@ai-ecoverse/mcpcat 0.17.10 → 0.18.0
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 +43 -19
- package/dist/kernel/mcpcat.mjs +43 -19
- package/package.json +4 -4
package/dist/host/mcpcat.mjs
CHANGED
|
@@ -13284,23 +13284,29 @@ function resolveProxyUrl(target, headers, version) {
|
|
|
13284
13284
|
const url = target.startsWith("http") ? target : `https://${target}`;
|
|
13285
13285
|
return { url, headers, version };
|
|
13286
13286
|
}
|
|
13287
|
+
function unsetIn(header, value, env) {
|
|
13288
|
+
const missing = missingPlaceholders(value, env);
|
|
13289
|
+
if (missing.length === 0) return void 0;
|
|
13290
|
+
return `unset variable ${missing.join(", ")} in header '${header}'`;
|
|
13291
|
+
}
|
|
13292
|
+
function hide(hidden, template, expanded, env) {
|
|
13293
|
+
if (template) hidden.add(template);
|
|
13294
|
+
if (expanded) hidden.add(expanded);
|
|
13295
|
+
for (const p of placeholderValues(template, env)) hidden.add(p);
|
|
13296
|
+
}
|
|
13287
13297
|
async function resolveProxyConfig(platform2, target, connectHeaders, hiddenValues, version) {
|
|
13288
13298
|
const config = await MergedConfigSource.load(platform2);
|
|
13289
13299
|
const entry = await config.get(target);
|
|
13290
13300
|
if (!entry) return `unknown target '${target}'`;
|
|
13291
13301
|
if ("url" in entry && entry.url) {
|
|
13292
|
-
const expanded =
|
|
13293
|
-
|
|
13294
|
-
|
|
13295
|
-
|
|
13296
|
-
|
|
13297
|
-
|
|
13298
|
-
if (entry.headers) {
|
|
13299
|
-
for (const v of Object.values(entry.headers)) {
|
|
13300
|
-
hiddenValues.add(v);
|
|
13301
|
-
for (const p of placeholderValues(v, platform2.env)) hiddenValues.add(p);
|
|
13302
|
-
}
|
|
13302
|
+
const expanded = {};
|
|
13303
|
+
for (const [k, v] of Object.entries(entry.headers ?? {})) {
|
|
13304
|
+
const missing = unsetIn(k, v, platform2.env);
|
|
13305
|
+
if (missing) return missing;
|
|
13306
|
+
expanded[k] = expandPlaceholders(v, platform2.env);
|
|
13307
|
+
hide(hiddenValues, v, expanded[k], platform2.env);
|
|
13303
13308
|
}
|
|
13309
|
+
const merged = { ...expanded, ...connectHeaders };
|
|
13304
13310
|
return { url: entry.url, headers: merged, version };
|
|
13305
13311
|
}
|
|
13306
13312
|
if ("command" in entry && entry.command) {
|
|
@@ -13319,12 +13325,12 @@ async function buildProxyConnectOpts(platform2, options, version) {
|
|
|
13319
13325
|
const connectHeaders = {};
|
|
13320
13326
|
const hiddenValues = /* @__PURE__ */ new Set();
|
|
13321
13327
|
for (const [k, v] of options.proxyHeaders) {
|
|
13322
|
-
const
|
|
13323
|
-
if (
|
|
13328
|
+
const missing = unsetIn(k, v, platform2.env);
|
|
13329
|
+
if (missing) return { error: missing };
|
|
13330
|
+
const expanded = expandPlaceholders(v, platform2.env);
|
|
13324
13331
|
const key = k.toLowerCase() === "authorization" ? "Authorization" : k;
|
|
13325
13332
|
connectHeaders[key] = expanded;
|
|
13326
|
-
hiddenValues.
|
|
13327
|
-
for (const p of placeholderValues(v, platform2.env)) hiddenValues.add(p);
|
|
13333
|
+
hide(hiddenValues, v, expanded, platform2.env);
|
|
13328
13334
|
}
|
|
13329
13335
|
const isUrl = target.startsWith("http://") || target.startsWith("https://") || target.includes(".");
|
|
13330
13336
|
let connectOpts;
|
|
@@ -15556,6 +15562,7 @@ Options:
|
|
|
15556
15562
|
-v, --verbose Trace on stderr
|
|
15557
15563
|
--silent Suppress progress
|
|
15558
15564
|
-o, --output <path> Write result to file
|
|
15565
|
+
--no-input Never prompt (non-TTY implies it)
|
|
15559
15566
|
-V, --version Print version
|
|
15560
15567
|
-h, --help Show this help
|
|
15561
15568
|
`;
|
|
@@ -15609,6 +15616,7 @@ function parseFlags(args2) {
|
|
|
15609
15616
|
const positional = [];
|
|
15610
15617
|
let trailingCommand;
|
|
15611
15618
|
let respondArg;
|
|
15619
|
+
let noInput = false;
|
|
15612
15620
|
const roots = [];
|
|
15613
15621
|
let outputPath;
|
|
15614
15622
|
let noValidate = false;
|
|
@@ -15655,6 +15663,8 @@ function parseFlags(args2) {
|
|
|
15655
15663
|
timeoutMs = Number(args2[++i]) * 1e3;
|
|
15656
15664
|
} else if (arg === "--respond" && args2[i + 1]) {
|
|
15657
15665
|
respondArg = args2[++i];
|
|
15666
|
+
} else if (arg === "--no-input") {
|
|
15667
|
+
noInput = true;
|
|
15658
15668
|
} else if (arg === "--root" && args2[i + 1]) {
|
|
15659
15669
|
roots.push(args2[++i]);
|
|
15660
15670
|
} else if ((arg === "-o" || arg === "--output") && args2[i + 1]) {
|
|
@@ -15681,6 +15691,10 @@ function parseFlags(args2) {
|
|
|
15681
15691
|
jsonOutput = true;
|
|
15682
15692
|
} else if (ra === "--no-validate") {
|
|
15683
15693
|
noValidate = true;
|
|
15694
|
+
} else if (ra === "--no-input") {
|
|
15695
|
+
noInput = true;
|
|
15696
|
+
} else if (ra === "--respond" && rest[j + 1] !== void 0) {
|
|
15697
|
+
respondArg = rest[++j];
|
|
15684
15698
|
} else if ((ra === "-o" || ra === "--output") && rest[j + 1] !== void 0) {
|
|
15685
15699
|
outputPath = rest[++j];
|
|
15686
15700
|
} else if (ra === "--help" || ra === "-h") {
|
|
@@ -15710,6 +15724,7 @@ function parseFlags(args2) {
|
|
|
15710
15724
|
positional,
|
|
15711
15725
|
trailingCommand,
|
|
15712
15726
|
respondArg,
|
|
15727
|
+
noInput,
|
|
15713
15728
|
roots,
|
|
15714
15729
|
outputPath,
|
|
15715
15730
|
noValidate,
|
|
@@ -15767,6 +15782,7 @@ function parseArgs(args2) {
|
|
|
15767
15782
|
silent: flags.silent,
|
|
15768
15783
|
noValidate: flags.noValidate,
|
|
15769
15784
|
respondArg: flags.respondArg,
|
|
15785
|
+
noInput: flags.noInput,
|
|
15770
15786
|
roots: flags.roots,
|
|
15771
15787
|
outputPath: flags.outputPath
|
|
15772
15788
|
};
|
|
@@ -16591,7 +16607,7 @@ async function loadRespondData(platform2, respondArg, json) {
|
|
|
16591
16607
|
return { exitCode: EXIT_USAGE };
|
|
16592
16608
|
}
|
|
16593
16609
|
}
|
|
16594
|
-
async function handleInputRequired(platform2, conn, err, respondData, json, redact2) {
|
|
16610
|
+
async function handleInputRequired(platform2, conn, err, respondData, json, redact2, noInput) {
|
|
16595
16611
|
const parsed2 = JSON.parse(err.requestJson);
|
|
16596
16612
|
const requestOut = sanitizeJson(JSON.stringify(redactDeep(parsed2, redact2), null, 2));
|
|
16597
16613
|
const inputReq = parseInputRequest(parsed2.result ?? parsed2);
|
|
@@ -16600,7 +16616,7 @@ async function handleInputRequired(platform2, conn, err, respondData, json, reda
|
|
|
16600
16616
|
`);
|
|
16601
16617
|
return EXIT_INPUT_REQUIRED;
|
|
16602
16618
|
}
|
|
16603
|
-
const isTty = platform2.kind === "host" && platform2.isatty(0) && platform2.isatty(2);
|
|
16619
|
+
const isTty = !noInput && platform2.kind === "host" && platform2.isatty(0) && platform2.isatty(2);
|
|
16604
16620
|
const elicitResult = await handleElicitation(
|
|
16605
16621
|
redactWrites(platform2, redact2),
|
|
16606
16622
|
inputReq,
|
|
@@ -16770,7 +16786,15 @@ async function runClientVerb(platform2, version, parsed) {
|
|
|
16770
16786
|
return termExitCode;
|
|
16771
16787
|
}
|
|
16772
16788
|
if (err instanceof InputRequiredError) {
|
|
16773
|
-
return await handleInputRequired(
|
|
16789
|
+
return await handleInputRequired(
|
|
16790
|
+
platform2,
|
|
16791
|
+
conn,
|
|
16792
|
+
err,
|
|
16793
|
+
respondData,
|
|
16794
|
+
parsed.jsonOutput,
|
|
16795
|
+
redact2,
|
|
16796
|
+
parsed.noInput
|
|
16797
|
+
);
|
|
16774
16798
|
}
|
|
16775
16799
|
const e = classifyError(err);
|
|
16776
16800
|
await writeErrRedacted(platform2, parsed.jsonOutput, e.kind, e.msg, redact2);
|
|
@@ -17072,5 +17096,5 @@ try {
|
|
|
17072
17096
|
});
|
|
17073
17097
|
} catch {
|
|
17074
17098
|
}
|
|
17075
|
-
var code = await run(platform, "0.
|
|
17099
|
+
var code = await run(platform, "0.18.0", args);
|
|
17076
17100
|
process.exit(code);
|
package/dist/kernel/mcpcat.mjs
CHANGED
|
@@ -12905,23 +12905,29 @@ function resolveProxyUrl(target, headers, version) {
|
|
|
12905
12905
|
const url = target.startsWith("http") ? target : `https://${target}`;
|
|
12906
12906
|
return { url, headers, version };
|
|
12907
12907
|
}
|
|
12908
|
+
function unsetIn(header, value, env2) {
|
|
12909
|
+
const missing = missingPlaceholders(value, env2);
|
|
12910
|
+
if (missing.length === 0) return void 0;
|
|
12911
|
+
return `unset variable ${missing.join(", ")} in header '${header}'`;
|
|
12912
|
+
}
|
|
12913
|
+
function hide(hidden, template, expanded, env2) {
|
|
12914
|
+
if (template) hidden.add(template);
|
|
12915
|
+
if (expanded) hidden.add(expanded);
|
|
12916
|
+
for (const p of placeholderValues(template, env2)) hidden.add(p);
|
|
12917
|
+
}
|
|
12908
12918
|
async function resolveProxyConfig(platform2, target, connectHeaders, hiddenValues, version) {
|
|
12909
12919
|
const config = await MergedConfigSource.load(platform2);
|
|
12910
12920
|
const entry = await config.get(target);
|
|
12911
12921
|
if (!entry) return `unknown target '${target}'`;
|
|
12912
12922
|
if ("url" in entry && entry.url) {
|
|
12913
|
-
const expanded =
|
|
12914
|
-
|
|
12915
|
-
|
|
12916
|
-
|
|
12917
|
-
|
|
12918
|
-
|
|
12919
|
-
if (entry.headers) {
|
|
12920
|
-
for (const v of Object.values(entry.headers)) {
|
|
12921
|
-
hiddenValues.add(v);
|
|
12922
|
-
for (const p of placeholderValues(v, platform2.env)) hiddenValues.add(p);
|
|
12923
|
-
}
|
|
12923
|
+
const expanded = {};
|
|
12924
|
+
for (const [k, v] of Object.entries(entry.headers ?? {})) {
|
|
12925
|
+
const missing = unsetIn(k, v, platform2.env);
|
|
12926
|
+
if (missing) return missing;
|
|
12927
|
+
expanded[k] = expandPlaceholders(v, platform2.env);
|
|
12928
|
+
hide(hiddenValues, v, expanded[k], platform2.env);
|
|
12924
12929
|
}
|
|
12930
|
+
const merged = { ...expanded, ...connectHeaders };
|
|
12925
12931
|
return { url: entry.url, headers: merged, version };
|
|
12926
12932
|
}
|
|
12927
12933
|
if ("command" in entry && entry.command) {
|
|
@@ -12940,12 +12946,12 @@ async function buildProxyConnectOpts(platform2, options, version) {
|
|
|
12940
12946
|
const connectHeaders = {};
|
|
12941
12947
|
const hiddenValues = /* @__PURE__ */ new Set();
|
|
12942
12948
|
for (const [k, v] of options.proxyHeaders) {
|
|
12943
|
-
const
|
|
12944
|
-
if (
|
|
12949
|
+
const missing = unsetIn(k, v, platform2.env);
|
|
12950
|
+
if (missing) return { error: missing };
|
|
12951
|
+
const expanded = expandPlaceholders(v, platform2.env);
|
|
12945
12952
|
const key = k.toLowerCase() === "authorization" ? "Authorization" : k;
|
|
12946
12953
|
connectHeaders[key] = expanded;
|
|
12947
|
-
hiddenValues.
|
|
12948
|
-
for (const p of placeholderValues(v, platform2.env)) hiddenValues.add(p);
|
|
12954
|
+
hide(hiddenValues, v, expanded, platform2.env);
|
|
12949
12955
|
}
|
|
12950
12956
|
const isUrl = target.startsWith("http://") || target.startsWith("https://") || target.includes(".");
|
|
12951
12957
|
let connectOpts;
|
|
@@ -15177,6 +15183,7 @@ Options:
|
|
|
15177
15183
|
-v, --verbose Trace on stderr
|
|
15178
15184
|
--silent Suppress progress
|
|
15179
15185
|
-o, --output <path> Write result to file
|
|
15186
|
+
--no-input Never prompt (non-TTY implies it)
|
|
15180
15187
|
-V, --version Print version
|
|
15181
15188
|
-h, --help Show this help
|
|
15182
15189
|
`;
|
|
@@ -15230,6 +15237,7 @@ function parseFlags(args) {
|
|
|
15230
15237
|
const positional = [];
|
|
15231
15238
|
let trailingCommand;
|
|
15232
15239
|
let respondArg;
|
|
15240
|
+
let noInput = false;
|
|
15233
15241
|
const roots = [];
|
|
15234
15242
|
let outputPath;
|
|
15235
15243
|
let noValidate = false;
|
|
@@ -15276,6 +15284,8 @@ function parseFlags(args) {
|
|
|
15276
15284
|
timeoutMs = Number(args[++i]) * 1e3;
|
|
15277
15285
|
} else if (arg === "--respond" && args[i + 1]) {
|
|
15278
15286
|
respondArg = args[++i];
|
|
15287
|
+
} else if (arg === "--no-input") {
|
|
15288
|
+
noInput = true;
|
|
15279
15289
|
} else if (arg === "--root" && args[i + 1]) {
|
|
15280
15290
|
roots.push(args[++i]);
|
|
15281
15291
|
} else if ((arg === "-o" || arg === "--output") && args[i + 1]) {
|
|
@@ -15302,6 +15312,10 @@ function parseFlags(args) {
|
|
|
15302
15312
|
jsonOutput = true;
|
|
15303
15313
|
} else if (ra === "--no-validate") {
|
|
15304
15314
|
noValidate = true;
|
|
15315
|
+
} else if (ra === "--no-input") {
|
|
15316
|
+
noInput = true;
|
|
15317
|
+
} else if (ra === "--respond" && rest[j + 1] !== void 0) {
|
|
15318
|
+
respondArg = rest[++j];
|
|
15305
15319
|
} else if ((ra === "-o" || ra === "--output") && rest[j + 1] !== void 0) {
|
|
15306
15320
|
outputPath = rest[++j];
|
|
15307
15321
|
} else if (ra === "--help" || ra === "-h") {
|
|
@@ -15331,6 +15345,7 @@ function parseFlags(args) {
|
|
|
15331
15345
|
positional,
|
|
15332
15346
|
trailingCommand,
|
|
15333
15347
|
respondArg,
|
|
15348
|
+
noInput,
|
|
15334
15349
|
roots,
|
|
15335
15350
|
outputPath,
|
|
15336
15351
|
noValidate,
|
|
@@ -15388,6 +15403,7 @@ function parseArgs(args) {
|
|
|
15388
15403
|
silent: flags.silent,
|
|
15389
15404
|
noValidate: flags.noValidate,
|
|
15390
15405
|
respondArg: flags.respondArg,
|
|
15406
|
+
noInput: flags.noInput,
|
|
15391
15407
|
roots: flags.roots,
|
|
15392
15408
|
outputPath: flags.outputPath
|
|
15393
15409
|
};
|
|
@@ -16212,7 +16228,7 @@ async function loadRespondData(platform2, respondArg, json) {
|
|
|
16212
16228
|
return { exitCode: EXIT_USAGE };
|
|
16213
16229
|
}
|
|
16214
16230
|
}
|
|
16215
|
-
async function handleInputRequired(platform2, conn, err, respondData, json, redact2) {
|
|
16231
|
+
async function handleInputRequired(platform2, conn, err, respondData, json, redact2, noInput) {
|
|
16216
16232
|
const parsed2 = JSON.parse(err.requestJson);
|
|
16217
16233
|
const requestOut = sanitizeJson(JSON.stringify(redactDeep(parsed2, redact2), null, 2));
|
|
16218
16234
|
const inputReq = parseInputRequest(parsed2.result ?? parsed2);
|
|
@@ -16221,7 +16237,7 @@ async function handleInputRequired(platform2, conn, err, respondData, json, reda
|
|
|
16221
16237
|
`);
|
|
16222
16238
|
return EXIT_INPUT_REQUIRED;
|
|
16223
16239
|
}
|
|
16224
|
-
const isTty = platform2.kind === "host" && platform2.isatty(0) && platform2.isatty(2);
|
|
16240
|
+
const isTty = !noInput && platform2.kind === "host" && platform2.isatty(0) && platform2.isatty(2);
|
|
16225
16241
|
const elicitResult = await handleElicitation(
|
|
16226
16242
|
redactWrites(platform2, redact2),
|
|
16227
16243
|
inputReq,
|
|
@@ -16391,7 +16407,15 @@ async function runClientVerb(platform2, version, parsed) {
|
|
|
16391
16407
|
return termExitCode;
|
|
16392
16408
|
}
|
|
16393
16409
|
if (err instanceof InputRequiredError) {
|
|
16394
|
-
return await handleInputRequired(
|
|
16410
|
+
return await handleInputRequired(
|
|
16411
|
+
platform2,
|
|
16412
|
+
conn,
|
|
16413
|
+
err,
|
|
16414
|
+
respondData,
|
|
16415
|
+
parsed.jsonOutput,
|
|
16416
|
+
redact2,
|
|
16417
|
+
parsed.noInput
|
|
16418
|
+
);
|
|
16395
16419
|
}
|
|
16396
16420
|
const e = classifyError(err);
|
|
16397
16421
|
await writeErrRedacted(platform2, parsed.jsonOutput, e.kind, e.msg, redact2);
|
|
@@ -16794,7 +16818,7 @@ async function main(ctx) {
|
|
|
16794
16818
|
packageDir: "/node_modules/@ai-ecoverse/mcpcat"
|
|
16795
16819
|
});
|
|
16796
16820
|
const args = ctx.argv.slice(1);
|
|
16797
|
-
return run(platform2, "0.
|
|
16821
|
+
return run(platform2, "0.18.0", args);
|
|
16798
16822
|
}
|
|
16799
16823
|
export {
|
|
16800
16824
|
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.18.0",
|
|
4
4
|
"description": "A curl for the Model Context Protocol",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -62,14 +62,14 @@
|
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
64
|
"@ai-ecoverse/slicc-bios": "1.38.0",
|
|
65
|
-
"@ai-ecoverse/slicc-kernel": "1.
|
|
66
|
-
"@ai-ecoverse/slicc-shared-web": "1.29.
|
|
65
|
+
"@ai-ecoverse/slicc-kernel": "1.143.1",
|
|
66
|
+
"@ai-ecoverse/slicc-shared-web": "1.29.16",
|
|
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.
|
|
72
|
+
"kernel-cert-new": "npm:@ai-ecoverse/slicc-kernel@1.143.1",
|
|
73
73
|
"lefthook": "2.2.2",
|
|
74
74
|
"monocart-coverage-reports": "2.13.2",
|
|
75
75
|
"proper-lockfile": "4.1.2",
|