@yawlabs/ctxlint 0.18.1 → 0.18.3

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/index.js CHANGED
@@ -8878,8 +8878,8 @@ var require_files = __commonJS({
8878
8878
  exports.resolveGlobalYarnPath = resolveGlobalYarnPath;
8879
8879
  exports.resolveModulePath = resolveModulePath;
8880
8880
  var url2 = __importStar(__require("url"));
8881
- var path19 = __importStar(__require("path"));
8882
- var fs14 = __importStar(__require("fs"));
8881
+ var path20 = __importStar(__require("path"));
8882
+ var fs15 = __importStar(__require("fs"));
8883
8883
  var child_process_1 = __require("child_process");
8884
8884
  function uriToFilePath(uri) {
8885
8885
  const parsed = url2.parse(uri);
@@ -8897,7 +8897,7 @@ var require_files = __commonJS({
8897
8897
  segments.shift();
8898
8898
  }
8899
8899
  }
8900
- return path19.normalize(segments.join("/"));
8900
+ return path20.normalize(segments.join("/"));
8901
8901
  }
8902
8902
  function isWindows() {
8903
8903
  return process.platform === "win32";
@@ -8925,9 +8925,9 @@ var require_files = __commonJS({
8925
8925
  const env2 = process.env;
8926
8926
  const newEnv = /* @__PURE__ */ Object.create(null);
8927
8927
  Object.keys(env2).forEach((key) => newEnv[key] = env2[key]);
8928
- if (nodePath && fs14.existsSync(nodePath)) {
8928
+ if (nodePath && fs15.existsSync(nodePath)) {
8929
8929
  if (newEnv[nodePathKey]) {
8930
- newEnv[nodePathKey] = nodePath + path19.delimiter + newEnv[nodePathKey];
8930
+ newEnv[nodePathKey] = nodePath + path20.delimiter + newEnv[nodePathKey];
8931
8931
  } else {
8932
8932
  newEnv[nodePathKey] = nodePath;
8933
8933
  }
@@ -8999,9 +8999,9 @@ var require_files = __commonJS({
8999
8999
  }
9000
9000
  if (prefix.length > 0) {
9001
9001
  if (isWindows()) {
9002
- return path19.join(prefix, "node_modules");
9002
+ return path20.join(prefix, "node_modules");
9003
9003
  } else {
9004
- return path19.join(prefix, "lib", "node_modules");
9004
+ return path20.join(prefix, "lib", "node_modules");
9005
9005
  }
9006
9006
  }
9007
9007
  return void 0;
@@ -9040,7 +9040,7 @@ var require_files = __commonJS({
9040
9040
  try {
9041
9041
  const yarn = JSON.parse(line);
9042
9042
  if (yarn.type === "log") {
9043
- return path19.join(yarn.data, "node_modules");
9043
+ return path20.join(yarn.data, "node_modules");
9044
9044
  }
9045
9045
  } catch (e) {
9046
9046
  }
@@ -9062,24 +9062,24 @@ var require_files = __commonJS({
9062
9062
  if (process.platform === "win32") {
9063
9063
  _isCaseSensitive = false;
9064
9064
  } else {
9065
- _isCaseSensitive = !fs14.existsSync(__filename.toUpperCase()) || !fs14.existsSync(__filename.toLowerCase());
9065
+ _isCaseSensitive = !fs15.existsSync(__filename.toUpperCase()) || !fs15.existsSync(__filename.toLowerCase());
9066
9066
  }
9067
9067
  return _isCaseSensitive;
9068
9068
  }
9069
9069
  FileSystem2.isCaseSensitive = isCaseSensitive;
9070
9070
  function isParent(parent, child) {
9071
9071
  if (isCaseSensitive()) {
9072
- return path19.normalize(child).indexOf(path19.normalize(parent)) === 0;
9072
+ return path20.normalize(child).indexOf(path20.normalize(parent)) === 0;
9073
9073
  } else {
9074
- return path19.normalize(child).toLowerCase().indexOf(path19.normalize(parent).toLowerCase()) === 0;
9074
+ return path20.normalize(child).toLowerCase().indexOf(path20.normalize(parent).toLowerCase()) === 0;
9075
9075
  }
9076
9076
  }
9077
9077
  FileSystem2.isParent = isParent;
9078
9078
  })(FileSystem || (exports.FileSystem = FileSystem = {}));
9079
9079
  function resolveModulePath(workspaceRoot, moduleName, nodePath, tracer) {
9080
9080
  if (nodePath) {
9081
- if (!path19.isAbsolute(nodePath)) {
9082
- nodePath = path19.join(workspaceRoot, nodePath);
9081
+ if (!path20.isAbsolute(nodePath)) {
9082
+ nodePath = path20.join(workspaceRoot, nodePath);
9083
9083
  }
9084
9084
  return resolve18(moduleName, nodePath, nodePath, tracer).then((value) => {
9085
9085
  if (FileSystem.isParent(nodePath, value)) {
@@ -9314,18 +9314,18 @@ var require_main = __commonJS({
9314
9314
  exports.createMessageConnection = createMessageConnection;
9315
9315
  var ril_1 = __importDefault(require_ril());
9316
9316
  ril_1.default.install();
9317
- var path19 = __importStar(__require("path"));
9317
+ var path20 = __importStar(__require("path"));
9318
9318
  var os7 = __importStar(__require("os"));
9319
- var fs14 = __importStar(__require("fs"));
9319
+ var fs15 = __importStar(__require("fs"));
9320
9320
  var crypto_1 = __require("crypto");
9321
9321
  var net_1 = __require("net");
9322
9322
  var api_1 = require_api();
9323
9323
  __exportStar(require_api(), exports);
9324
9324
  var IPCMessageReader = class extends api_1.AbstractMessageReader {
9325
9325
  process;
9326
- constructor(process11) {
9326
+ constructor(process12) {
9327
9327
  super();
9328
- this.process = process11;
9328
+ this.process = process12;
9329
9329
  const eventEmitter = this.process;
9330
9330
  eventEmitter.on("error", (error52) => this.fireError(error52));
9331
9331
  eventEmitter.on("close", () => this.fireClose());
@@ -9339,9 +9339,9 @@ var require_main = __commonJS({
9339
9339
  var IPCMessageWriter = class extends api_1.AbstractMessageWriter {
9340
9340
  process;
9341
9341
  errorCount;
9342
- constructor(process11) {
9342
+ constructor(process12) {
9343
9343
  super();
9344
- this.process = process11;
9344
+ this.process = process12;
9345
9345
  this.errorCount = 0;
9346
9346
  const eventEmitter = this.process;
9347
9347
  eventEmitter.on("error", (error52) => this.fireError(error52));
@@ -9457,7 +9457,7 @@ var require_main = __commonJS({
9457
9457
  }
9458
9458
  let randomLength = 32;
9459
9459
  const fixedLength = "/lsp-.sock".length;
9460
- const tmpDir = fs14.realpathSync(XDG_RUNTIME_DIR ?? os7.tmpdir());
9460
+ const tmpDir = fs15.realpathSync(XDG_RUNTIME_DIR ?? os7.tmpdir());
9461
9461
  const limit = safeIpcPathLengths.get(process.platform);
9462
9462
  if (limit !== void 0) {
9463
9463
  randomLength = Math.min(limit - tmpDir.length - fixedLength, randomLength);
@@ -9466,7 +9466,7 @@ var require_main = __commonJS({
9466
9466
  throw new Error(`Unable to generate a random pipe name with ${randomLength} characters.`);
9467
9467
  }
9468
9468
  const randomSuffix = (0, crypto_1.randomBytes)(Math.floor(randomLength / 2)).toString("hex");
9469
- return path19.join(tmpDir, `lsp-${randomSuffix}.sock`);
9469
+ return path20.join(tmpDir, `lsp-${randomSuffix}.sock`);
9470
9470
  }
9471
9471
  function createClientPipeTransport(pipeName, encoding = "utf-8") {
9472
9472
  let connectResolve;
@@ -13414,29 +13414,27 @@ async function scanForMcpConfigs(projectRoot) {
13414
13414
  const found = [];
13415
13415
  const seen = /* @__PURE__ */ new Set();
13416
13416
  const realRoot = resolveRealRoot(projectRoot);
13417
- for (const pattern of MCP_CONFIG_PATTERNS) {
13418
- const matches = await Ze(pattern, {
13419
- cwd: projectRoot,
13420
- absolute: true,
13421
- nodir: true,
13422
- dot: true
13417
+ const matches = await Ze(MCP_CONFIG_PATTERNS, {
13418
+ cwd: projectRoot,
13419
+ absolute: true,
13420
+ nodir: true,
13421
+ dot: true
13422
+ });
13423
+ for (const match of matches) {
13424
+ const normalized = path2.normalize(match);
13425
+ if (seen.has(normalized)) continue;
13426
+ seen.add(normalized);
13427
+ const relativePath = path2.relative(projectRoot, normalized);
13428
+ const symlink = isSymlink(normalized);
13429
+ if (isExcludedScanTarget(normalized, realRoot, symlink)) continue;
13430
+ const target = symlink ? readSymlinkTarget(normalized) : void 0;
13431
+ found.push({
13432
+ absolutePath: normalized,
13433
+ relativePath: relativePath.replace(/\\/g, "/"),
13434
+ isSymlink: symlink,
13435
+ symlinkTarget: target,
13436
+ type: "mcp-config"
13423
13437
  });
13424
- for (const match of matches) {
13425
- const normalized = path2.normalize(match);
13426
- if (seen.has(normalized)) continue;
13427
- seen.add(normalized);
13428
- const relativePath = path2.relative(projectRoot, normalized);
13429
- const symlink = isSymlink(normalized);
13430
- if (isExcludedScanTarget(normalized, realRoot, symlink)) continue;
13431
- const target = symlink ? readSymlinkTarget(normalized) : void 0;
13432
- found.push({
13433
- absolutePath: normalized,
13434
- relativePath: relativePath.replace(/\\/g, "/"),
13435
- isSymlink: symlink,
13436
- symlinkTarget: target,
13437
- type: "mcp-config"
13438
- });
13439
- }
13440
13438
  }
13441
13439
  return found.sort((a, b2) => a.relativePath.localeCompare(b2.relativePath));
13442
13440
  }
@@ -13769,6 +13767,13 @@ function extractPathReferences(lines, sections) {
13769
13767
  cleanValue = cleanValue.slice(0, -1);
13770
13768
  }
13771
13769
  if (!cleanValue.includes("/")) continue;
13770
+ if (inCodeBlock && codeBlockLang === "" && /^\s/.test(line) && /^[\w@.-]+\/$/.test(cleanValue)) {
13771
+ continue;
13772
+ }
13773
+ const lowerProse = /^([a-z][\w-]*)\/[a-z][\w-]*$/.exec(cleanValue);
13774
+ if (lowerProse && !PATH_FIRST_SEGMENTS.has(lowerProse[1])) {
13775
+ continue;
13776
+ }
13772
13777
  if (/(^|\/)\.git\//.test(cleanValue) || /\.app\//.test(cleanValue)) continue;
13773
13778
  const column = match.index + match[0].length - match[1].length + 1;
13774
13779
  paths.push({
@@ -13874,7 +13879,7 @@ function extractCommandReferences(lines, sections) {
13874
13879
  }
13875
13880
  return commands;
13876
13881
  }
13877
- var PATH_PATTERN, PATH_EXCLUDE, COMMAND_PREFIXES, COMMON_COMMANDS;
13882
+ var PATH_PATTERN, PATH_EXCLUDE, PATH_FIRST_SEGMENTS, COMMAND_PREFIXES, COMMON_COMMANDS;
13878
13883
  var init_parser = __esm({
13879
13884
  "src/core/parser.ts"() {
13880
13885
  "use strict";
@@ -13883,6 +13888,37 @@ var init_parser = __esm({
13883
13888
  init_tokens();
13884
13889
  PATH_PATTERN = /(?:^|[\s`"'(])((\.{0,2}\/)?(?:(?:\*{1,2}|[\w@.-][\w@.*-]*)\/)+[\w.*-]*(?:\.\w+)?)(?=[\s`"'),;:]|$)/gm;
13885
13890
  PATH_EXCLUDE = /^(https?:\/\/|ftp:\/\/|mailto:|n\/a|w\/o|I\/O|i\/o|e\.g\.|N\/A|\.deb\/|\.rpm[.\/]|\.tar[.\/]|\.zip[.\/])/i;
13891
+ PATH_FIRST_SEGMENTS = /* @__PURE__ */ new Set([
13892
+ "src",
13893
+ "app",
13894
+ "apps",
13895
+ "lib",
13896
+ "libs",
13897
+ "pkg",
13898
+ "packages",
13899
+ "scripts",
13900
+ "docs",
13901
+ "test",
13902
+ "tests",
13903
+ "dist",
13904
+ "build",
13905
+ "infra",
13906
+ "config",
13907
+ "bin",
13908
+ "cmd",
13909
+ "internal",
13910
+ "public",
13911
+ "static",
13912
+ "assets",
13913
+ "components",
13914
+ "pages",
13915
+ "migrations",
13916
+ "modules",
13917
+ "vendor",
13918
+ "examples",
13919
+ "e2e",
13920
+ "node_modules"
13921
+ ]);
13886
13922
  COMMAND_PREFIXES = /^\s*[\$>]\s+(.+)$/;
13887
13923
  COMMON_COMMANDS = /^(npm|npx|pnpm|yarn|make|cargo|go\s+(run|build|test)|python|pytest|vitest|jest|mocha|tsc|eslint|prettier|bun|deno)\b/;
13888
13924
  }
@@ -14689,10 +14725,10 @@ var require_src2 = __commonJS({
14689
14725
  var fs_1 = __require("fs");
14690
14726
  var debug_1 = __importDefault(require_src());
14691
14727
  var log = debug_1.default("@kwsites/file-exists");
14692
- function check2(path19, isFile, isDirectory2) {
14693
- log(`checking %s`, path19);
14728
+ function check2(path20, isFile, isDirectory2) {
14729
+ log(`checking %s`, path20);
14694
14730
  try {
14695
- const stat3 = fs_1.statSync(path19);
14731
+ const stat3 = fs_1.statSync(path20);
14696
14732
  if (stat3.isFile() && isFile) {
14697
14733
  log(`[OK] path represents a file`);
14698
14734
  return true;
@@ -14712,8 +14748,8 @@ var require_src2 = __commonJS({
14712
14748
  throw e;
14713
14749
  }
14714
14750
  }
14715
- function exists2(path19, type = exports.READABLE) {
14716
- return check2(path19, (type & exports.FILE) > 0, (type & exports.FOLDER) > 0);
14751
+ function exists2(path20, type = exports.READABLE) {
14752
+ return check2(path20, (type & exports.FILE) > 0, (type & exports.FOLDER) > 0);
14717
14753
  }
14718
14754
  exports.exists = exists2;
14719
14755
  exports.FILE = 1;
@@ -15311,8 +15347,8 @@ function toLinesWithContent(input = "", trimmed2 = true, separator = "\n") {
15311
15347
  function forEachLineWithContent(input, callback) {
15312
15348
  return toLinesWithContent(input, true).map((line) => callback(line));
15313
15349
  }
15314
- function folderExists(path19) {
15315
- return (0, import_file_exists.exists)(path19, import_file_exists.FOLDER);
15350
+ function folderExists(path20) {
15351
+ return (0, import_file_exists.exists)(path20, import_file_exists.FOLDER);
15316
15352
  }
15317
15353
  function append(target, item) {
15318
15354
  if (Array.isArray(target)) {
@@ -15503,8 +15539,8 @@ function checkIsRepoRootTask() {
15503
15539
  commands,
15504
15540
  format: "utf-8",
15505
15541
  onError,
15506
- parser(path19) {
15507
- return /^\.(git)?$/.test(path19.trim());
15542
+ parser(path20) {
15543
+ return /^\.(git)?$/.test(path20.trim());
15508
15544
  }
15509
15545
  };
15510
15546
  }
@@ -15760,11 +15796,11 @@ function parseGrep(grep) {
15760
15796
  const paths = /* @__PURE__ */ new Set();
15761
15797
  const results = {};
15762
15798
  forEachLineWithContent(grep, (input) => {
15763
- const [path19, line, preview] = input.split(NULL);
15764
- paths.add(path19);
15765
- (results[path19] = results[path19] || []).push({
15799
+ const [path20, line, preview] = input.split(NULL);
15800
+ paths.add(path20);
15801
+ (results[path20] = results[path20] || []).push({
15766
15802
  line: asNumber(line),
15767
- path: path19,
15803
+ path: path20,
15768
15804
  preview
15769
15805
  });
15770
15806
  });
@@ -16061,14 +16097,14 @@ function hashObjectTask(filePath, write) {
16061
16097
  }
16062
16098
  return straightThroughStringTask(commands, true);
16063
16099
  }
16064
- function parseInit(bare, path19, text) {
16100
+ function parseInit(bare, path20, text) {
16065
16101
  const response = String(text).trim();
16066
16102
  let result;
16067
16103
  if (result = initResponseRegex.exec(response)) {
16068
- return new InitSummary(bare, path19, false, result[1]);
16104
+ return new InitSummary(bare, path20, false, result[1]);
16069
16105
  }
16070
16106
  if (result = reInitResponseRegex.exec(response)) {
16071
- return new InitSummary(bare, path19, true, result[1]);
16107
+ return new InitSummary(bare, path20, true, result[1]);
16072
16108
  }
16073
16109
  let gitDir = "";
16074
16110
  const tokens = response.split(" ");
@@ -16079,12 +16115,12 @@ function parseInit(bare, path19, text) {
16079
16115
  break;
16080
16116
  }
16081
16117
  }
16082
- return new InitSummary(bare, path19, /^re/i.test(response), gitDir);
16118
+ return new InitSummary(bare, path20, /^re/i.test(response), gitDir);
16083
16119
  }
16084
16120
  function hasBareCommand(command) {
16085
16121
  return command.includes(bareCommand);
16086
16122
  }
16087
- function initTask(bare = false, path19, customArgs) {
16123
+ function initTask(bare = false, path20, customArgs) {
16088
16124
  const commands = ["init", ...customArgs];
16089
16125
  if (bare && !hasBareCommand(commands)) {
16090
16126
  commands.splice(1, 0, bareCommand);
@@ -16093,7 +16129,7 @@ function initTask(bare = false, path19, customArgs) {
16093
16129
  commands,
16094
16130
  format: "utf-8",
16095
16131
  parser(text) {
16096
- return parseInit(commands.includes("--bare"), path19, text);
16132
+ return parseInit(commands.includes("--bare"), path20, text);
16097
16133
  }
16098
16134
  };
16099
16135
  }
@@ -16372,14 +16408,14 @@ function splitLine(result, lineStr) {
16372
16408
  default:
16373
16409
  return;
16374
16410
  }
16375
- function data(index, workingDir, path19) {
16411
+ function data(index, workingDir, path20) {
16376
16412
  const raw = `${index}${workingDir}`;
16377
16413
  const handler = parsers6.get(raw);
16378
16414
  if (handler) {
16379
- handler(result, path19);
16415
+ handler(result, path20);
16380
16416
  }
16381
16417
  if (raw !== "##" && raw !== "!!") {
16382
- result.files.push(new FileStatusSummary(path19, index, workingDir));
16418
+ result.files.push(new FileStatusSummary(path20, index, workingDir));
16383
16419
  }
16384
16420
  }
16385
16421
  }
@@ -16566,8 +16602,8 @@ function deleteBranchTask(branch, forceDelete = false) {
16566
16602
  return task;
16567
16603
  }
16568
16604
  function toPath(input) {
16569
- const path19 = input.trim().replace(/^["']|["']$/g, "");
16570
- return path19 && normalize2(path19);
16605
+ const path20 = input.trim().replace(/^["']|["']$/g, "");
16606
+ return path20 && normalize2(path20);
16571
16607
  }
16572
16608
  function checkIgnoreTask(paths) {
16573
16609
  return {
@@ -16706,8 +16742,8 @@ function stashListTask(opt = {}, customArgs) {
16706
16742
  parser: parser4
16707
16743
  };
16708
16744
  }
16709
- function addSubModuleTask(repo, path19) {
16710
- return subModuleTask(["add", repo, path19]);
16745
+ function addSubModuleTask(repo, path20) {
16746
+ return subModuleTask(["add", repo, path20]);
16711
16747
  }
16712
16748
  function initSubModuleTask(customArgs) {
16713
16749
  return subModuleTask(["init", ...customArgs]);
@@ -17970,9 +18006,9 @@ var init_esm = __esm({
17970
18006
  "src/lib/responses/InitSummary.ts"() {
17971
18007
  "use strict";
17972
18008
  InitSummary = class {
17973
- constructor(bare, path19, existing, gitDir) {
18009
+ constructor(bare, path20, existing, gitDir) {
17974
18010
  this.bare = bare;
17975
- this.path = path19;
18011
+ this.path = path20;
17976
18012
  this.existing = existing;
17977
18013
  this.gitDir = gitDir;
17978
18014
  }
@@ -18505,12 +18541,12 @@ var init_esm = __esm({
18505
18541
  "use strict";
18506
18542
  fromPathRegex = /^(.+)\0(.+)$/;
18507
18543
  FileStatusSummary = class {
18508
- constructor(path19, index, working_dir) {
18509
- this.path = path19;
18544
+ constructor(path20, index, working_dir) {
18545
+ this.path = path20;
18510
18546
  this.index = index;
18511
18547
  this.working_dir = working_dir;
18512
18548
  if (index === "R" || working_dir === "R") {
18513
- const detail = fromPathRegex.exec(path19) || [null, path19, path19];
18549
+ const detail = fromPathRegex.exec(path20) || [null, path20, path20];
18514
18550
  this.from = detail[2] || "";
18515
18551
  this.path = detail[1] || "";
18516
18552
  }
@@ -18772,9 +18808,9 @@ var init_esm = __esm({
18772
18808
  next
18773
18809
  );
18774
18810
  }
18775
- hashObject(path19, write) {
18811
+ hashObject(path20, write) {
18776
18812
  return this._runTask(
18777
- hashObjectTask(path19, write === true),
18813
+ hashObjectTask(path20, write === true),
18778
18814
  trailingFunctionArgument(arguments)
18779
18815
  );
18780
18816
  }
@@ -19411,8 +19447,8 @@ var init_esm = __esm({
19411
19447
  }
19412
19448
  return this._runTask(straightThroughStringTask2(command, this._trimmed), next);
19413
19449
  };
19414
- Git2.prototype.submoduleAdd = function(repo, path19, then) {
19415
- return this._runTask(addSubModuleTask2(repo, path19), trailingFunctionArgument2(arguments));
19450
+ Git2.prototype.submoduleAdd = function(repo, path20, then) {
19451
+ return this._runTask(addSubModuleTask2(repo, path20), trailingFunctionArgument2(arguments));
19416
19452
  };
19417
19453
  Git2.prototype.submoduleUpdate = function(args2, then) {
19418
19454
  return this._runTask(
@@ -19671,6 +19707,18 @@ function normalizePath(p2, projectRoot) {
19671
19707
  const normalized = path3.posix.normalize(cleaned);
19672
19708
  return process.platform === "win32" ? normalized.toLowerCase() : normalized;
19673
19709
  }
19710
+ function toGitPathspec(p2, projectRoot) {
19711
+ if (p2.includes("*")) return null;
19712
+ let cleaned = p2.replace(/\\/g, "/");
19713
+ if (path3.isAbsolute(p2)) {
19714
+ const rel = path3.relative(projectRoot, p2).replace(/\\/g, "/");
19715
+ if (!rel || rel.startsWith("..")) return null;
19716
+ cleaned = rel;
19717
+ }
19718
+ const normalized = path3.posix.normalize(cleaned);
19719
+ if (normalized === ".." || normalized.startsWith("../")) return null;
19720
+ return process.platform === "win32" ? `:(icase)${normalized}` : normalized;
19721
+ }
19674
19722
  function getGit(projectRoot) {
19675
19723
  if (!gitInstance || gitProjectRoot !== projectRoot) {
19676
19724
  gitInstance = esm_default(projectRoot);
@@ -19717,7 +19765,12 @@ async function getCommitsSinceBatch(projectRoot, paths, since) {
19717
19765
  try {
19718
19766
  const git = getGit(projectRoot);
19719
19767
  const SENTINEL = "___CTXLINT_COMMIT___";
19720
- const raw = await git.raw([
19768
+ const pathspecs = [];
19769
+ for (const p2 of paths) {
19770
+ const spec = toGitPathspec(p2, projectRoot);
19771
+ if (spec) pathspecs.push(spec);
19772
+ }
19773
+ const logArgs = [
19721
19774
  // Git's default core.quotePath=true wraps non-ASCII paths in quotes
19722
19775
  // with octal escapes ("src/f\303\266\303\266.txt"); nothing below
19723
19776
  // unquotes, so the leading `"` would break both the exact and the
@@ -19731,7 +19784,11 @@ async function getCommitsSinceBatch(projectRoot, paths, since) {
19731
19784
  // what keeps git from rejecting the sentinel as an invalid --pretty
19732
19785
  // format ("fatal: invalid --pretty format: ___CTXLINT_COMMIT___").
19733
19786
  `--format=%n${SENTINEL}`
19734
- ]);
19787
+ ];
19788
+ if (pathspecs.length > 0) {
19789
+ logArgs.push("--", ...pathspecs);
19790
+ }
19791
+ const raw = await git.raw(logArgs);
19735
19792
  const requested = new Set(counts.keys());
19736
19793
  const lines = raw.split("\n");
19737
19794
  let inCommit = false;
@@ -20423,13 +20480,28 @@ function getProjectFiles(projectRoot) {
20423
20480
  cachedProjectFiles = { root: projectRoot, files };
20424
20481
  return files;
20425
20482
  }
20483
+ function getBasenameIndex(projectRoot, files) {
20484
+ if (cachedBasenameIndex?.root === projectRoot) return cachedBasenameIndex.index;
20485
+ const index = /* @__PURE__ */ new Map();
20486
+ for (const file2 of files) {
20487
+ const norm = file2.replace(/\\/g, "/");
20488
+ const base = path4.basename(norm);
20489
+ const list = index.get(base);
20490
+ if (list) list.push(norm);
20491
+ else index.set(base, [norm]);
20492
+ }
20493
+ cachedBasenameIndex = { root: projectRoot, index };
20494
+ return index;
20495
+ }
20426
20496
  function resetPathsCache() {
20427
20497
  cachedProjectFiles = null;
20498
+ cachedBasenameIndex = null;
20428
20499
  resetRenameCache();
20429
20500
  }
20430
20501
  async function checkPaths(file2, projectRoot) {
20431
20502
  const issues = [];
20432
20503
  const projectFiles = getProjectFiles(projectRoot);
20504
+ const basenameIndex = getBasenameIndex(projectRoot, projectFiles);
20433
20505
  const contextDir = path4.dirname(file2.filePath);
20434
20506
  const pending = [];
20435
20507
  for (const ref of file2.references.paths) {
@@ -20514,7 +20586,7 @@ async function checkPaths(file2, projectRoot) {
20514
20586
  suggestion = `Did you mean ${rename.newPath}?`;
20515
20587
  detail = `Renamed ${rename.daysAgo} days ago in commit ${rename.commitHash}`;
20516
20588
  } else {
20517
- const match = findClosestMatch(normalizedRef, projectFiles);
20589
+ const match = findClosestMatch(normalizedRef, projectFiles, basenameIndex);
20518
20590
  if (match) {
20519
20591
  fixTarget = match;
20520
20592
  suggestion = `Did you mean ${match}?`;
@@ -20555,14 +20627,14 @@ async function checkPaths(file2, projectRoot) {
20555
20627
  }
20556
20628
  return issues;
20557
20629
  }
20558
- function findClosestMatch(target, files) {
20630
+ function findClosestMatch(target, files, basenameIndex) {
20559
20631
  const targetNorm = target.replace(/\\/g, "/");
20560
20632
  const targetBase = path4.basename(targetNorm);
20633
+ const candidates = basenameIndex.get(targetBase) ?? [];
20561
20634
  let basenameMatch = null;
20562
20635
  let basenameDistance = Infinity;
20563
- for (const file2 of files) {
20564
- const fileNorm = file2.replace(/\\/g, "/");
20565
- if (path4.basename(fileNorm) === targetBase && fileNorm !== targetNorm) {
20636
+ for (const fileNorm of candidates) {
20637
+ if (fileNorm !== targetNorm) {
20566
20638
  const dist = levenshtein(targetNorm, fileNorm);
20567
20639
  if (dist < basenameDistance) {
20568
20640
  basenameDistance = dist;
@@ -20586,7 +20658,7 @@ function findClosestMatch(target, files) {
20586
20658
  }
20587
20659
  return fullPathMatch;
20588
20660
  }
20589
- var import_fast_levenshtein, levenshtein, GLOB_IGNORE, cachedProjectFiles;
20661
+ var import_fast_levenshtein, levenshtein, GLOB_IGNORE, cachedProjectFiles, cachedBasenameIndex;
20590
20662
  var init_paths = __esm({
20591
20663
  "src/core/checks/paths.ts"() {
20592
20664
  "use strict";
@@ -20598,6 +20670,7 @@ var init_paths = __esm({
20598
20670
  levenshtein = import_fast_levenshtein.default.get;
20599
20671
  GLOB_IGNORE = ["**/node_modules/**", "**/.git/**", "**/dist/**", "**/build/**"];
20600
20672
  cachedProjectFiles = null;
20673
+ cachedBasenameIndex = null;
20601
20674
  }
20602
20675
  });
20603
20676
 
@@ -21593,12 +21666,12 @@ function parseTree(text, errors = [], options = ParseOptions.DEFAULT) {
21593
21666
  }
21594
21667
  return result;
21595
21668
  }
21596
- function findNodeAtLocation(root, path19) {
21669
+ function findNodeAtLocation(root, path20) {
21597
21670
  if (!root) {
21598
21671
  return void 0;
21599
21672
  }
21600
21673
  let node = root;
21601
- for (let segment of path19) {
21674
+ for (let segment of path20) {
21602
21675
  if (typeof segment === "string") {
21603
21676
  if (node.type !== "object" || !Array.isArray(node.children)) {
21604
21677
  return void 0;
@@ -26156,8 +26229,8 @@ var require_utils = __commonJS({
26156
26229
  }
26157
26230
  return output;
26158
26231
  };
26159
- exports.basename = (path19, { windows } = {}) => {
26160
- const segs = path19.split(windows ? /[\\/]/ : "/");
26232
+ exports.basename = (path20, { windows } = {}) => {
26233
+ const segs = path20.split(windows ? /[\\/]/ : "/");
26161
26234
  const last2 = segs[segs.length - 1];
26162
26235
  if (last2 === "") {
26163
26236
  return segs[segs.length - 2];
@@ -27715,7 +27788,7 @@ import { readFileSync as readFileSync7 } from "node:fs";
27715
27788
  import { resolve as resolve14, dirname as dirname6 } from "node:path";
27716
27789
  import { fileURLToPath as fileURLToPath2 } from "node:url";
27717
27790
  function loadVersion() {
27718
- if (true) return "0.18.1";
27791
+ if (true) return "0.18.3";
27719
27792
  try {
27720
27793
  const __dir = dirname6(fileURLToPath2(import.meta.url));
27721
27794
  const pkgPath = resolve14(__dir, "../package.json");
@@ -28677,8 +28750,8 @@ var init_parseUtil = __esm({
28677
28750
  init_errors();
28678
28751
  init_en();
28679
28752
  makeIssue = (params) => {
28680
- const { data, path: path19, errorMaps, issueData } = params;
28681
- const fullPath = [...path19, ...issueData.path || []];
28753
+ const { data, path: path20, errorMaps, issueData } = params;
28754
+ const fullPath = [...path20, ...issueData.path || []];
28682
28755
  const fullIssue = {
28683
28756
  ...issueData,
28684
28757
  path: fullPath
@@ -28961,11 +29034,11 @@ var init_types2 = __esm({
28961
29034
  init_parseUtil();
28962
29035
  init_util2();
28963
29036
  ParseInputLazyPath = class {
28964
- constructor(parent, value, path19, key) {
29037
+ constructor(parent, value, path20, key) {
28965
29038
  this._cachedPath = [];
28966
29039
  this.parent = parent;
28967
29040
  this.data = value;
28968
- this._path = path19;
29041
+ this._path = path20;
28969
29042
  this._key = key;
28970
29043
  }
28971
29044
  get path() {
@@ -32467,10 +32540,10 @@ function mergeDefs(...defs) {
32467
32540
  function cloneDef(schema) {
32468
32541
  return mergeDefs(schema._zod.def);
32469
32542
  }
32470
- function getElementAtPath(obj, path19) {
32471
- if (!path19)
32543
+ function getElementAtPath(obj, path20) {
32544
+ if (!path20)
32472
32545
  return obj;
32473
- return path19.reduce((acc, key) => acc?.[key], obj);
32546
+ return path20.reduce((acc, key) => acc?.[key], obj);
32474
32547
  }
32475
32548
  function promiseAllObject(promisesObj) {
32476
32549
  const keys = Object.keys(promisesObj);
@@ -32798,11 +32871,11 @@ function explicitlyAborted(x3, startIndex = 0) {
32798
32871
  }
32799
32872
  return false;
32800
32873
  }
32801
- function prefixIssues(path19, issues) {
32874
+ function prefixIssues(path20, issues) {
32802
32875
  return issues.map((iss) => {
32803
32876
  var _a4;
32804
32877
  (_a4 = iss).path ?? (_a4.path = []);
32805
- iss.path.unshift(path19);
32878
+ iss.path.unshift(path20);
32806
32879
  return iss;
32807
32880
  });
32808
32881
  }
@@ -33020,16 +33093,16 @@ function flattenError(error52, mapper = (issue2) => issue2.message) {
33020
33093
  }
33021
33094
  function formatError(error52, mapper = (issue2) => issue2.message) {
33022
33095
  const fieldErrors = { _errors: [] };
33023
- const processError = (error53, path19 = []) => {
33096
+ const processError = (error53, path20 = []) => {
33024
33097
  for (const issue2 of error53.issues) {
33025
33098
  if (issue2.code === "invalid_union" && issue2.errors.length) {
33026
- issue2.errors.map((issues) => processError({ issues }, [...path19, ...issue2.path]));
33099
+ issue2.errors.map((issues) => processError({ issues }, [...path20, ...issue2.path]));
33027
33100
  } else if (issue2.code === "invalid_key") {
33028
- processError({ issues: issue2.issues }, [...path19, ...issue2.path]);
33101
+ processError({ issues: issue2.issues }, [...path20, ...issue2.path]);
33029
33102
  } else if (issue2.code === "invalid_element") {
33030
- processError({ issues: issue2.issues }, [...path19, ...issue2.path]);
33103
+ processError({ issues: issue2.issues }, [...path20, ...issue2.path]);
33031
33104
  } else {
33032
- const fullpath = [...path19, ...issue2.path];
33105
+ const fullpath = [...path20, ...issue2.path];
33033
33106
  if (fullpath.length === 0) {
33034
33107
  fieldErrors._errors.push(mapper(issue2));
33035
33108
  } else {
@@ -33056,17 +33129,17 @@ function formatError(error52, mapper = (issue2) => issue2.message) {
33056
33129
  }
33057
33130
  function treeifyError(error52, mapper = (issue2) => issue2.message) {
33058
33131
  const result = { errors: [] };
33059
- const processError = (error53, path19 = []) => {
33132
+ const processError = (error53, path20 = []) => {
33060
33133
  var _a4, _b;
33061
33134
  for (const issue2 of error53.issues) {
33062
33135
  if (issue2.code === "invalid_union" && issue2.errors.length) {
33063
- issue2.errors.map((issues) => processError({ issues }, [...path19, ...issue2.path]));
33136
+ issue2.errors.map((issues) => processError({ issues }, [...path20, ...issue2.path]));
33064
33137
  } else if (issue2.code === "invalid_key") {
33065
- processError({ issues: issue2.issues }, [...path19, ...issue2.path]);
33138
+ processError({ issues: issue2.issues }, [...path20, ...issue2.path]);
33066
33139
  } else if (issue2.code === "invalid_element") {
33067
- processError({ issues: issue2.issues }, [...path19, ...issue2.path]);
33140
+ processError({ issues: issue2.issues }, [...path20, ...issue2.path]);
33068
33141
  } else {
33069
- const fullpath = [...path19, ...issue2.path];
33142
+ const fullpath = [...path20, ...issue2.path];
33070
33143
  if (fullpath.length === 0) {
33071
33144
  result.errors.push(mapper(issue2));
33072
33145
  continue;
@@ -33098,8 +33171,8 @@ function treeifyError(error52, mapper = (issue2) => issue2.message) {
33098
33171
  }
33099
33172
  function toDotPath(_path) {
33100
33173
  const segs = [];
33101
- const path19 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
33102
- for (const seg of path19) {
33174
+ const path20 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
33175
+ for (const seg of path20) {
33103
33176
  if (typeof seg === "number")
33104
33177
  segs.push(`[${seg}]`);
33105
33178
  else if (typeof seg === "symbol")
@@ -46860,13 +46933,13 @@ function resolveRef2(ref, ctx) {
46860
46933
  if (!ref.startsWith("#")) {
46861
46934
  throw new Error("External $ref is not supported, only local refs (#/...) are allowed");
46862
46935
  }
46863
- const path19 = ref.slice(1).split("/").filter(Boolean);
46864
- if (path19.length === 0) {
46936
+ const path20 = ref.slice(1).split("/").filter(Boolean);
46937
+ if (path20.length === 0) {
46865
46938
  return ctx.rootSchema;
46866
46939
  }
46867
46940
  const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions";
46868
- if (path19[0] === defsKey) {
46869
- const key = path19[1];
46941
+ if (path20[0] === defsKey) {
46942
+ const key = path20[1];
46870
46943
  if (!key || !ctx.defs[key]) {
46871
46944
  throw new Error(`Reference not found: ${ref}`);
46872
46945
  }
@@ -55035,8 +55108,8 @@ var require_utils2 = __commonJS({
55035
55108
  }
55036
55109
  return ind;
55037
55110
  }
55038
- function removeDotSegments(path19) {
55039
- let input = path19;
55111
+ function removeDotSegments(path20) {
55112
+ let input = path20;
55040
55113
  const output = [];
55041
55114
  let nextSlash = -1;
55042
55115
  let len = 0;
@@ -55289,8 +55362,8 @@ var require_schemes = __commonJS({
55289
55362
  wsComponent.secure = void 0;
55290
55363
  }
55291
55364
  if (wsComponent.resourceName) {
55292
- const [path19, query] = wsComponent.resourceName.split("?");
55293
- wsComponent.path = path19 && path19 !== "/" ? path19 : void 0;
55365
+ const [path20, query] = wsComponent.resourceName.split("?");
55366
+ wsComponent.path = path20 && path20 !== "/" ? path20 : void 0;
55294
55367
  wsComponent.query = query;
55295
55368
  wsComponent.resourceName = void 0;
55296
55369
  }
@@ -58729,12 +58802,12 @@ var require_dist3 = __commonJS({
58729
58802
  throw new Error(`Unknown format "${name}"`);
58730
58803
  return f;
58731
58804
  };
58732
- function addFormats(ajv, list, fs14, exportName) {
58805
+ function addFormats(ajv, list, fs15, exportName) {
58733
58806
  var _a4;
58734
58807
  var _b;
58735
58808
  (_a4 = (_b = ajv.opts.code).formats) !== null && _a4 !== void 0 ? _a4 : _b.formats = (0, codegen_1._)`require("ajv-formats/dist/formats").${exportName}`;
58736
58809
  for (const f of list)
58737
- ajv.addFormat(f, fs14[f]);
58810
+ ajv.addFormat(f, fs15[f]);
58738
58811
  }
58739
58812
  module.exports = exports = formatsPlugin;
58740
58813
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -61738,11 +61811,12 @@ var init_server4 = __esm({
61738
61811
  }
61739
61812
  });
61740
61813
 
61741
- // node_modules/.pnpm/commander@14.0.3/node_modules/commander/lib/error.js
61742
- var require_error = __commonJS({
61743
- "node_modules/.pnpm/commander@14.0.3/node_modules/commander/lib/error.js"(exports) {
61814
+ // node_modules/.pnpm/commander@15.0.0/node_modules/commander/lib/error.js
61815
+ var CommanderError, InvalidArgumentError;
61816
+ var init_error = __esm({
61817
+ "node_modules/.pnpm/commander@15.0.0/node_modules/commander/lib/error.js"() {
61744
61818
  init_define_WEB_FIRST_SEGMENTS();
61745
- var CommanderError2 = class extends Error {
61819
+ CommanderError = class extends Error {
61746
61820
  /**
61747
61821
  * Constructs the CommanderError class
61748
61822
  * @param {number} exitCode suggested exit code which could be used with process.exit
@@ -61758,7 +61832,7 @@ var require_error = __commonJS({
61758
61832
  this.nestedError = void 0;
61759
61833
  }
61760
61834
  };
61761
- var InvalidArgumentError2 = class extends CommanderError2 {
61835
+ InvalidArgumentError = class extends CommanderError {
61762
61836
  /**
61763
61837
  * Constructs the InvalidArgumentError class
61764
61838
  * @param {string} [message] explanation of why argument is invalid
@@ -61769,17 +61843,20 @@ var require_error = __commonJS({
61769
61843
  this.name = this.constructor.name;
61770
61844
  }
61771
61845
  };
61772
- exports.CommanderError = CommanderError2;
61773
- exports.InvalidArgumentError = InvalidArgumentError2;
61774
61846
  }
61775
61847
  });
61776
61848
 
61777
- // node_modules/.pnpm/commander@14.0.3/node_modules/commander/lib/argument.js
61778
- var require_argument = __commonJS({
61779
- "node_modules/.pnpm/commander@14.0.3/node_modules/commander/lib/argument.js"(exports) {
61849
+ // node_modules/.pnpm/commander@15.0.0/node_modules/commander/lib/argument.js
61850
+ function humanReadableArgName(arg) {
61851
+ const nameOutput = arg.name() + (arg.variadic === true ? "..." : "");
61852
+ return arg.required ? "<" + nameOutput + ">" : "[" + nameOutput + "]";
61853
+ }
61854
+ var Argument;
61855
+ var init_argument = __esm({
61856
+ "node_modules/.pnpm/commander@15.0.0/node_modules/commander/lib/argument.js"() {
61780
61857
  init_define_WEB_FIRST_SEGMENTS();
61781
- var { InvalidArgumentError: InvalidArgumentError2 } = require_error();
61782
- var Argument2 = class {
61858
+ init_error();
61859
+ Argument = class {
61783
61860
  /**
61784
61861
  * Initialize a new command argument with the given name and description.
61785
61862
  * The default is that the argument is required, and you can explicitly
@@ -61864,7 +61941,7 @@ var require_argument = __commonJS({
61864
61941
  this.argChoices = values.slice();
61865
61942
  this.parseArg = (arg, previous) => {
61866
61943
  if (!this.argChoices.includes(arg)) {
61867
- throw new InvalidArgumentError2(
61944
+ throw new InvalidArgumentError(
61868
61945
  `Allowed choices are ${this.argChoices.join(", ")}.`
61869
61946
  );
61870
61947
  }
@@ -61894,21 +61971,17 @@ var require_argument = __commonJS({
61894
61971
  return this;
61895
61972
  }
61896
61973
  };
61897
- function humanReadableArgName(arg) {
61898
- const nameOutput = arg.name() + (arg.variadic === true ? "..." : "");
61899
- return arg.required ? "<" + nameOutput + ">" : "[" + nameOutput + "]";
61900
- }
61901
- exports.Argument = Argument2;
61902
- exports.humanReadableArgName = humanReadableArgName;
61903
61974
  }
61904
61975
  });
61905
61976
 
61906
- // node_modules/.pnpm/commander@14.0.3/node_modules/commander/lib/help.js
61907
- var require_help = __commonJS({
61908
- "node_modules/.pnpm/commander@14.0.3/node_modules/commander/lib/help.js"(exports) {
61977
+ // node_modules/.pnpm/commander@15.0.0/node_modules/commander/lib/help.js
61978
+ import { stripVTControlCharacters } from "node:util";
61979
+ var Help;
61980
+ var init_help = __esm({
61981
+ "node_modules/.pnpm/commander@15.0.0/node_modules/commander/lib/help.js"() {
61909
61982
  init_define_WEB_FIRST_SEGMENTS();
61910
- var { humanReadableArgName } = require_argument();
61911
- var Help2 = class {
61983
+ init_argument();
61984
+ Help = class {
61912
61985
  constructor() {
61913
61986
  this.helpWidth = void 0;
61914
61987
  this.minWidthToWrap = 40;
@@ -62338,7 +62411,7 @@ var require_help = __commonJS({
62338
62411
  * @returns {number}
62339
62412
  */
62340
62413
  displayWidth(str) {
62341
- return stripColor(str).length;
62414
+ return stripVTControlCharacters(str).length;
62342
62415
  }
62343
62416
  /**
62344
62417
  * Style the title for displaying in the help. Called with 'Usage:', 'Options:', etc.
@@ -62497,21 +62570,60 @@ ${itemIndentStr}`);
62497
62570
  return wrappedLines.join("\n");
62498
62571
  }
62499
62572
  };
62500
- function stripColor(str) {
62501
- const sgrPattern = /\x1b\[\d*(;\d*)*m/g;
62502
- return str.replace(sgrPattern, "");
62503
- }
62504
- exports.Help = Help2;
62505
- exports.stripColor = stripColor;
62506
62573
  }
62507
62574
  });
62508
62575
 
62509
- // node_modules/.pnpm/commander@14.0.3/node_modules/commander/lib/option.js
62510
- var require_option = __commonJS({
62511
- "node_modules/.pnpm/commander@14.0.3/node_modules/commander/lib/option.js"(exports) {
62576
+ // node_modules/.pnpm/commander@15.0.0/node_modules/commander/lib/option.js
62577
+ function camelcase(str) {
62578
+ return str.split("-").reduce((str2, word) => {
62579
+ return str2 + word[0].toUpperCase() + word.slice(1);
62580
+ });
62581
+ }
62582
+ function splitOptionFlags(flags) {
62583
+ let shortFlag;
62584
+ let longFlag;
62585
+ const shortFlagExp = /^-[^-]$/;
62586
+ const longFlagExp = /^--[^-]/;
62587
+ const flagParts = flags.split(/[ |,]+/).concat("guard");
62588
+ if (shortFlagExp.test(flagParts[0])) shortFlag = flagParts.shift();
62589
+ if (longFlagExp.test(flagParts[0])) longFlag = flagParts.shift();
62590
+ if (!shortFlag && shortFlagExp.test(flagParts[0]))
62591
+ shortFlag = flagParts.shift();
62592
+ if (!shortFlag && longFlagExp.test(flagParts[0])) {
62593
+ shortFlag = longFlag;
62594
+ longFlag = flagParts.shift();
62595
+ }
62596
+ if (flagParts[0].startsWith("-")) {
62597
+ const unsupportedFlag = flagParts[0];
62598
+ const baseError = `option creation failed due to '${unsupportedFlag}' in option flags '${flags}'`;
62599
+ if (/^-[^-][^-]/.test(unsupportedFlag))
62600
+ throw new Error(
62601
+ `${baseError}
62602
+ - a short flag is a single dash and a single character
62603
+ - either use a single dash and a single character (for a short flag)
62604
+ - or use a double dash for a long option (and can have two, like '--ws, --workspace')`
62605
+ );
62606
+ if (shortFlagExp.test(unsupportedFlag))
62607
+ throw new Error(`${baseError}
62608
+ - too many short flags`);
62609
+ if (longFlagExp.test(unsupportedFlag))
62610
+ throw new Error(`${baseError}
62611
+ - too many long flags`);
62612
+ throw new Error(`${baseError}
62613
+ - unrecognised flag format`);
62614
+ }
62615
+ if (shortFlag === void 0 && longFlag === void 0)
62616
+ throw new Error(
62617
+ `option creation failed due to no flags found in '${flags}'.`
62618
+ );
62619
+ return { shortFlag, longFlag };
62620
+ }
62621
+ var Option, DualOptions;
62622
+ var init_option = __esm({
62623
+ "node_modules/.pnpm/commander@15.0.0/node_modules/commander/lib/option.js"() {
62512
62624
  init_define_WEB_FIRST_SEGMENTS();
62513
- var { InvalidArgumentError: InvalidArgumentError2 } = require_error();
62514
- var Option2 = class {
62625
+ init_error();
62626
+ Option = class {
62515
62627
  /**
62516
62628
  * Initialize a new `Option` with the given `flags` and `description`.
62517
62629
  *
@@ -62669,7 +62781,7 @@ var require_option = __commonJS({
62669
62781
  this.argChoices = values.slice();
62670
62782
  this.parseArg = (arg, previous) => {
62671
62783
  if (!this.argChoices.includes(arg)) {
62672
- throw new InvalidArgumentError2(
62784
+ throw new InvalidArgumentError(
62673
62785
  `Allowed choices are ${this.argChoices.join(", ")}.`
62674
62786
  );
62675
62787
  }
@@ -62735,7 +62847,7 @@ var require_option = __commonJS({
62735
62847
  return !this.required && !this.optional && !this.negate;
62736
62848
  }
62737
62849
  };
62738
- var DualOptions = class {
62850
+ DualOptions = class {
62739
62851
  /**
62740
62852
  * @param {Option[]} options
62741
62853
  */
@@ -62771,151 +62883,143 @@ var require_option = __commonJS({
62771
62883
  return option.negate === (negativeValue === value);
62772
62884
  }
62773
62885
  };
62774
- function camelcase(str) {
62775
- return str.split("-").reduce((str2, word) => {
62776
- return str2 + word[0].toUpperCase() + word.slice(1);
62777
- });
62778
- }
62779
- function splitOptionFlags(flags) {
62780
- let shortFlag;
62781
- let longFlag;
62782
- const shortFlagExp = /^-[^-]$/;
62783
- const longFlagExp = /^--[^-]/;
62784
- const flagParts = flags.split(/[ |,]+/).concat("guard");
62785
- if (shortFlagExp.test(flagParts[0])) shortFlag = flagParts.shift();
62786
- if (longFlagExp.test(flagParts[0])) longFlag = flagParts.shift();
62787
- if (!shortFlag && shortFlagExp.test(flagParts[0]))
62788
- shortFlag = flagParts.shift();
62789
- if (!shortFlag && longFlagExp.test(flagParts[0])) {
62790
- shortFlag = longFlag;
62791
- longFlag = flagParts.shift();
62792
- }
62793
- if (flagParts[0].startsWith("-")) {
62794
- const unsupportedFlag = flagParts[0];
62795
- const baseError = `option creation failed due to '${unsupportedFlag}' in option flags '${flags}'`;
62796
- if (/^-[^-][^-]/.test(unsupportedFlag))
62797
- throw new Error(
62798
- `${baseError}
62799
- - a short flag is a single dash and a single character
62800
- - either use a single dash and a single character (for a short flag)
62801
- - or use a double dash for a long option (and can have two, like '--ws, --workspace')`
62802
- );
62803
- if (shortFlagExp.test(unsupportedFlag))
62804
- throw new Error(`${baseError}
62805
- - too many short flags`);
62806
- if (longFlagExp.test(unsupportedFlag))
62807
- throw new Error(`${baseError}
62808
- - too many long flags`);
62809
- throw new Error(`${baseError}
62810
- - unrecognised flag format`);
62811
- }
62812
- if (shortFlag === void 0 && longFlag === void 0)
62813
- throw new Error(
62814
- `option creation failed due to no flags found in '${flags}'.`
62815
- );
62816
- return { shortFlag, longFlag };
62817
- }
62818
- exports.Option = Option2;
62819
- exports.DualOptions = DualOptions;
62820
62886
  }
62821
62887
  });
62822
62888
 
62823
- // node_modules/.pnpm/commander@14.0.3/node_modules/commander/lib/suggestSimilar.js
62824
- var require_suggestSimilar = __commonJS({
62825
- "node_modules/.pnpm/commander@14.0.3/node_modules/commander/lib/suggestSimilar.js"(exports) {
62826
- init_define_WEB_FIRST_SEGMENTS();
62827
- var maxDistance = 3;
62828
- function editDistance(a, b2) {
62829
- if (Math.abs(a.length - b2.length) > maxDistance)
62830
- return Math.max(a.length, b2.length);
62831
- const d = [];
62832
- for (let i2 = 0; i2 <= a.length; i2++) {
62833
- d[i2] = [i2];
62834
- }
62835
- for (let j3 = 0; j3 <= b2.length; j3++) {
62836
- d[0][j3] = j3;
62837
- }
62838
- for (let j3 = 1; j3 <= b2.length; j3++) {
62839
- for (let i2 = 1; i2 <= a.length; i2++) {
62840
- let cost = 1;
62841
- if (a[i2 - 1] === b2[j3 - 1]) {
62842
- cost = 0;
62843
- } else {
62844
- cost = 1;
62845
- }
62846
- d[i2][j3] = Math.min(
62847
- d[i2 - 1][j3] + 1,
62848
- // deletion
62849
- d[i2][j3 - 1] + 1,
62850
- // insertion
62851
- d[i2 - 1][j3 - 1] + cost
62852
- // substitution
62853
- );
62854
- if (i2 > 1 && j3 > 1 && a[i2 - 1] === b2[j3 - 2] && a[i2 - 2] === b2[j3 - 1]) {
62855
- d[i2][j3] = Math.min(d[i2][j3], d[i2 - 2][j3 - 2] + 1);
62856
- }
62857
- }
62889
+ // node_modules/.pnpm/commander@15.0.0/node_modules/commander/lib/suggestSimilar.js
62890
+ function editDistance(a, b2) {
62891
+ if (Math.abs(a.length - b2.length) > maxDistance)
62892
+ return Math.max(a.length, b2.length);
62893
+ const d = [];
62894
+ for (let i2 = 0; i2 <= a.length; i2++) {
62895
+ d[i2] = [i2];
62896
+ }
62897
+ for (let j3 = 0; j3 <= b2.length; j3++) {
62898
+ d[0][j3] = j3;
62899
+ }
62900
+ for (let j3 = 1; j3 <= b2.length; j3++) {
62901
+ for (let i2 = 1; i2 <= a.length; i2++) {
62902
+ let cost;
62903
+ if (a[i2 - 1] === b2[j3 - 1]) {
62904
+ cost = 0;
62905
+ } else {
62906
+ cost = 1;
62907
+ }
62908
+ d[i2][j3] = Math.min(
62909
+ d[i2 - 1][j3] + 1,
62910
+ // deletion
62911
+ d[i2][j3 - 1] + 1,
62912
+ // insertion
62913
+ d[i2 - 1][j3 - 1] + cost
62914
+ // substitution
62915
+ );
62916
+ if (i2 > 1 && j3 > 1 && a[i2 - 1] === b2[j3 - 2] && a[i2 - 2] === b2[j3 - 1]) {
62917
+ d[i2][j3] = Math.min(d[i2][j3], d[i2 - 2][j3 - 2] + 1);
62858
62918
  }
62859
- return d[a.length][b2.length];
62860
62919
  }
62861
- function suggestSimilar(word, candidates) {
62862
- if (!candidates || candidates.length === 0) return "";
62863
- candidates = Array.from(new Set(candidates));
62864
- const searchingOptions = word.startsWith("--");
62865
- if (searchingOptions) {
62866
- word = word.slice(2);
62867
- candidates = candidates.map((candidate) => candidate.slice(2));
62868
- }
62869
- let similar = [];
62870
- let bestDistance = maxDistance;
62871
- const minSimilarity = 0.4;
62872
- candidates.forEach((candidate) => {
62873
- if (candidate.length <= 1) return;
62874
- const distance2 = editDistance(word, candidate);
62875
- const length = Math.max(word.length, candidate.length);
62876
- const similarity = (length - distance2) / length;
62877
- if (similarity > minSimilarity) {
62878
- if (distance2 < bestDistance) {
62879
- bestDistance = distance2;
62880
- similar = [candidate];
62881
- } else if (distance2 === bestDistance) {
62882
- similar.push(candidate);
62883
- }
62884
- }
62885
- });
62886
- similar.sort((a, b2) => a.localeCompare(b2));
62887
- if (searchingOptions) {
62888
- similar = similar.map((candidate) => `--${candidate}`);
62920
+ }
62921
+ return d[a.length][b2.length];
62922
+ }
62923
+ function suggestSimilar(word, candidates) {
62924
+ if (!candidates || candidates.length === 0) return "";
62925
+ candidates = Array.from(new Set(candidates));
62926
+ const searchingOptions = word.startsWith("--");
62927
+ if (searchingOptions) {
62928
+ word = word.slice(2);
62929
+ candidates = candidates.map((candidate) => candidate.slice(2));
62930
+ }
62931
+ let similar = [];
62932
+ let bestDistance = maxDistance;
62933
+ const minSimilarity = 0.4;
62934
+ candidates.forEach((candidate) => {
62935
+ if (candidate.length <= 1) return;
62936
+ const distance2 = editDistance(word, candidate);
62937
+ const length = Math.max(word.length, candidate.length);
62938
+ const similarity = (length - distance2) / length;
62939
+ if (similarity > minSimilarity) {
62940
+ if (distance2 < bestDistance) {
62941
+ bestDistance = distance2;
62942
+ similar = [candidate];
62943
+ } else if (distance2 === bestDistance) {
62944
+ similar.push(candidate);
62889
62945
  }
62890
- if (similar.length > 1) {
62891
- return `
62946
+ }
62947
+ });
62948
+ similar.sort((a, b2) => a.localeCompare(b2));
62949
+ if (searchingOptions) {
62950
+ similar = similar.map((candidate) => `--${candidate}`);
62951
+ }
62952
+ if (similar.length > 1) {
62953
+ return `
62892
62954
  (Did you mean one of ${similar.join(", ")}?)`;
62893
- }
62894
- if (similar.length === 1) {
62895
- return `
62955
+ }
62956
+ if (similar.length === 1) {
62957
+ return `
62896
62958
  (Did you mean ${similar[0]}?)`;
62897
- }
62898
- return "";
62899
- }
62900
- exports.suggestSimilar = suggestSimilar;
62959
+ }
62960
+ return "";
62961
+ }
62962
+ var maxDistance;
62963
+ var init_suggestSimilar = __esm({
62964
+ "node_modules/.pnpm/commander@15.0.0/node_modules/commander/lib/suggestSimilar.js"() {
62965
+ init_define_WEB_FIRST_SEGMENTS();
62966
+ maxDistance = 3;
62901
62967
  }
62902
62968
  });
62903
62969
 
62904
- // node_modules/.pnpm/commander@14.0.3/node_modules/commander/lib/command.js
62905
- var require_command = __commonJS({
62906
- "node_modules/.pnpm/commander@14.0.3/node_modules/commander/lib/command.js"(exports) {
62970
+ // node_modules/.pnpm/commander@15.0.0/node_modules/commander/lib/command.js
62971
+ import { EventEmitter as EventEmitter2 } from "node:events";
62972
+ import childProcess from "node:child_process";
62973
+ import path18 from "node:path";
62974
+ import fs13 from "node:fs";
62975
+ import process5 from "node:process";
62976
+ import { stripVTControlCharacters as stripVTControlCharacters2 } from "node:util";
62977
+ function incrementNodeInspectorPort(args2) {
62978
+ return args2.map((arg) => {
62979
+ if (!arg.startsWith("--inspect")) {
62980
+ return arg;
62981
+ }
62982
+ let debugOption;
62983
+ let debugHost = "127.0.0.1";
62984
+ let debugPort = "9229";
62985
+ let match;
62986
+ if ((match = arg.match(/^(--inspect(-brk)?)$/)) !== null) {
62987
+ debugOption = match[1];
62988
+ } else if ((match = arg.match(/^(--inspect(-brk|-port)?)=([^:]+)$/)) !== null) {
62989
+ debugOption = match[1];
62990
+ if (/^\d+$/.test(match[3])) {
62991
+ debugPort = match[3];
62992
+ } else {
62993
+ debugHost = match[3];
62994
+ }
62995
+ } else if ((match = arg.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/)) !== null) {
62996
+ debugOption = match[1];
62997
+ debugHost = match[3];
62998
+ debugPort = match[4];
62999
+ }
63000
+ if (debugOption && debugPort !== "0") {
63001
+ return `${debugOption}=${debugHost}:${parseInt(debugPort) + 1}`;
63002
+ }
63003
+ return arg;
63004
+ });
63005
+ }
63006
+ function useColor() {
63007
+ if (process5.env.NO_COLOR || process5.env.FORCE_COLOR === "0" || process5.env.FORCE_COLOR === "false")
63008
+ return false;
63009
+ if (process5.env.FORCE_COLOR || process5.env.CLICOLOR_FORCE !== void 0)
63010
+ return true;
63011
+ return void 0;
63012
+ }
63013
+ var Command2;
63014
+ var init_command = __esm({
63015
+ "node_modules/.pnpm/commander@15.0.0/node_modules/commander/lib/command.js"() {
62907
63016
  init_define_WEB_FIRST_SEGMENTS();
62908
- var EventEmitter2 = __require("node:events").EventEmitter;
62909
- var childProcess = __require("node:child_process");
62910
- var path19 = __require("node:path");
62911
- var fs14 = __require("node:fs");
62912
- var process11 = __require("node:process");
62913
- var { Argument: Argument2, humanReadableArgName } = require_argument();
62914
- var { CommanderError: CommanderError2 } = require_error();
62915
- var { Help: Help2, stripColor } = require_help();
62916
- var { Option: Option2, DualOptions } = require_option();
62917
- var { suggestSimilar } = require_suggestSimilar();
62918
- var Command3 = class _Command extends EventEmitter2 {
63017
+ init_argument();
63018
+ init_error();
63019
+ init_help();
63020
+ init_option();
63021
+ init_suggestSimilar();
63022
+ Command2 = class _Command extends EventEmitter2 {
62919
63023
  /**
62920
63024
  * Initialize a new `Command`.
62921
63025
  *
@@ -62956,14 +63060,14 @@ var require_command = __commonJS({
62956
63060
  this._showSuggestionAfterError = true;
62957
63061
  this._savedState = null;
62958
63062
  this._outputConfiguration = {
62959
- writeOut: (str) => process11.stdout.write(str),
62960
- writeErr: (str) => process11.stderr.write(str),
63063
+ writeOut: (str) => process5.stdout.write(str),
63064
+ writeErr: (str) => process5.stderr.write(str),
62961
63065
  outputError: (str, write) => write(str),
62962
- getOutHelpWidth: () => process11.stdout.isTTY ? process11.stdout.columns : void 0,
62963
- getErrHelpWidth: () => process11.stderr.isTTY ? process11.stderr.columns : void 0,
62964
- getOutHasColors: () => useColor() ?? (process11.stdout.isTTY && process11.stdout.hasColors?.()),
62965
- getErrHasColors: () => useColor() ?? (process11.stderr.isTTY && process11.stderr.hasColors?.()),
62966
- stripColor: (str) => stripColor(str)
63066
+ getOutHelpWidth: () => process5.stdout.isTTY ? process5.stdout.columns : void 0,
63067
+ getErrHelpWidth: () => process5.stderr.isTTY ? process5.stderr.columns : void 0,
63068
+ getOutHasColors: () => useColor() ?? (process5.stdout.isTTY && process5.stdout.hasColors?.()),
63069
+ getErrHasColors: () => useColor() ?? (process5.stderr.isTTY && process5.stderr.hasColors?.()),
63070
+ stripColor: (str) => stripVTControlCharacters2(str)
62967
63071
  };
62968
63072
  this._hidden = false;
62969
63073
  this._helpOption = void 0;
@@ -63074,7 +63178,7 @@ var require_command = __commonJS({
63074
63178
  * @return {Help}
63075
63179
  */
63076
63180
  createHelp() {
63077
- return Object.assign(new Help2(), this.configureHelp());
63181
+ return Object.assign(new Help(), this.configureHelp());
63078
63182
  }
63079
63183
  /**
63080
63184
  * You can customise the help by overriding Help properties using configureHelp(),
@@ -63172,7 +63276,7 @@ var require_command = __commonJS({
63172
63276
  * @return {Argument} new argument
63173
63277
  */
63174
63278
  createArgument(name, description) {
63175
- return new Argument2(name, description);
63279
+ return new Argument(name, description);
63176
63280
  }
63177
63281
  /**
63178
63282
  * Define argument syntax for command.
@@ -63354,9 +63458,9 @@ Expecting one of '${allowedValues.join("', '")}'`);
63354
63458
  */
63355
63459
  _exit(exitCode, code, message) {
63356
63460
  if (this._exitCallback) {
63357
- this._exitCallback(new CommanderError2(exitCode, code, message));
63461
+ this._exitCallback(new CommanderError(exitCode, code, message));
63358
63462
  }
63359
- process11.exit(exitCode);
63463
+ process5.exit(exitCode);
63360
63464
  }
63361
63465
  /**
63362
63466
  * Register callback `fn` for the command.
@@ -63398,7 +63502,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
63398
63502
  * @return {Option} new option
63399
63503
  */
63400
63504
  createOption(flags, description) {
63401
- return new Option2(flags, description);
63505
+ return new Option(flags, description);
63402
63506
  }
63403
63507
  /**
63404
63508
  * Wrap parseArgs to catch 'commander.invalidArgument'.
@@ -63471,16 +63575,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
63471
63575
  this._registerOption(option);
63472
63576
  const oname = option.name();
63473
63577
  const name = option.attributeName();
63474
- if (option.negate) {
63475
- const positiveLongFlag = option.long.replace(/^--no-/, "--");
63476
- if (!this._findOption(positiveLongFlag)) {
63477
- this.setOptionValueWithSource(
63478
- name,
63479
- option.defaultValue === void 0 ? true : option.defaultValue,
63480
- "default"
63481
- );
63482
- }
63483
- } else if (option.defaultValue !== void 0) {
63578
+ if (option.defaultValue !== void 0) {
63484
63579
  this.setOptionValueWithSource(name, option.defaultValue, "default");
63485
63580
  }
63486
63581
  const handleOptionValue = (val, invalidValueMessage, valueSource) => {
@@ -63523,7 +63618,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
63523
63618
  * @private
63524
63619
  */
63525
63620
  _optionEx(config2, flags, description, fn, defaultValue) {
63526
- if (typeof flags === "object" && flags instanceof Option2) {
63621
+ if (typeof flags === "object" && flags instanceof Option) {
63527
63622
  throw new Error(
63528
63623
  "To add an Option object use addOption() instead of option() or requiredOption()"
63529
63624
  );
@@ -63756,16 +63851,16 @@ Expecting one of '${allowedValues.join("', '")}'`);
63756
63851
  }
63757
63852
  parseOptions = parseOptions || {};
63758
63853
  if (argv === void 0 && parseOptions.from === void 0) {
63759
- if (process11.versions?.electron) {
63854
+ if (process5.versions?.electron) {
63760
63855
  parseOptions.from = "electron";
63761
63856
  }
63762
- const execArgv = process11.execArgv ?? [];
63857
+ const execArgv = process5.execArgv ?? [];
63763
63858
  if (execArgv.includes("-e") || execArgv.includes("--eval") || execArgv.includes("-p") || execArgv.includes("--print")) {
63764
63859
  parseOptions.from = "eval";
63765
63860
  }
63766
63861
  }
63767
63862
  if (argv === void 0) {
63768
- argv = process11.argv;
63863
+ argv = process5.argv;
63769
63864
  }
63770
63865
  this.rawArgs = argv.slice();
63771
63866
  let userArgs;
@@ -63776,7 +63871,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
63776
63871
  userArgs = argv.slice(2);
63777
63872
  break;
63778
63873
  case "electron":
63779
- if (process11.defaultApp) {
63874
+ if (process5.defaultApp) {
63780
63875
  this._scriptPath = argv[1];
63781
63876
  userArgs = argv.slice(2);
63782
63877
  } else {
@@ -63855,6 +63950,18 @@ Expecting one of '${allowedValues.join("', '")}'`);
63855
63950
  }
63856
63951
  _prepareForParse() {
63857
63952
  if (this._savedState === null) {
63953
+ this.options.filter(
63954
+ (option) => option.negate && option.defaultValue === void 0 && this.getOptionValue(option.attributeName()) === void 0
63955
+ ).forEach((option) => {
63956
+ const positiveLongFlag = option.long.replace(/^--no-/, "--");
63957
+ if (!this._findOption(positiveLongFlag)) {
63958
+ this.setOptionValueWithSource(
63959
+ option.attributeName(),
63960
+ true,
63961
+ "default"
63962
+ );
63963
+ }
63964
+ });
63858
63965
  this.saveStateBeforeParse();
63859
63966
  } else {
63860
63967
  this.restoreStateBeforeParse();
@@ -63902,7 +64009,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
63902
64009
  * @param {string} subcommandName
63903
64010
  */
63904
64011
  _checkForMissingExecutable(executableFile, executableDir, subcommandName) {
63905
- if (fs14.existsSync(executableFile)) return;
64012
+ if (fs13.existsSync(executableFile)) return;
63906
64013
  const executableDirMessage = executableDir ? `searched for local subcommand relative to directory '${executableDir}'` : "no directory for search for local subcommand, use .executableDir() to supply a custom directory";
63907
64014
  const executableMissing = `'${executableFile}' does not exist
63908
64015
  - if '${subcommandName}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
@@ -63917,14 +64024,13 @@ Expecting one of '${allowedValues.join("', '")}'`);
63917
64024
  */
63918
64025
  _executeSubCommand(subcommand, args2) {
63919
64026
  args2 = args2.slice();
63920
- let launchWithNode = false;
63921
64027
  const sourceExt = [".js", ".ts", ".tsx", ".mjs", ".cjs"];
63922
64028
  function findFile(baseDir, baseName) {
63923
- const localBin = path19.resolve(baseDir, baseName);
63924
- if (fs14.existsSync(localBin)) return localBin;
63925
- if (sourceExt.includes(path19.extname(baseName))) return void 0;
64029
+ const localBin = path18.resolve(baseDir, baseName);
64030
+ if (fs13.existsSync(localBin)) return localBin;
64031
+ if (sourceExt.includes(path18.extname(baseName))) return void 0;
63926
64032
  const foundExt = sourceExt.find(
63927
- (ext) => fs14.existsSync(`${localBin}${ext}`)
64033
+ (ext) => fs13.existsSync(`${localBin}${ext}`)
63928
64034
  );
63929
64035
  if (foundExt) return `${localBin}${foundExt}`;
63930
64036
  return void 0;
@@ -63936,21 +64042,21 @@ Expecting one of '${allowedValues.join("', '")}'`);
63936
64042
  if (this._scriptPath) {
63937
64043
  let resolvedScriptPath;
63938
64044
  try {
63939
- resolvedScriptPath = fs14.realpathSync(this._scriptPath);
64045
+ resolvedScriptPath = fs13.realpathSync(this._scriptPath);
63940
64046
  } catch {
63941
64047
  resolvedScriptPath = this._scriptPath;
63942
64048
  }
63943
- executableDir = path19.resolve(
63944
- path19.dirname(resolvedScriptPath),
64049
+ executableDir = path18.resolve(
64050
+ path18.dirname(resolvedScriptPath),
63945
64051
  executableDir
63946
64052
  );
63947
64053
  }
63948
64054
  if (executableDir) {
63949
64055
  let localFile = findFile(executableDir, executableFile);
63950
64056
  if (!localFile && !subcommand._executableFile && this._scriptPath) {
63951
- const legacyName = path19.basename(
64057
+ const legacyName = path18.basename(
63952
64058
  this._scriptPath,
63953
- path19.extname(this._scriptPath)
64059
+ path18.extname(this._scriptPath)
63954
64060
  );
63955
64061
  if (legacyName !== this._name) {
63956
64062
  localFile = findFile(
@@ -63961,13 +64067,13 @@ Expecting one of '${allowedValues.join("', '")}'`);
63961
64067
  }
63962
64068
  executableFile = localFile || executableFile;
63963
64069
  }
63964
- launchWithNode = sourceExt.includes(path19.extname(executableFile));
64070
+ const launchWithNode = sourceExt.includes(path18.extname(executableFile));
63965
64071
  let proc;
63966
- if (process11.platform !== "win32") {
64072
+ if (process5.platform !== "win32") {
63967
64073
  if (launchWithNode) {
63968
64074
  args2.unshift(executableFile);
63969
- args2 = incrementNodeInspectorPort(process11.execArgv).concat(args2);
63970
- proc = childProcess.spawn(process11.argv[0], args2, { stdio: "inherit" });
64075
+ args2 = incrementNodeInspectorPort(process5.execArgv).concat(args2);
64076
+ proc = childProcess.spawn(process5.argv[0], args2, { stdio: "inherit" });
63971
64077
  } else {
63972
64078
  proc = childProcess.spawn(executableFile, args2, { stdio: "inherit" });
63973
64079
  }
@@ -63978,13 +64084,13 @@ Expecting one of '${allowedValues.join("', '")}'`);
63978
64084
  subcommand._name
63979
64085
  );
63980
64086
  args2.unshift(executableFile);
63981
- args2 = incrementNodeInspectorPort(process11.execArgv).concat(args2);
63982
- proc = childProcess.spawn(process11.execPath, args2, { stdio: "inherit" });
64087
+ args2 = incrementNodeInspectorPort(process5.execArgv).concat(args2);
64088
+ proc = childProcess.spawn(process5.execPath, args2, { stdio: "inherit" });
63983
64089
  }
63984
64090
  if (!proc.killed) {
63985
64091
  const signals2 = ["SIGUSR1", "SIGUSR2", "SIGTERM", "SIGINT", "SIGHUP"];
63986
64092
  signals2.forEach((signal) => {
63987
- process11.on(signal, () => {
64093
+ process5.on(signal, () => {
63988
64094
  if (proc.killed === false && proc.exitCode === null) {
63989
64095
  proc.kill(signal);
63990
64096
  }
@@ -63995,10 +64101,10 @@ Expecting one of '${allowedValues.join("', '")}'`);
63995
64101
  proc.on("close", (code) => {
63996
64102
  code = code ?? 1;
63997
64103
  if (!exitCallback) {
63998
- process11.exit(code);
64104
+ process5.exit(code);
63999
64105
  } else {
64000
64106
  exitCallback(
64001
- new CommanderError2(
64107
+ new CommanderError(
64002
64108
  code,
64003
64109
  "commander.executeSubCommandAsync",
64004
64110
  "(close)"
@@ -64017,9 +64123,9 @@ Expecting one of '${allowedValues.join("', '")}'`);
64017
64123
  throw new Error(`'${executableFile}' not executable`);
64018
64124
  }
64019
64125
  if (!exitCallback) {
64020
- process11.exit(1);
64126
+ process5.exit(1);
64021
64127
  } else {
64022
- const wrappedError = new CommanderError2(
64128
+ const wrappedError = new CommanderError(
64023
64129
  1,
64024
64130
  "commander.executeSubCommandAsync",
64025
64131
  "(error)"
@@ -64517,13 +64623,13 @@ Expecting one of '${allowedValues.join("', '")}'`);
64517
64623
  */
64518
64624
  _parseOptionsEnv() {
64519
64625
  this.options.forEach((option) => {
64520
- if (option.envVar && option.envVar in process11.env) {
64626
+ if (option.envVar && option.envVar in process5.env) {
64521
64627
  const optionKey = option.attributeName();
64522
64628
  if (this.getOptionValue(optionKey) === void 0 || ["default", "config", "env"].includes(
64523
64629
  this.getOptionValueSource(optionKey)
64524
64630
  )) {
64525
64631
  if (option.required || option.optional) {
64526
- this.emit(`optionEnv:${option.name()}`, process11.env[option.envVar]);
64632
+ this.emit(`optionEnv:${option.name()}`, process5.env[option.envVar]);
64527
64633
  } else {
64528
64634
  this.emit(`optionEnv:${option.name()}`);
64529
64635
  }
@@ -64652,8 +64758,10 @@ Expecting one of '${allowedValues.join("', '")}'`);
64652
64758
  if (this._allowExcessArguments) return;
64653
64759
  const expected = this.registeredArguments.length;
64654
64760
  const s = expected === 1 ? "" : "s";
64761
+ const received = receivedArgs.length;
64655
64762
  const forSubcommand = this.parent ? ` for '${this.name()}'` : "";
64656
- const message = `error: too many arguments${forSubcommand}. Expected ${expected} argument${s} but got ${receivedArgs.length}.`;
64763
+ const details = receivedArgs.join(", ");
64764
+ const message = `error: too many arguments${forSubcommand}. Expected ${expected} argument${s} but got ${received}: ${details}.`;
64657
64765
  this.error(message, { code: "commander.excessArguments" });
64658
64766
  }
64659
64767
  /**
@@ -64865,25 +64973,25 @@ Expecting one of '${allowedValues.join("', '")}'`);
64865
64973
  }
64866
64974
  /**
64867
64975
  * Set the name of the command from script filename, such as process.argv[1],
64868
- * or require.main.filename, or __filename.
64976
+ * or import.meta.filename.
64869
64977
  *
64870
64978
  * (Used internally and public although not documented in README.)
64871
64979
  *
64872
64980
  * @example
64873
- * program.nameFromFilename(require.main.filename);
64981
+ * program.nameFromFilename(import.meta.filename);
64874
64982
  *
64875
64983
  * @param {string} filename
64876
64984
  * @return {Command}
64877
64985
  */
64878
64986
  nameFromFilename(filename) {
64879
- this._name = path19.basename(filename, path19.extname(filename));
64987
+ this._name = path18.basename(filename, path18.extname(filename));
64880
64988
  return this;
64881
64989
  }
64882
64990
  /**
64883
64991
  * Get or set the directory for searching for executable subcommands of this command.
64884
64992
  *
64885
64993
  * @example
64886
- * program.executableDir(__dirname);
64994
+ * program.executableDir(import.meta.dirname);
64887
64995
  * // or
64888
64996
  * program.executableDir('subcommands');
64889
64997
  *
@@ -65047,7 +65155,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
65047
65155
  */
65048
65156
  help(contextOptions) {
65049
65157
  this.outputHelp(contextOptions);
65050
- let exitCode = Number(process11.exitCode ?? 0);
65158
+ let exitCode = Number(process5.exitCode ?? 0);
65051
65159
  if (exitCode === 0 && contextOptions && typeof contextOptions !== "function" && contextOptions.error) {
65052
65160
  exitCode = 1;
65053
65161
  }
@@ -65107,92 +65215,20 @@ Expecting one of '${allowedValues.join("', '")}'`);
65107
65215
  }
65108
65216
  }
65109
65217
  };
65110
- function incrementNodeInspectorPort(args2) {
65111
- return args2.map((arg) => {
65112
- if (!arg.startsWith("--inspect")) {
65113
- return arg;
65114
- }
65115
- let debugOption;
65116
- let debugHost = "127.0.0.1";
65117
- let debugPort = "9229";
65118
- let match;
65119
- if ((match = arg.match(/^(--inspect(-brk)?)$/)) !== null) {
65120
- debugOption = match[1];
65121
- } else if ((match = arg.match(/^(--inspect(-brk|-port)?)=([^:]+)$/)) !== null) {
65122
- debugOption = match[1];
65123
- if (/^\d+$/.test(match[3])) {
65124
- debugPort = match[3];
65125
- } else {
65126
- debugHost = match[3];
65127
- }
65128
- } else if ((match = arg.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/)) !== null) {
65129
- debugOption = match[1];
65130
- debugHost = match[3];
65131
- debugPort = match[4];
65132
- }
65133
- if (debugOption && debugPort !== "0") {
65134
- return `${debugOption}=${debugHost}:${parseInt(debugPort) + 1}`;
65135
- }
65136
- return arg;
65137
- });
65138
- }
65139
- function useColor() {
65140
- if (process11.env.NO_COLOR || process11.env.FORCE_COLOR === "0" || process11.env.FORCE_COLOR === "false")
65141
- return false;
65142
- if (process11.env.FORCE_COLOR || process11.env.CLICOLOR_FORCE !== void 0)
65143
- return true;
65144
- return void 0;
65145
- }
65146
- exports.Command = Command3;
65147
- exports.useColor = useColor;
65148
65218
  }
65149
65219
  });
65150
65220
 
65151
- // node_modules/.pnpm/commander@14.0.3/node_modules/commander/index.js
65152
- var require_commander = __commonJS({
65153
- "node_modules/.pnpm/commander@14.0.3/node_modules/commander/index.js"(exports) {
65221
+ // node_modules/.pnpm/commander@15.0.0/node_modules/commander/index.js
65222
+ var program;
65223
+ var init_commander = __esm({
65224
+ "node_modules/.pnpm/commander@15.0.0/node_modules/commander/index.js"() {
65154
65225
  init_define_WEB_FIRST_SEGMENTS();
65155
- var { Argument: Argument2 } = require_argument();
65156
- var { Command: Command3 } = require_command();
65157
- var { CommanderError: CommanderError2, InvalidArgumentError: InvalidArgumentError2 } = require_error();
65158
- var { Help: Help2 } = require_help();
65159
- var { Option: Option2 } = require_option();
65160
- exports.program = new Command3();
65161
- exports.createCommand = (name) => new Command3(name);
65162
- exports.createOption = (flags, description) => new Option2(flags, description);
65163
- exports.createArgument = (name, description) => new Argument2(name, description);
65164
- exports.Command = Command3;
65165
- exports.Option = Option2;
65166
- exports.Argument = Argument2;
65167
- exports.Help = Help2;
65168
- exports.CommanderError = CommanderError2;
65169
- exports.InvalidArgumentError = InvalidArgumentError2;
65170
- exports.InvalidOptionArgumentError = InvalidArgumentError2;
65171
- }
65172
- });
65173
-
65174
- // node_modules/.pnpm/commander@14.0.3/node_modules/commander/esm.mjs
65175
- var import_index2, program, createCommand, createArgument, createOption, CommanderError, InvalidArgumentError, InvalidOptionArgumentError, Command2, Argument, Option, Help;
65176
- var init_esm3 = __esm({
65177
- "node_modules/.pnpm/commander@14.0.3/node_modules/commander/esm.mjs"() {
65178
- init_define_WEB_FIRST_SEGMENTS();
65179
- import_index2 = __toESM(require_commander(), 1);
65180
- ({
65181
- program,
65182
- createCommand,
65183
- createArgument,
65184
- createOption,
65185
- CommanderError,
65186
- InvalidArgumentError,
65187
- InvalidOptionArgumentError,
65188
- Command: (
65189
- // deprecated old name
65190
- Command2
65191
- ),
65192
- Argument,
65193
- Option,
65194
- Help
65195
- } = import_index2.default);
65226
+ init_argument();
65227
+ init_command();
65228
+ init_error();
65229
+ init_help();
65230
+ init_option();
65231
+ program = new Command2();
65196
65232
  }
65197
65233
  });
65198
65234
 
@@ -65317,12 +65353,12 @@ var init_signals = __esm({
65317
65353
  });
65318
65354
 
65319
65355
  // node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/index.js
65320
- var processOk, kExitEmitter, global, ObjectDefineProperty, Emitter, SignalExitBase, signalExitWrap, SignalExitFallback, SignalExit, process5, onExit, load, unload;
65356
+ var processOk, kExitEmitter, global, ObjectDefineProperty, Emitter, SignalExitBase, signalExitWrap, SignalExitFallback, SignalExit, process6, onExit, load, unload;
65321
65357
  var init_mjs = __esm({
65322
65358
  "node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/index.js"() {
65323
65359
  init_define_WEB_FIRST_SEGMENTS();
65324
65360
  init_signals();
65325
- processOk = (process11) => !!process11 && typeof process11 === "object" && typeof process11.removeListener === "function" && typeof process11.emit === "function" && typeof process11.reallyExit === "function" && typeof process11.listeners === "function" && typeof process11.kill === "function" && typeof process11.pid === "number" && typeof process11.on === "function";
65361
+ processOk = (process12) => !!process12 && typeof process12 === "object" && typeof process12.removeListener === "function" && typeof process12.emit === "function" && typeof process12.reallyExit === "function" && typeof process12.listeners === "function" && typeof process12.kill === "function" && typeof process12.pid === "number" && typeof process12.on === "function";
65326
65362
  kExitEmitter = /* @__PURE__ */ Symbol.for("signal-exit emitter");
65327
65363
  global = globalThis;
65328
65364
  ObjectDefineProperty = Object.defineProperty.bind(Object);
@@ -65407,7 +65443,7 @@ var init_mjs = __esm({
65407
65443
  // "SIGHUP" throws an `ENOSYS` error on Windows,
65408
65444
  // so use a supported signal instead
65409
65445
  /* c8 ignore start */
65410
- #hupSig = process5.platform === "win32" ? "SIGINT" : "SIGHUP";
65446
+ #hupSig = process6.platform === "win32" ? "SIGINT" : "SIGHUP";
65411
65447
  /* c8 ignore stop */
65412
65448
  #emitter = new Emitter();
65413
65449
  #process;
@@ -65415,15 +65451,15 @@ var init_mjs = __esm({
65415
65451
  #originalProcessReallyExit;
65416
65452
  #sigListeners = {};
65417
65453
  #loaded = false;
65418
- constructor(process11) {
65454
+ constructor(process12) {
65419
65455
  super();
65420
- this.#process = process11;
65456
+ this.#process = process12;
65421
65457
  this.#sigListeners = {};
65422
65458
  for (const sig of signals) {
65423
65459
  this.#sigListeners[sig] = () => {
65424
65460
  const listeners = this.#process.listeners(sig);
65425
65461
  let { count } = this.#emitter;
65426
- const p2 = process11;
65462
+ const p2 = process12;
65427
65463
  if (typeof p2.__signal_exit_emitter__ === "object" && typeof p2.__signal_exit_emitter__.count === "number") {
65428
65464
  count += p2.__signal_exit_emitter__.count;
65429
65465
  }
@@ -65432,12 +65468,12 @@ var init_mjs = __esm({
65432
65468
  const ret = this.#emitter.emit("exit", null, sig);
65433
65469
  const s = sig === "SIGHUP" ? this.#hupSig : sig;
65434
65470
  if (!ret)
65435
- process11.kill(process11.pid, s);
65471
+ process12.kill(process12.pid, s);
65436
65472
  }
65437
65473
  };
65438
65474
  }
65439
- this.#originalProcessReallyExit = process11.reallyExit;
65440
- this.#originalProcessEmit = process11.emit;
65475
+ this.#originalProcessReallyExit = process12.reallyExit;
65476
+ this.#originalProcessEmit = process12.emit;
65441
65477
  }
65442
65478
  onExit(cb, opts) {
65443
65479
  if (!processOk(this.#process)) {
@@ -65518,7 +65554,7 @@ var init_mjs = __esm({
65518
65554
  }
65519
65555
  }
65520
65556
  };
65521
- process5 = globalThis.process;
65557
+ process6 = globalThis.process;
65522
65558
  ({
65523
65559
  onExit: (
65524
65560
  /**
@@ -65552,19 +65588,19 @@ var init_mjs = __esm({
65552
65588
  */
65553
65589
  unload
65554
65590
  )
65555
- } = signalExitWrap(processOk(process5) ? new SignalExit(process5) : new SignalExitFallback()));
65591
+ } = signalExitWrap(processOk(process6) ? new SignalExit(process6) : new SignalExitFallback()));
65556
65592
  }
65557
65593
  });
65558
65594
 
65559
65595
  // node_modules/.pnpm/restore-cursor@5.1.0/node_modules/restore-cursor/index.js
65560
- import process6 from "node:process";
65596
+ import process7 from "node:process";
65561
65597
  var terminal, restoreCursor, restore_cursor_default;
65562
65598
  var init_restore_cursor = __esm({
65563
65599
  "node_modules/.pnpm/restore-cursor@5.1.0/node_modules/restore-cursor/index.js"() {
65564
65600
  init_define_WEB_FIRST_SEGMENTS();
65565
65601
  init_onetime();
65566
65602
  init_mjs();
65567
- terminal = process6.stderr.isTTY ? process6.stderr : process6.stdout.isTTY ? process6.stdout : void 0;
65603
+ terminal = process7.stderr.isTTY ? process7.stderr : process7.stdout.isTTY ? process7.stdout : void 0;
65568
65604
  restoreCursor = terminal ? onetime_default(() => {
65569
65605
  onExit(() => {
65570
65606
  terminal.write("\x1B[?25h");
@@ -65576,7 +65612,7 @@ var init_restore_cursor = __esm({
65576
65612
  });
65577
65613
 
65578
65614
  // node_modules/.pnpm/cli-cursor@5.0.0/node_modules/cli-cursor/index.js
65579
- import process7 from "node:process";
65615
+ import process8 from "node:process";
65580
65616
  var isHidden, cliCursor, cli_cursor_default;
65581
65617
  var init_cli_cursor = __esm({
65582
65618
  "node_modules/.pnpm/cli-cursor@5.0.0/node_modules/cli-cursor/index.js"() {
@@ -65584,14 +65620,14 @@ var init_cli_cursor = __esm({
65584
65620
  init_restore_cursor();
65585
65621
  isHidden = false;
65586
65622
  cliCursor = {};
65587
- cliCursor.show = (writableStream = process7.stderr) => {
65623
+ cliCursor.show = (writableStream = process8.stderr) => {
65588
65624
  if (!writableStream.isTTY) {
65589
65625
  return;
65590
65626
  }
65591
65627
  isHidden = false;
65592
65628
  writableStream.write("\x1B[?25h");
65593
65629
  };
65594
- cliCursor.hide = (writableStream = process7.stderr) => {
65630
+ cliCursor.hide = (writableStream = process8.stderr) => {
65595
65631
  if (!writableStream.isTTY) {
65596
65632
  return;
65597
65633
  }
@@ -67414,11 +67450,11 @@ var init_yoctocolors = __esm({
67414
67450
  });
67415
67451
 
67416
67452
  // node_modules/.pnpm/is-unicode-supported@2.1.0/node_modules/is-unicode-supported/index.js
67417
- import process8 from "node:process";
67453
+ import process9 from "node:process";
67418
67454
  function isUnicodeSupported() {
67419
- const { env: env2 } = process8;
67455
+ const { env: env2 } = process9;
67420
67456
  const { TERM, TERM_PROGRAM } = env2;
67421
- if (process8.platform !== "win32") {
67457
+ if (process9.platform !== "win32") {
67422
67458
  return TERM !== "linux";
67423
67459
  }
67424
67460
  return Boolean(env2.WT_SESSION) || Boolean(env2.TERMINUS_SUBLIME) || env2.ConEmuTask === "{cmd::Cmder}" || TERM_PROGRAM === "Terminus-Sublime" || TERM_PROGRAM === "vscode" || TERM === "xterm-256color" || TERM === "alacritty" || TERM === "rxvt-unicode" || TERM === "rxvt-unicode-256color" || env2.TERMINAL_EMULATOR === "JetBrains-JediTerm";
@@ -67748,7 +67784,7 @@ var init_is_interactive = __esm({
67748
67784
  });
67749
67785
 
67750
67786
  // node_modules/.pnpm/stdin-discarder@0.3.2/node_modules/stdin-discarder/index.js
67751
- import process9 from "node:process";
67787
+ import process10 from "node:process";
67752
67788
  var ASCII_ETX_CODE, StdinDiscarder, stdinDiscarder, stdin_discarder_default;
67753
67789
  var init_stdin_discarder = __esm({
67754
67790
  "node_modules/.pnpm/stdin-discarder@0.3.2/node_modules/stdin-discarder/index.js"() {
@@ -67765,7 +67801,7 @@ var init_stdin_discarder = __esm({
67765
67801
  }
67766
67802
  const code = typeof chunk === "string" ? chunk.codePointAt(0) : chunk[0];
67767
67803
  if (code === ASCII_ETX_CODE) {
67768
- process9.kill(process9.pid, "SIGINT");
67804
+ process10.kill(process10.pid, "SIGINT");
67769
67805
  }
67770
67806
  };
67771
67807
  start() {
@@ -67783,8 +67819,8 @@ var init_stdin_discarder = __esm({
67783
67819
  }
67784
67820
  }
67785
67821
  #realStart() {
67786
- const { stdin } = process9;
67787
- if (process9.platform === "win32" || !stdin?.isTTY || typeof stdin.setRawMode !== "function") {
67822
+ const { stdin } = process10;
67823
+ if (process10.platform === "win32" || !stdin?.isTTY || typeof stdin.setRawMode !== "function") {
67788
67824
  this.#stdin = void 0;
67789
67825
  return;
67790
67826
  }
@@ -67820,8 +67856,8 @@ var init_stdin_discarder = __esm({
67820
67856
  });
67821
67857
 
67822
67858
  // node_modules/.pnpm/ora@9.4.0/node_modules/ora/index.js
67823
- import process10 from "node:process";
67824
- import { stripVTControlCharacters } from "node:util";
67859
+ import process11 from "node:process";
67860
+ import { stripVTControlCharacters as stripVTControlCharacters3 } from "node:util";
67825
67861
  function ora(options) {
67826
67862
  return new Ora(options);
67827
67863
  }
@@ -67927,7 +67963,7 @@ var init_ora = __esm({
67927
67963
  }
67928
67964
  this.#options = {
67929
67965
  color: "cyan",
67930
- stream: process10.stderr,
67966
+ stream: process11.stderr,
67931
67967
  discardStdin: true,
67932
67968
  hideCursor: true,
67933
67969
  ...options
@@ -67950,7 +67986,7 @@ var init_ora = __esm({
67950
67986
  this.prefixText = this.#options.prefixText;
67951
67987
  this.suffixText = this.#options.suffixText;
67952
67988
  this.indent = this.#options.indent;
67953
- if (process10.env.NODE_ENV === "test") {
67989
+ if (process11.env.NODE_ENV === "test") {
67954
67990
  this._stream = this.#stream;
67955
67991
  this._isEnabled = this.#options.isEnabled;
67956
67992
  Object.defineProperty(this, "_linesToClear", {
@@ -68052,7 +68088,7 @@ var init_ora = __esm({
68052
68088
  }
68053
68089
  #computeLineCountFrom(text, columns) {
68054
68090
  let count = 0;
68055
- for (const line of stripVTControlCharacters(text).split("\n")) {
68091
+ for (const line of stripVTControlCharacters3(text).split("\n")) {
68056
68092
  count += Math.max(1, Math.ceil(stringWidth(line) / columns));
68057
68093
  }
68058
68094
  return count;
@@ -68140,7 +68176,7 @@ var init_ora = __esm({
68140
68176
  if (!this.isEnabled || this.#hookedStreams.size > 0) {
68141
68177
  return;
68142
68178
  }
68143
- const streamsToHook = /* @__PURE__ */ new Set([this.#stream, process10.stdout, process10.stderr]);
68179
+ const streamsToHook = /* @__PURE__ */ new Set([this.#stream, process11.stdout, process11.stderr]);
68144
68180
  for (const stream of streamsToHook) {
68145
68181
  this.#hookStream(stream);
68146
68182
  }
@@ -68235,7 +68271,7 @@ var init_ora = __esm({
68235
68271
  if (this.#options.hideCursor) {
68236
68272
  cli_cursor_default.hide(this.#stream);
68237
68273
  }
68238
- if (this.#options.discardStdin && process10.stdin.isTTY) {
68274
+ if (this.#options.discardStdin && process11.stdin.isTTY) {
68239
68275
  stdin_discarder_default.start();
68240
68276
  this.#isDiscardingStdin = true;
68241
68277
  }
@@ -68765,8 +68801,8 @@ __export(cli_exports, {
68765
68801
  promptYesNo: () => promptYesNo,
68766
68802
  runCli: () => runCli
68767
68803
  });
68768
- import * as fs13 from "node:fs";
68769
- import * as path18 from "node:path";
68804
+ import * as fs14 from "node:fs";
68805
+ import * as path19 from "node:path";
68770
68806
  function validateCheckNames(names, source) {
68771
68807
  const invalid = names.filter((n7) => n7 && !VALID_CHECKS.has(n7));
68772
68808
  if (invalid.length > 0) {
@@ -68789,7 +68825,7 @@ async function runCli() {
68789
68825
  "Also scan the user-global ~/.claude/settings.json in the dead-hook check (off by default; the standard run only reads project .claude/settings.json[.local])",
68790
68826
  false
68791
68827
  ).option("--no-ignore-file", "Disable .ctxlintignore suppression (see all findings)").option("--watch", "Re-lint on context file changes", false).action(async (projectPath, opts) => {
68792
- const resolvedPath = path18.resolve(projectPath);
68828
+ const resolvedPath = path19.resolve(projectPath);
68793
68829
  const { config: config2, options, activeChecks } = resolveSession(resolvedPath, opts);
68794
68830
  const spinner = options.format === "text" && !options.quiet ? ora("Scanning for context files...").start() : void 0;
68795
68831
  try {
@@ -68920,41 +68956,41 @@ Fixed ${applied.totalFixes} issue${applied.totalFixes !== 1 ? "s" : ""} in ${app
68920
68956
  const chalk2 = (await Promise.resolve().then(() => (init_source(), source_exports))).default;
68921
68957
  console.log(chalk2.dim("\nWatching for changes... (Ctrl+C to stop)\n"));
68922
68958
  const watchPaths = [
68923
- path18.join(resolvedPath, "CLAUDE.md"),
68924
- path18.join(resolvedPath, "CLAUDE.local.md"),
68925
- path18.join(resolvedPath, "AGENTS.md"),
68926
- path18.join(resolvedPath, "AGENT.md"),
68927
- path18.join(resolvedPath, ".cursorrules"),
68928
- path18.join(resolvedPath, ".windsurfrules"),
68929
- path18.join(resolvedPath, ".clinerules"),
68930
- path18.join(resolvedPath, ".aiderules"),
68931
- path18.join(resolvedPath, ".continuerules"),
68932
- path18.join(resolvedPath, ".rules"),
68933
- path18.join(resolvedPath, ".goosehints"),
68934
- path18.join(resolvedPath, "GEMINI.md"),
68935
- path18.join(resolvedPath, "replit.md"),
68936
- path18.join(resolvedPath, "package.json"),
68937
- path18.join(resolvedPath, ".mcp.json"),
68959
+ path19.join(resolvedPath, "CLAUDE.md"),
68960
+ path19.join(resolvedPath, "CLAUDE.local.md"),
68961
+ path19.join(resolvedPath, "AGENTS.md"),
68962
+ path19.join(resolvedPath, "AGENT.md"),
68963
+ path19.join(resolvedPath, ".cursorrules"),
68964
+ path19.join(resolvedPath, ".windsurfrules"),
68965
+ path19.join(resolvedPath, ".clinerules"),
68966
+ path19.join(resolvedPath, ".aiderules"),
68967
+ path19.join(resolvedPath, ".continuerules"),
68968
+ path19.join(resolvedPath, ".rules"),
68969
+ path19.join(resolvedPath, ".goosehints"),
68970
+ path19.join(resolvedPath, "GEMINI.md"),
68971
+ path19.join(resolvedPath, "replit.md"),
68972
+ path19.join(resolvedPath, "package.json"),
68973
+ path19.join(resolvedPath, ".mcp.json"),
68938
68974
  // ctxlint config — re-resolve on edit so threshold changes,
68939
68975
  // ignore-list edits, and check-list overrides take effect without
68940
68976
  // restarting the watcher.
68941
- path18.join(resolvedPath, ".ctxlintrc"),
68942
- path18.join(resolvedPath, ".ctxlintrc.json"),
68977
+ path19.join(resolvedPath, ".ctxlintrc"),
68978
+ path19.join(resolvedPath, ".ctxlintrc.json"),
68943
68979
  // .ctxlintignore — re-lint when suppression rules change.
68944
- path18.join(resolvedPath, ".ctxlintignore")
68980
+ path19.join(resolvedPath, ".ctxlintignore")
68945
68981
  ];
68946
68982
  const watchDirs = [
68947
- path18.join(resolvedPath, ".claude"),
68948
- path18.join(resolvedPath, ".cursor"),
68949
- path18.join(resolvedPath, ".github"),
68950
- path18.join(resolvedPath, ".windsurf"),
68951
- path18.join(resolvedPath, ".aide"),
68952
- path18.join(resolvedPath, ".amazonq"),
68953
- path18.join(resolvedPath, ".goose"),
68954
- path18.join(resolvedPath, ".junie"),
68955
- path18.join(resolvedPath, ".aiassistant"),
68956
- path18.join(resolvedPath, ".continue"),
68957
- path18.join(resolvedPath, ".vscode")
68983
+ path19.join(resolvedPath, ".claude"),
68984
+ path19.join(resolvedPath, ".cursor"),
68985
+ path19.join(resolvedPath, ".github"),
68986
+ path19.join(resolvedPath, ".windsurf"),
68987
+ path19.join(resolvedPath, ".aide"),
68988
+ path19.join(resolvedPath, ".amazonq"),
68989
+ path19.join(resolvedPath, ".goose"),
68990
+ path19.join(resolvedPath, ".junie"),
68991
+ path19.join(resolvedPath, ".aiassistant"),
68992
+ path19.join(resolvedPath, ".continue"),
68993
+ path19.join(resolvedPath, ".vscode")
68958
68994
  ];
68959
68995
  const watchers = [];
68960
68996
  let debounceTimer = null;
@@ -69016,13 +69052,13 @@ Fixed ${applied.totalFixes} issue${applied.totalFixes !== 1 ? "s" : ""} in ${app
69016
69052
  };
69017
69053
  for (const filePath of watchPaths) {
69018
69054
  try {
69019
- watchers.push(fs13.watch(filePath, rerun));
69055
+ watchers.push(fs14.watch(filePath, rerun));
69020
69056
  } catch {
69021
69057
  }
69022
69058
  }
69023
69059
  for (const dir of watchDirs) {
69024
69060
  try {
69025
- watchers.push(fs13.watch(dir, { recursive: true }, rerun));
69061
+ watchers.push(fs14.watch(dir, { recursive: true }, rerun));
69026
69062
  } catch {
69027
69063
  }
69028
69064
  }
@@ -69043,17 +69079,17 @@ Fixed ${applied.totalFixes} issue${applied.totalFixes !== 1 ? "s" : ""} in ${app
69043
69079
  }
69044
69080
  });
69045
69081
  program2.command("init").description("Set up a git pre-commit hook that runs ctxlint --strict").argument("[path]", "Project directory", ".").action(async (projectPath) => {
69046
- const resolvedRoot = path18.resolve(projectPath);
69047
- const gitDir = path18.join(resolvedRoot, ".git");
69048
- const hooksDir = path18.join(gitDir, "hooks");
69049
- if (!fs13.existsSync(gitDir)) {
69082
+ const resolvedRoot = path19.resolve(projectPath);
69083
+ const gitDir = path19.join(resolvedRoot, ".git");
69084
+ const hooksDir = path19.join(gitDir, "hooks");
69085
+ if (!fs14.existsSync(gitDir)) {
69050
69086
  console.error('Error: not a git repository. Run "git init" first.');
69051
69087
  process.exit(1);
69052
69088
  }
69053
- if (!fs13.existsSync(hooksDir)) {
69054
- fs13.mkdirSync(hooksDir, { recursive: true });
69089
+ if (!fs14.existsSync(hooksDir)) {
69090
+ fs14.mkdirSync(hooksDir, { recursive: true });
69055
69091
  }
69056
- const hookPath = path18.join(hooksDir, "pre-commit");
69092
+ const hookPath = path19.join(hooksDir, "pre-commit");
69057
69093
  const fullHookContent = `#!/bin/sh
69058
69094
  # ctxlint pre-commit hook
69059
69095
  npx @yawlabs/ctxlint@${VERSION} --strict
@@ -69062,15 +69098,15 @@ npx @yawlabs/ctxlint@${VERSION} --strict
69062
69098
  # ctxlint pre-commit hook
69063
69099
  npx @yawlabs/ctxlint@${VERSION} --strict
69064
69100
  `;
69065
- if (fs13.existsSync(hookPath)) {
69066
- const existing = fs13.readFileSync(hookPath, "utf-8");
69101
+ if (fs14.existsSync(hookPath)) {
69102
+ const existing = fs14.readFileSync(hookPath, "utf-8");
69067
69103
  const installed = existing.match(
69068
69104
  /^[^#\r\n]*\bnpx\s+(?:-y\s+|--yes\s+)?@yawlabs\/ctxlint(?:@(\d+\.\d+\.\d+))?/m
69069
69105
  );
69070
69106
  if (installed) {
69071
69107
  const pinned = installed[1];
69072
69108
  if (pinned && pinned !== VERSION) {
69073
- fs13.writeFileSync(
69109
+ fs14.writeFileSync(
69074
69110
  hookPath,
69075
69111
  existing.replace(/(@yawlabs\/ctxlint@)\d+\.\d+\.\d+/g, `$1${VERSION}`)
69076
69112
  );
@@ -69080,10 +69116,10 @@ npx @yawlabs/ctxlint@${VERSION} --strict
69080
69116
  }
69081
69117
  return;
69082
69118
  }
69083
- fs13.appendFileSync(hookPath, appendHookContent);
69119
+ fs14.appendFileSync(hookPath, appendHookContent);
69084
69120
  console.log("Added ctxlint to existing pre-commit hook.");
69085
69121
  } else {
69086
- fs13.writeFileSync(hookPath, fullHookContent, { mode: 493 });
69122
+ fs14.writeFileSync(hookPath, fullHookContent, { mode: 493 });
69087
69123
  console.log("Created pre-commit hook at .git/hooks/pre-commit");
69088
69124
  }
69089
69125
  console.log("ctxlint will now run automatically before each commit.");
@@ -69105,7 +69141,7 @@ function resolveDepth(raw) {
69105
69141
  return Number.isNaN(parsed) ? 2 : Math.max(0, Math.min(parsed, 10));
69106
69142
  }
69107
69143
  function resolveSession(resolvedPath, opts, throwOnConfigError = false) {
69108
- const configPath = opts.config ? path18.resolve(opts.config) : void 0;
69144
+ const configPath = opts.config ? path19.resolve(opts.config) : void 0;
69109
69145
  const config2 = configPath ? loadConfigFromPath(configPath, throwOnConfigError) : loadConfig(resolvedPath);
69110
69146
  const mcpGlobal = opts.mcpGlobal || config2?.mcpGlobal || false;
69111
69147
  const mcpOnly = opts.mcpOnly || config2?.mcpOnly || false;
@@ -69189,7 +69225,7 @@ var init_cli = __esm({
69189
69225
  "src/cli.ts"() {
69190
69226
  "use strict";
69191
69227
  init_define_WEB_FIRST_SEGMENTS();
69192
- init_esm3();
69228
+ init_commander();
69193
69229
  init_ora();
69194
69230
  init_paths();
69195
69231
  init_cache();