@anuma/sdk 6.34.0 → 6.36.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/expo/index.cjs +858 -52
- package/dist/expo/index.d.mts +134 -8
- package/dist/expo/index.d.ts +134 -8
- package/dist/expo/index.mjs +848 -52
- package/dist/memory/context.d.mts +21 -1
- package/dist/memory/context.d.ts +21 -1
- package/dist/react/index.cjs +848 -42
- package/dist/react/index.d.mts +134 -8
- package/dist/react/index.d.ts +134 -8
- package/dist/react/index.mjs +838 -42
- package/dist/server/index.cjs +201 -13
- package/dist/server/index.d.mts +61 -8
- package/dist/server/index.d.ts +61 -8
- package/dist/server/index.mjs +198 -13
- package/package.json +1 -1
package/dist/server/index.cjs
CHANGED
|
@@ -16302,7 +16302,10 @@ __export(index_exports, {
|
|
|
16302
16302
|
MAX_HOPS: () => MAX_HOPS,
|
|
16303
16303
|
MAX_MESSAGES_PER_SUMMARIZATION: () => MAX_MESSAGES_PER_SUMMARIZATION,
|
|
16304
16304
|
MEDIUM_TTL_MS: () => MEDIUM_TTL_MS,
|
|
16305
|
+
MEMORY_KINDS: () => MEMORY_KINDS,
|
|
16306
|
+
MEMORY_LEVELS: () => MEMORY_LEVELS,
|
|
16305
16307
|
Media: () => Media,
|
|
16308
|
+
MemoryLevelError: () => MemoryLevelError,
|
|
16306
16309
|
Message: () => Message,
|
|
16307
16310
|
ModelPreference: () => ModelPreference,
|
|
16308
16311
|
NEVER_TTL_MS: () => NEVER_TTL_MS,
|
|
@@ -25407,6 +25410,15 @@ __decorateClass([
|
|
|
25407
25410
|
__decorateClass([
|
|
25408
25411
|
(0, import_decorators6.text)("scope")
|
|
25409
25412
|
], VaultMemory.prototype, "scope", 2);
|
|
25413
|
+
__decorateClass([
|
|
25414
|
+
(0, import_decorators6.field)("kind")
|
|
25415
|
+
], VaultMemory.prototype, "kind", 2);
|
|
25416
|
+
__decorateClass([
|
|
25417
|
+
(0, import_decorators6.field)("kind_value")
|
|
25418
|
+
], VaultMemory.prototype, "kindValue", 2);
|
|
25419
|
+
__decorateClass([
|
|
25420
|
+
(0, import_decorators6.field)("level")
|
|
25421
|
+
], VaultMemory.prototype, "level", 2);
|
|
25410
25422
|
__decorateClass([
|
|
25411
25423
|
(0, import_decorators6.field)("folder_id")
|
|
25412
25424
|
], VaultMemory.prototype, "folderId", 2);
|
|
@@ -25632,7 +25644,7 @@ __decorateClass([
|
|
|
25632
25644
|
], VaultFolder.prototype, "context", 2);
|
|
25633
25645
|
|
|
25634
25646
|
// src/lib/db/schema.ts
|
|
25635
|
-
var SDK_SCHEMA_VERSION =
|
|
25647
|
+
var SDK_SCHEMA_VERSION = 48;
|
|
25636
25648
|
var sdkSchema = (0, import_watermelondb15.appSchema)({
|
|
25637
25649
|
version: SDK_SCHEMA_VERSION,
|
|
25638
25650
|
tables: [
|
|
@@ -25727,6 +25739,9 @@ var sdkSchema = (0, import_watermelondb15.appSchema)({
|
|
|
25727
25739
|
columns: [
|
|
25728
25740
|
{ name: "content", type: "string" },
|
|
25729
25741
|
{ name: "scope", type: "string", isIndexed: true },
|
|
25742
|
+
{ name: "kind", type: "string", isOptional: true, isIndexed: true },
|
|
25743
|
+
{ name: "kind_value", type: "string", isOptional: true },
|
|
25744
|
+
{ name: "level", type: "string", isOptional: true, isIndexed: true },
|
|
25730
25745
|
{ name: "folder_id", type: "string", isOptional: true, isIndexed: true },
|
|
25731
25746
|
{ name: "created_at", type: "number", isIndexed: true },
|
|
25732
25747
|
{ name: "updated_at", type: "number", isIndexed: true },
|
|
@@ -26403,6 +26418,22 @@ var sdkMigrations = (0, import_migrations.schemaMigrations)({
|
|
|
26403
26418
|
]
|
|
26404
26419
|
})
|
|
26405
26420
|
]
|
|
26421
|
+
},
|
|
26422
|
+
{
|
|
26423
|
+
toVersion: 48,
|
|
26424
|
+
steps: [
|
|
26425
|
+
(0, import_migrations.addColumns)({
|
|
26426
|
+
table: "memory_vault",
|
|
26427
|
+
columns: [
|
|
26428
|
+
{ name: "kind", type: "string", isOptional: true, isIndexed: true },
|
|
26429
|
+
{ name: "kind_value", type: "string", isOptional: true },
|
|
26430
|
+
{ name: "level", type: "string", isOptional: true, isIndexed: true }
|
|
26431
|
+
]
|
|
26432
|
+
}),
|
|
26433
|
+
(0, import_migrations.unsafeExecuteSql)(
|
|
26434
|
+
"UPDATE memory_vault SET level = CASE WHEN scope IN ('shared', 'public') THEN 'matching' ELSE 'private' END WHERE level IS NULL;"
|
|
26435
|
+
)
|
|
26436
|
+
]
|
|
26406
26437
|
}
|
|
26407
26438
|
]
|
|
26408
26439
|
});
|
|
@@ -27558,13 +27589,54 @@ async function decryptVaultMemoryFields(memory, address, signMessage, embeddedWa
|
|
|
27558
27589
|
}
|
|
27559
27590
|
}
|
|
27560
27591
|
const decryptedContent = await decryptField(memory.content, address);
|
|
27592
|
+
const decryptedKindValue = typeof memory.kindValue === "string" ? await decryptField(memory.kindValue, address) : memory.kindValue;
|
|
27561
27593
|
return {
|
|
27562
27594
|
...memory,
|
|
27563
|
-
content: decryptedContent
|
|
27595
|
+
content: decryptedContent,
|
|
27596
|
+
...decryptedKindValue !== void 0 && { kindValue: decryptedKindValue }
|
|
27564
27597
|
};
|
|
27565
27598
|
}
|
|
27566
27599
|
|
|
27567
27600
|
// src/lib/db/memoryVault/types.ts
|
|
27601
|
+
var MEMORY_KINDS = [
|
|
27602
|
+
"display_name",
|
|
27603
|
+
"birth_date",
|
|
27604
|
+
"bio",
|
|
27605
|
+
"occupation",
|
|
27606
|
+
"interest",
|
|
27607
|
+
"gender",
|
|
27608
|
+
"height_cm",
|
|
27609
|
+
"looking_for",
|
|
27610
|
+
"politics",
|
|
27611
|
+
"religion",
|
|
27612
|
+
"ethnicity",
|
|
27613
|
+
"smoking",
|
|
27614
|
+
"drinking",
|
|
27615
|
+
"exercise",
|
|
27616
|
+
"sexuality",
|
|
27617
|
+
"prompt"
|
|
27618
|
+
];
|
|
27619
|
+
var MEMORY_LEVELS = ["private", "matching", "profile"];
|
|
27620
|
+
var MemoryLevelError = class extends Error {
|
|
27621
|
+
constructor(message) {
|
|
27622
|
+
super(message);
|
|
27623
|
+
this.name = "MemoryLevelError";
|
|
27624
|
+
}
|
|
27625
|
+
};
|
|
27626
|
+
var PUBLISHED_SCOPES = /* @__PURE__ */ new Set(["shared", "public"]);
|
|
27627
|
+
function levelFromScope(scope) {
|
|
27628
|
+
return typeof scope === "string" && PUBLISHED_SCOPES.has(scope) ? "matching" : "private";
|
|
27629
|
+
}
|
|
27630
|
+
function scopeForLevel(level) {
|
|
27631
|
+
return level === "private" ? "private" : "shared";
|
|
27632
|
+
}
|
|
27633
|
+
function resolveMemoryLevel(level, scope) {
|
|
27634
|
+
return typeof level === "string" && MEMORY_LEVELS.includes(level) ? level : levelFromScope(scope);
|
|
27635
|
+
}
|
|
27636
|
+
function levelForScopeChange(current, nextScope) {
|
|
27637
|
+
const implied = levelFromScope(nextScope);
|
|
27638
|
+
return implied === "matching" && resolveMemoryLevel(current.level, current.scope) === "profile" ? "profile" : implied;
|
|
27639
|
+
}
|
|
27568
27640
|
function parseMedia(value) {
|
|
27569
27641
|
if (typeof value !== "string" || value === "") return null;
|
|
27570
27642
|
try {
|
|
@@ -27594,6 +27666,56 @@ function visibilityConditions(requested) {
|
|
|
27594
27666
|
if (excluded.length === 0) return [];
|
|
27595
27667
|
return [import_watermelondb19.Q.or(import_watermelondb19.Q.where("visibility", null), import_watermelondb19.Q.where("visibility", import_watermelondb19.Q.notIn(excluded)))];
|
|
27596
27668
|
}
|
|
27669
|
+
function isKinded(record) {
|
|
27670
|
+
return record.kind !== null && record.kind !== void 0;
|
|
27671
|
+
}
|
|
27672
|
+
function assertValidKindLevel(kind, level) {
|
|
27673
|
+
const hasKind = kind !== null && kind !== void 0;
|
|
27674
|
+
if (hasKind && !MEMORY_KINDS.includes(kind)) {
|
|
27675
|
+
throw new MemoryLevelError(`Unknown memory kind: ${kind}`);
|
|
27676
|
+
}
|
|
27677
|
+
if (level !== void 0 && !MEMORY_LEVELS.includes(level)) {
|
|
27678
|
+
throw new MemoryLevelError(`Unknown memory level: ${level}`);
|
|
27679
|
+
}
|
|
27680
|
+
if (level === "profile" && !hasKind) {
|
|
27681
|
+
throw new MemoryLevelError("Only a memory with a kind can be at level 'profile'");
|
|
27682
|
+
}
|
|
27683
|
+
}
|
|
27684
|
+
function resolveCreateLevel(opts) {
|
|
27685
|
+
if (opts.level !== void 0) return { level: opts.level, scope: scopeForLevel(opts.level) };
|
|
27686
|
+
if (opts.scope !== void 0) return { level: levelFromScope(opts.scope), scope: opts.scope };
|
|
27687
|
+
return { level: "private", scope: "private" };
|
|
27688
|
+
}
|
|
27689
|
+
async function encryptKindValue(ctx, value) {
|
|
27690
|
+
if (typeof value !== "string" || !ctx.walletAddress || !ctx.signMessage) return value;
|
|
27691
|
+
return encryptVaultMemoryContent(
|
|
27692
|
+
value,
|
|
27693
|
+
ctx.walletAddress,
|
|
27694
|
+
ctx.signMessage,
|
|
27695
|
+
ctx.embeddedWalletSigner
|
|
27696
|
+
);
|
|
27697
|
+
}
|
|
27698
|
+
function levelConditions(requested) {
|
|
27699
|
+
if (!requested?.length) return [];
|
|
27700
|
+
const published = ["shared", "public"];
|
|
27701
|
+
const wantsMatching = requested.includes("matching");
|
|
27702
|
+
const wantsPrivate = requested.includes("private");
|
|
27703
|
+
const unresolved = import_watermelondb19.Q.or(import_watermelondb19.Q.where("level", null), import_watermelondb19.Q.where("level", import_watermelondb19.Q.notIn([...MEMORY_LEVELS])));
|
|
27704
|
+
const byLevel = import_watermelondb19.Q.where("level", import_watermelondb19.Q.oneOf([...requested]));
|
|
27705
|
+
if (wantsMatching && wantsPrivate) return [import_watermelondb19.Q.or(byLevel, unresolved)];
|
|
27706
|
+
if (wantsMatching) {
|
|
27707
|
+
return [import_watermelondb19.Q.or(byLevel, import_watermelondb19.Q.and(unresolved, import_watermelondb19.Q.where("scope", import_watermelondb19.Q.oneOf(published))))];
|
|
27708
|
+
}
|
|
27709
|
+
if (wantsPrivate) {
|
|
27710
|
+
return [
|
|
27711
|
+
import_watermelondb19.Q.or(
|
|
27712
|
+
byLevel,
|
|
27713
|
+
import_watermelondb19.Q.and(unresolved, import_watermelondb19.Q.or(import_watermelondb19.Q.where("scope", null), import_watermelondb19.Q.where("scope", import_watermelondb19.Q.notIn(published))))
|
|
27714
|
+
)
|
|
27715
|
+
];
|
|
27716
|
+
}
|
|
27717
|
+
return [byLevel];
|
|
27718
|
+
}
|
|
27597
27719
|
function isOwnedByCtxUser(ctx, record) {
|
|
27598
27720
|
return ctx.userId === void 0 || record.userId === ctx.userId;
|
|
27599
27721
|
}
|
|
@@ -27637,6 +27759,9 @@ function vaultMemoryToStoredRaw(memory) {
|
|
|
27637
27759
|
uniqueId: memory.id,
|
|
27638
27760
|
content: memory.content,
|
|
27639
27761
|
scope: memory.scope,
|
|
27762
|
+
kind: memory.kind ?? null,
|
|
27763
|
+
kindValue: memory.kindValue ?? null,
|
|
27764
|
+
level: resolveMemoryLevel(memory.level, memory.scope),
|
|
27640
27765
|
folderId: memory.folderId ?? null,
|
|
27641
27766
|
userId: memory.userId ?? null,
|
|
27642
27767
|
embedding: memory.embedding ?? null,
|
|
@@ -27675,9 +27800,13 @@ async function vaultMemoryToStored(memory, walletAddress, signMessage, embeddedW
|
|
|
27675
27800
|
}
|
|
27676
27801
|
return raw;
|
|
27677
27802
|
}
|
|
27678
|
-
function populateNewVaultMemory(record, ctx, opts, encryptedContent) {
|
|
27803
|
+
function populateNewVaultMemory(record, ctx, opts, encryptedContent, encryptedKindValue) {
|
|
27804
|
+
const { level, scope } = resolveCreateLevel(opts);
|
|
27679
27805
|
record._setRaw("content", encryptedContent);
|
|
27680
|
-
record._setRaw("scope",
|
|
27806
|
+
record._setRaw("scope", scope);
|
|
27807
|
+
record._setRaw("level", level);
|
|
27808
|
+
record._setRaw("kind", opts.kind ?? null);
|
|
27809
|
+
record._setRaw("kind_value", encryptedKindValue ?? null);
|
|
27681
27810
|
record._setRaw("folder_id", opts.folderId ?? null);
|
|
27682
27811
|
record._setRaw("user_id", ctx.userId ?? null);
|
|
27683
27812
|
record._setRaw("is_deleted", false);
|
|
@@ -27711,6 +27840,8 @@ function populateNewVaultMemory(record, ctx, opts, encryptedContent) {
|
|
|
27711
27840
|
}
|
|
27712
27841
|
}
|
|
27713
27842
|
async function createVaultMemoryOp(ctx, opts) {
|
|
27843
|
+
assertValidKindLevel(opts.kind, resolveCreateLevel(opts).level);
|
|
27844
|
+
const encryptedKindValue = await encryptKindValue(ctx, opts.kindValue);
|
|
27714
27845
|
const encryptedContent = ctx.walletAddress && ctx.signMessage ? await encryptVaultMemoryContent(
|
|
27715
27846
|
opts.content,
|
|
27716
27847
|
ctx.walletAddress,
|
|
@@ -27721,13 +27852,15 @@ async function createVaultMemoryOp(ctx, opts) {
|
|
|
27721
27852
|
if (ctx.canWrite && !await ctx.canWrite())
|
|
27722
27853
|
throw new Error("Memory source is no longer eligible");
|
|
27723
27854
|
return ctx.vaultMemoryCollection.create(
|
|
27724
|
-
(record) => populateNewVaultMemory(record, ctx, opts, encryptedContent)
|
|
27855
|
+
(record) => populateNewVaultMemory(record, ctx, opts, encryptedContent, encryptedKindValue)
|
|
27725
27856
|
);
|
|
27726
27857
|
});
|
|
27727
27858
|
return vaultMemoryToStored(created, ctx.walletAddress, ctx.signMessage, ctx.embeddedWalletSigner);
|
|
27728
27859
|
}
|
|
27729
27860
|
async function createSupersedingMemoryOp(ctx, opts, targetId) {
|
|
27730
27861
|
if (!targetId) return { created: null, retired: false };
|
|
27862
|
+
assertValidKindLevel(opts.kind, resolveCreateLevel(opts).level);
|
|
27863
|
+
const encryptedKindValue = await encryptKindValue(ctx, opts.kindValue);
|
|
27731
27864
|
const encryptedContent = ctx.walletAddress && ctx.signMessage ? await encryptVaultMemoryContent(
|
|
27732
27865
|
opts.content,
|
|
27733
27866
|
ctx.walletAddress,
|
|
@@ -27744,9 +27877,10 @@ async function createSupersedingMemoryOp(ctx, opts, targetId) {
|
|
|
27744
27877
|
} catch {
|
|
27745
27878
|
return;
|
|
27746
27879
|
}
|
|
27747
|
-
if (target.isDeleted || target.supersededBy || !isOwnedByCtxUser(ctx, target))
|
|
27880
|
+
if (target.isDeleted || target.supersededBy || isKinded(target) || !isOwnedByCtxUser(ctx, target))
|
|
27881
|
+
return;
|
|
27748
27882
|
createdRecord = await ctx.vaultMemoryCollection.create(
|
|
27749
|
-
(record) => populateNewVaultMemory(record, ctx, opts, encryptedContent)
|
|
27883
|
+
(record) => populateNewVaultMemory(record, ctx, opts, encryptedContent, encryptedKindValue)
|
|
27750
27884
|
);
|
|
27751
27885
|
await target.update((r) => {
|
|
27752
27886
|
r._setRaw("superseded_by", createdRecord.id);
|
|
@@ -27810,6 +27944,10 @@ async function getMemoriesByEventTimeOp(ctx, windowStart, windowEnd) {
|
|
|
27810
27944
|
}
|
|
27811
27945
|
async function createVaultMemoriesBatchOp(ctx, optionsArray) {
|
|
27812
27946
|
if (optionsArray.length === 0) return [];
|
|
27947
|
+
for (const opts of optionsArray) assertValidKindLevel(opts.kind, resolveCreateLevel(opts).level);
|
|
27948
|
+
const encryptedKindValues = await Promise.all(
|
|
27949
|
+
optionsArray.map((opts) => encryptKindValue(ctx, opts.kindValue))
|
|
27950
|
+
);
|
|
27813
27951
|
const encryptedContents = await Promise.all(
|
|
27814
27952
|
optionsArray.map(async (opts) => {
|
|
27815
27953
|
if (ctx.walletAddress && ctx.signMessage) {
|
|
@@ -27828,7 +27966,7 @@ async function createVaultMemoriesBatchOp(ctx, optionsArray) {
|
|
|
27828
27966
|
throw new Error("Memory source is no longer eligible");
|
|
27829
27967
|
const prepared = optionsArray.map(
|
|
27830
27968
|
(opts, i) => ctx.vaultMemoryCollection.prepareCreate(
|
|
27831
|
-
(record) => populateNewVaultMemory(record, ctx, opts, encryptedContents[i])
|
|
27969
|
+
(record) => populateNewVaultMemory(record, ctx, opts, encryptedContents[i], encryptedKindValues[i])
|
|
27832
27970
|
)
|
|
27833
27971
|
);
|
|
27834
27972
|
await ctx.database.batch(...prepared);
|
|
@@ -27871,6 +28009,9 @@ function vaultMemoryRawToStoredRaw(raw) {
|
|
|
27871
28009
|
uniqueId: raw.id,
|
|
27872
28010
|
content: raw.content ?? "",
|
|
27873
28011
|
scope: raw.scope ?? "",
|
|
28012
|
+
kind: raw.kind ?? null,
|
|
28013
|
+
kindValue: raw.kind_value ?? null,
|
|
28014
|
+
level: resolveMemoryLevel(raw.level, raw.scope),
|
|
27874
28015
|
folderId: raw.folder_id ?? null,
|
|
27875
28016
|
userId: raw.user_id ?? null,
|
|
27876
28017
|
embedding: raw.embedding ?? null,
|
|
@@ -27914,6 +28055,8 @@ async function getAllVaultMemoriesOp(ctx, options) {
|
|
|
27914
28055
|
...baseVaultConditions(ctx, options),
|
|
27915
28056
|
...options?.scopes?.length ? [import_watermelondb19.Q.where("scope", import_watermelondb19.Q.oneOf(options.scopes))] : [],
|
|
27916
28057
|
...visibilityConditions(options?.visibility),
|
|
28058
|
+
...levelConditions(options?.levels),
|
|
28059
|
+
...options?.kinds?.length ? [import_watermelondb19.Q.where("kind", import_watermelondb19.Q.oneOf(options.kinds))] : [],
|
|
27917
28060
|
...options?.folderId !== void 0 ? [import_watermelondb19.Q.where("folder_id", options.folderId)] : [],
|
|
27918
28061
|
...options?.factTypes?.length ? [import_watermelondb19.Q.where("fact_type", import_watermelondb19.Q.oneOf(options.factTypes))] : [],
|
|
27919
28062
|
import_watermelondb19.Q.sortBy(options?.since ? "updated_at" : "created_at", import_watermelondb19.Q.desc),
|
|
@@ -28080,6 +28223,14 @@ async function updateVaultMemoryOp(ctx, id, opts) {
|
|
|
28080
28223
|
try {
|
|
28081
28224
|
const probe = await ctx.vaultMemoryCollection.find(id);
|
|
28082
28225
|
if (probe.isDeleted || probe.supersededBy || !isOwnedByCtxUser(ctx, probe)) return null;
|
|
28226
|
+
if (opts.freeFormOnly && isKinded(probe)) return null;
|
|
28227
|
+
const levelAfter = (current) => {
|
|
28228
|
+
if (opts.level !== void 0) return opts.level;
|
|
28229
|
+
if (opts.scope === void 0) return resolveMemoryLevel(current.level, current.scope);
|
|
28230
|
+
return levelForScopeChange(current, opts.scope);
|
|
28231
|
+
};
|
|
28232
|
+
assertValidKindLevel(opts.kind !== void 0 ? opts.kind : probe.kind, levelAfter(probe));
|
|
28233
|
+
const encryptedKindValue = await encryptKindValue(ctx, opts.kindValue);
|
|
28083
28234
|
const encryptedContent = ctx.walletAddress && ctx.signMessage ? await encryptVaultMemoryContent(
|
|
28084
28235
|
opts.content,
|
|
28085
28236
|
ctx.walletAddress,
|
|
@@ -28092,10 +28243,13 @@ async function updateVaultMemoryOp(ctx, id, opts) {
|
|
|
28092
28243
|
await ctx.database.write(async () => {
|
|
28093
28244
|
if (ctx.canWrite && !await ctx.canWrite())
|
|
28094
28245
|
throw new Error("Memory source is no longer eligible");
|
|
28095
|
-
if (record.isDeleted || record.supersededBy || !isOwnedByCtxUser(ctx, record)) {
|
|
28246
|
+
if (record.isDeleted || record.supersededBy || !isOwnedByCtxUser(ctx, record) || opts.freeFormOnly && isKinded(record)) {
|
|
28096
28247
|
stale = true;
|
|
28097
28248
|
return;
|
|
28098
28249
|
}
|
|
28250
|
+
const nextKind = opts.kind !== void 0 ? opts.kind : record.kind;
|
|
28251
|
+
const nextLevel = levelAfter(record);
|
|
28252
|
+
assertValidKindLevel(nextKind, nextLevel);
|
|
28099
28253
|
let observedSources = [];
|
|
28100
28254
|
let replayedObservation = false;
|
|
28101
28255
|
if (opts.observationSourceIds?.length) {
|
|
@@ -28109,8 +28263,18 @@ async function updateVaultMemoryOp(ctx, id, opts) {
|
|
|
28109
28263
|
}
|
|
28110
28264
|
await record.update((r) => {
|
|
28111
28265
|
r._setRaw("content", encryptedContent);
|
|
28112
|
-
if (opts.
|
|
28266
|
+
if (opts.level !== void 0) {
|
|
28267
|
+
r._setRaw("level", nextLevel);
|
|
28268
|
+
r._setRaw("scope", scopeForLevel(nextLevel));
|
|
28269
|
+
} else if (opts.scope !== void 0) {
|
|
28113
28270
|
r._setRaw("scope", opts.scope);
|
|
28271
|
+
r._setRaw("level", nextLevel);
|
|
28272
|
+
}
|
|
28273
|
+
if (opts.kind !== void 0) {
|
|
28274
|
+
r._setRaw("kind", opts.kind);
|
|
28275
|
+
}
|
|
28276
|
+
if (encryptedKindValue !== void 0) {
|
|
28277
|
+
r._setRaw("kind_value", encryptedKindValue);
|
|
28114
28278
|
}
|
|
28115
28279
|
if (opts.folderId !== void 0) {
|
|
28116
28280
|
r._setRaw("folder_id", opts.folderId);
|
|
@@ -28169,7 +28333,8 @@ async function updateVaultMemoryOp(ctx, id, opts) {
|
|
|
28169
28333
|
ctx.signMessage,
|
|
28170
28334
|
ctx.embeddedWalletSigner
|
|
28171
28335
|
);
|
|
28172
|
-
} catch {
|
|
28336
|
+
} catch (err) {
|
|
28337
|
+
if (err instanceof MemoryLevelError) throw err;
|
|
28173
28338
|
return null;
|
|
28174
28339
|
}
|
|
28175
28340
|
}
|
|
@@ -28305,6 +28470,7 @@ async function supersedeVaultMemoryOp(ctx, id, supersededById) {
|
|
|
28305
28470
|
try {
|
|
28306
28471
|
const record = await ctx.vaultMemoryCollection.find(id);
|
|
28307
28472
|
if (record.isDeleted || record.supersededBy || !isOwnedByCtxUser(ctx, record)) return false;
|
|
28473
|
+
if (isKinded(record)) return false;
|
|
28308
28474
|
let successor;
|
|
28309
28475
|
try {
|
|
28310
28476
|
successor = await ctx.vaultMemoryCollection.find(supersededById);
|
|
@@ -28605,7 +28771,10 @@ function assertVaultScopeForSweep(ctx) {
|
|
|
28605
28771
|
}
|
|
28606
28772
|
async function getDecayCandidatesRawOp(ctx) {
|
|
28607
28773
|
assertVaultScopeForSweep(ctx);
|
|
28608
|
-
const results = await ctx.vaultMemoryCollection.query(
|
|
28774
|
+
const results = await ctx.vaultMemoryCollection.query(
|
|
28775
|
+
...baseVaultConditions(ctx, { includeArchived: true, includeQuarantined: true }),
|
|
28776
|
+
import_watermelondb19.Q.where("kind", null)
|
|
28777
|
+
).unsafeFetchRaw();
|
|
28609
28778
|
return results.map((raw) => ({
|
|
28610
28779
|
uniqueId: raw.id,
|
|
28611
28780
|
factType: raw.fact_type ?? null,
|
|
@@ -28866,6 +29035,7 @@ async function ingestPublishedPhotoMemoriesOp(ctx, rows) {
|
|
|
28866
29035
|
record._raw.id = row.memoryId;
|
|
28867
29036
|
record._setRaw("content", content);
|
|
28868
29037
|
record._setRaw("scope", "shared");
|
|
29038
|
+
record._setRaw("level", "matching");
|
|
28869
29039
|
record._setRaw("folder_id", null);
|
|
28870
29040
|
record._setRaw("user_id", ctx.userId ?? null);
|
|
28871
29041
|
record._setRaw("is_deleted", false);
|
|
@@ -31820,6 +31990,7 @@ async function retainWithPersistence(content, ctx, options = {}) {
|
|
|
31820
31990
|
includeArchived: true,
|
|
31821
31991
|
...options.folderId !== void 0 && { folderId: options.folderId }
|
|
31822
31992
|
});
|
|
31993
|
+
prepared = withoutKindedRows(prepared);
|
|
31823
31994
|
if (prepared.embeddingFailure || prepared.embeddingsUnavailable) {
|
|
31824
31995
|
throw new Error(
|
|
31825
31996
|
"retain: embeddings unavailable \u2014 refusing to auto-merge against an inert cosine lane, which would create a duplicate instead of merging into the existing memory. Retry when embeddings recover, or pass enableAutoMerge: false to force a create."
|
|
@@ -31861,6 +32032,7 @@ async function retainWithPersistence(content, ctx, options = {}) {
|
|
|
31861
32032
|
const resurrect = resurrectFields(existing);
|
|
31862
32033
|
const updated = await ctx.persistence.update(targetId, {
|
|
31863
32034
|
content: existing.content,
|
|
32035
|
+
freeFormOnly: true,
|
|
31864
32036
|
proofCountIncrement: 1,
|
|
31865
32037
|
observationSourceIds: options.sourceChunkIds,
|
|
31866
32038
|
sourceChunkIds: mergedSourceIds,
|
|
@@ -31989,6 +32161,17 @@ async function retainWithPersistence(content, ctx, options = {}) {
|
|
|
31989
32161
|
...consolidationDecidedCreate && { consolidation: "create" }
|
|
31990
32162
|
};
|
|
31991
32163
|
}
|
|
32164
|
+
function withoutKindedRows(prepared) {
|
|
32165
|
+
const kinded = new Set(
|
|
32166
|
+
prepared.memories.filter((m) => m.kind !== null && m.kind !== void 0).map((m) => m.uniqueId)
|
|
32167
|
+
);
|
|
32168
|
+
if (kinded.size === 0) return prepared;
|
|
32169
|
+
return {
|
|
32170
|
+
...prepared,
|
|
32171
|
+
memories: prepared.memories.filter((m) => !kinded.has(m.uniqueId)),
|
|
32172
|
+
embeddedItems: prepared.embeddedItems.filter((item) => !kinded.has(item.id))
|
|
32173
|
+
};
|
|
32174
|
+
}
|
|
31992
32175
|
function unionStrings(a, b) {
|
|
31993
32176
|
return [.../* @__PURE__ */ new Set([...a, ...b])];
|
|
31994
32177
|
}
|
|
@@ -32088,6 +32271,7 @@ async function tryConsolidate(trimmed, ctx, options, prepared) {
|
|
|
32088
32271
|
const resurrect = resurrectFields(existing);
|
|
32089
32272
|
const updated = await ctx.persistence.update(decision.targetId, {
|
|
32090
32273
|
content: existing.content,
|
|
32274
|
+
freeFormOnly: true,
|
|
32091
32275
|
proofCountIncrement: 1,
|
|
32092
32276
|
observationSourceIds: options.sourceChunkIds,
|
|
32093
32277
|
sourceChunkIds: mergedSourceIds,
|
|
@@ -32133,6 +32317,7 @@ async function tryConsolidate(trimmed, ctx, options, prepared) {
|
|
|
32133
32317
|
const resurrect = resurrectFields(existing);
|
|
32134
32318
|
const updated = await ctx.persistence.update(decision.targetId, {
|
|
32135
32319
|
content: decision.content,
|
|
32320
|
+
freeFormOnly: true,
|
|
32136
32321
|
proofCountIncrement: 1,
|
|
32137
32322
|
observationSourceIds: options.sourceChunkIds,
|
|
32138
32323
|
sourceChunkIds: mergedSourceIds,
|
|
@@ -32176,7 +32361,7 @@ async function tryConsolidate(trimmed, ctx, options, prepared) {
|
|
|
32176
32361
|
}
|
|
32177
32362
|
async function assertMergeTargetGoneOrThrow(ctx, targetId) {
|
|
32178
32363
|
const stillExists = await (ctx.persistence.getFresh ? ctx.persistence.getFresh(targetId) : ctx.persistence.get(targetId));
|
|
32179
|
-
if (stillExists) {
|
|
32364
|
+
if (stillExists && (stillExists.kind === null || stillExists.kind === void 0)) {
|
|
32180
32365
|
throw new Error(`retain: merge into memory ${targetId} failed to persist`);
|
|
32181
32366
|
}
|
|
32182
32367
|
}
|
|
@@ -38579,7 +38764,10 @@ function serverPlatformStorage() {
|
|
|
38579
38764
|
MAX_HOPS,
|
|
38580
38765
|
MAX_MESSAGES_PER_SUMMARIZATION,
|
|
38581
38766
|
MEDIUM_TTL_MS,
|
|
38767
|
+
MEMORY_KINDS,
|
|
38768
|
+
MEMORY_LEVELS,
|
|
38582
38769
|
Media,
|
|
38770
|
+
MemoryLevelError,
|
|
38583
38771
|
Message,
|
|
38584
38772
|
ModelPreference,
|
|
38585
38773
|
NEVER_TTL_MS,
|
package/dist/server/index.d.mts
CHANGED
|
@@ -4775,8 +4775,10 @@ declare function deleteConversationSummaryOp(ctx: SummaryOperationsContext, conv
|
|
|
4775
4775
|
* budget was in memory and reset on every turn, so one batch that could never
|
|
4776
4776
|
* extract blocked its conversation's extraction forever. Additive, both
|
|
4777
4777
|
* nullable, no backfill: NULL reads as "never failed"
|
|
4778
|
+
* - v48: Added kind, kind_value (encrypted) and level to memory_vault; level is
|
|
4779
|
+
* backfilled from scope where SQL steps run
|
|
4778
4780
|
*/
|
|
4779
|
-
declare const SDK_SCHEMA_VERSION =
|
|
4781
|
+
declare const SDK_SCHEMA_VERSION = 48;
|
|
4780
4782
|
/**
|
|
4781
4783
|
* Combined WatermelonDB schema for all SDK storage modules.
|
|
4782
4784
|
*
|
|
@@ -4865,6 +4867,7 @@ declare const sdkSchema: Readonly<{
|
|
|
4865
4867
|
* - v41 → v42: Added `topics` + `topics_updated_at` columns to memory_vault, making a memory's topics the durable synced record and `entity`/`memory_entity` a device-local index over it (null `topics` = pre-v42, backfilled from the row's current links by the sweep)
|
|
4866
4868
|
* - v42 → v43: Added a composite `(is_deleted, created_at)` index to conversations so the list reads stop temp-sorting (structural only, no data rewritten)
|
|
4867
4869
|
* - v43 → v44: Added `origin` column to history recording which producer synthesised a row, so the embedding sweep can skip never-rendered tool-result dumps (plaintext by design — the sweep has no wallet context; null = legacy, embedded as before)
|
|
4870
|
+
* - v47 → v48: Added `kind`, `kind_value`, `level` to memory_vault; `level` backfilled from `scope` (`shared`/`public` → matching, else private) where SQL steps run
|
|
4868
4871
|
*/
|
|
4869
4872
|
declare const sdkMigrations: Readonly<{
|
|
4870
4873
|
validated: true;
|
|
@@ -5382,6 +5385,12 @@ declare class VaultMemory extends Model {
|
|
|
5382
5385
|
static table: string;
|
|
5383
5386
|
content: string;
|
|
5384
5387
|
scope: string;
|
|
5388
|
+
/** Profile kind, or null for a free-form memory. */
|
|
5389
|
+
kind: string | null;
|
|
5390
|
+
/** Canonical JSON value of a kinded memory, encrypted at rest. */
|
|
5391
|
+
kindValue: string | null;
|
|
5392
|
+
/** private | matching | profile. */
|
|
5393
|
+
level: string | null;
|
|
5385
5394
|
folderId: string | null;
|
|
5386
5395
|
userId: string | null;
|
|
5387
5396
|
embedding: string | null;
|
|
@@ -7135,13 +7144,35 @@ declare function extractAndRetain(messages: AutoExtractMessage[], retainCtx: Ret
|
|
|
7135
7144
|
* the fail-safe direction: it un-publishes rather than exposes.
|
|
7136
7145
|
*/
|
|
7137
7146
|
type VaultMemoryVisibility = "private" | "public";
|
|
7147
|
+
/** Profile kinds a vault memory can carry. */
|
|
7148
|
+
declare const MEMORY_KINDS: readonly ["display_name", "birth_date", "bio", "occupation", "interest", "gender", "height_cm", "looking_for", "politics", "religion", "ethnicity", "smoking", "drinking", "exercise", "sexuality", "prompt"];
|
|
7149
|
+
/** One of {@link MEMORY_KINDS}. */
|
|
7150
|
+
type VaultMemoryKind = (typeof MEMORY_KINDS)[number];
|
|
7151
|
+
/** Who a memory reaches. */
|
|
7152
|
+
declare const MEMORY_LEVELS: readonly ["private", "matching", "profile"];
|
|
7153
|
+
/** One of {@link MEMORY_LEVELS}. */
|
|
7154
|
+
type MemoryLevel = (typeof MEMORY_LEVELS)[number];
|
|
7155
|
+
/**
|
|
7156
|
+
* Thrown by vault writes that would store an unknown kind or level, or a profile level without a kind.
|
|
7157
|
+
*
|
|
7158
|
+
* @public
|
|
7159
|
+
*/
|
|
7160
|
+
declare class MemoryLevelError extends Error {
|
|
7161
|
+
constructor(message: string);
|
|
7162
|
+
}
|
|
7138
7163
|
interface StoredVaultMemory {
|
|
7139
7164
|
/** WatermelonDB internal ID */
|
|
7140
7165
|
uniqueId: string;
|
|
7141
7166
|
/** Plain text memory content */
|
|
7142
7167
|
content: string;
|
|
7143
|
-
/** Scope for partitioning memories (e.g., "private", "shared") */
|
|
7168
|
+
/** Scope for partitioning memories (e.g., "private", "shared"). */
|
|
7144
7169
|
scope: string;
|
|
7170
|
+
/** Profile kind ({@link MEMORY_KINDS}) or null for a free-form memory. */
|
|
7171
|
+
kind?: string | null;
|
|
7172
|
+
/** Canonical value of a kinded memory, JSON-encoded (slug, slug[], int, date, text). */
|
|
7173
|
+
kindValue?: string | null;
|
|
7174
|
+
/** Who this memory reaches. */
|
|
7175
|
+
level?: MemoryLevel;
|
|
7145
7176
|
/** Folder ID for organization, null if unfiled */
|
|
7146
7177
|
folderId: string | null;
|
|
7147
7178
|
/** User ID for multi-user server-side scoping, null on client */
|
|
@@ -7245,8 +7276,14 @@ interface PhotoMediaRef {
|
|
|
7245
7276
|
declare function parseMedia(value: unknown): PhotoMediaRef[] | null;
|
|
7246
7277
|
interface CreateVaultMemoryOptions {
|
|
7247
7278
|
content: string;
|
|
7248
|
-
/** Scope for the memory.
|
|
7279
|
+
/** Scope for the memory. */
|
|
7249
7280
|
scope?: string;
|
|
7281
|
+
/** Profile kind, or omit/null for a free-form memory. */
|
|
7282
|
+
kind?: VaultMemoryKind | null;
|
|
7283
|
+
/** Canonical JSON value of a kinded memory. */
|
|
7284
|
+
kindValue?: string | null;
|
|
7285
|
+
/** Who this memory reaches. */
|
|
7286
|
+
level?: MemoryLevel;
|
|
7250
7287
|
/** Folder ID for organization, null or omitted if unfiled */
|
|
7251
7288
|
folderId?: string | null;
|
|
7252
7289
|
/** JSON-stringified embedding vector to persist */
|
|
@@ -7287,8 +7324,19 @@ interface CreateVaultMemoryOptions {
|
|
|
7287
7324
|
}
|
|
7288
7325
|
interface UpdateVaultMemoryOptions {
|
|
7289
7326
|
content: string;
|
|
7290
|
-
/**
|
|
7327
|
+
/** When true, the write is skipped (returns null) if the row carries a profile kind. */
|
|
7328
|
+
freeFormOnly?: boolean;
|
|
7329
|
+
/**
|
|
7330
|
+
* If provided, updates the memory's scope (and the level it implies; a `profile` row keeps
|
|
7331
|
+
* `profile` under `scope: "shared"`).
|
|
7332
|
+
*/
|
|
7291
7333
|
scope?: string;
|
|
7334
|
+
/** If provided, sets the profile kind (null makes the memory free-form). */
|
|
7335
|
+
kind?: VaultMemoryKind | null;
|
|
7336
|
+
/** If provided, sets the canonical JSON value (null clears it). */
|
|
7337
|
+
kindValue?: string | null;
|
|
7338
|
+
/** If provided, sets the level (and dual-writes `scope`). */
|
|
7339
|
+
level?: MemoryLevel;
|
|
7292
7340
|
/** If provided, moves the memory to this folder. */
|
|
7293
7341
|
folderId?: string | null;
|
|
7294
7342
|
/** JSON-stringified embedding vector to persist, or null to clear stale embedding */
|
|
@@ -7428,6 +7476,10 @@ declare function getAllVaultMemoriesOp(ctx: VaultMemoryOperationsContext, option
|
|
|
7428
7476
|
* published set to diff against the server index.
|
|
7429
7477
|
*/
|
|
7430
7478
|
visibility?: VaultMemoryVisibility[];
|
|
7479
|
+
/** Filter by level. */
|
|
7480
|
+
levels?: MemoryLevel[];
|
|
7481
|
+
/** Restrict to these profile kinds. */
|
|
7482
|
+
kinds?: string[];
|
|
7431
7483
|
}): Promise<StoredVaultMemory[]>;
|
|
7432
7484
|
declare function getAllVaultMemoryContentsOp(ctx: VaultMemoryOperationsContext, options?: {
|
|
7433
7485
|
since?: Date;
|
|
@@ -7667,7 +7719,8 @@ interface DecayCandidateRaw {
|
|
|
7667
7719
|
*
|
|
7668
7720
|
* Includes archived AND quarantined rows (so archived→delete transitions and
|
|
7669
7721
|
* aged quarantined rows are seen) but excludes hard-deleted rows — the
|
|
7670
|
-
* `baseVaultConditions` default keeps `is_deleted = false`.
|
|
7722
|
+
* `baseVaultConditions` default keeps `is_deleted = false`. Excludes kinded
|
|
7723
|
+
* (profile) memories, which never decay.
|
|
7671
7724
|
*
|
|
7672
7725
|
* Refuses to run on an unscoped multi-tenant context (see
|
|
7673
7726
|
* {@link assertVaultScopeForSweep}).
|
|
@@ -9660,8 +9713,8 @@ interface SynthesizeProfileOptions extends PortalLlmAuth {
|
|
|
9660
9713
|
* on memories the user approved for publication. Empty intersection → empty
|
|
9661
9714
|
* section (legitimate no-evidence), not a stale fallback.
|
|
9662
9715
|
*
|
|
9663
|
-
* Pass the user's published set (e.g. `getAllVaultMemoriesOp(ctx, {
|
|
9664
|
-
* ["
|
|
9716
|
+
* Pass the user's published set (e.g. `getAllVaultMemoriesOp(ctx, { levels:
|
|
9717
|
+
* ["matching", "profile"] })`) to keep a published profile derivable only from published
|
|
9665
9718
|
* memories — People Nearby's two-tier model treats `private` memories as never
|
|
9666
9719
|
* leaving the device, and a summary derived from them is a derivative that does.
|
|
9667
9720
|
*
|
|
@@ -10734,4 +10787,4 @@ declare class PostgreSQLAdapter implements DatabaseAdapter {
|
|
|
10734
10787
|
*/
|
|
10735
10788
|
declare function serverPlatformStorage(): PlatformStorage;
|
|
10736
10789
|
|
|
10737
|
-
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 ConsolidationAction, 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, type DurableAutoExtractorOptions, ENTITY_FANOUT, type EmbeddedWalletSignerFn, EncryptionKeyMissingError, ExcelProcessor, type ExtractFactsOptions, type ExtractOutcome, type ExtractedCandidate, type ExtractedEntity, type ExtractionCursorStore, type ExtractionFunnel, type ExtractionTimings, type FactType, type FileMetadata, type FileProcessingReason, type FileProcessingStatus, 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, type LocalMemoryStoreOptions, 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 MemoryContextItem, type MemoryContextLane, type MemoryContextOptions, type MemoryContextResult, type EmbeddingOptions as MemoryEngineEmbeddingOptions, type MemoryEngineResult, type MemoryEngineSearchOptions, type MemoryExtractedEvent, type MemoryKind, type MemoryListOptions, type MemoryMaintenance, type MemoryQuarantinedEvent, type MemoryRecallOptions, type MemoryRetainOptions, type MemoryStore, type MemorySubscribeOptions, type MemoryToVerify, type MemoryUpdate, type MemoryVaultSearchOptions, type MemoryVaultToolOptions, type MemoryVerification, Message, type MessageChunk, type MessageFeedback, type MessageOrigin, type ModelCallEndEvent, type ModelCallStartEvent, ModelPreference, NEVER_TTL_MS, NODE_BUDGET, type NeighborRefiner, type NowSource, type ObservationTrend, type ObservationTrendInput, type OperationExecutor, PAST_EVENT_GRACE_MS, PROFILE_DOC_VERSION, type ParsedServerToolsResponse, PdfProcessor, type PersonalitySettings, type PersonalitySliders, type PersonalityStyle, type PgClientLike, type PgPoolLike, type PhotoIngestResult, type PhotoMediaRef, type PlatformStorage, type PortalLlmAuth, type PortalLlmFailure, type PortalLlmFailureReason, PostgreSQLAdapter, type PostgreSQLAdapterOptions, type PreprocessingOptions, type PreprocessingResult, type ProcessedFileResult, ProcessorRegistry, type ProfileConfigFingerprint, type ProfileDoc, type ProfileFacet, type ProfileFacetKey, type ProfileSalienceInput, type ProfileSection, type ProfileUpdate, Project, type ProjectOperationsContext, type PromptContext, type PromptPreProcessor, type PromptPreProcessorContext, type PromptSection, type PromptTemplates, type PublishedPhotoMemory, type QuarantinedMemoryInfo, type QueueEncryptionContext, QueueManager, type QueueStatus, type QueuedOperation, type QueuedOperationType, RECALL_MAX_LIMIT, RECALL_TOOL_NAME, type RankedMemory, type RankedProfileCandidate, type RecallContext, type RecallDegradation, type RecallDiagnostics, type RecallEmptyReason, type RecallOptions, type RecallResult, type RecallToolCallbacks, type RecallToolOptions, type RecencyOptions, type ReflectOptions, type ReflectResult, type RequestEncryptionKeyOptions, RerankerUnavailableError, type ResumeStreamOptions, type ResumeStreamResult, type RetainAction, type RetainContext, type RetainOptions, type RetainResult, type RetainSource, type RunEndEvent, type RunErrorEvent, type RunHooks, type RunStartEvent, type RunTerminalState, type RunToolLoopOptions, type RunToolLoopResult, SDK_SCHEMA_VERSION, SERVER_TOOL_DEPENDENCY_SETS, SHORT_TTL_MS, SLIDER_CONFIG, STREAM_RESUMABLE_HEADER, type ScoreBreakdown, type ScoreProfileSalienceOptions, type ScreenResult, type ScreenedCandidate, type SearchSource, type SelectServerToolsForPromptOptions, type ServerTool, type ServerToolCallEvent, type ServerToolsFilterFunction, type ServerToolsOptions, type ServerToolsResponse, type SettingsStorageOperationsContext, type SignMessageFn, type StepFinishEvent, type StockPriceClassification, type StockPricePreProcessorOptions, type StorageOperationsContext, type StoredConversation, type StoredConversationSummary, type StoredFileWithContext, type StoredMedia, type StoredMessage, type StoredMessageWithSimilarity, type StoredModelPreference, type StoredProject, type StoredUserPreference, type StoredVaultMemory, StreamExpiredError, type StreamMetaEvent, type StreamResumeHandle, type StreamSmoothingConfig, type StreamingTransport, type StreamingTransportOptions, type StreamingTransportResult, type StyleAnalysisSchedule, type SynthesizeProfileOptions, TOOL_CATALOG, TOPICS_EXTRACTION_VERSION, TOPIC_EXTRACTION_BATCH_SIZE, TREND_RECENT_WINDOW_DAYS, TREND_STALE_WINDOW_DAYS, type TextChunk, TextProcessor, type ToolConfig, type ToolExecutor, type ToolMatchOptions, type ToolMatchResult, type ToolSet, type ToolUseEndEvent, type ToolUseStartEvent, type TopicExtractOptions, type TopicExtractionInput, type TopicExtractionRunResult, type TopicSkipReason, type TurnCompleteEvent, type TurnSkippedEvent, type UncheckedReason, type UnverifiableReason, type UpdateMediaOptions, type UpdateModelPreferenceOptions, type UpdateProjectOptions, type UpdateUserPreferenceOptions, type UpdateVaultMemoryOptions, UserPreference, type UserPreferencesStorageOperationsContext, VAULT_SIZE_HOP_CAP, type VaultEmbeddingCache, type VaultEmbeddingExpectation, 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, assembleMemoryContext, 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, createDurableAutoExtractor, createLlmDecayClassifier, createLlmNeighborRefiner, createLocalMemoryStore, 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, deleteMessageOp, deleteModelPreferenceOp, deleteProjectOp, deleteUserPreferenceOp, deleteVaultMemoryOp, deriveKeyFromSignatureBytes, eagerEmbedContent, embedAllMessages, embedMessage, encryptData, encryptDataBatch, encryptDataBytes, encryptDataWithKey, estimateMessagesTokens, estimateTokens, exportPublicKey, extractAndLinkEntitiesForMemoriesOp, extractAndRetain, extractEntitiesForMemories, extractFacts, findMatchingTools, formatFileProcessingNotes, generateConversationId, generateEmbedding, generateEmbeddings, generateMediaId, generateProjectId, getAIGeneratedMediaOp, getAllFilesOp, getAllVaultMemoriesOp, getAllVaultMemoryContentsOp, getAudioOp, getCachedServerTools, getConversationOp, getConversationSummaryOp, getConversationsByProjectLazyOp, getConversationsByProjectOp, getConversationsLazyOp, getConversationsOp, getConversationsPageOp, getDecayCandidatesRawOp, getDocumentsOp, getEncryptionKey, getImagesOp, getMediaByConversationOp, getMediaByIdOp, getMediaByIdsOp, getMediaByMessageOp, getMediaByModelOp, getMediaByRoleOp, getMediaBySourceUrlOp, getMediaByTypeOp, getMediaCountOp, getMediaCountsByTypeOp, getMediaOp, getMediaTypeFromMime, getMemoriesNeedingTopicExtractionOp, getMessageOp, getMessagesOp, getModelPreferenceOp, getProjectConversationCountOp, getProjectConversationsOp, getProjectOp, getProjectsOp, getRecentMediaOp, getServerTools, getSupportedFileTypes, getToolsChecksum, getUnfiledVaultMemoriesOp, getUserPreferenceOp, getUserUploadedMediaOp, getVaultMemoryOp, getVideosOp, hardDeleteDecayedOp, hardDeleteMediaOp, hasEncryptionKey, hasKeyPair, ingestPublishedPhotoMemoriesOp, injectionSignatureCatalog, isDegradedTopicSkip, isRerankerAvailable, isSupportedFile, isSupportedMediaType, makeSyntheticStoredConversation, makeSyntheticStoredMessage, maybeSummarizeHistory, mediaToStored, migrateFromModelPreferencesOp, onKeyAvailable, parseMedia, preEmbedVaultMemories, preprocessFiles, progressiveSummarize, projectToStored, queueManager, rankProfileCandidates, recall, reflect, refreshEncryptionKeyIfMatches, relinkMemoryTopicsOp, relinkMisclassifiedVideosOp, renderTemplate, requestEncryptionKey, requestKeyPair, restoreVaultMemoryOp, resumeStream, retain, runToolLoop, sanitizeQuotes, schemaToCreateSQL, scoreProfileSalience, screenCandidatesForInjection, sdkMigrations, sdkModelClasses, sdkSchema, searchChunksOp, searchMediaOp, searchMessagesOp, searchVaultMemories, seedEncryptionKeys, selectServerToolsForPrompt, serverPlatformStorage, setMemoryVisibilityOp, setModelPreferenceOp, setUserPreferenceOp, shouldAnalyzeStyle, shouldChunkMessage, shouldRecallMemory, shouldRefreshTools, splitMessagesAtThreshold, stampTopicsExtractedAtOp, streamCancelPath, streamReplayPath, stripLegacyChunkTextOp, 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 };
|
|
10790
|
+
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 ConsolidationAction, 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, type DurableAutoExtractorOptions, ENTITY_FANOUT, type EmbeddedWalletSignerFn, EncryptionKeyMissingError, ExcelProcessor, type ExtractFactsOptions, type ExtractOutcome, type ExtractedCandidate, type ExtractedEntity, type ExtractionCursorStore, type ExtractionFunnel, type ExtractionTimings, type FactType, type FileMetadata, type FileProcessingReason, type FileProcessingStatus, 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, type LocalMemoryStoreOptions, MAX_HOPS, MAX_MESSAGES_PER_SUMMARIZATION, MEDIUM_TTL_MS, MEMORY_KINDS, MEMORY_LEVELS, Media, type MediaDimensions, type MediaFilterOptions, type MediaMetadata, type MediaOperationsContext, type MediaRole, type MediaType, type MemoriesNeedingTopicExtraction, type MemoryContextItem, type MemoryContextLane, type MemoryContextOptions, type MemoryContextResult, type EmbeddingOptions as MemoryEngineEmbeddingOptions, type MemoryEngineResult, type MemoryEngineSearchOptions, type MemoryExtractedEvent, type MemoryKind, type MemoryLevel, MemoryLevelError, type MemoryListOptions, type MemoryMaintenance, type MemoryQuarantinedEvent, type MemoryRecallOptions, type MemoryRetainOptions, type MemoryStore, type MemorySubscribeOptions, type MemoryToVerify, type MemoryUpdate, type MemoryVaultSearchOptions, type MemoryVaultToolOptions, type MemoryVerification, Message, type MessageChunk, type MessageFeedback, type MessageOrigin, type ModelCallEndEvent, type ModelCallStartEvent, ModelPreference, NEVER_TTL_MS, NODE_BUDGET, type NeighborRefiner, type NowSource, type ObservationTrend, type ObservationTrendInput, type OperationExecutor, PAST_EVENT_GRACE_MS, PROFILE_DOC_VERSION, type ParsedServerToolsResponse, PdfProcessor, type PersonalitySettings, type PersonalitySliders, type PersonalityStyle, type PgClientLike, type PgPoolLike, type PhotoIngestResult, type PhotoMediaRef, type PlatformStorage, type PortalLlmAuth, type PortalLlmFailure, type PortalLlmFailureReason, PostgreSQLAdapter, type PostgreSQLAdapterOptions, type PreprocessingOptions, type PreprocessingResult, type ProcessedFileResult, ProcessorRegistry, type ProfileConfigFingerprint, type ProfileDoc, type ProfileFacet, type ProfileFacetKey, type ProfileSalienceInput, type ProfileSection, type ProfileUpdate, Project, type ProjectOperationsContext, type PromptContext, type PromptPreProcessor, type PromptPreProcessorContext, type PromptSection, type PromptTemplates, type PublishedPhotoMemory, type QuarantinedMemoryInfo, type QueueEncryptionContext, QueueManager, type QueueStatus, type QueuedOperation, type QueuedOperationType, RECALL_MAX_LIMIT, RECALL_TOOL_NAME, type RankedMemory, type RankedProfileCandidate, type RecallContext, type RecallDegradation, type RecallDiagnostics, type RecallEmptyReason, type RecallOptions, type RecallResult, type RecallToolCallbacks, type RecallToolOptions, type RecencyOptions, type ReflectOptions, type ReflectResult, type RequestEncryptionKeyOptions, RerankerUnavailableError, type ResumeStreamOptions, type ResumeStreamResult, type RetainAction, type RetainContext, type RetainOptions, type RetainResult, type RetainSource, type RunEndEvent, type RunErrorEvent, type RunHooks, type RunStartEvent, type RunTerminalState, type RunToolLoopOptions, type RunToolLoopResult, SDK_SCHEMA_VERSION, SERVER_TOOL_DEPENDENCY_SETS, SHORT_TTL_MS, SLIDER_CONFIG, STREAM_RESUMABLE_HEADER, type ScoreBreakdown, type ScoreProfileSalienceOptions, type ScreenResult, type ScreenedCandidate, type SearchSource, type SelectServerToolsForPromptOptions, type ServerTool, type ServerToolCallEvent, type ServerToolsFilterFunction, type ServerToolsOptions, type ServerToolsResponse, type SettingsStorageOperationsContext, type SignMessageFn, type StepFinishEvent, type StockPriceClassification, type StockPricePreProcessorOptions, type StorageOperationsContext, type StoredConversation, type StoredConversationSummary, type StoredFileWithContext, type StoredMedia, type StoredMessage, type StoredMessageWithSimilarity, type StoredModelPreference, type StoredProject, type StoredUserPreference, type StoredVaultMemory, StreamExpiredError, type StreamMetaEvent, type StreamResumeHandle, type StreamSmoothingConfig, type StreamingTransport, type StreamingTransportOptions, type StreamingTransportResult, type StyleAnalysisSchedule, type SynthesizeProfileOptions, TOOL_CATALOG, TOPICS_EXTRACTION_VERSION, TOPIC_EXTRACTION_BATCH_SIZE, TREND_RECENT_WINDOW_DAYS, TREND_STALE_WINDOW_DAYS, type TextChunk, TextProcessor, type ToolConfig, type ToolExecutor, type ToolMatchOptions, type ToolMatchResult, type ToolSet, type ToolUseEndEvent, type ToolUseStartEvent, type TopicExtractOptions, type TopicExtractionInput, type TopicExtractionRunResult, type TopicSkipReason, type TurnCompleteEvent, type TurnSkippedEvent, type UncheckedReason, type UnverifiableReason, type UpdateMediaOptions, type UpdateModelPreferenceOptions, type UpdateProjectOptions, type UpdateUserPreferenceOptions, type UpdateVaultMemoryOptions, UserPreference, type UserPreferencesStorageOperationsContext, VAULT_SIZE_HOP_CAP, type VaultEmbeddingCache, type VaultEmbeddingExpectation, VaultMemory, type VaultMemoryKind, 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, assembleMemoryContext, 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, createDurableAutoExtractor, createLlmDecayClassifier, createLlmNeighborRefiner, createLocalMemoryStore, 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, deleteMessageOp, deleteModelPreferenceOp, deleteProjectOp, deleteUserPreferenceOp, deleteVaultMemoryOp, deriveKeyFromSignatureBytes, eagerEmbedContent, embedAllMessages, embedMessage, encryptData, encryptDataBatch, encryptDataBytes, encryptDataWithKey, estimateMessagesTokens, estimateTokens, exportPublicKey, extractAndLinkEntitiesForMemoriesOp, extractAndRetain, extractEntitiesForMemories, extractFacts, findMatchingTools, formatFileProcessingNotes, generateConversationId, generateEmbedding, generateEmbeddings, generateMediaId, generateProjectId, getAIGeneratedMediaOp, getAllFilesOp, getAllVaultMemoriesOp, getAllVaultMemoryContentsOp, getAudioOp, getCachedServerTools, getConversationOp, getConversationSummaryOp, getConversationsByProjectLazyOp, getConversationsByProjectOp, getConversationsLazyOp, getConversationsOp, getConversationsPageOp, getDecayCandidatesRawOp, getDocumentsOp, getEncryptionKey, getImagesOp, getMediaByConversationOp, getMediaByIdOp, getMediaByIdsOp, getMediaByMessageOp, getMediaByModelOp, getMediaByRoleOp, getMediaBySourceUrlOp, getMediaByTypeOp, getMediaCountOp, getMediaCountsByTypeOp, getMediaOp, getMediaTypeFromMime, getMemoriesNeedingTopicExtractionOp, getMessageOp, getMessagesOp, getModelPreferenceOp, getProjectConversationCountOp, getProjectConversationsOp, getProjectOp, getProjectsOp, getRecentMediaOp, getServerTools, getSupportedFileTypes, getToolsChecksum, getUnfiledVaultMemoriesOp, getUserPreferenceOp, getUserUploadedMediaOp, getVaultMemoryOp, getVideosOp, hardDeleteDecayedOp, hardDeleteMediaOp, hasEncryptionKey, hasKeyPair, ingestPublishedPhotoMemoriesOp, injectionSignatureCatalog, isDegradedTopicSkip, isRerankerAvailable, isSupportedFile, isSupportedMediaType, makeSyntheticStoredConversation, makeSyntheticStoredMessage, maybeSummarizeHistory, mediaToStored, migrateFromModelPreferencesOp, onKeyAvailable, parseMedia, preEmbedVaultMemories, preprocessFiles, progressiveSummarize, projectToStored, queueManager, rankProfileCandidates, recall, reflect, refreshEncryptionKeyIfMatches, relinkMemoryTopicsOp, relinkMisclassifiedVideosOp, renderTemplate, requestEncryptionKey, requestKeyPair, restoreVaultMemoryOp, resumeStream, retain, runToolLoop, sanitizeQuotes, schemaToCreateSQL, scoreProfileSalience, screenCandidatesForInjection, sdkMigrations, sdkModelClasses, sdkSchema, searchChunksOp, searchMediaOp, searchMessagesOp, searchVaultMemories, seedEncryptionKeys, selectServerToolsForPrompt, serverPlatformStorage, setMemoryVisibilityOp, setModelPreferenceOp, setUserPreferenceOp, shouldAnalyzeStyle, shouldChunkMessage, shouldRecallMemory, shouldRefreshTools, splitMessagesAtThreshold, stampTopicsExtractedAtOp, streamCancelPath, streamReplayPath, stripLegacyChunkTextOp, 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 };
|