@anuma/sdk 6.39.2 → 6.40.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/expo/index.cjs +333 -28
- package/dist/expo/index.d.mts +28 -8
- package/dist/expo/index.d.ts +28 -8
- package/dist/expo/index.mjs +333 -28
- package/dist/react/index.cjs +333 -28
- package/dist/react/index.d.mts +28 -8
- package/dist/react/index.d.ts +28 -8
- package/dist/react/index.mjs +333 -28
- package/dist/server/index.cjs +123 -18
- package/dist/server/index.d.mts +34 -8
- package/dist/server/index.d.ts +34 -8
- package/dist/server/index.mjs +123 -18
- package/package.json +1 -1
package/dist/expo/index.cjs
CHANGED
|
@@ -6702,6 +6702,93 @@ function composeHooks(hooks) {
|
|
|
6702
6702
|
};
|
|
6703
6703
|
}
|
|
6704
6704
|
|
|
6705
|
+
// src/lib/chat/streamIdleTimeout.ts
|
|
6706
|
+
var StreamIdleTimeoutError = class extends Error {
|
|
6707
|
+
constructor(idleTimeoutMs) {
|
|
6708
|
+
super(`Stream timed out after ${idleTimeoutMs} ms without activity.`);
|
|
6709
|
+
this.name = "StreamIdleTimeoutError";
|
|
6710
|
+
this.idleTimeoutMs = idleTimeoutMs;
|
|
6711
|
+
}
|
|
6712
|
+
};
|
|
6713
|
+
function withStreamIdleTimeout(transport, idleTimeoutMs) {
|
|
6714
|
+
if (!(idleTimeoutMs > 0) || idleTimeoutMs === Infinity) return transport;
|
|
6715
|
+
return (options) => ({
|
|
6716
|
+
stream: (async function* () {
|
|
6717
|
+
const controller = new AbortController();
|
|
6718
|
+
let timer;
|
|
6719
|
+
let settled = false;
|
|
6720
|
+
let completed = false;
|
|
6721
|
+
let iterator;
|
|
6722
|
+
let interruption;
|
|
6723
|
+
let rejectPending;
|
|
6724
|
+
const disarm = () => {
|
|
6725
|
+
if (timer !== void 0) clearTimeout(timer);
|
|
6726
|
+
timer = void 0;
|
|
6727
|
+
};
|
|
6728
|
+
const interrupt = (error) => {
|
|
6729
|
+
if (interruption) return;
|
|
6730
|
+
interruption = error;
|
|
6731
|
+
rejectPending?.(error);
|
|
6732
|
+
controller.abort();
|
|
6733
|
+
};
|
|
6734
|
+
const arm = () => {
|
|
6735
|
+
if (settled || controller.signal.aborted) return;
|
|
6736
|
+
disarm();
|
|
6737
|
+
timer = setTimeout(() => {
|
|
6738
|
+
interrupt(new StreamIdleTimeoutError(idleTimeoutMs));
|
|
6739
|
+
}, idleTimeoutMs);
|
|
6740
|
+
};
|
|
6741
|
+
const onAbort = () => {
|
|
6742
|
+
controller.abort();
|
|
6743
|
+
};
|
|
6744
|
+
options.signal?.addEventListener("abort", onAbort, { once: true });
|
|
6745
|
+
try {
|
|
6746
|
+
if (options.signal?.aborted) {
|
|
6747
|
+
const error = new Error("Request aborted");
|
|
6748
|
+
error.name = "AbortError";
|
|
6749
|
+
throw error;
|
|
6750
|
+
}
|
|
6751
|
+
arm();
|
|
6752
|
+
iterator = transport({
|
|
6753
|
+
...options,
|
|
6754
|
+
signal: controller.signal,
|
|
6755
|
+
onActivity: () => {
|
|
6756
|
+
arm();
|
|
6757
|
+
options.onActivity?.();
|
|
6758
|
+
}
|
|
6759
|
+
}).stream[Symbol.asyncIterator]();
|
|
6760
|
+
while (true) {
|
|
6761
|
+
if (interruption) throw interruption;
|
|
6762
|
+
const next = await new Promise((resolve, reject) => {
|
|
6763
|
+
rejectPending = reject;
|
|
6764
|
+
Promise.resolve(iterator.next()).then(resolve, reject);
|
|
6765
|
+
});
|
|
6766
|
+
rejectPending = void 0;
|
|
6767
|
+
if (next.done) {
|
|
6768
|
+
completed = true;
|
|
6769
|
+
break;
|
|
6770
|
+
}
|
|
6771
|
+
arm();
|
|
6772
|
+
yield next.value;
|
|
6773
|
+
}
|
|
6774
|
+
} finally {
|
|
6775
|
+
settled = true;
|
|
6776
|
+
rejectPending = void 0;
|
|
6777
|
+
disarm();
|
|
6778
|
+
options.signal?.removeEventListener("abort", onAbort);
|
|
6779
|
+
if (!completed) {
|
|
6780
|
+
controller.abort();
|
|
6781
|
+
try {
|
|
6782
|
+
void iterator?.return?.().catch(() => {
|
|
6783
|
+
});
|
|
6784
|
+
} catch {
|
|
6785
|
+
}
|
|
6786
|
+
}
|
|
6787
|
+
}
|
|
6788
|
+
})()
|
|
6789
|
+
});
|
|
6790
|
+
}
|
|
6791
|
+
|
|
6705
6792
|
// src/lib/chat/useChat/utils.ts
|
|
6706
6793
|
var import_jsonrepair = require("jsonrepair");
|
|
6707
6794
|
init_logger();
|
|
@@ -8892,7 +8979,20 @@ var defaultTransport = (options) => {
|
|
|
8892
8979
|
} catch {
|
|
8893
8980
|
}
|
|
8894
8981
|
}
|
|
8895
|
-
return response;
|
|
8982
|
+
if (!response.body || !options.onActivity) return response;
|
|
8983
|
+
const body = response.body.pipeThrough(
|
|
8984
|
+
new TransformStream({
|
|
8985
|
+
transform(chunk, controller) {
|
|
8986
|
+
if (chunk.byteLength > 0) options.onActivity?.();
|
|
8987
|
+
controller.enqueue(chunk);
|
|
8988
|
+
}
|
|
8989
|
+
})
|
|
8990
|
+
);
|
|
8991
|
+
return new Response(body, {
|
|
8992
|
+
status: response.status,
|
|
8993
|
+
statusText: response.statusText,
|
|
8994
|
+
headers: response.headers
|
|
8995
|
+
});
|
|
8896
8996
|
};
|
|
8897
8997
|
return createSseClient({
|
|
8898
8998
|
method: options.method ?? "POST",
|
|
@@ -8949,6 +9049,7 @@ async function runToolLoop(options) {
|
|
|
8949
9049
|
conversationId,
|
|
8950
9050
|
smoothing,
|
|
8951
9051
|
signal,
|
|
9052
|
+
idleTimeoutMs = 12e4,
|
|
8952
9053
|
resumable,
|
|
8953
9054
|
detachSignal,
|
|
8954
9055
|
onStreamMeta,
|
|
@@ -8962,13 +9063,14 @@ async function runToolLoop(options) {
|
|
|
8962
9063
|
onStepFinish,
|
|
8963
9064
|
onRequest,
|
|
8964
9065
|
onStreamRetry,
|
|
8965
|
-
transport
|
|
9066
|
+
transport = defaultTransport,
|
|
8966
9067
|
preProcessors,
|
|
8967
9068
|
maxConnectorCalls = 2,
|
|
8968
9069
|
hooks: hooksOption,
|
|
8969
9070
|
piiRedaction,
|
|
8970
9071
|
onPiiRedacted
|
|
8971
9072
|
} = options;
|
|
9073
|
+
const makeStreamingRequest = withStreamIdleTimeout(transport, idleTimeoutMs);
|
|
8972
9074
|
const hooks = Array.isArray(hooksOption) ? composeHooks(hooksOption) : hooksOption;
|
|
8973
9075
|
const runId = generateRunId();
|
|
8974
9076
|
let messages = options.messages;
|
|
@@ -19774,6 +19876,14 @@ function createLocalMemoryStore(options) {
|
|
|
19774
19876
|
getLogger().warn("[memory/store] Failed to embed memory:", err);
|
|
19775
19877
|
});
|
|
19776
19878
|
};
|
|
19879
|
+
const maintenance = {
|
|
19880
|
+
createDecaySweeper: (sweeperOptions) => createDecaySweeper({ ...sweeperOptions, vaultCtx }),
|
|
19881
|
+
getTopicBacklog: (backlogOptions) => getMemoriesNeedingTopicExtractionOp(vaultCtx, backlogOptions),
|
|
19882
|
+
extractTopics: (memoryIds, extractOptions) => extractAndLinkEntitiesForMemoriesOp(vaultCtx, memoryIds, extractOptions),
|
|
19883
|
+
stampTopicsExtracted: (memoryIds, extractedAt, version) => stampTopicsExtractedAtOp(vaultCtx, memoryIds, extractedAt, version),
|
|
19884
|
+
relinkTopics: (memoryIds) => relinkMemoryTopicsOp(vaultCtx, memoryIds),
|
|
19885
|
+
backfillTopics: (memoryIds) => backfillMemoryTopicsOp(vaultCtx, memoryIds)
|
|
19886
|
+
};
|
|
19777
19887
|
return {
|
|
19778
19888
|
masksEmbeddingInput: options.embeddingOptions.maskInput !== void 0,
|
|
19779
19889
|
list: (listOptions) => getAllVaultMemoriesOp(vaultCtx, listOptions),
|
|
@@ -19787,21 +19897,22 @@ function createLocalMemoryStore(options) {
|
|
|
19787
19897
|
memoriesByTopics: (names) => getMemoriesByEntityNamesOp(entityCtx, names),
|
|
19788
19898
|
topicsByMemories: (memoryIds) => getEntitiesByMemoryIdsOp(entityCtx, memoryIds),
|
|
19789
19899
|
listTopics: async () => {
|
|
19790
|
-
const links = await entityCtx.memoryEntityCollection.query(...linksOwnedBy).
|
|
19900
|
+
const links = await entityCtx.memoryEntityCollection.query(...linksOwnedBy).unsafeFetchRaw();
|
|
19791
19901
|
const members = /* @__PURE__ */ new Map();
|
|
19792
19902
|
for (const link of links) {
|
|
19793
|
-
const entityId = String(link.
|
|
19903
|
+
const entityId = String(link.entity_id);
|
|
19794
19904
|
const set = members.get(entityId) ?? /* @__PURE__ */ new Set();
|
|
19795
|
-
set.add(String(link.
|
|
19905
|
+
set.add(String(link.memory_id));
|
|
19796
19906
|
members.set(entityId, set);
|
|
19797
19907
|
}
|
|
19798
|
-
const entities = userId === void 0 ? await entityCtx.entityCollection.query().
|
|
19908
|
+
const entities = userId === void 0 ? await entityCtx.entityCollection.query().unsafeFetchRaw() : members.size ? await entityCtx.entityCollection.query(import_watermelondb23.Q.where("id", import_watermelondb23.Q.oneOf([...members.keys()]))).unsafeFetchRaw() : [];
|
|
19799
19909
|
const byName = /* @__PURE__ */ new Map();
|
|
19800
19910
|
for (const entity of entities) {
|
|
19801
|
-
const
|
|
19802
|
-
const
|
|
19803
|
-
byName.
|
|
19804
|
-
|
|
19911
|
+
const name = String(entity.canonical_name);
|
|
19912
|
+
const count2 = members.get(String(entity.id))?.size ?? 0;
|
|
19913
|
+
const existing = byName.get(name);
|
|
19914
|
+
byName.set(name, {
|
|
19915
|
+
name,
|
|
19805
19916
|
kind: existing?.kind ?? entity.kind ?? null,
|
|
19806
19917
|
memoryCount: (existing?.memoryCount ?? 0) + count2
|
|
19807
19918
|
});
|
|
@@ -19892,14 +20003,8 @@ function createLocalMemoryStore(options) {
|
|
|
19892
20003
|
}
|
|
19893
20004
|
return () => subscriptions.forEach((s) => s.unsubscribe());
|
|
19894
20005
|
},
|
|
19895
|
-
maintenance
|
|
19896
|
-
|
|
19897
|
-
getTopicBacklog: (backlogOptions) => getMemoriesNeedingTopicExtractionOp(vaultCtx, backlogOptions),
|
|
19898
|
-
extractTopics: (memoryIds, extractOptions) => extractAndLinkEntitiesForMemoriesOp(vaultCtx, memoryIds, extractOptions),
|
|
19899
|
-
stampTopicsExtracted: (memoryIds, extractedAt, version) => stampTopicsExtractedAtOp(vaultCtx, memoryIds, extractedAt, version),
|
|
19900
|
-
relinkTopics: (memoryIds) => relinkMemoryTopicsOp(vaultCtx, memoryIds),
|
|
19901
|
-
backfillTopics: (memoryIds) => backfillMemoryTopicsOp(vaultCtx, memoryIds)
|
|
19902
|
-
}
|
|
20006
|
+
maintenance,
|
|
20007
|
+
topicMaintenance: maintenance
|
|
19903
20008
|
};
|
|
19904
20009
|
}
|
|
19905
20010
|
|
|
@@ -20684,7 +20789,7 @@ function createRemoteMemoryPipeline(options) {
|
|
|
20684
20789
|
const memory = {
|
|
20685
20790
|
...snapshot.memory,
|
|
20686
20791
|
content: patch.content,
|
|
20687
|
-
updated_at: patch.preserveUpdatedAt ? snapshot.memory.updated_at : Date.now()
|
|
20792
|
+
updated_at: patch.preserveUpdatedAt ? snapshot.memory.updated_at : Math.max(Date.now(), (snapshot.memory.topics_extracted_at ?? 0) + 1)
|
|
20688
20793
|
};
|
|
20689
20794
|
if (patch.scope !== void 0) memory.scope = patch.scope;
|
|
20690
20795
|
if (patch.embedding === void 0 && patch.content !== snapshot.memory.content) {
|
|
@@ -20818,6 +20923,7 @@ function projection({ memory }) {
|
|
|
20818
20923
|
};
|
|
20819
20924
|
}
|
|
20820
20925
|
function relevant(change, options) {
|
|
20926
|
+
if (change === "metadata") return false;
|
|
20821
20927
|
return options.includeDeleted ? change === "membership" : change !== "embedding" || !!options.embeddings;
|
|
20822
20928
|
}
|
|
20823
20929
|
function safely(onChange) {
|
|
@@ -20909,6 +21015,17 @@ function mergeTopics(existing, added) {
|
|
|
20909
21015
|
}
|
|
20910
21016
|
return [...byName.values()];
|
|
20911
21017
|
}
|
|
21018
|
+
function sameTopics(stored2, next) {
|
|
21019
|
+
const key = (t) => JSON.stringify([t.name, t.kind ?? null, t.source]);
|
|
21020
|
+
if (stored2 === null || stored2.length !== next.length) return false;
|
|
21021
|
+
const keys = new Set(stored2.map(key));
|
|
21022
|
+
return next.every((t) => keys.has(key(t)));
|
|
21023
|
+
}
|
|
21024
|
+
function extractionDue(memory) {
|
|
21025
|
+
const stamp = memory.topics_extracted_at;
|
|
21026
|
+
if (stamp === void 0 || stamp === null) return "fresh";
|
|
21027
|
+
return memory.updated_at > stamp || (memory.topics_extracted_version ?? 0) < TOPICS_EXTRACTION_VERSION ? "stale" : null;
|
|
21028
|
+
}
|
|
20912
21029
|
function canonicalTopics(row) {
|
|
20913
21030
|
return new Set((parseTopics(row.topics) ?? []).map((topic) => normalizeEntityName(topic.name)));
|
|
20914
21031
|
}
|
|
@@ -20921,7 +21038,12 @@ function createRemoteMemoryStore(options) {
|
|
|
20921
21038
|
const seen = /* @__PURE__ */ new Map();
|
|
20922
21039
|
let timer;
|
|
20923
21040
|
const notify = (change, records = []) => {
|
|
20924
|
-
if (timer)
|
|
21041
|
+
if (timer)
|
|
21042
|
+
for (const record2 of records) {
|
|
21043
|
+
const previous = seen.get(record2.memory.memory_id);
|
|
21044
|
+
if ((previous?.version ?? 0) + 1 === record2.version)
|
|
21045
|
+
seen.set(record2.memory.memory_id, record2);
|
|
21046
|
+
}
|
|
20925
21047
|
for (const subscriber of [...subscribers])
|
|
20926
21048
|
if (relevant(change, subscriber.options)) safely(subscriber.onChange);
|
|
20927
21049
|
};
|
|
@@ -20982,15 +21104,72 @@ function createRemoteMemoryStore(options) {
|
|
|
20982
21104
|
const record2 = await persistence.get(id);
|
|
20983
21105
|
return record2 && !record2.memory.is_deleted ? record2 : null;
|
|
20984
21106
|
};
|
|
20985
|
-
const
|
|
21107
|
+
const mutateLocked = async (id, change, edit) => {
|
|
20986
21108
|
const record2 = await live(id);
|
|
20987
21109
|
if (!record2) return null;
|
|
20988
21110
|
const next = edit(structuredClone(record2.memory));
|
|
20989
21111
|
if (!next) return null;
|
|
20990
21112
|
const saved = await persistence.put(next, record2);
|
|
20991
|
-
notify(change, [saved]);
|
|
21113
|
+
notify(typeof change === "function" ? change(record2.memory) : change, [saved]);
|
|
20992
21114
|
return saved;
|
|
20993
|
-
}
|
|
21115
|
+
};
|
|
21116
|
+
const mutate = (id, change, edit) => serialized(id, () => mutateLocked(id, change, edit));
|
|
21117
|
+
const serializedAll = (ids, task) => [...new Set(ids)].sort().reduceRight((inner, id) => () => serialized(id, inner), task)();
|
|
21118
|
+
const mutateMany = async (ids, change, edit) => {
|
|
21119
|
+
const saved = /* @__PURE__ */ new Map();
|
|
21120
|
+
const failed = /* @__PURE__ */ new Map();
|
|
21121
|
+
for (const slice of chunks([...new Set(ids)], MAX_BATCH)) {
|
|
21122
|
+
await serializedAll(slice, async () => {
|
|
21123
|
+
const writes = [];
|
|
21124
|
+
let read;
|
|
21125
|
+
try {
|
|
21126
|
+
read = await readEveryState(slice);
|
|
21127
|
+
} catch (error) {
|
|
21128
|
+
for (const id of slice) failed.set(id, error);
|
|
21129
|
+
return;
|
|
21130
|
+
}
|
|
21131
|
+
const { records, unreadable } = read;
|
|
21132
|
+
for (const id of slice) {
|
|
21133
|
+
const record2 = records.get(id);
|
|
21134
|
+
if (unreadable.has(id)) failed.set(id, new Error(`Memory ${id} could not be decrypted`));
|
|
21135
|
+
else if (!record2) failed.set(id, new Error(`Memory ${id} was not found`));
|
|
21136
|
+
else if (!record2.memory.is_deleted) {
|
|
21137
|
+
const memory = edit(structuredClone(record2.memory));
|
|
21138
|
+
if (memory) writes.push({ before: record2, memory });
|
|
21139
|
+
}
|
|
21140
|
+
}
|
|
21141
|
+
if (writes.length === 0) return;
|
|
21142
|
+
try {
|
|
21143
|
+
const written = await persistence.putMany(
|
|
21144
|
+
writes.map(({ before, memory }) => ({ memory, expectedVersion: before }))
|
|
21145
|
+
);
|
|
21146
|
+
const byChange = /* @__PURE__ */ new Map();
|
|
21147
|
+
written.forEach((record2, i) => {
|
|
21148
|
+
saved.set(record2.memory.memory_id, record2);
|
|
21149
|
+
const kind = change(writes[i].before.memory);
|
|
21150
|
+
byChange.set(kind, [...byChange.get(kind) ?? [], record2]);
|
|
21151
|
+
});
|
|
21152
|
+
for (const [kind, changed] of byChange) notify(kind, changed);
|
|
21153
|
+
} catch (error) {
|
|
21154
|
+
const perRow = error instanceof RemoteMemoryError && (error.code === "version_conflict" || error.status === 429);
|
|
21155
|
+
for (const { before } of writes) {
|
|
21156
|
+
const id = before.memory.memory_id;
|
|
21157
|
+
if (!perRow) {
|
|
21158
|
+
failed.set(id, error);
|
|
21159
|
+
continue;
|
|
21160
|
+
}
|
|
21161
|
+
try {
|
|
21162
|
+
const record2 = await mutateLocked(id, change, edit);
|
|
21163
|
+
if (record2) saved.set(id, record2);
|
|
21164
|
+
} catch (rowError) {
|
|
21165
|
+
failed.set(id, rowError);
|
|
21166
|
+
}
|
|
21167
|
+
}
|
|
21168
|
+
}
|
|
21169
|
+
});
|
|
21170
|
+
}
|
|
21171
|
+
return { saved, failed };
|
|
21172
|
+
};
|
|
20994
21173
|
const embedInBackground = ({ memory: { memory_id: id, content } }) => {
|
|
20995
21174
|
generateEmbedding(content, embeddingOptions).then(
|
|
20996
21175
|
(vector) => serialized(id, async () => {
|
|
@@ -21046,11 +21225,10 @@ function createRemoteMemoryStore(options) {
|
|
|
21046
21225
|
return records.map((record2) => stored(record2.memory));
|
|
21047
21226
|
};
|
|
21048
21227
|
const asStored = (record2) => record2 ? stored(record2.memory) : null;
|
|
21049
|
-
const
|
|
21228
|
+
const knownKinds = async (topics) => {
|
|
21050
21229
|
const unkinded = [
|
|
21051
21230
|
...new Set(topics.filter((t) => !t.kind).map((t) => normalizeEntityName(t.name)))
|
|
21052
21231
|
];
|
|
21053
|
-
if (unkinded.length === 0) return topics;
|
|
21054
21232
|
const kinds = /* @__PURE__ */ new Map();
|
|
21055
21233
|
for (const names of chunks(unkinded, MAX_QUERY_TOPICS)) {
|
|
21056
21234
|
for (const { memory } of await pages(metadata, {
|
|
@@ -21065,10 +21243,136 @@ function createRemoteMemoryStore(options) {
|
|
|
21065
21243
|
}
|
|
21066
21244
|
}
|
|
21067
21245
|
}
|
|
21068
|
-
return
|
|
21246
|
+
return (topic) => {
|
|
21069
21247
|
const kind = topic.kind ?? kinds.get(normalizeEntityName(topic.name));
|
|
21070
21248
|
return kind ? { ...topic, kind } : topic;
|
|
21071
|
-
}
|
|
21249
|
+
};
|
|
21250
|
+
};
|
|
21251
|
+
const withKnownKinds = async (topics) => topics.map(await knownKinds(topics));
|
|
21252
|
+
const readEveryState = async (ids) => {
|
|
21253
|
+
const records = /* @__PURE__ */ new Map();
|
|
21254
|
+
const unreadable = /* @__PURE__ */ new Set();
|
|
21255
|
+
for (const memory_ids of chunks(ids, MAX_QUERY_IDS)) {
|
|
21256
|
+
let cursor2;
|
|
21257
|
+
do {
|
|
21258
|
+
const page = await persistence.query({
|
|
21259
|
+
memory_ids,
|
|
21260
|
+
include_deleted: true,
|
|
21261
|
+
include_archived: true,
|
|
21262
|
+
include_quarantined: true,
|
|
21263
|
+
include_superseded: true,
|
|
21264
|
+
limit: 200,
|
|
21265
|
+
...cursor2 && { cursor: cursor2 }
|
|
21266
|
+
});
|
|
21267
|
+
warnFailed(page.failed);
|
|
21268
|
+
for (const record2 of page.items) records.set(record2.memory.memory_id, record2);
|
|
21269
|
+
for (const failure of page.failed) unreadable.add(failure.memory_id);
|
|
21270
|
+
cursor2 = page.next_cursor;
|
|
21271
|
+
} while (cursor2);
|
|
21272
|
+
}
|
|
21273
|
+
return { records, unreadable };
|
|
21274
|
+
};
|
|
21275
|
+
const topicMaintenance = {
|
|
21276
|
+
getTopicBacklog: async (backlogOptions = {}) => {
|
|
21277
|
+
const stale = [];
|
|
21278
|
+
const fresh = [];
|
|
21279
|
+
for (const { memory } of await pages(metadata, { order: "created" })) {
|
|
21280
|
+
if (memory.topics_user_managed) continue;
|
|
21281
|
+
const due = extractionDue(memory);
|
|
21282
|
+
if (due === "stale") stale.push(memory.memory_id);
|
|
21283
|
+
else if (due === "fresh") fresh.push(memory.memory_id);
|
|
21284
|
+
}
|
|
21285
|
+
const limit = backlogOptions.limit !== void 0 && backlogOptions.limit > 0 ? backlogOptions.limit : Infinity;
|
|
21286
|
+
return {
|
|
21287
|
+
pending: [...stale, ...fresh].slice(0, limit).map((uniqueId) => ({ uniqueId })),
|
|
21288
|
+
linkedUnstamped: [],
|
|
21289
|
+
topicsToRelink: [],
|
|
21290
|
+
topicsBackfill: []
|
|
21291
|
+
};
|
|
21292
|
+
},
|
|
21293
|
+
extractTopics: async (memoryIds, extractOptions) => {
|
|
21294
|
+
const extractedAt = extractOptions.now ?? Date.now();
|
|
21295
|
+
const skippedIds = [];
|
|
21296
|
+
const skippedReasons = /* @__PURE__ */ new Map();
|
|
21297
|
+
const skip = (id, reason) => {
|
|
21298
|
+
if (skippedReasons.has(id)) return;
|
|
21299
|
+
skippedIds.push(id);
|
|
21300
|
+
skippedReasons.set(id, reason);
|
|
21301
|
+
};
|
|
21302
|
+
const ids = [...new Set(memoryIds)];
|
|
21303
|
+
const { records, unreadable } = await readEveryState(ids);
|
|
21304
|
+
const inputs = [];
|
|
21305
|
+
for (const id of ids) {
|
|
21306
|
+
const memory = records.get(id)?.memory;
|
|
21307
|
+
if (unreadable.has(id)) skip(id, "unreadable");
|
|
21308
|
+
else if (!memory) skip(id, "not-found");
|
|
21309
|
+
else if (memory.is_deleted || memory.topics_user_managed) skip(id, "excluded");
|
|
21310
|
+
else inputs.push({ id, content: memory.content });
|
|
21311
|
+
}
|
|
21312
|
+
const entitiesByMemory = await extractEntitiesForMemories(inputs, extractOptions);
|
|
21313
|
+
const answered = /* @__PURE__ */ new Map();
|
|
21314
|
+
for (const input of inputs) {
|
|
21315
|
+
const entities = entitiesByMemory.get(input.id);
|
|
21316
|
+
if (entities === void 0) skip(input.id, "llm-unanswered");
|
|
21317
|
+
else
|
|
21318
|
+
answered.set(input.id, { content: input.content, topics: topicInputs(entities, "auto") });
|
|
21319
|
+
}
|
|
21320
|
+
const stampedIds = [];
|
|
21321
|
+
const fail = (id, reason) => {
|
|
21322
|
+
skip(id, reason);
|
|
21323
|
+
entitiesByMemory.delete(id);
|
|
21324
|
+
};
|
|
21325
|
+
try {
|
|
21326
|
+
const kinded = await knownKinds([...answered.values()].flatMap((a) => a.topics));
|
|
21327
|
+
const topics = new Map(
|
|
21328
|
+
[...answered].map(([id, a]) => [id, mergeTopics([], a.topics.map(kinded))])
|
|
21329
|
+
);
|
|
21330
|
+
const unchanged = (memory) => sameTopics(parseTopics(memory.topics), topics.get(memory.memory_id));
|
|
21331
|
+
const { saved, failed } = await mutateMany(
|
|
21332
|
+
[...answered.keys()],
|
|
21333
|
+
(before) => sameTopics(parseTopics(before.topics) ?? [], topics.get(before.memory_id)) ? "metadata" : "edit",
|
|
21334
|
+
(memory) => {
|
|
21335
|
+
if (memory.topics_user_managed || memory.content !== answered.get(memory.memory_id).content)
|
|
21336
|
+
return null;
|
|
21337
|
+
return {
|
|
21338
|
+
...memory,
|
|
21339
|
+
...!unchanged(memory) && {
|
|
21340
|
+
topics: serializeTopics(topics.get(memory.memory_id)),
|
|
21341
|
+
topics_updated_at: Date.now()
|
|
21342
|
+
},
|
|
21343
|
+
topics_extracted_at: Math.max(extractedAt, memory.updated_at),
|
|
21344
|
+
topics_extracted_version: TOPICS_EXTRACTION_VERSION
|
|
21345
|
+
};
|
|
21346
|
+
}
|
|
21347
|
+
);
|
|
21348
|
+
for (const id of answered.keys()) {
|
|
21349
|
+
if (saved.has(id)) stampedIds.push(id);
|
|
21350
|
+
else fail(id, failed.has(id) ? "link-failed" : "link-declined");
|
|
21351
|
+
}
|
|
21352
|
+
if (failed.size)
|
|
21353
|
+
getLogger().warn(
|
|
21354
|
+
"[memory/remote-store] Failed to write extracted topics:",
|
|
21355
|
+
failed.values().next().value
|
|
21356
|
+
);
|
|
21357
|
+
} catch (error) {
|
|
21358
|
+
getLogger().warn("[memory/remote-store] Failed to write extracted topics:", error);
|
|
21359
|
+
for (const id of answered.keys()) fail(id, "link-failed");
|
|
21360
|
+
}
|
|
21361
|
+
return { entitiesByMemory, stampedIds, skippedIds, skippedReasons };
|
|
21362
|
+
},
|
|
21363
|
+
stampTopicsExtracted: async (memoryIds, extractedAt, version = TOPICS_EXTRACTION_VERSION) => {
|
|
21364
|
+
const ids = [...new Set(memoryIds)];
|
|
21365
|
+
const { saved, failed } = await mutateMany(
|
|
21366
|
+
ids,
|
|
21367
|
+
() => "metadata",
|
|
21368
|
+
(memory) => memory.topics_user_managed ? null : { ...memory, topics_extracted_at: extractedAt, topics_extracted_version: version }
|
|
21369
|
+
);
|
|
21370
|
+
if (failed.size)
|
|
21371
|
+
getLogger().warn("[memory/remote-store] Failed to stamp topics:", [...failed.values()]);
|
|
21372
|
+
return ids.filter((id) => saved.has(id));
|
|
21373
|
+
},
|
|
21374
|
+
relinkTopics: () => Promise.resolve([]),
|
|
21375
|
+
backfillTopics: () => Promise.resolve([])
|
|
21072
21376
|
};
|
|
21073
21377
|
const everyState = {
|
|
21074
21378
|
include_deleted: true,
|
|
@@ -21147,6 +21451,7 @@ function createRemoteMemoryStore(options) {
|
|
|
21147
21451
|
};
|
|
21148
21452
|
return {
|
|
21149
21453
|
masksEmbeddingInput: embeddingOptions.maskInput !== void 0,
|
|
21454
|
+
topicMaintenance,
|
|
21150
21455
|
list: async (listOptions = {}) => (await listRows(decrypted, listOptions, listFilters(listOptions), maxOf(listOptions))).map(
|
|
21151
21456
|
(r) => stored(r.memory)
|
|
21152
21457
|
),
|
|
@@ -21231,7 +21536,7 @@ function createRemoteMemoryStore(options) {
|
|
|
21231
21536
|
const kind = patch.kind !== void 0 ? patch.kind : memory.kind;
|
|
21232
21537
|
assertValidKindLevel(kind, level);
|
|
21233
21538
|
memory.content = patch.content;
|
|
21234
|
-
memory.updated_at = Date.now();
|
|
21539
|
+
memory.updated_at = Math.max(Date.now(), (memory.topics_extracted_at ?? 0) + 1);
|
|
21235
21540
|
if (patch.level !== void 0) {
|
|
21236
21541
|
memory.level = level;
|
|
21237
21542
|
memory.scope = scopeForLevel(level);
|
package/dist/expo/index.d.mts
CHANGED
|
@@ -2592,12 +2592,10 @@ type StreamingTransportOptions = {
|
|
|
2592
2592
|
inferenceId: string;
|
|
2593
2593
|
}) => void;
|
|
2594
2594
|
/**
|
|
2595
|
-
* Fires
|
|
2596
|
-
*
|
|
2597
|
-
*
|
|
2598
|
-
*
|
|
2599
|
-
* apart from a dead connection (no bytes at all). Not every transport emits it
|
|
2600
|
-
* — the xhr transport does; treat its absence as "no extra liveness info".
|
|
2595
|
+
* Fires when the transport receives bytes, including SSE keep-alive comments.
|
|
2596
|
+
* Consumers can use this callback to reset the idle timeout.
|
|
2597
|
+
* The fetch and XHR transports emit it.
|
|
2598
|
+
* Custom transports can omit it if they cannot report byte activity.
|
|
2601
2599
|
*/
|
|
2602
2600
|
onActivity?: () => void;
|
|
2603
2601
|
};
|
|
@@ -6502,13 +6500,33 @@ interface MemorySubscribeOptions {
|
|
|
6502
6500
|
* from the main interface.
|
|
6503
6501
|
* @public
|
|
6504
6502
|
*/
|
|
6505
|
-
interface MemoryMaintenance {
|
|
6503
|
+
interface MemoryMaintenance extends MemoryTopicMaintenance {
|
|
6506
6504
|
/** Decay sweeper bound to this store's vault (see `createDecaySweeper`). */
|
|
6507
6505
|
createDecaySweeper(options?: Omit<CreateDecaySweeperOptions, "vaultCtx">): DecaySweeper;
|
|
6508
6506
|
/** One page of the topic-extraction backlog (see `getMemoriesNeedingTopicExtractionOp`). */
|
|
6509
6507
|
getTopicBacklog(options?: {
|
|
6510
6508
|
limit?: number;
|
|
6511
6509
|
}): Promise<MemoriesNeedingTopicExtraction>;
|
|
6510
|
+
}
|
|
6511
|
+
/** @public */
|
|
6512
|
+
interface MemoryTopicBacklog {
|
|
6513
|
+
pending: readonly {
|
|
6514
|
+
uniqueId: string;
|
|
6515
|
+
}[];
|
|
6516
|
+
linkedUnstamped: readonly string[];
|
|
6517
|
+
topicsToRelink: readonly string[];
|
|
6518
|
+
topicsBackfill: readonly string[];
|
|
6519
|
+
}
|
|
6520
|
+
/**
|
|
6521
|
+
* Topic-extraction upkeep for either backend. On a remote store `pending` carries ids only, the
|
|
6522
|
+
* other backlog lists are always empty, and `relinkTopics` / `backfillTopics` do nothing.
|
|
6523
|
+
* @public
|
|
6524
|
+
*/
|
|
6525
|
+
interface MemoryTopicMaintenance {
|
|
6526
|
+
/** One page of the topic-extraction backlog, edited or outdated rows first. */
|
|
6527
|
+
getTopicBacklog(options?: {
|
|
6528
|
+
limit?: number;
|
|
6529
|
+
}): Promise<MemoryTopicBacklog>;
|
|
6512
6530
|
/** LLM topic extraction + link + stamp for these memories. */
|
|
6513
6531
|
extractTopics(memoryIds: readonly string[], options: TopicExtractOptions & {
|
|
6514
6532
|
now?: number;
|
|
@@ -6585,6 +6603,8 @@ interface MemoryStore {
|
|
|
6585
6603
|
subscribe(onChange: () => void, options?: MemorySubscribeOptions): () => void;
|
|
6586
6604
|
/** TRANSITIONAL — see {@link MemoryMaintenance}. Absent on a remote backend. */
|
|
6587
6605
|
maintenance?: MemoryMaintenance;
|
|
6606
|
+
/** Topic-extraction upkeep, available on every backend. */
|
|
6607
|
+
readonly topicMaintenance: MemoryTopicMaintenance;
|
|
6588
6608
|
}
|
|
6589
6609
|
|
|
6590
6610
|
/**
|
|
@@ -11278,4 +11298,4 @@ interface UseChatStorageResult extends BaseUseChatStorageResult {
|
|
|
11278
11298
|
*/
|
|
11279
11299
|
declare function useChatStorage(options: UseChatStorageOptions): UseChatStorageResult;
|
|
11280
11300
|
|
|
11281
|
-
export { type AutoExtractMessage, type AutoExtractor, type Budget, CHUNKS_DISCARDED_ORIGIN, type CachedChunkVectors, type CachedServerTools, Conversation as ChatConversation, Message as ChatMessage, type ChatRole, type ChunkVectorCache, type ChunkingOptions, type ConsolidationAction, type ConsolidationFallbackReason, type ConversationMemoryInput, ConversationMemory as ConversationMemoryModel, type ConversationMemoryOperationsContext, type CreateAutoExtractorOptions, type CreateConversationOptions, type CreateDecaySweeperOptions, type CreateMessageOptions, type CreateVaultFolderOptions, type CreateVaultMemoryOptions, type CryptoPriceClassification, type CryptoPricePreProcessorOptions, DEFAULT_CACHE_EXPIRATION_MS, DEFAULT_CHUNK_CACHE_SIZE, DEFAULT_CHUNK_OVERLAP, DEFAULT_CHUNK_SIZE, DEFAULT_DECAY_POLICY, DEFAULT_MAX_CLASSIFIER_CALLS_PER_SWEEP, DEFAULT_MIN_CHUNK_SIZE, DEFAULT_PROFILE_FACETS, DEFAULT_PROFILE_FACT_TYPE_WEIGHTS, DEFAULT_PROFILE_PROOF_ALPHA, DEFAULT_PROFILE_TREND_MULTIPLIERS, DEFAULT_VAULT_CACHE_SIZE, DatabaseManager, type DatabaseManagerLogger, type DatabaseManagerOptions, type DecayCandidateRaw, type DecayClassifier, type DecayInput, type DecayPolicy, type DecaySweepResult, type DecaySweeper, type DecayVerdict, type DurableAutoExtractorOptions, ENTITY_FANOUT, type EmbeddedWalletSignerFn, EncryptionKeyMissingError, type ExtractFactsOptions, type ExtractOutcome, type ExtractedCandidate, type ExtractedEntity, type ExtractionCursorStore, type ExtractionFunnel, type ExtractionTimings, type FactType, type FileMetadata, type FileProcessingReason, type FileProcessingStatus, type FlushResult, type GetConversationsPageOptions, type GetMessagesPageOptions, type GraphTraversalOptions, HARD_DELETE_WINDOW_MS, INFERENCE_ID_HEADER, type InjectionClassifierOptions, type InjectionReason, type LazyStoredConversation, type LlmDecayClassifierOptions, type LlmNeighborRefinerOptions, type LocalMemoryStoreOptions, type Logger, LoggerProvider, type LoggerProviderProps, MAX_HOPS, MEDIUM_TTL_MS, MEMORY_KINDS, MEMORY_LEVELS, type ManualFactType, type MemoriesNeedingTopicExtraction, type MemoryContextItem, type MemoryContextLane, type MemoryContextOptions, type MemoryContextResult, type MemoryCreate, type EmbeddingOptions as MemoryEngineEmbeddingOptions, type MemoryEngineResult, type MemoryEngineSearchOptions, type MemoryExtractedEvent, MemoryKeyError, type MemoryKeyRing, type MemoryKind, type MemoryLevel, MemoryLevelError, type MemoryListOptions, type MemoryMaintenance, type MemoryQuarantinedEvent, type MemoryRecallOptions, type MemoryRetainOptions, type MemoryStore, type MemorySubscribeOptions, type MemoryToVerify, type MemoryTopic, type MemoryUpdate, type MemoryVaultSearchOptions, type MemoryVaultToolOptions, type MemoryVerification, type MessageRedactionResult, type MessageSkeleton, NEVER_TTL_MS, NODE_BUDGET, NOTION_OAUTH_CONFIG, type NeighborRefiner, type NotionAuthUrlParams, type NotionClientRegistration, type NotionExchangeCodeParams, type NotionMcpCaller, type NotionOAuthEndpoints, type NotionPKCEChallenge, type NotionRefreshTokenParams, type NotionTokenResponse, type NowSource, type ObservationTrend, type ObservationTrendInput, PAST_EVENT_GRACE_MS, PII_PATTERNS, PROFILE_DOC_VERSION, type PhotoIngestResult, type PhotoMediaRef, type PiiCategory, type PiiMatch, type PiiPattern, PiiRedactor, type PiiRedactorOptions, type PlatformStorage, type PortalLlmAuth, type PortalLlmFailure, type PortalLlmFailureReason, type ProfileConfigFingerprint, type ProfileDoc, type ProfileFacet, type ProfileFacetKey, type ProfileSalienceInput, type ProfileSection, type PromptPreProcessor, type PromptPreProcessorContext, type PublishedPhotoMemory, type QuantizedEmbedding, type QuarantinedMemoryInfo, QueueManager, type QueueStatus, RECALL_MAX_LIMIT, RECALL_TOOL_NAME, type RankableVaultMemory, type RankedMemory, type RankedProfileCandidate, type RecallContext, type RecallDegradation, type RecallDiagnostics, type RecallEmptyReason, type RecallOptions, type RecallResult, type RecallToolCallbacks, type RecallToolOptions, type RecencyOptions, type RedactionResult, type ReflectOptions, type ReflectResult, type RemoteMemoryCandidateOptions, type RemoteMemoryDecodeFailure, RemoteMemoryError, type RemoteMemoryListOptions, type RemoteMemoryMetadataPage, type RemoteMemoryMetadataRecord, type RemoteMemoryPage, RemoteMemoryPartialCreateError, type RemoteMemoryPersistence, type RemoteMemoryPersistenceOptions, type RemoteMemoryPipeline, type RemoteMemoryPipelineOptions, type RemoteMemoryQueryOptions, type RemoteMemoryQueryPage, type RemoteMemoryReadFilters, type RemoteMemoryRecord, type RemoteMemoryRow, type RemoteMemoryStoreOptions, type RequestEncryptionKeyOptions, RerankerUnavailableError, type ReservationReceipt, type ResumeStreamOptions, type ResumeStreamResult, type ResumeStreamWithStorageResult, type RetainAction, type RetainContext, type RetainOptions, type RetainResult, type RetainSource, SDK_SCHEMA_VERSION, SHORT_TTL_MS, STREAM_RESUMABLE_HEADER, type ScoreBreakdown, type ScoreProfileSalienceOptions, type ScreenResult, type ScreenedCandidate, type SearchSource, type SendMessageWithStorageArgs, type SendMessageWithStorageDetachedResult, type SendMessageWithStorageResult, type ServerToolsOptions, type ServerToolsResponse, type SignMessageFn, type StockPriceClassification, type StockPricePreProcessorOptions, type ChatCompletionUsage as StoredChatCompletionUsage, type StoredConversation, type StoredConversationMemory, type StoredMessage, type StoredMessageWithSimilarity, type StoredVaultFolder, VaultFolder as StoredVaultFolderModel, type StoredVaultMemory, VaultMemory as StoredVaultMemoryModel, StreamExpiredError, type StreamMetaEvent, type StreamResumeHandle, type StreamSmoothingConfig, type SynthesizeProfileOptions, TOOL_RESULT_ORIGIN, TOPICS_EXTRACTION_VERSION, TOPIC_EXTRACTION_BATCH_SIZE, TREND_RECENT_WINDOW_DAYS, TREND_STALE_WINDOW_DAYS, type TextChunk, type TopicExtractOptions, type TopicExtractionInput, type TopicExtractionRunResult, type TopicSkipReason, type TurnCompleteEvent, type TurnSkippedEvent, type UncheckedReason, type UnverifiableReason, type UpdateVaultFolderOptions, type UpdateVaultMemoryOptions, type UseChatStorageOptions, type UseChatStorageResult, type UseCreditsOptions, type UseCreditsResult, type UseModelsOptions, type UseModelsResult, VAULT_SIZE_HOP_CAP, type VaultEmbeddingCache, type VaultEmbeddingExpectation, type VaultFolderOperationsContext, type VaultMemoryKind, type VaultMemoryOperationsContext, type VaultMemoryProjection, type VaultMemoryVisibility, type VaultMemoryWriter, type VaultSaveOperation, type VaultSearchResult, type VaultWriteAction, type VaultWriteInput, type VaultWriteOutcome, type VerificationSources, type VerifyMemoriesForPublishOptions, WalletPoller, type WeatherClassification, type WeatherPreProcessorOptions, type WebSearchClassification, type WebSearchPreProcessorOptions, addConversationMemoriesOp, archiveVaultMemoryOp, assembleMemoryContext, attachFileContextToLastUserMessage, backfillMemoryTopicsOp, buildAttachedFilesText, buildNotionAuthUrl, capHopsForDensity, chatStorageMigrations, chatStorageSchema, chunkAndEmbedAllMessages, chunkAndEmbedMessage, chunkText, classifyCryptoPrice, classifyCryptoPriceBatch, classifyDecay, classifyInjectionCandidates, classifyObservationTrend, classifyStockPrice, classifyStockPriceBatch, classifyWeather, classifyWeatherBatch, classifyWebSearch, classifyWebSearchBatch, clearAllEncryptionKeys, clearAllEncryptionState, clearConversationMemoriesOp, clearEncryptionKey, clearLazyTitleCache, clearModelsCache, clearServerToolsCache, consoleLogger, conversationMemoryToStored, cosineInt8, createAutoExtractor, createChunkVectorCache, createCryptoPricePreProcessor, createDecaySweeper, createDurableAutoExtractor, createLlmDecayClassifier, createLlmNeighborRefiner, createLocalMemoryStore, createMemoryEngineTool, createMemoryVaultSearchTool, createMemoryVaultTool, createMessageSourceResolver, createNotionProxyTools, createNotionTools, createPlatformCursorStore, createRecallTool, createRemoteMemoryPersistence, createRemoteMemoryPipeline, createRemoteMemoryStore, createStockPricePreProcessor, createStreamingDeAnonymizer, createVaultEmbeddingCache, createVaultFolderOp, createVaultMemoriesBatchOp, createVaultMemoryOp, createWeatherPreProcessor, createWebSearchPreProcessor, decodeChunkVector, decryptConversationTitle, deleteAllVaultMemoriesForUserOp, deleteMessageOp, deleteVaultFolderOp, deleteVaultMemoryOp, dequantizeEmbedding, deriveKeyFromSignatureBytes, deriveMemoryKeyRing, discoverNotionOAuthEndpoints, eagerEmbedContent, embedAllMessages, embedMessage, encodeChunkVector, ensureDefaultFoldersOp, exchangeNotionCode, extractAndLinkEntitiesForMemoriesOp, extractAndRetain, extractEntitiesForMemories, extractFacts, extractReservationReceipts, formatFileProcessingNotes, generateConversationId, generateEmbedding, generateEmbeddings, generateNotionPKCE, getAllVaultFoldersOp, getAllVaultMemoriesOp, getAllVaultMemoryContentsOp, getCachedServerTools, getConversationMemoriesOp, getConversationsByProjectLazyOp, getConversationsLazyOp, getConversationsPageOp, getDecayCandidatesRawOp, getLogger, getMemoriesNeedingTopicExtractionOp, getServerTools, getUnfiledVaultMemoriesOp, getVaultFolderMemoryCountOp, getVaultMemoriesByIdsOp, getVaultMemoryOp, getVaultRankingProjectionsOp, hardDeleteDecayedOp, hasEncryptionKey, ingestPublishedPhotoMemoriesOp, injectionSignatureCatalog, isAttachedFilesText, isDegradedTopicSkip, isEncrypted, isPiiRedactor, isRerankerAvailable, maskScopedEmbeddingCache, memoryCipher, moveMemoriesToFolderOp, noopLogger, onKeyAvailable, parseMedia, preEmbedVaultMemories, quantizeEmbedding, queueManager, rankProfileCandidates, recall, reencryptMemoryField, reflect, refreshEncryptionKeyIfMatches, refreshNotionAccessToken, registerNotionClient, relinkMemoryTopicsOp, requestEncryptionKey, resolvePiiRedactor, restoreVaultMemoryOp, resumeStream, retain, scoreProfileSalience, screenCandidatesForInjection, sdkMigrations, sdkModelClasses, sdkSchema, searchVaultMemories, seedEncryptionKeys, setLogger, setMemoryVisibilityOp, shouldChunkMessage, shouldRecallMemory, stampTopicsExtractedAtOp, streamCancelPath, streamReplayPath, stripLegacyChunkTextOp, summarizeObservationTrends, supersedeVaultMemoryOp, synthesizeProfile, traverseGraphLane, ttlForType, updateVaultFolderContextOp, updateVaultFolderOp, updateVaultMemoryEmbeddingOp, updateVaultMemoryOp, upsertMessageOp, useChat, useChatStorage, useCredits, useEncryption, useModels, verifyMemoriesForPublish, xhrTransport };
|
|
11301
|
+
export { type AutoExtractMessage, type AutoExtractor, type Budget, CHUNKS_DISCARDED_ORIGIN, type CachedChunkVectors, type CachedServerTools, Conversation as ChatConversation, Message as ChatMessage, type ChatRole, type ChunkVectorCache, type ChunkingOptions, type ConsolidationAction, type ConsolidationFallbackReason, type ConversationMemoryInput, ConversationMemory as ConversationMemoryModel, type ConversationMemoryOperationsContext, type CreateAutoExtractorOptions, type CreateConversationOptions, type CreateDecaySweeperOptions, type CreateMessageOptions, type CreateVaultFolderOptions, type CreateVaultMemoryOptions, type CryptoPriceClassification, type CryptoPricePreProcessorOptions, DEFAULT_CACHE_EXPIRATION_MS, DEFAULT_CHUNK_CACHE_SIZE, DEFAULT_CHUNK_OVERLAP, DEFAULT_CHUNK_SIZE, DEFAULT_DECAY_POLICY, DEFAULT_MAX_CLASSIFIER_CALLS_PER_SWEEP, DEFAULT_MIN_CHUNK_SIZE, DEFAULT_PROFILE_FACETS, DEFAULT_PROFILE_FACT_TYPE_WEIGHTS, DEFAULT_PROFILE_PROOF_ALPHA, DEFAULT_PROFILE_TREND_MULTIPLIERS, DEFAULT_VAULT_CACHE_SIZE, DatabaseManager, type DatabaseManagerLogger, type DatabaseManagerOptions, type DecayCandidateRaw, type DecayClassifier, type DecayInput, type DecayPolicy, type DecaySweepResult, type DecaySweeper, type DecayVerdict, type DurableAutoExtractorOptions, ENTITY_FANOUT, type EmbeddedWalletSignerFn, EncryptionKeyMissingError, type ExtractFactsOptions, type ExtractOutcome, type ExtractedCandidate, type ExtractedEntity, type ExtractionCursorStore, type ExtractionFunnel, type ExtractionTimings, type FactType, type FileMetadata, type FileProcessingReason, type FileProcessingStatus, type FlushResult, type GetConversationsPageOptions, type GetMessagesPageOptions, type GraphTraversalOptions, HARD_DELETE_WINDOW_MS, INFERENCE_ID_HEADER, type InjectionClassifierOptions, type InjectionReason, type LazyStoredConversation, type LlmDecayClassifierOptions, type LlmNeighborRefinerOptions, type LocalMemoryStoreOptions, type Logger, LoggerProvider, type LoggerProviderProps, MAX_HOPS, MEDIUM_TTL_MS, MEMORY_KINDS, MEMORY_LEVELS, type ManualFactType, type MemoriesNeedingTopicExtraction, type MemoryContextItem, type MemoryContextLane, type MemoryContextOptions, type MemoryContextResult, type MemoryCreate, type EmbeddingOptions as MemoryEngineEmbeddingOptions, type MemoryEngineResult, type MemoryEngineSearchOptions, type MemoryExtractedEvent, MemoryKeyError, type MemoryKeyRing, type MemoryKind, type MemoryLevel, MemoryLevelError, type MemoryListOptions, type MemoryMaintenance, type MemoryQuarantinedEvent, type MemoryRecallOptions, type MemoryRetainOptions, type MemoryStore, type MemorySubscribeOptions, type MemoryToVerify, type MemoryTopic, type MemoryTopicBacklog, type MemoryTopicMaintenance, type MemoryUpdate, type MemoryVaultSearchOptions, type MemoryVaultToolOptions, type MemoryVerification, type MessageRedactionResult, type MessageSkeleton, NEVER_TTL_MS, NODE_BUDGET, NOTION_OAUTH_CONFIG, type NeighborRefiner, type NotionAuthUrlParams, type NotionClientRegistration, type NotionExchangeCodeParams, type NotionMcpCaller, type NotionOAuthEndpoints, type NotionPKCEChallenge, type NotionRefreshTokenParams, type NotionTokenResponse, type NowSource, type ObservationTrend, type ObservationTrendInput, PAST_EVENT_GRACE_MS, PII_PATTERNS, PROFILE_DOC_VERSION, type PhotoIngestResult, type PhotoMediaRef, type PiiCategory, type PiiMatch, type PiiPattern, PiiRedactor, type PiiRedactorOptions, type PlatformStorage, type PortalLlmAuth, type PortalLlmFailure, type PortalLlmFailureReason, type ProfileConfigFingerprint, type ProfileDoc, type ProfileFacet, type ProfileFacetKey, type ProfileSalienceInput, type ProfileSection, type PromptPreProcessor, type PromptPreProcessorContext, type PublishedPhotoMemory, type QuantizedEmbedding, type QuarantinedMemoryInfo, QueueManager, type QueueStatus, RECALL_MAX_LIMIT, RECALL_TOOL_NAME, type RankableVaultMemory, type RankedMemory, type RankedProfileCandidate, type RecallContext, type RecallDegradation, type RecallDiagnostics, type RecallEmptyReason, type RecallOptions, type RecallResult, type RecallToolCallbacks, type RecallToolOptions, type RecencyOptions, type RedactionResult, type ReflectOptions, type ReflectResult, type RemoteMemoryCandidateOptions, type RemoteMemoryDecodeFailure, RemoteMemoryError, type RemoteMemoryListOptions, type RemoteMemoryMetadataPage, type RemoteMemoryMetadataRecord, type RemoteMemoryPage, RemoteMemoryPartialCreateError, type RemoteMemoryPersistence, type RemoteMemoryPersistenceOptions, type RemoteMemoryPipeline, type RemoteMemoryPipelineOptions, type RemoteMemoryQueryOptions, type RemoteMemoryQueryPage, type RemoteMemoryReadFilters, type RemoteMemoryRecord, type RemoteMemoryRow, type RemoteMemoryStoreOptions, type RequestEncryptionKeyOptions, RerankerUnavailableError, type ReservationReceipt, type ResumeStreamOptions, type ResumeStreamResult, type ResumeStreamWithStorageResult, type RetainAction, type RetainContext, type RetainOptions, type RetainResult, type RetainSource, SDK_SCHEMA_VERSION, SHORT_TTL_MS, STREAM_RESUMABLE_HEADER, type ScoreBreakdown, type ScoreProfileSalienceOptions, type ScreenResult, type ScreenedCandidate, type SearchSource, type SendMessageWithStorageArgs, type SendMessageWithStorageDetachedResult, type SendMessageWithStorageResult, type ServerToolsOptions, type ServerToolsResponse, type SignMessageFn, type StockPriceClassification, type StockPricePreProcessorOptions, type ChatCompletionUsage as StoredChatCompletionUsage, type StoredConversation, type StoredConversationMemory, type StoredMessage, type StoredMessageWithSimilarity, type StoredVaultFolder, VaultFolder as StoredVaultFolderModel, type StoredVaultMemory, VaultMemory as StoredVaultMemoryModel, StreamExpiredError, type StreamMetaEvent, type StreamResumeHandle, type StreamSmoothingConfig, type SynthesizeProfileOptions, TOOL_RESULT_ORIGIN, TOPICS_EXTRACTION_VERSION, TOPIC_EXTRACTION_BATCH_SIZE, TREND_RECENT_WINDOW_DAYS, TREND_STALE_WINDOW_DAYS, type TextChunk, type TopicExtractOptions, type TopicExtractionInput, type TopicExtractionRunResult, type TopicSkipReason, type TurnCompleteEvent, type TurnSkippedEvent, type UncheckedReason, type UnverifiableReason, type UpdateVaultFolderOptions, type UpdateVaultMemoryOptions, type UseChatStorageOptions, type UseChatStorageResult, type UseCreditsOptions, type UseCreditsResult, type UseModelsOptions, type UseModelsResult, VAULT_SIZE_HOP_CAP, type VaultEmbeddingCache, type VaultEmbeddingExpectation, type VaultFolderOperationsContext, type VaultMemoryKind, type VaultMemoryOperationsContext, type VaultMemoryProjection, type VaultMemoryVisibility, type VaultMemoryWriter, type VaultSaveOperation, type VaultSearchResult, type VaultWriteAction, type VaultWriteInput, type VaultWriteOutcome, type VerificationSources, type VerifyMemoriesForPublishOptions, WalletPoller, type WeatherClassification, type WeatherPreProcessorOptions, type WebSearchClassification, type WebSearchPreProcessorOptions, addConversationMemoriesOp, archiveVaultMemoryOp, assembleMemoryContext, attachFileContextToLastUserMessage, backfillMemoryTopicsOp, buildAttachedFilesText, buildNotionAuthUrl, capHopsForDensity, chatStorageMigrations, chatStorageSchema, chunkAndEmbedAllMessages, chunkAndEmbedMessage, chunkText, classifyCryptoPrice, classifyCryptoPriceBatch, classifyDecay, classifyInjectionCandidates, classifyObservationTrend, classifyStockPrice, classifyStockPriceBatch, classifyWeather, classifyWeatherBatch, classifyWebSearch, classifyWebSearchBatch, clearAllEncryptionKeys, clearAllEncryptionState, clearConversationMemoriesOp, clearEncryptionKey, clearLazyTitleCache, clearModelsCache, clearServerToolsCache, consoleLogger, conversationMemoryToStored, cosineInt8, createAutoExtractor, createChunkVectorCache, createCryptoPricePreProcessor, createDecaySweeper, createDurableAutoExtractor, createLlmDecayClassifier, createLlmNeighborRefiner, createLocalMemoryStore, createMemoryEngineTool, createMemoryVaultSearchTool, createMemoryVaultTool, createMessageSourceResolver, createNotionProxyTools, createNotionTools, createPlatformCursorStore, createRecallTool, createRemoteMemoryPersistence, createRemoteMemoryPipeline, createRemoteMemoryStore, createStockPricePreProcessor, createStreamingDeAnonymizer, createVaultEmbeddingCache, createVaultFolderOp, createVaultMemoriesBatchOp, createVaultMemoryOp, createWeatherPreProcessor, createWebSearchPreProcessor, decodeChunkVector, decryptConversationTitle, deleteAllVaultMemoriesForUserOp, deleteMessageOp, deleteVaultFolderOp, deleteVaultMemoryOp, dequantizeEmbedding, deriveKeyFromSignatureBytes, deriveMemoryKeyRing, discoverNotionOAuthEndpoints, eagerEmbedContent, embedAllMessages, embedMessage, encodeChunkVector, ensureDefaultFoldersOp, exchangeNotionCode, extractAndLinkEntitiesForMemoriesOp, extractAndRetain, extractEntitiesForMemories, extractFacts, extractReservationReceipts, formatFileProcessingNotes, generateConversationId, generateEmbedding, generateEmbeddings, generateNotionPKCE, getAllVaultFoldersOp, getAllVaultMemoriesOp, getAllVaultMemoryContentsOp, getCachedServerTools, getConversationMemoriesOp, getConversationsByProjectLazyOp, getConversationsLazyOp, getConversationsPageOp, getDecayCandidatesRawOp, getLogger, getMemoriesNeedingTopicExtractionOp, getServerTools, getUnfiledVaultMemoriesOp, getVaultFolderMemoryCountOp, getVaultMemoriesByIdsOp, getVaultMemoryOp, getVaultRankingProjectionsOp, hardDeleteDecayedOp, hasEncryptionKey, ingestPublishedPhotoMemoriesOp, injectionSignatureCatalog, isAttachedFilesText, isDegradedTopicSkip, isEncrypted, isPiiRedactor, isRerankerAvailable, maskScopedEmbeddingCache, memoryCipher, moveMemoriesToFolderOp, noopLogger, onKeyAvailable, parseMedia, preEmbedVaultMemories, quantizeEmbedding, queueManager, rankProfileCandidates, recall, reencryptMemoryField, reflect, refreshEncryptionKeyIfMatches, refreshNotionAccessToken, registerNotionClient, relinkMemoryTopicsOp, requestEncryptionKey, resolvePiiRedactor, restoreVaultMemoryOp, resumeStream, retain, scoreProfileSalience, screenCandidatesForInjection, sdkMigrations, sdkModelClasses, sdkSchema, searchVaultMemories, seedEncryptionKeys, setLogger, setMemoryVisibilityOp, shouldChunkMessage, shouldRecallMemory, stampTopicsExtractedAtOp, streamCancelPath, streamReplayPath, stripLegacyChunkTextOp, summarizeObservationTrends, supersedeVaultMemoryOp, synthesizeProfile, traverseGraphLane, ttlForType, updateVaultFolderContextOp, updateVaultFolderOp, updateVaultMemoryEmbeddingOp, updateVaultMemoryOp, upsertMessageOp, useChat, useChatStorage, useCredits, useEncryption, useModels, verifyMemoriesForPublish, xhrTransport };
|