@ai-ecoverse/mcpcat 0.17.2 → 0.17.4

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.
@@ -9118,6 +9118,9 @@ var CONTROL_RE = /[\u0000-\u0008\u000b-\u001f\u007f-\u009f]/g;
9118
9118
  function sanitizeTerminal(text) {
9119
9119
  return text.replace(CONTROL_RE, (c) => `\\x${c.charCodeAt(0).toString(16).padStart(2, "0")}`);
9120
9120
  }
9121
+ function sanitizeJson(json) {
9122
+ return json.replace(CONTROL_RE, (c) => `\\u${c.charCodeAt(0).toString(16).padStart(4, "0")}`);
9123
+ }
9121
9124
 
9122
9125
  // src/client/elicit.ts
9123
9126
  function readLine(platform2) {
@@ -11018,8 +11021,8 @@ async function runFromDiscovery(platform2, args2) {
11018
11021
  }
11019
11022
  const result = parseEvents(text);
11020
11023
  if ("error" in result) {
11021
- await platform2.write(2, `mcpcat add --from-discovery: ${result.error}
11022
- `);
11024
+ await platform2.write(2, sanitizeTerminal(`mcpcat add --from-discovery: ${result.error}
11025
+ `));
11023
11026
  return result.code;
11024
11027
  }
11025
11028
  resetIdCounter();
@@ -11079,8 +11082,8 @@ async function runAddCandidate(platform2, name, candidateId2, configFile) {
11079
11082
  const { replaced } = await addServer(platform2.fs, path, name, config);
11080
11083
  for (const t of candidate.trust) {
11081
11084
  if (t.type.includes("mismatch")) {
11082
- await platform2.write(2, `mcpcat add: warning: ${t.type}: ${t.detail}
11083
- `);
11085
+ await platform2.write(2, sanitizeTerminal(`mcpcat add: warning: ${t.type}: ${t.detail}
11086
+ `));
11084
11087
  }
11085
11088
  }
11086
11089
  await platform2.write(1, `${replaced ? "replaced" : "added"} ${name} in ${path}
@@ -14221,7 +14224,7 @@ async function jerkLogin(platform2, target, resolved, args2) {
14221
14224
  return 0;
14222
14225
  }
14223
14226
  if (errText.trim()) {
14224
- await platform2.write(2, errText);
14227
+ await platform2.write(2, sanitizeTerminal(errText));
14225
14228
  }
14226
14229
  if (result.status === JERK_EXIT_SIGN_IN) return 4;
14227
14230
  return result.status;
@@ -16532,14 +16535,14 @@ async function handleInputRequired(platform2, conn, err, respondData, json) {
16532
16535
  const parsed2 = JSON.parse(err.requestJson);
16533
16536
  const inputReq = parseInputRequest(parsed2.result ?? parsed2);
16534
16537
  if (!inputReq) {
16535
- await platform2.write(2, `${err.requestJson}
16538
+ await platform2.write(2, `${sanitizeJson(err.requestJson)}
16536
16539
  `);
16537
16540
  return EXIT_INPUT_REQUIRED;
16538
16541
  }
16539
16542
  const isTty = platform2.kind === "host" && platform2.isatty(0) && platform2.isatty(2);
16540
16543
  const elicitResult = await handleElicitation(platform2, inputReq, isTty, respondData);
16541
16544
  if ("exitCode" in elicitResult) {
16542
- await platform2.write(2, `${err.requestJson}
16545
+ await platform2.write(2, `${sanitizeJson(err.requestJson)}
16543
16546
  `);
16544
16547
  return EXIT_INPUT_REQUIRED;
16545
16548
  }
@@ -17011,5 +17014,5 @@ try {
17011
17014
  });
17012
17015
  } catch {
17013
17016
  }
17014
- var code = await run(platform, "0.17.2", args);
17017
+ var code = await run(platform, "0.17.4", args);
17015
17018
  process.exit(code);
@@ -8739,6 +8739,9 @@ var CONTROL_RE = /[\u0000-\u0008\u000b-\u001f\u007f-\u009f]/g;
8739
8739
  function sanitizeTerminal(text) {
8740
8740
  return text.replace(CONTROL_RE, (c) => `\\x${c.charCodeAt(0).toString(16).padStart(2, "0")}`);
8741
8741
  }
8742
+ function sanitizeJson(json) {
8743
+ return json.replace(CONTROL_RE, (c) => `\\u${c.charCodeAt(0).toString(16).padStart(4, "0")}`);
8744
+ }
8742
8745
 
8743
8746
  // src/client/elicit.ts
8744
8747
  function readLine(platform2) {
@@ -10639,8 +10642,8 @@ async function runFromDiscovery(platform2, args) {
10639
10642
  }
10640
10643
  const result = parseEvents(text);
10641
10644
  if ("error" in result) {
10642
- await platform2.write(2, `mcpcat add --from-discovery: ${result.error}
10643
- `);
10645
+ await platform2.write(2, sanitizeTerminal(`mcpcat add --from-discovery: ${result.error}
10646
+ `));
10644
10647
  return result.code;
10645
10648
  }
10646
10649
  resetIdCounter();
@@ -10700,8 +10703,8 @@ async function runAddCandidate(platform2, name, candidateId2, configFile) {
10700
10703
  const { replaced } = await addServer(platform2.fs, path, name, config);
10701
10704
  for (const t of candidate.trust) {
10702
10705
  if (t.type.includes("mismatch")) {
10703
- await platform2.write(2, `mcpcat add: warning: ${t.type}: ${t.detail}
10704
- `);
10706
+ await platform2.write(2, sanitizeTerminal(`mcpcat add: warning: ${t.type}: ${t.detail}
10707
+ `));
10705
10708
  }
10706
10709
  }
10707
10710
  await platform2.write(1, `${replaced ? "replaced" : "added"} ${name} in ${path}
@@ -13842,7 +13845,7 @@ async function jerkLogin(platform2, target, resolved, args) {
13842
13845
  return 0;
13843
13846
  }
13844
13847
  if (errText.trim()) {
13845
- await platform2.write(2, errText);
13848
+ await platform2.write(2, sanitizeTerminal(errText));
13846
13849
  }
13847
13850
  if (result.status === JERK_EXIT_SIGN_IN) return 4;
13848
13851
  return result.status;
@@ -16153,14 +16156,14 @@ async function handleInputRequired(platform2, conn, err, respondData, json) {
16153
16156
  const parsed2 = JSON.parse(err.requestJson);
16154
16157
  const inputReq = parseInputRequest(parsed2.result ?? parsed2);
16155
16158
  if (!inputReq) {
16156
- await platform2.write(2, `${err.requestJson}
16159
+ await platform2.write(2, `${sanitizeJson(err.requestJson)}
16157
16160
  `);
16158
16161
  return EXIT_INPUT_REQUIRED;
16159
16162
  }
16160
16163
  const isTty = platform2.kind === "host" && platform2.isatty(0) && platform2.isatty(2);
16161
16164
  const elicitResult = await handleElicitation(platform2, inputReq, isTty, respondData);
16162
16165
  if ("exitCode" in elicitResult) {
16163
- await platform2.write(2, `${err.requestJson}
16166
+ await platform2.write(2, `${sanitizeJson(err.requestJson)}
16164
16167
  `);
16165
16168
  return EXIT_INPUT_REQUIRED;
16166
16169
  }
@@ -16733,7 +16736,7 @@ async function main(ctx) {
16733
16736
  packageDir: "/node_modules/@ai-ecoverse/mcpcat"
16734
16737
  });
16735
16738
  const args = ctx.argv.slice(1);
16736
- return run(platform2, "0.17.2", args);
16739
+ return run(platform2, "0.17.4", args);
16737
16740
  }
16738
16741
  export {
16739
16742
  main as default
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-ecoverse/mcpcat",
3
- "version": "0.17.2",
3
+ "version": "0.17.4",
4
4
  "description": "A curl for the Model Context Protocol",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -61,15 +61,16 @@
61
61
  "trust:dry": "npx fledgling sync --dry-run -y --skip-publish"
62
62
  },
63
63
  "devDependencies": {
64
- "@ai-ecoverse/slicc-bios": "1.31.5",
65
- "@ai-ecoverse/slicc-kernel": "1.134.1",
66
- "@ai-ecoverse/slicc-shared-web": "1.23.2",
64
+ "@ai-ecoverse/slicc-bios": "1.33.1",
65
+ "@ai-ecoverse/slicc-kernel": "1.140.0",
66
+ "@ai-ecoverse/slicc-shared-web": "1.29.2",
67
67
  "@biomejs/biome": "2.5.15",
68
68
  "@earendil-works/pi-codemode": "1.2.0",
69
69
  "@earendil-works/pi-mcp": "1.2.0",
70
70
  "@types/node": "26.6.5",
71
71
  "esbuild": "0.28.2",
72
- "kernel-cert-new": "npm:@ai-ecoverse/slicc-kernel@1.134.1",
72
+ "kernel-cert-new": "npm:@ai-ecoverse/slicc-kernel@1.140.0",
73
+ "lefthook": "2.2.2",
73
74
  "monocart-coverage-reports": "2.13.2",
74
75
  "proper-lockfile": "4.1.2",
75
76
  "quickjs-wasi": "3.6.2",