@anuma/sdk 11.3.4 → 11.4.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.
@@ -1481,6 +1481,7 @@ __export(index_exports, {
1481
1481
  addConversationMemoriesOp: () => addConversationMemoriesOp,
1482
1482
  anumaLastReadSortKey: () => anumaLastReadSortKey,
1483
1483
  anumaTurnContent: () => anumaTurnContent,
1484
+ appFileId: () => appFileId,
1484
1485
  archiveVaultMemoryOp: () => archiveVaultMemoryOp,
1485
1486
  assembleMemoryContext: () => assembleMemoryContext,
1486
1487
  attachFileContextToLastUserMessage: () => attachFileContextToLastUserMessage,
@@ -1515,6 +1516,7 @@ __export(index_exports, {
1515
1516
  conversationMemoryToStored: () => conversationMemoryToStored,
1516
1517
  cosineInt8: () => cosineInt8,
1517
1518
  countUnreadAnumaTurns: () => countUnreadAnumaTurns,
1519
+ createAppFileIndex: () => createAppFileIndex,
1518
1520
  createAutoExtractor: () => createAutoExtractor,
1519
1521
  createChunkVectorCache: () => createChunkVectorCache,
1520
1522
  createCryptoPricePreProcessor: () => createCryptoPricePreProcessor,
@@ -1552,7 +1554,9 @@ __export(index_exports, {
1552
1554
  decryptConversationTitle: () => decryptConversationTitle,
1553
1555
  decryptMessageEmbeddingFields: () => decryptMessageEmbeddingFields,
1554
1556
  deleteAllVaultMemoriesForUserOp: () => deleteAllVaultMemoriesForUserOp,
1557
+ deleteAppFile: () => deleteAppFile,
1555
1558
  deleteMessageOp: () => deleteMessageOp,
1559
+ deleteSavedTool: () => deleteSavedTool,
1556
1560
  deleteVaultFolderOp: () => deleteVaultFolderOp,
1557
1561
  deleteVaultMemoryOp: () => deleteVaultMemoryOp,
1558
1562
  dequantizeEmbedding: () => dequantizeEmbedding,
@@ -1581,6 +1585,7 @@ __export(index_exports, {
1581
1585
  getAllVaultFoldersOp: () => getAllVaultFoldersOp,
1582
1586
  getAllVaultMemoriesOp: () => getAllVaultMemoriesOp,
1583
1587
  getAllVaultMemoryContentsOp: () => getAllVaultMemoryContentsOp,
1588
+ getAppFile: () => getAppFile,
1584
1589
  getCachedServerTools: () => getCachedServerTools,
1585
1590
  getConversationMemoriesOp: () => getConversationMemoriesOp,
1586
1591
  getConversationsByProjectLazyOp: () => getConversationsByProjectLazyOp,
@@ -1605,6 +1610,9 @@ __export(index_exports, {
1605
1610
  isPiiRedactor: () => isPiiRedactor,
1606
1611
  isRerankerAvailable: () => isRerankerAvailable,
1607
1612
  listActiveStreams: () => listActiveStreams,
1613
+ listAppFiles: () => listAppFiles,
1614
+ listEveryAppFile: () => listEveryAppFile,
1615
+ loadSavedTools: () => loadSavedTools,
1608
1616
  loadSettings: () => loadSettings,
1609
1617
  localChatBackend: () => localChatBackend,
1610
1618
  markAnumaRead: () => markAnumaRead,
@@ -1637,6 +1645,8 @@ __export(index_exports, {
1637
1645
  restoreVaultMemoryOp: () => restoreVaultMemoryOp,
1638
1646
  resumeStream: () => resumeStream,
1639
1647
  retain: () => retain,
1648
+ saveAppFile: () => saveAppFile,
1649
+ saveSavedTool: () => saveSavedTool,
1640
1650
  saveSetting: () => saveSetting,
1641
1651
  scoreProfileSalience: () => scoreProfileSalience,
1642
1652
  screenCandidatesForInjection: () => screenCandidatesForInjection,
@@ -1645,6 +1655,7 @@ __export(index_exports, {
1645
1655
  sdkSchema: () => sdkSchema,
1646
1656
  sealLegacyMessageEmbeddingsOp: () => sealLegacyMessageEmbeddingsOp,
1647
1657
  searchVaultMemories: () => searchVaultMemories,
1658
+ seedAppFilesToVault: () => seedAppFilesToVault,
1648
1659
  seedEncryptionKeys: () => seedEncryptionKeys,
1649
1660
  setLogger: () => setLogger,
1650
1661
  setMemoryVisibilityOp: () => setMemoryVisibilityOp,
@@ -7348,9 +7359,9 @@ function createNearbyRequest(options, apiPath = "/api/private-memories") {
7348
7359
  };
7349
7360
  const request = async (path, init = {}, signal) => {
7350
7361
  const controller = new AbortController();
7351
- let timedOut = false;
7362
+ let timedOut2 = false;
7352
7363
  const timer = setTimeout(() => {
7353
- timedOut = true;
7364
+ timedOut2 = true;
7354
7365
  controller.abort();
7355
7366
  }, timeoutMs);
7356
7367
  const forwardAbort = () => controller.abort(signal?.reason);
@@ -7416,7 +7427,7 @@ function createNearbyRequest(options, apiPath = "/api/private-memories") {
7416
7427
  if (response.status === 204) return null;
7417
7428
  return await response.json();
7418
7429
  } catch (error) {
7419
- if (timedOut) throw new RemoteMemoryError("Nearby request timed out", 408, "timeout");
7430
+ if (timedOut2) throw new RemoteMemoryError("Nearby request timed out", 408, "timeout");
7420
7431
  throw error;
7421
7432
  } finally {
7422
7433
  clearTimeout(timer);
@@ -13497,6 +13508,168 @@ function countUnreadAnumaTurns(messages, lastReadSortKey) {
13497
13508
  return turns.size;
13498
13509
  }
13499
13510
 
13511
+ // src/utils/paths.ts
13512
+ function normalizePath(p) {
13513
+ return p.replace(/^\/+/, "").replace(/\/\/+/g, "/").split("/").reduce((acc, seg) => {
13514
+ if (seg === "..") acc.pop();
13515
+ else if (seg !== ".") acc.push(seg);
13516
+ return acc;
13517
+ }, []).join("/");
13518
+ }
13519
+
13520
+ // src/lib/chatStore/appFiles.ts
13521
+ var maxSaveAttempts = 3;
13522
+ async function appFileId(store, conversationId, path) {
13523
+ if (!store.sealedId) throw new Error("App file ids need a chat store that seals ids");
13524
+ return store.sealedId(`app_file\0${conversationId}\0${normalizePath(path)}`);
13525
+ }
13526
+ async function putLatest(store, target, next, signal) {
13527
+ for (let attempt = 1; ; attempt++) {
13528
+ const current = await store.get(target.kind, target.id, signal);
13529
+ if (next.isDeleted && (!current || current.record.isDeleted)) return current;
13530
+ const now = Date.now();
13531
+ try {
13532
+ const [saved] = await store.putMany(
13533
+ [
13534
+ {
13535
+ record: {
13536
+ ...target,
13537
+ sortKey: 0,
13538
+ createdAt: current?.record.createdAt ?? now,
13539
+ updatedAt: Math.max(now, (current?.record.updatedAt ?? 0) + 1),
13540
+ isDeleted: next.isDeleted,
13541
+ data: next.isDeleted ? {} : next.data
13542
+ },
13543
+ expectedVersion: current?.version ?? 0
13544
+ }
13545
+ ],
13546
+ signal
13547
+ );
13548
+ return saved;
13549
+ } catch (error) {
13550
+ if (!(error instanceof ChatStoreError) || error.code !== "version_conflict" || attempt >= maxSaveAttempts)
13551
+ throw error;
13552
+ }
13553
+ }
13554
+ }
13555
+ async function listAll(store, kind, conversationId, signal) {
13556
+ const out = [];
13557
+ let cursor;
13558
+ do {
13559
+ const page = await store.list({ kind, conversationId, limit: 100, cursor, signal });
13560
+ out.push(...page.items.filter((item) => !item.record.isDeleted));
13561
+ cursor = page.nextCursor;
13562
+ } while (cursor);
13563
+ return out;
13564
+ }
13565
+ function toAppFile(snapshot) {
13566
+ const { path, content } = snapshot.record.data;
13567
+ if (typeof path !== "string" || typeof content !== "string") return null;
13568
+ return {
13569
+ conversationId: snapshot.record.conversationId,
13570
+ path,
13571
+ content,
13572
+ version: snapshot.version,
13573
+ createdAt: snapshot.record.createdAt,
13574
+ updatedAt: snapshot.record.updatedAt
13575
+ };
13576
+ }
13577
+ function toSavedTool(snapshot) {
13578
+ const d = snapshot.record.data;
13579
+ if (typeof d.name !== "string" || typeof d.displayName !== "string" || typeof d.description !== "string" || typeof d.parameters !== "string" || typeof d.html !== "string" || d.conversationId !== null && typeof d.conversationId !== "string")
13580
+ return null;
13581
+ return {
13582
+ id: snapshot.record.id,
13583
+ name: d.name,
13584
+ displayName: d.displayName,
13585
+ description: d.description,
13586
+ parameters: d.parameters,
13587
+ html: d.html,
13588
+ conversationId: d.conversationId,
13589
+ version: snapshot.version,
13590
+ createdAt: snapshot.record.createdAt,
13591
+ updatedAt: snapshot.record.updatedAt
13592
+ };
13593
+ }
13594
+ async function listAppFiles(store, conversationId, signal) {
13595
+ const items = await listAll(store, "app_file", conversationId, signal);
13596
+ return items.map(toAppFile).filter((file) => file !== null);
13597
+ }
13598
+ function createAppFileIndex(store) {
13599
+ const latest = /* @__PURE__ */ new Map();
13600
+ let cursor;
13601
+ let queue = Promise.resolve();
13602
+ const catchUp = async (signal) => {
13603
+ for (; ; ) {
13604
+ const page = await store.changes(cursor, { kinds: ["app_file"], limit: 200, signal });
13605
+ for (const item of page.items) latest.set(item.record.id, item);
13606
+ cursor = page.nextCursor ?? page.changesCursor;
13607
+ if (!page.nextCursor) break;
13608
+ }
13609
+ return [...latest.values()].filter((item) => !item.record.isDeleted).map(toAppFile).filter((file) => file !== null);
13610
+ };
13611
+ return {
13612
+ list(signal) {
13613
+ const next = queue.then(() => catchUp(signal));
13614
+ queue = next.catch(() => void 0);
13615
+ return next;
13616
+ }
13617
+ };
13618
+ }
13619
+ function listEveryAppFile(store, signal) {
13620
+ return createAppFileIndex(store).list(signal);
13621
+ }
13622
+ async function getAppFile(store, conversationId, path, signal) {
13623
+ const snapshot = await store.get(
13624
+ "app_file",
13625
+ await appFileId(store, conversationId, path),
13626
+ signal
13627
+ );
13628
+ return snapshot && !snapshot.record.isDeleted ? toAppFile(snapshot) : null;
13629
+ }
13630
+ async function saveAppFile(store, file, signal) {
13631
+ const saved = await putLatest(
13632
+ store,
13633
+ {
13634
+ kind: "app_file",
13635
+ id: await appFileId(store, file.conversationId, file.path),
13636
+ conversationId: file.conversationId
13637
+ },
13638
+ { data: { path: normalizePath(file.path), content: file.content }, isDeleted: false },
13639
+ signal
13640
+ );
13641
+ return toAppFile(saved);
13642
+ }
13643
+ async function deleteAppFile(store, conversationId, path, signal) {
13644
+ await putLatest(
13645
+ store,
13646
+ { kind: "app_file", id: await appFileId(store, conversationId, path), conversationId },
13647
+ { data: {}, isDeleted: true },
13648
+ signal
13649
+ );
13650
+ }
13651
+ async function loadSavedTools(store, signal) {
13652
+ const items = await listAll(store, "saved_tool", void 0, signal);
13653
+ return items.map(toSavedTool).filter((tool) => tool !== null);
13654
+ }
13655
+ async function saveSavedTool(store, id2, tool, signal) {
13656
+ const saved = await putLatest(
13657
+ store,
13658
+ { kind: "saved_tool", id: id2, conversationId: "" },
13659
+ { data: { ...tool }, isDeleted: false },
13660
+ signal
13661
+ );
13662
+ return toSavedTool(saved);
13663
+ }
13664
+ async function deleteSavedTool(store, id2, signal) {
13665
+ await putLatest(
13666
+ store,
13667
+ { kind: "saved_tool", id: id2, conversationId: "" },
13668
+ { data: {}, isDeleted: true },
13669
+ signal
13670
+ );
13671
+ }
13672
+
13500
13673
  // src/lib/db/chat/summaryOperations.ts
13501
13674
  var import_watermelondb6 = require("@nozbe/watermelondb");
13502
13675
  init_logger();
@@ -13700,7 +13873,16 @@ function batches(records) {
13700
13873
  }
13701
13874
 
13702
13875
  // src/lib/chatStore/remote.ts
13703
- var kinds = /* @__PURE__ */ new Set(["conversation", "message", "summary", "project", "memory_links", "setting"]);
13876
+ var kinds = /* @__PURE__ */ new Set([
13877
+ "conversation",
13878
+ "message",
13879
+ "summary",
13880
+ "project",
13881
+ "memory_links",
13882
+ "setting",
13883
+ "app_file",
13884
+ "saved_tool"
13885
+ ]);
13704
13886
  var cipherPattern = /^enc:v\d+:(?:[0-9a-f]{2}){28,}$/i;
13705
13887
  var maxPayload = 2 * 1024 * 1024;
13706
13888
  var storedDims2 = 1536;
@@ -13760,7 +13942,7 @@ function validRecord(value) {
13760
13942
  return root ? value.conversationId === "" : id(value.conversationId);
13761
13943
  }
13762
13944
  function rootKind(kind) {
13763
- return kind === "conversation" || kind === "project" || kind === "setting";
13945
+ return kind === "conversation" || kind === "project" || kind === "setting" || kind === "saved_tool";
13764
13946
  }
13765
13947
  function embeddings(write) {
13766
13948
  if (write.embeddings === void 0) return true;
@@ -13841,6 +14023,7 @@ async function createRemoteChatStore(options) {
13841
14023
  const keyId = options.keyId;
13842
14024
  const encrypt = options.encrypt;
13843
14025
  const decrypt = options.decrypt;
14026
+ const hashTopic = options.hashTopic;
13844
14027
  const nearby = createNearbyRequest({ ...options }, "/api/private-chats");
13845
14028
  const request = async (...args) => {
13846
14029
  try {
@@ -13891,7 +14074,9 @@ async function createRemoteChatStore(options) {
13891
14074
  JSON.stringify({ schema: 1, account_id: accountId, key_id: keyId, record: record3 })
13892
14075
  );
13893
14076
  signal?.throwIfAborted();
13894
- if (!cipherPattern.test(payload) || payload.length > maxPayload) invalid();
14077
+ if (!cipherPattern.test(payload)) invalid();
14078
+ if (payload.length > maxPayload)
14079
+ throw new ChatStoreError("Encrypted chat record is too large", 413, "record_too_large");
13895
14080
  return payload;
13896
14081
  };
13897
14082
  const capture = (items, max, signal) => {
@@ -14172,6 +14357,7 @@ async function createRemoteChatStore(options) {
14172
14357
  if (!object(value) || !integer(value.deleted)) invalid();
14173
14358
  return value.deleted;
14174
14359
  },
14360
+ ...hashTopic ? { sealedId: (value) => hashTopic(`record-id\0${value}`) } : {},
14175
14361
  attachments: {
14176
14362
  async create(sizeBytes, signal) {
14177
14363
  if (!integer(sizeBytes, 1) || sizeBytes > maxAttachmentBytes) invalid();
@@ -14249,6 +14435,7 @@ var emptyMessage = {
14249
14435
  };
14250
14436
 
14251
14437
  // src/lib/chatStore/migrateChats.ts
14438
+ var timedOut = (error) => error instanceof ChatStoreError && error.status === 408;
14252
14439
  var maxPasses = 5;
14253
14440
  var verifyBatch = 1e3;
14254
14441
  var writeBatch = 25;
@@ -14517,19 +14704,107 @@ async function migrateChatsToRemote(options) {
14517
14704
  await journal.add(upload.map((r) => key(r.record)));
14518
14705
  let sent = 0;
14519
14706
  options.onProgress?.({ imported: sent, toImport: upload.length });
14520
- for (const batch of batches(upload)) {
14521
- await store.importRecords(batch, signal);
14707
+ const send = async (batch) => {
14708
+ try {
14709
+ await store.importRecords(batch, signal);
14710
+ } catch (error) {
14711
+ if (batch.length < 2 || !timedOut(error)) throw error;
14712
+ const half = Math.ceil(batch.length / 2);
14713
+ await send(batch.slice(0, half));
14714
+ await send(batch.slice(half));
14715
+ return;
14716
+ }
14522
14717
  sent += batch.length;
14523
14718
  options.onProgress?.({ imported: sent, toImport: upload.length });
14524
- }
14719
+ };
14720
+ for (const batch of batches(upload)) await send(batch);
14525
14721
  imported += sent;
14526
14722
  }
14527
14723
  };
14528
14724
  return passes(false);
14529
14725
  }
14530
14726
 
14727
+ // src/lib/chatStore/seedAppFiles.ts
14728
+ var maxSeedAttempts = 3;
14729
+ async function rawRows(database, table) {
14730
+ const rows = await database.get(table).query().fetch();
14731
+ return rows.map((row) => row._raw);
14732
+ }
14733
+ async function seedRecord(store, target, device, signal) {
14734
+ for (let attempt = 1; ; attempt++) {
14735
+ const current = await store.get(target.kind, target.id, signal);
14736
+ if (current && (current.record.isDeleted || current.record.updatedAt >= device.updatedAt))
14737
+ return false;
14738
+ try {
14739
+ await store.putMany(
14740
+ [
14741
+ {
14742
+ record: {
14743
+ ...target,
14744
+ sortKey: 0,
14745
+ createdAt: current?.record.createdAt ?? device.createdAt,
14746
+ updatedAt: device.updatedAt,
14747
+ isDeleted: false,
14748
+ data: device.data
14749
+ },
14750
+ expectedVersion: current?.version ?? 0
14751
+ }
14752
+ ],
14753
+ signal
14754
+ );
14755
+ return true;
14756
+ } catch (error) {
14757
+ if (!(error instanceof ChatStoreError) || error.code !== "version_conflict" || attempt >= maxSeedAttempts)
14758
+ throw error;
14759
+ }
14760
+ }
14761
+ }
14762
+ function leftOnDevice(error, result) {
14763
+ if (!(error instanceof ChatStoreError)) return false;
14764
+ if (error.code === "conversation_not_found") result.orphaned++;
14765
+ else if (error.code === "record_too_large") result.tooLarge++;
14766
+ else return false;
14767
+ return true;
14768
+ }
14769
+ async function seedAppFilesToVault(database, store, signal) {
14770
+ const result = { appFiles: 0, savedTools: 0, orphaned: 0, tooLarge: 0 };
14771
+ for (const file of await rawRows(database, "app_files")) {
14772
+ try {
14773
+ const target = {
14774
+ kind: "app_file",
14775
+ id: await appFileId(store, file.conversation_id, file.path),
14776
+ conversationId: file.conversation_id
14777
+ };
14778
+ const data = { path: normalizePath(file.path), content: file.content };
14779
+ const device = { data, createdAt: file.created_at, updatedAt: file.updated_at };
14780
+ if (await seedRecord(store, target, device, signal)) result.appFiles++;
14781
+ } catch (error) {
14782
+ if (!leftOnDevice(error, result)) throw error;
14783
+ }
14784
+ }
14785
+ for (const tool of await rawRows(database, "saved_tools")) {
14786
+ if (tool.is_deleted) continue;
14787
+ try {
14788
+ const data = {
14789
+ name: tool.name,
14790
+ displayName: tool.display_name,
14791
+ description: tool.description,
14792
+ parameters: tool.parameters,
14793
+ html: tool.html,
14794
+ conversationId: tool.conversation_id || null
14795
+ };
14796
+ const target = { kind: "saved_tool", id: tool.id, conversationId: "" };
14797
+ const device = { data, createdAt: tool.created_at, updatedAt: tool.updated_at };
14798
+ if (await seedRecord(store, target, device, signal)) result.savedTools++;
14799
+ } catch (error) {
14800
+ if (!leftOnDevice(error, result)) throw error;
14801
+ }
14802
+ }
14803
+ return result;
14804
+ }
14805
+
14531
14806
  // src/lib/chatStore/settings.ts
14532
- var maxSaveAttempts = 3;
14807
+ var maxSaveAttempts2 = 3;
14533
14808
  function toSetting(snapshot) {
14534
14809
  if (snapshot.record.isDeleted) return null;
14535
14810
  return {
@@ -14578,7 +14853,7 @@ async function saveSetting(store, section, data, signal) {
14578
14853
  );
14579
14854
  return toSetting(saved);
14580
14855
  } catch (error) {
14581
- if (!(error instanceof ChatStoreError) || error.code !== "version_conflict" || attempt >= maxSaveAttempts)
14856
+ if (!(error instanceof ChatStoreError) || error.code !== "version_conflict" || attempt >= maxSaveAttempts2)
14582
14857
  throw error;
14583
14858
  }
14584
14859
  }
@@ -15404,12 +15679,15 @@ function createVaultChatBackend(options) {
15404
15679
  emit({ type: "vector_quota" });
15405
15680
  return "retry";
15406
15681
  }
15407
- if (error.code === "private_chat_storage_limit_reached" || error.code === "invalid_record" || error.status === 400) {
15682
+ if (error.code === "private_chat_storage_limit_reached" || error.code === "invalid_record" || error.code === "record_too_large" || error.status === 400) {
15408
15683
  if (batch.length > 1) {
15409
15684
  isolate = batch.length;
15410
15685
  return "retry";
15411
15686
  }
15412
- drop(batch[0], error.status === 413 ? "storage_quota" : "invalid");
15687
+ drop(
15688
+ batch[0],
15689
+ error.code === "private_chat_storage_limit_reached" ? "storage_quota" : "invalid"
15690
+ );
15413
15691
  return "retry";
15414
15692
  }
15415
15693
  if (error.status === 429) return backoff(error.retryAfterMs, true);
@@ -27059,6 +27337,12 @@ async function importBatch2(request, keyId, rows, signal) {
27059
27337
  );
27060
27338
  return;
27061
27339
  } catch (error) {
27340
+ if (error instanceof RemoteMemoryError && error.status === 408 && rows.length > 1) {
27341
+ const half = Math.ceil(rows.length / 2);
27342
+ await importBatch2(request, keyId, rows.slice(0, half), signal);
27343
+ await importBatch2(request, keyId, rows.slice(half), signal);
27344
+ return;
27345
+ }
27062
27346
  if (!(error instanceof RemoteMemoryError) || error.status !== 429 || attempt >= MAX_RATE_LIMIT_WAITS)
27063
27347
  throw error;
27064
27348
  await wait(error.retryAfterMs ?? DEFAULT_RATE_LIMIT_WAIT_MS, signal);
@@ -35879,6 +36163,7 @@ function useChatStorage(options) {
35879
36163
  addConversationMemoriesOp,
35880
36164
  anumaLastReadSortKey,
35881
36165
  anumaTurnContent,
36166
+ appFileId,
35882
36167
  archiveVaultMemoryOp,
35883
36168
  assembleMemoryContext,
35884
36169
  attachFileContextToLastUserMessage,
@@ -35913,6 +36198,7 @@ function useChatStorage(options) {
35913
36198
  conversationMemoryToStored,
35914
36199
  cosineInt8,
35915
36200
  countUnreadAnumaTurns,
36201
+ createAppFileIndex,
35916
36202
  createAutoExtractor,
35917
36203
  createChunkVectorCache,
35918
36204
  createCryptoPricePreProcessor,
@@ -35950,7 +36236,9 @@ function useChatStorage(options) {
35950
36236
  decryptConversationTitle,
35951
36237
  decryptMessageEmbeddingFields,
35952
36238
  deleteAllVaultMemoriesForUserOp,
36239
+ deleteAppFile,
35953
36240
  deleteMessageOp,
36241
+ deleteSavedTool,
35954
36242
  deleteVaultFolderOp,
35955
36243
  deleteVaultMemoryOp,
35956
36244
  dequantizeEmbedding,
@@ -35979,6 +36267,7 @@ function useChatStorage(options) {
35979
36267
  getAllVaultFoldersOp,
35980
36268
  getAllVaultMemoriesOp,
35981
36269
  getAllVaultMemoryContentsOp,
36270
+ getAppFile,
35982
36271
  getCachedServerTools,
35983
36272
  getConversationMemoriesOp,
35984
36273
  getConversationsByProjectLazyOp,
@@ -36003,6 +36292,9 @@ function useChatStorage(options) {
36003
36292
  isPiiRedactor,
36004
36293
  isRerankerAvailable,
36005
36294
  listActiveStreams,
36295
+ listAppFiles,
36296
+ listEveryAppFile,
36297
+ loadSavedTools,
36006
36298
  loadSettings,
36007
36299
  localChatBackend,
36008
36300
  markAnumaRead,
@@ -36035,6 +36327,8 @@ function useChatStorage(options) {
36035
36327
  restoreVaultMemoryOp,
36036
36328
  resumeStream,
36037
36329
  retain,
36330
+ saveAppFile,
36331
+ saveSavedTool,
36038
36332
  saveSetting,
36039
36333
  scoreProfileSalience,
36040
36334
  screenCandidatesForInjection,
@@ -36043,6 +36337,7 @@ function useChatStorage(options) {
36043
36337
  sdkSchema,
36044
36338
  sealLegacyMessageEmbeddingsOp,
36045
36339
  searchVaultMemories,
36340
+ seedAppFilesToVault,
36046
36341
  seedEncryptionKeys,
36047
36342
  setLogger,
36048
36343
  setMemoryVisibilityOp,
@@ -2662,7 +2662,7 @@ type ApiType = "auto" | "responses" | "completions";
2662
2662
  */
2663
2663
  type ApiResponse = LlmapiResponseResponse | LlmapiChatCompletionResponse;
2664
2664
 
2665
- type ChatRecordKind = "conversation" | "message" | "summary" | "project" | "memory_links" | "setting";
2665
+ type ChatRecordKind = "conversation" | "message" | "summary" | "project" | "memory_links" | "setting" | "app_file" | "saved_tool";
2666
2666
  type ChatJson = null | boolean | number | string | ChatJson[] | {
2667
2667
  [key: string]: ChatJson;
2668
2668
  };
@@ -2796,6 +2796,8 @@ interface ChatStore {
2796
2796
  }): Promise<ChatChanges>;
2797
2797
  search(embedding: readonly number[], options?: ChatSearchOptions): Promise<ChatSearchHit[]>;
2798
2798
  deleteAll(signal?: AbortSignal): Promise<number>;
2799
+ /** A keyed hash vault cannot reproduce, for record ids derived from private names. */
2800
+ sealedId?(value: string): Promise<string>;
2799
2801
  attachments: ChatAttachments;
2800
2802
  }
2801
2803
  interface RemoteChatStoreOptions {
@@ -2804,6 +2806,7 @@ interface RemoteChatStoreOptions {
2804
2806
  keyId: string;
2805
2807
  encrypt: (plaintext: string) => Promise<string>;
2806
2808
  decrypt: (ciphertext: string) => Promise<string>;
2809
+ hashTopic?: (normalized: string) => Promise<string>;
2807
2810
  fetch?: typeof globalThis.fetch;
2808
2811
  timeoutMs?: number;
2809
2812
  signal?: AbortSignal;
@@ -8559,6 +8562,54 @@ declare function markAnumaRead(store: ChatStore, sortKey: number, options?: {
8559
8562
  /** Counts Anuma turns the user has not read: assistant turns above both the read marker and the user's latest message. */
8560
8563
  declare function countUnreadAnumaTurns(messages: readonly Pick<StoredMessage, "messageId" | "role" | "anuma" | "uniqueId">[], lastReadSortKey: number): number;
8561
8564
 
8565
+ interface AppFile {
8566
+ conversationId: string;
8567
+ path: string;
8568
+ content: string;
8569
+ version: number;
8570
+ createdAt: number;
8571
+ updatedAt: number;
8572
+ }
8573
+ interface SavedToolData {
8574
+ name: string;
8575
+ displayName: string;
8576
+ description: string;
8577
+ parameters: string;
8578
+ html: string;
8579
+ conversationId: string | null;
8580
+ }
8581
+ interface SavedTool extends SavedToolData {
8582
+ id: string;
8583
+ version: number;
8584
+ createdAt: number;
8585
+ updatedAt: number;
8586
+ }
8587
+ /** The vault record id of a conversation's file: a keyed hash, so vault cannot tell the path. */
8588
+ declare function appFileId(store: Pick<ChatStore, "sealedId">, conversationId: string, path: string): Promise<string>;
8589
+ /** Every live file of one conversation. */
8590
+ declare function listAppFiles(store: ChatStore, conversationId: string, signal?: AbortSignal): Promise<AppFile[]>;
8591
+ interface AppFileIndex {
8592
+ /** Every live file of every conversation, fetching only what changed since the last call. */
8593
+ list(signal?: AbortSignal): Promise<AppFile[]>;
8594
+ }
8595
+ /** Keeps every app file of the account current from the changes feed. */
8596
+ declare function createAppFileIndex(store: ChatStore): AppFileIndex;
8597
+ /** Every live file of every conversation, read from the changes feed. */
8598
+ declare function listEveryAppFile(store: ChatStore, signal?: AbortSignal): Promise<AppFile[]>;
8599
+ /** One conversation file, or null when vault holds none at that path. */
8600
+ declare function getAppFile(store: ChatStore, conversationId: string, path: string, signal?: AbortSignal): Promise<AppFile | null>;
8601
+ /** Creates or replaces a conversation file; the last save of a path wins across devices. */
8602
+ declare function saveAppFile(store: ChatStore, file: {
8603
+ conversationId: string;
8604
+ path: string;
8605
+ content: string;
8606
+ }, signal?: AbortSignal): Promise<AppFile>;
8607
+ declare function deleteAppFile(store: ChatStore, conversationId: string, path: string, signal?: AbortSignal): Promise<void>;
8608
+ declare function loadSavedTools(store: ChatStore, signal?: AbortSignal): Promise<SavedTool[]>;
8609
+ /** Creates or replaces a saved tool; the last save wins across devices. */
8610
+ declare function saveSavedTool(store: ChatStore, id: string, tool: SavedToolData, signal?: AbortSignal): Promise<SavedTool>;
8611
+ declare function deleteSavedTool(store: ChatStore, id: string, signal?: AbortSignal): Promise<void>;
8612
+
8562
8613
  interface ChatMigrationOptions {
8563
8614
  /** The device's local chat database. */
8564
8615
  database: Database;
@@ -8606,6 +8657,20 @@ declare function migrateChatsToRemote(options: ChatMigrationOptions): Promise<Ch
8606
8657
  /** Connect to owner-scoped server storage using the account's canonical device-held cipher. */
8607
8658
  declare function createRemoteChatStore(options: RemoteChatStoreOptions): Promise<ChatStore>;
8608
8659
 
8660
+ interface AppFileSeedResult {
8661
+ appFiles: number;
8662
+ savedTools: number;
8663
+ /** Files of conversations vault does not hold, left on the device. */
8664
+ orphaned: number;
8665
+ /** Files too large for one vault record, left on the device. */
8666
+ tooLarge: number;
8667
+ }
8668
+ /**
8669
+ * Uploads this device's app files and saved tools that vault lacks or holds an older edit of,
8670
+ * keeping each one's own edit time so the newest copy across devices wins.
8671
+ */
8672
+ declare function seedAppFilesToVault(database: Database, store: ChatStore, signal?: AbortSignal): Promise<AppFileSeedResult>;
8673
+
8609
8674
  interface Setting {
8610
8675
  section: string;
8611
8676
  data: {
@@ -12479,4 +12544,4 @@ interface UseChatStorageResult extends BaseUseChatStorageResult {
12479
12544
  */
12480
12545
  declare function useChatStorage(options: UseChatStorageOptions): UseChatStorageResult;
12481
12546
 
12482
- export { ANUMA_CONVERSATION_ID, type ActiveStream, type AnumaTurn, type AnumaTurnOrigin, type AutoExtractMessage, type AutoExtractor, type Budget, CHUNKS_DISCARDED_ORIGIN, type CachedChunkVectors, type CachedServerTools, type ChatAccount, type ChatAccountState, type ChatAttachment, type ChatAttachments, type ChatBackend, type ChatBackendFactory, type ChatBackendSigner, type ChatCacheStorage, type ChatChanges, type ChatChunkSearchOptions, Conversation as ChatConversation, type ChatImport, type ChatJson, type ChatListOptions, Message as ChatMessage, type ChatMigrationOptions, type ChatMigrationProgress, type ChatMigrationResult, type ChatMigrationSkip, type ChatOutboxLocks, type ChatOutboxStorage, type ChatPage, type ChatPresignedUrl, type ChatRecord, type ChatRecordKind, type ChatRef, type ChatRevision, type ChatRole, type ChatSearchHit, type ChatSearchOptions, type ChatSnapshot, type ChatStore, ChatStoreError, type ChatWrite, type ChunkSearchStats, type ChunkVectorCache, type ChunkingOptions, type ConsolidationAction, type ConsolidationFallbackReason, type ConversationMemoryInput, ConversationMemory as ConversationMemoryModel, type ConversationMemoryOperationsContext, type CreateAutoExtractorOptions, type CreateConversationOptions, type CreateDecaySweeperOptions, type CreateMessageOptions, type CreateSelectPaymentWalletToolOptions, type CreateVaultFolderOptions, type CreateVaultMemoryOptions, type CreateWalletPaymentToolOptions, 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, type DurableAutoExtractorOptions, ENTITY_FANOUT, type EmbeddedWalletSignerFn, type EmbeddingRepairOptions, type EmbeddingRepairResult, EncryptionKeyMissingError, type ExtractFactsOptions, type ExtractOutcome, type ExtractedCandidate, type ExtractedEntity, type ExtractionCursorStore, type ExtractionFunnel, type ExtractionMessageSource, type ExtractionSourceMessage, type ExtractionSourceStatus, type ExtractionTimings, type FactType, type FileMetadata, type FileProcessingReason, type FileProcessingStatus, type FlushResult, type GetConversationsPageOptions, type GetMessagesPageOptions, type GraphTraversalOptions, HARD_DELETE_WINDOW_MS, INFERENCE_ID_HEADER, type InboxDeliveryResult, type InboxItem, type InboxPlaintext, type InjectionClassifierOptions, type InjectionReason, type LazyStoredConversation, type LlmDecayClassifierOptions, type LlmNeighborRefinerOptions, type LocalMemoryStoreOptions, type LocalMessageAttachment, type Logger, LoggerProvider, type LoggerProviderProps, MAX_HOPS, MEDIUM_TTL_MS, MEMORY_KINDS, MEMORY_LEVELS, type ManualFactType, type MemoriesNeedingTopicExtraction, type MemoryContextItem, type MemoryContextLane, type MemoryContextOptions, type MemoryContextResult, type MemoryCounts, type MemoryCreate, type MemoryDecay, type MemoryDecaySweeperOptions, type EmbeddingOptions as MemoryEngineEmbeddingOptions, type MemoryEngineResult, type MemoryEngineSearchOptions, type MemoryExtractedEvent, MemoryKeyError, type MemoryKeyRing, type MemoryKind, type MemoryLevel, MemoryLevelError, type MemoryListOptions, type MemoryMaintenance, type MemoryMigrationOptions, type MemoryMigrationProgress, type MemoryMigrationResult, type MemoryMigrationSkip, type MemoryQuarantinedEvent, type MemoryRecallOptions, type MemoryRetainOptions, type MemoryStore, type MemorySubscribeOptions, type MemoryToVerify, type MemoryTopic, type MemoryTopicBacklog, type MemoryTopicMaintenance, type MemoryUpdate, type MemoryVaultSearchOptions, type MemoryVaultToolOptions, type MemoryVerification, type MessageAttachmentMigrationOptions, type MessageAttachmentMigrationResult, type MessageRedactionResult, type MessageSkeleton, NEVER_TTL_MS, NODE_BUDGET, NOTION_OAUTH_CONFIG, type NeighborRefiner, type NotionAuthUrlParams, type NotionClientRegistration, type NotionExchangeCodeParams, type NotionMcpCaller, type NotionOAuthEndpoints, type NotionPKCEChallenge, type NotionRefreshTokenParams, type NotionTokenResponse, type NowSource, type ObservationTrend, type ObservationTrendInput, PAST_EVENT_GRACE_MS, PII_PATTERNS, PROFILE_DOC_VERSION, type PaymentWallet, type PhotoIngestResult, type PhotoMediaRef, type PiiCategory, type PiiMatch, type PiiPattern, PiiRedactor, type PiiRedactorOptions, type PlatformStorage, type PortalLlmAuth, type PortalLlmFailure, type PortalLlmFailureReason, type ProfileConfigFingerprint, type ProfileDoc, type ProfileFacet, type ProfileFacetKey, type ProfileSalienceInput, type ProfileSection, type PromptPreProcessor, type PromptPreProcessorContext, type PublishedPhotoMemory, type QuantizedEmbedding, type QuarantinedMemoryInfo, QueueManager, type QueueStatus, RECALL_MAX_LIMIT, RECALL_TOOL_NAME, type RankableVaultMemory, type RankedMemory, type RankedProfileCandidate, type RecallContext, type RecallDegradation, type RecallDiagnostics, type RecallEmptyReason, type RecallOptions, type RecallResult, type RecallTelemetryCallbacks, type RecallToolCallbacks, type RecallToolOptions, type RecallTruncation, type RecencyOptions, type RedactionResult, type ReflectOptions, type ReflectResult, type RemoteChatStoreOptions, type RemoteMemoryCandidateOptions, type RemoteMemoryDecodeFailure, RemoteMemoryError, type RemoteMemoryListOptions, type RemoteMemoryMetadataPage, type RemoteMemoryMetadataRecord, type RemoteMemoryPage, RemoteMemoryPartialCreateError, type RemoteMemoryPersistence, type RemoteMemoryPersistenceOptions, type RemoteMemoryPipeline, type RemoteMemoryPipelineOptions, type RemoteMemoryQueryOptions, type RemoteMemoryQueryPage, type RemoteMemoryReadFilters, type RemoteMemoryRecord, type RemoteMemoryRow, type RemoteMemoryStoreOptions, type RemoteMemoryTopic, type RemoteMemoryWorkKind, type RemoteMemoryWorkLease, type RemoteMemoryWorkPersistence, type RemoteTopicPersistence, type RequestEncryptionKeyOptions, RerankerUnavailableError, type ReservationReceipt, type ResumeStreamOptions, type ResumeStreamResult, type ResumeStreamWithStorageResult, type RetainAction, type RetainContext, type RetainOptions, type RetainResult, type RetainSource, SDK_SCHEMA_VERSION, SELECT_PAYMENT_WALLET_TOOL_NAME, SHORT_TTL_MS, STREAM_RESUMABLE_HEADER, type ScoreBreakdown, type ScoreProfileSalienceOptions, type ScreenResult, type ScreenedCandidate, type SearchSource, type SelectPaymentWalletResult, type SendMessageWithStorageArgs, type SendMessageWithStorageDetachedResult, type SendMessageWithStorageResult, type ServerToolsOptions, type ServerToolsResponse, type Setting, type SignMessageFn, type StockPriceClassification, type StockPricePreProcessorOptions, type ChatCompletionUsage as StoredChatCompletionUsage, type StoredConversation, type StoredConversationMemory, type StoredMessage, type StoredMessageWithSimilarity, type StoredTopic, type StoredVaultFolder, VaultFolder as StoredVaultFolderModel, type StoredVaultMemory, VaultMemory as StoredVaultMemoryModel, StreamExpiredError, type StreamMetaEvent, type StreamResumeHandle, type StreamSmoothingConfig, type SynthesizeProfileOptions, TOOL_RESULT_ORIGIN, TOPICS_EXTRACTION_VERSION, TOPIC_EXTRACTION_BATCH_SIZE, TOPIC_SALIENCE_WEIGHTS, TREND_RECENT_WINDOW_DAYS, TREND_STALE_WINDOW_DAYS, type TextChunk, type TopicExtractOptions, type TopicExtractionBatchDiagnostics, type TopicExtractionInput, type TopicExtractionRunResult, type TopicSalience, type TopicSkipReason, 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 VaultAttachmentCache, type VaultAttachmentJournal, type VaultAttachmentOwner, type VaultAttachmentRef, type VaultAttachmentUploadOptions, type VaultAttachments, type VaultAttachmentsOptions, type VaultChatActivity, type VaultChatBackend, type VaultChatBackendOptions, type VaultChatEvent, type VaultEmbeddingCache, type VaultEmbeddingExpectation, type VaultFolderOperationsContext, type VaultInbox, type VaultMemoryKind, type VaultMemoryOperationsContext, type VaultMemoryProjection, type VaultMemoryVisibility, type VaultMemoryWriter, type VaultSaveOperation, type VaultSearchResult, type VaultWriteAction, type VaultWriteInput, type VaultWriteOutcome, type VerificationSources, type VerifyMemoriesForPublishOptions, WALLET_PAYMENT_TOOL_NAME, type WalletPaymentOutcome, type WalletPaymentPassenger, type WalletPaymentRequest, type WalletPaymentResult, WalletPoller, type WeatherClassification, type WeatherPreProcessorOptions, type WebSearchClassification, type WebSearchPreProcessorOptions, type WriteFailureReason, addConversationMemoriesOp, anumaLastReadSortKey, anumaTurnContent, archiveVaultMemoryOp, assembleMemoryContext, attachFileContextToLastUserMessage, backfillMemoryTopicsOp, buildAttachedFilesText, buildNotionAuthUrl, capHopsForDensity, chatStorageMigrations, chatStorageSchema, chunkAndEmbedAllMessages, chunkAndEmbedMessage, chunkText, classifyCryptoPrice, classifyCryptoPriceBatch, classifyDecay, classifyInjectionCandidates, classifyObservationTrend, classifyStockPrice, classifyStockPriceBatch, classifyWeather, classifyWeatherBatch, classifyWebSearch, classifyWebSearchBatch, clearAllEncryptionKeys, clearAllEncryptionState, clearConversationMemoriesOp, clearEncryptionKey, clearLazyTitleCache, clearModelsCache, clearServerToolsCache, consoleLogger, conversationMemoryToStored, cosineInt8, countUnreadAnumaTurns, createAutoExtractor, createChunkVectorCache, createCryptoPricePreProcessor, createDecaySweeper, createDurableAutoExtractor, createLlmDecayClassifier, createLlmNeighborRefiner, createLocalMemoryStore, createMemoryEngineTool, createMemoryVaultSearchTool, createMemoryVaultTool, createMessageSourceResolver, createNotionProxyTools, createNotionTools, createPlatformCursorStore, createRecallTool, createRemoteChatStore, createRemoteMemoryPersistence, createRemoteMemoryPipeline, createRemoteMemoryStore, createSelectPaymentWalletTool, createStockPricePreProcessor, createStreamingDeAnonymizer, createVaultAttachments, createVaultChatBackend, createVaultEmbeddingCache, createVaultFolderOp, createVaultInbox, createVaultMemoriesBatchOp, createVaultMemoryOp, createWalletPaymentTool, createWeatherPreProcessor, createWebSearchPreProcessor, decodeChunkVector, decryptConversationTitle, decryptMessageEmbeddingFields, deleteAllVaultMemoriesForUserOp, deleteMessageOp, deleteVaultFolderOp, deleteVaultMemoryOp, dequantizeEmbedding, deriveKeyFromSignatureBytes, deriveMemoryKeyRing, discoverNotionOAuthEndpoints, eagerEmbedContent, embedAllMessages, embedMessage, encodeChunkVector, encryptToolCallEventsOp, ensureAnumaConversation, ensureDefaultFoldersOp, exchangeNotionCode, exportInboxPublicKey, extractAndLinkEntitiesForMemoriesOp, extractAndRetain, extractEntitiesForMemories, extractFacts, extractReservationReceipts, formatFileProcessingNotes, generateConversationId, generateEmbedding, generateEmbeddings, generateNotionPKCE, getAllVaultFoldersOp, getAllVaultMemoriesOp, getAllVaultMemoryContentsOp, getCachedServerTools, getConversationMemoriesOp, getConversationsByProjectLazyOp, getConversationsLazyOp, getConversationsPageOp, getDecayCandidatesRawOp, getLogger, getMemoriesNeedingTopicExtractionOp, getServerTools, getUnfiledVaultMemoriesOp, getVaultFolderMemoryCountOp, getVaultMemoriesByIdsOp, getVaultMemoryOp, getVaultRankingProjectionsOp, hardDeleteDecayedOp, hasEncryptionKey, ingestPublishedPhotoMemoriesOp, injectionSignatureCatalog, isAttachedFilesText, isDegradedTopicSkip, isEncrypted, isPiiRedactor, isRerankerAvailable, listActiveStreams, loadSettings, localChatBackend, markAnumaRead, maskScopedEmbeddingCache, maxVaultAttachmentBytes, memoryCipher, migrateChatsToRemote, migrateMemoriesToRemote, migrateMessageAttachments, moveMemoriesToFolderOp, noopLogger, onKeyAvailable, openInboxItem, parseMedia, preEmbedVaultMemories, primaryTopic, quantizeEmbedding, queueManager, rankProfileCandidates, readAnumaTurn, recall, reencryptMemoryField, reflect, refreshEncryptionKeyIfMatches, refreshNotionAccessToken, registerNotionClient, relinkMemoryTopicsOp, requestEncryptionKey, resolvePiiRedactor, restoreVaultMemoryOp, resumeStream, retain, saveSetting, scoreProfileSalience, screenCandidatesForInjection, sdkMigrations, sdkModelClasses, sdkSchema, sealLegacyMessageEmbeddingsOp, searchVaultMemories, seedEncryptionKeys, setLogger, setMemoryVisibilityOp, shouldChunkMessage, shouldRecallMemory, stampTopicsExtractedAtOp, streamCancelPath, streamReplayPath, stripLegacyChunkTextOp, summarizeObservationTrends, supersedeVaultMemoryOp, synthesizeProfile, topicWeight, traverseGraphLane, ttlForType, updateVaultFolderContextOp, updateVaultFolderOp, updateVaultMemoryEmbeddingOp, updateVaultMemoryOp, upsertMessageOp, useChat, useChatStorage, useCredits, useEncryption, useModels, vaultAttachmentRefs, vaultChatBackend, verifyMemoriesForPublish, xhrTransport };
12547
+ export { ANUMA_CONVERSATION_ID, type ActiveStream, type AnumaTurn, type AnumaTurnOrigin, type AppFile, type AppFileIndex, type AppFileSeedResult, type AutoExtractMessage, type AutoExtractor, type Budget, CHUNKS_DISCARDED_ORIGIN, type CachedChunkVectors, type CachedServerTools, type ChatAccount, type ChatAccountState, type ChatAttachment, type ChatAttachments, type ChatBackend, type ChatBackendFactory, type ChatBackendSigner, type ChatCacheStorage, type ChatChanges, type ChatChunkSearchOptions, Conversation as ChatConversation, type ChatImport, type ChatJson, type ChatListOptions, Message as ChatMessage, type ChatMigrationOptions, type ChatMigrationProgress, type ChatMigrationResult, type ChatMigrationSkip, type ChatOutboxLocks, type ChatOutboxStorage, type ChatPage, type ChatPresignedUrl, type ChatRecord, type ChatRecordKind, type ChatRef, type ChatRevision, type ChatRole, type ChatSearchHit, type ChatSearchOptions, type ChatSnapshot, type ChatStore, ChatStoreError, type ChatWrite, type ChunkSearchStats, type ChunkVectorCache, type ChunkingOptions, type ConsolidationAction, type ConsolidationFallbackReason, type ConversationMemoryInput, ConversationMemory as ConversationMemoryModel, type ConversationMemoryOperationsContext, type CreateAutoExtractorOptions, type CreateConversationOptions, type CreateDecaySweeperOptions, type CreateMessageOptions, type CreateSelectPaymentWalletToolOptions, type CreateVaultFolderOptions, type CreateVaultMemoryOptions, type CreateWalletPaymentToolOptions, 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, type DurableAutoExtractorOptions, ENTITY_FANOUT, type EmbeddedWalletSignerFn, type EmbeddingRepairOptions, type EmbeddingRepairResult, EncryptionKeyMissingError, type ExtractFactsOptions, type ExtractOutcome, type ExtractedCandidate, type ExtractedEntity, type ExtractionCursorStore, type ExtractionFunnel, type ExtractionMessageSource, type ExtractionSourceMessage, type ExtractionSourceStatus, type ExtractionTimings, type FactType, type FileMetadata, type FileProcessingReason, type FileProcessingStatus, type FlushResult, type GetConversationsPageOptions, type GetMessagesPageOptions, type GraphTraversalOptions, HARD_DELETE_WINDOW_MS, INFERENCE_ID_HEADER, type InboxDeliveryResult, type InboxItem, type InboxPlaintext, type InjectionClassifierOptions, type InjectionReason, type LazyStoredConversation, type LlmDecayClassifierOptions, type LlmNeighborRefinerOptions, type LocalMemoryStoreOptions, type LocalMessageAttachment, type Logger, LoggerProvider, type LoggerProviderProps, MAX_HOPS, MEDIUM_TTL_MS, MEMORY_KINDS, MEMORY_LEVELS, type ManualFactType, type MemoriesNeedingTopicExtraction, type MemoryContextItem, type MemoryContextLane, type MemoryContextOptions, type MemoryContextResult, type MemoryCounts, type MemoryCreate, type MemoryDecay, type MemoryDecaySweeperOptions, type EmbeddingOptions as MemoryEngineEmbeddingOptions, type MemoryEngineResult, type MemoryEngineSearchOptions, type MemoryExtractedEvent, MemoryKeyError, type MemoryKeyRing, type MemoryKind, type MemoryLevel, MemoryLevelError, type MemoryListOptions, type MemoryMaintenance, type MemoryMigrationOptions, type MemoryMigrationProgress, type MemoryMigrationResult, type MemoryMigrationSkip, type MemoryQuarantinedEvent, type MemoryRecallOptions, type MemoryRetainOptions, type MemoryStore, type MemorySubscribeOptions, type MemoryToVerify, type MemoryTopic, type MemoryTopicBacklog, type MemoryTopicMaintenance, type MemoryUpdate, type MemoryVaultSearchOptions, type MemoryVaultToolOptions, type MemoryVerification, type MessageAttachmentMigrationOptions, type MessageAttachmentMigrationResult, type MessageRedactionResult, type MessageSkeleton, NEVER_TTL_MS, NODE_BUDGET, NOTION_OAUTH_CONFIG, type NeighborRefiner, type NotionAuthUrlParams, type NotionClientRegistration, type NotionExchangeCodeParams, type NotionMcpCaller, type NotionOAuthEndpoints, type NotionPKCEChallenge, type NotionRefreshTokenParams, type NotionTokenResponse, type NowSource, type ObservationTrend, type ObservationTrendInput, PAST_EVENT_GRACE_MS, PII_PATTERNS, PROFILE_DOC_VERSION, type PaymentWallet, type PhotoIngestResult, type PhotoMediaRef, type PiiCategory, type PiiMatch, type PiiPattern, PiiRedactor, type PiiRedactorOptions, type PlatformStorage, type PortalLlmAuth, type PortalLlmFailure, type PortalLlmFailureReason, type ProfileConfigFingerprint, type ProfileDoc, type ProfileFacet, type ProfileFacetKey, type ProfileSalienceInput, type ProfileSection, type PromptPreProcessor, type PromptPreProcessorContext, type PublishedPhotoMemory, type QuantizedEmbedding, type QuarantinedMemoryInfo, QueueManager, type QueueStatus, RECALL_MAX_LIMIT, RECALL_TOOL_NAME, type RankableVaultMemory, type RankedMemory, type RankedProfileCandidate, type RecallContext, type RecallDegradation, type RecallDiagnostics, type RecallEmptyReason, type RecallOptions, type RecallResult, type RecallTelemetryCallbacks, type RecallToolCallbacks, type RecallToolOptions, type RecallTruncation, type RecencyOptions, type RedactionResult, type ReflectOptions, type ReflectResult, type RemoteChatStoreOptions, type RemoteMemoryCandidateOptions, type RemoteMemoryDecodeFailure, RemoteMemoryError, type RemoteMemoryListOptions, type RemoteMemoryMetadataPage, type RemoteMemoryMetadataRecord, type RemoteMemoryPage, RemoteMemoryPartialCreateError, type RemoteMemoryPersistence, type RemoteMemoryPersistenceOptions, type RemoteMemoryPipeline, type RemoteMemoryPipelineOptions, type RemoteMemoryQueryOptions, type RemoteMemoryQueryPage, type RemoteMemoryReadFilters, type RemoteMemoryRecord, type RemoteMemoryRow, type RemoteMemoryStoreOptions, type RemoteMemoryTopic, type RemoteMemoryWorkKind, type RemoteMemoryWorkLease, type RemoteMemoryWorkPersistence, type RemoteTopicPersistence, type RequestEncryptionKeyOptions, RerankerUnavailableError, type ReservationReceipt, type ResumeStreamOptions, type ResumeStreamResult, type ResumeStreamWithStorageResult, type RetainAction, type RetainContext, type RetainOptions, type RetainResult, type RetainSource, SDK_SCHEMA_VERSION, SELECT_PAYMENT_WALLET_TOOL_NAME, SHORT_TTL_MS, STREAM_RESUMABLE_HEADER, type SavedTool, type SavedToolData, type ScoreBreakdown, type ScoreProfileSalienceOptions, type ScreenResult, type ScreenedCandidate, type SearchSource, type SelectPaymentWalletResult, type SendMessageWithStorageArgs, type SendMessageWithStorageDetachedResult, type SendMessageWithStorageResult, type ServerToolsOptions, type ServerToolsResponse, type Setting, type SignMessageFn, type StockPriceClassification, type StockPricePreProcessorOptions, type ChatCompletionUsage as StoredChatCompletionUsage, type StoredConversation, type StoredConversationMemory, type StoredMessage, type StoredMessageWithSimilarity, type StoredTopic, type StoredVaultFolder, VaultFolder as StoredVaultFolderModel, type StoredVaultMemory, VaultMemory as StoredVaultMemoryModel, StreamExpiredError, type StreamMetaEvent, type StreamResumeHandle, type StreamSmoothingConfig, type SynthesizeProfileOptions, TOOL_RESULT_ORIGIN, TOPICS_EXTRACTION_VERSION, TOPIC_EXTRACTION_BATCH_SIZE, TOPIC_SALIENCE_WEIGHTS, TREND_RECENT_WINDOW_DAYS, TREND_STALE_WINDOW_DAYS, type TextChunk, type TopicExtractOptions, type TopicExtractionBatchDiagnostics, type TopicExtractionInput, type TopicExtractionRunResult, type TopicSalience, type TopicSkipReason, 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 VaultAttachmentCache, type VaultAttachmentJournal, type VaultAttachmentOwner, type VaultAttachmentRef, type VaultAttachmentUploadOptions, type VaultAttachments, type VaultAttachmentsOptions, type VaultChatActivity, type VaultChatBackend, type VaultChatBackendOptions, type VaultChatEvent, type VaultEmbeddingCache, type VaultEmbeddingExpectation, type VaultFolderOperationsContext, type VaultInbox, type VaultMemoryKind, type VaultMemoryOperationsContext, type VaultMemoryProjection, type VaultMemoryVisibility, type VaultMemoryWriter, type VaultSaveOperation, type VaultSearchResult, type VaultWriteAction, type VaultWriteInput, type VaultWriteOutcome, type VerificationSources, type VerifyMemoriesForPublishOptions, WALLET_PAYMENT_TOOL_NAME, type WalletPaymentOutcome, type WalletPaymentPassenger, type WalletPaymentRequest, type WalletPaymentResult, WalletPoller, type WeatherClassification, type WeatherPreProcessorOptions, type WebSearchClassification, type WebSearchPreProcessorOptions, type WriteFailureReason, addConversationMemoriesOp, anumaLastReadSortKey, anumaTurnContent, appFileId, archiveVaultMemoryOp, assembleMemoryContext, attachFileContextToLastUserMessage, backfillMemoryTopicsOp, buildAttachedFilesText, buildNotionAuthUrl, capHopsForDensity, chatStorageMigrations, chatStorageSchema, chunkAndEmbedAllMessages, chunkAndEmbedMessage, chunkText, classifyCryptoPrice, classifyCryptoPriceBatch, classifyDecay, classifyInjectionCandidates, classifyObservationTrend, classifyStockPrice, classifyStockPriceBatch, classifyWeather, classifyWeatherBatch, classifyWebSearch, classifyWebSearchBatch, clearAllEncryptionKeys, clearAllEncryptionState, clearConversationMemoriesOp, clearEncryptionKey, clearLazyTitleCache, clearModelsCache, clearServerToolsCache, consoleLogger, conversationMemoryToStored, cosineInt8, countUnreadAnumaTurns, createAppFileIndex, createAutoExtractor, createChunkVectorCache, createCryptoPricePreProcessor, createDecaySweeper, createDurableAutoExtractor, createLlmDecayClassifier, createLlmNeighborRefiner, createLocalMemoryStore, createMemoryEngineTool, createMemoryVaultSearchTool, createMemoryVaultTool, createMessageSourceResolver, createNotionProxyTools, createNotionTools, createPlatformCursorStore, createRecallTool, createRemoteChatStore, createRemoteMemoryPersistence, createRemoteMemoryPipeline, createRemoteMemoryStore, createSelectPaymentWalletTool, createStockPricePreProcessor, createStreamingDeAnonymizer, createVaultAttachments, createVaultChatBackend, createVaultEmbeddingCache, createVaultFolderOp, createVaultInbox, createVaultMemoriesBatchOp, createVaultMemoryOp, createWalletPaymentTool, createWeatherPreProcessor, createWebSearchPreProcessor, decodeChunkVector, decryptConversationTitle, decryptMessageEmbeddingFields, deleteAllVaultMemoriesForUserOp, deleteAppFile, deleteMessageOp, deleteSavedTool, deleteVaultFolderOp, deleteVaultMemoryOp, dequantizeEmbedding, deriveKeyFromSignatureBytes, deriveMemoryKeyRing, discoverNotionOAuthEndpoints, eagerEmbedContent, embedAllMessages, embedMessage, encodeChunkVector, encryptToolCallEventsOp, ensureAnumaConversation, ensureDefaultFoldersOp, exchangeNotionCode, exportInboxPublicKey, extractAndLinkEntitiesForMemoriesOp, extractAndRetain, extractEntitiesForMemories, extractFacts, extractReservationReceipts, formatFileProcessingNotes, generateConversationId, generateEmbedding, generateEmbeddings, generateNotionPKCE, getAllVaultFoldersOp, getAllVaultMemoriesOp, getAllVaultMemoryContentsOp, getAppFile, getCachedServerTools, getConversationMemoriesOp, getConversationsByProjectLazyOp, getConversationsLazyOp, getConversationsPageOp, getDecayCandidatesRawOp, getLogger, getMemoriesNeedingTopicExtractionOp, getServerTools, getUnfiledVaultMemoriesOp, getVaultFolderMemoryCountOp, getVaultMemoriesByIdsOp, getVaultMemoryOp, getVaultRankingProjectionsOp, hardDeleteDecayedOp, hasEncryptionKey, ingestPublishedPhotoMemoriesOp, injectionSignatureCatalog, isAttachedFilesText, isDegradedTopicSkip, isEncrypted, isPiiRedactor, isRerankerAvailable, listActiveStreams, listAppFiles, listEveryAppFile, loadSavedTools, loadSettings, localChatBackend, markAnumaRead, maskScopedEmbeddingCache, maxVaultAttachmentBytes, memoryCipher, migrateChatsToRemote, migrateMemoriesToRemote, migrateMessageAttachments, moveMemoriesToFolderOp, noopLogger, onKeyAvailable, openInboxItem, parseMedia, preEmbedVaultMemories, primaryTopic, quantizeEmbedding, queueManager, rankProfileCandidates, readAnumaTurn, recall, reencryptMemoryField, reflect, refreshEncryptionKeyIfMatches, refreshNotionAccessToken, registerNotionClient, relinkMemoryTopicsOp, requestEncryptionKey, resolvePiiRedactor, restoreVaultMemoryOp, resumeStream, retain, saveAppFile, saveSavedTool, saveSetting, scoreProfileSalience, screenCandidatesForInjection, sdkMigrations, sdkModelClasses, sdkSchema, sealLegacyMessageEmbeddingsOp, searchVaultMemories, seedAppFilesToVault, seedEncryptionKeys, setLogger, setMemoryVisibilityOp, shouldChunkMessage, shouldRecallMemory, stampTopicsExtractedAtOp, streamCancelPath, streamReplayPath, stripLegacyChunkTextOp, summarizeObservationTrends, supersedeVaultMemoryOp, synthesizeProfile, topicWeight, traverseGraphLane, ttlForType, updateVaultFolderContextOp, updateVaultFolderOp, updateVaultMemoryEmbeddingOp, updateVaultMemoryOp, upsertMessageOp, useChat, useChatStorage, useCredits, useEncryption, useModels, vaultAttachmentRefs, vaultChatBackend, verifyMemoriesForPublish, xhrTransport };