@adhdev/daemon-standalone 0.9.76-rc.41 → 0.9.76-rc.43
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 +441 -454
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/vendor/mcp-server/index.js +156 -177
- 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((resolve2, reject) => {
|
|
9675
|
+
socket.once("connect", () => resolve2());
|
|
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((resolve2, 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
|
+
resolve2(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((resolve2) => {
|
|
9722
9722
|
let settled = false;
|
|
9723
9723
|
const done = () => {
|
|
9724
9724
|
if (settled) return;
|
|
9725
9725
|
settled = true;
|
|
9726
|
-
|
|
9726
|
+
resolve2();
|
|
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 stat = fs5.statSync(helper);
|
|
9784
|
+
if (!(stat.mode & 73)) {
|
|
9785
|
+
fs5.chmodSync(helper, stat.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 = (open, close, parent) => {
|
|
10284
10284
|
let openAll;
|
|
10285
10285
|
let closeAll;
|
|
10286
10286
|
if (parent === void 0) {
|
|
10287
|
-
openAll =
|
|
10287
|
+
openAll = open;
|
|
10288
10288
|
closeAll = close;
|
|
10289
10289
|
} else {
|
|
10290
|
-
openAll = parent.openAll +
|
|
10290
|
+
openAll = parent.openAll + open;
|
|
10291
10291
|
closeAll = close + parent.closeAll;
|
|
10292
10292
|
}
|
|
10293
10293
|
return {
|
|
10294
|
-
open
|
|
10294
|
+
open,
|
|
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((resolve2) => {
|
|
26393
|
+
this.#abortController.signal.addEventListener("abort", () => resolve2());
|
|
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((resolve2, reject) => {
|
|
26543
|
+
this.#pendingResponses.set(id, { resolve: resolve2, reject });
|
|
26544
26544
|
});
|
|
26545
26545
|
await this.#sendMessage({ jsonrpc: "2.0", id, method, params });
|
|
26546
26546
|
return responsePromise;
|
|
@@ -26635,69 +26635,56 @@ var init_acp = __esm({
|
|
|
26635
26635
|
}
|
|
26636
26636
|
});
|
|
26637
26637
|
|
|
26638
|
-
//
|
|
26639
|
-
|
|
26640
|
-
|
|
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"() {
|
|
26638
|
+
// ../../node_modules/readdirp/index.js
|
|
26639
|
+
var require_readdirp = __commonJS({
|
|
26640
|
+
"../../node_modules/readdirp/index.js"(exports2) {
|
|
26658
26641
|
"use strict";
|
|
26659
|
-
|
|
26660
|
-
|
|
26661
|
-
|
|
26662
|
-
|
|
26642
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
26643
|
+
exports2.ReaddirpStream = exports2.EntryTypes = void 0;
|
|
26644
|
+
exports2.readdirp = readdirp;
|
|
26645
|
+
exports2.readdirpPromise = readdirpPromise;
|
|
26646
|
+
var promises_1 = require("fs/promises");
|
|
26647
|
+
var node_stream_1 = require("stream");
|
|
26648
|
+
var node_path_1 = require("path");
|
|
26649
|
+
exports2.EntryTypes = {
|
|
26663
26650
|
FILE_TYPE: "files",
|
|
26664
26651
|
DIR_TYPE: "directories",
|
|
26665
26652
|
FILE_DIR_TYPE: "files_directories",
|
|
26666
26653
|
EVERYTHING_TYPE: "all"
|
|
26667
26654
|
};
|
|
26668
|
-
defaultOptions = {
|
|
26655
|
+
var defaultOptions = {
|
|
26669
26656
|
root: ".",
|
|
26670
26657
|
fileFilter: (_entryInfo) => true,
|
|
26671
26658
|
directoryFilter: (_entryInfo) => true,
|
|
26672
|
-
type: EntryTypes.FILE_TYPE,
|
|
26659
|
+
type: exports2.EntryTypes.FILE_TYPE,
|
|
26673
26660
|
lstat: false,
|
|
26674
26661
|
depth: 2147483648,
|
|
26675
26662
|
alwaysStat: false,
|
|
26676
26663
|
highWaterMark: 4096
|
|
26677
26664
|
};
|
|
26678
26665
|
Object.freeze(defaultOptions);
|
|
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
|
|
26666
|
+
var RECURSIVE_ERROR_CODE = "READDIRP_RECURSIVE_ERROR";
|
|
26667
|
+
var NORMAL_FLOW_ERRORS = /* @__PURE__ */ new Set(["ENOENT", "EPERM", "EACCES", "ELOOP", RECURSIVE_ERROR_CODE]);
|
|
26668
|
+
var ALL_TYPES = [
|
|
26669
|
+
exports2.EntryTypes.DIR_TYPE,
|
|
26670
|
+
exports2.EntryTypes.EVERYTHING_TYPE,
|
|
26671
|
+
exports2.EntryTypes.FILE_DIR_TYPE,
|
|
26672
|
+
exports2.EntryTypes.FILE_TYPE
|
|
26686
26673
|
];
|
|
26687
|
-
DIR_TYPES = /* @__PURE__ */ new Set([
|
|
26688
|
-
EntryTypes.DIR_TYPE,
|
|
26689
|
-
EntryTypes.EVERYTHING_TYPE,
|
|
26690
|
-
EntryTypes.FILE_DIR_TYPE
|
|
26674
|
+
var DIR_TYPES = /* @__PURE__ */ new Set([
|
|
26675
|
+
exports2.EntryTypes.DIR_TYPE,
|
|
26676
|
+
exports2.EntryTypes.EVERYTHING_TYPE,
|
|
26677
|
+
exports2.EntryTypes.FILE_DIR_TYPE
|
|
26691
26678
|
]);
|
|
26692
|
-
FILE_TYPES = /* @__PURE__ */ new Set([
|
|
26693
|
-
EntryTypes.EVERYTHING_TYPE,
|
|
26694
|
-
EntryTypes.FILE_DIR_TYPE,
|
|
26695
|
-
EntryTypes.FILE_TYPE
|
|
26679
|
+
var FILE_TYPES = /* @__PURE__ */ new Set([
|
|
26680
|
+
exports2.EntryTypes.EVERYTHING_TYPE,
|
|
26681
|
+
exports2.EntryTypes.FILE_DIR_TYPE,
|
|
26682
|
+
exports2.EntryTypes.FILE_TYPE
|
|
26696
26683
|
]);
|
|
26697
|
-
isNormalFlowError = (error48) => NORMAL_FLOW_ERRORS.has(error48.code);
|
|
26698
|
-
wantBigintFsStats = process.platform === "win32";
|
|
26699
|
-
emptyFn = (_entryInfo) => true;
|
|
26700
|
-
normalizeFilter = (filter) => {
|
|
26684
|
+
var isNormalFlowError = (error48) => NORMAL_FLOW_ERRORS.has(error48.code);
|
|
26685
|
+
var wantBigintFsStats = process.platform === "win32";
|
|
26686
|
+
var emptyFn = (_entryInfo) => true;
|
|
26687
|
+
var normalizeFilter = (filter) => {
|
|
26701
26688
|
if (filter === void 0)
|
|
26702
26689
|
return emptyFn;
|
|
26703
26690
|
if (typeof filter === "function")
|
|
@@ -26712,21 +26699,7 @@ var init_readdirp = __esm({
|
|
|
26712
26699
|
}
|
|
26713
26700
|
return emptyFn;
|
|
26714
26701
|
};
|
|
26715
|
-
ReaddirpStream = class extends
|
|
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;
|
|
26702
|
+
var ReaddirpStream = class extends node_stream_1.Readable {
|
|
26730
26703
|
constructor(options = {}) {
|
|
26731
26704
|
super({
|
|
26732
26705
|
objectMode: true,
|
|
@@ -26737,17 +26710,17 @@ var init_readdirp = __esm({
|
|
|
26737
26710
|
const { root, type } = opts;
|
|
26738
26711
|
this._fileFilter = normalizeFilter(opts.fileFilter);
|
|
26739
26712
|
this._directoryFilter = normalizeFilter(opts.directoryFilter);
|
|
26740
|
-
const statMethod = opts.lstat ?
|
|
26713
|
+
const statMethod = opts.lstat ? promises_1.lstat : promises_1.stat;
|
|
26741
26714
|
if (wantBigintFsStats) {
|
|
26742
26715
|
this._stat = (path5) => statMethod(path5, { bigint: true });
|
|
26743
26716
|
} else {
|
|
26744
26717
|
this._stat = statMethod;
|
|
26745
26718
|
}
|
|
26746
|
-
this._maxDepth = opts.depth
|
|
26719
|
+
this._maxDepth = opts.depth ?? defaultOptions.depth;
|
|
26747
26720
|
this._wantsDir = type ? DIR_TYPES.has(type) : false;
|
|
26748
26721
|
this._wantsFile = type ? FILE_TYPES.has(type) : false;
|
|
26749
|
-
this._wantsEverything = type === EntryTypes.EVERYTHING_TYPE;
|
|
26750
|
-
this._root = (0,
|
|
26722
|
+
this._wantsEverything = type === exports2.EntryTypes.EVERYTHING_TYPE;
|
|
26723
|
+
this._root = (0, node_path_1.resolve)(root);
|
|
26751
26724
|
this._isDirent = !opts.alwaysStat;
|
|
26752
26725
|
this._statsProp = this._isDirent ? "dirent" : "stats";
|
|
26753
26726
|
this._rdOptions = { encoding: "utf8", withFileTypes: this._isDirent };
|
|
@@ -26808,7 +26781,7 @@ var init_readdirp = __esm({
|
|
|
26808
26781
|
async _exploreDir(path5, depth) {
|
|
26809
26782
|
let files;
|
|
26810
26783
|
try {
|
|
26811
|
-
files = await (0,
|
|
26784
|
+
files = await (0, promises_1.readdir)(path5, this._rdOptions);
|
|
26812
26785
|
} catch (error48) {
|
|
26813
26786
|
this._onError(error48);
|
|
26814
26787
|
}
|
|
@@ -26816,10 +26789,10 @@ var init_readdirp = __esm({
|
|
|
26816
26789
|
}
|
|
26817
26790
|
async _formatEntry(dirent, path5) {
|
|
26818
26791
|
let entry;
|
|
26819
|
-
const
|
|
26792
|
+
const basename = this._isDirent ? dirent.name : dirent;
|
|
26820
26793
|
try {
|
|
26821
|
-
const fullPath = (0,
|
|
26822
|
-
entry = { path: (0,
|
|
26794
|
+
const fullPath = (0, node_path_1.resolve)((0, node_path_1.join)(path5, basename));
|
|
26795
|
+
entry = { path: (0, node_path_1.relative)(this._root, fullPath), fullPath, basename };
|
|
26823
26796
|
entry[this._statsProp] = this._isDirent ? dirent : await this._stat(fullPath);
|
|
26824
26797
|
} catch (err) {
|
|
26825
26798
|
this._onError(err);
|
|
@@ -26846,14 +26819,14 @@ var init_readdirp = __esm({
|
|
|
26846
26819
|
if (stats && stats.isSymbolicLink()) {
|
|
26847
26820
|
const full = entry.fullPath;
|
|
26848
26821
|
try {
|
|
26849
|
-
const entryRealPath = await (0,
|
|
26850
|
-
const entryRealPathStats = await (0,
|
|
26822
|
+
const entryRealPath = await (0, promises_1.realpath)(full);
|
|
26823
|
+
const entryRealPathStats = await (0, promises_1.lstat)(entryRealPath);
|
|
26851
26824
|
if (entryRealPathStats.isFile()) {
|
|
26852
26825
|
return "file";
|
|
26853
26826
|
}
|
|
26854
26827
|
if (entryRealPathStats.isDirectory()) {
|
|
26855
26828
|
const len = entryRealPath.length;
|
|
26856
|
-
if (full.startsWith(entryRealPath) && full.substr(len, 1) ===
|
|
26829
|
+
if (full.startsWith(entryRealPath) && full.substr(len, 1) === node_path_1.sep) {
|
|
26857
26830
|
const recursiveError = new Error(`Circular symlink detected: "${full}" points to "${entryRealPath}"`);
|
|
26858
26831
|
recursiveError.code = RECURSIVE_ERROR_CODE;
|
|
26859
26832
|
return this._onError(recursiveError);
|
|
@@ -26871,47 +26844,58 @@ var init_readdirp = __esm({
|
|
|
26871
26844
|
return stats && this._wantsEverything && !stats.isDirectory();
|
|
26872
26845
|
}
|
|
26873
26846
|
};
|
|
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;
|
|
26874
26871
|
}
|
|
26875
26872
|
});
|
|
26876
26873
|
|
|
26877
|
-
//
|
|
26878
|
-
|
|
26879
|
-
|
|
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"() {
|
|
26874
|
+
// ../../node_modules/chokidar/handler.js
|
|
26875
|
+
var require_handler = __commonJS({
|
|
26876
|
+
"../../node_modules/chokidar/handler.js"(exports2) {
|
|
26898
26877
|
"use strict";
|
|
26899
|
-
|
|
26900
|
-
|
|
26901
|
-
|
|
26902
|
-
|
|
26903
|
-
|
|
26904
|
-
|
|
26905
|
-
|
|
26906
|
-
|
|
26907
|
-
|
|
26908
|
-
|
|
26909
|
-
|
|
26910
|
-
|
|
26911
|
-
|
|
26912
|
-
|
|
26913
|
-
|
|
26914
|
-
|
|
26878
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
26879
|
+
exports2.NodeFsHandler = exports2.EVENTS = exports2.isIBMi = exports2.isFreeBSD = exports2.isLinux = exports2.isMacos = exports2.isWindows = exports2.IDENTITY_FN = exports2.EMPTY_FN = exports2.STR_CLOSE = exports2.STR_END = exports2.STR_DATA = void 0;
|
|
26880
|
+
var fs_1 = require("fs");
|
|
26881
|
+
var promises_1 = require("fs/promises");
|
|
26882
|
+
var sysPath = require("path");
|
|
26883
|
+
var os_1 = require("os");
|
|
26884
|
+
exports2.STR_DATA = "data";
|
|
26885
|
+
exports2.STR_END = "end";
|
|
26886
|
+
exports2.STR_CLOSE = "close";
|
|
26887
|
+
var EMPTY_FN = () => {
|
|
26888
|
+
};
|
|
26889
|
+
exports2.EMPTY_FN = EMPTY_FN;
|
|
26890
|
+
var IDENTITY_FN = (val) => val;
|
|
26891
|
+
exports2.IDENTITY_FN = IDENTITY_FN;
|
|
26892
|
+
var pl = process.platform;
|
|
26893
|
+
exports2.isWindows = pl === "win32";
|
|
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 = {
|
|
26915
26899
|
ALL: "all",
|
|
26916
26900
|
READY: "ready",
|
|
26917
26901
|
ADD: "add",
|
|
@@ -26922,14 +26906,14 @@ var init_handler = __esm({
|
|
|
26922
26906
|
RAW: "raw",
|
|
26923
26907
|
ERROR: "error"
|
|
26924
26908
|
};
|
|
26925
|
-
EV = EVENTS;
|
|
26926
|
-
THROTTLE_MODE_WATCH = "watch";
|
|
26927
|
-
statMethods = { lstat:
|
|
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([
|
|
26909
|
+
var EV = exports2.EVENTS;
|
|
26910
|
+
var THROTTLE_MODE_WATCH = "watch";
|
|
26911
|
+
var statMethods = { lstat: promises_1.lstat, stat: promises_1.stat };
|
|
26912
|
+
var KEY_LISTENERS = "listeners";
|
|
26913
|
+
var KEY_ERR = "errHandlers";
|
|
26914
|
+
var KEY_RAW = "rawEmitters";
|
|
26915
|
+
var HANDLER_KEYS = [KEY_LISTENERS, KEY_ERR, KEY_RAW];
|
|
26916
|
+
var binaryExtensions = /* @__PURE__ */ new Set([
|
|
26933
26917
|
"3dm",
|
|
26934
26918
|
"3ds",
|
|
26935
26919
|
"3g2",
|
|
@@ -27192,22 +27176,22 @@ var init_handler = __esm({
|
|
|
27192
27176
|
"zip",
|
|
27193
27177
|
"zipx"
|
|
27194
27178
|
]);
|
|
27195
|
-
isBinaryPath = (filePath) => binaryExtensions.has(
|
|
27196
|
-
foreach = (val, fn2) => {
|
|
27179
|
+
var isBinaryPath = (filePath) => binaryExtensions.has(sysPath.extname(filePath).slice(1).toLowerCase());
|
|
27180
|
+
var foreach = (val, fn2) => {
|
|
27197
27181
|
if (val instanceof Set) {
|
|
27198
27182
|
val.forEach(fn2);
|
|
27199
27183
|
} else {
|
|
27200
27184
|
fn2(val);
|
|
27201
27185
|
}
|
|
27202
27186
|
};
|
|
27203
|
-
addAndConvert = (main2, prop, item) => {
|
|
27187
|
+
var addAndConvert = (main2, prop, item) => {
|
|
27204
27188
|
let container = main2[prop];
|
|
27205
27189
|
if (!(container instanceof Set)) {
|
|
27206
27190
|
main2[prop] = container = /* @__PURE__ */ new Set([container]);
|
|
27207
27191
|
}
|
|
27208
27192
|
container.add(item);
|
|
27209
27193
|
};
|
|
27210
|
-
clearItem = (cont) => (key) => {
|
|
27194
|
+
var clearItem = (cont) => (key) => {
|
|
27211
27195
|
const set2 = cont[key];
|
|
27212
27196
|
if (set2 instanceof Set) {
|
|
27213
27197
|
set2.clear();
|
|
@@ -27215,7 +27199,7 @@ var init_handler = __esm({
|
|
|
27215
27199
|
delete cont[key];
|
|
27216
27200
|
}
|
|
27217
27201
|
};
|
|
27218
|
-
delFromSet = (main2, prop, item) => {
|
|
27202
|
+
var delFromSet = (main2, prop, item) => {
|
|
27219
27203
|
const container = main2[prop];
|
|
27220
27204
|
if (container instanceof Set) {
|
|
27221
27205
|
container.delete(item);
|
|
@@ -27223,9 +27207,26 @@ var init_handler = __esm({
|
|
|
27223
27207
|
delete main2[prop];
|
|
27224
27208
|
}
|
|
27225
27209
|
};
|
|
27226
|
-
isEmptySet = (val) => val instanceof Set ? val.size === 0 : !val;
|
|
27227
|
-
FsWatchInstances = /* @__PURE__ */ new Map();
|
|
27228
|
-
|
|
27210
|
+
var isEmptySet = (val) => val instanceof Set ? val.size === 0 : !val;
|
|
27211
|
+
var FsWatchInstances = /* @__PURE__ */ new Map();
|
|
27212
|
+
function createFsWatchInstance(path5, options, listener, errHandler, emitRaw) {
|
|
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) => {
|
|
27229
27230
|
const cont = FsWatchInstances.get(fullPath);
|
|
27230
27231
|
if (!cont)
|
|
27231
27232
|
return;
|
|
@@ -27233,7 +27234,7 @@ var init_handler = __esm({
|
|
|
27233
27234
|
listener(val1, val2, val3);
|
|
27234
27235
|
});
|
|
27235
27236
|
};
|
|
27236
|
-
setFsWatchListener = (path5, fullPath, options, handlers) => {
|
|
27237
|
+
var setFsWatchListener = (path5, fullPath, options, handlers) => {
|
|
27237
27238
|
const { listener, errHandler, rawEmitter } = handlers;
|
|
27238
27239
|
let cont = FsWatchInstances.get(fullPath);
|
|
27239
27240
|
let watcher;
|
|
@@ -27262,9 +27263,9 @@ var init_handler = __esm({
|
|
|
27262
27263
|
const broadcastErr = fsWatchBroadcast.bind(null, fullPath, KEY_ERR);
|
|
27263
27264
|
if (cont)
|
|
27264
27265
|
cont.watcherUnusable = true;
|
|
27265
|
-
if (isWindows && error48.code === "EPERM") {
|
|
27266
|
+
if (exports2.isWindows && error48.code === "EPERM") {
|
|
27266
27267
|
try {
|
|
27267
|
-
const fd = await (0,
|
|
27268
|
+
const fd = await (0, promises_1.open)(path5, "r");
|
|
27268
27269
|
await fd.close();
|
|
27269
27270
|
broadcastErr(error48);
|
|
27270
27271
|
} catch (err) {
|
|
@@ -27294,13 +27295,13 @@ var init_handler = __esm({
|
|
|
27294
27295
|
}
|
|
27295
27296
|
};
|
|
27296
27297
|
};
|
|
27297
|
-
FsWatchFileInstances = /* @__PURE__ */ new Map();
|
|
27298
|
-
setFsWatchFileListener = (path5, fullPath, options, handlers) => {
|
|
27298
|
+
var FsWatchFileInstances = /* @__PURE__ */ new Map();
|
|
27299
|
+
var setFsWatchFileListener = (path5, fullPath, options, handlers) => {
|
|
27299
27300
|
const { listener, rawEmitter } = handlers;
|
|
27300
27301
|
let cont = FsWatchFileInstances.get(fullPath);
|
|
27301
27302
|
const copts = cont && cont.options;
|
|
27302
27303
|
if (copts && (copts.persistent < options.persistent || copts.interval > options.interval)) {
|
|
27303
|
-
(0,
|
|
27304
|
+
(0, fs_1.unwatchFile)(fullPath);
|
|
27304
27305
|
cont = void 0;
|
|
27305
27306
|
}
|
|
27306
27307
|
if (cont) {
|
|
@@ -27311,7 +27312,7 @@ var init_handler = __esm({
|
|
|
27311
27312
|
listeners: listener,
|
|
27312
27313
|
rawEmitters: rawEmitter,
|
|
27313
27314
|
options,
|
|
27314
|
-
watcher: (0,
|
|
27315
|
+
watcher: (0, fs_1.watchFile)(fullPath, options, (curr, prev) => {
|
|
27315
27316
|
foreach(cont.rawEmitters, (rawEmitter2) => {
|
|
27316
27317
|
rawEmitter2(EV.CHANGE, fullPath, { curr, prev });
|
|
27317
27318
|
});
|
|
@@ -27328,15 +27329,13 @@ var init_handler = __esm({
|
|
|
27328
27329
|
delFromSet(cont, KEY_RAW, rawEmitter);
|
|
27329
27330
|
if (isEmptySet(cont.listeners)) {
|
|
27330
27331
|
FsWatchFileInstances.delete(fullPath);
|
|
27331
|
-
(0,
|
|
27332
|
+
(0, fs_1.unwatchFile)(fullPath);
|
|
27332
27333
|
cont.options = cont.watcher = void 0;
|
|
27333
27334
|
Object.freeze(cont);
|
|
27334
27335
|
}
|
|
27335
27336
|
};
|
|
27336
27337
|
};
|
|
27337
|
-
NodeFsHandler = class {
|
|
27338
|
-
fsw;
|
|
27339
|
-
_boundHandleError;
|
|
27338
|
+
var NodeFsHandler = class {
|
|
27340
27339
|
constructor(fsW) {
|
|
27341
27340
|
this.fsw = fsW;
|
|
27342
27341
|
this._boundHandleError = (error48) => fsW._handleError(error48);
|
|
@@ -27349,20 +27348,20 @@ var init_handler = __esm({
|
|
|
27349
27348
|
*/
|
|
27350
27349
|
_watchWithNodeFs(path5, listener) {
|
|
27351
27350
|
const opts = this.fsw.options;
|
|
27352
|
-
const directory =
|
|
27353
|
-
const
|
|
27351
|
+
const directory = sysPath.dirname(path5);
|
|
27352
|
+
const basename = sysPath.basename(path5);
|
|
27354
27353
|
const parent = this.fsw._getWatchedDir(directory);
|
|
27355
|
-
parent.add(
|
|
27356
|
-
const absolutePath =
|
|
27354
|
+
parent.add(basename);
|
|
27355
|
+
const absolutePath = sysPath.resolve(path5);
|
|
27357
27356
|
const options = {
|
|
27358
27357
|
persistent: opts.persistent
|
|
27359
27358
|
};
|
|
27360
27359
|
if (!listener)
|
|
27361
|
-
listener = EMPTY_FN;
|
|
27360
|
+
listener = exports2.EMPTY_FN;
|
|
27362
27361
|
let closer;
|
|
27363
27362
|
if (opts.usePolling) {
|
|
27364
27363
|
const enableBin = opts.interval !== opts.binaryInterval;
|
|
27365
|
-
options.interval = enableBin && isBinaryPath(
|
|
27364
|
+
options.interval = enableBin && isBinaryPath(basename) ? opts.binaryInterval : opts.interval;
|
|
27366
27365
|
closer = setFsWatchFileListener(path5, absolutePath, options, {
|
|
27367
27366
|
listener,
|
|
27368
27367
|
rawEmitter: this.fsw._emitRaw
|
|
@@ -27384,18 +27383,18 @@ var init_handler = __esm({
|
|
|
27384
27383
|
if (this.fsw.closed) {
|
|
27385
27384
|
return;
|
|
27386
27385
|
}
|
|
27387
|
-
const
|
|
27388
|
-
const
|
|
27389
|
-
const parent = this.fsw._getWatchedDir(
|
|
27386
|
+
const dirname3 = sysPath.dirname(file2);
|
|
27387
|
+
const basename = sysPath.basename(file2);
|
|
27388
|
+
const parent = this.fsw._getWatchedDir(dirname3);
|
|
27390
27389
|
let prevStats = stats;
|
|
27391
|
-
if (parent.has(
|
|
27390
|
+
if (parent.has(basename))
|
|
27392
27391
|
return;
|
|
27393
27392
|
const listener = async (path5, newStats) => {
|
|
27394
27393
|
if (!this.fsw._throttle(THROTTLE_MODE_WATCH, file2, 5))
|
|
27395
27394
|
return;
|
|
27396
27395
|
if (!newStats || newStats.mtimeMs === 0) {
|
|
27397
27396
|
try {
|
|
27398
|
-
const newStats2 = await (0,
|
|
27397
|
+
const newStats2 = await (0, promises_1.stat)(file2);
|
|
27399
27398
|
if (this.fsw.closed)
|
|
27400
27399
|
return;
|
|
27401
27400
|
const at2 = newStats2.atimeMs;
|
|
@@ -27403,7 +27402,7 @@ var init_handler = __esm({
|
|
|
27403
27402
|
if (!at2 || at2 <= mt2 || mt2 !== prevStats.mtimeMs) {
|
|
27404
27403
|
this.fsw._emit(EV.CHANGE, file2, newStats2);
|
|
27405
27404
|
}
|
|
27406
|
-
if ((isMacos || isLinux || isFreeBSD) && prevStats.ino !== newStats2.ino) {
|
|
27405
|
+
if ((exports2.isMacos || exports2.isLinux || exports2.isFreeBSD) && prevStats.ino !== newStats2.ino) {
|
|
27407
27406
|
this.fsw._closeFile(path5);
|
|
27408
27407
|
prevStats = newStats2;
|
|
27409
27408
|
const closer2 = this._watchWithNodeFs(file2, listener);
|
|
@@ -27413,9 +27412,9 @@ var init_handler = __esm({
|
|
|
27413
27412
|
prevStats = newStats2;
|
|
27414
27413
|
}
|
|
27415
27414
|
} catch (error48) {
|
|
27416
|
-
this.fsw._remove(
|
|
27415
|
+
this.fsw._remove(dirname3, basename);
|
|
27417
27416
|
}
|
|
27418
|
-
} else if (parent.has(
|
|
27417
|
+
} else if (parent.has(basename)) {
|
|
27419
27418
|
const at2 = newStats.atimeMs;
|
|
27420
27419
|
const mt2 = newStats.mtimeMs;
|
|
27421
27420
|
if (!at2 || at2 <= mt2 || mt2 !== prevStats.mtimeMs) {
|
|
@@ -27450,7 +27449,7 @@ var init_handler = __esm({
|
|
|
27450
27449
|
this.fsw._incrReadyCount();
|
|
27451
27450
|
let linkPath;
|
|
27452
27451
|
try {
|
|
27453
|
-
linkPath = await (0,
|
|
27452
|
+
linkPath = await (0, promises_1.realpath)(path5);
|
|
27454
27453
|
} catch (e) {
|
|
27455
27454
|
this.fsw._emitReady();
|
|
27456
27455
|
return true;
|
|
@@ -27476,9 +27475,8 @@ var init_handler = __esm({
|
|
|
27476
27475
|
this.fsw._symlinkPaths.set(full, true);
|
|
27477
27476
|
}
|
|
27478
27477
|
_handleRead(directory, initialAdd, wh, target, dir, depth, throttler) {
|
|
27479
|
-
directory =
|
|
27480
|
-
|
|
27481
|
-
throttler = this.fsw._throttle("readdir", throttleKey, 1e3);
|
|
27478
|
+
directory = sysPath.join(directory, "");
|
|
27479
|
+
throttler = this.fsw._throttle("readdir", directory, 1e3);
|
|
27482
27480
|
if (!throttler)
|
|
27483
27481
|
return;
|
|
27484
27482
|
const previous = this.fsw._getWatchedDir(wh.path);
|
|
@@ -27489,13 +27487,13 @@ var init_handler = __esm({
|
|
|
27489
27487
|
});
|
|
27490
27488
|
if (!stream)
|
|
27491
27489
|
return;
|
|
27492
|
-
stream.on(STR_DATA, async (entry) => {
|
|
27490
|
+
stream.on(exports2.STR_DATA, async (entry) => {
|
|
27493
27491
|
if (this.fsw.closed) {
|
|
27494
27492
|
stream = void 0;
|
|
27495
27493
|
return;
|
|
27496
27494
|
}
|
|
27497
27495
|
const item = entry.path;
|
|
27498
|
-
let path5 =
|
|
27496
|
+
let path5 = sysPath.join(directory, item);
|
|
27499
27497
|
current.add(item);
|
|
27500
27498
|
if (entry.stats.isSymbolicLink() && await this._handleSymlink(entry, directory, path5, item)) {
|
|
27501
27499
|
return;
|
|
@@ -27506,20 +27504,20 @@ var init_handler = __esm({
|
|
|
27506
27504
|
}
|
|
27507
27505
|
if (item === target || !target && !previous.has(item)) {
|
|
27508
27506
|
this.fsw._incrReadyCount();
|
|
27509
|
-
path5 =
|
|
27507
|
+
path5 = sysPath.join(dir, sysPath.relative(dir, path5));
|
|
27510
27508
|
this._addToNodeFs(path5, initialAdd, wh, depth + 1);
|
|
27511
27509
|
}
|
|
27512
27510
|
}).on(EV.ERROR, this._boundHandleError);
|
|
27513
|
-
return new Promise((
|
|
27511
|
+
return new Promise((resolve2, reject) => {
|
|
27514
27512
|
if (!stream)
|
|
27515
27513
|
return reject();
|
|
27516
|
-
stream.once(STR_END, () => {
|
|
27514
|
+
stream.once(exports2.STR_END, () => {
|
|
27517
27515
|
if (this.fsw.closed) {
|
|
27518
27516
|
stream = void 0;
|
|
27519
27517
|
return;
|
|
27520
27518
|
}
|
|
27521
27519
|
const wasThrottled = throttler ? throttler.clear() : false;
|
|
27522
|
-
|
|
27520
|
+
resolve2(void 0);
|
|
27523
27521
|
previous.getChildren().filter((item) => {
|
|
27524
27522
|
return item !== directory && !current.has(item);
|
|
27525
27523
|
}).forEach((item) => {
|
|
@@ -27542,18 +27540,18 @@ var init_handler = __esm({
|
|
|
27542
27540
|
* @param realpath
|
|
27543
27541
|
* @returns closer for the watcher instance.
|
|
27544
27542
|
*/
|
|
27545
|
-
async _handleDir(dir, stats, initialAdd, depth, target, wh,
|
|
27546
|
-
const parentDir = this.fsw._getWatchedDir(
|
|
27547
|
-
const tracked = parentDir.has(
|
|
27543
|
+
async _handleDir(dir, stats, initialAdd, depth, target, wh, realpath) {
|
|
27544
|
+
const parentDir = this.fsw._getWatchedDir(sysPath.dirname(dir));
|
|
27545
|
+
const tracked = parentDir.has(sysPath.basename(dir));
|
|
27548
27546
|
if (!(initialAdd && this.fsw.options.ignoreInitial) && !target && !tracked) {
|
|
27549
27547
|
this.fsw._emit(EV.ADD_DIR, dir, stats);
|
|
27550
27548
|
}
|
|
27551
|
-
parentDir.add(
|
|
27549
|
+
parentDir.add(sysPath.basename(dir));
|
|
27552
27550
|
this.fsw._getWatchedDir(dir);
|
|
27553
27551
|
let throttler;
|
|
27554
27552
|
let closer;
|
|
27555
27553
|
const oDepth = this.fsw.options.depth;
|
|
27556
|
-
if ((oDepth == null || depth <= oDepth) && !this.fsw._symlinkPaths.has(
|
|
27554
|
+
if ((oDepth == null || depth <= oDepth) && !this.fsw._symlinkPaths.has(realpath)) {
|
|
27557
27555
|
if (!target) {
|
|
27558
27556
|
await this._handleRead(dir, initialAdd, wh, target, dir, depth, throttler);
|
|
27559
27557
|
if (this.fsw.closed)
|
|
@@ -27598,8 +27596,8 @@ var init_handler = __esm({
|
|
|
27598
27596
|
const follow = this.fsw.options.followSymlinks;
|
|
27599
27597
|
let closer;
|
|
27600
27598
|
if (stats.isDirectory()) {
|
|
27601
|
-
const absPath =
|
|
27602
|
-
const targetPath = follow ? await (0,
|
|
27599
|
+
const absPath = sysPath.resolve(path5);
|
|
27600
|
+
const targetPath = follow ? await (0, promises_1.realpath)(path5) : path5;
|
|
27603
27601
|
if (this.fsw.closed)
|
|
27604
27602
|
return;
|
|
27605
27603
|
closer = await this._handleDir(wh.watchPath, stats, initialAdd, depth, target, wh, targetPath);
|
|
@@ -27609,17 +27607,17 @@ var init_handler = __esm({
|
|
|
27609
27607
|
this.fsw._symlinkPaths.set(absPath, targetPath);
|
|
27610
27608
|
}
|
|
27611
27609
|
} else if (stats.isSymbolicLink()) {
|
|
27612
|
-
const targetPath = follow ? await (0,
|
|
27610
|
+
const targetPath = follow ? await (0, promises_1.realpath)(path5) : path5;
|
|
27613
27611
|
if (this.fsw.closed)
|
|
27614
27612
|
return;
|
|
27615
|
-
const parent =
|
|
27613
|
+
const parent = sysPath.dirname(wh.watchPath);
|
|
27616
27614
|
this.fsw._getWatchedDir(parent).add(wh.watchPath);
|
|
27617
27615
|
this.fsw._emit(EV.ADD, wh.watchPath, stats);
|
|
27618
27616
|
closer = await this._handleDir(parent, stats, initialAdd, depth, path5, wh, targetPath);
|
|
27619
27617
|
if (this.fsw.closed)
|
|
27620
27618
|
return;
|
|
27621
27619
|
if (targetPath !== void 0) {
|
|
27622
|
-
this.fsw._symlinkPaths.set(
|
|
27620
|
+
this.fsw._symlinkPaths.set(sysPath.resolve(path5), targetPath);
|
|
27623
27621
|
}
|
|
27624
27622
|
} else {
|
|
27625
27623
|
closer = this._handleFile(wh.watchPath, stats, initialAdd);
|
|
@@ -27636,142 +27634,134 @@ var init_handler = __esm({
|
|
|
27636
27634
|
}
|
|
27637
27635
|
}
|
|
27638
27636
|
};
|
|
27637
|
+
exports2.NodeFsHandler = NodeFsHandler;
|
|
27639
27638
|
}
|
|
27640
27639
|
});
|
|
27641
27640
|
|
|
27642
|
-
//
|
|
27643
|
-
var
|
|
27644
|
-
|
|
27645
|
-
|
|
27646
|
-
|
|
27647
|
-
|
|
27648
|
-
|
|
27649
|
-
|
|
27650
|
-
|
|
27651
|
-
|
|
27652
|
-
|
|
27653
|
-
|
|
27654
|
-
|
|
27655
|
-
|
|
27656
|
-
|
|
27657
|
-
|
|
27658
|
-
|
|
27659
|
-
|
|
27660
|
-
|
|
27661
|
-
|
|
27662
|
-
|
|
27663
|
-
|
|
27664
|
-
|
|
27665
|
-
|
|
27666
|
-
|
|
27641
|
+
// ../../node_modules/chokidar/index.js
|
|
27642
|
+
var require_chokidar = __commonJS({
|
|
27643
|
+
"../../node_modules/chokidar/index.js"(exports2) {
|
|
27644
|
+
"use strict";
|
|
27645
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
27646
|
+
exports2.FSWatcher = exports2.WatchHelper = void 0;
|
|
27647
|
+
exports2.watch = watch;
|
|
27648
|
+
var fs_1 = require("fs");
|
|
27649
|
+
var promises_1 = require("fs/promises");
|
|
27650
|
+
var events_1 = require("events");
|
|
27651
|
+
var sysPath = require("path");
|
|
27652
|
+
var readdirp_1 = require_readdirp();
|
|
27653
|
+
var handler_js_1 = require_handler();
|
|
27654
|
+
var SLASH = "/";
|
|
27655
|
+
var SLASH_SLASH = "//";
|
|
27656
|
+
var ONE_DOT = ".";
|
|
27657
|
+
var TWO_DOTS = "..";
|
|
27658
|
+
var STRING_TYPE = "string";
|
|
27659
|
+
var BACK_SLASH_RE = /\\/g;
|
|
27660
|
+
var DOUBLE_SLASH_RE = /\/\//;
|
|
27661
|
+
var DOT_RE = /\..*\.(sw[px])$|~$|\.subl.*\.tmp/;
|
|
27662
|
+
var REPLACER_RE = /^\.[/\\]/;
|
|
27663
|
+
function arrify(item) {
|
|
27664
|
+
return Array.isArray(item) ? item : [item];
|
|
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
|
+
}
|
|
27667
27685
|
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;
|
|
27668
27711
|
}
|
|
27669
|
-
return !relative3.startsWith("..") && !sp2.isAbsolute(relative3);
|
|
27670
27712
|
}
|
|
27671
27713
|
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;
|
|
27695
27714
|
}
|
|
27696
|
-
|
|
27697
|
-
|
|
27698
|
-
|
|
27699
|
-
|
|
27700
|
-
|
|
27701
|
-
|
|
27702
|
-
|
|
27703
|
-
|
|
27704
|
-
|
|
27705
|
-
|
|
27706
|
-
|
|
27707
|
-
return matchPatterns(patterns,
|
|
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_) => {
|
|
27715
|
+
function anymatch(matchers, testString) {
|
|
27716
|
+
if (matchers == null) {
|
|
27717
|
+
throw new TypeError("anymatch: specify first argument");
|
|
27718
|
+
}
|
|
27719
|
+
const matchersArray = arrify(matchers);
|
|
27720
|
+
const patterns = matchersArray.map((matcher) => createPattern(matcher));
|
|
27721
|
+
if (testString == null) {
|
|
27722
|
+
return (testString2, stats) => {
|
|
27723
|
+
return matchPatterns(patterns, testString2, stats);
|
|
27724
|
+
};
|
|
27725
|
+
}
|
|
27726
|
+
return matchPatterns(patterns, testString);
|
|
27727
|
+
}
|
|
27728
|
+
var unifyPaths = (paths_) => {
|
|
27738
27729
|
const paths = arrify(paths_).flat();
|
|
27739
27730
|
if (!paths.every((p) => typeof p === STRING_TYPE)) {
|
|
27740
27731
|
throw new TypeError(`Non-string provided as watch path: ${paths}`);
|
|
27741
27732
|
}
|
|
27742
27733
|
return paths.map(normalizePathToUnix);
|
|
27743
27734
|
};
|
|
27744
|
-
toUnix = (string4) => {
|
|
27735
|
+
var toUnix = (string4) => {
|
|
27745
27736
|
let str = string4.replace(BACK_SLASH_RE, SLASH);
|
|
27746
27737
|
let prepend = false;
|
|
27747
27738
|
if (str.startsWith(SLASH_SLASH)) {
|
|
27748
27739
|
prepend = true;
|
|
27749
27740
|
}
|
|
27750
|
-
|
|
27741
|
+
while (str.match(DOUBLE_SLASH_RE)) {
|
|
27742
|
+
str = str.replace(DOUBLE_SLASH_RE, SLASH);
|
|
27743
|
+
}
|
|
27751
27744
|
if (prepend) {
|
|
27752
27745
|
str = SLASH + str;
|
|
27753
27746
|
}
|
|
27754
27747
|
return str;
|
|
27755
27748
|
};
|
|
27756
|
-
normalizePathToUnix = (path5) => toUnix(
|
|
27757
|
-
normalizeIgnored = (cwd = "") => (path5) => {
|
|
27749
|
+
var normalizePathToUnix = (path5) => toUnix(sysPath.normalize(toUnix(path5)));
|
|
27750
|
+
var normalizeIgnored = (cwd = "") => (path5) => {
|
|
27758
27751
|
if (typeof path5 === "string") {
|
|
27759
|
-
return normalizePathToUnix(
|
|
27752
|
+
return normalizePathToUnix(sysPath.isAbsolute(path5) ? path5 : sysPath.join(cwd, path5));
|
|
27760
27753
|
} else {
|
|
27761
27754
|
return path5;
|
|
27762
27755
|
}
|
|
27763
27756
|
};
|
|
27764
|
-
getAbsolutePath = (path5, cwd) => {
|
|
27765
|
-
if (
|
|
27757
|
+
var getAbsolutePath = (path5, cwd) => {
|
|
27758
|
+
if (sysPath.isAbsolute(path5)) {
|
|
27766
27759
|
return path5;
|
|
27767
27760
|
}
|
|
27768
|
-
return
|
|
27761
|
+
return sysPath.join(cwd, path5);
|
|
27769
27762
|
};
|
|
27770
|
-
EMPTY_SET = Object.freeze(/* @__PURE__ */ new Set());
|
|
27771
|
-
DirEntry = class {
|
|
27772
|
-
path;
|
|
27773
|
-
_removeWatcher;
|
|
27774
|
-
items;
|
|
27763
|
+
var EMPTY_SET = Object.freeze(/* @__PURE__ */ new Set());
|
|
27764
|
+
var DirEntry = class {
|
|
27775
27765
|
constructor(dir, removeWatcher) {
|
|
27776
27766
|
this.path = dir;
|
|
27777
27767
|
this._removeWatcher = removeWatcher;
|
|
@@ -27793,10 +27783,10 @@ var init_chokidar = __esm({
|
|
|
27793
27783
|
return;
|
|
27794
27784
|
const dir = this.path;
|
|
27795
27785
|
try {
|
|
27796
|
-
await (0,
|
|
27786
|
+
await (0, promises_1.readdir)(dir);
|
|
27797
27787
|
} catch (err) {
|
|
27798
27788
|
if (this._removeWatcher) {
|
|
27799
|
-
this._removeWatcher(
|
|
27789
|
+
this._removeWatcher(sysPath.dirname(dir), sysPath.basename(dir));
|
|
27800
27790
|
}
|
|
27801
27791
|
}
|
|
27802
27792
|
}
|
|
@@ -27815,27 +27805,20 @@ var init_chokidar = __esm({
|
|
|
27815
27805
|
dispose() {
|
|
27816
27806
|
this.items.clear();
|
|
27817
27807
|
this.path = "";
|
|
27818
|
-
this._removeWatcher = EMPTY_FN;
|
|
27808
|
+
this._removeWatcher = handler_js_1.EMPTY_FN;
|
|
27819
27809
|
this.items = EMPTY_SET;
|
|
27820
27810
|
Object.freeze(this);
|
|
27821
27811
|
}
|
|
27822
27812
|
};
|
|
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;
|
|
27813
|
+
var STAT_METHOD_F = "stat";
|
|
27814
|
+
var STAT_METHOD_L = "lstat";
|
|
27815
|
+
var WatchHelper = class {
|
|
27833
27816
|
constructor(path5, follow, fsw) {
|
|
27834
27817
|
this.fsw = fsw;
|
|
27835
27818
|
const watchPath = path5;
|
|
27836
27819
|
this.path = path5 = path5.replace(REPLACER_RE, "");
|
|
27837
27820
|
this.watchPath = watchPath;
|
|
27838
|
-
this.fullWatchPath =
|
|
27821
|
+
this.fullWatchPath = sysPath.resolve(watchPath);
|
|
27839
27822
|
this.dirParts = [];
|
|
27840
27823
|
this.dirParts.forEach((parts) => {
|
|
27841
27824
|
if (parts.length > 1)
|
|
@@ -27845,7 +27828,7 @@ var init_chokidar = __esm({
|
|
|
27845
27828
|
this.statMethod = follow ? STAT_METHOD_F : STAT_METHOD_L;
|
|
27846
27829
|
}
|
|
27847
27830
|
entryPath(entry) {
|
|
27848
|
-
return
|
|
27831
|
+
return sysPath.join(this.watchPath, sysPath.relative(this.watchPath, entry.fullPath));
|
|
27849
27832
|
}
|
|
27850
27833
|
filterPath(entry) {
|
|
27851
27834
|
const { stats } = entry;
|
|
@@ -27858,25 +27841,8 @@ var init_chokidar = __esm({
|
|
|
27858
27841
|
return this.fsw._isntIgnored(this.entryPath(entry), entry.stats);
|
|
27859
27842
|
}
|
|
27860
27843
|
};
|
|
27861
|
-
|
|
27862
|
-
|
|
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;
|
|
27844
|
+
exports2.WatchHelper = WatchHelper;
|
|
27845
|
+
var FSWatcher = class extends events_1.EventEmitter {
|
|
27880
27846
|
// Not indenting methods for history sake; for now.
|
|
27881
27847
|
constructor(_opts = {}) {
|
|
27882
27848
|
super();
|
|
@@ -27910,7 +27876,7 @@ var init_chokidar = __esm({
|
|
|
27910
27876
|
ignored: _opts.ignored ? arrify(_opts.ignored) : arrify([]),
|
|
27911
27877
|
awaitWriteFinish: awf === true ? DEF_AWF : typeof awf === "object" ? { ...DEF_AWF, ...awf } : false
|
|
27912
27878
|
};
|
|
27913
|
-
if (isIBMi)
|
|
27879
|
+
if (handler_js_1.isIBMi)
|
|
27914
27880
|
opts.usePolling = true;
|
|
27915
27881
|
if (opts.atomic === void 0)
|
|
27916
27882
|
opts.atomic = !opts.usePolling;
|
|
@@ -27931,15 +27897,15 @@ var init_chokidar = __esm({
|
|
|
27931
27897
|
this._emitReady = () => {
|
|
27932
27898
|
readyCalls++;
|
|
27933
27899
|
if (readyCalls >= this._readyCount) {
|
|
27934
|
-
this._emitReady = EMPTY_FN;
|
|
27900
|
+
this._emitReady = handler_js_1.EMPTY_FN;
|
|
27935
27901
|
this._readyEmitted = true;
|
|
27936
|
-
process.nextTick(() => this.emit(EVENTS.READY));
|
|
27902
|
+
process.nextTick(() => this.emit(handler_js_1.EVENTS.READY));
|
|
27937
27903
|
}
|
|
27938
27904
|
};
|
|
27939
|
-
this._emitRaw = (...args) => this.emit(EVENTS.RAW, ...args);
|
|
27905
|
+
this._emitRaw = (...args) => this.emit(handler_js_1.EVENTS.RAW, ...args);
|
|
27940
27906
|
this._boundRemove = this._remove.bind(this);
|
|
27941
27907
|
this.options = opts;
|
|
27942
|
-
this._nodeFsHandler = new NodeFsHandler(this);
|
|
27908
|
+
this._nodeFsHandler = new handler_js_1.NodeFsHandler(this);
|
|
27943
27909
|
Object.freeze(opts);
|
|
27944
27910
|
}
|
|
27945
27911
|
_addIgnoredPath(matcher) {
|
|
@@ -27995,7 +27961,7 @@ var init_chokidar = __esm({
|
|
|
27995
27961
|
return;
|
|
27996
27962
|
results.forEach((item) => {
|
|
27997
27963
|
if (item)
|
|
27998
|
-
this.add(
|
|
27964
|
+
this.add(sysPath.dirname(item), sysPath.basename(_origAdd || item));
|
|
27999
27965
|
});
|
|
28000
27966
|
});
|
|
28001
27967
|
return this;
|
|
@@ -28009,10 +27975,10 @@ var init_chokidar = __esm({
|
|
|
28009
27975
|
const paths = unifyPaths(paths_);
|
|
28010
27976
|
const { cwd } = this.options;
|
|
28011
27977
|
paths.forEach((path5) => {
|
|
28012
|
-
if (!
|
|
27978
|
+
if (!sysPath.isAbsolute(path5) && !this._closers.has(path5)) {
|
|
28013
27979
|
if (cwd)
|
|
28014
|
-
path5 =
|
|
28015
|
-
path5 =
|
|
27980
|
+
path5 = sysPath.join(cwd, path5);
|
|
27981
|
+
path5 = sysPath.resolve(path5);
|
|
28016
27982
|
}
|
|
28017
27983
|
this._closePath(path5);
|
|
28018
27984
|
this._addIgnoredPath(path5);
|
|
@@ -28061,7 +28027,7 @@ var init_chokidar = __esm({
|
|
|
28061
28027
|
getWatched() {
|
|
28062
28028
|
const watchList = {};
|
|
28063
28029
|
this._watched.forEach((entry, dir) => {
|
|
28064
|
-
const key = this.options.cwd ?
|
|
28030
|
+
const key = this.options.cwd ? sysPath.relative(this.options.cwd, dir) : dir;
|
|
28065
28031
|
const index = key || ONE_DOT;
|
|
28066
28032
|
watchList[index] = entry.getChildren().sort();
|
|
28067
28033
|
});
|
|
@@ -28069,8 +28035,8 @@ var init_chokidar = __esm({
|
|
|
28069
28035
|
}
|
|
28070
28036
|
emitWithAll(event, args) {
|
|
28071
28037
|
this.emit(event, ...args);
|
|
28072
|
-
if (event !== EVENTS.ERROR)
|
|
28073
|
-
this.emit(EVENTS.ALL, event, ...args);
|
|
28038
|
+
if (event !== handler_js_1.EVENTS.ERROR)
|
|
28039
|
+
this.emit(handler_js_1.EVENTS.ALL, event, ...args);
|
|
28074
28040
|
}
|
|
28075
28041
|
// Common helpers
|
|
28076
28042
|
// --------------
|
|
@@ -28086,10 +28052,10 @@ var init_chokidar = __esm({
|
|
|
28086
28052
|
if (this.closed)
|
|
28087
28053
|
return;
|
|
28088
28054
|
const opts = this.options;
|
|
28089
|
-
if (isWindows)
|
|
28090
|
-
path5 =
|
|
28055
|
+
if (handler_js_1.isWindows)
|
|
28056
|
+
path5 = sysPath.normalize(path5);
|
|
28091
28057
|
if (opts.cwd)
|
|
28092
|
-
path5 =
|
|
28058
|
+
path5 = sysPath.relative(opts.cwd, path5);
|
|
28093
28059
|
const args = [path5];
|
|
28094
28060
|
if (stats != null)
|
|
28095
28061
|
args.push(stats);
|
|
@@ -28100,26 +28066,26 @@ var init_chokidar = __esm({
|
|
|
28100
28066
|
return this;
|
|
28101
28067
|
}
|
|
28102
28068
|
if (opts.atomic) {
|
|
28103
|
-
if (event === EVENTS.UNLINK) {
|
|
28069
|
+
if (event === handler_js_1.EVENTS.UNLINK) {
|
|
28104
28070
|
this._pendingUnlinks.set(path5, [event, ...args]);
|
|
28105
28071
|
setTimeout(() => {
|
|
28106
28072
|
this._pendingUnlinks.forEach((entry, path6) => {
|
|
28107
28073
|
this.emit(...entry);
|
|
28108
|
-
this.emit(EVENTS.ALL, ...entry);
|
|
28074
|
+
this.emit(handler_js_1.EVENTS.ALL, ...entry);
|
|
28109
28075
|
this._pendingUnlinks.delete(path6);
|
|
28110
28076
|
});
|
|
28111
28077
|
}, typeof opts.atomic === "number" ? opts.atomic : 100);
|
|
28112
28078
|
return this;
|
|
28113
28079
|
}
|
|
28114
|
-
if (event === EVENTS.ADD && this._pendingUnlinks.has(path5)) {
|
|
28115
|
-
event = EVENTS.CHANGE;
|
|
28080
|
+
if (event === handler_js_1.EVENTS.ADD && this._pendingUnlinks.has(path5)) {
|
|
28081
|
+
event = handler_js_1.EVENTS.CHANGE;
|
|
28116
28082
|
this._pendingUnlinks.delete(path5);
|
|
28117
28083
|
}
|
|
28118
28084
|
}
|
|
28119
|
-
if (awf && (event === EVENTS.ADD || event === EVENTS.CHANGE) && this._readyEmitted) {
|
|
28085
|
+
if (awf && (event === handler_js_1.EVENTS.ADD || event === handler_js_1.EVENTS.CHANGE) && this._readyEmitted) {
|
|
28120
28086
|
const awfEmit = (err, stats2) => {
|
|
28121
28087
|
if (err) {
|
|
28122
|
-
event = EVENTS.ERROR;
|
|
28088
|
+
event = handler_js_1.EVENTS.ERROR;
|
|
28123
28089
|
args[0] = err;
|
|
28124
28090
|
this.emitWithAll(event, args);
|
|
28125
28091
|
} else if (stats2) {
|
|
@@ -28134,16 +28100,16 @@ var init_chokidar = __esm({
|
|
|
28134
28100
|
this._awaitWriteFinish(path5, awf.stabilityThreshold, event, awfEmit);
|
|
28135
28101
|
return this;
|
|
28136
28102
|
}
|
|
28137
|
-
if (event === EVENTS.CHANGE) {
|
|
28138
|
-
const isThrottled = !this._throttle(EVENTS.CHANGE, path5, 50);
|
|
28103
|
+
if (event === handler_js_1.EVENTS.CHANGE) {
|
|
28104
|
+
const isThrottled = !this._throttle(handler_js_1.EVENTS.CHANGE, path5, 50);
|
|
28139
28105
|
if (isThrottled)
|
|
28140
28106
|
return this;
|
|
28141
28107
|
}
|
|
28142
|
-
if (opts.alwaysStat && stats === void 0 && (event === EVENTS.ADD || event === EVENTS.ADD_DIR || event === EVENTS.CHANGE)) {
|
|
28143
|
-
const fullPath = opts.cwd ?
|
|
28108
|
+
if (opts.alwaysStat && stats === void 0 && (event === handler_js_1.EVENTS.ADD || event === handler_js_1.EVENTS.ADD_DIR || event === handler_js_1.EVENTS.CHANGE)) {
|
|
28109
|
+
const fullPath = opts.cwd ? sysPath.join(opts.cwd, path5) : path5;
|
|
28144
28110
|
let stats2;
|
|
28145
28111
|
try {
|
|
28146
|
-
stats2 = await (0,
|
|
28112
|
+
stats2 = await (0, promises_1.stat)(fullPath);
|
|
28147
28113
|
} catch (err) {
|
|
28148
28114
|
}
|
|
28149
28115
|
if (!stats2 || this.closed)
|
|
@@ -28160,7 +28126,7 @@ var init_chokidar = __esm({
|
|
|
28160
28126
|
_handleError(error48) {
|
|
28161
28127
|
const code = error48 && error48.code;
|
|
28162
28128
|
if (error48 && code !== "ENOENT" && code !== "ENOTDIR" && (!this.options.ignorePermissionErrors || code !== "EPERM" && code !== "EACCES")) {
|
|
28163
|
-
this.emit(EVENTS.ERROR, error48);
|
|
28129
|
+
this.emit(handler_js_1.EVENTS.ERROR, error48);
|
|
28164
28130
|
}
|
|
28165
28131
|
return error48 || this.closed;
|
|
28166
28132
|
}
|
|
@@ -28216,13 +28182,13 @@ var init_chokidar = __esm({
|
|
|
28216
28182
|
const pollInterval = awf.pollInterval;
|
|
28217
28183
|
let timeoutHandler;
|
|
28218
28184
|
let fullPath = path5;
|
|
28219
|
-
if (this.options.cwd && !
|
|
28220
|
-
fullPath =
|
|
28185
|
+
if (this.options.cwd && !sysPath.isAbsolute(path5)) {
|
|
28186
|
+
fullPath = sysPath.join(this.options.cwd, path5);
|
|
28221
28187
|
}
|
|
28222
28188
|
const now = /* @__PURE__ */ new Date();
|
|
28223
28189
|
const writes = this._pendingWrites;
|
|
28224
28190
|
function awaitWriteFinishFn(prevStat) {
|
|
28225
|
-
(0,
|
|
28191
|
+
(0, fs_1.stat)(fullPath, (err, curStat) => {
|
|
28226
28192
|
if (err || !writes.has(path5)) {
|
|
28227
28193
|
if (err && err.code !== "ENOENT")
|
|
28228
28194
|
awfEmit(err);
|
|
@@ -28270,8 +28236,8 @@ var init_chokidar = __esm({
|
|
|
28270
28236
|
}
|
|
28271
28237
|
return this._userIgnored(path5, stats);
|
|
28272
28238
|
}
|
|
28273
|
-
_isntIgnored(path5,
|
|
28274
|
-
return !this._isIgnored(path5,
|
|
28239
|
+
_isntIgnored(path5, stat) {
|
|
28240
|
+
return !this._isIgnored(path5, stat);
|
|
28275
28241
|
}
|
|
28276
28242
|
/**
|
|
28277
28243
|
* Provides a set of common helpers and properties relating to symlink handling.
|
|
@@ -28287,7 +28253,7 @@ var init_chokidar = __esm({
|
|
|
28287
28253
|
* @param directory path of the directory
|
|
28288
28254
|
*/
|
|
28289
28255
|
_getWatchedDir(directory) {
|
|
28290
|
-
const dir =
|
|
28256
|
+
const dir = sysPath.resolve(directory);
|
|
28291
28257
|
if (!this._watched.has(dir))
|
|
28292
28258
|
this._watched.set(dir, new DirEntry(dir, this._boundRemove));
|
|
28293
28259
|
return this._watched.get(dir);
|
|
@@ -28310,8 +28276,8 @@ var init_chokidar = __esm({
|
|
|
28310
28276
|
* @param item base path of item/directory
|
|
28311
28277
|
*/
|
|
28312
28278
|
_remove(directory, item, isDirectory) {
|
|
28313
|
-
const path5 =
|
|
28314
|
-
const fullPath =
|
|
28279
|
+
const path5 = sysPath.join(directory, item);
|
|
28280
|
+
const fullPath = sysPath.resolve(path5);
|
|
28315
28281
|
isDirectory = isDirectory != null ? isDirectory : this._watched.has(path5) || this._watched.has(fullPath);
|
|
28316
28282
|
if (!this._throttle("remove", path5, 100))
|
|
28317
28283
|
return;
|
|
@@ -28329,15 +28295,15 @@ var init_chokidar = __esm({
|
|
|
28329
28295
|
}
|
|
28330
28296
|
let relPath = path5;
|
|
28331
28297
|
if (this.options.cwd)
|
|
28332
|
-
relPath =
|
|
28298
|
+
relPath = sysPath.relative(this.options.cwd, path5);
|
|
28333
28299
|
if (this.options.awaitWriteFinish && this._pendingWrites.has(relPath)) {
|
|
28334
28300
|
const event = this._pendingWrites.get(relPath).cancelWait();
|
|
28335
|
-
if (event === EVENTS.ADD)
|
|
28301
|
+
if (event === handler_js_1.EVENTS.ADD)
|
|
28336
28302
|
return;
|
|
28337
28303
|
}
|
|
28338
28304
|
this._watched.delete(path5);
|
|
28339
28305
|
this._watched.delete(fullPath);
|
|
28340
|
-
const eventName = isDirectory ? EVENTS.UNLINK_DIR : EVENTS.UNLINK;
|
|
28306
|
+
const eventName = isDirectory ? handler_js_1.EVENTS.UNLINK_DIR : handler_js_1.EVENTS.UNLINK;
|
|
28341
28307
|
if (wasTracked && !this._isIgnored(path5))
|
|
28342
28308
|
this._emit(eventName, path5);
|
|
28343
28309
|
this._closePath(path5);
|
|
@@ -28347,8 +28313,8 @@ var init_chokidar = __esm({
|
|
|
28347
28313
|
*/
|
|
28348
28314
|
_closePath(path5) {
|
|
28349
28315
|
this._closeFile(path5);
|
|
28350
|
-
const dir =
|
|
28351
|
-
this._getWatchedDir(dir).remove(
|
|
28316
|
+
const dir = sysPath.dirname(path5);
|
|
28317
|
+
this._getWatchedDir(dir).remove(sysPath.basename(path5));
|
|
28352
28318
|
}
|
|
28353
28319
|
/**
|
|
28354
28320
|
* Closes only file-specific watchers
|
|
@@ -28373,13 +28339,13 @@ var init_chokidar = __esm({
|
|
|
28373
28339
|
_readdirp(root, opts) {
|
|
28374
28340
|
if (this.closed)
|
|
28375
28341
|
return;
|
|
28376
|
-
const options = { type: EVENTS.ALL, alwaysStat: true, lstat: true, ...opts, depth: 0 };
|
|
28377
|
-
let stream = readdirp(root, options);
|
|
28342
|
+
const options = { type: handler_js_1.EVENTS.ALL, alwaysStat: true, lstat: true, ...opts, depth: 0 };
|
|
28343
|
+
let stream = (0, readdirp_1.readdirp)(root, options);
|
|
28378
28344
|
this._streams.add(stream);
|
|
28379
|
-
stream.once(STR_CLOSE, () => {
|
|
28345
|
+
stream.once(handler_js_1.STR_CLOSE, () => {
|
|
28380
28346
|
stream = void 0;
|
|
28381
28347
|
});
|
|
28382
|
-
stream.once(STR_END, () => {
|
|
28348
|
+
stream.once(handler_js_1.STR_END, () => {
|
|
28383
28349
|
if (stream) {
|
|
28384
28350
|
this._streams.delete(stream);
|
|
28385
28351
|
stream = void 0;
|
|
@@ -28388,7 +28354,13 @@ var init_chokidar = __esm({
|
|
|
28388
28354
|
return stream;
|
|
28389
28355
|
}
|
|
28390
28356
|
};
|
|
28391
|
-
|
|
28357
|
+
exports2.FSWatcher = FSWatcher;
|
|
28358
|
+
function watch(paths, options = {}) {
|
|
28359
|
+
const watcher = new FSWatcher(options);
|
|
28360
|
+
watcher.add(paths);
|
|
28361
|
+
return watcher;
|
|
28362
|
+
}
|
|
28363
|
+
exports2.default = { watch, FSWatcher };
|
|
28392
28364
|
}
|
|
28393
28365
|
});
|
|
28394
28366
|
|
|
@@ -31253,10 +31225,10 @@ var require_dist2 = __commonJS({
|
|
|
31253
31225
|
async function createWorktree(opts) {
|
|
31254
31226
|
const { repoRoot, branch, baseBranch, meshName } = opts;
|
|
31255
31227
|
const targetDir = opts.targetDir || resolveWorktreePath(repoRoot, meshName, branch);
|
|
31256
|
-
if ((0,
|
|
31228
|
+
if ((0, import_node_fs2.existsSync)(targetDir)) {
|
|
31257
31229
|
throw new Error(`Worktree target directory already exists: ${targetDir}`);
|
|
31258
31230
|
}
|
|
31259
|
-
await (0,
|
|
31231
|
+
await (0, import_promises3.mkdir)(path42.dirname(targetDir), { recursive: true });
|
|
31260
31232
|
const args = ["worktree", "add", targetDir, "-b", branch];
|
|
31261
31233
|
if (baseBranch) {
|
|
31262
31234
|
args.push(baseBranch);
|
|
@@ -31283,7 +31255,7 @@ var require_dist2 = __commonJS({
|
|
|
31283
31255
|
};
|
|
31284
31256
|
}
|
|
31285
31257
|
async function removeWorktree(repoRoot, worktreePath) {
|
|
31286
|
-
if (!(0,
|
|
31258
|
+
if (!(0, import_node_fs2.existsSync)(worktreePath)) {
|
|
31287
31259
|
await pruneWorktrees(repoRoot);
|
|
31288
31260
|
return { success: true, removedPath: worktreePath };
|
|
31289
31261
|
}
|
|
@@ -31348,8 +31320,8 @@ var require_dist2 = __commonJS({
|
|
|
31348
31320
|
}
|
|
31349
31321
|
}
|
|
31350
31322
|
var path42;
|
|
31351
|
-
var
|
|
31352
|
-
var
|
|
31323
|
+
var import_promises3;
|
|
31324
|
+
var import_node_fs2;
|
|
31353
31325
|
var import_node_child_process2;
|
|
31354
31326
|
var import_node_util2;
|
|
31355
31327
|
var execFileAsync2;
|
|
@@ -31360,8 +31332,8 @@ var require_dist2 = __commonJS({
|
|
|
31360
31332
|
"src/git/git-worktree.ts"() {
|
|
31361
31333
|
"use strict";
|
|
31362
31334
|
path42 = __toESM2(require("path"));
|
|
31363
|
-
|
|
31364
|
-
|
|
31335
|
+
import_promises3 = require("fs/promises");
|
|
31336
|
+
import_node_fs2 = require("fs");
|
|
31365
31337
|
import_node_child_process2 = require("child_process");
|
|
31366
31338
|
import_node_util2 = require("util");
|
|
31367
31339
|
execFileAsync2 = (0, import_node_util2.promisify)(import_node_child_process2.execFile);
|
|
@@ -31957,8 +31929,8 @@ ${rules.join("\n")}`;
|
|
|
31957
31929
|
}
|
|
31958
31930
|
function rotateSizeIfNeeded() {
|
|
31959
31931
|
try {
|
|
31960
|
-
const
|
|
31961
|
-
if (
|
|
31932
|
+
const stat2 = fs22.statSync(currentLogFile);
|
|
31933
|
+
if (stat2.size > MAX_LOG_SIZE) {
|
|
31962
31934
|
const backup = currentLogFile.replace(".log", ".1.log");
|
|
31963
31935
|
try {
|
|
31964
31936
|
fs22.unlinkSync(backup);
|
|
@@ -32105,8 +32077,8 @@ ${rules.join("\n")}`;
|
|
|
32105
32077
|
try {
|
|
32106
32078
|
const oldLog = path10.join(LOG_DIR, "daemon.log");
|
|
32107
32079
|
if (fs22.existsSync(oldLog)) {
|
|
32108
|
-
const
|
|
32109
|
-
const oldDate =
|
|
32080
|
+
const stat2 = fs22.statSync(oldLog);
|
|
32081
|
+
const oldDate = stat2.mtime.toISOString().slice(0, 10);
|
|
32110
32082
|
fs22.renameSync(oldLog, path10.join(LOG_DIR, `daemon-${oldDate}.log`));
|
|
32111
32083
|
}
|
|
32112
32084
|
const oldLogBackup = path10.join(LOG_DIR, "daemon.log.old");
|
|
@@ -32526,8 +32498,8 @@ ${rules.join("\n")}`;
|
|
|
32526
32498
|
if (cwd) {
|
|
32527
32499
|
try {
|
|
32528
32500
|
const fs16 = require("fs");
|
|
32529
|
-
const
|
|
32530
|
-
if (!
|
|
32501
|
+
const stat2 = fs16.statSync(cwd);
|
|
32502
|
+
if (!stat2.isDirectory()) cwd = os8.homedir();
|
|
32531
32503
|
} catch {
|
|
32532
32504
|
cwd = os8.homedir();
|
|
32533
32505
|
}
|
|
@@ -34548,7 +34520,14 @@ ${lastSnapshot}`;
|
|
|
34548
34520
|
})() : null;
|
|
34549
34521
|
const parsedSessionStatus = typeof parsedStatusBeforeSend?.status === "string" ? String(parsedStatusBeforeSend.status) : "";
|
|
34550
34522
|
if (!allowInputDuringGeneration && (parsedSessionStatus === "generating" || parsedSessionStatus === "long_generating")) {
|
|
34551
|
-
|
|
34523
|
+
const parsedModal = parsedStatusBeforeSend?.activeModal ?? parsedStatusBeforeSend?.modal ?? null;
|
|
34524
|
+
const parsedHasActionableModal = Boolean(
|
|
34525
|
+
parsedModal && Array.isArray(parsedModal.buttons) && parsedModal.buttons.some((candidate) => typeof candidate === "string" && candidate.trim())
|
|
34526
|
+
);
|
|
34527
|
+
const terminalLooksIdle = this.currentStatus === "idle" && this.runDetectStatus(this.recentOutputBuffer) === "idle" && !this.isWaitingForResponse && !this.currentTurnScope && !this.hasActionableApproval() && !parsedHasActionableModal;
|
|
34528
|
+
if (!terminalLooksIdle) {
|
|
34529
|
+
throw new Error(`${this.cliName} is still processing the previous prompt`);
|
|
34530
|
+
}
|
|
34552
34531
|
}
|
|
34553
34532
|
if (this.isWaitingForResponse && !allowInputDuringGeneration) {
|
|
34554
34533
|
if (!this.clearStaleIdleResponseGuard("send_message_guard")) {
|
|
@@ -35212,8 +35191,8 @@ ${lastSnapshot}`;
|
|
|
35212
35191
|
module2.exports = __toCommonJS2(index_exports);
|
|
35213
35192
|
init_repo_mesh_types();
|
|
35214
35193
|
var import_node_child_process = require("child_process");
|
|
35215
|
-
var
|
|
35216
|
-
var
|
|
35194
|
+
var import_node_fs = require("fs");
|
|
35195
|
+
var import_promises = require("fs/promises");
|
|
35217
35196
|
var path5 = __toESM2(require("path"));
|
|
35218
35197
|
var import_node_util = require("util");
|
|
35219
35198
|
var execFileAsync = (0, import_node_util.promisify)(import_node_child_process.execFile);
|
|
@@ -35272,8 +35251,8 @@ ${lastSnapshot}`;
|
|
|
35272
35251
|
});
|
|
35273
35252
|
}
|
|
35274
35253
|
const cwd = options.cwd ? await validateWorkspace(options.cwd) : await validateWorkspace(repo.workspace);
|
|
35275
|
-
const canonicalRepoRoot = await (0,
|
|
35276
|
-
const canonicalCwd = await (0,
|
|
35254
|
+
const canonicalRepoRoot = await (0, import_promises.realpath)(repo.repoRoot);
|
|
35255
|
+
const canonicalCwd = await (0, import_promises.realpath)(cwd);
|
|
35277
35256
|
if (!isPathInside(canonicalRepoRoot, canonicalCwd)) {
|
|
35278
35257
|
throw new GitCommandError("path_outside_repo", "Git cwd is outside the repository root", {
|
|
35279
35258
|
argv,
|
|
@@ -35301,13 +35280,13 @@ ${lastSnapshot}`;
|
|
|
35301
35280
|
}
|
|
35302
35281
|
const normalizedWorkspace = path5.resolve(workspace);
|
|
35303
35282
|
try {
|
|
35304
|
-
const info = await (0,
|
|
35283
|
+
const info = await (0, import_promises.stat)(normalizedWorkspace);
|
|
35305
35284
|
if (!info.isDirectory()) {
|
|
35306
35285
|
throw new GitCommandError("invalid_args", "Workspace must be an existing directory", {
|
|
35307
35286
|
cwd: normalizedWorkspace
|
|
35308
35287
|
});
|
|
35309
35288
|
}
|
|
35310
|
-
await (0,
|
|
35289
|
+
await (0, import_promises.access)(normalizedWorkspace, import_node_fs.constants.R_OK);
|
|
35311
35290
|
} catch (error48) {
|
|
35312
35291
|
if (error48 instanceof GitCommandError) throw error48;
|
|
35313
35292
|
throw new GitCommandError("invalid_args", "Workspace must be an existing directory", {
|
|
@@ -35548,7 +35527,7 @@ ${lastSnapshot}`;
|
|
|
35548
35527
|
reason: error48.reason
|
|
35549
35528
|
};
|
|
35550
35529
|
}
|
|
35551
|
-
var
|
|
35530
|
+
var import_promises2 = require("fs/promises");
|
|
35552
35531
|
var path23 = __toESM2(require("path"));
|
|
35553
35532
|
var DEFAULT_MAX_FILES = 200;
|
|
35554
35533
|
var DEFAULT_MAX_BYTES = 2e5;
|
|
@@ -35720,9 +35699,9 @@ ${lastSnapshot}`;
|
|
|
35720
35699
|
if (typeof filePath !== "string" || filePath.length === 0 || filePath.includes("\0")) {
|
|
35721
35700
|
throw new GitCommandError("invalid_args", "File path must be a non-empty path");
|
|
35722
35701
|
}
|
|
35723
|
-
const canonicalRepoRoot = await (0,
|
|
35702
|
+
const canonicalRepoRoot = await (0, import_promises2.realpath)(repoRoot).catch(() => path23.resolve(repoRoot));
|
|
35724
35703
|
const absolutePath = path23.isAbsolute(filePath) ? path23.resolve(filePath) : path23.resolve(repoRoot, filePath);
|
|
35725
|
-
const checkPath = await (0,
|
|
35704
|
+
const checkPath = await (0, import_promises2.realpath)(absolutePath).catch(() => absolutePath);
|
|
35726
35705
|
const relativeBase = isPathInside(canonicalRepoRoot, checkPath) ? canonicalRepoRoot : path23.resolve(repoRoot);
|
|
35727
35706
|
if (!isPathInside(canonicalRepoRoot, checkPath) && !isPathInside(repoRoot, absolutePath)) {
|
|
35728
35707
|
throw new GitCommandError("path_outside_repo", "Selected file path is outside the repository root", {
|
|
@@ -35738,7 +35717,7 @@ ${lastSnapshot}`;
|
|
|
35738
35717
|
return { absolutePath, relativePath };
|
|
35739
35718
|
}
|
|
35740
35719
|
async function buildUntrackedDiff(absolutePath, relativePath, readLimit) {
|
|
35741
|
-
const content = await (0,
|
|
35720
|
+
const content = await (0, import_promises2.readFile)(absolutePath, "utf8");
|
|
35742
35721
|
const limitedContent = content.length > readLimit ? content.slice(0, readLimit) : content;
|
|
35743
35722
|
const lines = limitedContent.length > 0 ? limitedContent.split("\n") : [];
|
|
35744
35723
|
const plusLines = lines.filter((line, index) => index < lines.length - 1 || line.length > 0).map((line) => `+${line}`).join("\n");
|
|
@@ -39652,8 +39631,8 @@ ${cleanBody}`;
|
|
|
39652
39631
|
function buildSavedHistoryFileSignatureMap(dir, files) {
|
|
39653
39632
|
return new Map(files.map((file2) => {
|
|
39654
39633
|
try {
|
|
39655
|
-
const
|
|
39656
|
-
return [file2, `${file2}:${
|
|
39634
|
+
const stat2 = fs32.statSync(path11.join(dir, file2));
|
|
39635
|
+
return [file2, `${file2}:${stat2.size}:${Math.trunc(stat2.mtimeMs)}`];
|
|
39657
39636
|
} catch {
|
|
39658
39637
|
return [file2, `${file2}:missing`];
|
|
39659
39638
|
}
|
|
@@ -39716,8 +39695,8 @@ ${cleanBody}`;
|
|
|
39716
39695
|
} catch (error48) {
|
|
39717
39696
|
if (error48?.code !== "EEXIST") return null;
|
|
39718
39697
|
try {
|
|
39719
|
-
const
|
|
39720
|
-
if (Date.now() -
|
|
39698
|
+
const stat2 = fs32.statSync(lockPath);
|
|
39699
|
+
if (Date.now() - stat2.mtimeMs > SAVED_HISTORY_INDEX_LOCK_STALE_MS) {
|
|
39721
39700
|
fs32.rmSync(lockPath, { recursive: true, force: true });
|
|
39722
39701
|
continue;
|
|
39723
39702
|
}
|
|
@@ -39780,8 +39759,8 @@ ${cleanBody}`;
|
|
|
39780
39759
|
}
|
|
39781
39760
|
function buildSavedHistoryIndexFileSignature(dir) {
|
|
39782
39761
|
try {
|
|
39783
|
-
const
|
|
39784
|
-
return `index:${
|
|
39762
|
+
const stat2 = fs32.statSync(getSavedHistoryIndexFilePath(dir));
|
|
39763
|
+
return `index:${stat2.size}:${Math.trunc(stat2.mtimeMs)}`;
|
|
39785
39764
|
} catch {
|
|
39786
39765
|
return "index:missing";
|
|
39787
39766
|
}
|
|
@@ -39791,8 +39770,8 @@ ${cleanBody}`;
|
|
|
39791
39770
|
const indexStat = fs32.statSync(getSavedHistoryIndexFilePath(dir));
|
|
39792
39771
|
const files = listHistoryFiles(dir);
|
|
39793
39772
|
for (const file2 of files) {
|
|
39794
|
-
const
|
|
39795
|
-
if (
|
|
39773
|
+
const stat2 = fs32.statSync(path11.join(dir, file2));
|
|
39774
|
+
if (stat2.mtimeMs > indexStat.mtimeMs) return true;
|
|
39796
39775
|
}
|
|
39797
39776
|
return false;
|
|
39798
39777
|
} catch {
|
|
@@ -39801,8 +39780,8 @@ ${cleanBody}`;
|
|
|
39801
39780
|
}
|
|
39802
39781
|
function buildSavedHistoryFileSignature(dir, file2) {
|
|
39803
39782
|
try {
|
|
39804
|
-
const
|
|
39805
|
-
return `${file2}:${
|
|
39783
|
+
const stat2 = fs32.statSync(path11.join(dir, file2));
|
|
39784
|
+
return `${file2}:${stat2.size}:${Math.trunc(stat2.mtimeMs)}`;
|
|
39806
39785
|
} catch {
|
|
39807
39786
|
return `${file2}:missing`;
|
|
39808
39787
|
}
|
|
@@ -40340,8 +40319,8 @@ ${cleanBody}`;
|
|
|
40340
40319
|
let removedAny = false;
|
|
40341
40320
|
for (const file2 of files) {
|
|
40342
40321
|
const filePath = path11.join(dirPath, file2);
|
|
40343
|
-
const
|
|
40344
|
-
if (
|
|
40322
|
+
const stat2 = fs32.statSync(filePath);
|
|
40323
|
+
if (stat2.mtimeMs < cutoff) {
|
|
40345
40324
|
fs32.unlinkSync(filePath);
|
|
40346
40325
|
removedAny = true;
|
|
40347
40326
|
}
|
|
@@ -44417,9 +44396,17 @@ ${effect.notification.body || ""}`.trim();
|
|
|
44417
44396
|
const targetState = targetInstance?.getState?.();
|
|
44418
44397
|
const surfacedModal = targetState?.activeChat?.activeModal && Array.isArray(targetState.activeChat.activeModal.buttons) && targetState.activeChat.activeModal.buttons.some((candidate) => typeof candidate === "string" && candidate.trim()) ? targetState.activeChat.activeModal : null;
|
|
44419
44398
|
const statusModal = status?.activeModal && Array.isArray(status.activeModal.buttons) && status.activeModal.buttons.some((candidate) => typeof candidate === "string" && candidate.trim()) ? status.activeModal : null;
|
|
44420
|
-
const
|
|
44421
|
-
|
|
44422
|
-
|
|
44399
|
+
const parsedStatus = !statusModal && !surfacedModal && typeof adapter.getScriptParsedStatus === "function" ? (() => {
|
|
44400
|
+
try {
|
|
44401
|
+
return parseMaybeJson(adapter.getScriptParsedStatus());
|
|
44402
|
+
} catch {
|
|
44403
|
+
return null;
|
|
44404
|
+
}
|
|
44405
|
+
})() : null;
|
|
44406
|
+
const parsedModal = parsedStatus?.status === "waiting_approval" && parsedStatus?.activeModal && Array.isArray(parsedStatus.activeModal.buttons) && parsedStatus.activeModal.buttons.some((candidate) => typeof candidate === "string" && candidate.trim()) ? parsedStatus.activeModal : null;
|
|
44407
|
+
const effectiveModal = statusModal || surfacedModal || parsedModal;
|
|
44408
|
+
const effectiveStatus = status?.status === "waiting_approval" || targetState?.activeChat?.status === "waiting_approval" || parsedStatus?.status === "waiting_approval" ? "waiting_approval" : status?.status;
|
|
44409
|
+
LOG2.info("Command", `[resolveAction] CLI PTY gate target=${String(args?.targetSessionId || "")} rawStatus=${String(status?.status || "")} effectiveStatus=${String(effectiveStatus || "")} statusModal=${statusModal ? "yes" : "no"} surfacedModal=${surfacedModal ? "yes" : "no"} parsedModal=${parsedModal ? "yes" : "no"} instance=${targetInstance ? "yes" : "no"}`);
|
|
44423
44410
|
if (!effectiveModal) {
|
|
44424
44411
|
return { success: false, error: "Not in approval state" };
|
|
44425
44412
|
}
|
|
@@ -44834,11 +44821,11 @@ ${effect.notification.body || ""}`.trim();
|
|
|
44834
44821
|
files.push({ name: entry.name, type: "file", size });
|
|
44835
44822
|
continue;
|
|
44836
44823
|
}
|
|
44837
|
-
const
|
|
44824
|
+
const stat2 = fs52.statSync(entryPath);
|
|
44838
44825
|
files.push({
|
|
44839
44826
|
name: entry.name,
|
|
44840
|
-
type:
|
|
44841
|
-
size:
|
|
44827
|
+
type: stat2.isDirectory() ? "directory" : "file",
|
|
44828
|
+
size: stat2.isFile() ? stat2.size : void 0
|
|
44842
44829
|
});
|
|
44843
44830
|
} catch {
|
|
44844
44831
|
}
|
|
@@ -48962,7 +48949,7 @@ Run 'adhdev doctor' for detailed diagnostics.`
|
|
|
48962
48949
|
var fs7 = __toESM2(require("fs"));
|
|
48963
48950
|
var path18 = __toESM2(require("path"));
|
|
48964
48951
|
var os14 = __toESM2(require("os"));
|
|
48965
|
-
var chokidar = __toESM2((
|
|
48952
|
+
var chokidar = __toESM2(require_chokidar());
|
|
48966
48953
|
init_logger();
|
|
48967
48954
|
var VALID_CAPABILITY_MEDIA_TYPES = /* @__PURE__ */ new Set(["text", "image", "audio", "video", "resource"]);
|
|
48968
48955
|
var KNOWN_PROVIDER_FIELDS = /* @__PURE__ */ new Set([
|
|
@@ -51288,8 +51275,8 @@ Run 'adhdev doctor' for detailed diagnostics.`
|
|
|
51288
51275
|
}
|
|
51289
51276
|
function checkSize() {
|
|
51290
51277
|
try {
|
|
51291
|
-
const
|
|
51292
|
-
if (
|
|
51278
|
+
const stat2 = fs8.statSync(currentFile);
|
|
51279
|
+
if (stat2.size > MAX_FILE_SIZE) {
|
|
51293
51280
|
const backup = currentFile.replace(".jsonl", ".1.jsonl");
|
|
51294
51281
|
try {
|
|
51295
51282
|
fs8.unlinkSync(backup);
|
|
@@ -51362,10 +51349,10 @@ Run 'adhdev doctor' for detailed diagnostics.`
|
|
|
51362
51349
|
var yaml = __toESM2(require_js_yaml());
|
|
51363
51350
|
init_logger();
|
|
51364
51351
|
var import_node_child_process3 = require("child_process");
|
|
51365
|
-
var
|
|
51352
|
+
var import_node_fs3 = require("fs");
|
|
51366
51353
|
var import_node_module2 = require("module");
|
|
51367
51354
|
var os17 = __toESM2(require("os"));
|
|
51368
|
-
var
|
|
51355
|
+
var import_node_path = require("path");
|
|
51369
51356
|
var DEFAULT_SERVER_NAME = "adhdev-mesh";
|
|
51370
51357
|
var DEFAULT_ADHDEV_MCP_COMMAND = "adhdev-mcp";
|
|
51371
51358
|
var HERMES_CLI_TYPE = "hermes-cli";
|
|
@@ -51493,9 +51480,9 @@ Run 'adhdev doctor' for detailed diagnostics.`
|
|
|
51493
51480
|
function resolveMcpConfigPath(configPath, workspace) {
|
|
51494
51481
|
const trimmed = configPath.trim();
|
|
51495
51482
|
if (trimmed === "~") return os17.homedir();
|
|
51496
|
-
if (trimmed.startsWith("~/")) return (0,
|
|
51497
|
-
if ((0,
|
|
51498
|
-
return (0,
|
|
51483
|
+
if (trimmed.startsWith("~/")) return (0, import_node_path.join)(os17.homedir(), trimmed.slice(2));
|
|
51484
|
+
if ((0, import_node_path.isAbsolute)(trimmed)) return trimmed;
|
|
51485
|
+
return (0, import_node_path.join)(workspace, trimmed);
|
|
51499
51486
|
}
|
|
51500
51487
|
function resolveAdhdevMcpServerLaunch(options) {
|
|
51501
51488
|
const entryPath = resolveAdhdevMcpEntryPath(options.adhdevMcpEntryPath);
|
|
@@ -51535,15 +51522,15 @@ Run 'adhdev doctor' for detailed diagnostics.`
|
|
|
51535
51522
|
for (const entry of (pathValue || "").split(":")) {
|
|
51536
51523
|
const dir = entry.trim();
|
|
51537
51524
|
if (!dir) continue;
|
|
51538
|
-
addCandidate((0,
|
|
51525
|
+
addCandidate((0, import_node_path.join)(dir, "node"));
|
|
51539
51526
|
}
|
|
51540
51527
|
}
|
|
51541
51528
|
function addNodeCandidatesFromNvm(homeDir, addCandidate) {
|
|
51542
|
-
const versionsDir = (0,
|
|
51529
|
+
const versionsDir = (0, import_node_path.join)(homeDir, ".nvm", "versions", "node");
|
|
51543
51530
|
try {
|
|
51544
|
-
const versionDirs = (0,
|
|
51531
|
+
const versionDirs = (0, import_node_fs3.readdirSync)(versionsDir, { withFileTypes: true }).filter((entry) => entry.isDirectory()).map((entry) => entry.name).sort(compareNodeVersionNamesDescending);
|
|
51545
51532
|
for (const versionDir of versionDirs) {
|
|
51546
|
-
addCandidate((0,
|
|
51533
|
+
addCandidate((0, import_node_path.join)(versionsDir, versionDir, "bin", "node"));
|
|
51547
51534
|
}
|
|
51548
51535
|
} catch {
|
|
51549
51536
|
}
|
|
@@ -51581,12 +51568,12 @@ Run 'adhdev doctor' for detailed diagnostics.`
|
|
|
51581
51568
|
const addPackagedCandidates = (baseFile) => {
|
|
51582
51569
|
if (!baseFile) return;
|
|
51583
51570
|
const realBase = normalizeExistingPath(baseFile) || baseFile;
|
|
51584
|
-
const dir = (0,
|
|
51585
|
-
addCandidate((0,
|
|
51586
|
-
addCandidate((0,
|
|
51587
|
-
addCandidate((0,
|
|
51588
|
-
addCandidate((0,
|
|
51589
|
-
addCandidate((0,
|
|
51571
|
+
const dir = (0, import_node_path.dirname)(realBase);
|
|
51572
|
+
addCandidate((0, import_node_path.resolve)(dir, "../vendor/mcp-server/index.js"));
|
|
51573
|
+
addCandidate((0, import_node_path.resolve)(dir, "../../vendor/mcp-server/index.js"));
|
|
51574
|
+
addCandidate((0, import_node_path.resolve)(dir, "../../../vendor/mcp-server/index.js"));
|
|
51575
|
+
addCandidate((0, import_node_path.resolve)(dir, "../../mcp-server/dist/index.js"));
|
|
51576
|
+
addCandidate((0, import_node_path.resolve)(dir, "../../../mcp-server/dist/index.js"));
|
|
51590
51577
|
};
|
|
51591
51578
|
addPackagedCandidates(process.argv[1]);
|
|
51592
51579
|
for (const candidate of candidates) {
|
|
@@ -51594,7 +51581,7 @@ Run 'adhdev doctor' for detailed diagnostics.`
|
|
|
51594
51581
|
if (normalized) return normalized;
|
|
51595
51582
|
}
|
|
51596
51583
|
try {
|
|
51597
|
-
const requireBase = process.argv[1] ? normalizeExistingPath(process.argv[1]) || process.argv[1] : (0,
|
|
51584
|
+
const requireBase = process.argv[1] ? normalizeExistingPath(process.argv[1]) || process.argv[1] : (0, import_node_path.join)(process.cwd(), "adhdev-daemon.js");
|
|
51598
51585
|
const req = (0, import_node_module2.createRequire)(requireBase);
|
|
51599
51586
|
const resolvedModule = req.resolve("@adhdev/mcp-server");
|
|
51600
51587
|
return normalizeExistingPath(resolvedModule) || resolvedModule;
|
|
@@ -51604,8 +51591,8 @@ Run 'adhdev doctor' for detailed diagnostics.`
|
|
|
51604
51591
|
}
|
|
51605
51592
|
function normalizeExistingPath(filePath) {
|
|
51606
51593
|
try {
|
|
51607
|
-
if (!(0,
|
|
51608
|
-
return
|
|
51594
|
+
if (!(0, import_node_fs3.existsSync)(filePath)) return null;
|
|
51595
|
+
return import_node_fs3.realpathSync.native(filePath);
|
|
51609
51596
|
} catch {
|
|
51610
51597
|
return null;
|
|
51611
51598
|
}
|
|
@@ -59719,8 +59706,8 @@ data: ${JSON.stringify(msg.data)}
|
|
|
59719
59706
|
files.push({ path: rel, size: 0, type: "dir" });
|
|
59720
59707
|
scan(path26.join(d, entry.name), rel);
|
|
59721
59708
|
} else {
|
|
59722
|
-
const
|
|
59723
|
-
files.push({ path: rel, size:
|
|
59709
|
+
const stat2 = fs15.statSync(path26.join(d, entry.name));
|
|
59710
|
+
files.push({ path: rel, size: stat2.size, type: "file" });
|
|
59724
59711
|
}
|
|
59725
59712
|
}
|
|
59726
59713
|
} catch {
|
|
@@ -61799,9 +61786,9 @@ async function runSessionHostCli(args) {
|
|
|
61799
61786
|
stdio: "inherit",
|
|
61800
61787
|
env: buildSessionHostEnv(process.env)
|
|
61801
61788
|
});
|
|
61802
|
-
return await new Promise((
|
|
61789
|
+
return await new Promise((resolve2, reject) => {
|
|
61803
61790
|
child.on("error", reject);
|
|
61804
|
-
child.on("exit", (code) =>
|
|
61791
|
+
child.on("exit", (code) => resolve2(code ?? 0));
|
|
61805
61792
|
});
|
|
61806
61793
|
}
|
|
61807
61794
|
async function ensureSessionHostReady() {
|
|
@@ -61939,8 +61926,8 @@ var SessionHostClient = class {
|
|
|
61939
61926
|
} catch {
|
|
61940
61927
|
}
|
|
61941
61928
|
});
|
|
61942
|
-
await new Promise((
|
|
61943
|
-
socket.once("connect", () =>
|
|
61929
|
+
await new Promise((resolve2, reject) => {
|
|
61930
|
+
socket.once("connect", () => resolve2());
|
|
61944
61931
|
socket.once("error", reject);
|
|
61945
61932
|
});
|
|
61946
61933
|
}
|
|
@@ -61959,7 +61946,7 @@ var SessionHostClient = class {
|
|
|
61959
61946
|
requestId,
|
|
61960
61947
|
request
|
|
61961
61948
|
};
|
|
61962
|
-
const response = await new Promise((
|
|
61949
|
+
const response = await new Promise((resolve2, reject) => {
|
|
61963
61950
|
const timeout = setTimeout(() => {
|
|
61964
61951
|
this.requestWaiters.delete(requestId);
|
|
61965
61952
|
reject(new Error(`Session host request timed out after 30s (${request.type})`));
|
|
@@ -61967,7 +61954,7 @@ var SessionHostClient = class {
|
|
|
61967
61954
|
this.requestWaiters.set(requestId, {
|
|
61968
61955
|
resolve: (value) => {
|
|
61969
61956
|
clearTimeout(timeout);
|
|
61970
|
-
|
|
61957
|
+
resolve2(value);
|
|
61971
61958
|
},
|
|
61972
61959
|
reject: (error48) => {
|
|
61973
61960
|
clearTimeout(timeout);
|
|
@@ -61986,12 +61973,12 @@ var SessionHostClient = class {
|
|
|
61986
61973
|
waiter.reject(new Error("Session host client closed"));
|
|
61987
61974
|
}
|
|
61988
61975
|
this.requestWaiters.clear();
|
|
61989
|
-
await new Promise((
|
|
61976
|
+
await new Promise((resolve2) => {
|
|
61990
61977
|
let settled = false;
|
|
61991
61978
|
const done = () => {
|
|
61992
61979
|
if (settled) return;
|
|
61993
61980
|
settled = true;
|
|
61994
|
-
|
|
61981
|
+
resolve2();
|
|
61995
61982
|
};
|
|
61996
61983
|
socket.once("close", done);
|
|
61997
61984
|
socket.end();
|
|
@@ -62130,8 +62117,8 @@ var AdhMuxControlClient = class {
|
|
|
62130
62117
|
}
|
|
62131
62118
|
this.waiters.clear();
|
|
62132
62119
|
});
|
|
62133
|
-
await new Promise((
|
|
62134
|
-
socket.once("connect", () =>
|
|
62120
|
+
await new Promise((resolve2, reject) => {
|
|
62121
|
+
socket.once("connect", () => resolve2());
|
|
62135
62122
|
socket.once("error", reject);
|
|
62136
62123
|
});
|
|
62137
62124
|
}
|
|
@@ -62140,8 +62127,8 @@ var AdhMuxControlClient = class {
|
|
|
62140
62127
|
if (!this.socket) throw new Error("adhmux control socket unavailable");
|
|
62141
62128
|
const requestId = `${Date.now()}-${Math.random().toString(36).slice(2)}`;
|
|
62142
62129
|
const envelope = { kind: "request", requestId, request };
|
|
62143
|
-
const response = await new Promise((
|
|
62144
|
-
this.waiters.set(requestId, { resolve:
|
|
62130
|
+
const response = await new Promise((resolve2, reject) => {
|
|
62131
|
+
this.waiters.set(requestId, { resolve: resolve2, reject });
|
|
62145
62132
|
this.socket?.write(serializeEnvelope2(envelope));
|
|
62146
62133
|
});
|
|
62147
62134
|
return response;
|
|
@@ -62160,12 +62147,12 @@ var AdhMuxControlClient = class {
|
|
|
62160
62147
|
waiter.reject(new Error("adhmux control client closed"));
|
|
62161
62148
|
}
|
|
62162
62149
|
this.waiters.clear();
|
|
62163
|
-
await new Promise((
|
|
62150
|
+
await new Promise((resolve2) => {
|
|
62164
62151
|
let settled = false;
|
|
62165
62152
|
const done = () => {
|
|
62166
62153
|
if (settled) return;
|
|
62167
62154
|
settled = true;
|
|
62168
|
-
|
|
62155
|
+
resolve2();
|
|
62169
62156
|
};
|
|
62170
62157
|
socket.once("close", done);
|
|
62171
62158
|
socket.end();
|
|
@@ -62554,14 +62541,14 @@ var StandaloneServer = class {
|
|
|
62554
62541
|
}
|
|
62555
62542
|
}
|
|
62556
62543
|
async readJsonBody(req) {
|
|
62557
|
-
return await new Promise((
|
|
62544
|
+
return await new Promise((resolve2, reject) => {
|
|
62558
62545
|
let body = "";
|
|
62559
62546
|
req.on("data", (chunk) => {
|
|
62560
62547
|
body += chunk;
|
|
62561
62548
|
});
|
|
62562
62549
|
req.on("end", () => {
|
|
62563
62550
|
try {
|
|
62564
|
-
|
|
62551
|
+
resolve2(body ? JSON.parse(body) : {});
|
|
62565
62552
|
} catch (error48) {
|
|
62566
62553
|
reject(error48);
|
|
62567
62554
|
}
|
|
@@ -62681,9 +62668,9 @@ var StandaloneServer = class {
|
|
|
62681
62668
|
if (this.hasWsGitSubscriptions()) void this.flushWsGitSubscriptions();
|
|
62682
62669
|
}, STATUS_INTERVAL);
|
|
62683
62670
|
this.running = true;
|
|
62684
|
-
await new Promise((
|
|
62671
|
+
await new Promise((resolve2) => {
|
|
62685
62672
|
this.httpServer.listen(port, host, () => {
|
|
62686
|
-
|
|
62673
|
+
resolve2();
|
|
62687
62674
|
});
|
|
62688
62675
|
});
|
|
62689
62676
|
console.log("");
|
|
@@ -62723,8 +62710,8 @@ var StandaloneServer = class {
|
|
|
62723
62710
|
console.log("");
|
|
62724
62711
|
if (options.open !== false) {
|
|
62725
62712
|
try {
|
|
62726
|
-
const
|
|
62727
|
-
await
|
|
62713
|
+
const open = (await import("open")).default;
|
|
62714
|
+
await open(`http://localhost:${port}`);
|
|
62728
62715
|
} catch {
|
|
62729
62716
|
}
|
|
62730
62717
|
}
|