@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
|
@@ -2410,6 +2410,22 @@ async function decryptVaultMemoryFields(memory, address, signMessage, embeddedWa
|
|
|
2410
2410
|
};
|
|
2411
2411
|
}
|
|
2412
2412
|
|
|
2413
|
+
// src/lib/db/memoryVault/types.ts
|
|
2414
|
+
function parseMedia(value) {
|
|
2415
|
+
if (typeof value !== "string" || value === "") return null;
|
|
2416
|
+
try {
|
|
2417
|
+
const parsed = JSON.parse(value);
|
|
2418
|
+
if (!Array.isArray(parsed)) return null;
|
|
2419
|
+
const refs = parsed.filter((r) => typeof r === "object" && r !== null).map((r) => ({
|
|
2420
|
+
feedItemId: Number(r.feedItemId ?? r.feed_item_id),
|
|
2421
|
+
objectKey: r.objectKey ?? r.object_key ?? null
|
|
2422
|
+
})).filter((r) => Number.isFinite(r.feedItemId));
|
|
2423
|
+
return refs.length > 0 ? refs : null;
|
|
2424
|
+
} catch {
|
|
2425
|
+
return null;
|
|
2426
|
+
}
|
|
2427
|
+
}
|
|
2428
|
+
|
|
2413
2429
|
// src/lib/db/memoryVault/operations.ts
|
|
2414
2430
|
function visibilityOrPrivate(value) {
|
|
2415
2431
|
return value === "public" ? value : "private";
|
|
@@ -2473,6 +2489,7 @@ function vaultMemoryToStoredRaw(memory) {
|
|
|
2473
2489
|
sourceChunkIds,
|
|
2474
2490
|
proofCount: memory.proofCount ?? null,
|
|
2475
2491
|
source: memory.source ?? null,
|
|
2492
|
+
media: parseMedia(memory.media),
|
|
2476
2493
|
eventTimeStart: memory.eventTimeStart ?? null,
|
|
2477
2494
|
eventTimeEnd: memory.eventTimeEnd ?? null,
|
|
2478
2495
|
eventTimeKind: memory.eventTimeKind ?? null,
|
|
@@ -2755,6 +2772,7 @@ function vaultMemoryRawToStoredRaw(raw) {
|
|
|
2755
2772
|
eventTimeKind: raw.event_time_kind ?? null,
|
|
2756
2773
|
// SQLite stores booleans as 0/1, LokiJS as true/false — coerce both.
|
|
2757
2774
|
topicsUserManaged: raw.topics_user_managed === true || raw.topics_user_managed === 1,
|
|
2775
|
+
media: parseMedia(raw.media),
|
|
2758
2776
|
topics: parseTopics(raw.topics),
|
|
2759
2777
|
topicsUpdatedAt: raw.topics_updated_at ?? null,
|
|
2760
2778
|
topicsExtractedAt: raw.topics_extracted_at ?? null,
|
|
@@ -6500,7 +6518,7 @@ function createMemoryVaultSearchTool(vaultCtx, embeddingOptions, cache, searchOp
|
|
|
6500
6518
|
subQueries = decomp.subQueries;
|
|
6501
6519
|
}
|
|
6502
6520
|
}
|
|
6503
|
-
const { recall: recall2 } = await import("./recall-
|
|
6521
|
+
const { recall: recall2 } = await import("./recall-UVM2366D.mjs");
|
|
6504
6522
|
let recallDegraded = [];
|
|
6505
6523
|
const result = await recall2(
|
|
6506
6524
|
query,
|
|
@@ -7516,6 +7534,8 @@ export {
|
|
|
7516
7534
|
ENTITY_KINDS,
|
|
7517
7535
|
linkMemoryEntitiesOp,
|
|
7518
7536
|
replaceMemoryEntitiesGuardedOp,
|
|
7537
|
+
encryptVaultMemoryContent,
|
|
7538
|
+
parseMedia,
|
|
7519
7539
|
vaultMemoryToStored,
|
|
7520
7540
|
createVaultMemoryOp,
|
|
7521
7541
|
createSupersedingMemoryOp,
|
package/dist/expo/index.cjs
CHANGED
|
@@ -4663,6 +4663,27 @@ var init_encryption2 = __esm({
|
|
|
4663
4663
|
}
|
|
4664
4664
|
});
|
|
4665
4665
|
|
|
4666
|
+
// src/lib/db/memoryVault/types.ts
|
|
4667
|
+
function parseMedia(value) {
|
|
4668
|
+
if (typeof value !== "string" || value === "") return null;
|
|
4669
|
+
try {
|
|
4670
|
+
const parsed = JSON.parse(value);
|
|
4671
|
+
if (!Array.isArray(parsed)) return null;
|
|
4672
|
+
const refs = parsed.filter((r) => typeof r === "object" && r !== null).map((r) => ({
|
|
4673
|
+
feedItemId: Number(r.feedItemId ?? r.feed_item_id),
|
|
4674
|
+
objectKey: r.objectKey ?? r.object_key ?? null
|
|
4675
|
+
})).filter((r) => Number.isFinite(r.feedItemId));
|
|
4676
|
+
return refs.length > 0 ? refs : null;
|
|
4677
|
+
} catch {
|
|
4678
|
+
return null;
|
|
4679
|
+
}
|
|
4680
|
+
}
|
|
4681
|
+
var init_types4 = __esm({
|
|
4682
|
+
"src/lib/db/memoryVault/types.ts"() {
|
|
4683
|
+
"use strict";
|
|
4684
|
+
}
|
|
4685
|
+
});
|
|
4686
|
+
|
|
4666
4687
|
// src/lib/db/memoryVault/operations.ts
|
|
4667
4688
|
function visibilityOrPrivate(value) {
|
|
4668
4689
|
return value === "public" ? value : "private";
|
|
@@ -4724,6 +4745,7 @@ function vaultMemoryToStoredRaw(memory) {
|
|
|
4724
4745
|
sourceChunkIds,
|
|
4725
4746
|
proofCount: memory.proofCount ?? null,
|
|
4726
4747
|
source: memory.source ?? null,
|
|
4748
|
+
media: parseMedia(memory.media),
|
|
4727
4749
|
eventTimeStart: memory.eventTimeStart ?? null,
|
|
4728
4750
|
eventTimeEnd: memory.eventTimeEnd ?? null,
|
|
4729
4751
|
eventTimeKind: memory.eventTimeKind ?? null,
|
|
@@ -5006,6 +5028,7 @@ function vaultMemoryRawToStoredRaw(raw) {
|
|
|
5006
5028
|
eventTimeKind: raw.event_time_kind ?? null,
|
|
5007
5029
|
// SQLite stores booleans as 0/1, LokiJS as true/false — coerce both.
|
|
5008
5030
|
topicsUserManaged: raw.topics_user_managed === true || raw.topics_user_managed === 1,
|
|
5031
|
+
media: parseMedia(raw.media),
|
|
5009
5032
|
topics: parseTopics(raw.topics),
|
|
5010
5033
|
topicsUpdatedAt: raw.topics_updated_at ?? null,
|
|
5011
5034
|
topicsExtractedAt: raw.topics_extracted_at ?? null,
|
|
@@ -5730,6 +5753,7 @@ var init_operations3 = __esm({
|
|
|
5730
5753
|
init_operations2();
|
|
5731
5754
|
init_types3();
|
|
5732
5755
|
init_encryption2();
|
|
5756
|
+
init_types4();
|
|
5733
5757
|
NON_PRIVATE_VISIBILITIES = ["public"];
|
|
5734
5758
|
KNOWN_TRUST_TIERS = /* @__PURE__ */ new Set(["quarantined", "trusted"]);
|
|
5735
5759
|
TOPICS_EXTRACTION_VERSION = 3;
|
|
@@ -6057,17 +6081,17 @@ function recencyMultiplier(updatedAt, opts = {}) {
|
|
|
6057
6081
|
const now = opts.now ?? /* @__PURE__ */ new Date();
|
|
6058
6082
|
const nowMs2 = now.getTime();
|
|
6059
6083
|
if (!Number.isFinite(nowMs2)) return noDate;
|
|
6060
|
-
const ageDays2 = Math.max(0, (nowMs2 - updatedMs) /
|
|
6084
|
+
const ageDays2 = Math.max(0, (nowMs2 - updatedMs) / DAY_MS2);
|
|
6061
6085
|
const perYearDecay = opts.perYearDecay ?? DEFAULT_PER_YEAR_DECAY;
|
|
6062
6086
|
const floor = opts.floor ?? DEFAULT_FLOOR;
|
|
6063
6087
|
const decay = perYearDecay * (ageDays2 / 365);
|
|
6064
6088
|
return Math.max(floor, 1 - decay);
|
|
6065
6089
|
}
|
|
6066
|
-
var
|
|
6090
|
+
var DAY_MS2, DEFAULT_PER_YEAR_DECAY, DEFAULT_FLOOR, DEFAULT_NO_DATE_MULTIPLIER;
|
|
6067
6091
|
var init_recency = __esm({
|
|
6068
6092
|
"src/lib/memory/recency.ts"() {
|
|
6069
6093
|
"use strict";
|
|
6070
|
-
|
|
6094
|
+
DAY_MS2 = 1e3 * 60 * 60 * 24;
|
|
6071
6095
|
DEFAULT_PER_YEAR_DECAY = 0.2;
|
|
6072
6096
|
DEFAULT_FLOOR = 0.1;
|
|
6073
6097
|
DEFAULT_NO_DATE_MULTIPLIER = 0.5;
|
|
@@ -6824,8 +6848,8 @@ function classifyObservationTrend(input, now = Date.now()) {
|
|
|
6824
6848
|
const lastMsRaw = input.lastObservedAt;
|
|
6825
6849
|
const lastMs = lastMsRaw !== null && lastMsRaw !== void 0 && Number.isFinite(lastMsRaw) ? Math.max(createdMs, lastMsRaw) : createdMs;
|
|
6826
6850
|
const proofs = Math.max(1, input.proofCount ?? 1);
|
|
6827
|
-
const ageDays2 = Math.max(0, (now - createdMs) /
|
|
6828
|
-
const daysSinceLast = Math.max(0, (now - lastMs) /
|
|
6851
|
+
const ageDays2 = Math.max(0, (now - createdMs) / DAY_MS3);
|
|
6852
|
+
const daysSinceLast = Math.max(0, (now - lastMs) / DAY_MS3);
|
|
6829
6853
|
if (daysSinceLast >= TREND_STALE_WINDOW_DAYS) return "stale";
|
|
6830
6854
|
if (daysSinceLast >= TREND_RECENT_WINDOW_DAYS) return "weakening";
|
|
6831
6855
|
if (ageDays2 <= TREND_RECENT_WINDOW_DAYS && proofs <= 2) return "new";
|
|
@@ -6846,11 +6870,11 @@ function summarizeObservationTrends(inputs, now = Date.now()) {
|
|
|
6846
6870
|
}
|
|
6847
6871
|
return counts;
|
|
6848
6872
|
}
|
|
6849
|
-
var
|
|
6873
|
+
var DAY_MS3, TREND_RECENT_WINDOW_DAYS, TREND_STALE_WINDOW_DAYS;
|
|
6850
6874
|
var init_observationTrend = __esm({
|
|
6851
6875
|
"src/lib/memory/observationTrend.ts"() {
|
|
6852
6876
|
"use strict";
|
|
6853
|
-
|
|
6877
|
+
DAY_MS3 = 1e3 * 60 * 60 * 24;
|
|
6854
6878
|
TREND_RECENT_WINDOW_DAYS = 30;
|
|
6855
6879
|
TREND_STALE_WINDOW_DAYS = 90;
|
|
6856
6880
|
}
|
|
@@ -9133,12 +9157,14 @@ __export(index_exports, {
|
|
|
9133
9157
|
getVaultMemoryOp: () => getVaultMemoryOp,
|
|
9134
9158
|
hardDeleteDecayedOp: () => hardDeleteDecayedOp,
|
|
9135
9159
|
hasEncryptionKey: () => hasEncryptionKey,
|
|
9160
|
+
ingestPublishedPhotoMemoriesOp: () => ingestPublishedPhotoMemoriesOp,
|
|
9136
9161
|
injectionSignatureCatalog: () => injectionSignatureCatalog,
|
|
9137
9162
|
isPiiRedactor: () => isPiiRedactor,
|
|
9138
9163
|
isRerankerAvailable: () => isRerankerAvailable,
|
|
9139
9164
|
moveMemoriesToFolderOp: () => moveMemoriesToFolderOp,
|
|
9140
9165
|
noopLogger: () => noopLogger,
|
|
9141
9166
|
onKeyAvailable: () => onKeyAvailable,
|
|
9167
|
+
parseMedia: () => parseMedia,
|
|
9142
9168
|
preEmbedVaultMemories: () => preEmbedVaultMemories,
|
|
9143
9169
|
quantizeEmbedding: () => quantizeEmbedding,
|
|
9144
9170
|
queueManager: () => queueManager,
|
|
@@ -14730,6 +14756,9 @@ __decorateClass([
|
|
|
14730
14756
|
__decorateClass([
|
|
14731
14757
|
(0, import_decorators3.field)("topics_updated_at")
|
|
14732
14758
|
], VaultMemory.prototype, "topicsUpdatedAt", 2);
|
|
14759
|
+
__decorateClass([
|
|
14760
|
+
(0, import_decorators3.field)("media")
|
|
14761
|
+
], VaultMemory.prototype, "media", 2);
|
|
14733
14762
|
__decorateClass([
|
|
14734
14763
|
(0, import_decorators3.field)("topics_extracted_at")
|
|
14735
14764
|
], VaultMemory.prototype, "topicsExtractedAt", 2);
|
|
@@ -14780,6 +14809,138 @@ __decorateClass([
|
|
|
14780
14809
|
// src/lib/db/memoryVault/index.ts
|
|
14781
14810
|
init_operations3();
|
|
14782
14811
|
|
|
14812
|
+
// src/lib/memory/decay.ts
|
|
14813
|
+
init_logger();
|
|
14814
|
+
var DAY_MS = 24 * 60 * 60 * 1e3;
|
|
14815
|
+
var SHORT_TTL_MS = 30 * DAY_MS;
|
|
14816
|
+
var MEDIUM_TTL_MS = 180 * DAY_MS;
|
|
14817
|
+
var SOURCE_PHOTO = "photo";
|
|
14818
|
+
var NEVER_TTL_MS = Number.POSITIVE_INFINITY;
|
|
14819
|
+
var HARD_DELETE_WINDOW_MS = 30 * DAY_MS;
|
|
14820
|
+
var PAST_EVENT_GRACE_MS = 7 * DAY_MS;
|
|
14821
|
+
var DEFAULT_DECAY_POLICY = {
|
|
14822
|
+
ttlByType: {
|
|
14823
|
+
identity: NEVER_TTL_MS,
|
|
14824
|
+
preference: NEVER_TTL_MS,
|
|
14825
|
+
relationship: NEVER_TTL_MS,
|
|
14826
|
+
constraint: NEVER_TTL_MS,
|
|
14827
|
+
plan: SHORT_TTL_MS,
|
|
14828
|
+
ongoing_context: SHORT_TTL_MS,
|
|
14829
|
+
other: MEDIUM_TTL_MS
|
|
14830
|
+
},
|
|
14831
|
+
fallbackTtlMs: MEDIUM_TTL_MS,
|
|
14832
|
+
hardDeleteWindowMs: HARD_DELETE_WINDOW_MS,
|
|
14833
|
+
pastEventGraceMs: PAST_EVENT_GRACE_MS
|
|
14834
|
+
};
|
|
14835
|
+
function resolvePolicy(policy) {
|
|
14836
|
+
if (!policy) return DEFAULT_DECAY_POLICY;
|
|
14837
|
+
return {
|
|
14838
|
+
ttlByType: { ...DEFAULT_DECAY_POLICY.ttlByType, ...policy.ttlByType },
|
|
14839
|
+
fallbackTtlMs: policy.fallbackTtlMs ?? DEFAULT_DECAY_POLICY.fallbackTtlMs,
|
|
14840
|
+
hardDeleteWindowMs: policy.hardDeleteWindowMs ?? DEFAULT_DECAY_POLICY.hardDeleteWindowMs,
|
|
14841
|
+
pastEventGraceMs: policy.pastEventGraceMs ?? DEFAULT_DECAY_POLICY.pastEventGraceMs
|
|
14842
|
+
};
|
|
14843
|
+
}
|
|
14844
|
+
function ttlForType(factType, policy) {
|
|
14845
|
+
const resolved = resolvePolicy(policy);
|
|
14846
|
+
if (factType === null) return resolved.fallbackTtlMs;
|
|
14847
|
+
return resolved.ttlByType[factType] ?? resolved.fallbackTtlMs;
|
|
14848
|
+
}
|
|
14849
|
+
function isTimeSensitiveType(factType) {
|
|
14850
|
+
return factType === "plan" || factType === "ongoing_context";
|
|
14851
|
+
}
|
|
14852
|
+
function hasFiniteTimestamps(m, now) {
|
|
14853
|
+
return Number.isFinite(now) && Number.isFinite(m.updatedAt) && (m.archivedAt === null || Number.isFinite(m.archivedAt));
|
|
14854
|
+
}
|
|
14855
|
+
function classifyDecay(m, now, policy) {
|
|
14856
|
+
const resolved = resolvePolicy(policy);
|
|
14857
|
+
if (!hasFiniteTimestamps(m, now)) {
|
|
14858
|
+
getLogger().warn("[memory/decay] non-finite timestamp on a memory row; keeping it", {
|
|
14859
|
+
now,
|
|
14860
|
+
updatedAt: m.updatedAt,
|
|
14861
|
+
archivedAt: m.archivedAt,
|
|
14862
|
+
factType: m.factType
|
|
14863
|
+
});
|
|
14864
|
+
return "keep";
|
|
14865
|
+
}
|
|
14866
|
+
if (m.archivedAt !== null) {
|
|
14867
|
+
return now - m.archivedAt > resolved.hardDeleteWindowMs ? "delete" : "keep";
|
|
14868
|
+
}
|
|
14869
|
+
if (m.source === "manual" || m.source === SOURCE_PHOTO) return "keep";
|
|
14870
|
+
if (isTimeSensitiveType(m.factType) && m.eventTimeEnd !== null) {
|
|
14871
|
+
if (m.eventTimeEnd < now - resolved.pastEventGraceMs) return "archive";
|
|
14872
|
+
if (m.eventTimeEnd >= now) return "keep";
|
|
14873
|
+
}
|
|
14874
|
+
if (now - m.updatedAt > ttlForType(m.factType, resolved)) return "archive";
|
|
14875
|
+
return "keep";
|
|
14876
|
+
}
|
|
14877
|
+
|
|
14878
|
+
// src/lib/db/memoryVault/photoIngest.ts
|
|
14879
|
+
init_encryption2();
|
|
14880
|
+
var PHOTO_MEMORY_ID_PREFIX = "photo:";
|
|
14881
|
+
async function ingestPublishedPhotoMemoriesOp(ctx, rows) {
|
|
14882
|
+
const byId = /* @__PURE__ */ new Map();
|
|
14883
|
+
for (const r of rows) {
|
|
14884
|
+
if (typeof r.memoryId !== "string" || !r.memoryId.startsWith(PHOTO_MEMORY_ID_PREFIX)) continue;
|
|
14885
|
+
if (!byId.has(r.memoryId)) byId.set(r.memoryId, r);
|
|
14886
|
+
}
|
|
14887
|
+
const photoRows = [...byId.values()];
|
|
14888
|
+
if (photoRows.length === 0) return { inserted: 0, skipped: 0 };
|
|
14889
|
+
const known = await ctx.vaultMemoryCollection.query().fetchIds().then((ids) => new Set(ids));
|
|
14890
|
+
const candidates = photoRows.filter((r) => !known.has(r.memoryId));
|
|
14891
|
+
if (candidates.length === 0) return { inserted: 0, skipped: photoRows.length };
|
|
14892
|
+
const fresh = candidates;
|
|
14893
|
+
const contents = await Promise.all(
|
|
14894
|
+
fresh.map(async (r) => {
|
|
14895
|
+
if (ctx.walletAddress && ctx.signMessage) {
|
|
14896
|
+
return encryptVaultMemoryContent(
|
|
14897
|
+
r.text,
|
|
14898
|
+
ctx.walletAddress,
|
|
14899
|
+
ctx.signMessage,
|
|
14900
|
+
ctx.embeddedWalletSigner
|
|
14901
|
+
);
|
|
14902
|
+
}
|
|
14903
|
+
return r.text;
|
|
14904
|
+
})
|
|
14905
|
+
);
|
|
14906
|
+
const now = Date.now();
|
|
14907
|
+
let inserted = 0;
|
|
14908
|
+
await ctx.database.write(async () => {
|
|
14909
|
+
const present = new Set(await ctx.vaultMemoryCollection.query().fetchIds());
|
|
14910
|
+
const writable = fresh.map((row, i) => ({ row, content: contents[i] })).filter(({ row }) => !present.has(row.memoryId));
|
|
14911
|
+
inserted = writable.length;
|
|
14912
|
+
if (writable.length === 0) return;
|
|
14913
|
+
const prepared = writable.map(
|
|
14914
|
+
({ row, content }) => ctx.vaultMemoryCollection.prepareCreate((record) => {
|
|
14915
|
+
record._raw.id = row.memoryId;
|
|
14916
|
+
record._setRaw("content", content);
|
|
14917
|
+
record._setRaw("scope", "private");
|
|
14918
|
+
record._setRaw("folder_id", null);
|
|
14919
|
+
record._setRaw("user_id", ctx.userId ?? null);
|
|
14920
|
+
record._setRaw("is_deleted", false);
|
|
14921
|
+
record._setRaw("proof_count", 1);
|
|
14922
|
+
record._setRaw("source", SOURCE_PHOTO);
|
|
14923
|
+
record._setRaw(
|
|
14924
|
+
"media",
|
|
14925
|
+
row.media && row.media.length > 0 ? JSON.stringify(row.media) : null
|
|
14926
|
+
);
|
|
14927
|
+
record._setRaw("visibility", "public");
|
|
14928
|
+
record._setRaw("published_at", now);
|
|
14929
|
+
if (row.eventTime) {
|
|
14930
|
+
record._setRaw("event_time_start", row.eventTime.start ?? null);
|
|
14931
|
+
record._setRaw("event_time_end", row.eventTime.end ?? null);
|
|
14932
|
+
record._setRaw("event_time_kind", row.eventTime.kind ?? null);
|
|
14933
|
+
}
|
|
14934
|
+
})
|
|
14935
|
+
);
|
|
14936
|
+
await ctx.database.batch(...prepared);
|
|
14937
|
+
});
|
|
14938
|
+
return { inserted, skipped: photoRows.length - inserted };
|
|
14939
|
+
}
|
|
14940
|
+
|
|
14941
|
+
// src/lib/db/memoryVault/index.ts
|
|
14942
|
+
init_types4();
|
|
14943
|
+
|
|
14783
14944
|
// src/lib/db/queue/manager.ts
|
|
14784
14945
|
var import_uuid4 = require("uuid");
|
|
14785
14946
|
init_logger();
|
|
@@ -16559,71 +16720,6 @@ function createChunkVectorCache(maxSize = DEFAULT_CHUNK_CACHE_SIZE) {
|
|
|
16559
16720
|
return new LRUCache(maxSize);
|
|
16560
16721
|
}
|
|
16561
16722
|
|
|
16562
|
-
// src/lib/memory/decay.ts
|
|
16563
|
-
init_logger();
|
|
16564
|
-
var DAY_MS3 = 24 * 60 * 60 * 1e3;
|
|
16565
|
-
var SHORT_TTL_MS = 30 * DAY_MS3;
|
|
16566
|
-
var MEDIUM_TTL_MS = 180 * DAY_MS3;
|
|
16567
|
-
var NEVER_TTL_MS = Number.POSITIVE_INFINITY;
|
|
16568
|
-
var HARD_DELETE_WINDOW_MS = 30 * DAY_MS3;
|
|
16569
|
-
var PAST_EVENT_GRACE_MS = 7 * DAY_MS3;
|
|
16570
|
-
var DEFAULT_DECAY_POLICY = {
|
|
16571
|
-
ttlByType: {
|
|
16572
|
-
identity: NEVER_TTL_MS,
|
|
16573
|
-
preference: NEVER_TTL_MS,
|
|
16574
|
-
relationship: NEVER_TTL_MS,
|
|
16575
|
-
constraint: NEVER_TTL_MS,
|
|
16576
|
-
plan: SHORT_TTL_MS,
|
|
16577
|
-
ongoing_context: SHORT_TTL_MS,
|
|
16578
|
-
other: MEDIUM_TTL_MS
|
|
16579
|
-
},
|
|
16580
|
-
fallbackTtlMs: MEDIUM_TTL_MS,
|
|
16581
|
-
hardDeleteWindowMs: HARD_DELETE_WINDOW_MS,
|
|
16582
|
-
pastEventGraceMs: PAST_EVENT_GRACE_MS
|
|
16583
|
-
};
|
|
16584
|
-
function resolvePolicy(policy) {
|
|
16585
|
-
if (!policy) return DEFAULT_DECAY_POLICY;
|
|
16586
|
-
return {
|
|
16587
|
-
ttlByType: { ...DEFAULT_DECAY_POLICY.ttlByType, ...policy.ttlByType },
|
|
16588
|
-
fallbackTtlMs: policy.fallbackTtlMs ?? DEFAULT_DECAY_POLICY.fallbackTtlMs,
|
|
16589
|
-
hardDeleteWindowMs: policy.hardDeleteWindowMs ?? DEFAULT_DECAY_POLICY.hardDeleteWindowMs,
|
|
16590
|
-
pastEventGraceMs: policy.pastEventGraceMs ?? DEFAULT_DECAY_POLICY.pastEventGraceMs
|
|
16591
|
-
};
|
|
16592
|
-
}
|
|
16593
|
-
function ttlForType(factType, policy) {
|
|
16594
|
-
const resolved = resolvePolicy(policy);
|
|
16595
|
-
if (factType === null) return resolved.fallbackTtlMs;
|
|
16596
|
-
return resolved.ttlByType[factType] ?? resolved.fallbackTtlMs;
|
|
16597
|
-
}
|
|
16598
|
-
function isTimeSensitiveType(factType) {
|
|
16599
|
-
return factType === "plan" || factType === "ongoing_context";
|
|
16600
|
-
}
|
|
16601
|
-
function hasFiniteTimestamps(m, now) {
|
|
16602
|
-
return Number.isFinite(now) && Number.isFinite(m.updatedAt) && (m.archivedAt === null || Number.isFinite(m.archivedAt));
|
|
16603
|
-
}
|
|
16604
|
-
function classifyDecay(m, now, policy) {
|
|
16605
|
-
const resolved = resolvePolicy(policy);
|
|
16606
|
-
if (!hasFiniteTimestamps(m, now)) {
|
|
16607
|
-
getLogger().warn("[memory/decay] non-finite timestamp on a memory row; keeping it", {
|
|
16608
|
-
now,
|
|
16609
|
-
updatedAt: m.updatedAt,
|
|
16610
|
-
archivedAt: m.archivedAt,
|
|
16611
|
-
factType: m.factType
|
|
16612
|
-
});
|
|
16613
|
-
return "keep";
|
|
16614
|
-
}
|
|
16615
|
-
if (m.archivedAt !== null) {
|
|
16616
|
-
return now - m.archivedAt > resolved.hardDeleteWindowMs ? "delete" : "keep";
|
|
16617
|
-
}
|
|
16618
|
-
if (m.source === "manual") return "keep";
|
|
16619
|
-
if (isTimeSensitiveType(m.factType) && m.eventTimeEnd !== null) {
|
|
16620
|
-
if (m.eventTimeEnd < now - resolved.pastEventGraceMs) return "archive";
|
|
16621
|
-
if (m.eventTimeEnd >= now) return "keep";
|
|
16622
|
-
}
|
|
16623
|
-
if (now - m.updatedAt > ttlForType(m.factType, resolved)) return "archive";
|
|
16624
|
-
return "keep";
|
|
16625
|
-
}
|
|
16626
|
-
|
|
16627
16723
|
// src/lib/memory/decayClassifier.ts
|
|
16628
16724
|
init_logger();
|
|
16629
16725
|
init_redactor();
|
|
@@ -16726,7 +16822,7 @@ function toDecayInput(c) {
|
|
|
16726
16822
|
};
|
|
16727
16823
|
}
|
|
16728
16824
|
function isBorderline(input) {
|
|
16729
|
-
if (input.source === "manual") return false;
|
|
16825
|
+
if (input.source === "manual" || input.source === SOURCE_PHOTO) return false;
|
|
16730
16826
|
if (input.trustTier === "quarantined") return false;
|
|
16731
16827
|
if (input.archivedAt !== null) return false;
|
|
16732
16828
|
if (input.factType === null || input.factType === "other") return true;
|
|
@@ -21448,7 +21544,7 @@ __decorateClass([
|
|
|
21448
21544
|
], VaultFolder.prototype, "context", 2);
|
|
21449
21545
|
|
|
21450
21546
|
// src/lib/db/schema.ts
|
|
21451
|
-
var SDK_SCHEMA_VERSION =
|
|
21547
|
+
var SDK_SCHEMA_VERSION = 45;
|
|
21452
21548
|
var sdkSchema = (0, import_watermelondb19.appSchema)({
|
|
21453
21549
|
version: SDK_SCHEMA_VERSION,
|
|
21454
21550
|
tables: [
|
|
@@ -21596,6 +21692,18 @@ var sdkSchema = (0, import_watermelondb19.appSchema)({
|
|
|
21596
21692
|
// paths key on `updated_at` — so without this a topic-only change would
|
|
21597
21693
|
// neither upload nor merge. Null = `topics` never written.
|
|
21598
21694
|
{ name: "topics_updated_at", type: "number", isOptional: true },
|
|
21695
|
+
// The photo(s) a SERVER-EXTRACTED memory was read out of, as a JSON
|
|
21696
|
+
// array of `{feed_item_id, object_key}` — exactly what
|
|
21697
|
+
// GET /api/memories/published returns in `media[]`. Enough to render the
|
|
21698
|
+
// source image without a second round-trip per memory.
|
|
21699
|
+
//
|
|
21700
|
+
// A JSON column rather than a join table: nothing on the client ever
|
|
21701
|
+
// queries BY photo (the only direction is memory -> render its image),
|
|
21702
|
+
// so a table would add a sync lane and a local-id space to serve a
|
|
21703
|
+
// question nobody asks. `topics` and `source_chunk_ids` set the
|
|
21704
|
+
// precedent for a list that is only ever read back whole. Null on
|
|
21705
|
+
// anything not extracted from a photo.
|
|
21706
|
+
{ name: "media", type: "string", isOptional: true },
|
|
21599
21707
|
// Unix ms of the last LLM topic-extraction pass over this memory's
|
|
21600
21708
|
// content. Null = never extracted standalone (legacy rows with entity
|
|
21601
21709
|
// links are grandfathered — see getMemoriesNeedingTopicExtractionOp).
|
|
@@ -22430,6 +22538,20 @@ var sdkMigrations = (0, import_migrations2.schemaMigrations)({
|
|
|
22430
22538
|
columns: [{ name: "origin", type: "string", isOptional: true }]
|
|
22431
22539
|
})
|
|
22432
22540
|
]
|
|
22541
|
+
},
|
|
22542
|
+
// v44 -> v45: `media` on memory_vault — the photo(s) a server-extracted
|
|
22543
|
+
// memory was read out of, as JSON `[{feed_item_id, object_key}]`, mirroring
|
|
22544
|
+
// the `media[]` that GET /api/memories/published already returns. Existing
|
|
22545
|
+
// rows keep NULL, which is the correct value for every memory that did not
|
|
22546
|
+
// come from a photo (i.e. all of them until photo ingest runs).
|
|
22547
|
+
{
|
|
22548
|
+
toVersion: 45,
|
|
22549
|
+
steps: [
|
|
22550
|
+
(0, import_migrations2.addColumns)({
|
|
22551
|
+
table: "memory_vault",
|
|
22552
|
+
columns: [{ name: "media", type: "string", isOptional: true }]
|
|
22553
|
+
})
|
|
22554
|
+
]
|
|
22433
22555
|
}
|
|
22434
22556
|
]
|
|
22435
22557
|
});
|
|
@@ -23901,12 +24023,14 @@ function createNotionTools(getAccessToken, requestNotionAccess) {
|
|
|
23901
24023
|
getVaultMemoryOp,
|
|
23902
24024
|
hardDeleteDecayedOp,
|
|
23903
24025
|
hasEncryptionKey,
|
|
24026
|
+
ingestPublishedPhotoMemoriesOp,
|
|
23904
24027
|
injectionSignatureCatalog,
|
|
23905
24028
|
isPiiRedactor,
|
|
23906
24029
|
isRerankerAvailable,
|
|
23907
24030
|
moveMemoriesToFolderOp,
|
|
23908
24031
|
noopLogger,
|
|
23909
24032
|
onKeyAvailable,
|
|
24033
|
+
parseMedia,
|
|
23910
24034
|
preEmbedVaultMemories,
|
|
23911
24035
|
quantizeEmbedding,
|
|
23912
24036
|
queueManager,
|
package/dist/expo/index.d.mts
CHANGED
|
@@ -4661,6 +4661,10 @@ declare class VaultMemory extends Model {
|
|
|
4661
4661
|
/** Unix ms of the last `topics` write. Separate from `updated_at`, which every
|
|
4662
4662
|
* topic writer pins on purpose (recall recency) — see the schema note. */
|
|
4663
4663
|
topicsUpdatedAt: number | null;
|
|
4664
|
+
/** The photo(s) a SERVER-EXTRACTED memory came from — JSON
|
|
4665
|
+
* `[{feed_item_id, object_key}]`, exactly the shape
|
|
4666
|
+
* GET /api/memories/published returns. Null on anything not from a photo. */
|
|
4667
|
+
media: string | null;
|
|
4664
4668
|
/** Unix ms of the last LLM topic-extraction pass. Null = never extracted
|
|
4665
4669
|
* standalone (linked legacy rows are grandfathered as extracted).
|
|
4666
4670
|
* DEPRECATED (v42) — subsumed by `topics_updated_at`; see the schema note. */
|
|
@@ -6045,8 +6049,16 @@ interface StoredVaultMemory {
|
|
|
6045
6049
|
sourceChunkIds: string[] | null;
|
|
6046
6050
|
/** Times this fact has been re-observed (for ranking + UX badges). */
|
|
6047
6051
|
proofCount: number | null;
|
|
6048
|
-
/** How the memory was created: manual | auto-extracted | capsule. */
|
|
6052
|
+
/** How the memory was created: manual | auto-extracted | capsule | photo. */
|
|
6049
6053
|
source: string | null;
|
|
6054
|
+
/** The photo(s) a SERVER-EXTRACTED memory was read out of. Null on every
|
|
6055
|
+
* memory that did not come from a photo. See {@link PhotoMediaRef}.
|
|
6056
|
+
*
|
|
6057
|
+
* OPTIONAL rather than required: every read path sets it (the row mappers
|
|
6058
|
+
* always call parseMedia), but making it required would be a compile-break
|
|
6059
|
+
* for any caller that CONSTRUCTS a StoredVaultMemory — fixtures, mocks, and
|
|
6060
|
+
* anything downstream — for a field that is null on all but photo rows. */
|
|
6061
|
+
media?: PhotoMediaRef[] | null;
|
|
6050
6062
|
/** W6 temporal lane — Unix ms when the event occurred (point/start of range). */
|
|
6051
6063
|
eventTimeStart: number | null;
|
|
6052
6064
|
/** W6 temporal lane — Unix ms when the event ended (range only). */
|
|
@@ -6105,6 +6117,26 @@ interface StoredVaultMemory {
|
|
|
6105
6117
|
updatedAt: Date;
|
|
6106
6118
|
isDeleted: boolean;
|
|
6107
6119
|
}
|
|
6120
|
+
/**
|
|
6121
|
+
* A photo a server-extracted memory came from, as
|
|
6122
|
+
* GET /api/memories/published returns it in `media[]`.
|
|
6123
|
+
*
|
|
6124
|
+
* Both identifiers travel because both are needed: `feedItemId` is the server's
|
|
6125
|
+
* handle for the photo, and `objectKey` is what a client turns into a CDN URL
|
|
6126
|
+
* without another round-trip per memory.
|
|
6127
|
+
*/
|
|
6128
|
+
interface PhotoMediaRef {
|
|
6129
|
+
feedItemId: number;
|
|
6130
|
+
objectKey: string | null;
|
|
6131
|
+
}
|
|
6132
|
+
/**
|
|
6133
|
+
* Decode the stored `media` column. Returns null for "no photo behind this
|
|
6134
|
+
* memory" (the column is null on every non-photo row) and tolerates a corrupt
|
|
6135
|
+
* or unexpected payload by reading it as null too — a memory whose photo
|
|
6136
|
+
* reference cannot be parsed is still a perfectly good memory, and losing the
|
|
6137
|
+
* thumbnail is a better failure than losing the row.
|
|
6138
|
+
*/
|
|
6139
|
+
declare function parseMedia(value: unknown): PhotoMediaRef[] | null;
|
|
6108
6140
|
interface CreateVaultMemoryOptions {
|
|
6109
6141
|
content: string;
|
|
6110
6142
|
/** Scope for the memory. Defaults to "private" if omitted. */
|
|
@@ -6546,6 +6578,95 @@ declare function hardDeleteDecayedOp(ctx: VaultMemoryOperationsContext, id: stri
|
|
|
6546
6578
|
}): Promise<boolean>;
|
|
6547
6579
|
declare function updateVaultMemoryEmbeddingOp(ctx: VaultMemoryOperationsContext, id: string, embedding: string, embeddingModel: string): Promise<boolean>;
|
|
6548
6580
|
|
|
6581
|
+
/**
|
|
6582
|
+
* Ingest server-extracted photo memories into the local vault.
|
|
6583
|
+
*
|
|
6584
|
+
* A photo uploaded to People Nearby is read by the server, which extracts
|
|
6585
|
+
* durable facts about the user, embeds them and publishes them
|
|
6586
|
+
* (anuma-ai/nearby#114). Until those rows reach the device they exist only
|
|
6587
|
+
* server-side: the user's own assistant cannot recall them, and no screen can
|
|
6588
|
+
* show them — so the "visible and deletable" promise the design makes is not
|
|
6589
|
+
* kept. This is the path that brings them home.
|
|
6590
|
+
*
|
|
6591
|
+
* Three things about the shape of this, each of which is load-bearing:
|
|
6592
|
+
*
|
|
6593
|
+
* 1. **It takes rows; it does not fetch them.** The publish reconciler already
|
|
6594
|
+
* calls `listPublished()` on every pass and gets `text`, `media[]`,
|
|
6595
|
+
* `event_time` and `user_authored` back. Ingest consumes that response. No
|
|
6596
|
+
* new endpoint, no second network call, no change to nearby's API.
|
|
6597
|
+
*
|
|
6598
|
+
* 2. **The vault row's id IS the server's `memory_id`.** That is what makes a
|
|
6599
|
+
* revoke addressable: the reconciler's ledger, its published set and its
|
|
6600
|
+
* `toRevoke` list are all keyed on that id, so a locally-minted id would
|
|
6601
|
+
* leave the user with a switch that cannot reach the row it appears to
|
|
6602
|
+
* control. It is also what makes ingest idempotent for free — a second pass
|
|
6603
|
+
* sees the id already present and writes nothing.
|
|
6604
|
+
*
|
|
6605
|
+
* 3. **These rows never go through `retain()`.** That path is for facts being
|
|
6606
|
+
* learned on-device: it dedupes and merges candidates against local rows and
|
|
6607
|
+
* mints its own ids, both of which would break (2). A photo memory is not a
|
|
6608
|
+
* candidate to be reconciled against the vault — it is an already-decided
|
|
6609
|
+
* fact the server has published.
|
|
6610
|
+
*
|
|
6611
|
+
* The rows are written `visibility: "public"` because they genuinely ARE
|
|
6612
|
+
* published — the reconciler reads local visibility as the user's intent, and
|
|
6613
|
+
* anything else would make it immediately revoke a memory the user never turned
|
|
6614
|
+
* off. They carry `source: SOURCE_PHOTO`, which is what exempts them from
|
|
6615
|
+
* decay's auto-archive; see the note there for why archiving one would silently
|
|
6616
|
+
* unpublish it.
|
|
6617
|
+
*
|
|
6618
|
+
* No embedding is computed here. `searchTool`'s un-embedded lane embeds any row
|
|
6619
|
+
* lacking a vector at search time, uses it in that same search and persists it
|
|
6620
|
+
* via `updateVaultMemoryEmbeddingOp` — so a row ingested without one is picked
|
|
6621
|
+
* up on first recall rather than costing an embedding call at ingest.
|
|
6622
|
+
*/
|
|
6623
|
+
|
|
6624
|
+
/**
|
|
6625
|
+
* One row of `GET /api/memories/published`, narrowed to what ingest needs.
|
|
6626
|
+
*
|
|
6627
|
+
* Deliberately structural rather than an import from the transport client: this
|
|
6628
|
+
* op is in the SDK and the two hand-written nearby clients live in the app, so
|
|
6629
|
+
* a shared nominal type would drag one across a package boundary for no gain.
|
|
6630
|
+
*/
|
|
6631
|
+
interface PublishedPhotoMemory {
|
|
6632
|
+
/** The server-minted memory id. `photo:<feedItemID>:fact:NN` or `:caption`. */
|
|
6633
|
+
memoryId: string;
|
|
6634
|
+
/** The projected fact text. */
|
|
6635
|
+
text: string;
|
|
6636
|
+
/** The photo(s) this fact was read out of. */
|
|
6637
|
+
media?: PhotoMediaRef[] | null;
|
|
6638
|
+
/** When the event in the memory happened, if the server knows. */
|
|
6639
|
+
eventTime?: {
|
|
6640
|
+
start: number | null;
|
|
6641
|
+
end: number | null;
|
|
6642
|
+
kind: "point" | "range" | "ongoing" | null;
|
|
6643
|
+
} | null;
|
|
6644
|
+
/** True when the text is the user's own words (a kept caption). */
|
|
6645
|
+
userAuthored?: boolean;
|
|
6646
|
+
}
|
|
6647
|
+
/** What one ingest pass did, for the caller's logs and tests. */
|
|
6648
|
+
interface PhotoIngestResult {
|
|
6649
|
+
/** Rows newly written to the vault. */
|
|
6650
|
+
inserted: number;
|
|
6651
|
+
/** Rows already present, left untouched. */
|
|
6652
|
+
skipped: number;
|
|
6653
|
+
}
|
|
6654
|
+
/**
|
|
6655
|
+
* Write the published photo memories this vault does not already have.
|
|
6656
|
+
*
|
|
6657
|
+
* Idempotent on `memoryId`: a row whose id is already in the vault is counted as
|
|
6658
|
+
* skipped and NOT rewritten, even when the server's text has since changed.
|
|
6659
|
+
* That is deliberate — the local row is the user's copy, they may have edited
|
|
6660
|
+
* it, and silently overwriting an edit to match the server would be the same
|
|
6661
|
+
* class of bug as publishing a version the user has since changed. Re-ingesting
|
|
6662
|
+
* changed text is a follow-up that needs a merge decision, not a clobber.
|
|
6663
|
+
*
|
|
6664
|
+
* Non-`photo:` ids are ignored: everything else in the published set is a
|
|
6665
|
+
* client-published memory that by definition already lives in this vault (or in
|
|
6666
|
+
* another device's, which is not ours to recreate).
|
|
6667
|
+
*/
|
|
6668
|
+
declare function ingestPublishedPhotoMemoriesOp(ctx: VaultMemoryOperationsContext, rows: PublishedPhotoMemory[]): Promise<PhotoIngestResult>;
|
|
6669
|
+
|
|
6549
6670
|
/**
|
|
6550
6671
|
* Queue Types
|
|
6551
6672
|
*
|
|
@@ -7045,6 +7166,15 @@ declare function createChunkVectorCache(maxSize?: number): ChunkVectorCache;
|
|
|
7045
7166
|
* shared purge buffer for every row, so an already-archived manual memory is
|
|
7046
7167
|
* still deleted after the window (the archived check runs before the manual
|
|
7047
7168
|
* short-circuit by design).
|
|
7169
|
+
*
|
|
7170
|
+
* `source === "photo"` (server-extracted photo memories) is protected the same
|
|
7171
|
+
* way, and for a sharper reason than curation: those rows are PUBLISHED, and
|
|
7172
|
+
* auto-archiving one would silently un-publish it. Archived rows drop out of the
|
|
7173
|
+
* default vault read, the publish reconciler builds its desired set from that
|
|
7174
|
+
* read, and anything it previously adopted but no longer sees goes into
|
|
7175
|
+
* `toRevoke` — so an age-archive at the medium TTL would revoke a memory from
|
|
7176
|
+
* the server that the user never switched off. Revoking is the user's decision
|
|
7177
|
+
* and has exactly one entry point: the publish switch.
|
|
7048
7178
|
*/
|
|
7049
7179
|
/** The verdict for a single memory. */
|
|
7050
7180
|
type DecayVerdict = "keep" | "archive" | "delete";
|
|
@@ -9195,8 +9325,11 @@ declare function useChatStorage(options: UseChatStorageOptions): UseChatStorageR
|
|
|
9195
9325
|
* unreadable flag would fail open. Existing rows stay NULL (= legacy,
|
|
9196
9326
|
* unknown provenance, embedded as before) with no backfill, matching the v37
|
|
9197
9327
|
* read-time-fallback precedent
|
|
9328
|
+
* - v45: Added `media` to memory_vault — the photo(s) a server-extracted
|
|
9329
|
+
* memory came from, as JSON `[{feed_item_id, object_key}]`. Null on every
|
|
9330
|
+
* row that did not come from a photo, which is all of them before this
|
|
9198
9331
|
*/
|
|
9199
|
-
declare const SDK_SCHEMA_VERSION =
|
|
9332
|
+
declare const SDK_SCHEMA_VERSION = 45;
|
|
9200
9333
|
/**
|
|
9201
9334
|
* Combined WatermelonDB schema for all SDK storage modules.
|
|
9202
9335
|
*
|
|
@@ -9808,4 +9941,4 @@ declare function refreshNotionAccessToken(params: NotionRefreshTokenParams): Pro
|
|
|
9808
9941
|
*/
|
|
9809
9942
|
declare function createNotionTools(getAccessToken: () => string | null, requestNotionAccess: () => Promise<string>): ToolConfig[];
|
|
9810
9943
|
|
|
9811
|
-
export { type AutoExtractMessage, type AutoExtractor, type Budget, type CachedChunkVectors, type CachedServerTools, Conversation as ChatConversation, Message as ChatMessage, type ChatRole, type ChunkVectorCache, type ChunkingOptions, type ConsolidationFallbackReason, type ConversationMemoryInput, ConversationMemory as ConversationMemoryModel, type ConversationMemoryOperationsContext, type CreateAutoExtractorOptions, type CreateConversationOptions, type CreateDecaySweeperOptions, type CreateMessageOptions, type CreateVaultFolderOptions, type CreateVaultMemoryOptions, type CryptoPriceClassification, type CryptoPricePreProcessorOptions, DEFAULT_CACHE_EXPIRATION_MS, DEFAULT_CHUNK_CACHE_SIZE, DEFAULT_CHUNK_OVERLAP, DEFAULT_CHUNK_SIZE, DEFAULT_DECAY_POLICY, DEFAULT_MAX_CLASSIFIER_CALLS_PER_SWEEP, DEFAULT_MIN_CHUNK_SIZE, DEFAULT_PROFILE_FACETS, DEFAULT_PROFILE_FACT_TYPE_WEIGHTS, DEFAULT_PROFILE_PROOF_ALPHA, DEFAULT_PROFILE_TREND_MULTIPLIERS, DEFAULT_VAULT_CACHE_SIZE, DatabaseManager, type DatabaseManagerLogger, type DatabaseManagerOptions, type DecayCandidateRaw, type DecayClassifier, type DecayInput, type DecayPolicy, type DecaySweepResult, type DecaySweeper, type DecayVerdict, ENTITY_FANOUT, type EmbeddedWalletSignerFn, EncryptionKeyMissingError, type ExtractFactsOptions, type ExtractOutcome, type ExtractedCandidate, type ExtractedEntity, type ExtractionCursorStore, type FactType, type FileMetadata, type FlushResult, type GetConversationsPageOptions, type GetMessagesPageOptions, type GraphTraversalOptions, HARD_DELETE_WINDOW_MS, INFERENCE_ID_HEADER, type InjectionClassifierOptions, type InjectionReason, type LazyStoredConversation, type LlmDecayClassifierOptions, type LlmNeighborRefinerOptions, type Logger, LoggerProvider, type LoggerProviderProps, MAX_HOPS, MEDIUM_TTL_MS, type MemoriesNeedingTopicExtraction, type EmbeddingOptions as MemoryEngineEmbeddingOptions, type MemoryEngineResult, type MemoryEngineSearchOptions, type MemoryExtractedEvent, type MemoryKind, type MemoryQuarantinedEvent, type MemoryToVerify, type MemoryVaultSearchOptions, type MemoryVaultToolOptions, type MemoryVerification, type MessageRedactionResult, type MessageSkeleton, NEVER_TTL_MS, NODE_BUDGET, NOTION_OAUTH_CONFIG, type NeighborRefiner, type NotionAuthUrlParams, type NotionClientRegistration, type NotionExchangeCodeParams, type NotionOAuthEndpoints, type NotionPKCEChallenge, type NotionRefreshTokenParams, type NotionTokenResponse, type NowSource, type ObservationTrend, type ObservationTrendInput, PAST_EVENT_GRACE_MS, PII_PATTERNS, PROFILE_DOC_VERSION, type PiiCategory, type PiiMatch, type PiiPattern, PiiRedactor, type PiiRedactorOptions, type PlatformStorage, type PortalLlmAuth, type ProfileConfigFingerprint, type ProfileDoc, type ProfileFacet, type ProfileFacetKey, type ProfileSalienceInput, type ProfileSection, type PromptPreProcessor, type PromptPreProcessorContext, type QuantizedEmbedding, type QuarantinedMemoryInfo, QueueManager, type QueueStatus, 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 RedactionResult, type ReflectOptions, type ReflectResult, type RequestEncryptionKeyOptions, RerankerUnavailableError, type ResumeStreamOptions, type ResumeStreamResult, type ResumeStreamWithStorageResult, type RetainAction, type RetainContext, type RetainOptions, type RetainResult, type RetainSource, SDK_SCHEMA_VERSION, SHORT_TTL_MS, STREAM_RESUMABLE_HEADER, type ScoreBreakdown, type ScoreProfileSalienceOptions, type ScreenResult, type ScreenedCandidate, type SearchSource, type SendMessageWithStorageArgs, type SendMessageWithStorageDetachedResult, type SendMessageWithStorageResult, type ServerToolsOptions, type ServerToolsResponse, type SignMessageFn, type StockPriceClassification, type StockPricePreProcessorOptions, type ChatCompletionUsage as StoredChatCompletionUsage, type StoredConversation, type StoredConversationMemory, type StoredMessage, type StoredMessageWithSimilarity, type StoredVaultFolder, VaultFolder as StoredVaultFolderModel, type StoredVaultMemory, VaultMemory as StoredVaultMemoryModel, StreamExpiredError, type StreamMetaEvent, type StreamResumeHandle, type SynthesizeProfileOptions, TOPICS_EXTRACTION_VERSION, TOPIC_EXTRACTION_BATCH_SIZE, TREND_RECENT_WINDOW_DAYS, TREND_STALE_WINDOW_DAYS, type TextChunk, type TopicExtractOptions, type TopicExtractionInput, type TopicExtractionRunResult, type TurnCompleteEvent, type TurnSkippedEvent, type UncheckedReason, type UnverifiableReason, type UpdateVaultFolderOptions, type UpdateVaultMemoryOptions, type UseChatStorageOptions, type UseChatStorageResult, type UseCreditsOptions, type UseCreditsResult, type UseModelsOptions, type UseModelsResult, VAULT_SIZE_HOP_CAP, type VaultEmbeddingCache, type VaultFolderOperationsContext, type VaultMemoryOperationsContext, type VaultMemoryVisibility, type VaultSaveOperation, type VaultSearchResult, type VerificationSources, type VerifyMemoriesForPublishOptions, WalletPoller, type WeatherClassification, type WeatherPreProcessorOptions, type WebSearchClassification, type WebSearchPreProcessorOptions, addConversationMemoriesOp, archiveVaultMemoryOp, backfillMemoryTopicsOp, buildNotionAuthUrl, capHopsForDensity, chatStorageMigrations, chatStorageSchema, chunkAndEmbedAllMessages, chunkAndEmbedMessage, chunkText, classifyCryptoPrice, classifyCryptoPriceBatch, classifyDecay, classifyInjectionCandidates, classifyObservationTrend, classifyStockPrice, classifyStockPriceBatch, classifyWeather, classifyWeatherBatch, classifyWebSearch, classifyWebSearchBatch, clearAllEncryptionKeys, clearAllEncryptionState, clearConversationMemoriesOp, clearEncryptionKey, clearLazyTitleCache, clearServerToolsCache, consoleLogger, conversationMemoryToStored, cosineInt8, createAutoExtractor, createChunkVectorCache, createCryptoPricePreProcessor, createDecaySweeper, createLlmDecayClassifier, createLlmNeighborRefiner, createMemoryEngineTool, createMemoryVaultSearchTool, createMemoryVaultTool, createMessageSourceResolver, createNotionTools, createPlatformCursorStore, createRecallTool, createStockPricePreProcessor, createStreamingDeAnonymizer, createVaultEmbeddingCache, createVaultFolderOp, createVaultMemoriesBatchOp, createVaultMemoryOp, createWeatherPreProcessor, createWebSearchPreProcessor, decryptConversationTitle, deleteAllVaultMemoriesForUserOp, deleteVaultFolderOp, deleteVaultMemoryOp, dequantizeEmbedding, discoverNotionOAuthEndpoints, eagerEmbedContent, embedAllMessages, embedMessage, ensureDefaultFoldersOp, exchangeNotionCode, extractAndLinkEntitiesForMemoriesOp, extractAndRetain, extractEntitiesForMemories, extractFacts, generateConversationId, generateEmbedding, generateEmbeddings, generateNotionPKCE, getAllVaultFoldersOp, getAllVaultMemoriesOp, getAllVaultMemoryContentsOp, getCachedServerTools, getConversationMemoriesOp, getConversationsByProjectLazyOp, getConversationsLazyOp, getConversationsPageOp, getDecayCandidatesRawOp, getLogger, getMemoriesNeedingTopicExtractionOp, getServerTools, getUnfiledVaultMemoriesOp, getVaultFolderMemoryCountOp, getVaultMemoryOp, hardDeleteDecayedOp, hasEncryptionKey, injectionSignatureCatalog, isPiiRedactor, isRerankerAvailable, moveMemoriesToFolderOp, noopLogger, onKeyAvailable, preEmbedVaultMemories, quantizeEmbedding, queueManager, rankProfileCandidates, recall, reflect, refreshEncryptionKeyIfMatches, refreshNotionAccessToken, registerNotionClient, relinkMemoryTopicsOp, requestEncryptionKey, resolvePiiRedactor, restoreVaultMemoryOp, resumeStream, retain, scoreProfileSalience, screenCandidatesForInjection, sdkMigrations, sdkModelClasses, sdkSchema, searchVaultMemories, seedEncryptionKeys, setLogger, setMemoryVisibilityOp, shouldChunkMessage, stampTopicsExtractedAtOp, streamCancelPath, streamReplayPath, summarizeObservationTrends, supersedeVaultMemoryOp, synthesizeProfile, traverseGraphLane, ttlForType, updateVaultFolderContextOp, updateVaultFolderOp, updateVaultMemoryEmbeddingOp, updateVaultMemoryOp, upsertMessageOp, useChat, useChatStorage, useCredits, useEncryption, useModels, verifyMemoriesForPublish, xhrTransport };
|
|
9944
|
+
export { type AutoExtractMessage, type AutoExtractor, type Budget, type CachedChunkVectors, type CachedServerTools, Conversation as ChatConversation, Message as ChatMessage, type ChatRole, type ChunkVectorCache, type ChunkingOptions, type ConsolidationFallbackReason, type ConversationMemoryInput, ConversationMemory as ConversationMemoryModel, type ConversationMemoryOperationsContext, type CreateAutoExtractorOptions, type CreateConversationOptions, type CreateDecaySweeperOptions, type CreateMessageOptions, type CreateVaultFolderOptions, type CreateVaultMemoryOptions, type CryptoPriceClassification, type CryptoPricePreProcessorOptions, DEFAULT_CACHE_EXPIRATION_MS, DEFAULT_CHUNK_CACHE_SIZE, DEFAULT_CHUNK_OVERLAP, DEFAULT_CHUNK_SIZE, DEFAULT_DECAY_POLICY, DEFAULT_MAX_CLASSIFIER_CALLS_PER_SWEEP, DEFAULT_MIN_CHUNK_SIZE, DEFAULT_PROFILE_FACETS, DEFAULT_PROFILE_FACT_TYPE_WEIGHTS, DEFAULT_PROFILE_PROOF_ALPHA, DEFAULT_PROFILE_TREND_MULTIPLIERS, DEFAULT_VAULT_CACHE_SIZE, DatabaseManager, type DatabaseManagerLogger, type DatabaseManagerOptions, type DecayCandidateRaw, type DecayClassifier, type DecayInput, type DecayPolicy, type DecaySweepResult, type DecaySweeper, type DecayVerdict, ENTITY_FANOUT, type EmbeddedWalletSignerFn, EncryptionKeyMissingError, type ExtractFactsOptions, type ExtractOutcome, type ExtractedCandidate, type ExtractedEntity, type ExtractionCursorStore, type FactType, type FileMetadata, type FlushResult, type GetConversationsPageOptions, type GetMessagesPageOptions, type GraphTraversalOptions, HARD_DELETE_WINDOW_MS, INFERENCE_ID_HEADER, type InjectionClassifierOptions, type InjectionReason, type LazyStoredConversation, type LlmDecayClassifierOptions, type LlmNeighborRefinerOptions, type Logger, LoggerProvider, type LoggerProviderProps, MAX_HOPS, MEDIUM_TTL_MS, type MemoriesNeedingTopicExtraction, type EmbeddingOptions as MemoryEngineEmbeddingOptions, type MemoryEngineResult, type MemoryEngineSearchOptions, type MemoryExtractedEvent, type MemoryKind, type MemoryQuarantinedEvent, type MemoryToVerify, type MemoryVaultSearchOptions, type MemoryVaultToolOptions, type MemoryVerification, type MessageRedactionResult, type MessageSkeleton, NEVER_TTL_MS, NODE_BUDGET, NOTION_OAUTH_CONFIG, type NeighborRefiner, type NotionAuthUrlParams, type NotionClientRegistration, type NotionExchangeCodeParams, type NotionOAuthEndpoints, type NotionPKCEChallenge, type NotionRefreshTokenParams, type NotionTokenResponse, type NowSource, type ObservationTrend, type ObservationTrendInput, PAST_EVENT_GRACE_MS, PII_PATTERNS, PROFILE_DOC_VERSION, type PhotoIngestResult, type PhotoMediaRef, type PiiCategory, type PiiMatch, type PiiPattern, PiiRedactor, type PiiRedactorOptions, type PlatformStorage, type PortalLlmAuth, type ProfileConfigFingerprint, type ProfileDoc, type ProfileFacet, type ProfileFacetKey, type ProfileSalienceInput, type ProfileSection, type PromptPreProcessor, type PromptPreProcessorContext, type PublishedPhotoMemory, type QuantizedEmbedding, type QuarantinedMemoryInfo, QueueManager, type QueueStatus, RECALL_MAX_LIMIT, RECALL_TOOL_NAME, type RankedMemory, type RankedProfileCandidate, type RecallContext, type RecallDegradation, type RecallDiagnostics, type RecallOptions, type RecallResult, type RecallToolCallbacks, type RecallToolOptions, type RecencyOptions, type RedactionResult, type ReflectOptions, type ReflectResult, type RequestEncryptionKeyOptions, RerankerUnavailableError, type ResumeStreamOptions, type ResumeStreamResult, type ResumeStreamWithStorageResult, type RetainAction, type RetainContext, type RetainOptions, type RetainResult, type RetainSource, SDK_SCHEMA_VERSION, SHORT_TTL_MS, STREAM_RESUMABLE_HEADER, type ScoreBreakdown, type ScoreProfileSalienceOptions, type ScreenResult, type ScreenedCandidate, type SearchSource, type SendMessageWithStorageArgs, type SendMessageWithStorageDetachedResult, type SendMessageWithStorageResult, type ServerToolsOptions, type ServerToolsResponse, type SignMessageFn, type StockPriceClassification, type StockPricePreProcessorOptions, type ChatCompletionUsage as StoredChatCompletionUsage, type StoredConversation, type StoredConversationMemory, type StoredMessage, type StoredMessageWithSimilarity, type StoredVaultFolder, VaultFolder as StoredVaultFolderModel, type StoredVaultMemory, VaultMemory as StoredVaultMemoryModel, StreamExpiredError, type StreamMetaEvent, type StreamResumeHandle, type SynthesizeProfileOptions, TOPICS_EXTRACTION_VERSION, TOPIC_EXTRACTION_BATCH_SIZE, TREND_RECENT_WINDOW_DAYS, TREND_STALE_WINDOW_DAYS, type TextChunk, type TopicExtractOptions, type TopicExtractionInput, type TopicExtractionRunResult, type TurnCompleteEvent, type TurnSkippedEvent, type UncheckedReason, type UnverifiableReason, type UpdateVaultFolderOptions, type UpdateVaultMemoryOptions, type UseChatStorageOptions, type UseChatStorageResult, type UseCreditsOptions, type UseCreditsResult, type UseModelsOptions, type UseModelsResult, VAULT_SIZE_HOP_CAP, type VaultEmbeddingCache, type VaultFolderOperationsContext, type VaultMemoryOperationsContext, type VaultMemoryVisibility, type VaultSaveOperation, type VaultSearchResult, type VerificationSources, type VerifyMemoriesForPublishOptions, WalletPoller, type WeatherClassification, type WeatherPreProcessorOptions, type WebSearchClassification, type WebSearchPreProcessorOptions, addConversationMemoriesOp, archiveVaultMemoryOp, backfillMemoryTopicsOp, buildNotionAuthUrl, capHopsForDensity, chatStorageMigrations, chatStorageSchema, chunkAndEmbedAllMessages, chunkAndEmbedMessage, chunkText, classifyCryptoPrice, classifyCryptoPriceBatch, classifyDecay, classifyInjectionCandidates, classifyObservationTrend, classifyStockPrice, classifyStockPriceBatch, classifyWeather, classifyWeatherBatch, classifyWebSearch, classifyWebSearchBatch, clearAllEncryptionKeys, clearAllEncryptionState, clearConversationMemoriesOp, clearEncryptionKey, clearLazyTitleCache, clearServerToolsCache, consoleLogger, conversationMemoryToStored, cosineInt8, createAutoExtractor, createChunkVectorCache, createCryptoPricePreProcessor, createDecaySweeper, createLlmDecayClassifier, createLlmNeighborRefiner, createMemoryEngineTool, createMemoryVaultSearchTool, createMemoryVaultTool, createMessageSourceResolver, createNotionTools, createPlatformCursorStore, createRecallTool, createStockPricePreProcessor, createStreamingDeAnonymizer, createVaultEmbeddingCache, createVaultFolderOp, createVaultMemoriesBatchOp, createVaultMemoryOp, createWeatherPreProcessor, createWebSearchPreProcessor, decryptConversationTitle, deleteAllVaultMemoriesForUserOp, deleteVaultFolderOp, deleteVaultMemoryOp, dequantizeEmbedding, discoverNotionOAuthEndpoints, eagerEmbedContent, embedAllMessages, embedMessage, ensureDefaultFoldersOp, exchangeNotionCode, extractAndLinkEntitiesForMemoriesOp, extractAndRetain, extractEntitiesForMemories, extractFacts, generateConversationId, generateEmbedding, generateEmbeddings, generateNotionPKCE, getAllVaultFoldersOp, getAllVaultMemoriesOp, getAllVaultMemoryContentsOp, getCachedServerTools, getConversationMemoriesOp, getConversationsByProjectLazyOp, getConversationsLazyOp, getConversationsPageOp, getDecayCandidatesRawOp, getLogger, getMemoriesNeedingTopicExtractionOp, getServerTools, getUnfiledVaultMemoriesOp, getVaultFolderMemoryCountOp, getVaultMemoryOp, hardDeleteDecayedOp, hasEncryptionKey, ingestPublishedPhotoMemoriesOp, injectionSignatureCatalog, isPiiRedactor, isRerankerAvailable, moveMemoriesToFolderOp, noopLogger, onKeyAvailable, parseMedia, preEmbedVaultMemories, quantizeEmbedding, queueManager, rankProfileCandidates, recall, reflect, refreshEncryptionKeyIfMatches, refreshNotionAccessToken, registerNotionClient, relinkMemoryTopicsOp, requestEncryptionKey, resolvePiiRedactor, restoreVaultMemoryOp, resumeStream, retain, scoreProfileSalience, screenCandidatesForInjection, sdkMigrations, sdkModelClasses, sdkSchema, searchVaultMemories, seedEncryptionKeys, setLogger, setMemoryVisibilityOp, shouldChunkMessage, stampTopicsExtractedAtOp, streamCancelPath, streamReplayPath, summarizeObservationTrends, supersedeVaultMemoryOp, synthesizeProfile, traverseGraphLane, ttlForType, updateVaultFolderContextOp, updateVaultFolderOp, updateVaultMemoryEmbeddingOp, updateVaultMemoryOp, upsertMessageOp, useChat, useChatStorage, useCredits, useEncryption, useModels, verifyMemoriesForPublish, xhrTransport };
|