@yawlabs/ctxlint 0.18.0 → 0.18.2

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,7 @@ function extractPathReferences(lines, sections) {
13769
13767
  cleanValue = cleanValue.slice(0, -1);
13770
13768
  }
13771
13769
  if (!cleanValue.includes("/")) continue;
13770
+ if (/(^|\/)\.git\//.test(cleanValue) || /\.app\//.test(cleanValue)) continue;
13772
13771
  const column = match.index + match[0].length - match[1].length + 1;
13773
13772
  paths.push({
13774
13773
  value: cleanValue,
@@ -14688,10 +14687,10 @@ var require_src2 = __commonJS({
14688
14687
  var fs_1 = __require("fs");
14689
14688
  var debug_1 = __importDefault(require_src());
14690
14689
  var log = debug_1.default("@kwsites/file-exists");
14691
- function check2(path19, isFile, isDirectory2) {
14692
- log(`checking %s`, path19);
14690
+ function check2(path20, isFile, isDirectory2) {
14691
+ log(`checking %s`, path20);
14693
14692
  try {
14694
- const stat3 = fs_1.statSync(path19);
14693
+ const stat3 = fs_1.statSync(path20);
14695
14694
  if (stat3.isFile() && isFile) {
14696
14695
  log(`[OK] path represents a file`);
14697
14696
  return true;
@@ -14711,8 +14710,8 @@ var require_src2 = __commonJS({
14711
14710
  throw e;
14712
14711
  }
14713
14712
  }
14714
- function exists2(path19, type = exports.READABLE) {
14715
- return check2(path19, (type & exports.FILE) > 0, (type & exports.FOLDER) > 0);
14713
+ function exists2(path20, type = exports.READABLE) {
14714
+ return check2(path20, (type & exports.FILE) > 0, (type & exports.FOLDER) > 0);
14716
14715
  }
14717
14716
  exports.exists = exists2;
14718
14717
  exports.FILE = 1;
@@ -15310,8 +15309,8 @@ function toLinesWithContent(input = "", trimmed2 = true, separator = "\n") {
15310
15309
  function forEachLineWithContent(input, callback) {
15311
15310
  return toLinesWithContent(input, true).map((line) => callback(line));
15312
15311
  }
15313
- function folderExists(path19) {
15314
- return (0, import_file_exists.exists)(path19, import_file_exists.FOLDER);
15312
+ function folderExists(path20) {
15313
+ return (0, import_file_exists.exists)(path20, import_file_exists.FOLDER);
15315
15314
  }
15316
15315
  function append(target, item) {
15317
15316
  if (Array.isArray(target)) {
@@ -15502,8 +15501,8 @@ function checkIsRepoRootTask() {
15502
15501
  commands,
15503
15502
  format: "utf-8",
15504
15503
  onError,
15505
- parser(path19) {
15506
- return /^\.(git)?$/.test(path19.trim());
15504
+ parser(path20) {
15505
+ return /^\.(git)?$/.test(path20.trim());
15507
15506
  }
15508
15507
  };
15509
15508
  }
@@ -15759,11 +15758,11 @@ function parseGrep(grep) {
15759
15758
  const paths = /* @__PURE__ */ new Set();
15760
15759
  const results = {};
15761
15760
  forEachLineWithContent(grep, (input) => {
15762
- const [path19, line, preview] = input.split(NULL);
15763
- paths.add(path19);
15764
- (results[path19] = results[path19] || []).push({
15761
+ const [path20, line, preview] = input.split(NULL);
15762
+ paths.add(path20);
15763
+ (results[path20] = results[path20] || []).push({
15765
15764
  line: asNumber(line),
15766
- path: path19,
15765
+ path: path20,
15767
15766
  preview
15768
15767
  });
15769
15768
  });
@@ -16060,14 +16059,14 @@ function hashObjectTask(filePath, write) {
16060
16059
  }
16061
16060
  return straightThroughStringTask(commands, true);
16062
16061
  }
16063
- function parseInit(bare, path19, text) {
16062
+ function parseInit(bare, path20, text) {
16064
16063
  const response = String(text).trim();
16065
16064
  let result;
16066
16065
  if (result = initResponseRegex.exec(response)) {
16067
- return new InitSummary(bare, path19, false, result[1]);
16066
+ return new InitSummary(bare, path20, false, result[1]);
16068
16067
  }
16069
16068
  if (result = reInitResponseRegex.exec(response)) {
16070
- return new InitSummary(bare, path19, true, result[1]);
16069
+ return new InitSummary(bare, path20, true, result[1]);
16071
16070
  }
16072
16071
  let gitDir = "";
16073
16072
  const tokens = response.split(" ");
@@ -16078,12 +16077,12 @@ function parseInit(bare, path19, text) {
16078
16077
  break;
16079
16078
  }
16080
16079
  }
16081
- return new InitSummary(bare, path19, /^re/i.test(response), gitDir);
16080
+ return new InitSummary(bare, path20, /^re/i.test(response), gitDir);
16082
16081
  }
16083
16082
  function hasBareCommand(command) {
16084
16083
  return command.includes(bareCommand);
16085
16084
  }
16086
- function initTask(bare = false, path19, customArgs) {
16085
+ function initTask(bare = false, path20, customArgs) {
16087
16086
  const commands = ["init", ...customArgs];
16088
16087
  if (bare && !hasBareCommand(commands)) {
16089
16088
  commands.splice(1, 0, bareCommand);
@@ -16092,7 +16091,7 @@ function initTask(bare = false, path19, customArgs) {
16092
16091
  commands,
16093
16092
  format: "utf-8",
16094
16093
  parser(text) {
16095
- return parseInit(commands.includes("--bare"), path19, text);
16094
+ return parseInit(commands.includes("--bare"), path20, text);
16096
16095
  }
16097
16096
  };
16098
16097
  }
@@ -16371,14 +16370,14 @@ function splitLine(result, lineStr) {
16371
16370
  default:
16372
16371
  return;
16373
16372
  }
16374
- function data(index, workingDir, path19) {
16373
+ function data(index, workingDir, path20) {
16375
16374
  const raw = `${index}${workingDir}`;
16376
16375
  const handler = parsers6.get(raw);
16377
16376
  if (handler) {
16378
- handler(result, path19);
16377
+ handler(result, path20);
16379
16378
  }
16380
16379
  if (raw !== "##" && raw !== "!!") {
16381
- result.files.push(new FileStatusSummary(path19, index, workingDir));
16380
+ result.files.push(new FileStatusSummary(path20, index, workingDir));
16382
16381
  }
16383
16382
  }
16384
16383
  }
@@ -16565,8 +16564,8 @@ function deleteBranchTask(branch, forceDelete = false) {
16565
16564
  return task;
16566
16565
  }
16567
16566
  function toPath(input) {
16568
- const path19 = input.trim().replace(/^["']|["']$/g, "");
16569
- return path19 && normalize2(path19);
16567
+ const path20 = input.trim().replace(/^["']|["']$/g, "");
16568
+ return path20 && normalize2(path20);
16570
16569
  }
16571
16570
  function checkIgnoreTask(paths) {
16572
16571
  return {
@@ -16705,8 +16704,8 @@ function stashListTask(opt = {}, customArgs) {
16705
16704
  parser: parser4
16706
16705
  };
16707
16706
  }
16708
- function addSubModuleTask(repo, path19) {
16709
- return subModuleTask(["add", repo, path19]);
16707
+ function addSubModuleTask(repo, path20) {
16708
+ return subModuleTask(["add", repo, path20]);
16710
16709
  }
16711
16710
  function initSubModuleTask(customArgs) {
16712
16711
  return subModuleTask(["init", ...customArgs]);
@@ -17969,9 +17968,9 @@ var init_esm = __esm({
17969
17968
  "src/lib/responses/InitSummary.ts"() {
17970
17969
  "use strict";
17971
17970
  InitSummary = class {
17972
- constructor(bare, path19, existing, gitDir) {
17971
+ constructor(bare, path20, existing, gitDir) {
17973
17972
  this.bare = bare;
17974
- this.path = path19;
17973
+ this.path = path20;
17975
17974
  this.existing = existing;
17976
17975
  this.gitDir = gitDir;
17977
17976
  }
@@ -18504,12 +18503,12 @@ var init_esm = __esm({
18504
18503
  "use strict";
18505
18504
  fromPathRegex = /^(.+)\0(.+)$/;
18506
18505
  FileStatusSummary = class {
18507
- constructor(path19, index, working_dir) {
18508
- this.path = path19;
18506
+ constructor(path20, index, working_dir) {
18507
+ this.path = path20;
18509
18508
  this.index = index;
18510
18509
  this.working_dir = working_dir;
18511
18510
  if (index === "R" || working_dir === "R") {
18512
- const detail = fromPathRegex.exec(path19) || [null, path19, path19];
18511
+ const detail = fromPathRegex.exec(path20) || [null, path20, path20];
18513
18512
  this.from = detail[2] || "";
18514
18513
  this.path = detail[1] || "";
18515
18514
  }
@@ -18771,9 +18770,9 @@ var init_esm = __esm({
18771
18770
  next
18772
18771
  );
18773
18772
  }
18774
- hashObject(path19, write) {
18773
+ hashObject(path20, write) {
18775
18774
  return this._runTask(
18776
- hashObjectTask(path19, write === true),
18775
+ hashObjectTask(path20, write === true),
18777
18776
  trailingFunctionArgument(arguments)
18778
18777
  );
18779
18778
  }
@@ -19410,8 +19409,8 @@ var init_esm = __esm({
19410
19409
  }
19411
19410
  return this._runTask(straightThroughStringTask2(command, this._trimmed), next);
19412
19411
  };
19413
- Git2.prototype.submoduleAdd = function(repo, path19, then) {
19414
- return this._runTask(addSubModuleTask2(repo, path19), trailingFunctionArgument2(arguments));
19412
+ Git2.prototype.submoduleAdd = function(repo, path20, then) {
19413
+ return this._runTask(addSubModuleTask2(repo, path20), trailingFunctionArgument2(arguments));
19415
19414
  };
19416
19415
  Git2.prototype.submoduleUpdate = function(args2, then) {
19417
19416
  return this._runTask(
@@ -19670,6 +19669,18 @@ function normalizePath(p2, projectRoot) {
19670
19669
  const normalized = path3.posix.normalize(cleaned);
19671
19670
  return process.platform === "win32" ? normalized.toLowerCase() : normalized;
19672
19671
  }
19672
+ function toGitPathspec(p2, projectRoot) {
19673
+ if (p2.includes("*")) return null;
19674
+ let cleaned = p2.replace(/\\/g, "/");
19675
+ if (path3.isAbsolute(p2)) {
19676
+ const rel = path3.relative(projectRoot, p2).replace(/\\/g, "/");
19677
+ if (!rel || rel.startsWith("..")) return null;
19678
+ cleaned = rel;
19679
+ }
19680
+ const normalized = path3.posix.normalize(cleaned);
19681
+ if (normalized === ".." || normalized.startsWith("../")) return null;
19682
+ return process.platform === "win32" ? `:(icase)${normalized}` : normalized;
19683
+ }
19673
19684
  function getGit(projectRoot) {
19674
19685
  if (!gitInstance || gitProjectRoot !== projectRoot) {
19675
19686
  gitInstance = esm_default(projectRoot);
@@ -19716,7 +19727,12 @@ async function getCommitsSinceBatch(projectRoot, paths, since) {
19716
19727
  try {
19717
19728
  const git = getGit(projectRoot);
19718
19729
  const SENTINEL = "___CTXLINT_COMMIT___";
19719
- const raw = await git.raw([
19730
+ const pathspecs = [];
19731
+ for (const p2 of paths) {
19732
+ const spec = toGitPathspec(p2, projectRoot);
19733
+ if (spec) pathspecs.push(spec);
19734
+ }
19735
+ const logArgs = [
19720
19736
  // Git's default core.quotePath=true wraps non-ASCII paths in quotes
19721
19737
  // with octal escapes ("src/f\303\266\303\266.txt"); nothing below
19722
19738
  // unquotes, so the leading `"` would break both the exact and the
@@ -19730,7 +19746,11 @@ async function getCommitsSinceBatch(projectRoot, paths, since) {
19730
19746
  // what keeps git from rejecting the sentinel as an invalid --pretty
19731
19747
  // format ("fatal: invalid --pretty format: ___CTXLINT_COMMIT___").
19732
19748
  `--format=%n${SENTINEL}`
19733
- ]);
19749
+ ];
19750
+ if (pathspecs.length > 0) {
19751
+ logArgs.push("--", ...pathspecs);
19752
+ }
19753
+ const raw = await git.raw(logArgs);
19734
19754
  const requested = new Set(counts.keys());
19735
19755
  const lines = raw.split("\n");
19736
19756
  let inCommit = false;
@@ -20422,22 +20442,59 @@ function getProjectFiles(projectRoot) {
20422
20442
  cachedProjectFiles = { root: projectRoot, files };
20423
20443
  return files;
20424
20444
  }
20445
+ function getBasenameIndex(projectRoot, files) {
20446
+ if (cachedBasenameIndex?.root === projectRoot) return cachedBasenameIndex.index;
20447
+ const index = /* @__PURE__ */ new Map();
20448
+ for (const file2 of files) {
20449
+ const norm = file2.replace(/\\/g, "/");
20450
+ const base = path4.basename(norm);
20451
+ const list = index.get(base);
20452
+ if (list) list.push(norm);
20453
+ else index.set(base, [norm]);
20454
+ }
20455
+ cachedBasenameIndex = { root: projectRoot, index };
20456
+ return index;
20457
+ }
20425
20458
  function resetPathsCache() {
20426
20459
  cachedProjectFiles = null;
20460
+ cachedBasenameIndex = null;
20427
20461
  resetRenameCache();
20428
20462
  }
20429
20463
  async function checkPaths(file2, projectRoot) {
20430
20464
  const issues = [];
20431
20465
  const projectFiles = getProjectFiles(projectRoot);
20466
+ const basenameIndex = getBasenameIndex(projectRoot, projectFiles);
20432
20467
  const contextDir = path4.dirname(file2.filePath);
20433
20468
  const pending = [];
20434
20469
  for (const ref of file2.references.paths) {
20435
- const normalizedRef = ref.value.replace(/\\/g, "/");
20436
- const baseDir = /^\.\.?\//.test(normalizedRef) ? contextDir : projectRoot;
20437
- const resolvedPath = path4.resolve(baseDir, normalizedRef);
20470
+ const rawNormalized = ref.value.replace(/\\/g, "/");
20471
+ const isImport = rawNormalized.startsWith("@");
20472
+ const normalizedRef = isImport ? rawNormalized.slice(1) : rawNormalized;
20473
+ if (isImport && normalizedRef.startsWith("~/")) continue;
20474
+ if (isImport && /^[\w.-]+\/[\w.-]+$/.test(normalizedRef) && !/\.\w+$/.test(normalizedRef)) {
20475
+ continue;
20476
+ }
20477
+ const explicitRel = /^\.\.?\//.test(normalizedRef);
20478
+ const baseDirs = explicitRel || isImport ? [contextDir] : [projectRoot, contextDir];
20479
+ const primaryBase = baseDirs[0];
20438
20480
  if (normalizedRef.includes("*")) {
20439
- const iter = path4.isAbsolute(normalizedRef) ? es(normalizedRef, { absolute: true, nodir: false, ignore: GLOB_IGNORE }) : es(normalizedRef, { cwd: baseDir, nodir: false, ignore: GLOB_IGNORE });
20440
- const hasMatch = !(await iter.next()).done;
20481
+ let hasMatch = false;
20482
+ if (path4.isAbsolute(normalizedRef)) {
20483
+ const iter = es(normalizedRef, {
20484
+ absolute: true,
20485
+ nodir: false,
20486
+ ignore: GLOB_IGNORE
20487
+ });
20488
+ hasMatch = !(await iter.next()).done;
20489
+ } else {
20490
+ for (const b2 of baseDirs) {
20491
+ const iter = es(normalizedRef, { cwd: b2, nodir: false, ignore: GLOB_IGNORE });
20492
+ if (!(await iter.next()).done) {
20493
+ hasMatch = true;
20494
+ break;
20495
+ }
20496
+ }
20497
+ }
20441
20498
  if (!hasMatch) {
20442
20499
  issues.push({
20443
20500
  severity: "error",
@@ -20452,8 +20509,7 @@ async function checkPaths(file2, projectRoot) {
20452
20509
  }
20453
20510
  const isDir = normalizedRef.endsWith("/");
20454
20511
  if (isDir) {
20455
- const dirPath = path4.resolve(baseDir, normalizedRef);
20456
- if (!isDirectory(dirPath)) {
20512
+ if (!baseDirs.some((b2) => isDirectory(path4.resolve(b2, normalizedRef)))) {
20457
20513
  issues.push({
20458
20514
  severity: "error",
20459
20515
  check: "paths",
@@ -20464,18 +20520,25 @@ async function checkPaths(file2, projectRoot) {
20464
20520
  }
20465
20521
  continue;
20466
20522
  }
20467
- if (fileExists(resolvedPath) || isDirectory(resolvedPath)) {
20523
+ const resolvedCandidates = baseDirs.map((b2) => path4.resolve(b2, normalizedRef));
20524
+ if (resolvedCandidates.some((p2) => fileExists(p2) || isDirectory(p2))) {
20468
20525
  continue;
20469
20526
  }
20527
+ const insideRoot = resolvedCandidates.some((p2) => {
20528
+ const rel = path4.relative(projectRoot, p2);
20529
+ return rel === "" || !rel.startsWith("..") && !path4.isAbsolute(rel);
20530
+ });
20531
+ if (!insideRoot) continue;
20532
+ const resolvedPath = path4.resolve(primaryBase, normalizedRef);
20470
20533
  const relTarget = path4.relative(projectRoot, resolvedPath).replace(/\\/g, "/");
20471
- pending.push({ ref, normalizedRef, baseDir, relTarget });
20534
+ pending.push({ ref, normalizedRef, baseDir: primaryBase, relTarget, isImport });
20472
20535
  }
20473
20536
  if (pending.length > 0) {
20474
20537
  const batchResult = await findRenamesBatch(
20475
20538
  projectRoot,
20476
20539
  pending.map((p2) => p2.relTarget)
20477
20540
  );
20478
- for (const { ref, normalizedRef, baseDir, relTarget } of pending) {
20541
+ for (const { ref, normalizedRef, baseDir, relTarget, isImport } of pending) {
20479
20542
  const rename = batchResult.get(relTarget) ?? null;
20480
20543
  let suggestion;
20481
20544
  let detail;
@@ -20485,7 +20548,7 @@ async function checkPaths(file2, projectRoot) {
20485
20548
  suggestion = `Did you mean ${rename.newPath}?`;
20486
20549
  detail = `Renamed ${rename.daysAgo} days ago in commit ${rename.commitHash}`;
20487
20550
  } else {
20488
- const match = findClosestMatch(normalizedRef, projectFiles);
20551
+ const match = findClosestMatch(normalizedRef, projectFiles, basenameIndex);
20489
20552
  if (match) {
20490
20553
  fixTarget = match;
20491
20554
  suggestion = `Did you mean ${match}?`;
@@ -20498,6 +20561,9 @@ async function checkPaths(file2, projectRoot) {
20498
20561
  fixText = `./${fixText}`;
20499
20562
  }
20500
20563
  }
20564
+ if (fixText && isImport) {
20565
+ fixText = `@${fixText}`;
20566
+ }
20501
20567
  issues.push({
20502
20568
  severity: "error",
20503
20569
  check: "paths",
@@ -20523,14 +20589,14 @@ async function checkPaths(file2, projectRoot) {
20523
20589
  }
20524
20590
  return issues;
20525
20591
  }
20526
- function findClosestMatch(target, files) {
20592
+ function findClosestMatch(target, files, basenameIndex) {
20527
20593
  const targetNorm = target.replace(/\\/g, "/");
20528
20594
  const targetBase = path4.basename(targetNorm);
20595
+ const candidates = basenameIndex.get(targetBase) ?? [];
20529
20596
  let basenameMatch = null;
20530
20597
  let basenameDistance = Infinity;
20531
- for (const file2 of files) {
20532
- const fileNorm = file2.replace(/\\/g, "/");
20533
- if (path4.basename(fileNorm) === targetBase && fileNorm !== targetNorm) {
20598
+ for (const fileNorm of candidates) {
20599
+ if (fileNorm !== targetNorm) {
20534
20600
  const dist = levenshtein(targetNorm, fileNorm);
20535
20601
  if (dist < basenameDistance) {
20536
20602
  basenameDistance = dist;
@@ -20554,7 +20620,7 @@ function findClosestMatch(target, files) {
20554
20620
  }
20555
20621
  return fullPathMatch;
20556
20622
  }
20557
- var import_fast_levenshtein, levenshtein, GLOB_IGNORE, cachedProjectFiles;
20623
+ var import_fast_levenshtein, levenshtein, GLOB_IGNORE, cachedProjectFiles, cachedBasenameIndex;
20558
20624
  var init_paths = __esm({
20559
20625
  "src/core/checks/paths.ts"() {
20560
20626
  "use strict";
@@ -20566,6 +20632,7 @@ var init_paths = __esm({
20566
20632
  levenshtein = import_fast_levenshtein.default.get;
20567
20633
  GLOB_IGNORE = ["**/node_modules/**", "**/.git/**", "**/dist/**", "**/build/**"];
20568
20634
  cachedProjectFiles = null;
20635
+ cachedBasenameIndex = null;
20569
20636
  }
20570
20637
  });
20571
20638
 
@@ -21561,12 +21628,12 @@ function parseTree(text, errors = [], options = ParseOptions.DEFAULT) {
21561
21628
  }
21562
21629
  return result;
21563
21630
  }
21564
- function findNodeAtLocation(root, path19) {
21631
+ function findNodeAtLocation(root, path20) {
21565
21632
  if (!root) {
21566
21633
  return void 0;
21567
21634
  }
21568
21635
  let node = root;
21569
- for (let segment of path19) {
21636
+ for (let segment of path20) {
21570
21637
  if (typeof segment === "string") {
21571
21638
  if (node.type !== "object" || !Array.isArray(node.children)) {
21572
21639
  return void 0;
@@ -26124,8 +26191,8 @@ var require_utils = __commonJS({
26124
26191
  }
26125
26192
  return output;
26126
26193
  };
26127
- exports.basename = (path19, { windows } = {}) => {
26128
- const segs = path19.split(windows ? /[\\/]/ : "/");
26194
+ exports.basename = (path20, { windows } = {}) => {
26195
+ const segs = path20.split(windows ? /[\\/]/ : "/");
26129
26196
  const last2 = segs[segs.length - 1];
26130
26197
  if (last2 === "") {
26131
26198
  return segs[segs.length - 2];
@@ -27683,7 +27750,7 @@ import { readFileSync as readFileSync7 } from "node:fs";
27683
27750
  import { resolve as resolve14, dirname as dirname6 } from "node:path";
27684
27751
  import { fileURLToPath as fileURLToPath2 } from "node:url";
27685
27752
  function loadVersion() {
27686
- if (true) return "0.18.0";
27753
+ if (true) return "0.18.2";
27687
27754
  try {
27688
27755
  const __dir = dirname6(fileURLToPath2(import.meta.url));
27689
27756
  const pkgPath = resolve14(__dir, "../package.json");
@@ -28645,8 +28712,8 @@ var init_parseUtil = __esm({
28645
28712
  init_errors();
28646
28713
  init_en();
28647
28714
  makeIssue = (params) => {
28648
- const { data, path: path19, errorMaps, issueData } = params;
28649
- const fullPath = [...path19, ...issueData.path || []];
28715
+ const { data, path: path20, errorMaps, issueData } = params;
28716
+ const fullPath = [...path20, ...issueData.path || []];
28650
28717
  const fullIssue = {
28651
28718
  ...issueData,
28652
28719
  path: fullPath
@@ -28929,11 +28996,11 @@ var init_types2 = __esm({
28929
28996
  init_parseUtil();
28930
28997
  init_util2();
28931
28998
  ParseInputLazyPath = class {
28932
- constructor(parent, value, path19, key) {
28999
+ constructor(parent, value, path20, key) {
28933
29000
  this._cachedPath = [];
28934
29001
  this.parent = parent;
28935
29002
  this.data = value;
28936
- this._path = path19;
29003
+ this._path = path20;
28937
29004
  this._key = key;
28938
29005
  }
28939
29006
  get path() {
@@ -32435,10 +32502,10 @@ function mergeDefs(...defs) {
32435
32502
  function cloneDef(schema) {
32436
32503
  return mergeDefs(schema._zod.def);
32437
32504
  }
32438
- function getElementAtPath(obj, path19) {
32439
- if (!path19)
32505
+ function getElementAtPath(obj, path20) {
32506
+ if (!path20)
32440
32507
  return obj;
32441
- return path19.reduce((acc, key) => acc?.[key], obj);
32508
+ return path20.reduce((acc, key) => acc?.[key], obj);
32442
32509
  }
32443
32510
  function promiseAllObject(promisesObj) {
32444
32511
  const keys = Object.keys(promisesObj);
@@ -32766,11 +32833,11 @@ function explicitlyAborted(x3, startIndex = 0) {
32766
32833
  }
32767
32834
  return false;
32768
32835
  }
32769
- function prefixIssues(path19, issues) {
32836
+ function prefixIssues(path20, issues) {
32770
32837
  return issues.map((iss) => {
32771
32838
  var _a4;
32772
32839
  (_a4 = iss).path ?? (_a4.path = []);
32773
- iss.path.unshift(path19);
32840
+ iss.path.unshift(path20);
32774
32841
  return iss;
32775
32842
  });
32776
32843
  }
@@ -32988,16 +33055,16 @@ function flattenError(error52, mapper = (issue2) => issue2.message) {
32988
33055
  }
32989
33056
  function formatError(error52, mapper = (issue2) => issue2.message) {
32990
33057
  const fieldErrors = { _errors: [] };
32991
- const processError = (error53, path19 = []) => {
33058
+ const processError = (error53, path20 = []) => {
32992
33059
  for (const issue2 of error53.issues) {
32993
33060
  if (issue2.code === "invalid_union" && issue2.errors.length) {
32994
- issue2.errors.map((issues) => processError({ issues }, [...path19, ...issue2.path]));
33061
+ issue2.errors.map((issues) => processError({ issues }, [...path20, ...issue2.path]));
32995
33062
  } else if (issue2.code === "invalid_key") {
32996
- processError({ issues: issue2.issues }, [...path19, ...issue2.path]);
33063
+ processError({ issues: issue2.issues }, [...path20, ...issue2.path]);
32997
33064
  } else if (issue2.code === "invalid_element") {
32998
- processError({ issues: issue2.issues }, [...path19, ...issue2.path]);
33065
+ processError({ issues: issue2.issues }, [...path20, ...issue2.path]);
32999
33066
  } else {
33000
- const fullpath = [...path19, ...issue2.path];
33067
+ const fullpath = [...path20, ...issue2.path];
33001
33068
  if (fullpath.length === 0) {
33002
33069
  fieldErrors._errors.push(mapper(issue2));
33003
33070
  } else {
@@ -33024,17 +33091,17 @@ function formatError(error52, mapper = (issue2) => issue2.message) {
33024
33091
  }
33025
33092
  function treeifyError(error52, mapper = (issue2) => issue2.message) {
33026
33093
  const result = { errors: [] };
33027
- const processError = (error53, path19 = []) => {
33094
+ const processError = (error53, path20 = []) => {
33028
33095
  var _a4, _b;
33029
33096
  for (const issue2 of error53.issues) {
33030
33097
  if (issue2.code === "invalid_union" && issue2.errors.length) {
33031
- issue2.errors.map((issues) => processError({ issues }, [...path19, ...issue2.path]));
33098
+ issue2.errors.map((issues) => processError({ issues }, [...path20, ...issue2.path]));
33032
33099
  } else if (issue2.code === "invalid_key") {
33033
- processError({ issues: issue2.issues }, [...path19, ...issue2.path]);
33100
+ processError({ issues: issue2.issues }, [...path20, ...issue2.path]);
33034
33101
  } else if (issue2.code === "invalid_element") {
33035
- processError({ issues: issue2.issues }, [...path19, ...issue2.path]);
33102
+ processError({ issues: issue2.issues }, [...path20, ...issue2.path]);
33036
33103
  } else {
33037
- const fullpath = [...path19, ...issue2.path];
33104
+ const fullpath = [...path20, ...issue2.path];
33038
33105
  if (fullpath.length === 0) {
33039
33106
  result.errors.push(mapper(issue2));
33040
33107
  continue;
@@ -33066,8 +33133,8 @@ function treeifyError(error52, mapper = (issue2) => issue2.message) {
33066
33133
  }
33067
33134
  function toDotPath(_path) {
33068
33135
  const segs = [];
33069
- const path19 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
33070
- for (const seg of path19) {
33136
+ const path20 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
33137
+ for (const seg of path20) {
33071
33138
  if (typeof seg === "number")
33072
33139
  segs.push(`[${seg}]`);
33073
33140
  else if (typeof seg === "symbol")
@@ -46828,13 +46895,13 @@ function resolveRef2(ref, ctx) {
46828
46895
  if (!ref.startsWith("#")) {
46829
46896
  throw new Error("External $ref is not supported, only local refs (#/...) are allowed");
46830
46897
  }
46831
- const path19 = ref.slice(1).split("/").filter(Boolean);
46832
- if (path19.length === 0) {
46898
+ const path20 = ref.slice(1).split("/").filter(Boolean);
46899
+ if (path20.length === 0) {
46833
46900
  return ctx.rootSchema;
46834
46901
  }
46835
46902
  const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions";
46836
- if (path19[0] === defsKey) {
46837
- const key = path19[1];
46903
+ if (path20[0] === defsKey) {
46904
+ const key = path20[1];
46838
46905
  if (!key || !ctx.defs[key]) {
46839
46906
  throw new Error(`Reference not found: ${ref}`);
46840
46907
  }
@@ -55003,8 +55070,8 @@ var require_utils2 = __commonJS({
55003
55070
  }
55004
55071
  return ind;
55005
55072
  }
55006
- function removeDotSegments(path19) {
55007
- let input = path19;
55073
+ function removeDotSegments(path20) {
55074
+ let input = path20;
55008
55075
  const output = [];
55009
55076
  let nextSlash = -1;
55010
55077
  let len = 0;
@@ -55257,8 +55324,8 @@ var require_schemes = __commonJS({
55257
55324
  wsComponent.secure = void 0;
55258
55325
  }
55259
55326
  if (wsComponent.resourceName) {
55260
- const [path19, query] = wsComponent.resourceName.split("?");
55261
- wsComponent.path = path19 && path19 !== "/" ? path19 : void 0;
55327
+ const [path20, query] = wsComponent.resourceName.split("?");
55328
+ wsComponent.path = path20 && path20 !== "/" ? path20 : void 0;
55262
55329
  wsComponent.query = query;
55263
55330
  wsComponent.resourceName = void 0;
55264
55331
  }
@@ -58697,12 +58764,12 @@ var require_dist3 = __commonJS({
58697
58764
  throw new Error(`Unknown format "${name}"`);
58698
58765
  return f;
58699
58766
  };
58700
- function addFormats(ajv, list, fs14, exportName) {
58767
+ function addFormats(ajv, list, fs15, exportName) {
58701
58768
  var _a4;
58702
58769
  var _b;
58703
58770
  (_a4 = (_b = ajv.opts.code).formats) !== null && _a4 !== void 0 ? _a4 : _b.formats = (0, codegen_1._)`require("ajv-formats/dist/formats").${exportName}`;
58704
58771
  for (const f of list)
58705
- ajv.addFormat(f, fs14[f]);
58772
+ ajv.addFormat(f, fs15[f]);
58706
58773
  }
58707
58774
  module.exports = exports = formatsPlugin;
58708
58775
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -61706,11 +61773,12 @@ var init_server4 = __esm({
61706
61773
  }
61707
61774
  });
61708
61775
 
61709
- // node_modules/.pnpm/commander@14.0.3/node_modules/commander/lib/error.js
61710
- var require_error = __commonJS({
61711
- "node_modules/.pnpm/commander@14.0.3/node_modules/commander/lib/error.js"(exports) {
61776
+ // node_modules/.pnpm/commander@15.0.0/node_modules/commander/lib/error.js
61777
+ var CommanderError, InvalidArgumentError;
61778
+ var init_error = __esm({
61779
+ "node_modules/.pnpm/commander@15.0.0/node_modules/commander/lib/error.js"() {
61712
61780
  init_define_WEB_FIRST_SEGMENTS();
61713
- var CommanderError2 = class extends Error {
61781
+ CommanderError = class extends Error {
61714
61782
  /**
61715
61783
  * Constructs the CommanderError class
61716
61784
  * @param {number} exitCode suggested exit code which could be used with process.exit
@@ -61726,7 +61794,7 @@ var require_error = __commonJS({
61726
61794
  this.nestedError = void 0;
61727
61795
  }
61728
61796
  };
61729
- var InvalidArgumentError2 = class extends CommanderError2 {
61797
+ InvalidArgumentError = class extends CommanderError {
61730
61798
  /**
61731
61799
  * Constructs the InvalidArgumentError class
61732
61800
  * @param {string} [message] explanation of why argument is invalid
@@ -61737,17 +61805,20 @@ var require_error = __commonJS({
61737
61805
  this.name = this.constructor.name;
61738
61806
  }
61739
61807
  };
61740
- exports.CommanderError = CommanderError2;
61741
- exports.InvalidArgumentError = InvalidArgumentError2;
61742
61808
  }
61743
61809
  });
61744
61810
 
61745
- // node_modules/.pnpm/commander@14.0.3/node_modules/commander/lib/argument.js
61746
- var require_argument = __commonJS({
61747
- "node_modules/.pnpm/commander@14.0.3/node_modules/commander/lib/argument.js"(exports) {
61811
+ // node_modules/.pnpm/commander@15.0.0/node_modules/commander/lib/argument.js
61812
+ function humanReadableArgName(arg) {
61813
+ const nameOutput = arg.name() + (arg.variadic === true ? "..." : "");
61814
+ return arg.required ? "<" + nameOutput + ">" : "[" + nameOutput + "]";
61815
+ }
61816
+ var Argument;
61817
+ var init_argument = __esm({
61818
+ "node_modules/.pnpm/commander@15.0.0/node_modules/commander/lib/argument.js"() {
61748
61819
  init_define_WEB_FIRST_SEGMENTS();
61749
- var { InvalidArgumentError: InvalidArgumentError2 } = require_error();
61750
- var Argument2 = class {
61820
+ init_error();
61821
+ Argument = class {
61751
61822
  /**
61752
61823
  * Initialize a new command argument with the given name and description.
61753
61824
  * The default is that the argument is required, and you can explicitly
@@ -61832,7 +61903,7 @@ var require_argument = __commonJS({
61832
61903
  this.argChoices = values.slice();
61833
61904
  this.parseArg = (arg, previous) => {
61834
61905
  if (!this.argChoices.includes(arg)) {
61835
- throw new InvalidArgumentError2(
61906
+ throw new InvalidArgumentError(
61836
61907
  `Allowed choices are ${this.argChoices.join(", ")}.`
61837
61908
  );
61838
61909
  }
@@ -61862,21 +61933,17 @@ var require_argument = __commonJS({
61862
61933
  return this;
61863
61934
  }
61864
61935
  };
61865
- function humanReadableArgName(arg) {
61866
- const nameOutput = arg.name() + (arg.variadic === true ? "..." : "");
61867
- return arg.required ? "<" + nameOutput + ">" : "[" + nameOutput + "]";
61868
- }
61869
- exports.Argument = Argument2;
61870
- exports.humanReadableArgName = humanReadableArgName;
61871
61936
  }
61872
61937
  });
61873
61938
 
61874
- // node_modules/.pnpm/commander@14.0.3/node_modules/commander/lib/help.js
61875
- var require_help = __commonJS({
61876
- "node_modules/.pnpm/commander@14.0.3/node_modules/commander/lib/help.js"(exports) {
61939
+ // node_modules/.pnpm/commander@15.0.0/node_modules/commander/lib/help.js
61940
+ import { stripVTControlCharacters } from "node:util";
61941
+ var Help;
61942
+ var init_help = __esm({
61943
+ "node_modules/.pnpm/commander@15.0.0/node_modules/commander/lib/help.js"() {
61877
61944
  init_define_WEB_FIRST_SEGMENTS();
61878
- var { humanReadableArgName } = require_argument();
61879
- var Help2 = class {
61945
+ init_argument();
61946
+ Help = class {
61880
61947
  constructor() {
61881
61948
  this.helpWidth = void 0;
61882
61949
  this.minWidthToWrap = 40;
@@ -62306,7 +62373,7 @@ var require_help = __commonJS({
62306
62373
  * @returns {number}
62307
62374
  */
62308
62375
  displayWidth(str) {
62309
- return stripColor(str).length;
62376
+ return stripVTControlCharacters(str).length;
62310
62377
  }
62311
62378
  /**
62312
62379
  * Style the title for displaying in the help. Called with 'Usage:', 'Options:', etc.
@@ -62465,21 +62532,60 @@ ${itemIndentStr}`);
62465
62532
  return wrappedLines.join("\n");
62466
62533
  }
62467
62534
  };
62468
- function stripColor(str) {
62469
- const sgrPattern = /\x1b\[\d*(;\d*)*m/g;
62470
- return str.replace(sgrPattern, "");
62471
- }
62472
- exports.Help = Help2;
62473
- exports.stripColor = stripColor;
62474
62535
  }
62475
62536
  });
62476
62537
 
62477
- // node_modules/.pnpm/commander@14.0.3/node_modules/commander/lib/option.js
62478
- var require_option = __commonJS({
62479
- "node_modules/.pnpm/commander@14.0.3/node_modules/commander/lib/option.js"(exports) {
62538
+ // node_modules/.pnpm/commander@15.0.0/node_modules/commander/lib/option.js
62539
+ function camelcase(str) {
62540
+ return str.split("-").reduce((str2, word) => {
62541
+ return str2 + word[0].toUpperCase() + word.slice(1);
62542
+ });
62543
+ }
62544
+ function splitOptionFlags(flags) {
62545
+ let shortFlag;
62546
+ let longFlag;
62547
+ const shortFlagExp = /^-[^-]$/;
62548
+ const longFlagExp = /^--[^-]/;
62549
+ const flagParts = flags.split(/[ |,]+/).concat("guard");
62550
+ if (shortFlagExp.test(flagParts[0])) shortFlag = flagParts.shift();
62551
+ if (longFlagExp.test(flagParts[0])) longFlag = flagParts.shift();
62552
+ if (!shortFlag && shortFlagExp.test(flagParts[0]))
62553
+ shortFlag = flagParts.shift();
62554
+ if (!shortFlag && longFlagExp.test(flagParts[0])) {
62555
+ shortFlag = longFlag;
62556
+ longFlag = flagParts.shift();
62557
+ }
62558
+ if (flagParts[0].startsWith("-")) {
62559
+ const unsupportedFlag = flagParts[0];
62560
+ const baseError = `option creation failed due to '${unsupportedFlag}' in option flags '${flags}'`;
62561
+ if (/^-[^-][^-]/.test(unsupportedFlag))
62562
+ throw new Error(
62563
+ `${baseError}
62564
+ - a short flag is a single dash and a single character
62565
+ - either use a single dash and a single character (for a short flag)
62566
+ - or use a double dash for a long option (and can have two, like '--ws, --workspace')`
62567
+ );
62568
+ if (shortFlagExp.test(unsupportedFlag))
62569
+ throw new Error(`${baseError}
62570
+ - too many short flags`);
62571
+ if (longFlagExp.test(unsupportedFlag))
62572
+ throw new Error(`${baseError}
62573
+ - too many long flags`);
62574
+ throw new Error(`${baseError}
62575
+ - unrecognised flag format`);
62576
+ }
62577
+ if (shortFlag === void 0 && longFlag === void 0)
62578
+ throw new Error(
62579
+ `option creation failed due to no flags found in '${flags}'.`
62580
+ );
62581
+ return { shortFlag, longFlag };
62582
+ }
62583
+ var Option, DualOptions;
62584
+ var init_option = __esm({
62585
+ "node_modules/.pnpm/commander@15.0.0/node_modules/commander/lib/option.js"() {
62480
62586
  init_define_WEB_FIRST_SEGMENTS();
62481
- var { InvalidArgumentError: InvalidArgumentError2 } = require_error();
62482
- var Option2 = class {
62587
+ init_error();
62588
+ Option = class {
62483
62589
  /**
62484
62590
  * Initialize a new `Option` with the given `flags` and `description`.
62485
62591
  *
@@ -62637,7 +62743,7 @@ var require_option = __commonJS({
62637
62743
  this.argChoices = values.slice();
62638
62744
  this.parseArg = (arg, previous) => {
62639
62745
  if (!this.argChoices.includes(arg)) {
62640
- throw new InvalidArgumentError2(
62746
+ throw new InvalidArgumentError(
62641
62747
  `Allowed choices are ${this.argChoices.join(", ")}.`
62642
62748
  );
62643
62749
  }
@@ -62703,7 +62809,7 @@ var require_option = __commonJS({
62703
62809
  return !this.required && !this.optional && !this.negate;
62704
62810
  }
62705
62811
  };
62706
- var DualOptions = class {
62812
+ DualOptions = class {
62707
62813
  /**
62708
62814
  * @param {Option[]} options
62709
62815
  */
@@ -62739,151 +62845,143 @@ var require_option = __commonJS({
62739
62845
  return option.negate === (negativeValue === value);
62740
62846
  }
62741
62847
  };
62742
- function camelcase(str) {
62743
- return str.split("-").reduce((str2, word) => {
62744
- return str2 + word[0].toUpperCase() + word.slice(1);
62745
- });
62746
- }
62747
- function splitOptionFlags(flags) {
62748
- let shortFlag;
62749
- let longFlag;
62750
- const shortFlagExp = /^-[^-]$/;
62751
- const longFlagExp = /^--[^-]/;
62752
- const flagParts = flags.split(/[ |,]+/).concat("guard");
62753
- if (shortFlagExp.test(flagParts[0])) shortFlag = flagParts.shift();
62754
- if (longFlagExp.test(flagParts[0])) longFlag = flagParts.shift();
62755
- if (!shortFlag && shortFlagExp.test(flagParts[0]))
62756
- shortFlag = flagParts.shift();
62757
- if (!shortFlag && longFlagExp.test(flagParts[0])) {
62758
- shortFlag = longFlag;
62759
- longFlag = flagParts.shift();
62760
- }
62761
- if (flagParts[0].startsWith("-")) {
62762
- const unsupportedFlag = flagParts[0];
62763
- const baseError = `option creation failed due to '${unsupportedFlag}' in option flags '${flags}'`;
62764
- if (/^-[^-][^-]/.test(unsupportedFlag))
62765
- throw new Error(
62766
- `${baseError}
62767
- - a short flag is a single dash and a single character
62768
- - either use a single dash and a single character (for a short flag)
62769
- - or use a double dash for a long option (and can have two, like '--ws, --workspace')`
62770
- );
62771
- if (shortFlagExp.test(unsupportedFlag))
62772
- throw new Error(`${baseError}
62773
- - too many short flags`);
62774
- if (longFlagExp.test(unsupportedFlag))
62775
- throw new Error(`${baseError}
62776
- - too many long flags`);
62777
- throw new Error(`${baseError}
62778
- - unrecognised flag format`);
62779
- }
62780
- if (shortFlag === void 0 && longFlag === void 0)
62781
- throw new Error(
62782
- `option creation failed due to no flags found in '${flags}'.`
62783
- );
62784
- return { shortFlag, longFlag };
62785
- }
62786
- exports.Option = Option2;
62787
- exports.DualOptions = DualOptions;
62788
62848
  }
62789
62849
  });
62790
62850
 
62791
- // node_modules/.pnpm/commander@14.0.3/node_modules/commander/lib/suggestSimilar.js
62792
- var require_suggestSimilar = __commonJS({
62793
- "node_modules/.pnpm/commander@14.0.3/node_modules/commander/lib/suggestSimilar.js"(exports) {
62794
- init_define_WEB_FIRST_SEGMENTS();
62795
- var maxDistance = 3;
62796
- function editDistance(a, b2) {
62797
- if (Math.abs(a.length - b2.length) > maxDistance)
62798
- return Math.max(a.length, b2.length);
62799
- const d = [];
62800
- for (let i2 = 0; i2 <= a.length; i2++) {
62801
- d[i2] = [i2];
62802
- }
62803
- for (let j3 = 0; j3 <= b2.length; j3++) {
62804
- d[0][j3] = j3;
62805
- }
62806
- for (let j3 = 1; j3 <= b2.length; j3++) {
62807
- for (let i2 = 1; i2 <= a.length; i2++) {
62808
- let cost = 1;
62809
- if (a[i2 - 1] === b2[j3 - 1]) {
62810
- cost = 0;
62811
- } else {
62812
- cost = 1;
62813
- }
62814
- d[i2][j3] = Math.min(
62815
- d[i2 - 1][j3] + 1,
62816
- // deletion
62817
- d[i2][j3 - 1] + 1,
62818
- // insertion
62819
- d[i2 - 1][j3 - 1] + cost
62820
- // substitution
62821
- );
62822
- if (i2 > 1 && j3 > 1 && a[i2 - 1] === b2[j3 - 2] && a[i2 - 2] === b2[j3 - 1]) {
62823
- d[i2][j3] = Math.min(d[i2][j3], d[i2 - 2][j3 - 2] + 1);
62824
- }
62825
- }
62851
+ // node_modules/.pnpm/commander@15.0.0/node_modules/commander/lib/suggestSimilar.js
62852
+ function editDistance(a, b2) {
62853
+ if (Math.abs(a.length - b2.length) > maxDistance)
62854
+ return Math.max(a.length, b2.length);
62855
+ const d = [];
62856
+ for (let i2 = 0; i2 <= a.length; i2++) {
62857
+ d[i2] = [i2];
62858
+ }
62859
+ for (let j3 = 0; j3 <= b2.length; j3++) {
62860
+ d[0][j3] = j3;
62861
+ }
62862
+ for (let j3 = 1; j3 <= b2.length; j3++) {
62863
+ for (let i2 = 1; i2 <= a.length; i2++) {
62864
+ let cost;
62865
+ if (a[i2 - 1] === b2[j3 - 1]) {
62866
+ cost = 0;
62867
+ } else {
62868
+ cost = 1;
62869
+ }
62870
+ d[i2][j3] = Math.min(
62871
+ d[i2 - 1][j3] + 1,
62872
+ // deletion
62873
+ d[i2][j3 - 1] + 1,
62874
+ // insertion
62875
+ d[i2 - 1][j3 - 1] + cost
62876
+ // substitution
62877
+ );
62878
+ if (i2 > 1 && j3 > 1 && a[i2 - 1] === b2[j3 - 2] && a[i2 - 2] === b2[j3 - 1]) {
62879
+ d[i2][j3] = Math.min(d[i2][j3], d[i2 - 2][j3 - 2] + 1);
62826
62880
  }
62827
- return d[a.length][b2.length];
62828
62881
  }
62829
- function suggestSimilar(word, candidates) {
62830
- if (!candidates || candidates.length === 0) return "";
62831
- candidates = Array.from(new Set(candidates));
62832
- const searchingOptions = word.startsWith("--");
62833
- if (searchingOptions) {
62834
- word = word.slice(2);
62835
- candidates = candidates.map((candidate) => candidate.slice(2));
62836
- }
62837
- let similar = [];
62838
- let bestDistance = maxDistance;
62839
- const minSimilarity = 0.4;
62840
- candidates.forEach((candidate) => {
62841
- if (candidate.length <= 1) return;
62842
- const distance2 = editDistance(word, candidate);
62843
- const length = Math.max(word.length, candidate.length);
62844
- const similarity = (length - distance2) / length;
62845
- if (similarity > minSimilarity) {
62846
- if (distance2 < bestDistance) {
62847
- bestDistance = distance2;
62848
- similar = [candidate];
62849
- } else if (distance2 === bestDistance) {
62850
- similar.push(candidate);
62851
- }
62852
- }
62853
- });
62854
- similar.sort((a, b2) => a.localeCompare(b2));
62855
- if (searchingOptions) {
62856
- similar = similar.map((candidate) => `--${candidate}`);
62882
+ }
62883
+ return d[a.length][b2.length];
62884
+ }
62885
+ function suggestSimilar(word, candidates) {
62886
+ if (!candidates || candidates.length === 0) return "";
62887
+ candidates = Array.from(new Set(candidates));
62888
+ const searchingOptions = word.startsWith("--");
62889
+ if (searchingOptions) {
62890
+ word = word.slice(2);
62891
+ candidates = candidates.map((candidate) => candidate.slice(2));
62892
+ }
62893
+ let similar = [];
62894
+ let bestDistance = maxDistance;
62895
+ const minSimilarity = 0.4;
62896
+ candidates.forEach((candidate) => {
62897
+ if (candidate.length <= 1) return;
62898
+ const distance2 = editDistance(word, candidate);
62899
+ const length = Math.max(word.length, candidate.length);
62900
+ const similarity = (length - distance2) / length;
62901
+ if (similarity > minSimilarity) {
62902
+ if (distance2 < bestDistance) {
62903
+ bestDistance = distance2;
62904
+ similar = [candidate];
62905
+ } else if (distance2 === bestDistance) {
62906
+ similar.push(candidate);
62857
62907
  }
62858
- if (similar.length > 1) {
62859
- return `
62908
+ }
62909
+ });
62910
+ similar.sort((a, b2) => a.localeCompare(b2));
62911
+ if (searchingOptions) {
62912
+ similar = similar.map((candidate) => `--${candidate}`);
62913
+ }
62914
+ if (similar.length > 1) {
62915
+ return `
62860
62916
  (Did you mean one of ${similar.join(", ")}?)`;
62861
- }
62862
- if (similar.length === 1) {
62863
- return `
62917
+ }
62918
+ if (similar.length === 1) {
62919
+ return `
62864
62920
  (Did you mean ${similar[0]}?)`;
62865
- }
62866
- return "";
62867
- }
62868
- exports.suggestSimilar = suggestSimilar;
62921
+ }
62922
+ return "";
62923
+ }
62924
+ var maxDistance;
62925
+ var init_suggestSimilar = __esm({
62926
+ "node_modules/.pnpm/commander@15.0.0/node_modules/commander/lib/suggestSimilar.js"() {
62927
+ init_define_WEB_FIRST_SEGMENTS();
62928
+ maxDistance = 3;
62869
62929
  }
62870
62930
  });
62871
62931
 
62872
- // node_modules/.pnpm/commander@14.0.3/node_modules/commander/lib/command.js
62873
- var require_command = __commonJS({
62874
- "node_modules/.pnpm/commander@14.0.3/node_modules/commander/lib/command.js"(exports) {
62932
+ // node_modules/.pnpm/commander@15.0.0/node_modules/commander/lib/command.js
62933
+ import { EventEmitter as EventEmitter2 } from "node:events";
62934
+ import childProcess from "node:child_process";
62935
+ import path18 from "node:path";
62936
+ import fs13 from "node:fs";
62937
+ import process5 from "node:process";
62938
+ import { stripVTControlCharacters as stripVTControlCharacters2 } from "node:util";
62939
+ function incrementNodeInspectorPort(args2) {
62940
+ return args2.map((arg) => {
62941
+ if (!arg.startsWith("--inspect")) {
62942
+ return arg;
62943
+ }
62944
+ let debugOption;
62945
+ let debugHost = "127.0.0.1";
62946
+ let debugPort = "9229";
62947
+ let match;
62948
+ if ((match = arg.match(/^(--inspect(-brk)?)$/)) !== null) {
62949
+ debugOption = match[1];
62950
+ } else if ((match = arg.match(/^(--inspect(-brk|-port)?)=([^:]+)$/)) !== null) {
62951
+ debugOption = match[1];
62952
+ if (/^\d+$/.test(match[3])) {
62953
+ debugPort = match[3];
62954
+ } else {
62955
+ debugHost = match[3];
62956
+ }
62957
+ } else if ((match = arg.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/)) !== null) {
62958
+ debugOption = match[1];
62959
+ debugHost = match[3];
62960
+ debugPort = match[4];
62961
+ }
62962
+ if (debugOption && debugPort !== "0") {
62963
+ return `${debugOption}=${debugHost}:${parseInt(debugPort) + 1}`;
62964
+ }
62965
+ return arg;
62966
+ });
62967
+ }
62968
+ function useColor() {
62969
+ if (process5.env.NO_COLOR || process5.env.FORCE_COLOR === "0" || process5.env.FORCE_COLOR === "false")
62970
+ return false;
62971
+ if (process5.env.FORCE_COLOR || process5.env.CLICOLOR_FORCE !== void 0)
62972
+ return true;
62973
+ return void 0;
62974
+ }
62975
+ var Command2;
62976
+ var init_command = __esm({
62977
+ "node_modules/.pnpm/commander@15.0.0/node_modules/commander/lib/command.js"() {
62875
62978
  init_define_WEB_FIRST_SEGMENTS();
62876
- var EventEmitter2 = __require("node:events").EventEmitter;
62877
- var childProcess = __require("node:child_process");
62878
- var path19 = __require("node:path");
62879
- var fs14 = __require("node:fs");
62880
- var process11 = __require("node:process");
62881
- var { Argument: Argument2, humanReadableArgName } = require_argument();
62882
- var { CommanderError: CommanderError2 } = require_error();
62883
- var { Help: Help2, stripColor } = require_help();
62884
- var { Option: Option2, DualOptions } = require_option();
62885
- var { suggestSimilar } = require_suggestSimilar();
62886
- var Command3 = class _Command extends EventEmitter2 {
62979
+ init_argument();
62980
+ init_error();
62981
+ init_help();
62982
+ init_option();
62983
+ init_suggestSimilar();
62984
+ Command2 = class _Command extends EventEmitter2 {
62887
62985
  /**
62888
62986
  * Initialize a new `Command`.
62889
62987
  *
@@ -62924,14 +63022,14 @@ var require_command = __commonJS({
62924
63022
  this._showSuggestionAfterError = true;
62925
63023
  this._savedState = null;
62926
63024
  this._outputConfiguration = {
62927
- writeOut: (str) => process11.stdout.write(str),
62928
- writeErr: (str) => process11.stderr.write(str),
63025
+ writeOut: (str) => process5.stdout.write(str),
63026
+ writeErr: (str) => process5.stderr.write(str),
62929
63027
  outputError: (str, write) => write(str),
62930
- getOutHelpWidth: () => process11.stdout.isTTY ? process11.stdout.columns : void 0,
62931
- getErrHelpWidth: () => process11.stderr.isTTY ? process11.stderr.columns : void 0,
62932
- getOutHasColors: () => useColor() ?? (process11.stdout.isTTY && process11.stdout.hasColors?.()),
62933
- getErrHasColors: () => useColor() ?? (process11.stderr.isTTY && process11.stderr.hasColors?.()),
62934
- stripColor: (str) => stripColor(str)
63028
+ getOutHelpWidth: () => process5.stdout.isTTY ? process5.stdout.columns : void 0,
63029
+ getErrHelpWidth: () => process5.stderr.isTTY ? process5.stderr.columns : void 0,
63030
+ getOutHasColors: () => useColor() ?? (process5.stdout.isTTY && process5.stdout.hasColors?.()),
63031
+ getErrHasColors: () => useColor() ?? (process5.stderr.isTTY && process5.stderr.hasColors?.()),
63032
+ stripColor: (str) => stripVTControlCharacters2(str)
62935
63033
  };
62936
63034
  this._hidden = false;
62937
63035
  this._helpOption = void 0;
@@ -63042,7 +63140,7 @@ var require_command = __commonJS({
63042
63140
  * @return {Help}
63043
63141
  */
63044
63142
  createHelp() {
63045
- return Object.assign(new Help2(), this.configureHelp());
63143
+ return Object.assign(new Help(), this.configureHelp());
63046
63144
  }
63047
63145
  /**
63048
63146
  * You can customise the help by overriding Help properties using configureHelp(),
@@ -63140,7 +63238,7 @@ var require_command = __commonJS({
63140
63238
  * @return {Argument} new argument
63141
63239
  */
63142
63240
  createArgument(name, description) {
63143
- return new Argument2(name, description);
63241
+ return new Argument(name, description);
63144
63242
  }
63145
63243
  /**
63146
63244
  * Define argument syntax for command.
@@ -63322,9 +63420,9 @@ Expecting one of '${allowedValues.join("', '")}'`);
63322
63420
  */
63323
63421
  _exit(exitCode, code, message) {
63324
63422
  if (this._exitCallback) {
63325
- this._exitCallback(new CommanderError2(exitCode, code, message));
63423
+ this._exitCallback(new CommanderError(exitCode, code, message));
63326
63424
  }
63327
- process11.exit(exitCode);
63425
+ process5.exit(exitCode);
63328
63426
  }
63329
63427
  /**
63330
63428
  * Register callback `fn` for the command.
@@ -63366,7 +63464,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
63366
63464
  * @return {Option} new option
63367
63465
  */
63368
63466
  createOption(flags, description) {
63369
- return new Option2(flags, description);
63467
+ return new Option(flags, description);
63370
63468
  }
63371
63469
  /**
63372
63470
  * Wrap parseArgs to catch 'commander.invalidArgument'.
@@ -63439,16 +63537,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
63439
63537
  this._registerOption(option);
63440
63538
  const oname = option.name();
63441
63539
  const name = option.attributeName();
63442
- if (option.negate) {
63443
- const positiveLongFlag = option.long.replace(/^--no-/, "--");
63444
- if (!this._findOption(positiveLongFlag)) {
63445
- this.setOptionValueWithSource(
63446
- name,
63447
- option.defaultValue === void 0 ? true : option.defaultValue,
63448
- "default"
63449
- );
63450
- }
63451
- } else if (option.defaultValue !== void 0) {
63540
+ if (option.defaultValue !== void 0) {
63452
63541
  this.setOptionValueWithSource(name, option.defaultValue, "default");
63453
63542
  }
63454
63543
  const handleOptionValue = (val, invalidValueMessage, valueSource) => {
@@ -63491,7 +63580,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
63491
63580
  * @private
63492
63581
  */
63493
63582
  _optionEx(config2, flags, description, fn, defaultValue) {
63494
- if (typeof flags === "object" && flags instanceof Option2) {
63583
+ if (typeof flags === "object" && flags instanceof Option) {
63495
63584
  throw new Error(
63496
63585
  "To add an Option object use addOption() instead of option() or requiredOption()"
63497
63586
  );
@@ -63724,16 +63813,16 @@ Expecting one of '${allowedValues.join("', '")}'`);
63724
63813
  }
63725
63814
  parseOptions = parseOptions || {};
63726
63815
  if (argv === void 0 && parseOptions.from === void 0) {
63727
- if (process11.versions?.electron) {
63816
+ if (process5.versions?.electron) {
63728
63817
  parseOptions.from = "electron";
63729
63818
  }
63730
- const execArgv = process11.execArgv ?? [];
63819
+ const execArgv = process5.execArgv ?? [];
63731
63820
  if (execArgv.includes("-e") || execArgv.includes("--eval") || execArgv.includes("-p") || execArgv.includes("--print")) {
63732
63821
  parseOptions.from = "eval";
63733
63822
  }
63734
63823
  }
63735
63824
  if (argv === void 0) {
63736
- argv = process11.argv;
63825
+ argv = process5.argv;
63737
63826
  }
63738
63827
  this.rawArgs = argv.slice();
63739
63828
  let userArgs;
@@ -63744,7 +63833,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
63744
63833
  userArgs = argv.slice(2);
63745
63834
  break;
63746
63835
  case "electron":
63747
- if (process11.defaultApp) {
63836
+ if (process5.defaultApp) {
63748
63837
  this._scriptPath = argv[1];
63749
63838
  userArgs = argv.slice(2);
63750
63839
  } else {
@@ -63823,6 +63912,18 @@ Expecting one of '${allowedValues.join("', '")}'`);
63823
63912
  }
63824
63913
  _prepareForParse() {
63825
63914
  if (this._savedState === null) {
63915
+ this.options.filter(
63916
+ (option) => option.negate && option.defaultValue === void 0 && this.getOptionValue(option.attributeName()) === void 0
63917
+ ).forEach((option) => {
63918
+ const positiveLongFlag = option.long.replace(/^--no-/, "--");
63919
+ if (!this._findOption(positiveLongFlag)) {
63920
+ this.setOptionValueWithSource(
63921
+ option.attributeName(),
63922
+ true,
63923
+ "default"
63924
+ );
63925
+ }
63926
+ });
63826
63927
  this.saveStateBeforeParse();
63827
63928
  } else {
63828
63929
  this.restoreStateBeforeParse();
@@ -63870,7 +63971,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
63870
63971
  * @param {string} subcommandName
63871
63972
  */
63872
63973
  _checkForMissingExecutable(executableFile, executableDir, subcommandName) {
63873
- if (fs14.existsSync(executableFile)) return;
63974
+ if (fs13.existsSync(executableFile)) return;
63874
63975
  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";
63875
63976
  const executableMissing = `'${executableFile}' does not exist
63876
63977
  - if '${subcommandName}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
@@ -63885,14 +63986,13 @@ Expecting one of '${allowedValues.join("', '")}'`);
63885
63986
  */
63886
63987
  _executeSubCommand(subcommand, args2) {
63887
63988
  args2 = args2.slice();
63888
- let launchWithNode = false;
63889
63989
  const sourceExt = [".js", ".ts", ".tsx", ".mjs", ".cjs"];
63890
63990
  function findFile(baseDir, baseName) {
63891
- const localBin = path19.resolve(baseDir, baseName);
63892
- if (fs14.existsSync(localBin)) return localBin;
63893
- if (sourceExt.includes(path19.extname(baseName))) return void 0;
63991
+ const localBin = path18.resolve(baseDir, baseName);
63992
+ if (fs13.existsSync(localBin)) return localBin;
63993
+ if (sourceExt.includes(path18.extname(baseName))) return void 0;
63894
63994
  const foundExt = sourceExt.find(
63895
- (ext) => fs14.existsSync(`${localBin}${ext}`)
63995
+ (ext) => fs13.existsSync(`${localBin}${ext}`)
63896
63996
  );
63897
63997
  if (foundExt) return `${localBin}${foundExt}`;
63898
63998
  return void 0;
@@ -63904,21 +64004,21 @@ Expecting one of '${allowedValues.join("', '")}'`);
63904
64004
  if (this._scriptPath) {
63905
64005
  let resolvedScriptPath;
63906
64006
  try {
63907
- resolvedScriptPath = fs14.realpathSync(this._scriptPath);
64007
+ resolvedScriptPath = fs13.realpathSync(this._scriptPath);
63908
64008
  } catch {
63909
64009
  resolvedScriptPath = this._scriptPath;
63910
64010
  }
63911
- executableDir = path19.resolve(
63912
- path19.dirname(resolvedScriptPath),
64011
+ executableDir = path18.resolve(
64012
+ path18.dirname(resolvedScriptPath),
63913
64013
  executableDir
63914
64014
  );
63915
64015
  }
63916
64016
  if (executableDir) {
63917
64017
  let localFile = findFile(executableDir, executableFile);
63918
64018
  if (!localFile && !subcommand._executableFile && this._scriptPath) {
63919
- const legacyName = path19.basename(
64019
+ const legacyName = path18.basename(
63920
64020
  this._scriptPath,
63921
- path19.extname(this._scriptPath)
64021
+ path18.extname(this._scriptPath)
63922
64022
  );
63923
64023
  if (legacyName !== this._name) {
63924
64024
  localFile = findFile(
@@ -63929,13 +64029,13 @@ Expecting one of '${allowedValues.join("', '")}'`);
63929
64029
  }
63930
64030
  executableFile = localFile || executableFile;
63931
64031
  }
63932
- launchWithNode = sourceExt.includes(path19.extname(executableFile));
64032
+ const launchWithNode = sourceExt.includes(path18.extname(executableFile));
63933
64033
  let proc;
63934
- if (process11.platform !== "win32") {
64034
+ if (process5.platform !== "win32") {
63935
64035
  if (launchWithNode) {
63936
64036
  args2.unshift(executableFile);
63937
- args2 = incrementNodeInspectorPort(process11.execArgv).concat(args2);
63938
- proc = childProcess.spawn(process11.argv[0], args2, { stdio: "inherit" });
64037
+ args2 = incrementNodeInspectorPort(process5.execArgv).concat(args2);
64038
+ proc = childProcess.spawn(process5.argv[0], args2, { stdio: "inherit" });
63939
64039
  } else {
63940
64040
  proc = childProcess.spawn(executableFile, args2, { stdio: "inherit" });
63941
64041
  }
@@ -63946,13 +64046,13 @@ Expecting one of '${allowedValues.join("', '")}'`);
63946
64046
  subcommand._name
63947
64047
  );
63948
64048
  args2.unshift(executableFile);
63949
- args2 = incrementNodeInspectorPort(process11.execArgv).concat(args2);
63950
- proc = childProcess.spawn(process11.execPath, args2, { stdio: "inherit" });
64049
+ args2 = incrementNodeInspectorPort(process5.execArgv).concat(args2);
64050
+ proc = childProcess.spawn(process5.execPath, args2, { stdio: "inherit" });
63951
64051
  }
63952
64052
  if (!proc.killed) {
63953
64053
  const signals2 = ["SIGUSR1", "SIGUSR2", "SIGTERM", "SIGINT", "SIGHUP"];
63954
64054
  signals2.forEach((signal) => {
63955
- process11.on(signal, () => {
64055
+ process5.on(signal, () => {
63956
64056
  if (proc.killed === false && proc.exitCode === null) {
63957
64057
  proc.kill(signal);
63958
64058
  }
@@ -63963,10 +64063,10 @@ Expecting one of '${allowedValues.join("', '")}'`);
63963
64063
  proc.on("close", (code) => {
63964
64064
  code = code ?? 1;
63965
64065
  if (!exitCallback) {
63966
- process11.exit(code);
64066
+ process5.exit(code);
63967
64067
  } else {
63968
64068
  exitCallback(
63969
- new CommanderError2(
64069
+ new CommanderError(
63970
64070
  code,
63971
64071
  "commander.executeSubCommandAsync",
63972
64072
  "(close)"
@@ -63985,9 +64085,9 @@ Expecting one of '${allowedValues.join("', '")}'`);
63985
64085
  throw new Error(`'${executableFile}' not executable`);
63986
64086
  }
63987
64087
  if (!exitCallback) {
63988
- process11.exit(1);
64088
+ process5.exit(1);
63989
64089
  } else {
63990
- const wrappedError = new CommanderError2(
64090
+ const wrappedError = new CommanderError(
63991
64091
  1,
63992
64092
  "commander.executeSubCommandAsync",
63993
64093
  "(error)"
@@ -64485,13 +64585,13 @@ Expecting one of '${allowedValues.join("', '")}'`);
64485
64585
  */
64486
64586
  _parseOptionsEnv() {
64487
64587
  this.options.forEach((option) => {
64488
- if (option.envVar && option.envVar in process11.env) {
64588
+ if (option.envVar && option.envVar in process5.env) {
64489
64589
  const optionKey = option.attributeName();
64490
64590
  if (this.getOptionValue(optionKey) === void 0 || ["default", "config", "env"].includes(
64491
64591
  this.getOptionValueSource(optionKey)
64492
64592
  )) {
64493
64593
  if (option.required || option.optional) {
64494
- this.emit(`optionEnv:${option.name()}`, process11.env[option.envVar]);
64594
+ this.emit(`optionEnv:${option.name()}`, process5.env[option.envVar]);
64495
64595
  } else {
64496
64596
  this.emit(`optionEnv:${option.name()}`);
64497
64597
  }
@@ -64620,8 +64720,10 @@ Expecting one of '${allowedValues.join("', '")}'`);
64620
64720
  if (this._allowExcessArguments) return;
64621
64721
  const expected = this.registeredArguments.length;
64622
64722
  const s = expected === 1 ? "" : "s";
64723
+ const received = receivedArgs.length;
64623
64724
  const forSubcommand = this.parent ? ` for '${this.name()}'` : "";
64624
- const message = `error: too many arguments${forSubcommand}. Expected ${expected} argument${s} but got ${receivedArgs.length}.`;
64725
+ const details = receivedArgs.join(", ");
64726
+ const message = `error: too many arguments${forSubcommand}. Expected ${expected} argument${s} but got ${received}: ${details}.`;
64625
64727
  this.error(message, { code: "commander.excessArguments" });
64626
64728
  }
64627
64729
  /**
@@ -64833,25 +64935,25 @@ Expecting one of '${allowedValues.join("', '")}'`);
64833
64935
  }
64834
64936
  /**
64835
64937
  * Set the name of the command from script filename, such as process.argv[1],
64836
- * or require.main.filename, or __filename.
64938
+ * or import.meta.filename.
64837
64939
  *
64838
64940
  * (Used internally and public although not documented in README.)
64839
64941
  *
64840
64942
  * @example
64841
- * program.nameFromFilename(require.main.filename);
64943
+ * program.nameFromFilename(import.meta.filename);
64842
64944
  *
64843
64945
  * @param {string} filename
64844
64946
  * @return {Command}
64845
64947
  */
64846
64948
  nameFromFilename(filename) {
64847
- this._name = path19.basename(filename, path19.extname(filename));
64949
+ this._name = path18.basename(filename, path18.extname(filename));
64848
64950
  return this;
64849
64951
  }
64850
64952
  /**
64851
64953
  * Get or set the directory for searching for executable subcommands of this command.
64852
64954
  *
64853
64955
  * @example
64854
- * program.executableDir(__dirname);
64956
+ * program.executableDir(import.meta.dirname);
64855
64957
  * // or
64856
64958
  * program.executableDir('subcommands');
64857
64959
  *
@@ -65015,7 +65117,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
65015
65117
  */
65016
65118
  help(contextOptions) {
65017
65119
  this.outputHelp(contextOptions);
65018
- let exitCode = Number(process11.exitCode ?? 0);
65120
+ let exitCode = Number(process5.exitCode ?? 0);
65019
65121
  if (exitCode === 0 && contextOptions && typeof contextOptions !== "function" && contextOptions.error) {
65020
65122
  exitCode = 1;
65021
65123
  }
@@ -65075,92 +65177,20 @@ Expecting one of '${allowedValues.join("', '")}'`);
65075
65177
  }
65076
65178
  }
65077
65179
  };
65078
- function incrementNodeInspectorPort(args2) {
65079
- return args2.map((arg) => {
65080
- if (!arg.startsWith("--inspect")) {
65081
- return arg;
65082
- }
65083
- let debugOption;
65084
- let debugHost = "127.0.0.1";
65085
- let debugPort = "9229";
65086
- let match;
65087
- if ((match = arg.match(/^(--inspect(-brk)?)$/)) !== null) {
65088
- debugOption = match[1];
65089
- } else if ((match = arg.match(/^(--inspect(-brk|-port)?)=([^:]+)$/)) !== null) {
65090
- debugOption = match[1];
65091
- if (/^\d+$/.test(match[3])) {
65092
- debugPort = match[3];
65093
- } else {
65094
- debugHost = match[3];
65095
- }
65096
- } else if ((match = arg.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/)) !== null) {
65097
- debugOption = match[1];
65098
- debugHost = match[3];
65099
- debugPort = match[4];
65100
- }
65101
- if (debugOption && debugPort !== "0") {
65102
- return `${debugOption}=${debugHost}:${parseInt(debugPort) + 1}`;
65103
- }
65104
- return arg;
65105
- });
65106
- }
65107
- function useColor() {
65108
- if (process11.env.NO_COLOR || process11.env.FORCE_COLOR === "0" || process11.env.FORCE_COLOR === "false")
65109
- return false;
65110
- if (process11.env.FORCE_COLOR || process11.env.CLICOLOR_FORCE !== void 0)
65111
- return true;
65112
- return void 0;
65113
- }
65114
- exports.Command = Command3;
65115
- exports.useColor = useColor;
65116
65180
  }
65117
65181
  });
65118
65182
 
65119
- // node_modules/.pnpm/commander@14.0.3/node_modules/commander/index.js
65120
- var require_commander = __commonJS({
65121
- "node_modules/.pnpm/commander@14.0.3/node_modules/commander/index.js"(exports) {
65183
+ // node_modules/.pnpm/commander@15.0.0/node_modules/commander/index.js
65184
+ var program;
65185
+ var init_commander = __esm({
65186
+ "node_modules/.pnpm/commander@15.0.0/node_modules/commander/index.js"() {
65122
65187
  init_define_WEB_FIRST_SEGMENTS();
65123
- var { Argument: Argument2 } = require_argument();
65124
- var { Command: Command3 } = require_command();
65125
- var { CommanderError: CommanderError2, InvalidArgumentError: InvalidArgumentError2 } = require_error();
65126
- var { Help: Help2 } = require_help();
65127
- var { Option: Option2 } = require_option();
65128
- exports.program = new Command3();
65129
- exports.createCommand = (name) => new Command3(name);
65130
- exports.createOption = (flags, description) => new Option2(flags, description);
65131
- exports.createArgument = (name, description) => new Argument2(name, description);
65132
- exports.Command = Command3;
65133
- exports.Option = Option2;
65134
- exports.Argument = Argument2;
65135
- exports.Help = Help2;
65136
- exports.CommanderError = CommanderError2;
65137
- exports.InvalidArgumentError = InvalidArgumentError2;
65138
- exports.InvalidOptionArgumentError = InvalidArgumentError2;
65139
- }
65140
- });
65141
-
65142
- // node_modules/.pnpm/commander@14.0.3/node_modules/commander/esm.mjs
65143
- var import_index2, program, createCommand, createArgument, createOption, CommanderError, InvalidArgumentError, InvalidOptionArgumentError, Command2, Argument, Option, Help;
65144
- var init_esm3 = __esm({
65145
- "node_modules/.pnpm/commander@14.0.3/node_modules/commander/esm.mjs"() {
65146
- init_define_WEB_FIRST_SEGMENTS();
65147
- import_index2 = __toESM(require_commander(), 1);
65148
- ({
65149
- program,
65150
- createCommand,
65151
- createArgument,
65152
- createOption,
65153
- CommanderError,
65154
- InvalidArgumentError,
65155
- InvalidOptionArgumentError,
65156
- Command: (
65157
- // deprecated old name
65158
- Command2
65159
- ),
65160
- Argument,
65161
- Option,
65162
- Help
65163
- } = import_index2.default);
65188
+ init_argument();
65189
+ init_command();
65190
+ init_error();
65191
+ init_help();
65192
+ init_option();
65193
+ program = new Command2();
65164
65194
  }
65165
65195
  });
65166
65196
 
@@ -65285,12 +65315,12 @@ var init_signals = __esm({
65285
65315
  });
65286
65316
 
65287
65317
  // node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/index.js
65288
- var processOk, kExitEmitter, global, ObjectDefineProperty, Emitter, SignalExitBase, signalExitWrap, SignalExitFallback, SignalExit, process5, onExit, load, unload;
65318
+ var processOk, kExitEmitter, global, ObjectDefineProperty, Emitter, SignalExitBase, signalExitWrap, SignalExitFallback, SignalExit, process6, onExit, load, unload;
65289
65319
  var init_mjs = __esm({
65290
65320
  "node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/index.js"() {
65291
65321
  init_define_WEB_FIRST_SEGMENTS();
65292
65322
  init_signals();
65293
- 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";
65323
+ 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";
65294
65324
  kExitEmitter = /* @__PURE__ */ Symbol.for("signal-exit emitter");
65295
65325
  global = globalThis;
65296
65326
  ObjectDefineProperty = Object.defineProperty.bind(Object);
@@ -65375,7 +65405,7 @@ var init_mjs = __esm({
65375
65405
  // "SIGHUP" throws an `ENOSYS` error on Windows,
65376
65406
  // so use a supported signal instead
65377
65407
  /* c8 ignore start */
65378
- #hupSig = process5.platform === "win32" ? "SIGINT" : "SIGHUP";
65408
+ #hupSig = process6.platform === "win32" ? "SIGINT" : "SIGHUP";
65379
65409
  /* c8 ignore stop */
65380
65410
  #emitter = new Emitter();
65381
65411
  #process;
@@ -65383,15 +65413,15 @@ var init_mjs = __esm({
65383
65413
  #originalProcessReallyExit;
65384
65414
  #sigListeners = {};
65385
65415
  #loaded = false;
65386
- constructor(process11) {
65416
+ constructor(process12) {
65387
65417
  super();
65388
- this.#process = process11;
65418
+ this.#process = process12;
65389
65419
  this.#sigListeners = {};
65390
65420
  for (const sig of signals) {
65391
65421
  this.#sigListeners[sig] = () => {
65392
65422
  const listeners = this.#process.listeners(sig);
65393
65423
  let { count } = this.#emitter;
65394
- const p2 = process11;
65424
+ const p2 = process12;
65395
65425
  if (typeof p2.__signal_exit_emitter__ === "object" && typeof p2.__signal_exit_emitter__.count === "number") {
65396
65426
  count += p2.__signal_exit_emitter__.count;
65397
65427
  }
@@ -65400,12 +65430,12 @@ var init_mjs = __esm({
65400
65430
  const ret = this.#emitter.emit("exit", null, sig);
65401
65431
  const s = sig === "SIGHUP" ? this.#hupSig : sig;
65402
65432
  if (!ret)
65403
- process11.kill(process11.pid, s);
65433
+ process12.kill(process12.pid, s);
65404
65434
  }
65405
65435
  };
65406
65436
  }
65407
- this.#originalProcessReallyExit = process11.reallyExit;
65408
- this.#originalProcessEmit = process11.emit;
65437
+ this.#originalProcessReallyExit = process12.reallyExit;
65438
+ this.#originalProcessEmit = process12.emit;
65409
65439
  }
65410
65440
  onExit(cb, opts) {
65411
65441
  if (!processOk(this.#process)) {
@@ -65486,7 +65516,7 @@ var init_mjs = __esm({
65486
65516
  }
65487
65517
  }
65488
65518
  };
65489
- process5 = globalThis.process;
65519
+ process6 = globalThis.process;
65490
65520
  ({
65491
65521
  onExit: (
65492
65522
  /**
@@ -65520,19 +65550,19 @@ var init_mjs = __esm({
65520
65550
  */
65521
65551
  unload
65522
65552
  )
65523
- } = signalExitWrap(processOk(process5) ? new SignalExit(process5) : new SignalExitFallback()));
65553
+ } = signalExitWrap(processOk(process6) ? new SignalExit(process6) : new SignalExitFallback()));
65524
65554
  }
65525
65555
  });
65526
65556
 
65527
65557
  // node_modules/.pnpm/restore-cursor@5.1.0/node_modules/restore-cursor/index.js
65528
- import process6 from "node:process";
65558
+ import process7 from "node:process";
65529
65559
  var terminal, restoreCursor, restore_cursor_default;
65530
65560
  var init_restore_cursor = __esm({
65531
65561
  "node_modules/.pnpm/restore-cursor@5.1.0/node_modules/restore-cursor/index.js"() {
65532
65562
  init_define_WEB_FIRST_SEGMENTS();
65533
65563
  init_onetime();
65534
65564
  init_mjs();
65535
- terminal = process6.stderr.isTTY ? process6.stderr : process6.stdout.isTTY ? process6.stdout : void 0;
65565
+ terminal = process7.stderr.isTTY ? process7.stderr : process7.stdout.isTTY ? process7.stdout : void 0;
65536
65566
  restoreCursor = terminal ? onetime_default(() => {
65537
65567
  onExit(() => {
65538
65568
  terminal.write("\x1B[?25h");
@@ -65544,7 +65574,7 @@ var init_restore_cursor = __esm({
65544
65574
  });
65545
65575
 
65546
65576
  // node_modules/.pnpm/cli-cursor@5.0.0/node_modules/cli-cursor/index.js
65547
- import process7 from "node:process";
65577
+ import process8 from "node:process";
65548
65578
  var isHidden, cliCursor, cli_cursor_default;
65549
65579
  var init_cli_cursor = __esm({
65550
65580
  "node_modules/.pnpm/cli-cursor@5.0.0/node_modules/cli-cursor/index.js"() {
@@ -65552,14 +65582,14 @@ var init_cli_cursor = __esm({
65552
65582
  init_restore_cursor();
65553
65583
  isHidden = false;
65554
65584
  cliCursor = {};
65555
- cliCursor.show = (writableStream = process7.stderr) => {
65585
+ cliCursor.show = (writableStream = process8.stderr) => {
65556
65586
  if (!writableStream.isTTY) {
65557
65587
  return;
65558
65588
  }
65559
65589
  isHidden = false;
65560
65590
  writableStream.write("\x1B[?25h");
65561
65591
  };
65562
- cliCursor.hide = (writableStream = process7.stderr) => {
65592
+ cliCursor.hide = (writableStream = process8.stderr) => {
65563
65593
  if (!writableStream.isTTY) {
65564
65594
  return;
65565
65595
  }
@@ -67382,11 +67412,11 @@ var init_yoctocolors = __esm({
67382
67412
  });
67383
67413
 
67384
67414
  // node_modules/.pnpm/is-unicode-supported@2.1.0/node_modules/is-unicode-supported/index.js
67385
- import process8 from "node:process";
67415
+ import process9 from "node:process";
67386
67416
  function isUnicodeSupported() {
67387
- const { env: env2 } = process8;
67417
+ const { env: env2 } = process9;
67388
67418
  const { TERM, TERM_PROGRAM } = env2;
67389
- if (process8.platform !== "win32") {
67419
+ if (process9.platform !== "win32") {
67390
67420
  return TERM !== "linux";
67391
67421
  }
67392
67422
  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";
@@ -67716,7 +67746,7 @@ var init_is_interactive = __esm({
67716
67746
  });
67717
67747
 
67718
67748
  // node_modules/.pnpm/stdin-discarder@0.3.2/node_modules/stdin-discarder/index.js
67719
- import process9 from "node:process";
67749
+ import process10 from "node:process";
67720
67750
  var ASCII_ETX_CODE, StdinDiscarder, stdinDiscarder, stdin_discarder_default;
67721
67751
  var init_stdin_discarder = __esm({
67722
67752
  "node_modules/.pnpm/stdin-discarder@0.3.2/node_modules/stdin-discarder/index.js"() {
@@ -67733,7 +67763,7 @@ var init_stdin_discarder = __esm({
67733
67763
  }
67734
67764
  const code = typeof chunk === "string" ? chunk.codePointAt(0) : chunk[0];
67735
67765
  if (code === ASCII_ETX_CODE) {
67736
- process9.kill(process9.pid, "SIGINT");
67766
+ process10.kill(process10.pid, "SIGINT");
67737
67767
  }
67738
67768
  };
67739
67769
  start() {
@@ -67751,8 +67781,8 @@ var init_stdin_discarder = __esm({
67751
67781
  }
67752
67782
  }
67753
67783
  #realStart() {
67754
- const { stdin } = process9;
67755
- if (process9.platform === "win32" || !stdin?.isTTY || typeof stdin.setRawMode !== "function") {
67784
+ const { stdin } = process10;
67785
+ if (process10.platform === "win32" || !stdin?.isTTY || typeof stdin.setRawMode !== "function") {
67756
67786
  this.#stdin = void 0;
67757
67787
  return;
67758
67788
  }
@@ -67788,8 +67818,8 @@ var init_stdin_discarder = __esm({
67788
67818
  });
67789
67819
 
67790
67820
  // node_modules/.pnpm/ora@9.4.0/node_modules/ora/index.js
67791
- import process10 from "node:process";
67792
- import { stripVTControlCharacters } from "node:util";
67821
+ import process11 from "node:process";
67822
+ import { stripVTControlCharacters as stripVTControlCharacters3 } from "node:util";
67793
67823
  function ora(options) {
67794
67824
  return new Ora(options);
67795
67825
  }
@@ -67895,7 +67925,7 @@ var init_ora = __esm({
67895
67925
  }
67896
67926
  this.#options = {
67897
67927
  color: "cyan",
67898
- stream: process10.stderr,
67928
+ stream: process11.stderr,
67899
67929
  discardStdin: true,
67900
67930
  hideCursor: true,
67901
67931
  ...options
@@ -67918,7 +67948,7 @@ var init_ora = __esm({
67918
67948
  this.prefixText = this.#options.prefixText;
67919
67949
  this.suffixText = this.#options.suffixText;
67920
67950
  this.indent = this.#options.indent;
67921
- if (process10.env.NODE_ENV === "test") {
67951
+ if (process11.env.NODE_ENV === "test") {
67922
67952
  this._stream = this.#stream;
67923
67953
  this._isEnabled = this.#options.isEnabled;
67924
67954
  Object.defineProperty(this, "_linesToClear", {
@@ -68020,7 +68050,7 @@ var init_ora = __esm({
68020
68050
  }
68021
68051
  #computeLineCountFrom(text, columns) {
68022
68052
  let count = 0;
68023
- for (const line of stripVTControlCharacters(text).split("\n")) {
68053
+ for (const line of stripVTControlCharacters3(text).split("\n")) {
68024
68054
  count += Math.max(1, Math.ceil(stringWidth(line) / columns));
68025
68055
  }
68026
68056
  return count;
@@ -68108,7 +68138,7 @@ var init_ora = __esm({
68108
68138
  if (!this.isEnabled || this.#hookedStreams.size > 0) {
68109
68139
  return;
68110
68140
  }
68111
- const streamsToHook = /* @__PURE__ */ new Set([this.#stream, process10.stdout, process10.stderr]);
68141
+ const streamsToHook = /* @__PURE__ */ new Set([this.#stream, process11.stdout, process11.stderr]);
68112
68142
  for (const stream of streamsToHook) {
68113
68143
  this.#hookStream(stream);
68114
68144
  }
@@ -68203,7 +68233,7 @@ var init_ora = __esm({
68203
68233
  if (this.#options.hideCursor) {
68204
68234
  cli_cursor_default.hide(this.#stream);
68205
68235
  }
68206
- if (this.#options.discardStdin && process10.stdin.isTTY) {
68236
+ if (this.#options.discardStdin && process11.stdin.isTTY) {
68207
68237
  stdin_discarder_default.start();
68208
68238
  this.#isDiscardingStdin = true;
68209
68239
  }
@@ -68733,8 +68763,8 @@ __export(cli_exports, {
68733
68763
  promptYesNo: () => promptYesNo,
68734
68764
  runCli: () => runCli
68735
68765
  });
68736
- import * as fs13 from "node:fs";
68737
- import * as path18 from "node:path";
68766
+ import * as fs14 from "node:fs";
68767
+ import * as path19 from "node:path";
68738
68768
  function validateCheckNames(names, source) {
68739
68769
  const invalid = names.filter((n7) => n7 && !VALID_CHECKS.has(n7));
68740
68770
  if (invalid.length > 0) {
@@ -68757,7 +68787,7 @@ async function runCli() {
68757
68787
  "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])",
68758
68788
  false
68759
68789
  ).option("--no-ignore-file", "Disable .ctxlintignore suppression (see all findings)").option("--watch", "Re-lint on context file changes", false).action(async (projectPath, opts) => {
68760
- const resolvedPath = path18.resolve(projectPath);
68790
+ const resolvedPath = path19.resolve(projectPath);
68761
68791
  const { config: config2, options, activeChecks } = resolveSession(resolvedPath, opts);
68762
68792
  const spinner = options.format === "text" && !options.quiet ? ora("Scanning for context files...").start() : void 0;
68763
68793
  try {
@@ -68888,41 +68918,41 @@ Fixed ${applied.totalFixes} issue${applied.totalFixes !== 1 ? "s" : ""} in ${app
68888
68918
  const chalk2 = (await Promise.resolve().then(() => (init_source(), source_exports))).default;
68889
68919
  console.log(chalk2.dim("\nWatching for changes... (Ctrl+C to stop)\n"));
68890
68920
  const watchPaths = [
68891
- path18.join(resolvedPath, "CLAUDE.md"),
68892
- path18.join(resolvedPath, "CLAUDE.local.md"),
68893
- path18.join(resolvedPath, "AGENTS.md"),
68894
- path18.join(resolvedPath, "AGENT.md"),
68895
- path18.join(resolvedPath, ".cursorrules"),
68896
- path18.join(resolvedPath, ".windsurfrules"),
68897
- path18.join(resolvedPath, ".clinerules"),
68898
- path18.join(resolvedPath, ".aiderules"),
68899
- path18.join(resolvedPath, ".continuerules"),
68900
- path18.join(resolvedPath, ".rules"),
68901
- path18.join(resolvedPath, ".goosehints"),
68902
- path18.join(resolvedPath, "GEMINI.md"),
68903
- path18.join(resolvedPath, "replit.md"),
68904
- path18.join(resolvedPath, "package.json"),
68905
- path18.join(resolvedPath, ".mcp.json"),
68921
+ path19.join(resolvedPath, "CLAUDE.md"),
68922
+ path19.join(resolvedPath, "CLAUDE.local.md"),
68923
+ path19.join(resolvedPath, "AGENTS.md"),
68924
+ path19.join(resolvedPath, "AGENT.md"),
68925
+ path19.join(resolvedPath, ".cursorrules"),
68926
+ path19.join(resolvedPath, ".windsurfrules"),
68927
+ path19.join(resolvedPath, ".clinerules"),
68928
+ path19.join(resolvedPath, ".aiderules"),
68929
+ path19.join(resolvedPath, ".continuerules"),
68930
+ path19.join(resolvedPath, ".rules"),
68931
+ path19.join(resolvedPath, ".goosehints"),
68932
+ path19.join(resolvedPath, "GEMINI.md"),
68933
+ path19.join(resolvedPath, "replit.md"),
68934
+ path19.join(resolvedPath, "package.json"),
68935
+ path19.join(resolvedPath, ".mcp.json"),
68906
68936
  // ctxlint config — re-resolve on edit so threshold changes,
68907
68937
  // ignore-list edits, and check-list overrides take effect without
68908
68938
  // restarting the watcher.
68909
- path18.join(resolvedPath, ".ctxlintrc"),
68910
- path18.join(resolvedPath, ".ctxlintrc.json"),
68939
+ path19.join(resolvedPath, ".ctxlintrc"),
68940
+ path19.join(resolvedPath, ".ctxlintrc.json"),
68911
68941
  // .ctxlintignore — re-lint when suppression rules change.
68912
- path18.join(resolvedPath, ".ctxlintignore")
68942
+ path19.join(resolvedPath, ".ctxlintignore")
68913
68943
  ];
68914
68944
  const watchDirs = [
68915
- path18.join(resolvedPath, ".claude"),
68916
- path18.join(resolvedPath, ".cursor"),
68917
- path18.join(resolvedPath, ".github"),
68918
- path18.join(resolvedPath, ".windsurf"),
68919
- path18.join(resolvedPath, ".aide"),
68920
- path18.join(resolvedPath, ".amazonq"),
68921
- path18.join(resolvedPath, ".goose"),
68922
- path18.join(resolvedPath, ".junie"),
68923
- path18.join(resolvedPath, ".aiassistant"),
68924
- path18.join(resolvedPath, ".continue"),
68925
- path18.join(resolvedPath, ".vscode")
68945
+ path19.join(resolvedPath, ".claude"),
68946
+ path19.join(resolvedPath, ".cursor"),
68947
+ path19.join(resolvedPath, ".github"),
68948
+ path19.join(resolvedPath, ".windsurf"),
68949
+ path19.join(resolvedPath, ".aide"),
68950
+ path19.join(resolvedPath, ".amazonq"),
68951
+ path19.join(resolvedPath, ".goose"),
68952
+ path19.join(resolvedPath, ".junie"),
68953
+ path19.join(resolvedPath, ".aiassistant"),
68954
+ path19.join(resolvedPath, ".continue"),
68955
+ path19.join(resolvedPath, ".vscode")
68926
68956
  ];
68927
68957
  const watchers = [];
68928
68958
  let debounceTimer = null;
@@ -68984,13 +69014,13 @@ Fixed ${applied.totalFixes} issue${applied.totalFixes !== 1 ? "s" : ""} in ${app
68984
69014
  };
68985
69015
  for (const filePath of watchPaths) {
68986
69016
  try {
68987
- watchers.push(fs13.watch(filePath, rerun));
69017
+ watchers.push(fs14.watch(filePath, rerun));
68988
69018
  } catch {
68989
69019
  }
68990
69020
  }
68991
69021
  for (const dir of watchDirs) {
68992
69022
  try {
68993
- watchers.push(fs13.watch(dir, { recursive: true }, rerun));
69023
+ watchers.push(fs14.watch(dir, { recursive: true }, rerun));
68994
69024
  } catch {
68995
69025
  }
68996
69026
  }
@@ -69011,17 +69041,17 @@ Fixed ${applied.totalFixes} issue${applied.totalFixes !== 1 ? "s" : ""} in ${app
69011
69041
  }
69012
69042
  });
69013
69043
  program2.command("init").description("Set up a git pre-commit hook that runs ctxlint --strict").argument("[path]", "Project directory", ".").action(async (projectPath) => {
69014
- const resolvedRoot = path18.resolve(projectPath);
69015
- const gitDir = path18.join(resolvedRoot, ".git");
69016
- const hooksDir = path18.join(gitDir, "hooks");
69017
- if (!fs13.existsSync(gitDir)) {
69044
+ const resolvedRoot = path19.resolve(projectPath);
69045
+ const gitDir = path19.join(resolvedRoot, ".git");
69046
+ const hooksDir = path19.join(gitDir, "hooks");
69047
+ if (!fs14.existsSync(gitDir)) {
69018
69048
  console.error('Error: not a git repository. Run "git init" first.');
69019
69049
  process.exit(1);
69020
69050
  }
69021
- if (!fs13.existsSync(hooksDir)) {
69022
- fs13.mkdirSync(hooksDir, { recursive: true });
69051
+ if (!fs14.existsSync(hooksDir)) {
69052
+ fs14.mkdirSync(hooksDir, { recursive: true });
69023
69053
  }
69024
- const hookPath = path18.join(hooksDir, "pre-commit");
69054
+ const hookPath = path19.join(hooksDir, "pre-commit");
69025
69055
  const fullHookContent = `#!/bin/sh
69026
69056
  # ctxlint pre-commit hook
69027
69057
  npx @yawlabs/ctxlint@${VERSION} --strict
@@ -69030,15 +69060,15 @@ npx @yawlabs/ctxlint@${VERSION} --strict
69030
69060
  # ctxlint pre-commit hook
69031
69061
  npx @yawlabs/ctxlint@${VERSION} --strict
69032
69062
  `;
69033
- if (fs13.existsSync(hookPath)) {
69034
- const existing = fs13.readFileSync(hookPath, "utf-8");
69063
+ if (fs14.existsSync(hookPath)) {
69064
+ const existing = fs14.readFileSync(hookPath, "utf-8");
69035
69065
  const installed = existing.match(
69036
69066
  /^[^#\r\n]*\bnpx\s+(?:-y\s+|--yes\s+)?@yawlabs\/ctxlint(?:@(\d+\.\d+\.\d+))?/m
69037
69067
  );
69038
69068
  if (installed) {
69039
69069
  const pinned = installed[1];
69040
69070
  if (pinned && pinned !== VERSION) {
69041
- fs13.writeFileSync(
69071
+ fs14.writeFileSync(
69042
69072
  hookPath,
69043
69073
  existing.replace(/(@yawlabs\/ctxlint@)\d+\.\d+\.\d+/g, `$1${VERSION}`)
69044
69074
  );
@@ -69048,10 +69078,10 @@ npx @yawlabs/ctxlint@${VERSION} --strict
69048
69078
  }
69049
69079
  return;
69050
69080
  }
69051
- fs13.appendFileSync(hookPath, appendHookContent);
69081
+ fs14.appendFileSync(hookPath, appendHookContent);
69052
69082
  console.log("Added ctxlint to existing pre-commit hook.");
69053
69083
  } else {
69054
- fs13.writeFileSync(hookPath, fullHookContent, { mode: 493 });
69084
+ fs14.writeFileSync(hookPath, fullHookContent, { mode: 493 });
69055
69085
  console.log("Created pre-commit hook at .git/hooks/pre-commit");
69056
69086
  }
69057
69087
  console.log("ctxlint will now run automatically before each commit.");
@@ -69073,7 +69103,7 @@ function resolveDepth(raw) {
69073
69103
  return Number.isNaN(parsed) ? 2 : Math.max(0, Math.min(parsed, 10));
69074
69104
  }
69075
69105
  function resolveSession(resolvedPath, opts, throwOnConfigError = false) {
69076
- const configPath = opts.config ? path18.resolve(opts.config) : void 0;
69106
+ const configPath = opts.config ? path19.resolve(opts.config) : void 0;
69077
69107
  const config2 = configPath ? loadConfigFromPath(configPath, throwOnConfigError) : loadConfig(resolvedPath);
69078
69108
  const mcpGlobal = opts.mcpGlobal || config2?.mcpGlobal || false;
69079
69109
  const mcpOnly = opts.mcpOnly || config2?.mcpOnly || false;
@@ -69157,7 +69187,7 @@ var init_cli = __esm({
69157
69187
  "src/cli.ts"() {
69158
69188
  "use strict";
69159
69189
  init_define_WEB_FIRST_SEGMENTS();
69160
- init_esm3();
69190
+ init_commander();
69161
69191
  init_ora();
69162
69192
  init_paths();
69163
69193
  init_cache();