Documentation
    Preparing search index...

    A watcher API client. Every method validates its request with the core schema before sending, validates the response, and throws a WatcherError on any failure. No retries.

    interface WatcherClient {
        documents: DocumentsApi;
        issues(): Promise<
            {
                count: number;
                issues: Record<
                    string,
                    {
                        details?: unknown;
                        message: string;
                        operation?: string;
                        property?: string;
                        rule?: string;
                        rules?: string[];
                        timestamp: string
                        | number;
                        type:
                            | "type_collision"
                            | "interpolation_error"
                            | "extraction_error"
                            | "embedding_error"
                            | "upsert_error"
                            | "match_failed"
                            | "rule_missing"
                            | "no_content"
                            | "source_unavailable"
                            | "unsupported_content_type";
                        types?: string[];
                    }[],
                >;
            },
        >;
        metadata(
            request: {
                metadata: Record<string, unknown>;
                path?: string;
                source?: string;
            },
        ): Promise<{ matched_rules: string[]; ok: true }>;
        reindex(
            request?: {
                dryRun?: boolean;
                path?: string | string[];
                scope?: "path" | "issues" | "rules" | "full" | "prune";
                source?: string | string[];
            },
        ): Promise<
            {
                plan?: {
                    byRoot: Record<string, number>;
                    incomplete?: boolean;
                    toDelete: number;
                    toProcess: number;
                    total: number;
                };
                scope: "path"
                | "issues"
                | "rules"
                | "full"
                | "prune";
                status: "started" | "dry_run";
            },
        >;
        render(
            request: { path?: string; source?: string },
        ): Promise<
            {
                content: string;
                metadata: Record<string, unknown>;
                renderAs: string;
                rules: string[];
            },
        >;
        scan(
            request: {
                countOnly?: boolean;
                cursor?: string | number;
                fields?: string[];
                filter: Record<string, unknown>;
                limit?: number;
            },
        ): Promise<
            | {
                cursor: string
                | number
                | null;
                points: { id: string; payload: Record<string, unknown> }[];
            }
            | { count: number },
        >;
        search(
            request: {
                filter?: Record<string, unknown>;
                limit?: number;
                offset?: number;
                query: string;
            },
        ): Promise<
            { id: string; payload: Record<string, unknown>; score: number }[],
        >;
        status(): Promise<
            {
                health: Record<string, unknown>;
                name: string;
                status: "healthy" | "degraded" | "unhealthy";
                uptime: number;
                version: string;
            },
        >;
    }
    Index
    documents: DocumentsApi

    Source-document notify and delete.

    • Current processing issues keyed by document (GET /issues).

      Returns Promise<
          {
              count: number;
              issues: Record<
                  string,
                  {
                      details?: unknown;
                      message: string;
                      operation?: string;
                      property?: string;
                      rule?: string;
                      rules?: string[];
                      timestamp: string
                      | number;
                      type:
                          | "type_collision"
                          | "interpolation_error"
                          | "extraction_error"
                          | "embedding_error"
                          | "upsert_error"
                          | "match_failed"
                          | "rule_missing"
                          | "no_content"
                          | "source_unavailable"
                          | "unsupported_content_type";
                      types?: string[];
                  }[],
              >;
          },
      >

    • Set enrichment metadata on a document (POST /metadata).

      Parameters

      • request: { metadata: Record<string, unknown>; path?: string; source?: string }

        { path } or { source }, plus metadata.

        • metadata: Record<string, unknown>

          Enrichment metadata to merge into the document's points.

        • Optionalpath?: string

          File path of a file document.

        • Optionalsource?: string

          Source reference of a source document (<name>://<id>).

      Returns Promise<{ matched_rules: string[]; ok: true }>

    • Start a scoped reindex (POST /reindex).

      Parameters

      • Optionalrequest: {
            dryRun?: boolean;
            path?: string | string[];
            scope?: "path" | "issues" | "rules" | "full" | "prune";
            source?: string | string[];
        }

        Scope (default issues), targets and dryRun.

        • OptionaldryRun?: boolean

          Compute and return the plan without executing.

        • Optionalpath?: string | string[]

          File path(s) or globs for scopes path and rules.

        • Optionalscope?: "path" | "issues" | "rules" | "full" | "prune"

          Reindex scope. Default: issues.

        • Optionalsource?: string | string[]

          Source reference(s) for scope path.

      Returns Promise<
          {
              plan?: {
                  byRoot: Record<string, number>;
                  incomplete?: boolean;
                  toDelete: number;
                  toProcess: number;
                  total: number;
              };
              scope: "path"
              | "issues"
              | "rules"
              | "full"
              | "prune";
              status: "started" | "dry_run";
          },
      >

    • Render a document through the template pipeline (POST /render).

      Parameters

      • request: { path?: string; source?: string }

        { path } for a file or { source } for a source document.

        • Optionalpath?: string

          File path of a file document.

        • Optionalsource?: string

          Source reference of a source document (<name>://<id>).

      Returns Promise<
          {
              content: string;
              metadata: Record<string, unknown>;
              renderAs: string;
              rules: string[];
          },
      >

    • Filter-only point query (POST /scan).

      Parameters

      • request: {
            countOnly?: boolean;
            cursor?: string | number;
            fields?: string[];
            filter: Record<string, unknown>;
            limit?: number;
        }

        Qdrant filter, optional limit, cursor, fields, countOnly.

        • OptionalcountOnly?: boolean

          Return only { count }.

        • Optionalcursor?: string | number

          Opaque cursor from a previous page.

        • Optionalfields?: string[]

          Payload fields to return (projection).

        • filter: Record<string, unknown>

          Qdrant filter (required).

        • Optionallimit?: number

          Page size (1 to SCAN_MAX_LIMIT). Default: SCAN_DEFAULT_LIMIT.

      Returns Promise<
          | {
              cursor: string
              | number
              | null;
              points: { id: string; payload: Record<string, unknown> }[];
          }
          | { count: number },
      >

    • Semantic search (POST /search).

      Parameters

      • request: {
            filter?: Record<string, unknown>;
            limit?: number;
            offset?: number;
            query: string;
        }

        Query text, optional limit, offset and Qdrant filter.

        • Optionalfilter?: Record<string, unknown>

          Optional Qdrant filter.

        • Optionallimit?: number

          Maximum results to return. Default: SEARCH_DEFAULT_LIMIT.

        • Optionaloffset?: number

          Number of results to skip (pagination).

        • query: string

          Natural-language query text to embed.

      Returns Promise<{ id: string; payload: Record<string, unknown>; score: number }[]>

    • Service health (GET /status; open even when an API key is configured).

      Returns Promise<
          {
              health: Record<string, unknown>;
              name: string;
              status: "healthy" | "degraded" | "unhealthy";
              uptime: number;
              version: string;
          },
      >