blun-king-cli 9.1.607 → 9.1.608

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/blun.mjs CHANGED
@@ -1,23 +1,23 @@
1
1
  #!/usr/bin/env node
2
- // BLUN_BUILD_INPUT_SHA256:9c2732198b7a858bcd8b66604ad503ed8e359fcaa2b196011f9954a3caa53dba
2
+ // BLUN_BUILD_INPUT_SHA256:47510c4534e220288a7d413e8081ba7b69d9557c15c1b1e47eb83e2417b79e59
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$18 from "node:fs";
9
+ import * as fs$17 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$18 from "node:path";
11
+ import * as path$17 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 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";
14
+ import ro, { 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 path$1, { basename as basename$1, dirname as dirname$1, join as join$1, parse as parse$1 } from "path";
20
+ import js, { 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$18.existsSync(input)) throw new ChatProviderError(`Video file not found: ${input}`);
2240
- const filename = path$18.basename(input);
2239
+ if (!fs$17.existsSync(input)) throw new ChatProviderError(`Video file not found: ${input}`);
2240
+ const filename = path$17.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$18.promises.readFile(input);
2243
+ const data = await fs$17.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}`);
@@ -10449,7 +10449,18 @@ async function readOwner(lockDirectory) {
10449
10449
  const marker = join(lockDirectory, name);
10450
10450
  const stats = await lstat(marker);
10451
10451
  if (!stats.isFile() || stats.isSymbolicLink() || stats.size > 2048) throw unavailable();
10452
- const record = JSON.parse(await readFile(marker, "utf8"));
10452
+ let content;
10453
+ try {
10454
+ content = await readFile(marker, "utf8");
10455
+ } catch (error) {
10456
+ if (process.platform === "win32" && codeOf(error) === "EPERM") try {
10457
+ await lstat(marker);
10458
+ } catch (inspectionError) {
10459
+ if (codeOf(inspectionError) === "ENOENT") throw inspectionError;
10460
+ }
10461
+ throw error;
10462
+ }
10463
+ const record = JSON.parse(content);
10453
10464
  if (record === null || record.version !== 1 || record.ownerId !== match[1] || !Number.isSafeInteger(record.pid) || record.pid <= 0 || record.hostname !== hostname()) throw unavailable();
10454
10465
  return {
10455
10466
  name,
@@ -10641,6 +10652,22 @@ function isRecord$26(value) {
10641
10652
  var init_utils$1 = __esmMin((() => {}));
10642
10653
  //#endregion
10643
10654
  //#region ../../packages/oauth/src/windows-command-worker.ts
10655
+ function prepareWindowsCommand(executable, args, platform = process.platform) {
10656
+ const target = args[0];
10657
+ if (platform !== "win32" || win32.basename(executable).toLowerCase() !== "icacls.exe" || !target || !win32.isAbsolute(target) || !win32.basename(target)) return { args };
10658
+ const save = args.length === 4 && args[1] === "/save" && args[3] === "/Q" && !!args[2] && win32.isAbsolute(args[2]);
10659
+ const repair = [
10660
+ "/inheritance:r",
10661
+ "/grant:r",
10662
+ "/remove",
10663
+ "/remove:d"
10664
+ ].includes(args[1] ?? "") && args.at(-1) === "/Q";
10665
+ if (!save && !repair) return { args };
10666
+ return {
10667
+ args: [win32.basename(target), ...args.slice(1)],
10668
+ cwd: win32.dirname(target)
10669
+ };
10670
+ }
10644
10671
  function retireWhenIdle(state) {
10645
10672
  if (state.pending.size !== 0) return;
10646
10673
  state.worker.unref();
@@ -10694,7 +10721,7 @@ function runWindowsCommand(executable, args) {
10694
10721
  state.worker.postMessage({
10695
10722
  id,
10696
10723
  executable,
10697
- args: [...args]
10724
+ ...prepareWindowsCommand(executable, [...args])
10698
10725
  });
10699
10726
  } catch (error) {
10700
10727
  state.pending.delete(id);
@@ -10708,10 +10735,10 @@ var init_windows_command_worker = __esmMin((() => {
10708
10735
  SOURCE = `
10709
10736
  const { parentPort } = require('node:worker_threads');
10710
10737
  const { execFileSync } = require('node:child_process');
10711
- parentPort.on('message', ({ id, executable, args }) => {
10738
+ parentPort.on('message', ({ id, executable, args, cwd }) => {
10712
10739
  try {
10713
10740
  const stdout = execFileSync(executable, args, {
10714
- encoding: 'utf8', shell: false, windowsHide: true,
10741
+ encoding: 'utf8', shell: false, windowsHide: true, cwd,
10715
10742
  stdio: ['ignore', 'pipe', 'pipe'],
10716
10743
  });
10717
10744
  parentPort.postMessage({ id, stdout });
@@ -10950,7 +10977,7 @@ var init_windows_private_acl = __esmMin((() => {
10950
10977
  return this.userSid;
10951
10978
  }
10952
10979
  async save(target) {
10953
- const file = join(tmpdir(), `blun-private-acl-${process.pid}-${randomBytes(16).toString("hex")}.txt`);
10980
+ const file = join(tmpdir(), `${randomBytes(16).toString("hex")}.txt`);
10954
10981
  try {
10955
10982
  await this.run("icacls.exe", [
10956
10983
  target,
@@ -11081,7 +11108,7 @@ var init_windows_private_acl = __esmMin((() => {
11081
11108
  return this.userSid;
11082
11109
  }
11083
11110
  transferPath() {
11084
- return join(tmpdir(), `blun-private-acl-${process.pid}-${randomBytes(16).toString("hex")}.txt`);
11111
+ return join(tmpdir(), `${randomBytes(16).toString("hex")}.txt`);
11085
11112
  }
11086
11113
  removeTransferFile(file) {
11087
11114
  try {
@@ -11870,7 +11897,7 @@ var require_clone$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
11870
11897
  //#endregion
11871
11898
  //#region ../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/graceful-fs.js
11872
11899
  var require_graceful_fs = /* @__PURE__ */ __commonJSMin(((exports, module) => {
11873
- var fs$17 = __require("fs");
11900
+ var fs$16 = __require("fs");
11874
11901
  var polyfills = require_polyfills();
11875
11902
  var legacy = require_legacy_streams();
11876
11903
  var clone = require_clone$1();
@@ -11899,36 +11926,36 @@ var require_graceful_fs = /* @__PURE__ */ __commonJSMin(((exports, module) => {
11899
11926
  m = "GFS4: " + m.split(/\n/).join("\nGFS4: ");
11900
11927
  console.error(m);
11901
11928
  };
11902
- if (!fs$17[gracefulQueue]) {
11903
- publishQueue(fs$17, global[gracefulQueue] || []);
11904
- fs$17.close = (function(fs$close) {
11929
+ if (!fs$16[gracefulQueue]) {
11930
+ publishQueue(fs$16, global[gracefulQueue] || []);
11931
+ fs$16.close = (function(fs$close) {
11905
11932
  function close(fd, cb) {
11906
- return fs$close.call(fs$17, fd, function(err) {
11933
+ return fs$close.call(fs$16, fd, function(err) {
11907
11934
  if (!err) resetQueue();
11908
11935
  if (typeof cb === "function") cb.apply(this, arguments);
11909
11936
  });
11910
11937
  }
11911
11938
  Object.defineProperty(close, previousSymbol, { value: fs$close });
11912
11939
  return close;
11913
- })(fs$17.close);
11914
- fs$17.closeSync = (function(fs$closeSync) {
11940
+ })(fs$16.close);
11941
+ fs$16.closeSync = (function(fs$closeSync) {
11915
11942
  function closeSync(fd) {
11916
- fs$closeSync.apply(fs$17, arguments);
11943
+ fs$closeSync.apply(fs$16, arguments);
11917
11944
  resetQueue();
11918
11945
  }
11919
11946
  Object.defineProperty(closeSync, previousSymbol, { value: fs$closeSync });
11920
11947
  return closeSync;
11921
- })(fs$17.closeSync);
11948
+ })(fs$16.closeSync);
11922
11949
  if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) process.on("exit", function() {
11923
- debug(fs$17[gracefulQueue]);
11924
- __require("assert").equal(fs$17[gracefulQueue].length, 0);
11950
+ debug(fs$16[gracefulQueue]);
11951
+ __require("assert").equal(fs$16[gracefulQueue].length, 0);
11925
11952
  });
11926
11953
  }
11927
- if (!global[gracefulQueue]) publishQueue(global, fs$17[gracefulQueue]);
11928
- module.exports = patch(clone(fs$17));
11929
- if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs$17.__patched) {
11930
- module.exports = patch(fs$17);
11931
- fs$17.__patched = true;
11954
+ if (!global[gracefulQueue]) publishQueue(global, fs$16[gracefulQueue]);
11955
+ module.exports = patch(clone(fs$16));
11956
+ if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs$16.__patched) {
11957
+ module.exports = patch(fs$16);
11958
+ fs$16.__patched = true;
11932
11959
  }
11933
11960
  function patch(fs) {
11934
11961
  polyfills(fs);
@@ -12183,23 +12210,23 @@ var require_graceful_fs = /* @__PURE__ */ __commonJSMin(((exports, module) => {
12183
12210
  }
12184
12211
  function enqueue(elem) {
12185
12212
  debug("ENQUEUE", elem[0].name, elem[1]);
12186
- fs$17[gracefulQueue].push(elem);
12213
+ fs$16[gracefulQueue].push(elem);
12187
12214
  retry();
12188
12215
  }
12189
12216
  var retryTimer;
12190
12217
  function resetQueue() {
12191
12218
  var now = Date.now();
12192
- for (var i = 0; i < fs$17[gracefulQueue].length; ++i) if (fs$17[gracefulQueue][i].length > 2) {
12193
- fs$17[gracefulQueue][i][3] = now;
12194
- fs$17[gracefulQueue][i][4] = now;
12219
+ for (var i = 0; i < fs$16[gracefulQueue].length; ++i) if (fs$16[gracefulQueue][i].length > 2) {
12220
+ fs$16[gracefulQueue][i][3] = now;
12221
+ fs$16[gracefulQueue][i][4] = now;
12195
12222
  }
12196
12223
  retry();
12197
12224
  }
12198
12225
  function retry() {
12199
12226
  clearTimeout(retryTimer);
12200
12227
  retryTimer = void 0;
12201
- if (fs$17[gracefulQueue].length === 0) return;
12202
- var elem = fs$17[gracefulQueue].shift();
12228
+ if (fs$16[gracefulQueue].length === 0) return;
12229
+ var elem = fs$16[gracefulQueue].shift();
12203
12230
  var fn = elem[0];
12204
12231
  var args = elem[1];
12205
12232
  var err = elem[2];
@@ -12218,7 +12245,7 @@ var require_graceful_fs = /* @__PURE__ */ __commonJSMin(((exports, module) => {
12218
12245
  if (sinceAttempt >= Math.min(sinceStart * 1.2, 100)) {
12219
12246
  debug("RETRY", fn.name, args);
12220
12247
  fn.apply(null, args.concat([startTime]));
12221
- } else fs$17[gracefulQueue].push(elem);
12248
+ } else fs$16[gracefulQueue].push(elem);
12222
12249
  }
12223
12250
  if (retryTimer === void 0) retryTimer = setTimeout(retry, 0);
12224
12251
  }
@@ -12570,7 +12597,7 @@ var require_mtime_precision = /* @__PURE__ */ __commonJSMin(((exports, module) =
12570
12597
  //#endregion
12571
12598
  //#region ../../node_modules/.pnpm/proper-lockfile@4.1.2/node_modules/proper-lockfile/lib/lockfile.js
12572
12599
  var require_lockfile = /* @__PURE__ */ __commonJSMin(((exports, module) => {
12573
- const path$17 = __require("path");
12600
+ const path$16 = __require("path");
12574
12601
  const fs = require_graceful_fs();
12575
12602
  const retry = require_retry$3();
12576
12603
  const onExit = require_signal_exit();
@@ -12580,7 +12607,7 @@ var require_lockfile = /* @__PURE__ */ __commonJSMin(((exports, module) => {
12580
12607
  return options.lockfilePath || `${file}.lock`;
12581
12608
  }
12582
12609
  function resolveCanonicalPath(file, options, callback) {
12583
- if (!options.realpath) return callback(null, path$17.resolve(file));
12610
+ if (!options.realpath) return callback(null, path$16.resolve(file));
12584
12611
  options.fs.realpath(file, callback);
12585
12612
  }
12586
12613
  function acquireLock(file, options, callback) {
@@ -15062,7 +15089,7 @@ async function syncDir(dirPath) {
15062
15089
  */
15063
15090
  function syncFd(fd) {
15064
15091
  return new Promise((resolve, reject) => {
15065
- fs$18.fsync(fd, (err) => {
15092
+ fs$17.fsync(fd, (err) => {
15066
15093
  if (err) {
15067
15094
  reject(err);
15068
15095
  return;
@@ -16827,8 +16854,19 @@ async function mutateConfigFile(filePath, transform) {
16827
16854
  try {
16828
16855
  await writer.assertOwned();
16829
16856
  const { config, result } = transform(readConfigFileForUpdate(canonical));
16830
- await writer.assertOwned();
16831
- await writeConfigFile(canonical, config);
16857
+ for (let attempt = 0;; attempt += 1) {
16858
+ await writer.assertOwned();
16859
+ try {
16860
+ await writeConfigFile(canonical, config);
16861
+ break;
16862
+ } catch (error) {
16863
+ const failure = error;
16864
+ if (process.platform !== "win32" || attempt >= 9 || failure?.code !== "EPERM" || failure.syscall !== "rename" || typeof failure.dest !== "string" || resolve(failure.dest) !== canonical) throw error;
16865
+ await new Promise((resolve) => {
16866
+ setTimeout(resolve, 25);
16867
+ });
16868
+ }
16869
+ }
16832
16870
  return result;
16833
16871
  } finally {
16834
16872
  await writer.release();
@@ -26006,7 +26044,7 @@ var require_loader = /* @__PURE__ */ __commonJSMin(((exports, module) => {
26006
26044
  };
26007
26045
  return _setPrototypeOf(o, p);
26008
26046
  }
26009
- var path$16 = __require("path");
26047
+ var path$15 = __require("path");
26010
26048
  module.exports = /* @__PURE__ */ function(_EmitterObj) {
26011
26049
  _inheritsLoose(Loader, _EmitterObj);
26012
26050
  function Loader() {
@@ -26014,7 +26052,7 @@ var require_loader = /* @__PURE__ */ __commonJSMin(((exports, module) => {
26014
26052
  }
26015
26053
  var _proto = Loader.prototype;
26016
26054
  _proto.resolve = function resolve(from, to) {
26017
- return path$16.resolve(path$16.dirname(from), to);
26055
+ return path$15.resolve(path$15.dirname(from), to);
26018
26056
  };
26019
26057
  _proto.isRelative = function isRelative(filename) {
26020
26058
  return filename.indexOf("./") === 0 || filename.indexOf("../") === 0;
@@ -27670,8 +27708,8 @@ var require_node_loaders = /* @__PURE__ */ __commonJSMin(((exports, module) => {
27670
27708
  };
27671
27709
  return _setPrototypeOf(o, p);
27672
27710
  }
27673
- var fs$16 = __require("fs");
27674
- var path$15 = __require("path");
27711
+ var fs$15 = __require("fs");
27712
+ var path$14 = __require("path");
27675
27713
  var Loader = require_loader();
27676
27714
  var PrecompiledLoader = require_precompiled_loader().PrecompiledLoader;
27677
27715
  var chokidar;
@@ -27686,7 +27724,7 @@ var require_node_loaders = /* @__PURE__ */ __commonJSMin(((exports, module) => {
27686
27724
  _this.noCache = !!opts.noCache;
27687
27725
  if (searchPaths) {
27688
27726
  searchPaths = Array.isArray(searchPaths) ? searchPaths : [searchPaths];
27689
- _this.searchPaths = searchPaths.map(path$15.normalize);
27727
+ _this.searchPaths = searchPaths.map(path$14.normalize);
27690
27728
  } else _this.searchPaths = ["."];
27691
27729
  if (opts.watch) {
27692
27730
  try {
@@ -27694,10 +27732,10 @@ var require_node_loaders = /* @__PURE__ */ __commonJSMin(((exports, module) => {
27694
27732
  } catch (e) {
27695
27733
  throw new Error("watch requires chokidar to be installed");
27696
27734
  }
27697
- var paths = _this.searchPaths.filter(fs$16.existsSync);
27735
+ var paths = _this.searchPaths.filter(fs$15.existsSync);
27698
27736
  var watcher = chokidar.watch(paths);
27699
27737
  watcher.on("all", function(event, fullname) {
27700
- fullname = path$15.resolve(fullname);
27738
+ fullname = path$14.resolve(fullname);
27701
27739
  if (event === "change" && fullname in _this.pathsToNames) _this.emit("update", _this.pathsToNames[fullname], fullname);
27702
27740
  });
27703
27741
  watcher.on("error", function(error) {
@@ -27711,9 +27749,9 @@ var require_node_loaders = /* @__PURE__ */ __commonJSMin(((exports, module) => {
27711
27749
  var fullpath = null;
27712
27750
  var paths = this.searchPaths;
27713
27751
  for (var i = 0; i < paths.length; i++) {
27714
- var basePath = path$15.resolve(paths[i]);
27715
- var p = path$15.resolve(paths[i], name);
27716
- if (p.indexOf(basePath) === 0 && fs$16.existsSync(p)) {
27752
+ var basePath = path$14.resolve(paths[i]);
27753
+ var p = path$14.resolve(paths[i], name);
27754
+ if (p.indexOf(basePath) === 0 && fs$15.existsSync(p)) {
27717
27755
  fullpath = p;
27718
27756
  break;
27719
27757
  }
@@ -27721,7 +27759,7 @@ var require_node_loaders = /* @__PURE__ */ __commonJSMin(((exports, module) => {
27721
27759
  if (!fullpath) return null;
27722
27760
  this.pathsToNames[fullpath] = name;
27723
27761
  var source = {
27724
- src: fs$16.readFileSync(fullpath, "utf-8"),
27762
+ src: fs$15.readFileSync(fullpath, "utf-8"),
27725
27763
  path: fullpath,
27726
27764
  noCache: this.noCache
27727
27765
  };
@@ -27769,7 +27807,7 @@ var require_node_loaders = /* @__PURE__ */ __commonJSMin(((exports, module) => {
27769
27807
  }
27770
27808
  this.pathsToNames[fullpath] = name;
27771
27809
  var source = {
27772
- src: fs$16.readFileSync(fullpath, "utf-8"),
27810
+ src: fs$15.readFileSync(fullpath, "utf-8"),
27773
27811
  path: fullpath,
27774
27812
  noCache: this.noCache
27775
27813
  };
@@ -28071,13 +28109,13 @@ var require_globals = /* @__PURE__ */ __commonJSMin(((exports, module) => {
28071
28109
  //#endregion
28072
28110
  //#region ../../node_modules/.pnpm/nunjucks@3.2.4_chokidar@4.0.3/node_modules/nunjucks/src/express-app.js
28073
28111
  var require_express_app = /* @__PURE__ */ __commonJSMin(((exports, module) => {
28074
- var path$14 = __require("path");
28112
+ var path$13 = __require("path");
28075
28113
  module.exports = function express(env, app) {
28076
28114
  function NunjucksView(name, opts) {
28077
28115
  this.name = name;
28078
28116
  this.path = name;
28079
28117
  this.defaultEngine = opts.defaultEngine;
28080
- this.ext = path$14.extname(name);
28118
+ this.ext = path$13.extname(name);
28081
28119
  if (!this.ext && !this.defaultEngine) throw new Error("No default engine was specified and no extension was provided.");
28082
28120
  if (!this.ext) this.name += this.ext = (this.defaultEngine[0] !== "." ? "." : "") + this.defaultEngine;
28083
28121
  }
@@ -28513,8 +28551,8 @@ var require_precompile_global = /* @__PURE__ */ __commonJSMin(((exports, module)
28513
28551
  //#endregion
28514
28552
  //#region ../../node_modules/.pnpm/nunjucks@3.2.4_chokidar@4.0.3/node_modules/nunjucks/src/precompile.js
28515
28553
  var require_precompile = /* @__PURE__ */ __commonJSMin(((exports, module) => {
28516
- var fs$15 = __require("fs");
28517
- var path$13 = __require("path");
28554
+ var fs$14 = __require("fs");
28555
+ var path$12 = __require("path");
28518
28556
  var _prettifyError = require_lib$8()._prettifyError;
28519
28557
  var compiler = require_compiler();
28520
28558
  var Environment = require_environment().Environment;
@@ -28538,27 +28576,27 @@ var require_precompile = /* @__PURE__ */ __commonJSMin(((exports, module) => {
28538
28576
  var env = opts.env || new Environment([]);
28539
28577
  var wrapper = opts.wrapper || precompileGlobal;
28540
28578
  if (opts.isString) return precompileString(input, opts);
28541
- var pathStats = fs$15.existsSync(input) && fs$15.statSync(input);
28579
+ var pathStats = fs$14.existsSync(input) && fs$14.statSync(input);
28542
28580
  var precompiled = [];
28543
28581
  var templates = [];
28544
28582
  function addTemplates(dir) {
28545
- fs$15.readdirSync(dir).forEach(function(file) {
28546
- var filepath = path$13.join(dir, file);
28547
- var subpath = filepath.substr(path$13.join(input, "/").length);
28548
- var stat = fs$15.statSync(filepath);
28583
+ fs$14.readdirSync(dir).forEach(function(file) {
28584
+ var filepath = path$12.join(dir, file);
28585
+ var subpath = filepath.substr(path$12.join(input, "/").length);
28586
+ var stat = fs$14.statSync(filepath);
28549
28587
  if (stat && stat.isDirectory()) {
28550
28588
  subpath += "/";
28551
28589
  if (!match(subpath, opts.exclude)) addTemplates(filepath);
28552
28590
  } else if (match(subpath, opts.include)) templates.push(filepath);
28553
28591
  });
28554
28592
  }
28555
- if (pathStats.isFile()) precompiled.push(_precompile(fs$15.readFileSync(input, "utf-8"), opts.name || input, env));
28593
+ if (pathStats.isFile()) precompiled.push(_precompile(fs$14.readFileSync(input, "utf-8"), opts.name || input, env));
28556
28594
  else if (pathStats.isDirectory()) {
28557
28595
  addTemplates(input);
28558
28596
  for (var i = 0; i < templates.length; i++) {
28559
- var name = templates[i].replace(path$13.join(input, "/"), "");
28597
+ var name = templates[i].replace(path$12.join(input, "/"), "");
28560
28598
  try {
28561
- precompiled.push(_precompile(fs$15.readFileSync(templates[i], "utf-8"), name, env));
28599
+ precompiled.push(_precompile(fs$14.readFileSync(templates[i], "utf-8"), name, env));
28562
28600
  } catch (e) {
28563
28601
  if (opts.force) console.error(e);
28564
28602
  else throw e;
@@ -32596,7 +32634,7 @@ var require_buffer_from = /* @__PURE__ */ __commonJSMin(((exports, module) => {
32596
32634
  //#region ../../node_modules/.pnpm/source-map-support@0.5.21/node_modules/source-map-support/source-map-support.js
32597
32635
  var require_source_map_support = /* @__PURE__ */ __commonJSMin(((exports, module) => {
32598
32636
  var SourceMapConsumer = require_source_map().SourceMapConsumer;
32599
- var path$12 = __require("path");
32637
+ var path$11 = __require("path");
32600
32638
  var fs;
32601
32639
  try {
32602
32640
  fs = __require("fs");
@@ -32673,15 +32711,15 @@ var require_source_map_support = /* @__PURE__ */ __commonJSMin(((exports, module
32673
32711
  });
32674
32712
  function supportRelativeURL(file, url) {
32675
32713
  if (!file) return url;
32676
- var dir = path$12.dirname(file);
32714
+ var dir = path$11.dirname(file);
32677
32715
  var match = /^\w+:\/\/[^\/]*/.exec(dir);
32678
32716
  var protocol = match ? match[0] : "";
32679
32717
  var startPath = dir.slice(protocol.length);
32680
32718
  if (protocol && /^\/\w\:/.test(startPath)) {
32681
32719
  protocol += "/";
32682
- return protocol + path$12.resolve(dir.slice(protocol.length), url).replace(/\\/g, "/");
32720
+ return protocol + path$11.resolve(dir.slice(protocol.length), url).replace(/\\/g, "/");
32683
32721
  }
32684
- return protocol + path$12.resolve(dir.slice(protocol.length), url);
32722
+ return protocol + path$11.resolve(dir.slice(protocol.length), url);
32685
32723
  }
32686
32724
  function retrieveSourceMapURL(source) {
32687
32725
  var fileData;
@@ -191924,7 +191962,7 @@ var require_gifframe = /* @__PURE__ */ __commonJSMin(((exports) => {
191924
191962
  //#region ../../node_modules/.pnpm/gifwrap@0.10.1/node_modules/gifwrap/src/gifutil.js
191925
191963
  var require_gifutil = /* @__PURE__ */ __commonJSMin(((exports) => {
191926
191964
  /** @namespace GifUtil */
191927
- const fs$14 = __require("fs");
191965
+ const fs$13 = __require("fs");
191928
191966
  const ImageQ = require_image_q();
191929
191967
  const BitmapImage = require_bitmapimage();
191930
191968
  const { GifFrame } = require_gifframe();
@@ -192191,7 +192229,7 @@ var require_gifutil = /* @__PURE__ */ __commonJSMin(((exports) => {
192191
192229
  }
192192
192230
  function _readBinary(path) {
192193
192231
  return new Promise((resolve, reject) => {
192194
- fs$14.readFile(path, (err, buffer) => {
192232
+ fs$13.readFile(path, (err, buffer) => {
192195
192233
  if (err) return reject(err);
192196
192234
  return resolve(buffer);
192197
192235
  });
@@ -192199,7 +192237,7 @@ var require_gifutil = /* @__PURE__ */ __commonJSMin(((exports) => {
192199
192237
  }
192200
192238
  function _writeBinary(path, buffer) {
192201
192239
  return new Promise((resolve, reject) => {
192202
- fs$14.writeFile(path, buffer, (err) => {
192240
+ fs$13.writeFile(path, buffer, (err) => {
192203
192241
  if (err) return reject(err);
192204
192242
  return resolve();
192205
192243
  });
@@ -218017,7 +218055,7 @@ var init_file_type = __esmMin((() => {
218017
218055
  }
218018
218056
  async fromFile(path) {
218019
218057
  this.options.signal?.throwIfAborted();
218020
- const fileHandle = await fs.open(path, constants.O_RDONLY | constants.O_NONBLOCK);
218058
+ const fileHandle = await ro.open(path, constants.O_RDONLY | constants.O_NONBLOCK);
218021
218059
  const fileStat = await fileHandle.stat();
218022
218060
  if (!fileStat.isFile()) {
218023
218061
  await fileHandle.close();
@@ -228522,7 +228560,7 @@ async function processBitmapFont(file, font) {
228522
228560
  ...font,
228523
228561
  chars,
228524
228562
  kernings,
228525
- pages: await Promise.all(font.pages.map(async (page) => CharacterJimp.read(path$1.join(path$1.dirname(file), page))))
228563
+ pages: await Promise.all(font.pages.map(async (page) => CharacterJimp.read(js.join(js.dirname(file), page))))
228526
228564
  };
228527
228565
  }
228528
228566
  var import_parse_bmfont_ascii, import_lib$1, import_parse_bmfont_binary, convertXML, isWebWorker, CharacterJimp, HEADER;
@@ -259086,7 +259124,7 @@ function Yn(s, t) {
259086
259124
  function Kn(s, t) {
259087
259125
  s.head = new ue$1(t, void 0, s.head, s), s.tail || (s.tail = s.head), s.length++;
259088
259126
  }
259089
- 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;
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$12, 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;
259090
259128
  var init_index_min = __esmMin((() => {
259091
259129
  zr = Object.defineProperty;
259092
259130
  Ur = (s, t) => {
@@ -260614,7 +260652,7 @@ while (this[Zs](this[st$1].shift()));
260614
260652
  let [o, h] = ce$1(this.path);
260615
260653
  o && typeof h == "string" && (this.path = h, r = o);
260616
260654
  }
260617
- 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`, {
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 || js.resolve(this.cwd, t)), this.path === "" && (this.path = "./"), r && this.warn("TAR_ENTRY_INFO", `stripping ${r} from absolute path`, {
260618
260656
  entry: this,
260619
260657
  path: r + this.path
260620
260658
  });
@@ -260697,7 +260735,7 @@ while (this[Zs](this[st$1].shift()));
260697
260735
  }
260698
260736
  [sr](t) {
260699
260737
  if (!this.stat) throw new Error("cannot create link entry without stat");
260700
- this.type = "Link", this.linkpath = f(path$1.relative(this.cwd, t)), this.stat.size = 0, this[fe$1](), this.end();
260738
+ this.type = "Link", this.linkpath = f(js.relative(this.cwd, t)), this.stat.size = 0, this[fe$1](), this.end();
260701
260739
  }
260702
260740
  [er]() {
260703
260741
  if (!this.stat) throw new Error("cannot create file entry without stat");
@@ -261056,7 +261094,7 @@ while (this[Zs](this[st$1].shift()));
261056
261094
  constructor(t, e) {
261057
261095
  this.path = t || "./", this.absolute = e;
261058
261096
  }
261059
- }, 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 {
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$12 = Symbol("ondrain"), wt = class extends A$1 {
261060
261098
  sync = !1;
261061
261099
  opt;
261062
261100
  cwd;
@@ -261089,8 +261127,8 @@ while (this[Zs](this[st$1].shift()));
261089
261127
  if ((t.gzip ? 1 : 0) + (t.brotli ? 1 : 0) + (t.zstd ? 1 : 0) > 1) throw new TypeError("gzip, brotli, zstd are mutually exclusive");
261090
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");
261091
261129
  let e = this.zip;
261092
- e.on("data", (i) => super.write(i)), e.on("end", () => super.end()), e.on("drain", () => this[fs$13]()), this.on("resume", () => e.resume());
261093
- } else this.on("drain", this[fs$13]);
261130
+ e.on("data", (i) => super.write(i)), e.on("end", () => super.end()), e.on("drain", () => this[fs$12]()), this.on("resume", () => e.resume());
261131
+ } else this.on("drain", this[fs$12]);
261094
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;
261095
261133
  }
261096
261134
  [lr](t) {
@@ -261107,7 +261145,7 @@ while (this[Zs](this[st$1].shift()));
261107
261145
  return typeof t == "string" ? this[ci](t) : this[or](t), this.flowing;
261108
261146
  }
261109
261147
  [or](t) {
261110
- let e = f(path$1.resolve(this.cwd, t.path));
261148
+ let e = f(js.resolve(this.cwd, t.path));
261111
261149
  if (!this.filter(t.path, t)) t.resume();
261112
261150
  else {
261113
261151
  let i = new pi(t.path, e);
@@ -261116,7 +261154,7 @@ while (this[Zs](this[st$1].shift()));
261116
261154
  this[Ft$1]();
261117
261155
  }
261118
261156
  [ci](t) {
261119
- let e = f(path$1.resolve(this.cwd, t));
261157
+ let e = f(js.resolve(this.cwd, t));
261120
261158
  this[W$1].push(new pi(t, e)), this[Ft$1]();
261121
261159
  }
261122
261160
  [ds](t) {
@@ -261217,7 +261255,7 @@ while (this[Zs](this[st$1].shift()));
261217
261255
  this.emit("error", e);
261218
261256
  }
261219
261257
  }
261220
- [fs$13]() {
261258
+ [fs$12]() {
261221
261259
  this[Et] && this[Et].entry && this[Et].entry.resume();
261222
261260
  }
261223
261261
  [di](t) {
@@ -261383,7 +261421,7 @@ while (this[Zs](this[st$1].shift()));
261383
261421
  E ? e(E) : x && a ? Es(x, o, h, (Le) => y(Le)) : n ? Kt.chmod(s, r, e) : e();
261384
261422
  };
261385
261423
  if (s === d) return no(s, y);
261386
- if (l) return fs.mkdir(s, {
261424
+ if (l) return ro.mkdir(s, {
261387
261425
  mode: r,
261388
261426
  recursive: !0
261389
261427
  }).then((E) => y(null, E ?? void 0), y);
@@ -262142,7 +262180,7 @@ var require_pend = /* @__PURE__ */ __commonJSMin(((exports, module) => {
262142
262180
  //#endregion
262143
262181
  //#region ../../node_modules/.pnpm/yauzl@3.3.0/node_modules/yauzl/fd-slicer.js
262144
262182
  var require_fd_slicer = /* @__PURE__ */ __commonJSMin(((exports) => {
262145
- var fs$12 = __require("fs");
262183
+ var fs$11 = __require("fs");
262146
262184
  var util$6 = __require("util");
262147
262185
  var stream$2 = __require("stream");
262148
262186
  var Readable = stream$2.Readable;
@@ -262167,7 +262205,7 @@ var require_fd_slicer = /* @__PURE__ */ __commonJSMin(((exports) => {
262167
262205
  FdSlicer.prototype.read = function(buffer, offset, length, position, callback) {
262168
262206
  var self = this;
262169
262207
  self.pend.go(function(cb) {
262170
- fs$12.read(self.fd, buffer, offset, length, position, function(err, bytesRead, buffer) {
262208
+ fs$11.read(self.fd, buffer, offset, length, position, function(err, bytesRead, buffer) {
262171
262209
  cb();
262172
262210
  callback(err, bytesRead, buffer);
262173
262211
  });
@@ -262176,7 +262214,7 @@ var require_fd_slicer = /* @__PURE__ */ __commonJSMin(((exports) => {
262176
262214
  FdSlicer.prototype.write = function(buffer, offset, length, position, callback) {
262177
262215
  var self = this;
262178
262216
  self.pend.go(function(cb) {
262179
- fs$12.write(self.fd, buffer, offset, length, position, function(err, written, buffer) {
262217
+ fs$11.write(self.fd, buffer, offset, length, position, function(err, written, buffer) {
262180
262218
  cb();
262181
262219
  callback(err, written, buffer);
262182
262220
  });
@@ -262196,7 +262234,7 @@ var require_fd_slicer = /* @__PURE__ */ __commonJSMin(((exports) => {
262196
262234
  self.refCount -= 1;
262197
262235
  if (self.refCount > 0) return;
262198
262236
  if (self.refCount < 0) throw new Error("invalid unref");
262199
- if (self.autoClose) fs$12.close(self.fd, onCloseDone);
262237
+ if (self.autoClose) fs$11.close(self.fd, onCloseDone);
262200
262238
  function onCloseDone(err) {
262201
262239
  if (err) self.emit("error", err);
262202
262240
  else self.emit("close");
@@ -262227,7 +262265,7 @@ var require_fd_slicer = /* @__PURE__ */ __commonJSMin(((exports) => {
262227
262265
  self.context.pend.go(function(cb) {
262228
262266
  if (self.destroyed) return cb();
262229
262267
  var buffer = Buffer.allocUnsafe(toRead);
262230
- fs$12.read(self.context.fd, buffer, 0, toRead, self.pos, function(err, bytesRead) {
262268
+ fs$11.read(self.context.fd, buffer, 0, toRead, self.pos, function(err, bytesRead) {
262231
262269
  if (err) self.destroy(err);
262232
262270
  else if (bytesRead === 0) {
262233
262271
  self.destroyed = true;
@@ -262273,7 +262311,7 @@ var require_fd_slicer = /* @__PURE__ */ __commonJSMin(((exports) => {
262273
262311
  }
262274
262312
  self.context.pend.go(function(cb) {
262275
262313
  if (self.destroyed) return cb();
262276
- fs$12.write(self.context.fd, buffer, 0, buffer.length, self.pos, function(err, bytes) {
262314
+ fs$11.write(self.context.fd, buffer, 0, buffer.length, self.pos, function(err, bytes) {
262277
262315
  if (err) {
262278
262316
  self.destroy();
262279
262317
  cb();
@@ -266186,14 +266224,14 @@ async function readGitExecPath(deps, gitExe) {
266186
266224
  }
266187
266225
  }
266188
266226
  function gitBashCandidatesFromGitExe(gitExe) {
266189
- const normalizedGitExe = path$18.win32.normalize(normalizeWindowsPath(gitExe));
266190
- const gitDir = path$18.win32.dirname(normalizedGitExe);
266191
- const gitDirName = path$18.win32.basename(gitDir).toLowerCase();
266227
+ const normalizedGitExe = path$17.win32.normalize(normalizeWindowsPath(gitExe));
266228
+ const gitDir = path$17.win32.dirname(normalizedGitExe);
266229
+ const gitDirName = path$17.win32.basename(gitDir).toLowerCase();
266192
266230
  if (gitDirName !== "cmd" && gitDirName !== "bin") return;
266193
- return gitBashCandidatesFromGitRoot(path$18.win32.dirname(gitDir));
266231
+ return gitBashCandidatesFromGitRoot(path$17.win32.dirname(gitDir));
266194
266232
  }
266195
266233
  function gitBashCandidatesFromGitExecPath(execPath) {
266196
- const normalized = path$18.win32.normalize(normalizeWindowsPath(execPath));
266234
+ const normalized = path$17.win32.normalize(normalizeWindowsPath(execPath));
266197
266235
  const parts = normalized.split("\\");
266198
266236
  for (let i = parts.length - 1; i >= 0; i -= 1) {
266199
266237
  const segment = parts[i]?.toLowerCase();
@@ -266202,16 +266240,16 @@ function gitBashCandidatesFromGitExecPath(execPath) {
266202
266240
  if (root.length > 0) return gitBashCandidatesFromGitRoot(root);
266203
266241
  }
266204
266242
  }
266205
- return gitBashCandidatesFromGitRoot(path$18.win32.join(normalized, "..", ".."));
266243
+ return gitBashCandidatesFromGitRoot(path$17.win32.join(normalized, "..", ".."));
266206
266244
  }
266207
266245
  function gitBashCandidatesFromGitRoot(root) {
266208
- 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"))];
266246
+ return [path$17.win32.normalize(path$17.win32.join(root, "bin", "bash.exe")), path$17.win32.normalize(path$17.win32.join(root, "usr", "bin", "bash.exe"))];
266209
266247
  }
266210
266248
  function normalizeWindowsPath(path) {
266211
266249
  return path.replaceAll("/", "\\");
266212
266250
  }
266213
266251
  function isAbsoluteWindowsPath(path) {
266214
- return path$18.win32.isAbsolute(normalizeWindowsPath(path));
266252
+ return path$17.win32.isAbsolute(normalizeWindowsPath(path));
266215
266253
  }
266216
266254
  function dedupeWindowsPaths(paths) {
266217
266255
  const deduped = [];
@@ -303130,7 +303168,7 @@ var init_proxy = __esmMin((() => {
303130
303168
  var require_windows = /* @__PURE__ */ __commonJSMin(((exports, module) => {
303131
303169
  module.exports = isexe;
303132
303170
  isexe.sync = sync;
303133
- var fs$10 = __require("fs");
303171
+ var fs$9 = __require("fs");
303134
303172
  function checkPathExt(path, options) {
303135
303173
  var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT;
303136
303174
  if (!pathext) return true;
@@ -303147,12 +303185,12 @@ var require_windows = /* @__PURE__ */ __commonJSMin(((exports, module) => {
303147
303185
  return checkPathExt(path, options);
303148
303186
  }
303149
303187
  function isexe(path, options, cb) {
303150
- fs$10.stat(path, function(er, stat) {
303188
+ fs$9.stat(path, function(er, stat) {
303151
303189
  cb(er, er ? false : checkStat(stat, path, options));
303152
303190
  });
303153
303191
  }
303154
303192
  function sync(path, options) {
303155
- return checkStat(fs$10.statSync(path), path, options);
303193
+ return checkStat(fs$9.statSync(path), path, options);
303156
303194
  }
303157
303195
  }));
303158
303196
  //#endregion
@@ -303160,14 +303198,14 @@ var require_windows = /* @__PURE__ */ __commonJSMin(((exports, module) => {
303160
303198
  var require_mode = /* @__PURE__ */ __commonJSMin(((exports, module) => {
303161
303199
  module.exports = isexe;
303162
303200
  isexe.sync = sync;
303163
- var fs$9 = __require("fs");
303201
+ var fs$8 = __require("fs");
303164
303202
  function isexe(path, options, cb) {
303165
- fs$9.stat(path, function(er, stat) {
303203
+ fs$8.stat(path, function(er, stat) {
303166
303204
  cb(er, er ? false : checkStat(stat, options));
303167
303205
  });
303168
303206
  }
303169
303207
  function sync(path, options) {
303170
- return checkStat(fs$9.statSync(path), options);
303208
+ return checkStat(fs$8.statSync(path), options);
303171
303209
  }
303172
303210
  function checkStat(stat, options) {
303173
303211
  return stat.isFile() && checkMode(stat, options);
@@ -303231,7 +303269,7 @@ var require_isexe = /* @__PURE__ */ __commonJSMin(((exports, module) => {
303231
303269
  //#region ../../node_modules/.pnpm/which@2.0.2/node_modules/which/which.js
303232
303270
  var require_which = /* @__PURE__ */ __commonJSMin(((exports, module) => {
303233
303271
  const isWindows = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
303234
- const path$11 = __require("path");
303272
+ const path$10 = __require("path");
303235
303273
  const COLON = isWindows ? ";" : ":";
303236
303274
  const isexe = require_isexe();
303237
303275
  const getNotFoundError = (cmd) => Object.assign(/* @__PURE__ */ new Error(`not found: ${cmd}`), { code: "ENOENT" });
@@ -303261,7 +303299,7 @@ var require_which = /* @__PURE__ */ __commonJSMin(((exports, module) => {
303261
303299
  if (i === pathEnv.length) return opt.all && found.length ? resolve(found) : reject(getNotFoundError(cmd));
303262
303300
  const ppRaw = pathEnv[i];
303263
303301
  const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
303264
- const pCmd = path$11.join(pathPart, cmd);
303302
+ const pCmd = path$10.join(pathPart, cmd);
303265
303303
  resolve(subStep(!pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd, i, 0));
303266
303304
  });
303267
303305
  const subStep = (p, i, ii) => new Promise((resolve, reject) => {
@@ -303282,7 +303320,7 @@ var require_which = /* @__PURE__ */ __commonJSMin(((exports, module) => {
303282
303320
  for (let i = 0; i < pathEnv.length; i++) {
303283
303321
  const ppRaw = pathEnv[i];
303284
303322
  const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
303285
- const pCmd = path$11.join(pathPart, cmd);
303323
+ const pCmd = path$10.join(pathPart, cmd);
303286
303324
  const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
303287
303325
  for (let j = 0; j < pathExt.length; j++) {
303288
303326
  const cur = p + pathExt[j];
@@ -303313,7 +303351,7 @@ var require_path_key = /* @__PURE__ */ __commonJSMin(((exports, module) => {
303313
303351
  //#endregion
303314
303352
  //#region ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js
303315
303353
  var require_resolveCommand = /* @__PURE__ */ __commonJSMin(((exports, module) => {
303316
- const path$10 = __require("path");
303354
+ const path$9 = __require("path");
303317
303355
  const which = require_which();
303318
303356
  const getPathKey = require_path_key();
303319
303357
  function resolveCommandAttempt(parsed, withoutPathExt) {
@@ -303328,12 +303366,12 @@ var require_resolveCommand = /* @__PURE__ */ __commonJSMin(((exports, module) =>
303328
303366
  try {
303329
303367
  resolved = which.sync(parsed.command, {
303330
303368
  path: env[getPathKey({ env })],
303331
- pathExt: withoutPathExt ? path$10.delimiter : void 0
303369
+ pathExt: withoutPathExt ? path$9.delimiter : void 0
303332
303370
  });
303333
303371
  } catch (e) {} finally {
303334
303372
  if (shouldSwitchCwd) process.chdir(cwd);
303335
303373
  }
303336
- if (resolved) resolved = path$10.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
303374
+ if (resolved) resolved = path$9.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
303337
303375
  return resolved;
303338
303376
  }
303339
303377
  function resolveCommand(parsed) {
@@ -303382,16 +303420,16 @@ var require_shebang_command = /* @__PURE__ */ __commonJSMin(((exports, module) =
303382
303420
  //#endregion
303383
303421
  //#region ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js
303384
303422
  var require_readShebang = /* @__PURE__ */ __commonJSMin(((exports, module) => {
303385
- const fs$8 = __require("fs");
303423
+ const fs$7 = __require("fs");
303386
303424
  const shebangCommand = require_shebang_command();
303387
303425
  function readShebang(command) {
303388
303426
  const size = 150;
303389
303427
  const buffer = Buffer.alloc(size);
303390
303428
  let fd;
303391
303429
  try {
303392
- fd = fs$8.openSync(command, "r");
303393
- fs$8.readSync(fd, buffer, 0, size, 0);
303394
- fs$8.closeSync(fd);
303430
+ fd = fs$7.openSync(command, "r");
303431
+ fs$7.readSync(fd, buffer, 0, size, 0);
303432
+ fs$7.closeSync(fd);
303395
303433
  } catch (e) {}
303396
303434
  return shebangCommand(buffer.toString());
303397
303435
  }
@@ -303400,7 +303438,7 @@ var require_readShebang = /* @__PURE__ */ __commonJSMin(((exports, module) => {
303400
303438
  //#endregion
303401
303439
  //#region ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js
303402
303440
  var require_parse$5 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
303403
- const path$9 = __require("path");
303441
+ const path$8 = __require("path");
303404
303442
  const resolveCommand = require_resolveCommand();
303405
303443
  const escape = require_escape();
303406
303444
  const readShebang = require_readShebang();
@@ -303423,7 +303461,7 @@ var require_parse$5 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
303423
303461
  const needsShell = !isExecutableRegExp.test(commandFile);
303424
303462
  if (parsed.options.forceShell || needsShell) {
303425
303463
  const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
303426
- parsed.command = path$9.normalize(parsed.command);
303464
+ parsed.command = path$8.normalize(parsed.command);
303427
303465
  parsed.command = escape.command(parsed.command);
303428
303466
  parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
303429
303467
  parsed.args = [
@@ -337553,7 +337591,7 @@ var require_dist$5 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
337553
337591
  //#endregion
337554
337592
  //#region ../../node_modules/.pnpm/yazl@3.3.1/node_modules/yazl/index.js
337555
337593
  var require_yazl = /* @__PURE__ */ __commonJSMin(((exports) => {
337556
- var fs$7 = __require("fs");
337594
+ var fs$6 = __require("fs");
337557
337595
  var Transform$2 = __require("stream").Transform;
337558
337596
  var PassThrough$2 = __require("stream").PassThrough;
337559
337597
  var zlib$1 = __require("zlib");
@@ -337582,14 +337620,14 @@ var require_yazl = /* @__PURE__ */ __commonJSMin(((exports) => {
337582
337620
  if (shouldIgnoreAdding(self)) return;
337583
337621
  var entry = new Entry(metadataPath, false, options);
337584
337622
  self.entries.push(entry);
337585
- fs$7.stat(realPath, function(err, stats) {
337623
+ fs$6.stat(realPath, function(err, stats) {
337586
337624
  if (err) return self.emit("error", err);
337587
337625
  if (!stats.isFile()) return self.emit("error", /* @__PURE__ */ new Error("not a file: " + realPath));
337588
337626
  entry.uncompressedSize = stats.size;
337589
337627
  if (options.mtime == null) entry.setLastModDate(stats.mtime);
337590
337628
  if (options.mode == null) entry.setFileAttributesMode(stats.mode);
337591
337629
  entry.setFileDataPumpFunction(function() {
337592
- var readStream = fs$7.createReadStream(realPath);
337630
+ var readStream = fs$6.createReadStream(realPath);
337593
337631
  entry.state = Entry.FILE_DATA_IN_PROGRESS;
337594
337632
  readStream.on("error", function(err) {
337595
337633
  self.emit("error", err);
@@ -353390,8 +353428,8 @@ var require_suggestSimilar = /* @__PURE__ */ __commonJSMin(((exports) => {
353390
353428
  var require_command = /* @__PURE__ */ __commonJSMin(((exports) => {
353391
353429
  const EventEmitter$12 = __require("node:events").EventEmitter;
353392
353430
  const childProcess = __require("node:child_process");
353393
- const path$8 = __require("node:path");
353394
- const fs$6 = __require("node:fs");
353431
+ const path$7 = __require("node:path");
353432
+ const fs$5 = __require("node:fs");
353395
353433
  const process$2 = __require("node:process");
353396
353434
  const { Argument, humanReadableArgName } = require_argument();
353397
353435
  const { CommanderError } = require_error$2();
@@ -354274,7 +354312,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
354274
354312
  * @param {string} subcommandName
354275
354313
  */
354276
354314
  _checkForMissingExecutable(executableFile, executableDir, subcommandName) {
354277
- if (fs$6.existsSync(executableFile)) return;
354315
+ if (fs$5.existsSync(executableFile)) return;
354278
354316
  const executableMissing = `'${executableFile}' does not exist
354279
354317
  - if '${subcommandName}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
354280
354318
  - if the default executable name is not suitable, use the executableFile option to supply a custom name or path
@@ -354297,10 +354335,10 @@ Expecting one of '${allowedValues.join("', '")}'`);
354297
354335
  ".cjs"
354298
354336
  ];
354299
354337
  function findFile(baseDir, baseName) {
354300
- const localBin = path$8.resolve(baseDir, baseName);
354301
- if (fs$6.existsSync(localBin)) return localBin;
354302
- if (sourceExt.includes(path$8.extname(baseName))) return void 0;
354303
- const foundExt = sourceExt.find((ext) => fs$6.existsSync(`${localBin}${ext}`));
354338
+ const localBin = path$7.resolve(baseDir, baseName);
354339
+ if (fs$5.existsSync(localBin)) return localBin;
354340
+ if (sourceExt.includes(path$7.extname(baseName))) return void 0;
354341
+ const foundExt = sourceExt.find((ext) => fs$5.existsSync(`${localBin}${ext}`));
354304
354342
  if (foundExt) return `${localBin}${foundExt}`;
354305
354343
  }
354306
354344
  this._checkForMissingMandatoryOptions();
@@ -354310,21 +354348,21 @@ Expecting one of '${allowedValues.join("', '")}'`);
354310
354348
  if (this._scriptPath) {
354311
354349
  let resolvedScriptPath;
354312
354350
  try {
354313
- resolvedScriptPath = fs$6.realpathSync(this._scriptPath);
354351
+ resolvedScriptPath = fs$5.realpathSync(this._scriptPath);
354314
354352
  } catch {
354315
354353
  resolvedScriptPath = this._scriptPath;
354316
354354
  }
354317
- executableDir = path$8.resolve(path$8.dirname(resolvedScriptPath), executableDir);
354355
+ executableDir = path$7.resolve(path$7.dirname(resolvedScriptPath), executableDir);
354318
354356
  }
354319
354357
  if (executableDir) {
354320
354358
  let localFile = findFile(executableDir, executableFile);
354321
354359
  if (!localFile && !subcommand._executableFile && this._scriptPath) {
354322
- const legacyName = path$8.basename(this._scriptPath, path$8.extname(this._scriptPath));
354360
+ const legacyName = path$7.basename(this._scriptPath, path$7.extname(this._scriptPath));
354323
354361
  if (legacyName !== this._name) localFile = findFile(executableDir, `${legacyName}-${subcommand._name}`);
354324
354362
  }
354325
354363
  executableFile = localFile || executableFile;
354326
354364
  }
354327
- launchWithNode = sourceExt.includes(path$8.extname(executableFile));
354365
+ launchWithNode = sourceExt.includes(path$7.extname(executableFile));
354328
354366
  let proc;
354329
354367
  if (process$2.platform !== "win32") if (launchWithNode) {
354330
354368
  args.unshift(executableFile);
@@ -355028,7 +355066,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
355028
355066
  * @return {Command}
355029
355067
  */
355030
355068
  nameFromFilename(filename) {
355031
- this._name = path$8.basename(filename, path$8.extname(filename));
355069
+ this._name = path$7.basename(filename, path$7.extname(filename));
355032
355070
  return this;
355033
355071
  }
355034
355072
  /**
@@ -372827,10 +372865,10 @@ var require_atomic_sleep = /* @__PURE__ */ __commonJSMin(((exports, module) => {
372827
372865
  //#endregion
372828
372866
  //#region ../../node_modules/.pnpm/sonic-boom@4.2.1/node_modules/sonic-boom/index.js
372829
372867
  var require_sonic_boom = /* @__PURE__ */ __commonJSMin(((exports, module) => {
372830
- const fs$5 = __require("fs");
372868
+ const fs$4 = __require("fs");
372831
372869
  const EventEmitter$10 = __require("events");
372832
372870
  const inherits$6 = __require("util").inherits;
372833
- const path$7 = __require("path");
372871
+ const path$6 = __require("path");
372834
372872
  const sleep = require_atomic_sleep();
372835
372873
  const assert$8 = __require("assert");
372836
372874
  const BUSY_WRITE_TIMEOUT = 100;
@@ -372870,17 +372908,17 @@ var require_sonic_boom = /* @__PURE__ */ __commonJSMin(((exports, module) => {
372870
372908
  const flags = sonic.append ? "a" : "w";
372871
372909
  const mode = sonic.mode;
372872
372910
  if (sonic.sync) try {
372873
- if (sonic.mkdir) fs$5.mkdirSync(path$7.dirname(file), { recursive: true });
372874
- fileOpened(null, fs$5.openSync(file, flags, mode));
372911
+ if (sonic.mkdir) fs$4.mkdirSync(path$6.dirname(file), { recursive: true });
372912
+ fileOpened(null, fs$4.openSync(file, flags, mode));
372875
372913
  } catch (err) {
372876
372914
  fileOpened(err);
372877
372915
  throw err;
372878
372916
  }
372879
- else if (sonic.mkdir) fs$5.mkdir(path$7.dirname(file), { recursive: true }, (err) => {
372917
+ else if (sonic.mkdir) fs$4.mkdir(path$6.dirname(file), { recursive: true }, (err) => {
372880
372918
  if (err) return fileOpened(err);
372881
- fs$5.open(file, flags, mode, fileOpened);
372919
+ fs$4.open(file, flags, mode, fileOpened);
372882
372920
  });
372883
- else fs$5.open(file, flags, mode, fileOpened);
372921
+ else fs$4.open(file, flags, mode, fileOpened);
372884
372922
  }
372885
372923
  function SonicBoom(opts) {
372886
372924
  if (!(this instanceof SonicBoom)) return new SonicBoom(opts);
@@ -372918,8 +372956,8 @@ var require_sonic_boom = /* @__PURE__ */ __commonJSMin(((exports, module) => {
372918
372956
  this.flush = flushBuffer;
372919
372957
  this.flushSync = flushBufferSync;
372920
372958
  this._actualWrite = actualWriteBuffer;
372921
- fsWriteSync = () => fs$5.writeSync(this.fd, this._writingBuf);
372922
- fsWrite = () => fs$5.write(this.fd, this._writingBuf, this.release);
372959
+ fsWriteSync = () => fs$4.writeSync(this.fd, this._writingBuf);
372960
+ fsWrite = () => fs$4.write(this.fd, this._writingBuf, this.release);
372923
372961
  } else if (contentMode === void 0 || contentMode === kContentModeUtf8) {
372924
372962
  this._writingBuf = "";
372925
372963
  this.write = write;
@@ -372927,12 +372965,12 @@ var require_sonic_boom = /* @__PURE__ */ __commonJSMin(((exports, module) => {
372927
372965
  this.flushSync = flushSync;
372928
372966
  this._actualWrite = actualWrite;
372929
372967
  fsWriteSync = () => {
372930
- if (Buffer.isBuffer(this._writingBuf)) return fs$5.writeSync(this.fd, this._writingBuf);
372931
- return fs$5.writeSync(this.fd, this._writingBuf, "utf8");
372968
+ if (Buffer.isBuffer(this._writingBuf)) return fs$4.writeSync(this.fd, this._writingBuf);
372969
+ return fs$4.writeSync(this.fd, this._writingBuf, "utf8");
372932
372970
  };
372933
372971
  fsWrite = () => {
372934
- if (Buffer.isBuffer(this._writingBuf)) return fs$5.write(this.fd, this._writingBuf, this.release);
372935
- return fs$5.write(this.fd, this._writingBuf, "utf8", this.release);
372972
+ if (Buffer.isBuffer(this._writingBuf)) return fs$4.write(this.fd, this._writingBuf, this.release);
372973
+ return fs$4.write(this.fd, this._writingBuf, "utf8", this.release);
372936
372974
  };
372937
372975
  } else throw new Error(`SonicBoom supports "${kContentModeUtf8}" and "${kContentModeBuffer}", but passed ${contentMode}`);
372938
372976
  if (typeof fd === "number") {
@@ -372977,7 +373015,7 @@ var require_sonic_boom = /* @__PURE__ */ __commonJSMin(((exports, module) => {
372977
373015
  return;
372978
373016
  }
372979
373017
  }
372980
- if (this._fsync) fs$5.fsyncSync(this.fd);
373018
+ if (this._fsync) fs$4.fsyncSync(this.fd);
372981
373019
  const len = this._len;
372982
373020
  if (this._reopening) {
372983
373021
  this._writing = false;
@@ -373074,7 +373112,7 @@ var require_sonic_boom = /* @__PURE__ */ __commonJSMin(((exports, module) => {
373074
373112
  this._flushPending = true;
373075
373113
  const onDrain = () => {
373076
373114
  if (!this._fsync) try {
373077
- fs$5.fsync(this.fd, (err) => {
373115
+ fs$4.fsync(this.fd, (err) => {
373078
373116
  this._flushPending = false;
373079
373117
  cb(err);
373080
373118
  });
@@ -373151,7 +373189,7 @@ var require_sonic_boom = /* @__PURE__ */ __commonJSMin(((exports, module) => {
373151
373189
  if (this._writing) return;
373152
373190
  const fd = this.fd;
373153
373191
  this.once("ready", () => {
373154
- if (fd !== this.fd) fs$5.close(fd, (err) => {
373192
+ if (fd !== this.fd) fs$4.close(fd, (err) => {
373155
373193
  if (err) return this.emit("error", err);
373156
373194
  });
373157
373195
  });
@@ -373182,7 +373220,7 @@ var require_sonic_boom = /* @__PURE__ */ __commonJSMin(((exports, module) => {
373182
373220
  while (this._bufs.length || buf.length) {
373183
373221
  if (buf.length <= 0) buf = this._bufs[0];
373184
373222
  try {
373185
- const n = Buffer.isBuffer(buf) ? fs$5.writeSync(this.fd, buf) : fs$5.writeSync(this.fd, buf, "utf8");
373223
+ const n = Buffer.isBuffer(buf) ? fs$4.writeSync(this.fd, buf) : fs$4.writeSync(this.fd, buf, "utf8");
373186
373224
  const releasedBufObj = releaseWritingBuf(buf, this._len, n);
373187
373225
  buf = releasedBufObj.writingBuf;
373188
373226
  this._len = releasedBufObj.len;
@@ -373193,7 +373231,7 @@ var require_sonic_boom = /* @__PURE__ */ __commonJSMin(((exports, module) => {
373193
373231
  }
373194
373232
  }
373195
373233
  try {
373196
- fs$5.fsyncSync(this.fd);
373234
+ fs$4.fsyncSync(this.fd);
373197
373235
  } catch {}
373198
373236
  }
373199
373237
  function flushBufferSync() {
@@ -373207,7 +373245,7 @@ var require_sonic_boom = /* @__PURE__ */ __commonJSMin(((exports, module) => {
373207
373245
  while (this._bufs.length || buf.length) {
373208
373246
  if (buf.length <= 0) buf = mergeBuf(this._bufs[0], this._lens[0]);
373209
373247
  try {
373210
- const n = fs$5.writeSync(this.fd, buf);
373248
+ const n = fs$4.writeSync(this.fd, buf);
373211
373249
  buf = buf.subarray(n);
373212
373250
  this._len = Math.max(this._len - n, 0);
373213
373251
  if (buf.length <= 0) {
@@ -373229,24 +373267,24 @@ var require_sonic_boom = /* @__PURE__ */ __commonJSMin(((exports, module) => {
373229
373267
  this._writing = true;
373230
373268
  this._writingBuf = this._writingBuf.length ? this._writingBuf : this._bufs.shift() || "";
373231
373269
  if (this.sync) try {
373232
- release(null, Buffer.isBuffer(this._writingBuf) ? fs$5.writeSync(this.fd, this._writingBuf) : fs$5.writeSync(this.fd, this._writingBuf, "utf8"));
373270
+ release(null, Buffer.isBuffer(this._writingBuf) ? fs$4.writeSync(this.fd, this._writingBuf) : fs$4.writeSync(this.fd, this._writingBuf, "utf8"));
373233
373271
  } catch (err) {
373234
373272
  release(err);
373235
373273
  }
373236
- else fs$5.write(this.fd, this._writingBuf, release);
373274
+ else fs$4.write(this.fd, this._writingBuf, release);
373237
373275
  }
373238
373276
  function actualWriteBuffer() {
373239
373277
  const release = this.release;
373240
373278
  this._writing = true;
373241
373279
  this._writingBuf = this._writingBuf.length ? this._writingBuf : mergeBuf(this._bufs.shift(), this._lens.shift());
373242
373280
  if (this.sync) try {
373243
- release(null, fs$5.writeSync(this.fd, this._writingBuf));
373281
+ release(null, fs$4.writeSync(this.fd, this._writingBuf));
373244
373282
  } catch (err) {
373245
373283
  release(err);
373246
373284
  }
373247
373285
  else {
373248
373286
  if (kCopyBuffer) this._writingBuf = Buffer.from(this._writingBuf);
373249
- fs$5.write(this.fd, this._writingBuf, release);
373287
+ fs$4.write(this.fd, this._writingBuf, release);
373250
373288
  }
373251
373289
  }
373252
373290
  function actualClose(sonic) {
@@ -373260,10 +373298,10 @@ var require_sonic_boom = /* @__PURE__ */ __commonJSMin(((exports, module) => {
373260
373298
  sonic._lens = [];
373261
373299
  assert$8(typeof sonic.fd === "number", `sonic.fd must be a number, got ${typeof sonic.fd}`);
373262
373300
  try {
373263
- fs$5.fsync(sonic.fd, closeWrapped);
373301
+ fs$4.fsync(sonic.fd, closeWrapped);
373264
373302
  } catch {}
373265
373303
  function closeWrapped() {
373266
- if (sonic.fd !== 1 && sonic.fd !== 2) fs$5.close(sonic.fd, done);
373304
+ if (sonic.fd !== 1 && sonic.fd !== 2) fs$4.close(sonic.fd, done);
373267
373305
  else done();
373268
373306
  }
373269
373307
  function done(err) {
@@ -395886,8 +395924,8 @@ var require_constants$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
395886
395924
  //#endregion
395887
395925
  //#region ../../../../../node_modules/node-gyp-build/node-gyp-build.js
395888
395926
  var require_node_gyp_build$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
395889
- var fs$4 = __require("fs");
395890
- var path$6 = __require("path");
395927
+ var fs$3 = __require("fs");
395928
+ var path$5 = __require("path");
395891
395929
  var os$4 = __require("os");
395892
395930
  var runtimeRequire = typeof __webpack_require__ === "function" ? __non_webpack_require__ : __require;
395893
395931
  var vars = process.config && process.config.variables || {};
@@ -395904,20 +395942,20 @@ var require_node_gyp_build$1 = /* @__PURE__ */ __commonJSMin(((exports, module)
395904
395942
  return runtimeRequire(load.resolve(dir));
395905
395943
  }
395906
395944
  load.resolve = load.path = function(dir) {
395907
- dir = path$6.resolve(dir || ".");
395945
+ dir = path$5.resolve(dir || ".");
395908
395946
  try {
395909
- var name = runtimeRequire(path$6.join(dir, "package.json")).name.toUpperCase().replace(/-/g, "_");
395947
+ var name = runtimeRequire(path$5.join(dir, "package.json")).name.toUpperCase().replace(/-/g, "_");
395910
395948
  if (process.env[name + "_PREBUILD"]) dir = process.env[name + "_PREBUILD"];
395911
395949
  } catch (err) {}
395912
395950
  if (!prebuildsOnly) {
395913
- var release = getFirst(path$6.join(dir, "build/Release"), matchBuild);
395951
+ var release = getFirst(path$5.join(dir, "build/Release"), matchBuild);
395914
395952
  if (release) return release;
395915
- var debug = getFirst(path$6.join(dir, "build/Debug"), matchBuild);
395953
+ var debug = getFirst(path$5.join(dir, "build/Debug"), matchBuild);
395916
395954
  if (debug) return debug;
395917
395955
  }
395918
395956
  var prebuild = resolve(dir);
395919
395957
  if (prebuild) return prebuild;
395920
- var nearby = resolve(path$6.dirname(process.execPath));
395958
+ var nearby = resolve(path$5.dirname(process.execPath));
395921
395959
  if (nearby) return nearby;
395922
395960
  var target = [
395923
395961
  "platform=" + platform,
@@ -395933,23 +395971,23 @@ var require_node_gyp_build$1 = /* @__PURE__ */ __commonJSMin(((exports, module)
395933
395971
  ].filter(Boolean).join(" ");
395934
395972
  throw new Error("No native build was found for " + target + "\n loaded from: " + dir + "\n");
395935
395973
  function resolve(dir) {
395936
- var tuple = readdirSync(path$6.join(dir, "prebuilds")).map(parseTuple).filter(matchTuple(platform, arch)).sort(compareTuples)[0];
395974
+ var tuple = readdirSync(path$5.join(dir, "prebuilds")).map(parseTuple).filter(matchTuple(platform, arch)).sort(compareTuples)[0];
395937
395975
  if (!tuple) return;
395938
- var prebuilds = path$6.join(dir, "prebuilds", tuple.name);
395976
+ var prebuilds = path$5.join(dir, "prebuilds", tuple.name);
395939
395977
  var winner = readdirSync(prebuilds).map(parseTags).filter(matchTags(runtime, abi)).sort(compareTags(runtime))[0];
395940
- if (winner) return path$6.join(prebuilds, winner.file);
395978
+ if (winner) return path$5.join(prebuilds, winner.file);
395941
395979
  }
395942
395980
  };
395943
395981
  function readdirSync(dir) {
395944
395982
  try {
395945
- return fs$4.readdirSync(dir);
395983
+ return fs$3.readdirSync(dir);
395946
395984
  } catch (err) {
395947
395985
  return [];
395948
395986
  }
395949
395987
  }
395950
395988
  function getFirst(dir, filter) {
395951
395989
  var files = readdirSync(dir).filter(filter);
395952
- return files[0] && path$6.join(dir, files[0]);
395990
+ return files[0] && path$5.join(dir, files[0]);
395953
395991
  }
395954
395992
  function matchBuild(name) {
395955
395993
  return /\.node$/.test(name);
@@ -396030,7 +396068,7 @@ var require_node_gyp_build$1 = /* @__PURE__ */ __commonJSMin(((exports, module)
396030
396068
  return typeof window !== "undefined" && window.process && window.process.type === "renderer";
396031
396069
  }
396032
396070
  function isAlpine(platform) {
396033
- return platform === "linux" && fs$4.existsSync("/etc/alpine-release");
396071
+ return platform === "linux" && fs$3.existsSync("/etc/alpine-release");
396034
396072
  }
396035
396073
  load.parseTags = parseTags;
396036
396074
  load.matchTags = matchTags;
@@ -403146,7 +403184,7 @@ var import_multipart = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((
403146
403184
  const fp = require_plugin();
403147
403185
  const { createWriteStream: createWriteStream$1 } = __require("node:fs");
403148
403186
  const { unlink: unlink$1 } = __require("node:fs/promises");
403149
- const path$5 = __require("node:path");
403187
+ const path$4 = __require("node:path");
403150
403188
  const { generateId } = require_generateId();
403151
403189
  const createError = require_error$1();
403152
403190
  const streamToNull = require_stream_consumer();
@@ -403441,7 +403479,7 @@ var import_multipart = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((
403441
403479
  for await (const part of parts) {
403442
403480
  values = part.fields;
403443
403481
  if (!part.file) continue;
403444
- const filepath = path$5.join(tmpdir, generateId() + path$5.extname(part.filename || "file" + i++));
403482
+ const filepath = path$4.join(tmpdir, generateId() + path$4.extname(part.filename || "file" + i++));
403445
403483
  const target = createWriteStream$1(filepath);
403446
403484
  try {
403447
403485
  this.tmpUploads.push(filepath);
@@ -416182,8 +416220,8 @@ var require_dist$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
416182
416220
  //#endregion
416183
416221
  //#region ../../node_modules/.pnpm/@fastify+swagger@9.7.0/node_modules/@fastify/swagger/lib/mode/static.js
416184
416222
  var require_static = /* @__PURE__ */ __commonJSMin(((exports, module) => {
416185
- const path$4 = __require("node:path");
416186
- const fs$3 = __require("node:fs");
416223
+ const path$3 = __require("node:path");
416224
+ const fs$2 = __require("node:fs");
416187
416225
  const yaml = require_dist$1();
416188
416226
  module.exports = function(fastify, opts, done) {
416189
416227
  if (!opts.specification) return done(/* @__PURE__ */ new Error("specification is missing in the module options"));
@@ -416192,14 +416230,14 @@ var require_static = /* @__PURE__ */ __commonJSMin(((exports, module) => {
416192
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"));
416193
416231
  else if (opts.specification.path) {
416194
416232
  if (typeof opts.specification.path !== "string") return done(/* @__PURE__ */ new Error("specification.path is not a string"));
416195
- if (!fs$3.existsSync(path$4.resolve(opts.specification.path))) return done(/* @__PURE__ */ new Error(`${opts.specification.path} does not exist`));
416196
- const extName = path$4.extname(opts.specification.path).toLowerCase();
416233
+ if (!fs$2.existsSync(path$3.resolve(opts.specification.path))) return done(/* @__PURE__ */ new Error(`${opts.specification.path} does not exist`));
416234
+ const extName = path$3.extname(opts.specification.path).toLowerCase();
416197
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']"));
416198
416236
  if (opts.specification.postProcessor && typeof opts.specification.postProcessor !== "function") return done(/* @__PURE__ */ new Error("specification.postProcessor should be a function"));
416199
416237
  if (opts.specification.baseDir && typeof opts.specification.baseDir !== "string") return done(/* @__PURE__ */ new Error("specification.baseDir should be string"));
416200
- if (!opts.specification.baseDir) opts.specification.baseDir = path$4.resolve(path$4.dirname(opts.specification.path));
416238
+ if (!opts.specification.baseDir) opts.specification.baseDir = path$3.resolve(path$3.dirname(opts.specification.path));
416201
416239
  else while (opts.specification.baseDir.endsWith("/")) opts.specification.baseDir = opts.specification.baseDir.slice(0, -1);
416202
- const source = fs$3.readFileSync(path$4.resolve(opts.specification.path), "utf8");
416240
+ const source = fs$2.readFileSync(path$3.resolve(opts.specification.path), "utf8");
416203
416241
  switch (extName) {
416204
416242
  case ".yaml":
416205
416243
  swaggerObject = yaml.parse(source);
@@ -416466,11 +416504,11 @@ var require_should_route_hide = /* @__PURE__ */ __commonJSMin(((exports, module)
416466
416504
  //#endregion
416467
416505
  //#region ../../node_modules/.pnpm/@fastify+swagger@9.7.0/node_modules/@fastify/swagger/lib/util/read-package-json.js
416468
416506
  var require_read_package_json = /* @__PURE__ */ __commonJSMin(((exports, module) => {
416469
- const fs$2 = __require("node:fs");
416470
- const path$3 = __require("node:path");
416507
+ const fs$1 = __require("node:fs");
416508
+ const path$2 = __require("node:path");
416471
416509
  function readPackageJson() {
416472
416510
  try {
416473
- return JSON.parse(fs$2.readFileSync(path$3.join(__dirname, "..", "..", "package.json")));
416511
+ return JSON.parse(fs$1.readFileSync(path$2.join(__dirname, "..", "..", "package.json")));
416474
416512
  } catch {
416475
416513
  return {};
416476
416514
  }
@@ -432461,9 +432499,9 @@ var TUI = class TUI extends Container {
432461
432499
  const debugRedraw = process.env["PI_DEBUG_REDRAW"] === "1";
432462
432500
  const logRedraw = (reason) => {
432463
432501
  if (!debugRedraw) return;
432464
- const logPath = path$18.join(nodeOs.homedir(), ".pi", "agent", "pi-debug.log");
432502
+ const logPath = path$17.join(nodeOs.homedir(), ".pi", "agent", "pi-debug.log");
432465
432503
  const msg = `[${(/* @__PURE__ */ new Date()).toISOString()}] fullRender: ${reason} (prev=${this.previousLines.length}, new=${newLines.length}, height=${height})\n`;
432466
- fs$18.appendFileSync(logPath, msg);
432504
+ fs$17.appendFileSync(logPath, msg);
432467
432505
  };
432468
432506
  if (this.previousLines.length === 0 && !widthChanged && !heightChanged) {
432469
432507
  logRedraw("first render");
@@ -432610,8 +432648,8 @@ var TUI = class TUI extends Container {
432610
432648
  buffer += "\x1B[?2026l";
432611
432649
  if (process.env["PI_TUI_DEBUG"] === "1") {
432612
432650
  const debugDir = "/tmp/tui";
432613
- fs$18.mkdirSync(debugDir, { recursive: true });
432614
- const debugPath = path$18.join(debugDir, `render-${Date.now()}-${Math.random().toString(36).slice(2)}.log`);
432651
+ fs$17.mkdirSync(debugDir, { recursive: true });
432652
+ const debugPath = path$17.join(debugDir, `render-${Date.now()}-${Math.random().toString(36).slice(2)}.log`);
432615
432653
  const debugData = [
432616
432654
  `firstChanged: ${firstChanged}`,
432617
432655
  `viewportTop: ${viewportTop}`,
@@ -432634,7 +432672,7 @@ var TUI = class TUI extends Container {
432634
432672
  "=== buffer ===",
432635
432673
  JSON.stringify(buffer)
432636
432674
  ].join("\n");
432637
- fs$18.writeFileSync(debugPath, debugData);
432675
+ fs$17.writeFileSync(debugPath, debugData);
432638
432676
  }
432639
432677
  this.terminal.write(buffer);
432640
432678
  this.cursorRow = Math.max(0, newLines.length - 1);
@@ -437220,12 +437258,12 @@ function loadNativeModifiersHelper() {
437220
437258
  if (process.platform !== "darwin") return void 0;
437221
437259
  const arch = process.arch;
437222
437260
  if (arch !== "x64" && arch !== "arm64") return void 0;
437223
- const moduleDir = path$18.dirname(fileURLToPath(import.meta.url));
437224
- const nativePath = path$18.join("native", "darwin", "prebuilds", `darwin-${arch}`, "darwin-modifiers.node");
437261
+ const moduleDir = path$17.dirname(fileURLToPath(import.meta.url));
437262
+ const nativePath = path$17.join("native", "darwin", "prebuilds", `darwin-${arch}`, "darwin-modifiers.node");
437225
437263
  const candidates = [
437226
- path$18.join(moduleDir, "..", nativePath),
437227
- path$18.join(moduleDir, nativePath),
437228
- path$18.join(path$18.dirname(process.execPath), nativePath)
437264
+ path$17.join(moduleDir, "..", nativePath),
437265
+ path$17.join(moduleDir, nativePath),
437266
+ path$17.join(path$17.dirname(process.execPath), nativePath)
437229
437267
  ];
437230
437268
  for (const modulePath of candidates) try {
437231
437269
  const helper = cjsRequire$1(modulePath);
@@ -437298,10 +437336,10 @@ var ProcessTerminal = class {
437298
437336
  const env = process.env["PI_TUI_WRITE_LOG"] || "";
437299
437337
  if (!env) return "";
437300
437338
  try {
437301
- if (fs$18.statSync(env).isDirectory()) {
437339
+ if (fs$17.statSync(env).isDirectory()) {
437302
437340
  const now = /* @__PURE__ */ new Date();
437303
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")}`;
437304
- return path$18.join(env, `tui-${ts}-${process.pid}.log`);
437342
+ return path$17.join(env, `tui-${ts}-${process.pid}.log`);
437305
437343
  }
437306
437344
  } catch {}
437307
437345
  return env;
@@ -437504,12 +437542,12 @@ var ProcessTerminal = class {
437504
437542
  try {
437505
437543
  const arch = process.arch;
437506
437544
  if (arch !== "x64" && arch !== "arm64") return;
437507
- const moduleDir = path$18.dirname(fileURLToPath(import.meta.url));
437508
- const nativePath = path$18.join("native", "win32", "prebuilds", `win32-${arch}`, "win32-console-mode.node");
437545
+ const moduleDir = path$17.dirname(fileURLToPath(import.meta.url));
437546
+ const nativePath = path$17.join("native", "win32", "prebuilds", `win32-${arch}`, "win32-console-mode.node");
437509
437547
  const candidates = [
437510
- path$18.join(moduleDir, "..", nativePath),
437511
- path$18.join(moduleDir, nativePath),
437512
- path$18.join(path$18.dirname(process.execPath), nativePath)
437548
+ path$17.join(moduleDir, "..", nativePath),
437549
+ path$17.join(moduleDir, nativePath),
437550
+ path$17.join(path$17.dirname(process.execPath), nativePath)
437513
437551
  ];
437514
437552
  for (const modulePath of candidates) try {
437515
437553
  cjsRequire(modulePath).enableVirtualTerminalInput?.();
@@ -437581,7 +437619,7 @@ var ProcessTerminal = class {
437581
437619
  write(data) {
437582
437620
  process.stdout.write(data);
437583
437621
  if (this.writeLogPath) try {
437584
- fs$18.appendFileSync(this.writeLogPath, data, { encoding: "utf8" });
437622
+ fs$17.appendFileSync(this.writeLogPath, data, { encoding: "utf8" });
437585
437623
  } catch {}
437586
437624
  }
437587
437625
  get columns() {
@@ -525792,7 +525830,8 @@ var QuestionDialogComponent = class extends Container {
525792
525830
  this.cursors[questionIdx] = optionIdx;
525793
525831
  this.editingOther = false;
525794
525832
  this.reviewMessage = void 0;
525795
- if (this.isOtherOption(questionIdx, optionIdx)) {
525833
+ const togglingCommittedOther = question.multi_select && method === "space" && this.committedOtherValues[questionIdx] !== void 0;
525834
+ if (this.isOtherOption(questionIdx, optionIdx) && !togglingCommittedOther) {
525796
525835
  this.enterOtherInput(questionIdx);
525797
525836
  return;
525798
525837
  }
@@ -545452,13 +545491,13 @@ var BlunTUI = class {
545452
545491
  //#endregion
545453
545492
  //#region src/constant/update.ts
545454
545493
  var import_runtime_exit_ledger = (/* @__PURE__ */ __commonJSMin(((exports, module) => {
545455
- const fs$1 = __require("node:fs");
545494
+ const fs = __require("node:fs");
545456
545495
  const os$1 = __require("node:os");
545457
- const path$2 = __require("node:path");
545496
+ const path$1 = __require("node:path");
545458
545497
  const DEFAULT_MAX_BYTES = 1024 * 1024;
545459
545498
  const DEFAULT_RETAIN_BYTES = 512 * 1024;
545460
545499
  function runtimeExitLedgerPath(homeDir) {
545461
- return path$2.join(homeDir, "diagnostics", "runtime-exits.jsonl");
545500
+ return path$1.join(homeDir, "diagnostics", "runtime-exits.jsonl");
545462
545501
  }
545463
545502
  function sanitizeExitText(input, maxChars = 2048) {
545464
545503
  let value = String(input ?? "");
@@ -545467,7 +545506,7 @@ var import_runtime_exit_ledger = (/* @__PURE__ */ __commonJSMin(((exports, modul
545467
545506
  process.env.USERPROFILE,
545468
545507
  process.env.HOME
545469
545508
  ].filter((entry) => typeof entry === "string" && entry.length > 2));
545470
- for (const home of homes) for (const variant of [path$2.normalize(home), home.replaceAll("\\", "/")]) {
545509
+ for (const home of homes) for (const variant of [path$1.normalize(home), home.replaceAll("\\", "/")]) {
545471
545510
  const escaped = variant.replace(/[.*+?^${}()|[\]\\]/gu, "\\$&");
545472
545511
  value = value.replace(new RegExp(escaped, process.platform === "win32" ? "giu" : "gu"), "$HOME");
545473
545512
  }
@@ -545506,7 +545545,7 @@ var import_runtime_exit_ledger = (/* @__PURE__ */ __commonJSMin(((exports, modul
545506
545545
  return record;
545507
545546
  }
545508
545547
  function directoryIdentity(directory) {
545509
- const stat = fs$1.lstatSync(directory, { bigint: true });
545548
+ const stat = fs.lstatSync(directory, { bigint: true });
545510
545549
  if (!stat.isDirectory() || stat.isSymbolicLink()) throw new Error("Unsafe exit directory");
545511
545550
  return stat;
545512
545551
  }
@@ -545518,46 +545557,46 @@ var import_runtime_exit_ledger = (/* @__PURE__ */ __commonJSMin(((exports, modul
545518
545557
  return stat;
545519
545558
  }
545520
545559
  function trimLedger(descriptor, maxBytes, retainBytes, incomingBytes) {
545521
- const size = Number(regularLedger(fs$1.fstatSync(descriptor, { bigint: true })).size);
545560
+ const size = Number(regularLedger(fs.fstatSync(descriptor, { bigint: true })).size);
545522
545561
  if (!Number.isSafeInteger(size)) throw new Error("Invalid exit ledger size");
545523
545562
  if (size + incomingBytes <= maxBytes) return;
545524
545563
  const keepBytes = Math.max(0, Math.min(size, retainBytes, maxBytes - incomingBytes));
545525
545564
  const contents = Buffer.alloc(keepBytes);
545526
- const read = fs$1.readSync(descriptor, contents, 0, keepBytes, size - keepBytes);
545565
+ const read = fs.readSync(descriptor, contents, 0, keepBytes, size - keepBytes);
545527
545566
  const tail = contents.subarray(0, read);
545528
545567
  const lineStart = size > keepBytes ? tail.indexOf(10) + 1 : 0;
545529
- fs$1.ftruncateSync(descriptor, 0);
545530
- fs$1.writeFileSync(descriptor, lineStart > 0 || size === keepBytes ? tail.subarray(lineStart) : "");
545568
+ fs.ftruncateSync(descriptor, 0);
545569
+ fs.writeFileSync(descriptor, lineStart > 0 || size === keepBytes ? tail.subarray(lineStart) : "");
545531
545570
  }
545532
545571
  function recordRuntimeExit(input = {}) {
545533
545572
  let descriptor;
545534
545573
  let appendDescriptor;
545535
545574
  try {
545536
545575
  const homeDir = typeof input.homeDir === "string" ? input.homeDir.trim() : "";
545537
- if (!homeDir || !path$2.isAbsolute(homeDir)) return false;
545538
- fs$1.mkdirSync(homeDir, {
545576
+ if (!homeDir || !path$1.isAbsolute(homeDir)) return false;
545577
+ fs.mkdirSync(homeDir, {
545539
545578
  recursive: true,
545540
545579
  mode: 448
545541
545580
  });
545542
545581
  const homeIdentity = directoryIdentity(homeDir);
545543
545582
  const file = runtimeExitLedgerPath(homeDir);
545544
- const directory = path$2.dirname(file);
545583
+ const directory = path$1.dirname(file);
545545
545584
  try {
545546
- fs$1.mkdirSync(directory, { mode: 448 });
545585
+ fs.mkdirSync(directory, { mode: 448 });
545547
545586
  } catch (error) {
545548
545587
  if (error.code !== "EEXIST") throw error;
545549
545588
  }
545550
545589
  const directoryStat = directoryIdentity(directory);
545551
545590
  let before;
545552
545591
  try {
545553
- before = regularLedger(fs$1.lstatSync(file, { bigint: true }));
545592
+ before = regularLedger(fs.lstatSync(file, { bigint: true }));
545554
545593
  } catch (error) {
545555
545594
  if (error.code !== "ENOENT") throw error;
545556
545595
  }
545557
- 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);
545558
- descriptor = fs$1.openSync(file, flags, 384);
545559
- const opened = regularLedger(fs$1.fstatSync(descriptor, { bigint: true }));
545560
- 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");
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");
545561
545600
  const maxBytes = Math.max(1024, Number.isInteger(input.maxBytes) ? input.maxBytes : DEFAULT_MAX_BYTES);
545562
545601
  const retainBytes = Math.max(0, Number.isInteger(input.retainBytes) ? input.retainBytes : DEFAULT_RETAIN_BYTES);
545563
545602
  const record = buildRuntimeExitRecord(input);
@@ -545580,21 +545619,21 @@ var import_runtime_exit_ledger = (/* @__PURE__ */ __commonJSMin(((exports, modul
545580
545619
  line = `${JSON.stringify(record)}\n`;
545581
545620
  }
545582
545621
  trimLedger(descriptor, maxBytes, retainBytes, Buffer.byteLength(line));
545583
- 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));
545584
- 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");
545585
- fs$1.appendFileSync(appendDescriptor, line, { encoding: "utf8" });
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" });
545586
545625
  try {
545587
- fs$1.fchmodSync(descriptor, 384);
545626
+ fs.fchmodSync(descriptor, 384);
545588
545627
  } catch {}
545589
545628
  return true;
545590
545629
  } catch {
545591
545630
  return false;
545592
545631
  } finally {
545593
545632
  if (appendDescriptor !== void 0) try {
545594
- fs$1.closeSync(appendDescriptor);
545633
+ fs.closeSync(appendDescriptor);
545595
545634
  } catch {}
545596
545635
  if (descriptor !== void 0) try {
545597
- fs$1.closeSync(descriptor);
545636
+ fs.closeSync(descriptor);
545598
545637
  } catch {}
545599
545638
  }
545600
545639
  }