agent-sanitizer 2.34.7 → 2.34.9

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.
package/src/output.mjs CHANGED
@@ -263,6 +263,19 @@ export const REDACTION_DOCTRINE =
263
263
  " (placeholders rehydrate only via Edit/Write on the owning file; other " +
264
264
  "write paths persist the placeholder text and lose the secret)";
265
265
 
266
+ /**
267
+ * The warning prose for a value the caller asked for and is not getting,
268
+ * because the redactor could not vet it for secrets.
269
+ *
270
+ * Exported so the hook layer composes the same sentence for the artifacts it
271
+ * withholds itself (the reveal sidecar) rather than restating the wording.
272
+ * @param {string} label what was withheld, as a noun phrase
273
+ * @returns {string}
274
+ */
275
+ export function withheldWarning(label) {
276
+ return `Withheld the ${label}: it could not be vetted for secrets`;
277
+ }
278
+
266
279
  // Layer 2/3 pre-gate and warning prose are shared with the root entry
267
280
  // (./index.mjs), which runs the same layers; re-exported here because both were
268
281
  // part of this module's public surface before they moved.
@@ -527,9 +540,7 @@ async function vetStageValue(text, redact, findings, label) {
527
540
  // A WARNING: the caller asked for this field and is not getting it, and the
528
541
  // reason is an unrunnable redactor — the same fault that fails `cleaned`
529
542
  // closed, just with a survivable remedy here.
530
- findings.push(
531
- warning(`Withheld the ${label}: it could not be vetted for secrets`),
532
- );
543
+ findings.push(warning(withheldWarning(label)));
533
544
  return undefined;
534
545
  }
535
546
  }
@@ -274,7 +274,7 @@ export const SECRET_HINT_EXT: RegExp;
274
274
  export const describeRemoved: typeof import("agent-sanitizer/output").describeRemoved;
275
275
  export const describeWarned: typeof import("agent-sanitizer/output").describeWarned;
276
276
  export const suppressToolOutput: typeof import("agent-sanitizer/output").suppressToolOutput;
277
- export const REVEAL_WITHHELD_WARNING: "Withheld the reveal sidecar: it could not be vetted for secrets";
277
+ export const REVEAL_WITHHELD_WARNING: string;
278
278
  export const COLLISION_WITHHELD_MESSAGE: "[WITHHELD \u2014 this field's name collided with another after sanitization]";
279
279
  export const ON_DISK_PLACEHOLDER_WARNING: string;
280
280
  /**
@@ -1,3 +1,13 @@
1
+ /**
2
+ * The warning prose for a value the caller asked for and is not getting,
3
+ * because the redactor could not vet it for secrets.
4
+ *
5
+ * Exported so the hook layer composes the same sentence for the artifacts it
6
+ * withholds itself (the reveal sidecar) rather than restating the wording.
7
+ * @param {string} label what was withheld, as a noun phrase
8
+ * @returns {string}
9
+ */
10
+ export function withheldWarning(label: string): string;
1
11
  /**
2
12
  * Delete each verbatim span in `spans` from `text`. The secure Layer-5
3
13
  * primitive: a filter can only ask for deletions, so this can never inject