@caupulican/pi-agent-core 0.90.0 → 0.90.2

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,10 +1,2 @@
1
- /**
2
- * Sanitize binary output for display/storage.
3
- * Removes characters that crash string-width or cause display issues:
4
- * - Control characters (except tab, newline, carriage return)
5
- * - Lone surrogates
6
- * - Unicode Format characters (crash string-width due to a bug)
7
- * - Characters with undefined code points
8
- */
9
1
  export declare function sanitizeBinaryOutput(str: string): string;
10
2
  //# sourceMappingURL=shell-output.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"shell-output.d.ts","sourceRoot":"","sources":["../../src/utils/shell-output.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CA+BxD"}
1
+ {"version":3,"file":"shell-output.d.ts","sourceRoot":"","sources":["../../src/utils/shell-output.ts"],"names":[],"mappings":"AAWA,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAgCxD"}
@@ -6,7 +6,10 @@
6
6
  * - Unicode Format characters (crash string-width due to a bug)
7
7
  * - Characters with undefined code points
8
8
  */
9
+ const UNSAFE_OUTPUT_CHARACTER_PATTERN = /[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f-\u009f\ud800-\udfff\ufff9-\ufffb]/u;
9
10
  export function sanitizeBinaryOutput(str) {
11
+ if (!UNSAFE_OUTPUT_CHARACTER_PATTERN.test(str))
12
+ return str;
10
13
  return Array.from(str)
11
14
  .filter((char) => {
12
15
  // Filter out characters that cause string-width to crash
@@ -1 +1 @@
1
- {"version":3,"file":"shell-output.js","sourceRoot":"","sources":["../../src/utils/shell-output.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,UAAU,oBAAoB,CAAC,GAAW;IAC/C,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC;SACpB,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE;QAChB,yDAAyD;QACzD,iBAAiB;QACjB,8BAA8B;QAC9B,oBAAoB;QACpB,kCAAkC;QAClC,0CAA0C;QAE1C,MAAM,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;QAEjC,mEAAmE;QACnE,IAAI,IAAI,KAAK,SAAS;YAAE,OAAO,KAAK,CAAC;QAErC,sCAAsC;QACtC,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,IAAI;YAAE,OAAO,IAAI,CAAC;QAEjE,sFAAsF;QACtF,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,KAAK,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,CAAC;YAAE,OAAO,KAAK,CAAC;QAElF,6FAA6F;QAC7F,yFAAyF;QACzF,IAAI,IAAI,IAAI,MAAM,IAAI,IAAI,IAAI,MAAM;YAAE,OAAO,KAAK,CAAC;QAEnD,uCAAuC;QACvC,IAAI,IAAI,IAAI,MAAM,IAAI,IAAI,IAAI,MAAM;YAAE,OAAO,KAAK,CAAC;QAEnD,OAAO,IAAI,CAAC;IACb,CAAC,CAAC;SACD,IAAI,CAAC,EAAE,CAAC,CAAC;AACZ,CAAC","sourcesContent":["/**\n * Sanitize binary output for display/storage.\n * Removes characters that crash string-width or cause display issues:\n * - Control characters (except tab, newline, carriage return)\n * - Lone surrogates\n * - Unicode Format characters (crash string-width due to a bug)\n * - Characters with undefined code points\n */\nexport function sanitizeBinaryOutput(str: string): string {\n\treturn Array.from(str)\n\t\t.filter((char) => {\n\t\t\t// Filter out characters that cause string-width to crash\n\t\t\t// This includes:\n\t\t\t// - Unicode format characters\n\t\t\t// - Lone surrogates\n\t\t\t// - Control chars except \\t \\n \\r\n\t\t\t// - Characters with undefined code points\n\n\t\t\tconst code = char.codePointAt(0);\n\n\t\t\t// Skip if code point is undefined (edge case with invalid strings)\n\t\t\tif (code === undefined) return false;\n\n\t\t\t// Allow tab, newline, carriage return\n\t\t\tif (code === 0x09 || code === 0x0a || code === 0x0d) return true;\n\n\t\t\t// Filter out control characters (0x00-0x1F, 0x7F, 0x80-0x9F; except 0x09, 0x0a, 0x0d)\n\t\t\tif (code <= 0x1f || code === 0x7f || (code >= 0x80 && code <= 0x9f)) return false;\n\n\t\t\t// Filter out lone surrogate code units. Valid surrogate pairs are emitted by Array.from as a\n\t\t\t// two-code-unit string whose code point is outside the surrogate range, so they survive.\n\t\t\tif (code >= 0xd800 && code <= 0xdfff) return false;\n\n\t\t\t// Filter out Unicode format characters\n\t\t\tif (code >= 0xfff9 && code <= 0xfffb) return false;\n\n\t\t\treturn true;\n\t\t})\n\t\t.join(\"\");\n}\n"]}
1
+ {"version":3,"file":"shell-output.js","sourceRoot":"","sources":["../../src/utils/shell-output.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,+BAA+B,GACpC,kFAAkF,CAAC;AAEpF,MAAM,UAAU,oBAAoB,CAAC,GAAW;IAC/C,IAAI,CAAC,+BAA+B,CAAC,IAAI,CAAC,GAAG,CAAC;QAAE,OAAO,GAAG,CAAC;IAC3D,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC;SACpB,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE;QAChB,yDAAyD;QACzD,iBAAiB;QACjB,8BAA8B;QAC9B,oBAAoB;QACpB,kCAAkC;QAClC,0CAA0C;QAE1C,MAAM,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;QAEjC,mEAAmE;QACnE,IAAI,IAAI,KAAK,SAAS;YAAE,OAAO,KAAK,CAAC;QAErC,sCAAsC;QACtC,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,IAAI;YAAE,OAAO,IAAI,CAAC;QAEjE,sFAAsF;QACtF,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,KAAK,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,CAAC;YAAE,OAAO,KAAK,CAAC;QAElF,6FAA6F;QAC7F,yFAAyF;QACzF,IAAI,IAAI,IAAI,MAAM,IAAI,IAAI,IAAI,MAAM;YAAE,OAAO,KAAK,CAAC;QAEnD,uCAAuC;QACvC,IAAI,IAAI,IAAI,MAAM,IAAI,IAAI,IAAI,MAAM;YAAE,OAAO,KAAK,CAAC;QAEnD,OAAO,IAAI,CAAC;IACb,CAAC,CAAC;SACD,IAAI,CAAC,EAAE,CAAC,CAAC;AACZ,CAAC","sourcesContent":["/**\n * Sanitize binary output for display/storage.\n * Removes characters that crash string-width or cause display issues:\n * - Control characters (except tab, newline, carriage return)\n * - Lone surrogates\n * - Unicode Format characters (crash string-width due to a bug)\n * - Characters with undefined code points\n */\nconst UNSAFE_OUTPUT_CHARACTER_PATTERN =\n\t/[\\u0000-\\u0008\\u000b\\u000c\\u000e-\\u001f\\u007f-\\u009f\\ud800-\\udfff\\ufff9-\\ufffb]/u;\n\nexport function sanitizeBinaryOutput(str: string): string {\n\tif (!UNSAFE_OUTPUT_CHARACTER_PATTERN.test(str)) return str;\n\treturn Array.from(str)\n\t\t.filter((char) => {\n\t\t\t// Filter out characters that cause string-width to crash\n\t\t\t// This includes:\n\t\t\t// - Unicode format characters\n\t\t\t// - Lone surrogates\n\t\t\t// - Control chars except \\t \\n \\r\n\t\t\t// - Characters with undefined code points\n\n\t\t\tconst code = char.codePointAt(0);\n\n\t\t\t// Skip if code point is undefined (edge case with invalid strings)\n\t\t\tif (code === undefined) return false;\n\n\t\t\t// Allow tab, newline, carriage return\n\t\t\tif (code === 0x09 || code === 0x0a || code === 0x0d) return true;\n\n\t\t\t// Filter out control characters (0x00-0x1F, 0x7F, 0x80-0x9F; except 0x09, 0x0a, 0x0d)\n\t\t\tif (code <= 0x1f || code === 0x7f || (code >= 0x80 && code <= 0x9f)) return false;\n\n\t\t\t// Filter out lone surrogate code units. Valid surrogate pairs are emitted by Array.from as a\n\t\t\t// two-code-unit string whose code point is outside the surrogate range, so they survive.\n\t\t\tif (code >= 0xd800 && code <= 0xdfff) return false;\n\n\t\t\t// Filter out Unicode format characters\n\t\t\tif (code >= 0xfff9 && code <= 0xfffb) return false;\n\n\t\t\treturn true;\n\t\t})\n\t\t.join(\"\");\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@caupulican/pi-agent-core",
3
- "version": "0.90.0",
3
+ "version": "0.90.2",
4
4
  "description": "General-purpose agent with transport abstraction, state management, and attachment support",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -121,7 +121,7 @@
121
121
  "prepublishOnly": "npm run clean && npm run build"
122
122
  },
123
123
  "dependencies": {
124
- "@caupulican/pi-ai": "^0.90.0",
124
+ "@caupulican/pi-ai": "^0.90.2",
125
125
  "ignore": "7.0.5",
126
126
  "typebox": "1.1.38",
127
127
  "yaml": "2.9.0"