@anuma/sdk 6.4.1 → 6.5.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.
@@ -3390,13 +3390,24 @@ type ChatRole = "user" | "assistant" | "system";
3390
3390
  */
3391
3391
  type MessageFeedback = "like" | "dislike" | null;
3392
3392
  /**
3393
- * Which producer synthesised a message, for rows the user did not type and the
3394
- * UI does not render. Set at write time by that producer; a union so further
3395
- * synthetic kinds can be added without another column.
3393
+ * Provenance for a row that needs handling the content cannot justify. Set at
3394
+ * write time by whoever produced or repaired the row; a union so further kinds
3395
+ * can be added without another column.
3396
+ *
3397
+ * Read it as an enum, never as a boolean. The values do NOT share a meaning:
3398
+ * `tool_result` marks a synthetic row that is both unindexed and hidden, while
3399
+ * `chunks_discarded` marks an ordinary typed message that is unindexed and still
3400
+ * rendered. Any predicate that collapses this to "has an origin" hides real
3401
+ * messages (see `isToolResultsRow`).
3396
3402
  *
3397
3403
  * - `tool_result`: the hidden `[Tool Execution Results]` row built from a
3398
3404
  * turn's auto-executed tool results. Skipped by the embedding sweep (see
3399
- * `memoryEngine/embeddings`).
3405
+ * `memoryEngine/embeddings`) AND hidden from the transcript.
3406
+ * - `chunks_discarded`: an ordinary, still-rendered message whose chunk vectors
3407
+ * were built over `enc:v3:` ciphertext (sdk#864) and have been discarded
3408
+ * rather than re-embedded at the user's own expense (client#5618). Skipped by
3409
+ * the embedding sweep so nothing re-embeds it, but NOT hidden — only
3410
+ * `tool_result` hides a row, and `isToolResultsRow` is what draws that line.
3400
3411
  * - undefined/null: a normal message, or any row written before v44.
3401
3412
  *
3402
3413
  * Stored in the plaintext `origin` column — never encrypted. The deferred
@@ -3404,7 +3415,7 @@ type MessageFeedback = "like" | "dislike" | null;
3404
3415
  * encrypted flag would be unreadable exactly where it matters and the skip
3405
3416
  * would fail open.
3406
3417
  */
3407
- type MessageOrigin = "tool_result";
3418
+ type MessageOrigin = "tool_result" | "chunks_discarded";
3408
3419
  /**
3409
3420
  * Metadata for files attached to messages.
3410
3421
  *
@@ -3626,7 +3637,18 @@ interface StoredMessageWithSimilarity extends StoredMessage {
3626
3637
  interface MessageChunk {
3627
3638
  /** The chunk text */
3628
3639
  text: string;
3629
- /** Embedding vector for this chunk */
3640
+ /**
3641
+ * Embedding vector for this chunk.
3642
+ *
3643
+ * Read it through `decodeChunkVector` rather than passing it straight to a
3644
+ * numeric call site. This stays `number[]` only while the writer still emits
3645
+ * JSON arrays; it widens to `number[] | string` in the release that flips the
3646
+ * writer to base64 float32 (sdk#862), and that widening is the whole reason
3647
+ * that release is a major. Readers already accept both, so code written
3648
+ * against the decoder today needs no change when it happens — code written
3649
+ * against the raw array degrades silently, because a string handed to
3650
+ * `Float32Array.from` yields one NaN per character rather than an error.
3651
+ */
3630
3652
  vector: number[];
3631
3653
  /** Character offset where this chunk starts in the original message */
3632
3654
  startOffset: number;
@@ -8707,6 +8729,42 @@ declare function generateEmbeddings(texts: string[], options: EmbeddingOptions):
8707
8729
  * `../memoryEngine/embeddings` and the `../memoryEngine` barrel keep working.
8708
8730
  */
8709
8731
 
8732
+ /**
8733
+ * An ordinary message whose chunk vectors were built over `enc:v3:` ciphertext
8734
+ * (sdk#864) and have been discarded instead of re-embedded.
8735
+ *
8736
+ * Re-embedding is the obvious repair and is the wrong one: the sweep calls the
8737
+ * embedder with the user's own identity token, so healing these rows would
8738
+ * silently spend a user's own credits — up to ~9k embedding calls on the
8739
+ * worst-hit account — on a background repair nobody asked for (client#5618).
8740
+ * Discarding costs semantic recall on rows whose vectors describe hex, i.e. on
8741
+ * search that is already broken for them.
8742
+ *
8743
+ * Deliberately NOT `tool_result`, because that value does two jobs: it
8744
+ * suppresses embedding AND hides the row (`isToolResultsRow` returns true on it
8745
+ * alone, with no content check, and the clients render nothing for such a row).
8746
+ * These are ~2k real user and assistant messages that must keep rendering, so
8747
+ * they need the first job without the second.
8748
+ *
8749
+ * Suppression is "never automatically", not "never": `filter.reembedDiscarded`
8750
+ * on either sweep re-opens these rows for an explicit, caller-initiated
8751
+ * re-index. Off by default, so no background pass can spend a user's credits
8752
+ * without being asked to.
8753
+ *
8754
+ * That flag opens the gate for one call and nothing more. It does not heal the
8755
+ * row: a message that re-indexes successfully still carries `chunks_discarded`
8756
+ * afterwards, so the next pass skips it again unless that pass sets the flag
8757
+ * too. An embedding-model migration is where this bites. It reaches this gate
8758
+ * before it can do anything, so the repaired rows stay on the old model, and
8759
+ * `searchChunksOp` already drops stale-model vectors — they go quiet with
8760
+ * nothing telling them apart from rows that were never repaired. Clearing the
8761
+ * marker on a successful re-index is the real fix, tracked in #879.
8762
+ *
8763
+ * `satisfies MessageOrigin` so the constant and the union cannot drift apart
8764
+ * silently — the column's type is the union, and a typo here would otherwise
8765
+ * only surface as a marker nothing matches.
8766
+ */
8767
+ declare const CHUNKS_DISCARDED_ORIGIN = "chunks_discarded";
8710
8768
  /**
8711
8769
  * Embed a single message and store the embedding in the database
8712
8770
  *
@@ -8731,6 +8789,17 @@ declare function embedAllMessages(ctx: StorageOperationsContext, options: Embedd
8731
8789
  roles?: ("user" | "assistant")[];
8732
8790
  /** Minimum content length to embed (default: 30). Shorter messages are skipped. */
8733
8791
  minContentLength?: number;
8792
+ /**
8793
+ * Re-index rows the ciphertext sweep marked {@link CHUNKS_DISCARDED_ORIGIN}.
8794
+ * Off by default: this spends the user's own embedding credits, so it belongs
8795
+ * to an explicit user action, never to a background pass. Opens that marker
8796
+ * only — `tool_result` rows stay excluded.
8797
+ *
8798
+ * Per call, not a state change: a row that re-indexes successfully keeps its
8799
+ * marker, so a later pass that omits this flag skips it again. See
8800
+ * {@link CHUNKS_DISCARDED_ORIGIN}.
8801
+ */
8802
+ reembedDiscarded?: boolean;
8734
8803
  }): Promise<number>;
8735
8804
  /**
8736
8805
  * Chunk and embed a single message, storing chunk embeddings in the database.
@@ -8776,6 +8845,21 @@ declare function chunkAndEmbedAllMessages(ctx: StorageOperationsContext, options
8776
8845
  rechunkExisting?: boolean;
8777
8846
  /** Minimum content length to embed (default: 30). Shorter messages are skipped. */
8778
8847
  minContentLength?: number;
8848
+ /**
8849
+ * Re-index rows the ciphertext sweep marked {@link CHUNKS_DISCARDED_ORIGIN}.
8850
+ * Off by default: this spends the user's own embedding credits, so it belongs
8851
+ * to an explicit user action, never to a background pass. Opens that marker
8852
+ * only — `tool_result` rows stay excluded.
8853
+ *
8854
+ * `rechunkExisting` cannot substitute for it: a discarded row has neither
8855
+ * chunks nor vector, so it never reaches that check and falls straight to the
8856
+ * origin gate.
8857
+ *
8858
+ * Per call, not a state change: a row that re-indexes successfully keeps its
8859
+ * marker, so a later pass that omits this flag skips it again. See
8860
+ * {@link CHUNKS_DISCARDED_ORIGIN}.
8861
+ */
8862
+ reembedDiscarded?: boolean;
8779
8863
  }): Promise<number>;
8780
8864
 
8781
8865
  /**
@@ -8890,6 +8974,71 @@ declare function createMemoryEngineTool(storageCtx: StorageOperationsContext, em
8890
8974
  onRetrieve?: (conversationIds: string[]) => void;
8891
8975
  }): ToolConfig;
8892
8976
 
8977
+ /**
8978
+ * Storage encoding for `MessageChunk.vector`.
8979
+ *
8980
+ * Chunk vectors are persisted inside the `chunks` column as JSON. Since #732
8981
+ * their values are canonically float32 — `generateEmbeddings` round-trips its
8982
+ * return value through a `Float32Array` so a cache hit and a cache miss agree —
8983
+ * which paradoxically made the JSON LONGER: `JSON.stringify` emits the shortest
8984
+ * decimal that round-trips to the float64, and a binary32-exact value needs ~17
8985
+ * significant digits. Measured at 4096 dims (`qwen/qwen3-embedding-8b`): 54.5 KB
8986
+ * of JSON before #732, 84.5 KB after.
8987
+ *
8988
+ * Base64-encoding the `Float32Array` stores the same bits as 4 bytes per value
8989
+ * instead of ~21 characters — 21.3 KB at 4096 dims. Because the data already IS
8990
+ * float32, the encoding is EXACTLY lossless, so the round-trip assertion is
8991
+ * equality and never a tolerance.
8992
+ *
8993
+ * Rollout (sdk#862). `decodeChunkVector` accepts both encodings and ships first;
8994
+ * `encodeChunkVector` is deliberately NOT wired into the write path yet. Every
8995
+ * stored chunk on every device is still a JSON array, and chat history syncs
8996
+ * those rows between devices verbatim — the backup push spreads the whole raw
8997
+ * row and the restore copies every column — so a device on an older build would
8998
+ * meet a base64 string where it expects `number[]`. It does not throw, and it
8999
+ * does not fall back: the row still HAS chunks, so the old build takes the chunk
9000
+ * branch and never reaches the whole-message one. `Float32Array.from` over the
9001
+ * string yields one NaN per character, `cosineSimilarity` returns 0 on the
9002
+ * dimension mismatch, and the default `minSimilarity` cuts it — the row leaves
9003
+ * search entirely. The old build then caches what it built: ~87 KB of NaN per
9004
+ * chunk, so ~54 MB resident for a 620-chunk row, on exactly the device this
9005
+ * sequencing exists to protect. The writer flips in a later release, once a
9006
+ * build that reads both encodings has saturated; the single flip site is
9007
+ * `updateMessageChunksOp`.
9008
+ *
9009
+ * Byte order is the platform's, since this reads the `Float32Array` bytes
9010
+ * directly. Every runtime the SDK targets (browsers, iOS, Android, Node on
9011
+ * x86/ARM) is little-endian.
9012
+ */
9013
+ /**
9014
+ * Encode an embedding as base64 float32 for storage.
9015
+ *
9016
+ * Not yet called by the write path — see the rollout note above. Values are
9017
+ * narrowed to float32 first, which is lossless for anything `generateEmbeddings`
9018
+ * produced and is what makes the decode byte-exact.
9019
+ */
9020
+ declare function encodeChunkVector(vector: ArrayLike<number>): string;
9021
+ /**
9022
+ * Read a stored chunk vector in either encoding: a base64 float32 string, or the
9023
+ * legacy `number[]` that every row written before the writer flip still holds.
9024
+ *
9025
+ * Returns a zero-length `Float32Array` for a missing, empty, or unreadable
9026
+ * value, which callers already treat as "this chunk has no vector" — the same
9027
+ * degradation a malformed `chunks` JSON gets today, rather than a throw that
9028
+ * would take down a whole search pass over one bad row.
9029
+ *
9030
+ * That one return value covers two different situations, and a caller cannot
9031
+ * tell them apart: a chunk that legitimately has no vector, and a chunk whose
9032
+ * vector is corrupt. `onMalformed` separates them. It fires only on the corrupt
9033
+ * paths, never on an absent or empty value, so a caller can count corruption
9034
+ * without counting normal empties.
9035
+ *
9036
+ * Nothing is logged here. A corrupt row holds hundreds of chunks and this runs
9037
+ * once per chunk, so the caller aggregates and reports once per pass — the shape
9038
+ * `searchChunksOp` already uses for stale-model vectors.
9039
+ */
9040
+ declare function decodeChunkVector(vector: number[] | string | null | undefined, onMalformed?: () => void): Float32Array<ArrayBuffer>;
9041
+
8893
9042
  /**
8894
9043
  * Memory Vault Tool
8895
9044
  *
@@ -9797,6 +9946,13 @@ declare function getVaultFolderMemoryCountOp(ctx: VaultFolderOperationsContext,
9797
9946
  */
9798
9947
  declare function ensureDefaultFoldersOp(ctx: VaultFolderOperationsContext): Promise<Map<string, string>>;
9799
9948
 
9949
+ /**
9950
+ * Value of the `origin` column on a row the SDK synthesised for a turn's tool results (v44, #866).
9951
+ *
9952
+ * `satisfies MessageOrigin` so this constant and the column's union cannot drift apart silently.
9953
+ */
9954
+ declare const TOOL_RESULT_ORIGIN = "tool_result";
9955
+
9800
9956
  /**
9801
9957
  * Pluggable logger for the Anuma SDK.
9802
9958
  *
@@ -10014,4 +10170,4 @@ declare function refreshNotionAccessToken(params: NotionRefreshTokenParams): Pro
10014
10170
  */
10015
10171
  declare function createNotionTools(getAccessToken: () => string | null, requestNotionAccess: () => Promise<string>): ToolConfig[];
10016
10172
 
10017
- 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 MemoryToVerify, type MemoryVaultSearchOptions, type MemoryVaultToolOptions, type MemoryVerification, 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 PhotoIngestResult, type PhotoMediaRef, 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 PublishedPhotoMemory, 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 UncheckedReason, type UnverifiableReason, 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, type VerificationSources, type VerifyMemoriesForPublishOptions, 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, createMessageSourceResolver, 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, ingestPublishedPhotoMemoriesOp, injectionSignatureCatalog, isPiiRedactor, isRerankerAvailable, moveMemoriesToFolderOp, noopLogger, onKeyAvailable, parseMedia, 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, verifyMemoriesForPublish, xhrTransport };
10173
+ export { type AutoExtractMessage, type AutoExtractor, type Budget, CHUNKS_DISCARDED_ORIGIN, 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 MemoryToVerify, type MemoryVaultSearchOptions, type MemoryVaultToolOptions, type MemoryVerification, 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 PhotoIngestResult, type PhotoMediaRef, 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 PublishedPhotoMemory, 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, TOOL_RESULT_ORIGIN, 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 UncheckedReason, type UnverifiableReason, 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, type VerificationSources, type VerifyMemoriesForPublishOptions, 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, createMessageSourceResolver, createNotionTools, createPlatformCursorStore, createRecallTool, createStockPricePreProcessor, createStreamingDeAnonymizer, createVaultEmbeddingCache, createVaultFolderOp, createVaultMemoriesBatchOp, createVaultMemoryOp, createWeatherPreProcessor, createWebSearchPreProcessor, decodeChunkVector, decryptConversationTitle, deleteAllVaultMemoriesForUserOp, deleteVaultFolderOp, deleteVaultMemoryOp, dequantizeEmbedding, discoverNotionOAuthEndpoints, eagerEmbedContent, embedAllMessages, embedMessage, encodeChunkVector, 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, ingestPublishedPhotoMemoriesOp, injectionSignatureCatalog, isPiiRedactor, isRerankerAvailable, moveMemoriesToFolderOp, noopLogger, onKeyAvailable, parseMedia, 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, verifyMemoriesForPublish, xhrTransport };
@@ -3390,13 +3390,24 @@ type ChatRole = "user" | "assistant" | "system";
3390
3390
  */
3391
3391
  type MessageFeedback = "like" | "dislike" | null;
3392
3392
  /**
3393
- * Which producer synthesised a message, for rows the user did not type and the
3394
- * UI does not render. Set at write time by that producer; a union so further
3395
- * synthetic kinds can be added without another column.
3393
+ * Provenance for a row that needs handling the content cannot justify. Set at
3394
+ * write time by whoever produced or repaired the row; a union so further kinds
3395
+ * can be added without another column.
3396
+ *
3397
+ * Read it as an enum, never as a boolean. The values do NOT share a meaning:
3398
+ * `tool_result` marks a synthetic row that is both unindexed and hidden, while
3399
+ * `chunks_discarded` marks an ordinary typed message that is unindexed and still
3400
+ * rendered. Any predicate that collapses this to "has an origin" hides real
3401
+ * messages (see `isToolResultsRow`).
3396
3402
  *
3397
3403
  * - `tool_result`: the hidden `[Tool Execution Results]` row built from a
3398
3404
  * turn's auto-executed tool results. Skipped by the embedding sweep (see
3399
- * `memoryEngine/embeddings`).
3405
+ * `memoryEngine/embeddings`) AND hidden from the transcript.
3406
+ * - `chunks_discarded`: an ordinary, still-rendered message whose chunk vectors
3407
+ * were built over `enc:v3:` ciphertext (sdk#864) and have been discarded
3408
+ * rather than re-embedded at the user's own expense (client#5618). Skipped by
3409
+ * the embedding sweep so nothing re-embeds it, but NOT hidden — only
3410
+ * `tool_result` hides a row, and `isToolResultsRow` is what draws that line.
3400
3411
  * - undefined/null: a normal message, or any row written before v44.
3401
3412
  *
3402
3413
  * Stored in the plaintext `origin` column — never encrypted. The deferred
@@ -3404,7 +3415,7 @@ type MessageFeedback = "like" | "dislike" | null;
3404
3415
  * encrypted flag would be unreadable exactly where it matters and the skip
3405
3416
  * would fail open.
3406
3417
  */
3407
- type MessageOrigin = "tool_result";
3418
+ type MessageOrigin = "tool_result" | "chunks_discarded";
3408
3419
  /**
3409
3420
  * Metadata for files attached to messages.
3410
3421
  *
@@ -3626,7 +3637,18 @@ interface StoredMessageWithSimilarity extends StoredMessage {
3626
3637
  interface MessageChunk {
3627
3638
  /** The chunk text */
3628
3639
  text: string;
3629
- /** Embedding vector for this chunk */
3640
+ /**
3641
+ * Embedding vector for this chunk.
3642
+ *
3643
+ * Read it through `decodeChunkVector` rather than passing it straight to a
3644
+ * numeric call site. This stays `number[]` only while the writer still emits
3645
+ * JSON arrays; it widens to `number[] | string` in the release that flips the
3646
+ * writer to base64 float32 (sdk#862), and that widening is the whole reason
3647
+ * that release is a major. Readers already accept both, so code written
3648
+ * against the decoder today needs no change when it happens — code written
3649
+ * against the raw array degrades silently, because a string handed to
3650
+ * `Float32Array.from` yields one NaN per character rather than an error.
3651
+ */
3630
3652
  vector: number[];
3631
3653
  /** Character offset where this chunk starts in the original message */
3632
3654
  startOffset: number;
@@ -8707,6 +8729,42 @@ declare function generateEmbeddings(texts: string[], options: EmbeddingOptions):
8707
8729
  * `../memoryEngine/embeddings` and the `../memoryEngine` barrel keep working.
8708
8730
  */
8709
8731
 
8732
+ /**
8733
+ * An ordinary message whose chunk vectors were built over `enc:v3:` ciphertext
8734
+ * (sdk#864) and have been discarded instead of re-embedded.
8735
+ *
8736
+ * Re-embedding is the obvious repair and is the wrong one: the sweep calls the
8737
+ * embedder with the user's own identity token, so healing these rows would
8738
+ * silently spend a user's own credits — up to ~9k embedding calls on the
8739
+ * worst-hit account — on a background repair nobody asked for (client#5618).
8740
+ * Discarding costs semantic recall on rows whose vectors describe hex, i.e. on
8741
+ * search that is already broken for them.
8742
+ *
8743
+ * Deliberately NOT `tool_result`, because that value does two jobs: it
8744
+ * suppresses embedding AND hides the row (`isToolResultsRow` returns true on it
8745
+ * alone, with no content check, and the clients render nothing for such a row).
8746
+ * These are ~2k real user and assistant messages that must keep rendering, so
8747
+ * they need the first job without the second.
8748
+ *
8749
+ * Suppression is "never automatically", not "never": `filter.reembedDiscarded`
8750
+ * on either sweep re-opens these rows for an explicit, caller-initiated
8751
+ * re-index. Off by default, so no background pass can spend a user's credits
8752
+ * without being asked to.
8753
+ *
8754
+ * That flag opens the gate for one call and nothing more. It does not heal the
8755
+ * row: a message that re-indexes successfully still carries `chunks_discarded`
8756
+ * afterwards, so the next pass skips it again unless that pass sets the flag
8757
+ * too. An embedding-model migration is where this bites. It reaches this gate
8758
+ * before it can do anything, so the repaired rows stay on the old model, and
8759
+ * `searchChunksOp` already drops stale-model vectors — they go quiet with
8760
+ * nothing telling them apart from rows that were never repaired. Clearing the
8761
+ * marker on a successful re-index is the real fix, tracked in #879.
8762
+ *
8763
+ * `satisfies MessageOrigin` so the constant and the union cannot drift apart
8764
+ * silently — the column's type is the union, and a typo here would otherwise
8765
+ * only surface as a marker nothing matches.
8766
+ */
8767
+ declare const CHUNKS_DISCARDED_ORIGIN = "chunks_discarded";
8710
8768
  /**
8711
8769
  * Embed a single message and store the embedding in the database
8712
8770
  *
@@ -8731,6 +8789,17 @@ declare function embedAllMessages(ctx: StorageOperationsContext, options: Embedd
8731
8789
  roles?: ("user" | "assistant")[];
8732
8790
  /** Minimum content length to embed (default: 30). Shorter messages are skipped. */
8733
8791
  minContentLength?: number;
8792
+ /**
8793
+ * Re-index rows the ciphertext sweep marked {@link CHUNKS_DISCARDED_ORIGIN}.
8794
+ * Off by default: this spends the user's own embedding credits, so it belongs
8795
+ * to an explicit user action, never to a background pass. Opens that marker
8796
+ * only — `tool_result` rows stay excluded.
8797
+ *
8798
+ * Per call, not a state change: a row that re-indexes successfully keeps its
8799
+ * marker, so a later pass that omits this flag skips it again. See
8800
+ * {@link CHUNKS_DISCARDED_ORIGIN}.
8801
+ */
8802
+ reembedDiscarded?: boolean;
8734
8803
  }): Promise<number>;
8735
8804
  /**
8736
8805
  * Chunk and embed a single message, storing chunk embeddings in the database.
@@ -8776,6 +8845,21 @@ declare function chunkAndEmbedAllMessages(ctx: StorageOperationsContext, options
8776
8845
  rechunkExisting?: boolean;
8777
8846
  /** Minimum content length to embed (default: 30). Shorter messages are skipped. */
8778
8847
  minContentLength?: number;
8848
+ /**
8849
+ * Re-index rows the ciphertext sweep marked {@link CHUNKS_DISCARDED_ORIGIN}.
8850
+ * Off by default: this spends the user's own embedding credits, so it belongs
8851
+ * to an explicit user action, never to a background pass. Opens that marker
8852
+ * only — `tool_result` rows stay excluded.
8853
+ *
8854
+ * `rechunkExisting` cannot substitute for it: a discarded row has neither
8855
+ * chunks nor vector, so it never reaches that check and falls straight to the
8856
+ * origin gate.
8857
+ *
8858
+ * Per call, not a state change: a row that re-indexes successfully keeps its
8859
+ * marker, so a later pass that omits this flag skips it again. See
8860
+ * {@link CHUNKS_DISCARDED_ORIGIN}.
8861
+ */
8862
+ reembedDiscarded?: boolean;
8779
8863
  }): Promise<number>;
8780
8864
 
8781
8865
  /**
@@ -8890,6 +8974,71 @@ declare function createMemoryEngineTool(storageCtx: StorageOperationsContext, em
8890
8974
  onRetrieve?: (conversationIds: string[]) => void;
8891
8975
  }): ToolConfig;
8892
8976
 
8977
+ /**
8978
+ * Storage encoding for `MessageChunk.vector`.
8979
+ *
8980
+ * Chunk vectors are persisted inside the `chunks` column as JSON. Since #732
8981
+ * their values are canonically float32 — `generateEmbeddings` round-trips its
8982
+ * return value through a `Float32Array` so a cache hit and a cache miss agree —
8983
+ * which paradoxically made the JSON LONGER: `JSON.stringify` emits the shortest
8984
+ * decimal that round-trips to the float64, and a binary32-exact value needs ~17
8985
+ * significant digits. Measured at 4096 dims (`qwen/qwen3-embedding-8b`): 54.5 KB
8986
+ * of JSON before #732, 84.5 KB after.
8987
+ *
8988
+ * Base64-encoding the `Float32Array` stores the same bits as 4 bytes per value
8989
+ * instead of ~21 characters — 21.3 KB at 4096 dims. Because the data already IS
8990
+ * float32, the encoding is EXACTLY lossless, so the round-trip assertion is
8991
+ * equality and never a tolerance.
8992
+ *
8993
+ * Rollout (sdk#862). `decodeChunkVector` accepts both encodings and ships first;
8994
+ * `encodeChunkVector` is deliberately NOT wired into the write path yet. Every
8995
+ * stored chunk on every device is still a JSON array, and chat history syncs
8996
+ * those rows between devices verbatim — the backup push spreads the whole raw
8997
+ * row and the restore copies every column — so a device on an older build would
8998
+ * meet a base64 string where it expects `number[]`. It does not throw, and it
8999
+ * does not fall back: the row still HAS chunks, so the old build takes the chunk
9000
+ * branch and never reaches the whole-message one. `Float32Array.from` over the
9001
+ * string yields one NaN per character, `cosineSimilarity` returns 0 on the
9002
+ * dimension mismatch, and the default `minSimilarity` cuts it — the row leaves
9003
+ * search entirely. The old build then caches what it built: ~87 KB of NaN per
9004
+ * chunk, so ~54 MB resident for a 620-chunk row, on exactly the device this
9005
+ * sequencing exists to protect. The writer flips in a later release, once a
9006
+ * build that reads both encodings has saturated; the single flip site is
9007
+ * `updateMessageChunksOp`.
9008
+ *
9009
+ * Byte order is the platform's, since this reads the `Float32Array` bytes
9010
+ * directly. Every runtime the SDK targets (browsers, iOS, Android, Node on
9011
+ * x86/ARM) is little-endian.
9012
+ */
9013
+ /**
9014
+ * Encode an embedding as base64 float32 for storage.
9015
+ *
9016
+ * Not yet called by the write path — see the rollout note above. Values are
9017
+ * narrowed to float32 first, which is lossless for anything `generateEmbeddings`
9018
+ * produced and is what makes the decode byte-exact.
9019
+ */
9020
+ declare function encodeChunkVector(vector: ArrayLike<number>): string;
9021
+ /**
9022
+ * Read a stored chunk vector in either encoding: a base64 float32 string, or the
9023
+ * legacy `number[]` that every row written before the writer flip still holds.
9024
+ *
9025
+ * Returns a zero-length `Float32Array` for a missing, empty, or unreadable
9026
+ * value, which callers already treat as "this chunk has no vector" — the same
9027
+ * degradation a malformed `chunks` JSON gets today, rather than a throw that
9028
+ * would take down a whole search pass over one bad row.
9029
+ *
9030
+ * That one return value covers two different situations, and a caller cannot
9031
+ * tell them apart: a chunk that legitimately has no vector, and a chunk whose
9032
+ * vector is corrupt. `onMalformed` separates them. It fires only on the corrupt
9033
+ * paths, never on an absent or empty value, so a caller can count corruption
9034
+ * without counting normal empties.
9035
+ *
9036
+ * Nothing is logged here. A corrupt row holds hundreds of chunks and this runs
9037
+ * once per chunk, so the caller aggregates and reports once per pass — the shape
9038
+ * `searchChunksOp` already uses for stale-model vectors.
9039
+ */
9040
+ declare function decodeChunkVector(vector: number[] | string | null | undefined, onMalformed?: () => void): Float32Array<ArrayBuffer>;
9041
+
8893
9042
  /**
8894
9043
  * Memory Vault Tool
8895
9044
  *
@@ -9797,6 +9946,13 @@ declare function getVaultFolderMemoryCountOp(ctx: VaultFolderOperationsContext,
9797
9946
  */
9798
9947
  declare function ensureDefaultFoldersOp(ctx: VaultFolderOperationsContext): Promise<Map<string, string>>;
9799
9948
 
9949
+ /**
9950
+ * Value of the `origin` column on a row the SDK synthesised for a turn's tool results (v44, #866).
9951
+ *
9952
+ * `satisfies MessageOrigin` so this constant and the column's union cannot drift apart silently.
9953
+ */
9954
+ declare const TOOL_RESULT_ORIGIN = "tool_result";
9955
+
9800
9956
  /**
9801
9957
  * Pluggable logger for the Anuma SDK.
9802
9958
  *
@@ -10014,4 +10170,4 @@ declare function refreshNotionAccessToken(params: NotionRefreshTokenParams): Pro
10014
10170
  */
10015
10171
  declare function createNotionTools(getAccessToken: () => string | null, requestNotionAccess: () => Promise<string>): ToolConfig[];
10016
10172
 
10017
- 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 MemoryToVerify, type MemoryVaultSearchOptions, type MemoryVaultToolOptions, type MemoryVerification, 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 PhotoIngestResult, type PhotoMediaRef, 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 PublishedPhotoMemory, 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 UncheckedReason, type UnverifiableReason, 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, type VerificationSources, type VerifyMemoriesForPublishOptions, 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, createMessageSourceResolver, 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, ingestPublishedPhotoMemoriesOp, injectionSignatureCatalog, isPiiRedactor, isRerankerAvailable, moveMemoriesToFolderOp, noopLogger, onKeyAvailable, parseMedia, 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, verifyMemoriesForPublish, xhrTransport };
10173
+ export { type AutoExtractMessage, type AutoExtractor, type Budget, CHUNKS_DISCARDED_ORIGIN, 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 MemoryToVerify, type MemoryVaultSearchOptions, type MemoryVaultToolOptions, type MemoryVerification, 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 PhotoIngestResult, type PhotoMediaRef, 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 PublishedPhotoMemory, 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, TOOL_RESULT_ORIGIN, 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 UncheckedReason, type UnverifiableReason, 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, type VerificationSources, type VerifyMemoriesForPublishOptions, 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, createMessageSourceResolver, createNotionTools, createPlatformCursorStore, createRecallTool, createStockPricePreProcessor, createStreamingDeAnonymizer, createVaultEmbeddingCache, createVaultFolderOp, createVaultMemoriesBatchOp, createVaultMemoryOp, createWeatherPreProcessor, createWebSearchPreProcessor, decodeChunkVector, decryptConversationTitle, deleteAllVaultMemoriesForUserOp, deleteVaultFolderOp, deleteVaultMemoryOp, dequantizeEmbedding, discoverNotionOAuthEndpoints, eagerEmbedContent, embedAllMessages, embedMessage, encodeChunkVector, 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, ingestPublishedPhotoMemoriesOp, injectionSignatureCatalog, isPiiRedactor, isRerankerAvailable, moveMemoriesToFolderOp, noopLogger, onKeyAvailable, parseMedia, 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, verifyMemoriesForPublish, xhrTransport };