@anuma/sdk 6.36.0 → 6.38.0

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.
@@ -20350,6 +20350,46 @@ init_clientConfig();
20350
20350
 
20351
20351
  // src/tools/confirmConstants.ts
20352
20352
  var CONFIRM_TOOL_NAME = "prompt_user_confirm";
20353
+ var BOOK_RESTAURANT = {
20354
+ tool: "AnumaPaymentsMCP-anuma_book_restaurant",
20355
+ status: "confirmed_not_booked",
20356
+ fields: ["venue_id", "config_id", "party_size", "day", "venue_name", "time"]
20357
+ };
20358
+ var CANCEL_RESERVATION = {
20359
+ tool: "AnumaPaymentsMCP-anuma_cancel_reservation",
20360
+ status: "confirmed_not_cancelled",
20361
+ fields: [
20362
+ "reservation_id",
20363
+ "venue_name",
20364
+ "day",
20365
+ "time",
20366
+ "party_size",
20367
+ "fee_applies",
20368
+ "fee_amount"
20369
+ ]
20370
+ };
20371
+ var CONFIRM_REQUIRED_FIELDS = /* @__PURE__ */ new Map([
20372
+ ["book_restaurant", BOOK_RESTAURANT],
20373
+ ["anuma_book_restaurant", BOOK_RESTAURANT],
20374
+ ["anumapaymentsmcp-anuma_book_restaurant", BOOK_RESTAURANT],
20375
+ ["cancel_reservation", CANCEL_RESERVATION],
20376
+ ["anuma_cancel_reservation", CANCEL_RESERVATION],
20377
+ ["anumapaymentsmcp-anuma_cancel_reservation", CANCEL_RESERVATION]
20378
+ ]);
20379
+ function confirmRequirement(action) {
20380
+ if (typeof action !== "string") return void 0;
20381
+ return CONFIRM_REQUIRED_FIELDS.get(action.trim().toLowerCase());
20382
+ }
20383
+ function missingConfirmFields(action, parameters) {
20384
+ const requirement = confirmRequirement(action);
20385
+ if (!requirement) return [];
20386
+ const shown = /* @__PURE__ */ new Set();
20387
+ for (const parameter of Array.isArray(parameters) ? parameters : []) {
20388
+ const { name, value } = parameter ?? {};
20389
+ if (typeof name === "string" && typeof value === "string" && value.trim()) shown.add(name);
20390
+ }
20391
+ return requirement.fields.filter((field10) => !shown.has(field10));
20392
+ }
20353
20393
 
20354
20394
  // src/lib/chat/toolLoop.ts
20355
20395
  init_redactor();
@@ -23219,6 +23259,7 @@ function getToolName(tool) {
23219
23259
  }
23220
23260
  function toolsAfterConfirmation(apiTools, executionResults) {
23221
23261
  const members = /* @__PURE__ */ new Set();
23262
+ let keepConfirm = false;
23222
23263
  for (const r of executionResults) {
23223
23264
  if (r.name !== CONFIRM_TOOL_NAME) continue;
23224
23265
  const answer = r.result;
@@ -23226,11 +23267,12 @@ function toolsAfterConfirmation(apiTools, executionResults) {
23226
23267
  const setName = CONFIRMED_ACTION_TOOL_SETS.get(answer.action.trim().toLowerCase());
23227
23268
  const set = BUILT_IN_TOOL_SETS.find((s) => s.name === setName);
23228
23269
  for (const member of set?.members ?? []) members.add(member);
23270
+ if (missingConfirmFields(answer.action, answer.parameters).length > 0) keepConfirm = true;
23229
23271
  }
23230
23272
  if (!apiTools.some((t) => members.has(getToolName(t) ?? ""))) return void 0;
23231
23273
  return apiTools.filter((t) => {
23232
23274
  const name = getToolName(t) ?? "";
23233
- return members.has(name) || name === CONFIRM_TOOL_NAME || name === TOOL_SEARCH_TOOL_NAME;
23275
+ return members.has(name) || name === TOOL_SEARCH_TOOL_NAME || keepConfirm && name === CONFIRM_TOOL_NAME;
23234
23276
  });
23235
23277
  }
23236
23278
  var STREAM_RESUMABLE_HEADER = "X-Stream-Resumable";
@@ -28051,22 +28093,35 @@ async function vaultMemoryRawToStored(raw, walletAddress, signMessage, embeddedW
28051
28093
  return stored;
28052
28094
  }
28053
28095
  async function getAllVaultMemoriesOp(ctx, options) {
28054
- const conditions = [
28096
+ const results = await ctx.vaultMemoryCollection.query(...vaultListConditions(ctx, options), ...vaultListOrder(options)).unsafeFetchRaw();
28097
+ return mapInBatches(
28098
+ results,
28099
+ (raw) => vaultMemoryRawToStored(raw, ctx.walletAddress, ctx.signMessage, ctx.embeddedWalletSigner)
28100
+ );
28101
+ }
28102
+ function vaultListConditions(ctx, options) {
28103
+ return [
28055
28104
  ...baseVaultConditions(ctx, options),
28056
28105
  ...options?.scopes?.length ? [import_watermelondb19.Q.where("scope", import_watermelondb19.Q.oneOf(options.scopes))] : [],
28057
28106
  ...visibilityConditions(options?.visibility),
28058
28107
  ...levelConditions(options?.levels),
28059
28108
  ...options?.kinds?.length ? [import_watermelondb19.Q.where("kind", import_watermelondb19.Q.oneOf(options.kinds))] : [],
28060
28109
  ...options?.folderId !== void 0 ? [import_watermelondb19.Q.where("folder_id", options.folderId)] : [],
28061
- ...options?.factTypes?.length ? [import_watermelondb19.Q.where("fact_type", import_watermelondb19.Q.oneOf(options.factTypes))] : [],
28110
+ ...options?.factTypes?.length ? [import_watermelondb19.Q.where("fact_type", import_watermelondb19.Q.oneOf(options.factTypes))] : []
28111
+ ];
28112
+ }
28113
+ function vaultListOrder(options) {
28114
+ return [
28062
28115
  import_watermelondb19.Q.sortBy(options?.since ? "updated_at" : "created_at", import_watermelondb19.Q.desc),
28063
28116
  ...options?.limit !== null && options?.limit !== void 0 && options.limit > 0 ? [import_watermelondb19.Q.take(options.limit)] : []
28064
28117
  ];
28065
- const results = await ctx.vaultMemoryCollection.query(...conditions).unsafeFetchRaw();
28066
- return mapInBatches(
28067
- results,
28068
- (raw) => vaultMemoryRawToStored(raw, ctx.walletAddress, ctx.signMessage, ctx.embeddedWalletSigner)
28069
- );
28118
+ }
28119
+ async function getVaultMemoryProjectionsOp(ctx, options) {
28120
+ const results = await ctx.vaultMemoryCollection.query(...vaultListConditions(ctx, options), ...vaultListOrder(options)).unsafeFetchRaw();
28121
+ return results.map((raw) => ({
28122
+ ...vaultMemoryRawToRankable(raw),
28123
+ topicsUserManaged: raw.topics_user_managed === true || raw.topics_user_managed === 1
28124
+ }));
28070
28125
  }
28071
28126
  function vaultMemoryRawToRankable(raw) {
28072
28127
  return {
@@ -34903,6 +34958,7 @@ function createLocalMemoryStore(options) {
34903
34958
  };
34904
34959
  const vaultCache = options.vaultCache ?? createVaultEmbeddingCache();
34905
34960
  const ownedBy = userId !== void 0 ? [import_watermelondb24.Q.where("user_id", userId)] : [];
34961
+ const linksOwnedBy = userId === void 0 ? [] : options.allowUnscopedRows ? [import_watermelondb24.Q.or(import_watermelondb24.Q.where("user_id", userId), import_watermelondb24.Q.where("user_id", null))] : [import_watermelondb24.Q.where("user_id", userId)];
34906
34962
  const watchedColumns = [
34907
34963
  "content",
34908
34964
  "scope",
@@ -34945,6 +35001,29 @@ function createLocalMemoryStore(options) {
34945
35001
  },
34946
35002
  memoriesByTopics: (names) => getMemoriesByEntityNamesOp(entityCtx, names),
34947
35003
  topicsByMemories: (memoryIds) => getEntitiesByMemoryIdsOp(entityCtx, memoryIds),
35004
+ listTopics: async () => {
35005
+ const links = await entityCtx.memoryEntityCollection.query(...linksOwnedBy).fetch();
35006
+ const members = /* @__PURE__ */ new Map();
35007
+ for (const link of links) {
35008
+ const entityId = String(link.entityId);
35009
+ const set = members.get(entityId) ?? /* @__PURE__ */ new Set();
35010
+ set.add(String(link.memoryId));
35011
+ members.set(entityId, set);
35012
+ }
35013
+ const entities = userId === void 0 ? await entityCtx.entityCollection.query().fetch() : members.size ? await entityCtx.entityCollection.query(import_watermelondb24.Q.where("id", import_watermelondb24.Q.oneOf([...members.keys()]))).fetch() : [];
35014
+ const byName = /* @__PURE__ */ new Map();
35015
+ for (const entity of entities) {
35016
+ const count = members.get(entity.id)?.size ?? 0;
35017
+ const existing = byName.get(entity.canonicalName);
35018
+ byName.set(entity.canonicalName, {
35019
+ name: entity.canonicalName,
35020
+ kind: existing?.kind ?? entity.kind ?? null,
35021
+ memoryCount: (existing?.memoryCount ?? 0) + count
35022
+ });
35023
+ }
35024
+ return [...byName.values()].sort((a, b) => a.name.localeCompare(b.name));
35025
+ },
35026
+ listProjections: (listOptions) => getVaultMemoryProjectionsOp(vaultCtx, listOptions),
34948
35027
  create: async (input) => {
34949
35028
  const created = await createVaultMemoryOp(vaultCtx, input);
34950
35029
  if (input.embedding === void 0) embedInBackground(created);
@@ -35006,7 +35085,6 @@ function createLocalMemoryStore(options) {
35006
35085
  );
35007
35086
  const subscriptions = [memories.subscribe(afterFirst())];
35008
35087
  if (subscribeOptions?.topics) {
35009
- const linksOwnedBy = userId === void 0 ? [] : options.allowUnscopedRows ? [import_watermelondb24.Q.or(import_watermelondb24.Q.where("user_id", userId), import_watermelondb24.Q.where("user_id", null))] : [import_watermelondb24.Q.where("user_id", userId)];
35010
35088
  subscriptions.push(
35011
35089
  entityCtx.memoryEntityCollection.query(...linksOwnedBy).observe().subscribe(afterFirst())
35012
35090
  );
@@ -7254,6 +7254,48 @@ interface StoredVaultMemory {
7254
7254
  updatedAt: Date;
7255
7255
  isDeleted: boolean;
7256
7256
  }
7257
+ /**
7258
+ * Content-free projection of a vault memory, used to RANK candidates for recall
7259
+ * WITHOUT decrypting the (encrypted) `content` column. Everything here is a
7260
+ * plaintext-at-rest column — `embedding` is stored plaintext (schema v21), and
7261
+ * `folderId`/`updatedAt` drive source-filtering + tie-breaks. There is
7262
+ * deliberately NO `content` field: a ranking pass must never carry ciphertext
7263
+ * masquerading as the plaintext `StoredVaultMemory.content`. Decrypt the top-N
7264
+ * winners on demand via {@link getVaultMemoryOp}.
7265
+ */
7266
+ interface RankableVaultMemory {
7267
+ /** WatermelonDB internal ID — pass to `getVaultMemoryOp` to decrypt on demand. */
7268
+ uniqueId: string;
7269
+ /** Scope for partitioning memories (e.g., "private", "shared"). */
7270
+ scope: string;
7271
+ /** Folder ID for organization, null if unfiled. */
7272
+ folderId: string | null;
7273
+ /** JSON-stringified embedding vector, null if not yet computed. */
7274
+ embedding: string | null;
7275
+ /** Model that produced `embedding`. Null on legacy rows. */
7276
+ embeddingModel: string | null;
7277
+ createdAt: Date;
7278
+ updatedAt: Date;
7279
+ /** C3 re-observation watermark (`last_observed_at`), Unix ms or null — the
7280
+ * same column {@link StoredVaultMemory.lastObservedAt} carries. A retain()
7281
+ * consolidation `update` rewrites `content` under `preserveUpdatedAt`, so
7282
+ * `updatedAt` stays pinned and only this column moves. A consumer that
7283
+ * decides "has this row changed since I last sent it" from `updatedAt` alone
7284
+ * (the Nearby publish reconciler) never sees that rewrite; it must take
7285
+ * `max(updatedAt, lastObservedAt)`.
7286
+ *
7287
+ * OPTIONAL, not just nullable: `RankableVaultMemory` is a public exported
7288
+ * type, and this field is new. Required would break any existing consumer
7289
+ * constructing a literal of this shape (a test fixture, a mock) — the same
7290
+ * reason every other watermark field of this kind in this package
7291
+ * (memory/types.ts, memoryVault/searchTool.ts) is optional rather than
7292
+ * required. `vaultMemoryRawToRankable` still always sets it. */
7293
+ lastObservedAt?: number | null;
7294
+ }
7295
+ /** @public */
7296
+ interface VaultMemoryProjection extends RankableVaultMemory {
7297
+ topicsUserManaged: boolean;
7298
+ }
7257
7299
  /**
7258
7300
  * A photo a server-extracted memory came from, as
7259
7301
  * GET /api/memories/published returns it in `media[]`.
@@ -9383,7 +9425,7 @@ interface MemoryListOptions {
9383
9425
  * passing provenance, trust or publication metadata through manual creation.
9384
9426
  * @public
9385
9427
  */
9386
- type MemoryCreate = Pick<CreateVaultMemoryOptions, "content" | "scope" | "factType" | "eventTime" | "embedding" | "embeddingModel" | "geohash">;
9428
+ type MemoryCreate = Pick<CreateVaultMemoryOptions, "content" | "scope" | "factType" | "eventTime" | "embedding" | "embeddingModel" | "geohash" | "kind" | "kindValue" | "level">;
9387
9429
  /**
9388
9430
  * The edits an app makes to an existing memory. Deliberately narrower than
9389
9431
  * {@link UpdateVaultMemoryOptions}: the re-observation knobs (`proofCountIncrement`,
@@ -9399,7 +9441,7 @@ type MemoryCreate = Pick<CreateVaultMemoryOptions, "content" | "scope" | "factTy
9399
9441
  * `embedding` (with `embeddingModel`) only when you already have the new one.
9400
9442
  * @public
9401
9443
  */
9402
- type MemoryUpdate = Pick<UpdateVaultMemoryOptions, "content" | "scope" | "factType" | "eventTime" | "embedding" | "embeddingModel">;
9444
+ type MemoryUpdate = Pick<UpdateVaultMemoryOptions, "content" | "scope" | "factType" | "eventTime" | "embedding" | "embeddingModel" | "kind" | "kindValue" | "level">;
9403
9445
  /**
9404
9446
  * Fact-only recall. Conversation chunks are message storage, not memory, so
9405
9447
  * the chunk-lane knobs are not part of this surface; nor is `folderId` (see
@@ -9425,6 +9467,15 @@ type MemoryRecallOptions = Omit<RecallOptions, "types" | "includeChunks" | "conv
9425
9467
  * @public
9426
9468
  */
9427
9469
  type MemoryRetainOptions = Omit<RetainOptions, "folderId">;
9470
+ /**
9471
+ * A topic and how many memories link to it.
9472
+ * @public
9473
+ */
9474
+ interface MemoryTopic {
9475
+ name: string;
9476
+ kind: string | null;
9477
+ memoryCount: number;
9478
+ }
9428
9479
  /** @public */
9429
9480
  interface MemorySubscribeOptions {
9430
9481
  /**
@@ -9506,6 +9557,10 @@ interface MemoryStore {
9506
9557
  memoriesByTopics(names: readonly string[]): Promise<Map<string, Set<string>>>;
9507
9558
  /** Memory id → its canonical (lowercased) topic names. Unlinked ids are absent. */
9508
9559
  topicsByMemories(memoryIds: readonly string[]): Promise<Map<string, Set<string>>>;
9560
+ /** Every topic by canonical name, with its kind and linked-memory count. */
9561
+ listTopics(): Promise<MemoryTopic[]>;
9562
+ /** The memories {@link MemoryStore.list} would return, without decrypting content. */
9563
+ listProjections(options?: MemoryListOptions): Promise<VaultMemoryProjection[]>;
9509
9564
  /** Manual save; missing embeddings are filled in the background. */
9510
9565
  create(input: MemoryCreate): Promise<StoredVaultMemory>;
9511
9566
  /** One write for a batch of manual saves; migration/restore uses lower-level operations. */
@@ -10787,4 +10842,4 @@ declare class PostgreSQLAdapter implements DatabaseAdapter {
10787
10842
  */
10788
10843
  declare function serverPlatformStorage(): PlatformStorage;
10789
10844
 
10790
- 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 ConsolidationAction, 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, type DurableAutoExtractorOptions, ENTITY_FANOUT, type EmbeddedWalletSignerFn, EncryptionKeyMissingError, ExcelProcessor, type ExtractFactsOptions, type ExtractOutcome, type ExtractedCandidate, type ExtractedEntity, type ExtractionCursorStore, type ExtractionFunnel, type ExtractionTimings, type FactType, type FileMetadata, type FileProcessingReason, type FileProcessingStatus, 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, type LocalMemoryStoreOptions, MAX_HOPS, MAX_MESSAGES_PER_SUMMARIZATION, MEDIUM_TTL_MS, MEMORY_KINDS, MEMORY_LEVELS, Media, type MediaDimensions, type MediaFilterOptions, type MediaMetadata, type MediaOperationsContext, type MediaRole, type MediaType, type MemoriesNeedingTopicExtraction, type MemoryContextItem, type MemoryContextLane, type MemoryContextOptions, type MemoryContextResult, type EmbeddingOptions as MemoryEngineEmbeddingOptions, type MemoryEngineResult, type MemoryEngineSearchOptions, type MemoryExtractedEvent, type MemoryKind, type MemoryLevel, MemoryLevelError, type MemoryListOptions, type MemoryMaintenance, type MemoryQuarantinedEvent, type MemoryRecallOptions, type MemoryRetainOptions, type MemoryStore, type MemorySubscribeOptions, type MemoryToVerify, type MemoryUpdate, type MemoryVaultSearchOptions, type MemoryVaultToolOptions, type MemoryVerification, Message, type MessageChunk, type MessageFeedback, type MessageOrigin, 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 PhotoIngestResult, type PhotoMediaRef, type PlatformStorage, type PortalLlmAuth, type PortalLlmFailure, type PortalLlmFailureReason, 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 PublishedPhotoMemory, 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 RecallEmptyReason, type RecallOptions, type RecallResult, type RecallToolCallbacks, type RecallToolOptions, type RecencyOptions, type ReflectOptions, type ReflectResult, type RequestEncryptionKeyOptions, 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 TopicSkipReason, type TurnCompleteEvent, type TurnSkippedEvent, type UncheckedReason, type UnverifiableReason, type UpdateMediaOptions, type UpdateModelPreferenceOptions, type UpdateProjectOptions, type UpdateUserPreferenceOptions, type UpdateVaultMemoryOptions, UserPreference, type UserPreferencesStorageOperationsContext, VAULT_SIZE_HOP_CAP, type VaultEmbeddingCache, type VaultEmbeddingExpectation, VaultMemory, type VaultMemoryKind, type VaultMemoryOperationsContext, type VaultMemoryVisibility, type VaultSaveOperation, type VaultSearchResult, type VerificationSources, type VerifyMemoriesForPublishOptions, WalletPoller, type WeatherClassification, type WeatherPreProcessorOptions, type WebSearchClassification, type WebSearchPreProcessorOptions, WordProcessor, ZipProcessor, type ZipProcessorOptions, activatedToolSetNames, analyzeStyle, archiveVaultMemoryOp, assembleMemoryContext, backfillMemoryTopicsOp, 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, createDurableAutoExtractor, createLlmDecayClassifier, createLlmNeighborRefiner, createLocalMemoryStore, createMediaBatchOp, createMediaOp, createMemoryEngineTool, createMemoryVaultSearchTool, createMemoryVaultTool, createMessageOp, createMessageSourceResolver, createPlatformCursorStore, createProjectOp, createRecallTool, createServerToolsFilter, createStockPricePreProcessor, createSummaryContext, createVaultEmbeddingCache, createVaultMemoriesBatchOp, createVaultMemoryOp, createWeatherPreProcessor, createWebSearchPreProcessor, decryptConversationTitle, decryptData, decryptDataBatch, decryptDataBytes, decryptDataBytesFromBytes, decryptDataWithKey, defaultServerToolsFilter, deleteAllVaultMemoriesForUserOp, deleteConversationOp, deleteConversationSummaryOp, deleteMediaByConversationOp, deleteMediaByMessageOp, deleteMediaOp, deleteMessageOp, deleteModelPreferenceOp, deleteProjectOp, deleteUserPreferenceOp, deleteVaultMemoryOp, deriveKeyFromSignatureBytes, eagerEmbedContent, embedAllMessages, embedMessage, encryptData, encryptDataBatch, encryptDataBytes, encryptDataWithKey, estimateMessagesTokens, estimateTokens, exportPublicKey, extractAndLinkEntitiesForMemoriesOp, extractAndRetain, extractEntitiesForMemories, extractFacts, findMatchingTools, formatFileProcessingNotes, 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, ingestPublishedPhotoMemoriesOp, injectionSignatureCatalog, isDegradedTopicSkip, isRerankerAvailable, isSupportedFile, isSupportedMediaType, makeSyntheticStoredConversation, makeSyntheticStoredMessage, maybeSummarizeHistory, mediaToStored, migrateFromModelPreferencesOp, onKeyAvailable, parseMedia, preEmbedVaultMemories, preprocessFiles, progressiveSummarize, projectToStored, queueManager, rankProfileCandidates, recall, reflect, refreshEncryptionKeyIfMatches, relinkMemoryTopicsOp, relinkMisclassifiedVideosOp, renderTemplate, requestEncryptionKey, requestKeyPair, restoreVaultMemoryOp, resumeStream, retain, runToolLoop, sanitizeQuotes, schemaToCreateSQL, scoreProfileSalience, screenCandidatesForInjection, sdkMigrations, sdkModelClasses, sdkSchema, searchChunksOp, searchMediaOp, searchMessagesOp, searchVaultMemories, seedEncryptionKeys, selectServerToolsForPrompt, serverPlatformStorage, setMemoryVisibilityOp, setModelPreferenceOp, setUserPreferenceOp, shouldAnalyzeStyle, shouldChunkMessage, shouldRecallMemory, shouldRefreshTools, splitMessagesAtThreshold, stampTopicsExtractedAtOp, streamCancelPath, streamReplayPath, stripLegacyChunkTextOp, summarizeObservationTrends, summaryToSystemMessage, supersedeVaultMemoryOp, synthesizeProfile, toolSetSystemPrompts, traverseGraphLane, ttlForType, updateConversationProjectOp, updateConversationTitleOp, updateMediaMessageIdBatchOp, updateMediaOp, updateMessageChunksOp, updateMessageEmbeddingOp, updateMessageErrorOp, updateMessageFeedbackOp, updateModelsOp, updatePersonalityOp, updateProfileOp, updateProjectNameOp, updateProjectOp, updateVaultMemoryEmbeddingOp, updateVaultMemoryOp, upsertConversationSummaryOp, upsertMessageOp, verifyMemoriesForPublish };
10845
+ 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 ConsolidationAction, 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, type DurableAutoExtractorOptions, ENTITY_FANOUT, type EmbeddedWalletSignerFn, EncryptionKeyMissingError, ExcelProcessor, type ExtractFactsOptions, type ExtractOutcome, type ExtractedCandidate, type ExtractedEntity, type ExtractionCursorStore, type ExtractionFunnel, type ExtractionTimings, type FactType, type FileMetadata, type FileProcessingReason, type FileProcessingStatus, 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, type LocalMemoryStoreOptions, MAX_HOPS, MAX_MESSAGES_PER_SUMMARIZATION, MEDIUM_TTL_MS, MEMORY_KINDS, MEMORY_LEVELS, Media, type MediaDimensions, type MediaFilterOptions, type MediaMetadata, type MediaOperationsContext, type MediaRole, type MediaType, type MemoriesNeedingTopicExtraction, type MemoryContextItem, type MemoryContextLane, type MemoryContextOptions, type MemoryContextResult, type EmbeddingOptions as MemoryEngineEmbeddingOptions, type MemoryEngineResult, type MemoryEngineSearchOptions, type MemoryExtractedEvent, type MemoryKind, type MemoryLevel, MemoryLevelError, type MemoryListOptions, type MemoryMaintenance, type MemoryQuarantinedEvent, type MemoryRecallOptions, type MemoryRetainOptions, type MemoryStore, type MemorySubscribeOptions, type MemoryToVerify, type MemoryTopic, type MemoryUpdate, type MemoryVaultSearchOptions, type MemoryVaultToolOptions, type MemoryVerification, Message, type MessageChunk, type MessageFeedback, type MessageOrigin, 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 PhotoIngestResult, type PhotoMediaRef, type PlatformStorage, type PortalLlmAuth, type PortalLlmFailure, type PortalLlmFailureReason, 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 PublishedPhotoMemory, 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 RecallEmptyReason, type RecallOptions, type RecallResult, type RecallToolCallbacks, type RecallToolOptions, type RecencyOptions, type ReflectOptions, type ReflectResult, type RequestEncryptionKeyOptions, 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 TopicSkipReason, type TurnCompleteEvent, type TurnSkippedEvent, type UncheckedReason, type UnverifiableReason, type UpdateMediaOptions, type UpdateModelPreferenceOptions, type UpdateProjectOptions, type UpdateUserPreferenceOptions, type UpdateVaultMemoryOptions, UserPreference, type UserPreferencesStorageOperationsContext, VAULT_SIZE_HOP_CAP, type VaultEmbeddingCache, type VaultEmbeddingExpectation, VaultMemory, type VaultMemoryKind, type VaultMemoryOperationsContext, type VaultMemoryVisibility, type VaultSaveOperation, type VaultSearchResult, type VerificationSources, type VerifyMemoriesForPublishOptions, WalletPoller, type WeatherClassification, type WeatherPreProcessorOptions, type WebSearchClassification, type WebSearchPreProcessorOptions, WordProcessor, ZipProcessor, type ZipProcessorOptions, activatedToolSetNames, analyzeStyle, archiveVaultMemoryOp, assembleMemoryContext, backfillMemoryTopicsOp, 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, createDurableAutoExtractor, createLlmDecayClassifier, createLlmNeighborRefiner, createLocalMemoryStore, createMediaBatchOp, createMediaOp, createMemoryEngineTool, createMemoryVaultSearchTool, createMemoryVaultTool, createMessageOp, createMessageSourceResolver, createPlatformCursorStore, createProjectOp, createRecallTool, createServerToolsFilter, createStockPricePreProcessor, createSummaryContext, createVaultEmbeddingCache, createVaultMemoriesBatchOp, createVaultMemoryOp, createWeatherPreProcessor, createWebSearchPreProcessor, decryptConversationTitle, decryptData, decryptDataBatch, decryptDataBytes, decryptDataBytesFromBytes, decryptDataWithKey, defaultServerToolsFilter, deleteAllVaultMemoriesForUserOp, deleteConversationOp, deleteConversationSummaryOp, deleteMediaByConversationOp, deleteMediaByMessageOp, deleteMediaOp, deleteMessageOp, deleteModelPreferenceOp, deleteProjectOp, deleteUserPreferenceOp, deleteVaultMemoryOp, deriveKeyFromSignatureBytes, eagerEmbedContent, embedAllMessages, embedMessage, encryptData, encryptDataBatch, encryptDataBytes, encryptDataWithKey, estimateMessagesTokens, estimateTokens, exportPublicKey, extractAndLinkEntitiesForMemoriesOp, extractAndRetain, extractEntitiesForMemories, extractFacts, findMatchingTools, formatFileProcessingNotes, 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, ingestPublishedPhotoMemoriesOp, injectionSignatureCatalog, isDegradedTopicSkip, isRerankerAvailable, isSupportedFile, isSupportedMediaType, makeSyntheticStoredConversation, makeSyntheticStoredMessage, maybeSummarizeHistory, mediaToStored, migrateFromModelPreferencesOp, onKeyAvailable, parseMedia, preEmbedVaultMemories, preprocessFiles, progressiveSummarize, projectToStored, queueManager, rankProfileCandidates, recall, reflect, refreshEncryptionKeyIfMatches, relinkMemoryTopicsOp, relinkMisclassifiedVideosOp, renderTemplate, requestEncryptionKey, requestKeyPair, restoreVaultMemoryOp, resumeStream, retain, runToolLoop, sanitizeQuotes, schemaToCreateSQL, scoreProfileSalience, screenCandidatesForInjection, sdkMigrations, sdkModelClasses, sdkSchema, searchChunksOp, searchMediaOp, searchMessagesOp, searchVaultMemories, seedEncryptionKeys, selectServerToolsForPrompt, serverPlatformStorage, setMemoryVisibilityOp, setModelPreferenceOp, setUserPreferenceOp, shouldAnalyzeStyle, shouldChunkMessage, shouldRecallMemory, shouldRefreshTools, splitMessagesAtThreshold, stampTopicsExtractedAtOp, streamCancelPath, streamReplayPath, stripLegacyChunkTextOp, summarizeObservationTrends, summaryToSystemMessage, supersedeVaultMemoryOp, synthesizeProfile, toolSetSystemPrompts, traverseGraphLane, ttlForType, updateConversationProjectOp, updateConversationTitleOp, updateMediaMessageIdBatchOp, updateMediaOp, updateMessageChunksOp, updateMessageEmbeddingOp, updateMessageErrorOp, updateMessageFeedbackOp, updateModelsOp, updatePersonalityOp, updateProfileOp, updateProjectNameOp, updateProjectOp, updateVaultMemoryEmbeddingOp, updateVaultMemoryOp, upsertConversationSummaryOp, upsertMessageOp, verifyMemoriesForPublish };
@@ -7254,6 +7254,48 @@ interface StoredVaultMemory {
7254
7254
  updatedAt: Date;
7255
7255
  isDeleted: boolean;
7256
7256
  }
7257
+ /**
7258
+ * Content-free projection of a vault memory, used to RANK candidates for recall
7259
+ * WITHOUT decrypting the (encrypted) `content` column. Everything here is a
7260
+ * plaintext-at-rest column — `embedding` is stored plaintext (schema v21), and
7261
+ * `folderId`/`updatedAt` drive source-filtering + tie-breaks. There is
7262
+ * deliberately NO `content` field: a ranking pass must never carry ciphertext
7263
+ * masquerading as the plaintext `StoredVaultMemory.content`. Decrypt the top-N
7264
+ * winners on demand via {@link getVaultMemoryOp}.
7265
+ */
7266
+ interface RankableVaultMemory {
7267
+ /** WatermelonDB internal ID — pass to `getVaultMemoryOp` to decrypt on demand. */
7268
+ uniqueId: string;
7269
+ /** Scope for partitioning memories (e.g., "private", "shared"). */
7270
+ scope: string;
7271
+ /** Folder ID for organization, null if unfiled. */
7272
+ folderId: string | null;
7273
+ /** JSON-stringified embedding vector, null if not yet computed. */
7274
+ embedding: string | null;
7275
+ /** Model that produced `embedding`. Null on legacy rows. */
7276
+ embeddingModel: string | null;
7277
+ createdAt: Date;
7278
+ updatedAt: Date;
7279
+ /** C3 re-observation watermark (`last_observed_at`), Unix ms or null — the
7280
+ * same column {@link StoredVaultMemory.lastObservedAt} carries. A retain()
7281
+ * consolidation `update` rewrites `content` under `preserveUpdatedAt`, so
7282
+ * `updatedAt` stays pinned and only this column moves. A consumer that
7283
+ * decides "has this row changed since I last sent it" from `updatedAt` alone
7284
+ * (the Nearby publish reconciler) never sees that rewrite; it must take
7285
+ * `max(updatedAt, lastObservedAt)`.
7286
+ *
7287
+ * OPTIONAL, not just nullable: `RankableVaultMemory` is a public exported
7288
+ * type, and this field is new. Required would break any existing consumer
7289
+ * constructing a literal of this shape (a test fixture, a mock) — the same
7290
+ * reason every other watermark field of this kind in this package
7291
+ * (memory/types.ts, memoryVault/searchTool.ts) is optional rather than
7292
+ * required. `vaultMemoryRawToRankable` still always sets it. */
7293
+ lastObservedAt?: number | null;
7294
+ }
7295
+ /** @public */
7296
+ interface VaultMemoryProjection extends RankableVaultMemory {
7297
+ topicsUserManaged: boolean;
7298
+ }
7257
7299
  /**
7258
7300
  * A photo a server-extracted memory came from, as
7259
7301
  * GET /api/memories/published returns it in `media[]`.
@@ -9383,7 +9425,7 @@ interface MemoryListOptions {
9383
9425
  * passing provenance, trust or publication metadata through manual creation.
9384
9426
  * @public
9385
9427
  */
9386
- type MemoryCreate = Pick<CreateVaultMemoryOptions, "content" | "scope" | "factType" | "eventTime" | "embedding" | "embeddingModel" | "geohash">;
9428
+ type MemoryCreate = Pick<CreateVaultMemoryOptions, "content" | "scope" | "factType" | "eventTime" | "embedding" | "embeddingModel" | "geohash" | "kind" | "kindValue" | "level">;
9387
9429
  /**
9388
9430
  * The edits an app makes to an existing memory. Deliberately narrower than
9389
9431
  * {@link UpdateVaultMemoryOptions}: the re-observation knobs (`proofCountIncrement`,
@@ -9399,7 +9441,7 @@ type MemoryCreate = Pick<CreateVaultMemoryOptions, "content" | "scope" | "factTy
9399
9441
  * `embedding` (with `embeddingModel`) only when you already have the new one.
9400
9442
  * @public
9401
9443
  */
9402
- type MemoryUpdate = Pick<UpdateVaultMemoryOptions, "content" | "scope" | "factType" | "eventTime" | "embedding" | "embeddingModel">;
9444
+ type MemoryUpdate = Pick<UpdateVaultMemoryOptions, "content" | "scope" | "factType" | "eventTime" | "embedding" | "embeddingModel" | "kind" | "kindValue" | "level">;
9403
9445
  /**
9404
9446
  * Fact-only recall. Conversation chunks are message storage, not memory, so
9405
9447
  * the chunk-lane knobs are not part of this surface; nor is `folderId` (see
@@ -9425,6 +9467,15 @@ type MemoryRecallOptions = Omit<RecallOptions, "types" | "includeChunks" | "conv
9425
9467
  * @public
9426
9468
  */
9427
9469
  type MemoryRetainOptions = Omit<RetainOptions, "folderId">;
9470
+ /**
9471
+ * A topic and how many memories link to it.
9472
+ * @public
9473
+ */
9474
+ interface MemoryTopic {
9475
+ name: string;
9476
+ kind: string | null;
9477
+ memoryCount: number;
9478
+ }
9428
9479
  /** @public */
9429
9480
  interface MemorySubscribeOptions {
9430
9481
  /**
@@ -9506,6 +9557,10 @@ interface MemoryStore {
9506
9557
  memoriesByTopics(names: readonly string[]): Promise<Map<string, Set<string>>>;
9507
9558
  /** Memory id → its canonical (lowercased) topic names. Unlinked ids are absent. */
9508
9559
  topicsByMemories(memoryIds: readonly string[]): Promise<Map<string, Set<string>>>;
9560
+ /** Every topic by canonical name, with its kind and linked-memory count. */
9561
+ listTopics(): Promise<MemoryTopic[]>;
9562
+ /** The memories {@link MemoryStore.list} would return, without decrypting content. */
9563
+ listProjections(options?: MemoryListOptions): Promise<VaultMemoryProjection[]>;
9509
9564
  /** Manual save; missing embeddings are filled in the background. */
9510
9565
  create(input: MemoryCreate): Promise<StoredVaultMemory>;
9511
9566
  /** One write for a batch of manual saves; migration/restore uses lower-level operations. */
@@ -10787,4 +10842,4 @@ declare class PostgreSQLAdapter implements DatabaseAdapter {
10787
10842
  */
10788
10843
  declare function serverPlatformStorage(): PlatformStorage;
10789
10844
 
10790
- 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 ConsolidationAction, 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, type DurableAutoExtractorOptions, ENTITY_FANOUT, type EmbeddedWalletSignerFn, EncryptionKeyMissingError, ExcelProcessor, type ExtractFactsOptions, type ExtractOutcome, type ExtractedCandidate, type ExtractedEntity, type ExtractionCursorStore, type ExtractionFunnel, type ExtractionTimings, type FactType, type FileMetadata, type FileProcessingReason, type FileProcessingStatus, 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, type LocalMemoryStoreOptions, MAX_HOPS, MAX_MESSAGES_PER_SUMMARIZATION, MEDIUM_TTL_MS, MEMORY_KINDS, MEMORY_LEVELS, Media, type MediaDimensions, type MediaFilterOptions, type MediaMetadata, type MediaOperationsContext, type MediaRole, type MediaType, type MemoriesNeedingTopicExtraction, type MemoryContextItem, type MemoryContextLane, type MemoryContextOptions, type MemoryContextResult, type EmbeddingOptions as MemoryEngineEmbeddingOptions, type MemoryEngineResult, type MemoryEngineSearchOptions, type MemoryExtractedEvent, type MemoryKind, type MemoryLevel, MemoryLevelError, type MemoryListOptions, type MemoryMaintenance, type MemoryQuarantinedEvent, type MemoryRecallOptions, type MemoryRetainOptions, type MemoryStore, type MemorySubscribeOptions, type MemoryToVerify, type MemoryUpdate, type MemoryVaultSearchOptions, type MemoryVaultToolOptions, type MemoryVerification, Message, type MessageChunk, type MessageFeedback, type MessageOrigin, 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 PhotoIngestResult, type PhotoMediaRef, type PlatformStorage, type PortalLlmAuth, type PortalLlmFailure, type PortalLlmFailureReason, 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 PublishedPhotoMemory, 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 RecallEmptyReason, type RecallOptions, type RecallResult, type RecallToolCallbacks, type RecallToolOptions, type RecencyOptions, type ReflectOptions, type ReflectResult, type RequestEncryptionKeyOptions, 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 TopicSkipReason, type TurnCompleteEvent, type TurnSkippedEvent, type UncheckedReason, type UnverifiableReason, type UpdateMediaOptions, type UpdateModelPreferenceOptions, type UpdateProjectOptions, type UpdateUserPreferenceOptions, type UpdateVaultMemoryOptions, UserPreference, type UserPreferencesStorageOperationsContext, VAULT_SIZE_HOP_CAP, type VaultEmbeddingCache, type VaultEmbeddingExpectation, VaultMemory, type VaultMemoryKind, type VaultMemoryOperationsContext, type VaultMemoryVisibility, type VaultSaveOperation, type VaultSearchResult, type VerificationSources, type VerifyMemoriesForPublishOptions, WalletPoller, type WeatherClassification, type WeatherPreProcessorOptions, type WebSearchClassification, type WebSearchPreProcessorOptions, WordProcessor, ZipProcessor, type ZipProcessorOptions, activatedToolSetNames, analyzeStyle, archiveVaultMemoryOp, assembleMemoryContext, backfillMemoryTopicsOp, 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, createDurableAutoExtractor, createLlmDecayClassifier, createLlmNeighborRefiner, createLocalMemoryStore, createMediaBatchOp, createMediaOp, createMemoryEngineTool, createMemoryVaultSearchTool, createMemoryVaultTool, createMessageOp, createMessageSourceResolver, createPlatformCursorStore, createProjectOp, createRecallTool, createServerToolsFilter, createStockPricePreProcessor, createSummaryContext, createVaultEmbeddingCache, createVaultMemoriesBatchOp, createVaultMemoryOp, createWeatherPreProcessor, createWebSearchPreProcessor, decryptConversationTitle, decryptData, decryptDataBatch, decryptDataBytes, decryptDataBytesFromBytes, decryptDataWithKey, defaultServerToolsFilter, deleteAllVaultMemoriesForUserOp, deleteConversationOp, deleteConversationSummaryOp, deleteMediaByConversationOp, deleteMediaByMessageOp, deleteMediaOp, deleteMessageOp, deleteModelPreferenceOp, deleteProjectOp, deleteUserPreferenceOp, deleteVaultMemoryOp, deriveKeyFromSignatureBytes, eagerEmbedContent, embedAllMessages, embedMessage, encryptData, encryptDataBatch, encryptDataBytes, encryptDataWithKey, estimateMessagesTokens, estimateTokens, exportPublicKey, extractAndLinkEntitiesForMemoriesOp, extractAndRetain, extractEntitiesForMemories, extractFacts, findMatchingTools, formatFileProcessingNotes, 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, ingestPublishedPhotoMemoriesOp, injectionSignatureCatalog, isDegradedTopicSkip, isRerankerAvailable, isSupportedFile, isSupportedMediaType, makeSyntheticStoredConversation, makeSyntheticStoredMessage, maybeSummarizeHistory, mediaToStored, migrateFromModelPreferencesOp, onKeyAvailable, parseMedia, preEmbedVaultMemories, preprocessFiles, progressiveSummarize, projectToStored, queueManager, rankProfileCandidates, recall, reflect, refreshEncryptionKeyIfMatches, relinkMemoryTopicsOp, relinkMisclassifiedVideosOp, renderTemplate, requestEncryptionKey, requestKeyPair, restoreVaultMemoryOp, resumeStream, retain, runToolLoop, sanitizeQuotes, schemaToCreateSQL, scoreProfileSalience, screenCandidatesForInjection, sdkMigrations, sdkModelClasses, sdkSchema, searchChunksOp, searchMediaOp, searchMessagesOp, searchVaultMemories, seedEncryptionKeys, selectServerToolsForPrompt, serverPlatformStorage, setMemoryVisibilityOp, setModelPreferenceOp, setUserPreferenceOp, shouldAnalyzeStyle, shouldChunkMessage, shouldRecallMemory, shouldRefreshTools, splitMessagesAtThreshold, stampTopicsExtractedAtOp, streamCancelPath, streamReplayPath, stripLegacyChunkTextOp, summarizeObservationTrends, summaryToSystemMessage, supersedeVaultMemoryOp, synthesizeProfile, toolSetSystemPrompts, traverseGraphLane, ttlForType, updateConversationProjectOp, updateConversationTitleOp, updateMediaMessageIdBatchOp, updateMediaOp, updateMessageChunksOp, updateMessageEmbeddingOp, updateMessageErrorOp, updateMessageFeedbackOp, updateModelsOp, updatePersonalityOp, updateProfileOp, updateProjectNameOp, updateProjectOp, updateVaultMemoryEmbeddingOp, updateVaultMemoryOp, upsertConversationSummaryOp, upsertMessageOp, verifyMemoriesForPublish };
10845
+ 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 ConsolidationAction, 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, type DurableAutoExtractorOptions, ENTITY_FANOUT, type EmbeddedWalletSignerFn, EncryptionKeyMissingError, ExcelProcessor, type ExtractFactsOptions, type ExtractOutcome, type ExtractedCandidate, type ExtractedEntity, type ExtractionCursorStore, type ExtractionFunnel, type ExtractionTimings, type FactType, type FileMetadata, type FileProcessingReason, type FileProcessingStatus, 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, type LocalMemoryStoreOptions, MAX_HOPS, MAX_MESSAGES_PER_SUMMARIZATION, MEDIUM_TTL_MS, MEMORY_KINDS, MEMORY_LEVELS, Media, type MediaDimensions, type MediaFilterOptions, type MediaMetadata, type MediaOperationsContext, type MediaRole, type MediaType, type MemoriesNeedingTopicExtraction, type MemoryContextItem, type MemoryContextLane, type MemoryContextOptions, type MemoryContextResult, type EmbeddingOptions as MemoryEngineEmbeddingOptions, type MemoryEngineResult, type MemoryEngineSearchOptions, type MemoryExtractedEvent, type MemoryKind, type MemoryLevel, MemoryLevelError, type MemoryListOptions, type MemoryMaintenance, type MemoryQuarantinedEvent, type MemoryRecallOptions, type MemoryRetainOptions, type MemoryStore, type MemorySubscribeOptions, type MemoryToVerify, type MemoryTopic, type MemoryUpdate, type MemoryVaultSearchOptions, type MemoryVaultToolOptions, type MemoryVerification, Message, type MessageChunk, type MessageFeedback, type MessageOrigin, 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 PhotoIngestResult, type PhotoMediaRef, type PlatformStorage, type PortalLlmAuth, type PortalLlmFailure, type PortalLlmFailureReason, 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 PublishedPhotoMemory, 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 RecallEmptyReason, type RecallOptions, type RecallResult, type RecallToolCallbacks, type RecallToolOptions, type RecencyOptions, type ReflectOptions, type ReflectResult, type RequestEncryptionKeyOptions, 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 TopicSkipReason, type TurnCompleteEvent, type TurnSkippedEvent, type UncheckedReason, type UnverifiableReason, type UpdateMediaOptions, type UpdateModelPreferenceOptions, type UpdateProjectOptions, type UpdateUserPreferenceOptions, type UpdateVaultMemoryOptions, UserPreference, type UserPreferencesStorageOperationsContext, VAULT_SIZE_HOP_CAP, type VaultEmbeddingCache, type VaultEmbeddingExpectation, VaultMemory, type VaultMemoryKind, type VaultMemoryOperationsContext, type VaultMemoryVisibility, type VaultSaveOperation, type VaultSearchResult, type VerificationSources, type VerifyMemoriesForPublishOptions, WalletPoller, type WeatherClassification, type WeatherPreProcessorOptions, type WebSearchClassification, type WebSearchPreProcessorOptions, WordProcessor, ZipProcessor, type ZipProcessorOptions, activatedToolSetNames, analyzeStyle, archiveVaultMemoryOp, assembleMemoryContext, backfillMemoryTopicsOp, 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, createDurableAutoExtractor, createLlmDecayClassifier, createLlmNeighborRefiner, createLocalMemoryStore, createMediaBatchOp, createMediaOp, createMemoryEngineTool, createMemoryVaultSearchTool, createMemoryVaultTool, createMessageOp, createMessageSourceResolver, createPlatformCursorStore, createProjectOp, createRecallTool, createServerToolsFilter, createStockPricePreProcessor, createSummaryContext, createVaultEmbeddingCache, createVaultMemoriesBatchOp, createVaultMemoryOp, createWeatherPreProcessor, createWebSearchPreProcessor, decryptConversationTitle, decryptData, decryptDataBatch, decryptDataBytes, decryptDataBytesFromBytes, decryptDataWithKey, defaultServerToolsFilter, deleteAllVaultMemoriesForUserOp, deleteConversationOp, deleteConversationSummaryOp, deleteMediaByConversationOp, deleteMediaByMessageOp, deleteMediaOp, deleteMessageOp, deleteModelPreferenceOp, deleteProjectOp, deleteUserPreferenceOp, deleteVaultMemoryOp, deriveKeyFromSignatureBytes, eagerEmbedContent, embedAllMessages, embedMessage, encryptData, encryptDataBatch, encryptDataBytes, encryptDataWithKey, estimateMessagesTokens, estimateTokens, exportPublicKey, extractAndLinkEntitiesForMemoriesOp, extractAndRetain, extractEntitiesForMemories, extractFacts, findMatchingTools, formatFileProcessingNotes, 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, ingestPublishedPhotoMemoriesOp, injectionSignatureCatalog, isDegradedTopicSkip, isRerankerAvailable, isSupportedFile, isSupportedMediaType, makeSyntheticStoredConversation, makeSyntheticStoredMessage, maybeSummarizeHistory, mediaToStored, migrateFromModelPreferencesOp, onKeyAvailable, parseMedia, preEmbedVaultMemories, preprocessFiles, progressiveSummarize, projectToStored, queueManager, rankProfileCandidates, recall, reflect, refreshEncryptionKeyIfMatches, relinkMemoryTopicsOp, relinkMisclassifiedVideosOp, renderTemplate, requestEncryptionKey, requestKeyPair, restoreVaultMemoryOp, resumeStream, retain, runToolLoop, sanitizeQuotes, schemaToCreateSQL, scoreProfileSalience, screenCandidatesForInjection, sdkMigrations, sdkModelClasses, sdkSchema, searchChunksOp, searchMediaOp, searchMessagesOp, searchVaultMemories, seedEncryptionKeys, selectServerToolsForPrompt, serverPlatformStorage, setMemoryVisibilityOp, setModelPreferenceOp, setUserPreferenceOp, shouldAnalyzeStyle, shouldChunkMessage, shouldRecallMemory, shouldRefreshTools, splitMessagesAtThreshold, stampTopicsExtractedAtOp, streamCancelPath, streamReplayPath, stripLegacyChunkTextOp, summarizeObservationTrends, summaryToSystemMessage, supersedeVaultMemoryOp, synthesizeProfile, toolSetSystemPrompts, traverseGraphLane, ttlForType, updateConversationProjectOp, updateConversationTitleOp, updateMediaMessageIdBatchOp, updateMediaOp, updateMessageChunksOp, updateMessageEmbeddingOp, updateMessageErrorOp, updateMessageFeedbackOp, updateModelsOp, updatePersonalityOp, updateProfileOp, updateProjectNameOp, updateProjectOp, updateVaultMemoryEmbeddingOp, updateVaultMemoryOp, upsertConversationSummaryOp, upsertMessageOp, verifyMemoriesForPublish };
@@ -18687,6 +18687,46 @@ function createCryptoPricePreProcessor(options = {}) {
18687
18687
 
18688
18688
  // src/tools/confirmConstants.ts
18689
18689
  var CONFIRM_TOOL_NAME = "prompt_user_confirm";
18690
+ var BOOK_RESTAURANT = {
18691
+ tool: "AnumaPaymentsMCP-anuma_book_restaurant",
18692
+ status: "confirmed_not_booked",
18693
+ fields: ["venue_id", "config_id", "party_size", "day", "venue_name", "time"]
18694
+ };
18695
+ var CANCEL_RESERVATION = {
18696
+ tool: "AnumaPaymentsMCP-anuma_cancel_reservation",
18697
+ status: "confirmed_not_cancelled",
18698
+ fields: [
18699
+ "reservation_id",
18700
+ "venue_name",
18701
+ "day",
18702
+ "time",
18703
+ "party_size",
18704
+ "fee_applies",
18705
+ "fee_amount"
18706
+ ]
18707
+ };
18708
+ var CONFIRM_REQUIRED_FIELDS = /* @__PURE__ */ new Map([
18709
+ ["book_restaurant", BOOK_RESTAURANT],
18710
+ ["anuma_book_restaurant", BOOK_RESTAURANT],
18711
+ ["anumapaymentsmcp-anuma_book_restaurant", BOOK_RESTAURANT],
18712
+ ["cancel_reservation", CANCEL_RESERVATION],
18713
+ ["anuma_cancel_reservation", CANCEL_RESERVATION],
18714
+ ["anumapaymentsmcp-anuma_cancel_reservation", CANCEL_RESERVATION]
18715
+ ]);
18716
+ function confirmRequirement(action) {
18717
+ if (typeof action !== "string") return void 0;
18718
+ return CONFIRM_REQUIRED_FIELDS.get(action.trim().toLowerCase());
18719
+ }
18720
+ function missingConfirmFields(action, parameters) {
18721
+ const requirement = confirmRequirement(action);
18722
+ if (!requirement) return [];
18723
+ const shown = /* @__PURE__ */ new Set();
18724
+ for (const parameter of Array.isArray(parameters) ? parameters : []) {
18725
+ const { name, value } = parameter ?? {};
18726
+ if (typeof name === "string" && typeof value === "string" && value.trim()) shown.add(name);
18727
+ }
18728
+ return requirement.fields.filter((field10) => !shown.has(field10));
18729
+ }
18690
18730
 
18691
18731
  // src/lib/storage/mcpImages.ts
18692
18732
  var IMAGE_TOOL_NAMES = /* @__PURE__ */ new Set([
@@ -21548,6 +21588,7 @@ function getToolName(tool) {
21548
21588
  }
21549
21589
  function toolsAfterConfirmation(apiTools, executionResults) {
21550
21590
  const members = /* @__PURE__ */ new Set();
21591
+ let keepConfirm = false;
21551
21592
  for (const r of executionResults) {
21552
21593
  if (r.name !== CONFIRM_TOOL_NAME) continue;
21553
21594
  const answer = r.result;
@@ -21555,11 +21596,12 @@ function toolsAfterConfirmation(apiTools, executionResults) {
21555
21596
  const setName = CONFIRMED_ACTION_TOOL_SETS.get(answer.action.trim().toLowerCase());
21556
21597
  const set = BUILT_IN_TOOL_SETS.find((s) => s.name === setName);
21557
21598
  for (const member of set?.members ?? []) members.add(member);
21599
+ if (missingConfirmFields(answer.action, answer.parameters).length > 0) keepConfirm = true;
21558
21600
  }
21559
21601
  if (!apiTools.some((t) => members.has(getToolName(t) ?? ""))) return void 0;
21560
21602
  return apiTools.filter((t) => {
21561
21603
  const name = getToolName(t) ?? "";
21562
- return members.has(name) || name === CONFIRM_TOOL_NAME || name === TOOL_SEARCH_TOOL_NAME;
21604
+ return members.has(name) || name === TOOL_SEARCH_TOOL_NAME || keepConfirm && name === CONFIRM_TOOL_NAME;
21563
21605
  });
21564
21606
  }
21565
21607
  var STREAM_RESUMABLE_HEADER = "X-Stream-Resumable";
@@ -26370,22 +26412,35 @@ async function vaultMemoryRawToStored(raw, walletAddress, signMessage, embeddedW
26370
26412
  return stored;
26371
26413
  }
26372
26414
  async function getAllVaultMemoriesOp(ctx, options) {
26373
- const conditions = [
26415
+ const results = await ctx.vaultMemoryCollection.query(...vaultListConditions(ctx, options), ...vaultListOrder(options)).unsafeFetchRaw();
26416
+ return mapInBatches(
26417
+ results,
26418
+ (raw) => vaultMemoryRawToStored(raw, ctx.walletAddress, ctx.signMessage, ctx.embeddedWalletSigner)
26419
+ );
26420
+ }
26421
+ function vaultListConditions(ctx, options) {
26422
+ return [
26374
26423
  ...baseVaultConditions(ctx, options),
26375
26424
  ...options?.scopes?.length ? [import_watermelondb19.Q.where("scope", import_watermelondb19.Q.oneOf(options.scopes))] : [],
26376
26425
  ...visibilityConditions(options?.visibility),
26377
26426
  ...levelConditions(options?.levels),
26378
26427
  ...options?.kinds?.length ? [import_watermelondb19.Q.where("kind", import_watermelondb19.Q.oneOf(options.kinds))] : [],
26379
26428
  ...options?.folderId !== void 0 ? [import_watermelondb19.Q.where("folder_id", options.folderId)] : [],
26380
- ...options?.factTypes?.length ? [import_watermelondb19.Q.where("fact_type", import_watermelondb19.Q.oneOf(options.factTypes))] : [],
26429
+ ...options?.factTypes?.length ? [import_watermelondb19.Q.where("fact_type", import_watermelondb19.Q.oneOf(options.factTypes))] : []
26430
+ ];
26431
+ }
26432
+ function vaultListOrder(options) {
26433
+ return [
26381
26434
  import_watermelondb19.Q.sortBy(options?.since ? "updated_at" : "created_at", import_watermelondb19.Q.desc),
26382
26435
  ...options?.limit !== null && options?.limit !== void 0 && options.limit > 0 ? [import_watermelondb19.Q.take(options.limit)] : []
26383
26436
  ];
26384
- const results = await ctx.vaultMemoryCollection.query(...conditions).unsafeFetchRaw();
26385
- return mapInBatches(
26386
- results,
26387
- (raw) => vaultMemoryRawToStored(raw, ctx.walletAddress, ctx.signMessage, ctx.embeddedWalletSigner)
26388
- );
26437
+ }
26438
+ async function getVaultMemoryProjectionsOp(ctx, options) {
26439
+ const results = await ctx.vaultMemoryCollection.query(...vaultListConditions(ctx, options), ...vaultListOrder(options)).unsafeFetchRaw();
26440
+ return results.map((raw) => ({
26441
+ ...vaultMemoryRawToRankable(raw),
26442
+ topicsUserManaged: raw.topics_user_managed === true || raw.topics_user_managed === 1
26443
+ }));
26389
26444
  }
26390
26445
  function vaultMemoryRawToRankable(raw) {
26391
26446
  return {
@@ -33180,6 +33235,7 @@ function createLocalMemoryStore(options) {
33180
33235
  };
33181
33236
  const vaultCache = options.vaultCache ?? createVaultEmbeddingCache();
33182
33237
  const ownedBy = userId !== void 0 ? [import_watermelondb24.Q.where("user_id", userId)] : [];
33238
+ const linksOwnedBy = userId === void 0 ? [] : options.allowUnscopedRows ? [import_watermelondb24.Q.or(import_watermelondb24.Q.where("user_id", userId), import_watermelondb24.Q.where("user_id", null))] : [import_watermelondb24.Q.where("user_id", userId)];
33183
33239
  const watchedColumns = [
33184
33240
  "content",
33185
33241
  "scope",
@@ -33222,6 +33278,29 @@ function createLocalMemoryStore(options) {
33222
33278
  },
33223
33279
  memoriesByTopics: (names) => getMemoriesByEntityNamesOp(entityCtx, names),
33224
33280
  topicsByMemories: (memoryIds) => getEntitiesByMemoryIdsOp(entityCtx, memoryIds),
33281
+ listTopics: async () => {
33282
+ const links = await entityCtx.memoryEntityCollection.query(...linksOwnedBy).fetch();
33283
+ const members = /* @__PURE__ */ new Map();
33284
+ for (const link of links) {
33285
+ const entityId = String(link.entityId);
33286
+ const set = members.get(entityId) ?? /* @__PURE__ */ new Set();
33287
+ set.add(String(link.memoryId));
33288
+ members.set(entityId, set);
33289
+ }
33290
+ const entities = userId === void 0 ? await entityCtx.entityCollection.query().fetch() : members.size ? await entityCtx.entityCollection.query(import_watermelondb24.Q.where("id", import_watermelondb24.Q.oneOf([...members.keys()]))).fetch() : [];
33291
+ const byName = /* @__PURE__ */ new Map();
33292
+ for (const entity of entities) {
33293
+ const count = members.get(entity.id)?.size ?? 0;
33294
+ const existing = byName.get(entity.canonicalName);
33295
+ byName.set(entity.canonicalName, {
33296
+ name: entity.canonicalName,
33297
+ kind: existing?.kind ?? entity.kind ?? null,
33298
+ memoryCount: (existing?.memoryCount ?? 0) + count
33299
+ });
33300
+ }
33301
+ return [...byName.values()].sort((a, b) => a.name.localeCompare(b.name));
33302
+ },
33303
+ listProjections: (listOptions) => getVaultMemoryProjectionsOp(vaultCtx, listOptions),
33225
33304
  create: async (input) => {
33226
33305
  const created = await createVaultMemoryOp(vaultCtx, input);
33227
33306
  if (input.embedding === void 0) embedInBackground(created);
@@ -33283,7 +33362,6 @@ function createLocalMemoryStore(options) {
33283
33362
  );
33284
33363
  const subscriptions = [memories.subscribe(afterFirst())];
33285
33364
  if (subscribeOptions?.topics) {
33286
- const linksOwnedBy = userId === void 0 ? [] : options.allowUnscopedRows ? [import_watermelondb24.Q.or(import_watermelondb24.Q.where("user_id", userId), import_watermelondb24.Q.where("user_id", null))] : [import_watermelondb24.Q.where("user_id", userId)];
33287
33365
  subscriptions.push(
33288
33366
  entityCtx.memoryEntityCollection.query(...linksOwnedBy).observe().subscribe(afterFirst())
33289
33367
  );