@anuma/sdk 6.34.0 → 6.35.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.
@@ -1389,6 +1389,9 @@ __export(index_exports, {
1389
1389
  LoggerProvider: () => LoggerProvider,
1390
1390
  MAX_HOPS: () => MAX_HOPS,
1391
1391
  MEDIUM_TTL_MS: () => MEDIUM_TTL_MS,
1392
+ MEMORY_KINDS: () => MEMORY_KINDS,
1393
+ MEMORY_LEVELS: () => MEMORY_LEVELS,
1394
+ MemoryLevelError: () => MemoryLevelError,
1392
1395
  NEVER_TTL_MS: () => NEVER_TTL_MS,
1393
1396
  NODE_BUDGET: () => NODE_BUDGET,
1394
1397
  NOTION_OAUTH_CONFIG: () => NOTION_OAUTH_CONFIG,
@@ -10818,6 +10821,15 @@ __decorateClass([
10818
10821
  __decorateClass([
10819
10822
  (0, import_decorators6.text)("scope")
10820
10823
  ], VaultMemory.prototype, "scope", 2);
10824
+ __decorateClass([
10825
+ (0, import_decorators6.field)("kind")
10826
+ ], VaultMemory.prototype, "kind", 2);
10827
+ __decorateClass([
10828
+ (0, import_decorators6.field)("kind_value")
10829
+ ], VaultMemory.prototype, "kindValue", 2);
10830
+ __decorateClass([
10831
+ (0, import_decorators6.field)("level")
10832
+ ], VaultMemory.prototype, "level", 2);
10821
10833
  __decorateClass([
10822
10834
  (0, import_decorators6.field)("folder_id")
10823
10835
  ], VaultMemory.prototype, "folderId", 2);
@@ -11043,7 +11055,7 @@ __decorateClass([
11043
11055
  ], VaultFolder.prototype, "context", 2);
11044
11056
 
11045
11057
  // src/lib/db/schema.ts
11046
- var SDK_SCHEMA_VERSION = 47;
11058
+ var SDK_SCHEMA_VERSION = 48;
11047
11059
  var sdkSchema = (0, import_watermelondb17.appSchema)({
11048
11060
  version: SDK_SCHEMA_VERSION,
11049
11061
  tables: [
@@ -11138,6 +11150,9 @@ var sdkSchema = (0, import_watermelondb17.appSchema)({
11138
11150
  columns: [
11139
11151
  { name: "content", type: "string" },
11140
11152
  { name: "scope", type: "string", isIndexed: true },
11153
+ { name: "kind", type: "string", isOptional: true, isIndexed: true },
11154
+ { name: "kind_value", type: "string", isOptional: true },
11155
+ { name: "level", type: "string", isOptional: true, isIndexed: true },
11141
11156
  { name: "folder_id", type: "string", isOptional: true, isIndexed: true },
11142
11157
  { name: "created_at", type: "number", isIndexed: true },
11143
11158
  { name: "updated_at", type: "number", isIndexed: true },
@@ -11814,6 +11829,22 @@ var sdkMigrations = (0, import_migrations2.schemaMigrations)({
11814
11829
  ]
11815
11830
  })
11816
11831
  ]
11832
+ },
11833
+ {
11834
+ toVersion: 48,
11835
+ steps: [
11836
+ (0, import_migrations2.addColumns)({
11837
+ table: "memory_vault",
11838
+ columns: [
11839
+ { name: "kind", type: "string", isOptional: true, isIndexed: true },
11840
+ { name: "kind_value", type: "string", isOptional: true },
11841
+ { name: "level", type: "string", isOptional: true, isIndexed: true }
11842
+ ]
11843
+ }),
11844
+ (0, import_migrations2.unsafeExecuteSql)(
11845
+ "UPDATE memory_vault SET level = CASE WHEN scope IN ('shared', 'public') THEN 'matching' ELSE 'private' END WHERE level IS NULL;"
11846
+ )
11847
+ ]
11817
11848
  }
11818
11849
  ]
11819
11850
  });
@@ -12381,13 +12412,54 @@ async function decryptVaultMemoryFields(memory, address, signMessage, embeddedWa
12381
12412
  }
12382
12413
  }
12383
12414
  const decryptedContent = await decryptField(memory.content, address);
12415
+ const decryptedKindValue = typeof memory.kindValue === "string" ? await decryptField(memory.kindValue, address) : memory.kindValue;
12384
12416
  return {
12385
12417
  ...memory,
12386
- content: decryptedContent
12418
+ content: decryptedContent,
12419
+ ...decryptedKindValue !== void 0 && { kindValue: decryptedKindValue }
12387
12420
  };
12388
12421
  }
12389
12422
 
12390
12423
  // src/lib/db/memoryVault/types.ts
12424
+ var MEMORY_KINDS = [
12425
+ "display_name",
12426
+ "birth_date",
12427
+ "bio",
12428
+ "occupation",
12429
+ "interest",
12430
+ "gender",
12431
+ "height_cm",
12432
+ "looking_for",
12433
+ "politics",
12434
+ "religion",
12435
+ "ethnicity",
12436
+ "smoking",
12437
+ "drinking",
12438
+ "exercise",
12439
+ "sexuality",
12440
+ "prompt"
12441
+ ];
12442
+ var MEMORY_LEVELS = ["private", "matching", "profile"];
12443
+ var MemoryLevelError = class extends Error {
12444
+ constructor(message) {
12445
+ super(message);
12446
+ this.name = "MemoryLevelError";
12447
+ }
12448
+ };
12449
+ var PUBLISHED_SCOPES = /* @__PURE__ */ new Set(["shared", "public"]);
12450
+ function levelFromScope(scope) {
12451
+ return typeof scope === "string" && PUBLISHED_SCOPES.has(scope) ? "matching" : "private";
12452
+ }
12453
+ function scopeForLevel(level) {
12454
+ return level === "private" ? "private" : "shared";
12455
+ }
12456
+ function resolveMemoryLevel(level, scope) {
12457
+ return typeof level === "string" && MEMORY_LEVELS.includes(level) ? level : levelFromScope(scope);
12458
+ }
12459
+ function levelForScopeChange(current, nextScope) {
12460
+ const implied = levelFromScope(nextScope);
12461
+ return implied === "matching" && resolveMemoryLevel(current.level, current.scope) === "profile" ? "profile" : implied;
12462
+ }
12391
12463
  function parseMedia(value) {
12392
12464
  if (typeof value !== "string" || value === "") return null;
12393
12465
  try {
@@ -12417,6 +12489,56 @@ function visibilityConditions(requested) {
12417
12489
  if (excluded.length === 0) return [];
12418
12490
  return [import_watermelondb20.Q.or(import_watermelondb20.Q.where("visibility", null), import_watermelondb20.Q.where("visibility", import_watermelondb20.Q.notIn(excluded)))];
12419
12491
  }
12492
+ function isKinded(record2) {
12493
+ return record2.kind !== null && record2.kind !== void 0;
12494
+ }
12495
+ function assertValidKindLevel(kind, level) {
12496
+ const hasKind = kind !== null && kind !== void 0;
12497
+ if (hasKind && !MEMORY_KINDS.includes(kind)) {
12498
+ throw new MemoryLevelError(`Unknown memory kind: ${kind}`);
12499
+ }
12500
+ if (level !== void 0 && !MEMORY_LEVELS.includes(level)) {
12501
+ throw new MemoryLevelError(`Unknown memory level: ${level}`);
12502
+ }
12503
+ if (level === "profile" && !hasKind) {
12504
+ throw new MemoryLevelError("Only a memory with a kind can be at level 'profile'");
12505
+ }
12506
+ }
12507
+ function resolveCreateLevel(opts) {
12508
+ if (opts.level !== void 0) return { level: opts.level, scope: scopeForLevel(opts.level) };
12509
+ if (opts.scope !== void 0) return { level: levelFromScope(opts.scope), scope: opts.scope };
12510
+ return { level: "private", scope: "private" };
12511
+ }
12512
+ async function encryptKindValue(ctx, value) {
12513
+ if (typeof value !== "string" || !ctx.walletAddress || !ctx.signMessage) return value;
12514
+ return encryptVaultMemoryContent(
12515
+ value,
12516
+ ctx.walletAddress,
12517
+ ctx.signMessage,
12518
+ ctx.embeddedWalletSigner
12519
+ );
12520
+ }
12521
+ function levelConditions(requested) {
12522
+ if (!requested?.length) return [];
12523
+ const published = ["shared", "public"];
12524
+ const wantsMatching = requested.includes("matching");
12525
+ const wantsPrivate = requested.includes("private");
12526
+ const unresolved = import_watermelondb20.Q.or(import_watermelondb20.Q.where("level", null), import_watermelondb20.Q.where("level", import_watermelondb20.Q.notIn([...MEMORY_LEVELS])));
12527
+ const byLevel = import_watermelondb20.Q.where("level", import_watermelondb20.Q.oneOf([...requested]));
12528
+ if (wantsMatching && wantsPrivate) return [import_watermelondb20.Q.or(byLevel, unresolved)];
12529
+ if (wantsMatching) {
12530
+ return [import_watermelondb20.Q.or(byLevel, import_watermelondb20.Q.and(unresolved, import_watermelondb20.Q.where("scope", import_watermelondb20.Q.oneOf(published))))];
12531
+ }
12532
+ if (wantsPrivate) {
12533
+ return [
12534
+ import_watermelondb20.Q.or(
12535
+ byLevel,
12536
+ import_watermelondb20.Q.and(unresolved, import_watermelondb20.Q.or(import_watermelondb20.Q.where("scope", null), import_watermelondb20.Q.where("scope", import_watermelondb20.Q.notIn(published))))
12537
+ )
12538
+ ];
12539
+ }
12540
+ return [byLevel];
12541
+ }
12420
12542
  function isOwnedByCtxUser(ctx, record2) {
12421
12543
  return ctx.userId === void 0 || record2.userId === ctx.userId;
12422
12544
  }
@@ -12460,6 +12582,9 @@ function vaultMemoryToStoredRaw(memory) {
12460
12582
  uniqueId: memory.id,
12461
12583
  content: memory.content,
12462
12584
  scope: memory.scope,
12585
+ kind: memory.kind ?? null,
12586
+ kindValue: memory.kindValue ?? null,
12587
+ level: resolveMemoryLevel(memory.level, memory.scope),
12463
12588
  folderId: memory.folderId ?? null,
12464
12589
  userId: memory.userId ?? null,
12465
12590
  embedding: memory.embedding ?? null,
@@ -12498,9 +12623,13 @@ async function vaultMemoryToStored(memory, walletAddress, signMessage, embeddedW
12498
12623
  }
12499
12624
  return raw;
12500
12625
  }
12501
- function populateNewVaultMemory(record2, ctx, opts, encryptedContent) {
12626
+ function populateNewVaultMemory(record2, ctx, opts, encryptedContent, encryptedKindValue) {
12627
+ const { level, scope } = resolveCreateLevel(opts);
12502
12628
  record2._setRaw("content", encryptedContent);
12503
- record2._setRaw("scope", opts.scope ?? "private");
12629
+ record2._setRaw("scope", scope);
12630
+ record2._setRaw("level", level);
12631
+ record2._setRaw("kind", opts.kind ?? null);
12632
+ record2._setRaw("kind_value", encryptedKindValue ?? null);
12504
12633
  record2._setRaw("folder_id", opts.folderId ?? null);
12505
12634
  record2._setRaw("user_id", ctx.userId ?? null);
12506
12635
  record2._setRaw("is_deleted", false);
@@ -12534,6 +12663,8 @@ function populateNewVaultMemory(record2, ctx, opts, encryptedContent) {
12534
12663
  }
12535
12664
  }
12536
12665
  async function createVaultMemoryOp(ctx, opts) {
12666
+ assertValidKindLevel(opts.kind, resolveCreateLevel(opts).level);
12667
+ const encryptedKindValue = await encryptKindValue(ctx, opts.kindValue);
12537
12668
  const encryptedContent = ctx.walletAddress && ctx.signMessage ? await encryptVaultMemoryContent(
12538
12669
  opts.content,
12539
12670
  ctx.walletAddress,
@@ -12544,13 +12675,15 @@ async function createVaultMemoryOp(ctx, opts) {
12544
12675
  if (ctx.canWrite && !await ctx.canWrite())
12545
12676
  throw new Error("Memory source is no longer eligible");
12546
12677
  return ctx.vaultMemoryCollection.create(
12547
- (record2) => populateNewVaultMemory(record2, ctx, opts, encryptedContent)
12678
+ (record2) => populateNewVaultMemory(record2, ctx, opts, encryptedContent, encryptedKindValue)
12548
12679
  );
12549
12680
  });
12550
12681
  return vaultMemoryToStored(created, ctx.walletAddress, ctx.signMessage, ctx.embeddedWalletSigner);
12551
12682
  }
12552
12683
  async function createSupersedingMemoryOp(ctx, opts, targetId) {
12553
12684
  if (!targetId) return { created: null, retired: false };
12685
+ assertValidKindLevel(opts.kind, resolveCreateLevel(opts).level);
12686
+ const encryptedKindValue = await encryptKindValue(ctx, opts.kindValue);
12554
12687
  const encryptedContent = ctx.walletAddress && ctx.signMessage ? await encryptVaultMemoryContent(
12555
12688
  opts.content,
12556
12689
  ctx.walletAddress,
@@ -12567,9 +12700,10 @@ async function createSupersedingMemoryOp(ctx, opts, targetId) {
12567
12700
  } catch {
12568
12701
  return;
12569
12702
  }
12570
- if (target.isDeleted || target.supersededBy || !isOwnedByCtxUser(ctx, target)) return;
12703
+ if (target.isDeleted || target.supersededBy || isKinded(target) || !isOwnedByCtxUser(ctx, target))
12704
+ return;
12571
12705
  createdRecord = await ctx.vaultMemoryCollection.create(
12572
- (record2) => populateNewVaultMemory(record2, ctx, opts, encryptedContent)
12706
+ (record2) => populateNewVaultMemory(record2, ctx, opts, encryptedContent, encryptedKindValue)
12573
12707
  );
12574
12708
  await target.update((r) => {
12575
12709
  r._setRaw("superseded_by", createdRecord.id);
@@ -12633,6 +12767,10 @@ async function getMemoriesByEventTimeOp(ctx, windowStart, windowEnd) {
12633
12767
  }
12634
12768
  async function createVaultMemoriesBatchOp(ctx, optionsArray) {
12635
12769
  if (optionsArray.length === 0) return [];
12770
+ for (const opts of optionsArray) assertValidKindLevel(opts.kind, resolveCreateLevel(opts).level);
12771
+ const encryptedKindValues = await Promise.all(
12772
+ optionsArray.map((opts) => encryptKindValue(ctx, opts.kindValue))
12773
+ );
12636
12774
  const encryptedContents = await Promise.all(
12637
12775
  optionsArray.map(async (opts) => {
12638
12776
  if (ctx.walletAddress && ctx.signMessage) {
@@ -12651,7 +12789,7 @@ async function createVaultMemoriesBatchOp(ctx, optionsArray) {
12651
12789
  throw new Error("Memory source is no longer eligible");
12652
12790
  const prepared = optionsArray.map(
12653
12791
  (opts, i) => ctx.vaultMemoryCollection.prepareCreate(
12654
- (record2) => populateNewVaultMemory(record2, ctx, opts, encryptedContents[i])
12792
+ (record2) => populateNewVaultMemory(record2, ctx, opts, encryptedContents[i], encryptedKindValues[i])
12655
12793
  )
12656
12794
  );
12657
12795
  await ctx.database.batch(...prepared);
@@ -12694,6 +12832,9 @@ function vaultMemoryRawToStoredRaw(raw) {
12694
12832
  uniqueId: raw.id,
12695
12833
  content: raw.content ?? "",
12696
12834
  scope: raw.scope ?? "",
12835
+ kind: raw.kind ?? null,
12836
+ kindValue: raw.kind_value ?? null,
12837
+ level: resolveMemoryLevel(raw.level, raw.scope),
12697
12838
  folderId: raw.folder_id ?? null,
12698
12839
  userId: raw.user_id ?? null,
12699
12840
  embedding: raw.embedding ?? null,
@@ -12737,6 +12878,8 @@ async function getAllVaultMemoriesOp(ctx, options) {
12737
12878
  ...baseVaultConditions(ctx, options),
12738
12879
  ...options?.scopes?.length ? [import_watermelondb20.Q.where("scope", import_watermelondb20.Q.oneOf(options.scopes))] : [],
12739
12880
  ...visibilityConditions(options?.visibility),
12881
+ ...levelConditions(options?.levels),
12882
+ ...options?.kinds?.length ? [import_watermelondb20.Q.where("kind", import_watermelondb20.Q.oneOf(options.kinds))] : [],
12740
12883
  ...options?.folderId !== void 0 ? [import_watermelondb20.Q.where("folder_id", options.folderId)] : [],
12741
12884
  ...options?.factTypes?.length ? [import_watermelondb20.Q.where("fact_type", import_watermelondb20.Q.oneOf(options.factTypes))] : [],
12742
12885
  import_watermelondb20.Q.sortBy(options?.since ? "updated_at" : "created_at", import_watermelondb20.Q.desc),
@@ -12903,6 +13046,14 @@ async function updateVaultMemoryOp(ctx, id, opts) {
12903
13046
  try {
12904
13047
  const probe = await ctx.vaultMemoryCollection.find(id);
12905
13048
  if (probe.isDeleted || probe.supersededBy || !isOwnedByCtxUser(ctx, probe)) return null;
13049
+ if (opts.freeFormOnly && isKinded(probe)) return null;
13050
+ const levelAfter = (current) => {
13051
+ if (opts.level !== void 0) return opts.level;
13052
+ if (opts.scope === void 0) return resolveMemoryLevel(current.level, current.scope);
13053
+ return levelForScopeChange(current, opts.scope);
13054
+ };
13055
+ assertValidKindLevel(opts.kind !== void 0 ? opts.kind : probe.kind, levelAfter(probe));
13056
+ const encryptedKindValue = await encryptKindValue(ctx, opts.kindValue);
12906
13057
  const encryptedContent = ctx.walletAddress && ctx.signMessage ? await encryptVaultMemoryContent(
12907
13058
  opts.content,
12908
13059
  ctx.walletAddress,
@@ -12915,10 +13066,13 @@ async function updateVaultMemoryOp(ctx, id, opts) {
12915
13066
  await ctx.database.write(async () => {
12916
13067
  if (ctx.canWrite && !await ctx.canWrite())
12917
13068
  throw new Error("Memory source is no longer eligible");
12918
- if (record2.isDeleted || record2.supersededBy || !isOwnedByCtxUser(ctx, record2)) {
13069
+ if (record2.isDeleted || record2.supersededBy || !isOwnedByCtxUser(ctx, record2) || opts.freeFormOnly && isKinded(record2)) {
12919
13070
  stale = true;
12920
13071
  return;
12921
13072
  }
13073
+ const nextKind = opts.kind !== void 0 ? opts.kind : record2.kind;
13074
+ const nextLevel = levelAfter(record2);
13075
+ assertValidKindLevel(nextKind, nextLevel);
12922
13076
  let observedSources = [];
12923
13077
  let replayedObservation = false;
12924
13078
  if (opts.observationSourceIds?.length) {
@@ -12932,8 +13086,18 @@ async function updateVaultMemoryOp(ctx, id, opts) {
12932
13086
  }
12933
13087
  await record2.update((r) => {
12934
13088
  r._setRaw("content", encryptedContent);
12935
- if (opts.scope !== void 0) {
13089
+ if (opts.level !== void 0) {
13090
+ r._setRaw("level", nextLevel);
13091
+ r._setRaw("scope", scopeForLevel(nextLevel));
13092
+ } else if (opts.scope !== void 0) {
12936
13093
  r._setRaw("scope", opts.scope);
13094
+ r._setRaw("level", nextLevel);
13095
+ }
13096
+ if (opts.kind !== void 0) {
13097
+ r._setRaw("kind", opts.kind);
13098
+ }
13099
+ if (encryptedKindValue !== void 0) {
13100
+ r._setRaw("kind_value", encryptedKindValue);
12937
13101
  }
12938
13102
  if (opts.folderId !== void 0) {
12939
13103
  r._setRaw("folder_id", opts.folderId);
@@ -12992,7 +13156,8 @@ async function updateVaultMemoryOp(ctx, id, opts) {
12992
13156
  ctx.signMessage,
12993
13157
  ctx.embeddedWalletSigner
12994
13158
  );
12995
- } catch {
13159
+ } catch (err) {
13160
+ if (err instanceof MemoryLevelError) throw err;
12996
13161
  return null;
12997
13162
  }
12998
13163
  }
@@ -13128,6 +13293,7 @@ async function supersedeVaultMemoryOp(ctx, id, supersededById) {
13128
13293
  try {
13129
13294
  const record2 = await ctx.vaultMemoryCollection.find(id);
13130
13295
  if (record2.isDeleted || record2.supersededBy || !isOwnedByCtxUser(ctx, record2)) return false;
13296
+ if (isKinded(record2)) return false;
13131
13297
  let successor;
13132
13298
  try {
13133
13299
  successor = await ctx.vaultMemoryCollection.find(supersededById);
@@ -13428,7 +13594,10 @@ function assertVaultScopeForSweep(ctx) {
13428
13594
  }
13429
13595
  async function getDecayCandidatesRawOp(ctx) {
13430
13596
  assertVaultScopeForSweep(ctx);
13431
- const results = await ctx.vaultMemoryCollection.query(...baseVaultConditions(ctx, { includeArchived: true, includeQuarantined: true })).unsafeFetchRaw();
13597
+ const results = await ctx.vaultMemoryCollection.query(
13598
+ ...baseVaultConditions(ctx, { includeArchived: true, includeQuarantined: true }),
13599
+ import_watermelondb20.Q.where("kind", null)
13600
+ ).unsafeFetchRaw();
13432
13601
  return results.map((raw) => ({
13433
13602
  uniqueId: raw.id,
13434
13603
  factType: raw.fact_type ?? null,
@@ -13689,6 +13858,7 @@ async function ingestPublishedPhotoMemoriesOp(ctx, rows) {
13689
13858
  record2._raw.id = row.memoryId;
13690
13859
  record2._setRaw("content", content);
13691
13860
  record2._setRaw("scope", "shared");
13861
+ record2._setRaw("level", "matching");
13692
13862
  record2._setRaw("folder_id", null);
13693
13863
  record2._setRaw("user_id", ctx.userId ?? null);
13694
13864
  record2._setRaw("is_deleted", false);
@@ -14098,6 +14268,7 @@ async function updateVaultFolderOp(ctx, id, opts) {
14098
14268
  for (const memory of memories) {
14099
14269
  updates.push(
14100
14270
  memory.prepareUpdate((r) => {
14271
+ r._setRaw("level", levelForScopeChange(r, opts.scope));
14101
14272
  r._setRaw("scope", opts.scope);
14102
14273
  })
14103
14274
  );
@@ -14119,6 +14290,7 @@ async function deleteVaultFolderOp(ctx, id) {
14119
14290
  const preparedMemories = memories.map(
14120
14291
  (memory) => memory.prepareUpdate((r) => {
14121
14292
  r._setRaw("folder_id", null);
14293
+ r._setRaw("level", levelForScopeChange(r, "private"));
14122
14294
  r._setRaw("scope", "private");
14123
14295
  })
14124
14296
  );
@@ -14155,6 +14327,7 @@ async function moveMemoriesToFolderOp(ctx, memoryIds, folderId) {
14155
14327
  const prepared = memories.map(
14156
14328
  (memory) => memory.prepareUpdate((r) => {
14157
14329
  r._setRaw("folder_id", folderId);
14330
+ r._setRaw("level", levelForScopeChange(r, targetScope));
14158
14331
  r._setRaw("scope", targetScope);
14159
14332
  })
14160
14333
  );
@@ -16484,6 +16657,7 @@ async function retainWithPersistence(content, ctx, options = {}) {
16484
16657
  includeArchived: true,
16485
16658
  ...options.folderId !== void 0 && { folderId: options.folderId }
16486
16659
  });
16660
+ prepared = withoutKindedRows(prepared);
16487
16661
  if (prepared.embeddingFailure || prepared.embeddingsUnavailable) {
16488
16662
  throw new Error(
16489
16663
  "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."
@@ -16525,6 +16699,7 @@ async function retainWithPersistence(content, ctx, options = {}) {
16525
16699
  const resurrect = resurrectFields(existing);
16526
16700
  const updated = await ctx.persistence.update(targetId, {
16527
16701
  content: existing.content,
16702
+ freeFormOnly: true,
16528
16703
  proofCountIncrement: 1,
16529
16704
  observationSourceIds: options.sourceChunkIds,
16530
16705
  sourceChunkIds: mergedSourceIds,
@@ -16653,6 +16828,17 @@ async function retainWithPersistence(content, ctx, options = {}) {
16653
16828
  ...consolidationDecidedCreate && { consolidation: "create" }
16654
16829
  };
16655
16830
  }
16831
+ function withoutKindedRows(prepared) {
16832
+ const kinded = new Set(
16833
+ prepared.memories.filter((m) => m.kind !== null && m.kind !== void 0).map((m) => m.uniqueId)
16834
+ );
16835
+ if (kinded.size === 0) return prepared;
16836
+ return {
16837
+ ...prepared,
16838
+ memories: prepared.memories.filter((m) => !kinded.has(m.uniqueId)),
16839
+ embeddedItems: prepared.embeddedItems.filter((item) => !kinded.has(item.id))
16840
+ };
16841
+ }
16656
16842
  function unionStrings(a, b) {
16657
16843
  return [.../* @__PURE__ */ new Set([...a, ...b])];
16658
16844
  }
@@ -16752,6 +16938,7 @@ async function tryConsolidate(trimmed, ctx, options, prepared) {
16752
16938
  const resurrect = resurrectFields(existing);
16753
16939
  const updated = await ctx.persistence.update(decision.targetId, {
16754
16940
  content: existing.content,
16941
+ freeFormOnly: true,
16755
16942
  proofCountIncrement: 1,
16756
16943
  observationSourceIds: options.sourceChunkIds,
16757
16944
  sourceChunkIds: mergedSourceIds,
@@ -16797,6 +16984,7 @@ async function tryConsolidate(trimmed, ctx, options, prepared) {
16797
16984
  const resurrect = resurrectFields(existing);
16798
16985
  const updated = await ctx.persistence.update(decision.targetId, {
16799
16986
  content: decision.content,
16987
+ freeFormOnly: true,
16800
16988
  proofCountIncrement: 1,
16801
16989
  observationSourceIds: options.sourceChunkIds,
16802
16990
  sourceChunkIds: mergedSourceIds,
@@ -16840,7 +17028,7 @@ async function tryConsolidate(trimmed, ctx, options, prepared) {
16840
17028
  }
16841
17029
  async function assertMergeTargetGoneOrThrow(ctx, targetId) {
16842
17030
  const stillExists = await (ctx.persistence.getFresh ? ctx.persistence.getFresh(targetId) : ctx.persistence.get(targetId));
16843
- if (stillExists) {
17031
+ if (stillExists && (stillExists.kind === null || stillExists.kind === void 0)) {
16844
17032
  throw new Error(`retain: merge into memory ${targetId} failed to persist`);
16845
17033
  }
16846
17034
  }
@@ -19914,6 +20102,9 @@ function sourceIds(value) {
19914
20102
  return [];
19915
20103
  }
19916
20104
  }
20105
+ function isMemoryLevel(value) {
20106
+ return MEMORY_LEVELS.includes(value);
20107
+ }
19917
20108
  function stored(row) {
19918
20109
  return {
19919
20110
  uniqueId: row.memory_id,
@@ -19921,6 +20112,9 @@ function stored(row) {
19921
20112
  scope: row.scope,
19922
20113
  folderId: row.folder_id ?? null,
19923
20114
  userId: null,
20115
+ kind: row.kind ?? null,
20116
+ kindValue: row.kind_value ?? null,
20117
+ ...isMemoryLevel(row.level) && { level: row.level },
19924
20118
  embedding: row.embedding ? JSON.stringify(row.embedding) : null,
19925
20119
  embeddingModel: row.embedding_model ?? null,
19926
20120
  sourceChunkIds: row.source_chunk_ids === void 0 ? null : sourceIds(row.source_chunk_ids),
@@ -20142,7 +20336,8 @@ function createRemoteMemoryPipeline(options) {
20142
20336
  create: (input) => write(createRow(input), 0),
20143
20337
  update: async (id, patch) => {
20144
20338
  const existing = await get(id);
20145
- if (!existing) return null;
20339
+ if (!existing || patch.freeFormOnly && existing.kind !== null && existing.kind !== void 0)
20340
+ return null;
20146
20341
  const snapshot = snapshots.get(id);
20147
20342
  const memory = {
20148
20343
  ...snapshot.memory,
@@ -26349,6 +26544,9 @@ function useChatStorage(options) {
26349
26544
  LoggerProvider,
26350
26545
  MAX_HOPS,
26351
26546
  MEDIUM_TTL_MS,
26547
+ MEMORY_KINDS,
26548
+ MEMORY_LEVELS,
26549
+ MemoryLevelError,
26352
26550
  NEVER_TTL_MS,
26353
26551
  NODE_BUDGET,
26354
26552
  NOTION_OAUTH_CONFIG,
@@ -4866,8 +4866,10 @@ declare function isEncrypted(value: string): boolean;
4866
4866
  * budget was in memory and reset on every turn, so one batch that could never
4867
4867
  * extract blocked its conversation's extraction forever. Additive, both
4868
4868
  * nullable, no backfill: NULL reads as "never failed"
4869
+ * - v48: Added kind, kind_value (encrypted) and level to memory_vault; level is
4870
+ * backfilled from scope where SQL steps run
4869
4871
  */
4870
- declare const SDK_SCHEMA_VERSION = 47;
4872
+ declare const SDK_SCHEMA_VERSION = 48;
4871
4873
  /**
4872
4874
  * Combined WatermelonDB schema for all SDK storage modules.
4873
4875
  *
@@ -4956,6 +4958,7 @@ declare const sdkSchema: Readonly<{
4956
4958
  * - 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)
4957
4959
  * - v42 → v43: Added a composite `(is_deleted, created_at)` index to conversations so the list reads stop temp-sorting (structural only, no data rewritten)
4958
4960
  * - 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)
4961
+ * - v47 → v48: Added `kind`, `kind_value`, `level` to memory_vault; `level` backfilled from `scope` (`shared`/`public` → matching, else private) where SQL steps run
4959
4962
  */
4960
4963
  declare const sdkMigrations: Readonly<{
4961
4964
  validated: true;
@@ -5126,6 +5129,12 @@ declare class VaultMemory extends Model {
5126
5129
  static table: string;
5127
5130
  content: string;
5128
5131
  scope: string;
5132
+ /** Profile kind, or null for a free-form memory. */
5133
+ kind: string | null;
5134
+ /** Canonical JSON value of a kinded memory, encrypted at rest. */
5135
+ kindValue: string | null;
5136
+ /** private | matching | profile. */
5137
+ level: string | null;
5129
5138
  folderId: string | null;
5130
5139
  userId: string | null;
5131
5140
  embedding: string | null;
@@ -6879,13 +6888,35 @@ declare function extractAndRetain(messages: AutoExtractMessage[], retainCtx: Ret
6879
6888
  * the fail-safe direction: it un-publishes rather than exposes.
6880
6889
  */
6881
6890
  type VaultMemoryVisibility = "private" | "public";
6891
+ /** Profile kinds a vault memory can carry. */
6892
+ 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"];
6893
+ /** One of {@link MEMORY_KINDS}. */
6894
+ type VaultMemoryKind = (typeof MEMORY_KINDS)[number];
6895
+ /** Who a memory reaches. */
6896
+ declare const MEMORY_LEVELS: readonly ["private", "matching", "profile"];
6897
+ /** One of {@link MEMORY_LEVELS}. */
6898
+ type MemoryLevel = (typeof MEMORY_LEVELS)[number];
6899
+ /**
6900
+ * Thrown by vault writes that would store an unknown kind or level, or a profile level without a kind.
6901
+ *
6902
+ * @public
6903
+ */
6904
+ declare class MemoryLevelError extends Error {
6905
+ constructor(message: string);
6906
+ }
6882
6907
  interface StoredVaultMemory {
6883
6908
  /** WatermelonDB internal ID */
6884
6909
  uniqueId: string;
6885
6910
  /** Plain text memory content */
6886
6911
  content: string;
6887
- /** Scope for partitioning memories (e.g., "private", "shared") */
6912
+ /** Scope for partitioning memories (e.g., "private", "shared"). */
6888
6913
  scope: string;
6914
+ /** Profile kind ({@link MEMORY_KINDS}) or null for a free-form memory. */
6915
+ kind?: string | null;
6916
+ /** Canonical value of a kinded memory, JSON-encoded (slug, slug[], int, date, text). */
6917
+ kindValue?: string | null;
6918
+ /** Who this memory reaches. */
6919
+ level?: MemoryLevel;
6889
6920
  /** Folder ID for organization, null if unfiled */
6890
6921
  folderId: string | null;
6891
6922
  /** User ID for multi-user server-side scoping, null on client */
@@ -7027,8 +7058,14 @@ interface PhotoMediaRef {
7027
7058
  declare function parseMedia(value: unknown): PhotoMediaRef[] | null;
7028
7059
  interface CreateVaultMemoryOptions {
7029
7060
  content: string;
7030
- /** Scope for the memory. Defaults to "private" if omitted. */
7061
+ /** Scope for the memory. */
7031
7062
  scope?: string;
7063
+ /** Profile kind, or omit/null for a free-form memory. */
7064
+ kind?: VaultMemoryKind | null;
7065
+ /** Canonical JSON value of a kinded memory. */
7066
+ kindValue?: string | null;
7067
+ /** Who this memory reaches. */
7068
+ level?: MemoryLevel;
7032
7069
  /** Folder ID for organization, null or omitted if unfiled */
7033
7070
  folderId?: string | null;
7034
7071
  /** JSON-stringified embedding vector to persist */
@@ -7069,8 +7106,19 @@ interface CreateVaultMemoryOptions {
7069
7106
  }
7070
7107
  interface UpdateVaultMemoryOptions {
7071
7108
  content: string;
7072
- /** If provided, updates the memory's scope. */
7109
+ /** When true, the write is skipped (returns null) if the row carries a profile kind. */
7110
+ freeFormOnly?: boolean;
7111
+ /**
7112
+ * If provided, updates the memory's scope (and the level it implies; a `profile` row keeps
7113
+ * `profile` under `scope: "shared"`).
7114
+ */
7073
7115
  scope?: string;
7116
+ /** If provided, sets the profile kind (null makes the memory free-form). */
7117
+ kind?: VaultMemoryKind | null;
7118
+ /** If provided, sets the canonical JSON value (null clears it). */
7119
+ kindValue?: string | null;
7120
+ /** If provided, sets the level (and dual-writes `scope`). */
7121
+ level?: MemoryLevel;
7074
7122
  /** If provided, moves the memory to this folder. */
7075
7123
  folderId?: string | null;
7076
7124
  /** JSON-stringified embedding vector to persist, or null to clear stale embedding */
@@ -7210,6 +7258,10 @@ declare function getAllVaultMemoriesOp(ctx: VaultMemoryOperationsContext, option
7210
7258
  * published set to diff against the server index.
7211
7259
  */
7212
7260
  visibility?: VaultMemoryVisibility[];
7261
+ /** Filter by level. */
7262
+ levels?: MemoryLevel[];
7263
+ /** Restrict to these profile kinds. */
7264
+ kinds?: string[];
7213
7265
  }): Promise<StoredVaultMemory[]>;
7214
7266
  /**
7215
7267
  * Return content-free {@link RankableVaultMemory} projections for recall
@@ -7491,7 +7543,8 @@ interface DecayCandidateRaw {
7491
7543
  *
7492
7544
  * Includes archived AND quarantined rows (so archived→delete transitions and
7493
7545
  * aged quarantined rows are seen) but excludes hard-deleted rows — the
7494
- * `baseVaultConditions` default keeps `is_deleted = false`.
7546
+ * `baseVaultConditions` default keeps `is_deleted = false`. Excludes kinded
7547
+ * (profile) memories, which never decay.
7495
7548
  *
7496
7549
  * Refuses to run on an unscoped multi-tenant context (see
7497
7550
  * {@link assertVaultScopeForSweep}).
@@ -9495,8 +9548,8 @@ interface SynthesizeProfileOptions extends PortalLlmAuth {
9495
9548
  * on memories the user approved for publication. Empty intersection → empty
9496
9549
  * section (legitimate no-evidence), not a stale fallback.
9497
9550
  *
9498
- * Pass the user's published set (e.g. `getAllVaultMemoriesOp(ctx, { visibility:
9499
- * ["public"] })`) to keep a published profile derivable only from published
9551
+ * Pass the user's published set (e.g. `getAllVaultMemoriesOp(ctx, { levels:
9552
+ * ["matching", "profile"] })`) to keep a published profile derivable only from published
9500
9553
  * memories — People Nearby's two-tier model treats `private` memories as never
9501
9554
  * leaving the device, and a summary derived from them is a derivative that does.
9502
9555
  *
@@ -10953,4 +11006,4 @@ interface UseChatStorageResult extends BaseUseChatStorageResult {
10953
11006
  */
10954
11007
  declare function useChatStorage(options: UseChatStorageOptions): UseChatStorageResult;
10955
11008
 
10956
- export { type AutoExtractMessage, type AutoExtractor, type Budget, CHUNKS_DISCARDED_ORIGIN, type CachedChunkVectors, type CachedServerTools, Conversation as ChatConversation, Message as ChatMessage, type ChatRole, type ChunkVectorCache, type ChunkingOptions, type ConsolidationAction, type ConsolidationFallbackReason, type ConversationMemoryInput, ConversationMemory as ConversationMemoryModel, type ConversationMemoryOperationsContext, type CreateAutoExtractorOptions, type CreateConversationOptions, type CreateDecaySweeperOptions, type CreateMessageOptions, type CreateVaultFolderOptions, type CreateVaultMemoryOptions, type CryptoPriceClassification, type CryptoPricePreProcessorOptions, DEFAULT_CACHE_EXPIRATION_MS, DEFAULT_CHUNK_CACHE_SIZE, DEFAULT_CHUNK_OVERLAP, DEFAULT_CHUNK_SIZE, DEFAULT_DECAY_POLICY, DEFAULT_MAX_CLASSIFIER_CALLS_PER_SWEEP, DEFAULT_MIN_CHUNK_SIZE, DEFAULT_PROFILE_FACETS, DEFAULT_PROFILE_FACT_TYPE_WEIGHTS, DEFAULT_PROFILE_PROOF_ALPHA, DEFAULT_PROFILE_TREND_MULTIPLIERS, DEFAULT_VAULT_CACHE_SIZE, DatabaseManager, type DatabaseManagerLogger, type DatabaseManagerOptions, type DecayCandidateRaw, type DecayClassifier, type DecayInput, type DecayPolicy, type DecaySweepResult, type DecaySweeper, type DecayVerdict, type DurableAutoExtractorOptions, ENTITY_FANOUT, type EmbeddedWalletSignerFn, EncryptionKeyMissingError, type ExtractFactsOptions, type ExtractOutcome, type ExtractedCandidate, type ExtractedEntity, type ExtractionCursorStore, type ExtractionFunnel, type ExtractionTimings, type FactType, type FileMetadata, type FileProcessingReason, type FileProcessingStatus, type FlushResult, type GetConversationsPageOptions, type GetMessagesPageOptions, type GraphTraversalOptions, HARD_DELETE_WINDOW_MS, INFERENCE_ID_HEADER, type InjectionClassifierOptions, type InjectionReason, type LazyStoredConversation, type LlmDecayClassifierOptions, type LlmNeighborRefinerOptions, type LocalMemoryStoreOptions, type Logger, LoggerProvider, type LoggerProviderProps, MAX_HOPS, MEDIUM_TTL_MS, type ManualFactType, type MemoriesNeedingTopicExtraction, type MemoryContextItem, type MemoryContextLane, type MemoryContextOptions, type MemoryContextResult, type MemoryCreate, 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, type MessageRedactionResult, type MessageSkeleton, NEVER_TTL_MS, NODE_BUDGET, NOTION_OAUTH_CONFIG, type NeighborRefiner, type NotionAuthUrlParams, type NotionClientRegistration, type NotionExchangeCodeParams, type NotionMcpCaller, type NotionOAuthEndpoints, type NotionPKCEChallenge, type NotionRefreshTokenParams, type NotionTokenResponse, type NowSource, type ObservationTrend, type ObservationTrendInput, PAST_EVENT_GRACE_MS, PII_PATTERNS, PROFILE_DOC_VERSION, type PhotoIngestResult, type PhotoMediaRef, type PiiCategory, type PiiMatch, type PiiPattern, PiiRedactor, type PiiRedactorOptions, type PlatformStorage, type PortalLlmAuth, type PortalLlmFailure, type PortalLlmFailureReason, type ProfileConfigFingerprint, type ProfileDoc, type ProfileFacet, type ProfileFacetKey, type ProfileSalienceInput, type ProfileSection, type PromptPreProcessor, type PromptPreProcessorContext, type PublishedPhotoMemory, type QuantizedEmbedding, type QuarantinedMemoryInfo, QueueManager, type QueueStatus, RECALL_MAX_LIMIT, RECALL_TOOL_NAME, type RankableVaultMemory, type RankedMemory, type RankedProfileCandidate, type RecallContext, type RecallDegradation, type RecallDiagnostics, type RecallEmptyReason, type RecallOptions, type RecallResult, type RecallToolCallbacks, type RecallToolOptions, type RecencyOptions, type RedactionResult, type ReflectOptions, type ReflectResult, type RemoteMemoryCandidateOptions, type RemoteMemoryDecodeFailure, RemoteMemoryError, type RemoteMemoryListOptions, type RemoteMemoryPage, type RemoteMemoryPersistence, type RemoteMemoryPersistenceOptions, type RemoteMemoryPipeline, type RemoteMemoryPipelineOptions, type RemoteMemoryReadFilters, type RemoteMemoryRecord, type RemoteMemoryRow, type RequestEncryptionKeyOptions, RerankerUnavailableError, type ResumeStreamOptions, type ResumeStreamResult, type ResumeStreamWithStorageResult, type RetainAction, type RetainContext, type RetainOptions, type RetainResult, type RetainSource, SDK_SCHEMA_VERSION, SHORT_TTL_MS, STREAM_RESUMABLE_HEADER, type ScoreBreakdown, type ScoreProfileSalienceOptions, type ScreenResult, type ScreenedCandidate, type SearchSource, type SendMessageWithStorageArgs, type SendMessageWithStorageDetachedResult, type SendMessageWithStorageResult, type ServerToolsOptions, type ServerToolsResponse, type SignMessageFn, type StockPriceClassification, type StockPricePreProcessorOptions, type ChatCompletionUsage as StoredChatCompletionUsage, type StoredConversation, type StoredConversationMemory, type StoredMessage, type StoredMessageWithSimilarity, type StoredVaultFolder, VaultFolder as StoredVaultFolderModel, type StoredVaultMemory, VaultMemory as StoredVaultMemoryModel, StreamExpiredError, type StreamMetaEvent, type StreamResumeHandle, type StreamSmoothingConfig, type SynthesizeProfileOptions, TOOL_RESULT_ORIGIN, TOPICS_EXTRACTION_VERSION, TOPIC_EXTRACTION_BATCH_SIZE, TREND_RECENT_WINDOW_DAYS, TREND_STALE_WINDOW_DAYS, type TextChunk, type TopicExtractOptions, type TopicExtractionInput, type TopicExtractionRunResult, type TopicSkipReason, type TurnCompleteEvent, type TurnSkippedEvent, type UncheckedReason, type UnverifiableReason, type UpdateVaultFolderOptions, type UpdateVaultMemoryOptions, type UseChatStorageOptions, type UseChatStorageResult, type UseCreditsOptions, type UseCreditsResult, type UseModelsOptions, type UseModelsResult, VAULT_SIZE_HOP_CAP, type VaultEmbeddingCache, type VaultEmbeddingExpectation, type VaultFolderOperationsContext, type VaultMemoryOperationsContext, type VaultMemoryVisibility, type VaultMemoryWriter, type VaultSaveOperation, type VaultSearchResult, type VaultWriteAction, type VaultWriteInput, type VaultWriteOutcome, type VerificationSources, type VerifyMemoriesForPublishOptions, WalletPoller, type WeatherClassification, type WeatherPreProcessorOptions, type WebSearchClassification, type WebSearchPreProcessorOptions, addConversationMemoriesOp, archiveVaultMemoryOp, assembleMemoryContext, attachFileContextToLastUserMessage, backfillMemoryTopicsOp, buildAttachedFilesText, buildNotionAuthUrl, capHopsForDensity, chatStorageMigrations, chatStorageSchema, chunkAndEmbedAllMessages, chunkAndEmbedMessage, chunkText, classifyCryptoPrice, classifyCryptoPriceBatch, classifyDecay, classifyInjectionCandidates, classifyObservationTrend, classifyStockPrice, classifyStockPriceBatch, classifyWeather, classifyWeatherBatch, classifyWebSearch, classifyWebSearchBatch, clearAllEncryptionKeys, clearAllEncryptionState, clearConversationMemoriesOp, clearEncryptionKey, clearLazyTitleCache, clearServerToolsCache, consoleLogger, conversationMemoryToStored, cosineInt8, createAutoExtractor, createChunkVectorCache, createCryptoPricePreProcessor, createDecaySweeper, createDurableAutoExtractor, createLlmDecayClassifier, createLlmNeighborRefiner, createLocalMemoryStore, createMemoryEngineTool, createMemoryVaultSearchTool, createMemoryVaultTool, createMessageSourceResolver, createNotionProxyTools, createNotionTools, createPlatformCursorStore, createRecallTool, createRemoteMemoryPersistence, createRemoteMemoryPipeline, createStockPricePreProcessor, createStreamingDeAnonymizer, createVaultEmbeddingCache, createVaultFolderOp, createVaultMemoriesBatchOp, createVaultMemoryOp, createWeatherPreProcessor, createWebSearchPreProcessor, decodeChunkVector, decryptConversationTitle, deleteAllVaultMemoriesForUserOp, deleteMessageOp, deleteVaultFolderOp, deleteVaultMemoryOp, dequantizeEmbedding, deriveKeyFromSignatureBytes, discoverNotionOAuthEndpoints, eagerEmbedContent, embedAllMessages, embedMessage, encodeChunkVector, ensureDefaultFoldersOp, exchangeNotionCode, extractAndLinkEntitiesForMemoriesOp, extractAndRetain, extractEntitiesForMemories, extractFacts, formatFileProcessingNotes, generateConversationId, generateEmbedding, generateEmbeddings, generateNotionPKCE, getAllVaultFoldersOp, getAllVaultMemoriesOp, getAllVaultMemoryContentsOp, getCachedServerTools, getConversationMemoriesOp, getConversationsByProjectLazyOp, getConversationsLazyOp, getConversationsPageOp, getDecayCandidatesRawOp, getLogger, getMemoriesNeedingTopicExtractionOp, getServerTools, getUnfiledVaultMemoriesOp, getVaultFolderMemoryCountOp, getVaultMemoriesByIdsOp, getVaultMemoryOp, getVaultRankingProjectionsOp, hardDeleteDecayedOp, hasEncryptionKey, ingestPublishedPhotoMemoriesOp, injectionSignatureCatalog, isAttachedFilesText, isDegradedTopicSkip, isEncrypted, isPiiRedactor, isRerankerAvailable, maskScopedEmbeddingCache, moveMemoriesToFolderOp, noopLogger, onKeyAvailable, parseMedia, preEmbedVaultMemories, quantizeEmbedding, queueManager, rankProfileCandidates, recall, reflect, refreshEncryptionKeyIfMatches, refreshNotionAccessToken, registerNotionClient, relinkMemoryTopicsOp, requestEncryptionKey, resolvePiiRedactor, restoreVaultMemoryOp, resumeStream, retain, scoreProfileSalience, screenCandidatesForInjection, sdkMigrations, sdkModelClasses, sdkSchema, searchVaultMemories, seedEncryptionKeys, setLogger, setMemoryVisibilityOp, shouldChunkMessage, shouldRecallMemory, stampTopicsExtractedAtOp, streamCancelPath, streamReplayPath, stripLegacyChunkTextOp, summarizeObservationTrends, supersedeVaultMemoryOp, synthesizeProfile, traverseGraphLane, ttlForType, updateVaultFolderContextOp, updateVaultFolderOp, updateVaultMemoryEmbeddingOp, updateVaultMemoryOp, upsertMessageOp, useChat, useChatStorage, useCredits, useEncryption, useModels, verifyMemoriesForPublish, xhrTransport };
11009
+ export { type AutoExtractMessage, type AutoExtractor, type Budget, CHUNKS_DISCARDED_ORIGIN, type CachedChunkVectors, type CachedServerTools, Conversation as ChatConversation, Message as ChatMessage, type ChatRole, type ChunkVectorCache, type ChunkingOptions, type ConsolidationAction, type ConsolidationFallbackReason, type ConversationMemoryInput, ConversationMemory as ConversationMemoryModel, type ConversationMemoryOperationsContext, type CreateAutoExtractorOptions, type CreateConversationOptions, type CreateDecaySweeperOptions, type CreateMessageOptions, type CreateVaultFolderOptions, type CreateVaultMemoryOptions, type CryptoPriceClassification, type CryptoPricePreProcessorOptions, DEFAULT_CACHE_EXPIRATION_MS, DEFAULT_CHUNK_CACHE_SIZE, DEFAULT_CHUNK_OVERLAP, DEFAULT_CHUNK_SIZE, DEFAULT_DECAY_POLICY, DEFAULT_MAX_CLASSIFIER_CALLS_PER_SWEEP, DEFAULT_MIN_CHUNK_SIZE, DEFAULT_PROFILE_FACETS, DEFAULT_PROFILE_FACT_TYPE_WEIGHTS, DEFAULT_PROFILE_PROOF_ALPHA, DEFAULT_PROFILE_TREND_MULTIPLIERS, DEFAULT_VAULT_CACHE_SIZE, DatabaseManager, type DatabaseManagerLogger, type DatabaseManagerOptions, type DecayCandidateRaw, type DecayClassifier, type DecayInput, type DecayPolicy, type DecaySweepResult, type DecaySweeper, type DecayVerdict, type DurableAutoExtractorOptions, ENTITY_FANOUT, type EmbeddedWalletSignerFn, EncryptionKeyMissingError, type ExtractFactsOptions, type ExtractOutcome, type ExtractedCandidate, type ExtractedEntity, type ExtractionCursorStore, type ExtractionFunnel, type ExtractionTimings, type FactType, type FileMetadata, type FileProcessingReason, type FileProcessingStatus, type FlushResult, type GetConversationsPageOptions, type GetMessagesPageOptions, type GraphTraversalOptions, HARD_DELETE_WINDOW_MS, INFERENCE_ID_HEADER, type InjectionClassifierOptions, type InjectionReason, type LazyStoredConversation, type LlmDecayClassifierOptions, type LlmNeighborRefinerOptions, type LocalMemoryStoreOptions, type Logger, LoggerProvider, type LoggerProviderProps, MAX_HOPS, MEDIUM_TTL_MS, MEMORY_KINDS, MEMORY_LEVELS, type ManualFactType, type MemoriesNeedingTopicExtraction, type MemoryContextItem, type MemoryContextLane, type MemoryContextOptions, type MemoryContextResult, type MemoryCreate, 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, type MessageRedactionResult, type MessageSkeleton, NEVER_TTL_MS, NODE_BUDGET, NOTION_OAUTH_CONFIG, type NeighborRefiner, type NotionAuthUrlParams, type NotionClientRegistration, type NotionExchangeCodeParams, type NotionMcpCaller, type NotionOAuthEndpoints, type NotionPKCEChallenge, type NotionRefreshTokenParams, type NotionTokenResponse, type NowSource, type ObservationTrend, type ObservationTrendInput, PAST_EVENT_GRACE_MS, PII_PATTERNS, PROFILE_DOC_VERSION, type PhotoIngestResult, type PhotoMediaRef, type PiiCategory, type PiiMatch, type PiiPattern, PiiRedactor, type PiiRedactorOptions, type PlatformStorage, type PortalLlmAuth, type PortalLlmFailure, type PortalLlmFailureReason, type ProfileConfigFingerprint, type ProfileDoc, type ProfileFacet, type ProfileFacetKey, type ProfileSalienceInput, type ProfileSection, type PromptPreProcessor, type PromptPreProcessorContext, type PublishedPhotoMemory, type QuantizedEmbedding, type QuarantinedMemoryInfo, QueueManager, type QueueStatus, RECALL_MAX_LIMIT, RECALL_TOOL_NAME, type RankableVaultMemory, type RankedMemory, type RankedProfileCandidate, type RecallContext, type RecallDegradation, type RecallDiagnostics, type RecallEmptyReason, type RecallOptions, type RecallResult, type RecallToolCallbacks, type RecallToolOptions, type RecencyOptions, type RedactionResult, type ReflectOptions, type ReflectResult, type RemoteMemoryCandidateOptions, type RemoteMemoryDecodeFailure, RemoteMemoryError, type RemoteMemoryListOptions, type RemoteMemoryPage, type RemoteMemoryPersistence, type RemoteMemoryPersistenceOptions, type RemoteMemoryPipeline, type RemoteMemoryPipelineOptions, type RemoteMemoryReadFilters, type RemoteMemoryRecord, type RemoteMemoryRow, type RequestEncryptionKeyOptions, RerankerUnavailableError, type ResumeStreamOptions, type ResumeStreamResult, type ResumeStreamWithStorageResult, type RetainAction, type RetainContext, type RetainOptions, type RetainResult, type RetainSource, SDK_SCHEMA_VERSION, SHORT_TTL_MS, STREAM_RESUMABLE_HEADER, type ScoreBreakdown, type ScoreProfileSalienceOptions, type ScreenResult, type ScreenedCandidate, type SearchSource, type SendMessageWithStorageArgs, type SendMessageWithStorageDetachedResult, type SendMessageWithStorageResult, type ServerToolsOptions, type ServerToolsResponse, type SignMessageFn, type StockPriceClassification, type StockPricePreProcessorOptions, type ChatCompletionUsage as StoredChatCompletionUsage, type StoredConversation, type StoredConversationMemory, type StoredMessage, type StoredMessageWithSimilarity, type StoredVaultFolder, VaultFolder as StoredVaultFolderModel, type StoredVaultMemory, VaultMemory as StoredVaultMemoryModel, StreamExpiredError, type StreamMetaEvent, type StreamResumeHandle, type StreamSmoothingConfig, type SynthesizeProfileOptions, TOOL_RESULT_ORIGIN, TOPICS_EXTRACTION_VERSION, TOPIC_EXTRACTION_BATCH_SIZE, TREND_RECENT_WINDOW_DAYS, TREND_STALE_WINDOW_DAYS, type TextChunk, type TopicExtractOptions, type TopicExtractionInput, type TopicExtractionRunResult, type TopicSkipReason, type TurnCompleteEvent, type TurnSkippedEvent, type UncheckedReason, type UnverifiableReason, type UpdateVaultFolderOptions, type UpdateVaultMemoryOptions, type UseChatStorageOptions, type UseChatStorageResult, type UseCreditsOptions, type UseCreditsResult, type UseModelsOptions, type UseModelsResult, VAULT_SIZE_HOP_CAP, type VaultEmbeddingCache, type VaultEmbeddingExpectation, type VaultFolderOperationsContext, type VaultMemoryKind, type VaultMemoryOperationsContext, type VaultMemoryVisibility, type VaultMemoryWriter, type VaultSaveOperation, type VaultSearchResult, type VaultWriteAction, type VaultWriteInput, type VaultWriteOutcome, type VerificationSources, type VerifyMemoriesForPublishOptions, WalletPoller, type WeatherClassification, type WeatherPreProcessorOptions, type WebSearchClassification, type WebSearchPreProcessorOptions, addConversationMemoriesOp, archiveVaultMemoryOp, assembleMemoryContext, attachFileContextToLastUserMessage, backfillMemoryTopicsOp, buildAttachedFilesText, buildNotionAuthUrl, capHopsForDensity, chatStorageMigrations, chatStorageSchema, chunkAndEmbedAllMessages, chunkAndEmbedMessage, chunkText, classifyCryptoPrice, classifyCryptoPriceBatch, classifyDecay, classifyInjectionCandidates, classifyObservationTrend, classifyStockPrice, classifyStockPriceBatch, classifyWeather, classifyWeatherBatch, classifyWebSearch, classifyWebSearchBatch, clearAllEncryptionKeys, clearAllEncryptionState, clearConversationMemoriesOp, clearEncryptionKey, clearLazyTitleCache, clearServerToolsCache, consoleLogger, conversationMemoryToStored, cosineInt8, createAutoExtractor, createChunkVectorCache, createCryptoPricePreProcessor, createDecaySweeper, createDurableAutoExtractor, createLlmDecayClassifier, createLlmNeighborRefiner, createLocalMemoryStore, createMemoryEngineTool, createMemoryVaultSearchTool, createMemoryVaultTool, createMessageSourceResolver, createNotionProxyTools, createNotionTools, createPlatformCursorStore, createRecallTool, createRemoteMemoryPersistence, createRemoteMemoryPipeline, createStockPricePreProcessor, createStreamingDeAnonymizer, createVaultEmbeddingCache, createVaultFolderOp, createVaultMemoriesBatchOp, createVaultMemoryOp, createWeatherPreProcessor, createWebSearchPreProcessor, decodeChunkVector, decryptConversationTitle, deleteAllVaultMemoriesForUserOp, deleteMessageOp, deleteVaultFolderOp, deleteVaultMemoryOp, dequantizeEmbedding, deriveKeyFromSignatureBytes, discoverNotionOAuthEndpoints, eagerEmbedContent, embedAllMessages, embedMessage, encodeChunkVector, ensureDefaultFoldersOp, exchangeNotionCode, extractAndLinkEntitiesForMemoriesOp, extractAndRetain, extractEntitiesForMemories, extractFacts, formatFileProcessingNotes, generateConversationId, generateEmbedding, generateEmbeddings, generateNotionPKCE, getAllVaultFoldersOp, getAllVaultMemoriesOp, getAllVaultMemoryContentsOp, getCachedServerTools, getConversationMemoriesOp, getConversationsByProjectLazyOp, getConversationsLazyOp, getConversationsPageOp, getDecayCandidatesRawOp, getLogger, getMemoriesNeedingTopicExtractionOp, getServerTools, getUnfiledVaultMemoriesOp, getVaultFolderMemoryCountOp, getVaultMemoriesByIdsOp, getVaultMemoryOp, getVaultRankingProjectionsOp, hardDeleteDecayedOp, hasEncryptionKey, ingestPublishedPhotoMemoriesOp, injectionSignatureCatalog, isAttachedFilesText, isDegradedTopicSkip, isEncrypted, isPiiRedactor, isRerankerAvailable, maskScopedEmbeddingCache, moveMemoriesToFolderOp, noopLogger, onKeyAvailable, parseMedia, preEmbedVaultMemories, quantizeEmbedding, queueManager, rankProfileCandidates, recall, reflect, refreshEncryptionKeyIfMatches, refreshNotionAccessToken, registerNotionClient, relinkMemoryTopicsOp, requestEncryptionKey, resolvePiiRedactor, restoreVaultMemoryOp, resumeStream, retain, scoreProfileSalience, screenCandidatesForInjection, sdkMigrations, sdkModelClasses, sdkSchema, searchVaultMemories, seedEncryptionKeys, setLogger, setMemoryVisibilityOp, shouldChunkMessage, shouldRecallMemory, stampTopicsExtractedAtOp, streamCancelPath, streamReplayPath, stripLegacyChunkTextOp, summarizeObservationTrends, supersedeVaultMemoryOp, synthesizeProfile, traverseGraphLane, ttlForType, updateVaultFolderContextOp, updateVaultFolderOp, updateVaultMemoryEmbeddingOp, updateVaultMemoryOp, upsertMessageOp, useChat, useChatStorage, useCredits, useEncryption, useModels, verifyMemoriesForPublish, xhrTransport };