@anuma/sdk 10.2.1 → 10.2.3

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.
@@ -109,6 +109,7 @@ function isWordChar(ch) {
109
109
  }
110
110
  var PiiRedactor = class {
111
111
  constructor(options = {}) {
112
+ this.disposed = false;
112
113
  /** Maps original PII value → placeholder tag. */
113
114
  this.valueToPlaceholder = /* @__PURE__ */ new Map();
114
115
  /** Maps placeholder tag → original PII value (reverse lookup for de-anonymization). */
@@ -183,6 +184,7 @@ var PiiRedactor = class {
183
184
  * The same value always gets the same placeholder within a redactor instance.
184
185
  */
185
186
  getPlaceholder(category, value) {
187
+ if (this.disposed) throw new Error("PII redactor session ended");
186
188
  const normalizedValue = value.trim();
187
189
  const existing = this.valueToPlaceholder.get(normalizedValue);
188
190
  if (existing) return existing;
@@ -558,6 +560,11 @@ var PiiRedactor = class {
558
560
  this.warnedNonText = false;
559
561
  this.warnedNerFailure = false;
560
562
  }
563
+ /** Clear the mappings and prevent new reversible mappings. */
564
+ dispose() {
565
+ this.disposed = true;
566
+ this.clear();
567
+ }
561
568
  };
562
569
  function isPiiRedactor(value) {
563
570
  return typeof value === "object" && value !== null && typeof value.redactMessages === "function" && typeof value.deAnonymize === "function";
@@ -4,7 +4,7 @@ import {
4
4
  notifyConsolidationFallback,
5
5
  requiresResponsesTransport,
6
6
  resolvePiiRedactor
7
- } from "./chunk-QEROZ4VH.mjs";
7
+ } from "./chunk-QK62YWBH.mjs";
8
8
  import "./chunk-3RPGXXPZ.mjs";
9
9
 
10
10
  // src/lib/memory/consolidate.ts
@@ -15036,6 +15036,7 @@ var init_redactor = __esm({
15036
15036
  init_patterns();
15037
15037
  PiiRedactor = class {
15038
15038
  constructor(options = {}) {
15039
+ this.disposed = false;
15039
15040
  /** Maps original PII value → placeholder tag. */
15040
15041
  this.valueToPlaceholder = /* @__PURE__ */ new Map();
15041
15042
  /** Maps placeholder tag → original PII value (reverse lookup for de-anonymization). */
@@ -15110,6 +15111,7 @@ var init_redactor = __esm({
15110
15111
  * The same value always gets the same placeholder within a redactor instance.
15111
15112
  */
15112
15113
  getPlaceholder(category, value) {
15114
+ if (this.disposed) throw new Error("PII redactor session ended");
15113
15115
  const normalizedValue = value.trim();
15114
15116
  const existing = this.valueToPlaceholder.get(normalizedValue);
15115
15117
  if (existing) return existing;
@@ -15485,6 +15487,11 @@ var init_redactor = __esm({
15485
15487
  this.warnedNonText = false;
15486
15488
  this.warnedNerFailure = false;
15487
15489
  }
15490
+ /** Clear the mappings and prevent new reversible mappings. */
15491
+ dispose() {
15492
+ this.disposed = true;
15493
+ this.clear();
15494
+ }
15488
15495
  };
15489
15496
  }
15490
15497
  });
@@ -1476,6 +1476,7 @@ interface MessageRedactionResult {
1476
1476
  * same email address throughout the conversation.
1477
1477
  */
1478
1478
  declare class PiiRedactor {
1479
+ private disposed;
1479
1480
  /** Maps original PII value → placeholder tag. */
1480
1481
  private valueToPlaceholder;
1481
1482
  /** Maps placeholder tag → original PII value (reverse lookup for de-anonymization). */
@@ -1675,6 +1676,8 @@ declare class PiiRedactor {
1675
1676
  * Reset all state. Useful for testing or when starting a fresh conversation.
1676
1677
  */
1677
1678
  clear(): void;
1679
+ /** Clear the mappings and prevent new reversible mappings. */
1680
+ dispose(): void;
1678
1681
  }
1679
1682
 
1680
1683
  type LlmTokenUsage = {
@@ -1476,6 +1476,7 @@ interface MessageRedactionResult {
1476
1476
  * same email address throughout the conversation.
1477
1477
  */
1478
1478
  declare class PiiRedactor {
1479
+ private disposed;
1479
1480
  /** Maps original PII value → placeholder tag. */
1480
1481
  private valueToPlaceholder;
1481
1482
  /** Maps placeholder tag → original PII value (reverse lookup for de-anonymization). */
@@ -1675,6 +1676,8 @@ declare class PiiRedactor {
1675
1676
  * Reset all state. Useful for testing or when starting a fresh conversation.
1676
1677
  */
1677
1678
  clear(): void;
1679
+ /** Clear the mappings and prevent new reversible mappings. */
1680
+ dispose(): void;
1678
1681
  }
1679
1682
 
1680
1683
  type LlmTokenUsage = {
@@ -13,7 +13,7 @@ import {
13
13
  taskTypeHeader,
14
14
  validateEndpointOverride,
15
15
  withInternalFlowMarker
16
- } from "./chunk-QEROZ4VH.mjs";
16
+ } from "./chunk-QK62YWBH.mjs";
17
17
  import {
18
18
  BASE_URL,
19
19
  __commonJS,
@@ -31740,7 +31740,7 @@ async function tryConsolidate(trimmed, ctx, options, prepared) {
31740
31740
  content: m.content,
31741
31741
  similarity: m.similarity
31742
31742
  }));
31743
- const { consolidateMemory: doConsolidate } = await import("./consolidate-PYED62LW.mjs");
31743
+ const { consolidateMemory: doConsolidate } = await import("./consolidate-NW4UVA6T.mjs");
31744
31744
  const decision = await doConsolidate(trimmed, candidates, consolidateOptions);
31745
31745
  if (decision.action === "create") return decision.fallbackReason ? null : { create: true };
31746
31746
  if (decision.action === "supersede" && decision.content) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anuma/sdk",
3
- "version": "10.2.1",
3
+ "version": "10.2.3",
4
4
  "description": "",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.mjs",