@anuma/sdk 6.24.1 → 6.25.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/dist/expo/{chunk-XDBX4FZY.mjs → chunk-EDABJLYN.mjs} +441 -2
  2. package/dist/{react/consolidate-XKS6IZFC.mjs → expo/consolidate-5WM3CFKK.mjs} +2 -4
  3. package/dist/expo/index.cjs +16259 -16469
  4. package/dist/expo/index.d.mts +106 -18
  5. package/dist/expo/index.d.ts +106 -18
  6. package/dist/expo/index.mjs +14022 -5927
  7. package/dist/index.cjs +88 -46
  8. package/dist/index.mjs +88 -46
  9. package/dist/memory/context.d.mts +20 -1
  10. package/dist/memory/context.d.ts +20 -1
  11. package/dist/{server/chunk-RKQ4MRS2.mjs → react/chunk-BPMINZPO.mjs} +443 -2
  12. package/dist/{expo/consolidate-XBYKAFKT.mjs → react/consolidate-A2X3M47N.mjs} +2 -4
  13. package/dist/react/index.cjs +17892 -18131
  14. package/dist/react/index.d.mts +113 -18
  15. package/dist/react/index.d.ts +113 -18
  16. package/dist/react/index.mjs +11492 -3153
  17. package/dist/{react/chunk-GPLMMMZN.mjs → server/chunk-DWNEDXA5.mjs} +425 -4
  18. package/dist/server/{consolidate-54P6QZKU.mjs → consolidate-53I4CTD7.mjs} +2 -4
  19. package/dist/server/index.cjs +11333 -11520
  20. package/dist/server/index.d.mts +113 -18
  21. package/dist/server/index.d.ts +113 -18
  22. package/dist/server/index.mjs +26288 -4192
  23. package/dist/telemetry/index.d.mts +4 -0
  24. package/dist/telemetry/index.d.ts +4 -0
  25. package/dist/tools/index.cjs +112 -2
  26. package/dist/tools/index.d.mts +106 -1
  27. package/dist/tools/index.d.ts +106 -1
  28. package/dist/tools/index.mjs +110 -2
  29. package/dist/tools/selection/index.cjs +88 -46
  30. package/dist/tools/selection/index.mjs +88 -46
  31. package/package.json +1 -1
  32. package/dist/expo/chunk-5LKHK5LN.mjs +0 -8142
  33. package/dist/expo/chunk-WUG6GTHO.mjs +0 -445
  34. package/dist/expo/recall-4FSY2MC4.mjs +0 -8
  35. package/dist/react/chunk-DOYXFYB3.mjs +0 -8472
  36. package/dist/react/chunk-MHZB6KIX.mjs +0 -445
  37. package/dist/react/recall-6FVSDGWU.mjs +0 -8
  38. package/dist/server/chunk-FEDRFVHD.mjs +0 -22161
  39. package/dist/server/chunk-YXL5VKCO.mjs +0 -429
  40. package/dist/server/recall-Z2WJGXOL.mjs +0 -8
@@ -4371,6 +4371,13 @@ declare function searchChunksOp(ctx: StorageOperationsContext, queryVector: numb
4371
4371
  limit?: number;
4372
4372
  minSimilarity?: number;
4373
4373
  conversationId?: string;
4374
+ /**
4375
+ * Skip every message in this conversation BEFORE scoring, so it can't take
4376
+ * top-K slots. Filtering after the cut (what recall() used to do) lets a
4377
+ * long current conversation fill all `limit` slots and leaves
4378
+ * past-conversation recall with nothing.
4379
+ */
4380
+ excludeConversationId?: string;
4374
4381
  /**
4375
4382
  * Current embedding model. When set, messages whose stored
4376
4383
  * `embedding_model` is non-null and differs are skipped — their vectors
@@ -5160,6 +5167,28 @@ interface EmbeddingOptions {
5160
5167
  * while real PII never reaches the server. Used when PII redaction is active.
5161
5168
  */
5162
5169
  maskInput?: (text: string) => string;
5170
+ /**
5171
+ * Deadline, in ms, for EACH embeddings HTTP attempt (default 15000). An
5172
+ * attempt that exceeds it is aborted and counts as a transient failure, so the
5173
+ * bounded retry still applies. `0` disables the deadline.
5174
+ */
5175
+ timeoutMs?: number;
5176
+ /**
5177
+ * Deadline, in ms, for the `getToken()` read that precedes a request (default
5178
+ * 10000). A provider that never settles rejects instead of hanging the
5179
+ * embedding — and the recall waiting on it. `0` disables the deadline.
5180
+ */
5181
+ tokenTimeoutMs?: number;
5182
+ /**
5183
+ * Overall deadline, in ms, for one `generateEmbedding` call — the token read,
5184
+ * every retry attempt and the backoff between them. Unset (the default) means
5185
+ * only the per-attempt deadlines apply, which is right for background/bulk
5186
+ * embeds. The recall query path sets it (see
5187
+ * `RecallOptions.queryEmbedTotalTimeoutMs`) so an outage degrades a turn to
5188
+ * BM25 within a few seconds instead of ~4 x `timeoutMs`. Not applied by
5189
+ * `generateEmbeddings`.
5190
+ */
5191
+ totalTimeoutMs?: number;
5163
5192
  }
5164
5193
 
5165
5194
  /**
@@ -5248,6 +5277,12 @@ interface MemoryVaultSearchOptions {
5248
5277
  rerankTopN?: number;
5249
5278
  /** Multiplicative cross-encoder blend weight. Default 0.1. Only used when `rerank` is true. */
5250
5279
  ceWeight?: number;
5280
+ /**
5281
+ * Max ms a rerank waits for the cross-encoder's FIRST model load (default
5282
+ * 10000). On expiry the search degrades to the fused ranking and reports
5283
+ * `reranked: false`; the load continues in the background for later calls.
5284
+ */
5285
+ rerankLoadTimeoutMs?: number;
5251
5286
  /** Recency boost slope applied in the fused ranker. Default 1.0. */
5252
5287
  recencyAlpha?: number;
5253
5288
  /** Recency decay curve overrides (per-year decay slope, floor, no-date multiplier). */
@@ -5315,6 +5350,23 @@ interface MemoryVaultSearchOptions {
5315
5350
  * prefix stays byte-identical.
5316
5351
  */
5317
5352
  decryptLast?: boolean;
5353
+ /**
5354
+ * A vector the caller already computed for THIS query, with the model named in
5355
+ * `embeddingOptions`. When set, the search uses it instead of embedding the
5356
+ * query a second time — `recall()` embeds once for its chunk lane and passes
5357
+ * the vector here. An EMPTY array means the caller's embed failed: the search
5358
+ * degrades to BM25 (reported as embeddings unavailable) without re-trying a
5359
+ * provider that just failed.
5360
+ */
5361
+ queryEmbedding?: number[];
5362
+ /**
5363
+ * Overall deadline, in ms, for embedding the QUERY (token read + all attempts
5364
+ * + backoff). On expiry the search degrades to BM25 and reports embeddings
5365
+ * unavailable. Unset = only the per-attempt deadlines apply. `recall()` sets
5366
+ * it (default 8000 — see `RecallOptions.queryEmbedTotalTimeoutMs`); row
5367
+ * (re)embeds are never subject to it.
5368
+ */
5369
+ queryEmbedTotalTimeoutMs?: number;
5318
5370
  /** Admission window multiplier for decrypt-last (`limit * admitFactor`). Default 3. */
5319
5371
  admitFactor?: number;
5320
5372
  /** Admission window floor for decrypt-last. Default 30. */
@@ -5331,7 +5383,14 @@ declare function preEmbedVaultMemories(vaultCtx: VaultMemoryOperationsContext, e
5331
5383
  * Eagerly embed a single piece of content and store it in the cache.
5332
5384
  * Call this when a vault memory is created or updated.
5333
5385
  */
5334
- declare function eagerEmbedContent(content: string, embeddingOptions: EmbeddingOptions, cache: VaultEmbeddingCache, vaultCtx?: VaultMemoryOperationsContext, memoryId?: string): Promise<void>;
5386
+ declare function eagerEmbedContent(content: string, embeddingOptions: EmbeddingOptions, cache: VaultEmbeddingCache, vaultCtx?: VaultMemoryOperationsContext, memoryId?: string,
5387
+ /**
5388
+ * `updatedAt` of the committed row this content belongs to. When given, the
5389
+ * cache entry is tied to that row version; without it the entry is
5390
+ * unversioned and a search re-resolves it from the stored column instead of
5391
+ * trusting it (see `vectorVersion.ts`).
5392
+ */
5393
+ updatedAt?: Date): Promise<void>;
5335
5394
  /**
5336
5395
  * A single vault search result with its similarity score.
5337
5396
  */
@@ -5372,21 +5431,6 @@ interface VaultSearchResult {
5372
5431
  * @returns Sorted results (empty array on invalid input or empty vault)
5373
5432
  */
5374
5433
  declare function searchVaultMemories(query: string, vaultCtx: VaultMemoryOperationsContext, embeddingOptions: EmbeddingOptions, cache: VaultEmbeddingCache, searchOptions?: MemoryVaultSearchOptions): Promise<VaultSearchResult[]>;
5375
- /**
5376
- * Creates a memory vault search tool for use with chat completions.
5377
- *
5378
- * The tool allows the LLM to search through vault memories using semantic
5379
- * similarity. Vault entries should have their embeddings pre-computed in the
5380
- * cache (via preEmbedVaultMemories or eagerEmbedContent). Any missing
5381
- * embeddings are computed on the fly as a fallback.
5382
- *
5383
- * @param vaultCtx - Vault operations context for database access
5384
- * @param embeddingOptions - Options for embedding generation (auth, base URL)
5385
- * @param cache - Pre-populated embedding cache
5386
- * @param searchOptions - Optional search configuration
5387
- * @returns A ToolConfig that can be passed to chat completion tools
5388
- */
5389
- declare function createMemoryVaultSearchTool(vaultCtx: VaultMemoryOperationsContext, embeddingOptions: EmbeddingOptions, cache: VaultEmbeddingCache, searchOptions?: MemoryVaultSearchOptions): ToolConfig;
5390
5434
 
5391
5435
  /**
5392
5436
  * C2 — Observation trend labels.
@@ -5609,6 +5653,20 @@ interface RecallOptions {
5609
5653
  rerankTopN?: number;
5610
5654
  /** Multiplicative cross-encoder blend weight. Default: 0.1. */
5611
5655
  ceWeight?: number;
5656
+ /**
5657
+ * Max ms a `mid`/`high` recall waits for the cross-encoder's FIRST model load
5658
+ * before degrading to the fused ranking (reported as `rerank-unavailable`).
5659
+ * Default: 10000. The load keeps going in the background for later calls.
5660
+ */
5661
+ rerankLoadTimeoutMs?: number;
5662
+ /**
5663
+ * Overall deadline, in ms, for embedding the query — token read, every retry
5664
+ * attempt and the backoff between them. Default: 8000. On expiry the fact lane
5665
+ * degrades to BM25 and the (cosine-only) chunk lane is skipped, reported as
5666
+ * `embeddings-unavailable`, so an embeddings outage costs a turn at most this
5667
+ * long rather than ~4 x the per-attempt timeout. `0` disables it.
5668
+ */
5669
+ queryEmbedTotalTimeoutMs?: number;
5612
5670
  /** Recency boost slope in the fused ranker. Default: 1.0. */
5613
5671
  recencyAlpha?: number;
5614
5672
  /** Recency decay curve overrides (per-year decay slope, floor, no-date multiplier). */
@@ -5636,7 +5694,8 @@ interface RecallOptions {
5636
5694
  maxHops?: number;
5637
5695
  /** Max neighbor entities expanded per hop. Default: 8. */
5638
5696
  entityFanout?: number;
5639
- /** Hard cap on accumulated memory IDs across all hops. Default: 64. */
5697
+ /** Hard cap on graph-lane memory IDs — across all hops, and on the single-hop
5698
+ * lane `low`/`mid` run. Default: 64. */
5640
5699
  nodeBudget?: number;
5641
5700
  /**
5642
5701
  * PR5 — enable LLM graph path-refinement: at each traversal hop a model picks
@@ -5871,6 +5930,10 @@ interface RecallDiagnostics {
5871
5930
  * fast `vault_size = 0` population never established a baseline for this
5872
5931
  * cost, and why the ~850ms floor on the smallest NON-empty vaults had no
5873
5932
  * attributable owner.
5933
+ *
5934
+ * EXCEPTION — a mixed fact + chunk recall embeds the query ONCE, during
5935
+ * {@link prep}, and hands the vector to both lanes. There `queryEmbed` is
5936
+ * that shared embed and sits inside `prep`, not `factLane`.
5874
5937
  */
5875
5938
  queryEmbed: number;
5876
5939
  /** Chunk-lane search (`searchChunksOp`). */
@@ -8011,6 +8074,38 @@ declare function createMemoryEngineTool(storageCtx: StorageOperationsContext, em
8011
8074
  onRetrieve?: (conversationIds: string[]) => void;
8012
8075
  }): ToolConfig;
8013
8076
 
8077
+ /**
8078
+ * `memory_vault_search` chat tool — the executor half of the vault search.
8079
+ *
8080
+ * Split out of `searchTool.ts` to break the `recall` <-> `searchTool` import
8081
+ * cycle: `recall()` statically imports the vault search from `searchTool.ts`,
8082
+ * and this executor routes through `recall()`. While both lived in one module
8083
+ * the executor reached recall through a dynamic `import()`, and the cycle it
8084
+ * papered over is what surfaced as the order-dependent
8085
+ * `Cannot access 'nowMs' before initialization` flake. With the executor here,
8086
+ * the graph is a straight line: executor -> recall -> searchTool.
8087
+ *
8088
+ * `searchTool.ts` must NOT import (or re-export) from this module, or the
8089
+ * cycle comes back. The public name is re-exported from the barrel
8090
+ * (`./index.ts`), which is the path every entry point already uses.
8091
+ */
8092
+
8093
+ /**
8094
+ * Creates a memory vault search tool for use with chat completions.
8095
+ *
8096
+ * The tool allows the LLM to search through vault memories using semantic
8097
+ * similarity. Vault entries should have their embeddings pre-computed in the
8098
+ * cache (via preEmbedVaultMemories or eagerEmbedContent). Any missing
8099
+ * embeddings are computed on the fly as a fallback.
8100
+ *
8101
+ * @param vaultCtx - Vault operations context for database access
8102
+ * @param embeddingOptions - Options for embedding generation (auth, base URL)
8103
+ * @param cache - Pre-populated embedding cache
8104
+ * @param searchOptions - Optional search configuration
8105
+ * @returns A ToolConfig that can be passed to chat completion tools
8106
+ */
8107
+ declare function createMemoryVaultSearchTool(vaultCtx: VaultMemoryOperationsContext, embeddingOptions: EmbeddingOptions, cache: VaultEmbeddingCache, searchOptions?: MemoryVaultSearchOptions): ToolConfig;
8108
+
8014
8109
  /**
8015
8110
  * Memory Vault Tool
8016
8111
  *
@@ -9319,7 +9414,7 @@ declare function reflect(query: string, ctx: RecallContext, options: ReflectOpti
9319
9414
  declare class RerankerUnavailableError extends Error {
9320
9415
  /** The underlying import failure, kept for debugging. */
9321
9416
  readonly reason: unknown;
9322
- constructor(reason: unknown);
9417
+ constructor(reason: unknown, message?: string);
9323
9418
  }
9324
9419
  /**
9325
9420
  * Whether the cross-encoder reranker can run in this environment.
@@ -4371,6 +4371,13 @@ declare function searchChunksOp(ctx: StorageOperationsContext, queryVector: numb
4371
4371
  limit?: number;
4372
4372
  minSimilarity?: number;
4373
4373
  conversationId?: string;
4374
+ /**
4375
+ * Skip every message in this conversation BEFORE scoring, so it can't take
4376
+ * top-K slots. Filtering after the cut (what recall() used to do) lets a
4377
+ * long current conversation fill all `limit` slots and leaves
4378
+ * past-conversation recall with nothing.
4379
+ */
4380
+ excludeConversationId?: string;
4374
4381
  /**
4375
4382
  * Current embedding model. When set, messages whose stored
4376
4383
  * `embedding_model` is non-null and differs are skipped — their vectors
@@ -5160,6 +5167,28 @@ interface EmbeddingOptions {
5160
5167
  * while real PII never reaches the server. Used when PII redaction is active.
5161
5168
  */
5162
5169
  maskInput?: (text: string) => string;
5170
+ /**
5171
+ * Deadline, in ms, for EACH embeddings HTTP attempt (default 15000). An
5172
+ * attempt that exceeds it is aborted and counts as a transient failure, so the
5173
+ * bounded retry still applies. `0` disables the deadline.
5174
+ */
5175
+ timeoutMs?: number;
5176
+ /**
5177
+ * Deadline, in ms, for the `getToken()` read that precedes a request (default
5178
+ * 10000). A provider that never settles rejects instead of hanging the
5179
+ * embedding — and the recall waiting on it. `0` disables the deadline.
5180
+ */
5181
+ tokenTimeoutMs?: number;
5182
+ /**
5183
+ * Overall deadline, in ms, for one `generateEmbedding` call — the token read,
5184
+ * every retry attempt and the backoff between them. Unset (the default) means
5185
+ * only the per-attempt deadlines apply, which is right for background/bulk
5186
+ * embeds. The recall query path sets it (see
5187
+ * `RecallOptions.queryEmbedTotalTimeoutMs`) so an outage degrades a turn to
5188
+ * BM25 within a few seconds instead of ~4 x `timeoutMs`. Not applied by
5189
+ * `generateEmbeddings`.
5190
+ */
5191
+ totalTimeoutMs?: number;
5163
5192
  }
5164
5193
 
5165
5194
  /**
@@ -5248,6 +5277,12 @@ interface MemoryVaultSearchOptions {
5248
5277
  rerankTopN?: number;
5249
5278
  /** Multiplicative cross-encoder blend weight. Default 0.1. Only used when `rerank` is true. */
5250
5279
  ceWeight?: number;
5280
+ /**
5281
+ * Max ms a rerank waits for the cross-encoder's FIRST model load (default
5282
+ * 10000). On expiry the search degrades to the fused ranking and reports
5283
+ * `reranked: false`; the load continues in the background for later calls.
5284
+ */
5285
+ rerankLoadTimeoutMs?: number;
5251
5286
  /** Recency boost slope applied in the fused ranker. Default 1.0. */
5252
5287
  recencyAlpha?: number;
5253
5288
  /** Recency decay curve overrides (per-year decay slope, floor, no-date multiplier). */
@@ -5315,6 +5350,23 @@ interface MemoryVaultSearchOptions {
5315
5350
  * prefix stays byte-identical.
5316
5351
  */
5317
5352
  decryptLast?: boolean;
5353
+ /**
5354
+ * A vector the caller already computed for THIS query, with the model named in
5355
+ * `embeddingOptions`. When set, the search uses it instead of embedding the
5356
+ * query a second time — `recall()` embeds once for its chunk lane and passes
5357
+ * the vector here. An EMPTY array means the caller's embed failed: the search
5358
+ * degrades to BM25 (reported as embeddings unavailable) without re-trying a
5359
+ * provider that just failed.
5360
+ */
5361
+ queryEmbedding?: number[];
5362
+ /**
5363
+ * Overall deadline, in ms, for embedding the QUERY (token read + all attempts
5364
+ * + backoff). On expiry the search degrades to BM25 and reports embeddings
5365
+ * unavailable. Unset = only the per-attempt deadlines apply. `recall()` sets
5366
+ * it (default 8000 — see `RecallOptions.queryEmbedTotalTimeoutMs`); row
5367
+ * (re)embeds are never subject to it.
5368
+ */
5369
+ queryEmbedTotalTimeoutMs?: number;
5318
5370
  /** Admission window multiplier for decrypt-last (`limit * admitFactor`). Default 3. */
5319
5371
  admitFactor?: number;
5320
5372
  /** Admission window floor for decrypt-last. Default 30. */
@@ -5331,7 +5383,14 @@ declare function preEmbedVaultMemories(vaultCtx: VaultMemoryOperationsContext, e
5331
5383
  * Eagerly embed a single piece of content and store it in the cache.
5332
5384
  * Call this when a vault memory is created or updated.
5333
5385
  */
5334
- declare function eagerEmbedContent(content: string, embeddingOptions: EmbeddingOptions, cache: VaultEmbeddingCache, vaultCtx?: VaultMemoryOperationsContext, memoryId?: string): Promise<void>;
5386
+ declare function eagerEmbedContent(content: string, embeddingOptions: EmbeddingOptions, cache: VaultEmbeddingCache, vaultCtx?: VaultMemoryOperationsContext, memoryId?: string,
5387
+ /**
5388
+ * `updatedAt` of the committed row this content belongs to. When given, the
5389
+ * cache entry is tied to that row version; without it the entry is
5390
+ * unversioned and a search re-resolves it from the stored column instead of
5391
+ * trusting it (see `vectorVersion.ts`).
5392
+ */
5393
+ updatedAt?: Date): Promise<void>;
5335
5394
  /**
5336
5395
  * A single vault search result with its similarity score.
5337
5396
  */
@@ -5372,21 +5431,6 @@ interface VaultSearchResult {
5372
5431
  * @returns Sorted results (empty array on invalid input or empty vault)
5373
5432
  */
5374
5433
  declare function searchVaultMemories(query: string, vaultCtx: VaultMemoryOperationsContext, embeddingOptions: EmbeddingOptions, cache: VaultEmbeddingCache, searchOptions?: MemoryVaultSearchOptions): Promise<VaultSearchResult[]>;
5375
- /**
5376
- * Creates a memory vault search tool for use with chat completions.
5377
- *
5378
- * The tool allows the LLM to search through vault memories using semantic
5379
- * similarity. Vault entries should have their embeddings pre-computed in the
5380
- * cache (via preEmbedVaultMemories or eagerEmbedContent). Any missing
5381
- * embeddings are computed on the fly as a fallback.
5382
- *
5383
- * @param vaultCtx - Vault operations context for database access
5384
- * @param embeddingOptions - Options for embedding generation (auth, base URL)
5385
- * @param cache - Pre-populated embedding cache
5386
- * @param searchOptions - Optional search configuration
5387
- * @returns A ToolConfig that can be passed to chat completion tools
5388
- */
5389
- declare function createMemoryVaultSearchTool(vaultCtx: VaultMemoryOperationsContext, embeddingOptions: EmbeddingOptions, cache: VaultEmbeddingCache, searchOptions?: MemoryVaultSearchOptions): ToolConfig;
5390
5434
 
5391
5435
  /**
5392
5436
  * C2 — Observation trend labels.
@@ -5609,6 +5653,20 @@ interface RecallOptions {
5609
5653
  rerankTopN?: number;
5610
5654
  /** Multiplicative cross-encoder blend weight. Default: 0.1. */
5611
5655
  ceWeight?: number;
5656
+ /**
5657
+ * Max ms a `mid`/`high` recall waits for the cross-encoder's FIRST model load
5658
+ * before degrading to the fused ranking (reported as `rerank-unavailable`).
5659
+ * Default: 10000. The load keeps going in the background for later calls.
5660
+ */
5661
+ rerankLoadTimeoutMs?: number;
5662
+ /**
5663
+ * Overall deadline, in ms, for embedding the query — token read, every retry
5664
+ * attempt and the backoff between them. Default: 8000. On expiry the fact lane
5665
+ * degrades to BM25 and the (cosine-only) chunk lane is skipped, reported as
5666
+ * `embeddings-unavailable`, so an embeddings outage costs a turn at most this
5667
+ * long rather than ~4 x the per-attempt timeout. `0` disables it.
5668
+ */
5669
+ queryEmbedTotalTimeoutMs?: number;
5612
5670
  /** Recency boost slope in the fused ranker. Default: 1.0. */
5613
5671
  recencyAlpha?: number;
5614
5672
  /** Recency decay curve overrides (per-year decay slope, floor, no-date multiplier). */
@@ -5636,7 +5694,8 @@ interface RecallOptions {
5636
5694
  maxHops?: number;
5637
5695
  /** Max neighbor entities expanded per hop. Default: 8. */
5638
5696
  entityFanout?: number;
5639
- /** Hard cap on accumulated memory IDs across all hops. Default: 64. */
5697
+ /** Hard cap on graph-lane memory IDs — across all hops, and on the single-hop
5698
+ * lane `low`/`mid` run. Default: 64. */
5640
5699
  nodeBudget?: number;
5641
5700
  /**
5642
5701
  * PR5 — enable LLM graph path-refinement: at each traversal hop a model picks
@@ -5871,6 +5930,10 @@ interface RecallDiagnostics {
5871
5930
  * fast `vault_size = 0` population never established a baseline for this
5872
5931
  * cost, and why the ~850ms floor on the smallest NON-empty vaults had no
5873
5932
  * attributable owner.
5933
+ *
5934
+ * EXCEPTION — a mixed fact + chunk recall embeds the query ONCE, during
5935
+ * {@link prep}, and hands the vector to both lanes. There `queryEmbed` is
5936
+ * that shared embed and sits inside `prep`, not `factLane`.
5874
5937
  */
5875
5938
  queryEmbed: number;
5876
5939
  /** Chunk-lane search (`searchChunksOp`). */
@@ -8011,6 +8074,38 @@ declare function createMemoryEngineTool(storageCtx: StorageOperationsContext, em
8011
8074
  onRetrieve?: (conversationIds: string[]) => void;
8012
8075
  }): ToolConfig;
8013
8076
 
8077
+ /**
8078
+ * `memory_vault_search` chat tool — the executor half of the vault search.
8079
+ *
8080
+ * Split out of `searchTool.ts` to break the `recall` <-> `searchTool` import
8081
+ * cycle: `recall()` statically imports the vault search from `searchTool.ts`,
8082
+ * and this executor routes through `recall()`. While both lived in one module
8083
+ * the executor reached recall through a dynamic `import()`, and the cycle it
8084
+ * papered over is what surfaced as the order-dependent
8085
+ * `Cannot access 'nowMs' before initialization` flake. With the executor here,
8086
+ * the graph is a straight line: executor -> recall -> searchTool.
8087
+ *
8088
+ * `searchTool.ts` must NOT import (or re-export) from this module, or the
8089
+ * cycle comes back. The public name is re-exported from the barrel
8090
+ * (`./index.ts`), which is the path every entry point already uses.
8091
+ */
8092
+
8093
+ /**
8094
+ * Creates a memory vault search tool for use with chat completions.
8095
+ *
8096
+ * The tool allows the LLM to search through vault memories using semantic
8097
+ * similarity. Vault entries should have their embeddings pre-computed in the
8098
+ * cache (via preEmbedVaultMemories or eagerEmbedContent). Any missing
8099
+ * embeddings are computed on the fly as a fallback.
8100
+ *
8101
+ * @param vaultCtx - Vault operations context for database access
8102
+ * @param embeddingOptions - Options for embedding generation (auth, base URL)
8103
+ * @param cache - Pre-populated embedding cache
8104
+ * @param searchOptions - Optional search configuration
8105
+ * @returns A ToolConfig that can be passed to chat completion tools
8106
+ */
8107
+ declare function createMemoryVaultSearchTool(vaultCtx: VaultMemoryOperationsContext, embeddingOptions: EmbeddingOptions, cache: VaultEmbeddingCache, searchOptions?: MemoryVaultSearchOptions): ToolConfig;
8108
+
8014
8109
  /**
8015
8110
  * Memory Vault Tool
8016
8111
  *
@@ -9319,7 +9414,7 @@ declare function reflect(query: string, ctx: RecallContext, options: ReflectOpti
9319
9414
  declare class RerankerUnavailableError extends Error {
9320
9415
  /** The underlying import failure, kept for debugging. */
9321
9416
  readonly reason: unknown;
9322
- constructor(reason: unknown);
9417
+ constructor(reason: unknown, message?: string);
9323
9418
  }
9324
9419
  /**
9325
9420
  * Whether the cross-encoder reranker can run in this environment.