@anuma/sdk 6.31.3 → 6.31.4-next.20261007051905
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/react/index.cjs +219 -67
- package/dist/react/index.d.mts +57 -1
- package/dist/react/index.d.ts +57 -1
- package/dist/react/index.mjs +217 -67
- package/package.json +1 -1
package/dist/react/index.cjs
CHANGED
|
@@ -1653,6 +1653,7 @@ __export(index_exports, {
|
|
|
1653
1653
|
extractEntitiesForMemories: () => extractEntitiesForMemories,
|
|
1654
1654
|
extractFacts: () => extractFacts,
|
|
1655
1655
|
extractFileIds: () => extractFileIds,
|
|
1656
|
+
extractMCPImageUrls: () => extractMCPImageUrls,
|
|
1656
1657
|
fileExists: () => fileExists,
|
|
1657
1658
|
findById: () => findById,
|
|
1658
1659
|
findMatchingTools: () => findMatchingTools,
|
|
@@ -10603,6 +10604,7 @@ async function resumeStream(options) {
|
|
|
10603
10604
|
// src/react/useChat.ts
|
|
10604
10605
|
var import_react = require("react");
|
|
10605
10606
|
init_clientConfig();
|
|
10607
|
+
init_logger();
|
|
10606
10608
|
init_redactor();
|
|
10607
10609
|
function useChat(options) {
|
|
10608
10610
|
const {
|
|
@@ -10616,6 +10618,8 @@ function useChat(options) {
|
|
|
10616
10618
|
onServerToolCall,
|
|
10617
10619
|
onToolCallArgumentsDelta,
|
|
10618
10620
|
onStepFinish,
|
|
10621
|
+
resumable,
|
|
10622
|
+
onStreamMeta,
|
|
10619
10623
|
apiType: defaultApiType = "auto",
|
|
10620
10624
|
smoothing,
|
|
10621
10625
|
preProcessors,
|
|
@@ -10625,25 +10629,37 @@ function useChat(options) {
|
|
|
10625
10629
|
const [isLoading, setIsLoading] = (0, import_react.useState)(false);
|
|
10626
10630
|
const abortControllerRef = (0, import_react.useRef)(null);
|
|
10627
10631
|
const requestIdRef = (0, import_react.useRef)(0);
|
|
10632
|
+
const pendingInferenceRef = (0, import_react.useRef)(null);
|
|
10633
|
+
const cancelInference = (0, import_react.useCallback)(
|
|
10634
|
+
(inferenceId) => {
|
|
10635
|
+
void (async () => {
|
|
10636
|
+
const token = getToken ? await getToken() : null;
|
|
10637
|
+
const response = await fetch(`${baseUrl}${streamCancelPath(inferenceId)}`, {
|
|
10638
|
+
method: "POST",
|
|
10639
|
+
headers: token ? { Authorization: `Bearer ${token}` } : void 0
|
|
10640
|
+
});
|
|
10641
|
+
if (!response.ok) throw new Error(`Stream cancellation failed: ${response.status}`);
|
|
10642
|
+
})().catch((error) => getLogger().warn("[useChat] stream cancel POST failed:", error));
|
|
10643
|
+
},
|
|
10644
|
+
[getToken, baseUrl]
|
|
10645
|
+
);
|
|
10628
10646
|
const piiRedactorRef = (0, import_react.useRef)(null);
|
|
10629
10647
|
if (piiRedaction === true && !piiRedactorRef.current) {
|
|
10630
10648
|
piiRedactorRef.current = new PiiRedactor();
|
|
10631
10649
|
}
|
|
10632
10650
|
const resolvedPiiRedaction = piiRedaction === true ? piiRedactorRef.current : piiRedaction;
|
|
10633
10651
|
const stop = (0, import_react.useCallback)(() => {
|
|
10652
|
+
const inferenceId = pendingInferenceRef.current;
|
|
10653
|
+
pendingInferenceRef.current = null;
|
|
10654
|
+
if (resumable && inferenceId) cancelInference(inferenceId);
|
|
10634
10655
|
if (abortControllerRef.current) {
|
|
10635
10656
|
abortControllerRef.current.abort();
|
|
10636
10657
|
abortControllerRef.current = null;
|
|
10637
10658
|
}
|
|
10638
|
-
}, []);
|
|
10639
|
-
(0, import_react.
|
|
10640
|
-
|
|
10641
|
-
|
|
10642
|
-
abortControllerRef.current.abort();
|
|
10643
|
-
abortControllerRef.current = null;
|
|
10644
|
-
}
|
|
10645
|
-
};
|
|
10646
|
-
}, []);
|
|
10659
|
+
}, [resumable, cancelInference]);
|
|
10660
|
+
const stopRef = (0, import_react.useRef)(stop);
|
|
10661
|
+
stopRef.current = stop;
|
|
10662
|
+
(0, import_react.useEffect)(() => () => stopRef.current(), []);
|
|
10647
10663
|
const sendMessage = (0, import_react.useCallback)(
|
|
10648
10664
|
async ({
|
|
10649
10665
|
messages,
|
|
@@ -10669,9 +10685,7 @@ function useChat(options) {
|
|
|
10669
10685
|
endpointOverride,
|
|
10670
10686
|
piiRedaction: requestPiiRedaction
|
|
10671
10687
|
}) => {
|
|
10672
|
-
|
|
10673
|
-
abortControllerRef.current.abort();
|
|
10674
|
-
}
|
|
10688
|
+
stop();
|
|
10675
10689
|
const abortController = new AbortController();
|
|
10676
10690
|
abortControllerRef.current = abortController;
|
|
10677
10691
|
const requestId = ++requestIdRef.current;
|
|
@@ -10738,6 +10752,15 @@ function useChat(options) {
|
|
|
10738
10752
|
headers,
|
|
10739
10753
|
apiType: requestApiType ?? defaultApiType,
|
|
10740
10754
|
endpointOverride,
|
|
10755
|
+
resumable,
|
|
10756
|
+
onStreamMeta: resumable || onStreamMeta ? (meta) => {
|
|
10757
|
+
if (requestId !== requestIdRef.current || abortController.signal.aborted) {
|
|
10758
|
+
if (resumable) cancelInference(meta.inferenceId);
|
|
10759
|
+
return;
|
|
10760
|
+
}
|
|
10761
|
+
pendingInferenceRef.current = meta.inferenceId;
|
|
10762
|
+
onStreamMeta?.(meta);
|
|
10763
|
+
} : void 0,
|
|
10741
10764
|
temperature,
|
|
10742
10765
|
maxOutputTokens,
|
|
10743
10766
|
tools,
|
|
@@ -10777,12 +10800,15 @@ function useChat(options) {
|
|
|
10777
10800
|
if (requestIdRef.current === requestId) {
|
|
10778
10801
|
setIsLoading(false);
|
|
10779
10802
|
abortControllerRef.current = null;
|
|
10803
|
+
pendingInferenceRef.current = null;
|
|
10780
10804
|
}
|
|
10781
10805
|
}
|
|
10782
10806
|
},
|
|
10783
10807
|
[
|
|
10784
10808
|
getToken,
|
|
10785
10809
|
baseUrl,
|
|
10810
|
+
stop,
|
|
10811
|
+
cancelInference,
|
|
10786
10812
|
globalOnData,
|
|
10787
10813
|
globalOnThinking,
|
|
10788
10814
|
onFinish,
|
|
@@ -10791,6 +10817,8 @@ function useChat(options) {
|
|
|
10791
10817
|
onServerToolCall,
|
|
10792
10818
|
onToolCallArgumentsDelta,
|
|
10793
10819
|
onStepFinish,
|
|
10820
|
+
resumable,
|
|
10821
|
+
onStreamMeta,
|
|
10794
10822
|
defaultApiType,
|
|
10795
10823
|
smoothing,
|
|
10796
10824
|
preProcessors,
|
|
@@ -24690,6 +24718,8 @@ function useChatStorage(options) {
|
|
|
24690
24718
|
onError,
|
|
24691
24719
|
onServerToolCall,
|
|
24692
24720
|
onToolCallArgumentsDelta,
|
|
24721
|
+
resumable,
|
|
24722
|
+
onStreamMeta,
|
|
24693
24723
|
apiType,
|
|
24694
24724
|
walletAddress,
|
|
24695
24725
|
signMessage,
|
|
@@ -25254,6 +25284,8 @@ function useChatStorage(options) {
|
|
|
25254
25284
|
onError,
|
|
25255
25285
|
onServerToolCall,
|
|
25256
25286
|
onToolCallArgumentsDelta,
|
|
25287
|
+
resumable,
|
|
25288
|
+
onStreamMeta,
|
|
25257
25289
|
apiType,
|
|
25258
25290
|
preProcessors,
|
|
25259
25291
|
smoothing,
|
|
@@ -25676,6 +25708,7 @@ function useChatStorage(options) {
|
|
|
25676
25708
|
return {
|
|
25677
25709
|
data: result2.data,
|
|
25678
25710
|
error: null,
|
|
25711
|
+
autoExecutedToolResults: "autoExecutedToolResults" in result2 ? result2.autoExecutedToolResults : void 0,
|
|
25679
25712
|
skipped: true
|
|
25680
25713
|
};
|
|
25681
25714
|
}
|
|
@@ -32167,6 +32200,22 @@ async function uploadFileToDropbox(accessToken, filename, content, folder = DEFA
|
|
|
32167
32200
|
}
|
|
32168
32201
|
return response.json();
|
|
32169
32202
|
}
|
|
32203
|
+
async function getDropboxFileMetadata(accessToken, filename, folder = DEFAULT_BACKUP_FOLDER) {
|
|
32204
|
+
const response = await fetch(`${DROPBOX_API_URL}/files/get_metadata`, {
|
|
32205
|
+
method: "POST",
|
|
32206
|
+
headers: {
|
|
32207
|
+
Authorization: `Bearer ${accessToken}`,
|
|
32208
|
+
"Content-Type": "application/json"
|
|
32209
|
+
},
|
|
32210
|
+
body: JSON.stringify({ path: `${folder}/${filename}` })
|
|
32211
|
+
});
|
|
32212
|
+
if (response.status === 409) return null;
|
|
32213
|
+
if (!response.ok) {
|
|
32214
|
+
const errorText = await response.text();
|
|
32215
|
+
throw new Error(`Dropbox get metadata failed: ${response.status} - ${errorText}`);
|
|
32216
|
+
}
|
|
32217
|
+
return response.json();
|
|
32218
|
+
}
|
|
32170
32219
|
async function listDropboxFiles(accessToken, folder = DEFAULT_BACKUP_FOLDER) {
|
|
32171
32220
|
await ensureBackupFolder(accessToken, folder);
|
|
32172
32221
|
const response = await fetch(`${DROPBOX_API_URL}/files/list_folder`, {
|
|
@@ -32232,27 +32281,61 @@ async function downloadDropboxFile(accessToken, path) {
|
|
|
32232
32281
|
}
|
|
32233
32282
|
return response.blob();
|
|
32234
32283
|
}
|
|
32235
|
-
async function findDropboxFile(accessToken, filename, folder = DEFAULT_BACKUP_FOLDER) {
|
|
32236
|
-
const files = await listDropboxFiles(accessToken, folder);
|
|
32237
|
-
return files.find((f) => f.name === filename) || null;
|
|
32238
|
-
}
|
|
32239
32284
|
|
|
32240
32285
|
// src/lib/backup/dropbox/backup.ts
|
|
32241
32286
|
var isAuthError = (err) => err instanceof Error && (err.message.includes("401") || err.message.includes("invalid_access_token"));
|
|
32242
|
-
|
|
32287
|
+
var MAX_LISTING_FAILURES = 3;
|
|
32288
|
+
function createDropboxFileIndex(backupFolder) {
|
|
32289
|
+
let pending;
|
|
32290
|
+
let failures = 0;
|
|
32291
|
+
return {
|
|
32292
|
+
get(token) {
|
|
32293
|
+
if (!pending) {
|
|
32294
|
+
if (failures >= MAX_LISTING_FAILURES) {
|
|
32295
|
+
return Promise.reject(
|
|
32296
|
+
new Error("The backup folder listing failed repeatedly; skipped for this run")
|
|
32297
|
+
);
|
|
32298
|
+
}
|
|
32299
|
+
pending = listDropboxFiles(token, backupFolder).then((files) => {
|
|
32300
|
+
const byName = /* @__PURE__ */ new Map();
|
|
32301
|
+
for (const file of files) {
|
|
32302
|
+
if (!byName.has(file.name)) byName.set(file.name, file);
|
|
32303
|
+
}
|
|
32304
|
+
return byName;
|
|
32305
|
+
}).catch((err) => {
|
|
32306
|
+
pending = void 0;
|
|
32307
|
+
failures++;
|
|
32308
|
+
throw err;
|
|
32309
|
+
});
|
|
32310
|
+
}
|
|
32311
|
+
return pending;
|
|
32312
|
+
}
|
|
32313
|
+
};
|
|
32314
|
+
}
|
|
32315
|
+
async function readLocalUpdatedAt(database, conversationId) {
|
|
32316
|
+
const { Q: Q19 } = await import("@nozbe/watermelondb");
|
|
32317
|
+
const records = await database.get("conversations").query(Q19.where("conversation_id", conversationId)).fetch();
|
|
32318
|
+
const match = records.map(conversationToStoredRaw).find((c) => c.conversationId === conversationId);
|
|
32319
|
+
return match ? match.updatedAt : null;
|
|
32320
|
+
}
|
|
32321
|
+
async function pushConversationToDropbox(database, conversationId, userAddress, token, fileIndex, deps, backupFolder = DEFAULT_BACKUP_FOLDER, _retried = false) {
|
|
32243
32322
|
try {
|
|
32244
32323
|
await deps.requestEncryptionKey(userAddress);
|
|
32245
32324
|
const filename = `${conversationId}.json`;
|
|
32246
|
-
const
|
|
32325
|
+
const index = await fileIndex.get(token);
|
|
32326
|
+
const existingFile = index.get(filename);
|
|
32247
32327
|
if (existingFile) {
|
|
32248
|
-
const
|
|
32249
|
-
const
|
|
32250
|
-
|
|
32251
|
-
|
|
32252
|
-
|
|
32253
|
-
|
|
32254
|
-
|
|
32255
|
-
|
|
32328
|
+
const localUpdatedAt = await readLocalUpdatedAt(database, conversationId);
|
|
32329
|
+
const localUpdated = localUpdatedAt ? localUpdatedAt.getTime() : null;
|
|
32330
|
+
if (localUpdated !== null && localUpdated <= new Date(existingFile.server_modified).getTime()) {
|
|
32331
|
+
return "skipped";
|
|
32332
|
+
}
|
|
32333
|
+
const current = await getDropboxFileMetadata(token, filename, backupFolder);
|
|
32334
|
+
if (!current) {
|
|
32335
|
+
index.delete(filename);
|
|
32336
|
+
} else {
|
|
32337
|
+
index.set(filename, current);
|
|
32338
|
+
if (localUpdated !== null && localUpdated <= new Date(current.server_modified).getTime()) {
|
|
32256
32339
|
return "skipped";
|
|
32257
32340
|
}
|
|
32258
32341
|
}
|
|
@@ -32261,7 +32344,8 @@ async function pushConversationToDropbox(database, conversationId, userAddress,
|
|
|
32261
32344
|
if (!exportResult.success || !exportResult.blob) {
|
|
32262
32345
|
return "failed";
|
|
32263
32346
|
}
|
|
32264
|
-
await uploadFileToDropbox(token, filename, exportResult.blob, backupFolder);
|
|
32347
|
+
const uploaded = await uploadFileToDropbox(token, filename, exportResult.blob, backupFolder);
|
|
32348
|
+
index.set(filename, uploaded);
|
|
32265
32349
|
return "uploaded";
|
|
32266
32350
|
} catch (err) {
|
|
32267
32351
|
if (isAuthError(err) && !_retried) {
|
|
@@ -32272,6 +32356,7 @@ async function pushConversationToDropbox(database, conversationId, userAddress,
|
|
|
32272
32356
|
conversationId,
|
|
32273
32357
|
userAddress,
|
|
32274
32358
|
newToken,
|
|
32359
|
+
fileIndex,
|
|
32275
32360
|
deps,
|
|
32276
32361
|
backupFolder,
|
|
32277
32362
|
true
|
|
@@ -32295,6 +32380,7 @@ async function performDropboxExport(database, userAddress, token, deps, onProgre
|
|
|
32295
32380
|
}
|
|
32296
32381
|
let uploaded = 0;
|
|
32297
32382
|
let skipped = 0;
|
|
32383
|
+
const fileIndex = createDropboxFileIndex(backupFolder);
|
|
32298
32384
|
for (let i = 0; i < conversations.length; i++) {
|
|
32299
32385
|
const conv = conversations[i];
|
|
32300
32386
|
onProgress?.(i + 1, total);
|
|
@@ -32303,6 +32389,7 @@ async function performDropboxExport(database, userAddress, token, deps, onProgre
|
|
|
32303
32389
|
conv.conversationId,
|
|
32304
32390
|
userAddress,
|
|
32305
32391
|
token,
|
|
32392
|
+
fileIndex,
|
|
32306
32393
|
deps,
|
|
32307
32394
|
backupFolder
|
|
32308
32395
|
);
|
|
@@ -32866,29 +32953,52 @@ async function listDriveFiles(accessToken, folderId) {
|
|
|
32866
32953
|
const data = await response.json();
|
|
32867
32954
|
return data.files ?? [];
|
|
32868
32955
|
}
|
|
32869
|
-
|
|
32870
|
-
|
|
32871
|
-
|
|
32872
|
-
|
|
32873
|
-
|
|
32874
|
-
|
|
32875
|
-
|
|
32876
|
-
|
|
32956
|
+
var DRIVE_MAX_PAGE_SIZE = 1e3;
|
|
32957
|
+
async function listAllDriveFiles(accessToken, folderId) {
|
|
32958
|
+
const query = `'${escapeQueryValue(folderId)}' in parents and trashed=false`;
|
|
32959
|
+
const fields = encodeURIComponent("nextPageToken,files(id,name,createdTime,modifiedTime,size)");
|
|
32960
|
+
const files = [];
|
|
32961
|
+
let pageToken;
|
|
32962
|
+
do {
|
|
32963
|
+
const tokenParam = pageToken ? `&pageToken=${encodeURIComponent(pageToken)}` : "";
|
|
32964
|
+
const response = await fetch(
|
|
32965
|
+
`${DRIVE_API_URL}/files?q=${encodeURIComponent(query)}&fields=${fields}&pageSize=${DRIVE_MAX_PAGE_SIZE}${tokenParam}`,
|
|
32966
|
+
{
|
|
32967
|
+
headers: { Authorization: `Bearer ${accessToken}` }
|
|
32968
|
+
}
|
|
32969
|
+
);
|
|
32970
|
+
if (!response.ok) {
|
|
32971
|
+
throw new Error(`Failed to list files: ${response.status}`);
|
|
32972
|
+
}
|
|
32973
|
+
const data = await response.json();
|
|
32974
|
+
files.push(...data.files ?? []);
|
|
32975
|
+
pageToken = data.nextPageToken;
|
|
32976
|
+
} while (pageToken);
|
|
32977
|
+
return files;
|
|
32877
32978
|
}
|
|
32878
|
-
async function
|
|
32879
|
-
const
|
|
32880
|
-
const fields = "files(id,name,createdTime,modifiedTime,size)";
|
|
32979
|
+
async function getDriveFileMetadata(accessToken, fileId) {
|
|
32980
|
+
const fields = encodeURIComponent("id,name,createdTime,modifiedTime,size,trashed");
|
|
32881
32981
|
const response = await fetch(
|
|
32882
|
-
`${DRIVE_API_URL}/files
|
|
32982
|
+
`${DRIVE_API_URL}/files/${encodeURIComponent(fileId)}?fields=${fields}`,
|
|
32883
32983
|
{
|
|
32884
32984
|
headers: { Authorization: `Bearer ${accessToken}` }
|
|
32885
32985
|
}
|
|
32886
32986
|
);
|
|
32987
|
+
if (response.status === 404) return null;
|
|
32887
32988
|
if (!response.ok) {
|
|
32888
|
-
throw new Error(`Failed to
|
|
32989
|
+
throw new Error(`Failed to read file: ${response.status}`);
|
|
32889
32990
|
}
|
|
32890
32991
|
const data = await response.json();
|
|
32891
|
-
return data.
|
|
32992
|
+
return data.trashed ? null : data;
|
|
32993
|
+
}
|
|
32994
|
+
async function downloadDriveFile(accessToken, fileId) {
|
|
32995
|
+
const response = await fetch(`${DRIVE_API_URL}/files/${fileId}?alt=media`, {
|
|
32996
|
+
headers: { Authorization: `Bearer ${accessToken}` }
|
|
32997
|
+
});
|
|
32998
|
+
if (!response.ok) {
|
|
32999
|
+
throw new Error(`Failed to download file: ${response.status}`);
|
|
33000
|
+
}
|
|
33001
|
+
return response.blob();
|
|
32892
33002
|
}
|
|
32893
33003
|
|
|
32894
33004
|
// src/lib/backup/google/backup.ts
|
|
@@ -32910,28 +33020,59 @@ async function getConversationsFolder(token, requestDriveAccess, rootFolder, sub
|
|
|
32910
33020
|
throw err;
|
|
32911
33021
|
}
|
|
32912
33022
|
}
|
|
32913
|
-
|
|
33023
|
+
var MAX_LISTING_FAILURES2 = 3;
|
|
33024
|
+
function createDriveFileIndex(folderId) {
|
|
33025
|
+
let pending;
|
|
33026
|
+
let failures = 0;
|
|
33027
|
+
return {
|
|
33028
|
+
get(token) {
|
|
33029
|
+
if (!pending) {
|
|
33030
|
+
if (failures >= MAX_LISTING_FAILURES2) {
|
|
33031
|
+
return Promise.reject(
|
|
33032
|
+
new Error("The backup folder listing failed repeatedly; skipped for this run")
|
|
33033
|
+
);
|
|
33034
|
+
}
|
|
33035
|
+
pending = listAllDriveFiles(token, folderId).then((files) => {
|
|
33036
|
+
const byName = /* @__PURE__ */ new Map();
|
|
33037
|
+
for (const file of files) {
|
|
33038
|
+
if (!byName.has(file.name)) byName.set(file.name, file);
|
|
33039
|
+
}
|
|
33040
|
+
return byName;
|
|
33041
|
+
}).catch((err) => {
|
|
33042
|
+
pending = void 0;
|
|
33043
|
+
failures++;
|
|
33044
|
+
throw err;
|
|
33045
|
+
});
|
|
33046
|
+
}
|
|
33047
|
+
return pending;
|
|
33048
|
+
}
|
|
33049
|
+
};
|
|
33050
|
+
}
|
|
33051
|
+
async function readLocalUpdatedAt2(database, conversationId) {
|
|
33052
|
+
const { Q: Q19 } = await import("@nozbe/watermelondb");
|
|
33053
|
+
const records = await database.get("conversations").query(Q19.where("conversation_id", conversationId)).fetch();
|
|
33054
|
+
const match = records.map(conversationToStoredRaw).find((c) => c.conversationId === conversationId);
|
|
33055
|
+
return match ? match.updatedAt : null;
|
|
33056
|
+
}
|
|
33057
|
+
async function pushConversationToDrive(database, conversationId, userAddress, token, folderId, fileIndex, deps, _retried = false) {
|
|
32914
33058
|
try {
|
|
32915
33059
|
await deps.requestEncryptionKey(userAddress);
|
|
32916
|
-
const folderResult = await getConversationsFolder(
|
|
32917
|
-
token,
|
|
32918
|
-
deps.requestDriveAccess,
|
|
32919
|
-
rootFolder,
|
|
32920
|
-
subfolder
|
|
32921
|
-
);
|
|
32922
|
-
if (!folderResult) return "failed";
|
|
32923
|
-
const { folderId, token: activeToken } = folderResult;
|
|
32924
33060
|
const filename = `${conversationId}.json`;
|
|
32925
|
-
const
|
|
33061
|
+
const index = await fileIndex.get(token);
|
|
33062
|
+
let existingFile = index.get(filename);
|
|
32926
33063
|
if (existingFile) {
|
|
32927
|
-
const
|
|
32928
|
-
const
|
|
32929
|
-
|
|
32930
|
-
|
|
32931
|
-
|
|
32932
|
-
|
|
32933
|
-
|
|
32934
|
-
|
|
33064
|
+
const localUpdatedAt = await readLocalUpdatedAt2(database, conversationId);
|
|
33065
|
+
const localUpdated = localUpdatedAt ? localUpdatedAt.getTime() : null;
|
|
33066
|
+
if (localUpdated !== null && localUpdated <= new Date(existingFile.modifiedTime).getTime()) {
|
|
33067
|
+
return "skipped";
|
|
33068
|
+
}
|
|
33069
|
+
const current = await getDriveFileMetadata(token, existingFile.id);
|
|
33070
|
+
if (!current) {
|
|
33071
|
+
index.delete(filename);
|
|
33072
|
+
existingFile = void 0;
|
|
33073
|
+
} else {
|
|
33074
|
+
index.set(filename, current);
|
|
33075
|
+
if (localUpdated !== null && localUpdated <= new Date(current.modifiedTime).getTime()) {
|
|
32935
33076
|
return "skipped";
|
|
32936
33077
|
}
|
|
32937
33078
|
}
|
|
@@ -32940,10 +33081,19 @@ async function pushConversationToDrive(database, conversationId, userAddress, to
|
|
|
32940
33081
|
if (!exportResult.success || !exportResult.blob) {
|
|
32941
33082
|
return "failed";
|
|
32942
33083
|
}
|
|
33084
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
32943
33085
|
if (existingFile) {
|
|
32944
|
-
await updateDriveFile(
|
|
33086
|
+
await updateDriveFile(token, existingFile.id, exportResult.blob);
|
|
33087
|
+
index.set(filename, { ...existingFile, modifiedTime: now });
|
|
32945
33088
|
} else {
|
|
32946
|
-
await uploadFileToDrive(
|
|
33089
|
+
const created = await uploadFileToDrive(token, folderId, exportResult.blob, filename);
|
|
33090
|
+
index.set(filename, {
|
|
33091
|
+
id: created.id,
|
|
33092
|
+
name: created.name,
|
|
33093
|
+
createdTime: now,
|
|
33094
|
+
modifiedTime: now,
|
|
33095
|
+
size: String(exportResult.blob.size)
|
|
33096
|
+
});
|
|
32947
33097
|
}
|
|
32948
33098
|
return "uploaded";
|
|
32949
33099
|
} catch (err) {
|
|
@@ -32955,9 +33105,9 @@ async function pushConversationToDrive(database, conversationId, userAddress, to
|
|
|
32955
33105
|
conversationId,
|
|
32956
33106
|
userAddress,
|
|
32957
33107
|
newToken,
|
|
33108
|
+
folderId,
|
|
33109
|
+
fileIndex,
|
|
32958
33110
|
deps,
|
|
32959
|
-
rootFolder,
|
|
32960
|
-
subfolder,
|
|
32961
33111
|
true
|
|
32962
33112
|
);
|
|
32963
33113
|
} catch {
|
|
@@ -32978,7 +33128,8 @@ async function performGoogleDriveExport(database, userAddress, token, deps, onPr
|
|
|
32978
33128
|
if (!folderResult) {
|
|
32979
33129
|
return { success: false, uploaded: 0, skipped: 0, total: 0 };
|
|
32980
33130
|
}
|
|
32981
|
-
const { token: activeToken } = folderResult;
|
|
33131
|
+
const { folderId, token: activeToken } = folderResult;
|
|
33132
|
+
const fileIndex = createDriveFileIndex(folderId);
|
|
32982
33133
|
const { Q: Q19 } = await import("@nozbe/watermelondb");
|
|
32983
33134
|
const conversationsCollection = database.get("conversations");
|
|
32984
33135
|
const records = await conversationsCollection.query(Q19.where("is_deleted", false)).fetch();
|
|
@@ -32997,9 +33148,9 @@ async function performGoogleDriveExport(database, userAddress, token, deps, onPr
|
|
|
32997
33148
|
conv.conversationId,
|
|
32998
33149
|
userAddress,
|
|
32999
33150
|
activeToken,
|
|
33000
|
-
|
|
33001
|
-
|
|
33002
|
-
|
|
33151
|
+
folderId,
|
|
33152
|
+
fileIndex,
|
|
33153
|
+
deps
|
|
33003
33154
|
);
|
|
33004
33155
|
if (result === "uploaded") uploaded++;
|
|
33005
33156
|
if (result === "skipped") skipped++;
|
|
@@ -37628,6 +37779,7 @@ function renderAnumaJsx(jsx3) {
|
|
|
37628
37779
|
extractEntitiesForMemories,
|
|
37629
37780
|
extractFacts,
|
|
37630
37781
|
extractFileIds,
|
|
37782
|
+
extractMCPImageUrls,
|
|
37631
37783
|
fileExists,
|
|
37632
37784
|
findById,
|
|
37633
37785
|
findMatchingTools,
|
package/dist/react/index.d.mts
CHANGED
|
@@ -2721,6 +2721,13 @@ type SendMessageResult = {
|
|
|
2721
2721
|
* @inline
|
|
2722
2722
|
*/
|
|
2723
2723
|
interface UseChatOptions extends BaseUseChatOptions {
|
|
2724
|
+
/** Buffer streamed rounds so a service can verify their canonical output. */
|
|
2725
|
+
resumable?: boolean;
|
|
2726
|
+
/** Inference identifier for each HTTP round, including client-tool continuations. */
|
|
2727
|
+
onStreamMeta?: (meta: {
|
|
2728
|
+
inferenceId: string;
|
|
2729
|
+
round: number;
|
|
2730
|
+
}) => void;
|
|
2724
2731
|
/**
|
|
2725
2732
|
* Which API endpoint to use. Default: "auto"
|
|
2726
2733
|
* - "auto": automatically selects the best API based on model support
|
|
@@ -11819,6 +11826,13 @@ declare function previewToolSelection(options: {
|
|
|
11819
11826
|
* @inline
|
|
11820
11827
|
*/
|
|
11821
11828
|
interface UseChatStorageOptions extends BaseUseChatStorageOptions {
|
|
11829
|
+
/** Opt into the portal stream buffer for every generated round. */
|
|
11830
|
+
resumable?: boolean;
|
|
11831
|
+
/** Inference identifier for each HTTP round, including client-tool continuations. */
|
|
11832
|
+
onStreamMeta?: (meta: {
|
|
11833
|
+
inferenceId: string;
|
|
11834
|
+
round: number;
|
|
11835
|
+
}) => void;
|
|
11822
11836
|
/**
|
|
11823
11837
|
* Which API endpoint to use. Default: "responses"
|
|
11824
11838
|
* - "responses": OpenAI Responses API (supports thinking, reasoning, conversations)
|
|
@@ -11979,6 +11993,11 @@ type SendMessageWithStorageResult = {
|
|
|
11979
11993
|
error: null;
|
|
11980
11994
|
userMessage?: undefined;
|
|
11981
11995
|
assistantMessage?: undefined;
|
|
11996
|
+
/** Client-tool output remains available even when no private history is written. */
|
|
11997
|
+
autoExecutedToolResults?: {
|
|
11998
|
+
name: string;
|
|
11999
|
+
result: unknown;
|
|
12000
|
+
}[];
|
|
11982
12001
|
/** Indicates this was a skipStorage request - no messages were persisted */
|
|
11983
12002
|
skipped: true;
|
|
11984
12003
|
} | {
|
|
@@ -12313,6 +12332,43 @@ interface ChatStorageAdapter {
|
|
|
12313
12332
|
write<T>(fn: (adapter: ChatStorageAdapter) => Promise<T>): Promise<T>;
|
|
12314
12333
|
}
|
|
12315
12334
|
|
|
12335
|
+
/**
|
|
12336
|
+
* Pure functions for extracting MCP media URLs (images and videos).
|
|
12337
|
+
*
|
|
12338
|
+
* These are extracted from `useChatMedia.extractAndStoreEncryptedMCPImages`
|
|
12339
|
+
* so they can be tested in isolation without React hooks or OPFS dependencies.
|
|
12340
|
+
*/
|
|
12341
|
+
/** Minimal tool call event shape needed for URL extraction. */
|
|
12342
|
+
interface ToolCallEvent {
|
|
12343
|
+
name?: string;
|
|
12344
|
+
output?: string;
|
|
12345
|
+
}
|
|
12346
|
+
/** Media kind an extracted URL resolves to. */
|
|
12347
|
+
type ExtractedMediaKind = "image" | "video";
|
|
12348
|
+
/** Extracted media URL with its associated model and resolved kind. */
|
|
12349
|
+
interface ExtractedMediaUrl {
|
|
12350
|
+
url: string;
|
|
12351
|
+
model: string;
|
|
12352
|
+
/** "video" when the URL/tool is a video source, otherwise "image". */
|
|
12353
|
+
mediaType: ExtractedMediaKind;
|
|
12354
|
+
}
|
|
12355
|
+
/**
|
|
12356
|
+
* Extracts MCP media URLs from tool_call_events (primary) or content (fallback).
|
|
12357
|
+
*
|
|
12358
|
+
* Primary path: parses JSON output of image- and video-generation tool calls.
|
|
12359
|
+
* Fallback path: regex-matches MCP R2 domain URLs in content and classifies
|
|
12360
|
+
* each by file extension (so videos aren't mislabeled as images).
|
|
12361
|
+
*
|
|
12362
|
+
* The function name is retained for call-site stability; it now returns videos
|
|
12363
|
+
* too, each tagged with `mediaType`.
|
|
12364
|
+
*
|
|
12365
|
+
* @param content - The message content (may contain markdown/HTML media refs)
|
|
12366
|
+
* @param toolCallEvents - Tool call events from streaming accumulator
|
|
12367
|
+
* @param mcpR2Domain - The R2 domain to match
|
|
12368
|
+
* @returns Array of extracted URLs with model + mediaType info
|
|
12369
|
+
*/
|
|
12370
|
+
declare function extractMCPImageUrls(content: string, toolCallEvents: ToolCallEvent[] | undefined, mcpR2Domain: string): ExtractedMediaUrl[];
|
|
12371
|
+
|
|
12316
12372
|
/**
|
|
12317
12373
|
* OPFS (Origin Private File System) storage utilities with encryption support.
|
|
12318
12374
|
*
|
|
@@ -16687,4 +16743,4 @@ declare function renderAnumaTree(node: AnumaNode): React.ReactElement | null;
|
|
|
16687
16743
|
*/
|
|
16688
16744
|
declare function renderAnumaJsx(jsx: string): React.ReactElement | null;
|
|
16689
16745
|
|
|
16690
|
-
export { Anuma, type AnumaChild, AnumaJsxError, type AnumaNode, AnumaShadowIsolationProvider, type AnumaShadowIsolationProviderProps, type AnumaTheme, AnumaThemeProvider, type AnumaThemeProviderProps, AppFile as AppFileModel, type AppFileOperationsContext, type AttrValue, type AutoExtractMessage, type AutoExtractor, DEFAULT_CONVERSATIONS_FOLDER as BACKUP_DRIVE_CONVERSATIONS_FOLDER, DEFAULT_ROOT_FOLDER as BACKUP_DRIVE_ROOT_FOLDER, DEFAULT_BACKUP_FOLDER as BACKUP_ICLOUD_FOLDER, BUILT_IN_TOOL_SETS, type BackupAuthContextValue, BackupAuthProvider, type BackupAuthProviderProps, type BackupOperationOptions, BlobUrlManager, type Budget, CHUNKS_DISCARDED_ORIGIN, type CachedChunkVectors, type CachedServerTools, ChartCard, type ChartCardProps, type ChartConfig, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, Conversation as ChatConversation, Message as ChatMessage, type ChatRole, type ChatStorageAdapter, type ChatStorageObservable, type ChunkSearchResult, type ChunkVectorCache, type ChunkingOptions, type CircleProps, type ClientToolsFilterFn, type ConsolidationAction, type ConsolidationFallbackReason, type ConversationMemoryInput, ConversationMemory as ConversationMemoryModel, type ConversationMemoryOperationsContext, type ConversationQueryOptions, type CreateAutoExtractorOptions, type CreateConversationOptions, type CreateDecaySweeperOptions, type CreateEntityOptions, type CreateMediaOptions, type CreateMessageOptions, type CreateModelPreferenceOptions, type CreateProjectOptions, type CreateSavedToolOptions, type CreateServerToolsFilterOptions, type CreateUserPreferenceOptions, type CreateVaultFolderOptions, type CreateVaultMemoryOptions, type CryptoPriceClassification, type CryptoPricePreProcessorOptions, DEFAULT_BACKUP_FOLDER$1 as DEFAULT_BACKUP_FOLDER, DEFAULT_CACHE_EXPIRATION_MS, DEFAULT_CHUNK_CACHE_SIZE, DEFAULT_CHUNK_OVERLAP, DEFAULT_CHUNK_SIZE, DEFAULT_DECAY_POLICY, DEFAULT_CONVERSATIONS_FOLDER as DEFAULT_DRIVE_CONVERSATIONS_FOLDER, DEFAULT_ROOT_FOLDER as DEFAULT_DRIVE_ROOT_FOLDER, DEFAULT_BACKUP_FOLDER$1 as DEFAULT_DROPBOX_FOLDER, DEFAULT_EXCLUDED_SERVER_TOOLS, DEFAULT_BACKUP_FOLDER as DEFAULT_ICLOUD_BACKUP_FOLDER, DEFAULT_MAX_CLASSIFIER_CALLS_PER_SWEEP, DEFAULT_MIN_CHUNK_SIZE, DEFAULT_PERSONALITY_SETTINGS, DEFAULT_PROFILE_FACETS, DEFAULT_PROFILE_FACT_TYPE_WEIGHTS, DEFAULT_PROFILE_PROOF_ALPHA, DEFAULT_PROFILE_TREND_MULTIPLIERS, DEFAULT_SERVER_TOOLS_MATCH_OPTIONS, DEFAULT_VAULT_CACHE_SIZE, DatabaseManager, type DatabaseManagerLogger, type DatabaseManagerOptions, type DecayCandidateRaw, type DecayClassifier, type DecayInput, type DecayPolicy, type DecaySweepResult, type DecaySweeper, type DecayVerdict, type DeckProps, type DisplayToolMigrations, type DropboxAuthContextValue, DropboxAuthProvider, type DropboxAuthProviderProps, type DropboxExportResult, type DropboxImportResult, type DurableAutoExtractorOptions, ENTITY_FANOUT, ENTITY_KINDS, type EmbeddedWalletSignerFn, EncryptionKeyMissingError, type EncryptionKeyVersion, type EntityInput, type EntityKind, Entity as EntityModel, type EntityOperationsContext, ExcelProcessor, type ExtractFactsOptions, type ExtractOutcome, type ExtractedCandidate, type ExtractedEntity, type ExtractionCursorStore, type ExtractionFunnel, type ExtractionTimings, FILE_PLACEHOLDER_PREFIX, FILE_PLACEHOLDER_REGEX, type FactType, type FileMetadata, type FileProcessingReason, type FileProcessingStatus, type FileProcessor, type FileTypeQuery, type FileWithData, type FlushResult, type GetConversationsPageOptions, type GetMessagesPageOptions, type GoogleDriveAuthContextValue, GoogleDriveAuthProvider, type GoogleDriveAuthProviderProps, type GoogleDriveExportResult, type GoogleDriveImportResult, type GraphTraversalOptions, type GroupProps, HARD_DELETE_WINDOW_MS, type ICloudAuthContextValue, ICloudAuthProvider, type ICloudAuthProviderProps, type ICloudExportResult, type ICloudImportResult, INFERENCE_ID_HEADER, INTERNAL_FLOW_MARKER, type IconProps, type ImageProps, type InjectionClassifierOptions, type InjectionReason, type InteractionType, type KnownTag, type LazyStoredConversation, type LineProps, type LlmDecayClassifierOptions, type LlmNeighborRefinerOptions, type Logger, LoggerProvider, type LoggerProviderProps, MAX_HOPS, MEDIUM_TTL_MS, type ManualFactType, type MediaDimensions, type MediaFilterOptions, type MediaMetadata, type MediaOperationsContext, type MediaRole, type MediaType, type MemoriesNeedingTopicExtraction, type MemoryContextItem, type MemoryContextLane, type MemoryContextOptions, type MemoryContextResult, type EmbeddingOptions as MemoryEngineEmbeddingOptions, type MemoryEngineResult, type MemoryEngineSearchOptions, MemoryEntity as MemoryEntityModel, type MemoryExtractedEvent, type MemoryKind, type MemoryQuarantinedEvent, type MemoryToVerify, type MemoryVaultSearchOptions, type MemoryVaultToolOptions, type MemoryVerification, type MessageChunk, type MessageFeedback, type MessageOrigin, type MessageSkeleton, type ModelLoadProgress, NEVER_TTL_MS, NODE_BUDGET, type NeighborRefiner, type NowSource, type OCRFile, type ObservationTrend, type ObservationTrendInput, type OperationExecutor, PAST_EVENT_GRACE_MS, PROFILE_DOC_VERSION, type ParsedServerToolsResponse, type PdfExportOptions, type PdfExportProgress, type PdfExportStage, type PdfFile, PdfProcessor, type PendingInteraction, type PersonalitySettings, type PersonalitySliders, type PersonalityStyle, type PhoneCallPollingOptions, type PhotoIngestResult, type PhotoMediaRef, type PlatformStorage, type PortalLlmAuth, type PortalLlmFailure, type PortalLlmFailureReason, type PreprocessingOptions, type PreprocessingResult, type ProcessedFileResult, ProcessorRegistry, type ProfileConfigFingerprint, type ProfileDoc, type ProfileFacet, type ProfileFacetKey, type ProfileSalienceInput, type ProfileSection, type ProfileUpdate, type ProgressCallback, Project, type ProjectOperationsContext, type PromptPreProcessor, type PromptPreProcessorContext, type ProviderAuthState, type ProviderBackupState, ProviderStreamError, type PublishedPhotoMemory, type QuantizedEmbedding, type QuarantinedMemoryInfo, type QueueEncryptionContext, QueueManager, type QueueStatus, type QueuedOperation, type QueuedOperationType, R2_DEFAULT_TTL_MS, RECALL_MAX_LIMIT, RECALL_TOOL_NAME, type RankableVaultMemory, type RankedMemory, type RankedProfileCandidate, type RecallContext, type RecallDegradation, type RecallDiagnostics, type RecallEmptyReason, type RecallOptions, type RecallResult, type RecallToolCallbacks, type RecallToolOptions, type RecencyOptions, type RectProps, type ReflectOptions, type ReflectResult, type RequestEncryptionKeyOptions, RerankerUnavailableError, type ResumeStreamOptions, type ResumeStreamResult, type RetainAction, type RetainContext, type RetainOptions, type RetainResult, type RetainSource, SDK_SCHEMA_VERSION, SERVER_TOOL_DEPENDENCY_SETS, SHORT_TTL_MS, SLIDER_CONFIG, SLIDES_FILE_PATH, SLIDE_CANVAS_HEIGHT, SLIDE_CANVAS_WIDTH, STREAM_RESUMABLE_HEADER, SavedTool as SavedToolModel, type SavedToolOperationsContext, type SavedToolParameter, type ScoreBreakdown, type ScoreProfileSalienceOptions, type ScreenProps, type ScreenResult, type ScreenedCandidate, type SearchMessagesOptions, type SearchSource, type SelectServerToolsForPromptOptions, type SendMessageWithStorageArgs, type SendMessageWithStorageResult, type ServerTool, type ServerToolsFilter, type ServerToolsFilterFn, type ServerToolsFilterFunction, type ServerToolsOptions, type ServerToolsResponse, type SignMessageFn, type SignMessageOptions, type SlideProps, type StepFinishEvent, type StockPriceClassification, type StockPricePreProcessorOptions, type StorageOperationsContext, type StoredAppFile, type ChatCompletionUsage as StoredChatCompletionUsage, type StoredConversation, type StoredConversationMemory, type StoredEntity, type StoredFileWithContext, type StoredMedia, Media as StoredMediaModel, type StoredMessage, type StoredMessageWithSimilarity, type StoredModelPreference, ModelPreference as StoredModelPreferenceModel, type StoredProject, type StoredSavedTool, type StoredTopic, type StoredUserPreference, UserPreference as StoredUserPreferenceModel, type StoredVaultFolder, VaultFolder as StoredVaultFolderModel, type StoredVaultMemory, VaultMemory as StoredVaultMemoryModel, StreamExpiredError, type StreamMetaEvent, type StreamResumeHandle, type StreamSmoothingConfig, type SynthesizeProfileOptions, THEME_ATTRS, TOOL_RESULT_ORIGIN, TOPICS_EXTRACTION_VERSION, TOPIC_EXTRACTION_BATCH_SIZE, TREND_RECENT_WINDOW_DAYS, TREND_STALE_WINDOW_DAYS, type TextChunk, TextProcessor, type TextProps, type ThemeAttr, type ToolCallArgumentsDeltaEvent, type ToolMatchOptions, type ToolMatchResult, type ToolSet, type TopicExtractOptions, type TopicExtractionInput, type TopicExtractionRunResult, type TopicSkipReason, type TopicSource, type TranscriptionResult, type TurnCompleteEvent, type TurnSkippedEvent, type UIInteractionContextValue, UIInteractionProvider, type UIInteractionProviderProps, type UncheckedReason, type UnverifiableReason, type UpdateMediaOptions, type UpdateModelPreferenceOptions, type UpdateProjectOptions, type UpdateSavedToolOptions, type UpdateUserPreferenceOptions, type UpdateVaultFolderOptions, type UpdateVaultMemoryOptions, type UseBackupOptions, type UseBackupResult, type UseChatStorageOptions, type UseChatStorageResult, type UseCreditsOptions, type UseCreditsResult, type UseDropboxBackupOptions, type UseDropboxBackupResult, type UseEncryptionResult, type UseExportPdfResult, type UseFilesOptions, type UseFilesResult, type UseGoogleDriveBackupOptions, type UseGoogleDriveBackupResult, type UseICloudBackupOptions, type UseICloudBackupResult, type UseModelsResult, type UseOCRResult, type UsePdfResult, type UsePhoneCallsOptions, type UsePhoneCallsResult, type UseProjectsOptions, type UseProjectsResult, type UseSettingsOptions, type UseSettingsResult, type UseSubscriptionOptions, type UseSubscriptionResult, type UseToolsOptions, type UseToolsResult, type UseVoiceOptions, type UseVoiceResult, type UseWalletBindingOptions, type UseWalletBindingResult, VAULT_SIZE_HOP_CAP, type VaultCandidateKey, type VaultEmbeddingCache, type VaultEmbeddingExpectation, type VaultFolderOperationsContext, type VaultMemoryOperationsContext, type VaultMemoryVisibility, type VaultMemoryWriter, type VaultSaveOperation, type VaultSearchResult, type VaultWriteAction, type VaultWriteInput, type VaultWriteOutcome, type VerificationSources, type VerifyMemoriesForPublishOptions, type VoiceRecording, WalletPoller, WatermelonChatStorageAdapter, type WatermelonChatStorageAdapterOptions, type WeatherClassification, type WeatherPreProcessorOptions, type WebSearchClassification, type WebSearchPreProcessorOptions, type WhisperModel, WordProcessor, ZipProcessor, type ZipProcessorOptions, addConversationMemoriesOp, appFileToStored, archiveVaultMemoryOp, assembleMemoryContext, attachFileContextToLastUserMessage, backfillMemoryEntityUserIdsOp, backfillMemoryTopicsOp, buildAttachedFilesText, capHopsForDensity, chatStorageMigrations, chatStorageSchema, chunkAndEmbedAllMessages, chunkAndEmbedMessage, chunkText, classifyCryptoPrice, classifyCryptoPriceBatch, classifyDecay, classifyInjectionCandidates, classifyObservationTrend, classifyStockPrice, classifyStockPriceBatch, classifyWeather, classifyWeatherBatch, classifyWebSearch, classifyWebSearchBatch, clearAllEncryptionKeys, clearAllEncryptionState, clearAllKeyPairs, clearCalendarToken, clearConversationMemoriesOp, clearDriveToken, clearToken as clearDropboxToken, clearEncryptionKey, clearGithubToken, clearGoogleDriveToken, clearICloudAuth, clearKeyPair, clearLazyTitleCache, clearMemoryTopicsOverrideOp, clearNotionToken, clearServerToolsCache, consoleLogger, conversationMemoryToStored, cosineInt8, createAutoExtractor, createChunkVectorCache, createCryptoPricePreProcessor, createDecaySweeper, createDurableAutoExtractor, createGitHubTools, createLlmDecayClassifier, createLlmNeighborRefiner, createMediaBatchOp, createMediaOp, createMemoryEngineTool, createMemoryVaultSearchTool, createMemoryVaultTool, createMessageSourceResolver, createPlatformCursorStore, createProjectOp, createRecallTool, createSavedToolOp, createServerToolsFilter, createStockPricePreProcessor, createVaultEmbeddingCache, createVaultFolderOp, createVaultMemoriesBatchOp, createVaultMemoryOp, createWeatherPreProcessor, createWebSearchPreProcessor, decodeChunkVector, decryptConversationTitle, decryptData, decryptDataBatch, decryptDataBytes, decryptDataBytesFromBytes, decryptDataWithKey, defaultServerToolsFilter, deleteAllAppFilesOp, deleteAllVaultMemoriesForUserOp, deleteAppFileOp, deleteEncryptedFile, deleteMediaByConversationOp, deleteMediaByMessageOp, deleteMediaOp, deleteMessageOp, deleteProjectOp, deleteSavedToolOp, deleteVaultFolderOp, deleteVaultMemoryOp, dequantizeEmbedding, deriveKeyFromSignatureBytes, eagerEmbedContent, embedAllMessages, embedMessage, encodeChunkVector, encryptData, encryptDataBatch, encryptDataBytes, encryptDataWithKey, ensureDefaultFoldersOp, expandToolSetsAdditive, exportElementToPdf, exportMarkdownToPdf, exportPublicKey, extractAndLinkEntitiesForMemoriesOp, extractAndRetain, extractEntitiesForMemories, extractFacts, extractFileIds, fileExists, findById, findMatchingTools, findParentOfId, formatFileProcessingNotes, generateConversationId, generateEmbedding, generateEmbeddings, generateMediaId, generateProjectId, getAIGeneratedMediaOp, getAllSavedToolsOp, getAllVaultFoldersOp, getAllVaultMemoriesOp, getAllVaultMemoryContentsOp, getAndClearCalendarPendingMessage, getAndClearCalendarReturnUrl, getAndClearDrivePendingMessage, getAndClearDriveReturnUrl, getAndClearGithubPendingMessage, getAndClearGithubReturnUrl, getAndClearNotionPendingMessage, getAndClearNotionReturnUrl, getAppFileMapOp, getAppFileOp, getAppFilesOp, getAudioOp, getCachedServerTools, getCalendarAccessToken, getConversationMemoriesOp, getConversationsByProjectLazyOp, getConversationsByProjectOp, getConversationsLazyOp, getConversationsPageOp, getDecayCandidatesRawOp, getDocumentsOp, getDriveAccessToken, getEncryptionKey, getEntitiesByMemoryIdsOp, getGithubAccessToken, getGoogleDriveStoredToken, getId, getImagesOp, getLogger, getMediaByConversationOp, getMediaByIdOp, getMediaByIdsOp, getMediaByMessageOp, getMediaByModelOp, getMediaByRoleOp, getMediaBySourceUrlOp, getMediaByTypeOp, getMediaCountOp, getMediaCountsByTypeOp, getMediaOp, getMediaTypeFromMime, getMemoriesByEntityNamesOp, getMemoriesNeedingTopicExtractionOp, getNotionAccessToken, getNotionMCPUrl, getNumberAttr, getProjectConversationCountOp, getProjectConversationsOp, getProjectOp, getProjectsOp, getRecentMediaOp, getSavedToolByIdOp, getServerTools, getStringAttr, getSupportedFileTypes, getToolsChecksum, getUnfiledVaultMemoriesOp, getUserUploadedMediaOp, getValidCalendarToken, getValidDriveToken, getValidGithubToken, getValidNotionToken, getVaultCandidateKeysOp, getVaultEmbeddingsByIdsOp, getVaultFolderMemoryCountOp, getVaultMemoriesByIdsOp, getVaultMemoryOp, getVaultRankingProjectionsOp, getVideosOp, handleCalendarCallback, handleDriveCallback, handleGithubCallback, handleNotionCallback, hardDeleteDecayedOp, hardDeleteMediaOp, hasCalendarCredentials, hasDriveCredentials, hasDropboxCredentials, hasEncryptionKey, hasGithubCredentials, hasGoogleDriveCredentials, hasICloudCredentials, hasKeyPair, hasNotionCredentials, ingestPublishedPhotoMemoriesOp, injectionSignatureCatalog, insertAfterId, insertChild, isAnumaTag, isAttachedFilesText, isCalendarCallback, isDegradedTopicSkip, isDriveCallback, isEncrypted, isGithubCallback, isHtmlTag, isNotionCallback, isOPFSSupported, isR2UrlExpired, isRerankerAvailable, isSupportedFile, isSupportedMediaType, linkMemoryEntitiesOp, maskScopedEmbeddingCache, mediaToStored, migrateCalendarToken, migrateDisplayResult, migrateDriveToken, migrateGithubToken, migrateNotionClientRegistration, migrateNotionToken, moveMemoriesToFolderOp, noopLogger, onKeyAvailable, parseJsx, parseMedia, preEmbedVaultMemories, preprocessFiles, previewToolSelection, projectToStored, putAppFileOp, quantizeEmbedding, queueManager, rankProfileCandidates, readEncryptedFile, recall, reflect, refreshCalendarToken, refreshDriveToken, refreshEncryptionKeyIfMatches, refreshGithubToken, refreshNotionToken, relinkMemoryTopicsOp, relinkMisclassifiedVideosOp, removeById, renderAnumaJsx, renderAnumaTree, renderElementToCanvas, replaceById, replaceMemoryEntitiesGuardedOp, requestEncryptionKey, requestKeyPair, resolveFilePlaceholders, resolveThemeColor, restoreVaultMemoryOp, resumeStream, retain, revokeCalendarToken, revokeDriveToken, revokeGithubToken, revokeNotionAccess, savedToolToStored, scoreProfileSalience, screenCandidatesForInjection, sdkMigrations, sdkModelClasses, sdkSchema, searchChunksOp, searchMediaOp, searchMessagesOp, searchVaultMemories, seedEncryptionKeys, selectServerToolsForPrompt, serializeJsx, setLogger, setMemoryEntitiesOp, setMemoryVisibilityOp, settingsStorageSchema, shouldChunkMessage, shouldRecallMemory, shouldRefreshTools, stampTopicsExtractedAtOp, startGithubAuth, startNotionAuth, storeCalendarPendingMessage, storeCalendarReturnUrl, storeCalendarToken, storeDrivePendingMessage, storeDriveReturnUrl, storeDriveToken, storeGithubPendingMessage, storeGithubReturnUrl, storeGithubToken, storeNotionPendingMessage, storeNotionReturnUrl, streamCancelPath, streamReplayPath, stripLegacyChunkTextOp, summarizeObservationTrends, supersedeVaultMemoryOp, synthesizeProfile, traverseGraphLane, ttlForType, updateAttrs, updateConversationProjectOp, updateMediaMessageIdBatchOp, updateMediaOp, updateMessageFeedbackOp, updateProjectNameOp, updateProjectOp, updateSavedToolOp, updateVaultFolderContextOp, updateVaultFolderOp, updateVaultMemoryEmbeddingOp, updateVaultMemoryOp, useAnumaTheme, useBackup, useBackupAuth, useChat, useChatStorage, useCredits, useDatabaseManager, useDropboxAuth, useDropboxBackup, useEncryption, useExportPdf, useFiles, useGoogleDriveAuth, useGoogleDriveBackup, useICloudAuth, useICloudBackup, useModels, useOCR, usePdf, usePhoneCalls, useProjects, useSettings, useSubscription, useTools, useUIInteraction, useVoice, useWalletBinding, userPreferencesStorageSchema, verifyMemoriesForPublish, walk, webPlatformStorage, withActiveToolSetServerTools, withInternalFlowMarker, writeEncryptedFile };
|
|
16746
|
+
export { Anuma, type AnumaChild, AnumaJsxError, type AnumaNode, AnumaShadowIsolationProvider, type AnumaShadowIsolationProviderProps, type AnumaTheme, AnumaThemeProvider, type AnumaThemeProviderProps, AppFile as AppFileModel, type AppFileOperationsContext, type AttrValue, type AutoExtractMessage, type AutoExtractor, DEFAULT_CONVERSATIONS_FOLDER as BACKUP_DRIVE_CONVERSATIONS_FOLDER, DEFAULT_ROOT_FOLDER as BACKUP_DRIVE_ROOT_FOLDER, DEFAULT_BACKUP_FOLDER as BACKUP_ICLOUD_FOLDER, BUILT_IN_TOOL_SETS, type BackupAuthContextValue, BackupAuthProvider, type BackupAuthProviderProps, type BackupOperationOptions, BlobUrlManager, type Budget, CHUNKS_DISCARDED_ORIGIN, type CachedChunkVectors, type CachedServerTools, ChartCard, type ChartCardProps, type ChartConfig, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, Conversation as ChatConversation, Message as ChatMessage, type ChatRole, type ChatStorageAdapter, type ChatStorageObservable, type ChunkSearchResult, type ChunkVectorCache, type ChunkingOptions, type CircleProps, type ClientToolsFilterFn, type ConsolidationAction, type ConsolidationFallbackReason, type ConversationMemoryInput, ConversationMemory as ConversationMemoryModel, type ConversationMemoryOperationsContext, type ConversationQueryOptions, type CreateAutoExtractorOptions, type CreateConversationOptions, type CreateDecaySweeperOptions, type CreateEntityOptions, type CreateMediaOptions, type CreateMessageOptions, type CreateModelPreferenceOptions, type CreateProjectOptions, type CreateSavedToolOptions, type CreateServerToolsFilterOptions, type CreateUserPreferenceOptions, type CreateVaultFolderOptions, type CreateVaultMemoryOptions, type CryptoPriceClassification, type CryptoPricePreProcessorOptions, DEFAULT_BACKUP_FOLDER$1 as DEFAULT_BACKUP_FOLDER, DEFAULT_CACHE_EXPIRATION_MS, DEFAULT_CHUNK_CACHE_SIZE, DEFAULT_CHUNK_OVERLAP, DEFAULT_CHUNK_SIZE, DEFAULT_DECAY_POLICY, DEFAULT_CONVERSATIONS_FOLDER as DEFAULT_DRIVE_CONVERSATIONS_FOLDER, DEFAULT_ROOT_FOLDER as DEFAULT_DRIVE_ROOT_FOLDER, DEFAULT_BACKUP_FOLDER$1 as DEFAULT_DROPBOX_FOLDER, DEFAULT_EXCLUDED_SERVER_TOOLS, DEFAULT_BACKUP_FOLDER as DEFAULT_ICLOUD_BACKUP_FOLDER, DEFAULT_MAX_CLASSIFIER_CALLS_PER_SWEEP, DEFAULT_MIN_CHUNK_SIZE, DEFAULT_PERSONALITY_SETTINGS, DEFAULT_PROFILE_FACETS, DEFAULT_PROFILE_FACT_TYPE_WEIGHTS, DEFAULT_PROFILE_PROOF_ALPHA, DEFAULT_PROFILE_TREND_MULTIPLIERS, DEFAULT_SERVER_TOOLS_MATCH_OPTIONS, DEFAULT_VAULT_CACHE_SIZE, DatabaseManager, type DatabaseManagerLogger, type DatabaseManagerOptions, type DecayCandidateRaw, type DecayClassifier, type DecayInput, type DecayPolicy, type DecaySweepResult, type DecaySweeper, type DecayVerdict, type DeckProps, type DisplayToolMigrations, type DropboxAuthContextValue, DropboxAuthProvider, type DropboxAuthProviderProps, type DropboxExportResult, type DropboxImportResult, type DurableAutoExtractorOptions, ENTITY_FANOUT, ENTITY_KINDS, type EmbeddedWalletSignerFn, EncryptionKeyMissingError, type EncryptionKeyVersion, type EntityInput, type EntityKind, Entity as EntityModel, type EntityOperationsContext, ExcelProcessor, type ExtractFactsOptions, type ExtractOutcome, type ExtractedCandidate, type ExtractedEntity, type ExtractionCursorStore, type ExtractionFunnel, type ExtractionTimings, FILE_PLACEHOLDER_PREFIX, FILE_PLACEHOLDER_REGEX, type FactType, type FileMetadata, type FileProcessingReason, type FileProcessingStatus, type FileProcessor, type FileTypeQuery, type FileWithData, type FlushResult, type GetConversationsPageOptions, type GetMessagesPageOptions, type GoogleDriveAuthContextValue, GoogleDriveAuthProvider, type GoogleDriveAuthProviderProps, type GoogleDriveExportResult, type GoogleDriveImportResult, type GraphTraversalOptions, type GroupProps, HARD_DELETE_WINDOW_MS, type ICloudAuthContextValue, ICloudAuthProvider, type ICloudAuthProviderProps, type ICloudExportResult, type ICloudImportResult, INFERENCE_ID_HEADER, INTERNAL_FLOW_MARKER, type IconProps, type ImageProps, type InjectionClassifierOptions, type InjectionReason, type InteractionType, type KnownTag, type LazyStoredConversation, type LineProps, type LlmDecayClassifierOptions, type LlmNeighborRefinerOptions, type Logger, LoggerProvider, type LoggerProviderProps, MAX_HOPS, MEDIUM_TTL_MS, type ManualFactType, type MediaDimensions, type MediaFilterOptions, type MediaMetadata, type MediaOperationsContext, type MediaRole, type MediaType, type MemoriesNeedingTopicExtraction, type MemoryContextItem, type MemoryContextLane, type MemoryContextOptions, type MemoryContextResult, type EmbeddingOptions as MemoryEngineEmbeddingOptions, type MemoryEngineResult, type MemoryEngineSearchOptions, MemoryEntity as MemoryEntityModel, type MemoryExtractedEvent, type MemoryKind, type MemoryQuarantinedEvent, type MemoryToVerify, type MemoryVaultSearchOptions, type MemoryVaultToolOptions, type MemoryVerification, type MessageChunk, type MessageFeedback, type MessageOrigin, type MessageSkeleton, type ModelLoadProgress, NEVER_TTL_MS, NODE_BUDGET, type NeighborRefiner, type NowSource, type OCRFile, type ObservationTrend, type ObservationTrendInput, type OperationExecutor, PAST_EVENT_GRACE_MS, PROFILE_DOC_VERSION, type ParsedServerToolsResponse, type PdfExportOptions, type PdfExportProgress, type PdfExportStage, type PdfFile, PdfProcessor, type PendingInteraction, type PersonalitySettings, type PersonalitySliders, type PersonalityStyle, type PhoneCallPollingOptions, type PhotoIngestResult, type PhotoMediaRef, type PlatformStorage, type PortalLlmAuth, type PortalLlmFailure, type PortalLlmFailureReason, type PreprocessingOptions, type PreprocessingResult, type ProcessedFileResult, ProcessorRegistry, type ProfileConfigFingerprint, type ProfileDoc, type ProfileFacet, type ProfileFacetKey, type ProfileSalienceInput, type ProfileSection, type ProfileUpdate, type ProgressCallback, Project, type ProjectOperationsContext, type PromptPreProcessor, type PromptPreProcessorContext, type ProviderAuthState, type ProviderBackupState, ProviderStreamError, type PublishedPhotoMemory, type QuantizedEmbedding, type QuarantinedMemoryInfo, type QueueEncryptionContext, QueueManager, type QueueStatus, type QueuedOperation, type QueuedOperationType, R2_DEFAULT_TTL_MS, RECALL_MAX_LIMIT, RECALL_TOOL_NAME, type RankableVaultMemory, type RankedMemory, type RankedProfileCandidate, type RecallContext, type RecallDegradation, type RecallDiagnostics, type RecallEmptyReason, type RecallOptions, type RecallResult, type RecallToolCallbacks, type RecallToolOptions, type RecencyOptions, type RectProps, type ReflectOptions, type ReflectResult, type RequestEncryptionKeyOptions, RerankerUnavailableError, type ResumeStreamOptions, type ResumeStreamResult, type RetainAction, type RetainContext, type RetainOptions, type RetainResult, type RetainSource, SDK_SCHEMA_VERSION, SERVER_TOOL_DEPENDENCY_SETS, SHORT_TTL_MS, SLIDER_CONFIG, SLIDES_FILE_PATH, SLIDE_CANVAS_HEIGHT, SLIDE_CANVAS_WIDTH, STREAM_RESUMABLE_HEADER, SavedTool as SavedToolModel, type SavedToolOperationsContext, type SavedToolParameter, type ScoreBreakdown, type ScoreProfileSalienceOptions, type ScreenProps, type ScreenResult, type ScreenedCandidate, type SearchMessagesOptions, type SearchSource, type SelectServerToolsForPromptOptions, type SendMessageWithStorageArgs, type SendMessageWithStorageResult, type ServerTool, type ServerToolsFilter, type ServerToolsFilterFn, type ServerToolsFilterFunction, type ServerToolsOptions, type ServerToolsResponse, type SignMessageFn, type SignMessageOptions, type SlideProps, type StepFinishEvent, type StockPriceClassification, type StockPricePreProcessorOptions, type StorageOperationsContext, type StoredAppFile, type ChatCompletionUsage as StoredChatCompletionUsage, type StoredConversation, type StoredConversationMemory, type StoredEntity, type StoredFileWithContext, type StoredMedia, Media as StoredMediaModel, type StoredMessage, type StoredMessageWithSimilarity, type StoredModelPreference, ModelPreference as StoredModelPreferenceModel, type StoredProject, type StoredSavedTool, type StoredTopic, type StoredUserPreference, UserPreference as StoredUserPreferenceModel, type StoredVaultFolder, VaultFolder as StoredVaultFolderModel, type StoredVaultMemory, VaultMemory as StoredVaultMemoryModel, StreamExpiredError, type StreamMetaEvent, type StreamResumeHandle, type StreamSmoothingConfig, type SynthesizeProfileOptions, THEME_ATTRS, TOOL_RESULT_ORIGIN, TOPICS_EXTRACTION_VERSION, TOPIC_EXTRACTION_BATCH_SIZE, TREND_RECENT_WINDOW_DAYS, TREND_STALE_WINDOW_DAYS, type TextChunk, TextProcessor, type TextProps, type ThemeAttr, type ToolCallArgumentsDeltaEvent, type ToolMatchOptions, type ToolMatchResult, type ToolSet, type TopicExtractOptions, type TopicExtractionInput, type TopicExtractionRunResult, type TopicSkipReason, type TopicSource, type TranscriptionResult, type TurnCompleteEvent, type TurnSkippedEvent, type UIInteractionContextValue, UIInteractionProvider, type UIInteractionProviderProps, type UncheckedReason, type UnverifiableReason, type UpdateMediaOptions, type UpdateModelPreferenceOptions, type UpdateProjectOptions, type UpdateSavedToolOptions, type UpdateUserPreferenceOptions, type UpdateVaultFolderOptions, type UpdateVaultMemoryOptions, type UseBackupOptions, type UseBackupResult, type UseChatStorageOptions, type UseChatStorageResult, type UseCreditsOptions, type UseCreditsResult, type UseDropboxBackupOptions, type UseDropboxBackupResult, type UseEncryptionResult, type UseExportPdfResult, type UseFilesOptions, type UseFilesResult, type UseGoogleDriveBackupOptions, type UseGoogleDriveBackupResult, type UseICloudBackupOptions, type UseICloudBackupResult, type UseModelsResult, type UseOCRResult, type UsePdfResult, type UsePhoneCallsOptions, type UsePhoneCallsResult, type UseProjectsOptions, type UseProjectsResult, type UseSettingsOptions, type UseSettingsResult, type UseSubscriptionOptions, type UseSubscriptionResult, type UseToolsOptions, type UseToolsResult, type UseVoiceOptions, type UseVoiceResult, type UseWalletBindingOptions, type UseWalletBindingResult, VAULT_SIZE_HOP_CAP, type VaultCandidateKey, type VaultEmbeddingCache, type VaultEmbeddingExpectation, type VaultFolderOperationsContext, type VaultMemoryOperationsContext, type VaultMemoryVisibility, type VaultMemoryWriter, type VaultSaveOperation, type VaultSearchResult, type VaultWriteAction, type VaultWriteInput, type VaultWriteOutcome, type VerificationSources, type VerifyMemoriesForPublishOptions, type VoiceRecording, WalletPoller, WatermelonChatStorageAdapter, type WatermelonChatStorageAdapterOptions, type WeatherClassification, type WeatherPreProcessorOptions, type WebSearchClassification, type WebSearchPreProcessorOptions, type WhisperModel, WordProcessor, ZipProcessor, type ZipProcessorOptions, addConversationMemoriesOp, appFileToStored, archiveVaultMemoryOp, assembleMemoryContext, attachFileContextToLastUserMessage, backfillMemoryEntityUserIdsOp, backfillMemoryTopicsOp, buildAttachedFilesText, capHopsForDensity, chatStorageMigrations, chatStorageSchema, chunkAndEmbedAllMessages, chunkAndEmbedMessage, chunkText, classifyCryptoPrice, classifyCryptoPriceBatch, classifyDecay, classifyInjectionCandidates, classifyObservationTrend, classifyStockPrice, classifyStockPriceBatch, classifyWeather, classifyWeatherBatch, classifyWebSearch, classifyWebSearchBatch, clearAllEncryptionKeys, clearAllEncryptionState, clearAllKeyPairs, clearCalendarToken, clearConversationMemoriesOp, clearDriveToken, clearToken as clearDropboxToken, clearEncryptionKey, clearGithubToken, clearGoogleDriveToken, clearICloudAuth, clearKeyPair, clearLazyTitleCache, clearMemoryTopicsOverrideOp, clearNotionToken, clearServerToolsCache, consoleLogger, conversationMemoryToStored, cosineInt8, createAutoExtractor, createChunkVectorCache, createCryptoPricePreProcessor, createDecaySweeper, createDurableAutoExtractor, createGitHubTools, createLlmDecayClassifier, createLlmNeighborRefiner, createMediaBatchOp, createMediaOp, createMemoryEngineTool, createMemoryVaultSearchTool, createMemoryVaultTool, createMessageSourceResolver, createPlatformCursorStore, createProjectOp, createRecallTool, createSavedToolOp, createServerToolsFilter, createStockPricePreProcessor, createVaultEmbeddingCache, createVaultFolderOp, createVaultMemoriesBatchOp, createVaultMemoryOp, createWeatherPreProcessor, createWebSearchPreProcessor, decodeChunkVector, decryptConversationTitle, decryptData, decryptDataBatch, decryptDataBytes, decryptDataBytesFromBytes, decryptDataWithKey, defaultServerToolsFilter, deleteAllAppFilesOp, deleteAllVaultMemoriesForUserOp, deleteAppFileOp, deleteEncryptedFile, deleteMediaByConversationOp, deleteMediaByMessageOp, deleteMediaOp, deleteMessageOp, deleteProjectOp, deleteSavedToolOp, deleteVaultFolderOp, deleteVaultMemoryOp, dequantizeEmbedding, deriveKeyFromSignatureBytes, eagerEmbedContent, embedAllMessages, embedMessage, encodeChunkVector, encryptData, encryptDataBatch, encryptDataBytes, encryptDataWithKey, ensureDefaultFoldersOp, expandToolSetsAdditive, exportElementToPdf, exportMarkdownToPdf, exportPublicKey, extractAndLinkEntitiesForMemoriesOp, extractAndRetain, extractEntitiesForMemories, extractFacts, extractFileIds, extractMCPImageUrls, fileExists, findById, findMatchingTools, findParentOfId, formatFileProcessingNotes, generateConversationId, generateEmbedding, generateEmbeddings, generateMediaId, generateProjectId, getAIGeneratedMediaOp, getAllSavedToolsOp, getAllVaultFoldersOp, getAllVaultMemoriesOp, getAllVaultMemoryContentsOp, getAndClearCalendarPendingMessage, getAndClearCalendarReturnUrl, getAndClearDrivePendingMessage, getAndClearDriveReturnUrl, getAndClearGithubPendingMessage, getAndClearGithubReturnUrl, getAndClearNotionPendingMessage, getAndClearNotionReturnUrl, getAppFileMapOp, getAppFileOp, getAppFilesOp, getAudioOp, getCachedServerTools, getCalendarAccessToken, getConversationMemoriesOp, getConversationsByProjectLazyOp, getConversationsByProjectOp, getConversationsLazyOp, getConversationsPageOp, getDecayCandidatesRawOp, getDocumentsOp, getDriveAccessToken, getEncryptionKey, getEntitiesByMemoryIdsOp, getGithubAccessToken, getGoogleDriveStoredToken, getId, getImagesOp, getLogger, getMediaByConversationOp, getMediaByIdOp, getMediaByIdsOp, getMediaByMessageOp, getMediaByModelOp, getMediaByRoleOp, getMediaBySourceUrlOp, getMediaByTypeOp, getMediaCountOp, getMediaCountsByTypeOp, getMediaOp, getMediaTypeFromMime, getMemoriesByEntityNamesOp, getMemoriesNeedingTopicExtractionOp, getNotionAccessToken, getNotionMCPUrl, getNumberAttr, getProjectConversationCountOp, getProjectConversationsOp, getProjectOp, getProjectsOp, getRecentMediaOp, getSavedToolByIdOp, getServerTools, getStringAttr, getSupportedFileTypes, getToolsChecksum, getUnfiledVaultMemoriesOp, getUserUploadedMediaOp, getValidCalendarToken, getValidDriveToken, getValidGithubToken, getValidNotionToken, getVaultCandidateKeysOp, getVaultEmbeddingsByIdsOp, getVaultFolderMemoryCountOp, getVaultMemoriesByIdsOp, getVaultMemoryOp, getVaultRankingProjectionsOp, getVideosOp, handleCalendarCallback, handleDriveCallback, handleGithubCallback, handleNotionCallback, hardDeleteDecayedOp, hardDeleteMediaOp, hasCalendarCredentials, hasDriveCredentials, hasDropboxCredentials, hasEncryptionKey, hasGithubCredentials, hasGoogleDriveCredentials, hasICloudCredentials, hasKeyPair, hasNotionCredentials, ingestPublishedPhotoMemoriesOp, injectionSignatureCatalog, insertAfterId, insertChild, isAnumaTag, isAttachedFilesText, isCalendarCallback, isDegradedTopicSkip, isDriveCallback, isEncrypted, isGithubCallback, isHtmlTag, isNotionCallback, isOPFSSupported, isR2UrlExpired, isRerankerAvailable, isSupportedFile, isSupportedMediaType, linkMemoryEntitiesOp, maskScopedEmbeddingCache, mediaToStored, migrateCalendarToken, migrateDisplayResult, migrateDriveToken, migrateGithubToken, migrateNotionClientRegistration, migrateNotionToken, moveMemoriesToFolderOp, noopLogger, onKeyAvailable, parseJsx, parseMedia, preEmbedVaultMemories, preprocessFiles, previewToolSelection, projectToStored, putAppFileOp, quantizeEmbedding, queueManager, rankProfileCandidates, readEncryptedFile, recall, reflect, refreshCalendarToken, refreshDriveToken, refreshEncryptionKeyIfMatches, refreshGithubToken, refreshNotionToken, relinkMemoryTopicsOp, relinkMisclassifiedVideosOp, removeById, renderAnumaJsx, renderAnumaTree, renderElementToCanvas, replaceById, replaceMemoryEntitiesGuardedOp, requestEncryptionKey, requestKeyPair, resolveFilePlaceholders, resolveThemeColor, restoreVaultMemoryOp, resumeStream, retain, revokeCalendarToken, revokeDriveToken, revokeGithubToken, revokeNotionAccess, savedToolToStored, scoreProfileSalience, screenCandidatesForInjection, sdkMigrations, sdkModelClasses, sdkSchema, searchChunksOp, searchMediaOp, searchMessagesOp, searchVaultMemories, seedEncryptionKeys, selectServerToolsForPrompt, serializeJsx, setLogger, setMemoryEntitiesOp, setMemoryVisibilityOp, settingsStorageSchema, shouldChunkMessage, shouldRecallMemory, shouldRefreshTools, stampTopicsExtractedAtOp, startGithubAuth, startNotionAuth, storeCalendarPendingMessage, storeCalendarReturnUrl, storeCalendarToken, storeDrivePendingMessage, storeDriveReturnUrl, storeDriveToken, storeGithubPendingMessage, storeGithubReturnUrl, storeGithubToken, storeNotionPendingMessage, storeNotionReturnUrl, streamCancelPath, streamReplayPath, stripLegacyChunkTextOp, summarizeObservationTrends, supersedeVaultMemoryOp, synthesizeProfile, traverseGraphLane, ttlForType, updateAttrs, updateConversationProjectOp, updateMediaMessageIdBatchOp, updateMediaOp, updateMessageFeedbackOp, updateProjectNameOp, updateProjectOp, updateSavedToolOp, updateVaultFolderContextOp, updateVaultFolderOp, updateVaultMemoryEmbeddingOp, updateVaultMemoryOp, useAnumaTheme, useBackup, useBackupAuth, useChat, useChatStorage, useCredits, useDatabaseManager, useDropboxAuth, useDropboxBackup, useEncryption, useExportPdf, useFiles, useGoogleDriveAuth, useGoogleDriveBackup, useICloudAuth, useICloudBackup, useModels, useOCR, usePdf, usePhoneCalls, useProjects, useSettings, useSubscription, useTools, useUIInteraction, useVoice, useWalletBinding, userPreferencesStorageSchema, verifyMemoriesForPublish, walk, webPlatformStorage, withActiveToolSetServerTools, withInternalFlowMarker, writeEncryptedFile };
|
package/dist/react/index.d.ts
CHANGED
|
@@ -2721,6 +2721,13 @@ type SendMessageResult = {
|
|
|
2721
2721
|
* @inline
|
|
2722
2722
|
*/
|
|
2723
2723
|
interface UseChatOptions extends BaseUseChatOptions {
|
|
2724
|
+
/** Buffer streamed rounds so a service can verify their canonical output. */
|
|
2725
|
+
resumable?: boolean;
|
|
2726
|
+
/** Inference identifier for each HTTP round, including client-tool continuations. */
|
|
2727
|
+
onStreamMeta?: (meta: {
|
|
2728
|
+
inferenceId: string;
|
|
2729
|
+
round: number;
|
|
2730
|
+
}) => void;
|
|
2724
2731
|
/**
|
|
2725
2732
|
* Which API endpoint to use. Default: "auto"
|
|
2726
2733
|
* - "auto": automatically selects the best API based on model support
|
|
@@ -11819,6 +11826,13 @@ declare function previewToolSelection(options: {
|
|
|
11819
11826
|
* @inline
|
|
11820
11827
|
*/
|
|
11821
11828
|
interface UseChatStorageOptions extends BaseUseChatStorageOptions {
|
|
11829
|
+
/** Opt into the portal stream buffer for every generated round. */
|
|
11830
|
+
resumable?: boolean;
|
|
11831
|
+
/** Inference identifier for each HTTP round, including client-tool continuations. */
|
|
11832
|
+
onStreamMeta?: (meta: {
|
|
11833
|
+
inferenceId: string;
|
|
11834
|
+
round: number;
|
|
11835
|
+
}) => void;
|
|
11822
11836
|
/**
|
|
11823
11837
|
* Which API endpoint to use. Default: "responses"
|
|
11824
11838
|
* - "responses": OpenAI Responses API (supports thinking, reasoning, conversations)
|
|
@@ -11979,6 +11993,11 @@ type SendMessageWithStorageResult = {
|
|
|
11979
11993
|
error: null;
|
|
11980
11994
|
userMessage?: undefined;
|
|
11981
11995
|
assistantMessage?: undefined;
|
|
11996
|
+
/** Client-tool output remains available even when no private history is written. */
|
|
11997
|
+
autoExecutedToolResults?: {
|
|
11998
|
+
name: string;
|
|
11999
|
+
result: unknown;
|
|
12000
|
+
}[];
|
|
11982
12001
|
/** Indicates this was a skipStorage request - no messages were persisted */
|
|
11983
12002
|
skipped: true;
|
|
11984
12003
|
} | {
|
|
@@ -12313,6 +12332,43 @@ interface ChatStorageAdapter {
|
|
|
12313
12332
|
write<T>(fn: (adapter: ChatStorageAdapter) => Promise<T>): Promise<T>;
|
|
12314
12333
|
}
|
|
12315
12334
|
|
|
12335
|
+
/**
|
|
12336
|
+
* Pure functions for extracting MCP media URLs (images and videos).
|
|
12337
|
+
*
|
|
12338
|
+
* These are extracted from `useChatMedia.extractAndStoreEncryptedMCPImages`
|
|
12339
|
+
* so they can be tested in isolation without React hooks or OPFS dependencies.
|
|
12340
|
+
*/
|
|
12341
|
+
/** Minimal tool call event shape needed for URL extraction. */
|
|
12342
|
+
interface ToolCallEvent {
|
|
12343
|
+
name?: string;
|
|
12344
|
+
output?: string;
|
|
12345
|
+
}
|
|
12346
|
+
/** Media kind an extracted URL resolves to. */
|
|
12347
|
+
type ExtractedMediaKind = "image" | "video";
|
|
12348
|
+
/** Extracted media URL with its associated model and resolved kind. */
|
|
12349
|
+
interface ExtractedMediaUrl {
|
|
12350
|
+
url: string;
|
|
12351
|
+
model: string;
|
|
12352
|
+
/** "video" when the URL/tool is a video source, otherwise "image". */
|
|
12353
|
+
mediaType: ExtractedMediaKind;
|
|
12354
|
+
}
|
|
12355
|
+
/**
|
|
12356
|
+
* Extracts MCP media URLs from tool_call_events (primary) or content (fallback).
|
|
12357
|
+
*
|
|
12358
|
+
* Primary path: parses JSON output of image- and video-generation tool calls.
|
|
12359
|
+
* Fallback path: regex-matches MCP R2 domain URLs in content and classifies
|
|
12360
|
+
* each by file extension (so videos aren't mislabeled as images).
|
|
12361
|
+
*
|
|
12362
|
+
* The function name is retained for call-site stability; it now returns videos
|
|
12363
|
+
* too, each tagged with `mediaType`.
|
|
12364
|
+
*
|
|
12365
|
+
* @param content - The message content (may contain markdown/HTML media refs)
|
|
12366
|
+
* @param toolCallEvents - Tool call events from streaming accumulator
|
|
12367
|
+
* @param mcpR2Domain - The R2 domain to match
|
|
12368
|
+
* @returns Array of extracted URLs with model + mediaType info
|
|
12369
|
+
*/
|
|
12370
|
+
declare function extractMCPImageUrls(content: string, toolCallEvents: ToolCallEvent[] | undefined, mcpR2Domain: string): ExtractedMediaUrl[];
|
|
12371
|
+
|
|
12316
12372
|
/**
|
|
12317
12373
|
* OPFS (Origin Private File System) storage utilities with encryption support.
|
|
12318
12374
|
*
|
|
@@ -16687,4 +16743,4 @@ declare function renderAnumaTree(node: AnumaNode): React.ReactElement | null;
|
|
|
16687
16743
|
*/
|
|
16688
16744
|
declare function renderAnumaJsx(jsx: string): React.ReactElement | null;
|
|
16689
16745
|
|
|
16690
|
-
export { Anuma, type AnumaChild, AnumaJsxError, type AnumaNode, AnumaShadowIsolationProvider, type AnumaShadowIsolationProviderProps, type AnumaTheme, AnumaThemeProvider, type AnumaThemeProviderProps, AppFile as AppFileModel, type AppFileOperationsContext, type AttrValue, type AutoExtractMessage, type AutoExtractor, DEFAULT_CONVERSATIONS_FOLDER as BACKUP_DRIVE_CONVERSATIONS_FOLDER, DEFAULT_ROOT_FOLDER as BACKUP_DRIVE_ROOT_FOLDER, DEFAULT_BACKUP_FOLDER as BACKUP_ICLOUD_FOLDER, BUILT_IN_TOOL_SETS, type BackupAuthContextValue, BackupAuthProvider, type BackupAuthProviderProps, type BackupOperationOptions, BlobUrlManager, type Budget, CHUNKS_DISCARDED_ORIGIN, type CachedChunkVectors, type CachedServerTools, ChartCard, type ChartCardProps, type ChartConfig, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, Conversation as ChatConversation, Message as ChatMessage, type ChatRole, type ChatStorageAdapter, type ChatStorageObservable, type ChunkSearchResult, type ChunkVectorCache, type ChunkingOptions, type CircleProps, type ClientToolsFilterFn, type ConsolidationAction, type ConsolidationFallbackReason, type ConversationMemoryInput, ConversationMemory as ConversationMemoryModel, type ConversationMemoryOperationsContext, type ConversationQueryOptions, type CreateAutoExtractorOptions, type CreateConversationOptions, type CreateDecaySweeperOptions, type CreateEntityOptions, type CreateMediaOptions, type CreateMessageOptions, type CreateModelPreferenceOptions, type CreateProjectOptions, type CreateSavedToolOptions, type CreateServerToolsFilterOptions, type CreateUserPreferenceOptions, type CreateVaultFolderOptions, type CreateVaultMemoryOptions, type CryptoPriceClassification, type CryptoPricePreProcessorOptions, DEFAULT_BACKUP_FOLDER$1 as DEFAULT_BACKUP_FOLDER, DEFAULT_CACHE_EXPIRATION_MS, DEFAULT_CHUNK_CACHE_SIZE, DEFAULT_CHUNK_OVERLAP, DEFAULT_CHUNK_SIZE, DEFAULT_DECAY_POLICY, DEFAULT_CONVERSATIONS_FOLDER as DEFAULT_DRIVE_CONVERSATIONS_FOLDER, DEFAULT_ROOT_FOLDER as DEFAULT_DRIVE_ROOT_FOLDER, DEFAULT_BACKUP_FOLDER$1 as DEFAULT_DROPBOX_FOLDER, DEFAULT_EXCLUDED_SERVER_TOOLS, DEFAULT_BACKUP_FOLDER as DEFAULT_ICLOUD_BACKUP_FOLDER, DEFAULT_MAX_CLASSIFIER_CALLS_PER_SWEEP, DEFAULT_MIN_CHUNK_SIZE, DEFAULT_PERSONALITY_SETTINGS, DEFAULT_PROFILE_FACETS, DEFAULT_PROFILE_FACT_TYPE_WEIGHTS, DEFAULT_PROFILE_PROOF_ALPHA, DEFAULT_PROFILE_TREND_MULTIPLIERS, DEFAULT_SERVER_TOOLS_MATCH_OPTIONS, DEFAULT_VAULT_CACHE_SIZE, DatabaseManager, type DatabaseManagerLogger, type DatabaseManagerOptions, type DecayCandidateRaw, type DecayClassifier, type DecayInput, type DecayPolicy, type DecaySweepResult, type DecaySweeper, type DecayVerdict, type DeckProps, type DisplayToolMigrations, type DropboxAuthContextValue, DropboxAuthProvider, type DropboxAuthProviderProps, type DropboxExportResult, type DropboxImportResult, type DurableAutoExtractorOptions, ENTITY_FANOUT, ENTITY_KINDS, type EmbeddedWalletSignerFn, EncryptionKeyMissingError, type EncryptionKeyVersion, type EntityInput, type EntityKind, Entity as EntityModel, type EntityOperationsContext, ExcelProcessor, type ExtractFactsOptions, type ExtractOutcome, type ExtractedCandidate, type ExtractedEntity, type ExtractionCursorStore, type ExtractionFunnel, type ExtractionTimings, FILE_PLACEHOLDER_PREFIX, FILE_PLACEHOLDER_REGEX, type FactType, type FileMetadata, type FileProcessingReason, type FileProcessingStatus, type FileProcessor, type FileTypeQuery, type FileWithData, type FlushResult, type GetConversationsPageOptions, type GetMessagesPageOptions, type GoogleDriveAuthContextValue, GoogleDriveAuthProvider, type GoogleDriveAuthProviderProps, type GoogleDriveExportResult, type GoogleDriveImportResult, type GraphTraversalOptions, type GroupProps, HARD_DELETE_WINDOW_MS, type ICloudAuthContextValue, ICloudAuthProvider, type ICloudAuthProviderProps, type ICloudExportResult, type ICloudImportResult, INFERENCE_ID_HEADER, INTERNAL_FLOW_MARKER, type IconProps, type ImageProps, type InjectionClassifierOptions, type InjectionReason, type InteractionType, type KnownTag, type LazyStoredConversation, type LineProps, type LlmDecayClassifierOptions, type LlmNeighborRefinerOptions, type Logger, LoggerProvider, type LoggerProviderProps, MAX_HOPS, MEDIUM_TTL_MS, type ManualFactType, type MediaDimensions, type MediaFilterOptions, type MediaMetadata, type MediaOperationsContext, type MediaRole, type MediaType, type MemoriesNeedingTopicExtraction, type MemoryContextItem, type MemoryContextLane, type MemoryContextOptions, type MemoryContextResult, type EmbeddingOptions as MemoryEngineEmbeddingOptions, type MemoryEngineResult, type MemoryEngineSearchOptions, MemoryEntity as MemoryEntityModel, type MemoryExtractedEvent, type MemoryKind, type MemoryQuarantinedEvent, type MemoryToVerify, type MemoryVaultSearchOptions, type MemoryVaultToolOptions, type MemoryVerification, type MessageChunk, type MessageFeedback, type MessageOrigin, type MessageSkeleton, type ModelLoadProgress, NEVER_TTL_MS, NODE_BUDGET, type NeighborRefiner, type NowSource, type OCRFile, type ObservationTrend, type ObservationTrendInput, type OperationExecutor, PAST_EVENT_GRACE_MS, PROFILE_DOC_VERSION, type ParsedServerToolsResponse, type PdfExportOptions, type PdfExportProgress, type PdfExportStage, type PdfFile, PdfProcessor, type PendingInteraction, type PersonalitySettings, type PersonalitySliders, type PersonalityStyle, type PhoneCallPollingOptions, type PhotoIngestResult, type PhotoMediaRef, type PlatformStorage, type PortalLlmAuth, type PortalLlmFailure, type PortalLlmFailureReason, type PreprocessingOptions, type PreprocessingResult, type ProcessedFileResult, ProcessorRegistry, type ProfileConfigFingerprint, type ProfileDoc, type ProfileFacet, type ProfileFacetKey, type ProfileSalienceInput, type ProfileSection, type ProfileUpdate, type ProgressCallback, Project, type ProjectOperationsContext, type PromptPreProcessor, type PromptPreProcessorContext, type ProviderAuthState, type ProviderBackupState, ProviderStreamError, type PublishedPhotoMemory, type QuantizedEmbedding, type QuarantinedMemoryInfo, type QueueEncryptionContext, QueueManager, type QueueStatus, type QueuedOperation, type QueuedOperationType, R2_DEFAULT_TTL_MS, RECALL_MAX_LIMIT, RECALL_TOOL_NAME, type RankableVaultMemory, type RankedMemory, type RankedProfileCandidate, type RecallContext, type RecallDegradation, type RecallDiagnostics, type RecallEmptyReason, type RecallOptions, type RecallResult, type RecallToolCallbacks, type RecallToolOptions, type RecencyOptions, type RectProps, type ReflectOptions, type ReflectResult, type RequestEncryptionKeyOptions, RerankerUnavailableError, type ResumeStreamOptions, type ResumeStreamResult, type RetainAction, type RetainContext, type RetainOptions, type RetainResult, type RetainSource, SDK_SCHEMA_VERSION, SERVER_TOOL_DEPENDENCY_SETS, SHORT_TTL_MS, SLIDER_CONFIG, SLIDES_FILE_PATH, SLIDE_CANVAS_HEIGHT, SLIDE_CANVAS_WIDTH, STREAM_RESUMABLE_HEADER, SavedTool as SavedToolModel, type SavedToolOperationsContext, type SavedToolParameter, type ScoreBreakdown, type ScoreProfileSalienceOptions, type ScreenProps, type ScreenResult, type ScreenedCandidate, type SearchMessagesOptions, type SearchSource, type SelectServerToolsForPromptOptions, type SendMessageWithStorageArgs, type SendMessageWithStorageResult, type ServerTool, type ServerToolsFilter, type ServerToolsFilterFn, type ServerToolsFilterFunction, type ServerToolsOptions, type ServerToolsResponse, type SignMessageFn, type SignMessageOptions, type SlideProps, type StepFinishEvent, type StockPriceClassification, type StockPricePreProcessorOptions, type StorageOperationsContext, type StoredAppFile, type ChatCompletionUsage as StoredChatCompletionUsage, type StoredConversation, type StoredConversationMemory, type StoredEntity, type StoredFileWithContext, type StoredMedia, Media as StoredMediaModel, type StoredMessage, type StoredMessageWithSimilarity, type StoredModelPreference, ModelPreference as StoredModelPreferenceModel, type StoredProject, type StoredSavedTool, type StoredTopic, type StoredUserPreference, UserPreference as StoredUserPreferenceModel, type StoredVaultFolder, VaultFolder as StoredVaultFolderModel, type StoredVaultMemory, VaultMemory as StoredVaultMemoryModel, StreamExpiredError, type StreamMetaEvent, type StreamResumeHandle, type StreamSmoothingConfig, type SynthesizeProfileOptions, THEME_ATTRS, TOOL_RESULT_ORIGIN, TOPICS_EXTRACTION_VERSION, TOPIC_EXTRACTION_BATCH_SIZE, TREND_RECENT_WINDOW_DAYS, TREND_STALE_WINDOW_DAYS, type TextChunk, TextProcessor, type TextProps, type ThemeAttr, type ToolCallArgumentsDeltaEvent, type ToolMatchOptions, type ToolMatchResult, type ToolSet, type TopicExtractOptions, type TopicExtractionInput, type TopicExtractionRunResult, type TopicSkipReason, type TopicSource, type TranscriptionResult, type TurnCompleteEvent, type TurnSkippedEvent, type UIInteractionContextValue, UIInteractionProvider, type UIInteractionProviderProps, type UncheckedReason, type UnverifiableReason, type UpdateMediaOptions, type UpdateModelPreferenceOptions, type UpdateProjectOptions, type UpdateSavedToolOptions, type UpdateUserPreferenceOptions, type UpdateVaultFolderOptions, type UpdateVaultMemoryOptions, type UseBackupOptions, type UseBackupResult, type UseChatStorageOptions, type UseChatStorageResult, type UseCreditsOptions, type UseCreditsResult, type UseDropboxBackupOptions, type UseDropboxBackupResult, type UseEncryptionResult, type UseExportPdfResult, type UseFilesOptions, type UseFilesResult, type UseGoogleDriveBackupOptions, type UseGoogleDriveBackupResult, type UseICloudBackupOptions, type UseICloudBackupResult, type UseModelsResult, type UseOCRResult, type UsePdfResult, type UsePhoneCallsOptions, type UsePhoneCallsResult, type UseProjectsOptions, type UseProjectsResult, type UseSettingsOptions, type UseSettingsResult, type UseSubscriptionOptions, type UseSubscriptionResult, type UseToolsOptions, type UseToolsResult, type UseVoiceOptions, type UseVoiceResult, type UseWalletBindingOptions, type UseWalletBindingResult, VAULT_SIZE_HOP_CAP, type VaultCandidateKey, type VaultEmbeddingCache, type VaultEmbeddingExpectation, type VaultFolderOperationsContext, type VaultMemoryOperationsContext, type VaultMemoryVisibility, type VaultMemoryWriter, type VaultSaveOperation, type VaultSearchResult, type VaultWriteAction, type VaultWriteInput, type VaultWriteOutcome, type VerificationSources, type VerifyMemoriesForPublishOptions, type VoiceRecording, WalletPoller, WatermelonChatStorageAdapter, type WatermelonChatStorageAdapterOptions, type WeatherClassification, type WeatherPreProcessorOptions, type WebSearchClassification, type WebSearchPreProcessorOptions, type WhisperModel, WordProcessor, ZipProcessor, type ZipProcessorOptions, addConversationMemoriesOp, appFileToStored, archiveVaultMemoryOp, assembleMemoryContext, attachFileContextToLastUserMessage, backfillMemoryEntityUserIdsOp, backfillMemoryTopicsOp, buildAttachedFilesText, capHopsForDensity, chatStorageMigrations, chatStorageSchema, chunkAndEmbedAllMessages, chunkAndEmbedMessage, chunkText, classifyCryptoPrice, classifyCryptoPriceBatch, classifyDecay, classifyInjectionCandidates, classifyObservationTrend, classifyStockPrice, classifyStockPriceBatch, classifyWeather, classifyWeatherBatch, classifyWebSearch, classifyWebSearchBatch, clearAllEncryptionKeys, clearAllEncryptionState, clearAllKeyPairs, clearCalendarToken, clearConversationMemoriesOp, clearDriveToken, clearToken as clearDropboxToken, clearEncryptionKey, clearGithubToken, clearGoogleDriveToken, clearICloudAuth, clearKeyPair, clearLazyTitleCache, clearMemoryTopicsOverrideOp, clearNotionToken, clearServerToolsCache, consoleLogger, conversationMemoryToStored, cosineInt8, createAutoExtractor, createChunkVectorCache, createCryptoPricePreProcessor, createDecaySweeper, createDurableAutoExtractor, createGitHubTools, createLlmDecayClassifier, createLlmNeighborRefiner, createMediaBatchOp, createMediaOp, createMemoryEngineTool, createMemoryVaultSearchTool, createMemoryVaultTool, createMessageSourceResolver, createPlatformCursorStore, createProjectOp, createRecallTool, createSavedToolOp, createServerToolsFilter, createStockPricePreProcessor, createVaultEmbeddingCache, createVaultFolderOp, createVaultMemoriesBatchOp, createVaultMemoryOp, createWeatherPreProcessor, createWebSearchPreProcessor, decodeChunkVector, decryptConversationTitle, decryptData, decryptDataBatch, decryptDataBytes, decryptDataBytesFromBytes, decryptDataWithKey, defaultServerToolsFilter, deleteAllAppFilesOp, deleteAllVaultMemoriesForUserOp, deleteAppFileOp, deleteEncryptedFile, deleteMediaByConversationOp, deleteMediaByMessageOp, deleteMediaOp, deleteMessageOp, deleteProjectOp, deleteSavedToolOp, deleteVaultFolderOp, deleteVaultMemoryOp, dequantizeEmbedding, deriveKeyFromSignatureBytes, eagerEmbedContent, embedAllMessages, embedMessage, encodeChunkVector, encryptData, encryptDataBatch, encryptDataBytes, encryptDataWithKey, ensureDefaultFoldersOp, expandToolSetsAdditive, exportElementToPdf, exportMarkdownToPdf, exportPublicKey, extractAndLinkEntitiesForMemoriesOp, extractAndRetain, extractEntitiesForMemories, extractFacts, extractFileIds, fileExists, findById, findMatchingTools, findParentOfId, formatFileProcessingNotes, generateConversationId, generateEmbedding, generateEmbeddings, generateMediaId, generateProjectId, getAIGeneratedMediaOp, getAllSavedToolsOp, getAllVaultFoldersOp, getAllVaultMemoriesOp, getAllVaultMemoryContentsOp, getAndClearCalendarPendingMessage, getAndClearCalendarReturnUrl, getAndClearDrivePendingMessage, getAndClearDriveReturnUrl, getAndClearGithubPendingMessage, getAndClearGithubReturnUrl, getAndClearNotionPendingMessage, getAndClearNotionReturnUrl, getAppFileMapOp, getAppFileOp, getAppFilesOp, getAudioOp, getCachedServerTools, getCalendarAccessToken, getConversationMemoriesOp, getConversationsByProjectLazyOp, getConversationsByProjectOp, getConversationsLazyOp, getConversationsPageOp, getDecayCandidatesRawOp, getDocumentsOp, getDriveAccessToken, getEncryptionKey, getEntitiesByMemoryIdsOp, getGithubAccessToken, getGoogleDriveStoredToken, getId, getImagesOp, getLogger, getMediaByConversationOp, getMediaByIdOp, getMediaByIdsOp, getMediaByMessageOp, getMediaByModelOp, getMediaByRoleOp, getMediaBySourceUrlOp, getMediaByTypeOp, getMediaCountOp, getMediaCountsByTypeOp, getMediaOp, getMediaTypeFromMime, getMemoriesByEntityNamesOp, getMemoriesNeedingTopicExtractionOp, getNotionAccessToken, getNotionMCPUrl, getNumberAttr, getProjectConversationCountOp, getProjectConversationsOp, getProjectOp, getProjectsOp, getRecentMediaOp, getSavedToolByIdOp, getServerTools, getStringAttr, getSupportedFileTypes, getToolsChecksum, getUnfiledVaultMemoriesOp, getUserUploadedMediaOp, getValidCalendarToken, getValidDriveToken, getValidGithubToken, getValidNotionToken, getVaultCandidateKeysOp, getVaultEmbeddingsByIdsOp, getVaultFolderMemoryCountOp, getVaultMemoriesByIdsOp, getVaultMemoryOp, getVaultRankingProjectionsOp, getVideosOp, handleCalendarCallback, handleDriveCallback, handleGithubCallback, handleNotionCallback, hardDeleteDecayedOp, hardDeleteMediaOp, hasCalendarCredentials, hasDriveCredentials, hasDropboxCredentials, hasEncryptionKey, hasGithubCredentials, hasGoogleDriveCredentials, hasICloudCredentials, hasKeyPair, hasNotionCredentials, ingestPublishedPhotoMemoriesOp, injectionSignatureCatalog, insertAfterId, insertChild, isAnumaTag, isAttachedFilesText, isCalendarCallback, isDegradedTopicSkip, isDriveCallback, isEncrypted, isGithubCallback, isHtmlTag, isNotionCallback, isOPFSSupported, isR2UrlExpired, isRerankerAvailable, isSupportedFile, isSupportedMediaType, linkMemoryEntitiesOp, maskScopedEmbeddingCache, mediaToStored, migrateCalendarToken, migrateDisplayResult, migrateDriveToken, migrateGithubToken, migrateNotionClientRegistration, migrateNotionToken, moveMemoriesToFolderOp, noopLogger, onKeyAvailable, parseJsx, parseMedia, preEmbedVaultMemories, preprocessFiles, previewToolSelection, projectToStored, putAppFileOp, quantizeEmbedding, queueManager, rankProfileCandidates, readEncryptedFile, recall, reflect, refreshCalendarToken, refreshDriveToken, refreshEncryptionKeyIfMatches, refreshGithubToken, refreshNotionToken, relinkMemoryTopicsOp, relinkMisclassifiedVideosOp, removeById, renderAnumaJsx, renderAnumaTree, renderElementToCanvas, replaceById, replaceMemoryEntitiesGuardedOp, requestEncryptionKey, requestKeyPair, resolveFilePlaceholders, resolveThemeColor, restoreVaultMemoryOp, resumeStream, retain, revokeCalendarToken, revokeDriveToken, revokeGithubToken, revokeNotionAccess, savedToolToStored, scoreProfileSalience, screenCandidatesForInjection, sdkMigrations, sdkModelClasses, sdkSchema, searchChunksOp, searchMediaOp, searchMessagesOp, searchVaultMemories, seedEncryptionKeys, selectServerToolsForPrompt, serializeJsx, setLogger, setMemoryEntitiesOp, setMemoryVisibilityOp, settingsStorageSchema, shouldChunkMessage, shouldRecallMemory, shouldRefreshTools, stampTopicsExtractedAtOp, startGithubAuth, startNotionAuth, storeCalendarPendingMessage, storeCalendarReturnUrl, storeCalendarToken, storeDrivePendingMessage, storeDriveReturnUrl, storeDriveToken, storeGithubPendingMessage, storeGithubReturnUrl, storeGithubToken, storeNotionPendingMessage, storeNotionReturnUrl, streamCancelPath, streamReplayPath, stripLegacyChunkTextOp, summarizeObservationTrends, supersedeVaultMemoryOp, synthesizeProfile, traverseGraphLane, ttlForType, updateAttrs, updateConversationProjectOp, updateMediaMessageIdBatchOp, updateMediaOp, updateMessageFeedbackOp, updateProjectNameOp, updateProjectOp, updateSavedToolOp, updateVaultFolderContextOp, updateVaultFolderOp, updateVaultMemoryEmbeddingOp, updateVaultMemoryOp, useAnumaTheme, useBackup, useBackupAuth, useChat, useChatStorage, useCredits, useDatabaseManager, useDropboxAuth, useDropboxBackup, useEncryption, useExportPdf, useFiles, useGoogleDriveAuth, useGoogleDriveBackup, useICloudAuth, useICloudBackup, useModels, useOCR, usePdf, usePhoneCalls, useProjects, useSettings, useSubscription, useTools, useUIInteraction, useVoice, useWalletBinding, userPreferencesStorageSchema, verifyMemoriesForPublish, walk, webPlatformStorage, withActiveToolSetServerTools, withInternalFlowMarker, writeEncryptedFile };
|
|
16746
|
+
export { Anuma, type AnumaChild, AnumaJsxError, type AnumaNode, AnumaShadowIsolationProvider, type AnumaShadowIsolationProviderProps, type AnumaTheme, AnumaThemeProvider, type AnumaThemeProviderProps, AppFile as AppFileModel, type AppFileOperationsContext, type AttrValue, type AutoExtractMessage, type AutoExtractor, DEFAULT_CONVERSATIONS_FOLDER as BACKUP_DRIVE_CONVERSATIONS_FOLDER, DEFAULT_ROOT_FOLDER as BACKUP_DRIVE_ROOT_FOLDER, DEFAULT_BACKUP_FOLDER as BACKUP_ICLOUD_FOLDER, BUILT_IN_TOOL_SETS, type BackupAuthContextValue, BackupAuthProvider, type BackupAuthProviderProps, type BackupOperationOptions, BlobUrlManager, type Budget, CHUNKS_DISCARDED_ORIGIN, type CachedChunkVectors, type CachedServerTools, ChartCard, type ChartCardProps, type ChartConfig, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, Conversation as ChatConversation, Message as ChatMessage, type ChatRole, type ChatStorageAdapter, type ChatStorageObservable, type ChunkSearchResult, type ChunkVectorCache, type ChunkingOptions, type CircleProps, type ClientToolsFilterFn, type ConsolidationAction, type ConsolidationFallbackReason, type ConversationMemoryInput, ConversationMemory as ConversationMemoryModel, type ConversationMemoryOperationsContext, type ConversationQueryOptions, type CreateAutoExtractorOptions, type CreateConversationOptions, type CreateDecaySweeperOptions, type CreateEntityOptions, type CreateMediaOptions, type CreateMessageOptions, type CreateModelPreferenceOptions, type CreateProjectOptions, type CreateSavedToolOptions, type CreateServerToolsFilterOptions, type CreateUserPreferenceOptions, type CreateVaultFolderOptions, type CreateVaultMemoryOptions, type CryptoPriceClassification, type CryptoPricePreProcessorOptions, DEFAULT_BACKUP_FOLDER$1 as DEFAULT_BACKUP_FOLDER, DEFAULT_CACHE_EXPIRATION_MS, DEFAULT_CHUNK_CACHE_SIZE, DEFAULT_CHUNK_OVERLAP, DEFAULT_CHUNK_SIZE, DEFAULT_DECAY_POLICY, DEFAULT_CONVERSATIONS_FOLDER as DEFAULT_DRIVE_CONVERSATIONS_FOLDER, DEFAULT_ROOT_FOLDER as DEFAULT_DRIVE_ROOT_FOLDER, DEFAULT_BACKUP_FOLDER$1 as DEFAULT_DROPBOX_FOLDER, DEFAULT_EXCLUDED_SERVER_TOOLS, DEFAULT_BACKUP_FOLDER as DEFAULT_ICLOUD_BACKUP_FOLDER, DEFAULT_MAX_CLASSIFIER_CALLS_PER_SWEEP, DEFAULT_MIN_CHUNK_SIZE, DEFAULT_PERSONALITY_SETTINGS, DEFAULT_PROFILE_FACETS, DEFAULT_PROFILE_FACT_TYPE_WEIGHTS, DEFAULT_PROFILE_PROOF_ALPHA, DEFAULT_PROFILE_TREND_MULTIPLIERS, DEFAULT_SERVER_TOOLS_MATCH_OPTIONS, DEFAULT_VAULT_CACHE_SIZE, DatabaseManager, type DatabaseManagerLogger, type DatabaseManagerOptions, type DecayCandidateRaw, type DecayClassifier, type DecayInput, type DecayPolicy, type DecaySweepResult, type DecaySweeper, type DecayVerdict, type DeckProps, type DisplayToolMigrations, type DropboxAuthContextValue, DropboxAuthProvider, type DropboxAuthProviderProps, type DropboxExportResult, type DropboxImportResult, type DurableAutoExtractorOptions, ENTITY_FANOUT, ENTITY_KINDS, type EmbeddedWalletSignerFn, EncryptionKeyMissingError, type EncryptionKeyVersion, type EntityInput, type EntityKind, Entity as EntityModel, type EntityOperationsContext, ExcelProcessor, type ExtractFactsOptions, type ExtractOutcome, type ExtractedCandidate, type ExtractedEntity, type ExtractionCursorStore, type ExtractionFunnel, type ExtractionTimings, FILE_PLACEHOLDER_PREFIX, FILE_PLACEHOLDER_REGEX, type FactType, type FileMetadata, type FileProcessingReason, type FileProcessingStatus, type FileProcessor, type FileTypeQuery, type FileWithData, type FlushResult, type GetConversationsPageOptions, type GetMessagesPageOptions, type GoogleDriveAuthContextValue, GoogleDriveAuthProvider, type GoogleDriveAuthProviderProps, type GoogleDriveExportResult, type GoogleDriveImportResult, type GraphTraversalOptions, type GroupProps, HARD_DELETE_WINDOW_MS, type ICloudAuthContextValue, ICloudAuthProvider, type ICloudAuthProviderProps, type ICloudExportResult, type ICloudImportResult, INFERENCE_ID_HEADER, INTERNAL_FLOW_MARKER, type IconProps, type ImageProps, type InjectionClassifierOptions, type InjectionReason, type InteractionType, type KnownTag, type LazyStoredConversation, type LineProps, type LlmDecayClassifierOptions, type LlmNeighborRefinerOptions, type Logger, LoggerProvider, type LoggerProviderProps, MAX_HOPS, MEDIUM_TTL_MS, type ManualFactType, type MediaDimensions, type MediaFilterOptions, type MediaMetadata, type MediaOperationsContext, type MediaRole, type MediaType, type MemoriesNeedingTopicExtraction, type MemoryContextItem, type MemoryContextLane, type MemoryContextOptions, type MemoryContextResult, type EmbeddingOptions as MemoryEngineEmbeddingOptions, type MemoryEngineResult, type MemoryEngineSearchOptions, MemoryEntity as MemoryEntityModel, type MemoryExtractedEvent, type MemoryKind, type MemoryQuarantinedEvent, type MemoryToVerify, type MemoryVaultSearchOptions, type MemoryVaultToolOptions, type MemoryVerification, type MessageChunk, type MessageFeedback, type MessageOrigin, type MessageSkeleton, type ModelLoadProgress, NEVER_TTL_MS, NODE_BUDGET, type NeighborRefiner, type NowSource, type OCRFile, type ObservationTrend, type ObservationTrendInput, type OperationExecutor, PAST_EVENT_GRACE_MS, PROFILE_DOC_VERSION, type ParsedServerToolsResponse, type PdfExportOptions, type PdfExportProgress, type PdfExportStage, type PdfFile, PdfProcessor, type PendingInteraction, type PersonalitySettings, type PersonalitySliders, type PersonalityStyle, type PhoneCallPollingOptions, type PhotoIngestResult, type PhotoMediaRef, type PlatformStorage, type PortalLlmAuth, type PortalLlmFailure, type PortalLlmFailureReason, type PreprocessingOptions, type PreprocessingResult, type ProcessedFileResult, ProcessorRegistry, type ProfileConfigFingerprint, type ProfileDoc, type ProfileFacet, type ProfileFacetKey, type ProfileSalienceInput, type ProfileSection, type ProfileUpdate, type ProgressCallback, Project, type ProjectOperationsContext, type PromptPreProcessor, type PromptPreProcessorContext, type ProviderAuthState, type ProviderBackupState, ProviderStreamError, type PublishedPhotoMemory, type QuantizedEmbedding, type QuarantinedMemoryInfo, type QueueEncryptionContext, QueueManager, type QueueStatus, type QueuedOperation, type QueuedOperationType, R2_DEFAULT_TTL_MS, RECALL_MAX_LIMIT, RECALL_TOOL_NAME, type RankableVaultMemory, type RankedMemory, type RankedProfileCandidate, type RecallContext, type RecallDegradation, type RecallDiagnostics, type RecallEmptyReason, type RecallOptions, type RecallResult, type RecallToolCallbacks, type RecallToolOptions, type RecencyOptions, type RectProps, type ReflectOptions, type ReflectResult, type RequestEncryptionKeyOptions, RerankerUnavailableError, type ResumeStreamOptions, type ResumeStreamResult, type RetainAction, type RetainContext, type RetainOptions, type RetainResult, type RetainSource, SDK_SCHEMA_VERSION, SERVER_TOOL_DEPENDENCY_SETS, SHORT_TTL_MS, SLIDER_CONFIG, SLIDES_FILE_PATH, SLIDE_CANVAS_HEIGHT, SLIDE_CANVAS_WIDTH, STREAM_RESUMABLE_HEADER, SavedTool as SavedToolModel, type SavedToolOperationsContext, type SavedToolParameter, type ScoreBreakdown, type ScoreProfileSalienceOptions, type ScreenProps, type ScreenResult, type ScreenedCandidate, type SearchMessagesOptions, type SearchSource, type SelectServerToolsForPromptOptions, type SendMessageWithStorageArgs, type SendMessageWithStorageResult, type ServerTool, type ServerToolsFilter, type ServerToolsFilterFn, type ServerToolsFilterFunction, type ServerToolsOptions, type ServerToolsResponse, type SignMessageFn, type SignMessageOptions, type SlideProps, type StepFinishEvent, type StockPriceClassification, type StockPricePreProcessorOptions, type StorageOperationsContext, type StoredAppFile, type ChatCompletionUsage as StoredChatCompletionUsage, type StoredConversation, type StoredConversationMemory, type StoredEntity, type StoredFileWithContext, type StoredMedia, Media as StoredMediaModel, type StoredMessage, type StoredMessageWithSimilarity, type StoredModelPreference, ModelPreference as StoredModelPreferenceModel, type StoredProject, type StoredSavedTool, type StoredTopic, type StoredUserPreference, UserPreference as StoredUserPreferenceModel, type StoredVaultFolder, VaultFolder as StoredVaultFolderModel, type StoredVaultMemory, VaultMemory as StoredVaultMemoryModel, StreamExpiredError, type StreamMetaEvent, type StreamResumeHandle, type StreamSmoothingConfig, type SynthesizeProfileOptions, THEME_ATTRS, TOOL_RESULT_ORIGIN, TOPICS_EXTRACTION_VERSION, TOPIC_EXTRACTION_BATCH_SIZE, TREND_RECENT_WINDOW_DAYS, TREND_STALE_WINDOW_DAYS, type TextChunk, TextProcessor, type TextProps, type ThemeAttr, type ToolCallArgumentsDeltaEvent, type ToolMatchOptions, type ToolMatchResult, type ToolSet, type TopicExtractOptions, type TopicExtractionInput, type TopicExtractionRunResult, type TopicSkipReason, type TopicSource, type TranscriptionResult, type TurnCompleteEvent, type TurnSkippedEvent, type UIInteractionContextValue, UIInteractionProvider, type UIInteractionProviderProps, type UncheckedReason, type UnverifiableReason, type UpdateMediaOptions, type UpdateModelPreferenceOptions, type UpdateProjectOptions, type UpdateSavedToolOptions, type UpdateUserPreferenceOptions, type UpdateVaultFolderOptions, type UpdateVaultMemoryOptions, type UseBackupOptions, type UseBackupResult, type UseChatStorageOptions, type UseChatStorageResult, type UseCreditsOptions, type UseCreditsResult, type UseDropboxBackupOptions, type UseDropboxBackupResult, type UseEncryptionResult, type UseExportPdfResult, type UseFilesOptions, type UseFilesResult, type UseGoogleDriveBackupOptions, type UseGoogleDriveBackupResult, type UseICloudBackupOptions, type UseICloudBackupResult, type UseModelsResult, type UseOCRResult, type UsePdfResult, type UsePhoneCallsOptions, type UsePhoneCallsResult, type UseProjectsOptions, type UseProjectsResult, type UseSettingsOptions, type UseSettingsResult, type UseSubscriptionOptions, type UseSubscriptionResult, type UseToolsOptions, type UseToolsResult, type UseVoiceOptions, type UseVoiceResult, type UseWalletBindingOptions, type UseWalletBindingResult, VAULT_SIZE_HOP_CAP, type VaultCandidateKey, type VaultEmbeddingCache, type VaultEmbeddingExpectation, type VaultFolderOperationsContext, type VaultMemoryOperationsContext, type VaultMemoryVisibility, type VaultMemoryWriter, type VaultSaveOperation, type VaultSearchResult, type VaultWriteAction, type VaultWriteInput, type VaultWriteOutcome, type VerificationSources, type VerifyMemoriesForPublishOptions, type VoiceRecording, WalletPoller, WatermelonChatStorageAdapter, type WatermelonChatStorageAdapterOptions, type WeatherClassification, type WeatherPreProcessorOptions, type WebSearchClassification, type WebSearchPreProcessorOptions, type WhisperModel, WordProcessor, ZipProcessor, type ZipProcessorOptions, addConversationMemoriesOp, appFileToStored, archiveVaultMemoryOp, assembleMemoryContext, attachFileContextToLastUserMessage, backfillMemoryEntityUserIdsOp, backfillMemoryTopicsOp, buildAttachedFilesText, capHopsForDensity, chatStorageMigrations, chatStorageSchema, chunkAndEmbedAllMessages, chunkAndEmbedMessage, chunkText, classifyCryptoPrice, classifyCryptoPriceBatch, classifyDecay, classifyInjectionCandidates, classifyObservationTrend, classifyStockPrice, classifyStockPriceBatch, classifyWeather, classifyWeatherBatch, classifyWebSearch, classifyWebSearchBatch, clearAllEncryptionKeys, clearAllEncryptionState, clearAllKeyPairs, clearCalendarToken, clearConversationMemoriesOp, clearDriveToken, clearToken as clearDropboxToken, clearEncryptionKey, clearGithubToken, clearGoogleDriveToken, clearICloudAuth, clearKeyPair, clearLazyTitleCache, clearMemoryTopicsOverrideOp, clearNotionToken, clearServerToolsCache, consoleLogger, conversationMemoryToStored, cosineInt8, createAutoExtractor, createChunkVectorCache, createCryptoPricePreProcessor, createDecaySweeper, createDurableAutoExtractor, createGitHubTools, createLlmDecayClassifier, createLlmNeighborRefiner, createMediaBatchOp, createMediaOp, createMemoryEngineTool, createMemoryVaultSearchTool, createMemoryVaultTool, createMessageSourceResolver, createPlatformCursorStore, createProjectOp, createRecallTool, createSavedToolOp, createServerToolsFilter, createStockPricePreProcessor, createVaultEmbeddingCache, createVaultFolderOp, createVaultMemoriesBatchOp, createVaultMemoryOp, createWeatherPreProcessor, createWebSearchPreProcessor, decodeChunkVector, decryptConversationTitle, decryptData, decryptDataBatch, decryptDataBytes, decryptDataBytesFromBytes, decryptDataWithKey, defaultServerToolsFilter, deleteAllAppFilesOp, deleteAllVaultMemoriesForUserOp, deleteAppFileOp, deleteEncryptedFile, deleteMediaByConversationOp, deleteMediaByMessageOp, deleteMediaOp, deleteMessageOp, deleteProjectOp, deleteSavedToolOp, deleteVaultFolderOp, deleteVaultMemoryOp, dequantizeEmbedding, deriveKeyFromSignatureBytes, eagerEmbedContent, embedAllMessages, embedMessage, encodeChunkVector, encryptData, encryptDataBatch, encryptDataBytes, encryptDataWithKey, ensureDefaultFoldersOp, expandToolSetsAdditive, exportElementToPdf, exportMarkdownToPdf, exportPublicKey, extractAndLinkEntitiesForMemoriesOp, extractAndRetain, extractEntitiesForMemories, extractFacts, extractFileIds, extractMCPImageUrls, fileExists, findById, findMatchingTools, findParentOfId, formatFileProcessingNotes, generateConversationId, generateEmbedding, generateEmbeddings, generateMediaId, generateProjectId, getAIGeneratedMediaOp, getAllSavedToolsOp, getAllVaultFoldersOp, getAllVaultMemoriesOp, getAllVaultMemoryContentsOp, getAndClearCalendarPendingMessage, getAndClearCalendarReturnUrl, getAndClearDrivePendingMessage, getAndClearDriveReturnUrl, getAndClearGithubPendingMessage, getAndClearGithubReturnUrl, getAndClearNotionPendingMessage, getAndClearNotionReturnUrl, getAppFileMapOp, getAppFileOp, getAppFilesOp, getAudioOp, getCachedServerTools, getCalendarAccessToken, getConversationMemoriesOp, getConversationsByProjectLazyOp, getConversationsByProjectOp, getConversationsLazyOp, getConversationsPageOp, getDecayCandidatesRawOp, getDocumentsOp, getDriveAccessToken, getEncryptionKey, getEntitiesByMemoryIdsOp, getGithubAccessToken, getGoogleDriveStoredToken, getId, getImagesOp, getLogger, getMediaByConversationOp, getMediaByIdOp, getMediaByIdsOp, getMediaByMessageOp, getMediaByModelOp, getMediaByRoleOp, getMediaBySourceUrlOp, getMediaByTypeOp, getMediaCountOp, getMediaCountsByTypeOp, getMediaOp, getMediaTypeFromMime, getMemoriesByEntityNamesOp, getMemoriesNeedingTopicExtractionOp, getNotionAccessToken, getNotionMCPUrl, getNumberAttr, getProjectConversationCountOp, getProjectConversationsOp, getProjectOp, getProjectsOp, getRecentMediaOp, getSavedToolByIdOp, getServerTools, getStringAttr, getSupportedFileTypes, getToolsChecksum, getUnfiledVaultMemoriesOp, getUserUploadedMediaOp, getValidCalendarToken, getValidDriveToken, getValidGithubToken, getValidNotionToken, getVaultCandidateKeysOp, getVaultEmbeddingsByIdsOp, getVaultFolderMemoryCountOp, getVaultMemoriesByIdsOp, getVaultMemoryOp, getVaultRankingProjectionsOp, getVideosOp, handleCalendarCallback, handleDriveCallback, handleGithubCallback, handleNotionCallback, hardDeleteDecayedOp, hardDeleteMediaOp, hasCalendarCredentials, hasDriveCredentials, hasDropboxCredentials, hasEncryptionKey, hasGithubCredentials, hasGoogleDriveCredentials, hasICloudCredentials, hasKeyPair, hasNotionCredentials, ingestPublishedPhotoMemoriesOp, injectionSignatureCatalog, insertAfterId, insertChild, isAnumaTag, isAttachedFilesText, isCalendarCallback, isDegradedTopicSkip, isDriveCallback, isEncrypted, isGithubCallback, isHtmlTag, isNotionCallback, isOPFSSupported, isR2UrlExpired, isRerankerAvailable, isSupportedFile, isSupportedMediaType, linkMemoryEntitiesOp, maskScopedEmbeddingCache, mediaToStored, migrateCalendarToken, migrateDisplayResult, migrateDriveToken, migrateGithubToken, migrateNotionClientRegistration, migrateNotionToken, moveMemoriesToFolderOp, noopLogger, onKeyAvailable, parseJsx, parseMedia, preEmbedVaultMemories, preprocessFiles, previewToolSelection, projectToStored, putAppFileOp, quantizeEmbedding, queueManager, rankProfileCandidates, readEncryptedFile, recall, reflect, refreshCalendarToken, refreshDriveToken, refreshEncryptionKeyIfMatches, refreshGithubToken, refreshNotionToken, relinkMemoryTopicsOp, relinkMisclassifiedVideosOp, removeById, renderAnumaJsx, renderAnumaTree, renderElementToCanvas, replaceById, replaceMemoryEntitiesGuardedOp, requestEncryptionKey, requestKeyPair, resolveFilePlaceholders, resolveThemeColor, restoreVaultMemoryOp, resumeStream, retain, revokeCalendarToken, revokeDriveToken, revokeGithubToken, revokeNotionAccess, savedToolToStored, scoreProfileSalience, screenCandidatesForInjection, sdkMigrations, sdkModelClasses, sdkSchema, searchChunksOp, searchMediaOp, searchMessagesOp, searchVaultMemories, seedEncryptionKeys, selectServerToolsForPrompt, serializeJsx, setLogger, setMemoryEntitiesOp, setMemoryVisibilityOp, settingsStorageSchema, shouldChunkMessage, shouldRecallMemory, shouldRefreshTools, stampTopicsExtractedAtOp, startGithubAuth, startNotionAuth, storeCalendarPendingMessage, storeCalendarReturnUrl, storeCalendarToken, storeDrivePendingMessage, storeDriveReturnUrl, storeDriveToken, storeGithubPendingMessage, storeGithubReturnUrl, storeGithubToken, storeNotionPendingMessage, storeNotionReturnUrl, streamCancelPath, streamReplayPath, stripLegacyChunkTextOp, summarizeObservationTrends, supersedeVaultMemoryOp, synthesizeProfile, traverseGraphLane, ttlForType, updateAttrs, updateConversationProjectOp, updateMediaMessageIdBatchOp, updateMediaOp, updateMessageFeedbackOp, updateProjectNameOp, updateProjectOp, updateSavedToolOp, updateVaultFolderContextOp, updateVaultFolderOp, updateVaultMemoryEmbeddingOp, updateVaultMemoryOp, useAnumaTheme, useBackup, useBackupAuth, useChat, useChatStorage, useCredits, useDatabaseManager, useDropboxAuth, useDropboxBackup, useEncryption, useExportPdf, useFiles, useGoogleDriveAuth, useGoogleDriveBackup, useICloudAuth, useICloudBackup, useModels, useOCR, usePdf, usePhoneCalls, useProjects, useSettings, useSubscription, useTools, useUIInteraction, useVoice, useWalletBinding, userPreferencesStorageSchema, verifyMemoriesForPublish, walk, webPlatformStorage, withActiveToolSetServerTools, withInternalFlowMarker, writeEncryptedFile };
|
package/dist/react/index.mjs
CHANGED
|
@@ -8704,6 +8704,8 @@ function useChat(options) {
|
|
|
8704
8704
|
onServerToolCall,
|
|
8705
8705
|
onToolCallArgumentsDelta,
|
|
8706
8706
|
onStepFinish,
|
|
8707
|
+
resumable,
|
|
8708
|
+
onStreamMeta,
|
|
8707
8709
|
apiType: defaultApiType = "auto",
|
|
8708
8710
|
smoothing,
|
|
8709
8711
|
preProcessors,
|
|
@@ -8713,25 +8715,37 @@ function useChat(options) {
|
|
|
8713
8715
|
const [isLoading, setIsLoading] = useState(false);
|
|
8714
8716
|
const abortControllerRef = useRef(null);
|
|
8715
8717
|
const requestIdRef = useRef(0);
|
|
8718
|
+
const pendingInferenceRef = useRef(null);
|
|
8719
|
+
const cancelInference = useCallback(
|
|
8720
|
+
(inferenceId) => {
|
|
8721
|
+
void (async () => {
|
|
8722
|
+
const token = getToken ? await getToken() : null;
|
|
8723
|
+
const response = await fetch(`${baseUrl}${streamCancelPath(inferenceId)}`, {
|
|
8724
|
+
method: "POST",
|
|
8725
|
+
headers: token ? { Authorization: `Bearer ${token}` } : void 0
|
|
8726
|
+
});
|
|
8727
|
+
if (!response.ok) throw new Error(`Stream cancellation failed: ${response.status}`);
|
|
8728
|
+
})().catch((error) => getLogger().warn("[useChat] stream cancel POST failed:", error));
|
|
8729
|
+
},
|
|
8730
|
+
[getToken, baseUrl]
|
|
8731
|
+
);
|
|
8716
8732
|
const piiRedactorRef = useRef(null);
|
|
8717
8733
|
if (piiRedaction === true && !piiRedactorRef.current) {
|
|
8718
8734
|
piiRedactorRef.current = new PiiRedactor();
|
|
8719
8735
|
}
|
|
8720
8736
|
const resolvedPiiRedaction = piiRedaction === true ? piiRedactorRef.current : piiRedaction;
|
|
8721
8737
|
const stop = useCallback(() => {
|
|
8738
|
+
const inferenceId = pendingInferenceRef.current;
|
|
8739
|
+
pendingInferenceRef.current = null;
|
|
8740
|
+
if (resumable && inferenceId) cancelInference(inferenceId);
|
|
8722
8741
|
if (abortControllerRef.current) {
|
|
8723
8742
|
abortControllerRef.current.abort();
|
|
8724
8743
|
abortControllerRef.current = null;
|
|
8725
8744
|
}
|
|
8726
|
-
}, []);
|
|
8727
|
-
|
|
8728
|
-
|
|
8729
|
-
|
|
8730
|
-
abortControllerRef.current.abort();
|
|
8731
|
-
abortControllerRef.current = null;
|
|
8732
|
-
}
|
|
8733
|
-
};
|
|
8734
|
-
}, []);
|
|
8745
|
+
}, [resumable, cancelInference]);
|
|
8746
|
+
const stopRef = useRef(stop);
|
|
8747
|
+
stopRef.current = stop;
|
|
8748
|
+
useEffect(() => () => stopRef.current(), []);
|
|
8735
8749
|
const sendMessage = useCallback(
|
|
8736
8750
|
async ({
|
|
8737
8751
|
messages,
|
|
@@ -8757,9 +8771,7 @@ function useChat(options) {
|
|
|
8757
8771
|
endpointOverride,
|
|
8758
8772
|
piiRedaction: requestPiiRedaction
|
|
8759
8773
|
}) => {
|
|
8760
|
-
|
|
8761
|
-
abortControllerRef.current.abort();
|
|
8762
|
-
}
|
|
8774
|
+
stop();
|
|
8763
8775
|
const abortController = new AbortController();
|
|
8764
8776
|
abortControllerRef.current = abortController;
|
|
8765
8777
|
const requestId = ++requestIdRef.current;
|
|
@@ -8826,6 +8838,15 @@ function useChat(options) {
|
|
|
8826
8838
|
headers,
|
|
8827
8839
|
apiType: requestApiType ?? defaultApiType,
|
|
8828
8840
|
endpointOverride,
|
|
8841
|
+
resumable,
|
|
8842
|
+
onStreamMeta: resumable || onStreamMeta ? (meta) => {
|
|
8843
|
+
if (requestId !== requestIdRef.current || abortController.signal.aborted) {
|
|
8844
|
+
if (resumable) cancelInference(meta.inferenceId);
|
|
8845
|
+
return;
|
|
8846
|
+
}
|
|
8847
|
+
pendingInferenceRef.current = meta.inferenceId;
|
|
8848
|
+
onStreamMeta?.(meta);
|
|
8849
|
+
} : void 0,
|
|
8829
8850
|
temperature,
|
|
8830
8851
|
maxOutputTokens,
|
|
8831
8852
|
tools,
|
|
@@ -8865,12 +8886,15 @@ function useChat(options) {
|
|
|
8865
8886
|
if (requestIdRef.current === requestId) {
|
|
8866
8887
|
setIsLoading(false);
|
|
8867
8888
|
abortControllerRef.current = null;
|
|
8889
|
+
pendingInferenceRef.current = null;
|
|
8868
8890
|
}
|
|
8869
8891
|
}
|
|
8870
8892
|
},
|
|
8871
8893
|
[
|
|
8872
8894
|
getToken,
|
|
8873
8895
|
baseUrl,
|
|
8896
|
+
stop,
|
|
8897
|
+
cancelInference,
|
|
8874
8898
|
globalOnData,
|
|
8875
8899
|
globalOnThinking,
|
|
8876
8900
|
onFinish,
|
|
@@ -8879,6 +8903,8 @@ function useChat(options) {
|
|
|
8879
8903
|
onServerToolCall,
|
|
8880
8904
|
onToolCallArgumentsDelta,
|
|
8881
8905
|
onStepFinish,
|
|
8906
|
+
resumable,
|
|
8907
|
+
onStreamMeta,
|
|
8882
8908
|
defaultApiType,
|
|
8883
8909
|
smoothing,
|
|
8884
8910
|
preProcessors,
|
|
@@ -22719,6 +22745,8 @@ function useChatStorage(options) {
|
|
|
22719
22745
|
onError,
|
|
22720
22746
|
onServerToolCall,
|
|
22721
22747
|
onToolCallArgumentsDelta,
|
|
22748
|
+
resumable,
|
|
22749
|
+
onStreamMeta,
|
|
22722
22750
|
apiType,
|
|
22723
22751
|
walletAddress,
|
|
22724
22752
|
signMessage,
|
|
@@ -23283,6 +23311,8 @@ function useChatStorage(options) {
|
|
|
23283
23311
|
onError,
|
|
23284
23312
|
onServerToolCall,
|
|
23285
23313
|
onToolCallArgumentsDelta,
|
|
23314
|
+
resumable,
|
|
23315
|
+
onStreamMeta,
|
|
23286
23316
|
apiType,
|
|
23287
23317
|
preProcessors,
|
|
23288
23318
|
smoothing,
|
|
@@ -23705,6 +23735,7 @@ function useChatStorage(options) {
|
|
|
23705
23735
|
return {
|
|
23706
23736
|
data: result2.data,
|
|
23707
23737
|
error: null,
|
|
23738
|
+
autoExecutedToolResults: "autoExecutedToolResults" in result2 ? result2.autoExecutedToolResults : void 0,
|
|
23708
23739
|
skipped: true
|
|
23709
23740
|
};
|
|
23710
23741
|
}
|
|
@@ -30194,6 +30225,22 @@ async function uploadFileToDropbox(accessToken, filename, content, folder = DEFA
|
|
|
30194
30225
|
}
|
|
30195
30226
|
return response.json();
|
|
30196
30227
|
}
|
|
30228
|
+
async function getDropboxFileMetadata(accessToken, filename, folder = DEFAULT_BACKUP_FOLDER) {
|
|
30229
|
+
const response = await fetch(`${DROPBOX_API_URL}/files/get_metadata`, {
|
|
30230
|
+
method: "POST",
|
|
30231
|
+
headers: {
|
|
30232
|
+
Authorization: `Bearer ${accessToken}`,
|
|
30233
|
+
"Content-Type": "application/json"
|
|
30234
|
+
},
|
|
30235
|
+
body: JSON.stringify({ path: `${folder}/${filename}` })
|
|
30236
|
+
});
|
|
30237
|
+
if (response.status === 409) return null;
|
|
30238
|
+
if (!response.ok) {
|
|
30239
|
+
const errorText = await response.text();
|
|
30240
|
+
throw new Error(`Dropbox get metadata failed: ${response.status} - ${errorText}`);
|
|
30241
|
+
}
|
|
30242
|
+
return response.json();
|
|
30243
|
+
}
|
|
30197
30244
|
async function listDropboxFiles(accessToken, folder = DEFAULT_BACKUP_FOLDER) {
|
|
30198
30245
|
await ensureBackupFolder(accessToken, folder);
|
|
30199
30246
|
const response = await fetch(`${DROPBOX_API_URL}/files/list_folder`, {
|
|
@@ -30259,27 +30306,61 @@ async function downloadDropboxFile(accessToken, path) {
|
|
|
30259
30306
|
}
|
|
30260
30307
|
return response.blob();
|
|
30261
30308
|
}
|
|
30262
|
-
async function findDropboxFile(accessToken, filename, folder = DEFAULT_BACKUP_FOLDER) {
|
|
30263
|
-
const files = await listDropboxFiles(accessToken, folder);
|
|
30264
|
-
return files.find((f) => f.name === filename) || null;
|
|
30265
|
-
}
|
|
30266
30309
|
|
|
30267
30310
|
// src/lib/backup/dropbox/backup.ts
|
|
30268
30311
|
var isAuthError = (err) => err instanceof Error && (err.message.includes("401") || err.message.includes("invalid_access_token"));
|
|
30269
|
-
|
|
30312
|
+
var MAX_LISTING_FAILURES = 3;
|
|
30313
|
+
function createDropboxFileIndex(backupFolder) {
|
|
30314
|
+
let pending;
|
|
30315
|
+
let failures = 0;
|
|
30316
|
+
return {
|
|
30317
|
+
get(token) {
|
|
30318
|
+
if (!pending) {
|
|
30319
|
+
if (failures >= MAX_LISTING_FAILURES) {
|
|
30320
|
+
return Promise.reject(
|
|
30321
|
+
new Error("The backup folder listing failed repeatedly; skipped for this run")
|
|
30322
|
+
);
|
|
30323
|
+
}
|
|
30324
|
+
pending = listDropboxFiles(token, backupFolder).then((files) => {
|
|
30325
|
+
const byName = /* @__PURE__ */ new Map();
|
|
30326
|
+
for (const file of files) {
|
|
30327
|
+
if (!byName.has(file.name)) byName.set(file.name, file);
|
|
30328
|
+
}
|
|
30329
|
+
return byName;
|
|
30330
|
+
}).catch((err) => {
|
|
30331
|
+
pending = void 0;
|
|
30332
|
+
failures++;
|
|
30333
|
+
throw err;
|
|
30334
|
+
});
|
|
30335
|
+
}
|
|
30336
|
+
return pending;
|
|
30337
|
+
}
|
|
30338
|
+
};
|
|
30339
|
+
}
|
|
30340
|
+
async function readLocalUpdatedAt(database, conversationId) {
|
|
30341
|
+
const { Q: Q19 } = await import("@nozbe/watermelondb");
|
|
30342
|
+
const records = await database.get("conversations").query(Q19.where("conversation_id", conversationId)).fetch();
|
|
30343
|
+
const match = records.map(conversationToStoredRaw).find((c) => c.conversationId === conversationId);
|
|
30344
|
+
return match ? match.updatedAt : null;
|
|
30345
|
+
}
|
|
30346
|
+
async function pushConversationToDropbox(database, conversationId, userAddress, token, fileIndex, deps, backupFolder = DEFAULT_BACKUP_FOLDER, _retried = false) {
|
|
30270
30347
|
try {
|
|
30271
30348
|
await deps.requestEncryptionKey(userAddress);
|
|
30272
30349
|
const filename = `${conversationId}.json`;
|
|
30273
|
-
const
|
|
30350
|
+
const index = await fileIndex.get(token);
|
|
30351
|
+
const existingFile = index.get(filename);
|
|
30274
30352
|
if (existingFile) {
|
|
30275
|
-
const
|
|
30276
|
-
const
|
|
30277
|
-
|
|
30278
|
-
|
|
30279
|
-
|
|
30280
|
-
|
|
30281
|
-
|
|
30282
|
-
|
|
30353
|
+
const localUpdatedAt = await readLocalUpdatedAt(database, conversationId);
|
|
30354
|
+
const localUpdated = localUpdatedAt ? localUpdatedAt.getTime() : null;
|
|
30355
|
+
if (localUpdated !== null && localUpdated <= new Date(existingFile.server_modified).getTime()) {
|
|
30356
|
+
return "skipped";
|
|
30357
|
+
}
|
|
30358
|
+
const current = await getDropboxFileMetadata(token, filename, backupFolder);
|
|
30359
|
+
if (!current) {
|
|
30360
|
+
index.delete(filename);
|
|
30361
|
+
} else {
|
|
30362
|
+
index.set(filename, current);
|
|
30363
|
+
if (localUpdated !== null && localUpdated <= new Date(current.server_modified).getTime()) {
|
|
30283
30364
|
return "skipped";
|
|
30284
30365
|
}
|
|
30285
30366
|
}
|
|
@@ -30288,7 +30369,8 @@ async function pushConversationToDropbox(database, conversationId, userAddress,
|
|
|
30288
30369
|
if (!exportResult.success || !exportResult.blob) {
|
|
30289
30370
|
return "failed";
|
|
30290
30371
|
}
|
|
30291
|
-
await uploadFileToDropbox(token, filename, exportResult.blob, backupFolder);
|
|
30372
|
+
const uploaded = await uploadFileToDropbox(token, filename, exportResult.blob, backupFolder);
|
|
30373
|
+
index.set(filename, uploaded);
|
|
30292
30374
|
return "uploaded";
|
|
30293
30375
|
} catch (err) {
|
|
30294
30376
|
if (isAuthError(err) && !_retried) {
|
|
@@ -30299,6 +30381,7 @@ async function pushConversationToDropbox(database, conversationId, userAddress,
|
|
|
30299
30381
|
conversationId,
|
|
30300
30382
|
userAddress,
|
|
30301
30383
|
newToken,
|
|
30384
|
+
fileIndex,
|
|
30302
30385
|
deps,
|
|
30303
30386
|
backupFolder,
|
|
30304
30387
|
true
|
|
@@ -30322,6 +30405,7 @@ async function performDropboxExport(database, userAddress, token, deps, onProgre
|
|
|
30322
30405
|
}
|
|
30323
30406
|
let uploaded = 0;
|
|
30324
30407
|
let skipped = 0;
|
|
30408
|
+
const fileIndex = createDropboxFileIndex(backupFolder);
|
|
30325
30409
|
for (let i = 0; i < conversations.length; i++) {
|
|
30326
30410
|
const conv = conversations[i];
|
|
30327
30411
|
onProgress?.(i + 1, total);
|
|
@@ -30330,6 +30414,7 @@ async function performDropboxExport(database, userAddress, token, deps, onProgre
|
|
|
30330
30414
|
conv.conversationId,
|
|
30331
30415
|
userAddress,
|
|
30332
30416
|
token,
|
|
30417
|
+
fileIndex,
|
|
30333
30418
|
deps,
|
|
30334
30419
|
backupFolder
|
|
30335
30420
|
);
|
|
@@ -30898,29 +30983,52 @@ async function listDriveFiles(accessToken, folderId) {
|
|
|
30898
30983
|
const data = await response.json();
|
|
30899
30984
|
return data.files ?? [];
|
|
30900
30985
|
}
|
|
30901
|
-
|
|
30902
|
-
|
|
30903
|
-
|
|
30904
|
-
|
|
30905
|
-
|
|
30906
|
-
|
|
30907
|
-
|
|
30908
|
-
|
|
30986
|
+
var DRIVE_MAX_PAGE_SIZE = 1e3;
|
|
30987
|
+
async function listAllDriveFiles(accessToken, folderId) {
|
|
30988
|
+
const query = `'${escapeQueryValue(folderId)}' in parents and trashed=false`;
|
|
30989
|
+
const fields = encodeURIComponent("nextPageToken,files(id,name,createdTime,modifiedTime,size)");
|
|
30990
|
+
const files = [];
|
|
30991
|
+
let pageToken;
|
|
30992
|
+
do {
|
|
30993
|
+
const tokenParam = pageToken ? `&pageToken=${encodeURIComponent(pageToken)}` : "";
|
|
30994
|
+
const response = await fetch(
|
|
30995
|
+
`${DRIVE_API_URL}/files?q=${encodeURIComponent(query)}&fields=${fields}&pageSize=${DRIVE_MAX_PAGE_SIZE}${tokenParam}`,
|
|
30996
|
+
{
|
|
30997
|
+
headers: { Authorization: `Bearer ${accessToken}` }
|
|
30998
|
+
}
|
|
30999
|
+
);
|
|
31000
|
+
if (!response.ok) {
|
|
31001
|
+
throw new Error(`Failed to list files: ${response.status}`);
|
|
31002
|
+
}
|
|
31003
|
+
const data = await response.json();
|
|
31004
|
+
files.push(...data.files ?? []);
|
|
31005
|
+
pageToken = data.nextPageToken;
|
|
31006
|
+
} while (pageToken);
|
|
31007
|
+
return files;
|
|
30909
31008
|
}
|
|
30910
|
-
async function
|
|
30911
|
-
const
|
|
30912
|
-
const fields = "files(id,name,createdTime,modifiedTime,size)";
|
|
31009
|
+
async function getDriveFileMetadata(accessToken, fileId) {
|
|
31010
|
+
const fields = encodeURIComponent("id,name,createdTime,modifiedTime,size,trashed");
|
|
30913
31011
|
const response = await fetch(
|
|
30914
|
-
`${DRIVE_API_URL}/files
|
|
31012
|
+
`${DRIVE_API_URL}/files/${encodeURIComponent(fileId)}?fields=${fields}`,
|
|
30915
31013
|
{
|
|
30916
31014
|
headers: { Authorization: `Bearer ${accessToken}` }
|
|
30917
31015
|
}
|
|
30918
31016
|
);
|
|
31017
|
+
if (response.status === 404) return null;
|
|
30919
31018
|
if (!response.ok) {
|
|
30920
|
-
throw new Error(`Failed to
|
|
31019
|
+
throw new Error(`Failed to read file: ${response.status}`);
|
|
30921
31020
|
}
|
|
30922
31021
|
const data = await response.json();
|
|
30923
|
-
return data.
|
|
31022
|
+
return data.trashed ? null : data;
|
|
31023
|
+
}
|
|
31024
|
+
async function downloadDriveFile(accessToken, fileId) {
|
|
31025
|
+
const response = await fetch(`${DRIVE_API_URL}/files/${fileId}?alt=media`, {
|
|
31026
|
+
headers: { Authorization: `Bearer ${accessToken}` }
|
|
31027
|
+
});
|
|
31028
|
+
if (!response.ok) {
|
|
31029
|
+
throw new Error(`Failed to download file: ${response.status}`);
|
|
31030
|
+
}
|
|
31031
|
+
return response.blob();
|
|
30924
31032
|
}
|
|
30925
31033
|
|
|
30926
31034
|
// src/lib/backup/google/backup.ts
|
|
@@ -30942,28 +31050,59 @@ async function getConversationsFolder(token, requestDriveAccess, rootFolder, sub
|
|
|
30942
31050
|
throw err;
|
|
30943
31051
|
}
|
|
30944
31052
|
}
|
|
30945
|
-
|
|
31053
|
+
var MAX_LISTING_FAILURES2 = 3;
|
|
31054
|
+
function createDriveFileIndex(folderId) {
|
|
31055
|
+
let pending;
|
|
31056
|
+
let failures = 0;
|
|
31057
|
+
return {
|
|
31058
|
+
get(token) {
|
|
31059
|
+
if (!pending) {
|
|
31060
|
+
if (failures >= MAX_LISTING_FAILURES2) {
|
|
31061
|
+
return Promise.reject(
|
|
31062
|
+
new Error("The backup folder listing failed repeatedly; skipped for this run")
|
|
31063
|
+
);
|
|
31064
|
+
}
|
|
31065
|
+
pending = listAllDriveFiles(token, folderId).then((files) => {
|
|
31066
|
+
const byName = /* @__PURE__ */ new Map();
|
|
31067
|
+
for (const file of files) {
|
|
31068
|
+
if (!byName.has(file.name)) byName.set(file.name, file);
|
|
31069
|
+
}
|
|
31070
|
+
return byName;
|
|
31071
|
+
}).catch((err) => {
|
|
31072
|
+
pending = void 0;
|
|
31073
|
+
failures++;
|
|
31074
|
+
throw err;
|
|
31075
|
+
});
|
|
31076
|
+
}
|
|
31077
|
+
return pending;
|
|
31078
|
+
}
|
|
31079
|
+
};
|
|
31080
|
+
}
|
|
31081
|
+
async function readLocalUpdatedAt2(database, conversationId) {
|
|
31082
|
+
const { Q: Q19 } = await import("@nozbe/watermelondb");
|
|
31083
|
+
const records = await database.get("conversations").query(Q19.where("conversation_id", conversationId)).fetch();
|
|
31084
|
+
const match = records.map(conversationToStoredRaw).find((c) => c.conversationId === conversationId);
|
|
31085
|
+
return match ? match.updatedAt : null;
|
|
31086
|
+
}
|
|
31087
|
+
async function pushConversationToDrive(database, conversationId, userAddress, token, folderId, fileIndex, deps, _retried = false) {
|
|
30946
31088
|
try {
|
|
30947
31089
|
await deps.requestEncryptionKey(userAddress);
|
|
30948
|
-
const folderResult = await getConversationsFolder(
|
|
30949
|
-
token,
|
|
30950
|
-
deps.requestDriveAccess,
|
|
30951
|
-
rootFolder,
|
|
30952
|
-
subfolder
|
|
30953
|
-
);
|
|
30954
|
-
if (!folderResult) return "failed";
|
|
30955
|
-
const { folderId, token: activeToken } = folderResult;
|
|
30956
31090
|
const filename = `${conversationId}.json`;
|
|
30957
|
-
const
|
|
31091
|
+
const index = await fileIndex.get(token);
|
|
31092
|
+
let existingFile = index.get(filename);
|
|
30958
31093
|
if (existingFile) {
|
|
30959
|
-
const
|
|
30960
|
-
const
|
|
30961
|
-
|
|
30962
|
-
|
|
30963
|
-
|
|
30964
|
-
|
|
30965
|
-
|
|
30966
|
-
|
|
31094
|
+
const localUpdatedAt = await readLocalUpdatedAt2(database, conversationId);
|
|
31095
|
+
const localUpdated = localUpdatedAt ? localUpdatedAt.getTime() : null;
|
|
31096
|
+
if (localUpdated !== null && localUpdated <= new Date(existingFile.modifiedTime).getTime()) {
|
|
31097
|
+
return "skipped";
|
|
31098
|
+
}
|
|
31099
|
+
const current = await getDriveFileMetadata(token, existingFile.id);
|
|
31100
|
+
if (!current) {
|
|
31101
|
+
index.delete(filename);
|
|
31102
|
+
existingFile = void 0;
|
|
31103
|
+
} else {
|
|
31104
|
+
index.set(filename, current);
|
|
31105
|
+
if (localUpdated !== null && localUpdated <= new Date(current.modifiedTime).getTime()) {
|
|
30967
31106
|
return "skipped";
|
|
30968
31107
|
}
|
|
30969
31108
|
}
|
|
@@ -30972,10 +31111,19 @@ async function pushConversationToDrive(database, conversationId, userAddress, to
|
|
|
30972
31111
|
if (!exportResult.success || !exportResult.blob) {
|
|
30973
31112
|
return "failed";
|
|
30974
31113
|
}
|
|
31114
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
30975
31115
|
if (existingFile) {
|
|
30976
|
-
await updateDriveFile(
|
|
31116
|
+
await updateDriveFile(token, existingFile.id, exportResult.blob);
|
|
31117
|
+
index.set(filename, { ...existingFile, modifiedTime: now });
|
|
30977
31118
|
} else {
|
|
30978
|
-
await uploadFileToDrive(
|
|
31119
|
+
const created = await uploadFileToDrive(token, folderId, exportResult.blob, filename);
|
|
31120
|
+
index.set(filename, {
|
|
31121
|
+
id: created.id,
|
|
31122
|
+
name: created.name,
|
|
31123
|
+
createdTime: now,
|
|
31124
|
+
modifiedTime: now,
|
|
31125
|
+
size: String(exportResult.blob.size)
|
|
31126
|
+
});
|
|
30979
31127
|
}
|
|
30980
31128
|
return "uploaded";
|
|
30981
31129
|
} catch (err) {
|
|
@@ -30987,9 +31135,9 @@ async function pushConversationToDrive(database, conversationId, userAddress, to
|
|
|
30987
31135
|
conversationId,
|
|
30988
31136
|
userAddress,
|
|
30989
31137
|
newToken,
|
|
31138
|
+
folderId,
|
|
31139
|
+
fileIndex,
|
|
30990
31140
|
deps,
|
|
30991
|
-
rootFolder,
|
|
30992
|
-
subfolder,
|
|
30993
31141
|
true
|
|
30994
31142
|
);
|
|
30995
31143
|
} catch {
|
|
@@ -31010,7 +31158,8 @@ async function performGoogleDriveExport(database, userAddress, token, deps, onPr
|
|
|
31010
31158
|
if (!folderResult) {
|
|
31011
31159
|
return { success: false, uploaded: 0, skipped: 0, total: 0 };
|
|
31012
31160
|
}
|
|
31013
|
-
const { token: activeToken } = folderResult;
|
|
31161
|
+
const { folderId, token: activeToken } = folderResult;
|
|
31162
|
+
const fileIndex = createDriveFileIndex(folderId);
|
|
31014
31163
|
const { Q: Q19 } = await import("@nozbe/watermelondb");
|
|
31015
31164
|
const conversationsCollection = database.get("conversations");
|
|
31016
31165
|
const records = await conversationsCollection.query(Q19.where("is_deleted", false)).fetch();
|
|
@@ -31029,9 +31178,9 @@ async function performGoogleDriveExport(database, userAddress, token, deps, onPr
|
|
|
31029
31178
|
conv.conversationId,
|
|
31030
31179
|
userAddress,
|
|
31031
31180
|
activeToken,
|
|
31032
|
-
|
|
31033
|
-
|
|
31034
|
-
|
|
31181
|
+
folderId,
|
|
31182
|
+
fileIndex,
|
|
31183
|
+
deps
|
|
31035
31184
|
);
|
|
31036
31185
|
if (result === "uploaded") uploaded++;
|
|
31037
31186
|
if (result === "skipped") skipped++;
|
|
@@ -35665,6 +35814,7 @@ export {
|
|
|
35665
35814
|
extractEntitiesForMemories,
|
|
35666
35815
|
extractFacts,
|
|
35667
35816
|
extractFileIds,
|
|
35817
|
+
extractMCPImageUrls,
|
|
35668
35818
|
fileExists,
|
|
35669
35819
|
findById,
|
|
35670
35820
|
findMatchingTools,
|