@ai-ecoverse/mcpcat 0.15.8 → 0.16.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.
- package/README.md +4 -0
- package/dist/host/mcpcat.mjs +47 -29
- package/dist/kernel/mcpcat.mjs +49 -30
- package/package.json +5 -4
package/README.md
CHANGED
|
@@ -24,6 +24,10 @@ npm install -g @ai-ecoverse/mcpcat
|
|
|
24
24
|
|
|
25
25
|
mcpcat runs natively on macOS, Linux and Windows (Node ≥ 24), and inside Sliccy Seven as a kernel program, with the same flags, the same output and the same config file in both places. Orphan-free shutdown of stdio server trees in the kernel needs slicc-kernel ≥ 1.74.0; on older kernels only the direct child is signalled. A SIGKILLed mcpcat runs no handler. On slicc-kernel ≥ 1.88.0, mcpcat spawns stdio servers and served commands with a parent death signal (like Linux `PR_SET_PDEATHSIG`), so the kernel SIGKILLs each server's process group when mcpcat dies. On older kernels, and on the host, where there is no portable equivalent, servers that exit on stdin EOF (most MCP servers) still stop, but servers that ignore it keep running.
|
|
26
26
|
|
|
27
|
+
## Releases: certified = latest
|
|
28
|
+
|
|
29
|
+
Every change that alters what mcpcat ships is certified before it reaches `main`. A pull request that touches `src/`, the build, the dependencies or the release workflows gets mcpcat's cert-review on a pack of its head, and again in the merge queue on the exact tree that lands on `main`; a FAIL blocks the merge. Docs-, test- and CI-only changes skip it as "not behaviour". Each merge to `main` is then released to npm as `latest` in one step by semantic-release, with provenance, so `npm install @ai-ecoverse/mcpcat` and the installer always get certified code. The verdict line is a comment on the pull request and the `cert-review` commit status.
|
|
30
|
+
|
|
27
31
|
## Quick start
|
|
28
32
|
|
|
29
33
|
```sh
|
package/dist/host/mcpcat.mjs
CHANGED
|
@@ -9113,6 +9113,12 @@ async function connect(platform2, options) {
|
|
|
9113
9113
|
}
|
|
9114
9114
|
}
|
|
9115
9115
|
|
|
9116
|
+
// src/render/sanitize.ts
|
|
9117
|
+
var CONTROL_RE = /[\u0000-\u0008\u000b-\u001f\u007f-\u009f]/g;
|
|
9118
|
+
function sanitizeTerminal(text) {
|
|
9119
|
+
return text.replace(CONTROL_RE, (c) => `\\x${c.charCodeAt(0).toString(16).padStart(2, "0")}`);
|
|
9120
|
+
}
|
|
9121
|
+
|
|
9116
9122
|
// src/client/elicit.ts
|
|
9117
9123
|
function readLine(platform2) {
|
|
9118
9124
|
return new Promise((resolve, reject) => {
|
|
@@ -9164,7 +9170,7 @@ async function promptForSchema(platform2, schema) {
|
|
|
9164
9170
|
const desc = prop.description ? ` - ${prop.description}` : "";
|
|
9165
9171
|
const def = prop.default !== void 0 ? ` [${String(prop.default)}]` : "";
|
|
9166
9172
|
const choices = prop.enum ? ` (${prop.enum.join("|")})` : "";
|
|
9167
|
-
await platform2.write(2, `${key}${req}${desc}${choices}${def}: `);
|
|
9173
|
+
await platform2.write(2, sanitizeTerminal(`${key}${req}${desc}${choices}${def}: `));
|
|
9168
9174
|
const line = await readLine(platform2);
|
|
9169
9175
|
const value = line.trim();
|
|
9170
9176
|
if (value === "" && prop.default !== void 0) {
|
|
@@ -9186,8 +9192,8 @@ function parseInputRequest(result) {
|
|
|
9186
9192
|
async function handleElicitation(platform2, inputRequest, isTty, respondData) {
|
|
9187
9193
|
if (inputRequest.url) {
|
|
9188
9194
|
if (isTty) {
|
|
9189
|
-
await platform2.write(2, `Open this URL to continue: ${inputRequest.url}
|
|
9190
|
-
`);
|
|
9195
|
+
await platform2.write(2, sanitizeTerminal(`Open this URL to continue: ${inputRequest.url}
|
|
9196
|
+
`));
|
|
9191
9197
|
await platform2.write(2, "Press Enter when done...");
|
|
9192
9198
|
await readLine(platform2);
|
|
9193
9199
|
return { answers: {} };
|
|
@@ -9202,8 +9208,8 @@ async function handleElicitation(platform2, inputRequest, isTty, respondData) {
|
|
|
9202
9208
|
}
|
|
9203
9209
|
const schema = inputRequest.schema ?? { type: "object", properties: {} };
|
|
9204
9210
|
if (inputRequest.message) {
|
|
9205
|
-
await platform2.write(2, `${inputRequest.message}
|
|
9206
|
-
`);
|
|
9211
|
+
await platform2.write(2, sanitizeTerminal(`${inputRequest.message}
|
|
9212
|
+
`));
|
|
9207
9213
|
}
|
|
9208
9214
|
const answers = await promptForSchema(platform2, schema);
|
|
9209
9215
|
return { answers };
|
|
@@ -9724,8 +9730,11 @@ async function formatOutput(platform2, result, json) {
|
|
|
9724
9730
|
`);
|
|
9725
9731
|
}
|
|
9726
9732
|
if (!result.ok) {
|
|
9727
|
-
await platform2.write(
|
|
9728
|
-
|
|
9733
|
+
await platform2.write(
|
|
9734
|
+
2,
|
|
9735
|
+
sanitizeTerminal(`mcpcat: script failed: ${result.error.message}
|
|
9736
|
+
`)
|
|
9737
|
+
);
|
|
9729
9738
|
}
|
|
9730
9739
|
}
|
|
9731
9740
|
const isTimeout = !result.ok && result.error && result.error.kind === "timeout";
|
|
@@ -11187,8 +11196,8 @@ async function renderCallResult(platform2, result, options) {
|
|
|
11187
11196
|
}
|
|
11188
11197
|
const text = renderCallResultText(result, options);
|
|
11189
11198
|
if (result.isError) {
|
|
11190
|
-
await platform2.write(2, r(`${text || "(tool reported error)"}
|
|
11191
|
-
`));
|
|
11199
|
+
await platform2.write(2, sanitizeTerminal(r(`${text || "(tool reported error)"}
|
|
11200
|
+
`)));
|
|
11192
11201
|
return 1;
|
|
11193
11202
|
}
|
|
11194
11203
|
if (text) {
|
|
@@ -12828,9 +12837,12 @@ function concat(chunks) {
|
|
|
12828
12837
|
return out;
|
|
12829
12838
|
}
|
|
12830
12839
|
var KILL_GRACE_MS = 2e3;
|
|
12840
|
+
var SIGNAL_EXIT = { SIGINT: 130, SIGTERM: 143, SIGHUP: 129 };
|
|
12831
12841
|
async function trapShutdown(platform2, handler) {
|
|
12832
12842
|
await Promise.all(
|
|
12833
|
-
["SIGINT", "SIGTERM", "SIGHUP"].map(
|
|
12843
|
+
["SIGINT", "SIGTERM", "SIGHUP"].map(
|
|
12844
|
+
(sig) => platform2.onSignal?.(sig, () => handler(sig))
|
|
12845
|
+
)
|
|
12834
12846
|
);
|
|
12835
12847
|
}
|
|
12836
12848
|
async function killInflight() {
|
|
@@ -13042,10 +13054,13 @@ function createToolExecutor(platform2, clis, allTools, childEnv, options, serveC
|
|
|
13042
13054
|
async function discoverWithSignal(platform2, commands, childEnv, cwd) {
|
|
13043
13055
|
const clis = [];
|
|
13044
13056
|
let earlyShutdown = false;
|
|
13057
|
+
let shutdownExit = SIGNAL_EXIT.SIGTERM;
|
|
13045
13058
|
let inflightDone;
|
|
13046
13059
|
const earlyAbort = new AbortController();
|
|
13047
|
-
const onShutdown = () => {
|
|
13060
|
+
const onShutdown = (sig) => {
|
|
13061
|
+
if (earlyShutdown) return;
|
|
13048
13062
|
earlyShutdown = true;
|
|
13063
|
+
shutdownExit = SIGNAL_EXIT[sig];
|
|
13049
13064
|
earlyAbort.abort();
|
|
13050
13065
|
inflightDone = killInflight();
|
|
13051
13066
|
};
|
|
@@ -13055,13 +13070,13 @@ async function discoverWithSignal(platform2, commands, childEnv, cwd) {
|
|
|
13055
13070
|
const cli = await discoverCli(platform2, cmd.path, cmd.name, childEnv, cwd, earlyAbort.signal);
|
|
13056
13071
|
clis.push(cli);
|
|
13057
13072
|
} catch (err) {
|
|
13058
|
-
if (earlyShutdown) return { exitCode:
|
|
13073
|
+
if (earlyShutdown) return { exitCode: shutdownExit, inflightDone };
|
|
13059
13074
|
await platform2.write(2, `mcpcat serve: ${err.message}
|
|
13060
13075
|
`);
|
|
13061
13076
|
return { exitCode: 2 };
|
|
13062
13077
|
}
|
|
13063
13078
|
}
|
|
13064
|
-
if (earlyShutdown) return { exitCode:
|
|
13079
|
+
if (earlyShutdown) return { exitCode: shutdownExit, inflightDone };
|
|
13065
13080
|
return { clis };
|
|
13066
13081
|
}
|
|
13067
13082
|
async function resolveBearer(platform2, options) {
|
|
@@ -13290,8 +13305,8 @@ async function runWebMcpServe(platform2, options, version, resolvedBearer, gener
|
|
|
13290
13305
|
return 3;
|
|
13291
13306
|
}
|
|
13292
13307
|
if (!resolved.tab) {
|
|
13293
|
-
await platform2.write(2, `mcpcat serve --webmcp: ${resolved.error}
|
|
13294
|
-
`);
|
|
13308
|
+
await platform2.write(2, sanitizeTerminal(`mcpcat serve --webmcp: ${resolved.error}
|
|
13309
|
+
`));
|
|
13295
13310
|
return 3;
|
|
13296
13311
|
}
|
|
13297
13312
|
tab = resolved.tab;
|
|
@@ -14294,8 +14309,8 @@ ${url.href}
|
|
|
14294
14309
|
await platform2.write(2, "mcpcat: sign-in cancelled\n");
|
|
14295
14310
|
return 1;
|
|
14296
14311
|
}
|
|
14297
|
-
await platform2.write(2, `mcpcat: login failed: ${err.message}
|
|
14298
|
-
`);
|
|
14312
|
+
await platform2.write(2, sanitizeTerminal(`mcpcat: login failed: ${err.message}
|
|
14313
|
+
`));
|
|
14299
14314
|
return 4;
|
|
14300
14315
|
}
|
|
14301
14316
|
}
|
|
@@ -14928,8 +14943,8 @@ async function runAdd(platform2, args2, probe) {
|
|
|
14928
14943
|
if (!flags.noProbe && probe) {
|
|
14929
14944
|
const reason = await probe(name, config, platform2);
|
|
14930
14945
|
if (reason) {
|
|
14931
|
-
await platform2.write(2, `mcpcat add: probe failed: ${reason}
|
|
14932
|
-
`);
|
|
14946
|
+
await platform2.write(2, sanitizeTerminal(`mcpcat add: probe failed: ${reason}
|
|
14947
|
+
`));
|
|
14933
14948
|
return 3;
|
|
14934
14949
|
}
|
|
14935
14950
|
}
|
|
@@ -15310,7 +15325,7 @@ function redact(text, secrets) {
|
|
|
15310
15325
|
function createVerboseLogger(platform2, enabled) {
|
|
15311
15326
|
const secrets = /* @__PURE__ */ new Set();
|
|
15312
15327
|
function write(line) {
|
|
15313
|
-
const safe = redact(line, secrets);
|
|
15328
|
+
const safe = sanitizeTerminal(redact(line, secrets));
|
|
15314
15329
|
platform2.write(2, `${safe}
|
|
15315
15330
|
`).catch(() => {
|
|
15316
15331
|
});
|
|
@@ -16129,8 +16144,11 @@ async function connectTargets(platform2, names, config, parsed, version) {
|
|
|
16129
16144
|
const info = await conn.info();
|
|
16130
16145
|
targets.push({ name, conn, instructions: info.instructions });
|
|
16131
16146
|
} catch (err) {
|
|
16132
|
-
await platform2.write(
|
|
16133
|
-
|
|
16147
|
+
await platform2.write(
|
|
16148
|
+
2,
|
|
16149
|
+
sanitizeTerminal(`mcpcat: connection to ${name} failed: ${err.message}
|
|
16150
|
+
`)
|
|
16151
|
+
);
|
|
16134
16152
|
}
|
|
16135
16153
|
}
|
|
16136
16154
|
return {
|
|
@@ -16549,8 +16567,8 @@ async function runClientVerb(platform2, version, parsed) {
|
|
|
16549
16567
|
if (!showProgress) return;
|
|
16550
16568
|
const pct = total ? ` ${Math.round(progress / total * 100)}%` : "";
|
|
16551
16569
|
const msg = message ? ` ${message}` : "";
|
|
16552
|
-
platform2.write(2, `* progress:${pct}${msg}
|
|
16553
|
-
`).catch(() => {
|
|
16570
|
+
platform2.write(2, sanitizeTerminal(`* progress:${pct}${msg}
|
|
16571
|
+
`)).catch(() => {
|
|
16554
16572
|
});
|
|
16555
16573
|
};
|
|
16556
16574
|
const config = await MergedConfigSource.load(platform2);
|
|
@@ -16678,13 +16696,13 @@ async function closeAndKillStdio(conn) {
|
|
|
16678
16696
|
}
|
|
16679
16697
|
async function writeErr(p, json, kind, msg) {
|
|
16680
16698
|
if (json) await renderErrorJson(p, kind, msg);
|
|
16681
|
-
else await p.write(2, `mcpcat: ${msg}
|
|
16682
|
-
`);
|
|
16699
|
+
else await p.write(2, sanitizeTerminal(`mcpcat: ${msg}
|
|
16700
|
+
`));
|
|
16683
16701
|
}
|
|
16684
16702
|
async function writeErrRedacted(p, json, kind, msg, redact2) {
|
|
16685
16703
|
if (json) await renderErrorJson(p, kind, msg, void 0, void 0, redact2);
|
|
16686
|
-
else await p.write(2, `mcpcat: ${redact2(msg)}
|
|
16687
|
-
`);
|
|
16704
|
+
else await p.write(2, sanitizeTerminal(`mcpcat: ${redact2(msg)}
|
|
16705
|
+
`));
|
|
16688
16706
|
}
|
|
16689
16707
|
function collectConfigSecrets(headers, env) {
|
|
16690
16708
|
if (!headers) return [];
|
|
@@ -16957,5 +16975,5 @@ try {
|
|
|
16957
16975
|
});
|
|
16958
16976
|
} catch {
|
|
16959
16977
|
}
|
|
16960
|
-
var code = await run(platform, "0.
|
|
16978
|
+
var code = await run(platform, "0.16.3", args);
|
|
16961
16979
|
process.exit(code);
|
package/dist/kernel/mcpcat.mjs
CHANGED
|
@@ -8734,6 +8734,12 @@ async function connect(platform2, options) {
|
|
|
8734
8734
|
}
|
|
8735
8735
|
}
|
|
8736
8736
|
|
|
8737
|
+
// src/render/sanitize.ts
|
|
8738
|
+
var CONTROL_RE = /[\u0000-\u0008\u000b-\u001f\u007f-\u009f]/g;
|
|
8739
|
+
function sanitizeTerminal(text) {
|
|
8740
|
+
return text.replace(CONTROL_RE, (c) => `\\x${c.charCodeAt(0).toString(16).padStart(2, "0")}`);
|
|
8741
|
+
}
|
|
8742
|
+
|
|
8737
8743
|
// src/client/elicit.ts
|
|
8738
8744
|
function readLine(platform2) {
|
|
8739
8745
|
return new Promise((resolve2, reject) => {
|
|
@@ -8785,7 +8791,7 @@ async function promptForSchema(platform2, schema) {
|
|
|
8785
8791
|
const desc = prop.description ? ` - ${prop.description}` : "";
|
|
8786
8792
|
const def = prop.default !== void 0 ? ` [${String(prop.default)}]` : "";
|
|
8787
8793
|
const choices = prop.enum ? ` (${prop.enum.join("|")})` : "";
|
|
8788
|
-
await platform2.write(2, `${key}${req}${desc}${choices}${def}: `);
|
|
8794
|
+
await platform2.write(2, sanitizeTerminal(`${key}${req}${desc}${choices}${def}: `));
|
|
8789
8795
|
const line = await readLine(platform2);
|
|
8790
8796
|
const value = line.trim();
|
|
8791
8797
|
if (value === "" && prop.default !== void 0) {
|
|
@@ -8807,8 +8813,8 @@ function parseInputRequest(result) {
|
|
|
8807
8813
|
async function handleElicitation(platform2, inputRequest, isTty, respondData) {
|
|
8808
8814
|
if (inputRequest.url) {
|
|
8809
8815
|
if (isTty) {
|
|
8810
|
-
await platform2.write(2, `Open this URL to continue: ${inputRequest.url}
|
|
8811
|
-
`);
|
|
8816
|
+
await platform2.write(2, sanitizeTerminal(`Open this URL to continue: ${inputRequest.url}
|
|
8817
|
+
`));
|
|
8812
8818
|
await platform2.write(2, "Press Enter when done...");
|
|
8813
8819
|
await readLine(platform2);
|
|
8814
8820
|
return { answers: {} };
|
|
@@ -8823,8 +8829,8 @@ async function handleElicitation(platform2, inputRequest, isTty, respondData) {
|
|
|
8823
8829
|
}
|
|
8824
8830
|
const schema = inputRequest.schema ?? { type: "object", properties: {} };
|
|
8825
8831
|
if (inputRequest.message) {
|
|
8826
|
-
await platform2.write(2, `${inputRequest.message}
|
|
8827
|
-
`);
|
|
8832
|
+
await platform2.write(2, sanitizeTerminal(`${inputRequest.message}
|
|
8833
|
+
`));
|
|
8828
8834
|
}
|
|
8829
8835
|
const answers = await promptForSchema(platform2, schema);
|
|
8830
8836
|
return { answers };
|
|
@@ -9345,8 +9351,11 @@ async function formatOutput(platform2, result, json) {
|
|
|
9345
9351
|
`);
|
|
9346
9352
|
}
|
|
9347
9353
|
if (!result.ok) {
|
|
9348
|
-
await platform2.write(
|
|
9349
|
-
|
|
9354
|
+
await platform2.write(
|
|
9355
|
+
2,
|
|
9356
|
+
sanitizeTerminal(`mcpcat: script failed: ${result.error.message}
|
|
9357
|
+
`)
|
|
9358
|
+
);
|
|
9350
9359
|
}
|
|
9351
9360
|
}
|
|
9352
9361
|
const isTimeout = !result.ok && result.error && result.error.kind === "timeout";
|
|
@@ -10808,8 +10817,8 @@ async function renderCallResult(platform2, result, options) {
|
|
|
10808
10817
|
}
|
|
10809
10818
|
const text = renderCallResultText(result, options);
|
|
10810
10819
|
if (result.isError) {
|
|
10811
|
-
await platform2.write(2, r(`${text || "(tool reported error)"}
|
|
10812
|
-
`));
|
|
10820
|
+
await platform2.write(2, sanitizeTerminal(r(`${text || "(tool reported error)"}
|
|
10821
|
+
`)));
|
|
10813
10822
|
return 1;
|
|
10814
10823
|
}
|
|
10815
10824
|
if (text) {
|
|
@@ -12449,9 +12458,12 @@ function concat(chunks) {
|
|
|
12449
12458
|
return out;
|
|
12450
12459
|
}
|
|
12451
12460
|
var KILL_GRACE_MS = 2e3;
|
|
12461
|
+
var SIGNAL_EXIT = { SIGINT: 130, SIGTERM: 143, SIGHUP: 129 };
|
|
12452
12462
|
async function trapShutdown(platform2, handler) {
|
|
12453
12463
|
await Promise.all(
|
|
12454
|
-
["SIGINT", "SIGTERM", "SIGHUP"].map(
|
|
12464
|
+
["SIGINT", "SIGTERM", "SIGHUP"].map(
|
|
12465
|
+
(sig) => platform2.onSignal?.(sig, () => handler(sig))
|
|
12466
|
+
)
|
|
12455
12467
|
);
|
|
12456
12468
|
}
|
|
12457
12469
|
async function killInflight() {
|
|
@@ -12663,10 +12675,13 @@ function createToolExecutor(platform2, clis, allTools, childEnv, options, serveC
|
|
|
12663
12675
|
async function discoverWithSignal(platform2, commands, childEnv, cwd) {
|
|
12664
12676
|
const clis = [];
|
|
12665
12677
|
let earlyShutdown = false;
|
|
12678
|
+
let shutdownExit = SIGNAL_EXIT.SIGTERM;
|
|
12666
12679
|
let inflightDone;
|
|
12667
12680
|
const earlyAbort = new AbortController();
|
|
12668
|
-
const onShutdown = () => {
|
|
12681
|
+
const onShutdown = (sig) => {
|
|
12682
|
+
if (earlyShutdown) return;
|
|
12669
12683
|
earlyShutdown = true;
|
|
12684
|
+
shutdownExit = SIGNAL_EXIT[sig];
|
|
12670
12685
|
earlyAbort.abort();
|
|
12671
12686
|
inflightDone = killInflight();
|
|
12672
12687
|
};
|
|
@@ -12676,13 +12691,13 @@ async function discoverWithSignal(platform2, commands, childEnv, cwd) {
|
|
|
12676
12691
|
const cli = await discoverCli(platform2, cmd.path, cmd.name, childEnv, cwd, earlyAbort.signal);
|
|
12677
12692
|
clis.push(cli);
|
|
12678
12693
|
} catch (err) {
|
|
12679
|
-
if (earlyShutdown) return { exitCode:
|
|
12694
|
+
if (earlyShutdown) return { exitCode: shutdownExit, inflightDone };
|
|
12680
12695
|
await platform2.write(2, `mcpcat serve: ${err.message}
|
|
12681
12696
|
`);
|
|
12682
12697
|
return { exitCode: 2 };
|
|
12683
12698
|
}
|
|
12684
12699
|
}
|
|
12685
|
-
if (earlyShutdown) return { exitCode:
|
|
12700
|
+
if (earlyShutdown) return { exitCode: shutdownExit, inflightDone };
|
|
12686
12701
|
return { clis };
|
|
12687
12702
|
}
|
|
12688
12703
|
async function resolveBearer(platform2, options) {
|
|
@@ -12911,8 +12926,8 @@ async function runWebMcpServe(platform2, options, version, resolvedBearer, gener
|
|
|
12911
12926
|
return 3;
|
|
12912
12927
|
}
|
|
12913
12928
|
if (!resolved.tab) {
|
|
12914
|
-
await platform2.write(2, `mcpcat serve --webmcp: ${resolved.error}
|
|
12915
|
-
`);
|
|
12929
|
+
await platform2.write(2, sanitizeTerminal(`mcpcat serve --webmcp: ${resolved.error}
|
|
12930
|
+
`));
|
|
12916
12931
|
return 3;
|
|
12917
12932
|
}
|
|
12918
12933
|
tab = resolved.tab;
|
|
@@ -13915,8 +13930,8 @@ ${url.href}
|
|
|
13915
13930
|
await platform2.write(2, "mcpcat: sign-in cancelled\n");
|
|
13916
13931
|
return 1;
|
|
13917
13932
|
}
|
|
13918
|
-
await platform2.write(2, `mcpcat: login failed: ${err.message}
|
|
13919
|
-
`);
|
|
13933
|
+
await platform2.write(2, sanitizeTerminal(`mcpcat: login failed: ${err.message}
|
|
13934
|
+
`));
|
|
13920
13935
|
return 4;
|
|
13921
13936
|
}
|
|
13922
13937
|
}
|
|
@@ -14549,8 +14564,8 @@ async function runAdd(platform2, args, probe) {
|
|
|
14549
14564
|
if (!flags.noProbe && probe) {
|
|
14550
14565
|
const reason = await probe(name, config, platform2);
|
|
14551
14566
|
if (reason) {
|
|
14552
|
-
await platform2.write(2, `mcpcat add: probe failed: ${reason}
|
|
14553
|
-
`);
|
|
14567
|
+
await platform2.write(2, sanitizeTerminal(`mcpcat add: probe failed: ${reason}
|
|
14568
|
+
`));
|
|
14554
14569
|
return 3;
|
|
14555
14570
|
}
|
|
14556
14571
|
}
|
|
@@ -14931,7 +14946,7 @@ function redact(text, secrets) {
|
|
|
14931
14946
|
function createVerboseLogger(platform2, enabled) {
|
|
14932
14947
|
const secrets = /* @__PURE__ */ new Set();
|
|
14933
14948
|
function write(line) {
|
|
14934
|
-
const safe = redact(line, secrets);
|
|
14949
|
+
const safe = sanitizeTerminal(redact(line, secrets));
|
|
14935
14950
|
platform2.write(2, `${safe}
|
|
14936
14951
|
`).catch(() => {
|
|
14937
14952
|
});
|
|
@@ -15750,8 +15765,11 @@ async function connectTargets(platform2, names, config, parsed, version) {
|
|
|
15750
15765
|
const info = await conn.info();
|
|
15751
15766
|
targets.push({ name, conn, instructions: info.instructions });
|
|
15752
15767
|
} catch (err) {
|
|
15753
|
-
await platform2.write(
|
|
15754
|
-
|
|
15768
|
+
await platform2.write(
|
|
15769
|
+
2,
|
|
15770
|
+
sanitizeTerminal(`mcpcat: connection to ${name} failed: ${err.message}
|
|
15771
|
+
`)
|
|
15772
|
+
);
|
|
15755
15773
|
}
|
|
15756
15774
|
}
|
|
15757
15775
|
return {
|
|
@@ -16170,8 +16188,8 @@ async function runClientVerb(platform2, version, parsed) {
|
|
|
16170
16188
|
if (!showProgress) return;
|
|
16171
16189
|
const pct = total ? ` ${Math.round(progress / total * 100)}%` : "";
|
|
16172
16190
|
const msg = message ? ` ${message}` : "";
|
|
16173
|
-
platform2.write(2, `* progress:${pct}${msg}
|
|
16174
|
-
`).catch(() => {
|
|
16191
|
+
platform2.write(2, sanitizeTerminal(`* progress:${pct}${msg}
|
|
16192
|
+
`)).catch(() => {
|
|
16175
16193
|
});
|
|
16176
16194
|
};
|
|
16177
16195
|
const config = await MergedConfigSource.load(platform2);
|
|
@@ -16299,13 +16317,13 @@ async function closeAndKillStdio(conn) {
|
|
|
16299
16317
|
}
|
|
16300
16318
|
async function writeErr(p, json, kind, msg) {
|
|
16301
16319
|
if (json) await renderErrorJson(p, kind, msg);
|
|
16302
|
-
else await p.write(2, `mcpcat: ${msg}
|
|
16303
|
-
`);
|
|
16320
|
+
else await p.write(2, sanitizeTerminal(`mcpcat: ${msg}
|
|
16321
|
+
`));
|
|
16304
16322
|
}
|
|
16305
16323
|
async function writeErrRedacted(p, json, kind, msg, redact2) {
|
|
16306
16324
|
if (json) await renderErrorJson(p, kind, msg, void 0, void 0, redact2);
|
|
16307
|
-
else await p.write(2, `mcpcat: ${redact2(msg)}
|
|
16308
|
-
`);
|
|
16325
|
+
else await p.write(2, sanitizeTerminal(`mcpcat: ${redact2(msg)}
|
|
16326
|
+
`));
|
|
16309
16327
|
}
|
|
16310
16328
|
function collectConfigSecrets(headers, env2) {
|
|
16311
16329
|
if (!headers) return [];
|
|
@@ -16396,11 +16414,12 @@ async function kernelSpawn(ctx, options) {
|
|
|
16396
16414
|
}
|
|
16397
16415
|
}
|
|
16398
16416
|
const useGroupKill = groupSpawnSupported;
|
|
16417
|
+
let waited;
|
|
16399
16418
|
return {
|
|
16400
16419
|
stdin: result.stdin ?? new WritableStream(),
|
|
16401
16420
|
stdout: result.stdout,
|
|
16402
16421
|
stderr: result.stderr,
|
|
16403
|
-
wait: () => result.wait(),
|
|
16422
|
+
wait: () => waited ??= result.wait(),
|
|
16404
16423
|
kill: async (signal) => {
|
|
16405
16424
|
if (useGroupKill) {
|
|
16406
16425
|
try {
|
|
@@ -16678,7 +16697,7 @@ async function main(ctx) {
|
|
|
16678
16697
|
packageDir: "/node_modules/@ai-ecoverse/mcpcat"
|
|
16679
16698
|
});
|
|
16680
16699
|
const args = ctx.argv.slice(1);
|
|
16681
|
-
return run(platform2, "0.
|
|
16700
|
+
return run(platform2, "0.16.3", args);
|
|
16682
16701
|
}
|
|
16683
16702
|
export {
|
|
16684
16703
|
main as default
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-ecoverse/mcpcat",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.3",
|
|
4
4
|
"description": "A curl for the Model Context Protocol",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -56,14 +56,15 @@
|
|
|
56
56
|
"trust:dry": "npx fledgling sync --dry-run -y --skip-publish"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
|
-
"@ai-ecoverse/slicc-bios": "1.
|
|
60
|
-
"@ai-ecoverse/slicc-kernel": "1.
|
|
61
|
-
"@ai-ecoverse/slicc-shared-web": "1.
|
|
59
|
+
"@ai-ecoverse/slicc-bios": "1.5.2",
|
|
60
|
+
"@ai-ecoverse/slicc-kernel": "1.107.1",
|
|
61
|
+
"@ai-ecoverse/slicc-shared-web": "1.21.1",
|
|
62
62
|
"@biomejs/biome": "2.5.15",
|
|
63
63
|
"@earendil-works/pi-codemode": "1.2.0",
|
|
64
64
|
"@earendil-works/pi-mcp": "1.2.0",
|
|
65
65
|
"@types/node": "26.6.5",
|
|
66
66
|
"esbuild": "0.28.2",
|
|
67
|
+
"kernel-cert-new": "npm:@ai-ecoverse/slicc-kernel@1.107.1",
|
|
67
68
|
"monocart-coverage-reports": "2.13.2",
|
|
68
69
|
"proper-lockfile": "4.1.2",
|
|
69
70
|
"quickjs-wasi": "3.6.2",
|