xtrm-tools 2.1.10 → 2.1.12
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/cli/dist/index.cjs +566 -473
- package/cli/dist/index.cjs.map +1 -1
- package/cli/package.json +1 -1
- package/config/pi/auth.json.template +14 -0
- package/config/pi/extensions/auto-session-name.ts +29 -0
- package/config/pi/extensions/auto-update.ts +71 -0
- package/config/pi/extensions/bg-process.ts +230 -0
- package/config/pi/extensions/compact-header.ts +69 -0
- package/config/pi/extensions/custom-footer.ts +95 -0
- package/config/pi/extensions/custom-provider-qwen-cli/index.ts +363 -0
- package/config/pi/extensions/custom-provider-qwen-cli/package.json +1 -0
- package/config/pi/extensions/git-checkpoint.ts +53 -0
- package/config/pi/extensions/git-guard.ts +45 -0
- package/config/pi/extensions/safe-guard.ts +46 -0
- package/config/pi/extensions/todo.ts +299 -0
- package/config/pi/install-schema.json +41 -0
- package/config/pi/models.json.template +76 -0
- package/config/pi/settings.json.template +15 -0
- package/package.json +1 -1
package/cli/dist/index.cjs
CHANGED
|
@@ -1202,8 +1202,8 @@ var require_command = __commonJS({
|
|
|
1202
1202
|
"use strict";
|
|
1203
1203
|
var EventEmitter2 = require("events").EventEmitter;
|
|
1204
1204
|
var childProcess = require("child_process");
|
|
1205
|
-
var
|
|
1206
|
-
var
|
|
1205
|
+
var path17 = require("path");
|
|
1206
|
+
var fs18 = require("fs");
|
|
1207
1207
|
var process19 = require("process");
|
|
1208
1208
|
var { Argument: Argument2, humanReadableArgName } = require_argument();
|
|
1209
1209
|
var { CommanderError: CommanderError2 } = require_error();
|
|
@@ -2197,7 +2197,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2197
2197
|
* @param {string} subcommandName
|
|
2198
2198
|
*/
|
|
2199
2199
|
_checkForMissingExecutable(executableFile, executableDir, subcommandName) {
|
|
2200
|
-
if (
|
|
2200
|
+
if (fs18.existsSync(executableFile)) return;
|
|
2201
2201
|
const executableDirMessage = executableDir ? `searched for local subcommand relative to directory '${executableDir}'` : "no directory for search for local subcommand, use .executableDir() to supply a custom directory";
|
|
2202
2202
|
const executableMissing = `'${executableFile}' does not exist
|
|
2203
2203
|
- if '${subcommandName}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
|
|
@@ -2215,11 +2215,11 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2215
2215
|
let launchWithNode = false;
|
|
2216
2216
|
const sourceExt = [".js", ".ts", ".tsx", ".mjs", ".cjs"];
|
|
2217
2217
|
function findFile(baseDir, baseName) {
|
|
2218
|
-
const localBin =
|
|
2219
|
-
if (
|
|
2220
|
-
if (sourceExt.includes(
|
|
2218
|
+
const localBin = path17.resolve(baseDir, baseName);
|
|
2219
|
+
if (fs18.existsSync(localBin)) return localBin;
|
|
2220
|
+
if (sourceExt.includes(path17.extname(baseName))) return void 0;
|
|
2221
2221
|
const foundExt = sourceExt.find(
|
|
2222
|
-
(ext) =>
|
|
2222
|
+
(ext) => fs18.existsSync(`${localBin}${ext}`)
|
|
2223
2223
|
);
|
|
2224
2224
|
if (foundExt) return `${localBin}${foundExt}`;
|
|
2225
2225
|
return void 0;
|
|
@@ -2231,21 +2231,21 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2231
2231
|
if (this._scriptPath) {
|
|
2232
2232
|
let resolvedScriptPath;
|
|
2233
2233
|
try {
|
|
2234
|
-
resolvedScriptPath =
|
|
2234
|
+
resolvedScriptPath = fs18.realpathSync(this._scriptPath);
|
|
2235
2235
|
} catch {
|
|
2236
2236
|
resolvedScriptPath = this._scriptPath;
|
|
2237
2237
|
}
|
|
2238
|
-
executableDir =
|
|
2239
|
-
|
|
2238
|
+
executableDir = path17.resolve(
|
|
2239
|
+
path17.dirname(resolvedScriptPath),
|
|
2240
2240
|
executableDir
|
|
2241
2241
|
);
|
|
2242
2242
|
}
|
|
2243
2243
|
if (executableDir) {
|
|
2244
2244
|
let localFile = findFile(executableDir, executableFile);
|
|
2245
2245
|
if (!localFile && !subcommand._executableFile && this._scriptPath) {
|
|
2246
|
-
const legacyName =
|
|
2246
|
+
const legacyName = path17.basename(
|
|
2247
2247
|
this._scriptPath,
|
|
2248
|
-
|
|
2248
|
+
path17.extname(this._scriptPath)
|
|
2249
2249
|
);
|
|
2250
2250
|
if (legacyName !== this._name) {
|
|
2251
2251
|
localFile = findFile(
|
|
@@ -2256,7 +2256,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2256
2256
|
}
|
|
2257
2257
|
executableFile = localFile || executableFile;
|
|
2258
2258
|
}
|
|
2259
|
-
launchWithNode = sourceExt.includes(
|
|
2259
|
+
launchWithNode = sourceExt.includes(path17.extname(executableFile));
|
|
2260
2260
|
let proc;
|
|
2261
2261
|
if (process19.platform !== "win32") {
|
|
2262
2262
|
if (launchWithNode) {
|
|
@@ -3171,7 +3171,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
3171
3171
|
* @return {Command}
|
|
3172
3172
|
*/
|
|
3173
3173
|
nameFromFilename(filename) {
|
|
3174
|
-
this._name =
|
|
3174
|
+
this._name = path17.basename(filename, path17.extname(filename));
|
|
3175
3175
|
return this;
|
|
3176
3176
|
}
|
|
3177
3177
|
/**
|
|
@@ -3185,9 +3185,9 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
3185
3185
|
* @param {string} [path]
|
|
3186
3186
|
* @return {(string|null|Command)}
|
|
3187
3187
|
*/
|
|
3188
|
-
executableDir(
|
|
3189
|
-
if (
|
|
3190
|
-
this._executableDir =
|
|
3188
|
+
executableDir(path18) {
|
|
3189
|
+
if (path18 === void 0) return this._executableDir;
|
|
3190
|
+
this._executableDir = path18;
|
|
3191
3191
|
return this;
|
|
3192
3192
|
}
|
|
3193
3193
|
/**
|
|
@@ -6053,7 +6053,7 @@ var require_dist = __commonJS({
|
|
|
6053
6053
|
});
|
|
6054
6054
|
};
|
|
6055
6055
|
}
|
|
6056
|
-
var
|
|
6056
|
+
var prompts5 = require_prompts();
|
|
6057
6057
|
var passOn = ["suggest", "format", "onState", "validate", "onRender", "type"];
|
|
6058
6058
|
var noop = () => {
|
|
6059
6059
|
};
|
|
@@ -6104,7 +6104,7 @@ var require_dist = __commonJS({
|
|
|
6104
6104
|
var _question2 = question;
|
|
6105
6105
|
name = _question2.name;
|
|
6106
6106
|
type = _question2.type;
|
|
6107
|
-
if (
|
|
6107
|
+
if (prompts5[type] === void 0) {
|
|
6108
6108
|
throw new Error(`prompt type (${type}) is not defined`);
|
|
6109
6109
|
}
|
|
6110
6110
|
if (override2[question.name] !== void 0) {
|
|
@@ -6115,7 +6115,7 @@ var require_dist = __commonJS({
|
|
|
6115
6115
|
}
|
|
6116
6116
|
}
|
|
6117
6117
|
try {
|
|
6118
|
-
answer = prompt._injected ? getInjectedAnswer(prompt._injected, question.initial) : yield
|
|
6118
|
+
answer = prompt._injected ? getInjectedAnswer(prompt._injected, question.initial) : yield prompts5[type](question);
|
|
6119
6119
|
answers[name] = answer = yield getFormattedAnswer(question, answer, true);
|
|
6120
6120
|
quit = yield onSubmit(question, answer, answers);
|
|
6121
6121
|
} catch (err) {
|
|
@@ -6147,7 +6147,7 @@ var require_dist = __commonJS({
|
|
|
6147
6147
|
}
|
|
6148
6148
|
module2.exports = Object.assign(prompt, {
|
|
6149
6149
|
prompt,
|
|
6150
|
-
prompts:
|
|
6150
|
+
prompts: prompts5,
|
|
6151
6151
|
inject,
|
|
6152
6152
|
override
|
|
6153
6153
|
});
|
|
@@ -8234,7 +8234,7 @@ var require_prompts2 = __commonJS({
|
|
|
8234
8234
|
var require_lib = __commonJS({
|
|
8235
8235
|
"../node_modules/prompts/lib/index.js"(exports2, module2) {
|
|
8236
8236
|
"use strict";
|
|
8237
|
-
var
|
|
8237
|
+
var prompts5 = require_prompts2();
|
|
8238
8238
|
var passOn = ["suggest", "format", "onState", "validate", "onRender", "type"];
|
|
8239
8239
|
var noop = () => {
|
|
8240
8240
|
};
|
|
@@ -8266,7 +8266,7 @@ var require_lib = __commonJS({
|
|
|
8266
8266
|
throw new Error("prompt message is required");
|
|
8267
8267
|
}
|
|
8268
8268
|
({ name, type } = question);
|
|
8269
|
-
if (
|
|
8269
|
+
if (prompts5[type] === void 0) {
|
|
8270
8270
|
throw new Error(`prompt type (${type}) is not defined`);
|
|
8271
8271
|
}
|
|
8272
8272
|
if (override2[question.name] !== void 0) {
|
|
@@ -8277,7 +8277,7 @@ var require_lib = __commonJS({
|
|
|
8277
8277
|
}
|
|
8278
8278
|
}
|
|
8279
8279
|
try {
|
|
8280
|
-
answer = prompt._injected ? getInjectedAnswer(prompt._injected, question.initial) : await
|
|
8280
|
+
answer = prompt._injected ? getInjectedAnswer(prompt._injected, question.initial) : await prompts5[type](question);
|
|
8281
8281
|
answers[name] = answer = await getFormattedAnswer(question, answer, true);
|
|
8282
8282
|
quit = await onSubmit(question, answer, answers);
|
|
8283
8283
|
} catch (err) {
|
|
@@ -8300,7 +8300,7 @@ var require_lib = __commonJS({
|
|
|
8300
8300
|
function override(answers) {
|
|
8301
8301
|
prompt._override = Object.assign({}, answers);
|
|
8302
8302
|
}
|
|
8303
|
-
module2.exports = Object.assign(prompt, { prompt, prompts:
|
|
8303
|
+
module2.exports = Object.assign(prompt, { prompt, prompts: prompts5, inject, override });
|
|
8304
8304
|
}
|
|
8305
8305
|
});
|
|
8306
8306
|
|
|
@@ -11639,54 +11639,54 @@ var require_polyfills = __commonJS({
|
|
|
11639
11639
|
}
|
|
11640
11640
|
var chdir;
|
|
11641
11641
|
module2.exports = patch;
|
|
11642
|
-
function patch(
|
|
11642
|
+
function patch(fs18) {
|
|
11643
11643
|
if (constants.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) {
|
|
11644
|
-
patchLchmod(
|
|
11645
|
-
}
|
|
11646
|
-
if (!
|
|
11647
|
-
patchLutimes(
|
|
11648
|
-
}
|
|
11649
|
-
|
|
11650
|
-
|
|
11651
|
-
|
|
11652
|
-
|
|
11653
|
-
|
|
11654
|
-
|
|
11655
|
-
|
|
11656
|
-
|
|
11657
|
-
|
|
11658
|
-
|
|
11659
|
-
|
|
11660
|
-
|
|
11661
|
-
|
|
11662
|
-
|
|
11663
|
-
|
|
11664
|
-
|
|
11665
|
-
|
|
11666
|
-
|
|
11667
|
-
if (
|
|
11668
|
-
|
|
11644
|
+
patchLchmod(fs18);
|
|
11645
|
+
}
|
|
11646
|
+
if (!fs18.lutimes) {
|
|
11647
|
+
patchLutimes(fs18);
|
|
11648
|
+
}
|
|
11649
|
+
fs18.chown = chownFix(fs18.chown);
|
|
11650
|
+
fs18.fchown = chownFix(fs18.fchown);
|
|
11651
|
+
fs18.lchown = chownFix(fs18.lchown);
|
|
11652
|
+
fs18.chmod = chmodFix(fs18.chmod);
|
|
11653
|
+
fs18.fchmod = chmodFix(fs18.fchmod);
|
|
11654
|
+
fs18.lchmod = chmodFix(fs18.lchmod);
|
|
11655
|
+
fs18.chownSync = chownFixSync(fs18.chownSync);
|
|
11656
|
+
fs18.fchownSync = chownFixSync(fs18.fchownSync);
|
|
11657
|
+
fs18.lchownSync = chownFixSync(fs18.lchownSync);
|
|
11658
|
+
fs18.chmodSync = chmodFixSync(fs18.chmodSync);
|
|
11659
|
+
fs18.fchmodSync = chmodFixSync(fs18.fchmodSync);
|
|
11660
|
+
fs18.lchmodSync = chmodFixSync(fs18.lchmodSync);
|
|
11661
|
+
fs18.stat = statFix(fs18.stat);
|
|
11662
|
+
fs18.fstat = statFix(fs18.fstat);
|
|
11663
|
+
fs18.lstat = statFix(fs18.lstat);
|
|
11664
|
+
fs18.statSync = statFixSync(fs18.statSync);
|
|
11665
|
+
fs18.fstatSync = statFixSync(fs18.fstatSync);
|
|
11666
|
+
fs18.lstatSync = statFixSync(fs18.lstatSync);
|
|
11667
|
+
if (fs18.chmod && !fs18.lchmod) {
|
|
11668
|
+
fs18.lchmod = function(path17, mode, cb) {
|
|
11669
11669
|
if (cb) process.nextTick(cb);
|
|
11670
11670
|
};
|
|
11671
|
-
|
|
11671
|
+
fs18.lchmodSync = function() {
|
|
11672
11672
|
};
|
|
11673
11673
|
}
|
|
11674
|
-
if (
|
|
11675
|
-
|
|
11674
|
+
if (fs18.chown && !fs18.lchown) {
|
|
11675
|
+
fs18.lchown = function(path17, uid, gid, cb) {
|
|
11676
11676
|
if (cb) process.nextTick(cb);
|
|
11677
11677
|
};
|
|
11678
|
-
|
|
11678
|
+
fs18.lchownSync = function() {
|
|
11679
11679
|
};
|
|
11680
11680
|
}
|
|
11681
11681
|
if (platform2 === "win32") {
|
|
11682
|
-
|
|
11682
|
+
fs18.rename = typeof fs18.rename !== "function" ? fs18.rename : (function(fs$rename) {
|
|
11683
11683
|
function rename(from, to, cb) {
|
|
11684
11684
|
var start = Date.now();
|
|
11685
11685
|
var backoff = 0;
|
|
11686
11686
|
fs$rename(from, to, function CB(er) {
|
|
11687
11687
|
if (er && (er.code === "EACCES" || er.code === "EPERM" || er.code === "EBUSY") && Date.now() - start < 6e4) {
|
|
11688
11688
|
setTimeout(function() {
|
|
11689
|
-
|
|
11689
|
+
fs18.stat(to, function(stater, st) {
|
|
11690
11690
|
if (stater && stater.code === "ENOENT")
|
|
11691
11691
|
fs$rename(from, to, CB);
|
|
11692
11692
|
else
|
|
@@ -11702,9 +11702,9 @@ var require_polyfills = __commonJS({
|
|
|
11702
11702
|
}
|
|
11703
11703
|
if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename);
|
|
11704
11704
|
return rename;
|
|
11705
|
-
})(
|
|
11705
|
+
})(fs18.rename);
|
|
11706
11706
|
}
|
|
11707
|
-
|
|
11707
|
+
fs18.read = typeof fs18.read !== "function" ? fs18.read : (function(fs$read) {
|
|
11708
11708
|
function read(fd, buffer, offset, length, position, callback_) {
|
|
11709
11709
|
var callback;
|
|
11710
11710
|
if (callback_ && typeof callback_ === "function") {
|
|
@@ -11712,22 +11712,22 @@ var require_polyfills = __commonJS({
|
|
|
11712
11712
|
callback = function(er, _, __) {
|
|
11713
11713
|
if (er && er.code === "EAGAIN" && eagCounter < 10) {
|
|
11714
11714
|
eagCounter++;
|
|
11715
|
-
return fs$read.call(
|
|
11715
|
+
return fs$read.call(fs18, fd, buffer, offset, length, position, callback);
|
|
11716
11716
|
}
|
|
11717
11717
|
callback_.apply(this, arguments);
|
|
11718
11718
|
};
|
|
11719
11719
|
}
|
|
11720
|
-
return fs$read.call(
|
|
11720
|
+
return fs$read.call(fs18, fd, buffer, offset, length, position, callback);
|
|
11721
11721
|
}
|
|
11722
11722
|
if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read);
|
|
11723
11723
|
return read;
|
|
11724
|
-
})(
|
|
11725
|
-
|
|
11724
|
+
})(fs18.read);
|
|
11725
|
+
fs18.readSync = typeof fs18.readSync !== "function" ? fs18.readSync : /* @__PURE__ */ (function(fs$readSync) {
|
|
11726
11726
|
return function(fd, buffer, offset, length, position) {
|
|
11727
11727
|
var eagCounter = 0;
|
|
11728
11728
|
while (true) {
|
|
11729
11729
|
try {
|
|
11730
|
-
return fs$readSync.call(
|
|
11730
|
+
return fs$readSync.call(fs18, fd, buffer, offset, length, position);
|
|
11731
11731
|
} catch (er) {
|
|
11732
11732
|
if (er.code === "EAGAIN" && eagCounter < 10) {
|
|
11733
11733
|
eagCounter++;
|
|
@@ -11737,11 +11737,11 @@ var require_polyfills = __commonJS({
|
|
|
11737
11737
|
}
|
|
11738
11738
|
}
|
|
11739
11739
|
};
|
|
11740
|
-
})(
|
|
11741
|
-
function patchLchmod(
|
|
11742
|
-
|
|
11743
|
-
|
|
11744
|
-
|
|
11740
|
+
})(fs18.readSync);
|
|
11741
|
+
function patchLchmod(fs19) {
|
|
11742
|
+
fs19.lchmod = function(path17, mode, callback) {
|
|
11743
|
+
fs19.open(
|
|
11744
|
+
path17,
|
|
11745
11745
|
constants.O_WRONLY | constants.O_SYMLINK,
|
|
11746
11746
|
mode,
|
|
11747
11747
|
function(err, fd) {
|
|
@@ -11749,80 +11749,80 @@ var require_polyfills = __commonJS({
|
|
|
11749
11749
|
if (callback) callback(err);
|
|
11750
11750
|
return;
|
|
11751
11751
|
}
|
|
11752
|
-
|
|
11753
|
-
|
|
11752
|
+
fs19.fchmod(fd, mode, function(err2) {
|
|
11753
|
+
fs19.close(fd, function(err22) {
|
|
11754
11754
|
if (callback) callback(err2 || err22);
|
|
11755
11755
|
});
|
|
11756
11756
|
});
|
|
11757
11757
|
}
|
|
11758
11758
|
);
|
|
11759
11759
|
};
|
|
11760
|
-
|
|
11761
|
-
var fd =
|
|
11760
|
+
fs19.lchmodSync = function(path17, mode) {
|
|
11761
|
+
var fd = fs19.openSync(path17, constants.O_WRONLY | constants.O_SYMLINK, mode);
|
|
11762
11762
|
var threw = true;
|
|
11763
11763
|
var ret;
|
|
11764
11764
|
try {
|
|
11765
|
-
ret =
|
|
11765
|
+
ret = fs19.fchmodSync(fd, mode);
|
|
11766
11766
|
threw = false;
|
|
11767
11767
|
} finally {
|
|
11768
11768
|
if (threw) {
|
|
11769
11769
|
try {
|
|
11770
|
-
|
|
11770
|
+
fs19.closeSync(fd);
|
|
11771
11771
|
} catch (er) {
|
|
11772
11772
|
}
|
|
11773
11773
|
} else {
|
|
11774
|
-
|
|
11774
|
+
fs19.closeSync(fd);
|
|
11775
11775
|
}
|
|
11776
11776
|
}
|
|
11777
11777
|
return ret;
|
|
11778
11778
|
};
|
|
11779
11779
|
}
|
|
11780
|
-
function patchLutimes(
|
|
11781
|
-
if (constants.hasOwnProperty("O_SYMLINK") &&
|
|
11782
|
-
|
|
11783
|
-
|
|
11780
|
+
function patchLutimes(fs19) {
|
|
11781
|
+
if (constants.hasOwnProperty("O_SYMLINK") && fs19.futimes) {
|
|
11782
|
+
fs19.lutimes = function(path17, at, mt, cb) {
|
|
11783
|
+
fs19.open(path17, constants.O_SYMLINK, function(er, fd) {
|
|
11784
11784
|
if (er) {
|
|
11785
11785
|
if (cb) cb(er);
|
|
11786
11786
|
return;
|
|
11787
11787
|
}
|
|
11788
|
-
|
|
11789
|
-
|
|
11788
|
+
fs19.futimes(fd, at, mt, function(er2) {
|
|
11789
|
+
fs19.close(fd, function(er22) {
|
|
11790
11790
|
if (cb) cb(er2 || er22);
|
|
11791
11791
|
});
|
|
11792
11792
|
});
|
|
11793
11793
|
});
|
|
11794
11794
|
};
|
|
11795
|
-
|
|
11796
|
-
var fd =
|
|
11795
|
+
fs19.lutimesSync = function(path17, at, mt) {
|
|
11796
|
+
var fd = fs19.openSync(path17, constants.O_SYMLINK);
|
|
11797
11797
|
var ret;
|
|
11798
11798
|
var threw = true;
|
|
11799
11799
|
try {
|
|
11800
|
-
ret =
|
|
11800
|
+
ret = fs19.futimesSync(fd, at, mt);
|
|
11801
11801
|
threw = false;
|
|
11802
11802
|
} finally {
|
|
11803
11803
|
if (threw) {
|
|
11804
11804
|
try {
|
|
11805
|
-
|
|
11805
|
+
fs19.closeSync(fd);
|
|
11806
11806
|
} catch (er) {
|
|
11807
11807
|
}
|
|
11808
11808
|
} else {
|
|
11809
|
-
|
|
11809
|
+
fs19.closeSync(fd);
|
|
11810
11810
|
}
|
|
11811
11811
|
}
|
|
11812
11812
|
return ret;
|
|
11813
11813
|
};
|
|
11814
|
-
} else if (
|
|
11815
|
-
|
|
11814
|
+
} else if (fs19.futimes) {
|
|
11815
|
+
fs19.lutimes = function(_a2, _b, _c, cb) {
|
|
11816
11816
|
if (cb) process.nextTick(cb);
|
|
11817
11817
|
};
|
|
11818
|
-
|
|
11818
|
+
fs19.lutimesSync = function() {
|
|
11819
11819
|
};
|
|
11820
11820
|
}
|
|
11821
11821
|
}
|
|
11822
11822
|
function chmodFix(orig) {
|
|
11823
11823
|
if (!orig) return orig;
|
|
11824
11824
|
return function(target, mode, cb) {
|
|
11825
|
-
return orig.call(
|
|
11825
|
+
return orig.call(fs18, target, mode, function(er) {
|
|
11826
11826
|
if (chownErOk(er)) er = null;
|
|
11827
11827
|
if (cb) cb.apply(this, arguments);
|
|
11828
11828
|
});
|
|
@@ -11832,7 +11832,7 @@ var require_polyfills = __commonJS({
|
|
|
11832
11832
|
if (!orig) return orig;
|
|
11833
11833
|
return function(target, mode) {
|
|
11834
11834
|
try {
|
|
11835
|
-
return orig.call(
|
|
11835
|
+
return orig.call(fs18, target, mode);
|
|
11836
11836
|
} catch (er) {
|
|
11837
11837
|
if (!chownErOk(er)) throw er;
|
|
11838
11838
|
}
|
|
@@ -11841,7 +11841,7 @@ var require_polyfills = __commonJS({
|
|
|
11841
11841
|
function chownFix(orig) {
|
|
11842
11842
|
if (!orig) return orig;
|
|
11843
11843
|
return function(target, uid, gid, cb) {
|
|
11844
|
-
return orig.call(
|
|
11844
|
+
return orig.call(fs18, target, uid, gid, function(er) {
|
|
11845
11845
|
if (chownErOk(er)) er = null;
|
|
11846
11846
|
if (cb) cb.apply(this, arguments);
|
|
11847
11847
|
});
|
|
@@ -11851,7 +11851,7 @@ var require_polyfills = __commonJS({
|
|
|
11851
11851
|
if (!orig) return orig;
|
|
11852
11852
|
return function(target, uid, gid) {
|
|
11853
11853
|
try {
|
|
11854
|
-
return orig.call(
|
|
11854
|
+
return orig.call(fs18, target, uid, gid);
|
|
11855
11855
|
} catch (er) {
|
|
11856
11856
|
if (!chownErOk(er)) throw er;
|
|
11857
11857
|
}
|
|
@@ -11871,13 +11871,13 @@ var require_polyfills = __commonJS({
|
|
|
11871
11871
|
}
|
|
11872
11872
|
if (cb) cb.apply(this, arguments);
|
|
11873
11873
|
}
|
|
11874
|
-
return options ? orig.call(
|
|
11874
|
+
return options ? orig.call(fs18, target, options, callback) : orig.call(fs18, target, callback);
|
|
11875
11875
|
};
|
|
11876
11876
|
}
|
|
11877
11877
|
function statFixSync(orig) {
|
|
11878
11878
|
if (!orig) return orig;
|
|
11879
11879
|
return function(target, options) {
|
|
11880
|
-
var stats = options ? orig.call(
|
|
11880
|
+
var stats = options ? orig.call(fs18, target, options) : orig.call(fs18, target);
|
|
11881
11881
|
if (stats) {
|
|
11882
11882
|
if (stats.uid < 0) stats.uid += 4294967296;
|
|
11883
11883
|
if (stats.gid < 0) stats.gid += 4294967296;
|
|
@@ -11907,16 +11907,16 @@ var require_legacy_streams = __commonJS({
|
|
|
11907
11907
|
"use strict";
|
|
11908
11908
|
var Stream = require("stream").Stream;
|
|
11909
11909
|
module2.exports = legacy;
|
|
11910
|
-
function legacy(
|
|
11910
|
+
function legacy(fs18) {
|
|
11911
11911
|
return {
|
|
11912
11912
|
ReadStream,
|
|
11913
11913
|
WriteStream
|
|
11914
11914
|
};
|
|
11915
|
-
function ReadStream(
|
|
11916
|
-
if (!(this instanceof ReadStream)) return new ReadStream(
|
|
11915
|
+
function ReadStream(path17, options) {
|
|
11916
|
+
if (!(this instanceof ReadStream)) return new ReadStream(path17, options);
|
|
11917
11917
|
Stream.call(this);
|
|
11918
11918
|
var self = this;
|
|
11919
|
-
this.path =
|
|
11919
|
+
this.path = path17;
|
|
11920
11920
|
this.fd = null;
|
|
11921
11921
|
this.readable = true;
|
|
11922
11922
|
this.paused = false;
|
|
@@ -11950,7 +11950,7 @@ var require_legacy_streams = __commonJS({
|
|
|
11950
11950
|
});
|
|
11951
11951
|
return;
|
|
11952
11952
|
}
|
|
11953
|
-
|
|
11953
|
+
fs18.open(this.path, this.flags, this.mode, function(err, fd) {
|
|
11954
11954
|
if (err) {
|
|
11955
11955
|
self.emit("error", err);
|
|
11956
11956
|
self.readable = false;
|
|
@@ -11961,10 +11961,10 @@ var require_legacy_streams = __commonJS({
|
|
|
11961
11961
|
self._read();
|
|
11962
11962
|
});
|
|
11963
11963
|
}
|
|
11964
|
-
function WriteStream(
|
|
11965
|
-
if (!(this instanceof WriteStream)) return new WriteStream(
|
|
11964
|
+
function WriteStream(path17, options) {
|
|
11965
|
+
if (!(this instanceof WriteStream)) return new WriteStream(path17, options);
|
|
11966
11966
|
Stream.call(this);
|
|
11967
|
-
this.path =
|
|
11967
|
+
this.path = path17;
|
|
11968
11968
|
this.fd = null;
|
|
11969
11969
|
this.writable = true;
|
|
11970
11970
|
this.flags = "w";
|
|
@@ -11989,7 +11989,7 @@ var require_legacy_streams = __commonJS({
|
|
|
11989
11989
|
this.busy = false;
|
|
11990
11990
|
this._queue = [];
|
|
11991
11991
|
if (this.fd === null) {
|
|
11992
|
-
this._open =
|
|
11992
|
+
this._open = fs18.open;
|
|
11993
11993
|
this._queue.push([this._open, this.path, this.flags, this.mode, void 0]);
|
|
11994
11994
|
this.flush();
|
|
11995
11995
|
}
|
|
@@ -12025,7 +12025,7 @@ var require_clone = __commonJS({
|
|
|
12025
12025
|
var require_graceful_fs = __commonJS({
|
|
12026
12026
|
"../node_modules/graceful-fs/graceful-fs.js"(exports2, module2) {
|
|
12027
12027
|
"use strict";
|
|
12028
|
-
var
|
|
12028
|
+
var fs18 = require("fs");
|
|
12029
12029
|
var polyfills = require_polyfills();
|
|
12030
12030
|
var legacy = require_legacy_streams();
|
|
12031
12031
|
var clone3 = require_clone();
|
|
@@ -12057,12 +12057,12 @@ var require_graceful_fs = __commonJS({
|
|
|
12057
12057
|
m = "GFS4: " + m.split(/\n/).join("\nGFS4: ");
|
|
12058
12058
|
console.error(m);
|
|
12059
12059
|
};
|
|
12060
|
-
if (!
|
|
12060
|
+
if (!fs18[gracefulQueue]) {
|
|
12061
12061
|
queue = global[gracefulQueue] || [];
|
|
12062
|
-
publishQueue(
|
|
12063
|
-
|
|
12062
|
+
publishQueue(fs18, queue);
|
|
12063
|
+
fs18.close = (function(fs$close) {
|
|
12064
12064
|
function close(fd, cb) {
|
|
12065
|
-
return fs$close.call(
|
|
12065
|
+
return fs$close.call(fs18, fd, function(err) {
|
|
12066
12066
|
if (!err) {
|
|
12067
12067
|
resetQueue();
|
|
12068
12068
|
}
|
|
@@ -12074,48 +12074,48 @@ var require_graceful_fs = __commonJS({
|
|
|
12074
12074
|
value: fs$close
|
|
12075
12075
|
});
|
|
12076
12076
|
return close;
|
|
12077
|
-
})(
|
|
12078
|
-
|
|
12077
|
+
})(fs18.close);
|
|
12078
|
+
fs18.closeSync = (function(fs$closeSync) {
|
|
12079
12079
|
function closeSync(fd) {
|
|
12080
|
-
fs$closeSync.apply(
|
|
12080
|
+
fs$closeSync.apply(fs18, arguments);
|
|
12081
12081
|
resetQueue();
|
|
12082
12082
|
}
|
|
12083
12083
|
Object.defineProperty(closeSync, previousSymbol, {
|
|
12084
12084
|
value: fs$closeSync
|
|
12085
12085
|
});
|
|
12086
12086
|
return closeSync;
|
|
12087
|
-
})(
|
|
12087
|
+
})(fs18.closeSync);
|
|
12088
12088
|
if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) {
|
|
12089
12089
|
process.on("exit", function() {
|
|
12090
|
-
debug(
|
|
12091
|
-
require("assert").equal(
|
|
12090
|
+
debug(fs18[gracefulQueue]);
|
|
12091
|
+
require("assert").equal(fs18[gracefulQueue].length, 0);
|
|
12092
12092
|
});
|
|
12093
12093
|
}
|
|
12094
12094
|
}
|
|
12095
12095
|
var queue;
|
|
12096
12096
|
if (!global[gracefulQueue]) {
|
|
12097
|
-
publishQueue(global,
|
|
12098
|
-
}
|
|
12099
|
-
module2.exports = patch(clone3(
|
|
12100
|
-
if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !
|
|
12101
|
-
module2.exports = patch(
|
|
12102
|
-
|
|
12103
|
-
}
|
|
12104
|
-
function patch(
|
|
12105
|
-
polyfills(
|
|
12106
|
-
|
|
12107
|
-
|
|
12108
|
-
|
|
12109
|
-
var fs$readFile =
|
|
12110
|
-
|
|
12111
|
-
function readFile(
|
|
12097
|
+
publishQueue(global, fs18[gracefulQueue]);
|
|
12098
|
+
}
|
|
12099
|
+
module2.exports = patch(clone3(fs18));
|
|
12100
|
+
if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs18.__patched) {
|
|
12101
|
+
module2.exports = patch(fs18);
|
|
12102
|
+
fs18.__patched = true;
|
|
12103
|
+
}
|
|
12104
|
+
function patch(fs19) {
|
|
12105
|
+
polyfills(fs19);
|
|
12106
|
+
fs19.gracefulify = patch;
|
|
12107
|
+
fs19.createReadStream = createReadStream;
|
|
12108
|
+
fs19.createWriteStream = createWriteStream2;
|
|
12109
|
+
var fs$readFile = fs19.readFile;
|
|
12110
|
+
fs19.readFile = readFile;
|
|
12111
|
+
function readFile(path17, options, cb) {
|
|
12112
12112
|
if (typeof options === "function")
|
|
12113
12113
|
cb = options, options = null;
|
|
12114
|
-
return go$readFile(
|
|
12115
|
-
function go$readFile(
|
|
12116
|
-
return fs$readFile(
|
|
12114
|
+
return go$readFile(path17, options, cb);
|
|
12115
|
+
function go$readFile(path18, options2, cb2, startTime) {
|
|
12116
|
+
return fs$readFile(path18, options2, function(err) {
|
|
12117
12117
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
12118
|
-
enqueue([go$readFile, [
|
|
12118
|
+
enqueue([go$readFile, [path18, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
12119
12119
|
else {
|
|
12120
12120
|
if (typeof cb2 === "function")
|
|
12121
12121
|
cb2.apply(this, arguments);
|
|
@@ -12123,16 +12123,16 @@ var require_graceful_fs = __commonJS({
|
|
|
12123
12123
|
});
|
|
12124
12124
|
}
|
|
12125
12125
|
}
|
|
12126
|
-
var fs$writeFile =
|
|
12127
|
-
|
|
12128
|
-
function writeFile(
|
|
12126
|
+
var fs$writeFile = fs19.writeFile;
|
|
12127
|
+
fs19.writeFile = writeFile;
|
|
12128
|
+
function writeFile(path17, data, options, cb) {
|
|
12129
12129
|
if (typeof options === "function")
|
|
12130
12130
|
cb = options, options = null;
|
|
12131
|
-
return go$writeFile(
|
|
12132
|
-
function go$writeFile(
|
|
12133
|
-
return fs$writeFile(
|
|
12131
|
+
return go$writeFile(path17, data, options, cb);
|
|
12132
|
+
function go$writeFile(path18, data2, options2, cb2, startTime) {
|
|
12133
|
+
return fs$writeFile(path18, data2, options2, function(err) {
|
|
12134
12134
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
12135
|
-
enqueue([go$writeFile, [
|
|
12135
|
+
enqueue([go$writeFile, [path18, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
12136
12136
|
else {
|
|
12137
12137
|
if (typeof cb2 === "function")
|
|
12138
12138
|
cb2.apply(this, arguments);
|
|
@@ -12140,17 +12140,17 @@ var require_graceful_fs = __commonJS({
|
|
|
12140
12140
|
});
|
|
12141
12141
|
}
|
|
12142
12142
|
}
|
|
12143
|
-
var fs$appendFile =
|
|
12143
|
+
var fs$appendFile = fs19.appendFile;
|
|
12144
12144
|
if (fs$appendFile)
|
|
12145
|
-
|
|
12146
|
-
function appendFile(
|
|
12145
|
+
fs19.appendFile = appendFile;
|
|
12146
|
+
function appendFile(path17, data, options, cb) {
|
|
12147
12147
|
if (typeof options === "function")
|
|
12148
12148
|
cb = options, options = null;
|
|
12149
|
-
return go$appendFile(
|
|
12150
|
-
function go$appendFile(
|
|
12151
|
-
return fs$appendFile(
|
|
12149
|
+
return go$appendFile(path17, data, options, cb);
|
|
12150
|
+
function go$appendFile(path18, data2, options2, cb2, startTime) {
|
|
12151
|
+
return fs$appendFile(path18, data2, options2, function(err) {
|
|
12152
12152
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
12153
|
-
enqueue([go$appendFile, [
|
|
12153
|
+
enqueue([go$appendFile, [path18, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
12154
12154
|
else {
|
|
12155
12155
|
if (typeof cb2 === "function")
|
|
12156
12156
|
cb2.apply(this, arguments);
|
|
@@ -12158,9 +12158,9 @@ var require_graceful_fs = __commonJS({
|
|
|
12158
12158
|
});
|
|
12159
12159
|
}
|
|
12160
12160
|
}
|
|
12161
|
-
var fs$copyFile =
|
|
12161
|
+
var fs$copyFile = fs19.copyFile;
|
|
12162
12162
|
if (fs$copyFile)
|
|
12163
|
-
|
|
12163
|
+
fs19.copyFile = copyFile;
|
|
12164
12164
|
function copyFile(src, dest, flags, cb) {
|
|
12165
12165
|
if (typeof flags === "function") {
|
|
12166
12166
|
cb = flags;
|
|
@@ -12178,34 +12178,34 @@ var require_graceful_fs = __commonJS({
|
|
|
12178
12178
|
});
|
|
12179
12179
|
}
|
|
12180
12180
|
}
|
|
12181
|
-
var fs$readdir =
|
|
12182
|
-
|
|
12181
|
+
var fs$readdir = fs19.readdir;
|
|
12182
|
+
fs19.readdir = readdir;
|
|
12183
12183
|
var noReaddirOptionVersions = /^v[0-5]\./;
|
|
12184
|
-
function readdir(
|
|
12184
|
+
function readdir(path17, options, cb) {
|
|
12185
12185
|
if (typeof options === "function")
|
|
12186
12186
|
cb = options, options = null;
|
|
12187
|
-
var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(
|
|
12188
|
-
return fs$readdir(
|
|
12189
|
-
|
|
12187
|
+
var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path18, options2, cb2, startTime) {
|
|
12188
|
+
return fs$readdir(path18, fs$readdirCallback(
|
|
12189
|
+
path18,
|
|
12190
12190
|
options2,
|
|
12191
12191
|
cb2,
|
|
12192
12192
|
startTime
|
|
12193
12193
|
));
|
|
12194
|
-
} : function go$readdir2(
|
|
12195
|
-
return fs$readdir(
|
|
12196
|
-
|
|
12194
|
+
} : function go$readdir2(path18, options2, cb2, startTime) {
|
|
12195
|
+
return fs$readdir(path18, options2, fs$readdirCallback(
|
|
12196
|
+
path18,
|
|
12197
12197
|
options2,
|
|
12198
12198
|
cb2,
|
|
12199
12199
|
startTime
|
|
12200
12200
|
));
|
|
12201
12201
|
};
|
|
12202
|
-
return go$readdir(
|
|
12203
|
-
function fs$readdirCallback(
|
|
12202
|
+
return go$readdir(path17, options, cb);
|
|
12203
|
+
function fs$readdirCallback(path18, options2, cb2, startTime) {
|
|
12204
12204
|
return function(err, files) {
|
|
12205
12205
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
12206
12206
|
enqueue([
|
|
12207
12207
|
go$readdir,
|
|
12208
|
-
[
|
|
12208
|
+
[path18, options2, cb2],
|
|
12209
12209
|
err,
|
|
12210
12210
|
startTime || Date.now(),
|
|
12211
12211
|
Date.now()
|
|
@@ -12220,21 +12220,21 @@ var require_graceful_fs = __commonJS({
|
|
|
12220
12220
|
}
|
|
12221
12221
|
}
|
|
12222
12222
|
if (process.version.substr(0, 4) === "v0.8") {
|
|
12223
|
-
var legStreams = legacy(
|
|
12223
|
+
var legStreams = legacy(fs19);
|
|
12224
12224
|
ReadStream = legStreams.ReadStream;
|
|
12225
12225
|
WriteStream = legStreams.WriteStream;
|
|
12226
12226
|
}
|
|
12227
|
-
var fs$ReadStream =
|
|
12227
|
+
var fs$ReadStream = fs19.ReadStream;
|
|
12228
12228
|
if (fs$ReadStream) {
|
|
12229
12229
|
ReadStream.prototype = Object.create(fs$ReadStream.prototype);
|
|
12230
12230
|
ReadStream.prototype.open = ReadStream$open;
|
|
12231
12231
|
}
|
|
12232
|
-
var fs$WriteStream =
|
|
12232
|
+
var fs$WriteStream = fs19.WriteStream;
|
|
12233
12233
|
if (fs$WriteStream) {
|
|
12234
12234
|
WriteStream.prototype = Object.create(fs$WriteStream.prototype);
|
|
12235
12235
|
WriteStream.prototype.open = WriteStream$open;
|
|
12236
12236
|
}
|
|
12237
|
-
Object.defineProperty(
|
|
12237
|
+
Object.defineProperty(fs19, "ReadStream", {
|
|
12238
12238
|
get: function() {
|
|
12239
12239
|
return ReadStream;
|
|
12240
12240
|
},
|
|
@@ -12244,7 +12244,7 @@ var require_graceful_fs = __commonJS({
|
|
|
12244
12244
|
enumerable: true,
|
|
12245
12245
|
configurable: true
|
|
12246
12246
|
});
|
|
12247
|
-
Object.defineProperty(
|
|
12247
|
+
Object.defineProperty(fs19, "WriteStream", {
|
|
12248
12248
|
get: function() {
|
|
12249
12249
|
return WriteStream;
|
|
12250
12250
|
},
|
|
@@ -12255,7 +12255,7 @@ var require_graceful_fs = __commonJS({
|
|
|
12255
12255
|
configurable: true
|
|
12256
12256
|
});
|
|
12257
12257
|
var FileReadStream = ReadStream;
|
|
12258
|
-
Object.defineProperty(
|
|
12258
|
+
Object.defineProperty(fs19, "FileReadStream", {
|
|
12259
12259
|
get: function() {
|
|
12260
12260
|
return FileReadStream;
|
|
12261
12261
|
},
|
|
@@ -12266,7 +12266,7 @@ var require_graceful_fs = __commonJS({
|
|
|
12266
12266
|
configurable: true
|
|
12267
12267
|
});
|
|
12268
12268
|
var FileWriteStream = WriteStream;
|
|
12269
|
-
Object.defineProperty(
|
|
12269
|
+
Object.defineProperty(fs19, "FileWriteStream", {
|
|
12270
12270
|
get: function() {
|
|
12271
12271
|
return FileWriteStream;
|
|
12272
12272
|
},
|
|
@@ -12276,7 +12276,7 @@ var require_graceful_fs = __commonJS({
|
|
|
12276
12276
|
enumerable: true,
|
|
12277
12277
|
configurable: true
|
|
12278
12278
|
});
|
|
12279
|
-
function ReadStream(
|
|
12279
|
+
function ReadStream(path17, options) {
|
|
12280
12280
|
if (this instanceof ReadStream)
|
|
12281
12281
|
return fs$ReadStream.apply(this, arguments), this;
|
|
12282
12282
|
else
|
|
@@ -12296,7 +12296,7 @@ var require_graceful_fs = __commonJS({
|
|
|
12296
12296
|
}
|
|
12297
12297
|
});
|
|
12298
12298
|
}
|
|
12299
|
-
function WriteStream(
|
|
12299
|
+
function WriteStream(path17, options) {
|
|
12300
12300
|
if (this instanceof WriteStream)
|
|
12301
12301
|
return fs$WriteStream.apply(this, arguments), this;
|
|
12302
12302
|
else
|
|
@@ -12314,22 +12314,22 @@ var require_graceful_fs = __commonJS({
|
|
|
12314
12314
|
}
|
|
12315
12315
|
});
|
|
12316
12316
|
}
|
|
12317
|
-
function createReadStream(
|
|
12318
|
-
return new
|
|
12317
|
+
function createReadStream(path17, options) {
|
|
12318
|
+
return new fs19.ReadStream(path17, options);
|
|
12319
12319
|
}
|
|
12320
|
-
function createWriteStream2(
|
|
12321
|
-
return new
|
|
12320
|
+
function createWriteStream2(path17, options) {
|
|
12321
|
+
return new fs19.WriteStream(path17, options);
|
|
12322
12322
|
}
|
|
12323
|
-
var fs$open =
|
|
12324
|
-
|
|
12325
|
-
function open(
|
|
12323
|
+
var fs$open = fs19.open;
|
|
12324
|
+
fs19.open = open;
|
|
12325
|
+
function open(path17, flags, mode, cb) {
|
|
12326
12326
|
if (typeof mode === "function")
|
|
12327
12327
|
cb = mode, mode = null;
|
|
12328
|
-
return go$open(
|
|
12329
|
-
function go$open(
|
|
12330
|
-
return fs$open(
|
|
12328
|
+
return go$open(path17, flags, mode, cb);
|
|
12329
|
+
function go$open(path18, flags2, mode2, cb2, startTime) {
|
|
12330
|
+
return fs$open(path18, flags2, mode2, function(err, fd) {
|
|
12331
12331
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
12332
|
-
enqueue([go$open, [
|
|
12332
|
+
enqueue([go$open, [path18, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
12333
12333
|
else {
|
|
12334
12334
|
if (typeof cb2 === "function")
|
|
12335
12335
|
cb2.apply(this, arguments);
|
|
@@ -12337,20 +12337,20 @@ var require_graceful_fs = __commonJS({
|
|
|
12337
12337
|
});
|
|
12338
12338
|
}
|
|
12339
12339
|
}
|
|
12340
|
-
return
|
|
12340
|
+
return fs19;
|
|
12341
12341
|
}
|
|
12342
12342
|
function enqueue(elem) {
|
|
12343
12343
|
debug("ENQUEUE", elem[0].name, elem[1]);
|
|
12344
|
-
|
|
12344
|
+
fs18[gracefulQueue].push(elem);
|
|
12345
12345
|
retry();
|
|
12346
12346
|
}
|
|
12347
12347
|
var retryTimer;
|
|
12348
12348
|
function resetQueue() {
|
|
12349
12349
|
var now = Date.now();
|
|
12350
|
-
for (var i = 0; i <
|
|
12351
|
-
if (
|
|
12352
|
-
|
|
12353
|
-
|
|
12350
|
+
for (var i = 0; i < fs18[gracefulQueue].length; ++i) {
|
|
12351
|
+
if (fs18[gracefulQueue][i].length > 2) {
|
|
12352
|
+
fs18[gracefulQueue][i][3] = now;
|
|
12353
|
+
fs18[gracefulQueue][i][4] = now;
|
|
12354
12354
|
}
|
|
12355
12355
|
}
|
|
12356
12356
|
retry();
|
|
@@ -12358,9 +12358,9 @@ var require_graceful_fs = __commonJS({
|
|
|
12358
12358
|
function retry() {
|
|
12359
12359
|
clearTimeout(retryTimer);
|
|
12360
12360
|
retryTimer = void 0;
|
|
12361
|
-
if (
|
|
12361
|
+
if (fs18[gracefulQueue].length === 0)
|
|
12362
12362
|
return;
|
|
12363
|
-
var elem =
|
|
12363
|
+
var elem = fs18[gracefulQueue].shift();
|
|
12364
12364
|
var fn = elem[0];
|
|
12365
12365
|
var args = elem[1];
|
|
12366
12366
|
var err = elem[2];
|
|
@@ -12382,7 +12382,7 @@ var require_graceful_fs = __commonJS({
|
|
|
12382
12382
|
debug("RETRY", fn.name, args);
|
|
12383
12383
|
fn.apply(null, args.concat([startTime]));
|
|
12384
12384
|
} else {
|
|
12385
|
-
|
|
12385
|
+
fs18[gracefulQueue].push(elem);
|
|
12386
12386
|
}
|
|
12387
12387
|
}
|
|
12388
12388
|
if (retryTimer === void 0) {
|
|
@@ -12397,7 +12397,7 @@ var require_fs = __commonJS({
|
|
|
12397
12397
|
"../node_modules/fs-extra/lib/fs/index.js"(exports2) {
|
|
12398
12398
|
"use strict";
|
|
12399
12399
|
var u = require_universalify().fromCallback;
|
|
12400
|
-
var
|
|
12400
|
+
var fs18 = require_graceful_fs();
|
|
12401
12401
|
var api = [
|
|
12402
12402
|
"access",
|
|
12403
12403
|
"appendFile",
|
|
@@ -12438,26 +12438,26 @@ var require_fs = __commonJS({
|
|
|
12438
12438
|
"utimes",
|
|
12439
12439
|
"writeFile"
|
|
12440
12440
|
].filter((key) => {
|
|
12441
|
-
return typeof
|
|
12441
|
+
return typeof fs18[key] === "function";
|
|
12442
12442
|
});
|
|
12443
|
-
Object.assign(exports2,
|
|
12443
|
+
Object.assign(exports2, fs18);
|
|
12444
12444
|
api.forEach((method) => {
|
|
12445
|
-
exports2[method] = u(
|
|
12445
|
+
exports2[method] = u(fs18[method]);
|
|
12446
12446
|
});
|
|
12447
12447
|
exports2.exists = function(filename, callback) {
|
|
12448
12448
|
if (typeof callback === "function") {
|
|
12449
|
-
return
|
|
12449
|
+
return fs18.exists(filename, callback);
|
|
12450
12450
|
}
|
|
12451
12451
|
return new Promise((resolve2) => {
|
|
12452
|
-
return
|
|
12452
|
+
return fs18.exists(filename, resolve2);
|
|
12453
12453
|
});
|
|
12454
12454
|
};
|
|
12455
12455
|
exports2.read = function(fd, buffer, offset, length, position, callback) {
|
|
12456
12456
|
if (typeof callback === "function") {
|
|
12457
|
-
return
|
|
12457
|
+
return fs18.read(fd, buffer, offset, length, position, callback);
|
|
12458
12458
|
}
|
|
12459
12459
|
return new Promise((resolve2, reject) => {
|
|
12460
|
-
|
|
12460
|
+
fs18.read(fd, buffer, offset, length, position, (err, bytesRead, buffer2) => {
|
|
12461
12461
|
if (err) return reject(err);
|
|
12462
12462
|
resolve2({ bytesRead, buffer: buffer2 });
|
|
12463
12463
|
});
|
|
@@ -12465,10 +12465,10 @@ var require_fs = __commonJS({
|
|
|
12465
12465
|
};
|
|
12466
12466
|
exports2.write = function(fd, buffer, ...args) {
|
|
12467
12467
|
if (typeof args[args.length - 1] === "function") {
|
|
12468
|
-
return
|
|
12468
|
+
return fs18.write(fd, buffer, ...args);
|
|
12469
12469
|
}
|
|
12470
12470
|
return new Promise((resolve2, reject) => {
|
|
12471
|
-
|
|
12471
|
+
fs18.write(fd, buffer, ...args, (err, bytesWritten, buffer2) => {
|
|
12472
12472
|
if (err) return reject(err);
|
|
12473
12473
|
resolve2({ bytesWritten, buffer: buffer2 });
|
|
12474
12474
|
});
|
|
@@ -12476,10 +12476,10 @@ var require_fs = __commonJS({
|
|
|
12476
12476
|
};
|
|
12477
12477
|
exports2.readv = function(fd, buffers, ...args) {
|
|
12478
12478
|
if (typeof args[args.length - 1] === "function") {
|
|
12479
|
-
return
|
|
12479
|
+
return fs18.readv(fd, buffers, ...args);
|
|
12480
12480
|
}
|
|
12481
12481
|
return new Promise((resolve2, reject) => {
|
|
12482
|
-
|
|
12482
|
+
fs18.readv(fd, buffers, ...args, (err, bytesRead, buffers2) => {
|
|
12483
12483
|
if (err) return reject(err);
|
|
12484
12484
|
resolve2({ bytesRead, buffers: buffers2 });
|
|
12485
12485
|
});
|
|
@@ -12487,17 +12487,17 @@ var require_fs = __commonJS({
|
|
|
12487
12487
|
};
|
|
12488
12488
|
exports2.writev = function(fd, buffers, ...args) {
|
|
12489
12489
|
if (typeof args[args.length - 1] === "function") {
|
|
12490
|
-
return
|
|
12490
|
+
return fs18.writev(fd, buffers, ...args);
|
|
12491
12491
|
}
|
|
12492
12492
|
return new Promise((resolve2, reject) => {
|
|
12493
|
-
|
|
12493
|
+
fs18.writev(fd, buffers, ...args, (err, bytesWritten, buffers2) => {
|
|
12494
12494
|
if (err) return reject(err);
|
|
12495
12495
|
resolve2({ bytesWritten, buffers: buffers2 });
|
|
12496
12496
|
});
|
|
12497
12497
|
});
|
|
12498
12498
|
};
|
|
12499
|
-
if (typeof
|
|
12500
|
-
exports2.realpath.native = u(
|
|
12499
|
+
if (typeof fs18.realpath.native === "function") {
|
|
12500
|
+
exports2.realpath.native = u(fs18.realpath.native);
|
|
12501
12501
|
} else {
|
|
12502
12502
|
process.emitWarning(
|
|
12503
12503
|
"fs.realpath.native is not a function. Is fs being monkey-patched?",
|
|
@@ -12512,10 +12512,10 @@ var require_fs = __commonJS({
|
|
|
12512
12512
|
var require_utils = __commonJS({
|
|
12513
12513
|
"../node_modules/fs-extra/lib/mkdirs/utils.js"(exports2, module2) {
|
|
12514
12514
|
"use strict";
|
|
12515
|
-
var
|
|
12515
|
+
var path17 = require("path");
|
|
12516
12516
|
module2.exports.checkPath = function checkPath(pth) {
|
|
12517
12517
|
if (process.platform === "win32") {
|
|
12518
|
-
const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(
|
|
12518
|
+
const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path17.parse(pth).root, ""));
|
|
12519
12519
|
if (pathHasInvalidWinCharacters) {
|
|
12520
12520
|
const error49 = new Error(`Path contains invalid characters: ${pth}`);
|
|
12521
12521
|
error49.code = "EINVAL";
|
|
@@ -12530,7 +12530,7 @@ var require_utils = __commonJS({
|
|
|
12530
12530
|
var require_make_dir = __commonJS({
|
|
12531
12531
|
"../node_modules/fs-extra/lib/mkdirs/make-dir.js"(exports2, module2) {
|
|
12532
12532
|
"use strict";
|
|
12533
|
-
var
|
|
12533
|
+
var fs18 = require_fs();
|
|
12534
12534
|
var { checkPath } = require_utils();
|
|
12535
12535
|
var getMode = (options) => {
|
|
12536
12536
|
const defaults = { mode: 511 };
|
|
@@ -12539,14 +12539,14 @@ var require_make_dir = __commonJS({
|
|
|
12539
12539
|
};
|
|
12540
12540
|
module2.exports.makeDir = async (dir, options) => {
|
|
12541
12541
|
checkPath(dir);
|
|
12542
|
-
return
|
|
12542
|
+
return fs18.mkdir(dir, {
|
|
12543
12543
|
mode: getMode(options),
|
|
12544
12544
|
recursive: true
|
|
12545
12545
|
});
|
|
12546
12546
|
};
|
|
12547
12547
|
module2.exports.makeDirSync = (dir, options) => {
|
|
12548
12548
|
checkPath(dir);
|
|
12549
|
-
return
|
|
12549
|
+
return fs18.mkdirSync(dir, {
|
|
12550
12550
|
mode: getMode(options),
|
|
12551
12551
|
recursive: true
|
|
12552
12552
|
});
|
|
@@ -12578,13 +12578,13 @@ var require_path_exists = __commonJS({
|
|
|
12578
12578
|
"../node_modules/fs-extra/lib/path-exists/index.js"(exports2, module2) {
|
|
12579
12579
|
"use strict";
|
|
12580
12580
|
var u = require_universalify().fromPromise;
|
|
12581
|
-
var
|
|
12582
|
-
function pathExists(
|
|
12583
|
-
return
|
|
12581
|
+
var fs18 = require_fs();
|
|
12582
|
+
function pathExists(path17) {
|
|
12583
|
+
return fs18.access(path17).then(() => true).catch(() => false);
|
|
12584
12584
|
}
|
|
12585
12585
|
module2.exports = {
|
|
12586
12586
|
pathExists: u(pathExists),
|
|
12587
|
-
pathExistsSync:
|
|
12587
|
+
pathExistsSync: fs18.existsSync
|
|
12588
12588
|
};
|
|
12589
12589
|
}
|
|
12590
12590
|
});
|
|
@@ -12593,16 +12593,16 @@ var require_path_exists = __commonJS({
|
|
|
12593
12593
|
var require_utimes = __commonJS({
|
|
12594
12594
|
"../node_modules/fs-extra/lib/util/utimes.js"(exports2, module2) {
|
|
12595
12595
|
"use strict";
|
|
12596
|
-
var
|
|
12596
|
+
var fs18 = require_fs();
|
|
12597
12597
|
var u = require_universalify().fromPromise;
|
|
12598
|
-
async function utimesMillis(
|
|
12599
|
-
const fd = await
|
|
12598
|
+
async function utimesMillis(path17, atime, mtime) {
|
|
12599
|
+
const fd = await fs18.open(path17, "r+");
|
|
12600
12600
|
let closeErr = null;
|
|
12601
12601
|
try {
|
|
12602
|
-
await
|
|
12602
|
+
await fs18.futimes(fd, atime, mtime);
|
|
12603
12603
|
} finally {
|
|
12604
12604
|
try {
|
|
12605
|
-
await
|
|
12605
|
+
await fs18.close(fd);
|
|
12606
12606
|
} catch (e) {
|
|
12607
12607
|
closeErr = e;
|
|
12608
12608
|
}
|
|
@@ -12611,10 +12611,10 @@ var require_utimes = __commonJS({
|
|
|
12611
12611
|
throw closeErr;
|
|
12612
12612
|
}
|
|
12613
12613
|
}
|
|
12614
|
-
function utimesMillisSync(
|
|
12615
|
-
const fd =
|
|
12616
|
-
|
|
12617
|
-
return
|
|
12614
|
+
function utimesMillisSync(path17, atime, mtime) {
|
|
12615
|
+
const fd = fs18.openSync(path17, "r+");
|
|
12616
|
+
fs18.futimesSync(fd, atime, mtime);
|
|
12617
|
+
return fs18.closeSync(fd);
|
|
12618
12618
|
}
|
|
12619
12619
|
module2.exports = {
|
|
12620
12620
|
utimesMillis: u(utimesMillis),
|
|
@@ -12627,11 +12627,11 @@ var require_utimes = __commonJS({
|
|
|
12627
12627
|
var require_stat = __commonJS({
|
|
12628
12628
|
"../node_modules/fs-extra/lib/util/stat.js"(exports2, module2) {
|
|
12629
12629
|
"use strict";
|
|
12630
|
-
var
|
|
12631
|
-
var
|
|
12630
|
+
var fs18 = require_fs();
|
|
12631
|
+
var path17 = require("path");
|
|
12632
12632
|
var u = require_universalify().fromPromise;
|
|
12633
12633
|
function getStats(src, dest, opts) {
|
|
12634
|
-
const statFunc = opts.dereference ? (file2) =>
|
|
12634
|
+
const statFunc = opts.dereference ? (file2) => fs18.stat(file2, { bigint: true }) : (file2) => fs18.lstat(file2, { bigint: true });
|
|
12635
12635
|
return Promise.all([
|
|
12636
12636
|
statFunc(src),
|
|
12637
12637
|
statFunc(dest).catch((err) => {
|
|
@@ -12642,7 +12642,7 @@ var require_stat = __commonJS({
|
|
|
12642
12642
|
}
|
|
12643
12643
|
function getStatsSync(src, dest, opts) {
|
|
12644
12644
|
let destStat;
|
|
12645
|
-
const statFunc = opts.dereference ? (file2) =>
|
|
12645
|
+
const statFunc = opts.dereference ? (file2) => fs18.statSync(file2, { bigint: true }) : (file2) => fs18.lstatSync(file2, { bigint: true });
|
|
12646
12646
|
const srcStat = statFunc(src);
|
|
12647
12647
|
try {
|
|
12648
12648
|
destStat = statFunc(dest);
|
|
@@ -12656,8 +12656,8 @@ var require_stat = __commonJS({
|
|
|
12656
12656
|
const { srcStat, destStat } = await getStats(src, dest, opts);
|
|
12657
12657
|
if (destStat) {
|
|
12658
12658
|
if (areIdentical(srcStat, destStat)) {
|
|
12659
|
-
const srcBaseName =
|
|
12660
|
-
const destBaseName =
|
|
12659
|
+
const srcBaseName = path17.basename(src);
|
|
12660
|
+
const destBaseName = path17.basename(dest);
|
|
12661
12661
|
if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
|
|
12662
12662
|
return { srcStat, destStat, isChangingCase: true };
|
|
12663
12663
|
}
|
|
@@ -12679,8 +12679,8 @@ var require_stat = __commonJS({
|
|
|
12679
12679
|
const { srcStat, destStat } = getStatsSync(src, dest, opts);
|
|
12680
12680
|
if (destStat) {
|
|
12681
12681
|
if (areIdentical(srcStat, destStat)) {
|
|
12682
|
-
const srcBaseName =
|
|
12683
|
-
const destBaseName =
|
|
12682
|
+
const srcBaseName = path17.basename(src);
|
|
12683
|
+
const destBaseName = path17.basename(dest);
|
|
12684
12684
|
if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
|
|
12685
12685
|
return { srcStat, destStat, isChangingCase: true };
|
|
12686
12686
|
}
|
|
@@ -12699,12 +12699,12 @@ var require_stat = __commonJS({
|
|
|
12699
12699
|
return { srcStat, destStat };
|
|
12700
12700
|
}
|
|
12701
12701
|
async function checkParentPaths(src, srcStat, dest, funcName) {
|
|
12702
|
-
const srcParent =
|
|
12703
|
-
const destParent =
|
|
12704
|
-
if (destParent === srcParent || destParent ===
|
|
12702
|
+
const srcParent = path17.resolve(path17.dirname(src));
|
|
12703
|
+
const destParent = path17.resolve(path17.dirname(dest));
|
|
12704
|
+
if (destParent === srcParent || destParent === path17.parse(destParent).root) return;
|
|
12705
12705
|
let destStat;
|
|
12706
12706
|
try {
|
|
12707
|
-
destStat = await
|
|
12707
|
+
destStat = await fs18.stat(destParent, { bigint: true });
|
|
12708
12708
|
} catch (err) {
|
|
12709
12709
|
if (err.code === "ENOENT") return;
|
|
12710
12710
|
throw err;
|
|
@@ -12715,12 +12715,12 @@ var require_stat = __commonJS({
|
|
|
12715
12715
|
return checkParentPaths(src, srcStat, destParent, funcName);
|
|
12716
12716
|
}
|
|
12717
12717
|
function checkParentPathsSync(src, srcStat, dest, funcName) {
|
|
12718
|
-
const srcParent =
|
|
12719
|
-
const destParent =
|
|
12720
|
-
if (destParent === srcParent || destParent ===
|
|
12718
|
+
const srcParent = path17.resolve(path17.dirname(src));
|
|
12719
|
+
const destParent = path17.resolve(path17.dirname(dest));
|
|
12720
|
+
if (destParent === srcParent || destParent === path17.parse(destParent).root) return;
|
|
12721
12721
|
let destStat;
|
|
12722
12722
|
try {
|
|
12723
|
-
destStat =
|
|
12723
|
+
destStat = fs18.statSync(destParent, { bigint: true });
|
|
12724
12724
|
} catch (err) {
|
|
12725
12725
|
if (err.code === "ENOENT") return;
|
|
12726
12726
|
throw err;
|
|
@@ -12734,8 +12734,8 @@ var require_stat = __commonJS({
|
|
|
12734
12734
|
return destStat.ino !== void 0 && destStat.dev !== void 0 && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev;
|
|
12735
12735
|
}
|
|
12736
12736
|
function isSrcSubdir(src, dest) {
|
|
12737
|
-
const srcArr =
|
|
12738
|
-
const destArr =
|
|
12737
|
+
const srcArr = path17.resolve(src).split(path17.sep).filter((i) => i);
|
|
12738
|
+
const destArr = path17.resolve(dest).split(path17.sep).filter((i) => i);
|
|
12739
12739
|
return srcArr.every((cur, i) => destArr[i] === cur);
|
|
12740
12740
|
}
|
|
12741
12741
|
function errMsg(src, dest, funcName) {
|
|
@@ -12787,8 +12787,8 @@ var require_async = __commonJS({
|
|
|
12787
12787
|
var require_copy = __commonJS({
|
|
12788
12788
|
"../node_modules/fs-extra/lib/copy/copy.js"(exports2, module2) {
|
|
12789
12789
|
"use strict";
|
|
12790
|
-
var
|
|
12791
|
-
var
|
|
12790
|
+
var fs18 = require_fs();
|
|
12791
|
+
var path17 = require("path");
|
|
12792
12792
|
var { mkdirs } = require_mkdirs();
|
|
12793
12793
|
var { pathExists } = require_path_exists();
|
|
12794
12794
|
var { utimesMillis } = require_utimes();
|
|
@@ -12811,7 +12811,7 @@ var require_copy = __commonJS({
|
|
|
12811
12811
|
await stat.checkParentPaths(src, srcStat, dest, "copy");
|
|
12812
12812
|
const include = await runFilter(src, dest, opts);
|
|
12813
12813
|
if (!include) return;
|
|
12814
|
-
const destParent =
|
|
12814
|
+
const destParent = path17.dirname(dest);
|
|
12815
12815
|
const dirExists = await pathExists(destParent);
|
|
12816
12816
|
if (!dirExists) {
|
|
12817
12817
|
await mkdirs(destParent);
|
|
@@ -12823,7 +12823,7 @@ var require_copy = __commonJS({
|
|
|
12823
12823
|
return opts.filter(src, dest);
|
|
12824
12824
|
}
|
|
12825
12825
|
async function getStatsAndPerformCopy(destStat, src, dest, opts) {
|
|
12826
|
-
const statFn = opts.dereference ?
|
|
12826
|
+
const statFn = opts.dereference ? fs18.stat : fs18.lstat;
|
|
12827
12827
|
const srcStat = await statFn(src);
|
|
12828
12828
|
if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts);
|
|
12829
12829
|
if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts);
|
|
@@ -12835,7 +12835,7 @@ var require_copy = __commonJS({
|
|
|
12835
12835
|
async function onFile(srcStat, destStat, src, dest, opts) {
|
|
12836
12836
|
if (!destStat) return copyFile(srcStat, src, dest, opts);
|
|
12837
12837
|
if (opts.overwrite) {
|
|
12838
|
-
await
|
|
12838
|
+
await fs18.unlink(dest);
|
|
12839
12839
|
return copyFile(srcStat, src, dest, opts);
|
|
12840
12840
|
}
|
|
12841
12841
|
if (opts.errorOnExist) {
|
|
@@ -12843,29 +12843,29 @@ var require_copy = __commonJS({
|
|
|
12843
12843
|
}
|
|
12844
12844
|
}
|
|
12845
12845
|
async function copyFile(srcStat, src, dest, opts) {
|
|
12846
|
-
await
|
|
12846
|
+
await fs18.copyFile(src, dest);
|
|
12847
12847
|
if (opts.preserveTimestamps) {
|
|
12848
12848
|
if (fileIsNotWritable(srcStat.mode)) {
|
|
12849
12849
|
await makeFileWritable(dest, srcStat.mode);
|
|
12850
12850
|
}
|
|
12851
|
-
const updatedSrcStat = await
|
|
12851
|
+
const updatedSrcStat = await fs18.stat(src);
|
|
12852
12852
|
await utimesMillis(dest, updatedSrcStat.atime, updatedSrcStat.mtime);
|
|
12853
12853
|
}
|
|
12854
|
-
return
|
|
12854
|
+
return fs18.chmod(dest, srcStat.mode);
|
|
12855
12855
|
}
|
|
12856
12856
|
function fileIsNotWritable(srcMode) {
|
|
12857
12857
|
return (srcMode & 128) === 0;
|
|
12858
12858
|
}
|
|
12859
12859
|
function makeFileWritable(dest, srcMode) {
|
|
12860
|
-
return
|
|
12860
|
+
return fs18.chmod(dest, srcMode | 128);
|
|
12861
12861
|
}
|
|
12862
12862
|
async function onDir(srcStat, destStat, src, dest, opts) {
|
|
12863
12863
|
if (!destStat) {
|
|
12864
|
-
await
|
|
12864
|
+
await fs18.mkdir(dest);
|
|
12865
12865
|
}
|
|
12866
|
-
await asyncIteratorConcurrentProcess(await
|
|
12867
|
-
const srcItem =
|
|
12868
|
-
const destItem =
|
|
12866
|
+
await asyncIteratorConcurrentProcess(await fs18.opendir(src), async (item) => {
|
|
12867
|
+
const srcItem = path17.join(src, item.name);
|
|
12868
|
+
const destItem = path17.join(dest, item.name);
|
|
12869
12869
|
const include = await runFilter(srcItem, destItem, opts);
|
|
12870
12870
|
if (include) {
|
|
12871
12871
|
const { destStat: destStat2 } = await stat.checkPaths(srcItem, destItem, "copy", opts);
|
|
@@ -12873,26 +12873,26 @@ var require_copy = __commonJS({
|
|
|
12873
12873
|
}
|
|
12874
12874
|
});
|
|
12875
12875
|
if (!destStat) {
|
|
12876
|
-
await
|
|
12876
|
+
await fs18.chmod(dest, srcStat.mode);
|
|
12877
12877
|
}
|
|
12878
12878
|
}
|
|
12879
12879
|
async function onLink(destStat, src, dest, opts) {
|
|
12880
|
-
let resolvedSrc = await
|
|
12880
|
+
let resolvedSrc = await fs18.readlink(src);
|
|
12881
12881
|
if (opts.dereference) {
|
|
12882
|
-
resolvedSrc =
|
|
12882
|
+
resolvedSrc = path17.resolve(process.cwd(), resolvedSrc);
|
|
12883
12883
|
}
|
|
12884
12884
|
if (!destStat) {
|
|
12885
|
-
return
|
|
12885
|
+
return fs18.symlink(resolvedSrc, dest);
|
|
12886
12886
|
}
|
|
12887
12887
|
let resolvedDest = null;
|
|
12888
12888
|
try {
|
|
12889
|
-
resolvedDest = await
|
|
12889
|
+
resolvedDest = await fs18.readlink(dest);
|
|
12890
12890
|
} catch (e) {
|
|
12891
|
-
if (e.code === "EINVAL" || e.code === "UNKNOWN") return
|
|
12891
|
+
if (e.code === "EINVAL" || e.code === "UNKNOWN") return fs18.symlink(resolvedSrc, dest);
|
|
12892
12892
|
throw e;
|
|
12893
12893
|
}
|
|
12894
12894
|
if (opts.dereference) {
|
|
12895
|
-
resolvedDest =
|
|
12895
|
+
resolvedDest = path17.resolve(process.cwd(), resolvedDest);
|
|
12896
12896
|
}
|
|
12897
12897
|
if (resolvedSrc !== resolvedDest) {
|
|
12898
12898
|
if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
|
|
@@ -12902,8 +12902,8 @@ var require_copy = __commonJS({
|
|
|
12902
12902
|
throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`);
|
|
12903
12903
|
}
|
|
12904
12904
|
}
|
|
12905
|
-
await
|
|
12906
|
-
return
|
|
12905
|
+
await fs18.unlink(dest);
|
|
12906
|
+
return fs18.symlink(resolvedSrc, dest);
|
|
12907
12907
|
}
|
|
12908
12908
|
module2.exports = copy;
|
|
12909
12909
|
}
|
|
@@ -12913,8 +12913,8 @@ var require_copy = __commonJS({
|
|
|
12913
12913
|
var require_copy_sync = __commonJS({
|
|
12914
12914
|
"../node_modules/fs-extra/lib/copy/copy-sync.js"(exports2, module2) {
|
|
12915
12915
|
"use strict";
|
|
12916
|
-
var
|
|
12917
|
-
var
|
|
12916
|
+
var fs18 = require_graceful_fs();
|
|
12917
|
+
var path17 = require("path");
|
|
12918
12918
|
var mkdirsSync = require_mkdirs().mkdirsSync;
|
|
12919
12919
|
var utimesMillisSync = require_utimes().utimesMillisSync;
|
|
12920
12920
|
var stat = require_stat();
|
|
@@ -12935,12 +12935,12 @@ var require_copy_sync = __commonJS({
|
|
|
12935
12935
|
const { srcStat, destStat } = stat.checkPathsSync(src, dest, "copy", opts);
|
|
12936
12936
|
stat.checkParentPathsSync(src, srcStat, dest, "copy");
|
|
12937
12937
|
if (opts.filter && !opts.filter(src, dest)) return;
|
|
12938
|
-
const destParent =
|
|
12939
|
-
if (!
|
|
12938
|
+
const destParent = path17.dirname(dest);
|
|
12939
|
+
if (!fs18.existsSync(destParent)) mkdirsSync(destParent);
|
|
12940
12940
|
return getStats(destStat, src, dest, opts);
|
|
12941
12941
|
}
|
|
12942
12942
|
function getStats(destStat, src, dest, opts) {
|
|
12943
|
-
const statSync = opts.dereference ?
|
|
12943
|
+
const statSync = opts.dereference ? fs18.statSync : fs18.lstatSync;
|
|
12944
12944
|
const srcStat = statSync(src);
|
|
12945
12945
|
if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts);
|
|
12946
12946
|
else if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts);
|
|
@@ -12955,14 +12955,14 @@ var require_copy_sync = __commonJS({
|
|
|
12955
12955
|
}
|
|
12956
12956
|
function mayCopyFile(srcStat, src, dest, opts) {
|
|
12957
12957
|
if (opts.overwrite) {
|
|
12958
|
-
|
|
12958
|
+
fs18.unlinkSync(dest);
|
|
12959
12959
|
return copyFile(srcStat, src, dest, opts);
|
|
12960
12960
|
} else if (opts.errorOnExist) {
|
|
12961
12961
|
throw new Error(`'${dest}' already exists`);
|
|
12962
12962
|
}
|
|
12963
12963
|
}
|
|
12964
12964
|
function copyFile(srcStat, src, dest, opts) {
|
|
12965
|
-
|
|
12965
|
+
fs18.copyFileSync(src, dest);
|
|
12966
12966
|
if (opts.preserveTimestamps) handleTimestamps(srcStat.mode, src, dest);
|
|
12967
12967
|
return setDestMode(dest, srcStat.mode);
|
|
12968
12968
|
}
|
|
@@ -12977,10 +12977,10 @@ var require_copy_sync = __commonJS({
|
|
|
12977
12977
|
return setDestMode(dest, srcMode | 128);
|
|
12978
12978
|
}
|
|
12979
12979
|
function setDestMode(dest, srcMode) {
|
|
12980
|
-
return
|
|
12980
|
+
return fs18.chmodSync(dest, srcMode);
|
|
12981
12981
|
}
|
|
12982
12982
|
function setDestTimestamps(src, dest) {
|
|
12983
|
-
const updatedSrcStat =
|
|
12983
|
+
const updatedSrcStat = fs18.statSync(src);
|
|
12984
12984
|
return utimesMillisSync(dest, updatedSrcStat.atime, updatedSrcStat.mtime);
|
|
12985
12985
|
}
|
|
12986
12986
|
function onDir(srcStat, destStat, src, dest, opts) {
|
|
@@ -12988,12 +12988,12 @@ var require_copy_sync = __commonJS({
|
|
|
12988
12988
|
return copyDir(src, dest, opts);
|
|
12989
12989
|
}
|
|
12990
12990
|
function mkDirAndCopy(srcMode, src, dest, opts) {
|
|
12991
|
-
|
|
12991
|
+
fs18.mkdirSync(dest);
|
|
12992
12992
|
copyDir(src, dest, opts);
|
|
12993
12993
|
return setDestMode(dest, srcMode);
|
|
12994
12994
|
}
|
|
12995
12995
|
function copyDir(src, dest, opts) {
|
|
12996
|
-
const dir =
|
|
12996
|
+
const dir = fs18.opendirSync(src);
|
|
12997
12997
|
try {
|
|
12998
12998
|
let dirent;
|
|
12999
12999
|
while ((dirent = dir.readSync()) !== null) {
|
|
@@ -13004,29 +13004,29 @@ var require_copy_sync = __commonJS({
|
|
|
13004
13004
|
}
|
|
13005
13005
|
}
|
|
13006
13006
|
function copyDirItem(item, src, dest, opts) {
|
|
13007
|
-
const srcItem =
|
|
13008
|
-
const destItem =
|
|
13007
|
+
const srcItem = path17.join(src, item);
|
|
13008
|
+
const destItem = path17.join(dest, item);
|
|
13009
13009
|
if (opts.filter && !opts.filter(srcItem, destItem)) return;
|
|
13010
13010
|
const { destStat } = stat.checkPathsSync(srcItem, destItem, "copy", opts);
|
|
13011
13011
|
return getStats(destStat, srcItem, destItem, opts);
|
|
13012
13012
|
}
|
|
13013
13013
|
function onLink(destStat, src, dest, opts) {
|
|
13014
|
-
let resolvedSrc =
|
|
13014
|
+
let resolvedSrc = fs18.readlinkSync(src);
|
|
13015
13015
|
if (opts.dereference) {
|
|
13016
|
-
resolvedSrc =
|
|
13016
|
+
resolvedSrc = path17.resolve(process.cwd(), resolvedSrc);
|
|
13017
13017
|
}
|
|
13018
13018
|
if (!destStat) {
|
|
13019
|
-
return
|
|
13019
|
+
return fs18.symlinkSync(resolvedSrc, dest);
|
|
13020
13020
|
} else {
|
|
13021
13021
|
let resolvedDest;
|
|
13022
13022
|
try {
|
|
13023
|
-
resolvedDest =
|
|
13023
|
+
resolvedDest = fs18.readlinkSync(dest);
|
|
13024
13024
|
} catch (err) {
|
|
13025
|
-
if (err.code === "EINVAL" || err.code === "UNKNOWN") return
|
|
13025
|
+
if (err.code === "EINVAL" || err.code === "UNKNOWN") return fs18.symlinkSync(resolvedSrc, dest);
|
|
13026
13026
|
throw err;
|
|
13027
13027
|
}
|
|
13028
13028
|
if (opts.dereference) {
|
|
13029
|
-
resolvedDest =
|
|
13029
|
+
resolvedDest = path17.resolve(process.cwd(), resolvedDest);
|
|
13030
13030
|
}
|
|
13031
13031
|
if (resolvedSrc !== resolvedDest) {
|
|
13032
13032
|
if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
|
|
@@ -13040,8 +13040,8 @@ var require_copy_sync = __commonJS({
|
|
|
13040
13040
|
}
|
|
13041
13041
|
}
|
|
13042
13042
|
function copyLink(resolvedSrc, dest) {
|
|
13043
|
-
|
|
13044
|
-
return
|
|
13043
|
+
fs18.unlinkSync(dest);
|
|
13044
|
+
return fs18.symlinkSync(resolvedSrc, dest);
|
|
13045
13045
|
}
|
|
13046
13046
|
module2.exports = copySync;
|
|
13047
13047
|
}
|
|
@@ -13063,13 +13063,13 @@ var require_copy2 = __commonJS({
|
|
|
13063
13063
|
var require_remove = __commonJS({
|
|
13064
13064
|
"../node_modules/fs-extra/lib/remove/index.js"(exports2, module2) {
|
|
13065
13065
|
"use strict";
|
|
13066
|
-
var
|
|
13066
|
+
var fs18 = require_graceful_fs();
|
|
13067
13067
|
var u = require_universalify().fromCallback;
|
|
13068
|
-
function remove(
|
|
13069
|
-
|
|
13068
|
+
function remove(path17, callback) {
|
|
13069
|
+
fs18.rm(path17, { recursive: true, force: true }, callback);
|
|
13070
13070
|
}
|
|
13071
|
-
function removeSync(
|
|
13072
|
-
|
|
13071
|
+
function removeSync(path17) {
|
|
13072
|
+
fs18.rmSync(path17, { recursive: true, force: true });
|
|
13073
13073
|
}
|
|
13074
13074
|
module2.exports = {
|
|
13075
13075
|
remove: u(remove),
|
|
@@ -13083,28 +13083,28 @@ var require_empty = __commonJS({
|
|
|
13083
13083
|
"../node_modules/fs-extra/lib/empty/index.js"(exports2, module2) {
|
|
13084
13084
|
"use strict";
|
|
13085
13085
|
var u = require_universalify().fromPromise;
|
|
13086
|
-
var
|
|
13087
|
-
var
|
|
13086
|
+
var fs18 = require_fs();
|
|
13087
|
+
var path17 = require("path");
|
|
13088
13088
|
var mkdir = require_mkdirs();
|
|
13089
13089
|
var remove = require_remove();
|
|
13090
13090
|
var emptyDir = u(async function emptyDir2(dir) {
|
|
13091
13091
|
let items;
|
|
13092
13092
|
try {
|
|
13093
|
-
items = await
|
|
13093
|
+
items = await fs18.readdir(dir);
|
|
13094
13094
|
} catch {
|
|
13095
13095
|
return mkdir.mkdirs(dir);
|
|
13096
13096
|
}
|
|
13097
|
-
return Promise.all(items.map((item) => remove.remove(
|
|
13097
|
+
return Promise.all(items.map((item) => remove.remove(path17.join(dir, item))));
|
|
13098
13098
|
});
|
|
13099
13099
|
function emptyDirSync(dir) {
|
|
13100
13100
|
let items;
|
|
13101
13101
|
try {
|
|
13102
|
-
items =
|
|
13102
|
+
items = fs18.readdirSync(dir);
|
|
13103
13103
|
} catch {
|
|
13104
13104
|
return mkdir.mkdirsSync(dir);
|
|
13105
13105
|
}
|
|
13106
13106
|
items.forEach((item) => {
|
|
13107
|
-
item =
|
|
13107
|
+
item = path17.join(dir, item);
|
|
13108
13108
|
remove.removeSync(item);
|
|
13109
13109
|
});
|
|
13110
13110
|
}
|
|
@@ -13122,52 +13122,52 @@ var require_file = __commonJS({
|
|
|
13122
13122
|
"../node_modules/fs-extra/lib/ensure/file.js"(exports2, module2) {
|
|
13123
13123
|
"use strict";
|
|
13124
13124
|
var u = require_universalify().fromPromise;
|
|
13125
|
-
var
|
|
13126
|
-
var
|
|
13125
|
+
var path17 = require("path");
|
|
13126
|
+
var fs18 = require_fs();
|
|
13127
13127
|
var mkdir = require_mkdirs();
|
|
13128
13128
|
async function createFile(file2) {
|
|
13129
13129
|
let stats;
|
|
13130
13130
|
try {
|
|
13131
|
-
stats = await
|
|
13131
|
+
stats = await fs18.stat(file2);
|
|
13132
13132
|
} catch {
|
|
13133
13133
|
}
|
|
13134
13134
|
if (stats && stats.isFile()) return;
|
|
13135
|
-
const dir =
|
|
13135
|
+
const dir = path17.dirname(file2);
|
|
13136
13136
|
let dirStats = null;
|
|
13137
13137
|
try {
|
|
13138
|
-
dirStats = await
|
|
13138
|
+
dirStats = await fs18.stat(dir);
|
|
13139
13139
|
} catch (err) {
|
|
13140
13140
|
if (err.code === "ENOENT") {
|
|
13141
13141
|
await mkdir.mkdirs(dir);
|
|
13142
|
-
await
|
|
13142
|
+
await fs18.writeFile(file2, "");
|
|
13143
13143
|
return;
|
|
13144
13144
|
} else {
|
|
13145
13145
|
throw err;
|
|
13146
13146
|
}
|
|
13147
13147
|
}
|
|
13148
13148
|
if (dirStats.isDirectory()) {
|
|
13149
|
-
await
|
|
13149
|
+
await fs18.writeFile(file2, "");
|
|
13150
13150
|
} else {
|
|
13151
|
-
await
|
|
13151
|
+
await fs18.readdir(dir);
|
|
13152
13152
|
}
|
|
13153
13153
|
}
|
|
13154
13154
|
function createFileSync(file2) {
|
|
13155
13155
|
let stats;
|
|
13156
13156
|
try {
|
|
13157
|
-
stats =
|
|
13157
|
+
stats = fs18.statSync(file2);
|
|
13158
13158
|
} catch {
|
|
13159
13159
|
}
|
|
13160
13160
|
if (stats && stats.isFile()) return;
|
|
13161
|
-
const dir =
|
|
13161
|
+
const dir = path17.dirname(file2);
|
|
13162
13162
|
try {
|
|
13163
|
-
if (!
|
|
13164
|
-
|
|
13163
|
+
if (!fs18.statSync(dir).isDirectory()) {
|
|
13164
|
+
fs18.readdirSync(dir);
|
|
13165
13165
|
}
|
|
13166
13166
|
} catch (err) {
|
|
13167
13167
|
if (err && err.code === "ENOENT") mkdir.mkdirsSync(dir);
|
|
13168
13168
|
else throw err;
|
|
13169
13169
|
}
|
|
13170
|
-
|
|
13170
|
+
fs18.writeFileSync(file2, "");
|
|
13171
13171
|
}
|
|
13172
13172
|
module2.exports = {
|
|
13173
13173
|
createFile: u(createFile),
|
|
@@ -13181,50 +13181,50 @@ var require_link = __commonJS({
|
|
|
13181
13181
|
"../node_modules/fs-extra/lib/ensure/link.js"(exports2, module2) {
|
|
13182
13182
|
"use strict";
|
|
13183
13183
|
var u = require_universalify().fromPromise;
|
|
13184
|
-
var
|
|
13185
|
-
var
|
|
13184
|
+
var path17 = require("path");
|
|
13185
|
+
var fs18 = require_fs();
|
|
13186
13186
|
var mkdir = require_mkdirs();
|
|
13187
13187
|
var { pathExists } = require_path_exists();
|
|
13188
13188
|
var { areIdentical } = require_stat();
|
|
13189
13189
|
async function createLink(srcpath, dstpath) {
|
|
13190
13190
|
let dstStat;
|
|
13191
13191
|
try {
|
|
13192
|
-
dstStat = await
|
|
13192
|
+
dstStat = await fs18.lstat(dstpath);
|
|
13193
13193
|
} catch {
|
|
13194
13194
|
}
|
|
13195
13195
|
let srcStat;
|
|
13196
13196
|
try {
|
|
13197
|
-
srcStat = await
|
|
13197
|
+
srcStat = await fs18.lstat(srcpath);
|
|
13198
13198
|
} catch (err) {
|
|
13199
13199
|
err.message = err.message.replace("lstat", "ensureLink");
|
|
13200
13200
|
throw err;
|
|
13201
13201
|
}
|
|
13202
13202
|
if (dstStat && areIdentical(srcStat, dstStat)) return;
|
|
13203
|
-
const dir =
|
|
13203
|
+
const dir = path17.dirname(dstpath);
|
|
13204
13204
|
const dirExists = await pathExists(dir);
|
|
13205
13205
|
if (!dirExists) {
|
|
13206
13206
|
await mkdir.mkdirs(dir);
|
|
13207
13207
|
}
|
|
13208
|
-
await
|
|
13208
|
+
await fs18.link(srcpath, dstpath);
|
|
13209
13209
|
}
|
|
13210
13210
|
function createLinkSync(srcpath, dstpath) {
|
|
13211
13211
|
let dstStat;
|
|
13212
13212
|
try {
|
|
13213
|
-
dstStat =
|
|
13213
|
+
dstStat = fs18.lstatSync(dstpath);
|
|
13214
13214
|
} catch {
|
|
13215
13215
|
}
|
|
13216
13216
|
try {
|
|
13217
|
-
const srcStat =
|
|
13217
|
+
const srcStat = fs18.lstatSync(srcpath);
|
|
13218
13218
|
if (dstStat && areIdentical(srcStat, dstStat)) return;
|
|
13219
13219
|
} catch (err) {
|
|
13220
13220
|
err.message = err.message.replace("lstat", "ensureLink");
|
|
13221
13221
|
throw err;
|
|
13222
13222
|
}
|
|
13223
|
-
const dir =
|
|
13224
|
-
const dirExists =
|
|
13225
|
-
if (dirExists) return
|
|
13223
|
+
const dir = path17.dirname(dstpath);
|
|
13224
|
+
const dirExists = fs18.existsSync(dir);
|
|
13225
|
+
if (dirExists) return fs18.linkSync(srcpath, dstpath);
|
|
13226
13226
|
mkdir.mkdirsSync(dir);
|
|
13227
|
-
return
|
|
13227
|
+
return fs18.linkSync(srcpath, dstpath);
|
|
13228
13228
|
}
|
|
13229
13229
|
module2.exports = {
|
|
13230
13230
|
createLink: u(createLink),
|
|
@@ -13237,14 +13237,14 @@ var require_link = __commonJS({
|
|
|
13237
13237
|
var require_symlink_paths = __commonJS({
|
|
13238
13238
|
"../node_modules/fs-extra/lib/ensure/symlink-paths.js"(exports2, module2) {
|
|
13239
13239
|
"use strict";
|
|
13240
|
-
var
|
|
13241
|
-
var
|
|
13240
|
+
var path17 = require("path");
|
|
13241
|
+
var fs18 = require_fs();
|
|
13242
13242
|
var { pathExists } = require_path_exists();
|
|
13243
13243
|
var u = require_universalify().fromPromise;
|
|
13244
13244
|
async function symlinkPaths(srcpath, dstpath) {
|
|
13245
|
-
if (
|
|
13245
|
+
if (path17.isAbsolute(srcpath)) {
|
|
13246
13246
|
try {
|
|
13247
|
-
await
|
|
13247
|
+
await fs18.lstat(srcpath);
|
|
13248
13248
|
} catch (err) {
|
|
13249
13249
|
err.message = err.message.replace("lstat", "ensureSymlink");
|
|
13250
13250
|
throw err;
|
|
@@ -13254,8 +13254,8 @@ var require_symlink_paths = __commonJS({
|
|
|
13254
13254
|
toDst: srcpath
|
|
13255
13255
|
};
|
|
13256
13256
|
}
|
|
13257
|
-
const dstdir =
|
|
13258
|
-
const relativeToDst =
|
|
13257
|
+
const dstdir = path17.dirname(dstpath);
|
|
13258
|
+
const relativeToDst = path17.join(dstdir, srcpath);
|
|
13259
13259
|
const exists = await pathExists(relativeToDst);
|
|
13260
13260
|
if (exists) {
|
|
13261
13261
|
return {
|
|
@@ -13264,39 +13264,39 @@ var require_symlink_paths = __commonJS({
|
|
|
13264
13264
|
};
|
|
13265
13265
|
}
|
|
13266
13266
|
try {
|
|
13267
|
-
await
|
|
13267
|
+
await fs18.lstat(srcpath);
|
|
13268
13268
|
} catch (err) {
|
|
13269
13269
|
err.message = err.message.replace("lstat", "ensureSymlink");
|
|
13270
13270
|
throw err;
|
|
13271
13271
|
}
|
|
13272
13272
|
return {
|
|
13273
13273
|
toCwd: srcpath,
|
|
13274
|
-
toDst:
|
|
13274
|
+
toDst: path17.relative(dstdir, srcpath)
|
|
13275
13275
|
};
|
|
13276
13276
|
}
|
|
13277
13277
|
function symlinkPathsSync(srcpath, dstpath) {
|
|
13278
|
-
if (
|
|
13279
|
-
const exists2 =
|
|
13278
|
+
if (path17.isAbsolute(srcpath)) {
|
|
13279
|
+
const exists2 = fs18.existsSync(srcpath);
|
|
13280
13280
|
if (!exists2) throw new Error("absolute srcpath does not exist");
|
|
13281
13281
|
return {
|
|
13282
13282
|
toCwd: srcpath,
|
|
13283
13283
|
toDst: srcpath
|
|
13284
13284
|
};
|
|
13285
13285
|
}
|
|
13286
|
-
const dstdir =
|
|
13287
|
-
const relativeToDst =
|
|
13288
|
-
const exists =
|
|
13286
|
+
const dstdir = path17.dirname(dstpath);
|
|
13287
|
+
const relativeToDst = path17.join(dstdir, srcpath);
|
|
13288
|
+
const exists = fs18.existsSync(relativeToDst);
|
|
13289
13289
|
if (exists) {
|
|
13290
13290
|
return {
|
|
13291
13291
|
toCwd: relativeToDst,
|
|
13292
13292
|
toDst: srcpath
|
|
13293
13293
|
};
|
|
13294
13294
|
}
|
|
13295
|
-
const srcExists =
|
|
13295
|
+
const srcExists = fs18.existsSync(srcpath);
|
|
13296
13296
|
if (!srcExists) throw new Error("relative srcpath does not exist");
|
|
13297
13297
|
return {
|
|
13298
13298
|
toCwd: srcpath,
|
|
13299
|
-
toDst:
|
|
13299
|
+
toDst: path17.relative(dstdir, srcpath)
|
|
13300
13300
|
};
|
|
13301
13301
|
}
|
|
13302
13302
|
module2.exports = {
|
|
@@ -13310,13 +13310,13 @@ var require_symlink_paths = __commonJS({
|
|
|
13310
13310
|
var require_symlink_type = __commonJS({
|
|
13311
13311
|
"../node_modules/fs-extra/lib/ensure/symlink-type.js"(exports2, module2) {
|
|
13312
13312
|
"use strict";
|
|
13313
|
-
var
|
|
13313
|
+
var fs18 = require_fs();
|
|
13314
13314
|
var u = require_universalify().fromPromise;
|
|
13315
13315
|
async function symlinkType(srcpath, type) {
|
|
13316
13316
|
if (type) return type;
|
|
13317
13317
|
let stats;
|
|
13318
13318
|
try {
|
|
13319
|
-
stats = await
|
|
13319
|
+
stats = await fs18.lstat(srcpath);
|
|
13320
13320
|
} catch {
|
|
13321
13321
|
return "file";
|
|
13322
13322
|
}
|
|
@@ -13326,7 +13326,7 @@ var require_symlink_type = __commonJS({
|
|
|
13326
13326
|
if (type) return type;
|
|
13327
13327
|
let stats;
|
|
13328
13328
|
try {
|
|
13329
|
-
stats =
|
|
13329
|
+
stats = fs18.lstatSync(srcpath);
|
|
13330
13330
|
} catch {
|
|
13331
13331
|
return "file";
|
|
13332
13332
|
}
|
|
@@ -13344,8 +13344,8 @@ var require_symlink = __commonJS({
|
|
|
13344
13344
|
"../node_modules/fs-extra/lib/ensure/symlink.js"(exports2, module2) {
|
|
13345
13345
|
"use strict";
|
|
13346
13346
|
var u = require_universalify().fromPromise;
|
|
13347
|
-
var
|
|
13348
|
-
var
|
|
13347
|
+
var path17 = require("path");
|
|
13348
|
+
var fs18 = require_fs();
|
|
13349
13349
|
var { mkdirs, mkdirsSync } = require_mkdirs();
|
|
13350
13350
|
var { symlinkPaths, symlinkPathsSync } = require_symlink_paths();
|
|
13351
13351
|
var { symlinkType, symlinkTypeSync } = require_symlink_type();
|
|
@@ -13354,44 +13354,44 @@ var require_symlink = __commonJS({
|
|
|
13354
13354
|
async function createSymlink(srcpath, dstpath, type) {
|
|
13355
13355
|
let stats;
|
|
13356
13356
|
try {
|
|
13357
|
-
stats = await
|
|
13357
|
+
stats = await fs18.lstat(dstpath);
|
|
13358
13358
|
} catch {
|
|
13359
13359
|
}
|
|
13360
13360
|
if (stats && stats.isSymbolicLink()) {
|
|
13361
13361
|
const [srcStat, dstStat] = await Promise.all([
|
|
13362
|
-
|
|
13363
|
-
|
|
13362
|
+
fs18.stat(srcpath),
|
|
13363
|
+
fs18.stat(dstpath)
|
|
13364
13364
|
]);
|
|
13365
13365
|
if (areIdentical(srcStat, dstStat)) return;
|
|
13366
13366
|
}
|
|
13367
13367
|
const relative = await symlinkPaths(srcpath, dstpath);
|
|
13368
13368
|
srcpath = relative.toDst;
|
|
13369
13369
|
const toType = await symlinkType(relative.toCwd, type);
|
|
13370
|
-
const dir =
|
|
13370
|
+
const dir = path17.dirname(dstpath);
|
|
13371
13371
|
if (!await pathExists(dir)) {
|
|
13372
13372
|
await mkdirs(dir);
|
|
13373
13373
|
}
|
|
13374
|
-
return
|
|
13374
|
+
return fs18.symlink(srcpath, dstpath, toType);
|
|
13375
13375
|
}
|
|
13376
13376
|
function createSymlinkSync(srcpath, dstpath, type) {
|
|
13377
13377
|
let stats;
|
|
13378
13378
|
try {
|
|
13379
|
-
stats =
|
|
13379
|
+
stats = fs18.lstatSync(dstpath);
|
|
13380
13380
|
} catch {
|
|
13381
13381
|
}
|
|
13382
13382
|
if (stats && stats.isSymbolicLink()) {
|
|
13383
|
-
const srcStat =
|
|
13384
|
-
const dstStat =
|
|
13383
|
+
const srcStat = fs18.statSync(srcpath);
|
|
13384
|
+
const dstStat = fs18.statSync(dstpath);
|
|
13385
13385
|
if (areIdentical(srcStat, dstStat)) return;
|
|
13386
13386
|
}
|
|
13387
13387
|
const relative = symlinkPathsSync(srcpath, dstpath);
|
|
13388
13388
|
srcpath = relative.toDst;
|
|
13389
13389
|
type = symlinkTypeSync(relative.toCwd, type);
|
|
13390
|
-
const dir =
|
|
13391
|
-
const exists =
|
|
13392
|
-
if (exists) return
|
|
13390
|
+
const dir = path17.dirname(dstpath);
|
|
13391
|
+
const exists = fs18.existsSync(dir);
|
|
13392
|
+
if (exists) return fs18.symlinkSync(srcpath, dstpath, type);
|
|
13393
13393
|
mkdirsSync(dir);
|
|
13394
|
-
return
|
|
13394
|
+
return fs18.symlinkSync(srcpath, dstpath, type);
|
|
13395
13395
|
}
|
|
13396
13396
|
module2.exports = {
|
|
13397
13397
|
createSymlink: u(createSymlink),
|
|
@@ -13460,9 +13460,9 @@ var require_jsonfile = __commonJS({
|
|
|
13460
13460
|
if (typeof options === "string") {
|
|
13461
13461
|
options = { encoding: options };
|
|
13462
13462
|
}
|
|
13463
|
-
const
|
|
13463
|
+
const fs18 = options.fs || _fs;
|
|
13464
13464
|
const shouldThrow = "throws" in options ? options.throws : true;
|
|
13465
|
-
let data = await universalify.fromCallback(
|
|
13465
|
+
let data = await universalify.fromCallback(fs18.readFile)(file2, options);
|
|
13466
13466
|
data = stripBom(data);
|
|
13467
13467
|
let obj;
|
|
13468
13468
|
try {
|
|
@@ -13482,10 +13482,10 @@ var require_jsonfile = __commonJS({
|
|
|
13482
13482
|
if (typeof options === "string") {
|
|
13483
13483
|
options = { encoding: options };
|
|
13484
13484
|
}
|
|
13485
|
-
const
|
|
13485
|
+
const fs18 = options.fs || _fs;
|
|
13486
13486
|
const shouldThrow = "throws" in options ? options.throws : true;
|
|
13487
13487
|
try {
|
|
13488
|
-
let content =
|
|
13488
|
+
let content = fs18.readFileSync(file2, options);
|
|
13489
13489
|
content = stripBom(content);
|
|
13490
13490
|
return JSON.parse(content, options.reviver);
|
|
13491
13491
|
} catch (err) {
|
|
@@ -13498,15 +13498,15 @@ var require_jsonfile = __commonJS({
|
|
|
13498
13498
|
}
|
|
13499
13499
|
}
|
|
13500
13500
|
async function _writeFile(file2, obj, options = {}) {
|
|
13501
|
-
const
|
|
13501
|
+
const fs18 = options.fs || _fs;
|
|
13502
13502
|
const str = stringify2(obj, options);
|
|
13503
|
-
await universalify.fromCallback(
|
|
13503
|
+
await universalify.fromCallback(fs18.writeFile)(file2, str, options);
|
|
13504
13504
|
}
|
|
13505
13505
|
var writeFile = universalify.fromPromise(_writeFile);
|
|
13506
13506
|
function writeFileSync2(file2, obj, options = {}) {
|
|
13507
|
-
const
|
|
13507
|
+
const fs18 = options.fs || _fs;
|
|
13508
13508
|
const str = stringify2(obj, options);
|
|
13509
|
-
return
|
|
13509
|
+
return fs18.writeFileSync(file2, str, options);
|
|
13510
13510
|
}
|
|
13511
13511
|
module2.exports = {
|
|
13512
13512
|
readFile,
|
|
@@ -13537,23 +13537,23 @@ var require_output_file = __commonJS({
|
|
|
13537
13537
|
"../node_modules/fs-extra/lib/output-file/index.js"(exports2, module2) {
|
|
13538
13538
|
"use strict";
|
|
13539
13539
|
var u = require_universalify().fromPromise;
|
|
13540
|
-
var
|
|
13541
|
-
var
|
|
13540
|
+
var fs18 = require_fs();
|
|
13541
|
+
var path17 = require("path");
|
|
13542
13542
|
var mkdir = require_mkdirs();
|
|
13543
13543
|
var pathExists = require_path_exists().pathExists;
|
|
13544
13544
|
async function outputFile(file2, data, encoding = "utf-8") {
|
|
13545
|
-
const dir =
|
|
13545
|
+
const dir = path17.dirname(file2);
|
|
13546
13546
|
if (!await pathExists(dir)) {
|
|
13547
13547
|
await mkdir.mkdirs(dir);
|
|
13548
13548
|
}
|
|
13549
|
-
return
|
|
13549
|
+
return fs18.writeFile(file2, data, encoding);
|
|
13550
13550
|
}
|
|
13551
13551
|
function outputFileSync(file2, ...args) {
|
|
13552
|
-
const dir =
|
|
13553
|
-
if (!
|
|
13552
|
+
const dir = path17.dirname(file2);
|
|
13553
|
+
if (!fs18.existsSync(dir)) {
|
|
13554
13554
|
mkdir.mkdirsSync(dir);
|
|
13555
13555
|
}
|
|
13556
|
-
|
|
13556
|
+
fs18.writeFileSync(file2, ...args);
|
|
13557
13557
|
}
|
|
13558
13558
|
module2.exports = {
|
|
13559
13559
|
outputFile: u(outputFile),
|
|
@@ -13612,8 +13612,8 @@ var require_json = __commonJS({
|
|
|
13612
13612
|
var require_move = __commonJS({
|
|
13613
13613
|
"../node_modules/fs-extra/lib/move/move.js"(exports2, module2) {
|
|
13614
13614
|
"use strict";
|
|
13615
|
-
var
|
|
13616
|
-
var
|
|
13615
|
+
var fs18 = require_fs();
|
|
13616
|
+
var path17 = require("path");
|
|
13617
13617
|
var { copy } = require_copy2();
|
|
13618
13618
|
var { remove } = require_remove();
|
|
13619
13619
|
var { mkdirp } = require_mkdirs();
|
|
@@ -13623,8 +13623,8 @@ var require_move = __commonJS({
|
|
|
13623
13623
|
const overwrite = opts.overwrite || opts.clobber || false;
|
|
13624
13624
|
const { srcStat, isChangingCase = false } = await stat.checkPaths(src, dest, "move", opts);
|
|
13625
13625
|
await stat.checkParentPaths(src, srcStat, dest, "move");
|
|
13626
|
-
const destParent =
|
|
13627
|
-
const parsedParentPath =
|
|
13626
|
+
const destParent = path17.dirname(dest);
|
|
13627
|
+
const parsedParentPath = path17.parse(destParent);
|
|
13628
13628
|
if (parsedParentPath.root !== destParent) {
|
|
13629
13629
|
await mkdirp(destParent);
|
|
13630
13630
|
}
|
|
@@ -13639,7 +13639,7 @@ var require_move = __commonJS({
|
|
|
13639
13639
|
}
|
|
13640
13640
|
}
|
|
13641
13641
|
try {
|
|
13642
|
-
await
|
|
13642
|
+
await fs18.rename(src, dest);
|
|
13643
13643
|
} catch (err) {
|
|
13644
13644
|
if (err.code !== "EXDEV") {
|
|
13645
13645
|
throw err;
|
|
@@ -13664,8 +13664,8 @@ var require_move = __commonJS({
|
|
|
13664
13664
|
var require_move_sync = __commonJS({
|
|
13665
13665
|
"../node_modules/fs-extra/lib/move/move-sync.js"(exports2, module2) {
|
|
13666
13666
|
"use strict";
|
|
13667
|
-
var
|
|
13668
|
-
var
|
|
13667
|
+
var fs18 = require_graceful_fs();
|
|
13668
|
+
var path17 = require("path");
|
|
13669
13669
|
var copySync = require_copy2().copySync;
|
|
13670
13670
|
var removeSync = require_remove().removeSync;
|
|
13671
13671
|
var mkdirpSync = require_mkdirs().mkdirpSync;
|
|
@@ -13675,12 +13675,12 @@ var require_move_sync = __commonJS({
|
|
|
13675
13675
|
const overwrite = opts.overwrite || opts.clobber || false;
|
|
13676
13676
|
const { srcStat, isChangingCase = false } = stat.checkPathsSync(src, dest, "move", opts);
|
|
13677
13677
|
stat.checkParentPathsSync(src, srcStat, dest, "move");
|
|
13678
|
-
if (!isParentRoot(dest)) mkdirpSync(
|
|
13678
|
+
if (!isParentRoot(dest)) mkdirpSync(path17.dirname(dest));
|
|
13679
13679
|
return doRename(src, dest, overwrite, isChangingCase);
|
|
13680
13680
|
}
|
|
13681
13681
|
function isParentRoot(dest) {
|
|
13682
|
-
const parent =
|
|
13683
|
-
const parsedPath =
|
|
13682
|
+
const parent = path17.dirname(dest);
|
|
13683
|
+
const parsedPath = path17.parse(parent);
|
|
13684
13684
|
return parsedPath.root === parent;
|
|
13685
13685
|
}
|
|
13686
13686
|
function doRename(src, dest, overwrite, isChangingCase) {
|
|
@@ -13689,12 +13689,12 @@ var require_move_sync = __commonJS({
|
|
|
13689
13689
|
removeSync(dest);
|
|
13690
13690
|
return rename(src, dest, overwrite);
|
|
13691
13691
|
}
|
|
13692
|
-
if (
|
|
13692
|
+
if (fs18.existsSync(dest)) throw new Error("dest already exists.");
|
|
13693
13693
|
return rename(src, dest, overwrite);
|
|
13694
13694
|
}
|
|
13695
13695
|
function rename(src, dest, overwrite) {
|
|
13696
13696
|
try {
|
|
13697
|
-
|
|
13697
|
+
fs18.renameSync(src, dest);
|
|
13698
13698
|
} catch (err) {
|
|
13699
13699
|
if (err.code !== "EXDEV") throw err;
|
|
13700
13700
|
return moveAcrossDevice(src, dest, overwrite);
|
|
@@ -16939,8 +16939,8 @@ var require_utils3 = __commonJS({
|
|
|
16939
16939
|
}
|
|
16940
16940
|
return ind;
|
|
16941
16941
|
}
|
|
16942
|
-
function removeDotSegments(
|
|
16943
|
-
let input =
|
|
16942
|
+
function removeDotSegments(path17) {
|
|
16943
|
+
let input = path17;
|
|
16944
16944
|
const output = [];
|
|
16945
16945
|
let nextSlash = -1;
|
|
16946
16946
|
let len = 0;
|
|
@@ -17139,8 +17139,8 @@ var require_schemes = __commonJS({
|
|
|
17139
17139
|
wsComponent.secure = void 0;
|
|
17140
17140
|
}
|
|
17141
17141
|
if (wsComponent.resourceName) {
|
|
17142
|
-
const [
|
|
17143
|
-
wsComponent.path =
|
|
17142
|
+
const [path17, query] = wsComponent.resourceName.split("?");
|
|
17143
|
+
wsComponent.path = path17 && path17 !== "/" ? path17 : void 0;
|
|
17144
17144
|
wsComponent.query = query;
|
|
17145
17145
|
wsComponent.resourceName = void 0;
|
|
17146
17146
|
}
|
|
@@ -20466,12 +20466,12 @@ var require_dist2 = __commonJS({
|
|
|
20466
20466
|
throw new Error(`Unknown format "${name}"`);
|
|
20467
20467
|
return f;
|
|
20468
20468
|
};
|
|
20469
|
-
function addFormats(ajv, list,
|
|
20469
|
+
function addFormats(ajv, list, fs18, exportName) {
|
|
20470
20470
|
var _a2;
|
|
20471
20471
|
var _b;
|
|
20472
20472
|
(_a2 = (_b = ajv.opts.code).formats) !== null && _a2 !== void 0 ? _a2 : _b.formats = codegen_1._`require("ajv-formats/dist/formats").${exportName}`;
|
|
20473
20473
|
for (const f of list)
|
|
20474
|
-
ajv.addFormat(f,
|
|
20474
|
+
ajv.addFormat(f, fs18[f]);
|
|
20475
20475
|
}
|
|
20476
20476
|
module2.exports = exports2 = formatsPlugin;
|
|
20477
20477
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
@@ -31073,8 +31073,8 @@ var require_package = __commonJS({
|
|
|
31073
31073
|
var require_main = __commonJS({
|
|
31074
31074
|
"node_modules/dotenv/lib/main.js"(exports2, module2) {
|
|
31075
31075
|
"use strict";
|
|
31076
|
-
var
|
|
31077
|
-
var
|
|
31076
|
+
var fs18 = require("fs");
|
|
31077
|
+
var path17 = require("path");
|
|
31078
31078
|
var os7 = require("os");
|
|
31079
31079
|
var crypto2 = require("crypto");
|
|
31080
31080
|
var packageJson = require_package();
|
|
@@ -31182,7 +31182,7 @@ var require_main = __commonJS({
|
|
|
31182
31182
|
if (options && options.path && options.path.length > 0) {
|
|
31183
31183
|
if (Array.isArray(options.path)) {
|
|
31184
31184
|
for (const filepath of options.path) {
|
|
31185
|
-
if (
|
|
31185
|
+
if (fs18.existsSync(filepath)) {
|
|
31186
31186
|
possibleVaultPath = filepath.endsWith(".vault") ? filepath : `${filepath}.vault`;
|
|
31187
31187
|
}
|
|
31188
31188
|
}
|
|
@@ -31190,15 +31190,15 @@ var require_main = __commonJS({
|
|
|
31190
31190
|
possibleVaultPath = options.path.endsWith(".vault") ? options.path : `${options.path}.vault`;
|
|
31191
31191
|
}
|
|
31192
31192
|
} else {
|
|
31193
|
-
possibleVaultPath =
|
|
31193
|
+
possibleVaultPath = path17.resolve(process.cwd(), ".env.vault");
|
|
31194
31194
|
}
|
|
31195
|
-
if (
|
|
31195
|
+
if (fs18.existsSync(possibleVaultPath)) {
|
|
31196
31196
|
return possibleVaultPath;
|
|
31197
31197
|
}
|
|
31198
31198
|
return null;
|
|
31199
31199
|
}
|
|
31200
31200
|
function _resolveHome(envPath) {
|
|
31201
|
-
return envPath[0] === "~" ?
|
|
31201
|
+
return envPath[0] === "~" ? path17.join(os7.homedir(), envPath.slice(1)) : envPath;
|
|
31202
31202
|
}
|
|
31203
31203
|
function _configVault(options) {
|
|
31204
31204
|
const debug = Boolean(options && options.debug);
|
|
@@ -31215,7 +31215,7 @@ var require_main = __commonJS({
|
|
|
31215
31215
|
return { parsed };
|
|
31216
31216
|
}
|
|
31217
31217
|
function configDotenv(options) {
|
|
31218
|
-
const dotenvPath =
|
|
31218
|
+
const dotenvPath = path17.resolve(process.cwd(), ".env");
|
|
31219
31219
|
let encoding = "utf8";
|
|
31220
31220
|
const debug = Boolean(options && options.debug);
|
|
31221
31221
|
const quiet = options && "quiet" in options ? options.quiet : true;
|
|
@@ -31239,13 +31239,13 @@ var require_main = __commonJS({
|
|
|
31239
31239
|
}
|
|
31240
31240
|
let lastError;
|
|
31241
31241
|
const parsedAll = {};
|
|
31242
|
-
for (const
|
|
31242
|
+
for (const path18 of optionPaths) {
|
|
31243
31243
|
try {
|
|
31244
|
-
const parsed = DotenvModule.parse(
|
|
31244
|
+
const parsed = DotenvModule.parse(fs18.readFileSync(path18, { encoding }));
|
|
31245
31245
|
DotenvModule.populate(parsedAll, parsed, options);
|
|
31246
31246
|
} catch (e) {
|
|
31247
31247
|
if (debug) {
|
|
31248
|
-
_debug(`Failed to load ${
|
|
31248
|
+
_debug(`Failed to load ${path18} ${e.message}`);
|
|
31249
31249
|
}
|
|
31250
31250
|
lastError = e;
|
|
31251
31251
|
}
|
|
@@ -31260,7 +31260,7 @@ var require_main = __commonJS({
|
|
|
31260
31260
|
const shortPaths = [];
|
|
31261
31261
|
for (const filePath of optionPaths) {
|
|
31262
31262
|
try {
|
|
31263
|
-
const relative =
|
|
31263
|
+
const relative = path17.relative(process.cwd(), filePath);
|
|
31264
31264
|
shortPaths.push(relative);
|
|
31265
31265
|
} catch (e) {
|
|
31266
31266
|
if (debug) {
|
|
@@ -33948,7 +33948,7 @@ function init(open, close) {
|
|
|
33948
33948
|
var kleur_default = $;
|
|
33949
33949
|
|
|
33950
33950
|
// src/commands/install.ts
|
|
33951
|
-
var
|
|
33951
|
+
var import_prompts3 = __toESM(require_prompts3(), 1);
|
|
33952
33952
|
|
|
33953
33953
|
// ../node_modules/eventemitter3/index.mjs
|
|
33954
33954
|
var import_index2 = __toESM(require_eventemitter3(), 1);
|
|
@@ -35746,7 +35746,7 @@ var Listr = class {
|
|
|
35746
35746
|
};
|
|
35747
35747
|
|
|
35748
35748
|
// src/commands/install.ts
|
|
35749
|
-
var
|
|
35749
|
+
var import_fs_extra13 = __toESM(require_lib2(), 1);
|
|
35750
35750
|
|
|
35751
35751
|
// src/core/context.ts
|
|
35752
35752
|
var import_os2 = __toESM(require("os"), 1);
|
|
@@ -35772,12 +35772,12 @@ var disallowedKeys = /* @__PURE__ */ new Set([
|
|
|
35772
35772
|
"constructor"
|
|
35773
35773
|
]);
|
|
35774
35774
|
var digits = new Set("0123456789");
|
|
35775
|
-
function getPathSegments(
|
|
35775
|
+
function getPathSegments(path17) {
|
|
35776
35776
|
const parts = [];
|
|
35777
35777
|
let currentSegment = "";
|
|
35778
35778
|
let currentPart = "start";
|
|
35779
35779
|
let isIgnoring = false;
|
|
35780
|
-
for (const character of
|
|
35780
|
+
for (const character of path17) {
|
|
35781
35781
|
switch (character) {
|
|
35782
35782
|
case "\\": {
|
|
35783
35783
|
if (currentPart === "index") {
|
|
@@ -35899,11 +35899,11 @@ function assertNotStringIndex(object2, key) {
|
|
|
35899
35899
|
throw new Error("Cannot use string index");
|
|
35900
35900
|
}
|
|
35901
35901
|
}
|
|
35902
|
-
function getProperty(object2,
|
|
35903
|
-
if (!isObject(object2) || typeof
|
|
35902
|
+
function getProperty(object2, path17, value) {
|
|
35903
|
+
if (!isObject(object2) || typeof path17 !== "string") {
|
|
35904
35904
|
return value === void 0 ? object2 : value;
|
|
35905
35905
|
}
|
|
35906
|
-
const pathArray = getPathSegments(
|
|
35906
|
+
const pathArray = getPathSegments(path17);
|
|
35907
35907
|
if (pathArray.length === 0) {
|
|
35908
35908
|
return value;
|
|
35909
35909
|
}
|
|
@@ -35923,12 +35923,12 @@ function getProperty(object2, path16, value) {
|
|
|
35923
35923
|
}
|
|
35924
35924
|
return object2 === void 0 ? value : object2;
|
|
35925
35925
|
}
|
|
35926
|
-
function setProperty(object2,
|
|
35927
|
-
if (!isObject(object2) || typeof
|
|
35926
|
+
function setProperty(object2, path17, value) {
|
|
35927
|
+
if (!isObject(object2) || typeof path17 !== "string") {
|
|
35928
35928
|
return object2;
|
|
35929
35929
|
}
|
|
35930
35930
|
const root = object2;
|
|
35931
|
-
const pathArray = getPathSegments(
|
|
35931
|
+
const pathArray = getPathSegments(path17);
|
|
35932
35932
|
for (let index = 0; index < pathArray.length; index++) {
|
|
35933
35933
|
const key = pathArray[index];
|
|
35934
35934
|
assertNotStringIndex(object2, key);
|
|
@@ -35941,11 +35941,11 @@ function setProperty(object2, path16, value) {
|
|
|
35941
35941
|
}
|
|
35942
35942
|
return root;
|
|
35943
35943
|
}
|
|
35944
|
-
function deleteProperty(object2,
|
|
35945
|
-
if (!isObject(object2) || typeof
|
|
35944
|
+
function deleteProperty(object2, path17) {
|
|
35945
|
+
if (!isObject(object2) || typeof path17 !== "string") {
|
|
35946
35946
|
return false;
|
|
35947
35947
|
}
|
|
35948
|
-
const pathArray = getPathSegments(
|
|
35948
|
+
const pathArray = getPathSegments(path17);
|
|
35949
35949
|
for (let index = 0; index < pathArray.length; index++) {
|
|
35950
35950
|
const key = pathArray[index];
|
|
35951
35951
|
assertNotStringIndex(object2, key);
|
|
@@ -35959,11 +35959,11 @@ function deleteProperty(object2, path16) {
|
|
|
35959
35959
|
}
|
|
35960
35960
|
}
|
|
35961
35961
|
}
|
|
35962
|
-
function hasProperty(object2,
|
|
35963
|
-
if (!isObject(object2) || typeof
|
|
35962
|
+
function hasProperty(object2, path17) {
|
|
35963
|
+
if (!isObject(object2) || typeof path17 !== "string") {
|
|
35964
35964
|
return false;
|
|
35965
35965
|
}
|
|
35966
|
-
const pathArray = getPathSegments(
|
|
35966
|
+
const pathArray = getPathSegments(path17);
|
|
35967
35967
|
if (pathArray.length === 0) {
|
|
35968
35968
|
return false;
|
|
35969
35969
|
}
|
|
@@ -37174,8 +37174,8 @@ function detectAdapter(systemRoot) {
|
|
|
37174
37174
|
// src/core/diff.ts
|
|
37175
37175
|
var IGNORED_ITEMS = /* @__PURE__ */ new Set(["__pycache__", ".DS_Store", "Thumbs.db", ".gitkeep", "node_modules"]);
|
|
37176
37176
|
var PruneModeReadError = class extends Error {
|
|
37177
|
-
constructor(
|
|
37178
|
-
super(`Cannot read ${
|
|
37177
|
+
constructor(path17) {
|
|
37178
|
+
super(`Cannot read ${path17} in prune mode \u2014 aborting to prevent accidental deletion`);
|
|
37179
37179
|
this.name = "PruneModeReadError";
|
|
37180
37180
|
}
|
|
37181
37181
|
};
|
|
@@ -40045,7 +40045,7 @@ async function handleMissingEnvVars(missing) {
|
|
|
40045
40045
|
if (missing.length === 0) {
|
|
40046
40046
|
return true;
|
|
40047
40047
|
}
|
|
40048
|
-
const
|
|
40048
|
+
const prompts5 = (await Promise.resolve().then(() => __toESM(require_prompts3(), 1))).default;
|
|
40049
40049
|
const answers = {};
|
|
40050
40050
|
for (const key of missing) {
|
|
40051
40051
|
const config3 = REQUIRED_ENV_VARS[key];
|
|
@@ -40057,7 +40057,7 @@ async function handleMissingEnvVars(missing) {
|
|
|
40057
40057
|
console.log(kleur_default.yellow(`
|
|
40058
40058
|
\u26A0\uFE0F ${key} is required by a selected MCP server`));
|
|
40059
40059
|
}
|
|
40060
|
-
const { value } = await
|
|
40060
|
+
const { value } = await prompts5({
|
|
40061
40061
|
type: "text",
|
|
40062
40062
|
name: "value",
|
|
40063
40063
|
message: `Enter ${key}:`,
|
|
@@ -40346,8 +40346,8 @@ async function syncMcpServersWithCli(agent, mcpConfig, dryRun = false, prune = f
|
|
|
40346
40346
|
}
|
|
40347
40347
|
let selectedNames = toAdd.map(([name]) => name);
|
|
40348
40348
|
if (!dryRun) {
|
|
40349
|
-
const
|
|
40350
|
-
const { selected } = await
|
|
40349
|
+
const prompts5 = await Promise.resolve().then(() => __toESM(require_prompts3(), 1));
|
|
40350
|
+
const { selected } = await prompts5.default({
|
|
40351
40351
|
type: "multiselect",
|
|
40352
40352
|
name: "selected",
|
|
40353
40353
|
message: `Select MCP servers to install via ${agent} CLI:`,
|
|
@@ -40784,7 +40784,7 @@ var sym = {
|
|
|
40784
40784
|
};
|
|
40785
40785
|
|
|
40786
40786
|
// src/commands/install.ts
|
|
40787
|
-
var
|
|
40787
|
+
var import_path13 = __toESM(require("path"), 1);
|
|
40788
40788
|
|
|
40789
40789
|
// src/commands/install-project.ts
|
|
40790
40790
|
var import_path11 = __toESM(require("path"), 1);
|
|
@@ -41420,6 +41420,98 @@ function createProjectCommand() {
|
|
|
41420
41420
|
return projectCmd;
|
|
41421
41421
|
}
|
|
41422
41422
|
|
|
41423
|
+
// src/commands/install-pi.ts
|
|
41424
|
+
var import_prompts2 = __toESM(require_prompts3(), 1);
|
|
41425
|
+
var import_fs_extra12 = __toESM(require_lib2(), 1);
|
|
41426
|
+
var import_path12 = __toESM(require("path"), 1);
|
|
41427
|
+
var import_node_child_process = require("child_process");
|
|
41428
|
+
var import_node_os4 = require("os");
|
|
41429
|
+
var PI_AGENT_DIR = import_path12.default.join((0, import_node_os4.homedir)(), ".pi", "agent");
|
|
41430
|
+
function fillTemplate(template, values) {
|
|
41431
|
+
return template.replace(/\{\{(\w+)\}\}/g, (_, key) => values[key] ?? "");
|
|
41432
|
+
}
|
|
41433
|
+
function readExistingPiValues(piAgentDir) {
|
|
41434
|
+
const values = {};
|
|
41435
|
+
try {
|
|
41436
|
+
const auth = JSON.parse(require("fs").readFileSync(import_path12.default.join(piAgentDir, "auth.json"), "utf8"));
|
|
41437
|
+
if (auth?.dashscope?.key) values["DASHSCOPE_API_KEY"] = auth.dashscope.key;
|
|
41438
|
+
if (auth?.zai?.key) values["ZAI_API_KEY"] = auth.zai.key;
|
|
41439
|
+
} catch {
|
|
41440
|
+
}
|
|
41441
|
+
return values;
|
|
41442
|
+
}
|
|
41443
|
+
function isPiInstalled() {
|
|
41444
|
+
return (0, import_node_child_process.spawnSync)("pi", ["--version"], { encoding: "utf8" }).status === 0;
|
|
41445
|
+
}
|
|
41446
|
+
function createInstallPiCommand() {
|
|
41447
|
+
const cmd = new Command("pi");
|
|
41448
|
+
cmd.description("Install Pi coding agent with providers, extensions, and npm packages").option("-y, --yes", "Skip confirmation prompts", false).action(async (opts) => {
|
|
41449
|
+
const { yes } = opts;
|
|
41450
|
+
const repoRoot = await findRepoRoot();
|
|
41451
|
+
const piConfigDir = import_path12.default.join(repoRoot, "config", "pi");
|
|
41452
|
+
console.log(t.bold("\n Pi Coding Agent Setup\n"));
|
|
41453
|
+
if (!isPiInstalled()) {
|
|
41454
|
+
console.log(kleur_default.yellow(" pi not found \u2014 installing oh-pi globally...\n"));
|
|
41455
|
+
const r = (0, import_node_child_process.spawnSync)("npm", ["install", "-g", "oh-pi"], { stdio: "inherit" });
|
|
41456
|
+
if (r.status !== 0) {
|
|
41457
|
+
console.error(kleur_default.red("\n Failed to install oh-pi. Run: npm install -g oh-pi\n"));
|
|
41458
|
+
process.exit(1);
|
|
41459
|
+
}
|
|
41460
|
+
console.log(t.success(" pi installed\n"));
|
|
41461
|
+
} else {
|
|
41462
|
+
const v = (0, import_node_child_process.spawnSync)("pi", ["--version"], { encoding: "utf8" });
|
|
41463
|
+
console.log(t.success(` pi ${v.stdout.trim()} already installed
|
|
41464
|
+
`));
|
|
41465
|
+
}
|
|
41466
|
+
const schema = await import_fs_extra12.default.readJson(import_path12.default.join(piConfigDir, "install-schema.json"));
|
|
41467
|
+
const existing = readExistingPiValues(PI_AGENT_DIR);
|
|
41468
|
+
const values = { ...existing };
|
|
41469
|
+
console.log(t.bold(" API Keys\n"));
|
|
41470
|
+
for (const field of schema.fields) {
|
|
41471
|
+
if (existing[field.key]) {
|
|
41472
|
+
console.log(t.success(` ${sym.ok} ${field.label} [already set]`));
|
|
41473
|
+
continue;
|
|
41474
|
+
}
|
|
41475
|
+
if (!field.required && !yes) {
|
|
41476
|
+
const { include } = await (0, import_prompts2.default)({ type: "confirm", name: "include", message: ` Configure ${field.label}? (optional)`, initial: false });
|
|
41477
|
+
if (!include) continue;
|
|
41478
|
+
}
|
|
41479
|
+
const { value } = await (0, import_prompts2.default)({ type: field.secret ? "password" : "text", name: "value", message: ` ${field.label}`, hint: field.hint, validate: (v) => field.required && !v ? "Required" : true });
|
|
41480
|
+
if (value) values[field.key] = value;
|
|
41481
|
+
}
|
|
41482
|
+
await import_fs_extra12.default.ensureDir(PI_AGENT_DIR);
|
|
41483
|
+
console.log(t.muted(`
|
|
41484
|
+
Writing config to ${PI_AGENT_DIR}`));
|
|
41485
|
+
for (const name of ["models.json", "auth.json", "settings.json"]) {
|
|
41486
|
+
const destPath = import_path12.default.join(PI_AGENT_DIR, name);
|
|
41487
|
+
if (name === "auth.json" && await import_fs_extra12.default.pathExists(destPath) && !yes) {
|
|
41488
|
+
const { overwrite } = await (0, import_prompts2.default)({ type: "confirm", name: "overwrite", message: ` ${name} already exists \u2014 overwrite? (OAuth tokens will be lost)`, initial: false });
|
|
41489
|
+
if (!overwrite) {
|
|
41490
|
+
console.log(t.muted(` skipped ${name}`));
|
|
41491
|
+
continue;
|
|
41492
|
+
}
|
|
41493
|
+
}
|
|
41494
|
+
const raw = await import_fs_extra12.default.readFile(import_path12.default.join(piConfigDir, `${name}.template`), "utf8");
|
|
41495
|
+
await import_fs_extra12.default.writeFile(destPath, fillTemplate(raw, values), "utf8");
|
|
41496
|
+
console.log(t.success(` ${sym.ok} ${name}`));
|
|
41497
|
+
}
|
|
41498
|
+
await import_fs_extra12.default.copy(import_path12.default.join(piConfigDir, "extensions"), import_path12.default.join(PI_AGENT_DIR, "extensions"), { overwrite: true });
|
|
41499
|
+
console.log(t.success(` ${sym.ok} extensions/`));
|
|
41500
|
+
console.log(t.bold("\n npm Packages\n"));
|
|
41501
|
+
for (const pkg of schema.packages) {
|
|
41502
|
+
const r = (0, import_node_child_process.spawnSync)("pi", ["install", pkg], { stdio: "inherit" });
|
|
41503
|
+
if (r.status === 0) console.log(t.success(` ${sym.ok} ${pkg}`));
|
|
41504
|
+
else console.log(kleur_default.yellow(` ${pkg} \u2014 failed, run manually: pi install ${pkg}`));
|
|
41505
|
+
}
|
|
41506
|
+
console.log(t.bold("\n OAuth (manual steps)\n"));
|
|
41507
|
+
for (const provider of schema.oauth_providers) {
|
|
41508
|
+
console.log(t.muted(` ${provider.key}: ${provider.instruction}`));
|
|
41509
|
+
}
|
|
41510
|
+
console.log(t.boldGreen("\n Pi setup complete\n"));
|
|
41511
|
+
});
|
|
41512
|
+
return cmd;
|
|
41513
|
+
}
|
|
41514
|
+
|
|
41423
41515
|
// src/commands/install.ts
|
|
41424
41516
|
var import_child_process4 = require("child_process");
|
|
41425
41517
|
var import_child_process5 = require("child_process");
|
|
@@ -41471,7 +41563,7 @@ function formatTargetLabel(target) {
|
|
|
41471
41563
|
const normalized = target.replace(/\\/g, "/").toLowerCase();
|
|
41472
41564
|
if (normalized.endsWith("/.agents/skills") || normalized.includes("/.agents/skills/")) return "~/.agents/skills";
|
|
41473
41565
|
if (normalized.endsWith("/.claude") || normalized.includes("/.claude/")) return "~/.claude";
|
|
41474
|
-
return
|
|
41566
|
+
return import_path13.default.basename(target);
|
|
41475
41567
|
}
|
|
41476
41568
|
function filterBeadsFromChangeSet(changeSet) {
|
|
41477
41569
|
return {
|
|
@@ -41504,15 +41596,15 @@ function isDoltInstalled() {
|
|
|
41504
41596
|
async function needsSettingsSync(repoRoot, target) {
|
|
41505
41597
|
const normalizedTarget = target.replace(/\\/g, "/").toLowerCase();
|
|
41506
41598
|
if (normalizedTarget.includes(".agents/skills")) return false;
|
|
41507
|
-
const hooksTemplatePath =
|
|
41508
|
-
if (!await
|
|
41509
|
-
const requiredEvents = Object.keys((await
|
|
41599
|
+
const hooksTemplatePath = import_path13.default.join(repoRoot, "config", "hooks.json");
|
|
41600
|
+
if (!await import_fs_extra13.default.pathExists(hooksTemplatePath)) return false;
|
|
41601
|
+
const requiredEvents = Object.keys((await import_fs_extra13.default.readJson(hooksTemplatePath)).hooks ?? {});
|
|
41510
41602
|
if (requiredEvents.length === 0) return false;
|
|
41511
|
-
const targetSettingsPath =
|
|
41512
|
-
if (!await
|
|
41603
|
+
const targetSettingsPath = import_path13.default.join(target, "settings.json");
|
|
41604
|
+
if (!await import_fs_extra13.default.pathExists(targetSettingsPath)) return true;
|
|
41513
41605
|
let settings = {};
|
|
41514
41606
|
try {
|
|
41515
|
-
settings = await
|
|
41607
|
+
settings = await import_fs_extra13.default.readJson(targetSettingsPath);
|
|
41516
41608
|
} catch {
|
|
41517
41609
|
return true;
|
|
41518
41610
|
}
|
|
@@ -41541,7 +41633,7 @@ async function runGlobalInstall(flags, installOpts = {}) {
|
|
|
41541
41633
|
const missing = [!beadsOk && "bd", !doltOk && "dolt"].filter(Boolean).join(", ");
|
|
41542
41634
|
let doInstall = effectiveYes;
|
|
41543
41635
|
if (!effectiveYes) {
|
|
41544
|
-
const { install } = await (0,
|
|
41636
|
+
const { install } = await (0, import_prompts3.default)({
|
|
41545
41637
|
type: "confirm",
|
|
41546
41638
|
name: "install",
|
|
41547
41639
|
message: `Install beads + dolt? (${missing} not found) \u2014 required for workflow enforcement hooks`,
|
|
@@ -41620,7 +41712,7 @@ async function runGlobalInstall(flags, installOpts = {}) {
|
|
|
41620
41712
|
}
|
|
41621
41713
|
if (!effectiveYes) {
|
|
41622
41714
|
const totalChangesCount = allChanges.reduce((s, c) => s + c.totalChanges, 0);
|
|
41623
|
-
const { confirm } = await (0,
|
|
41715
|
+
const { confirm } = await (0, import_prompts3.default)({
|
|
41624
41716
|
type: "confirm",
|
|
41625
41717
|
name: "confirm",
|
|
41626
41718
|
message: `Proceed with install (${totalChangesCount} total changes)?`,
|
|
@@ -41692,7 +41784,7 @@ function createInstallCommand() {
|
|
|
41692
41784
|
const missing = [!beadsOk && "bd", !doltOk && "dolt"].filter(Boolean).join(", ");
|
|
41693
41785
|
let doInstall = effectiveYes;
|
|
41694
41786
|
if (!effectiveYes) {
|
|
41695
|
-
const { install } = await (0,
|
|
41787
|
+
const { install } = await (0, import_prompts3.default)({
|
|
41696
41788
|
type: "confirm",
|
|
41697
41789
|
name: "install",
|
|
41698
41790
|
message: `Install beads + dolt? (${missing} not found) \u2014 required for workflow enforcement hooks`,
|
|
@@ -41788,7 +41880,7 @@ function createInstallCommand() {
|
|
|
41788
41880
|
}
|
|
41789
41881
|
if (!effectiveYes) {
|
|
41790
41882
|
const totalChangesCount = allChanges.reduce((s, c) => s + c.totalChanges, 0);
|
|
41791
|
-
const { confirm } = await (0,
|
|
41883
|
+
const { confirm } = await (0, import_prompts3.default)({
|
|
41792
41884
|
type: "confirm",
|
|
41793
41885
|
name: "confirm",
|
|
41794
41886
|
message: `Proceed with ${actionLabel} (${totalChangesCount} total changes)?`,
|
|
@@ -41819,14 +41911,15 @@ function createInstallCommand() {
|
|
|
41819
41911
|
installCmd.addCommand(createInstallAllCommand());
|
|
41820
41912
|
installCmd.addCommand(createInstallBasicCommand());
|
|
41821
41913
|
installCmd.addCommand(createInstallProjectCommand());
|
|
41914
|
+
installCmd.addCommand(createInstallPiCommand());
|
|
41822
41915
|
return installCmd;
|
|
41823
41916
|
}
|
|
41824
41917
|
|
|
41825
41918
|
// src/commands/status.ts
|
|
41826
|
-
var
|
|
41919
|
+
var import_prompts4 = __toESM(require_prompts3(), 1);
|
|
41827
41920
|
|
|
41828
41921
|
// src/core/manifest.ts
|
|
41829
|
-
var
|
|
41922
|
+
var import_path14 = require("path");
|
|
41830
41923
|
|
|
41831
41924
|
// ../node_modules/zod/v4/classic/external.js
|
|
41832
41925
|
var external_exports = {};
|
|
@@ -42595,10 +42688,10 @@ function mergeDefs(...defs) {
|
|
|
42595
42688
|
function cloneDef(schema) {
|
|
42596
42689
|
return mergeDefs(schema._zod.def);
|
|
42597
42690
|
}
|
|
42598
|
-
function getElementAtPath(obj,
|
|
42599
|
-
if (!
|
|
42691
|
+
function getElementAtPath(obj, path17) {
|
|
42692
|
+
if (!path17)
|
|
42600
42693
|
return obj;
|
|
42601
|
-
return
|
|
42694
|
+
return path17.reduce((acc, key) => acc?.[key], obj);
|
|
42602
42695
|
}
|
|
42603
42696
|
function promiseAllObject(promisesObj) {
|
|
42604
42697
|
const keys = Object.keys(promisesObj);
|
|
@@ -42981,11 +43074,11 @@ function aborted(x, startIndex = 0) {
|
|
|
42981
43074
|
}
|
|
42982
43075
|
return false;
|
|
42983
43076
|
}
|
|
42984
|
-
function prefixIssues(
|
|
43077
|
+
function prefixIssues(path17, issues) {
|
|
42985
43078
|
return issues.map((iss) => {
|
|
42986
43079
|
var _a2;
|
|
42987
43080
|
(_a2 = iss).path ?? (_a2.path = []);
|
|
42988
|
-
iss.path.unshift(
|
|
43081
|
+
iss.path.unshift(path17);
|
|
42989
43082
|
return iss;
|
|
42990
43083
|
});
|
|
42991
43084
|
}
|
|
@@ -43168,7 +43261,7 @@ function formatError(error49, mapper = (issue2) => issue2.message) {
|
|
|
43168
43261
|
}
|
|
43169
43262
|
function treeifyError(error49, mapper = (issue2) => issue2.message) {
|
|
43170
43263
|
const result = { errors: [] };
|
|
43171
|
-
const processError = (error50,
|
|
43264
|
+
const processError = (error50, path17 = []) => {
|
|
43172
43265
|
var _a2, _b;
|
|
43173
43266
|
for (const issue2 of error50.issues) {
|
|
43174
43267
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
@@ -43178,7 +43271,7 @@ function treeifyError(error49, mapper = (issue2) => issue2.message) {
|
|
|
43178
43271
|
} else if (issue2.code === "invalid_element") {
|
|
43179
43272
|
processError({ issues: issue2.issues }, issue2.path);
|
|
43180
43273
|
} else {
|
|
43181
|
-
const fullpath = [...
|
|
43274
|
+
const fullpath = [...path17, ...issue2.path];
|
|
43182
43275
|
if (fullpath.length === 0) {
|
|
43183
43276
|
result.errors.push(mapper(issue2));
|
|
43184
43277
|
continue;
|
|
@@ -43210,8 +43303,8 @@ function treeifyError(error49, mapper = (issue2) => issue2.message) {
|
|
|
43210
43303
|
}
|
|
43211
43304
|
function toDotPath(_path) {
|
|
43212
43305
|
const segs = [];
|
|
43213
|
-
const
|
|
43214
|
-
for (const seg of
|
|
43306
|
+
const path17 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
|
|
43307
|
+
for (const seg of path17) {
|
|
43215
43308
|
if (typeof seg === "number")
|
|
43216
43309
|
segs.push(`[${seg}]`);
|
|
43217
43310
|
else if (typeof seg === "symbol")
|
|
@@ -55188,13 +55281,13 @@ function resolveRef(ref, ctx) {
|
|
|
55188
55281
|
if (!ref.startsWith("#")) {
|
|
55189
55282
|
throw new Error("External $ref is not supported, only local refs (#/...) are allowed");
|
|
55190
55283
|
}
|
|
55191
|
-
const
|
|
55192
|
-
if (
|
|
55284
|
+
const path17 = ref.slice(1).split("/").filter(Boolean);
|
|
55285
|
+
if (path17.length === 0) {
|
|
55193
55286
|
return ctx.rootSchema;
|
|
55194
55287
|
}
|
|
55195
55288
|
const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions";
|
|
55196
|
-
if (
|
|
55197
|
-
const key =
|
|
55289
|
+
if (path17[0] === defsKey) {
|
|
55290
|
+
const key = path17[1];
|
|
55198
55291
|
if (!key || !ctx.defs[key]) {
|
|
55199
55292
|
throw new Error(`Reference not found: ${ref}`);
|
|
55200
55293
|
}
|
|
@@ -55637,17 +55730,17 @@ var ManifestSchema = external_exports.object({
|
|
|
55637
55730
|
// src/core/manifest.ts
|
|
55638
55731
|
var MANIFEST_FILE = ".jaggers-sync-manifest.json";
|
|
55639
55732
|
function getManifestPath(projectDir) {
|
|
55640
|
-
return (0,
|
|
55733
|
+
return (0, import_path14.join)(projectDir, MANIFEST_FILE);
|
|
55641
55734
|
}
|
|
55642
55735
|
|
|
55643
55736
|
// src/commands/status.ts
|
|
55644
|
-
var
|
|
55645
|
-
var
|
|
55737
|
+
var import_fs_extra14 = __toESM(require_lib2(), 1);
|
|
55738
|
+
var import_path15 = __toESM(require("path"), 1);
|
|
55646
55739
|
function formatTargetLabel2(target) {
|
|
55647
55740
|
const normalized = target.replace(/\\/g, "/").toLowerCase();
|
|
55648
55741
|
if (normalized.endsWith("/.agents/skills") || normalized.includes("/.agents/skills/")) return "~/.agents/skills";
|
|
55649
55742
|
if (normalized.endsWith("/.claude") || normalized.includes("/.claude/")) return "~/.claude";
|
|
55650
|
-
return
|
|
55743
|
+
return import_path15.default.basename(target);
|
|
55651
55744
|
}
|
|
55652
55745
|
function formatRelativeTime(timestamp) {
|
|
55653
55746
|
const now = Date.now();
|
|
@@ -55667,7 +55760,7 @@ function createStatusCommand() {
|
|
|
55667
55760
|
const candidates = getCandidatePaths();
|
|
55668
55761
|
const targets = [];
|
|
55669
55762
|
for (const c of candidates) {
|
|
55670
|
-
if (await
|
|
55763
|
+
if (await import_fs_extra14.default.pathExists(c.path)) targets.push(c.path);
|
|
55671
55764
|
}
|
|
55672
55765
|
if (targets.length === 0) {
|
|
55673
55766
|
console.log(kleur_default.yellow("\n No agent environments found (~/.claude, ~/.gemini, ~/.qwen)\n"));
|
|
@@ -55678,8 +55771,8 @@ function createStatusCommand() {
|
|
|
55678
55771
|
const manifestPath = getManifestPath(target);
|
|
55679
55772
|
let lastSync = null;
|
|
55680
55773
|
try {
|
|
55681
|
-
if (await
|
|
55682
|
-
const manifest = await
|
|
55774
|
+
if (await import_fs_extra14.default.pathExists(manifestPath)) {
|
|
55775
|
+
const manifest = await import_fs_extra14.default.readJson(manifestPath);
|
|
55683
55776
|
if (manifest.lastSync) lastSync = manifest.lastSync;
|
|
55684
55777
|
}
|
|
55685
55778
|
} catch {
|
|
@@ -55729,7 +55822,7 @@ function createStatusCommand() {
|
|
|
55729
55822
|
console.log(kleur_default.yellow(`
|
|
55730
55823
|
\u26A0 ${totalPending} pending change${totalPending !== 1 ? "s" : ""} across ${pending.length} environment${pending.length !== 1 ? "s" : ""}
|
|
55731
55824
|
`));
|
|
55732
|
-
const { selected } = await (0,
|
|
55825
|
+
const { selected } = await (0, import_prompts4.default)({
|
|
55733
55826
|
type: "multiselect",
|
|
55734
55827
|
name: "selected",
|
|
55735
55828
|
message: "Select environments to sync:",
|
|
@@ -55771,8 +55864,8 @@ function createResetCommand() {
|
|
|
55771
55864
|
}
|
|
55772
55865
|
|
|
55773
55866
|
// src/commands/help.ts
|
|
55774
|
-
var
|
|
55775
|
-
var
|
|
55867
|
+
var import_path16 = __toESM(require("path"), 1);
|
|
55868
|
+
var import_fs_extra15 = __toESM(require_lib2(), 1);
|
|
55776
55869
|
var HOOK_CATALOG = [
|
|
55777
55870
|
{ file: "main-guard.mjs", event: "PreToolUse", desc: "Blocks direct edits on protected branches" },
|
|
55778
55871
|
{ file: "main-guard-post-push.mjs", event: "PostToolUse", desc: "After feature-branch push, reminds PR/merge/sync steps" },
|
|
@@ -55788,26 +55881,26 @@ var HOOK_CATALOG = [
|
|
|
55788
55881
|
{ file: "beads-close-memory-prompt.mjs", event: "PostToolUse", desc: "Prompts memory save when closing a beads issue", beads: true }
|
|
55789
55882
|
];
|
|
55790
55883
|
async function readSkillsFromDir(dir) {
|
|
55791
|
-
if (!await
|
|
55792
|
-
const entries = await
|
|
55884
|
+
if (!await import_fs_extra15.default.pathExists(dir)) return [];
|
|
55885
|
+
const entries = await import_fs_extra15.default.readdir(dir);
|
|
55793
55886
|
const skills = [];
|
|
55794
55887
|
for (const name of entries.sort()) {
|
|
55795
|
-
const skillMd =
|
|
55796
|
-
if (!await
|
|
55797
|
-
const content = await
|
|
55888
|
+
const skillMd = import_path16.default.join(dir, name, "SKILL.md");
|
|
55889
|
+
if (!await import_fs_extra15.default.pathExists(skillMd)) continue;
|
|
55890
|
+
const content = await import_fs_extra15.default.readFile(skillMd, "utf8");
|
|
55798
55891
|
const m = content.match(/^description:\s*(.+)$/m);
|
|
55799
55892
|
skills.push({ name, desc: m ? m[1].replace(/^["']|["']$/g, "").trim() : "" });
|
|
55800
55893
|
}
|
|
55801
55894
|
return skills;
|
|
55802
55895
|
}
|
|
55803
55896
|
async function readProjectSkillsFromDir(dir) {
|
|
55804
|
-
if (!await
|
|
55805
|
-
const entries = await
|
|
55897
|
+
if (!await import_fs_extra15.default.pathExists(dir)) return [];
|
|
55898
|
+
const entries = await import_fs_extra15.default.readdir(dir);
|
|
55806
55899
|
const skills = [];
|
|
55807
55900
|
for (const name of entries.sort()) {
|
|
55808
|
-
const readme =
|
|
55809
|
-
if (!await
|
|
55810
|
-
const content = await
|
|
55901
|
+
const readme = import_path16.default.join(dir, name, "README.md");
|
|
55902
|
+
if (!await import_fs_extra15.default.pathExists(readme)) continue;
|
|
55903
|
+
const content = await import_fs_extra15.default.readFile(readme, "utf8");
|
|
55811
55904
|
const descLine = content.split("\n").find((line) => {
|
|
55812
55905
|
const trimmed = line.trim();
|
|
55813
55906
|
return Boolean(trimmed) && !trimmed.startsWith("#") && !trimmed.startsWith("[") && !trimmed.startsWith("<");
|
|
@@ -55818,11 +55911,11 @@ async function readProjectSkillsFromDir(dir) {
|
|
|
55818
55911
|
}
|
|
55819
55912
|
function resolvePkgRootFallback() {
|
|
55820
55913
|
const candidates = [
|
|
55821
|
-
|
|
55822
|
-
|
|
55914
|
+
import_path16.default.resolve(__dirname, "../.."),
|
|
55915
|
+
import_path16.default.resolve(__dirname, "../../..")
|
|
55823
55916
|
];
|
|
55824
55917
|
const match = candidates.find(
|
|
55825
|
-
(candidate) =>
|
|
55918
|
+
(candidate) => import_fs_extra15.default.existsSync(import_path16.default.join(candidate, "skills")) || import_fs_extra15.default.existsSync(import_path16.default.join(candidate, "project-skills"))
|
|
55826
55919
|
);
|
|
55827
55920
|
return match || null;
|
|
55828
55921
|
}
|
|
@@ -55840,8 +55933,8 @@ function createHelpCommand() {
|
|
|
55840
55933
|
const pkgRoot = resolvePkgRootFallback();
|
|
55841
55934
|
const skillsRoot = repoRoot || pkgRoot || "";
|
|
55842
55935
|
const projectSkillsRoot = repoRoot || pkgRoot || "";
|
|
55843
|
-
const skills = skillsRoot ? await readSkillsFromDir(
|
|
55844
|
-
const projectSkills = projectSkillsRoot ? await readProjectSkillsFromDir(
|
|
55936
|
+
const skills = skillsRoot ? await readSkillsFromDir(import_path16.default.join(skillsRoot, "skills")) : [];
|
|
55937
|
+
const projectSkills = projectSkillsRoot ? await readProjectSkillsFromDir(import_path16.default.join(projectSkillsRoot, "project-skills")) : [];
|
|
55845
55938
|
const W = 80;
|
|
55846
55939
|
const hr = kleur_default.dim("-".repeat(W));
|
|
55847
55940
|
const section = (title) => `
|