@anuma/sdk 6.40.0 → 6.42.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 +169 -83
- package/dist/expo/index.d.mts +38 -1
- package/dist/expo/index.d.ts +38 -1
- package/dist/expo/index.mjs +166 -83
- package/dist/memory/context.d.mts +2 -0
- package/dist/memory/context.d.ts +2 -0
- package/dist/react/index.cjs +131 -43
- package/dist/react/index.d.mts +38 -1
- package/dist/react/index.d.ts +38 -1
- package/dist/react/index.mjs +128 -43
- package/dist/server/index.cjs +108 -40
- package/dist/server/index.d.mts +16 -0
- package/dist/server/index.d.ts +16 -0
- package/dist/server/index.mjs +108 -40
- package/package.json +1 -1
package/dist/expo/index.cjs
CHANGED
|
@@ -1415,6 +1415,7 @@ __export(index_exports, {
|
|
|
1415
1415
|
TOOL_RESULT_ORIGIN: () => TOOL_RESULT_ORIGIN,
|
|
1416
1416
|
TOPICS_EXTRACTION_VERSION: () => TOPICS_EXTRACTION_VERSION,
|
|
1417
1417
|
TOPIC_EXTRACTION_BATCH_SIZE: () => TOPIC_EXTRACTION_BATCH_SIZE,
|
|
1418
|
+
TOPIC_SALIENCE_WEIGHTS: () => TOPIC_SALIENCE_WEIGHTS,
|
|
1418
1419
|
TREND_RECENT_WINDOW_DAYS: () => TREND_RECENT_WINDOW_DAYS,
|
|
1419
1420
|
TREND_STALE_WINDOW_DAYS: () => TREND_STALE_WINDOW_DAYS,
|
|
1420
1421
|
VAULT_SIZE_HOP_CAP: () => VAULT_SIZE_HOP_CAP,
|
|
@@ -1539,6 +1540,7 @@ __export(index_exports, {
|
|
|
1539
1540
|
onKeyAvailable: () => onKeyAvailable,
|
|
1540
1541
|
parseMedia: () => parseMedia,
|
|
1541
1542
|
preEmbedVaultMemories: () => preEmbedVaultMemories,
|
|
1543
|
+
primaryTopic: () => primaryTopic,
|
|
1542
1544
|
quantizeEmbedding: () => quantizeEmbedding,
|
|
1543
1545
|
queueManager: () => queueManager,
|
|
1544
1546
|
rankProfileCandidates: () => rankProfileCandidates,
|
|
@@ -1572,6 +1574,7 @@ __export(index_exports, {
|
|
|
1572
1574
|
summarizeObservationTrends: () => summarizeObservationTrends,
|
|
1573
1575
|
supersedeVaultMemoryOp: () => supersedeVaultMemoryOp,
|
|
1574
1576
|
synthesizeProfile: () => synthesizeProfile,
|
|
1577
|
+
topicWeight: () => topicWeight,
|
|
1575
1578
|
traverseGraphLane: () => traverseGraphLane,
|
|
1576
1579
|
ttlForType: () => ttlForType,
|
|
1577
1580
|
updateVaultFolderContextOp: () => updateVaultFolderContextOp,
|
|
@@ -10921,6 +10924,62 @@ async function clearConversationMemoriesOp(ctx, conversationId) {
|
|
|
10921
10924
|
});
|
|
10922
10925
|
}
|
|
10923
10926
|
|
|
10927
|
+
// src/lib/db/entities/types.ts
|
|
10928
|
+
var ENTITY_KINDS = [
|
|
10929
|
+
"person",
|
|
10930
|
+
"organization",
|
|
10931
|
+
"place",
|
|
10932
|
+
"event",
|
|
10933
|
+
"product",
|
|
10934
|
+
"thing",
|
|
10935
|
+
"concept",
|
|
10936
|
+
"other"
|
|
10937
|
+
];
|
|
10938
|
+
function normalizeEntityName(name) {
|
|
10939
|
+
return name.trim().toLowerCase();
|
|
10940
|
+
}
|
|
10941
|
+
var TOPIC_SALIENCE_WEIGHTS = { primary: 1, secondary: 0.6, mention: 0.3 };
|
|
10942
|
+
function topicWeight(topic) {
|
|
10943
|
+
return topic.source === "user" ? 1 : topic.weight ?? 1;
|
|
10944
|
+
}
|
|
10945
|
+
function primaryTopic(topics) {
|
|
10946
|
+
let best = null;
|
|
10947
|
+
for (const topic of topics ?? []) {
|
|
10948
|
+
if (best === null || topicWeight(topic) > topicWeight(best)) best = topic;
|
|
10949
|
+
}
|
|
10950
|
+
return best;
|
|
10951
|
+
}
|
|
10952
|
+
function parseTopicWeight(value) {
|
|
10953
|
+
return typeof value === "number" && value > 0 && value <= 1 ? value : void 0;
|
|
10954
|
+
}
|
|
10955
|
+
function serializeTopics(topics) {
|
|
10956
|
+
return JSON.stringify(topics);
|
|
10957
|
+
}
|
|
10958
|
+
function parseTopics(value) {
|
|
10959
|
+
if (typeof value !== "string" || value.length === 0) return null;
|
|
10960
|
+
let parsed;
|
|
10961
|
+
try {
|
|
10962
|
+
parsed = JSON.parse(value);
|
|
10963
|
+
} catch {
|
|
10964
|
+
return null;
|
|
10965
|
+
}
|
|
10966
|
+
if (!Array.isArray(parsed)) return null;
|
|
10967
|
+
const out = [];
|
|
10968
|
+
for (const raw of parsed) {
|
|
10969
|
+
if (typeof raw !== "object" || raw === null) continue;
|
|
10970
|
+
const { name, kind, source, weight } = raw;
|
|
10971
|
+
if (typeof name !== "string" || name.trim().length === 0) continue;
|
|
10972
|
+
const parsedWeight = parseTopicWeight(weight);
|
|
10973
|
+
out.push({
|
|
10974
|
+
name,
|
|
10975
|
+
...typeof kind === "string" && kind.length > 0 ? { kind } : {},
|
|
10976
|
+
source: source === "user" ? "user" : "auto",
|
|
10977
|
+
...parsedWeight !== void 0 ? { weight: parsedWeight } : {}
|
|
10978
|
+
});
|
|
10979
|
+
}
|
|
10980
|
+
return out;
|
|
10981
|
+
}
|
|
10982
|
+
|
|
10924
10983
|
// src/lib/db/manager.ts
|
|
10925
10984
|
var import_watermelondb18 = require("@nozbe/watermelondb");
|
|
10926
10985
|
|
|
@@ -12273,48 +12332,6 @@ init_logger();
|
|
|
12273
12332
|
|
|
12274
12333
|
// src/lib/db/entities/operations.ts
|
|
12275
12334
|
var import_watermelondb19 = require("@nozbe/watermelondb");
|
|
12276
|
-
|
|
12277
|
-
// src/lib/db/entities/types.ts
|
|
12278
|
-
var ENTITY_KINDS = [
|
|
12279
|
-
"person",
|
|
12280
|
-
"organization",
|
|
12281
|
-
"place",
|
|
12282
|
-
"event",
|
|
12283
|
-
"product",
|
|
12284
|
-
"thing",
|
|
12285
|
-
"concept",
|
|
12286
|
-
"other"
|
|
12287
|
-
];
|
|
12288
|
-
function normalizeEntityName(name) {
|
|
12289
|
-
return name.trim().toLowerCase();
|
|
12290
|
-
}
|
|
12291
|
-
function serializeTopics(topics) {
|
|
12292
|
-
return JSON.stringify(topics);
|
|
12293
|
-
}
|
|
12294
|
-
function parseTopics(value) {
|
|
12295
|
-
if (typeof value !== "string" || value.length === 0) return null;
|
|
12296
|
-
let parsed;
|
|
12297
|
-
try {
|
|
12298
|
-
parsed = JSON.parse(value);
|
|
12299
|
-
} catch {
|
|
12300
|
-
return null;
|
|
12301
|
-
}
|
|
12302
|
-
if (!Array.isArray(parsed)) return null;
|
|
12303
|
-
const out = [];
|
|
12304
|
-
for (const raw of parsed) {
|
|
12305
|
-
if (typeof raw !== "object" || raw === null) continue;
|
|
12306
|
-
const { name, kind, source } = raw;
|
|
12307
|
-
if (typeof name !== "string" || name.trim().length === 0) continue;
|
|
12308
|
-
out.push({
|
|
12309
|
-
name,
|
|
12310
|
-
...typeof kind === "string" && kind.length > 0 ? { kind } : {},
|
|
12311
|
-
source: source === "user" ? "user" : "auto"
|
|
12312
|
-
});
|
|
12313
|
-
}
|
|
12314
|
-
return out;
|
|
12315
|
-
}
|
|
12316
|
-
|
|
12317
|
-
// src/lib/db/entities/operations.ts
|
|
12318
12335
|
function entityToStored(e) {
|
|
12319
12336
|
return {
|
|
12320
12337
|
uniqueId: e.id,
|
|
@@ -12395,21 +12412,47 @@ function displayNamesOf(entities) {
|
|
|
12395
12412
|
}
|
|
12396
12413
|
function topicsEqual(stored2, computed) {
|
|
12397
12414
|
if (stored2 === null || stored2.length !== computed.length) return false;
|
|
12398
|
-
const key = (t) => JSON.stringify([t.name, t.kind ?? null, t.source]);
|
|
12415
|
+
const key = (t) => JSON.stringify([t.name, t.kind ?? null, t.source, t.weight ?? null]);
|
|
12399
12416
|
const storedKeys = stored2.map(key).sort();
|
|
12400
12417
|
const computedKeys = computed.map(key).sort();
|
|
12401
12418
|
return storedKeys.every((k, i) => k === computedKeys[i]);
|
|
12402
12419
|
}
|
|
12403
|
-
function resolveTopicsWrite(row, linked,
|
|
12420
|
+
function resolveTopicsWrite(row, linked, inputs, source, mode) {
|
|
12404
12421
|
if (row === null || source === null) return null;
|
|
12405
|
-
const
|
|
12406
|
-
|
|
12422
|
+
const stored2 = parseTopics(row.topics);
|
|
12423
|
+
const carried = mode === "merge" ? stored2 : null;
|
|
12424
|
+
const weights = source === "auto" ? weightsOf(carried, inputs) : null;
|
|
12425
|
+
const displayNames = displayNamesOf([...inputs, ...carried ?? []]);
|
|
12426
|
+
const topics = topicsForEntities(linked, displayNames, source, weights);
|
|
12427
|
+
if (topicsEqual(stored2, topics)) return null;
|
|
12407
12428
|
return { row, topics };
|
|
12408
12429
|
}
|
|
12409
|
-
function
|
|
12430
|
+
function weightsOf(stored2, inputs) {
|
|
12431
|
+
const out = /* @__PURE__ */ new Map();
|
|
12432
|
+
for (const topic of stored2 ?? []) out.set(normalizeEntityName(topic.name), topic.weight);
|
|
12433
|
+
for (const input of inputs) {
|
|
12434
|
+
const weight = parseTopicWeight(input.weight);
|
|
12435
|
+
if (weight === void 0) continue;
|
|
12436
|
+
const name = normalizeEntityName(input.name);
|
|
12437
|
+
if (!out.has(name)) {
|
|
12438
|
+
out.set(name, weight);
|
|
12439
|
+
continue;
|
|
12440
|
+
}
|
|
12441
|
+
const current = out.get(name);
|
|
12442
|
+
if (current !== void 0 && weight > current) out.set(name, weight);
|
|
12443
|
+
}
|
|
12444
|
+
return out;
|
|
12445
|
+
}
|
|
12446
|
+
function topicsForEntities(entities, displayNames, source, weights) {
|
|
12410
12447
|
return entities.map((e) => {
|
|
12411
12448
|
const name = displayNames.get(e.canonicalName) ?? e.canonicalName;
|
|
12412
|
-
|
|
12449
|
+
const weight = weights?.get(e.canonicalName);
|
|
12450
|
+
return {
|
|
12451
|
+
name,
|
|
12452
|
+
...e.kind ? { kind: e.kind } : {},
|
|
12453
|
+
source,
|
|
12454
|
+
...weight !== void 0 ? { weight } : {}
|
|
12455
|
+
};
|
|
12413
12456
|
});
|
|
12414
12457
|
}
|
|
12415
12458
|
function toEntityObjects(entityInputs) {
|
|
@@ -12417,7 +12460,7 @@ function toEntityObjects(entityInputs) {
|
|
|
12417
12460
|
}
|
|
12418
12461
|
async function resolveMemoryTopicsWrite(ctx, memoryId, linked, inputs, source) {
|
|
12419
12462
|
const row = await findVaultRowInWrite(ctx, memoryId);
|
|
12420
|
-
return resolveTopicsWrite(row, linked,
|
|
12463
|
+
return resolveTopicsWrite(row, linked, toEntityObjects(inputs), source, "replace");
|
|
12421
12464
|
}
|
|
12422
12465
|
function prepareMemoryTopicsUpdate(write) {
|
|
12423
12466
|
return prepareTopicsUpdate(write.row, write.topics, Date.now());
|
|
@@ -12455,8 +12498,9 @@ async function linkMemoryEntitiesOp(ctx, memoryId, entityInputs, options) {
|
|
|
12455
12498
|
const topicsWrite = resolveTopicsWrite(
|
|
12456
12499
|
vaultRow,
|
|
12457
12500
|
[...carriedOver, ...entities],
|
|
12458
|
-
|
|
12459
|
-
options?.topicsSource ?? "auto"
|
|
12501
|
+
normalized,
|
|
12502
|
+
options?.topicsSource ?? "auto",
|
|
12503
|
+
"merge"
|
|
12460
12504
|
);
|
|
12461
12505
|
if (entityOps.length === 0 && kindBackfills.length === 0 && toCreate.length === 0 && topicsWrite === null) {
|
|
12462
12506
|
return;
|
|
@@ -12522,8 +12566,9 @@ async function replaceMemoryEntities(ctx, memoryId, entityInputs, options) {
|
|
|
12522
12566
|
const topicsWrite = resolveTopicsWrite(
|
|
12523
12567
|
vaultRow,
|
|
12524
12568
|
entities,
|
|
12525
|
-
|
|
12526
|
-
options.topicsSource
|
|
12569
|
+
normalized,
|
|
12570
|
+
options.topicsSource,
|
|
12571
|
+
"replace"
|
|
12527
12572
|
);
|
|
12528
12573
|
if (entityOps.length === 0 && kindBackfills.length === 0 && toCreate.length === 0 && toDestroy.length === 0 && topicsWrite === null) {
|
|
12529
12574
|
return;
|
|
@@ -17348,9 +17393,9 @@ For each durable fact, output:
|
|
|
17348
17393
|
- type: one of identity | preference | relationship | plan | ongoing_context | constraint | other
|
|
17349
17394
|
- confidence: 0.0-1.0; how sure you are this is durable AND true. Only include facts >= 0.7.
|
|
17350
17395
|
- sourceMessageIds: which message IDs from the conversation contained the evidence
|
|
17351
|
-
- entities: named entities mentioned, each as an object { "name": string, "kind": one of "person" | "organization" | "place" | "event" | "product" | "thing" | "concept" | "other" }. Optional \u2014 include only NAMED entities, skip generic/common nouns. ${ENTITY_KIND_GUIDELINES} Examples:
|
|
17352
|
-
- "started a new job at Hollowpoint Labs and I'm learning Haskell for it" \u2192 entities: [{ "name": "Hollowpoint Labs", "kind": "organization" }, { "name": "Haskell", "kind": "concept" }]
|
|
17353
|
-
- "running the Berlin Half in May and I track workouts in Whoop" \u2192 entities: [{ "name": "Berlin Half", "kind": "event" }, { "name": "Whoop", "kind": "product" }]
|
|
17396
|
+
- entities: named entities mentioned, each as an object { "name": string, "kind": one of "person" | "organization" | "place" | "event" | "product" | "thing" | "concept" | "other", "salience": one of "primary" | "secondary" | "mention" }. Optional \u2014 include only NAMED entities, skip generic/common nouns. ${ENTITY_KIND_GUIDELINES} Salience is how central the entity is to the fact: "primary" = the fact is ABOUT it (usually exactly one per fact), "secondary" = a meaningful part of it, "mention" = named in passing. Examples:
|
|
17397
|
+
- "started a new job at Hollowpoint Labs and I'm learning Haskell for it" \u2192 entities: [{ "name": "Hollowpoint Labs", "kind": "organization", "salience": "primary" }, { "name": "Haskell", "kind": "concept", "salience": "secondary" }]
|
|
17398
|
+
- "running the Berlin Half in May and I track workouts in Whoop" \u2192 entities: [{ "name": "Berlin Half", "kind": "event", "salience": "primary" }, { "name": "Whoop", "kind": "product", "salience": "mention" }]
|
|
17354
17399
|
- eventTime: when the event in this fact occurs/occurred. Resolve relative phrases ("yesterday", "next week") against the current date given in the user message. Output one of:
|
|
17355
17400
|
- { "kind": "point", "start": "YYYY-MM-DD" } for a single date ("met Sara on March 14, 2026")
|
|
17356
17401
|
- { "kind": "range", "start": "YYYY-MM-DD", "end": "YYYY-MM-DD" } for a span ("Japan trip May 4\u201315, 2026")
|
|
@@ -17431,9 +17476,10 @@ function restoreCandidates(candidates, redactor, ownNames) {
|
|
|
17431
17476
|
candidate: {
|
|
17432
17477
|
...c,
|
|
17433
17478
|
content: content.text,
|
|
17434
|
-
entities: c.entities.
|
|
17435
|
-
|
|
17436
|
-
|
|
17479
|
+
entities: c.entities.flatMap((e) => {
|
|
17480
|
+
const restored = redactor.restoreForStorage(e.name);
|
|
17481
|
+
return restored.unresolved ? [] : [{ ...e, name: restored.text }];
|
|
17482
|
+
})
|
|
17437
17483
|
},
|
|
17438
17484
|
unresolved: content.unresolved
|
|
17439
17485
|
};
|
|
@@ -17662,7 +17708,12 @@ function parseEntities(raw) {
|
|
|
17662
17708
|
const name = typeof obj.name === "string" ? obj.name.trim() : "";
|
|
17663
17709
|
if (name.length === 0 || isGenericEntityName(name)) continue;
|
|
17664
17710
|
const kind = typeof obj.kind === "string" && ENTITY_KINDS.includes(obj.kind) ? obj.kind : void 0;
|
|
17665
|
-
|
|
17711
|
+
const weight = typeof obj.salience === "string" && Object.keys(TOPIC_SALIENCE_WEIGHTS).includes(obj.salience) ? TOPIC_SALIENCE_WEIGHTS[obj.salience] : void 0;
|
|
17712
|
+
out.push({
|
|
17713
|
+
name,
|
|
17714
|
+
...kind !== void 0 ? { kind } : {},
|
|
17715
|
+
...weight !== void 0 ? { weight } : {}
|
|
17716
|
+
});
|
|
17666
17717
|
}
|
|
17667
17718
|
return out;
|
|
17668
17719
|
}
|
|
@@ -19642,7 +19693,13 @@ Include only NAMED entities, skip generic/common nouns. A topic must identify a
|
|
|
19642
19693
|
- Prefer 0 entities over a weak one. A memory whose only candidate is a generic noun has NO entities.
|
|
19643
19694
|
${ENTITY_KIND_GUIDELINES}
|
|
19644
19695
|
|
|
19645
|
-
|
|
19696
|
+
Give each entity a "salience" \u2014 how central it is to the memory:
|
|
19697
|
+
- "primary": the memory is ABOUT it. A memory with entities usually has exactly one primary; never more than two.
|
|
19698
|
+
- "secondary": a meaningful part of the memory, but not its subject.
|
|
19699
|
+
- "mention": named in passing; the memory would say much the same without it.
|
|
19700
|
+
Example: "Ran the Chicago Marathon with my sister Ana in 3:41" \u2192 Chicago Marathon primary, Ana secondary.
|
|
19701
|
+
|
|
19702
|
+
Each memory below is written as "<id>: <text>". Output strict JSON: {"memories": [{"id": string, "entities": [{"name": string, "kind": string, "salience": "primary" | "secondary" | "mention"}]}]}
|
|
19646
19703
|
- exactly one element per input memory; copy its id EXACTLY as written (the token before the first ": "), with no brackets, quotes, or extra characters
|
|
19647
19704
|
- "entities" may be empty when a memory mentions no named entities \u2014 most short memories have 0-3
|
|
19648
19705
|
No prose.`;
|
|
@@ -19713,9 +19770,10 @@ List each memory's named entities.`,
|
|
|
19713
19770
|
return out;
|
|
19714
19771
|
}
|
|
19715
19772
|
function restoreEntities(entities, redactor) {
|
|
19716
|
-
return entities.
|
|
19717
|
-
|
|
19718
|
-
|
|
19773
|
+
return entities.flatMap((e) => {
|
|
19774
|
+
const restored = redactor.restoreForStorage(e.name);
|
|
19775
|
+
return restored.unresolved ? [] : [{ ...e, name: restored.text }];
|
|
19776
|
+
});
|
|
19719
19777
|
}
|
|
19720
19778
|
function parseTopicResponse(parsed, validIds) {
|
|
19721
19779
|
if (typeof parsed !== "object" || parsed === null) return null;
|
|
@@ -21004,19 +21062,23 @@ function topicInputs(topics, source) {
|
|
|
21004
21062
|
return topics.flatMap((topic) => {
|
|
21005
21063
|
const name = (typeof topic === "string" ? topic : topic.name).trim();
|
|
21006
21064
|
const kind = typeof topic === "string" ? void 0 : topic.kind;
|
|
21007
|
-
|
|
21065
|
+
const weight = typeof topic === "string" || source === "user" ? void 0 : parseTopicWeight(topic.weight);
|
|
21066
|
+
return name ? [{ name, ...kind && { kind }, source, ...weight && { weight } }] : [];
|
|
21008
21067
|
});
|
|
21009
21068
|
}
|
|
21010
21069
|
function mergeTopics(existing, added) {
|
|
21011
21070
|
const byName = /* @__PURE__ */ new Map();
|
|
21012
21071
|
for (const topic of [...existing, ...added]) {
|
|
21013
21072
|
const key = normalizeEntityName(topic.name);
|
|
21014
|
-
|
|
21073
|
+
const kept = byName.get(key);
|
|
21074
|
+
if (!kept) byName.set(key, topic);
|
|
21075
|
+
else if (kept.weight !== void 0 && topic.weight !== void 0 && topic.weight > kept.weight)
|
|
21076
|
+
byName.set(key, { ...kept, weight: topic.weight });
|
|
21015
21077
|
}
|
|
21016
21078
|
return [...byName.values()];
|
|
21017
21079
|
}
|
|
21018
21080
|
function sameTopics(stored2, next) {
|
|
21019
|
-
const key = (t) => JSON.stringify([t.name, t.kind ?? null, t.source]);
|
|
21081
|
+
const key = (t) => JSON.stringify([t.name, t.kind ?? null, t.source, t.weight ?? null]);
|
|
21020
21082
|
if (stored2 === null || stored2.length !== next.length) return false;
|
|
21021
21083
|
const keys = new Set(stored2.map(key));
|
|
21022
21084
|
return next.every((t) => keys.has(key(t)));
|
|
@@ -21781,12 +21843,19 @@ var FACET_STRUCTURED_RESPONSE_HINT = {
|
|
|
21781
21843
|
interests: `, "interests": <the same interests as an array of at most ${NEARBY_MAX_INTERESTS} strings of at most ${NEARBY_MAX_INTEREST_CODEPOINTS} characters each, e.g. ["trail running", "film photography"], or []>`
|
|
21782
21844
|
};
|
|
21783
21845
|
async function synthesizeProfile(ctx, options = {}) {
|
|
21784
|
-
|
|
21785
|
-
|
|
21846
|
+
const { store } = options;
|
|
21847
|
+
const vaultCtx = ctx.vaultCtx;
|
|
21848
|
+
if (!store && !vaultCtx) {
|
|
21849
|
+
throw new Error(
|
|
21850
|
+
"synthesizeProfile requires options.store or ctx.vaultCtx (vault-backed facts)."
|
|
21851
|
+
);
|
|
21786
21852
|
}
|
|
21787
|
-
if (!ctx.vaultCache) {
|
|
21788
|
-
throw new Error(
|
|
21853
|
+
if (!store && !ctx.vaultCache) {
|
|
21854
|
+
throw new Error(
|
|
21855
|
+
"synthesizeProfile requires options.store or ctx.vaultCache (semantic fact recall)."
|
|
21856
|
+
);
|
|
21789
21857
|
}
|
|
21858
|
+
const recallCtx = store ? { embeddingOptions: ctx.embeddingOptions, factSource: store.factSource } : ctx;
|
|
21790
21859
|
const facets = options.facets ?? DEFAULT_PROFILE_FACETS;
|
|
21791
21860
|
const scopes = options.scopes ?? DEFAULT_SCOPES;
|
|
21792
21861
|
const config = {
|
|
@@ -21797,11 +21866,8 @@ async function synthesizeProfile(ctx, options = {}) {
|
|
|
21797
21866
|
reviewedMemoryIdsSignature: reviewedMemoryIdsSignature(options.reviewedMemoryIds)
|
|
21798
21867
|
};
|
|
21799
21868
|
const previous = options.previous && options.previous.version === PROFILE_DOC_VERSION && configMatches(options.previous.config, config) ? options.previous : void 0;
|
|
21800
|
-
const
|
|
21801
|
-
|
|
21802
|
-
includeDeleted: true,
|
|
21803
|
-
includeSuperseded: true
|
|
21804
|
-
});
|
|
21869
|
+
const listOptions = { scopes, includeDeleted: true, includeSuperseded: true };
|
|
21870
|
+
const [memories, projections] = store ? await Promise.all([store.list(listOptions), store.listProjections(listOptions)]) : [await getAllVaultMemoriesOp(vaultCtx, listOptions), []];
|
|
21805
21871
|
const watermark = computeVaultWatermark(memories);
|
|
21806
21872
|
const observationTrends = summarizeObservationTrends(
|
|
21807
21873
|
memories.filter((m) => !m.isDeleted && m.supersededBy === null).map((m) => ({
|
|
@@ -21811,11 +21877,14 @@ async function synthesizeProfile(ctx, options = {}) {
|
|
|
21811
21877
|
}))
|
|
21812
21878
|
);
|
|
21813
21879
|
const presentIds = new Set(memories.map((m) => m.uniqueId));
|
|
21880
|
+
const unreadableMemoryIds = projections.map((p) => p.uniqueId).filter((id) => !presentIds.has(id)).sort();
|
|
21881
|
+
const previousUnreadable = new Set(previous?.unreadableMemoryIds ?? []);
|
|
21882
|
+
const sameUnreadable = unreadableMemoryIds.length === previousUnreadable.size && unreadableMemoryIds.every((id) => previousUnreadable.has(id));
|
|
21814
21883
|
const hasStaleSections = previous?.sections.some((s) => s.stale);
|
|
21815
21884
|
const citesMissingFact = previous?.sections.some(
|
|
21816
21885
|
(s) => s.sourceMemoryIds.some((id) => !presentIds.has(id))
|
|
21817
21886
|
);
|
|
21818
|
-
if (previous && previous.vaultWatermark === watermark && !hasStaleSections && !citesMissingFact) {
|
|
21887
|
+
if (previous && previous.vaultWatermark === watermark && !hasStaleSections && !citesMissingFact && sameUnreadable) {
|
|
21819
21888
|
const sameOrder = previous.sections.length === facets.length && facets.every((f, i) => previous.sections[i]?.key === f.key);
|
|
21820
21889
|
if (sameOrder) {
|
|
21821
21890
|
if (trendsEqual(previous.observationTrends, observationTrends)) return previous;
|
|
@@ -21828,12 +21897,13 @@ async function synthesizeProfile(ctx, options = {}) {
|
|
|
21828
21897
|
};
|
|
21829
21898
|
}
|
|
21830
21899
|
const staleKeys = await computeStaleFacetKeys(
|
|
21831
|
-
|
|
21900
|
+
recallCtx,
|
|
21832
21901
|
memories,
|
|
21833
21902
|
facets,
|
|
21834
21903
|
previous,
|
|
21835
21904
|
watermark,
|
|
21836
|
-
options.reviewedMemoryIds
|
|
21905
|
+
options.reviewedMemoryIds,
|
|
21906
|
+
previousUnreadable
|
|
21837
21907
|
);
|
|
21838
21908
|
const memoriesById = new Map(memories.map((memory) => [memory.uniqueId, memory]));
|
|
21839
21909
|
const fallbackPriors = /* @__PURE__ */ new Map();
|
|
@@ -21853,7 +21923,7 @@ async function synthesizeProfile(ctx, options = {}) {
|
|
|
21853
21923
|
if (prior && !staleKeys.has(facet.key)) {
|
|
21854
21924
|
return prior;
|
|
21855
21925
|
}
|
|
21856
|
-
return synthesizeFacet(facet,
|
|
21926
|
+
return synthesizeFacet(facet, recallCtx, options, fallbackPriors.get(facet.key));
|
|
21857
21927
|
})
|
|
21858
21928
|
);
|
|
21859
21929
|
const sections = settled.map((r, i) => {
|
|
@@ -21868,12 +21938,18 @@ async function synthesizeProfile(ctx, options = {}) {
|
|
|
21868
21938
|
);
|
|
21869
21939
|
return fallbackSection(facet, fallbackPriors.get(facet.key));
|
|
21870
21940
|
});
|
|
21941
|
+
if (!sameUnreadable && unreadableMemoryIds.length > 0) {
|
|
21942
|
+
getLogger().warn("[memory/synthesizeProfile] some memories could not be read", {
|
|
21943
|
+
unreadable: unreadableMemoryIds.length
|
|
21944
|
+
});
|
|
21945
|
+
}
|
|
21871
21946
|
return {
|
|
21872
21947
|
version: PROFILE_DOC_VERSION,
|
|
21873
21948
|
sections,
|
|
21874
21949
|
vaultWatermark: watermark,
|
|
21875
21950
|
config,
|
|
21876
21951
|
observationTrends,
|
|
21952
|
+
...unreadableMemoryIds.length > 0 && { unreadableMemoryIds },
|
|
21877
21953
|
generatedAt: Date.now()
|
|
21878
21954
|
};
|
|
21879
21955
|
}
|
|
@@ -21907,11 +21983,13 @@ function computeVaultWatermark(memories) {
|
|
|
21907
21983
|
}
|
|
21908
21984
|
return max;
|
|
21909
21985
|
}
|
|
21910
|
-
async function computeStaleFacetKeys(ctx, memories, facets, previous, watermark, reviewedMemoryIds) {
|
|
21986
|
+
async function computeStaleFacetKeys(ctx, memories, facets, previous, watermark, reviewedMemoryIds, previouslyUnreadable) {
|
|
21911
21987
|
const allKeys = new Set(facets.map((f) => f.key));
|
|
21912
21988
|
if (previous && watermark < previous.vaultWatermark) return allKeys;
|
|
21913
21989
|
if (!previous) return allKeys;
|
|
21914
|
-
const changed = memories.filter(
|
|
21990
|
+
const changed = memories.filter(
|
|
21991
|
+
(m) => changeTime(m) > previous.vaultWatermark || previouslyUnreadable.has(m.uniqueId)
|
|
21992
|
+
);
|
|
21915
21993
|
const changedIds = new Set(changed.map((m) => m.uniqueId));
|
|
21916
21994
|
const presentIds = new Set(memories.map((m) => m.uniqueId));
|
|
21917
21995
|
const stale = /* @__PURE__ */ new Set();
|
|
@@ -21985,7 +22063,12 @@ async function attributeFacts(ctx, candidates, facets) {
|
|
|
21985
22063
|
for (const fv of factVectors) {
|
|
21986
22064
|
let matchedAny = false;
|
|
21987
22065
|
for (let i = 0; i < facets.length; i++) {
|
|
21988
|
-
|
|
22066
|
+
const query = queryVectors[i];
|
|
22067
|
+
const similarity = cosineSimilarity(
|
|
22068
|
+
fv,
|
|
22069
|
+
fv.length < query.length ? query.slice(0, fv.length) : query
|
|
22070
|
+
);
|
|
22071
|
+
if (similarity >= NEW_FACT_ATTRIBUTION_MIN_SCORE) {
|
|
21989
22072
|
keys.add(facets[i].key);
|
|
21990
22073
|
matchedAny = true;
|
|
21991
22074
|
}
|
|
@@ -27954,6 +28037,7 @@ function useChatStorage(options) {
|
|
|
27954
28037
|
TOOL_RESULT_ORIGIN,
|
|
27955
28038
|
TOPICS_EXTRACTION_VERSION,
|
|
27956
28039
|
TOPIC_EXTRACTION_BATCH_SIZE,
|
|
28040
|
+
TOPIC_SALIENCE_WEIGHTS,
|
|
27957
28041
|
TREND_RECENT_WINDOW_DAYS,
|
|
27958
28042
|
TREND_STALE_WINDOW_DAYS,
|
|
27959
28043
|
VAULT_SIZE_HOP_CAP,
|
|
@@ -28078,6 +28162,7 @@ function useChatStorage(options) {
|
|
|
28078
28162
|
onKeyAvailable,
|
|
28079
28163
|
parseMedia,
|
|
28080
28164
|
preEmbedVaultMemories,
|
|
28165
|
+
primaryTopic,
|
|
28081
28166
|
quantizeEmbedding,
|
|
28082
28167
|
queueManager,
|
|
28083
28168
|
rankProfileCandidates,
|
|
@@ -28111,6 +28196,7 @@ function useChatStorage(options) {
|
|
|
28111
28196
|
summarizeObservationTrends,
|
|
28112
28197
|
supersedeVaultMemoryOp,
|
|
28113
28198
|
synthesizeProfile,
|
|
28199
|
+
topicWeight,
|
|
28114
28200
|
traverseGraphLane,
|
|
28115
28201
|
ttlForType,
|
|
28116
28202
|
updateVaultFolderContextOp,
|
package/dist/expo/index.d.mts
CHANGED
|
@@ -3201,7 +3201,30 @@ interface StoredTopic {
|
|
|
3201
3201
|
name: string;
|
|
3202
3202
|
kind?: string;
|
|
3203
3203
|
source: TopicSource;
|
|
3204
|
+
/** How central the topic is to the memory, in (0, 1]; read it with {@link topicWeight}. */
|
|
3205
|
+
weight?: number;
|
|
3204
3206
|
}
|
|
3207
|
+
/**
|
|
3208
|
+
* Fixed weight per salience level the topic extractor assigns.
|
|
3209
|
+
* @public
|
|
3210
|
+
*/
|
|
3211
|
+
declare const TOPIC_SALIENCE_WEIGHTS: {
|
|
3212
|
+
readonly primary: 1;
|
|
3213
|
+
readonly secondary: 0.6;
|
|
3214
|
+
readonly mention: 0.3;
|
|
3215
|
+
};
|
|
3216
|
+
/** @public */
|
|
3217
|
+
type TopicSalience = keyof typeof TOPIC_SALIENCE_WEIGHTS;
|
|
3218
|
+
/**
|
|
3219
|
+
* A topic's weight: 1 when it is user-set or carries no weight.
|
|
3220
|
+
* @public
|
|
3221
|
+
*/
|
|
3222
|
+
declare function topicWeight(topic: StoredTopic): number;
|
|
3223
|
+
/**
|
|
3224
|
+
* The first topic with the highest weight, or null when there are none.
|
|
3225
|
+
* @public
|
|
3226
|
+
*/
|
|
3227
|
+
declare function primaryTopic(topics: readonly StoredTopic[] | null | undefined): StoredTopic | null;
|
|
3205
3228
|
|
|
3206
3229
|
/**
|
|
3207
3230
|
* Accepted entity shape for {@link linkMemoryEntitiesOp}. A bare string is
|
|
@@ -3212,6 +3235,7 @@ interface StoredTopic {
|
|
|
3212
3235
|
type EntityInput = string | {
|
|
3213
3236
|
name: string;
|
|
3214
3237
|
kind?: EntityKind | (string & {});
|
|
3238
|
+
weight?: number;
|
|
3215
3239
|
};
|
|
3216
3240
|
interface EntityOperationsContext {
|
|
3217
3241
|
database: Database;
|
|
@@ -4920,6 +4944,7 @@ interface AutoExtractMessage {
|
|
|
4920
4944
|
interface ExtractedEntity {
|
|
4921
4945
|
name: string;
|
|
4922
4946
|
kind?: EntityKind;
|
|
4947
|
+
weight?: number;
|
|
4923
4948
|
}
|
|
4924
4949
|
interface ExtractedCandidate {
|
|
4925
4950
|
content: string;
|
|
@@ -9796,6 +9821,12 @@ interface ProfileDoc {
|
|
|
9796
9821
|
* without another LLM pass. Recomputed every synthesis (not delta-cached).
|
|
9797
9822
|
*/
|
|
9798
9823
|
observationTrends: Record<ObservationTrend, number>;
|
|
9824
|
+
/**
|
|
9825
|
+
* Sorted ids the store listed but could not decrypt at synthesis time.
|
|
9826
|
+
* Absent when every memory was readable. A later call regenerates only when
|
|
9827
|
+
* this set changes, and attributes a memory once it becomes readable.
|
|
9828
|
+
*/
|
|
9829
|
+
unreadableMemoryIds?: string[];
|
|
9799
9830
|
/** Unix ms this doc was produced. */
|
|
9800
9831
|
generatedAt: number;
|
|
9801
9832
|
}
|
|
@@ -9849,6 +9880,12 @@ interface SynthesizeProfileOptions extends PortalLlmAuth {
|
|
|
9849
9880
|
* never accidentally disable the gate by finding it empty.
|
|
9850
9881
|
*/
|
|
9851
9882
|
reviewedMemoryIds?: readonly string[];
|
|
9883
|
+
/**
|
|
9884
|
+
* Read facts and recall through this store instead of `ctx.vaultCtx` and
|
|
9885
|
+
* `ctx.vaultCache`, so a remote store works. Only `ctx.embeddingOptions` is
|
|
9886
|
+
* then read from `ctx`.
|
|
9887
|
+
*/
|
|
9888
|
+
store?: Pick<MemoryStore, "list" | "listProjections" | "factSource">;
|
|
9852
9889
|
}
|
|
9853
9890
|
/**
|
|
9854
9891
|
* Synthesize a shareable {@link ProfileDoc} from the user's vault, on-device.
|
|
@@ -11298,4 +11335,4 @@ interface UseChatStorageResult extends BaseUseChatStorageResult {
|
|
|
11298
11335
|
*/
|
|
11299
11336
|
declare function useChatStorage(options: UseChatStorageOptions): UseChatStorageResult;
|
|
11300
11337
|
|
|
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 };
|
|
11338
|
+
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 StoredTopic, type StoredVaultFolder, VaultFolder as StoredVaultFolderModel, type StoredVaultMemory, VaultMemory as StoredVaultMemoryModel, StreamExpiredError, type StreamMetaEvent, type StreamResumeHandle, type StreamSmoothingConfig, type SynthesizeProfileOptions, TOOL_RESULT_ORIGIN, TOPICS_EXTRACTION_VERSION, TOPIC_EXTRACTION_BATCH_SIZE, TOPIC_SALIENCE_WEIGHTS, TREND_RECENT_WINDOW_DAYS, TREND_STALE_WINDOW_DAYS, type TextChunk, type TopicExtractOptions, type TopicExtractionInput, type TopicExtractionRunResult, type TopicSalience, type TopicSkipReason, type TurnCompleteEvent, type TurnSkippedEvent, type UncheckedReason, type UnverifiableReason, type UpdateVaultFolderOptions, type UpdateVaultMemoryOptions, type UseChatStorageOptions, type UseChatStorageResult, type UseCreditsOptions, type UseCreditsResult, type UseModelsOptions, type UseModelsResult, VAULT_SIZE_HOP_CAP, type 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, primaryTopic, 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, topicWeight, traverseGraphLane, ttlForType, updateVaultFolderContextOp, updateVaultFolderOp, updateVaultMemoryEmbeddingOp, updateVaultMemoryOp, upsertMessageOp, useChat, useChatStorage, useCredits, useEncryption, useModels, verifyMemoriesForPublish, xhrTransport };
|