Documentation
    Preparing search index...

    The source callback client. Constructed once from the parsed sources config (defaults applied, ${ENV} already substituted at load). Each source gets its own concurrency semaphore; the timeoutMs clock starts when a request leaves the queue, not while it waits for a slot. Callbacks do not draw from the embedding rate limiter.

    Implements

    Index
    • Validate a reference and build its URL without making a request.

      Parameters

      • reference: string

      Returns { id: string; name: string; ref: string; url: string }

      • id: string

        Opaque document id.

      • name: string

        Source name.

      • ref: string

        The full reference string.

      • url: string

        Callback URL built from sources.<name>.url.

    • Retrieve a document. Rejects with SourceReferenceError (and sends nothing) for an invalid reference; otherwise never rejects.

      Parameters

      • reference: string

      Returns Promise<
          | { body: Record<string, unknown>; kind: "document" }
          | { kind: "gone" }
          | {
              code: "source_unavailable" | "unsupported_content_type";
              kind: "error";
              message: string;
          },
      >