@ai-ecoverse/mcpcat 0.17.11 → 0.18.1

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.
@@ -12858,15 +12858,18 @@ async function runCommand(platform2, cmdPath, argv, childEnv, stdin, timeoutMs,
12858
12858
  r.releaseLock();
12859
12859
  }
12860
12860
  };
12861
- const timer = new Promise(
12862
- (resolve) => setTimeout(() => resolve("timeout"), timeoutMs)
12863
- );
12861
+ let timerId;
12862
+ let onAbort;
12863
+ const timer = new Promise((resolve) => {
12864
+ timerId = setTimeout(() => resolve("timeout"), timeoutMs);
12865
+ });
12864
12866
  const abortPromise = signal ? new Promise((resolve) => {
12865
12867
  if (signal.aborted) {
12866
12868
  resolve("timeout");
12867
12869
  return;
12868
12870
  }
12869
- signal.addEventListener("abort", () => resolve("timeout"), { once: true });
12871
+ onAbort = () => resolve("timeout");
12872
+ signal.addEventListener("abort", onAbort, { once: true });
12870
12873
  }) : null;
12871
12874
  const work = Promise.all([
12872
12875
  readStream3(proc.stdout, stdoutChunks),
@@ -12878,7 +12881,13 @@ async function runCommand(platform2, cmdPath, argv, childEnv, stdin, timeoutMs,
12878
12881
  timer
12879
12882
  ];
12880
12883
  if (abortPromise !== null) racers.push(abortPromise);
12881
- const result = await Promise.race(racers);
12884
+ let result;
12885
+ try {
12886
+ result = await Promise.race(racers);
12887
+ } finally {
12888
+ clearTimeout(timerId);
12889
+ if (onAbort) signal?.removeEventListener("abort", onAbort);
12890
+ }
12882
12891
  if (result === "timeout") {
12883
12892
  await proc.kill("SIGTERM");
12884
12893
  if (!signal?.aborted) {
@@ -15562,6 +15571,7 @@ Options:
15562
15571
  -v, --verbose Trace on stderr
15563
15572
  --silent Suppress progress
15564
15573
  -o, --output <path> Write result to file
15574
+ --no-input Never prompt (non-TTY implies it)
15565
15575
  -V, --version Print version
15566
15576
  -h, --help Show this help
15567
15577
  `;
@@ -15615,6 +15625,7 @@ function parseFlags(args2) {
15615
15625
  const positional = [];
15616
15626
  let trailingCommand;
15617
15627
  let respondArg;
15628
+ let noInput = false;
15618
15629
  const roots = [];
15619
15630
  let outputPath;
15620
15631
  let noValidate = false;
@@ -15661,6 +15672,8 @@ function parseFlags(args2) {
15661
15672
  timeoutMs = Number(args2[++i]) * 1e3;
15662
15673
  } else if (arg === "--respond" && args2[i + 1]) {
15663
15674
  respondArg = args2[++i];
15675
+ } else if (arg === "--no-input") {
15676
+ noInput = true;
15664
15677
  } else if (arg === "--root" && args2[i + 1]) {
15665
15678
  roots.push(args2[++i]);
15666
15679
  } else if ((arg === "-o" || arg === "--output") && args2[i + 1]) {
@@ -15687,6 +15700,10 @@ function parseFlags(args2) {
15687
15700
  jsonOutput = true;
15688
15701
  } else if (ra === "--no-validate") {
15689
15702
  noValidate = true;
15703
+ } else if (ra === "--no-input") {
15704
+ noInput = true;
15705
+ } else if (ra === "--respond" && rest[j + 1] !== void 0) {
15706
+ respondArg = rest[++j];
15690
15707
  } else if ((ra === "-o" || ra === "--output") && rest[j + 1] !== void 0) {
15691
15708
  outputPath = rest[++j];
15692
15709
  } else if (ra === "--help" || ra === "-h") {
@@ -15716,6 +15733,7 @@ function parseFlags(args2) {
15716
15733
  positional,
15717
15734
  trailingCommand,
15718
15735
  respondArg,
15736
+ noInput,
15719
15737
  roots,
15720
15738
  outputPath,
15721
15739
  noValidate,
@@ -15773,6 +15791,7 @@ function parseArgs(args2) {
15773
15791
  silent: flags.silent,
15774
15792
  noValidate: flags.noValidate,
15775
15793
  respondArg: flags.respondArg,
15794
+ noInput: flags.noInput,
15776
15795
  roots: flags.roots,
15777
15796
  outputPath: flags.outputPath
15778
15797
  };
@@ -16597,7 +16616,7 @@ async function loadRespondData(platform2, respondArg, json) {
16597
16616
  return { exitCode: EXIT_USAGE };
16598
16617
  }
16599
16618
  }
16600
- async function handleInputRequired(platform2, conn, err, respondData, json, redact2) {
16619
+ async function handleInputRequired(platform2, conn, err, respondData, json, redact2, noInput) {
16601
16620
  const parsed2 = JSON.parse(err.requestJson);
16602
16621
  const requestOut = sanitizeJson(JSON.stringify(redactDeep(parsed2, redact2), null, 2));
16603
16622
  const inputReq = parseInputRequest(parsed2.result ?? parsed2);
@@ -16606,7 +16625,7 @@ async function handleInputRequired(platform2, conn, err, respondData, json, reda
16606
16625
  `);
16607
16626
  return EXIT_INPUT_REQUIRED;
16608
16627
  }
16609
- const isTty = platform2.kind === "host" && platform2.isatty(0) && platform2.isatty(2);
16628
+ const isTty = !noInput && platform2.kind === "host" && platform2.isatty(0) && platform2.isatty(2);
16610
16629
  const elicitResult = await handleElicitation(
16611
16630
  redactWrites(platform2, redact2),
16612
16631
  inputReq,
@@ -16776,7 +16795,15 @@ async function runClientVerb(platform2, version, parsed) {
16776
16795
  return termExitCode;
16777
16796
  }
16778
16797
  if (err instanceof InputRequiredError) {
16779
- return await handleInputRequired(platform2, conn, err, respondData, parsed.jsonOutput, redact2);
16798
+ return await handleInputRequired(
16799
+ platform2,
16800
+ conn,
16801
+ err,
16802
+ respondData,
16803
+ parsed.jsonOutput,
16804
+ redact2,
16805
+ parsed.noInput
16806
+ );
16780
16807
  }
16781
16808
  const e = classifyError(err);
16782
16809
  await writeErrRedacted(platform2, parsed.jsonOutput, e.kind, e.msg, redact2);
@@ -17078,5 +17105,5 @@ try {
17078
17105
  });
17079
17106
  } catch {
17080
17107
  }
17081
- var code = await run(platform, "0.17.11", args);
17108
+ var code = await run(platform, "0.18.1", args);
17082
17109
  process.exit(code);
@@ -12479,15 +12479,18 @@ async function runCommand(platform2, cmdPath, argv, childEnv, stdin, timeoutMs,
12479
12479
  r.releaseLock();
12480
12480
  }
12481
12481
  };
12482
- const timer = new Promise(
12483
- (resolve2) => setTimeout(() => resolve2("timeout"), timeoutMs)
12484
- );
12482
+ let timerId;
12483
+ let onAbort;
12484
+ const timer = new Promise((resolve2) => {
12485
+ timerId = setTimeout(() => resolve2("timeout"), timeoutMs);
12486
+ });
12485
12487
  const abortPromise = signal ? new Promise((resolve2) => {
12486
12488
  if (signal.aborted) {
12487
12489
  resolve2("timeout");
12488
12490
  return;
12489
12491
  }
12490
- signal.addEventListener("abort", () => resolve2("timeout"), { once: true });
12492
+ onAbort = () => resolve2("timeout");
12493
+ signal.addEventListener("abort", onAbort, { once: true });
12491
12494
  }) : null;
12492
12495
  const work = Promise.all([
12493
12496
  readStream3(proc.stdout, stdoutChunks),
@@ -12499,7 +12502,13 @@ async function runCommand(platform2, cmdPath, argv, childEnv, stdin, timeoutMs,
12499
12502
  timer
12500
12503
  ];
12501
12504
  if (abortPromise !== null) racers.push(abortPromise);
12502
- const result = await Promise.race(racers);
12505
+ let result;
12506
+ try {
12507
+ result = await Promise.race(racers);
12508
+ } finally {
12509
+ clearTimeout(timerId);
12510
+ if (onAbort) signal?.removeEventListener("abort", onAbort);
12511
+ }
12503
12512
  if (result === "timeout") {
12504
12513
  await proc.kill("SIGTERM");
12505
12514
  if (!signal?.aborted) {
@@ -15183,6 +15192,7 @@ Options:
15183
15192
  -v, --verbose Trace on stderr
15184
15193
  --silent Suppress progress
15185
15194
  -o, --output <path> Write result to file
15195
+ --no-input Never prompt (non-TTY implies it)
15186
15196
  -V, --version Print version
15187
15197
  -h, --help Show this help
15188
15198
  `;
@@ -15236,6 +15246,7 @@ function parseFlags(args) {
15236
15246
  const positional = [];
15237
15247
  let trailingCommand;
15238
15248
  let respondArg;
15249
+ let noInput = false;
15239
15250
  const roots = [];
15240
15251
  let outputPath;
15241
15252
  let noValidate = false;
@@ -15282,6 +15293,8 @@ function parseFlags(args) {
15282
15293
  timeoutMs = Number(args[++i]) * 1e3;
15283
15294
  } else if (arg === "--respond" && args[i + 1]) {
15284
15295
  respondArg = args[++i];
15296
+ } else if (arg === "--no-input") {
15297
+ noInput = true;
15285
15298
  } else if (arg === "--root" && args[i + 1]) {
15286
15299
  roots.push(args[++i]);
15287
15300
  } else if ((arg === "-o" || arg === "--output") && args[i + 1]) {
@@ -15308,6 +15321,10 @@ function parseFlags(args) {
15308
15321
  jsonOutput = true;
15309
15322
  } else if (ra === "--no-validate") {
15310
15323
  noValidate = true;
15324
+ } else if (ra === "--no-input") {
15325
+ noInput = true;
15326
+ } else if (ra === "--respond" && rest[j + 1] !== void 0) {
15327
+ respondArg = rest[++j];
15311
15328
  } else if ((ra === "-o" || ra === "--output") && rest[j + 1] !== void 0) {
15312
15329
  outputPath = rest[++j];
15313
15330
  } else if (ra === "--help" || ra === "-h") {
@@ -15337,6 +15354,7 @@ function parseFlags(args) {
15337
15354
  positional,
15338
15355
  trailingCommand,
15339
15356
  respondArg,
15357
+ noInput,
15340
15358
  roots,
15341
15359
  outputPath,
15342
15360
  noValidate,
@@ -15394,6 +15412,7 @@ function parseArgs(args) {
15394
15412
  silent: flags.silent,
15395
15413
  noValidate: flags.noValidate,
15396
15414
  respondArg: flags.respondArg,
15415
+ noInput: flags.noInput,
15397
15416
  roots: flags.roots,
15398
15417
  outputPath: flags.outputPath
15399
15418
  };
@@ -16218,7 +16237,7 @@ async function loadRespondData(platform2, respondArg, json) {
16218
16237
  return { exitCode: EXIT_USAGE };
16219
16238
  }
16220
16239
  }
16221
- async function handleInputRequired(platform2, conn, err, respondData, json, redact2) {
16240
+ async function handleInputRequired(platform2, conn, err, respondData, json, redact2, noInput) {
16222
16241
  const parsed2 = JSON.parse(err.requestJson);
16223
16242
  const requestOut = sanitizeJson(JSON.stringify(redactDeep(parsed2, redact2), null, 2));
16224
16243
  const inputReq = parseInputRequest(parsed2.result ?? parsed2);
@@ -16227,7 +16246,7 @@ async function handleInputRequired(platform2, conn, err, respondData, json, reda
16227
16246
  `);
16228
16247
  return EXIT_INPUT_REQUIRED;
16229
16248
  }
16230
- const isTty = platform2.kind === "host" && platform2.isatty(0) && platform2.isatty(2);
16249
+ const isTty = !noInput && platform2.kind === "host" && platform2.isatty(0) && platform2.isatty(2);
16231
16250
  const elicitResult = await handleElicitation(
16232
16251
  redactWrites(platform2, redact2),
16233
16252
  inputReq,
@@ -16397,7 +16416,15 @@ async function runClientVerb(platform2, version, parsed) {
16397
16416
  return termExitCode;
16398
16417
  }
16399
16418
  if (err instanceof InputRequiredError) {
16400
- return await handleInputRequired(platform2, conn, err, respondData, parsed.jsonOutput, redact2);
16419
+ return await handleInputRequired(
16420
+ platform2,
16421
+ conn,
16422
+ err,
16423
+ respondData,
16424
+ parsed.jsonOutput,
16425
+ redact2,
16426
+ parsed.noInput
16427
+ );
16401
16428
  }
16402
16429
  const e = classifyError(err);
16403
16430
  await writeErrRedacted(platform2, parsed.jsonOutput, e.kind, e.msg, redact2);
@@ -16800,7 +16827,7 @@ async function main(ctx) {
16800
16827
  packageDir: "/node_modules/@ai-ecoverse/mcpcat"
16801
16828
  });
16802
16829
  const args = ctx.argv.slice(1);
16803
- return run(platform2, "0.17.11", args);
16830
+ return run(platform2, "0.18.1", args);
16804
16831
  }
16805
16832
  export {
16806
16833
  main as default
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-ecoverse/mcpcat",
3
- "version": "0.17.11",
3
+ "version": "0.18.1",
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.142.1",
66
- "@ai-ecoverse/slicc-shared-web": "1.29.16",
65
+ "@ai-ecoverse/slicc-kernel": "1.143.2",
66
+ "@ai-ecoverse/slicc-shared-web": "1.30.1",
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.142.1",
72
+ "kernel-cert-new": "npm:@ai-ecoverse/slicc-kernel@1.143.2",
73
73
  "lefthook": "2.2.2",
74
74
  "monocart-coverage-reports": "2.13.2",
75
75
  "proper-lockfile": "4.1.2",