@anuma/sdk 4.1.0 → 4.2.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.
@@ -3506,6 +3506,15 @@ interface StoredMessage {
3506
3506
  feedback?: MessageFeedback;
3507
3507
  /** Tool call events from the backend response (for reconstructing tool call history) */
3508
3508
  toolCallEvents?: LlmapiToolCallEvent[];
3509
+ /**
3510
+ * Set when `content` could not be decrypted on read (#561).
3511
+ * The `content` field still holds the original ciphertext — never a
3512
+ * `[Decryption Failed]` placeholder — so a later unlock can recover.
3513
+ * - `key_missing`: no key for this field's `enc:vN:` version in the store
3514
+ * - `auth_mismatch`: a key was present but AES-GCM auth failed (wrong key)
3515
+ * - `invalid_payload`: malformed ciphertext envelope
3516
+ */
3517
+ decryptionStatus?: "key_missing" | "auth_mismatch" | "invalid_payload";
3509
3518
  }
3510
3519
  interface ActivityPhase {
3511
3520
  id: string;
@@ -4141,6 +4150,35 @@ declare class Conversation extends Model {
4141
4150
  pinnedAt?: Date | null;
4142
4151
  }
4143
4152
 
4153
+ /**
4154
+ * Encryption key version type.
4155
+ * - "v2": Legacy SHA-256 derived key (for reading enc:v2: data)
4156
+ * - "v3": HKDF derived key with domain separation (for new encryption)
4157
+ */
4158
+ type EncryptionKeyVersion = "v2" | "v3";
4159
+ /**
4160
+ * Thrown by {@link getEncryptionKey} when the requested version is absent.
4161
+ * Distinct from AES-GCM auth-tag failures so decrypt callers can tell
4162
+ * "need to derive/hydrate this version" from "wrong key for intact ciphertext".
4163
+ */
4164
+ declare class EncryptionKeyMissingError extends Error {
4165
+ readonly address: string;
4166
+ readonly version: EncryptionKeyVersion;
4167
+ constructor(address: string, version: EncryptionKeyVersion);
4168
+ }
4169
+ /**
4170
+ * Options for {@link requestEncryptionKey}.
4171
+ */
4172
+ interface RequestEncryptionKeyOptions {
4173
+ /**
4174
+ * When true, re-derive and replace any existing in-memory keys for this
4175
+ * address. Default false preserves the historical "if present, return"
4176
+ * short-circuit. Prefer {@link refreshEncryptionKeyIfMatches} when the
4177
+ * caller has ciphertext that must keep working — force-replace can pin a
4178
+ * newly derived wrong key over a still-valid one.
4179
+ */
4180
+ force?: boolean;
4181
+ }
4144
4182
  /**
4145
4183
  * Register a callback that fires when an encryption key becomes available for an address.
4146
4184
  * If the key is already available, the callback fires immediately.
@@ -4186,9 +4224,30 @@ declare function clearAllEncryptionState(): void;
4186
4224
  */
4187
4225
  declare function clearAllEncryptionKeys(): void;
4188
4226
  /**
4189
- * Checks if an encryption key exists in memory for the given wallet address
4227
+ * Checks if an encryption key exists in memory for the given wallet address.
4228
+ *
4229
+ * @param address - Wallet address
4230
+ * @param version - When omitted, checks the **v3** (`current`) key — the key
4231
+ * write/OPFS/encrypt paths need. Callers that only need to read legacy
4232
+ * `enc:v2:` data should pass `"v2"` explicitly. (#561 / PR #828)
4233
+ */
4234
+ declare function hasEncryptionKey(address: string, version?: EncryptionKeyVersion): boolean;
4235
+ /**
4236
+ * Seed (or merge) raw key hex into the in-memory store without signing.
4237
+ *
4238
+ * Used by platform polyfills that hydrate from SecureStore / keychain where
4239
+ * one version may be missing — callers must not require both versions to
4240
+ * exist before the other becomes usable (#561).
4241
+ *
4242
+ * Existing versions are preserved when the corresponding argument is omitted.
4243
+ * Pass an explicit empty merge is not supported; omit the field to leave it.
4244
+ *
4245
+ * Each provided key must be 64 hex characters (32-byte AES key).
4190
4246
  */
4191
- declare function hasEncryptionKey(address: string): boolean;
4247
+ declare function seedEncryptionKeys(address: string, keys: {
4248
+ legacy?: string;
4249
+ current?: string;
4250
+ }): void;
4192
4251
  /**
4193
4252
  * Options for signing messages.
4194
4253
  */
@@ -4209,24 +4268,50 @@ type SignMessageFn = (message: string, options?: SignMessageOptions) => Promise<
4209
4268
  type EmbeddedWalletSignerFn = (message: string, options?: SignMessageOptions) => Promise<string>;
4210
4269
  /**
4211
4270
  * Requests the user to sign a message to generate an encryption key.
4212
- * If a key already exists in memory for the given wallet, resolves immediately.
4271
+ * If a key already exists in memory for the given wallet, resolves immediately
4272
+ * unless {@link RequestEncryptionKeyOptions.force} is set.
4213
4273
  *
4214
4274
  * Note: Keys are stored in memory only and do not persist across page reloads.
4215
4275
  * This is a security feature - users must sign once per session to derive their key.
4216
4276
  *
4277
+ * When a seeded/pinned store already has keys and the fresh derive does not
4278
+ * match any of them, the store is left unchanged and this resolves to `false`
4279
+ * (without firing {@link onKeyAvailable}). Callers that need write readiness
4280
+ * should check the return value or {@link hasEncryptionKey} before encrypting
4281
+ * so they can surface a re-unlock UI instead of failing downstream (#828).
4282
+ *
4217
4283
  * @param walletAddress - The wallet address to generate the key for
4218
4284
  * @param signMessage - Function to sign a message (returns signature hex string)
4219
4285
  * @param embeddedWalletSigner - Optional function for silent signing with embedded wallets
4220
- * @returns Promise that resolves when the key is available
4286
+ * @param options - Optional flags (e.g. force re-derive)
4287
+ * @returns `true` when keys are available after the call; `false` when a
4288
+ * divergent derive left the store unchanged (or the session was torn down
4289
+ * mid-flight).
4290
+ */
4291
+ declare function requestEncryptionKey(walletAddress: string, signMessage: SignMessageFn, embeddedWalletSigner?: EmbeddedWalletSignerFn, options?: RequestEncryptionKeyOptions): Promise<boolean>;
4292
+ /**
4293
+ * Re-derive encryption keys from a fresh signature and commit them **only if**
4294
+ * they successfully decrypt `probeCiphertext` (a prefixed `enc:v2:` / `enc:v3:`
4295
+ * value). If they do not, the existing in-memory keys are left untouched.
4296
+ *
4297
+ * Concurrent calls for the same wallet share one sign+derive. Each caller then
4298
+ * probes **its own** ciphertext against those candidates, so mixed-era messages
4299
+ * in one `Promise.all` batch can still recover when only the leader's probe
4300
+ * misses (#828 review). Failed candidates are memoized for the session so
4301
+ * pagination does not re-prompt on every page when the wallet has changed.
4302
+ *
4303
+ * @returns true when keys were refreshed (probe decrypted); false when the
4304
+ * probe failed under the candidate keys (store unchanged) or the probe was
4305
+ * not encrypted.
4221
4306
  */
4222
- declare function requestEncryptionKey(walletAddress: string, signMessage: SignMessageFn, embeddedWalletSigner?: EmbeddedWalletSignerFn): Promise<void>;
4307
+ declare function refreshEncryptionKeyIfMatches(walletAddress: string, probeCiphertext: string, signMessage: SignMessageFn, embeddedWalletSigner?: EmbeddedWalletSignerFn): Promise<boolean>;
4223
4308
  /**
4224
4309
  * Result returned by the useEncryption hook.
4225
4310
  * @category Hooks
4226
4311
  */
4227
4312
  interface UseEncryptionResult {
4228
4313
  /** Request and generate an encryption key for a wallet address */
4229
- requestEncryptionKey: (walletAddress: string) => Promise<void>;
4314
+ requestEncryptionKey: (walletAddress: string) => Promise<boolean>;
4230
4315
  /** Request and generate an ECDH key pair for a wallet address */
4231
4316
  requestKeyPair: (walletAddress: string) => Promise<void>;
4232
4317
  /** Export the public key for a wallet address as base64-encoded SPKI */
@@ -7631,6 +7716,23 @@ interface ProfileSection {
7631
7716
  text: string;
7632
7717
  /** Vault memory ids this section was grounded on — provenance + delta refresh. */
7633
7718
  sourceMemoryIds: string[];
7719
+ /**
7720
+ * Structured occupation — the `work_role` facet only. A short role phrase
7721
+ * (at most 80 code points, PII-gated alongside {@link ProfileSection.text})
7722
+ * that a profile store's `occupation` column takes verbatim.
7723
+ *
7724
+ * Absent when the facet found no evidence, when the model didn't return one,
7725
+ * or when the value it returned couldn't be made publishable. `text` is
7726
+ * unaffected either way, so the prose is never blocked on this.
7727
+ */
7728
+ occupation?: string;
7729
+ /**
7730
+ * Structured interests — the `interests` facet only. Discrete entries,
7731
+ * trimmed and deduped case- and space-insensitively (first spelling wins), at
7732
+ * most 12 items of at most 40 code points each, ready for a profile store's
7733
+ * `interests` column. Absent when nothing survived normalization.
7734
+ */
7735
+ interests?: string[];
7634
7736
  /** Unix ms this section was generated. */
7635
7737
  generatedAt: number;
7636
7738
  /** True when regeneration failed and a prior section value was carried
@@ -7647,10 +7749,12 @@ interface ProfileConfigFingerprint {
7647
7749
  /** Facet keys present in the doc, sorted. */
7648
7750
  facetKeys: ProfileFacetKey[];
7649
7751
  /** Order-independent digest of each facet's full definition (key + label +
7650
- * query + guidance). Reuse must invalidate when a facet's PROMPT changes, not
7651
- * just its key set — otherwise reused sections carry text generated under the
7652
- * old definition. Facet display order does NOT invalidate (sections are
7653
- * rebuilt in facet order and reused by key). */
7752
+ * query + guidance) and the response schema it is synthesized under. Reuse
7753
+ * must invalidate when a facet's PROMPT changes, not just its key set —
7754
+ * otherwise reused sections carry text generated under the old definition,
7755
+ * or under an output schema that predates a field the caller now reads.
7756
+ * Facet display order does NOT invalidate (sections are rebuilt in facet
7757
+ * order and reused by key). */
7654
7758
  facetsSignature: string;
7655
7759
  /** Scopes the facts were drawn from, sorted. */
7656
7760
  scopes: string[];
@@ -9234,4 +9338,4 @@ declare function refreshNotionAccessToken(params: NotionRefreshTokenParams): Pro
9234
9338
  */
9235
9339
  declare function createNotionTools(getAccessToken: () => string | null, requestNotionAccess: () => Promise<string>): ToolConfig[];
9236
9340
 
9237
- export { type AutoExtractMessage, type AutoExtractor, type Budget, type CachedChunkVectors, type CachedServerTools, Conversation as ChatConversation, Message as ChatMessage, type ChatRole, type ChunkVectorCache, type ChunkingOptions, type ConsolidationFallbackReason, type ConversationMemoryInput, ConversationMemory as ConversationMemoryModel, type ConversationMemoryOperationsContext, type CreateAutoExtractorOptions, type CreateConversationOptions, type CreateDecaySweeperOptions, type CreateMessageOptions, type CreateVaultFolderOptions, type CreateVaultMemoryOptions, type CryptoPriceClassification, type CryptoPricePreProcessorOptions, DEFAULT_CACHE_EXPIRATION_MS, DEFAULT_CHUNK_CACHE_SIZE, DEFAULT_CHUNK_OVERLAP, DEFAULT_CHUNK_SIZE, DEFAULT_DECAY_POLICY, DEFAULT_MAX_CLASSIFIER_CALLS_PER_SWEEP, DEFAULT_MIN_CHUNK_SIZE, DEFAULT_PROFILE_FACETS, DEFAULT_PROFILE_FACT_TYPE_WEIGHTS, DEFAULT_PROFILE_PROOF_ALPHA, DEFAULT_PROFILE_TREND_MULTIPLIERS, 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, type ExtractFactsOptions, type ExtractOutcome, type ExtractedCandidate, type ExtractedEntity, type ExtractionCursorStore, type FactType, type FileMetadata, type FlushResult, type GetConversationsPageOptions, type GetMessagesPageOptions, type GraphTraversalOptions, HARD_DELETE_WINDOW_MS, INFERENCE_ID_HEADER, type InjectionClassifierOptions, type InjectionReason, type LazyStoredConversation, type LlmDecayClassifierOptions, type LlmNeighborRefinerOptions, type Logger, LoggerProvider, type LoggerProviderProps, MAX_HOPS, MEDIUM_TTL_MS, type MemoriesNeedingTopicExtraction, type EmbeddingOptions as MemoryEngineEmbeddingOptions, type MemoryEngineResult, type MemoryEngineSearchOptions, type MemoryExtractedEvent, type MemoryKind, type MemoryQuarantinedEvent, type MemoryVaultSearchOptions, type MemoryVaultToolOptions, type MessageRedactionResult, type MessageSkeleton, NEVER_TTL_MS, NODE_BUDGET, NOTION_OAUTH_CONFIG, type NeighborRefiner, type NotionAuthUrlParams, type NotionClientRegistration, type NotionExchangeCodeParams, type NotionOAuthEndpoints, type NotionPKCEChallenge, type NotionRefreshTokenParams, type NotionTokenResponse, type NowSource, type ObservationTrend, type ObservationTrendInput, PAST_EVENT_GRACE_MS, PII_PATTERNS, PROFILE_DOC_VERSION, type PiiCategory, type PiiMatch, type PiiPattern, PiiRedactor, type PiiRedactorOptions, type PlatformStorage, type PortalLlmAuth, type ProfileConfigFingerprint, type ProfileDoc, type ProfileFacet, type ProfileFacetKey, type ProfileSalienceInput, type ProfileSection, type PromptPreProcessor, type PromptPreProcessorContext, type QuantizedEmbedding, type QuarantinedMemoryInfo, QueueManager, type QueueStatus, 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 RedactionResult, type ReflectOptions, type ReflectResult, RerankerUnavailableError, type ResumeStreamOptions, type ResumeStreamResult, type ResumeStreamWithStorageResult, type RetainAction, type RetainContext, type RetainOptions, type RetainResult, type RetainSource, SDK_SCHEMA_VERSION, SHORT_TTL_MS, STREAM_RESUMABLE_HEADER, type ScoreBreakdown, type ScoreProfileSalienceOptions, type ScreenResult, type ScreenedCandidate, type SearchSource, type SendMessageWithStorageArgs, type SendMessageWithStorageDetachedResult, type SendMessageWithStorageResult, type ServerToolsOptions, type ServerToolsResponse, type SignMessageFn, type StockPriceClassification, type StockPricePreProcessorOptions, type ChatCompletionUsage as StoredChatCompletionUsage, type StoredConversation, type StoredConversationMemory, type StoredMessage, type StoredMessageWithSimilarity, type StoredVaultFolder, VaultFolder as StoredVaultFolderModel, type StoredVaultMemory, VaultMemory as StoredVaultMemoryModel, StreamExpiredError, type StreamMetaEvent, type StreamResumeHandle, type SynthesizeProfileOptions, TOPICS_EXTRACTION_VERSION, TOPIC_EXTRACTION_BATCH_SIZE, TREND_RECENT_WINDOW_DAYS, TREND_STALE_WINDOW_DAYS, type TextChunk, type TopicExtractOptions, type TopicExtractionInput, type TopicExtractionRunResult, type TurnCompleteEvent, type TurnSkippedEvent, type UpdateVaultFolderOptions, type UpdateVaultMemoryOptions, type UseChatStorageOptions, type UseChatStorageResult, type UseCreditsOptions, type UseCreditsResult, type UseModelsOptions, type UseModelsResult, VAULT_SIZE_HOP_CAP, type VaultEmbeddingCache, type VaultFolderOperationsContext, type VaultMemoryOperationsContext, type VaultMemoryVisibility, type VaultSaveOperation, type VaultSearchResult, WalletPoller, type WeatherClassification, type WeatherPreProcessorOptions, type WebSearchClassification, type WebSearchPreProcessorOptions, addConversationMemoriesOp, archiveVaultMemoryOp, backfillMemoryTopicsOp, buildNotionAuthUrl, capHopsForDensity, chatStorageMigrations, chatStorageSchema, chunkAndEmbedAllMessages, chunkAndEmbedMessage, chunkText, classifyCryptoPrice, classifyCryptoPriceBatch, classifyDecay, classifyInjectionCandidates, classifyObservationTrend, classifyStockPrice, classifyStockPriceBatch, classifyWeather, classifyWeatherBatch, classifyWebSearch, classifyWebSearchBatch, clearAllEncryptionKeys, clearAllEncryptionState, clearConversationMemoriesOp, clearEncryptionKey, clearLazyTitleCache, clearServerToolsCache, consoleLogger, conversationMemoryToStored, cosineInt8, createAutoExtractor, createChunkVectorCache, createCryptoPricePreProcessor, createDecaySweeper, createLlmDecayClassifier, createLlmNeighborRefiner, createMemoryEngineTool, createMemoryVaultSearchTool, createMemoryVaultTool, createNotionTools, createPlatformCursorStore, createRecallTool, createStockPricePreProcessor, createStreamingDeAnonymizer, createVaultEmbeddingCache, createVaultFolderOp, createVaultMemoriesBatchOp, createVaultMemoryOp, createWeatherPreProcessor, createWebSearchPreProcessor, decryptConversationTitle, deleteAllVaultMemoriesForUserOp, deleteVaultFolderOp, deleteVaultMemoryOp, dequantizeEmbedding, discoverNotionOAuthEndpoints, eagerEmbedContent, embedAllMessages, embedMessage, ensureDefaultFoldersOp, exchangeNotionCode, extractAndLinkEntitiesForMemoriesOp, extractAndRetain, extractEntitiesForMemories, extractFacts, generateConversationId, generateEmbedding, generateEmbeddings, generateNotionPKCE, getAllVaultFoldersOp, getAllVaultMemoriesOp, getAllVaultMemoryContentsOp, getCachedServerTools, getConversationMemoriesOp, getConversationsByProjectLazyOp, getConversationsLazyOp, getConversationsPageOp, getDecayCandidatesRawOp, getLogger, getMemoriesNeedingTopicExtractionOp, getServerTools, getUnfiledVaultMemoriesOp, getVaultFolderMemoryCountOp, getVaultMemoryOp, hardDeleteDecayedOp, hasEncryptionKey, injectionSignatureCatalog, isPiiRedactor, isRerankerAvailable, moveMemoriesToFolderOp, noopLogger, onKeyAvailable, preEmbedVaultMemories, quantizeEmbedding, queueManager, rankProfileCandidates, recall, reflect, refreshNotionAccessToken, registerNotionClient, relinkMemoryTopicsOp, requestEncryptionKey, resolvePiiRedactor, restoreVaultMemoryOp, resumeStream, retain, scoreProfileSalience, screenCandidatesForInjection, sdkMigrations, sdkModelClasses, sdkSchema, searchVaultMemories, setLogger, setMemoryVisibilityOp, shouldChunkMessage, stampTopicsExtractedAtOp, streamCancelPath, streamReplayPath, summarizeObservationTrends, supersedeVaultMemoryOp, synthesizeProfile, traverseGraphLane, ttlForType, updateVaultFolderContextOp, updateVaultFolderOp, updateVaultMemoryEmbeddingOp, updateVaultMemoryOp, upsertMessageOp, useChat, useChatStorage, useCredits, useEncryption, useModels, xhrTransport };
9341
+ export { type AutoExtractMessage, type AutoExtractor, type Budget, type CachedChunkVectors, type CachedServerTools, Conversation as ChatConversation, Message as ChatMessage, type ChatRole, type ChunkVectorCache, type ChunkingOptions, type ConsolidationFallbackReason, type ConversationMemoryInput, ConversationMemory as ConversationMemoryModel, type ConversationMemoryOperationsContext, type CreateAutoExtractorOptions, type CreateConversationOptions, type CreateDecaySweeperOptions, type CreateMessageOptions, type CreateVaultFolderOptions, type CreateVaultMemoryOptions, type CryptoPriceClassification, type CryptoPricePreProcessorOptions, DEFAULT_CACHE_EXPIRATION_MS, DEFAULT_CHUNK_CACHE_SIZE, DEFAULT_CHUNK_OVERLAP, DEFAULT_CHUNK_SIZE, DEFAULT_DECAY_POLICY, DEFAULT_MAX_CLASSIFIER_CALLS_PER_SWEEP, DEFAULT_MIN_CHUNK_SIZE, DEFAULT_PROFILE_FACETS, DEFAULT_PROFILE_FACT_TYPE_WEIGHTS, DEFAULT_PROFILE_PROOF_ALPHA, DEFAULT_PROFILE_TREND_MULTIPLIERS, 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, EncryptionKeyMissingError, type ExtractFactsOptions, type ExtractOutcome, type ExtractedCandidate, type ExtractedEntity, type ExtractionCursorStore, type FactType, type FileMetadata, type FlushResult, type GetConversationsPageOptions, type GetMessagesPageOptions, type GraphTraversalOptions, HARD_DELETE_WINDOW_MS, INFERENCE_ID_HEADER, type InjectionClassifierOptions, type InjectionReason, type LazyStoredConversation, type LlmDecayClassifierOptions, type LlmNeighborRefinerOptions, type Logger, LoggerProvider, type LoggerProviderProps, MAX_HOPS, MEDIUM_TTL_MS, type MemoriesNeedingTopicExtraction, type EmbeddingOptions as MemoryEngineEmbeddingOptions, type MemoryEngineResult, type MemoryEngineSearchOptions, type MemoryExtractedEvent, type MemoryKind, type MemoryQuarantinedEvent, type MemoryVaultSearchOptions, type MemoryVaultToolOptions, type MessageRedactionResult, type MessageSkeleton, NEVER_TTL_MS, NODE_BUDGET, NOTION_OAUTH_CONFIG, type NeighborRefiner, type NotionAuthUrlParams, type NotionClientRegistration, type NotionExchangeCodeParams, type NotionOAuthEndpoints, type NotionPKCEChallenge, type NotionRefreshTokenParams, type NotionTokenResponse, type NowSource, type ObservationTrend, type ObservationTrendInput, PAST_EVENT_GRACE_MS, PII_PATTERNS, PROFILE_DOC_VERSION, type PiiCategory, type PiiMatch, type PiiPattern, PiiRedactor, type PiiRedactorOptions, type PlatformStorage, type PortalLlmAuth, type ProfileConfigFingerprint, type ProfileDoc, type ProfileFacet, type ProfileFacetKey, type ProfileSalienceInput, type ProfileSection, type PromptPreProcessor, type PromptPreProcessorContext, type QuantizedEmbedding, type QuarantinedMemoryInfo, QueueManager, type QueueStatus, 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 RedactionResult, type ReflectOptions, type ReflectResult, type RequestEncryptionKeyOptions, RerankerUnavailableError, type ResumeStreamOptions, type ResumeStreamResult, type ResumeStreamWithStorageResult, type RetainAction, type RetainContext, type RetainOptions, type RetainResult, type RetainSource, SDK_SCHEMA_VERSION, SHORT_TTL_MS, STREAM_RESUMABLE_HEADER, type ScoreBreakdown, type ScoreProfileSalienceOptions, type ScreenResult, type ScreenedCandidate, type SearchSource, type SendMessageWithStorageArgs, type SendMessageWithStorageDetachedResult, type SendMessageWithStorageResult, type ServerToolsOptions, type ServerToolsResponse, type SignMessageFn, type StockPriceClassification, type StockPricePreProcessorOptions, type ChatCompletionUsage as StoredChatCompletionUsage, type StoredConversation, type StoredConversationMemory, type StoredMessage, type StoredMessageWithSimilarity, type StoredVaultFolder, VaultFolder as StoredVaultFolderModel, type StoredVaultMemory, VaultMemory as StoredVaultMemoryModel, StreamExpiredError, type StreamMetaEvent, type StreamResumeHandle, type SynthesizeProfileOptions, TOPICS_EXTRACTION_VERSION, TOPIC_EXTRACTION_BATCH_SIZE, TREND_RECENT_WINDOW_DAYS, TREND_STALE_WINDOW_DAYS, type TextChunk, type TopicExtractOptions, type TopicExtractionInput, type TopicExtractionRunResult, type TurnCompleteEvent, type TurnSkippedEvent, type UpdateVaultFolderOptions, type UpdateVaultMemoryOptions, type UseChatStorageOptions, type UseChatStorageResult, type UseCreditsOptions, type UseCreditsResult, type UseModelsOptions, type UseModelsResult, VAULT_SIZE_HOP_CAP, type VaultEmbeddingCache, type VaultFolderOperationsContext, type VaultMemoryOperationsContext, type VaultMemoryVisibility, type VaultSaveOperation, type VaultSearchResult, WalletPoller, type WeatherClassification, type WeatherPreProcessorOptions, type WebSearchClassification, type WebSearchPreProcessorOptions, addConversationMemoriesOp, archiveVaultMemoryOp, backfillMemoryTopicsOp, buildNotionAuthUrl, capHopsForDensity, chatStorageMigrations, chatStorageSchema, chunkAndEmbedAllMessages, chunkAndEmbedMessage, chunkText, classifyCryptoPrice, classifyCryptoPriceBatch, classifyDecay, classifyInjectionCandidates, classifyObservationTrend, classifyStockPrice, classifyStockPriceBatch, classifyWeather, classifyWeatherBatch, classifyWebSearch, classifyWebSearchBatch, clearAllEncryptionKeys, clearAllEncryptionState, clearConversationMemoriesOp, clearEncryptionKey, clearLazyTitleCache, clearServerToolsCache, consoleLogger, conversationMemoryToStored, cosineInt8, createAutoExtractor, createChunkVectorCache, createCryptoPricePreProcessor, createDecaySweeper, createLlmDecayClassifier, createLlmNeighborRefiner, createMemoryEngineTool, createMemoryVaultSearchTool, createMemoryVaultTool, createNotionTools, createPlatformCursorStore, createRecallTool, createStockPricePreProcessor, createStreamingDeAnonymizer, createVaultEmbeddingCache, createVaultFolderOp, createVaultMemoriesBatchOp, createVaultMemoryOp, createWeatherPreProcessor, createWebSearchPreProcessor, decryptConversationTitle, deleteAllVaultMemoriesForUserOp, deleteVaultFolderOp, deleteVaultMemoryOp, dequantizeEmbedding, discoverNotionOAuthEndpoints, eagerEmbedContent, embedAllMessages, embedMessage, ensureDefaultFoldersOp, exchangeNotionCode, extractAndLinkEntitiesForMemoriesOp, extractAndRetain, extractEntitiesForMemories, extractFacts, generateConversationId, generateEmbedding, generateEmbeddings, generateNotionPKCE, getAllVaultFoldersOp, getAllVaultMemoriesOp, getAllVaultMemoryContentsOp, getCachedServerTools, getConversationMemoriesOp, getConversationsByProjectLazyOp, getConversationsLazyOp, getConversationsPageOp, getDecayCandidatesRawOp, getLogger, getMemoriesNeedingTopicExtractionOp, getServerTools, getUnfiledVaultMemoriesOp, getVaultFolderMemoryCountOp, getVaultMemoryOp, hardDeleteDecayedOp, hasEncryptionKey, injectionSignatureCatalog, isPiiRedactor, isRerankerAvailable, moveMemoriesToFolderOp, noopLogger, onKeyAvailable, preEmbedVaultMemories, quantizeEmbedding, queueManager, rankProfileCandidates, recall, reflect, refreshEncryptionKeyIfMatches, refreshNotionAccessToken, registerNotionClient, relinkMemoryTopicsOp, requestEncryptionKey, resolvePiiRedactor, restoreVaultMemoryOp, resumeStream, retain, scoreProfileSalience, screenCandidatesForInjection, sdkMigrations, sdkModelClasses, sdkSchema, searchVaultMemories, seedEncryptionKeys, setLogger, setMemoryVisibilityOp, shouldChunkMessage, stampTopicsExtractedAtOp, streamCancelPath, streamReplayPath, summarizeObservationTrends, supersedeVaultMemoryOp, synthesizeProfile, traverseGraphLane, ttlForType, updateVaultFolderContextOp, updateVaultFolderOp, updateVaultMemoryEmbeddingOp, updateVaultMemoryOp, upsertMessageOp, useChat, useChatStorage, useCredits, useEncryption, useModels, xhrTransport };
@@ -3506,6 +3506,15 @@ interface StoredMessage {
3506
3506
  feedback?: MessageFeedback;
3507
3507
  /** Tool call events from the backend response (for reconstructing tool call history) */
3508
3508
  toolCallEvents?: LlmapiToolCallEvent[];
3509
+ /**
3510
+ * Set when `content` could not be decrypted on read (#561).
3511
+ * The `content` field still holds the original ciphertext — never a
3512
+ * `[Decryption Failed]` placeholder — so a later unlock can recover.
3513
+ * - `key_missing`: no key for this field's `enc:vN:` version in the store
3514
+ * - `auth_mismatch`: a key was present but AES-GCM auth failed (wrong key)
3515
+ * - `invalid_payload`: malformed ciphertext envelope
3516
+ */
3517
+ decryptionStatus?: "key_missing" | "auth_mismatch" | "invalid_payload";
3509
3518
  }
3510
3519
  interface ActivityPhase {
3511
3520
  id: string;
@@ -4141,6 +4150,35 @@ declare class Conversation extends Model {
4141
4150
  pinnedAt?: Date | null;
4142
4151
  }
4143
4152
 
4153
+ /**
4154
+ * Encryption key version type.
4155
+ * - "v2": Legacy SHA-256 derived key (for reading enc:v2: data)
4156
+ * - "v3": HKDF derived key with domain separation (for new encryption)
4157
+ */
4158
+ type EncryptionKeyVersion = "v2" | "v3";
4159
+ /**
4160
+ * Thrown by {@link getEncryptionKey} when the requested version is absent.
4161
+ * Distinct from AES-GCM auth-tag failures so decrypt callers can tell
4162
+ * "need to derive/hydrate this version" from "wrong key for intact ciphertext".
4163
+ */
4164
+ declare class EncryptionKeyMissingError extends Error {
4165
+ readonly address: string;
4166
+ readonly version: EncryptionKeyVersion;
4167
+ constructor(address: string, version: EncryptionKeyVersion);
4168
+ }
4169
+ /**
4170
+ * Options for {@link requestEncryptionKey}.
4171
+ */
4172
+ interface RequestEncryptionKeyOptions {
4173
+ /**
4174
+ * When true, re-derive and replace any existing in-memory keys for this
4175
+ * address. Default false preserves the historical "if present, return"
4176
+ * short-circuit. Prefer {@link refreshEncryptionKeyIfMatches} when the
4177
+ * caller has ciphertext that must keep working — force-replace can pin a
4178
+ * newly derived wrong key over a still-valid one.
4179
+ */
4180
+ force?: boolean;
4181
+ }
4144
4182
  /**
4145
4183
  * Register a callback that fires when an encryption key becomes available for an address.
4146
4184
  * If the key is already available, the callback fires immediately.
@@ -4186,9 +4224,30 @@ declare function clearAllEncryptionState(): void;
4186
4224
  */
4187
4225
  declare function clearAllEncryptionKeys(): void;
4188
4226
  /**
4189
- * Checks if an encryption key exists in memory for the given wallet address
4227
+ * Checks if an encryption key exists in memory for the given wallet address.
4228
+ *
4229
+ * @param address - Wallet address
4230
+ * @param version - When omitted, checks the **v3** (`current`) key — the key
4231
+ * write/OPFS/encrypt paths need. Callers that only need to read legacy
4232
+ * `enc:v2:` data should pass `"v2"` explicitly. (#561 / PR #828)
4233
+ */
4234
+ declare function hasEncryptionKey(address: string, version?: EncryptionKeyVersion): boolean;
4235
+ /**
4236
+ * Seed (or merge) raw key hex into the in-memory store without signing.
4237
+ *
4238
+ * Used by platform polyfills that hydrate from SecureStore / keychain where
4239
+ * one version may be missing — callers must not require both versions to
4240
+ * exist before the other becomes usable (#561).
4241
+ *
4242
+ * Existing versions are preserved when the corresponding argument is omitted.
4243
+ * Pass an explicit empty merge is not supported; omit the field to leave it.
4244
+ *
4245
+ * Each provided key must be 64 hex characters (32-byte AES key).
4190
4246
  */
4191
- declare function hasEncryptionKey(address: string): boolean;
4247
+ declare function seedEncryptionKeys(address: string, keys: {
4248
+ legacy?: string;
4249
+ current?: string;
4250
+ }): void;
4192
4251
  /**
4193
4252
  * Options for signing messages.
4194
4253
  */
@@ -4209,24 +4268,50 @@ type SignMessageFn = (message: string, options?: SignMessageOptions) => Promise<
4209
4268
  type EmbeddedWalletSignerFn = (message: string, options?: SignMessageOptions) => Promise<string>;
4210
4269
  /**
4211
4270
  * Requests the user to sign a message to generate an encryption key.
4212
- * If a key already exists in memory for the given wallet, resolves immediately.
4271
+ * If a key already exists in memory for the given wallet, resolves immediately
4272
+ * unless {@link RequestEncryptionKeyOptions.force} is set.
4213
4273
  *
4214
4274
  * Note: Keys are stored in memory only and do not persist across page reloads.
4215
4275
  * This is a security feature - users must sign once per session to derive their key.
4216
4276
  *
4277
+ * When a seeded/pinned store already has keys and the fresh derive does not
4278
+ * match any of them, the store is left unchanged and this resolves to `false`
4279
+ * (without firing {@link onKeyAvailable}). Callers that need write readiness
4280
+ * should check the return value or {@link hasEncryptionKey} before encrypting
4281
+ * so they can surface a re-unlock UI instead of failing downstream (#828).
4282
+ *
4217
4283
  * @param walletAddress - The wallet address to generate the key for
4218
4284
  * @param signMessage - Function to sign a message (returns signature hex string)
4219
4285
  * @param embeddedWalletSigner - Optional function for silent signing with embedded wallets
4220
- * @returns Promise that resolves when the key is available
4286
+ * @param options - Optional flags (e.g. force re-derive)
4287
+ * @returns `true` when keys are available after the call; `false` when a
4288
+ * divergent derive left the store unchanged (or the session was torn down
4289
+ * mid-flight).
4290
+ */
4291
+ declare function requestEncryptionKey(walletAddress: string, signMessage: SignMessageFn, embeddedWalletSigner?: EmbeddedWalletSignerFn, options?: RequestEncryptionKeyOptions): Promise<boolean>;
4292
+ /**
4293
+ * Re-derive encryption keys from a fresh signature and commit them **only if**
4294
+ * they successfully decrypt `probeCiphertext` (a prefixed `enc:v2:` / `enc:v3:`
4295
+ * value). If they do not, the existing in-memory keys are left untouched.
4296
+ *
4297
+ * Concurrent calls for the same wallet share one sign+derive. Each caller then
4298
+ * probes **its own** ciphertext against those candidates, so mixed-era messages
4299
+ * in one `Promise.all` batch can still recover when only the leader's probe
4300
+ * misses (#828 review). Failed candidates are memoized for the session so
4301
+ * pagination does not re-prompt on every page when the wallet has changed.
4302
+ *
4303
+ * @returns true when keys were refreshed (probe decrypted); false when the
4304
+ * probe failed under the candidate keys (store unchanged) or the probe was
4305
+ * not encrypted.
4221
4306
  */
4222
- declare function requestEncryptionKey(walletAddress: string, signMessage: SignMessageFn, embeddedWalletSigner?: EmbeddedWalletSignerFn): Promise<void>;
4307
+ declare function refreshEncryptionKeyIfMatches(walletAddress: string, probeCiphertext: string, signMessage: SignMessageFn, embeddedWalletSigner?: EmbeddedWalletSignerFn): Promise<boolean>;
4223
4308
  /**
4224
4309
  * Result returned by the useEncryption hook.
4225
4310
  * @category Hooks
4226
4311
  */
4227
4312
  interface UseEncryptionResult {
4228
4313
  /** Request and generate an encryption key for a wallet address */
4229
- requestEncryptionKey: (walletAddress: string) => Promise<void>;
4314
+ requestEncryptionKey: (walletAddress: string) => Promise<boolean>;
4230
4315
  /** Request and generate an ECDH key pair for a wallet address */
4231
4316
  requestKeyPair: (walletAddress: string) => Promise<void>;
4232
4317
  /** Export the public key for a wallet address as base64-encoded SPKI */
@@ -7631,6 +7716,23 @@ interface ProfileSection {
7631
7716
  text: string;
7632
7717
  /** Vault memory ids this section was grounded on — provenance + delta refresh. */
7633
7718
  sourceMemoryIds: string[];
7719
+ /**
7720
+ * Structured occupation — the `work_role` facet only. A short role phrase
7721
+ * (at most 80 code points, PII-gated alongside {@link ProfileSection.text})
7722
+ * that a profile store's `occupation` column takes verbatim.
7723
+ *
7724
+ * Absent when the facet found no evidence, when the model didn't return one,
7725
+ * or when the value it returned couldn't be made publishable. `text` is
7726
+ * unaffected either way, so the prose is never blocked on this.
7727
+ */
7728
+ occupation?: string;
7729
+ /**
7730
+ * Structured interests — the `interests` facet only. Discrete entries,
7731
+ * trimmed and deduped case- and space-insensitively (first spelling wins), at
7732
+ * most 12 items of at most 40 code points each, ready for a profile store's
7733
+ * `interests` column. Absent when nothing survived normalization.
7734
+ */
7735
+ interests?: string[];
7634
7736
  /** Unix ms this section was generated. */
7635
7737
  generatedAt: number;
7636
7738
  /** True when regeneration failed and a prior section value was carried
@@ -7647,10 +7749,12 @@ interface ProfileConfigFingerprint {
7647
7749
  /** Facet keys present in the doc, sorted. */
7648
7750
  facetKeys: ProfileFacetKey[];
7649
7751
  /** Order-independent digest of each facet's full definition (key + label +
7650
- * query + guidance). Reuse must invalidate when a facet's PROMPT changes, not
7651
- * just its key set — otherwise reused sections carry text generated under the
7652
- * old definition. Facet display order does NOT invalidate (sections are
7653
- * rebuilt in facet order and reused by key). */
7752
+ * query + guidance) and the response schema it is synthesized under. Reuse
7753
+ * must invalidate when a facet's PROMPT changes, not just its key set —
7754
+ * otherwise reused sections carry text generated under the old definition,
7755
+ * or under an output schema that predates a field the caller now reads.
7756
+ * Facet display order does NOT invalidate (sections are rebuilt in facet
7757
+ * order and reused by key). */
7654
7758
  facetsSignature: string;
7655
7759
  /** Scopes the facts were drawn from, sorted. */
7656
7760
  scopes: string[];
@@ -9234,4 +9338,4 @@ declare function refreshNotionAccessToken(params: NotionRefreshTokenParams): Pro
9234
9338
  */
9235
9339
  declare function createNotionTools(getAccessToken: () => string | null, requestNotionAccess: () => Promise<string>): ToolConfig[];
9236
9340
 
9237
- export { type AutoExtractMessage, type AutoExtractor, type Budget, type CachedChunkVectors, type CachedServerTools, Conversation as ChatConversation, Message as ChatMessage, type ChatRole, type ChunkVectorCache, type ChunkingOptions, type ConsolidationFallbackReason, type ConversationMemoryInput, ConversationMemory as ConversationMemoryModel, type ConversationMemoryOperationsContext, type CreateAutoExtractorOptions, type CreateConversationOptions, type CreateDecaySweeperOptions, type CreateMessageOptions, type CreateVaultFolderOptions, type CreateVaultMemoryOptions, type CryptoPriceClassification, type CryptoPricePreProcessorOptions, DEFAULT_CACHE_EXPIRATION_MS, DEFAULT_CHUNK_CACHE_SIZE, DEFAULT_CHUNK_OVERLAP, DEFAULT_CHUNK_SIZE, DEFAULT_DECAY_POLICY, DEFAULT_MAX_CLASSIFIER_CALLS_PER_SWEEP, DEFAULT_MIN_CHUNK_SIZE, DEFAULT_PROFILE_FACETS, DEFAULT_PROFILE_FACT_TYPE_WEIGHTS, DEFAULT_PROFILE_PROOF_ALPHA, DEFAULT_PROFILE_TREND_MULTIPLIERS, 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, type ExtractFactsOptions, type ExtractOutcome, type ExtractedCandidate, type ExtractedEntity, type ExtractionCursorStore, type FactType, type FileMetadata, type FlushResult, type GetConversationsPageOptions, type GetMessagesPageOptions, type GraphTraversalOptions, HARD_DELETE_WINDOW_MS, INFERENCE_ID_HEADER, type InjectionClassifierOptions, type InjectionReason, type LazyStoredConversation, type LlmDecayClassifierOptions, type LlmNeighborRefinerOptions, type Logger, LoggerProvider, type LoggerProviderProps, MAX_HOPS, MEDIUM_TTL_MS, type MemoriesNeedingTopicExtraction, type EmbeddingOptions as MemoryEngineEmbeddingOptions, type MemoryEngineResult, type MemoryEngineSearchOptions, type MemoryExtractedEvent, type MemoryKind, type MemoryQuarantinedEvent, type MemoryVaultSearchOptions, type MemoryVaultToolOptions, type MessageRedactionResult, type MessageSkeleton, NEVER_TTL_MS, NODE_BUDGET, NOTION_OAUTH_CONFIG, type NeighborRefiner, type NotionAuthUrlParams, type NotionClientRegistration, type NotionExchangeCodeParams, type NotionOAuthEndpoints, type NotionPKCEChallenge, type NotionRefreshTokenParams, type NotionTokenResponse, type NowSource, type ObservationTrend, type ObservationTrendInput, PAST_EVENT_GRACE_MS, PII_PATTERNS, PROFILE_DOC_VERSION, type PiiCategory, type PiiMatch, type PiiPattern, PiiRedactor, type PiiRedactorOptions, type PlatformStorage, type PortalLlmAuth, type ProfileConfigFingerprint, type ProfileDoc, type ProfileFacet, type ProfileFacetKey, type ProfileSalienceInput, type ProfileSection, type PromptPreProcessor, type PromptPreProcessorContext, type QuantizedEmbedding, type QuarantinedMemoryInfo, QueueManager, type QueueStatus, 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 RedactionResult, type ReflectOptions, type ReflectResult, RerankerUnavailableError, type ResumeStreamOptions, type ResumeStreamResult, type ResumeStreamWithStorageResult, type RetainAction, type RetainContext, type RetainOptions, type RetainResult, type RetainSource, SDK_SCHEMA_VERSION, SHORT_TTL_MS, STREAM_RESUMABLE_HEADER, type ScoreBreakdown, type ScoreProfileSalienceOptions, type ScreenResult, type ScreenedCandidate, type SearchSource, type SendMessageWithStorageArgs, type SendMessageWithStorageDetachedResult, type SendMessageWithStorageResult, type ServerToolsOptions, type ServerToolsResponse, type SignMessageFn, type StockPriceClassification, type StockPricePreProcessorOptions, type ChatCompletionUsage as StoredChatCompletionUsage, type StoredConversation, type StoredConversationMemory, type StoredMessage, type StoredMessageWithSimilarity, type StoredVaultFolder, VaultFolder as StoredVaultFolderModel, type StoredVaultMemory, VaultMemory as StoredVaultMemoryModel, StreamExpiredError, type StreamMetaEvent, type StreamResumeHandle, type SynthesizeProfileOptions, TOPICS_EXTRACTION_VERSION, TOPIC_EXTRACTION_BATCH_SIZE, TREND_RECENT_WINDOW_DAYS, TREND_STALE_WINDOW_DAYS, type TextChunk, type TopicExtractOptions, type TopicExtractionInput, type TopicExtractionRunResult, type TurnCompleteEvent, type TurnSkippedEvent, type UpdateVaultFolderOptions, type UpdateVaultMemoryOptions, type UseChatStorageOptions, type UseChatStorageResult, type UseCreditsOptions, type UseCreditsResult, type UseModelsOptions, type UseModelsResult, VAULT_SIZE_HOP_CAP, type VaultEmbeddingCache, type VaultFolderOperationsContext, type VaultMemoryOperationsContext, type VaultMemoryVisibility, type VaultSaveOperation, type VaultSearchResult, WalletPoller, type WeatherClassification, type WeatherPreProcessorOptions, type WebSearchClassification, type WebSearchPreProcessorOptions, addConversationMemoriesOp, archiveVaultMemoryOp, backfillMemoryTopicsOp, buildNotionAuthUrl, capHopsForDensity, chatStorageMigrations, chatStorageSchema, chunkAndEmbedAllMessages, chunkAndEmbedMessage, chunkText, classifyCryptoPrice, classifyCryptoPriceBatch, classifyDecay, classifyInjectionCandidates, classifyObservationTrend, classifyStockPrice, classifyStockPriceBatch, classifyWeather, classifyWeatherBatch, classifyWebSearch, classifyWebSearchBatch, clearAllEncryptionKeys, clearAllEncryptionState, clearConversationMemoriesOp, clearEncryptionKey, clearLazyTitleCache, clearServerToolsCache, consoleLogger, conversationMemoryToStored, cosineInt8, createAutoExtractor, createChunkVectorCache, createCryptoPricePreProcessor, createDecaySweeper, createLlmDecayClassifier, createLlmNeighborRefiner, createMemoryEngineTool, createMemoryVaultSearchTool, createMemoryVaultTool, createNotionTools, createPlatformCursorStore, createRecallTool, createStockPricePreProcessor, createStreamingDeAnonymizer, createVaultEmbeddingCache, createVaultFolderOp, createVaultMemoriesBatchOp, createVaultMemoryOp, createWeatherPreProcessor, createWebSearchPreProcessor, decryptConversationTitle, deleteAllVaultMemoriesForUserOp, deleteVaultFolderOp, deleteVaultMemoryOp, dequantizeEmbedding, discoverNotionOAuthEndpoints, eagerEmbedContent, embedAllMessages, embedMessage, ensureDefaultFoldersOp, exchangeNotionCode, extractAndLinkEntitiesForMemoriesOp, extractAndRetain, extractEntitiesForMemories, extractFacts, generateConversationId, generateEmbedding, generateEmbeddings, generateNotionPKCE, getAllVaultFoldersOp, getAllVaultMemoriesOp, getAllVaultMemoryContentsOp, getCachedServerTools, getConversationMemoriesOp, getConversationsByProjectLazyOp, getConversationsLazyOp, getConversationsPageOp, getDecayCandidatesRawOp, getLogger, getMemoriesNeedingTopicExtractionOp, getServerTools, getUnfiledVaultMemoriesOp, getVaultFolderMemoryCountOp, getVaultMemoryOp, hardDeleteDecayedOp, hasEncryptionKey, injectionSignatureCatalog, isPiiRedactor, isRerankerAvailable, moveMemoriesToFolderOp, noopLogger, onKeyAvailable, preEmbedVaultMemories, quantizeEmbedding, queueManager, rankProfileCandidates, recall, reflect, refreshNotionAccessToken, registerNotionClient, relinkMemoryTopicsOp, requestEncryptionKey, resolvePiiRedactor, restoreVaultMemoryOp, resumeStream, retain, scoreProfileSalience, screenCandidatesForInjection, sdkMigrations, sdkModelClasses, sdkSchema, searchVaultMemories, setLogger, setMemoryVisibilityOp, shouldChunkMessage, stampTopicsExtractedAtOp, streamCancelPath, streamReplayPath, summarizeObservationTrends, supersedeVaultMemoryOp, synthesizeProfile, traverseGraphLane, ttlForType, updateVaultFolderContextOp, updateVaultFolderOp, updateVaultMemoryEmbeddingOp, updateVaultMemoryOp, upsertMessageOp, useChat, useChatStorage, useCredits, useEncryption, useModels, xhrTransport };
9341
+ export { type AutoExtractMessage, type AutoExtractor, type Budget, type CachedChunkVectors, type CachedServerTools, Conversation as ChatConversation, Message as ChatMessage, type ChatRole, type ChunkVectorCache, type ChunkingOptions, type ConsolidationFallbackReason, type ConversationMemoryInput, ConversationMemory as ConversationMemoryModel, type ConversationMemoryOperationsContext, type CreateAutoExtractorOptions, type CreateConversationOptions, type CreateDecaySweeperOptions, type CreateMessageOptions, type CreateVaultFolderOptions, type CreateVaultMemoryOptions, type CryptoPriceClassification, type CryptoPricePreProcessorOptions, DEFAULT_CACHE_EXPIRATION_MS, DEFAULT_CHUNK_CACHE_SIZE, DEFAULT_CHUNK_OVERLAP, DEFAULT_CHUNK_SIZE, DEFAULT_DECAY_POLICY, DEFAULT_MAX_CLASSIFIER_CALLS_PER_SWEEP, DEFAULT_MIN_CHUNK_SIZE, DEFAULT_PROFILE_FACETS, DEFAULT_PROFILE_FACT_TYPE_WEIGHTS, DEFAULT_PROFILE_PROOF_ALPHA, DEFAULT_PROFILE_TREND_MULTIPLIERS, 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, EncryptionKeyMissingError, type ExtractFactsOptions, type ExtractOutcome, type ExtractedCandidate, type ExtractedEntity, type ExtractionCursorStore, type FactType, type FileMetadata, type FlushResult, type GetConversationsPageOptions, type GetMessagesPageOptions, type GraphTraversalOptions, HARD_DELETE_WINDOW_MS, INFERENCE_ID_HEADER, type InjectionClassifierOptions, type InjectionReason, type LazyStoredConversation, type LlmDecayClassifierOptions, type LlmNeighborRefinerOptions, type Logger, LoggerProvider, type LoggerProviderProps, MAX_HOPS, MEDIUM_TTL_MS, type MemoriesNeedingTopicExtraction, type EmbeddingOptions as MemoryEngineEmbeddingOptions, type MemoryEngineResult, type MemoryEngineSearchOptions, type MemoryExtractedEvent, type MemoryKind, type MemoryQuarantinedEvent, type MemoryVaultSearchOptions, type MemoryVaultToolOptions, type MessageRedactionResult, type MessageSkeleton, NEVER_TTL_MS, NODE_BUDGET, NOTION_OAUTH_CONFIG, type NeighborRefiner, type NotionAuthUrlParams, type NotionClientRegistration, type NotionExchangeCodeParams, type NotionOAuthEndpoints, type NotionPKCEChallenge, type NotionRefreshTokenParams, type NotionTokenResponse, type NowSource, type ObservationTrend, type ObservationTrendInput, PAST_EVENT_GRACE_MS, PII_PATTERNS, PROFILE_DOC_VERSION, type PiiCategory, type PiiMatch, type PiiPattern, PiiRedactor, type PiiRedactorOptions, type PlatformStorage, type PortalLlmAuth, type ProfileConfigFingerprint, type ProfileDoc, type ProfileFacet, type ProfileFacetKey, type ProfileSalienceInput, type ProfileSection, type PromptPreProcessor, type PromptPreProcessorContext, type QuantizedEmbedding, type QuarantinedMemoryInfo, QueueManager, type QueueStatus, 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 RedactionResult, type ReflectOptions, type ReflectResult, type RequestEncryptionKeyOptions, RerankerUnavailableError, type ResumeStreamOptions, type ResumeStreamResult, type ResumeStreamWithStorageResult, type RetainAction, type RetainContext, type RetainOptions, type RetainResult, type RetainSource, SDK_SCHEMA_VERSION, SHORT_TTL_MS, STREAM_RESUMABLE_HEADER, type ScoreBreakdown, type ScoreProfileSalienceOptions, type ScreenResult, type ScreenedCandidate, type SearchSource, type SendMessageWithStorageArgs, type SendMessageWithStorageDetachedResult, type SendMessageWithStorageResult, type ServerToolsOptions, type ServerToolsResponse, type SignMessageFn, type StockPriceClassification, type StockPricePreProcessorOptions, type ChatCompletionUsage as StoredChatCompletionUsage, type StoredConversation, type StoredConversationMemory, type StoredMessage, type StoredMessageWithSimilarity, type StoredVaultFolder, VaultFolder as StoredVaultFolderModel, type StoredVaultMemory, VaultMemory as StoredVaultMemoryModel, StreamExpiredError, type StreamMetaEvent, type StreamResumeHandle, type SynthesizeProfileOptions, TOPICS_EXTRACTION_VERSION, TOPIC_EXTRACTION_BATCH_SIZE, TREND_RECENT_WINDOW_DAYS, TREND_STALE_WINDOW_DAYS, type TextChunk, type TopicExtractOptions, type TopicExtractionInput, type TopicExtractionRunResult, type TurnCompleteEvent, type TurnSkippedEvent, type UpdateVaultFolderOptions, type UpdateVaultMemoryOptions, type UseChatStorageOptions, type UseChatStorageResult, type UseCreditsOptions, type UseCreditsResult, type UseModelsOptions, type UseModelsResult, VAULT_SIZE_HOP_CAP, type VaultEmbeddingCache, type VaultFolderOperationsContext, type VaultMemoryOperationsContext, type VaultMemoryVisibility, type VaultSaveOperation, type VaultSearchResult, WalletPoller, type WeatherClassification, type WeatherPreProcessorOptions, type WebSearchClassification, type WebSearchPreProcessorOptions, addConversationMemoriesOp, archiveVaultMemoryOp, backfillMemoryTopicsOp, buildNotionAuthUrl, capHopsForDensity, chatStorageMigrations, chatStorageSchema, chunkAndEmbedAllMessages, chunkAndEmbedMessage, chunkText, classifyCryptoPrice, classifyCryptoPriceBatch, classifyDecay, classifyInjectionCandidates, classifyObservationTrend, classifyStockPrice, classifyStockPriceBatch, classifyWeather, classifyWeatherBatch, classifyWebSearch, classifyWebSearchBatch, clearAllEncryptionKeys, clearAllEncryptionState, clearConversationMemoriesOp, clearEncryptionKey, clearLazyTitleCache, clearServerToolsCache, consoleLogger, conversationMemoryToStored, cosineInt8, createAutoExtractor, createChunkVectorCache, createCryptoPricePreProcessor, createDecaySweeper, createLlmDecayClassifier, createLlmNeighborRefiner, createMemoryEngineTool, createMemoryVaultSearchTool, createMemoryVaultTool, createNotionTools, createPlatformCursorStore, createRecallTool, createStockPricePreProcessor, createStreamingDeAnonymizer, createVaultEmbeddingCache, createVaultFolderOp, createVaultMemoriesBatchOp, createVaultMemoryOp, createWeatherPreProcessor, createWebSearchPreProcessor, decryptConversationTitle, deleteAllVaultMemoriesForUserOp, deleteVaultFolderOp, deleteVaultMemoryOp, dequantizeEmbedding, discoverNotionOAuthEndpoints, eagerEmbedContent, embedAllMessages, embedMessage, ensureDefaultFoldersOp, exchangeNotionCode, extractAndLinkEntitiesForMemoriesOp, extractAndRetain, extractEntitiesForMemories, extractFacts, generateConversationId, generateEmbedding, generateEmbeddings, generateNotionPKCE, getAllVaultFoldersOp, getAllVaultMemoriesOp, getAllVaultMemoryContentsOp, getCachedServerTools, getConversationMemoriesOp, getConversationsByProjectLazyOp, getConversationsLazyOp, getConversationsPageOp, getDecayCandidatesRawOp, getLogger, getMemoriesNeedingTopicExtractionOp, getServerTools, getUnfiledVaultMemoriesOp, getVaultFolderMemoryCountOp, getVaultMemoryOp, hardDeleteDecayedOp, hasEncryptionKey, injectionSignatureCatalog, isPiiRedactor, isRerankerAvailable, moveMemoriesToFolderOp, noopLogger, onKeyAvailable, preEmbedVaultMemories, quantizeEmbedding, queueManager, rankProfileCandidates, recall, reflect, refreshEncryptionKeyIfMatches, refreshNotionAccessToken, registerNotionClient, relinkMemoryTopicsOp, requestEncryptionKey, resolvePiiRedactor, restoreVaultMemoryOp, resumeStream, retain, scoreProfileSalience, screenCandidatesForInjection, sdkMigrations, sdkModelClasses, sdkSchema, searchVaultMemories, seedEncryptionKeys, setLogger, setMemoryVisibilityOp, shouldChunkMessage, stampTopicsExtractedAtOp, streamCancelPath, streamReplayPath, summarizeObservationTrends, supersedeVaultMemoryOp, synthesizeProfile, traverseGraphLane, ttlForType, updateVaultFolderContextOp, updateVaultFolderOp, updateVaultMemoryEmbeddingOp, updateVaultMemoryOp, upsertMessageOp, useChat, useChatStorage, useCredits, useEncryption, useModels, xhrTransport };