@anuma/sdk 5.0.3 → 5.1.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.
@@ -407,7 +407,7 @@ type LlmapiResponseReasoning = {
407
407
  */
408
408
  summary?: string;
409
409
  };
410
- type LlmapiResponseResponse = {
410
+ type LlmapiResponseResponse$1 = {
411
411
  /**
412
412
  * ClientInjectedTools are tool names the client provided in the original request.
413
413
  */
@@ -1234,6 +1234,30 @@ type LlmapiChatCompletionUsage = OpenaiCompletionUsage & {
1234
1234
  * strategies/completions.ts `buildFinalResponse`. See that TODO for the full
1235
1235
  * deprecation plan.
1236
1236
  */
1237
+ /**
1238
+ * Add the Responses API's terminal-state fields, which the portal's generated
1239
+ * schema does not declare.
1240
+ *
1241
+ * Without them the two transports are asymmetric: a completions consumer reads
1242
+ * `choices[0].finish_reason` and can see a turn cut off at the output ceiling,
1243
+ * while a Responses consumer has no field to read at all — the truncation the
1244
+ * SDK *did* detect (see the normalization in `strategies/responses.ts`) died at
1245
+ * the stream boundary. `runToolLoop` works around this with `terminalState` on
1246
+ * its own result, but a caller holding only a response object cannot (#805).
1247
+ *
1248
+ * These are standard OpenAI Responses fields, so this widens the type toward
1249
+ * the wire rather than inventing shape: they are optional because a
1250
+ * non-streaming direct call returns only what the portal serializes today.
1251
+ * Drop the override once the portal declares them upstream.
1252
+ */
1253
+ type LlmapiResponseResponse = LlmapiResponseResponse$1 & {
1254
+ /** `"completed"` | `"incomplete"` — the turn's own status, not an output item's. */
1255
+ status?: string;
1256
+ /** Present when `status` is `"incomplete"`; `"max_output_tokens"` is a truncation. */
1257
+ incomplete_details?: {
1258
+ reason?: string;
1259
+ };
1260
+ };
1237
1261
  type LlmapiChatCompletionResponse = Omit<LlmapiChatCompletionResponse$1, "usage"> & {
1238
1262
  usage?: LlmapiChatCompletionUsage;
1239
1263
  inference_id?: string;
@@ -2428,6 +2452,21 @@ type StepFinishEvent = {
2428
2452
  inputTokens?: number;
2429
2453
  outputTokens?: number;
2430
2454
  };
2455
+ /**
2456
+ * The round's own finish reason, as the provider sent it — `"length"` means
2457
+ * this round hit the output ceiling.
2458
+ *
2459
+ * Per-round, not per-turn: a round can truncate and the loop still recover on
2460
+ * the next one, which is why the loop does not treat it as an error on its
2461
+ * own (see the truncation guard below). Without it a consumer watching steps
2462
+ * cannot tell a round that said everything it meant to from one that was cut
2463
+ * off mid-argument — they differ only in this field (#805).
2464
+ *
2465
+ * Absent when the provider sent no finish reason. Note that no step event
2466
+ * fires for the round that *ends* a turn, so use {@link RunTerminalState} on
2467
+ * the result for the final round.
2468
+ */
2469
+ finishReason?: string;
2431
2470
  };
2432
2471
  /**
2433
2472
  * Terminal state of the LAST model response in the turn, normalized to the
@@ -2435,13 +2474,14 @@ type StepFinishEvent = {
2435
2474
  * specific values). `undefined` when the stream carried no finish reason at all.
2436
2475
  *
2437
2476
  * Exposed because neither response shape reliably carries it out to a caller.
2438
- * The Responses API shape has no field for it — `LlmapiResponseResponse` declares
2439
- * neither `status` nor `incomplete_details` — so `buildFinalResponse` cannot
2440
- * surface truncation there even though the loop detected it (`responses.ts`
2441
- * normalizes it onto the accumulator). Completions does expose
2442
- * `choices[0].finish_reason`, but omits `tool_calls` entirely when there are
2443
- * none, so a caller sniffing the response cannot tell "no tool calls" from
2444
- * "field absent".
2477
+ * The Responses shape now carries `status` / `incomplete_details` — added in
2478
+ * `clientCompat` and emitted by `buildFinalResponse` — but only in the
2479
+ * Responses vocabulary, so a caller reading it has to translate
2480
+ * `incomplete_details.reason === "max_output_tokens"` itself. Completions
2481
+ * exposes `choices[0].finish_reason`, but omits `tool_calls` entirely when
2482
+ * there are none, so a caller sniffing the response cannot tell "no tool calls"
2483
+ * from "field absent". This field answers both questions in one vocabulary,
2484
+ * for either transport.
2445
2485
  *
2446
2486
  * The loop already knows both, unambiguously and identically for either API.
2447
2487
  * Reporting them here means callers and test harnesses stop reverse-engineering
@@ -8017,6 +8057,298 @@ declare function extractAndLinkEntitiesForMemoriesOp(ctx: VaultMemoryOperationsC
8017
8057
  now?: number;
8018
8058
  }): Promise<TopicExtractionRunResult>;
8019
8059
 
8060
+ /**
8061
+ * Post-hoc support verification for extracted memories (#707).
8062
+ *
8063
+ * A stored memory's `confidence` is the extractor's own self-report at
8064
+ * extraction time — clamped to [0,1] and filtered at >= 0.7 (see
8065
+ * `validateCandidates` in autoExtract.ts) — and nothing re-checks it
8066
+ * afterwards. So a hallucinated or mis-attributed fact with confidence 0.9 is
8067
+ * byte-for-byte indistinguishable from a well-grounded one. That was tolerable
8068
+ * while memories only fed recall (a wrong fact meant a bad answer). People
8069
+ * Nearby publishes memory TEXT to public profiles and into digital-twin
8070
+ * prompts, where the same wrong fact is user-visible and attributed to the
8071
+ * user.
8072
+ *
8073
+ * This module asks one question per memory, entailment-style: is this fact
8074
+ * stated or clearly implied by the messages it was extracted from? It reads
8075
+ * the provenance already on the row (`source_chunk_ids`, schema v28) and
8076
+ * WRITES NOTHING — it returns verdicts and the caller decides what to do with
8077
+ * them. #707 is explicit that a failing memory is flagged for user review and
8078
+ * never silently deleted; a pass with no write path cannot violate that.
8079
+ *
8080
+ * WHERE IT MOUNTS. Deliberately NOT inside `setMemoryVisibilityOp`. That op
8081
+ * takes a `VaultMemoryOperationsContext` (database + collection + wallet — no
8082
+ * portal auth, no fetch), runs inside WatermelonDB's serialized writer, and is
8083
+ * also the REVOKE path, which must never be gated on a network call. It is
8084
+ * also not the authority on what is published: its own contract says the
8085
+ * server index is (operations.ts). So verification composes BEFORE it — the
8086
+ * caller verifies, decides, and then calls `setMemoryVisibilityOp` for the
8087
+ * memories it is publishing. The only thing that seam presupposes is "verify
8088
+ * runs before publish"; it assumes nothing about a client publish flow, which
8089
+ * does not exist yet.
8090
+ *
8091
+ * FOUR OUTCOMES, NOT TWO. "Could not be verified" is not the same claim as
8092
+ * "failed verification", and neither is "the verifier itself was unavailable".
8093
+ * Collapsing them would let a broken judge, a deleted conversation, or a
8094
+ * manually-written memory all read as "unsupported" — i.e. would surface a
8095
+ * scary review flag for something that was never even in question. The three
8096
+ * ways provenance can be unusable are kept distinct and are all decided
8097
+ * LOCALLY, before any content leaves the device:
8098
+ *
8099
+ * 1. `not-auto-extracted` — `source` is manual/capsule/legacy-null, so this
8100
+ * device's extractor did not write the row and there is no local chat
8101
+ * turn it was derived from. Entailment against local history is
8102
+ * inapplicable, not merely unavailable. Note the narrower claim: only
8103
+ * `manual` is reliably the user's own words. `source` records how the
8104
+ * LOCAL row was created, and a `capsule` import can carry content that
8105
+ * was auto-extracted somewhere else — its chunk ids could not resolve
8106
+ * here either way, but it is not "the user wrote this", so UI copy must
8107
+ * not say so. Nothing about these memories is sent to the portal.
8108
+ * 2. `no-provenance` — auto-extracted but `sourceChunkIds` is null/empty: the
8109
+ * H4 case where extraction found no usable source ids and no fallback
8110
+ * message either (retain.ts only writes the column when the array is
8111
+ * non-empty). Not pre-v28 rows: v28 added `source` and `source_chunk_ids`
8112
+ * in the same migration and nothing backfills `source`, so a legacy row
8113
+ * has no label to be auto-extracted BY and lands in bucket 1 instead.
8114
+ * 3. `sources-missing` — the ids are there but none of them resolve. Chat
8115
+ * messages are hard-deleted (`destroyPermanently`), so provenance
8116
+ * routinely outlives the evidence; the same bucket also catches a client
8117
+ * whose message ids were never chat-row ids, since the extraction
8118
+ * pipeline stores whatever ids the caller passed to `processTurn`.
8119
+ *
8120
+ * A source read that FAILS is none of those three. It is transient, so it goes
8121
+ * to `unchecked`/`sources-unavailable` alongside the judge being down —
8122
+ * "sources are gone" and "the database was locked for a second" must not land
8123
+ * a user in the same place, since only one of them is worth retrying.
8124
+ *
8125
+ * PARTIAL resolution is not a further failure: the memory is verified against
8126
+ * the sources that survive, and `droppedSourceCount` reports the rest so a
8127
+ * caller can caveat the verdict.
8128
+ *
8129
+ * KNOWN SOURCE OF FALSE FLAGS. Extraction's H4 fallback attributes a candidate
8130
+ * with missing/mangled source ids to the last user message in the window and
8131
+ * persists no marker that it did so (autoExtract.ts). A genuine fact whose
8132
+ * evidence lives in some other message will therefore come back `unsupported`,
8133
+ * and post-hoc there is no way to tell that apart from a real miss. The verdict
8134
+ * is still literally true — the fact is not supported by its recorded
8135
+ * provenance — and #707's flag-for-review semantics absorb it. Evidence
8136
+ * truncation (see `maxEvidenceChars`) can do the same thing on very long source
8137
+ * messages. Both cost a review tap; neither can delete anything.
8138
+ *
8139
+ * SECURITY. This is a NEW portal egress surface for memory content, and unlike
8140
+ * the injection classifier it also sends raw CONVERSATION text as evidence, so
8141
+ * it is strictly wider — treat enabling it as such. Mitigations, in order:
8142
+ * - Nothing is sent for a memory that can be bucketed locally (above), so a
8143
+ * manual or imported memory never leaves the device on this path at all.
8144
+ * - Content is PII-redacted with the same redactor class as the extraction
8145
+ * and injection-classifier paths, and redaction here is OPT-OUT rather
8146
+ * than opt-in. Those paths inherit `extract.piiRedaction` from the caller
8147
+ * that runs them; this one has no such parent, so defaulting it off would
8148
+ * mean the SDK's widest memory egress ships raw whenever a client forgets
8149
+ * a flag. One shared instance per call, so a value redacted in the fact
8150
+ * gets the SAME placeholder in the evidence and entailment still lines up.
8151
+ * - The response is item numbers only, so nothing needs de-anonymizing.
8152
+ * - Judge injection: both slots carry text an attacker can reach — evidence
8153
+ * is raw user conversation, and a fact is whatever the extractor wrote
8154
+ * about a poisoned turn — so the framing is built so content cannot forge
8155
+ * either of the two things the prompt reasons over. STRUCTURE: facts
8156
+ * collapse to one line and every evidence line is indented, which leaves
8157
+ * the left margin — item headers, the MESSAGES: label, the truncation note,
8158
+ * our own framing lines — unreachable from content. ATTRIBUTION: the
8159
+ * resolver labels every evidence LINE with its speaker, because "support
8160
+ * must come from the USER's own words" is the prompt's load-bearing rule and
8161
+ * one label per MESSAGE would let a line break inside an assistant turn
8162
+ * render a forged `user:` line byte-identically to a real one. That second
8163
+ * invariant lives in `VerificationSources` rather than here: this module
8164
+ * indents text it cannot attribute, so a custom resolver owns its half.
8165
+ * Both halves treat a lone `\r` as a break (see `LINE_BREAK`), since the
8166
+ * question is what can start a VISUAL line, not what `split("\n")` sees.
8167
+ * Beyond structure, persuasion remains possible, and the output shape bounds
8168
+ * the blast radius both ways: a swayed "supported" leaves us exactly where
8169
+ * we are today with no verification at all, and a swayed "unsupported" costs
8170
+ * a review tap. Neither can write, publish, or delete.
8171
+ */
8172
+
8173
+ /**
8174
+ * The row fields verification reads. A `StoredVaultMemory` satisfies this
8175
+ * structurally, so callers pass their rows straight through; deriving it with
8176
+ * `Pick` keeps the field names and types tied to the row rather than
8177
+ * re-declared next to it.
8178
+ * @public
8179
+ */
8180
+ type MemoryToVerify = Pick<StoredVaultMemory, "uniqueId" | "content" | "source" | "sourceChunkIds">;
8181
+ /**
8182
+ * Why a memory could not be checked against its sources at all. Distinct from
8183
+ * a failed check — see this module's header.
8184
+ * @public
8185
+ */
8186
+ type UnverifiableReason =
8187
+ /** `source` is not "auto-extracted" — written by hand or imported, so no
8188
+ * local chat turn produced it and entailment does not apply. NOT a claim
8189
+ * that the user authored the text: an imported capsule may hold content
8190
+ * extracted elsewhere (see this module's header). */
8191
+ "not-auto-extracted"
8192
+ /** Auto-extracted but the row carries no source ids. */
8193
+ | "no-provenance"
8194
+ /** Source ids are recorded but none of them resolve any more. */
8195
+ | "sources-missing";
8196
+ /**
8197
+ * Why a memory that COULD have been checked wasn't. Never conflate with
8198
+ * `unsupported`: this says the verifier didn't run, not that the fact failed.
8199
+ * @public
8200
+ */
8201
+ type UncheckedReason =
8202
+ /** The portal call failed (no auth, network, non-2xx, exhausted retries). */
8203
+ "llm-unavailable"
8204
+ /** The batch exceeded `maxItems`, so this memory was never sent. */
8205
+ | "over-budget"
8206
+ /** At least one source read FAILED (locked DB, adapter error) rather than
8207
+ * coming back empty. Transient, so retryable — deliberately not
8208
+ * `sources-missing`, which claims the evidence is gone for good. */
8209
+ | "sources-unavailable";
8210
+ /**
8211
+ * One memory's verdict.
8212
+ *
8213
+ * Note what `unsupported` claims: the fact is not entailed by the provenance
8214
+ * RECORDED on the row, which is a weaker statement than "the fact is wrong".
8215
+ * Extraction's H4 fallback attributes a candidate with missing ids to the last
8216
+ * user message and persists no marker that it guessed, so a well-grounded fact
8217
+ * whose evidence lives in some other message lands here too, and post-hoc
8218
+ * nothing distinguishes it from a real miss (see this module's header). Review
8219
+ * copy should read as "we could not confirm this", not as an accusation.
8220
+ * @public
8221
+ */
8222
+ type MemoryVerification = {
8223
+ /** The memory's `uniqueId`, so results can be joined back to the input. */
8224
+ uniqueId: string;
8225
+ /** Source ids that resolved to real message text and were sent as evidence. */
8226
+ resolvedSourceCount: number;
8227
+ /** Source ids that produced no evidence — deleted messages, ids that were
8228
+ * never chat rows, or (on `sources-unavailable`) reads that failed. Adds up
8229
+ * with `resolvedSourceCount` to the memory's distinct source ids on every
8230
+ * status where resolution actually ran, and the status says which kind of
8231
+ * not-resolving happened. Both are 0 on the two statuses decided before any
8232
+ * read — `not-auto-extracted` and `no-provenance` — including for a
8233
+ * `not-auto-extracted` row that does carry ids (an import's ids belong to
8234
+ * another device, so they are never resolved here): 0/0 there means "we did
8235
+ * not look", not "the row had no sources". Non-zero alongside
8236
+ * `supported`/`unsupported` means the verdict rests on partial evidence. */
8237
+ droppedSourceCount: number;
8238
+ } & ({
8239
+ status: "supported" | "unsupported";
8240
+ } | {
8241
+ status: "unverifiable";
8242
+ reason: UnverifiableReason;
8243
+ } | {
8244
+ status: "unchecked";
8245
+ reason: UncheckedReason;
8246
+ });
8247
+ /**
8248
+ * How verification turns a stored source id into text to judge against.
8249
+ * Injected rather than assumed so this module stays storage-agnostic (and
8250
+ * testable without a database) — {@link createMessageSourceResolver} is the
8251
+ * default wiring over the chat store.
8252
+ * @public
8253
+ */
8254
+ interface VerificationSources {
8255
+ /**
8256
+ * Resolve one `sourceChunkIds` entry.
8257
+ *
8258
+ * Return null only when the id DEFINITIVELY resolves to nothing — the
8259
+ * message was deleted, or the id was never a message. That is a permanent
8260
+ * fact about the provenance and produces `unverifiable`/`sources-missing`.
8261
+ *
8262
+ * THROW when the read itself failed (locked database, adapter error, network
8263
+ * store). That is transient and produces `unchecked`/`sources-unavailable`,
8264
+ * so the caller can retry instead of telling a user their evidence is gone.
8265
+ * Verification catches the throw per id; it never propagates.
8266
+ *
8267
+ * An implementation that labels speakers — as
8268
+ * {@link createMessageSourceResolver} does, because the verifier weighs the
8269
+ * user's words differently from the assistant's — must label EVERY line of a
8270
+ * multi-line message, counting a lone `\r` as a break the way verification's
8271
+ * indentation does. Verification indents evidence but cannot see roles, so a
8272
+ * single leading label lets a break in the body forge a second speaker.
8273
+ */
8274
+ getSourceText(chunkId: string): Promise<string | null>;
8275
+ }
8276
+ /**
8277
+ * Auth + tuning for {@link verifyMemoriesForPublish}. Auth is the dual pattern
8278
+ * — one of `apiKey` / `getToken` is required at runtime (see
8279
+ * {@link PortalLlmAuth}); without it nothing is verified.
8280
+ * @public
8281
+ */
8282
+ interface VerifyMemoriesForPublishOptions extends PortalLlmAuth {
8283
+ baseUrl?: string;
8284
+ model?: string;
8285
+ /** Override fetch (tests). */
8286
+ fetchFn?: typeof fetch;
8287
+ /** Max portal attempts on a TRANSIENT failure. Default 2. */
8288
+ maxAttempts?: number;
8289
+ /** Absolute wall-clock budget across attempts. Default 20s. */
8290
+ totalTimeoutMs?: number;
8291
+ /** Backoff before each retry (ms). Tests pass `() => 0`. */
8292
+ backoffMs?: (attempt: number) => number;
8293
+ /**
8294
+ * PII redaction for the outbound fact + evidence.
8295
+ *
8296
+ * OPT-OUT: defaults to ON (a fresh per-call redactor) when omitted, the same
8297
+ * posture as the LLM decay classifier. This is a standalone entry point — there
8298
+ * is no `extract.piiRedaction` upstream of it to inherit from the way the
8299
+ * injection classifier and consolidation inherit theirs — so an off-by-
8300
+ * default switch would mean the widest memory egress in the SDK (fact text
8301
+ * PLUS raw conversation) shipping raw unless a client remembered a flag.
8302
+ * Pass `false` to deliberately disable it.
8303
+ *
8304
+ * Pass a shared {@link PiiRedactor} to keep placeholder numbering consistent
8305
+ * with other calls in the same session. Either way ONE instance covers a
8306
+ * whole call, so the same value redacts to the same placeholder in the fact
8307
+ * and in the evidence — with two instances entailment would break on every
8308
+ * redacted value.
8309
+ */
8310
+ piiRedaction?: boolean | PiiRedactor;
8311
+ /** Max memories verified in one call; the rest come back `unchecked`
8312
+ * (`over-budget`). Default 20. */
8313
+ maxItems?: number;
8314
+ /** Per-memory cap on joined evidence characters. Default 2000. */
8315
+ maxEvidenceChars?: number;
8316
+ }
8317
+ /**
8318
+ * Verify each memory against the messages it was extracted from, in input
8319
+ * order. Makes at most ONE portal call, and none at all when every memory can
8320
+ * be bucketed locally.
8321
+ *
8322
+ * Writes nothing and publishes nothing — the caller reads the verdicts,
8323
+ * decides (per #707: flag the failures for user review, never delete), and
8324
+ * calls `setMemoryVisibilityOp` for whatever it goes on to publish.
8325
+ *
8326
+ * @public
8327
+ */
8328
+ declare function verifyMemoriesForPublish(memories: readonly MemoryToVerify[], sources: VerificationSources, options: VerifyMemoriesForPublishOptions): Promise<MemoryVerification[]>;
8329
+ /**
8330
+ * Default {@link VerificationSources} over the chat store: resolves a source id
8331
+ * to its message text, role-prefixed per LINE so the verifier can apply the same
8332
+ * "the USER must have said it" rule the extractor does without the message body
8333
+ * being able to forge a speaker. Decryption is the ops layer's job — pass the
8334
+ * same `StorageOperationsContext` the rest of the chat reads go through.
8335
+ *
8336
+ * Returns null for an id that no longer resolves, which is the common case
8337
+ * rather than an error: messages are hard-deleted, and the ids on a memory are
8338
+ * whatever the client handed `processTurn`, which the SDK never required to be
8339
+ * chat rows.
8340
+ *
8341
+ * Storage failures are deliberately NOT swallowed here. `getMessageOp` already
8342
+ * separates the two — null for "not found", a throw for a locked DB or adapter
8343
+ * failure — and flattening that would report a broken read as permanently
8344
+ * missing evidence. The throw propagates into verification, which catches it
8345
+ * per id and returns `unchecked`/`sources-unavailable`; nothing reaches the
8346
+ * caller as an exception.
8347
+ *
8348
+ * @public
8349
+ */
8350
+ declare function createMessageSourceResolver(ctx: StorageOperationsContext): VerificationSources;
8351
+
8020
8352
  /**
8021
8353
  * Text Chunking Utilities
8022
8354
  *
@@ -9393,4 +9725,4 @@ declare function refreshNotionAccessToken(params: NotionRefreshTokenParams): Pro
9393
9725
  */
9394
9726
  declare function createNotionTools(getAccessToken: () => string | null, requestNotionAccess: () => Promise<string>): ToolConfig[];
9395
9727
 
9396
- export { type AutoExtractMessage, type AutoExtractor, type Budget, type CachedChunkVectors, type CachedServerTools, Conversation as ChatConversation, Message as ChatMessage, type ChatRole, type ChunkVectorCache, type ChunkingOptions, type ConsolidationFallbackReason, type ConversationMemoryInput, ConversationMemory as ConversationMemoryModel, type ConversationMemoryOperationsContext, type CreateAutoExtractorOptions, type CreateConversationOptions, type CreateDecaySweeperOptions, type CreateMessageOptions, type CreateVaultFolderOptions, type CreateVaultMemoryOptions, type CryptoPriceClassification, type CryptoPricePreProcessorOptions, DEFAULT_CACHE_EXPIRATION_MS, DEFAULT_CHUNK_CACHE_SIZE, DEFAULT_CHUNK_OVERLAP, DEFAULT_CHUNK_SIZE, DEFAULT_DECAY_POLICY, DEFAULT_MAX_CLASSIFIER_CALLS_PER_SWEEP, DEFAULT_MIN_CHUNK_SIZE, DEFAULT_PROFILE_FACETS, DEFAULT_PROFILE_FACT_TYPE_WEIGHTS, DEFAULT_PROFILE_PROOF_ALPHA, DEFAULT_PROFILE_TREND_MULTIPLIERS, DEFAULT_VAULT_CACHE_SIZE, DatabaseManager, type DatabaseManagerLogger, type DatabaseManagerOptions, type DecayCandidateRaw, type DecayClassifier, type DecayInput, type DecayPolicy, type DecaySweepResult, type DecaySweeper, type DecayVerdict, ENTITY_FANOUT, type EmbeddedWalletSignerFn, EncryptionKeyMissingError, type ExtractFactsOptions, type ExtractOutcome, type ExtractedCandidate, type ExtractedEntity, type ExtractionCursorStore, type FactType, type FileMetadata, type FlushResult, type GetConversationsPageOptions, type GetMessagesPageOptions, type GraphTraversalOptions, HARD_DELETE_WINDOW_MS, INFERENCE_ID_HEADER, type InjectionClassifierOptions, type InjectionReason, type LazyStoredConversation, type LlmDecayClassifierOptions, type LlmNeighborRefinerOptions, type Logger, LoggerProvider, type LoggerProviderProps, MAX_HOPS, MEDIUM_TTL_MS, type MemoriesNeedingTopicExtraction, type EmbeddingOptions as MemoryEngineEmbeddingOptions, type MemoryEngineResult, type MemoryEngineSearchOptions, type MemoryExtractedEvent, type MemoryKind, type MemoryQuarantinedEvent, type MemoryVaultSearchOptions, type MemoryVaultToolOptions, type MessageRedactionResult, type MessageSkeleton, NEVER_TTL_MS, NODE_BUDGET, NOTION_OAUTH_CONFIG, type NeighborRefiner, type NotionAuthUrlParams, type NotionClientRegistration, type NotionExchangeCodeParams, type NotionOAuthEndpoints, type NotionPKCEChallenge, type NotionRefreshTokenParams, type NotionTokenResponse, type NowSource, type ObservationTrend, type ObservationTrendInput, PAST_EVENT_GRACE_MS, PII_PATTERNS, PROFILE_DOC_VERSION, type PiiCategory, type PiiMatch, type PiiPattern, PiiRedactor, type PiiRedactorOptions, type PlatformStorage, type PortalLlmAuth, type ProfileConfigFingerprint, type ProfileDoc, type ProfileFacet, type ProfileFacetKey, type ProfileSalienceInput, type ProfileSection, type PromptPreProcessor, type PromptPreProcessorContext, type QuantizedEmbedding, type QuarantinedMemoryInfo, QueueManager, type QueueStatus, RECALL_MAX_LIMIT, RECALL_TOOL_NAME, type RankedMemory, type RankedProfileCandidate, type RecallContext, type RecallDegradation, type RecallDiagnostics, type RecallOptions, type RecallResult, type RecallToolCallbacks, type RecallToolOptions, type RecencyOptions, type RedactionResult, type ReflectOptions, type ReflectResult, type RequestEncryptionKeyOptions, RerankerUnavailableError, type ResumeStreamOptions, type ResumeStreamResult, type ResumeStreamWithStorageResult, type RetainAction, type RetainContext, type RetainOptions, type RetainResult, type RetainSource, SDK_SCHEMA_VERSION, SHORT_TTL_MS, STREAM_RESUMABLE_HEADER, type ScoreBreakdown, type ScoreProfileSalienceOptions, type ScreenResult, type ScreenedCandidate, type SearchSource, type SendMessageWithStorageArgs, type SendMessageWithStorageDetachedResult, type SendMessageWithStorageResult, type ServerToolsOptions, type ServerToolsResponse, type SignMessageFn, type StockPriceClassification, type StockPricePreProcessorOptions, type ChatCompletionUsage as StoredChatCompletionUsage, type StoredConversation, type StoredConversationMemory, type StoredMessage, type StoredMessageWithSimilarity, type StoredVaultFolder, VaultFolder as StoredVaultFolderModel, type StoredVaultMemory, VaultMemory as StoredVaultMemoryModel, StreamExpiredError, type StreamMetaEvent, type StreamResumeHandle, type SynthesizeProfileOptions, TOPICS_EXTRACTION_VERSION, TOPIC_EXTRACTION_BATCH_SIZE, TREND_RECENT_WINDOW_DAYS, TREND_STALE_WINDOW_DAYS, type TextChunk, type TopicExtractOptions, type TopicExtractionInput, type TopicExtractionRunResult, type TurnCompleteEvent, type TurnSkippedEvent, type UpdateVaultFolderOptions, type UpdateVaultMemoryOptions, type UseChatStorageOptions, type UseChatStorageResult, type UseCreditsOptions, type UseCreditsResult, type UseModelsOptions, type UseModelsResult, VAULT_SIZE_HOP_CAP, type VaultEmbeddingCache, type VaultFolderOperationsContext, type VaultMemoryOperationsContext, type VaultMemoryVisibility, type VaultSaveOperation, type VaultSearchResult, WalletPoller, type WeatherClassification, type WeatherPreProcessorOptions, type WebSearchClassification, type WebSearchPreProcessorOptions, addConversationMemoriesOp, archiveVaultMemoryOp, backfillMemoryTopicsOp, buildNotionAuthUrl, capHopsForDensity, chatStorageMigrations, chatStorageSchema, chunkAndEmbedAllMessages, chunkAndEmbedMessage, chunkText, classifyCryptoPrice, classifyCryptoPriceBatch, classifyDecay, classifyInjectionCandidates, classifyObservationTrend, classifyStockPrice, classifyStockPriceBatch, classifyWeather, classifyWeatherBatch, classifyWebSearch, classifyWebSearchBatch, clearAllEncryptionKeys, clearAllEncryptionState, clearConversationMemoriesOp, clearEncryptionKey, clearLazyTitleCache, clearServerToolsCache, consoleLogger, conversationMemoryToStored, cosineInt8, createAutoExtractor, createChunkVectorCache, createCryptoPricePreProcessor, createDecaySweeper, createLlmDecayClassifier, createLlmNeighborRefiner, createMemoryEngineTool, createMemoryVaultSearchTool, createMemoryVaultTool, createNotionTools, createPlatformCursorStore, createRecallTool, createStockPricePreProcessor, createStreamingDeAnonymizer, createVaultEmbeddingCache, createVaultFolderOp, createVaultMemoriesBatchOp, createVaultMemoryOp, createWeatherPreProcessor, createWebSearchPreProcessor, decryptConversationTitle, deleteAllVaultMemoriesForUserOp, deleteVaultFolderOp, deleteVaultMemoryOp, dequantizeEmbedding, discoverNotionOAuthEndpoints, eagerEmbedContent, embedAllMessages, embedMessage, ensureDefaultFoldersOp, exchangeNotionCode, extractAndLinkEntitiesForMemoriesOp, extractAndRetain, extractEntitiesForMemories, extractFacts, generateConversationId, generateEmbedding, generateEmbeddings, generateNotionPKCE, getAllVaultFoldersOp, getAllVaultMemoriesOp, getAllVaultMemoryContentsOp, getCachedServerTools, getConversationMemoriesOp, getConversationsByProjectLazyOp, getConversationsLazyOp, getConversationsPageOp, getDecayCandidatesRawOp, getLogger, getMemoriesNeedingTopicExtractionOp, getServerTools, getUnfiledVaultMemoriesOp, getVaultFolderMemoryCountOp, getVaultMemoryOp, hardDeleteDecayedOp, hasEncryptionKey, injectionSignatureCatalog, isPiiRedactor, isRerankerAvailable, moveMemoriesToFolderOp, noopLogger, onKeyAvailable, preEmbedVaultMemories, quantizeEmbedding, queueManager, rankProfileCandidates, recall, reflect, refreshEncryptionKeyIfMatches, refreshNotionAccessToken, registerNotionClient, relinkMemoryTopicsOp, requestEncryptionKey, resolvePiiRedactor, restoreVaultMemoryOp, resumeStream, retain, scoreProfileSalience, screenCandidatesForInjection, sdkMigrations, sdkModelClasses, sdkSchema, searchVaultMemories, seedEncryptionKeys, setLogger, setMemoryVisibilityOp, shouldChunkMessage, stampTopicsExtractedAtOp, streamCancelPath, streamReplayPath, summarizeObservationTrends, supersedeVaultMemoryOp, synthesizeProfile, traverseGraphLane, ttlForType, updateVaultFolderContextOp, updateVaultFolderOp, updateVaultMemoryEmbeddingOp, updateVaultMemoryOp, upsertMessageOp, useChat, useChatStorage, useCredits, useEncryption, useModels, xhrTransport };
9728
+ 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 };