@anuma/sdk 3.9.6 → 3.11.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.
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  callPortalJsonCompletion,
3
3
  getLogger
4
- } from "./chunk-BOY27A2C.mjs";
4
+ } from "./chunk-ILAWDQDE.mjs";
5
5
  import {
6
6
  BASE_URL,
7
7
  createClientConfig
@@ -2187,6 +2187,19 @@ async function decryptVaultMemoryFields(memory, address, signMessage, embeddedWa
2187
2187
  }
2188
2188
 
2189
2189
  // src/lib/db/memoryVault/operations.ts
2190
+ function visibilityOrPrivate(value) {
2191
+ return value === "public" ? value : "private";
2192
+ }
2193
+ var NON_PRIVATE_VISIBILITIES = ["public"];
2194
+ function visibilityConditions(requested) {
2195
+ if (!requested?.length) return [];
2196
+ if (!requested.includes("private")) {
2197
+ return [Q3.where("visibility", Q3.oneOf([...requested]))];
2198
+ }
2199
+ const excluded = NON_PRIVATE_VISIBILITIES.filter((v) => !requested.includes(v));
2200
+ if (excluded.length === 0) return [];
2201
+ return [Q3.or(Q3.where("visibility", null), Q3.where("visibility", Q3.notIn(excluded)))];
2202
+ }
2190
2203
  function isOwnedByCtxUser(ctx, record) {
2191
2204
  return ctx.userId === void 0 || record.userId === ctx.userId;
2192
2205
  }
@@ -2248,6 +2261,10 @@ function vaultMemoryToStoredRaw(memory) {
2248
2261
  factType: memory.factType ?? null,
2249
2262
  archivedAt: memory.archivedAt ?? null,
2250
2263
  trustTier: memory.trustTier ?? null,
2264
+ visibility: visibilityOrPrivate(memory.visibility),
2265
+ twinOptIn: memory.twinOptIn ?? false,
2266
+ publishedAt: memory.publishedAt ?? null,
2267
+ geohash: memory.geohash ?? null,
2251
2268
  createdAt: memory.createdAt,
2252
2269
  updatedAt: memory.updatedAt,
2253
2270
  isDeleted: memory.isDeleted
@@ -2295,6 +2312,14 @@ async function createVaultMemoryOp(ctx, opts) {
2295
2312
  if (opts.trustTier !== void 0) {
2296
2313
  record._setRaw("trust_tier", normalizeTrustTier(opts.trustTier));
2297
2314
  }
2315
+ record._setRaw("visibility", opts.visibility ?? "private");
2316
+ record._setRaw(
2317
+ "published_at",
2318
+ opts.visibility && opts.visibility !== "private" ? opts.publishedAt ?? Date.now() : null
2319
+ );
2320
+ if (opts.geohash !== void 0) {
2321
+ record._setRaw("geohash", opts.geohash);
2322
+ }
2298
2323
  });
2299
2324
  });
2300
2325
  return vaultMemoryToStored(created, ctx.walletAddress, ctx.signMessage, ctx.embeddedWalletSigner);
@@ -2441,6 +2466,14 @@ async function createVaultMemoriesBatchOp(ctx, optionsArray) {
2441
2466
  if (opts.trustTier !== void 0) {
2442
2467
  record._setRaw("trust_tier", normalizeTrustTier(opts.trustTier));
2443
2468
  }
2469
+ record._setRaw("visibility", opts.visibility ?? "private");
2470
+ record._setRaw(
2471
+ "published_at",
2472
+ opts.visibility && opts.visibility !== "private" ? opts.publishedAt ?? Date.now() : null
2473
+ );
2474
+ if (opts.geohash !== void 0) {
2475
+ record._setRaw("geohash", opts.geohash);
2476
+ }
2444
2477
  })
2445
2478
  );
2446
2479
  await ctx.database.batch(...prepared);
@@ -2504,6 +2537,10 @@ function vaultMemoryRawToStoredRaw(raw) {
2504
2537
  factType: raw.fact_type ?? null,
2505
2538
  archivedAt: raw.archived_at ?? null,
2506
2539
  trustTier: raw.trust_tier ?? null,
2540
+ visibility: visibilityOrPrivate(raw.visibility),
2541
+ twinOptIn: raw.twin_opt_in === true || raw.twin_opt_in === 1,
2542
+ publishedAt: raw.published_at ?? null,
2543
+ geohash: raw.geohash ?? null,
2507
2544
  createdAt: new Date(raw.created_at),
2508
2545
  updatedAt: new Date(raw.updated_at),
2509
2546
  isDeleted: raw.is_deleted === true || raw.is_deleted === 1
@@ -2520,6 +2557,7 @@ async function getAllVaultMemoriesOp(ctx, options) {
2520
2557
  const conditions = [
2521
2558
  ...baseVaultConditions(ctx, options),
2522
2559
  ...options?.scopes?.length ? [Q3.where("scope", Q3.oneOf(options.scopes))] : [],
2560
+ ...visibilityConditions(options?.visibility),
2523
2561
  ...options?.folderId !== void 0 ? [Q3.where("folder_id", options.folderId)] : [],
2524
2562
  ...options?.factTypes?.length ? [Q3.where("fact_type", Q3.oneOf(options.factTypes))] : [],
2525
2563
  Q3.sortBy(options?.since ? "updated_at" : "created_at", Q3.desc),
@@ -2813,6 +2851,38 @@ async function clearMemoryTopicsOverrideOp(ctx, memoryId) {
2813
2851
  });
2814
2852
  return true;
2815
2853
  }
2854
+ async function setMemoryVisibilityOp(ctx, id, opts) {
2855
+ let record;
2856
+ try {
2857
+ record = await ctx.vaultMemoryCollection.find(id);
2858
+ } catch {
2859
+ return null;
2860
+ }
2861
+ if (record.isDeleted || !isOwnedByCtxUser(ctx, record)) return null;
2862
+ let stale = false;
2863
+ await ctx.database.write(async () => {
2864
+ if (record.isDeleted || !isOwnedByCtxUser(ctx, record)) {
2865
+ stale = true;
2866
+ return;
2867
+ }
2868
+ const currentUpdatedAt = record.updatedAt.getTime();
2869
+ const currentPublishedAt = record.publishedAt ?? null;
2870
+ await record.update((r) => {
2871
+ r._setRaw("visibility", opts.visibility);
2872
+ if (opts.visibility === "private") {
2873
+ r._setRaw("published_at", null);
2874
+ } else if (currentPublishedAt === null) {
2875
+ r._setRaw("published_at", Date.now());
2876
+ }
2877
+ if (opts.twinOptIn !== void 0) {
2878
+ r._setRaw("twin_opt_in", opts.twinOptIn);
2879
+ }
2880
+ r._setRaw("updated_at", currentUpdatedAt);
2881
+ });
2882
+ });
2883
+ if (stale) return null;
2884
+ return vaultMemoryToStored(record, ctx.walletAddress, ctx.signMessage, ctx.embeddedWalletSigner);
2885
+ }
2816
2886
  async function deleteVaultMemoryOp(ctx, id) {
2817
2887
  try {
2818
2888
  const record = await ctx.vaultMemoryCollection.find(id);
@@ -5959,7 +6029,7 @@ function createMemoryVaultSearchTool(vaultCtx, embeddingOptions, cache, searchOp
5959
6029
  legacy.map((r) => ({ id: r.uniqueId, content: r.content, score: r.similarity }))
5960
6030
  );
5961
6031
  }
5962
- const { recall: recall2 } = await import("./recall-ELUJPQQB.mjs");
6032
+ const { recall: recall2 } = await import("./recall-Q5V5DN4L.mjs");
5963
6033
  const result = await recall2(
5964
6034
  query,
5965
6035
  { vaultCtx, embeddingOptions, vaultCache: cache },
@@ -6986,6 +7056,7 @@ export {
6986
7056
  updateVaultMemoryOp,
6987
7057
  setMemoryEntitiesOp,
6988
7058
  clearMemoryTopicsOverrideOp,
7059
+ setMemoryVisibilityOp,
6989
7060
  deleteVaultMemoryOp,
6990
7061
  supersedeVaultMemoryOp,
6991
7062
  getUnfiledVaultMemoriesOp,
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  callPortalJsonCompletion,
6
6
  getLogger
7
- } from "./chunk-BOY27A2C.mjs";
7
+ } from "./chunk-ILAWDQDE.mjs";
8
8
  import "./chunk-GYKJOWEO.mjs";
9
9
 
10
10
  // src/lib/memory/consolidate.ts
@@ -4500,6 +4500,18 @@ var init_encryption2 = __esm({
4500
4500
  });
4501
4501
 
4502
4502
  // src/lib/db/memoryVault/operations.ts
4503
+ function visibilityOrPrivate(value) {
4504
+ return value === "public" ? value : "private";
4505
+ }
4506
+ function visibilityConditions(requested) {
4507
+ if (!requested?.length) return [];
4508
+ if (!requested.includes("private")) {
4509
+ return [import_watermelondb10.Q.where("visibility", import_watermelondb10.Q.oneOf([...requested]))];
4510
+ }
4511
+ const excluded = NON_PRIVATE_VISIBILITIES.filter((v) => !requested.includes(v));
4512
+ if (excluded.length === 0) return [];
4513
+ return [import_watermelondb10.Q.or(import_watermelondb10.Q.where("visibility", null), import_watermelondb10.Q.where("visibility", import_watermelondb10.Q.notIn(excluded)))];
4514
+ }
4503
4515
  function isOwnedByCtxUser(ctx, record) {
4504
4516
  return ctx.userId === void 0 || record.userId === ctx.userId;
4505
4517
  }
@@ -4560,6 +4572,10 @@ function vaultMemoryToStoredRaw(memory) {
4560
4572
  factType: memory.factType ?? null,
4561
4573
  archivedAt: memory.archivedAt ?? null,
4562
4574
  trustTier: memory.trustTier ?? null,
4575
+ visibility: visibilityOrPrivate(memory.visibility),
4576
+ twinOptIn: memory.twinOptIn ?? false,
4577
+ publishedAt: memory.publishedAt ?? null,
4578
+ geohash: memory.geohash ?? null,
4563
4579
  createdAt: memory.createdAt,
4564
4580
  updatedAt: memory.updatedAt,
4565
4581
  isDeleted: memory.isDeleted
@@ -4607,6 +4623,14 @@ async function createVaultMemoryOp(ctx, opts) {
4607
4623
  if (opts.trustTier !== void 0) {
4608
4624
  record._setRaw("trust_tier", normalizeTrustTier(opts.trustTier));
4609
4625
  }
4626
+ record._setRaw("visibility", opts.visibility ?? "private");
4627
+ record._setRaw(
4628
+ "published_at",
4629
+ opts.visibility && opts.visibility !== "private" ? opts.publishedAt ?? Date.now() : null
4630
+ );
4631
+ if (opts.geohash !== void 0) {
4632
+ record._setRaw("geohash", opts.geohash);
4633
+ }
4610
4634
  });
4611
4635
  });
4612
4636
  return vaultMemoryToStored(created, ctx.walletAddress, ctx.signMessage, ctx.embeddedWalletSigner);
@@ -4753,6 +4777,14 @@ async function createVaultMemoriesBatchOp(ctx, optionsArray) {
4753
4777
  if (opts.trustTier !== void 0) {
4754
4778
  record._setRaw("trust_tier", normalizeTrustTier(opts.trustTier));
4755
4779
  }
4780
+ record._setRaw("visibility", opts.visibility ?? "private");
4781
+ record._setRaw(
4782
+ "published_at",
4783
+ opts.visibility && opts.visibility !== "private" ? opts.publishedAt ?? Date.now() : null
4784
+ );
4785
+ if (opts.geohash !== void 0) {
4786
+ record._setRaw("geohash", opts.geohash);
4787
+ }
4756
4788
  })
4757
4789
  );
4758
4790
  await ctx.database.batch(...prepared);
@@ -4816,6 +4848,10 @@ function vaultMemoryRawToStoredRaw(raw) {
4816
4848
  factType: raw.fact_type ?? null,
4817
4849
  archivedAt: raw.archived_at ?? null,
4818
4850
  trustTier: raw.trust_tier ?? null,
4851
+ visibility: visibilityOrPrivate(raw.visibility),
4852
+ twinOptIn: raw.twin_opt_in === true || raw.twin_opt_in === 1,
4853
+ publishedAt: raw.published_at ?? null,
4854
+ geohash: raw.geohash ?? null,
4819
4855
  createdAt: new Date(raw.created_at),
4820
4856
  updatedAt: new Date(raw.updated_at),
4821
4857
  isDeleted: raw.is_deleted === true || raw.is_deleted === 1
@@ -4832,6 +4868,7 @@ async function getAllVaultMemoriesOp(ctx, options) {
4832
4868
  const conditions = [
4833
4869
  ...baseVaultConditions(ctx, options),
4834
4870
  ...options?.scopes?.length ? [import_watermelondb10.Q.where("scope", import_watermelondb10.Q.oneOf(options.scopes))] : [],
4871
+ ...visibilityConditions(options?.visibility),
4835
4872
  ...options?.folderId !== void 0 ? [import_watermelondb10.Q.where("folder_id", options.folderId)] : [],
4836
4873
  ...options?.factTypes?.length ? [import_watermelondb10.Q.where("fact_type", import_watermelondb10.Q.oneOf(options.factTypes))] : [],
4837
4874
  import_watermelondb10.Q.sortBy(options?.since ? "updated_at" : "created_at", import_watermelondb10.Q.desc),
@@ -5125,6 +5162,38 @@ async function clearMemoryTopicsOverrideOp(ctx, memoryId) {
5125
5162
  });
5126
5163
  return true;
5127
5164
  }
5165
+ async function setMemoryVisibilityOp(ctx, id, opts) {
5166
+ let record;
5167
+ try {
5168
+ record = await ctx.vaultMemoryCollection.find(id);
5169
+ } catch {
5170
+ return null;
5171
+ }
5172
+ if (record.isDeleted || !isOwnedByCtxUser(ctx, record)) return null;
5173
+ let stale = false;
5174
+ await ctx.database.write(async () => {
5175
+ if (record.isDeleted || !isOwnedByCtxUser(ctx, record)) {
5176
+ stale = true;
5177
+ return;
5178
+ }
5179
+ const currentUpdatedAt = record.updatedAt.getTime();
5180
+ const currentPublishedAt = record.publishedAt ?? null;
5181
+ await record.update((r) => {
5182
+ r._setRaw("visibility", opts.visibility);
5183
+ if (opts.visibility === "private") {
5184
+ r._setRaw("published_at", null);
5185
+ } else if (currentPublishedAt === null) {
5186
+ r._setRaw("published_at", Date.now());
5187
+ }
5188
+ if (opts.twinOptIn !== void 0) {
5189
+ r._setRaw("twin_opt_in", opts.twinOptIn);
5190
+ }
5191
+ r._setRaw("updated_at", currentUpdatedAt);
5192
+ });
5193
+ });
5194
+ if (stale) return null;
5195
+ return vaultMemoryToStored(record, ctx.walletAddress, ctx.signMessage, ctx.embeddedWalletSigner);
5196
+ }
5128
5197
  async function deleteVaultMemoryOp(ctx, id) {
5129
5198
  try {
5130
5199
  const record = await ctx.vaultMemoryCollection.find(id);
@@ -5414,7 +5483,7 @@ async function updateVaultMemoryEmbeddingOp(ctx, id, embedding, embeddingModel)
5414
5483
  return false;
5415
5484
  }
5416
5485
  }
5417
- var import_watermelondb10, KNOWN_TRUST_TIERS, TOPICS_EXTRACTION_VERSION;
5486
+ var import_watermelondb10, NON_PRIVATE_VISIBILITIES, KNOWN_TRUST_TIERS, TOPICS_EXTRACTION_VERSION;
5418
5487
  var init_operations3 = __esm({
5419
5488
  "src/lib/db/memoryVault/operations.ts"() {
5420
5489
  "use strict";
@@ -5422,6 +5491,7 @@ var init_operations3 = __esm({
5422
5491
  init_logger();
5423
5492
  init_operations2();
5424
5493
  init_encryption2();
5494
+ NON_PRIVATE_VISIBILITIES = ["public"];
5425
5495
  KNOWN_TRUST_TIERS = /* @__PURE__ */ new Set(["quarantined", "trusted"]);
5426
5496
  TOPICS_EXTRACTION_VERSION = 3;
5427
5497
  }
@@ -5575,6 +5645,7 @@ async function attemptPortalJson(req, endpoint) {
5575
5645
  return { kind: "retryable", reason: `response body parse failed: ${err.message}` };
5576
5646
  }
5577
5647
  clearTimeout(timer);
5648
+ logPortalUsage(body, req.tag);
5578
5649
  const rawContent = extractCompletionContent(body);
5579
5650
  if (!rawContent) {
5580
5651
  return { kind: "retryable", reason: "portal response had no completion content" };
@@ -5630,6 +5701,29 @@ function extractJsonCandidate(raw) {
5630
5701
  }
5631
5702
  return body;
5632
5703
  }
5704
+ function asRecord(value) {
5705
+ return typeof value === "object" && value !== null ? value : void 0;
5706
+ }
5707
+ function asCount(value) {
5708
+ return typeof value === "number" && Number.isFinite(value) ? value : void 0;
5709
+ }
5710
+ function logPortalUsage(body, tag) {
5711
+ try {
5712
+ const root = asRecord(body);
5713
+ if (!root) return;
5714
+ const usage = asRecord(root.usage);
5715
+ const promptTokens = asCount(usage?.prompt_tokens);
5716
+ const completionTokens = asCount(usage?.completion_tokens);
5717
+ if (promptTokens === void 0 && completionTokens === void 0) return;
5718
+ const cachedTokens = asCount(asRecord(root.portal)?.cached_tokens) ?? asCount(asRecord(usage?.prompt_tokens_details)?.cached_tokens) ?? 0;
5719
+ const parts = [];
5720
+ if (promptTokens !== void 0) parts.push(`prompt=${promptTokens}`);
5721
+ if (completionTokens !== void 0) parts.push(`completion=${completionTokens}`);
5722
+ parts.push(`cached=${cachedTokens}`);
5723
+ getLogger().debug(`[${tag}] usage ${parts.join(" ")}`);
5724
+ } catch {
5725
+ }
5726
+ }
5633
5727
  function extractCompletionContent(body) {
5634
5728
  if (typeof body !== "object" || body === null) return null;
5635
5729
  const choices = body.choices;
@@ -8701,6 +8795,7 @@ __export(index_exports, {
8701
8795
  serializeJsx: () => serializeJsx,
8702
8796
  setLogger: () => setLogger,
8703
8797
  setMemoryEntitiesOp: () => setMemoryEntitiesOp,
8798
+ setMemoryVisibilityOp: () => setMemoryVisibilityOp,
8704
8799
  settingsStorageSchema: () => settingsStorageSchema,
8705
8800
  shouldChunkMessage: () => shouldChunkMessage,
8706
8801
  shouldRefreshTools: () => shouldRefreshTools,
@@ -15365,6 +15460,18 @@ __decorateClass([
15365
15460
  __decorateClass([
15366
15461
  (0, import_decorators3.field)("trust_tier")
15367
15462
  ], VaultMemory.prototype, "trustTier", 2);
15463
+ __decorateClass([
15464
+ (0, import_decorators3.field)("visibility")
15465
+ ], VaultMemory.prototype, "visibility", 2);
15466
+ __decorateClass([
15467
+ (0, import_decorators3.field)("twin_opt_in")
15468
+ ], VaultMemory.prototype, "twinOptIn", 2);
15469
+ __decorateClass([
15470
+ (0, import_decorators3.field)("published_at")
15471
+ ], VaultMemory.prototype, "publishedAt", 2);
15472
+ __decorateClass([
15473
+ (0, import_decorators3.field)("geohash")
15474
+ ], VaultMemory.prototype, "geohash", 2);
15368
15475
  __decorateClass([
15369
15476
  import_decorators3.readonly,
15370
15477
  (0, import_decorators3.date)("created_at")
@@ -16641,18 +16748,16 @@ function createAutoExtractor(options) {
16641
16748
  } catch {
16642
16749
  }
16643
16750
  };
16644
- const consolidateBaseUrl = options.consolidate?.baseUrl ?? options.extract.baseUrl;
16645
- const consolidateOptions = options.consolidate ? {
16646
- ...options.extract.apiKey !== void 0 && { apiKey: options.extract.apiKey },
16647
- ...options.extract.getToken !== void 0 && { getToken: options.extract.getToken },
16648
- ...consolidateBaseUrl !== void 0 && { baseUrl: consolidateBaseUrl },
16649
- ...options.consolidate.model !== void 0 && { model: options.consolidate.model },
16650
- ...options.consolidate.onFallback !== void 0 && {
16651
- onFallback: options.consolidate.onFallback
16652
- }
16653
- // PII redaction is inherited from `extract.piiRedaction` inside
16654
- // extractAndRetain (so direct callers are covered too), not copied here.
16655
- } : void 0;
16751
+ const subPassAuth = (baseUrlOverride) => {
16752
+ const baseUrl = baseUrlOverride ?? options.extract.baseUrl;
16753
+ return {
16754
+ ...options.extract.apiKey !== void 0 && { apiKey: options.extract.apiKey },
16755
+ ...options.extract.getToken !== void 0 && { getToken: options.extract.getToken },
16756
+ ...baseUrl !== void 0 && { baseUrl }
16757
+ };
16758
+ };
16759
+ const consolidateOptions = options.consolidate ? { ...options.consolidate, ...subPassAuth(options.consolidate.baseUrl) } : void 0;
16760
+ const injectionClassifierOptions = options.injectionClassifier ? { ...options.injectionClassifier, ...subPassAuth(options.injectionClassifier.baseUrl) } : void 0;
16656
16761
  if (options.retainCtx.vaultCtx.entityCtx && !options.entityCtx) {
16657
16762
  getLogger().warn(
16658
16763
  "[memory/extract] retainCtx.vaultCtx.entityCtx is set but extractor was created without `entityCtx` \u2014 W5 graph lane will receive no writes"
@@ -16706,6 +16811,9 @@ function createAutoExtractor(options) {
16706
16811
  ...options.scope !== void 0 && { scope: options.scope },
16707
16812
  ...options.folderId !== void 0 && { folderId: options.folderId },
16708
16813
  ...consolidateOptions !== void 0 && { consolidateOptions },
16814
+ ...injectionClassifierOptions !== void 0 && {
16815
+ injectionClassifier: injectionClassifierOptions
16816
+ },
16709
16817
  ...options.onCandidateFailed && {
16710
16818
  onCandidateFailed: (candidate, error) => options.onCandidateFailed?.({ candidate, error, conversationId })
16711
16819
  },
@@ -22476,7 +22584,7 @@ __decorateClass([
22476
22584
  ], VaultFolder.prototype, "context", 2);
22477
22585
 
22478
22586
  // src/lib/db/schema.ts
22479
- var SDK_SCHEMA_VERSION = 40;
22587
+ var SDK_SCHEMA_VERSION = 41;
22480
22588
  var sdkSchema = (0, import_watermelondb20.appSchema)({
22481
22589
  version: SDK_SCHEMA_VERSION,
22482
22590
  tables: [
@@ -22635,7 +22743,26 @@ var sdkSchema = (0, import_watermelondb20.appSchema)({
22635
22743
  // Tier-0 security (PR3) — "quarantined" when the write-time injection
22636
22744
  // screen flagged this fact, else null/"trusted". Indexed so the recall
22637
22745
  // choke point can default-exclude quarantined rows.
22638
- { name: "trust_tier", type: "string", isOptional: true, isIndexed: true }
22746
+ { name: "trust_tier", type: "string", isOptional: true, isIndexed: true },
22747
+ // People Nearby cross-user visibility axis — ORTHOGONAL to `scope`
22748
+ // (which partitions by MODEL access: private vs shared providers).
22749
+ // TWO tiers: 'private' (or null, or any unrecognised value —
22750
+ // grandfathered / fail-safe) = local-only; 'public' = embedding +
22751
+ // plaintext may be published (matching/profile/discovery/twin).
22752
+ // The server index is the authority for what IS published; this
22753
+ // column records the user's intent.
22754
+ { name: "visibility", type: "string", isOptional: true, isIndexed: true },
22755
+ // When true, the owner opted this memory into their own digital twin
22756
+ // even if it is otherwise private (twin-scoped upload only — never
22757
+ // indexed for matching, never displayed). Null/false = follows visibility.
22758
+ { name: "twin_opt_in", type: "boolean", isOptional: true },
22759
+ // Unix ms when visibility last became non-private. Null when private
22760
+ // (cleared on revoke) — the publish reconciler uses it to diff local
22761
+ // intent against the server index.
22762
+ { name: "published_at", type: "number", isOptional: true },
22763
+ // Reserved geo slot (coarse geohash) for landmark/Trail memories.
22764
+ // Unused at launch; populated by location-tagged memory sources.
22765
+ { name: "geohash", type: "string", isOptional: true }
22639
22766
  ]
22640
22767
  }),
22641
22768
  // Entity table — canonical names extracted from auto-extraction (W5).
@@ -23310,6 +23437,24 @@ var sdkMigrations = (0, import_migrations2.schemaMigrations)({
23310
23437
  ]
23311
23438
  })
23312
23439
  ]
23440
+ },
23441
+ // v40 -> v41: People Nearby visibility axis on memory_vault. Existing rows
23442
+ // keep visibility NULL — read as 'private' (nothing pre-existing is ever
23443
+ // published without an explicit user action; the consent posture requires
23444
+ // opt-in, never a retroactive default).
23445
+ {
23446
+ toVersion: 41,
23447
+ steps: [
23448
+ (0, import_migrations2.addColumns)({
23449
+ table: "memory_vault",
23450
+ columns: [
23451
+ { name: "visibility", type: "string", isOptional: true, isIndexed: true },
23452
+ { name: "twin_opt_in", type: "boolean", isOptional: true },
23453
+ { name: "published_at", type: "number", isOptional: true },
23454
+ { name: "geohash", type: "string", isOptional: true }
23455
+ ]
23456
+ })
23457
+ ]
23313
23458
  }
23314
23459
  ]
23315
23460
  });
@@ -33281,6 +33426,7 @@ function renderAnumaJsx(jsx3) {
33281
33426
  serializeJsx,
33282
33427
  setLogger,
33283
33428
  setMemoryEntitiesOp,
33429
+ setMemoryVisibilityOp,
33284
33430
  settingsStorageSchema,
33285
33431
  shouldChunkMessage,
33286
33432
  shouldRefreshTools,