@ai-ecoverse/mcpcat 0.30.4 → 0.30.5
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/dist/host/mcpcat.mjs +11 -7
- package/dist/kernel/mcpcat.mjs +17 -8
- package/package.json +3 -3
package/dist/host/mcpcat.mjs
CHANGED
|
@@ -19622,10 +19622,14 @@ function remoteHttps(url) {
|
|
|
19622
19622
|
if (protocol !== "https:") return false;
|
|
19623
19623
|
return !(host === "localhost" || host.endsWith(".localhost") || host === "host.slicc.internal" || host === "[::1]" || LOOPBACK_V4.test(host));
|
|
19624
19624
|
}
|
|
19625
|
-
function
|
|
19625
|
+
function corsBlocked(cause, kernel) {
|
|
19626
|
+
if (cause?.detail === "transport") return true;
|
|
19627
|
+
return !kernel.marksTransport && cause?.code === "ECONNREFUSED" && remoteHttps(kernel.url);
|
|
19628
|
+
}
|
|
19629
|
+
function transportHint(err, kernel) {
|
|
19626
19630
|
if (err instanceof TypeError) {
|
|
19627
19631
|
const cause = err.cause;
|
|
19628
|
-
if (
|
|
19632
|
+
if (kernel && corsBlocked(cause, kernel)) {
|
|
19629
19633
|
return `${NETWORK_HINT}: ${err.message}`;
|
|
19630
19634
|
}
|
|
19631
19635
|
if (cause?.code === "ECONNREFUSED" || cause?.code === "ENETUNREACH") {
|
|
@@ -20700,7 +20704,7 @@ async function resolveAuthProvider(platform2, hasAuthHeader, url, target, config
|
|
|
20700
20704
|
}
|
|
20701
20705
|
return { provider, credentialSecrets };
|
|
20702
20706
|
}
|
|
20703
|
-
function classifyConnectionError(err, target, interrupted,
|
|
20707
|
+
function classifyConnectionError(err, target, interrupted, platform2, url) {
|
|
20704
20708
|
if (err instanceof TransportRefusalError) {
|
|
20705
20709
|
const hint = "in seven, reach the host via http://host.slicc.internal:<port>; in tests, enable the transport's hostLoopback";
|
|
20706
20710
|
return {
|
|
@@ -20718,8 +20722,8 @@ function classifyConnectionError(err, target, interrupted, platformKind, url) {
|
|
|
20718
20722
|
if (interrupted) {
|
|
20719
20723
|
return { code: EXIT_INTERRUPTED, kind: "interrupted", msg: "interrupted" };
|
|
20720
20724
|
}
|
|
20721
|
-
const
|
|
20722
|
-
const msg = transportHint(err,
|
|
20725
|
+
const kernel = platform2.kind === "kernel" ? { url, marksTransport: platform2.fetchMarksTransport === true } : void 0;
|
|
20726
|
+
const msg = transportHint(err, kernel) ?? `connection failed: ${err.message}`;
|
|
20723
20727
|
return { code: EXIT_CONNECTION, kind: "connection", msg };
|
|
20724
20728
|
}
|
|
20725
20729
|
function buildRoots(rootArgs, isStdio, cwd) {
|
|
@@ -20906,7 +20910,7 @@ async function runClientVerb(platform2, version, parsed) {
|
|
|
20906
20910
|
);
|
|
20907
20911
|
return EXIT_CONNECTION;
|
|
20908
20912
|
}
|
|
20909
|
-
const e = classifyConnectionError(err, target, interrupted, platform2
|
|
20913
|
+
const e = classifyConnectionError(err, target, interrupted, platform2, resolved.url);
|
|
20910
20914
|
if (e.code === EXIT_INTERRUPTED) {
|
|
20911
20915
|
await platform2.write(2, "mcpcat: interrupted\n");
|
|
20912
20916
|
return termExitCode;
|
|
@@ -21636,5 +21640,5 @@ try {
|
|
|
21636
21640
|
});
|
|
21637
21641
|
} catch {
|
|
21638
21642
|
}
|
|
21639
|
-
var code = await run(platform, "0.30.
|
|
21643
|
+
var code = await run(platform, "0.30.5", args);
|
|
21640
21644
|
process.exit(code);
|
package/dist/kernel/mcpcat.mjs
CHANGED
|
@@ -19139,10 +19139,14 @@ function remoteHttps(url) {
|
|
|
19139
19139
|
if (protocol !== "https:") return false;
|
|
19140
19140
|
return !(host === "localhost" || host.endsWith(".localhost") || host === "host.slicc.internal" || host === "[::1]" || LOOPBACK_V4.test(host));
|
|
19141
19141
|
}
|
|
19142
|
-
function
|
|
19142
|
+
function corsBlocked(cause, kernel) {
|
|
19143
|
+
if (cause?.detail === "transport") return true;
|
|
19144
|
+
return !kernel.marksTransport && cause?.code === "ECONNREFUSED" && remoteHttps(kernel.url);
|
|
19145
|
+
}
|
|
19146
|
+
function transportHint(err, kernel) {
|
|
19143
19147
|
if (err instanceof TypeError) {
|
|
19144
19148
|
const cause = err.cause;
|
|
19145
|
-
if (
|
|
19149
|
+
if (kernel && corsBlocked(cause, kernel)) {
|
|
19146
19150
|
return `${NETWORK_HINT}: ${err.message}`;
|
|
19147
19151
|
}
|
|
19148
19152
|
if (cause?.code === "ECONNREFUSED" || cause?.code === "ENETUNREACH") {
|
|
@@ -20217,7 +20221,7 @@ async function resolveAuthProvider(platform2, hasAuthHeader, url, target, config
|
|
|
20217
20221
|
}
|
|
20218
20222
|
return { provider, credentialSecrets };
|
|
20219
20223
|
}
|
|
20220
|
-
function classifyConnectionError(err, target, interrupted,
|
|
20224
|
+
function classifyConnectionError(err, target, interrupted, platform2, url) {
|
|
20221
20225
|
if (err instanceof TransportRefusalError) {
|
|
20222
20226
|
const hint = "in seven, reach the host via http://host.slicc.internal:<port>; in tests, enable the transport's hostLoopback";
|
|
20223
20227
|
return {
|
|
@@ -20235,8 +20239,8 @@ function classifyConnectionError(err, target, interrupted, platformKind, url) {
|
|
|
20235
20239
|
if (interrupted) {
|
|
20236
20240
|
return { code: EXIT_INTERRUPTED, kind: "interrupted", msg: "interrupted" };
|
|
20237
20241
|
}
|
|
20238
|
-
const
|
|
20239
|
-
const msg = transportHint(err,
|
|
20242
|
+
const kernel = platform2.kind === "kernel" ? { url, marksTransport: platform2.fetchMarksTransport === true } : void 0;
|
|
20243
|
+
const msg = transportHint(err, kernel) ?? `connection failed: ${err.message}`;
|
|
20240
20244
|
return { code: EXIT_CONNECTION, kind: "connection", msg };
|
|
20241
20245
|
}
|
|
20242
20246
|
function buildRoots(rootArgs, isStdio, cwd) {
|
|
@@ -20423,7 +20427,7 @@ async function runClientVerb(platform2, version, parsed) {
|
|
|
20423
20427
|
);
|
|
20424
20428
|
return EXIT_CONNECTION;
|
|
20425
20429
|
}
|
|
20426
|
-
const e = classifyConnectionError(err, target, interrupted, platform2
|
|
20430
|
+
const e = classifyConnectionError(err, target, interrupted, platform2, resolved.url);
|
|
20427
20431
|
if (e.code === EXIT_INTERRUPTED) {
|
|
20428
20432
|
await platform2.write(2, "mcpcat: interrupted\n");
|
|
20429
20433
|
return termExitCode;
|
|
@@ -20940,6 +20944,10 @@ async function kernelSeal(ctx, request) {
|
|
|
20940
20944
|
await f.close();
|
|
20941
20945
|
}
|
|
20942
20946
|
}
|
|
20947
|
+
function marksTransport(version) {
|
|
20948
|
+
const [major, minor] = (version ?? "").split(".").map(Number);
|
|
20949
|
+
return major > 1 || major === 1 && minor >= 170;
|
|
20950
|
+
}
|
|
20943
20951
|
function createKernelPlatform(ctx, options) {
|
|
20944
20952
|
const encoder2 = new TextEncoder();
|
|
20945
20953
|
return {
|
|
@@ -20967,7 +20975,8 @@ function createKernelPlatform(ctx, options) {
|
|
|
20967
20975
|
async seal(request) {
|
|
20968
20976
|
return kernelSeal(ctx, request);
|
|
20969
20977
|
},
|
|
20970
|
-
packageDir: options?.packageDir
|
|
20978
|
+
packageDir: options?.packageDir,
|
|
20979
|
+
fetchMarksTransport: marksTransport(ctx.kernel?.version)
|
|
20971
20980
|
};
|
|
20972
20981
|
}
|
|
20973
20982
|
|
|
@@ -20983,7 +20992,7 @@ async function main(ctx) {
|
|
|
20983
20992
|
packageDir: "/node_modules/@ai-ecoverse/mcpcat"
|
|
20984
20993
|
});
|
|
20985
20994
|
const args = ctx.argv.slice(1);
|
|
20986
|
-
return run(platform2, "0.30.
|
|
20995
|
+
return run(platform2, "0.30.5", args);
|
|
20987
20996
|
}
|
|
20988
20997
|
export {
|
|
20989
20998
|
main as default
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-ecoverse/mcpcat",
|
|
3
|
-
"version": "0.30.
|
|
3
|
+
"version": "0.30.5",
|
|
4
4
|
"description": "A curl for the Model Context Protocol",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -58,8 +58,8 @@
|
|
|
58
58
|
"trust:dry": "npx fledgling sync --dry-run -y --skip-publish"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
|
-
"@ai-ecoverse/slicc-kernel": "1.
|
|
62
|
-
"@ai-ecoverse/slicc-shared-web": "2.13.
|
|
61
|
+
"@ai-ecoverse/slicc-kernel": "1.170.0",
|
|
62
|
+
"@ai-ecoverse/slicc-shared-web": "2.13.4",
|
|
63
63
|
"@biomejs/biome": "2.5.15",
|
|
64
64
|
"@earendil-works/pi-codemode": "1.3.0",
|
|
65
65
|
"@earendil-works/pi-mcp": "1.3.0",
|