@ai-ecoverse/mcpcat 0.23.3 → 0.23.4

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.
@@ -17783,51 +17783,24 @@ function wantsServeHelp(args2) {
17783
17783
  }
17784
17784
  var UPGRADE_VERBS = /* @__PURE__ */ new Set(["upgrade", "update"]);
17785
17785
  var LEADING_STOPS = /* @__PURE__ */ new Set(["--", "--help", "-h", "--version", "-V"]);
17786
- var GLOBAL_VALUE_FLAGS = /* @__PURE__ */ new Set([
17787
- "-H",
17788
- "--header",
17789
- "-d",
17790
- "--protocol-version",
17791
- "--budget",
17792
- "-e",
17793
- "-s",
17794
- "--server",
17795
- "-m",
17796
- "--timeout",
17797
- "--respond",
17798
- "--root",
17799
- "-o",
17800
- "--output",
17801
- "--memory"
17802
- ]);
17803
- var GLOBAL_BOOLEAN_FLAGS = /* @__PURE__ */ new Set([
17804
- "--schema",
17805
- "--ts",
17806
- "--json",
17807
- "--rank",
17808
- "-E",
17809
- "--allow-shell",
17810
- "-v",
17811
- "--verbose",
17812
- "--silent",
17813
- "--no-input",
17814
- "--no-validate"
17815
- ]);
17786
+ function takesValue(flag) {
17787
+ return parseFlags([flag, "value"]).positional.length === 0;
17788
+ }
17789
+ function isGlobalFlag(flag) {
17790
+ return JSON.stringify(parseFlags([flag])) !== JSON.stringify(parseFlags([]));
17791
+ }
17816
17792
  function upgradeArgs(args2) {
17817
- const at = args2.findIndex((arg) => UPGRADE_VERBS.has(arg));
17818
- if (at < 0) return void 0;
17819
17793
  const own = [];
17820
- for (let i = 0; i < at; i++) {
17794
+ for (let i = 0; i < args2.length; i++) {
17821
17795
  const arg = args2[i];
17822
- if (LEADING_STOPS.has(arg) || !arg.startsWith("-")) return void 0;
17823
- if (GLOBAL_VALUE_FLAGS.has(arg)) {
17824
- if (i + 1 === at) return void 0;
17825
- i++;
17826
- } else if (!GLOBAL_BOOLEAN_FLAGS.has(arg)) {
17827
- own.push(arg);
17796
+ if (LEADING_STOPS.has(arg)) return void 0;
17797
+ if (!arg.startsWith("-")) {
17798
+ return UPGRADE_VERBS.has(arg) ? [arg, ...own, ...args2.slice(i + 1)] : void 0;
17828
17799
  }
17800
+ if (args2[i + 1] && takesValue(arg)) i++;
17801
+ else if (!isGlobalFlag(arg)) own.push(arg);
17829
17802
  }
17830
- return [args2[at], ...own, ...args2.slice(at + 1)];
17803
+ return void 0;
17831
17804
  }
17832
17805
  async function upgrade(platform2, version, args2) {
17833
17806
  const command = args2[0];
@@ -18943,5 +18916,5 @@ try {
18943
18916
  });
18944
18917
  } catch {
18945
18918
  }
18946
- var code = await run(platform, "0.23.3", args);
18919
+ var code = await run(platform, "0.23.4", args);
18947
18920
  process.exit(code);
@@ -17300,51 +17300,24 @@ function wantsServeHelp(args) {
17300
17300
  }
17301
17301
  var UPGRADE_VERBS = /* @__PURE__ */ new Set(["upgrade", "update"]);
17302
17302
  var LEADING_STOPS = /* @__PURE__ */ new Set(["--", "--help", "-h", "--version", "-V"]);
17303
- var GLOBAL_VALUE_FLAGS = /* @__PURE__ */ new Set([
17304
- "-H",
17305
- "--header",
17306
- "-d",
17307
- "--protocol-version",
17308
- "--budget",
17309
- "-e",
17310
- "-s",
17311
- "--server",
17312
- "-m",
17313
- "--timeout",
17314
- "--respond",
17315
- "--root",
17316
- "-o",
17317
- "--output",
17318
- "--memory"
17319
- ]);
17320
- var GLOBAL_BOOLEAN_FLAGS = /* @__PURE__ */ new Set([
17321
- "--schema",
17322
- "--ts",
17323
- "--json",
17324
- "--rank",
17325
- "-E",
17326
- "--allow-shell",
17327
- "-v",
17328
- "--verbose",
17329
- "--silent",
17330
- "--no-input",
17331
- "--no-validate"
17332
- ]);
17303
+ function takesValue(flag) {
17304
+ return parseFlags([flag, "value"]).positional.length === 0;
17305
+ }
17306
+ function isGlobalFlag(flag) {
17307
+ return JSON.stringify(parseFlags([flag])) !== JSON.stringify(parseFlags([]));
17308
+ }
17333
17309
  function upgradeArgs(args) {
17334
- const at = args.findIndex((arg) => UPGRADE_VERBS.has(arg));
17335
- if (at < 0) return void 0;
17336
17310
  const own = [];
17337
- for (let i = 0; i < at; i++) {
17311
+ for (let i = 0; i < args.length; i++) {
17338
17312
  const arg = args[i];
17339
- if (LEADING_STOPS.has(arg) || !arg.startsWith("-")) return void 0;
17340
- if (GLOBAL_VALUE_FLAGS.has(arg)) {
17341
- if (i + 1 === at) return void 0;
17342
- i++;
17343
- } else if (!GLOBAL_BOOLEAN_FLAGS.has(arg)) {
17344
- own.push(arg);
17313
+ if (LEADING_STOPS.has(arg)) return void 0;
17314
+ if (!arg.startsWith("-")) {
17315
+ return UPGRADE_VERBS.has(arg) ? [arg, ...own, ...args.slice(i + 1)] : void 0;
17345
17316
  }
17317
+ if (args[i + 1] && takesValue(arg)) i++;
17318
+ else if (!isGlobalFlag(arg)) own.push(arg);
17346
17319
  }
17347
- return [args[at], ...own, ...args.slice(at + 1)];
17320
+ return void 0;
17348
17321
  }
17349
17322
  async function upgrade(platform2, version, args) {
17350
17323
  const command = args[0];
@@ -18170,7 +18143,7 @@ async function main(ctx) {
18170
18143
  packageDir: "/node_modules/@ai-ecoverse/mcpcat"
18171
18144
  });
18172
18145
  const args = ctx.argv.slice(1);
18173
- return run(platform2, "0.23.3", args);
18146
+ return run(platform2, "0.23.4", args);
18174
18147
  }
18175
18148
  export {
18176
18149
  main as default
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-ecoverse/mcpcat",
3
- "version": "0.23.3",
3
+ "version": "0.23.4",
4
4
  "description": "A curl for the Model Context Protocol",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",