@cortexkit/pi-magic-context 0.27.0 → 0.27.1

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.
Files changed (2) hide show
  1. package/dist/index.js +9 -3
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -176728,6 +176728,12 @@ function redactionTypeForKey(key) {
176728
176728
  const suffix = normalized.split(".").filter(Boolean).at(-1) ?? normalized;
176729
176729
  return suffix || "secret";
176730
176730
  }
176731
+ function isNonSecretScalarValue(value) {
176732
+ const v = value.trim();
176733
+ if (v === "true" || v === "false" || v === "null" || v === "undefined")
176734
+ return true;
176735
+ return /^[+-]?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?$/.test(v);
176736
+ }
176731
176737
  var SECRET_QUALIFIERS = new Set([
176732
176738
  "api",
176733
176739
  "access",
@@ -176807,11 +176813,11 @@ var SECRET_TEXT_PATTERNS = [
176807
176813
  },
176808
176814
  {
176809
176815
  pattern: /(["'])([^"']*(?:key|token|secret|password|auth|bearer|credential)[^"']*)\1(\s*:\s*)(["'])([^"']*)\4/gi,
176810
- replacement: (_full, quote, key, separator, valueQuote) => `${quote}${key}${quote}${separator}${valueQuote}<REDACTED:${redactionTypeForKey(key)}>${valueQuote}`
176816
+ replacement: (full, quote, key, separator, valueQuote, value) => isNonSecretScalarValue(value) ? full : `${quote}${key}${quote}${separator}${valueQuote}<REDACTED:${redactionTypeForKey(key)}>${valueQuote}`
176811
176817
  },
176812
176818
  {
176813
176819
  pattern: /\b([A-Za-z0-9_.-]*(?:key|token|secret|password|auth|bearer|credential)[A-Za-z0-9_.-]*)\s*=\s*([^\s'"`]+)/gi,
176814
- replacement: (_full, key) => `${key}=<REDACTED:${redactionTypeForKey(key)}>`
176820
+ replacement: (full, key, value) => isNonSecretScalarValue(value) ? full : `${key}=<REDACTED:${redactionTypeForKey(key)}>`
176815
176821
  }
176816
176822
  ];
176817
176823
  function redactSecretText(value) {
@@ -199294,7 +199300,7 @@ function formatThresholdPercent(value) {
199294
199300
  // package.json
199295
199301
  var package_default = {
199296
199302
  name: "@cortexkit/pi-magic-context",
199297
- version: "0.27.0",
199303
+ version: "0.27.1",
199298
199304
  type: "module",
199299
199305
  description: "Pi coding agent extension for Magic Context — cross-session memory and context management",
199300
199306
  main: "dist/index.js",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cortexkit/pi-magic-context",
3
- "version": "0.27.0",
3
+ "version": "0.27.1",
4
4
  "type": "module",
5
5
  "description": "Pi coding agent extension for Magic Context — cross-session memory and context management",
6
6
  "main": "dist/index.js",