@anuma/sdk 3.13.2 → 4.0.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.
@@ -16938,7 +16938,8 @@ function configMatches(a, b) {
16938
16938
  return a.redacted === b.redacted && a.facetsSignature === b.facetsSignature && (a.reviewedMemoryIdsSignature ?? "") === b.reviewedMemoryIdsSignature && a.scopes.length === b.scopes.length && a.scopes.every((s, i) => s === b.scopes[i]);
16939
16939
  }
16940
16940
  function reviewedMemoryIdsSignature(ids) {
16941
- if (ids === void 0 || ids.length === 0) return "";
16941
+ if (ids === void 0) return "";
16942
+ if (ids.length === 0) return "\0gated-empty";
16942
16943
  return [...new Set(ids)].sort().join("\n");
16943
16944
  }
16944
16945
  function facetsSignature(facets) {
@@ -17048,7 +17049,16 @@ async function synthesizeFacet(facet, ctx, options, prior) {
17048
17049
  const factTypeWeights = { ...DEFAULT_PROFILE_FACT_TYPE_WEIGHTS, ...options.factTypeWeights };
17049
17050
  const proofCountAlpha = options.proofCountAlpha ?? DEFAULT_PROFILE_PROOF_ALPHA;
17050
17051
  const reviewed = options.reviewedMemoryIds;
17051
- const hasReviewGate = reviewed !== void 0 && reviewed.length > 0;
17052
+ const hasReviewGate = reviewed !== void 0;
17053
+ if (hasReviewGate && reviewed.length === 0) {
17054
+ return {
17055
+ key: facet.key,
17056
+ label: facet.label,
17057
+ text: "",
17058
+ sourceMemoryIds: [],
17059
+ generatedAt: Date.now()
17060
+ };
17061
+ }
17052
17062
  const recalled = await recall(facet.query, ctx, {
17053
17063
  scopes,
17054
17064
  limit: hasReviewGate ? RECALL_MAX_LIMIT : limit,
@@ -7710,10 +7710,20 @@ interface SynthesizeProfileOptions extends PortalLlmAuth {
7710
7710
  */
7711
7711
  proofCountAlpha?: number;
7712
7712
  /**
7713
- * When non-empty, intersect each facet's recalled evidence with this id set
7714
- * before the LLM runs (publish-review gate). Empty intersection → empty
7715
- * section (legitimate no-evidence), not a stale fallback. Omit / empty →
7716
- * no gate.
7713
+ * Publish-review gate: when SUPPLIED, each facet's recalled evidence is
7714
+ * intersected with this id set before the LLM runs, so synthesis can only draw
7715
+ * on memories the user approved for publication. Empty intersection → empty
7716
+ * section (legitimate no-evidence), not a stale fallback.
7717
+ *
7718
+ * Pass the user's published set (e.g. `getAllVaultMemoriesOp(ctx, { visibility:
7719
+ * ["public"] })`) to keep a published profile derivable only from published
7720
+ * memories — People Nearby's two-tier model treats `private` memories as never
7721
+ * leaving the device, and a summary derived from them is a derivative that does.
7722
+ *
7723
+ * `[]` means "nothing approved" and gates everything OUT (no recall, no LLM
7724
+ * call, empty sections). **Omitting the field is the only way to run ungated**
7725
+ * — that asymmetry is deliberate, so a caller computing a published set can
7726
+ * never accidentally disable the gate by finding it empty.
7717
7727
  */
7718
7728
  reviewedMemoryIds?: readonly string[];
7719
7729
  }
@@ -7710,10 +7710,20 @@ interface SynthesizeProfileOptions extends PortalLlmAuth {
7710
7710
  */
7711
7711
  proofCountAlpha?: number;
7712
7712
  /**
7713
- * When non-empty, intersect each facet's recalled evidence with this id set
7714
- * before the LLM runs (publish-review gate). Empty intersection → empty
7715
- * section (legitimate no-evidence), not a stale fallback. Omit / empty →
7716
- * no gate.
7713
+ * Publish-review gate: when SUPPLIED, each facet's recalled evidence is
7714
+ * intersected with this id set before the LLM runs, so synthesis can only draw
7715
+ * on memories the user approved for publication. Empty intersection → empty
7716
+ * section (legitimate no-evidence), not a stale fallback.
7717
+ *
7718
+ * Pass the user's published set (e.g. `getAllVaultMemoriesOp(ctx, { visibility:
7719
+ * ["public"] })`) to keep a published profile derivable only from published
7720
+ * memories — People Nearby's two-tier model treats `private` memories as never
7721
+ * leaving the device, and a summary derived from them is a derivative that does.
7722
+ *
7723
+ * `[]` means "nothing approved" and gates everything OUT (no recall, no LLM
7724
+ * call, empty sections). **Omitting the field is the only way to run ungated**
7725
+ * — that asymmetry is deliberate, so a caller computing a published set can
7726
+ * never accidentally disable the gate by finding it empty.
7717
7727
  */
7718
7728
  reviewedMemoryIds?: readonly string[];
7719
7729
  }
@@ -8219,7 +8219,8 @@ function configMatches(a, b) {
8219
8219
  return a.redacted === b.redacted && a.facetsSignature === b.facetsSignature && (a.reviewedMemoryIdsSignature ?? "") === b.reviewedMemoryIdsSignature && a.scopes.length === b.scopes.length && a.scopes.every((s, i) => s === b.scopes[i]);
8220
8220
  }
8221
8221
  function reviewedMemoryIdsSignature(ids) {
8222
- if (ids === void 0 || ids.length === 0) return "";
8222
+ if (ids === void 0) return "";
8223
+ if (ids.length === 0) return "\0gated-empty";
8223
8224
  return [...new Set(ids)].sort().join("\n");
8224
8225
  }
8225
8226
  function facetsSignature(facets) {
@@ -8329,7 +8330,16 @@ async function synthesizeFacet(facet, ctx, options, prior) {
8329
8330
  const factTypeWeights = { ...DEFAULT_PROFILE_FACT_TYPE_WEIGHTS, ...options.factTypeWeights };
8330
8331
  const proofCountAlpha = options.proofCountAlpha ?? DEFAULT_PROFILE_PROOF_ALPHA;
8331
8332
  const reviewed = options.reviewedMemoryIds;
8332
- const hasReviewGate = reviewed !== void 0 && reviewed.length > 0;
8333
+ const hasReviewGate = reviewed !== void 0;
8334
+ if (hasReviewGate && reviewed.length === 0) {
8335
+ return {
8336
+ key: facet.key,
8337
+ label: facet.label,
8338
+ text: "",
8339
+ sourceMemoryIds: [],
8340
+ generatedAt: Date.now()
8341
+ };
8342
+ }
8333
8343
  const recalled = await recall(facet.query, ctx, {
8334
8344
  scopes,
8335
8345
  limit: hasReviewGate ? RECALL_MAX_LIMIT : limit,
@@ -18265,7 +18265,8 @@ function configMatches(a, b) {
18265
18265
  return a.redacted === b.redacted && a.facetsSignature === b.facetsSignature && (a.reviewedMemoryIdsSignature ?? "") === b.reviewedMemoryIdsSignature && a.scopes.length === b.scopes.length && a.scopes.every((s, i) => s === b.scopes[i]);
18266
18266
  }
18267
18267
  function reviewedMemoryIdsSignature(ids) {
18268
- if (ids === void 0 || ids.length === 0) return "";
18268
+ if (ids === void 0) return "";
18269
+ if (ids.length === 0) return "\0gated-empty";
18269
18270
  return [...new Set(ids)].sort().join("\n");
18270
18271
  }
18271
18272
  function facetsSignature(facets) {
@@ -18375,7 +18376,16 @@ async function synthesizeFacet(facet, ctx, options, prior) {
18375
18376
  const factTypeWeights = { ...DEFAULT_PROFILE_FACT_TYPE_WEIGHTS, ...options.factTypeWeights };
18376
18377
  const proofCountAlpha = options.proofCountAlpha ?? DEFAULT_PROFILE_PROOF_ALPHA;
18377
18378
  const reviewed = options.reviewedMemoryIds;
18378
- const hasReviewGate = reviewed !== void 0 && reviewed.length > 0;
18379
+ const hasReviewGate = reviewed !== void 0;
18380
+ if (hasReviewGate && reviewed.length === 0) {
18381
+ return {
18382
+ key: facet.key,
18383
+ label: facet.label,
18384
+ text: "",
18385
+ sourceMemoryIds: [],
18386
+ generatedAt: Date.now()
18387
+ };
18388
+ }
18379
18389
  const recalled = await recall(facet.query, ctx, {
18380
18390
  scopes,
18381
18391
  limit: hasReviewGate ? RECALL_MAX_LIMIT : limit,
@@ -8949,10 +8949,20 @@ interface SynthesizeProfileOptions extends PortalLlmAuth {
8949
8949
  */
8950
8950
  proofCountAlpha?: number;
8951
8951
  /**
8952
- * When non-empty, intersect each facet's recalled evidence with this id set
8953
- * before the LLM runs (publish-review gate). Empty intersection → empty
8954
- * section (legitimate no-evidence), not a stale fallback. Omit / empty →
8955
- * no gate.
8952
+ * Publish-review gate: when SUPPLIED, each facet's recalled evidence is
8953
+ * intersected with this id set before the LLM runs, so synthesis can only draw
8954
+ * on memories the user approved for publication. Empty intersection → empty
8955
+ * section (legitimate no-evidence), not a stale fallback.
8956
+ *
8957
+ * Pass the user's published set (e.g. `getAllVaultMemoriesOp(ctx, { visibility:
8958
+ * ["public"] })`) to keep a published profile derivable only from published
8959
+ * memories — People Nearby's two-tier model treats `private` memories as never
8960
+ * leaving the device, and a summary derived from them is a derivative that does.
8961
+ *
8962
+ * `[]` means "nothing approved" and gates everything OUT (no recall, no LLM
8963
+ * call, empty sections). **Omitting the field is the only way to run ungated**
8964
+ * — that asymmetry is deliberate, so a caller computing a published set can
8965
+ * never accidentally disable the gate by finding it empty.
8956
8966
  */
8957
8967
  reviewedMemoryIds?: readonly string[];
8958
8968
  }
@@ -8949,10 +8949,20 @@ interface SynthesizeProfileOptions extends PortalLlmAuth {
8949
8949
  */
8950
8950
  proofCountAlpha?: number;
8951
8951
  /**
8952
- * When non-empty, intersect each facet's recalled evidence with this id set
8953
- * before the LLM runs (publish-review gate). Empty intersection → empty
8954
- * section (legitimate no-evidence), not a stale fallback. Omit / empty →
8955
- * no gate.
8952
+ * Publish-review gate: when SUPPLIED, each facet's recalled evidence is
8953
+ * intersected with this id set before the LLM runs, so synthesis can only draw
8954
+ * on memories the user approved for publication. Empty intersection → empty
8955
+ * section (legitimate no-evidence), not a stale fallback.
8956
+ *
8957
+ * Pass the user's published set (e.g. `getAllVaultMemoriesOp(ctx, { visibility:
8958
+ * ["public"] })`) to keep a published profile derivable only from published
8959
+ * memories — People Nearby's two-tier model treats `private` memories as never
8960
+ * leaving the device, and a summary derived from them is a derivative that does.
8961
+ *
8962
+ * `[]` means "nothing approved" and gates everything OUT (no recall, no LLM
8963
+ * call, empty sections). **Omitting the field is the only way to run ungated**
8964
+ * — that asymmetry is deliberate, so a caller computing a published set can
8965
+ * never accidentally disable the gate by finding it empty.
8956
8966
  */
8957
8967
  reviewedMemoryIds?: readonly string[];
8958
8968
  }
@@ -9036,7 +9036,8 @@ function configMatches(a, b) {
9036
9036
  return a.redacted === b.redacted && a.facetsSignature === b.facetsSignature && (a.reviewedMemoryIdsSignature ?? "") === b.reviewedMemoryIdsSignature && a.scopes.length === b.scopes.length && a.scopes.every((s, i) => s === b.scopes[i]);
9037
9037
  }
9038
9038
  function reviewedMemoryIdsSignature(ids) {
9039
- if (ids === void 0 || ids.length === 0) return "";
9039
+ if (ids === void 0) return "";
9040
+ if (ids.length === 0) return "\0gated-empty";
9040
9041
  return [...new Set(ids)].sort().join("\n");
9041
9042
  }
9042
9043
  function facetsSignature(facets) {
@@ -9146,7 +9147,16 @@ async function synthesizeFacet(facet, ctx, options, prior) {
9146
9147
  const factTypeWeights = { ...DEFAULT_PROFILE_FACT_TYPE_WEIGHTS, ...options.factTypeWeights };
9147
9148
  const proofCountAlpha = options.proofCountAlpha ?? DEFAULT_PROFILE_PROOF_ALPHA;
9148
9149
  const reviewed = options.reviewedMemoryIds;
9149
- const hasReviewGate = reviewed !== void 0 && reviewed.length > 0;
9150
+ const hasReviewGate = reviewed !== void 0;
9151
+ if (hasReviewGate && reviewed.length === 0) {
9152
+ return {
9153
+ key: facet.key,
9154
+ label: facet.label,
9155
+ text: "",
9156
+ sourceMemoryIds: [],
9157
+ generatedAt: Date.now()
9158
+ };
9159
+ }
9150
9160
  const recalled = await recall(facet.query, ctx, {
9151
9161
  scopes,
9152
9162
  limit: hasReviewGate ? RECALL_MAX_LIMIT : limit,
@@ -29956,7 +29956,8 @@ function configMatches(a, b) {
29956
29956
  return a.redacted === b.redacted && a.facetsSignature === b.facetsSignature && (a.reviewedMemoryIdsSignature ?? "") === b.reviewedMemoryIdsSignature && a.scopes.length === b.scopes.length && a.scopes.every((s, i) => s === b.scopes[i]);
29957
29957
  }
29958
29958
  function reviewedMemoryIdsSignature(ids) {
29959
- if (ids === void 0 || ids.length === 0) return "";
29959
+ if (ids === void 0) return "";
29960
+ if (ids.length === 0) return "\0gated-empty";
29960
29961
  return [...new Set(ids)].sort().join("\n");
29961
29962
  }
29962
29963
  function facetsSignature(facets) {
@@ -30066,7 +30067,16 @@ async function synthesizeFacet(facet, ctx, options, prior) {
30066
30067
  const factTypeWeights = { ...DEFAULT_PROFILE_FACT_TYPE_WEIGHTS, ...options.factTypeWeights };
30067
30068
  const proofCountAlpha = options.proofCountAlpha ?? DEFAULT_PROFILE_PROOF_ALPHA;
30068
30069
  const reviewed = options.reviewedMemoryIds;
30069
- const hasReviewGate = reviewed !== void 0 && reviewed.length > 0;
30070
+ const hasReviewGate = reviewed !== void 0;
30071
+ if (hasReviewGate && reviewed.length === 0) {
30072
+ return {
30073
+ key: facet.key,
30074
+ label: facet.label,
30075
+ text: "",
30076
+ sourceMemoryIds: [],
30077
+ generatedAt: Date.now()
30078
+ };
30079
+ }
30070
30080
  const recalled = await recall(facet.query, ctx, {
30071
30081
  scopes,
30072
30082
  limit: hasReviewGate ? RECALL_MAX_LIMIT : limit,
@@ -8356,10 +8356,20 @@ interface SynthesizeProfileOptions extends PortalLlmAuth {
8356
8356
  */
8357
8357
  proofCountAlpha?: number;
8358
8358
  /**
8359
- * When non-empty, intersect each facet's recalled evidence with this id set
8360
- * before the LLM runs (publish-review gate). Empty intersection → empty
8361
- * section (legitimate no-evidence), not a stale fallback. Omit / empty →
8362
- * no gate.
8359
+ * Publish-review gate: when SUPPLIED, each facet's recalled evidence is
8360
+ * intersected with this id set before the LLM runs, so synthesis can only draw
8361
+ * on memories the user approved for publication. Empty intersection → empty
8362
+ * section (legitimate no-evidence), not a stale fallback.
8363
+ *
8364
+ * Pass the user's published set (e.g. `getAllVaultMemoriesOp(ctx, { visibility:
8365
+ * ["public"] })`) to keep a published profile derivable only from published
8366
+ * memories — People Nearby's two-tier model treats `private` memories as never
8367
+ * leaving the device, and a summary derived from them is a derivative that does.
8368
+ *
8369
+ * `[]` means "nothing approved" and gates everything OUT (no recall, no LLM
8370
+ * call, empty sections). **Omitting the field is the only way to run ungated**
8371
+ * — that asymmetry is deliberate, so a caller computing a published set can
8372
+ * never accidentally disable the gate by finding it empty.
8363
8373
  */
8364
8374
  reviewedMemoryIds?: readonly string[];
8365
8375
  }
@@ -8356,10 +8356,20 @@ interface SynthesizeProfileOptions extends PortalLlmAuth {
8356
8356
  */
8357
8357
  proofCountAlpha?: number;
8358
8358
  /**
8359
- * When non-empty, intersect each facet's recalled evidence with this id set
8360
- * before the LLM runs (publish-review gate). Empty intersection → empty
8361
- * section (legitimate no-evidence), not a stale fallback. Omit / empty →
8362
- * no gate.
8359
+ * Publish-review gate: when SUPPLIED, each facet's recalled evidence is
8360
+ * intersected with this id set before the LLM runs, so synthesis can only draw
8361
+ * on memories the user approved for publication. Empty intersection → empty
8362
+ * section (legitimate no-evidence), not a stale fallback.
8363
+ *
8364
+ * Pass the user's published set (e.g. `getAllVaultMemoriesOp(ctx, { visibility:
8365
+ * ["public"] })`) to keep a published profile derivable only from published
8366
+ * memories — People Nearby's two-tier model treats `private` memories as never
8367
+ * leaving the device, and a summary derived from them is a derivative that does.
8368
+ *
8369
+ * `[]` means "nothing approved" and gates everything OUT (no recall, no LLM
8370
+ * call, empty sections). **Omitting the field is the only way to run ungated**
8371
+ * — that asymmetry is deliberate, so a caller computing a published set can
8372
+ * never accidentally disable the gate by finding it empty.
8363
8373
  */
8364
8374
  reviewedMemoryIds?: readonly string[];
8365
8375
  }
@@ -6991,7 +6991,8 @@ function configMatches(a, b) {
6991
6991
  return a.redacted === b.redacted && a.facetsSignature === b.facetsSignature && (a.reviewedMemoryIdsSignature ?? "") === b.reviewedMemoryIdsSignature && a.scopes.length === b.scopes.length && a.scopes.every((s, i) => s === b.scopes[i]);
6992
6992
  }
6993
6993
  function reviewedMemoryIdsSignature(ids) {
6994
- if (ids === void 0 || ids.length === 0) return "";
6994
+ if (ids === void 0) return "";
6995
+ if (ids.length === 0) return "\0gated-empty";
6995
6996
  return [...new Set(ids)].sort().join("\n");
6996
6997
  }
6997
6998
  function facetsSignature(facets) {
@@ -7101,7 +7102,16 @@ async function synthesizeFacet(facet, ctx, options, prior) {
7101
7102
  const factTypeWeights = { ...DEFAULT_PROFILE_FACT_TYPE_WEIGHTS, ...options.factTypeWeights };
7102
7103
  const proofCountAlpha = options.proofCountAlpha ?? DEFAULT_PROFILE_PROOF_ALPHA;
7103
7104
  const reviewed = options.reviewedMemoryIds;
7104
- const hasReviewGate = reviewed !== void 0 && reviewed.length > 0;
7105
+ const hasReviewGate = reviewed !== void 0;
7106
+ if (hasReviewGate && reviewed.length === 0) {
7107
+ return {
7108
+ key: facet.key,
7109
+ label: facet.label,
7110
+ text: "",
7111
+ sourceMemoryIds: [],
7112
+ generatedAt: Date.now()
7113
+ };
7114
+ }
7105
7115
  const recalled = await recall(facet.query, ctx, {
7106
7116
  scopes,
7107
7117
  limit: hasReviewGate ? RECALL_MAX_LIMIT : limit,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anuma/sdk",
3
- "version": "3.13.2",
3
+ "version": "4.0.0",
4
4
  "description": "",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.mjs",