@yawlabs/ctxlint 0.9.14 → 0.9.15

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.
Files changed (3) hide show
  1. package/README.md +12 -6
  2. package/dist/index.js +205 -204
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -260,7 +260,7 @@ Options:
260
260
  --mcp-global Also scan user/global MCP config files (implies --mcp)
261
261
  --session Enable session audit checks (cross-project consistency)
262
262
  --session-only Run only session checks, skip context and MCP checks
263
- --mcp-server Start the MCP server (for IDE/agent integration)
263
+ --mcp-server Start the MCP server (alias: `serve` subcommand)
264
264
  --watch Re-lint on context file changes
265
265
  -V, --version Output the version number
266
266
  -h, --help Display help
@@ -405,10 +405,16 @@ CLI flags override config file settings. Use `--config <path>` to load a config
405
405
 
406
406
  ctxlint ships with an MCP server that exposes six tools (`ctxlint_audit`, `ctxlint_mcp_audit`, `ctxlint_session_audit`, `ctxlint_validate_path`, `ctxlint_token_report`, `ctxlint_fix`). All read-only tools declare annotations so MCP clients can skip confirmation dialogs.
407
407
 
408
+ Launch it with the `serve` subcommand (or the equivalent `--mcp-server` flag, kept for back-compat):
409
+
410
+ ```bash
411
+ npx -y @yawlabs/ctxlint serve
412
+ ```
413
+
408
414
  ### With Claude Code
409
415
 
410
416
  ```bash
411
- claude mcp add ctxlint -- npx -y @yawlabs/ctxlint --mcp-server
417
+ claude mcp add ctxlint -- npx -y @yawlabs/ctxlint serve
412
418
  ```
413
419
 
414
420
  ### With `.mcp.json` (Claude Code project config, Cursor, Windsurf)
@@ -422,7 +428,7 @@ macOS / Linux / WSL:
422
428
  "mcpServers": {
423
429
  "ctxlint": {
424
430
  "command": "npx",
425
- "args": ["-y", "@yawlabs/ctxlint", "--mcp-server"]
431
+ "args": ["-y", "@yawlabs/ctxlint", "serve"]
426
432
  }
427
433
  }
428
434
  }
@@ -435,7 +441,7 @@ Windows:
435
441
  "mcpServers": {
436
442
  "ctxlint": {
437
443
  "command": "cmd",
438
- "args": ["/c", "npx", "-y", "@yawlabs/ctxlint", "--mcp-server"]
444
+ "args": ["/c", "npx", "-y", "@yawlabs/ctxlint", "serve"]
439
445
  }
440
446
  }
441
447
  }
@@ -452,7 +458,7 @@ Add to `.vscode/mcp.json`:
452
458
  "servers": {
453
459
  "ctxlint": {
454
460
  "command": "npx",
455
- "args": ["-y", "@yawlabs/ctxlint", "--mcp-server"]
461
+ "args": ["-y", "@yawlabs/ctxlint", "serve"]
456
462
  }
457
463
  }
458
464
  }
@@ -467,7 +473,7 @@ Add to your Claude Desktop config (`claude_desktop_config.json`):
467
473
  "mcpServers": {
468
474
  "ctxlint": {
469
475
  "command": "npx",
470
- "args": ["-y", "@yawlabs/ctxlint", "--mcp-server"]
476
+ "args": ["-y", "@yawlabs/ctxlint", "serve"]
471
477
  }
472
478
  }
473
479
  }
package/dist/index.js CHANGED
@@ -578,24 +578,24 @@ function processCreateParams(params) {
578
578
  };
579
579
  return { errorMap: customMap, description };
580
580
  }
581
- function timeRegexSource(args) {
581
+ function timeRegexSource(args2) {
582
582
  let secondsRegexSource = `[0-5]\\d`;
583
- if (args.precision) {
584
- secondsRegexSource = `${secondsRegexSource}\\.\\d{${args.precision}}`;
585
- } else if (args.precision == null) {
583
+ if (args2.precision) {
584
+ secondsRegexSource = `${secondsRegexSource}\\.\\d{${args2.precision}}`;
585
+ } else if (args2.precision == null) {
586
586
  secondsRegexSource = `${secondsRegexSource}(\\.\\d+)?`;
587
587
  }
588
- const secondsQuantifier = args.precision ? "+" : "?";
588
+ const secondsQuantifier = args2.precision ? "+" : "?";
589
589
  return `([01]\\d|2[0-3]):[0-5]\\d(:${secondsRegexSource})${secondsQuantifier}`;
590
590
  }
591
- function timeRegex(args) {
592
- return new RegExp(`^${timeRegexSource(args)}$`);
591
+ function timeRegex(args2) {
592
+ return new RegExp(`^${timeRegexSource(args2)}$`);
593
593
  }
594
- function datetimeRegex(args) {
595
- let regex2 = `${dateRegexSource}T${timeRegexSource(args)}`;
594
+ function datetimeRegex(args2) {
595
+ let regex2 = `${dateRegexSource}T${timeRegexSource(args2)}`;
596
596
  const opts = [];
597
- opts.push(args.local ? `Z?` : `Z`);
598
- if (args.offset)
597
+ opts.push(args2.local ? `Z?` : `Z`);
598
+ if (args2.offset)
599
599
  opts.push(`([+-]\\d{2}:?\\d{2})`);
600
600
  regex2 = `${regex2}(${opts.join("|")})`;
601
601
  return new RegExp(`^${regex2}$`);
@@ -3256,9 +3256,9 @@ var init_types = __esm({
3256
3256
  });
3257
3257
  return INVALID;
3258
3258
  }
3259
- function makeArgsIssue(args, error49) {
3259
+ function makeArgsIssue(args2, error49) {
3260
3260
  return makeIssue({
3261
- data: args,
3261
+ data: args2,
3262
3262
  path: ctx.path,
3263
3263
  errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, getErrorMap(), en_default].filter((x3) => !!x3),
3264
3264
  issueData: {
@@ -3282,10 +3282,10 @@ var init_types = __esm({
3282
3282
  const fn = ctx.data;
3283
3283
  if (this._def.returns instanceof ZodPromise) {
3284
3284
  const me2 = this;
3285
- return OK(async function(...args) {
3285
+ return OK(async function(...args2) {
3286
3286
  const error49 = new ZodError([]);
3287
- const parsedArgs = await me2._def.args.parseAsync(args, params).catch((e) => {
3288
- error49.addIssue(makeArgsIssue(args, e));
3287
+ const parsedArgs = await me2._def.args.parseAsync(args2, params).catch((e) => {
3288
+ error49.addIssue(makeArgsIssue(args2, e));
3289
3289
  throw error49;
3290
3290
  });
3291
3291
  const result = await Reflect.apply(fn, this, parsedArgs);
@@ -3297,10 +3297,10 @@ var init_types = __esm({
3297
3297
  });
3298
3298
  } else {
3299
3299
  const me2 = this;
3300
- return OK(function(...args) {
3301
- const parsedArgs = me2._def.args.safeParse(args, params);
3300
+ return OK(function(...args2) {
3301
+ const parsedArgs = me2._def.args.safeParse(args2, params);
3302
3302
  if (!parsedArgs.success) {
3303
- throw new ZodError([makeArgsIssue(args, parsedArgs.error)]);
3303
+ throw new ZodError([makeArgsIssue(args2, parsedArgs.error)]);
3304
3304
  }
3305
3305
  const result = Reflect.apply(fn, this, parsedArgs.data);
3306
3306
  const parsedReturns = me2._def.returns.safeParse(result, params);
@@ -3337,9 +3337,9 @@ var init_types = __esm({
3337
3337
  const validatedFunc = this.parse(func);
3338
3338
  return validatedFunc;
3339
3339
  }
3340
- static create(args, returns, params) {
3340
+ static create(args2, returns, params) {
3341
3341
  return new _ZodFunction({
3342
- args: args ? args : ZodTuple.create([]).rest(ZodUnknown.create()),
3342
+ args: args2 ? args2 : ZodTuple.create([]).rest(ZodUnknown.create()),
3343
3343
  returns: returns || ZodUnknown.create(),
3344
3344
  typeName: ZodFirstPartyTypeKind.ZodFunction,
3345
3345
  ...processCreateParams(params)
@@ -4613,8 +4613,8 @@ function parsedType(data) {
4613
4613
  }
4614
4614
  return t2;
4615
4615
  }
4616
- function issue(...args) {
4617
- const [iss, input, inst] = args;
4616
+ function issue(...args2) {
4617
+ const [iss, input, inst] = args2;
4618
4618
  if (typeof iss === "string") {
4619
4619
  return {
4620
4620
  message: iss,
@@ -5053,20 +5053,20 @@ __export(regexes_exports, {
5053
5053
  function emoji() {
5054
5054
  return new RegExp(_emoji, "u");
5055
5055
  }
5056
- function timeSource(args) {
5056
+ function timeSource(args2) {
5057
5057
  const hhmm = `(?:[01]\\d|2[0-3]):[0-5]\\d`;
5058
- const regex2 = typeof args.precision === "number" ? args.precision === -1 ? `${hhmm}` : args.precision === 0 ? `${hhmm}:[0-5]\\d` : `${hhmm}:[0-5]\\d\\.\\d{${args.precision}}` : `${hhmm}(?::[0-5]\\d(?:\\.\\d+)?)?`;
5058
+ const regex2 = typeof args2.precision === "number" ? args2.precision === -1 ? `${hhmm}` : args2.precision === 0 ? `${hhmm}:[0-5]\\d` : `${hhmm}:[0-5]\\d\\.\\d{${args2.precision}}` : `${hhmm}(?::[0-5]\\d(?:\\.\\d+)?)?`;
5059
5059
  return regex2;
5060
5060
  }
5061
- function time(args) {
5062
- return new RegExp(`^${timeSource(args)}$`);
5061
+ function time(args2) {
5062
+ return new RegExp(`^${timeSource(args2)}$`);
5063
5063
  }
5064
- function datetime(args) {
5065
- const time3 = timeSource({ precision: args.precision });
5064
+ function datetime(args2) {
5065
+ const time3 = timeSource({ precision: args2.precision });
5066
5066
  const opts = ["Z"];
5067
- if (args.local)
5067
+ if (args2.local)
5068
5068
  opts.push("");
5069
- if (args.offset)
5069
+ if (args2.offset)
5070
5070
  opts.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);
5071
5071
  const timeRegex2 = `${time3}(?:${opts.join("|")})`;
5072
5072
  return new RegExp(`^${dateSource}T(?:${timeRegex2})$`);
@@ -5712,11 +5712,11 @@ var Doc;
5712
5712
  var init_doc = __esm({
5713
5713
  "node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/doc.js"() {
5714
5714
  Doc = class {
5715
- constructor(args = []) {
5715
+ constructor(args2 = []) {
5716
5716
  this.content = [];
5717
5717
  this.indent = 0;
5718
5718
  if (this)
5719
- this.args = args;
5719
+ this.args = args2;
5720
5720
  }
5721
5721
  indented(fn) {
5722
5722
  this.indent += 1;
@@ -5739,10 +5739,10 @@ var init_doc = __esm({
5739
5739
  }
5740
5740
  compile() {
5741
5741
  const F3 = Function;
5742
- const args = this?.args;
5742
+ const args2 = this?.args;
5743
5743
  const content = this?.content ?? [``];
5744
5744
  const lines = [...content.map((x3) => ` ${x3}`)];
5745
- return new F3(...args, lines.join("\n"));
5745
+ return new F3(...args2, lines.join("\n"));
5746
5746
  }
5747
5747
  };
5748
5748
  }
@@ -7638,8 +7638,8 @@ var init_schemas = __esm({
7638
7638
  if (typeof func !== "function") {
7639
7639
  throw new Error("implement() must be called with a function");
7640
7640
  }
7641
- return function(...args) {
7642
- const parsedArgs = inst._def.input ? parse(inst._def.input, args) : args;
7641
+ return function(...args2) {
7642
+ const parsedArgs = inst._def.input ? parse(inst._def.input, args2) : args2;
7643
7643
  const result = Reflect.apply(func, this, parsedArgs);
7644
7644
  if (inst._def.output) {
7645
7645
  return parse(inst._def.output, result);
@@ -7651,8 +7651,8 @@ var init_schemas = __esm({
7651
7651
  if (typeof func !== "function") {
7652
7652
  throw new Error("implementAsync() must be called with a function");
7653
7653
  }
7654
- return async function(...args) {
7655
- const parsedArgs = inst._def.input ? await parseAsync(inst._def.input, args) : args;
7654
+ return async function(...args2) {
7655
+ const parsedArgs = inst._def.input ? await parseAsync(inst._def.input, args2) : args2;
7656
7656
  const result = await Reflect.apply(func, this, parsedArgs);
7657
7657
  if (inst._def.output) {
7658
7658
  return await parseAsync(inst._def.output, result);
@@ -7678,22 +7678,22 @@ var init_schemas = __esm({
7678
7678
  }
7679
7679
  return payload;
7680
7680
  };
7681
- inst.input = (...args) => {
7681
+ inst.input = (...args2) => {
7682
7682
  const F3 = inst.constructor;
7683
- if (Array.isArray(args[0])) {
7683
+ if (Array.isArray(args2[0])) {
7684
7684
  return new F3({
7685
7685
  type: "function",
7686
7686
  input: new $ZodTuple({
7687
7687
  type: "tuple",
7688
- items: args[0],
7689
- rest: args[1]
7688
+ items: args2[0],
7689
+ rest: args2[1]
7690
7690
  }),
7691
7691
  output: inst._def.output
7692
7692
  });
7693
7693
  }
7694
7694
  return new F3({
7695
7695
  type: "function",
7696
- input: args[0],
7696
+ input: args2[0],
7697
7697
  output: inst._def.output
7698
7698
  });
7699
7699
  };
@@ -17185,12 +17185,12 @@ var init_schemas3 = __esm({
17185
17185
  },
17186
17186
  configurable: true
17187
17187
  });
17188
- inst.meta = (...args) => {
17189
- if (args.length === 0) {
17188
+ inst.meta = (...args2) => {
17189
+ if (args2.length === 0) {
17190
17190
  return globalRegistry.get(inst);
17191
17191
  }
17192
17192
  const cl = inst.clone();
17193
- globalRegistry.add(cl, args[0]);
17193
+ globalRegistry.add(cl, args2[0]);
17194
17194
  return cl;
17195
17195
  };
17196
17196
  inst.isOptional = () => inst.safeParse(void 0).success;
@@ -17206,18 +17206,18 @@ var init_schemas3 = __esm({
17206
17206
  inst.format = bag.format ?? null;
17207
17207
  inst.minLength = bag.minimum ?? null;
17208
17208
  inst.maxLength = bag.maximum ?? null;
17209
- inst.regex = (...args) => inst.check(_regex(...args));
17210
- inst.includes = (...args) => inst.check(_includes(...args));
17211
- inst.startsWith = (...args) => inst.check(_startsWith(...args));
17212
- inst.endsWith = (...args) => inst.check(_endsWith(...args));
17213
- inst.min = (...args) => inst.check(_minLength(...args));
17214
- inst.max = (...args) => inst.check(_maxLength(...args));
17215
- inst.length = (...args) => inst.check(_length(...args));
17216
- inst.nonempty = (...args) => inst.check(_minLength(1, ...args));
17209
+ inst.regex = (...args2) => inst.check(_regex(...args2));
17210
+ inst.includes = (...args2) => inst.check(_includes(...args2));
17211
+ inst.startsWith = (...args2) => inst.check(_startsWith(...args2));
17212
+ inst.endsWith = (...args2) => inst.check(_endsWith(...args2));
17213
+ inst.min = (...args2) => inst.check(_minLength(...args2));
17214
+ inst.max = (...args2) => inst.check(_maxLength(...args2));
17215
+ inst.length = (...args2) => inst.check(_length(...args2));
17216
+ inst.nonempty = (...args2) => inst.check(_minLength(1, ...args2));
17217
17217
  inst.lowercase = (params) => inst.check(_lowercase(params));
17218
17218
  inst.uppercase = (params) => inst.check(_uppercase(params));
17219
17219
  inst.trim = () => inst.check(_trim());
17220
- inst.normalize = (...args) => inst.check(_normalize(...args));
17220
+ inst.normalize = (...args2) => inst.check(_normalize(...args2));
17221
17221
  inst.toLowerCase = () => inst.check(_toLowerCase());
17222
17222
  inst.toUpperCase = () => inst.check(_toUpperCase());
17223
17223
  inst.slugify = () => inst.check(_slugify());
@@ -17480,8 +17480,8 @@ var init_schemas3 = __esm({
17480
17480
  inst.merge = (other) => util_exports.merge(inst, other);
17481
17481
  inst.pick = (mask) => util_exports.pick(inst, mask);
17482
17482
  inst.omit = (mask) => util_exports.omit(inst, mask);
17483
- inst.partial = (...args) => util_exports.partial(ZodOptional2, inst, args[0]);
17484
- inst.required = (...args) => util_exports.required(ZodNonOptional, inst, args[0]);
17483
+ inst.partial = (...args2) => util_exports.partial(ZodOptional2, inst, args2[0]);
17484
+ inst.required = (...args2) => util_exports.required(ZodNonOptional, inst, args2[0]);
17485
17485
  });
17486
17486
  ZodUnion2 = /* @__PURE__ */ $constructor("ZodUnion", (inst, def) => {
17487
17487
  $ZodUnion.init(inst, def);
@@ -17526,19 +17526,19 @@ var init_schemas3 = __esm({
17526
17526
  inst._zod.processJSONSchema = (ctx, json2, params) => mapProcessor(inst, ctx, json2, params);
17527
17527
  inst.keyType = def.keyType;
17528
17528
  inst.valueType = def.valueType;
17529
- inst.min = (...args) => inst.check(_minSize(...args));
17529
+ inst.min = (...args2) => inst.check(_minSize(...args2));
17530
17530
  inst.nonempty = (params) => inst.check(_minSize(1, params));
17531
- inst.max = (...args) => inst.check(_maxSize(...args));
17532
- inst.size = (...args) => inst.check(_size(...args));
17531
+ inst.max = (...args2) => inst.check(_maxSize(...args2));
17532
+ inst.size = (...args2) => inst.check(_size(...args2));
17533
17533
  });
17534
17534
  ZodSet2 = /* @__PURE__ */ $constructor("ZodSet", (inst, def) => {
17535
17535
  $ZodSet.init(inst, def);
17536
17536
  ZodType2.init(inst, def);
17537
17537
  inst._zod.processJSONSchema = (ctx, json2, params) => setProcessor(inst, ctx, json2, params);
17538
- inst.min = (...args) => inst.check(_minSize(...args));
17538
+ inst.min = (...args2) => inst.check(_minSize(...args2));
17539
17539
  inst.nonempty = (params) => inst.check(_minSize(1, params));
17540
- inst.max = (...args) => inst.check(_maxSize(...args));
17541
- inst.size = (...args) => inst.check(_size(...args));
17540
+ inst.max = (...args2) => inst.check(_maxSize(...args2));
17541
+ inst.size = (...args2) => inst.check(_size(...args2));
17542
17542
  });
17543
17543
  ZodEnum2 = /* @__PURE__ */ $constructor("ZodEnum", (inst, def) => {
17544
17544
  $ZodEnum.init(inst, def);
@@ -17733,11 +17733,11 @@ var init_schemas3 = __esm({
17733
17733
  });
17734
17734
  describe2 = describe;
17735
17735
  meta2 = meta;
17736
- stringbool = (...args) => _stringbool({
17736
+ stringbool = (...args2) => _stringbool({
17737
17737
  Codec: ZodCodec,
17738
17738
  Boolean: ZodBoolean2,
17739
17739
  String: ZodString2
17740
- }, ...args);
17740
+ }, ...args2);
17741
17741
  }
17742
17742
  });
17743
17743
 
@@ -22751,23 +22751,23 @@ var require_code = __commonJS({
22751
22751
  };
22752
22752
  exports._Code = _Code;
22753
22753
  exports.nil = new _Code("");
22754
- function _3(strs, ...args) {
22754
+ function _3(strs, ...args2) {
22755
22755
  const code = [strs[0]];
22756
22756
  let i2 = 0;
22757
- while (i2 < args.length) {
22758
- addCodeArg(code, args[i2]);
22757
+ while (i2 < args2.length) {
22758
+ addCodeArg(code, args2[i2]);
22759
22759
  code.push(strs[++i2]);
22760
22760
  }
22761
22761
  return new _Code(code);
22762
22762
  }
22763
22763
  exports._ = _3;
22764
22764
  var plus = new _Code("+");
22765
- function str(strs, ...args) {
22765
+ function str(strs, ...args2) {
22766
22766
  const expr = [safeStringify(strs[0])];
22767
22767
  let i2 = 0;
22768
- while (i2 < args.length) {
22768
+ while (i2 < args2.length) {
22769
22769
  expr.push(plus);
22770
- addCodeArg(expr, args[i2]);
22770
+ addCodeArg(expr, args2[i2]);
22771
22771
  expr.push(plus, safeStringify(strs[++i2]));
22772
22772
  }
22773
22773
  optimize(expr);
@@ -23322,10 +23322,10 @@ var require_codegen = __commonJS({
23322
23322
  }
23323
23323
  };
23324
23324
  var Func = class extends BlockNode {
23325
- constructor(name, args, async) {
23325
+ constructor(name, args2, async) {
23326
23326
  super();
23327
23327
  this.name = name;
23328
- this.args = args;
23328
+ this.args = args2;
23329
23329
  this.async = async;
23330
23330
  }
23331
23331
  render(opts) {
@@ -23600,8 +23600,8 @@ var require_codegen = __commonJS({
23600
23600
  return this;
23601
23601
  }
23602
23602
  // `function` heading (or definition if funcBody is passed)
23603
- func(name, args = code_1.nil, async, funcBody) {
23604
- this._blockNode(new Func(name, args, async));
23603
+ func(name, args2 = code_1.nil, async, funcBody) {
23604
+ this._blockNode(new Func(name, args2, async));
23605
23605
  if (funcBody)
23606
23606
  this.code(funcBody).endFunc();
23607
23607
  return this;
@@ -23695,13 +23695,13 @@ var require_codegen = __commonJS({
23695
23695
  }
23696
23696
  exports.not = not;
23697
23697
  var andCode = mappend(exports.operators.AND);
23698
- function and(...args) {
23699
- return args.reduce(andCode);
23698
+ function and(...args2) {
23699
+ return args2.reduce(andCode);
23700
23700
  }
23701
23701
  exports.and = and;
23702
23702
  var orCode = mappend(exports.operators.OR);
23703
- function or(...args) {
23704
- return args.reduce(orCode);
23703
+ function or(...args2) {
23704
+ return args2.reduce(orCode);
23705
23705
  }
23706
23706
  exports.or = or;
23707
23707
  function mappend(op) {
@@ -24434,8 +24434,8 @@ var require_code2 = __commonJS({
24434
24434
  ];
24435
24435
  if (it2.opts.dynamicRef)
24436
24436
  valCxt.push([names_1.default.dynamicAnchors, names_1.default.dynamicAnchors]);
24437
- const args = (0, codegen_1._)`${dataAndSchema}, ${gen.object(...valCxt)}`;
24438
- return context !== codegen_1.nil ? (0, codegen_1._)`${func}.call(${context}, ${args})` : (0, codegen_1._)`${func}(${args})`;
24437
+ const args2 = (0, codegen_1._)`${dataAndSchema}, ${gen.object(...valCxt)}`;
24438
+ return context !== codegen_1.nil ? (0, codegen_1._)`${func}.call(${context}, ${args2})` : (0, codegen_1._)`${func}(${args2})`;
24439
24439
  }
24440
24440
  exports.callValidateCode = callValidateCode;
24441
24441
  var newRegExp = (0, codegen_1._)`new RegExp`;
@@ -30480,8 +30480,8 @@ var init_mcp = __esm({
30480
30480
  if (taskSupport === "optional" && !isTaskRequest && isTaskHandler) {
30481
30481
  return await this.handleAutomaticTaskPolling(tool, request, extra);
30482
30482
  }
30483
- const args = await this.validateToolInput(tool, request.params.arguments, request.params.name);
30484
- const result = await this.executeToolHandler(tool, args, extra);
30483
+ const args2 = await this.validateToolInput(tool, request.params.arguments, request.params.name);
30484
+ const result = await this.executeToolHandler(tool, args2, extra);
30485
30485
  if (isTaskRequest) {
30486
30486
  return result;
30487
30487
  }
@@ -30518,13 +30518,13 @@ var init_mcp = __esm({
30518
30518
  /**
30519
30519
  * Validates tool input arguments against the tool's input schema.
30520
30520
  */
30521
- async validateToolInput(tool, args, toolName) {
30521
+ async validateToolInput(tool, args2, toolName) {
30522
30522
  if (!tool.inputSchema) {
30523
30523
  return void 0;
30524
30524
  }
30525
30525
  const inputObj = normalizeObjectSchema(tool.inputSchema);
30526
30526
  const schemaToParse = inputObj ?? tool.inputSchema;
30527
- const parseResult = await safeParseAsync2(schemaToParse, args);
30527
+ const parseResult = await safeParseAsync2(schemaToParse, args2);
30528
30528
  if (!parseResult.success) {
30529
30529
  const error49 = "error" in parseResult ? parseResult.error : "Unknown error";
30530
30530
  const errorMessage = getParseErrorMessage(error49);
@@ -30559,7 +30559,7 @@ var init_mcp = __esm({
30559
30559
  /**
30560
30560
  * Executes a tool handler (either regular or task-based).
30561
30561
  */
30562
- async executeToolHandler(tool, args, extra) {
30562
+ async executeToolHandler(tool, args2, extra) {
30563
30563
  const handler = tool.handler;
30564
30564
  const isTaskHandler = "createTask" in handler;
30565
30565
  if (isTaskHandler) {
@@ -30569,7 +30569,7 @@ var init_mcp = __esm({
30569
30569
  const taskExtra = { ...extra, taskStore: extra.taskStore };
30570
30570
  if (tool.inputSchema) {
30571
30571
  const typedHandler = handler;
30572
- return await Promise.resolve(typedHandler.createTask(args, taskExtra));
30572
+ return await Promise.resolve(typedHandler.createTask(args2, taskExtra));
30573
30573
  } else {
30574
30574
  const typedHandler = handler;
30575
30575
  return await Promise.resolve(typedHandler.createTask(taskExtra));
@@ -30577,7 +30577,7 @@ var init_mcp = __esm({
30577
30577
  }
30578
30578
  if (tool.inputSchema) {
30579
30579
  const typedHandler = handler;
30580
- return await Promise.resolve(typedHandler(args, extra));
30580
+ return await Promise.resolve(typedHandler(args2, extra));
30581
30581
  } else {
30582
30582
  const typedHandler = handler;
30583
30583
  return await Promise.resolve(typedHandler(extra));
@@ -30590,10 +30590,10 @@ var init_mcp = __esm({
30590
30590
  if (!extra.taskStore) {
30591
30591
  throw new Error("No task store provided for task-capable tool.");
30592
30592
  }
30593
- const args = await this.validateToolInput(tool, request.params.arguments, request.params.name);
30593
+ const args2 = await this.validateToolInput(tool, request.params.arguments, request.params.name);
30594
30594
  const handler = tool.handler;
30595
30595
  const taskExtra = { ...extra, taskStore: extra.taskStore };
30596
- const createTaskResult = args ? await Promise.resolve(handler.createTask(args, taskExtra)) : (
30596
+ const createTaskResult = args2 ? await Promise.resolve(handler.createTask(args2, taskExtra)) : (
30597
30597
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
30598
30598
  await Promise.resolve(handler.createTask(taskExtra))
30599
30599
  );
@@ -30768,9 +30768,9 @@ var init_mcp = __esm({
30768
30768
  const errorMessage = getParseErrorMessage(error49);
30769
30769
  throw new McpError(ErrorCode.InvalidParams, `Invalid arguments for prompt ${request.params.name}: ${errorMessage}`);
30770
30770
  }
30771
- const args = parseResult.data;
30771
+ const args2 = parseResult.data;
30772
30772
  const cb = prompt.callback;
30773
- return await Promise.resolve(cb(args, extra));
30773
+ return await Promise.resolve(cb(args2, extra));
30774
30774
  } else {
30775
30775
  const cb = prompt.callback;
30776
30776
  return await Promise.resolve(cb(extra));
@@ -34885,7 +34885,7 @@ var require_common = __commonJS({
34885
34885
  let enableOverride = null;
34886
34886
  let namespacesCache;
34887
34887
  let enabledCache;
34888
- function debug2(...args) {
34888
+ function debug2(...args2) {
34889
34889
  if (!debug2.enabled) {
34890
34890
  return;
34891
34891
  }
@@ -34896,28 +34896,28 @@ var require_common = __commonJS({
34896
34896
  self2.prev = prevTime;
34897
34897
  self2.curr = curr;
34898
34898
  prevTime = curr;
34899
- args[0] = createDebug.coerce(args[0]);
34900
- if (typeof args[0] !== "string") {
34901
- args.unshift("%O");
34899
+ args2[0] = createDebug.coerce(args2[0]);
34900
+ if (typeof args2[0] !== "string") {
34901
+ args2.unshift("%O");
34902
34902
  }
34903
34903
  let index = 0;
34904
- args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format2) => {
34904
+ args2[0] = args2[0].replace(/%([a-zA-Z%])/g, (match, format2) => {
34905
34905
  if (match === "%%") {
34906
34906
  return "%";
34907
34907
  }
34908
34908
  index++;
34909
34909
  const formatter = createDebug.formatters[format2];
34910
34910
  if (typeof formatter === "function") {
34911
- const val = args[index];
34911
+ const val = args2[index];
34912
34912
  match = formatter.call(self2, val);
34913
- args.splice(index, 1);
34913
+ args2.splice(index, 1);
34914
34914
  index--;
34915
34915
  }
34916
34916
  return match;
34917
34917
  });
34918
- createDebug.formatArgs.call(self2, args);
34918
+ createDebug.formatArgs.call(self2, args2);
34919
34919
  const logFn = self2.log || createDebug.log;
34920
- logFn.apply(self2, args);
34920
+ logFn.apply(self2, args2);
34921
34921
  }
34922
34922
  debug2.namespace = namespace;
34923
34923
  debug2.useColors = createDebug.useColors();
@@ -35139,16 +35139,16 @@ var require_browser = __commonJS({
35139
35139
  typeof navigator !== "undefined" && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker
35140
35140
  typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
35141
35141
  }
35142
- function formatArgs(args) {
35143
- args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module.exports.humanize(this.diff);
35142
+ function formatArgs(args2) {
35143
+ args2[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args2[0] + (this.useColors ? "%c " : " ") + "+" + module.exports.humanize(this.diff);
35144
35144
  if (!this.useColors) {
35145
35145
  return;
35146
35146
  }
35147
35147
  const c3 = "color: " + this.color;
35148
- args.splice(1, 0, c3, "color: inherit");
35148
+ args2.splice(1, 0, c3, "color: inherit");
35149
35149
  let index = 0;
35150
35150
  let lastC = 0;
35151
- args[0].replace(/%[a-zA-Z%]/g, (match) => {
35151
+ args2[0].replace(/%[a-zA-Z%]/g, (match) => {
35152
35152
  if (match === "%%") {
35153
35153
  return;
35154
35154
  }
@@ -35157,7 +35157,7 @@ var require_browser = __commonJS({
35157
35157
  lastC = index;
35158
35158
  }
35159
35159
  });
35160
- args.splice(lastC, 0, c3);
35160
+ args2.splice(lastC, 0, c3);
35161
35161
  }
35162
35162
  exports.log = console.debug || console.log || (() => {
35163
35163
  });
@@ -35438,16 +35438,16 @@ var require_node = __commonJS({
35438
35438
  function useColors() {
35439
35439
  return "colors" in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty3.isatty(process.stderr.fd);
35440
35440
  }
35441
- function formatArgs(args) {
35441
+ function formatArgs(args2) {
35442
35442
  const { namespace: name, useColors: useColors2 } = this;
35443
35443
  if (useColors2) {
35444
35444
  const c3 = this.color;
35445
35445
  const colorCode = "\x1B[3" + (c3 < 8 ? c3 : "8;5;" + c3);
35446
35446
  const prefix = ` ${colorCode};1m${name} \x1B[0m`;
35447
- args[0] = prefix + args[0].split("\n").join("\n" + prefix);
35448
- args.push(colorCode + "m+" + module.exports.humanize(this.diff) + "\x1B[0m");
35447
+ args2[0] = prefix + args2[0].split("\n").join("\n" + prefix);
35448
+ args2.push(colorCode + "m+" + module.exports.humanize(this.diff) + "\x1B[0m");
35449
35449
  } else {
35450
- args[0] = getDate() + name + " " + args[0];
35450
+ args2[0] = getDate() + name + " " + args2[0];
35451
35451
  }
35452
35452
  }
35453
35453
  function getDate() {
@@ -35456,8 +35456,8 @@ var require_node = __commonJS({
35456
35456
  }
35457
35457
  return (/* @__PURE__ */ new Date()).toISOString() + " ";
35458
35458
  }
35459
- function log(...args) {
35460
- return process.stderr.write(util2.formatWithOptions(exports.inspectOpts, ...args) + "\n");
35459
+ function log(...args2) {
35460
+ return process.stderr.write(util2.formatWithOptions(exports.inspectOpts, ...args2) + "\n");
35461
35461
  }
35462
35462
  function save(namespaces) {
35463
35463
  if (namespaces) {
@@ -36253,29 +36253,29 @@ function appendTaskOptions(options, commands = []) {
36253
36253
  return commands2;
36254
36254
  }, commands);
36255
36255
  }
36256
- function getTrailingOptions(args, initialPrimitive = 0, objectOnly = false) {
36256
+ function getTrailingOptions(args2, initialPrimitive = 0, objectOnly = false) {
36257
36257
  const command = [];
36258
- for (let i2 = 0, max = initialPrimitive < 0 ? args.length : initialPrimitive; i2 < max; i2++) {
36259
- if ("string|number".includes(typeof args[i2])) {
36260
- command.push(String(args[i2]));
36258
+ for (let i2 = 0, max = initialPrimitive < 0 ? args2.length : initialPrimitive; i2 < max; i2++) {
36259
+ if ("string|number".includes(typeof args2[i2])) {
36260
+ command.push(String(args2[i2]));
36261
36261
  }
36262
36262
  }
36263
- appendTaskOptions(trailingOptionsArgument(args), command);
36263
+ appendTaskOptions(trailingOptionsArgument(args2), command);
36264
36264
  if (!objectOnly) {
36265
- command.push(...trailingArrayArgument(args));
36265
+ command.push(...trailingArrayArgument(args2));
36266
36266
  }
36267
36267
  return command;
36268
36268
  }
36269
- function trailingArrayArgument(args) {
36270
- const hasTrailingCallback = typeof last(args) === "function";
36271
- return asStringArray(filterType(last(args, hasTrailingCallback ? 1 : 0), filterArray, []));
36269
+ function trailingArrayArgument(args2) {
36270
+ const hasTrailingCallback = typeof last(args2) === "function";
36271
+ return asStringArray(filterType(last(args2, hasTrailingCallback ? 1 : 0), filterArray, []));
36272
36272
  }
36273
- function trailingOptionsArgument(args) {
36274
- const hasTrailingCallback = filterFunction(last(args));
36275
- return filterType(last(args, hasTrailingCallback ? 1 : 0), filterPlainObject);
36273
+ function trailingOptionsArgument(args2) {
36274
+ const hasTrailingCallback = filterFunction(last(args2));
36275
+ return filterType(last(args2, hasTrailingCallback ? 1 : 0), filterPlainObject);
36276
36276
  }
36277
- function trailingFunctionArgument(args, includeNoop = true) {
36278
- const callback = asFunction(last(args));
36277
+ function trailingFunctionArgument(args2, includeNoop = true) {
36278
+ const callback = asFunction(last(args2));
36279
36279
  return includeNoop || isUserFunction(callback) ? callback : void 0;
36280
36280
  }
36281
36281
  function callTaskParser(parser4, streams) {
@@ -36643,15 +36643,15 @@ function createLog() {
36643
36643
  }
36644
36644
  function prefixedLogger(to, prefix, forward) {
36645
36645
  if (!prefix || !String(prefix).replace(/\s*/, "")) {
36646
- return !forward ? to : (message, ...args) => {
36647
- to(message, ...args);
36648
- forward(message, ...args);
36646
+ return !forward ? to : (message, ...args2) => {
36647
+ to(message, ...args2);
36648
+ forward(message, ...args2);
36649
36649
  };
36650
36650
  }
36651
- return (message, ...args) => {
36652
- to(`%s ${message}`, prefix, ...args);
36651
+ return (message, ...args2) => {
36652
+ to(`%s ${message}`, prefix, ...args2);
36653
36653
  if (forward) {
36654
- forward(message, ...args);
36654
+ forward(message, ...args2);
36655
36655
  }
36656
36656
  };
36657
36657
  }
@@ -36753,8 +36753,8 @@ function changeWorkingDirectoryTask(directory, root) {
36753
36753
  return (root || instance).cwd = directory;
36754
36754
  });
36755
36755
  }
36756
- function checkoutTask(args) {
36757
- const commands = ["checkout", ...args];
36756
+ function checkoutTask(args2) {
36757
+ const commands = ["checkout", ...args2];
36758
36758
  if (commands[1] === "-b" && commands.includes("-B")) {
36759
36759
  commands[1] = remove(commands, "-B");
36760
36760
  }
@@ -37258,11 +37258,11 @@ function versionParser(stdOut) {
37258
37258
  }
37259
37259
  return parseStringResponse(versionResponse(0, 0, 0, stdOut), parsers7, stdOut);
37260
37260
  }
37261
- function createCloneTask(api, task, repoPath, ...args) {
37261
+ function createCloneTask(api, task, repoPath, ...args2) {
37262
37262
  if (!filterString(repoPath)) {
37263
37263
  return configurationErrorTask(`git.${api}() requires a string 'repoPath'`);
37264
37264
  }
37265
- return task(repoPath, filterType(args[0], filterString), getTrailingOptions(arguments));
37265
+ return task(repoPath, filterType(args2[0], filterString), getTrailingOptions(arguments));
37266
37266
  }
37267
37267
  function clone_default() {
37268
37268
  return {
@@ -37610,13 +37610,13 @@ function abortPlugin(signal) {
37610
37610
  function blockUnsafeOperationsPlugin(options = {}) {
37611
37611
  return {
37612
37612
  type: "spawn.args",
37613
- action(args, { env: env2 }) {
37614
- for (const vulnerability of te2(args, env2)) {
37613
+ action(args2, { env: env2 }) {
37614
+ for (const vulnerability of te2(args2, env2)) {
37615
37615
  if (options[vulnerability.category] !== true) {
37616
37616
  throw new GitPluginError(void 0, "unsafe", vulnerability.message);
37617
37617
  }
37618
37618
  }
37619
- return args;
37619
+ return args2;
37620
37620
  }
37621
37621
  };
37622
37622
  }
@@ -37782,11 +37782,11 @@ function progressMonitorPlugin(progress) {
37782
37782
  };
37783
37783
  const onArgs = {
37784
37784
  type: "spawn.args",
37785
- action(args, context) {
37785
+ action(args2, context) {
37786
37786
  if (!progressMethods.includes(context.method)) {
37787
- return args;
37787
+ return args2;
37788
37788
  }
37789
- return including(args, progressCommand);
37789
+ return including(args2, progressCommand);
37790
37790
  }
37791
37791
  };
37792
37792
  return [onArgs, onProgress];
@@ -37843,8 +37843,8 @@ function suffixPathsPlugin() {
37843
37843
  action(data) {
37844
37844
  const prefix = [];
37845
37845
  let suffix;
37846
- function append2(args) {
37847
- (suffix = suffix || []).push(...args);
37846
+ function append2(args2) {
37847
+ (suffix = suffix || []).push(...args2);
37848
37848
  }
37849
37849
  for (let i2 = 0; i2 < data.length; i2++) {
37850
37850
  const param = data[i2];
@@ -38509,18 +38509,18 @@ var init_esm2 = __esm({
38509
38509
  }
38510
38510
  async attemptRemoteTask(task, logger) {
38511
38511
  const binary = this._plugins.exec("spawn.binary", "", pluginContext(task, task.commands));
38512
- const args = this._plugins.exec("spawn.args", [...task.commands], {
38512
+ const args2 = this._plugins.exec("spawn.args", [...task.commands], {
38513
38513
  ...pluginContext(task, task.commands),
38514
38514
  env: { ...this.env }
38515
38515
  });
38516
38516
  const raw = await this.gitResponse(
38517
38517
  task,
38518
38518
  binary,
38519
- args,
38519
+ args2,
38520
38520
  this.outputHandler,
38521
38521
  logger.step("SPAWN")
38522
38522
  );
38523
- const outputStreams = await this.handleTaskData(task, args, raw, logger.step("HANDLE"));
38523
+ const outputStreams = await this.handleTaskData(task, args2, raw, logger.step("HANDLE"));
38524
38524
  logger(`passing response to task's parser as a %s`, task.format);
38525
38525
  if (isBufferTask(task)) {
38526
38526
  return callTaskParser(task.parser, outputStreams);
@@ -38531,7 +38531,7 @@ var init_esm2 = __esm({
38531
38531
  logger(`empty task bypassing child process to call to task's parser`);
38532
38532
  return task.parser(this);
38533
38533
  }
38534
- handleTaskData(task, args, result, logger) {
38534
+ handleTaskData(task, args2, result, logger) {
38535
38535
  const { exitCode, rejection, stdOut, stdErr } = result;
38536
38536
  return new Promise((done, fail) => {
38537
38537
  logger(`Preparing to handle process response exitCode=%d stdOut=`, exitCode);
@@ -38539,7 +38539,7 @@ var init_esm2 = __esm({
38539
38539
  "task.error",
38540
38540
  { error: rejection },
38541
38541
  {
38542
- ...pluginContext(task, args),
38542
+ ...pluginContext(task, args2),
38543
38543
  ...result
38544
38544
  }
38545
38545
  );
@@ -38574,7 +38574,7 @@ var init_esm2 = __esm({
38574
38574
  done(new GitOutputStreams(Buffer.concat(stdOut), Buffer.concat(stdErr)));
38575
38575
  });
38576
38576
  }
38577
- async gitResponse(task, command, args, outputHandler, logger) {
38577
+ async gitResponse(task, command, args2, outputHandler, logger) {
38578
38578
  const outputLogger = logger.sibling("output");
38579
38579
  const spawnOptions = this._plugins.exec(
38580
38580
  "spawn.options",
@@ -38588,9 +38588,9 @@ var init_esm2 = __esm({
38588
38588
  return new Promise((done) => {
38589
38589
  const stdOut = [];
38590
38590
  const stdErr = [];
38591
- logger.info(`%s %o`, command, args);
38591
+ logger.info(`%s %o`, command, args2);
38592
38592
  logger("%O", spawnOptions);
38593
- let rejection = this._beforeSpawn(task, args);
38593
+ let rejection = this._beforeSpawn(task, args2);
38594
38594
  if (rejection) {
38595
38595
  return done({
38596
38596
  stdOut,
@@ -38600,12 +38600,12 @@ var init_esm2 = __esm({
38600
38600
  });
38601
38601
  }
38602
38602
  this._plugins.exec("spawn.before", void 0, {
38603
- ...pluginContext(task, args),
38603
+ ...pluginContext(task, args2),
38604
38604
  kill(reason) {
38605
38605
  rejection = reason || rejection;
38606
38606
  }
38607
38607
  });
38608
- const spawned = spawn(command, args, spawnOptions);
38608
+ const spawned = spawn(command, args2, spawnOptions);
38609
38609
  spawned.stdout.on(
38610
38610
  "data",
38611
38611
  onDataReceived(stdOut, "stdOut", logger, outputLogger.step("stdOut"))
@@ -38617,10 +38617,10 @@ var init_esm2 = __esm({
38617
38617
  spawned.on("error", onErrorReceived(stdErr, logger));
38618
38618
  if (outputHandler) {
38619
38619
  logger(`Passing child process stdOut/stdErr to custom outputHandler`);
38620
- outputHandler(command, spawned.stdout, spawned.stderr, [...args]);
38620
+ outputHandler(command, spawned.stdout, spawned.stderr, [...args2]);
38621
38621
  }
38622
38622
  this._plugins.exec("spawn.after", void 0, {
38623
- ...pluginContext(task, args),
38623
+ ...pluginContext(task, args2),
38624
38624
  spawned,
38625
38625
  close(exitCode, reason) {
38626
38626
  done({
@@ -38640,10 +38640,10 @@ var init_esm2 = __esm({
38640
38640
  });
38641
38641
  });
38642
38642
  }
38643
- _beforeSpawn(task, args) {
38643
+ _beforeSpawn(task, args2) {
38644
38644
  let rejection;
38645
38645
  this._plugins.exec("spawn.before", void 0, {
38646
- ...pluginContext(task, args),
38646
+ ...pluginContext(task, args2),
38647
38647
  kill(reason) {
38648
38648
  rejection = reason || rejection;
38649
38649
  }
@@ -40226,13 +40226,13 @@ var init_esm2 = __esm({
40226
40226
  Git2.prototype.submoduleAdd = function(repo, path12, then) {
40227
40227
  return this._runTask(addSubModuleTask2(repo, path12), trailingFunctionArgument2(arguments));
40228
40228
  };
40229
- Git2.prototype.submoduleUpdate = function(args, then) {
40229
+ Git2.prototype.submoduleUpdate = function(args2, then) {
40230
40230
  return this._runTask(
40231
40231
  updateSubModuleTask2(getTrailingOptions2(arguments, true)),
40232
40232
  trailingFunctionArgument2(arguments)
40233
40233
  );
40234
40234
  };
40235
- Git2.prototype.submoduleInit = function(args, then) {
40235
+ Git2.prototype.submoduleInit = function(args2, then) {
40236
40236
  return this._runTask(
40237
40237
  initSubModuleTask2(getTrailingOptions2(arguments, true)),
40238
40238
  trailingFunctionArgument2(arguments)
@@ -40306,10 +40306,10 @@ var init_esm2 = __esm({
40306
40306
  Git2.prototype.binaryCatFile = function() {
40307
40307
  return this._catFile("buffer", arguments);
40308
40308
  };
40309
- Git2.prototype._catFile = function(format2, args) {
40310
- var handler = trailingFunctionArgument2(args);
40309
+ Git2.prototype._catFile = function(format2, args2) {
40310
+ var handler = trailingFunctionArgument2(args2);
40311
40311
  var command = ["cat-file"];
40312
- var options = args[0];
40312
+ var options = args2[0];
40313
40313
  if (typeof options === "string") {
40314
40314
  return this._runTask(
40315
40315
  configurationErrorTask2("Git.catFile: options must be supplied as an array of strings"),
@@ -43854,7 +43854,7 @@ import { readFileSync as readFileSync4 } from "node:fs";
43854
43854
  import { resolve as resolve8, dirname as dirname3 } from "node:path";
43855
43855
  import { fileURLToPath } from "node:url";
43856
43856
  function loadVersion() {
43857
- if (true) return "0.9.14";
43857
+ if (true) return "0.9.15";
43858
43858
  const __dir = dirname3(fileURLToPath(import.meta.url));
43859
43859
  const pkgPath = resolve8(__dir, "../package.json");
43860
43860
  const pkg = JSON.parse(readFileSync4(pkgPath, "utf-8"));
@@ -45342,9 +45342,9 @@ var require_help = __commonJS({
45342
45342
  * @returns {string}
45343
45343
  */
45344
45344
  subcommandTerm(cmd) {
45345
- const args = cmd.registeredArguments.map((arg) => humanReadableArgName(arg)).join(" ");
45345
+ const args2 = cmd.registeredArguments.map((arg) => humanReadableArgName(arg)).join(" ");
45346
45346
  return cmd._name + (cmd._aliases[0] ? "|" + cmd._aliases[0] : "") + (cmd.options.length ? " [options]" : "") + // simplistic check for non-help option
45347
- (args ? " " + args : "");
45347
+ (args2 ? " " + args2 : "");
45348
45348
  }
45349
45349
  /**
45350
45350
  * Get the option term to show in the list of options.
@@ -46346,7 +46346,7 @@ var require_command = __commonJS({
46346
46346
  desc = null;
46347
46347
  }
46348
46348
  opts = opts || {};
46349
- const [, name, args] = nameAndArgs.match(/([^ ]+) *(.*)/);
46349
+ const [, name, args2] = nameAndArgs.match(/([^ ]+) *(.*)/);
46350
46350
  const cmd = this.createCommand(name);
46351
46351
  if (desc) {
46352
46352
  cmd.description(desc);
@@ -46355,7 +46355,7 @@ var require_command = __commonJS({
46355
46355
  if (opts.isDefault) this._defaultCommandName = cmd._name;
46356
46356
  cmd._hidden = !!(opts.noHelp || opts.hidden);
46357
46357
  cmd._executableFile = opts.executableFile || null;
46358
- if (args) cmd.arguments(args);
46358
+ if (args2) cmd.arguments(args2);
46359
46359
  this._registerCommand(cmd);
46360
46360
  cmd.parent = this;
46361
46361
  cmd.copyInheritedSettings(this);
@@ -46680,9 +46680,9 @@ Expecting one of '${allowedValues.join("', '")}'`);
46680
46680
  * @return {Command} `this` command for chaining
46681
46681
  */
46682
46682
  action(fn) {
46683
- const listener = (args) => {
46683
+ const listener = (args2) => {
46684
46684
  const expectedArgsCount = this.registeredArguments.length;
46685
- const actionArgs = args.slice(0, expectedArgsCount);
46685
+ const actionArgs = args2.slice(0, expectedArgsCount);
46686
46686
  if (this._storeOptionsAsProperties) {
46687
46687
  actionArgs[expectedArgsCount] = this;
46688
46688
  } else {
@@ -47222,8 +47222,8 @@ Expecting one of '${allowedValues.join("', '")}'`);
47222
47222
  *
47223
47223
  * @private
47224
47224
  */
47225
- _executeSubCommand(subcommand, args) {
47226
- args = args.slice();
47225
+ _executeSubCommand(subcommand, args2) {
47226
+ args2 = args2.slice();
47227
47227
  let launchWithNode = false;
47228
47228
  const sourceExt = [".js", ".ts", ".tsx", ".mjs", ".cjs"];
47229
47229
  function findFile(baseDir, baseName) {
@@ -47272,11 +47272,11 @@ Expecting one of '${allowedValues.join("', '")}'`);
47272
47272
  let proc;
47273
47273
  if (process11.platform !== "win32") {
47274
47274
  if (launchWithNode) {
47275
- args.unshift(executableFile);
47276
- args = incrementNodeInspectorPort(process11.execArgv).concat(args);
47277
- proc = childProcess.spawn(process11.argv[0], args, { stdio: "inherit" });
47275
+ args2.unshift(executableFile);
47276
+ args2 = incrementNodeInspectorPort(process11.execArgv).concat(args2);
47277
+ proc = childProcess.spawn(process11.argv[0], args2, { stdio: "inherit" });
47278
47278
  } else {
47279
- proc = childProcess.spawn(executableFile, args, { stdio: "inherit" });
47279
+ proc = childProcess.spawn(executableFile, args2, { stdio: "inherit" });
47280
47280
  }
47281
47281
  } else {
47282
47282
  this._checkForMissingExecutable(
@@ -47284,9 +47284,9 @@ Expecting one of '${allowedValues.join("', '")}'`);
47284
47284
  executableDir,
47285
47285
  subcommand._name
47286
47286
  );
47287
- args.unshift(executableFile);
47288
- args = incrementNodeInspectorPort(process11.execArgv).concat(args);
47289
- proc = childProcess.spawn(process11.execPath, args, { stdio: "inherit" });
47287
+ args2.unshift(executableFile);
47288
+ args2 = incrementNodeInspectorPort(process11.execArgv).concat(args2);
47289
+ proc = childProcess.spawn(process11.execPath, args2, { stdio: "inherit" });
47290
47290
  }
47291
47291
  if (!proc.killed) {
47292
47292
  const signals2 = ["SIGUSR1", "SIGUSR2", "SIGTERM", "SIGINT", "SIGHUP"];
@@ -47669,7 +47669,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
47669
47669
  * @param {string[]} args
47670
47670
  * @return {{operands: string[], unknown: string[]}}
47671
47671
  */
47672
- parseOptions(args) {
47672
+ parseOptions(args2) {
47673
47673
  const operands = [];
47674
47674
  const unknown2 = [];
47675
47675
  let dest = operands;
@@ -47685,12 +47685,12 @@ Expecting one of '${allowedValues.join("', '")}'`);
47685
47685
  let activeVariadicOption = null;
47686
47686
  let activeGroup = null;
47687
47687
  let i2 = 0;
47688
- while (i2 < args.length || activeGroup) {
47689
- const arg = activeGroup ?? args[i2++];
47688
+ while (i2 < args2.length || activeGroup) {
47689
+ const arg = activeGroup ?? args2[i2++];
47690
47690
  activeGroup = null;
47691
47691
  if (arg === "--") {
47692
47692
  if (dest === unknown2) dest.push(arg);
47693
- dest.push(...args.slice(i2));
47693
+ dest.push(...args2.slice(i2));
47694
47694
  break;
47695
47695
  }
47696
47696
  if (activeVariadicOption && (!maybeOption(arg) || negativeNumberArg(arg))) {
@@ -47702,13 +47702,13 @@ Expecting one of '${allowedValues.join("', '")}'`);
47702
47702
  const option = this._findOption(arg);
47703
47703
  if (option) {
47704
47704
  if (option.required) {
47705
- const value = args[i2++];
47705
+ const value = args2[i2++];
47706
47706
  if (value === void 0) this.optionMissingArgument(option);
47707
47707
  this.emit(`option:${option.name()}`, value);
47708
47708
  } else if (option.optional) {
47709
47709
  let value = null;
47710
- if (i2 < args.length && (!maybeOption(args[i2]) || negativeNumberArg(args[i2]))) {
47711
- value = args[i2++];
47710
+ if (i2 < args2.length && (!maybeOption(args2[i2]) || negativeNumberArg(args2[i2]))) {
47711
+ value = args2[i2++];
47712
47712
  }
47713
47713
  this.emit(`option:${option.name()}`, value);
47714
47714
  } else {
@@ -47744,18 +47744,18 @@ Expecting one of '${allowedValues.join("', '")}'`);
47744
47744
  if ((this._enablePositionalOptions || this._passThroughOptions) && operands.length === 0 && unknown2.length === 0) {
47745
47745
  if (this._findCommand(arg)) {
47746
47746
  operands.push(arg);
47747
- unknown2.push(...args.slice(i2));
47747
+ unknown2.push(...args2.slice(i2));
47748
47748
  break;
47749
47749
  } else if (this._getHelpCommand() && arg === this._getHelpCommand().name()) {
47750
- operands.push(arg, ...args.slice(i2));
47750
+ operands.push(arg, ...args2.slice(i2));
47751
47751
  break;
47752
47752
  } else if (this._defaultCommandName) {
47753
- unknown2.push(arg, ...args.slice(i2));
47753
+ unknown2.push(arg, ...args2.slice(i2));
47754
47754
  break;
47755
47755
  }
47756
47756
  }
47757
47757
  if (this._passThroughOptions) {
47758
- dest.push(arg, ...args.slice(i2));
47758
+ dest.push(arg, ...args2.slice(i2));
47759
47759
  break;
47760
47760
  }
47761
47761
  dest.push(arg);
@@ -48084,13 +48084,13 @@ Expecting one of '${allowedValues.join("', '")}'`);
48084
48084
  usage(str) {
48085
48085
  if (str === void 0) {
48086
48086
  if (this._usage) return this._usage;
48087
- const args = this.registeredArguments.map((arg) => {
48087
+ const args2 = this.registeredArguments.map((arg) => {
48088
48088
  return humanReadableArgName(arg);
48089
48089
  });
48090
48090
  return [].concat(
48091
48091
  this.options.length || this._helpOption !== null ? "[options]" : [],
48092
48092
  this.commands.length ? "[command]" : [],
48093
- this.registeredArguments.length ? args : []
48093
+ this.registeredArguments.length ? args2 : []
48094
48094
  ).join(" ");
48095
48095
  }
48096
48096
  this._usage = str;
@@ -48405,17 +48405,17 @@ Expecting one of '${allowedValues.join("', '")}'`);
48405
48405
  * @param {Array} args - array of options to search for help flags
48406
48406
  * @private
48407
48407
  */
48408
- _outputHelpIfRequested(args) {
48408
+ _outputHelpIfRequested(args2) {
48409
48409
  const helpOption = this._getHelpOption();
48410
- const helpRequested = helpOption && args.find((arg) => helpOption.is(arg));
48410
+ const helpRequested = helpOption && args2.find((arg) => helpOption.is(arg));
48411
48411
  if (helpRequested) {
48412
48412
  this.outputHelp();
48413
48413
  this._exit(0, "commander.helpDisplayed", "(outputHelp)");
48414
48414
  }
48415
48415
  }
48416
48416
  };
48417
- function incrementNodeInspectorPort(args) {
48418
- return args.map((arg) => {
48417
+ function incrementNodeInspectorPort(args2) {
48418
+ return args2.map((arg) => {
48419
48419
  if (!arg.startsWith("--inspect")) {
48420
48420
  return arg;
48421
48421
  }
@@ -48805,17 +48805,17 @@ var init_mjs = __esm({
48805
48805
  this.#emitter.emit("exit", this.#process.exitCode, null);
48806
48806
  return this.#originalProcessReallyExit.call(this.#process, this.#process.exitCode);
48807
48807
  }
48808
- #processEmit(ev, ...args) {
48808
+ #processEmit(ev, ...args2) {
48809
48809
  const og = this.#originalProcessEmit;
48810
48810
  if (ev === "exit" && processOk(this.#process)) {
48811
- if (typeof args[0] === "number") {
48812
- this.#process.exitCode = args[0];
48811
+ if (typeof args2[0] === "number") {
48812
+ this.#process.exitCode = args2[0];
48813
48813
  }
48814
- const ret = og.call(this.#process, ev, ...args);
48814
+ const ret = og.call(this.#process, ev, ...args2);
48815
48815
  this.#emitter.emit("exit", this.#process.exitCode, null);
48816
48816
  return ret;
48817
48817
  } else {
48818
- return og.call(this.#process, ev, ...args);
48818
+ return og.call(this.#process, ev, ...args2);
48819
48819
  }
48820
48820
  }
48821
48821
  };
@@ -52001,7 +52001,7 @@ async function runCli() {
52001
52001
  "Lint your AI agent context files and MCP server configs against your actual codebase"
52002
52002
  ).version(VERSION).argument("[path]", "Project directory to scan", ".").option("--strict", "Exit code 1 on any warning or error (for CI)", false).option("--checks <checks>", "Comma-separated list of checks to run", "").addOption(
52003
52003
  new Option("--format <format>", "Output format: text, json, or sarif").choices(["text", "json", "sarif"]).default("text")
52004
- ).option("--tokens", "Show token breakdown per file", false).option("--verbose", "Show passing checks too", false).option("--fix", "Auto-fix broken paths using git history and fuzzy matching", false).option("--fix-dry-run", "Preview --fix changes without writing", false).option("--yes", "Skip interactive confirmation prompts (required for --fix in TTY)", false).option("--follow-symlinks", "Allow --fix to write through symlinks (default: skip)", false).option("--ignore <checks>", "Comma-separated list of checks to ignore", "").option("--quiet", "Suppress all output except errors (exit code only)", false).option("--config <path>", "Path to config file (default: .ctxlintrc in project root)").option("--depth <n>", "Max subdirectory depth to scan (default: 2)", "2").option("--mcp", "Enable MCP config linting alongside context file checks", false).option("--mcp-only", "Run only MCP config checks, skip context file checks", false).option("--mcp-global", "Also scan user/global MCP config files (implies --mcp)", false).option("--mcp-server", "Start the MCP server (for IDE/agent integration)").option("--session", "Run session audit checks (cross-project consistency)", false).option("--session-only", "Run only session checks, skip context and MCP checks", false).option("--watch", "Re-lint on context file changes", false).action(async (projectPath, opts) => {
52004
+ ).option("--tokens", "Show token breakdown per file", false).option("--verbose", "Show passing checks too", false).option("--fix", "Auto-fix broken paths using git history and fuzzy matching", false).option("--fix-dry-run", "Preview --fix changes without writing", false).option("--yes", "Skip interactive confirmation prompts (required for --fix in TTY)", false).option("--follow-symlinks", "Allow --fix to write through symlinks (default: skip)", false).option("--ignore <checks>", "Comma-separated list of checks to ignore", "").option("--quiet", "Suppress all output except errors (exit code only)", false).option("--config <path>", "Path to config file (default: .ctxlintrc in project root)").option("--depth <n>", "Max subdirectory depth to scan (default: 2)", "2").option("--mcp", "Enable MCP config linting alongside context file checks", false).option("--mcp-only", "Run only MCP config checks, skip context file checks", false).option("--mcp-global", "Also scan user/global MCP config files (implies --mcp)", false).option("--mcp-server", "Start the MCP server (alias: `ctxlint serve`)").option("--session", "Run session audit checks (cross-project consistency)", false).option("--session-only", "Run only session checks, skip context and MCP checks", false).option("--watch", "Re-lint on context file changes", false).action(async (projectPath, opts) => {
52005
52005
  const resolvedPath = path11.resolve(projectPath);
52006
52006
  const configPath = opts.config ? path11.resolve(opts.config) : void 0;
52007
52007
  const config2 = configPath ? loadConfigFromPath(configPath) : loadConfig(resolvedPath);
@@ -52341,7 +52341,8 @@ var init_cli = __esm({
52341
52341
  });
52342
52342
 
52343
52343
  // src/index.ts
52344
- if (process.argv.includes("--mcp-server")) {
52344
+ var args = process.argv.slice(2);
52345
+ if (args[0] === "serve" || args.includes("--mcp-server")) {
52345
52346
  await init_server3().then(() => server_exports);
52346
52347
  } else {
52347
52348
  const { runCli: runCli2 } = await Promise.resolve().then(() => (init_cli(), cli_exports));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yawlabs/ctxlint",
3
- "version": "0.9.14",
3
+ "version": "0.9.15",
4
4
  "description": "Lint your AI agent context files, MCP server configs, and session data against your actual codebase",
5
5
  "bin": {
6
6
  "ctxlint": "dist/index.js"