blun-king-cli 9.1.608 → 9.1.609
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/CHANGELOG.md +6 -0
- package/LIESMICH.txt +1 -1
- package/README.md +1 -1
- package/blun.mjs +233 -215
- package/package.json +1 -1
- package/worker-host.mjs +1 -1
package/blun.mjs
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
// BLUN_BUILD_INPUT_SHA256:
|
|
2
|
+
// BLUN_BUILD_INPUT_SHA256:5d42292f090cacd4506d9194f177756c6d8acc509f938ecc413c752522d368c2
|
|
3
3
|
import { fileURLToPath as __cjsShimFileURLToPath } from 'node:url';
|
|
4
4
|
import { dirname as __cjsShimDirname } from 'node:path';
|
|
5
5
|
const __filename = __cjsShimFileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __cjsShimDirname(__filename);
|
|
7
7
|
import { createRequire } from "node:module";
|
|
8
8
|
import crypto$1, { createHash, randomBytes, randomInt, randomUUID, timingSafeEqual } from "node:crypto";
|
|
9
|
-
import * as fs$
|
|
9
|
+
import * as fs$18 from "node:fs";
|
|
10
10
|
import Kt, { accessSync, appendFileSync, chmodSync, closeSync, constants, copyFileSync, createReadStream, createWriteStream, existsSync, fstatSync, fsyncSync, linkSync, lstatSync, mkdirSync, openSync, opendirSync, promises, readFileSync, readSync, readdirSync, realpathSync, renameSync, rmSync, statSync, unlinkSync, writeFileSync, writeSync } from "node:fs";
|
|
11
|
-
import * as path$
|
|
11
|
+
import * as path$18 from "node:path";
|
|
12
12
|
import path, { basename, dirname, extname, isAbsolute, join, normalize, parse, posix, relative, resolve, sep, win32 } from "node:path";
|
|
13
13
|
import { Blob as Blob$1, Buffer as Buffer$1, File as File$1 } from "node:buffer";
|
|
14
|
-
import
|
|
14
|
+
import fs, { access, appendFile, chmod, constants as constants$1, copyFile, cp, link, lstat, mkdir, mkdtemp, open, readFile, readdir, readlink, realpath, rename, rm, rmdir, stat, unlink, writeFile } from "node:fs/promises";
|
|
15
15
|
import * as nodeOs from "node:os";
|
|
16
16
|
import os, { arch, homedir, hostname, networkInterfaces, platform, release, tmpdir, type, userInfo } from "node:os";
|
|
17
17
|
import { execFile, execFileSync, execSync, spawn, spawnSync } from "node:child_process";
|
|
18
18
|
import { Worker } from "node:worker_threads";
|
|
19
19
|
import * as sysPath from "path";
|
|
20
|
-
import
|
|
20
|
+
import path$1, { basename as basename$1, dirname as dirname$1, join as join$1, parse as parse$1 } from "path";
|
|
21
21
|
import I, { existsSync as existsSync$1, promises as promises$1, readdirSync as readdirSync$1, stat as stat$1, statSync as statSync$1, unwatchFile, watch, watchFile } from "fs";
|
|
22
22
|
import { Readable } from "stream";
|
|
23
23
|
import zi from "assert";
|
|
@@ -2236,11 +2236,11 @@ var init_blun_files = __esmMin((() => {
|
|
|
2236
2236
|
async uploadVideo(input, options) {
|
|
2237
2237
|
let file;
|
|
2238
2238
|
if (typeof input === "string") {
|
|
2239
|
-
if (!fs$
|
|
2240
|
-
const filename = path$
|
|
2239
|
+
if (!fs$18.existsSync(input)) throw new ChatProviderError(`Video file not found: ${input}`);
|
|
2240
|
+
const filename = path$18.basename(input);
|
|
2241
2241
|
const mimeType = guessMimeTypeFromExt(filename);
|
|
2242
2242
|
if (mimeType === void 0 || !mimeType.startsWith("video/")) throw new ChatProviderError(`BlunFiles.uploadVideo: file extension does not indicate a video type: ${filename}`);
|
|
2243
|
-
const data = await fs$
|
|
2243
|
+
const data = await fs$18.promises.readFile(input);
|
|
2244
2244
|
file = new File$1([new Blob$1([new Uint8Array(data)], { type: mimeType })], filename, { type: mimeType });
|
|
2245
2245
|
} else {
|
|
2246
2246
|
if (!input.mimeType.startsWith("video/")) throw new ChatProviderError(`Expected a video mime type, got ${input.mimeType}`);
|
|
@@ -11897,7 +11897,7 @@ var require_clone$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
11897
11897
|
//#endregion
|
|
11898
11898
|
//#region ../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/graceful-fs.js
|
|
11899
11899
|
var require_graceful_fs = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
11900
|
-
var fs$
|
|
11900
|
+
var fs$17 = __require("fs");
|
|
11901
11901
|
var polyfills = require_polyfills();
|
|
11902
11902
|
var legacy = require_legacy_streams();
|
|
11903
11903
|
var clone = require_clone$1();
|
|
@@ -11926,36 +11926,36 @@ var require_graceful_fs = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
11926
11926
|
m = "GFS4: " + m.split(/\n/).join("\nGFS4: ");
|
|
11927
11927
|
console.error(m);
|
|
11928
11928
|
};
|
|
11929
|
-
if (!fs$
|
|
11930
|
-
publishQueue(fs$
|
|
11931
|
-
fs$
|
|
11929
|
+
if (!fs$17[gracefulQueue]) {
|
|
11930
|
+
publishQueue(fs$17, global[gracefulQueue] || []);
|
|
11931
|
+
fs$17.close = (function(fs$close) {
|
|
11932
11932
|
function close(fd, cb) {
|
|
11933
|
-
return fs$close.call(fs$
|
|
11933
|
+
return fs$close.call(fs$17, fd, function(err) {
|
|
11934
11934
|
if (!err) resetQueue();
|
|
11935
11935
|
if (typeof cb === "function") cb.apply(this, arguments);
|
|
11936
11936
|
});
|
|
11937
11937
|
}
|
|
11938
11938
|
Object.defineProperty(close, previousSymbol, { value: fs$close });
|
|
11939
11939
|
return close;
|
|
11940
|
-
})(fs$
|
|
11941
|
-
fs$
|
|
11940
|
+
})(fs$17.close);
|
|
11941
|
+
fs$17.closeSync = (function(fs$closeSync) {
|
|
11942
11942
|
function closeSync(fd) {
|
|
11943
|
-
fs$closeSync.apply(fs$
|
|
11943
|
+
fs$closeSync.apply(fs$17, arguments);
|
|
11944
11944
|
resetQueue();
|
|
11945
11945
|
}
|
|
11946
11946
|
Object.defineProperty(closeSync, previousSymbol, { value: fs$closeSync });
|
|
11947
11947
|
return closeSync;
|
|
11948
|
-
})(fs$
|
|
11948
|
+
})(fs$17.closeSync);
|
|
11949
11949
|
if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) process.on("exit", function() {
|
|
11950
|
-
debug(fs$
|
|
11951
|
-
__require("assert").equal(fs$
|
|
11950
|
+
debug(fs$17[gracefulQueue]);
|
|
11951
|
+
__require("assert").equal(fs$17[gracefulQueue].length, 0);
|
|
11952
11952
|
});
|
|
11953
11953
|
}
|
|
11954
|
-
if (!global[gracefulQueue]) publishQueue(global, fs$
|
|
11955
|
-
module.exports = patch(clone(fs$
|
|
11956
|
-
if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs$
|
|
11957
|
-
module.exports = patch(fs$
|
|
11958
|
-
fs$
|
|
11954
|
+
if (!global[gracefulQueue]) publishQueue(global, fs$17[gracefulQueue]);
|
|
11955
|
+
module.exports = patch(clone(fs$17));
|
|
11956
|
+
if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs$17.__patched) {
|
|
11957
|
+
module.exports = patch(fs$17);
|
|
11958
|
+
fs$17.__patched = true;
|
|
11959
11959
|
}
|
|
11960
11960
|
function patch(fs) {
|
|
11961
11961
|
polyfills(fs);
|
|
@@ -12210,23 +12210,23 @@ var require_graceful_fs = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
12210
12210
|
}
|
|
12211
12211
|
function enqueue(elem) {
|
|
12212
12212
|
debug("ENQUEUE", elem[0].name, elem[1]);
|
|
12213
|
-
fs$
|
|
12213
|
+
fs$17[gracefulQueue].push(elem);
|
|
12214
12214
|
retry();
|
|
12215
12215
|
}
|
|
12216
12216
|
var retryTimer;
|
|
12217
12217
|
function resetQueue() {
|
|
12218
12218
|
var now = Date.now();
|
|
12219
|
-
for (var i = 0; i < fs$
|
|
12220
|
-
fs$
|
|
12221
|
-
fs$
|
|
12219
|
+
for (var i = 0; i < fs$17[gracefulQueue].length; ++i) if (fs$17[gracefulQueue][i].length > 2) {
|
|
12220
|
+
fs$17[gracefulQueue][i][3] = now;
|
|
12221
|
+
fs$17[gracefulQueue][i][4] = now;
|
|
12222
12222
|
}
|
|
12223
12223
|
retry();
|
|
12224
12224
|
}
|
|
12225
12225
|
function retry() {
|
|
12226
12226
|
clearTimeout(retryTimer);
|
|
12227
12227
|
retryTimer = void 0;
|
|
12228
|
-
if (fs$
|
|
12229
|
-
var elem = fs$
|
|
12228
|
+
if (fs$17[gracefulQueue].length === 0) return;
|
|
12229
|
+
var elem = fs$17[gracefulQueue].shift();
|
|
12230
12230
|
var fn = elem[0];
|
|
12231
12231
|
var args = elem[1];
|
|
12232
12232
|
var err = elem[2];
|
|
@@ -12245,7 +12245,7 @@ var require_graceful_fs = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
12245
12245
|
if (sinceAttempt >= Math.min(sinceStart * 1.2, 100)) {
|
|
12246
12246
|
debug("RETRY", fn.name, args);
|
|
12247
12247
|
fn.apply(null, args.concat([startTime]));
|
|
12248
|
-
} else fs$
|
|
12248
|
+
} else fs$17[gracefulQueue].push(elem);
|
|
12249
12249
|
}
|
|
12250
12250
|
if (retryTimer === void 0) retryTimer = setTimeout(retry, 0);
|
|
12251
12251
|
}
|
|
@@ -12597,7 +12597,7 @@ var require_mtime_precision = /* @__PURE__ */ __commonJSMin(((exports, module) =
|
|
|
12597
12597
|
//#endregion
|
|
12598
12598
|
//#region ../../node_modules/.pnpm/proper-lockfile@4.1.2/node_modules/proper-lockfile/lib/lockfile.js
|
|
12599
12599
|
var require_lockfile = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
12600
|
-
const path$
|
|
12600
|
+
const path$17 = __require("path");
|
|
12601
12601
|
const fs = require_graceful_fs();
|
|
12602
12602
|
const retry = require_retry$3();
|
|
12603
12603
|
const onExit = require_signal_exit();
|
|
@@ -12607,7 +12607,7 @@ var require_lockfile = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
12607
12607
|
return options.lockfilePath || `${file}.lock`;
|
|
12608
12608
|
}
|
|
12609
12609
|
function resolveCanonicalPath(file, options, callback) {
|
|
12610
|
-
if (!options.realpath) return callback(null, path$
|
|
12610
|
+
if (!options.realpath) return callback(null, path$17.resolve(file));
|
|
12611
12611
|
options.fs.realpath(file, callback);
|
|
12612
12612
|
}
|
|
12613
12613
|
function acquireLock(file, options, callback) {
|
|
@@ -15089,7 +15089,7 @@ async function syncDir(dirPath) {
|
|
|
15089
15089
|
*/
|
|
15090
15090
|
function syncFd(fd) {
|
|
15091
15091
|
return new Promise((resolve, reject) => {
|
|
15092
|
-
fs$
|
|
15092
|
+
fs$18.fsync(fd, (err) => {
|
|
15093
15093
|
if (err) {
|
|
15094
15094
|
reject(err);
|
|
15095
15095
|
return;
|
|
@@ -26044,7 +26044,7 @@ var require_loader = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
26044
26044
|
};
|
|
26045
26045
|
return _setPrototypeOf(o, p);
|
|
26046
26046
|
}
|
|
26047
|
-
var path$
|
|
26047
|
+
var path$16 = __require("path");
|
|
26048
26048
|
module.exports = /* @__PURE__ */ function(_EmitterObj) {
|
|
26049
26049
|
_inheritsLoose(Loader, _EmitterObj);
|
|
26050
26050
|
function Loader() {
|
|
@@ -26052,7 +26052,7 @@ var require_loader = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
26052
26052
|
}
|
|
26053
26053
|
var _proto = Loader.prototype;
|
|
26054
26054
|
_proto.resolve = function resolve(from, to) {
|
|
26055
|
-
return path$
|
|
26055
|
+
return path$16.resolve(path$16.dirname(from), to);
|
|
26056
26056
|
};
|
|
26057
26057
|
_proto.isRelative = function isRelative(filename) {
|
|
26058
26058
|
return filename.indexOf("./") === 0 || filename.indexOf("../") === 0;
|
|
@@ -27708,8 +27708,8 @@ var require_node_loaders = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
27708
27708
|
};
|
|
27709
27709
|
return _setPrototypeOf(o, p);
|
|
27710
27710
|
}
|
|
27711
|
-
var fs$
|
|
27712
|
-
var path$
|
|
27711
|
+
var fs$16 = __require("fs");
|
|
27712
|
+
var path$15 = __require("path");
|
|
27713
27713
|
var Loader = require_loader();
|
|
27714
27714
|
var PrecompiledLoader = require_precompiled_loader().PrecompiledLoader;
|
|
27715
27715
|
var chokidar;
|
|
@@ -27724,7 +27724,7 @@ var require_node_loaders = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
27724
27724
|
_this.noCache = !!opts.noCache;
|
|
27725
27725
|
if (searchPaths) {
|
|
27726
27726
|
searchPaths = Array.isArray(searchPaths) ? searchPaths : [searchPaths];
|
|
27727
|
-
_this.searchPaths = searchPaths.map(path$
|
|
27727
|
+
_this.searchPaths = searchPaths.map(path$15.normalize);
|
|
27728
27728
|
} else _this.searchPaths = ["."];
|
|
27729
27729
|
if (opts.watch) {
|
|
27730
27730
|
try {
|
|
@@ -27732,10 +27732,10 @@ var require_node_loaders = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
27732
27732
|
} catch (e) {
|
|
27733
27733
|
throw new Error("watch requires chokidar to be installed");
|
|
27734
27734
|
}
|
|
27735
|
-
var paths = _this.searchPaths.filter(fs$
|
|
27735
|
+
var paths = _this.searchPaths.filter(fs$16.existsSync);
|
|
27736
27736
|
var watcher = chokidar.watch(paths);
|
|
27737
27737
|
watcher.on("all", function(event, fullname) {
|
|
27738
|
-
fullname = path$
|
|
27738
|
+
fullname = path$15.resolve(fullname);
|
|
27739
27739
|
if (event === "change" && fullname in _this.pathsToNames) _this.emit("update", _this.pathsToNames[fullname], fullname);
|
|
27740
27740
|
});
|
|
27741
27741
|
watcher.on("error", function(error) {
|
|
@@ -27749,9 +27749,9 @@ var require_node_loaders = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
27749
27749
|
var fullpath = null;
|
|
27750
27750
|
var paths = this.searchPaths;
|
|
27751
27751
|
for (var i = 0; i < paths.length; i++) {
|
|
27752
|
-
var basePath = path$
|
|
27753
|
-
var p = path$
|
|
27754
|
-
if (p.indexOf(basePath) === 0 && fs$
|
|
27752
|
+
var basePath = path$15.resolve(paths[i]);
|
|
27753
|
+
var p = path$15.resolve(paths[i], name);
|
|
27754
|
+
if (p.indexOf(basePath) === 0 && fs$16.existsSync(p)) {
|
|
27755
27755
|
fullpath = p;
|
|
27756
27756
|
break;
|
|
27757
27757
|
}
|
|
@@ -27759,7 +27759,7 @@ var require_node_loaders = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
27759
27759
|
if (!fullpath) return null;
|
|
27760
27760
|
this.pathsToNames[fullpath] = name;
|
|
27761
27761
|
var source = {
|
|
27762
|
-
src: fs$
|
|
27762
|
+
src: fs$16.readFileSync(fullpath, "utf-8"),
|
|
27763
27763
|
path: fullpath,
|
|
27764
27764
|
noCache: this.noCache
|
|
27765
27765
|
};
|
|
@@ -27807,7 +27807,7 @@ var require_node_loaders = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
27807
27807
|
}
|
|
27808
27808
|
this.pathsToNames[fullpath] = name;
|
|
27809
27809
|
var source = {
|
|
27810
|
-
src: fs$
|
|
27810
|
+
src: fs$16.readFileSync(fullpath, "utf-8"),
|
|
27811
27811
|
path: fullpath,
|
|
27812
27812
|
noCache: this.noCache
|
|
27813
27813
|
};
|
|
@@ -28109,13 +28109,13 @@ var require_globals = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
28109
28109
|
//#endregion
|
|
28110
28110
|
//#region ../../node_modules/.pnpm/nunjucks@3.2.4_chokidar@4.0.3/node_modules/nunjucks/src/express-app.js
|
|
28111
28111
|
var require_express_app = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
28112
|
-
var path$
|
|
28112
|
+
var path$14 = __require("path");
|
|
28113
28113
|
module.exports = function express(env, app) {
|
|
28114
28114
|
function NunjucksView(name, opts) {
|
|
28115
28115
|
this.name = name;
|
|
28116
28116
|
this.path = name;
|
|
28117
28117
|
this.defaultEngine = opts.defaultEngine;
|
|
28118
|
-
this.ext = path$
|
|
28118
|
+
this.ext = path$14.extname(name);
|
|
28119
28119
|
if (!this.ext && !this.defaultEngine) throw new Error("No default engine was specified and no extension was provided.");
|
|
28120
28120
|
if (!this.ext) this.name += this.ext = (this.defaultEngine[0] !== "." ? "." : "") + this.defaultEngine;
|
|
28121
28121
|
}
|
|
@@ -28551,8 +28551,8 @@ var require_precompile_global = /* @__PURE__ */ __commonJSMin(((exports, module)
|
|
|
28551
28551
|
//#endregion
|
|
28552
28552
|
//#region ../../node_modules/.pnpm/nunjucks@3.2.4_chokidar@4.0.3/node_modules/nunjucks/src/precompile.js
|
|
28553
28553
|
var require_precompile = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
28554
|
-
var fs$
|
|
28555
|
-
var path$
|
|
28554
|
+
var fs$15 = __require("fs");
|
|
28555
|
+
var path$13 = __require("path");
|
|
28556
28556
|
var _prettifyError = require_lib$8()._prettifyError;
|
|
28557
28557
|
var compiler = require_compiler();
|
|
28558
28558
|
var Environment = require_environment().Environment;
|
|
@@ -28576,27 +28576,27 @@ var require_precompile = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
28576
28576
|
var env = opts.env || new Environment([]);
|
|
28577
28577
|
var wrapper = opts.wrapper || precompileGlobal;
|
|
28578
28578
|
if (opts.isString) return precompileString(input, opts);
|
|
28579
|
-
var pathStats = fs$
|
|
28579
|
+
var pathStats = fs$15.existsSync(input) && fs$15.statSync(input);
|
|
28580
28580
|
var precompiled = [];
|
|
28581
28581
|
var templates = [];
|
|
28582
28582
|
function addTemplates(dir) {
|
|
28583
|
-
fs$
|
|
28584
|
-
var filepath = path$
|
|
28585
|
-
var subpath = filepath.substr(path$
|
|
28586
|
-
var stat = fs$
|
|
28583
|
+
fs$15.readdirSync(dir).forEach(function(file) {
|
|
28584
|
+
var filepath = path$13.join(dir, file);
|
|
28585
|
+
var subpath = filepath.substr(path$13.join(input, "/").length);
|
|
28586
|
+
var stat = fs$15.statSync(filepath);
|
|
28587
28587
|
if (stat && stat.isDirectory()) {
|
|
28588
28588
|
subpath += "/";
|
|
28589
28589
|
if (!match(subpath, opts.exclude)) addTemplates(filepath);
|
|
28590
28590
|
} else if (match(subpath, opts.include)) templates.push(filepath);
|
|
28591
28591
|
});
|
|
28592
28592
|
}
|
|
28593
|
-
if (pathStats.isFile()) precompiled.push(_precompile(fs$
|
|
28593
|
+
if (pathStats.isFile()) precompiled.push(_precompile(fs$15.readFileSync(input, "utf-8"), opts.name || input, env));
|
|
28594
28594
|
else if (pathStats.isDirectory()) {
|
|
28595
28595
|
addTemplates(input);
|
|
28596
28596
|
for (var i = 0; i < templates.length; i++) {
|
|
28597
|
-
var name = templates[i].replace(path$
|
|
28597
|
+
var name = templates[i].replace(path$13.join(input, "/"), "");
|
|
28598
28598
|
try {
|
|
28599
|
-
precompiled.push(_precompile(fs$
|
|
28599
|
+
precompiled.push(_precompile(fs$15.readFileSync(templates[i], "utf-8"), name, env));
|
|
28600
28600
|
} catch (e) {
|
|
28601
28601
|
if (opts.force) console.error(e);
|
|
28602
28602
|
else throw e;
|
|
@@ -32634,7 +32634,7 @@ var require_buffer_from = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
32634
32634
|
//#region ../../node_modules/.pnpm/source-map-support@0.5.21/node_modules/source-map-support/source-map-support.js
|
|
32635
32635
|
var require_source_map_support = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
32636
32636
|
var SourceMapConsumer = require_source_map().SourceMapConsumer;
|
|
32637
|
-
var path$
|
|
32637
|
+
var path$12 = __require("path");
|
|
32638
32638
|
var fs;
|
|
32639
32639
|
try {
|
|
32640
32640
|
fs = __require("fs");
|
|
@@ -32711,15 +32711,15 @@ var require_source_map_support = /* @__PURE__ */ __commonJSMin(((exports, module
|
|
|
32711
32711
|
});
|
|
32712
32712
|
function supportRelativeURL(file, url) {
|
|
32713
32713
|
if (!file) return url;
|
|
32714
|
-
var dir = path$
|
|
32714
|
+
var dir = path$12.dirname(file);
|
|
32715
32715
|
var match = /^\w+:\/\/[^\/]*/.exec(dir);
|
|
32716
32716
|
var protocol = match ? match[0] : "";
|
|
32717
32717
|
var startPath = dir.slice(protocol.length);
|
|
32718
32718
|
if (protocol && /^\/\w\:/.test(startPath)) {
|
|
32719
32719
|
protocol += "/";
|
|
32720
|
-
return protocol + path$
|
|
32720
|
+
return protocol + path$12.resolve(dir.slice(protocol.length), url).replace(/\\/g, "/");
|
|
32721
32721
|
}
|
|
32722
|
-
return protocol + path$
|
|
32722
|
+
return protocol + path$12.resolve(dir.slice(protocol.length), url);
|
|
32723
32723
|
}
|
|
32724
32724
|
function retrieveSourceMapURL(source) {
|
|
32725
32725
|
var fileData;
|
|
@@ -191962,7 +191962,7 @@ var require_gifframe = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
191962
191962
|
//#region ../../node_modules/.pnpm/gifwrap@0.10.1/node_modules/gifwrap/src/gifutil.js
|
|
191963
191963
|
var require_gifutil = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
191964
191964
|
/** @namespace GifUtil */
|
|
191965
|
-
const fs$
|
|
191965
|
+
const fs$14 = __require("fs");
|
|
191966
191966
|
const ImageQ = require_image_q();
|
|
191967
191967
|
const BitmapImage = require_bitmapimage();
|
|
191968
191968
|
const { GifFrame } = require_gifframe();
|
|
@@ -192229,7 +192229,7 @@ var require_gifutil = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
192229
192229
|
}
|
|
192230
192230
|
function _readBinary(path) {
|
|
192231
192231
|
return new Promise((resolve, reject) => {
|
|
192232
|
-
fs$
|
|
192232
|
+
fs$14.readFile(path, (err, buffer) => {
|
|
192233
192233
|
if (err) return reject(err);
|
|
192234
192234
|
return resolve(buffer);
|
|
192235
192235
|
});
|
|
@@ -192237,7 +192237,7 @@ var require_gifutil = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
192237
192237
|
}
|
|
192238
192238
|
function _writeBinary(path, buffer) {
|
|
192239
192239
|
return new Promise((resolve, reject) => {
|
|
192240
|
-
fs$
|
|
192240
|
+
fs$14.writeFile(path, buffer, (err) => {
|
|
192241
192241
|
if (err) return reject(err);
|
|
192242
192242
|
return resolve();
|
|
192243
192243
|
});
|
|
@@ -218055,7 +218055,7 @@ var init_file_type = __esmMin((() => {
|
|
|
218055
218055
|
}
|
|
218056
218056
|
async fromFile(path) {
|
|
218057
218057
|
this.options.signal?.throwIfAborted();
|
|
218058
|
-
const fileHandle = await
|
|
218058
|
+
const fileHandle = await fs.open(path, constants.O_RDONLY | constants.O_NONBLOCK);
|
|
218059
218059
|
const fileStat = await fileHandle.stat();
|
|
218060
218060
|
if (!fileStat.isFile()) {
|
|
218061
218061
|
await fileHandle.close();
|
|
@@ -228560,7 +228560,7 @@ async function processBitmapFont(file, font) {
|
|
|
228560
228560
|
...font,
|
|
228561
228561
|
chars,
|
|
228562
228562
|
kernings,
|
|
228563
|
-
pages: await Promise.all(font.pages.map(async (page) => CharacterJimp.read(
|
|
228563
|
+
pages: await Promise.all(font.pages.map(async (page) => CharacterJimp.read(path$1.join(path$1.dirname(file), page))))
|
|
228564
228564
|
};
|
|
228565
228565
|
}
|
|
228566
228566
|
var import_parse_bmfont_ascii, import_lib$1, import_parse_bmfont_binary, convertXML, isWebWorker, CharacterJimp, HEADER;
|
|
@@ -259124,7 +259124,7 @@ function Yn(s, t) {
|
|
|
259124
259124
|
function Kn(s, t) {
|
|
259125
259125
|
s.head = new ue$1(t, void 0, s.head, s), s.tail || (s.tail = s.head), s.length++;
|
|
259126
259126
|
}
|
|
259127
|
-
var zr, Ur, Ds, Wr, Gr, Zr, Q$1, J$1, nt$1, De$1, qt, Ne$1, Ns, Ae$1, As, z$1, Mt, g$1, Qt, Bt, b$1, N$1, _$1, bi, Ie$1, L$1, S, _i, Oi, Is, Ti, Z$1, xi, Ce$1, Jt$1, Rt, C, jt, Yr, Kr, Vr, $r, Fe$1, Li, Xr, qr, A$1, Jr, ht, H$1, te, m$1, Ni, tt$1, Ai, ki, vi, ie$1, ke$1, Ut$1, Ht, Ii, Pt, at, U$1, ot, Y$1, zt, Ci, j$1, ee$1, Fi, ve$1, gt$2, Me, bt, _t, Be$1, et$1, Wt$1, jr, Fs, ks, vs, Ms, Bs, tn, se$1, K$1, sn, M$1, rn, zs, nn, Bi, Tt, Gt, Pi, re, Pe$1, ze$1, Ue, He$1, We$1, Ge$1, Ze$1, Ye$1, Ke$1, Us, hn, an, Hs, ln, cn, Ws, Gs, Hi, ne, dn, Ui, oe$1, Ve$1, un, F$1, mn, xt, Wi, pn, lt, En, wn, Sn, ct, yn, Rn, gn, Gi, bn, Lt, ft, On, Tn, xn, f, $e$1, Dt, Nn, Xi, qi, An, B$1, Nt, it, Zi, Zs, V$1, he$1, dt, Ys, p, st$1, ut, Yi, At, w$1, Xe$1, qe$1, Ki, Ks, Vs, ae$1, Vi, Qe$1, Yt$1, $$1, Je$1, It, je$1, ti, $s, In, le$1, $i, Xs, Cn, rt$1, mt, vn, Qi, Mn, Bn, Ct, Ji, zn, qs, ce$1, ei, ji, Un, Hn, ts, Qs, rr, Wn, tr, er, ir, is$2, sr, fe$1, ii, ss, si, rs, ns, os$7, hs, pt, ri, as, es, q$1, de$1, ni, oi, Gn, hi, ue$1, pi, nr, li, me$1, W$1, pe$2, Et, Ft$1, Ee$1, ai, G, ls, ci, or, ds, us, fi, di, hr, cs, ui, lr, fs$
|
|
259127
|
+
var zr, Ur, Ds, Wr, Gr, Zr, Q$1, J$1, nt$1, De$1, qt, Ne$1, Ns, Ae$1, As, z$1, Mt, g$1, Qt, Bt, b$1, N$1, _$1, bi, Ie$1, L$1, S, _i, Oi, Is, Ti, Z$1, xi, Ce$1, Jt$1, Rt, C, jt, Yr, Kr, Vr, $r, Fe$1, Li, Xr, qr, A$1, Jr, ht, H$1, te, m$1, Ni, tt$1, Ai, ki, vi, ie$1, ke$1, Ut$1, Ht, Ii, Pt, at, U$1, ot, Y$1, zt, Ci, j$1, ee$1, Fi, ve$1, gt$2, Me, bt, _t, Be$1, et$1, Wt$1, jr, Fs, ks, vs, Ms, Bs, tn, se$1, K$1, sn, M$1, rn, zs, nn, Bi, Tt, Gt, Pi, re, Pe$1, ze$1, Ue, He$1, We$1, Ge$1, Ze$1, Ye$1, Ke$1, Us, hn, an, Hs, ln, cn, Ws, Gs, Hi, ne, dn, Ui, oe$1, Ve$1, un, F$1, mn, xt, Wi, pn, lt, En, wn, Sn, ct, yn, Rn, gn, Gi, bn, Lt, ft, On, Tn, xn, f, $e$1, Dt, Nn, Xi, qi, An, B$1, Nt, it, Zi, Zs, V$1, he$1, dt, Ys, p, st$1, ut, Yi, At, w$1, Xe$1, qe$1, Ki, Ks, Vs, ae$1, Vi, Qe$1, Yt$1, $$1, Je$1, It, je$1, ti, $s, In, le$1, $i, Xs, Cn, rt$1, mt, vn, Qi, Mn, Bn, Ct, Ji, zn, qs, ce$1, ei, ji, Un, Hn, ts, Qs, rr, Wn, tr, er, ir, is$2, sr, fe$1, ii, ss, si, rs, ns, os$7, hs, pt, ri, as, es, q$1, de$1, ni, oi, Gn, hi, ue$1, pi, nr, li, me$1, W$1, pe$2, Et, Ft$1, Ee$1, ai, G, ls, ci, or, ds, us, fi, di, hr, cs, ui, lr, fs$13, wt, kt, Vn, $n, fr, dr, Xn, qn, Er, wr, ur, Sr, yr, Rr, jn, to, eo, mr, ms, ps, Ei, io, Es, so, ws, Se$1, St, no, gr, Ss, br, oo, _r, ys, Or, Vt$1, Tr, ao, lo, yi, Lr, Dr, _s, Nr, Os, P$1, Ts, xs, gi, Ar, Ir, Re, Cr, Fr, Rs, yt, O$1, Ri, kr, $t, gs, bs, Ls, ge$1, be, _e$1, Oe$1, Te$1, uo, mo, po, vr, Xt$1, ye$1, xe$1, Eo, wo, So, yo, Ro, go, bo, _o, vt, To;
|
|
259128
259128
|
var init_index_min = __esmMin((() => {
|
|
259129
259129
|
zr = Object.defineProperty;
|
|
259130
259130
|
Ur = (s, t) => {
|
|
@@ -260652,7 +260652,7 @@ while (this[Zs](this[st$1].shift()));
|
|
|
260652
260652
|
let [o, h] = ce$1(this.path);
|
|
260653
260653
|
o && typeof h == "string" && (this.path = h, r = o);
|
|
260654
260654
|
}
|
|
260655
|
-
this.win32 = !!i.win32 || process.platform === "win32", this.win32 && (this.path = Qs(this.path.replaceAll(/\\/g, "/")), t = t.replaceAll(/\\/g, "/")), this.absolute = f(i.absolute ||
|
|
260655
|
+
this.win32 = !!i.win32 || process.platform === "win32", this.win32 && (this.path = Qs(this.path.replaceAll(/\\/g, "/")), t = t.replaceAll(/\\/g, "/")), this.absolute = f(i.absolute || path$1.resolve(this.cwd, t)), this.path === "" && (this.path = "./"), r && this.warn("TAR_ENTRY_INFO", `stripping ${r} from absolute path`, {
|
|
260656
260656
|
entry: this,
|
|
260657
260657
|
path: r + this.path
|
|
260658
260658
|
});
|
|
@@ -260735,7 +260735,7 @@ while (this[Zs](this[st$1].shift()));
|
|
|
260735
260735
|
}
|
|
260736
260736
|
[sr](t) {
|
|
260737
260737
|
if (!this.stat) throw new Error("cannot create link entry without stat");
|
|
260738
|
-
this.type = "Link", this.linkpath = f(
|
|
260738
|
+
this.type = "Link", this.linkpath = f(path$1.relative(this.cwd, t)), this.stat.size = 0, this[fe$1](), this.end();
|
|
260739
260739
|
}
|
|
260740
260740
|
[er]() {
|
|
260741
260741
|
if (!this.stat) throw new Error("cannot create file entry without stat");
|
|
@@ -261094,7 +261094,7 @@ while (this[Zs](this[st$1].shift()));
|
|
|
261094
261094
|
constructor(t, e) {
|
|
261095
261095
|
this.path = t || "./", this.absolute = e;
|
|
261096
261096
|
}
|
|
261097
|
-
}, nr = Buffer.alloc(1024), li = Symbol("onStat"), me$1 = Symbol("ended"), W$1 = Symbol("queue"), pe$2 = Symbol("pendingLinks"), Et = Symbol("current"), Ft$1 = Symbol("process"), Ee$1 = Symbol("processing"), ai = Symbol("processJob"), G = Symbol("jobs"), ls = Symbol("jobDone"), ci = Symbol("addFSEntry"), or = Symbol("addTarEntry"), ds = Symbol("stat"), us = Symbol("readdir"), fi = Symbol("onreaddir"), di = Symbol("pipe"), hr = Symbol("entry"), cs = Symbol("entryOpt"), ui = Symbol("writeEntryClass"), lr = Symbol("write"), fs$
|
|
261097
|
+
}, nr = Buffer.alloc(1024), li = Symbol("onStat"), me$1 = Symbol("ended"), W$1 = Symbol("queue"), pe$2 = Symbol("pendingLinks"), Et = Symbol("current"), Ft$1 = Symbol("process"), Ee$1 = Symbol("processing"), ai = Symbol("processJob"), G = Symbol("jobs"), ls = Symbol("jobDone"), ci = Symbol("addFSEntry"), or = Symbol("addTarEntry"), ds = Symbol("stat"), us = Symbol("readdir"), fi = Symbol("onreaddir"), di = Symbol("pipe"), hr = Symbol("entry"), cs = Symbol("entryOpt"), ui = Symbol("writeEntryClass"), lr = Symbol("write"), fs$13 = Symbol("ondrain"), wt = class extends A$1 {
|
|
261098
261098
|
sync = !1;
|
|
261099
261099
|
opt;
|
|
261100
261100
|
cwd;
|
|
@@ -261127,8 +261127,8 @@ while (this[Zs](this[st$1].shift()));
|
|
|
261127
261127
|
if ((t.gzip ? 1 : 0) + (t.brotli ? 1 : 0) + (t.zstd ? 1 : 0) > 1) throw new TypeError("gzip, brotli, zstd are mutually exclusive");
|
|
261128
261128
|
if (t.gzip && (typeof t.gzip != "object" && (t.gzip = {}), this.portable && (t.gzip.portable = !0), this.zip = new ze$1(t.gzip)), t.brotli && (typeof t.brotli != "object" && (t.brotli = {}), this.zip = new We$1(t.brotli)), t.zstd && (typeof t.zstd != "object" && (t.zstd = {}), this.zip = new Ye$1(t.zstd)), !this.zip) throw new Error("impossible");
|
|
261129
261129
|
let e = this.zip;
|
|
261130
|
-
e.on("data", (i) => super.write(i)), e.on("end", () => super.end()), e.on("drain", () => this[fs$
|
|
261131
|
-
} else this.on("drain", this[fs$
|
|
261130
|
+
e.on("data", (i) => super.write(i)), e.on("end", () => super.end()), e.on("drain", () => this[fs$13]()), this.on("resume", () => e.resume());
|
|
261131
|
+
} else this.on("drain", this[fs$13]);
|
|
261132
261132
|
this.noDirRecurse = !!t.noDirRecurse, this.follow = !!t.follow, this.noMtime = !!t.noMtime, t.mtime && (this.mtime = t.mtime), this.filter = typeof t.filter == "function" ? t.filter : () => !0, this[W$1] = new hi(), this[G] = 0, this.jobs = Number(t.jobs) || 4, this[Ee$1] = !1, this[me$1] = !1;
|
|
261133
261133
|
}
|
|
261134
261134
|
[lr](t) {
|
|
@@ -261145,7 +261145,7 @@ while (this[Zs](this[st$1].shift()));
|
|
|
261145
261145
|
return typeof t == "string" ? this[ci](t) : this[or](t), this.flowing;
|
|
261146
261146
|
}
|
|
261147
261147
|
[or](t) {
|
|
261148
|
-
let e = f(
|
|
261148
|
+
let e = f(path$1.resolve(this.cwd, t.path));
|
|
261149
261149
|
if (!this.filter(t.path, t)) t.resume();
|
|
261150
261150
|
else {
|
|
261151
261151
|
let i = new pi(t.path, e);
|
|
@@ -261154,7 +261154,7 @@ while (this[Zs](this[st$1].shift()));
|
|
|
261154
261154
|
this[Ft$1]();
|
|
261155
261155
|
}
|
|
261156
261156
|
[ci](t) {
|
|
261157
|
-
let e = f(
|
|
261157
|
+
let e = f(path$1.resolve(this.cwd, t));
|
|
261158
261158
|
this[W$1].push(new pi(t, e)), this[Ft$1]();
|
|
261159
261159
|
}
|
|
261160
261160
|
[ds](t) {
|
|
@@ -261255,7 +261255,7 @@ while (this[Zs](this[st$1].shift()));
|
|
|
261255
261255
|
this.emit("error", e);
|
|
261256
261256
|
}
|
|
261257
261257
|
}
|
|
261258
|
-
[fs$
|
|
261258
|
+
[fs$13]() {
|
|
261259
261259
|
this[Et] && this[Et].entry && this[Et].entry.resume();
|
|
261260
261260
|
}
|
|
261261
261261
|
[di](t) {
|
|
@@ -261421,7 +261421,7 @@ while (this[Zs](this[st$1].shift()));
|
|
|
261421
261421
|
E ? e(E) : x && a ? Es(x, o, h, (Le) => y(Le)) : n ? Kt.chmod(s, r, e) : e();
|
|
261422
261422
|
};
|
|
261423
261423
|
if (s === d) return no(s, y);
|
|
261424
|
-
if (l) return
|
|
261424
|
+
if (l) return fs.mkdir(s, {
|
|
261425
261425
|
mode: r,
|
|
261426
261426
|
recursive: !0
|
|
261427
261427
|
}).then((E) => y(null, E ?? void 0), y);
|
|
@@ -262180,7 +262180,7 @@ var require_pend = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
262180
262180
|
//#endregion
|
|
262181
262181
|
//#region ../../node_modules/.pnpm/yauzl@3.3.0/node_modules/yauzl/fd-slicer.js
|
|
262182
262182
|
var require_fd_slicer = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
262183
|
-
var fs$
|
|
262183
|
+
var fs$12 = __require("fs");
|
|
262184
262184
|
var util$6 = __require("util");
|
|
262185
262185
|
var stream$2 = __require("stream");
|
|
262186
262186
|
var Readable = stream$2.Readable;
|
|
@@ -262205,7 +262205,7 @@ var require_fd_slicer = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
262205
262205
|
FdSlicer.prototype.read = function(buffer, offset, length, position, callback) {
|
|
262206
262206
|
var self = this;
|
|
262207
262207
|
self.pend.go(function(cb) {
|
|
262208
|
-
fs$
|
|
262208
|
+
fs$12.read(self.fd, buffer, offset, length, position, function(err, bytesRead, buffer) {
|
|
262209
262209
|
cb();
|
|
262210
262210
|
callback(err, bytesRead, buffer);
|
|
262211
262211
|
});
|
|
@@ -262214,7 +262214,7 @@ var require_fd_slicer = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
262214
262214
|
FdSlicer.prototype.write = function(buffer, offset, length, position, callback) {
|
|
262215
262215
|
var self = this;
|
|
262216
262216
|
self.pend.go(function(cb) {
|
|
262217
|
-
fs$
|
|
262217
|
+
fs$12.write(self.fd, buffer, offset, length, position, function(err, written, buffer) {
|
|
262218
262218
|
cb();
|
|
262219
262219
|
callback(err, written, buffer);
|
|
262220
262220
|
});
|
|
@@ -262234,7 +262234,7 @@ var require_fd_slicer = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
262234
262234
|
self.refCount -= 1;
|
|
262235
262235
|
if (self.refCount > 0) return;
|
|
262236
262236
|
if (self.refCount < 0) throw new Error("invalid unref");
|
|
262237
|
-
if (self.autoClose) fs$
|
|
262237
|
+
if (self.autoClose) fs$12.close(self.fd, onCloseDone);
|
|
262238
262238
|
function onCloseDone(err) {
|
|
262239
262239
|
if (err) self.emit("error", err);
|
|
262240
262240
|
else self.emit("close");
|
|
@@ -262265,7 +262265,7 @@ var require_fd_slicer = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
262265
262265
|
self.context.pend.go(function(cb) {
|
|
262266
262266
|
if (self.destroyed) return cb();
|
|
262267
262267
|
var buffer = Buffer.allocUnsafe(toRead);
|
|
262268
|
-
fs$
|
|
262268
|
+
fs$12.read(self.context.fd, buffer, 0, toRead, self.pos, function(err, bytesRead) {
|
|
262269
262269
|
if (err) self.destroy(err);
|
|
262270
262270
|
else if (bytesRead === 0) {
|
|
262271
262271
|
self.destroyed = true;
|
|
@@ -262311,7 +262311,7 @@ var require_fd_slicer = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
262311
262311
|
}
|
|
262312
262312
|
self.context.pend.go(function(cb) {
|
|
262313
262313
|
if (self.destroyed) return cb();
|
|
262314
|
-
fs$
|
|
262314
|
+
fs$12.write(self.context.fd, buffer, 0, buffer.length, self.pos, function(err, bytes) {
|
|
262315
262315
|
if (err) {
|
|
262316
262316
|
self.destroy();
|
|
262317
262317
|
cb();
|
|
@@ -266224,14 +266224,14 @@ async function readGitExecPath(deps, gitExe) {
|
|
|
266224
266224
|
}
|
|
266225
266225
|
}
|
|
266226
266226
|
function gitBashCandidatesFromGitExe(gitExe) {
|
|
266227
|
-
const normalizedGitExe = path$
|
|
266228
|
-
const gitDir = path$
|
|
266229
|
-
const gitDirName = path$
|
|
266227
|
+
const normalizedGitExe = path$18.win32.normalize(normalizeWindowsPath(gitExe));
|
|
266228
|
+
const gitDir = path$18.win32.dirname(normalizedGitExe);
|
|
266229
|
+
const gitDirName = path$18.win32.basename(gitDir).toLowerCase();
|
|
266230
266230
|
if (gitDirName !== "cmd" && gitDirName !== "bin") return;
|
|
266231
|
-
return gitBashCandidatesFromGitRoot(path$
|
|
266231
|
+
return gitBashCandidatesFromGitRoot(path$18.win32.dirname(gitDir));
|
|
266232
266232
|
}
|
|
266233
266233
|
function gitBashCandidatesFromGitExecPath(execPath) {
|
|
266234
|
-
const normalized = path$
|
|
266234
|
+
const normalized = path$18.win32.normalize(normalizeWindowsPath(execPath));
|
|
266235
266235
|
const parts = normalized.split("\\");
|
|
266236
266236
|
for (let i = parts.length - 1; i >= 0; i -= 1) {
|
|
266237
266237
|
const segment = parts[i]?.toLowerCase();
|
|
@@ -266240,16 +266240,16 @@ function gitBashCandidatesFromGitExecPath(execPath) {
|
|
|
266240
266240
|
if (root.length > 0) return gitBashCandidatesFromGitRoot(root);
|
|
266241
266241
|
}
|
|
266242
266242
|
}
|
|
266243
|
-
return gitBashCandidatesFromGitRoot(path$
|
|
266243
|
+
return gitBashCandidatesFromGitRoot(path$18.win32.join(normalized, "..", ".."));
|
|
266244
266244
|
}
|
|
266245
266245
|
function gitBashCandidatesFromGitRoot(root) {
|
|
266246
|
-
return [path$
|
|
266246
|
+
return [path$18.win32.normalize(path$18.win32.join(root, "bin", "bash.exe")), path$18.win32.normalize(path$18.win32.join(root, "usr", "bin", "bash.exe"))];
|
|
266247
266247
|
}
|
|
266248
266248
|
function normalizeWindowsPath(path) {
|
|
266249
266249
|
return path.replaceAll("/", "\\");
|
|
266250
266250
|
}
|
|
266251
266251
|
function isAbsoluteWindowsPath(path) {
|
|
266252
|
-
return path$
|
|
266252
|
+
return path$18.win32.isAbsolute(normalizeWindowsPath(path));
|
|
266253
266253
|
}
|
|
266254
266254
|
function dedupeWindowsPaths(paths) {
|
|
266255
266255
|
const deduped = [];
|
|
@@ -303168,7 +303168,7 @@ var init_proxy = __esmMin((() => {
|
|
|
303168
303168
|
var require_windows = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
303169
303169
|
module.exports = isexe;
|
|
303170
303170
|
isexe.sync = sync;
|
|
303171
|
-
var fs$
|
|
303171
|
+
var fs$10 = __require("fs");
|
|
303172
303172
|
function checkPathExt(path, options) {
|
|
303173
303173
|
var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT;
|
|
303174
303174
|
if (!pathext) return true;
|
|
@@ -303185,12 +303185,12 @@ var require_windows = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
303185
303185
|
return checkPathExt(path, options);
|
|
303186
303186
|
}
|
|
303187
303187
|
function isexe(path, options, cb) {
|
|
303188
|
-
fs$
|
|
303188
|
+
fs$10.stat(path, function(er, stat) {
|
|
303189
303189
|
cb(er, er ? false : checkStat(stat, path, options));
|
|
303190
303190
|
});
|
|
303191
303191
|
}
|
|
303192
303192
|
function sync(path, options) {
|
|
303193
|
-
return checkStat(fs$
|
|
303193
|
+
return checkStat(fs$10.statSync(path), path, options);
|
|
303194
303194
|
}
|
|
303195
303195
|
}));
|
|
303196
303196
|
//#endregion
|
|
@@ -303198,14 +303198,14 @@ var require_windows = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
303198
303198
|
var require_mode = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
303199
303199
|
module.exports = isexe;
|
|
303200
303200
|
isexe.sync = sync;
|
|
303201
|
-
var fs$
|
|
303201
|
+
var fs$9 = __require("fs");
|
|
303202
303202
|
function isexe(path, options, cb) {
|
|
303203
|
-
fs$
|
|
303203
|
+
fs$9.stat(path, function(er, stat) {
|
|
303204
303204
|
cb(er, er ? false : checkStat(stat, options));
|
|
303205
303205
|
});
|
|
303206
303206
|
}
|
|
303207
303207
|
function sync(path, options) {
|
|
303208
|
-
return checkStat(fs$
|
|
303208
|
+
return checkStat(fs$9.statSync(path), options);
|
|
303209
303209
|
}
|
|
303210
303210
|
function checkStat(stat, options) {
|
|
303211
303211
|
return stat.isFile() && checkMode(stat, options);
|
|
@@ -303269,7 +303269,7 @@ var require_isexe = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
303269
303269
|
//#region ../../node_modules/.pnpm/which@2.0.2/node_modules/which/which.js
|
|
303270
303270
|
var require_which = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
303271
303271
|
const isWindows = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
|
|
303272
|
-
const path$
|
|
303272
|
+
const path$11 = __require("path");
|
|
303273
303273
|
const COLON = isWindows ? ";" : ":";
|
|
303274
303274
|
const isexe = require_isexe();
|
|
303275
303275
|
const getNotFoundError = (cmd) => Object.assign(/* @__PURE__ */ new Error(`not found: ${cmd}`), { code: "ENOENT" });
|
|
@@ -303299,7 +303299,7 @@ var require_which = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
303299
303299
|
if (i === pathEnv.length) return opt.all && found.length ? resolve(found) : reject(getNotFoundError(cmd));
|
|
303300
303300
|
const ppRaw = pathEnv[i];
|
|
303301
303301
|
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
303302
|
-
const pCmd = path$
|
|
303302
|
+
const pCmd = path$11.join(pathPart, cmd);
|
|
303303
303303
|
resolve(subStep(!pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd, i, 0));
|
|
303304
303304
|
});
|
|
303305
303305
|
const subStep = (p, i, ii) => new Promise((resolve, reject) => {
|
|
@@ -303320,7 +303320,7 @@ var require_which = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
303320
303320
|
for (let i = 0; i < pathEnv.length; i++) {
|
|
303321
303321
|
const ppRaw = pathEnv[i];
|
|
303322
303322
|
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
303323
|
-
const pCmd = path$
|
|
303323
|
+
const pCmd = path$11.join(pathPart, cmd);
|
|
303324
303324
|
const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
303325
303325
|
for (let j = 0; j < pathExt.length; j++) {
|
|
303326
303326
|
const cur = p + pathExt[j];
|
|
@@ -303351,7 +303351,7 @@ var require_path_key = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
303351
303351
|
//#endregion
|
|
303352
303352
|
//#region ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js
|
|
303353
303353
|
var require_resolveCommand = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
303354
|
-
const path$
|
|
303354
|
+
const path$10 = __require("path");
|
|
303355
303355
|
const which = require_which();
|
|
303356
303356
|
const getPathKey = require_path_key();
|
|
303357
303357
|
function resolveCommandAttempt(parsed, withoutPathExt) {
|
|
@@ -303366,12 +303366,12 @@ var require_resolveCommand = /* @__PURE__ */ __commonJSMin(((exports, module) =>
|
|
|
303366
303366
|
try {
|
|
303367
303367
|
resolved = which.sync(parsed.command, {
|
|
303368
303368
|
path: env[getPathKey({ env })],
|
|
303369
|
-
pathExt: withoutPathExt ? path$
|
|
303369
|
+
pathExt: withoutPathExt ? path$10.delimiter : void 0
|
|
303370
303370
|
});
|
|
303371
303371
|
} catch (e) {} finally {
|
|
303372
303372
|
if (shouldSwitchCwd) process.chdir(cwd);
|
|
303373
303373
|
}
|
|
303374
|
-
if (resolved) resolved = path$
|
|
303374
|
+
if (resolved) resolved = path$10.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
|
|
303375
303375
|
return resolved;
|
|
303376
303376
|
}
|
|
303377
303377
|
function resolveCommand(parsed) {
|
|
@@ -303420,16 +303420,16 @@ var require_shebang_command = /* @__PURE__ */ __commonJSMin(((exports, module) =
|
|
|
303420
303420
|
//#endregion
|
|
303421
303421
|
//#region ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js
|
|
303422
303422
|
var require_readShebang = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
303423
|
-
const fs$
|
|
303423
|
+
const fs$8 = __require("fs");
|
|
303424
303424
|
const shebangCommand = require_shebang_command();
|
|
303425
303425
|
function readShebang(command) {
|
|
303426
303426
|
const size = 150;
|
|
303427
303427
|
const buffer = Buffer.alloc(size);
|
|
303428
303428
|
let fd;
|
|
303429
303429
|
try {
|
|
303430
|
-
fd = fs$
|
|
303431
|
-
fs$
|
|
303432
|
-
fs$
|
|
303430
|
+
fd = fs$8.openSync(command, "r");
|
|
303431
|
+
fs$8.readSync(fd, buffer, 0, size, 0);
|
|
303432
|
+
fs$8.closeSync(fd);
|
|
303433
303433
|
} catch (e) {}
|
|
303434
303434
|
return shebangCommand(buffer.toString());
|
|
303435
303435
|
}
|
|
@@ -303438,7 +303438,7 @@ var require_readShebang = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
303438
303438
|
//#endregion
|
|
303439
303439
|
//#region ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js
|
|
303440
303440
|
var require_parse$5 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
303441
|
-
const path$
|
|
303441
|
+
const path$9 = __require("path");
|
|
303442
303442
|
const resolveCommand = require_resolveCommand();
|
|
303443
303443
|
const escape = require_escape();
|
|
303444
303444
|
const readShebang = require_readShebang();
|
|
@@ -303461,7 +303461,7 @@ var require_parse$5 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
303461
303461
|
const needsShell = !isExecutableRegExp.test(commandFile);
|
|
303462
303462
|
if (parsed.options.forceShell || needsShell) {
|
|
303463
303463
|
const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
|
|
303464
|
-
parsed.command = path$
|
|
303464
|
+
parsed.command = path$9.normalize(parsed.command);
|
|
303465
303465
|
parsed.command = escape.command(parsed.command);
|
|
303466
303466
|
parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
|
|
303467
303467
|
parsed.args = [
|
|
@@ -337591,7 +337591,7 @@ var require_dist$5 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
337591
337591
|
//#endregion
|
|
337592
337592
|
//#region ../../node_modules/.pnpm/yazl@3.3.1/node_modules/yazl/index.js
|
|
337593
337593
|
var require_yazl = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
337594
|
-
var fs$
|
|
337594
|
+
var fs$7 = __require("fs");
|
|
337595
337595
|
var Transform$2 = __require("stream").Transform;
|
|
337596
337596
|
var PassThrough$2 = __require("stream").PassThrough;
|
|
337597
337597
|
var zlib$1 = __require("zlib");
|
|
@@ -337620,14 +337620,14 @@ var require_yazl = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
337620
337620
|
if (shouldIgnoreAdding(self)) return;
|
|
337621
337621
|
var entry = new Entry(metadataPath, false, options);
|
|
337622
337622
|
self.entries.push(entry);
|
|
337623
|
-
fs$
|
|
337623
|
+
fs$7.stat(realPath, function(err, stats) {
|
|
337624
337624
|
if (err) return self.emit("error", err);
|
|
337625
337625
|
if (!stats.isFile()) return self.emit("error", /* @__PURE__ */ new Error("not a file: " + realPath));
|
|
337626
337626
|
entry.uncompressedSize = stats.size;
|
|
337627
337627
|
if (options.mtime == null) entry.setLastModDate(stats.mtime);
|
|
337628
337628
|
if (options.mode == null) entry.setFileAttributesMode(stats.mode);
|
|
337629
337629
|
entry.setFileDataPumpFunction(function() {
|
|
337630
|
-
var readStream = fs$
|
|
337630
|
+
var readStream = fs$7.createReadStream(realPath);
|
|
337631
337631
|
entry.state = Entry.FILE_DATA_IN_PROGRESS;
|
|
337632
337632
|
readStream.on("error", function(err) {
|
|
337633
337633
|
self.emit("error", err);
|
|
@@ -353428,8 +353428,8 @@ var require_suggestSimilar = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
353428
353428
|
var require_command = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
353429
353429
|
const EventEmitter$12 = __require("node:events").EventEmitter;
|
|
353430
353430
|
const childProcess = __require("node:child_process");
|
|
353431
|
-
const path$
|
|
353432
|
-
const fs$
|
|
353431
|
+
const path$8 = __require("node:path");
|
|
353432
|
+
const fs$6 = __require("node:fs");
|
|
353433
353433
|
const process$2 = __require("node:process");
|
|
353434
353434
|
const { Argument, humanReadableArgName } = require_argument();
|
|
353435
353435
|
const { CommanderError } = require_error$2();
|
|
@@ -354312,7 +354312,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
354312
354312
|
* @param {string} subcommandName
|
|
354313
354313
|
*/
|
|
354314
354314
|
_checkForMissingExecutable(executableFile, executableDir, subcommandName) {
|
|
354315
|
-
if (fs$
|
|
354315
|
+
if (fs$6.existsSync(executableFile)) return;
|
|
354316
354316
|
const executableMissing = `'${executableFile}' does not exist
|
|
354317
354317
|
- if '${subcommandName}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
|
|
354318
354318
|
- if the default executable name is not suitable, use the executableFile option to supply a custom name or path
|
|
@@ -354335,10 +354335,10 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
354335
354335
|
".cjs"
|
|
354336
354336
|
];
|
|
354337
354337
|
function findFile(baseDir, baseName) {
|
|
354338
|
-
const localBin = path$
|
|
354339
|
-
if (fs$
|
|
354340
|
-
if (sourceExt.includes(path$
|
|
354341
|
-
const foundExt = sourceExt.find((ext) => fs$
|
|
354338
|
+
const localBin = path$8.resolve(baseDir, baseName);
|
|
354339
|
+
if (fs$6.existsSync(localBin)) return localBin;
|
|
354340
|
+
if (sourceExt.includes(path$8.extname(baseName))) return void 0;
|
|
354341
|
+
const foundExt = sourceExt.find((ext) => fs$6.existsSync(`${localBin}${ext}`));
|
|
354342
354342
|
if (foundExt) return `${localBin}${foundExt}`;
|
|
354343
354343
|
}
|
|
354344
354344
|
this._checkForMissingMandatoryOptions();
|
|
@@ -354348,21 +354348,21 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
354348
354348
|
if (this._scriptPath) {
|
|
354349
354349
|
let resolvedScriptPath;
|
|
354350
354350
|
try {
|
|
354351
|
-
resolvedScriptPath = fs$
|
|
354351
|
+
resolvedScriptPath = fs$6.realpathSync(this._scriptPath);
|
|
354352
354352
|
} catch {
|
|
354353
354353
|
resolvedScriptPath = this._scriptPath;
|
|
354354
354354
|
}
|
|
354355
|
-
executableDir = path$
|
|
354355
|
+
executableDir = path$8.resolve(path$8.dirname(resolvedScriptPath), executableDir);
|
|
354356
354356
|
}
|
|
354357
354357
|
if (executableDir) {
|
|
354358
354358
|
let localFile = findFile(executableDir, executableFile);
|
|
354359
354359
|
if (!localFile && !subcommand._executableFile && this._scriptPath) {
|
|
354360
|
-
const legacyName = path$
|
|
354360
|
+
const legacyName = path$8.basename(this._scriptPath, path$8.extname(this._scriptPath));
|
|
354361
354361
|
if (legacyName !== this._name) localFile = findFile(executableDir, `${legacyName}-${subcommand._name}`);
|
|
354362
354362
|
}
|
|
354363
354363
|
executableFile = localFile || executableFile;
|
|
354364
354364
|
}
|
|
354365
|
-
launchWithNode = sourceExt.includes(path$
|
|
354365
|
+
launchWithNode = sourceExt.includes(path$8.extname(executableFile));
|
|
354366
354366
|
let proc;
|
|
354367
354367
|
if (process$2.platform !== "win32") if (launchWithNode) {
|
|
354368
354368
|
args.unshift(executableFile);
|
|
@@ -355066,7 +355066,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
355066
355066
|
* @return {Command}
|
|
355067
355067
|
*/
|
|
355068
355068
|
nameFromFilename(filename) {
|
|
355069
|
-
this._name = path$
|
|
355069
|
+
this._name = path$8.basename(filename, path$8.extname(filename));
|
|
355070
355070
|
return this;
|
|
355071
355071
|
}
|
|
355072
355072
|
/**
|
|
@@ -372865,10 +372865,10 @@ var require_atomic_sleep = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
372865
372865
|
//#endregion
|
|
372866
372866
|
//#region ../../node_modules/.pnpm/sonic-boom@4.2.1/node_modules/sonic-boom/index.js
|
|
372867
372867
|
var require_sonic_boom = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
372868
|
-
const fs$
|
|
372868
|
+
const fs$5 = __require("fs");
|
|
372869
372869
|
const EventEmitter$10 = __require("events");
|
|
372870
372870
|
const inherits$6 = __require("util").inherits;
|
|
372871
|
-
const path$
|
|
372871
|
+
const path$7 = __require("path");
|
|
372872
372872
|
const sleep = require_atomic_sleep();
|
|
372873
372873
|
const assert$8 = __require("assert");
|
|
372874
372874
|
const BUSY_WRITE_TIMEOUT = 100;
|
|
@@ -372908,17 +372908,17 @@ var require_sonic_boom = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
372908
372908
|
const flags = sonic.append ? "a" : "w";
|
|
372909
372909
|
const mode = sonic.mode;
|
|
372910
372910
|
if (sonic.sync) try {
|
|
372911
|
-
if (sonic.mkdir) fs$
|
|
372912
|
-
fileOpened(null, fs$
|
|
372911
|
+
if (sonic.mkdir) fs$5.mkdirSync(path$7.dirname(file), { recursive: true });
|
|
372912
|
+
fileOpened(null, fs$5.openSync(file, flags, mode));
|
|
372913
372913
|
} catch (err) {
|
|
372914
372914
|
fileOpened(err);
|
|
372915
372915
|
throw err;
|
|
372916
372916
|
}
|
|
372917
|
-
else if (sonic.mkdir) fs$
|
|
372917
|
+
else if (sonic.mkdir) fs$5.mkdir(path$7.dirname(file), { recursive: true }, (err) => {
|
|
372918
372918
|
if (err) return fileOpened(err);
|
|
372919
|
-
fs$
|
|
372919
|
+
fs$5.open(file, flags, mode, fileOpened);
|
|
372920
372920
|
});
|
|
372921
|
-
else fs$
|
|
372921
|
+
else fs$5.open(file, flags, mode, fileOpened);
|
|
372922
372922
|
}
|
|
372923
372923
|
function SonicBoom(opts) {
|
|
372924
372924
|
if (!(this instanceof SonicBoom)) return new SonicBoom(opts);
|
|
@@ -372956,8 +372956,8 @@ var require_sonic_boom = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
372956
372956
|
this.flush = flushBuffer;
|
|
372957
372957
|
this.flushSync = flushBufferSync;
|
|
372958
372958
|
this._actualWrite = actualWriteBuffer;
|
|
372959
|
-
fsWriteSync = () => fs$
|
|
372960
|
-
fsWrite = () => fs$
|
|
372959
|
+
fsWriteSync = () => fs$5.writeSync(this.fd, this._writingBuf);
|
|
372960
|
+
fsWrite = () => fs$5.write(this.fd, this._writingBuf, this.release);
|
|
372961
372961
|
} else if (contentMode === void 0 || contentMode === kContentModeUtf8) {
|
|
372962
372962
|
this._writingBuf = "";
|
|
372963
372963
|
this.write = write;
|
|
@@ -372965,12 +372965,12 @@ var require_sonic_boom = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
372965
372965
|
this.flushSync = flushSync;
|
|
372966
372966
|
this._actualWrite = actualWrite;
|
|
372967
372967
|
fsWriteSync = () => {
|
|
372968
|
-
if (Buffer.isBuffer(this._writingBuf)) return fs$
|
|
372969
|
-
return fs$
|
|
372968
|
+
if (Buffer.isBuffer(this._writingBuf)) return fs$5.writeSync(this.fd, this._writingBuf);
|
|
372969
|
+
return fs$5.writeSync(this.fd, this._writingBuf, "utf8");
|
|
372970
372970
|
};
|
|
372971
372971
|
fsWrite = () => {
|
|
372972
|
-
if (Buffer.isBuffer(this._writingBuf)) return fs$
|
|
372973
|
-
return fs$
|
|
372972
|
+
if (Buffer.isBuffer(this._writingBuf)) return fs$5.write(this.fd, this._writingBuf, this.release);
|
|
372973
|
+
return fs$5.write(this.fd, this._writingBuf, "utf8", this.release);
|
|
372974
372974
|
};
|
|
372975
372975
|
} else throw new Error(`SonicBoom supports "${kContentModeUtf8}" and "${kContentModeBuffer}", but passed ${contentMode}`);
|
|
372976
372976
|
if (typeof fd === "number") {
|
|
@@ -373015,7 +373015,7 @@ var require_sonic_boom = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
373015
373015
|
return;
|
|
373016
373016
|
}
|
|
373017
373017
|
}
|
|
373018
|
-
if (this._fsync) fs$
|
|
373018
|
+
if (this._fsync) fs$5.fsyncSync(this.fd);
|
|
373019
373019
|
const len = this._len;
|
|
373020
373020
|
if (this._reopening) {
|
|
373021
373021
|
this._writing = false;
|
|
@@ -373112,7 +373112,7 @@ var require_sonic_boom = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
373112
373112
|
this._flushPending = true;
|
|
373113
373113
|
const onDrain = () => {
|
|
373114
373114
|
if (!this._fsync) try {
|
|
373115
|
-
fs$
|
|
373115
|
+
fs$5.fsync(this.fd, (err) => {
|
|
373116
373116
|
this._flushPending = false;
|
|
373117
373117
|
cb(err);
|
|
373118
373118
|
});
|
|
@@ -373189,7 +373189,7 @@ var require_sonic_boom = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
373189
373189
|
if (this._writing) return;
|
|
373190
373190
|
const fd = this.fd;
|
|
373191
373191
|
this.once("ready", () => {
|
|
373192
|
-
if (fd !== this.fd) fs$
|
|
373192
|
+
if (fd !== this.fd) fs$5.close(fd, (err) => {
|
|
373193
373193
|
if (err) return this.emit("error", err);
|
|
373194
373194
|
});
|
|
373195
373195
|
});
|
|
@@ -373220,7 +373220,7 @@ var require_sonic_boom = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
373220
373220
|
while (this._bufs.length || buf.length) {
|
|
373221
373221
|
if (buf.length <= 0) buf = this._bufs[0];
|
|
373222
373222
|
try {
|
|
373223
|
-
const n = Buffer.isBuffer(buf) ? fs$
|
|
373223
|
+
const n = Buffer.isBuffer(buf) ? fs$5.writeSync(this.fd, buf) : fs$5.writeSync(this.fd, buf, "utf8");
|
|
373224
373224
|
const releasedBufObj = releaseWritingBuf(buf, this._len, n);
|
|
373225
373225
|
buf = releasedBufObj.writingBuf;
|
|
373226
373226
|
this._len = releasedBufObj.len;
|
|
@@ -373231,7 +373231,7 @@ var require_sonic_boom = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
373231
373231
|
}
|
|
373232
373232
|
}
|
|
373233
373233
|
try {
|
|
373234
|
-
fs$
|
|
373234
|
+
fs$5.fsyncSync(this.fd);
|
|
373235
373235
|
} catch {}
|
|
373236
373236
|
}
|
|
373237
373237
|
function flushBufferSync() {
|
|
@@ -373245,7 +373245,7 @@ var require_sonic_boom = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
373245
373245
|
while (this._bufs.length || buf.length) {
|
|
373246
373246
|
if (buf.length <= 0) buf = mergeBuf(this._bufs[0], this._lens[0]);
|
|
373247
373247
|
try {
|
|
373248
|
-
const n = fs$
|
|
373248
|
+
const n = fs$5.writeSync(this.fd, buf);
|
|
373249
373249
|
buf = buf.subarray(n);
|
|
373250
373250
|
this._len = Math.max(this._len - n, 0);
|
|
373251
373251
|
if (buf.length <= 0) {
|
|
@@ -373267,24 +373267,24 @@ var require_sonic_boom = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
373267
373267
|
this._writing = true;
|
|
373268
373268
|
this._writingBuf = this._writingBuf.length ? this._writingBuf : this._bufs.shift() || "";
|
|
373269
373269
|
if (this.sync) try {
|
|
373270
|
-
release(null, Buffer.isBuffer(this._writingBuf) ? fs$
|
|
373270
|
+
release(null, Buffer.isBuffer(this._writingBuf) ? fs$5.writeSync(this.fd, this._writingBuf) : fs$5.writeSync(this.fd, this._writingBuf, "utf8"));
|
|
373271
373271
|
} catch (err) {
|
|
373272
373272
|
release(err);
|
|
373273
373273
|
}
|
|
373274
|
-
else fs$
|
|
373274
|
+
else fs$5.write(this.fd, this._writingBuf, release);
|
|
373275
373275
|
}
|
|
373276
373276
|
function actualWriteBuffer() {
|
|
373277
373277
|
const release = this.release;
|
|
373278
373278
|
this._writing = true;
|
|
373279
373279
|
this._writingBuf = this._writingBuf.length ? this._writingBuf : mergeBuf(this._bufs.shift(), this._lens.shift());
|
|
373280
373280
|
if (this.sync) try {
|
|
373281
|
-
release(null, fs$
|
|
373281
|
+
release(null, fs$5.writeSync(this.fd, this._writingBuf));
|
|
373282
373282
|
} catch (err) {
|
|
373283
373283
|
release(err);
|
|
373284
373284
|
}
|
|
373285
373285
|
else {
|
|
373286
373286
|
if (kCopyBuffer) this._writingBuf = Buffer.from(this._writingBuf);
|
|
373287
|
-
fs$
|
|
373287
|
+
fs$5.write(this.fd, this._writingBuf, release);
|
|
373288
373288
|
}
|
|
373289
373289
|
}
|
|
373290
373290
|
function actualClose(sonic) {
|
|
@@ -373298,10 +373298,10 @@ var require_sonic_boom = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
373298
373298
|
sonic._lens = [];
|
|
373299
373299
|
assert$8(typeof sonic.fd === "number", `sonic.fd must be a number, got ${typeof sonic.fd}`);
|
|
373300
373300
|
try {
|
|
373301
|
-
fs$
|
|
373301
|
+
fs$5.fsync(sonic.fd, closeWrapped);
|
|
373302
373302
|
} catch {}
|
|
373303
373303
|
function closeWrapped() {
|
|
373304
|
-
if (sonic.fd !== 1 && sonic.fd !== 2) fs$
|
|
373304
|
+
if (sonic.fd !== 1 && sonic.fd !== 2) fs$5.close(sonic.fd, done);
|
|
373305
373305
|
else done();
|
|
373306
373306
|
}
|
|
373307
373307
|
function done(err) {
|
|
@@ -395924,8 +395924,8 @@ var require_constants$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
395924
395924
|
//#endregion
|
|
395925
395925
|
//#region ../../../../../node_modules/node-gyp-build/node-gyp-build.js
|
|
395926
395926
|
var require_node_gyp_build$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
395927
|
-
var fs$
|
|
395928
|
-
var path$
|
|
395927
|
+
var fs$4 = __require("fs");
|
|
395928
|
+
var path$6 = __require("path");
|
|
395929
395929
|
var os$4 = __require("os");
|
|
395930
395930
|
var runtimeRequire = typeof __webpack_require__ === "function" ? __non_webpack_require__ : __require;
|
|
395931
395931
|
var vars = process.config && process.config.variables || {};
|
|
@@ -395942,20 +395942,20 @@ var require_node_gyp_build$1 = /* @__PURE__ */ __commonJSMin(((exports, module)
|
|
|
395942
395942
|
return runtimeRequire(load.resolve(dir));
|
|
395943
395943
|
}
|
|
395944
395944
|
load.resolve = load.path = function(dir) {
|
|
395945
|
-
dir = path$
|
|
395945
|
+
dir = path$6.resolve(dir || ".");
|
|
395946
395946
|
try {
|
|
395947
|
-
var name = runtimeRequire(path$
|
|
395947
|
+
var name = runtimeRequire(path$6.join(dir, "package.json")).name.toUpperCase().replace(/-/g, "_");
|
|
395948
395948
|
if (process.env[name + "_PREBUILD"]) dir = process.env[name + "_PREBUILD"];
|
|
395949
395949
|
} catch (err) {}
|
|
395950
395950
|
if (!prebuildsOnly) {
|
|
395951
|
-
var release = getFirst(path$
|
|
395951
|
+
var release = getFirst(path$6.join(dir, "build/Release"), matchBuild);
|
|
395952
395952
|
if (release) return release;
|
|
395953
|
-
var debug = getFirst(path$
|
|
395953
|
+
var debug = getFirst(path$6.join(dir, "build/Debug"), matchBuild);
|
|
395954
395954
|
if (debug) return debug;
|
|
395955
395955
|
}
|
|
395956
395956
|
var prebuild = resolve(dir);
|
|
395957
395957
|
if (prebuild) return prebuild;
|
|
395958
|
-
var nearby = resolve(path$
|
|
395958
|
+
var nearby = resolve(path$6.dirname(process.execPath));
|
|
395959
395959
|
if (nearby) return nearby;
|
|
395960
395960
|
var target = [
|
|
395961
395961
|
"platform=" + platform,
|
|
@@ -395971,23 +395971,23 @@ var require_node_gyp_build$1 = /* @__PURE__ */ __commonJSMin(((exports, module)
|
|
|
395971
395971
|
].filter(Boolean).join(" ");
|
|
395972
395972
|
throw new Error("No native build was found for " + target + "\n loaded from: " + dir + "\n");
|
|
395973
395973
|
function resolve(dir) {
|
|
395974
|
-
var tuple = readdirSync(path$
|
|
395974
|
+
var tuple = readdirSync(path$6.join(dir, "prebuilds")).map(parseTuple).filter(matchTuple(platform, arch)).sort(compareTuples)[0];
|
|
395975
395975
|
if (!tuple) return;
|
|
395976
|
-
var prebuilds = path$
|
|
395976
|
+
var prebuilds = path$6.join(dir, "prebuilds", tuple.name);
|
|
395977
395977
|
var winner = readdirSync(prebuilds).map(parseTags).filter(matchTags(runtime, abi)).sort(compareTags(runtime))[0];
|
|
395978
|
-
if (winner) return path$
|
|
395978
|
+
if (winner) return path$6.join(prebuilds, winner.file);
|
|
395979
395979
|
}
|
|
395980
395980
|
};
|
|
395981
395981
|
function readdirSync(dir) {
|
|
395982
395982
|
try {
|
|
395983
|
-
return fs$
|
|
395983
|
+
return fs$4.readdirSync(dir);
|
|
395984
395984
|
} catch (err) {
|
|
395985
395985
|
return [];
|
|
395986
395986
|
}
|
|
395987
395987
|
}
|
|
395988
395988
|
function getFirst(dir, filter) {
|
|
395989
395989
|
var files = readdirSync(dir).filter(filter);
|
|
395990
|
-
return files[0] && path$
|
|
395990
|
+
return files[0] && path$6.join(dir, files[0]);
|
|
395991
395991
|
}
|
|
395992
395992
|
function matchBuild(name) {
|
|
395993
395993
|
return /\.node$/.test(name);
|
|
@@ -396068,7 +396068,7 @@ var require_node_gyp_build$1 = /* @__PURE__ */ __commonJSMin(((exports, module)
|
|
|
396068
396068
|
return typeof window !== "undefined" && window.process && window.process.type === "renderer";
|
|
396069
396069
|
}
|
|
396070
396070
|
function isAlpine(platform) {
|
|
396071
|
-
return platform === "linux" && fs$
|
|
396071
|
+
return platform === "linux" && fs$4.existsSync("/etc/alpine-release");
|
|
396072
396072
|
}
|
|
396073
396073
|
load.parseTags = parseTags;
|
|
396074
396074
|
load.matchTags = matchTags;
|
|
@@ -403184,7 +403184,7 @@ var import_multipart = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((
|
|
|
403184
403184
|
const fp = require_plugin();
|
|
403185
403185
|
const { createWriteStream: createWriteStream$1 } = __require("node:fs");
|
|
403186
403186
|
const { unlink: unlink$1 } = __require("node:fs/promises");
|
|
403187
|
-
const path$
|
|
403187
|
+
const path$5 = __require("node:path");
|
|
403188
403188
|
const { generateId } = require_generateId();
|
|
403189
403189
|
const createError = require_error$1();
|
|
403190
403190
|
const streamToNull = require_stream_consumer();
|
|
@@ -403479,7 +403479,7 @@ var import_multipart = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((
|
|
|
403479
403479
|
for await (const part of parts) {
|
|
403480
403480
|
values = part.fields;
|
|
403481
403481
|
if (!part.file) continue;
|
|
403482
|
-
const filepath = path$
|
|
403482
|
+
const filepath = path$5.join(tmpdir, generateId() + path$5.extname(part.filename || "file" + i++));
|
|
403483
403483
|
const target = createWriteStream$1(filepath);
|
|
403484
403484
|
try {
|
|
403485
403485
|
this.tmpUploads.push(filepath);
|
|
@@ -416220,8 +416220,8 @@ var require_dist$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
416220
416220
|
//#endregion
|
|
416221
416221
|
//#region ../../node_modules/.pnpm/@fastify+swagger@9.7.0/node_modules/@fastify/swagger/lib/mode/static.js
|
|
416222
416222
|
var require_static = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
416223
|
-
const path$
|
|
416224
|
-
const fs$
|
|
416223
|
+
const path$4 = __require("node:path");
|
|
416224
|
+
const fs$3 = __require("node:fs");
|
|
416225
416225
|
const yaml = require_dist$1();
|
|
416226
416226
|
module.exports = function(fastify, opts, done) {
|
|
416227
416227
|
if (!opts.specification) return done(/* @__PURE__ */ new Error("specification is missing in the module options"));
|
|
@@ -416230,14 +416230,14 @@ var require_static = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
416230
416230
|
if (!opts.specification.path && !opts.specification.document) return done(/* @__PURE__ */ new Error("both specification.path and specification.document are missing, should be path to the file or swagger document spec"));
|
|
416231
416231
|
else if (opts.specification.path) {
|
|
416232
416232
|
if (typeof opts.specification.path !== "string") return done(/* @__PURE__ */ new Error("specification.path is not a string"));
|
|
416233
|
-
if (!fs$
|
|
416234
|
-
const extName = path$
|
|
416233
|
+
if (!fs$3.existsSync(path$4.resolve(opts.specification.path))) return done(/* @__PURE__ */ new Error(`${opts.specification.path} does not exist`));
|
|
416234
|
+
const extName = path$4.extname(opts.specification.path).toLowerCase();
|
|
416235
416235
|
if ([".yaml", ".json"].indexOf(extName) === -1) return done(/* @__PURE__ */ new Error("specification.path extension name is not supported, should be one from ['.yaml', '.json']"));
|
|
416236
416236
|
if (opts.specification.postProcessor && typeof opts.specification.postProcessor !== "function") return done(/* @__PURE__ */ new Error("specification.postProcessor should be a function"));
|
|
416237
416237
|
if (opts.specification.baseDir && typeof opts.specification.baseDir !== "string") return done(/* @__PURE__ */ new Error("specification.baseDir should be string"));
|
|
416238
|
-
if (!opts.specification.baseDir) opts.specification.baseDir = path$
|
|
416238
|
+
if (!opts.specification.baseDir) opts.specification.baseDir = path$4.resolve(path$4.dirname(opts.specification.path));
|
|
416239
416239
|
else while (opts.specification.baseDir.endsWith("/")) opts.specification.baseDir = opts.specification.baseDir.slice(0, -1);
|
|
416240
|
-
const source = fs$
|
|
416240
|
+
const source = fs$3.readFileSync(path$4.resolve(opts.specification.path), "utf8");
|
|
416241
416241
|
switch (extName) {
|
|
416242
416242
|
case ".yaml":
|
|
416243
416243
|
swaggerObject = yaml.parse(source);
|
|
@@ -416504,11 +416504,11 @@ var require_should_route_hide = /* @__PURE__ */ __commonJSMin(((exports, module)
|
|
|
416504
416504
|
//#endregion
|
|
416505
416505
|
//#region ../../node_modules/.pnpm/@fastify+swagger@9.7.0/node_modules/@fastify/swagger/lib/util/read-package-json.js
|
|
416506
416506
|
var require_read_package_json = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
416507
|
-
const fs$
|
|
416508
|
-
const path$
|
|
416507
|
+
const fs$2 = __require("node:fs");
|
|
416508
|
+
const path$3 = __require("node:path");
|
|
416509
416509
|
function readPackageJson() {
|
|
416510
416510
|
try {
|
|
416511
|
-
return JSON.parse(fs$
|
|
416511
|
+
return JSON.parse(fs$2.readFileSync(path$3.join(__dirname, "..", "..", "package.json")));
|
|
416512
416512
|
} catch {
|
|
416513
416513
|
return {};
|
|
416514
416514
|
}
|
|
@@ -432499,9 +432499,9 @@ var TUI = class TUI extends Container {
|
|
|
432499
432499
|
const debugRedraw = process.env["PI_DEBUG_REDRAW"] === "1";
|
|
432500
432500
|
const logRedraw = (reason) => {
|
|
432501
432501
|
if (!debugRedraw) return;
|
|
432502
|
-
const logPath = path$
|
|
432502
|
+
const logPath = path$18.join(nodeOs.homedir(), ".pi", "agent", "pi-debug.log");
|
|
432503
432503
|
const msg = `[${(/* @__PURE__ */ new Date()).toISOString()}] fullRender: ${reason} (prev=${this.previousLines.length}, new=${newLines.length}, height=${height})\n`;
|
|
432504
|
-
fs$
|
|
432504
|
+
fs$18.appendFileSync(logPath, msg);
|
|
432505
432505
|
};
|
|
432506
432506
|
if (this.previousLines.length === 0 && !widthChanged && !heightChanged) {
|
|
432507
432507
|
logRedraw("first render");
|
|
@@ -432648,8 +432648,8 @@ var TUI = class TUI extends Container {
|
|
|
432648
432648
|
buffer += "\x1B[?2026l";
|
|
432649
432649
|
if (process.env["PI_TUI_DEBUG"] === "1") {
|
|
432650
432650
|
const debugDir = "/tmp/tui";
|
|
432651
|
-
fs$
|
|
432652
|
-
const debugPath = path$
|
|
432651
|
+
fs$18.mkdirSync(debugDir, { recursive: true });
|
|
432652
|
+
const debugPath = path$18.join(debugDir, `render-${Date.now()}-${Math.random().toString(36).slice(2)}.log`);
|
|
432653
432653
|
const debugData = [
|
|
432654
432654
|
`firstChanged: ${firstChanged}`,
|
|
432655
432655
|
`viewportTop: ${viewportTop}`,
|
|
@@ -432672,7 +432672,7 @@ var TUI = class TUI extends Container {
|
|
|
432672
432672
|
"=== buffer ===",
|
|
432673
432673
|
JSON.stringify(buffer)
|
|
432674
432674
|
].join("\n");
|
|
432675
|
-
fs$
|
|
432675
|
+
fs$18.writeFileSync(debugPath, debugData);
|
|
432676
432676
|
}
|
|
432677
432677
|
this.terminal.write(buffer);
|
|
432678
432678
|
this.cursorRow = Math.max(0, newLines.length - 1);
|
|
@@ -437258,12 +437258,12 @@ function loadNativeModifiersHelper() {
|
|
|
437258
437258
|
if (process.platform !== "darwin") return void 0;
|
|
437259
437259
|
const arch = process.arch;
|
|
437260
437260
|
if (arch !== "x64" && arch !== "arm64") return void 0;
|
|
437261
|
-
const moduleDir = path$
|
|
437262
|
-
const nativePath = path$
|
|
437261
|
+
const moduleDir = path$18.dirname(fileURLToPath(import.meta.url));
|
|
437262
|
+
const nativePath = path$18.join("native", "darwin", "prebuilds", `darwin-${arch}`, "darwin-modifiers.node");
|
|
437263
437263
|
const candidates = [
|
|
437264
|
-
path$
|
|
437265
|
-
path$
|
|
437266
|
-
path$
|
|
437264
|
+
path$18.join(moduleDir, "..", nativePath),
|
|
437265
|
+
path$18.join(moduleDir, nativePath),
|
|
437266
|
+
path$18.join(path$18.dirname(process.execPath), nativePath)
|
|
437267
437267
|
];
|
|
437268
437268
|
for (const modulePath of candidates) try {
|
|
437269
437269
|
const helper = cjsRequire$1(modulePath);
|
|
@@ -437336,10 +437336,10 @@ var ProcessTerminal = class {
|
|
|
437336
437336
|
const env = process.env["PI_TUI_WRITE_LOG"] || "";
|
|
437337
437337
|
if (!env) return "";
|
|
437338
437338
|
try {
|
|
437339
|
-
if (fs$
|
|
437339
|
+
if (fs$18.statSync(env).isDirectory()) {
|
|
437340
437340
|
const now = /* @__PURE__ */ new Date();
|
|
437341
437341
|
const ts = `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, "0")}-${String(now.getDate()).padStart(2, "0")}_${String(now.getHours()).padStart(2, "0")}-${String(now.getMinutes()).padStart(2, "0")}-${String(now.getSeconds()).padStart(2, "0")}`;
|
|
437342
|
-
return path$
|
|
437342
|
+
return path$18.join(env, `tui-${ts}-${process.pid}.log`);
|
|
437343
437343
|
}
|
|
437344
437344
|
} catch {}
|
|
437345
437345
|
return env;
|
|
@@ -437542,12 +437542,12 @@ var ProcessTerminal = class {
|
|
|
437542
437542
|
try {
|
|
437543
437543
|
const arch = process.arch;
|
|
437544
437544
|
if (arch !== "x64" && arch !== "arm64") return;
|
|
437545
|
-
const moduleDir = path$
|
|
437546
|
-
const nativePath = path$
|
|
437545
|
+
const moduleDir = path$18.dirname(fileURLToPath(import.meta.url));
|
|
437546
|
+
const nativePath = path$18.join("native", "win32", "prebuilds", `win32-${arch}`, "win32-console-mode.node");
|
|
437547
437547
|
const candidates = [
|
|
437548
|
-
path$
|
|
437549
|
-
path$
|
|
437550
|
-
path$
|
|
437548
|
+
path$18.join(moduleDir, "..", nativePath),
|
|
437549
|
+
path$18.join(moduleDir, nativePath),
|
|
437550
|
+
path$18.join(path$18.dirname(process.execPath), nativePath)
|
|
437551
437551
|
];
|
|
437552
437552
|
for (const modulePath of candidates) try {
|
|
437553
437553
|
cjsRequire(modulePath).enableVirtualTerminalInput?.();
|
|
@@ -437619,7 +437619,7 @@ var ProcessTerminal = class {
|
|
|
437619
437619
|
write(data) {
|
|
437620
437620
|
process.stdout.write(data);
|
|
437621
437621
|
if (this.writeLogPath) try {
|
|
437622
|
-
fs$
|
|
437622
|
+
fs$18.appendFileSync(this.writeLogPath, data, { encoding: "utf8" });
|
|
437623
437623
|
} catch {}
|
|
437624
437624
|
}
|
|
437625
437625
|
get columns() {
|
|
@@ -499461,6 +499461,7 @@ var CustomEditor = class extends Editor {
|
|
|
499461
499461
|
onToggleToolExpand;
|
|
499462
499462
|
onOpenExternalEditor;
|
|
499463
499463
|
onOpenSessionPicker;
|
|
499464
|
+
onOpenEffortPicker;
|
|
499464
499465
|
onCtrlS;
|
|
499465
499466
|
/** Return `true` to consume Ctrl+B; return `false`/`undefined` to fall through to the editor default (cursor-left). */
|
|
499466
499467
|
onCtrlB;
|
|
@@ -499649,6 +499650,10 @@ var CustomEditor = class extends Editor {
|
|
|
499649
499650
|
this.onOpenSessionPicker?.();
|
|
499650
499651
|
return;
|
|
499651
499652
|
}
|
|
499653
|
+
if (matchesKey(normalized, Key.ctrl("l"))) {
|
|
499654
|
+
this.onOpenEffortPicker?.();
|
|
499655
|
+
return;
|
|
499656
|
+
}
|
|
499652
499657
|
if (matchesKey(normalized, Key.ctrl("g"))) {
|
|
499653
499658
|
this.onOpenExternalEditor?.();
|
|
499654
499659
|
return;
|
|
@@ -531444,6 +531449,10 @@ var EditorKeyboardController = class {
|
|
|
531444
531449
|
this.clearPendingExit();
|
|
531445
531450
|
host.openSessionPickerShortcut();
|
|
531446
531451
|
};
|
|
531452
|
+
editor.onOpenEffortPicker = () => {
|
|
531453
|
+
this.clearPendingExit();
|
|
531454
|
+
host.openEffortPickerShortcut();
|
|
531455
|
+
};
|
|
531447
531456
|
editor.onOpenExternalEditor = () => {
|
|
531448
531457
|
host.track("shortcut_editor");
|
|
531449
531458
|
this.openExternalEditor();
|
|
@@ -545278,6 +545287,15 @@ var BlunTUI = class {
|
|
|
545278
545287
|
if (this.state.queuedMessages.some((item) => item.mode === "command" && item.text === "/sessions" && item.agentId === this.harness.interactiveAgentId && item.channelCommandEnvelope === void 0)) return;
|
|
545279
545288
|
this.runSlashCommand("/sessions");
|
|
545280
545289
|
}
|
|
545290
|
+
openEffortPickerShortcut() {
|
|
545291
|
+
if (this.editorReplacementActive || this.queueCommandRunning) return;
|
|
545292
|
+
if (this.state.appState.isReplaying) {
|
|
545293
|
+
this.showError(uiText("blunTui.input.replayBlocked"));
|
|
545294
|
+
return;
|
|
545295
|
+
}
|
|
545296
|
+
if (this.state.queuedMessages.some((item) => item.mode === "command" && item.text === "/effort" && item.agentId === this.harness.interactiveAgentId && item.channelCommandEnvelope === void 0)) return;
|
|
545297
|
+
this.runSlashCommand("/effort");
|
|
545298
|
+
}
|
|
545281
545299
|
async showSessionPicker(target) {
|
|
545282
545300
|
await this.openSessionPicker({
|
|
545283
545301
|
target,
|
|
@@ -545491,13 +545509,13 @@ var BlunTUI = class {
|
|
|
545491
545509
|
//#endregion
|
|
545492
545510
|
//#region src/constant/update.ts
|
|
545493
545511
|
var import_runtime_exit_ledger = (/* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
545494
|
-
const fs = __require("node:fs");
|
|
545512
|
+
const fs$1 = __require("node:fs");
|
|
545495
545513
|
const os$1 = __require("node:os");
|
|
545496
|
-
const path$
|
|
545514
|
+
const path$2 = __require("node:path");
|
|
545497
545515
|
const DEFAULT_MAX_BYTES = 1024 * 1024;
|
|
545498
545516
|
const DEFAULT_RETAIN_BYTES = 512 * 1024;
|
|
545499
545517
|
function runtimeExitLedgerPath(homeDir) {
|
|
545500
|
-
return path$
|
|
545518
|
+
return path$2.join(homeDir, "diagnostics", "runtime-exits.jsonl");
|
|
545501
545519
|
}
|
|
545502
545520
|
function sanitizeExitText(input, maxChars = 2048) {
|
|
545503
545521
|
let value = String(input ?? "");
|
|
@@ -545506,7 +545524,7 @@ var import_runtime_exit_ledger = (/* @__PURE__ */ __commonJSMin(((exports, modul
|
|
|
545506
545524
|
process.env.USERPROFILE,
|
|
545507
545525
|
process.env.HOME
|
|
545508
545526
|
].filter((entry) => typeof entry === "string" && entry.length > 2));
|
|
545509
|
-
for (const home of homes) for (const variant of [path$
|
|
545527
|
+
for (const home of homes) for (const variant of [path$2.normalize(home), home.replaceAll("\\", "/")]) {
|
|
545510
545528
|
const escaped = variant.replace(/[.*+?^${}()|[\]\\]/gu, "\\$&");
|
|
545511
545529
|
value = value.replace(new RegExp(escaped, process.platform === "win32" ? "giu" : "gu"), "$HOME");
|
|
545512
545530
|
}
|
|
@@ -545545,7 +545563,7 @@ var import_runtime_exit_ledger = (/* @__PURE__ */ __commonJSMin(((exports, modul
|
|
|
545545
545563
|
return record;
|
|
545546
545564
|
}
|
|
545547
545565
|
function directoryIdentity(directory) {
|
|
545548
|
-
const stat = fs.lstatSync(directory, { bigint: true });
|
|
545566
|
+
const stat = fs$1.lstatSync(directory, { bigint: true });
|
|
545549
545567
|
if (!stat.isDirectory() || stat.isSymbolicLink()) throw new Error("Unsafe exit directory");
|
|
545550
545568
|
return stat;
|
|
545551
545569
|
}
|
|
@@ -545557,46 +545575,46 @@ var import_runtime_exit_ledger = (/* @__PURE__ */ __commonJSMin(((exports, modul
|
|
|
545557
545575
|
return stat;
|
|
545558
545576
|
}
|
|
545559
545577
|
function trimLedger(descriptor, maxBytes, retainBytes, incomingBytes) {
|
|
545560
|
-
const size = Number(regularLedger(fs.fstatSync(descriptor, { bigint: true })).size);
|
|
545578
|
+
const size = Number(regularLedger(fs$1.fstatSync(descriptor, { bigint: true })).size);
|
|
545561
545579
|
if (!Number.isSafeInteger(size)) throw new Error("Invalid exit ledger size");
|
|
545562
545580
|
if (size + incomingBytes <= maxBytes) return;
|
|
545563
545581
|
const keepBytes = Math.max(0, Math.min(size, retainBytes, maxBytes - incomingBytes));
|
|
545564
545582
|
const contents = Buffer.alloc(keepBytes);
|
|
545565
|
-
const read = fs.readSync(descriptor, contents, 0, keepBytes, size - keepBytes);
|
|
545583
|
+
const read = fs$1.readSync(descriptor, contents, 0, keepBytes, size - keepBytes);
|
|
545566
545584
|
const tail = contents.subarray(0, read);
|
|
545567
545585
|
const lineStart = size > keepBytes ? tail.indexOf(10) + 1 : 0;
|
|
545568
|
-
fs.ftruncateSync(descriptor, 0);
|
|
545569
|
-
fs.writeFileSync(descriptor, lineStart > 0 || size === keepBytes ? tail.subarray(lineStart) : "");
|
|
545586
|
+
fs$1.ftruncateSync(descriptor, 0);
|
|
545587
|
+
fs$1.writeFileSync(descriptor, lineStart > 0 || size === keepBytes ? tail.subarray(lineStart) : "");
|
|
545570
545588
|
}
|
|
545571
545589
|
function recordRuntimeExit(input = {}) {
|
|
545572
545590
|
let descriptor;
|
|
545573
545591
|
let appendDescriptor;
|
|
545574
545592
|
try {
|
|
545575
545593
|
const homeDir = typeof input.homeDir === "string" ? input.homeDir.trim() : "";
|
|
545576
|
-
if (!homeDir || !path$
|
|
545577
|
-
fs.mkdirSync(homeDir, {
|
|
545594
|
+
if (!homeDir || !path$2.isAbsolute(homeDir)) return false;
|
|
545595
|
+
fs$1.mkdirSync(homeDir, {
|
|
545578
545596
|
recursive: true,
|
|
545579
545597
|
mode: 448
|
|
545580
545598
|
});
|
|
545581
545599
|
const homeIdentity = directoryIdentity(homeDir);
|
|
545582
545600
|
const file = runtimeExitLedgerPath(homeDir);
|
|
545583
|
-
const directory = path$
|
|
545601
|
+
const directory = path$2.dirname(file);
|
|
545584
545602
|
try {
|
|
545585
|
-
fs.mkdirSync(directory, { mode: 448 });
|
|
545603
|
+
fs$1.mkdirSync(directory, { mode: 448 });
|
|
545586
545604
|
} catch (error) {
|
|
545587
545605
|
if (error.code !== "EEXIST") throw error;
|
|
545588
545606
|
}
|
|
545589
545607
|
const directoryStat = directoryIdentity(directory);
|
|
545590
545608
|
let before;
|
|
545591
545609
|
try {
|
|
545592
|
-
before = regularLedger(fs.lstatSync(file, { bigint: true }));
|
|
545610
|
+
before = regularLedger(fs$1.lstatSync(file, { bigint: true }));
|
|
545593
545611
|
} catch (error) {
|
|
545594
545612
|
if (error.code !== "ENOENT") throw error;
|
|
545595
545613
|
}
|
|
545596
|
-
const flags = fs.constants.O_RDWR | (fs.constants.O_NOFOLLOW ?? 0) | (fs.constants.O_NONBLOCK ?? 0) | (before ? 0 : fs.constants.O_CREAT | fs.constants.O_EXCL);
|
|
545597
|
-
descriptor = fs.openSync(file, flags, 384);
|
|
545598
|
-
const opened = regularLedger(fs.fstatSync(descriptor, { bigint: true }));
|
|
545599
|
-
if (before && !sameIdentity(before, opened) || !sameIdentity(opened, regularLedger(fs.lstatSync(file, { bigint: true }))) || !sameIdentity(homeIdentity, directoryIdentity(homeDir)) || !sameIdentity(directoryStat, directoryIdentity(directory))) throw new Error("Exit ledger changed");
|
|
545614
|
+
const flags = fs$1.constants.O_RDWR | (fs$1.constants.O_NOFOLLOW ?? 0) | (fs$1.constants.O_NONBLOCK ?? 0) | (before ? 0 : fs$1.constants.O_CREAT | fs$1.constants.O_EXCL);
|
|
545615
|
+
descriptor = fs$1.openSync(file, flags, 384);
|
|
545616
|
+
const opened = regularLedger(fs$1.fstatSync(descriptor, { bigint: true }));
|
|
545617
|
+
if (before && !sameIdentity(before, opened) || !sameIdentity(opened, regularLedger(fs$1.lstatSync(file, { bigint: true }))) || !sameIdentity(homeIdentity, directoryIdentity(homeDir)) || !sameIdentity(directoryStat, directoryIdentity(directory))) throw new Error("Exit ledger changed");
|
|
545600
545618
|
const maxBytes = Math.max(1024, Number.isInteger(input.maxBytes) ? input.maxBytes : DEFAULT_MAX_BYTES);
|
|
545601
545619
|
const retainBytes = Math.max(0, Number.isInteger(input.retainBytes) ? input.retainBytes : DEFAULT_RETAIN_BYTES);
|
|
545602
545620
|
const record = buildRuntimeExitRecord(input);
|
|
@@ -545619,21 +545637,21 @@ var import_runtime_exit_ledger = (/* @__PURE__ */ __commonJSMin(((exports, modul
|
|
|
545619
545637
|
line = `${JSON.stringify(record)}\n`;
|
|
545620
545638
|
}
|
|
545621
545639
|
trimLedger(descriptor, maxBytes, retainBytes, Buffer.byteLength(line));
|
|
545622
|
-
appendDescriptor = fs.openSync(file, fs.constants.O_WRONLY | fs.constants.O_APPEND | (fs.constants.O_NOFOLLOW ?? 0) | (fs.constants.O_NONBLOCK ?? 0));
|
|
545623
|
-
if (!sameIdentity(opened, regularLedger(fs.fstatSync(appendDescriptor, { bigint: true }))) || !sameIdentity(opened, regularLedger(fs.lstatSync(file, { bigint: true }))) || !sameIdentity(homeIdentity, directoryIdentity(homeDir)) || !sameIdentity(directoryStat, directoryIdentity(directory))) throw new Error("Exit ledger changed");
|
|
545624
|
-
fs.appendFileSync(appendDescriptor, line, { encoding: "utf8" });
|
|
545640
|
+
appendDescriptor = fs$1.openSync(file, fs$1.constants.O_WRONLY | fs$1.constants.O_APPEND | (fs$1.constants.O_NOFOLLOW ?? 0) | (fs$1.constants.O_NONBLOCK ?? 0));
|
|
545641
|
+
if (!sameIdentity(opened, regularLedger(fs$1.fstatSync(appendDescriptor, { bigint: true }))) || !sameIdentity(opened, regularLedger(fs$1.lstatSync(file, { bigint: true }))) || !sameIdentity(homeIdentity, directoryIdentity(homeDir)) || !sameIdentity(directoryStat, directoryIdentity(directory))) throw new Error("Exit ledger changed");
|
|
545642
|
+
fs$1.appendFileSync(appendDescriptor, line, { encoding: "utf8" });
|
|
545625
545643
|
try {
|
|
545626
|
-
fs.fchmodSync(descriptor, 384);
|
|
545644
|
+
fs$1.fchmodSync(descriptor, 384);
|
|
545627
545645
|
} catch {}
|
|
545628
545646
|
return true;
|
|
545629
545647
|
} catch {
|
|
545630
545648
|
return false;
|
|
545631
545649
|
} finally {
|
|
545632
545650
|
if (appendDescriptor !== void 0) try {
|
|
545633
|
-
fs.closeSync(appendDescriptor);
|
|
545651
|
+
fs$1.closeSync(appendDescriptor);
|
|
545634
545652
|
} catch {}
|
|
545635
545653
|
if (descriptor !== void 0) try {
|
|
545636
|
-
fs.closeSync(descriptor);
|
|
545654
|
+
fs$1.closeSync(descriptor);
|
|
545637
545655
|
} catch {}
|
|
545638
545656
|
}
|
|
545639
545657
|
}
|