dev-cockpit 0.3.1 → 0.3.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
@@ -294,8 +294,8 @@ var require_req = __commonJS({
294
294
  if (req.originalUrl) {
295
295
  _req.url = req.originalUrl;
296
296
  } else {
297
- const path23 = req.path;
298
- _req.url = typeof path23 === "string" ? path23 : req.url ? req.url.path || req.url : void 0;
297
+ const path26 = req.path;
298
+ _req.url = typeof path26 === "string" ? path26 : req.url ? req.url.path || req.url : void 0;
299
299
  }
300
300
  if (req.query) {
301
301
  _req.query = req.query;
@@ -460,14 +460,14 @@ var require_redact = __commonJS({
460
460
  }
461
461
  return obj;
462
462
  }
463
- function parsePath(path23) {
463
+ function parsePath(path26) {
464
464
  const parts = [];
465
465
  let current = "";
466
466
  let inBrackets = false;
467
467
  let inQuotes = false;
468
468
  let quoteChar = "";
469
- for (let i2 = 0; i2 < path23.length; i2++) {
470
- const char = path23[i2];
469
+ for (let i2 = 0; i2 < path26.length; i2++) {
470
+ const char = path26[i2];
471
471
  if (!inBrackets && char === ".") {
472
472
  if (current) {
473
473
  parts.push(current);
@@ -598,10 +598,10 @@ var require_redact = __commonJS({
598
598
  return current;
599
599
  }
600
600
  function redactPaths(obj, paths, censor, remove = false) {
601
- for (const path23 of paths) {
602
- const parts = parsePath(path23);
601
+ for (const path26 of paths) {
602
+ const parts = parsePath(path26);
603
603
  if (parts.includes("*")) {
604
- redactWildcardPath(obj, parts, censor, path23, remove);
604
+ redactWildcardPath(obj, parts, censor, path26, remove);
605
605
  } else {
606
606
  if (remove) {
607
607
  removeKey(obj, parts);
@@ -686,8 +686,8 @@ var require_redact = __commonJS({
686
686
  }
687
687
  } else {
688
688
  if (afterWildcard.includes("*")) {
689
- const wrappedCensor = typeof censor === "function" ? (value, path23) => {
690
- const fullPath = [...pathArray.slice(0, pathLength), ...path23];
689
+ const wrappedCensor = typeof censor === "function" ? (value, path26) => {
690
+ const fullPath = [...pathArray.slice(0, pathLength), ...path26];
691
691
  return censor(value, fullPath);
692
692
  } : censor;
693
693
  redactWildcardPath(current, afterWildcard, wrappedCensor, originalPath, remove);
@@ -722,8 +722,8 @@ var require_redact = __commonJS({
722
722
  return null;
723
723
  }
724
724
  const pathStructure = /* @__PURE__ */ new Map();
725
- for (const path23 of pathsToClone) {
726
- const parts = parsePath(path23);
725
+ for (const path26 of pathsToClone) {
726
+ const parts = parsePath(path26);
727
727
  let current = pathStructure;
728
728
  for (let i2 = 0; i2 < parts.length; i2++) {
729
729
  const part = parts[i2];
@@ -775,24 +775,24 @@ var require_redact = __commonJS({
775
775
  }
776
776
  return cloneSelectively(obj, pathStructure);
777
777
  }
778
- function validatePath(path23) {
779
- if (typeof path23 !== "string") {
778
+ function validatePath(path26) {
779
+ if (typeof path26 !== "string") {
780
780
  throw new Error("Paths must be (non-empty) strings");
781
781
  }
782
- if (path23 === "") {
782
+ if (path26 === "") {
783
783
  throw new Error("Invalid redaction path ()");
784
784
  }
785
- if (path23.includes("..")) {
786
- throw new Error(`Invalid redaction path (${path23})`);
785
+ if (path26.includes("..")) {
786
+ throw new Error(`Invalid redaction path (${path26})`);
787
787
  }
788
- if (path23.includes(",")) {
789
- throw new Error(`Invalid redaction path (${path23})`);
788
+ if (path26.includes(",")) {
789
+ throw new Error(`Invalid redaction path (${path26})`);
790
790
  }
791
791
  let bracketCount = 0;
792
792
  let inQuotes = false;
793
793
  let quoteChar = "";
794
- for (let i2 = 0; i2 < path23.length; i2++) {
795
- const char = path23[i2];
794
+ for (let i2 = 0; i2 < path26.length; i2++) {
795
+ const char = path26[i2];
796
796
  if ((char === '"' || char === "'") && bracketCount > 0) {
797
797
  if (!inQuotes) {
798
798
  inQuotes = true;
@@ -806,20 +806,20 @@ var require_redact = __commonJS({
806
806
  } else if (char === "]" && !inQuotes) {
807
807
  bracketCount--;
808
808
  if (bracketCount < 0) {
809
- throw new Error(`Invalid redaction path (${path23})`);
809
+ throw new Error(`Invalid redaction path (${path26})`);
810
810
  }
811
811
  }
812
812
  }
813
813
  if (bracketCount !== 0) {
814
- throw new Error(`Invalid redaction path (${path23})`);
814
+ throw new Error(`Invalid redaction path (${path26})`);
815
815
  }
816
816
  }
817
817
  function validatePaths(paths) {
818
818
  if (!Array.isArray(paths)) {
819
819
  throw new TypeError("paths must be an array");
820
820
  }
821
- for (const path23 of paths) {
822
- validatePath(path23);
821
+ for (const path26 of paths) {
822
+ validatePath(path26);
823
823
  }
824
824
  }
825
825
  function slowRedact(options2 = {}) {
@@ -987,8 +987,8 @@ var require_redaction = __commonJS({
987
987
  if (shape[k] === null) {
988
988
  o2[k] = (value) => topCensor(value, [k]);
989
989
  } else {
990
- const wrappedCensor = typeof censor === "function" ? (value, path23) => {
991
- return censor(value, [k, ...path23]);
990
+ const wrappedCensor = typeof censor === "function" ? (value, path26) => {
991
+ return censor(value, [k, ...path26]);
992
992
  } : censor;
993
993
  o2[k] = Redact({
994
994
  paths: shape[k],
@@ -1206,10 +1206,10 @@ var require_atomic_sleep = __commonJS({
1206
1206
  var require_sonic_boom = __commonJS({
1207
1207
  "node_modules/sonic-boom/index.js"(exports, module) {
1208
1208
  "use strict";
1209
- var fs18 = __require("fs");
1209
+ var fs19 = __require("fs");
1210
1210
  var EventEmitter3 = __require("events");
1211
1211
  var inherits = __require("util").inherits;
1212
- var path23 = __require("path");
1212
+ var path26 = __require("path");
1213
1213
  var sleep = require_atomic_sleep();
1214
1214
  var assert = __require("assert");
1215
1215
  var BUSY_WRITE_TIMEOUT = 100;
@@ -1263,20 +1263,20 @@ var require_sonic_boom = __commonJS({
1263
1263
  const mode = sonic.mode;
1264
1264
  if (sonic.sync) {
1265
1265
  try {
1266
- if (sonic.mkdir) fs18.mkdirSync(path23.dirname(file), { recursive: true });
1267
- const fd = fs18.openSync(file, flags, mode);
1266
+ if (sonic.mkdir) fs19.mkdirSync(path26.dirname(file), { recursive: true });
1267
+ const fd = fs19.openSync(file, flags, mode);
1268
1268
  fileOpened(null, fd);
1269
1269
  } catch (err) {
1270
1270
  fileOpened(err);
1271
1271
  throw err;
1272
1272
  }
1273
1273
  } else if (sonic.mkdir) {
1274
- fs18.mkdir(path23.dirname(file), { recursive: true }, (err) => {
1274
+ fs19.mkdir(path26.dirname(file), { recursive: true }, (err) => {
1275
1275
  if (err) return fileOpened(err);
1276
- fs18.open(file, flags, mode, fileOpened);
1276
+ fs19.open(file, flags, mode, fileOpened);
1277
1277
  });
1278
1278
  } else {
1279
- fs18.open(file, flags, mode, fileOpened);
1279
+ fs19.open(file, flags, mode, fileOpened);
1280
1280
  }
1281
1281
  }
1282
1282
  function SonicBoom(opts) {
@@ -1317,8 +1317,8 @@ var require_sonic_boom = __commonJS({
1317
1317
  this.flush = flushBuffer;
1318
1318
  this.flushSync = flushBufferSync;
1319
1319
  this._actualWrite = actualWriteBuffer;
1320
- fsWriteSync = () => fs18.writeSync(this.fd, this._writingBuf);
1321
- fsWrite = () => fs18.write(this.fd, this._writingBuf, this.release);
1320
+ fsWriteSync = () => fs19.writeSync(this.fd, this._writingBuf);
1321
+ fsWrite = () => fs19.write(this.fd, this._writingBuf, this.release);
1322
1322
  } else if (contentMode === void 0 || contentMode === kContentModeUtf8) {
1323
1323
  this._writingBuf = "";
1324
1324
  this.write = write;
@@ -1327,15 +1327,15 @@ var require_sonic_boom = __commonJS({
1327
1327
  this._actualWrite = actualWrite;
1328
1328
  fsWriteSync = () => {
1329
1329
  if (Buffer.isBuffer(this._writingBuf)) {
1330
- return fs18.writeSync(this.fd, this._writingBuf);
1330
+ return fs19.writeSync(this.fd, this._writingBuf);
1331
1331
  }
1332
- return fs18.writeSync(this.fd, this._writingBuf, "utf8");
1332
+ return fs19.writeSync(this.fd, this._writingBuf, "utf8");
1333
1333
  };
1334
1334
  fsWrite = () => {
1335
1335
  if (Buffer.isBuffer(this._writingBuf)) {
1336
- return fs18.write(this.fd, this._writingBuf, this.release);
1336
+ return fs19.write(this.fd, this._writingBuf, this.release);
1337
1337
  }
1338
- return fs18.write(this.fd, this._writingBuf, "utf8", this.release);
1338
+ return fs19.write(this.fd, this._writingBuf, "utf8", this.release);
1339
1339
  };
1340
1340
  } else {
1341
1341
  throw new Error(`SonicBoom supports "${kContentModeUtf8}" and "${kContentModeBuffer}", but passed ${contentMode}`);
@@ -1392,7 +1392,7 @@ var require_sonic_boom = __commonJS({
1392
1392
  }
1393
1393
  }
1394
1394
  if (this._fsync) {
1395
- fs18.fsyncSync(this.fd);
1395
+ fs19.fsyncSync(this.fd);
1396
1396
  }
1397
1397
  const len = this._len;
1398
1398
  if (this._reopening) {
@@ -1506,7 +1506,7 @@ var require_sonic_boom = __commonJS({
1506
1506
  const onDrain = () => {
1507
1507
  if (!this._fsync) {
1508
1508
  try {
1509
- fs18.fsync(this.fd, (err) => {
1509
+ fs19.fsync(this.fd, (err) => {
1510
1510
  this._flushPending = false;
1511
1511
  cb(err);
1512
1512
  });
@@ -1608,7 +1608,7 @@ var require_sonic_boom = __commonJS({
1608
1608
  const fd = this.fd;
1609
1609
  this.once("ready", () => {
1610
1610
  if (fd !== this.fd) {
1611
- fs18.close(fd, (err) => {
1611
+ fs19.close(fd, (err) => {
1612
1612
  if (err) {
1613
1613
  return this.emit("error", err);
1614
1614
  }
@@ -1657,7 +1657,7 @@ var require_sonic_boom = __commonJS({
1657
1657
  buf = this._bufs[0];
1658
1658
  }
1659
1659
  try {
1660
- const n2 = Buffer.isBuffer(buf) ? fs18.writeSync(this.fd, buf) : fs18.writeSync(this.fd, buf, "utf8");
1660
+ const n2 = Buffer.isBuffer(buf) ? fs19.writeSync(this.fd, buf) : fs19.writeSync(this.fd, buf, "utf8");
1661
1661
  const releasedBufObj = releaseWritingBuf(buf, this._len, n2);
1662
1662
  buf = releasedBufObj.writingBuf;
1663
1663
  this._len = releasedBufObj.len;
@@ -1673,7 +1673,7 @@ var require_sonic_boom = __commonJS({
1673
1673
  }
1674
1674
  }
1675
1675
  try {
1676
- fs18.fsyncSync(this.fd);
1676
+ fs19.fsyncSync(this.fd);
1677
1677
  } catch {
1678
1678
  }
1679
1679
  }
@@ -1694,7 +1694,7 @@ var require_sonic_boom = __commonJS({
1694
1694
  buf = mergeBuf(this._bufs[0], this._lens[0]);
1695
1695
  }
1696
1696
  try {
1697
- const n2 = fs18.writeSync(this.fd, buf);
1697
+ const n2 = fs19.writeSync(this.fd, buf);
1698
1698
  buf = buf.subarray(n2);
1699
1699
  this._len = Math.max(this._len - n2, 0);
1700
1700
  if (buf.length <= 0) {
@@ -1722,13 +1722,13 @@ var require_sonic_boom = __commonJS({
1722
1722
  this._writingBuf = this._writingBuf.length ? this._writingBuf : this._bufs.shift() || "";
1723
1723
  if (this.sync) {
1724
1724
  try {
1725
- const written = Buffer.isBuffer(this._writingBuf) ? fs18.writeSync(this.fd, this._writingBuf) : fs18.writeSync(this.fd, this._writingBuf, "utf8");
1725
+ const written = Buffer.isBuffer(this._writingBuf) ? fs19.writeSync(this.fd, this._writingBuf) : fs19.writeSync(this.fd, this._writingBuf, "utf8");
1726
1726
  release(null, written);
1727
1727
  } catch (err) {
1728
1728
  release(err);
1729
1729
  }
1730
1730
  } else {
1731
- fs18.write(this.fd, this._writingBuf, release);
1731
+ fs19.write(this.fd, this._writingBuf, release);
1732
1732
  }
1733
1733
  }
1734
1734
  function actualWriteBuffer() {
@@ -1737,7 +1737,7 @@ var require_sonic_boom = __commonJS({
1737
1737
  this._writingBuf = this._writingBuf.length ? this._writingBuf : mergeBuf(this._bufs.shift(), this._lens.shift());
1738
1738
  if (this.sync) {
1739
1739
  try {
1740
- const written = fs18.writeSync(this.fd, this._writingBuf);
1740
+ const written = fs19.writeSync(this.fd, this._writingBuf);
1741
1741
  release(null, written);
1742
1742
  } catch (err) {
1743
1743
  release(err);
@@ -1746,7 +1746,7 @@ var require_sonic_boom = __commonJS({
1746
1746
  if (kCopyBuffer) {
1747
1747
  this._writingBuf = Buffer.from(this._writingBuf);
1748
1748
  }
1749
- fs18.write(this.fd, this._writingBuf, release);
1749
+ fs19.write(this.fd, this._writingBuf, release);
1750
1750
  }
1751
1751
  }
1752
1752
  function actualClose(sonic) {
@@ -1762,12 +1762,12 @@ var require_sonic_boom = __commonJS({
1762
1762
  sonic._lens = [];
1763
1763
  assert(typeof sonic.fd === "number", `sonic.fd must be a number, got ${typeof sonic.fd}`);
1764
1764
  try {
1765
- fs18.fsync(sonic.fd, closeWrapped);
1765
+ fs19.fsync(sonic.fd, closeWrapped);
1766
1766
  } catch {
1767
1767
  }
1768
1768
  function closeWrapped() {
1769
1769
  if (sonic.fd !== 1 && sonic.fd !== 2) {
1770
- fs18.close(sonic.fd, done);
1770
+ fs19.close(sonic.fd, done);
1771
1771
  } else {
1772
1772
  done();
1773
1773
  }
@@ -4341,8 +4341,8 @@ var require_windows = __commonJS({
4341
4341
  "node_modules/isexe/windows.js"(exports, module) {
4342
4342
  module.exports = isexe;
4343
4343
  isexe.sync = sync;
4344
- var fs18 = __require("fs");
4345
- function checkPathExt(path23, options2) {
4344
+ var fs19 = __require("fs");
4345
+ function checkPathExt(path26, options2) {
4346
4346
  var pathext = options2.pathExt !== void 0 ? options2.pathExt : process.env.PATHEXT;
4347
4347
  if (!pathext) {
4348
4348
  return true;
@@ -4353,25 +4353,25 @@ var require_windows = __commonJS({
4353
4353
  }
4354
4354
  for (var i2 = 0; i2 < pathext.length; i2++) {
4355
4355
  var p = pathext[i2].toLowerCase();
4356
- if (p && path23.substr(-p.length).toLowerCase() === p) {
4356
+ if (p && path26.substr(-p.length).toLowerCase() === p) {
4357
4357
  return true;
4358
4358
  }
4359
4359
  }
4360
4360
  return false;
4361
4361
  }
4362
- function checkStat(stat4, path23, options2) {
4362
+ function checkStat(stat4, path26, options2) {
4363
4363
  if (!stat4.isSymbolicLink() && !stat4.isFile()) {
4364
4364
  return false;
4365
4365
  }
4366
- return checkPathExt(path23, options2);
4366
+ return checkPathExt(path26, options2);
4367
4367
  }
4368
- function isexe(path23, options2, cb) {
4369
- fs18.stat(path23, function(er, stat4) {
4370
- cb(er, er ? false : checkStat(stat4, path23, options2));
4368
+ function isexe(path26, options2, cb) {
4369
+ fs19.stat(path26, function(er, stat4) {
4370
+ cb(er, er ? false : checkStat(stat4, path26, options2));
4371
4371
  });
4372
4372
  }
4373
- function sync(path23, options2) {
4374
- return checkStat(fs18.statSync(path23), path23, options2);
4373
+ function sync(path26, options2) {
4374
+ return checkStat(fs19.statSync(path26), path26, options2);
4375
4375
  }
4376
4376
  }
4377
4377
  });
@@ -4381,14 +4381,14 @@ var require_mode = __commonJS({
4381
4381
  "node_modules/isexe/mode.js"(exports, module) {
4382
4382
  module.exports = isexe;
4383
4383
  isexe.sync = sync;
4384
- var fs18 = __require("fs");
4385
- function isexe(path23, options2, cb) {
4386
- fs18.stat(path23, function(er, stat4) {
4384
+ var fs19 = __require("fs");
4385
+ function isexe(path26, options2, cb) {
4386
+ fs19.stat(path26, function(er, stat4) {
4387
4387
  cb(er, er ? false : checkStat(stat4, options2));
4388
4388
  });
4389
4389
  }
4390
- function sync(path23, options2) {
4391
- return checkStat(fs18.statSync(path23), options2);
4390
+ function sync(path26, options2) {
4391
+ return checkStat(fs19.statSync(path26), options2);
4392
4392
  }
4393
4393
  function checkStat(stat4, options2) {
4394
4394
  return stat4.isFile() && checkMode(stat4, options2);
@@ -4412,7 +4412,7 @@ var require_mode = __commonJS({
4412
4412
  // node_modules/isexe/index.js
4413
4413
  var require_isexe = __commonJS({
4414
4414
  "node_modules/isexe/index.js"(exports, module) {
4415
- var fs18 = __require("fs");
4415
+ var fs19 = __require("fs");
4416
4416
  var core;
4417
4417
  if (process.platform === "win32" || global.TESTING_WINDOWS) {
4418
4418
  core = require_windows();
@@ -4421,7 +4421,7 @@ var require_isexe = __commonJS({
4421
4421
  }
4422
4422
  module.exports = isexe;
4423
4423
  isexe.sync = sync;
4424
- function isexe(path23, options2, cb) {
4424
+ function isexe(path26, options2, cb) {
4425
4425
  if (typeof options2 === "function") {
4426
4426
  cb = options2;
4427
4427
  options2 = {};
@@ -4431,7 +4431,7 @@ var require_isexe = __commonJS({
4431
4431
  throw new TypeError("callback not provided");
4432
4432
  }
4433
4433
  return new Promise(function(resolve3, reject) {
4434
- isexe(path23, options2 || {}, function(er, is) {
4434
+ isexe(path26, options2 || {}, function(er, is) {
4435
4435
  if (er) {
4436
4436
  reject(er);
4437
4437
  } else {
@@ -4440,7 +4440,7 @@ var require_isexe = __commonJS({
4440
4440
  });
4441
4441
  });
4442
4442
  }
4443
- core(path23, options2 || {}, function(er, is) {
4443
+ core(path26, options2 || {}, function(er, is) {
4444
4444
  if (er) {
4445
4445
  if (er.code === "EACCES" || options2 && options2.ignoreErrors) {
4446
4446
  er = null;
@@ -4450,9 +4450,9 @@ var require_isexe = __commonJS({
4450
4450
  cb(er, is);
4451
4451
  });
4452
4452
  }
4453
- function sync(path23, options2) {
4453
+ function sync(path26, options2) {
4454
4454
  try {
4455
- return core.sync(path23, options2 || {});
4455
+ return core.sync(path26, options2 || {});
4456
4456
  } catch (er) {
4457
4457
  if (options2 && options2.ignoreErrors || er.code === "EACCES") {
4458
4458
  return false;
@@ -4468,7 +4468,7 @@ var require_isexe = __commonJS({
4468
4468
  var require_which = __commonJS({
4469
4469
  "node_modules/which/which.js"(exports, module) {
4470
4470
  var isWindows2 = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
4471
- var path23 = __require("path");
4471
+ var path26 = __require("path");
4472
4472
  var COLON = isWindows2 ? ";" : ":";
4473
4473
  var isexe = require_isexe();
4474
4474
  var getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" });
@@ -4506,7 +4506,7 @@ var require_which = __commonJS({
4506
4506
  return opt.all && found.length ? resolve3(found) : reject(getNotFoundError(cmd));
4507
4507
  const ppRaw = pathEnv[i2];
4508
4508
  const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
4509
- const pCmd = path23.join(pathPart, cmd);
4509
+ const pCmd = path26.join(pathPart, cmd);
4510
4510
  const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
4511
4511
  resolve3(subStep(p, i2, 0));
4512
4512
  });
@@ -4533,7 +4533,7 @@ var require_which = __commonJS({
4533
4533
  for (let i2 = 0; i2 < pathEnv.length; i2++) {
4534
4534
  const ppRaw = pathEnv[i2];
4535
4535
  const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
4536
- const pCmd = path23.join(pathPart, cmd);
4536
+ const pCmd = path26.join(pathPart, cmd);
4537
4537
  const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
4538
4538
  for (let j = 0; j < pathExt.length; j++) {
4539
4539
  const cur = p + pathExt[j];
@@ -4581,7 +4581,7 @@ var require_path_key = __commonJS({
4581
4581
  var require_resolveCommand = __commonJS({
4582
4582
  "node_modules/cross-spawn/lib/util/resolveCommand.js"(exports, module) {
4583
4583
  "use strict";
4584
- var path23 = __require("path");
4584
+ var path26 = __require("path");
4585
4585
  var which = require_which();
4586
4586
  var getPathKey = require_path_key();
4587
4587
  function resolveCommandAttempt(parsed, withoutPathExt) {
@@ -4599,7 +4599,7 @@ var require_resolveCommand = __commonJS({
4599
4599
  try {
4600
4600
  resolved = which.sync(parsed.command, {
4601
4601
  path: env[getPathKey({ env })],
4602
- pathExt: withoutPathExt ? path23.delimiter : void 0
4602
+ pathExt: withoutPathExt ? path26.delimiter : void 0
4603
4603
  });
4604
4604
  } catch (e) {
4605
4605
  } finally {
@@ -4608,7 +4608,7 @@ var require_resolveCommand = __commonJS({
4608
4608
  }
4609
4609
  }
4610
4610
  if (resolved) {
4611
- resolved = path23.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
4611
+ resolved = path26.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
4612
4612
  }
4613
4613
  return resolved;
4614
4614
  }
@@ -4662,8 +4662,8 @@ var require_shebang_command = __commonJS({
4662
4662
  if (!match) {
4663
4663
  return null;
4664
4664
  }
4665
- const [path23, argument] = match[0].replace(/#! ?/, "").split(" ");
4666
- const binary = path23.split("/").pop();
4665
+ const [path26, argument] = match[0].replace(/#! ?/, "").split(" ");
4666
+ const binary = path26.split("/").pop();
4667
4667
  if (binary === "env") {
4668
4668
  return argument;
4669
4669
  }
@@ -4676,16 +4676,16 @@ var require_shebang_command = __commonJS({
4676
4676
  var require_readShebang = __commonJS({
4677
4677
  "node_modules/cross-spawn/lib/util/readShebang.js"(exports, module) {
4678
4678
  "use strict";
4679
- var fs18 = __require("fs");
4679
+ var fs19 = __require("fs");
4680
4680
  var shebangCommand = require_shebang_command();
4681
4681
  function readShebang(command) {
4682
4682
  const size = 150;
4683
4683
  const buffer = Buffer.alloc(size);
4684
4684
  let fd;
4685
4685
  try {
4686
- fd = fs18.openSync(command, "r");
4687
- fs18.readSync(fd, buffer, 0, size, 0);
4688
- fs18.closeSync(fd);
4686
+ fd = fs19.openSync(command, "r");
4687
+ fs19.readSync(fd, buffer, 0, size, 0);
4688
+ fs19.closeSync(fd);
4689
4689
  } catch (e) {
4690
4690
  }
4691
4691
  return shebangCommand(buffer.toString());
@@ -4698,7 +4698,7 @@ var require_readShebang = __commonJS({
4698
4698
  var require_parse = __commonJS({
4699
4699
  "node_modules/cross-spawn/lib/parse.js"(exports, module) {
4700
4700
  "use strict";
4701
- var path23 = __require("path");
4701
+ var path26 = __require("path");
4702
4702
  var resolveCommand = require_resolveCommand();
4703
4703
  var escape3 = require_escape();
4704
4704
  var readShebang = require_readShebang();
@@ -4723,7 +4723,7 @@ var require_parse = __commonJS({
4723
4723
  const needsShell = !isExecutableRegExp.test(commandFile);
4724
4724
  if (parsed.options.forceShell || needsShell) {
4725
4725
  const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
4726
- parsed.command = path23.normalize(parsed.command);
4726
+ parsed.command = path26.normalize(parsed.command);
4727
4727
  parsed.command = escape3.command(parsed.command);
4728
4728
  parsed.args = parsed.args.map((arg) => escape3.argument(arg, needsDoubleEscapeMetaChars));
4729
4729
  const shellCommand = [parsed.command].concat(parsed.args).join(" ");
@@ -4785,14 +4785,14 @@ var require_enoent = __commonJS({
4785
4785
  return originalEmit.apply(cp, arguments);
4786
4786
  };
4787
4787
  }
4788
- function verifyENOENT(status, parsed) {
4789
- if (isWin && status === 1 && !parsed.file) {
4788
+ function verifyENOENT(status4, parsed) {
4789
+ if (isWin && status4 === 1 && !parsed.file) {
4790
4790
  return notFoundError(parsed.original, "spawn");
4791
4791
  }
4792
4792
  return null;
4793
4793
  }
4794
- function verifyENOENTSync(status, parsed) {
4795
- if (isWin && status === 1 && !parsed.file) {
4794
+ function verifyENOENTSync(status4, parsed) {
4795
+ if (isWin && status4 === 1 && !parsed.file) {
4796
4796
  return notFoundError(parsed.original, "spawnSync");
4797
4797
  }
4798
4798
  return null;
@@ -4910,17 +4910,17 @@ var require_visit = __commonJS({
4910
4910
  visit.BREAK = BREAK;
4911
4911
  visit.SKIP = SKIP;
4912
4912
  visit.REMOVE = REMOVE;
4913
- function visit_(key, node, visitor, path23) {
4914
- const ctrl = callVisitor(key, node, visitor, path23);
4913
+ function visit_(key, node, visitor, path26) {
4914
+ const ctrl = callVisitor(key, node, visitor, path26);
4915
4915
  if (identity4.isNode(ctrl) || identity4.isPair(ctrl)) {
4916
- replaceNode(key, path23, ctrl);
4917
- return visit_(key, ctrl, visitor, path23);
4916
+ replaceNode(key, path26, ctrl);
4917
+ return visit_(key, ctrl, visitor, path26);
4918
4918
  }
4919
4919
  if (typeof ctrl !== "symbol") {
4920
4920
  if (identity4.isCollection(node)) {
4921
- path23 = Object.freeze(path23.concat(node));
4921
+ path26 = Object.freeze(path26.concat(node));
4922
4922
  for (let i2 = 0; i2 < node.items.length; ++i2) {
4923
- const ci = visit_(i2, node.items[i2], visitor, path23);
4923
+ const ci = visit_(i2, node.items[i2], visitor, path26);
4924
4924
  if (typeof ci === "number")
4925
4925
  i2 = ci - 1;
4926
4926
  else if (ci === BREAK)
@@ -4931,13 +4931,13 @@ var require_visit = __commonJS({
4931
4931
  }
4932
4932
  }
4933
4933
  } else if (identity4.isPair(node)) {
4934
- path23 = Object.freeze(path23.concat(node));
4935
- const ck = visit_("key", node.key, visitor, path23);
4934
+ path26 = Object.freeze(path26.concat(node));
4935
+ const ck = visit_("key", node.key, visitor, path26);
4936
4936
  if (ck === BREAK)
4937
4937
  return BREAK;
4938
4938
  else if (ck === REMOVE)
4939
4939
  node.key = null;
4940
- const cv = visit_("value", node.value, visitor, path23);
4940
+ const cv = visit_("value", node.value, visitor, path26);
4941
4941
  if (cv === BREAK)
4942
4942
  return BREAK;
4943
4943
  else if (cv === REMOVE)
@@ -4958,17 +4958,17 @@ var require_visit = __commonJS({
4958
4958
  visitAsync.BREAK = BREAK;
4959
4959
  visitAsync.SKIP = SKIP;
4960
4960
  visitAsync.REMOVE = REMOVE;
4961
- async function visitAsync_(key, node, visitor, path23) {
4962
- const ctrl = await callVisitor(key, node, visitor, path23);
4961
+ async function visitAsync_(key, node, visitor, path26) {
4962
+ const ctrl = await callVisitor(key, node, visitor, path26);
4963
4963
  if (identity4.isNode(ctrl) || identity4.isPair(ctrl)) {
4964
- replaceNode(key, path23, ctrl);
4965
- return visitAsync_(key, ctrl, visitor, path23);
4964
+ replaceNode(key, path26, ctrl);
4965
+ return visitAsync_(key, ctrl, visitor, path26);
4966
4966
  }
4967
4967
  if (typeof ctrl !== "symbol") {
4968
4968
  if (identity4.isCollection(node)) {
4969
- path23 = Object.freeze(path23.concat(node));
4969
+ path26 = Object.freeze(path26.concat(node));
4970
4970
  for (let i2 = 0; i2 < node.items.length; ++i2) {
4971
- const ci = await visitAsync_(i2, node.items[i2], visitor, path23);
4971
+ const ci = await visitAsync_(i2, node.items[i2], visitor, path26);
4972
4972
  if (typeof ci === "number")
4973
4973
  i2 = ci - 1;
4974
4974
  else if (ci === BREAK)
@@ -4979,13 +4979,13 @@ var require_visit = __commonJS({
4979
4979
  }
4980
4980
  }
4981
4981
  } else if (identity4.isPair(node)) {
4982
- path23 = Object.freeze(path23.concat(node));
4983
- const ck = await visitAsync_("key", node.key, visitor, path23);
4982
+ path26 = Object.freeze(path26.concat(node));
4983
+ const ck = await visitAsync_("key", node.key, visitor, path26);
4984
4984
  if (ck === BREAK)
4985
4985
  return BREAK;
4986
4986
  else if (ck === REMOVE)
4987
4987
  node.key = null;
4988
- const cv = await visitAsync_("value", node.value, visitor, path23);
4988
+ const cv = await visitAsync_("value", node.value, visitor, path26);
4989
4989
  if (cv === BREAK)
4990
4990
  return BREAK;
4991
4991
  else if (cv === REMOVE)
@@ -5012,23 +5012,23 @@ var require_visit = __commonJS({
5012
5012
  }
5013
5013
  return visitor;
5014
5014
  }
5015
- function callVisitor(key, node, visitor, path23) {
5015
+ function callVisitor(key, node, visitor, path26) {
5016
5016
  if (typeof visitor === "function")
5017
- return visitor(key, node, path23);
5017
+ return visitor(key, node, path26);
5018
5018
  if (identity4.isMap(node))
5019
- return visitor.Map?.(key, node, path23);
5019
+ return visitor.Map?.(key, node, path26);
5020
5020
  if (identity4.isSeq(node))
5021
- return visitor.Seq?.(key, node, path23);
5021
+ return visitor.Seq?.(key, node, path26);
5022
5022
  if (identity4.isPair(node))
5023
- return visitor.Pair?.(key, node, path23);
5023
+ return visitor.Pair?.(key, node, path26);
5024
5024
  if (identity4.isScalar(node))
5025
- return visitor.Scalar?.(key, node, path23);
5025
+ return visitor.Scalar?.(key, node, path26);
5026
5026
  if (identity4.isAlias(node))
5027
- return visitor.Alias?.(key, node, path23);
5027
+ return visitor.Alias?.(key, node, path26);
5028
5028
  return void 0;
5029
5029
  }
5030
- function replaceNode(key, path23, node) {
5031
- const parent = path23[path23.length - 1];
5030
+ function replaceNode(key, path26, node) {
5031
+ const parent = path26[path26.length - 1];
5032
5032
  if (identity4.isCollection(parent)) {
5033
5033
  parent.items[key] = node;
5034
5034
  } else if (identity4.isPair(parent)) {
@@ -5638,10 +5638,10 @@ var require_Collection = __commonJS({
5638
5638
  var createNode = require_createNode();
5639
5639
  var identity4 = require_identity();
5640
5640
  var Node = require_Node();
5641
- function collectionFromPath(schema, path23, value) {
5641
+ function collectionFromPath(schema, path26, value) {
5642
5642
  let v = value;
5643
- for (let i2 = path23.length - 1; i2 >= 0; --i2) {
5644
- const k = path23[i2];
5643
+ for (let i2 = path26.length - 1; i2 >= 0; --i2) {
5644
+ const k = path26[i2];
5645
5645
  if (typeof k === "number" && Number.isInteger(k) && k >= 0) {
5646
5646
  const a2 = [];
5647
5647
  a2[k] = v;
@@ -5660,7 +5660,7 @@ var require_Collection = __commonJS({
5660
5660
  sourceObjects: /* @__PURE__ */ new Map()
5661
5661
  });
5662
5662
  }
5663
- var isEmptyPath = (path23) => path23 == null || typeof path23 === "object" && !!path23[Symbol.iterator]().next().done;
5663
+ var isEmptyPath = (path26) => path26 == null || typeof path26 === "object" && !!path26[Symbol.iterator]().next().done;
5664
5664
  var Collection = class extends Node.NodeBase {
5665
5665
  constructor(type, schema) {
5666
5666
  super(type);
@@ -5690,11 +5690,11 @@ var require_Collection = __commonJS({
5690
5690
  * be a Pair instance or a `{ key, value }` object, which may not have a key
5691
5691
  * that already exists in the map.
5692
5692
  */
5693
- addIn(path23, value) {
5694
- if (isEmptyPath(path23))
5693
+ addIn(path26, value) {
5694
+ if (isEmptyPath(path26))
5695
5695
  this.add(value);
5696
5696
  else {
5697
- const [key, ...rest] = path23;
5697
+ const [key, ...rest] = path26;
5698
5698
  const node = this.get(key, true);
5699
5699
  if (identity4.isCollection(node))
5700
5700
  node.addIn(rest, value);
@@ -5708,8 +5708,8 @@ var require_Collection = __commonJS({
5708
5708
  * Removes a value from the collection.
5709
5709
  * @returns `true` if the item was found and removed.
5710
5710
  */
5711
- deleteIn(path23) {
5712
- const [key, ...rest] = path23;
5711
+ deleteIn(path26) {
5712
+ const [key, ...rest] = path26;
5713
5713
  if (rest.length === 0)
5714
5714
  return this.delete(key);
5715
5715
  const node = this.get(key, true);
@@ -5723,8 +5723,8 @@ var require_Collection = __commonJS({
5723
5723
  * scalar values from their surrounding node; to disable set `keepScalar` to
5724
5724
  * `true` (collections are always returned intact).
5725
5725
  */
5726
- getIn(path23, keepScalar) {
5727
- const [key, ...rest] = path23;
5726
+ getIn(path26, keepScalar) {
5727
+ const [key, ...rest] = path26;
5728
5728
  const node = this.get(key, true);
5729
5729
  if (rest.length === 0)
5730
5730
  return !keepScalar && identity4.isScalar(node) ? node.value : node;
@@ -5742,8 +5742,8 @@ var require_Collection = __commonJS({
5742
5742
  /**
5743
5743
  * Checks if the collection includes a value with the key `key`.
5744
5744
  */
5745
- hasIn(path23) {
5746
- const [key, ...rest] = path23;
5745
+ hasIn(path26) {
5746
+ const [key, ...rest] = path26;
5747
5747
  if (rest.length === 0)
5748
5748
  return this.has(key);
5749
5749
  const node = this.get(key, true);
@@ -5753,8 +5753,8 @@ var require_Collection = __commonJS({
5753
5753
  * Sets a value in this collection. For `!!set`, `value` needs to be a
5754
5754
  * boolean to add/remove the item from the set.
5755
5755
  */
5756
- setIn(path23, value) {
5757
- const [key, ...rest] = path23;
5756
+ setIn(path26, value) {
5757
+ const [key, ...rest] = path26;
5758
5758
  if (rest.length === 0) {
5759
5759
  this.set(key, value);
5760
5760
  } else {
@@ -8269,9 +8269,9 @@ var require_Document = __commonJS({
8269
8269
  this.contents.add(value);
8270
8270
  }
8271
8271
  /** Adds a value to the document. */
8272
- addIn(path23, value) {
8272
+ addIn(path26, value) {
8273
8273
  if (assertCollection(this.contents))
8274
- this.contents.addIn(path23, value);
8274
+ this.contents.addIn(path26, value);
8275
8275
  }
8276
8276
  /**
8277
8277
  * Create a new `Alias` node, ensuring that the target `node` has the required anchor.
@@ -8346,14 +8346,14 @@ var require_Document = __commonJS({
8346
8346
  * Removes a value from the document.
8347
8347
  * @returns `true` if the item was found and removed.
8348
8348
  */
8349
- deleteIn(path23) {
8350
- if (Collection.isEmptyPath(path23)) {
8349
+ deleteIn(path26) {
8350
+ if (Collection.isEmptyPath(path26)) {
8351
8351
  if (this.contents == null)
8352
8352
  return false;
8353
8353
  this.contents = null;
8354
8354
  return true;
8355
8355
  }
8356
- return assertCollection(this.contents) ? this.contents.deleteIn(path23) : false;
8356
+ return assertCollection(this.contents) ? this.contents.deleteIn(path26) : false;
8357
8357
  }
8358
8358
  /**
8359
8359
  * Returns item at `key`, or `undefined` if not found. By default unwraps
@@ -8368,10 +8368,10 @@ var require_Document = __commonJS({
8368
8368
  * scalar values from their surrounding node; to disable set `keepScalar` to
8369
8369
  * `true` (collections are always returned intact).
8370
8370
  */
8371
- getIn(path23, keepScalar) {
8372
- if (Collection.isEmptyPath(path23))
8371
+ getIn(path26, keepScalar) {
8372
+ if (Collection.isEmptyPath(path26))
8373
8373
  return !keepScalar && identity4.isScalar(this.contents) ? this.contents.value : this.contents;
8374
- return identity4.isCollection(this.contents) ? this.contents.getIn(path23, keepScalar) : void 0;
8374
+ return identity4.isCollection(this.contents) ? this.contents.getIn(path26, keepScalar) : void 0;
8375
8375
  }
8376
8376
  /**
8377
8377
  * Checks if the document includes a value with the key `key`.
@@ -8382,10 +8382,10 @@ var require_Document = __commonJS({
8382
8382
  /**
8383
8383
  * Checks if the document includes a value at `path`.
8384
8384
  */
8385
- hasIn(path23) {
8386
- if (Collection.isEmptyPath(path23))
8385
+ hasIn(path26) {
8386
+ if (Collection.isEmptyPath(path26))
8387
8387
  return this.contents !== void 0;
8388
- return identity4.isCollection(this.contents) ? this.contents.hasIn(path23) : false;
8388
+ return identity4.isCollection(this.contents) ? this.contents.hasIn(path26) : false;
8389
8389
  }
8390
8390
  /**
8391
8391
  * Sets a value in this document. For `!!set`, `value` needs to be a
@@ -8402,13 +8402,13 @@ var require_Document = __commonJS({
8402
8402
  * Sets a value in this document. For `!!set`, `value` needs to be a
8403
8403
  * boolean to add/remove the item from the set.
8404
8404
  */
8405
- setIn(path23, value) {
8406
- if (Collection.isEmptyPath(path23)) {
8405
+ setIn(path26, value) {
8406
+ if (Collection.isEmptyPath(path26)) {
8407
8407
  this.contents = value;
8408
8408
  } else if (this.contents == null) {
8409
- this.contents = Collection.collectionFromPath(this.schema, Array.from(path23), value);
8409
+ this.contents = Collection.collectionFromPath(this.schema, Array.from(path26), value);
8410
8410
  } else if (assertCollection(this.contents)) {
8411
- this.contents.setIn(path23, value);
8411
+ this.contents.setIn(path26, value);
8412
8412
  }
8413
8413
  }
8414
8414
  /**
@@ -10366,9 +10366,9 @@ var require_cst_visit = __commonJS({
10366
10366
  visit.BREAK = BREAK;
10367
10367
  visit.SKIP = SKIP;
10368
10368
  visit.REMOVE = REMOVE;
10369
- visit.itemAtPath = (cst, path23) => {
10369
+ visit.itemAtPath = (cst, path26) => {
10370
10370
  let item = cst;
10371
- for (const [field, index] of path23) {
10371
+ for (const [field, index] of path26) {
10372
10372
  const tok = item?.[field];
10373
10373
  if (tok && "items" in tok) {
10374
10374
  item = tok.items[index];
@@ -10377,23 +10377,23 @@ var require_cst_visit = __commonJS({
10377
10377
  }
10378
10378
  return item;
10379
10379
  };
10380
- visit.parentCollection = (cst, path23) => {
10381
- const parent = visit.itemAtPath(cst, path23.slice(0, -1));
10382
- const field = path23[path23.length - 1][0];
10380
+ visit.parentCollection = (cst, path26) => {
10381
+ const parent = visit.itemAtPath(cst, path26.slice(0, -1));
10382
+ const field = path26[path26.length - 1][0];
10383
10383
  const coll = parent?.[field];
10384
10384
  if (coll && "items" in coll)
10385
10385
  return coll;
10386
10386
  throw new Error("Parent collection not found");
10387
10387
  };
10388
- function _visit(path23, item, visitor) {
10389
- let ctrl = visitor(item, path23);
10388
+ function _visit(path26, item, visitor) {
10389
+ let ctrl = visitor(item, path26);
10390
10390
  if (typeof ctrl === "symbol")
10391
10391
  return ctrl;
10392
10392
  for (const field of ["key", "value"]) {
10393
10393
  const token = item[field];
10394
10394
  if (token && "items" in token) {
10395
10395
  for (let i2 = 0; i2 < token.items.length; ++i2) {
10396
- const ci = _visit(Object.freeze(path23.concat([[field, i2]])), token.items[i2], visitor);
10396
+ const ci = _visit(Object.freeze(path26.concat([[field, i2]])), token.items[i2], visitor);
10397
10397
  if (typeof ci === "number")
10398
10398
  i2 = ci - 1;
10399
10399
  else if (ci === BREAK)
@@ -10404,10 +10404,10 @@ var require_cst_visit = __commonJS({
10404
10404
  }
10405
10405
  }
10406
10406
  if (typeof ctrl === "function" && field === "key")
10407
- ctrl = ctrl(item, path23);
10407
+ ctrl = ctrl(item, path26);
10408
10408
  }
10409
10409
  }
10410
- return typeof ctrl === "function" ? ctrl(item, path23) : ctrl;
10410
+ return typeof ctrl === "function" ? ctrl(item, path26) : ctrl;
10411
10411
  }
10412
10412
  exports.visit = visit;
10413
10413
  }
@@ -11692,14 +11692,14 @@ var require_parser = __commonJS({
11692
11692
  case "scalar":
11693
11693
  case "single-quoted-scalar":
11694
11694
  case "double-quoted-scalar": {
11695
- const fs18 = this.flowScalar(this.type);
11695
+ const fs19 = this.flowScalar(this.type);
11696
11696
  if (atNextItem || it.value) {
11697
- map.items.push({ start, key: fs18, sep: [] });
11697
+ map.items.push({ start, key: fs19, sep: [] });
11698
11698
  this.onKeyLine = true;
11699
11699
  } else if (it.sep) {
11700
- this.stack.push(fs18);
11700
+ this.stack.push(fs19);
11701
11701
  } else {
11702
- Object.assign(it, { key: fs18, sep: [] });
11702
+ Object.assign(it, { key: fs19, sep: [] });
11703
11703
  this.onKeyLine = true;
11704
11704
  }
11705
11705
  return;
@@ -11827,13 +11827,13 @@ var require_parser = __commonJS({
11827
11827
  case "scalar":
11828
11828
  case "single-quoted-scalar":
11829
11829
  case "double-quoted-scalar": {
11830
- const fs18 = this.flowScalar(this.type);
11830
+ const fs19 = this.flowScalar(this.type);
11831
11831
  if (!it || it.value)
11832
- fc.items.push({ start: [], key: fs18, sep: [] });
11832
+ fc.items.push({ start: [], key: fs19, sep: [] });
11833
11833
  else if (it.sep)
11834
- this.stack.push(fs18);
11834
+ this.stack.push(fs19);
11835
11835
  else
11836
- Object.assign(it, { key: fs18, sep: [] });
11836
+ Object.assign(it, { key: fs19, sep: [] });
11837
11837
  return;
11838
11838
  }
11839
11839
  case "flow-map-end":
@@ -13074,8 +13074,8 @@ var require_command = __commonJS({
13074
13074
  "node_modules/commander/lib/command.js"(exports) {
13075
13075
  var EventEmitter3 = __require("node:events").EventEmitter;
13076
13076
  var childProcess = __require("node:child_process");
13077
- var path23 = __require("node:path");
13078
- var fs18 = __require("node:fs");
13077
+ var path26 = __require("node:path");
13078
+ var fs19 = __require("node:fs");
13079
13079
  var process10 = __require("node:process");
13080
13080
  var { Argument: Argument2, humanReadableArgName } = require_argument();
13081
13081
  var { CommanderError: CommanderError2 } = require_error();
@@ -14007,11 +14007,11 @@ Expecting one of '${allowedValues.join("', '")}'`);
14007
14007
  let launchWithNode = false;
14008
14008
  const sourceExt = [".js", ".ts", ".tsx", ".mjs", ".cjs"];
14009
14009
  function findFile(baseDir, baseName) {
14010
- const localBin = path23.resolve(baseDir, baseName);
14011
- if (fs18.existsSync(localBin)) return localBin;
14012
- if (sourceExt.includes(path23.extname(baseName))) return void 0;
14010
+ const localBin = path26.resolve(baseDir, baseName);
14011
+ if (fs19.existsSync(localBin)) return localBin;
14012
+ if (sourceExt.includes(path26.extname(baseName))) return void 0;
14013
14013
  const foundExt = sourceExt.find(
14014
- (ext) => fs18.existsSync(`${localBin}${ext}`)
14014
+ (ext) => fs19.existsSync(`${localBin}${ext}`)
14015
14015
  );
14016
14016
  if (foundExt) return `${localBin}${foundExt}`;
14017
14017
  return void 0;
@@ -14023,21 +14023,21 @@ Expecting one of '${allowedValues.join("', '")}'`);
14023
14023
  if (this._scriptPath) {
14024
14024
  let resolvedScriptPath;
14025
14025
  try {
14026
- resolvedScriptPath = fs18.realpathSync(this._scriptPath);
14026
+ resolvedScriptPath = fs19.realpathSync(this._scriptPath);
14027
14027
  } catch (err) {
14028
14028
  resolvedScriptPath = this._scriptPath;
14029
14029
  }
14030
- executableDir = path23.resolve(
14031
- path23.dirname(resolvedScriptPath),
14030
+ executableDir = path26.resolve(
14031
+ path26.dirname(resolvedScriptPath),
14032
14032
  executableDir
14033
14033
  );
14034
14034
  }
14035
14035
  if (executableDir) {
14036
14036
  let localFile = findFile(executableDir, executableFile);
14037
14037
  if (!localFile && !subcommand._executableFile && this._scriptPath) {
14038
- const legacyName = path23.basename(
14038
+ const legacyName = path26.basename(
14039
14039
  this._scriptPath,
14040
- path23.extname(this._scriptPath)
14040
+ path26.extname(this._scriptPath)
14041
14041
  );
14042
14042
  if (legacyName !== this._name) {
14043
14043
  localFile = findFile(
@@ -14048,7 +14048,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
14048
14048
  }
14049
14049
  executableFile = localFile || executableFile;
14050
14050
  }
14051
- launchWithNode = sourceExt.includes(path23.extname(executableFile));
14051
+ launchWithNode = sourceExt.includes(path26.extname(executableFile));
14052
14052
  let proc;
14053
14053
  if (process10.platform !== "win32") {
14054
14054
  if (launchWithNode) {
@@ -14888,7 +14888,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
14888
14888
  * @return {Command}
14889
14889
  */
14890
14890
  nameFromFilename(filename) {
14891
- this._name = path23.basename(filename, path23.extname(filename));
14891
+ this._name = path26.basename(filename, path26.extname(filename));
14892
14892
  return this;
14893
14893
  }
14894
14894
  /**
@@ -14902,9 +14902,9 @@ Expecting one of '${allowedValues.join("', '")}'`);
14902
14902
  * @param {string} [path]
14903
14903
  * @return {(string|null|Command)}
14904
14904
  */
14905
- executableDir(path24) {
14906
- if (path24 === void 0) return this._executableDir;
14907
- this._executableDir = path24;
14905
+ executableDir(path27) {
14906
+ if (path27 === void 0) return this._executableDir;
14907
+ this._executableDir = path27;
14908
14908
  return this;
14909
14909
  }
14910
14910
  /**
@@ -60073,15 +60073,15 @@ var require_route = __commonJS({
60073
60073
  };
60074
60074
  }
60075
60075
  function wrapConversion(toModel, graph) {
60076
- const path23 = [graph[toModel].parent, toModel];
60076
+ const path26 = [graph[toModel].parent, toModel];
60077
60077
  let fn = conversions[graph[toModel].parent][toModel];
60078
60078
  let cur = graph[toModel].parent;
60079
60079
  while (graph[cur].parent) {
60080
- path23.unshift(graph[cur].parent);
60080
+ path26.unshift(graph[cur].parent);
60081
60081
  fn = link2(conversions[graph[cur].parent][cur], fn);
60082
60082
  cur = graph[cur].parent;
60083
60083
  }
60084
- fn.conversion = path23;
60084
+ fn.conversion = path26;
60085
60085
  return fn;
60086
60086
  }
60087
60087
  module.exports = function(fromModel) {
@@ -77216,13 +77216,13 @@ var logOutputSync = ({ serializedResult, fdNumber, state, verboseInfo, encoding,
77216
77216
  }
77217
77217
  };
77218
77218
  var writeToFiles = (serializedResult, stdioItems, outputFiles) => {
77219
- for (const { path: path23, append } of stdioItems.filter(({ type }) => FILE_TYPES.has(type))) {
77220
- const pathString = typeof path23 === "string" ? path23 : path23.toString();
77219
+ for (const { path: path26, append } of stdioItems.filter(({ type }) => FILE_TYPES.has(type))) {
77220
+ const pathString = typeof path26 === "string" ? path26 : path26.toString();
77221
77221
  if (append || outputFiles.has(pathString)) {
77222
- appendFileSync(path23, serializedResult);
77222
+ appendFileSync(path26, serializedResult);
77223
77223
  } else {
77224
77224
  outputFiles.add(pathString);
77225
- writeFileSync(path23, serializedResult);
77225
+ writeFileSync(path26, serializedResult);
77226
77226
  }
77227
77227
  }
77228
77228
  };
@@ -80300,8 +80300,8 @@ function getErrorMap() {
80300
80300
 
80301
80301
  // node_modules/zod/v3/helpers/parseUtil.js
80302
80302
  var makeIssue = (params) => {
80303
- const { data, path: path23, errorMaps, issueData } = params;
80304
- const fullPath = [...path23, ...issueData.path || []];
80303
+ const { data, path: path26, errorMaps, issueData } = params;
80304
+ const fullPath = [...path26, ...issueData.path || []];
80305
80305
  const fullIssue = {
80306
80306
  ...issueData,
80307
80307
  path: fullPath
@@ -80356,18 +80356,18 @@ var ParseStatus = class _ParseStatus {
80356
80356
  if (this.value !== "aborted")
80357
80357
  this.value = "aborted";
80358
80358
  }
80359
- static mergeArray(status, results) {
80359
+ static mergeArray(status4, results) {
80360
80360
  const arrayValue = [];
80361
80361
  for (const s of results) {
80362
80362
  if (s.status === "aborted")
80363
80363
  return INVALID;
80364
80364
  if (s.status === "dirty")
80365
- status.dirty();
80365
+ status4.dirty();
80366
80366
  arrayValue.push(s.value);
80367
80367
  }
80368
- return { status: status.value, value: arrayValue };
80368
+ return { status: status4.value, value: arrayValue };
80369
80369
  }
80370
- static async mergeObjectAsync(status, pairs) {
80370
+ static async mergeObjectAsync(status4, pairs) {
80371
80371
  const syncPairs = [];
80372
80372
  for (const pair of pairs) {
80373
80373
  const key = await pair.key;
@@ -80377,9 +80377,9 @@ var ParseStatus = class _ParseStatus {
80377
80377
  value
80378
80378
  });
80379
80379
  }
80380
- return _ParseStatus.mergeObjectSync(status, syncPairs);
80380
+ return _ParseStatus.mergeObjectSync(status4, syncPairs);
80381
80381
  }
80382
- static mergeObjectSync(status, pairs) {
80382
+ static mergeObjectSync(status4, pairs) {
80383
80383
  const finalObject = {};
80384
80384
  for (const pair of pairs) {
80385
80385
  const { key, value } = pair;
@@ -80388,14 +80388,14 @@ var ParseStatus = class _ParseStatus {
80388
80388
  if (value.status === "aborted")
80389
80389
  return INVALID;
80390
80390
  if (key.status === "dirty")
80391
- status.dirty();
80391
+ status4.dirty();
80392
80392
  if (value.status === "dirty")
80393
- status.dirty();
80393
+ status4.dirty();
80394
80394
  if (key.value !== "__proto__" && (typeof value.value !== "undefined" || pair.alwaysSet)) {
80395
80395
  finalObject[key.value] = value.value;
80396
80396
  }
80397
80397
  }
80398
- return { status: status.value, value: finalObject };
80398
+ return { status: status4.value, value: finalObject };
80399
80399
  }
80400
80400
  };
80401
80401
  var INVALID = Object.freeze({
@@ -80417,11 +80417,11 @@ var errorUtil;
80417
80417
 
80418
80418
  // node_modules/zod/v3/types.js
80419
80419
  var ParseInputLazyPath = class {
80420
- constructor(parent, value, path23, key) {
80420
+ constructor(parent, value, path26, key) {
80421
80421
  this._cachedPath = [];
80422
80422
  this.parent = parent;
80423
80423
  this.data = value;
80424
- this._path = path23;
80424
+ this._path = path26;
80425
80425
  this._key = key;
80426
80426
  }
80427
80427
  get path() {
@@ -80855,7 +80855,7 @@ var ZodString = class _ZodString extends ZodType {
80855
80855
  });
80856
80856
  return INVALID;
80857
80857
  }
80858
- const status = new ParseStatus();
80858
+ const status4 = new ParseStatus();
80859
80859
  let ctx = void 0;
80860
80860
  for (const check of this._def.checks) {
80861
80861
  if (check.kind === "min") {
@@ -80869,7 +80869,7 @@ var ZodString = class _ZodString extends ZodType {
80869
80869
  exact: false,
80870
80870
  message: check.message
80871
80871
  });
80872
- status.dirty();
80872
+ status4.dirty();
80873
80873
  }
80874
80874
  } else if (check.kind === "max") {
80875
80875
  if (input.data.length > check.value) {
@@ -80882,7 +80882,7 @@ var ZodString = class _ZodString extends ZodType {
80882
80882
  exact: false,
80883
80883
  message: check.message
80884
80884
  });
80885
- status.dirty();
80885
+ status4.dirty();
80886
80886
  }
80887
80887
  } else if (check.kind === "length") {
80888
80888
  const tooBig = input.data.length > check.value;
@@ -80908,7 +80908,7 @@ var ZodString = class _ZodString extends ZodType {
80908
80908
  message: check.message
80909
80909
  });
80910
80910
  }
80911
- status.dirty();
80911
+ status4.dirty();
80912
80912
  }
80913
80913
  } else if (check.kind === "email") {
80914
80914
  if (!emailRegex.test(input.data)) {
@@ -80918,7 +80918,7 @@ var ZodString = class _ZodString extends ZodType {
80918
80918
  code: ZodIssueCode.invalid_string,
80919
80919
  message: check.message
80920
80920
  });
80921
- status.dirty();
80921
+ status4.dirty();
80922
80922
  }
80923
80923
  } else if (check.kind === "emoji") {
80924
80924
  if (!emojiRegex) {
@@ -80931,7 +80931,7 @@ var ZodString = class _ZodString extends ZodType {
80931
80931
  code: ZodIssueCode.invalid_string,
80932
80932
  message: check.message
80933
80933
  });
80934
- status.dirty();
80934
+ status4.dirty();
80935
80935
  }
80936
80936
  } else if (check.kind === "uuid") {
80937
80937
  if (!uuidRegex.test(input.data)) {
@@ -80941,7 +80941,7 @@ var ZodString = class _ZodString extends ZodType {
80941
80941
  code: ZodIssueCode.invalid_string,
80942
80942
  message: check.message
80943
80943
  });
80944
- status.dirty();
80944
+ status4.dirty();
80945
80945
  }
80946
80946
  } else if (check.kind === "nanoid") {
80947
80947
  if (!nanoidRegex.test(input.data)) {
@@ -80951,7 +80951,7 @@ var ZodString = class _ZodString extends ZodType {
80951
80951
  code: ZodIssueCode.invalid_string,
80952
80952
  message: check.message
80953
80953
  });
80954
- status.dirty();
80954
+ status4.dirty();
80955
80955
  }
80956
80956
  } else if (check.kind === "cuid") {
80957
80957
  if (!cuidRegex.test(input.data)) {
@@ -80961,7 +80961,7 @@ var ZodString = class _ZodString extends ZodType {
80961
80961
  code: ZodIssueCode.invalid_string,
80962
80962
  message: check.message
80963
80963
  });
80964
- status.dirty();
80964
+ status4.dirty();
80965
80965
  }
80966
80966
  } else if (check.kind === "cuid2") {
80967
80967
  if (!cuid2Regex.test(input.data)) {
@@ -80971,7 +80971,7 @@ var ZodString = class _ZodString extends ZodType {
80971
80971
  code: ZodIssueCode.invalid_string,
80972
80972
  message: check.message
80973
80973
  });
80974
- status.dirty();
80974
+ status4.dirty();
80975
80975
  }
80976
80976
  } else if (check.kind === "ulid") {
80977
80977
  if (!ulidRegex.test(input.data)) {
@@ -80981,7 +80981,7 @@ var ZodString = class _ZodString extends ZodType {
80981
80981
  code: ZodIssueCode.invalid_string,
80982
80982
  message: check.message
80983
80983
  });
80984
- status.dirty();
80984
+ status4.dirty();
80985
80985
  }
80986
80986
  } else if (check.kind === "url") {
80987
80987
  try {
@@ -80993,7 +80993,7 @@ var ZodString = class _ZodString extends ZodType {
80993
80993
  code: ZodIssueCode.invalid_string,
80994
80994
  message: check.message
80995
80995
  });
80996
- status.dirty();
80996
+ status4.dirty();
80997
80997
  }
80998
80998
  } else if (check.kind === "regex") {
80999
80999
  check.regex.lastIndex = 0;
@@ -81005,7 +81005,7 @@ var ZodString = class _ZodString extends ZodType {
81005
81005
  code: ZodIssueCode.invalid_string,
81006
81006
  message: check.message
81007
81007
  });
81008
- status.dirty();
81008
+ status4.dirty();
81009
81009
  }
81010
81010
  } else if (check.kind === "trim") {
81011
81011
  input.data = input.data.trim();
@@ -81017,7 +81017,7 @@ var ZodString = class _ZodString extends ZodType {
81017
81017
  validation: { includes: check.value, position: check.position },
81018
81018
  message: check.message
81019
81019
  });
81020
- status.dirty();
81020
+ status4.dirty();
81021
81021
  }
81022
81022
  } else if (check.kind === "toLowerCase") {
81023
81023
  input.data = input.data.toLowerCase();
@@ -81031,7 +81031,7 @@ var ZodString = class _ZodString extends ZodType {
81031
81031
  validation: { startsWith: check.value },
81032
81032
  message: check.message
81033
81033
  });
81034
- status.dirty();
81034
+ status4.dirty();
81035
81035
  }
81036
81036
  } else if (check.kind === "endsWith") {
81037
81037
  if (!input.data.endsWith(check.value)) {
@@ -81041,7 +81041,7 @@ var ZodString = class _ZodString extends ZodType {
81041
81041
  validation: { endsWith: check.value },
81042
81042
  message: check.message
81043
81043
  });
81044
- status.dirty();
81044
+ status4.dirty();
81045
81045
  }
81046
81046
  } else if (check.kind === "datetime") {
81047
81047
  const regex = datetimeRegex(check);
@@ -81052,7 +81052,7 @@ var ZodString = class _ZodString extends ZodType {
81052
81052
  validation: "datetime",
81053
81053
  message: check.message
81054
81054
  });
81055
- status.dirty();
81055
+ status4.dirty();
81056
81056
  }
81057
81057
  } else if (check.kind === "date") {
81058
81058
  const regex = dateRegex;
@@ -81063,7 +81063,7 @@ var ZodString = class _ZodString extends ZodType {
81063
81063
  validation: "date",
81064
81064
  message: check.message
81065
81065
  });
81066
- status.dirty();
81066
+ status4.dirty();
81067
81067
  }
81068
81068
  } else if (check.kind === "time") {
81069
81069
  const regex = timeRegex(check);
@@ -81074,7 +81074,7 @@ var ZodString = class _ZodString extends ZodType {
81074
81074
  validation: "time",
81075
81075
  message: check.message
81076
81076
  });
81077
- status.dirty();
81077
+ status4.dirty();
81078
81078
  }
81079
81079
  } else if (check.kind === "duration") {
81080
81080
  if (!durationRegex.test(input.data)) {
@@ -81084,7 +81084,7 @@ var ZodString = class _ZodString extends ZodType {
81084
81084
  code: ZodIssueCode.invalid_string,
81085
81085
  message: check.message
81086
81086
  });
81087
- status.dirty();
81087
+ status4.dirty();
81088
81088
  }
81089
81089
  } else if (check.kind === "ip") {
81090
81090
  if (!isValidIP(input.data, check.version)) {
@@ -81094,7 +81094,7 @@ var ZodString = class _ZodString extends ZodType {
81094
81094
  code: ZodIssueCode.invalid_string,
81095
81095
  message: check.message
81096
81096
  });
81097
- status.dirty();
81097
+ status4.dirty();
81098
81098
  }
81099
81099
  } else if (check.kind === "jwt") {
81100
81100
  if (!isValidJWT(input.data, check.alg)) {
@@ -81104,7 +81104,7 @@ var ZodString = class _ZodString extends ZodType {
81104
81104
  code: ZodIssueCode.invalid_string,
81105
81105
  message: check.message
81106
81106
  });
81107
- status.dirty();
81107
+ status4.dirty();
81108
81108
  }
81109
81109
  } else if (check.kind === "cidr") {
81110
81110
  if (!isValidCidr(input.data, check.version)) {
@@ -81114,7 +81114,7 @@ var ZodString = class _ZodString extends ZodType {
81114
81114
  code: ZodIssueCode.invalid_string,
81115
81115
  message: check.message
81116
81116
  });
81117
- status.dirty();
81117
+ status4.dirty();
81118
81118
  }
81119
81119
  } else if (check.kind === "base64") {
81120
81120
  if (!base64Regex.test(input.data)) {
@@ -81124,7 +81124,7 @@ var ZodString = class _ZodString extends ZodType {
81124
81124
  code: ZodIssueCode.invalid_string,
81125
81125
  message: check.message
81126
81126
  });
81127
- status.dirty();
81127
+ status4.dirty();
81128
81128
  }
81129
81129
  } else if (check.kind === "base64url") {
81130
81130
  if (!base64urlRegex.test(input.data)) {
@@ -81134,13 +81134,13 @@ var ZodString = class _ZodString extends ZodType {
81134
81134
  code: ZodIssueCode.invalid_string,
81135
81135
  message: check.message
81136
81136
  });
81137
- status.dirty();
81137
+ status4.dirty();
81138
81138
  }
81139
81139
  } else {
81140
81140
  util.assertNever(check);
81141
81141
  }
81142
81142
  }
81143
- return { status: status.value, value: input.data };
81143
+ return { status: status4.value, value: input.data };
81144
81144
  }
81145
81145
  _regex(regex, validation, message) {
81146
81146
  return this.refinement((data) => regex.test(data), {
@@ -81416,7 +81416,7 @@ var ZodNumber = class _ZodNumber extends ZodType {
81416
81416
  return INVALID;
81417
81417
  }
81418
81418
  let ctx = void 0;
81419
- const status = new ParseStatus();
81419
+ const status4 = new ParseStatus();
81420
81420
  for (const check of this._def.checks) {
81421
81421
  if (check.kind === "int") {
81422
81422
  if (!util.isInteger(input.data)) {
@@ -81427,7 +81427,7 @@ var ZodNumber = class _ZodNumber extends ZodType {
81427
81427
  received: "float",
81428
81428
  message: check.message
81429
81429
  });
81430
- status.dirty();
81430
+ status4.dirty();
81431
81431
  }
81432
81432
  } else if (check.kind === "min") {
81433
81433
  const tooSmall = check.inclusive ? input.data < check.value : input.data <= check.value;
@@ -81441,7 +81441,7 @@ var ZodNumber = class _ZodNumber extends ZodType {
81441
81441
  exact: false,
81442
81442
  message: check.message
81443
81443
  });
81444
- status.dirty();
81444
+ status4.dirty();
81445
81445
  }
81446
81446
  } else if (check.kind === "max") {
81447
81447
  const tooBig = check.inclusive ? input.data > check.value : input.data >= check.value;
@@ -81455,7 +81455,7 @@ var ZodNumber = class _ZodNumber extends ZodType {
81455
81455
  exact: false,
81456
81456
  message: check.message
81457
81457
  });
81458
- status.dirty();
81458
+ status4.dirty();
81459
81459
  }
81460
81460
  } else if (check.kind === "multipleOf") {
81461
81461
  if (floatSafeRemainder(input.data, check.value) !== 0) {
@@ -81465,7 +81465,7 @@ var ZodNumber = class _ZodNumber extends ZodType {
81465
81465
  multipleOf: check.value,
81466
81466
  message: check.message
81467
81467
  });
81468
- status.dirty();
81468
+ status4.dirty();
81469
81469
  }
81470
81470
  } else if (check.kind === "finite") {
81471
81471
  if (!Number.isFinite(input.data)) {
@@ -81474,13 +81474,13 @@ var ZodNumber = class _ZodNumber extends ZodType {
81474
81474
  code: ZodIssueCode.not_finite,
81475
81475
  message: check.message
81476
81476
  });
81477
- status.dirty();
81477
+ status4.dirty();
81478
81478
  }
81479
81479
  } else {
81480
81480
  util.assertNever(check);
81481
81481
  }
81482
81482
  }
81483
- return { status: status.value, value: input.data };
81483
+ return { status: status4.value, value: input.data };
81484
81484
  }
81485
81485
  gte(value, message) {
81486
81486
  return this.setLimit("min", value, true, errorUtil.toString(message));
@@ -81645,7 +81645,7 @@ var ZodBigInt = class _ZodBigInt extends ZodType {
81645
81645
  return this._getInvalidInput(input);
81646
81646
  }
81647
81647
  let ctx = void 0;
81648
- const status = new ParseStatus();
81648
+ const status4 = new ParseStatus();
81649
81649
  for (const check of this._def.checks) {
81650
81650
  if (check.kind === "min") {
81651
81651
  const tooSmall = check.inclusive ? input.data < check.value : input.data <= check.value;
@@ -81658,7 +81658,7 @@ var ZodBigInt = class _ZodBigInt extends ZodType {
81658
81658
  inclusive: check.inclusive,
81659
81659
  message: check.message
81660
81660
  });
81661
- status.dirty();
81661
+ status4.dirty();
81662
81662
  }
81663
81663
  } else if (check.kind === "max") {
81664
81664
  const tooBig = check.inclusive ? input.data > check.value : input.data >= check.value;
@@ -81671,7 +81671,7 @@ var ZodBigInt = class _ZodBigInt extends ZodType {
81671
81671
  inclusive: check.inclusive,
81672
81672
  message: check.message
81673
81673
  });
81674
- status.dirty();
81674
+ status4.dirty();
81675
81675
  }
81676
81676
  } else if (check.kind === "multipleOf") {
81677
81677
  if (input.data % check.value !== BigInt(0)) {
@@ -81681,13 +81681,13 @@ var ZodBigInt = class _ZodBigInt extends ZodType {
81681
81681
  multipleOf: check.value,
81682
81682
  message: check.message
81683
81683
  });
81684
- status.dirty();
81684
+ status4.dirty();
81685
81685
  }
81686
81686
  } else {
81687
81687
  util.assertNever(check);
81688
81688
  }
81689
81689
  }
81690
- return { status: status.value, value: input.data };
81690
+ return { status: status4.value, value: input.data };
81691
81691
  }
81692
81692
  _getInvalidInput(input) {
81693
81693
  const ctx = this._getOrReturnCtx(input);
@@ -81845,7 +81845,7 @@ var ZodDate = class _ZodDate extends ZodType {
81845
81845
  });
81846
81846
  return INVALID;
81847
81847
  }
81848
- const status = new ParseStatus();
81848
+ const status4 = new ParseStatus();
81849
81849
  let ctx = void 0;
81850
81850
  for (const check of this._def.checks) {
81851
81851
  if (check.kind === "min") {
@@ -81859,7 +81859,7 @@ var ZodDate = class _ZodDate extends ZodType {
81859
81859
  minimum: check.value,
81860
81860
  type: "date"
81861
81861
  });
81862
- status.dirty();
81862
+ status4.dirty();
81863
81863
  }
81864
81864
  } else if (check.kind === "max") {
81865
81865
  if (input.data.getTime() > check.value) {
@@ -81872,14 +81872,14 @@ var ZodDate = class _ZodDate extends ZodType {
81872
81872
  maximum: check.value,
81873
81873
  type: "date"
81874
81874
  });
81875
- status.dirty();
81875
+ status4.dirty();
81876
81876
  }
81877
81877
  } else {
81878
81878
  util.assertNever(check);
81879
81879
  }
81880
81880
  }
81881
81881
  return {
81882
- status: status.value,
81882
+ status: status4.value,
81883
81883
  value: new Date(input.data.getTime())
81884
81884
  };
81885
81885
  }
@@ -82065,7 +82065,7 @@ ZodVoid.create = (params) => {
82065
82065
  };
82066
82066
  var ZodArray = class _ZodArray extends ZodType {
82067
82067
  _parse(input) {
82068
- const { ctx, status } = this._processInputParams(input);
82068
+ const { ctx, status: status4 } = this._processInputParams(input);
82069
82069
  const def2 = this._def;
82070
82070
  if (ctx.parsedType !== ZodParsedType.array) {
82071
82071
  addIssueToContext(ctx, {
@@ -82088,7 +82088,7 @@ var ZodArray = class _ZodArray extends ZodType {
82088
82088
  exact: true,
82089
82089
  message: def2.exactLength.message
82090
82090
  });
82091
- status.dirty();
82091
+ status4.dirty();
82092
82092
  }
82093
82093
  }
82094
82094
  if (def2.minLength !== null) {
@@ -82101,7 +82101,7 @@ var ZodArray = class _ZodArray extends ZodType {
82101
82101
  exact: false,
82102
82102
  message: def2.minLength.message
82103
82103
  });
82104
- status.dirty();
82104
+ status4.dirty();
82105
82105
  }
82106
82106
  }
82107
82107
  if (def2.maxLength !== null) {
@@ -82114,20 +82114,20 @@ var ZodArray = class _ZodArray extends ZodType {
82114
82114
  exact: false,
82115
82115
  message: def2.maxLength.message
82116
82116
  });
82117
- status.dirty();
82117
+ status4.dirty();
82118
82118
  }
82119
82119
  }
82120
82120
  if (ctx.common.async) {
82121
82121
  return Promise.all([...ctx.data].map((item, i2) => {
82122
82122
  return def2.type._parseAsync(new ParseInputLazyPath(ctx, item, ctx.path, i2));
82123
82123
  })).then((result2) => {
82124
- return ParseStatus.mergeArray(status, result2);
82124
+ return ParseStatus.mergeArray(status4, result2);
82125
82125
  });
82126
82126
  }
82127
82127
  const result = [...ctx.data].map((item, i2) => {
82128
82128
  return def2.type._parseSync(new ParseInputLazyPath(ctx, item, ctx.path, i2));
82129
82129
  });
82130
- return ParseStatus.mergeArray(status, result);
82130
+ return ParseStatus.mergeArray(status4, result);
82131
82131
  }
82132
82132
  get element() {
82133
82133
  return this._def.type;
@@ -82216,7 +82216,7 @@ var ZodObject = class _ZodObject extends ZodType {
82216
82216
  });
82217
82217
  return INVALID;
82218
82218
  }
82219
- const { status, ctx } = this._processInputParams(input);
82219
+ const { status: status4, ctx } = this._processInputParams(input);
82220
82220
  const { shape, keys: shapeKeys } = this._getCached();
82221
82221
  const extraKeys = [];
82222
82222
  if (!(this._def.catchall instanceof ZodNever && this._def.unknownKeys === "strip")) {
@@ -82251,7 +82251,7 @@ var ZodObject = class _ZodObject extends ZodType {
82251
82251
  code: ZodIssueCode.unrecognized_keys,
82252
82252
  keys: extraKeys
82253
82253
  });
82254
- status.dirty();
82254
+ status4.dirty();
82255
82255
  }
82256
82256
  } else if (unknownKeys === "strip") {
82257
82257
  } else {
@@ -82285,10 +82285,10 @@ var ZodObject = class _ZodObject extends ZodType {
82285
82285
  }
82286
82286
  return syncPairs;
82287
82287
  }).then((syncPairs) => {
82288
- return ParseStatus.mergeObjectSync(status, syncPairs);
82288
+ return ParseStatus.mergeObjectSync(status4, syncPairs);
82289
82289
  });
82290
82290
  } else {
82291
- return ParseStatus.mergeObjectSync(status, pairs);
82291
+ return ParseStatus.mergeObjectSync(status4, pairs);
82292
82292
  }
82293
82293
  }
82294
82294
  get shape() {
@@ -82766,7 +82766,7 @@ function mergeValues(a2, b) {
82766
82766
  }
82767
82767
  var ZodIntersection = class extends ZodType {
82768
82768
  _parse(input) {
82769
- const { status, ctx } = this._processInputParams(input);
82769
+ const { status: status4, ctx } = this._processInputParams(input);
82770
82770
  const handleParsed = (parsedLeft, parsedRight) => {
82771
82771
  if (isAborted(parsedLeft) || isAborted(parsedRight)) {
82772
82772
  return INVALID;
@@ -82779,9 +82779,9 @@ var ZodIntersection = class extends ZodType {
82779
82779
  return INVALID;
82780
82780
  }
82781
82781
  if (isDirty(parsedLeft) || isDirty(parsedRight)) {
82782
- status.dirty();
82782
+ status4.dirty();
82783
82783
  }
82784
- return { status: status.value, value: merged.data };
82784
+ return { status: status4.value, value: merged.data };
82785
82785
  };
82786
82786
  if (ctx.common.async) {
82787
82787
  return Promise.all([
@@ -82819,7 +82819,7 @@ ZodIntersection.create = (left, right, params) => {
82819
82819
  };
82820
82820
  var ZodTuple = class _ZodTuple extends ZodType {
82821
82821
  _parse(input) {
82822
- const { status, ctx } = this._processInputParams(input);
82822
+ const { status: status4, ctx } = this._processInputParams(input);
82823
82823
  if (ctx.parsedType !== ZodParsedType.array) {
82824
82824
  addIssueToContext(ctx, {
82825
82825
  code: ZodIssueCode.invalid_type,
@@ -82847,7 +82847,7 @@ var ZodTuple = class _ZodTuple extends ZodType {
82847
82847
  exact: false,
82848
82848
  type: "array"
82849
82849
  });
82850
- status.dirty();
82850
+ status4.dirty();
82851
82851
  }
82852
82852
  const items = [...ctx.data].map((item, itemIndex) => {
82853
82853
  const schema = this._def.items[itemIndex] || this._def.rest;
@@ -82857,10 +82857,10 @@ var ZodTuple = class _ZodTuple extends ZodType {
82857
82857
  }).filter((x) => !!x);
82858
82858
  if (ctx.common.async) {
82859
82859
  return Promise.all(items).then((results) => {
82860
- return ParseStatus.mergeArray(status, results);
82860
+ return ParseStatus.mergeArray(status4, results);
82861
82861
  });
82862
82862
  } else {
82863
- return ParseStatus.mergeArray(status, items);
82863
+ return ParseStatus.mergeArray(status4, items);
82864
82864
  }
82865
82865
  }
82866
82866
  get items() {
@@ -82892,7 +82892,7 @@ var ZodRecord = class _ZodRecord extends ZodType {
82892
82892
  return this._def.valueType;
82893
82893
  }
82894
82894
  _parse(input) {
82895
- const { status, ctx } = this._processInputParams(input);
82895
+ const { status: status4, ctx } = this._processInputParams(input);
82896
82896
  if (ctx.parsedType !== ZodParsedType.object) {
82897
82897
  addIssueToContext(ctx, {
82898
82898
  code: ZodIssueCode.invalid_type,
@@ -82912,9 +82912,9 @@ var ZodRecord = class _ZodRecord extends ZodType {
82912
82912
  });
82913
82913
  }
82914
82914
  if (ctx.common.async) {
82915
- return ParseStatus.mergeObjectAsync(status, pairs);
82915
+ return ParseStatus.mergeObjectAsync(status4, pairs);
82916
82916
  } else {
82917
- return ParseStatus.mergeObjectSync(status, pairs);
82917
+ return ParseStatus.mergeObjectSync(status4, pairs);
82918
82918
  }
82919
82919
  }
82920
82920
  get element() {
@@ -82945,7 +82945,7 @@ var ZodMap = class extends ZodType {
82945
82945
  return this._def.valueType;
82946
82946
  }
82947
82947
  _parse(input) {
82948
- const { status, ctx } = this._processInputParams(input);
82948
+ const { status: status4, ctx } = this._processInputParams(input);
82949
82949
  if (ctx.parsedType !== ZodParsedType.map) {
82950
82950
  addIssueToContext(ctx, {
82951
82951
  code: ZodIssueCode.invalid_type,
@@ -82972,11 +82972,11 @@ var ZodMap = class extends ZodType {
82972
82972
  return INVALID;
82973
82973
  }
82974
82974
  if (key.status === "dirty" || value.status === "dirty") {
82975
- status.dirty();
82975
+ status4.dirty();
82976
82976
  }
82977
82977
  finalMap.set(key.value, value.value);
82978
82978
  }
82979
- return { status: status.value, value: finalMap };
82979
+ return { status: status4.value, value: finalMap };
82980
82980
  });
82981
82981
  } else {
82982
82982
  const finalMap = /* @__PURE__ */ new Map();
@@ -82987,11 +82987,11 @@ var ZodMap = class extends ZodType {
82987
82987
  return INVALID;
82988
82988
  }
82989
82989
  if (key.status === "dirty" || value.status === "dirty") {
82990
- status.dirty();
82990
+ status4.dirty();
82991
82991
  }
82992
82992
  finalMap.set(key.value, value.value);
82993
82993
  }
82994
- return { status: status.value, value: finalMap };
82994
+ return { status: status4.value, value: finalMap };
82995
82995
  }
82996
82996
  }
82997
82997
  };
@@ -83005,7 +83005,7 @@ ZodMap.create = (keyType, valueType, params) => {
83005
83005
  };
83006
83006
  var ZodSet = class _ZodSet extends ZodType {
83007
83007
  _parse(input) {
83008
- const { status, ctx } = this._processInputParams(input);
83008
+ const { status: status4, ctx } = this._processInputParams(input);
83009
83009
  if (ctx.parsedType !== ZodParsedType.set) {
83010
83010
  addIssueToContext(ctx, {
83011
83011
  code: ZodIssueCode.invalid_type,
@@ -83025,7 +83025,7 @@ var ZodSet = class _ZodSet extends ZodType {
83025
83025
  exact: false,
83026
83026
  message: def2.minSize.message
83027
83027
  });
83028
- status.dirty();
83028
+ status4.dirty();
83029
83029
  }
83030
83030
  }
83031
83031
  if (def2.maxSize !== null) {
@@ -83038,7 +83038,7 @@ var ZodSet = class _ZodSet extends ZodType {
83038
83038
  exact: false,
83039
83039
  message: def2.maxSize.message
83040
83040
  });
83041
- status.dirty();
83041
+ status4.dirty();
83042
83042
  }
83043
83043
  }
83044
83044
  const valueType = this._def.valueType;
@@ -83048,10 +83048,10 @@ var ZodSet = class _ZodSet extends ZodType {
83048
83048
  if (element.status === "aborted")
83049
83049
  return INVALID;
83050
83050
  if (element.status === "dirty")
83051
- status.dirty();
83051
+ status4.dirty();
83052
83052
  parsedSet.add(element.value);
83053
83053
  }
83054
- return { status: status.value, value: parsedSet };
83054
+ return { status: status4.value, value: parsedSet };
83055
83055
  }
83056
83056
  const elements = [...ctx.data.values()].map((item, i2) => valueType._parse(new ParseInputLazyPath(ctx, item, ctx.path, i2)));
83057
83057
  if (ctx.common.async) {
@@ -83382,15 +83382,15 @@ var ZodEffects = class extends ZodType {
83382
83382
  return this._def.schema._def.typeName === ZodFirstPartyTypeKind.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
83383
83383
  }
83384
83384
  _parse(input) {
83385
- const { status, ctx } = this._processInputParams(input);
83385
+ const { status: status4, ctx } = this._processInputParams(input);
83386
83386
  const effect = this._def.effect || null;
83387
83387
  const checkCtx = {
83388
83388
  addIssue: (arg) => {
83389
83389
  addIssueToContext(ctx, arg);
83390
83390
  if (arg.fatal) {
83391
- status.abort();
83391
+ status4.abort();
83392
83392
  } else {
83393
- status.dirty();
83393
+ status4.dirty();
83394
83394
  }
83395
83395
  },
83396
83396
  get path() {
@@ -83402,7 +83402,7 @@ var ZodEffects = class extends ZodType {
83402
83402
  const processed = effect.transform(ctx.data, checkCtx);
83403
83403
  if (ctx.common.async) {
83404
83404
  return Promise.resolve(processed).then(async (processed2) => {
83405
- if (status.value === "aborted")
83405
+ if (status4.value === "aborted")
83406
83406
  return INVALID;
83407
83407
  const result = await this._def.schema._parseAsync({
83408
83408
  data: processed2,
@@ -83413,12 +83413,12 @@ var ZodEffects = class extends ZodType {
83413
83413
  return INVALID;
83414
83414
  if (result.status === "dirty")
83415
83415
  return DIRTY(result.value);
83416
- if (status.value === "dirty")
83416
+ if (status4.value === "dirty")
83417
83417
  return DIRTY(result.value);
83418
83418
  return result;
83419
83419
  });
83420
83420
  } else {
83421
- if (status.value === "aborted")
83421
+ if (status4.value === "aborted")
83422
83422
  return INVALID;
83423
83423
  const result = this._def.schema._parseSync({
83424
83424
  data: processed,
@@ -83429,7 +83429,7 @@ var ZodEffects = class extends ZodType {
83429
83429
  return INVALID;
83430
83430
  if (result.status === "dirty")
83431
83431
  return DIRTY(result.value);
83432
- if (status.value === "dirty")
83432
+ if (status4.value === "dirty")
83433
83433
  return DIRTY(result.value);
83434
83434
  return result;
83435
83435
  }
@@ -83454,17 +83454,17 @@ var ZodEffects = class extends ZodType {
83454
83454
  if (inner.status === "aborted")
83455
83455
  return INVALID;
83456
83456
  if (inner.status === "dirty")
83457
- status.dirty();
83457
+ status4.dirty();
83458
83458
  executeRefinement(inner.value);
83459
- return { status: status.value, value: inner.value };
83459
+ return { status: status4.value, value: inner.value };
83460
83460
  } else {
83461
83461
  return this._def.schema._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }).then((inner) => {
83462
83462
  if (inner.status === "aborted")
83463
83463
  return INVALID;
83464
83464
  if (inner.status === "dirty")
83465
- status.dirty();
83465
+ status4.dirty();
83466
83466
  return executeRefinement(inner.value).then(() => {
83467
- return { status: status.value, value: inner.value };
83467
+ return { status: status4.value, value: inner.value };
83468
83468
  });
83469
83469
  });
83470
83470
  }
@@ -83482,13 +83482,13 @@ var ZodEffects = class extends ZodType {
83482
83482
  if (result instanceof Promise) {
83483
83483
  throw new Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);
83484
83484
  }
83485
- return { status: status.value, value: result };
83485
+ return { status: status4.value, value: result };
83486
83486
  } else {
83487
83487
  return this._def.schema._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }).then((base) => {
83488
83488
  if (!isValid(base))
83489
83489
  return INVALID;
83490
83490
  return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({
83491
- status: status.value,
83491
+ status: status4.value,
83492
83492
  value: result
83493
83493
  }));
83494
83494
  });
@@ -83667,7 +83667,7 @@ var ZodBranded = class extends ZodType {
83667
83667
  };
83668
83668
  var ZodPipeline = class _ZodPipeline extends ZodType {
83669
83669
  _parse(input) {
83670
- const { status, ctx } = this._processInputParams(input);
83670
+ const { status: status4, ctx } = this._processInputParams(input);
83671
83671
  if (ctx.common.async) {
83672
83672
  const handleAsync = async () => {
83673
83673
  const inResult = await this._def.in._parseAsync({
@@ -83678,7 +83678,7 @@ var ZodPipeline = class _ZodPipeline extends ZodType {
83678
83678
  if (inResult.status === "aborted")
83679
83679
  return INVALID;
83680
83680
  if (inResult.status === "dirty") {
83681
- status.dirty();
83681
+ status4.dirty();
83682
83682
  return DIRTY(inResult.value);
83683
83683
  } else {
83684
83684
  return this._def.out._parseAsync({
@@ -83698,7 +83698,7 @@ var ZodPipeline = class _ZodPipeline extends ZodType {
83698
83698
  if (inResult.status === "aborted")
83699
83699
  return INVALID;
83700
83700
  if (inResult.status === "dirty") {
83701
- status.dirty();
83701
+ status4.dirty();
83702
83702
  return {
83703
83703
  status: "dirty",
83704
83704
  value: inResult.value
@@ -83989,6 +83989,16 @@ var ActionSchema = external_exports.object({
83989
83989
  message: "actions with scope 'repos' or 'repos:<id>' require a single-character `key` (the action panel can't surface them without one)",
83990
83990
  path: ["key"]
83991
83991
  });
83992
+ var ComposerSettingsSchema = external_exports.object({
83993
+ /**
83994
+ * Workspace-relative directories that contain a `composer.lock`. The
83995
+ * auto-registered `composer-drift` health check scans each entry for
83996
+ * lock-vs-vendor mtime drift. Default: `['.']` (root only). Wrappers with
83997
+ * nested PHP roots (Bedrock-style `project/`, monorepos, etc.) list each
83998
+ * scope explicitly. `'.'` and `''` both resolve to workspaceRoot.
83999
+ */
84000
+ packageDirs: external_exports.array(external_exports.string()).optional().default(["."])
84001
+ });
83992
84002
  var MountSettingsSchema = external_exports.object({
83993
84003
  /**
83994
84004
  * Override path for the generated docker-compose overlay. When unset
@@ -84021,6 +84031,7 @@ var BaseCockpitConfigSchema = external_exports.object({
84021
84031
  mount: MountSettingsSchema.optional().default({
84022
84032
  manifestFile: "mount.manifest.json"
84023
84033
  }),
84034
+ composer: ComposerSettingsSchema.optional().default({ packageDirs: ["."] }),
84024
84035
  /** Which pane the cockpit lands on when it boots. Profile may override. */
84025
84036
  defaultPane: external_exports.enum(["repos", "output", "health", "help"]).optional().default("repos"),
84026
84037
  /** Named keystroke-bound shell commands surfaced via the `:` palette. */
@@ -84206,10 +84217,10 @@ var cockpitStore = createStore()((set, get2) => ({
84206
84217
  selectedRecentErrorIndex: 0,
84207
84218
  activeRemediation: null,
84208
84219
  helpConfig: {},
84209
- setRepoStatus: (key, status) => set((state) => {
84220
+ setRepoStatus: (key, status4) => set((state) => {
84210
84221
  const existing = state.repos[key];
84211
84222
  if (!existing) return state;
84212
- return { repos: { ...state.repos, [key]: { ...existing, status } } };
84223
+ return { repos: { ...state.repos, [key]: { ...existing, status: status4 } } };
84213
84224
  }),
84214
84225
  setLintStatus: (key, lintStatus) => set((state) => ({
84215
84226
  repoLintStatus: { ...state.repoLintStatus, [key]: lintStatus }
@@ -84379,8 +84390,8 @@ function findActionByKey(actions, rowKey, keypress) {
84379
84390
 
84380
84391
  // src/cockpit/panes/Repos.tsx
84381
84392
  var import_jsx_runtime = __toESM(require_jsx_runtime(), 1);
84382
- function statusGlyph(status) {
84383
- switch (status) {
84393
+ function statusGlyph(status4) {
84394
+ switch (status4) {
84384
84395
  case "running":
84385
84396
  return { glyph: "\u25CF", color: "green" };
84386
84397
  case "failing":
@@ -88186,23 +88197,23 @@ var httpOk = (entry) => {
88186
88197
  }
88187
88198
  const expect = entry.expectStatus ?? 200;
88188
88199
  return async () => {
88189
- let status = 0;
88200
+ let status4 = 0;
88190
88201
  let detail = "";
88191
88202
  try {
88192
88203
  const ac = new AbortController();
88193
88204
  const t = setTimeout(() => ac.abort(), 5e3);
88194
88205
  const res = await fetch(url, { signal: ac.signal });
88195
88206
  clearTimeout(t);
88196
- status = res.status;
88207
+ status4 = res.status;
88197
88208
  } catch (err) {
88198
88209
  detail = `fetch failed: ${String(err.message ?? err)}`;
88199
88210
  }
88200
- const ok = status === expect;
88211
+ const ok = status4 === expect;
88201
88212
  return {
88202
88213
  id: entry.id,
88203
88214
  label: entry.label,
88204
88215
  severity: ok ? "ok" : entry.severity ?? "error",
88205
- detail: ok ? `${url} returned ${status}` : detail || `${url} returned ${status} (expected ${expect})`,
88216
+ detail: ok ? `${url} returned ${status4}` : detail || `${url} returned ${status4} (expected ${expect})`,
88206
88217
  remediationKey: entry.remediation.key
88207
88218
  };
88208
88219
  };
@@ -88313,6 +88324,11 @@ function buildHealthRegistry(opts = {}) {
88313
88324
  seenIds.add(check.id);
88314
88325
  out.push(check);
88315
88326
  }
88327
+ for (const check of opts.autoChecks ?? []) {
88328
+ if (seenIds.has(check.id)) continue;
88329
+ seenIds.add(check.id);
88330
+ out.push(check);
88331
+ }
88316
88332
  return out;
88317
88333
  }
88318
88334
  function safeLogger() {
@@ -88837,7 +88853,7 @@ var ReaddirpStream = class extends Readable4 {
88837
88853
  this._directoryFilter = normalizeFilter(opts.directoryFilter);
88838
88854
  const statMethod = opts.lstat ? lstat : stat;
88839
88855
  if (wantBigintFsStats) {
88840
- this._stat = (path23) => statMethod(path23, { bigint: true });
88856
+ this._stat = (path26) => statMethod(path26, { bigint: true });
88841
88857
  } else {
88842
88858
  this._stat = statMethod;
88843
88859
  }
@@ -88862,8 +88878,8 @@ var ReaddirpStream = class extends Readable4 {
88862
88878
  const par = this.parent;
88863
88879
  const fil = par && par.files;
88864
88880
  if (fil && fil.length > 0) {
88865
- const { path: path23, depth } = par;
88866
- const slice = fil.splice(0, batch).map((dirent) => this._formatEntry(dirent, path23));
88881
+ const { path: path26, depth } = par;
88882
+ const slice = fil.splice(0, batch).map((dirent) => this._formatEntry(dirent, path26));
88867
88883
  const awaited = await Promise.all(slice);
88868
88884
  for (const entry of awaited) {
88869
88885
  if (!entry)
@@ -88903,20 +88919,20 @@ var ReaddirpStream = class extends Readable4 {
88903
88919
  this.reading = false;
88904
88920
  }
88905
88921
  }
88906
- async _exploreDir(path23, depth) {
88922
+ async _exploreDir(path26, depth) {
88907
88923
  let files;
88908
88924
  try {
88909
- files = await readdir(path23, this._rdOptions);
88925
+ files = await readdir(path26, this._rdOptions);
88910
88926
  } catch (error) {
88911
88927
  this._onError(error);
88912
88928
  }
88913
- return { files, depth, path: path23 };
88929
+ return { files, depth, path: path26 };
88914
88930
  }
88915
- async _formatEntry(dirent, path23) {
88931
+ async _formatEntry(dirent, path26) {
88916
88932
  let entry;
88917
88933
  const basename3 = this._isDirent ? dirent.name : dirent;
88918
88934
  try {
88919
- const fullPath = presolve(pjoin(path23, basename3));
88935
+ const fullPath = presolve(pjoin(path26, basename3));
88920
88936
  entry = { path: prelative(this._root, fullPath), fullPath, basename: basename3 };
88921
88937
  entry[this._statsProp] = this._isDirent ? dirent : await this._stat(fullPath);
88922
88938
  } catch (err) {
@@ -89316,16 +89332,16 @@ var delFromSet = (main, prop, item) => {
89316
89332
  };
89317
89333
  var isEmptySet = (val) => val instanceof Set ? val.size === 0 : !val;
89318
89334
  var FsWatchInstances = /* @__PURE__ */ new Map();
89319
- function createFsWatchInstance(path23, options2, listener, errHandler, emitRaw) {
89335
+ function createFsWatchInstance(path26, options2, listener, errHandler, emitRaw) {
89320
89336
  const handleEvent = (rawEvent, evPath) => {
89321
- listener(path23);
89322
- emitRaw(rawEvent, evPath, { watchedPath: path23 });
89323
- if (evPath && path23 !== evPath) {
89324
- fsWatchBroadcast(sp.resolve(path23, evPath), KEY_LISTENERS, sp.join(path23, evPath));
89337
+ listener(path26);
89338
+ emitRaw(rawEvent, evPath, { watchedPath: path26 });
89339
+ if (evPath && path26 !== evPath) {
89340
+ fsWatchBroadcast(sp.resolve(path26, evPath), KEY_LISTENERS, sp.join(path26, evPath));
89325
89341
  }
89326
89342
  };
89327
89343
  try {
89328
- return fs_watch(path23, {
89344
+ return fs_watch(path26, {
89329
89345
  persistent: options2.persistent
89330
89346
  }, handleEvent);
89331
89347
  } catch (error) {
@@ -89341,12 +89357,12 @@ var fsWatchBroadcast = (fullPath, listenerType, val1, val2, val3) => {
89341
89357
  listener(val1, val2, val3);
89342
89358
  });
89343
89359
  };
89344
- var setFsWatchListener = (path23, fullPath, options2, handlers) => {
89360
+ var setFsWatchListener = (path26, fullPath, options2, handlers) => {
89345
89361
  const { listener, errHandler, rawEmitter } = handlers;
89346
89362
  let cont = FsWatchInstances.get(fullPath);
89347
89363
  let watcher;
89348
89364
  if (!options2.persistent) {
89349
- watcher = createFsWatchInstance(path23, options2, listener, errHandler, rawEmitter);
89365
+ watcher = createFsWatchInstance(path26, options2, listener, errHandler, rawEmitter);
89350
89366
  if (!watcher)
89351
89367
  return;
89352
89368
  return watcher.close.bind(watcher);
@@ -89357,7 +89373,7 @@ var setFsWatchListener = (path23, fullPath, options2, handlers) => {
89357
89373
  addAndConvert(cont, KEY_RAW, rawEmitter);
89358
89374
  } else {
89359
89375
  watcher = createFsWatchInstance(
89360
- path23,
89376
+ path26,
89361
89377
  options2,
89362
89378
  fsWatchBroadcast.bind(null, fullPath, KEY_LISTENERS),
89363
89379
  errHandler,
@@ -89372,7 +89388,7 @@ var setFsWatchListener = (path23, fullPath, options2, handlers) => {
89372
89388
  cont.watcherUnusable = true;
89373
89389
  if (isWindows && error.code === "EPERM") {
89374
89390
  try {
89375
- const fd = await open(path23, "r");
89391
+ const fd = await open(path26, "r");
89376
89392
  await fd.close();
89377
89393
  broadcastErr(error);
89378
89394
  } catch (err) {
@@ -89403,7 +89419,7 @@ var setFsWatchListener = (path23, fullPath, options2, handlers) => {
89403
89419
  };
89404
89420
  };
89405
89421
  var FsWatchFileInstances = /* @__PURE__ */ new Map();
89406
- var setFsWatchFileListener = (path23, fullPath, options2, handlers) => {
89422
+ var setFsWatchFileListener = (path26, fullPath, options2, handlers) => {
89407
89423
  const { listener, rawEmitter } = handlers;
89408
89424
  let cont = FsWatchFileInstances.get(fullPath);
89409
89425
  const copts = cont && cont.options;
@@ -89425,7 +89441,7 @@ var setFsWatchFileListener = (path23, fullPath, options2, handlers) => {
89425
89441
  });
89426
89442
  const currmtime = curr.mtimeMs;
89427
89443
  if (curr.size !== prev.size || currmtime > prev.mtimeMs || currmtime === 0) {
89428
- foreach(cont.listeners, (listener2) => listener2(path23, curr));
89444
+ foreach(cont.listeners, (listener2) => listener2(path26, curr));
89429
89445
  }
89430
89446
  })
89431
89447
  };
@@ -89455,13 +89471,13 @@ var NodeFsHandler = class {
89455
89471
  * @param listener on fs change
89456
89472
  * @returns closer for the watcher instance
89457
89473
  */
89458
- _watchWithNodeFs(path23, listener) {
89474
+ _watchWithNodeFs(path26, listener) {
89459
89475
  const opts = this.fsw.options;
89460
- const directory = sp.dirname(path23);
89461
- const basename3 = sp.basename(path23);
89476
+ const directory = sp.dirname(path26);
89477
+ const basename3 = sp.basename(path26);
89462
89478
  const parent = this.fsw._getWatchedDir(directory);
89463
89479
  parent.add(basename3);
89464
- const absolutePath = sp.resolve(path23);
89480
+ const absolutePath = sp.resolve(path26);
89465
89481
  const options2 = {
89466
89482
  persistent: opts.persistent
89467
89483
  };
@@ -89471,12 +89487,12 @@ var NodeFsHandler = class {
89471
89487
  if (opts.usePolling) {
89472
89488
  const enableBin = opts.interval !== opts.binaryInterval;
89473
89489
  options2.interval = enableBin && isBinaryPath(basename3) ? opts.binaryInterval : opts.interval;
89474
- closer = setFsWatchFileListener(path23, absolutePath, options2, {
89490
+ closer = setFsWatchFileListener(path26, absolutePath, options2, {
89475
89491
  listener,
89476
89492
  rawEmitter: this.fsw._emitRaw
89477
89493
  });
89478
89494
  } else {
89479
- closer = setFsWatchListener(path23, absolutePath, options2, {
89495
+ closer = setFsWatchListener(path26, absolutePath, options2, {
89480
89496
  listener,
89481
89497
  errHandler: this._boundHandleError,
89482
89498
  rawEmitter: this.fsw._emitRaw
@@ -89498,7 +89514,7 @@ var NodeFsHandler = class {
89498
89514
  let prevStats = stats;
89499
89515
  if (parent.has(basename3))
89500
89516
  return;
89501
- const listener = async (path23, newStats) => {
89517
+ const listener = async (path26, newStats) => {
89502
89518
  if (!this.fsw._throttle(THROTTLE_MODE_WATCH, file, 5))
89503
89519
  return;
89504
89520
  if (!newStats || newStats.mtimeMs === 0) {
@@ -89512,11 +89528,11 @@ var NodeFsHandler = class {
89512
89528
  this.fsw._emit(EV.CHANGE, file, newStats2);
89513
89529
  }
89514
89530
  if ((isMacos || isLinux || isFreeBSD) && prevStats.ino !== newStats2.ino) {
89515
- this.fsw._closeFile(path23);
89531
+ this.fsw._closeFile(path26);
89516
89532
  prevStats = newStats2;
89517
89533
  const closer2 = this._watchWithNodeFs(file, listener);
89518
89534
  if (closer2)
89519
- this.fsw._addPathCloser(path23, closer2);
89535
+ this.fsw._addPathCloser(path26, closer2);
89520
89536
  } else {
89521
89537
  prevStats = newStats2;
89522
89538
  }
@@ -89548,7 +89564,7 @@ var NodeFsHandler = class {
89548
89564
  * @param item basename of this item
89549
89565
  * @returns true if no more processing is needed for this entry.
89550
89566
  */
89551
- async _handleSymlink(entry, directory, path23, item) {
89567
+ async _handleSymlink(entry, directory, path26, item) {
89552
89568
  if (this.fsw.closed) {
89553
89569
  return;
89554
89570
  }
@@ -89558,7 +89574,7 @@ var NodeFsHandler = class {
89558
89574
  this.fsw._incrReadyCount();
89559
89575
  let linkPath;
89560
89576
  try {
89561
- linkPath = await fsrealpath(path23);
89577
+ linkPath = await fsrealpath(path26);
89562
89578
  } catch (e) {
89563
89579
  this.fsw._emitReady();
89564
89580
  return true;
@@ -89568,12 +89584,12 @@ var NodeFsHandler = class {
89568
89584
  if (dir.has(item)) {
89569
89585
  if (this.fsw._symlinkPaths.get(full) !== linkPath) {
89570
89586
  this.fsw._symlinkPaths.set(full, linkPath);
89571
- this.fsw._emit(EV.CHANGE, path23, entry.stats);
89587
+ this.fsw._emit(EV.CHANGE, path26, entry.stats);
89572
89588
  }
89573
89589
  } else {
89574
89590
  dir.add(item);
89575
89591
  this.fsw._symlinkPaths.set(full, linkPath);
89576
- this.fsw._emit(EV.ADD, path23, entry.stats);
89592
+ this.fsw._emit(EV.ADD, path26, entry.stats);
89577
89593
  }
89578
89594
  this.fsw._emitReady();
89579
89595
  return true;
@@ -89603,9 +89619,9 @@ var NodeFsHandler = class {
89603
89619
  return;
89604
89620
  }
89605
89621
  const item = entry.path;
89606
- let path23 = sp.join(directory, item);
89622
+ let path26 = sp.join(directory, item);
89607
89623
  current.add(item);
89608
- if (entry.stats.isSymbolicLink() && await this._handleSymlink(entry, directory, path23, item)) {
89624
+ if (entry.stats.isSymbolicLink() && await this._handleSymlink(entry, directory, path26, item)) {
89609
89625
  return;
89610
89626
  }
89611
89627
  if (this.fsw.closed) {
@@ -89614,8 +89630,8 @@ var NodeFsHandler = class {
89614
89630
  }
89615
89631
  if (item === target || !target && !previous.has(item)) {
89616
89632
  this.fsw._incrReadyCount();
89617
- path23 = sp.join(dir, sp.relative(dir, path23));
89618
- this._addToNodeFs(path23, initialAdd, wh, depth + 1);
89633
+ path26 = sp.join(dir, sp.relative(dir, path26));
89634
+ this._addToNodeFs(path26, initialAdd, wh, depth + 1);
89619
89635
  }
89620
89636
  }).on(EV.ERROR, this._boundHandleError);
89621
89637
  return new Promise((resolve3, reject) => {
@@ -89684,13 +89700,13 @@ var NodeFsHandler = class {
89684
89700
  * @param depth Child path actually targeted for watch
89685
89701
  * @param target Child path actually targeted for watch
89686
89702
  */
89687
- async _addToNodeFs(path23, initialAdd, priorWh, depth, target) {
89703
+ async _addToNodeFs(path26, initialAdd, priorWh, depth, target) {
89688
89704
  const ready = this.fsw._emitReady;
89689
- if (this.fsw._isIgnored(path23) || this.fsw.closed) {
89705
+ if (this.fsw._isIgnored(path26) || this.fsw.closed) {
89690
89706
  ready();
89691
89707
  return false;
89692
89708
  }
89693
- const wh = this.fsw._getWatchHelpers(path23);
89709
+ const wh = this.fsw._getWatchHelpers(path26);
89694
89710
  if (priorWh) {
89695
89711
  wh.filterPath = (entry) => priorWh.filterPath(entry);
89696
89712
  wh.filterDir = (entry) => priorWh.filterDir(entry);
@@ -89706,8 +89722,8 @@ var NodeFsHandler = class {
89706
89722
  const follow = this.fsw.options.followSymlinks;
89707
89723
  let closer;
89708
89724
  if (stats.isDirectory()) {
89709
- const absPath = sp.resolve(path23);
89710
- const targetPath = follow ? await fsrealpath(path23) : path23;
89725
+ const absPath = sp.resolve(path26);
89726
+ const targetPath = follow ? await fsrealpath(path26) : path26;
89711
89727
  if (this.fsw.closed)
89712
89728
  return;
89713
89729
  closer = await this._handleDir(wh.watchPath, stats, initialAdd, depth, target, wh, targetPath);
@@ -89717,29 +89733,29 @@ var NodeFsHandler = class {
89717
89733
  this.fsw._symlinkPaths.set(absPath, targetPath);
89718
89734
  }
89719
89735
  } else if (stats.isSymbolicLink()) {
89720
- const targetPath = follow ? await fsrealpath(path23) : path23;
89736
+ const targetPath = follow ? await fsrealpath(path26) : path26;
89721
89737
  if (this.fsw.closed)
89722
89738
  return;
89723
89739
  const parent = sp.dirname(wh.watchPath);
89724
89740
  this.fsw._getWatchedDir(parent).add(wh.watchPath);
89725
89741
  this.fsw._emit(EV.ADD, wh.watchPath, stats);
89726
- closer = await this._handleDir(parent, stats, initialAdd, depth, path23, wh, targetPath);
89742
+ closer = await this._handleDir(parent, stats, initialAdd, depth, path26, wh, targetPath);
89727
89743
  if (this.fsw.closed)
89728
89744
  return;
89729
89745
  if (targetPath !== void 0) {
89730
- this.fsw._symlinkPaths.set(sp.resolve(path23), targetPath);
89746
+ this.fsw._symlinkPaths.set(sp.resolve(path26), targetPath);
89731
89747
  }
89732
89748
  } else {
89733
89749
  closer = this._handleFile(wh.watchPath, stats, initialAdd);
89734
89750
  }
89735
89751
  ready();
89736
89752
  if (closer)
89737
- this.fsw._addPathCloser(path23, closer);
89753
+ this.fsw._addPathCloser(path26, closer);
89738
89754
  return false;
89739
89755
  } catch (error) {
89740
89756
  if (this.fsw._handleError(error)) {
89741
89757
  ready();
89742
- return path23;
89758
+ return path26;
89743
89759
  }
89744
89760
  }
89745
89761
  }
@@ -89782,24 +89798,24 @@ function createPattern(matcher) {
89782
89798
  }
89783
89799
  return () => false;
89784
89800
  }
89785
- function normalizePath(path23) {
89786
- if (typeof path23 !== "string")
89801
+ function normalizePath(path26) {
89802
+ if (typeof path26 !== "string")
89787
89803
  throw new Error("string expected");
89788
- path23 = sp2.normalize(path23);
89789
- path23 = path23.replace(/\\/g, "/");
89804
+ path26 = sp2.normalize(path26);
89805
+ path26 = path26.replace(/\\/g, "/");
89790
89806
  let prepend = false;
89791
- if (path23.startsWith("//"))
89807
+ if (path26.startsWith("//"))
89792
89808
  prepend = true;
89793
- path23 = path23.replace(DOUBLE_SLASH_RE, "/");
89809
+ path26 = path26.replace(DOUBLE_SLASH_RE, "/");
89794
89810
  if (prepend)
89795
- path23 = "/" + path23;
89796
- return path23;
89811
+ path26 = "/" + path26;
89812
+ return path26;
89797
89813
  }
89798
89814
  function matchPatterns(patterns, testString, stats) {
89799
- const path23 = normalizePath(testString);
89815
+ const path26 = normalizePath(testString);
89800
89816
  for (let index = 0; index < patterns.length; index++) {
89801
89817
  const pattern = patterns[index];
89802
- if (pattern(path23, stats)) {
89818
+ if (pattern(path26, stats)) {
89803
89819
  return true;
89804
89820
  }
89805
89821
  }
@@ -89837,19 +89853,19 @@ var toUnix = (string) => {
89837
89853
  }
89838
89854
  return str;
89839
89855
  };
89840
- var normalizePathToUnix = (path23) => toUnix(sp2.normalize(toUnix(path23)));
89841
- var normalizeIgnored = (cwd = "") => (path23) => {
89842
- if (typeof path23 === "string") {
89843
- return normalizePathToUnix(sp2.isAbsolute(path23) ? path23 : sp2.join(cwd, path23));
89856
+ var normalizePathToUnix = (path26) => toUnix(sp2.normalize(toUnix(path26)));
89857
+ var normalizeIgnored = (cwd = "") => (path26) => {
89858
+ if (typeof path26 === "string") {
89859
+ return normalizePathToUnix(sp2.isAbsolute(path26) ? path26 : sp2.join(cwd, path26));
89844
89860
  } else {
89845
- return path23;
89861
+ return path26;
89846
89862
  }
89847
89863
  };
89848
- var getAbsolutePath = (path23, cwd) => {
89849
- if (sp2.isAbsolute(path23)) {
89850
- return path23;
89864
+ var getAbsolutePath = (path26, cwd) => {
89865
+ if (sp2.isAbsolute(path26)) {
89866
+ return path26;
89851
89867
  }
89852
- return sp2.join(cwd, path23);
89868
+ return sp2.join(cwd, path26);
89853
89869
  };
89854
89870
  var EMPTY_SET = Object.freeze(/* @__PURE__ */ new Set());
89855
89871
  var DirEntry = class {
@@ -89914,10 +89930,10 @@ var WatchHelper = class {
89914
89930
  dirParts;
89915
89931
  followSymlinks;
89916
89932
  statMethod;
89917
- constructor(path23, follow, fsw) {
89933
+ constructor(path26, follow, fsw) {
89918
89934
  this.fsw = fsw;
89919
- const watchPath = path23;
89920
- this.path = path23 = path23.replace(REPLACER_RE, "");
89935
+ const watchPath = path26;
89936
+ this.path = path26 = path26.replace(REPLACER_RE, "");
89921
89937
  this.watchPath = watchPath;
89922
89938
  this.fullWatchPath = sp2.resolve(watchPath);
89923
89939
  this.dirParts = [];
@@ -90057,20 +90073,20 @@ var FSWatcher = class extends EventEmitter2 {
90057
90073
  this._closePromise = void 0;
90058
90074
  let paths = unifyPaths(paths_);
90059
90075
  if (cwd) {
90060
- paths = paths.map((path23) => {
90061
- const absPath = getAbsolutePath(path23, cwd);
90076
+ paths = paths.map((path26) => {
90077
+ const absPath = getAbsolutePath(path26, cwd);
90062
90078
  return absPath;
90063
90079
  });
90064
90080
  }
90065
- paths.forEach((path23) => {
90066
- this._removeIgnoredPath(path23);
90081
+ paths.forEach((path26) => {
90082
+ this._removeIgnoredPath(path26);
90067
90083
  });
90068
90084
  this._userIgnored = void 0;
90069
90085
  if (!this._readyCount)
90070
90086
  this._readyCount = 0;
90071
90087
  this._readyCount += paths.length;
90072
- Promise.all(paths.map(async (path23) => {
90073
- const res = await this._nodeFsHandler._addToNodeFs(path23, !_internal, void 0, 0, _origAdd);
90088
+ Promise.all(paths.map(async (path26) => {
90089
+ const res = await this._nodeFsHandler._addToNodeFs(path26, !_internal, void 0, 0, _origAdd);
90074
90090
  if (res)
90075
90091
  this._emitReady();
90076
90092
  return res;
@@ -90092,17 +90108,17 @@ var FSWatcher = class extends EventEmitter2 {
90092
90108
  return this;
90093
90109
  const paths = unifyPaths(paths_);
90094
90110
  const { cwd } = this.options;
90095
- paths.forEach((path23) => {
90096
- if (!sp2.isAbsolute(path23) && !this._closers.has(path23)) {
90111
+ paths.forEach((path26) => {
90112
+ if (!sp2.isAbsolute(path26) && !this._closers.has(path26)) {
90097
90113
  if (cwd)
90098
- path23 = sp2.join(cwd, path23);
90099
- path23 = sp2.resolve(path23);
90114
+ path26 = sp2.join(cwd, path26);
90115
+ path26 = sp2.resolve(path26);
90100
90116
  }
90101
- this._closePath(path23);
90102
- this._addIgnoredPath(path23);
90103
- if (this._watched.has(path23)) {
90117
+ this._closePath(path26);
90118
+ this._addIgnoredPath(path26);
90119
+ if (this._watched.has(path26)) {
90104
90120
  this._addIgnoredPath({
90105
- path: path23,
90121
+ path: path26,
90106
90122
  recursive: true
90107
90123
  });
90108
90124
  }
@@ -90166,38 +90182,38 @@ var FSWatcher = class extends EventEmitter2 {
90166
90182
  * @param stats arguments to be passed with event
90167
90183
  * @returns the error if defined, otherwise the value of the FSWatcher instance's `closed` flag
90168
90184
  */
90169
- async _emit(event, path23, stats) {
90185
+ async _emit(event, path26, stats) {
90170
90186
  if (this.closed)
90171
90187
  return;
90172
90188
  const opts = this.options;
90173
90189
  if (isWindows)
90174
- path23 = sp2.normalize(path23);
90190
+ path26 = sp2.normalize(path26);
90175
90191
  if (opts.cwd)
90176
- path23 = sp2.relative(opts.cwd, path23);
90177
- const args = [path23];
90192
+ path26 = sp2.relative(opts.cwd, path26);
90193
+ const args = [path26];
90178
90194
  if (stats != null)
90179
90195
  args.push(stats);
90180
90196
  const awf = opts.awaitWriteFinish;
90181
90197
  let pw;
90182
- if (awf && (pw = this._pendingWrites.get(path23))) {
90198
+ if (awf && (pw = this._pendingWrites.get(path26))) {
90183
90199
  pw.lastChange = /* @__PURE__ */ new Date();
90184
90200
  return this;
90185
90201
  }
90186
90202
  if (opts.atomic) {
90187
90203
  if (event === EVENTS.UNLINK) {
90188
- this._pendingUnlinks.set(path23, [event, ...args]);
90204
+ this._pendingUnlinks.set(path26, [event, ...args]);
90189
90205
  setTimeout(() => {
90190
- this._pendingUnlinks.forEach((entry, path24) => {
90206
+ this._pendingUnlinks.forEach((entry, path27) => {
90191
90207
  this.emit(...entry);
90192
90208
  this.emit(EVENTS.ALL, ...entry);
90193
- this._pendingUnlinks.delete(path24);
90209
+ this._pendingUnlinks.delete(path27);
90194
90210
  });
90195
90211
  }, typeof opts.atomic === "number" ? opts.atomic : 100);
90196
90212
  return this;
90197
90213
  }
90198
- if (event === EVENTS.ADD && this._pendingUnlinks.has(path23)) {
90214
+ if (event === EVENTS.ADD && this._pendingUnlinks.has(path26)) {
90199
90215
  event = EVENTS.CHANGE;
90200
- this._pendingUnlinks.delete(path23);
90216
+ this._pendingUnlinks.delete(path26);
90201
90217
  }
90202
90218
  }
90203
90219
  if (awf && (event === EVENTS.ADD || event === EVENTS.CHANGE) && this._readyEmitted) {
@@ -90215,16 +90231,16 @@ var FSWatcher = class extends EventEmitter2 {
90215
90231
  this.emitWithAll(event, args);
90216
90232
  }
90217
90233
  };
90218
- this._awaitWriteFinish(path23, awf.stabilityThreshold, event, awfEmit);
90234
+ this._awaitWriteFinish(path26, awf.stabilityThreshold, event, awfEmit);
90219
90235
  return this;
90220
90236
  }
90221
90237
  if (event === EVENTS.CHANGE) {
90222
- const isThrottled = !this._throttle(EVENTS.CHANGE, path23, 50);
90238
+ const isThrottled = !this._throttle(EVENTS.CHANGE, path26, 50);
90223
90239
  if (isThrottled)
90224
90240
  return this;
90225
90241
  }
90226
90242
  if (opts.alwaysStat && stats === void 0 && (event === EVENTS.ADD || event === EVENTS.ADD_DIR || event === EVENTS.CHANGE)) {
90227
- const fullPath = opts.cwd ? sp2.join(opts.cwd, path23) : path23;
90243
+ const fullPath = opts.cwd ? sp2.join(opts.cwd, path26) : path26;
90228
90244
  let stats2;
90229
90245
  try {
90230
90246
  stats2 = await stat3(fullPath);
@@ -90255,23 +90271,23 @@ var FSWatcher = class extends EventEmitter2 {
90255
90271
  * @param timeout duration of time to suppress duplicate actions
90256
90272
  * @returns tracking object or false if action should be suppressed
90257
90273
  */
90258
- _throttle(actionType, path23, timeout) {
90274
+ _throttle(actionType, path26, timeout) {
90259
90275
  if (!this._throttled.has(actionType)) {
90260
90276
  this._throttled.set(actionType, /* @__PURE__ */ new Map());
90261
90277
  }
90262
90278
  const action = this._throttled.get(actionType);
90263
90279
  if (!action)
90264
90280
  throw new Error("invalid throttle");
90265
- const actionPath = action.get(path23);
90281
+ const actionPath = action.get(path26);
90266
90282
  if (actionPath) {
90267
90283
  actionPath.count++;
90268
90284
  return false;
90269
90285
  }
90270
90286
  let timeoutObject;
90271
90287
  const clear = () => {
90272
- const item = action.get(path23);
90288
+ const item = action.get(path26);
90273
90289
  const count2 = item ? item.count : 0;
90274
- action.delete(path23);
90290
+ action.delete(path26);
90275
90291
  clearTimeout(timeoutObject);
90276
90292
  if (item)
90277
90293
  clearTimeout(item.timeoutObject);
@@ -90279,7 +90295,7 @@ var FSWatcher = class extends EventEmitter2 {
90279
90295
  };
90280
90296
  timeoutObject = setTimeout(clear, timeout);
90281
90297
  const thr = { timeoutObject, clear, count: 0 };
90282
- action.set(path23, thr);
90298
+ action.set(path26, thr);
90283
90299
  return thr;
90284
90300
  }
90285
90301
  _incrReadyCount() {
@@ -90293,44 +90309,44 @@ var FSWatcher = class extends EventEmitter2 {
90293
90309
  * @param event
90294
90310
  * @param awfEmit Callback to be called when ready for event to be emitted.
90295
90311
  */
90296
- _awaitWriteFinish(path23, threshold, event, awfEmit) {
90312
+ _awaitWriteFinish(path26, threshold, event, awfEmit) {
90297
90313
  const awf = this.options.awaitWriteFinish;
90298
90314
  if (typeof awf !== "object")
90299
90315
  return;
90300
90316
  const pollInterval = awf.pollInterval;
90301
90317
  let timeoutHandler;
90302
- let fullPath = path23;
90303
- if (this.options.cwd && !sp2.isAbsolute(path23)) {
90304
- fullPath = sp2.join(this.options.cwd, path23);
90318
+ let fullPath = path26;
90319
+ if (this.options.cwd && !sp2.isAbsolute(path26)) {
90320
+ fullPath = sp2.join(this.options.cwd, path26);
90305
90321
  }
90306
90322
  const now = /* @__PURE__ */ new Date();
90307
90323
  const writes = this._pendingWrites;
90308
90324
  function awaitWriteFinishFn(prevStat) {
90309
90325
  statcb(fullPath, (err, curStat) => {
90310
- if (err || !writes.has(path23)) {
90326
+ if (err || !writes.has(path26)) {
90311
90327
  if (err && err.code !== "ENOENT")
90312
90328
  awfEmit(err);
90313
90329
  return;
90314
90330
  }
90315
90331
  const now2 = Number(/* @__PURE__ */ new Date());
90316
90332
  if (prevStat && curStat.size !== prevStat.size) {
90317
- writes.get(path23).lastChange = now2;
90333
+ writes.get(path26).lastChange = now2;
90318
90334
  }
90319
- const pw = writes.get(path23);
90335
+ const pw = writes.get(path26);
90320
90336
  const df = now2 - pw.lastChange;
90321
90337
  if (df >= threshold) {
90322
- writes.delete(path23);
90338
+ writes.delete(path26);
90323
90339
  awfEmit(void 0, curStat);
90324
90340
  } else {
90325
90341
  timeoutHandler = setTimeout(awaitWriteFinishFn, pollInterval, curStat);
90326
90342
  }
90327
90343
  });
90328
90344
  }
90329
- if (!writes.has(path23)) {
90330
- writes.set(path23, {
90345
+ if (!writes.has(path26)) {
90346
+ writes.set(path26, {
90331
90347
  lastChange: now,
90332
90348
  cancelWait: () => {
90333
- writes.delete(path23);
90349
+ writes.delete(path26);
90334
90350
  clearTimeout(timeoutHandler);
90335
90351
  return event;
90336
90352
  }
@@ -90341,8 +90357,8 @@ var FSWatcher = class extends EventEmitter2 {
90341
90357
  /**
90342
90358
  * Determines whether user has asked to ignore this path.
90343
90359
  */
90344
- _isIgnored(path23, stats) {
90345
- if (this.options.atomic && DOT_RE.test(path23))
90360
+ _isIgnored(path26, stats) {
90361
+ if (this.options.atomic && DOT_RE.test(path26))
90346
90362
  return true;
90347
90363
  if (!this._userIgnored) {
90348
90364
  const { cwd } = this.options;
@@ -90352,17 +90368,17 @@ var FSWatcher = class extends EventEmitter2 {
90352
90368
  const list3 = [...ignoredPaths.map(normalizeIgnored(cwd)), ...ignored];
90353
90369
  this._userIgnored = anymatch(list3, void 0);
90354
90370
  }
90355
- return this._userIgnored(path23, stats);
90371
+ return this._userIgnored(path26, stats);
90356
90372
  }
90357
- _isntIgnored(path23, stat4) {
90358
- return !this._isIgnored(path23, stat4);
90373
+ _isntIgnored(path26, stat4) {
90374
+ return !this._isIgnored(path26, stat4);
90359
90375
  }
90360
90376
  /**
90361
90377
  * Provides a set of common helpers and properties relating to symlink handling.
90362
90378
  * @param path file or directory pattern being watched
90363
90379
  */
90364
- _getWatchHelpers(path23) {
90365
- return new WatchHelper(path23, this.options.followSymlinks, this);
90380
+ _getWatchHelpers(path26) {
90381
+ return new WatchHelper(path26, this.options.followSymlinks, this);
90366
90382
  }
90367
90383
  // Directory helpers
90368
90384
  // -----------------
@@ -90394,63 +90410,63 @@ var FSWatcher = class extends EventEmitter2 {
90394
90410
  * @param item base path of item/directory
90395
90411
  */
90396
90412
  _remove(directory, item, isDirectory) {
90397
- const path23 = sp2.join(directory, item);
90398
- const fullPath = sp2.resolve(path23);
90399
- isDirectory = isDirectory != null ? isDirectory : this._watched.has(path23) || this._watched.has(fullPath);
90400
- if (!this._throttle("remove", path23, 100))
90413
+ const path26 = sp2.join(directory, item);
90414
+ const fullPath = sp2.resolve(path26);
90415
+ isDirectory = isDirectory != null ? isDirectory : this._watched.has(path26) || this._watched.has(fullPath);
90416
+ if (!this._throttle("remove", path26, 100))
90401
90417
  return;
90402
90418
  if (!isDirectory && this._watched.size === 1) {
90403
90419
  this.add(directory, item, true);
90404
90420
  }
90405
- const wp = this._getWatchedDir(path23);
90421
+ const wp = this._getWatchedDir(path26);
90406
90422
  const nestedDirectoryChildren = wp.getChildren();
90407
- nestedDirectoryChildren.forEach((nested) => this._remove(path23, nested));
90423
+ nestedDirectoryChildren.forEach((nested) => this._remove(path26, nested));
90408
90424
  const parent = this._getWatchedDir(directory);
90409
90425
  const wasTracked = parent.has(item);
90410
90426
  parent.remove(item);
90411
90427
  if (this._symlinkPaths.has(fullPath)) {
90412
90428
  this._symlinkPaths.delete(fullPath);
90413
90429
  }
90414
- let relPath = path23;
90430
+ let relPath = path26;
90415
90431
  if (this.options.cwd)
90416
- relPath = sp2.relative(this.options.cwd, path23);
90432
+ relPath = sp2.relative(this.options.cwd, path26);
90417
90433
  if (this.options.awaitWriteFinish && this._pendingWrites.has(relPath)) {
90418
90434
  const event = this._pendingWrites.get(relPath).cancelWait();
90419
90435
  if (event === EVENTS.ADD)
90420
90436
  return;
90421
90437
  }
90422
- this._watched.delete(path23);
90438
+ this._watched.delete(path26);
90423
90439
  this._watched.delete(fullPath);
90424
90440
  const eventName = isDirectory ? EVENTS.UNLINK_DIR : EVENTS.UNLINK;
90425
- if (wasTracked && !this._isIgnored(path23))
90426
- this._emit(eventName, path23);
90427
- this._closePath(path23);
90441
+ if (wasTracked && !this._isIgnored(path26))
90442
+ this._emit(eventName, path26);
90443
+ this._closePath(path26);
90428
90444
  }
90429
90445
  /**
90430
90446
  * Closes all watchers for a path
90431
90447
  */
90432
- _closePath(path23) {
90433
- this._closeFile(path23);
90434
- const dir = sp2.dirname(path23);
90435
- this._getWatchedDir(dir).remove(sp2.basename(path23));
90448
+ _closePath(path26) {
90449
+ this._closeFile(path26);
90450
+ const dir = sp2.dirname(path26);
90451
+ this._getWatchedDir(dir).remove(sp2.basename(path26));
90436
90452
  }
90437
90453
  /**
90438
90454
  * Closes only file-specific watchers
90439
90455
  */
90440
- _closeFile(path23) {
90441
- const closers = this._closers.get(path23);
90456
+ _closeFile(path26) {
90457
+ const closers = this._closers.get(path26);
90442
90458
  if (!closers)
90443
90459
  return;
90444
90460
  closers.forEach((closer) => closer());
90445
- this._closers.delete(path23);
90461
+ this._closers.delete(path26);
90446
90462
  }
90447
- _addPathCloser(path23, closer) {
90463
+ _addPathCloser(path26, closer) {
90448
90464
  if (!closer)
90449
90465
  return;
90450
- let list3 = this._closers.get(path23);
90466
+ let list3 = this._closers.get(path26);
90451
90467
  if (!list3) {
90452
90468
  list3 = [];
90453
- this._closers.set(path23, list3);
90469
+ this._closers.set(path26, list3);
90454
90470
  }
90455
90471
  list3.push(closer);
90456
90472
  }
@@ -90795,6 +90811,504 @@ var WatcherManager = class {
90795
90811
  }
90796
90812
  };
90797
90813
 
90814
+ // src/health/auto-checks.ts
90815
+ import fs11 from "node:fs";
90816
+ import path19 from "node:path";
90817
+
90818
+ // src/health/predicates/docker-ps.ts
90819
+ import { execFile } from "node:child_process";
90820
+ import { promisify as promisify3 } from "node:util";
90821
+ var execFileAsync = promisify3(execFile);
90822
+ async function getDockerServiceStatuses(cwd) {
90823
+ let stdout = "";
90824
+ try {
90825
+ const result = await execFileAsync("docker", ["compose", "ps", "--format", "json"], {
90826
+ cwd,
90827
+ // A handful of rows × ~50KB of labels each = well under 10MB.
90828
+ maxBuffer: 10 * 1024 * 1024
90829
+ });
90830
+ stdout = result.stdout;
90831
+ } catch {
90832
+ return [];
90833
+ }
90834
+ return parseDockerPsOutput(stdout);
90835
+ }
90836
+ function parseDockerPsOutput(stdout) {
90837
+ const trimmed = stdout.trim();
90838
+ if (!trimmed) return [];
90839
+ try {
90840
+ const parsed = JSON.parse(trimmed);
90841
+ if (Array.isArray(parsed)) return parsed;
90842
+ return [parsed];
90843
+ } catch {
90844
+ }
90845
+ try {
90846
+ return trimmed.split("\n").filter(Boolean).map((line2) => JSON.parse(line2));
90847
+ } catch {
90848
+ return [];
90849
+ }
90850
+ }
90851
+
90852
+ // src/health/predicates/docker-unhealthy.ts
90853
+ async function checkDockerUnhealthy(ctx, opts) {
90854
+ const runner = opts.runDockerPs ?? getDockerServiceStatuses;
90855
+ let services;
90856
+ try {
90857
+ services = await runner(ctx.workspaceRoot);
90858
+ } catch {
90859
+ return status("warn", "could not query docker compose status");
90860
+ }
90861
+ if (services.length === 0) {
90862
+ return status("warn", "no docker services found \u2014 is docker compose running?");
90863
+ }
90864
+ const unhealthy = [];
90865
+ for (const svc of services) {
90866
+ const name = (svc.Service || svc.Name || "").toLowerCase();
90867
+ if (!opts.monitored.has(name)) continue;
90868
+ const state = (svc.State || "").toLowerCase();
90869
+ const health = (svc.Health || "").toLowerCase();
90870
+ if (state === "exited" || state === "stopped" || health === "unhealthy") {
90871
+ unhealthy.push(`${name} (${state}${health ? "/" + health : ""})`);
90872
+ }
90873
+ }
90874
+ if (unhealthy.length === 0) {
90875
+ return status("ok", "all monitored services are running");
90876
+ }
90877
+ return status("error", `unhealthy: ${unhealthy.join(", ")} \u2014 run docker compose up`);
90878
+ }
90879
+ function status(severity, detail) {
90880
+ return {
90881
+ id: "docker-unhealthy",
90882
+ label: "Docker services",
90883
+ severity,
90884
+ detail,
90885
+ remediationKey: "D"
90886
+ };
90887
+ }
90888
+ var DEFAULT_MONITORED = /* @__PURE__ */ new Set(["web", "db", "redis"]);
90889
+ function createDockerUnhealthyCheck(opts) {
90890
+ const monitored = new Set(
90891
+ Array.from(opts.monitored, (s) => s.toLowerCase()).filter(Boolean)
90892
+ );
90893
+ const effective = monitored.size > 0 ? monitored : DEFAULT_MONITORED;
90894
+ return {
90895
+ id: opts.id ?? "docker-unhealthy",
90896
+ label: opts.label ?? "Docker services",
90897
+ severity: opts.severity ?? "error",
90898
+ triggers: opts.triggers ?? ["startup", "docker"],
90899
+ predicate: (ctx) => checkDockerUnhealthy(ctx, { monitored: effective }),
90900
+ remediation: opts.remediation ?? {
90901
+ key: "D",
90902
+ label: "Start docker compose",
90903
+ command: "docker compose up -d"
90904
+ }
90905
+ };
90906
+ }
90907
+
90908
+ // src/health/predicates/node-modules-drift.ts
90909
+ import path14 from "node:path";
90910
+ var DEFAULT_LOCKFILES = ["package-lock.json", "yarn.lock"];
90911
+ async function checkNodeModulesDrift(ctx, opts = {}) {
90912
+ const { workspaceRoot, fs: fs19 } = ctx;
90913
+ const baseDir = opts.packageDir ? path14.isAbsolute(opts.packageDir) ? opts.packageDir : path14.join(workspaceRoot, opts.packageDir) : workspaceRoot;
90914
+ const nodeModules = path14.join(baseDir, "node_modules");
90915
+ const lockfiles = opts.lockfiles ?? DEFAULT_LOCKFILES;
90916
+ let lockPath = null;
90917
+ for (const name of lockfiles) {
90918
+ const candidate = path14.join(baseDir, name);
90919
+ if (fs19.existsSync(candidate)) {
90920
+ lockPath = candidate;
90921
+ break;
90922
+ }
90923
+ }
90924
+ if (!lockPath) {
90925
+ return status2("ok", "no lockfile found \u2014 nothing to check");
90926
+ }
90927
+ if (!fs19.existsSync(nodeModules)) {
90928
+ return status2("error", "node_modules/ is missing \u2014 run npm install");
90929
+ }
90930
+ let lockMtime;
90931
+ let nmMtime;
90932
+ try {
90933
+ lockMtime = fs19.statSync(lockPath).mtimeMs;
90934
+ nmMtime = fs19.statSync(nodeModules).mtimeMs;
90935
+ } catch {
90936
+ return status2("warn", "could not stat lockfile or node_modules/");
90937
+ }
90938
+ if (lockMtime > nmMtime) {
90939
+ return status2(
90940
+ "error",
90941
+ `${path14.basename(lockPath)} is newer than node_modules/ \u2014 run npm install`
90942
+ );
90943
+ }
90944
+ return status2("ok", "node_modules/ is up to date");
90945
+ }
90946
+ function status2(severity, detail) {
90947
+ return {
90948
+ id: "node-modules-drift",
90949
+ label: "node_modules",
90950
+ severity,
90951
+ detail,
90952
+ remediationKey: "Y"
90953
+ };
90954
+ }
90955
+ function createNodeModulesDriftCheck(opts = {}) {
90956
+ return {
90957
+ id: opts.id ?? "node-modules-drift",
90958
+ label: opts.label ?? "node_modules",
90959
+ severity: opts.severity ?? "error",
90960
+ triggers: opts.triggers ?? ["startup", "lockfile"],
90961
+ predicate: (ctx) => checkNodeModulesDrift(ctx, opts),
90962
+ remediation: opts.remediation ?? {
90963
+ key: "Y",
90964
+ label: "Run npm install",
90965
+ command: "npm install"
90966
+ }
90967
+ };
90968
+ }
90969
+
90970
+ // src/health/predicates/composer-drift.ts
90971
+ import path15 from "node:path";
90972
+ function resolveScopes(workspaceRoot, dirs) {
90973
+ return dirs.map((d) => {
90974
+ const rel = d === "" || d === "." ? "" : d;
90975
+ const base = rel ? path15.join(workspaceRoot, rel) : workspaceRoot;
90976
+ return {
90977
+ lock: path15.join(base, "composer.lock"),
90978
+ vendor: path15.join(base, "vendor"),
90979
+ label: rel || "root"
90980
+ };
90981
+ });
90982
+ }
90983
+ async function checkComposerDrift(ctx, opts = {}) {
90984
+ const { workspaceRoot, fs: fs19 } = ctx;
90985
+ const scopes = resolveScopes(workspaceRoot, opts.packageDirs ?? ["."]);
90986
+ const missing = [];
90987
+ const stale = [];
90988
+ for (const scope of scopes) {
90989
+ if (!fs19.existsSync(scope.lock)) continue;
90990
+ let lockMtime;
90991
+ try {
90992
+ lockMtime = fs19.statSync(scope.lock).mtimeMs;
90993
+ } catch {
90994
+ continue;
90995
+ }
90996
+ if (!fs19.existsSync(scope.vendor)) {
90997
+ missing.push(scope.label);
90998
+ continue;
90999
+ }
91000
+ let vendorMtime;
91001
+ try {
91002
+ vendorMtime = fs19.statSync(scope.vendor).mtimeMs;
91003
+ } catch {
91004
+ stale.push(`${scope.label} (vendor unreadable)`);
91005
+ continue;
91006
+ }
91007
+ if (lockMtime > vendorMtime) {
91008
+ stale.push(scope.label);
91009
+ }
91010
+ }
91011
+ if (missing.length === 0 && stale.length === 0) {
91012
+ return status3("ok", "composer.lock and vendor/ are in sync");
91013
+ }
91014
+ const parts = [];
91015
+ if (missing.length > 0) parts.push(`vendor missing in: ${missing.join(", ")}`);
91016
+ if (stale.length > 0) parts.push(`composer.lock newer than vendor/ in: ${stale.join(", ")}`);
91017
+ return status3("error", `${parts.join("; ")} \u2014 run composer install`);
91018
+ }
91019
+ function status3(severity, detail) {
91020
+ return {
91021
+ id: "composer-drift",
91022
+ label: "Composer",
91023
+ severity,
91024
+ detail,
91025
+ remediationKey: "R"
91026
+ };
91027
+ }
91028
+ function createComposerDriftCheck(opts = {}) {
91029
+ const dirs = opts.packageDirs ?? ["."];
91030
+ const defaultCommand = dirs.map((d) => d === "" || d === "." ? "composer install" : `(cd ${d} && composer install)`).join(" && ");
91031
+ return {
91032
+ id: opts.id ?? "composer-drift",
91033
+ label: opts.label ?? "Composer",
91034
+ severity: opts.severity ?? "error",
91035
+ triggers: opts.triggers ?? ["startup", "lockfile"],
91036
+ predicate: (ctx) => checkComposerDrift(ctx, opts),
91037
+ remediation: opts.remediation ?? {
91038
+ key: "R",
91039
+ label: "Run composer install",
91040
+ command: defaultCommand
91041
+ }
91042
+ };
91043
+ }
91044
+
91045
+ // src/mount/health-check.ts
91046
+ import path18 from "node:path";
91047
+
91048
+ // src/mount/symlinks.ts
91049
+ import fs9 from "node:fs";
91050
+ import path16 from "node:path";
91051
+ import { spawnSync as spawnSync2 } from "node:child_process";
91052
+ function applyManagedSymlinks(workspaceRoot, mounts, strategy) {
91053
+ const report = { created: [], replaced: [], skipped: [] };
91054
+ for (const m of mounts) {
91055
+ const linkPath = strategy.linkPath(m, workspaceRoot);
91056
+ if (!linkPath) continue;
91057
+ const outcome = applyOneSymlink(linkPath, m.hostPath);
91058
+ if (outcome === "created") report.created.push(linkPath);
91059
+ else if (outcome === "replaced") report.replaced.push(linkPath);
91060
+ else report.skipped.push(linkPath);
91061
+ }
91062
+ return report;
91063
+ }
91064
+ function applyOneSymlink(linkPath, hostPath) {
91065
+ let preExistingRealDir = false;
91066
+ let existing = null;
91067
+ try {
91068
+ existing = fs9.lstatSync(linkPath);
91069
+ } catch {
91070
+ }
91071
+ if (existing) {
91072
+ if (existing.isSymbolicLink()) {
91073
+ try {
91074
+ if (fs9.readlinkSync(linkPath) === hostPath) return "created";
91075
+ fs9.unlinkSync(linkPath);
91076
+ } catch {
91077
+ return "skipped";
91078
+ }
91079
+ } else if (existing.isDirectory()) {
91080
+ preExistingRealDir = true;
91081
+ if (!tryRemoveDir(linkPath)) return "skipped";
91082
+ } else {
91083
+ try {
91084
+ fs9.unlinkSync(linkPath);
91085
+ } catch {
91086
+ return "skipped";
91087
+ }
91088
+ }
91089
+ }
91090
+ try {
91091
+ fs9.mkdirSync(path16.dirname(linkPath), { recursive: true });
91092
+ fs9.symlinkSync(hostPath, linkPath);
91093
+ } catch {
91094
+ return "skipped";
91095
+ }
91096
+ return preExistingRealDir ? "replaced" : "created";
91097
+ }
91098
+ function tryRemoveDir(p) {
91099
+ try {
91100
+ fs9.rmSync(p, { recursive: true, force: true });
91101
+ } catch {
91102
+ if (process.platform === "darwin") {
91103
+ spawnSync2("chmod", ["-RN", p], { stdio: "ignore" });
91104
+ try {
91105
+ fs9.rmSync(p, { recursive: true, force: true });
91106
+ } catch {
91107
+ }
91108
+ }
91109
+ }
91110
+ return !fs9.existsSync(p);
91111
+ }
91112
+ function removeManagedSymlinks(workspaceRoot, mounts, strategy) {
91113
+ for (const m of mounts) {
91114
+ const linkPath = strategy.linkPath(m, workspaceRoot);
91115
+ if (!linkPath) continue;
91116
+ try {
91117
+ const lstat3 = fs9.lstatSync(linkPath);
91118
+ if (lstat3.isSymbolicLink()) fs9.unlinkSync(linkPath);
91119
+ } catch {
91120
+ }
91121
+ }
91122
+ }
91123
+ function detectBrokenSymlinks(workspaceRoot, mounts, strategy) {
91124
+ const broken = [];
91125
+ for (const m of mounts) {
91126
+ const linkPath = strategy.linkPath(m, workspaceRoot);
91127
+ if (!linkPath) continue;
91128
+ let lstat3 = null;
91129
+ try {
91130
+ lstat3 = fs9.lstatSync(linkPath);
91131
+ } catch {
91132
+ broken.push({ linkPath, intendedTarget: m.hostPath, reason: "missing", mount: m });
91133
+ continue;
91134
+ }
91135
+ if (!lstat3.isSymbolicLink()) {
91136
+ broken.push({ linkPath, intendedTarget: m.hostPath, reason: "missing", mount: m });
91137
+ continue;
91138
+ }
91139
+ try {
91140
+ fs9.statSync(linkPath);
91141
+ } catch {
91142
+ broken.push({ linkPath, intendedTarget: m.hostPath, reason: "broken", mount: m });
91143
+ }
91144
+ }
91145
+ return broken;
91146
+ }
91147
+
91148
+ // src/mount/manifest.ts
91149
+ import fs10 from "node:fs";
91150
+ import path17 from "node:path";
91151
+ var CURRENT_MANIFEST_VERSION = 1;
91152
+ var MountManifestError = class extends Error {
91153
+ constructor(filePath, reason) {
91154
+ super(`mount manifest at "${filePath}": ${reason}`);
91155
+ this.name = "MountManifestError";
91156
+ }
91157
+ };
91158
+ function readMountManifest(manifestPath2) {
91159
+ if (!fs10.existsSync(manifestPath2)) return null;
91160
+ let raw;
91161
+ try {
91162
+ raw = JSON.parse(fs10.readFileSync(manifestPath2, "utf8"));
91163
+ } catch (err) {
91164
+ throw new MountManifestError(manifestPath2, `JSON parse error: ${String(err)}`);
91165
+ }
91166
+ validateMountManifest(manifestPath2, raw);
91167
+ return raw;
91168
+ }
91169
+ function writeMountManifest(manifestPath2, manifest) {
91170
+ fs10.mkdirSync(path17.dirname(manifestPath2), { recursive: true });
91171
+ fs10.writeFileSync(manifestPath2, JSON.stringify(manifest, null, 2), "utf8");
91172
+ }
91173
+ function deleteMountManifest(manifestPath2) {
91174
+ if (!fs10.existsSync(manifestPath2)) return false;
91175
+ fs10.rmSync(manifestPath2);
91176
+ return true;
91177
+ }
91178
+ function validateMountManifest(filePath, raw) {
91179
+ if (typeof raw !== "object" || raw === null || Array.isArray(raw)) {
91180
+ throw new MountManifestError(filePath, "must be a JSON object");
91181
+ }
91182
+ const obj = raw;
91183
+ if (obj["version"] !== CURRENT_MANIFEST_VERSION) {
91184
+ throw new MountManifestError(
91185
+ filePath,
91186
+ `unsupported version: expected ${CURRENT_MANIFEST_VERSION}, got ${JSON.stringify(obj["version"])}`
91187
+ );
91188
+ }
91189
+ for (const key of ["appName", "workspaceRoot", "service", "overlayPath", "appliedAt"]) {
91190
+ if (typeof obj[key] !== "string") {
91191
+ throw new MountManifestError(filePath, `"${key}" must be a string`);
91192
+ }
91193
+ }
91194
+ if (!Array.isArray(obj["mounts"])) {
91195
+ throw new MountManifestError(filePath, '"mounts" must be an array');
91196
+ }
91197
+ for (let i2 = 0; i2 < obj["mounts"].length; i2++) {
91198
+ const m = obj["mounts"][i2];
91199
+ if (typeof m["hostPath"] !== "string") {
91200
+ throw new MountManifestError(filePath, `mounts[${i2}].hostPath must be a string`);
91201
+ }
91202
+ const kind = m["kind"];
91203
+ const isSymlinkOnly = kind === "symlink-only";
91204
+ if (!isSymlinkOnly && typeof m["containerPath"] !== "string") {
91205
+ throw new MountManifestError(filePath, `mounts[${i2}].containerPath must be a string`);
91206
+ }
91207
+ }
91208
+ }
91209
+
91210
+ // src/mount/health-check.ts
91211
+ var DEFAULT_REMEDIATION = {
91212
+ key: "F",
91213
+ label: "mount apply",
91214
+ command: "dev-cockpit mount"
91215
+ };
91216
+ function createMountBrokenSymlinkCheck(opts) {
91217
+ const id = opts.id ?? "mount-broken-symlink";
91218
+ const label = opts.label ?? "Mount symlinks";
91219
+ const severity = opts.severity ?? "error";
91220
+ const triggers = opts.triggers ?? ["startup", "fsevent"];
91221
+ const remediation = opts.remediation ?? DEFAULT_REMEDIATION;
91222
+ const remediationKey = remediation.key;
91223
+ const predicate = async (ctx) => {
91224
+ const { workspaceRoot } = ctx;
91225
+ let manifestPath2;
91226
+ try {
91227
+ const { configPath } = discoverConfig({
91228
+ workspaceDiscoverer: () => ({ root: workspaceRoot })
91229
+ });
91230
+ const config = loadConfig(configPath);
91231
+ const paths = getStatePaths(workspaceRoot, { appName: config.appName });
91232
+ manifestPath2 = path18.join(paths.stateDir, config.mount.manifestFile);
91233
+ } catch (err) {
91234
+ if (err instanceof DiscoveryError) {
91235
+ return { id, label, severity: "ok", detail: "no cockpit.yaml found", remediationKey };
91236
+ }
91237
+ throw err;
91238
+ }
91239
+ let mounts;
91240
+ try {
91241
+ const manifest = readMountManifest(manifestPath2);
91242
+ mounts = manifest?.mounts ?? [];
91243
+ } catch {
91244
+ return {
91245
+ id,
91246
+ label,
91247
+ severity: "warn",
91248
+ detail: "mount manifest could not be read",
91249
+ remediationKey
91250
+ };
91251
+ }
91252
+ if (mounts.length === 0) {
91253
+ return { id, label, severity: "ok", detail: "no active mounts", remediationKey };
91254
+ }
91255
+ const broken = detectBrokenSymlinks(workspaceRoot, mounts, opts.symlinks);
91256
+ if (broken.length === 0) {
91257
+ return {
91258
+ id,
91259
+ label,
91260
+ severity: "ok",
91261
+ detail: `${mounts.length} symlink(s) healthy`,
91262
+ remediationKey
91263
+ };
91264
+ }
91265
+ const namesFor = (reason) => broken.filter((b) => b.reason === reason).map(
91266
+ (b) => b.mount.meta?.["name"] ?? b.mount.containerPath ?? b.mount.hostPath
91267
+ ).join(", ");
91268
+ const parts = [];
91269
+ const brokenNames = namesFor("broken");
91270
+ const missingNames = namesFor("missing");
91271
+ if (brokenNames) parts.push(`broken (target missing): ${brokenNames}`);
91272
+ if (missingNames) parts.push(`not applied (no symlink): ${missingNames}`);
91273
+ return { id, label, severity, detail: parts.join("; "), remediationKey };
91274
+ };
91275
+ return { id, label, severity, triggers, predicate, remediation };
91276
+ }
91277
+
91278
+ // src/health/auto-checks.ts
91279
+ var DOCKER_UNHEALTHY_ID = "docker-unhealthy";
91280
+ var NODE_MODULES_DRIFT_ID = "node-modules-drift";
91281
+ var COMPOSER_DRIFT_ID = "composer-drift";
91282
+ var MOUNT_BROKEN_SYMLINK_ID = "mount-broken-symlink";
91283
+ function buildAutoChecks(opts) {
91284
+ const { config, profile, workspaceRoot } = opts;
91285
+ const configIds = new Set((config.health ?? []).map((h2) => h2.id));
91286
+ const out = [];
91287
+ if (config.docker && !configIds.has(DOCKER_UNHEALTHY_ID)) {
91288
+ const monitored = (config.docker.services ?? []).map((s) => s.name);
91289
+ out.push(createDockerUnhealthyCheck({ monitored }));
91290
+ }
91291
+ if (!configIds.has(NODE_MODULES_DRIFT_ID) && hasLockfile(workspaceRoot)) {
91292
+ out.push(createNodeModulesDriftCheck());
91293
+ }
91294
+ if (!configIds.has(COMPOSER_DRIFT_ID)) {
91295
+ const dirs = config.composer?.packageDirs ?? ["."];
91296
+ const scopesWithLock = dirs.filter(
91297
+ (d) => fs11.existsSync(path19.join(workspaceRoot, d === "" || d === "." ? "" : d, "composer.lock"))
91298
+ );
91299
+ if (scopesWithLock.length > 0) {
91300
+ out.push(createComposerDriftCheck({ packageDirs: scopesWithLock }));
91301
+ }
91302
+ }
91303
+ if (profile?.mountSymlinks && !configIds.has(MOUNT_BROKEN_SYMLINK_ID)) {
91304
+ out.push(createMountBrokenSymlinkCheck({ symlinks: profile.mountSymlinks }));
91305
+ }
91306
+ return out;
91307
+ }
91308
+ function hasLockfile(workspaceRoot) {
91309
+ return fs11.existsSync(path19.join(workspaceRoot, "package-lock.json")) || fs11.existsSync(path19.join(workspaceRoot, "yarn.lock"));
91310
+ }
91311
+
90798
91312
  // src/runCockpit.ts
90799
91313
  var import_react9 = __toESM(require_react(), 1);
90800
91314
  var ENTER_ALT_SCREEN = "\x1B[?1049h\x1B[H";
@@ -90855,8 +91369,8 @@ import { fileURLToPath as fileURLToPath4 } from "node:url";
90855
91369
  import { dirname as dirname3, join as join3 } from "node:path";
90856
91370
 
90857
91371
  // src/commands/dev.ts
90858
- import path14 from "node:path";
90859
- import fs9 from "node:fs";
91372
+ import path20 from "node:path";
91373
+ import fs12 from "node:fs";
90860
91374
 
90861
91375
  // src/actions/registry.ts
90862
91376
  function buildActionRegistry(configActions, profileActions = []) {
@@ -90886,7 +91400,7 @@ async function devCommand(opts = {}) {
90886
91400
  }
90887
91401
  throw err;
90888
91402
  }
90889
- if (!fs9.existsSync(configPath)) {
91403
+ if (!fs12.existsSync(configPath)) {
90890
91404
  process.stderr.write(
90891
91405
  `dev-cockpit: cockpit.yaml at ${configPath} doesn't exist (resolved via --config DEV_COCKPIT_CONFIG / link).`
90892
91406
  );
@@ -90925,7 +91439,8 @@ async function devCommand(opts = {}) {
90925
91439
  );
90926
91440
  const registry = buildHealthRegistry({
90927
91441
  profileChecks: profile?.healthChecks,
90928
- configEntries: config.health
91442
+ configEntries: config.health,
91443
+ autoChecks: buildAutoChecks({ config, profile, workspaceRoot })
90929
91444
  });
90930
91445
  const helpSources = (profile?.helpSources ?? []).map((src) => ({
90931
91446
  id: src.id,
@@ -90963,7 +91478,7 @@ async function devCommand(opts = {}) {
90963
91478
  });
90964
91479
  };
90965
91480
  spawnStream(shell, [shellFlag, proc.command], {
90966
- cwd: proc.cwd ? path14.resolve(workspaceRoot, proc.cwd) : workspaceRoot,
91481
+ cwd: proc.cwd ? path20.resolve(workspaceRoot, proc.cwd) : workspaceRoot,
90967
91482
  env: proc.env,
90968
91483
  tag: proc.id,
90969
91484
  onStdout: (line2) => emit(line2, "info"),
@@ -91040,7 +91555,7 @@ async function devCommand(opts = {}) {
91040
91555
  });
91041
91556
  return;
91042
91557
  }
91043
- const cwd = action.cwd ? path14.resolve(workspaceRoot, action.cwd) : workspaceRoot;
91558
+ const cwd = action.cwd ? path20.resolve(workspaceRoot, action.cwd) : workspaceRoot;
91044
91559
  store.appendOutput({
91045
91560
  ts: Date.now(),
91046
91561
  source: action.id,
@@ -91126,7 +91641,7 @@ async function devCommand(opts = {}) {
91126
91641
  }
91127
91642
 
91128
91643
  // src/commands/doctor.ts
91129
- import fs10 from "node:fs";
91644
+ import fs13 from "node:fs";
91130
91645
  var GLYPH = {
91131
91646
  ok: "\u2713",
91132
91647
  warn: "\u26A0",
@@ -91172,7 +91687,7 @@ async function doctorCommand(opts = {}) {
91172
91687
  }
91173
91688
  throw err;
91174
91689
  }
91175
- if (!fs10.existsSync(configPath)) {
91690
+ if (!fs13.existsSync(configPath)) {
91176
91691
  process.stderr.write(
91177
91692
  `dev-cockpit: cockpit.yaml at ${configPath} doesn't exist (resolved via --config DEV_COCKPIT_CONFIG / link).`
91178
91693
  );
@@ -91185,7 +91700,8 @@ async function doctorCommand(opts = {}) {
91185
91700
  const ctx = buildHealthContext(workspaceRoot);
91186
91701
  const registry = buildHealthRegistry({
91187
91702
  profileChecks: profile?.healthChecks,
91188
- configEntries: config.health
91703
+ configEntries: config.health,
91704
+ autoChecks: buildAutoChecks({ config, profile, workspaceRoot })
91189
91705
  });
91190
91706
  const results = await runChecks(registry, ["startup"], ctx);
91191
91707
  const { lines, exitCode } = formatResults(results, config.appName);
@@ -91197,12 +91713,12 @@ async function doctorCommand(opts = {}) {
91197
91713
  }
91198
91714
 
91199
91715
  // src/commands/init-config.ts
91200
- import fs12 from "node:fs";
91201
- import path16 from "node:path";
91716
+ import fs15 from "node:fs";
91717
+ import path22 from "node:path";
91202
91718
 
91203
91719
  // src/commands/init-config-wizard.ts
91204
- import fs11 from "node:fs";
91205
- import path15 from "node:path";
91720
+ import fs14 from "node:fs";
91721
+ import path21 from "node:path";
91206
91722
  function indent(line2, level) {
91207
91723
  return " ".repeat(level) + line2;
91208
91724
  }
@@ -91380,7 +91896,7 @@ function showSummary(result) {
91380
91896
  }
91381
91897
  function safeReadJson(p) {
91382
91898
  try {
91383
- return JSON.parse(fs11.readFileSync(p, "utf8"));
91899
+ return JSON.parse(fs14.readFileSync(p, "utf8"));
91384
91900
  } catch {
91385
91901
  return null;
91386
91902
  }
@@ -91392,13 +91908,13 @@ function detectComposeFile(cwd) {
91392
91908
  "docker-compose.yml",
91393
91909
  "docker-compose.yaml"
91394
91910
  ]) {
91395
- if (fs11.existsSync(path15.join(cwd, candidate))) return candidate;
91911
+ if (fs14.existsSync(path21.join(cwd, candidate))) return candidate;
91396
91912
  }
91397
91913
  return void 0;
91398
91914
  }
91399
91915
  function parseComposeServices(cwd, composeFile) {
91400
91916
  try {
91401
- const text = fs11.readFileSync(path15.join(cwd, composeFile), "utf8");
91917
+ const text = fs14.readFileSync(path21.join(cwd, composeFile), "utf8");
91402
91918
  const out = [];
91403
91919
  let inServices = false;
91404
91920
  for (const raw of text.split("\n")) {
@@ -91430,15 +91946,15 @@ function detectRepoSuggestions(cwd, pkg) {
91430
91946
  for (const glob of workspaceGlobs) {
91431
91947
  for (const entry of expandSimpleGlob(cwd, glob)) {
91432
91948
  out.push({
91433
- id: path15.basename(entry),
91434
- path: path15.relative(cwd, path15.join(cwd, entry)) || "."
91949
+ id: path21.basename(entry),
91950
+ path: path21.relative(cwd, path21.join(cwd, entry)) || "."
91435
91951
  });
91436
91952
  }
91437
91953
  }
91438
- const pnpmFile = path15.join(cwd, "pnpm-workspace.yaml");
91439
- if (fs11.existsSync(pnpmFile)) {
91954
+ const pnpmFile = path21.join(cwd, "pnpm-workspace.yaml");
91955
+ if (fs14.existsSync(pnpmFile)) {
91440
91956
  try {
91441
- const text = fs11.readFileSync(pnpmFile, "utf8");
91957
+ const text = fs14.readFileSync(pnpmFile, "utf8");
91442
91958
  const inPackages = /packages:\s*([\s\S]*?)(?:\n[a-zA-Z]|$)/.exec(text);
91443
91959
  if (inPackages?.[1]) {
91444
91960
  for (const line2 of inPackages[1].split("\n")) {
@@ -91446,7 +91962,7 @@ function detectRepoSuggestions(cwd, pkg) {
91446
91962
  if (m?.[1]) {
91447
91963
  for (const entry of expandSimpleGlob(cwd, m[1])) {
91448
91964
  if (!out.some((e) => e.path === entry)) {
91449
- out.push({ id: path15.basename(entry), path: entry });
91965
+ out.push({ id: path21.basename(entry), path: entry });
91450
91966
  }
91451
91967
  }
91452
91968
  }
@@ -91456,39 +91972,39 @@ function detectRepoSuggestions(cwd, pkg) {
91456
91972
  }
91457
91973
  }
91458
91974
  if (out.length === 0) {
91459
- const id = pkg?.["name"] ?? path15.basename(cwd) ?? "app";
91975
+ const id = pkg?.["name"] ?? path21.basename(cwd) ?? "app";
91460
91976
  out.push({ id, path: "." });
91461
91977
  }
91462
91978
  return out;
91463
91979
  }
91464
91980
  function expandSimpleGlob(cwd, glob) {
91465
91981
  if (!glob.includes("*")) {
91466
- return fs11.existsSync(path15.join(cwd, glob)) ? [glob] : [];
91982
+ return fs14.existsSync(path21.join(cwd, glob)) ? [glob] : [];
91467
91983
  }
91468
91984
  const m = /^([^*]+?)\/?\*$/.exec(glob);
91469
91985
  if (!m?.[1]) return [];
91470
91986
  const baseRel = m[1];
91471
- const baseAbs = path15.join(cwd, baseRel);
91472
- if (!fs11.existsSync(baseAbs)) return [];
91987
+ const baseAbs = path21.join(cwd, baseRel);
91988
+ if (!fs14.existsSync(baseAbs)) return [];
91473
91989
  try {
91474
- return fs11.readdirSync(baseAbs, { withFileTypes: true }).filter((d) => d.isDirectory() && !d.name.startsWith(".")).map((d) => path15.posix.join(baseRel, d.name));
91990
+ return fs14.readdirSync(baseAbs, { withFileTypes: true }).filter((d) => d.isDirectory() && !d.name.startsWith(".")).map((d) => path21.posix.join(baseRel, d.name));
91475
91991
  } catch {
91476
91992
  return [];
91477
91993
  }
91478
91994
  }
91479
91995
  function gatherHints(cwd) {
91480
- const pkg = safeReadJson(path15.join(cwd, "package.json"));
91996
+ const pkg = safeReadJson(path21.join(cwd, "package.json"));
91481
91997
  const pkgScripts = pkg?.["scripts"] ?? {};
91482
91998
  const composeFile = detectComposeFile(cwd);
91483
91999
  const composeServices = composeFile ? parseComposeServices(cwd, composeFile) : [];
91484
92000
  return {
91485
92001
  cwd,
91486
- appNameDefault: pkg?.["name"] ?? path15.basename(cwd) ?? "my-cockpit",
92002
+ appNameDefault: pkg?.["name"] ?? path21.basename(cwd) ?? "my-cockpit",
91487
92003
  packageJsonScripts: pkgScripts,
91488
92004
  composeFile,
91489
92005
  composeServices,
91490
- hasArtisan: fs11.existsSync(path15.join(cwd, "artisan")),
91491
- hasComposerJson: fs11.existsSync(path15.join(cwd, "composer.json")),
92006
+ hasArtisan: fs14.existsSync(path21.join(cwd, "artisan")),
92007
+ hasComposerJson: fs14.existsSync(path21.join(cwd, "composer.json")),
91492
92008
  repoSuggestions: detectRepoSuggestions(cwd, pkg)
91493
92009
  };
91494
92010
  }
@@ -92270,8 +92786,8 @@ ${dockerBlock}
92270
92786
  }
92271
92787
  async function initConfigCommand(opts = {}) {
92272
92788
  const cwd = opts.cwd ?? process.cwd();
92273
- const target = opts.output ? path16.resolve(cwd, opts.output) : path16.join(cwd, "cockpit.yaml");
92274
- const exists = fs12.existsSync(target);
92789
+ const target = opts.output ? path22.resolve(cwd, opts.output) : path22.join(cwd, "cockpit.yaml");
92790
+ const exists = fs15.existsSync(target);
92275
92791
  if (exists && !opts.force) {
92276
92792
  process.stdout.write(
92277
92793
  `dev-cockpit init-config: ${target} already exists.
@@ -92282,7 +92798,7 @@ async function initConfigCommand(opts = {}) {
92282
92798
  }
92283
92799
  const content = opts.interactive ? renderWizardYaml(
92284
92800
  await runInitWizard({
92285
- defaultAppName: opts.appName ?? (path16.basename(cwd) || "my-cockpit"),
92801
+ defaultAppName: opts.appName ?? (path22.basename(cwd) || "my-cockpit"),
92286
92802
  cwd,
92287
92803
  profileSteps: opts.profile?.wizardSteps
92288
92804
  })
@@ -92290,7 +92806,7 @@ async function initConfigCommand(opts = {}) {
92290
92806
  withDocker: opts.withDocker ?? false,
92291
92807
  appName: opts.appName ?? "my-cockpit"
92292
92808
  });
92293
- fs12.writeFileSync(target, content, "utf8");
92809
+ fs15.writeFileSync(target, content, "utf8");
92294
92810
  process.stdout.write(`
92295
92811
  dev-cockpit init-config: wrote ${target}
92296
92812
  `);
@@ -92328,70 +92844,8 @@ doctor failed: ${err instanceof Error ? err.message : String(err)}
92328
92844
  }
92329
92845
 
92330
92846
  // src/commands/mount.ts
92331
- import path20 from "node:path";
92332
- import fs15 from "node:fs";
92333
-
92334
- // src/mount/manifest.ts
92335
- import fs13 from "node:fs";
92336
- import path17 from "node:path";
92337
- var CURRENT_MANIFEST_VERSION = 1;
92338
- var MountManifestError = class extends Error {
92339
- constructor(filePath, reason) {
92340
- super(`mount manifest at "${filePath}": ${reason}`);
92341
- this.name = "MountManifestError";
92342
- }
92343
- };
92344
- function readMountManifest(manifestPath2) {
92345
- if (!fs13.existsSync(manifestPath2)) return null;
92346
- let raw;
92347
- try {
92348
- raw = JSON.parse(fs13.readFileSync(manifestPath2, "utf8"));
92349
- } catch (err) {
92350
- throw new MountManifestError(manifestPath2, `JSON parse error: ${String(err)}`);
92351
- }
92352
- validateMountManifest(manifestPath2, raw);
92353
- return raw;
92354
- }
92355
- function writeMountManifest(manifestPath2, manifest) {
92356
- fs13.mkdirSync(path17.dirname(manifestPath2), { recursive: true });
92357
- fs13.writeFileSync(manifestPath2, JSON.stringify(manifest, null, 2), "utf8");
92358
- }
92359
- function deleteMountManifest(manifestPath2) {
92360
- if (!fs13.existsSync(manifestPath2)) return false;
92361
- fs13.rmSync(manifestPath2);
92362
- return true;
92363
- }
92364
- function validateMountManifest(filePath, raw) {
92365
- if (typeof raw !== "object" || raw === null || Array.isArray(raw)) {
92366
- throw new MountManifestError(filePath, "must be a JSON object");
92367
- }
92368
- const obj = raw;
92369
- if (obj["version"] !== CURRENT_MANIFEST_VERSION) {
92370
- throw new MountManifestError(
92371
- filePath,
92372
- `unsupported version: expected ${CURRENT_MANIFEST_VERSION}, got ${JSON.stringify(obj["version"])}`
92373
- );
92374
- }
92375
- for (const key of ["appName", "workspaceRoot", "service", "overlayPath", "appliedAt"]) {
92376
- if (typeof obj[key] !== "string") {
92377
- throw new MountManifestError(filePath, `"${key}" must be a string`);
92378
- }
92379
- }
92380
- if (!Array.isArray(obj["mounts"])) {
92381
- throw new MountManifestError(filePath, '"mounts" must be an array');
92382
- }
92383
- for (let i2 = 0; i2 < obj["mounts"].length; i2++) {
92384
- const m = obj["mounts"][i2];
92385
- if (typeof m["hostPath"] !== "string") {
92386
- throw new MountManifestError(filePath, `mounts[${i2}].hostPath must be a string`);
92387
- }
92388
- const kind = m["kind"];
92389
- const isSymlinkOnly = kind === "symlink-only";
92390
- if (!isSymlinkOnly && typeof m["containerPath"] !== "string") {
92391
- throw new MountManifestError(filePath, `mounts[${i2}].containerPath must be a string`);
92392
- }
92393
- }
92394
- }
92847
+ import path24 from "node:path";
92848
+ import fs16 from "node:fs";
92395
92849
 
92396
92850
  // src/mount/compose.ts
92397
92851
  function renderDockerOverlay(mounts, opts) {
@@ -92422,113 +92876,13 @@ function renderDockerOverlay(mounts, opts) {
92422
92876
  }
92423
92877
 
92424
92878
  // src/mount/overlay-path.ts
92425
- import path18 from "node:path";
92879
+ import path23 from "node:path";
92426
92880
  function resolveOverlayPath(opts) {
92427
92881
  if (!opts.configOverride) {
92428
- return path18.join(opts.stateDir, "dev-mount-overlay.yml");
92429
- }
92430
- if (path18.isAbsolute(opts.configOverride)) return opts.configOverride;
92431
- return path18.resolve(opts.workspaceRoot, opts.configOverride);
92432
- }
92433
-
92434
- // src/mount/symlinks.ts
92435
- import fs14 from "node:fs";
92436
- import path19 from "node:path";
92437
- import { spawnSync as spawnSync2 } from "node:child_process";
92438
- function applyManagedSymlinks(workspaceRoot, mounts, strategy) {
92439
- const report = { created: [], replaced: [], skipped: [] };
92440
- for (const m of mounts) {
92441
- const linkPath = strategy.linkPath(m, workspaceRoot);
92442
- if (!linkPath) continue;
92443
- const outcome = applyOneSymlink(linkPath, m.hostPath);
92444
- if (outcome === "created") report.created.push(linkPath);
92445
- else if (outcome === "replaced") report.replaced.push(linkPath);
92446
- else report.skipped.push(linkPath);
92447
- }
92448
- return report;
92449
- }
92450
- function applyOneSymlink(linkPath, hostPath) {
92451
- let preExistingRealDir = false;
92452
- let existing = null;
92453
- try {
92454
- existing = fs14.lstatSync(linkPath);
92455
- } catch {
92882
+ return path23.join(opts.stateDir, "dev-mount-overlay.yml");
92456
92883
  }
92457
- if (existing) {
92458
- if (existing.isSymbolicLink()) {
92459
- try {
92460
- if (fs14.readlinkSync(linkPath) === hostPath) return "created";
92461
- fs14.unlinkSync(linkPath);
92462
- } catch {
92463
- return "skipped";
92464
- }
92465
- } else if (existing.isDirectory()) {
92466
- preExistingRealDir = true;
92467
- if (!tryRemoveDir(linkPath)) return "skipped";
92468
- } else {
92469
- try {
92470
- fs14.unlinkSync(linkPath);
92471
- } catch {
92472
- return "skipped";
92473
- }
92474
- }
92475
- }
92476
- try {
92477
- fs14.mkdirSync(path19.dirname(linkPath), { recursive: true });
92478
- fs14.symlinkSync(hostPath, linkPath);
92479
- } catch {
92480
- return "skipped";
92481
- }
92482
- return preExistingRealDir ? "replaced" : "created";
92483
- }
92484
- function tryRemoveDir(p) {
92485
- try {
92486
- fs14.rmSync(p, { recursive: true, force: true });
92487
- } catch {
92488
- if (process.platform === "darwin") {
92489
- spawnSync2("chmod", ["-RN", p], { stdio: "ignore" });
92490
- try {
92491
- fs14.rmSync(p, { recursive: true, force: true });
92492
- } catch {
92493
- }
92494
- }
92495
- }
92496
- return !fs14.existsSync(p);
92497
- }
92498
- function removeManagedSymlinks(workspaceRoot, mounts, strategy) {
92499
- for (const m of mounts) {
92500
- const linkPath = strategy.linkPath(m, workspaceRoot);
92501
- if (!linkPath) continue;
92502
- try {
92503
- const lstat3 = fs14.lstatSync(linkPath);
92504
- if (lstat3.isSymbolicLink()) fs14.unlinkSync(linkPath);
92505
- } catch {
92506
- }
92507
- }
92508
- }
92509
- function detectBrokenSymlinks(workspaceRoot, mounts, strategy) {
92510
- const broken = [];
92511
- for (const m of mounts) {
92512
- const linkPath = strategy.linkPath(m, workspaceRoot);
92513
- if (!linkPath) continue;
92514
- let lstat3 = null;
92515
- try {
92516
- lstat3 = fs14.lstatSync(linkPath);
92517
- } catch {
92518
- broken.push({ linkPath, intendedTarget: m.hostPath, reason: "missing", mount: m });
92519
- continue;
92520
- }
92521
- if (!lstat3.isSymbolicLink()) {
92522
- broken.push({ linkPath, intendedTarget: m.hostPath, reason: "missing", mount: m });
92523
- continue;
92524
- }
92525
- try {
92526
- fs14.statSync(linkPath);
92527
- } catch {
92528
- broken.push({ linkPath, intendedTarget: m.hostPath, reason: "broken", mount: m });
92529
- }
92530
- }
92531
- return broken;
92884
+ if (path23.isAbsolute(opts.configOverride)) return opts.configOverride;
92885
+ return path23.resolve(opts.workspaceRoot, opts.configOverride);
92532
92886
  }
92533
92887
 
92534
92888
  // src/mount/git-status.ts
@@ -92588,7 +92942,7 @@ async function resolveContext(opts) {
92588
92942
  }
92589
92943
  throw err;
92590
92944
  }
92591
- if (!fs15.existsSync(configPath)) {
92945
+ if (!fs16.existsSync(configPath)) {
92592
92946
  process.stderr.write(`dev-cockpit mount: cockpit.yaml at ${configPath} doesn't exist.
92593
92947
  `);
92594
92948
  process.exit(1);
@@ -92611,7 +92965,7 @@ async function resolveContext(opts) {
92611
92965
  workspaceRoot,
92612
92966
  configOverride: config.mount.overlayPath
92613
92967
  });
92614
- const manifestPath2 = path20.join(paths.stateDir, config.mount.manifestFile);
92968
+ const manifestPath2 = path24.join(paths.stateDir, config.mount.manifestFile);
92615
92969
  return {
92616
92970
  configPath,
92617
92971
  workspaceRoot,
@@ -92652,7 +93006,7 @@ async function pickSourceForMount(m, prompts) {
92652
93006
  if (chosen !== CUSTOM_PATH_SENTINEL) return chosen;
92653
93007
  return (await prompts.input({
92654
93008
  message: "Host path (absolute):",
92655
- validate: (v) => v.trim().length > 0 && path20.isAbsolute(v.trim()) ? true : "must be an absolute path"
93009
+ validate: (v) => v.trim().length > 0 && path24.isAbsolute(v.trim()) ? true : "must be an absolute path"
92656
93010
  })).trim();
92657
93011
  }
92658
93012
  async function pickMounts(candidates) {
@@ -92730,7 +93084,7 @@ async function pickMounts(candidates) {
92730
93084
  if (picked === CUSTOM_PATH_SENTINEL) {
92731
93085
  hostPath = (await input({
92732
93086
  message: "Host path (absolute):",
92733
- validate: (v) => v.trim().length > 0 && path20.isAbsolute(v.trim()) ? true : "must be an absolute path"
93087
+ validate: (v) => v.trim().length > 0 && path24.isAbsolute(v.trim()) ? true : "must be an absolute path"
92734
93088
  })).trim();
92735
93089
  } else {
92736
93090
  hostPath = picked;
@@ -92738,7 +93092,7 @@ async function pickMounts(candidates) {
92738
93092
  } else {
92739
93093
  hostPath = (await input({
92740
93094
  message: "Host path (absolute):",
92741
- validate: (v) => v.trim().length > 0 && path20.isAbsolute(v.trim()) ? true : "must be an absolute path"
93095
+ validate: (v) => v.trim().length > 0 && path24.isAbsolute(v.trim()) ? true : "must be an absolute path"
92742
93096
  })).trim();
92743
93097
  }
92744
93098
  let containerPath;
@@ -92753,7 +93107,7 @@ async function pickMounts(candidates) {
92753
93107
  if (picked === CUSTOM_PATH_SENTINEL) {
92754
93108
  containerPath = (await input({
92755
93109
  message: "Container path (absolute):",
92756
- validate: (v) => v.trim().length > 0 && path20.isAbsolute(v.trim()) ? true : "must be an absolute path"
93110
+ validate: (v) => v.trim().length > 0 && path24.isAbsolute(v.trim()) ? true : "must be an absolute path"
92757
93111
  })).trim();
92758
93112
  } else {
92759
93113
  containerPath = picked;
@@ -92761,7 +93115,7 @@ async function pickMounts(candidates) {
92761
93115
  } else {
92762
93116
  containerPath = (await input({
92763
93117
  message: "Container path (absolute):",
92764
- validate: (v) => v.trim().length > 0 && path20.isAbsolute(v.trim()) ? true : "must be an absolute path"
93118
+ validate: (v) => v.trim().length > 0 && path24.isAbsolute(v.trim()) ? true : "must be an absolute path"
92765
93119
  })).trim();
92766
93120
  }
92767
93121
  const name = (await input({
@@ -92814,8 +93168,8 @@ async function mountCommand(opts = {}) {
92814
93168
  return;
92815
93169
  }
92816
93170
  }
92817
- fs15.mkdirSync(path20.dirname(overlayPath), { recursive: true });
92818
- fs15.writeFileSync(overlayPath, renderDockerOverlay(selected, { service }), "utf8");
93171
+ fs16.mkdirSync(path24.dirname(overlayPath), { recursive: true });
93172
+ fs16.writeFileSync(overlayPath, renderDockerOverlay(selected, { service }), "utf8");
92819
93173
  process.stdout.write(`dev-cockpit mount: wrote ${overlayPath}
92820
93174
  `);
92821
93175
  writeMountManifest(manifestPath2, {
@@ -92854,7 +93208,7 @@ async function mountCommand(opts = {}) {
92854
93208
  await profile.onMountApply(hookCtx);
92855
93209
  } else {
92856
93210
  process.stdout.write(
92857
- ` Apply with: docker compose -f <your-compose>.yml -f ${path20.basename(overlayPath)} up -d
93211
+ ` Apply with: docker compose -f <your-compose>.yml -f ${path24.basename(overlayPath)} up -d
92858
93212
  `
92859
93213
  );
92860
93214
  }
@@ -92935,8 +93289,8 @@ async function mountClearCommand(opts = {}) {
92935
93289
  `);
92936
93290
  }
92937
93291
  let removed = 0;
92938
- if (fs15.existsSync(overlayPath)) {
92939
- fs15.rmSync(overlayPath);
93292
+ if (fs16.existsSync(overlayPath)) {
93293
+ fs16.rmSync(overlayPath);
92940
93294
  process.stdout.write(`dev-cockpit mount: removed ${overlayPath}
92941
93295
  `);
92942
93296
  removed += 1;
@@ -92963,16 +93317,16 @@ async function mountClearCommand(opts = {}) {
92963
93317
 
92964
93318
  // src/commands/migrate-config.ts
92965
93319
  var import_yaml2 = __toESM(require_dist(), 1);
92966
- import fs16 from "node:fs";
92967
- import path21 from "node:path";
93320
+ import fs17 from "node:fs";
93321
+ import path25 from "node:path";
92968
93322
  async function migrateConfigCommand(opts = {}) {
92969
- const configPath = path21.resolve(opts.config ?? "cockpit.yaml");
92970
- if (!fs16.existsSync(configPath)) {
93323
+ const configPath = path25.resolve(opts.config ?? "cockpit.yaml");
93324
+ if (!fs17.existsSync(configPath)) {
92971
93325
  process.stderr.write(`dev-cockpit migrate-config: no file at ${configPath}.
92972
93326
  `);
92973
93327
  process.exit(1);
92974
93328
  }
92975
- const content = fs16.readFileSync(configPath, "utf8");
93329
+ const content = fs17.readFileSync(configPath, "utf8");
92976
93330
  const raw = (0, import_yaml2.parse)(content) ?? {};
92977
93331
  if (typeof raw["version"] !== "number") {
92978
93332
  process.stderr.write(
@@ -93014,7 +93368,7 @@ async function migrateConfigCommand(opts = {}) {
93014
93368
  process.stdout.write(out);
93015
93369
  return;
93016
93370
  }
93017
- fs16.writeFileSync(configPath, out, "utf8");
93371
+ fs17.writeFileSync(configPath, out, "utf8");
93018
93372
  process.stdout.write(
93019
93373
  `dev-cockpit migrate-config: rewrote ${configPath} (v${fromVersion} \u2192 v${CONFIG_VERSION}).
93020
93374
  `
@@ -93131,9 +93485,9 @@ This creates a docker-compose overlay file. The location of the overlay file is
93131
93485
  }
93132
93486
 
93133
93487
  // src/mount/discovery.ts
93134
- import fs17 from "node:fs";
93488
+ import fs18 from "node:fs";
93135
93489
  function findHostClones(opts) {
93136
- const fsImpl = opts.fsImpl ?? fs17;
93490
+ const fsImpl = opts.fsImpl ?? fs18;
93137
93491
  const found = [];
93138
93492
  for (const pkg of opts.packages) {
93139
93493
  const hostPath = opts.resolveHostPath(pkg, opts.parentDir);
@@ -93147,75 +93501,6 @@ function findHostClones(opts) {
93147
93501
  }
93148
93502
  return found;
93149
93503
  }
93150
-
93151
- // src/mount/health-check.ts
93152
- import path22 from "node:path";
93153
- var DEFAULT_REMEDIATION = {
93154
- key: "F",
93155
- label: "mount apply",
93156
- command: "dev-cockpit mount"
93157
- };
93158
- function createMountBrokenSymlinkCheck(opts) {
93159
- const id = opts.id ?? "mount-broken-symlink";
93160
- const label = opts.label ?? "Mount symlinks";
93161
- const severity = opts.severity ?? "error";
93162
- const triggers = opts.triggers ?? ["startup", "fsevent"];
93163
- const remediation = opts.remediation ?? DEFAULT_REMEDIATION;
93164
- const remediationKey = remediation.key;
93165
- const predicate = async (ctx) => {
93166
- const { workspaceRoot } = ctx;
93167
- let manifestPath2;
93168
- try {
93169
- const { configPath } = discoverConfig({
93170
- workspaceDiscoverer: () => ({ root: workspaceRoot })
93171
- });
93172
- const config = loadConfig(configPath);
93173
- const paths = getStatePaths(workspaceRoot, { appName: config.appName });
93174
- manifestPath2 = path22.join(paths.stateDir, config.mount.manifestFile);
93175
- } catch (err) {
93176
- if (err instanceof DiscoveryError) {
93177
- return { id, label, severity: "ok", detail: "no cockpit.yaml found", remediationKey };
93178
- }
93179
- throw err;
93180
- }
93181
- let mounts;
93182
- try {
93183
- const manifest = readMountManifest(manifestPath2);
93184
- mounts = manifest?.mounts ?? [];
93185
- } catch {
93186
- return {
93187
- id,
93188
- label,
93189
- severity: "warn",
93190
- detail: "mount manifest could not be read",
93191
- remediationKey
93192
- };
93193
- }
93194
- if (mounts.length === 0) {
93195
- return { id, label, severity: "ok", detail: "no active mounts", remediationKey };
93196
- }
93197
- const broken = detectBrokenSymlinks(workspaceRoot, mounts, opts.symlinks);
93198
- if (broken.length === 0) {
93199
- return {
93200
- id,
93201
- label,
93202
- severity: "ok",
93203
- detail: `${mounts.length} symlink(s) healthy`,
93204
- remediationKey
93205
- };
93206
- }
93207
- const namesFor = (reason) => broken.filter((b) => b.reason === reason).map(
93208
- (b) => b.mount.meta?.["name"] ?? b.mount.containerPath ?? b.mount.hostPath
93209
- ).join(", ");
93210
- const parts = [];
93211
- const brokenNames = namesFor("broken");
93212
- const missingNames = namesFor("missing");
93213
- if (brokenNames) parts.push(`broken (target missing): ${brokenNames}`);
93214
- if (missingNames) parts.push(`not applied (no symlink): ${missingNames}`);
93215
- return { id, label, severity, detail: parts.join("; "), remediationKey };
93216
- };
93217
- return { id, label, severity, triggers, predicate, remediation };
93218
- }
93219
93504
  export {
93220
93505
  BUILTIN_CHECK_FACTORIES,
93221
93506
  BUILTIN_DEFAULT_SEVERITY,
@@ -93249,15 +93534,22 @@ export {
93249
93534
  WatcherManager,
93250
93535
  applyManagedSymlinks,
93251
93536
  buildActionRegistry,
93537
+ buildAutoChecks,
93252
93538
  buildCli,
93253
93539
  buildHealthContext,
93254
93540
  buildHealthRegistry,
93255
93541
  buildTemplate,
93256
93542
  canonical,
93543
+ checkComposerDrift,
93544
+ checkDockerUnhealthy,
93545
+ checkNodeModulesDrift,
93257
93546
  cockpitStore,
93258
93547
  compileHighlights,
93548
+ createComposerDriftCheck,
93549
+ createDockerUnhealthyCheck,
93259
93550
  createLogger,
93260
93551
  createMountBrokenSymlinkCheck,
93552
+ createNodeModulesDriftCheck,
93261
93553
  deleteMountManifest,
93262
93554
  detectBrokenSymlinks,
93263
93555
  detectTransitions,
@@ -93271,6 +93563,7 @@ export {
93271
93563
  findRemediation,
93272
93564
  findSpawnedByTag,
93273
93565
  formatResults,
93566
+ getDockerServiceStatuses,
93274
93567
  getLogger,
93275
93568
  getStatePaths,
93276
93569
  hashWorkspacePath,
@@ -93293,6 +93586,7 @@ export {
93293
93586
  mountStatusCommand,
93294
93587
  notify,
93295
93588
  notifyTransitions,
93589
+ parseDockerPsOutput,
93296
93590
  parseIndex,
93297
93591
  readGitInfo,
93298
93592
  readManifest,