@anuma/sdk 4.2.0 → 5.0.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.
@@ -3471,6 +3471,15 @@ interface StoredMessage {
3471
3471
  feedback?: MessageFeedback;
3472
3472
  /** Tool call events from the backend response (for reconstructing tool call history) */
3473
3473
  toolCallEvents?: LlmapiToolCallEvent[];
3474
+ /**
3475
+ * Set when `content` could not be decrypted on read (#561).
3476
+ * The `content` field still holds the original ciphertext — never a
3477
+ * `[Decryption Failed]` placeholder — so a later unlock can recover.
3478
+ * - `key_missing`: no key for this field's `enc:vN:` version in the store
3479
+ * - `auth_mismatch`: a key was present but AES-GCM auth failed (wrong key)
3480
+ * - `invalid_payload`: malformed ciphertext envelope
3481
+ */
3482
+ decryptionStatus?: "key_missing" | "auth_mismatch" | "invalid_payload";
3474
3483
  }
3475
3484
  interface ActivityPhase {
3476
3485
  id: string;
@@ -3682,6 +3691,29 @@ declare class ConversationSummary extends Model$1 {
3682
3691
  * - "v3": HKDF derived key with domain separation (for new encryption)
3683
3692
  */
3684
3693
  type EncryptionKeyVersion = "v2" | "v3";
3694
+ /**
3695
+ * Thrown by {@link getEncryptionKey} when the requested version is absent.
3696
+ * Distinct from AES-GCM auth-tag failures so decrypt callers can tell
3697
+ * "need to derive/hydrate this version" from "wrong key for intact ciphertext".
3698
+ */
3699
+ declare class EncryptionKeyMissingError extends Error {
3700
+ readonly address: string;
3701
+ readonly version: EncryptionKeyVersion;
3702
+ constructor(address: string, version: EncryptionKeyVersion);
3703
+ }
3704
+ /**
3705
+ * Options for {@link requestEncryptionKey}.
3706
+ */
3707
+ interface RequestEncryptionKeyOptions {
3708
+ /**
3709
+ * When true, re-derive and replace any existing in-memory keys for this
3710
+ * address. Default false preserves the historical "if present, return"
3711
+ * short-circuit. Prefer {@link refreshEncryptionKeyIfMatches} when the
3712
+ * caller has ciphertext that must keep working — force-replace can pin a
3713
+ * newly derived wrong key over a still-valid one.
3714
+ */
3715
+ force?: boolean;
3716
+ }
3685
3717
  /**
3686
3718
  * Register a callback that fires when an encryption key becomes available for an address.
3687
3719
  * If the key is already available, the callback fires immediately.
@@ -3829,9 +3861,30 @@ declare function decryptDataBytes(encryptedHex: string, address: string, version
3829
3861
  */
3830
3862
  declare function decryptDataBytesFromBytes(encrypted: Uint8Array, address: string, version?: EncryptionKeyVersion): Promise<Uint8Array>;
3831
3863
  /**
3832
- * Checks if an encryption key exists in memory for the given wallet address
3864
+ * Checks if an encryption key exists in memory for the given wallet address.
3865
+ *
3866
+ * @param address - Wallet address
3867
+ * @param version - When omitted, checks the **v3** (`current`) key — the key
3868
+ * write/OPFS/encrypt paths need. Callers that only need to read legacy
3869
+ * `enc:v2:` data should pass `"v2"` explicitly. (#561 / PR #828)
3870
+ */
3871
+ declare function hasEncryptionKey(address: string, version?: EncryptionKeyVersion): boolean;
3872
+ /**
3873
+ * Seed (or merge) raw key hex into the in-memory store without signing.
3874
+ *
3875
+ * Used by platform polyfills that hydrate from SecureStore / keychain where
3876
+ * one version may be missing — callers must not require both versions to
3877
+ * exist before the other becomes usable (#561).
3878
+ *
3879
+ * Existing versions are preserved when the corresponding argument is omitted.
3880
+ * Pass an explicit empty merge is not supported; omit the field to leave it.
3881
+ *
3882
+ * Each provided key must be 64 hex characters (32-byte AES key).
3833
3883
  */
3834
- declare function hasEncryptionKey(address: string): boolean;
3884
+ declare function seedEncryptionKeys(address: string, keys: {
3885
+ legacy?: string;
3886
+ current?: string;
3887
+ }): void;
3835
3888
  /**
3836
3889
  * Encrypts data using a pre-fetched CryptoKey.
3837
3890
  * Use this for batch operations to avoid repeated key lookups.
@@ -3912,17 +3965,43 @@ type SignMessageFn = (message: string, options?: SignMessageOptions) => Promise<
3912
3965
  type EmbeddedWalletSignerFn = (message: string, options?: SignMessageOptions) => Promise<string>;
3913
3966
  /**
3914
3967
  * Requests the user to sign a message to generate an encryption key.
3915
- * If a key already exists in memory for the given wallet, resolves immediately.
3968
+ * If a key already exists in memory for the given wallet, resolves immediately
3969
+ * unless {@link RequestEncryptionKeyOptions.force} is set.
3916
3970
  *
3917
3971
  * Note: Keys are stored in memory only and do not persist across page reloads.
3918
3972
  * This is a security feature - users must sign once per session to derive their key.
3919
3973
  *
3974
+ * When a seeded/pinned store already has keys and the fresh derive does not
3975
+ * match any of them, the store is left unchanged and this resolves to `false`
3976
+ * (without firing {@link onKeyAvailable}). Callers that need write readiness
3977
+ * should check the return value or {@link hasEncryptionKey} before encrypting
3978
+ * so they can surface a re-unlock UI instead of failing downstream (#828).
3979
+ *
3920
3980
  * @param walletAddress - The wallet address to generate the key for
3921
3981
  * @param signMessage - Function to sign a message (returns signature hex string)
3922
3982
  * @param embeddedWalletSigner - Optional function for silent signing with embedded wallets
3923
- * @returns Promise that resolves when the key is available
3983
+ * @param options - Optional flags (e.g. force re-derive)
3984
+ * @returns `true` when keys are available after the call; `false` when a
3985
+ * divergent derive left the store unchanged (or the session was torn down
3986
+ * mid-flight).
3924
3987
  */
3925
- declare function requestEncryptionKey(walletAddress: string, signMessage: SignMessageFn, embeddedWalletSigner?: EmbeddedWalletSignerFn): Promise<void>;
3988
+ declare function requestEncryptionKey(walletAddress: string, signMessage: SignMessageFn, embeddedWalletSigner?: EmbeddedWalletSignerFn, options?: RequestEncryptionKeyOptions): Promise<boolean>;
3989
+ /**
3990
+ * Re-derive encryption keys from a fresh signature and commit them **only if**
3991
+ * they successfully decrypt `probeCiphertext` (a prefixed `enc:v2:` / `enc:v3:`
3992
+ * value). If they do not, the existing in-memory keys are left untouched.
3993
+ *
3994
+ * Concurrent calls for the same wallet share one sign+derive. Each caller then
3995
+ * probes **its own** ciphertext against those candidates, so mixed-era messages
3996
+ * in one `Promise.all` batch can still recover when only the leader's probe
3997
+ * misses (#828 review). Failed candidates are memoized for the session so
3998
+ * pagination does not re-prompt on every page when the wallet has changed.
3999
+ *
4000
+ * @returns true when keys were refreshed (probe decrypted); false when the
4001
+ * probe failed under the candidate keys (store unchanged) or the probe was
4002
+ * not encrypted.
4003
+ */
4004
+ declare function refreshEncryptionKeyIfMatches(walletAddress: string, probeCiphertext: string, signMessage: SignMessageFn, embeddedWalletSigner?: EmbeddedWalletSignerFn): Promise<boolean>;
3926
4005
  /**
3927
4006
  * Requests the user to sign a message to generate an ECDH key pair.
3928
4007
  * If a key pair already exists in memory for the given wallet, resolves immediately.
@@ -4866,15 +4945,26 @@ interface MemoryVaultSearchOptions {
4866
4945
  /** RRF smoothing constant for lane fusion. Default 60. */
4867
4946
  rrfK?: number;
4868
4947
  /**
4869
- * LLM-based query decomposition for composite/abstract queries. When set,
4870
- * each query is classified + (if composite) decomposed into 3–5 facet
4871
- * sub-queries via gpt-5-mini, then ranked via {@link rankComposite}.
4872
- * Requires `decomposeOptions` (auth) when set to "llm".
4948
+ * Pre-decomposed facet queries for the composite ranker (719/B4). When
4949
+ * ≥2 are supplied (and embeddings are available), runs {@link rankComposite}
4950
+ * over them — no LLM call inside the search path. Callers that want LLM
4951
+ * rewrite (e.g. `createRecallTool`) call `decomposeQuery` first and pass
4952
+ * the facets here.
4953
+ */
4954
+ subQueries?: string[];
4955
+ /**
4956
+ * @deprecated 719/B4 — ignored by {@link searchVaultMemories} /
4957
+ * {@link searchVaultMemoriesWithSize}. Pass {@link MemoryVaultSearchOptions.subQueries}
4958
+ * (or use `createRecallTool`). The legacy {@link createMemoryVaultSearchTool}
4959
+ * executor still honors `decompose: "llm"` + `decomposeOptions` for eval
4960
+ * parity, then forwards facets into the LLM-free search path.
4873
4961
  */
4874
4962
  decompose?: "off" | "llm";
4875
- /** Auth + endpoint for the decomposition LLM call. Required when
4876
- * decompose="llm". Auth is the dual pattern — one of `apiKey` /
4877
- * `getToken`; see {@link PortalLlmAuth}. */
4963
+ /**
4964
+ * @deprecated 719/B4 — see `decompose`. Ignored on the programmatic search
4965
+ * path; tool-layer rewrite still reads this from the search-tool options.
4966
+ * Prefer `RecallToolOptions.decomposeOptions` with `createRecallTool`.
4967
+ */
4878
4968
  decomposeOptions?: PortalLlmAuth & {
4879
4969
  baseUrl?: string;
4880
4970
  model?: string;
@@ -5039,9 +5129,11 @@ type MemoryKind = "fact" | "chunk";
5039
5129
  * Budget controls retrieval depth/cost. Higher budgets enable more
5040
5130
  * candidate sources and the cross-encoder reranker.
5041
5131
  *
5042
- * - `low`: cosine + BM25 fusion only. No reranker. Mobile default.
5043
- * - `mid`: + recency boost. Demo default.
5044
- * - `high`: + cross-encoder rerank stage. Demo `budget: high` path.
5132
+ * - `low`: cosine + BM25 + recency. No reranker. Mobile default.
5133
+ * - `mid`: + cross-encoder rerank.
5134
+ * - `high`: + multi-hop graph traversal. LLM-free — query decomposition
5135
+ * (when wanted) lives in the tool/agent layer ({@link createRecallTool}),
5136
+ * not inside `recall()` itself (719/B4).
5045
5137
  */
5046
5138
  type Budget = "low" | "mid" | "high";
5047
5139
  interface ScoreBreakdown {
@@ -5141,10 +5233,28 @@ interface RecallOptions {
5141
5233
  /** Drop results below this score. Default: 0.1 for facts, 0.5 for chunks (mirrors today's defaults). */
5142
5234
  minScore?: number;
5143
5235
  /**
5144
- * Auth + endpoint for the LLM-based query decomposition pass. Without
5145
- * these, decompose is skipped even at `budget: 'high'`. Mirrors the
5146
- * shape used by `searchVaultMemories`. Auth is the dual pattern — one
5147
- * of `apiKey` / `getToken` is required; see {@link PortalLlmAuth}.
5236
+ * Pre-decomposed facet queries for the composite ranker. When ≥2 are
5237
+ * supplied, the vault lane runs `rankComposite` over them (no LLM call
5238
+ * inside `recall()` — 719/B4). Callers that still want LLM rewrite
5239
+ * (e.g. {@link createRecallTool} at `budget: 'high'`) call
5240
+ * `decomposeQuery` themselves and pass the result here. A single entry
5241
+ * (or omitting this) keeps the single-query path.
5242
+ */
5243
+ subQueries?: string[];
5244
+ /**
5245
+ * Auth + endpoint for optional LLM helpers that reuse portal auth —
5246
+ * currently {@link RecallOptions.graphRefine} neighbor selection.
5247
+ * Query decomposition is **not** driven by this field inside `recall()`
5248
+ * (719/B4); {@link createRecallTool} reads the same shape from
5249
+ * `RecallToolOptions.decomposeOptions` for tool-layer rewrite.
5250
+ *
5251
+ * Callers that still pass `{ budget: 'high', decomposeOptions }` without
5252
+ * {@link RecallOptions.subQueries} keep compiling but no longer rewrite —
5253
+ * `recall()` emits `decompose-moved` on {@link RecallDiagnostics.degraded}
5254
+ * so upgrades without a changelog read still leave a telemetry breadcrumb.
5255
+ *
5256
+ * Auth is the dual pattern — one of `apiKey` / `getToken` is required;
5257
+ * see {@link PortalLlmAuth}.
5148
5258
  */
5149
5259
  decomposeOptions?: PortalLlmAuth & {
5150
5260
  baseUrl?: string;
@@ -5248,9 +5358,22 @@ type RecallDegradation =
5248
5358
  /** Rerank was requested (budget mid/high) but the cross-encoder didn't run
5249
5359
  * this call — unavailable (e.g. React Native) or a transient failure. */
5250
5360
  "rerank-unavailable"
5251
- /** `budget: 'high'` requested but no `decomposeOptions`, so query
5252
- * decomposition was skipped and the budget downgraded to mid. */
5361
+ /**
5362
+ * @deprecated 719/B4 moved query decomposition out of `recall()`. Budget
5363
+ * `high` no longer requires `decomposeOptions` and this signal is never
5364
+ * emitted. Prefer `"decompose-moved"` for the upgrade breadcrumb. Kept in
5365
+ * the union so existing telemetry consumers stay typed.
5366
+ */
5253
5367
  | "decompose-unavailable"
5368
+ /**
5369
+ * `budget: 'high'` with `decomposeOptions` set but no usable
5370
+ * {@link RecallOptions.subQueries}. Pre-B4 this call shape triggered LLM
5371
+ * rewrite inside `recall()`; post-B4 it stays on the single-query high
5372
+ * path (rerank + graph) and callers must pass facets (or use
5373
+ * {@link createRecallTool}). Surfaced so silent quality regressions show
5374
+ * up in diagnostics instead of looking healthier than before.
5375
+ */
5376
+ | "decompose-moved"
5254
5377
  /** There was no usable cosine lane, so results were ranked on BM25 (lexical)
5255
5378
  * alone: either the query embedding failed (or came back empty), or no
5256
5379
  * candidate had a vector to score against it because the row (re)embed failed.
@@ -8024,9 +8147,14 @@ declare function rankProfileCandidates(inputs: readonly ProfileSalienceInput[],
8024
8147
  * Unified Recall API — single retrieval surface above vault + engine.
8025
8148
  *
8026
8149
  * Budget maps to pipeline depth (mirrors Hindsight's tiered defaults):
8027
- * - `low` → V2 cosine + BM25 + recency (no rerank, no decompose)
8150
+ * - `low` → V2 cosine + BM25 + recency (no rerank)
8028
8151
  * - `mid` → V2 + cross-encoder rerank
8029
- * - `high` → V2 + rerank + LLM query decomposition for composite queries
8152
+ * - `high` → V2 + rerank + multi-hop graph traversal
8153
+ *
8154
+ * LLM-free by design (719/B4): query decomposition for composite asks
8155
+ * lives in the tool/agent layer (`createRecallTool`), which may pass
8156
+ * pre-built `subQueries` into this API. `recall()` itself never pays an
8157
+ * LLM RTT.
8030
8158
  *
8031
8159
  * Fact + chunk lanes are fused with RRF (k=60). The previous naive
8032
8160
  * "sort the union by raw score" path is gone — score scales differ
@@ -8081,7 +8209,8 @@ interface RecallToolOptions {
8081
8209
  folderId?: string | null;
8082
8210
  /** Exclude one conversation from chunk results (typically the active one). */
8083
8211
  excludeConversationId?: string;
8084
- /** LLM-decompose options; only used at budget="high". Auth follows the
8212
+ /** LLM-decompose options; only used at budget="high". Runs in THIS tool
8213
+ * executor (719/B4) — `recall()` itself is LLM-free. Auth follows the
8085
8214
  * dual pattern: apiKey (server/CLI) or getToken (browser identity
8086
8215
  * tokens) — at least one required. */
8087
8216
  decomposeOptions?: PortalLlmAuth & {
@@ -9522,4 +9651,4 @@ declare function sanitizeQuotes(s: string): string;
9522
9651
  declare function renderTemplate(value: string | null | undefined, template: string): string | null;
9523
9652
  declare function buildSystemPrompt(ctx: PromptContext, options?: BuildPromptOptions): BuildPromptResult;
9524
9653
 
9525
- export { type AnalyzeStyleOptions, type AnalyzeStyleResult, type ApiResponse, type ApiType, type AutoExecutedToolResult, type AutoExtractMessage, type AutoExtractor, type Budget, type BuildPromptOptions, type BuildPromptResult, type CachedChunkVectors, type CachedServerTools, type ChatCompletionUsage, type ChatRole, type ChunkSearchResult, type ChunkVectorCache, type ChunkingOptions, type ConnectorGuidance, type ConnectorGuidanceInput, type ConsolidationFallbackReason, Conversation, ConversationSummary, type CreateAutoExtractorOptions, type CreateConversationOptions, type CreateDecaySweeperOptions, type CreateMediaOptions, type CreateMessageOptions, type CreateModelPreferenceOptions, type CreateProjectOptions, type CreateUserPreferenceOptions, type CreateVaultMemoryOptions, type CryptoPriceClassification, type CryptoPricePreProcessorOptions, DEFAULT_ANALYSIS_PROMPT, DEFAULT_ANALYZE_AFTER_MESSAGES, DEFAULT_CACHE_EXPIRATION_MS, DEFAULT_CHUNK_CACHE_SIZE, DEFAULT_CHUNK_OVERLAP, DEFAULT_CHUNK_SIZE, DEFAULT_DECAY_POLICY, DEFAULT_DOCUMENT_PATTERN, DEFAULT_EXCLUDED_SERVER_TOOLS, DEFAULT_MAX_CLASSIFIER_CALLS_PER_SWEEP, DEFAULT_MAX_INPUT_MESSAGES, DEFAULT_MAX_PROFILE_LENGTH, DEFAULT_MIN_CHUNK_SIZE, DEFAULT_MIN_MESSAGES, DEFAULT_PERSONALITY_SETTINGS, DEFAULT_PROFILE_FACETS, DEFAULT_PROFILE_FACT_TYPE_WEIGHTS, DEFAULT_PROFILE_PROOF_ALPHA, DEFAULT_PROFILE_TREND_MULTIPLIERS, DEFAULT_PROMPT_TEMPLATES, DEFAULT_REFRESH_EVERY_MESSAGES, DEFAULT_SERVER_TOOLS_MATCH_OPTIONS, DEFAULT_SUMMARY_MIN_WINDOW_MESSAGES, DEFAULT_SUMMARY_MODEL, DEFAULT_SUMMARY_TOKEN_THRESHOLD, DEFAULT_VAULT_CACHE_SIZE, DatabaseManager, type DatabaseManagerLogger, type DatabaseManagerOptions, type DecayCandidateRaw, type DecayClassifier, type DecayInput, type DecayPolicy, type DecaySweepResult, type DecaySweeper, type DecayVerdict, ENTITY_FANOUT, type EmbeddedWalletSignerFn, ExcelProcessor, type ExtractFactsOptions, type ExtractOutcome, type ExtractedCandidate, type ExtractedEntity, type ExtractionCursorStore, type FactType, type FileMetadata, type FileProcessor, type FileTypeQuery, type FileWithData, type FlushResult, type GetConversationsPageOptions, type GraphTraversalOptions, HARD_DELETE_WINDOW_MS, INFERENCE_ID_HEADER, type InjectionClassifierOptions, type InjectionReason, type LazyStoredConversation, type LlmDecayClassifierOptions, type LlmNeighborRefinerOptions, type LlmTokenUsage, MAX_HOPS, MAX_MESSAGES_PER_SUMMARIZATION, MEDIUM_TTL_MS, Media, type MediaDimensions, type MediaFilterOptions, type MediaMetadata, type MediaOperationsContext, type MediaRole, type MediaType, type MemoriesNeedingTopicExtraction, type EmbeddingOptions as MemoryEngineEmbeddingOptions, type MemoryEngineResult, type MemoryEngineSearchOptions, type MemoryExtractedEvent, type MemoryKind, type MemoryQuarantinedEvent, type MemoryVaultSearchOptions, type MemoryVaultToolOptions, Message, type MessageChunk, type MessageFeedback, type ModelCallEndEvent, type ModelCallStartEvent, ModelPreference, NEVER_TTL_MS, NODE_BUDGET, type NeighborRefiner, type NowSource, type ObservationTrend, type ObservationTrendInput, type OperationExecutor, PAST_EVENT_GRACE_MS, PROFILE_DOC_VERSION, type ParsedServerToolsResponse, PdfProcessor, type PersonalitySettings, type PersonalitySliders, type PersonalityStyle, type PgClientLike, type PgPoolLike, type PlatformStorage, type PortalLlmAuth, PostgreSQLAdapter, type PostgreSQLAdapterOptions, type PreprocessingOptions, type PreprocessingResult, type ProcessedFileResult, ProcessorRegistry, type ProfileConfigFingerprint, type ProfileDoc, type ProfileFacet, type ProfileFacetKey, type ProfileSalienceInput, type ProfileSection, type ProfileUpdate, Project, type ProjectOperationsContext, type PromptContext, type PromptPreProcessor, type PromptPreProcessorContext, type PromptSection, type PromptTemplates, type QuarantinedMemoryInfo, type QueueEncryptionContext, QueueManager, type QueueStatus, type QueuedOperation, type QueuedOperationType, RECALL_MAX_LIMIT, RECALL_TOOL_NAME, type RankedMemory, type RankedProfileCandidate, type RecallContext, type RecallDegradation, type RecallDiagnostics, type RecallOptions, type RecallResult, type RecallToolCallbacks, type RecallToolOptions, type RecencyOptions, type ReflectOptions, type ReflectResult, RerankerUnavailableError, type ResumeStreamOptions, type ResumeStreamResult, type RetainAction, type RetainContext, type RetainOptions, type RetainResult, type RetainSource, type RunEndEvent, type RunErrorEvent, type RunHooks, type RunStartEvent, type RunTerminalState, type RunToolLoopOptions, type RunToolLoopResult, SDK_SCHEMA_VERSION, SERVER_TOOL_DEPENDENCY_SETS, SHORT_TTL_MS, SLIDER_CONFIG, STREAM_RESUMABLE_HEADER, type ScoreBreakdown, type ScoreProfileSalienceOptions, type ScreenResult, type ScreenedCandidate, type SearchSource, type SelectServerToolsForPromptOptions, type ServerTool, type ServerToolCallEvent, type ServerToolsFilterFunction, type ServerToolsOptions, type ServerToolsResponse, type SettingsStorageOperationsContext, type SignMessageFn, type StepFinishEvent, type StockPriceClassification, type StockPricePreProcessorOptions, type StorageOperationsContext, type StoredConversation, type StoredConversationSummary, type StoredFileWithContext, type StoredMedia, type StoredMessage, type StoredMessageWithSimilarity, type StoredModelPreference, type StoredProject, type StoredUserPreference, type StoredVaultMemory, StreamExpiredError, type StreamMetaEvent, type StreamResumeHandle, type StreamSmoothingConfig, type StreamingTransport, type StreamingTransportOptions, type StreamingTransportResult, type StyleAnalysisSchedule, type SynthesizeProfileOptions, TOOL_CATALOG, TOPICS_EXTRACTION_VERSION, TOPIC_EXTRACTION_BATCH_SIZE, TREND_RECENT_WINDOW_DAYS, TREND_STALE_WINDOW_DAYS, type TextChunk, TextProcessor, type ToolConfig, type ToolExecutor, type ToolMatchOptions, type ToolMatchResult, type ToolSet, type ToolUseEndEvent, type ToolUseStartEvent, type TopicExtractOptions, type TopicExtractionInput, type TopicExtractionRunResult, type TurnCompleteEvent, type TurnSkippedEvent, type UpdateMediaOptions, type UpdateModelPreferenceOptions, type UpdateProjectOptions, type UpdateUserPreferenceOptions, type UpdateVaultMemoryOptions, UserPreference, type UserPreferencesStorageOperationsContext, VAULT_SIZE_HOP_CAP, type VaultEmbeddingCache, VaultMemory, type VaultMemoryOperationsContext, type VaultMemoryVisibility, type VaultSaveOperation, type VaultSearchResult, WalletPoller, type WeatherClassification, type WeatherPreProcessorOptions, type WebSearchClassification, type WebSearchPreProcessorOptions, WordProcessor, ZipProcessor, type ZipProcessorOptions, activatedToolSetNames, analyzeStyle, archiveVaultMemoryOp, 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, createLlmDecayClassifier, createLlmNeighborRefiner, createMediaBatchOp, createMediaOp, createMemoryEngineTool, createMemoryVaultSearchTool, createMemoryVaultTool, createMessageOp, createPlatformCursorStore, createProjectOp, createRecallTool, createServerToolsFilter, createStockPricePreProcessor, createSummaryContext, createVaultEmbeddingCache, createVaultMemoriesBatchOp, createVaultMemoryOp, createWeatherPreProcessor, createWebSearchPreProcessor, decryptConversationTitle, decryptData, decryptDataBatch, decryptDataBytes, decryptDataBytesFromBytes, decryptDataWithKey, defaultServerToolsFilter, deleteAllVaultMemoriesForUserOp, deleteConversationOp, deleteConversationSummaryOp, deleteMediaByConversationOp, deleteMediaByMessageOp, deleteMediaOp, deleteModelPreferenceOp, deleteProjectOp, deleteUserPreferenceOp, deleteVaultMemoryOp, eagerEmbedContent, embedAllMessages, embedMessage, encryptData, encryptDataBatch, encryptDataBytes, encryptDataWithKey, estimateMessagesTokens, estimateTokens, exportPublicKey, extractAndLinkEntitiesForMemoriesOp, extractAndRetain, extractEntitiesForMemories, extractFacts, findMatchingTools, generateConversationId, generateEmbedding, generateEmbeddings, generateMediaId, generateProjectId, getAIGeneratedMediaOp, getAllFilesOp, getAllVaultMemoriesOp, getAllVaultMemoryContentsOp, getAudioOp, getCachedServerTools, getConversationOp, getConversationSummaryOp, getConversationsByProjectLazyOp, getConversationsByProjectOp, getConversationsLazyOp, getConversationsOp, getConversationsPageOp, getDecayCandidatesRawOp, getDocumentsOp, getEncryptionKey, getImagesOp, getMediaByConversationOp, getMediaByIdOp, getMediaByIdsOp, getMediaByMessageOp, getMediaByModelOp, getMediaByRoleOp, getMediaBySourceUrlOp, getMediaByTypeOp, getMediaCountOp, getMediaCountsByTypeOp, getMediaOp, getMediaTypeFromMime, getMemoriesNeedingTopicExtractionOp, getMessageOp, getMessagesOp, getModelPreferenceOp, getProjectConversationCountOp, getProjectConversationsOp, getProjectOp, getProjectsOp, getRecentMediaOp, getServerTools, getSupportedFileTypes, getToolsChecksum, getUnfiledVaultMemoriesOp, getUserPreferenceOp, getUserUploadedMediaOp, getVaultMemoryOp, getVideosOp, hardDeleteDecayedOp, hardDeleteMediaOp, hasEncryptionKey, hasKeyPair, injectionSignatureCatalog, isRerankerAvailable, isSupportedFile, isSupportedMediaType, makeSyntheticStoredConversation, makeSyntheticStoredMessage, maybeSummarizeHistory, mediaToStored, migrateFromModelPreferencesOp, onKeyAvailable, preEmbedVaultMemories, preprocessFiles, progressiveSummarize, projectToStored, queueManager, rankProfileCandidates, recall, reflect, relinkMemoryTopicsOp, relinkMisclassifiedVideosOp, renderTemplate, requestEncryptionKey, requestKeyPair, restoreVaultMemoryOp, resumeStream, retain, runToolLoop, sanitizeQuotes, schemaToCreateSQL, scoreProfileSalience, screenCandidatesForInjection, sdkMigrations, sdkModelClasses, sdkSchema, searchChunksOp, searchMediaOp, searchMessagesOp, searchVaultMemories, selectServerToolsForPrompt, serverPlatformStorage, setMemoryVisibilityOp, setModelPreferenceOp, setUserPreferenceOp, shouldAnalyzeStyle, shouldChunkMessage, shouldRefreshTools, splitMessagesAtThreshold, stampTopicsExtractedAtOp, streamCancelPath, streamReplayPath, summarizeObservationTrends, summaryToSystemMessage, supersedeVaultMemoryOp, synthesizeProfile, toolSetSystemPrompts, traverseGraphLane, ttlForType, updateConversationProjectOp, updateConversationTitleOp, updateMediaMessageIdBatchOp, updateMediaOp, updateMessageChunksOp, updateMessageEmbeddingOp, updateMessageErrorOp, updateMessageFeedbackOp, updateModelsOp, updatePersonalityOp, updateProfileOp, updateProjectNameOp, updateProjectOp, updateVaultMemoryEmbeddingOp, updateVaultMemoryOp, upsertConversationSummaryOp, upsertMessageOp };
9654
+ export { type AnalyzeStyleOptions, type AnalyzeStyleResult, type ApiResponse, type ApiType, type AutoExecutedToolResult, type AutoExtractMessage, type AutoExtractor, type Budget, type BuildPromptOptions, type BuildPromptResult, type CachedChunkVectors, type CachedServerTools, type ChatCompletionUsage, type ChatRole, type ChunkSearchResult, type ChunkVectorCache, type ChunkingOptions, type ConnectorGuidance, type ConnectorGuidanceInput, type ConsolidationFallbackReason, Conversation, ConversationSummary, type CreateAutoExtractorOptions, type CreateConversationOptions, type CreateDecaySweeperOptions, type CreateMediaOptions, type CreateMessageOptions, type CreateModelPreferenceOptions, type CreateProjectOptions, type CreateUserPreferenceOptions, type CreateVaultMemoryOptions, type CryptoPriceClassification, type CryptoPricePreProcessorOptions, DEFAULT_ANALYSIS_PROMPT, DEFAULT_ANALYZE_AFTER_MESSAGES, DEFAULT_CACHE_EXPIRATION_MS, DEFAULT_CHUNK_CACHE_SIZE, DEFAULT_CHUNK_OVERLAP, DEFAULT_CHUNK_SIZE, DEFAULT_DECAY_POLICY, DEFAULT_DOCUMENT_PATTERN, DEFAULT_EXCLUDED_SERVER_TOOLS, DEFAULT_MAX_CLASSIFIER_CALLS_PER_SWEEP, DEFAULT_MAX_INPUT_MESSAGES, DEFAULT_MAX_PROFILE_LENGTH, DEFAULT_MIN_CHUNK_SIZE, DEFAULT_MIN_MESSAGES, DEFAULT_PERSONALITY_SETTINGS, DEFAULT_PROFILE_FACETS, DEFAULT_PROFILE_FACT_TYPE_WEIGHTS, DEFAULT_PROFILE_PROOF_ALPHA, DEFAULT_PROFILE_TREND_MULTIPLIERS, DEFAULT_PROMPT_TEMPLATES, DEFAULT_REFRESH_EVERY_MESSAGES, DEFAULT_SERVER_TOOLS_MATCH_OPTIONS, DEFAULT_SUMMARY_MIN_WINDOW_MESSAGES, DEFAULT_SUMMARY_MODEL, DEFAULT_SUMMARY_TOKEN_THRESHOLD, DEFAULT_VAULT_CACHE_SIZE, DatabaseManager, type DatabaseManagerLogger, type DatabaseManagerOptions, type DecayCandidateRaw, type DecayClassifier, type DecayInput, type DecayPolicy, type DecaySweepResult, type DecaySweeper, type DecayVerdict, ENTITY_FANOUT, type EmbeddedWalletSignerFn, EncryptionKeyMissingError, ExcelProcessor, type ExtractFactsOptions, type ExtractOutcome, type ExtractedCandidate, type ExtractedEntity, type ExtractionCursorStore, type FactType, type FileMetadata, type FileProcessor, type FileTypeQuery, type FileWithData, type FlushResult, type GetConversationsPageOptions, type GraphTraversalOptions, HARD_DELETE_WINDOW_MS, INFERENCE_ID_HEADER, type InjectionClassifierOptions, type InjectionReason, type LazyStoredConversation, type LlmDecayClassifierOptions, type LlmNeighborRefinerOptions, type LlmTokenUsage, MAX_HOPS, MAX_MESSAGES_PER_SUMMARIZATION, MEDIUM_TTL_MS, Media, type MediaDimensions, type MediaFilterOptions, type MediaMetadata, type MediaOperationsContext, type MediaRole, type MediaType, type MemoriesNeedingTopicExtraction, type EmbeddingOptions as MemoryEngineEmbeddingOptions, type MemoryEngineResult, type MemoryEngineSearchOptions, type MemoryExtractedEvent, type MemoryKind, type MemoryQuarantinedEvent, type MemoryVaultSearchOptions, type MemoryVaultToolOptions, Message, type MessageChunk, type MessageFeedback, type ModelCallEndEvent, type ModelCallStartEvent, ModelPreference, NEVER_TTL_MS, NODE_BUDGET, type NeighborRefiner, type NowSource, type ObservationTrend, type ObservationTrendInput, type OperationExecutor, PAST_EVENT_GRACE_MS, PROFILE_DOC_VERSION, type ParsedServerToolsResponse, PdfProcessor, type PersonalitySettings, type PersonalitySliders, type PersonalityStyle, type PgClientLike, type PgPoolLike, type PlatformStorage, type PortalLlmAuth, PostgreSQLAdapter, type PostgreSQLAdapterOptions, type PreprocessingOptions, type PreprocessingResult, type ProcessedFileResult, ProcessorRegistry, type ProfileConfigFingerprint, type ProfileDoc, type ProfileFacet, type ProfileFacetKey, type ProfileSalienceInput, type ProfileSection, type ProfileUpdate, Project, type ProjectOperationsContext, type PromptContext, type PromptPreProcessor, type PromptPreProcessorContext, type PromptSection, type PromptTemplates, type QuarantinedMemoryInfo, type QueueEncryptionContext, QueueManager, type QueueStatus, type QueuedOperation, type QueuedOperationType, RECALL_MAX_LIMIT, RECALL_TOOL_NAME, type RankedMemory, type RankedProfileCandidate, type RecallContext, type RecallDegradation, type RecallDiagnostics, type RecallOptions, type RecallResult, type RecallToolCallbacks, type RecallToolOptions, type RecencyOptions, type ReflectOptions, type ReflectResult, 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 TurnCompleteEvent, type TurnSkippedEvent, type UpdateMediaOptions, type UpdateModelPreferenceOptions, type UpdateProjectOptions, type UpdateUserPreferenceOptions, type UpdateVaultMemoryOptions, UserPreference, type UserPreferencesStorageOperationsContext, VAULT_SIZE_HOP_CAP, type VaultEmbeddingCache, VaultMemory, type VaultMemoryOperationsContext, type VaultMemoryVisibility, type VaultSaveOperation, type VaultSearchResult, WalletPoller, type WeatherClassification, type WeatherPreProcessorOptions, type WebSearchClassification, type WebSearchPreProcessorOptions, WordProcessor, ZipProcessor, type ZipProcessorOptions, activatedToolSetNames, analyzeStyle, archiveVaultMemoryOp, 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, createLlmDecayClassifier, createLlmNeighborRefiner, createMediaBatchOp, createMediaOp, createMemoryEngineTool, createMemoryVaultSearchTool, createMemoryVaultTool, createMessageOp, createPlatformCursorStore, createProjectOp, createRecallTool, createServerToolsFilter, createStockPricePreProcessor, createSummaryContext, createVaultEmbeddingCache, createVaultMemoriesBatchOp, createVaultMemoryOp, createWeatherPreProcessor, createWebSearchPreProcessor, decryptConversationTitle, decryptData, decryptDataBatch, decryptDataBytes, decryptDataBytesFromBytes, decryptDataWithKey, defaultServerToolsFilter, deleteAllVaultMemoriesForUserOp, deleteConversationOp, deleteConversationSummaryOp, deleteMediaByConversationOp, deleteMediaByMessageOp, deleteMediaOp, deleteModelPreferenceOp, deleteProjectOp, deleteUserPreferenceOp, deleteVaultMemoryOp, eagerEmbedContent, embedAllMessages, embedMessage, encryptData, encryptDataBatch, encryptDataBytes, encryptDataWithKey, estimateMessagesTokens, estimateTokens, exportPublicKey, extractAndLinkEntitiesForMemoriesOp, extractAndRetain, extractEntitiesForMemories, extractFacts, findMatchingTools, generateConversationId, generateEmbedding, generateEmbeddings, generateMediaId, generateProjectId, getAIGeneratedMediaOp, getAllFilesOp, getAllVaultMemoriesOp, getAllVaultMemoryContentsOp, getAudioOp, getCachedServerTools, getConversationOp, getConversationSummaryOp, getConversationsByProjectLazyOp, getConversationsByProjectOp, getConversationsLazyOp, getConversationsOp, getConversationsPageOp, getDecayCandidatesRawOp, getDocumentsOp, getEncryptionKey, getImagesOp, getMediaByConversationOp, getMediaByIdOp, getMediaByIdsOp, getMediaByMessageOp, getMediaByModelOp, getMediaByRoleOp, getMediaBySourceUrlOp, getMediaByTypeOp, getMediaCountOp, getMediaCountsByTypeOp, getMediaOp, getMediaTypeFromMime, getMemoriesNeedingTopicExtractionOp, getMessageOp, getMessagesOp, getModelPreferenceOp, getProjectConversationCountOp, getProjectConversationsOp, getProjectOp, getProjectsOp, getRecentMediaOp, getServerTools, getSupportedFileTypes, getToolsChecksum, getUnfiledVaultMemoriesOp, getUserPreferenceOp, getUserUploadedMediaOp, getVaultMemoryOp, getVideosOp, hardDeleteDecayedOp, hardDeleteMediaOp, hasEncryptionKey, hasKeyPair, injectionSignatureCatalog, isRerankerAvailable, isSupportedFile, isSupportedMediaType, makeSyntheticStoredConversation, makeSyntheticStoredMessage, maybeSummarizeHistory, mediaToStored, migrateFromModelPreferencesOp, onKeyAvailable, preEmbedVaultMemories, preprocessFiles, progressiveSummarize, projectToStored, queueManager, rankProfileCandidates, recall, reflect, 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, shouldRefreshTools, splitMessagesAtThreshold, stampTopicsExtractedAtOp, streamCancelPath, streamReplayPath, summarizeObservationTrends, summaryToSystemMessage, supersedeVaultMemoryOp, synthesizeProfile, toolSetSystemPrompts, traverseGraphLane, ttlForType, updateConversationProjectOp, updateConversationTitleOp, updateMediaMessageIdBatchOp, updateMediaOp, updateMessageChunksOp, updateMessageEmbeddingOp, updateMessageErrorOp, updateMessageFeedbackOp, updateModelsOp, updatePersonalityOp, updateProfileOp, updateProjectNameOp, updateProjectOp, updateVaultMemoryEmbeddingOp, updateVaultMemoryOp, upsertConversationSummaryOp, upsertMessageOp };
@@ -3471,6 +3471,15 @@ interface StoredMessage {
3471
3471
  feedback?: MessageFeedback;
3472
3472
  /** Tool call events from the backend response (for reconstructing tool call history) */
3473
3473
  toolCallEvents?: LlmapiToolCallEvent[];
3474
+ /**
3475
+ * Set when `content` could not be decrypted on read (#561).
3476
+ * The `content` field still holds the original ciphertext — never a
3477
+ * `[Decryption Failed]` placeholder — so a later unlock can recover.
3478
+ * - `key_missing`: no key for this field's `enc:vN:` version in the store
3479
+ * - `auth_mismatch`: a key was present but AES-GCM auth failed (wrong key)
3480
+ * - `invalid_payload`: malformed ciphertext envelope
3481
+ */
3482
+ decryptionStatus?: "key_missing" | "auth_mismatch" | "invalid_payload";
3474
3483
  }
3475
3484
  interface ActivityPhase {
3476
3485
  id: string;
@@ -3682,6 +3691,29 @@ declare class ConversationSummary extends Model$1 {
3682
3691
  * - "v3": HKDF derived key with domain separation (for new encryption)
3683
3692
  */
3684
3693
  type EncryptionKeyVersion = "v2" | "v3";
3694
+ /**
3695
+ * Thrown by {@link getEncryptionKey} when the requested version is absent.
3696
+ * Distinct from AES-GCM auth-tag failures so decrypt callers can tell
3697
+ * "need to derive/hydrate this version" from "wrong key for intact ciphertext".
3698
+ */
3699
+ declare class EncryptionKeyMissingError extends Error {
3700
+ readonly address: string;
3701
+ readonly version: EncryptionKeyVersion;
3702
+ constructor(address: string, version: EncryptionKeyVersion);
3703
+ }
3704
+ /**
3705
+ * Options for {@link requestEncryptionKey}.
3706
+ */
3707
+ interface RequestEncryptionKeyOptions {
3708
+ /**
3709
+ * When true, re-derive and replace any existing in-memory keys for this
3710
+ * address. Default false preserves the historical "if present, return"
3711
+ * short-circuit. Prefer {@link refreshEncryptionKeyIfMatches} when the
3712
+ * caller has ciphertext that must keep working — force-replace can pin a
3713
+ * newly derived wrong key over a still-valid one.
3714
+ */
3715
+ force?: boolean;
3716
+ }
3685
3717
  /**
3686
3718
  * Register a callback that fires when an encryption key becomes available for an address.
3687
3719
  * If the key is already available, the callback fires immediately.
@@ -3829,9 +3861,30 @@ declare function decryptDataBytes(encryptedHex: string, address: string, version
3829
3861
  */
3830
3862
  declare function decryptDataBytesFromBytes(encrypted: Uint8Array, address: string, version?: EncryptionKeyVersion): Promise<Uint8Array>;
3831
3863
  /**
3832
- * Checks if an encryption key exists in memory for the given wallet address
3864
+ * Checks if an encryption key exists in memory for the given wallet address.
3865
+ *
3866
+ * @param address - Wallet address
3867
+ * @param version - When omitted, checks the **v3** (`current`) key — the key
3868
+ * write/OPFS/encrypt paths need. Callers that only need to read legacy
3869
+ * `enc:v2:` data should pass `"v2"` explicitly. (#561 / PR #828)
3870
+ */
3871
+ declare function hasEncryptionKey(address: string, version?: EncryptionKeyVersion): boolean;
3872
+ /**
3873
+ * Seed (or merge) raw key hex into the in-memory store without signing.
3874
+ *
3875
+ * Used by platform polyfills that hydrate from SecureStore / keychain where
3876
+ * one version may be missing — callers must not require both versions to
3877
+ * exist before the other becomes usable (#561).
3878
+ *
3879
+ * Existing versions are preserved when the corresponding argument is omitted.
3880
+ * Pass an explicit empty merge is not supported; omit the field to leave it.
3881
+ *
3882
+ * Each provided key must be 64 hex characters (32-byte AES key).
3833
3883
  */
3834
- declare function hasEncryptionKey(address: string): boolean;
3884
+ declare function seedEncryptionKeys(address: string, keys: {
3885
+ legacy?: string;
3886
+ current?: string;
3887
+ }): void;
3835
3888
  /**
3836
3889
  * Encrypts data using a pre-fetched CryptoKey.
3837
3890
  * Use this for batch operations to avoid repeated key lookups.
@@ -3912,17 +3965,43 @@ type SignMessageFn = (message: string, options?: SignMessageOptions) => Promise<
3912
3965
  type EmbeddedWalletSignerFn = (message: string, options?: SignMessageOptions) => Promise<string>;
3913
3966
  /**
3914
3967
  * Requests the user to sign a message to generate an encryption key.
3915
- * If a key already exists in memory for the given wallet, resolves immediately.
3968
+ * If a key already exists in memory for the given wallet, resolves immediately
3969
+ * unless {@link RequestEncryptionKeyOptions.force} is set.
3916
3970
  *
3917
3971
  * Note: Keys are stored in memory only and do not persist across page reloads.
3918
3972
  * This is a security feature - users must sign once per session to derive their key.
3919
3973
  *
3974
+ * When a seeded/pinned store already has keys and the fresh derive does not
3975
+ * match any of them, the store is left unchanged and this resolves to `false`
3976
+ * (without firing {@link onKeyAvailable}). Callers that need write readiness
3977
+ * should check the return value or {@link hasEncryptionKey} before encrypting
3978
+ * so they can surface a re-unlock UI instead of failing downstream (#828).
3979
+ *
3920
3980
  * @param walletAddress - The wallet address to generate the key for
3921
3981
  * @param signMessage - Function to sign a message (returns signature hex string)
3922
3982
  * @param embeddedWalletSigner - Optional function for silent signing with embedded wallets
3923
- * @returns Promise that resolves when the key is available
3983
+ * @param options - Optional flags (e.g. force re-derive)
3984
+ * @returns `true` when keys are available after the call; `false` when a
3985
+ * divergent derive left the store unchanged (or the session was torn down
3986
+ * mid-flight).
3924
3987
  */
3925
- declare function requestEncryptionKey(walletAddress: string, signMessage: SignMessageFn, embeddedWalletSigner?: EmbeddedWalletSignerFn): Promise<void>;
3988
+ declare function requestEncryptionKey(walletAddress: string, signMessage: SignMessageFn, embeddedWalletSigner?: EmbeddedWalletSignerFn, options?: RequestEncryptionKeyOptions): Promise<boolean>;
3989
+ /**
3990
+ * Re-derive encryption keys from a fresh signature and commit them **only if**
3991
+ * they successfully decrypt `probeCiphertext` (a prefixed `enc:v2:` / `enc:v3:`
3992
+ * value). If they do not, the existing in-memory keys are left untouched.
3993
+ *
3994
+ * Concurrent calls for the same wallet share one sign+derive. Each caller then
3995
+ * probes **its own** ciphertext against those candidates, so mixed-era messages
3996
+ * in one `Promise.all` batch can still recover when only the leader's probe
3997
+ * misses (#828 review). Failed candidates are memoized for the session so
3998
+ * pagination does not re-prompt on every page when the wallet has changed.
3999
+ *
4000
+ * @returns true when keys were refreshed (probe decrypted); false when the
4001
+ * probe failed under the candidate keys (store unchanged) or the probe was
4002
+ * not encrypted.
4003
+ */
4004
+ declare function refreshEncryptionKeyIfMatches(walletAddress: string, probeCiphertext: string, signMessage: SignMessageFn, embeddedWalletSigner?: EmbeddedWalletSignerFn): Promise<boolean>;
3926
4005
  /**
3927
4006
  * Requests the user to sign a message to generate an ECDH key pair.
3928
4007
  * If a key pair already exists in memory for the given wallet, resolves immediately.
@@ -4866,15 +4945,26 @@ interface MemoryVaultSearchOptions {
4866
4945
  /** RRF smoothing constant for lane fusion. Default 60. */
4867
4946
  rrfK?: number;
4868
4947
  /**
4869
- * LLM-based query decomposition for composite/abstract queries. When set,
4870
- * each query is classified + (if composite) decomposed into 3–5 facet
4871
- * sub-queries via gpt-5-mini, then ranked via {@link rankComposite}.
4872
- * Requires `decomposeOptions` (auth) when set to "llm".
4948
+ * Pre-decomposed facet queries for the composite ranker (719/B4). When
4949
+ * ≥2 are supplied (and embeddings are available), runs {@link rankComposite}
4950
+ * over them — no LLM call inside the search path. Callers that want LLM
4951
+ * rewrite (e.g. `createRecallTool`) call `decomposeQuery` first and pass
4952
+ * the facets here.
4953
+ */
4954
+ subQueries?: string[];
4955
+ /**
4956
+ * @deprecated 719/B4 — ignored by {@link searchVaultMemories} /
4957
+ * {@link searchVaultMemoriesWithSize}. Pass {@link MemoryVaultSearchOptions.subQueries}
4958
+ * (or use `createRecallTool`). The legacy {@link createMemoryVaultSearchTool}
4959
+ * executor still honors `decompose: "llm"` + `decomposeOptions` for eval
4960
+ * parity, then forwards facets into the LLM-free search path.
4873
4961
  */
4874
4962
  decompose?: "off" | "llm";
4875
- /** Auth + endpoint for the decomposition LLM call. Required when
4876
- * decompose="llm". Auth is the dual pattern — one of `apiKey` /
4877
- * `getToken`; see {@link PortalLlmAuth}. */
4963
+ /**
4964
+ * @deprecated 719/B4 — see `decompose`. Ignored on the programmatic search
4965
+ * path; tool-layer rewrite still reads this from the search-tool options.
4966
+ * Prefer `RecallToolOptions.decomposeOptions` with `createRecallTool`.
4967
+ */
4878
4968
  decomposeOptions?: PortalLlmAuth & {
4879
4969
  baseUrl?: string;
4880
4970
  model?: string;
@@ -5039,9 +5129,11 @@ type MemoryKind = "fact" | "chunk";
5039
5129
  * Budget controls retrieval depth/cost. Higher budgets enable more
5040
5130
  * candidate sources and the cross-encoder reranker.
5041
5131
  *
5042
- * - `low`: cosine + BM25 fusion only. No reranker. Mobile default.
5043
- * - `mid`: + recency boost. Demo default.
5044
- * - `high`: + cross-encoder rerank stage. Demo `budget: high` path.
5132
+ * - `low`: cosine + BM25 + recency. No reranker. Mobile default.
5133
+ * - `mid`: + cross-encoder rerank.
5134
+ * - `high`: + multi-hop graph traversal. LLM-free — query decomposition
5135
+ * (when wanted) lives in the tool/agent layer ({@link createRecallTool}),
5136
+ * not inside `recall()` itself (719/B4).
5045
5137
  */
5046
5138
  type Budget = "low" | "mid" | "high";
5047
5139
  interface ScoreBreakdown {
@@ -5141,10 +5233,28 @@ interface RecallOptions {
5141
5233
  /** Drop results below this score. Default: 0.1 for facts, 0.5 for chunks (mirrors today's defaults). */
5142
5234
  minScore?: number;
5143
5235
  /**
5144
- * Auth + endpoint for the LLM-based query decomposition pass. Without
5145
- * these, decompose is skipped even at `budget: 'high'`. Mirrors the
5146
- * shape used by `searchVaultMemories`. Auth is the dual pattern — one
5147
- * of `apiKey` / `getToken` is required; see {@link PortalLlmAuth}.
5236
+ * Pre-decomposed facet queries for the composite ranker. When ≥2 are
5237
+ * supplied, the vault lane runs `rankComposite` over them (no LLM call
5238
+ * inside `recall()` — 719/B4). Callers that still want LLM rewrite
5239
+ * (e.g. {@link createRecallTool} at `budget: 'high'`) call
5240
+ * `decomposeQuery` themselves and pass the result here. A single entry
5241
+ * (or omitting this) keeps the single-query path.
5242
+ */
5243
+ subQueries?: string[];
5244
+ /**
5245
+ * Auth + endpoint for optional LLM helpers that reuse portal auth —
5246
+ * currently {@link RecallOptions.graphRefine} neighbor selection.
5247
+ * Query decomposition is **not** driven by this field inside `recall()`
5248
+ * (719/B4); {@link createRecallTool} reads the same shape from
5249
+ * `RecallToolOptions.decomposeOptions` for tool-layer rewrite.
5250
+ *
5251
+ * Callers that still pass `{ budget: 'high', decomposeOptions }` without
5252
+ * {@link RecallOptions.subQueries} keep compiling but no longer rewrite —
5253
+ * `recall()` emits `decompose-moved` on {@link RecallDiagnostics.degraded}
5254
+ * so upgrades without a changelog read still leave a telemetry breadcrumb.
5255
+ *
5256
+ * Auth is the dual pattern — one of `apiKey` / `getToken` is required;
5257
+ * see {@link PortalLlmAuth}.
5148
5258
  */
5149
5259
  decomposeOptions?: PortalLlmAuth & {
5150
5260
  baseUrl?: string;
@@ -5248,9 +5358,22 @@ type RecallDegradation =
5248
5358
  /** Rerank was requested (budget mid/high) but the cross-encoder didn't run
5249
5359
  * this call — unavailable (e.g. React Native) or a transient failure. */
5250
5360
  "rerank-unavailable"
5251
- /** `budget: 'high'` requested but no `decomposeOptions`, so query
5252
- * decomposition was skipped and the budget downgraded to mid. */
5361
+ /**
5362
+ * @deprecated 719/B4 moved query decomposition out of `recall()`. Budget
5363
+ * `high` no longer requires `decomposeOptions` and this signal is never
5364
+ * emitted. Prefer `"decompose-moved"` for the upgrade breadcrumb. Kept in
5365
+ * the union so existing telemetry consumers stay typed.
5366
+ */
5253
5367
  | "decompose-unavailable"
5368
+ /**
5369
+ * `budget: 'high'` with `decomposeOptions` set but no usable
5370
+ * {@link RecallOptions.subQueries}. Pre-B4 this call shape triggered LLM
5371
+ * rewrite inside `recall()`; post-B4 it stays on the single-query high
5372
+ * path (rerank + graph) and callers must pass facets (or use
5373
+ * {@link createRecallTool}). Surfaced so silent quality regressions show
5374
+ * up in diagnostics instead of looking healthier than before.
5375
+ */
5376
+ | "decompose-moved"
5254
5377
  /** There was no usable cosine lane, so results were ranked on BM25 (lexical)
5255
5378
  * alone: either the query embedding failed (or came back empty), or no
5256
5379
  * candidate had a vector to score against it because the row (re)embed failed.
@@ -8024,9 +8147,14 @@ declare function rankProfileCandidates(inputs: readonly ProfileSalienceInput[],
8024
8147
  * Unified Recall API — single retrieval surface above vault + engine.
8025
8148
  *
8026
8149
  * Budget maps to pipeline depth (mirrors Hindsight's tiered defaults):
8027
- * - `low` → V2 cosine + BM25 + recency (no rerank, no decompose)
8150
+ * - `low` → V2 cosine + BM25 + recency (no rerank)
8028
8151
  * - `mid` → V2 + cross-encoder rerank
8029
- * - `high` → V2 + rerank + LLM query decomposition for composite queries
8152
+ * - `high` → V2 + rerank + multi-hop graph traversal
8153
+ *
8154
+ * LLM-free by design (719/B4): query decomposition for composite asks
8155
+ * lives in the tool/agent layer (`createRecallTool`), which may pass
8156
+ * pre-built `subQueries` into this API. `recall()` itself never pays an
8157
+ * LLM RTT.
8030
8158
  *
8031
8159
  * Fact + chunk lanes are fused with RRF (k=60). The previous naive
8032
8160
  * "sort the union by raw score" path is gone — score scales differ
@@ -8081,7 +8209,8 @@ interface RecallToolOptions {
8081
8209
  folderId?: string | null;
8082
8210
  /** Exclude one conversation from chunk results (typically the active one). */
8083
8211
  excludeConversationId?: string;
8084
- /** LLM-decompose options; only used at budget="high". Auth follows the
8212
+ /** LLM-decompose options; only used at budget="high". Runs in THIS tool
8213
+ * executor (719/B4) — `recall()` itself is LLM-free. Auth follows the
8085
8214
  * dual pattern: apiKey (server/CLI) or getToken (browser identity
8086
8215
  * tokens) — at least one required. */
8087
8216
  decomposeOptions?: PortalLlmAuth & {
@@ -9522,4 +9651,4 @@ declare function sanitizeQuotes(s: string): string;
9522
9651
  declare function renderTemplate(value: string | null | undefined, template: string): string | null;
9523
9652
  declare function buildSystemPrompt(ctx: PromptContext, options?: BuildPromptOptions): BuildPromptResult;
9524
9653
 
9525
- export { type AnalyzeStyleOptions, type AnalyzeStyleResult, type ApiResponse, type ApiType, type AutoExecutedToolResult, type AutoExtractMessage, type AutoExtractor, type Budget, type BuildPromptOptions, type BuildPromptResult, type CachedChunkVectors, type CachedServerTools, type ChatCompletionUsage, type ChatRole, type ChunkSearchResult, type ChunkVectorCache, type ChunkingOptions, type ConnectorGuidance, type ConnectorGuidanceInput, type ConsolidationFallbackReason, Conversation, ConversationSummary, type CreateAutoExtractorOptions, type CreateConversationOptions, type CreateDecaySweeperOptions, type CreateMediaOptions, type CreateMessageOptions, type CreateModelPreferenceOptions, type CreateProjectOptions, type CreateUserPreferenceOptions, type CreateVaultMemoryOptions, type CryptoPriceClassification, type CryptoPricePreProcessorOptions, DEFAULT_ANALYSIS_PROMPT, DEFAULT_ANALYZE_AFTER_MESSAGES, DEFAULT_CACHE_EXPIRATION_MS, DEFAULT_CHUNK_CACHE_SIZE, DEFAULT_CHUNK_OVERLAP, DEFAULT_CHUNK_SIZE, DEFAULT_DECAY_POLICY, DEFAULT_DOCUMENT_PATTERN, DEFAULT_EXCLUDED_SERVER_TOOLS, DEFAULT_MAX_CLASSIFIER_CALLS_PER_SWEEP, DEFAULT_MAX_INPUT_MESSAGES, DEFAULT_MAX_PROFILE_LENGTH, DEFAULT_MIN_CHUNK_SIZE, DEFAULT_MIN_MESSAGES, DEFAULT_PERSONALITY_SETTINGS, DEFAULT_PROFILE_FACETS, DEFAULT_PROFILE_FACT_TYPE_WEIGHTS, DEFAULT_PROFILE_PROOF_ALPHA, DEFAULT_PROFILE_TREND_MULTIPLIERS, DEFAULT_PROMPT_TEMPLATES, DEFAULT_REFRESH_EVERY_MESSAGES, DEFAULT_SERVER_TOOLS_MATCH_OPTIONS, DEFAULT_SUMMARY_MIN_WINDOW_MESSAGES, DEFAULT_SUMMARY_MODEL, DEFAULT_SUMMARY_TOKEN_THRESHOLD, DEFAULT_VAULT_CACHE_SIZE, DatabaseManager, type DatabaseManagerLogger, type DatabaseManagerOptions, type DecayCandidateRaw, type DecayClassifier, type DecayInput, type DecayPolicy, type DecaySweepResult, type DecaySweeper, type DecayVerdict, ENTITY_FANOUT, type EmbeddedWalletSignerFn, ExcelProcessor, type ExtractFactsOptions, type ExtractOutcome, type ExtractedCandidate, type ExtractedEntity, type ExtractionCursorStore, type FactType, type FileMetadata, type FileProcessor, type FileTypeQuery, type FileWithData, type FlushResult, type GetConversationsPageOptions, type GraphTraversalOptions, HARD_DELETE_WINDOW_MS, INFERENCE_ID_HEADER, type InjectionClassifierOptions, type InjectionReason, type LazyStoredConversation, type LlmDecayClassifierOptions, type LlmNeighborRefinerOptions, type LlmTokenUsage, MAX_HOPS, MAX_MESSAGES_PER_SUMMARIZATION, MEDIUM_TTL_MS, Media, type MediaDimensions, type MediaFilterOptions, type MediaMetadata, type MediaOperationsContext, type MediaRole, type MediaType, type MemoriesNeedingTopicExtraction, type EmbeddingOptions as MemoryEngineEmbeddingOptions, type MemoryEngineResult, type MemoryEngineSearchOptions, type MemoryExtractedEvent, type MemoryKind, type MemoryQuarantinedEvent, type MemoryVaultSearchOptions, type MemoryVaultToolOptions, Message, type MessageChunk, type MessageFeedback, type ModelCallEndEvent, type ModelCallStartEvent, ModelPreference, NEVER_TTL_MS, NODE_BUDGET, type NeighborRefiner, type NowSource, type ObservationTrend, type ObservationTrendInput, type OperationExecutor, PAST_EVENT_GRACE_MS, PROFILE_DOC_VERSION, type ParsedServerToolsResponse, PdfProcessor, type PersonalitySettings, type PersonalitySliders, type PersonalityStyle, type PgClientLike, type PgPoolLike, type PlatformStorage, type PortalLlmAuth, PostgreSQLAdapter, type PostgreSQLAdapterOptions, type PreprocessingOptions, type PreprocessingResult, type ProcessedFileResult, ProcessorRegistry, type ProfileConfigFingerprint, type ProfileDoc, type ProfileFacet, type ProfileFacetKey, type ProfileSalienceInput, type ProfileSection, type ProfileUpdate, Project, type ProjectOperationsContext, type PromptContext, type PromptPreProcessor, type PromptPreProcessorContext, type PromptSection, type PromptTemplates, type QuarantinedMemoryInfo, type QueueEncryptionContext, QueueManager, type QueueStatus, type QueuedOperation, type QueuedOperationType, RECALL_MAX_LIMIT, RECALL_TOOL_NAME, type RankedMemory, type RankedProfileCandidate, type RecallContext, type RecallDegradation, type RecallDiagnostics, type RecallOptions, type RecallResult, type RecallToolCallbacks, type RecallToolOptions, type RecencyOptions, type ReflectOptions, type ReflectResult, RerankerUnavailableError, type ResumeStreamOptions, type ResumeStreamResult, type RetainAction, type RetainContext, type RetainOptions, type RetainResult, type RetainSource, type RunEndEvent, type RunErrorEvent, type RunHooks, type RunStartEvent, type RunTerminalState, type RunToolLoopOptions, type RunToolLoopResult, SDK_SCHEMA_VERSION, SERVER_TOOL_DEPENDENCY_SETS, SHORT_TTL_MS, SLIDER_CONFIG, STREAM_RESUMABLE_HEADER, type ScoreBreakdown, type ScoreProfileSalienceOptions, type ScreenResult, type ScreenedCandidate, type SearchSource, type SelectServerToolsForPromptOptions, type ServerTool, type ServerToolCallEvent, type ServerToolsFilterFunction, type ServerToolsOptions, type ServerToolsResponse, type SettingsStorageOperationsContext, type SignMessageFn, type StepFinishEvent, type StockPriceClassification, type StockPricePreProcessorOptions, type StorageOperationsContext, type StoredConversation, type StoredConversationSummary, type StoredFileWithContext, type StoredMedia, type StoredMessage, type StoredMessageWithSimilarity, type StoredModelPreference, type StoredProject, type StoredUserPreference, type StoredVaultMemory, StreamExpiredError, type StreamMetaEvent, type StreamResumeHandle, type StreamSmoothingConfig, type StreamingTransport, type StreamingTransportOptions, type StreamingTransportResult, type StyleAnalysisSchedule, type SynthesizeProfileOptions, TOOL_CATALOG, TOPICS_EXTRACTION_VERSION, TOPIC_EXTRACTION_BATCH_SIZE, TREND_RECENT_WINDOW_DAYS, TREND_STALE_WINDOW_DAYS, type TextChunk, TextProcessor, type ToolConfig, type ToolExecutor, type ToolMatchOptions, type ToolMatchResult, type ToolSet, type ToolUseEndEvent, type ToolUseStartEvent, type TopicExtractOptions, type TopicExtractionInput, type TopicExtractionRunResult, type TurnCompleteEvent, type TurnSkippedEvent, type UpdateMediaOptions, type UpdateModelPreferenceOptions, type UpdateProjectOptions, type UpdateUserPreferenceOptions, type UpdateVaultMemoryOptions, UserPreference, type UserPreferencesStorageOperationsContext, VAULT_SIZE_HOP_CAP, type VaultEmbeddingCache, VaultMemory, type VaultMemoryOperationsContext, type VaultMemoryVisibility, type VaultSaveOperation, type VaultSearchResult, WalletPoller, type WeatherClassification, type WeatherPreProcessorOptions, type WebSearchClassification, type WebSearchPreProcessorOptions, WordProcessor, ZipProcessor, type ZipProcessorOptions, activatedToolSetNames, analyzeStyle, archiveVaultMemoryOp, 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, createLlmDecayClassifier, createLlmNeighborRefiner, createMediaBatchOp, createMediaOp, createMemoryEngineTool, createMemoryVaultSearchTool, createMemoryVaultTool, createMessageOp, createPlatformCursorStore, createProjectOp, createRecallTool, createServerToolsFilter, createStockPricePreProcessor, createSummaryContext, createVaultEmbeddingCache, createVaultMemoriesBatchOp, createVaultMemoryOp, createWeatherPreProcessor, createWebSearchPreProcessor, decryptConversationTitle, decryptData, decryptDataBatch, decryptDataBytes, decryptDataBytesFromBytes, decryptDataWithKey, defaultServerToolsFilter, deleteAllVaultMemoriesForUserOp, deleteConversationOp, deleteConversationSummaryOp, deleteMediaByConversationOp, deleteMediaByMessageOp, deleteMediaOp, deleteModelPreferenceOp, deleteProjectOp, deleteUserPreferenceOp, deleteVaultMemoryOp, eagerEmbedContent, embedAllMessages, embedMessage, encryptData, encryptDataBatch, encryptDataBytes, encryptDataWithKey, estimateMessagesTokens, estimateTokens, exportPublicKey, extractAndLinkEntitiesForMemoriesOp, extractAndRetain, extractEntitiesForMemories, extractFacts, findMatchingTools, generateConversationId, generateEmbedding, generateEmbeddings, generateMediaId, generateProjectId, getAIGeneratedMediaOp, getAllFilesOp, getAllVaultMemoriesOp, getAllVaultMemoryContentsOp, getAudioOp, getCachedServerTools, getConversationOp, getConversationSummaryOp, getConversationsByProjectLazyOp, getConversationsByProjectOp, getConversationsLazyOp, getConversationsOp, getConversationsPageOp, getDecayCandidatesRawOp, getDocumentsOp, getEncryptionKey, getImagesOp, getMediaByConversationOp, getMediaByIdOp, getMediaByIdsOp, getMediaByMessageOp, getMediaByModelOp, getMediaByRoleOp, getMediaBySourceUrlOp, getMediaByTypeOp, getMediaCountOp, getMediaCountsByTypeOp, getMediaOp, getMediaTypeFromMime, getMemoriesNeedingTopicExtractionOp, getMessageOp, getMessagesOp, getModelPreferenceOp, getProjectConversationCountOp, getProjectConversationsOp, getProjectOp, getProjectsOp, getRecentMediaOp, getServerTools, getSupportedFileTypes, getToolsChecksum, getUnfiledVaultMemoriesOp, getUserPreferenceOp, getUserUploadedMediaOp, getVaultMemoryOp, getVideosOp, hardDeleteDecayedOp, hardDeleteMediaOp, hasEncryptionKey, hasKeyPair, injectionSignatureCatalog, isRerankerAvailable, isSupportedFile, isSupportedMediaType, makeSyntheticStoredConversation, makeSyntheticStoredMessage, maybeSummarizeHistory, mediaToStored, migrateFromModelPreferencesOp, onKeyAvailable, preEmbedVaultMemories, preprocessFiles, progressiveSummarize, projectToStored, queueManager, rankProfileCandidates, recall, reflect, relinkMemoryTopicsOp, relinkMisclassifiedVideosOp, renderTemplate, requestEncryptionKey, requestKeyPair, restoreVaultMemoryOp, resumeStream, retain, runToolLoop, sanitizeQuotes, schemaToCreateSQL, scoreProfileSalience, screenCandidatesForInjection, sdkMigrations, sdkModelClasses, sdkSchema, searchChunksOp, searchMediaOp, searchMessagesOp, searchVaultMemories, selectServerToolsForPrompt, serverPlatformStorage, setMemoryVisibilityOp, setModelPreferenceOp, setUserPreferenceOp, shouldAnalyzeStyle, shouldChunkMessage, shouldRefreshTools, splitMessagesAtThreshold, stampTopicsExtractedAtOp, streamCancelPath, streamReplayPath, summarizeObservationTrends, summaryToSystemMessage, supersedeVaultMemoryOp, synthesizeProfile, toolSetSystemPrompts, traverseGraphLane, ttlForType, updateConversationProjectOp, updateConversationTitleOp, updateMediaMessageIdBatchOp, updateMediaOp, updateMessageChunksOp, updateMessageEmbeddingOp, updateMessageErrorOp, updateMessageFeedbackOp, updateModelsOp, updatePersonalityOp, updateProfileOp, updateProjectNameOp, updateProjectOp, updateVaultMemoryEmbeddingOp, updateVaultMemoryOp, upsertConversationSummaryOp, upsertMessageOp };
9654
+ export { type AnalyzeStyleOptions, type AnalyzeStyleResult, type ApiResponse, type ApiType, type AutoExecutedToolResult, type AutoExtractMessage, type AutoExtractor, type Budget, type BuildPromptOptions, type BuildPromptResult, type CachedChunkVectors, type CachedServerTools, type ChatCompletionUsage, type ChatRole, type ChunkSearchResult, type ChunkVectorCache, type ChunkingOptions, type ConnectorGuidance, type ConnectorGuidanceInput, type ConsolidationFallbackReason, Conversation, ConversationSummary, type CreateAutoExtractorOptions, type CreateConversationOptions, type CreateDecaySweeperOptions, type CreateMediaOptions, type CreateMessageOptions, type CreateModelPreferenceOptions, type CreateProjectOptions, type CreateUserPreferenceOptions, type CreateVaultMemoryOptions, type CryptoPriceClassification, type CryptoPricePreProcessorOptions, DEFAULT_ANALYSIS_PROMPT, DEFAULT_ANALYZE_AFTER_MESSAGES, DEFAULT_CACHE_EXPIRATION_MS, DEFAULT_CHUNK_CACHE_SIZE, DEFAULT_CHUNK_OVERLAP, DEFAULT_CHUNK_SIZE, DEFAULT_DECAY_POLICY, DEFAULT_DOCUMENT_PATTERN, DEFAULT_EXCLUDED_SERVER_TOOLS, DEFAULT_MAX_CLASSIFIER_CALLS_PER_SWEEP, DEFAULT_MAX_INPUT_MESSAGES, DEFAULT_MAX_PROFILE_LENGTH, DEFAULT_MIN_CHUNK_SIZE, DEFAULT_MIN_MESSAGES, DEFAULT_PERSONALITY_SETTINGS, DEFAULT_PROFILE_FACETS, DEFAULT_PROFILE_FACT_TYPE_WEIGHTS, DEFAULT_PROFILE_PROOF_ALPHA, DEFAULT_PROFILE_TREND_MULTIPLIERS, DEFAULT_PROMPT_TEMPLATES, DEFAULT_REFRESH_EVERY_MESSAGES, DEFAULT_SERVER_TOOLS_MATCH_OPTIONS, DEFAULT_SUMMARY_MIN_WINDOW_MESSAGES, DEFAULT_SUMMARY_MODEL, DEFAULT_SUMMARY_TOKEN_THRESHOLD, DEFAULT_VAULT_CACHE_SIZE, DatabaseManager, type DatabaseManagerLogger, type DatabaseManagerOptions, type DecayCandidateRaw, type DecayClassifier, type DecayInput, type DecayPolicy, type DecaySweepResult, type DecaySweeper, type DecayVerdict, ENTITY_FANOUT, type EmbeddedWalletSignerFn, EncryptionKeyMissingError, ExcelProcessor, type ExtractFactsOptions, type ExtractOutcome, type ExtractedCandidate, type ExtractedEntity, type ExtractionCursorStore, type FactType, type FileMetadata, type FileProcessor, type FileTypeQuery, type FileWithData, type FlushResult, type GetConversationsPageOptions, type GraphTraversalOptions, HARD_DELETE_WINDOW_MS, INFERENCE_ID_HEADER, type InjectionClassifierOptions, type InjectionReason, type LazyStoredConversation, type LlmDecayClassifierOptions, type LlmNeighborRefinerOptions, type LlmTokenUsage, MAX_HOPS, MAX_MESSAGES_PER_SUMMARIZATION, MEDIUM_TTL_MS, Media, type MediaDimensions, type MediaFilterOptions, type MediaMetadata, type MediaOperationsContext, type MediaRole, type MediaType, type MemoriesNeedingTopicExtraction, type EmbeddingOptions as MemoryEngineEmbeddingOptions, type MemoryEngineResult, type MemoryEngineSearchOptions, type MemoryExtractedEvent, type MemoryKind, type MemoryQuarantinedEvent, type MemoryVaultSearchOptions, type MemoryVaultToolOptions, Message, type MessageChunk, type MessageFeedback, type ModelCallEndEvent, type ModelCallStartEvent, ModelPreference, NEVER_TTL_MS, NODE_BUDGET, type NeighborRefiner, type NowSource, type ObservationTrend, type ObservationTrendInput, type OperationExecutor, PAST_EVENT_GRACE_MS, PROFILE_DOC_VERSION, type ParsedServerToolsResponse, PdfProcessor, type PersonalitySettings, type PersonalitySliders, type PersonalityStyle, type PgClientLike, type PgPoolLike, type PlatformStorage, type PortalLlmAuth, PostgreSQLAdapter, type PostgreSQLAdapterOptions, type PreprocessingOptions, type PreprocessingResult, type ProcessedFileResult, ProcessorRegistry, type ProfileConfigFingerprint, type ProfileDoc, type ProfileFacet, type ProfileFacetKey, type ProfileSalienceInput, type ProfileSection, type ProfileUpdate, Project, type ProjectOperationsContext, type PromptContext, type PromptPreProcessor, type PromptPreProcessorContext, type PromptSection, type PromptTemplates, type QuarantinedMemoryInfo, type QueueEncryptionContext, QueueManager, type QueueStatus, type QueuedOperation, type QueuedOperationType, RECALL_MAX_LIMIT, RECALL_TOOL_NAME, type RankedMemory, type RankedProfileCandidate, type RecallContext, type RecallDegradation, type RecallDiagnostics, type RecallOptions, type RecallResult, type RecallToolCallbacks, type RecallToolOptions, type RecencyOptions, type ReflectOptions, type ReflectResult, 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 TurnCompleteEvent, type TurnSkippedEvent, type UpdateMediaOptions, type UpdateModelPreferenceOptions, type UpdateProjectOptions, type UpdateUserPreferenceOptions, type UpdateVaultMemoryOptions, UserPreference, type UserPreferencesStorageOperationsContext, VAULT_SIZE_HOP_CAP, type VaultEmbeddingCache, VaultMemory, type VaultMemoryOperationsContext, type VaultMemoryVisibility, type VaultSaveOperation, type VaultSearchResult, WalletPoller, type WeatherClassification, type WeatherPreProcessorOptions, type WebSearchClassification, type WebSearchPreProcessorOptions, WordProcessor, ZipProcessor, type ZipProcessorOptions, activatedToolSetNames, analyzeStyle, archiveVaultMemoryOp, 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, createLlmDecayClassifier, createLlmNeighborRefiner, createMediaBatchOp, createMediaOp, createMemoryEngineTool, createMemoryVaultSearchTool, createMemoryVaultTool, createMessageOp, createPlatformCursorStore, createProjectOp, createRecallTool, createServerToolsFilter, createStockPricePreProcessor, createSummaryContext, createVaultEmbeddingCache, createVaultMemoriesBatchOp, createVaultMemoryOp, createWeatherPreProcessor, createWebSearchPreProcessor, decryptConversationTitle, decryptData, decryptDataBatch, decryptDataBytes, decryptDataBytesFromBytes, decryptDataWithKey, defaultServerToolsFilter, deleteAllVaultMemoriesForUserOp, deleteConversationOp, deleteConversationSummaryOp, deleteMediaByConversationOp, deleteMediaByMessageOp, deleteMediaOp, deleteModelPreferenceOp, deleteProjectOp, deleteUserPreferenceOp, deleteVaultMemoryOp, eagerEmbedContent, embedAllMessages, embedMessage, encryptData, encryptDataBatch, encryptDataBytes, encryptDataWithKey, estimateMessagesTokens, estimateTokens, exportPublicKey, extractAndLinkEntitiesForMemoriesOp, extractAndRetain, extractEntitiesForMemories, extractFacts, findMatchingTools, generateConversationId, generateEmbedding, generateEmbeddings, generateMediaId, generateProjectId, getAIGeneratedMediaOp, getAllFilesOp, getAllVaultMemoriesOp, getAllVaultMemoryContentsOp, getAudioOp, getCachedServerTools, getConversationOp, getConversationSummaryOp, getConversationsByProjectLazyOp, getConversationsByProjectOp, getConversationsLazyOp, getConversationsOp, getConversationsPageOp, getDecayCandidatesRawOp, getDocumentsOp, getEncryptionKey, getImagesOp, getMediaByConversationOp, getMediaByIdOp, getMediaByIdsOp, getMediaByMessageOp, getMediaByModelOp, getMediaByRoleOp, getMediaBySourceUrlOp, getMediaByTypeOp, getMediaCountOp, getMediaCountsByTypeOp, getMediaOp, getMediaTypeFromMime, getMemoriesNeedingTopicExtractionOp, getMessageOp, getMessagesOp, getModelPreferenceOp, getProjectConversationCountOp, getProjectConversationsOp, getProjectOp, getProjectsOp, getRecentMediaOp, getServerTools, getSupportedFileTypes, getToolsChecksum, getUnfiledVaultMemoriesOp, getUserPreferenceOp, getUserUploadedMediaOp, getVaultMemoryOp, getVideosOp, hardDeleteDecayedOp, hardDeleteMediaOp, hasEncryptionKey, hasKeyPair, injectionSignatureCatalog, isRerankerAvailable, isSupportedFile, isSupportedMediaType, makeSyntheticStoredConversation, makeSyntheticStoredMessage, maybeSummarizeHistory, mediaToStored, migrateFromModelPreferencesOp, onKeyAvailable, preEmbedVaultMemories, preprocessFiles, progressiveSummarize, projectToStored, queueManager, rankProfileCandidates, recall, reflect, 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, shouldRefreshTools, splitMessagesAtThreshold, stampTopicsExtractedAtOp, streamCancelPath, streamReplayPath, summarizeObservationTrends, summaryToSystemMessage, supersedeVaultMemoryOp, synthesizeProfile, toolSetSystemPrompts, traverseGraphLane, ttlForType, updateConversationProjectOp, updateConversationTitleOp, updateMediaMessageIdBatchOp, updateMediaOp, updateMessageChunksOp, updateMessageEmbeddingOp, updateMessageErrorOp, updateMessageFeedbackOp, updateModelsOp, updatePersonalityOp, updateProfileOp, updateProjectNameOp, updateProjectOp, updateVaultMemoryEmbeddingOp, updateVaultMemoryOp, upsertConversationSummaryOp, upsertMessageOp };