Member Junction
    Preparing search index...

    Abstract base for a web search driver.

    Subclasses register with @RegisterClass(BaseWebSearchProvider, 'DriverClassName') to become discoverable by WebSearchEngine.

    Lifecycle, per provider record, at engine config time:

    1. WebSearchEngine loads Active MJ: Web Search Providers records
    2. ClassFactory creates an instance from DriverClass
    3. Initialize receives the record's configuration and any decrypted credential values
    4. CheckAvailability verifies the driver is actually operational
    5. If IsAvailable is true, the driver joins the selection pool

    A driver that cannot work — no API key, missing optional dependency — must self-disable in CheckAvailability rather than throw. An unconfigured vendor is a normal state in a product shipped to many hosts, not an error, and the engine simply routes around it.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    Capabilities: WebSearchCapabilities

    What this driver can do. Declared by the class, never read from the database.

    Configuration from the metadata record, set during Initialize.

    Accessors

    Methods

    • Read a credential value, preferring the decrypted MJ: Credentials record and falling back to an environment variable.

      The fallback exists because the web search actions this engine supersedes read their keys from mj.config.cjs / the environment, and a host upgrading should not have to migrate its secrets into the Credential store on the same day it gains the engine.

      Parameters

      • credentialKey: string

        key within the credential record's decrypted values, e.g. apiKey

      • envVarName: string

        environment variable consulted when no credential value is present

      Returns string

    • The effective result cap: the caller's request, bounded by the metadata override (when set) and then by the vendor's own hard cap.

      Clamped rather than rejected — a caller asking for 50 wants as many as possible, and most vendors reject the whole request when asked for more than they serve.

      Parameters

      • requested: number
      • fallback: number = 10

      Returns number