blun-king-cli 9.1.20 → 9.1.21

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,22 +1,22 @@
1
1
  #!/usr/bin/env node
2
- // BLUN_BUILD_INPUT_SHA256:174c2b539d18926415abba5d8148da0982699f4c5f397fc12a30c3d6718ac8ea
2
+ // BLUN_BUILD_INPUT_SHA256:18b6ba1c5baca9739e0e2b5c280d073bac714589178a987d0bc9fd63d56020f0
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$16 from "node:fs";
9
+ import * as fs$17 from "node:fs";
10
10
  import Kt, { accessSync, appendFileSync, chmodSync, closeSync, constants, copyFileSync, createReadStream, createWriteStream, existsSync, fsyncSync, linkSync, lstatSync, mkdirSync, openSync, promises, readFileSync, readSync, readdirSync, realpathSync, renameSync, rmSync, statSync, unlinkSync, writeFileSync, writeSync } from "node:fs";
11
- import * as path$16 from "node:path";
11
+ import * as path$17 from "node:path";
12
12
  import path, { basename, dirname, extname, isAbsolute, join, normalize, 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
14
  import * as nodeOs from "node:os";
15
15
  import os, { arch, homedir, hostname, networkInterfaces, platform, release, tmpdir, type, userInfo } from "node:os";
16
- import ro, { access, appendFile, chmod, constants as constants$1, copyFile, cp, link, lstat, mkdir, mkdtemp, open, readFile, readdir, realpath, rename, rm, stat, unlink, writeFile } from "node:fs/promises";
16
+ import fs, { access, appendFile, chmod, constants as constants$1, copyFile, cp, link, lstat, mkdir, mkdtemp, open, readFile, readdir, realpath, rename, rm, stat, unlink, writeFile } from "node:fs/promises";
17
17
  import { execFile, execFileSync, execSync, spawn, spawnSync } from "node:child_process";
18
18
  import * as sysPath from "path";
19
- import js, { basename as basename$1, dirname as dirname$1, join as join$1, parse } from "path";
19
+ import path$1, { basename as basename$1, dirname as dirname$1, join as join$1, parse } from "path";
20
20
  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";
21
21
  import { Readable } from "stream";
22
22
  import zi from "assert";
@@ -2072,11 +2072,11 @@ var init_blun_files = __esmMin((() => {
2072
2072
  async uploadVideo(input, options) {
2073
2073
  let file;
2074
2074
  if (typeof input === "string") {
2075
- if (!fs$16.existsSync(input)) throw new ChatProviderError(`Video file not found: ${input}`);
2076
- const filename = path$16.basename(input);
2075
+ if (!fs$17.existsSync(input)) throw new ChatProviderError(`Video file not found: ${input}`);
2076
+ const filename = path$17.basename(input);
2077
2077
  const mimeType = guessMimeTypeFromExt(filename);
2078
2078
  if (mimeType === void 0 || !mimeType.startsWith("video/")) throw new ChatProviderError(`BlunFiles.uploadVideo: file extension does not indicate a video type: ${filename}`);
2079
- const data = await fs$16.promises.readFile(input);
2079
+ const data = await fs$17.promises.readFile(input);
2080
2080
  file = new File$1([new Blob$1([new Uint8Array(data)], { type: mimeType })], filename, { type: mimeType });
2081
2081
  } else {
2082
2082
  if (!input.mimeType.startsWith("video/")) throw new ChatProviderError(`Expected a video mime type, got ${input.mimeType}`);
@@ -11425,7 +11425,7 @@ var require_clone$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
11425
11425
  //#endregion
11426
11426
  //#region ../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/graceful-fs.js
11427
11427
  var require_graceful_fs = /* @__PURE__ */ __commonJSMin(((exports, module) => {
11428
- var fs$15 = __require("fs");
11428
+ var fs$16 = __require("fs");
11429
11429
  var polyfills = require_polyfills();
11430
11430
  var legacy = require_legacy_streams();
11431
11431
  var clone = require_clone$1();
@@ -11454,36 +11454,36 @@ var require_graceful_fs = /* @__PURE__ */ __commonJSMin(((exports, module) => {
11454
11454
  m = "GFS4: " + m.split(/\n/).join("\nGFS4: ");
11455
11455
  console.error(m);
11456
11456
  };
11457
- if (!fs$15[gracefulQueue]) {
11458
- publishQueue(fs$15, global[gracefulQueue] || []);
11459
- fs$15.close = (function(fs$close) {
11457
+ if (!fs$16[gracefulQueue]) {
11458
+ publishQueue(fs$16, global[gracefulQueue] || []);
11459
+ fs$16.close = (function(fs$close) {
11460
11460
  function close(fd, cb) {
11461
- return fs$close.call(fs$15, fd, function(err) {
11461
+ return fs$close.call(fs$16, fd, function(err) {
11462
11462
  if (!err) resetQueue();
11463
11463
  if (typeof cb === "function") cb.apply(this, arguments);
11464
11464
  });
11465
11465
  }
11466
11466
  Object.defineProperty(close, previousSymbol, { value: fs$close });
11467
11467
  return close;
11468
- })(fs$15.close);
11469
- fs$15.closeSync = (function(fs$closeSync) {
11468
+ })(fs$16.close);
11469
+ fs$16.closeSync = (function(fs$closeSync) {
11470
11470
  function closeSync(fd) {
11471
- fs$closeSync.apply(fs$15, arguments);
11471
+ fs$closeSync.apply(fs$16, arguments);
11472
11472
  resetQueue();
11473
11473
  }
11474
11474
  Object.defineProperty(closeSync, previousSymbol, { value: fs$closeSync });
11475
11475
  return closeSync;
11476
- })(fs$15.closeSync);
11476
+ })(fs$16.closeSync);
11477
11477
  if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) process.on("exit", function() {
11478
- debug(fs$15[gracefulQueue]);
11479
- __require("assert").equal(fs$15[gracefulQueue].length, 0);
11478
+ debug(fs$16[gracefulQueue]);
11479
+ __require("assert").equal(fs$16[gracefulQueue].length, 0);
11480
11480
  });
11481
11481
  }
11482
- if (!global[gracefulQueue]) publishQueue(global, fs$15[gracefulQueue]);
11483
- module.exports = patch(clone(fs$15));
11484
- if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs$15.__patched) {
11485
- module.exports = patch(fs$15);
11486
- fs$15.__patched = true;
11482
+ if (!global[gracefulQueue]) publishQueue(global, fs$16[gracefulQueue]);
11483
+ module.exports = patch(clone(fs$16));
11484
+ if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs$16.__patched) {
11485
+ module.exports = patch(fs$16);
11486
+ fs$16.__patched = true;
11487
11487
  }
11488
11488
  function patch(fs) {
11489
11489
  polyfills(fs);
@@ -11738,23 +11738,23 @@ var require_graceful_fs = /* @__PURE__ */ __commonJSMin(((exports, module) => {
11738
11738
  }
11739
11739
  function enqueue(elem) {
11740
11740
  debug("ENQUEUE", elem[0].name, elem[1]);
11741
- fs$15[gracefulQueue].push(elem);
11741
+ fs$16[gracefulQueue].push(elem);
11742
11742
  retry();
11743
11743
  }
11744
11744
  var retryTimer;
11745
11745
  function resetQueue() {
11746
11746
  var now = Date.now();
11747
- for (var i = 0; i < fs$15[gracefulQueue].length; ++i) if (fs$15[gracefulQueue][i].length > 2) {
11748
- fs$15[gracefulQueue][i][3] = now;
11749
- fs$15[gracefulQueue][i][4] = now;
11747
+ for (var i = 0; i < fs$16[gracefulQueue].length; ++i) if (fs$16[gracefulQueue][i].length > 2) {
11748
+ fs$16[gracefulQueue][i][3] = now;
11749
+ fs$16[gracefulQueue][i][4] = now;
11750
11750
  }
11751
11751
  retry();
11752
11752
  }
11753
11753
  function retry() {
11754
11754
  clearTimeout(retryTimer);
11755
11755
  retryTimer = void 0;
11756
- if (fs$15[gracefulQueue].length === 0) return;
11757
- var elem = fs$15[gracefulQueue].shift();
11756
+ if (fs$16[gracefulQueue].length === 0) return;
11757
+ var elem = fs$16[gracefulQueue].shift();
11758
11758
  var fn = elem[0];
11759
11759
  var args = elem[1];
11760
11760
  var err = elem[2];
@@ -11773,7 +11773,7 @@ var require_graceful_fs = /* @__PURE__ */ __commonJSMin(((exports, module) => {
11773
11773
  if (sinceAttempt >= Math.min(sinceStart * 1.2, 100)) {
11774
11774
  debug("RETRY", fn.name, args);
11775
11775
  fn.apply(null, args.concat([startTime]));
11776
- } else fs$15[gracefulQueue].push(elem);
11776
+ } else fs$16[gracefulQueue].push(elem);
11777
11777
  }
11778
11778
  if (retryTimer === void 0) retryTimer = setTimeout(retry, 0);
11779
11779
  }
@@ -12125,7 +12125,7 @@ var require_mtime_precision = /* @__PURE__ */ __commonJSMin(((exports, module) =
12125
12125
  //#endregion
12126
12126
  //#region ../../node_modules/.pnpm/proper-lockfile@4.1.2/node_modules/proper-lockfile/lib/lockfile.js
12127
12127
  var require_lockfile = /* @__PURE__ */ __commonJSMin(((exports, module) => {
12128
- const path$15 = __require("path");
12128
+ const path$16 = __require("path");
12129
12129
  const fs = require_graceful_fs();
12130
12130
  const retry = require_retry$3();
12131
12131
  const onExit = require_signal_exit();
@@ -12135,7 +12135,7 @@ var require_lockfile = /* @__PURE__ */ __commonJSMin(((exports, module) => {
12135
12135
  return options.lockfilePath || `${file}.lock`;
12136
12136
  }
12137
12137
  function resolveCanonicalPath(file, options, callback) {
12138
- if (!options.realpath) return callback(null, path$15.resolve(file));
12138
+ if (!options.realpath) return callback(null, path$16.resolve(file));
12139
12139
  options.fs.realpath(file, callback);
12140
12140
  }
12141
12141
  function acquireLock(file, options, callback) {
@@ -14374,6 +14374,14 @@ function providerModelsEqual(config, nextConfig, providerId, aliasKeys) {
14374
14374
  function providerConfigEqual(config, nextConfig, providerId) {
14375
14375
  return JSON.stringify(config.providers[providerId] ?? null) === JSON.stringify(nextConfig.providers[providerId] ?? null);
14376
14376
  }
14377
+ function managedServicesEqual(config, nextConfig) {
14378
+ const snapshot = (candidate) => JSON.stringify({
14379
+ blunSearch: candidate.services?.blunSearch ?? null,
14380
+ blunFetch: candidate.services?.blunFetch ?? null,
14381
+ blunMedia: candidate.services?.blunMedia ?? null
14382
+ });
14383
+ return snapshot(config) === snapshot(nextConfig);
14384
+ }
14377
14385
  async function refreshProviderModels(host, options = {}) {
14378
14386
  const changed = [];
14379
14387
  const unchanged = [];
@@ -14421,7 +14429,7 @@ async function refreshProviderModels(host, options = {}) {
14421
14429
  });
14422
14430
  const refreshedAliasKeys = providerAliasKeys(config, BLUN_PROVIDER_NAME$1);
14423
14431
  for (const alias of providerAliasKeys(next, BLUN_PROVIDER_NAME$1)) refreshedAliasKeys.add(alias);
14424
- if (providerModelsEqual(config, next, "managed:blun", refreshedAliasKeys) && config.defaultModel === next.defaultModel) unchanged.push(BLUN_PROVIDER_NAME$1);
14432
+ if (providerModelsEqual(config, next, "managed:blun", refreshedAliasKeys) && config.defaultModel === next.defaultModel && managedServicesEqual(config, next)) unchanged.push(BLUN_PROVIDER_NAME$1);
14425
14433
  else {
14426
14434
  const { added, removed } = computeChanges(collectModelIdsForAliases(config, refreshedAliasKeys), collectModelIdsForAliases(next, refreshedAliasKeys));
14427
14435
  await host.removeProvider(BLUN_PROVIDER_NAME$1);
@@ -14429,7 +14437,8 @@ async function refreshProviderModels(host, options = {}) {
14429
14437
  providers: next.providers,
14430
14438
  models: next.models,
14431
14439
  defaultModel: next.defaultModel,
14432
- thinking: next.thinking
14440
+ thinking: next.thinking,
14441
+ services: next.services
14433
14442
  });
14434
14443
  changed.push({
14435
14444
  providerId: BLUN_PROVIDER_NAME$1,
@@ -14600,7 +14609,7 @@ async function syncDir(dirPath) {
14600
14609
  */
14601
14610
  function syncFd(fd) {
14602
14611
  return new Promise((resolve, reject) => {
14603
- fs$16.fsync(fd, (err) => {
14612
+ fs$17.fsync(fd, (err) => {
14604
14613
  if (err) {
14605
14614
  reject(err);
14606
14615
  return;
@@ -25113,7 +25122,7 @@ var require_loader = /* @__PURE__ */ __commonJSMin(((exports, module) => {
25113
25122
  };
25114
25123
  return _setPrototypeOf(o, p);
25115
25124
  }
25116
- var path$14 = __require("path");
25125
+ var path$15 = __require("path");
25117
25126
  module.exports = /* @__PURE__ */ function(_EmitterObj) {
25118
25127
  _inheritsLoose(Loader, _EmitterObj);
25119
25128
  function Loader() {
@@ -25121,7 +25130,7 @@ var require_loader = /* @__PURE__ */ __commonJSMin(((exports, module) => {
25121
25130
  }
25122
25131
  var _proto = Loader.prototype;
25123
25132
  _proto.resolve = function resolve(from, to) {
25124
- return path$14.resolve(path$14.dirname(from), to);
25133
+ return path$15.resolve(path$15.dirname(from), to);
25125
25134
  };
25126
25135
  _proto.isRelative = function isRelative(filename) {
25127
25136
  return filename.indexOf("./") === 0 || filename.indexOf("../") === 0;
@@ -26777,8 +26786,8 @@ var require_node_loaders = /* @__PURE__ */ __commonJSMin(((exports, module) => {
26777
26786
  };
26778
26787
  return _setPrototypeOf(o, p);
26779
26788
  }
26780
- var fs$14 = __require("fs");
26781
- var path$13 = __require("path");
26789
+ var fs$15 = __require("fs");
26790
+ var path$14 = __require("path");
26782
26791
  var Loader = require_loader();
26783
26792
  var PrecompiledLoader = require_precompiled_loader().PrecompiledLoader;
26784
26793
  var chokidar;
@@ -26793,7 +26802,7 @@ var require_node_loaders = /* @__PURE__ */ __commonJSMin(((exports, module) => {
26793
26802
  _this.noCache = !!opts.noCache;
26794
26803
  if (searchPaths) {
26795
26804
  searchPaths = Array.isArray(searchPaths) ? searchPaths : [searchPaths];
26796
- _this.searchPaths = searchPaths.map(path$13.normalize);
26805
+ _this.searchPaths = searchPaths.map(path$14.normalize);
26797
26806
  } else _this.searchPaths = ["."];
26798
26807
  if (opts.watch) {
26799
26808
  try {
@@ -26801,10 +26810,10 @@ var require_node_loaders = /* @__PURE__ */ __commonJSMin(((exports, module) => {
26801
26810
  } catch (e) {
26802
26811
  throw new Error("watch requires chokidar to be installed");
26803
26812
  }
26804
- var paths = _this.searchPaths.filter(fs$14.existsSync);
26813
+ var paths = _this.searchPaths.filter(fs$15.existsSync);
26805
26814
  var watcher = chokidar.watch(paths);
26806
26815
  watcher.on("all", function(event, fullname) {
26807
- fullname = path$13.resolve(fullname);
26816
+ fullname = path$14.resolve(fullname);
26808
26817
  if (event === "change" && fullname in _this.pathsToNames) _this.emit("update", _this.pathsToNames[fullname], fullname);
26809
26818
  });
26810
26819
  watcher.on("error", function(error) {
@@ -26818,9 +26827,9 @@ var require_node_loaders = /* @__PURE__ */ __commonJSMin(((exports, module) => {
26818
26827
  var fullpath = null;
26819
26828
  var paths = this.searchPaths;
26820
26829
  for (var i = 0; i < paths.length; i++) {
26821
- var basePath = path$13.resolve(paths[i]);
26822
- var p = path$13.resolve(paths[i], name);
26823
- if (p.indexOf(basePath) === 0 && fs$14.existsSync(p)) {
26830
+ var basePath = path$14.resolve(paths[i]);
26831
+ var p = path$14.resolve(paths[i], name);
26832
+ if (p.indexOf(basePath) === 0 && fs$15.existsSync(p)) {
26824
26833
  fullpath = p;
26825
26834
  break;
26826
26835
  }
@@ -26828,7 +26837,7 @@ var require_node_loaders = /* @__PURE__ */ __commonJSMin(((exports, module) => {
26828
26837
  if (!fullpath) return null;
26829
26838
  this.pathsToNames[fullpath] = name;
26830
26839
  var source = {
26831
- src: fs$14.readFileSync(fullpath, "utf-8"),
26840
+ src: fs$15.readFileSync(fullpath, "utf-8"),
26832
26841
  path: fullpath,
26833
26842
  noCache: this.noCache
26834
26843
  };
@@ -26876,7 +26885,7 @@ var require_node_loaders = /* @__PURE__ */ __commonJSMin(((exports, module) => {
26876
26885
  }
26877
26886
  this.pathsToNames[fullpath] = name;
26878
26887
  var source = {
26879
- src: fs$14.readFileSync(fullpath, "utf-8"),
26888
+ src: fs$15.readFileSync(fullpath, "utf-8"),
26880
26889
  path: fullpath,
26881
26890
  noCache: this.noCache
26882
26891
  };
@@ -27178,13 +27187,13 @@ var require_globals = /* @__PURE__ */ __commonJSMin(((exports, module) => {
27178
27187
  //#endregion
27179
27188
  //#region ../../node_modules/.pnpm/nunjucks@3.2.4_chokidar@4.0.3/node_modules/nunjucks/src/express-app.js
27180
27189
  var require_express_app = /* @__PURE__ */ __commonJSMin(((exports, module) => {
27181
- var path$12 = __require("path");
27190
+ var path$13 = __require("path");
27182
27191
  module.exports = function express(env, app) {
27183
27192
  function NunjucksView(name, opts) {
27184
27193
  this.name = name;
27185
27194
  this.path = name;
27186
27195
  this.defaultEngine = opts.defaultEngine;
27187
- this.ext = path$12.extname(name);
27196
+ this.ext = path$13.extname(name);
27188
27197
  if (!this.ext && !this.defaultEngine) throw new Error("No default engine was specified and no extension was provided.");
27189
27198
  if (!this.ext) this.name += this.ext = (this.defaultEngine[0] !== "." ? "." : "") + this.defaultEngine;
27190
27199
  }
@@ -27620,8 +27629,8 @@ var require_precompile_global = /* @__PURE__ */ __commonJSMin(((exports, module)
27620
27629
  //#endregion
27621
27630
  //#region ../../node_modules/.pnpm/nunjucks@3.2.4_chokidar@4.0.3/node_modules/nunjucks/src/precompile.js
27622
27631
  var require_precompile = /* @__PURE__ */ __commonJSMin(((exports, module) => {
27623
- var fs$13 = __require("fs");
27624
- var path$11 = __require("path");
27632
+ var fs$14 = __require("fs");
27633
+ var path$12 = __require("path");
27625
27634
  var _prettifyError = require_lib$7()._prettifyError;
27626
27635
  var compiler = require_compiler();
27627
27636
  var Environment = require_environment().Environment;
@@ -27645,27 +27654,27 @@ var require_precompile = /* @__PURE__ */ __commonJSMin(((exports, module) => {
27645
27654
  var env = opts.env || new Environment([]);
27646
27655
  var wrapper = opts.wrapper || precompileGlobal;
27647
27656
  if (opts.isString) return precompileString(input, opts);
27648
- var pathStats = fs$13.existsSync(input) && fs$13.statSync(input);
27657
+ var pathStats = fs$14.existsSync(input) && fs$14.statSync(input);
27649
27658
  var precompiled = [];
27650
27659
  var templates = [];
27651
27660
  function addTemplates(dir) {
27652
- fs$13.readdirSync(dir).forEach(function(file) {
27653
- var filepath = path$11.join(dir, file);
27654
- var subpath = filepath.substr(path$11.join(input, "/").length);
27655
- var stat = fs$13.statSync(filepath);
27661
+ fs$14.readdirSync(dir).forEach(function(file) {
27662
+ var filepath = path$12.join(dir, file);
27663
+ var subpath = filepath.substr(path$12.join(input, "/").length);
27664
+ var stat = fs$14.statSync(filepath);
27656
27665
  if (stat && stat.isDirectory()) {
27657
27666
  subpath += "/";
27658
27667
  if (!match(subpath, opts.exclude)) addTemplates(filepath);
27659
27668
  } else if (match(subpath, opts.include)) templates.push(filepath);
27660
27669
  });
27661
27670
  }
27662
- if (pathStats.isFile()) precompiled.push(_precompile(fs$13.readFileSync(input, "utf-8"), opts.name || input, env));
27671
+ if (pathStats.isFile()) precompiled.push(_precompile(fs$14.readFileSync(input, "utf-8"), opts.name || input, env));
27663
27672
  else if (pathStats.isDirectory()) {
27664
27673
  addTemplates(input);
27665
27674
  for (var i = 0; i < templates.length; i++) {
27666
- var name = templates[i].replace(path$11.join(input, "/"), "");
27675
+ var name = templates[i].replace(path$12.join(input, "/"), "");
27667
27676
  try {
27668
- precompiled.push(_precompile(fs$13.readFileSync(templates[i], "utf-8"), name, env));
27677
+ precompiled.push(_precompile(fs$14.readFileSync(templates[i], "utf-8"), name, env));
27669
27678
  } catch (e) {
27670
27679
  if (opts.force) console.error(e);
27671
27680
  else throw e;
@@ -36230,7 +36239,7 @@ var require_gifframe = /* @__PURE__ */ __commonJSMin(((exports) => {
36230
36239
  //#region ../../node_modules/.pnpm/gifwrap@0.10.1/node_modules/gifwrap/src/gifutil.js
36231
36240
  var require_gifutil = /* @__PURE__ */ __commonJSMin(((exports) => {
36232
36241
  /** @namespace GifUtil */
36233
- const fs$12 = __require("fs");
36242
+ const fs$13 = __require("fs");
36234
36243
  const ImageQ = require_image_q();
36235
36244
  const BitmapImage = require_bitmapimage();
36236
36245
  const { GifFrame } = require_gifframe();
@@ -36497,7 +36506,7 @@ var require_gifutil = /* @__PURE__ */ __commonJSMin(((exports) => {
36497
36506
  }
36498
36507
  function _readBinary(path) {
36499
36508
  return new Promise((resolve, reject) => {
36500
- fs$12.readFile(path, (err, buffer) => {
36509
+ fs$13.readFile(path, (err, buffer) => {
36501
36510
  if (err) return reject(err);
36502
36511
  return resolve(buffer);
36503
36512
  });
@@ -36505,7 +36514,7 @@ var require_gifutil = /* @__PURE__ */ __commonJSMin(((exports) => {
36505
36514
  }
36506
36515
  function _writeBinary(path, buffer) {
36507
36516
  return new Promise((resolve, reject) => {
36508
- fs$12.writeFile(path, buffer, (err) => {
36517
+ fs$13.writeFile(path, buffer, (err) => {
36509
36518
  if (err) return reject(err);
36510
36519
  return resolve();
36511
36520
  });
@@ -62323,7 +62332,7 @@ var init_file_type = __esmMin((() => {
62323
62332
  }
62324
62333
  async fromFile(path) {
62325
62334
  this.options.signal?.throwIfAborted();
62326
- const fileHandle = await ro.open(path, constants.O_RDONLY | constants.O_NONBLOCK);
62335
+ const fileHandle = await fs.open(path, constants.O_RDONLY | constants.O_NONBLOCK);
62327
62336
  const fileStat = await fileHandle.stat();
62328
62337
  if (!fileStat.isFile()) {
62329
62338
  await fileHandle.close();
@@ -72828,7 +72837,7 @@ async function processBitmapFont(file, font) {
72828
72837
  ...font,
72829
72838
  chars,
72830
72839
  kernings,
72831
- pages: await Promise.all(font.pages.map(async (page) => CharacterJimp.read(js.join(js.dirname(file), page))))
72840
+ pages: await Promise.all(font.pages.map(async (page) => CharacterJimp.read(path$1.join(path$1.dirname(file), page))))
72832
72841
  };
72833
72842
  }
72834
72843
  var import_parse_bmfont_ascii, import_lib$1, import_parse_bmfont_binary, convertXML, isWebWorker, CharacterJimp, HEADER;
@@ -80680,7 +80689,7 @@ var require_buffer_from = /* @__PURE__ */ __commonJSMin(((exports, module) => {
80680
80689
  //#region ../../node_modules/.pnpm/source-map-support@0.5.21/node_modules/source-map-support/source-map-support.js
80681
80690
  var require_source_map_support = /* @__PURE__ */ __commonJSMin(((exports, module) => {
80682
80691
  var SourceMapConsumer = require_source_map().SourceMapConsumer;
80683
- var path$10 = __require("path");
80692
+ var path$11 = __require("path");
80684
80693
  var fs;
80685
80694
  try {
80686
80695
  fs = __require("fs");
@@ -80757,15 +80766,15 @@ var require_source_map_support = /* @__PURE__ */ __commonJSMin(((exports, module
80757
80766
  });
80758
80767
  function supportRelativeURL(file, url) {
80759
80768
  if (!file) return url;
80760
- var dir = path$10.dirname(file);
80769
+ var dir = path$11.dirname(file);
80761
80770
  var match = /^\w+:\/\/[^\/]*/.exec(dir);
80762
80771
  var protocol = match ? match[0] : "";
80763
80772
  var startPath = dir.slice(protocol.length);
80764
80773
  if (protocol && /^\/\w\:/.test(startPath)) {
80765
80774
  protocol += "/";
80766
- return protocol + path$10.resolve(dir.slice(protocol.length), url).replace(/\\/g, "/");
80775
+ return protocol + path$11.resolve(dir.slice(protocol.length), url).replace(/\\/g, "/");
80767
80776
  }
80768
- return protocol + path$10.resolve(dir.slice(protocol.length), url);
80777
+ return protocol + path$11.resolve(dir.slice(protocol.length), url);
80769
80778
  }
80770
80779
  function retrieveSourceMapURL(source) {
80771
80780
  var fileData;
@@ -252324,7 +252333,7 @@ function Yn(s, t) {
252324
252333
  function Kn(s, t) {
252325
252334
  s.head = new ue$1(t, void 0, s.head, s), s.tail || (s.tail = s.head), s.length++;
252326
252335
  }
252327
- 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$6, 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$11, 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;
252336
+ 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$6, 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;
252328
252337
  var init_index_min = __esmMin((() => {
252329
252338
  zr = Object.defineProperty;
252330
252339
  Ur = (s, t) => {
@@ -253852,7 +253861,7 @@ while (this[Zs](this[st$1].shift()));
253852
253861
  let [o, h] = ce$1(this.path);
253853
253862
  o && typeof h == "string" && (this.path = h, r = o);
253854
253863
  }
253855
- 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`, {
253864
+ 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`, {
253856
253865
  entry: this,
253857
253866
  path: r + this.path
253858
253867
  });
@@ -253935,7 +253944,7 @@ while (this[Zs](this[st$1].shift()));
253935
253944
  }
253936
253945
  [sr](t) {
253937
253946
  if (!this.stat) throw new Error("cannot create link entry without stat");
253938
- this.type = "Link", this.linkpath = f(js.relative(this.cwd, t)), this.stat.size = 0, this[fe$1](), this.end();
253947
+ this.type = "Link", this.linkpath = f(path$1.relative(this.cwd, t)), this.stat.size = 0, this[fe$1](), this.end();
253939
253948
  }
253940
253949
  [er]() {
253941
253950
  if (!this.stat) throw new Error("cannot create file entry without stat");
@@ -254294,7 +254303,7 @@ while (this[Zs](this[st$1].shift()));
254294
254303
  constructor(t, e) {
254295
254304
  this.path = t || "./", this.absolute = e;
254296
254305
  }
254297
- }, 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$11 = Symbol("ondrain"), wt = class extends A$1 {
254306
+ }, 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 {
254298
254307
  sync = !1;
254299
254308
  opt;
254300
254309
  cwd;
@@ -254327,8 +254336,8 @@ while (this[Zs](this[st$1].shift()));
254327
254336
  if ((t.gzip ? 1 : 0) + (t.brotli ? 1 : 0) + (t.zstd ? 1 : 0) > 1) throw new TypeError("gzip, brotli, zstd are mutually exclusive");
254328
254337
  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");
254329
254338
  let e = this.zip;
254330
- e.on("data", (i) => super.write(i)), e.on("end", () => super.end()), e.on("drain", () => this[fs$11]()), this.on("resume", () => e.resume());
254331
- } else this.on("drain", this[fs$11]);
254339
+ e.on("data", (i) => super.write(i)), e.on("end", () => super.end()), e.on("drain", () => this[fs$12]()), this.on("resume", () => e.resume());
254340
+ } else this.on("drain", this[fs$12]);
254332
254341
  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;
254333
254342
  }
254334
254343
  [lr](t) {
@@ -254345,7 +254354,7 @@ while (this[Zs](this[st$1].shift()));
254345
254354
  return typeof t == "string" ? this[ci](t) : this[or](t), this.flowing;
254346
254355
  }
254347
254356
  [or](t) {
254348
- let e = f(js.resolve(this.cwd, t.path));
254357
+ let e = f(path$1.resolve(this.cwd, t.path));
254349
254358
  if (!this.filter(t.path, t)) t.resume();
254350
254359
  else {
254351
254360
  let i = new pi(t.path, e);
@@ -254354,7 +254363,7 @@ while (this[Zs](this[st$1].shift()));
254354
254363
  this[Ft$1]();
254355
254364
  }
254356
254365
  [ci](t) {
254357
- let e = f(js.resolve(this.cwd, t));
254366
+ let e = f(path$1.resolve(this.cwd, t));
254358
254367
  this[W$1].push(new pi(t, e)), this[Ft$1]();
254359
254368
  }
254360
254369
  [ds](t) {
@@ -254455,7 +254464,7 @@ while (this[Zs](this[st$1].shift()));
254455
254464
  this.emit("error", e);
254456
254465
  }
254457
254466
  }
254458
- [fs$11]() {
254467
+ [fs$12]() {
254459
254468
  this[Et] && this[Et].entry && this[Et].entry.resume();
254460
254469
  }
254461
254470
  [di](t) {
@@ -254621,7 +254630,7 @@ while (this[Zs](this[st$1].shift()));
254621
254630
  E ? e(E) : x && a ? Es(x, o, h, (Le) => y(Le)) : n ? Kt.chmod(s, r, e) : e();
254622
254631
  };
254623
254632
  if (s === d) return no(s, y);
254624
- if (l) return ro.mkdir(s, {
254633
+ if (l) return fs.mkdir(s, {
254625
254634
  mode: r,
254626
254635
  recursive: !0
254627
254636
  }).then((E) => y(null, E ?? void 0), y);
@@ -255380,7 +255389,7 @@ var require_pend = /* @__PURE__ */ __commonJSMin(((exports, module) => {
255380
255389
  //#endregion
255381
255390
  //#region ../../node_modules/.pnpm/yauzl@3.3.0/node_modules/yauzl/fd-slicer.js
255382
255391
  var require_fd_slicer = /* @__PURE__ */ __commonJSMin(((exports) => {
255383
- var fs$10 = __require("fs");
255392
+ var fs$11 = __require("fs");
255384
255393
  var util$6 = __require("util");
255385
255394
  var stream$2 = __require("stream");
255386
255395
  var Readable = stream$2.Readable;
@@ -255405,7 +255414,7 @@ var require_fd_slicer = /* @__PURE__ */ __commonJSMin(((exports) => {
255405
255414
  FdSlicer.prototype.read = function(buffer, offset, length, position, callback) {
255406
255415
  var self = this;
255407
255416
  self.pend.go(function(cb) {
255408
- fs$10.read(self.fd, buffer, offset, length, position, function(err, bytesRead, buffer) {
255417
+ fs$11.read(self.fd, buffer, offset, length, position, function(err, bytesRead, buffer) {
255409
255418
  cb();
255410
255419
  callback(err, bytesRead, buffer);
255411
255420
  });
@@ -255414,7 +255423,7 @@ var require_fd_slicer = /* @__PURE__ */ __commonJSMin(((exports) => {
255414
255423
  FdSlicer.prototype.write = function(buffer, offset, length, position, callback) {
255415
255424
  var self = this;
255416
255425
  self.pend.go(function(cb) {
255417
- fs$10.write(self.fd, buffer, offset, length, position, function(err, written, buffer) {
255426
+ fs$11.write(self.fd, buffer, offset, length, position, function(err, written, buffer) {
255418
255427
  cb();
255419
255428
  callback(err, written, buffer);
255420
255429
  });
@@ -255434,7 +255443,7 @@ var require_fd_slicer = /* @__PURE__ */ __commonJSMin(((exports) => {
255434
255443
  self.refCount -= 1;
255435
255444
  if (self.refCount > 0) return;
255436
255445
  if (self.refCount < 0) throw new Error("invalid unref");
255437
- if (self.autoClose) fs$10.close(self.fd, onCloseDone);
255446
+ if (self.autoClose) fs$11.close(self.fd, onCloseDone);
255438
255447
  function onCloseDone(err) {
255439
255448
  if (err) self.emit("error", err);
255440
255449
  else self.emit("close");
@@ -255465,7 +255474,7 @@ var require_fd_slicer = /* @__PURE__ */ __commonJSMin(((exports) => {
255465
255474
  self.context.pend.go(function(cb) {
255466
255475
  if (self.destroyed) return cb();
255467
255476
  var buffer = Buffer.allocUnsafe(toRead);
255468
- fs$10.read(self.context.fd, buffer, 0, toRead, self.pos, function(err, bytesRead) {
255477
+ fs$11.read(self.context.fd, buffer, 0, toRead, self.pos, function(err, bytesRead) {
255469
255478
  if (err) self.destroy(err);
255470
255479
  else if (bytesRead === 0) {
255471
255480
  self.destroyed = true;
@@ -255511,7 +255520,7 @@ var require_fd_slicer = /* @__PURE__ */ __commonJSMin(((exports) => {
255511
255520
  }
255512
255521
  self.context.pend.go(function(cb) {
255513
255522
  if (self.destroyed) return cb();
255514
- fs$10.write(self.context.fd, buffer, 0, buffer.length, self.pos, function(err, bytes) {
255523
+ fs$11.write(self.context.fd, buffer, 0, buffer.length, self.pos, function(err, bytes) {
255515
255524
  if (err) {
255516
255525
  self.destroy();
255517
255526
  cb();
@@ -292234,7 +292243,7 @@ var init_proxy = __esmMin((() => {
292234
292243
  var require_windows = /* @__PURE__ */ __commonJSMin(((exports, module) => {
292235
292244
  module.exports = isexe;
292236
292245
  isexe.sync = sync;
292237
- var fs$8 = __require("fs");
292246
+ var fs$9 = __require("fs");
292238
292247
  function checkPathExt(path, options) {
292239
292248
  var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT;
292240
292249
  if (!pathext) return true;
@@ -292251,12 +292260,12 @@ var require_windows = /* @__PURE__ */ __commonJSMin(((exports, module) => {
292251
292260
  return checkPathExt(path, options);
292252
292261
  }
292253
292262
  function isexe(path, options, cb) {
292254
- fs$8.stat(path, function(er, stat) {
292263
+ fs$9.stat(path, function(er, stat) {
292255
292264
  cb(er, er ? false : checkStat(stat, path, options));
292256
292265
  });
292257
292266
  }
292258
292267
  function sync(path, options) {
292259
- return checkStat(fs$8.statSync(path), path, options);
292268
+ return checkStat(fs$9.statSync(path), path, options);
292260
292269
  }
292261
292270
  }));
292262
292271
  //#endregion
@@ -292264,14 +292273,14 @@ var require_windows = /* @__PURE__ */ __commonJSMin(((exports, module) => {
292264
292273
  var require_mode = /* @__PURE__ */ __commonJSMin(((exports, module) => {
292265
292274
  module.exports = isexe;
292266
292275
  isexe.sync = sync;
292267
- var fs$7 = __require("fs");
292276
+ var fs$8 = __require("fs");
292268
292277
  function isexe(path, options, cb) {
292269
- fs$7.stat(path, function(er, stat) {
292278
+ fs$8.stat(path, function(er, stat) {
292270
292279
  cb(er, er ? false : checkStat(stat, options));
292271
292280
  });
292272
292281
  }
292273
292282
  function sync(path, options) {
292274
- return checkStat(fs$7.statSync(path), options);
292283
+ return checkStat(fs$8.statSync(path), options);
292275
292284
  }
292276
292285
  function checkStat(stat, options) {
292277
292286
  return stat.isFile() && checkMode(stat, options);
@@ -292335,7 +292344,7 @@ var require_isexe = /* @__PURE__ */ __commonJSMin(((exports, module) => {
292335
292344
  //#region ../../node_modules/.pnpm/which@2.0.2/node_modules/which/which.js
292336
292345
  var require_which = /* @__PURE__ */ __commonJSMin(((exports, module) => {
292337
292346
  const isWindows = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
292338
- const path$9 = __require("path");
292347
+ const path$10 = __require("path");
292339
292348
  const COLON = isWindows ? ";" : ":";
292340
292349
  const isexe = require_isexe();
292341
292350
  const getNotFoundError = (cmd) => Object.assign(/* @__PURE__ */ new Error(`not found: ${cmd}`), { code: "ENOENT" });
@@ -292365,7 +292374,7 @@ var require_which = /* @__PURE__ */ __commonJSMin(((exports, module) => {
292365
292374
  if (i === pathEnv.length) return opt.all && found.length ? resolve(found) : reject(getNotFoundError(cmd));
292366
292375
  const ppRaw = pathEnv[i];
292367
292376
  const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
292368
- const pCmd = path$9.join(pathPart, cmd);
292377
+ const pCmd = path$10.join(pathPart, cmd);
292369
292378
  resolve(subStep(!pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd, i, 0));
292370
292379
  });
292371
292380
  const subStep = (p, i, ii) => new Promise((resolve, reject) => {
@@ -292386,7 +292395,7 @@ var require_which = /* @__PURE__ */ __commonJSMin(((exports, module) => {
292386
292395
  for (let i = 0; i < pathEnv.length; i++) {
292387
292396
  const ppRaw = pathEnv[i];
292388
292397
  const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
292389
- const pCmd = path$9.join(pathPart, cmd);
292398
+ const pCmd = path$10.join(pathPart, cmd);
292390
292399
  const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
292391
292400
  for (let j = 0; j < pathExt.length; j++) {
292392
292401
  const cur = p + pathExt[j];
@@ -292417,7 +292426,7 @@ var require_path_key = /* @__PURE__ */ __commonJSMin(((exports, module) => {
292417
292426
  //#endregion
292418
292427
  //#region ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js
292419
292428
  var require_resolveCommand = /* @__PURE__ */ __commonJSMin(((exports, module) => {
292420
- const path$8 = __require("path");
292429
+ const path$9 = __require("path");
292421
292430
  const which = require_which();
292422
292431
  const getPathKey = require_path_key();
292423
292432
  function resolveCommandAttempt(parsed, withoutPathExt) {
@@ -292432,12 +292441,12 @@ var require_resolveCommand = /* @__PURE__ */ __commonJSMin(((exports, module) =>
292432
292441
  try {
292433
292442
  resolved = which.sync(parsed.command, {
292434
292443
  path: env[getPathKey({ env })],
292435
- pathExt: withoutPathExt ? path$8.delimiter : void 0
292444
+ pathExt: withoutPathExt ? path$9.delimiter : void 0
292436
292445
  });
292437
292446
  } catch (e) {} finally {
292438
292447
  if (shouldSwitchCwd) process.chdir(cwd);
292439
292448
  }
292440
- if (resolved) resolved = path$8.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
292449
+ if (resolved) resolved = path$9.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
292441
292450
  return resolved;
292442
292451
  }
292443
292452
  function resolveCommand(parsed) {
@@ -292486,16 +292495,16 @@ var require_shebang_command = /* @__PURE__ */ __commonJSMin(((exports, module) =
292486
292495
  //#endregion
292487
292496
  //#region ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js
292488
292497
  var require_readShebang = /* @__PURE__ */ __commonJSMin(((exports, module) => {
292489
- const fs$6 = __require("fs");
292498
+ const fs$7 = __require("fs");
292490
292499
  const shebangCommand = require_shebang_command();
292491
292500
  function readShebang(command) {
292492
292501
  const size = 150;
292493
292502
  const buffer = Buffer.alloc(size);
292494
292503
  let fd;
292495
292504
  try {
292496
- fd = fs$6.openSync(command, "r");
292497
- fs$6.readSync(fd, buffer, 0, size, 0);
292498
- fs$6.closeSync(fd);
292505
+ fd = fs$7.openSync(command, "r");
292506
+ fs$7.readSync(fd, buffer, 0, size, 0);
292507
+ fs$7.closeSync(fd);
292499
292508
  } catch (e) {}
292500
292509
  return shebangCommand(buffer.toString());
292501
292510
  }
@@ -292504,7 +292513,7 @@ var require_readShebang = /* @__PURE__ */ __commonJSMin(((exports, module) => {
292504
292513
  //#endregion
292505
292514
  //#region ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js
292506
292515
  var require_parse$5 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
292507
- const path$7 = __require("path");
292516
+ const path$8 = __require("path");
292508
292517
  const resolveCommand = require_resolveCommand();
292509
292518
  const escape = require_escape();
292510
292519
  const readShebang = require_readShebang();
@@ -292527,7 +292536,7 @@ var require_parse$5 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
292527
292536
  const needsShell = !isExecutableRegExp.test(commandFile);
292528
292537
  if (parsed.options.forceShell || needsShell) {
292529
292538
  const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
292530
- parsed.command = path$7.normalize(parsed.command);
292539
+ parsed.command = path$8.normalize(parsed.command);
292531
292540
  parsed.command = escape.command(parsed.command);
292532
292541
  parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
292533
292542
  parsed.args = [
@@ -309616,7 +309625,7 @@ var require_dist$5 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
309616
309625
  //#endregion
309617
309626
  //#region ../../node_modules/.pnpm/yazl@3.3.1/node_modules/yazl/index.js
309618
309627
  var require_yazl = /* @__PURE__ */ __commonJSMin(((exports) => {
309619
- var fs$5 = __require("fs");
309628
+ var fs$6 = __require("fs");
309620
309629
  var Transform$2 = __require("stream").Transform;
309621
309630
  var PassThrough$2 = __require("stream").PassThrough;
309622
309631
  var zlib$1 = __require("zlib");
@@ -309645,14 +309654,14 @@ var require_yazl = /* @__PURE__ */ __commonJSMin(((exports) => {
309645
309654
  if (shouldIgnoreAdding(self)) return;
309646
309655
  var entry = new Entry(metadataPath, false, options);
309647
309656
  self.entries.push(entry);
309648
- fs$5.stat(realPath, function(err, stats) {
309657
+ fs$6.stat(realPath, function(err, stats) {
309649
309658
  if (err) return self.emit("error", err);
309650
309659
  if (!stats.isFile()) return self.emit("error", /* @__PURE__ */ new Error("not a file: " + realPath));
309651
309660
  entry.uncompressedSize = stats.size;
309652
309661
  if (options.mtime == null) entry.setLastModDate(stats.mtime);
309653
309662
  if (options.mode == null) entry.setFileAttributesMode(stats.mode);
309654
309663
  entry.setFileDataPumpFunction(function() {
309655
- var readStream = fs$5.createReadStream(realPath);
309664
+ var readStream = fs$6.createReadStream(realPath);
309656
309665
  entry.state = Entry.FILE_DATA_IN_PROGRESS;
309657
309666
  readStream.on("error", function(err) {
309658
309667
  self.emit("error", err);
@@ -311498,14 +311507,14 @@ async function readGitExecPath(deps, gitExe) {
311498
311507
  }
311499
311508
  }
311500
311509
  function gitBashCandidatesFromGitExe(gitExe) {
311501
- const normalizedGitExe = path$16.win32.normalize(normalizeWindowsPath(gitExe));
311502
- const gitDir = path$16.win32.dirname(normalizedGitExe);
311503
- const gitDirName = path$16.win32.basename(gitDir).toLowerCase();
311510
+ const normalizedGitExe = path$17.win32.normalize(normalizeWindowsPath(gitExe));
311511
+ const gitDir = path$17.win32.dirname(normalizedGitExe);
311512
+ const gitDirName = path$17.win32.basename(gitDir).toLowerCase();
311504
311513
  if (gitDirName !== "cmd" && gitDirName !== "bin") return;
311505
- return gitBashCandidatesFromGitRoot(path$16.win32.dirname(gitDir));
311514
+ return gitBashCandidatesFromGitRoot(path$17.win32.dirname(gitDir));
311506
311515
  }
311507
311516
  function gitBashCandidatesFromGitExecPath(execPath) {
311508
- const normalized = path$16.win32.normalize(normalizeWindowsPath(execPath));
311517
+ const normalized = path$17.win32.normalize(normalizeWindowsPath(execPath));
311509
311518
  const parts = normalized.split("\\");
311510
311519
  for (let i = parts.length - 1; i >= 0; i -= 1) {
311511
311520
  const segment = parts[i]?.toLowerCase();
@@ -311514,16 +311523,16 @@ function gitBashCandidatesFromGitExecPath(execPath) {
311514
311523
  if (root.length > 0) return gitBashCandidatesFromGitRoot(root);
311515
311524
  }
311516
311525
  }
311517
- return gitBashCandidatesFromGitRoot(path$16.win32.join(normalized, "..", ".."));
311526
+ return gitBashCandidatesFromGitRoot(path$17.win32.join(normalized, "..", ".."));
311518
311527
  }
311519
311528
  function gitBashCandidatesFromGitRoot(root) {
311520
- return [path$16.win32.normalize(path$16.win32.join(root, "bin", "bash.exe")), path$16.win32.normalize(path$16.win32.join(root, "usr", "bin", "bash.exe"))];
311529
+ 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"))];
311521
311530
  }
311522
311531
  function normalizeWindowsPath(path) {
311523
311532
  return path.replaceAll("/", "\\");
311524
311533
  }
311525
311534
  function isAbsoluteWindowsPath(path) {
311526
- return path$16.win32.isAbsolute(normalizeWindowsPath(path));
311535
+ return path$17.win32.isAbsolute(normalizeWindowsPath(path));
311527
311536
  }
311528
311537
  function dedupeWindowsPaths(paths) {
311529
311538
  const deduped = [];
@@ -312506,7 +312515,7 @@ async function createRuntimeConfig(input) {
312506
312515
  const localFetcher = new LocalFetchURLProvider();
312507
312516
  const searchService = input.config.services?.blunSearch;
312508
312517
  const fetchService = input.config.services?.blunFetch;
312509
- const mediaService = input.config.services?.blunMedia;
312518
+ const mediaService = input.config.services?.blunMedia ?? managedBlunMediaService(input.config);
312510
312519
  return {
312511
312520
  urlFetcher: fetchService?.baseUrl === void 0 ? localFetcher : new BlunFetchURLProvider({
312512
312521
  baseUrl: fetchService.baseUrl,
@@ -312526,6 +312535,17 @@ async function createRuntimeConfig(input) {
312526
312535
  })
312527
312536
  };
312528
312537
  }
312538
+ function managedBlunMediaService(config) {
312539
+ const provider = config.providers[BLUN_PROVIDER_NAME];
312540
+ if (provider?.type !== "blun") return void 0;
312541
+ const baseUrl = nonEmptyString$1(provider.baseUrl);
312542
+ if (baseUrl === void 0) return void 0;
312543
+ return {
312544
+ baseUrl,
312545
+ apiKey: provider.apiKey,
312546
+ oauth: provider.oauth
312547
+ };
312548
+ }
312529
312549
  function serviceCredentials(service, resolveOAuthTokenProvider) {
312530
312550
  return {
312531
312551
  apiKey: nonEmptyString$1(service.apiKey),
@@ -326219,8 +326239,8 @@ var require_suggestSimilar = /* @__PURE__ */ __commonJSMin(((exports) => {
326219
326239
  var require_command = /* @__PURE__ */ __commonJSMin(((exports) => {
326220
326240
  const EventEmitter$12 = __require("node:events").EventEmitter;
326221
326241
  const childProcess = __require("node:child_process");
326222
- const path$6 = __require("node:path");
326223
- const fs$4 = __require("node:fs");
326242
+ const path$7 = __require("node:path");
326243
+ const fs$5 = __require("node:fs");
326224
326244
  const process$2 = __require("node:process");
326225
326245
  const { Argument, humanReadableArgName } = require_argument();
326226
326246
  const { CommanderError } = require_error$2();
@@ -327103,7 +327123,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
327103
327123
  * @param {string} subcommandName
327104
327124
  */
327105
327125
  _checkForMissingExecutable(executableFile, executableDir, subcommandName) {
327106
- if (fs$4.existsSync(executableFile)) return;
327126
+ if (fs$5.existsSync(executableFile)) return;
327107
327127
  const executableMissing = `'${executableFile}' does not exist
327108
327128
  - if '${subcommandName}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
327109
327129
  - if the default executable name is not suitable, use the executableFile option to supply a custom name or path
@@ -327126,10 +327146,10 @@ Expecting one of '${allowedValues.join("', '")}'`);
327126
327146
  ".cjs"
327127
327147
  ];
327128
327148
  function findFile(baseDir, baseName) {
327129
- const localBin = path$6.resolve(baseDir, baseName);
327130
- if (fs$4.existsSync(localBin)) return localBin;
327131
- if (sourceExt.includes(path$6.extname(baseName))) return void 0;
327132
- const foundExt = sourceExt.find((ext) => fs$4.existsSync(`${localBin}${ext}`));
327149
+ const localBin = path$7.resolve(baseDir, baseName);
327150
+ if (fs$5.existsSync(localBin)) return localBin;
327151
+ if (sourceExt.includes(path$7.extname(baseName))) return void 0;
327152
+ const foundExt = sourceExt.find((ext) => fs$5.existsSync(`${localBin}${ext}`));
327133
327153
  if (foundExt) return `${localBin}${foundExt}`;
327134
327154
  }
327135
327155
  this._checkForMissingMandatoryOptions();
@@ -327139,21 +327159,21 @@ Expecting one of '${allowedValues.join("', '")}'`);
327139
327159
  if (this._scriptPath) {
327140
327160
  let resolvedScriptPath;
327141
327161
  try {
327142
- resolvedScriptPath = fs$4.realpathSync(this._scriptPath);
327162
+ resolvedScriptPath = fs$5.realpathSync(this._scriptPath);
327143
327163
  } catch {
327144
327164
  resolvedScriptPath = this._scriptPath;
327145
327165
  }
327146
- executableDir = path$6.resolve(path$6.dirname(resolvedScriptPath), executableDir);
327166
+ executableDir = path$7.resolve(path$7.dirname(resolvedScriptPath), executableDir);
327147
327167
  }
327148
327168
  if (executableDir) {
327149
327169
  let localFile = findFile(executableDir, executableFile);
327150
327170
  if (!localFile && !subcommand._executableFile && this._scriptPath) {
327151
- const legacyName = path$6.basename(this._scriptPath, path$6.extname(this._scriptPath));
327171
+ const legacyName = path$7.basename(this._scriptPath, path$7.extname(this._scriptPath));
327152
327172
  if (legacyName !== this._name) localFile = findFile(executableDir, `${legacyName}-${subcommand._name}`);
327153
327173
  }
327154
327174
  executableFile = localFile || executableFile;
327155
327175
  }
327156
- launchWithNode = sourceExt.includes(path$6.extname(executableFile));
327176
+ launchWithNode = sourceExt.includes(path$7.extname(executableFile));
327157
327177
  let proc;
327158
327178
  if (process$2.platform !== "win32") if (launchWithNode) {
327159
327179
  args.unshift(executableFile);
@@ -327857,7 +327877,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
327857
327877
  * @return {Command}
327858
327878
  */
327859
327879
  nameFromFilename(filename) {
327860
- this._name = path$6.basename(filename, path$6.extname(filename));
327880
+ this._name = path$7.basename(filename, path$7.extname(filename));
327861
327881
  return this;
327862
327882
  }
327863
327883
  /**
@@ -345438,10 +345458,10 @@ var require_atomic_sleep = /* @__PURE__ */ __commonJSMin(((exports, module) => {
345438
345458
  //#endregion
345439
345459
  //#region ../../node_modules/.pnpm/sonic-boom@4.2.1/node_modules/sonic-boom/index.js
345440
345460
  var require_sonic_boom = /* @__PURE__ */ __commonJSMin(((exports, module) => {
345441
- const fs$3 = __require("fs");
345461
+ const fs$4 = __require("fs");
345442
345462
  const EventEmitter$10 = __require("events");
345443
345463
  const inherits$6 = __require("util").inherits;
345444
- const path$5 = __require("path");
345464
+ const path$6 = __require("path");
345445
345465
  const sleep = require_atomic_sleep();
345446
345466
  const assert$8 = __require("assert");
345447
345467
  const BUSY_WRITE_TIMEOUT = 100;
@@ -345481,17 +345501,17 @@ var require_sonic_boom = /* @__PURE__ */ __commonJSMin(((exports, module) => {
345481
345501
  const flags = sonic.append ? "a" : "w";
345482
345502
  const mode = sonic.mode;
345483
345503
  if (sonic.sync) try {
345484
- if (sonic.mkdir) fs$3.mkdirSync(path$5.dirname(file), { recursive: true });
345485
- fileOpened(null, fs$3.openSync(file, flags, mode));
345504
+ if (sonic.mkdir) fs$4.mkdirSync(path$6.dirname(file), { recursive: true });
345505
+ fileOpened(null, fs$4.openSync(file, flags, mode));
345486
345506
  } catch (err) {
345487
345507
  fileOpened(err);
345488
345508
  throw err;
345489
345509
  }
345490
- else if (sonic.mkdir) fs$3.mkdir(path$5.dirname(file), { recursive: true }, (err) => {
345510
+ else if (sonic.mkdir) fs$4.mkdir(path$6.dirname(file), { recursive: true }, (err) => {
345491
345511
  if (err) return fileOpened(err);
345492
- fs$3.open(file, flags, mode, fileOpened);
345512
+ fs$4.open(file, flags, mode, fileOpened);
345493
345513
  });
345494
- else fs$3.open(file, flags, mode, fileOpened);
345514
+ else fs$4.open(file, flags, mode, fileOpened);
345495
345515
  }
345496
345516
  function SonicBoom(opts) {
345497
345517
  if (!(this instanceof SonicBoom)) return new SonicBoom(opts);
@@ -345529,8 +345549,8 @@ var require_sonic_boom = /* @__PURE__ */ __commonJSMin(((exports, module) => {
345529
345549
  this.flush = flushBuffer;
345530
345550
  this.flushSync = flushBufferSync;
345531
345551
  this._actualWrite = actualWriteBuffer;
345532
- fsWriteSync = () => fs$3.writeSync(this.fd, this._writingBuf);
345533
- fsWrite = () => fs$3.write(this.fd, this._writingBuf, this.release);
345552
+ fsWriteSync = () => fs$4.writeSync(this.fd, this._writingBuf);
345553
+ fsWrite = () => fs$4.write(this.fd, this._writingBuf, this.release);
345534
345554
  } else if (contentMode === void 0 || contentMode === kContentModeUtf8) {
345535
345555
  this._writingBuf = "";
345536
345556
  this.write = write;
@@ -345538,12 +345558,12 @@ var require_sonic_boom = /* @__PURE__ */ __commonJSMin(((exports, module) => {
345538
345558
  this.flushSync = flushSync;
345539
345559
  this._actualWrite = actualWrite;
345540
345560
  fsWriteSync = () => {
345541
- if (Buffer.isBuffer(this._writingBuf)) return fs$3.writeSync(this.fd, this._writingBuf);
345542
- return fs$3.writeSync(this.fd, this._writingBuf, "utf8");
345561
+ if (Buffer.isBuffer(this._writingBuf)) return fs$4.writeSync(this.fd, this._writingBuf);
345562
+ return fs$4.writeSync(this.fd, this._writingBuf, "utf8");
345543
345563
  };
345544
345564
  fsWrite = () => {
345545
- if (Buffer.isBuffer(this._writingBuf)) return fs$3.write(this.fd, this._writingBuf, this.release);
345546
- return fs$3.write(this.fd, this._writingBuf, "utf8", this.release);
345565
+ if (Buffer.isBuffer(this._writingBuf)) return fs$4.write(this.fd, this._writingBuf, this.release);
345566
+ return fs$4.write(this.fd, this._writingBuf, "utf8", this.release);
345547
345567
  };
345548
345568
  } else throw new Error(`SonicBoom supports "${kContentModeUtf8}" and "${kContentModeBuffer}", but passed ${contentMode}`);
345549
345569
  if (typeof fd === "number") {
@@ -345588,7 +345608,7 @@ var require_sonic_boom = /* @__PURE__ */ __commonJSMin(((exports, module) => {
345588
345608
  return;
345589
345609
  }
345590
345610
  }
345591
- if (this._fsync) fs$3.fsyncSync(this.fd);
345611
+ if (this._fsync) fs$4.fsyncSync(this.fd);
345592
345612
  const len = this._len;
345593
345613
  if (this._reopening) {
345594
345614
  this._writing = false;
@@ -345685,7 +345705,7 @@ var require_sonic_boom = /* @__PURE__ */ __commonJSMin(((exports, module) => {
345685
345705
  this._flushPending = true;
345686
345706
  const onDrain = () => {
345687
345707
  if (!this._fsync) try {
345688
- fs$3.fsync(this.fd, (err) => {
345708
+ fs$4.fsync(this.fd, (err) => {
345689
345709
  this._flushPending = false;
345690
345710
  cb(err);
345691
345711
  });
@@ -345762,7 +345782,7 @@ var require_sonic_boom = /* @__PURE__ */ __commonJSMin(((exports, module) => {
345762
345782
  if (this._writing) return;
345763
345783
  const fd = this.fd;
345764
345784
  this.once("ready", () => {
345765
- if (fd !== this.fd) fs$3.close(fd, (err) => {
345785
+ if (fd !== this.fd) fs$4.close(fd, (err) => {
345766
345786
  if (err) return this.emit("error", err);
345767
345787
  });
345768
345788
  });
@@ -345793,7 +345813,7 @@ var require_sonic_boom = /* @__PURE__ */ __commonJSMin(((exports, module) => {
345793
345813
  while (this._bufs.length || buf.length) {
345794
345814
  if (buf.length <= 0) buf = this._bufs[0];
345795
345815
  try {
345796
- const n = Buffer.isBuffer(buf) ? fs$3.writeSync(this.fd, buf) : fs$3.writeSync(this.fd, buf, "utf8");
345816
+ const n = Buffer.isBuffer(buf) ? fs$4.writeSync(this.fd, buf) : fs$4.writeSync(this.fd, buf, "utf8");
345797
345817
  const releasedBufObj = releaseWritingBuf(buf, this._len, n);
345798
345818
  buf = releasedBufObj.writingBuf;
345799
345819
  this._len = releasedBufObj.len;
@@ -345804,7 +345824,7 @@ var require_sonic_boom = /* @__PURE__ */ __commonJSMin(((exports, module) => {
345804
345824
  }
345805
345825
  }
345806
345826
  try {
345807
- fs$3.fsyncSync(this.fd);
345827
+ fs$4.fsyncSync(this.fd);
345808
345828
  } catch {}
345809
345829
  }
345810
345830
  function flushBufferSync() {
@@ -345818,7 +345838,7 @@ var require_sonic_boom = /* @__PURE__ */ __commonJSMin(((exports, module) => {
345818
345838
  while (this._bufs.length || buf.length) {
345819
345839
  if (buf.length <= 0) buf = mergeBuf(this._bufs[0], this._lens[0]);
345820
345840
  try {
345821
- const n = fs$3.writeSync(this.fd, buf);
345841
+ const n = fs$4.writeSync(this.fd, buf);
345822
345842
  buf = buf.subarray(n);
345823
345843
  this._len = Math.max(this._len - n, 0);
345824
345844
  if (buf.length <= 0) {
@@ -345840,24 +345860,24 @@ var require_sonic_boom = /* @__PURE__ */ __commonJSMin(((exports, module) => {
345840
345860
  this._writing = true;
345841
345861
  this._writingBuf = this._writingBuf.length ? this._writingBuf : this._bufs.shift() || "";
345842
345862
  if (this.sync) try {
345843
- release(null, Buffer.isBuffer(this._writingBuf) ? fs$3.writeSync(this.fd, this._writingBuf) : fs$3.writeSync(this.fd, this._writingBuf, "utf8"));
345863
+ release(null, Buffer.isBuffer(this._writingBuf) ? fs$4.writeSync(this.fd, this._writingBuf) : fs$4.writeSync(this.fd, this._writingBuf, "utf8"));
345844
345864
  } catch (err) {
345845
345865
  release(err);
345846
345866
  }
345847
- else fs$3.write(this.fd, this._writingBuf, release);
345867
+ else fs$4.write(this.fd, this._writingBuf, release);
345848
345868
  }
345849
345869
  function actualWriteBuffer() {
345850
345870
  const release = this.release;
345851
345871
  this._writing = true;
345852
345872
  this._writingBuf = this._writingBuf.length ? this._writingBuf : mergeBuf(this._bufs.shift(), this._lens.shift());
345853
345873
  if (this.sync) try {
345854
- release(null, fs$3.writeSync(this.fd, this._writingBuf));
345874
+ release(null, fs$4.writeSync(this.fd, this._writingBuf));
345855
345875
  } catch (err) {
345856
345876
  release(err);
345857
345877
  }
345858
345878
  else {
345859
345879
  if (kCopyBuffer) this._writingBuf = Buffer.from(this._writingBuf);
345860
- fs$3.write(this.fd, this._writingBuf, release);
345880
+ fs$4.write(this.fd, this._writingBuf, release);
345861
345881
  }
345862
345882
  }
345863
345883
  function actualClose(sonic) {
@@ -345871,10 +345891,10 @@ var require_sonic_boom = /* @__PURE__ */ __commonJSMin(((exports, module) => {
345871
345891
  sonic._lens = [];
345872
345892
  assert$8(typeof sonic.fd === "number", `sonic.fd must be a number, got ${typeof sonic.fd}`);
345873
345893
  try {
345874
- fs$3.fsync(sonic.fd, closeWrapped);
345894
+ fs$4.fsync(sonic.fd, closeWrapped);
345875
345895
  } catch {}
345876
345896
  function closeWrapped() {
345877
- if (sonic.fd !== 1 && sonic.fd !== 2) fs$3.close(sonic.fd, done);
345897
+ if (sonic.fd !== 1 && sonic.fd !== 2) fs$4.close(sonic.fd, done);
345878
345898
  else done();
345879
345899
  }
345880
345900
  function done(err) {
@@ -368497,8 +368517,8 @@ var require_constants$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
368497
368517
  //#endregion
368498
368518
  //#region ../../../../node_modules/node-gyp-build/node-gyp-build.js
368499
368519
  var require_node_gyp_build$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
368500
- var fs$2 = __require("fs");
368501
- var path$4 = __require("path");
368520
+ var fs$3 = __require("fs");
368521
+ var path$5 = __require("path");
368502
368522
  var os$3 = __require("os");
368503
368523
  var runtimeRequire = typeof __webpack_require__ === "function" ? __non_webpack_require__ : __require;
368504
368524
  var vars = process.config && process.config.variables || {};
@@ -368515,20 +368535,20 @@ var require_node_gyp_build$1 = /* @__PURE__ */ __commonJSMin(((exports, module)
368515
368535
  return runtimeRequire(load.resolve(dir));
368516
368536
  }
368517
368537
  load.resolve = load.path = function(dir) {
368518
- dir = path$4.resolve(dir || ".");
368538
+ dir = path$5.resolve(dir || ".");
368519
368539
  try {
368520
- var name = runtimeRequire(path$4.join(dir, "package.json")).name.toUpperCase().replace(/-/g, "_");
368540
+ var name = runtimeRequire(path$5.join(dir, "package.json")).name.toUpperCase().replace(/-/g, "_");
368521
368541
  if (process.env[name + "_PREBUILD"]) dir = process.env[name + "_PREBUILD"];
368522
368542
  } catch (err) {}
368523
368543
  if (!prebuildsOnly) {
368524
- var release = getFirst(path$4.join(dir, "build/Release"), matchBuild);
368544
+ var release = getFirst(path$5.join(dir, "build/Release"), matchBuild);
368525
368545
  if (release) return release;
368526
- var debug = getFirst(path$4.join(dir, "build/Debug"), matchBuild);
368546
+ var debug = getFirst(path$5.join(dir, "build/Debug"), matchBuild);
368527
368547
  if (debug) return debug;
368528
368548
  }
368529
368549
  var prebuild = resolve(dir);
368530
368550
  if (prebuild) return prebuild;
368531
- var nearby = resolve(path$4.dirname(process.execPath));
368551
+ var nearby = resolve(path$5.dirname(process.execPath));
368532
368552
  if (nearby) return nearby;
368533
368553
  var target = [
368534
368554
  "platform=" + platform,
@@ -368544,23 +368564,23 @@ var require_node_gyp_build$1 = /* @__PURE__ */ __commonJSMin(((exports, module)
368544
368564
  ].filter(Boolean).join(" ");
368545
368565
  throw new Error("No native build was found for " + target + "\n loaded from: " + dir + "\n");
368546
368566
  function resolve(dir) {
368547
- var tuple = readdirSync(path$4.join(dir, "prebuilds")).map(parseTuple).filter(matchTuple(platform, arch)).sort(compareTuples)[0];
368567
+ var tuple = readdirSync(path$5.join(dir, "prebuilds")).map(parseTuple).filter(matchTuple(platform, arch)).sort(compareTuples)[0];
368548
368568
  if (!tuple) return;
368549
- var prebuilds = path$4.join(dir, "prebuilds", tuple.name);
368569
+ var prebuilds = path$5.join(dir, "prebuilds", tuple.name);
368550
368570
  var winner = readdirSync(prebuilds).map(parseTags).filter(matchTags(runtime, abi)).sort(compareTags(runtime))[0];
368551
- if (winner) return path$4.join(prebuilds, winner.file);
368571
+ if (winner) return path$5.join(prebuilds, winner.file);
368552
368572
  }
368553
368573
  };
368554
368574
  function readdirSync(dir) {
368555
368575
  try {
368556
- return fs$2.readdirSync(dir);
368576
+ return fs$3.readdirSync(dir);
368557
368577
  } catch (err) {
368558
368578
  return [];
368559
368579
  }
368560
368580
  }
368561
368581
  function getFirst(dir, filter) {
368562
368582
  var files = readdirSync(dir).filter(filter);
368563
- return files[0] && path$4.join(dir, files[0]);
368583
+ return files[0] && path$5.join(dir, files[0]);
368564
368584
  }
368565
368585
  function matchBuild(name) {
368566
368586
  return /\.node$/.test(name);
@@ -368641,7 +368661,7 @@ var require_node_gyp_build$1 = /* @__PURE__ */ __commonJSMin(((exports, module)
368641
368661
  return typeof window !== "undefined" && window.process && window.process.type === "renderer";
368642
368662
  }
368643
368663
  function isAlpine(platform) {
368644
- return platform === "linux" && fs$2.existsSync("/etc/alpine-release");
368664
+ return platform === "linux" && fs$3.existsSync("/etc/alpine-release");
368645
368665
  }
368646
368666
  load.parseTags = parseTags;
368647
368667
  load.matchTags = matchTags;
@@ -375757,7 +375777,7 @@ var import_multipart = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((
375757
375777
  const fp = require_plugin();
375758
375778
  const { createWriteStream: createWriteStream$1 } = __require("node:fs");
375759
375779
  const { unlink: unlink$1 } = __require("node:fs/promises");
375760
- const path$3 = __require("node:path");
375780
+ const path$4 = __require("node:path");
375761
375781
  const { generateId } = require_generateId();
375762
375782
  const createError = require_error$1();
375763
375783
  const streamToNull = require_stream_consumer();
@@ -376052,7 +376072,7 @@ var import_multipart = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((
376052
376072
  for await (const part of parts) {
376053
376073
  values = part.fields;
376054
376074
  if (!part.file) continue;
376055
- const filepath = path$3.join(tmpdir, generateId() + path$3.extname(part.filename || "file" + i++));
376075
+ const filepath = path$4.join(tmpdir, generateId() + path$4.extname(part.filename || "file" + i++));
376056
376076
  const target = createWriteStream$1(filepath);
376057
376077
  try {
376058
376078
  this.tmpUploads.push(filepath);
@@ -388793,8 +388813,8 @@ var require_dist$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
388793
388813
  //#endregion
388794
388814
  //#region ../../node_modules/.pnpm/@fastify+swagger@9.7.0/node_modules/@fastify/swagger/lib/mode/static.js
388795
388815
  var require_static = /* @__PURE__ */ __commonJSMin(((exports, module) => {
388796
- const path$2 = __require("node:path");
388797
- const fs$1 = __require("node:fs");
388816
+ const path$3 = __require("node:path");
388817
+ const fs$2 = __require("node:fs");
388798
388818
  const yaml = require_dist$1();
388799
388819
  module.exports = function(fastify, opts, done) {
388800
388820
  if (!opts.specification) return done(/* @__PURE__ */ new Error("specification is missing in the module options"));
@@ -388803,14 +388823,14 @@ var require_static = /* @__PURE__ */ __commonJSMin(((exports, module) => {
388803
388823
  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"));
388804
388824
  else if (opts.specification.path) {
388805
388825
  if (typeof opts.specification.path !== "string") return done(/* @__PURE__ */ new Error("specification.path is not a string"));
388806
- if (!fs$1.existsSync(path$2.resolve(opts.specification.path))) return done(/* @__PURE__ */ new Error(`${opts.specification.path} does not exist`));
388807
- const extName = path$2.extname(opts.specification.path).toLowerCase();
388826
+ if (!fs$2.existsSync(path$3.resolve(opts.specification.path))) return done(/* @__PURE__ */ new Error(`${opts.specification.path} does not exist`));
388827
+ const extName = path$3.extname(opts.specification.path).toLowerCase();
388808
388828
  if ([".yaml", ".json"].indexOf(extName) === -1) return done(/* @__PURE__ */ new Error("specification.path extension name is not supported, should be one from ['.yaml', '.json']"));
388809
388829
  if (opts.specification.postProcessor && typeof opts.specification.postProcessor !== "function") return done(/* @__PURE__ */ new Error("specification.postProcessor should be a function"));
388810
388830
  if (opts.specification.baseDir && typeof opts.specification.baseDir !== "string") return done(/* @__PURE__ */ new Error("specification.baseDir should be string"));
388811
- if (!opts.specification.baseDir) opts.specification.baseDir = path$2.resolve(path$2.dirname(opts.specification.path));
388831
+ if (!opts.specification.baseDir) opts.specification.baseDir = path$3.resolve(path$3.dirname(opts.specification.path));
388812
388832
  else while (opts.specification.baseDir.endsWith("/")) opts.specification.baseDir = opts.specification.baseDir.slice(0, -1);
388813
- const source = fs$1.readFileSync(path$2.resolve(opts.specification.path), "utf8");
388833
+ const source = fs$2.readFileSync(path$3.resolve(opts.specification.path), "utf8");
388814
388834
  switch (extName) {
388815
388835
  case ".yaml":
388816
388836
  swaggerObject = yaml.parse(source);
@@ -389077,11 +389097,11 @@ var require_should_route_hide = /* @__PURE__ */ __commonJSMin(((exports, module)
389077
389097
  //#endregion
389078
389098
  //#region ../../node_modules/.pnpm/@fastify+swagger@9.7.0/node_modules/@fastify/swagger/lib/util/read-package-json.js
389079
389099
  var require_read_package_json = /* @__PURE__ */ __commonJSMin(((exports, module) => {
389080
- const fs = __require("node:fs");
389081
- const path$1 = __require("node:path");
389100
+ const fs$1 = __require("node:fs");
389101
+ const path$2 = __require("node:path");
389082
389102
  function readPackageJson() {
389083
389103
  try {
389084
- return JSON.parse(fs.readFileSync(path$1.join(__dirname, "..", "..", "package.json")));
389104
+ return JSON.parse(fs$1.readFileSync(path$2.join(__dirname, "..", "..", "package.json")));
389085
389105
  } catch {
389086
389106
  return {};
389087
389107
  }
@@ -404029,9 +404049,9 @@ var TUI = class TUI extends Container {
404029
404049
  const debugRedraw = process.env["PI_DEBUG_REDRAW"] === "1";
404030
404050
  const logRedraw = (reason) => {
404031
404051
  if (!debugRedraw) return;
404032
- const logPath = path$16.join(nodeOs.homedir(), ".pi", "agent", "pi-debug.log");
404052
+ const logPath = path$17.join(nodeOs.homedir(), ".pi", "agent", "pi-debug.log");
404033
404053
  const msg = `[${(/* @__PURE__ */ new Date()).toISOString()}] fullRender: ${reason} (prev=${this.previousLines.length}, new=${newLines.length}, height=${height})\n`;
404034
- fs$16.appendFileSync(logPath, msg);
404054
+ fs$17.appendFileSync(logPath, msg);
404035
404055
  };
404036
404056
  if (this.previousLines.length === 0 && !widthChanged && !heightChanged) {
404037
404057
  logRedraw("first render");
@@ -404178,8 +404198,8 @@ var TUI = class TUI extends Container {
404178
404198
  buffer += "\x1B[?2026l";
404179
404199
  if (process.env["PI_TUI_DEBUG"] === "1") {
404180
404200
  const debugDir = "/tmp/tui";
404181
- fs$16.mkdirSync(debugDir, { recursive: true });
404182
- const debugPath = path$16.join(debugDir, `render-${Date.now()}-${Math.random().toString(36).slice(2)}.log`);
404201
+ fs$17.mkdirSync(debugDir, { recursive: true });
404202
+ const debugPath = path$17.join(debugDir, `render-${Date.now()}-${Math.random().toString(36).slice(2)}.log`);
404183
404203
  const debugData = [
404184
404204
  `firstChanged: ${firstChanged}`,
404185
404205
  `viewportTop: ${viewportTop}`,
@@ -404202,7 +404222,7 @@ var TUI = class TUI extends Container {
404202
404222
  "=== buffer ===",
404203
404223
  JSON.stringify(buffer)
404204
404224
  ].join("\n");
404205
- fs$16.writeFileSync(debugPath, debugData);
404225
+ fs$17.writeFileSync(debugPath, debugData);
404206
404226
  }
404207
404227
  this.terminal.write(buffer);
404208
404228
  this.cursorRow = Math.max(0, newLines.length - 1);
@@ -408783,12 +408803,12 @@ function loadNativeModifiersHelper() {
408783
408803
  if (process.platform !== "darwin") return void 0;
408784
408804
  const arch = process.arch;
408785
408805
  if (arch !== "x64" && arch !== "arm64") return void 0;
408786
- const moduleDir = path$16.dirname(fileURLToPath(import.meta.url));
408787
- const nativePath = path$16.join("native", "darwin", "prebuilds", `darwin-${arch}`, "darwin-modifiers.node");
408806
+ const moduleDir = path$17.dirname(fileURLToPath(import.meta.url));
408807
+ const nativePath = path$17.join("native", "darwin", "prebuilds", `darwin-${arch}`, "darwin-modifiers.node");
408788
408808
  const candidates = [
408789
- path$16.join(moduleDir, "..", nativePath),
408790
- path$16.join(moduleDir, nativePath),
408791
- path$16.join(path$16.dirname(process.execPath), nativePath)
408809
+ path$17.join(moduleDir, "..", nativePath),
408810
+ path$17.join(moduleDir, nativePath),
408811
+ path$17.join(path$17.dirname(process.execPath), nativePath)
408792
408812
  ];
408793
408813
  for (const modulePath of candidates) try {
408794
408814
  const helper = cjsRequire$1(modulePath);
@@ -408861,10 +408881,10 @@ var ProcessTerminal = class {
408861
408881
  const env = process.env["PI_TUI_WRITE_LOG"] || "";
408862
408882
  if (!env) return "";
408863
408883
  try {
408864
- if (fs$16.statSync(env).isDirectory()) {
408884
+ if (fs$17.statSync(env).isDirectory()) {
408865
408885
  const now = /* @__PURE__ */ new Date();
408866
408886
  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")}`;
408867
- return path$16.join(env, `tui-${ts}-${process.pid}.log`);
408887
+ return path$17.join(env, `tui-${ts}-${process.pid}.log`);
408868
408888
  }
408869
408889
  } catch {}
408870
408890
  return env;
@@ -409067,12 +409087,12 @@ var ProcessTerminal = class {
409067
409087
  try {
409068
409088
  const arch = process.arch;
409069
409089
  if (arch !== "x64" && arch !== "arm64") return;
409070
- const moduleDir = path$16.dirname(fileURLToPath(import.meta.url));
409071
- const nativePath = path$16.join("native", "win32", "prebuilds", `win32-${arch}`, "win32-console-mode.node");
409090
+ const moduleDir = path$17.dirname(fileURLToPath(import.meta.url));
409091
+ const nativePath = path$17.join("native", "win32", "prebuilds", `win32-${arch}`, "win32-console-mode.node");
409072
409092
  const candidates = [
409073
- path$16.join(moduleDir, "..", nativePath),
409074
- path$16.join(moduleDir, nativePath),
409075
- path$16.join(path$16.dirname(process.execPath), nativePath)
409093
+ path$17.join(moduleDir, "..", nativePath),
409094
+ path$17.join(moduleDir, nativePath),
409095
+ path$17.join(path$17.dirname(process.execPath), nativePath)
409076
409096
  ];
409077
409097
  for (const modulePath of candidates) try {
409078
409098
  cjsRequire(modulePath).enableVirtualTerminalInput?.();
@@ -409144,7 +409164,7 @@ var ProcessTerminal = class {
409144
409164
  write(data) {
409145
409165
  process.stdout.write(data);
409146
409166
  if (this.writeLogPath) try {
409147
- fs$16.appendFileSync(this.writeLogPath, data, { encoding: "utf8" });
409167
+ fs$17.appendFileSync(this.writeLogPath, data, { encoding: "utf8" });
409148
409168
  } catch {}
409149
409169
  }
409150
409170
  get columns() {
@@ -416087,7 +416107,7 @@ function appearanceSelectorCopy() {
416087
416107
  surface: uiText("appearance.surface"),
416088
416108
  preview: uiText("appearance.preview"),
416089
416109
  colorHint: uiText("appearance.colorHint"),
416090
- contrastHint: uiText("appearance.contrastHint"),
416110
+ contrastHint: uiText("appearance.contrastHint", { ratio: "{ratio}" }),
416091
416111
  footer: uiText("appearance.footer")
416092
416112
  };
416093
416113
  }
@@ -416239,7 +416259,6 @@ function showSettingsSelector(host) {
416239
416259
  }));
416240
416260
  }
416241
416261
  function handleSettingsSelection(host, value) {
416242
- host.restoreEditor();
416243
416262
  switch (value) {
416244
416263
  case "effort":
416245
416264
  handleEffortCommand(host, "");
@@ -416263,9 +416282,11 @@ function handleSettingsSelection(host, value) {
416263
416282
  showExperimentsPanel(host);
416264
416283
  return;
416265
416284
  case "usage":
416285
+ host.restoreEditor();
416266
416286
  showUsage(host);
416267
416287
  return;
416268
416288
  case "inline-suggest":
416289
+ host.restoreEditor();
416269
416290
  showInlineSuggestStatus(host);
416270
416291
  return;
416271
416292
  }
@@ -511514,7 +511535,11 @@ var BlunTUI = class {
511514
511535
  this.applyStartupPermissionAndPlanToAppState();
511515
511536
  }
511516
511537
  this.hideSessionPicker();
511517
- if (applyStartupModes) await this.promptStartupResumeGoalIfNeeded();
511538
+ if (applyStartupModes) {
511539
+ await this.refreshPersonalMemory(true);
511540
+ await this.authFlow.refreshManagedQuotaWindows();
511541
+ await this.promptStartupResumeGoalIfNeeded();
511542
+ }
511518
511543
  }
511519
511544
  showApprovalPanel(payload) {
511520
511545
  this.patchLivePane({ pendingApproval: { data: payload } });