dev-cockpit 0.2.8 → 0.3.0
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/commands/mount.d.ts +15 -0
- package/dist/commands/mount.d.ts.map +1 -1
- package/dist/core/config.d.ts +7 -0
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/types.d.ts +8 -0
- package/dist/core/types.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +520 -308
- package/dist/index.js.map +4 -4
- package/dist/mount/health-check.d.ts +41 -0
- package/dist/mount/health-check.d.ts.map +1 -0
- package/dist/mount/manifest.d.ts.map +1 -1
- package/dist/mount/types.d.ts +6 -0
- package/dist/mount/types.d.ts.map +1 -1
- package/examples/cockpit.schema.json +5 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -294,8 +294,8 @@ var require_req = __commonJS({
|
|
|
294
294
|
if (req.originalUrl) {
|
|
295
295
|
_req.url = req.originalUrl;
|
|
296
296
|
} else {
|
|
297
|
-
const
|
|
298
|
-
_req.url = typeof
|
|
297
|
+
const path23 = req.path;
|
|
298
|
+
_req.url = typeof path23 === "string" ? path23 : req.url ? req.url.path || req.url : void 0;
|
|
299
299
|
}
|
|
300
300
|
if (req.query) {
|
|
301
301
|
_req.query = req.query;
|
|
@@ -460,14 +460,14 @@ var require_redact = __commonJS({
|
|
|
460
460
|
}
|
|
461
461
|
return obj;
|
|
462
462
|
}
|
|
463
|
-
function parsePath(
|
|
463
|
+
function parsePath(path23) {
|
|
464
464
|
const parts = [];
|
|
465
465
|
let current = "";
|
|
466
466
|
let inBrackets = false;
|
|
467
467
|
let inQuotes = false;
|
|
468
468
|
let quoteChar = "";
|
|
469
|
-
for (let i2 = 0; i2 <
|
|
470
|
-
const char =
|
|
469
|
+
for (let i2 = 0; i2 < path23.length; i2++) {
|
|
470
|
+
const char = path23[i2];
|
|
471
471
|
if (!inBrackets && char === ".") {
|
|
472
472
|
if (current) {
|
|
473
473
|
parts.push(current);
|
|
@@ -598,10 +598,10 @@ var require_redact = __commonJS({
|
|
|
598
598
|
return current;
|
|
599
599
|
}
|
|
600
600
|
function redactPaths(obj, paths, censor, remove = false) {
|
|
601
|
-
for (const
|
|
602
|
-
const parts = parsePath(
|
|
601
|
+
for (const path23 of paths) {
|
|
602
|
+
const parts = parsePath(path23);
|
|
603
603
|
if (parts.includes("*")) {
|
|
604
|
-
redactWildcardPath(obj, parts, censor,
|
|
604
|
+
redactWildcardPath(obj, parts, censor, path23, remove);
|
|
605
605
|
} else {
|
|
606
606
|
if (remove) {
|
|
607
607
|
removeKey(obj, parts);
|
|
@@ -686,8 +686,8 @@ var require_redact = __commonJS({
|
|
|
686
686
|
}
|
|
687
687
|
} else {
|
|
688
688
|
if (afterWildcard.includes("*")) {
|
|
689
|
-
const wrappedCensor = typeof censor === "function" ? (value,
|
|
690
|
-
const fullPath = [...pathArray.slice(0, pathLength), ...
|
|
689
|
+
const wrappedCensor = typeof censor === "function" ? (value, path23) => {
|
|
690
|
+
const fullPath = [...pathArray.slice(0, pathLength), ...path23];
|
|
691
691
|
return censor(value, fullPath);
|
|
692
692
|
} : censor;
|
|
693
693
|
redactWildcardPath(current, afterWildcard, wrappedCensor, originalPath, remove);
|
|
@@ -722,8 +722,8 @@ var require_redact = __commonJS({
|
|
|
722
722
|
return null;
|
|
723
723
|
}
|
|
724
724
|
const pathStructure = /* @__PURE__ */ new Map();
|
|
725
|
-
for (const
|
|
726
|
-
const parts = parsePath(
|
|
725
|
+
for (const path23 of pathsToClone) {
|
|
726
|
+
const parts = parsePath(path23);
|
|
727
727
|
let current = pathStructure;
|
|
728
728
|
for (let i2 = 0; i2 < parts.length; i2++) {
|
|
729
729
|
const part = parts[i2];
|
|
@@ -775,24 +775,24 @@ var require_redact = __commonJS({
|
|
|
775
775
|
}
|
|
776
776
|
return cloneSelectively(obj, pathStructure);
|
|
777
777
|
}
|
|
778
|
-
function validatePath(
|
|
779
|
-
if (typeof
|
|
778
|
+
function validatePath(path23) {
|
|
779
|
+
if (typeof path23 !== "string") {
|
|
780
780
|
throw new Error("Paths must be (non-empty) strings");
|
|
781
781
|
}
|
|
782
|
-
if (
|
|
782
|
+
if (path23 === "") {
|
|
783
783
|
throw new Error("Invalid redaction path ()");
|
|
784
784
|
}
|
|
785
|
-
if (
|
|
786
|
-
throw new Error(`Invalid redaction path (${
|
|
785
|
+
if (path23.includes("..")) {
|
|
786
|
+
throw new Error(`Invalid redaction path (${path23})`);
|
|
787
787
|
}
|
|
788
|
-
if (
|
|
789
|
-
throw new Error(`Invalid redaction path (${
|
|
788
|
+
if (path23.includes(",")) {
|
|
789
|
+
throw new Error(`Invalid redaction path (${path23})`);
|
|
790
790
|
}
|
|
791
791
|
let bracketCount = 0;
|
|
792
792
|
let inQuotes = false;
|
|
793
793
|
let quoteChar = "";
|
|
794
|
-
for (let i2 = 0; i2 <
|
|
795
|
-
const char =
|
|
794
|
+
for (let i2 = 0; i2 < path23.length; i2++) {
|
|
795
|
+
const char = path23[i2];
|
|
796
796
|
if ((char === '"' || char === "'") && bracketCount > 0) {
|
|
797
797
|
if (!inQuotes) {
|
|
798
798
|
inQuotes = true;
|
|
@@ -806,20 +806,20 @@ var require_redact = __commonJS({
|
|
|
806
806
|
} else if (char === "]" && !inQuotes) {
|
|
807
807
|
bracketCount--;
|
|
808
808
|
if (bracketCount < 0) {
|
|
809
|
-
throw new Error(`Invalid redaction path (${
|
|
809
|
+
throw new Error(`Invalid redaction path (${path23})`);
|
|
810
810
|
}
|
|
811
811
|
}
|
|
812
812
|
}
|
|
813
813
|
if (bracketCount !== 0) {
|
|
814
|
-
throw new Error(`Invalid redaction path (${
|
|
814
|
+
throw new Error(`Invalid redaction path (${path23})`);
|
|
815
815
|
}
|
|
816
816
|
}
|
|
817
817
|
function validatePaths(paths) {
|
|
818
818
|
if (!Array.isArray(paths)) {
|
|
819
819
|
throw new TypeError("paths must be an array");
|
|
820
820
|
}
|
|
821
|
-
for (const
|
|
822
|
-
validatePath(
|
|
821
|
+
for (const path23 of paths) {
|
|
822
|
+
validatePath(path23);
|
|
823
823
|
}
|
|
824
824
|
}
|
|
825
825
|
function slowRedact(options2 = {}) {
|
|
@@ -987,8 +987,8 @@ var require_redaction = __commonJS({
|
|
|
987
987
|
if (shape[k] === null) {
|
|
988
988
|
o2[k] = (value) => topCensor(value, [k]);
|
|
989
989
|
} else {
|
|
990
|
-
const wrappedCensor = typeof censor === "function" ? (value,
|
|
991
|
-
return censor(value, [k, ...
|
|
990
|
+
const wrappedCensor = typeof censor === "function" ? (value, path23) => {
|
|
991
|
+
return censor(value, [k, ...path23]);
|
|
992
992
|
} : censor;
|
|
993
993
|
o2[k] = Redact({
|
|
994
994
|
paths: shape[k],
|
|
@@ -1209,7 +1209,7 @@ var require_sonic_boom = __commonJS({
|
|
|
1209
1209
|
var fs18 = __require("fs");
|
|
1210
1210
|
var EventEmitter3 = __require("events");
|
|
1211
1211
|
var inherits = __require("util").inherits;
|
|
1212
|
-
var
|
|
1212
|
+
var path23 = __require("path");
|
|
1213
1213
|
var sleep = require_atomic_sleep();
|
|
1214
1214
|
var assert = __require("assert");
|
|
1215
1215
|
var BUSY_WRITE_TIMEOUT = 100;
|
|
@@ -1263,7 +1263,7 @@ var require_sonic_boom = __commonJS({
|
|
|
1263
1263
|
const mode = sonic.mode;
|
|
1264
1264
|
if (sonic.sync) {
|
|
1265
1265
|
try {
|
|
1266
|
-
if (sonic.mkdir) fs18.mkdirSync(
|
|
1266
|
+
if (sonic.mkdir) fs18.mkdirSync(path23.dirname(file), { recursive: true });
|
|
1267
1267
|
const fd = fs18.openSync(file, flags, mode);
|
|
1268
1268
|
fileOpened(null, fd);
|
|
1269
1269
|
} catch (err) {
|
|
@@ -1271,7 +1271,7 @@ var require_sonic_boom = __commonJS({
|
|
|
1271
1271
|
throw err;
|
|
1272
1272
|
}
|
|
1273
1273
|
} else if (sonic.mkdir) {
|
|
1274
|
-
fs18.mkdir(
|
|
1274
|
+
fs18.mkdir(path23.dirname(file), { recursive: true }, (err) => {
|
|
1275
1275
|
if (err) return fileOpened(err);
|
|
1276
1276
|
fs18.open(file, flags, mode, fileOpened);
|
|
1277
1277
|
});
|
|
@@ -4342,7 +4342,7 @@ var require_windows = __commonJS({
|
|
|
4342
4342
|
module.exports = isexe;
|
|
4343
4343
|
isexe.sync = sync;
|
|
4344
4344
|
var fs18 = __require("fs");
|
|
4345
|
-
function checkPathExt(
|
|
4345
|
+
function checkPathExt(path23, options2) {
|
|
4346
4346
|
var pathext = options2.pathExt !== void 0 ? options2.pathExt : process.env.PATHEXT;
|
|
4347
4347
|
if (!pathext) {
|
|
4348
4348
|
return true;
|
|
@@ -4353,25 +4353,25 @@ var require_windows = __commonJS({
|
|
|
4353
4353
|
}
|
|
4354
4354
|
for (var i2 = 0; i2 < pathext.length; i2++) {
|
|
4355
4355
|
var p = pathext[i2].toLowerCase();
|
|
4356
|
-
if (p &&
|
|
4356
|
+
if (p && path23.substr(-p.length).toLowerCase() === p) {
|
|
4357
4357
|
return true;
|
|
4358
4358
|
}
|
|
4359
4359
|
}
|
|
4360
4360
|
return false;
|
|
4361
4361
|
}
|
|
4362
|
-
function checkStat(stat4,
|
|
4362
|
+
function checkStat(stat4, path23, options2) {
|
|
4363
4363
|
if (!stat4.isSymbolicLink() && !stat4.isFile()) {
|
|
4364
4364
|
return false;
|
|
4365
4365
|
}
|
|
4366
|
-
return checkPathExt(
|
|
4366
|
+
return checkPathExt(path23, options2);
|
|
4367
4367
|
}
|
|
4368
|
-
function isexe(
|
|
4369
|
-
fs18.stat(
|
|
4370
|
-
cb(er, er ? false : checkStat(stat4,
|
|
4368
|
+
function isexe(path23, options2, cb) {
|
|
4369
|
+
fs18.stat(path23, function(er, stat4) {
|
|
4370
|
+
cb(er, er ? false : checkStat(stat4, path23, options2));
|
|
4371
4371
|
});
|
|
4372
4372
|
}
|
|
4373
|
-
function sync(
|
|
4374
|
-
return checkStat(fs18.statSync(
|
|
4373
|
+
function sync(path23, options2) {
|
|
4374
|
+
return checkStat(fs18.statSync(path23), path23, options2);
|
|
4375
4375
|
}
|
|
4376
4376
|
}
|
|
4377
4377
|
});
|
|
@@ -4382,13 +4382,13 @@ var require_mode = __commonJS({
|
|
|
4382
4382
|
module.exports = isexe;
|
|
4383
4383
|
isexe.sync = sync;
|
|
4384
4384
|
var fs18 = __require("fs");
|
|
4385
|
-
function isexe(
|
|
4386
|
-
fs18.stat(
|
|
4385
|
+
function isexe(path23, options2, cb) {
|
|
4386
|
+
fs18.stat(path23, function(er, stat4) {
|
|
4387
4387
|
cb(er, er ? false : checkStat(stat4, options2));
|
|
4388
4388
|
});
|
|
4389
4389
|
}
|
|
4390
|
-
function sync(
|
|
4391
|
-
return checkStat(fs18.statSync(
|
|
4390
|
+
function sync(path23, options2) {
|
|
4391
|
+
return checkStat(fs18.statSync(path23), options2);
|
|
4392
4392
|
}
|
|
4393
4393
|
function checkStat(stat4, options2) {
|
|
4394
4394
|
return stat4.isFile() && checkMode(stat4, options2);
|
|
@@ -4421,7 +4421,7 @@ var require_isexe = __commonJS({
|
|
|
4421
4421
|
}
|
|
4422
4422
|
module.exports = isexe;
|
|
4423
4423
|
isexe.sync = sync;
|
|
4424
|
-
function isexe(
|
|
4424
|
+
function isexe(path23, options2, cb) {
|
|
4425
4425
|
if (typeof options2 === "function") {
|
|
4426
4426
|
cb = options2;
|
|
4427
4427
|
options2 = {};
|
|
@@ -4431,7 +4431,7 @@ var require_isexe = __commonJS({
|
|
|
4431
4431
|
throw new TypeError("callback not provided");
|
|
4432
4432
|
}
|
|
4433
4433
|
return new Promise(function(resolve3, reject) {
|
|
4434
|
-
isexe(
|
|
4434
|
+
isexe(path23, options2 || {}, function(er, is) {
|
|
4435
4435
|
if (er) {
|
|
4436
4436
|
reject(er);
|
|
4437
4437
|
} else {
|
|
@@ -4440,7 +4440,7 @@ var require_isexe = __commonJS({
|
|
|
4440
4440
|
});
|
|
4441
4441
|
});
|
|
4442
4442
|
}
|
|
4443
|
-
core(
|
|
4443
|
+
core(path23, options2 || {}, function(er, is) {
|
|
4444
4444
|
if (er) {
|
|
4445
4445
|
if (er.code === "EACCES" || options2 && options2.ignoreErrors) {
|
|
4446
4446
|
er = null;
|
|
@@ -4450,9 +4450,9 @@ var require_isexe = __commonJS({
|
|
|
4450
4450
|
cb(er, is);
|
|
4451
4451
|
});
|
|
4452
4452
|
}
|
|
4453
|
-
function sync(
|
|
4453
|
+
function sync(path23, options2) {
|
|
4454
4454
|
try {
|
|
4455
|
-
return core.sync(
|
|
4455
|
+
return core.sync(path23, options2 || {});
|
|
4456
4456
|
} catch (er) {
|
|
4457
4457
|
if (options2 && options2.ignoreErrors || er.code === "EACCES") {
|
|
4458
4458
|
return false;
|
|
@@ -4468,7 +4468,7 @@ var require_isexe = __commonJS({
|
|
|
4468
4468
|
var require_which = __commonJS({
|
|
4469
4469
|
"node_modules/which/which.js"(exports, module) {
|
|
4470
4470
|
var isWindows2 = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
|
|
4471
|
-
var
|
|
4471
|
+
var path23 = __require("path");
|
|
4472
4472
|
var COLON = isWindows2 ? ";" : ":";
|
|
4473
4473
|
var isexe = require_isexe();
|
|
4474
4474
|
var getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" });
|
|
@@ -4506,7 +4506,7 @@ var require_which = __commonJS({
|
|
|
4506
4506
|
return opt.all && found.length ? resolve3(found) : reject(getNotFoundError(cmd));
|
|
4507
4507
|
const ppRaw = pathEnv[i2];
|
|
4508
4508
|
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
4509
|
-
const pCmd =
|
|
4509
|
+
const pCmd = path23.join(pathPart, cmd);
|
|
4510
4510
|
const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
4511
4511
|
resolve3(subStep(p, i2, 0));
|
|
4512
4512
|
});
|
|
@@ -4533,7 +4533,7 @@ var require_which = __commonJS({
|
|
|
4533
4533
|
for (let i2 = 0; i2 < pathEnv.length; i2++) {
|
|
4534
4534
|
const ppRaw = pathEnv[i2];
|
|
4535
4535
|
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
4536
|
-
const pCmd =
|
|
4536
|
+
const pCmd = path23.join(pathPart, cmd);
|
|
4537
4537
|
const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
4538
4538
|
for (let j = 0; j < pathExt.length; j++) {
|
|
4539
4539
|
const cur = p + pathExt[j];
|
|
@@ -4581,7 +4581,7 @@ var require_path_key = __commonJS({
|
|
|
4581
4581
|
var require_resolveCommand = __commonJS({
|
|
4582
4582
|
"node_modules/cross-spawn/lib/util/resolveCommand.js"(exports, module) {
|
|
4583
4583
|
"use strict";
|
|
4584
|
-
var
|
|
4584
|
+
var path23 = __require("path");
|
|
4585
4585
|
var which = require_which();
|
|
4586
4586
|
var getPathKey = require_path_key();
|
|
4587
4587
|
function resolveCommandAttempt(parsed, withoutPathExt) {
|
|
@@ -4599,7 +4599,7 @@ var require_resolveCommand = __commonJS({
|
|
|
4599
4599
|
try {
|
|
4600
4600
|
resolved = which.sync(parsed.command, {
|
|
4601
4601
|
path: env[getPathKey({ env })],
|
|
4602
|
-
pathExt: withoutPathExt ?
|
|
4602
|
+
pathExt: withoutPathExt ? path23.delimiter : void 0
|
|
4603
4603
|
});
|
|
4604
4604
|
} catch (e) {
|
|
4605
4605
|
} finally {
|
|
@@ -4608,7 +4608,7 @@ var require_resolveCommand = __commonJS({
|
|
|
4608
4608
|
}
|
|
4609
4609
|
}
|
|
4610
4610
|
if (resolved) {
|
|
4611
|
-
resolved =
|
|
4611
|
+
resolved = path23.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
|
|
4612
4612
|
}
|
|
4613
4613
|
return resolved;
|
|
4614
4614
|
}
|
|
@@ -4662,8 +4662,8 @@ var require_shebang_command = __commonJS({
|
|
|
4662
4662
|
if (!match) {
|
|
4663
4663
|
return null;
|
|
4664
4664
|
}
|
|
4665
|
-
const [
|
|
4666
|
-
const binary =
|
|
4665
|
+
const [path23, argument] = match[0].replace(/#! ?/, "").split(" ");
|
|
4666
|
+
const binary = path23.split("/").pop();
|
|
4667
4667
|
if (binary === "env") {
|
|
4668
4668
|
return argument;
|
|
4669
4669
|
}
|
|
@@ -4698,7 +4698,7 @@ var require_readShebang = __commonJS({
|
|
|
4698
4698
|
var require_parse = __commonJS({
|
|
4699
4699
|
"node_modules/cross-spawn/lib/parse.js"(exports, module) {
|
|
4700
4700
|
"use strict";
|
|
4701
|
-
var
|
|
4701
|
+
var path23 = __require("path");
|
|
4702
4702
|
var resolveCommand = require_resolveCommand();
|
|
4703
4703
|
var escape3 = require_escape();
|
|
4704
4704
|
var readShebang = require_readShebang();
|
|
@@ -4723,7 +4723,7 @@ var require_parse = __commonJS({
|
|
|
4723
4723
|
const needsShell = !isExecutableRegExp.test(commandFile);
|
|
4724
4724
|
if (parsed.options.forceShell || needsShell) {
|
|
4725
4725
|
const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
|
|
4726
|
-
parsed.command =
|
|
4726
|
+
parsed.command = path23.normalize(parsed.command);
|
|
4727
4727
|
parsed.command = escape3.command(parsed.command);
|
|
4728
4728
|
parsed.args = parsed.args.map((arg) => escape3.argument(arg, needsDoubleEscapeMetaChars));
|
|
4729
4729
|
const shellCommand = [parsed.command].concat(parsed.args).join(" ");
|
|
@@ -4910,17 +4910,17 @@ var require_visit = __commonJS({
|
|
|
4910
4910
|
visit.BREAK = BREAK;
|
|
4911
4911
|
visit.SKIP = SKIP;
|
|
4912
4912
|
visit.REMOVE = REMOVE;
|
|
4913
|
-
function visit_(key, node, visitor,
|
|
4914
|
-
const ctrl = callVisitor(key, node, visitor,
|
|
4913
|
+
function visit_(key, node, visitor, path23) {
|
|
4914
|
+
const ctrl = callVisitor(key, node, visitor, path23);
|
|
4915
4915
|
if (identity4.isNode(ctrl) || identity4.isPair(ctrl)) {
|
|
4916
|
-
replaceNode(key,
|
|
4917
|
-
return visit_(key, ctrl, visitor,
|
|
4916
|
+
replaceNode(key, path23, ctrl);
|
|
4917
|
+
return visit_(key, ctrl, visitor, path23);
|
|
4918
4918
|
}
|
|
4919
4919
|
if (typeof ctrl !== "symbol") {
|
|
4920
4920
|
if (identity4.isCollection(node)) {
|
|
4921
|
-
|
|
4921
|
+
path23 = Object.freeze(path23.concat(node));
|
|
4922
4922
|
for (let i2 = 0; i2 < node.items.length; ++i2) {
|
|
4923
|
-
const ci = visit_(i2, node.items[i2], visitor,
|
|
4923
|
+
const ci = visit_(i2, node.items[i2], visitor, path23);
|
|
4924
4924
|
if (typeof ci === "number")
|
|
4925
4925
|
i2 = ci - 1;
|
|
4926
4926
|
else if (ci === BREAK)
|
|
@@ -4931,13 +4931,13 @@ var require_visit = __commonJS({
|
|
|
4931
4931
|
}
|
|
4932
4932
|
}
|
|
4933
4933
|
} else if (identity4.isPair(node)) {
|
|
4934
|
-
|
|
4935
|
-
const ck = visit_("key", node.key, visitor,
|
|
4934
|
+
path23 = Object.freeze(path23.concat(node));
|
|
4935
|
+
const ck = visit_("key", node.key, visitor, path23);
|
|
4936
4936
|
if (ck === BREAK)
|
|
4937
4937
|
return BREAK;
|
|
4938
4938
|
else if (ck === REMOVE)
|
|
4939
4939
|
node.key = null;
|
|
4940
|
-
const cv = visit_("value", node.value, visitor,
|
|
4940
|
+
const cv = visit_("value", node.value, visitor, path23);
|
|
4941
4941
|
if (cv === BREAK)
|
|
4942
4942
|
return BREAK;
|
|
4943
4943
|
else if (cv === REMOVE)
|
|
@@ -4958,17 +4958,17 @@ var require_visit = __commonJS({
|
|
|
4958
4958
|
visitAsync.BREAK = BREAK;
|
|
4959
4959
|
visitAsync.SKIP = SKIP;
|
|
4960
4960
|
visitAsync.REMOVE = REMOVE;
|
|
4961
|
-
async function visitAsync_(key, node, visitor,
|
|
4962
|
-
const ctrl = await callVisitor(key, node, visitor,
|
|
4961
|
+
async function visitAsync_(key, node, visitor, path23) {
|
|
4962
|
+
const ctrl = await callVisitor(key, node, visitor, path23);
|
|
4963
4963
|
if (identity4.isNode(ctrl) || identity4.isPair(ctrl)) {
|
|
4964
|
-
replaceNode(key,
|
|
4965
|
-
return visitAsync_(key, ctrl, visitor,
|
|
4964
|
+
replaceNode(key, path23, ctrl);
|
|
4965
|
+
return visitAsync_(key, ctrl, visitor, path23);
|
|
4966
4966
|
}
|
|
4967
4967
|
if (typeof ctrl !== "symbol") {
|
|
4968
4968
|
if (identity4.isCollection(node)) {
|
|
4969
|
-
|
|
4969
|
+
path23 = Object.freeze(path23.concat(node));
|
|
4970
4970
|
for (let i2 = 0; i2 < node.items.length; ++i2) {
|
|
4971
|
-
const ci = await visitAsync_(i2, node.items[i2], visitor,
|
|
4971
|
+
const ci = await visitAsync_(i2, node.items[i2], visitor, path23);
|
|
4972
4972
|
if (typeof ci === "number")
|
|
4973
4973
|
i2 = ci - 1;
|
|
4974
4974
|
else if (ci === BREAK)
|
|
@@ -4979,13 +4979,13 @@ var require_visit = __commonJS({
|
|
|
4979
4979
|
}
|
|
4980
4980
|
}
|
|
4981
4981
|
} else if (identity4.isPair(node)) {
|
|
4982
|
-
|
|
4983
|
-
const ck = await visitAsync_("key", node.key, visitor,
|
|
4982
|
+
path23 = Object.freeze(path23.concat(node));
|
|
4983
|
+
const ck = await visitAsync_("key", node.key, visitor, path23);
|
|
4984
4984
|
if (ck === BREAK)
|
|
4985
4985
|
return BREAK;
|
|
4986
4986
|
else if (ck === REMOVE)
|
|
4987
4987
|
node.key = null;
|
|
4988
|
-
const cv = await visitAsync_("value", node.value, visitor,
|
|
4988
|
+
const cv = await visitAsync_("value", node.value, visitor, path23);
|
|
4989
4989
|
if (cv === BREAK)
|
|
4990
4990
|
return BREAK;
|
|
4991
4991
|
else if (cv === REMOVE)
|
|
@@ -5012,23 +5012,23 @@ var require_visit = __commonJS({
|
|
|
5012
5012
|
}
|
|
5013
5013
|
return visitor;
|
|
5014
5014
|
}
|
|
5015
|
-
function callVisitor(key, node, visitor,
|
|
5015
|
+
function callVisitor(key, node, visitor, path23) {
|
|
5016
5016
|
if (typeof visitor === "function")
|
|
5017
|
-
return visitor(key, node,
|
|
5017
|
+
return visitor(key, node, path23);
|
|
5018
5018
|
if (identity4.isMap(node))
|
|
5019
|
-
return visitor.Map?.(key, node,
|
|
5019
|
+
return visitor.Map?.(key, node, path23);
|
|
5020
5020
|
if (identity4.isSeq(node))
|
|
5021
|
-
return visitor.Seq?.(key, node,
|
|
5021
|
+
return visitor.Seq?.(key, node, path23);
|
|
5022
5022
|
if (identity4.isPair(node))
|
|
5023
|
-
return visitor.Pair?.(key, node,
|
|
5023
|
+
return visitor.Pair?.(key, node, path23);
|
|
5024
5024
|
if (identity4.isScalar(node))
|
|
5025
|
-
return visitor.Scalar?.(key, node,
|
|
5025
|
+
return visitor.Scalar?.(key, node, path23);
|
|
5026
5026
|
if (identity4.isAlias(node))
|
|
5027
|
-
return visitor.Alias?.(key, node,
|
|
5027
|
+
return visitor.Alias?.(key, node, path23);
|
|
5028
5028
|
return void 0;
|
|
5029
5029
|
}
|
|
5030
|
-
function replaceNode(key,
|
|
5031
|
-
const parent =
|
|
5030
|
+
function replaceNode(key, path23, node) {
|
|
5031
|
+
const parent = path23[path23.length - 1];
|
|
5032
5032
|
if (identity4.isCollection(parent)) {
|
|
5033
5033
|
parent.items[key] = node;
|
|
5034
5034
|
} else if (identity4.isPair(parent)) {
|
|
@@ -5638,10 +5638,10 @@ var require_Collection = __commonJS({
|
|
|
5638
5638
|
var createNode = require_createNode();
|
|
5639
5639
|
var identity4 = require_identity();
|
|
5640
5640
|
var Node = require_Node();
|
|
5641
|
-
function collectionFromPath(schema,
|
|
5641
|
+
function collectionFromPath(schema, path23, value) {
|
|
5642
5642
|
let v = value;
|
|
5643
|
-
for (let i2 =
|
|
5644
|
-
const k =
|
|
5643
|
+
for (let i2 = path23.length - 1; i2 >= 0; --i2) {
|
|
5644
|
+
const k = path23[i2];
|
|
5645
5645
|
if (typeof k === "number" && Number.isInteger(k) && k >= 0) {
|
|
5646
5646
|
const a2 = [];
|
|
5647
5647
|
a2[k] = v;
|
|
@@ -5660,7 +5660,7 @@ var require_Collection = __commonJS({
|
|
|
5660
5660
|
sourceObjects: /* @__PURE__ */ new Map()
|
|
5661
5661
|
});
|
|
5662
5662
|
}
|
|
5663
|
-
var isEmptyPath = (
|
|
5663
|
+
var isEmptyPath = (path23) => path23 == null || typeof path23 === "object" && !!path23[Symbol.iterator]().next().done;
|
|
5664
5664
|
var Collection = class extends Node.NodeBase {
|
|
5665
5665
|
constructor(type, schema) {
|
|
5666
5666
|
super(type);
|
|
@@ -5690,11 +5690,11 @@ var require_Collection = __commonJS({
|
|
|
5690
5690
|
* be a Pair instance or a `{ key, value }` object, which may not have a key
|
|
5691
5691
|
* that already exists in the map.
|
|
5692
5692
|
*/
|
|
5693
|
-
addIn(
|
|
5694
|
-
if (isEmptyPath(
|
|
5693
|
+
addIn(path23, value) {
|
|
5694
|
+
if (isEmptyPath(path23))
|
|
5695
5695
|
this.add(value);
|
|
5696
5696
|
else {
|
|
5697
|
-
const [key, ...rest] =
|
|
5697
|
+
const [key, ...rest] = path23;
|
|
5698
5698
|
const node = this.get(key, true);
|
|
5699
5699
|
if (identity4.isCollection(node))
|
|
5700
5700
|
node.addIn(rest, value);
|
|
@@ -5708,8 +5708,8 @@ var require_Collection = __commonJS({
|
|
|
5708
5708
|
* Removes a value from the collection.
|
|
5709
5709
|
* @returns `true` if the item was found and removed.
|
|
5710
5710
|
*/
|
|
5711
|
-
deleteIn(
|
|
5712
|
-
const [key, ...rest] =
|
|
5711
|
+
deleteIn(path23) {
|
|
5712
|
+
const [key, ...rest] = path23;
|
|
5713
5713
|
if (rest.length === 0)
|
|
5714
5714
|
return this.delete(key);
|
|
5715
5715
|
const node = this.get(key, true);
|
|
@@ -5723,8 +5723,8 @@ var require_Collection = __commonJS({
|
|
|
5723
5723
|
* scalar values from their surrounding node; to disable set `keepScalar` to
|
|
5724
5724
|
* `true` (collections are always returned intact).
|
|
5725
5725
|
*/
|
|
5726
|
-
getIn(
|
|
5727
|
-
const [key, ...rest] =
|
|
5726
|
+
getIn(path23, keepScalar) {
|
|
5727
|
+
const [key, ...rest] = path23;
|
|
5728
5728
|
const node = this.get(key, true);
|
|
5729
5729
|
if (rest.length === 0)
|
|
5730
5730
|
return !keepScalar && identity4.isScalar(node) ? node.value : node;
|
|
@@ -5742,8 +5742,8 @@ var require_Collection = __commonJS({
|
|
|
5742
5742
|
/**
|
|
5743
5743
|
* Checks if the collection includes a value with the key `key`.
|
|
5744
5744
|
*/
|
|
5745
|
-
hasIn(
|
|
5746
|
-
const [key, ...rest] =
|
|
5745
|
+
hasIn(path23) {
|
|
5746
|
+
const [key, ...rest] = path23;
|
|
5747
5747
|
if (rest.length === 0)
|
|
5748
5748
|
return this.has(key);
|
|
5749
5749
|
const node = this.get(key, true);
|
|
@@ -5753,8 +5753,8 @@ var require_Collection = __commonJS({
|
|
|
5753
5753
|
* Sets a value in this collection. For `!!set`, `value` needs to be a
|
|
5754
5754
|
* boolean to add/remove the item from the set.
|
|
5755
5755
|
*/
|
|
5756
|
-
setIn(
|
|
5757
|
-
const [key, ...rest] =
|
|
5756
|
+
setIn(path23, value) {
|
|
5757
|
+
const [key, ...rest] = path23;
|
|
5758
5758
|
if (rest.length === 0) {
|
|
5759
5759
|
this.set(key, value);
|
|
5760
5760
|
} else {
|
|
@@ -8269,9 +8269,9 @@ var require_Document = __commonJS({
|
|
|
8269
8269
|
this.contents.add(value);
|
|
8270
8270
|
}
|
|
8271
8271
|
/** Adds a value to the document. */
|
|
8272
|
-
addIn(
|
|
8272
|
+
addIn(path23, value) {
|
|
8273
8273
|
if (assertCollection(this.contents))
|
|
8274
|
-
this.contents.addIn(
|
|
8274
|
+
this.contents.addIn(path23, value);
|
|
8275
8275
|
}
|
|
8276
8276
|
/**
|
|
8277
8277
|
* Create a new `Alias` node, ensuring that the target `node` has the required anchor.
|
|
@@ -8346,14 +8346,14 @@ var require_Document = __commonJS({
|
|
|
8346
8346
|
* Removes a value from the document.
|
|
8347
8347
|
* @returns `true` if the item was found and removed.
|
|
8348
8348
|
*/
|
|
8349
|
-
deleteIn(
|
|
8350
|
-
if (Collection.isEmptyPath(
|
|
8349
|
+
deleteIn(path23) {
|
|
8350
|
+
if (Collection.isEmptyPath(path23)) {
|
|
8351
8351
|
if (this.contents == null)
|
|
8352
8352
|
return false;
|
|
8353
8353
|
this.contents = null;
|
|
8354
8354
|
return true;
|
|
8355
8355
|
}
|
|
8356
|
-
return assertCollection(this.contents) ? this.contents.deleteIn(
|
|
8356
|
+
return assertCollection(this.contents) ? this.contents.deleteIn(path23) : false;
|
|
8357
8357
|
}
|
|
8358
8358
|
/**
|
|
8359
8359
|
* Returns item at `key`, or `undefined` if not found. By default unwraps
|
|
@@ -8368,10 +8368,10 @@ var require_Document = __commonJS({
|
|
|
8368
8368
|
* scalar values from their surrounding node; to disable set `keepScalar` to
|
|
8369
8369
|
* `true` (collections are always returned intact).
|
|
8370
8370
|
*/
|
|
8371
|
-
getIn(
|
|
8372
|
-
if (Collection.isEmptyPath(
|
|
8371
|
+
getIn(path23, keepScalar) {
|
|
8372
|
+
if (Collection.isEmptyPath(path23))
|
|
8373
8373
|
return !keepScalar && identity4.isScalar(this.contents) ? this.contents.value : this.contents;
|
|
8374
|
-
return identity4.isCollection(this.contents) ? this.contents.getIn(
|
|
8374
|
+
return identity4.isCollection(this.contents) ? this.contents.getIn(path23, keepScalar) : void 0;
|
|
8375
8375
|
}
|
|
8376
8376
|
/**
|
|
8377
8377
|
* Checks if the document includes a value with the key `key`.
|
|
@@ -8382,10 +8382,10 @@ var require_Document = __commonJS({
|
|
|
8382
8382
|
/**
|
|
8383
8383
|
* Checks if the document includes a value at `path`.
|
|
8384
8384
|
*/
|
|
8385
|
-
hasIn(
|
|
8386
|
-
if (Collection.isEmptyPath(
|
|
8385
|
+
hasIn(path23) {
|
|
8386
|
+
if (Collection.isEmptyPath(path23))
|
|
8387
8387
|
return this.contents !== void 0;
|
|
8388
|
-
return identity4.isCollection(this.contents) ? this.contents.hasIn(
|
|
8388
|
+
return identity4.isCollection(this.contents) ? this.contents.hasIn(path23) : false;
|
|
8389
8389
|
}
|
|
8390
8390
|
/**
|
|
8391
8391
|
* Sets a value in this document. For `!!set`, `value` needs to be a
|
|
@@ -8402,13 +8402,13 @@ var require_Document = __commonJS({
|
|
|
8402
8402
|
* Sets a value in this document. For `!!set`, `value` needs to be a
|
|
8403
8403
|
* boolean to add/remove the item from the set.
|
|
8404
8404
|
*/
|
|
8405
|
-
setIn(
|
|
8406
|
-
if (Collection.isEmptyPath(
|
|
8405
|
+
setIn(path23, value) {
|
|
8406
|
+
if (Collection.isEmptyPath(path23)) {
|
|
8407
8407
|
this.contents = value;
|
|
8408
8408
|
} else if (this.contents == null) {
|
|
8409
|
-
this.contents = Collection.collectionFromPath(this.schema, Array.from(
|
|
8409
|
+
this.contents = Collection.collectionFromPath(this.schema, Array.from(path23), value);
|
|
8410
8410
|
} else if (assertCollection(this.contents)) {
|
|
8411
|
-
this.contents.setIn(
|
|
8411
|
+
this.contents.setIn(path23, value);
|
|
8412
8412
|
}
|
|
8413
8413
|
}
|
|
8414
8414
|
/**
|
|
@@ -10366,9 +10366,9 @@ var require_cst_visit = __commonJS({
|
|
|
10366
10366
|
visit.BREAK = BREAK;
|
|
10367
10367
|
visit.SKIP = SKIP;
|
|
10368
10368
|
visit.REMOVE = REMOVE;
|
|
10369
|
-
visit.itemAtPath = (cst,
|
|
10369
|
+
visit.itemAtPath = (cst, path23) => {
|
|
10370
10370
|
let item = cst;
|
|
10371
|
-
for (const [field, index] of
|
|
10371
|
+
for (const [field, index] of path23) {
|
|
10372
10372
|
const tok = item?.[field];
|
|
10373
10373
|
if (tok && "items" in tok) {
|
|
10374
10374
|
item = tok.items[index];
|
|
@@ -10377,23 +10377,23 @@ var require_cst_visit = __commonJS({
|
|
|
10377
10377
|
}
|
|
10378
10378
|
return item;
|
|
10379
10379
|
};
|
|
10380
|
-
visit.parentCollection = (cst,
|
|
10381
|
-
const parent = visit.itemAtPath(cst,
|
|
10382
|
-
const field =
|
|
10380
|
+
visit.parentCollection = (cst, path23) => {
|
|
10381
|
+
const parent = visit.itemAtPath(cst, path23.slice(0, -1));
|
|
10382
|
+
const field = path23[path23.length - 1][0];
|
|
10383
10383
|
const coll = parent?.[field];
|
|
10384
10384
|
if (coll && "items" in coll)
|
|
10385
10385
|
return coll;
|
|
10386
10386
|
throw new Error("Parent collection not found");
|
|
10387
10387
|
};
|
|
10388
|
-
function _visit(
|
|
10389
|
-
let ctrl = visitor(item,
|
|
10388
|
+
function _visit(path23, item, visitor) {
|
|
10389
|
+
let ctrl = visitor(item, path23);
|
|
10390
10390
|
if (typeof ctrl === "symbol")
|
|
10391
10391
|
return ctrl;
|
|
10392
10392
|
for (const field of ["key", "value"]) {
|
|
10393
10393
|
const token = item[field];
|
|
10394
10394
|
if (token && "items" in token) {
|
|
10395
10395
|
for (let i2 = 0; i2 < token.items.length; ++i2) {
|
|
10396
|
-
const ci = _visit(Object.freeze(
|
|
10396
|
+
const ci = _visit(Object.freeze(path23.concat([[field, i2]])), token.items[i2], visitor);
|
|
10397
10397
|
if (typeof ci === "number")
|
|
10398
10398
|
i2 = ci - 1;
|
|
10399
10399
|
else if (ci === BREAK)
|
|
@@ -10404,10 +10404,10 @@ var require_cst_visit = __commonJS({
|
|
|
10404
10404
|
}
|
|
10405
10405
|
}
|
|
10406
10406
|
if (typeof ctrl === "function" && field === "key")
|
|
10407
|
-
ctrl = ctrl(item,
|
|
10407
|
+
ctrl = ctrl(item, path23);
|
|
10408
10408
|
}
|
|
10409
10409
|
}
|
|
10410
|
-
return typeof ctrl === "function" ? ctrl(item,
|
|
10410
|
+
return typeof ctrl === "function" ? ctrl(item, path23) : ctrl;
|
|
10411
10411
|
}
|
|
10412
10412
|
exports.visit = visit;
|
|
10413
10413
|
}
|
|
@@ -13074,7 +13074,7 @@ var require_command = __commonJS({
|
|
|
13074
13074
|
"node_modules/commander/lib/command.js"(exports) {
|
|
13075
13075
|
var EventEmitter3 = __require("node:events").EventEmitter;
|
|
13076
13076
|
var childProcess = __require("node:child_process");
|
|
13077
|
-
var
|
|
13077
|
+
var path23 = __require("node:path");
|
|
13078
13078
|
var fs18 = __require("node:fs");
|
|
13079
13079
|
var process10 = __require("node:process");
|
|
13080
13080
|
var { Argument: Argument2, humanReadableArgName } = require_argument();
|
|
@@ -14007,9 +14007,9 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
14007
14007
|
let launchWithNode = false;
|
|
14008
14008
|
const sourceExt = [".js", ".ts", ".tsx", ".mjs", ".cjs"];
|
|
14009
14009
|
function findFile(baseDir, baseName) {
|
|
14010
|
-
const localBin =
|
|
14010
|
+
const localBin = path23.resolve(baseDir, baseName);
|
|
14011
14011
|
if (fs18.existsSync(localBin)) return localBin;
|
|
14012
|
-
if (sourceExt.includes(
|
|
14012
|
+
if (sourceExt.includes(path23.extname(baseName))) return void 0;
|
|
14013
14013
|
const foundExt = sourceExt.find(
|
|
14014
14014
|
(ext) => fs18.existsSync(`${localBin}${ext}`)
|
|
14015
14015
|
);
|
|
@@ -14027,17 +14027,17 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
14027
14027
|
} catch (err) {
|
|
14028
14028
|
resolvedScriptPath = this._scriptPath;
|
|
14029
14029
|
}
|
|
14030
|
-
executableDir =
|
|
14031
|
-
|
|
14030
|
+
executableDir = path23.resolve(
|
|
14031
|
+
path23.dirname(resolvedScriptPath),
|
|
14032
14032
|
executableDir
|
|
14033
14033
|
);
|
|
14034
14034
|
}
|
|
14035
14035
|
if (executableDir) {
|
|
14036
14036
|
let localFile = findFile(executableDir, executableFile);
|
|
14037
14037
|
if (!localFile && !subcommand._executableFile && this._scriptPath) {
|
|
14038
|
-
const legacyName =
|
|
14038
|
+
const legacyName = path23.basename(
|
|
14039
14039
|
this._scriptPath,
|
|
14040
|
-
|
|
14040
|
+
path23.extname(this._scriptPath)
|
|
14041
14041
|
);
|
|
14042
14042
|
if (legacyName !== this._name) {
|
|
14043
14043
|
localFile = findFile(
|
|
@@ -14048,7 +14048,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
14048
14048
|
}
|
|
14049
14049
|
executableFile = localFile || executableFile;
|
|
14050
14050
|
}
|
|
14051
|
-
launchWithNode = sourceExt.includes(
|
|
14051
|
+
launchWithNode = sourceExt.includes(path23.extname(executableFile));
|
|
14052
14052
|
let proc;
|
|
14053
14053
|
if (process10.platform !== "win32") {
|
|
14054
14054
|
if (launchWithNode) {
|
|
@@ -14888,7 +14888,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
14888
14888
|
* @return {Command}
|
|
14889
14889
|
*/
|
|
14890
14890
|
nameFromFilename(filename) {
|
|
14891
|
-
this._name =
|
|
14891
|
+
this._name = path23.basename(filename, path23.extname(filename));
|
|
14892
14892
|
return this;
|
|
14893
14893
|
}
|
|
14894
14894
|
/**
|
|
@@ -14902,9 +14902,9 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
14902
14902
|
* @param {string} [path]
|
|
14903
14903
|
* @return {(string|null|Command)}
|
|
14904
14904
|
*/
|
|
14905
|
-
executableDir(
|
|
14906
|
-
if (
|
|
14907
|
-
this._executableDir =
|
|
14905
|
+
executableDir(path24) {
|
|
14906
|
+
if (path24 === void 0) return this._executableDir;
|
|
14907
|
+
this._executableDir = path24;
|
|
14908
14908
|
return this;
|
|
14909
14909
|
}
|
|
14910
14910
|
/**
|
|
@@ -60073,15 +60073,15 @@ var require_route = __commonJS({
|
|
|
60073
60073
|
};
|
|
60074
60074
|
}
|
|
60075
60075
|
function wrapConversion(toModel, graph) {
|
|
60076
|
-
const
|
|
60076
|
+
const path23 = [graph[toModel].parent, toModel];
|
|
60077
60077
|
let fn = conversions[graph[toModel].parent][toModel];
|
|
60078
60078
|
let cur = graph[toModel].parent;
|
|
60079
60079
|
while (graph[cur].parent) {
|
|
60080
|
-
|
|
60080
|
+
path23.unshift(graph[cur].parent);
|
|
60081
60081
|
fn = link2(conversions[graph[cur].parent][cur], fn);
|
|
60082
60082
|
cur = graph[cur].parent;
|
|
60083
60083
|
}
|
|
60084
|
-
fn.conversion =
|
|
60084
|
+
fn.conversion = path23;
|
|
60085
60085
|
return fn;
|
|
60086
60086
|
}
|
|
60087
60087
|
module.exports = function(fromModel) {
|
|
@@ -77216,13 +77216,13 @@ var logOutputSync = ({ serializedResult, fdNumber, state, verboseInfo, encoding,
|
|
|
77216
77216
|
}
|
|
77217
77217
|
};
|
|
77218
77218
|
var writeToFiles = (serializedResult, stdioItems, outputFiles) => {
|
|
77219
|
-
for (const { path:
|
|
77220
|
-
const pathString = typeof
|
|
77219
|
+
for (const { path: path23, append } of stdioItems.filter(({ type }) => FILE_TYPES.has(type))) {
|
|
77220
|
+
const pathString = typeof path23 === "string" ? path23 : path23.toString();
|
|
77221
77221
|
if (append || outputFiles.has(pathString)) {
|
|
77222
|
-
appendFileSync(
|
|
77222
|
+
appendFileSync(path23, serializedResult);
|
|
77223
77223
|
} else {
|
|
77224
77224
|
outputFiles.add(pathString);
|
|
77225
|
-
writeFileSync(
|
|
77225
|
+
writeFileSync(path23, serializedResult);
|
|
77226
77226
|
}
|
|
77227
77227
|
}
|
|
77228
77228
|
};
|
|
@@ -80300,8 +80300,8 @@ function getErrorMap() {
|
|
|
80300
80300
|
|
|
80301
80301
|
// node_modules/zod/v3/helpers/parseUtil.js
|
|
80302
80302
|
var makeIssue = (params) => {
|
|
80303
|
-
const { data, path:
|
|
80304
|
-
const fullPath = [...
|
|
80303
|
+
const { data, path: path23, errorMaps, issueData } = params;
|
|
80304
|
+
const fullPath = [...path23, ...issueData.path || []];
|
|
80305
80305
|
const fullIssue = {
|
|
80306
80306
|
...issueData,
|
|
80307
80307
|
path: fullPath
|
|
@@ -80417,11 +80417,11 @@ var errorUtil;
|
|
|
80417
80417
|
|
|
80418
80418
|
// node_modules/zod/v3/types.js
|
|
80419
80419
|
var ParseInputLazyPath = class {
|
|
80420
|
-
constructor(parent, value,
|
|
80420
|
+
constructor(parent, value, path23, key) {
|
|
80421
80421
|
this._cachedPath = [];
|
|
80422
80422
|
this.parent = parent;
|
|
80423
80423
|
this.data = value;
|
|
80424
|
-
this._path =
|
|
80424
|
+
this._path = path23;
|
|
80425
80425
|
this._key = key;
|
|
80426
80426
|
}
|
|
80427
80427
|
get path() {
|
|
@@ -83972,6 +83972,7 @@ var MountSchema = external_exports.object({
|
|
|
83972
83972
|
hostPath: external_exports.string(),
|
|
83973
83973
|
containerPath: external_exports.string().optional(),
|
|
83974
83974
|
kind: external_exports.enum(["bind", "symlink-only"]).optional(),
|
|
83975
|
+
alternativeSources: external_exports.array(external_exports.string()).optional(),
|
|
83975
83976
|
meta: external_exports.record(external_exports.unknown()).optional()
|
|
83976
83977
|
}).refine(
|
|
83977
83978
|
(m) => m.kind === "symlink-only" ? true : typeof m.containerPath === "string" && m.containerPath.length > 0,
|
|
@@ -88836,7 +88837,7 @@ var ReaddirpStream = class extends Readable4 {
|
|
|
88836
88837
|
this._directoryFilter = normalizeFilter(opts.directoryFilter);
|
|
88837
88838
|
const statMethod = opts.lstat ? lstat : stat;
|
|
88838
88839
|
if (wantBigintFsStats) {
|
|
88839
|
-
this._stat = (
|
|
88840
|
+
this._stat = (path23) => statMethod(path23, { bigint: true });
|
|
88840
88841
|
} else {
|
|
88841
88842
|
this._stat = statMethod;
|
|
88842
88843
|
}
|
|
@@ -88861,8 +88862,8 @@ var ReaddirpStream = class extends Readable4 {
|
|
|
88861
88862
|
const par = this.parent;
|
|
88862
88863
|
const fil = par && par.files;
|
|
88863
88864
|
if (fil && fil.length > 0) {
|
|
88864
|
-
const { path:
|
|
88865
|
-
const slice = fil.splice(0, batch).map((dirent) => this._formatEntry(dirent,
|
|
88865
|
+
const { path: path23, depth } = par;
|
|
88866
|
+
const slice = fil.splice(0, batch).map((dirent) => this._formatEntry(dirent, path23));
|
|
88866
88867
|
const awaited = await Promise.all(slice);
|
|
88867
88868
|
for (const entry of awaited) {
|
|
88868
88869
|
if (!entry)
|
|
@@ -88902,20 +88903,20 @@ var ReaddirpStream = class extends Readable4 {
|
|
|
88902
88903
|
this.reading = false;
|
|
88903
88904
|
}
|
|
88904
88905
|
}
|
|
88905
|
-
async _exploreDir(
|
|
88906
|
+
async _exploreDir(path23, depth) {
|
|
88906
88907
|
let files;
|
|
88907
88908
|
try {
|
|
88908
|
-
files = await readdir(
|
|
88909
|
+
files = await readdir(path23, this._rdOptions);
|
|
88909
88910
|
} catch (error) {
|
|
88910
88911
|
this._onError(error);
|
|
88911
88912
|
}
|
|
88912
|
-
return { files, depth, path:
|
|
88913
|
+
return { files, depth, path: path23 };
|
|
88913
88914
|
}
|
|
88914
|
-
async _formatEntry(dirent,
|
|
88915
|
+
async _formatEntry(dirent, path23) {
|
|
88915
88916
|
let entry;
|
|
88916
88917
|
const basename3 = this._isDirent ? dirent.name : dirent;
|
|
88917
88918
|
try {
|
|
88918
|
-
const fullPath = presolve(pjoin(
|
|
88919
|
+
const fullPath = presolve(pjoin(path23, basename3));
|
|
88919
88920
|
entry = { path: prelative(this._root, fullPath), fullPath, basename: basename3 };
|
|
88920
88921
|
entry[this._statsProp] = this._isDirent ? dirent : await this._stat(fullPath);
|
|
88921
88922
|
} catch (err) {
|
|
@@ -89315,16 +89316,16 @@ var delFromSet = (main, prop, item) => {
|
|
|
89315
89316
|
};
|
|
89316
89317
|
var isEmptySet = (val) => val instanceof Set ? val.size === 0 : !val;
|
|
89317
89318
|
var FsWatchInstances = /* @__PURE__ */ new Map();
|
|
89318
|
-
function createFsWatchInstance(
|
|
89319
|
+
function createFsWatchInstance(path23, options2, listener, errHandler, emitRaw) {
|
|
89319
89320
|
const handleEvent = (rawEvent, evPath) => {
|
|
89320
|
-
listener(
|
|
89321
|
-
emitRaw(rawEvent, evPath, { watchedPath:
|
|
89322
|
-
if (evPath &&
|
|
89323
|
-
fsWatchBroadcast(sp.resolve(
|
|
89321
|
+
listener(path23);
|
|
89322
|
+
emitRaw(rawEvent, evPath, { watchedPath: path23 });
|
|
89323
|
+
if (evPath && path23 !== evPath) {
|
|
89324
|
+
fsWatchBroadcast(sp.resolve(path23, evPath), KEY_LISTENERS, sp.join(path23, evPath));
|
|
89324
89325
|
}
|
|
89325
89326
|
};
|
|
89326
89327
|
try {
|
|
89327
|
-
return fs_watch(
|
|
89328
|
+
return fs_watch(path23, {
|
|
89328
89329
|
persistent: options2.persistent
|
|
89329
89330
|
}, handleEvent);
|
|
89330
89331
|
} catch (error) {
|
|
@@ -89340,12 +89341,12 @@ var fsWatchBroadcast = (fullPath, listenerType, val1, val2, val3) => {
|
|
|
89340
89341
|
listener(val1, val2, val3);
|
|
89341
89342
|
});
|
|
89342
89343
|
};
|
|
89343
|
-
var setFsWatchListener = (
|
|
89344
|
+
var setFsWatchListener = (path23, fullPath, options2, handlers) => {
|
|
89344
89345
|
const { listener, errHandler, rawEmitter } = handlers;
|
|
89345
89346
|
let cont = FsWatchInstances.get(fullPath);
|
|
89346
89347
|
let watcher;
|
|
89347
89348
|
if (!options2.persistent) {
|
|
89348
|
-
watcher = createFsWatchInstance(
|
|
89349
|
+
watcher = createFsWatchInstance(path23, options2, listener, errHandler, rawEmitter);
|
|
89349
89350
|
if (!watcher)
|
|
89350
89351
|
return;
|
|
89351
89352
|
return watcher.close.bind(watcher);
|
|
@@ -89356,7 +89357,7 @@ var setFsWatchListener = (path22, fullPath, options2, handlers) => {
|
|
|
89356
89357
|
addAndConvert(cont, KEY_RAW, rawEmitter);
|
|
89357
89358
|
} else {
|
|
89358
89359
|
watcher = createFsWatchInstance(
|
|
89359
|
-
|
|
89360
|
+
path23,
|
|
89360
89361
|
options2,
|
|
89361
89362
|
fsWatchBroadcast.bind(null, fullPath, KEY_LISTENERS),
|
|
89362
89363
|
errHandler,
|
|
@@ -89371,7 +89372,7 @@ var setFsWatchListener = (path22, fullPath, options2, handlers) => {
|
|
|
89371
89372
|
cont.watcherUnusable = true;
|
|
89372
89373
|
if (isWindows && error.code === "EPERM") {
|
|
89373
89374
|
try {
|
|
89374
|
-
const fd = await open(
|
|
89375
|
+
const fd = await open(path23, "r");
|
|
89375
89376
|
await fd.close();
|
|
89376
89377
|
broadcastErr(error);
|
|
89377
89378
|
} catch (err) {
|
|
@@ -89402,7 +89403,7 @@ var setFsWatchListener = (path22, fullPath, options2, handlers) => {
|
|
|
89402
89403
|
};
|
|
89403
89404
|
};
|
|
89404
89405
|
var FsWatchFileInstances = /* @__PURE__ */ new Map();
|
|
89405
|
-
var setFsWatchFileListener = (
|
|
89406
|
+
var setFsWatchFileListener = (path23, fullPath, options2, handlers) => {
|
|
89406
89407
|
const { listener, rawEmitter } = handlers;
|
|
89407
89408
|
let cont = FsWatchFileInstances.get(fullPath);
|
|
89408
89409
|
const copts = cont && cont.options;
|
|
@@ -89424,7 +89425,7 @@ var setFsWatchFileListener = (path22, fullPath, options2, handlers) => {
|
|
|
89424
89425
|
});
|
|
89425
89426
|
const currmtime = curr.mtimeMs;
|
|
89426
89427
|
if (curr.size !== prev.size || currmtime > prev.mtimeMs || currmtime === 0) {
|
|
89427
|
-
foreach(cont.listeners, (listener2) => listener2(
|
|
89428
|
+
foreach(cont.listeners, (listener2) => listener2(path23, curr));
|
|
89428
89429
|
}
|
|
89429
89430
|
})
|
|
89430
89431
|
};
|
|
@@ -89454,13 +89455,13 @@ var NodeFsHandler = class {
|
|
|
89454
89455
|
* @param listener on fs change
|
|
89455
89456
|
* @returns closer for the watcher instance
|
|
89456
89457
|
*/
|
|
89457
|
-
_watchWithNodeFs(
|
|
89458
|
+
_watchWithNodeFs(path23, listener) {
|
|
89458
89459
|
const opts = this.fsw.options;
|
|
89459
|
-
const directory = sp.dirname(
|
|
89460
|
-
const basename3 = sp.basename(
|
|
89460
|
+
const directory = sp.dirname(path23);
|
|
89461
|
+
const basename3 = sp.basename(path23);
|
|
89461
89462
|
const parent = this.fsw._getWatchedDir(directory);
|
|
89462
89463
|
parent.add(basename3);
|
|
89463
|
-
const absolutePath = sp.resolve(
|
|
89464
|
+
const absolutePath = sp.resolve(path23);
|
|
89464
89465
|
const options2 = {
|
|
89465
89466
|
persistent: opts.persistent
|
|
89466
89467
|
};
|
|
@@ -89470,12 +89471,12 @@ var NodeFsHandler = class {
|
|
|
89470
89471
|
if (opts.usePolling) {
|
|
89471
89472
|
const enableBin = opts.interval !== opts.binaryInterval;
|
|
89472
89473
|
options2.interval = enableBin && isBinaryPath(basename3) ? opts.binaryInterval : opts.interval;
|
|
89473
|
-
closer = setFsWatchFileListener(
|
|
89474
|
+
closer = setFsWatchFileListener(path23, absolutePath, options2, {
|
|
89474
89475
|
listener,
|
|
89475
89476
|
rawEmitter: this.fsw._emitRaw
|
|
89476
89477
|
});
|
|
89477
89478
|
} else {
|
|
89478
|
-
closer = setFsWatchListener(
|
|
89479
|
+
closer = setFsWatchListener(path23, absolutePath, options2, {
|
|
89479
89480
|
listener,
|
|
89480
89481
|
errHandler: this._boundHandleError,
|
|
89481
89482
|
rawEmitter: this.fsw._emitRaw
|
|
@@ -89497,7 +89498,7 @@ var NodeFsHandler = class {
|
|
|
89497
89498
|
let prevStats = stats;
|
|
89498
89499
|
if (parent.has(basename3))
|
|
89499
89500
|
return;
|
|
89500
|
-
const listener = async (
|
|
89501
|
+
const listener = async (path23, newStats) => {
|
|
89501
89502
|
if (!this.fsw._throttle(THROTTLE_MODE_WATCH, file, 5))
|
|
89502
89503
|
return;
|
|
89503
89504
|
if (!newStats || newStats.mtimeMs === 0) {
|
|
@@ -89511,11 +89512,11 @@ var NodeFsHandler = class {
|
|
|
89511
89512
|
this.fsw._emit(EV.CHANGE, file, newStats2);
|
|
89512
89513
|
}
|
|
89513
89514
|
if ((isMacos || isLinux || isFreeBSD) && prevStats.ino !== newStats2.ino) {
|
|
89514
|
-
this.fsw._closeFile(
|
|
89515
|
+
this.fsw._closeFile(path23);
|
|
89515
89516
|
prevStats = newStats2;
|
|
89516
89517
|
const closer2 = this._watchWithNodeFs(file, listener);
|
|
89517
89518
|
if (closer2)
|
|
89518
|
-
this.fsw._addPathCloser(
|
|
89519
|
+
this.fsw._addPathCloser(path23, closer2);
|
|
89519
89520
|
} else {
|
|
89520
89521
|
prevStats = newStats2;
|
|
89521
89522
|
}
|
|
@@ -89547,7 +89548,7 @@ var NodeFsHandler = class {
|
|
|
89547
89548
|
* @param item basename of this item
|
|
89548
89549
|
* @returns true if no more processing is needed for this entry.
|
|
89549
89550
|
*/
|
|
89550
|
-
async _handleSymlink(entry, directory,
|
|
89551
|
+
async _handleSymlink(entry, directory, path23, item) {
|
|
89551
89552
|
if (this.fsw.closed) {
|
|
89552
89553
|
return;
|
|
89553
89554
|
}
|
|
@@ -89557,7 +89558,7 @@ var NodeFsHandler = class {
|
|
|
89557
89558
|
this.fsw._incrReadyCount();
|
|
89558
89559
|
let linkPath;
|
|
89559
89560
|
try {
|
|
89560
|
-
linkPath = await fsrealpath(
|
|
89561
|
+
linkPath = await fsrealpath(path23);
|
|
89561
89562
|
} catch (e) {
|
|
89562
89563
|
this.fsw._emitReady();
|
|
89563
89564
|
return true;
|
|
@@ -89567,12 +89568,12 @@ var NodeFsHandler = class {
|
|
|
89567
89568
|
if (dir.has(item)) {
|
|
89568
89569
|
if (this.fsw._symlinkPaths.get(full) !== linkPath) {
|
|
89569
89570
|
this.fsw._symlinkPaths.set(full, linkPath);
|
|
89570
|
-
this.fsw._emit(EV.CHANGE,
|
|
89571
|
+
this.fsw._emit(EV.CHANGE, path23, entry.stats);
|
|
89571
89572
|
}
|
|
89572
89573
|
} else {
|
|
89573
89574
|
dir.add(item);
|
|
89574
89575
|
this.fsw._symlinkPaths.set(full, linkPath);
|
|
89575
|
-
this.fsw._emit(EV.ADD,
|
|
89576
|
+
this.fsw._emit(EV.ADD, path23, entry.stats);
|
|
89576
89577
|
}
|
|
89577
89578
|
this.fsw._emitReady();
|
|
89578
89579
|
return true;
|
|
@@ -89602,9 +89603,9 @@ var NodeFsHandler = class {
|
|
|
89602
89603
|
return;
|
|
89603
89604
|
}
|
|
89604
89605
|
const item = entry.path;
|
|
89605
|
-
let
|
|
89606
|
+
let path23 = sp.join(directory, item);
|
|
89606
89607
|
current.add(item);
|
|
89607
|
-
if (entry.stats.isSymbolicLink() && await this._handleSymlink(entry, directory,
|
|
89608
|
+
if (entry.stats.isSymbolicLink() && await this._handleSymlink(entry, directory, path23, item)) {
|
|
89608
89609
|
return;
|
|
89609
89610
|
}
|
|
89610
89611
|
if (this.fsw.closed) {
|
|
@@ -89613,8 +89614,8 @@ var NodeFsHandler = class {
|
|
|
89613
89614
|
}
|
|
89614
89615
|
if (item === target || !target && !previous.has(item)) {
|
|
89615
89616
|
this.fsw._incrReadyCount();
|
|
89616
|
-
|
|
89617
|
-
this._addToNodeFs(
|
|
89617
|
+
path23 = sp.join(dir, sp.relative(dir, path23));
|
|
89618
|
+
this._addToNodeFs(path23, initialAdd, wh, depth + 1);
|
|
89618
89619
|
}
|
|
89619
89620
|
}).on(EV.ERROR, this._boundHandleError);
|
|
89620
89621
|
return new Promise((resolve3, reject) => {
|
|
@@ -89683,13 +89684,13 @@ var NodeFsHandler = class {
|
|
|
89683
89684
|
* @param depth Child path actually targeted for watch
|
|
89684
89685
|
* @param target Child path actually targeted for watch
|
|
89685
89686
|
*/
|
|
89686
|
-
async _addToNodeFs(
|
|
89687
|
+
async _addToNodeFs(path23, initialAdd, priorWh, depth, target) {
|
|
89687
89688
|
const ready = this.fsw._emitReady;
|
|
89688
|
-
if (this.fsw._isIgnored(
|
|
89689
|
+
if (this.fsw._isIgnored(path23) || this.fsw.closed) {
|
|
89689
89690
|
ready();
|
|
89690
89691
|
return false;
|
|
89691
89692
|
}
|
|
89692
|
-
const wh = this.fsw._getWatchHelpers(
|
|
89693
|
+
const wh = this.fsw._getWatchHelpers(path23);
|
|
89693
89694
|
if (priorWh) {
|
|
89694
89695
|
wh.filterPath = (entry) => priorWh.filterPath(entry);
|
|
89695
89696
|
wh.filterDir = (entry) => priorWh.filterDir(entry);
|
|
@@ -89705,8 +89706,8 @@ var NodeFsHandler = class {
|
|
|
89705
89706
|
const follow = this.fsw.options.followSymlinks;
|
|
89706
89707
|
let closer;
|
|
89707
89708
|
if (stats.isDirectory()) {
|
|
89708
|
-
const absPath = sp.resolve(
|
|
89709
|
-
const targetPath = follow ? await fsrealpath(
|
|
89709
|
+
const absPath = sp.resolve(path23);
|
|
89710
|
+
const targetPath = follow ? await fsrealpath(path23) : path23;
|
|
89710
89711
|
if (this.fsw.closed)
|
|
89711
89712
|
return;
|
|
89712
89713
|
closer = await this._handleDir(wh.watchPath, stats, initialAdd, depth, target, wh, targetPath);
|
|
@@ -89716,29 +89717,29 @@ var NodeFsHandler = class {
|
|
|
89716
89717
|
this.fsw._symlinkPaths.set(absPath, targetPath);
|
|
89717
89718
|
}
|
|
89718
89719
|
} else if (stats.isSymbolicLink()) {
|
|
89719
|
-
const targetPath = follow ? await fsrealpath(
|
|
89720
|
+
const targetPath = follow ? await fsrealpath(path23) : path23;
|
|
89720
89721
|
if (this.fsw.closed)
|
|
89721
89722
|
return;
|
|
89722
89723
|
const parent = sp.dirname(wh.watchPath);
|
|
89723
89724
|
this.fsw._getWatchedDir(parent).add(wh.watchPath);
|
|
89724
89725
|
this.fsw._emit(EV.ADD, wh.watchPath, stats);
|
|
89725
|
-
closer = await this._handleDir(parent, stats, initialAdd, depth,
|
|
89726
|
+
closer = await this._handleDir(parent, stats, initialAdd, depth, path23, wh, targetPath);
|
|
89726
89727
|
if (this.fsw.closed)
|
|
89727
89728
|
return;
|
|
89728
89729
|
if (targetPath !== void 0) {
|
|
89729
|
-
this.fsw._symlinkPaths.set(sp.resolve(
|
|
89730
|
+
this.fsw._symlinkPaths.set(sp.resolve(path23), targetPath);
|
|
89730
89731
|
}
|
|
89731
89732
|
} else {
|
|
89732
89733
|
closer = this._handleFile(wh.watchPath, stats, initialAdd);
|
|
89733
89734
|
}
|
|
89734
89735
|
ready();
|
|
89735
89736
|
if (closer)
|
|
89736
|
-
this.fsw._addPathCloser(
|
|
89737
|
+
this.fsw._addPathCloser(path23, closer);
|
|
89737
89738
|
return false;
|
|
89738
89739
|
} catch (error) {
|
|
89739
89740
|
if (this.fsw._handleError(error)) {
|
|
89740
89741
|
ready();
|
|
89741
|
-
return
|
|
89742
|
+
return path23;
|
|
89742
89743
|
}
|
|
89743
89744
|
}
|
|
89744
89745
|
}
|
|
@@ -89781,24 +89782,24 @@ function createPattern(matcher) {
|
|
|
89781
89782
|
}
|
|
89782
89783
|
return () => false;
|
|
89783
89784
|
}
|
|
89784
|
-
function normalizePath(
|
|
89785
|
-
if (typeof
|
|
89785
|
+
function normalizePath(path23) {
|
|
89786
|
+
if (typeof path23 !== "string")
|
|
89786
89787
|
throw new Error("string expected");
|
|
89787
|
-
|
|
89788
|
-
|
|
89788
|
+
path23 = sp2.normalize(path23);
|
|
89789
|
+
path23 = path23.replace(/\\/g, "/");
|
|
89789
89790
|
let prepend = false;
|
|
89790
|
-
if (
|
|
89791
|
+
if (path23.startsWith("//"))
|
|
89791
89792
|
prepend = true;
|
|
89792
|
-
|
|
89793
|
+
path23 = path23.replace(DOUBLE_SLASH_RE, "/");
|
|
89793
89794
|
if (prepend)
|
|
89794
|
-
|
|
89795
|
-
return
|
|
89795
|
+
path23 = "/" + path23;
|
|
89796
|
+
return path23;
|
|
89796
89797
|
}
|
|
89797
89798
|
function matchPatterns(patterns, testString, stats) {
|
|
89798
|
-
const
|
|
89799
|
+
const path23 = normalizePath(testString);
|
|
89799
89800
|
for (let index = 0; index < patterns.length; index++) {
|
|
89800
89801
|
const pattern = patterns[index];
|
|
89801
|
-
if (pattern(
|
|
89802
|
+
if (pattern(path23, stats)) {
|
|
89802
89803
|
return true;
|
|
89803
89804
|
}
|
|
89804
89805
|
}
|
|
@@ -89836,19 +89837,19 @@ var toUnix = (string) => {
|
|
|
89836
89837
|
}
|
|
89837
89838
|
return str;
|
|
89838
89839
|
};
|
|
89839
|
-
var normalizePathToUnix = (
|
|
89840
|
-
var normalizeIgnored = (cwd = "") => (
|
|
89841
|
-
if (typeof
|
|
89842
|
-
return normalizePathToUnix(sp2.isAbsolute(
|
|
89840
|
+
var normalizePathToUnix = (path23) => toUnix(sp2.normalize(toUnix(path23)));
|
|
89841
|
+
var normalizeIgnored = (cwd = "") => (path23) => {
|
|
89842
|
+
if (typeof path23 === "string") {
|
|
89843
|
+
return normalizePathToUnix(sp2.isAbsolute(path23) ? path23 : sp2.join(cwd, path23));
|
|
89843
89844
|
} else {
|
|
89844
|
-
return
|
|
89845
|
+
return path23;
|
|
89845
89846
|
}
|
|
89846
89847
|
};
|
|
89847
|
-
var getAbsolutePath = (
|
|
89848
|
-
if (sp2.isAbsolute(
|
|
89849
|
-
return
|
|
89848
|
+
var getAbsolutePath = (path23, cwd) => {
|
|
89849
|
+
if (sp2.isAbsolute(path23)) {
|
|
89850
|
+
return path23;
|
|
89850
89851
|
}
|
|
89851
|
-
return sp2.join(cwd,
|
|
89852
|
+
return sp2.join(cwd, path23);
|
|
89852
89853
|
};
|
|
89853
89854
|
var EMPTY_SET = Object.freeze(/* @__PURE__ */ new Set());
|
|
89854
89855
|
var DirEntry = class {
|
|
@@ -89913,10 +89914,10 @@ var WatchHelper = class {
|
|
|
89913
89914
|
dirParts;
|
|
89914
89915
|
followSymlinks;
|
|
89915
89916
|
statMethod;
|
|
89916
|
-
constructor(
|
|
89917
|
+
constructor(path23, follow, fsw) {
|
|
89917
89918
|
this.fsw = fsw;
|
|
89918
|
-
const watchPath =
|
|
89919
|
-
this.path =
|
|
89919
|
+
const watchPath = path23;
|
|
89920
|
+
this.path = path23 = path23.replace(REPLACER_RE, "");
|
|
89920
89921
|
this.watchPath = watchPath;
|
|
89921
89922
|
this.fullWatchPath = sp2.resolve(watchPath);
|
|
89922
89923
|
this.dirParts = [];
|
|
@@ -90056,20 +90057,20 @@ var FSWatcher = class extends EventEmitter2 {
|
|
|
90056
90057
|
this._closePromise = void 0;
|
|
90057
90058
|
let paths = unifyPaths(paths_);
|
|
90058
90059
|
if (cwd) {
|
|
90059
|
-
paths = paths.map((
|
|
90060
|
-
const absPath = getAbsolutePath(
|
|
90060
|
+
paths = paths.map((path23) => {
|
|
90061
|
+
const absPath = getAbsolutePath(path23, cwd);
|
|
90061
90062
|
return absPath;
|
|
90062
90063
|
});
|
|
90063
90064
|
}
|
|
90064
|
-
paths.forEach((
|
|
90065
|
-
this._removeIgnoredPath(
|
|
90065
|
+
paths.forEach((path23) => {
|
|
90066
|
+
this._removeIgnoredPath(path23);
|
|
90066
90067
|
});
|
|
90067
90068
|
this._userIgnored = void 0;
|
|
90068
90069
|
if (!this._readyCount)
|
|
90069
90070
|
this._readyCount = 0;
|
|
90070
90071
|
this._readyCount += paths.length;
|
|
90071
|
-
Promise.all(paths.map(async (
|
|
90072
|
-
const res = await this._nodeFsHandler._addToNodeFs(
|
|
90072
|
+
Promise.all(paths.map(async (path23) => {
|
|
90073
|
+
const res = await this._nodeFsHandler._addToNodeFs(path23, !_internal, void 0, 0, _origAdd);
|
|
90073
90074
|
if (res)
|
|
90074
90075
|
this._emitReady();
|
|
90075
90076
|
return res;
|
|
@@ -90091,17 +90092,17 @@ var FSWatcher = class extends EventEmitter2 {
|
|
|
90091
90092
|
return this;
|
|
90092
90093
|
const paths = unifyPaths(paths_);
|
|
90093
90094
|
const { cwd } = this.options;
|
|
90094
|
-
paths.forEach((
|
|
90095
|
-
if (!sp2.isAbsolute(
|
|
90095
|
+
paths.forEach((path23) => {
|
|
90096
|
+
if (!sp2.isAbsolute(path23) && !this._closers.has(path23)) {
|
|
90096
90097
|
if (cwd)
|
|
90097
|
-
|
|
90098
|
-
|
|
90098
|
+
path23 = sp2.join(cwd, path23);
|
|
90099
|
+
path23 = sp2.resolve(path23);
|
|
90099
90100
|
}
|
|
90100
|
-
this._closePath(
|
|
90101
|
-
this._addIgnoredPath(
|
|
90102
|
-
if (this._watched.has(
|
|
90101
|
+
this._closePath(path23);
|
|
90102
|
+
this._addIgnoredPath(path23);
|
|
90103
|
+
if (this._watched.has(path23)) {
|
|
90103
90104
|
this._addIgnoredPath({
|
|
90104
|
-
path:
|
|
90105
|
+
path: path23,
|
|
90105
90106
|
recursive: true
|
|
90106
90107
|
});
|
|
90107
90108
|
}
|
|
@@ -90165,38 +90166,38 @@ var FSWatcher = class extends EventEmitter2 {
|
|
|
90165
90166
|
* @param stats arguments to be passed with event
|
|
90166
90167
|
* @returns the error if defined, otherwise the value of the FSWatcher instance's `closed` flag
|
|
90167
90168
|
*/
|
|
90168
|
-
async _emit(event,
|
|
90169
|
+
async _emit(event, path23, stats) {
|
|
90169
90170
|
if (this.closed)
|
|
90170
90171
|
return;
|
|
90171
90172
|
const opts = this.options;
|
|
90172
90173
|
if (isWindows)
|
|
90173
|
-
|
|
90174
|
+
path23 = sp2.normalize(path23);
|
|
90174
90175
|
if (opts.cwd)
|
|
90175
|
-
|
|
90176
|
-
const args = [
|
|
90176
|
+
path23 = sp2.relative(opts.cwd, path23);
|
|
90177
|
+
const args = [path23];
|
|
90177
90178
|
if (stats != null)
|
|
90178
90179
|
args.push(stats);
|
|
90179
90180
|
const awf = opts.awaitWriteFinish;
|
|
90180
90181
|
let pw;
|
|
90181
|
-
if (awf && (pw = this._pendingWrites.get(
|
|
90182
|
+
if (awf && (pw = this._pendingWrites.get(path23))) {
|
|
90182
90183
|
pw.lastChange = /* @__PURE__ */ new Date();
|
|
90183
90184
|
return this;
|
|
90184
90185
|
}
|
|
90185
90186
|
if (opts.atomic) {
|
|
90186
90187
|
if (event === EVENTS.UNLINK) {
|
|
90187
|
-
this._pendingUnlinks.set(
|
|
90188
|
+
this._pendingUnlinks.set(path23, [event, ...args]);
|
|
90188
90189
|
setTimeout(() => {
|
|
90189
|
-
this._pendingUnlinks.forEach((entry,
|
|
90190
|
+
this._pendingUnlinks.forEach((entry, path24) => {
|
|
90190
90191
|
this.emit(...entry);
|
|
90191
90192
|
this.emit(EVENTS.ALL, ...entry);
|
|
90192
|
-
this._pendingUnlinks.delete(
|
|
90193
|
+
this._pendingUnlinks.delete(path24);
|
|
90193
90194
|
});
|
|
90194
90195
|
}, typeof opts.atomic === "number" ? opts.atomic : 100);
|
|
90195
90196
|
return this;
|
|
90196
90197
|
}
|
|
90197
|
-
if (event === EVENTS.ADD && this._pendingUnlinks.has(
|
|
90198
|
+
if (event === EVENTS.ADD && this._pendingUnlinks.has(path23)) {
|
|
90198
90199
|
event = EVENTS.CHANGE;
|
|
90199
|
-
this._pendingUnlinks.delete(
|
|
90200
|
+
this._pendingUnlinks.delete(path23);
|
|
90200
90201
|
}
|
|
90201
90202
|
}
|
|
90202
90203
|
if (awf && (event === EVENTS.ADD || event === EVENTS.CHANGE) && this._readyEmitted) {
|
|
@@ -90214,16 +90215,16 @@ var FSWatcher = class extends EventEmitter2 {
|
|
|
90214
90215
|
this.emitWithAll(event, args);
|
|
90215
90216
|
}
|
|
90216
90217
|
};
|
|
90217
|
-
this._awaitWriteFinish(
|
|
90218
|
+
this._awaitWriteFinish(path23, awf.stabilityThreshold, event, awfEmit);
|
|
90218
90219
|
return this;
|
|
90219
90220
|
}
|
|
90220
90221
|
if (event === EVENTS.CHANGE) {
|
|
90221
|
-
const isThrottled = !this._throttle(EVENTS.CHANGE,
|
|
90222
|
+
const isThrottled = !this._throttle(EVENTS.CHANGE, path23, 50);
|
|
90222
90223
|
if (isThrottled)
|
|
90223
90224
|
return this;
|
|
90224
90225
|
}
|
|
90225
90226
|
if (opts.alwaysStat && stats === void 0 && (event === EVENTS.ADD || event === EVENTS.ADD_DIR || event === EVENTS.CHANGE)) {
|
|
90226
|
-
const fullPath = opts.cwd ? sp2.join(opts.cwd,
|
|
90227
|
+
const fullPath = opts.cwd ? sp2.join(opts.cwd, path23) : path23;
|
|
90227
90228
|
let stats2;
|
|
90228
90229
|
try {
|
|
90229
90230
|
stats2 = await stat3(fullPath);
|
|
@@ -90254,23 +90255,23 @@ var FSWatcher = class extends EventEmitter2 {
|
|
|
90254
90255
|
* @param timeout duration of time to suppress duplicate actions
|
|
90255
90256
|
* @returns tracking object or false if action should be suppressed
|
|
90256
90257
|
*/
|
|
90257
|
-
_throttle(actionType,
|
|
90258
|
+
_throttle(actionType, path23, timeout) {
|
|
90258
90259
|
if (!this._throttled.has(actionType)) {
|
|
90259
90260
|
this._throttled.set(actionType, /* @__PURE__ */ new Map());
|
|
90260
90261
|
}
|
|
90261
90262
|
const action = this._throttled.get(actionType);
|
|
90262
90263
|
if (!action)
|
|
90263
90264
|
throw new Error("invalid throttle");
|
|
90264
|
-
const actionPath = action.get(
|
|
90265
|
+
const actionPath = action.get(path23);
|
|
90265
90266
|
if (actionPath) {
|
|
90266
90267
|
actionPath.count++;
|
|
90267
90268
|
return false;
|
|
90268
90269
|
}
|
|
90269
90270
|
let timeoutObject;
|
|
90270
90271
|
const clear = () => {
|
|
90271
|
-
const item = action.get(
|
|
90272
|
+
const item = action.get(path23);
|
|
90272
90273
|
const count2 = item ? item.count : 0;
|
|
90273
|
-
action.delete(
|
|
90274
|
+
action.delete(path23);
|
|
90274
90275
|
clearTimeout(timeoutObject);
|
|
90275
90276
|
if (item)
|
|
90276
90277
|
clearTimeout(item.timeoutObject);
|
|
@@ -90278,7 +90279,7 @@ var FSWatcher = class extends EventEmitter2 {
|
|
|
90278
90279
|
};
|
|
90279
90280
|
timeoutObject = setTimeout(clear, timeout);
|
|
90280
90281
|
const thr = { timeoutObject, clear, count: 0 };
|
|
90281
|
-
action.set(
|
|
90282
|
+
action.set(path23, thr);
|
|
90282
90283
|
return thr;
|
|
90283
90284
|
}
|
|
90284
90285
|
_incrReadyCount() {
|
|
@@ -90292,44 +90293,44 @@ var FSWatcher = class extends EventEmitter2 {
|
|
|
90292
90293
|
* @param event
|
|
90293
90294
|
* @param awfEmit Callback to be called when ready for event to be emitted.
|
|
90294
90295
|
*/
|
|
90295
|
-
_awaitWriteFinish(
|
|
90296
|
+
_awaitWriteFinish(path23, threshold, event, awfEmit) {
|
|
90296
90297
|
const awf = this.options.awaitWriteFinish;
|
|
90297
90298
|
if (typeof awf !== "object")
|
|
90298
90299
|
return;
|
|
90299
90300
|
const pollInterval = awf.pollInterval;
|
|
90300
90301
|
let timeoutHandler;
|
|
90301
|
-
let fullPath =
|
|
90302
|
-
if (this.options.cwd && !sp2.isAbsolute(
|
|
90303
|
-
fullPath = sp2.join(this.options.cwd,
|
|
90302
|
+
let fullPath = path23;
|
|
90303
|
+
if (this.options.cwd && !sp2.isAbsolute(path23)) {
|
|
90304
|
+
fullPath = sp2.join(this.options.cwd, path23);
|
|
90304
90305
|
}
|
|
90305
90306
|
const now = /* @__PURE__ */ new Date();
|
|
90306
90307
|
const writes = this._pendingWrites;
|
|
90307
90308
|
function awaitWriteFinishFn(prevStat) {
|
|
90308
90309
|
statcb(fullPath, (err, curStat) => {
|
|
90309
|
-
if (err || !writes.has(
|
|
90310
|
+
if (err || !writes.has(path23)) {
|
|
90310
90311
|
if (err && err.code !== "ENOENT")
|
|
90311
90312
|
awfEmit(err);
|
|
90312
90313
|
return;
|
|
90313
90314
|
}
|
|
90314
90315
|
const now2 = Number(/* @__PURE__ */ new Date());
|
|
90315
90316
|
if (prevStat && curStat.size !== prevStat.size) {
|
|
90316
|
-
writes.get(
|
|
90317
|
+
writes.get(path23).lastChange = now2;
|
|
90317
90318
|
}
|
|
90318
|
-
const pw = writes.get(
|
|
90319
|
+
const pw = writes.get(path23);
|
|
90319
90320
|
const df = now2 - pw.lastChange;
|
|
90320
90321
|
if (df >= threshold) {
|
|
90321
|
-
writes.delete(
|
|
90322
|
+
writes.delete(path23);
|
|
90322
90323
|
awfEmit(void 0, curStat);
|
|
90323
90324
|
} else {
|
|
90324
90325
|
timeoutHandler = setTimeout(awaitWriteFinishFn, pollInterval, curStat);
|
|
90325
90326
|
}
|
|
90326
90327
|
});
|
|
90327
90328
|
}
|
|
90328
|
-
if (!writes.has(
|
|
90329
|
-
writes.set(
|
|
90329
|
+
if (!writes.has(path23)) {
|
|
90330
|
+
writes.set(path23, {
|
|
90330
90331
|
lastChange: now,
|
|
90331
90332
|
cancelWait: () => {
|
|
90332
|
-
writes.delete(
|
|
90333
|
+
writes.delete(path23);
|
|
90333
90334
|
clearTimeout(timeoutHandler);
|
|
90334
90335
|
return event;
|
|
90335
90336
|
}
|
|
@@ -90340,8 +90341,8 @@ var FSWatcher = class extends EventEmitter2 {
|
|
|
90340
90341
|
/**
|
|
90341
90342
|
* Determines whether user has asked to ignore this path.
|
|
90342
90343
|
*/
|
|
90343
|
-
_isIgnored(
|
|
90344
|
-
if (this.options.atomic && DOT_RE.test(
|
|
90344
|
+
_isIgnored(path23, stats) {
|
|
90345
|
+
if (this.options.atomic && DOT_RE.test(path23))
|
|
90345
90346
|
return true;
|
|
90346
90347
|
if (!this._userIgnored) {
|
|
90347
90348
|
const { cwd } = this.options;
|
|
@@ -90351,17 +90352,17 @@ var FSWatcher = class extends EventEmitter2 {
|
|
|
90351
90352
|
const list3 = [...ignoredPaths.map(normalizeIgnored(cwd)), ...ignored];
|
|
90352
90353
|
this._userIgnored = anymatch(list3, void 0);
|
|
90353
90354
|
}
|
|
90354
|
-
return this._userIgnored(
|
|
90355
|
+
return this._userIgnored(path23, stats);
|
|
90355
90356
|
}
|
|
90356
|
-
_isntIgnored(
|
|
90357
|
-
return !this._isIgnored(
|
|
90357
|
+
_isntIgnored(path23, stat4) {
|
|
90358
|
+
return !this._isIgnored(path23, stat4);
|
|
90358
90359
|
}
|
|
90359
90360
|
/**
|
|
90360
90361
|
* Provides a set of common helpers and properties relating to symlink handling.
|
|
90361
90362
|
* @param path file or directory pattern being watched
|
|
90362
90363
|
*/
|
|
90363
|
-
_getWatchHelpers(
|
|
90364
|
-
return new WatchHelper(
|
|
90364
|
+
_getWatchHelpers(path23) {
|
|
90365
|
+
return new WatchHelper(path23, this.options.followSymlinks, this);
|
|
90365
90366
|
}
|
|
90366
90367
|
// Directory helpers
|
|
90367
90368
|
// -----------------
|
|
@@ -90393,63 +90394,63 @@ var FSWatcher = class extends EventEmitter2 {
|
|
|
90393
90394
|
* @param item base path of item/directory
|
|
90394
90395
|
*/
|
|
90395
90396
|
_remove(directory, item, isDirectory) {
|
|
90396
|
-
const
|
|
90397
|
-
const fullPath = sp2.resolve(
|
|
90398
|
-
isDirectory = isDirectory != null ? isDirectory : this._watched.has(
|
|
90399
|
-
if (!this._throttle("remove",
|
|
90397
|
+
const path23 = sp2.join(directory, item);
|
|
90398
|
+
const fullPath = sp2.resolve(path23);
|
|
90399
|
+
isDirectory = isDirectory != null ? isDirectory : this._watched.has(path23) || this._watched.has(fullPath);
|
|
90400
|
+
if (!this._throttle("remove", path23, 100))
|
|
90400
90401
|
return;
|
|
90401
90402
|
if (!isDirectory && this._watched.size === 1) {
|
|
90402
90403
|
this.add(directory, item, true);
|
|
90403
90404
|
}
|
|
90404
|
-
const wp = this._getWatchedDir(
|
|
90405
|
+
const wp = this._getWatchedDir(path23);
|
|
90405
90406
|
const nestedDirectoryChildren = wp.getChildren();
|
|
90406
|
-
nestedDirectoryChildren.forEach((nested) => this._remove(
|
|
90407
|
+
nestedDirectoryChildren.forEach((nested) => this._remove(path23, nested));
|
|
90407
90408
|
const parent = this._getWatchedDir(directory);
|
|
90408
90409
|
const wasTracked = parent.has(item);
|
|
90409
90410
|
parent.remove(item);
|
|
90410
90411
|
if (this._symlinkPaths.has(fullPath)) {
|
|
90411
90412
|
this._symlinkPaths.delete(fullPath);
|
|
90412
90413
|
}
|
|
90413
|
-
let relPath =
|
|
90414
|
+
let relPath = path23;
|
|
90414
90415
|
if (this.options.cwd)
|
|
90415
|
-
relPath = sp2.relative(this.options.cwd,
|
|
90416
|
+
relPath = sp2.relative(this.options.cwd, path23);
|
|
90416
90417
|
if (this.options.awaitWriteFinish && this._pendingWrites.has(relPath)) {
|
|
90417
90418
|
const event = this._pendingWrites.get(relPath).cancelWait();
|
|
90418
90419
|
if (event === EVENTS.ADD)
|
|
90419
90420
|
return;
|
|
90420
90421
|
}
|
|
90421
|
-
this._watched.delete(
|
|
90422
|
+
this._watched.delete(path23);
|
|
90422
90423
|
this._watched.delete(fullPath);
|
|
90423
90424
|
const eventName = isDirectory ? EVENTS.UNLINK_DIR : EVENTS.UNLINK;
|
|
90424
|
-
if (wasTracked && !this._isIgnored(
|
|
90425
|
-
this._emit(eventName,
|
|
90426
|
-
this._closePath(
|
|
90425
|
+
if (wasTracked && !this._isIgnored(path23))
|
|
90426
|
+
this._emit(eventName, path23);
|
|
90427
|
+
this._closePath(path23);
|
|
90427
90428
|
}
|
|
90428
90429
|
/**
|
|
90429
90430
|
* Closes all watchers for a path
|
|
90430
90431
|
*/
|
|
90431
|
-
_closePath(
|
|
90432
|
-
this._closeFile(
|
|
90433
|
-
const dir = sp2.dirname(
|
|
90434
|
-
this._getWatchedDir(dir).remove(sp2.basename(
|
|
90432
|
+
_closePath(path23) {
|
|
90433
|
+
this._closeFile(path23);
|
|
90434
|
+
const dir = sp2.dirname(path23);
|
|
90435
|
+
this._getWatchedDir(dir).remove(sp2.basename(path23));
|
|
90435
90436
|
}
|
|
90436
90437
|
/**
|
|
90437
90438
|
* Closes only file-specific watchers
|
|
90438
90439
|
*/
|
|
90439
|
-
_closeFile(
|
|
90440
|
-
const closers = this._closers.get(
|
|
90440
|
+
_closeFile(path23) {
|
|
90441
|
+
const closers = this._closers.get(path23);
|
|
90441
90442
|
if (!closers)
|
|
90442
90443
|
return;
|
|
90443
90444
|
closers.forEach((closer) => closer());
|
|
90444
|
-
this._closers.delete(
|
|
90445
|
+
this._closers.delete(path23);
|
|
90445
90446
|
}
|
|
90446
|
-
_addPathCloser(
|
|
90447
|
+
_addPathCloser(path23, closer) {
|
|
90447
90448
|
if (!closer)
|
|
90448
90449
|
return;
|
|
90449
|
-
let list3 = this._closers.get(
|
|
90450
|
+
let list3 = this._closers.get(path23);
|
|
90450
90451
|
if (!list3) {
|
|
90451
90452
|
list3 = [];
|
|
90452
|
-
this._closers.set(
|
|
90453
|
+
this._closers.set(path23, list3);
|
|
90453
90454
|
}
|
|
90454
90455
|
list3.push(closer);
|
|
90455
90456
|
}
|
|
@@ -92384,7 +92385,9 @@ function validateMountManifest(filePath, raw) {
|
|
|
92384
92385
|
if (typeof m["hostPath"] !== "string") {
|
|
92385
92386
|
throw new MountManifestError(filePath, `mounts[${i2}].hostPath must be a string`);
|
|
92386
92387
|
}
|
|
92387
|
-
|
|
92388
|
+
const kind = m["kind"];
|
|
92389
|
+
const isSymlinkOnly = kind === "symlink-only";
|
|
92390
|
+
if (!isSymlinkOnly && typeof m["containerPath"] !== "string") {
|
|
92388
92391
|
throw new MountManifestError(filePath, `mounts[${i2}].containerPath must be a string`);
|
|
92389
92392
|
}
|
|
92390
92393
|
}
|
|
@@ -92625,19 +92628,153 @@ var stdoutSink = (line2) => process.stdout.write(`${line2}
|
|
|
92625
92628
|
`);
|
|
92626
92629
|
var stderrSink = (line2) => process.stderr.write(`${line2}
|
|
92627
92630
|
`);
|
|
92628
|
-
|
|
92629
|
-
const
|
|
92630
|
-
const
|
|
92631
|
-
|
|
92632
|
-
|
|
92633
|
-
|
|
92634
|
-
|
|
92635
|
-
|
|
92636
|
-
|
|
92637
|
-
|
|
92638
|
-
|
|
92639
|
-
|
|
92631
|
+
function mountLabel(m) {
|
|
92632
|
+
const fallbackName = m.containerPath ?? (m.kind === "symlink-only" ? `(symlink) ${m.hostPath}` : m.hostPath);
|
|
92633
|
+
const name = m.meta?.["name"] ?? fallbackName;
|
|
92634
|
+
const type = m.meta?.["type"];
|
|
92635
|
+
return type ? `${name} (${type})` : name;
|
|
92636
|
+
}
|
|
92637
|
+
function isUnmatched(m) {
|
|
92638
|
+
return m.meta?.["unmatched"] === true;
|
|
92639
|
+
}
|
|
92640
|
+
var CUSTOM_PATH_SENTINEL = "__custom__";
|
|
92641
|
+
async function pickSourceForMount(m, prompts) {
|
|
92642
|
+
const alts = m.alternativeSources ?? [];
|
|
92643
|
+
const choices = [
|
|
92644
|
+
...alts.map((s) => ({ name: s, value: s })),
|
|
92645
|
+
{ name: "Custom path...", value: CUSTOM_PATH_SENTINEL }
|
|
92646
|
+
];
|
|
92647
|
+
const chosen = await prompts.select({
|
|
92648
|
+
message: `Source for ${mountLabel(m)}:`,
|
|
92649
|
+
choices,
|
|
92650
|
+
default: alts.includes(m.hostPath) ? m.hostPath : void 0
|
|
92640
92651
|
});
|
|
92652
|
+
if (chosen !== CUSTOM_PATH_SENTINEL) return chosen;
|
|
92653
|
+
return (await prompts.input({
|
|
92654
|
+
message: "Host path (absolute):",
|
|
92655
|
+
validate: (v) => v.trim().length > 0 && path20.isAbsolute(v.trim()) ? true : "must be an absolute path"
|
|
92656
|
+
})).trim();
|
|
92657
|
+
}
|
|
92658
|
+
async function pickMounts(candidates) {
|
|
92659
|
+
const { checkbox, confirm, input, select } = await import("@inquirer/prompts");
|
|
92660
|
+
const prompts = { select, input };
|
|
92661
|
+
let selected = [];
|
|
92662
|
+
if (candidates.length > 0) {
|
|
92663
|
+
const choices = candidates.map((m) => {
|
|
92664
|
+
const unmatched = isUnmatched(m);
|
|
92665
|
+
const suffix = unmatched ? " (no source found \u2014 pick one)" : ` ${m.hostPath}`;
|
|
92666
|
+
return {
|
|
92667
|
+
name: `${mountLabel(m)}${suffix}`,
|
|
92668
|
+
value: m,
|
|
92669
|
+
checked: !unmatched
|
|
92670
|
+
};
|
|
92671
|
+
});
|
|
92672
|
+
selected = await checkbox({ message: "Select mounts to apply:", choices });
|
|
92673
|
+
}
|
|
92674
|
+
const unmatchedRows = selected.filter(isUnmatched);
|
|
92675
|
+
const matchedWithAlts = selected.filter(
|
|
92676
|
+
(m) => !isUnmatched(m) && (m.alternativeSources?.length ?? 0) > 0
|
|
92677
|
+
);
|
|
92678
|
+
for (const m of unmatchedRows) {
|
|
92679
|
+
const chosen = await pickSourceForMount(m, prompts);
|
|
92680
|
+
const next = { ...m, hostPath: chosen };
|
|
92681
|
+
if (next.meta && "unmatched" in next.meta) {
|
|
92682
|
+
const cleaned = { ...next.meta };
|
|
92683
|
+
delete cleaned["unmatched"];
|
|
92684
|
+
next.meta = cleaned;
|
|
92685
|
+
}
|
|
92686
|
+
const idx = selected.indexOf(m);
|
|
92687
|
+
if (idx >= 0) selected[idx] = next;
|
|
92688
|
+
}
|
|
92689
|
+
const overridable = matchedWithAlts;
|
|
92690
|
+
if (overridable.length > 0) {
|
|
92691
|
+
const wantOverride = await confirm({
|
|
92692
|
+
message: "Override the source dir for any of the selected mounts?",
|
|
92693
|
+
default: false
|
|
92694
|
+
});
|
|
92695
|
+
if (wantOverride) {
|
|
92696
|
+
const toEdit = await checkbox({
|
|
92697
|
+
message: "Pick the mounts whose source you want to change:",
|
|
92698
|
+
choices: overridable.map((m) => ({
|
|
92699
|
+
name: `${mountLabel(m)} (current: ${m.hostPath})`,
|
|
92700
|
+
value: m,
|
|
92701
|
+
checked: false
|
|
92702
|
+
}))
|
|
92703
|
+
});
|
|
92704
|
+
for (const m of toEdit) {
|
|
92705
|
+
const chosen = await pickSourceForMount(m, prompts);
|
|
92706
|
+
const idx = selected.indexOf(m);
|
|
92707
|
+
if (idx >= 0) selected[idx] = { ...m, hostPath: chosen };
|
|
92708
|
+
}
|
|
92709
|
+
}
|
|
92710
|
+
}
|
|
92711
|
+
const knownContainerPaths = Array.from(
|
|
92712
|
+
new Set(
|
|
92713
|
+
candidates.map((c3) => c3.containerPath).filter((p) => typeof p === "string" && p.length > 0)
|
|
92714
|
+
)
|
|
92715
|
+
);
|
|
92716
|
+
const knownHostPaths = Array.from(new Set(candidates.flatMap((c3) => c3.alternativeSources ?? [])));
|
|
92717
|
+
while (await confirm({
|
|
92718
|
+
message: candidates.length === 0 ? "Add a custom mount?" : "Add another (custom) mount?",
|
|
92719
|
+
default: false
|
|
92720
|
+
})) {
|
|
92721
|
+
let hostPath;
|
|
92722
|
+
if (knownHostPaths.length > 0) {
|
|
92723
|
+
const picked = await select({
|
|
92724
|
+
message: "Host path:",
|
|
92725
|
+
choices: [
|
|
92726
|
+
...knownHostPaths.map((s) => ({ name: s, value: s })),
|
|
92727
|
+
{ name: "Custom path...", value: CUSTOM_PATH_SENTINEL }
|
|
92728
|
+
]
|
|
92729
|
+
});
|
|
92730
|
+
if (picked === CUSTOM_PATH_SENTINEL) {
|
|
92731
|
+
hostPath = (await input({
|
|
92732
|
+
message: "Host path (absolute):",
|
|
92733
|
+
validate: (v) => v.trim().length > 0 && path20.isAbsolute(v.trim()) ? true : "must be an absolute path"
|
|
92734
|
+
})).trim();
|
|
92735
|
+
} else {
|
|
92736
|
+
hostPath = picked;
|
|
92737
|
+
}
|
|
92738
|
+
} else {
|
|
92739
|
+
hostPath = (await input({
|
|
92740
|
+
message: "Host path (absolute):",
|
|
92741
|
+
validate: (v) => v.trim().length > 0 && path20.isAbsolute(v.trim()) ? true : "must be an absolute path"
|
|
92742
|
+
})).trim();
|
|
92743
|
+
}
|
|
92744
|
+
let containerPath;
|
|
92745
|
+
if (knownContainerPaths.length > 0) {
|
|
92746
|
+
const picked = await select({
|
|
92747
|
+
message: "Container path:",
|
|
92748
|
+
choices: [
|
|
92749
|
+
...knownContainerPaths.map((p) => ({ name: p, value: p })),
|
|
92750
|
+
{ name: "Custom path...", value: CUSTOM_PATH_SENTINEL }
|
|
92751
|
+
]
|
|
92752
|
+
});
|
|
92753
|
+
if (picked === CUSTOM_PATH_SENTINEL) {
|
|
92754
|
+
containerPath = (await input({
|
|
92755
|
+
message: "Container path (absolute):",
|
|
92756
|
+
validate: (v) => v.trim().length > 0 && path20.isAbsolute(v.trim()) ? true : "must be an absolute path"
|
|
92757
|
+
})).trim();
|
|
92758
|
+
} else {
|
|
92759
|
+
containerPath = picked;
|
|
92760
|
+
}
|
|
92761
|
+
} else {
|
|
92762
|
+
containerPath = (await input({
|
|
92763
|
+
message: "Container path (absolute):",
|
|
92764
|
+
validate: (v) => v.trim().length > 0 && path20.isAbsolute(v.trim()) ? true : "must be an absolute path"
|
|
92765
|
+
})).trim();
|
|
92766
|
+
}
|
|
92767
|
+
const name = (await input({
|
|
92768
|
+
message: "Name (optional, used for status table + log lines):"
|
|
92769
|
+
})).trim();
|
|
92770
|
+
selected.push({
|
|
92771
|
+
hostPath,
|
|
92772
|
+
containerPath,
|
|
92773
|
+
kind: "bind",
|
|
92774
|
+
...name ? { meta: { name } } : {}
|
|
92775
|
+
});
|
|
92776
|
+
}
|
|
92777
|
+
return selected;
|
|
92641
92778
|
}
|
|
92642
92779
|
async function mountCommand(opts = {}) {
|
|
92643
92780
|
const ctx = await resolveContext(opts);
|
|
@@ -92652,20 +92789,25 @@ async function mountCommand(opts = {}) {
|
|
|
92652
92789
|
profile
|
|
92653
92790
|
} = ctx;
|
|
92654
92791
|
const merged = mergeMounts(configMounts, providerMounts);
|
|
92655
|
-
if (merged.length === 0) {
|
|
92656
|
-
process.stdout.write(
|
|
92657
|
-
"dev-cockpit mount: no mount candidates from config.mounts[] or profile.mountCandidatesProvider.\n"
|
|
92658
|
-
);
|
|
92659
|
-
return;
|
|
92660
|
-
}
|
|
92661
92792
|
let selected;
|
|
92662
92793
|
if (opts.quiet || configMounts.length > 0 && providerMounts.length === 0) {
|
|
92794
|
+
if (merged.length === 0) {
|
|
92795
|
+
process.stdout.write(
|
|
92796
|
+
"dev-cockpit mount: no mount candidates from config.mounts[] or profile.mountCandidatesProvider.\n"
|
|
92797
|
+
);
|
|
92798
|
+
return;
|
|
92799
|
+
}
|
|
92663
92800
|
selected = merged;
|
|
92664
92801
|
if (opts.quiet) {
|
|
92665
92802
|
process.stdout.write(`dev-cockpit mount: applying all ${selected.length} candidate(s).
|
|
92666
92803
|
`);
|
|
92667
92804
|
}
|
|
92668
92805
|
} else {
|
|
92806
|
+
if (merged.length === 0) {
|
|
92807
|
+
process.stdout.write(
|
|
92808
|
+
"dev-cockpit mount: no mount candidates discovered. You can add custom mounts interactively below, or Ctrl-C to bail.\n"
|
|
92809
|
+
);
|
|
92810
|
+
}
|
|
92669
92811
|
selected = await pickMounts(merged);
|
|
92670
92812
|
if (selected.length === 0) {
|
|
92671
92813
|
process.stdout.write("dev-cockpit mount: nothing selected; nothing to apply.\n");
|
|
@@ -93005,6 +93147,75 @@ function findHostClones(opts) {
|
|
|
93005
93147
|
}
|
|
93006
93148
|
return found;
|
|
93007
93149
|
}
|
|
93150
|
+
|
|
93151
|
+
// src/mount/health-check.ts
|
|
93152
|
+
import path22 from "node:path";
|
|
93153
|
+
var DEFAULT_REMEDIATION = {
|
|
93154
|
+
key: "F",
|
|
93155
|
+
label: "mount apply",
|
|
93156
|
+
command: "dev-cockpit mount"
|
|
93157
|
+
};
|
|
93158
|
+
function createMountBrokenSymlinkCheck(opts) {
|
|
93159
|
+
const id = opts.id ?? "mount-broken-symlink";
|
|
93160
|
+
const label = opts.label ?? "Mount symlinks";
|
|
93161
|
+
const severity = opts.severity ?? "error";
|
|
93162
|
+
const triggers = opts.triggers ?? ["startup", "fsevent"];
|
|
93163
|
+
const remediation = opts.remediation ?? DEFAULT_REMEDIATION;
|
|
93164
|
+
const remediationKey = remediation.key;
|
|
93165
|
+
const predicate = async (ctx) => {
|
|
93166
|
+
const { workspaceRoot } = ctx;
|
|
93167
|
+
let manifestPath2;
|
|
93168
|
+
try {
|
|
93169
|
+
const { configPath } = discoverConfig({
|
|
93170
|
+
workspaceDiscoverer: () => ({ root: workspaceRoot })
|
|
93171
|
+
});
|
|
93172
|
+
const config = loadConfig(configPath);
|
|
93173
|
+
const paths = getStatePaths(workspaceRoot, { appName: config.appName });
|
|
93174
|
+
manifestPath2 = path22.join(paths.stateDir, config.mount.manifestFile);
|
|
93175
|
+
} catch (err) {
|
|
93176
|
+
if (err instanceof DiscoveryError) {
|
|
93177
|
+
return { id, label, severity: "ok", detail: "no cockpit.yaml found", remediationKey };
|
|
93178
|
+
}
|
|
93179
|
+
throw err;
|
|
93180
|
+
}
|
|
93181
|
+
let mounts;
|
|
93182
|
+
try {
|
|
93183
|
+
const manifest = readMountManifest(manifestPath2);
|
|
93184
|
+
mounts = manifest?.mounts ?? [];
|
|
93185
|
+
} catch {
|
|
93186
|
+
return {
|
|
93187
|
+
id,
|
|
93188
|
+
label,
|
|
93189
|
+
severity: "warn",
|
|
93190
|
+
detail: "mount manifest could not be read",
|
|
93191
|
+
remediationKey
|
|
93192
|
+
};
|
|
93193
|
+
}
|
|
93194
|
+
if (mounts.length === 0) {
|
|
93195
|
+
return { id, label, severity: "ok", detail: "no active mounts", remediationKey };
|
|
93196
|
+
}
|
|
93197
|
+
const broken = detectBrokenSymlinks(workspaceRoot, mounts, opts.symlinks);
|
|
93198
|
+
if (broken.length === 0) {
|
|
93199
|
+
return {
|
|
93200
|
+
id,
|
|
93201
|
+
label,
|
|
93202
|
+
severity: "ok",
|
|
93203
|
+
detail: `${mounts.length} symlink(s) healthy`,
|
|
93204
|
+
remediationKey
|
|
93205
|
+
};
|
|
93206
|
+
}
|
|
93207
|
+
const namesFor = (reason) => broken.filter((b) => b.reason === reason).map(
|
|
93208
|
+
(b) => b.mount.meta?.["name"] ?? b.mount.containerPath ?? b.mount.hostPath
|
|
93209
|
+
).join(", ");
|
|
93210
|
+
const parts = [];
|
|
93211
|
+
const brokenNames = namesFor("broken");
|
|
93212
|
+
const missingNames = namesFor("missing");
|
|
93213
|
+
if (brokenNames) parts.push(`broken (target missing): ${brokenNames}`);
|
|
93214
|
+
if (missingNames) parts.push(`not applied (no symlink): ${missingNames}`);
|
|
93215
|
+
return { id, label, severity, detail: parts.join("; "), remediationKey };
|
|
93216
|
+
};
|
|
93217
|
+
return { id, label, severity, triggers, predicate, remediation };
|
|
93218
|
+
}
|
|
93008
93219
|
export {
|
|
93009
93220
|
BUILTIN_CHECK_FACTORIES,
|
|
93010
93221
|
BUILTIN_DEFAULT_SEVERITY,
|
|
@@ -93046,6 +93257,7 @@ export {
|
|
|
93046
93257
|
cockpitStore,
|
|
93047
93258
|
compileHighlights,
|
|
93048
93259
|
createLogger,
|
|
93260
|
+
createMountBrokenSymlinkCheck,
|
|
93049
93261
|
deleteMountManifest,
|
|
93050
93262
|
detectBrokenSymlinks,
|
|
93051
93263
|
detectTransitions,
|