@anuma/sdk 2.6.1 → 3.0.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.
@@ -15242,6 +15242,15 @@ async function encryptData(plaintext, address) {
15242
15242
  const key = await getEncryptionKey(address);
15243
15243
  return encryptDataWithKey(plaintext, key);
15244
15244
  }
15245
+ async function encryptDataBytes(plaintext, address) {
15246
+ if (!isValidWalletAddress(address)) {
15247
+ throw new Error(
15248
+ `Invalid wallet address: ${address}. Address must start with 0x and be 42 characters (0x + 40 hex characters).`
15249
+ );
15250
+ }
15251
+ const key = await getEncryptionKey(address);
15252
+ return encryptBytesWithKey(plaintext, key);
15253
+ }
15245
15254
  async function decryptData(encryptedHex, address, version = "v3") {
15246
15255
  const key = await getEncryptionKey(address, version);
15247
15256
  return decryptDataWithKey(encryptedHex, key);
@@ -15261,6 +15270,20 @@ async function decryptDataBytes(encryptedHex, address, version = "v3") {
15261
15270
  );
15262
15271
  return new Uint8Array(decryptedData);
15263
15272
  }
15273
+ async function decryptDataBytesFromBytes(encrypted, address, version = "v3") {
15274
+ const key = await getEncryptionKey(address, version);
15275
+ const iv = encrypted.subarray(0, 12);
15276
+ const encryptedData = encrypted.subarray(12);
15277
+ const decryptedData = await crypto.subtle.decrypt(
15278
+ {
15279
+ name: "AES-GCM",
15280
+ iv
15281
+ },
15282
+ key,
15283
+ encryptedData
15284
+ );
15285
+ return new Uint8Array(decryptedData);
15286
+ }
15264
15287
  function hasEncryptionKey(address) {
15265
15288
  return getStoredKey(address) !== null;
15266
15289
  }
@@ -15954,6 +15977,67 @@ async function messageToStored(message, walletAddress, signMessage, embeddedWall
15954
15977
  }
15955
15978
  return baseMessage;
15956
15979
  }
15980
+ function rawDate(value) {
15981
+ return new Date(typeof value === "number" ? value : 0);
15982
+ }
15983
+ function messageRawToStoredRaw(raw, projection) {
15984
+ const parseJsonField = (rawValue) => {
15985
+ if (!rawValue) return void 0;
15986
+ if (typeof rawValue === "string") {
15987
+ if (rawValue.startsWith("enc:")) return rawValue;
15988
+ try {
15989
+ return JSON.parse(rawValue);
15990
+ } catch {
15991
+ return void 0;
15992
+ }
15993
+ }
15994
+ return rawValue;
15995
+ };
15996
+ const skipEmbeddings = projection?.skipEmbeddings === true;
15997
+ const vectorRaw = skipEmbeddings ? null : raw.vector;
15998
+ const chunksRaw = skipEmbeddings ? null : raw.chunks;
15999
+ return {
16000
+ uniqueId: raw.id,
16001
+ messageId: raw.message_id,
16002
+ conversationId: raw.conversation_id ?? "",
16003
+ role: raw.role ?? "",
16004
+ content: raw.content ?? "",
16005
+ model: raw.model,
16006
+ imageModel: raw.image_model,
16007
+ files: parseJsonField(raw.files),
16008
+ fileIds: parseJsonField(raw.file_ids),
16009
+ createdAt: rawDate(raw.created_at),
16010
+ updatedAt: rawDate(raw.updated_at),
16011
+ vector: skipEmbeddings ? void 0 : parseJsonField(vectorRaw),
16012
+ embeddingModel: raw.embedding_model,
16013
+ chunks: skipEmbeddings ? void 0 : parseJsonField(chunksRaw),
16014
+ usage: parseJsonField(raw.usage),
16015
+ sources: parseJsonField(raw.sources),
16016
+ responseDuration: raw.response_duration,
16017
+ // `was_stopped` is an OPTIONAL boolean: an unset row sanitizes to null, and the Model path
16018
+ // (message.wasStopped) returns that null verbatim. Preserve it (don't collapse to false) so the
16019
+ // raw path is byte-identical. When set, coerce SQLite 0/1 and LokiJS true/false alike.
16020
+ wasStopped: raw.was_stopped === null || raw.was_stopped === void 0 ? raw.was_stopped : raw.was_stopped === true || raw.was_stopped === 1,
16021
+ error: raw.error,
16022
+ thoughtProcess: parseJsonField(raw.thought_process),
16023
+ thinking: raw.thinking,
16024
+ parentMessageId: raw.parent_message_id,
16025
+ feedback: raw.feedback || null,
16026
+ toolCallEvents: parseJsonField(raw.tool_call_events)
16027
+ };
16028
+ }
16029
+ async function messageRawToStored(raw, walletAddress, signMessage, embeddedWalletSigner, projection) {
16030
+ const baseMessage = messageRawToStoredRaw(raw, projection);
16031
+ if (walletAddress) {
16032
+ return await decryptMessageFields(
16033
+ baseMessage,
16034
+ walletAddress,
16035
+ signMessage,
16036
+ embeddedWalletSigner
16037
+ );
16038
+ }
16039
+ return baseMessage;
16040
+ }
15957
16041
  function conversationToStoredRaw(conversation) {
15958
16042
  return {
15959
16043
  uniqueId: conversation.id,
@@ -15978,6 +16062,33 @@ async function conversationToStored(conversation, walletAddress, signMessage, em
15978
16062
  }
15979
16063
  return baseConversation;
15980
16064
  }
16065
+ function conversationRawToStoredRaw(raw) {
16066
+ const pinnedAt = raw.pinned_at;
16067
+ return {
16068
+ uniqueId: raw.id,
16069
+ conversationId: raw.conversation_id ?? "",
16070
+ title: raw.title ?? "",
16071
+ projectId: raw.project_id,
16072
+ createdAt: rawDate(raw.created_at),
16073
+ updatedAt: rawDate(raw.updated_at),
16074
+ // SQLite stores booleans as 0/1, LokiJS as true/false — coerce both.
16075
+ isDeleted: raw.is_deleted === true || raw.is_deleted === 1,
16076
+ // @date maps a non-number raw column (incl. an explicit unpin null) to null; a number → Date.
16077
+ pinnedAt: typeof pinnedAt === "number" ? new Date(pinnedAt) : null
16078
+ };
16079
+ }
16080
+ async function conversationRawToStored(raw, walletAddress, signMessage, embeddedWalletSigner) {
16081
+ const baseConversation = conversationRawToStoredRaw(raw);
16082
+ if (walletAddress) {
16083
+ return await decryptConversationFields(
16084
+ baseConversation,
16085
+ walletAddress,
16086
+ signMessage,
16087
+ embeddedWalletSigner
16088
+ );
16089
+ }
16090
+ return baseConversation;
16091
+ }
15981
16092
  async function createConversationOp(ctx, opts, defaultTitle = "New Conversation") {
15982
16093
  const convId = opts?.conversationId || generateConversationId();
15983
16094
  const title = opts?.title || defaultTitle;
@@ -16017,36 +16128,51 @@ async function getConversationOp(ctx, id) {
16017
16128
  ) : null;
16018
16129
  }
16019
16130
  async function getConversationsOp(ctx) {
16020
- const results = await ctx.conversationsCollection.query(import_watermelondb14.Q.where("is_deleted", false), import_watermelondb14.Q.sortBy("created_at", import_watermelondb14.Q.desc)).fetch();
16131
+ const results = await ctx.conversationsCollection.query(import_watermelondb14.Q.where("is_deleted", false), import_watermelondb14.Q.sortBy("created_at", import_watermelondb14.Q.desc)).unsafeFetchRaw();
16021
16132
  return Promise.all(
16022
16133
  results.map(
16023
- (conv) => conversationToStored(conv, ctx.walletAddress, ctx.signMessage, ctx.embeddedWalletSigner)
16134
+ (raw) => conversationRawToStored(raw, ctx.walletAddress, ctx.signMessage, ctx.embeddedWalletSigner)
16024
16135
  )
16025
16136
  );
16026
16137
  }
16027
- function conversationToLazyStored(conversation) {
16138
+ function conversationRawToLazyStored(raw) {
16139
+ const pinnedAt = raw.pinned_at;
16028
16140
  return {
16029
- uniqueId: conversation.id,
16030
- conversationId: conversation.conversationId,
16031
- encryptedTitle: conversation.title,
16032
- projectId: conversation.projectId,
16033
- createdAt: conversation.createdAt,
16034
- updatedAt: conversation.updatedAt,
16035
- isDeleted: conversation.isDeleted,
16036
- pinnedAt: conversation.pinnedAt
16141
+ uniqueId: raw.id,
16142
+ conversationId: raw.conversation_id ?? "",
16143
+ encryptedTitle: raw.title ?? "",
16144
+ projectId: raw.project_id,
16145
+ createdAt: rawDate(raw.created_at),
16146
+ updatedAt: rawDate(raw.updated_at),
16147
+ isDeleted: raw.is_deleted === true || raw.is_deleted === 1,
16148
+ pinnedAt: typeof pinnedAt === "number" ? new Date(pinnedAt) : null
16037
16149
  };
16038
16150
  }
16039
16151
  async function getConversationsLazyOp(ctx) {
16040
- const results = await ctx.conversationsCollection.query(import_watermelondb14.Q.where("is_deleted", false), import_watermelondb14.Q.sortBy("created_at", import_watermelondb14.Q.desc)).fetch();
16041
- return results.map(conversationToLazyStored);
16152
+ const results = await ctx.conversationsCollection.query(import_watermelondb14.Q.where("is_deleted", false), import_watermelondb14.Q.sortBy("created_at", import_watermelondb14.Q.desc)).unsafeFetchRaw();
16153
+ return results.map(conversationRawToLazyStored);
16154
+ }
16155
+ async function getConversationsPageOp(ctx, options) {
16156
+ const limit = Math.floor(options?.limit ?? 200);
16157
+ if (!Number.isFinite(limit) || limit < 1) return [];
16158
+ const exclude = new Set(options?.boundaryExcludeUniqueIds ?? []);
16159
+ const clauses = [import_watermelondb14.Q.where("is_deleted", false)];
16160
+ if (options?.before !== void 0) {
16161
+ clauses.push(
16162
+ exclude.size > 0 ? import_watermelondb14.Q.where("created_at", import_watermelondb14.Q.lte(options.before)) : import_watermelondb14.Q.where("created_at", import_watermelondb14.Q.lt(options.before))
16163
+ );
16164
+ }
16165
+ const fetched = await ctx.conversationsCollection.query(...clauses, import_watermelondb14.Q.sortBy("created_at", import_watermelondb14.Q.desc), import_watermelondb14.Q.take(limit + exclude.size)).unsafeFetchRaw();
16166
+ const results = exclude.size > 0 ? fetched.filter((raw) => !exclude.has(raw.id)) : fetched;
16167
+ return results.slice(0, limit).map(conversationRawToLazyStored);
16042
16168
  }
16043
16169
  async function getConversationsByProjectLazyOp(ctx, projectId) {
16044
16170
  const results = await ctx.conversationsCollection.query(
16045
16171
  import_watermelondb14.Q.where("project_id", projectId === null ? "" : projectId),
16046
16172
  import_watermelondb14.Q.where("is_deleted", false),
16047
16173
  import_watermelondb14.Q.sortBy("created_at", import_watermelondb14.Q.desc)
16048
- ).fetch();
16049
- return results.map(conversationToLazyStored);
16174
+ ).unsafeFetchRaw();
16175
+ return results.map(conversationRawToLazyStored);
16050
16176
  }
16051
16177
  async function updateConversationTitleOp(ctx, id, title) {
16052
16178
  const results = await ctx.conversationsCollection.query(import_watermelondb14.Q.where("conversation_id", id), import_watermelondb14.Q.where("is_deleted", false)).fetch();
@@ -16096,18 +16222,18 @@ async function getConversationsByProjectOp(ctx, projectId) {
16096
16222
  import_watermelondb14.Q.where("project_id", projectId === null ? "" : projectId),
16097
16223
  import_watermelondb14.Q.where("is_deleted", false),
16098
16224
  import_watermelondb14.Q.sortBy("created_at", import_watermelondb14.Q.desc)
16099
- ).fetch();
16225
+ ).unsafeFetchRaw();
16100
16226
  return Promise.all(
16101
16227
  results.map(
16102
- (conv) => conversationToStored(conv, ctx.walletAddress, ctx.signMessage, ctx.embeddedWalletSigner)
16228
+ (raw) => conversationRawToStored(raw, ctx.walletAddress, ctx.signMessage, ctx.embeddedWalletSigner)
16103
16229
  )
16104
16230
  );
16105
16231
  }
16106
16232
  async function getMessagesOp(ctx, convId) {
16107
- const results = await ctx.messagesCollection.query(import_watermelondb14.Q.where("conversation_id", convId), import_watermelondb14.Q.sortBy("message_id", import_watermelondb14.Q.asc)).fetch();
16233
+ const results = await ctx.messagesCollection.query(import_watermelondb14.Q.where("conversation_id", convId), import_watermelondb14.Q.sortBy("message_id", import_watermelondb14.Q.asc)).unsafeFetchRaw();
16108
16234
  return Promise.all(
16109
16235
  results.map(
16110
- (msg) => messageToStored(msg, ctx.walletAddress, ctx.signMessage, ctx.embeddedWalletSigner)
16236
+ (raw) => messageRawToStored(raw, ctx.walletAddress, ctx.signMessage, ctx.embeddedWalletSigner)
16111
16237
  )
16112
16238
  );
16113
16239
  }
@@ -18538,7 +18664,7 @@ async function generateEmbedding(text12, options) {
18538
18664
  const { baseUrl = BASE_URL, getToken, apiKey, model, cache } = options;
18539
18665
  if (cache) {
18540
18666
  const cached = cache.get(text12);
18541
- if (cached) return cached;
18667
+ if (cached) return Array.from(cached);
18542
18668
  }
18543
18669
  let headers;
18544
18670
  if (apiKey) {
@@ -18577,10 +18703,11 @@ async function generateEmbedding(text12, options) {
18577
18703
  totalTokens: response.data.usage.total_tokens ?? 0
18578
18704
  });
18579
18705
  }
18706
+ const f32Embedding = Float32Array.from(embedding);
18580
18707
  if (cache) {
18581
- cache.set(text12, embedding);
18708
+ cache.set(text12, f32Embedding);
18582
18709
  }
18583
- return embedding;
18710
+ return Array.from(f32Embedding);
18584
18711
  }
18585
18712
  async function generateEmbeddingsBatch(texts, headers, baseUrl, model, onUsage, maskInput) {
18586
18713
  const response = await withEmbeddingRetry(
@@ -18616,7 +18743,7 @@ async function generateEmbeddings(texts, options) {
18616
18743
  if (cache) {
18617
18744
  const cached = cache.get(texts[i]);
18618
18745
  if (cached) {
18619
- results[i] = cached;
18746
+ results[i] = Array.from(cached);
18620
18747
  continue;
18621
18748
  }
18622
18749
  }
@@ -18677,9 +18804,10 @@ async function generateEmbeddings(texts, options) {
18677
18804
  newEmbeddings = allEmbeddings.flat();
18678
18805
  }
18679
18806
  for (let i = 0; i < uncachedIndices.length; i++) {
18680
- results[uncachedIndices[i]] = newEmbeddings[i];
18807
+ const f32Embedding = Float32Array.from(newEmbeddings[i]);
18808
+ results[uncachedIndices[i]] = Array.from(f32Embedding);
18681
18809
  if (cache) {
18682
- cache.set(uncachedTexts[i], newEmbeddings[i]);
18810
+ cache.set(uncachedTexts[i], f32Embedding);
18683
18811
  }
18684
18812
  }
18685
18813
  return results;
@@ -21955,6 +22083,7 @@ __export(index_exports, {
21955
22083
  decryptData: () => decryptData,
21956
22084
  decryptDataBatch: () => decryptDataBatch,
21957
22085
  decryptDataBytes: () => decryptDataBytes,
22086
+ decryptDataBytesFromBytes: () => decryptDataBytesFromBytes,
21958
22087
  decryptDataWithKey: () => decryptDataWithKey,
21959
22088
  defaultServerToolsFilter: () => defaultServerToolsFilter,
21960
22089
  deleteAllVaultMemoriesForUserOp: () => deleteAllVaultMemoriesForUserOp,
@@ -21973,6 +22102,7 @@ __export(index_exports, {
21973
22102
  embedMessage: () => embedMessage,
21974
22103
  encryptData: () => encryptData,
21975
22104
  encryptDataBatch: () => encryptDataBatch,
22105
+ encryptDataBytes: () => encryptDataBytes,
21976
22106
  encryptDataWithKey: () => encryptDataWithKey,
21977
22107
  ensureDefaultFoldersOp: () => ensureDefaultFoldersOp,
21978
22108
  estimateMessagesTokens: () => estimateMessagesTokens,
@@ -22001,6 +22131,7 @@ __export(index_exports, {
22001
22131
  getConversationsByProjectOp: () => getConversationsByProjectOp,
22002
22132
  getConversationsLazyOp: () => getConversationsLazyOp,
22003
22133
  getConversationsOp: () => getConversationsOp,
22134
+ getConversationsPageOp: () => getConversationsPageOp,
22004
22135
  getDocumentsOp: () => getDocumentsOp,
22005
22136
  getEncryptionKey: () => getEncryptionKey,
22006
22137
  getImagesOp: () => getImagesOp,
@@ -28489,6 +28620,7 @@ var WalletPoller = class {
28489
28620
  init_logger();
28490
28621
 
28491
28622
  // src/lib/processors/encoding.ts
28623
+ var B64_ENCODE_CHUNK = 32768 * 3;
28492
28624
  async function dataUrlToArrayBuffer(dataUrl) {
28493
28625
  if (dataUrl.startsWith("blob:") || dataUrl.startsWith("http://") || dataUrl.startsWith("https://")) {
28494
28626
  const response = await fetch(dataUrl);
@@ -28511,11 +28643,16 @@ function uint8ArrayToBase64(data) {
28511
28643
  if (typeof Buffer !== "undefined") {
28512
28644
  return Buffer.from(data).toString("base64");
28513
28645
  }
28514
- let binary = "";
28515
- for (let i = 0; i < data.length; i++) {
28516
- binary += String.fromCharCode(data[i]);
28646
+ let base64 = "";
28647
+ for (let i = 0; i < data.length; i += B64_ENCODE_CHUNK) {
28648
+ const slice = data.subarray(i, i + B64_ENCODE_CHUNK);
28649
+ let binary = "";
28650
+ for (let j = 0; j < slice.length; j++) {
28651
+ binary += String.fromCharCode(slice[j]);
28652
+ }
28653
+ base64 += btoa(binary);
28517
28654
  }
28518
- return btoa(binary);
28655
+ return base64;
28519
28656
  }
28520
28657
 
28521
28658
  // src/lib/processors/ExcelProcessor.ts
@@ -31455,6 +31592,22 @@ function linkAbortSignals(a, b) {
31455
31592
  }
31456
31593
  };
31457
31594
  }
31595
+ function validateEndpointOverride(override) {
31596
+ const trimmed = override.trim();
31597
+ if (trimmed === "") {
31598
+ return {
31599
+ valid: false,
31600
+ message: 'endpointOverride must be a non-empty, root-relative path (e.g. "/api/v1/utility/responses"); received an empty or whitespace-only string'
31601
+ };
31602
+ }
31603
+ if (trimmed.startsWith("//") || trimmed.includes("://")) {
31604
+ return {
31605
+ valid: false,
31606
+ message: `endpointOverride must be a root-relative path (e.g. "/api/v1/utility/responses"), not a protocol-relative or absolute URL; received "${trimmed}"`
31607
+ };
31608
+ }
31609
+ return { valid: true, endpoint: trimmed.startsWith("/") ? trimmed : `/${trimmed}` };
31610
+ }
31458
31611
  async function runToolLoop(options) {
31459
31612
  const {
31460
31613
  model,
@@ -31462,6 +31615,7 @@ async function runToolLoop(options) {
31462
31615
  baseUrl = BASE_URL,
31463
31616
  headers,
31464
31617
  apiType = "auto",
31618
+ endpointOverride,
31465
31619
  temperature,
31466
31620
  maxOutputTokens,
31467
31621
  tools,
@@ -31544,6 +31698,20 @@ async function runToolLoop(options) {
31544
31698
  await fireRunError({ error: msg, stage: "model", errorObject: new Error(msg) });
31545
31699
  return { data: null, error: msg };
31546
31700
  }
31701
+ let effectiveEndpoint = strategy.endpoint;
31702
+ if (endpointOverride !== void 0) {
31703
+ const overrideValidation = validateEndpointOverride(endpointOverride);
31704
+ if (!overrideValidation.valid) {
31705
+ if (onError) onError(new Error(overrideValidation.message));
31706
+ await fireRunError({
31707
+ error: overrideValidation.message,
31708
+ stage: "model",
31709
+ errorObject: new Error(overrideValidation.message)
31710
+ });
31711
+ return { data: null, error: overrideValidation.message };
31712
+ }
31713
+ effectiveEndpoint = overrideValidation.endpoint;
31714
+ }
31547
31715
  const { signal: combinedSignal, cleanup: cleanupSignalLink } = linkAbortSignals(
31548
31716
  signal,
31549
31717
  detachSignal
@@ -31727,7 +31895,7 @@ async function runToolLoop(options) {
31727
31895
  if (onRequest) onRequest(measureRequest(0, attempt, requestBody, messages, apiTools));
31728
31896
  const sseResult = makeStreamingRequest({
31729
31897
  baseUrl,
31730
- endpoint: strategy.endpoint,
31898
+ endpoint: effectiveEndpoint,
31731
31899
  body: requestBody,
31732
31900
  token,
31733
31901
  headers: effectiveHeaders,
@@ -32199,7 +32367,7 @@ Executing tool: ${toolInfo}
32199
32367
  const continuationRound = toolIteration;
32200
32368
  const continuationResult = makeStreamingRequest({
32201
32369
  baseUrl,
32202
- endpoint: strategy.endpoint,
32370
+ endpoint: effectiveEndpoint,
32203
32371
  body: continuationRequestBody,
32204
32372
  token,
32205
32373
  headers: effectiveHeaders,
@@ -32955,6 +33123,7 @@ function buildSystemPrompt(ctx, options) {
32955
33123
  decryptData,
32956
33124
  decryptDataBatch,
32957
33125
  decryptDataBytes,
33126
+ decryptDataBytesFromBytes,
32958
33127
  decryptDataWithKey,
32959
33128
  defaultServerToolsFilter,
32960
33129
  deleteAllVaultMemoriesForUserOp,
@@ -32973,6 +33142,7 @@ function buildSystemPrompt(ctx, options) {
32973
33142
  embedMessage,
32974
33143
  encryptData,
32975
33144
  encryptDataBatch,
33145
+ encryptDataBytes,
32976
33146
  encryptDataWithKey,
32977
33147
  ensureDefaultFoldersOp,
32978
33148
  estimateMessagesTokens,
@@ -33001,6 +33171,7 @@ function buildSystemPrompt(ctx, options) {
33001
33171
  getConversationsByProjectOp,
33002
33172
  getConversationsLazyOp,
33003
33173
  getConversationsOp,
33174
+ getConversationsPageOp,
33004
33175
  getDocumentsOp,
33005
33176
  getEncryptionKey,
33006
33177
  getImagesOp,
@@ -2211,6 +2211,23 @@ type RunToolLoopOptions = {
2211
2211
  headers?: Record<string, string>;
2212
2212
  /** Which API backend to use. @default "auto" */
2213
2213
  apiType?: ApiType;
2214
+ /**
2215
+ * Optional per-call override for the request path. When set, every streaming
2216
+ * request targets this path instead of the endpoint the strategy resolves from
2217
+ * the model. Only the URL path changes — the request body and response parsing
2218
+ * follow the resolved strategy exactly as they would without the override.
2219
+ *
2220
+ * Must be a non-empty, root-relative path (e.g. `"/api/v1/utility/responses"`);
2221
+ * a missing leading slash is normalized on. Empty/whitespace-only values and
2222
+ * protocol-relative (`"//host"`) or absolute (`"scheme://host"`) URLs are
2223
+ * rejected — the transport builds the URL as `baseUrl + endpoint`, so a bad
2224
+ * value would silently hit the portal root or send the request (and its Bearer
2225
+ * token) off-origin. An invalid override is reported like any other pre-flight
2226
+ * failure: `onRunError` fires and the run resolves to `{ data: null, error }`
2227
+ * (no throw).
2228
+ * @default undefined (path resolved from the model / `apiType`)
2229
+ */
2230
+ endpointOverride?: string;
2214
2231
  /** Controls randomness (0.0 to 2.0). */
2215
2232
  temperature?: number;
2216
2233
  /** Maximum tokens to generate. */
@@ -2483,33 +2500,6 @@ type StreamingTransportResult = {
2483
2500
  * transport both honor this contract.
2484
2501
  */
2485
2502
  type StreamingTransport = (options: StreamingTransportOptions) => StreamingTransportResult;
2486
- /**
2487
- * Framework-agnostic tool execution loop.
2488
- *
2489
- * Sends a streaming completion request, auto-executes tools that have executors,
2490
- * feeds results back to the model, and repeats until the model stops emitting
2491
- * tool calls or hits the iteration limit.
2492
- *
2493
- * This is the same loop that powers `useChat` in the React SDK, extracted so
2494
- * it can be used from Node.js servers, CLI tools, and background workers.
2495
- *
2496
- * @example
2497
- * ```ts
2498
- * import { runToolLoop } from "@anuma/sdk/server";
2499
- *
2500
- * const result = await runToolLoop({
2501
- * messages: [{ role: "user", content: [{ type: "text", text: "What's the weather?" }] }],
2502
- * model: "fireworks/accounts/fireworks/models/kimi-k2p5",
2503
- * token: "my-api-token",
2504
- * tools: [{
2505
- * type: "function",
2506
- * function: { name: "get_weather", parameters: { type: "object", properties: { city: { type: "string" } } } },
2507
- * executor: async ({ city }) => fetchWeather(city),
2508
- * }],
2509
- * onData: (chunk) => process.stdout.write(chunk),
2510
- * });
2511
- * ```
2512
- */
2513
2503
  declare function runToolLoop(options: RunToolLoopOptions): Promise<RunToolLoopResult>;
2514
2504
 
2515
2505
  /**
@@ -3276,6 +3266,32 @@ interface SearchSource {
3276
3266
  snippet?: string;
3277
3267
  date?: string;
3278
3268
  }
3269
+ /** Options for keyset-paginated conversation-list reads ({@link getConversationsPageOp}). */
3270
+ interface GetConversationsPageOptions {
3271
+ /**
3272
+ * Upper-bound `created_at` cursor (epoch ms). Without
3273
+ * `boundaryExcludeUniqueIds` it is EXCLUSIVE: only conversations with
3274
+ * `createdAt < before` are returned. Omit to fetch the newest page.
3275
+ */
3276
+ before?: number;
3277
+ /**
3278
+ * uniqueIds of the rows the caller already holds AT the `before` boundary.
3279
+ * `created_at` is NOT unique (a bulk restore/import writes many rows with the
3280
+ * same timestamp) — with an exclusive cursor, an unseen row sharing the
3281
+ * boundary timestamp would be silently skipped by every page. When provided,
3282
+ * the boundary timestamp is fetched INCLUSIVELY and these known rows are
3283
+ * filtered out, so a boundary-timestamp row is returned exactly once. Mirrors
3284
+ * {@link GetMessagesPageOptions.boundaryExcludeUniqueIds}.
3285
+ */
3286
+ boundaryExcludeUniqueIds?: string[];
3287
+ /**
3288
+ * Maximum rows to return — the NEWEST `limit` rows of the matching range.
3289
+ * Defaults to 200. A non-positive or non-finite value yields an EMPTY page
3290
+ * (never an unbounded read — SQLite treats `LIMIT -1` as "no limit");
3291
+ * fractional values are floored.
3292
+ */
3293
+ limit?: number;
3294
+ }
3279
3295
  interface StoredMessage {
3280
3296
  uniqueId: string;
3281
3297
  messageId: number;
@@ -3603,6 +3619,19 @@ declare function getEncryptionKey(address: string, version?: EncryptionKeyVersio
3603
3619
  * @category Encryption
3604
3620
  */
3605
3621
  declare function encryptData(plaintext: string | Uint8Array, address: string): Promise<string>;
3622
+ /**
3623
+ * Like {@link encryptData} but takes raw bytes and returns the raw encrypted
3624
+ * `[IV][ciphertext+tag]` Uint8Array instead of a hex string. Avoids the hex
3625
+ * round-trip (`encryptData` returns hex, which callers immediately convert back
3626
+ * to bytes) — for large binary media that hex string is a ~1.37x copy of the
3627
+ * whole payload. Use for binary uploads (e.g. enc:v3 media frames).
3628
+ *
3629
+ * @param plaintext - The raw bytes to encrypt
3630
+ * @param address - The wallet address associated with the encryption key
3631
+ * @returns Encrypted data as raw bytes (IV + ciphertext + auth tag)
3632
+ * @category Encryption
3633
+ */
3634
+ declare function encryptDataBytes(plaintext: Uint8Array, address: string): Promise<Uint8Array>;
3606
3635
  /**
3607
3636
  * Decrypts data using AES-GCM with the stored encryption key.
3608
3637
  *
@@ -3639,6 +3668,21 @@ declare function decryptData(encryptedHex: string, address: string, version?: En
3639
3668
  * @returns Decrypted data as Uint8Array
3640
3669
  */
3641
3670
  declare function decryptDataBytes(encryptedHex: string, address: string, version?: EncryptionKeyVersion): Promise<Uint8Array>;
3671
+ /**
3672
+ * Like {@link decryptDataBytes} but takes the raw encrypted bytes
3673
+ * (`[IV][ciphertext+tag]`) directly instead of a hex string. Skips the
3674
+ * `hexToBytes` conversion — for large binary media the hex string the caller
3675
+ * would otherwise build is a ~1.37x copy of the whole payload (a ~1GB string
3676
+ * for a 500MB video), plus this avoids a second byte copy. Same key resolution
3677
+ * as decryptDataBytes.
3678
+ *
3679
+ * @param encrypted - Raw encrypted bytes (IV + ciphertext + auth tag), no hex
3680
+ * @param address - The wallet address associated with the encryption key
3681
+ * @param version - Encryption key version to decrypt with (defaults to "v3")
3682
+ * @returns Decrypted data as Uint8Array
3683
+ * @category Encryption
3684
+ */
3685
+ declare function decryptDataBytesFromBytes(encrypted: Uint8Array, address: string, version?: EncryptionKeyVersion): Promise<Uint8Array>;
3642
3686
  /**
3643
3687
  * Checks if an encryption key exists in memory for the given wallet address
3644
3688
  */
@@ -3806,6 +3850,20 @@ declare function getConversationsOp(ctx: StorageOperationsContext): Promise<Stor
3806
3850
  * for `decryptField` is exactly zero.
3807
3851
  */
3808
3852
  declare function getConversationsLazyOp(ctx: StorageOperationsContext): Promise<LazyStoredConversation[]>;
3853
+ /**
3854
+ * Keyset-paginated, lazy (no-decrypt) variant of {@link getConversationsLazyOp}.
3855
+ *
3856
+ * Returns at most `limit` conversations (newest first by `created_at`), each
3857
+ * with its raw stored title under `encryptedTitle` — pair with
3858
+ * {@link decryptConversationTitle} to decrypt on render. Page through older
3859
+ * threads by passing the oldest loaded `createdAt` as `before` plus the
3860
+ * uniqueIds held at that boundary as `boundaryExcludeUniqueIds`.
3861
+ *
3862
+ * Decrypts nothing and builds no WatermelonDB Model (the never-evicted
3863
+ * RecordCache stays empty — web Pile-2). Sort order, soft-delete filtering,
3864
+ * and the encrypted-title projection all match `getConversationsLazyOp`.
3865
+ */
3866
+ declare function getConversationsPageOp(ctx: StorageOperationsContext, options?: GetConversationsPageOptions): Promise<LazyStoredConversation[]>;
3809
3867
  /**
3810
3868
  * Lazy variant of {@link getConversationsByProjectOp}.
3811
3869
  *
@@ -5285,8 +5343,13 @@ interface EmbeddingOptions {
5285
5343
  * are looked up in this map before calling the API, and new embeddings
5286
5344
  * are stored after generation. Useful when the same texts are embedded
5287
5345
  * repeatedly (e.g., across eval iterations or re-indexing runs).
5346
+ *
5347
+ * Values are stored as `Float32Array` (the embedding model's native
5348
+ * precision) rather than a float64 `number[]`, halving the resident RAM of
5349
+ * the cache with no precision loss. `generateEmbedding(s)` still return
5350
+ * `number[]` at the API boundary, so callers are unaffected.
5288
5351
  */
5289
- cache?: Map<string, number[]>;
5352
+ cache?: Map<string, Float32Array>;
5290
5353
  /** Called after each embedding API call with the token usage from the response. */
5291
5354
  onUsage?: (usage: {
5292
5355
  promptTokens: number;
@@ -7791,4 +7854,4 @@ declare function sanitizeQuotes(s: string): string;
7791
7854
  declare function renderTemplate(value: string | null | undefined, template: string): string | null;
7792
7855
  declare function buildSystemPrompt(ctx: PromptContext, options?: BuildPromptOptions): BuildPromptResult;
7793
7856
 
7794
- export { type AnalyzeStyleOptions, type AnalyzeStyleResult, type ApiResponse, type ApiType, type AutoExecutedToolResult, type AutoExtractMessage, type AutoExtractor, type Budget, type BuildPromptOptions, type BuildPromptResult, type CachedChunkVectors, type CachedServerTools, type ChatCompletionUsage, type ChatRole, type ChunkSearchResult, type ChunkVectorCache, type ChunkingOptions, type ConnectorGuidance, type ConnectorGuidanceInput, type ConsolidationFallbackReason, Conversation, ConversationSummary, type CreateAutoExtractorOptions, type CreateConversationOptions, type CreateMediaOptions, type CreateMessageOptions, type CreateModelPreferenceOptions, type CreateProjectOptions, type CreateUserPreferenceOptions, type CreateVaultFolderOptions, type CreateVaultMemoryOptions, type CryptoPriceClassification, type CryptoPricePreProcessorOptions, DEFAULT_ANALYSIS_PROMPT, DEFAULT_ANALYZE_AFTER_MESSAGES, DEFAULT_CACHE_EXPIRATION_MS, DEFAULT_CHUNK_CACHE_SIZE, DEFAULT_CHUNK_OVERLAP, DEFAULT_CHUNK_SIZE, DEFAULT_DOCUMENT_PATTERN, DEFAULT_EXCLUDED_SERVER_TOOLS, DEFAULT_MAX_INPUT_MESSAGES, DEFAULT_MAX_PROFILE_LENGTH, DEFAULT_MIN_CHUNK_SIZE, DEFAULT_MIN_MESSAGES, DEFAULT_PERSONALITY_SETTINGS, DEFAULT_PROMPT_TEMPLATES, DEFAULT_REFRESH_EVERY_MESSAGES, DEFAULT_SERVER_TOOLS_MATCH_OPTIONS, DEFAULT_SUMMARY_MIN_WINDOW_MESSAGES, DEFAULT_SUMMARY_MODEL, DEFAULT_SUMMARY_TOKEN_THRESHOLD, DEFAULT_VAULT_CACHE_SIZE, DatabaseManager, type DatabaseManagerLogger, type DatabaseManagerOptions, type EmbeddedWalletSignerFn, ExcelProcessor, type ExtractFactsOptions, type ExtractOutcome, type ExtractedCandidate, type ExtractedEntity, type ExtractionCursorStore, type FactType, type FileMetadata, type FileProcessor, type FileTypeQuery, type FileWithData, type FlushResult, INFERENCE_ID_HEADER, type LazyStoredConversation, type LlmTokenUsage, MAX_MESSAGES_PER_SUMMARIZATION, Media, type MediaDimensions, type MediaFilterOptions, type MediaMetadata, type MediaOperationsContext, type MediaRole, type MediaType, type MemoriesNeedingTopicExtraction, type EmbeddingOptions as MemoryEngineEmbeddingOptions, type MemoryEngineResult, type MemoryEngineSearchOptions, type MemoryExtractedEvent, type MemoryKind, type MemoryVaultSearchOptions, type MemoryVaultToolOptions, Message, type MessageChunk, type MessageFeedback, type ModelCallEndEvent, type ModelCallStartEvent, ModelPreference, type OperationExecutor, type ParsedServerToolsResponse, PdfProcessor, type PersonalitySettings, type PersonalitySliders, type PersonalityStyle, type PgClientLike, type PgPoolLike, type PlatformStorage, type PortalLlmAuth, PostgreSQLAdapter, type PostgreSQLAdapterOptions, type PreprocessingOptions, type PreprocessingResult, type ProcessedFileResult, ProcessorRegistry, type ProfileUpdate, Project, type ProjectOperationsContext, type PromptContext, type PromptPreProcessor, type PromptPreProcessorContext, type PromptSection, type PromptTemplates, type QueueEncryptionContext, QueueManager, type QueueStatus, type QueuedOperation, type QueuedOperationType, RECALL_MAX_LIMIT, RECALL_TOOL_NAME, type RankedMemory, type RecallContext, type RecallDegradation, type RecallDiagnostics, type RecallOptions, type RecallResult, type RecallToolCallbacks, type RecallToolOptions, type RecencyOptions, type ReflectOptions, type ReflectResult, RerankerUnavailableError, type ResumeStreamOptions, type ResumeStreamResult, type RetainAction, type RetainContext, type RetainOptions, type RetainResult, type RetainSource, type RunEndEvent, type RunErrorEvent, type RunHooks, type RunStartEvent, type RunToolLoopOptions, type RunToolLoopResult, SDK_SCHEMA_VERSION, SERVER_TOOL_DEPENDENCY_SETS, SLIDER_CONFIG, STREAM_RESUMABLE_HEADER, type ScoreBreakdown, type SearchSource, type SelectServerToolsForPromptOptions, type ServerTool, type ServerToolCallEvent, type ServerToolsFilterFunction, type ServerToolsOptions, type ServerToolsResponse, type SettingsStorageOperationsContext, type SignMessageFn, type StepFinishEvent, type StockPriceClassification, type StockPricePreProcessorOptions, type StorageOperationsContext, type StoredConversation, type StoredConversationSummary, type StoredFileWithContext, type StoredMedia, type StoredMessage, type StoredMessageWithSimilarity, type StoredModelPreference, type StoredProject, type StoredUserPreference, type StoredVaultFolder, type StoredVaultMemory, StreamExpiredError, type StreamMetaEvent, type StreamResumeHandle, type StreamSmoothingConfig, type StreamingTransport, type StreamingTransportOptions, type StreamingTransportResult, type StyleAnalysisSchedule, TOOL_CATALOG, TOPICS_EXTRACTION_VERSION, TOPIC_EXTRACTION_BATCH_SIZE, type TextChunk, TextProcessor, type ToolConfig, type ToolExecutor, type ToolMatchOptions, type ToolMatchResult, type ToolSet, type ToolUseEndEvent, type ToolUseStartEvent, type TopicExtractOptions, type TopicExtractionInput, type TopicExtractionRunResult, type TurnCompleteEvent, type TurnSkippedEvent, type UpdateMediaOptions, type UpdateModelPreferenceOptions, type UpdateProjectOptions, type UpdateUserPreferenceOptions, type UpdateVaultFolderOptions, type UpdateVaultMemoryOptions, UserPreference, type UserPreferencesStorageOperationsContext, type VaultEmbeddingCache, VaultFolder, type VaultFolderOperationsContext, VaultMemory, type VaultMemoryOperationsContext, type VaultSaveOperation, type VaultSearchResult, WalletPoller, type WeatherClassification, type WeatherPreProcessorOptions, type WebSearchClassification, type WebSearchPreProcessorOptions, WordProcessor, ZipProcessor, type ZipProcessorOptions, activatedToolSetNames, analyzeStyle, buildConnectorGuidance, buildDeniedToolsRider, buildSystemPrompt, chunkAndEmbedAllMessages, chunkAndEmbedMessage, chunkText, classifyCryptoPrice, classifyCryptoPriceBatch, classifyStockPrice, classifyStockPriceBatch, classifyWeather, classifyWeatherBatch, classifyWebSearch, classifyWebSearchBatch, cleanupConversationSummary, clearAllEncryptionKeys, clearAllEncryptionState, clearAllKeyPairs, clearEncryptionKey, clearKeyPair, clearLazyTitleCache, clearMessagesOp, clearServerToolsCache, composeHooks, createAutoExtractor, createChunkVectorCache, createConversationOp, createCryptoPricePreProcessor, createMediaBatchOp, createMediaOp, createMemoryEngineTool, createMemoryVaultSearchTool, createMemoryVaultTool, createMessageOp, createPlatformCursorStore, createProjectOp, createRecallTool, createServerToolsFilter, createStockPricePreProcessor, createSummaryContext, createVaultEmbeddingCache, createVaultFolderOp, createVaultMemoriesBatchOp, createVaultMemoryOp, createWeatherPreProcessor, createWebSearchPreProcessor, decryptConversationTitle, decryptData, decryptDataBatch, decryptDataBytes, decryptDataWithKey, defaultServerToolsFilter, deleteAllVaultMemoriesForUserOp, deleteConversationOp, deleteConversationSummaryOp, deleteMediaByConversationOp, deleteMediaByMessageOp, deleteMediaOp, deleteModelPreferenceOp, deleteProjectOp, deleteUserPreferenceOp, deleteVaultFolderOp, deleteVaultMemoryOp, eagerEmbedContent, embedAllMessages, embedMessage, encryptData, encryptDataBatch, encryptDataWithKey, ensureDefaultFoldersOp, estimateMessagesTokens, estimateTokens, exportPublicKey, extractAndLinkEntitiesForMemoriesOp, extractAndRetain, extractEntitiesForMemories, extractFacts, findMatchingTools, generateConversationId, generateEmbedding, generateEmbeddings, generateMediaId, generateProjectId, getAIGeneratedMediaOp, getAllFilesOp, getAllVaultFoldersOp, getAllVaultMemoriesOp, getAllVaultMemoryContentsOp, getAudioOp, getCachedServerTools, getConversationOp, getConversationSummaryOp, getConversationsByProjectLazyOp, getConversationsByProjectOp, getConversationsLazyOp, getConversationsOp, getDocumentsOp, getEncryptionKey, getImagesOp, getMediaByConversationOp, getMediaByIdOp, getMediaByIdsOp, getMediaByMessageOp, getMediaByModelOp, getMediaByRoleOp, getMediaBySourceUrlOp, getMediaByTypeOp, getMediaCountOp, getMediaCountsByTypeOp, getMediaOp, getMediaTypeFromMime, getMemoriesNeedingTopicExtractionOp, getMessagesOp, getModelPreferenceOp, getProjectConversationCountOp, getProjectConversationsOp, getProjectOp, getProjectsOp, getRecentMediaOp, getServerTools, getSupportedFileTypes, getToolsChecksum, getUnfiledVaultMemoriesOp, getUserPreferenceOp, getUserUploadedMediaOp, getVaultFolderMemoryCountOp, getVaultMemoryOp, getVideosOp, hardDeleteMediaOp, hasEncryptionKey, hasKeyPair, isRerankerAvailable, isSupportedFile, isSupportedMediaType, makeSyntheticStoredConversation, makeSyntheticStoredMessage, maybeSummarizeHistory, mediaToStored, migrateFromModelPreferencesOp, moveMemoriesToFolderOp, onKeyAvailable, preEmbedVaultMemories, preprocessFiles, progressiveSummarize, projectToStored, queueManager, recall, reflect, relinkMisclassifiedVideosOp, renderTemplate, requestEncryptionKey, requestKeyPair, resumeStream, retain, runToolLoop, sanitizeQuotes, schemaToCreateSQL, sdkMigrations, sdkModelClasses, sdkSchema, searchChunksOp, searchMediaOp, searchMessagesOp, searchVaultMemories, selectServerToolsForPrompt, serverPlatformStorage, setModelPreferenceOp, setUserPreferenceOp, shouldAnalyzeStyle, shouldChunkMessage, shouldRefreshTools, splitMessagesAtThreshold, stampTopicsExtractedAtOp, streamCancelPath, streamReplayPath, summaryToSystemMessage, supersedeVaultMemoryOp, toolSetSystemPrompts, updateConversationProjectOp, updateConversationTitleOp, updateMediaMessageIdBatchOp, updateMediaOp, updateMessageChunksOp, updateMessageEmbeddingOp, updateMessageErrorOp, updateMessageFeedbackOp, updateModelsOp, updatePersonalityOp, updateProfileOp, updateProjectNameOp, updateProjectOp, updateVaultFolderContextOp, updateVaultFolderOp, updateVaultMemoryEmbeddingOp, updateVaultMemoryOp, upsertConversationSummaryOp, upsertMessageOp };
7857
+ export { type AnalyzeStyleOptions, type AnalyzeStyleResult, type ApiResponse, type ApiType, type AutoExecutedToolResult, type AutoExtractMessage, type AutoExtractor, type Budget, type BuildPromptOptions, type BuildPromptResult, type CachedChunkVectors, type CachedServerTools, type ChatCompletionUsage, type ChatRole, type ChunkSearchResult, type ChunkVectorCache, type ChunkingOptions, type ConnectorGuidance, type ConnectorGuidanceInput, type ConsolidationFallbackReason, Conversation, ConversationSummary, type CreateAutoExtractorOptions, type CreateConversationOptions, type CreateMediaOptions, type CreateMessageOptions, type CreateModelPreferenceOptions, type CreateProjectOptions, type CreateUserPreferenceOptions, type CreateVaultFolderOptions, type CreateVaultMemoryOptions, type CryptoPriceClassification, type CryptoPricePreProcessorOptions, DEFAULT_ANALYSIS_PROMPT, DEFAULT_ANALYZE_AFTER_MESSAGES, DEFAULT_CACHE_EXPIRATION_MS, DEFAULT_CHUNK_CACHE_SIZE, DEFAULT_CHUNK_OVERLAP, DEFAULT_CHUNK_SIZE, DEFAULT_DOCUMENT_PATTERN, DEFAULT_EXCLUDED_SERVER_TOOLS, DEFAULT_MAX_INPUT_MESSAGES, DEFAULT_MAX_PROFILE_LENGTH, DEFAULT_MIN_CHUNK_SIZE, DEFAULT_MIN_MESSAGES, DEFAULT_PERSONALITY_SETTINGS, DEFAULT_PROMPT_TEMPLATES, DEFAULT_REFRESH_EVERY_MESSAGES, DEFAULT_SERVER_TOOLS_MATCH_OPTIONS, DEFAULT_SUMMARY_MIN_WINDOW_MESSAGES, DEFAULT_SUMMARY_MODEL, DEFAULT_SUMMARY_TOKEN_THRESHOLD, DEFAULT_VAULT_CACHE_SIZE, DatabaseManager, type DatabaseManagerLogger, type DatabaseManagerOptions, type EmbeddedWalletSignerFn, ExcelProcessor, type ExtractFactsOptions, type ExtractOutcome, type ExtractedCandidate, type ExtractedEntity, type ExtractionCursorStore, type FactType, type FileMetadata, type FileProcessor, type FileTypeQuery, type FileWithData, type FlushResult, type GetConversationsPageOptions, INFERENCE_ID_HEADER, type LazyStoredConversation, type LlmTokenUsage, MAX_MESSAGES_PER_SUMMARIZATION, Media, type MediaDimensions, type MediaFilterOptions, type MediaMetadata, type MediaOperationsContext, type MediaRole, type MediaType, type MemoriesNeedingTopicExtraction, type EmbeddingOptions as MemoryEngineEmbeddingOptions, type MemoryEngineResult, type MemoryEngineSearchOptions, type MemoryExtractedEvent, type MemoryKind, type MemoryVaultSearchOptions, type MemoryVaultToolOptions, Message, type MessageChunk, type MessageFeedback, type ModelCallEndEvent, type ModelCallStartEvent, ModelPreference, type OperationExecutor, type ParsedServerToolsResponse, PdfProcessor, type PersonalitySettings, type PersonalitySliders, type PersonalityStyle, type PgClientLike, type PgPoolLike, type PlatformStorage, type PortalLlmAuth, PostgreSQLAdapter, type PostgreSQLAdapterOptions, type PreprocessingOptions, type PreprocessingResult, type ProcessedFileResult, ProcessorRegistry, type ProfileUpdate, Project, type ProjectOperationsContext, type PromptContext, type PromptPreProcessor, type PromptPreProcessorContext, type PromptSection, type PromptTemplates, type QueueEncryptionContext, QueueManager, type QueueStatus, type QueuedOperation, type QueuedOperationType, RECALL_MAX_LIMIT, RECALL_TOOL_NAME, type RankedMemory, type RecallContext, type RecallDegradation, type RecallDiagnostics, type RecallOptions, type RecallResult, type RecallToolCallbacks, type RecallToolOptions, type RecencyOptions, type ReflectOptions, type ReflectResult, RerankerUnavailableError, type ResumeStreamOptions, type ResumeStreamResult, type RetainAction, type RetainContext, type RetainOptions, type RetainResult, type RetainSource, type RunEndEvent, type RunErrorEvent, type RunHooks, type RunStartEvent, type RunToolLoopOptions, type RunToolLoopResult, SDK_SCHEMA_VERSION, SERVER_TOOL_DEPENDENCY_SETS, SLIDER_CONFIG, STREAM_RESUMABLE_HEADER, type ScoreBreakdown, type SearchSource, type SelectServerToolsForPromptOptions, type ServerTool, type ServerToolCallEvent, type ServerToolsFilterFunction, type ServerToolsOptions, type ServerToolsResponse, type SettingsStorageOperationsContext, type SignMessageFn, type StepFinishEvent, type StockPriceClassification, type StockPricePreProcessorOptions, type StorageOperationsContext, type StoredConversation, type StoredConversationSummary, type StoredFileWithContext, type StoredMedia, type StoredMessage, type StoredMessageWithSimilarity, type StoredModelPreference, type StoredProject, type StoredUserPreference, type StoredVaultFolder, type StoredVaultMemory, StreamExpiredError, type StreamMetaEvent, type StreamResumeHandle, type StreamSmoothingConfig, type StreamingTransport, type StreamingTransportOptions, type StreamingTransportResult, type StyleAnalysisSchedule, TOOL_CATALOG, TOPICS_EXTRACTION_VERSION, TOPIC_EXTRACTION_BATCH_SIZE, type TextChunk, TextProcessor, type ToolConfig, type ToolExecutor, type ToolMatchOptions, type ToolMatchResult, type ToolSet, type ToolUseEndEvent, type ToolUseStartEvent, type TopicExtractOptions, type TopicExtractionInput, type TopicExtractionRunResult, type TurnCompleteEvent, type TurnSkippedEvent, type UpdateMediaOptions, type UpdateModelPreferenceOptions, type UpdateProjectOptions, type UpdateUserPreferenceOptions, type UpdateVaultFolderOptions, type UpdateVaultMemoryOptions, UserPreference, type UserPreferencesStorageOperationsContext, type VaultEmbeddingCache, VaultFolder, type VaultFolderOperationsContext, VaultMemory, type VaultMemoryOperationsContext, type VaultSaveOperation, type VaultSearchResult, WalletPoller, type WeatherClassification, type WeatherPreProcessorOptions, type WebSearchClassification, type WebSearchPreProcessorOptions, WordProcessor, ZipProcessor, type ZipProcessorOptions, activatedToolSetNames, analyzeStyle, buildConnectorGuidance, buildDeniedToolsRider, buildSystemPrompt, chunkAndEmbedAllMessages, chunkAndEmbedMessage, chunkText, classifyCryptoPrice, classifyCryptoPriceBatch, classifyStockPrice, classifyStockPriceBatch, classifyWeather, classifyWeatherBatch, classifyWebSearch, classifyWebSearchBatch, cleanupConversationSummary, clearAllEncryptionKeys, clearAllEncryptionState, clearAllKeyPairs, clearEncryptionKey, clearKeyPair, clearLazyTitleCache, clearMessagesOp, clearServerToolsCache, composeHooks, createAutoExtractor, createChunkVectorCache, createConversationOp, createCryptoPricePreProcessor, createMediaBatchOp, createMediaOp, createMemoryEngineTool, createMemoryVaultSearchTool, createMemoryVaultTool, createMessageOp, createPlatformCursorStore, createProjectOp, createRecallTool, createServerToolsFilter, createStockPricePreProcessor, createSummaryContext, createVaultEmbeddingCache, createVaultFolderOp, createVaultMemoriesBatchOp, createVaultMemoryOp, createWeatherPreProcessor, createWebSearchPreProcessor, decryptConversationTitle, decryptData, decryptDataBatch, decryptDataBytes, decryptDataBytesFromBytes, decryptDataWithKey, defaultServerToolsFilter, deleteAllVaultMemoriesForUserOp, deleteConversationOp, deleteConversationSummaryOp, deleteMediaByConversationOp, deleteMediaByMessageOp, deleteMediaOp, deleteModelPreferenceOp, deleteProjectOp, deleteUserPreferenceOp, deleteVaultFolderOp, deleteVaultMemoryOp, eagerEmbedContent, embedAllMessages, embedMessage, encryptData, encryptDataBatch, encryptDataBytes, encryptDataWithKey, ensureDefaultFoldersOp, estimateMessagesTokens, estimateTokens, exportPublicKey, extractAndLinkEntitiesForMemoriesOp, extractAndRetain, extractEntitiesForMemories, extractFacts, findMatchingTools, generateConversationId, generateEmbedding, generateEmbeddings, generateMediaId, generateProjectId, getAIGeneratedMediaOp, getAllFilesOp, getAllVaultFoldersOp, getAllVaultMemoriesOp, getAllVaultMemoryContentsOp, getAudioOp, getCachedServerTools, getConversationOp, getConversationSummaryOp, getConversationsByProjectLazyOp, getConversationsByProjectOp, getConversationsLazyOp, getConversationsOp, getConversationsPageOp, getDocumentsOp, getEncryptionKey, getImagesOp, getMediaByConversationOp, getMediaByIdOp, getMediaByIdsOp, getMediaByMessageOp, getMediaByModelOp, getMediaByRoleOp, getMediaBySourceUrlOp, getMediaByTypeOp, getMediaCountOp, getMediaCountsByTypeOp, getMediaOp, getMediaTypeFromMime, getMemoriesNeedingTopicExtractionOp, getMessagesOp, getModelPreferenceOp, getProjectConversationCountOp, getProjectConversationsOp, getProjectOp, getProjectsOp, getRecentMediaOp, getServerTools, getSupportedFileTypes, getToolsChecksum, getUnfiledVaultMemoriesOp, getUserPreferenceOp, getUserUploadedMediaOp, getVaultFolderMemoryCountOp, getVaultMemoryOp, getVideosOp, hardDeleteMediaOp, hasEncryptionKey, hasKeyPair, isRerankerAvailable, isSupportedFile, isSupportedMediaType, makeSyntheticStoredConversation, makeSyntheticStoredMessage, maybeSummarizeHistory, mediaToStored, migrateFromModelPreferencesOp, moveMemoriesToFolderOp, onKeyAvailable, preEmbedVaultMemories, preprocessFiles, progressiveSummarize, projectToStored, queueManager, recall, reflect, relinkMisclassifiedVideosOp, renderTemplate, requestEncryptionKey, requestKeyPair, resumeStream, retain, runToolLoop, sanitizeQuotes, schemaToCreateSQL, sdkMigrations, sdkModelClasses, sdkSchema, searchChunksOp, searchMediaOp, searchMessagesOp, searchVaultMemories, selectServerToolsForPrompt, serverPlatformStorage, setModelPreferenceOp, setUserPreferenceOp, shouldAnalyzeStyle, shouldChunkMessage, shouldRefreshTools, splitMessagesAtThreshold, stampTopicsExtractedAtOp, streamCancelPath, streamReplayPath, summaryToSystemMessage, supersedeVaultMemoryOp, toolSetSystemPrompts, updateConversationProjectOp, updateConversationTitleOp, updateMediaMessageIdBatchOp, updateMediaOp, updateMessageChunksOp, updateMessageEmbeddingOp, updateMessageErrorOp, updateMessageFeedbackOp, updateModelsOp, updatePersonalityOp, updateProfileOp, updateProjectNameOp, updateProjectOp, updateVaultFolderContextOp, updateVaultFolderOp, updateVaultMemoryEmbeddingOp, updateVaultMemoryOp, upsertConversationSummaryOp, upsertMessageOp };