@ai-ecoverse/mcpcat 0.23.0 → 0.23.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.
- package/dist/host/mcpcat.mjs +72 -18
- package/dist/kernel/mcpcat.mjs +72 -18
- package/package.json +2 -2
package/dist/host/mcpcat.mjs
CHANGED
|
@@ -12739,6 +12739,7 @@ var DIALOG_ANSWER_MS = 7e3;
|
|
|
12739
12739
|
var DIALOG_CLAIM_MS = 1e3;
|
|
12740
12740
|
var DIALOG_MODES = ["report", "dismiss", "accept"];
|
|
12741
12741
|
var LABEL2 = "mcpcat serve --webmcp";
|
|
12742
|
+
var REFUSED = "playwright-cli refuses to answer it (protected, unverified or in a frame)";
|
|
12742
12743
|
function parseHoldEvent(line) {
|
|
12743
12744
|
try {
|
|
12744
12745
|
const value = JSON.parse(line);
|
|
@@ -12786,8 +12787,22 @@ function startDialogHolder(platform2, options) {
|
|
|
12786
12787
|
let delay = HOLDER_RESTART_MIN_MS;
|
|
12787
12788
|
let readyAt;
|
|
12788
12789
|
let restartTimer;
|
|
12789
|
-
let
|
|
12790
|
-
let
|
|
12790
|
+
let settled = true;
|
|
12791
|
+
let pending = Promise.resolve();
|
|
12792
|
+
let settle = () => {
|
|
12793
|
+
};
|
|
12794
|
+
const unready = () => {
|
|
12795
|
+
isReady = false;
|
|
12796
|
+
waitedOut = false;
|
|
12797
|
+
if (!settled) return;
|
|
12798
|
+
settled = false;
|
|
12799
|
+
pending = new Promise((resolve) => {
|
|
12800
|
+
settle = () => {
|
|
12801
|
+
settled = true;
|
|
12802
|
+
resolve();
|
|
12803
|
+
};
|
|
12804
|
+
});
|
|
12805
|
+
};
|
|
12791
12806
|
let exited = Promise.resolve();
|
|
12792
12807
|
const report = reporter(options);
|
|
12793
12808
|
const send = async (id, dialogId) => {
|
|
@@ -12835,15 +12850,11 @@ function startDialogHolder(platform2, options) {
|
|
|
12835
12850
|
current = { id: event.dialogId, armed: armed > 0 };
|
|
12836
12851
|
if (current.armed) answer(current);
|
|
12837
12852
|
} else if (event.event === "dialog-refused" && isId(event.dialogId)) {
|
|
12838
|
-
current = {
|
|
12839
|
-
id: event.dialogId,
|
|
12840
|
-
armed: armed > 0,
|
|
12841
|
-
problem: "playwright-cli refuses to answer it (protected, unverified or in a frame)"
|
|
12842
|
-
};
|
|
12853
|
+
current = { id: event.dialogId, armed: armed > 0, problem: REFUSED };
|
|
12843
12854
|
} else if (event.event === "dialog-closed") {
|
|
12844
12855
|
current = void 0;
|
|
12845
12856
|
} else if (event.event === "stopped") {
|
|
12846
|
-
|
|
12857
|
+
unready();
|
|
12847
12858
|
current = void 0;
|
|
12848
12859
|
}
|
|
12849
12860
|
};
|
|
@@ -12851,16 +12862,11 @@ function startDialogHolder(platform2, options) {
|
|
|
12851
12862
|
const argv = [options.playwrightCli];
|
|
12852
12863
|
if (options.cdp) argv.push("--cdp", options.cdp);
|
|
12853
12864
|
argv.push("dialog-hold", "--tab", options.tab);
|
|
12854
|
-
waitedOut = false;
|
|
12855
|
-
pending = new Promise((resolve) => {
|
|
12856
|
-
settle = resolve;
|
|
12857
|
-
});
|
|
12858
12865
|
let child;
|
|
12859
12866
|
try {
|
|
12860
12867
|
child = await platform2.spawn({ argv, dieWithParent: true });
|
|
12861
12868
|
} catch (err2) {
|
|
12862
12869
|
report(`cannot start playwright-cli dialog-hold: ${err2.message}`);
|
|
12863
|
-
settle();
|
|
12864
12870
|
scheduleRestart();
|
|
12865
12871
|
return;
|
|
12866
12872
|
}
|
|
@@ -12869,7 +12875,6 @@ function startDialogHolder(platform2, options) {
|
|
|
12869
12875
|
await child.stdin.getWriter().close();
|
|
12870
12876
|
} catch {
|
|
12871
12877
|
}
|
|
12872
|
-
settle();
|
|
12873
12878
|
return;
|
|
12874
12879
|
}
|
|
12875
12880
|
proc = child;
|
|
@@ -12882,10 +12887,9 @@ function startDialogHolder(platform2, options) {
|
|
|
12882
12887
|
exited = Promise.all([out, err, child.wait()]).then(([, , result]) => {
|
|
12883
12888
|
proc = void 0;
|
|
12884
12889
|
writer = void 0;
|
|
12885
|
-
isReady = false;
|
|
12886
12890
|
current = void 0;
|
|
12887
12891
|
reply?.resolve("holder-gone");
|
|
12888
|
-
|
|
12892
|
+
if (!stopped) unready();
|
|
12889
12893
|
if (readyAt !== void 0 && Date.now() - readyAt >= HOLDER_STABLE_MS) {
|
|
12890
12894
|
delay = HOLDER_RESTART_MIN_MS;
|
|
12891
12895
|
}
|
|
@@ -12907,6 +12911,7 @@ function startDialogHolder(platform2, options) {
|
|
|
12907
12911
|
if (!stopped) void spawn3();
|
|
12908
12912
|
}, wait);
|
|
12909
12913
|
};
|
|
12914
|
+
unready();
|
|
12910
12915
|
void spawn3();
|
|
12911
12916
|
return {
|
|
12912
12917
|
async ready() {
|
|
@@ -12931,6 +12936,7 @@ function startDialogHolder(platform2, options) {
|
|
|
12931
12936
|
},
|
|
12932
12937
|
async stop() {
|
|
12933
12938
|
stopped = true;
|
|
12939
|
+
settle();
|
|
12934
12940
|
clearTimeout(restartTimer);
|
|
12935
12941
|
const child = proc;
|
|
12936
12942
|
const w = writer;
|
|
@@ -17743,7 +17749,8 @@ async function dispatchMultiTarget(platform2, parsed, version) {
|
|
|
17743
17749
|
}
|
|
17744
17750
|
async function run(platform2, version, args2) {
|
|
17745
17751
|
try {
|
|
17746
|
-
|
|
17752
|
+
const upgrading = upgradeArgs(args2);
|
|
17753
|
+
if (upgrading) return await upgrade(platform2, version, upgrading);
|
|
17747
17754
|
return await runInner(platform2, version, args2);
|
|
17748
17755
|
} catch (err) {
|
|
17749
17756
|
if (err.code === "EACCES") {
|
|
@@ -17759,6 +17766,53 @@ function wantsServeHelp(args2) {
|
|
|
17759
17766
|
return parseArgs(args2).verb === "serve";
|
|
17760
17767
|
}
|
|
17761
17768
|
var UPGRADE_VERBS = /* @__PURE__ */ new Set(["upgrade", "update"]);
|
|
17769
|
+
var LEADING_STOPS = /* @__PURE__ */ new Set(["--", "--help", "-h", "--version", "-V"]);
|
|
17770
|
+
var GLOBAL_VALUE_FLAGS = /* @__PURE__ */ new Set([
|
|
17771
|
+
"-H",
|
|
17772
|
+
"--header",
|
|
17773
|
+
"-d",
|
|
17774
|
+
"--protocol-version",
|
|
17775
|
+
"--budget",
|
|
17776
|
+
"-e",
|
|
17777
|
+
"-s",
|
|
17778
|
+
"--server",
|
|
17779
|
+
"-m",
|
|
17780
|
+
"--timeout",
|
|
17781
|
+
"--respond",
|
|
17782
|
+
"--root",
|
|
17783
|
+
"-o",
|
|
17784
|
+
"--output",
|
|
17785
|
+
"--memory"
|
|
17786
|
+
]);
|
|
17787
|
+
var GLOBAL_BOOLEAN_FLAGS = /* @__PURE__ */ new Set([
|
|
17788
|
+
"--schema",
|
|
17789
|
+
"--ts",
|
|
17790
|
+
"--json",
|
|
17791
|
+
"--rank",
|
|
17792
|
+
"-E",
|
|
17793
|
+
"--allow-shell",
|
|
17794
|
+
"-v",
|
|
17795
|
+
"--verbose",
|
|
17796
|
+
"--silent",
|
|
17797
|
+
"--no-input",
|
|
17798
|
+
"--no-validate"
|
|
17799
|
+
]);
|
|
17800
|
+
function upgradeArgs(args2) {
|
|
17801
|
+
const at = args2.findIndex((arg) => UPGRADE_VERBS.has(arg));
|
|
17802
|
+
if (at < 0) return void 0;
|
|
17803
|
+
const own = [];
|
|
17804
|
+
for (let i = 0; i < at; i++) {
|
|
17805
|
+
const arg = args2[i];
|
|
17806
|
+
if (LEADING_STOPS.has(arg) || !arg.startsWith("-")) return void 0;
|
|
17807
|
+
if (GLOBAL_VALUE_FLAGS.has(arg)) {
|
|
17808
|
+
if (i + 1 === at) return void 0;
|
|
17809
|
+
i++;
|
|
17810
|
+
} else if (!GLOBAL_BOOLEAN_FLAGS.has(arg)) {
|
|
17811
|
+
own.push(arg);
|
|
17812
|
+
}
|
|
17813
|
+
}
|
|
17814
|
+
return [args2[at], ...own, ...args2.slice(at + 1)];
|
|
17815
|
+
}
|
|
17762
17816
|
async function upgrade(platform2, version, args2) {
|
|
17763
17817
|
const command = args2[0];
|
|
17764
17818
|
const parsed = parseUpgradeArgs(args2.slice(1));
|
|
@@ -18873,5 +18927,5 @@ try {
|
|
|
18873
18927
|
});
|
|
18874
18928
|
} catch {
|
|
18875
18929
|
}
|
|
18876
|
-
var code = await run(platform, "0.23.
|
|
18930
|
+
var code = await run(platform, "0.23.2", args);
|
|
18877
18931
|
process.exit(code);
|
package/dist/kernel/mcpcat.mjs
CHANGED
|
@@ -12360,6 +12360,7 @@ var DIALOG_ANSWER_MS = 7e3;
|
|
|
12360
12360
|
var DIALOG_CLAIM_MS = 1e3;
|
|
12361
12361
|
var DIALOG_MODES = ["report", "dismiss", "accept"];
|
|
12362
12362
|
var LABEL2 = "mcpcat serve --webmcp";
|
|
12363
|
+
var REFUSED = "playwright-cli refuses to answer it (protected, unverified or in a frame)";
|
|
12363
12364
|
function parseHoldEvent(line) {
|
|
12364
12365
|
try {
|
|
12365
12366
|
const value = JSON.parse(line);
|
|
@@ -12407,8 +12408,22 @@ function startDialogHolder(platform2, options) {
|
|
|
12407
12408
|
let delay = HOLDER_RESTART_MIN_MS;
|
|
12408
12409
|
let readyAt;
|
|
12409
12410
|
let restartTimer;
|
|
12410
|
-
let
|
|
12411
|
-
let
|
|
12411
|
+
let settled = true;
|
|
12412
|
+
let pending = Promise.resolve();
|
|
12413
|
+
let settle = () => {
|
|
12414
|
+
};
|
|
12415
|
+
const unready = () => {
|
|
12416
|
+
isReady = false;
|
|
12417
|
+
waitedOut = false;
|
|
12418
|
+
if (!settled) return;
|
|
12419
|
+
settled = false;
|
|
12420
|
+
pending = new Promise((resolve2) => {
|
|
12421
|
+
settle = () => {
|
|
12422
|
+
settled = true;
|
|
12423
|
+
resolve2();
|
|
12424
|
+
};
|
|
12425
|
+
});
|
|
12426
|
+
};
|
|
12412
12427
|
let exited = Promise.resolve();
|
|
12413
12428
|
const report = reporter(options);
|
|
12414
12429
|
const send = async (id, dialogId) => {
|
|
@@ -12456,15 +12471,11 @@ function startDialogHolder(platform2, options) {
|
|
|
12456
12471
|
current = { id: event.dialogId, armed: armed > 0 };
|
|
12457
12472
|
if (current.armed) answer(current);
|
|
12458
12473
|
} else if (event.event === "dialog-refused" && isId(event.dialogId)) {
|
|
12459
|
-
current = {
|
|
12460
|
-
id: event.dialogId,
|
|
12461
|
-
armed: armed > 0,
|
|
12462
|
-
problem: "playwright-cli refuses to answer it (protected, unverified or in a frame)"
|
|
12463
|
-
};
|
|
12474
|
+
current = { id: event.dialogId, armed: armed > 0, problem: REFUSED };
|
|
12464
12475
|
} else if (event.event === "dialog-closed") {
|
|
12465
12476
|
current = void 0;
|
|
12466
12477
|
} else if (event.event === "stopped") {
|
|
12467
|
-
|
|
12478
|
+
unready();
|
|
12468
12479
|
current = void 0;
|
|
12469
12480
|
}
|
|
12470
12481
|
};
|
|
@@ -12472,16 +12483,11 @@ function startDialogHolder(platform2, options) {
|
|
|
12472
12483
|
const argv = [options.playwrightCli];
|
|
12473
12484
|
if (options.cdp) argv.push("--cdp", options.cdp);
|
|
12474
12485
|
argv.push("dialog-hold", "--tab", options.tab);
|
|
12475
|
-
waitedOut = false;
|
|
12476
|
-
pending = new Promise((resolve2) => {
|
|
12477
|
-
settle = resolve2;
|
|
12478
|
-
});
|
|
12479
12486
|
let child;
|
|
12480
12487
|
try {
|
|
12481
12488
|
child = await platform2.spawn({ argv, dieWithParent: true });
|
|
12482
12489
|
} catch (err2) {
|
|
12483
12490
|
report(`cannot start playwright-cli dialog-hold: ${err2.message}`);
|
|
12484
|
-
settle();
|
|
12485
12491
|
scheduleRestart();
|
|
12486
12492
|
return;
|
|
12487
12493
|
}
|
|
@@ -12490,7 +12496,6 @@ function startDialogHolder(platform2, options) {
|
|
|
12490
12496
|
await child.stdin.getWriter().close();
|
|
12491
12497
|
} catch {
|
|
12492
12498
|
}
|
|
12493
|
-
settle();
|
|
12494
12499
|
return;
|
|
12495
12500
|
}
|
|
12496
12501
|
proc = child;
|
|
@@ -12503,10 +12508,9 @@ function startDialogHolder(platform2, options) {
|
|
|
12503
12508
|
exited = Promise.all([out, err, child.wait()]).then(([, , result]) => {
|
|
12504
12509
|
proc = void 0;
|
|
12505
12510
|
writer = void 0;
|
|
12506
|
-
isReady = false;
|
|
12507
12511
|
current = void 0;
|
|
12508
12512
|
reply?.resolve("holder-gone");
|
|
12509
|
-
|
|
12513
|
+
if (!stopped) unready();
|
|
12510
12514
|
if (readyAt !== void 0 && Date.now() - readyAt >= HOLDER_STABLE_MS) {
|
|
12511
12515
|
delay = HOLDER_RESTART_MIN_MS;
|
|
12512
12516
|
}
|
|
@@ -12528,6 +12532,7 @@ function startDialogHolder(platform2, options) {
|
|
|
12528
12532
|
if (!stopped) void spawn2();
|
|
12529
12533
|
}, wait);
|
|
12530
12534
|
};
|
|
12535
|
+
unready();
|
|
12531
12536
|
void spawn2();
|
|
12532
12537
|
return {
|
|
12533
12538
|
async ready() {
|
|
@@ -12552,6 +12557,7 @@ function startDialogHolder(platform2, options) {
|
|
|
12552
12557
|
},
|
|
12553
12558
|
async stop() {
|
|
12554
12559
|
stopped = true;
|
|
12560
|
+
settle();
|
|
12555
12561
|
clearTimeout(restartTimer);
|
|
12556
12562
|
const child = proc;
|
|
12557
12563
|
const w = writer;
|
|
@@ -17260,7 +17266,8 @@ async function dispatchMultiTarget(platform2, parsed, version) {
|
|
|
17260
17266
|
}
|
|
17261
17267
|
async function run(platform2, version, args) {
|
|
17262
17268
|
try {
|
|
17263
|
-
|
|
17269
|
+
const upgrading = upgradeArgs(args);
|
|
17270
|
+
if (upgrading) return await upgrade(platform2, version, upgrading);
|
|
17264
17271
|
return await runInner(platform2, version, args);
|
|
17265
17272
|
} catch (err) {
|
|
17266
17273
|
if (err.code === "EACCES") {
|
|
@@ -17276,6 +17283,53 @@ function wantsServeHelp(args) {
|
|
|
17276
17283
|
return parseArgs(args).verb === "serve";
|
|
17277
17284
|
}
|
|
17278
17285
|
var UPGRADE_VERBS = /* @__PURE__ */ new Set(["upgrade", "update"]);
|
|
17286
|
+
var LEADING_STOPS = /* @__PURE__ */ new Set(["--", "--help", "-h", "--version", "-V"]);
|
|
17287
|
+
var GLOBAL_VALUE_FLAGS = /* @__PURE__ */ new Set([
|
|
17288
|
+
"-H",
|
|
17289
|
+
"--header",
|
|
17290
|
+
"-d",
|
|
17291
|
+
"--protocol-version",
|
|
17292
|
+
"--budget",
|
|
17293
|
+
"-e",
|
|
17294
|
+
"-s",
|
|
17295
|
+
"--server",
|
|
17296
|
+
"-m",
|
|
17297
|
+
"--timeout",
|
|
17298
|
+
"--respond",
|
|
17299
|
+
"--root",
|
|
17300
|
+
"-o",
|
|
17301
|
+
"--output",
|
|
17302
|
+
"--memory"
|
|
17303
|
+
]);
|
|
17304
|
+
var GLOBAL_BOOLEAN_FLAGS = /* @__PURE__ */ new Set([
|
|
17305
|
+
"--schema",
|
|
17306
|
+
"--ts",
|
|
17307
|
+
"--json",
|
|
17308
|
+
"--rank",
|
|
17309
|
+
"-E",
|
|
17310
|
+
"--allow-shell",
|
|
17311
|
+
"-v",
|
|
17312
|
+
"--verbose",
|
|
17313
|
+
"--silent",
|
|
17314
|
+
"--no-input",
|
|
17315
|
+
"--no-validate"
|
|
17316
|
+
]);
|
|
17317
|
+
function upgradeArgs(args) {
|
|
17318
|
+
const at = args.findIndex((arg) => UPGRADE_VERBS.has(arg));
|
|
17319
|
+
if (at < 0) return void 0;
|
|
17320
|
+
const own = [];
|
|
17321
|
+
for (let i = 0; i < at; i++) {
|
|
17322
|
+
const arg = args[i];
|
|
17323
|
+
if (LEADING_STOPS.has(arg) || !arg.startsWith("-")) return void 0;
|
|
17324
|
+
if (GLOBAL_VALUE_FLAGS.has(arg)) {
|
|
17325
|
+
if (i + 1 === at) return void 0;
|
|
17326
|
+
i++;
|
|
17327
|
+
} else if (!GLOBAL_BOOLEAN_FLAGS.has(arg)) {
|
|
17328
|
+
own.push(arg);
|
|
17329
|
+
}
|
|
17330
|
+
}
|
|
17331
|
+
return [args[at], ...own, ...args.slice(at + 1)];
|
|
17332
|
+
}
|
|
17279
17333
|
async function upgrade(platform2, version, args) {
|
|
17280
17334
|
const command = args[0];
|
|
17281
17335
|
const parsed = parseUpgradeArgs(args.slice(1));
|
|
@@ -18100,7 +18154,7 @@ async function main(ctx) {
|
|
|
18100
18154
|
packageDir: "/node_modules/@ai-ecoverse/mcpcat"
|
|
18101
18155
|
});
|
|
18102
18156
|
const args = ctx.argv.slice(1);
|
|
18103
|
-
return run(platform2, "0.23.
|
|
18157
|
+
return run(platform2, "0.23.2", args);
|
|
18104
18158
|
}
|
|
18105
18159
|
export {
|
|
18106
18160
|
main as default
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-ecoverse/mcpcat",
|
|
3
|
-
"version": "0.23.
|
|
3
|
+
"version": "0.23.2",
|
|
4
4
|
"description": "A curl for the Model Context Protocol",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"trust:dry": "npx fledgling sync --dry-run -y --skip-publish"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
|
-
"@ai-ecoverse/slicc-kernel": "1.
|
|
61
|
+
"@ai-ecoverse/slicc-kernel": "1.152.1",
|
|
62
62
|
"@ai-ecoverse/slicc-shared-web": "2.11.3",
|
|
63
63
|
"@biomejs/biome": "2.5.15",
|
|
64
64
|
"@earendil-works/pi-codemode": "1.3.0",
|