dev-cockpit 0.2.1 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -15,6 +15,11 @@ import {
15
15
  import {
16
16
  require_react
17
17
  } from "./chunk-VN6UILQW.js";
18
+ import {
19
+ canonical,
20
+ lookupConfig,
21
+ manifestPath
22
+ } from "./chunk-C4GFJDMG.js";
18
23
  import {
19
24
  __commonJS,
20
25
  __export,
@@ -285,8 +290,8 @@ var require_req = __commonJS({
285
290
  if (req.originalUrl) {
286
291
  _req.url = req.originalUrl;
287
292
  } else {
288
- const path21 = req.path;
289
- _req.url = typeof path21 === "string" ? path21 : req.url ? req.url.path || req.url : void 0;
293
+ const path22 = req.path;
294
+ _req.url = typeof path22 === "string" ? path22 : req.url ? req.url.path || req.url : void 0;
290
295
  }
291
296
  if (req.query) {
292
297
  _req.query = req.query;
@@ -451,14 +456,14 @@ var require_redact = __commonJS({
451
456
  }
452
457
  return obj;
453
458
  }
454
- function parsePath(path21) {
459
+ function parsePath(path22) {
455
460
  const parts = [];
456
461
  let current = "";
457
462
  let inBrackets = false;
458
463
  let inQuotes = false;
459
464
  let quoteChar = "";
460
- for (let i2 = 0; i2 < path21.length; i2++) {
461
- const char = path21[i2];
465
+ for (let i2 = 0; i2 < path22.length; i2++) {
466
+ const char = path22[i2];
462
467
  if (!inBrackets && char === ".") {
463
468
  if (current) {
464
469
  parts.push(current);
@@ -589,10 +594,10 @@ var require_redact = __commonJS({
589
594
  return current;
590
595
  }
591
596
  function redactPaths(obj, paths, censor, remove = false) {
592
- for (const path21 of paths) {
593
- const parts = parsePath(path21);
597
+ for (const path22 of paths) {
598
+ const parts = parsePath(path22);
594
599
  if (parts.includes("*")) {
595
- redactWildcardPath(obj, parts, censor, path21, remove);
600
+ redactWildcardPath(obj, parts, censor, path22, remove);
596
601
  } else {
597
602
  if (remove) {
598
603
  removeKey(obj, parts);
@@ -677,8 +682,8 @@ var require_redact = __commonJS({
677
682
  }
678
683
  } else {
679
684
  if (afterWildcard.includes("*")) {
680
- const wrappedCensor = typeof censor === "function" ? (value, path21) => {
681
- const fullPath = [...pathArray.slice(0, pathLength), ...path21];
685
+ const wrappedCensor = typeof censor === "function" ? (value, path22) => {
686
+ const fullPath = [...pathArray.slice(0, pathLength), ...path22];
682
687
  return censor(value, fullPath);
683
688
  } : censor;
684
689
  redactWildcardPath(current, afterWildcard, wrappedCensor, originalPath, remove);
@@ -713,8 +718,8 @@ var require_redact = __commonJS({
713
718
  return null;
714
719
  }
715
720
  const pathStructure = /* @__PURE__ */ new Map();
716
- for (const path21 of pathsToClone) {
717
- const parts = parsePath(path21);
721
+ for (const path22 of pathsToClone) {
722
+ const parts = parsePath(path22);
718
723
  let current = pathStructure;
719
724
  for (let i2 = 0; i2 < parts.length; i2++) {
720
725
  const part = parts[i2];
@@ -766,24 +771,24 @@ var require_redact = __commonJS({
766
771
  }
767
772
  return cloneSelectively(obj, pathStructure);
768
773
  }
769
- function validatePath(path21) {
770
- if (typeof path21 !== "string") {
774
+ function validatePath(path22) {
775
+ if (typeof path22 !== "string") {
771
776
  throw new Error("Paths must be (non-empty) strings");
772
777
  }
773
- if (path21 === "") {
778
+ if (path22 === "") {
774
779
  throw new Error("Invalid redaction path ()");
775
780
  }
776
- if (path21.includes("..")) {
777
- throw new Error(`Invalid redaction path (${path21})`);
781
+ if (path22.includes("..")) {
782
+ throw new Error(`Invalid redaction path (${path22})`);
778
783
  }
779
- if (path21.includes(",")) {
780
- throw new Error(`Invalid redaction path (${path21})`);
784
+ if (path22.includes(",")) {
785
+ throw new Error(`Invalid redaction path (${path22})`);
781
786
  }
782
787
  let bracketCount = 0;
783
788
  let inQuotes = false;
784
789
  let quoteChar = "";
785
- for (let i2 = 0; i2 < path21.length; i2++) {
786
- const char = path21[i2];
790
+ for (let i2 = 0; i2 < path22.length; i2++) {
791
+ const char = path22[i2];
787
792
  if ((char === '"' || char === "'") && bracketCount > 0) {
788
793
  if (!inQuotes) {
789
794
  inQuotes = true;
@@ -797,20 +802,20 @@ var require_redact = __commonJS({
797
802
  } else if (char === "]" && !inQuotes) {
798
803
  bracketCount--;
799
804
  if (bracketCount < 0) {
800
- throw new Error(`Invalid redaction path (${path21})`);
805
+ throw new Error(`Invalid redaction path (${path22})`);
801
806
  }
802
807
  }
803
808
  }
804
809
  if (bracketCount !== 0) {
805
- throw new Error(`Invalid redaction path (${path21})`);
810
+ throw new Error(`Invalid redaction path (${path22})`);
806
811
  }
807
812
  }
808
813
  function validatePaths(paths) {
809
814
  if (!Array.isArray(paths)) {
810
815
  throw new TypeError("paths must be an array");
811
816
  }
812
- for (const path21 of paths) {
813
- validatePath(path21);
817
+ for (const path22 of paths) {
818
+ validatePath(path22);
814
819
  }
815
820
  }
816
821
  function slowRedact(options2 = {}) {
@@ -978,8 +983,8 @@ var require_redaction = __commonJS({
978
983
  if (shape[k] === null) {
979
984
  o2[k] = (value) => topCensor(value, [k]);
980
985
  } else {
981
- const wrappedCensor = typeof censor === "function" ? (value, path21) => {
982
- return censor(value, [k, ...path21]);
986
+ const wrappedCensor = typeof censor === "function" ? (value, path22) => {
987
+ return censor(value, [k, ...path22]);
983
988
  } : censor;
984
989
  o2[k] = Redact({
985
990
  paths: shape[k],
@@ -1197,10 +1202,10 @@ var require_atomic_sleep = __commonJS({
1197
1202
  var require_sonic_boom = __commonJS({
1198
1203
  "node_modules/sonic-boom/index.js"(exports, module) {
1199
1204
  "use strict";
1200
- var fs17 = __require("fs");
1205
+ var fs18 = __require("fs");
1201
1206
  var EventEmitter3 = __require("events");
1202
1207
  var inherits = __require("util").inherits;
1203
- var path21 = __require("path");
1208
+ var path22 = __require("path");
1204
1209
  var sleep = require_atomic_sleep();
1205
1210
  var assert = __require("assert");
1206
1211
  var BUSY_WRITE_TIMEOUT = 100;
@@ -1254,20 +1259,20 @@ var require_sonic_boom = __commonJS({
1254
1259
  const mode = sonic.mode;
1255
1260
  if (sonic.sync) {
1256
1261
  try {
1257
- if (sonic.mkdir) fs17.mkdirSync(path21.dirname(file), { recursive: true });
1258
- const fd = fs17.openSync(file, flags, mode);
1262
+ if (sonic.mkdir) fs18.mkdirSync(path22.dirname(file), { recursive: true });
1263
+ const fd = fs18.openSync(file, flags, mode);
1259
1264
  fileOpened(null, fd);
1260
1265
  } catch (err) {
1261
1266
  fileOpened(err);
1262
1267
  throw err;
1263
1268
  }
1264
1269
  } else if (sonic.mkdir) {
1265
- fs17.mkdir(path21.dirname(file), { recursive: true }, (err) => {
1270
+ fs18.mkdir(path22.dirname(file), { recursive: true }, (err) => {
1266
1271
  if (err) return fileOpened(err);
1267
- fs17.open(file, flags, mode, fileOpened);
1272
+ fs18.open(file, flags, mode, fileOpened);
1268
1273
  });
1269
1274
  } else {
1270
- fs17.open(file, flags, mode, fileOpened);
1275
+ fs18.open(file, flags, mode, fileOpened);
1271
1276
  }
1272
1277
  }
1273
1278
  function SonicBoom(opts) {
@@ -1308,8 +1313,8 @@ var require_sonic_boom = __commonJS({
1308
1313
  this.flush = flushBuffer;
1309
1314
  this.flushSync = flushBufferSync;
1310
1315
  this._actualWrite = actualWriteBuffer;
1311
- fsWriteSync = () => fs17.writeSync(this.fd, this._writingBuf);
1312
- fsWrite = () => fs17.write(this.fd, this._writingBuf, this.release);
1316
+ fsWriteSync = () => fs18.writeSync(this.fd, this._writingBuf);
1317
+ fsWrite = () => fs18.write(this.fd, this._writingBuf, this.release);
1313
1318
  } else if (contentMode === void 0 || contentMode === kContentModeUtf8) {
1314
1319
  this._writingBuf = "";
1315
1320
  this.write = write;
@@ -1318,15 +1323,15 @@ var require_sonic_boom = __commonJS({
1318
1323
  this._actualWrite = actualWrite;
1319
1324
  fsWriteSync = () => {
1320
1325
  if (Buffer.isBuffer(this._writingBuf)) {
1321
- return fs17.writeSync(this.fd, this._writingBuf);
1326
+ return fs18.writeSync(this.fd, this._writingBuf);
1322
1327
  }
1323
- return fs17.writeSync(this.fd, this._writingBuf, "utf8");
1328
+ return fs18.writeSync(this.fd, this._writingBuf, "utf8");
1324
1329
  };
1325
1330
  fsWrite = () => {
1326
1331
  if (Buffer.isBuffer(this._writingBuf)) {
1327
- return fs17.write(this.fd, this._writingBuf, this.release);
1332
+ return fs18.write(this.fd, this._writingBuf, this.release);
1328
1333
  }
1329
- return fs17.write(this.fd, this._writingBuf, "utf8", this.release);
1334
+ return fs18.write(this.fd, this._writingBuf, "utf8", this.release);
1330
1335
  };
1331
1336
  } else {
1332
1337
  throw new Error(`SonicBoom supports "${kContentModeUtf8}" and "${kContentModeBuffer}", but passed ${contentMode}`);
@@ -1383,7 +1388,7 @@ var require_sonic_boom = __commonJS({
1383
1388
  }
1384
1389
  }
1385
1390
  if (this._fsync) {
1386
- fs17.fsyncSync(this.fd);
1391
+ fs18.fsyncSync(this.fd);
1387
1392
  }
1388
1393
  const len = this._len;
1389
1394
  if (this._reopening) {
@@ -1497,7 +1502,7 @@ var require_sonic_boom = __commonJS({
1497
1502
  const onDrain = () => {
1498
1503
  if (!this._fsync) {
1499
1504
  try {
1500
- fs17.fsync(this.fd, (err) => {
1505
+ fs18.fsync(this.fd, (err) => {
1501
1506
  this._flushPending = false;
1502
1507
  cb(err);
1503
1508
  });
@@ -1599,7 +1604,7 @@ var require_sonic_boom = __commonJS({
1599
1604
  const fd = this.fd;
1600
1605
  this.once("ready", () => {
1601
1606
  if (fd !== this.fd) {
1602
- fs17.close(fd, (err) => {
1607
+ fs18.close(fd, (err) => {
1603
1608
  if (err) {
1604
1609
  return this.emit("error", err);
1605
1610
  }
@@ -1648,7 +1653,7 @@ var require_sonic_boom = __commonJS({
1648
1653
  buf = this._bufs[0];
1649
1654
  }
1650
1655
  try {
1651
- const n2 = Buffer.isBuffer(buf) ? fs17.writeSync(this.fd, buf) : fs17.writeSync(this.fd, buf, "utf8");
1656
+ const n2 = Buffer.isBuffer(buf) ? fs18.writeSync(this.fd, buf) : fs18.writeSync(this.fd, buf, "utf8");
1652
1657
  const releasedBufObj = releaseWritingBuf(buf, this._len, n2);
1653
1658
  buf = releasedBufObj.writingBuf;
1654
1659
  this._len = releasedBufObj.len;
@@ -1664,7 +1669,7 @@ var require_sonic_boom = __commonJS({
1664
1669
  }
1665
1670
  }
1666
1671
  try {
1667
- fs17.fsyncSync(this.fd);
1672
+ fs18.fsyncSync(this.fd);
1668
1673
  } catch {
1669
1674
  }
1670
1675
  }
@@ -1685,7 +1690,7 @@ var require_sonic_boom = __commonJS({
1685
1690
  buf = mergeBuf(this._bufs[0], this._lens[0]);
1686
1691
  }
1687
1692
  try {
1688
- const n2 = fs17.writeSync(this.fd, buf);
1693
+ const n2 = fs18.writeSync(this.fd, buf);
1689
1694
  buf = buf.subarray(n2);
1690
1695
  this._len = Math.max(this._len - n2, 0);
1691
1696
  if (buf.length <= 0) {
@@ -1713,13 +1718,13 @@ var require_sonic_boom = __commonJS({
1713
1718
  this._writingBuf = this._writingBuf.length ? this._writingBuf : this._bufs.shift() || "";
1714
1719
  if (this.sync) {
1715
1720
  try {
1716
- const written = Buffer.isBuffer(this._writingBuf) ? fs17.writeSync(this.fd, this._writingBuf) : fs17.writeSync(this.fd, this._writingBuf, "utf8");
1721
+ const written = Buffer.isBuffer(this._writingBuf) ? fs18.writeSync(this.fd, this._writingBuf) : fs18.writeSync(this.fd, this._writingBuf, "utf8");
1717
1722
  release(null, written);
1718
1723
  } catch (err) {
1719
1724
  release(err);
1720
1725
  }
1721
1726
  } else {
1722
- fs17.write(this.fd, this._writingBuf, release);
1727
+ fs18.write(this.fd, this._writingBuf, release);
1723
1728
  }
1724
1729
  }
1725
1730
  function actualWriteBuffer() {
@@ -1728,7 +1733,7 @@ var require_sonic_boom = __commonJS({
1728
1733
  this._writingBuf = this._writingBuf.length ? this._writingBuf : mergeBuf(this._bufs.shift(), this._lens.shift());
1729
1734
  if (this.sync) {
1730
1735
  try {
1731
- const written = fs17.writeSync(this.fd, this._writingBuf);
1736
+ const written = fs18.writeSync(this.fd, this._writingBuf);
1732
1737
  release(null, written);
1733
1738
  } catch (err) {
1734
1739
  release(err);
@@ -1737,7 +1742,7 @@ var require_sonic_boom = __commonJS({
1737
1742
  if (kCopyBuffer) {
1738
1743
  this._writingBuf = Buffer.from(this._writingBuf);
1739
1744
  }
1740
- fs17.write(this.fd, this._writingBuf, release);
1745
+ fs18.write(this.fd, this._writingBuf, release);
1741
1746
  }
1742
1747
  }
1743
1748
  function actualClose(sonic) {
@@ -1753,12 +1758,12 @@ var require_sonic_boom = __commonJS({
1753
1758
  sonic._lens = [];
1754
1759
  assert(typeof sonic.fd === "number", `sonic.fd must be a number, got ${typeof sonic.fd}`);
1755
1760
  try {
1756
- fs17.fsync(sonic.fd, closeWrapped);
1761
+ fs18.fsync(sonic.fd, closeWrapped);
1757
1762
  } catch {
1758
1763
  }
1759
1764
  function closeWrapped() {
1760
1765
  if (sonic.fd !== 1 && sonic.fd !== 2) {
1761
- fs17.close(sonic.fd, done);
1766
+ fs18.close(sonic.fd, done);
1762
1767
  } else {
1763
1768
  done();
1764
1769
  }
@@ -4332,8 +4337,8 @@ var require_windows = __commonJS({
4332
4337
  "node_modules/isexe/windows.js"(exports, module) {
4333
4338
  module.exports = isexe;
4334
4339
  isexe.sync = sync;
4335
- var fs17 = __require("fs");
4336
- function checkPathExt(path21, options2) {
4340
+ var fs18 = __require("fs");
4341
+ function checkPathExt(path22, options2) {
4337
4342
  var pathext = options2.pathExt !== void 0 ? options2.pathExt : process.env.PATHEXT;
4338
4343
  if (!pathext) {
4339
4344
  return true;
@@ -4344,25 +4349,25 @@ var require_windows = __commonJS({
4344
4349
  }
4345
4350
  for (var i2 = 0; i2 < pathext.length; i2++) {
4346
4351
  var p = pathext[i2].toLowerCase();
4347
- if (p && path21.substr(-p.length).toLowerCase() === p) {
4352
+ if (p && path22.substr(-p.length).toLowerCase() === p) {
4348
4353
  return true;
4349
4354
  }
4350
4355
  }
4351
4356
  return false;
4352
4357
  }
4353
- function checkStat(stat4, path21, options2) {
4358
+ function checkStat(stat4, path22, options2) {
4354
4359
  if (!stat4.isSymbolicLink() && !stat4.isFile()) {
4355
4360
  return false;
4356
4361
  }
4357
- return checkPathExt(path21, options2);
4362
+ return checkPathExt(path22, options2);
4358
4363
  }
4359
- function isexe(path21, options2, cb) {
4360
- fs17.stat(path21, function(er, stat4) {
4361
- cb(er, er ? false : checkStat(stat4, path21, options2));
4364
+ function isexe(path22, options2, cb) {
4365
+ fs18.stat(path22, function(er, stat4) {
4366
+ cb(er, er ? false : checkStat(stat4, path22, options2));
4362
4367
  });
4363
4368
  }
4364
- function sync(path21, options2) {
4365
- return checkStat(fs17.statSync(path21), path21, options2);
4369
+ function sync(path22, options2) {
4370
+ return checkStat(fs18.statSync(path22), path22, options2);
4366
4371
  }
4367
4372
  }
4368
4373
  });
@@ -4372,14 +4377,14 @@ var require_mode = __commonJS({
4372
4377
  "node_modules/isexe/mode.js"(exports, module) {
4373
4378
  module.exports = isexe;
4374
4379
  isexe.sync = sync;
4375
- var fs17 = __require("fs");
4376
- function isexe(path21, options2, cb) {
4377
- fs17.stat(path21, function(er, stat4) {
4380
+ var fs18 = __require("fs");
4381
+ function isexe(path22, options2, cb) {
4382
+ fs18.stat(path22, function(er, stat4) {
4378
4383
  cb(er, er ? false : checkStat(stat4, options2));
4379
4384
  });
4380
4385
  }
4381
- function sync(path21, options2) {
4382
- return checkStat(fs17.statSync(path21), options2);
4386
+ function sync(path22, options2) {
4387
+ return checkStat(fs18.statSync(path22), options2);
4383
4388
  }
4384
4389
  function checkStat(stat4, options2) {
4385
4390
  return stat4.isFile() && checkMode(stat4, options2);
@@ -4403,7 +4408,7 @@ var require_mode = __commonJS({
4403
4408
  // node_modules/isexe/index.js
4404
4409
  var require_isexe = __commonJS({
4405
4410
  "node_modules/isexe/index.js"(exports, module) {
4406
- var fs17 = __require("fs");
4411
+ var fs18 = __require("fs");
4407
4412
  var core;
4408
4413
  if (process.platform === "win32" || global.TESTING_WINDOWS) {
4409
4414
  core = require_windows();
@@ -4412,7 +4417,7 @@ var require_isexe = __commonJS({
4412
4417
  }
4413
4418
  module.exports = isexe;
4414
4419
  isexe.sync = sync;
4415
- function isexe(path21, options2, cb) {
4420
+ function isexe(path22, options2, cb) {
4416
4421
  if (typeof options2 === "function") {
4417
4422
  cb = options2;
4418
4423
  options2 = {};
@@ -4422,7 +4427,7 @@ var require_isexe = __commonJS({
4422
4427
  throw new TypeError("callback not provided");
4423
4428
  }
4424
4429
  return new Promise(function(resolve3, reject) {
4425
- isexe(path21, options2 || {}, function(er, is) {
4430
+ isexe(path22, options2 || {}, function(er, is) {
4426
4431
  if (er) {
4427
4432
  reject(er);
4428
4433
  } else {
@@ -4431,7 +4436,7 @@ var require_isexe = __commonJS({
4431
4436
  });
4432
4437
  });
4433
4438
  }
4434
- core(path21, options2 || {}, function(er, is) {
4439
+ core(path22, options2 || {}, function(er, is) {
4435
4440
  if (er) {
4436
4441
  if (er.code === "EACCES" || options2 && options2.ignoreErrors) {
4437
4442
  er = null;
@@ -4441,9 +4446,9 @@ var require_isexe = __commonJS({
4441
4446
  cb(er, is);
4442
4447
  });
4443
4448
  }
4444
- function sync(path21, options2) {
4449
+ function sync(path22, options2) {
4445
4450
  try {
4446
- return core.sync(path21, options2 || {});
4451
+ return core.sync(path22, options2 || {});
4447
4452
  } catch (er) {
4448
4453
  if (options2 && options2.ignoreErrors || er.code === "EACCES") {
4449
4454
  return false;
@@ -4459,7 +4464,7 @@ var require_isexe = __commonJS({
4459
4464
  var require_which = __commonJS({
4460
4465
  "node_modules/which/which.js"(exports, module) {
4461
4466
  var isWindows2 = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
4462
- var path21 = __require("path");
4467
+ var path22 = __require("path");
4463
4468
  var COLON = isWindows2 ? ";" : ":";
4464
4469
  var isexe = require_isexe();
4465
4470
  var getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" });
@@ -4497,7 +4502,7 @@ var require_which = __commonJS({
4497
4502
  return opt.all && found.length ? resolve3(found) : reject(getNotFoundError(cmd));
4498
4503
  const ppRaw = pathEnv[i2];
4499
4504
  const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
4500
- const pCmd = path21.join(pathPart, cmd);
4505
+ const pCmd = path22.join(pathPart, cmd);
4501
4506
  const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
4502
4507
  resolve3(subStep(p, i2, 0));
4503
4508
  });
@@ -4524,7 +4529,7 @@ var require_which = __commonJS({
4524
4529
  for (let i2 = 0; i2 < pathEnv.length; i2++) {
4525
4530
  const ppRaw = pathEnv[i2];
4526
4531
  const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
4527
- const pCmd = path21.join(pathPart, cmd);
4532
+ const pCmd = path22.join(pathPart, cmd);
4528
4533
  const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
4529
4534
  for (let j = 0; j < pathExt.length; j++) {
4530
4535
  const cur = p + pathExt[j];
@@ -4572,7 +4577,7 @@ var require_path_key = __commonJS({
4572
4577
  var require_resolveCommand = __commonJS({
4573
4578
  "node_modules/cross-spawn/lib/util/resolveCommand.js"(exports, module) {
4574
4579
  "use strict";
4575
- var path21 = __require("path");
4580
+ var path22 = __require("path");
4576
4581
  var which = require_which();
4577
4582
  var getPathKey = require_path_key();
4578
4583
  function resolveCommandAttempt(parsed, withoutPathExt) {
@@ -4590,7 +4595,7 @@ var require_resolveCommand = __commonJS({
4590
4595
  try {
4591
4596
  resolved = which.sync(parsed.command, {
4592
4597
  path: env[getPathKey({ env })],
4593
- pathExt: withoutPathExt ? path21.delimiter : void 0
4598
+ pathExt: withoutPathExt ? path22.delimiter : void 0
4594
4599
  });
4595
4600
  } catch (e) {
4596
4601
  } finally {
@@ -4599,7 +4604,7 @@ var require_resolveCommand = __commonJS({
4599
4604
  }
4600
4605
  }
4601
4606
  if (resolved) {
4602
- resolved = path21.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
4607
+ resolved = path22.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
4603
4608
  }
4604
4609
  return resolved;
4605
4610
  }
@@ -4653,8 +4658,8 @@ var require_shebang_command = __commonJS({
4653
4658
  if (!match) {
4654
4659
  return null;
4655
4660
  }
4656
- const [path21, argument] = match[0].replace(/#! ?/, "").split(" ");
4657
- const binary = path21.split("/").pop();
4661
+ const [path22, argument] = match[0].replace(/#! ?/, "").split(" ");
4662
+ const binary = path22.split("/").pop();
4658
4663
  if (binary === "env") {
4659
4664
  return argument;
4660
4665
  }
@@ -4667,16 +4672,16 @@ var require_shebang_command = __commonJS({
4667
4672
  var require_readShebang = __commonJS({
4668
4673
  "node_modules/cross-spawn/lib/util/readShebang.js"(exports, module) {
4669
4674
  "use strict";
4670
- var fs17 = __require("fs");
4675
+ var fs18 = __require("fs");
4671
4676
  var shebangCommand = require_shebang_command();
4672
4677
  function readShebang(command) {
4673
4678
  const size = 150;
4674
4679
  const buffer = Buffer.alloc(size);
4675
4680
  let fd;
4676
4681
  try {
4677
- fd = fs17.openSync(command, "r");
4678
- fs17.readSync(fd, buffer, 0, size, 0);
4679
- fs17.closeSync(fd);
4682
+ fd = fs18.openSync(command, "r");
4683
+ fs18.readSync(fd, buffer, 0, size, 0);
4684
+ fs18.closeSync(fd);
4680
4685
  } catch (e) {
4681
4686
  }
4682
4687
  return shebangCommand(buffer.toString());
@@ -4689,7 +4694,7 @@ var require_readShebang = __commonJS({
4689
4694
  var require_parse = __commonJS({
4690
4695
  "node_modules/cross-spawn/lib/parse.js"(exports, module) {
4691
4696
  "use strict";
4692
- var path21 = __require("path");
4697
+ var path22 = __require("path");
4693
4698
  var resolveCommand = require_resolveCommand();
4694
4699
  var escape3 = require_escape();
4695
4700
  var readShebang = require_readShebang();
@@ -4714,7 +4719,7 @@ var require_parse = __commonJS({
4714
4719
  const needsShell = !isExecutableRegExp.test(commandFile);
4715
4720
  if (parsed.options.forceShell || needsShell) {
4716
4721
  const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
4717
- parsed.command = path21.normalize(parsed.command);
4722
+ parsed.command = path22.normalize(parsed.command);
4718
4723
  parsed.command = escape3.command(parsed.command);
4719
4724
  parsed.args = parsed.args.map((arg) => escape3.argument(arg, needsDoubleEscapeMetaChars));
4720
4725
  const shellCommand = [parsed.command].concat(parsed.args).join(" ");
@@ -4901,17 +4906,17 @@ var require_visit = __commonJS({
4901
4906
  visit.BREAK = BREAK;
4902
4907
  visit.SKIP = SKIP;
4903
4908
  visit.REMOVE = REMOVE;
4904
- function visit_(key, node, visitor, path21) {
4905
- const ctrl = callVisitor(key, node, visitor, path21);
4909
+ function visit_(key, node, visitor, path22) {
4910
+ const ctrl = callVisitor(key, node, visitor, path22);
4906
4911
  if (identity4.isNode(ctrl) || identity4.isPair(ctrl)) {
4907
- replaceNode(key, path21, ctrl);
4908
- return visit_(key, ctrl, visitor, path21);
4912
+ replaceNode(key, path22, ctrl);
4913
+ return visit_(key, ctrl, visitor, path22);
4909
4914
  }
4910
4915
  if (typeof ctrl !== "symbol") {
4911
4916
  if (identity4.isCollection(node)) {
4912
- path21 = Object.freeze(path21.concat(node));
4917
+ path22 = Object.freeze(path22.concat(node));
4913
4918
  for (let i2 = 0; i2 < node.items.length; ++i2) {
4914
- const ci = visit_(i2, node.items[i2], visitor, path21);
4919
+ const ci = visit_(i2, node.items[i2], visitor, path22);
4915
4920
  if (typeof ci === "number")
4916
4921
  i2 = ci - 1;
4917
4922
  else if (ci === BREAK)
@@ -4922,13 +4927,13 @@ var require_visit = __commonJS({
4922
4927
  }
4923
4928
  }
4924
4929
  } else if (identity4.isPair(node)) {
4925
- path21 = Object.freeze(path21.concat(node));
4926
- const ck = visit_("key", node.key, visitor, path21);
4930
+ path22 = Object.freeze(path22.concat(node));
4931
+ const ck = visit_("key", node.key, visitor, path22);
4927
4932
  if (ck === BREAK)
4928
4933
  return BREAK;
4929
4934
  else if (ck === REMOVE)
4930
4935
  node.key = null;
4931
- const cv = visit_("value", node.value, visitor, path21);
4936
+ const cv = visit_("value", node.value, visitor, path22);
4932
4937
  if (cv === BREAK)
4933
4938
  return BREAK;
4934
4939
  else if (cv === REMOVE)
@@ -4949,17 +4954,17 @@ var require_visit = __commonJS({
4949
4954
  visitAsync.BREAK = BREAK;
4950
4955
  visitAsync.SKIP = SKIP;
4951
4956
  visitAsync.REMOVE = REMOVE;
4952
- async function visitAsync_(key, node, visitor, path21) {
4953
- const ctrl = await callVisitor(key, node, visitor, path21);
4957
+ async function visitAsync_(key, node, visitor, path22) {
4958
+ const ctrl = await callVisitor(key, node, visitor, path22);
4954
4959
  if (identity4.isNode(ctrl) || identity4.isPair(ctrl)) {
4955
- replaceNode(key, path21, ctrl);
4956
- return visitAsync_(key, ctrl, visitor, path21);
4960
+ replaceNode(key, path22, ctrl);
4961
+ return visitAsync_(key, ctrl, visitor, path22);
4957
4962
  }
4958
4963
  if (typeof ctrl !== "symbol") {
4959
4964
  if (identity4.isCollection(node)) {
4960
- path21 = Object.freeze(path21.concat(node));
4965
+ path22 = Object.freeze(path22.concat(node));
4961
4966
  for (let i2 = 0; i2 < node.items.length; ++i2) {
4962
- const ci = await visitAsync_(i2, node.items[i2], visitor, path21);
4967
+ const ci = await visitAsync_(i2, node.items[i2], visitor, path22);
4963
4968
  if (typeof ci === "number")
4964
4969
  i2 = ci - 1;
4965
4970
  else if (ci === BREAK)
@@ -4970,13 +4975,13 @@ var require_visit = __commonJS({
4970
4975
  }
4971
4976
  }
4972
4977
  } else if (identity4.isPair(node)) {
4973
- path21 = Object.freeze(path21.concat(node));
4974
- const ck = await visitAsync_("key", node.key, visitor, path21);
4978
+ path22 = Object.freeze(path22.concat(node));
4979
+ const ck = await visitAsync_("key", node.key, visitor, path22);
4975
4980
  if (ck === BREAK)
4976
4981
  return BREAK;
4977
4982
  else if (ck === REMOVE)
4978
4983
  node.key = null;
4979
- const cv = await visitAsync_("value", node.value, visitor, path21);
4984
+ const cv = await visitAsync_("value", node.value, visitor, path22);
4980
4985
  if (cv === BREAK)
4981
4986
  return BREAK;
4982
4987
  else if (cv === REMOVE)
@@ -5003,23 +5008,23 @@ var require_visit = __commonJS({
5003
5008
  }
5004
5009
  return visitor;
5005
5010
  }
5006
- function callVisitor(key, node, visitor, path21) {
5011
+ function callVisitor(key, node, visitor, path22) {
5007
5012
  if (typeof visitor === "function")
5008
- return visitor(key, node, path21);
5013
+ return visitor(key, node, path22);
5009
5014
  if (identity4.isMap(node))
5010
- return visitor.Map?.(key, node, path21);
5015
+ return visitor.Map?.(key, node, path22);
5011
5016
  if (identity4.isSeq(node))
5012
- return visitor.Seq?.(key, node, path21);
5017
+ return visitor.Seq?.(key, node, path22);
5013
5018
  if (identity4.isPair(node))
5014
- return visitor.Pair?.(key, node, path21);
5019
+ return visitor.Pair?.(key, node, path22);
5015
5020
  if (identity4.isScalar(node))
5016
- return visitor.Scalar?.(key, node, path21);
5021
+ return visitor.Scalar?.(key, node, path22);
5017
5022
  if (identity4.isAlias(node))
5018
- return visitor.Alias?.(key, node, path21);
5023
+ return visitor.Alias?.(key, node, path22);
5019
5024
  return void 0;
5020
5025
  }
5021
- function replaceNode(key, path21, node) {
5022
- const parent = path21[path21.length - 1];
5026
+ function replaceNode(key, path22, node) {
5027
+ const parent = path22[path22.length - 1];
5023
5028
  if (identity4.isCollection(parent)) {
5024
5029
  parent.items[key] = node;
5025
5030
  } else if (identity4.isPair(parent)) {
@@ -5629,10 +5634,10 @@ var require_Collection = __commonJS({
5629
5634
  var createNode = require_createNode();
5630
5635
  var identity4 = require_identity();
5631
5636
  var Node = require_Node();
5632
- function collectionFromPath(schema, path21, value) {
5637
+ function collectionFromPath(schema, path22, value) {
5633
5638
  let v = value;
5634
- for (let i2 = path21.length - 1; i2 >= 0; --i2) {
5635
- const k = path21[i2];
5639
+ for (let i2 = path22.length - 1; i2 >= 0; --i2) {
5640
+ const k = path22[i2];
5636
5641
  if (typeof k === "number" && Number.isInteger(k) && k >= 0) {
5637
5642
  const a2 = [];
5638
5643
  a2[k] = v;
@@ -5651,7 +5656,7 @@ var require_Collection = __commonJS({
5651
5656
  sourceObjects: /* @__PURE__ */ new Map()
5652
5657
  });
5653
5658
  }
5654
- var isEmptyPath = (path21) => path21 == null || typeof path21 === "object" && !!path21[Symbol.iterator]().next().done;
5659
+ var isEmptyPath = (path22) => path22 == null || typeof path22 === "object" && !!path22[Symbol.iterator]().next().done;
5655
5660
  var Collection = class extends Node.NodeBase {
5656
5661
  constructor(type, schema) {
5657
5662
  super(type);
@@ -5681,11 +5686,11 @@ var require_Collection = __commonJS({
5681
5686
  * be a Pair instance or a `{ key, value }` object, which may not have a key
5682
5687
  * that already exists in the map.
5683
5688
  */
5684
- addIn(path21, value) {
5685
- if (isEmptyPath(path21))
5689
+ addIn(path22, value) {
5690
+ if (isEmptyPath(path22))
5686
5691
  this.add(value);
5687
5692
  else {
5688
- const [key, ...rest] = path21;
5693
+ const [key, ...rest] = path22;
5689
5694
  const node = this.get(key, true);
5690
5695
  if (identity4.isCollection(node))
5691
5696
  node.addIn(rest, value);
@@ -5699,8 +5704,8 @@ var require_Collection = __commonJS({
5699
5704
  * Removes a value from the collection.
5700
5705
  * @returns `true` if the item was found and removed.
5701
5706
  */
5702
- deleteIn(path21) {
5703
- const [key, ...rest] = path21;
5707
+ deleteIn(path22) {
5708
+ const [key, ...rest] = path22;
5704
5709
  if (rest.length === 0)
5705
5710
  return this.delete(key);
5706
5711
  const node = this.get(key, true);
@@ -5714,8 +5719,8 @@ var require_Collection = __commonJS({
5714
5719
  * scalar values from their surrounding node; to disable set `keepScalar` to
5715
5720
  * `true` (collections are always returned intact).
5716
5721
  */
5717
- getIn(path21, keepScalar) {
5718
- const [key, ...rest] = path21;
5722
+ getIn(path22, keepScalar) {
5723
+ const [key, ...rest] = path22;
5719
5724
  const node = this.get(key, true);
5720
5725
  if (rest.length === 0)
5721
5726
  return !keepScalar && identity4.isScalar(node) ? node.value : node;
@@ -5733,8 +5738,8 @@ var require_Collection = __commonJS({
5733
5738
  /**
5734
5739
  * Checks if the collection includes a value with the key `key`.
5735
5740
  */
5736
- hasIn(path21) {
5737
- const [key, ...rest] = path21;
5741
+ hasIn(path22) {
5742
+ const [key, ...rest] = path22;
5738
5743
  if (rest.length === 0)
5739
5744
  return this.has(key);
5740
5745
  const node = this.get(key, true);
@@ -5744,8 +5749,8 @@ var require_Collection = __commonJS({
5744
5749
  * Sets a value in this collection. For `!!set`, `value` needs to be a
5745
5750
  * boolean to add/remove the item from the set.
5746
5751
  */
5747
- setIn(path21, value) {
5748
- const [key, ...rest] = path21;
5752
+ setIn(path22, value) {
5753
+ const [key, ...rest] = path22;
5749
5754
  if (rest.length === 0) {
5750
5755
  this.set(key, value);
5751
5756
  } else {
@@ -8260,9 +8265,9 @@ var require_Document = __commonJS({
8260
8265
  this.contents.add(value);
8261
8266
  }
8262
8267
  /** Adds a value to the document. */
8263
- addIn(path21, value) {
8268
+ addIn(path22, value) {
8264
8269
  if (assertCollection(this.contents))
8265
- this.contents.addIn(path21, value);
8270
+ this.contents.addIn(path22, value);
8266
8271
  }
8267
8272
  /**
8268
8273
  * Create a new `Alias` node, ensuring that the target `node` has the required anchor.
@@ -8337,14 +8342,14 @@ var require_Document = __commonJS({
8337
8342
  * Removes a value from the document.
8338
8343
  * @returns `true` if the item was found and removed.
8339
8344
  */
8340
- deleteIn(path21) {
8341
- if (Collection.isEmptyPath(path21)) {
8345
+ deleteIn(path22) {
8346
+ if (Collection.isEmptyPath(path22)) {
8342
8347
  if (this.contents == null)
8343
8348
  return false;
8344
8349
  this.contents = null;
8345
8350
  return true;
8346
8351
  }
8347
- return assertCollection(this.contents) ? this.contents.deleteIn(path21) : false;
8352
+ return assertCollection(this.contents) ? this.contents.deleteIn(path22) : false;
8348
8353
  }
8349
8354
  /**
8350
8355
  * Returns item at `key`, or `undefined` if not found. By default unwraps
@@ -8359,10 +8364,10 @@ var require_Document = __commonJS({
8359
8364
  * scalar values from their surrounding node; to disable set `keepScalar` to
8360
8365
  * `true` (collections are always returned intact).
8361
8366
  */
8362
- getIn(path21, keepScalar) {
8363
- if (Collection.isEmptyPath(path21))
8367
+ getIn(path22, keepScalar) {
8368
+ if (Collection.isEmptyPath(path22))
8364
8369
  return !keepScalar && identity4.isScalar(this.contents) ? this.contents.value : this.contents;
8365
- return identity4.isCollection(this.contents) ? this.contents.getIn(path21, keepScalar) : void 0;
8370
+ return identity4.isCollection(this.contents) ? this.contents.getIn(path22, keepScalar) : void 0;
8366
8371
  }
8367
8372
  /**
8368
8373
  * Checks if the document includes a value with the key `key`.
@@ -8373,10 +8378,10 @@ var require_Document = __commonJS({
8373
8378
  /**
8374
8379
  * Checks if the document includes a value at `path`.
8375
8380
  */
8376
- hasIn(path21) {
8377
- if (Collection.isEmptyPath(path21))
8381
+ hasIn(path22) {
8382
+ if (Collection.isEmptyPath(path22))
8378
8383
  return this.contents !== void 0;
8379
- return identity4.isCollection(this.contents) ? this.contents.hasIn(path21) : false;
8384
+ return identity4.isCollection(this.contents) ? this.contents.hasIn(path22) : false;
8380
8385
  }
8381
8386
  /**
8382
8387
  * Sets a value in this document. For `!!set`, `value` needs to be a
@@ -8393,13 +8398,13 @@ var require_Document = __commonJS({
8393
8398
  * Sets a value in this document. For `!!set`, `value` needs to be a
8394
8399
  * boolean to add/remove the item from the set.
8395
8400
  */
8396
- setIn(path21, value) {
8397
- if (Collection.isEmptyPath(path21)) {
8401
+ setIn(path22, value) {
8402
+ if (Collection.isEmptyPath(path22)) {
8398
8403
  this.contents = value;
8399
8404
  } else if (this.contents == null) {
8400
- this.contents = Collection.collectionFromPath(this.schema, Array.from(path21), value);
8405
+ this.contents = Collection.collectionFromPath(this.schema, Array.from(path22), value);
8401
8406
  } else if (assertCollection(this.contents)) {
8402
- this.contents.setIn(path21, value);
8407
+ this.contents.setIn(path22, value);
8403
8408
  }
8404
8409
  }
8405
8410
  /**
@@ -10357,9 +10362,9 @@ var require_cst_visit = __commonJS({
10357
10362
  visit.BREAK = BREAK;
10358
10363
  visit.SKIP = SKIP;
10359
10364
  visit.REMOVE = REMOVE;
10360
- visit.itemAtPath = (cst, path21) => {
10365
+ visit.itemAtPath = (cst, path22) => {
10361
10366
  let item = cst;
10362
- for (const [field, index] of path21) {
10367
+ for (const [field, index] of path22) {
10363
10368
  const tok = item?.[field];
10364
10369
  if (tok && "items" in tok) {
10365
10370
  item = tok.items[index];
@@ -10368,23 +10373,23 @@ var require_cst_visit = __commonJS({
10368
10373
  }
10369
10374
  return item;
10370
10375
  };
10371
- visit.parentCollection = (cst, path21) => {
10372
- const parent = visit.itemAtPath(cst, path21.slice(0, -1));
10373
- const field = path21[path21.length - 1][0];
10376
+ visit.parentCollection = (cst, path22) => {
10377
+ const parent = visit.itemAtPath(cst, path22.slice(0, -1));
10378
+ const field = path22[path22.length - 1][0];
10374
10379
  const coll = parent?.[field];
10375
10380
  if (coll && "items" in coll)
10376
10381
  return coll;
10377
10382
  throw new Error("Parent collection not found");
10378
10383
  };
10379
- function _visit(path21, item, visitor) {
10380
- let ctrl = visitor(item, path21);
10384
+ function _visit(path22, item, visitor) {
10385
+ let ctrl = visitor(item, path22);
10381
10386
  if (typeof ctrl === "symbol")
10382
10387
  return ctrl;
10383
10388
  for (const field of ["key", "value"]) {
10384
10389
  const token = item[field];
10385
10390
  if (token && "items" in token) {
10386
10391
  for (let i2 = 0; i2 < token.items.length; ++i2) {
10387
- const ci = _visit(Object.freeze(path21.concat([[field, i2]])), token.items[i2], visitor);
10392
+ const ci = _visit(Object.freeze(path22.concat([[field, i2]])), token.items[i2], visitor);
10388
10393
  if (typeof ci === "number")
10389
10394
  i2 = ci - 1;
10390
10395
  else if (ci === BREAK)
@@ -10395,10 +10400,10 @@ var require_cst_visit = __commonJS({
10395
10400
  }
10396
10401
  }
10397
10402
  if (typeof ctrl === "function" && field === "key")
10398
- ctrl = ctrl(item, path21);
10403
+ ctrl = ctrl(item, path22);
10399
10404
  }
10400
10405
  }
10401
- return typeof ctrl === "function" ? ctrl(item, path21) : ctrl;
10406
+ return typeof ctrl === "function" ? ctrl(item, path22) : ctrl;
10402
10407
  }
10403
10408
  exports.visit = visit;
10404
10409
  }
@@ -11683,14 +11688,14 @@ var require_parser = __commonJS({
11683
11688
  case "scalar":
11684
11689
  case "single-quoted-scalar":
11685
11690
  case "double-quoted-scalar": {
11686
- const fs17 = this.flowScalar(this.type);
11691
+ const fs18 = this.flowScalar(this.type);
11687
11692
  if (atNextItem || it.value) {
11688
- map.items.push({ start, key: fs17, sep: [] });
11693
+ map.items.push({ start, key: fs18, sep: [] });
11689
11694
  this.onKeyLine = true;
11690
11695
  } else if (it.sep) {
11691
- this.stack.push(fs17);
11696
+ this.stack.push(fs18);
11692
11697
  } else {
11693
- Object.assign(it, { key: fs17, sep: [] });
11698
+ Object.assign(it, { key: fs18, sep: [] });
11694
11699
  this.onKeyLine = true;
11695
11700
  }
11696
11701
  return;
@@ -11818,13 +11823,13 @@ var require_parser = __commonJS({
11818
11823
  case "scalar":
11819
11824
  case "single-quoted-scalar":
11820
11825
  case "double-quoted-scalar": {
11821
- const fs17 = this.flowScalar(this.type);
11826
+ const fs18 = this.flowScalar(this.type);
11822
11827
  if (!it || it.value)
11823
- fc.items.push({ start: [], key: fs17, sep: [] });
11828
+ fc.items.push({ start: [], key: fs18, sep: [] });
11824
11829
  else if (it.sep)
11825
- this.stack.push(fs17);
11830
+ this.stack.push(fs18);
11826
11831
  else
11827
- Object.assign(it, { key: fs17, sep: [] });
11832
+ Object.assign(it, { key: fs18, sep: [] });
11828
11833
  return;
11829
11834
  }
11830
11835
  case "flow-map-end":
@@ -13065,8 +13070,8 @@ var require_command = __commonJS({
13065
13070
  "node_modules/commander/lib/command.js"(exports) {
13066
13071
  var EventEmitter3 = __require("node:events").EventEmitter;
13067
13072
  var childProcess = __require("node:child_process");
13068
- var path21 = __require("node:path");
13069
- var fs17 = __require("node:fs");
13073
+ var path22 = __require("node:path");
13074
+ var fs18 = __require("node:fs");
13070
13075
  var process10 = __require("node:process");
13071
13076
  var { Argument: Argument2, humanReadableArgName } = require_argument();
13072
13077
  var { CommanderError: CommanderError2 } = require_error();
@@ -13998,11 +14003,11 @@ Expecting one of '${allowedValues.join("', '")}'`);
13998
14003
  let launchWithNode = false;
13999
14004
  const sourceExt = [".js", ".ts", ".tsx", ".mjs", ".cjs"];
14000
14005
  function findFile(baseDir, baseName) {
14001
- const localBin = path21.resolve(baseDir, baseName);
14002
- if (fs17.existsSync(localBin)) return localBin;
14003
- if (sourceExt.includes(path21.extname(baseName))) return void 0;
14006
+ const localBin = path22.resolve(baseDir, baseName);
14007
+ if (fs18.existsSync(localBin)) return localBin;
14008
+ if (sourceExt.includes(path22.extname(baseName))) return void 0;
14004
14009
  const foundExt = sourceExt.find(
14005
- (ext) => fs17.existsSync(`${localBin}${ext}`)
14010
+ (ext) => fs18.existsSync(`${localBin}${ext}`)
14006
14011
  );
14007
14012
  if (foundExt) return `${localBin}${foundExt}`;
14008
14013
  return void 0;
@@ -14014,21 +14019,21 @@ Expecting one of '${allowedValues.join("', '")}'`);
14014
14019
  if (this._scriptPath) {
14015
14020
  let resolvedScriptPath;
14016
14021
  try {
14017
- resolvedScriptPath = fs17.realpathSync(this._scriptPath);
14022
+ resolvedScriptPath = fs18.realpathSync(this._scriptPath);
14018
14023
  } catch (err) {
14019
14024
  resolvedScriptPath = this._scriptPath;
14020
14025
  }
14021
- executableDir = path21.resolve(
14022
- path21.dirname(resolvedScriptPath),
14026
+ executableDir = path22.resolve(
14027
+ path22.dirname(resolvedScriptPath),
14023
14028
  executableDir
14024
14029
  );
14025
14030
  }
14026
14031
  if (executableDir) {
14027
14032
  let localFile = findFile(executableDir, executableFile);
14028
14033
  if (!localFile && !subcommand._executableFile && this._scriptPath) {
14029
- const legacyName = path21.basename(
14034
+ const legacyName = path22.basename(
14030
14035
  this._scriptPath,
14031
- path21.extname(this._scriptPath)
14036
+ path22.extname(this._scriptPath)
14032
14037
  );
14033
14038
  if (legacyName !== this._name) {
14034
14039
  localFile = findFile(
@@ -14039,7 +14044,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
14039
14044
  }
14040
14045
  executableFile = localFile || executableFile;
14041
14046
  }
14042
- launchWithNode = sourceExt.includes(path21.extname(executableFile));
14047
+ launchWithNode = sourceExt.includes(path22.extname(executableFile));
14043
14048
  let proc;
14044
14049
  if (process10.platform !== "win32") {
14045
14050
  if (launchWithNode) {
@@ -14879,7 +14884,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
14879
14884
  * @return {Command}
14880
14885
  */
14881
14886
  nameFromFilename(filename) {
14882
- this._name = path21.basename(filename, path21.extname(filename));
14887
+ this._name = path22.basename(filename, path22.extname(filename));
14883
14888
  return this;
14884
14889
  }
14885
14890
  /**
@@ -14893,9 +14898,9 @@ Expecting one of '${allowedValues.join("', '")}'`);
14893
14898
  * @param {string} [path]
14894
14899
  * @return {(string|null|Command)}
14895
14900
  */
14896
- executableDir(path22) {
14897
- if (path22 === void 0) return this._executableDir;
14898
- this._executableDir = path22;
14901
+ executableDir(path23) {
14902
+ if (path23 === void 0) return this._executableDir;
14903
+ this._executableDir = path23;
14899
14904
  return this;
14900
14905
  }
14901
14906
  /**
@@ -60064,15 +60069,15 @@ var require_route = __commonJS({
60064
60069
  };
60065
60070
  }
60066
60071
  function wrapConversion(toModel, graph) {
60067
- const path21 = [graph[toModel].parent, toModel];
60072
+ const path22 = [graph[toModel].parent, toModel];
60068
60073
  let fn = conversions[graph[toModel].parent][toModel];
60069
60074
  let cur = graph[toModel].parent;
60070
60075
  while (graph[cur].parent) {
60071
- path21.unshift(graph[cur].parent);
60076
+ path22.unshift(graph[cur].parent);
60072
60077
  fn = link2(conversions[graph[cur].parent][cur], fn);
60073
60078
  cur = graph[cur].parent;
60074
60079
  }
60075
- fn.conversion = path21;
60080
+ fn.conversion = path22;
60076
60081
  return fn;
60077
60082
  }
60078
60083
  module.exports = function(fromModel) {
@@ -77207,13 +77212,13 @@ var logOutputSync = ({ serializedResult, fdNumber, state, verboseInfo, encoding,
77207
77212
  }
77208
77213
  };
77209
77214
  var writeToFiles = (serializedResult, stdioItems, outputFiles) => {
77210
- for (const { path: path21, append } of stdioItems.filter(({ type }) => FILE_TYPES.has(type))) {
77211
- const pathString = typeof path21 === "string" ? path21 : path21.toString();
77215
+ for (const { path: path22, append } of stdioItems.filter(({ type }) => FILE_TYPES.has(type))) {
77216
+ const pathString = typeof path22 === "string" ? path22 : path22.toString();
77212
77217
  if (append || outputFiles.has(pathString)) {
77213
- appendFileSync(path21, serializedResult);
77218
+ appendFileSync(path22, serializedResult);
77214
77219
  } else {
77215
77220
  outputFiles.add(pathString);
77216
- writeFileSync(path21, serializedResult);
77221
+ writeFileSync(path22, serializedResult);
77217
77222
  }
77218
77223
  }
77219
77224
  };
@@ -80264,8 +80269,8 @@ function getErrorMap() {
80264
80269
 
80265
80270
  // node_modules/zod/v3/helpers/parseUtil.js
80266
80271
  var makeIssue = (params) => {
80267
- const { data, path: path21, errorMaps, issueData } = params;
80268
- const fullPath = [...path21, ...issueData.path || []];
80272
+ const { data, path: path22, errorMaps, issueData } = params;
80273
+ const fullPath = [...path22, ...issueData.path || []];
80269
80274
  const fullIssue = {
80270
80275
  ...issueData,
80271
80276
  path: fullPath
@@ -80381,11 +80386,11 @@ var errorUtil;
80381
80386
 
80382
80387
  // node_modules/zod/v3/types.js
80383
80388
  var ParseInputLazyPath = class {
80384
- constructor(parent, value, path21, key) {
80389
+ constructor(parent, value, path22, key) {
80385
80390
  this._cachedPath = [];
80386
80391
  this.parent = parent;
80387
80392
  this.data = value;
80388
- this._path = path21;
80393
+ this._path = path22;
80389
80394
  this._key = key;
80390
80395
  }
80391
80396
  get path() {
@@ -83946,8 +83951,14 @@ var ActionSchema = external_exports.object({
83946
83951
  key: external_exports.string().min(1).max(1).optional()
83947
83952
  });
83948
83953
  var MountSettingsSchema = external_exports.object({
83949
- /** Workspace-relative path for the generated docker-compose overlay. */
83950
- overlayPath: external_exports.string().optional().default("docker-compose.dev-cockpit.yml"),
83954
+ /**
83955
+ * Override path for the generated docker-compose overlay. When unset
83956
+ * (the default), the overlay lands in the cockpit state dir alongside
83957
+ * `mount.manifest.json` — keeps the wrapper repo clean of per-developer
83958
+ * artefacts. When set, the value is workspace-relative; absolute paths
83959
+ * are honoured verbatim.
83960
+ */
83961
+ overlayPath: external_exports.string().optional(),
83951
83962
  /** Basename inside stateDir for the manifest. */
83952
83963
  manifestFile: external_exports.string().optional().default("mount.manifest.json")
83953
83964
  });
@@ -83967,7 +83978,6 @@ var BaseCockpitConfigSchema = external_exports.object({
83967
83978
  }),
83968
83979
  mounts: external_exports.array(MountSchema).optional().default([]),
83969
83980
  mount: MountSettingsSchema.optional().default({
83970
- overlayPath: "docker-compose.dev-cockpit.yml",
83971
83981
  manifestFile: "mount.manifest.json"
83972
83982
  }),
83973
83983
  /** Which pane the cockpit lands on when it boots. Profile may override. */
@@ -88769,7 +88779,7 @@ var ReaddirpStream = class extends Readable4 {
88769
88779
  this._directoryFilter = normalizeFilter(opts.directoryFilter);
88770
88780
  const statMethod = opts.lstat ? lstat : stat;
88771
88781
  if (wantBigintFsStats) {
88772
- this._stat = (path21) => statMethod(path21, { bigint: true });
88782
+ this._stat = (path22) => statMethod(path22, { bigint: true });
88773
88783
  } else {
88774
88784
  this._stat = statMethod;
88775
88785
  }
@@ -88794,8 +88804,8 @@ var ReaddirpStream = class extends Readable4 {
88794
88804
  const par = this.parent;
88795
88805
  const fil = par && par.files;
88796
88806
  if (fil && fil.length > 0) {
88797
- const { path: path21, depth } = par;
88798
- const slice = fil.splice(0, batch).map((dirent) => this._formatEntry(dirent, path21));
88807
+ const { path: path22, depth } = par;
88808
+ const slice = fil.splice(0, batch).map((dirent) => this._formatEntry(dirent, path22));
88799
88809
  const awaited = await Promise.all(slice);
88800
88810
  for (const entry of awaited) {
88801
88811
  if (!entry)
@@ -88835,20 +88845,20 @@ var ReaddirpStream = class extends Readable4 {
88835
88845
  this.reading = false;
88836
88846
  }
88837
88847
  }
88838
- async _exploreDir(path21, depth) {
88848
+ async _exploreDir(path22, depth) {
88839
88849
  let files;
88840
88850
  try {
88841
- files = await readdir(path21, this._rdOptions);
88851
+ files = await readdir(path22, this._rdOptions);
88842
88852
  } catch (error) {
88843
88853
  this._onError(error);
88844
88854
  }
88845
- return { files, depth, path: path21 };
88855
+ return { files, depth, path: path22 };
88846
88856
  }
88847
- async _formatEntry(dirent, path21) {
88857
+ async _formatEntry(dirent, path22) {
88848
88858
  let entry;
88849
88859
  const basename3 = this._isDirent ? dirent.name : dirent;
88850
88860
  try {
88851
- const fullPath = presolve(pjoin(path21, basename3));
88861
+ const fullPath = presolve(pjoin(path22, basename3));
88852
88862
  entry = { path: prelative(this._root, fullPath), fullPath, basename: basename3 };
88853
88863
  entry[this._statsProp] = this._isDirent ? dirent : await this._stat(fullPath);
88854
88864
  } catch (err) {
@@ -89248,16 +89258,16 @@ var delFromSet = (main, prop, item) => {
89248
89258
  };
89249
89259
  var isEmptySet = (val) => val instanceof Set ? val.size === 0 : !val;
89250
89260
  var FsWatchInstances = /* @__PURE__ */ new Map();
89251
- function createFsWatchInstance(path21, options2, listener, errHandler, emitRaw) {
89261
+ function createFsWatchInstance(path22, options2, listener, errHandler, emitRaw) {
89252
89262
  const handleEvent = (rawEvent, evPath) => {
89253
- listener(path21);
89254
- emitRaw(rawEvent, evPath, { watchedPath: path21 });
89255
- if (evPath && path21 !== evPath) {
89256
- fsWatchBroadcast(sp.resolve(path21, evPath), KEY_LISTENERS, sp.join(path21, evPath));
89263
+ listener(path22);
89264
+ emitRaw(rawEvent, evPath, { watchedPath: path22 });
89265
+ if (evPath && path22 !== evPath) {
89266
+ fsWatchBroadcast(sp.resolve(path22, evPath), KEY_LISTENERS, sp.join(path22, evPath));
89257
89267
  }
89258
89268
  };
89259
89269
  try {
89260
- return fs_watch(path21, {
89270
+ return fs_watch(path22, {
89261
89271
  persistent: options2.persistent
89262
89272
  }, handleEvent);
89263
89273
  } catch (error) {
@@ -89273,12 +89283,12 @@ var fsWatchBroadcast = (fullPath, listenerType, val1, val2, val3) => {
89273
89283
  listener(val1, val2, val3);
89274
89284
  });
89275
89285
  };
89276
- var setFsWatchListener = (path21, fullPath, options2, handlers) => {
89286
+ var setFsWatchListener = (path22, fullPath, options2, handlers) => {
89277
89287
  const { listener, errHandler, rawEmitter } = handlers;
89278
89288
  let cont = FsWatchInstances.get(fullPath);
89279
89289
  let watcher;
89280
89290
  if (!options2.persistent) {
89281
- watcher = createFsWatchInstance(path21, options2, listener, errHandler, rawEmitter);
89291
+ watcher = createFsWatchInstance(path22, options2, listener, errHandler, rawEmitter);
89282
89292
  if (!watcher)
89283
89293
  return;
89284
89294
  return watcher.close.bind(watcher);
@@ -89289,7 +89299,7 @@ var setFsWatchListener = (path21, fullPath, options2, handlers) => {
89289
89299
  addAndConvert(cont, KEY_RAW, rawEmitter);
89290
89300
  } else {
89291
89301
  watcher = createFsWatchInstance(
89292
- path21,
89302
+ path22,
89293
89303
  options2,
89294
89304
  fsWatchBroadcast.bind(null, fullPath, KEY_LISTENERS),
89295
89305
  errHandler,
@@ -89304,7 +89314,7 @@ var setFsWatchListener = (path21, fullPath, options2, handlers) => {
89304
89314
  cont.watcherUnusable = true;
89305
89315
  if (isWindows && error.code === "EPERM") {
89306
89316
  try {
89307
- const fd = await open(path21, "r");
89317
+ const fd = await open(path22, "r");
89308
89318
  await fd.close();
89309
89319
  broadcastErr(error);
89310
89320
  } catch (err) {
@@ -89335,7 +89345,7 @@ var setFsWatchListener = (path21, fullPath, options2, handlers) => {
89335
89345
  };
89336
89346
  };
89337
89347
  var FsWatchFileInstances = /* @__PURE__ */ new Map();
89338
- var setFsWatchFileListener = (path21, fullPath, options2, handlers) => {
89348
+ var setFsWatchFileListener = (path22, fullPath, options2, handlers) => {
89339
89349
  const { listener, rawEmitter } = handlers;
89340
89350
  let cont = FsWatchFileInstances.get(fullPath);
89341
89351
  const copts = cont && cont.options;
@@ -89357,7 +89367,7 @@ var setFsWatchFileListener = (path21, fullPath, options2, handlers) => {
89357
89367
  });
89358
89368
  const currmtime = curr.mtimeMs;
89359
89369
  if (curr.size !== prev.size || currmtime > prev.mtimeMs || currmtime === 0) {
89360
- foreach(cont.listeners, (listener2) => listener2(path21, curr));
89370
+ foreach(cont.listeners, (listener2) => listener2(path22, curr));
89361
89371
  }
89362
89372
  })
89363
89373
  };
@@ -89387,13 +89397,13 @@ var NodeFsHandler = class {
89387
89397
  * @param listener on fs change
89388
89398
  * @returns closer for the watcher instance
89389
89399
  */
89390
- _watchWithNodeFs(path21, listener) {
89400
+ _watchWithNodeFs(path22, listener) {
89391
89401
  const opts = this.fsw.options;
89392
- const directory = sp.dirname(path21);
89393
- const basename3 = sp.basename(path21);
89402
+ const directory = sp.dirname(path22);
89403
+ const basename3 = sp.basename(path22);
89394
89404
  const parent = this.fsw._getWatchedDir(directory);
89395
89405
  parent.add(basename3);
89396
- const absolutePath = sp.resolve(path21);
89406
+ const absolutePath = sp.resolve(path22);
89397
89407
  const options2 = {
89398
89408
  persistent: opts.persistent
89399
89409
  };
@@ -89403,12 +89413,12 @@ var NodeFsHandler = class {
89403
89413
  if (opts.usePolling) {
89404
89414
  const enableBin = opts.interval !== opts.binaryInterval;
89405
89415
  options2.interval = enableBin && isBinaryPath(basename3) ? opts.binaryInterval : opts.interval;
89406
- closer = setFsWatchFileListener(path21, absolutePath, options2, {
89416
+ closer = setFsWatchFileListener(path22, absolutePath, options2, {
89407
89417
  listener,
89408
89418
  rawEmitter: this.fsw._emitRaw
89409
89419
  });
89410
89420
  } else {
89411
- closer = setFsWatchListener(path21, absolutePath, options2, {
89421
+ closer = setFsWatchListener(path22, absolutePath, options2, {
89412
89422
  listener,
89413
89423
  errHandler: this._boundHandleError,
89414
89424
  rawEmitter: this.fsw._emitRaw
@@ -89430,7 +89440,7 @@ var NodeFsHandler = class {
89430
89440
  let prevStats = stats;
89431
89441
  if (parent.has(basename3))
89432
89442
  return;
89433
- const listener = async (path21, newStats) => {
89443
+ const listener = async (path22, newStats) => {
89434
89444
  if (!this.fsw._throttle(THROTTLE_MODE_WATCH, file, 5))
89435
89445
  return;
89436
89446
  if (!newStats || newStats.mtimeMs === 0) {
@@ -89444,11 +89454,11 @@ var NodeFsHandler = class {
89444
89454
  this.fsw._emit(EV.CHANGE, file, newStats2);
89445
89455
  }
89446
89456
  if ((isMacos || isLinux || isFreeBSD) && prevStats.ino !== newStats2.ino) {
89447
- this.fsw._closeFile(path21);
89457
+ this.fsw._closeFile(path22);
89448
89458
  prevStats = newStats2;
89449
89459
  const closer2 = this._watchWithNodeFs(file, listener);
89450
89460
  if (closer2)
89451
- this.fsw._addPathCloser(path21, closer2);
89461
+ this.fsw._addPathCloser(path22, closer2);
89452
89462
  } else {
89453
89463
  prevStats = newStats2;
89454
89464
  }
@@ -89480,7 +89490,7 @@ var NodeFsHandler = class {
89480
89490
  * @param item basename of this item
89481
89491
  * @returns true if no more processing is needed for this entry.
89482
89492
  */
89483
- async _handleSymlink(entry, directory, path21, item) {
89493
+ async _handleSymlink(entry, directory, path22, item) {
89484
89494
  if (this.fsw.closed) {
89485
89495
  return;
89486
89496
  }
@@ -89490,7 +89500,7 @@ var NodeFsHandler = class {
89490
89500
  this.fsw._incrReadyCount();
89491
89501
  let linkPath;
89492
89502
  try {
89493
- linkPath = await fsrealpath(path21);
89503
+ linkPath = await fsrealpath(path22);
89494
89504
  } catch (e) {
89495
89505
  this.fsw._emitReady();
89496
89506
  return true;
@@ -89500,12 +89510,12 @@ var NodeFsHandler = class {
89500
89510
  if (dir.has(item)) {
89501
89511
  if (this.fsw._symlinkPaths.get(full) !== linkPath) {
89502
89512
  this.fsw._symlinkPaths.set(full, linkPath);
89503
- this.fsw._emit(EV.CHANGE, path21, entry.stats);
89513
+ this.fsw._emit(EV.CHANGE, path22, entry.stats);
89504
89514
  }
89505
89515
  } else {
89506
89516
  dir.add(item);
89507
89517
  this.fsw._symlinkPaths.set(full, linkPath);
89508
- this.fsw._emit(EV.ADD, path21, entry.stats);
89518
+ this.fsw._emit(EV.ADD, path22, entry.stats);
89509
89519
  }
89510
89520
  this.fsw._emitReady();
89511
89521
  return true;
@@ -89535,9 +89545,9 @@ var NodeFsHandler = class {
89535
89545
  return;
89536
89546
  }
89537
89547
  const item = entry.path;
89538
- let path21 = sp.join(directory, item);
89548
+ let path22 = sp.join(directory, item);
89539
89549
  current.add(item);
89540
- if (entry.stats.isSymbolicLink() && await this._handleSymlink(entry, directory, path21, item)) {
89550
+ if (entry.stats.isSymbolicLink() && await this._handleSymlink(entry, directory, path22, item)) {
89541
89551
  return;
89542
89552
  }
89543
89553
  if (this.fsw.closed) {
@@ -89546,8 +89556,8 @@ var NodeFsHandler = class {
89546
89556
  }
89547
89557
  if (item === target || !target && !previous.has(item)) {
89548
89558
  this.fsw._incrReadyCount();
89549
- path21 = sp.join(dir, sp.relative(dir, path21));
89550
- this._addToNodeFs(path21, initialAdd, wh, depth + 1);
89559
+ path22 = sp.join(dir, sp.relative(dir, path22));
89560
+ this._addToNodeFs(path22, initialAdd, wh, depth + 1);
89551
89561
  }
89552
89562
  }).on(EV.ERROR, this._boundHandleError);
89553
89563
  return new Promise((resolve3, reject) => {
@@ -89616,13 +89626,13 @@ var NodeFsHandler = class {
89616
89626
  * @param depth Child path actually targeted for watch
89617
89627
  * @param target Child path actually targeted for watch
89618
89628
  */
89619
- async _addToNodeFs(path21, initialAdd, priorWh, depth, target) {
89629
+ async _addToNodeFs(path22, initialAdd, priorWh, depth, target) {
89620
89630
  const ready = this.fsw._emitReady;
89621
- if (this.fsw._isIgnored(path21) || this.fsw.closed) {
89631
+ if (this.fsw._isIgnored(path22) || this.fsw.closed) {
89622
89632
  ready();
89623
89633
  return false;
89624
89634
  }
89625
- const wh = this.fsw._getWatchHelpers(path21);
89635
+ const wh = this.fsw._getWatchHelpers(path22);
89626
89636
  if (priorWh) {
89627
89637
  wh.filterPath = (entry) => priorWh.filterPath(entry);
89628
89638
  wh.filterDir = (entry) => priorWh.filterDir(entry);
@@ -89638,8 +89648,8 @@ var NodeFsHandler = class {
89638
89648
  const follow = this.fsw.options.followSymlinks;
89639
89649
  let closer;
89640
89650
  if (stats.isDirectory()) {
89641
- const absPath = sp.resolve(path21);
89642
- const targetPath = follow ? await fsrealpath(path21) : path21;
89651
+ const absPath = sp.resolve(path22);
89652
+ const targetPath = follow ? await fsrealpath(path22) : path22;
89643
89653
  if (this.fsw.closed)
89644
89654
  return;
89645
89655
  closer = await this._handleDir(wh.watchPath, stats, initialAdd, depth, target, wh, targetPath);
@@ -89649,29 +89659,29 @@ var NodeFsHandler = class {
89649
89659
  this.fsw._symlinkPaths.set(absPath, targetPath);
89650
89660
  }
89651
89661
  } else if (stats.isSymbolicLink()) {
89652
- const targetPath = follow ? await fsrealpath(path21) : path21;
89662
+ const targetPath = follow ? await fsrealpath(path22) : path22;
89653
89663
  if (this.fsw.closed)
89654
89664
  return;
89655
89665
  const parent = sp.dirname(wh.watchPath);
89656
89666
  this.fsw._getWatchedDir(parent).add(wh.watchPath);
89657
89667
  this.fsw._emit(EV.ADD, wh.watchPath, stats);
89658
- closer = await this._handleDir(parent, stats, initialAdd, depth, path21, wh, targetPath);
89668
+ closer = await this._handleDir(parent, stats, initialAdd, depth, path22, wh, targetPath);
89659
89669
  if (this.fsw.closed)
89660
89670
  return;
89661
89671
  if (targetPath !== void 0) {
89662
- this.fsw._symlinkPaths.set(sp.resolve(path21), targetPath);
89672
+ this.fsw._symlinkPaths.set(sp.resolve(path22), targetPath);
89663
89673
  }
89664
89674
  } else {
89665
89675
  closer = this._handleFile(wh.watchPath, stats, initialAdd);
89666
89676
  }
89667
89677
  ready();
89668
89678
  if (closer)
89669
- this.fsw._addPathCloser(path21, closer);
89679
+ this.fsw._addPathCloser(path22, closer);
89670
89680
  return false;
89671
89681
  } catch (error) {
89672
89682
  if (this.fsw._handleError(error)) {
89673
89683
  ready();
89674
- return path21;
89684
+ return path22;
89675
89685
  }
89676
89686
  }
89677
89687
  }
@@ -89714,24 +89724,24 @@ function createPattern(matcher) {
89714
89724
  }
89715
89725
  return () => false;
89716
89726
  }
89717
- function normalizePath(path21) {
89718
- if (typeof path21 !== "string")
89727
+ function normalizePath(path22) {
89728
+ if (typeof path22 !== "string")
89719
89729
  throw new Error("string expected");
89720
- path21 = sp2.normalize(path21);
89721
- path21 = path21.replace(/\\/g, "/");
89730
+ path22 = sp2.normalize(path22);
89731
+ path22 = path22.replace(/\\/g, "/");
89722
89732
  let prepend = false;
89723
- if (path21.startsWith("//"))
89733
+ if (path22.startsWith("//"))
89724
89734
  prepend = true;
89725
- path21 = path21.replace(DOUBLE_SLASH_RE, "/");
89735
+ path22 = path22.replace(DOUBLE_SLASH_RE, "/");
89726
89736
  if (prepend)
89727
- path21 = "/" + path21;
89728
- return path21;
89737
+ path22 = "/" + path22;
89738
+ return path22;
89729
89739
  }
89730
89740
  function matchPatterns(patterns, testString, stats) {
89731
- const path21 = normalizePath(testString);
89741
+ const path22 = normalizePath(testString);
89732
89742
  for (let index = 0; index < patterns.length; index++) {
89733
89743
  const pattern = patterns[index];
89734
- if (pattern(path21, stats)) {
89744
+ if (pattern(path22, stats)) {
89735
89745
  return true;
89736
89746
  }
89737
89747
  }
@@ -89769,19 +89779,19 @@ var toUnix = (string) => {
89769
89779
  }
89770
89780
  return str;
89771
89781
  };
89772
- var normalizePathToUnix = (path21) => toUnix(sp2.normalize(toUnix(path21)));
89773
- var normalizeIgnored = (cwd = "") => (path21) => {
89774
- if (typeof path21 === "string") {
89775
- return normalizePathToUnix(sp2.isAbsolute(path21) ? path21 : sp2.join(cwd, path21));
89782
+ var normalizePathToUnix = (path22) => toUnix(sp2.normalize(toUnix(path22)));
89783
+ var normalizeIgnored = (cwd = "") => (path22) => {
89784
+ if (typeof path22 === "string") {
89785
+ return normalizePathToUnix(sp2.isAbsolute(path22) ? path22 : sp2.join(cwd, path22));
89776
89786
  } else {
89777
- return path21;
89787
+ return path22;
89778
89788
  }
89779
89789
  };
89780
- var getAbsolutePath = (path21, cwd) => {
89781
- if (sp2.isAbsolute(path21)) {
89782
- return path21;
89790
+ var getAbsolutePath = (path22, cwd) => {
89791
+ if (sp2.isAbsolute(path22)) {
89792
+ return path22;
89783
89793
  }
89784
- return sp2.join(cwd, path21);
89794
+ return sp2.join(cwd, path22);
89785
89795
  };
89786
89796
  var EMPTY_SET = Object.freeze(/* @__PURE__ */ new Set());
89787
89797
  var DirEntry = class {
@@ -89846,10 +89856,10 @@ var WatchHelper = class {
89846
89856
  dirParts;
89847
89857
  followSymlinks;
89848
89858
  statMethod;
89849
- constructor(path21, follow, fsw) {
89859
+ constructor(path22, follow, fsw) {
89850
89860
  this.fsw = fsw;
89851
- const watchPath = path21;
89852
- this.path = path21 = path21.replace(REPLACER_RE, "");
89861
+ const watchPath = path22;
89862
+ this.path = path22 = path22.replace(REPLACER_RE, "");
89853
89863
  this.watchPath = watchPath;
89854
89864
  this.fullWatchPath = sp2.resolve(watchPath);
89855
89865
  this.dirParts = [];
@@ -89989,20 +89999,20 @@ var FSWatcher = class extends EventEmitter2 {
89989
89999
  this._closePromise = void 0;
89990
90000
  let paths = unifyPaths(paths_);
89991
90001
  if (cwd) {
89992
- paths = paths.map((path21) => {
89993
- const absPath = getAbsolutePath(path21, cwd);
90002
+ paths = paths.map((path22) => {
90003
+ const absPath = getAbsolutePath(path22, cwd);
89994
90004
  return absPath;
89995
90005
  });
89996
90006
  }
89997
- paths.forEach((path21) => {
89998
- this._removeIgnoredPath(path21);
90007
+ paths.forEach((path22) => {
90008
+ this._removeIgnoredPath(path22);
89999
90009
  });
90000
90010
  this._userIgnored = void 0;
90001
90011
  if (!this._readyCount)
90002
90012
  this._readyCount = 0;
90003
90013
  this._readyCount += paths.length;
90004
- Promise.all(paths.map(async (path21) => {
90005
- const res = await this._nodeFsHandler._addToNodeFs(path21, !_internal, void 0, 0, _origAdd);
90014
+ Promise.all(paths.map(async (path22) => {
90015
+ const res = await this._nodeFsHandler._addToNodeFs(path22, !_internal, void 0, 0, _origAdd);
90006
90016
  if (res)
90007
90017
  this._emitReady();
90008
90018
  return res;
@@ -90024,17 +90034,17 @@ var FSWatcher = class extends EventEmitter2 {
90024
90034
  return this;
90025
90035
  const paths = unifyPaths(paths_);
90026
90036
  const { cwd } = this.options;
90027
- paths.forEach((path21) => {
90028
- if (!sp2.isAbsolute(path21) && !this._closers.has(path21)) {
90037
+ paths.forEach((path22) => {
90038
+ if (!sp2.isAbsolute(path22) && !this._closers.has(path22)) {
90029
90039
  if (cwd)
90030
- path21 = sp2.join(cwd, path21);
90031
- path21 = sp2.resolve(path21);
90040
+ path22 = sp2.join(cwd, path22);
90041
+ path22 = sp2.resolve(path22);
90032
90042
  }
90033
- this._closePath(path21);
90034
- this._addIgnoredPath(path21);
90035
- if (this._watched.has(path21)) {
90043
+ this._closePath(path22);
90044
+ this._addIgnoredPath(path22);
90045
+ if (this._watched.has(path22)) {
90036
90046
  this._addIgnoredPath({
90037
- path: path21,
90047
+ path: path22,
90038
90048
  recursive: true
90039
90049
  });
90040
90050
  }
@@ -90098,38 +90108,38 @@ var FSWatcher = class extends EventEmitter2 {
90098
90108
  * @param stats arguments to be passed with event
90099
90109
  * @returns the error if defined, otherwise the value of the FSWatcher instance's `closed` flag
90100
90110
  */
90101
- async _emit(event, path21, stats) {
90111
+ async _emit(event, path22, stats) {
90102
90112
  if (this.closed)
90103
90113
  return;
90104
90114
  const opts = this.options;
90105
90115
  if (isWindows)
90106
- path21 = sp2.normalize(path21);
90116
+ path22 = sp2.normalize(path22);
90107
90117
  if (opts.cwd)
90108
- path21 = sp2.relative(opts.cwd, path21);
90109
- const args = [path21];
90118
+ path22 = sp2.relative(opts.cwd, path22);
90119
+ const args = [path22];
90110
90120
  if (stats != null)
90111
90121
  args.push(stats);
90112
90122
  const awf = opts.awaitWriteFinish;
90113
90123
  let pw;
90114
- if (awf && (pw = this._pendingWrites.get(path21))) {
90124
+ if (awf && (pw = this._pendingWrites.get(path22))) {
90115
90125
  pw.lastChange = /* @__PURE__ */ new Date();
90116
90126
  return this;
90117
90127
  }
90118
90128
  if (opts.atomic) {
90119
90129
  if (event === EVENTS.UNLINK) {
90120
- this._pendingUnlinks.set(path21, [event, ...args]);
90130
+ this._pendingUnlinks.set(path22, [event, ...args]);
90121
90131
  setTimeout(() => {
90122
- this._pendingUnlinks.forEach((entry, path22) => {
90132
+ this._pendingUnlinks.forEach((entry, path23) => {
90123
90133
  this.emit(...entry);
90124
90134
  this.emit(EVENTS.ALL, ...entry);
90125
- this._pendingUnlinks.delete(path22);
90135
+ this._pendingUnlinks.delete(path23);
90126
90136
  });
90127
90137
  }, typeof opts.atomic === "number" ? opts.atomic : 100);
90128
90138
  return this;
90129
90139
  }
90130
- if (event === EVENTS.ADD && this._pendingUnlinks.has(path21)) {
90140
+ if (event === EVENTS.ADD && this._pendingUnlinks.has(path22)) {
90131
90141
  event = EVENTS.CHANGE;
90132
- this._pendingUnlinks.delete(path21);
90142
+ this._pendingUnlinks.delete(path22);
90133
90143
  }
90134
90144
  }
90135
90145
  if (awf && (event === EVENTS.ADD || event === EVENTS.CHANGE) && this._readyEmitted) {
@@ -90147,16 +90157,16 @@ var FSWatcher = class extends EventEmitter2 {
90147
90157
  this.emitWithAll(event, args);
90148
90158
  }
90149
90159
  };
90150
- this._awaitWriteFinish(path21, awf.stabilityThreshold, event, awfEmit);
90160
+ this._awaitWriteFinish(path22, awf.stabilityThreshold, event, awfEmit);
90151
90161
  return this;
90152
90162
  }
90153
90163
  if (event === EVENTS.CHANGE) {
90154
- const isThrottled = !this._throttle(EVENTS.CHANGE, path21, 50);
90164
+ const isThrottled = !this._throttle(EVENTS.CHANGE, path22, 50);
90155
90165
  if (isThrottled)
90156
90166
  return this;
90157
90167
  }
90158
90168
  if (opts.alwaysStat && stats === void 0 && (event === EVENTS.ADD || event === EVENTS.ADD_DIR || event === EVENTS.CHANGE)) {
90159
- const fullPath = opts.cwd ? sp2.join(opts.cwd, path21) : path21;
90169
+ const fullPath = opts.cwd ? sp2.join(opts.cwd, path22) : path22;
90160
90170
  let stats2;
90161
90171
  try {
90162
90172
  stats2 = await stat3(fullPath);
@@ -90187,23 +90197,23 @@ var FSWatcher = class extends EventEmitter2 {
90187
90197
  * @param timeout duration of time to suppress duplicate actions
90188
90198
  * @returns tracking object or false if action should be suppressed
90189
90199
  */
90190
- _throttle(actionType, path21, timeout) {
90200
+ _throttle(actionType, path22, timeout) {
90191
90201
  if (!this._throttled.has(actionType)) {
90192
90202
  this._throttled.set(actionType, /* @__PURE__ */ new Map());
90193
90203
  }
90194
90204
  const action = this._throttled.get(actionType);
90195
90205
  if (!action)
90196
90206
  throw new Error("invalid throttle");
90197
- const actionPath = action.get(path21);
90207
+ const actionPath = action.get(path22);
90198
90208
  if (actionPath) {
90199
90209
  actionPath.count++;
90200
90210
  return false;
90201
90211
  }
90202
90212
  let timeoutObject;
90203
90213
  const clear = () => {
90204
- const item = action.get(path21);
90214
+ const item = action.get(path22);
90205
90215
  const count2 = item ? item.count : 0;
90206
- action.delete(path21);
90216
+ action.delete(path22);
90207
90217
  clearTimeout(timeoutObject);
90208
90218
  if (item)
90209
90219
  clearTimeout(item.timeoutObject);
@@ -90211,7 +90221,7 @@ var FSWatcher = class extends EventEmitter2 {
90211
90221
  };
90212
90222
  timeoutObject = setTimeout(clear, timeout);
90213
90223
  const thr = { timeoutObject, clear, count: 0 };
90214
- action.set(path21, thr);
90224
+ action.set(path22, thr);
90215
90225
  return thr;
90216
90226
  }
90217
90227
  _incrReadyCount() {
@@ -90225,44 +90235,44 @@ var FSWatcher = class extends EventEmitter2 {
90225
90235
  * @param event
90226
90236
  * @param awfEmit Callback to be called when ready for event to be emitted.
90227
90237
  */
90228
- _awaitWriteFinish(path21, threshold, event, awfEmit) {
90238
+ _awaitWriteFinish(path22, threshold, event, awfEmit) {
90229
90239
  const awf = this.options.awaitWriteFinish;
90230
90240
  if (typeof awf !== "object")
90231
90241
  return;
90232
90242
  const pollInterval = awf.pollInterval;
90233
90243
  let timeoutHandler;
90234
- let fullPath = path21;
90235
- if (this.options.cwd && !sp2.isAbsolute(path21)) {
90236
- fullPath = sp2.join(this.options.cwd, path21);
90244
+ let fullPath = path22;
90245
+ if (this.options.cwd && !sp2.isAbsolute(path22)) {
90246
+ fullPath = sp2.join(this.options.cwd, path22);
90237
90247
  }
90238
90248
  const now = /* @__PURE__ */ new Date();
90239
90249
  const writes = this._pendingWrites;
90240
90250
  function awaitWriteFinishFn(prevStat) {
90241
90251
  statcb(fullPath, (err, curStat) => {
90242
- if (err || !writes.has(path21)) {
90252
+ if (err || !writes.has(path22)) {
90243
90253
  if (err && err.code !== "ENOENT")
90244
90254
  awfEmit(err);
90245
90255
  return;
90246
90256
  }
90247
90257
  const now2 = Number(/* @__PURE__ */ new Date());
90248
90258
  if (prevStat && curStat.size !== prevStat.size) {
90249
- writes.get(path21).lastChange = now2;
90259
+ writes.get(path22).lastChange = now2;
90250
90260
  }
90251
- const pw = writes.get(path21);
90261
+ const pw = writes.get(path22);
90252
90262
  const df = now2 - pw.lastChange;
90253
90263
  if (df >= threshold) {
90254
- writes.delete(path21);
90264
+ writes.delete(path22);
90255
90265
  awfEmit(void 0, curStat);
90256
90266
  } else {
90257
90267
  timeoutHandler = setTimeout(awaitWriteFinishFn, pollInterval, curStat);
90258
90268
  }
90259
90269
  });
90260
90270
  }
90261
- if (!writes.has(path21)) {
90262
- writes.set(path21, {
90271
+ if (!writes.has(path22)) {
90272
+ writes.set(path22, {
90263
90273
  lastChange: now,
90264
90274
  cancelWait: () => {
90265
- writes.delete(path21);
90275
+ writes.delete(path22);
90266
90276
  clearTimeout(timeoutHandler);
90267
90277
  return event;
90268
90278
  }
@@ -90273,8 +90283,8 @@ var FSWatcher = class extends EventEmitter2 {
90273
90283
  /**
90274
90284
  * Determines whether user has asked to ignore this path.
90275
90285
  */
90276
- _isIgnored(path21, stats) {
90277
- if (this.options.atomic && DOT_RE.test(path21))
90286
+ _isIgnored(path22, stats) {
90287
+ if (this.options.atomic && DOT_RE.test(path22))
90278
90288
  return true;
90279
90289
  if (!this._userIgnored) {
90280
90290
  const { cwd } = this.options;
@@ -90284,17 +90294,17 @@ var FSWatcher = class extends EventEmitter2 {
90284
90294
  const list3 = [...ignoredPaths.map(normalizeIgnored(cwd)), ...ignored];
90285
90295
  this._userIgnored = anymatch(list3, void 0);
90286
90296
  }
90287
- return this._userIgnored(path21, stats);
90297
+ return this._userIgnored(path22, stats);
90288
90298
  }
90289
- _isntIgnored(path21, stat4) {
90290
- return !this._isIgnored(path21, stat4);
90299
+ _isntIgnored(path22, stat4) {
90300
+ return !this._isIgnored(path22, stat4);
90291
90301
  }
90292
90302
  /**
90293
90303
  * Provides a set of common helpers and properties relating to symlink handling.
90294
90304
  * @param path file or directory pattern being watched
90295
90305
  */
90296
- _getWatchHelpers(path21) {
90297
- return new WatchHelper(path21, this.options.followSymlinks, this);
90306
+ _getWatchHelpers(path22) {
90307
+ return new WatchHelper(path22, this.options.followSymlinks, this);
90298
90308
  }
90299
90309
  // Directory helpers
90300
90310
  // -----------------
@@ -90326,63 +90336,63 @@ var FSWatcher = class extends EventEmitter2 {
90326
90336
  * @param item base path of item/directory
90327
90337
  */
90328
90338
  _remove(directory, item, isDirectory) {
90329
- const path21 = sp2.join(directory, item);
90330
- const fullPath = sp2.resolve(path21);
90331
- isDirectory = isDirectory != null ? isDirectory : this._watched.has(path21) || this._watched.has(fullPath);
90332
- if (!this._throttle("remove", path21, 100))
90339
+ const path22 = sp2.join(directory, item);
90340
+ const fullPath = sp2.resolve(path22);
90341
+ isDirectory = isDirectory != null ? isDirectory : this._watched.has(path22) || this._watched.has(fullPath);
90342
+ if (!this._throttle("remove", path22, 100))
90333
90343
  return;
90334
90344
  if (!isDirectory && this._watched.size === 1) {
90335
90345
  this.add(directory, item, true);
90336
90346
  }
90337
- const wp = this._getWatchedDir(path21);
90347
+ const wp = this._getWatchedDir(path22);
90338
90348
  const nestedDirectoryChildren = wp.getChildren();
90339
- nestedDirectoryChildren.forEach((nested) => this._remove(path21, nested));
90349
+ nestedDirectoryChildren.forEach((nested) => this._remove(path22, nested));
90340
90350
  const parent = this._getWatchedDir(directory);
90341
90351
  const wasTracked = parent.has(item);
90342
90352
  parent.remove(item);
90343
90353
  if (this._symlinkPaths.has(fullPath)) {
90344
90354
  this._symlinkPaths.delete(fullPath);
90345
90355
  }
90346
- let relPath = path21;
90356
+ let relPath = path22;
90347
90357
  if (this.options.cwd)
90348
- relPath = sp2.relative(this.options.cwd, path21);
90358
+ relPath = sp2.relative(this.options.cwd, path22);
90349
90359
  if (this.options.awaitWriteFinish && this._pendingWrites.has(relPath)) {
90350
90360
  const event = this._pendingWrites.get(relPath).cancelWait();
90351
90361
  if (event === EVENTS.ADD)
90352
90362
  return;
90353
90363
  }
90354
- this._watched.delete(path21);
90364
+ this._watched.delete(path22);
90355
90365
  this._watched.delete(fullPath);
90356
90366
  const eventName = isDirectory ? EVENTS.UNLINK_DIR : EVENTS.UNLINK;
90357
- if (wasTracked && !this._isIgnored(path21))
90358
- this._emit(eventName, path21);
90359
- this._closePath(path21);
90367
+ if (wasTracked && !this._isIgnored(path22))
90368
+ this._emit(eventName, path22);
90369
+ this._closePath(path22);
90360
90370
  }
90361
90371
  /**
90362
90372
  * Closes all watchers for a path
90363
90373
  */
90364
- _closePath(path21) {
90365
- this._closeFile(path21);
90366
- const dir = sp2.dirname(path21);
90367
- this._getWatchedDir(dir).remove(sp2.basename(path21));
90374
+ _closePath(path22) {
90375
+ this._closeFile(path22);
90376
+ const dir = sp2.dirname(path22);
90377
+ this._getWatchedDir(dir).remove(sp2.basename(path22));
90368
90378
  }
90369
90379
  /**
90370
90380
  * Closes only file-specific watchers
90371
90381
  */
90372
- _closeFile(path21) {
90373
- const closers = this._closers.get(path21);
90382
+ _closeFile(path22) {
90383
+ const closers = this._closers.get(path22);
90374
90384
  if (!closers)
90375
90385
  return;
90376
90386
  closers.forEach((closer) => closer());
90377
- this._closers.delete(path21);
90387
+ this._closers.delete(path22);
90378
90388
  }
90379
- _addPathCloser(path21, closer) {
90389
+ _addPathCloser(path22, closer) {
90380
90390
  if (!closer)
90381
90391
  return;
90382
- let list3 = this._closers.get(path21);
90392
+ let list3 = this._closers.get(path22);
90383
90393
  if (!list3) {
90384
90394
  list3 = [];
90385
- this._closers.set(path21, list3);
90395
+ this._closers.set(path22, list3);
90386
90396
  }
90387
90397
  list3.push(closer);
90388
90398
  }
@@ -90787,8 +90797,8 @@ import { fileURLToPath as fileURLToPath4 } from "node:url";
90787
90797
  import { dirname as dirname3, join as join3 } from "node:path";
90788
90798
 
90789
90799
  // src/commands/dev.ts
90790
- import path13 from "node:path";
90791
- import fs8 from "node:fs";
90800
+ import path14 from "node:path";
90801
+ import fs9 from "node:fs";
90792
90802
 
90793
90803
  // src/actions/registry.ts
90794
90804
  function buildActionRegistry(configActions, profileActions = []) {
@@ -90798,23 +90808,78 @@ function buildActionRegistry(configActions, profileActions = []) {
90798
90808
  return Array.from(byId.values());
90799
90809
  }
90800
90810
 
90811
+ // src/core/config-discovery.ts
90812
+ import fs8 from "node:fs";
90813
+ import path13 from "node:path";
90814
+ var DiscoveryError = class extends Error {
90815
+ constructor(workspaceRoot) {
90816
+ super(
90817
+ `dev-cockpit: no cockpit.yaml found at ${workspaceRoot}/cockpit.yaml and no entry in ${manifestPath()}. Run \`dev-cockpit link <config-path>\` from this directory to register one, or pass --config <path>.`
90818
+ );
90819
+ this.workspaceRoot = workspaceRoot;
90820
+ this.name = "DiscoveryError";
90821
+ }
90822
+ };
90823
+ function discoverConfig(opts = {}) {
90824
+ const cwd = opts.cwd ?? process.cwd();
90825
+ const envConfig = opts.envConfig ?? process.env["DEV_COCKPIT_CONFIG"];
90826
+ const profileRoot = opts.workspaceDiscoverer?.()?.root;
90827
+ const workspaceRoot = profileRoot ? canonical(profileRoot) : canonical(cwd);
90828
+ if (opts.cliConfig) {
90829
+ return {
90830
+ configPath: path13.resolve(cwd, opts.cliConfig),
90831
+ workspaceRoot,
90832
+ source: "cli"
90833
+ };
90834
+ }
90835
+ if (envConfig) {
90836
+ return {
90837
+ configPath: path13.resolve(cwd, envConfig),
90838
+ workspaceRoot,
90839
+ source: "env"
90840
+ };
90841
+ }
90842
+ const localConfig = path13.join(workspaceRoot, "cockpit.yaml");
90843
+ if (fs8.existsSync(localConfig)) {
90844
+ return { configPath: localConfig, workspaceRoot, source: "workspace" };
90845
+ }
90846
+ const mapped = lookupConfig(workspaceRoot);
90847
+ if (mapped) {
90848
+ return { configPath: mapped, workspaceRoot, source: "manifest" };
90849
+ }
90850
+ throw new DiscoveryError(workspaceRoot);
90851
+ }
90852
+
90801
90853
  // src/commands/dev.ts
90802
90854
  async function devCommand(opts = {}) {
90803
- const configPath = path13.resolve(opts.config ?? "cockpit.yaml");
90804
- if (!fs8.existsSync(configPath)) {
90855
+ const profile = opts.profile;
90856
+ let configPath;
90857
+ let workspaceRoot;
90858
+ try {
90859
+ const result = discoverConfig({
90860
+ cliConfig: opts.config,
90861
+ workspaceDiscoverer: profile?.discoverer
90862
+ });
90863
+ configPath = result.configPath;
90864
+ workspaceRoot = result.workspaceRoot;
90865
+ } catch (err) {
90866
+ if (err instanceof DiscoveryError) {
90867
+ process.stderr.write(`${err.message}
90868
+ `);
90869
+ process.exit(1);
90870
+ }
90871
+ throw err;
90872
+ }
90873
+ if (!fs9.existsSync(configPath)) {
90805
90874
  process.stderr.write(
90806
- `dev-cockpit: no cockpit.yaml found at ${configPath}.
90807
- Run \`dev-cockpit init-config\` to scaffold one.
90808
- `
90875
+ `dev-cockpit: cockpit.yaml at ${configPath} doesn't exist (resolved via --config DEV_COCKPIT_CONFIG / link).`
90809
90876
  );
90810
90877
  process.exit(1);
90811
90878
  }
90812
- const profile = opts.profile;
90813
90879
  const config = loadConfig(configPath, {
90814
90880
  configSchemaExt: profile?.configSchemaExt,
90815
90881
  profileKey: profile?.appName
90816
90882
  });
90817
- const workspaceRoot = profile?.discoverer?.()?.root ?? path13.dirname(configPath);
90818
90883
  const seededRepos = {};
90819
90884
  const seededOrder = [];
90820
90885
  for (const repo of config.repos) {
@@ -90886,7 +90951,7 @@ async function devCommand(opts = {}) {
90886
90951
  });
90887
90952
  };
90888
90953
  spawnStream(shell, [shellFlag, proc.command], {
90889
- cwd: proc.cwd ? path13.resolve(workspaceRoot, proc.cwd) : workspaceRoot,
90954
+ cwd: proc.cwd ? path14.resolve(workspaceRoot, proc.cwd) : workspaceRoot,
90890
90955
  env: proc.env,
90891
90956
  tag: proc.id,
90892
90957
  onStdout: (line2) => emit(line2, "info"),
@@ -90958,7 +91023,7 @@ async function devCommand(opts = {}) {
90958
91023
  });
90959
91024
  return;
90960
91025
  }
90961
- const cwd = action.cwd ? path13.resolve(workspaceRoot, action.cwd) : workspaceRoot;
91026
+ const cwd = action.cwd ? path14.resolve(workspaceRoot, action.cwd) : workspaceRoot;
90962
91027
  store.appendOutput({
90963
91028
  ts: Date.now(),
90964
91029
  source: action.id,
@@ -91024,8 +91089,7 @@ async function devCommand(opts = {}) {
91024
91089
  }
91025
91090
 
91026
91091
  // src/commands/doctor.ts
91027
- import path14 from "node:path";
91028
- import fs9 from "node:fs";
91092
+ import fs10 from "node:fs";
91029
91093
  var GLYPH = {
91030
91094
  ok: "\u2713",
91031
91095
  warn: "\u26A0",
@@ -91053,18 +91117,34 @@ function formatResults(results, appName) {
91053
91117
  return { lines, exitCode: anyError ? 1 : 0 };
91054
91118
  }
91055
91119
  async function doctorCommand(opts = {}) {
91056
- const configPath = path14.resolve(opts.config ?? "cockpit.yaml");
91057
- if (!fs9.existsSync(configPath)) {
91058
- process.stderr.write(`dev-cockpit doctor: no cockpit.yaml found at ${configPath}.
91120
+ const profile = opts.profile;
91121
+ let configPath;
91122
+ let workspaceRoot;
91123
+ try {
91124
+ const result = discoverConfig({
91125
+ cliConfig: opts.config,
91126
+ workspaceDiscoverer: profile?.discoverer
91127
+ });
91128
+ configPath = result.configPath;
91129
+ workspaceRoot = result.workspaceRoot;
91130
+ } catch (err) {
91131
+ if (err instanceof DiscoveryError) {
91132
+ process.stderr.write(`${err.message}
91059
91133
  `);
91134
+ process.exit(1);
91135
+ }
91136
+ throw err;
91137
+ }
91138
+ if (!fs10.existsSync(configPath)) {
91139
+ process.stderr.write(
91140
+ `dev-cockpit: cockpit.yaml at ${configPath} doesn't exist (resolved via --config DEV_COCKPIT_CONFIG / link).`
91141
+ );
91060
91142
  process.exit(1);
91061
91143
  }
91062
- const profile = opts.profile;
91063
91144
  const config = loadConfig(configPath, {
91064
91145
  configSchemaExt: profile?.configSchemaExt,
91065
91146
  profileKey: profile?.appName
91066
91147
  });
91067
- const workspaceRoot = profile?.discoverer?.()?.root ?? path14.dirname(configPath);
91068
91148
  const ctx = buildHealthContext(workspaceRoot);
91069
91149
  const registry = buildHealthRegistry({
91070
91150
  profileChecks: profile?.healthChecks,
@@ -91080,11 +91160,11 @@ async function doctorCommand(opts = {}) {
91080
91160
  }
91081
91161
 
91082
91162
  // src/commands/init-config.ts
91083
- import fs11 from "node:fs";
91163
+ import fs12 from "node:fs";
91084
91164
  import path16 from "node:path";
91085
91165
 
91086
91166
  // src/commands/init-config-wizard.ts
91087
- import fs10 from "node:fs";
91167
+ import fs11 from "node:fs";
91088
91168
  import path15 from "node:path";
91089
91169
  function indent(line2, level) {
91090
91170
  return " ".repeat(level) + line2;
@@ -91266,20 +91346,20 @@ function showSummary(result) {
91266
91346
  }
91267
91347
  function safeReadJson(p) {
91268
91348
  try {
91269
- return JSON.parse(fs10.readFileSync(p, "utf8"));
91349
+ return JSON.parse(fs11.readFileSync(p, "utf8"));
91270
91350
  } catch {
91271
91351
  return null;
91272
91352
  }
91273
91353
  }
91274
91354
  function detectComposeFile(cwd) {
91275
91355
  for (const candidate of ["compose.yaml", "compose.yml", "docker-compose.yml", "docker-compose.yaml"]) {
91276
- if (fs10.existsSync(path15.join(cwd, candidate))) return candidate;
91356
+ if (fs11.existsSync(path15.join(cwd, candidate))) return candidate;
91277
91357
  }
91278
91358
  return void 0;
91279
91359
  }
91280
91360
  function parseComposeServices(cwd, composeFile) {
91281
91361
  try {
91282
- const text = fs10.readFileSync(path15.join(cwd, composeFile), "utf8");
91362
+ const text = fs11.readFileSync(path15.join(cwd, composeFile), "utf8");
91283
91363
  const out = [];
91284
91364
  let inServices = false;
91285
91365
  for (const raw of text.split("\n")) {
@@ -91314,9 +91394,9 @@ function detectRepoSuggestions(cwd, pkg) {
91314
91394
  }
91315
91395
  }
91316
91396
  const pnpmFile = path15.join(cwd, "pnpm-workspace.yaml");
91317
- if (fs10.existsSync(pnpmFile)) {
91397
+ if (fs11.existsSync(pnpmFile)) {
91318
91398
  try {
91319
- const text = fs10.readFileSync(pnpmFile, "utf8");
91399
+ const text = fs11.readFileSync(pnpmFile, "utf8");
91320
91400
  const inPackages = /packages:\s*([\s\S]*?)(?:\n[a-zA-Z]|$)/.exec(text);
91321
91401
  if (inPackages?.[1]) {
91322
91402
  for (const line2 of inPackages[1].split("\n")) {
@@ -91341,15 +91421,15 @@ function detectRepoSuggestions(cwd, pkg) {
91341
91421
  }
91342
91422
  function expandSimpleGlob(cwd, glob) {
91343
91423
  if (!glob.includes("*")) {
91344
- return fs10.existsSync(path15.join(cwd, glob)) ? [glob] : [];
91424
+ return fs11.existsSync(path15.join(cwd, glob)) ? [glob] : [];
91345
91425
  }
91346
91426
  const m = /^([^*]+?)\/?\*$/.exec(glob);
91347
91427
  if (!m?.[1]) return [];
91348
91428
  const baseRel = m[1];
91349
91429
  const baseAbs = path15.join(cwd, baseRel);
91350
- if (!fs10.existsSync(baseAbs)) return [];
91430
+ if (!fs11.existsSync(baseAbs)) return [];
91351
91431
  try {
91352
- return fs10.readdirSync(baseAbs, { withFileTypes: true }).filter((d) => d.isDirectory() && !d.name.startsWith(".")).map((d) => path15.posix.join(baseRel, d.name));
91432
+ return fs11.readdirSync(baseAbs, { withFileTypes: true }).filter((d) => d.isDirectory() && !d.name.startsWith(".")).map((d) => path15.posix.join(baseRel, d.name));
91353
91433
  } catch {
91354
91434
  return [];
91355
91435
  }
@@ -91365,8 +91445,8 @@ function gatherHints(cwd) {
91365
91445
  packageJsonScripts: pkgScripts,
91366
91446
  composeFile,
91367
91447
  composeServices,
91368
- hasArtisan: fs10.existsSync(path15.join(cwd, "artisan")),
91369
- hasComposerJson: fs10.existsSync(path15.join(cwd, "composer.json")),
91448
+ hasArtisan: fs11.existsSync(path15.join(cwd, "artisan")),
91449
+ hasComposerJson: fs11.existsSync(path15.join(cwd, "composer.json")),
91370
91450
  repoSuggestions: detectRepoSuggestions(cwd, pkg)
91371
91451
  };
91372
91452
  }
@@ -92092,8 +92172,8 @@ ${dockerBlock}
92092
92172
  }
92093
92173
  async function initConfigCommand(opts = {}) {
92094
92174
  const cwd = opts.cwd ?? process.cwd();
92095
- const target = path16.join(cwd, "cockpit.yaml");
92096
- const exists = fs11.existsSync(target);
92175
+ const target = opts.output ? path16.resolve(cwd, opts.output) : path16.join(cwd, "cockpit.yaml");
92176
+ const exists = fs12.existsSync(target);
92097
92177
  if (exists && !opts.force) {
92098
92178
  process.stdout.write(
92099
92179
  `dev-cockpit init-config: ${target} already exists.
@@ -92112,7 +92192,7 @@ async function initConfigCommand(opts = {}) {
92112
92192
  withDocker: opts.withDocker ?? false,
92113
92193
  appName: opts.appName ?? "my-cockpit"
92114
92194
  });
92115
- fs11.writeFileSync(target, content, "utf8");
92195
+ fs12.writeFileSync(target, content, "utf8");
92116
92196
  process.stdout.write(`
92117
92197
  dev-cockpit init-config: wrote ${target}
92118
92198
  `);
@@ -92146,11 +92226,11 @@ doctor failed: ${err instanceof Error ? err.message : String(err)}
92146
92226
  }
92147
92227
 
92148
92228
  // src/commands/mount.ts
92149
- import path19 from "node:path";
92150
- import fs14 from "node:fs";
92229
+ import path20 from "node:path";
92230
+ import fs15 from "node:fs";
92151
92231
 
92152
92232
  // src/mount/manifest.ts
92153
- import fs12 from "node:fs";
92233
+ import fs13 from "node:fs";
92154
92234
  import path17 from "node:path";
92155
92235
  var CURRENT_MANIFEST_VERSION = 1;
92156
92236
  var MountManifestError = class extends Error {
@@ -92159,24 +92239,24 @@ var MountManifestError = class extends Error {
92159
92239
  this.name = "MountManifestError";
92160
92240
  }
92161
92241
  };
92162
- function readMountManifest(manifestPath) {
92163
- if (!fs12.existsSync(manifestPath)) return null;
92242
+ function readMountManifest(manifestPath2) {
92243
+ if (!fs13.existsSync(manifestPath2)) return null;
92164
92244
  let raw;
92165
92245
  try {
92166
- raw = JSON.parse(fs12.readFileSync(manifestPath, "utf8"));
92246
+ raw = JSON.parse(fs13.readFileSync(manifestPath2, "utf8"));
92167
92247
  } catch (err) {
92168
- throw new MountManifestError(manifestPath, `JSON parse error: ${String(err)}`);
92248
+ throw new MountManifestError(manifestPath2, `JSON parse error: ${String(err)}`);
92169
92249
  }
92170
- validateMountManifest(manifestPath, raw);
92250
+ validateMountManifest(manifestPath2, raw);
92171
92251
  return raw;
92172
92252
  }
92173
- function writeMountManifest(manifestPath, manifest) {
92174
- fs12.mkdirSync(path17.dirname(manifestPath), { recursive: true });
92175
- fs12.writeFileSync(manifestPath, JSON.stringify(manifest, null, 2), "utf8");
92253
+ function writeMountManifest(manifestPath2, manifest) {
92254
+ fs13.mkdirSync(path17.dirname(manifestPath2), { recursive: true });
92255
+ fs13.writeFileSync(manifestPath2, JSON.stringify(manifest, null, 2), "utf8");
92176
92256
  }
92177
- function deleteMountManifest(manifestPath) {
92178
- if (!fs12.existsSync(manifestPath)) return false;
92179
- fs12.rmSync(manifestPath);
92257
+ function deleteMountManifest(manifestPath2) {
92258
+ if (!fs13.existsSync(manifestPath2)) return false;
92259
+ fs13.rmSync(manifestPath2);
92180
92260
  return true;
92181
92261
  }
92182
92262
  function validateMountManifest(filePath, raw) {
@@ -92232,33 +92312,43 @@ function renderDockerOverlay(mounts, opts) {
92232
92312
  `;
92233
92313
  }
92234
92314
 
92235
- // src/mount/symlinks.ts
92236
- import fs13 from "node:fs";
92315
+ // src/mount/overlay-path.ts
92237
92316
  import path18 from "node:path";
92317
+ function resolveOverlayPath(opts) {
92318
+ if (!opts.configOverride) {
92319
+ return path18.join(opts.stateDir, "dev-mount-overlay.yml");
92320
+ }
92321
+ if (path18.isAbsolute(opts.configOverride)) return opts.configOverride;
92322
+ return path18.resolve(opts.workspaceRoot, opts.configOverride);
92323
+ }
92324
+
92325
+ // src/mount/symlinks.ts
92326
+ import fs14 from "node:fs";
92327
+ import path19 from "node:path";
92238
92328
  function applyManagedSymlinks(workspaceRoot, mounts, strategy) {
92239
92329
  const report = { created: [], skipped: [] };
92240
92330
  for (const m of mounts) {
92241
92331
  const linkPath = strategy.linkPath(m, workspaceRoot);
92242
92332
  if (!linkPath) continue;
92243
92333
  try {
92244
- const lstat3 = fs13.lstatSync(linkPath);
92334
+ const lstat3 = fs14.lstatSync(linkPath);
92245
92335
  if (lstat3.isSymbolicLink()) {
92246
- const existing = fs13.readlinkSync(linkPath);
92336
+ const existing = fs14.readlinkSync(linkPath);
92247
92337
  if (existing === m.hostPath) {
92248
92338
  report.created.push(linkPath);
92249
92339
  continue;
92250
92340
  }
92251
- fs13.unlinkSync(linkPath);
92341
+ fs14.unlinkSync(linkPath);
92252
92342
  } else if (lstat3.isDirectory()) {
92253
92343
  report.skipped.push(linkPath);
92254
92344
  continue;
92255
92345
  } else {
92256
- fs13.unlinkSync(linkPath);
92346
+ fs14.unlinkSync(linkPath);
92257
92347
  }
92258
92348
  } catch {
92259
92349
  }
92260
- fs13.mkdirSync(path18.dirname(linkPath), { recursive: true });
92261
- fs13.symlinkSync(m.hostPath, linkPath);
92350
+ fs14.mkdirSync(path19.dirname(linkPath), { recursive: true });
92351
+ fs14.symlinkSync(m.hostPath, linkPath);
92262
92352
  report.created.push(linkPath);
92263
92353
  }
92264
92354
  return report;
@@ -92268,8 +92358,8 @@ function removeManagedSymlinks(workspaceRoot, mounts, strategy) {
92268
92358
  const linkPath = strategy.linkPath(m, workspaceRoot);
92269
92359
  if (!linkPath) continue;
92270
92360
  try {
92271
- const lstat3 = fs13.lstatSync(linkPath);
92272
- if (lstat3.isSymbolicLink()) fs13.unlinkSync(linkPath);
92361
+ const lstat3 = fs14.lstatSync(linkPath);
92362
+ if (lstat3.isSymbolicLink()) fs14.unlinkSync(linkPath);
92273
92363
  } catch {
92274
92364
  }
92275
92365
  }
@@ -92281,7 +92371,7 @@ function detectBrokenSymlinks(workspaceRoot, mounts, strategy) {
92281
92371
  if (!linkPath) continue;
92282
92372
  let lstat3 = null;
92283
92373
  try {
92284
- lstat3 = fs13.lstatSync(linkPath);
92374
+ lstat3 = fs14.lstatSync(linkPath);
92285
92375
  } catch {
92286
92376
  broken.push({ linkPath, intendedTarget: m.hostPath, reason: "missing", mount: m });
92287
92377
  continue;
@@ -92291,7 +92381,7 @@ function detectBrokenSymlinks(workspaceRoot, mounts, strategy) {
92291
92381
  continue;
92292
92382
  }
92293
92383
  try {
92294
- fs13.statSync(linkPath);
92384
+ fs14.statSync(linkPath);
92295
92385
  } catch {
92296
92386
  broken.push({ linkPath, intendedTarget: m.hostPath, reason: "broken", mount: m });
92297
92387
  }
@@ -92339,17 +92429,34 @@ function mergeMounts(configMounts, providerMounts) {
92339
92429
  }
92340
92430
  async function resolveContext(opts) {
92341
92431
  const profile = opts.profile;
92342
- const configPath = path19.resolve(opts.config ?? "cockpit.yaml");
92343
- if (!fs14.existsSync(configPath)) {
92344
- process.stderr.write(`dev-cockpit mount: no cockpit.yaml found at ${configPath}.
92432
+ let configPath;
92433
+ let workspaceRoot;
92434
+ try {
92435
+ const result = discoverConfig({
92436
+ cliConfig: opts.config,
92437
+ workspaceDiscoverer: profile?.discoverer
92438
+ });
92439
+ configPath = result.configPath;
92440
+ workspaceRoot = result.workspaceRoot;
92441
+ } catch (err) {
92442
+ if (err instanceof DiscoveryError) {
92443
+ process.stderr.write(`${err.message}
92345
92444
  `);
92445
+ process.exit(1);
92446
+ }
92447
+ throw err;
92448
+ }
92449
+ if (!fs15.existsSync(configPath)) {
92450
+ process.stderr.write(
92451
+ `dev-cockpit mount: cockpit.yaml at ${configPath} doesn't exist.
92452
+ `
92453
+ );
92346
92454
  process.exit(1);
92347
92455
  }
92348
92456
  const config = loadConfig(configPath, {
92349
92457
  configSchemaExt: profile?.configSchemaExt,
92350
92458
  profileKey: profile?.appName
92351
92459
  });
92352
- const workspaceRoot = profile?.discoverer?.()?.root ?? path19.dirname(configPath);
92353
92460
  const explicitService = opts.service ?? config.docker?.services?.[0]?.name;
92354
92461
  if (!explicitService) {
92355
92462
  process.stderr.write(
@@ -92358,9 +92465,13 @@ async function resolveContext(opts) {
92358
92465
  process.exit(1);
92359
92466
  }
92360
92467
  const providerMounts = await profile?.mountCandidatesProvider?.() ?? [];
92361
- const overlayPath = path19.resolve(workspaceRoot, config.mount.overlayPath);
92362
92468
  const paths = getStatePaths(workspaceRoot, { appName: config.appName });
92363
- const manifestPath = path19.join(paths.stateDir, config.mount.manifestFile);
92469
+ const overlayPath = resolveOverlayPath({
92470
+ stateDir: paths.stateDir,
92471
+ workspaceRoot,
92472
+ configOverride: config.mount.overlayPath
92473
+ });
92474
+ const manifestPath2 = path20.join(paths.stateDir, config.mount.manifestFile);
92364
92475
  return {
92365
92476
  configPath,
92366
92477
  workspaceRoot,
@@ -92369,7 +92480,7 @@ async function resolveContext(opts) {
92369
92480
  configMounts: config.mounts,
92370
92481
  providerMounts,
92371
92482
  overlayPath,
92372
- manifestPath,
92483
+ manifestPath: manifestPath2,
92373
92484
  profile
92374
92485
  };
92375
92486
  }
@@ -92400,7 +92511,7 @@ async function pickMounts(candidates) {
92400
92511
  }
92401
92512
  async function mountCommand(opts = {}) {
92402
92513
  const ctx = await resolveContext(opts);
92403
- const { workspaceRoot, appName, service, configMounts, providerMounts, overlayPath, manifestPath, profile } = ctx;
92514
+ const { workspaceRoot, appName, service, configMounts, providerMounts, overlayPath, manifestPath: manifestPath2, profile } = ctx;
92404
92515
  const merged = applyExclude(mergeMounts(configMounts, providerMounts), opts.exclude ?? []);
92405
92516
  if (merged.length === 0) {
92406
92517
  process.stdout.write(
@@ -92422,11 +92533,11 @@ async function mountCommand(opts = {}) {
92422
92533
  return;
92423
92534
  }
92424
92535
  }
92425
- fs14.mkdirSync(path19.dirname(overlayPath), { recursive: true });
92426
- fs14.writeFileSync(overlayPath, renderDockerOverlay(selected, { service }), "utf8");
92536
+ fs15.mkdirSync(path20.dirname(overlayPath), { recursive: true });
92537
+ fs15.writeFileSync(overlayPath, renderDockerOverlay(selected, { service }), "utf8");
92427
92538
  process.stdout.write(`dev-cockpit mount: wrote ${overlayPath}
92428
92539
  `);
92429
- writeMountManifest(manifestPath, {
92540
+ writeMountManifest(manifestPath2, {
92430
92541
  version: 1,
92431
92542
  appName,
92432
92543
  workspaceRoot,
@@ -92435,7 +92546,7 @@ async function mountCommand(opts = {}) {
92435
92546
  mounts: selected,
92436
92547
  appliedAt: (/* @__PURE__ */ new Date()).toISOString()
92437
92548
  });
92438
- process.stdout.write(`dev-cockpit mount: wrote ${manifestPath}
92549
+ process.stdout.write(`dev-cockpit mount: wrote ${manifestPath2}
92439
92550
  `);
92440
92551
  if (profile?.mountSymlinks) {
92441
92552
  const report = applyManagedSymlinks(workspaceRoot, selected, profile.mountSymlinks);
@@ -92454,15 +92565,15 @@ async function mountCommand(opts = {}) {
92454
92565
  await profile.onMountApply(hookCtx);
92455
92566
  } else {
92456
92567
  process.stdout.write(
92457
- ` Apply with: docker compose -f <your-compose>.yml -f ${path19.basename(overlayPath)} up -d
92568
+ ` Apply with: docker compose -f <your-compose>.yml -f ${path20.basename(overlayPath)} up -d
92458
92569
  `
92459
92570
  );
92460
92571
  }
92461
92572
  }
92462
92573
  async function mountStatusCommand(opts = {}) {
92463
92574
  const ctx = await resolveContext(opts);
92464
- const { workspaceRoot, manifestPath, profile } = ctx;
92465
- const manifest = readMountManifest(manifestPath);
92575
+ const { workspaceRoot, manifestPath: manifestPath2, profile } = ctx;
92576
+ const manifest = readMountManifest(manifestPath2);
92466
92577
  if (!manifest || manifest.mounts.length === 0) {
92467
92578
  process.stdout.write("dev-cockpit mount: no active mounts.\n");
92468
92579
  return;
@@ -92526,8 +92637,8 @@ dev-cockpit mount status \u2014 service: ${manifest.service}
92526
92637
  }
92527
92638
  async function mountClearCommand(opts = {}) {
92528
92639
  const ctx = await resolveContext(opts);
92529
- const { workspaceRoot, overlayPath, manifestPath, profile } = ctx;
92530
- const manifest = readMountManifest(manifestPath);
92640
+ const { workspaceRoot, overlayPath, manifestPath: manifestPath2, profile } = ctx;
92641
+ const manifest = readMountManifest(manifestPath2);
92531
92642
  const previous = manifest?.mounts ?? [];
92532
92643
  if (profile?.mountSymlinks && previous.length > 0) {
92533
92644
  removeManagedSymlinks(workspaceRoot, previous, profile.mountSymlinks);
@@ -92535,14 +92646,14 @@ async function mountClearCommand(opts = {}) {
92535
92646
  `);
92536
92647
  }
92537
92648
  let removed = 0;
92538
- if (fs14.existsSync(overlayPath)) {
92539
- fs14.rmSync(overlayPath);
92649
+ if (fs15.existsSync(overlayPath)) {
92650
+ fs15.rmSync(overlayPath);
92540
92651
  process.stdout.write(`dev-cockpit mount: removed ${overlayPath}
92541
92652
  `);
92542
92653
  removed += 1;
92543
92654
  }
92544
- if (deleteMountManifest(manifestPath)) {
92545
- process.stdout.write(`dev-cockpit mount: removed ${manifestPath}
92655
+ if (deleteMountManifest(manifestPath2)) {
92656
+ process.stdout.write(`dev-cockpit mount: removed ${manifestPath2}
92546
92657
  `);
92547
92658
  removed += 1;
92548
92659
  }
@@ -92563,16 +92674,16 @@ async function mountClearCommand(opts = {}) {
92563
92674
 
92564
92675
  // src/commands/migrate-config.ts
92565
92676
  var import_yaml2 = __toESM(require_dist(), 1);
92566
- import fs15 from "node:fs";
92567
- import path20 from "node:path";
92677
+ import fs16 from "node:fs";
92678
+ import path21 from "node:path";
92568
92679
  async function migrateConfigCommand(opts = {}) {
92569
- const configPath = path20.resolve(opts.config ?? "cockpit.yaml");
92570
- if (!fs15.existsSync(configPath)) {
92680
+ const configPath = path21.resolve(opts.config ?? "cockpit.yaml");
92681
+ if (!fs16.existsSync(configPath)) {
92571
92682
  process.stderr.write(`dev-cockpit migrate-config: no file at ${configPath}.
92572
92683
  `);
92573
92684
  process.exit(1);
92574
92685
  }
92575
- const content = fs15.readFileSync(configPath, "utf8");
92686
+ const content = fs16.readFileSync(configPath, "utf8");
92576
92687
  const raw = (0, import_yaml2.parse)(content) ?? {};
92577
92688
  if (typeof raw["version"] !== "number") {
92578
92689
  process.stderr.write(
@@ -92612,7 +92723,7 @@ async function migrateConfigCommand(opts = {}) {
92612
92723
  process.stdout.write(out);
92613
92724
  return;
92614
92725
  }
92615
- fs15.writeFileSync(configPath, out, "utf8");
92726
+ fs16.writeFileSync(configPath, out, "utf8");
92616
92727
  process.stdout.write(
92617
92728
  `dev-cockpit migrate-config: rewrote ${configPath} (v${fromVersion} \u2192 v${CONFIG_VERSION}).
92618
92729
  `
@@ -92643,30 +92754,45 @@ function buildCli(opts = {}) {
92643
92754
  profile.setupCli(program2);
92644
92755
  }
92645
92756
  if (!hasCommand(program2, "dev")) {
92646
- program2.command("dev").description("Boot the three-pane TUI (Repos / Output / Health / Help)").option("-c, --config <path>", "Path to cockpit.yaml", "cockpit.yaml").action(async (cmdOpts) => {
92757
+ program2.command("dev").description("Boot the three-pane TUI (Repos / Output / Health / Help)").option("-c, --config <path>", "Path to cockpit.yaml (default: <cwd>/cockpit.yaml or registered via `link`)").action(async (cmdOpts) => {
92647
92758
  await devCommand({ config: cmdOpts.config, profile });
92648
92759
  });
92649
92760
  }
92650
92761
  if (!hasCommand(program2, "doctor")) {
92651
- program2.command("doctor").description("Run all health checks once and print a status table").option("-c, --config <path>", "Path to cockpit.yaml", "cockpit.yaml").action(async (cmdOpts) => {
92762
+ program2.command("doctor").description("Run all health checks once and print a status table").option("-c, --config <path>", "Path to cockpit.yaml (default: <cwd>/cockpit.yaml or registered via `link`)").action(async (cmdOpts) => {
92652
92763
  await doctorCommand({ config: cmdOpts.config, profile });
92653
92764
  });
92654
92765
  }
92655
92766
  if (!hasCommand(program2, "init-config")) {
92656
- program2.command("init-config").description("Write a starter cockpit.yaml in the current directory").option("-f, --force", "Overwrite an existing cockpit.yaml without prompting", false).option("--with-docker", "Include an uncommented docker block (static template only)", false).option("-i, --interactive", "Walk through prompts to populate the file (skips static template)", false).action(
92767
+ program2.command("init-config").description("Write a starter cockpit.yaml in the current directory").option("-f, --force", "Overwrite an existing cockpit.yaml without prompting", false).option("--with-docker", "Include an uncommented docker block (static template only)", false).option("-i, --interactive", "Walk through prompts to populate the file (skips static template)", false).option("-o, --output <path>", "Write the file to this path instead of <cwd>/cockpit.yaml").action(
92657
92768
  async (cmdOpts) => {
92658
92769
  await initConfigCommand({
92659
92770
  force: cmdOpts.force ?? false,
92660
92771
  withDocker: cmdOpts.withDocker ?? false,
92661
92772
  interactive: cmdOpts.interactive ?? false,
92662
92773
  appName,
92663
- profile
92774
+ profile,
92775
+ output: cmdOpts.output
92664
92776
  });
92665
92777
  }
92666
92778
  );
92667
92779
  }
92780
+ if (!hasCommand(program2, "link")) {
92781
+ const linkCmd = program2.command("link").description("Register the current directory as using a cockpit.yaml that lives elsewhere").argument("<config-path>", "Path to the cockpit.yaml to associate with this directory").action(async (configPath) => {
92782
+ const { linkAddCommand } = await import("./link-HXNII7EU.js");
92783
+ linkAddCommand({ configPath });
92784
+ });
92785
+ linkCmd.command("list").description("Print all registered project \u2192 config mappings").action(async () => {
92786
+ const { linkListCommand } = await import("./link-HXNII7EU.js");
92787
+ linkListCommand();
92788
+ });
92789
+ linkCmd.command("remove").description("Unregister the current directory from the manifest").action(async () => {
92790
+ const { linkRemoveCommand } = await import("./link-HXNII7EU.js");
92791
+ linkRemoveCommand();
92792
+ });
92793
+ }
92668
92794
  if (!hasCommand(program2, "mount")) {
92669
- const mountCmd = program2.command("mount").description("Apply a docker-compose bind-mount overlay (interactive picker by default)").option("-c, --config <path>", "Path to cockpit.yaml", "cockpit.yaml").option("-s, --service <name>", "Target compose service (default: first in docker.services)").option("-q, --quiet", "Skip the interactive picker; apply all candidates").option(
92795
+ const mountCmd = program2.command("mount").description("Apply a docker-compose bind-mount overlay (interactive picker by default)").option("-c, --config <path>", "Path to cockpit.yaml (default: <cwd>/cockpit.yaml or registered via `link`)").option("-s, --service <name>", "Target compose service (default: first in docker.services)").option("-q, --quiet", "Skip the interactive picker; apply all candidates").option(
92670
92796
  "-e, --exclude <name>",
92671
92797
  "Exclude a candidate by meta.name (repeatable)",
92672
92798
  (val, prev) => [...prev, val],
@@ -92680,15 +92806,15 @@ function buildCli(opts = {}) {
92680
92806
  profile
92681
92807
  });
92682
92808
  });
92683
- mountCmd.command("status").description("Show active mounts with branch, dirty, and broken-symlink status").option("-c, --config <path>", "Path to cockpit.yaml", "cockpit.yaml").action(async (cmdOpts) => {
92809
+ mountCmd.command("status").description("Show active mounts with branch, dirty, and broken-symlink status").option("-c, --config <path>", "Path to cockpit.yaml (default: <cwd>/cockpit.yaml or registered via `link`)").action(async (cmdOpts) => {
92684
92810
  await mountStatusCommand({ config: cmdOpts.config, profile });
92685
92811
  });
92686
- mountCmd.command("clear").description("Remove the overlay, manifest, and managed symlinks; runs profile.onMountClear").option("-c, --config <path>", "Path to cockpit.yaml", "cockpit.yaml").action(async (cmdOpts) => {
92812
+ mountCmd.command("clear").description("Remove the overlay, manifest, and managed symlinks; runs profile.onMountClear").option("-c, --config <path>", "Path to cockpit.yaml (default: <cwd>/cockpit.yaml or registered via `link`)").action(async (cmdOpts) => {
92687
92813
  await mountClearCommand({ config: cmdOpts.config, profile });
92688
92814
  });
92689
92815
  }
92690
92816
  if (!hasCommand(program2, "migrate-config")) {
92691
- program2.command("migrate-config").description("Rewrite cockpit.yaml at the current CONFIG_VERSION").option("-c, --config <path>", "Path to cockpit.yaml", "cockpit.yaml").option("--dry-run", "Print the migrated YAML to stdout instead of writing").action(async (cmdOpts) => {
92817
+ program2.command("migrate-config").description("Rewrite cockpit.yaml at the current CONFIG_VERSION").option("-c, --config <path>", "Path to cockpit.yaml (default: <cwd>/cockpit.yaml or registered via `link`)").option("--dry-run", "Print the migrated YAML to stdout instead of writing").action(async (cmdOpts) => {
92692
92818
  await migrateConfigCommand({ config: cmdOpts.config, dryRun: cmdOpts.dryRun });
92693
92819
  });
92694
92820
  }
@@ -92696,9 +92822,9 @@ function buildCli(opts = {}) {
92696
92822
  }
92697
92823
 
92698
92824
  // src/mount/discovery.ts
92699
- import fs16 from "node:fs";
92825
+ import fs17 from "node:fs";
92700
92826
  function findHostClones(opts) {
92701
- const fsImpl = opts.fsImpl ?? fs16;
92827
+ const fsImpl = opts.fsImpl ?? fs17;
92702
92828
  const found = [];
92703
92829
  for (const pkg of opts.packages) {
92704
92830
  const hostPath = opts.resolveHostPath(pkg, opts.parentDir);
@@ -92791,6 +92917,7 @@ export {
92791
92917
  renderWizardYaml,
92792
92918
  resolveDocsRoot,
92793
92919
  resolveNotify,
92920
+ resolveOverlayPath,
92794
92921
  restartDockerService,
92795
92922
  runAllLints,
92796
92923
  runChecks,