@anuma/sdk 3.11.6 → 3.12.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.
@@ -22995,6 +22995,25 @@ var init_redactor = __esm({
22995
22995
  }
22996
22996
  });
22997
22997
 
22998
+ // src/lib/memory/consolidationFallback.ts
22999
+ function notifyConsolidationFallback(reason, onFallback, detail) {
23000
+ if (detail !== void 0) {
23001
+ getLogger().warn(`memory/consolidate: degraded to create (${reason})`, detail);
23002
+ } else {
23003
+ getLogger().warn(`memory/consolidate: degraded to create (${reason})`);
23004
+ }
23005
+ try {
23006
+ onFallback?.(reason);
23007
+ } catch {
23008
+ }
23009
+ }
23010
+ var init_consolidationFallback = __esm({
23011
+ "src/lib/memory/consolidationFallback.ts"() {
23012
+ "use strict";
23013
+ init_logger();
23014
+ }
23015
+ });
23016
+
22998
23017
  // src/lib/memory/consolidate.ts
22999
23018
  var consolidate_exports = {};
23000
23019
  __export(consolidate_exports, {
@@ -23059,15 +23078,7 @@ ${candidateText}`;
23059
23078
  return result;
23060
23079
  }
23061
23080
  function degrade(reason, fallback, options, detail) {
23062
- if (detail !== void 0) {
23063
- getLogger().warn(`memory/consolidate: degraded to create (${reason})`, detail);
23064
- } else {
23065
- getLogger().warn(`memory/consolidate: degraded to create (${reason})`);
23066
- }
23067
- try {
23068
- options.onFallback?.(reason);
23069
- } catch {
23070
- }
23081
+ notifyConsolidationFallback(reason, options.onFallback, detail);
23071
23082
  return { ...fallback, fallbackReason: reason };
23072
23083
  }
23073
23084
  function validate2(parsed, newContent, validIds) {
@@ -23107,8 +23118,8 @@ var DEFAULT_CONSOLIDATION_MODEL, DEFAULT_CONSOLIDATE_ATTEMPTS, DEFAULT_CONSOLIDA
23107
23118
  var init_consolidate = __esm({
23108
23119
  "src/lib/memory/consolidate.ts"() {
23109
23120
  "use strict";
23110
- init_logger();
23111
23121
  init_redactor();
23122
+ init_consolidationFallback();
23112
23123
  init_portalLlm();
23113
23124
  DEFAULT_CONSOLIDATION_MODEL = "inclusionai/ling-2.6-flash";
23114
23125
  DEFAULT_CONSOLIDATE_ATTEMPTS = 3;
@@ -27822,6 +27833,7 @@ init_constants();
27822
27833
  init_embeddings();
27823
27834
  init_vector();
27824
27835
  init_searchTool();
27836
+ init_consolidationFallback();
27825
27837
  var DEFAULT_AUTO_MERGE_THRESHOLD = 0.8;
27826
27838
  var DEFAULT_SCOPE = "private";
27827
27839
  var DEFAULT_CONSOLIDATE_THRESHOLD = 0.55;
@@ -28001,6 +28013,11 @@ async function retain(content, ctx, options = {}) {
28001
28013
  proofCount: 1
28002
28014
  };
28003
28015
  }
28016
+ notifyConsolidationFallback(
28017
+ "target_vanished",
28018
+ options.consolidateOptions?.onFallback,
28019
+ `supersede: primary target ${primaryTargetId} retired or deleted inside the atomic write`
28020
+ );
28004
28021
  }
28005
28022
  const created = await createVaultMemoryOp(ctx.vaultCtx, createOpts);
28006
28023
  ctx.vaultCache.set(created.uniqueId, Float32Array.from(embedding));
@@ -28052,6 +28069,10 @@ function pickFactTypeUpdate(existing, incoming) {
28052
28069
  function resurrectFields(existing) {
28053
28070
  return typeof existing.archivedAt === "number" ? { restore: true } : { preserveUpdatedAt: true };
28054
28071
  }
28072
+ function abandonToRace(options, detail) {
28073
+ notifyConsolidationFallback("target_vanished", options.consolidateOptions?.onFallback, detail);
28074
+ return null;
28075
+ }
28055
28076
  async function tryConsolidate(trimmed, ctx, options, prepared) {
28056
28077
  const consolidateOptions = options.consolidateOptions;
28057
28078
  if (!consolidateOptions) return null;
@@ -28084,12 +28105,22 @@ async function tryConsolidate(trimmed, ctx, options, prepared) {
28084
28105
  const existing = await getVaultMemoryOp(ctx.vaultCtx, id);
28085
28106
  if (existing && !existing.supersededBy) valid.push(id);
28086
28107
  }
28087
- if (valid.length === 0) return null;
28108
+ if (valid.length === 0) {
28109
+ return abandonToRace(
28110
+ options,
28111
+ `supersede: all ${requestedIds.length} target(s) deleted or already superseded`
28112
+ );
28113
+ }
28088
28114
  return { supersede: valid, content: decision.content };
28089
28115
  }
28090
28116
  if (decision.action === "noop" && decision.targetId) {
28091
28117
  const existing = await getVaultMemoryOp(ctx.vaultCtx, decision.targetId);
28092
- if (!existing || existing.supersededBy) return null;
28118
+ if (!existing || existing.supersededBy) {
28119
+ return abandonToRace(
28120
+ options,
28121
+ `noop: target ${decision.targetId} ${existing ? "superseded" : "deleted"} before the write`
28122
+ );
28123
+ }
28093
28124
  const mergedSourceIds = unionStrings(
28094
28125
  existing.sourceChunkIds ?? [],
28095
28126
  options.sourceChunkIds ?? []
@@ -28114,7 +28145,10 @@ async function tryConsolidate(trimmed, ctx, options, prepared) {
28114
28145
  });
28115
28146
  if (!updated) {
28116
28147
  await assertMergeTargetGoneOrThrow(ctx, decision.targetId);
28117
- return null;
28148
+ return abandonToRace(
28149
+ options,
28150
+ `noop: target ${decision.targetId} deleted mid-write (proof-count bump lost)`
28151
+ );
28118
28152
  }
28119
28153
  return {
28120
28154
  done: {
@@ -28127,7 +28161,12 @@ async function tryConsolidate(trimmed, ctx, options, prepared) {
28127
28161
  }
28128
28162
  if (decision.action === "update" && decision.targetId && decision.content) {
28129
28163
  const existing = await getVaultMemoryOp(ctx.vaultCtx, decision.targetId);
28130
- if (!existing || existing.supersededBy) return null;
28164
+ if (!existing || existing.supersededBy) {
28165
+ return abandonToRace(
28166
+ options,
28167
+ `update: target ${decision.targetId} ${existing ? "superseded" : "deleted"} before the write`
28168
+ );
28169
+ }
28131
28170
  const mergedSourceIds = unionStrings(
28132
28171
  existing.sourceChunkIds ?? [],
28133
28172
  options.sourceChunkIds ?? []
@@ -28158,7 +28197,10 @@ async function tryConsolidate(trimmed, ctx, options, prepared) {
28158
28197
  });
28159
28198
  if (!updated) {
28160
28199
  await assertMergeTargetGoneOrThrow(ctx, decision.targetId);
28161
- return null;
28200
+ return abandonToRace(
28201
+ options,
28202
+ `update: target ${decision.targetId} deleted mid-write (consolidated rewrite lost)`
28203
+ );
28162
28204
  }
28163
28205
  ctx.vaultCache.set(decision.targetId, Float32Array.from(newEmbedding));
28164
28206
  return {
@@ -28170,6 +28212,11 @@ async function tryConsolidate(trimmed, ctx, options, prepared) {
28170
28212
  }
28171
28213
  };
28172
28214
  }
28215
+ notifyConsolidationFallback(
28216
+ "invalid_response",
28217
+ options.consolidateOptions?.onFallback,
28218
+ `unapplicable ${decision.action} decision reached the applier \u2014 validate() should have rejected it`
28219
+ );
28173
28220
  return null;
28174
28221
  }
28175
28222
  async function assertMergeTargetGoneOrThrow(ctx, targetId) {
@@ -35092,13 +35139,18 @@ Executing tool: ${toolInfo}
35092
35139
  }
35093
35140
  const truncatedToNothing = (acc) => acc.finishReason === "length" && acc.toolCalls.size === 0 && acc.content.trim() === "";
35094
35141
  const TRUNCATION_ERROR = "Model response was truncated at the output-token limit before it produced any usable content or tool call. Retry with a higher `maxOutputTokens`, or prompt for fewer/smaller tool calls per turn.";
35142
+ const terminalStateOf = (acc) => ({
35143
+ ...acc.finishReason !== void 0 && { finishReason: acc.finishReason },
35144
+ finalToolCallCount: acc.toolCalls.size
35145
+ });
35095
35146
  if (toolIteration > 0) {
35096
35147
  if (truncatedToNothing(currentAccumulator)) {
35097
35148
  await fireRunError({ error: TRUNCATION_ERROR, stage: "model" });
35098
35149
  return {
35099
35150
  data: buildResponseFinal(currentAccumulator),
35100
35151
  error: TRUNCATION_ERROR,
35101
- toolsChecksum: currentAccumulator.toolsChecksum
35152
+ toolsChecksum: currentAccumulator.toolsChecksum,
35153
+ terminalState: terminalStateOf(currentAccumulator)
35102
35154
  };
35103
35155
  }
35104
35156
  const finalResponse = buildResponseFinal(currentAccumulator);
@@ -35111,7 +35163,8 @@ Executing tool: ${toolInfo}
35111
35163
  data: finalResponse,
35112
35164
  error: null,
35113
35165
  toolsChecksum: currentAccumulator.toolsChecksum,
35114
- autoExecutedToolResults: accumulatedToolResults
35166
+ autoExecutedToolResults: accumulatedToolResults,
35167
+ terminalState: terminalStateOf(currentAccumulator)
35115
35168
  };
35116
35169
  }
35117
35170
  if (truncatedToNothing(accumulator)) {
@@ -35119,7 +35172,8 @@ Executing tool: ${toolInfo}
35119
35172
  return {
35120
35173
  data: response,
35121
35174
  error: TRUNCATION_ERROR,
35122
- toolsChecksum: accumulator.toolsChecksum
35175
+ toolsChecksum: accumulator.toolsChecksum,
35176
+ terminalState: terminalStateOf(accumulator)
35123
35177
  };
35124
35178
  }
35125
35179
  if (onFinish) onFinish(response);
@@ -35130,7 +35184,8 @@ Executing tool: ${toolInfo}
35130
35184
  return {
35131
35185
  data: response,
35132
35186
  error: null,
35133
- toolsChecksum: accumulator.toolsChecksum
35187
+ toolsChecksum: accumulator.toolsChecksum,
35188
+ terminalState: terminalStateOf(accumulator)
35134
35189
  };
35135
35190
  } catch (err) {
35136
35191
  if (isAbortError(err)) {
@@ -2423,6 +2423,32 @@ type RunToolLoopOptions = {
2423
2423
  */
2424
2424
  hooks?: RunHooks | RunHooks[];
2425
2425
  };
2426
+ /**
2427
+ * Terminal state of the LAST model response in the turn, normalized to the
2428
+ * completions vocabulary (`"stop"` | `"length"` | `"tool_calls"` | provider-
2429
+ * specific values). `undefined` when the stream carried no finish reason at all.
2430
+ *
2431
+ * Exposed because neither response shape reliably carries it out to a caller.
2432
+ * The Responses API shape has no field for it — `LlmapiResponseResponse` declares
2433
+ * neither `status` nor `incomplete_details` — so `buildFinalResponse` cannot
2434
+ * surface truncation there even though the loop detected it (`responses.ts`
2435
+ * normalizes it onto the accumulator). Completions does expose
2436
+ * `choices[0].finish_reason`, but omits `tool_calls` entirely when there are
2437
+ * none, so a caller sniffing the response cannot tell "no tool calls" from
2438
+ * "field absent".
2439
+ *
2440
+ * The loop already knows both, unambiguously and identically for either API.
2441
+ * Reporting them here means callers and test harnesses stop reverse-engineering
2442
+ * them from a response shape that cannot answer. See anuma-ai/sdk#805.
2443
+ */
2444
+ type RunTerminalState = {
2445
+ /** Normalized finish reason of the final response. `"length"` means the output
2446
+ * ceiling cut it off; anything else means the model stopped on its own. */
2447
+ finishReason?: string;
2448
+ /** Tool calls the final response carried. `0` is meaningful — combined with
2449
+ * empty content it identifies a turn that ended having produced nothing. */
2450
+ finalToolCallCount: number;
2451
+ };
2426
2452
  type RunToolLoopResult = {
2427
2453
  data: ApiResponse;
2428
2454
  error: null;
@@ -2430,6 +2456,8 @@ type RunToolLoopResult = {
2430
2456
  toolsChecksum?: string;
2431
2457
  /** Results from tools that were auto-executed by the SDK */
2432
2458
  autoExecutedToolResults?: AutoExecutedToolResult[];
2459
+ /** Terminal state of the final model response. See {@link RunTerminalState}. */
2460
+ terminalState?: RunTerminalState;
2433
2461
  } | {
2434
2462
  data: ApiResponse | null;
2435
2463
  error: string;
@@ -2441,6 +2469,18 @@ type RunToolLoopResult = {
2441
2469
  detached?: true;
2442
2470
  /** Non-null only when `resumable` was true AND an inference id was captured before detach. */
2443
2471
  resume?: StreamResumeHandle | null;
2472
+ /**
2473
+ * Terminal state of the final model response, when the failure is one the
2474
+ * loop diagnosed FROM that response — today, the truncated-to-nothing
2475
+ * error. See {@link RunTerminalState}.
2476
+ *
2477
+ * Absent on failures that never got a terminal response to read (transport
2478
+ * errors, detach, an SSE failure mid-stream), which is why it stays
2479
+ * optional here. Present on the truncation error specifically because that
2480
+ * is where it is most diagnostic: a caller can branch on
2481
+ * `finishReason === "length"` instead of matching the error string.
2482
+ */
2483
+ terminalState?: RunTerminalState;
2444
2484
  };
2445
2485
  /** Capability header: tells the portal this client can resume a detached stream. Pinned with zeta-chain/ai-portal#1139. */
2446
2486
  declare const STREAM_RESUMABLE_HEADER = "X-Stream-Resumable";
@@ -5214,8 +5254,26 @@ interface RecallDiagnostics {
5214
5254
  }
5215
5255
  type RetainAction = "create" | "merge" | "update" | "skip" | "suppressed" | "supersede";
5216
5256
  type RetainSource = "manual" | "auto-extracted" | "capsule";
5217
- /** Why the consolidator fell back to "create" instead of a real decision. */
5218
- type ConsolidationFallbackReason = "llm_error" | "invalid_response";
5257
+ /**
5258
+ * Why a retain fell back to "create" instead of applying a consolidation
5259
+ * decision. Each value names a DIFFERENT thing to go fix, which is the point of
5260
+ * keeping them apart:
5261
+ *
5262
+ * - `llm_error` — the consolidation call never produced a response (network,
5263
+ * timeout, 5xx, 429, empty completion, or missing credentials). Look at the
5264
+ * portal and the auth config.
5265
+ * - `invalid_response` — the model answered, but with something unusable: an
5266
+ * unknown action, a targetId that was not in the candidate set, an `update` or
5267
+ * `supersede` with empty content, a `noop` with no target. Look at the prompt
5268
+ * and the model.
5269
+ * - `target_vanished` — the model returned a decision that was valid when it was
5270
+ * made, and the row it named was deleted or superseded by a concurrent writer
5271
+ * before the write landed. Nothing is broken in the consolidator; a sustained
5272
+ * rate points at write contention (for example an auto-extraction worker and a
5273
+ * manual write racing over the same vault), which quietly costs you the
5274
+ * dedup that decision would have performed.
5275
+ */
5276
+ type ConsolidationFallbackReason = "llm_error" | "invalid_response" | "target_vanished";
5219
5277
  interface RetainOptions {
5220
5278
  source?: RetainSource;
5221
5279
  sourceChunkIds?: string[];
@@ -5231,7 +5289,8 @@ interface RetainOptions {
5231
5289
  * Returns `action: 'suppressed'` with the matched `tombstoneId`.
5232
5290
  */
5233
5291
  respectTombstones?: boolean;
5234
- /** Cosine similarity threshold for auto-merge. Default: 0.85. */
5292
+ /** Cosine similarity threshold for auto-merge. Default: 0.8
5293
+ * (`DEFAULT_AUTO_MERGE_THRESHOLD` in retain.ts — the source of truth). */
5235
5294
  autoMergeThreshold?: number;
5236
5295
  /**
5237
5296
  * When provided, runs an LLM-based consolidation pass against the top-K
@@ -5259,9 +5318,13 @@ interface RetainOptions {
5259
5318
  */
5260
5319
  piiRedaction?: boolean | PiiRedactor;
5261
5320
  };
5262
- /** Cosine similarity floor for the consolidator candidate set. Default: 0.65. */
5321
+ /** Cosine similarity floor for the consolidator candidate set. Default: 0.55
5322
+ * (`DEFAULT_CONSOLIDATE_THRESHOLD` in retain.ts — the source of truth). */
5263
5323
  consolidateThreshold?: number;
5264
- /** Top-K consolidation candidates to feed the LLM. Default: 5. */
5324
+ /** Top-K consolidation candidates to feed the LLM. Default: 20
5325
+ * (`DEFAULT_CONSOLIDATE_TOP_K` in retain.ts — the source of truth). Widened
5326
+ * from 5 so a value change can find and retire ALL stale duplicates of the
5327
+ * old value in one pass, not just the nearest few. */
5265
5328
  consolidateTopK?: number;
5266
5329
  /**
5267
5330
  * W6 temporal lane — when the event in this fact occurred. Persisted to
@@ -9294,4 +9357,4 @@ declare function sanitizeQuotes(s: string): string;
9294
9357
  declare function renderTemplate(value: string | null | undefined, template: string): string | null;
9295
9358
  declare function buildSystemPrompt(ctx: PromptContext, options?: BuildPromptOptions): BuildPromptResult;
9296
9359
 
9297
- export { type AnalyzeStyleOptions, type AnalyzeStyleResult, type ApiResponse, type ApiType, type AutoExecutedToolResult, type AutoExtractMessage, type AutoExtractor, type Budget, type BuildPromptOptions, type BuildPromptResult, type CachedChunkVectors, type CachedServerTools, type ChatCompletionUsage, type ChatRole, type ChunkSearchResult, type ChunkVectorCache, type ChunkingOptions, type ConnectorGuidance, type ConnectorGuidanceInput, type ConsolidationFallbackReason, Conversation, ConversationSummary, type CreateAutoExtractorOptions, type CreateConversationOptions, type CreateDecaySweeperOptions, type CreateMediaOptions, type CreateMessageOptions, type CreateModelPreferenceOptions, type CreateProjectOptions, type CreateUserPreferenceOptions, type CreateVaultMemoryOptions, type CryptoPriceClassification, type CryptoPricePreProcessorOptions, DEFAULT_ANALYSIS_PROMPT, DEFAULT_ANALYZE_AFTER_MESSAGES, DEFAULT_CACHE_EXPIRATION_MS, DEFAULT_CHUNK_CACHE_SIZE, DEFAULT_CHUNK_OVERLAP, DEFAULT_CHUNK_SIZE, DEFAULT_DECAY_POLICY, DEFAULT_DOCUMENT_PATTERN, DEFAULT_EXCLUDED_SERVER_TOOLS, DEFAULT_MAX_CLASSIFIER_CALLS_PER_SWEEP, DEFAULT_MAX_INPUT_MESSAGES, DEFAULT_MAX_PROFILE_LENGTH, DEFAULT_MIN_CHUNK_SIZE, DEFAULT_MIN_MESSAGES, DEFAULT_PERSONALITY_SETTINGS, DEFAULT_PROFILE_FACETS, DEFAULT_PROFILE_FACT_TYPE_WEIGHTS, DEFAULT_PROFILE_PROOF_ALPHA, DEFAULT_PROFILE_TREND_MULTIPLIERS, DEFAULT_PROMPT_TEMPLATES, DEFAULT_REFRESH_EVERY_MESSAGES, DEFAULT_SERVER_TOOLS_MATCH_OPTIONS, DEFAULT_SUMMARY_MIN_WINDOW_MESSAGES, DEFAULT_SUMMARY_MODEL, DEFAULT_SUMMARY_TOKEN_THRESHOLD, DEFAULT_VAULT_CACHE_SIZE, DatabaseManager, type DatabaseManagerLogger, type DatabaseManagerOptions, type DecayCandidateRaw, type DecayClassifier, type DecayInput, type DecayPolicy, type DecaySweepResult, type DecaySweeper, type DecayVerdict, ENTITY_FANOUT, type EmbeddedWalletSignerFn, ExcelProcessor, type ExtractFactsOptions, type ExtractOutcome, type ExtractedCandidate, type ExtractedEntity, type ExtractionCursorStore, type FactType, type FileMetadata, type FileProcessor, type FileTypeQuery, type FileWithData, type FlushResult, type GetConversationsPageOptions, type GraphTraversalOptions, HARD_DELETE_WINDOW_MS, INFERENCE_ID_HEADER, type InjectionClassifierOptions, type InjectionReason, type LazyStoredConversation, type LlmDecayClassifierOptions, type LlmNeighborRefinerOptions, type LlmTokenUsage, MAX_HOPS, MAX_MESSAGES_PER_SUMMARIZATION, MEDIUM_TTL_MS, Media, type MediaDimensions, type MediaFilterOptions, type MediaMetadata, type MediaOperationsContext, type MediaRole, type MediaType, type MemoriesNeedingTopicExtraction, type EmbeddingOptions as MemoryEngineEmbeddingOptions, type MemoryEngineResult, type MemoryEngineSearchOptions, type MemoryExtractedEvent, type MemoryKind, type MemoryQuarantinedEvent, type MemoryVaultSearchOptions, type MemoryVaultToolOptions, Message, type MessageChunk, type MessageFeedback, type ModelCallEndEvent, type ModelCallStartEvent, ModelPreference, NEVER_TTL_MS, NODE_BUDGET, type NeighborRefiner, type NowSource, type ObservationTrend, type ObservationTrendInput, type OperationExecutor, PAST_EVENT_GRACE_MS, PROFILE_DOC_VERSION, type ParsedServerToolsResponse, PdfProcessor, type PersonalitySettings, type PersonalitySliders, type PersonalityStyle, type PgClientLike, type PgPoolLike, type PlatformStorage, type PortalLlmAuth, PostgreSQLAdapter, type PostgreSQLAdapterOptions, type PreprocessingOptions, type PreprocessingResult, type ProcessedFileResult, ProcessorRegistry, type ProfileConfigFingerprint, type ProfileDoc, type ProfileFacet, type ProfileFacetKey, type ProfileSalienceInput, type ProfileSection, type ProfileUpdate, Project, type ProjectOperationsContext, type PromptContext, type PromptPreProcessor, type PromptPreProcessorContext, type PromptSection, type PromptTemplates, type QuarantinedMemoryInfo, type QueueEncryptionContext, QueueManager, type QueueStatus, type QueuedOperation, type QueuedOperationType, RECALL_MAX_LIMIT, RECALL_TOOL_NAME, type RankedMemory, type RankedProfileCandidate, type RecallContext, type RecallDegradation, type RecallDiagnostics, type RecallOptions, type RecallResult, type RecallToolCallbacks, type RecallToolOptions, type RecencyOptions, type ReflectOptions, type ReflectResult, RerankerUnavailableError, type ResumeStreamOptions, type ResumeStreamResult, type RetainAction, type RetainContext, type RetainOptions, type RetainResult, type RetainSource, type RunEndEvent, type RunErrorEvent, type RunHooks, type RunStartEvent, type RunToolLoopOptions, type RunToolLoopResult, SDK_SCHEMA_VERSION, SERVER_TOOL_DEPENDENCY_SETS, SHORT_TTL_MS, SLIDER_CONFIG, STREAM_RESUMABLE_HEADER, type ScoreBreakdown, type ScoreProfileSalienceOptions, type ScreenResult, type ScreenedCandidate, type SearchSource, type SelectServerToolsForPromptOptions, type ServerTool, type ServerToolCallEvent, type ServerToolsFilterFunction, type ServerToolsOptions, type ServerToolsResponse, type SettingsStorageOperationsContext, type SignMessageFn, type StepFinishEvent, type StockPriceClassification, type StockPricePreProcessorOptions, type StorageOperationsContext, type StoredConversation, type StoredConversationSummary, type StoredFileWithContext, type StoredMedia, type StoredMessage, type StoredMessageWithSimilarity, type StoredModelPreference, type StoredProject, type StoredUserPreference, type StoredVaultMemory, StreamExpiredError, type StreamMetaEvent, type StreamResumeHandle, type StreamSmoothingConfig, type StreamingTransport, type StreamingTransportOptions, type StreamingTransportResult, type StyleAnalysisSchedule, type SynthesizeProfileOptions, TOOL_CATALOG, TOPICS_EXTRACTION_VERSION, TOPIC_EXTRACTION_BATCH_SIZE, TREND_RECENT_WINDOW_DAYS, TREND_STALE_WINDOW_DAYS, type TextChunk, TextProcessor, type ToolConfig, type ToolExecutor, type ToolMatchOptions, type ToolMatchResult, type ToolSet, type ToolUseEndEvent, type ToolUseStartEvent, type TopicExtractOptions, type TopicExtractionInput, type TopicExtractionRunResult, type TurnCompleteEvent, type TurnSkippedEvent, type UpdateMediaOptions, type UpdateModelPreferenceOptions, type UpdateProjectOptions, type UpdateUserPreferenceOptions, type UpdateVaultMemoryOptions, UserPreference, type UserPreferencesStorageOperationsContext, VAULT_SIZE_HOP_CAP, type VaultEmbeddingCache, VaultMemory, type VaultMemoryOperationsContext, type VaultMemoryVisibility, type VaultSaveOperation, type VaultSearchResult, WalletPoller, type WeatherClassification, type WeatherPreProcessorOptions, type WebSearchClassification, type WebSearchPreProcessorOptions, WordProcessor, ZipProcessor, type ZipProcessorOptions, activatedToolSetNames, analyzeStyle, archiveVaultMemoryOp, buildConnectorGuidance, buildDeniedToolsRider, buildSystemPrompt, capHopsForDensity, chunkAndEmbedAllMessages, chunkAndEmbedMessage, chunkText, classifyCryptoPrice, classifyCryptoPriceBatch, classifyDecay, classifyInjectionCandidates, classifyObservationTrend, classifyStockPrice, classifyStockPriceBatch, classifyWeather, classifyWeatherBatch, classifyWebSearch, classifyWebSearchBatch, cleanupConversationSummary, clearAllEncryptionKeys, clearAllEncryptionState, clearAllKeyPairs, clearEncryptionKey, clearKeyPair, clearLazyTitleCache, clearMessagesOp, clearServerToolsCache, composeHooks, createAutoExtractor, createChunkVectorCache, createConversationOp, createCryptoPricePreProcessor, createDecaySweeper, createLlmDecayClassifier, createLlmNeighborRefiner, createMediaBatchOp, createMediaOp, createMemoryEngineTool, createMemoryVaultSearchTool, createMemoryVaultTool, createMessageOp, createPlatformCursorStore, createProjectOp, createRecallTool, createServerToolsFilter, createStockPricePreProcessor, createSummaryContext, createVaultEmbeddingCache, createVaultMemoriesBatchOp, createVaultMemoryOp, createWeatherPreProcessor, createWebSearchPreProcessor, decryptConversationTitle, decryptData, decryptDataBatch, decryptDataBytes, decryptDataBytesFromBytes, decryptDataWithKey, defaultServerToolsFilter, deleteAllVaultMemoriesForUserOp, deleteConversationOp, deleteConversationSummaryOp, deleteMediaByConversationOp, deleteMediaByMessageOp, deleteMediaOp, deleteModelPreferenceOp, deleteProjectOp, deleteUserPreferenceOp, deleteVaultMemoryOp, eagerEmbedContent, embedAllMessages, embedMessage, encryptData, encryptDataBatch, encryptDataBytes, encryptDataWithKey, estimateMessagesTokens, estimateTokens, exportPublicKey, extractAndLinkEntitiesForMemoriesOp, extractAndRetain, extractEntitiesForMemories, extractFacts, findMatchingTools, generateConversationId, generateEmbedding, generateEmbeddings, generateMediaId, generateProjectId, getAIGeneratedMediaOp, getAllFilesOp, getAllVaultMemoriesOp, getAllVaultMemoryContentsOp, getAudioOp, getCachedServerTools, getConversationOp, getConversationSummaryOp, getConversationsByProjectLazyOp, getConversationsByProjectOp, getConversationsLazyOp, getConversationsOp, getConversationsPageOp, getDecayCandidatesRawOp, getDocumentsOp, getEncryptionKey, getImagesOp, getMediaByConversationOp, getMediaByIdOp, getMediaByIdsOp, getMediaByMessageOp, getMediaByModelOp, getMediaByRoleOp, getMediaBySourceUrlOp, getMediaByTypeOp, getMediaCountOp, getMediaCountsByTypeOp, getMediaOp, getMediaTypeFromMime, getMemoriesNeedingTopicExtractionOp, getMessageOp, getMessagesOp, getModelPreferenceOp, getProjectConversationCountOp, getProjectConversationsOp, getProjectOp, getProjectsOp, getRecentMediaOp, getServerTools, getSupportedFileTypes, getToolsChecksum, getUnfiledVaultMemoriesOp, getUserPreferenceOp, getUserUploadedMediaOp, getVaultMemoryOp, getVideosOp, hardDeleteDecayedOp, hardDeleteMediaOp, hasEncryptionKey, hasKeyPair, injectionSignatureCatalog, isRerankerAvailable, isSupportedFile, isSupportedMediaType, makeSyntheticStoredConversation, makeSyntheticStoredMessage, maybeSummarizeHistory, mediaToStored, migrateFromModelPreferencesOp, onKeyAvailable, preEmbedVaultMemories, preprocessFiles, progressiveSummarize, projectToStored, queueManager, rankProfileCandidates, recall, reflect, relinkMisclassifiedVideosOp, renderTemplate, requestEncryptionKey, requestKeyPair, restoreVaultMemoryOp, resumeStream, retain, runToolLoop, sanitizeQuotes, schemaToCreateSQL, scoreProfileSalience, screenCandidatesForInjection, sdkMigrations, sdkModelClasses, sdkSchema, searchChunksOp, searchMediaOp, searchMessagesOp, searchVaultMemories, selectServerToolsForPrompt, serverPlatformStorage, setMemoryVisibilityOp, setModelPreferenceOp, setUserPreferenceOp, shouldAnalyzeStyle, shouldChunkMessage, shouldRefreshTools, splitMessagesAtThreshold, stampTopicsExtractedAtOp, streamCancelPath, streamReplayPath, summarizeObservationTrends, summaryToSystemMessage, supersedeVaultMemoryOp, synthesizeProfile, toolSetSystemPrompts, traverseGraphLane, ttlForType, updateConversationProjectOp, updateConversationTitleOp, updateMediaMessageIdBatchOp, updateMediaOp, updateMessageChunksOp, updateMessageEmbeddingOp, updateMessageErrorOp, updateMessageFeedbackOp, updateModelsOp, updatePersonalityOp, updateProfileOp, updateProjectNameOp, updateProjectOp, updateVaultMemoryEmbeddingOp, updateVaultMemoryOp, upsertConversationSummaryOp, upsertMessageOp };
9360
+ export { type AnalyzeStyleOptions, type AnalyzeStyleResult, type ApiResponse, type ApiType, type AutoExecutedToolResult, type AutoExtractMessage, type AutoExtractor, type Budget, type BuildPromptOptions, type BuildPromptResult, type CachedChunkVectors, type CachedServerTools, type ChatCompletionUsage, type ChatRole, type ChunkSearchResult, type ChunkVectorCache, type ChunkingOptions, type ConnectorGuidance, type ConnectorGuidanceInput, type ConsolidationFallbackReason, Conversation, ConversationSummary, type CreateAutoExtractorOptions, type CreateConversationOptions, type CreateDecaySweeperOptions, type CreateMediaOptions, type CreateMessageOptions, type CreateModelPreferenceOptions, type CreateProjectOptions, type CreateUserPreferenceOptions, type CreateVaultMemoryOptions, type CryptoPriceClassification, type CryptoPricePreProcessorOptions, DEFAULT_ANALYSIS_PROMPT, DEFAULT_ANALYZE_AFTER_MESSAGES, DEFAULT_CACHE_EXPIRATION_MS, DEFAULT_CHUNK_CACHE_SIZE, DEFAULT_CHUNK_OVERLAP, DEFAULT_CHUNK_SIZE, DEFAULT_DECAY_POLICY, DEFAULT_DOCUMENT_PATTERN, DEFAULT_EXCLUDED_SERVER_TOOLS, DEFAULT_MAX_CLASSIFIER_CALLS_PER_SWEEP, DEFAULT_MAX_INPUT_MESSAGES, DEFAULT_MAX_PROFILE_LENGTH, DEFAULT_MIN_CHUNK_SIZE, DEFAULT_MIN_MESSAGES, DEFAULT_PERSONALITY_SETTINGS, DEFAULT_PROFILE_FACETS, DEFAULT_PROFILE_FACT_TYPE_WEIGHTS, DEFAULT_PROFILE_PROOF_ALPHA, DEFAULT_PROFILE_TREND_MULTIPLIERS, DEFAULT_PROMPT_TEMPLATES, DEFAULT_REFRESH_EVERY_MESSAGES, DEFAULT_SERVER_TOOLS_MATCH_OPTIONS, DEFAULT_SUMMARY_MIN_WINDOW_MESSAGES, DEFAULT_SUMMARY_MODEL, DEFAULT_SUMMARY_TOKEN_THRESHOLD, DEFAULT_VAULT_CACHE_SIZE, DatabaseManager, type DatabaseManagerLogger, type DatabaseManagerOptions, type DecayCandidateRaw, type DecayClassifier, type DecayInput, type DecayPolicy, type DecaySweepResult, type DecaySweeper, type DecayVerdict, ENTITY_FANOUT, type EmbeddedWalletSignerFn, ExcelProcessor, type ExtractFactsOptions, type ExtractOutcome, type ExtractedCandidate, type ExtractedEntity, type ExtractionCursorStore, type FactType, type FileMetadata, type FileProcessor, type FileTypeQuery, type FileWithData, type FlushResult, type GetConversationsPageOptions, type GraphTraversalOptions, HARD_DELETE_WINDOW_MS, INFERENCE_ID_HEADER, type InjectionClassifierOptions, type InjectionReason, type LazyStoredConversation, type LlmDecayClassifierOptions, type LlmNeighborRefinerOptions, type LlmTokenUsage, MAX_HOPS, MAX_MESSAGES_PER_SUMMARIZATION, MEDIUM_TTL_MS, Media, type MediaDimensions, type MediaFilterOptions, type MediaMetadata, type MediaOperationsContext, type MediaRole, type MediaType, type MemoriesNeedingTopicExtraction, type EmbeddingOptions as MemoryEngineEmbeddingOptions, type MemoryEngineResult, type MemoryEngineSearchOptions, type MemoryExtractedEvent, type MemoryKind, type MemoryQuarantinedEvent, type MemoryVaultSearchOptions, type MemoryVaultToolOptions, Message, type MessageChunk, type MessageFeedback, type ModelCallEndEvent, type ModelCallStartEvent, ModelPreference, NEVER_TTL_MS, NODE_BUDGET, type NeighborRefiner, type NowSource, type ObservationTrend, type ObservationTrendInput, type OperationExecutor, PAST_EVENT_GRACE_MS, PROFILE_DOC_VERSION, type ParsedServerToolsResponse, PdfProcessor, type PersonalitySettings, type PersonalitySliders, type PersonalityStyle, type PgClientLike, type PgPoolLike, type PlatformStorage, type PortalLlmAuth, PostgreSQLAdapter, type PostgreSQLAdapterOptions, type PreprocessingOptions, type PreprocessingResult, type ProcessedFileResult, ProcessorRegistry, type ProfileConfigFingerprint, type ProfileDoc, type ProfileFacet, type ProfileFacetKey, type ProfileSalienceInput, type ProfileSection, type ProfileUpdate, Project, type ProjectOperationsContext, type PromptContext, type PromptPreProcessor, type PromptPreProcessorContext, type PromptSection, type PromptTemplates, type QuarantinedMemoryInfo, type QueueEncryptionContext, QueueManager, type QueueStatus, type QueuedOperation, type QueuedOperationType, RECALL_MAX_LIMIT, RECALL_TOOL_NAME, type RankedMemory, type RankedProfileCandidate, type RecallContext, type RecallDegradation, type RecallDiagnostics, type RecallOptions, type RecallResult, type RecallToolCallbacks, type RecallToolOptions, type RecencyOptions, type ReflectOptions, type ReflectResult, RerankerUnavailableError, type ResumeStreamOptions, type ResumeStreamResult, type RetainAction, type RetainContext, type RetainOptions, type RetainResult, type RetainSource, type RunEndEvent, type RunErrorEvent, type RunHooks, type RunStartEvent, type RunTerminalState, type RunToolLoopOptions, type RunToolLoopResult, SDK_SCHEMA_VERSION, SERVER_TOOL_DEPENDENCY_SETS, SHORT_TTL_MS, SLIDER_CONFIG, STREAM_RESUMABLE_HEADER, type ScoreBreakdown, type ScoreProfileSalienceOptions, type ScreenResult, type ScreenedCandidate, type SearchSource, type SelectServerToolsForPromptOptions, type ServerTool, type ServerToolCallEvent, type ServerToolsFilterFunction, type ServerToolsOptions, type ServerToolsResponse, type SettingsStorageOperationsContext, type SignMessageFn, type StepFinishEvent, type StockPriceClassification, type StockPricePreProcessorOptions, type StorageOperationsContext, type StoredConversation, type StoredConversationSummary, type StoredFileWithContext, type StoredMedia, type StoredMessage, type StoredMessageWithSimilarity, type StoredModelPreference, type StoredProject, type StoredUserPreference, type StoredVaultMemory, StreamExpiredError, type StreamMetaEvent, type StreamResumeHandle, type StreamSmoothingConfig, type StreamingTransport, type StreamingTransportOptions, type StreamingTransportResult, type StyleAnalysisSchedule, type SynthesizeProfileOptions, TOOL_CATALOG, TOPICS_EXTRACTION_VERSION, TOPIC_EXTRACTION_BATCH_SIZE, TREND_RECENT_WINDOW_DAYS, TREND_STALE_WINDOW_DAYS, type TextChunk, TextProcessor, type ToolConfig, type ToolExecutor, type ToolMatchOptions, type ToolMatchResult, type ToolSet, type ToolUseEndEvent, type ToolUseStartEvent, type TopicExtractOptions, type TopicExtractionInput, type TopicExtractionRunResult, type TurnCompleteEvent, type TurnSkippedEvent, type UpdateMediaOptions, type UpdateModelPreferenceOptions, type UpdateProjectOptions, type UpdateUserPreferenceOptions, type UpdateVaultMemoryOptions, UserPreference, type UserPreferencesStorageOperationsContext, VAULT_SIZE_HOP_CAP, type VaultEmbeddingCache, VaultMemory, type VaultMemoryOperationsContext, type VaultMemoryVisibility, type VaultSaveOperation, type VaultSearchResult, WalletPoller, type WeatherClassification, type WeatherPreProcessorOptions, type WebSearchClassification, type WebSearchPreProcessorOptions, WordProcessor, ZipProcessor, type ZipProcessorOptions, activatedToolSetNames, analyzeStyle, archiveVaultMemoryOp, buildConnectorGuidance, buildDeniedToolsRider, buildSystemPrompt, capHopsForDensity, chunkAndEmbedAllMessages, chunkAndEmbedMessage, chunkText, classifyCryptoPrice, classifyCryptoPriceBatch, classifyDecay, classifyInjectionCandidates, classifyObservationTrend, classifyStockPrice, classifyStockPriceBatch, classifyWeather, classifyWeatherBatch, classifyWebSearch, classifyWebSearchBatch, cleanupConversationSummary, clearAllEncryptionKeys, clearAllEncryptionState, clearAllKeyPairs, clearEncryptionKey, clearKeyPair, clearLazyTitleCache, clearMessagesOp, clearServerToolsCache, composeHooks, createAutoExtractor, createChunkVectorCache, createConversationOp, createCryptoPricePreProcessor, createDecaySweeper, createLlmDecayClassifier, createLlmNeighborRefiner, createMediaBatchOp, createMediaOp, createMemoryEngineTool, createMemoryVaultSearchTool, createMemoryVaultTool, createMessageOp, createPlatformCursorStore, createProjectOp, createRecallTool, createServerToolsFilter, createStockPricePreProcessor, createSummaryContext, createVaultEmbeddingCache, createVaultMemoriesBatchOp, createVaultMemoryOp, createWeatherPreProcessor, createWebSearchPreProcessor, decryptConversationTitle, decryptData, decryptDataBatch, decryptDataBytes, decryptDataBytesFromBytes, decryptDataWithKey, defaultServerToolsFilter, deleteAllVaultMemoriesForUserOp, deleteConversationOp, deleteConversationSummaryOp, deleteMediaByConversationOp, deleteMediaByMessageOp, deleteMediaOp, deleteModelPreferenceOp, deleteProjectOp, deleteUserPreferenceOp, deleteVaultMemoryOp, eagerEmbedContent, embedAllMessages, embedMessage, encryptData, encryptDataBatch, encryptDataBytes, encryptDataWithKey, estimateMessagesTokens, estimateTokens, exportPublicKey, extractAndLinkEntitiesForMemoriesOp, extractAndRetain, extractEntitiesForMemories, extractFacts, findMatchingTools, generateConversationId, generateEmbedding, generateEmbeddings, generateMediaId, generateProjectId, getAIGeneratedMediaOp, getAllFilesOp, getAllVaultMemoriesOp, getAllVaultMemoryContentsOp, getAudioOp, getCachedServerTools, getConversationOp, getConversationSummaryOp, getConversationsByProjectLazyOp, getConversationsByProjectOp, getConversationsLazyOp, getConversationsOp, getConversationsPageOp, getDecayCandidatesRawOp, getDocumentsOp, getEncryptionKey, getImagesOp, getMediaByConversationOp, getMediaByIdOp, getMediaByIdsOp, getMediaByMessageOp, getMediaByModelOp, getMediaByRoleOp, getMediaBySourceUrlOp, getMediaByTypeOp, getMediaCountOp, getMediaCountsByTypeOp, getMediaOp, getMediaTypeFromMime, getMemoriesNeedingTopicExtractionOp, getMessageOp, getMessagesOp, getModelPreferenceOp, getProjectConversationCountOp, getProjectConversationsOp, getProjectOp, getProjectsOp, getRecentMediaOp, getServerTools, getSupportedFileTypes, getToolsChecksum, getUnfiledVaultMemoriesOp, getUserPreferenceOp, getUserUploadedMediaOp, getVaultMemoryOp, getVideosOp, hardDeleteDecayedOp, hardDeleteMediaOp, hasEncryptionKey, hasKeyPair, injectionSignatureCatalog, isRerankerAvailable, isSupportedFile, isSupportedMediaType, makeSyntheticStoredConversation, makeSyntheticStoredMessage, maybeSummarizeHistory, mediaToStored, migrateFromModelPreferencesOp, onKeyAvailable, preEmbedVaultMemories, preprocessFiles, progressiveSummarize, projectToStored, queueManager, rankProfileCandidates, recall, reflect, relinkMisclassifiedVideosOp, renderTemplate, requestEncryptionKey, requestKeyPair, restoreVaultMemoryOp, resumeStream, retain, runToolLoop, sanitizeQuotes, schemaToCreateSQL, scoreProfileSalience, screenCandidatesForInjection, sdkMigrations, sdkModelClasses, sdkSchema, searchChunksOp, searchMediaOp, searchMessagesOp, searchVaultMemories, selectServerToolsForPrompt, serverPlatformStorage, setMemoryVisibilityOp, setModelPreferenceOp, setUserPreferenceOp, shouldAnalyzeStyle, shouldChunkMessage, shouldRefreshTools, splitMessagesAtThreshold, stampTopicsExtractedAtOp, streamCancelPath, streamReplayPath, summarizeObservationTrends, summaryToSystemMessage, supersedeVaultMemoryOp, synthesizeProfile, toolSetSystemPrompts, traverseGraphLane, ttlForType, updateConversationProjectOp, updateConversationTitleOp, updateMediaMessageIdBatchOp, updateMediaOp, updateMessageChunksOp, updateMessageEmbeddingOp, updateMessageErrorOp, updateMessageFeedbackOp, updateModelsOp, updatePersonalityOp, updateProfileOp, updateProjectNameOp, updateProjectOp, updateVaultMemoryEmbeddingOp, updateVaultMemoryOp, upsertConversationSummaryOp, upsertMessageOp };
@@ -2423,6 +2423,32 @@ type RunToolLoopOptions = {
2423
2423
  */
2424
2424
  hooks?: RunHooks | RunHooks[];
2425
2425
  };
2426
+ /**
2427
+ * Terminal state of the LAST model response in the turn, normalized to the
2428
+ * completions vocabulary (`"stop"` | `"length"` | `"tool_calls"` | provider-
2429
+ * specific values). `undefined` when the stream carried no finish reason at all.
2430
+ *
2431
+ * Exposed because neither response shape reliably carries it out to a caller.
2432
+ * The Responses API shape has no field for it — `LlmapiResponseResponse` declares
2433
+ * neither `status` nor `incomplete_details` — so `buildFinalResponse` cannot
2434
+ * surface truncation there even though the loop detected it (`responses.ts`
2435
+ * normalizes it onto the accumulator). Completions does expose
2436
+ * `choices[0].finish_reason`, but omits `tool_calls` entirely when there are
2437
+ * none, so a caller sniffing the response cannot tell "no tool calls" from
2438
+ * "field absent".
2439
+ *
2440
+ * The loop already knows both, unambiguously and identically for either API.
2441
+ * Reporting them here means callers and test harnesses stop reverse-engineering
2442
+ * them from a response shape that cannot answer. See anuma-ai/sdk#805.
2443
+ */
2444
+ type RunTerminalState = {
2445
+ /** Normalized finish reason of the final response. `"length"` means the output
2446
+ * ceiling cut it off; anything else means the model stopped on its own. */
2447
+ finishReason?: string;
2448
+ /** Tool calls the final response carried. `0` is meaningful — combined with
2449
+ * empty content it identifies a turn that ended having produced nothing. */
2450
+ finalToolCallCount: number;
2451
+ };
2426
2452
  type RunToolLoopResult = {
2427
2453
  data: ApiResponse;
2428
2454
  error: null;
@@ -2430,6 +2456,8 @@ type RunToolLoopResult = {
2430
2456
  toolsChecksum?: string;
2431
2457
  /** Results from tools that were auto-executed by the SDK */
2432
2458
  autoExecutedToolResults?: AutoExecutedToolResult[];
2459
+ /** Terminal state of the final model response. See {@link RunTerminalState}. */
2460
+ terminalState?: RunTerminalState;
2433
2461
  } | {
2434
2462
  data: ApiResponse | null;
2435
2463
  error: string;
@@ -2441,6 +2469,18 @@ type RunToolLoopResult = {
2441
2469
  detached?: true;
2442
2470
  /** Non-null only when `resumable` was true AND an inference id was captured before detach. */
2443
2471
  resume?: StreamResumeHandle | null;
2472
+ /**
2473
+ * Terminal state of the final model response, when the failure is one the
2474
+ * loop diagnosed FROM that response — today, the truncated-to-nothing
2475
+ * error. See {@link RunTerminalState}.
2476
+ *
2477
+ * Absent on failures that never got a terminal response to read (transport
2478
+ * errors, detach, an SSE failure mid-stream), which is why it stays
2479
+ * optional here. Present on the truncation error specifically because that
2480
+ * is where it is most diagnostic: a caller can branch on
2481
+ * `finishReason === "length"` instead of matching the error string.
2482
+ */
2483
+ terminalState?: RunTerminalState;
2444
2484
  };
2445
2485
  /** Capability header: tells the portal this client can resume a detached stream. Pinned with zeta-chain/ai-portal#1139. */
2446
2486
  declare const STREAM_RESUMABLE_HEADER = "X-Stream-Resumable";
@@ -5214,8 +5254,26 @@ interface RecallDiagnostics {
5214
5254
  }
5215
5255
  type RetainAction = "create" | "merge" | "update" | "skip" | "suppressed" | "supersede";
5216
5256
  type RetainSource = "manual" | "auto-extracted" | "capsule";
5217
- /** Why the consolidator fell back to "create" instead of a real decision. */
5218
- type ConsolidationFallbackReason = "llm_error" | "invalid_response";
5257
+ /**
5258
+ * Why a retain fell back to "create" instead of applying a consolidation
5259
+ * decision. Each value names a DIFFERENT thing to go fix, which is the point of
5260
+ * keeping them apart:
5261
+ *
5262
+ * - `llm_error` — the consolidation call never produced a response (network,
5263
+ * timeout, 5xx, 429, empty completion, or missing credentials). Look at the
5264
+ * portal and the auth config.
5265
+ * - `invalid_response` — the model answered, but with something unusable: an
5266
+ * unknown action, a targetId that was not in the candidate set, an `update` or
5267
+ * `supersede` with empty content, a `noop` with no target. Look at the prompt
5268
+ * and the model.
5269
+ * - `target_vanished` — the model returned a decision that was valid when it was
5270
+ * made, and the row it named was deleted or superseded by a concurrent writer
5271
+ * before the write landed. Nothing is broken in the consolidator; a sustained
5272
+ * rate points at write contention (for example an auto-extraction worker and a
5273
+ * manual write racing over the same vault), which quietly costs you the
5274
+ * dedup that decision would have performed.
5275
+ */
5276
+ type ConsolidationFallbackReason = "llm_error" | "invalid_response" | "target_vanished";
5219
5277
  interface RetainOptions {
5220
5278
  source?: RetainSource;
5221
5279
  sourceChunkIds?: string[];
@@ -5231,7 +5289,8 @@ interface RetainOptions {
5231
5289
  * Returns `action: 'suppressed'` with the matched `tombstoneId`.
5232
5290
  */
5233
5291
  respectTombstones?: boolean;
5234
- /** Cosine similarity threshold for auto-merge. Default: 0.85. */
5292
+ /** Cosine similarity threshold for auto-merge. Default: 0.8
5293
+ * (`DEFAULT_AUTO_MERGE_THRESHOLD` in retain.ts — the source of truth). */
5235
5294
  autoMergeThreshold?: number;
5236
5295
  /**
5237
5296
  * When provided, runs an LLM-based consolidation pass against the top-K
@@ -5259,9 +5318,13 @@ interface RetainOptions {
5259
5318
  */
5260
5319
  piiRedaction?: boolean | PiiRedactor;
5261
5320
  };
5262
- /** Cosine similarity floor for the consolidator candidate set. Default: 0.65. */
5321
+ /** Cosine similarity floor for the consolidator candidate set. Default: 0.55
5322
+ * (`DEFAULT_CONSOLIDATE_THRESHOLD` in retain.ts — the source of truth). */
5263
5323
  consolidateThreshold?: number;
5264
- /** Top-K consolidation candidates to feed the LLM. Default: 5. */
5324
+ /** Top-K consolidation candidates to feed the LLM. Default: 20
5325
+ * (`DEFAULT_CONSOLIDATE_TOP_K` in retain.ts — the source of truth). Widened
5326
+ * from 5 so a value change can find and retire ALL stale duplicates of the
5327
+ * old value in one pass, not just the nearest few. */
5265
5328
  consolidateTopK?: number;
5266
5329
  /**
5267
5330
  * W6 temporal lane — when the event in this fact occurred. Persisted to
@@ -9294,4 +9357,4 @@ declare function sanitizeQuotes(s: string): string;
9294
9357
  declare function renderTemplate(value: string | null | undefined, template: string): string | null;
9295
9358
  declare function buildSystemPrompt(ctx: PromptContext, options?: BuildPromptOptions): BuildPromptResult;
9296
9359
 
9297
- export { type AnalyzeStyleOptions, type AnalyzeStyleResult, type ApiResponse, type ApiType, type AutoExecutedToolResult, type AutoExtractMessage, type AutoExtractor, type Budget, type BuildPromptOptions, type BuildPromptResult, type CachedChunkVectors, type CachedServerTools, type ChatCompletionUsage, type ChatRole, type ChunkSearchResult, type ChunkVectorCache, type ChunkingOptions, type ConnectorGuidance, type ConnectorGuidanceInput, type ConsolidationFallbackReason, Conversation, ConversationSummary, type CreateAutoExtractorOptions, type CreateConversationOptions, type CreateDecaySweeperOptions, type CreateMediaOptions, type CreateMessageOptions, type CreateModelPreferenceOptions, type CreateProjectOptions, type CreateUserPreferenceOptions, type CreateVaultMemoryOptions, type CryptoPriceClassification, type CryptoPricePreProcessorOptions, DEFAULT_ANALYSIS_PROMPT, DEFAULT_ANALYZE_AFTER_MESSAGES, DEFAULT_CACHE_EXPIRATION_MS, DEFAULT_CHUNK_CACHE_SIZE, DEFAULT_CHUNK_OVERLAP, DEFAULT_CHUNK_SIZE, DEFAULT_DECAY_POLICY, DEFAULT_DOCUMENT_PATTERN, DEFAULT_EXCLUDED_SERVER_TOOLS, DEFAULT_MAX_CLASSIFIER_CALLS_PER_SWEEP, DEFAULT_MAX_INPUT_MESSAGES, DEFAULT_MAX_PROFILE_LENGTH, DEFAULT_MIN_CHUNK_SIZE, DEFAULT_MIN_MESSAGES, DEFAULT_PERSONALITY_SETTINGS, DEFAULT_PROFILE_FACETS, DEFAULT_PROFILE_FACT_TYPE_WEIGHTS, DEFAULT_PROFILE_PROOF_ALPHA, DEFAULT_PROFILE_TREND_MULTIPLIERS, DEFAULT_PROMPT_TEMPLATES, DEFAULT_REFRESH_EVERY_MESSAGES, DEFAULT_SERVER_TOOLS_MATCH_OPTIONS, DEFAULT_SUMMARY_MIN_WINDOW_MESSAGES, DEFAULT_SUMMARY_MODEL, DEFAULT_SUMMARY_TOKEN_THRESHOLD, DEFAULT_VAULT_CACHE_SIZE, DatabaseManager, type DatabaseManagerLogger, type DatabaseManagerOptions, type DecayCandidateRaw, type DecayClassifier, type DecayInput, type DecayPolicy, type DecaySweepResult, type DecaySweeper, type DecayVerdict, ENTITY_FANOUT, type EmbeddedWalletSignerFn, ExcelProcessor, type ExtractFactsOptions, type ExtractOutcome, type ExtractedCandidate, type ExtractedEntity, type ExtractionCursorStore, type FactType, type FileMetadata, type FileProcessor, type FileTypeQuery, type FileWithData, type FlushResult, type GetConversationsPageOptions, type GraphTraversalOptions, HARD_DELETE_WINDOW_MS, INFERENCE_ID_HEADER, type InjectionClassifierOptions, type InjectionReason, type LazyStoredConversation, type LlmDecayClassifierOptions, type LlmNeighborRefinerOptions, type LlmTokenUsage, MAX_HOPS, MAX_MESSAGES_PER_SUMMARIZATION, MEDIUM_TTL_MS, Media, type MediaDimensions, type MediaFilterOptions, type MediaMetadata, type MediaOperationsContext, type MediaRole, type MediaType, type MemoriesNeedingTopicExtraction, type EmbeddingOptions as MemoryEngineEmbeddingOptions, type MemoryEngineResult, type MemoryEngineSearchOptions, type MemoryExtractedEvent, type MemoryKind, type MemoryQuarantinedEvent, type MemoryVaultSearchOptions, type MemoryVaultToolOptions, Message, type MessageChunk, type MessageFeedback, type ModelCallEndEvent, type ModelCallStartEvent, ModelPreference, NEVER_TTL_MS, NODE_BUDGET, type NeighborRefiner, type NowSource, type ObservationTrend, type ObservationTrendInput, type OperationExecutor, PAST_EVENT_GRACE_MS, PROFILE_DOC_VERSION, type ParsedServerToolsResponse, PdfProcessor, type PersonalitySettings, type PersonalitySliders, type PersonalityStyle, type PgClientLike, type PgPoolLike, type PlatformStorage, type PortalLlmAuth, PostgreSQLAdapter, type PostgreSQLAdapterOptions, type PreprocessingOptions, type PreprocessingResult, type ProcessedFileResult, ProcessorRegistry, type ProfileConfigFingerprint, type ProfileDoc, type ProfileFacet, type ProfileFacetKey, type ProfileSalienceInput, type ProfileSection, type ProfileUpdate, Project, type ProjectOperationsContext, type PromptContext, type PromptPreProcessor, type PromptPreProcessorContext, type PromptSection, type PromptTemplates, type QuarantinedMemoryInfo, type QueueEncryptionContext, QueueManager, type QueueStatus, type QueuedOperation, type QueuedOperationType, RECALL_MAX_LIMIT, RECALL_TOOL_NAME, type RankedMemory, type RankedProfileCandidate, type RecallContext, type RecallDegradation, type RecallDiagnostics, type RecallOptions, type RecallResult, type RecallToolCallbacks, type RecallToolOptions, type RecencyOptions, type ReflectOptions, type ReflectResult, RerankerUnavailableError, type ResumeStreamOptions, type ResumeStreamResult, type RetainAction, type RetainContext, type RetainOptions, type RetainResult, type RetainSource, type RunEndEvent, type RunErrorEvent, type RunHooks, type RunStartEvent, type RunToolLoopOptions, type RunToolLoopResult, SDK_SCHEMA_VERSION, SERVER_TOOL_DEPENDENCY_SETS, SHORT_TTL_MS, SLIDER_CONFIG, STREAM_RESUMABLE_HEADER, type ScoreBreakdown, type ScoreProfileSalienceOptions, type ScreenResult, type ScreenedCandidate, type SearchSource, type SelectServerToolsForPromptOptions, type ServerTool, type ServerToolCallEvent, type ServerToolsFilterFunction, type ServerToolsOptions, type ServerToolsResponse, type SettingsStorageOperationsContext, type SignMessageFn, type StepFinishEvent, type StockPriceClassification, type StockPricePreProcessorOptions, type StorageOperationsContext, type StoredConversation, type StoredConversationSummary, type StoredFileWithContext, type StoredMedia, type StoredMessage, type StoredMessageWithSimilarity, type StoredModelPreference, type StoredProject, type StoredUserPreference, type StoredVaultMemory, StreamExpiredError, type StreamMetaEvent, type StreamResumeHandle, type StreamSmoothingConfig, type StreamingTransport, type StreamingTransportOptions, type StreamingTransportResult, type StyleAnalysisSchedule, type SynthesizeProfileOptions, TOOL_CATALOG, TOPICS_EXTRACTION_VERSION, TOPIC_EXTRACTION_BATCH_SIZE, TREND_RECENT_WINDOW_DAYS, TREND_STALE_WINDOW_DAYS, type TextChunk, TextProcessor, type ToolConfig, type ToolExecutor, type ToolMatchOptions, type ToolMatchResult, type ToolSet, type ToolUseEndEvent, type ToolUseStartEvent, type TopicExtractOptions, type TopicExtractionInput, type TopicExtractionRunResult, type TurnCompleteEvent, type TurnSkippedEvent, type UpdateMediaOptions, type UpdateModelPreferenceOptions, type UpdateProjectOptions, type UpdateUserPreferenceOptions, type UpdateVaultMemoryOptions, UserPreference, type UserPreferencesStorageOperationsContext, VAULT_SIZE_HOP_CAP, type VaultEmbeddingCache, VaultMemory, type VaultMemoryOperationsContext, type VaultMemoryVisibility, type VaultSaveOperation, type VaultSearchResult, WalletPoller, type WeatherClassification, type WeatherPreProcessorOptions, type WebSearchClassification, type WebSearchPreProcessorOptions, WordProcessor, ZipProcessor, type ZipProcessorOptions, activatedToolSetNames, analyzeStyle, archiveVaultMemoryOp, buildConnectorGuidance, buildDeniedToolsRider, buildSystemPrompt, capHopsForDensity, chunkAndEmbedAllMessages, chunkAndEmbedMessage, chunkText, classifyCryptoPrice, classifyCryptoPriceBatch, classifyDecay, classifyInjectionCandidates, classifyObservationTrend, classifyStockPrice, classifyStockPriceBatch, classifyWeather, classifyWeatherBatch, classifyWebSearch, classifyWebSearchBatch, cleanupConversationSummary, clearAllEncryptionKeys, clearAllEncryptionState, clearAllKeyPairs, clearEncryptionKey, clearKeyPair, clearLazyTitleCache, clearMessagesOp, clearServerToolsCache, composeHooks, createAutoExtractor, createChunkVectorCache, createConversationOp, createCryptoPricePreProcessor, createDecaySweeper, createLlmDecayClassifier, createLlmNeighborRefiner, createMediaBatchOp, createMediaOp, createMemoryEngineTool, createMemoryVaultSearchTool, createMemoryVaultTool, createMessageOp, createPlatformCursorStore, createProjectOp, createRecallTool, createServerToolsFilter, createStockPricePreProcessor, createSummaryContext, createVaultEmbeddingCache, createVaultMemoriesBatchOp, createVaultMemoryOp, createWeatherPreProcessor, createWebSearchPreProcessor, decryptConversationTitle, decryptData, decryptDataBatch, decryptDataBytes, decryptDataBytesFromBytes, decryptDataWithKey, defaultServerToolsFilter, deleteAllVaultMemoriesForUserOp, deleteConversationOp, deleteConversationSummaryOp, deleteMediaByConversationOp, deleteMediaByMessageOp, deleteMediaOp, deleteModelPreferenceOp, deleteProjectOp, deleteUserPreferenceOp, deleteVaultMemoryOp, eagerEmbedContent, embedAllMessages, embedMessage, encryptData, encryptDataBatch, encryptDataBytes, encryptDataWithKey, estimateMessagesTokens, estimateTokens, exportPublicKey, extractAndLinkEntitiesForMemoriesOp, extractAndRetain, extractEntitiesForMemories, extractFacts, findMatchingTools, generateConversationId, generateEmbedding, generateEmbeddings, generateMediaId, generateProjectId, getAIGeneratedMediaOp, getAllFilesOp, getAllVaultMemoriesOp, getAllVaultMemoryContentsOp, getAudioOp, getCachedServerTools, getConversationOp, getConversationSummaryOp, getConversationsByProjectLazyOp, getConversationsByProjectOp, getConversationsLazyOp, getConversationsOp, getConversationsPageOp, getDecayCandidatesRawOp, getDocumentsOp, getEncryptionKey, getImagesOp, getMediaByConversationOp, getMediaByIdOp, getMediaByIdsOp, getMediaByMessageOp, getMediaByModelOp, getMediaByRoleOp, getMediaBySourceUrlOp, getMediaByTypeOp, getMediaCountOp, getMediaCountsByTypeOp, getMediaOp, getMediaTypeFromMime, getMemoriesNeedingTopicExtractionOp, getMessageOp, getMessagesOp, getModelPreferenceOp, getProjectConversationCountOp, getProjectConversationsOp, getProjectOp, getProjectsOp, getRecentMediaOp, getServerTools, getSupportedFileTypes, getToolsChecksum, getUnfiledVaultMemoriesOp, getUserPreferenceOp, getUserUploadedMediaOp, getVaultMemoryOp, getVideosOp, hardDeleteDecayedOp, hardDeleteMediaOp, hasEncryptionKey, hasKeyPair, injectionSignatureCatalog, isRerankerAvailable, isSupportedFile, isSupportedMediaType, makeSyntheticStoredConversation, makeSyntheticStoredMessage, maybeSummarizeHistory, mediaToStored, migrateFromModelPreferencesOp, onKeyAvailable, preEmbedVaultMemories, preprocessFiles, progressiveSummarize, projectToStored, queueManager, rankProfileCandidates, recall, reflect, relinkMisclassifiedVideosOp, renderTemplate, requestEncryptionKey, requestKeyPair, restoreVaultMemoryOp, resumeStream, retain, runToolLoop, sanitizeQuotes, schemaToCreateSQL, scoreProfileSalience, screenCandidatesForInjection, sdkMigrations, sdkModelClasses, sdkSchema, searchChunksOp, searchMediaOp, searchMessagesOp, searchVaultMemories, selectServerToolsForPrompt, serverPlatformStorage, setMemoryVisibilityOp, setModelPreferenceOp, setUserPreferenceOp, shouldAnalyzeStyle, shouldChunkMessage, shouldRefreshTools, splitMessagesAtThreshold, stampTopicsExtractedAtOp, streamCancelPath, streamReplayPath, summarizeObservationTrends, summaryToSystemMessage, supersedeVaultMemoryOp, synthesizeProfile, toolSetSystemPrompts, traverseGraphLane, ttlForType, updateConversationProjectOp, updateConversationTitleOp, updateMediaMessageIdBatchOp, updateMediaOp, updateMessageChunksOp, updateMessageEmbeddingOp, updateMessageErrorOp, updateMessageFeedbackOp, updateModelsOp, updatePersonalityOp, updateProfileOp, updateProjectNameOp, updateProjectOp, updateVaultMemoryEmbeddingOp, updateVaultMemoryOp, upsertConversationSummaryOp, upsertMessageOp };
9360
+ export { type AnalyzeStyleOptions, type AnalyzeStyleResult, type ApiResponse, type ApiType, type AutoExecutedToolResult, type AutoExtractMessage, type AutoExtractor, type Budget, type BuildPromptOptions, type BuildPromptResult, type CachedChunkVectors, type CachedServerTools, type ChatCompletionUsage, type ChatRole, type ChunkSearchResult, type ChunkVectorCache, type ChunkingOptions, type ConnectorGuidance, type ConnectorGuidanceInput, type ConsolidationFallbackReason, Conversation, ConversationSummary, type CreateAutoExtractorOptions, type CreateConversationOptions, type CreateDecaySweeperOptions, type CreateMediaOptions, type CreateMessageOptions, type CreateModelPreferenceOptions, type CreateProjectOptions, type CreateUserPreferenceOptions, type CreateVaultMemoryOptions, type CryptoPriceClassification, type CryptoPricePreProcessorOptions, DEFAULT_ANALYSIS_PROMPT, DEFAULT_ANALYZE_AFTER_MESSAGES, DEFAULT_CACHE_EXPIRATION_MS, DEFAULT_CHUNK_CACHE_SIZE, DEFAULT_CHUNK_OVERLAP, DEFAULT_CHUNK_SIZE, DEFAULT_DECAY_POLICY, DEFAULT_DOCUMENT_PATTERN, DEFAULT_EXCLUDED_SERVER_TOOLS, DEFAULT_MAX_CLASSIFIER_CALLS_PER_SWEEP, DEFAULT_MAX_INPUT_MESSAGES, DEFAULT_MAX_PROFILE_LENGTH, DEFAULT_MIN_CHUNK_SIZE, DEFAULT_MIN_MESSAGES, DEFAULT_PERSONALITY_SETTINGS, DEFAULT_PROFILE_FACETS, DEFAULT_PROFILE_FACT_TYPE_WEIGHTS, DEFAULT_PROFILE_PROOF_ALPHA, DEFAULT_PROFILE_TREND_MULTIPLIERS, DEFAULT_PROMPT_TEMPLATES, DEFAULT_REFRESH_EVERY_MESSAGES, DEFAULT_SERVER_TOOLS_MATCH_OPTIONS, DEFAULT_SUMMARY_MIN_WINDOW_MESSAGES, DEFAULT_SUMMARY_MODEL, DEFAULT_SUMMARY_TOKEN_THRESHOLD, DEFAULT_VAULT_CACHE_SIZE, DatabaseManager, type DatabaseManagerLogger, type DatabaseManagerOptions, type DecayCandidateRaw, type DecayClassifier, type DecayInput, type DecayPolicy, type DecaySweepResult, type DecaySweeper, type DecayVerdict, ENTITY_FANOUT, type EmbeddedWalletSignerFn, ExcelProcessor, type ExtractFactsOptions, type ExtractOutcome, type ExtractedCandidate, type ExtractedEntity, type ExtractionCursorStore, type FactType, type FileMetadata, type FileProcessor, type FileTypeQuery, type FileWithData, type FlushResult, type GetConversationsPageOptions, type GraphTraversalOptions, HARD_DELETE_WINDOW_MS, INFERENCE_ID_HEADER, type InjectionClassifierOptions, type InjectionReason, type LazyStoredConversation, type LlmDecayClassifierOptions, type LlmNeighborRefinerOptions, type LlmTokenUsage, MAX_HOPS, MAX_MESSAGES_PER_SUMMARIZATION, MEDIUM_TTL_MS, Media, type MediaDimensions, type MediaFilterOptions, type MediaMetadata, type MediaOperationsContext, type MediaRole, type MediaType, type MemoriesNeedingTopicExtraction, type EmbeddingOptions as MemoryEngineEmbeddingOptions, type MemoryEngineResult, type MemoryEngineSearchOptions, type MemoryExtractedEvent, type MemoryKind, type MemoryQuarantinedEvent, type MemoryVaultSearchOptions, type MemoryVaultToolOptions, Message, type MessageChunk, type MessageFeedback, type ModelCallEndEvent, type ModelCallStartEvent, ModelPreference, NEVER_TTL_MS, NODE_BUDGET, type NeighborRefiner, type NowSource, type ObservationTrend, type ObservationTrendInput, type OperationExecutor, PAST_EVENT_GRACE_MS, PROFILE_DOC_VERSION, type ParsedServerToolsResponse, PdfProcessor, type PersonalitySettings, type PersonalitySliders, type PersonalityStyle, type PgClientLike, type PgPoolLike, type PlatformStorage, type PortalLlmAuth, PostgreSQLAdapter, type PostgreSQLAdapterOptions, type PreprocessingOptions, type PreprocessingResult, type ProcessedFileResult, ProcessorRegistry, type ProfileConfigFingerprint, type ProfileDoc, type ProfileFacet, type ProfileFacetKey, type ProfileSalienceInput, type ProfileSection, type ProfileUpdate, Project, type ProjectOperationsContext, type PromptContext, type PromptPreProcessor, type PromptPreProcessorContext, type PromptSection, type PromptTemplates, type QuarantinedMemoryInfo, type QueueEncryptionContext, QueueManager, type QueueStatus, type QueuedOperation, type QueuedOperationType, RECALL_MAX_LIMIT, RECALL_TOOL_NAME, type RankedMemory, type RankedProfileCandidate, type RecallContext, type RecallDegradation, type RecallDiagnostics, type RecallOptions, type RecallResult, type RecallToolCallbacks, type RecallToolOptions, type RecencyOptions, type ReflectOptions, type ReflectResult, RerankerUnavailableError, type ResumeStreamOptions, type ResumeStreamResult, type RetainAction, type RetainContext, type RetainOptions, type RetainResult, type RetainSource, type RunEndEvent, type RunErrorEvent, type RunHooks, type RunStartEvent, type RunTerminalState, type RunToolLoopOptions, type RunToolLoopResult, SDK_SCHEMA_VERSION, SERVER_TOOL_DEPENDENCY_SETS, SHORT_TTL_MS, SLIDER_CONFIG, STREAM_RESUMABLE_HEADER, type ScoreBreakdown, type ScoreProfileSalienceOptions, type ScreenResult, type ScreenedCandidate, type SearchSource, type SelectServerToolsForPromptOptions, type ServerTool, type ServerToolCallEvent, type ServerToolsFilterFunction, type ServerToolsOptions, type ServerToolsResponse, type SettingsStorageOperationsContext, type SignMessageFn, type StepFinishEvent, type StockPriceClassification, type StockPricePreProcessorOptions, type StorageOperationsContext, type StoredConversation, type StoredConversationSummary, type StoredFileWithContext, type StoredMedia, type StoredMessage, type StoredMessageWithSimilarity, type StoredModelPreference, type StoredProject, type StoredUserPreference, type StoredVaultMemory, StreamExpiredError, type StreamMetaEvent, type StreamResumeHandle, type StreamSmoothingConfig, type StreamingTransport, type StreamingTransportOptions, type StreamingTransportResult, type StyleAnalysisSchedule, type SynthesizeProfileOptions, TOOL_CATALOG, TOPICS_EXTRACTION_VERSION, TOPIC_EXTRACTION_BATCH_SIZE, TREND_RECENT_WINDOW_DAYS, TREND_STALE_WINDOW_DAYS, type TextChunk, TextProcessor, type ToolConfig, type ToolExecutor, type ToolMatchOptions, type ToolMatchResult, type ToolSet, type ToolUseEndEvent, type ToolUseStartEvent, type TopicExtractOptions, type TopicExtractionInput, type TopicExtractionRunResult, type TurnCompleteEvent, type TurnSkippedEvent, type UpdateMediaOptions, type UpdateModelPreferenceOptions, type UpdateProjectOptions, type UpdateUserPreferenceOptions, type UpdateVaultMemoryOptions, UserPreference, type UserPreferencesStorageOperationsContext, VAULT_SIZE_HOP_CAP, type VaultEmbeddingCache, VaultMemory, type VaultMemoryOperationsContext, type VaultMemoryVisibility, type VaultSaveOperation, type VaultSearchResult, WalletPoller, type WeatherClassification, type WeatherPreProcessorOptions, type WebSearchClassification, type WebSearchPreProcessorOptions, WordProcessor, ZipProcessor, type ZipProcessorOptions, activatedToolSetNames, analyzeStyle, archiveVaultMemoryOp, buildConnectorGuidance, buildDeniedToolsRider, buildSystemPrompt, capHopsForDensity, chunkAndEmbedAllMessages, chunkAndEmbedMessage, chunkText, classifyCryptoPrice, classifyCryptoPriceBatch, classifyDecay, classifyInjectionCandidates, classifyObservationTrend, classifyStockPrice, classifyStockPriceBatch, classifyWeather, classifyWeatherBatch, classifyWebSearch, classifyWebSearchBatch, cleanupConversationSummary, clearAllEncryptionKeys, clearAllEncryptionState, clearAllKeyPairs, clearEncryptionKey, clearKeyPair, clearLazyTitleCache, clearMessagesOp, clearServerToolsCache, composeHooks, createAutoExtractor, createChunkVectorCache, createConversationOp, createCryptoPricePreProcessor, createDecaySweeper, createLlmDecayClassifier, createLlmNeighborRefiner, createMediaBatchOp, createMediaOp, createMemoryEngineTool, createMemoryVaultSearchTool, createMemoryVaultTool, createMessageOp, createPlatformCursorStore, createProjectOp, createRecallTool, createServerToolsFilter, createStockPricePreProcessor, createSummaryContext, createVaultEmbeddingCache, createVaultMemoriesBatchOp, createVaultMemoryOp, createWeatherPreProcessor, createWebSearchPreProcessor, decryptConversationTitle, decryptData, decryptDataBatch, decryptDataBytes, decryptDataBytesFromBytes, decryptDataWithKey, defaultServerToolsFilter, deleteAllVaultMemoriesForUserOp, deleteConversationOp, deleteConversationSummaryOp, deleteMediaByConversationOp, deleteMediaByMessageOp, deleteMediaOp, deleteModelPreferenceOp, deleteProjectOp, deleteUserPreferenceOp, deleteVaultMemoryOp, eagerEmbedContent, embedAllMessages, embedMessage, encryptData, encryptDataBatch, encryptDataBytes, encryptDataWithKey, estimateMessagesTokens, estimateTokens, exportPublicKey, extractAndLinkEntitiesForMemoriesOp, extractAndRetain, extractEntitiesForMemories, extractFacts, findMatchingTools, generateConversationId, generateEmbedding, generateEmbeddings, generateMediaId, generateProjectId, getAIGeneratedMediaOp, getAllFilesOp, getAllVaultMemoriesOp, getAllVaultMemoryContentsOp, getAudioOp, getCachedServerTools, getConversationOp, getConversationSummaryOp, getConversationsByProjectLazyOp, getConversationsByProjectOp, getConversationsLazyOp, getConversationsOp, getConversationsPageOp, getDecayCandidatesRawOp, getDocumentsOp, getEncryptionKey, getImagesOp, getMediaByConversationOp, getMediaByIdOp, getMediaByIdsOp, getMediaByMessageOp, getMediaByModelOp, getMediaByRoleOp, getMediaBySourceUrlOp, getMediaByTypeOp, getMediaCountOp, getMediaCountsByTypeOp, getMediaOp, getMediaTypeFromMime, getMemoriesNeedingTopicExtractionOp, getMessageOp, getMessagesOp, getModelPreferenceOp, getProjectConversationCountOp, getProjectConversationsOp, getProjectOp, getProjectsOp, getRecentMediaOp, getServerTools, getSupportedFileTypes, getToolsChecksum, getUnfiledVaultMemoriesOp, getUserPreferenceOp, getUserUploadedMediaOp, getVaultMemoryOp, getVideosOp, hardDeleteDecayedOp, hardDeleteMediaOp, hasEncryptionKey, hasKeyPair, injectionSignatureCatalog, isRerankerAvailable, isSupportedFile, isSupportedMediaType, makeSyntheticStoredConversation, makeSyntheticStoredMessage, maybeSummarizeHistory, mediaToStored, migrateFromModelPreferencesOp, onKeyAvailable, preEmbedVaultMemories, preprocessFiles, progressiveSummarize, projectToStored, queueManager, rankProfileCandidates, recall, reflect, relinkMisclassifiedVideosOp, renderTemplate, requestEncryptionKey, requestKeyPair, restoreVaultMemoryOp, resumeStream, retain, runToolLoop, sanitizeQuotes, schemaToCreateSQL, scoreProfileSalience, screenCandidatesForInjection, sdkMigrations, sdkModelClasses, sdkSchema, searchChunksOp, searchMediaOp, searchMessagesOp, searchVaultMemories, selectServerToolsForPrompt, serverPlatformStorage, setMemoryVisibilityOp, setModelPreferenceOp, setUserPreferenceOp, shouldAnalyzeStyle, shouldChunkMessage, shouldRefreshTools, splitMessagesAtThreshold, stampTopicsExtractedAtOp, streamCancelPath, streamReplayPath, summarizeObservationTrends, summaryToSystemMessage, supersedeVaultMemoryOp, synthesizeProfile, toolSetSystemPrompts, traverseGraphLane, ttlForType, updateConversationProjectOp, updateConversationTitleOp, updateMediaMessageIdBatchOp, updateMediaOp, updateMessageChunksOp, updateMessageEmbeddingOp, updateMessageErrorOp, updateMessageFeedbackOp, updateModelsOp, updatePersonalityOp, updateProfileOp, updateProjectNameOp, updateProjectOp, updateVaultMemoryEmbeddingOp, updateVaultMemoryOp, upsertConversationSummaryOp, upsertMessageOp };