@anuma/sdk 6.1.1 → 6.3.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.
@@ -3389,6 +3389,22 @@ type ChatRole = "user" | "assistant" | "system";
3389
3389
  * - null/undefined: No feedback given
3390
3390
  */
3391
3391
  type MessageFeedback = "like" | "dislike" | null;
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.
3396
+ *
3397
+ * - `tool_result`: the hidden `[Tool Execution Results]` row built from a
3398
+ * turn's auto-executed tool results. Skipped by the embedding sweep (see
3399
+ * `memoryEngine/embeddings`).
3400
+ * - undefined/null: a normal message, or any row written before v44.
3401
+ *
3402
+ * Stored in the plaintext `origin` column — never encrypted. The deferred
3403
+ * embedding sweep that has to honour it runs without wallet context, so an
3404
+ * encrypted flag would be unreadable exactly where it matters and the skip
3405
+ * would fail open.
3406
+ */
3407
+ type MessageOrigin = "tool_result";
3392
3408
  /**
3393
3409
  * Metadata for files attached to messages.
3394
3410
  *
@@ -3546,6 +3562,8 @@ interface StoredMessage {
3546
3562
  feedback?: MessageFeedback;
3547
3563
  /** Tool call events from the backend response (for reconstructing tool call history) */
3548
3564
  toolCallEvents?: LlmapiToolCallEvent[];
3565
+ /** Provenance for synthetic rows; undefined for typed messages and pre-v44 rows */
3566
+ origin?: MessageOrigin;
3549
3567
  /**
3550
3568
  * Set when `content` could not be decrypted on read (#561).
3551
3569
  * The `content` field still holds the original ciphertext — never a
@@ -3641,6 +3659,8 @@ interface CreateMessageOptions {
3641
3659
  parentMessageId?: string;
3642
3660
  /** Tool call events from the backend response (for reconstructing tool call history) */
3643
3661
  toolCallEvents?: LlmapiToolCallEvent[];
3662
+ /** Provenance for synthetic rows; set by the producer, never by user input */
3663
+ origin?: MessageOrigin;
3644
3664
  /**
3645
3665
  * Optional pre-generated unique ID for this message.
3646
3666
  * When provided, used as the WatermelonDB record ID instead of auto-generating one.
@@ -4174,6 +4194,8 @@ declare class Message extends Model {
4174
4194
  parentMessageId?: string;
4175
4195
  feedback?: MessageFeedback;
4176
4196
  toolCallEvents?: LlmapiToolCallEvent[];
4197
+ /** Plaintext by design — see MessageOrigin */
4198
+ origin?: MessageOrigin;
4177
4199
  }
4178
4200
  declare class Conversation extends Model {
4179
4201
  static table: string;
@@ -4639,6 +4661,10 @@ declare class VaultMemory extends Model {
4639
4661
  /** Unix ms of the last `topics` write. Separate from `updated_at`, which every
4640
4662
  * topic writer pins on purpose (recall recency) — see the schema note. */
4641
4663
  topicsUpdatedAt: number | null;
4664
+ /** The photo(s) a SERVER-EXTRACTED memory came from — JSON
4665
+ * `[{feed_item_id, object_key}]`, exactly the shape
4666
+ * GET /api/memories/published returns. Null on anything not from a photo. */
4667
+ media: string | null;
4642
4668
  /** Unix ms of the last LLM topic-extraction pass. Null = never extracted
4643
4669
  * standalone (linked legacy rows are grandfathered as extracted).
4644
4670
  * DEPRECATED (v42) — subsumed by `topics_updated_at`; see the schema note. */
@@ -6023,8 +6049,16 @@ interface StoredVaultMemory {
6023
6049
  sourceChunkIds: string[] | null;
6024
6050
  /** Times this fact has been re-observed (for ranking + UX badges). */
6025
6051
  proofCount: number | null;
6026
- /** How the memory was created: manual | auto-extracted | capsule. */
6052
+ /** How the memory was created: manual | auto-extracted | capsule | photo. */
6027
6053
  source: string | null;
6054
+ /** The photo(s) a SERVER-EXTRACTED memory was read out of. Null on every
6055
+ * memory that did not come from a photo. See {@link PhotoMediaRef}.
6056
+ *
6057
+ * OPTIONAL rather than required: every read path sets it (the row mappers
6058
+ * always call parseMedia), but making it required would be a compile-break
6059
+ * for any caller that CONSTRUCTS a StoredVaultMemory — fixtures, mocks, and
6060
+ * anything downstream — for a field that is null on all but photo rows. */
6061
+ media?: PhotoMediaRef[] | null;
6028
6062
  /** W6 temporal lane — Unix ms when the event occurred (point/start of range). */
6029
6063
  eventTimeStart: number | null;
6030
6064
  /** W6 temporal lane — Unix ms when the event ended (range only). */
@@ -6083,6 +6117,26 @@ interface StoredVaultMemory {
6083
6117
  updatedAt: Date;
6084
6118
  isDeleted: boolean;
6085
6119
  }
6120
+ /**
6121
+ * A photo a server-extracted memory came from, as
6122
+ * GET /api/memories/published returns it in `media[]`.
6123
+ *
6124
+ * Both identifiers travel because both are needed: `feedItemId` is the server's
6125
+ * handle for the photo, and `objectKey` is what a client turns into a CDN URL
6126
+ * without another round-trip per memory.
6127
+ */
6128
+ interface PhotoMediaRef {
6129
+ feedItemId: number;
6130
+ objectKey: string | null;
6131
+ }
6132
+ /**
6133
+ * Decode the stored `media` column. Returns null for "no photo behind this
6134
+ * memory" (the column is null on every non-photo row) and tolerates a corrupt
6135
+ * or unexpected payload by reading it as null too — a memory whose photo
6136
+ * reference cannot be parsed is still a perfectly good memory, and losing the
6137
+ * thumbnail is a better failure than losing the row.
6138
+ */
6139
+ declare function parseMedia(value: unknown): PhotoMediaRef[] | null;
6086
6140
  interface CreateVaultMemoryOptions {
6087
6141
  content: string;
6088
6142
  /** Scope for the memory. Defaults to "private" if omitted. */
@@ -6524,6 +6578,95 @@ declare function hardDeleteDecayedOp(ctx: VaultMemoryOperationsContext, id: stri
6524
6578
  }): Promise<boolean>;
6525
6579
  declare function updateVaultMemoryEmbeddingOp(ctx: VaultMemoryOperationsContext, id: string, embedding: string, embeddingModel: string): Promise<boolean>;
6526
6580
 
6581
+ /**
6582
+ * Ingest server-extracted photo memories into the local vault.
6583
+ *
6584
+ * A photo uploaded to People Nearby is read by the server, which extracts
6585
+ * durable facts about the user, embeds them and publishes them
6586
+ * (anuma-ai/nearby#114). Until those rows reach the device they exist only
6587
+ * server-side: the user's own assistant cannot recall them, and no screen can
6588
+ * show them — so the "visible and deletable" promise the design makes is not
6589
+ * kept. This is the path that brings them home.
6590
+ *
6591
+ * Three things about the shape of this, each of which is load-bearing:
6592
+ *
6593
+ * 1. **It takes rows; it does not fetch them.** The publish reconciler already
6594
+ * calls `listPublished()` on every pass and gets `text`, `media[]`,
6595
+ * `event_time` and `user_authored` back. Ingest consumes that response. No
6596
+ * new endpoint, no second network call, no change to nearby's API.
6597
+ *
6598
+ * 2. **The vault row's id IS the server's `memory_id`.** That is what makes a
6599
+ * revoke addressable: the reconciler's ledger, its published set and its
6600
+ * `toRevoke` list are all keyed on that id, so a locally-minted id would
6601
+ * leave the user with a switch that cannot reach the row it appears to
6602
+ * control. It is also what makes ingest idempotent for free — a second pass
6603
+ * sees the id already present and writes nothing.
6604
+ *
6605
+ * 3. **These rows never go through `retain()`.** That path is for facts being
6606
+ * learned on-device: it dedupes and merges candidates against local rows and
6607
+ * mints its own ids, both of which would break (2). A photo memory is not a
6608
+ * candidate to be reconciled against the vault — it is an already-decided
6609
+ * fact the server has published.
6610
+ *
6611
+ * The rows are written `visibility: "public"` because they genuinely ARE
6612
+ * published — the reconciler reads local visibility as the user's intent, and
6613
+ * anything else would make it immediately revoke a memory the user never turned
6614
+ * off. They carry `source: SOURCE_PHOTO`, which is what exempts them from
6615
+ * decay's auto-archive; see the note there for why archiving one would silently
6616
+ * unpublish it.
6617
+ *
6618
+ * No embedding is computed here. `searchTool`'s un-embedded lane embeds any row
6619
+ * lacking a vector at search time, uses it in that same search and persists it
6620
+ * via `updateVaultMemoryEmbeddingOp` — so a row ingested without one is picked
6621
+ * up on first recall rather than costing an embedding call at ingest.
6622
+ */
6623
+
6624
+ /**
6625
+ * One row of `GET /api/memories/published`, narrowed to what ingest needs.
6626
+ *
6627
+ * Deliberately structural rather than an import from the transport client: this
6628
+ * op is in the SDK and the two hand-written nearby clients live in the app, so
6629
+ * a shared nominal type would drag one across a package boundary for no gain.
6630
+ */
6631
+ interface PublishedPhotoMemory {
6632
+ /** The server-minted memory id. `photo:<feedItemID>:fact:NN` or `:caption`. */
6633
+ memoryId: string;
6634
+ /** The projected fact text. */
6635
+ text: string;
6636
+ /** The photo(s) this fact was read out of. */
6637
+ media?: PhotoMediaRef[] | null;
6638
+ /** When the event in the memory happened, if the server knows. */
6639
+ eventTime?: {
6640
+ start: number | null;
6641
+ end: number | null;
6642
+ kind: "point" | "range" | "ongoing" | null;
6643
+ } | null;
6644
+ /** True when the text is the user's own words (a kept caption). */
6645
+ userAuthored?: boolean;
6646
+ }
6647
+ /** What one ingest pass did, for the caller's logs and tests. */
6648
+ interface PhotoIngestResult {
6649
+ /** Rows newly written to the vault. */
6650
+ inserted: number;
6651
+ /** Rows already present, left untouched. */
6652
+ skipped: number;
6653
+ }
6654
+ /**
6655
+ * Write the published photo memories this vault does not already have.
6656
+ *
6657
+ * Idempotent on `memoryId`: a row whose id is already in the vault is counted as
6658
+ * skipped and NOT rewritten, even when the server's text has since changed.
6659
+ * That is deliberate — the local row is the user's copy, they may have edited
6660
+ * it, and silently overwriting an edit to match the server would be the same
6661
+ * class of bug as publishing a version the user has since changed. Re-ingesting
6662
+ * changed text is a follow-up that needs a merge decision, not a clobber.
6663
+ *
6664
+ * Non-`photo:` ids are ignored: everything else in the published set is a
6665
+ * client-published memory that by definition already lives in this vault (or in
6666
+ * another device's, which is not ours to recreate).
6667
+ */
6668
+ declare function ingestPublishedPhotoMemoriesOp(ctx: VaultMemoryOperationsContext, rows: PublishedPhotoMemory[]): Promise<PhotoIngestResult>;
6669
+
6527
6670
  /**
6528
6671
  * Queue Types
6529
6672
  *
@@ -7023,6 +7166,15 @@ declare function createChunkVectorCache(maxSize?: number): ChunkVectorCache;
7023
7166
  * shared purge buffer for every row, so an already-archived manual memory is
7024
7167
  * still deleted after the window (the archived check runs before the manual
7025
7168
  * short-circuit by design).
7169
+ *
7170
+ * `source === "photo"` (server-extracted photo memories) is protected the same
7171
+ * way, and for a sharper reason than curation: those rows are PUBLISHED, and
7172
+ * auto-archiving one would silently un-publish it. Archived rows drop out of the
7173
+ * default vault read, the publish reconciler builds its desired set from that
7174
+ * read, and anything it previously adopted but no longer sees goes into
7175
+ * `toRevoke` — so an age-archive at the medium TTL would revoke a memory from
7176
+ * the server that the user never switched off. Revoking is the user's decision
7177
+ * and has exactly one entry point: the publish switch.
7026
7178
  */
7027
7179
  /** The verdict for a single memory. */
7028
7180
  type DecayVerdict = "keep" | "archive" | "delete";
@@ -9161,8 +9313,23 @@ declare function useChatStorage(options: UseChatStorageOptions): UseChatStorageR
9161
9313
  * conversation list read filters is_deleted and orders by created_at DESC,
9162
9314
  * which previously meant a temp B-tree sort of the whole live set on every
9163
9315
  * read. Structural only — no column added, no data rewritten
9164
- */
9165
- declare const SDK_SCHEMA_VERSION = 43;
9316
+ * - v44: Added origin column to history — provenance of a row, set by the
9317
+ * producer that synthesised it (`tool_result` = the hidden
9318
+ * `[Tool Execution Results]` message written from autoExecutedToolResults).
9319
+ * The embedding sweep skips those rows: they are machine-readable API dumps
9320
+ * that are never rendered, and chunking one cost 52 MB of vectors (620
9321
+ * chunks) against 0.2 MB of content. A content-prefix test cannot do this
9322
+ * job — `content` is `enc:v3:` ciphertext by the time the sweep reads it, so
9323
+ * provenance has to be recorded at write time. Deliberately NOT encrypted:
9324
+ * the sweep that must honour it runs with no wallet context, and an
9325
+ * unreadable flag would fail open. Existing rows stay NULL (= legacy,
9326
+ * unknown provenance, embedded as before) with no backfill, matching the v37
9327
+ * read-time-fallback precedent
9328
+ * - v45: Added `media` to memory_vault — the photo(s) a server-extracted
9329
+ * memory came from, as JSON `[{feed_item_id, object_key}]`. Null on every
9330
+ * row that did not come from a photo, which is all of them before this
9331
+ */
9332
+ declare const SDK_SCHEMA_VERSION = 45;
9166
9333
  /**
9167
9334
  * Combined WatermelonDB schema for all SDK storage modules.
9168
9335
  *
@@ -9250,6 +9417,7 @@ declare const sdkSchema: Readonly<{
9250
9417
  * - v40 → v41: Added `visibility`, `twin_opt_in`, `published_at`, `geohash` columns to memory_vault for the People Nearby cross-user visibility axis (two-tier `private | public`; null/unknown grandfathered as 'private')
9251
9418
  * - v41 → v42: Added `topics` + `topics_updated_at` columns to memory_vault, making a memory's topics the durable synced record and `entity`/`memory_entity` a device-local index over it (null `topics` = pre-v42, backfilled from the row's current links by the sweep)
9252
9419
  * - v42 → v43: Added a composite `(is_deleted, created_at)` index to conversations so the list reads stop temp-sorting (structural only, no data rewritten)
9420
+ * - v43 → v44: Added `origin` column to history recording which producer synthesised a row, so the embedding sweep can skip never-rendered tool-result dumps (plaintext by design — the sweep has no wallet context; null = legacy, embedded as before)
9253
9421
  */
9254
9422
  declare const sdkMigrations: Readonly<{
9255
9423
  validated: true;
@@ -9773,4 +9941,4 @@ declare function refreshNotionAccessToken(params: NotionRefreshTokenParams): Pro
9773
9941
  */
9774
9942
  declare function createNotionTools(getAccessToken: () => string | null, requestNotionAccess: () => Promise<string>): ToolConfig[];
9775
9943
 
9776
- 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 PiiCategory, type PiiMatch, type PiiPattern, PiiRedactor, type PiiRedactorOptions, type PlatformStorage, type PortalLlmAuth, type ProfileConfigFingerprint, type ProfileDoc, type ProfileFacet, type ProfileFacetKey, type ProfileSalienceInput, type ProfileSection, type PromptPreProcessor, type PromptPreProcessorContext, type QuantizedEmbedding, type QuarantinedMemoryInfo, QueueManager, type QueueStatus, RECALL_MAX_LIMIT, RECALL_TOOL_NAME, type RankedMemory, type RankedProfileCandidate, type RecallContext, type RecallDegradation, type RecallDiagnostics, type RecallOptions, type RecallResult, type RecallToolCallbacks, type RecallToolOptions, type RecencyOptions, type RedactionResult, type ReflectOptions, type ReflectResult, type RequestEncryptionKeyOptions, RerankerUnavailableError, type ResumeStreamOptions, type ResumeStreamResult, type ResumeStreamWithStorageResult, type RetainAction, type RetainContext, type RetainOptions, type RetainResult, type RetainSource, SDK_SCHEMA_VERSION, SHORT_TTL_MS, STREAM_RESUMABLE_HEADER, type ScoreBreakdown, type ScoreProfileSalienceOptions, type ScreenResult, type ScreenedCandidate, type SearchSource, type SendMessageWithStorageArgs, type SendMessageWithStorageDetachedResult, type SendMessageWithStorageResult, type ServerToolsOptions, type ServerToolsResponse, type SignMessageFn, type StockPriceClassification, type StockPricePreProcessorOptions, type ChatCompletionUsage as StoredChatCompletionUsage, type StoredConversation, type StoredConversationMemory, type StoredMessage, type StoredMessageWithSimilarity, type StoredVaultFolder, VaultFolder as StoredVaultFolderModel, type StoredVaultMemory, VaultMemory as StoredVaultMemoryModel, StreamExpiredError, type StreamMetaEvent, type StreamResumeHandle, type SynthesizeProfileOptions, TOPICS_EXTRACTION_VERSION, TOPIC_EXTRACTION_BATCH_SIZE, TREND_RECENT_WINDOW_DAYS, TREND_STALE_WINDOW_DAYS, type TextChunk, type TopicExtractOptions, type TopicExtractionInput, type TopicExtractionRunResult, type TurnCompleteEvent, type TurnSkippedEvent, type 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, injectionSignatureCatalog, isPiiRedactor, isRerankerAvailable, moveMemoriesToFolderOp, noopLogger, onKeyAvailable, preEmbedVaultMemories, quantizeEmbedding, queueManager, rankProfileCandidates, recall, reflect, refreshEncryptionKeyIfMatches, refreshNotionAccessToken, registerNotionClient, relinkMemoryTopicsOp, requestEncryptionKey, resolvePiiRedactor, restoreVaultMemoryOp, resumeStream, retain, scoreProfileSalience, screenCandidatesForInjection, sdkMigrations, sdkModelClasses, sdkSchema, searchVaultMemories, seedEncryptionKeys, setLogger, setMemoryVisibilityOp, shouldChunkMessage, stampTopicsExtractedAtOp, streamCancelPath, streamReplayPath, summarizeObservationTrends, supersedeVaultMemoryOp, synthesizeProfile, traverseGraphLane, ttlForType, updateVaultFolderContextOp, updateVaultFolderOp, updateVaultMemoryEmbeddingOp, updateVaultMemoryOp, upsertMessageOp, useChat, useChatStorage, useCredits, useEncryption, useModels, verifyMemoriesForPublish, xhrTransport };
9944
+ 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 };
@@ -3389,6 +3389,22 @@ type ChatRole = "user" | "assistant" | "system";
3389
3389
  * - null/undefined: No feedback given
3390
3390
  */
3391
3391
  type MessageFeedback = "like" | "dislike" | null;
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.
3396
+ *
3397
+ * - `tool_result`: the hidden `[Tool Execution Results]` row built from a
3398
+ * turn's auto-executed tool results. Skipped by the embedding sweep (see
3399
+ * `memoryEngine/embeddings`).
3400
+ * - undefined/null: a normal message, or any row written before v44.
3401
+ *
3402
+ * Stored in the plaintext `origin` column — never encrypted. The deferred
3403
+ * embedding sweep that has to honour it runs without wallet context, so an
3404
+ * encrypted flag would be unreadable exactly where it matters and the skip
3405
+ * would fail open.
3406
+ */
3407
+ type MessageOrigin = "tool_result";
3392
3408
  /**
3393
3409
  * Metadata for files attached to messages.
3394
3410
  *
@@ -3546,6 +3562,8 @@ interface StoredMessage {
3546
3562
  feedback?: MessageFeedback;
3547
3563
  /** Tool call events from the backend response (for reconstructing tool call history) */
3548
3564
  toolCallEvents?: LlmapiToolCallEvent[];
3565
+ /** Provenance for synthetic rows; undefined for typed messages and pre-v44 rows */
3566
+ origin?: MessageOrigin;
3549
3567
  /**
3550
3568
  * Set when `content` could not be decrypted on read (#561).
3551
3569
  * The `content` field still holds the original ciphertext — never a
@@ -3641,6 +3659,8 @@ interface CreateMessageOptions {
3641
3659
  parentMessageId?: string;
3642
3660
  /** Tool call events from the backend response (for reconstructing tool call history) */
3643
3661
  toolCallEvents?: LlmapiToolCallEvent[];
3662
+ /** Provenance for synthetic rows; set by the producer, never by user input */
3663
+ origin?: MessageOrigin;
3644
3664
  /**
3645
3665
  * Optional pre-generated unique ID for this message.
3646
3666
  * When provided, used as the WatermelonDB record ID instead of auto-generating one.
@@ -4174,6 +4194,8 @@ declare class Message extends Model {
4174
4194
  parentMessageId?: string;
4175
4195
  feedback?: MessageFeedback;
4176
4196
  toolCallEvents?: LlmapiToolCallEvent[];
4197
+ /** Plaintext by design — see MessageOrigin */
4198
+ origin?: MessageOrigin;
4177
4199
  }
4178
4200
  declare class Conversation extends Model {
4179
4201
  static table: string;
@@ -4639,6 +4661,10 @@ declare class VaultMemory extends Model {
4639
4661
  /** Unix ms of the last `topics` write. Separate from `updated_at`, which every
4640
4662
  * topic writer pins on purpose (recall recency) — see the schema note. */
4641
4663
  topicsUpdatedAt: number | null;
4664
+ /** The photo(s) a SERVER-EXTRACTED memory came from — JSON
4665
+ * `[{feed_item_id, object_key}]`, exactly the shape
4666
+ * GET /api/memories/published returns. Null on anything not from a photo. */
4667
+ media: string | null;
4642
4668
  /** Unix ms of the last LLM topic-extraction pass. Null = never extracted
4643
4669
  * standalone (linked legacy rows are grandfathered as extracted).
4644
4670
  * DEPRECATED (v42) — subsumed by `topics_updated_at`; see the schema note. */
@@ -6023,8 +6049,16 @@ interface StoredVaultMemory {
6023
6049
  sourceChunkIds: string[] | null;
6024
6050
  /** Times this fact has been re-observed (for ranking + UX badges). */
6025
6051
  proofCount: number | null;
6026
- /** How the memory was created: manual | auto-extracted | capsule. */
6052
+ /** How the memory was created: manual | auto-extracted | capsule | photo. */
6027
6053
  source: string | null;
6054
+ /** The photo(s) a SERVER-EXTRACTED memory was read out of. Null on every
6055
+ * memory that did not come from a photo. See {@link PhotoMediaRef}.
6056
+ *
6057
+ * OPTIONAL rather than required: every read path sets it (the row mappers
6058
+ * always call parseMedia), but making it required would be a compile-break
6059
+ * for any caller that CONSTRUCTS a StoredVaultMemory — fixtures, mocks, and
6060
+ * anything downstream — for a field that is null on all but photo rows. */
6061
+ media?: PhotoMediaRef[] | null;
6028
6062
  /** W6 temporal lane — Unix ms when the event occurred (point/start of range). */
6029
6063
  eventTimeStart: number | null;
6030
6064
  /** W6 temporal lane — Unix ms when the event ended (range only). */
@@ -6083,6 +6117,26 @@ interface StoredVaultMemory {
6083
6117
  updatedAt: Date;
6084
6118
  isDeleted: boolean;
6085
6119
  }
6120
+ /**
6121
+ * A photo a server-extracted memory came from, as
6122
+ * GET /api/memories/published returns it in `media[]`.
6123
+ *
6124
+ * Both identifiers travel because both are needed: `feedItemId` is the server's
6125
+ * handle for the photo, and `objectKey` is what a client turns into a CDN URL
6126
+ * without another round-trip per memory.
6127
+ */
6128
+ interface PhotoMediaRef {
6129
+ feedItemId: number;
6130
+ objectKey: string | null;
6131
+ }
6132
+ /**
6133
+ * Decode the stored `media` column. Returns null for "no photo behind this
6134
+ * memory" (the column is null on every non-photo row) and tolerates a corrupt
6135
+ * or unexpected payload by reading it as null too — a memory whose photo
6136
+ * reference cannot be parsed is still a perfectly good memory, and losing the
6137
+ * thumbnail is a better failure than losing the row.
6138
+ */
6139
+ declare function parseMedia(value: unknown): PhotoMediaRef[] | null;
6086
6140
  interface CreateVaultMemoryOptions {
6087
6141
  content: string;
6088
6142
  /** Scope for the memory. Defaults to "private" if omitted. */
@@ -6524,6 +6578,95 @@ declare function hardDeleteDecayedOp(ctx: VaultMemoryOperationsContext, id: stri
6524
6578
  }): Promise<boolean>;
6525
6579
  declare function updateVaultMemoryEmbeddingOp(ctx: VaultMemoryOperationsContext, id: string, embedding: string, embeddingModel: string): Promise<boolean>;
6526
6580
 
6581
+ /**
6582
+ * Ingest server-extracted photo memories into the local vault.
6583
+ *
6584
+ * A photo uploaded to People Nearby is read by the server, which extracts
6585
+ * durable facts about the user, embeds them and publishes them
6586
+ * (anuma-ai/nearby#114). Until those rows reach the device they exist only
6587
+ * server-side: the user's own assistant cannot recall them, and no screen can
6588
+ * show them — so the "visible and deletable" promise the design makes is not
6589
+ * kept. This is the path that brings them home.
6590
+ *
6591
+ * Three things about the shape of this, each of which is load-bearing:
6592
+ *
6593
+ * 1. **It takes rows; it does not fetch them.** The publish reconciler already
6594
+ * calls `listPublished()` on every pass and gets `text`, `media[]`,
6595
+ * `event_time` and `user_authored` back. Ingest consumes that response. No
6596
+ * new endpoint, no second network call, no change to nearby's API.
6597
+ *
6598
+ * 2. **The vault row's id IS the server's `memory_id`.** That is what makes a
6599
+ * revoke addressable: the reconciler's ledger, its published set and its
6600
+ * `toRevoke` list are all keyed on that id, so a locally-minted id would
6601
+ * leave the user with a switch that cannot reach the row it appears to
6602
+ * control. It is also what makes ingest idempotent for free — a second pass
6603
+ * sees the id already present and writes nothing.
6604
+ *
6605
+ * 3. **These rows never go through `retain()`.** That path is for facts being
6606
+ * learned on-device: it dedupes and merges candidates against local rows and
6607
+ * mints its own ids, both of which would break (2). A photo memory is not a
6608
+ * candidate to be reconciled against the vault — it is an already-decided
6609
+ * fact the server has published.
6610
+ *
6611
+ * The rows are written `visibility: "public"` because they genuinely ARE
6612
+ * published — the reconciler reads local visibility as the user's intent, and
6613
+ * anything else would make it immediately revoke a memory the user never turned
6614
+ * off. They carry `source: SOURCE_PHOTO`, which is what exempts them from
6615
+ * decay's auto-archive; see the note there for why archiving one would silently
6616
+ * unpublish it.
6617
+ *
6618
+ * No embedding is computed here. `searchTool`'s un-embedded lane embeds any row
6619
+ * lacking a vector at search time, uses it in that same search and persists it
6620
+ * via `updateVaultMemoryEmbeddingOp` — so a row ingested without one is picked
6621
+ * up on first recall rather than costing an embedding call at ingest.
6622
+ */
6623
+
6624
+ /**
6625
+ * One row of `GET /api/memories/published`, narrowed to what ingest needs.
6626
+ *
6627
+ * Deliberately structural rather than an import from the transport client: this
6628
+ * op is in the SDK and the two hand-written nearby clients live in the app, so
6629
+ * a shared nominal type would drag one across a package boundary for no gain.
6630
+ */
6631
+ interface PublishedPhotoMemory {
6632
+ /** The server-minted memory id. `photo:<feedItemID>:fact:NN` or `:caption`. */
6633
+ memoryId: string;
6634
+ /** The projected fact text. */
6635
+ text: string;
6636
+ /** The photo(s) this fact was read out of. */
6637
+ media?: PhotoMediaRef[] | null;
6638
+ /** When the event in the memory happened, if the server knows. */
6639
+ eventTime?: {
6640
+ start: number | null;
6641
+ end: number | null;
6642
+ kind: "point" | "range" | "ongoing" | null;
6643
+ } | null;
6644
+ /** True when the text is the user's own words (a kept caption). */
6645
+ userAuthored?: boolean;
6646
+ }
6647
+ /** What one ingest pass did, for the caller's logs and tests. */
6648
+ interface PhotoIngestResult {
6649
+ /** Rows newly written to the vault. */
6650
+ inserted: number;
6651
+ /** Rows already present, left untouched. */
6652
+ skipped: number;
6653
+ }
6654
+ /**
6655
+ * Write the published photo memories this vault does not already have.
6656
+ *
6657
+ * Idempotent on `memoryId`: a row whose id is already in the vault is counted as
6658
+ * skipped and NOT rewritten, even when the server's text has since changed.
6659
+ * That is deliberate — the local row is the user's copy, they may have edited
6660
+ * it, and silently overwriting an edit to match the server would be the same
6661
+ * class of bug as publishing a version the user has since changed. Re-ingesting
6662
+ * changed text is a follow-up that needs a merge decision, not a clobber.
6663
+ *
6664
+ * Non-`photo:` ids are ignored: everything else in the published set is a
6665
+ * client-published memory that by definition already lives in this vault (or in
6666
+ * another device's, which is not ours to recreate).
6667
+ */
6668
+ declare function ingestPublishedPhotoMemoriesOp(ctx: VaultMemoryOperationsContext, rows: PublishedPhotoMemory[]): Promise<PhotoIngestResult>;
6669
+
6527
6670
  /**
6528
6671
  * Queue Types
6529
6672
  *
@@ -7023,6 +7166,15 @@ declare function createChunkVectorCache(maxSize?: number): ChunkVectorCache;
7023
7166
  * shared purge buffer for every row, so an already-archived manual memory is
7024
7167
  * still deleted after the window (the archived check runs before the manual
7025
7168
  * short-circuit by design).
7169
+ *
7170
+ * `source === "photo"` (server-extracted photo memories) is protected the same
7171
+ * way, and for a sharper reason than curation: those rows are PUBLISHED, and
7172
+ * auto-archiving one would silently un-publish it. Archived rows drop out of the
7173
+ * default vault read, the publish reconciler builds its desired set from that
7174
+ * read, and anything it previously adopted but no longer sees goes into
7175
+ * `toRevoke` — so an age-archive at the medium TTL would revoke a memory from
7176
+ * the server that the user never switched off. Revoking is the user's decision
7177
+ * and has exactly one entry point: the publish switch.
7026
7178
  */
7027
7179
  /** The verdict for a single memory. */
7028
7180
  type DecayVerdict = "keep" | "archive" | "delete";
@@ -9161,8 +9313,23 @@ declare function useChatStorage(options: UseChatStorageOptions): UseChatStorageR
9161
9313
  * conversation list read filters is_deleted and orders by created_at DESC,
9162
9314
  * which previously meant a temp B-tree sort of the whole live set on every
9163
9315
  * read. Structural only — no column added, no data rewritten
9164
- */
9165
- declare const SDK_SCHEMA_VERSION = 43;
9316
+ * - v44: Added origin column to history — provenance of a row, set by the
9317
+ * producer that synthesised it (`tool_result` = the hidden
9318
+ * `[Tool Execution Results]` message written from autoExecutedToolResults).
9319
+ * The embedding sweep skips those rows: they are machine-readable API dumps
9320
+ * that are never rendered, and chunking one cost 52 MB of vectors (620
9321
+ * chunks) against 0.2 MB of content. A content-prefix test cannot do this
9322
+ * job — `content` is `enc:v3:` ciphertext by the time the sweep reads it, so
9323
+ * provenance has to be recorded at write time. Deliberately NOT encrypted:
9324
+ * the sweep that must honour it runs with no wallet context, and an
9325
+ * unreadable flag would fail open. Existing rows stay NULL (= legacy,
9326
+ * unknown provenance, embedded as before) with no backfill, matching the v37
9327
+ * read-time-fallback precedent
9328
+ * - v45: Added `media` to memory_vault — the photo(s) a server-extracted
9329
+ * memory came from, as JSON `[{feed_item_id, object_key}]`. Null on every
9330
+ * row that did not come from a photo, which is all of them before this
9331
+ */
9332
+ declare const SDK_SCHEMA_VERSION = 45;
9166
9333
  /**
9167
9334
  * Combined WatermelonDB schema for all SDK storage modules.
9168
9335
  *
@@ -9250,6 +9417,7 @@ declare const sdkSchema: Readonly<{
9250
9417
  * - v40 → v41: Added `visibility`, `twin_opt_in`, `published_at`, `geohash` columns to memory_vault for the People Nearby cross-user visibility axis (two-tier `private | public`; null/unknown grandfathered as 'private')
9251
9418
  * - v41 → v42: Added `topics` + `topics_updated_at` columns to memory_vault, making a memory's topics the durable synced record and `entity`/`memory_entity` a device-local index over it (null `topics` = pre-v42, backfilled from the row's current links by the sweep)
9252
9419
  * - v42 → v43: Added a composite `(is_deleted, created_at)` index to conversations so the list reads stop temp-sorting (structural only, no data rewritten)
9420
+ * - v43 → v44: Added `origin` column to history recording which producer synthesised a row, so the embedding sweep can skip never-rendered tool-result dumps (plaintext by design — the sweep has no wallet context; null = legacy, embedded as before)
9253
9421
  */
9254
9422
  declare const sdkMigrations: Readonly<{
9255
9423
  validated: true;
@@ -9773,4 +9941,4 @@ declare function refreshNotionAccessToken(params: NotionRefreshTokenParams): Pro
9773
9941
  */
9774
9942
  declare function createNotionTools(getAccessToken: () => string | null, requestNotionAccess: () => Promise<string>): ToolConfig[];
9775
9943
 
9776
- 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 PiiCategory, type PiiMatch, type PiiPattern, PiiRedactor, type PiiRedactorOptions, type PlatformStorage, type PortalLlmAuth, type ProfileConfigFingerprint, type ProfileDoc, type ProfileFacet, type ProfileFacetKey, type ProfileSalienceInput, type ProfileSection, type PromptPreProcessor, type PromptPreProcessorContext, type QuantizedEmbedding, type QuarantinedMemoryInfo, QueueManager, type QueueStatus, RECALL_MAX_LIMIT, RECALL_TOOL_NAME, type RankedMemory, type RankedProfileCandidate, type RecallContext, type RecallDegradation, type RecallDiagnostics, type RecallOptions, type RecallResult, type RecallToolCallbacks, type RecallToolOptions, type RecencyOptions, type RedactionResult, type ReflectOptions, type ReflectResult, type RequestEncryptionKeyOptions, RerankerUnavailableError, type ResumeStreamOptions, type ResumeStreamResult, type ResumeStreamWithStorageResult, type RetainAction, type RetainContext, type RetainOptions, type RetainResult, type RetainSource, SDK_SCHEMA_VERSION, SHORT_TTL_MS, STREAM_RESUMABLE_HEADER, type ScoreBreakdown, type ScoreProfileSalienceOptions, type ScreenResult, type ScreenedCandidate, type SearchSource, type SendMessageWithStorageArgs, type SendMessageWithStorageDetachedResult, type SendMessageWithStorageResult, type ServerToolsOptions, type ServerToolsResponse, type SignMessageFn, type StockPriceClassification, type StockPricePreProcessorOptions, type ChatCompletionUsage as StoredChatCompletionUsage, type StoredConversation, type StoredConversationMemory, type StoredMessage, type StoredMessageWithSimilarity, type StoredVaultFolder, VaultFolder as StoredVaultFolderModel, type StoredVaultMemory, VaultMemory as StoredVaultMemoryModel, StreamExpiredError, type StreamMetaEvent, type StreamResumeHandle, type SynthesizeProfileOptions, TOPICS_EXTRACTION_VERSION, TOPIC_EXTRACTION_BATCH_SIZE, TREND_RECENT_WINDOW_DAYS, TREND_STALE_WINDOW_DAYS, type TextChunk, type TopicExtractOptions, type TopicExtractionInput, type TopicExtractionRunResult, type TurnCompleteEvent, type TurnSkippedEvent, type 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, injectionSignatureCatalog, isPiiRedactor, isRerankerAvailable, moveMemoriesToFolderOp, noopLogger, onKeyAvailable, preEmbedVaultMemories, quantizeEmbedding, queueManager, rankProfileCandidates, recall, reflect, refreshEncryptionKeyIfMatches, refreshNotionAccessToken, registerNotionClient, relinkMemoryTopicsOp, requestEncryptionKey, resolvePiiRedactor, restoreVaultMemoryOp, resumeStream, retain, scoreProfileSalience, screenCandidatesForInjection, sdkMigrations, sdkModelClasses, sdkSchema, searchVaultMemories, seedEncryptionKeys, setLogger, setMemoryVisibilityOp, shouldChunkMessage, stampTopicsExtractedAtOp, streamCancelPath, streamReplayPath, summarizeObservationTrends, supersedeVaultMemoryOp, synthesizeProfile, traverseGraphLane, ttlForType, updateVaultFolderContextOp, updateVaultFolderOp, updateVaultMemoryEmbeddingOp, updateVaultMemoryOp, upsertMessageOp, useChat, useChatStorage, useCredits, useEncryption, useModels, verifyMemoriesForPublish, xhrTransport };
9944
+ 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 };