@anuma/sdk 2.4.1 → 2.5.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.
@@ -4125,6 +4125,7 @@ function isOwnedByCtxUser(ctx, record) {
4125
4125
  function baseVaultConditions(ctx, options) {
4126
4126
  return [
4127
4127
  ...options?.includeDeleted ? [] : [import_watermelondb9.Q.where("is_deleted", false)],
4128
+ ...options?.includeSuperseded ? [] : [import_watermelondb9.Q.where("superseded_by", null)],
4128
4129
  ...ctx.userId !== void 0 ? [import_watermelondb9.Q.where("user_id", ctx.userId)] : [],
4129
4130
  ...options?.since ? [import_watermelondb9.Q.where("updated_at", import_watermelondb9.Q.gt(options.since.getTime()))] : []
4130
4131
  ];
@@ -4165,6 +4166,8 @@ function vaultMemoryToStoredRaw(memory) {
4165
4166
  eventTimeKind: memory.eventTimeKind ?? null,
4166
4167
  topicsUserManaged: memory.topicsUserManaged ?? false,
4167
4168
  topicsExtractedAt: memory.topicsExtractedAt ?? null,
4169
+ supersededBy: memory.supersededBy ?? null,
4170
+ supersededAt: memory.supersededAt ?? null,
4168
4171
  createdAt: memory.createdAt,
4169
4172
  updatedAt: memory.updatedAt,
4170
4173
  isDeleted: memory.isDeleted
@@ -4210,6 +4213,59 @@ async function createVaultMemoryOp(ctx, opts) {
4210
4213
  });
4211
4214
  return vaultMemoryToStored(created, ctx.walletAddress, ctx.signMessage, ctx.embeddedWalletSigner);
4212
4215
  }
4216
+ async function createSupersedingMemoryOp(ctx, opts, targetId) {
4217
+ if (!targetId) return { created: null, retired: false };
4218
+ const scope = opts.scope ?? "private";
4219
+ const encryptedContent = ctx.walletAddress && ctx.signMessage ? await encryptVaultMemoryContent(
4220
+ opts.content,
4221
+ ctx.walletAddress,
4222
+ ctx.signMessage,
4223
+ ctx.embeddedWalletSigner
4224
+ ) : opts.content;
4225
+ let createdRecord = null;
4226
+ await ctx.database.write(async () => {
4227
+ let target;
4228
+ try {
4229
+ target = await ctx.vaultMemoryCollection.find(targetId);
4230
+ } catch {
4231
+ return;
4232
+ }
4233
+ if (target.isDeleted || target.supersededBy || !isOwnedByCtxUser(ctx, target)) return;
4234
+ createdRecord = await ctx.vaultMemoryCollection.create((record) => {
4235
+ record._setRaw("content", encryptedContent);
4236
+ record._setRaw("scope", scope);
4237
+ record._setRaw("folder_id", opts.folderId ?? null);
4238
+ record._setRaw("user_id", ctx.userId ?? null);
4239
+ record._setRaw("is_deleted", false);
4240
+ if (opts.embedding !== void 0) {
4241
+ record._setRaw("embedding", opts.embedding);
4242
+ record._setRaw("embedding_model", opts.embeddingModel ?? null);
4243
+ }
4244
+ if (opts.sourceChunkIds !== void 0) {
4245
+ record._setRaw("source_chunk_ids", JSON.stringify(opts.sourceChunkIds));
4246
+ }
4247
+ record._setRaw("proof_count", opts.proofCount ?? 1);
4248
+ record._setRaw("source", opts.source ?? "manual");
4249
+ if (opts.eventTime) {
4250
+ record._setRaw("event_time_start", opts.eventTime.start ?? null);
4251
+ record._setRaw("event_time_end", opts.eventTime.end ?? null);
4252
+ record._setRaw("event_time_kind", opts.eventTime.kind ?? null);
4253
+ }
4254
+ });
4255
+ await target.update((r) => {
4256
+ r._setRaw("superseded_by", createdRecord.id);
4257
+ r._setRaw("superseded_at", Date.now());
4258
+ });
4259
+ });
4260
+ if (!createdRecord) return { created: null, retired: false };
4261
+ const created = await vaultMemoryToStored(
4262
+ createdRecord,
4263
+ ctx.walletAddress,
4264
+ ctx.signMessage,
4265
+ ctx.embeddedWalletSigner
4266
+ );
4267
+ return { created, retired: true };
4268
+ }
4213
4269
  async function getMemoriesByEventTimeOp(ctx, windowStart, windowEnd) {
4214
4270
  const records = await ctx.vaultMemoryCollection.query(
4215
4271
  ...baseVaultConditions(ctx),
@@ -4349,6 +4405,8 @@ function vaultMemoryRawToStoredRaw(raw) {
4349
4405
  // SQLite stores booleans as 0/1, LokiJS as true/false — coerce both.
4350
4406
  topicsUserManaged: raw.topics_user_managed === true || raw.topics_user_managed === 1,
4351
4407
  topicsExtractedAt: raw.topics_extracted_at ?? null,
4408
+ supersededBy: raw.superseded_by ?? null,
4409
+ supersededAt: raw.superseded_at ?? null,
4352
4410
  createdAt: new Date(raw.created_at),
4353
4411
  updatedAt: new Date(raw.updated_at),
4354
4412
  isDeleted: raw.is_deleted === true || raw.is_deleted === 1
@@ -4390,7 +4448,7 @@ async function getAllVaultMemoryContentsOp(ctx, options) {
4390
4448
  async function updateVaultMemoryOp(ctx, id, opts) {
4391
4449
  try {
4392
4450
  const probe = await ctx.vaultMemoryCollection.find(id);
4393
- if (probe.isDeleted || !isOwnedByCtxUser(ctx, probe)) return null;
4451
+ if (probe.isDeleted || probe.supersededBy || !isOwnedByCtxUser(ctx, probe)) return null;
4394
4452
  const encryptedContent = ctx.walletAddress && ctx.signMessage ? await encryptVaultMemoryContent(
4395
4453
  opts.content,
4396
4454
  ctx.walletAddress,
@@ -4401,7 +4459,7 @@ async function updateVaultMemoryOp(ctx, id, opts) {
4401
4459
  const record = probe;
4402
4460
  const originalUpdatedAt = record.updatedAt.getTime();
4403
4461
  await ctx.database.write(async () => {
4404
- if (record.isDeleted || !isOwnedByCtxUser(ctx, record)) {
4462
+ if (record.isDeleted || record.supersededBy || !isOwnedByCtxUser(ctx, record)) {
4405
4463
  stale = true;
4406
4464
  return;
4407
4465
  }
@@ -4479,6 +4537,40 @@ async function deleteVaultMemoryOp(ctx, id) {
4479
4537
  return false;
4480
4538
  }
4481
4539
  }
4540
+ async function supersedeVaultMemoryOp(ctx, id, supersededById) {
4541
+ if (id === supersededById) return false;
4542
+ try {
4543
+ const record = await ctx.vaultMemoryCollection.find(id);
4544
+ if (record.isDeleted || record.supersededBy || !isOwnedByCtxUser(ctx, record)) return false;
4545
+ let successor;
4546
+ try {
4547
+ successor = await ctx.vaultMemoryCollection.find(supersededById);
4548
+ } catch {
4549
+ return false;
4550
+ }
4551
+ if (successor.isDeleted || successor.supersededBy || !isOwnedByCtxUser(ctx, successor)) {
4552
+ return false;
4553
+ }
4554
+ let stale = false;
4555
+ await ctx.database.write(async () => {
4556
+ if (record.isDeleted || record.supersededBy || !isOwnedByCtxUser(ctx, record)) {
4557
+ stale = true;
4558
+ return;
4559
+ }
4560
+ if (successor.isDeleted || successor.supersededBy || !isOwnedByCtxUser(ctx, successor)) {
4561
+ stale = true;
4562
+ return;
4563
+ }
4564
+ await record.update((r) => {
4565
+ r._setRaw("superseded_by", supersededById);
4566
+ r._setRaw("superseded_at", Date.now());
4567
+ });
4568
+ });
4569
+ return !stale;
4570
+ } catch {
4571
+ return false;
4572
+ }
4573
+ }
4482
4574
  async function getUnfiledVaultMemoriesOp(ctx) {
4483
4575
  const conditions = [
4484
4576
  import_watermelondb9.Q.where("folder_id", null),
@@ -6896,7 +6988,9 @@ function validate2(parsed, newContent, validIds) {
6896
6988
  if (typeof parsed !== "object" || parsed === null) return null;
6897
6989
  const obj = parsed;
6898
6990
  const action = obj.action;
6899
- if (action !== "create" && action !== "update" && action !== "noop") return null;
6991
+ if (action !== "create" && action !== "update" && action !== "noop" && action !== "supersede") {
6992
+ return null;
6993
+ }
6900
6994
  if (action === "create") {
6901
6995
  const c2 = typeof obj.content === "string" ? obj.content.trim() : "";
6902
6996
  return { action: "create", content: c2.length > 0 ? c2 : newContent };
@@ -6908,7 +7002,7 @@ function validate2(parsed, newContent, validIds) {
6908
7002
  }
6909
7003
  const c = typeof obj.content === "string" ? obj.content.trim() : "";
6910
7004
  if (c.length === 0) return null;
6911
- return { action: "update", targetId, content: c };
7005
+ return { action, targetId, content: c };
6912
7006
  }
6913
7007
  var DEFAULT_MODEL2, DEFAULT_CONSOLIDATE_ATTEMPTS, DEFAULT_CONSOLIDATE_TOTAL_TIMEOUT_MS, SYSTEM_PROMPT2;
6914
7008
  var init_consolidate = __esm({
@@ -6924,10 +7018,11 @@ var init_consolidate = __esm({
6924
7018
 
6925
7019
  A "memory" is a self-contained natural-language fact about the user. Multiple memories about the same EXACT FACET (the same dimension of the same subject) should never coexist \u2014 they should be merged into one. Different facets on the same subject (e.g. user's dog's name vs user's dog's age) are SEPARATE memories.
6926
7020
 
6927
- Decide one of three actions:
7021
+ Decide one of four actions:
6928
7022
 
6929
7023
  - "create": the new memory describes a distinct fact not covered by any existing memory. Write it as new.
6930
- - "update": the new memory describes the SAME FACET as exactly one existing memory. Either it adds detail, corrects a value, or rephrases the same fact. Return targetId of that existing memory + the consolidated content (richest version of the two).
7024
+ - "update": the new memory describes the SAME FACET as exactly one existing memory and is COMPATIBLE with it \u2014 it adds detail, fixes an incomplete value, or rephrases the same still-true fact. Return targetId of that existing memory + the consolidated content (richest version of the two).
7025
+ - "supersede": the new memory REPLACES a standing fact whose value has CHANGED and is now INCOMPATIBLE with an existing memory \u2014 the old fact was true before but is false now (a state change). Return targetId of the STALE existing memory to retire + content = the NEW fact. The old memory is kept as history, not overwritten or deleted; do not re-state it.
6931
7026
  - "noop": the new memory is already fully captured by an existing memory \u2014 same facet, no new information. Skip the write.
6932
7027
 
6933
7028
  RULES (carry these strictly):
@@ -6935,18 +7030,21 @@ RULES (carry these strictly):
6935
7030
  1. ONE OBSERVATION PER DISTINCT FACET. If the new memory is about "user's aunt's twins" and an existing memory is also about "user's aunt's twins", they are the same facet \u2192 update, never create.
6936
7031
  2. MATCH BY FACET, NOT TOPIC. Two memories both mentioning "Zara" is not enough to merge \u2014 only merge if they describe the same property (e.g. both about "user's pending Zara boot exchange"). Two memories about Zara on different topics (e.g. "user shops at Zara" + "user returned a sweater to Zara last week") are separate facets.
6937
7032
  3. NO COMPUTATION. Do not sum counts, decrement quantities, or derive new facts from existing ones. If the new memory says "user spent $200 today" and an existing memory says "user spent $150 yesterday", these are TWO SEPARATE EVENTS \u2014 create.
6938
- 4. Events with different occurredAt dates are different memories even if the same activity ("user went to gym Monday" vs "user went to gym Friday" \u2014 separate events).
6939
- 5. When in doubt between create and update, choose create. Over-merging loses information; under-merging is recoverable.
7033
+ 4. EVENTS vs STANDING STATE.
7034
+ - Distinct EVENTS (episodic \u2014 something that happened on a date) are separate memories, even if the same activity: "user went to gym Monday" vs "user went to gym Friday" \u2192 create; keep both.
7035
+ - A STANDING ATTRIBUTE (an ongoing state: where the user lives/works, relationship status, current role) has ONE current value. When the new memory changes that value ("Lives in Portland" \u2192 "Lives in San Francisco"; "Works at Google" \u2192 "Works at Riverbend"; "Engaged" \u2192 "Broke up"), the old value is no longer true \u2192 supersede (retire the old, record the new). Do NOT create (that leaves a stale contradiction) and do NOT update (that erases the history that the old value was once true).
7036
+ 5. When in doubt between create and update, choose create \u2014 EXCEPT when the new memory directly contradicts the current value of a standing attribute in an existing memory; then choose supersede. Over-merging loses information; a live contradiction is worse than either.
6940
7037
 
6941
7038
  OUTPUT \u2014 strict JSON, no prose:
6942
7039
  {
6943
- "action": "create" | "update" | "noop",
6944
- "targetId": "<existing memory id, required for update/noop, omit for create>",
6945
- "content": "<consolidated content, required for create/update, omit for noop>"
7040
+ "action": "create" | "update" | "supersede" | "noop",
7041
+ "targetId": "<existing memory id \u2014 required for update/supersede/noop, omit for create>",
7042
+ "content": "<content \u2014 required for create/update/supersede, omit for noop>"
6946
7043
  }
6947
7044
 
6948
7045
  For "create": content is the new memory verbatim (or a slight refinement).
6949
7046
  For "update": content is the merged richest-version, \u226480 words.
7047
+ For "supersede": content is the NEW fact only (\u226480 words); targetId is the stale memory being retired.
6950
7048
  For "noop": no content (existing memory is already correct).`;
6951
7049
  }
6952
7050
  });
@@ -7079,6 +7177,7 @@ __export(index_exports, {
7079
7177
  stampTopicsExtractedAtOp: () => stampTopicsExtractedAtOp,
7080
7178
  streamCancelPath: () => streamCancelPath,
7081
7179
  streamReplayPath: () => streamReplayPath,
7180
+ supersedeVaultMemoryOp: () => supersedeVaultMemoryOp,
7082
7181
  updateVaultFolderContextOp: () => updateVaultFolderContextOp,
7083
7182
  updateVaultFolderOp: () => updateVaultFolderOp,
7084
7183
  updateVaultMemoryEmbeddingOp: () => updateVaultMemoryEmbeddingOp,
@@ -12543,6 +12642,12 @@ __decorateClass([
12543
12642
  __decorateClass([
12544
12643
  (0, import_decorators3.field)("topics_extracted_at")
12545
12644
  ], VaultMemory.prototype, "topicsExtractedAt", 2);
12645
+ __decorateClass([
12646
+ (0, import_decorators3.field)("superseded_by")
12647
+ ], VaultMemory.prototype, "supersededBy", 2);
12648
+ __decorateClass([
12649
+ (0, import_decorators3.field)("superseded_at")
12650
+ ], VaultMemory.prototype, "supersededAt", 2);
12546
12651
  __decorateClass([
12547
12652
  import_decorators3.readonly,
12548
12653
  (0, import_decorators3.date)("created_at")
@@ -12926,53 +13031,62 @@ async function retain(content, ctx, options = {}) {
12926
13031
  const enableAutoMerge = options.enableAutoMerge ?? true;
12927
13032
  const threshold = options.autoMergeThreshold ?? DEFAULT_AUTO_MERGE_THRESHOLD;
12928
13033
  const resolvedScope = options.scope ?? DEFAULT_SCOPE;
13034
+ let supersedeTargetId;
13035
+ let supersedeContent;
12929
13036
  if (enableAutoMerge) {
12930
13037
  if (options.consolidateOptions) {
12931
- const consolidationResult = await tryConsolidate(trimmed, ctx, options);
12932
- if (consolidationResult) return consolidationResult;
12933
- }
12934
- const matches = await searchVaultMemories(
12935
- trimmed,
12936
- ctx.vaultCtx,
12937
- ctx.embeddingOptions,
12938
- ctx.vaultCache,
12939
- {
12940
- limit: 1,
12941
- minSimilarity: threshold,
12942
- useFusion: false,
12943
- scopes: [resolvedScope],
12944
- ...options.folderId !== void 0 && { folderId: options.folderId }
12945
- }
12946
- );
12947
- if (matches.length > 0) {
12948
- const targetId = matches[0].uniqueId;
12949
- const existing = await getVaultMemoryOp(ctx.vaultCtx, targetId);
12950
- if (existing) {
12951
- const mergedSourceIds = unionStrings(
12952
- existing.sourceChunkIds ?? [],
12953
- options.sourceChunkIds ?? []
12954
- );
12955
- const eventTimeUpdate = pickEventTimeUpdate(existing, options.eventTime);
12956
- const updated = await updateVaultMemoryOp(ctx.vaultCtx, targetId, {
12957
- content: existing.content,
12958
- proofCountIncrement: 1,
12959
- sourceChunkIds: mergedSourceIds,
12960
- preserveUpdatedAt: true,
12961
- ...eventTimeUpdate && { eventTime: eventTimeUpdate }
12962
- });
12963
- if (updated) {
12964
- return {
12965
- action: "merge",
12966
- memoryId: targetId,
12967
- targetId,
12968
- proofCount: updated.proofCount ?? (existing.proofCount ?? 1) + 1
12969
- };
13038
+ const outcome = await tryConsolidate(trimmed, ctx, options);
13039
+ if (outcome) {
13040
+ if ("done" in outcome) return outcome.done;
13041
+ supersedeTargetId = outcome.supersede;
13042
+ supersedeContent = outcome.content;
13043
+ }
13044
+ }
13045
+ if (!supersedeTargetId) {
13046
+ const matches = await searchVaultMemories(
13047
+ trimmed,
13048
+ ctx.vaultCtx,
13049
+ ctx.embeddingOptions,
13050
+ ctx.vaultCache,
13051
+ {
13052
+ limit: 1,
13053
+ minSimilarity: threshold,
13054
+ useFusion: false,
13055
+ scopes: [resolvedScope],
13056
+ ...options.folderId !== void 0 && { folderId: options.folderId }
13057
+ }
13058
+ );
13059
+ if (matches.length > 0) {
13060
+ const targetId = matches[0].uniqueId;
13061
+ const existing = await getVaultMemoryOp(ctx.vaultCtx, targetId);
13062
+ if (existing && !existing.supersededBy) {
13063
+ const mergedSourceIds = unionStrings(
13064
+ existing.sourceChunkIds ?? [],
13065
+ options.sourceChunkIds ?? []
13066
+ );
13067
+ const eventTimeUpdate = pickEventTimeUpdate(existing, options.eventTime);
13068
+ const updated = await updateVaultMemoryOp(ctx.vaultCtx, targetId, {
13069
+ content: existing.content,
13070
+ proofCountIncrement: 1,
13071
+ sourceChunkIds: mergedSourceIds,
13072
+ preserveUpdatedAt: true,
13073
+ ...eventTimeUpdate && { eventTime: eventTimeUpdate }
13074
+ });
13075
+ if (updated) {
13076
+ return {
13077
+ action: "merge",
13078
+ memoryId: targetId,
13079
+ targetId,
13080
+ proofCount: updated.proofCount ?? (existing.proofCount ?? 1) + 1
13081
+ };
13082
+ }
13083
+ await assertMergeTargetGoneOrThrow(ctx, targetId);
12970
13084
  }
12971
- await assertMergeTargetGoneOrThrow(ctx, targetId);
12972
13085
  }
12973
13086
  }
12974
13087
  }
12975
- const embedding = await generateEmbedding(trimmed, ctx.embeddingOptions);
13088
+ const contentToWrite = supersedeContent ?? trimmed;
13089
+ const embedding = await generateEmbedding(contentToWrite, ctx.embeddingOptions);
12976
13090
  const embeddingModel = ctx.embeddingOptions.model ?? DEFAULT_API_EMBEDDING_MODEL;
12977
13091
  if (options.respectTombstones) {
12978
13092
  const tombstoneId = await findTombstoneMatch(embedding, embeddingModel, resolvedScope, ctx, {
@@ -12983,8 +13097,8 @@ async function retain(content, ctx, options = {}) {
12983
13097
  return { action: "suppressed", memoryId: tombstoneId, tombstoneId, proofCount: 0 };
12984
13098
  }
12985
13099
  }
12986
- const created = await createVaultMemoryOp(ctx.vaultCtx, {
12987
- content: trimmed,
13100
+ const createOpts = {
13101
+ content: contentToWrite,
12988
13102
  scope: resolvedScope,
12989
13103
  ...options.folderId !== void 0 && { folderId: options.folderId },
12990
13104
  embedding: JSON.stringify(embedding),
@@ -13001,7 +13115,24 @@ async function retain(content, ctx, options = {}) {
13001
13115
  kind: options.eventTime.kind
13002
13116
  }
13003
13117
  }
13004
- });
13118
+ };
13119
+ if (supersedeTargetId) {
13120
+ const { created: created2, retired } = await createSupersedingMemoryOp(
13121
+ ctx.vaultCtx,
13122
+ createOpts,
13123
+ supersedeTargetId
13124
+ );
13125
+ if (created2 && retired) {
13126
+ ctx.vaultCache.set(created2.uniqueId, Float32Array.from(embedding));
13127
+ return {
13128
+ action: "supersede",
13129
+ memoryId: created2.uniqueId,
13130
+ targetId: supersedeTargetId,
13131
+ proofCount: 1
13132
+ };
13133
+ }
13134
+ }
13135
+ const created = await createVaultMemoryOp(ctx.vaultCtx, createOpts);
13005
13136
  ctx.vaultCache.set(created.uniqueId, Float32Array.from(embedding));
13006
13137
  return {
13007
13138
  action: "create",
@@ -13071,9 +13202,14 @@ async function tryConsolidate(trimmed, ctx, options) {
13071
13202
  const { consolidateMemory: doConsolidate } = await Promise.resolve().then(() => (init_consolidate(), consolidate_exports));
13072
13203
  const decision = await doConsolidate(trimmed, candidates, consolidateOptions);
13073
13204
  if (decision.action === "create") return null;
13205
+ if (decision.action === "supersede" && decision.targetId && decision.content) {
13206
+ const existing = await getVaultMemoryOp(ctx.vaultCtx, decision.targetId);
13207
+ if (!existing || existing.supersededBy) return null;
13208
+ return { supersede: decision.targetId, content: decision.content };
13209
+ }
13074
13210
  if (decision.action === "noop" && decision.targetId) {
13075
13211
  const existing = await getVaultMemoryOp(ctx.vaultCtx, decision.targetId);
13076
- if (!existing) return null;
13212
+ if (!existing || existing.supersededBy) return null;
13077
13213
  const mergedSourceIds = unionStrings(
13078
13214
  existing.sourceChunkIds ?? [],
13079
13215
  options.sourceChunkIds ?? []
@@ -13091,15 +13227,17 @@ async function tryConsolidate(trimmed, ctx, options) {
13091
13227
  return null;
13092
13228
  }
13093
13229
  return {
13094
- action: "merge",
13095
- memoryId: decision.targetId,
13096
- targetId: decision.targetId,
13097
- proofCount: updated.proofCount ?? (existing.proofCount ?? 1) + 1
13230
+ done: {
13231
+ action: "merge",
13232
+ memoryId: decision.targetId,
13233
+ targetId: decision.targetId,
13234
+ proofCount: updated.proofCount ?? (existing.proofCount ?? 1) + 1
13235
+ }
13098
13236
  };
13099
13237
  }
13100
13238
  if (decision.action === "update" && decision.targetId && decision.content) {
13101
13239
  const existing = await getVaultMemoryOp(ctx.vaultCtx, decision.targetId);
13102
- if (!existing) return null;
13240
+ if (!existing || existing.supersededBy) return null;
13103
13241
  const mergedSourceIds = unionStrings(
13104
13242
  existing.sourceChunkIds ?? [],
13105
13243
  options.sourceChunkIds ?? []
@@ -13126,10 +13264,12 @@ async function tryConsolidate(trimmed, ctx, options) {
13126
13264
  }
13127
13265
  ctx.vaultCache.set(decision.targetId, Float32Array.from(newEmbedding));
13128
13266
  return {
13129
- action: "update",
13130
- memoryId: decision.targetId,
13131
- targetId: decision.targetId,
13132
- proofCount: updated.proofCount ?? (existing.proofCount ?? 1) + 1
13267
+ done: {
13268
+ action: "update",
13269
+ memoryId: decision.targetId,
13270
+ targetId: decision.targetId,
13271
+ proofCount: updated.proofCount ?? (existing.proofCount ?? 1) + 1
13272
+ }
13133
13273
  };
13134
13274
  }
13135
13275
  return null;
@@ -16624,7 +16764,7 @@ __decorateClass([
16624
16764
  ], VaultFolder.prototype, "context", 2);
16625
16765
 
16626
16766
  // src/lib/db/schema.ts
16627
- var SDK_SCHEMA_VERSION = 36;
16767
+ var SDK_SCHEMA_VERSION = 37;
16628
16768
  var sdkSchema = (0, import_watermelondb19.appSchema)({
16629
16769
  version: SDK_SCHEMA_VERSION,
16630
16770
  tables: [
@@ -16749,7 +16889,16 @@ var sdkSchema = (0, import_watermelondb19.appSchema)({
16749
16889
  // Unix ms of the last LLM topic-extraction pass over this memory's
16750
16890
  // content. Null = never extracted standalone (legacy rows with entity
16751
16891
  // links are grandfathered — see getMemoriesNeedingTopicExtractionOp).
16752
- { name: "topics_extracted_at", type: "number", isOptional: true }
16892
+ { name: "topics_extracted_at", type: "number", isOptional: true },
16893
+ // Write-time supersession (A2). When set, this fact was replaced by a
16894
+ // newer, incompatible-value fact (e.g. "Lives in Portland" superseded by
16895
+ // "Lives in SF"); `superseded_by` points at the newer memory's id and
16896
+ // `superseded_at` is the Unix ms it happened. Superseded rows stay in
16897
+ // the table (history / read-time fallback) but are excluded from recall
16898
+ // and dedup by default. Null = live (not superseded). Indexed so the
16899
+ // recall filter stays cheap.
16900
+ { name: "superseded_by", type: "string", isOptional: true, isIndexed: true },
16901
+ { name: "superseded_at", type: "number", isOptional: true }
16753
16902
  ]
16754
16903
  }),
16755
16904
  // Entity table — canonical names extracted from auto-extraction (W5).
@@ -17360,6 +17509,21 @@ var sdkMigrations = (0, import_migrations2.schemaMigrations)({
17360
17509
  columns: [{ name: "topics_extracted_at", type: "number", isOptional: true }]
17361
17510
  })
17362
17511
  ]
17512
+ },
17513
+ // v36 -> v37: write-time supersession columns on memory_vault. Existing rows
17514
+ // keep both NULL (= live / not superseded), so no backfill — legacy
17515
+ // contradictory rows are handled by the read-time supersession fallback.
17516
+ {
17517
+ toVersion: 37,
17518
+ steps: [
17519
+ (0, import_migrations2.addColumns)({
17520
+ table: "memory_vault",
17521
+ columns: [
17522
+ { name: "superseded_by", type: "string", isOptional: true, isIndexed: true },
17523
+ { name: "superseded_at", type: "number", isOptional: true }
17524
+ ]
17525
+ })
17526
+ ]
17363
17527
  }
17364
17528
  ]
17365
17529
  });
@@ -18825,6 +18989,7 @@ function createNotionTools(getAccessToken, requestNotionAccess) {
18825
18989
  stampTopicsExtractedAtOp,
18826
18990
  streamCancelPath,
18827
18991
  streamReplayPath,
18992
+ supersedeVaultMemoryOp,
18828
18993
  updateVaultFolderContextOp,
18829
18994
  updateVaultFolderOp,
18830
18995
  updateVaultMemoryEmbeddingOp,
@@ -4316,6 +4316,9 @@ declare class VaultMemory extends Model {
4316
4316
  /** Unix ms of the last LLM topic-extraction pass. Null = never extracted
4317
4317
  * standalone (linked legacy rows are grandfathered as extracted). */
4318
4318
  topicsExtractedAt: number | null;
4319
+ /** A2 supersession: newer memory id that replaced this one, or null if live. */
4320
+ supersededBy: string | null;
4321
+ supersededAt: number | null;
4319
4322
  createdAt: Date;
4320
4323
  updatedAt: Date;
4321
4324
  isDeleted: boolean;
@@ -4423,6 +4426,13 @@ interface StoredVaultMemory {
4423
4426
  * Null = never extracted standalone; rows that already carry entity links
4424
4427
  * are grandfathered as extracted (see getMemoriesNeedingTopicExtractionOp). */
4425
4428
  topicsExtractedAt: number | null;
4429
+ /** Write-time supersession (A2): id of the newer memory that replaced this
4430
+ * one (incompatible-value update, e.g. "Lives in Portland" → "Lives in SF").
4431
+ * Null = live. Superseded rows are excluded from recall/dedup by default but
4432
+ * kept for history + the read-time fallback. */
4433
+ supersededBy: string | null;
4434
+ /** Unix ms when this memory was superseded. Null when live. */
4435
+ supersededAt: number | null;
4426
4436
  createdAt: Date;
4427
4437
  updatedAt: Date;
4428
4438
  isDeleted: boolean;
@@ -4531,12 +4541,30 @@ declare function getAllVaultMemoriesOp(ctx: VaultMemoryOperationsContext, option
4531
4541
  * render "forgotten" nodes; ordinary consumers should leave this off.
4532
4542
  */
4533
4543
  includeDeleted?: boolean;
4544
+ /**
4545
+ * Include A2-superseded memories (each carries `supersededBy`). Default
4546
+ * `false` — superseded rows are excluded, as they are from recall/dedup.
4547
+ * Used by a "memory history" view to render retired facts.
4548
+ */
4549
+ includeSuperseded?: boolean;
4534
4550
  }): Promise<StoredVaultMemory[]>;
4535
4551
  declare function getAllVaultMemoryContentsOp(ctx: VaultMemoryOperationsContext, options?: {
4536
4552
  since?: Date;
4537
4553
  }): Promise<string[]>;
4538
4554
  declare function updateVaultMemoryOp(ctx: VaultMemoryOperationsContext, id: string, opts: UpdateVaultMemoryOptions): Promise<StoredVaultMemory | null>;
4539
4555
  declare function deleteVaultMemoryOp(ctx: VaultMemoryOperationsContext, id: string): Promise<boolean>;
4556
+ /**
4557
+ * Mark a memory as superseded by a newer one (A2 write-time supersession).
4558
+ * The row stays in the table (history + read-time fallback) but is excluded
4559
+ * from recall/dedup by default via `superseded_by`. Idempotent-ish: no-op if
4560
+ * the row is missing, not owned, deleted, or already superseded. Does NOT
4561
+ * preserve `updated_at` — superseded rows are hidden from recall, so their
4562
+ * recency is irrelevant.
4563
+ *
4564
+ * @param id - the memory being retired (e.g. "Lives in Portland")
4565
+ * @param supersededById - the newer memory that replaced it (e.g. "Lives in SF")
4566
+ */
4567
+ declare function supersedeVaultMemoryOp(ctx: VaultMemoryOperationsContext, id: string, supersededById: string): Promise<boolean>;
4540
4568
  /**
4541
4569
  * Get all non-deleted, unfiled vault memories (folder_id is null).
4542
4570
  */
@@ -5183,7 +5211,7 @@ interface RecallDiagnostics {
5183
5211
  /** Soft-degradation signals that fired this call (empty when clean). */
5184
5212
  degraded: RecallDegradation[];
5185
5213
  }
5186
- type RetainAction = "create" | "merge" | "update" | "skip" | "suppressed";
5214
+ type RetainAction = "create" | "merge" | "update" | "skip" | "suppressed" | "supersede";
5187
5215
  type RetainSource = "manual" | "auto-extracted" | "capsule";
5188
5216
  /** Why the consolidator fell back to "create" instead of a real decision. */
5189
5217
  type ConsolidationFallbackReason = "llm_error" | "invalid_response";
@@ -5249,7 +5277,8 @@ interface RetainOptions {
5249
5277
  interface RetainResult {
5250
5278
  action: RetainAction;
5251
5279
  memoryId: string;
5252
- /** When action is 'merge' or 'update', the prior memory's id. */
5280
+ /** When action is 'merge' or 'update', the prior memory's id. When action is
5281
+ * 'supersede', the stale memory that was retired (`memoryId` is the new one). */
5253
5282
  targetId?: string;
5254
5283
  /**
5255
5284
  * When action is 'suppressed', the id of the soft-deleted memory that blocked
@@ -5471,9 +5500,12 @@ declare function extractFacts(messages: AutoExtractMessage[], options: ExtractFa
5471
5500
  type ExtractOutcome = "extracted" | "no-facts" | "empty-after-retry" | "dropped-after-redaction";
5472
5501
  /**
5473
5502
  * Stage 2 — for each extracted candidate, call retain() with auto-merge
5474
- * enabled. The resolver path (decide create/merge/update via a second LLM
5475
- * call against the existing vault) is deferred — the auto-merge inside
5476
- * retain() handles dedup at the cosine-similarity level for hackathon.
5503
+ * enabled. When `consolidateOptions` are wired, retain()'s consolidation pass
5504
+ * is the "resolver": a second LLM call against the top-K existing vault
5505
+ * memories that decides create/update/noop/supersede — including retiring a
5506
+ * stale value on a state change (the supersession the extraction prompt above
5507
+ * promises). Without consolidation, retain() still dedups at the cosine-merge
5508
+ * level, and the read-time supersession heuristic remains the fallback.
5477
5509
  *
5478
5510
  * Returns the candidates that survived validation along with the retain
5479
5511
  * result for each (which captures whether the fact was created, merged,
@@ -6733,8 +6765,12 @@ declare function useChatStorage(options: UseChatStorageOptions): UseChatStorageR
6733
6765
  * LLM topic-extraction pass, so the background topic worker re-extracts only
6734
6766
  * memories edited since (updated_at > topics_extracted_at) instead of
6735
6767
  * re-running the whole vault
6768
+ * - v37: Added superseded_by + superseded_at columns to memory_vault for
6769
+ * write-time supersession — a changed fact retires the stale one (points at
6770
+ * the newer memory) instead of both surviving; superseded rows are excluded
6771
+ * from recall/dedup by default
6736
6772
  */
6737
- declare const SDK_SCHEMA_VERSION = 36;
6773
+ declare const SDK_SCHEMA_VERSION = 37;
6738
6774
  /**
6739
6775
  * Combined WatermelonDB schema for all SDK storage modules.
6740
6776
  *
@@ -6814,6 +6850,7 @@ declare const sdkSchema: Readonly<{
6814
6850
  * - v32 → v33: Added `embedding_model` column to memory_vault (null grandfathered as current-model-compatible)
6815
6851
  * - v34 → v35: Added `conversation_memory` table (conversation ↔ recalled memory ids)
6816
6852
  * - v35 → v36: Added `topics_extracted_at` column to memory_vault (watermark for the background topic-extraction worker; null + existing links grandfathered as extracted)
6853
+ * - v36 → v37: Added `superseded_by` + `superseded_at` columns to memory_vault (write-time supersession; null = live, excluded from recall/dedup when set)
6817
6854
  */
6818
6855
  declare const sdkMigrations: Readonly<{
6819
6856
  validated: true;
@@ -7335,4 +7372,4 @@ declare function refreshNotionAccessToken(params: NotionRefreshTokenParams): Pro
7335
7372
  */
7336
7373
  declare function createNotionTools(getAccessToken: () => string | null, requestNotionAccess: () => Promise<string>): ToolConfig[];
7337
7374
 
7338
- 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 CreateMessageOptions, type CreateVaultFolderOptions, type CreateVaultMemoryOptions, type CryptoPriceClassification, type CryptoPricePreProcessorOptions, DEFAULT_CACHE_EXPIRATION_MS, DEFAULT_CHUNK_CACHE_SIZE, DEFAULT_CHUNK_OVERLAP, DEFAULT_CHUNK_SIZE, DEFAULT_MIN_CHUNK_SIZE, DEFAULT_VAULT_CACHE_SIZE, DatabaseManager, type DatabaseManagerLogger, type DatabaseManagerOptions, type EmbeddedWalletSignerFn, type ExtractFactsOptions, type ExtractOutcome, type ExtractedCandidate, type ExtractedEntity, type ExtractionCursorStore, type FactType, type FileMetadata, type FlushResult, type GetMessagesPageOptions, INFERENCE_ID_HEADER, type LazyStoredConversation, type Logger, LoggerProvider, type LoggerProviderProps, type MemoriesNeedingTopicExtraction, type EmbeddingOptions as MemoryEngineEmbeddingOptions, type MemoryEngineResult, type MemoryEngineSearchOptions, type MemoryExtractedEvent, type MemoryKind, type MemoryVaultSearchOptions, type MemoryVaultToolOptions, type MessageRedactionResult, type MessageSkeleton, NOTION_OAUTH_CONFIG, type NotionAuthUrlParams, type NotionClientRegistration, type NotionExchangeCodeParams, type NotionOAuthEndpoints, type NotionPKCEChallenge, type NotionRefreshTokenParams, type NotionTokenResponse, PII_PATTERNS, type PiiCategory, type PiiMatch, type PiiPattern, PiiRedactor, type PiiRedactorOptions, type PlatformStorage, type PortalLlmAuth, type PromptPreProcessor, type PromptPreProcessorContext, type QuantizedEmbedding, QueueManager, type QueueStatus, RECALL_MAX_LIMIT, RECALL_TOOL_NAME, type RankedMemory, type RecallContext, type RecallDegradation, type RecallDiagnostics, type RecallOptions, type RecallResult, type RecallToolCallbacks, type RecallToolOptions, type RecencyOptions, type RedactionResult, type ReflectOptions, type ReflectResult, RerankerUnavailableError, type ResumeStreamOptions, type ResumeStreamResult, type ResumeStreamWithStorageResult, type RetainAction, type RetainContext, type RetainOptions, type RetainResult, type RetainSource, SDK_SCHEMA_VERSION, STREAM_RESUMABLE_HEADER, type ScoreBreakdown, 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, TOPIC_EXTRACTION_BATCH_SIZE, type TextChunk, type TopicExtractOptions, type TopicExtractionInput, type TopicExtractionRunResult, type TurnCompleteEvent, type TurnSkippedEvent, type UpdateVaultFolderOptions, type UpdateVaultMemoryOptions, type UseChatStorageOptions, type UseChatStorageResult, type UseCreditsOptions, type UseCreditsResult, type UseModelsOptions, type UseModelsResult, type VaultEmbeddingCache, type VaultFolderOperationsContext, type VaultMemoryOperationsContext, type VaultSaveOperation, type VaultSearchResult, WalletPoller, type WeatherClassification, type WeatherPreProcessorOptions, type WebSearchClassification, type WebSearchPreProcessorOptions, addConversationMemoriesOp, buildNotionAuthUrl, chatStorageMigrations, chatStorageSchema, chunkAndEmbedAllMessages, chunkAndEmbedMessage, chunkText, classifyCryptoPrice, classifyCryptoPriceBatch, classifyStockPrice, classifyStockPriceBatch, classifyWeather, classifyWeatherBatch, classifyWebSearch, classifyWebSearchBatch, clearAllEncryptionKeys, clearAllEncryptionState, clearConversationMemoriesOp, clearEncryptionKey, clearLazyTitleCache, clearServerToolsCache, consoleLogger, conversationMemoryToStored, cosineInt8, createAutoExtractor, createChunkVectorCache, createCryptoPricePreProcessor, createMemoryEngineTool, createMemoryVaultSearchTool, createMemoryVaultTool, 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, getLogger, getMemoriesNeedingTopicExtractionOp, getServerTools, getUnfiledVaultMemoriesOp, getVaultFolderMemoryCountOp, getVaultMemoryOp, hasEncryptionKey, isPiiRedactor, isRerankerAvailable, moveMemoriesToFolderOp, noopLogger, onKeyAvailable, preEmbedVaultMemories, quantizeEmbedding, queueManager, recall, reflect, refreshNotionAccessToken, registerNotionClient, requestEncryptionKey, resolvePiiRedactor, resumeStream, retain, sdkMigrations, sdkModelClasses, sdkSchema, searchVaultMemories, setLogger, shouldChunkMessage, stampTopicsExtractedAtOp, streamCancelPath, streamReplayPath, updateVaultFolderContextOp, updateVaultFolderOp, updateVaultMemoryEmbeddingOp, updateVaultMemoryOp, upsertMessageOp, useChat, useChatStorage, useCredits, useEncryption, useModels, xhrTransport };
7375
+ 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 CreateMessageOptions, type CreateVaultFolderOptions, type CreateVaultMemoryOptions, type CryptoPriceClassification, type CryptoPricePreProcessorOptions, DEFAULT_CACHE_EXPIRATION_MS, DEFAULT_CHUNK_CACHE_SIZE, DEFAULT_CHUNK_OVERLAP, DEFAULT_CHUNK_SIZE, DEFAULT_MIN_CHUNK_SIZE, DEFAULT_VAULT_CACHE_SIZE, DatabaseManager, type DatabaseManagerLogger, type DatabaseManagerOptions, type EmbeddedWalletSignerFn, type ExtractFactsOptions, type ExtractOutcome, type ExtractedCandidate, type ExtractedEntity, type ExtractionCursorStore, type FactType, type FileMetadata, type FlushResult, type GetMessagesPageOptions, INFERENCE_ID_HEADER, type LazyStoredConversation, type Logger, LoggerProvider, type LoggerProviderProps, type MemoriesNeedingTopicExtraction, type EmbeddingOptions as MemoryEngineEmbeddingOptions, type MemoryEngineResult, type MemoryEngineSearchOptions, type MemoryExtractedEvent, type MemoryKind, type MemoryVaultSearchOptions, type MemoryVaultToolOptions, type MessageRedactionResult, type MessageSkeleton, NOTION_OAUTH_CONFIG, type NotionAuthUrlParams, type NotionClientRegistration, type NotionExchangeCodeParams, type NotionOAuthEndpoints, type NotionPKCEChallenge, type NotionRefreshTokenParams, type NotionTokenResponse, PII_PATTERNS, type PiiCategory, type PiiMatch, type PiiPattern, PiiRedactor, type PiiRedactorOptions, type PlatformStorage, type PortalLlmAuth, type PromptPreProcessor, type PromptPreProcessorContext, type QuantizedEmbedding, QueueManager, type QueueStatus, RECALL_MAX_LIMIT, RECALL_TOOL_NAME, type RankedMemory, type RecallContext, type RecallDegradation, type RecallDiagnostics, type RecallOptions, type RecallResult, type RecallToolCallbacks, type RecallToolOptions, type RecencyOptions, type RedactionResult, type ReflectOptions, type ReflectResult, RerankerUnavailableError, type ResumeStreamOptions, type ResumeStreamResult, type ResumeStreamWithStorageResult, type RetainAction, type RetainContext, type RetainOptions, type RetainResult, type RetainSource, SDK_SCHEMA_VERSION, STREAM_RESUMABLE_HEADER, type ScoreBreakdown, 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, TOPIC_EXTRACTION_BATCH_SIZE, type TextChunk, type TopicExtractOptions, type TopicExtractionInput, type TopicExtractionRunResult, type TurnCompleteEvent, type TurnSkippedEvent, type UpdateVaultFolderOptions, type UpdateVaultMemoryOptions, type UseChatStorageOptions, type UseChatStorageResult, type UseCreditsOptions, type UseCreditsResult, type UseModelsOptions, type UseModelsResult, type VaultEmbeddingCache, type VaultFolderOperationsContext, type VaultMemoryOperationsContext, type VaultSaveOperation, type VaultSearchResult, WalletPoller, type WeatherClassification, type WeatherPreProcessorOptions, type WebSearchClassification, type WebSearchPreProcessorOptions, addConversationMemoriesOp, buildNotionAuthUrl, chatStorageMigrations, chatStorageSchema, chunkAndEmbedAllMessages, chunkAndEmbedMessage, chunkText, classifyCryptoPrice, classifyCryptoPriceBatch, classifyStockPrice, classifyStockPriceBatch, classifyWeather, classifyWeatherBatch, classifyWebSearch, classifyWebSearchBatch, clearAllEncryptionKeys, clearAllEncryptionState, clearConversationMemoriesOp, clearEncryptionKey, clearLazyTitleCache, clearServerToolsCache, consoleLogger, conversationMemoryToStored, cosineInt8, createAutoExtractor, createChunkVectorCache, createCryptoPricePreProcessor, createMemoryEngineTool, createMemoryVaultSearchTool, createMemoryVaultTool, 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, getLogger, getMemoriesNeedingTopicExtractionOp, getServerTools, getUnfiledVaultMemoriesOp, getVaultFolderMemoryCountOp, getVaultMemoryOp, hasEncryptionKey, isPiiRedactor, isRerankerAvailable, moveMemoriesToFolderOp, noopLogger, onKeyAvailable, preEmbedVaultMemories, quantizeEmbedding, queueManager, recall, reflect, refreshNotionAccessToken, registerNotionClient, requestEncryptionKey, resolvePiiRedactor, resumeStream, retain, sdkMigrations, sdkModelClasses, sdkSchema, searchVaultMemories, setLogger, shouldChunkMessage, stampTopicsExtractedAtOp, streamCancelPath, streamReplayPath, supersedeVaultMemoryOp, updateVaultFolderContextOp, updateVaultFolderOp, updateVaultMemoryEmbeddingOp, updateVaultMemoryOp, upsertMessageOp, useChat, useChatStorage, useCredits, useEncryption, useModels, xhrTransport };