@anuma/sdk 6.2.0 → 6.3.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-NH5VY3G7.mjs → chunk-PBCULYOW.mjs} +21 -1
- package/dist/expo/index.cjs +198 -74
- package/dist/expo/index.d.mts +136 -3
- package/dist/expo/index.d.ts +136 -3
- package/dist/expo/index.mjs +163 -67
- package/dist/expo/{recall-ZIKIYARO.mjs → recall-UVM2366D.mjs} +1 -1
- package/dist/react/{chunk-EMVLDEPB.mjs → chunk-TI3UVQPF.mjs} +21 -1
- package/dist/react/index.cjs +198 -74
- package/dist/react/index.d.mts +136 -3
- package/dist/react/index.d.ts +136 -3
- package/dist/react/index.mjs +163 -67
- package/dist/react/{recall-B7POS7NA.mjs → recall-PCM7H5TA.mjs} +1 -1
- package/dist/server/{chunk-6JS7SY6A.mjs → chunk-S5WEN7TE.mjs} +21 -1
- package/dist/server/index.cjs +198 -74
- package/dist/server/index.d.mts +136 -3
- package/dist/server/index.d.ts +136 -3
- package/dist/server/index.mjs +163 -67
- package/dist/server/{recall-IM6RLRI6.mjs → recall-BQSCJBGI.mjs} +1 -1
- package/package.json +1 -1
package/dist/server/index.cjs
CHANGED
|
@@ -17419,6 +17419,27 @@ var init_encryption2 = __esm({
|
|
|
17419
17419
|
}
|
|
17420
17420
|
});
|
|
17421
17421
|
|
|
17422
|
+
// src/lib/db/memoryVault/types.ts
|
|
17423
|
+
function parseMedia(value) {
|
|
17424
|
+
if (typeof value !== "string" || value === "") return null;
|
|
17425
|
+
try {
|
|
17426
|
+
const parsed = JSON.parse(value);
|
|
17427
|
+
if (!Array.isArray(parsed)) return null;
|
|
17428
|
+
const refs = parsed.filter((r) => typeof r === "object" && r !== null).map((r) => ({
|
|
17429
|
+
feedItemId: Number(r.feedItemId ?? r.feed_item_id),
|
|
17430
|
+
objectKey: r.objectKey ?? r.object_key ?? null
|
|
17431
|
+
})).filter((r) => Number.isFinite(r.feedItemId));
|
|
17432
|
+
return refs.length > 0 ? refs : null;
|
|
17433
|
+
} catch {
|
|
17434
|
+
return null;
|
|
17435
|
+
}
|
|
17436
|
+
}
|
|
17437
|
+
var init_types4 = __esm({
|
|
17438
|
+
"src/lib/db/memoryVault/types.ts"() {
|
|
17439
|
+
"use strict";
|
|
17440
|
+
}
|
|
17441
|
+
});
|
|
17442
|
+
|
|
17422
17443
|
// src/lib/db/memoryVault/operations.ts
|
|
17423
17444
|
function visibilityOrPrivate(value) {
|
|
17424
17445
|
return value === "public" ? value : "private";
|
|
@@ -17480,6 +17501,7 @@ function vaultMemoryToStoredRaw(memory) {
|
|
|
17480
17501
|
sourceChunkIds,
|
|
17481
17502
|
proofCount: memory.proofCount ?? null,
|
|
17482
17503
|
source: memory.source ?? null,
|
|
17504
|
+
media: parseMedia(memory.media),
|
|
17483
17505
|
eventTimeStart: memory.eventTimeStart ?? null,
|
|
17484
17506
|
eventTimeEnd: memory.eventTimeEnd ?? null,
|
|
17485
17507
|
eventTimeKind: memory.eventTimeKind ?? null,
|
|
@@ -17762,6 +17784,7 @@ function vaultMemoryRawToStoredRaw(raw) {
|
|
|
17762
17784
|
eventTimeKind: raw.event_time_kind ?? null,
|
|
17763
17785
|
// SQLite stores booleans as 0/1, LokiJS as true/false — coerce both.
|
|
17764
17786
|
topicsUserManaged: raw.topics_user_managed === true || raw.topics_user_managed === 1,
|
|
17787
|
+
media: parseMedia(raw.media),
|
|
17765
17788
|
topics: parseTopics(raw.topics),
|
|
17766
17789
|
topicsUpdatedAt: raw.topics_updated_at ?? null,
|
|
17767
17790
|
topicsExtractedAt: raw.topics_extracted_at ?? null,
|
|
@@ -18486,6 +18509,7 @@ var init_operations3 = __esm({
|
|
|
18486
18509
|
init_operations2();
|
|
18487
18510
|
init_types3();
|
|
18488
18511
|
init_encryption2();
|
|
18512
|
+
init_types4();
|
|
18489
18513
|
NON_PRIVATE_VISIBILITIES = ["public"];
|
|
18490
18514
|
KNOWN_TRUST_TIERS = /* @__PURE__ */ new Set(["quarantined", "trusted"]);
|
|
18491
18515
|
TOPICS_EXTRACTION_VERSION = 3;
|
|
@@ -19997,17 +20021,17 @@ function recencyMultiplier(updatedAt, opts = {}) {
|
|
|
19997
20021
|
const now = opts.now ?? /* @__PURE__ */ new Date();
|
|
19998
20022
|
const nowMs2 = now.getTime();
|
|
19999
20023
|
if (!Number.isFinite(nowMs2)) return noDate;
|
|
20000
|
-
const ageDays2 = Math.max(0, (nowMs2 - updatedMs) /
|
|
20024
|
+
const ageDays2 = Math.max(0, (nowMs2 - updatedMs) / DAY_MS2);
|
|
20001
20025
|
const perYearDecay = opts.perYearDecay ?? DEFAULT_PER_YEAR_DECAY;
|
|
20002
20026
|
const floor = opts.floor ?? DEFAULT_FLOOR;
|
|
20003
20027
|
const decay = perYearDecay * (ageDays2 / 365);
|
|
20004
20028
|
return Math.max(floor, 1 - decay);
|
|
20005
20029
|
}
|
|
20006
|
-
var
|
|
20030
|
+
var DAY_MS2, DEFAULT_PER_YEAR_DECAY, DEFAULT_FLOOR, DEFAULT_NO_DATE_MULTIPLIER;
|
|
20007
20031
|
var init_recency = __esm({
|
|
20008
20032
|
"src/lib/memory/recency.ts"() {
|
|
20009
20033
|
"use strict";
|
|
20010
|
-
|
|
20034
|
+
DAY_MS2 = 1e3 * 60 * 60 * 24;
|
|
20011
20035
|
DEFAULT_PER_YEAR_DECAY = 0.2;
|
|
20012
20036
|
DEFAULT_FLOOR = 0.1;
|
|
20013
20037
|
DEFAULT_NO_DATE_MULTIPLIER = 0.5;
|
|
@@ -20997,8 +21021,8 @@ function classifyObservationTrend(input, now = Date.now()) {
|
|
|
20997
21021
|
const lastMsRaw = input.lastObservedAt;
|
|
20998
21022
|
const lastMs = lastMsRaw !== null && lastMsRaw !== void 0 && Number.isFinite(lastMsRaw) ? Math.max(createdMs, lastMsRaw) : createdMs;
|
|
20999
21023
|
const proofs = Math.max(1, input.proofCount ?? 1);
|
|
21000
|
-
const ageDays2 = Math.max(0, (now - createdMs) /
|
|
21001
|
-
const daysSinceLast = Math.max(0, (now - lastMs) /
|
|
21024
|
+
const ageDays2 = Math.max(0, (now - createdMs) / DAY_MS3);
|
|
21025
|
+
const daysSinceLast = Math.max(0, (now - lastMs) / DAY_MS3);
|
|
21002
21026
|
if (daysSinceLast >= TREND_STALE_WINDOW_DAYS) return "stale";
|
|
21003
21027
|
if (daysSinceLast >= TREND_RECENT_WINDOW_DAYS) return "weakening";
|
|
21004
21028
|
if (ageDays2 <= TREND_RECENT_WINDOW_DAYS && proofs <= 2) return "new";
|
|
@@ -21019,11 +21043,11 @@ function summarizeObservationTrends(inputs, now = Date.now()) {
|
|
|
21019
21043
|
}
|
|
21020
21044
|
return counts;
|
|
21021
21045
|
}
|
|
21022
|
-
var
|
|
21046
|
+
var DAY_MS3, TREND_RECENT_WINDOW_DAYS, TREND_STALE_WINDOW_DAYS;
|
|
21023
21047
|
var init_observationTrend = __esm({
|
|
21024
21048
|
"src/lib/memory/observationTrend.ts"() {
|
|
21025
21049
|
"use strict";
|
|
21026
|
-
|
|
21050
|
+
DAY_MS3 = 1e3 * 60 * 60 * 24;
|
|
21027
21051
|
TREND_RECENT_WINDOW_DAYS = 30;
|
|
21028
21052
|
TREND_STALE_WINDOW_DAYS = 90;
|
|
21029
21053
|
}
|
|
@@ -24039,6 +24063,7 @@ __export(index_exports, {
|
|
|
24039
24063
|
hardDeleteMediaOp: () => hardDeleteMediaOp,
|
|
24040
24064
|
hasEncryptionKey: () => hasEncryptionKey,
|
|
24041
24065
|
hasKeyPair: () => hasKeyPair,
|
|
24066
|
+
ingestPublishedPhotoMemoriesOp: () => ingestPublishedPhotoMemoriesOp,
|
|
24042
24067
|
injectionSignatureCatalog: () => injectionSignatureCatalog,
|
|
24043
24068
|
isRerankerAvailable: () => isRerankerAvailable,
|
|
24044
24069
|
isSupportedFile: () => isSupportedFile,
|
|
@@ -24049,6 +24074,7 @@ __export(index_exports, {
|
|
|
24049
24074
|
mediaToStored: () => mediaToStored,
|
|
24050
24075
|
migrateFromModelPreferencesOp: () => migrateFromModelPreferencesOp,
|
|
24051
24076
|
onKeyAvailable: () => onKeyAvailable,
|
|
24077
|
+
parseMedia: () => parseMedia,
|
|
24052
24078
|
preEmbedVaultMemories: () => preEmbedVaultMemories,
|
|
24053
24079
|
preprocessFiles: () => preprocessFiles,
|
|
24054
24080
|
progressiveSummarize: () => progressiveSummarize,
|
|
@@ -24456,6 +24482,9 @@ __decorateClass([
|
|
|
24456
24482
|
__decorateClass([
|
|
24457
24483
|
(0, import_decorators6.field)("topics_updated_at")
|
|
24458
24484
|
], VaultMemory.prototype, "topicsUpdatedAt", 2);
|
|
24485
|
+
__decorateClass([
|
|
24486
|
+
(0, import_decorators6.field)("media")
|
|
24487
|
+
], VaultMemory.prototype, "media", 2);
|
|
24459
24488
|
__decorateClass([
|
|
24460
24489
|
(0, import_decorators6.field)("topics_extracted_at")
|
|
24461
24490
|
], VaultMemory.prototype, "topicsExtractedAt", 2);
|
|
@@ -24639,7 +24668,7 @@ __decorateClass([
|
|
|
24639
24668
|
], VaultFolder.prototype, "context", 2);
|
|
24640
24669
|
|
|
24641
24670
|
// src/lib/db/schema.ts
|
|
24642
|
-
var SDK_SCHEMA_VERSION =
|
|
24671
|
+
var SDK_SCHEMA_VERSION = 45;
|
|
24643
24672
|
var sdkSchema = (0, import_watermelondb12.appSchema)({
|
|
24644
24673
|
version: SDK_SCHEMA_VERSION,
|
|
24645
24674
|
tables: [
|
|
@@ -24787,6 +24816,18 @@ var sdkSchema = (0, import_watermelondb12.appSchema)({
|
|
|
24787
24816
|
// paths key on `updated_at` — so without this a topic-only change would
|
|
24788
24817
|
// neither upload nor merge. Null = `topics` never written.
|
|
24789
24818
|
{ name: "topics_updated_at", type: "number", isOptional: true },
|
|
24819
|
+
// The photo(s) a SERVER-EXTRACTED memory was read out of, as a JSON
|
|
24820
|
+
// array of `{feed_item_id, object_key}` — exactly what
|
|
24821
|
+
// GET /api/memories/published returns in `media[]`. Enough to render the
|
|
24822
|
+
// source image without a second round-trip per memory.
|
|
24823
|
+
//
|
|
24824
|
+
// A JSON column rather than a join table: nothing on the client ever
|
|
24825
|
+
// queries BY photo (the only direction is memory -> render its image),
|
|
24826
|
+
// so a table would add a sync lane and a local-id space to serve a
|
|
24827
|
+
// question nobody asks. `topics` and `source_chunk_ids` set the
|
|
24828
|
+
// precedent for a list that is only ever read back whole. Null on
|
|
24829
|
+
// anything not extracted from a photo.
|
|
24830
|
+
{ name: "media", type: "string", isOptional: true },
|
|
24790
24831
|
// Unix ms of the last LLM topic-extraction pass over this memory's
|
|
24791
24832
|
// content. Null = never extracted standalone (legacy rows with entity
|
|
24792
24833
|
// links are grandfathered — see getMemoriesNeedingTopicExtractionOp).
|
|
@@ -25621,6 +25662,20 @@ var sdkMigrations = (0, import_migrations.schemaMigrations)({
|
|
|
25621
25662
|
columns: [{ name: "origin", type: "string", isOptional: true }]
|
|
25622
25663
|
})
|
|
25623
25664
|
]
|
|
25665
|
+
},
|
|
25666
|
+
// v44 -> v45: `media` on memory_vault — the photo(s) a server-extracted
|
|
25667
|
+
// memory was read out of, as JSON `[{feed_item_id, object_key}]`, mirroring
|
|
25668
|
+
// the `media[]` that GET /api/memories/published already returns. Existing
|
|
25669
|
+
// rows keep NULL, which is the correct value for every memory that did not
|
|
25670
|
+
// come from a photo (i.e. all of them until photo ingest runs).
|
|
25671
|
+
{
|
|
25672
|
+
toVersion: 45,
|
|
25673
|
+
steps: [
|
|
25674
|
+
(0, import_migrations.addColumns)({
|
|
25675
|
+
table: "memory_vault",
|
|
25676
|
+
columns: [{ name: "media", type: "string", isOptional: true }]
|
|
25677
|
+
})
|
|
25678
|
+
]
|
|
25624
25679
|
}
|
|
25625
25680
|
]
|
|
25626
25681
|
});
|
|
@@ -26912,6 +26967,138 @@ async function cleanupConversationSummary(database, conversationId) {
|
|
|
26912
26967
|
// src/lib/db/memoryVault/index.ts
|
|
26913
26968
|
init_operations3();
|
|
26914
26969
|
|
|
26970
|
+
// src/lib/memory/decay.ts
|
|
26971
|
+
init_logger();
|
|
26972
|
+
var DAY_MS = 24 * 60 * 60 * 1e3;
|
|
26973
|
+
var SHORT_TTL_MS = 30 * DAY_MS;
|
|
26974
|
+
var MEDIUM_TTL_MS = 180 * DAY_MS;
|
|
26975
|
+
var SOURCE_PHOTO = "photo";
|
|
26976
|
+
var NEVER_TTL_MS = Number.POSITIVE_INFINITY;
|
|
26977
|
+
var HARD_DELETE_WINDOW_MS = 30 * DAY_MS;
|
|
26978
|
+
var PAST_EVENT_GRACE_MS = 7 * DAY_MS;
|
|
26979
|
+
var DEFAULT_DECAY_POLICY = {
|
|
26980
|
+
ttlByType: {
|
|
26981
|
+
identity: NEVER_TTL_MS,
|
|
26982
|
+
preference: NEVER_TTL_MS,
|
|
26983
|
+
relationship: NEVER_TTL_MS,
|
|
26984
|
+
constraint: NEVER_TTL_MS,
|
|
26985
|
+
plan: SHORT_TTL_MS,
|
|
26986
|
+
ongoing_context: SHORT_TTL_MS,
|
|
26987
|
+
other: MEDIUM_TTL_MS
|
|
26988
|
+
},
|
|
26989
|
+
fallbackTtlMs: MEDIUM_TTL_MS,
|
|
26990
|
+
hardDeleteWindowMs: HARD_DELETE_WINDOW_MS,
|
|
26991
|
+
pastEventGraceMs: PAST_EVENT_GRACE_MS
|
|
26992
|
+
};
|
|
26993
|
+
function resolvePolicy(policy) {
|
|
26994
|
+
if (!policy) return DEFAULT_DECAY_POLICY;
|
|
26995
|
+
return {
|
|
26996
|
+
ttlByType: { ...DEFAULT_DECAY_POLICY.ttlByType, ...policy.ttlByType },
|
|
26997
|
+
fallbackTtlMs: policy.fallbackTtlMs ?? DEFAULT_DECAY_POLICY.fallbackTtlMs,
|
|
26998
|
+
hardDeleteWindowMs: policy.hardDeleteWindowMs ?? DEFAULT_DECAY_POLICY.hardDeleteWindowMs,
|
|
26999
|
+
pastEventGraceMs: policy.pastEventGraceMs ?? DEFAULT_DECAY_POLICY.pastEventGraceMs
|
|
27000
|
+
};
|
|
27001
|
+
}
|
|
27002
|
+
function ttlForType(factType, policy) {
|
|
27003
|
+
const resolved = resolvePolicy(policy);
|
|
27004
|
+
if (factType === null) return resolved.fallbackTtlMs;
|
|
27005
|
+
return resolved.ttlByType[factType] ?? resolved.fallbackTtlMs;
|
|
27006
|
+
}
|
|
27007
|
+
function isTimeSensitiveType(factType) {
|
|
27008
|
+
return factType === "plan" || factType === "ongoing_context";
|
|
27009
|
+
}
|
|
27010
|
+
function hasFiniteTimestamps(m, now) {
|
|
27011
|
+
return Number.isFinite(now) && Number.isFinite(m.updatedAt) && (m.archivedAt === null || Number.isFinite(m.archivedAt));
|
|
27012
|
+
}
|
|
27013
|
+
function classifyDecay(m, now, policy) {
|
|
27014
|
+
const resolved = resolvePolicy(policy);
|
|
27015
|
+
if (!hasFiniteTimestamps(m, now)) {
|
|
27016
|
+
getLogger().warn("[memory/decay] non-finite timestamp on a memory row; keeping it", {
|
|
27017
|
+
now,
|
|
27018
|
+
updatedAt: m.updatedAt,
|
|
27019
|
+
archivedAt: m.archivedAt,
|
|
27020
|
+
factType: m.factType
|
|
27021
|
+
});
|
|
27022
|
+
return "keep";
|
|
27023
|
+
}
|
|
27024
|
+
if (m.archivedAt !== null) {
|
|
27025
|
+
return now - m.archivedAt > resolved.hardDeleteWindowMs ? "delete" : "keep";
|
|
27026
|
+
}
|
|
27027
|
+
if (m.source === "manual" || m.source === SOURCE_PHOTO) return "keep";
|
|
27028
|
+
if (isTimeSensitiveType(m.factType) && m.eventTimeEnd !== null) {
|
|
27029
|
+
if (m.eventTimeEnd < now - resolved.pastEventGraceMs) return "archive";
|
|
27030
|
+
if (m.eventTimeEnd >= now) return "keep";
|
|
27031
|
+
}
|
|
27032
|
+
if (now - m.updatedAt > ttlForType(m.factType, resolved)) return "archive";
|
|
27033
|
+
return "keep";
|
|
27034
|
+
}
|
|
27035
|
+
|
|
27036
|
+
// src/lib/db/memoryVault/photoIngest.ts
|
|
27037
|
+
init_encryption2();
|
|
27038
|
+
var PHOTO_MEMORY_ID_PREFIX = "photo:";
|
|
27039
|
+
async function ingestPublishedPhotoMemoriesOp(ctx, rows) {
|
|
27040
|
+
const byId = /* @__PURE__ */ new Map();
|
|
27041
|
+
for (const r of rows) {
|
|
27042
|
+
if (typeof r.memoryId !== "string" || !r.memoryId.startsWith(PHOTO_MEMORY_ID_PREFIX)) continue;
|
|
27043
|
+
if (!byId.has(r.memoryId)) byId.set(r.memoryId, r);
|
|
27044
|
+
}
|
|
27045
|
+
const photoRows = [...byId.values()];
|
|
27046
|
+
if (photoRows.length === 0) return { inserted: 0, skipped: 0 };
|
|
27047
|
+
const known = await ctx.vaultMemoryCollection.query().fetchIds().then((ids) => new Set(ids));
|
|
27048
|
+
const candidates = photoRows.filter((r) => !known.has(r.memoryId));
|
|
27049
|
+
if (candidates.length === 0) return { inserted: 0, skipped: photoRows.length };
|
|
27050
|
+
const fresh = candidates;
|
|
27051
|
+
const contents = await Promise.all(
|
|
27052
|
+
fresh.map(async (r) => {
|
|
27053
|
+
if (ctx.walletAddress && ctx.signMessage) {
|
|
27054
|
+
return encryptVaultMemoryContent(
|
|
27055
|
+
r.text,
|
|
27056
|
+
ctx.walletAddress,
|
|
27057
|
+
ctx.signMessage,
|
|
27058
|
+
ctx.embeddedWalletSigner
|
|
27059
|
+
);
|
|
27060
|
+
}
|
|
27061
|
+
return r.text;
|
|
27062
|
+
})
|
|
27063
|
+
);
|
|
27064
|
+
const now = Date.now();
|
|
27065
|
+
let inserted = 0;
|
|
27066
|
+
await ctx.database.write(async () => {
|
|
27067
|
+
const present = new Set(await ctx.vaultMemoryCollection.query().fetchIds());
|
|
27068
|
+
const writable = fresh.map((row, i) => ({ row, content: contents[i] })).filter(({ row }) => !present.has(row.memoryId));
|
|
27069
|
+
inserted = writable.length;
|
|
27070
|
+
if (writable.length === 0) return;
|
|
27071
|
+
const prepared = writable.map(
|
|
27072
|
+
({ row, content }) => ctx.vaultMemoryCollection.prepareCreate((record) => {
|
|
27073
|
+
record._raw.id = row.memoryId;
|
|
27074
|
+
record._setRaw("content", content);
|
|
27075
|
+
record._setRaw("scope", "private");
|
|
27076
|
+
record._setRaw("folder_id", null);
|
|
27077
|
+
record._setRaw("user_id", ctx.userId ?? null);
|
|
27078
|
+
record._setRaw("is_deleted", false);
|
|
27079
|
+
record._setRaw("proof_count", 1);
|
|
27080
|
+
record._setRaw("source", SOURCE_PHOTO);
|
|
27081
|
+
record._setRaw(
|
|
27082
|
+
"media",
|
|
27083
|
+
row.media && row.media.length > 0 ? JSON.stringify(row.media) : null
|
|
27084
|
+
);
|
|
27085
|
+
record._setRaw("visibility", "public");
|
|
27086
|
+
record._setRaw("published_at", now);
|
|
27087
|
+
if (row.eventTime) {
|
|
27088
|
+
record._setRaw("event_time_start", row.eventTime.start ?? null);
|
|
27089
|
+
record._setRaw("event_time_end", row.eventTime.end ?? null);
|
|
27090
|
+
record._setRaw("event_time_kind", row.eventTime.kind ?? null);
|
|
27091
|
+
}
|
|
27092
|
+
})
|
|
27093
|
+
);
|
|
27094
|
+
await ctx.database.batch(...prepared);
|
|
27095
|
+
});
|
|
27096
|
+
return { inserted, skipped: photoRows.length - inserted };
|
|
27097
|
+
}
|
|
27098
|
+
|
|
27099
|
+
// src/lib/db/memoryVault/index.ts
|
|
27100
|
+
init_types4();
|
|
27101
|
+
|
|
26915
27102
|
// src/lib/db/project/operations.ts
|
|
26916
27103
|
var import_watermelondb18 = __toESM(require_watermelondb());
|
|
26917
27104
|
init_operations();
|
|
@@ -29619,71 +29806,6 @@ function createChunkVectorCache(maxSize = DEFAULT_CHUNK_CACHE_SIZE) {
|
|
|
29619
29806
|
return new LRUCache(maxSize);
|
|
29620
29807
|
}
|
|
29621
29808
|
|
|
29622
|
-
// src/lib/memory/decay.ts
|
|
29623
|
-
init_logger();
|
|
29624
|
-
var DAY_MS3 = 24 * 60 * 60 * 1e3;
|
|
29625
|
-
var SHORT_TTL_MS = 30 * DAY_MS3;
|
|
29626
|
-
var MEDIUM_TTL_MS = 180 * DAY_MS3;
|
|
29627
|
-
var NEVER_TTL_MS = Number.POSITIVE_INFINITY;
|
|
29628
|
-
var HARD_DELETE_WINDOW_MS = 30 * DAY_MS3;
|
|
29629
|
-
var PAST_EVENT_GRACE_MS = 7 * DAY_MS3;
|
|
29630
|
-
var DEFAULT_DECAY_POLICY = {
|
|
29631
|
-
ttlByType: {
|
|
29632
|
-
identity: NEVER_TTL_MS,
|
|
29633
|
-
preference: NEVER_TTL_MS,
|
|
29634
|
-
relationship: NEVER_TTL_MS,
|
|
29635
|
-
constraint: NEVER_TTL_MS,
|
|
29636
|
-
plan: SHORT_TTL_MS,
|
|
29637
|
-
ongoing_context: SHORT_TTL_MS,
|
|
29638
|
-
other: MEDIUM_TTL_MS
|
|
29639
|
-
},
|
|
29640
|
-
fallbackTtlMs: MEDIUM_TTL_MS,
|
|
29641
|
-
hardDeleteWindowMs: HARD_DELETE_WINDOW_MS,
|
|
29642
|
-
pastEventGraceMs: PAST_EVENT_GRACE_MS
|
|
29643
|
-
};
|
|
29644
|
-
function resolvePolicy(policy) {
|
|
29645
|
-
if (!policy) return DEFAULT_DECAY_POLICY;
|
|
29646
|
-
return {
|
|
29647
|
-
ttlByType: { ...DEFAULT_DECAY_POLICY.ttlByType, ...policy.ttlByType },
|
|
29648
|
-
fallbackTtlMs: policy.fallbackTtlMs ?? DEFAULT_DECAY_POLICY.fallbackTtlMs,
|
|
29649
|
-
hardDeleteWindowMs: policy.hardDeleteWindowMs ?? DEFAULT_DECAY_POLICY.hardDeleteWindowMs,
|
|
29650
|
-
pastEventGraceMs: policy.pastEventGraceMs ?? DEFAULT_DECAY_POLICY.pastEventGraceMs
|
|
29651
|
-
};
|
|
29652
|
-
}
|
|
29653
|
-
function ttlForType(factType, policy) {
|
|
29654
|
-
const resolved = resolvePolicy(policy);
|
|
29655
|
-
if (factType === null) return resolved.fallbackTtlMs;
|
|
29656
|
-
return resolved.ttlByType[factType] ?? resolved.fallbackTtlMs;
|
|
29657
|
-
}
|
|
29658
|
-
function isTimeSensitiveType(factType) {
|
|
29659
|
-
return factType === "plan" || factType === "ongoing_context";
|
|
29660
|
-
}
|
|
29661
|
-
function hasFiniteTimestamps(m, now) {
|
|
29662
|
-
return Number.isFinite(now) && Number.isFinite(m.updatedAt) && (m.archivedAt === null || Number.isFinite(m.archivedAt));
|
|
29663
|
-
}
|
|
29664
|
-
function classifyDecay(m, now, policy) {
|
|
29665
|
-
const resolved = resolvePolicy(policy);
|
|
29666
|
-
if (!hasFiniteTimestamps(m, now)) {
|
|
29667
|
-
getLogger().warn("[memory/decay] non-finite timestamp on a memory row; keeping it", {
|
|
29668
|
-
now,
|
|
29669
|
-
updatedAt: m.updatedAt,
|
|
29670
|
-
archivedAt: m.archivedAt,
|
|
29671
|
-
factType: m.factType
|
|
29672
|
-
});
|
|
29673
|
-
return "keep";
|
|
29674
|
-
}
|
|
29675
|
-
if (m.archivedAt !== null) {
|
|
29676
|
-
return now - m.archivedAt > resolved.hardDeleteWindowMs ? "delete" : "keep";
|
|
29677
|
-
}
|
|
29678
|
-
if (m.source === "manual") return "keep";
|
|
29679
|
-
if (isTimeSensitiveType(m.factType) && m.eventTimeEnd !== null) {
|
|
29680
|
-
if (m.eventTimeEnd < now - resolved.pastEventGraceMs) return "archive";
|
|
29681
|
-
if (m.eventTimeEnd >= now) return "keep";
|
|
29682
|
-
}
|
|
29683
|
-
if (now - m.updatedAt > ttlForType(m.factType, resolved)) return "archive";
|
|
29684
|
-
return "keep";
|
|
29685
|
-
}
|
|
29686
|
-
|
|
29687
29809
|
// src/lib/memory/decayClassifier.ts
|
|
29688
29810
|
init_logger();
|
|
29689
29811
|
init_redactor();
|
|
@@ -29786,7 +29908,7 @@ function toDecayInput(c) {
|
|
|
29786
29908
|
};
|
|
29787
29909
|
}
|
|
29788
29910
|
function isBorderline(input) {
|
|
29789
|
-
if (input.source === "manual") return false;
|
|
29911
|
+
if (input.source === "manual" || input.source === SOURCE_PHOTO) return false;
|
|
29790
29912
|
if (input.trustTier === "quarantined") return false;
|
|
29791
29913
|
if (input.archivedAt !== null) return false;
|
|
29792
29914
|
if (input.factType === null || input.factType === "other") return true;
|
|
@@ -37106,6 +37228,7 @@ function buildSystemPrompt(ctx, options) {
|
|
|
37106
37228
|
hardDeleteMediaOp,
|
|
37107
37229
|
hasEncryptionKey,
|
|
37108
37230
|
hasKeyPair,
|
|
37231
|
+
ingestPublishedPhotoMemoriesOp,
|
|
37109
37232
|
injectionSignatureCatalog,
|
|
37110
37233
|
isRerankerAvailable,
|
|
37111
37234
|
isSupportedFile,
|
|
@@ -37116,6 +37239,7 @@ function buildSystemPrompt(ctx, options) {
|
|
|
37116
37239
|
mediaToStored,
|
|
37117
37240
|
migrateFromModelPreferencesOp,
|
|
37118
37241
|
onKeyAvailable,
|
|
37242
|
+
parseMedia,
|
|
37119
37243
|
preEmbedVaultMemories,
|
|
37120
37244
|
preprocessFiles,
|
|
37121
37245
|
progressiveSummarize,
|
package/dist/server/index.d.mts
CHANGED
|
@@ -103,8 +103,11 @@ import { ResultCallback } from '@nozbe/watermelondb/utils/fp/Result';
|
|
|
103
103
|
* unreadable flag would fail open. Existing rows stay NULL (= legacy,
|
|
104
104
|
* unknown provenance, embedded as before) with no backfill, matching the v37
|
|
105
105
|
* read-time-fallback precedent
|
|
106
|
+
* - v45: Added `media` to memory_vault — the photo(s) a server-extracted
|
|
107
|
+
* memory came from, as JSON `[{feed_item_id, object_key}]`. Null on every
|
|
108
|
+
* row that did not come from a photo, which is all of them before this
|
|
106
109
|
*/
|
|
107
|
-
declare const SDK_SCHEMA_VERSION =
|
|
110
|
+
declare const SDK_SCHEMA_VERSION = 45;
|
|
108
111
|
/**
|
|
109
112
|
* Combined WatermelonDB schema for all SDK storage modules.
|
|
110
113
|
*
|
|
@@ -4524,6 +4527,10 @@ declare class VaultMemory extends Model$1 {
|
|
|
4524
4527
|
/** Unix ms of the last `topics` write. Separate from `updated_at`, which every
|
|
4525
4528
|
* topic writer pins on purpose (recall recency) — see the schema note. */
|
|
4526
4529
|
topicsUpdatedAt: number | null;
|
|
4530
|
+
/** The photo(s) a SERVER-EXTRACTED memory came from — JSON
|
|
4531
|
+
* `[{feed_item_id, object_key}]`, exactly the shape
|
|
4532
|
+
* GET /api/memories/published returns. Null on anything not from a photo. */
|
|
4533
|
+
media: string | null;
|
|
4527
4534
|
/** Unix ms of the last LLM topic-extraction pass. Null = never extracted
|
|
4528
4535
|
* standalone (linked legacy rows are grandfathered as extracted).
|
|
4529
4536
|
* DEPRECATED (v42) — subsumed by `topics_updated_at`; see the schema note. */
|
|
@@ -5999,8 +6006,16 @@ interface StoredVaultMemory {
|
|
|
5999
6006
|
sourceChunkIds: string[] | null;
|
|
6000
6007
|
/** Times this fact has been re-observed (for ranking + UX badges). */
|
|
6001
6008
|
proofCount: number | null;
|
|
6002
|
-
/** How the memory was created: manual | auto-extracted | capsule. */
|
|
6009
|
+
/** How the memory was created: manual | auto-extracted | capsule | photo. */
|
|
6003
6010
|
source: string | null;
|
|
6011
|
+
/** The photo(s) a SERVER-EXTRACTED memory was read out of. Null on every
|
|
6012
|
+
* memory that did not come from a photo. See {@link PhotoMediaRef}.
|
|
6013
|
+
*
|
|
6014
|
+
* OPTIONAL rather than required: every read path sets it (the row mappers
|
|
6015
|
+
* always call parseMedia), but making it required would be a compile-break
|
|
6016
|
+
* for any caller that CONSTRUCTS a StoredVaultMemory — fixtures, mocks, and
|
|
6017
|
+
* anything downstream — for a field that is null on all but photo rows. */
|
|
6018
|
+
media?: PhotoMediaRef[] | null;
|
|
6004
6019
|
/** W6 temporal lane — Unix ms when the event occurred (point/start of range). */
|
|
6005
6020
|
eventTimeStart: number | null;
|
|
6006
6021
|
/** W6 temporal lane — Unix ms when the event ended (range only). */
|
|
@@ -6059,6 +6074,26 @@ interface StoredVaultMemory {
|
|
|
6059
6074
|
updatedAt: Date;
|
|
6060
6075
|
isDeleted: boolean;
|
|
6061
6076
|
}
|
|
6077
|
+
/**
|
|
6078
|
+
* A photo a server-extracted memory came from, as
|
|
6079
|
+
* GET /api/memories/published returns it in `media[]`.
|
|
6080
|
+
*
|
|
6081
|
+
* Both identifiers travel because both are needed: `feedItemId` is the server's
|
|
6082
|
+
* handle for the photo, and `objectKey` is what a client turns into a CDN URL
|
|
6083
|
+
* without another round-trip per memory.
|
|
6084
|
+
*/
|
|
6085
|
+
interface PhotoMediaRef {
|
|
6086
|
+
feedItemId: number;
|
|
6087
|
+
objectKey: string | null;
|
|
6088
|
+
}
|
|
6089
|
+
/**
|
|
6090
|
+
* Decode the stored `media` column. Returns null for "no photo behind this
|
|
6091
|
+
* memory" (the column is null on every non-photo row) and tolerates a corrupt
|
|
6092
|
+
* or unexpected payload by reading it as null too — a memory whose photo
|
|
6093
|
+
* reference cannot be parsed is still a perfectly good memory, and losing the
|
|
6094
|
+
* thumbnail is a better failure than losing the row.
|
|
6095
|
+
*/
|
|
6096
|
+
declare function parseMedia(value: unknown): PhotoMediaRef[] | null;
|
|
6062
6097
|
interface CreateVaultMemoryOptions {
|
|
6063
6098
|
content: string;
|
|
6064
6099
|
/** Scope for the memory. Defaults to "private" if omitted. */
|
|
@@ -6500,6 +6535,95 @@ declare function hardDeleteDecayedOp(ctx: VaultMemoryOperationsContext, id: stri
|
|
|
6500
6535
|
}): Promise<boolean>;
|
|
6501
6536
|
declare function updateVaultMemoryEmbeddingOp(ctx: VaultMemoryOperationsContext, id: string, embedding: string, embeddingModel: string): Promise<boolean>;
|
|
6502
6537
|
|
|
6538
|
+
/**
|
|
6539
|
+
* Ingest server-extracted photo memories into the local vault.
|
|
6540
|
+
*
|
|
6541
|
+
* A photo uploaded to People Nearby is read by the server, which extracts
|
|
6542
|
+
* durable facts about the user, embeds them and publishes them
|
|
6543
|
+
* (anuma-ai/nearby#114). Until those rows reach the device they exist only
|
|
6544
|
+
* server-side: the user's own assistant cannot recall them, and no screen can
|
|
6545
|
+
* show them — so the "visible and deletable" promise the design makes is not
|
|
6546
|
+
* kept. This is the path that brings them home.
|
|
6547
|
+
*
|
|
6548
|
+
* Three things about the shape of this, each of which is load-bearing:
|
|
6549
|
+
*
|
|
6550
|
+
* 1. **It takes rows; it does not fetch them.** The publish reconciler already
|
|
6551
|
+
* calls `listPublished()` on every pass and gets `text`, `media[]`,
|
|
6552
|
+
* `event_time` and `user_authored` back. Ingest consumes that response. No
|
|
6553
|
+
* new endpoint, no second network call, no change to nearby's API.
|
|
6554
|
+
*
|
|
6555
|
+
* 2. **The vault row's id IS the server's `memory_id`.** That is what makes a
|
|
6556
|
+
* revoke addressable: the reconciler's ledger, its published set and its
|
|
6557
|
+
* `toRevoke` list are all keyed on that id, so a locally-minted id would
|
|
6558
|
+
* leave the user with a switch that cannot reach the row it appears to
|
|
6559
|
+
* control. It is also what makes ingest idempotent for free — a second pass
|
|
6560
|
+
* sees the id already present and writes nothing.
|
|
6561
|
+
*
|
|
6562
|
+
* 3. **These rows never go through `retain()`.** That path is for facts being
|
|
6563
|
+
* learned on-device: it dedupes and merges candidates against local rows and
|
|
6564
|
+
* mints its own ids, both of which would break (2). A photo memory is not a
|
|
6565
|
+
* candidate to be reconciled against the vault — it is an already-decided
|
|
6566
|
+
* fact the server has published.
|
|
6567
|
+
*
|
|
6568
|
+
* The rows are written `visibility: "public"` because they genuinely ARE
|
|
6569
|
+
* published — the reconciler reads local visibility as the user's intent, and
|
|
6570
|
+
* anything else would make it immediately revoke a memory the user never turned
|
|
6571
|
+
* off. They carry `source: SOURCE_PHOTO`, which is what exempts them from
|
|
6572
|
+
* decay's auto-archive; see the note there for why archiving one would silently
|
|
6573
|
+
* unpublish it.
|
|
6574
|
+
*
|
|
6575
|
+
* No embedding is computed here. `searchTool`'s un-embedded lane embeds any row
|
|
6576
|
+
* lacking a vector at search time, uses it in that same search and persists it
|
|
6577
|
+
* via `updateVaultMemoryEmbeddingOp` — so a row ingested without one is picked
|
|
6578
|
+
* up on first recall rather than costing an embedding call at ingest.
|
|
6579
|
+
*/
|
|
6580
|
+
|
|
6581
|
+
/**
|
|
6582
|
+
* One row of `GET /api/memories/published`, narrowed to what ingest needs.
|
|
6583
|
+
*
|
|
6584
|
+
* Deliberately structural rather than an import from the transport client: this
|
|
6585
|
+
* op is in the SDK and the two hand-written nearby clients live in the app, so
|
|
6586
|
+
* a shared nominal type would drag one across a package boundary for no gain.
|
|
6587
|
+
*/
|
|
6588
|
+
interface PublishedPhotoMemory {
|
|
6589
|
+
/** The server-minted memory id. `photo:<feedItemID>:fact:NN` or `:caption`. */
|
|
6590
|
+
memoryId: string;
|
|
6591
|
+
/** The projected fact text. */
|
|
6592
|
+
text: string;
|
|
6593
|
+
/** The photo(s) this fact was read out of. */
|
|
6594
|
+
media?: PhotoMediaRef[] | null;
|
|
6595
|
+
/** When the event in the memory happened, if the server knows. */
|
|
6596
|
+
eventTime?: {
|
|
6597
|
+
start: number | null;
|
|
6598
|
+
end: number | null;
|
|
6599
|
+
kind: "point" | "range" | "ongoing" | null;
|
|
6600
|
+
} | null;
|
|
6601
|
+
/** True when the text is the user's own words (a kept caption). */
|
|
6602
|
+
userAuthored?: boolean;
|
|
6603
|
+
}
|
|
6604
|
+
/** What one ingest pass did, for the caller's logs and tests. */
|
|
6605
|
+
interface PhotoIngestResult {
|
|
6606
|
+
/** Rows newly written to the vault. */
|
|
6607
|
+
inserted: number;
|
|
6608
|
+
/** Rows already present, left untouched. */
|
|
6609
|
+
skipped: number;
|
|
6610
|
+
}
|
|
6611
|
+
/**
|
|
6612
|
+
* Write the published photo memories this vault does not already have.
|
|
6613
|
+
*
|
|
6614
|
+
* Idempotent on `memoryId`: a row whose id is already in the vault is counted as
|
|
6615
|
+
* skipped and NOT rewritten, even when the server's text has since changed.
|
|
6616
|
+
* That is deliberate — the local row is the user's copy, they may have edited
|
|
6617
|
+
* it, and silently overwriting an edit to match the server would be the same
|
|
6618
|
+
* class of bug as publishing a version the user has since changed. Re-ingesting
|
|
6619
|
+
* changed text is a follow-up that needs a merge decision, not a clobber.
|
|
6620
|
+
*
|
|
6621
|
+
* Non-`photo:` ids are ignored: everything else in the published set is a
|
|
6622
|
+
* client-published memory that by definition already lives in this vault (or in
|
|
6623
|
+
* another device's, which is not ours to recreate).
|
|
6624
|
+
*/
|
|
6625
|
+
declare function ingestPublishedPhotoMemoriesOp(ctx: VaultMemoryOperationsContext, rows: PublishedPhotoMemory[]): Promise<PhotoIngestResult>;
|
|
6626
|
+
|
|
6503
6627
|
declare class Project extends Model$1 {
|
|
6504
6628
|
static table: string;
|
|
6505
6629
|
static associations: Associations;
|
|
@@ -7703,6 +7827,15 @@ declare function createChunkVectorCache(maxSize?: number): ChunkVectorCache;
|
|
|
7703
7827
|
* shared purge buffer for every row, so an already-archived manual memory is
|
|
7704
7828
|
* still deleted after the window (the archived check runs before the manual
|
|
7705
7829
|
* short-circuit by design).
|
|
7830
|
+
*
|
|
7831
|
+
* `source === "photo"` (server-extracted photo memories) is protected the same
|
|
7832
|
+
* way, and for a sharper reason than curation: those rows are PUBLISHED, and
|
|
7833
|
+
* auto-archiving one would silently un-publish it. Archived rows drop out of the
|
|
7834
|
+
* default vault read, the publish reconciler builds its desired set from that
|
|
7835
|
+
* read, and anything it previously adopted but no longer sees goes into
|
|
7836
|
+
* `toRevoke` — so an age-archive at the medium TTL would revoke a memory from
|
|
7837
|
+
* the server that the user never switched off. Revoking is the user's decision
|
|
7838
|
+
* and has exactly one entry point: the publish switch.
|
|
7706
7839
|
*/
|
|
7707
7840
|
/** The verdict for a single memory. */
|
|
7708
7841
|
type DecayVerdict = "keep" | "archive" | "delete";
|
|
@@ -10069,4 +10202,4 @@ declare function sanitizeQuotes(s: string): string;
|
|
|
10069
10202
|
declare function renderTemplate(value: string | null | undefined, template: string): string | null;
|
|
10070
10203
|
declare function buildSystemPrompt(ctx: PromptContext, options?: BuildPromptOptions): BuildPromptResult;
|
|
10071
10204
|
|
|
10072
|
-
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 PlatformStorage, type PortalLlmAuth, 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 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, injectionSignatureCatalog, isRerankerAvailable, isSupportedFile, isSupportedMediaType, makeSyntheticStoredConversation, makeSyntheticStoredMessage, maybeSummarizeHistory, mediaToStored, migrateFromModelPreferencesOp, onKeyAvailable, 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 };
|
|
10205
|
+
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, 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 };
|