enquire-mcp API reference - v4.0.0-rc.7
    Preparing search index...

    Interface ServerDeps

    Heavyweight resources shared across every MCP-server instance: the vault (parsed-note cache + privacy filter), the FTS5 index handle, the optional filesystem watcher. v2.6.0 split this out so the HTTP transport can spin up a fresh McpServer per session over the SAME vault/index — opening the SQLite handle once and reusing it across thousands of remote-MCP calls.

    warningTracker is a single-fire latch for the --disabled-tools / --enabled-tools typo warnings: stdio prints them once at boot; HTTP prints them on the first session build, then never again.

    interface ServerDeps {
        disabledTools: Set<string>;
        embedDbFile?: string | null;
        enabledTools: Set<string>;
        enabledToolsConfigured?: boolean;
        feedbackStore: FeedbackStore | null;
        ftsIndex: FtsIndex | null;
        hnswContext:
            | {
                dbInstanceUuid: string;
                dbMutationEpoch: number;
                ef?: number;
                health?: Readonly<WatcherSearchHealth>;
                index: HnswIndex;
                modelAlias: string;
                persistenceLifetime?: Pick<PersistenceFamilyLeaseHandle, "release">;
                rowByLabel: Map<
                    number,
                    {
                        chunk_index: number;
                        kind: "md"
                        | "pdf";
                        line_end: number;
                        line_start: number;
                        rel_path: string;
                        text_preview: string;
                    },
                >;
            }
            | null;
        vault: Vault;
        warningTracker: { printed: boolean };
        watcher: VaultWatcher | null;
        watcherEmbedDb: EmbedDb | null;
        watcherHealth?: Readonly<WatcherSearchHealth> | null;
    }
    Index
    disabledTools: Set<string>
    embedDbFile?: string | null

    Embedding capability frozen for this prepared server generation.

    With --watch, null means no EmbedDb existed at preparation time, so search remains lexical until restart even if another process builds a DB later. undefined preserves historical dynamic discovery for non-watcher and backward-compatible caller-constructed dependencies. Every non-null path must end in the exact case-sensitive .embed.db suffix so its SQLite sidecars, watcher guard, and HNSW namespace remain injective.

    enabledTools: Set<string>

    Prepared or caller-supplied tool allowlist.

    This remains a Set<string> for source compatibility with the original public ServerDeps contract. For legacy caller-constructed dependencies, an empty set with no enabledToolsConfigured marker means that no allowlist was configured; any non-empty set is an active allowlist.

    enabledToolsConfigured?: boolean

    Provenance bit emitted by prepareServerDeps to distinguish an omitted allowlist from an explicitly empty ServeOptions.enabledTools allowlist. Optional so existing caller-constructed ServerDeps objects remain source-compatible.

    feedbackStore: FeedbackStore | null

    v3.11.0 — opt-in closed-loop feedback store, opened once on serve start when --feedback-weight > 0. Shared across every per-session McpServer (HTTP) so a mark_useful in one session influences the search boost in all of them. null when feedback is off. Holds an in-memory tally + a per-vault JSON sidecar. The store owns a cross-process persistence lifetime and must be awaited through close() during shutdown after request admission drains.

    ftsIndex: FtsIndex | null
    hnswContext:
        | {
            dbInstanceUuid: string;
            dbMutationEpoch: number;
            ef?: number;
            health?: Readonly<WatcherSearchHealth>;
            index: HnswIndex;
            modelAlias: string;
            persistenceLifetime?: Pick<PersistenceFamilyLeaseHandle, "release">;
            rowByLabel: Map<
                number,
                {
                    chunk_index: number;
                    kind: "md"
                    | "pdf";
                    line_end: number;
                    line_start: number;
                    rel_path: string;
                    text_preview: string;
                },
            >;
        }
        | null

    v2.13.0 — opt-in HNSW approximate nearest-neighbor index built in-memory on serve start from the embed-db rows instead of O(n) brute force. null when --use-hnsw wasn't passed or the embed-db doesn't exist.

    Type Declaration

    • {
          dbInstanceUuid: string;
          dbMutationEpoch: number;
          ef?: number;
          health?: Readonly<WatcherSearchHealth>;
          index: HnswIndex;
          modelAlias: string;
          persistenceLifetime?: Pick<PersistenceFamilyLeaseHandle, "release">;
          rowByLabel: Map<
              number,
              {
                  chunk_index: number;
                  kind: "md"
                  | "pdf";
                  line_end: number;
                  line_start: number;
                  rel_path: string;
                  text_preview: string;
              },
          >;
      }
      • dbInstanceUuid: string

        Physical EmbedDb generation backing this prepared graph.

      • dbMutationEpoch: number

        Durable EmbedDb mutation epoch backing this prepared graph.

      • Optionalef?: number

        Search-time beam width override; falls back to module default if undefined.

      • Optionalhealth?: Readonly<WatcherSearchHealth>

        Shared semantic-route health; HNSW falls back after an uncertain diff.

      • index: HnswIndex

        The HNSW index.

      • modelAlias: string

        v3.6.2 HN-4 — model alias the HNSW index was built with (from the embed-db's persisted meta, or the resolved default for fresh dbs). Propagated to HnswSearchContext at search time so the query embedder model can be verified against the index. CRIT-1 fixed the build-side destruction; this seals the search side.

      • OptionalpersistenceLifetime?: Pick<PersistenceFamilyLeaseHandle, "release">

        Shared semantic-family lifetime retained after the snapshot DB closes.

      • rowByLabel: Map<
            number,
            {
                chunk_index: number;
                kind: "md"
                | "pdf";
                line_end: number;
                line_start: number;
                rel_path: string;
                text_preview: string;
            },
        >

        Map from HNSW label (= embeddings.id) to source row metadata.

    • null
    vault: Vault
    warningTracker: { printed: boolean }
    watcher: VaultWatcher | null
    watcherEmbedDb: EmbedDb | null

    v3.8.0-rc.2 R-7 — embed-db handle owned by the watcher for runtime incremental sync. Opened in prepareServerDeps when --watch is on AND the embed-db file exists, separate from the HNSW init path (which opens its own short-lived handle for the rebuild scan). SQLite WAL mode allows concurrent opens to the same file; the two handles see consistent state via MVCC. Closed by the shutdown handler in startServer.

    watcherHealth?: Readonly<WatcherSearchHealth> | null

    Shared semantic-route health for this prepared generation. Startup integrity can latch it even when watching is disabled.