@adhdev/daemon-standalone 0.9.76-rc.11 → 0.9.76-rc.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/dist/index.js +3328 -459
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/vendor/mcp-server/index.js +3936 -1199
- package/vendor/mcp-server/index.js.map +1 -1
package/dist/index.js
CHANGED
|
@@ -9671,8 +9671,8 @@ var require_dist = __commonJS({
|
|
|
9671
9671
|
} catch {
|
|
9672
9672
|
}
|
|
9673
9673
|
});
|
|
9674
|
-
await new Promise((
|
|
9675
|
-
socket.once("connect", () =>
|
|
9674
|
+
await new Promise((resolve22, reject) => {
|
|
9675
|
+
socket.once("connect", () => resolve22());
|
|
9676
9676
|
socket.once("error", reject);
|
|
9677
9677
|
});
|
|
9678
9678
|
}
|
|
@@ -9691,7 +9691,7 @@ var require_dist = __commonJS({
|
|
|
9691
9691
|
requestId,
|
|
9692
9692
|
request
|
|
9693
9693
|
};
|
|
9694
|
-
const response = await new Promise((
|
|
9694
|
+
const response = await new Promise((resolve22, reject) => {
|
|
9695
9695
|
const timeout = setTimeout(() => {
|
|
9696
9696
|
this.requestWaiters.delete(requestId);
|
|
9697
9697
|
reject(new Error(`Session host request timed out after 30s (${request.type})`));
|
|
@@ -9699,7 +9699,7 @@ var require_dist = __commonJS({
|
|
|
9699
9699
|
this.requestWaiters.set(requestId, {
|
|
9700
9700
|
resolve: (value) => {
|
|
9701
9701
|
clearTimeout(timeout);
|
|
9702
|
-
|
|
9702
|
+
resolve22(value);
|
|
9703
9703
|
},
|
|
9704
9704
|
reject: (error48) => {
|
|
9705
9705
|
clearTimeout(timeout);
|
|
@@ -9718,12 +9718,12 @@ var require_dist = __commonJS({
|
|
|
9718
9718
|
waiter.reject(new Error("Session host client closed"));
|
|
9719
9719
|
}
|
|
9720
9720
|
this.requestWaiters.clear();
|
|
9721
|
-
await new Promise((
|
|
9721
|
+
await new Promise((resolve22) => {
|
|
9722
9722
|
let settled = false;
|
|
9723
9723
|
const done = () => {
|
|
9724
9724
|
if (settled) return;
|
|
9725
9725
|
settled = true;
|
|
9726
|
-
|
|
9726
|
+
resolve22();
|
|
9727
9727
|
};
|
|
9728
9728
|
socket.once("close", done);
|
|
9729
9729
|
socket.end();
|
|
@@ -9780,9 +9780,9 @@ var require_dist = __commonJS({
|
|
|
9780
9780
|
const platformArch = `${os22.platform()}-${os22.arch()}`;
|
|
9781
9781
|
const helper = path32.join(ptyDir, "prebuilds", platformArch, "spawn-helper");
|
|
9782
9782
|
if (fs5.existsSync(helper)) {
|
|
9783
|
-
const
|
|
9784
|
-
if (!(
|
|
9785
|
-
fs5.chmodSync(helper,
|
|
9783
|
+
const stat4 = fs5.statSync(helper);
|
|
9784
|
+
if (!(stat4.mode & 73)) {
|
|
9785
|
+
fs5.chmodSync(helper, stat4.mode | 493);
|
|
9786
9786
|
logFn?.(`Fixed spawn-helper permissions: ${helper}`);
|
|
9787
9787
|
}
|
|
9788
9788
|
}
|
|
@@ -10280,18 +10280,18 @@ var init_source = __esm({
|
|
|
10280
10280
|
}
|
|
10281
10281
|
}
|
|
10282
10282
|
});
|
|
10283
|
-
createStyler = (
|
|
10283
|
+
createStyler = (open2, close, parent) => {
|
|
10284
10284
|
let openAll;
|
|
10285
10285
|
let closeAll;
|
|
10286
10286
|
if (parent === void 0) {
|
|
10287
|
-
openAll =
|
|
10287
|
+
openAll = open2;
|
|
10288
10288
|
closeAll = close;
|
|
10289
10289
|
} else {
|
|
10290
|
-
openAll = parent.openAll +
|
|
10290
|
+
openAll = parent.openAll + open2;
|
|
10291
10291
|
closeAll = close + parent.closeAll;
|
|
10292
10292
|
}
|
|
10293
10293
|
return {
|
|
10294
|
-
open,
|
|
10294
|
+
open: open2,
|
|
10295
10295
|
close,
|
|
10296
10296
|
openAll,
|
|
10297
10297
|
closeAll,
|
|
@@ -26389,8 +26389,8 @@ var init_acp = __esm({
|
|
|
26389
26389
|
this.#requestHandler = requestHandler;
|
|
26390
26390
|
this.#notificationHandler = notificationHandler;
|
|
26391
26391
|
this.#stream = stream;
|
|
26392
|
-
this.#closedPromise = new Promise((
|
|
26393
|
-
this.#abortController.signal.addEventListener("abort", () =>
|
|
26392
|
+
this.#closedPromise = new Promise((resolve4) => {
|
|
26393
|
+
this.#abortController.signal.addEventListener("abort", () => resolve4());
|
|
26394
26394
|
});
|
|
26395
26395
|
this.#receive();
|
|
26396
26396
|
}
|
|
@@ -26539,8 +26539,8 @@ var init_acp = __esm({
|
|
|
26539
26539
|
}
|
|
26540
26540
|
async sendRequest(method, params) {
|
|
26541
26541
|
const id = this.#nextRequestId++;
|
|
26542
|
-
const responsePromise = new Promise((
|
|
26543
|
-
this.#pendingResponses.set(id, { resolve:
|
|
26542
|
+
const responsePromise = new Promise((resolve4, reject) => {
|
|
26543
|
+
this.#pendingResponses.set(id, { resolve: resolve4, reject });
|
|
26544
26544
|
});
|
|
26545
26545
|
await this.#sendMessage({ jsonrpc: "2.0", id, method, params });
|
|
26546
26546
|
return responsePromise;
|
|
@@ -26635,56 +26635,69 @@ var init_acp = __esm({
|
|
|
26635
26635
|
}
|
|
26636
26636
|
});
|
|
26637
26637
|
|
|
26638
|
-
//
|
|
26639
|
-
|
|
26640
|
-
|
|
26638
|
+
// ../daemon-core/node_modules/readdirp/index.js
|
|
26639
|
+
function readdirp(root, options = {}) {
|
|
26640
|
+
let type = options.entryType || options.type;
|
|
26641
|
+
if (type === "both")
|
|
26642
|
+
type = EntryTypes.FILE_DIR_TYPE;
|
|
26643
|
+
if (type)
|
|
26644
|
+
options.type = type;
|
|
26645
|
+
if (!root) {
|
|
26646
|
+
throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)");
|
|
26647
|
+
} else if (typeof root !== "string") {
|
|
26648
|
+
throw new TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)");
|
|
26649
|
+
} else if (type && !ALL_TYPES.includes(type)) {
|
|
26650
|
+
throw new Error(`readdirp: Invalid type passed. Use one of ${ALL_TYPES.join(", ")}`);
|
|
26651
|
+
}
|
|
26652
|
+
options.root = root;
|
|
26653
|
+
return new ReaddirpStream(options);
|
|
26654
|
+
}
|
|
26655
|
+
var import_promises, import_node_path, import_node_stream, EntryTypes, defaultOptions, RECURSIVE_ERROR_CODE, NORMAL_FLOW_ERRORS, ALL_TYPES, DIR_TYPES, FILE_TYPES, isNormalFlowError, wantBigintFsStats, emptyFn, normalizeFilter, ReaddirpStream;
|
|
26656
|
+
var init_readdirp = __esm({
|
|
26657
|
+
"../daemon-core/node_modules/readdirp/index.js"() {
|
|
26641
26658
|
"use strict";
|
|
26642
|
-
|
|
26643
|
-
|
|
26644
|
-
|
|
26645
|
-
|
|
26646
|
-
var promises_1 = require("fs/promises");
|
|
26647
|
-
var node_stream_1 = require("stream");
|
|
26648
|
-
var node_path_1 = require("path");
|
|
26649
|
-
exports2.EntryTypes = {
|
|
26659
|
+
import_promises = require("fs/promises");
|
|
26660
|
+
import_node_path = require("path");
|
|
26661
|
+
import_node_stream = require("stream");
|
|
26662
|
+
EntryTypes = {
|
|
26650
26663
|
FILE_TYPE: "files",
|
|
26651
26664
|
DIR_TYPE: "directories",
|
|
26652
26665
|
FILE_DIR_TYPE: "files_directories",
|
|
26653
26666
|
EVERYTHING_TYPE: "all"
|
|
26654
26667
|
};
|
|
26655
|
-
|
|
26668
|
+
defaultOptions = {
|
|
26656
26669
|
root: ".",
|
|
26657
26670
|
fileFilter: (_entryInfo) => true,
|
|
26658
26671
|
directoryFilter: (_entryInfo) => true,
|
|
26659
|
-
type:
|
|
26672
|
+
type: EntryTypes.FILE_TYPE,
|
|
26660
26673
|
lstat: false,
|
|
26661
26674
|
depth: 2147483648,
|
|
26662
26675
|
alwaysStat: false,
|
|
26663
26676
|
highWaterMark: 4096
|
|
26664
26677
|
};
|
|
26665
26678
|
Object.freeze(defaultOptions);
|
|
26666
|
-
|
|
26667
|
-
|
|
26668
|
-
|
|
26669
|
-
|
|
26670
|
-
|
|
26671
|
-
|
|
26672
|
-
|
|
26679
|
+
RECURSIVE_ERROR_CODE = "READDIRP_RECURSIVE_ERROR";
|
|
26680
|
+
NORMAL_FLOW_ERRORS = /* @__PURE__ */ new Set(["ENOENT", "EPERM", "EACCES", "ELOOP", RECURSIVE_ERROR_CODE]);
|
|
26681
|
+
ALL_TYPES = [
|
|
26682
|
+
EntryTypes.DIR_TYPE,
|
|
26683
|
+
EntryTypes.EVERYTHING_TYPE,
|
|
26684
|
+
EntryTypes.FILE_DIR_TYPE,
|
|
26685
|
+
EntryTypes.FILE_TYPE
|
|
26673
26686
|
];
|
|
26674
|
-
|
|
26675
|
-
|
|
26676
|
-
|
|
26677
|
-
|
|
26687
|
+
DIR_TYPES = /* @__PURE__ */ new Set([
|
|
26688
|
+
EntryTypes.DIR_TYPE,
|
|
26689
|
+
EntryTypes.EVERYTHING_TYPE,
|
|
26690
|
+
EntryTypes.FILE_DIR_TYPE
|
|
26678
26691
|
]);
|
|
26679
|
-
|
|
26680
|
-
|
|
26681
|
-
|
|
26682
|
-
|
|
26692
|
+
FILE_TYPES = /* @__PURE__ */ new Set([
|
|
26693
|
+
EntryTypes.EVERYTHING_TYPE,
|
|
26694
|
+
EntryTypes.FILE_DIR_TYPE,
|
|
26695
|
+
EntryTypes.FILE_TYPE
|
|
26683
26696
|
]);
|
|
26684
|
-
|
|
26685
|
-
|
|
26686
|
-
|
|
26687
|
-
|
|
26697
|
+
isNormalFlowError = (error48) => NORMAL_FLOW_ERRORS.has(error48.code);
|
|
26698
|
+
wantBigintFsStats = process.platform === "win32";
|
|
26699
|
+
emptyFn = (_entryInfo) => true;
|
|
26700
|
+
normalizeFilter = (filter) => {
|
|
26688
26701
|
if (filter === void 0)
|
|
26689
26702
|
return emptyFn;
|
|
26690
26703
|
if (typeof filter === "function")
|
|
@@ -26699,7 +26712,21 @@ var require_readdirp = __commonJS({
|
|
|
26699
26712
|
}
|
|
26700
26713
|
return emptyFn;
|
|
26701
26714
|
};
|
|
26702
|
-
|
|
26715
|
+
ReaddirpStream = class extends import_node_stream.Readable {
|
|
26716
|
+
parents;
|
|
26717
|
+
reading;
|
|
26718
|
+
parent;
|
|
26719
|
+
_stat;
|
|
26720
|
+
_maxDepth;
|
|
26721
|
+
_wantsDir;
|
|
26722
|
+
_wantsFile;
|
|
26723
|
+
_wantsEverything;
|
|
26724
|
+
_root;
|
|
26725
|
+
_isDirent;
|
|
26726
|
+
_statsProp;
|
|
26727
|
+
_rdOptions;
|
|
26728
|
+
_fileFilter;
|
|
26729
|
+
_directoryFilter;
|
|
26703
26730
|
constructor(options = {}) {
|
|
26704
26731
|
super({
|
|
26705
26732
|
objectMode: true,
|
|
@@ -26710,17 +26737,17 @@ var require_readdirp = __commonJS({
|
|
|
26710
26737
|
const { root, type } = opts;
|
|
26711
26738
|
this._fileFilter = normalizeFilter(opts.fileFilter);
|
|
26712
26739
|
this._directoryFilter = normalizeFilter(opts.directoryFilter);
|
|
26713
|
-
const statMethod = opts.lstat ?
|
|
26740
|
+
const statMethod = opts.lstat ? import_promises.lstat : import_promises.stat;
|
|
26714
26741
|
if (wantBigintFsStats) {
|
|
26715
26742
|
this._stat = (path5) => statMethod(path5, { bigint: true });
|
|
26716
26743
|
} else {
|
|
26717
26744
|
this._stat = statMethod;
|
|
26718
26745
|
}
|
|
26719
|
-
this._maxDepth = opts.depth
|
|
26746
|
+
this._maxDepth = opts.depth != null && Number.isSafeInteger(opts.depth) ? opts.depth : defaultOptions.depth;
|
|
26720
26747
|
this._wantsDir = type ? DIR_TYPES.has(type) : false;
|
|
26721
26748
|
this._wantsFile = type ? FILE_TYPES.has(type) : false;
|
|
26722
|
-
this._wantsEverything = type ===
|
|
26723
|
-
this._root = (0,
|
|
26749
|
+
this._wantsEverything = type === EntryTypes.EVERYTHING_TYPE;
|
|
26750
|
+
this._root = (0, import_node_path.resolve)(root);
|
|
26724
26751
|
this._isDirent = !opts.alwaysStat;
|
|
26725
26752
|
this._statsProp = this._isDirent ? "dirent" : "stats";
|
|
26726
26753
|
this._rdOptions = { encoding: "utf8", withFileTypes: this._isDirent };
|
|
@@ -26781,7 +26808,7 @@ var require_readdirp = __commonJS({
|
|
|
26781
26808
|
async _exploreDir(path5, depth) {
|
|
26782
26809
|
let files;
|
|
26783
26810
|
try {
|
|
26784
|
-
files = await (0,
|
|
26811
|
+
files = await (0, import_promises.readdir)(path5, this._rdOptions);
|
|
26785
26812
|
} catch (error48) {
|
|
26786
26813
|
this._onError(error48);
|
|
26787
26814
|
}
|
|
@@ -26789,10 +26816,10 @@ var require_readdirp = __commonJS({
|
|
|
26789
26816
|
}
|
|
26790
26817
|
async _formatEntry(dirent, path5) {
|
|
26791
26818
|
let entry;
|
|
26792
|
-
const
|
|
26819
|
+
const basename3 = this._isDirent ? dirent.name : dirent;
|
|
26793
26820
|
try {
|
|
26794
|
-
const fullPath = (0,
|
|
26795
|
-
entry = { path: (0,
|
|
26821
|
+
const fullPath = (0, import_node_path.resolve)((0, import_node_path.join)(path5, basename3));
|
|
26822
|
+
entry = { path: (0, import_node_path.relative)(this._root, fullPath), fullPath, basename: basename3 };
|
|
26796
26823
|
entry[this._statsProp] = this._isDirent ? dirent : await this._stat(fullPath);
|
|
26797
26824
|
} catch (err) {
|
|
26798
26825
|
this._onError(err);
|
|
@@ -26819,14 +26846,14 @@ var require_readdirp = __commonJS({
|
|
|
26819
26846
|
if (stats && stats.isSymbolicLink()) {
|
|
26820
26847
|
const full = entry.fullPath;
|
|
26821
26848
|
try {
|
|
26822
|
-
const entryRealPath = await (0,
|
|
26823
|
-
const entryRealPathStats = await (0,
|
|
26849
|
+
const entryRealPath = await (0, import_promises.realpath)(full);
|
|
26850
|
+
const entryRealPathStats = await (0, import_promises.lstat)(entryRealPath);
|
|
26824
26851
|
if (entryRealPathStats.isFile()) {
|
|
26825
26852
|
return "file";
|
|
26826
26853
|
}
|
|
26827
26854
|
if (entryRealPathStats.isDirectory()) {
|
|
26828
26855
|
const len = entryRealPath.length;
|
|
26829
|
-
if (full.startsWith(entryRealPath) && full.substr(len, 1) ===
|
|
26856
|
+
if (full.startsWith(entryRealPath) && full.substr(len, 1) === import_node_path.sep) {
|
|
26830
26857
|
const recursiveError = new Error(`Circular symlink detected: "${full}" points to "${entryRealPath}"`);
|
|
26831
26858
|
recursiveError.code = RECURSIVE_ERROR_CODE;
|
|
26832
26859
|
return this._onError(recursiveError);
|
|
@@ -26844,58 +26871,47 @@ var require_readdirp = __commonJS({
|
|
|
26844
26871
|
return stats && this._wantsEverything && !stats.isDirectory();
|
|
26845
26872
|
}
|
|
26846
26873
|
};
|
|
26847
|
-
exports2.ReaddirpStream = ReaddirpStream;
|
|
26848
|
-
function readdirp(root, options = {}) {
|
|
26849
|
-
let type = options.entryType || options.type;
|
|
26850
|
-
if (type === "both")
|
|
26851
|
-
type = exports2.EntryTypes.FILE_DIR_TYPE;
|
|
26852
|
-
if (type)
|
|
26853
|
-
options.type = type;
|
|
26854
|
-
if (!root) {
|
|
26855
|
-
throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)");
|
|
26856
|
-
} else if (typeof root !== "string") {
|
|
26857
|
-
throw new TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)");
|
|
26858
|
-
} else if (type && !ALL_TYPES.includes(type)) {
|
|
26859
|
-
throw new Error(`readdirp: Invalid type passed. Use one of ${ALL_TYPES.join(", ")}`);
|
|
26860
|
-
}
|
|
26861
|
-
options.root = root;
|
|
26862
|
-
return new ReaddirpStream(options);
|
|
26863
|
-
}
|
|
26864
|
-
function readdirpPromise(root, options = {}) {
|
|
26865
|
-
return new Promise((resolve2, reject) => {
|
|
26866
|
-
const files = [];
|
|
26867
|
-
readdirp(root, options).on("data", (entry) => files.push(entry)).on("end", () => resolve2(files)).on("error", (error48) => reject(error48));
|
|
26868
|
-
});
|
|
26869
|
-
}
|
|
26870
|
-
exports2.default = readdirp;
|
|
26871
26874
|
}
|
|
26872
26875
|
});
|
|
26873
26876
|
|
|
26874
|
-
//
|
|
26875
|
-
|
|
26876
|
-
|
|
26877
|
+
// ../daemon-core/node_modules/chokidar/handler.js
|
|
26878
|
+
function createFsWatchInstance(path5, options, listener, errHandler, emitRaw) {
|
|
26879
|
+
const handleEvent = (rawEvent, evPath) => {
|
|
26880
|
+
listener(path5);
|
|
26881
|
+
emitRaw(rawEvent, evPath, { watchedPath: path5 });
|
|
26882
|
+
if (evPath && path5 !== evPath) {
|
|
26883
|
+
fsWatchBroadcast(sp.resolve(path5, evPath), KEY_LISTENERS, sp.join(path5, evPath));
|
|
26884
|
+
}
|
|
26885
|
+
};
|
|
26886
|
+
try {
|
|
26887
|
+
return (0, import_node_fs.watch)(path5, {
|
|
26888
|
+
persistent: options.persistent
|
|
26889
|
+
}, handleEvent);
|
|
26890
|
+
} catch (error48) {
|
|
26891
|
+
errHandler(error48);
|
|
26892
|
+
return void 0;
|
|
26893
|
+
}
|
|
26894
|
+
}
|
|
26895
|
+
var import_node_fs, import_promises2, import_node_os2, sp, STR_DATA, STR_END, STR_CLOSE, EMPTY_FN, pl, isWindows, isMacos, isLinux, isFreeBSD, isIBMi, EVENTS, EV, THROTTLE_MODE_WATCH, statMethods, KEY_LISTENERS, KEY_ERR, KEY_RAW, HANDLER_KEYS, binaryExtensions, isBinaryPath, foreach, addAndConvert, clearItem, delFromSet, isEmptySet, FsWatchInstances, fsWatchBroadcast, setFsWatchListener, FsWatchFileInstances, setFsWatchFileListener, NodeFsHandler;
|
|
26896
|
+
var init_handler = __esm({
|
|
26897
|
+
"../daemon-core/node_modules/chokidar/handler.js"() {
|
|
26877
26898
|
"use strict";
|
|
26878
|
-
|
|
26879
|
-
|
|
26880
|
-
|
|
26881
|
-
|
|
26882
|
-
|
|
26883
|
-
|
|
26884
|
-
|
|
26885
|
-
|
|
26886
|
-
|
|
26887
|
-
|
|
26888
|
-
|
|
26889
|
-
|
|
26890
|
-
|
|
26891
|
-
|
|
26892
|
-
|
|
26893
|
-
|
|
26894
|
-
exports2.isMacos = pl === "darwin";
|
|
26895
|
-
exports2.isLinux = pl === "linux";
|
|
26896
|
-
exports2.isFreeBSD = pl === "freebsd";
|
|
26897
|
-
exports2.isIBMi = (0, os_1.type)() === "OS400";
|
|
26898
|
-
exports2.EVENTS = {
|
|
26899
|
+
import_node_fs = require("fs");
|
|
26900
|
+
import_promises2 = require("fs/promises");
|
|
26901
|
+
import_node_os2 = require("os");
|
|
26902
|
+
sp = __toESM(require("path"), 1);
|
|
26903
|
+
STR_DATA = "data";
|
|
26904
|
+
STR_END = "end";
|
|
26905
|
+
STR_CLOSE = "close";
|
|
26906
|
+
EMPTY_FN = () => {
|
|
26907
|
+
};
|
|
26908
|
+
pl = process.platform;
|
|
26909
|
+
isWindows = pl === "win32";
|
|
26910
|
+
isMacos = pl === "darwin";
|
|
26911
|
+
isLinux = pl === "linux";
|
|
26912
|
+
isFreeBSD = pl === "freebsd";
|
|
26913
|
+
isIBMi = (0, import_node_os2.type)() === "OS400";
|
|
26914
|
+
EVENTS = {
|
|
26899
26915
|
ALL: "all",
|
|
26900
26916
|
READY: "ready",
|
|
26901
26917
|
ADD: "add",
|
|
@@ -26906,14 +26922,14 @@ var require_handler = __commonJS({
|
|
|
26906
26922
|
RAW: "raw",
|
|
26907
26923
|
ERROR: "error"
|
|
26908
26924
|
};
|
|
26909
|
-
|
|
26910
|
-
|
|
26911
|
-
|
|
26912
|
-
|
|
26913
|
-
|
|
26914
|
-
|
|
26915
|
-
|
|
26916
|
-
|
|
26925
|
+
EV = EVENTS;
|
|
26926
|
+
THROTTLE_MODE_WATCH = "watch";
|
|
26927
|
+
statMethods = { lstat: import_promises2.lstat, stat: import_promises2.stat };
|
|
26928
|
+
KEY_LISTENERS = "listeners";
|
|
26929
|
+
KEY_ERR = "errHandlers";
|
|
26930
|
+
KEY_RAW = "rawEmitters";
|
|
26931
|
+
HANDLER_KEYS = [KEY_LISTENERS, KEY_ERR, KEY_RAW];
|
|
26932
|
+
binaryExtensions = /* @__PURE__ */ new Set([
|
|
26917
26933
|
"3dm",
|
|
26918
26934
|
"3ds",
|
|
26919
26935
|
"3g2",
|
|
@@ -27176,22 +27192,22 @@ var require_handler = __commonJS({
|
|
|
27176
27192
|
"zip",
|
|
27177
27193
|
"zipx"
|
|
27178
27194
|
]);
|
|
27179
|
-
|
|
27180
|
-
|
|
27195
|
+
isBinaryPath = (filePath) => binaryExtensions.has(sp.extname(filePath).slice(1).toLowerCase());
|
|
27196
|
+
foreach = (val, fn2) => {
|
|
27181
27197
|
if (val instanceof Set) {
|
|
27182
27198
|
val.forEach(fn2);
|
|
27183
27199
|
} else {
|
|
27184
27200
|
fn2(val);
|
|
27185
27201
|
}
|
|
27186
27202
|
};
|
|
27187
|
-
|
|
27203
|
+
addAndConvert = (main2, prop, item) => {
|
|
27188
27204
|
let container = main2[prop];
|
|
27189
27205
|
if (!(container instanceof Set)) {
|
|
27190
27206
|
main2[prop] = container = /* @__PURE__ */ new Set([container]);
|
|
27191
27207
|
}
|
|
27192
27208
|
container.add(item);
|
|
27193
27209
|
};
|
|
27194
|
-
|
|
27210
|
+
clearItem = (cont) => (key) => {
|
|
27195
27211
|
const set2 = cont[key];
|
|
27196
27212
|
if (set2 instanceof Set) {
|
|
27197
27213
|
set2.clear();
|
|
@@ -27199,7 +27215,7 @@ var require_handler = __commonJS({
|
|
|
27199
27215
|
delete cont[key];
|
|
27200
27216
|
}
|
|
27201
27217
|
};
|
|
27202
|
-
|
|
27218
|
+
delFromSet = (main2, prop, item) => {
|
|
27203
27219
|
const container = main2[prop];
|
|
27204
27220
|
if (container instanceof Set) {
|
|
27205
27221
|
container.delete(item);
|
|
@@ -27207,26 +27223,9 @@ var require_handler = __commonJS({
|
|
|
27207
27223
|
delete main2[prop];
|
|
27208
27224
|
}
|
|
27209
27225
|
};
|
|
27210
|
-
|
|
27211
|
-
|
|
27212
|
-
|
|
27213
|
-
const handleEvent = (rawEvent, evPath) => {
|
|
27214
|
-
listener(path5);
|
|
27215
|
-
emitRaw(rawEvent, evPath, { watchedPath: path5 });
|
|
27216
|
-
if (evPath && path5 !== evPath) {
|
|
27217
|
-
fsWatchBroadcast(sysPath.resolve(path5, evPath), KEY_LISTENERS, sysPath.join(path5, evPath));
|
|
27218
|
-
}
|
|
27219
|
-
};
|
|
27220
|
-
try {
|
|
27221
|
-
return (0, fs_1.watch)(path5, {
|
|
27222
|
-
persistent: options.persistent
|
|
27223
|
-
}, handleEvent);
|
|
27224
|
-
} catch (error48) {
|
|
27225
|
-
errHandler(error48);
|
|
27226
|
-
return void 0;
|
|
27227
|
-
}
|
|
27228
|
-
}
|
|
27229
|
-
var fsWatchBroadcast = (fullPath, listenerType, val1, val2, val3) => {
|
|
27226
|
+
isEmptySet = (val) => val instanceof Set ? val.size === 0 : !val;
|
|
27227
|
+
FsWatchInstances = /* @__PURE__ */ new Map();
|
|
27228
|
+
fsWatchBroadcast = (fullPath, listenerType, val1, val2, val3) => {
|
|
27230
27229
|
const cont = FsWatchInstances.get(fullPath);
|
|
27231
27230
|
if (!cont)
|
|
27232
27231
|
return;
|
|
@@ -27234,7 +27233,7 @@ var require_handler = __commonJS({
|
|
|
27234
27233
|
listener(val1, val2, val3);
|
|
27235
27234
|
});
|
|
27236
27235
|
};
|
|
27237
|
-
|
|
27236
|
+
setFsWatchListener = (path5, fullPath, options, handlers) => {
|
|
27238
27237
|
const { listener, errHandler, rawEmitter } = handlers;
|
|
27239
27238
|
let cont = FsWatchInstances.get(fullPath);
|
|
27240
27239
|
let watcher;
|
|
@@ -27263,9 +27262,9 @@ var require_handler = __commonJS({
|
|
|
27263
27262
|
const broadcastErr = fsWatchBroadcast.bind(null, fullPath, KEY_ERR);
|
|
27264
27263
|
if (cont)
|
|
27265
27264
|
cont.watcherUnusable = true;
|
|
27266
|
-
if (
|
|
27265
|
+
if (isWindows && error48.code === "EPERM") {
|
|
27267
27266
|
try {
|
|
27268
|
-
const fd = await (0,
|
|
27267
|
+
const fd = await (0, import_promises2.open)(path5, "r");
|
|
27269
27268
|
await fd.close();
|
|
27270
27269
|
broadcastErr(error48);
|
|
27271
27270
|
} catch (err) {
|
|
@@ -27295,13 +27294,13 @@ var require_handler = __commonJS({
|
|
|
27295
27294
|
}
|
|
27296
27295
|
};
|
|
27297
27296
|
};
|
|
27298
|
-
|
|
27299
|
-
|
|
27297
|
+
FsWatchFileInstances = /* @__PURE__ */ new Map();
|
|
27298
|
+
setFsWatchFileListener = (path5, fullPath, options, handlers) => {
|
|
27300
27299
|
const { listener, rawEmitter } = handlers;
|
|
27301
27300
|
let cont = FsWatchFileInstances.get(fullPath);
|
|
27302
27301
|
const copts = cont && cont.options;
|
|
27303
27302
|
if (copts && (copts.persistent < options.persistent || copts.interval > options.interval)) {
|
|
27304
|
-
(0,
|
|
27303
|
+
(0, import_node_fs.unwatchFile)(fullPath);
|
|
27305
27304
|
cont = void 0;
|
|
27306
27305
|
}
|
|
27307
27306
|
if (cont) {
|
|
@@ -27312,7 +27311,7 @@ var require_handler = __commonJS({
|
|
|
27312
27311
|
listeners: listener,
|
|
27313
27312
|
rawEmitters: rawEmitter,
|
|
27314
27313
|
options,
|
|
27315
|
-
watcher: (0,
|
|
27314
|
+
watcher: (0, import_node_fs.watchFile)(fullPath, options, (curr, prev) => {
|
|
27316
27315
|
foreach(cont.rawEmitters, (rawEmitter2) => {
|
|
27317
27316
|
rawEmitter2(EV.CHANGE, fullPath, { curr, prev });
|
|
27318
27317
|
});
|
|
@@ -27329,13 +27328,15 @@ var require_handler = __commonJS({
|
|
|
27329
27328
|
delFromSet(cont, KEY_RAW, rawEmitter);
|
|
27330
27329
|
if (isEmptySet(cont.listeners)) {
|
|
27331
27330
|
FsWatchFileInstances.delete(fullPath);
|
|
27332
|
-
(0,
|
|
27331
|
+
(0, import_node_fs.unwatchFile)(fullPath);
|
|
27333
27332
|
cont.options = cont.watcher = void 0;
|
|
27334
27333
|
Object.freeze(cont);
|
|
27335
27334
|
}
|
|
27336
27335
|
};
|
|
27337
27336
|
};
|
|
27338
|
-
|
|
27337
|
+
NodeFsHandler = class {
|
|
27338
|
+
fsw;
|
|
27339
|
+
_boundHandleError;
|
|
27339
27340
|
constructor(fsW) {
|
|
27340
27341
|
this.fsw = fsW;
|
|
27341
27342
|
this._boundHandleError = (error48) => fsW._handleError(error48);
|
|
@@ -27348,20 +27349,20 @@ var require_handler = __commonJS({
|
|
|
27348
27349
|
*/
|
|
27349
27350
|
_watchWithNodeFs(path5, listener) {
|
|
27350
27351
|
const opts = this.fsw.options;
|
|
27351
|
-
const directory =
|
|
27352
|
-
const
|
|
27352
|
+
const directory = sp.dirname(path5);
|
|
27353
|
+
const basename3 = sp.basename(path5);
|
|
27353
27354
|
const parent = this.fsw._getWatchedDir(directory);
|
|
27354
|
-
parent.add(
|
|
27355
|
-
const absolutePath =
|
|
27355
|
+
parent.add(basename3);
|
|
27356
|
+
const absolutePath = sp.resolve(path5);
|
|
27356
27357
|
const options = {
|
|
27357
27358
|
persistent: opts.persistent
|
|
27358
27359
|
};
|
|
27359
27360
|
if (!listener)
|
|
27360
|
-
listener =
|
|
27361
|
+
listener = EMPTY_FN;
|
|
27361
27362
|
let closer;
|
|
27362
27363
|
if (opts.usePolling) {
|
|
27363
27364
|
const enableBin = opts.interval !== opts.binaryInterval;
|
|
27364
|
-
options.interval = enableBin && isBinaryPath(
|
|
27365
|
+
options.interval = enableBin && isBinaryPath(basename3) ? opts.binaryInterval : opts.interval;
|
|
27365
27366
|
closer = setFsWatchFileListener(path5, absolutePath, options, {
|
|
27366
27367
|
listener,
|
|
27367
27368
|
rawEmitter: this.fsw._emitRaw
|
|
@@ -27383,18 +27384,18 @@ var require_handler = __commonJS({
|
|
|
27383
27384
|
if (this.fsw.closed) {
|
|
27384
27385
|
return;
|
|
27385
27386
|
}
|
|
27386
|
-
const
|
|
27387
|
-
const
|
|
27388
|
-
const parent = this.fsw._getWatchedDir(
|
|
27387
|
+
const dirname5 = sp.dirname(file2);
|
|
27388
|
+
const basename3 = sp.basename(file2);
|
|
27389
|
+
const parent = this.fsw._getWatchedDir(dirname5);
|
|
27389
27390
|
let prevStats = stats;
|
|
27390
|
-
if (parent.has(
|
|
27391
|
+
if (parent.has(basename3))
|
|
27391
27392
|
return;
|
|
27392
27393
|
const listener = async (path5, newStats) => {
|
|
27393
27394
|
if (!this.fsw._throttle(THROTTLE_MODE_WATCH, file2, 5))
|
|
27394
27395
|
return;
|
|
27395
27396
|
if (!newStats || newStats.mtimeMs === 0) {
|
|
27396
27397
|
try {
|
|
27397
|
-
const newStats2 = await (0,
|
|
27398
|
+
const newStats2 = await (0, import_promises2.stat)(file2);
|
|
27398
27399
|
if (this.fsw.closed)
|
|
27399
27400
|
return;
|
|
27400
27401
|
const at2 = newStats2.atimeMs;
|
|
@@ -27402,7 +27403,7 @@ var require_handler = __commonJS({
|
|
|
27402
27403
|
if (!at2 || at2 <= mt2 || mt2 !== prevStats.mtimeMs) {
|
|
27403
27404
|
this.fsw._emit(EV.CHANGE, file2, newStats2);
|
|
27404
27405
|
}
|
|
27405
|
-
if ((
|
|
27406
|
+
if ((isMacos || isLinux || isFreeBSD) && prevStats.ino !== newStats2.ino) {
|
|
27406
27407
|
this.fsw._closeFile(path5);
|
|
27407
27408
|
prevStats = newStats2;
|
|
27408
27409
|
const closer2 = this._watchWithNodeFs(file2, listener);
|
|
@@ -27412,9 +27413,9 @@ var require_handler = __commonJS({
|
|
|
27412
27413
|
prevStats = newStats2;
|
|
27413
27414
|
}
|
|
27414
27415
|
} catch (error48) {
|
|
27415
|
-
this.fsw._remove(
|
|
27416
|
+
this.fsw._remove(dirname5, basename3);
|
|
27416
27417
|
}
|
|
27417
|
-
} else if (parent.has(
|
|
27418
|
+
} else if (parent.has(basename3)) {
|
|
27418
27419
|
const at2 = newStats.atimeMs;
|
|
27419
27420
|
const mt2 = newStats.mtimeMs;
|
|
27420
27421
|
if (!at2 || at2 <= mt2 || mt2 !== prevStats.mtimeMs) {
|
|
@@ -27449,7 +27450,7 @@ var require_handler = __commonJS({
|
|
|
27449
27450
|
this.fsw._incrReadyCount();
|
|
27450
27451
|
let linkPath;
|
|
27451
27452
|
try {
|
|
27452
|
-
linkPath = await (0,
|
|
27453
|
+
linkPath = await (0, import_promises2.realpath)(path5);
|
|
27453
27454
|
} catch (e) {
|
|
27454
27455
|
this.fsw._emitReady();
|
|
27455
27456
|
return true;
|
|
@@ -27475,8 +27476,9 @@ var require_handler = __commonJS({
|
|
|
27475
27476
|
this.fsw._symlinkPaths.set(full, true);
|
|
27476
27477
|
}
|
|
27477
27478
|
_handleRead(directory, initialAdd, wh, target, dir, depth, throttler) {
|
|
27478
|
-
directory =
|
|
27479
|
-
|
|
27479
|
+
directory = sp.join(directory, "");
|
|
27480
|
+
const throttleKey = target ? `${directory}:${target}` : directory;
|
|
27481
|
+
throttler = this.fsw._throttle("readdir", throttleKey, 1e3);
|
|
27480
27482
|
if (!throttler)
|
|
27481
27483
|
return;
|
|
27482
27484
|
const previous = this.fsw._getWatchedDir(wh.path);
|
|
@@ -27487,13 +27489,13 @@ var require_handler = __commonJS({
|
|
|
27487
27489
|
});
|
|
27488
27490
|
if (!stream)
|
|
27489
27491
|
return;
|
|
27490
|
-
stream.on(
|
|
27492
|
+
stream.on(STR_DATA, async (entry) => {
|
|
27491
27493
|
if (this.fsw.closed) {
|
|
27492
27494
|
stream = void 0;
|
|
27493
27495
|
return;
|
|
27494
27496
|
}
|
|
27495
27497
|
const item = entry.path;
|
|
27496
|
-
let path5 =
|
|
27498
|
+
let path5 = sp.join(directory, item);
|
|
27497
27499
|
current.add(item);
|
|
27498
27500
|
if (entry.stats.isSymbolicLink() && await this._handleSymlink(entry, directory, path5, item)) {
|
|
27499
27501
|
return;
|
|
@@ -27504,20 +27506,20 @@ var require_handler = __commonJS({
|
|
|
27504
27506
|
}
|
|
27505
27507
|
if (item === target || !target && !previous.has(item)) {
|
|
27506
27508
|
this.fsw._incrReadyCount();
|
|
27507
|
-
path5 =
|
|
27509
|
+
path5 = sp.join(dir, sp.relative(dir, path5));
|
|
27508
27510
|
this._addToNodeFs(path5, initialAdd, wh, depth + 1);
|
|
27509
27511
|
}
|
|
27510
27512
|
}).on(EV.ERROR, this._boundHandleError);
|
|
27511
|
-
return new Promise((
|
|
27513
|
+
return new Promise((resolve4, reject) => {
|
|
27512
27514
|
if (!stream)
|
|
27513
27515
|
return reject();
|
|
27514
|
-
stream.once(
|
|
27516
|
+
stream.once(STR_END, () => {
|
|
27515
27517
|
if (this.fsw.closed) {
|
|
27516
27518
|
stream = void 0;
|
|
27517
27519
|
return;
|
|
27518
27520
|
}
|
|
27519
27521
|
const wasThrottled = throttler ? throttler.clear() : false;
|
|
27520
|
-
|
|
27522
|
+
resolve4(void 0);
|
|
27521
27523
|
previous.getChildren().filter((item) => {
|
|
27522
27524
|
return item !== directory && !current.has(item);
|
|
27523
27525
|
}).forEach((item) => {
|
|
@@ -27540,18 +27542,18 @@ var require_handler = __commonJS({
|
|
|
27540
27542
|
* @param realpath
|
|
27541
27543
|
* @returns closer for the watcher instance.
|
|
27542
27544
|
*/
|
|
27543
|
-
async _handleDir(dir, stats, initialAdd, depth, target, wh,
|
|
27544
|
-
const parentDir = this.fsw._getWatchedDir(
|
|
27545
|
-
const tracked = parentDir.has(
|
|
27545
|
+
async _handleDir(dir, stats, initialAdd, depth, target, wh, realpath2) {
|
|
27546
|
+
const parentDir = this.fsw._getWatchedDir(sp.dirname(dir));
|
|
27547
|
+
const tracked = parentDir.has(sp.basename(dir));
|
|
27546
27548
|
if (!(initialAdd && this.fsw.options.ignoreInitial) && !target && !tracked) {
|
|
27547
27549
|
this.fsw._emit(EV.ADD_DIR, dir, stats);
|
|
27548
27550
|
}
|
|
27549
|
-
parentDir.add(
|
|
27551
|
+
parentDir.add(sp.basename(dir));
|
|
27550
27552
|
this.fsw._getWatchedDir(dir);
|
|
27551
27553
|
let throttler;
|
|
27552
27554
|
let closer;
|
|
27553
27555
|
const oDepth = this.fsw.options.depth;
|
|
27554
|
-
if ((oDepth == null || depth <= oDepth) && !this.fsw._symlinkPaths.has(
|
|
27556
|
+
if ((oDepth == null || depth <= oDepth) && !this.fsw._symlinkPaths.has(realpath2)) {
|
|
27555
27557
|
if (!target) {
|
|
27556
27558
|
await this._handleRead(dir, initialAdd, wh, target, dir, depth, throttler);
|
|
27557
27559
|
if (this.fsw.closed)
|
|
@@ -27596,8 +27598,8 @@ var require_handler = __commonJS({
|
|
|
27596
27598
|
const follow = this.fsw.options.followSymlinks;
|
|
27597
27599
|
let closer;
|
|
27598
27600
|
if (stats.isDirectory()) {
|
|
27599
|
-
const absPath =
|
|
27600
|
-
const targetPath = follow ? await (0,
|
|
27601
|
+
const absPath = sp.resolve(path5);
|
|
27602
|
+
const targetPath = follow ? await (0, import_promises2.realpath)(path5) : path5;
|
|
27601
27603
|
if (this.fsw.closed)
|
|
27602
27604
|
return;
|
|
27603
27605
|
closer = await this._handleDir(wh.watchPath, stats, initialAdd, depth, target, wh, targetPath);
|
|
@@ -27607,17 +27609,17 @@ var require_handler = __commonJS({
|
|
|
27607
27609
|
this.fsw._symlinkPaths.set(absPath, targetPath);
|
|
27608
27610
|
}
|
|
27609
27611
|
} else if (stats.isSymbolicLink()) {
|
|
27610
|
-
const targetPath = follow ? await (0,
|
|
27612
|
+
const targetPath = follow ? await (0, import_promises2.realpath)(path5) : path5;
|
|
27611
27613
|
if (this.fsw.closed)
|
|
27612
27614
|
return;
|
|
27613
|
-
const parent =
|
|
27615
|
+
const parent = sp.dirname(wh.watchPath);
|
|
27614
27616
|
this.fsw._getWatchedDir(parent).add(wh.watchPath);
|
|
27615
27617
|
this.fsw._emit(EV.ADD, wh.watchPath, stats);
|
|
27616
27618
|
closer = await this._handleDir(parent, stats, initialAdd, depth, path5, wh, targetPath);
|
|
27617
27619
|
if (this.fsw.closed)
|
|
27618
27620
|
return;
|
|
27619
27621
|
if (targetPath !== void 0) {
|
|
27620
|
-
this.fsw._symlinkPaths.set(
|
|
27622
|
+
this.fsw._symlinkPaths.set(sp.resolve(path5), targetPath);
|
|
27621
27623
|
}
|
|
27622
27624
|
} else {
|
|
27623
27625
|
closer = this._handleFile(wh.watchPath, stats, initialAdd);
|
|
@@ -27634,134 +27636,142 @@ var require_handler = __commonJS({
|
|
|
27634
27636
|
}
|
|
27635
27637
|
}
|
|
27636
27638
|
};
|
|
27637
|
-
exports2.NodeFsHandler = NodeFsHandler;
|
|
27638
27639
|
}
|
|
27639
27640
|
});
|
|
27640
27641
|
|
|
27641
|
-
//
|
|
27642
|
-
var
|
|
27643
|
-
|
|
27644
|
-
|
|
27645
|
-
|
|
27646
|
-
|
|
27647
|
-
|
|
27648
|
-
|
|
27649
|
-
|
|
27650
|
-
|
|
27651
|
-
|
|
27652
|
-
|
|
27653
|
-
|
|
27654
|
-
|
|
27655
|
-
|
|
27656
|
-
|
|
27657
|
-
|
|
27658
|
-
|
|
27659
|
-
|
|
27660
|
-
|
|
27661
|
-
|
|
27662
|
-
|
|
27663
|
-
|
|
27664
|
-
|
|
27665
|
-
|
|
27666
|
-
var isMatcherObject = (matcher) => typeof matcher === "object" && matcher !== null && !(matcher instanceof RegExp);
|
|
27667
|
-
function createPattern(matcher) {
|
|
27668
|
-
if (typeof matcher === "function")
|
|
27669
|
-
return matcher;
|
|
27670
|
-
if (typeof matcher === "string")
|
|
27671
|
-
return (string4) => matcher === string4;
|
|
27672
|
-
if (matcher instanceof RegExp)
|
|
27673
|
-
return (string4) => matcher.test(string4);
|
|
27674
|
-
if (typeof matcher === "object" && matcher !== null) {
|
|
27675
|
-
return (string4) => {
|
|
27676
|
-
if (matcher.path === string4)
|
|
27677
|
-
return true;
|
|
27678
|
-
if (matcher.recursive) {
|
|
27679
|
-
const relative = sysPath.relative(matcher.path, string4);
|
|
27680
|
-
if (!relative) {
|
|
27681
|
-
return false;
|
|
27682
|
-
}
|
|
27683
|
-
return !relative.startsWith("..") && !sysPath.isAbsolute(relative);
|
|
27684
|
-
}
|
|
27642
|
+
// ../daemon-core/node_modules/chokidar/index.js
|
|
27643
|
+
var chokidar_exports = {};
|
|
27644
|
+
__export(chokidar_exports, {
|
|
27645
|
+
FSWatcher: () => FSWatcher,
|
|
27646
|
+
WatchHelper: () => WatchHelper,
|
|
27647
|
+
default: () => chokidar_default,
|
|
27648
|
+
watch: () => watch
|
|
27649
|
+
});
|
|
27650
|
+
function arrify(item) {
|
|
27651
|
+
return Array.isArray(item) ? item : [item];
|
|
27652
|
+
}
|
|
27653
|
+
function createPattern(matcher) {
|
|
27654
|
+
if (typeof matcher === "function")
|
|
27655
|
+
return matcher;
|
|
27656
|
+
if (typeof matcher === "string")
|
|
27657
|
+
return (string4) => matcher === string4;
|
|
27658
|
+
if (matcher instanceof RegExp)
|
|
27659
|
+
return (string4) => matcher.test(string4);
|
|
27660
|
+
if (typeof matcher === "object" && matcher !== null) {
|
|
27661
|
+
return (string4) => {
|
|
27662
|
+
if (matcher.path === string4)
|
|
27663
|
+
return true;
|
|
27664
|
+
if (matcher.recursive) {
|
|
27665
|
+
const relative3 = sp2.relative(matcher.path, string4);
|
|
27666
|
+
if (!relative3) {
|
|
27685
27667
|
return false;
|
|
27686
|
-
};
|
|
27687
|
-
}
|
|
27688
|
-
return () => false;
|
|
27689
|
-
}
|
|
27690
|
-
function normalizePath(path5) {
|
|
27691
|
-
if (typeof path5 !== "string")
|
|
27692
|
-
throw new Error("string expected");
|
|
27693
|
-
path5 = sysPath.normalize(path5);
|
|
27694
|
-
path5 = path5.replace(/\\/g, "/");
|
|
27695
|
-
let prepend = false;
|
|
27696
|
-
if (path5.startsWith("//"))
|
|
27697
|
-
prepend = true;
|
|
27698
|
-
const DOUBLE_SLASH_RE2 = /\/\//;
|
|
27699
|
-
while (path5.match(DOUBLE_SLASH_RE2))
|
|
27700
|
-
path5 = path5.replace(DOUBLE_SLASH_RE2, "/");
|
|
27701
|
-
if (prepend)
|
|
27702
|
-
path5 = "/" + path5;
|
|
27703
|
-
return path5;
|
|
27704
|
-
}
|
|
27705
|
-
function matchPatterns(patterns, testString, stats) {
|
|
27706
|
-
const path5 = normalizePath(testString);
|
|
27707
|
-
for (let index = 0; index < patterns.length; index++) {
|
|
27708
|
-
const pattern = patterns[index];
|
|
27709
|
-
if (pattern(path5, stats)) {
|
|
27710
|
-
return true;
|
|
27711
27668
|
}
|
|
27669
|
+
return !relative3.startsWith("..") && !sp2.isAbsolute(relative3);
|
|
27712
27670
|
}
|
|
27713
27671
|
return false;
|
|
27672
|
+
};
|
|
27673
|
+
}
|
|
27674
|
+
return () => false;
|
|
27675
|
+
}
|
|
27676
|
+
function normalizePath(path5) {
|
|
27677
|
+
if (typeof path5 !== "string")
|
|
27678
|
+
throw new Error("string expected");
|
|
27679
|
+
path5 = sp2.normalize(path5);
|
|
27680
|
+
path5 = path5.replace(/\\/g, "/");
|
|
27681
|
+
let prepend = false;
|
|
27682
|
+
if (path5.startsWith("//"))
|
|
27683
|
+
prepend = true;
|
|
27684
|
+
path5 = path5.replace(DOUBLE_SLASH_RE, "/");
|
|
27685
|
+
if (prepend)
|
|
27686
|
+
path5 = "/" + path5;
|
|
27687
|
+
return path5;
|
|
27688
|
+
}
|
|
27689
|
+
function matchPatterns(patterns, testString, stats) {
|
|
27690
|
+
const path5 = normalizePath(testString);
|
|
27691
|
+
for (let index = 0; index < patterns.length; index++) {
|
|
27692
|
+
const pattern = patterns[index];
|
|
27693
|
+
if (pattern(path5, stats)) {
|
|
27694
|
+
return true;
|
|
27714
27695
|
}
|
|
27715
|
-
|
|
27716
|
-
|
|
27717
|
-
|
|
27718
|
-
|
|
27719
|
-
|
|
27720
|
-
|
|
27721
|
-
|
|
27722
|
-
|
|
27723
|
-
|
|
27724
|
-
|
|
27725
|
-
|
|
27726
|
-
return matchPatterns(patterns,
|
|
27727
|
-
}
|
|
27728
|
-
|
|
27696
|
+
}
|
|
27697
|
+
return false;
|
|
27698
|
+
}
|
|
27699
|
+
function anymatch(matchers, testString) {
|
|
27700
|
+
if (matchers == null) {
|
|
27701
|
+
throw new TypeError("anymatch: specify first argument");
|
|
27702
|
+
}
|
|
27703
|
+
const matchersArray = arrify(matchers);
|
|
27704
|
+
const patterns = matchersArray.map((matcher) => createPattern(matcher));
|
|
27705
|
+
if (testString == null) {
|
|
27706
|
+
return (testString2, stats) => {
|
|
27707
|
+
return matchPatterns(patterns, testString2, stats);
|
|
27708
|
+
};
|
|
27709
|
+
}
|
|
27710
|
+
return matchPatterns(patterns, testString);
|
|
27711
|
+
}
|
|
27712
|
+
function watch(paths, options = {}) {
|
|
27713
|
+
const watcher = new FSWatcher(options);
|
|
27714
|
+
watcher.add(paths);
|
|
27715
|
+
return watcher;
|
|
27716
|
+
}
|
|
27717
|
+
var import_node_events, import_node_fs2, import_promises3, sp2, SLASH, SLASH_SLASH, ONE_DOT, TWO_DOTS, STRING_TYPE, BACK_SLASH_RE, DOUBLE_SLASH_RE, DOT_RE, REPLACER_RE, isMatcherObject, unifyPaths, toUnix, normalizePathToUnix, normalizeIgnored, getAbsolutePath, EMPTY_SET, DirEntry, STAT_METHOD_F, STAT_METHOD_L, WatchHelper, FSWatcher, chokidar_default;
|
|
27718
|
+
var init_chokidar = __esm({
|
|
27719
|
+
"../daemon-core/node_modules/chokidar/index.js"() {
|
|
27720
|
+
"use strict";
|
|
27721
|
+
import_node_events = require("events");
|
|
27722
|
+
import_node_fs2 = require("fs");
|
|
27723
|
+
import_promises3 = require("fs/promises");
|
|
27724
|
+
sp2 = __toESM(require("path"), 1);
|
|
27725
|
+
init_readdirp();
|
|
27726
|
+
init_handler();
|
|
27727
|
+
SLASH = "/";
|
|
27728
|
+
SLASH_SLASH = "//";
|
|
27729
|
+
ONE_DOT = ".";
|
|
27730
|
+
TWO_DOTS = "..";
|
|
27731
|
+
STRING_TYPE = "string";
|
|
27732
|
+
BACK_SLASH_RE = /\\/g;
|
|
27733
|
+
DOUBLE_SLASH_RE = /\/\//g;
|
|
27734
|
+
DOT_RE = /\..*\.(sw[px])$|~$|\.subl.*\.tmp/;
|
|
27735
|
+
REPLACER_RE = /^\.[/\\]/;
|
|
27736
|
+
isMatcherObject = (matcher) => typeof matcher === "object" && matcher !== null && !(matcher instanceof RegExp);
|
|
27737
|
+
unifyPaths = (paths_) => {
|
|
27729
27738
|
const paths = arrify(paths_).flat();
|
|
27730
27739
|
if (!paths.every((p) => typeof p === STRING_TYPE)) {
|
|
27731
27740
|
throw new TypeError(`Non-string provided as watch path: ${paths}`);
|
|
27732
27741
|
}
|
|
27733
27742
|
return paths.map(normalizePathToUnix);
|
|
27734
27743
|
};
|
|
27735
|
-
|
|
27744
|
+
toUnix = (string4) => {
|
|
27736
27745
|
let str = string4.replace(BACK_SLASH_RE, SLASH);
|
|
27737
27746
|
let prepend = false;
|
|
27738
27747
|
if (str.startsWith(SLASH_SLASH)) {
|
|
27739
27748
|
prepend = true;
|
|
27740
27749
|
}
|
|
27741
|
-
|
|
27742
|
-
str = str.replace(DOUBLE_SLASH_RE, SLASH);
|
|
27743
|
-
}
|
|
27750
|
+
str = str.replace(DOUBLE_SLASH_RE, SLASH);
|
|
27744
27751
|
if (prepend) {
|
|
27745
27752
|
str = SLASH + str;
|
|
27746
27753
|
}
|
|
27747
27754
|
return str;
|
|
27748
27755
|
};
|
|
27749
|
-
|
|
27750
|
-
|
|
27756
|
+
normalizePathToUnix = (path5) => toUnix(sp2.normalize(toUnix(path5)));
|
|
27757
|
+
normalizeIgnored = (cwd = "") => (path5) => {
|
|
27751
27758
|
if (typeof path5 === "string") {
|
|
27752
|
-
return normalizePathToUnix(
|
|
27759
|
+
return normalizePathToUnix(sp2.isAbsolute(path5) ? path5 : sp2.join(cwd, path5));
|
|
27753
27760
|
} else {
|
|
27754
27761
|
return path5;
|
|
27755
27762
|
}
|
|
27756
27763
|
};
|
|
27757
|
-
|
|
27758
|
-
if (
|
|
27764
|
+
getAbsolutePath = (path5, cwd) => {
|
|
27765
|
+
if (sp2.isAbsolute(path5)) {
|
|
27759
27766
|
return path5;
|
|
27760
27767
|
}
|
|
27761
|
-
return
|
|
27768
|
+
return sp2.join(cwd, path5);
|
|
27762
27769
|
};
|
|
27763
|
-
|
|
27764
|
-
|
|
27770
|
+
EMPTY_SET = Object.freeze(/* @__PURE__ */ new Set());
|
|
27771
|
+
DirEntry = class {
|
|
27772
|
+
path;
|
|
27773
|
+
_removeWatcher;
|
|
27774
|
+
items;
|
|
27765
27775
|
constructor(dir, removeWatcher) {
|
|
27766
27776
|
this.path = dir;
|
|
27767
27777
|
this._removeWatcher = removeWatcher;
|
|
@@ -27783,10 +27793,10 @@ var require_chokidar = __commonJS({
|
|
|
27783
27793
|
return;
|
|
27784
27794
|
const dir = this.path;
|
|
27785
27795
|
try {
|
|
27786
|
-
await (0,
|
|
27796
|
+
await (0, import_promises3.readdir)(dir);
|
|
27787
27797
|
} catch (err) {
|
|
27788
27798
|
if (this._removeWatcher) {
|
|
27789
|
-
this._removeWatcher(
|
|
27799
|
+
this._removeWatcher(sp2.dirname(dir), sp2.basename(dir));
|
|
27790
27800
|
}
|
|
27791
27801
|
}
|
|
27792
27802
|
}
|
|
@@ -27805,20 +27815,27 @@ var require_chokidar = __commonJS({
|
|
|
27805
27815
|
dispose() {
|
|
27806
27816
|
this.items.clear();
|
|
27807
27817
|
this.path = "";
|
|
27808
|
-
this._removeWatcher =
|
|
27818
|
+
this._removeWatcher = EMPTY_FN;
|
|
27809
27819
|
this.items = EMPTY_SET;
|
|
27810
27820
|
Object.freeze(this);
|
|
27811
27821
|
}
|
|
27812
27822
|
};
|
|
27813
|
-
|
|
27814
|
-
|
|
27815
|
-
|
|
27823
|
+
STAT_METHOD_F = "stat";
|
|
27824
|
+
STAT_METHOD_L = "lstat";
|
|
27825
|
+
WatchHelper = class {
|
|
27826
|
+
fsw;
|
|
27827
|
+
path;
|
|
27828
|
+
watchPath;
|
|
27829
|
+
fullWatchPath;
|
|
27830
|
+
dirParts;
|
|
27831
|
+
followSymlinks;
|
|
27832
|
+
statMethod;
|
|
27816
27833
|
constructor(path5, follow, fsw) {
|
|
27817
27834
|
this.fsw = fsw;
|
|
27818
27835
|
const watchPath = path5;
|
|
27819
27836
|
this.path = path5 = path5.replace(REPLACER_RE, "");
|
|
27820
27837
|
this.watchPath = watchPath;
|
|
27821
|
-
this.fullWatchPath =
|
|
27838
|
+
this.fullWatchPath = sp2.resolve(watchPath);
|
|
27822
27839
|
this.dirParts = [];
|
|
27823
27840
|
this.dirParts.forEach((parts) => {
|
|
27824
27841
|
if (parts.length > 1)
|
|
@@ -27828,7 +27845,7 @@ var require_chokidar = __commonJS({
|
|
|
27828
27845
|
this.statMethod = follow ? STAT_METHOD_F : STAT_METHOD_L;
|
|
27829
27846
|
}
|
|
27830
27847
|
entryPath(entry) {
|
|
27831
|
-
return
|
|
27848
|
+
return sp2.join(this.watchPath, sp2.relative(this.watchPath, entry.fullPath));
|
|
27832
27849
|
}
|
|
27833
27850
|
filterPath(entry) {
|
|
27834
27851
|
const { stats } = entry;
|
|
@@ -27841,8 +27858,25 @@ var require_chokidar = __commonJS({
|
|
|
27841
27858
|
return this.fsw._isntIgnored(this.entryPath(entry), entry.stats);
|
|
27842
27859
|
}
|
|
27843
27860
|
};
|
|
27844
|
-
|
|
27845
|
-
|
|
27861
|
+
FSWatcher = class extends import_node_events.EventEmitter {
|
|
27862
|
+
closed;
|
|
27863
|
+
options;
|
|
27864
|
+
_closers;
|
|
27865
|
+
_ignoredPaths;
|
|
27866
|
+
_throttled;
|
|
27867
|
+
_streams;
|
|
27868
|
+
_symlinkPaths;
|
|
27869
|
+
_watched;
|
|
27870
|
+
_pendingWrites;
|
|
27871
|
+
_pendingUnlinks;
|
|
27872
|
+
_readyCount;
|
|
27873
|
+
_emitReady;
|
|
27874
|
+
_closePromise;
|
|
27875
|
+
_userIgnored;
|
|
27876
|
+
_readyEmitted;
|
|
27877
|
+
_emitRaw;
|
|
27878
|
+
_boundRemove;
|
|
27879
|
+
_nodeFsHandler;
|
|
27846
27880
|
// Not indenting methods for history sake; for now.
|
|
27847
27881
|
constructor(_opts = {}) {
|
|
27848
27882
|
super();
|
|
@@ -27876,7 +27910,7 @@ var require_chokidar = __commonJS({
|
|
|
27876
27910
|
ignored: _opts.ignored ? arrify(_opts.ignored) : arrify([]),
|
|
27877
27911
|
awaitWriteFinish: awf === true ? DEF_AWF : typeof awf === "object" ? { ...DEF_AWF, ...awf } : false
|
|
27878
27912
|
};
|
|
27879
|
-
if (
|
|
27913
|
+
if (isIBMi)
|
|
27880
27914
|
opts.usePolling = true;
|
|
27881
27915
|
if (opts.atomic === void 0)
|
|
27882
27916
|
opts.atomic = !opts.usePolling;
|
|
@@ -27897,15 +27931,15 @@ var require_chokidar = __commonJS({
|
|
|
27897
27931
|
this._emitReady = () => {
|
|
27898
27932
|
readyCalls++;
|
|
27899
27933
|
if (readyCalls >= this._readyCount) {
|
|
27900
|
-
this._emitReady =
|
|
27934
|
+
this._emitReady = EMPTY_FN;
|
|
27901
27935
|
this._readyEmitted = true;
|
|
27902
|
-
process.nextTick(() => this.emit(
|
|
27936
|
+
process.nextTick(() => this.emit(EVENTS.READY));
|
|
27903
27937
|
}
|
|
27904
27938
|
};
|
|
27905
|
-
this._emitRaw = (...args) => this.emit(
|
|
27939
|
+
this._emitRaw = (...args) => this.emit(EVENTS.RAW, ...args);
|
|
27906
27940
|
this._boundRemove = this._remove.bind(this);
|
|
27907
27941
|
this.options = opts;
|
|
27908
|
-
this._nodeFsHandler = new
|
|
27942
|
+
this._nodeFsHandler = new NodeFsHandler(this);
|
|
27909
27943
|
Object.freeze(opts);
|
|
27910
27944
|
}
|
|
27911
27945
|
_addIgnoredPath(matcher) {
|
|
@@ -27961,7 +27995,7 @@ var require_chokidar = __commonJS({
|
|
|
27961
27995
|
return;
|
|
27962
27996
|
results.forEach((item) => {
|
|
27963
27997
|
if (item)
|
|
27964
|
-
this.add(
|
|
27998
|
+
this.add(sp2.dirname(item), sp2.basename(_origAdd || item));
|
|
27965
27999
|
});
|
|
27966
28000
|
});
|
|
27967
28001
|
return this;
|
|
@@ -27975,10 +28009,10 @@ var require_chokidar = __commonJS({
|
|
|
27975
28009
|
const paths = unifyPaths(paths_);
|
|
27976
28010
|
const { cwd } = this.options;
|
|
27977
28011
|
paths.forEach((path5) => {
|
|
27978
|
-
if (!
|
|
28012
|
+
if (!sp2.isAbsolute(path5) && !this._closers.has(path5)) {
|
|
27979
28013
|
if (cwd)
|
|
27980
|
-
path5 =
|
|
27981
|
-
path5 =
|
|
28014
|
+
path5 = sp2.join(cwd, path5);
|
|
28015
|
+
path5 = sp2.resolve(path5);
|
|
27982
28016
|
}
|
|
27983
28017
|
this._closePath(path5);
|
|
27984
28018
|
this._addIgnoredPath(path5);
|
|
@@ -28027,7 +28061,7 @@ var require_chokidar = __commonJS({
|
|
|
28027
28061
|
getWatched() {
|
|
28028
28062
|
const watchList = {};
|
|
28029
28063
|
this._watched.forEach((entry, dir) => {
|
|
28030
|
-
const key = this.options.cwd ?
|
|
28064
|
+
const key = this.options.cwd ? sp2.relative(this.options.cwd, dir) : dir;
|
|
28031
28065
|
const index = key || ONE_DOT;
|
|
28032
28066
|
watchList[index] = entry.getChildren().sort();
|
|
28033
28067
|
});
|
|
@@ -28035,8 +28069,8 @@ var require_chokidar = __commonJS({
|
|
|
28035
28069
|
}
|
|
28036
28070
|
emitWithAll(event, args) {
|
|
28037
28071
|
this.emit(event, ...args);
|
|
28038
|
-
if (event !==
|
|
28039
|
-
this.emit(
|
|
28072
|
+
if (event !== EVENTS.ERROR)
|
|
28073
|
+
this.emit(EVENTS.ALL, event, ...args);
|
|
28040
28074
|
}
|
|
28041
28075
|
// Common helpers
|
|
28042
28076
|
// --------------
|
|
@@ -28052,10 +28086,10 @@ var require_chokidar = __commonJS({
|
|
|
28052
28086
|
if (this.closed)
|
|
28053
28087
|
return;
|
|
28054
28088
|
const opts = this.options;
|
|
28055
|
-
if (
|
|
28056
|
-
path5 =
|
|
28089
|
+
if (isWindows)
|
|
28090
|
+
path5 = sp2.normalize(path5);
|
|
28057
28091
|
if (opts.cwd)
|
|
28058
|
-
path5 =
|
|
28092
|
+
path5 = sp2.relative(opts.cwd, path5);
|
|
28059
28093
|
const args = [path5];
|
|
28060
28094
|
if (stats != null)
|
|
28061
28095
|
args.push(stats);
|
|
@@ -28066,26 +28100,26 @@ var require_chokidar = __commonJS({
|
|
|
28066
28100
|
return this;
|
|
28067
28101
|
}
|
|
28068
28102
|
if (opts.atomic) {
|
|
28069
|
-
if (event ===
|
|
28103
|
+
if (event === EVENTS.UNLINK) {
|
|
28070
28104
|
this._pendingUnlinks.set(path5, [event, ...args]);
|
|
28071
28105
|
setTimeout(() => {
|
|
28072
28106
|
this._pendingUnlinks.forEach((entry, path6) => {
|
|
28073
28107
|
this.emit(...entry);
|
|
28074
|
-
this.emit(
|
|
28108
|
+
this.emit(EVENTS.ALL, ...entry);
|
|
28075
28109
|
this._pendingUnlinks.delete(path6);
|
|
28076
28110
|
});
|
|
28077
28111
|
}, typeof opts.atomic === "number" ? opts.atomic : 100);
|
|
28078
28112
|
return this;
|
|
28079
28113
|
}
|
|
28080
|
-
if (event ===
|
|
28081
|
-
event =
|
|
28114
|
+
if (event === EVENTS.ADD && this._pendingUnlinks.has(path5)) {
|
|
28115
|
+
event = EVENTS.CHANGE;
|
|
28082
28116
|
this._pendingUnlinks.delete(path5);
|
|
28083
28117
|
}
|
|
28084
28118
|
}
|
|
28085
|
-
if (awf && (event ===
|
|
28119
|
+
if (awf && (event === EVENTS.ADD || event === EVENTS.CHANGE) && this._readyEmitted) {
|
|
28086
28120
|
const awfEmit = (err, stats2) => {
|
|
28087
28121
|
if (err) {
|
|
28088
|
-
event =
|
|
28122
|
+
event = EVENTS.ERROR;
|
|
28089
28123
|
args[0] = err;
|
|
28090
28124
|
this.emitWithAll(event, args);
|
|
28091
28125
|
} else if (stats2) {
|
|
@@ -28100,16 +28134,16 @@ var require_chokidar = __commonJS({
|
|
|
28100
28134
|
this._awaitWriteFinish(path5, awf.stabilityThreshold, event, awfEmit);
|
|
28101
28135
|
return this;
|
|
28102
28136
|
}
|
|
28103
|
-
if (event ===
|
|
28104
|
-
const isThrottled = !this._throttle(
|
|
28137
|
+
if (event === EVENTS.CHANGE) {
|
|
28138
|
+
const isThrottled = !this._throttle(EVENTS.CHANGE, path5, 50);
|
|
28105
28139
|
if (isThrottled)
|
|
28106
28140
|
return this;
|
|
28107
28141
|
}
|
|
28108
|
-
if (opts.alwaysStat && stats === void 0 && (event ===
|
|
28109
|
-
const fullPath = opts.cwd ?
|
|
28142
|
+
if (opts.alwaysStat && stats === void 0 && (event === EVENTS.ADD || event === EVENTS.ADD_DIR || event === EVENTS.CHANGE)) {
|
|
28143
|
+
const fullPath = opts.cwd ? sp2.join(opts.cwd, path5) : path5;
|
|
28110
28144
|
let stats2;
|
|
28111
28145
|
try {
|
|
28112
|
-
stats2 = await (0,
|
|
28146
|
+
stats2 = await (0, import_promises3.stat)(fullPath);
|
|
28113
28147
|
} catch (err) {
|
|
28114
28148
|
}
|
|
28115
28149
|
if (!stats2 || this.closed)
|
|
@@ -28126,7 +28160,7 @@ var require_chokidar = __commonJS({
|
|
|
28126
28160
|
_handleError(error48) {
|
|
28127
28161
|
const code = error48 && error48.code;
|
|
28128
28162
|
if (error48 && code !== "ENOENT" && code !== "ENOTDIR" && (!this.options.ignorePermissionErrors || code !== "EPERM" && code !== "EACCES")) {
|
|
28129
|
-
this.emit(
|
|
28163
|
+
this.emit(EVENTS.ERROR, error48);
|
|
28130
28164
|
}
|
|
28131
28165
|
return error48 || this.closed;
|
|
28132
28166
|
}
|
|
@@ -28182,13 +28216,13 @@ var require_chokidar = __commonJS({
|
|
|
28182
28216
|
const pollInterval = awf.pollInterval;
|
|
28183
28217
|
let timeoutHandler;
|
|
28184
28218
|
let fullPath = path5;
|
|
28185
|
-
if (this.options.cwd && !
|
|
28186
|
-
fullPath =
|
|
28219
|
+
if (this.options.cwd && !sp2.isAbsolute(path5)) {
|
|
28220
|
+
fullPath = sp2.join(this.options.cwd, path5);
|
|
28187
28221
|
}
|
|
28188
28222
|
const now = /* @__PURE__ */ new Date();
|
|
28189
28223
|
const writes = this._pendingWrites;
|
|
28190
28224
|
function awaitWriteFinishFn(prevStat) {
|
|
28191
|
-
(0,
|
|
28225
|
+
(0, import_node_fs2.stat)(fullPath, (err, curStat) => {
|
|
28192
28226
|
if (err || !writes.has(path5)) {
|
|
28193
28227
|
if (err && err.code !== "ENOENT")
|
|
28194
28228
|
awfEmit(err);
|
|
@@ -28236,8 +28270,8 @@ var require_chokidar = __commonJS({
|
|
|
28236
28270
|
}
|
|
28237
28271
|
return this._userIgnored(path5, stats);
|
|
28238
28272
|
}
|
|
28239
|
-
_isntIgnored(path5,
|
|
28240
|
-
return !this._isIgnored(path5,
|
|
28273
|
+
_isntIgnored(path5, stat4) {
|
|
28274
|
+
return !this._isIgnored(path5, stat4);
|
|
28241
28275
|
}
|
|
28242
28276
|
/**
|
|
28243
28277
|
* Provides a set of common helpers and properties relating to symlink handling.
|
|
@@ -28253,7 +28287,7 @@ var require_chokidar = __commonJS({
|
|
|
28253
28287
|
* @param directory path of the directory
|
|
28254
28288
|
*/
|
|
28255
28289
|
_getWatchedDir(directory) {
|
|
28256
|
-
const dir =
|
|
28290
|
+
const dir = sp2.resolve(directory);
|
|
28257
28291
|
if (!this._watched.has(dir))
|
|
28258
28292
|
this._watched.set(dir, new DirEntry(dir, this._boundRemove));
|
|
28259
28293
|
return this._watched.get(dir);
|
|
@@ -28276,8 +28310,8 @@ var require_chokidar = __commonJS({
|
|
|
28276
28310
|
* @param item base path of item/directory
|
|
28277
28311
|
*/
|
|
28278
28312
|
_remove(directory, item, isDirectory) {
|
|
28279
|
-
const path5 =
|
|
28280
|
-
const fullPath =
|
|
28313
|
+
const path5 = sp2.join(directory, item);
|
|
28314
|
+
const fullPath = sp2.resolve(path5);
|
|
28281
28315
|
isDirectory = isDirectory != null ? isDirectory : this._watched.has(path5) || this._watched.has(fullPath);
|
|
28282
28316
|
if (!this._throttle("remove", path5, 100))
|
|
28283
28317
|
return;
|
|
@@ -28295,15 +28329,15 @@ var require_chokidar = __commonJS({
|
|
|
28295
28329
|
}
|
|
28296
28330
|
let relPath = path5;
|
|
28297
28331
|
if (this.options.cwd)
|
|
28298
|
-
relPath =
|
|
28332
|
+
relPath = sp2.relative(this.options.cwd, path5);
|
|
28299
28333
|
if (this.options.awaitWriteFinish && this._pendingWrites.has(relPath)) {
|
|
28300
28334
|
const event = this._pendingWrites.get(relPath).cancelWait();
|
|
28301
|
-
if (event ===
|
|
28335
|
+
if (event === EVENTS.ADD)
|
|
28302
28336
|
return;
|
|
28303
28337
|
}
|
|
28304
28338
|
this._watched.delete(path5);
|
|
28305
28339
|
this._watched.delete(fullPath);
|
|
28306
|
-
const eventName = isDirectory ?
|
|
28340
|
+
const eventName = isDirectory ? EVENTS.UNLINK_DIR : EVENTS.UNLINK;
|
|
28307
28341
|
if (wasTracked && !this._isIgnored(path5))
|
|
28308
28342
|
this._emit(eventName, path5);
|
|
28309
28343
|
this._closePath(path5);
|
|
@@ -28313,8 +28347,8 @@ var require_chokidar = __commonJS({
|
|
|
28313
28347
|
*/
|
|
28314
28348
|
_closePath(path5) {
|
|
28315
28349
|
this._closeFile(path5);
|
|
28316
|
-
const dir =
|
|
28317
|
-
this._getWatchedDir(dir).remove(
|
|
28350
|
+
const dir = sp2.dirname(path5);
|
|
28351
|
+
this._getWatchedDir(dir).remove(sp2.basename(path5));
|
|
28318
28352
|
}
|
|
28319
28353
|
/**
|
|
28320
28354
|
* Closes only file-specific watchers
|
|
@@ -28339,13 +28373,13 @@ var require_chokidar = __commonJS({
|
|
|
28339
28373
|
_readdirp(root, opts) {
|
|
28340
28374
|
if (this.closed)
|
|
28341
28375
|
return;
|
|
28342
|
-
const options = { type:
|
|
28343
|
-
let stream =
|
|
28376
|
+
const options = { type: EVENTS.ALL, alwaysStat: true, lstat: true, ...opts, depth: 0 };
|
|
28377
|
+
let stream = readdirp(root, options);
|
|
28344
28378
|
this._streams.add(stream);
|
|
28345
|
-
stream.once(
|
|
28379
|
+
stream.once(STR_CLOSE, () => {
|
|
28346
28380
|
stream = void 0;
|
|
28347
28381
|
});
|
|
28348
|
-
stream.once(
|
|
28382
|
+
stream.once(STR_END, () => {
|
|
28349
28383
|
if (stream) {
|
|
28350
28384
|
this._streams.delete(stream);
|
|
28351
28385
|
stream = void 0;
|
|
@@ -28354,13 +28388,2802 @@ var require_chokidar = __commonJS({
|
|
|
28354
28388
|
return stream;
|
|
28355
28389
|
}
|
|
28356
28390
|
};
|
|
28357
|
-
|
|
28358
|
-
|
|
28359
|
-
|
|
28360
|
-
|
|
28361
|
-
|
|
28391
|
+
chokidar_default = { watch, FSWatcher };
|
|
28392
|
+
}
|
|
28393
|
+
});
|
|
28394
|
+
|
|
28395
|
+
// ../../node_modules/js-yaml/lib/common.js
|
|
28396
|
+
var require_common = __commonJS({
|
|
28397
|
+
"../../node_modules/js-yaml/lib/common.js"(exports2, module2) {
|
|
28398
|
+
"use strict";
|
|
28399
|
+
function isNothing(subject) {
|
|
28400
|
+
return typeof subject === "undefined" || subject === null;
|
|
28401
|
+
}
|
|
28402
|
+
function isObject2(subject) {
|
|
28403
|
+
return typeof subject === "object" && subject !== null;
|
|
28404
|
+
}
|
|
28405
|
+
function toArray(sequence) {
|
|
28406
|
+
if (Array.isArray(sequence)) return sequence;
|
|
28407
|
+
else if (isNothing(sequence)) return [];
|
|
28408
|
+
return [sequence];
|
|
28409
|
+
}
|
|
28410
|
+
function extend2(target, source) {
|
|
28411
|
+
var index, length, key, sourceKeys;
|
|
28412
|
+
if (source) {
|
|
28413
|
+
sourceKeys = Object.keys(source);
|
|
28414
|
+
for (index = 0, length = sourceKeys.length; index < length; index += 1) {
|
|
28415
|
+
key = sourceKeys[index];
|
|
28416
|
+
target[key] = source[key];
|
|
28417
|
+
}
|
|
28418
|
+
}
|
|
28419
|
+
return target;
|
|
28420
|
+
}
|
|
28421
|
+
function repeat(string4, count) {
|
|
28422
|
+
var result = "", cycle;
|
|
28423
|
+
for (cycle = 0; cycle < count; cycle += 1) {
|
|
28424
|
+
result += string4;
|
|
28425
|
+
}
|
|
28426
|
+
return result;
|
|
28427
|
+
}
|
|
28428
|
+
function isNegativeZero(number4) {
|
|
28429
|
+
return number4 === 0 && Number.NEGATIVE_INFINITY === 1 / number4;
|
|
28430
|
+
}
|
|
28431
|
+
module2.exports.isNothing = isNothing;
|
|
28432
|
+
module2.exports.isObject = isObject2;
|
|
28433
|
+
module2.exports.toArray = toArray;
|
|
28434
|
+
module2.exports.repeat = repeat;
|
|
28435
|
+
module2.exports.isNegativeZero = isNegativeZero;
|
|
28436
|
+
module2.exports.extend = extend2;
|
|
28437
|
+
}
|
|
28438
|
+
});
|
|
28439
|
+
|
|
28440
|
+
// ../../node_modules/js-yaml/lib/exception.js
|
|
28441
|
+
var require_exception = __commonJS({
|
|
28442
|
+
"../../node_modules/js-yaml/lib/exception.js"(exports2, module2) {
|
|
28443
|
+
"use strict";
|
|
28444
|
+
function formatError2(exception, compact) {
|
|
28445
|
+
var where = "", message = exception.reason || "(unknown reason)";
|
|
28446
|
+
if (!exception.mark) return message;
|
|
28447
|
+
if (exception.mark.name) {
|
|
28448
|
+
where += 'in "' + exception.mark.name + '" ';
|
|
28449
|
+
}
|
|
28450
|
+
where += "(" + (exception.mark.line + 1) + ":" + (exception.mark.column + 1) + ")";
|
|
28451
|
+
if (!compact && exception.mark.snippet) {
|
|
28452
|
+
where += "\n\n" + exception.mark.snippet;
|
|
28453
|
+
}
|
|
28454
|
+
return message + " " + where;
|
|
28455
|
+
}
|
|
28456
|
+
function YAMLException(reason, mark) {
|
|
28457
|
+
Error.call(this);
|
|
28458
|
+
this.name = "YAMLException";
|
|
28459
|
+
this.reason = reason;
|
|
28460
|
+
this.mark = mark;
|
|
28461
|
+
this.message = formatError2(this, false);
|
|
28462
|
+
if (Error.captureStackTrace) {
|
|
28463
|
+
Error.captureStackTrace(this, this.constructor);
|
|
28464
|
+
} else {
|
|
28465
|
+
this.stack = new Error().stack || "";
|
|
28466
|
+
}
|
|
28467
|
+
}
|
|
28468
|
+
YAMLException.prototype = Object.create(Error.prototype);
|
|
28469
|
+
YAMLException.prototype.constructor = YAMLException;
|
|
28470
|
+
YAMLException.prototype.toString = function toString(compact) {
|
|
28471
|
+
return this.name + ": " + formatError2(this, compact);
|
|
28472
|
+
};
|
|
28473
|
+
module2.exports = YAMLException;
|
|
28474
|
+
}
|
|
28475
|
+
});
|
|
28476
|
+
|
|
28477
|
+
// ../../node_modules/js-yaml/lib/snippet.js
|
|
28478
|
+
var require_snippet = __commonJS({
|
|
28479
|
+
"../../node_modules/js-yaml/lib/snippet.js"(exports2, module2) {
|
|
28480
|
+
"use strict";
|
|
28481
|
+
var common = require_common();
|
|
28482
|
+
function getLine(buffer, lineStart, lineEnd, position, maxLineLength) {
|
|
28483
|
+
var head = "";
|
|
28484
|
+
var tail = "";
|
|
28485
|
+
var maxHalfLength = Math.floor(maxLineLength / 2) - 1;
|
|
28486
|
+
if (position - lineStart > maxHalfLength) {
|
|
28487
|
+
head = " ... ";
|
|
28488
|
+
lineStart = position - maxHalfLength + head.length;
|
|
28489
|
+
}
|
|
28490
|
+
if (lineEnd - position > maxHalfLength) {
|
|
28491
|
+
tail = " ...";
|
|
28492
|
+
lineEnd = position + maxHalfLength - tail.length;
|
|
28493
|
+
}
|
|
28494
|
+
return {
|
|
28495
|
+
str: head + buffer.slice(lineStart, lineEnd).replace(/\t/g, "\u2192") + tail,
|
|
28496
|
+
pos: position - lineStart + head.length
|
|
28497
|
+
// relative position
|
|
28498
|
+
};
|
|
28499
|
+
}
|
|
28500
|
+
function padStart(string4, max) {
|
|
28501
|
+
return common.repeat(" ", max - string4.length) + string4;
|
|
28502
|
+
}
|
|
28503
|
+
function makeSnippet(mark, options) {
|
|
28504
|
+
options = Object.create(options || null);
|
|
28505
|
+
if (!mark.buffer) return null;
|
|
28506
|
+
if (!options.maxLength) options.maxLength = 79;
|
|
28507
|
+
if (typeof options.indent !== "number") options.indent = 1;
|
|
28508
|
+
if (typeof options.linesBefore !== "number") options.linesBefore = 3;
|
|
28509
|
+
if (typeof options.linesAfter !== "number") options.linesAfter = 2;
|
|
28510
|
+
var re2 = /\r?\n|\r|\0/g;
|
|
28511
|
+
var lineStarts = [0];
|
|
28512
|
+
var lineEnds = [];
|
|
28513
|
+
var match;
|
|
28514
|
+
var foundLineNo = -1;
|
|
28515
|
+
while (match = re2.exec(mark.buffer)) {
|
|
28516
|
+
lineEnds.push(match.index);
|
|
28517
|
+
lineStarts.push(match.index + match[0].length);
|
|
28518
|
+
if (mark.position <= match.index && foundLineNo < 0) {
|
|
28519
|
+
foundLineNo = lineStarts.length - 2;
|
|
28520
|
+
}
|
|
28521
|
+
}
|
|
28522
|
+
if (foundLineNo < 0) foundLineNo = lineStarts.length - 1;
|
|
28523
|
+
var result = "", i, line;
|
|
28524
|
+
var lineNoLength = Math.min(mark.line + options.linesAfter, lineEnds.length).toString().length;
|
|
28525
|
+
var maxLineLength = options.maxLength - (options.indent + lineNoLength + 3);
|
|
28526
|
+
for (i = 1; i <= options.linesBefore; i++) {
|
|
28527
|
+
if (foundLineNo - i < 0) break;
|
|
28528
|
+
line = getLine(
|
|
28529
|
+
mark.buffer,
|
|
28530
|
+
lineStarts[foundLineNo - i],
|
|
28531
|
+
lineEnds[foundLineNo - i],
|
|
28532
|
+
mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo - i]),
|
|
28533
|
+
maxLineLength
|
|
28534
|
+
);
|
|
28535
|
+
result = common.repeat(" ", options.indent) + padStart((mark.line - i + 1).toString(), lineNoLength) + " | " + line.str + "\n" + result;
|
|
28536
|
+
}
|
|
28537
|
+
line = getLine(mark.buffer, lineStarts[foundLineNo], lineEnds[foundLineNo], mark.position, maxLineLength);
|
|
28538
|
+
result += common.repeat(" ", options.indent) + padStart((mark.line + 1).toString(), lineNoLength) + " | " + line.str + "\n";
|
|
28539
|
+
result += common.repeat("-", options.indent + lineNoLength + 3 + line.pos) + "^\n";
|
|
28540
|
+
for (i = 1; i <= options.linesAfter; i++) {
|
|
28541
|
+
if (foundLineNo + i >= lineEnds.length) break;
|
|
28542
|
+
line = getLine(
|
|
28543
|
+
mark.buffer,
|
|
28544
|
+
lineStarts[foundLineNo + i],
|
|
28545
|
+
lineEnds[foundLineNo + i],
|
|
28546
|
+
mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo + i]),
|
|
28547
|
+
maxLineLength
|
|
28548
|
+
);
|
|
28549
|
+
result += common.repeat(" ", options.indent) + padStart((mark.line + i + 1).toString(), lineNoLength) + " | " + line.str + "\n";
|
|
28550
|
+
}
|
|
28551
|
+
return result.replace(/\n$/, "");
|
|
28362
28552
|
}
|
|
28363
|
-
|
|
28553
|
+
module2.exports = makeSnippet;
|
|
28554
|
+
}
|
|
28555
|
+
});
|
|
28556
|
+
|
|
28557
|
+
// ../../node_modules/js-yaml/lib/type.js
|
|
28558
|
+
var require_type = __commonJS({
|
|
28559
|
+
"../../node_modules/js-yaml/lib/type.js"(exports2, module2) {
|
|
28560
|
+
"use strict";
|
|
28561
|
+
var YAMLException = require_exception();
|
|
28562
|
+
var TYPE_CONSTRUCTOR_OPTIONS = [
|
|
28563
|
+
"kind",
|
|
28564
|
+
"multi",
|
|
28565
|
+
"resolve",
|
|
28566
|
+
"construct",
|
|
28567
|
+
"instanceOf",
|
|
28568
|
+
"predicate",
|
|
28569
|
+
"represent",
|
|
28570
|
+
"representName",
|
|
28571
|
+
"defaultStyle",
|
|
28572
|
+
"styleAliases"
|
|
28573
|
+
];
|
|
28574
|
+
var YAML_NODE_KINDS = [
|
|
28575
|
+
"scalar",
|
|
28576
|
+
"sequence",
|
|
28577
|
+
"mapping"
|
|
28578
|
+
];
|
|
28579
|
+
function compileStyleAliases(map2) {
|
|
28580
|
+
var result = {};
|
|
28581
|
+
if (map2 !== null) {
|
|
28582
|
+
Object.keys(map2).forEach(function(style) {
|
|
28583
|
+
map2[style].forEach(function(alias) {
|
|
28584
|
+
result[String(alias)] = style;
|
|
28585
|
+
});
|
|
28586
|
+
});
|
|
28587
|
+
}
|
|
28588
|
+
return result;
|
|
28589
|
+
}
|
|
28590
|
+
function Type(tag, options) {
|
|
28591
|
+
options = options || {};
|
|
28592
|
+
Object.keys(options).forEach(function(name) {
|
|
28593
|
+
if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) {
|
|
28594
|
+
throw new YAMLException('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.');
|
|
28595
|
+
}
|
|
28596
|
+
});
|
|
28597
|
+
this.options = options;
|
|
28598
|
+
this.tag = tag;
|
|
28599
|
+
this.kind = options["kind"] || null;
|
|
28600
|
+
this.resolve = options["resolve"] || function() {
|
|
28601
|
+
return true;
|
|
28602
|
+
};
|
|
28603
|
+
this.construct = options["construct"] || function(data) {
|
|
28604
|
+
return data;
|
|
28605
|
+
};
|
|
28606
|
+
this.instanceOf = options["instanceOf"] || null;
|
|
28607
|
+
this.predicate = options["predicate"] || null;
|
|
28608
|
+
this.represent = options["represent"] || null;
|
|
28609
|
+
this.representName = options["representName"] || null;
|
|
28610
|
+
this.defaultStyle = options["defaultStyle"] || null;
|
|
28611
|
+
this.multi = options["multi"] || false;
|
|
28612
|
+
this.styleAliases = compileStyleAliases(options["styleAliases"] || null);
|
|
28613
|
+
if (YAML_NODE_KINDS.indexOf(this.kind) === -1) {
|
|
28614
|
+
throw new YAMLException('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.');
|
|
28615
|
+
}
|
|
28616
|
+
}
|
|
28617
|
+
module2.exports = Type;
|
|
28618
|
+
}
|
|
28619
|
+
});
|
|
28620
|
+
|
|
28621
|
+
// ../../node_modules/js-yaml/lib/schema.js
|
|
28622
|
+
var require_schema = __commonJS({
|
|
28623
|
+
"../../node_modules/js-yaml/lib/schema.js"(exports2, module2) {
|
|
28624
|
+
"use strict";
|
|
28625
|
+
var YAMLException = require_exception();
|
|
28626
|
+
var Type = require_type();
|
|
28627
|
+
function compileList(schema, name) {
|
|
28628
|
+
var result = [];
|
|
28629
|
+
schema[name].forEach(function(currentType) {
|
|
28630
|
+
var newIndex = result.length;
|
|
28631
|
+
result.forEach(function(previousType, previousIndex) {
|
|
28632
|
+
if (previousType.tag === currentType.tag && previousType.kind === currentType.kind && previousType.multi === currentType.multi) {
|
|
28633
|
+
newIndex = previousIndex;
|
|
28634
|
+
}
|
|
28635
|
+
});
|
|
28636
|
+
result[newIndex] = currentType;
|
|
28637
|
+
});
|
|
28638
|
+
return result;
|
|
28639
|
+
}
|
|
28640
|
+
function compileMap() {
|
|
28641
|
+
var result = {
|
|
28642
|
+
scalar: {},
|
|
28643
|
+
sequence: {},
|
|
28644
|
+
mapping: {},
|
|
28645
|
+
fallback: {},
|
|
28646
|
+
multi: {
|
|
28647
|
+
scalar: [],
|
|
28648
|
+
sequence: [],
|
|
28649
|
+
mapping: [],
|
|
28650
|
+
fallback: []
|
|
28651
|
+
}
|
|
28652
|
+
}, index, length;
|
|
28653
|
+
function collectType(type) {
|
|
28654
|
+
if (type.multi) {
|
|
28655
|
+
result.multi[type.kind].push(type);
|
|
28656
|
+
result.multi["fallback"].push(type);
|
|
28657
|
+
} else {
|
|
28658
|
+
result[type.kind][type.tag] = result["fallback"][type.tag] = type;
|
|
28659
|
+
}
|
|
28660
|
+
}
|
|
28661
|
+
for (index = 0, length = arguments.length; index < length; index += 1) {
|
|
28662
|
+
arguments[index].forEach(collectType);
|
|
28663
|
+
}
|
|
28664
|
+
return result;
|
|
28665
|
+
}
|
|
28666
|
+
function Schema(definition) {
|
|
28667
|
+
return this.extend(definition);
|
|
28668
|
+
}
|
|
28669
|
+
Schema.prototype.extend = function extend2(definition) {
|
|
28670
|
+
var implicit = [];
|
|
28671
|
+
var explicit = [];
|
|
28672
|
+
if (definition instanceof Type) {
|
|
28673
|
+
explicit.push(definition);
|
|
28674
|
+
} else if (Array.isArray(definition)) {
|
|
28675
|
+
explicit = explicit.concat(definition);
|
|
28676
|
+
} else if (definition && (Array.isArray(definition.implicit) || Array.isArray(definition.explicit))) {
|
|
28677
|
+
if (definition.implicit) implicit = implicit.concat(definition.implicit);
|
|
28678
|
+
if (definition.explicit) explicit = explicit.concat(definition.explicit);
|
|
28679
|
+
} else {
|
|
28680
|
+
throw new YAMLException("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");
|
|
28681
|
+
}
|
|
28682
|
+
implicit.forEach(function(type) {
|
|
28683
|
+
if (!(type instanceof Type)) {
|
|
28684
|
+
throw new YAMLException("Specified list of YAML types (or a single Type object) contains a non-Type object.");
|
|
28685
|
+
}
|
|
28686
|
+
if (type.loadKind && type.loadKind !== "scalar") {
|
|
28687
|
+
throw new YAMLException("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");
|
|
28688
|
+
}
|
|
28689
|
+
if (type.multi) {
|
|
28690
|
+
throw new YAMLException("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.");
|
|
28691
|
+
}
|
|
28692
|
+
});
|
|
28693
|
+
explicit.forEach(function(type) {
|
|
28694
|
+
if (!(type instanceof Type)) {
|
|
28695
|
+
throw new YAMLException("Specified list of YAML types (or a single Type object) contains a non-Type object.");
|
|
28696
|
+
}
|
|
28697
|
+
});
|
|
28698
|
+
var result = Object.create(Schema.prototype);
|
|
28699
|
+
result.implicit = (this.implicit || []).concat(implicit);
|
|
28700
|
+
result.explicit = (this.explicit || []).concat(explicit);
|
|
28701
|
+
result.compiledImplicit = compileList(result, "implicit");
|
|
28702
|
+
result.compiledExplicit = compileList(result, "explicit");
|
|
28703
|
+
result.compiledTypeMap = compileMap(result.compiledImplicit, result.compiledExplicit);
|
|
28704
|
+
return result;
|
|
28705
|
+
};
|
|
28706
|
+
module2.exports = Schema;
|
|
28707
|
+
}
|
|
28708
|
+
});
|
|
28709
|
+
|
|
28710
|
+
// ../../node_modules/js-yaml/lib/type/str.js
|
|
28711
|
+
var require_str = __commonJS({
|
|
28712
|
+
"../../node_modules/js-yaml/lib/type/str.js"(exports2, module2) {
|
|
28713
|
+
"use strict";
|
|
28714
|
+
var Type = require_type();
|
|
28715
|
+
module2.exports = new Type("tag:yaml.org,2002:str", {
|
|
28716
|
+
kind: "scalar",
|
|
28717
|
+
construct: function(data) {
|
|
28718
|
+
return data !== null ? data : "";
|
|
28719
|
+
}
|
|
28720
|
+
});
|
|
28721
|
+
}
|
|
28722
|
+
});
|
|
28723
|
+
|
|
28724
|
+
// ../../node_modules/js-yaml/lib/type/seq.js
|
|
28725
|
+
var require_seq = __commonJS({
|
|
28726
|
+
"../../node_modules/js-yaml/lib/type/seq.js"(exports2, module2) {
|
|
28727
|
+
"use strict";
|
|
28728
|
+
var Type = require_type();
|
|
28729
|
+
module2.exports = new Type("tag:yaml.org,2002:seq", {
|
|
28730
|
+
kind: "sequence",
|
|
28731
|
+
construct: function(data) {
|
|
28732
|
+
return data !== null ? data : [];
|
|
28733
|
+
}
|
|
28734
|
+
});
|
|
28735
|
+
}
|
|
28736
|
+
});
|
|
28737
|
+
|
|
28738
|
+
// ../../node_modules/js-yaml/lib/type/map.js
|
|
28739
|
+
var require_map = __commonJS({
|
|
28740
|
+
"../../node_modules/js-yaml/lib/type/map.js"(exports2, module2) {
|
|
28741
|
+
"use strict";
|
|
28742
|
+
var Type = require_type();
|
|
28743
|
+
module2.exports = new Type("tag:yaml.org,2002:map", {
|
|
28744
|
+
kind: "mapping",
|
|
28745
|
+
construct: function(data) {
|
|
28746
|
+
return data !== null ? data : {};
|
|
28747
|
+
}
|
|
28748
|
+
});
|
|
28749
|
+
}
|
|
28750
|
+
});
|
|
28751
|
+
|
|
28752
|
+
// ../../node_modules/js-yaml/lib/schema/failsafe.js
|
|
28753
|
+
var require_failsafe = __commonJS({
|
|
28754
|
+
"../../node_modules/js-yaml/lib/schema/failsafe.js"(exports2, module2) {
|
|
28755
|
+
"use strict";
|
|
28756
|
+
var Schema = require_schema();
|
|
28757
|
+
module2.exports = new Schema({
|
|
28758
|
+
explicit: [
|
|
28759
|
+
require_str(),
|
|
28760
|
+
require_seq(),
|
|
28761
|
+
require_map()
|
|
28762
|
+
]
|
|
28763
|
+
});
|
|
28764
|
+
}
|
|
28765
|
+
});
|
|
28766
|
+
|
|
28767
|
+
// ../../node_modules/js-yaml/lib/type/null.js
|
|
28768
|
+
var require_null = __commonJS({
|
|
28769
|
+
"../../node_modules/js-yaml/lib/type/null.js"(exports2, module2) {
|
|
28770
|
+
"use strict";
|
|
28771
|
+
var Type = require_type();
|
|
28772
|
+
function resolveYamlNull(data) {
|
|
28773
|
+
if (data === null) return true;
|
|
28774
|
+
var max = data.length;
|
|
28775
|
+
return max === 1 && data === "~" || max === 4 && (data === "null" || data === "Null" || data === "NULL");
|
|
28776
|
+
}
|
|
28777
|
+
function constructYamlNull() {
|
|
28778
|
+
return null;
|
|
28779
|
+
}
|
|
28780
|
+
function isNull(object2) {
|
|
28781
|
+
return object2 === null;
|
|
28782
|
+
}
|
|
28783
|
+
module2.exports = new Type("tag:yaml.org,2002:null", {
|
|
28784
|
+
kind: "scalar",
|
|
28785
|
+
resolve: resolveYamlNull,
|
|
28786
|
+
construct: constructYamlNull,
|
|
28787
|
+
predicate: isNull,
|
|
28788
|
+
represent: {
|
|
28789
|
+
canonical: function() {
|
|
28790
|
+
return "~";
|
|
28791
|
+
},
|
|
28792
|
+
lowercase: function() {
|
|
28793
|
+
return "null";
|
|
28794
|
+
},
|
|
28795
|
+
uppercase: function() {
|
|
28796
|
+
return "NULL";
|
|
28797
|
+
},
|
|
28798
|
+
camelcase: function() {
|
|
28799
|
+
return "Null";
|
|
28800
|
+
},
|
|
28801
|
+
empty: function() {
|
|
28802
|
+
return "";
|
|
28803
|
+
}
|
|
28804
|
+
},
|
|
28805
|
+
defaultStyle: "lowercase"
|
|
28806
|
+
});
|
|
28807
|
+
}
|
|
28808
|
+
});
|
|
28809
|
+
|
|
28810
|
+
// ../../node_modules/js-yaml/lib/type/bool.js
|
|
28811
|
+
var require_bool = __commonJS({
|
|
28812
|
+
"../../node_modules/js-yaml/lib/type/bool.js"(exports2, module2) {
|
|
28813
|
+
"use strict";
|
|
28814
|
+
var Type = require_type();
|
|
28815
|
+
function resolveYamlBoolean(data) {
|
|
28816
|
+
if (data === null) return false;
|
|
28817
|
+
var max = data.length;
|
|
28818
|
+
return max === 4 && (data === "true" || data === "True" || data === "TRUE") || max === 5 && (data === "false" || data === "False" || data === "FALSE");
|
|
28819
|
+
}
|
|
28820
|
+
function constructYamlBoolean(data) {
|
|
28821
|
+
return data === "true" || data === "True" || data === "TRUE";
|
|
28822
|
+
}
|
|
28823
|
+
function isBoolean(object2) {
|
|
28824
|
+
return Object.prototype.toString.call(object2) === "[object Boolean]";
|
|
28825
|
+
}
|
|
28826
|
+
module2.exports = new Type("tag:yaml.org,2002:bool", {
|
|
28827
|
+
kind: "scalar",
|
|
28828
|
+
resolve: resolveYamlBoolean,
|
|
28829
|
+
construct: constructYamlBoolean,
|
|
28830
|
+
predicate: isBoolean,
|
|
28831
|
+
represent: {
|
|
28832
|
+
lowercase: function(object2) {
|
|
28833
|
+
return object2 ? "true" : "false";
|
|
28834
|
+
},
|
|
28835
|
+
uppercase: function(object2) {
|
|
28836
|
+
return object2 ? "TRUE" : "FALSE";
|
|
28837
|
+
},
|
|
28838
|
+
camelcase: function(object2) {
|
|
28839
|
+
return object2 ? "True" : "False";
|
|
28840
|
+
}
|
|
28841
|
+
},
|
|
28842
|
+
defaultStyle: "lowercase"
|
|
28843
|
+
});
|
|
28844
|
+
}
|
|
28845
|
+
});
|
|
28846
|
+
|
|
28847
|
+
// ../../node_modules/js-yaml/lib/type/int.js
|
|
28848
|
+
var require_int = __commonJS({
|
|
28849
|
+
"../../node_modules/js-yaml/lib/type/int.js"(exports2, module2) {
|
|
28850
|
+
"use strict";
|
|
28851
|
+
var common = require_common();
|
|
28852
|
+
var Type = require_type();
|
|
28853
|
+
function isHexCode(c) {
|
|
28854
|
+
return 48 <= c && c <= 57 || 65 <= c && c <= 70 || 97 <= c && c <= 102;
|
|
28855
|
+
}
|
|
28856
|
+
function isOctCode(c) {
|
|
28857
|
+
return 48 <= c && c <= 55;
|
|
28858
|
+
}
|
|
28859
|
+
function isDecCode(c) {
|
|
28860
|
+
return 48 <= c && c <= 57;
|
|
28861
|
+
}
|
|
28862
|
+
function resolveYamlInteger(data) {
|
|
28863
|
+
if (data === null) return false;
|
|
28864
|
+
var max = data.length, index = 0, hasDigits = false, ch;
|
|
28865
|
+
if (!max) return false;
|
|
28866
|
+
ch = data[index];
|
|
28867
|
+
if (ch === "-" || ch === "+") {
|
|
28868
|
+
ch = data[++index];
|
|
28869
|
+
}
|
|
28870
|
+
if (ch === "0") {
|
|
28871
|
+
if (index + 1 === max) return true;
|
|
28872
|
+
ch = data[++index];
|
|
28873
|
+
if (ch === "b") {
|
|
28874
|
+
index++;
|
|
28875
|
+
for (; index < max; index++) {
|
|
28876
|
+
ch = data[index];
|
|
28877
|
+
if (ch === "_") continue;
|
|
28878
|
+
if (ch !== "0" && ch !== "1") return false;
|
|
28879
|
+
hasDigits = true;
|
|
28880
|
+
}
|
|
28881
|
+
return hasDigits && ch !== "_";
|
|
28882
|
+
}
|
|
28883
|
+
if (ch === "x") {
|
|
28884
|
+
index++;
|
|
28885
|
+
for (; index < max; index++) {
|
|
28886
|
+
ch = data[index];
|
|
28887
|
+
if (ch === "_") continue;
|
|
28888
|
+
if (!isHexCode(data.charCodeAt(index))) return false;
|
|
28889
|
+
hasDigits = true;
|
|
28890
|
+
}
|
|
28891
|
+
return hasDigits && ch !== "_";
|
|
28892
|
+
}
|
|
28893
|
+
if (ch === "o") {
|
|
28894
|
+
index++;
|
|
28895
|
+
for (; index < max; index++) {
|
|
28896
|
+
ch = data[index];
|
|
28897
|
+
if (ch === "_") continue;
|
|
28898
|
+
if (!isOctCode(data.charCodeAt(index))) return false;
|
|
28899
|
+
hasDigits = true;
|
|
28900
|
+
}
|
|
28901
|
+
return hasDigits && ch !== "_";
|
|
28902
|
+
}
|
|
28903
|
+
}
|
|
28904
|
+
if (ch === "_") return false;
|
|
28905
|
+
for (; index < max; index++) {
|
|
28906
|
+
ch = data[index];
|
|
28907
|
+
if (ch === "_") continue;
|
|
28908
|
+
if (!isDecCode(data.charCodeAt(index))) {
|
|
28909
|
+
return false;
|
|
28910
|
+
}
|
|
28911
|
+
hasDigits = true;
|
|
28912
|
+
}
|
|
28913
|
+
if (!hasDigits || ch === "_") return false;
|
|
28914
|
+
return true;
|
|
28915
|
+
}
|
|
28916
|
+
function constructYamlInteger(data) {
|
|
28917
|
+
var value = data, sign = 1, ch;
|
|
28918
|
+
if (value.indexOf("_") !== -1) {
|
|
28919
|
+
value = value.replace(/_/g, "");
|
|
28920
|
+
}
|
|
28921
|
+
ch = value[0];
|
|
28922
|
+
if (ch === "-" || ch === "+") {
|
|
28923
|
+
if (ch === "-") sign = -1;
|
|
28924
|
+
value = value.slice(1);
|
|
28925
|
+
ch = value[0];
|
|
28926
|
+
}
|
|
28927
|
+
if (value === "0") return 0;
|
|
28928
|
+
if (ch === "0") {
|
|
28929
|
+
if (value[1] === "b") return sign * parseInt(value.slice(2), 2);
|
|
28930
|
+
if (value[1] === "x") return sign * parseInt(value.slice(2), 16);
|
|
28931
|
+
if (value[1] === "o") return sign * parseInt(value.slice(2), 8);
|
|
28932
|
+
}
|
|
28933
|
+
return sign * parseInt(value, 10);
|
|
28934
|
+
}
|
|
28935
|
+
function isInteger(object2) {
|
|
28936
|
+
return Object.prototype.toString.call(object2) === "[object Number]" && (object2 % 1 === 0 && !common.isNegativeZero(object2));
|
|
28937
|
+
}
|
|
28938
|
+
module2.exports = new Type("tag:yaml.org,2002:int", {
|
|
28939
|
+
kind: "scalar",
|
|
28940
|
+
resolve: resolveYamlInteger,
|
|
28941
|
+
construct: constructYamlInteger,
|
|
28942
|
+
predicate: isInteger,
|
|
28943
|
+
represent: {
|
|
28944
|
+
binary: function(obj) {
|
|
28945
|
+
return obj >= 0 ? "0b" + obj.toString(2) : "-0b" + obj.toString(2).slice(1);
|
|
28946
|
+
},
|
|
28947
|
+
octal: function(obj) {
|
|
28948
|
+
return obj >= 0 ? "0o" + obj.toString(8) : "-0o" + obj.toString(8).slice(1);
|
|
28949
|
+
},
|
|
28950
|
+
decimal: function(obj) {
|
|
28951
|
+
return obj.toString(10);
|
|
28952
|
+
},
|
|
28953
|
+
/* eslint-disable max-len */
|
|
28954
|
+
hexadecimal: function(obj) {
|
|
28955
|
+
return obj >= 0 ? "0x" + obj.toString(16).toUpperCase() : "-0x" + obj.toString(16).toUpperCase().slice(1);
|
|
28956
|
+
}
|
|
28957
|
+
},
|
|
28958
|
+
defaultStyle: "decimal",
|
|
28959
|
+
styleAliases: {
|
|
28960
|
+
binary: [2, "bin"],
|
|
28961
|
+
octal: [8, "oct"],
|
|
28962
|
+
decimal: [10, "dec"],
|
|
28963
|
+
hexadecimal: [16, "hex"]
|
|
28964
|
+
}
|
|
28965
|
+
});
|
|
28966
|
+
}
|
|
28967
|
+
});
|
|
28968
|
+
|
|
28969
|
+
// ../../node_modules/js-yaml/lib/type/float.js
|
|
28970
|
+
var require_float = __commonJS({
|
|
28971
|
+
"../../node_modules/js-yaml/lib/type/float.js"(exports2, module2) {
|
|
28972
|
+
"use strict";
|
|
28973
|
+
var common = require_common();
|
|
28974
|
+
var Type = require_type();
|
|
28975
|
+
var YAML_FLOAT_PATTERN = new RegExp(
|
|
28976
|
+
// 2.5e4, 2.5 and integers
|
|
28977
|
+
"^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"
|
|
28978
|
+
);
|
|
28979
|
+
function resolveYamlFloat(data) {
|
|
28980
|
+
if (data === null) return false;
|
|
28981
|
+
if (!YAML_FLOAT_PATTERN.test(data) || // Quick hack to not allow integers end with `_`
|
|
28982
|
+
// Probably should update regexp & check speed
|
|
28983
|
+
data[data.length - 1] === "_") {
|
|
28984
|
+
return false;
|
|
28985
|
+
}
|
|
28986
|
+
return true;
|
|
28987
|
+
}
|
|
28988
|
+
function constructYamlFloat(data) {
|
|
28989
|
+
var value, sign;
|
|
28990
|
+
value = data.replace(/_/g, "").toLowerCase();
|
|
28991
|
+
sign = value[0] === "-" ? -1 : 1;
|
|
28992
|
+
if ("+-".indexOf(value[0]) >= 0) {
|
|
28993
|
+
value = value.slice(1);
|
|
28994
|
+
}
|
|
28995
|
+
if (value === ".inf") {
|
|
28996
|
+
return sign === 1 ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY;
|
|
28997
|
+
} else if (value === ".nan") {
|
|
28998
|
+
return NaN;
|
|
28999
|
+
}
|
|
29000
|
+
return sign * parseFloat(value, 10);
|
|
29001
|
+
}
|
|
29002
|
+
var SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/;
|
|
29003
|
+
function representYamlFloat(object2, style) {
|
|
29004
|
+
var res;
|
|
29005
|
+
if (isNaN(object2)) {
|
|
29006
|
+
switch (style) {
|
|
29007
|
+
case "lowercase":
|
|
29008
|
+
return ".nan";
|
|
29009
|
+
case "uppercase":
|
|
29010
|
+
return ".NAN";
|
|
29011
|
+
case "camelcase":
|
|
29012
|
+
return ".NaN";
|
|
29013
|
+
}
|
|
29014
|
+
} else if (Number.POSITIVE_INFINITY === object2) {
|
|
29015
|
+
switch (style) {
|
|
29016
|
+
case "lowercase":
|
|
29017
|
+
return ".inf";
|
|
29018
|
+
case "uppercase":
|
|
29019
|
+
return ".INF";
|
|
29020
|
+
case "camelcase":
|
|
29021
|
+
return ".Inf";
|
|
29022
|
+
}
|
|
29023
|
+
} else if (Number.NEGATIVE_INFINITY === object2) {
|
|
29024
|
+
switch (style) {
|
|
29025
|
+
case "lowercase":
|
|
29026
|
+
return "-.inf";
|
|
29027
|
+
case "uppercase":
|
|
29028
|
+
return "-.INF";
|
|
29029
|
+
case "camelcase":
|
|
29030
|
+
return "-.Inf";
|
|
29031
|
+
}
|
|
29032
|
+
} else if (common.isNegativeZero(object2)) {
|
|
29033
|
+
return "-0.0";
|
|
29034
|
+
}
|
|
29035
|
+
res = object2.toString(10);
|
|
29036
|
+
return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace("e", ".e") : res;
|
|
29037
|
+
}
|
|
29038
|
+
function isFloat(object2) {
|
|
29039
|
+
return Object.prototype.toString.call(object2) === "[object Number]" && (object2 % 1 !== 0 || common.isNegativeZero(object2));
|
|
29040
|
+
}
|
|
29041
|
+
module2.exports = new Type("tag:yaml.org,2002:float", {
|
|
29042
|
+
kind: "scalar",
|
|
29043
|
+
resolve: resolveYamlFloat,
|
|
29044
|
+
construct: constructYamlFloat,
|
|
29045
|
+
predicate: isFloat,
|
|
29046
|
+
represent: representYamlFloat,
|
|
29047
|
+
defaultStyle: "lowercase"
|
|
29048
|
+
});
|
|
29049
|
+
}
|
|
29050
|
+
});
|
|
29051
|
+
|
|
29052
|
+
// ../../node_modules/js-yaml/lib/schema/json.js
|
|
29053
|
+
var require_json = __commonJS({
|
|
29054
|
+
"../../node_modules/js-yaml/lib/schema/json.js"(exports2, module2) {
|
|
29055
|
+
"use strict";
|
|
29056
|
+
module2.exports = require_failsafe().extend({
|
|
29057
|
+
implicit: [
|
|
29058
|
+
require_null(),
|
|
29059
|
+
require_bool(),
|
|
29060
|
+
require_int(),
|
|
29061
|
+
require_float()
|
|
29062
|
+
]
|
|
29063
|
+
});
|
|
29064
|
+
}
|
|
29065
|
+
});
|
|
29066
|
+
|
|
29067
|
+
// ../../node_modules/js-yaml/lib/schema/core.js
|
|
29068
|
+
var require_core = __commonJS({
|
|
29069
|
+
"../../node_modules/js-yaml/lib/schema/core.js"(exports2, module2) {
|
|
29070
|
+
"use strict";
|
|
29071
|
+
module2.exports = require_json();
|
|
29072
|
+
}
|
|
29073
|
+
});
|
|
29074
|
+
|
|
29075
|
+
// ../../node_modules/js-yaml/lib/type/timestamp.js
|
|
29076
|
+
var require_timestamp = __commonJS({
|
|
29077
|
+
"../../node_modules/js-yaml/lib/type/timestamp.js"(exports2, module2) {
|
|
29078
|
+
"use strict";
|
|
29079
|
+
var Type = require_type();
|
|
29080
|
+
var YAML_DATE_REGEXP = new RegExp(
|
|
29081
|
+
"^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"
|
|
29082
|
+
);
|
|
29083
|
+
var YAML_TIMESTAMP_REGEXP = new RegExp(
|
|
29084
|
+
"^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$"
|
|
29085
|
+
);
|
|
29086
|
+
function resolveYamlTimestamp(data) {
|
|
29087
|
+
if (data === null) return false;
|
|
29088
|
+
if (YAML_DATE_REGEXP.exec(data) !== null) return true;
|
|
29089
|
+
if (YAML_TIMESTAMP_REGEXP.exec(data) !== null) return true;
|
|
29090
|
+
return false;
|
|
29091
|
+
}
|
|
29092
|
+
function constructYamlTimestamp(data) {
|
|
29093
|
+
var match, year, month, day, hour, minute, second, fraction = 0, delta = null, tz_hour, tz_minute, date5;
|
|
29094
|
+
match = YAML_DATE_REGEXP.exec(data);
|
|
29095
|
+
if (match === null) match = YAML_TIMESTAMP_REGEXP.exec(data);
|
|
29096
|
+
if (match === null) throw new Error("Date resolve error");
|
|
29097
|
+
year = +match[1];
|
|
29098
|
+
month = +match[2] - 1;
|
|
29099
|
+
day = +match[3];
|
|
29100
|
+
if (!match[4]) {
|
|
29101
|
+
return new Date(Date.UTC(year, month, day));
|
|
29102
|
+
}
|
|
29103
|
+
hour = +match[4];
|
|
29104
|
+
minute = +match[5];
|
|
29105
|
+
second = +match[6];
|
|
29106
|
+
if (match[7]) {
|
|
29107
|
+
fraction = match[7].slice(0, 3);
|
|
29108
|
+
while (fraction.length < 3) {
|
|
29109
|
+
fraction += "0";
|
|
29110
|
+
}
|
|
29111
|
+
fraction = +fraction;
|
|
29112
|
+
}
|
|
29113
|
+
if (match[9]) {
|
|
29114
|
+
tz_hour = +match[10];
|
|
29115
|
+
tz_minute = +(match[11] || 0);
|
|
29116
|
+
delta = (tz_hour * 60 + tz_minute) * 6e4;
|
|
29117
|
+
if (match[9] === "-") delta = -delta;
|
|
29118
|
+
}
|
|
29119
|
+
date5 = new Date(Date.UTC(year, month, day, hour, minute, second, fraction));
|
|
29120
|
+
if (delta) date5.setTime(date5.getTime() - delta);
|
|
29121
|
+
return date5;
|
|
29122
|
+
}
|
|
29123
|
+
function representYamlTimestamp(object2) {
|
|
29124
|
+
return object2.toISOString();
|
|
29125
|
+
}
|
|
29126
|
+
module2.exports = new Type("tag:yaml.org,2002:timestamp", {
|
|
29127
|
+
kind: "scalar",
|
|
29128
|
+
resolve: resolveYamlTimestamp,
|
|
29129
|
+
construct: constructYamlTimestamp,
|
|
29130
|
+
instanceOf: Date,
|
|
29131
|
+
represent: representYamlTimestamp
|
|
29132
|
+
});
|
|
29133
|
+
}
|
|
29134
|
+
});
|
|
29135
|
+
|
|
29136
|
+
// ../../node_modules/js-yaml/lib/type/merge.js
|
|
29137
|
+
var require_merge = __commonJS({
|
|
29138
|
+
"../../node_modules/js-yaml/lib/type/merge.js"(exports2, module2) {
|
|
29139
|
+
"use strict";
|
|
29140
|
+
var Type = require_type();
|
|
29141
|
+
function resolveYamlMerge(data) {
|
|
29142
|
+
return data === "<<" || data === null;
|
|
29143
|
+
}
|
|
29144
|
+
module2.exports = new Type("tag:yaml.org,2002:merge", {
|
|
29145
|
+
kind: "scalar",
|
|
29146
|
+
resolve: resolveYamlMerge
|
|
29147
|
+
});
|
|
29148
|
+
}
|
|
29149
|
+
});
|
|
29150
|
+
|
|
29151
|
+
// ../../node_modules/js-yaml/lib/type/binary.js
|
|
29152
|
+
var require_binary = __commonJS({
|
|
29153
|
+
"../../node_modules/js-yaml/lib/type/binary.js"(exports2, module2) {
|
|
29154
|
+
"use strict";
|
|
29155
|
+
var Type = require_type();
|
|
29156
|
+
var BASE64_MAP = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";
|
|
29157
|
+
function resolveYamlBinary(data) {
|
|
29158
|
+
if (data === null) return false;
|
|
29159
|
+
var code, idx, bitlen = 0, max = data.length, map2 = BASE64_MAP;
|
|
29160
|
+
for (idx = 0; idx < max; idx++) {
|
|
29161
|
+
code = map2.indexOf(data.charAt(idx));
|
|
29162
|
+
if (code > 64) continue;
|
|
29163
|
+
if (code < 0) return false;
|
|
29164
|
+
bitlen += 6;
|
|
29165
|
+
}
|
|
29166
|
+
return bitlen % 8 === 0;
|
|
29167
|
+
}
|
|
29168
|
+
function constructYamlBinary(data) {
|
|
29169
|
+
var idx, tailbits, input = data.replace(/[\r\n=]/g, ""), max = input.length, map2 = BASE64_MAP, bits = 0, result = [];
|
|
29170
|
+
for (idx = 0; idx < max; idx++) {
|
|
29171
|
+
if (idx % 4 === 0 && idx) {
|
|
29172
|
+
result.push(bits >> 16 & 255);
|
|
29173
|
+
result.push(bits >> 8 & 255);
|
|
29174
|
+
result.push(bits & 255);
|
|
29175
|
+
}
|
|
29176
|
+
bits = bits << 6 | map2.indexOf(input.charAt(idx));
|
|
29177
|
+
}
|
|
29178
|
+
tailbits = max % 4 * 6;
|
|
29179
|
+
if (tailbits === 0) {
|
|
29180
|
+
result.push(bits >> 16 & 255);
|
|
29181
|
+
result.push(bits >> 8 & 255);
|
|
29182
|
+
result.push(bits & 255);
|
|
29183
|
+
} else if (tailbits === 18) {
|
|
29184
|
+
result.push(bits >> 10 & 255);
|
|
29185
|
+
result.push(bits >> 2 & 255);
|
|
29186
|
+
} else if (tailbits === 12) {
|
|
29187
|
+
result.push(bits >> 4 & 255);
|
|
29188
|
+
}
|
|
29189
|
+
return new Uint8Array(result);
|
|
29190
|
+
}
|
|
29191
|
+
function representYamlBinary(object2) {
|
|
29192
|
+
var result = "", bits = 0, idx, tail, max = object2.length, map2 = BASE64_MAP;
|
|
29193
|
+
for (idx = 0; idx < max; idx++) {
|
|
29194
|
+
if (idx % 3 === 0 && idx) {
|
|
29195
|
+
result += map2[bits >> 18 & 63];
|
|
29196
|
+
result += map2[bits >> 12 & 63];
|
|
29197
|
+
result += map2[bits >> 6 & 63];
|
|
29198
|
+
result += map2[bits & 63];
|
|
29199
|
+
}
|
|
29200
|
+
bits = (bits << 8) + object2[idx];
|
|
29201
|
+
}
|
|
29202
|
+
tail = max % 3;
|
|
29203
|
+
if (tail === 0) {
|
|
29204
|
+
result += map2[bits >> 18 & 63];
|
|
29205
|
+
result += map2[bits >> 12 & 63];
|
|
29206
|
+
result += map2[bits >> 6 & 63];
|
|
29207
|
+
result += map2[bits & 63];
|
|
29208
|
+
} else if (tail === 2) {
|
|
29209
|
+
result += map2[bits >> 10 & 63];
|
|
29210
|
+
result += map2[bits >> 4 & 63];
|
|
29211
|
+
result += map2[bits << 2 & 63];
|
|
29212
|
+
result += map2[64];
|
|
29213
|
+
} else if (tail === 1) {
|
|
29214
|
+
result += map2[bits >> 2 & 63];
|
|
29215
|
+
result += map2[bits << 4 & 63];
|
|
29216
|
+
result += map2[64];
|
|
29217
|
+
result += map2[64];
|
|
29218
|
+
}
|
|
29219
|
+
return result;
|
|
29220
|
+
}
|
|
29221
|
+
function isBinary(obj) {
|
|
29222
|
+
return Object.prototype.toString.call(obj) === "[object Uint8Array]";
|
|
29223
|
+
}
|
|
29224
|
+
module2.exports = new Type("tag:yaml.org,2002:binary", {
|
|
29225
|
+
kind: "scalar",
|
|
29226
|
+
resolve: resolveYamlBinary,
|
|
29227
|
+
construct: constructYamlBinary,
|
|
29228
|
+
predicate: isBinary,
|
|
29229
|
+
represent: representYamlBinary
|
|
29230
|
+
});
|
|
29231
|
+
}
|
|
29232
|
+
});
|
|
29233
|
+
|
|
29234
|
+
// ../../node_modules/js-yaml/lib/type/omap.js
|
|
29235
|
+
var require_omap = __commonJS({
|
|
29236
|
+
"../../node_modules/js-yaml/lib/type/omap.js"(exports2, module2) {
|
|
29237
|
+
"use strict";
|
|
29238
|
+
var Type = require_type();
|
|
29239
|
+
var _hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
29240
|
+
var _toString = Object.prototype.toString;
|
|
29241
|
+
function resolveYamlOmap(data) {
|
|
29242
|
+
if (data === null) return true;
|
|
29243
|
+
var objectKeys = [], index, length, pair, pairKey, pairHasKey, object2 = data;
|
|
29244
|
+
for (index = 0, length = object2.length; index < length; index += 1) {
|
|
29245
|
+
pair = object2[index];
|
|
29246
|
+
pairHasKey = false;
|
|
29247
|
+
if (_toString.call(pair) !== "[object Object]") return false;
|
|
29248
|
+
for (pairKey in pair) {
|
|
29249
|
+
if (_hasOwnProperty.call(pair, pairKey)) {
|
|
29250
|
+
if (!pairHasKey) pairHasKey = true;
|
|
29251
|
+
else return false;
|
|
29252
|
+
}
|
|
29253
|
+
}
|
|
29254
|
+
if (!pairHasKey) return false;
|
|
29255
|
+
if (objectKeys.indexOf(pairKey) === -1) objectKeys.push(pairKey);
|
|
29256
|
+
else return false;
|
|
29257
|
+
}
|
|
29258
|
+
return true;
|
|
29259
|
+
}
|
|
29260
|
+
function constructYamlOmap(data) {
|
|
29261
|
+
return data !== null ? data : [];
|
|
29262
|
+
}
|
|
29263
|
+
module2.exports = new Type("tag:yaml.org,2002:omap", {
|
|
29264
|
+
kind: "sequence",
|
|
29265
|
+
resolve: resolveYamlOmap,
|
|
29266
|
+
construct: constructYamlOmap
|
|
29267
|
+
});
|
|
29268
|
+
}
|
|
29269
|
+
});
|
|
29270
|
+
|
|
29271
|
+
// ../../node_modules/js-yaml/lib/type/pairs.js
|
|
29272
|
+
var require_pairs = __commonJS({
|
|
29273
|
+
"../../node_modules/js-yaml/lib/type/pairs.js"(exports2, module2) {
|
|
29274
|
+
"use strict";
|
|
29275
|
+
var Type = require_type();
|
|
29276
|
+
var _toString = Object.prototype.toString;
|
|
29277
|
+
function resolveYamlPairs(data) {
|
|
29278
|
+
if (data === null) return true;
|
|
29279
|
+
var index, length, pair, keys, result, object2 = data;
|
|
29280
|
+
result = new Array(object2.length);
|
|
29281
|
+
for (index = 0, length = object2.length; index < length; index += 1) {
|
|
29282
|
+
pair = object2[index];
|
|
29283
|
+
if (_toString.call(pair) !== "[object Object]") return false;
|
|
29284
|
+
keys = Object.keys(pair);
|
|
29285
|
+
if (keys.length !== 1) return false;
|
|
29286
|
+
result[index] = [keys[0], pair[keys[0]]];
|
|
29287
|
+
}
|
|
29288
|
+
return true;
|
|
29289
|
+
}
|
|
29290
|
+
function constructYamlPairs(data) {
|
|
29291
|
+
if (data === null) return [];
|
|
29292
|
+
var index, length, pair, keys, result, object2 = data;
|
|
29293
|
+
result = new Array(object2.length);
|
|
29294
|
+
for (index = 0, length = object2.length; index < length; index += 1) {
|
|
29295
|
+
pair = object2[index];
|
|
29296
|
+
keys = Object.keys(pair);
|
|
29297
|
+
result[index] = [keys[0], pair[keys[0]]];
|
|
29298
|
+
}
|
|
29299
|
+
return result;
|
|
29300
|
+
}
|
|
29301
|
+
module2.exports = new Type("tag:yaml.org,2002:pairs", {
|
|
29302
|
+
kind: "sequence",
|
|
29303
|
+
resolve: resolveYamlPairs,
|
|
29304
|
+
construct: constructYamlPairs
|
|
29305
|
+
});
|
|
29306
|
+
}
|
|
29307
|
+
});
|
|
29308
|
+
|
|
29309
|
+
// ../../node_modules/js-yaml/lib/type/set.js
|
|
29310
|
+
var require_set = __commonJS({
|
|
29311
|
+
"../../node_modules/js-yaml/lib/type/set.js"(exports2, module2) {
|
|
29312
|
+
"use strict";
|
|
29313
|
+
var Type = require_type();
|
|
29314
|
+
var _hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
29315
|
+
function resolveYamlSet(data) {
|
|
29316
|
+
if (data === null) return true;
|
|
29317
|
+
var key, object2 = data;
|
|
29318
|
+
for (key in object2) {
|
|
29319
|
+
if (_hasOwnProperty.call(object2, key)) {
|
|
29320
|
+
if (object2[key] !== null) return false;
|
|
29321
|
+
}
|
|
29322
|
+
}
|
|
29323
|
+
return true;
|
|
29324
|
+
}
|
|
29325
|
+
function constructYamlSet(data) {
|
|
29326
|
+
return data !== null ? data : {};
|
|
29327
|
+
}
|
|
29328
|
+
module2.exports = new Type("tag:yaml.org,2002:set", {
|
|
29329
|
+
kind: "mapping",
|
|
29330
|
+
resolve: resolveYamlSet,
|
|
29331
|
+
construct: constructYamlSet
|
|
29332
|
+
});
|
|
29333
|
+
}
|
|
29334
|
+
});
|
|
29335
|
+
|
|
29336
|
+
// ../../node_modules/js-yaml/lib/schema/default.js
|
|
29337
|
+
var require_default = __commonJS({
|
|
29338
|
+
"../../node_modules/js-yaml/lib/schema/default.js"(exports2, module2) {
|
|
29339
|
+
"use strict";
|
|
29340
|
+
module2.exports = require_core().extend({
|
|
29341
|
+
implicit: [
|
|
29342
|
+
require_timestamp(),
|
|
29343
|
+
require_merge()
|
|
29344
|
+
],
|
|
29345
|
+
explicit: [
|
|
29346
|
+
require_binary(),
|
|
29347
|
+
require_omap(),
|
|
29348
|
+
require_pairs(),
|
|
29349
|
+
require_set()
|
|
29350
|
+
]
|
|
29351
|
+
});
|
|
29352
|
+
}
|
|
29353
|
+
});
|
|
29354
|
+
|
|
29355
|
+
// ../../node_modules/js-yaml/lib/loader.js
|
|
29356
|
+
var require_loader = __commonJS({
|
|
29357
|
+
"../../node_modules/js-yaml/lib/loader.js"(exports2, module2) {
|
|
29358
|
+
"use strict";
|
|
29359
|
+
var common = require_common();
|
|
29360
|
+
var YAMLException = require_exception();
|
|
29361
|
+
var makeSnippet = require_snippet();
|
|
29362
|
+
var DEFAULT_SCHEMA = require_default();
|
|
29363
|
+
var _hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
29364
|
+
var CONTEXT_FLOW_IN = 1;
|
|
29365
|
+
var CONTEXT_FLOW_OUT = 2;
|
|
29366
|
+
var CONTEXT_BLOCK_IN = 3;
|
|
29367
|
+
var CONTEXT_BLOCK_OUT = 4;
|
|
29368
|
+
var CHOMPING_CLIP = 1;
|
|
29369
|
+
var CHOMPING_STRIP = 2;
|
|
29370
|
+
var CHOMPING_KEEP = 3;
|
|
29371
|
+
var PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;
|
|
29372
|
+
var PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/;
|
|
29373
|
+
var PATTERN_FLOW_INDICATORS = /[,\[\]\{\}]/;
|
|
29374
|
+
var PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\-]+!)$/i;
|
|
29375
|
+
var PATTERN_TAG_URI = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;
|
|
29376
|
+
function _class(obj) {
|
|
29377
|
+
return Object.prototype.toString.call(obj);
|
|
29378
|
+
}
|
|
29379
|
+
function is_EOL(c) {
|
|
29380
|
+
return c === 10 || c === 13;
|
|
29381
|
+
}
|
|
29382
|
+
function is_WHITE_SPACE(c) {
|
|
29383
|
+
return c === 9 || c === 32;
|
|
29384
|
+
}
|
|
29385
|
+
function is_WS_OR_EOL(c) {
|
|
29386
|
+
return c === 9 || c === 32 || c === 10 || c === 13;
|
|
29387
|
+
}
|
|
29388
|
+
function is_FLOW_INDICATOR(c) {
|
|
29389
|
+
return c === 44 || c === 91 || c === 93 || c === 123 || c === 125;
|
|
29390
|
+
}
|
|
29391
|
+
function fromHexCode(c) {
|
|
29392
|
+
var lc;
|
|
29393
|
+
if (48 <= c && c <= 57) {
|
|
29394
|
+
return c - 48;
|
|
29395
|
+
}
|
|
29396
|
+
lc = c | 32;
|
|
29397
|
+
if (97 <= lc && lc <= 102) {
|
|
29398
|
+
return lc - 97 + 10;
|
|
29399
|
+
}
|
|
29400
|
+
return -1;
|
|
29401
|
+
}
|
|
29402
|
+
function escapedHexLen(c) {
|
|
29403
|
+
if (c === 120) {
|
|
29404
|
+
return 2;
|
|
29405
|
+
}
|
|
29406
|
+
if (c === 117) {
|
|
29407
|
+
return 4;
|
|
29408
|
+
}
|
|
29409
|
+
if (c === 85) {
|
|
29410
|
+
return 8;
|
|
29411
|
+
}
|
|
29412
|
+
return 0;
|
|
29413
|
+
}
|
|
29414
|
+
function fromDecimalCode(c) {
|
|
29415
|
+
if (48 <= c && c <= 57) {
|
|
29416
|
+
return c - 48;
|
|
29417
|
+
}
|
|
29418
|
+
return -1;
|
|
29419
|
+
}
|
|
29420
|
+
function simpleEscapeSequence(c) {
|
|
29421
|
+
return c === 48 ? "\0" : c === 97 ? "\x07" : c === 98 ? "\b" : c === 116 ? " " : c === 9 ? " " : c === 110 ? "\n" : c === 118 ? "\v" : c === 102 ? "\f" : c === 114 ? "\r" : c === 101 ? "\x1B" : c === 32 ? " " : c === 34 ? '"' : c === 47 ? "/" : c === 92 ? "\\" : c === 78 ? "\x85" : c === 95 ? "\xA0" : c === 76 ? "\u2028" : c === 80 ? "\u2029" : "";
|
|
29422
|
+
}
|
|
29423
|
+
function charFromCodepoint(c) {
|
|
29424
|
+
if (c <= 65535) {
|
|
29425
|
+
return String.fromCharCode(c);
|
|
29426
|
+
}
|
|
29427
|
+
return String.fromCharCode(
|
|
29428
|
+
(c - 65536 >> 10) + 55296,
|
|
29429
|
+
(c - 65536 & 1023) + 56320
|
|
29430
|
+
);
|
|
29431
|
+
}
|
|
29432
|
+
function setProperty(object2, key, value) {
|
|
29433
|
+
if (key === "__proto__") {
|
|
29434
|
+
Object.defineProperty(object2, key, {
|
|
29435
|
+
configurable: true,
|
|
29436
|
+
enumerable: true,
|
|
29437
|
+
writable: true,
|
|
29438
|
+
value
|
|
29439
|
+
});
|
|
29440
|
+
} else {
|
|
29441
|
+
object2[key] = value;
|
|
29442
|
+
}
|
|
29443
|
+
}
|
|
29444
|
+
var simpleEscapeCheck = new Array(256);
|
|
29445
|
+
var simpleEscapeMap = new Array(256);
|
|
29446
|
+
for (i = 0; i < 256; i++) {
|
|
29447
|
+
simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0;
|
|
29448
|
+
simpleEscapeMap[i] = simpleEscapeSequence(i);
|
|
29449
|
+
}
|
|
29450
|
+
var i;
|
|
29451
|
+
function State(input, options) {
|
|
29452
|
+
this.input = input;
|
|
29453
|
+
this.filename = options["filename"] || null;
|
|
29454
|
+
this.schema = options["schema"] || DEFAULT_SCHEMA;
|
|
29455
|
+
this.onWarning = options["onWarning"] || null;
|
|
29456
|
+
this.legacy = options["legacy"] || false;
|
|
29457
|
+
this.json = options["json"] || false;
|
|
29458
|
+
this.listener = options["listener"] || null;
|
|
29459
|
+
this.implicitTypes = this.schema.compiledImplicit;
|
|
29460
|
+
this.typeMap = this.schema.compiledTypeMap;
|
|
29461
|
+
this.length = input.length;
|
|
29462
|
+
this.position = 0;
|
|
29463
|
+
this.line = 0;
|
|
29464
|
+
this.lineStart = 0;
|
|
29465
|
+
this.lineIndent = 0;
|
|
29466
|
+
this.firstTabInLine = -1;
|
|
29467
|
+
this.documents = [];
|
|
29468
|
+
}
|
|
29469
|
+
function generateError(state, message) {
|
|
29470
|
+
var mark = {
|
|
29471
|
+
name: state.filename,
|
|
29472
|
+
buffer: state.input.slice(0, -1),
|
|
29473
|
+
// omit trailing \0
|
|
29474
|
+
position: state.position,
|
|
29475
|
+
line: state.line,
|
|
29476
|
+
column: state.position - state.lineStart
|
|
29477
|
+
};
|
|
29478
|
+
mark.snippet = makeSnippet(mark);
|
|
29479
|
+
return new YAMLException(message, mark);
|
|
29480
|
+
}
|
|
29481
|
+
function throwError(state, message) {
|
|
29482
|
+
throw generateError(state, message);
|
|
29483
|
+
}
|
|
29484
|
+
function throwWarning(state, message) {
|
|
29485
|
+
if (state.onWarning) {
|
|
29486
|
+
state.onWarning.call(null, generateError(state, message));
|
|
29487
|
+
}
|
|
29488
|
+
}
|
|
29489
|
+
var directiveHandlers = {
|
|
29490
|
+
YAML: function handleYamlDirective(state, name, args) {
|
|
29491
|
+
var match, major, minor;
|
|
29492
|
+
if (state.version !== null) {
|
|
29493
|
+
throwError(state, "duplication of %YAML directive");
|
|
29494
|
+
}
|
|
29495
|
+
if (args.length !== 1) {
|
|
29496
|
+
throwError(state, "YAML directive accepts exactly one argument");
|
|
29497
|
+
}
|
|
29498
|
+
match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]);
|
|
29499
|
+
if (match === null) {
|
|
29500
|
+
throwError(state, "ill-formed argument of the YAML directive");
|
|
29501
|
+
}
|
|
29502
|
+
major = parseInt(match[1], 10);
|
|
29503
|
+
minor = parseInt(match[2], 10);
|
|
29504
|
+
if (major !== 1) {
|
|
29505
|
+
throwError(state, "unacceptable YAML version of the document");
|
|
29506
|
+
}
|
|
29507
|
+
state.version = args[0];
|
|
29508
|
+
state.checkLineBreaks = minor < 2;
|
|
29509
|
+
if (minor !== 1 && minor !== 2) {
|
|
29510
|
+
throwWarning(state, "unsupported YAML version of the document");
|
|
29511
|
+
}
|
|
29512
|
+
},
|
|
29513
|
+
TAG: function handleTagDirective(state, name, args) {
|
|
29514
|
+
var handle, prefix;
|
|
29515
|
+
if (args.length !== 2) {
|
|
29516
|
+
throwError(state, "TAG directive accepts exactly two arguments");
|
|
29517
|
+
}
|
|
29518
|
+
handle = args[0];
|
|
29519
|
+
prefix = args[1];
|
|
29520
|
+
if (!PATTERN_TAG_HANDLE.test(handle)) {
|
|
29521
|
+
throwError(state, "ill-formed tag handle (first argument) of the TAG directive");
|
|
29522
|
+
}
|
|
29523
|
+
if (_hasOwnProperty.call(state.tagMap, handle)) {
|
|
29524
|
+
throwError(state, 'there is a previously declared suffix for "' + handle + '" tag handle');
|
|
29525
|
+
}
|
|
29526
|
+
if (!PATTERN_TAG_URI.test(prefix)) {
|
|
29527
|
+
throwError(state, "ill-formed tag prefix (second argument) of the TAG directive");
|
|
29528
|
+
}
|
|
29529
|
+
try {
|
|
29530
|
+
prefix = decodeURIComponent(prefix);
|
|
29531
|
+
} catch (err) {
|
|
29532
|
+
throwError(state, "tag prefix is malformed: " + prefix);
|
|
29533
|
+
}
|
|
29534
|
+
state.tagMap[handle] = prefix;
|
|
29535
|
+
}
|
|
29536
|
+
};
|
|
29537
|
+
function captureSegment(state, start, end, checkJson) {
|
|
29538
|
+
var _position, _length2, _character, _result;
|
|
29539
|
+
if (start < end) {
|
|
29540
|
+
_result = state.input.slice(start, end);
|
|
29541
|
+
if (checkJson) {
|
|
29542
|
+
for (_position = 0, _length2 = _result.length; _position < _length2; _position += 1) {
|
|
29543
|
+
_character = _result.charCodeAt(_position);
|
|
29544
|
+
if (!(_character === 9 || 32 <= _character && _character <= 1114111)) {
|
|
29545
|
+
throwError(state, "expected valid JSON character");
|
|
29546
|
+
}
|
|
29547
|
+
}
|
|
29548
|
+
} else if (PATTERN_NON_PRINTABLE.test(_result)) {
|
|
29549
|
+
throwError(state, "the stream contains non-printable characters");
|
|
29550
|
+
}
|
|
29551
|
+
state.result += _result;
|
|
29552
|
+
}
|
|
29553
|
+
}
|
|
29554
|
+
function mergeMappings(state, destination, source, overridableKeys) {
|
|
29555
|
+
var sourceKeys, key, index, quantity;
|
|
29556
|
+
if (!common.isObject(source)) {
|
|
29557
|
+
throwError(state, "cannot merge mappings; the provided source object is unacceptable");
|
|
29558
|
+
}
|
|
29559
|
+
sourceKeys = Object.keys(source);
|
|
29560
|
+
for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) {
|
|
29561
|
+
key = sourceKeys[index];
|
|
29562
|
+
if (!_hasOwnProperty.call(destination, key)) {
|
|
29563
|
+
setProperty(destination, key, source[key]);
|
|
29564
|
+
overridableKeys[key] = true;
|
|
29565
|
+
}
|
|
29566
|
+
}
|
|
29567
|
+
}
|
|
29568
|
+
function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, startLine, startLineStart, startPos) {
|
|
29569
|
+
var index, quantity;
|
|
29570
|
+
if (Array.isArray(keyNode)) {
|
|
29571
|
+
keyNode = Array.prototype.slice.call(keyNode);
|
|
29572
|
+
for (index = 0, quantity = keyNode.length; index < quantity; index += 1) {
|
|
29573
|
+
if (Array.isArray(keyNode[index])) {
|
|
29574
|
+
throwError(state, "nested arrays are not supported inside keys");
|
|
29575
|
+
}
|
|
29576
|
+
if (typeof keyNode === "object" && _class(keyNode[index]) === "[object Object]") {
|
|
29577
|
+
keyNode[index] = "[object Object]";
|
|
29578
|
+
}
|
|
29579
|
+
}
|
|
29580
|
+
}
|
|
29581
|
+
if (typeof keyNode === "object" && _class(keyNode) === "[object Object]") {
|
|
29582
|
+
keyNode = "[object Object]";
|
|
29583
|
+
}
|
|
29584
|
+
keyNode = String(keyNode);
|
|
29585
|
+
if (_result === null) {
|
|
29586
|
+
_result = {};
|
|
29587
|
+
}
|
|
29588
|
+
if (keyTag === "tag:yaml.org,2002:merge") {
|
|
29589
|
+
if (Array.isArray(valueNode)) {
|
|
29590
|
+
for (index = 0, quantity = valueNode.length; index < quantity; index += 1) {
|
|
29591
|
+
mergeMappings(state, _result, valueNode[index], overridableKeys);
|
|
29592
|
+
}
|
|
29593
|
+
} else {
|
|
29594
|
+
mergeMappings(state, _result, valueNode, overridableKeys);
|
|
29595
|
+
}
|
|
29596
|
+
} else {
|
|
29597
|
+
if (!state.json && !_hasOwnProperty.call(overridableKeys, keyNode) && _hasOwnProperty.call(_result, keyNode)) {
|
|
29598
|
+
state.line = startLine || state.line;
|
|
29599
|
+
state.lineStart = startLineStart || state.lineStart;
|
|
29600
|
+
state.position = startPos || state.position;
|
|
29601
|
+
throwError(state, "duplicated mapping key");
|
|
29602
|
+
}
|
|
29603
|
+
setProperty(_result, keyNode, valueNode);
|
|
29604
|
+
delete overridableKeys[keyNode];
|
|
29605
|
+
}
|
|
29606
|
+
return _result;
|
|
29607
|
+
}
|
|
29608
|
+
function readLineBreak(state) {
|
|
29609
|
+
var ch;
|
|
29610
|
+
ch = state.input.charCodeAt(state.position);
|
|
29611
|
+
if (ch === 10) {
|
|
29612
|
+
state.position++;
|
|
29613
|
+
} else if (ch === 13) {
|
|
29614
|
+
state.position++;
|
|
29615
|
+
if (state.input.charCodeAt(state.position) === 10) {
|
|
29616
|
+
state.position++;
|
|
29617
|
+
}
|
|
29618
|
+
} else {
|
|
29619
|
+
throwError(state, "a line break is expected");
|
|
29620
|
+
}
|
|
29621
|
+
state.line += 1;
|
|
29622
|
+
state.lineStart = state.position;
|
|
29623
|
+
state.firstTabInLine = -1;
|
|
29624
|
+
}
|
|
29625
|
+
function skipSeparationSpace(state, allowComments, checkIndent) {
|
|
29626
|
+
var lineBreaks = 0, ch = state.input.charCodeAt(state.position);
|
|
29627
|
+
while (ch !== 0) {
|
|
29628
|
+
while (is_WHITE_SPACE(ch)) {
|
|
29629
|
+
if (ch === 9 && state.firstTabInLine === -1) {
|
|
29630
|
+
state.firstTabInLine = state.position;
|
|
29631
|
+
}
|
|
29632
|
+
ch = state.input.charCodeAt(++state.position);
|
|
29633
|
+
}
|
|
29634
|
+
if (allowComments && ch === 35) {
|
|
29635
|
+
do {
|
|
29636
|
+
ch = state.input.charCodeAt(++state.position);
|
|
29637
|
+
} while (ch !== 10 && ch !== 13 && ch !== 0);
|
|
29638
|
+
}
|
|
29639
|
+
if (is_EOL(ch)) {
|
|
29640
|
+
readLineBreak(state);
|
|
29641
|
+
ch = state.input.charCodeAt(state.position);
|
|
29642
|
+
lineBreaks++;
|
|
29643
|
+
state.lineIndent = 0;
|
|
29644
|
+
while (ch === 32) {
|
|
29645
|
+
state.lineIndent++;
|
|
29646
|
+
ch = state.input.charCodeAt(++state.position);
|
|
29647
|
+
}
|
|
29648
|
+
} else {
|
|
29649
|
+
break;
|
|
29650
|
+
}
|
|
29651
|
+
}
|
|
29652
|
+
if (checkIndent !== -1 && lineBreaks !== 0 && state.lineIndent < checkIndent) {
|
|
29653
|
+
throwWarning(state, "deficient indentation");
|
|
29654
|
+
}
|
|
29655
|
+
return lineBreaks;
|
|
29656
|
+
}
|
|
29657
|
+
function testDocumentSeparator(state) {
|
|
29658
|
+
var _position = state.position, ch;
|
|
29659
|
+
ch = state.input.charCodeAt(_position);
|
|
29660
|
+
if ((ch === 45 || ch === 46) && ch === state.input.charCodeAt(_position + 1) && ch === state.input.charCodeAt(_position + 2)) {
|
|
29661
|
+
_position += 3;
|
|
29662
|
+
ch = state.input.charCodeAt(_position);
|
|
29663
|
+
if (ch === 0 || is_WS_OR_EOL(ch)) {
|
|
29664
|
+
return true;
|
|
29665
|
+
}
|
|
29666
|
+
}
|
|
29667
|
+
return false;
|
|
29668
|
+
}
|
|
29669
|
+
function writeFoldedLines(state, count) {
|
|
29670
|
+
if (count === 1) {
|
|
29671
|
+
state.result += " ";
|
|
29672
|
+
} else if (count > 1) {
|
|
29673
|
+
state.result += common.repeat("\n", count - 1);
|
|
29674
|
+
}
|
|
29675
|
+
}
|
|
29676
|
+
function readPlainScalar(state, nodeIndent, withinFlowCollection) {
|
|
29677
|
+
var preceding, following, captureStart, captureEnd, hasPendingContent, _line, _lineStart, _lineIndent, _kind = state.kind, _result = state.result, ch;
|
|
29678
|
+
ch = state.input.charCodeAt(state.position);
|
|
29679
|
+
if (is_WS_OR_EOL(ch) || is_FLOW_INDICATOR(ch) || ch === 35 || ch === 38 || ch === 42 || ch === 33 || ch === 124 || ch === 62 || ch === 39 || ch === 34 || ch === 37 || ch === 64 || ch === 96) {
|
|
29680
|
+
return false;
|
|
29681
|
+
}
|
|
29682
|
+
if (ch === 63 || ch === 45) {
|
|
29683
|
+
following = state.input.charCodeAt(state.position + 1);
|
|
29684
|
+
if (is_WS_OR_EOL(following) || withinFlowCollection && is_FLOW_INDICATOR(following)) {
|
|
29685
|
+
return false;
|
|
29686
|
+
}
|
|
29687
|
+
}
|
|
29688
|
+
state.kind = "scalar";
|
|
29689
|
+
state.result = "";
|
|
29690
|
+
captureStart = captureEnd = state.position;
|
|
29691
|
+
hasPendingContent = false;
|
|
29692
|
+
while (ch !== 0) {
|
|
29693
|
+
if (ch === 58) {
|
|
29694
|
+
following = state.input.charCodeAt(state.position + 1);
|
|
29695
|
+
if (is_WS_OR_EOL(following) || withinFlowCollection && is_FLOW_INDICATOR(following)) {
|
|
29696
|
+
break;
|
|
29697
|
+
}
|
|
29698
|
+
} else if (ch === 35) {
|
|
29699
|
+
preceding = state.input.charCodeAt(state.position - 1);
|
|
29700
|
+
if (is_WS_OR_EOL(preceding)) {
|
|
29701
|
+
break;
|
|
29702
|
+
}
|
|
29703
|
+
} else if (state.position === state.lineStart && testDocumentSeparator(state) || withinFlowCollection && is_FLOW_INDICATOR(ch)) {
|
|
29704
|
+
break;
|
|
29705
|
+
} else if (is_EOL(ch)) {
|
|
29706
|
+
_line = state.line;
|
|
29707
|
+
_lineStart = state.lineStart;
|
|
29708
|
+
_lineIndent = state.lineIndent;
|
|
29709
|
+
skipSeparationSpace(state, false, -1);
|
|
29710
|
+
if (state.lineIndent >= nodeIndent) {
|
|
29711
|
+
hasPendingContent = true;
|
|
29712
|
+
ch = state.input.charCodeAt(state.position);
|
|
29713
|
+
continue;
|
|
29714
|
+
} else {
|
|
29715
|
+
state.position = captureEnd;
|
|
29716
|
+
state.line = _line;
|
|
29717
|
+
state.lineStart = _lineStart;
|
|
29718
|
+
state.lineIndent = _lineIndent;
|
|
29719
|
+
break;
|
|
29720
|
+
}
|
|
29721
|
+
}
|
|
29722
|
+
if (hasPendingContent) {
|
|
29723
|
+
captureSegment(state, captureStart, captureEnd, false);
|
|
29724
|
+
writeFoldedLines(state, state.line - _line);
|
|
29725
|
+
captureStart = captureEnd = state.position;
|
|
29726
|
+
hasPendingContent = false;
|
|
29727
|
+
}
|
|
29728
|
+
if (!is_WHITE_SPACE(ch)) {
|
|
29729
|
+
captureEnd = state.position + 1;
|
|
29730
|
+
}
|
|
29731
|
+
ch = state.input.charCodeAt(++state.position);
|
|
29732
|
+
}
|
|
29733
|
+
captureSegment(state, captureStart, captureEnd, false);
|
|
29734
|
+
if (state.result) {
|
|
29735
|
+
return true;
|
|
29736
|
+
}
|
|
29737
|
+
state.kind = _kind;
|
|
29738
|
+
state.result = _result;
|
|
29739
|
+
return false;
|
|
29740
|
+
}
|
|
29741
|
+
function readSingleQuotedScalar(state, nodeIndent) {
|
|
29742
|
+
var ch, captureStart, captureEnd;
|
|
29743
|
+
ch = state.input.charCodeAt(state.position);
|
|
29744
|
+
if (ch !== 39) {
|
|
29745
|
+
return false;
|
|
29746
|
+
}
|
|
29747
|
+
state.kind = "scalar";
|
|
29748
|
+
state.result = "";
|
|
29749
|
+
state.position++;
|
|
29750
|
+
captureStart = captureEnd = state.position;
|
|
29751
|
+
while ((ch = state.input.charCodeAt(state.position)) !== 0) {
|
|
29752
|
+
if (ch === 39) {
|
|
29753
|
+
captureSegment(state, captureStart, state.position, true);
|
|
29754
|
+
ch = state.input.charCodeAt(++state.position);
|
|
29755
|
+
if (ch === 39) {
|
|
29756
|
+
captureStart = state.position;
|
|
29757
|
+
state.position++;
|
|
29758
|
+
captureEnd = state.position;
|
|
29759
|
+
} else {
|
|
29760
|
+
return true;
|
|
29761
|
+
}
|
|
29762
|
+
} else if (is_EOL(ch)) {
|
|
29763
|
+
captureSegment(state, captureStart, captureEnd, true);
|
|
29764
|
+
writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
|
|
29765
|
+
captureStart = captureEnd = state.position;
|
|
29766
|
+
} else if (state.position === state.lineStart && testDocumentSeparator(state)) {
|
|
29767
|
+
throwError(state, "unexpected end of the document within a single quoted scalar");
|
|
29768
|
+
} else {
|
|
29769
|
+
state.position++;
|
|
29770
|
+
captureEnd = state.position;
|
|
29771
|
+
}
|
|
29772
|
+
}
|
|
29773
|
+
throwError(state, "unexpected end of the stream within a single quoted scalar");
|
|
29774
|
+
}
|
|
29775
|
+
function readDoubleQuotedScalar(state, nodeIndent) {
|
|
29776
|
+
var captureStart, captureEnd, hexLength, hexResult, tmp, ch;
|
|
29777
|
+
ch = state.input.charCodeAt(state.position);
|
|
29778
|
+
if (ch !== 34) {
|
|
29779
|
+
return false;
|
|
29780
|
+
}
|
|
29781
|
+
state.kind = "scalar";
|
|
29782
|
+
state.result = "";
|
|
29783
|
+
state.position++;
|
|
29784
|
+
captureStart = captureEnd = state.position;
|
|
29785
|
+
while ((ch = state.input.charCodeAt(state.position)) !== 0) {
|
|
29786
|
+
if (ch === 34) {
|
|
29787
|
+
captureSegment(state, captureStart, state.position, true);
|
|
29788
|
+
state.position++;
|
|
29789
|
+
return true;
|
|
29790
|
+
} else if (ch === 92) {
|
|
29791
|
+
captureSegment(state, captureStart, state.position, true);
|
|
29792
|
+
ch = state.input.charCodeAt(++state.position);
|
|
29793
|
+
if (is_EOL(ch)) {
|
|
29794
|
+
skipSeparationSpace(state, false, nodeIndent);
|
|
29795
|
+
} else if (ch < 256 && simpleEscapeCheck[ch]) {
|
|
29796
|
+
state.result += simpleEscapeMap[ch];
|
|
29797
|
+
state.position++;
|
|
29798
|
+
} else if ((tmp = escapedHexLen(ch)) > 0) {
|
|
29799
|
+
hexLength = tmp;
|
|
29800
|
+
hexResult = 0;
|
|
29801
|
+
for (; hexLength > 0; hexLength--) {
|
|
29802
|
+
ch = state.input.charCodeAt(++state.position);
|
|
29803
|
+
if ((tmp = fromHexCode(ch)) >= 0) {
|
|
29804
|
+
hexResult = (hexResult << 4) + tmp;
|
|
29805
|
+
} else {
|
|
29806
|
+
throwError(state, "expected hexadecimal character");
|
|
29807
|
+
}
|
|
29808
|
+
}
|
|
29809
|
+
state.result += charFromCodepoint(hexResult);
|
|
29810
|
+
state.position++;
|
|
29811
|
+
} else {
|
|
29812
|
+
throwError(state, "unknown escape sequence");
|
|
29813
|
+
}
|
|
29814
|
+
captureStart = captureEnd = state.position;
|
|
29815
|
+
} else if (is_EOL(ch)) {
|
|
29816
|
+
captureSegment(state, captureStart, captureEnd, true);
|
|
29817
|
+
writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
|
|
29818
|
+
captureStart = captureEnd = state.position;
|
|
29819
|
+
} else if (state.position === state.lineStart && testDocumentSeparator(state)) {
|
|
29820
|
+
throwError(state, "unexpected end of the document within a double quoted scalar");
|
|
29821
|
+
} else {
|
|
29822
|
+
state.position++;
|
|
29823
|
+
captureEnd = state.position;
|
|
29824
|
+
}
|
|
29825
|
+
}
|
|
29826
|
+
throwError(state, "unexpected end of the stream within a double quoted scalar");
|
|
29827
|
+
}
|
|
29828
|
+
function readFlowCollection(state, nodeIndent) {
|
|
29829
|
+
var readNext = true, _line, _lineStart, _pos, _tag = state.tag, _result, _anchor = state.anchor, following, terminator, isPair, isExplicitPair, isMapping, overridableKeys = /* @__PURE__ */ Object.create(null), keyNode, keyTag, valueNode, ch;
|
|
29830
|
+
ch = state.input.charCodeAt(state.position);
|
|
29831
|
+
if (ch === 91) {
|
|
29832
|
+
terminator = 93;
|
|
29833
|
+
isMapping = false;
|
|
29834
|
+
_result = [];
|
|
29835
|
+
} else if (ch === 123) {
|
|
29836
|
+
terminator = 125;
|
|
29837
|
+
isMapping = true;
|
|
29838
|
+
_result = {};
|
|
29839
|
+
} else {
|
|
29840
|
+
return false;
|
|
29841
|
+
}
|
|
29842
|
+
if (state.anchor !== null) {
|
|
29843
|
+
state.anchorMap[state.anchor] = _result;
|
|
29844
|
+
}
|
|
29845
|
+
ch = state.input.charCodeAt(++state.position);
|
|
29846
|
+
while (ch !== 0) {
|
|
29847
|
+
skipSeparationSpace(state, true, nodeIndent);
|
|
29848
|
+
ch = state.input.charCodeAt(state.position);
|
|
29849
|
+
if (ch === terminator) {
|
|
29850
|
+
state.position++;
|
|
29851
|
+
state.tag = _tag;
|
|
29852
|
+
state.anchor = _anchor;
|
|
29853
|
+
state.kind = isMapping ? "mapping" : "sequence";
|
|
29854
|
+
state.result = _result;
|
|
29855
|
+
return true;
|
|
29856
|
+
} else if (!readNext) {
|
|
29857
|
+
throwError(state, "missed comma between flow collection entries");
|
|
29858
|
+
} else if (ch === 44) {
|
|
29859
|
+
throwError(state, "expected the node content, but found ','");
|
|
29860
|
+
}
|
|
29861
|
+
keyTag = keyNode = valueNode = null;
|
|
29862
|
+
isPair = isExplicitPair = false;
|
|
29863
|
+
if (ch === 63) {
|
|
29864
|
+
following = state.input.charCodeAt(state.position + 1);
|
|
29865
|
+
if (is_WS_OR_EOL(following)) {
|
|
29866
|
+
isPair = isExplicitPair = true;
|
|
29867
|
+
state.position++;
|
|
29868
|
+
skipSeparationSpace(state, true, nodeIndent);
|
|
29869
|
+
}
|
|
29870
|
+
}
|
|
29871
|
+
_line = state.line;
|
|
29872
|
+
_lineStart = state.lineStart;
|
|
29873
|
+
_pos = state.position;
|
|
29874
|
+
composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
|
|
29875
|
+
keyTag = state.tag;
|
|
29876
|
+
keyNode = state.result;
|
|
29877
|
+
skipSeparationSpace(state, true, nodeIndent);
|
|
29878
|
+
ch = state.input.charCodeAt(state.position);
|
|
29879
|
+
if ((isExplicitPair || state.line === _line) && ch === 58) {
|
|
29880
|
+
isPair = true;
|
|
29881
|
+
ch = state.input.charCodeAt(++state.position);
|
|
29882
|
+
skipSeparationSpace(state, true, nodeIndent);
|
|
29883
|
+
composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
|
|
29884
|
+
valueNode = state.result;
|
|
29885
|
+
}
|
|
29886
|
+
if (isMapping) {
|
|
29887
|
+
storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos);
|
|
29888
|
+
} else if (isPair) {
|
|
29889
|
+
_result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos));
|
|
29890
|
+
} else {
|
|
29891
|
+
_result.push(keyNode);
|
|
29892
|
+
}
|
|
29893
|
+
skipSeparationSpace(state, true, nodeIndent);
|
|
29894
|
+
ch = state.input.charCodeAt(state.position);
|
|
29895
|
+
if (ch === 44) {
|
|
29896
|
+
readNext = true;
|
|
29897
|
+
ch = state.input.charCodeAt(++state.position);
|
|
29898
|
+
} else {
|
|
29899
|
+
readNext = false;
|
|
29900
|
+
}
|
|
29901
|
+
}
|
|
29902
|
+
throwError(state, "unexpected end of the stream within a flow collection");
|
|
29903
|
+
}
|
|
29904
|
+
function readBlockScalar(state, nodeIndent) {
|
|
29905
|
+
var captureStart, folding, chomping = CHOMPING_CLIP, didReadContent = false, detectedIndent = false, textIndent = nodeIndent, emptyLines = 0, atMoreIndented = false, tmp, ch;
|
|
29906
|
+
ch = state.input.charCodeAt(state.position);
|
|
29907
|
+
if (ch === 124) {
|
|
29908
|
+
folding = false;
|
|
29909
|
+
} else if (ch === 62) {
|
|
29910
|
+
folding = true;
|
|
29911
|
+
} else {
|
|
29912
|
+
return false;
|
|
29913
|
+
}
|
|
29914
|
+
state.kind = "scalar";
|
|
29915
|
+
state.result = "";
|
|
29916
|
+
while (ch !== 0) {
|
|
29917
|
+
ch = state.input.charCodeAt(++state.position);
|
|
29918
|
+
if (ch === 43 || ch === 45) {
|
|
29919
|
+
if (CHOMPING_CLIP === chomping) {
|
|
29920
|
+
chomping = ch === 43 ? CHOMPING_KEEP : CHOMPING_STRIP;
|
|
29921
|
+
} else {
|
|
29922
|
+
throwError(state, "repeat of a chomping mode identifier");
|
|
29923
|
+
}
|
|
29924
|
+
} else if ((tmp = fromDecimalCode(ch)) >= 0) {
|
|
29925
|
+
if (tmp === 0) {
|
|
29926
|
+
throwError(state, "bad explicit indentation width of a block scalar; it cannot be less than one");
|
|
29927
|
+
} else if (!detectedIndent) {
|
|
29928
|
+
textIndent = nodeIndent + tmp - 1;
|
|
29929
|
+
detectedIndent = true;
|
|
29930
|
+
} else {
|
|
29931
|
+
throwError(state, "repeat of an indentation width identifier");
|
|
29932
|
+
}
|
|
29933
|
+
} else {
|
|
29934
|
+
break;
|
|
29935
|
+
}
|
|
29936
|
+
}
|
|
29937
|
+
if (is_WHITE_SPACE(ch)) {
|
|
29938
|
+
do {
|
|
29939
|
+
ch = state.input.charCodeAt(++state.position);
|
|
29940
|
+
} while (is_WHITE_SPACE(ch));
|
|
29941
|
+
if (ch === 35) {
|
|
29942
|
+
do {
|
|
29943
|
+
ch = state.input.charCodeAt(++state.position);
|
|
29944
|
+
} while (!is_EOL(ch) && ch !== 0);
|
|
29945
|
+
}
|
|
29946
|
+
}
|
|
29947
|
+
while (ch !== 0) {
|
|
29948
|
+
readLineBreak(state);
|
|
29949
|
+
state.lineIndent = 0;
|
|
29950
|
+
ch = state.input.charCodeAt(state.position);
|
|
29951
|
+
while ((!detectedIndent || state.lineIndent < textIndent) && ch === 32) {
|
|
29952
|
+
state.lineIndent++;
|
|
29953
|
+
ch = state.input.charCodeAt(++state.position);
|
|
29954
|
+
}
|
|
29955
|
+
if (!detectedIndent && state.lineIndent > textIndent) {
|
|
29956
|
+
textIndent = state.lineIndent;
|
|
29957
|
+
}
|
|
29958
|
+
if (is_EOL(ch)) {
|
|
29959
|
+
emptyLines++;
|
|
29960
|
+
continue;
|
|
29961
|
+
}
|
|
29962
|
+
if (state.lineIndent < textIndent) {
|
|
29963
|
+
if (chomping === CHOMPING_KEEP) {
|
|
29964
|
+
state.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines);
|
|
29965
|
+
} else if (chomping === CHOMPING_CLIP) {
|
|
29966
|
+
if (didReadContent) {
|
|
29967
|
+
state.result += "\n";
|
|
29968
|
+
}
|
|
29969
|
+
}
|
|
29970
|
+
break;
|
|
29971
|
+
}
|
|
29972
|
+
if (folding) {
|
|
29973
|
+
if (is_WHITE_SPACE(ch)) {
|
|
29974
|
+
atMoreIndented = true;
|
|
29975
|
+
state.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines);
|
|
29976
|
+
} else if (atMoreIndented) {
|
|
29977
|
+
atMoreIndented = false;
|
|
29978
|
+
state.result += common.repeat("\n", emptyLines + 1);
|
|
29979
|
+
} else if (emptyLines === 0) {
|
|
29980
|
+
if (didReadContent) {
|
|
29981
|
+
state.result += " ";
|
|
29982
|
+
}
|
|
29983
|
+
} else {
|
|
29984
|
+
state.result += common.repeat("\n", emptyLines);
|
|
29985
|
+
}
|
|
29986
|
+
} else {
|
|
29987
|
+
state.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines);
|
|
29988
|
+
}
|
|
29989
|
+
didReadContent = true;
|
|
29990
|
+
detectedIndent = true;
|
|
29991
|
+
emptyLines = 0;
|
|
29992
|
+
captureStart = state.position;
|
|
29993
|
+
while (!is_EOL(ch) && ch !== 0) {
|
|
29994
|
+
ch = state.input.charCodeAt(++state.position);
|
|
29995
|
+
}
|
|
29996
|
+
captureSegment(state, captureStart, state.position, false);
|
|
29997
|
+
}
|
|
29998
|
+
return true;
|
|
29999
|
+
}
|
|
30000
|
+
function readBlockSequence(state, nodeIndent) {
|
|
30001
|
+
var _line, _tag = state.tag, _anchor = state.anchor, _result = [], following, detected = false, ch;
|
|
30002
|
+
if (state.firstTabInLine !== -1) return false;
|
|
30003
|
+
if (state.anchor !== null) {
|
|
30004
|
+
state.anchorMap[state.anchor] = _result;
|
|
30005
|
+
}
|
|
30006
|
+
ch = state.input.charCodeAt(state.position);
|
|
30007
|
+
while (ch !== 0) {
|
|
30008
|
+
if (state.firstTabInLine !== -1) {
|
|
30009
|
+
state.position = state.firstTabInLine;
|
|
30010
|
+
throwError(state, "tab characters must not be used in indentation");
|
|
30011
|
+
}
|
|
30012
|
+
if (ch !== 45) {
|
|
30013
|
+
break;
|
|
30014
|
+
}
|
|
30015
|
+
following = state.input.charCodeAt(state.position + 1);
|
|
30016
|
+
if (!is_WS_OR_EOL(following)) {
|
|
30017
|
+
break;
|
|
30018
|
+
}
|
|
30019
|
+
detected = true;
|
|
30020
|
+
state.position++;
|
|
30021
|
+
if (skipSeparationSpace(state, true, -1)) {
|
|
30022
|
+
if (state.lineIndent <= nodeIndent) {
|
|
30023
|
+
_result.push(null);
|
|
30024
|
+
ch = state.input.charCodeAt(state.position);
|
|
30025
|
+
continue;
|
|
30026
|
+
}
|
|
30027
|
+
}
|
|
30028
|
+
_line = state.line;
|
|
30029
|
+
composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true);
|
|
30030
|
+
_result.push(state.result);
|
|
30031
|
+
skipSeparationSpace(state, true, -1);
|
|
30032
|
+
ch = state.input.charCodeAt(state.position);
|
|
30033
|
+
if ((state.line === _line || state.lineIndent > nodeIndent) && ch !== 0) {
|
|
30034
|
+
throwError(state, "bad indentation of a sequence entry");
|
|
30035
|
+
} else if (state.lineIndent < nodeIndent) {
|
|
30036
|
+
break;
|
|
30037
|
+
}
|
|
30038
|
+
}
|
|
30039
|
+
if (detected) {
|
|
30040
|
+
state.tag = _tag;
|
|
30041
|
+
state.anchor = _anchor;
|
|
30042
|
+
state.kind = "sequence";
|
|
30043
|
+
state.result = _result;
|
|
30044
|
+
return true;
|
|
30045
|
+
}
|
|
30046
|
+
return false;
|
|
30047
|
+
}
|
|
30048
|
+
function readBlockMapping(state, nodeIndent, flowIndent) {
|
|
30049
|
+
var following, allowCompact, _line, _keyLine, _keyLineStart, _keyPos, _tag = state.tag, _anchor = state.anchor, _result = {}, overridableKeys = /* @__PURE__ */ Object.create(null), keyTag = null, keyNode = null, valueNode = null, atExplicitKey = false, detected = false, ch;
|
|
30050
|
+
if (state.firstTabInLine !== -1) return false;
|
|
30051
|
+
if (state.anchor !== null) {
|
|
30052
|
+
state.anchorMap[state.anchor] = _result;
|
|
30053
|
+
}
|
|
30054
|
+
ch = state.input.charCodeAt(state.position);
|
|
30055
|
+
while (ch !== 0) {
|
|
30056
|
+
if (!atExplicitKey && state.firstTabInLine !== -1) {
|
|
30057
|
+
state.position = state.firstTabInLine;
|
|
30058
|
+
throwError(state, "tab characters must not be used in indentation");
|
|
30059
|
+
}
|
|
30060
|
+
following = state.input.charCodeAt(state.position + 1);
|
|
30061
|
+
_line = state.line;
|
|
30062
|
+
if ((ch === 63 || ch === 58) && is_WS_OR_EOL(following)) {
|
|
30063
|
+
if (ch === 63) {
|
|
30064
|
+
if (atExplicitKey) {
|
|
30065
|
+
storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);
|
|
30066
|
+
keyTag = keyNode = valueNode = null;
|
|
30067
|
+
}
|
|
30068
|
+
detected = true;
|
|
30069
|
+
atExplicitKey = true;
|
|
30070
|
+
allowCompact = true;
|
|
30071
|
+
} else if (atExplicitKey) {
|
|
30072
|
+
atExplicitKey = false;
|
|
30073
|
+
allowCompact = true;
|
|
30074
|
+
} else {
|
|
30075
|
+
throwError(state, "incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line");
|
|
30076
|
+
}
|
|
30077
|
+
state.position += 1;
|
|
30078
|
+
ch = following;
|
|
30079
|
+
} else {
|
|
30080
|
+
_keyLine = state.line;
|
|
30081
|
+
_keyLineStart = state.lineStart;
|
|
30082
|
+
_keyPos = state.position;
|
|
30083
|
+
if (!composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) {
|
|
30084
|
+
break;
|
|
30085
|
+
}
|
|
30086
|
+
if (state.line === _line) {
|
|
30087
|
+
ch = state.input.charCodeAt(state.position);
|
|
30088
|
+
while (is_WHITE_SPACE(ch)) {
|
|
30089
|
+
ch = state.input.charCodeAt(++state.position);
|
|
30090
|
+
}
|
|
30091
|
+
if (ch === 58) {
|
|
30092
|
+
ch = state.input.charCodeAt(++state.position);
|
|
30093
|
+
if (!is_WS_OR_EOL(ch)) {
|
|
30094
|
+
throwError(state, "a whitespace character is expected after the key-value separator within a block mapping");
|
|
30095
|
+
}
|
|
30096
|
+
if (atExplicitKey) {
|
|
30097
|
+
storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);
|
|
30098
|
+
keyTag = keyNode = valueNode = null;
|
|
30099
|
+
}
|
|
30100
|
+
detected = true;
|
|
30101
|
+
atExplicitKey = false;
|
|
30102
|
+
allowCompact = false;
|
|
30103
|
+
keyTag = state.tag;
|
|
30104
|
+
keyNode = state.result;
|
|
30105
|
+
} else if (detected) {
|
|
30106
|
+
throwError(state, "can not read an implicit mapping pair; a colon is missed");
|
|
30107
|
+
} else {
|
|
30108
|
+
state.tag = _tag;
|
|
30109
|
+
state.anchor = _anchor;
|
|
30110
|
+
return true;
|
|
30111
|
+
}
|
|
30112
|
+
} else if (detected) {
|
|
30113
|
+
throwError(state, "can not read a block mapping entry; a multiline key may not be an implicit key");
|
|
30114
|
+
} else {
|
|
30115
|
+
state.tag = _tag;
|
|
30116
|
+
state.anchor = _anchor;
|
|
30117
|
+
return true;
|
|
30118
|
+
}
|
|
30119
|
+
}
|
|
30120
|
+
if (state.line === _line || state.lineIndent > nodeIndent) {
|
|
30121
|
+
if (atExplicitKey) {
|
|
30122
|
+
_keyLine = state.line;
|
|
30123
|
+
_keyLineStart = state.lineStart;
|
|
30124
|
+
_keyPos = state.position;
|
|
30125
|
+
}
|
|
30126
|
+
if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) {
|
|
30127
|
+
if (atExplicitKey) {
|
|
30128
|
+
keyNode = state.result;
|
|
30129
|
+
} else {
|
|
30130
|
+
valueNode = state.result;
|
|
30131
|
+
}
|
|
30132
|
+
}
|
|
30133
|
+
if (!atExplicitKey) {
|
|
30134
|
+
storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _keyLine, _keyLineStart, _keyPos);
|
|
30135
|
+
keyTag = keyNode = valueNode = null;
|
|
30136
|
+
}
|
|
30137
|
+
skipSeparationSpace(state, true, -1);
|
|
30138
|
+
ch = state.input.charCodeAt(state.position);
|
|
30139
|
+
}
|
|
30140
|
+
if ((state.line === _line || state.lineIndent > nodeIndent) && ch !== 0) {
|
|
30141
|
+
throwError(state, "bad indentation of a mapping entry");
|
|
30142
|
+
} else if (state.lineIndent < nodeIndent) {
|
|
30143
|
+
break;
|
|
30144
|
+
}
|
|
30145
|
+
}
|
|
30146
|
+
if (atExplicitKey) {
|
|
30147
|
+
storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);
|
|
30148
|
+
}
|
|
30149
|
+
if (detected) {
|
|
30150
|
+
state.tag = _tag;
|
|
30151
|
+
state.anchor = _anchor;
|
|
30152
|
+
state.kind = "mapping";
|
|
30153
|
+
state.result = _result;
|
|
30154
|
+
}
|
|
30155
|
+
return detected;
|
|
30156
|
+
}
|
|
30157
|
+
function readTagProperty(state) {
|
|
30158
|
+
var _position, isVerbatim = false, isNamed = false, tagHandle, tagName, ch;
|
|
30159
|
+
ch = state.input.charCodeAt(state.position);
|
|
30160
|
+
if (ch !== 33) return false;
|
|
30161
|
+
if (state.tag !== null) {
|
|
30162
|
+
throwError(state, "duplication of a tag property");
|
|
30163
|
+
}
|
|
30164
|
+
ch = state.input.charCodeAt(++state.position);
|
|
30165
|
+
if (ch === 60) {
|
|
30166
|
+
isVerbatim = true;
|
|
30167
|
+
ch = state.input.charCodeAt(++state.position);
|
|
30168
|
+
} else if (ch === 33) {
|
|
30169
|
+
isNamed = true;
|
|
30170
|
+
tagHandle = "!!";
|
|
30171
|
+
ch = state.input.charCodeAt(++state.position);
|
|
30172
|
+
} else {
|
|
30173
|
+
tagHandle = "!";
|
|
30174
|
+
}
|
|
30175
|
+
_position = state.position;
|
|
30176
|
+
if (isVerbatim) {
|
|
30177
|
+
do {
|
|
30178
|
+
ch = state.input.charCodeAt(++state.position);
|
|
30179
|
+
} while (ch !== 0 && ch !== 62);
|
|
30180
|
+
if (state.position < state.length) {
|
|
30181
|
+
tagName = state.input.slice(_position, state.position);
|
|
30182
|
+
ch = state.input.charCodeAt(++state.position);
|
|
30183
|
+
} else {
|
|
30184
|
+
throwError(state, "unexpected end of the stream within a verbatim tag");
|
|
30185
|
+
}
|
|
30186
|
+
} else {
|
|
30187
|
+
while (ch !== 0 && !is_WS_OR_EOL(ch)) {
|
|
30188
|
+
if (ch === 33) {
|
|
30189
|
+
if (!isNamed) {
|
|
30190
|
+
tagHandle = state.input.slice(_position - 1, state.position + 1);
|
|
30191
|
+
if (!PATTERN_TAG_HANDLE.test(tagHandle)) {
|
|
30192
|
+
throwError(state, "named tag handle cannot contain such characters");
|
|
30193
|
+
}
|
|
30194
|
+
isNamed = true;
|
|
30195
|
+
_position = state.position + 1;
|
|
30196
|
+
} else {
|
|
30197
|
+
throwError(state, "tag suffix cannot contain exclamation marks");
|
|
30198
|
+
}
|
|
30199
|
+
}
|
|
30200
|
+
ch = state.input.charCodeAt(++state.position);
|
|
30201
|
+
}
|
|
30202
|
+
tagName = state.input.slice(_position, state.position);
|
|
30203
|
+
if (PATTERN_FLOW_INDICATORS.test(tagName)) {
|
|
30204
|
+
throwError(state, "tag suffix cannot contain flow indicator characters");
|
|
30205
|
+
}
|
|
30206
|
+
}
|
|
30207
|
+
if (tagName && !PATTERN_TAG_URI.test(tagName)) {
|
|
30208
|
+
throwError(state, "tag name cannot contain such characters: " + tagName);
|
|
30209
|
+
}
|
|
30210
|
+
try {
|
|
30211
|
+
tagName = decodeURIComponent(tagName);
|
|
30212
|
+
} catch (err) {
|
|
30213
|
+
throwError(state, "tag name is malformed: " + tagName);
|
|
30214
|
+
}
|
|
30215
|
+
if (isVerbatim) {
|
|
30216
|
+
state.tag = tagName;
|
|
30217
|
+
} else if (_hasOwnProperty.call(state.tagMap, tagHandle)) {
|
|
30218
|
+
state.tag = state.tagMap[tagHandle] + tagName;
|
|
30219
|
+
} else if (tagHandle === "!") {
|
|
30220
|
+
state.tag = "!" + tagName;
|
|
30221
|
+
} else if (tagHandle === "!!") {
|
|
30222
|
+
state.tag = "tag:yaml.org,2002:" + tagName;
|
|
30223
|
+
} else {
|
|
30224
|
+
throwError(state, 'undeclared tag handle "' + tagHandle + '"');
|
|
30225
|
+
}
|
|
30226
|
+
return true;
|
|
30227
|
+
}
|
|
30228
|
+
function readAnchorProperty(state) {
|
|
30229
|
+
var _position, ch;
|
|
30230
|
+
ch = state.input.charCodeAt(state.position);
|
|
30231
|
+
if (ch !== 38) return false;
|
|
30232
|
+
if (state.anchor !== null) {
|
|
30233
|
+
throwError(state, "duplication of an anchor property");
|
|
30234
|
+
}
|
|
30235
|
+
ch = state.input.charCodeAt(++state.position);
|
|
30236
|
+
_position = state.position;
|
|
30237
|
+
while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {
|
|
30238
|
+
ch = state.input.charCodeAt(++state.position);
|
|
30239
|
+
}
|
|
30240
|
+
if (state.position === _position) {
|
|
30241
|
+
throwError(state, "name of an anchor node must contain at least one character");
|
|
30242
|
+
}
|
|
30243
|
+
state.anchor = state.input.slice(_position, state.position);
|
|
30244
|
+
return true;
|
|
30245
|
+
}
|
|
30246
|
+
function readAlias(state) {
|
|
30247
|
+
var _position, alias, ch;
|
|
30248
|
+
ch = state.input.charCodeAt(state.position);
|
|
30249
|
+
if (ch !== 42) return false;
|
|
30250
|
+
ch = state.input.charCodeAt(++state.position);
|
|
30251
|
+
_position = state.position;
|
|
30252
|
+
while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {
|
|
30253
|
+
ch = state.input.charCodeAt(++state.position);
|
|
30254
|
+
}
|
|
30255
|
+
if (state.position === _position) {
|
|
30256
|
+
throwError(state, "name of an alias node must contain at least one character");
|
|
30257
|
+
}
|
|
30258
|
+
alias = state.input.slice(_position, state.position);
|
|
30259
|
+
if (!_hasOwnProperty.call(state.anchorMap, alias)) {
|
|
30260
|
+
throwError(state, 'unidentified alias "' + alias + '"');
|
|
30261
|
+
}
|
|
30262
|
+
state.result = state.anchorMap[alias];
|
|
30263
|
+
skipSeparationSpace(state, true, -1);
|
|
30264
|
+
return true;
|
|
30265
|
+
}
|
|
30266
|
+
function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact) {
|
|
30267
|
+
var allowBlockStyles, allowBlockScalars, allowBlockCollections, indentStatus = 1, atNewLine = false, hasContent = false, typeIndex, typeQuantity, typeList, type, flowIndent, blockIndent;
|
|
30268
|
+
if (state.listener !== null) {
|
|
30269
|
+
state.listener("open", state);
|
|
30270
|
+
}
|
|
30271
|
+
state.tag = null;
|
|
30272
|
+
state.anchor = null;
|
|
30273
|
+
state.kind = null;
|
|
30274
|
+
state.result = null;
|
|
30275
|
+
allowBlockStyles = allowBlockScalars = allowBlockCollections = CONTEXT_BLOCK_OUT === nodeContext || CONTEXT_BLOCK_IN === nodeContext;
|
|
30276
|
+
if (allowToSeek) {
|
|
30277
|
+
if (skipSeparationSpace(state, true, -1)) {
|
|
30278
|
+
atNewLine = true;
|
|
30279
|
+
if (state.lineIndent > parentIndent) {
|
|
30280
|
+
indentStatus = 1;
|
|
30281
|
+
} else if (state.lineIndent === parentIndent) {
|
|
30282
|
+
indentStatus = 0;
|
|
30283
|
+
} else if (state.lineIndent < parentIndent) {
|
|
30284
|
+
indentStatus = -1;
|
|
30285
|
+
}
|
|
30286
|
+
}
|
|
30287
|
+
}
|
|
30288
|
+
if (indentStatus === 1) {
|
|
30289
|
+
while (readTagProperty(state) || readAnchorProperty(state)) {
|
|
30290
|
+
if (skipSeparationSpace(state, true, -1)) {
|
|
30291
|
+
atNewLine = true;
|
|
30292
|
+
allowBlockCollections = allowBlockStyles;
|
|
30293
|
+
if (state.lineIndent > parentIndent) {
|
|
30294
|
+
indentStatus = 1;
|
|
30295
|
+
} else if (state.lineIndent === parentIndent) {
|
|
30296
|
+
indentStatus = 0;
|
|
30297
|
+
} else if (state.lineIndent < parentIndent) {
|
|
30298
|
+
indentStatus = -1;
|
|
30299
|
+
}
|
|
30300
|
+
} else {
|
|
30301
|
+
allowBlockCollections = false;
|
|
30302
|
+
}
|
|
30303
|
+
}
|
|
30304
|
+
}
|
|
30305
|
+
if (allowBlockCollections) {
|
|
30306
|
+
allowBlockCollections = atNewLine || allowCompact;
|
|
30307
|
+
}
|
|
30308
|
+
if (indentStatus === 1 || CONTEXT_BLOCK_OUT === nodeContext) {
|
|
30309
|
+
if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) {
|
|
30310
|
+
flowIndent = parentIndent;
|
|
30311
|
+
} else {
|
|
30312
|
+
flowIndent = parentIndent + 1;
|
|
30313
|
+
}
|
|
30314
|
+
blockIndent = state.position - state.lineStart;
|
|
30315
|
+
if (indentStatus === 1) {
|
|
30316
|
+
if (allowBlockCollections && (readBlockSequence(state, blockIndent) || readBlockMapping(state, blockIndent, flowIndent)) || readFlowCollection(state, flowIndent)) {
|
|
30317
|
+
hasContent = true;
|
|
30318
|
+
} else {
|
|
30319
|
+
if (allowBlockScalars && readBlockScalar(state, flowIndent) || readSingleQuotedScalar(state, flowIndent) || readDoubleQuotedScalar(state, flowIndent)) {
|
|
30320
|
+
hasContent = true;
|
|
30321
|
+
} else if (readAlias(state)) {
|
|
30322
|
+
hasContent = true;
|
|
30323
|
+
if (state.tag !== null || state.anchor !== null) {
|
|
30324
|
+
throwError(state, "alias node should not have any properties");
|
|
30325
|
+
}
|
|
30326
|
+
} else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) {
|
|
30327
|
+
hasContent = true;
|
|
30328
|
+
if (state.tag === null) {
|
|
30329
|
+
state.tag = "?";
|
|
30330
|
+
}
|
|
30331
|
+
}
|
|
30332
|
+
if (state.anchor !== null) {
|
|
30333
|
+
state.anchorMap[state.anchor] = state.result;
|
|
30334
|
+
}
|
|
30335
|
+
}
|
|
30336
|
+
} else if (indentStatus === 0) {
|
|
30337
|
+
hasContent = allowBlockCollections && readBlockSequence(state, blockIndent);
|
|
30338
|
+
}
|
|
30339
|
+
}
|
|
30340
|
+
if (state.tag === null) {
|
|
30341
|
+
if (state.anchor !== null) {
|
|
30342
|
+
state.anchorMap[state.anchor] = state.result;
|
|
30343
|
+
}
|
|
30344
|
+
} else if (state.tag === "?") {
|
|
30345
|
+
if (state.result !== null && state.kind !== "scalar") {
|
|
30346
|
+
throwError(state, 'unacceptable node kind for !<?> tag; it should be "scalar", not "' + state.kind + '"');
|
|
30347
|
+
}
|
|
30348
|
+
for (typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) {
|
|
30349
|
+
type = state.implicitTypes[typeIndex];
|
|
30350
|
+
if (type.resolve(state.result)) {
|
|
30351
|
+
state.result = type.construct(state.result);
|
|
30352
|
+
state.tag = type.tag;
|
|
30353
|
+
if (state.anchor !== null) {
|
|
30354
|
+
state.anchorMap[state.anchor] = state.result;
|
|
30355
|
+
}
|
|
30356
|
+
break;
|
|
30357
|
+
}
|
|
30358
|
+
}
|
|
30359
|
+
} else if (state.tag !== "!") {
|
|
30360
|
+
if (_hasOwnProperty.call(state.typeMap[state.kind || "fallback"], state.tag)) {
|
|
30361
|
+
type = state.typeMap[state.kind || "fallback"][state.tag];
|
|
30362
|
+
} else {
|
|
30363
|
+
type = null;
|
|
30364
|
+
typeList = state.typeMap.multi[state.kind || "fallback"];
|
|
30365
|
+
for (typeIndex = 0, typeQuantity = typeList.length; typeIndex < typeQuantity; typeIndex += 1) {
|
|
30366
|
+
if (state.tag.slice(0, typeList[typeIndex].tag.length) === typeList[typeIndex].tag) {
|
|
30367
|
+
type = typeList[typeIndex];
|
|
30368
|
+
break;
|
|
30369
|
+
}
|
|
30370
|
+
}
|
|
30371
|
+
}
|
|
30372
|
+
if (!type) {
|
|
30373
|
+
throwError(state, "unknown tag !<" + state.tag + ">");
|
|
30374
|
+
}
|
|
30375
|
+
if (state.result !== null && type.kind !== state.kind) {
|
|
30376
|
+
throwError(state, "unacceptable node kind for !<" + state.tag + '> tag; it should be "' + type.kind + '", not "' + state.kind + '"');
|
|
30377
|
+
}
|
|
30378
|
+
if (!type.resolve(state.result, state.tag)) {
|
|
30379
|
+
throwError(state, "cannot resolve a node with !<" + state.tag + "> explicit tag");
|
|
30380
|
+
} else {
|
|
30381
|
+
state.result = type.construct(state.result, state.tag);
|
|
30382
|
+
if (state.anchor !== null) {
|
|
30383
|
+
state.anchorMap[state.anchor] = state.result;
|
|
30384
|
+
}
|
|
30385
|
+
}
|
|
30386
|
+
}
|
|
30387
|
+
if (state.listener !== null) {
|
|
30388
|
+
state.listener("close", state);
|
|
30389
|
+
}
|
|
30390
|
+
return state.tag !== null || state.anchor !== null || hasContent;
|
|
30391
|
+
}
|
|
30392
|
+
function readDocument(state) {
|
|
30393
|
+
var documentStart = state.position, _position, directiveName, directiveArgs, hasDirectives = false, ch;
|
|
30394
|
+
state.version = null;
|
|
30395
|
+
state.checkLineBreaks = state.legacy;
|
|
30396
|
+
state.tagMap = /* @__PURE__ */ Object.create(null);
|
|
30397
|
+
state.anchorMap = /* @__PURE__ */ Object.create(null);
|
|
30398
|
+
while ((ch = state.input.charCodeAt(state.position)) !== 0) {
|
|
30399
|
+
skipSeparationSpace(state, true, -1);
|
|
30400
|
+
ch = state.input.charCodeAt(state.position);
|
|
30401
|
+
if (state.lineIndent > 0 || ch !== 37) {
|
|
30402
|
+
break;
|
|
30403
|
+
}
|
|
30404
|
+
hasDirectives = true;
|
|
30405
|
+
ch = state.input.charCodeAt(++state.position);
|
|
30406
|
+
_position = state.position;
|
|
30407
|
+
while (ch !== 0 && !is_WS_OR_EOL(ch)) {
|
|
30408
|
+
ch = state.input.charCodeAt(++state.position);
|
|
30409
|
+
}
|
|
30410
|
+
directiveName = state.input.slice(_position, state.position);
|
|
30411
|
+
directiveArgs = [];
|
|
30412
|
+
if (directiveName.length < 1) {
|
|
30413
|
+
throwError(state, "directive name must not be less than one character in length");
|
|
30414
|
+
}
|
|
30415
|
+
while (ch !== 0) {
|
|
30416
|
+
while (is_WHITE_SPACE(ch)) {
|
|
30417
|
+
ch = state.input.charCodeAt(++state.position);
|
|
30418
|
+
}
|
|
30419
|
+
if (ch === 35) {
|
|
30420
|
+
do {
|
|
30421
|
+
ch = state.input.charCodeAt(++state.position);
|
|
30422
|
+
} while (ch !== 0 && !is_EOL(ch));
|
|
30423
|
+
break;
|
|
30424
|
+
}
|
|
30425
|
+
if (is_EOL(ch)) break;
|
|
30426
|
+
_position = state.position;
|
|
30427
|
+
while (ch !== 0 && !is_WS_OR_EOL(ch)) {
|
|
30428
|
+
ch = state.input.charCodeAt(++state.position);
|
|
30429
|
+
}
|
|
30430
|
+
directiveArgs.push(state.input.slice(_position, state.position));
|
|
30431
|
+
}
|
|
30432
|
+
if (ch !== 0) readLineBreak(state);
|
|
30433
|
+
if (_hasOwnProperty.call(directiveHandlers, directiveName)) {
|
|
30434
|
+
directiveHandlers[directiveName](state, directiveName, directiveArgs);
|
|
30435
|
+
} else {
|
|
30436
|
+
throwWarning(state, 'unknown document directive "' + directiveName + '"');
|
|
30437
|
+
}
|
|
30438
|
+
}
|
|
30439
|
+
skipSeparationSpace(state, true, -1);
|
|
30440
|
+
if (state.lineIndent === 0 && state.input.charCodeAt(state.position) === 45 && state.input.charCodeAt(state.position + 1) === 45 && state.input.charCodeAt(state.position + 2) === 45) {
|
|
30441
|
+
state.position += 3;
|
|
30442
|
+
skipSeparationSpace(state, true, -1);
|
|
30443
|
+
} else if (hasDirectives) {
|
|
30444
|
+
throwError(state, "directives end mark is expected");
|
|
30445
|
+
}
|
|
30446
|
+
composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true);
|
|
30447
|
+
skipSeparationSpace(state, true, -1);
|
|
30448
|
+
if (state.checkLineBreaks && PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) {
|
|
30449
|
+
throwWarning(state, "non-ASCII line breaks are interpreted as content");
|
|
30450
|
+
}
|
|
30451
|
+
state.documents.push(state.result);
|
|
30452
|
+
if (state.position === state.lineStart && testDocumentSeparator(state)) {
|
|
30453
|
+
if (state.input.charCodeAt(state.position) === 46) {
|
|
30454
|
+
state.position += 3;
|
|
30455
|
+
skipSeparationSpace(state, true, -1);
|
|
30456
|
+
}
|
|
30457
|
+
return;
|
|
30458
|
+
}
|
|
30459
|
+
if (state.position < state.length - 1) {
|
|
30460
|
+
throwError(state, "end of the stream or a document separator is expected");
|
|
30461
|
+
} else {
|
|
30462
|
+
return;
|
|
30463
|
+
}
|
|
30464
|
+
}
|
|
30465
|
+
function loadDocuments(input, options) {
|
|
30466
|
+
input = String(input);
|
|
30467
|
+
options = options || {};
|
|
30468
|
+
if (input.length !== 0) {
|
|
30469
|
+
if (input.charCodeAt(input.length - 1) !== 10 && input.charCodeAt(input.length - 1) !== 13) {
|
|
30470
|
+
input += "\n";
|
|
30471
|
+
}
|
|
30472
|
+
if (input.charCodeAt(0) === 65279) {
|
|
30473
|
+
input = input.slice(1);
|
|
30474
|
+
}
|
|
30475
|
+
}
|
|
30476
|
+
var state = new State(input, options);
|
|
30477
|
+
var nullpos = input.indexOf("\0");
|
|
30478
|
+
if (nullpos !== -1) {
|
|
30479
|
+
state.position = nullpos;
|
|
30480
|
+
throwError(state, "null byte is not allowed in input");
|
|
30481
|
+
}
|
|
30482
|
+
state.input += "\0";
|
|
30483
|
+
while (state.input.charCodeAt(state.position) === 32) {
|
|
30484
|
+
state.lineIndent += 1;
|
|
30485
|
+
state.position += 1;
|
|
30486
|
+
}
|
|
30487
|
+
while (state.position < state.length - 1) {
|
|
30488
|
+
readDocument(state);
|
|
30489
|
+
}
|
|
30490
|
+
return state.documents;
|
|
30491
|
+
}
|
|
30492
|
+
function loadAll(input, iterator, options) {
|
|
30493
|
+
if (iterator !== null && typeof iterator === "object" && typeof options === "undefined") {
|
|
30494
|
+
options = iterator;
|
|
30495
|
+
iterator = null;
|
|
30496
|
+
}
|
|
30497
|
+
var documents = loadDocuments(input, options);
|
|
30498
|
+
if (typeof iterator !== "function") {
|
|
30499
|
+
return documents;
|
|
30500
|
+
}
|
|
30501
|
+
for (var index = 0, length = documents.length; index < length; index += 1) {
|
|
30502
|
+
iterator(documents[index]);
|
|
30503
|
+
}
|
|
30504
|
+
}
|
|
30505
|
+
function load(input, options) {
|
|
30506
|
+
var documents = loadDocuments(input, options);
|
|
30507
|
+
if (documents.length === 0) {
|
|
30508
|
+
return void 0;
|
|
30509
|
+
} else if (documents.length === 1) {
|
|
30510
|
+
return documents[0];
|
|
30511
|
+
}
|
|
30512
|
+
throw new YAMLException("expected a single document in the stream, but found more");
|
|
30513
|
+
}
|
|
30514
|
+
module2.exports.loadAll = loadAll;
|
|
30515
|
+
module2.exports.load = load;
|
|
30516
|
+
}
|
|
30517
|
+
});
|
|
30518
|
+
|
|
30519
|
+
// ../../node_modules/js-yaml/lib/dumper.js
|
|
30520
|
+
var require_dumper = __commonJS({
|
|
30521
|
+
"../../node_modules/js-yaml/lib/dumper.js"(exports2, module2) {
|
|
30522
|
+
"use strict";
|
|
30523
|
+
var common = require_common();
|
|
30524
|
+
var YAMLException = require_exception();
|
|
30525
|
+
var DEFAULT_SCHEMA = require_default();
|
|
30526
|
+
var _toString = Object.prototype.toString;
|
|
30527
|
+
var _hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
30528
|
+
var CHAR_BOM = 65279;
|
|
30529
|
+
var CHAR_TAB = 9;
|
|
30530
|
+
var CHAR_LINE_FEED = 10;
|
|
30531
|
+
var CHAR_CARRIAGE_RETURN = 13;
|
|
30532
|
+
var CHAR_SPACE = 32;
|
|
30533
|
+
var CHAR_EXCLAMATION = 33;
|
|
30534
|
+
var CHAR_DOUBLE_QUOTE = 34;
|
|
30535
|
+
var CHAR_SHARP = 35;
|
|
30536
|
+
var CHAR_PERCENT = 37;
|
|
30537
|
+
var CHAR_AMPERSAND = 38;
|
|
30538
|
+
var CHAR_SINGLE_QUOTE = 39;
|
|
30539
|
+
var CHAR_ASTERISK = 42;
|
|
30540
|
+
var CHAR_COMMA = 44;
|
|
30541
|
+
var CHAR_MINUS = 45;
|
|
30542
|
+
var CHAR_COLON = 58;
|
|
30543
|
+
var CHAR_EQUALS = 61;
|
|
30544
|
+
var CHAR_GREATER_THAN = 62;
|
|
30545
|
+
var CHAR_QUESTION = 63;
|
|
30546
|
+
var CHAR_COMMERCIAL_AT = 64;
|
|
30547
|
+
var CHAR_LEFT_SQUARE_BRACKET = 91;
|
|
30548
|
+
var CHAR_RIGHT_SQUARE_BRACKET = 93;
|
|
30549
|
+
var CHAR_GRAVE_ACCENT = 96;
|
|
30550
|
+
var CHAR_LEFT_CURLY_BRACKET = 123;
|
|
30551
|
+
var CHAR_VERTICAL_LINE = 124;
|
|
30552
|
+
var CHAR_RIGHT_CURLY_BRACKET = 125;
|
|
30553
|
+
var ESCAPE_SEQUENCES = {};
|
|
30554
|
+
ESCAPE_SEQUENCES[0] = "\\0";
|
|
30555
|
+
ESCAPE_SEQUENCES[7] = "\\a";
|
|
30556
|
+
ESCAPE_SEQUENCES[8] = "\\b";
|
|
30557
|
+
ESCAPE_SEQUENCES[9] = "\\t";
|
|
30558
|
+
ESCAPE_SEQUENCES[10] = "\\n";
|
|
30559
|
+
ESCAPE_SEQUENCES[11] = "\\v";
|
|
30560
|
+
ESCAPE_SEQUENCES[12] = "\\f";
|
|
30561
|
+
ESCAPE_SEQUENCES[13] = "\\r";
|
|
30562
|
+
ESCAPE_SEQUENCES[27] = "\\e";
|
|
30563
|
+
ESCAPE_SEQUENCES[34] = '\\"';
|
|
30564
|
+
ESCAPE_SEQUENCES[92] = "\\\\";
|
|
30565
|
+
ESCAPE_SEQUENCES[133] = "\\N";
|
|
30566
|
+
ESCAPE_SEQUENCES[160] = "\\_";
|
|
30567
|
+
ESCAPE_SEQUENCES[8232] = "\\L";
|
|
30568
|
+
ESCAPE_SEQUENCES[8233] = "\\P";
|
|
30569
|
+
var DEPRECATED_BOOLEANS_SYNTAX = [
|
|
30570
|
+
"y",
|
|
30571
|
+
"Y",
|
|
30572
|
+
"yes",
|
|
30573
|
+
"Yes",
|
|
30574
|
+
"YES",
|
|
30575
|
+
"on",
|
|
30576
|
+
"On",
|
|
30577
|
+
"ON",
|
|
30578
|
+
"n",
|
|
30579
|
+
"N",
|
|
30580
|
+
"no",
|
|
30581
|
+
"No",
|
|
30582
|
+
"NO",
|
|
30583
|
+
"off",
|
|
30584
|
+
"Off",
|
|
30585
|
+
"OFF"
|
|
30586
|
+
];
|
|
30587
|
+
var DEPRECATED_BASE60_SYNTAX = /^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;
|
|
30588
|
+
function compileStyleMap(schema, map2) {
|
|
30589
|
+
var result, keys, index, length, tag, style, type;
|
|
30590
|
+
if (map2 === null) return {};
|
|
30591
|
+
result = {};
|
|
30592
|
+
keys = Object.keys(map2);
|
|
30593
|
+
for (index = 0, length = keys.length; index < length; index += 1) {
|
|
30594
|
+
tag = keys[index];
|
|
30595
|
+
style = String(map2[tag]);
|
|
30596
|
+
if (tag.slice(0, 2) === "!!") {
|
|
30597
|
+
tag = "tag:yaml.org,2002:" + tag.slice(2);
|
|
30598
|
+
}
|
|
30599
|
+
type = schema.compiledTypeMap["fallback"][tag];
|
|
30600
|
+
if (type && _hasOwnProperty.call(type.styleAliases, style)) {
|
|
30601
|
+
style = type.styleAliases[style];
|
|
30602
|
+
}
|
|
30603
|
+
result[tag] = style;
|
|
30604
|
+
}
|
|
30605
|
+
return result;
|
|
30606
|
+
}
|
|
30607
|
+
function encodeHex(character) {
|
|
30608
|
+
var string4, handle, length;
|
|
30609
|
+
string4 = character.toString(16).toUpperCase();
|
|
30610
|
+
if (character <= 255) {
|
|
30611
|
+
handle = "x";
|
|
30612
|
+
length = 2;
|
|
30613
|
+
} else if (character <= 65535) {
|
|
30614
|
+
handle = "u";
|
|
30615
|
+
length = 4;
|
|
30616
|
+
} else if (character <= 4294967295) {
|
|
30617
|
+
handle = "U";
|
|
30618
|
+
length = 8;
|
|
30619
|
+
} else {
|
|
30620
|
+
throw new YAMLException("code point within a string may not be greater than 0xFFFFFFFF");
|
|
30621
|
+
}
|
|
30622
|
+
return "\\" + handle + common.repeat("0", length - string4.length) + string4;
|
|
30623
|
+
}
|
|
30624
|
+
var QUOTING_TYPE_SINGLE = 1;
|
|
30625
|
+
var QUOTING_TYPE_DOUBLE = 2;
|
|
30626
|
+
function State(options) {
|
|
30627
|
+
this.schema = options["schema"] || DEFAULT_SCHEMA;
|
|
30628
|
+
this.indent = Math.max(1, options["indent"] || 2);
|
|
30629
|
+
this.noArrayIndent = options["noArrayIndent"] || false;
|
|
30630
|
+
this.skipInvalid = options["skipInvalid"] || false;
|
|
30631
|
+
this.flowLevel = common.isNothing(options["flowLevel"]) ? -1 : options["flowLevel"];
|
|
30632
|
+
this.styleMap = compileStyleMap(this.schema, options["styles"] || null);
|
|
30633
|
+
this.sortKeys = options["sortKeys"] || false;
|
|
30634
|
+
this.lineWidth = options["lineWidth"] || 80;
|
|
30635
|
+
this.noRefs = options["noRefs"] || false;
|
|
30636
|
+
this.noCompatMode = options["noCompatMode"] || false;
|
|
30637
|
+
this.condenseFlow = options["condenseFlow"] || false;
|
|
30638
|
+
this.quotingType = options["quotingType"] === '"' ? QUOTING_TYPE_DOUBLE : QUOTING_TYPE_SINGLE;
|
|
30639
|
+
this.forceQuotes = options["forceQuotes"] || false;
|
|
30640
|
+
this.replacer = typeof options["replacer"] === "function" ? options["replacer"] : null;
|
|
30641
|
+
this.implicitTypes = this.schema.compiledImplicit;
|
|
30642
|
+
this.explicitTypes = this.schema.compiledExplicit;
|
|
30643
|
+
this.tag = null;
|
|
30644
|
+
this.result = "";
|
|
30645
|
+
this.duplicates = [];
|
|
30646
|
+
this.usedDuplicates = null;
|
|
30647
|
+
}
|
|
30648
|
+
function indentString(string4, spaces) {
|
|
30649
|
+
var ind = common.repeat(" ", spaces), position = 0, next = -1, result = "", line, length = string4.length;
|
|
30650
|
+
while (position < length) {
|
|
30651
|
+
next = string4.indexOf("\n", position);
|
|
30652
|
+
if (next === -1) {
|
|
30653
|
+
line = string4.slice(position);
|
|
30654
|
+
position = length;
|
|
30655
|
+
} else {
|
|
30656
|
+
line = string4.slice(position, next + 1);
|
|
30657
|
+
position = next + 1;
|
|
30658
|
+
}
|
|
30659
|
+
if (line.length && line !== "\n") result += ind;
|
|
30660
|
+
result += line;
|
|
30661
|
+
}
|
|
30662
|
+
return result;
|
|
30663
|
+
}
|
|
30664
|
+
function generateNextLine(state, level) {
|
|
30665
|
+
return "\n" + common.repeat(" ", state.indent * level);
|
|
30666
|
+
}
|
|
30667
|
+
function testImplicitResolving(state, str) {
|
|
30668
|
+
var index, length, type;
|
|
30669
|
+
for (index = 0, length = state.implicitTypes.length; index < length; index += 1) {
|
|
30670
|
+
type = state.implicitTypes[index];
|
|
30671
|
+
if (type.resolve(str)) {
|
|
30672
|
+
return true;
|
|
30673
|
+
}
|
|
30674
|
+
}
|
|
30675
|
+
return false;
|
|
30676
|
+
}
|
|
30677
|
+
function isWhitespace(c) {
|
|
30678
|
+
return c === CHAR_SPACE || c === CHAR_TAB;
|
|
30679
|
+
}
|
|
30680
|
+
function isPrintable(c) {
|
|
30681
|
+
return 32 <= c && c <= 126 || 161 <= c && c <= 55295 && c !== 8232 && c !== 8233 || 57344 <= c && c <= 65533 && c !== CHAR_BOM || 65536 <= c && c <= 1114111;
|
|
30682
|
+
}
|
|
30683
|
+
function isNsCharOrWhitespace(c) {
|
|
30684
|
+
return isPrintable(c) && c !== CHAR_BOM && c !== CHAR_CARRIAGE_RETURN && c !== CHAR_LINE_FEED;
|
|
30685
|
+
}
|
|
30686
|
+
function isPlainSafe(c, prev, inblock) {
|
|
30687
|
+
var cIsNsCharOrWhitespace = isNsCharOrWhitespace(c);
|
|
30688
|
+
var cIsNsChar = cIsNsCharOrWhitespace && !isWhitespace(c);
|
|
30689
|
+
return (
|
|
30690
|
+
// ns-plain-safe
|
|
30691
|
+
(inblock ? (
|
|
30692
|
+
// c = flow-in
|
|
30693
|
+
cIsNsCharOrWhitespace
|
|
30694
|
+
) : cIsNsCharOrWhitespace && c !== CHAR_COMMA && c !== CHAR_LEFT_SQUARE_BRACKET && c !== CHAR_RIGHT_SQUARE_BRACKET && c !== CHAR_LEFT_CURLY_BRACKET && c !== CHAR_RIGHT_CURLY_BRACKET) && c !== CHAR_SHARP && !(prev === CHAR_COLON && !cIsNsChar) || isNsCharOrWhitespace(prev) && !isWhitespace(prev) && c === CHAR_SHARP || prev === CHAR_COLON && cIsNsChar
|
|
30695
|
+
);
|
|
30696
|
+
}
|
|
30697
|
+
function isPlainSafeFirst(c) {
|
|
30698
|
+
return isPrintable(c) && c !== CHAR_BOM && !isWhitespace(c) && c !== CHAR_MINUS && c !== CHAR_QUESTION && c !== CHAR_COLON && c !== CHAR_COMMA && c !== CHAR_LEFT_SQUARE_BRACKET && c !== CHAR_RIGHT_SQUARE_BRACKET && c !== CHAR_LEFT_CURLY_BRACKET && c !== CHAR_RIGHT_CURLY_BRACKET && c !== CHAR_SHARP && c !== CHAR_AMPERSAND && c !== CHAR_ASTERISK && c !== CHAR_EXCLAMATION && c !== CHAR_VERTICAL_LINE && c !== CHAR_EQUALS && c !== CHAR_GREATER_THAN && c !== CHAR_SINGLE_QUOTE && c !== CHAR_DOUBLE_QUOTE && c !== CHAR_PERCENT && c !== CHAR_COMMERCIAL_AT && c !== CHAR_GRAVE_ACCENT;
|
|
30699
|
+
}
|
|
30700
|
+
function isPlainSafeLast(c) {
|
|
30701
|
+
return !isWhitespace(c) && c !== CHAR_COLON;
|
|
30702
|
+
}
|
|
30703
|
+
function codePointAt(string4, pos) {
|
|
30704
|
+
var first = string4.charCodeAt(pos), second;
|
|
30705
|
+
if (first >= 55296 && first <= 56319 && pos + 1 < string4.length) {
|
|
30706
|
+
second = string4.charCodeAt(pos + 1);
|
|
30707
|
+
if (second >= 56320 && second <= 57343) {
|
|
30708
|
+
return (first - 55296) * 1024 + second - 56320 + 65536;
|
|
30709
|
+
}
|
|
30710
|
+
}
|
|
30711
|
+
return first;
|
|
30712
|
+
}
|
|
30713
|
+
function needIndentIndicator(string4) {
|
|
30714
|
+
var leadingSpaceRe = /^\n* /;
|
|
30715
|
+
return leadingSpaceRe.test(string4);
|
|
30716
|
+
}
|
|
30717
|
+
var STYLE_PLAIN = 1;
|
|
30718
|
+
var STYLE_SINGLE = 2;
|
|
30719
|
+
var STYLE_LITERAL = 3;
|
|
30720
|
+
var STYLE_FOLDED = 4;
|
|
30721
|
+
var STYLE_DOUBLE = 5;
|
|
30722
|
+
function chooseScalarStyle(string4, singleLineOnly, indentPerLevel, lineWidth, testAmbiguousType, quotingType, forceQuotes, inblock) {
|
|
30723
|
+
var i;
|
|
30724
|
+
var char = 0;
|
|
30725
|
+
var prevChar = null;
|
|
30726
|
+
var hasLineBreak = false;
|
|
30727
|
+
var hasFoldableLine = false;
|
|
30728
|
+
var shouldTrackWidth = lineWidth !== -1;
|
|
30729
|
+
var previousLineBreak = -1;
|
|
30730
|
+
var plain = isPlainSafeFirst(codePointAt(string4, 0)) && isPlainSafeLast(codePointAt(string4, string4.length - 1));
|
|
30731
|
+
if (singleLineOnly || forceQuotes) {
|
|
30732
|
+
for (i = 0; i < string4.length; char >= 65536 ? i += 2 : i++) {
|
|
30733
|
+
char = codePointAt(string4, i);
|
|
30734
|
+
if (!isPrintable(char)) {
|
|
30735
|
+
return STYLE_DOUBLE;
|
|
30736
|
+
}
|
|
30737
|
+
plain = plain && isPlainSafe(char, prevChar, inblock);
|
|
30738
|
+
prevChar = char;
|
|
30739
|
+
}
|
|
30740
|
+
} else {
|
|
30741
|
+
for (i = 0; i < string4.length; char >= 65536 ? i += 2 : i++) {
|
|
30742
|
+
char = codePointAt(string4, i);
|
|
30743
|
+
if (char === CHAR_LINE_FEED) {
|
|
30744
|
+
hasLineBreak = true;
|
|
30745
|
+
if (shouldTrackWidth) {
|
|
30746
|
+
hasFoldableLine = hasFoldableLine || // Foldable line = too long, and not more-indented.
|
|
30747
|
+
i - previousLineBreak - 1 > lineWidth && string4[previousLineBreak + 1] !== " ";
|
|
30748
|
+
previousLineBreak = i;
|
|
30749
|
+
}
|
|
30750
|
+
} else if (!isPrintable(char)) {
|
|
30751
|
+
return STYLE_DOUBLE;
|
|
30752
|
+
}
|
|
30753
|
+
plain = plain && isPlainSafe(char, prevChar, inblock);
|
|
30754
|
+
prevChar = char;
|
|
30755
|
+
}
|
|
30756
|
+
hasFoldableLine = hasFoldableLine || shouldTrackWidth && (i - previousLineBreak - 1 > lineWidth && string4[previousLineBreak + 1] !== " ");
|
|
30757
|
+
}
|
|
30758
|
+
if (!hasLineBreak && !hasFoldableLine) {
|
|
30759
|
+
if (plain && !forceQuotes && !testAmbiguousType(string4)) {
|
|
30760
|
+
return STYLE_PLAIN;
|
|
30761
|
+
}
|
|
30762
|
+
return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE;
|
|
30763
|
+
}
|
|
30764
|
+
if (indentPerLevel > 9 && needIndentIndicator(string4)) {
|
|
30765
|
+
return STYLE_DOUBLE;
|
|
30766
|
+
}
|
|
30767
|
+
if (!forceQuotes) {
|
|
30768
|
+
return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL;
|
|
30769
|
+
}
|
|
30770
|
+
return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE;
|
|
30771
|
+
}
|
|
30772
|
+
function writeScalar(state, string4, level, iskey, inblock) {
|
|
30773
|
+
state.dump = (function() {
|
|
30774
|
+
if (string4.length === 0) {
|
|
30775
|
+
return state.quotingType === QUOTING_TYPE_DOUBLE ? '""' : "''";
|
|
30776
|
+
}
|
|
30777
|
+
if (!state.noCompatMode) {
|
|
30778
|
+
if (DEPRECATED_BOOLEANS_SYNTAX.indexOf(string4) !== -1 || DEPRECATED_BASE60_SYNTAX.test(string4)) {
|
|
30779
|
+
return state.quotingType === QUOTING_TYPE_DOUBLE ? '"' + string4 + '"' : "'" + string4 + "'";
|
|
30780
|
+
}
|
|
30781
|
+
}
|
|
30782
|
+
var indent = state.indent * Math.max(1, level);
|
|
30783
|
+
var lineWidth = state.lineWidth === -1 ? -1 : Math.max(Math.min(state.lineWidth, 40), state.lineWidth - indent);
|
|
30784
|
+
var singleLineOnly = iskey || state.flowLevel > -1 && level >= state.flowLevel;
|
|
30785
|
+
function testAmbiguity(string5) {
|
|
30786
|
+
return testImplicitResolving(state, string5);
|
|
30787
|
+
}
|
|
30788
|
+
switch (chooseScalarStyle(
|
|
30789
|
+
string4,
|
|
30790
|
+
singleLineOnly,
|
|
30791
|
+
state.indent,
|
|
30792
|
+
lineWidth,
|
|
30793
|
+
testAmbiguity,
|
|
30794
|
+
state.quotingType,
|
|
30795
|
+
state.forceQuotes && !iskey,
|
|
30796
|
+
inblock
|
|
30797
|
+
)) {
|
|
30798
|
+
case STYLE_PLAIN:
|
|
30799
|
+
return string4;
|
|
30800
|
+
case STYLE_SINGLE:
|
|
30801
|
+
return "'" + string4.replace(/'/g, "''") + "'";
|
|
30802
|
+
case STYLE_LITERAL:
|
|
30803
|
+
return "|" + blockHeader(string4, state.indent) + dropEndingNewline(indentString(string4, indent));
|
|
30804
|
+
case STYLE_FOLDED:
|
|
30805
|
+
return ">" + blockHeader(string4, state.indent) + dropEndingNewline(indentString(foldString(string4, lineWidth), indent));
|
|
30806
|
+
case STYLE_DOUBLE:
|
|
30807
|
+
return '"' + escapeString(string4, lineWidth) + '"';
|
|
30808
|
+
default:
|
|
30809
|
+
throw new YAMLException("impossible error: invalid scalar style");
|
|
30810
|
+
}
|
|
30811
|
+
})();
|
|
30812
|
+
}
|
|
30813
|
+
function blockHeader(string4, indentPerLevel) {
|
|
30814
|
+
var indentIndicator = needIndentIndicator(string4) ? String(indentPerLevel) : "";
|
|
30815
|
+
var clip = string4[string4.length - 1] === "\n";
|
|
30816
|
+
var keep = clip && (string4[string4.length - 2] === "\n" || string4 === "\n");
|
|
30817
|
+
var chomp = keep ? "+" : clip ? "" : "-";
|
|
30818
|
+
return indentIndicator + chomp + "\n";
|
|
30819
|
+
}
|
|
30820
|
+
function dropEndingNewline(string4) {
|
|
30821
|
+
return string4[string4.length - 1] === "\n" ? string4.slice(0, -1) : string4;
|
|
30822
|
+
}
|
|
30823
|
+
function foldString(string4, width) {
|
|
30824
|
+
var lineRe = /(\n+)([^\n]*)/g;
|
|
30825
|
+
var result = (function() {
|
|
30826
|
+
var nextLF = string4.indexOf("\n");
|
|
30827
|
+
nextLF = nextLF !== -1 ? nextLF : string4.length;
|
|
30828
|
+
lineRe.lastIndex = nextLF;
|
|
30829
|
+
return foldLine(string4.slice(0, nextLF), width);
|
|
30830
|
+
})();
|
|
30831
|
+
var prevMoreIndented = string4[0] === "\n" || string4[0] === " ";
|
|
30832
|
+
var moreIndented;
|
|
30833
|
+
var match;
|
|
30834
|
+
while (match = lineRe.exec(string4)) {
|
|
30835
|
+
var prefix = match[1], line = match[2];
|
|
30836
|
+
moreIndented = line[0] === " ";
|
|
30837
|
+
result += prefix + (!prevMoreIndented && !moreIndented && line !== "" ? "\n" : "") + foldLine(line, width);
|
|
30838
|
+
prevMoreIndented = moreIndented;
|
|
30839
|
+
}
|
|
30840
|
+
return result;
|
|
30841
|
+
}
|
|
30842
|
+
function foldLine(line, width) {
|
|
30843
|
+
if (line === "" || line[0] === " ") return line;
|
|
30844
|
+
var breakRe = / [^ ]/g;
|
|
30845
|
+
var match;
|
|
30846
|
+
var start = 0, end, curr = 0, next = 0;
|
|
30847
|
+
var result = "";
|
|
30848
|
+
while (match = breakRe.exec(line)) {
|
|
30849
|
+
next = match.index;
|
|
30850
|
+
if (next - start > width) {
|
|
30851
|
+
end = curr > start ? curr : next;
|
|
30852
|
+
result += "\n" + line.slice(start, end);
|
|
30853
|
+
start = end + 1;
|
|
30854
|
+
}
|
|
30855
|
+
curr = next;
|
|
30856
|
+
}
|
|
30857
|
+
result += "\n";
|
|
30858
|
+
if (line.length - start > width && curr > start) {
|
|
30859
|
+
result += line.slice(start, curr) + "\n" + line.slice(curr + 1);
|
|
30860
|
+
} else {
|
|
30861
|
+
result += line.slice(start);
|
|
30862
|
+
}
|
|
30863
|
+
return result.slice(1);
|
|
30864
|
+
}
|
|
30865
|
+
function escapeString(string4) {
|
|
30866
|
+
var result = "";
|
|
30867
|
+
var char = 0;
|
|
30868
|
+
var escapeSeq;
|
|
30869
|
+
for (var i = 0; i < string4.length; char >= 65536 ? i += 2 : i++) {
|
|
30870
|
+
char = codePointAt(string4, i);
|
|
30871
|
+
escapeSeq = ESCAPE_SEQUENCES[char];
|
|
30872
|
+
if (!escapeSeq && isPrintable(char)) {
|
|
30873
|
+
result += string4[i];
|
|
30874
|
+
if (char >= 65536) result += string4[i + 1];
|
|
30875
|
+
} else {
|
|
30876
|
+
result += escapeSeq || encodeHex(char);
|
|
30877
|
+
}
|
|
30878
|
+
}
|
|
30879
|
+
return result;
|
|
30880
|
+
}
|
|
30881
|
+
function writeFlowSequence(state, level, object2) {
|
|
30882
|
+
var _result = "", _tag = state.tag, index, length, value;
|
|
30883
|
+
for (index = 0, length = object2.length; index < length; index += 1) {
|
|
30884
|
+
value = object2[index];
|
|
30885
|
+
if (state.replacer) {
|
|
30886
|
+
value = state.replacer.call(object2, String(index), value);
|
|
30887
|
+
}
|
|
30888
|
+
if (writeNode(state, level, value, false, false) || typeof value === "undefined" && writeNode(state, level, null, false, false)) {
|
|
30889
|
+
if (_result !== "") _result += "," + (!state.condenseFlow ? " " : "");
|
|
30890
|
+
_result += state.dump;
|
|
30891
|
+
}
|
|
30892
|
+
}
|
|
30893
|
+
state.tag = _tag;
|
|
30894
|
+
state.dump = "[" + _result + "]";
|
|
30895
|
+
}
|
|
30896
|
+
function writeBlockSequence(state, level, object2, compact) {
|
|
30897
|
+
var _result = "", _tag = state.tag, index, length, value;
|
|
30898
|
+
for (index = 0, length = object2.length; index < length; index += 1) {
|
|
30899
|
+
value = object2[index];
|
|
30900
|
+
if (state.replacer) {
|
|
30901
|
+
value = state.replacer.call(object2, String(index), value);
|
|
30902
|
+
}
|
|
30903
|
+
if (writeNode(state, level + 1, value, true, true, false, true) || typeof value === "undefined" && writeNode(state, level + 1, null, true, true, false, true)) {
|
|
30904
|
+
if (!compact || _result !== "") {
|
|
30905
|
+
_result += generateNextLine(state, level);
|
|
30906
|
+
}
|
|
30907
|
+
if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
|
|
30908
|
+
_result += "-";
|
|
30909
|
+
} else {
|
|
30910
|
+
_result += "- ";
|
|
30911
|
+
}
|
|
30912
|
+
_result += state.dump;
|
|
30913
|
+
}
|
|
30914
|
+
}
|
|
30915
|
+
state.tag = _tag;
|
|
30916
|
+
state.dump = _result || "[]";
|
|
30917
|
+
}
|
|
30918
|
+
function writeFlowMapping(state, level, object2) {
|
|
30919
|
+
var _result = "", _tag = state.tag, objectKeyList = Object.keys(object2), index, length, objectKey, objectValue, pairBuffer;
|
|
30920
|
+
for (index = 0, length = objectKeyList.length; index < length; index += 1) {
|
|
30921
|
+
pairBuffer = "";
|
|
30922
|
+
if (_result !== "") pairBuffer += ", ";
|
|
30923
|
+
if (state.condenseFlow) pairBuffer += '"';
|
|
30924
|
+
objectKey = objectKeyList[index];
|
|
30925
|
+
objectValue = object2[objectKey];
|
|
30926
|
+
if (state.replacer) {
|
|
30927
|
+
objectValue = state.replacer.call(object2, objectKey, objectValue);
|
|
30928
|
+
}
|
|
30929
|
+
if (!writeNode(state, level, objectKey, false, false)) {
|
|
30930
|
+
continue;
|
|
30931
|
+
}
|
|
30932
|
+
if (state.dump.length > 1024) pairBuffer += "? ";
|
|
30933
|
+
pairBuffer += state.dump + (state.condenseFlow ? '"' : "") + ":" + (state.condenseFlow ? "" : " ");
|
|
30934
|
+
if (!writeNode(state, level, objectValue, false, false)) {
|
|
30935
|
+
continue;
|
|
30936
|
+
}
|
|
30937
|
+
pairBuffer += state.dump;
|
|
30938
|
+
_result += pairBuffer;
|
|
30939
|
+
}
|
|
30940
|
+
state.tag = _tag;
|
|
30941
|
+
state.dump = "{" + _result + "}";
|
|
30942
|
+
}
|
|
30943
|
+
function writeBlockMapping(state, level, object2, compact) {
|
|
30944
|
+
var _result = "", _tag = state.tag, objectKeyList = Object.keys(object2), index, length, objectKey, objectValue, explicitPair, pairBuffer;
|
|
30945
|
+
if (state.sortKeys === true) {
|
|
30946
|
+
objectKeyList.sort();
|
|
30947
|
+
} else if (typeof state.sortKeys === "function") {
|
|
30948
|
+
objectKeyList.sort(state.sortKeys);
|
|
30949
|
+
} else if (state.sortKeys) {
|
|
30950
|
+
throw new YAMLException("sortKeys must be a boolean or a function");
|
|
30951
|
+
}
|
|
30952
|
+
for (index = 0, length = objectKeyList.length; index < length; index += 1) {
|
|
30953
|
+
pairBuffer = "";
|
|
30954
|
+
if (!compact || _result !== "") {
|
|
30955
|
+
pairBuffer += generateNextLine(state, level);
|
|
30956
|
+
}
|
|
30957
|
+
objectKey = objectKeyList[index];
|
|
30958
|
+
objectValue = object2[objectKey];
|
|
30959
|
+
if (state.replacer) {
|
|
30960
|
+
objectValue = state.replacer.call(object2, objectKey, objectValue);
|
|
30961
|
+
}
|
|
30962
|
+
if (!writeNode(state, level + 1, objectKey, true, true, true)) {
|
|
30963
|
+
continue;
|
|
30964
|
+
}
|
|
30965
|
+
explicitPair = state.tag !== null && state.tag !== "?" || state.dump && state.dump.length > 1024;
|
|
30966
|
+
if (explicitPair) {
|
|
30967
|
+
if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
|
|
30968
|
+
pairBuffer += "?";
|
|
30969
|
+
} else {
|
|
30970
|
+
pairBuffer += "? ";
|
|
30971
|
+
}
|
|
30972
|
+
}
|
|
30973
|
+
pairBuffer += state.dump;
|
|
30974
|
+
if (explicitPair) {
|
|
30975
|
+
pairBuffer += generateNextLine(state, level);
|
|
30976
|
+
}
|
|
30977
|
+
if (!writeNode(state, level + 1, objectValue, true, explicitPair)) {
|
|
30978
|
+
continue;
|
|
30979
|
+
}
|
|
30980
|
+
if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
|
|
30981
|
+
pairBuffer += ":";
|
|
30982
|
+
} else {
|
|
30983
|
+
pairBuffer += ": ";
|
|
30984
|
+
}
|
|
30985
|
+
pairBuffer += state.dump;
|
|
30986
|
+
_result += pairBuffer;
|
|
30987
|
+
}
|
|
30988
|
+
state.tag = _tag;
|
|
30989
|
+
state.dump = _result || "{}";
|
|
30990
|
+
}
|
|
30991
|
+
function detectType(state, object2, explicit) {
|
|
30992
|
+
var _result, typeList, index, length, type, style;
|
|
30993
|
+
typeList = explicit ? state.explicitTypes : state.implicitTypes;
|
|
30994
|
+
for (index = 0, length = typeList.length; index < length; index += 1) {
|
|
30995
|
+
type = typeList[index];
|
|
30996
|
+
if ((type.instanceOf || type.predicate) && (!type.instanceOf || typeof object2 === "object" && object2 instanceof type.instanceOf) && (!type.predicate || type.predicate(object2))) {
|
|
30997
|
+
if (explicit) {
|
|
30998
|
+
if (type.multi && type.representName) {
|
|
30999
|
+
state.tag = type.representName(object2);
|
|
31000
|
+
} else {
|
|
31001
|
+
state.tag = type.tag;
|
|
31002
|
+
}
|
|
31003
|
+
} else {
|
|
31004
|
+
state.tag = "?";
|
|
31005
|
+
}
|
|
31006
|
+
if (type.represent) {
|
|
31007
|
+
style = state.styleMap[type.tag] || type.defaultStyle;
|
|
31008
|
+
if (_toString.call(type.represent) === "[object Function]") {
|
|
31009
|
+
_result = type.represent(object2, style);
|
|
31010
|
+
} else if (_hasOwnProperty.call(type.represent, style)) {
|
|
31011
|
+
_result = type.represent[style](object2, style);
|
|
31012
|
+
} else {
|
|
31013
|
+
throw new YAMLException("!<" + type.tag + '> tag resolver accepts not "' + style + '" style');
|
|
31014
|
+
}
|
|
31015
|
+
state.dump = _result;
|
|
31016
|
+
}
|
|
31017
|
+
return true;
|
|
31018
|
+
}
|
|
31019
|
+
}
|
|
31020
|
+
return false;
|
|
31021
|
+
}
|
|
31022
|
+
function writeNode(state, level, object2, block, compact, iskey, isblockseq) {
|
|
31023
|
+
state.tag = null;
|
|
31024
|
+
state.dump = object2;
|
|
31025
|
+
if (!detectType(state, object2, false)) {
|
|
31026
|
+
detectType(state, object2, true);
|
|
31027
|
+
}
|
|
31028
|
+
var type = _toString.call(state.dump);
|
|
31029
|
+
var inblock = block;
|
|
31030
|
+
var tagStr;
|
|
31031
|
+
if (block) {
|
|
31032
|
+
block = state.flowLevel < 0 || state.flowLevel > level;
|
|
31033
|
+
}
|
|
31034
|
+
var objectOrArray = type === "[object Object]" || type === "[object Array]", duplicateIndex, duplicate;
|
|
31035
|
+
if (objectOrArray) {
|
|
31036
|
+
duplicateIndex = state.duplicates.indexOf(object2);
|
|
31037
|
+
duplicate = duplicateIndex !== -1;
|
|
31038
|
+
}
|
|
31039
|
+
if (state.tag !== null && state.tag !== "?" || duplicate || state.indent !== 2 && level > 0) {
|
|
31040
|
+
compact = false;
|
|
31041
|
+
}
|
|
31042
|
+
if (duplicate && state.usedDuplicates[duplicateIndex]) {
|
|
31043
|
+
state.dump = "*ref_" + duplicateIndex;
|
|
31044
|
+
} else {
|
|
31045
|
+
if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) {
|
|
31046
|
+
state.usedDuplicates[duplicateIndex] = true;
|
|
31047
|
+
}
|
|
31048
|
+
if (type === "[object Object]") {
|
|
31049
|
+
if (block && Object.keys(state.dump).length !== 0) {
|
|
31050
|
+
writeBlockMapping(state, level, state.dump, compact);
|
|
31051
|
+
if (duplicate) {
|
|
31052
|
+
state.dump = "&ref_" + duplicateIndex + state.dump;
|
|
31053
|
+
}
|
|
31054
|
+
} else {
|
|
31055
|
+
writeFlowMapping(state, level, state.dump);
|
|
31056
|
+
if (duplicate) {
|
|
31057
|
+
state.dump = "&ref_" + duplicateIndex + " " + state.dump;
|
|
31058
|
+
}
|
|
31059
|
+
}
|
|
31060
|
+
} else if (type === "[object Array]") {
|
|
31061
|
+
if (block && state.dump.length !== 0) {
|
|
31062
|
+
if (state.noArrayIndent && !isblockseq && level > 0) {
|
|
31063
|
+
writeBlockSequence(state, level - 1, state.dump, compact);
|
|
31064
|
+
} else {
|
|
31065
|
+
writeBlockSequence(state, level, state.dump, compact);
|
|
31066
|
+
}
|
|
31067
|
+
if (duplicate) {
|
|
31068
|
+
state.dump = "&ref_" + duplicateIndex + state.dump;
|
|
31069
|
+
}
|
|
31070
|
+
} else {
|
|
31071
|
+
writeFlowSequence(state, level, state.dump);
|
|
31072
|
+
if (duplicate) {
|
|
31073
|
+
state.dump = "&ref_" + duplicateIndex + " " + state.dump;
|
|
31074
|
+
}
|
|
31075
|
+
}
|
|
31076
|
+
} else if (type === "[object String]") {
|
|
31077
|
+
if (state.tag !== "?") {
|
|
31078
|
+
writeScalar(state, state.dump, level, iskey, inblock);
|
|
31079
|
+
}
|
|
31080
|
+
} else if (type === "[object Undefined]") {
|
|
31081
|
+
return false;
|
|
31082
|
+
} else {
|
|
31083
|
+
if (state.skipInvalid) return false;
|
|
31084
|
+
throw new YAMLException("unacceptable kind of an object to dump " + type);
|
|
31085
|
+
}
|
|
31086
|
+
if (state.tag !== null && state.tag !== "?") {
|
|
31087
|
+
tagStr = encodeURI(
|
|
31088
|
+
state.tag[0] === "!" ? state.tag.slice(1) : state.tag
|
|
31089
|
+
).replace(/!/g, "%21");
|
|
31090
|
+
if (state.tag[0] === "!") {
|
|
31091
|
+
tagStr = "!" + tagStr;
|
|
31092
|
+
} else if (tagStr.slice(0, 18) === "tag:yaml.org,2002:") {
|
|
31093
|
+
tagStr = "!!" + tagStr.slice(18);
|
|
31094
|
+
} else {
|
|
31095
|
+
tagStr = "!<" + tagStr + ">";
|
|
31096
|
+
}
|
|
31097
|
+
state.dump = tagStr + " " + state.dump;
|
|
31098
|
+
}
|
|
31099
|
+
}
|
|
31100
|
+
return true;
|
|
31101
|
+
}
|
|
31102
|
+
function getDuplicateReferences(object2, state) {
|
|
31103
|
+
var objects = [], duplicatesIndexes = [], index, length;
|
|
31104
|
+
inspectNode(object2, objects, duplicatesIndexes);
|
|
31105
|
+
for (index = 0, length = duplicatesIndexes.length; index < length; index += 1) {
|
|
31106
|
+
state.duplicates.push(objects[duplicatesIndexes[index]]);
|
|
31107
|
+
}
|
|
31108
|
+
state.usedDuplicates = new Array(length);
|
|
31109
|
+
}
|
|
31110
|
+
function inspectNode(object2, objects, duplicatesIndexes) {
|
|
31111
|
+
var objectKeyList, index, length;
|
|
31112
|
+
if (object2 !== null && typeof object2 === "object") {
|
|
31113
|
+
index = objects.indexOf(object2);
|
|
31114
|
+
if (index !== -1) {
|
|
31115
|
+
if (duplicatesIndexes.indexOf(index) === -1) {
|
|
31116
|
+
duplicatesIndexes.push(index);
|
|
31117
|
+
}
|
|
31118
|
+
} else {
|
|
31119
|
+
objects.push(object2);
|
|
31120
|
+
if (Array.isArray(object2)) {
|
|
31121
|
+
for (index = 0, length = object2.length; index < length; index += 1) {
|
|
31122
|
+
inspectNode(object2[index], objects, duplicatesIndexes);
|
|
31123
|
+
}
|
|
31124
|
+
} else {
|
|
31125
|
+
objectKeyList = Object.keys(object2);
|
|
31126
|
+
for (index = 0, length = objectKeyList.length; index < length; index += 1) {
|
|
31127
|
+
inspectNode(object2[objectKeyList[index]], objects, duplicatesIndexes);
|
|
31128
|
+
}
|
|
31129
|
+
}
|
|
31130
|
+
}
|
|
31131
|
+
}
|
|
31132
|
+
}
|
|
31133
|
+
function dump(input, options) {
|
|
31134
|
+
options = options || {};
|
|
31135
|
+
var state = new State(options);
|
|
31136
|
+
if (!state.noRefs) getDuplicateReferences(input, state);
|
|
31137
|
+
var value = input;
|
|
31138
|
+
if (state.replacer) {
|
|
31139
|
+
value = state.replacer.call({ "": value }, "", value);
|
|
31140
|
+
}
|
|
31141
|
+
if (writeNode(state, 0, value, true, true)) return state.dump + "\n";
|
|
31142
|
+
return "";
|
|
31143
|
+
}
|
|
31144
|
+
module2.exports.dump = dump;
|
|
31145
|
+
}
|
|
31146
|
+
});
|
|
31147
|
+
|
|
31148
|
+
// ../../node_modules/js-yaml/index.js
|
|
31149
|
+
var require_js_yaml = __commonJS({
|
|
31150
|
+
"../../node_modules/js-yaml/index.js"(exports2, module2) {
|
|
31151
|
+
"use strict";
|
|
31152
|
+
var loader = require_loader();
|
|
31153
|
+
var dumper = require_dumper();
|
|
31154
|
+
function renamed(from, to) {
|
|
31155
|
+
return function() {
|
|
31156
|
+
throw new Error("Function yaml." + from + " is removed in js-yaml 4. Use yaml." + to + " instead, which is now safe by default.");
|
|
31157
|
+
};
|
|
31158
|
+
}
|
|
31159
|
+
module2.exports.Type = require_type();
|
|
31160
|
+
module2.exports.Schema = require_schema();
|
|
31161
|
+
module2.exports.FAILSAFE_SCHEMA = require_failsafe();
|
|
31162
|
+
module2.exports.JSON_SCHEMA = require_json();
|
|
31163
|
+
module2.exports.CORE_SCHEMA = require_core();
|
|
31164
|
+
module2.exports.DEFAULT_SCHEMA = require_default();
|
|
31165
|
+
module2.exports.load = loader.load;
|
|
31166
|
+
module2.exports.loadAll = loader.loadAll;
|
|
31167
|
+
module2.exports.dump = dumper.dump;
|
|
31168
|
+
module2.exports.YAMLException = require_exception();
|
|
31169
|
+
module2.exports.types = {
|
|
31170
|
+
binary: require_binary(),
|
|
31171
|
+
float: require_float(),
|
|
31172
|
+
map: require_map(),
|
|
31173
|
+
null: require_null(),
|
|
31174
|
+
pairs: require_pairs(),
|
|
31175
|
+
set: require_set(),
|
|
31176
|
+
timestamp: require_timestamp(),
|
|
31177
|
+
bool: require_bool(),
|
|
31178
|
+
int: require_int(),
|
|
31179
|
+
merge: require_merge(),
|
|
31180
|
+
omap: require_omap(),
|
|
31181
|
+
seq: require_seq(),
|
|
31182
|
+
str: require_str()
|
|
31183
|
+
};
|
|
31184
|
+
module2.exports.safeLoad = renamed("safeLoad", "load");
|
|
31185
|
+
module2.exports.safeLoadAll = renamed("safeLoadAll", "loadAll");
|
|
31186
|
+
module2.exports.safeDump = renamed("safeDump", "dump");
|
|
28364
31187
|
}
|
|
28365
31188
|
});
|
|
28366
31189
|
|
|
@@ -28429,10 +31252,10 @@ var require_dist2 = __commonJS({
|
|
|
28429
31252
|
async function createWorktree(opts) {
|
|
28430
31253
|
const { repoRoot, branch, baseBranch, meshName } = opts;
|
|
28431
31254
|
const targetDir = opts.targetDir || resolveWorktreePath(repoRoot, meshName, branch);
|
|
28432
|
-
if ((0,
|
|
31255
|
+
if ((0, import_node_fs22.existsSync)(targetDir)) {
|
|
28433
31256
|
throw new Error(`Worktree target directory already exists: ${targetDir}`);
|
|
28434
31257
|
}
|
|
28435
|
-
await (0,
|
|
31258
|
+
await (0, import_promises32.mkdir)(path42.dirname(targetDir), { recursive: true });
|
|
28436
31259
|
const args = ["worktree", "add", targetDir, "-b", branch];
|
|
28437
31260
|
if (baseBranch) {
|
|
28438
31261
|
args.push(baseBranch);
|
|
@@ -28459,7 +31282,7 @@ var require_dist2 = __commonJS({
|
|
|
28459
31282
|
};
|
|
28460
31283
|
}
|
|
28461
31284
|
async function removeWorktree(repoRoot, worktreePath) {
|
|
28462
|
-
if (!(0,
|
|
31285
|
+
if (!(0, import_node_fs22.existsSync)(worktreePath)) {
|
|
28463
31286
|
await pruneWorktrees(repoRoot);
|
|
28464
31287
|
return { success: true, removedPath: worktreePath };
|
|
28465
31288
|
}
|
|
@@ -28524,8 +31347,8 @@ var require_dist2 = __commonJS({
|
|
|
28524
31347
|
}
|
|
28525
31348
|
}
|
|
28526
31349
|
var path42;
|
|
28527
|
-
var
|
|
28528
|
-
var
|
|
31350
|
+
var import_promises32;
|
|
31351
|
+
var import_node_fs22;
|
|
28529
31352
|
var import_node_child_process2;
|
|
28530
31353
|
var import_node_util2;
|
|
28531
31354
|
var execFileAsync2;
|
|
@@ -28536,8 +31359,8 @@ var require_dist2 = __commonJS({
|
|
|
28536
31359
|
"src/git/git-worktree.ts"() {
|
|
28537
31360
|
"use strict";
|
|
28538
31361
|
path42 = __toESM2(require("path"));
|
|
28539
|
-
|
|
28540
|
-
|
|
31362
|
+
import_promises32 = require("fs/promises");
|
|
31363
|
+
import_node_fs22 = require("fs");
|
|
28541
31364
|
import_node_child_process2 = require("child_process");
|
|
28542
31365
|
import_node_util2 = require("util");
|
|
28543
31366
|
execFileAsync2 = (0, import_node_util2.promisify)(import_node_child_process2.execFile);
|
|
@@ -29119,8 +31942,8 @@ ${rules.join("\n")}`;
|
|
|
29119
31942
|
}
|
|
29120
31943
|
function rotateSizeIfNeeded() {
|
|
29121
31944
|
try {
|
|
29122
|
-
const
|
|
29123
|
-
if (
|
|
31945
|
+
const stat22 = fs22.statSync(currentLogFile);
|
|
31946
|
+
if (stat22.size > MAX_LOG_SIZE) {
|
|
29124
31947
|
const backup = currentLogFile.replace(".log", ".1.log");
|
|
29125
31948
|
try {
|
|
29126
31949
|
fs22.unlinkSync(backup);
|
|
@@ -29267,8 +32090,8 @@ ${rules.join("\n")}`;
|
|
|
29267
32090
|
try {
|
|
29268
32091
|
const oldLog = path10.join(LOG_DIR, "daemon.log");
|
|
29269
32092
|
if (fs22.existsSync(oldLog)) {
|
|
29270
|
-
const
|
|
29271
|
-
const oldDate =
|
|
32093
|
+
const stat22 = fs22.statSync(oldLog);
|
|
32094
|
+
const oldDate = stat22.mtime.toISOString().slice(0, 10);
|
|
29272
32095
|
fs22.renameSync(oldLog, path10.join(LOG_DIR, `daemon-${oldDate}.log`));
|
|
29273
32096
|
}
|
|
29274
32097
|
const oldLogBackup = path10.join(LOG_DIR, "daemon.log.old");
|
|
@@ -29688,8 +32511,8 @@ ${rules.join("\n")}`;
|
|
|
29688
32511
|
if (cwd) {
|
|
29689
32512
|
try {
|
|
29690
32513
|
const fs16 = require("fs");
|
|
29691
|
-
const
|
|
29692
|
-
if (!
|
|
32514
|
+
const stat22 = fs16.statSync(cwd);
|
|
32515
|
+
if (!stat22.isDirectory()) cwd = os8.homedir();
|
|
29693
32516
|
} catch {
|
|
29694
32517
|
cwd = os8.homedir();
|
|
29695
32518
|
}
|
|
@@ -30017,7 +32840,7 @@ ${rules.join("\n")}`;
|
|
|
30017
32840
|
}
|
|
30018
32841
|
});
|
|
30019
32842
|
function resolveCliSpawnPlan(options) {
|
|
30020
|
-
const { provider, runtimeSettings, workingDir, extraArgs } = options;
|
|
32843
|
+
const { provider, runtimeSettings, workingDir, extraArgs, extraEnv } = options;
|
|
30021
32844
|
const { spawn: spawnConfig } = provider;
|
|
30022
32845
|
const configuredCommand = typeof runtimeSettings.executablePath === "string" && runtimeSettings.executablePath.trim() ? runtimeSettings.executablePath.trim() : spawnConfig.command;
|
|
30023
32846
|
const binaryPath = findBinary(configuredCommand);
|
|
@@ -30041,7 +32864,7 @@ ${rules.join("\n")}`;
|
|
|
30041
32864
|
shellCmd = binaryPath;
|
|
30042
32865
|
shellArgs = allArgs;
|
|
30043
32866
|
}
|
|
30044
|
-
const env2 = buildCliSpawnEnv(process.env, spawnConfig.env);
|
|
32867
|
+
const env2 = buildCliSpawnEnv(process.env, { ...spawnConfig.env || {}, ...extraEnv || {} });
|
|
30045
32868
|
env2.TERMINAL_CWD = workingDir;
|
|
30046
32869
|
return {
|
|
30047
32870
|
binaryPath,
|
|
@@ -30145,8 +32968,9 @@ ${rules.join("\n")}`;
|
|
|
30145
32968
|
init_provider_cli_runtime();
|
|
30146
32969
|
init_provider_cli_shared();
|
|
30147
32970
|
ProviderCliAdapter = class _ProviderCliAdapter {
|
|
30148
|
-
constructor(provider, workingDir, extraArgs = [], transportFactory = new NodePtyTransportFactory()) {
|
|
32971
|
+
constructor(provider, workingDir, extraArgs = [], extraEnv = {}, transportFactory = new NodePtyTransportFactory()) {
|
|
30149
32972
|
this.extraArgs = extraArgs;
|
|
32973
|
+
this.extraEnv = extraEnv;
|
|
30150
32974
|
this.provider = provider;
|
|
30151
32975
|
this.transportFactory = transportFactory;
|
|
30152
32976
|
this.cliType = provider.type;
|
|
@@ -30462,7 +33286,8 @@ ${lastSnapshot}`;
|
|
|
30462
33286
|
provider: this.provider,
|
|
30463
33287
|
runtimeSettings: this.runtimeSettings,
|
|
30464
33288
|
workingDir: this.workingDir,
|
|
30465
|
-
extraArgs: this.extraArgs
|
|
33289
|
+
extraArgs: this.extraArgs,
|
|
33290
|
+
extraEnv: this.extraEnv
|
|
30466
33291
|
});
|
|
30467
33292
|
LOG2.info("CLI", `[${this.cliType}] Spawning in ${this.workingDir}`);
|
|
30468
33293
|
this.resetTraceSession();
|
|
@@ -32373,8 +35198,8 @@ ${lastSnapshot}`;
|
|
|
32373
35198
|
module2.exports = __toCommonJS2(index_exports);
|
|
32374
35199
|
init_repo_mesh_types();
|
|
32375
35200
|
var import_node_child_process = require("child_process");
|
|
32376
|
-
var
|
|
32377
|
-
var
|
|
35201
|
+
var import_node_fs3 = require("fs");
|
|
35202
|
+
var import_promises4 = require("fs/promises");
|
|
32378
35203
|
var path5 = __toESM2(require("path"));
|
|
32379
35204
|
var import_node_util = require("util");
|
|
32380
35205
|
var execFileAsync = (0, import_node_util.promisify)(import_node_child_process.execFile);
|
|
@@ -32433,8 +35258,8 @@ ${lastSnapshot}`;
|
|
|
32433
35258
|
});
|
|
32434
35259
|
}
|
|
32435
35260
|
const cwd = options.cwd ? await validateWorkspace(options.cwd) : await validateWorkspace(repo.workspace);
|
|
32436
|
-
const canonicalRepoRoot = await (0,
|
|
32437
|
-
const canonicalCwd = await (0,
|
|
35261
|
+
const canonicalRepoRoot = await (0, import_promises4.realpath)(repo.repoRoot);
|
|
35262
|
+
const canonicalCwd = await (0, import_promises4.realpath)(cwd);
|
|
32438
35263
|
if (!isPathInside(canonicalRepoRoot, canonicalCwd)) {
|
|
32439
35264
|
throw new GitCommandError("path_outside_repo", "Git cwd is outside the repository root", {
|
|
32440
35265
|
argv,
|
|
@@ -32462,13 +35287,13 @@ ${lastSnapshot}`;
|
|
|
32462
35287
|
}
|
|
32463
35288
|
const normalizedWorkspace = path5.resolve(workspace);
|
|
32464
35289
|
try {
|
|
32465
|
-
const info = await (0,
|
|
35290
|
+
const info = await (0, import_promises4.stat)(normalizedWorkspace);
|
|
32466
35291
|
if (!info.isDirectory()) {
|
|
32467
35292
|
throw new GitCommandError("invalid_args", "Workspace must be an existing directory", {
|
|
32468
35293
|
cwd: normalizedWorkspace
|
|
32469
35294
|
});
|
|
32470
35295
|
}
|
|
32471
|
-
await (0,
|
|
35296
|
+
await (0, import_promises4.access)(normalizedWorkspace, import_node_fs3.constants.R_OK);
|
|
32472
35297
|
} catch (error48) {
|
|
32473
35298
|
if (error48 instanceof GitCommandError) throw error48;
|
|
32474
35299
|
throw new GitCommandError("invalid_args", "Workspace must be an existing directory", {
|
|
@@ -32709,7 +35534,7 @@ ${lastSnapshot}`;
|
|
|
32709
35534
|
reason: error48.reason
|
|
32710
35535
|
};
|
|
32711
35536
|
}
|
|
32712
|
-
var
|
|
35537
|
+
var import_promises22 = require("fs/promises");
|
|
32713
35538
|
var path23 = __toESM2(require("path"));
|
|
32714
35539
|
var DEFAULT_MAX_FILES = 200;
|
|
32715
35540
|
var DEFAULT_MAX_BYTES = 2e5;
|
|
@@ -32881,9 +35706,9 @@ ${lastSnapshot}`;
|
|
|
32881
35706
|
if (typeof filePath !== "string" || filePath.length === 0 || filePath.includes("\0")) {
|
|
32882
35707
|
throw new GitCommandError("invalid_args", "File path must be a non-empty path");
|
|
32883
35708
|
}
|
|
32884
|
-
const canonicalRepoRoot = await (0,
|
|
35709
|
+
const canonicalRepoRoot = await (0, import_promises22.realpath)(repoRoot).catch(() => path23.resolve(repoRoot));
|
|
32885
35710
|
const absolutePath = path23.isAbsolute(filePath) ? path23.resolve(filePath) : path23.resolve(repoRoot, filePath);
|
|
32886
|
-
const checkPath = await (0,
|
|
35711
|
+
const checkPath = await (0, import_promises22.realpath)(absolutePath).catch(() => absolutePath);
|
|
32887
35712
|
const relativeBase = isPathInside(canonicalRepoRoot, checkPath) ? canonicalRepoRoot : path23.resolve(repoRoot);
|
|
32888
35713
|
if (!isPathInside(canonicalRepoRoot, checkPath) && !isPathInside(repoRoot, absolutePath)) {
|
|
32889
35714
|
throw new GitCommandError("path_outside_repo", "Selected file path is outside the repository root", {
|
|
@@ -32899,7 +35724,7 @@ ${lastSnapshot}`;
|
|
|
32899
35724
|
return { absolutePath, relativePath };
|
|
32900
35725
|
}
|
|
32901
35726
|
async function buildUntrackedDiff(absolutePath, relativePath, readLimit) {
|
|
32902
|
-
const content = await (0,
|
|
35727
|
+
const content = await (0, import_promises22.readFile)(absolutePath, "utf8");
|
|
32903
35728
|
const limitedContent = content.length > readLimit ? content.slice(0, readLimit) : content;
|
|
32904
35729
|
const lines = limitedContent.length > 0 ? limitedContent.split("\n") : [];
|
|
32905
35730
|
const plusLines = lines.filter((line, index) => index < lines.length - 1 || line.length > 0).map((line) => `+${line}`).join("\n");
|
|
@@ -34331,17 +37156,17 @@ ${lastSnapshot}`;
|
|
|
34331
37156
|
return null;
|
|
34332
37157
|
}
|
|
34333
37158
|
async function detectIDEs(providerLoader) {
|
|
34334
|
-
const
|
|
37159
|
+
const os222 = (0, import_os22.platform)();
|
|
34335
37160
|
const results = [];
|
|
34336
37161
|
for (const def of getMergedDefinitions()) {
|
|
34337
37162
|
const cliPath = findCliCommand(providerLoader?.getIdeCliCommand(def.id, def.cli) || def.cli);
|
|
34338
|
-
const appPath = checkPathExists(providerLoader?.getIdePathCandidates(def.id, def.paths[
|
|
37163
|
+
const appPath = checkPathExists(providerLoader?.getIdePathCandidates(def.id, def.paths[os222] || []) || []);
|
|
34339
37164
|
let resolvedCli = cliPath;
|
|
34340
|
-
if (!resolvedCli && appPath &&
|
|
37165
|
+
if (!resolvedCli && appPath && os222 === "darwin") {
|
|
34341
37166
|
const bundledCli = `${appPath}/Contents/Resources/app/bin/${def.cli}`;
|
|
34342
37167
|
if ((0, import_fs4.existsSync)(bundledCli)) resolvedCli = bundledCli;
|
|
34343
37168
|
}
|
|
34344
|
-
if (!resolvedCli && appPath &&
|
|
37169
|
+
if (!resolvedCli && appPath && os222 === "win32") {
|
|
34345
37170
|
const { dirname: dirname9 } = await import("path");
|
|
34346
37171
|
const appDir = dirname9(appPath);
|
|
34347
37172
|
const candidates = [
|
|
@@ -34358,7 +37183,7 @@ ${lastSnapshot}`;
|
|
|
34358
37183
|
}
|
|
34359
37184
|
}
|
|
34360
37185
|
}
|
|
34361
|
-
const installed =
|
|
37186
|
+
const installed = os222 === "darwin" ? !!(resolvedCli || appPath) : !!resolvedCli;
|
|
34362
37187
|
const version2 = resolvedCli ? getIdeVersion(resolvedCli) : null;
|
|
34363
37188
|
results.push({
|
|
34364
37189
|
id: def.id,
|
|
@@ -36809,8 +39634,8 @@ ${cleanBody}`;
|
|
|
36809
39634
|
function buildSavedHistoryFileSignatureMap(dir, files) {
|
|
36810
39635
|
return new Map(files.map((file2) => {
|
|
36811
39636
|
try {
|
|
36812
|
-
const
|
|
36813
|
-
return [file2, `${file2}:${
|
|
39637
|
+
const stat22 = fs32.statSync(path11.join(dir, file2));
|
|
39638
|
+
return [file2, `${file2}:${stat22.size}:${Math.trunc(stat22.mtimeMs)}`];
|
|
36814
39639
|
} catch {
|
|
36815
39640
|
return [file2, `${file2}:missing`];
|
|
36816
39641
|
}
|
|
@@ -36873,8 +39698,8 @@ ${cleanBody}`;
|
|
|
36873
39698
|
} catch (error48) {
|
|
36874
39699
|
if (error48?.code !== "EEXIST") return null;
|
|
36875
39700
|
try {
|
|
36876
|
-
const
|
|
36877
|
-
if (Date.now() -
|
|
39701
|
+
const stat22 = fs32.statSync(lockPath);
|
|
39702
|
+
if (Date.now() - stat22.mtimeMs > SAVED_HISTORY_INDEX_LOCK_STALE_MS) {
|
|
36878
39703
|
fs32.rmSync(lockPath, { recursive: true, force: true });
|
|
36879
39704
|
continue;
|
|
36880
39705
|
}
|
|
@@ -36937,8 +39762,8 @@ ${cleanBody}`;
|
|
|
36937
39762
|
}
|
|
36938
39763
|
function buildSavedHistoryIndexFileSignature(dir) {
|
|
36939
39764
|
try {
|
|
36940
|
-
const
|
|
36941
|
-
return `index:${
|
|
39765
|
+
const stat22 = fs32.statSync(getSavedHistoryIndexFilePath(dir));
|
|
39766
|
+
return `index:${stat22.size}:${Math.trunc(stat22.mtimeMs)}`;
|
|
36942
39767
|
} catch {
|
|
36943
39768
|
return "index:missing";
|
|
36944
39769
|
}
|
|
@@ -36948,8 +39773,8 @@ ${cleanBody}`;
|
|
|
36948
39773
|
const indexStat = fs32.statSync(getSavedHistoryIndexFilePath(dir));
|
|
36949
39774
|
const files = listHistoryFiles(dir);
|
|
36950
39775
|
for (const file2 of files) {
|
|
36951
|
-
const
|
|
36952
|
-
if (
|
|
39776
|
+
const stat22 = fs32.statSync(path11.join(dir, file2));
|
|
39777
|
+
if (stat22.mtimeMs > indexStat.mtimeMs) return true;
|
|
36953
39778
|
}
|
|
36954
39779
|
return false;
|
|
36955
39780
|
} catch {
|
|
@@ -36958,8 +39783,8 @@ ${cleanBody}`;
|
|
|
36958
39783
|
}
|
|
36959
39784
|
function buildSavedHistoryFileSignature(dir, file2) {
|
|
36960
39785
|
try {
|
|
36961
|
-
const
|
|
36962
|
-
return `${file2}:${
|
|
39786
|
+
const stat22 = fs32.statSync(path11.join(dir, file2));
|
|
39787
|
+
return `${file2}:${stat22.size}:${Math.trunc(stat22.mtimeMs)}`;
|
|
36963
39788
|
} catch {
|
|
36964
39789
|
return `${file2}:missing`;
|
|
36965
39790
|
}
|
|
@@ -37497,8 +40322,8 @@ ${cleanBody}`;
|
|
|
37497
40322
|
let removedAny = false;
|
|
37498
40323
|
for (const file2 of files) {
|
|
37499
40324
|
const filePath = path11.join(dirPath, file2);
|
|
37500
|
-
const
|
|
37501
|
-
if (
|
|
40325
|
+
const stat22 = fs32.statSync(filePath);
|
|
40326
|
+
if (stat22.mtimeMs < cutoff) {
|
|
37502
40327
|
fs32.unlinkSync(filePath);
|
|
37503
40328
|
removedAny = true;
|
|
37504
40329
|
}
|
|
@@ -41938,11 +44763,11 @@ ${effect.notification.body || ""}`.trim();
|
|
|
41938
44763
|
files.push({ name: entry.name, type: "file", size });
|
|
41939
44764
|
continue;
|
|
41940
44765
|
}
|
|
41941
|
-
const
|
|
44766
|
+
const stat22 = fs52.statSync(entryPath);
|
|
41942
44767
|
files.push({
|
|
41943
44768
|
name: entry.name,
|
|
41944
|
-
type:
|
|
41945
|
-
size:
|
|
44769
|
+
type: stat22.isDirectory() ? "directory" : "file",
|
|
44770
|
+
size: stat22.isFile() ? stat22.size : void 0
|
|
41946
44771
|
});
|
|
41947
44772
|
} catch {
|
|
41948
44773
|
}
|
|
@@ -43197,7 +46022,7 @@ ${effect.notification.body || ""}`.trim();
|
|
|
43197
46022
|
this.providerSessionId = options?.providerSessionId;
|
|
43198
46023
|
this.launchMode = options?.launchMode || "new";
|
|
43199
46024
|
this.onProviderSessionResolved = options?.onProviderSessionResolved;
|
|
43200
|
-
this.adapter = new ProviderCliAdapter(provider, workingDir, cliArgs, transportFactory);
|
|
46025
|
+
this.adapter = new ProviderCliAdapter(provider, workingDir, cliArgs, options?.extraEnv || {}, transportFactory);
|
|
43201
46026
|
this.monitor = new StatusMonitor();
|
|
43202
46027
|
this.historyWriter = new ChatHistoryWriter();
|
|
43203
46028
|
}
|
|
@@ -45400,7 +48225,7 @@ ${rawInput}` : rawInput;
|
|
|
45400
48225
|
attachExisting
|
|
45401
48226
|
}) || void 0;
|
|
45402
48227
|
}
|
|
45403
|
-
createAdapter(cliType, workingDir, cliArgs, runtimeId, providerSessionId, attachExisting = false) {
|
|
48228
|
+
createAdapter(cliType, workingDir, cliArgs, runtimeId, providerSessionId, attachExisting = false, extraEnv) {
|
|
45404
48229
|
const normalizedType = this.providerLoader.resolveAlias(cliType);
|
|
45405
48230
|
const provider = this.providerLoader.getMeta(normalizedType);
|
|
45406
48231
|
if (provider && provider.category === "cli" && provider.patterns && provider.spawn) {
|
|
@@ -45414,7 +48239,7 @@ ${rawInput}` : rawInput;
|
|
|
45414
48239
|
providerSessionId,
|
|
45415
48240
|
attachExisting
|
|
45416
48241
|
);
|
|
45417
|
-
return new ProviderCliAdapter(resolvedProvider, workingDir, cliArgs, transportFactory);
|
|
48242
|
+
return new ProviderCliAdapter(resolvedProvider, workingDir, cliArgs, extraEnv || {}, transportFactory);
|
|
45418
48243
|
}
|
|
45419
48244
|
throw new Error(`No CLI provider found for '${cliType}'. Create a provider.js in providers/cli/${cliType}/`);
|
|
45420
48245
|
}
|
|
@@ -45617,6 +48442,7 @@ Run 'adhdev doctor' for detailed diagnostics.`
|
|
|
45617
48442
|
{
|
|
45618
48443
|
providerSessionId: sessionBinding.providerSessionId,
|
|
45619
48444
|
launchMode: sessionBinding.launchMode,
|
|
48445
|
+
extraEnv: options?.extraEnv,
|
|
45620
48446
|
onProviderSessionResolved: ({ providerSessionId, providerName, providerType, workspace }) => {
|
|
45621
48447
|
this.persistRecentActivity({
|
|
45622
48448
|
kind: "cli",
|
|
@@ -45637,7 +48463,8 @@ Run 'adhdev doctor' for detailed diagnostics.`
|
|
|
45637
48463
|
resolvedCliArgs,
|
|
45638
48464
|
key,
|
|
45639
48465
|
sessionBinding.providerSessionId,
|
|
45640
|
-
false
|
|
48466
|
+
false,
|
|
48467
|
+
options?.extraEnv
|
|
45641
48468
|
);
|
|
45642
48469
|
try {
|
|
45643
48470
|
await adapter.spawn();
|
|
@@ -45866,7 +48693,7 @@ Run 'adhdev doctor' for detailed diagnostics.`
|
|
|
45866
48693
|
dir,
|
|
45867
48694
|
args?.cliArgs,
|
|
45868
48695
|
args?.initialModel,
|
|
45869
|
-
{ resumeSessionId: args?.resumeSessionId, settingsOverride: args?.settings }
|
|
48696
|
+
{ resumeSessionId: args?.resumeSessionId, settingsOverride: args?.settings, extraEnv: args?.env }
|
|
45870
48697
|
);
|
|
45871
48698
|
return {
|
|
45872
48699
|
success: true,
|
|
@@ -45990,7 +48817,7 @@ Run 'adhdev doctor' for detailed diagnostics.`
|
|
|
45990
48817
|
var fs7 = __toESM2(require("fs"));
|
|
45991
48818
|
var path18 = __toESM2(require("path"));
|
|
45992
48819
|
var os14 = __toESM2(require("os"));
|
|
45993
|
-
var chokidar = __toESM2(
|
|
48820
|
+
var chokidar = __toESM2((init_chokidar(), __toCommonJS(chokidar_exports)));
|
|
45994
48821
|
init_logger();
|
|
45995
48822
|
var VALID_CAPABILITY_MEDIA_TYPES = /* @__PURE__ */ new Set(["text", "image", "audio", "video", "resource"]);
|
|
45996
48823
|
var KNOWN_PROVIDER_FIELDS = /* @__PURE__ */ new Set([
|
|
@@ -48316,8 +51143,8 @@ Run 'adhdev doctor' for detailed diagnostics.`
|
|
|
48316
51143
|
}
|
|
48317
51144
|
function checkSize() {
|
|
48318
51145
|
try {
|
|
48319
|
-
const
|
|
48320
|
-
if (
|
|
51146
|
+
const stat22 = fs8.statSync(currentFile);
|
|
51147
|
+
if (stat22.size > MAX_FILE_SIZE) {
|
|
48321
51148
|
const backup = currentFile.replace(".jsonl", ".1.jsonl");
|
|
48322
51149
|
try {
|
|
48323
51150
|
fs8.unlinkSync(backup);
|
|
@@ -48387,10 +51214,12 @@ Run 'adhdev doctor' for detailed diagnostics.`
|
|
|
48387
51214
|
}
|
|
48388
51215
|
}
|
|
48389
51216
|
cleanOldFiles();
|
|
51217
|
+
var yaml = __toESM2(require_js_yaml());
|
|
48390
51218
|
init_logger();
|
|
48391
|
-
var
|
|
51219
|
+
var import_node_fs32 = require("fs");
|
|
48392
51220
|
var import_node_module2 = require("module");
|
|
48393
|
-
var
|
|
51221
|
+
var os17 = __toESM2(require("os"));
|
|
51222
|
+
var import_node_path2 = require("path");
|
|
48394
51223
|
var DEFAULT_SERVER_NAME = "adhdev-mesh";
|
|
48395
51224
|
var DEFAULT_ADHDEV_MCP_COMMAND = "adhdev-mcp";
|
|
48396
51225
|
function resolveMeshCoordinatorSetup(options) {
|
|
@@ -48429,7 +51258,7 @@ Run 'adhdev doctor' for detailed diagnostics.`
|
|
|
48429
51258
|
return {
|
|
48430
51259
|
kind: "auto_import",
|
|
48431
51260
|
serverName,
|
|
48432
|
-
configPath: (
|
|
51261
|
+
configPath: resolveMcpConfigPath(path27, workspace),
|
|
48433
51262
|
configFormat: mcpConfig.format,
|
|
48434
51263
|
mcpServer
|
|
48435
51264
|
};
|
|
@@ -48463,6 +51292,13 @@ Run 'adhdev doctor' for detailed diagnostics.`
|
|
|
48463
51292
|
function renderMeshCoordinatorTemplate(template, values) {
|
|
48464
51293
|
return template.replace(/\{\{\s*(meshId|workspace|serverName|adhdevMcpCommand)\s*\}\}/g, (_, key) => values[key] || "");
|
|
48465
51294
|
}
|
|
51295
|
+
function resolveMcpConfigPath(configPath, workspace) {
|
|
51296
|
+
const trimmed = configPath.trim();
|
|
51297
|
+
if (trimmed === "~") return os17.homedir();
|
|
51298
|
+
if (trimmed.startsWith("~/")) return (0, import_node_path2.join)(os17.homedir(), trimmed.slice(2));
|
|
51299
|
+
if ((0, import_node_path2.isAbsolute)(trimmed)) return trimmed;
|
|
51300
|
+
return (0, import_node_path2.join)(workspace, trimmed);
|
|
51301
|
+
}
|
|
48466
51302
|
function resolveAdhdevMcpServerLaunch(options) {
|
|
48467
51303
|
const entryPath = resolveAdhdevMcpEntryPath(options.adhdevMcpEntryPath);
|
|
48468
51304
|
if (!entryPath) return null;
|
|
@@ -48483,12 +51319,12 @@ Run 'adhdev doctor' for detailed diagnostics.`
|
|
|
48483
51319
|
const addPackagedCandidates = (baseFile) => {
|
|
48484
51320
|
if (!baseFile) return;
|
|
48485
51321
|
const realBase = normalizeExistingPath(baseFile) || baseFile;
|
|
48486
|
-
const dir = (0,
|
|
48487
|
-
addCandidate((0,
|
|
48488
|
-
addCandidate((0,
|
|
48489
|
-
addCandidate((0,
|
|
48490
|
-
addCandidate((0,
|
|
48491
|
-
addCandidate((0,
|
|
51322
|
+
const dir = (0, import_node_path2.dirname)(realBase);
|
|
51323
|
+
addCandidate((0, import_node_path2.resolve)(dir, "../vendor/mcp-server/index.js"));
|
|
51324
|
+
addCandidate((0, import_node_path2.resolve)(dir, "../../vendor/mcp-server/index.js"));
|
|
51325
|
+
addCandidate((0, import_node_path2.resolve)(dir, "../../../vendor/mcp-server/index.js"));
|
|
51326
|
+
addCandidate((0, import_node_path2.resolve)(dir, "../../mcp-server/dist/index.js"));
|
|
51327
|
+
addCandidate((0, import_node_path2.resolve)(dir, "../../../mcp-server/dist/index.js"));
|
|
48492
51328
|
};
|
|
48493
51329
|
addPackagedCandidates(process.argv[1]);
|
|
48494
51330
|
for (const candidate of candidates) {
|
|
@@ -48496,7 +51332,7 @@ Run 'adhdev doctor' for detailed diagnostics.`
|
|
|
48496
51332
|
if (normalized) return normalized;
|
|
48497
51333
|
}
|
|
48498
51334
|
try {
|
|
48499
|
-
const requireBase = process.argv[1] ? normalizeExistingPath(process.argv[1]) || process.argv[1] : (0,
|
|
51335
|
+
const requireBase = process.argv[1] ? normalizeExistingPath(process.argv[1]) || process.argv[1] : (0, import_node_path2.join)(process.cwd(), "adhdev-daemon.js");
|
|
48500
51336
|
const req = (0, import_node_module2.createRequire)(requireBase);
|
|
48501
51337
|
const resolvedModule = req.resolve("@adhdev/mcp-server");
|
|
48502
51338
|
return normalizeExistingPath(resolvedModule) || resolvedModule;
|
|
@@ -48506,13 +51342,13 @@ Run 'adhdev doctor' for detailed diagnostics.`
|
|
|
48506
51342
|
}
|
|
48507
51343
|
function normalizeExistingPath(filePath) {
|
|
48508
51344
|
try {
|
|
48509
|
-
if (!(0,
|
|
48510
|
-
return
|
|
51345
|
+
if (!(0, import_node_fs32.existsSync)(filePath)) return null;
|
|
51346
|
+
return import_node_fs32.realpathSync.native(filePath);
|
|
48511
51347
|
} catch {
|
|
48512
51348
|
return null;
|
|
48513
51349
|
}
|
|
48514
51350
|
}
|
|
48515
|
-
var
|
|
51351
|
+
var os18 = __toESM2(require("os"));
|
|
48516
51352
|
init_config();
|
|
48517
51353
|
init_terminal_screen();
|
|
48518
51354
|
init_logger();
|
|
@@ -48568,8 +51404,8 @@ Run 'adhdev doctor' for detailed diagnostics.`
|
|
|
48568
51404
|
}
|
|
48569
51405
|
function buildMachineInfo2(profile = "full") {
|
|
48570
51406
|
const base = {
|
|
48571
|
-
hostname:
|
|
48572
|
-
platform:
|
|
51407
|
+
hostname: os18.hostname(),
|
|
51408
|
+
platform: os18.platform()
|
|
48573
51409
|
};
|
|
48574
51410
|
if (profile === "live") {
|
|
48575
51411
|
return base;
|
|
@@ -48578,23 +51414,23 @@ Run 'adhdev doctor' for detailed diagnostics.`
|
|
|
48578
51414
|
const memSnap2 = getHostMemorySnapshot();
|
|
48579
51415
|
return {
|
|
48580
51416
|
...base,
|
|
48581
|
-
arch:
|
|
48582
|
-
cpus:
|
|
51417
|
+
arch: os18.arch(),
|
|
51418
|
+
cpus: os18.cpus().length,
|
|
48583
51419
|
totalMem: memSnap2.totalMem,
|
|
48584
|
-
release:
|
|
51420
|
+
release: os18.release()
|
|
48585
51421
|
};
|
|
48586
51422
|
}
|
|
48587
51423
|
const memSnap = getHostMemorySnapshot();
|
|
48588
51424
|
return {
|
|
48589
51425
|
...base,
|
|
48590
|
-
arch:
|
|
48591
|
-
cpus:
|
|
51426
|
+
arch: os18.arch(),
|
|
51427
|
+
cpus: os18.cpus().length,
|
|
48592
51428
|
totalMem: memSnap.totalMem,
|
|
48593
51429
|
freeMem: memSnap.freeMem,
|
|
48594
51430
|
availableMem: memSnap.availableMem,
|
|
48595
|
-
loadavg:
|
|
48596
|
-
uptime:
|
|
48597
|
-
release:
|
|
51431
|
+
loadavg: os18.loadavg(),
|
|
51432
|
+
uptime: os18.uptime(),
|
|
51433
|
+
release: os18.release()
|
|
48598
51434
|
};
|
|
48599
51435
|
}
|
|
48600
51436
|
function parseMessageTime(value) {
|
|
@@ -48826,11 +51662,11 @@ Run 'adhdev doctor' for detailed diagnostics.`
|
|
|
48826
51662
|
var import_child_process8 = require("child_process");
|
|
48827
51663
|
var import_child_process9 = require("child_process");
|
|
48828
51664
|
var fs9 = __toESM2(require("fs"));
|
|
48829
|
-
var
|
|
51665
|
+
var os19 = __toESM2(require("os"));
|
|
48830
51666
|
var path21 = __toESM2(require("path"));
|
|
48831
51667
|
var UPGRADE_HELPER_ENV = "ADHDEV_DAEMON_UPGRADE_HELPER";
|
|
48832
51668
|
function getUpgradeLogPath() {
|
|
48833
|
-
const home =
|
|
51669
|
+
const home = os19.homedir();
|
|
48834
51670
|
const dir = path21.join(home, ".adhdev");
|
|
48835
51671
|
fs9.mkdirSync(dir, { recursive: true });
|
|
48836
51672
|
return path21.join(dir, "daemon-upgrade.log");
|
|
@@ -49022,7 +51858,7 @@ Run 'adhdev doctor' for detailed diagnostics.`
|
|
|
49022
51858
|
}
|
|
49023
51859
|
}
|
|
49024
51860
|
function stopSessionHostProcesses(appName) {
|
|
49025
|
-
const pidFile = path21.join(
|
|
51861
|
+
const pidFile = path21.join(os19.homedir(), ".adhdev", `${appName}-session-host.pid`);
|
|
49026
51862
|
try {
|
|
49027
51863
|
if (fs9.existsSync(pidFile)) {
|
|
49028
51864
|
const pid = Number.parseInt(fs9.readFileSync(pidFile, "utf8").trim(), 10);
|
|
@@ -49039,7 +51875,7 @@ Run 'adhdev doctor' for detailed diagnostics.`
|
|
|
49039
51875
|
}
|
|
49040
51876
|
}
|
|
49041
51877
|
function removeDaemonPidFile() {
|
|
49042
|
-
const pidFile = path21.join(
|
|
51878
|
+
const pidFile = path21.join(os19.homedir(), ".adhdev", "daemon.pid");
|
|
49043
51879
|
try {
|
|
49044
51880
|
fs9.unlinkSync(pidFile);
|
|
49045
51881
|
} catch {
|
|
@@ -49175,6 +52011,22 @@ Run 'adhdev doctor' for detailed diagnostics.`
|
|
|
49175
52011
|
function resolveUpgradeChannel(args) {
|
|
49176
52012
|
return normalizeReleaseChannel(args?.channel) || normalizeReleaseChannel(args?.updatePolicy?.channel) || normalizeReleaseChannel(args?.npmTag) || normalizeReleaseChannel(loadConfig2().updateChannel) || "stable";
|
|
49177
52013
|
}
|
|
52014
|
+
function loadYamlModule() {
|
|
52015
|
+
return yaml;
|
|
52016
|
+
}
|
|
52017
|
+
function getMcpServersKey(format) {
|
|
52018
|
+
return format === "hermes_config_yaml" ? "mcp_servers" : "mcpServers";
|
|
52019
|
+
}
|
|
52020
|
+
function parseMeshCoordinatorMcpConfig(text, format) {
|
|
52021
|
+
if (!text.trim()) return {};
|
|
52022
|
+
if (format === "claude_mcp_json") return JSON.parse(text);
|
|
52023
|
+
const parsed = loadYamlModule().load(text);
|
|
52024
|
+
return parsed && typeof parsed === "object" && !Array.isArray(parsed) ? parsed : {};
|
|
52025
|
+
}
|
|
52026
|
+
function serializeMeshCoordinatorMcpConfig(config2, format) {
|
|
52027
|
+
if (format === "claude_mcp_json") return JSON.stringify(config2, null, 2);
|
|
52028
|
+
return loadYamlModule().dump(config2, { noRefs: true, lineWidth: 120 });
|
|
52029
|
+
}
|
|
49178
52030
|
var CHAT_COMMANDS = [
|
|
49179
52031
|
"send_chat",
|
|
49180
52032
|
"new_chat",
|
|
@@ -50152,7 +53004,8 @@ Run 'adhdev doctor' for detailed diagnostics.`
|
|
|
50152
53004
|
meshCoordinatorSetup: coordinatorSetup
|
|
50153
53005
|
};
|
|
50154
53006
|
}
|
|
50155
|
-
|
|
53007
|
+
const configFormat = coordinatorSetup.configFormat;
|
|
53008
|
+
if (configFormat !== "claude_mcp_json" && configFormat !== "hermes_config_yaml") {
|
|
50156
53009
|
return {
|
|
50157
53010
|
success: false,
|
|
50158
53011
|
code: "mesh_coordinator_unsupported",
|
|
@@ -50177,15 +53030,23 @@ Run 'adhdev doctor' for detailed diagnostics.`
|
|
|
50177
53030
|
workspace
|
|
50178
53031
|
};
|
|
50179
53032
|
}
|
|
50180
|
-
const { existsSync: existsSync23, readFileSync: readFileSync15, writeFileSync: writeFileSync12, copyFileSync: copyFileSync3 } = await import("fs");
|
|
53033
|
+
const { existsSync: existsSync23, readFileSync: readFileSync15, writeFileSync: writeFileSync12, copyFileSync: copyFileSync3, mkdirSync: mkdirSync14 } = await import("fs");
|
|
53034
|
+
const { dirname: dirname9 } = await import("path");
|
|
50181
53035
|
const mcpConfigPath = coordinatorSetup.configPath;
|
|
53036
|
+
mkdirSync14(dirname9(mcpConfigPath), { recursive: true });
|
|
50182
53037
|
const hadExistingMcpConfig = existsSync23(mcpConfigPath);
|
|
50183
53038
|
let existingMcpConfig = {};
|
|
50184
53039
|
if (hadExistingMcpConfig) {
|
|
50185
53040
|
try {
|
|
50186
|
-
existingMcpConfig =
|
|
53041
|
+
existingMcpConfig = parseMeshCoordinatorMcpConfig(readFileSync15(mcpConfigPath, "utf-8"), configFormat);
|
|
50187
53042
|
copyFileSync3(mcpConfigPath, mcpConfigPath + ".backup");
|
|
50188
|
-
} catch {
|
|
53043
|
+
} catch (error48) {
|
|
53044
|
+
LOG2.error("MeshCoordinator", `Failed to parse existing MCP config ${mcpConfigPath}: ${error48?.message || error48}`);
|
|
53045
|
+
return {
|
|
53046
|
+
success: false,
|
|
53047
|
+
code: "mesh_coordinator_config_parse_failed",
|
|
53048
|
+
error: `Failed to parse existing MCP config at ${mcpConfigPath}`
|
|
53049
|
+
};
|
|
50189
53050
|
}
|
|
50190
53051
|
}
|
|
50191
53052
|
const mcpServerEntry = {
|
|
@@ -50198,18 +53059,25 @@ Run 'adhdev doctor' for detailed diagnostics.`
|
|
|
50198
53059
|
ADHDEV_MCP_TRANSPORT: "ipc"
|
|
50199
53060
|
};
|
|
50200
53061
|
}
|
|
53062
|
+
const mcpServersKey = getMcpServersKey(configFormat);
|
|
53063
|
+
const existingServers = existingMcpConfig[mcpServersKey];
|
|
50201
53064
|
const mcpConfig = {
|
|
50202
53065
|
...existingMcpConfig,
|
|
50203
|
-
|
|
50204
|
-
...
|
|
53066
|
+
[mcpServersKey]: {
|
|
53067
|
+
...existingServers && typeof existingServers === "object" && !Array.isArray(existingServers) ? existingServers : {},
|
|
50205
53068
|
[coordinatorSetup.serverName]: mcpServerEntry
|
|
50206
53069
|
}
|
|
50207
53070
|
};
|
|
50208
|
-
writeFileSync12(mcpConfigPath,
|
|
53071
|
+
writeFileSync12(mcpConfigPath, serializeMeshCoordinatorMcpConfig(mcpConfig, configFormat), "utf-8");
|
|
50209
53072
|
LOG2.info("MeshCoordinator", `Wrote ${mcpConfigPath} with ${coordinatorSetup.serverName} server`);
|
|
50210
53073
|
const cliArgs = [];
|
|
53074
|
+
const launchEnv = {};
|
|
50211
53075
|
if (systemPrompt) {
|
|
50212
|
-
|
|
53076
|
+
if (configFormat === "hermes_config_yaml") {
|
|
53077
|
+
launchEnv.HERMES_EPHEMERAL_SYSTEM_PROMPT = systemPrompt;
|
|
53078
|
+
} else {
|
|
53079
|
+
cliArgs.push("--append-system-prompt", systemPrompt);
|
|
53080
|
+
}
|
|
50213
53081
|
}
|
|
50214
53082
|
if (cliType === "claude-cli") {
|
|
50215
53083
|
cliArgs.push("--mcp-config", coordinatorSetup.configPath);
|
|
@@ -50218,6 +53086,7 @@ Run 'adhdev doctor' for detailed diagnostics.`
|
|
|
50218
53086
|
cliType,
|
|
50219
53087
|
dir: workspace,
|
|
50220
53088
|
cliArgs: cliArgs.length > 0 ? cliArgs : void 0,
|
|
53089
|
+
env: Object.keys(launchEnv).length > 0 ? launchEnv : void 0,
|
|
50221
53090
|
settings: {
|
|
50222
53091
|
meshCoordinatorFor: meshId
|
|
50223
53092
|
}
|
|
@@ -51857,10 +54726,10 @@ Run 'adhdev doctor' for detailed diagnostics.`
|
|
|
51857
54726
|
};
|
|
51858
54727
|
var fs11 = __toESM2(require("fs"));
|
|
51859
54728
|
var path222 = __toESM2(require("path"));
|
|
51860
|
-
var
|
|
54729
|
+
var os20 = __toESM2(require("os"));
|
|
51861
54730
|
var import_child_process10 = require("child_process");
|
|
51862
54731
|
var import_os3 = require("os");
|
|
51863
|
-
var ARCHIVE_PATH = path222.join(
|
|
54732
|
+
var ARCHIVE_PATH = path222.join(os20.homedir(), ".adhdev", "version-history.json");
|
|
51864
54733
|
var MAX_ENTRIES_PER_PROVIDER = 20;
|
|
51865
54734
|
var VersionArchive = class {
|
|
51866
54735
|
history = {};
|
|
@@ -51963,7 +54832,7 @@ Run 'adhdev doctor' for detailed diagnostics.`
|
|
|
51963
54832
|
function checkPathExists2(paths) {
|
|
51964
54833
|
for (const p of paths) {
|
|
51965
54834
|
if (p.includes("*")) {
|
|
51966
|
-
const home =
|
|
54835
|
+
const home = os20.homedir();
|
|
51967
54836
|
const resolved = p.replace(/\*/g, home.split(path222.sep).pop() || "");
|
|
51968
54837
|
if (fs11.existsSync(resolved)) return resolved;
|
|
51969
54838
|
} else {
|
|
@@ -54340,7 +57209,7 @@ async (params) => {
|
|
|
54340
57209
|
}
|
|
54341
57210
|
var fs14 = __toESM2(require("fs"));
|
|
54342
57211
|
var path25 = __toESM2(require("path"));
|
|
54343
|
-
var
|
|
57212
|
+
var os21 = __toESM2(require("os"));
|
|
54344
57213
|
function getAutoImplPid(ctx) {
|
|
54345
57214
|
const pid = ctx.autoImplProcess?.pid;
|
|
54346
57215
|
return typeof pid === "number" && pid > 0 ? pid : null;
|
|
@@ -54541,7 +57410,7 @@ async (params) => {
|
|
|
54541
57410
|
});
|
|
54542
57411
|
const referenceScripts = loadAutoImplReferenceScripts(ctx, resolvedReference);
|
|
54543
57412
|
const prompt = buildAutoImplPrompt(ctx, type, provider, providerDir, functions, domContext, referenceScripts, comment, resolvedReference, verification);
|
|
54544
|
-
const tmpDir = path25.join(
|
|
57413
|
+
const tmpDir = path25.join(os21.tmpdir(), "adhdev-autoimpl");
|
|
54545
57414
|
if (!fs14.existsSync(tmpDir)) fs14.mkdirSync(tmpDir, { recursive: true });
|
|
54546
57415
|
const promptFile = path25.join(tmpDir, `prompt-${type}-${Date.now()}.md`);
|
|
54547
57416
|
fs14.writeFileSync(promptFile, prompt, "utf-8");
|
|
@@ -54696,7 +57565,7 @@ async (params) => {
|
|
|
54696
57565
|
const interactiveFlags = ["--yolo", "--interactive", "-i"];
|
|
54697
57566
|
const baseArgs = [...spawn4.args || []].filter((a) => !interactiveFlags.includes(a));
|
|
54698
57567
|
let shellCmd;
|
|
54699
|
-
const isWin =
|
|
57568
|
+
const isWin = os21.platform() === "win32";
|
|
54700
57569
|
const escapeArg = (a) => isWin ? `"${a.replace(/"/g, '""')}"` : `'${a.replace(/'/g, "'\\''")}'`;
|
|
54701
57570
|
const promptMode = autoImpl?.promptMode ?? "stdin";
|
|
54702
57571
|
const extraArgs = autoImpl?.extraArgs ?? [];
|
|
@@ -54735,7 +57604,7 @@ async (params) => {
|
|
|
54735
57604
|
try {
|
|
54736
57605
|
const pty = require("node-pty");
|
|
54737
57606
|
ctx.log(`Auto-implement spawn (PTY): ${shellCmd}`);
|
|
54738
|
-
const isWin2 =
|
|
57607
|
+
const isWin2 = os21.platform() === "win32";
|
|
54739
57608
|
child = pty.spawn(isWin2 ? "cmd.exe" : process.env.SHELL || "/bin/zsh", [isWin2 ? "/c" : "-c", shellCmd], {
|
|
54740
57609
|
name: "xterm-256color",
|
|
54741
57610
|
cols: 120,
|
|
@@ -56245,8 +59114,8 @@ data: ${JSON.stringify(msg.data)}
|
|
|
56245
59114
|
files.push({ path: rel, size: 0, type: "dir" });
|
|
56246
59115
|
scan(path26.join(d, entry.name), rel);
|
|
56247
59116
|
} else {
|
|
56248
|
-
const
|
|
56249
|
-
files.push({ path: rel, size:
|
|
59117
|
+
const stat22 = fs15.statSync(path26.join(d, entry.name));
|
|
59118
|
+
files.push({ path: rel, size: stat22.size, type: "file" });
|
|
56250
59119
|
}
|
|
56251
59120
|
}
|
|
56252
59121
|
} catch {
|
|
@@ -58363,9 +61232,9 @@ async function runSessionHostCli(args) {
|
|
|
58363
61232
|
stdio: "inherit",
|
|
58364
61233
|
env: buildSessionHostEnv(process.env)
|
|
58365
61234
|
});
|
|
58366
|
-
return await new Promise((
|
|
61235
|
+
return await new Promise((resolve4, reject) => {
|
|
58367
61236
|
child.on("error", reject);
|
|
58368
|
-
child.on("exit", (code) =>
|
|
61237
|
+
child.on("exit", (code) => resolve4(code ?? 0));
|
|
58369
61238
|
});
|
|
58370
61239
|
}
|
|
58371
61240
|
async function ensureSessionHostReady() {
|
|
@@ -58503,8 +61372,8 @@ var SessionHostClient = class {
|
|
|
58503
61372
|
} catch {
|
|
58504
61373
|
}
|
|
58505
61374
|
});
|
|
58506
|
-
await new Promise((
|
|
58507
|
-
socket.once("connect", () =>
|
|
61375
|
+
await new Promise((resolve22, reject) => {
|
|
61376
|
+
socket.once("connect", () => resolve22());
|
|
58508
61377
|
socket.once("error", reject);
|
|
58509
61378
|
});
|
|
58510
61379
|
}
|
|
@@ -58523,7 +61392,7 @@ var SessionHostClient = class {
|
|
|
58523
61392
|
requestId,
|
|
58524
61393
|
request
|
|
58525
61394
|
};
|
|
58526
|
-
const response = await new Promise((
|
|
61395
|
+
const response = await new Promise((resolve22, reject) => {
|
|
58527
61396
|
const timeout = setTimeout(() => {
|
|
58528
61397
|
this.requestWaiters.delete(requestId);
|
|
58529
61398
|
reject(new Error(`Session host request timed out after 30s (${request.type})`));
|
|
@@ -58531,7 +61400,7 @@ var SessionHostClient = class {
|
|
|
58531
61400
|
this.requestWaiters.set(requestId, {
|
|
58532
61401
|
resolve: (value) => {
|
|
58533
61402
|
clearTimeout(timeout);
|
|
58534
|
-
|
|
61403
|
+
resolve22(value);
|
|
58535
61404
|
},
|
|
58536
61405
|
reject: (error48) => {
|
|
58537
61406
|
clearTimeout(timeout);
|
|
@@ -58550,12 +61419,12 @@ var SessionHostClient = class {
|
|
|
58550
61419
|
waiter.reject(new Error("Session host client closed"));
|
|
58551
61420
|
}
|
|
58552
61421
|
this.requestWaiters.clear();
|
|
58553
|
-
await new Promise((
|
|
61422
|
+
await new Promise((resolve22) => {
|
|
58554
61423
|
let settled = false;
|
|
58555
61424
|
const done = () => {
|
|
58556
61425
|
if (settled) return;
|
|
58557
61426
|
settled = true;
|
|
58558
|
-
|
|
61427
|
+
resolve22();
|
|
58559
61428
|
};
|
|
58560
61429
|
socket.once("close", done);
|
|
58561
61430
|
socket.end();
|
|
@@ -58691,8 +61560,8 @@ var AdhMuxControlClient = class {
|
|
|
58691
61560
|
}
|
|
58692
61561
|
this.waiters.clear();
|
|
58693
61562
|
});
|
|
58694
|
-
await new Promise((
|
|
58695
|
-
socket.once("connect", () =>
|
|
61563
|
+
await new Promise((resolve4, reject) => {
|
|
61564
|
+
socket.once("connect", () => resolve4());
|
|
58696
61565
|
socket.once("error", reject);
|
|
58697
61566
|
});
|
|
58698
61567
|
}
|
|
@@ -58701,8 +61570,8 @@ var AdhMuxControlClient = class {
|
|
|
58701
61570
|
if (!this.socket) throw new Error("adhmux control socket unavailable");
|
|
58702
61571
|
const requestId = `${Date.now()}-${Math.random().toString(36).slice(2)}`;
|
|
58703
61572
|
const envelope = { kind: "request", requestId, request };
|
|
58704
|
-
const response = await new Promise((
|
|
58705
|
-
this.waiters.set(requestId, { resolve:
|
|
61573
|
+
const response = await new Promise((resolve4, reject) => {
|
|
61574
|
+
this.waiters.set(requestId, { resolve: resolve4, reject });
|
|
58706
61575
|
this.socket?.write(serializeEnvelope2(envelope));
|
|
58707
61576
|
});
|
|
58708
61577
|
return response;
|
|
@@ -58721,12 +61590,12 @@ var AdhMuxControlClient = class {
|
|
|
58721
61590
|
waiter.reject(new Error("adhmux control client closed"));
|
|
58722
61591
|
}
|
|
58723
61592
|
this.waiters.clear();
|
|
58724
|
-
await new Promise((
|
|
61593
|
+
await new Promise((resolve4) => {
|
|
58725
61594
|
let settled = false;
|
|
58726
61595
|
const done = () => {
|
|
58727
61596
|
if (settled) return;
|
|
58728
61597
|
settled = true;
|
|
58729
|
-
|
|
61598
|
+
resolve4();
|
|
58730
61599
|
};
|
|
58731
61600
|
socket.once("close", done);
|
|
58732
61601
|
socket.end();
|
|
@@ -59114,14 +61983,14 @@ var StandaloneServer = class {
|
|
|
59114
61983
|
}
|
|
59115
61984
|
}
|
|
59116
61985
|
async readJsonBody(req) {
|
|
59117
|
-
return await new Promise((
|
|
61986
|
+
return await new Promise((resolve4, reject) => {
|
|
59118
61987
|
let body = "";
|
|
59119
61988
|
req.on("data", (chunk) => {
|
|
59120
61989
|
body += chunk;
|
|
59121
61990
|
});
|
|
59122
61991
|
req.on("end", () => {
|
|
59123
61992
|
try {
|
|
59124
|
-
|
|
61993
|
+
resolve4(body ? JSON.parse(body) : {});
|
|
59125
61994
|
} catch (error48) {
|
|
59126
61995
|
reject(error48);
|
|
59127
61996
|
}
|
|
@@ -59241,9 +62110,9 @@ var StandaloneServer = class {
|
|
|
59241
62110
|
if (this.hasWsGitSubscriptions()) void this.flushWsGitSubscriptions();
|
|
59242
62111
|
}, STATUS_INTERVAL);
|
|
59243
62112
|
this.running = true;
|
|
59244
|
-
await new Promise((
|
|
62113
|
+
await new Promise((resolve4) => {
|
|
59245
62114
|
this.httpServer.listen(port, host, () => {
|
|
59246
|
-
|
|
62115
|
+
resolve4();
|
|
59247
62116
|
});
|
|
59248
62117
|
});
|
|
59249
62118
|
console.log("");
|
|
@@ -59283,8 +62152,8 @@ var StandaloneServer = class {
|
|
|
59283
62152
|
console.log("");
|
|
59284
62153
|
if (options.open !== false) {
|
|
59285
62154
|
try {
|
|
59286
|
-
const
|
|
59287
|
-
await
|
|
62155
|
+
const open2 = (await import("open")).default;
|
|
62156
|
+
await open2(`http://localhost:${port}`);
|
|
59288
62157
|
} catch {
|
|
59289
62158
|
}
|
|
59290
62159
|
}
|