@anuma/sdk 6.2.0 → 6.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/expo/{chunk-NH5VY3G7.mjs → chunk-PBCULYOW.mjs} +21 -1
- package/dist/expo/index.cjs +201 -74
- package/dist/expo/index.d.mts +161 -3
- package/dist/expo/index.d.ts +161 -3
- package/dist/expo/index.mjs +166 -67
- package/dist/expo/{recall-ZIKIYARO.mjs → recall-UVM2366D.mjs} +1 -1
- package/dist/react/{chunk-EMVLDEPB.mjs → chunk-TI3UVQPF.mjs} +21 -1
- package/dist/react/index.cjs +201 -74
- package/dist/react/index.d.mts +161 -3
- package/dist/react/index.d.ts +161 -3
- package/dist/react/index.mjs +166 -67
- package/dist/react/{recall-B7POS7NA.mjs → recall-PCM7H5TA.mjs} +1 -1
- package/dist/server/{chunk-6JS7SY6A.mjs → chunk-S5WEN7TE.mjs} +21 -1
- package/dist/server/index.cjs +201 -74
- package/dist/server/index.d.mts +161 -3
- package/dist/server/index.d.ts +161 -3
- package/dist/server/index.mjs +166 -67
- package/dist/server/{recall-IM6RLRI6.mjs → recall-BQSCJBGI.mjs} +1 -1
- package/package.json +1 -1
package/dist/expo/index.d.mts
CHANGED
|
@@ -4661,6 +4661,10 @@ declare class VaultMemory extends Model {
|
|
|
4661
4661
|
/** Unix ms of the last `topics` write. Separate from `updated_at`, which every
|
|
4662
4662
|
* topic writer pins on purpose (recall recency) — see the schema note. */
|
|
4663
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;
|
|
4664
4668
|
/** Unix ms of the last LLM topic-extraction pass. Null = never extracted
|
|
4665
4669
|
* standalone (linked legacy rows are grandfathered as extracted).
|
|
4666
4670
|
* DEPRECATED (v42) — subsumed by `topics_updated_at`; see the schema note. */
|
|
@@ -5816,6 +5820,31 @@ interface QuarantinedMemoryInfo {
|
|
|
5816
5820
|
interface ExtractFactsOptions extends PortalLlmAuth {
|
|
5817
5821
|
baseUrl?: string;
|
|
5818
5822
|
model?: string;
|
|
5823
|
+
/**
|
|
5824
|
+
* Optional per-call request path override, forwarded to
|
|
5825
|
+
* {@link callPortalJsonCompletion}. When set, the extraction call POSTs to
|
|
5826
|
+
* `baseUrl + endpointOverride` instead of the default
|
|
5827
|
+
* `/api/v1/chat/completions` — path only, body unchanged. Lets callers route
|
|
5828
|
+
* this internal-utility pass to a dedicated endpoint. Invalid values throw at
|
|
5829
|
+
* call time (see {@link validateEndpointOverride}).
|
|
5830
|
+
*
|
|
5831
|
+
* Why this exists (anuma-ai/ai-memoryless-client#5536): auto-extraction is the
|
|
5832
|
+
* highest-volume first-party background call in the product — one per
|
|
5833
|
+
* extracting turn, on every platform — and it carries no flow fingerprint, so
|
|
5834
|
+
* the portal's freeloader detector classifies it as scripted abuse. In reject
|
|
5835
|
+
* mode that 403s every basic-tier extraction, which surfaces here as
|
|
5836
|
+
* `onExhaustedEmpty` → `empty-after-retry` and leaves free-tier vaults empty.
|
|
5837
|
+
* {@link TopicExtractOptions.endpointOverride} already exists for the same
|
|
5838
|
+
* reason on the topic pass; this is the fact pass catching up.
|
|
5839
|
+
*
|
|
5840
|
+
* IMPORTANT — the utility endpoint clamps to a PRICE CEILING and never
|
|
5841
|
+
* rejects, so pointing this at `/api/v1/utility/chat/completions` while the
|
|
5842
|
+
* portal's ceiling prices below {@link DEFAULT_EXTRACTION_MODEL} silently
|
|
5843
|
+
* rewrites the model instead of 403-ing. That trades a visible failure for an
|
|
5844
|
+
* invisible quality regression: raise `PORTAL_UTILITY_CEILING_MODEL` to at
|
|
5845
|
+
* least the extraction model's rate BEFORE setting this in a client.
|
|
5846
|
+
*/
|
|
5847
|
+
endpointOverride?: string;
|
|
5819
5848
|
/** Override the global fetch implementation (useful for tests). */
|
|
5820
5849
|
fetchFn?: typeof fetch;
|
|
5821
5850
|
/**
|
|
@@ -6045,8 +6074,16 @@ interface StoredVaultMemory {
|
|
|
6045
6074
|
sourceChunkIds: string[] | null;
|
|
6046
6075
|
/** Times this fact has been re-observed (for ranking + UX badges). */
|
|
6047
6076
|
proofCount: number | null;
|
|
6048
|
-
/** How the memory was created: manual | auto-extracted | capsule. */
|
|
6077
|
+
/** How the memory was created: manual | auto-extracted | capsule | photo. */
|
|
6049
6078
|
source: string | null;
|
|
6079
|
+
/** The photo(s) a SERVER-EXTRACTED memory was read out of. Null on every
|
|
6080
|
+
* memory that did not come from a photo. See {@link PhotoMediaRef}.
|
|
6081
|
+
*
|
|
6082
|
+
* OPTIONAL rather than required: every read path sets it (the row mappers
|
|
6083
|
+
* always call parseMedia), but making it required would be a compile-break
|
|
6084
|
+
* for any caller that CONSTRUCTS a StoredVaultMemory — fixtures, mocks, and
|
|
6085
|
+
* anything downstream — for a field that is null on all but photo rows. */
|
|
6086
|
+
media?: PhotoMediaRef[] | null;
|
|
6050
6087
|
/** W6 temporal lane — Unix ms when the event occurred (point/start of range). */
|
|
6051
6088
|
eventTimeStart: number | null;
|
|
6052
6089
|
/** W6 temporal lane — Unix ms when the event ended (range only). */
|
|
@@ -6105,6 +6142,26 @@ interface StoredVaultMemory {
|
|
|
6105
6142
|
updatedAt: Date;
|
|
6106
6143
|
isDeleted: boolean;
|
|
6107
6144
|
}
|
|
6145
|
+
/**
|
|
6146
|
+
* A photo a server-extracted memory came from, as
|
|
6147
|
+
* GET /api/memories/published returns it in `media[]`.
|
|
6148
|
+
*
|
|
6149
|
+
* Both identifiers travel because both are needed: `feedItemId` is the server's
|
|
6150
|
+
* handle for the photo, and `objectKey` is what a client turns into a CDN URL
|
|
6151
|
+
* without another round-trip per memory.
|
|
6152
|
+
*/
|
|
6153
|
+
interface PhotoMediaRef {
|
|
6154
|
+
feedItemId: number;
|
|
6155
|
+
objectKey: string | null;
|
|
6156
|
+
}
|
|
6157
|
+
/**
|
|
6158
|
+
* Decode the stored `media` column. Returns null for "no photo behind this
|
|
6159
|
+
* memory" (the column is null on every non-photo row) and tolerates a corrupt
|
|
6160
|
+
* or unexpected payload by reading it as null too — a memory whose photo
|
|
6161
|
+
* reference cannot be parsed is still a perfectly good memory, and losing the
|
|
6162
|
+
* thumbnail is a better failure than losing the row.
|
|
6163
|
+
*/
|
|
6164
|
+
declare function parseMedia(value: unknown): PhotoMediaRef[] | null;
|
|
6108
6165
|
interface CreateVaultMemoryOptions {
|
|
6109
6166
|
content: string;
|
|
6110
6167
|
/** Scope for the memory. Defaults to "private" if omitted. */
|
|
@@ -6546,6 +6603,95 @@ declare function hardDeleteDecayedOp(ctx: VaultMemoryOperationsContext, id: stri
|
|
|
6546
6603
|
}): Promise<boolean>;
|
|
6547
6604
|
declare function updateVaultMemoryEmbeddingOp(ctx: VaultMemoryOperationsContext, id: string, embedding: string, embeddingModel: string): Promise<boolean>;
|
|
6548
6605
|
|
|
6606
|
+
/**
|
|
6607
|
+
* Ingest server-extracted photo memories into the local vault.
|
|
6608
|
+
*
|
|
6609
|
+
* A photo uploaded to People Nearby is read by the server, which extracts
|
|
6610
|
+
* durable facts about the user, embeds them and publishes them
|
|
6611
|
+
* (anuma-ai/nearby#114). Until those rows reach the device they exist only
|
|
6612
|
+
* server-side: the user's own assistant cannot recall them, and no screen can
|
|
6613
|
+
* show them — so the "visible and deletable" promise the design makes is not
|
|
6614
|
+
* kept. This is the path that brings them home.
|
|
6615
|
+
*
|
|
6616
|
+
* Three things about the shape of this, each of which is load-bearing:
|
|
6617
|
+
*
|
|
6618
|
+
* 1. **It takes rows; it does not fetch them.** The publish reconciler already
|
|
6619
|
+
* calls `listPublished()` on every pass and gets `text`, `media[]`,
|
|
6620
|
+
* `event_time` and `user_authored` back. Ingest consumes that response. No
|
|
6621
|
+
* new endpoint, no second network call, no change to nearby's API.
|
|
6622
|
+
*
|
|
6623
|
+
* 2. **The vault row's id IS the server's `memory_id`.** That is what makes a
|
|
6624
|
+
* revoke addressable: the reconciler's ledger, its published set and its
|
|
6625
|
+
* `toRevoke` list are all keyed on that id, so a locally-minted id would
|
|
6626
|
+
* leave the user with a switch that cannot reach the row it appears to
|
|
6627
|
+
* control. It is also what makes ingest idempotent for free — a second pass
|
|
6628
|
+
* sees the id already present and writes nothing.
|
|
6629
|
+
*
|
|
6630
|
+
* 3. **These rows never go through `retain()`.** That path is for facts being
|
|
6631
|
+
* learned on-device: it dedupes and merges candidates against local rows and
|
|
6632
|
+
* mints its own ids, both of which would break (2). A photo memory is not a
|
|
6633
|
+
* candidate to be reconciled against the vault — it is an already-decided
|
|
6634
|
+
* fact the server has published.
|
|
6635
|
+
*
|
|
6636
|
+
* The rows are written `visibility: "public"` because they genuinely ARE
|
|
6637
|
+
* published — the reconciler reads local visibility as the user's intent, and
|
|
6638
|
+
* anything else would make it immediately revoke a memory the user never turned
|
|
6639
|
+
* off. They carry `source: SOURCE_PHOTO`, which is what exempts them from
|
|
6640
|
+
* decay's auto-archive; see the note there for why archiving one would silently
|
|
6641
|
+
* unpublish it.
|
|
6642
|
+
*
|
|
6643
|
+
* No embedding is computed here. `searchTool`'s un-embedded lane embeds any row
|
|
6644
|
+
* lacking a vector at search time, uses it in that same search and persists it
|
|
6645
|
+
* via `updateVaultMemoryEmbeddingOp` — so a row ingested without one is picked
|
|
6646
|
+
* up on first recall rather than costing an embedding call at ingest.
|
|
6647
|
+
*/
|
|
6648
|
+
|
|
6649
|
+
/**
|
|
6650
|
+
* One row of `GET /api/memories/published`, narrowed to what ingest needs.
|
|
6651
|
+
*
|
|
6652
|
+
* Deliberately structural rather than an import from the transport client: this
|
|
6653
|
+
* op is in the SDK and the two hand-written nearby clients live in the app, so
|
|
6654
|
+
* a shared nominal type would drag one across a package boundary for no gain.
|
|
6655
|
+
*/
|
|
6656
|
+
interface PublishedPhotoMemory {
|
|
6657
|
+
/** The server-minted memory id. `photo:<feedItemID>:fact:NN` or `:caption`. */
|
|
6658
|
+
memoryId: string;
|
|
6659
|
+
/** The projected fact text. */
|
|
6660
|
+
text: string;
|
|
6661
|
+
/** The photo(s) this fact was read out of. */
|
|
6662
|
+
media?: PhotoMediaRef[] | null;
|
|
6663
|
+
/** When the event in the memory happened, if the server knows. */
|
|
6664
|
+
eventTime?: {
|
|
6665
|
+
start: number | null;
|
|
6666
|
+
end: number | null;
|
|
6667
|
+
kind: "point" | "range" | "ongoing" | null;
|
|
6668
|
+
} | null;
|
|
6669
|
+
/** True when the text is the user's own words (a kept caption). */
|
|
6670
|
+
userAuthored?: boolean;
|
|
6671
|
+
}
|
|
6672
|
+
/** What one ingest pass did, for the caller's logs and tests. */
|
|
6673
|
+
interface PhotoIngestResult {
|
|
6674
|
+
/** Rows newly written to the vault. */
|
|
6675
|
+
inserted: number;
|
|
6676
|
+
/** Rows already present, left untouched. */
|
|
6677
|
+
skipped: number;
|
|
6678
|
+
}
|
|
6679
|
+
/**
|
|
6680
|
+
* Write the published photo memories this vault does not already have.
|
|
6681
|
+
*
|
|
6682
|
+
* Idempotent on `memoryId`: a row whose id is already in the vault is counted as
|
|
6683
|
+
* skipped and NOT rewritten, even when the server's text has since changed.
|
|
6684
|
+
* That is deliberate — the local row is the user's copy, they may have edited
|
|
6685
|
+
* it, and silently overwriting an edit to match the server would be the same
|
|
6686
|
+
* class of bug as publishing a version the user has since changed. Re-ingesting
|
|
6687
|
+
* changed text is a follow-up that needs a merge decision, not a clobber.
|
|
6688
|
+
*
|
|
6689
|
+
* Non-`photo:` ids are ignored: everything else in the published set is a
|
|
6690
|
+
* client-published memory that by definition already lives in this vault (or in
|
|
6691
|
+
* another device's, which is not ours to recreate).
|
|
6692
|
+
*/
|
|
6693
|
+
declare function ingestPublishedPhotoMemoriesOp(ctx: VaultMemoryOperationsContext, rows: PublishedPhotoMemory[]): Promise<PhotoIngestResult>;
|
|
6694
|
+
|
|
6549
6695
|
/**
|
|
6550
6696
|
* Queue Types
|
|
6551
6697
|
*
|
|
@@ -7045,6 +7191,15 @@ declare function createChunkVectorCache(maxSize?: number): ChunkVectorCache;
|
|
|
7045
7191
|
* shared purge buffer for every row, so an already-archived manual memory is
|
|
7046
7192
|
* still deleted after the window (the archived check runs before the manual
|
|
7047
7193
|
* short-circuit by design).
|
|
7194
|
+
*
|
|
7195
|
+
* `source === "photo"` (server-extracted photo memories) is protected the same
|
|
7196
|
+
* way, and for a sharper reason than curation: those rows are PUBLISHED, and
|
|
7197
|
+
* auto-archiving one would silently un-publish it. Archived rows drop out of the
|
|
7198
|
+
* default vault read, the publish reconciler builds its desired set from that
|
|
7199
|
+
* read, and anything it previously adopted but no longer sees goes into
|
|
7200
|
+
* `toRevoke` — so an age-archive at the medium TTL would revoke a memory from
|
|
7201
|
+
* the server that the user never switched off. Revoking is the user's decision
|
|
7202
|
+
* and has exactly one entry point: the publish switch.
|
|
7048
7203
|
*/
|
|
7049
7204
|
/** The verdict for a single memory. */
|
|
7050
7205
|
type DecayVerdict = "keep" | "archive" | "delete";
|
|
@@ -9195,8 +9350,11 @@ declare function useChatStorage(options: UseChatStorageOptions): UseChatStorageR
|
|
|
9195
9350
|
* unreadable flag would fail open. Existing rows stay NULL (= legacy,
|
|
9196
9351
|
* unknown provenance, embedded as before) with no backfill, matching the v37
|
|
9197
9352
|
* read-time-fallback precedent
|
|
9353
|
+
* - v45: Added `media` to memory_vault — the photo(s) a server-extracted
|
|
9354
|
+
* memory came from, as JSON `[{feed_item_id, object_key}]`. Null on every
|
|
9355
|
+
* row that did not come from a photo, which is all of them before this
|
|
9198
9356
|
*/
|
|
9199
|
-
declare const SDK_SCHEMA_VERSION =
|
|
9357
|
+
declare const SDK_SCHEMA_VERSION = 45;
|
|
9200
9358
|
/**
|
|
9201
9359
|
* Combined WatermelonDB schema for all SDK storage modules.
|
|
9202
9360
|
*
|
|
@@ -9808,4 +9966,4 @@ declare function refreshNotionAccessToken(params: NotionRefreshTokenParams): Pro
|
|
|
9808
9966
|
*/
|
|
9809
9967
|
declare function createNotionTools(getAccessToken: () => string | null, requestNotionAccess: () => Promise<string>): ToolConfig[];
|
|
9810
9968
|
|
|
9811
|
-
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 };
|
|
9969
|
+
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 };
|
package/dist/expo/index.d.ts
CHANGED
|
@@ -4661,6 +4661,10 @@ declare class VaultMemory extends Model {
|
|
|
4661
4661
|
/** Unix ms of the last `topics` write. Separate from `updated_at`, which every
|
|
4662
4662
|
* topic writer pins on purpose (recall recency) — see the schema note. */
|
|
4663
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;
|
|
4664
4668
|
/** Unix ms of the last LLM topic-extraction pass. Null = never extracted
|
|
4665
4669
|
* standalone (linked legacy rows are grandfathered as extracted).
|
|
4666
4670
|
* DEPRECATED (v42) — subsumed by `topics_updated_at`; see the schema note. */
|
|
@@ -5816,6 +5820,31 @@ interface QuarantinedMemoryInfo {
|
|
|
5816
5820
|
interface ExtractFactsOptions extends PortalLlmAuth {
|
|
5817
5821
|
baseUrl?: string;
|
|
5818
5822
|
model?: string;
|
|
5823
|
+
/**
|
|
5824
|
+
* Optional per-call request path override, forwarded to
|
|
5825
|
+
* {@link callPortalJsonCompletion}. When set, the extraction call POSTs to
|
|
5826
|
+
* `baseUrl + endpointOverride` instead of the default
|
|
5827
|
+
* `/api/v1/chat/completions` — path only, body unchanged. Lets callers route
|
|
5828
|
+
* this internal-utility pass to a dedicated endpoint. Invalid values throw at
|
|
5829
|
+
* call time (see {@link validateEndpointOverride}).
|
|
5830
|
+
*
|
|
5831
|
+
* Why this exists (anuma-ai/ai-memoryless-client#5536): auto-extraction is the
|
|
5832
|
+
* highest-volume first-party background call in the product — one per
|
|
5833
|
+
* extracting turn, on every platform — and it carries no flow fingerprint, so
|
|
5834
|
+
* the portal's freeloader detector classifies it as scripted abuse. In reject
|
|
5835
|
+
* mode that 403s every basic-tier extraction, which surfaces here as
|
|
5836
|
+
* `onExhaustedEmpty` → `empty-after-retry` and leaves free-tier vaults empty.
|
|
5837
|
+
* {@link TopicExtractOptions.endpointOverride} already exists for the same
|
|
5838
|
+
* reason on the topic pass; this is the fact pass catching up.
|
|
5839
|
+
*
|
|
5840
|
+
* IMPORTANT — the utility endpoint clamps to a PRICE CEILING and never
|
|
5841
|
+
* rejects, so pointing this at `/api/v1/utility/chat/completions` while the
|
|
5842
|
+
* portal's ceiling prices below {@link DEFAULT_EXTRACTION_MODEL} silently
|
|
5843
|
+
* rewrites the model instead of 403-ing. That trades a visible failure for an
|
|
5844
|
+
* invisible quality regression: raise `PORTAL_UTILITY_CEILING_MODEL` to at
|
|
5845
|
+
* least the extraction model's rate BEFORE setting this in a client.
|
|
5846
|
+
*/
|
|
5847
|
+
endpointOverride?: string;
|
|
5819
5848
|
/** Override the global fetch implementation (useful for tests). */
|
|
5820
5849
|
fetchFn?: typeof fetch;
|
|
5821
5850
|
/**
|
|
@@ -6045,8 +6074,16 @@ interface StoredVaultMemory {
|
|
|
6045
6074
|
sourceChunkIds: string[] | null;
|
|
6046
6075
|
/** Times this fact has been re-observed (for ranking + UX badges). */
|
|
6047
6076
|
proofCount: number | null;
|
|
6048
|
-
/** How the memory was created: manual | auto-extracted | capsule. */
|
|
6077
|
+
/** How the memory was created: manual | auto-extracted | capsule | photo. */
|
|
6049
6078
|
source: string | null;
|
|
6079
|
+
/** The photo(s) a SERVER-EXTRACTED memory was read out of. Null on every
|
|
6080
|
+
* memory that did not come from a photo. See {@link PhotoMediaRef}.
|
|
6081
|
+
*
|
|
6082
|
+
* OPTIONAL rather than required: every read path sets it (the row mappers
|
|
6083
|
+
* always call parseMedia), but making it required would be a compile-break
|
|
6084
|
+
* for any caller that CONSTRUCTS a StoredVaultMemory — fixtures, mocks, and
|
|
6085
|
+
* anything downstream — for a field that is null on all but photo rows. */
|
|
6086
|
+
media?: PhotoMediaRef[] | null;
|
|
6050
6087
|
/** W6 temporal lane — Unix ms when the event occurred (point/start of range). */
|
|
6051
6088
|
eventTimeStart: number | null;
|
|
6052
6089
|
/** W6 temporal lane — Unix ms when the event ended (range only). */
|
|
@@ -6105,6 +6142,26 @@ interface StoredVaultMemory {
|
|
|
6105
6142
|
updatedAt: Date;
|
|
6106
6143
|
isDeleted: boolean;
|
|
6107
6144
|
}
|
|
6145
|
+
/**
|
|
6146
|
+
* A photo a server-extracted memory came from, as
|
|
6147
|
+
* GET /api/memories/published returns it in `media[]`.
|
|
6148
|
+
*
|
|
6149
|
+
* Both identifiers travel because both are needed: `feedItemId` is the server's
|
|
6150
|
+
* handle for the photo, and `objectKey` is what a client turns into a CDN URL
|
|
6151
|
+
* without another round-trip per memory.
|
|
6152
|
+
*/
|
|
6153
|
+
interface PhotoMediaRef {
|
|
6154
|
+
feedItemId: number;
|
|
6155
|
+
objectKey: string | null;
|
|
6156
|
+
}
|
|
6157
|
+
/**
|
|
6158
|
+
* Decode the stored `media` column. Returns null for "no photo behind this
|
|
6159
|
+
* memory" (the column is null on every non-photo row) and tolerates a corrupt
|
|
6160
|
+
* or unexpected payload by reading it as null too — a memory whose photo
|
|
6161
|
+
* reference cannot be parsed is still a perfectly good memory, and losing the
|
|
6162
|
+
* thumbnail is a better failure than losing the row.
|
|
6163
|
+
*/
|
|
6164
|
+
declare function parseMedia(value: unknown): PhotoMediaRef[] | null;
|
|
6108
6165
|
interface CreateVaultMemoryOptions {
|
|
6109
6166
|
content: string;
|
|
6110
6167
|
/** Scope for the memory. Defaults to "private" if omitted. */
|
|
@@ -6546,6 +6603,95 @@ declare function hardDeleteDecayedOp(ctx: VaultMemoryOperationsContext, id: stri
|
|
|
6546
6603
|
}): Promise<boolean>;
|
|
6547
6604
|
declare function updateVaultMemoryEmbeddingOp(ctx: VaultMemoryOperationsContext, id: string, embedding: string, embeddingModel: string): Promise<boolean>;
|
|
6548
6605
|
|
|
6606
|
+
/**
|
|
6607
|
+
* Ingest server-extracted photo memories into the local vault.
|
|
6608
|
+
*
|
|
6609
|
+
* A photo uploaded to People Nearby is read by the server, which extracts
|
|
6610
|
+
* durable facts about the user, embeds them and publishes them
|
|
6611
|
+
* (anuma-ai/nearby#114). Until those rows reach the device they exist only
|
|
6612
|
+
* server-side: the user's own assistant cannot recall them, and no screen can
|
|
6613
|
+
* show them — so the "visible and deletable" promise the design makes is not
|
|
6614
|
+
* kept. This is the path that brings them home.
|
|
6615
|
+
*
|
|
6616
|
+
* Three things about the shape of this, each of which is load-bearing:
|
|
6617
|
+
*
|
|
6618
|
+
* 1. **It takes rows; it does not fetch them.** The publish reconciler already
|
|
6619
|
+
* calls `listPublished()` on every pass and gets `text`, `media[]`,
|
|
6620
|
+
* `event_time` and `user_authored` back. Ingest consumes that response. No
|
|
6621
|
+
* new endpoint, no second network call, no change to nearby's API.
|
|
6622
|
+
*
|
|
6623
|
+
* 2. **The vault row's id IS the server's `memory_id`.** That is what makes a
|
|
6624
|
+
* revoke addressable: the reconciler's ledger, its published set and its
|
|
6625
|
+
* `toRevoke` list are all keyed on that id, so a locally-minted id would
|
|
6626
|
+
* leave the user with a switch that cannot reach the row it appears to
|
|
6627
|
+
* control. It is also what makes ingest idempotent for free — a second pass
|
|
6628
|
+
* sees the id already present and writes nothing.
|
|
6629
|
+
*
|
|
6630
|
+
* 3. **These rows never go through `retain()`.** That path is for facts being
|
|
6631
|
+
* learned on-device: it dedupes and merges candidates against local rows and
|
|
6632
|
+
* mints its own ids, both of which would break (2). A photo memory is not a
|
|
6633
|
+
* candidate to be reconciled against the vault — it is an already-decided
|
|
6634
|
+
* fact the server has published.
|
|
6635
|
+
*
|
|
6636
|
+
* The rows are written `visibility: "public"` because they genuinely ARE
|
|
6637
|
+
* published — the reconciler reads local visibility as the user's intent, and
|
|
6638
|
+
* anything else would make it immediately revoke a memory the user never turned
|
|
6639
|
+
* off. They carry `source: SOURCE_PHOTO`, which is what exempts them from
|
|
6640
|
+
* decay's auto-archive; see the note there for why archiving one would silently
|
|
6641
|
+
* unpublish it.
|
|
6642
|
+
*
|
|
6643
|
+
* No embedding is computed here. `searchTool`'s un-embedded lane embeds any row
|
|
6644
|
+
* lacking a vector at search time, uses it in that same search and persists it
|
|
6645
|
+
* via `updateVaultMemoryEmbeddingOp` — so a row ingested without one is picked
|
|
6646
|
+
* up on first recall rather than costing an embedding call at ingest.
|
|
6647
|
+
*/
|
|
6648
|
+
|
|
6649
|
+
/**
|
|
6650
|
+
* One row of `GET /api/memories/published`, narrowed to what ingest needs.
|
|
6651
|
+
*
|
|
6652
|
+
* Deliberately structural rather than an import from the transport client: this
|
|
6653
|
+
* op is in the SDK and the two hand-written nearby clients live in the app, so
|
|
6654
|
+
* a shared nominal type would drag one across a package boundary for no gain.
|
|
6655
|
+
*/
|
|
6656
|
+
interface PublishedPhotoMemory {
|
|
6657
|
+
/** The server-minted memory id. `photo:<feedItemID>:fact:NN` or `:caption`. */
|
|
6658
|
+
memoryId: string;
|
|
6659
|
+
/** The projected fact text. */
|
|
6660
|
+
text: string;
|
|
6661
|
+
/** The photo(s) this fact was read out of. */
|
|
6662
|
+
media?: PhotoMediaRef[] | null;
|
|
6663
|
+
/** When the event in the memory happened, if the server knows. */
|
|
6664
|
+
eventTime?: {
|
|
6665
|
+
start: number | null;
|
|
6666
|
+
end: number | null;
|
|
6667
|
+
kind: "point" | "range" | "ongoing" | null;
|
|
6668
|
+
} | null;
|
|
6669
|
+
/** True when the text is the user's own words (a kept caption). */
|
|
6670
|
+
userAuthored?: boolean;
|
|
6671
|
+
}
|
|
6672
|
+
/** What one ingest pass did, for the caller's logs and tests. */
|
|
6673
|
+
interface PhotoIngestResult {
|
|
6674
|
+
/** Rows newly written to the vault. */
|
|
6675
|
+
inserted: number;
|
|
6676
|
+
/** Rows already present, left untouched. */
|
|
6677
|
+
skipped: number;
|
|
6678
|
+
}
|
|
6679
|
+
/**
|
|
6680
|
+
* Write the published photo memories this vault does not already have.
|
|
6681
|
+
*
|
|
6682
|
+
* Idempotent on `memoryId`: a row whose id is already in the vault is counted as
|
|
6683
|
+
* skipped and NOT rewritten, even when the server's text has since changed.
|
|
6684
|
+
* That is deliberate — the local row is the user's copy, they may have edited
|
|
6685
|
+
* it, and silently overwriting an edit to match the server would be the same
|
|
6686
|
+
* class of bug as publishing a version the user has since changed. Re-ingesting
|
|
6687
|
+
* changed text is a follow-up that needs a merge decision, not a clobber.
|
|
6688
|
+
*
|
|
6689
|
+
* Non-`photo:` ids are ignored: everything else in the published set is a
|
|
6690
|
+
* client-published memory that by definition already lives in this vault (or in
|
|
6691
|
+
* another device's, which is not ours to recreate).
|
|
6692
|
+
*/
|
|
6693
|
+
declare function ingestPublishedPhotoMemoriesOp(ctx: VaultMemoryOperationsContext, rows: PublishedPhotoMemory[]): Promise<PhotoIngestResult>;
|
|
6694
|
+
|
|
6549
6695
|
/**
|
|
6550
6696
|
* Queue Types
|
|
6551
6697
|
*
|
|
@@ -7045,6 +7191,15 @@ declare function createChunkVectorCache(maxSize?: number): ChunkVectorCache;
|
|
|
7045
7191
|
* shared purge buffer for every row, so an already-archived manual memory is
|
|
7046
7192
|
* still deleted after the window (the archived check runs before the manual
|
|
7047
7193
|
* short-circuit by design).
|
|
7194
|
+
*
|
|
7195
|
+
* `source === "photo"` (server-extracted photo memories) is protected the same
|
|
7196
|
+
* way, and for a sharper reason than curation: those rows are PUBLISHED, and
|
|
7197
|
+
* auto-archiving one would silently un-publish it. Archived rows drop out of the
|
|
7198
|
+
* default vault read, the publish reconciler builds its desired set from that
|
|
7199
|
+
* read, and anything it previously adopted but no longer sees goes into
|
|
7200
|
+
* `toRevoke` — so an age-archive at the medium TTL would revoke a memory from
|
|
7201
|
+
* the server that the user never switched off. Revoking is the user's decision
|
|
7202
|
+
* and has exactly one entry point: the publish switch.
|
|
7048
7203
|
*/
|
|
7049
7204
|
/** The verdict for a single memory. */
|
|
7050
7205
|
type DecayVerdict = "keep" | "archive" | "delete";
|
|
@@ -9195,8 +9350,11 @@ declare function useChatStorage(options: UseChatStorageOptions): UseChatStorageR
|
|
|
9195
9350
|
* unreadable flag would fail open. Existing rows stay NULL (= legacy,
|
|
9196
9351
|
* unknown provenance, embedded as before) with no backfill, matching the v37
|
|
9197
9352
|
* read-time-fallback precedent
|
|
9353
|
+
* - v45: Added `media` to memory_vault — the photo(s) a server-extracted
|
|
9354
|
+
* memory came from, as JSON `[{feed_item_id, object_key}]`. Null on every
|
|
9355
|
+
* row that did not come from a photo, which is all of them before this
|
|
9198
9356
|
*/
|
|
9199
|
-
declare const SDK_SCHEMA_VERSION =
|
|
9357
|
+
declare const SDK_SCHEMA_VERSION = 45;
|
|
9200
9358
|
/**
|
|
9201
9359
|
* Combined WatermelonDB schema for all SDK storage modules.
|
|
9202
9360
|
*
|
|
@@ -9808,4 +9966,4 @@ declare function refreshNotionAccessToken(params: NotionRefreshTokenParams): Pro
|
|
|
9808
9966
|
*/
|
|
9809
9967
|
declare function createNotionTools(getAccessToken: () => string | null, requestNotionAccess: () => Promise<string>): ToolConfig[];
|
|
9810
9968
|
|
|
9811
|
-
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 };
|
|
9969
|
+
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 };
|