@ai-ecoverse/mcpcat 0.27.0 → 0.27.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.
@@ -8906,17 +8906,21 @@ async function createPiConnection(options) {
8906
8906
  roots: options.roots
8907
8907
  };
8908
8908
  const client = new McpClient(clientOptions);
8909
- let abortWith = () => {
8910
- };
8911
- const aborted = new Promise((_, reject) => {
8912
- abortWith = reject;
8913
- });
8914
- aborted.catch(() => {
8915
- });
8909
+ const onElicit = options.onElicit;
8910
+ const inFlight = /* @__PURE__ */ new Set();
8911
+ let abortError;
8912
+ function abortWith(err) {
8913
+ abortError ??= { err };
8914
+ for (const reject of inFlight) reject(err);
8915
+ }
8916
8916
  function guard(p) {
8917
- return Promise.race([p, aborted]);
8917
+ if (!onElicit) return p;
8918
+ return new Promise((resolve, reject) => {
8919
+ if (abortError) reject(abortError.err);
8920
+ inFlight.add(reject);
8921
+ p.then(resolve, reject).finally(() => inFlight.delete(reject));
8922
+ });
8918
8923
  }
8919
- const onElicit = options.onElicit;
8920
8924
  if (onElicit) {
8921
8925
  client.setRequestHandler("elicitation/create", async (params) => {
8922
8926
  try {
@@ -19370,5 +19374,5 @@ try {
19370
19374
  });
19371
19375
  } catch {
19372
19376
  }
19373
- var code = await run(platform, "0.27.0", args);
19377
+ var code = await run(platform, "0.27.1", args);
19374
19378
  process.exit(code);
@@ -8527,17 +8527,21 @@ async function createPiConnection(options) {
8527
8527
  roots: options.roots
8528
8528
  };
8529
8529
  const client = new McpClient(clientOptions);
8530
- let abortWith = () => {
8531
- };
8532
- const aborted = new Promise((_, reject) => {
8533
- abortWith = reject;
8534
- });
8535
- aborted.catch(() => {
8536
- });
8530
+ const onElicit = options.onElicit;
8531
+ const inFlight = /* @__PURE__ */ new Set();
8532
+ let abortError;
8533
+ function abortWith(err) {
8534
+ abortError ??= { err };
8535
+ for (const reject of inFlight) reject(err);
8536
+ }
8537
8537
  function guard(p) {
8538
- return Promise.race([p, aborted]);
8538
+ if (!onElicit) return p;
8539
+ return new Promise((resolve2, reject) => {
8540
+ if (abortError) reject(abortError.err);
8541
+ inFlight.add(reject);
8542
+ p.then(resolve2, reject).finally(() => inFlight.delete(reject));
8543
+ });
8539
8544
  }
8540
- const onElicit = options.onElicit;
8541
8545
  if (onElicit) {
8542
8546
  client.setRequestHandler("elicitation/create", async (params) => {
8543
8547
  try {
@@ -18597,7 +18601,7 @@ async function main(ctx) {
18597
18601
  packageDir: "/node_modules/@ai-ecoverse/mcpcat"
18598
18602
  });
18599
18603
  const args = ctx.argv.slice(1);
18600
- return run(platform2, "0.27.0", args);
18604
+ return run(platform2, "0.27.1", args);
18601
18605
  }
18602
18606
  export {
18603
18607
  main as default
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-ecoverse/mcpcat",
3
- "version": "0.27.0",
3
+ "version": "0.27.1",
4
4
  "description": "A curl for the Model Context Protocol",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",