@anuma/sdk 6.7.2 → 6.8.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.
Files changed (32) hide show
  1. package/dist/{react/chunk-B5UPJRCU.mjs → expo/chunk-CJ32HO6Q.mjs} +62 -11
  2. package/dist/expo/{chunk-VOMDHMKH.mjs → chunk-OUFITMDL.mjs} +1 -1
  3. package/dist/expo/{chunk-2YHVYDEL.mjs → chunk-YO5UXOC4.mjs} +3 -2
  4. package/dist/{react/consolidate-ZCGS7QUA.mjs → expo/consolidate-4BMNVOL4.mjs} +3 -2
  5. package/dist/expo/index.cjs +101 -18
  6. package/dist/expo/index.d.mts +105 -2
  7. package/dist/expo/index.d.ts +105 -2
  8. package/dist/expo/index.mjs +34 -10
  9. package/dist/expo/{recall-M3JVFTZL.mjs → recall-IEKVX4JL.mjs} +2 -2
  10. package/dist/index.cjs +10 -0
  11. package/dist/index.d.mts +49 -1
  12. package/dist/index.d.ts +49 -1
  13. package/dist/index.mjs +8 -0
  14. package/dist/{expo/chunk-B5UPJRCU.mjs → react/chunk-CJ32HO6Q.mjs} +62 -11
  15. package/dist/react/{chunk-2ARMO2NN.mjs → chunk-DY5VGC6K.mjs} +1 -1
  16. package/dist/react/{chunk-S6WPXD5N.mjs → chunk-POCLKALT.mjs} +3 -2
  17. package/dist/{expo/consolidate-TWE6OSSZ.mjs → react/consolidate-5TP3J6BY.mjs} +3 -2
  18. package/dist/react/index.cjs +101 -18
  19. package/dist/react/index.d.mts +105 -2
  20. package/dist/react/index.d.ts +105 -2
  21. package/dist/react/index.mjs +34 -10
  22. package/dist/react/{recall-ROEK55FJ.mjs → recall-B2AIAPCM.mjs} +2 -2
  23. package/dist/server/{chunk-TD7SMY7C.mjs → chunk-FS6DNUNT.mjs} +3 -2
  24. package/dist/server/{chunk-VHWLLYKO.mjs → chunk-KF5OU4IN.mjs} +62 -11
  25. package/dist/server/{chunk-CR5P3YIK.mjs → chunk-MEQ2PAEX.mjs} +1 -1
  26. package/dist/server/{consolidate-FWYK5KXB.mjs → consolidate-QDWEYFTZ.mjs} +3 -2
  27. package/dist/server/index.cjs +101 -18
  28. package/dist/server/index.d.mts +105 -2
  29. package/dist/server/index.d.ts +105 -2
  30. package/dist/server/index.mjs +34 -10
  31. package/dist/server/{recall-CGDEW2LQ.mjs → recall-2GAPE2XH.mjs} +2 -2
  32. package/package.json +1 -1
@@ -4795,6 +4795,18 @@ var init_internalFlowMarker = __esm({
4795
4795
  }
4796
4796
  });
4797
4797
 
4798
+ // src/lib/taskType.ts
4799
+ function taskTypeHeader(taskType) {
4800
+ return taskType ? { [TASK_TYPE_HEADER]: taskType } : {};
4801
+ }
4802
+ var TASK_TYPE_HEADER;
4803
+ var init_taskType = __esm({
4804
+ "src/lib/taskType.ts"() {
4805
+ "use strict";
4806
+ TASK_TYPE_HEADER = "X-Anuma-Task-Type";
4807
+ }
4808
+ });
4809
+
4798
4810
  // src/lib/db/entities/types.ts
4799
4811
  function normalizeEntityName(name) {
4800
4812
  return name.trim().toLowerCase();
@@ -6429,9 +6441,15 @@ async function callPortalJsonCompletion(req) {
6429
6441
  const maxAttempts = Math.max(1, req.maxAttempts ?? 3);
6430
6442
  const startedAt = Date.now();
6431
6443
  const overBudget = () => req.totalTimeoutMs !== void 0 && Date.now() - startedAt >= req.totalTimeoutMs;
6444
+ let lastFailure;
6445
+ const giveUp = () => {
6446
+ req.onFailure?.(lastFailure ?? { reason: "network", attempts: maxAttempts });
6447
+ return null;
6448
+ };
6432
6449
  for (let attempt = 1; attempt <= maxAttempts; attempt++) {
6433
6450
  if (attempt > 1 && overBudget()) {
6434
6451
  log.warn(`[${req.tag}] over time budget before attempt ${attempt}, giving up`);
6452
+ lastFailure = { reason: "time-budget-exhausted", attempts: attempt - 1 };
6435
6453
  break;
6436
6454
  }
6437
6455
  const attemptReq = req.totalTimeoutMs !== void 0 ? {
@@ -6443,9 +6461,14 @@ async function callPortalJsonCompletion(req) {
6443
6461
  } : req;
6444
6462
  const outcome = await attemptPortalJson(attemptReq, endpoint);
6445
6463
  if (outcome.kind === "ok") return outcome.value;
6464
+ lastFailure = {
6465
+ reason: outcome.code,
6466
+ ...outcome.httpStatus !== void 0 && { httpStatus: outcome.httpStatus },
6467
+ attempts: attempt
6468
+ };
6446
6469
  if (outcome.kind === "terminal") {
6447
6470
  log.warn(`[${req.tag}] ${outcome.reason}`);
6448
- return null;
6471
+ return giveUp();
6449
6472
  }
6450
6473
  if (attempt >= maxAttempts) {
6451
6474
  log.warn(`[${req.tag}] ${outcome.reason} \u2014 attempt ${attempt}/${maxAttempts}, giving up`);
@@ -6457,19 +6480,21 @@ async function callPortalJsonCompletion(req) {
6457
6480
  log.warn(
6458
6481
  `[${req.tag}] ${outcome.reason} \u2014 attempt ${attempt}/${maxAttempts}, over time budget, giving up`
6459
6482
  );
6483
+ lastFailure = { reason: "time-budget-exhausted", attempts: attempt };
6460
6484
  break;
6461
6485
  }
6462
6486
  log.warn(`[${req.tag}] ${outcome.reason} \u2014 attempt ${attempt}/${maxAttempts}, retrying`);
6463
6487
  if (delay > 0) await sleep3(delay);
6464
6488
  }
6465
- return null;
6489
+ return giveUp();
6466
6490
  }
6467
6491
  async function attemptPortalJson(req, endpoint) {
6468
6492
  const baseUrl = req.baseUrl ?? defaultBaseUrl();
6469
6493
  const fetchImpl = req.fetchFn ?? fetch;
6470
6494
  const timeoutMs = req.timeoutMs ?? 6e4;
6471
6495
  const authHeaders = await resolvePortalAuthHeaders(req, req.tag);
6472
- if (authHeaders === null) return { kind: "terminal", reason: "auth unavailable (no token)" };
6496
+ if (authHeaders === null)
6497
+ return { kind: "terminal", code: "auth-unavailable", reason: "auth unavailable (no token)" };
6473
6498
  const isAnthropic = req.model.startsWith("anthropic/");
6474
6499
  const prefill = isAnthropic ? "{" : "";
6475
6500
  const messages = [
@@ -6496,37 +6521,67 @@ async function attemptPortalJson(req, endpoint) {
6496
6521
  try {
6497
6522
  response = await fetchImpl(`${baseUrl}${endpoint}`, {
6498
6523
  method: "POST",
6499
- headers: { ...authHeaders, "Content-Type": "application/json" },
6524
+ // Attached HERE, at the one transport every background memory op shares, so
6525
+ // a new flow gets the provenance by construction rather than by remembering.
6526
+ headers: {
6527
+ ...authHeaders,
6528
+ ...taskTypeHeader(req.taskType),
6529
+ "Content-Type": "application/json"
6530
+ },
6500
6531
  body: JSON.stringify(requestBody),
6501
6532
  signal: controller.signal
6502
6533
  });
6503
6534
  } catch (err) {
6504
6535
  clearTimeout(timer);
6505
- return { kind: "retryable", reason: `fetch failed: ${err.message}` };
6536
+ return {
6537
+ kind: "retryable",
6538
+ code: "network",
6539
+ reason: `fetch failed: ${err.message}`
6540
+ };
6506
6541
  }
6507
6542
  if (!response.ok) {
6508
6543
  clearTimeout(timer);
6509
6544
  const reason = `portal returned ${response.status}`;
6510
6545
  if (response.status === 401) {
6511
6546
  const tokenAuth = !req.apiKey && !!req.getToken;
6512
- return tokenAuth ? { kind: "retryable", reason: `${reason} (token may be expired; refreshing)` } : { kind: "terminal", reason };
6513
- }
6514
- if (!isRetryableStatus(response.status)) return { kind: "terminal", reason };
6547
+ return tokenAuth ? {
6548
+ kind: "retryable",
6549
+ code: "http-retryable",
6550
+ reason: `${reason} (token may be expired; refreshing)`,
6551
+ httpStatus: response.status
6552
+ } : { kind: "terminal", code: "http-terminal", reason, httpStatus: response.status };
6553
+ }
6554
+ if (!isRetryableStatus(response.status))
6555
+ return { kind: "terminal", code: "http-terminal", reason, httpStatus: response.status };
6515
6556
  const retryAfterMs = parseRetryAfterMs(response.headers.get("retry-after"));
6516
- return retryAfterMs !== null ? { kind: "retryable", reason, retryAfterMs } : { kind: "retryable", reason };
6557
+ return {
6558
+ kind: "retryable",
6559
+ code: "http-retryable",
6560
+ reason,
6561
+ httpStatus: response.status,
6562
+ ...retryAfterMs !== null && { retryAfterMs }
6563
+ };
6517
6564
  }
6518
6565
  let body;
6519
6566
  try {
6520
6567
  body = await response.json();
6521
6568
  } catch (err) {
6522
6569
  clearTimeout(timer);
6523
- return { kind: "retryable", reason: `response body parse failed: ${err.message}` };
6570
+ return {
6571
+ kind: "retryable",
6572
+ code: "body-parse-failed",
6573
+ reason: `response body parse failed: ${err.message}`
6574
+ };
6524
6575
  }
6525
6576
  clearTimeout(timer);
6526
6577
  logPortalUsage(body, req.tag);
6527
6578
  const rawContent = extractCompletionContent(body);
6528
6579
  if (!rawContent) {
6529
- return { kind: "retryable", reason: "portal response had no completion content" };
6580
+ return {
6581
+ kind: "retryable",
6582
+ code: "empty-content",
6583
+ reason: "portal response had no completion content"
6584
+ };
6530
6585
  }
6531
6586
  const looksLikeContinuation = prefill && /^\s*"/.test(rawContent);
6532
6587
  const content = looksLikeContinuation ? prefill + rawContent : rawContent;
@@ -6537,11 +6592,12 @@ async function attemptPortalJson(req, endpoint) {
6537
6592
  } catch (err) {
6538
6593
  return {
6539
6594
  kind: "retryable",
6595
+ code: "invalid-json",
6540
6596
  reason: `completion was not valid JSON: ${err.message}`
6541
6597
  };
6542
6598
  }
6543
6599
  if (value === null) {
6544
- return { kind: "retryable", reason: "completion parsed to null" };
6600
+ return { kind: "retryable", code: "null-completion", reason: "completion parsed to null" };
6545
6601
  }
6546
6602
  return { kind: "ok", value };
6547
6603
  }
@@ -6618,6 +6674,7 @@ var init_portalLlm = __esm({
6618
6674
  init_endpointOverride();
6619
6675
  init_internalFlowMarker();
6620
6676
  init_logger();
6677
+ init_taskType();
6621
6678
  RESPONSE_FORMAT_OK = /* @__PURE__ */ new Set(["openai", "inclusionai", "deepseek"]);
6622
6679
  RESPONSE_SCHEMA_OK = /* @__PURE__ */ new Set(["openai"]);
6623
6680
  RETRYABLE_HTTP = /* @__PURE__ */ new Set([408, 409, 425, 429]);
@@ -7404,6 +7461,7 @@ Output strict JSON, no prose: { "expand": [<entity names to expand, verbatim fro
7404
7461
  ...options.apiKey !== void 0 && { apiKey: options.apiKey },
7405
7462
  ...options.getToken !== void 0 && { getToken: options.getToken },
7406
7463
  ...options.baseUrl !== void 0 && { baseUrl: options.baseUrl },
7464
+ taskType: "memory_graph",
7407
7465
  model: options.model ?? DEFAULT_REFINER_MODEL,
7408
7466
  systemPrompt,
7409
7467
  userMessage: `Question: ${query}
@@ -9487,6 +9545,7 @@ ${candidateText}`;
9487
9545
  ...options.apiKey !== void 0 && { apiKey: options.apiKey },
9488
9546
  ...options.getToken !== void 0 && { getToken: options.getToken },
9489
9547
  ...options.baseUrl !== void 0 && { baseUrl: options.baseUrl },
9548
+ taskType: "memory_consolidate",
9490
9549
  model: options.model ?? DEFAULT_CONSOLIDATION_MODEL,
9491
9550
  systemPrompt: SYSTEM_PROMPT3,
9492
9551
  userMessage,
@@ -14875,6 +14934,7 @@ async function deleteConversationSummaryOp(ctx, conversationId) {
14875
14934
  // src/lib/chat/summarize.ts
14876
14935
  init_internalFlowMarker();
14877
14936
  init_logger();
14937
+ init_taskType();
14878
14938
  var DEFAULT_SUMMARY_TOKEN_THRESHOLD = 4e3;
14879
14939
  var DEFAULT_SUMMARY_MIN_WINDOW_MESSAGES = 4;
14880
14940
  var DEFAULT_SUMMARY_MODEL = "cerebras/qwen-3-235b-a22b-instruct-2507";
@@ -15061,7 +15121,12 @@ async function callSummarizationLlm(prompt, model, token, baseUrl) {
15061
15121
  method: "POST",
15062
15122
  headers: {
15063
15123
  "Content-Type": "application/json",
15064
- Authorization: `Bearer ${token}`
15124
+ Authorization: `Bearer ${token}`,
15125
+ // Names the task so the portal can own this prompt server-side instead of
15126
+ // trusting the one we build. Summarization is the archetypal Class-B flow:
15127
+ // one fixed purpose, no conversation, and today its instructions are ours
15128
+ // to reword.
15129
+ ...taskTypeHeader("summarize")
15065
15130
  },
15066
15131
  body: JSON.stringify({
15067
15132
  model,
@@ -17153,6 +17218,7 @@ async function classifyInjectionCandidates(candidates, options) {
17153
17218
  ...options.apiKey !== void 0 && { apiKey: options.apiKey },
17154
17219
  ...options.getToken !== void 0 && { getToken: options.getToken },
17155
17220
  ...options.baseUrl !== void 0 && { baseUrl: options.baseUrl },
17221
+ taskType: "memory_injection_check",
17156
17222
  model: options.model ?? DEFAULT_MODEL,
17157
17223
  systemPrompt: SYSTEM_PROMPT,
17158
17224
  userMessage: `Candidate facts:
@@ -17854,10 +17920,15 @@ async function extractFacts(messages, options) {
17854
17920
  }
17855
17921
  const transcript = transcriptLines.join("\n");
17856
17922
  const today = formatLocalDate(options.now ?? Date.now());
17923
+ let failure;
17857
17924
  const parsed = await callPortalJsonCompletion({
17925
+ onFailure: (f) => {
17926
+ failure = f;
17927
+ },
17858
17928
  ...options.apiKey !== void 0 && { apiKey: options.apiKey },
17859
17929
  ...options.getToken !== void 0 && { getToken: options.getToken },
17860
17930
  ...options.baseUrl !== void 0 && { baseUrl: options.baseUrl },
17931
+ taskType: "memory_extract",
17861
17932
  ...options.endpointOverride !== void 0 && {
17862
17933
  endpointOverride: options.endpointOverride
17863
17934
  },
@@ -17877,7 +17948,7 @@ Extract durable user facts.`,
17877
17948
  ...options.backoffMs && { backoffMs: options.backoffMs }
17878
17949
  });
17879
17950
  if (parsed === null) {
17880
- options.onExhaustedEmpty?.();
17951
+ options.onExhaustedEmpty?.(failure ?? { reason: "empty-content", attempts: 1 });
17881
17952
  return [];
17882
17953
  }
17883
17954
  const fallbackSourceId = [...messages].reverse().find((m) => m.role === "user")?.id;
@@ -17921,14 +17992,16 @@ async function extractAndRetain(messages, retainCtx, options) {
17921
17992
  ...resolvedConsolidatePii !== void 0 && { piiRedaction: resolvedConsolidatePii }
17922
17993
  } : void 0;
17923
17994
  let exhaustedEmpty = false;
17995
+ let exhaustedFailure;
17924
17996
  let droppedAfterRedaction = false;
17925
17997
  const callerOnExhaustedEmpty = options.extract.onExhaustedEmpty;
17926
17998
  const callerOnCandidatesDropped = options.extract.onCandidatesDropped;
17927
17999
  const candidates = await extractFacts(messages, {
17928
18000
  ...options.extract,
17929
- onExhaustedEmpty: () => {
18001
+ onExhaustedEmpty: (failure) => {
17930
18002
  exhaustedEmpty = true;
17931
- callerOnExhaustedEmpty?.();
18003
+ exhaustedFailure = failure;
18004
+ callerOnExhaustedEmpty?.(failure);
17932
18005
  },
17933
18006
  onCandidatesDropped: () => {
17934
18007
  droppedAfterRedaction = true;
@@ -18047,12 +18120,19 @@ async function extractAndRetain(messages, retainCtx, options) {
18047
18120
  results,
18048
18121
  failedCount: failedWrites,
18049
18122
  outcome,
18050
- quarantined: quarantinedInfo
18123
+ quarantined: quarantinedInfo,
18124
+ // Only meaningful alongside `outcome: "empty-after-retry"`. Returned as well
18125
+ // as pushed through the callback so a consumer that only inspects the result
18126
+ // (rather than wiring a hook) can still report WHY.
18127
+ ...exhaustedFailure !== void 0 && { failure: exhaustedFailure }
18051
18128
  };
18052
18129
  }
18130
+ var UTTERANCE_ECHO_RE = /^(?:said|says|asked|answered|replied|guessed|typed)\s*:\s*(?:'[^']*'|"[^"]*"|‘[^’]*’|“[^”]*”)[\s.!?]*$/iu;
18053
18131
  function isLowSignalContent(content, ownNames) {
18054
- const normalized = content.trim().replace(/[.!?]+$/, "").toLowerCase();
18132
+ const trimmed = content.trim();
18133
+ const normalized = trimmed.replace(/[.!?]+$/, "").toLowerCase();
18055
18134
  if (normalized.length < MIN_CONTENT_LENGTH) return true;
18135
+ if (UTTERANCE_ECHO_RE.test(trimmed)) return true;
18056
18136
  if (ownNames.some(
18057
18137
  (n) => normalized === n.trim().replace(/[.!?]+$/, "").toLowerCase()
18058
18138
  )) {
@@ -18417,6 +18497,7 @@ function createLlmDecayClassifier(options) {
18417
18497
  ...options.apiKey !== void 0 && { apiKey: options.apiKey },
18418
18498
  ...options.getToken !== void 0 && { getToken: options.getToken },
18419
18499
  ...options.baseUrl !== void 0 && { baseUrl: options.baseUrl },
18500
+ taskType: "memory_decay",
18420
18501
  model: options.model ?? DEFAULT_MODEL3,
18421
18502
  systemPrompt: SYSTEM_PROMPT5,
18422
18503
  userMessage: `Memory content:
@@ -19574,6 +19655,7 @@ When a memory refers to one of these, reuse the EXACT existing name (same spelli
19574
19655
  ...options.apiKey !== void 0 && { apiKey: options.apiKey },
19575
19656
  ...options.getToken !== void 0 && { getToken: options.getToken },
19576
19657
  ...options.baseUrl !== void 0 && { baseUrl: options.baseUrl },
19658
+ taskType: "memory_topic",
19577
19659
  ...options.endpointOverride !== void 0 && {
19578
19660
  endpointOverride: options.endpointOverride
19579
19661
  },
@@ -19767,6 +19849,7 @@ ${evidence}`);
19767
19849
  ...options.apiKey !== void 0 && { apiKey: options.apiKey },
19768
19850
  ...options.getToken !== void 0 && { getToken: options.getToken },
19769
19851
  ...options.baseUrl !== void 0 && { baseUrl: options.baseUrl },
19852
+ taskType: "memory_verify_support",
19770
19853
  model: options.model ?? DEFAULT_MODEL5,
19771
19854
  systemPrompt: SYSTEM_PROMPT7,
19772
19855
  userMessage: `Stored facts and their sources:
@@ -6122,6 +6122,44 @@ declare function getMemoriesByEntityNamesOp(ctx: EntityOperationsContext, entity
6122
6122
  */
6123
6123
  declare function getEntitiesByMemoryIdsOp(ctx: EntityOperationsContext, memoryIds: readonly string[]): Promise<Map<string, Set<string>>>;
6124
6124
 
6125
+ /**
6126
+ * Shared portal LLM call for the memory pipeline.
6127
+ *
6128
+ * The three LLM-driven steps (`extractFacts`, `consolidateMemory`,
6129
+ * `decomposeQuery`) share the same shape: POST to `/api/v1/chat/completions`
6130
+ * with a system+user prompt and `response_format: json_object`, parse
6131
+ * `choices[0].message.content` as JSON, validate, return null on any failure.
6132
+ * This helper owns the fetch+timeout+parse+log boilerplate so each caller
6133
+ * stays focused on its prompt and validator.
6134
+ *
6135
+ * PROMPT CACHING. The portal inserts explicit prompt-cache breakpoints only for
6136
+ * `anthropic/` models. Its request schema does carry OpenAI's
6137
+ * `prompt_cache_key`, but that is a routing hint for OpenAI's own implicit
6138
+ * cache rather than a switch that enables caching, and we deliberately don't
6139
+ * send it: the memory pipeline runs open-weights models by default (gpt-oss for
6140
+ * extraction/topics, ling for consolidation), and this module already has one
6141
+ * hard lesson about OpenAI-standard fields a non-OpenAI provider hard-400s on
6142
+ * (`response_format`, below). Revisit only with a verified per-provider gate.
6143
+ *
6144
+ * So on the models this pipeline actually uses, the only cache that can hit is
6145
+ * the provider's own implicit prefix cache — which makes prefix stability the
6146
+ * one lever a caller controls. Messages are assembled system-first (below), so
6147
+ * every caller must pass a CONSTANT `systemPrompt` and keep all per-call
6148
+ * material in `userMessage`: a single interpolated timestamp, id, or count in a
6149
+ * system prompt shifts every byte after it and misses the cache on every
6150
+ * request thereafter. The memory callers are regression-gated on that property
6151
+ * in `promptPrefixStability.test.ts`.
6152
+ *
6153
+ * Whether those implicit caches hit is observable: each successful response
6154
+ * logs the portal's reported token counts at debug level, including
6155
+ * `portal.cached_tokens` (the prompt tokens the provider served from cache —
6156
+ * the portal omits the field when there was no hit). See {@link logPortalUsage}.
6157
+ *
6158
+ * There is no batch/async-bulk route on the portal, so a backfill or reindex
6159
+ * has no discounted-throughput path either; its only levers are the same stable
6160
+ * prefix and caller-side batching (e.g. topicExtract's 10-memories-per-call).
6161
+ */
6162
+
6125
6163
  /**
6126
6164
  * Auth for portal LLM calls (extraction, consolidation, decomposition,
6127
6165
  * reflection). Mirrors `memoryEngine`'s `EmbeddingOptions` dual-auth:
@@ -6140,6 +6178,60 @@ interface PortalLlmAuth {
6140
6178
  /** Function to get an auth token (e.g., Privy's getIdentityToken). Token is sent as `Authorization: Bearer`. */
6141
6179
  getToken?: () => Promise<string | null>;
6142
6180
  }
6181
+ /**
6182
+ * Why a portal JSON completion gave up, as a STABLE low-cardinality code.
6183
+ *
6184
+ * The retry loop has always classified its failures precisely, but only as an
6185
+ * interpolated `reason` string for `log.warn` — and prod ships no SDK log
6186
+ * (sdk#883), so in production every one of these collapsed into a single
6187
+ * `empty-after-retry` with no way to tell them apart. That is what made the
6188
+ * 2026-08-11 audit need a Prometheus cross-check to discover that the portal
6189
+ * was returning HTTP 200 with an empty body on ~60% of extraction turns.
6190
+ *
6191
+ * Codes are deliberately an enum, not the `reason` string: the strings embed
6192
+ * status codes and error messages, so they are unbounded and useless as an
6193
+ * analytics property. Keep this list SHORT and stable — it is a telemetry
6194
+ * contract, and a value added here has to mean the same thing in six months.
6195
+ *
6196
+ * @public
6197
+ */
6198
+ type PortalLlmFailureReason =
6199
+ /** No usable credential — `getToken` returned null or threw. Terminal. */
6200
+ "auth-unavailable"
6201
+ /** Non-retryable HTTP status (400/403/404, or 401 on the static-apiKey path). */
6202
+ | "http-terminal"
6203
+ /** Retryable status (408/409/425/429/5xx) that never succeeded. */
6204
+ | "http-retryable"
6205
+ /** Network error or the per-attempt timeout aborted the fetch. */
6206
+ | "network"
6207
+ /** HTTP 200 but the envelope itself wasn't JSON. */
6208
+ | "body-parse-failed"
6209
+ /**
6210
+ * HTTP 200 with NO completion content. The reasoning-class failure mode:
6211
+ * the model spends its budget on unreturned thinking and answers empty.
6212
+ */
6213
+ | "empty-content"
6214
+ /** Content present, but no parseable JSON in it (prose, a clarifying question). */
6215
+ | "invalid-json"
6216
+ /** Content parsed to a literal `null`, which is never a valid response. */
6217
+ | "null-completion"
6218
+ /** `totalTimeoutMs` was spent before the next attempt could run. */
6219
+ | "time-budget-exhausted";
6220
+ /**
6221
+ * A give-up report: the classified {@link PortalLlmFailureReason} plus the
6222
+ * little context worth carrying into telemetry. Both extra fields are bounded
6223
+ * (a status code, a small attempt count), so both are safe as event properties.
6224
+ *
6225
+ * @public
6226
+ */
6227
+ interface PortalLlmFailure {
6228
+ /** Stable code for the last failure observed. */
6229
+ reason: PortalLlmFailureReason;
6230
+ /** HTTP status, when the failure was an HTTP one. */
6231
+ httpStatus?: number;
6232
+ /** How many attempts ran before giving up (1-based, ≥ 1). */
6233
+ attempts: number;
6234
+ }
6143
6235
 
6144
6236
  /**
6145
6237
  * Optional LLM injection classifier — Tier-0 security second layer (PR5).
@@ -7244,8 +7336,14 @@ interface ExtractFactsOptions extends PortalLlmAuth {
7244
7336
  * `{candidates: []}` "nothing durable here". Lets callers distinguish a
7245
7337
  * silently-degrading extractor from quiet turns (the two are otherwise
7246
7338
  * indistinguishable). See {@link extractAndRetain}'s `outcome`.
7339
+ *
7340
+ * Receives the classified {@link PortalLlmFailure}. Knowing THAT extraction
7341
+ * failed was not enough: the 2026-08-11 audit found ~60% of production turns
7342
+ * ending here and had to cross-check Prometheus to learn that the cause was
7343
+ * HTTP-200-with-empty-body rather than the 403 everyone assumed. Forward
7344
+ * `failure.reason` into analytics so the next such question is a query.
7247
7345
  */
7248
- onExhaustedEmpty?: () => void;
7346
+ onExhaustedEmpty?: (failure: PortalLlmFailure) => void;
7249
7347
  /**
7250
7348
  * Called when the extractor DID produce candidates but PII de-anonymization
7251
7349
  * dropped every one of them — the model mangled its placeholders (so they
@@ -7368,6 +7466,11 @@ declare function extractAndRetain(messages: AutoExtractMessage[], retainCtx: Ret
7368
7466
  * "extracted but held for review".
7369
7467
  */
7370
7468
  quarantined: QuarantinedMemoryInfo[];
7469
+ /**
7470
+ * Present only when `outcome` is `empty-after-retry` — the classified cause of
7471
+ * the give-up, so "extraction is failing" can be reported as *why* it failed.
7472
+ */
7473
+ failure?: PortalLlmFailure;
7371
7474
  }>;
7372
7475
 
7373
7476
  /**
@@ -15402,4 +15505,4 @@ declare function renderAnumaTree(node: AnumaNode): React.ReactElement | null;
15402
15505
  */
15403
15506
  declare function renderAnumaJsx(jsx: string): React.ReactElement | null;
15404
15507
 
15405
- export { Anuma, type AnumaChild, AnumaJsxError, type AnumaNode, AnumaShadowIsolationProvider, type AnumaShadowIsolationProviderProps, type AnumaTheme, AnumaThemeProvider, type AnumaThemeProviderProps, AppFile as AppFileModel, type AppFileOperationsContext, type AttrValue, type AutoExtractMessage, type AutoExtractor, DEFAULT_CONVERSATIONS_FOLDER as BACKUP_DRIVE_CONVERSATIONS_FOLDER, DEFAULT_ROOT_FOLDER as BACKUP_DRIVE_ROOT_FOLDER, DEFAULT_BACKUP_FOLDER as BACKUP_ICLOUD_FOLDER, BUILT_IN_TOOL_SETS, type BackupAuthContextValue, BackupAuthProvider, type BackupAuthProviderProps, type BackupOperationOptions, BlobUrlManager, type Budget, CHUNKS_DISCARDED_ORIGIN, type CachedChunkVectors, type CachedServerTools, ChartCard, type ChartCardProps, type ChartConfig, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, Conversation as ChatConversation, Message as ChatMessage, type ChatRole, type ChatStorageAdapter, type ChatStorageObservable, type ChunkSearchResult, type ChunkVectorCache, type ChunkingOptions, type CircleProps, type ClientToolsFilterFn, type ConsolidationFallbackReason, type ConversationMemoryInput, ConversationMemory as ConversationMemoryModel, type ConversationMemoryOperationsContext, type ConversationQueryOptions, type CreateAutoExtractorOptions, type CreateConversationOptions, type CreateDecaySweeperOptions, type CreateEntityOptions, type CreateMediaOptions, type CreateMessageOptions, type CreateModelPreferenceOptions, type CreateProjectOptions, type CreateSavedToolOptions, type CreateServerToolsFilterOptions, type CreateUserPreferenceOptions, type CreateVaultFolderOptions, type CreateVaultMemoryOptions, type CryptoPriceClassification, type CryptoPricePreProcessorOptions, DEFAULT_BACKUP_FOLDER$1 as DEFAULT_BACKUP_FOLDER, DEFAULT_CACHE_EXPIRATION_MS, DEFAULT_CHUNK_CACHE_SIZE, DEFAULT_CHUNK_OVERLAP, DEFAULT_CHUNK_SIZE, DEFAULT_DECAY_POLICY, DEFAULT_CONVERSATIONS_FOLDER as DEFAULT_DRIVE_CONVERSATIONS_FOLDER, DEFAULT_ROOT_FOLDER as DEFAULT_DRIVE_ROOT_FOLDER, DEFAULT_BACKUP_FOLDER$1 as DEFAULT_DROPBOX_FOLDER, DEFAULT_EXCLUDED_SERVER_TOOLS, DEFAULT_BACKUP_FOLDER as DEFAULT_ICLOUD_BACKUP_FOLDER, DEFAULT_MAX_CLASSIFIER_CALLS_PER_SWEEP, DEFAULT_MIN_CHUNK_SIZE, DEFAULT_PERSONALITY_SETTINGS, DEFAULT_PROFILE_FACETS, DEFAULT_PROFILE_FACT_TYPE_WEIGHTS, DEFAULT_PROFILE_PROOF_ALPHA, DEFAULT_PROFILE_TREND_MULTIPLIERS, DEFAULT_SERVER_TOOLS_MATCH_OPTIONS, DEFAULT_VAULT_CACHE_SIZE, DatabaseManager, type DatabaseManagerLogger, type DatabaseManagerOptions, type DecayCandidateRaw, type DecayClassifier, type DecayInput, type DecayPolicy, type DecaySweepResult, type DecaySweeper, type DecayVerdict, type DeckProps, type DisplayToolMigrations, type DropboxAuthContextValue, DropboxAuthProvider, type DropboxAuthProviderProps, type DropboxExportResult, type DropboxImportResult, ENTITY_FANOUT, ENTITY_KINDS, type EmbeddedWalletSignerFn, EncryptionKeyMissingError, type EncryptionKeyVersion, type EntityInput, type EntityKind, Entity as EntityModel, type EntityOperationsContext, ExcelProcessor, type ExtractFactsOptions, type ExtractOutcome, type ExtractedCandidate, type ExtractedEntity, type ExtractionCursorStore, FILE_PLACEHOLDER_PREFIX, FILE_PLACEHOLDER_REGEX, type FactType, type FileMetadata, type FileProcessor, type FileTypeQuery, type FileWithData, type FlushResult, type GetConversationsPageOptions, type GetMessagesPageOptions, type GoogleDriveAuthContextValue, GoogleDriveAuthProvider, type GoogleDriveAuthProviderProps, type GoogleDriveExportResult, type GoogleDriveImportResult, type GraphTraversalOptions, type GroupProps, HARD_DELETE_WINDOW_MS, type ICloudAuthContextValue, ICloudAuthProvider, type ICloudAuthProviderProps, type ICloudExportResult, type ICloudImportResult, INFERENCE_ID_HEADER, type IconProps, type ImageProps, type InjectionClassifierOptions, type InjectionReason, type InteractionType, type KnownTag, type LazyStoredConversation, type LineProps, type LlmDecayClassifierOptions, type LlmNeighborRefinerOptions, type Logger, LoggerProvider, type LoggerProviderProps, MAX_HOPS, MEDIUM_TTL_MS, type MediaDimensions, type MediaFilterOptions, type MediaMetadata, type MediaOperationsContext, type MediaRole, type MediaType, type MemoriesNeedingTopicExtraction, type EmbeddingOptions as MemoryEngineEmbeddingOptions, type MemoryEngineResult, type MemoryEngineSearchOptions, MemoryEntity as MemoryEntityModel, type MemoryExtractedEvent, type MemoryKind, type MemoryQuarantinedEvent, type MemoryToVerify, type MemoryVaultSearchOptions, type MemoryVaultToolOptions, type MemoryVerification, type MessageChunk, type MessageFeedback, type MessageOrigin, type MessageSkeleton, type ModelLoadProgress, NEVER_TTL_MS, NODE_BUDGET, type NeighborRefiner, type NowSource, type OCRFile, type ObservationTrend, type ObservationTrendInput, type OperationExecutor, PAST_EVENT_GRACE_MS, PROFILE_DOC_VERSION, type ParsedServerToolsResponse, type PdfExportOptions, type PdfExportProgress, type PdfExportStage, type PdfFile, PdfProcessor, type PendingInteraction, type PersonalitySettings, type PersonalitySliders, type PersonalityStyle, type PhoneCallPollingOptions, type PhotoIngestResult, type PhotoMediaRef, type PlatformStorage, type PortalLlmAuth, type PreprocessingOptions, type PreprocessingResult, type ProcessedFileResult, ProcessorRegistry, type ProfileConfigFingerprint, type ProfileDoc, type ProfileFacet, type ProfileFacetKey, type ProfileSalienceInput, type ProfileSection, type ProfileUpdate, type ProgressCallback, Project, type ProjectOperationsContext, type PromptPreProcessor, type PromptPreProcessorContext, type ProviderAuthState, type ProviderBackupState, ProviderStreamError, type PublishedPhotoMemory, type QuantizedEmbedding, type QuarantinedMemoryInfo, type QueueEncryptionContext, QueueManager, type QueueStatus, type QueuedOperation, type QueuedOperationType, R2_DEFAULT_TTL_MS, RECALL_MAX_LIMIT, RECALL_TOOL_NAME, type RankableVaultMemory, type RankedMemory, type RankedProfileCandidate, type RecallContext, type RecallDegradation, type RecallDiagnostics, type RecallOptions, type RecallResult, type RecallToolCallbacks, type RecallToolOptions, type RecencyOptions, type RectProps, type ReflectOptions, type ReflectResult, type RequestEncryptionKeyOptions, RerankerUnavailableError, type ResumeStreamOptions, type ResumeStreamResult, type RetainAction, type RetainContext, type RetainOptions, type RetainResult, type RetainSource, SDK_SCHEMA_VERSION, SERVER_TOOL_DEPENDENCY_SETS, SHORT_TTL_MS, SLIDER_CONFIG, SLIDES_FILE_PATH, SLIDE_CANVAS_HEIGHT, SLIDE_CANVAS_WIDTH, STREAM_RESUMABLE_HEADER, SavedTool as SavedToolModel, type SavedToolOperationsContext, type SavedToolParameter, type ScoreBreakdown, type ScoreProfileSalienceOptions, type ScreenProps, type ScreenResult, type ScreenedCandidate, type SearchMessagesOptions, type SearchSource, type SelectServerToolsForPromptOptions, type SendMessageWithStorageArgs, type SendMessageWithStorageResult, type ServerTool, type ServerToolsFilter, type ServerToolsFilterFn, type ServerToolsFilterFunction, type ServerToolsOptions, type ServerToolsResponse, type SignMessageFn, type SignMessageOptions, type SlideProps, type StepFinishEvent, type StockPriceClassification, type StockPricePreProcessorOptions, type StorageOperationsContext, type StoredAppFile, type ChatCompletionUsage as StoredChatCompletionUsage, type StoredConversation, type StoredConversationMemory, type StoredEntity, type StoredFileWithContext, type StoredMedia, Media as StoredMediaModel, type StoredMessage, type StoredMessageWithSimilarity, type StoredModelPreference, ModelPreference as StoredModelPreferenceModel, type StoredProject, type StoredSavedTool, type StoredTopic, type StoredUserPreference, UserPreference as StoredUserPreferenceModel, type StoredVaultFolder, VaultFolder as StoredVaultFolderModel, type StoredVaultMemory, VaultMemory as StoredVaultMemoryModel, StreamExpiredError, type StreamMetaEvent, type StreamResumeHandle, type SynthesizeProfileOptions, THEME_ATTRS, TOOL_RESULT_ORIGIN, TOPICS_EXTRACTION_VERSION, TOPIC_EXTRACTION_BATCH_SIZE, TREND_RECENT_WINDOW_DAYS, TREND_STALE_WINDOW_DAYS, type TextChunk, TextProcessor, type TextProps, type ThemeAttr, type ToolCallArgumentsDeltaEvent, type ToolMatchOptions, type ToolMatchResult, type ToolSet, type TopicExtractOptions, type TopicExtractionInput, type TopicExtractionRunResult, type TopicSource, type TranscriptionResult, type TurnCompleteEvent, type TurnSkippedEvent, type UIInteractionContextValue, UIInteractionProvider, type UIInteractionProviderProps, type UncheckedReason, type UnverifiableReason, type UpdateMediaOptions, type UpdateModelPreferenceOptions, type UpdateProjectOptions, type UpdateSavedToolOptions, type UpdateUserPreferenceOptions, type UpdateVaultFolderOptions, type UpdateVaultMemoryOptions, type UseBackupOptions, type UseBackupResult, type UseChatStorageOptions, type UseChatStorageResult, type UseCreditsOptions, type UseCreditsResult, type UseDropboxBackupOptions, type UseDropboxBackupResult, type UseEncryptionResult, type UseExportPdfResult, type UseFilesOptions, type UseFilesResult, type UseGoogleDriveBackupOptions, type UseGoogleDriveBackupResult, type UseICloudBackupOptions, type UseICloudBackupResult, type UseModelsResult, type UseOCRResult, type UsePdfResult, type UsePhoneCallsOptions, type UsePhoneCallsResult, type UseProjectsOptions, type UseProjectsResult, type UseSettingsOptions, type UseSettingsResult, type UseSubscriptionOptions, type UseSubscriptionResult, type UseToolsOptions, type UseToolsResult, type UseVoiceOptions, type UseVoiceResult, type UseWalletBindingOptions, type UseWalletBindingResult, VAULT_SIZE_HOP_CAP, type VaultCandidateKey, type VaultEmbeddingCache, type VaultFolderOperationsContext, type VaultMemoryOperationsContext, type VaultMemoryVisibility, type VaultSaveOperation, type VaultSearchResult, type VerificationSources, type VerifyMemoriesForPublishOptions, type VoiceRecording, WalletPoller, WatermelonChatStorageAdapter, type WatermelonChatStorageAdapterOptions, type WeatherClassification, type WeatherPreProcessorOptions, type WebSearchClassification, type WebSearchPreProcessorOptions, type WhisperModel, WordProcessor, ZipProcessor, type ZipProcessorOptions, addConversationMemoriesOp, appFileToStored, archiveVaultMemoryOp, backfillMemoryEntityUserIdsOp, backfillMemoryTopicsOp, capHopsForDensity, chatStorageMigrations, chatStorageSchema, chunkAndEmbedAllMessages, chunkAndEmbedMessage, chunkText, classifyCryptoPrice, classifyCryptoPriceBatch, classifyDecay, classifyInjectionCandidates, classifyObservationTrend, classifyStockPrice, classifyStockPriceBatch, classifyWeather, classifyWeatherBatch, classifyWebSearch, classifyWebSearchBatch, clearAllEncryptionKeys, clearAllEncryptionState, clearAllKeyPairs, clearCalendarToken, clearConversationMemoriesOp, clearDriveToken, clearToken as clearDropboxToken, clearEncryptionKey, clearGithubToken, clearGoogleDriveToken, clearICloudAuth, clearKeyPair, clearLazyTitleCache, clearMemoryTopicsOverrideOp, clearNotionToken, clearServerToolsCache, consoleLogger, conversationMemoryToStored, cosineInt8, createAutoExtractor, createChunkVectorCache, createCryptoPricePreProcessor, createDecaySweeper, createGitHubTools, createLlmDecayClassifier, createLlmNeighborRefiner, createMediaBatchOp, createMediaOp, createMemoryEngineTool, createMemoryVaultSearchTool, createMemoryVaultTool, createMessageSourceResolver, createPlatformCursorStore, createProjectOp, createRecallTool, createSavedToolOp, createServerToolsFilter, createStockPricePreProcessor, createVaultEmbeddingCache, createVaultFolderOp, createVaultMemoriesBatchOp, createVaultMemoryOp, createWeatherPreProcessor, createWebSearchPreProcessor, decodeChunkVector, decryptConversationTitle, decryptData, decryptDataBatch, decryptDataBytes, decryptDataBytesFromBytes, decryptDataWithKey, defaultServerToolsFilter, deleteAllAppFilesOp, deleteAllVaultMemoriesForUserOp, deleteAppFileOp, deleteEncryptedFile, deleteMediaByConversationOp, deleteMediaByMessageOp, deleteMediaOp, deleteProjectOp, deleteSavedToolOp, deleteVaultFolderOp, deleteVaultMemoryOp, dequantizeEmbedding, eagerEmbedContent, embedAllMessages, embedMessage, encodeChunkVector, encryptData, encryptDataBatch, encryptDataBytes, encryptDataWithKey, ensureDefaultFoldersOp, expandToolSetsAdditive, exportElementToPdf, exportMarkdownToPdf, exportPublicKey, extractAndLinkEntitiesForMemoriesOp, extractAndRetain, extractEntitiesForMemories, extractFacts, extractFileIds, fileExists, findById, findMatchingTools, findParentOfId, generateConversationId, generateEmbedding, generateEmbeddings, generateMediaId, generateProjectId, getAIGeneratedMediaOp, getAllSavedToolsOp, getAllVaultFoldersOp, getAllVaultMemoriesOp, getAllVaultMemoryContentsOp, getAndClearCalendarPendingMessage, getAndClearCalendarReturnUrl, getAndClearDrivePendingMessage, getAndClearDriveReturnUrl, getAndClearGithubPendingMessage, getAndClearGithubReturnUrl, getAndClearNotionPendingMessage, getAndClearNotionReturnUrl, getAppFileMapOp, getAppFileOp, getAppFilesOp, getAudioOp, getCachedServerTools, getCalendarAccessToken, getConversationMemoriesOp, getConversationsByProjectLazyOp, getConversationsByProjectOp, getConversationsLazyOp, getConversationsPageOp, getDecayCandidatesRawOp, getDocumentsOp, getDriveAccessToken, getEncryptionKey, getEntitiesByMemoryIdsOp, getGithubAccessToken, getGoogleDriveStoredToken, getId, getImagesOp, getLogger, getMediaByConversationOp, getMediaByIdOp, getMediaByIdsOp, getMediaByMessageOp, getMediaByModelOp, getMediaByRoleOp, getMediaBySourceUrlOp, getMediaByTypeOp, getMediaCountOp, getMediaCountsByTypeOp, getMediaOp, getMediaTypeFromMime, getMemoriesByEntityNamesOp, getMemoriesNeedingTopicExtractionOp, getNotionAccessToken, getNotionMCPUrl, getNumberAttr, getProjectConversationCountOp, getProjectConversationsOp, getProjectOp, getProjectsOp, getRecentMediaOp, getSavedToolByIdOp, getServerTools, getStringAttr, getSupportedFileTypes, getToolsChecksum, getUnfiledVaultMemoriesOp, getUserUploadedMediaOp, getValidCalendarToken, getValidDriveToken, getValidGithubToken, getValidNotionToken, getVaultCandidateKeysOp, getVaultEmbeddingsByIdsOp, getVaultFolderMemoryCountOp, getVaultMemoriesByIdsOp, getVaultMemoryOp, getVaultRankingProjectionsOp, getVideosOp, handleCalendarCallback, handleDriveCallback, handleGithubCallback, handleNotionCallback, hardDeleteDecayedOp, hardDeleteMediaOp, hasCalendarCredentials, hasDriveCredentials, hasDropboxCredentials, hasEncryptionKey, hasGithubCredentials, hasGoogleDriveCredentials, hasICloudCredentials, hasKeyPair, hasNotionCredentials, ingestPublishedPhotoMemoriesOp, injectionSignatureCatalog, insertAfterId, insertChild, isAnumaTag, isCalendarCallback, isDriveCallback, isGithubCallback, isHtmlTag, isNotionCallback, isOPFSSupported, isR2UrlExpired, isRerankerAvailable, isSupportedFile, isSupportedMediaType, linkMemoryEntitiesOp, mediaToStored, migrateCalendarToken, migrateDisplayResult, migrateDriveToken, migrateGithubToken, migrateNotionClientRegistration, migrateNotionToken, moveMemoriesToFolderOp, noopLogger, onKeyAvailable, parseJsx, parseMedia, preEmbedVaultMemories, preprocessFiles, previewToolSelection, projectToStored, putAppFileOp, quantizeEmbedding, queueManager, rankProfileCandidates, readEncryptedFile, recall, reflect, refreshCalendarToken, refreshDriveToken, refreshEncryptionKeyIfMatches, refreshGithubToken, refreshNotionToken, relinkMemoryTopicsOp, relinkMisclassifiedVideosOp, removeById, renderAnumaJsx, renderAnumaTree, renderElementToCanvas, replaceById, replaceMemoryEntitiesGuardedOp, requestEncryptionKey, requestKeyPair, resolveFilePlaceholders, resolveThemeColor, restoreVaultMemoryOp, resumeStream, retain, revokeCalendarToken, revokeDriveToken, revokeGithubToken, revokeNotionAccess, savedToolToStored, scoreProfileSalience, screenCandidatesForInjection, sdkMigrations, sdkModelClasses, sdkSchema, searchChunksOp, searchMediaOp, searchMessagesOp, searchVaultMemories, seedEncryptionKeys, selectServerToolsForPrompt, serializeJsx, setLogger, setMemoryEntitiesOp, setMemoryVisibilityOp, settingsStorageSchema, shouldChunkMessage, shouldRefreshTools, stampTopicsExtractedAtOp, startGithubAuth, startNotionAuth, storeCalendarPendingMessage, storeCalendarReturnUrl, storeCalendarToken, storeDrivePendingMessage, storeDriveReturnUrl, storeDriveToken, storeGithubPendingMessage, storeGithubReturnUrl, storeGithubToken, storeNotionPendingMessage, storeNotionReturnUrl, streamCancelPath, streamReplayPath, summarizeObservationTrends, supersedeVaultMemoryOp, synthesizeProfile, traverseGraphLane, ttlForType, updateAttrs, updateConversationProjectOp, updateMediaMessageIdBatchOp, updateMediaOp, updateMessageFeedbackOp, updateProjectNameOp, updateProjectOp, updateSavedToolOp, updateVaultFolderContextOp, updateVaultFolderOp, updateVaultMemoryEmbeddingOp, updateVaultMemoryOp, useAnumaTheme, useBackup, useBackupAuth, useChat, useChatStorage, useCredits, useDatabaseManager, useDropboxAuth, useDropboxBackup, useEncryption, useExportPdf, useFiles, useGoogleDriveAuth, useGoogleDriveBackup, useICloudAuth, useICloudBackup, useModels, useOCR, usePdf, usePhoneCalls, useProjects, useSettings, useSubscription, useTools, useUIInteraction, useVoice, useWalletBinding, userPreferencesStorageSchema, verifyMemoriesForPublish, walk, webPlatformStorage, writeEncryptedFile };
15508
+ export { Anuma, type AnumaChild, AnumaJsxError, type AnumaNode, AnumaShadowIsolationProvider, type AnumaShadowIsolationProviderProps, type AnumaTheme, AnumaThemeProvider, type AnumaThemeProviderProps, AppFile as AppFileModel, type AppFileOperationsContext, type AttrValue, type AutoExtractMessage, type AutoExtractor, DEFAULT_CONVERSATIONS_FOLDER as BACKUP_DRIVE_CONVERSATIONS_FOLDER, DEFAULT_ROOT_FOLDER as BACKUP_DRIVE_ROOT_FOLDER, DEFAULT_BACKUP_FOLDER as BACKUP_ICLOUD_FOLDER, BUILT_IN_TOOL_SETS, type BackupAuthContextValue, BackupAuthProvider, type BackupAuthProviderProps, type BackupOperationOptions, BlobUrlManager, type Budget, CHUNKS_DISCARDED_ORIGIN, type CachedChunkVectors, type CachedServerTools, ChartCard, type ChartCardProps, type ChartConfig, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, Conversation as ChatConversation, Message as ChatMessage, type ChatRole, type ChatStorageAdapter, type ChatStorageObservable, type ChunkSearchResult, type ChunkVectorCache, type ChunkingOptions, type CircleProps, type ClientToolsFilterFn, type ConsolidationFallbackReason, type ConversationMemoryInput, ConversationMemory as ConversationMemoryModel, type ConversationMemoryOperationsContext, type ConversationQueryOptions, type CreateAutoExtractorOptions, type CreateConversationOptions, type CreateDecaySweeperOptions, type CreateEntityOptions, type CreateMediaOptions, type CreateMessageOptions, type CreateModelPreferenceOptions, type CreateProjectOptions, type CreateSavedToolOptions, type CreateServerToolsFilterOptions, type CreateUserPreferenceOptions, type CreateVaultFolderOptions, type CreateVaultMemoryOptions, type CryptoPriceClassification, type CryptoPricePreProcessorOptions, DEFAULT_BACKUP_FOLDER$1 as DEFAULT_BACKUP_FOLDER, DEFAULT_CACHE_EXPIRATION_MS, DEFAULT_CHUNK_CACHE_SIZE, DEFAULT_CHUNK_OVERLAP, DEFAULT_CHUNK_SIZE, DEFAULT_DECAY_POLICY, DEFAULT_CONVERSATIONS_FOLDER as DEFAULT_DRIVE_CONVERSATIONS_FOLDER, DEFAULT_ROOT_FOLDER as DEFAULT_DRIVE_ROOT_FOLDER, DEFAULT_BACKUP_FOLDER$1 as DEFAULT_DROPBOX_FOLDER, DEFAULT_EXCLUDED_SERVER_TOOLS, DEFAULT_BACKUP_FOLDER as DEFAULT_ICLOUD_BACKUP_FOLDER, DEFAULT_MAX_CLASSIFIER_CALLS_PER_SWEEP, DEFAULT_MIN_CHUNK_SIZE, DEFAULT_PERSONALITY_SETTINGS, DEFAULT_PROFILE_FACETS, DEFAULT_PROFILE_FACT_TYPE_WEIGHTS, DEFAULT_PROFILE_PROOF_ALPHA, DEFAULT_PROFILE_TREND_MULTIPLIERS, DEFAULT_SERVER_TOOLS_MATCH_OPTIONS, DEFAULT_VAULT_CACHE_SIZE, DatabaseManager, type DatabaseManagerLogger, type DatabaseManagerOptions, type DecayCandidateRaw, type DecayClassifier, type DecayInput, type DecayPolicy, type DecaySweepResult, type DecaySweeper, type DecayVerdict, type DeckProps, type DisplayToolMigrations, type DropboxAuthContextValue, DropboxAuthProvider, type DropboxAuthProviderProps, type DropboxExportResult, type DropboxImportResult, ENTITY_FANOUT, ENTITY_KINDS, type EmbeddedWalletSignerFn, EncryptionKeyMissingError, type EncryptionKeyVersion, type EntityInput, type EntityKind, Entity as EntityModel, type EntityOperationsContext, ExcelProcessor, type ExtractFactsOptions, type ExtractOutcome, type ExtractedCandidate, type ExtractedEntity, type ExtractionCursorStore, FILE_PLACEHOLDER_PREFIX, FILE_PLACEHOLDER_REGEX, type FactType, type FileMetadata, type FileProcessor, type FileTypeQuery, type FileWithData, type FlushResult, type GetConversationsPageOptions, type GetMessagesPageOptions, type GoogleDriveAuthContextValue, GoogleDriveAuthProvider, type GoogleDriveAuthProviderProps, type GoogleDriveExportResult, type GoogleDriveImportResult, type GraphTraversalOptions, type GroupProps, HARD_DELETE_WINDOW_MS, type ICloudAuthContextValue, ICloudAuthProvider, type ICloudAuthProviderProps, type ICloudExportResult, type ICloudImportResult, INFERENCE_ID_HEADER, type IconProps, type ImageProps, type InjectionClassifierOptions, type InjectionReason, type InteractionType, type KnownTag, type LazyStoredConversation, type LineProps, type LlmDecayClassifierOptions, type LlmNeighborRefinerOptions, type Logger, LoggerProvider, type LoggerProviderProps, MAX_HOPS, MEDIUM_TTL_MS, type MediaDimensions, type MediaFilterOptions, type MediaMetadata, type MediaOperationsContext, type MediaRole, type MediaType, type MemoriesNeedingTopicExtraction, type EmbeddingOptions as MemoryEngineEmbeddingOptions, type MemoryEngineResult, type MemoryEngineSearchOptions, MemoryEntity as MemoryEntityModel, type MemoryExtractedEvent, type MemoryKind, type MemoryQuarantinedEvent, type MemoryToVerify, type MemoryVaultSearchOptions, type MemoryVaultToolOptions, type MemoryVerification, type MessageChunk, type MessageFeedback, type MessageOrigin, type MessageSkeleton, type ModelLoadProgress, NEVER_TTL_MS, NODE_BUDGET, type NeighborRefiner, type NowSource, type OCRFile, type ObservationTrend, type ObservationTrendInput, type OperationExecutor, PAST_EVENT_GRACE_MS, PROFILE_DOC_VERSION, type ParsedServerToolsResponse, type PdfExportOptions, type PdfExportProgress, type PdfExportStage, type PdfFile, PdfProcessor, type PendingInteraction, type PersonalitySettings, type PersonalitySliders, type PersonalityStyle, type PhoneCallPollingOptions, type PhotoIngestResult, type PhotoMediaRef, type PlatformStorage, type PortalLlmAuth, type PortalLlmFailure, type PortalLlmFailureReason, type PreprocessingOptions, type PreprocessingResult, type ProcessedFileResult, ProcessorRegistry, type ProfileConfigFingerprint, type ProfileDoc, type ProfileFacet, type ProfileFacetKey, type ProfileSalienceInput, type ProfileSection, type ProfileUpdate, type ProgressCallback, Project, type ProjectOperationsContext, type PromptPreProcessor, type PromptPreProcessorContext, type ProviderAuthState, type ProviderBackupState, ProviderStreamError, type PublishedPhotoMemory, type QuantizedEmbedding, type QuarantinedMemoryInfo, type QueueEncryptionContext, QueueManager, type QueueStatus, type QueuedOperation, type QueuedOperationType, R2_DEFAULT_TTL_MS, RECALL_MAX_LIMIT, RECALL_TOOL_NAME, type RankableVaultMemory, type RankedMemory, type RankedProfileCandidate, type RecallContext, type RecallDegradation, type RecallDiagnostics, type RecallOptions, type RecallResult, type RecallToolCallbacks, type RecallToolOptions, type RecencyOptions, type RectProps, type ReflectOptions, type ReflectResult, type RequestEncryptionKeyOptions, RerankerUnavailableError, type ResumeStreamOptions, type ResumeStreamResult, type RetainAction, type RetainContext, type RetainOptions, type RetainResult, type RetainSource, SDK_SCHEMA_VERSION, SERVER_TOOL_DEPENDENCY_SETS, SHORT_TTL_MS, SLIDER_CONFIG, SLIDES_FILE_PATH, SLIDE_CANVAS_HEIGHT, SLIDE_CANVAS_WIDTH, STREAM_RESUMABLE_HEADER, SavedTool as SavedToolModel, type SavedToolOperationsContext, type SavedToolParameter, type ScoreBreakdown, type ScoreProfileSalienceOptions, type ScreenProps, type ScreenResult, type ScreenedCandidate, type SearchMessagesOptions, type SearchSource, type SelectServerToolsForPromptOptions, type SendMessageWithStorageArgs, type SendMessageWithStorageResult, type ServerTool, type ServerToolsFilter, type ServerToolsFilterFn, type ServerToolsFilterFunction, type ServerToolsOptions, type ServerToolsResponse, type SignMessageFn, type SignMessageOptions, type SlideProps, type StepFinishEvent, type StockPriceClassification, type StockPricePreProcessorOptions, type StorageOperationsContext, type StoredAppFile, type ChatCompletionUsage as StoredChatCompletionUsage, type StoredConversation, type StoredConversationMemory, type StoredEntity, type StoredFileWithContext, type StoredMedia, Media as StoredMediaModel, type StoredMessage, type StoredMessageWithSimilarity, type StoredModelPreference, ModelPreference as StoredModelPreferenceModel, type StoredProject, type StoredSavedTool, type StoredTopic, type StoredUserPreference, UserPreference as StoredUserPreferenceModel, type StoredVaultFolder, VaultFolder as StoredVaultFolderModel, type StoredVaultMemory, VaultMemory as StoredVaultMemoryModel, StreamExpiredError, type StreamMetaEvent, type StreamResumeHandle, type SynthesizeProfileOptions, THEME_ATTRS, TOOL_RESULT_ORIGIN, TOPICS_EXTRACTION_VERSION, TOPIC_EXTRACTION_BATCH_SIZE, TREND_RECENT_WINDOW_DAYS, TREND_STALE_WINDOW_DAYS, type TextChunk, TextProcessor, type TextProps, type ThemeAttr, type ToolCallArgumentsDeltaEvent, type ToolMatchOptions, type ToolMatchResult, type ToolSet, type TopicExtractOptions, type TopicExtractionInput, type TopicExtractionRunResult, type TopicSource, type TranscriptionResult, type TurnCompleteEvent, type TurnSkippedEvent, type UIInteractionContextValue, UIInteractionProvider, type UIInteractionProviderProps, type UncheckedReason, type UnverifiableReason, type UpdateMediaOptions, type UpdateModelPreferenceOptions, type UpdateProjectOptions, type UpdateSavedToolOptions, type UpdateUserPreferenceOptions, type UpdateVaultFolderOptions, type UpdateVaultMemoryOptions, type UseBackupOptions, type UseBackupResult, type UseChatStorageOptions, type UseChatStorageResult, type UseCreditsOptions, type UseCreditsResult, type UseDropboxBackupOptions, type UseDropboxBackupResult, type UseEncryptionResult, type UseExportPdfResult, type UseFilesOptions, type UseFilesResult, type UseGoogleDriveBackupOptions, type UseGoogleDriveBackupResult, type UseICloudBackupOptions, type UseICloudBackupResult, type UseModelsResult, type UseOCRResult, type UsePdfResult, type UsePhoneCallsOptions, type UsePhoneCallsResult, type UseProjectsOptions, type UseProjectsResult, type UseSettingsOptions, type UseSettingsResult, type UseSubscriptionOptions, type UseSubscriptionResult, type UseToolsOptions, type UseToolsResult, type UseVoiceOptions, type UseVoiceResult, type UseWalletBindingOptions, type UseWalletBindingResult, VAULT_SIZE_HOP_CAP, type VaultCandidateKey, type VaultEmbeddingCache, type VaultFolderOperationsContext, type VaultMemoryOperationsContext, type VaultMemoryVisibility, type VaultSaveOperation, type VaultSearchResult, type VerificationSources, type VerifyMemoriesForPublishOptions, type VoiceRecording, WalletPoller, WatermelonChatStorageAdapter, type WatermelonChatStorageAdapterOptions, type WeatherClassification, type WeatherPreProcessorOptions, type WebSearchClassification, type WebSearchPreProcessorOptions, type WhisperModel, WordProcessor, ZipProcessor, type ZipProcessorOptions, addConversationMemoriesOp, appFileToStored, archiveVaultMemoryOp, backfillMemoryEntityUserIdsOp, backfillMemoryTopicsOp, capHopsForDensity, chatStorageMigrations, chatStorageSchema, chunkAndEmbedAllMessages, chunkAndEmbedMessage, chunkText, classifyCryptoPrice, classifyCryptoPriceBatch, classifyDecay, classifyInjectionCandidates, classifyObservationTrend, classifyStockPrice, classifyStockPriceBatch, classifyWeather, classifyWeatherBatch, classifyWebSearch, classifyWebSearchBatch, clearAllEncryptionKeys, clearAllEncryptionState, clearAllKeyPairs, clearCalendarToken, clearConversationMemoriesOp, clearDriveToken, clearToken as clearDropboxToken, clearEncryptionKey, clearGithubToken, clearGoogleDriveToken, clearICloudAuth, clearKeyPair, clearLazyTitleCache, clearMemoryTopicsOverrideOp, clearNotionToken, clearServerToolsCache, consoleLogger, conversationMemoryToStored, cosineInt8, createAutoExtractor, createChunkVectorCache, createCryptoPricePreProcessor, createDecaySweeper, createGitHubTools, createLlmDecayClassifier, createLlmNeighborRefiner, createMediaBatchOp, createMediaOp, createMemoryEngineTool, createMemoryVaultSearchTool, createMemoryVaultTool, createMessageSourceResolver, createPlatformCursorStore, createProjectOp, createRecallTool, createSavedToolOp, createServerToolsFilter, createStockPricePreProcessor, createVaultEmbeddingCache, createVaultFolderOp, createVaultMemoriesBatchOp, createVaultMemoryOp, createWeatherPreProcessor, createWebSearchPreProcessor, decodeChunkVector, decryptConversationTitle, decryptData, decryptDataBatch, decryptDataBytes, decryptDataBytesFromBytes, decryptDataWithKey, defaultServerToolsFilter, deleteAllAppFilesOp, deleteAllVaultMemoriesForUserOp, deleteAppFileOp, deleteEncryptedFile, deleteMediaByConversationOp, deleteMediaByMessageOp, deleteMediaOp, deleteProjectOp, deleteSavedToolOp, deleteVaultFolderOp, deleteVaultMemoryOp, dequantizeEmbedding, eagerEmbedContent, embedAllMessages, embedMessage, encodeChunkVector, encryptData, encryptDataBatch, encryptDataBytes, encryptDataWithKey, ensureDefaultFoldersOp, expandToolSetsAdditive, exportElementToPdf, exportMarkdownToPdf, exportPublicKey, extractAndLinkEntitiesForMemoriesOp, extractAndRetain, extractEntitiesForMemories, extractFacts, extractFileIds, fileExists, findById, findMatchingTools, findParentOfId, generateConversationId, generateEmbedding, generateEmbeddings, generateMediaId, generateProjectId, getAIGeneratedMediaOp, getAllSavedToolsOp, getAllVaultFoldersOp, getAllVaultMemoriesOp, getAllVaultMemoryContentsOp, getAndClearCalendarPendingMessage, getAndClearCalendarReturnUrl, getAndClearDrivePendingMessage, getAndClearDriveReturnUrl, getAndClearGithubPendingMessage, getAndClearGithubReturnUrl, getAndClearNotionPendingMessage, getAndClearNotionReturnUrl, getAppFileMapOp, getAppFileOp, getAppFilesOp, getAudioOp, getCachedServerTools, getCalendarAccessToken, getConversationMemoriesOp, getConversationsByProjectLazyOp, getConversationsByProjectOp, getConversationsLazyOp, getConversationsPageOp, getDecayCandidatesRawOp, getDocumentsOp, getDriveAccessToken, getEncryptionKey, getEntitiesByMemoryIdsOp, getGithubAccessToken, getGoogleDriveStoredToken, getId, getImagesOp, getLogger, getMediaByConversationOp, getMediaByIdOp, getMediaByIdsOp, getMediaByMessageOp, getMediaByModelOp, getMediaByRoleOp, getMediaBySourceUrlOp, getMediaByTypeOp, getMediaCountOp, getMediaCountsByTypeOp, getMediaOp, getMediaTypeFromMime, getMemoriesByEntityNamesOp, getMemoriesNeedingTopicExtractionOp, getNotionAccessToken, getNotionMCPUrl, getNumberAttr, getProjectConversationCountOp, getProjectConversationsOp, getProjectOp, getProjectsOp, getRecentMediaOp, getSavedToolByIdOp, getServerTools, getStringAttr, getSupportedFileTypes, getToolsChecksum, getUnfiledVaultMemoriesOp, getUserUploadedMediaOp, getValidCalendarToken, getValidDriveToken, getValidGithubToken, getValidNotionToken, getVaultCandidateKeysOp, getVaultEmbeddingsByIdsOp, getVaultFolderMemoryCountOp, getVaultMemoriesByIdsOp, getVaultMemoryOp, getVaultRankingProjectionsOp, getVideosOp, handleCalendarCallback, handleDriveCallback, handleGithubCallback, handleNotionCallback, hardDeleteDecayedOp, hardDeleteMediaOp, hasCalendarCredentials, hasDriveCredentials, hasDropboxCredentials, hasEncryptionKey, hasGithubCredentials, hasGoogleDriveCredentials, hasICloudCredentials, hasKeyPair, hasNotionCredentials, ingestPublishedPhotoMemoriesOp, injectionSignatureCatalog, insertAfterId, insertChild, isAnumaTag, isCalendarCallback, isDriveCallback, isGithubCallback, isHtmlTag, isNotionCallback, isOPFSSupported, isR2UrlExpired, isRerankerAvailable, isSupportedFile, isSupportedMediaType, linkMemoryEntitiesOp, mediaToStored, migrateCalendarToken, migrateDisplayResult, migrateDriveToken, migrateGithubToken, migrateNotionClientRegistration, migrateNotionToken, moveMemoriesToFolderOp, noopLogger, onKeyAvailable, parseJsx, parseMedia, preEmbedVaultMemories, preprocessFiles, previewToolSelection, projectToStored, putAppFileOp, quantizeEmbedding, queueManager, rankProfileCandidates, readEncryptedFile, recall, reflect, refreshCalendarToken, refreshDriveToken, refreshEncryptionKeyIfMatches, refreshGithubToken, refreshNotionToken, relinkMemoryTopicsOp, relinkMisclassifiedVideosOp, removeById, renderAnumaJsx, renderAnumaTree, renderElementToCanvas, replaceById, replaceMemoryEntitiesGuardedOp, requestEncryptionKey, requestKeyPair, resolveFilePlaceholders, resolveThemeColor, restoreVaultMemoryOp, resumeStream, retain, revokeCalendarToken, revokeDriveToken, revokeGithubToken, revokeNotionAccess, savedToolToStored, scoreProfileSalience, screenCandidatesForInjection, sdkMigrations, sdkModelClasses, sdkSchema, searchChunksOp, searchMediaOp, searchMessagesOp, searchVaultMemories, seedEncryptionKeys, selectServerToolsForPrompt, serializeJsx, setLogger, setMemoryEntitiesOp, setMemoryVisibilityOp, settingsStorageSchema, shouldChunkMessage, shouldRefreshTools, stampTopicsExtractedAtOp, startGithubAuth, startNotionAuth, storeCalendarPendingMessage, storeCalendarReturnUrl, storeCalendarToken, storeDrivePendingMessage, storeDriveReturnUrl, storeDriveToken, storeGithubPendingMessage, storeGithubReturnUrl, storeGithubToken, storeNotionPendingMessage, storeNotionReturnUrl, streamCancelPath, streamReplayPath, summarizeObservationTrends, supersedeVaultMemoryOp, synthesizeProfile, traverseGraphLane, ttlForType, updateAttrs, updateConversationProjectOp, updateMediaMessageIdBatchOp, updateMediaOp, updateMessageFeedbackOp, updateProjectNameOp, updateProjectOp, updateSavedToolOp, updateVaultFolderContextOp, updateVaultFolderOp, updateVaultMemoryEmbeddingOp, updateVaultMemoryOp, useAnumaTheme, useBackup, useBackupAuth, useChat, useChatStorage, useCredits, useDatabaseManager, useDropboxAuth, useDropboxBackup, useEncryption, useExportPdf, useFiles, useGoogleDriveAuth, useGoogleDriveBackup, useICloudAuth, useICloudBackup, useModels, useOCR, usePdf, usePhoneCalls, useProjects, useSettings, useSubscription, useTools, useUIInteraction, useVoice, useWalletBinding, userPreferencesStorageSchema, verifyMemoriesForPublish, walk, webPlatformStorage, writeEncryptedFile };