@anuma/sdk 6.9.0 → 6.11.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/{chunk-4M56MKBV.mjs → chunk-ZO7S3TBT.mjs} +79 -25
- package/dist/expo/index.cjs +98 -23
- package/dist/expo/index.d.mts +94 -1
- package/dist/expo/index.d.ts +94 -1
- package/dist/expo/index.mjs +31 -11
- package/dist/expo/{recall-WIB7RQQZ.mjs → recall-OALPGL3H.mjs} +1 -1
- package/dist/react/{chunk-EJ65X4GI.mjs → chunk-HNQ2ZEFF.mjs} +79 -25
- package/dist/react/index.cjs +98 -23
- package/dist/react/index.d.mts +94 -1
- package/dist/react/index.d.ts +94 -1
- package/dist/react/index.mjs +31 -11
- package/dist/react/{recall-FWILZSFH.mjs → recall-F5DBVCU2.mjs} +1 -1
- package/dist/server/{chunk-I56324FR.mjs → chunk-BKB6AT7Z.mjs} +79 -25
- package/dist/server/index.cjs +98 -23
- package/dist/server/index.d.mts +94 -1
- package/dist/server/index.d.ts +94 -1
- package/dist/server/index.mjs +31 -11
- package/dist/server/{recall-T7CNXTQ3.mjs → recall-HVIEAH7J.mjs} +1 -1
- package/package.json +1 -1
package/dist/server/index.cjs
CHANGED
|
@@ -20236,9 +20236,9 @@ function recencyMultiplier(updatedAt, opts = {}) {
|
|
|
20236
20236
|
const updatedMs = updatedAt.getTime();
|
|
20237
20237
|
if (!Number.isFinite(updatedMs)) return noDate;
|
|
20238
20238
|
const now = opts.now ?? /* @__PURE__ */ new Date();
|
|
20239
|
-
const
|
|
20240
|
-
if (!Number.isFinite(
|
|
20241
|
-
const ageDays2 = Math.max(0, (
|
|
20239
|
+
const nowMs3 = now.getTime();
|
|
20240
|
+
if (!Number.isFinite(nowMs3)) return noDate;
|
|
20241
|
+
const ageDays2 = Math.max(0, (nowMs3 - updatedMs) / DAY_MS2);
|
|
20242
20242
|
const perYearDecay = opts.perYearDecay ?? DEFAULT_PER_YEAR_DECAY;
|
|
20243
20243
|
const floor = opts.floor ?? DEFAULT_FLOOR;
|
|
20244
20244
|
const decay = perYearDecay * (ageDays2 / 365);
|
|
@@ -21576,6 +21576,9 @@ async function recall(query, ctx, options = {}) {
|
|
|
21576
21576
|
const chunkResults = [];
|
|
21577
21577
|
let vaultSize;
|
|
21578
21578
|
let didRerank = false;
|
|
21579
|
+
let rerankMs = 0;
|
|
21580
|
+
let queryEmbedMs = 0;
|
|
21581
|
+
let vaultRowsEmbedded;
|
|
21579
21582
|
let hadV2Head = false;
|
|
21580
21583
|
let embeddingsUnavailable = false;
|
|
21581
21584
|
let chunkEmbedFailed = false;
|
|
@@ -21600,12 +21603,15 @@ async function recall(query, ctx, options = {}) {
|
|
|
21600
21603
|
...vaultSize !== void 0 && { vaultSize },
|
|
21601
21604
|
...decryptLastRan !== void 0 && { decryptLast: decryptLastRan },
|
|
21602
21605
|
...vaultRowsDecrypted !== void 0 && { vaultRowsDecrypted },
|
|
21606
|
+
...vaultRowsEmbedded !== void 0 && { vaultRowsEmbedded },
|
|
21603
21607
|
factCount: factResults.length,
|
|
21604
21608
|
chunkCount: chunkResults.length,
|
|
21605
21609
|
timings: {
|
|
21606
21610
|
total: nowMs() - t0,
|
|
21607
21611
|
prep: prepMs,
|
|
21608
21612
|
factLane: factLaneMs,
|
|
21613
|
+
rerank: rerankMs,
|
|
21614
|
+
queryEmbed: queryEmbedMs,
|
|
21609
21615
|
chunkLane: chunkLaneMs,
|
|
21610
21616
|
fuse: fuseMs
|
|
21611
21617
|
},
|
|
@@ -21669,6 +21675,9 @@ async function recall(query, ctx, options = {}) {
|
|
|
21669
21675
|
results,
|
|
21670
21676
|
vaultSize: size,
|
|
21671
21677
|
reranked,
|
|
21678
|
+
rerankMs: factRerankMs,
|
|
21679
|
+
queryEmbedMs: factQueryEmbedMs,
|
|
21680
|
+
rowsEmbedded: factRowsEmbedded,
|
|
21672
21681
|
hadV2Head: v2Head,
|
|
21673
21682
|
embeddingsUnavailable: factEmbeddingsUnavailable,
|
|
21674
21683
|
rankedOnCosine: factRankedOnCosine,
|
|
@@ -21727,6 +21736,9 @@ async function recall(query, ctx, options = {}) {
|
|
|
21727
21736
|
);
|
|
21728
21737
|
vaultSize = size;
|
|
21729
21738
|
didRerank = reranked;
|
|
21739
|
+
rerankMs = factRerankMs;
|
|
21740
|
+
queryEmbedMs = factQueryEmbedMs;
|
|
21741
|
+
vaultRowsEmbedded = factRowsEmbedded;
|
|
21730
21742
|
hadV2Head = v2Head;
|
|
21731
21743
|
if (factEmbeddingsUnavailable) embeddingsUnavailable = true;
|
|
21732
21744
|
factLaneRankedOnCosine = factRankedOnCosine;
|
|
@@ -22191,6 +22203,7 @@ async function rankFusedVaultMemoriesAsync(query, queryEmbedding, items, options
|
|
|
22191
22203
|
const rerankTopN = options.rerankTopN ?? 30;
|
|
22192
22204
|
const ceWeight = options.ceWeight ?? 0.1;
|
|
22193
22205
|
const headSlice = v2Ranked.slice(0, rerankTopN);
|
|
22206
|
+
const ceStart = nowMs2();
|
|
22194
22207
|
try {
|
|
22195
22208
|
const reranked = await rerankPairs(
|
|
22196
22209
|
query,
|
|
@@ -22218,6 +22231,8 @@ async function rankFusedVaultMemoriesAsync(query, queryEmbedding, items, options
|
|
|
22218
22231
|
getLogger().warn("[memory/search] cross-encoder rerank failed; using V2 ranking", err);
|
|
22219
22232
|
}
|
|
22220
22233
|
combined = v2Ranked;
|
|
22234
|
+
} finally {
|
|
22235
|
+
if (options.rerankStats) options.rerankStats.ms += nowMs2() - ceStart;
|
|
22221
22236
|
}
|
|
22222
22237
|
} else {
|
|
22223
22238
|
combined = v2Ranked;
|
|
@@ -22384,6 +22399,7 @@ async function rankComposite(originalQuery, originalQueryEmbedding, subQueries,
|
|
|
22384
22399
|
const ceWeight = options.ceWeight ?? 0.1;
|
|
22385
22400
|
const headSlice = combined.slice(0, rerankTopN);
|
|
22386
22401
|
const tailSlice = combined.slice(rerankTopN);
|
|
22402
|
+
const ceStart = nowMs2();
|
|
22387
22403
|
try {
|
|
22388
22404
|
const reranked = await rerankPairs(
|
|
22389
22405
|
originalQuery,
|
|
@@ -22411,6 +22427,8 @@ async function rankComposite(originalQuery, originalQueryEmbedding, subQueries,
|
|
|
22411
22427
|
err
|
|
22412
22428
|
);
|
|
22413
22429
|
}
|
|
22430
|
+
} finally {
|
|
22431
|
+
if (options.rerankStats) options.rerankStats.ms += nowMs2() - ceStart;
|
|
22414
22432
|
}
|
|
22415
22433
|
}
|
|
22416
22434
|
if (options?.mmr) {
|
|
@@ -22537,11 +22555,13 @@ async function buildProjectedCorpus(query, vaultCtx, embeddingOptions, cache, qu
|
|
|
22537
22555
|
rowsDecrypted: 0
|
|
22538
22556
|
};
|
|
22539
22557
|
}
|
|
22558
|
+
const queryEmbedStart = nowMs2();
|
|
22540
22559
|
const queryEmbedding = await embedQueryOrDegrade(
|
|
22541
22560
|
query,
|
|
22542
22561
|
embeddingOptions,
|
|
22543
22562
|
opts.onEmbeddingDegraded
|
|
22544
22563
|
);
|
|
22564
|
+
if (opts.embedStats) opts.embedStats.queryMs += nowMs2() - queryEmbedStart;
|
|
22545
22565
|
const embeddingsDegraded = queryEmbedding.length === 0;
|
|
22546
22566
|
const currentModel = embeddingOptions.model ?? DEFAULT_API_EMBEDDING_MODEL;
|
|
22547
22567
|
const vectored = [];
|
|
@@ -22594,6 +22614,7 @@ async function buildProjectedCorpus(query, vaultCtx, embeddingOptions, cache, qu
|
|
|
22594
22614
|
const laneRows = laneFetched.filter((m) => !isEncrypted(m.content));
|
|
22595
22615
|
if (laneRows.length > 0) {
|
|
22596
22616
|
let laneVecs;
|
|
22617
|
+
if (opts.embedStats) opts.embedStats.rowsEmbedded += laneRows.length;
|
|
22597
22618
|
try {
|
|
22598
22619
|
laneVecs = await generateEmbeddings(
|
|
22599
22620
|
laneRows.map((m) => m.content),
|
|
@@ -22672,6 +22693,10 @@ async function buildProjectedCorpus(query, vaultCtx, embeddingOptions, cache, qu
|
|
|
22672
22693
|
async function prepareVaultCandidates(query, vaultCtx, embeddingOptions, cache, searchOptions) {
|
|
22673
22694
|
if (!query || typeof query !== "string") {
|
|
22674
22695
|
return {
|
|
22696
|
+
// Nothing was read and nothing was embedded — the short-circuit fires
|
|
22697
|
+
// before either.
|
|
22698
|
+
queryEmbedMs: 0,
|
|
22699
|
+
rowsEmbedded: 0,
|
|
22675
22700
|
memories: [],
|
|
22676
22701
|
embeddedItems: [],
|
|
22677
22702
|
queryEmbedding: [],
|
|
@@ -22704,6 +22729,7 @@ async function prepareVaultCandidates(query, vaultCtx, embeddingOptions, cache,
|
|
|
22704
22729
|
embeddingsUnavailable = true;
|
|
22705
22730
|
embeddingFailure = true;
|
|
22706
22731
|
};
|
|
22732
|
+
const embedStats = { queryMs: 0, rowsEmbedded: 0 };
|
|
22707
22733
|
if (searchOptions?.decryptLast) {
|
|
22708
22734
|
const forceIncludeIds = [
|
|
22709
22735
|
...searchOptions.entityRanking ?? [],
|
|
@@ -22715,7 +22741,8 @@ async function prepareVaultCandidates(query, vaultCtx, embeddingOptions, cache,
|
|
|
22715
22741
|
admitFloor: ADMIT_FLOOR,
|
|
22716
22742
|
unembeddedCap: UNEMBEDDED_CAP,
|
|
22717
22743
|
...forceIncludeIds.length > 0 && { forceIncludeIds },
|
|
22718
|
-
onEmbeddingDegraded
|
|
22744
|
+
onEmbeddingDegraded,
|
|
22745
|
+
embedStats
|
|
22719
22746
|
});
|
|
22720
22747
|
if (corpus.vaultSize === 0) {
|
|
22721
22748
|
return {
|
|
@@ -22726,7 +22753,9 @@ async function prepareVaultCandidates(query, vaultCtx, embeddingOptions, cache,
|
|
|
22726
22753
|
embeddingsUnavailable: false,
|
|
22727
22754
|
embeddingFailure: false,
|
|
22728
22755
|
decryptLast: true,
|
|
22729
|
-
rowsDecrypted: corpus.rowsDecrypted
|
|
22756
|
+
rowsDecrypted: corpus.rowsDecrypted,
|
|
22757
|
+
queryEmbedMs: embedStats.queryMs,
|
|
22758
|
+
rowsEmbedded: embedStats.rowsEmbedded
|
|
22730
22759
|
};
|
|
22731
22760
|
}
|
|
22732
22761
|
({ memories, embeddedItems, queryEmbedding, vaultSize } = corpus);
|
|
@@ -22743,7 +22772,9 @@ async function prepareVaultCandidates(query, vaultCtx, embeddingOptions, cache,
|
|
|
22743
22772
|
decryptLast: true,
|
|
22744
22773
|
// Rows WERE decrypt-attempted even though none came back readable — that
|
|
22745
22774
|
// is the whole point of reporting attempts rather than successes.
|
|
22746
|
-
rowsDecrypted: corpus.rowsDecrypted
|
|
22775
|
+
rowsDecrypted: corpus.rowsDecrypted,
|
|
22776
|
+
queryEmbedMs: embedStats.queryMs,
|
|
22777
|
+
rowsEmbedded: embedStats.rowsEmbedded
|
|
22747
22778
|
};
|
|
22748
22779
|
}
|
|
22749
22780
|
} else {
|
|
@@ -22768,10 +22799,14 @@ async function prepareVaultCandidates(query, vaultCtx, embeddingOptions, cache,
|
|
|
22768
22799
|
embeddingsUnavailable: false,
|
|
22769
22800
|
embeddingFailure: false,
|
|
22770
22801
|
decryptLast: false,
|
|
22771
|
-
rowsDecrypted: loaded.length
|
|
22802
|
+
rowsDecrypted: loaded.length,
|
|
22803
|
+
queryEmbedMs: embedStats.queryMs,
|
|
22804
|
+
rowsEmbedded: embedStats.rowsEmbedded
|
|
22772
22805
|
};
|
|
22773
22806
|
}
|
|
22807
|
+
const legacyEmbedStart = nowMs2();
|
|
22774
22808
|
queryEmbedding = await embedQueryOrDegrade(query, embeddingOptions, onEmbeddingDegraded);
|
|
22809
|
+
embedStats.queryMs += nowMs2() - legacyEmbedStart;
|
|
22775
22810
|
const currentModel = embeddingOptions.model ?? DEFAULT_API_EMBEDDING_MODEL;
|
|
22776
22811
|
const uncachedTexts = [];
|
|
22777
22812
|
const uncachedIndices = [];
|
|
@@ -22805,6 +22840,7 @@ async function prepareVaultCandidates(query, vaultCtx, embeddingOptions, cache,
|
|
|
22805
22840
|
}
|
|
22806
22841
|
if (uncachedTexts.length > 0) {
|
|
22807
22842
|
let newEmbeddings;
|
|
22843
|
+
embedStats.rowsEmbedded += uncachedTexts.length;
|
|
22808
22844
|
try {
|
|
22809
22845
|
newEmbeddings = await generateEmbeddings(uncachedTexts, embeddingOptions);
|
|
22810
22846
|
} catch (err) {
|
|
@@ -22848,6 +22884,8 @@ async function prepareVaultCandidates(query, vaultCtx, embeddingOptions, cache,
|
|
|
22848
22884
|
embeddingsUnavailable = true;
|
|
22849
22885
|
}
|
|
22850
22886
|
return {
|
|
22887
|
+
queryEmbedMs: embedStats.queryMs,
|
|
22888
|
+
rowsEmbedded: embedStats.rowsEmbedded,
|
|
22851
22889
|
memories,
|
|
22852
22890
|
embeddedItems,
|
|
22853
22891
|
queryEmbedding,
|
|
@@ -22898,11 +22936,15 @@ async function rankPreparedVaultCandidates(query, prepared, embeddingOptions, se
|
|
|
22898
22936
|
results: results2,
|
|
22899
22937
|
vaultSize: out.vaultSize,
|
|
22900
22938
|
reranked: out.reranked ?? false,
|
|
22939
|
+
// Read straight off the shared stats object rather than being passed in at
|
|
22940
|
+
// each call site: every return in this function funnels through here, so a
|
|
22941
|
+
// path added later reports the CE bill without having to remember to.
|
|
22942
|
+
rerankMs: rerankStats.ms,
|
|
22901
22943
|
hadV2Head: out.hadV2Head ?? false,
|
|
22902
22944
|
embeddingsUnavailable
|
|
22903
22945
|
};
|
|
22904
22946
|
};
|
|
22905
|
-
const rerankStats = { applied: false };
|
|
22947
|
+
const rerankStats = { applied: false, ms: 0 };
|
|
22906
22948
|
const useFusion = searchOptions?.useFusion ?? true;
|
|
22907
22949
|
const tuning = {
|
|
22908
22950
|
...searchOptions?.recencyAlpha !== void 0 && { recencyAlpha: searchOptions.recencyAlpha },
|
|
@@ -23021,13 +23063,16 @@ async function searchVaultMemoriesWithSize(query, vaultCtx, embeddingOptions, ca
|
|
|
23021
23063
|
results: [],
|
|
23022
23064
|
vaultSize: 0,
|
|
23023
23065
|
reranked: false,
|
|
23066
|
+
rerankMs: 0,
|
|
23024
23067
|
hadV2Head: false,
|
|
23025
23068
|
embeddingsUnavailable: false,
|
|
23026
23069
|
rankedOnCosine: false,
|
|
23027
23070
|
// No storage read happened, so nothing was decrypted; report the path the
|
|
23028
23071
|
// caller asked for so this turn is still attributable.
|
|
23029
23072
|
decryptLast: !!searchOptions?.decryptLast,
|
|
23030
|
-
rowsDecrypted: 0
|
|
23073
|
+
rowsDecrypted: 0,
|
|
23074
|
+
queryEmbedMs: 0,
|
|
23075
|
+
rowsEmbedded: 0
|
|
23031
23076
|
};
|
|
23032
23077
|
}
|
|
23033
23078
|
if (searchOptions?.decompose === "llm" && normalizeSubQueries(searchOptions.subQueries).length < 2 && !warnedProgrammaticDecomposeIgnored) {
|
|
@@ -23048,11 +23093,14 @@ async function searchVaultMemoriesWithSize(query, vaultCtx, embeddingOptions, ca
|
|
|
23048
23093
|
results: [],
|
|
23049
23094
|
vaultSize: 0,
|
|
23050
23095
|
reranked: false,
|
|
23096
|
+
rerankMs: 0,
|
|
23051
23097
|
hadV2Head: false,
|
|
23052
23098
|
embeddingsUnavailable: prepared.embeddingsUnavailable,
|
|
23053
23099
|
rankedOnCosine: false,
|
|
23054
23100
|
decryptLast: prepared.decryptLast,
|
|
23055
|
-
rowsDecrypted: prepared.rowsDecrypted
|
|
23101
|
+
rowsDecrypted: prepared.rowsDecrypted,
|
|
23102
|
+
queryEmbedMs: prepared.queryEmbedMs,
|
|
23103
|
+
rowsEmbedded: prepared.rowsEmbedded
|
|
23056
23104
|
};
|
|
23057
23105
|
}
|
|
23058
23106
|
if (prepared.memories.length === 0) {
|
|
@@ -23060,11 +23108,14 @@ async function searchVaultMemoriesWithSize(query, vaultCtx, embeddingOptions, ca
|
|
|
23060
23108
|
results: [],
|
|
23061
23109
|
vaultSize: prepared.vaultSize,
|
|
23062
23110
|
reranked: false,
|
|
23111
|
+
rerankMs: 0,
|
|
23063
23112
|
hadV2Head: false,
|
|
23064
23113
|
embeddingsUnavailable: prepared.embeddingsUnavailable,
|
|
23065
23114
|
rankedOnCosine: false,
|
|
23066
23115
|
decryptLast: prepared.decryptLast,
|
|
23067
|
-
rowsDecrypted: prepared.rowsDecrypted
|
|
23116
|
+
rowsDecrypted: prepared.rowsDecrypted,
|
|
23117
|
+
queryEmbedMs: prepared.queryEmbedMs,
|
|
23118
|
+
rowsEmbedded: prepared.rowsEmbedded
|
|
23068
23119
|
};
|
|
23069
23120
|
}
|
|
23070
23121
|
const ranked = await rankPreparedVaultCandidates(
|
|
@@ -23077,7 +23128,9 @@ async function searchVaultMemoriesWithSize(query, vaultCtx, embeddingOptions, ca
|
|
|
23077
23128
|
...ranked,
|
|
23078
23129
|
rankedOnCosine: !ranked.embeddingsUnavailable,
|
|
23079
23130
|
decryptLast: prepared.decryptLast,
|
|
23080
|
-
rowsDecrypted: prepared.rowsDecrypted
|
|
23131
|
+
rowsDecrypted: prepared.rowsDecrypted,
|
|
23132
|
+
queryEmbedMs: prepared.queryEmbedMs,
|
|
23133
|
+
rowsEmbedded: prepared.rowsEmbedded
|
|
23081
23134
|
};
|
|
23082
23135
|
}
|
|
23083
23136
|
async function searchVaultMemories(query, vaultCtx, embeddingOptions, cache, searchOptions) {
|
|
@@ -23227,7 +23280,7 @@ ${formatted}`;
|
|
|
23227
23280
|
}
|
|
23228
23281
|
};
|
|
23229
23282
|
}
|
|
23230
|
-
var warnedProgrammaticDecomposeIgnored, SUPERSESSION_SIMILARITY_THRESHOLD, SUPERSESSION_MIN_AGE_GAP_MS, SUPERSESSION_BOOST_FACTOR, SUPERSESSION_MAX_WINDOW, EMBEDDINGS_DEGRADED_EMPTY_NO_LEXICAL;
|
|
23283
|
+
var nowMs2, warnedProgrammaticDecomposeIgnored, SUPERSESSION_SIMILARITY_THRESHOLD, SUPERSESSION_MIN_AGE_GAP_MS, SUPERSESSION_BOOST_FACTOR, SUPERSESSION_MAX_WINDOW, EMBEDDINGS_DEGRADED_EMPTY_NO_LEXICAL;
|
|
23231
23284
|
var init_searchTool = __esm({
|
|
23232
23285
|
"src/lib/memoryVault/searchTool.ts"() {
|
|
23233
23286
|
"use strict";
|
|
@@ -23245,6 +23298,7 @@ var init_searchTool = __esm({
|
|
|
23245
23298
|
init_bm25();
|
|
23246
23299
|
init_decomposeQuery();
|
|
23247
23300
|
init_lruCache();
|
|
23301
|
+
nowMs2 = () => typeof performance !== "undefined" && typeof performance.now === "function" ? performance.now() : Date.now();
|
|
23248
23302
|
warnedProgrammaticDecomposeIgnored = false;
|
|
23249
23303
|
SUPERSESSION_SIMILARITY_THRESHOLD = 0.7;
|
|
23250
23304
|
SUPERSESSION_MIN_AGE_GAP_MS = 30 * 24 * 60 * 60 * 1e3;
|
|
@@ -24335,6 +24389,7 @@ __export(index_exports, {
|
|
|
24335
24389
|
hasKeyPair: () => hasKeyPair,
|
|
24336
24390
|
ingestPublishedPhotoMemoriesOp: () => ingestPublishedPhotoMemoriesOp,
|
|
24337
24391
|
injectionSignatureCatalog: () => injectionSignatureCatalog,
|
|
24392
|
+
isDegradedTopicSkip: () => isDegradedTopicSkip,
|
|
24338
24393
|
isRerankerAvailable: () => isRerankerAvailable,
|
|
24339
24394
|
isSupportedFile: () => isSupportedFile,
|
|
24340
24395
|
isSupportedMediaType: () => isSupportedMediaType,
|
|
@@ -31379,6 +31434,18 @@ function parseTopicResponse(parsed, validIds) {
|
|
|
31379
31434
|
}
|
|
31380
31435
|
return out;
|
|
31381
31436
|
}
|
|
31437
|
+
var DEGRADED_TOPIC_SKIP = {
|
|
31438
|
+
excluded: false,
|
|
31439
|
+
"link-declined": false,
|
|
31440
|
+
"stamp-declined": false,
|
|
31441
|
+
"llm-unanswered": true,
|
|
31442
|
+
unreadable: true,
|
|
31443
|
+
"not-found": true,
|
|
31444
|
+
"link-failed": true
|
|
31445
|
+
};
|
|
31446
|
+
function isDegradedTopicSkip(reason) {
|
|
31447
|
+
return DEGRADED_TOPIC_SKIP[reason] === true;
|
|
31448
|
+
}
|
|
31382
31449
|
async function extractAndLinkEntitiesForMemoriesOp(ctx, memoryIds, options) {
|
|
31383
31450
|
const entityCtx = ctx.entityCtx;
|
|
31384
31451
|
if (!entityCtx) {
|
|
@@ -31387,17 +31454,24 @@ async function extractAndLinkEntitiesForMemoriesOp(ctx, memoryIds, options) {
|
|
|
31387
31454
|
const log = getLogger();
|
|
31388
31455
|
const extractedAt = options.now ?? Date.now();
|
|
31389
31456
|
const skippedIds = [];
|
|
31457
|
+
const skippedReasons = /* @__PURE__ */ new Map();
|
|
31458
|
+
const skip = (id, reason) => {
|
|
31459
|
+
if (skippedReasons.has(id)) return;
|
|
31460
|
+
skippedIds.push(id);
|
|
31461
|
+
skippedReasons.set(id, reason);
|
|
31462
|
+
};
|
|
31390
31463
|
const inputs = [];
|
|
31391
|
-
for (const id of memoryIds) {
|
|
31464
|
+
for (const id of new Set(memoryIds)) {
|
|
31392
31465
|
let record;
|
|
31393
31466
|
try {
|
|
31394
31467
|
record = await ctx.vaultMemoryCollection.find(id);
|
|
31395
|
-
} catch {
|
|
31396
|
-
|
|
31468
|
+
} catch (err) {
|
|
31469
|
+
log.warn("[memory/topics] vault lookup failed for extraction", err);
|
|
31470
|
+
skip(id, "not-found");
|
|
31397
31471
|
continue;
|
|
31398
31472
|
}
|
|
31399
31473
|
if (record.isDeleted || ctx.userId !== void 0 && record.userId !== ctx.userId || record.topicsUserManaged) {
|
|
31400
|
-
|
|
31474
|
+
skip(id, "excluded");
|
|
31401
31475
|
continue;
|
|
31402
31476
|
}
|
|
31403
31477
|
try {
|
|
@@ -31410,7 +31484,7 @@ async function extractAndLinkEntitiesForMemoriesOp(ctx, memoryIds, options) {
|
|
|
31410
31484
|
inputs.push({ id, content: stored.content });
|
|
31411
31485
|
} catch (err) {
|
|
31412
31486
|
log.warn("[memory/topics] failed to load memory for extraction", err);
|
|
31413
|
-
|
|
31487
|
+
skip(id, "unreadable");
|
|
31414
31488
|
}
|
|
31415
31489
|
}
|
|
31416
31490
|
const entitiesByMemory = await extractEntitiesForMemories(inputs, options);
|
|
@@ -31418,19 +31492,19 @@ async function extractAndLinkEntitiesForMemoriesOp(ctx, memoryIds, options) {
|
|
|
31418
31492
|
for (const input of inputs) {
|
|
31419
31493
|
const entities = entitiesByMemory.get(input.id);
|
|
31420
31494
|
if (entities === void 0) {
|
|
31421
|
-
|
|
31495
|
+
skip(input.id, "llm-unanswered");
|
|
31422
31496
|
continue;
|
|
31423
31497
|
}
|
|
31424
31498
|
try {
|
|
31425
31499
|
const linked = await replaceMemoryEntitiesGuardedOp(entityCtx, input.id, entities);
|
|
31426
31500
|
if (linked === null) {
|
|
31427
|
-
|
|
31501
|
+
skip(input.id, "link-declined");
|
|
31428
31502
|
entitiesByMemory.delete(input.id);
|
|
31429
31503
|
continue;
|
|
31430
31504
|
}
|
|
31431
31505
|
} catch (err) {
|
|
31432
31506
|
log.warn("[memory/topics] replaceMemoryEntitiesGuardedOp failed", err);
|
|
31433
|
-
|
|
31507
|
+
skip(input.id, "link-failed");
|
|
31434
31508
|
entitiesByMemory.delete(input.id);
|
|
31435
31509
|
continue;
|
|
31436
31510
|
}
|
|
@@ -31440,11 +31514,11 @@ async function extractAndLinkEntitiesForMemoriesOp(ctx, memoryIds, options) {
|
|
|
31440
31514
|
const stampedSet = new Set(stampedIds);
|
|
31441
31515
|
for (const id of toStamp) {
|
|
31442
31516
|
if (!stampedSet.has(id)) {
|
|
31443
|
-
|
|
31517
|
+
skip(id, "stamp-declined");
|
|
31444
31518
|
entitiesByMemory.delete(id);
|
|
31445
31519
|
}
|
|
31446
31520
|
}
|
|
31447
|
-
return { entitiesByMemory, stampedIds, skippedIds };
|
|
31521
|
+
return { entitiesByMemory, stampedIds, skippedIds, skippedReasons };
|
|
31448
31522
|
}
|
|
31449
31523
|
|
|
31450
31524
|
// src/lib/memory/verifySupport.ts
|
|
@@ -37512,6 +37586,7 @@ function buildSystemPrompt(ctx, options) {
|
|
|
37512
37586
|
hasKeyPair,
|
|
37513
37587
|
ingestPublishedPhotoMemoriesOp,
|
|
37514
37588
|
injectionSignatureCatalog,
|
|
37589
|
+
isDegradedTopicSkip,
|
|
37515
37590
|
isRerankerAvailable,
|
|
37516
37591
|
isSupportedFile,
|
|
37517
37592
|
isSupportedMediaType,
|
package/dist/server/index.d.mts
CHANGED
|
@@ -5641,6 +5641,17 @@ interface RecallDiagnostics {
|
|
|
5641
5641
|
* never the cost.
|
|
5642
5642
|
*/
|
|
5643
5643
|
vaultRowsDecrypted?: number;
|
|
5644
|
+
/**
|
|
5645
|
+
* Rows the fact lane had to re-embed through the portal because their stored
|
|
5646
|
+
* vector was unusable — stale `embedding_model`, wrong dimension, or
|
|
5647
|
+
* unparseable. Absent when the fact lane didn't run.
|
|
5648
|
+
*
|
|
5649
|
+
* Expected to be 0 on a healthy vault: rows are embedded at write time and the
|
|
5650
|
+
* re-embed writes the current model back, so a persistently non-zero value
|
|
5651
|
+
* means the writeback is not sticking and every turn is paying for it. On the
|
|
5652
|
+
* LEGACY read path this batch is uncapped, so it can be the whole vault.
|
|
5653
|
+
*/
|
|
5654
|
+
vaultRowsEmbedded?: number;
|
|
5644
5655
|
/** Facts the fact lane returned (post-dedupe, pre-fusion). */
|
|
5645
5656
|
factCount: number;
|
|
5646
5657
|
/** Chunks the chunk lane returned (post-dedupe, pre-fusion). */
|
|
@@ -5653,6 +5664,37 @@ interface RecallDiagnostics {
|
|
|
5653
5664
|
prep: number;
|
|
5654
5665
|
/** Vault fact-lane search (`searchVaultMemoriesWithSize`). */
|
|
5655
5666
|
factLane: number;
|
|
5667
|
+
/**
|
|
5668
|
+
* The cross-encoder's share of {@link factLane} — wall-clock spent inside
|
|
5669
|
+
* `rerankPairs`. Billed even when the CE threw partway through, because a
|
|
5670
|
+
* rerank that burned three seconds and then failed still cost them.
|
|
5671
|
+
*
|
|
5672
|
+
* A SUBSET of `factLane`, not a sibling: read `factLane - rerank` for
|
|
5673
|
+
* everything else the lane did (query embed, vault read, fused ranking).
|
|
5674
|
+
* 0 when the CE did not run; `reranked` is what distinguishes that from a
|
|
5675
|
+
* rerank that cost nothing.
|
|
5676
|
+
*
|
|
5677
|
+
* Exists because #845 spent three rounds arguing about which stage inside
|
|
5678
|
+
* the fact lane dominated — whole-vault read, then admission window, then
|
|
5679
|
+
* the CE — with one aggregate number for all of them. Every hypothesis was
|
|
5680
|
+
* an inference; this makes the question a query.
|
|
5681
|
+
*/
|
|
5682
|
+
rerank: number;
|
|
5683
|
+
/**
|
|
5684
|
+
* The query embed's share of {@link factLane} — one portal round trip.
|
|
5685
|
+
*
|
|
5686
|
+
* Also a SUBSET of `factLane`. Together with `rerank` this makes the lane
|
|
5687
|
+
* decomposable: `factLane - queryEmbed - rerank` is the local work (vault
|
|
5688
|
+
* read, decrypt, BM25/cosine fusion), and each of the three implies a
|
|
5689
|
+
* completely different fix.
|
|
5690
|
+
*
|
|
5691
|
+
* 0 when the lane returned before embedding, which includes every empty
|
|
5692
|
+
* vault — `prepareVaultCandidates` short-circuits first. That is why the
|
|
5693
|
+
* fast `vault_size = 0` population never established a baseline for this
|
|
5694
|
+
* cost, and why the ~850ms floor on the smallest NON-empty vaults had no
|
|
5695
|
+
* attributable owner.
|
|
5696
|
+
*/
|
|
5697
|
+
queryEmbed: number;
|
|
5656
5698
|
/** Chunk-lane search (`searchChunksOp`). */
|
|
5657
5699
|
chunkLane: number;
|
|
5658
5700
|
/** Cross-lane RRF fusion + provenance dedup after both lanes. */
|
|
@@ -9096,6 +9138,39 @@ interface TopicExtractOptions extends PortalLlmAuth {
|
|
|
9096
9138
|
* later sweep, never stamp them.
|
|
9097
9139
|
*/
|
|
9098
9140
|
declare function extractEntitiesForMemories(memories: readonly TopicExtractionInput[], options: TopicExtractOptions): Promise<Map<string, ExtractedEntity[]>>;
|
|
9141
|
+
/**
|
|
9142
|
+
* Why one memory was skipped by a topic sweep.
|
|
9143
|
+
*
|
|
9144
|
+
* Split along the line that actually matters operationally — did the sweep
|
|
9145
|
+
* DECLINE this row on purpose, or did something BREAK:
|
|
9146
|
+
*
|
|
9147
|
+
* Deliberate (healthy; a sweep of nothing but these is a success):
|
|
9148
|
+
* - `excluded` — deleted, owned by another user, or `topicsUserManaged`.
|
|
9149
|
+
* - `link-declined` — the entity-link write's in-row guard declined (the row
|
|
9150
|
+
* became user-managed / deleted / absent mid-run).
|
|
9151
|
+
* - `stamp-declined` — same, caught by the stamp op's own re-check.
|
|
9152
|
+
*
|
|
9153
|
+
* Degraded (something is wrong; see {@link isDegradedTopicSkip}):
|
|
9154
|
+
* - `llm-unanswered` — the batch failed or the model omitted this id. THE one
|
|
9155
|
+
* to alarm on: it is how a wholly broken sweep looks.
|
|
9156
|
+
* - `unreadable` — the row could not be loaded/decrypted.
|
|
9157
|
+
* - `not-found` — the lookup threw (absent row or read fault).
|
|
9158
|
+
* - `link-failed` — the entity-link write threw.
|
|
9159
|
+
*
|
|
9160
|
+
* @public
|
|
9161
|
+
*/
|
|
9162
|
+
type TopicSkipReason = "excluded" | "link-declined" | "stamp-declined" | "llm-unanswered" | "unreadable" | "not-found" | "link-failed";
|
|
9163
|
+
/**
|
|
9164
|
+
* Whether a skip reason means the sweep FAILED on that row, rather than
|
|
9165
|
+
* deliberately passing over it.
|
|
9166
|
+
*
|
|
9167
|
+
* Exported so callers classify identically instead of each re-deriving the
|
|
9168
|
+
* split — the reason this type exists is that one wrong grouping turns a broken
|
|
9169
|
+
* sweep back into a healthy-looking one.
|
|
9170
|
+
*
|
|
9171
|
+
* @public
|
|
9172
|
+
*/
|
|
9173
|
+
declare function isDegradedTopicSkip(reason: TopicSkipReason): boolean;
|
|
9099
9174
|
/** Outcome of one {@link extractAndLinkEntitiesForMemoriesOp} run. */
|
|
9100
9175
|
interface TopicExtractionRunResult {
|
|
9101
9176
|
/** memoryId → entities the LLM returned (post-validation, post-linking). */
|
|
@@ -9108,6 +9183,24 @@ interface TopicExtractionRunResult {
|
|
|
9108
9183
|
* LLM batches. Skipped ids are not stamped, so failed batches are retried
|
|
9109
9184
|
* by a later sweep — callers should apply their own attempt caps. */
|
|
9110
9185
|
skippedIds: string[];
|
|
9186
|
+
/**
|
|
9187
|
+
* Why each id in {@link skippedIds} was skipped.
|
|
9188
|
+
*
|
|
9189
|
+
* `skippedIds` alone cannot distinguish a sweep that deliberately declined
|
|
9190
|
+
* work from one that FAILED: a run where every LLM batch errored and a run
|
|
9191
|
+
* over rows the user has taken manual control of produce an identical array.
|
|
9192
|
+
* That is the same blindness `outcome: 'empty-after-retry'` had before #888 —
|
|
9193
|
+
* a degradation wearing the shape of normal control flow.
|
|
9194
|
+
*
|
|
9195
|
+
* It matters here because topics feed the entity recall lane, so a silently
|
|
9196
|
+
* failing sweep means memories that exist but cannot be found by entity, with
|
|
9197
|
+
* nothing in production saying so.
|
|
9198
|
+
*
|
|
9199
|
+
* Populated in lockstep with `skippedIds` (single `skip()` helper), so the two
|
|
9200
|
+
* cannot drift. Group by {@link isDegradedTopicSkip} to separate "declined" from
|
|
9201
|
+
* "broke".
|
|
9202
|
+
*/
|
|
9203
|
+
skippedReasons: Map<string, TopicSkipReason>;
|
|
9111
9204
|
}
|
|
9112
9205
|
/**
|
|
9113
9206
|
* Run LLM topic extraction over existing vault memories and persist the
|
|
@@ -10420,4 +10513,4 @@ declare function sanitizeQuotes(s: string): string;
|
|
|
10420
10513
|
declare function renderTemplate(value: string | null | undefined, template: string): string | null;
|
|
10421
10514
|
declare function buildSystemPrompt(ctx: PromptContext, options?: BuildPromptOptions): BuildPromptResult;
|
|
10422
10515
|
|
|
10423
|
-
export { type AnalyzeStyleOptions, type AnalyzeStyleResult, type ApiResponse, type ApiType, type AutoExecutedToolResult, type AutoExtractMessage, type AutoExtractor, type Budget, type BuildPromptOptions, type BuildPromptResult, type CachedChunkVectors, type CachedServerTools, type ChatCompletionUsage, type ChatRole, type ChunkSearchResult, type ChunkVectorCache, type ChunkingOptions, type ConnectorGuidance, type ConnectorGuidanceInput, type ConsolidationFallbackReason, Conversation, ConversationSummary, type CreateAutoExtractorOptions, type CreateConversationOptions, type CreateDecaySweeperOptions, type CreateMediaOptions, type CreateMessageOptions, type CreateModelPreferenceOptions, type CreateProjectOptions, type CreateUserPreferenceOptions, type CreateVaultMemoryOptions, type CryptoPriceClassification, type CryptoPricePreProcessorOptions, DEFAULT_ANALYSIS_PROMPT, DEFAULT_ANALYZE_AFTER_MESSAGES, DEFAULT_CACHE_EXPIRATION_MS, DEFAULT_CHUNK_CACHE_SIZE, DEFAULT_CHUNK_OVERLAP, DEFAULT_CHUNK_SIZE, DEFAULT_DECAY_POLICY, DEFAULT_DOCUMENT_PATTERN, DEFAULT_EXCLUDED_SERVER_TOOLS, DEFAULT_MAX_CLASSIFIER_CALLS_PER_SWEEP, DEFAULT_MAX_INPUT_MESSAGES, DEFAULT_MAX_PROFILE_LENGTH, DEFAULT_MIN_CHUNK_SIZE, DEFAULT_MIN_MESSAGES, DEFAULT_PERSONALITY_SETTINGS, DEFAULT_PROFILE_FACETS, DEFAULT_PROFILE_FACT_TYPE_WEIGHTS, DEFAULT_PROFILE_PROOF_ALPHA, DEFAULT_PROFILE_TREND_MULTIPLIERS, DEFAULT_PROMPT_TEMPLATES, DEFAULT_REFRESH_EVERY_MESSAGES, DEFAULT_SERVER_TOOLS_MATCH_OPTIONS, DEFAULT_SUMMARY_MIN_WINDOW_MESSAGES, DEFAULT_SUMMARY_MODEL, DEFAULT_SUMMARY_TOKEN_THRESHOLD, DEFAULT_VAULT_CACHE_SIZE, DatabaseManager, type DatabaseManagerLogger, type DatabaseManagerOptions, type DecayCandidateRaw, type DecayClassifier, type DecayInput, type DecayPolicy, type DecaySweepResult, type DecaySweeper, type DecayVerdict, ENTITY_FANOUT, type EmbeddedWalletSignerFn, EncryptionKeyMissingError, ExcelProcessor, type ExtractFactsOptions, type ExtractOutcome, type ExtractedCandidate, type ExtractedEntity, type ExtractionCursorStore, type FactType, type FileMetadata, type FileProcessor, type FileTypeQuery, type FileWithData, type FlushResult, type GetConversationsPageOptions, type GraphTraversalOptions, HARD_DELETE_WINDOW_MS, INFERENCE_ID_HEADER, type InjectionClassifierOptions, type InjectionReason, type LazyStoredConversation, type LlmDecayClassifierOptions, type LlmNeighborRefinerOptions, type LlmTokenUsage, MAX_HOPS, MAX_MESSAGES_PER_SUMMARIZATION, MEDIUM_TTL_MS, Media, type MediaDimensions, type MediaFilterOptions, type MediaMetadata, type MediaOperationsContext, type MediaRole, type MediaType, type MemoriesNeedingTopicExtraction, type EmbeddingOptions as MemoryEngineEmbeddingOptions, type MemoryEngineResult, type MemoryEngineSearchOptions, type MemoryExtractedEvent, type MemoryKind, type MemoryQuarantinedEvent, type MemoryToVerify, type MemoryVaultSearchOptions, type MemoryVaultToolOptions, type MemoryVerification, Message, type MessageChunk, type MessageFeedback, type MessageOrigin, type ModelCallEndEvent, type ModelCallStartEvent, ModelPreference, NEVER_TTL_MS, NODE_BUDGET, type NeighborRefiner, type NowSource, type ObservationTrend, type ObservationTrendInput, type OperationExecutor, PAST_EVENT_GRACE_MS, PROFILE_DOC_VERSION, type ParsedServerToolsResponse, PdfProcessor, type PersonalitySettings, type PersonalitySliders, type PersonalityStyle, type PgClientLike, type PgPoolLike, type PhotoIngestResult, type PhotoMediaRef, type PlatformStorage, type PortalLlmAuth, type PortalLlmFailure, type PortalLlmFailureReason, PostgreSQLAdapter, type PostgreSQLAdapterOptions, type PreprocessingOptions, type PreprocessingResult, type ProcessedFileResult, ProcessorRegistry, type ProfileConfigFingerprint, type ProfileDoc, type ProfileFacet, type ProfileFacetKey, type ProfileSalienceInput, type ProfileSection, type ProfileUpdate, Project, type ProjectOperationsContext, type PromptContext, type PromptPreProcessor, type PromptPreProcessorContext, type PromptSection, type PromptTemplates, type PublishedPhotoMemory, type QuarantinedMemoryInfo, type QueueEncryptionContext, QueueManager, type QueueStatus, type QueuedOperation, type QueuedOperationType, RECALL_MAX_LIMIT, RECALL_TOOL_NAME, type RankedMemory, type RankedProfileCandidate, type RecallContext, type RecallDegradation, type RecallDiagnostics, type RecallOptions, type RecallResult, type RecallToolCallbacks, type RecallToolOptions, type RecencyOptions, type ReflectOptions, type ReflectResult, type RequestEncryptionKeyOptions, RerankerUnavailableError, type ResumeStreamOptions, type ResumeStreamResult, type RetainAction, type RetainContext, type RetainOptions, type RetainResult, type RetainSource, type RunEndEvent, type RunErrorEvent, type RunHooks, type RunStartEvent, type RunTerminalState, type RunToolLoopOptions, type RunToolLoopResult, SDK_SCHEMA_VERSION, SERVER_TOOL_DEPENDENCY_SETS, SHORT_TTL_MS, SLIDER_CONFIG, STREAM_RESUMABLE_HEADER, type ScoreBreakdown, type ScoreProfileSalienceOptions, type ScreenResult, type ScreenedCandidate, type SearchSource, type SelectServerToolsForPromptOptions, type ServerTool, type ServerToolCallEvent, type ServerToolsFilterFunction, type ServerToolsOptions, type ServerToolsResponse, type SettingsStorageOperationsContext, type SignMessageFn, type StepFinishEvent, type StockPriceClassification, type StockPricePreProcessorOptions, type StorageOperationsContext, type StoredConversation, type StoredConversationSummary, type StoredFileWithContext, type StoredMedia, type StoredMessage, type StoredMessageWithSimilarity, type StoredModelPreference, type StoredProject, type StoredUserPreference, type StoredVaultMemory, StreamExpiredError, type StreamMetaEvent, type StreamResumeHandle, type StreamSmoothingConfig, type StreamingTransport, type StreamingTransportOptions, type StreamingTransportResult, type StyleAnalysisSchedule, type SynthesizeProfileOptions, TOOL_CATALOG, TOPICS_EXTRACTION_VERSION, TOPIC_EXTRACTION_BATCH_SIZE, TREND_RECENT_WINDOW_DAYS, TREND_STALE_WINDOW_DAYS, type TextChunk, TextProcessor, type ToolConfig, type ToolExecutor, type ToolMatchOptions, type ToolMatchResult, type ToolSet, type ToolUseEndEvent, type ToolUseStartEvent, type TopicExtractOptions, type TopicExtractionInput, type TopicExtractionRunResult, type TurnCompleteEvent, type TurnSkippedEvent, type UncheckedReason, type UnverifiableReason, type UpdateMediaOptions, type UpdateModelPreferenceOptions, type UpdateProjectOptions, type UpdateUserPreferenceOptions, type UpdateVaultMemoryOptions, UserPreference, type UserPreferencesStorageOperationsContext, VAULT_SIZE_HOP_CAP, type VaultEmbeddingCache, VaultMemory, type VaultMemoryOperationsContext, type VaultMemoryVisibility, type VaultSaveOperation, type VaultSearchResult, type VerificationSources, type VerifyMemoriesForPublishOptions, WalletPoller, type WeatherClassification, type WeatherPreProcessorOptions, type WebSearchClassification, type WebSearchPreProcessorOptions, WordProcessor, ZipProcessor, type ZipProcessorOptions, activatedToolSetNames, analyzeStyle, archiveVaultMemoryOp, backfillMemoryTopicsOp, buildConnectorGuidance, buildDeniedToolsRider, buildSystemPrompt, capHopsForDensity, chunkAndEmbedAllMessages, chunkAndEmbedMessage, chunkText, classifyCryptoPrice, classifyCryptoPriceBatch, classifyDecay, classifyInjectionCandidates, classifyObservationTrend, classifyStockPrice, classifyStockPriceBatch, classifyWeather, classifyWeatherBatch, classifyWebSearch, classifyWebSearchBatch, cleanupConversationSummary, clearAllEncryptionKeys, clearAllEncryptionState, clearAllKeyPairs, clearEncryptionKey, clearKeyPair, clearLazyTitleCache, clearMessagesOp, clearServerToolsCache, composeHooks, createAutoExtractor, createChunkVectorCache, createConversationOp, createCryptoPricePreProcessor, createDecaySweeper, createLlmDecayClassifier, createLlmNeighborRefiner, createMediaBatchOp, createMediaOp, createMemoryEngineTool, createMemoryVaultSearchTool, createMemoryVaultTool, createMessageOp, createMessageSourceResolver, createPlatformCursorStore, createProjectOp, createRecallTool, createServerToolsFilter, createStockPricePreProcessor, createSummaryContext, createVaultEmbeddingCache, createVaultMemoriesBatchOp, createVaultMemoryOp, createWeatherPreProcessor, createWebSearchPreProcessor, decryptConversationTitle, decryptData, decryptDataBatch, decryptDataBytes, decryptDataBytesFromBytes, decryptDataWithKey, defaultServerToolsFilter, deleteAllVaultMemoriesForUserOp, deleteConversationOp, deleteConversationSummaryOp, deleteMediaByConversationOp, deleteMediaByMessageOp, deleteMediaOp, deleteModelPreferenceOp, deleteProjectOp, deleteUserPreferenceOp, deleteVaultMemoryOp, eagerEmbedContent, embedAllMessages, embedMessage, encryptData, encryptDataBatch, encryptDataBytes, encryptDataWithKey, estimateMessagesTokens, estimateTokens, exportPublicKey, extractAndLinkEntitiesForMemoriesOp, extractAndRetain, extractEntitiesForMemories, extractFacts, findMatchingTools, generateConversationId, generateEmbedding, generateEmbeddings, generateMediaId, generateProjectId, getAIGeneratedMediaOp, getAllFilesOp, getAllVaultMemoriesOp, getAllVaultMemoryContentsOp, getAudioOp, getCachedServerTools, getConversationOp, getConversationSummaryOp, getConversationsByProjectLazyOp, getConversationsByProjectOp, getConversationsLazyOp, getConversationsOp, getConversationsPageOp, getDecayCandidatesRawOp, getDocumentsOp, getEncryptionKey, getImagesOp, getMediaByConversationOp, getMediaByIdOp, getMediaByIdsOp, getMediaByMessageOp, getMediaByModelOp, getMediaByRoleOp, getMediaBySourceUrlOp, getMediaByTypeOp, getMediaCountOp, getMediaCountsByTypeOp, getMediaOp, getMediaTypeFromMime, getMemoriesNeedingTopicExtractionOp, getMessageOp, getMessagesOp, getModelPreferenceOp, getProjectConversationCountOp, getProjectConversationsOp, getProjectOp, getProjectsOp, getRecentMediaOp, getServerTools, getSupportedFileTypes, getToolsChecksum, getUnfiledVaultMemoriesOp, getUserPreferenceOp, getUserUploadedMediaOp, getVaultMemoryOp, getVideosOp, hardDeleteDecayedOp, hardDeleteMediaOp, hasEncryptionKey, hasKeyPair, ingestPublishedPhotoMemoriesOp, injectionSignatureCatalog, isRerankerAvailable, isSupportedFile, isSupportedMediaType, makeSyntheticStoredConversation, makeSyntheticStoredMessage, maybeSummarizeHistory, mediaToStored, migrateFromModelPreferencesOp, onKeyAvailable, parseMedia, preEmbedVaultMemories, preprocessFiles, progressiveSummarize, projectToStored, queueManager, rankProfileCandidates, recall, reflect, refreshEncryptionKeyIfMatches, relinkMemoryTopicsOp, relinkMisclassifiedVideosOp, renderTemplate, requestEncryptionKey, requestKeyPair, restoreVaultMemoryOp, resumeStream, retain, runToolLoop, sanitizeQuotes, schemaToCreateSQL, scoreProfileSalience, screenCandidatesForInjection, sdkMigrations, sdkModelClasses, sdkSchema, searchChunksOp, searchMediaOp, searchMessagesOp, searchVaultMemories, seedEncryptionKeys, selectServerToolsForPrompt, serverPlatformStorage, setMemoryVisibilityOp, setModelPreferenceOp, setUserPreferenceOp, shouldAnalyzeStyle, shouldChunkMessage, shouldRefreshTools, splitMessagesAtThreshold, stampTopicsExtractedAtOp, streamCancelPath, streamReplayPath, summarizeObservationTrends, summaryToSystemMessage, supersedeVaultMemoryOp, synthesizeProfile, toolSetSystemPrompts, traverseGraphLane, ttlForType, updateConversationProjectOp, updateConversationTitleOp, updateMediaMessageIdBatchOp, updateMediaOp, updateMessageChunksOp, updateMessageEmbeddingOp, updateMessageErrorOp, updateMessageFeedbackOp, updateModelsOp, updatePersonalityOp, updateProfileOp, updateProjectNameOp, updateProjectOp, updateVaultMemoryEmbeddingOp, updateVaultMemoryOp, upsertConversationSummaryOp, upsertMessageOp, verifyMemoriesForPublish };
|
|
10516
|
+
export { type AnalyzeStyleOptions, type AnalyzeStyleResult, type ApiResponse, type ApiType, type AutoExecutedToolResult, type AutoExtractMessage, type AutoExtractor, type Budget, type BuildPromptOptions, type BuildPromptResult, type CachedChunkVectors, type CachedServerTools, type ChatCompletionUsage, type ChatRole, type ChunkSearchResult, type ChunkVectorCache, type ChunkingOptions, type ConnectorGuidance, type ConnectorGuidanceInput, type ConsolidationFallbackReason, Conversation, ConversationSummary, type CreateAutoExtractorOptions, type CreateConversationOptions, type CreateDecaySweeperOptions, type CreateMediaOptions, type CreateMessageOptions, type CreateModelPreferenceOptions, type CreateProjectOptions, type CreateUserPreferenceOptions, type CreateVaultMemoryOptions, type CryptoPriceClassification, type CryptoPricePreProcessorOptions, DEFAULT_ANALYSIS_PROMPT, DEFAULT_ANALYZE_AFTER_MESSAGES, DEFAULT_CACHE_EXPIRATION_MS, DEFAULT_CHUNK_CACHE_SIZE, DEFAULT_CHUNK_OVERLAP, DEFAULT_CHUNK_SIZE, DEFAULT_DECAY_POLICY, DEFAULT_DOCUMENT_PATTERN, DEFAULT_EXCLUDED_SERVER_TOOLS, DEFAULT_MAX_CLASSIFIER_CALLS_PER_SWEEP, DEFAULT_MAX_INPUT_MESSAGES, DEFAULT_MAX_PROFILE_LENGTH, DEFAULT_MIN_CHUNK_SIZE, DEFAULT_MIN_MESSAGES, DEFAULT_PERSONALITY_SETTINGS, DEFAULT_PROFILE_FACETS, DEFAULT_PROFILE_FACT_TYPE_WEIGHTS, DEFAULT_PROFILE_PROOF_ALPHA, DEFAULT_PROFILE_TREND_MULTIPLIERS, DEFAULT_PROMPT_TEMPLATES, DEFAULT_REFRESH_EVERY_MESSAGES, DEFAULT_SERVER_TOOLS_MATCH_OPTIONS, DEFAULT_SUMMARY_MIN_WINDOW_MESSAGES, DEFAULT_SUMMARY_MODEL, DEFAULT_SUMMARY_TOKEN_THRESHOLD, DEFAULT_VAULT_CACHE_SIZE, DatabaseManager, type DatabaseManagerLogger, type DatabaseManagerOptions, type DecayCandidateRaw, type DecayClassifier, type DecayInput, type DecayPolicy, type DecaySweepResult, type DecaySweeper, type DecayVerdict, ENTITY_FANOUT, type EmbeddedWalletSignerFn, EncryptionKeyMissingError, ExcelProcessor, type ExtractFactsOptions, type ExtractOutcome, type ExtractedCandidate, type ExtractedEntity, type ExtractionCursorStore, type FactType, type FileMetadata, type FileProcessor, type FileTypeQuery, type FileWithData, type FlushResult, type GetConversationsPageOptions, type GraphTraversalOptions, HARD_DELETE_WINDOW_MS, INFERENCE_ID_HEADER, type InjectionClassifierOptions, type InjectionReason, type LazyStoredConversation, type LlmDecayClassifierOptions, type LlmNeighborRefinerOptions, type LlmTokenUsage, MAX_HOPS, MAX_MESSAGES_PER_SUMMARIZATION, MEDIUM_TTL_MS, Media, type MediaDimensions, type MediaFilterOptions, type MediaMetadata, type MediaOperationsContext, type MediaRole, type MediaType, type MemoriesNeedingTopicExtraction, type EmbeddingOptions as MemoryEngineEmbeddingOptions, type MemoryEngineResult, type MemoryEngineSearchOptions, type MemoryExtractedEvent, type MemoryKind, type MemoryQuarantinedEvent, type MemoryToVerify, type MemoryVaultSearchOptions, type MemoryVaultToolOptions, type MemoryVerification, Message, type MessageChunk, type MessageFeedback, type MessageOrigin, type ModelCallEndEvent, type ModelCallStartEvent, ModelPreference, NEVER_TTL_MS, NODE_BUDGET, type NeighborRefiner, type NowSource, type ObservationTrend, type ObservationTrendInput, type OperationExecutor, PAST_EVENT_GRACE_MS, PROFILE_DOC_VERSION, type ParsedServerToolsResponse, PdfProcessor, type PersonalitySettings, type PersonalitySliders, type PersonalityStyle, type PgClientLike, type PgPoolLike, type PhotoIngestResult, type PhotoMediaRef, type PlatformStorage, type PortalLlmAuth, type PortalLlmFailure, type PortalLlmFailureReason, PostgreSQLAdapter, type PostgreSQLAdapterOptions, type PreprocessingOptions, type PreprocessingResult, type ProcessedFileResult, ProcessorRegistry, type ProfileConfigFingerprint, type ProfileDoc, type ProfileFacet, type ProfileFacetKey, type ProfileSalienceInput, type ProfileSection, type ProfileUpdate, Project, type ProjectOperationsContext, type PromptContext, type PromptPreProcessor, type PromptPreProcessorContext, type PromptSection, type PromptTemplates, type PublishedPhotoMemory, type QuarantinedMemoryInfo, type QueueEncryptionContext, QueueManager, type QueueStatus, type QueuedOperation, type QueuedOperationType, RECALL_MAX_LIMIT, RECALL_TOOL_NAME, type RankedMemory, type RankedProfileCandidate, type RecallContext, type RecallDegradation, type RecallDiagnostics, type RecallOptions, type RecallResult, type RecallToolCallbacks, type RecallToolOptions, type RecencyOptions, type ReflectOptions, type ReflectResult, type RequestEncryptionKeyOptions, RerankerUnavailableError, type ResumeStreamOptions, type ResumeStreamResult, type RetainAction, type RetainContext, type RetainOptions, type RetainResult, type RetainSource, type RunEndEvent, type RunErrorEvent, type RunHooks, type RunStartEvent, type RunTerminalState, type RunToolLoopOptions, type RunToolLoopResult, SDK_SCHEMA_VERSION, SERVER_TOOL_DEPENDENCY_SETS, SHORT_TTL_MS, SLIDER_CONFIG, STREAM_RESUMABLE_HEADER, type ScoreBreakdown, type ScoreProfileSalienceOptions, type ScreenResult, type ScreenedCandidate, type SearchSource, type SelectServerToolsForPromptOptions, type ServerTool, type ServerToolCallEvent, type ServerToolsFilterFunction, type ServerToolsOptions, type ServerToolsResponse, type SettingsStorageOperationsContext, type SignMessageFn, type StepFinishEvent, type StockPriceClassification, type StockPricePreProcessorOptions, type StorageOperationsContext, type StoredConversation, type StoredConversationSummary, type StoredFileWithContext, type StoredMedia, type StoredMessage, type StoredMessageWithSimilarity, type StoredModelPreference, type StoredProject, type StoredUserPreference, type StoredVaultMemory, StreamExpiredError, type StreamMetaEvent, type StreamResumeHandle, type StreamSmoothingConfig, type StreamingTransport, type StreamingTransportOptions, type StreamingTransportResult, type StyleAnalysisSchedule, type SynthesizeProfileOptions, TOOL_CATALOG, TOPICS_EXTRACTION_VERSION, TOPIC_EXTRACTION_BATCH_SIZE, TREND_RECENT_WINDOW_DAYS, TREND_STALE_WINDOW_DAYS, type TextChunk, TextProcessor, type ToolConfig, type ToolExecutor, type ToolMatchOptions, type ToolMatchResult, type ToolSet, type ToolUseEndEvent, type ToolUseStartEvent, type TopicExtractOptions, type TopicExtractionInput, type TopicExtractionRunResult, type TopicSkipReason, type TurnCompleteEvent, type TurnSkippedEvent, type UncheckedReason, type UnverifiableReason, type UpdateMediaOptions, type UpdateModelPreferenceOptions, type UpdateProjectOptions, type UpdateUserPreferenceOptions, type UpdateVaultMemoryOptions, UserPreference, type UserPreferencesStorageOperationsContext, VAULT_SIZE_HOP_CAP, type VaultEmbeddingCache, VaultMemory, type VaultMemoryOperationsContext, type VaultMemoryVisibility, type VaultSaveOperation, type VaultSearchResult, type VerificationSources, type VerifyMemoriesForPublishOptions, WalletPoller, type WeatherClassification, type WeatherPreProcessorOptions, type WebSearchClassification, type WebSearchPreProcessorOptions, WordProcessor, ZipProcessor, type ZipProcessorOptions, activatedToolSetNames, analyzeStyle, archiveVaultMemoryOp, backfillMemoryTopicsOp, buildConnectorGuidance, buildDeniedToolsRider, buildSystemPrompt, capHopsForDensity, chunkAndEmbedAllMessages, chunkAndEmbedMessage, chunkText, classifyCryptoPrice, classifyCryptoPriceBatch, classifyDecay, classifyInjectionCandidates, classifyObservationTrend, classifyStockPrice, classifyStockPriceBatch, classifyWeather, classifyWeatherBatch, classifyWebSearch, classifyWebSearchBatch, cleanupConversationSummary, clearAllEncryptionKeys, clearAllEncryptionState, clearAllKeyPairs, clearEncryptionKey, clearKeyPair, clearLazyTitleCache, clearMessagesOp, clearServerToolsCache, composeHooks, createAutoExtractor, createChunkVectorCache, createConversationOp, createCryptoPricePreProcessor, createDecaySweeper, createLlmDecayClassifier, createLlmNeighborRefiner, createMediaBatchOp, createMediaOp, createMemoryEngineTool, createMemoryVaultSearchTool, createMemoryVaultTool, createMessageOp, createMessageSourceResolver, createPlatformCursorStore, createProjectOp, createRecallTool, createServerToolsFilter, createStockPricePreProcessor, createSummaryContext, createVaultEmbeddingCache, createVaultMemoriesBatchOp, createVaultMemoryOp, createWeatherPreProcessor, createWebSearchPreProcessor, decryptConversationTitle, decryptData, decryptDataBatch, decryptDataBytes, decryptDataBytesFromBytes, decryptDataWithKey, defaultServerToolsFilter, deleteAllVaultMemoriesForUserOp, deleteConversationOp, deleteConversationSummaryOp, deleteMediaByConversationOp, deleteMediaByMessageOp, deleteMediaOp, deleteModelPreferenceOp, deleteProjectOp, deleteUserPreferenceOp, deleteVaultMemoryOp, eagerEmbedContent, embedAllMessages, embedMessage, encryptData, encryptDataBatch, encryptDataBytes, encryptDataWithKey, estimateMessagesTokens, estimateTokens, exportPublicKey, extractAndLinkEntitiesForMemoriesOp, extractAndRetain, extractEntitiesForMemories, extractFacts, findMatchingTools, generateConversationId, generateEmbedding, generateEmbeddings, generateMediaId, generateProjectId, getAIGeneratedMediaOp, getAllFilesOp, getAllVaultMemoriesOp, getAllVaultMemoryContentsOp, getAudioOp, getCachedServerTools, getConversationOp, getConversationSummaryOp, getConversationsByProjectLazyOp, getConversationsByProjectOp, getConversationsLazyOp, getConversationsOp, getConversationsPageOp, getDecayCandidatesRawOp, getDocumentsOp, getEncryptionKey, getImagesOp, getMediaByConversationOp, getMediaByIdOp, getMediaByIdsOp, getMediaByMessageOp, getMediaByModelOp, getMediaByRoleOp, getMediaBySourceUrlOp, getMediaByTypeOp, getMediaCountOp, getMediaCountsByTypeOp, getMediaOp, getMediaTypeFromMime, getMemoriesNeedingTopicExtractionOp, getMessageOp, getMessagesOp, getModelPreferenceOp, getProjectConversationCountOp, getProjectConversationsOp, getProjectOp, getProjectsOp, getRecentMediaOp, getServerTools, getSupportedFileTypes, getToolsChecksum, getUnfiledVaultMemoriesOp, getUserPreferenceOp, getUserUploadedMediaOp, getVaultMemoryOp, getVideosOp, hardDeleteDecayedOp, hardDeleteMediaOp, hasEncryptionKey, hasKeyPair, ingestPublishedPhotoMemoriesOp, injectionSignatureCatalog, isDegradedTopicSkip, isRerankerAvailable, isSupportedFile, isSupportedMediaType, makeSyntheticStoredConversation, makeSyntheticStoredMessage, maybeSummarizeHistory, mediaToStored, migrateFromModelPreferencesOp, onKeyAvailable, parseMedia, preEmbedVaultMemories, preprocessFiles, progressiveSummarize, projectToStored, queueManager, rankProfileCandidates, recall, reflect, refreshEncryptionKeyIfMatches, relinkMemoryTopicsOp, relinkMisclassifiedVideosOp, renderTemplate, requestEncryptionKey, requestKeyPair, restoreVaultMemoryOp, resumeStream, retain, runToolLoop, sanitizeQuotes, schemaToCreateSQL, scoreProfileSalience, screenCandidatesForInjection, sdkMigrations, sdkModelClasses, sdkSchema, searchChunksOp, searchMediaOp, searchMessagesOp, searchVaultMemories, seedEncryptionKeys, selectServerToolsForPrompt, serverPlatformStorage, setMemoryVisibilityOp, setModelPreferenceOp, setUserPreferenceOp, shouldAnalyzeStyle, shouldChunkMessage, shouldRefreshTools, splitMessagesAtThreshold, stampTopicsExtractedAtOp, streamCancelPath, streamReplayPath, summarizeObservationTrends, summaryToSystemMessage, supersedeVaultMemoryOp, synthesizeProfile, toolSetSystemPrompts, traverseGraphLane, ttlForType, updateConversationProjectOp, updateConversationTitleOp, updateMediaMessageIdBatchOp, updateMediaOp, updateMessageChunksOp, updateMessageEmbeddingOp, updateMessageErrorOp, updateMessageFeedbackOp, updateModelsOp, updatePersonalityOp, updateProfileOp, updateProjectNameOp, updateProjectOp, updateVaultMemoryEmbeddingOp, updateVaultMemoryOp, upsertConversationSummaryOp, upsertMessageOp, verifyMemoriesForPublish };
|