@jixo/cli 0.26.0 → 0.27.0

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/bundle/index.js CHANGED
@@ -1,13 +1,13 @@
1
1
  #!/usr/bin/env node
2
- import { $ZodAny, $ZodArray, $ZodBoolean, $ZodCustom, $ZodLiteral, $ZodNumber, $ZodObject, $ZodOptional, $ZodString, $ZodType, $ZodUnion, $ZodUnknown, $constructor, __commonJS as __commonJS$1, __export as __export$2, __require as __require$1, __toESM as __toESM$1, _any, _boolean, _custom, _enum, _number, _string, _unknown, array as array$2, assetsResolver, assignProp, boolean as boolean$1, clone as clone$2, createAcontext, createResolver, defineLazy, delay, extend as extend$1, func_catch, func_remember, globFilesWithParams, globbySync, isDynamicPattern, iter_map_not_null, literal as literal$2, map_get_or_put, map_get_or_put_async, normalizeFilePath, normalizeParams, number as number$1, obj_assign_props, obj_props, object as object$1, parse as parse$5, parseAsync, partial as partial$1, reactiveFs, readJson, require_src as require_src$1, safeParse, safeParseAsync, string as string$1, timmers, toJSONSchema, toPath, traversePathUp, union as union$1, z, zod_default } from "./file-replacer-CZhq6MJJ.js";
3
- import { _gen_content, blue, bold, cyan, doGenPrompts, gray, green, italic as italic$1, magenta, red, simpleGit, underline as underline$1, yellow } from "./gen-prompt-3bZp8K__.js";
2
+ import { $ZodAny, $ZodArray, $ZodBoolean, $ZodCustom, $ZodLiteral, $ZodNumber, $ZodObject, $ZodOptional, $ZodString, $ZodType, $ZodUnion, $ZodUnknown, $constructor, __commonJS as __commonJS$1, __export as __export$2, __require as __require$1, __toESM as __toESM$1, _any, _boolean, _custom, _enum, _number, _string, _unknown, array as array$2, assignProp, boolean as boolean$1, clone as clone$2, createAcontext, createResolver, defineLazy, delay, extend as extend$1, func_catch, func_remember, globFilesWithParams, globbySync, isDynamicPattern, iter_map_not_null, literal as literal$2, map_get_or_put, map_get_or_put_async, normalizeFilePath, normalizeParams, number as number$1, obj_assign_props, object as object$1, parse as parse$5, parseAsync, partial as partial$1, reactiveFs, require_src as require_src$1, safeParse, safeParseAsync, string as string$1, timmers, toJSONSchema, toPath, traversePathUp, union as union$1, z, zod_default } from "./file-replacer-D6j8Nj7r.js";
3
+ import { _gen_content, blue, bold, cyan, doGenPrompts, gray, green, italic as italic$1, magenta, red, simpleGit, underline as underline$1, yellow as yellow$1 } from "./gen-prompt-DqGDmpRI.js";
4
4
  import { createRequire } from "node:module";
5
5
  import { URL as URL$1, fileURLToPath, pathToFileURL } from "node:url";
6
6
  import path, { dirname } from "node:path";
7
- import fs, { appendFileSync, createReadStream, createWriteStream, existsSync, readFileSync, readdirSync, realpathSync, statSync, writeFileSync } from "node:fs";
7
+ import fs, { appendFileSync, createReadStream, createWriteStream, readFileSync, readdirSync, realpathSync, statSync, writeFileSync } from "node:fs";
8
8
  import assert3, { notStrictEqual, strictEqual } from "node:assert";
9
- import * as path$6 from "node:path";
10
- import path10, { basename, dirname as dirname$1, extname, join as join$1, normalize, relative, resolve } from "node:path";
9
+ import * as path$7 from "node:path";
10
+ import path$1, { basename, dirname as dirname$1, extname, join as join$1, normalize, relative, resolve } from "node:path";
11
11
  import fs3, { readFileSync as readFileSync$1, readdirSync as readdirSync$1, realpathSync as realpathSync$1, statSync as statSync$1, writeFile } from "node:fs";
12
12
  import { format, inspect } from "node:util";
13
13
  import * as url from "node:url";
@@ -1521,9 +1521,9 @@ const parser = new YargsParser({
1521
1521
  format,
1522
1522
  normalize,
1523
1523
  resolve,
1524
- require: (path$7) => {
1525
- if (typeof require$3 !== "undefined") return require$3(path$7);
1526
- else if (path$7.match(/\.json$/)) return JSON.parse(readFileSync$1(path$7, "utf8"));
1524
+ require: (path$8) => {
1525
+ if (typeof require$3 !== "undefined") return require$3(path$8);
1526
+ else if (path$8.match(/\.json$/)) return JSON.parse(readFileSync$1(path$8, "utf8"));
1527
1527
  else throw Error("only .json config files are supported in ESM");
1528
1528
  }
1529
1529
  });
@@ -1733,7 +1733,7 @@ var import_get_caller_file = /* @__PURE__ */ __toESM$1(require_get_caller_file()
1733
1733
  const __dirname$1 = fileURLToPath$1(import.meta.url);
1734
1734
  const mainFilename = __dirname$1.substring(0, __dirname$1.lastIndexOf("node_modules"));
1735
1735
  const require$2 = createRequire(import.meta.url);
1736
- var esm_default$4 = {
1736
+ var esm_default$2 = {
1737
1737
  assert: {
1738
1738
  notStrictEqual,
1739
1739
  strictEqual
@@ -4630,7 +4630,7 @@ function isYargsInstance(y) {
4630
4630
 
4631
4631
  //#endregion
4632
4632
  //#region ../../node_modules/.pnpm/yargs@18.0.0/node_modules/yargs/index.mjs
4633
- const Yargs = YargsFactory(esm_default$4);
4633
+ const Yargs = YargsFactory(esm_default$2);
4634
4634
  var yargs_default = Yargs;
4635
4635
 
4636
4636
  //#endregion
@@ -4758,7 +4758,6 @@ const func_throttle = (fn, wait = 0, options = {}) => {
4758
4758
  const isUpKey = (key$1) => key$1.name === "up" || key$1.name === "k" || key$1.ctrl && key$1.name === "p";
4759
4759
  const isDownKey = (key$1) => key$1.name === "down" || key$1.name === "j" || key$1.ctrl && key$1.name === "n";
4760
4760
  const isSpaceKey = (key$1) => key$1.name === "space";
4761
- const isBackspaceKey = (key$1) => key$1.name === "backspace";
4762
4761
  const isNumberKey = (key$1) => "1234567890".includes(key$1.name);
4763
4762
  const isEnterKey = (key$1) => key$1.name === "enter" || key$1.name === "return";
4764
4763
 
@@ -5263,7 +5262,7 @@ const fallbackSymbols$1 = {
5263
5262
  };
5264
5263
  const shouldUseMain$1 = isUnicodeSupported$1();
5265
5264
  const figures$1 = shouldUseMain$1 ? mainSymbols$1 : fallbackSymbols$1;
5266
- var esm_default$2 = figures$1;
5265
+ var esm_default = figures$1;
5267
5266
  const replacements$1 = Object.entries(specialMainSymbols$1);
5268
5267
 
5269
5268
  //#endregion
@@ -5272,7 +5271,7 @@ var import_yoctocolors_cjs$2 = /* @__PURE__ */ __toESM$1(require_yoctocolors_cjs
5272
5271
  const defaultTheme = {
5273
5272
  prefix: {
5274
5273
  idle: import_yoctocolors_cjs$2.default.blue("?"),
5275
- done: import_yoctocolors_cjs$2.default.green(esm_default$2.tick)
5274
+ done: import_yoctocolors_cjs$2.default.green(esm_default.tick)
5276
5275
  },
5277
5276
  spinner: {
5278
5277
  interval: 80,
@@ -7071,15 +7070,15 @@ var require_route = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/col
7071
7070
  };
7072
7071
  }
7073
7072
  function wrapConversion(toModel, graph) {
7074
- const path$7 = [graph[toModel].parent, toModel];
7073
+ const path$8 = [graph[toModel].parent, toModel];
7075
7074
  let fn = conversions$1[graph[toModel].parent][toModel];
7076
7075
  let cur = graph[toModel].parent;
7077
7076
  while (graph[cur].parent) {
7078
- path$7.unshift(graph[cur].parent);
7077
+ path$8.unshift(graph[cur].parent);
7079
7078
  fn = link(conversions$1[graph[cur].parent][cur], fn);
7080
7079
  cur = graph[cur].parent;
7081
7080
  }
7082
- fn.conversion = path$7;
7081
+ fn.conversion = path$8;
7083
7082
  return fn;
7084
7083
  }
7085
7084
  module.exports = function(fromModel) {
@@ -8061,7 +8060,7 @@ var import_yoctocolors_cjs$1 = /* @__PURE__ */ __toESM$1(require_yoctocolors_cjs
8061
8060
  * Used to space/separate choices group
8062
8061
  */
8063
8062
  var Separator = class {
8064
- separator = import_yoctocolors_cjs$1.default.dim(Array.from({ length: 15 }).join(esm_default$2.line));
8063
+ separator = import_yoctocolors_cjs$1.default.dim(Array.from({ length: 15 }).join(esm_default.line));
8065
8064
  type = "separator";
8066
8065
  constructor(separator) {
8067
8066
  if (separator) this.separator = separator;
@@ -8077,9 +8076,9 @@ var import_yoctocolors_cjs = /* @__PURE__ */ __toESM$1(require_yoctocolors_cjs()
8077
8076
  var import_ansi_escapes = /* @__PURE__ */ __toESM$1(require_ansi_escapes(), 1);
8078
8077
  const checkboxTheme = {
8079
8078
  icon: {
8080
- checked: import_yoctocolors_cjs.default.green(esm_default$2.circleFilled),
8081
- unchecked: esm_default$2.circle,
8082
- cursor: esm_default$2.pointer
8079
+ checked: import_yoctocolors_cjs.default.green(esm_default.circleFilled),
8080
+ unchecked: esm_default.circle,
8081
+ cursor: esm_default.pointer
8083
8082
  },
8084
8083
  style: {
8085
8084
  disabledChoice: (text) => import_yoctocolors_cjs.default.dim(`- ${text}`),
@@ -8130,7 +8129,7 @@ function normalizeChoices(choices) {
8130
8129
  return normalizedChoice;
8131
8130
  });
8132
8131
  }
8133
- var esm_default$3 = createPrompt((config, done) => {
8132
+ var esm_default$1 = createPrompt((config, done) => {
8134
8133
  const { instructions, pageSize = 7, loop = true, required, validate: validate$1 = () => true } = config;
8135
8134
  const shortcuts = {
8136
8135
  all: "a",
@@ -8244,110 +8243,6 @@ var esm_default$3 = createPrompt((config, done) => {
8244
8243
  return `${prefix} ${message}${helpTipTop}\n${page}${helpTipBottom}${choiceDescription}${error}${import_ansi_escapes.default.cursorHide}`;
8245
8244
  });
8246
8245
 
8247
- //#endregion
8248
- //#region ../../node_modules/.pnpm/@inquirer+confirm@5.1.14_@types+node@24.1.0/node_modules/@inquirer/confirm/dist/esm/index.js
8249
- function getBooleanValue(value, defaultValue) {
8250
- let answer = defaultValue !== false;
8251
- if (/^(y|yes)/i.test(value)) answer = true;
8252
- else if (/^(n|no)/i.test(value)) answer = false;
8253
- return answer;
8254
- }
8255
- function boolToString(value) {
8256
- return value ? "Yes" : "No";
8257
- }
8258
- var esm_default$1 = createPrompt((config, done) => {
8259
- const { transformer = boolToString } = config;
8260
- const [status, setStatus] = useState("idle");
8261
- const [value, setValue] = useState("");
8262
- const theme = makeTheme(config.theme);
8263
- const prefix = usePrefix({
8264
- status,
8265
- theme
8266
- });
8267
- useKeypress((key$1, rl) => {
8268
- if (isEnterKey(key$1)) {
8269
- const answer = getBooleanValue(value, config.default);
8270
- setValue(transformer(answer));
8271
- setStatus("done");
8272
- done(answer);
8273
- } else if (key$1.name === "tab") {
8274
- const answer = boolToString(!getBooleanValue(value, config.default));
8275
- rl.clearLine(0);
8276
- rl.write(answer);
8277
- setValue(answer);
8278
- } else setValue(rl.line);
8279
- });
8280
- let formattedValue = value;
8281
- let defaultValue = "";
8282
- if (status === "done") formattedValue = theme.style.answer(value);
8283
- else defaultValue = ` ${theme.style.defaultAnswer(config.default === false ? "y/N" : "Y/n")}`;
8284
- const message = theme.style.message(config.message, status);
8285
- return `${prefix} ${message}${defaultValue} ${formattedValue}`;
8286
- });
8287
-
8288
- //#endregion
8289
- //#region ../../node_modules/.pnpm/@inquirer+input@4.2.1_@types+node@24.1.0/node_modules/@inquirer/input/dist/esm/index.js
8290
- const inputTheme = { validationFailureMode: "keep" };
8291
- var esm_default = createPrompt((config, done) => {
8292
- const { required, validate: validate$1 = () => true, prefill = "tab" } = config;
8293
- const theme = makeTheme(inputTheme, config.theme);
8294
- const [status, setStatus] = useState("idle");
8295
- const [defaultValue = "", setDefaultValue] = useState(config.default);
8296
- const [errorMsg, setError] = useState();
8297
- const [value, setValue] = useState("");
8298
- const prefix = usePrefix({
8299
- status,
8300
- theme
8301
- });
8302
- useKeypress(async (key$1, rl) => {
8303
- if (status !== "idle") return;
8304
- if (isEnterKey(key$1)) {
8305
- const answer = value || defaultValue;
8306
- setStatus("loading");
8307
- const isValid = required && !answer ? "You must provide a value" : await validate$1(answer);
8308
- if (isValid === true) {
8309
- setValue(answer);
8310
- setStatus("done");
8311
- done(answer);
8312
- } else {
8313
- if (theme.validationFailureMode === "clear") setValue("");
8314
- else rl.write(value);
8315
- setError(isValid || "You must provide a valid value");
8316
- setStatus("idle");
8317
- }
8318
- } else if (isBackspaceKey(key$1) && !value) setDefaultValue(void 0);
8319
- else if (key$1.name === "tab" && !value) {
8320
- setDefaultValue(void 0);
8321
- rl.clearLine(0);
8322
- rl.write(defaultValue);
8323
- setValue(defaultValue);
8324
- } else {
8325
- setValue(rl.line);
8326
- setError(void 0);
8327
- }
8328
- });
8329
- useEffect((rl) => {
8330
- if (prefill === "editable" && defaultValue) {
8331
- rl.write(defaultValue);
8332
- setValue(defaultValue);
8333
- }
8334
- }, []);
8335
- const message = theme.style.message(config.message, status);
8336
- let formattedValue = value;
8337
- if (typeof config.transformer === "function") formattedValue = config.transformer(value, { isFinal: status === "done" });
8338
- else if (status === "done") formattedValue = theme.style.answer(value);
8339
- let defaultStr;
8340
- if (defaultValue && status !== "done" && !value) defaultStr = theme.style.defaultAnswer(defaultValue);
8341
- let error = "";
8342
- if (errorMsg) error = theme.style.error(errorMsg);
8343
- return [[
8344
- prefix,
8345
- message,
8346
- defaultStr,
8347
- formattedValue
8348
- ].filter((v) => v !== void 0).join(" "), error];
8349
- });
8350
-
8351
8246
  //#endregion
8352
8247
  //#region ../../node_modules/.pnpm/is-unicode-supported@2.1.0/node_modules/is-unicode-supported/index.js
8353
8248
  function isUnicodeSupported() {
@@ -18576,7 +18471,7 @@ var isUrlInstance = (value) => value instanceof URL;
18576
18471
  var isUrlString = (value) => typeof value === "string" && value.startsWith(URL_STRING_PREFIX);
18577
18472
  var isUrl$1 = (urlOrPath) => isUrlInstance(urlOrPath) || isUrlString(urlOrPath);
18578
18473
  var toPath$1 = (urlOrPath) => isUrl$1(urlOrPath) ? url.fileURLToPath(urlOrPath) : urlOrPath;
18579
- var toAbsolutePath = (urlOrPath) => urlOrPath ? path$6.resolve(isUrl$1(urlOrPath) ? url.fileURLToPath(urlOrPath) : urlOrPath) : urlOrPath;
18474
+ var toAbsolutePath = (urlOrPath) => urlOrPath ? path$7.resolve(isUrl$1(urlOrPath) ? url.fileURLToPath(urlOrPath) : urlOrPath) : urlOrPath;
18580
18475
  function partition2(array2, predicate) {
18581
18476
  const result = [[], []];
18582
18477
  for (const value of array2) result[predicate(value) ? 0 : 1].push(value);
@@ -18590,7 +18485,7 @@ async function findInDirectory(nameOrNames, { typeCheck, cwd: cwd$1, allowSymlin
18590
18485
  const directory = toAbsolutePath(cwd$1) ?? process2.cwd();
18591
18486
  const names = Array.isArray(nameOrNames) ? nameOrNames : [nameOrNames];
18592
18487
  for (const name$12 of names) {
18593
- const fileOrDirectory = path$6.join(directory, name$12);
18488
+ const fileOrDirectory = path$7.join(directory, name$12);
18594
18489
  const stats = await safeStat(fileOrDirectory, allowSymlinks);
18595
18490
  if (await typeCheck(stats) && (!filter2 || await filter2({
18596
18491
  name: name$12,
@@ -18620,13 +18515,13 @@ function* iterateDirectoryUp(from, to) {
18620
18515
  let directory = toAbsolutePath(from) ?? process2.cwd();
18621
18516
  let stopDirectory = toAbsolutePath(to);
18622
18517
  if (stopDirectory) {
18623
- const relation = path$6.relative(stopDirectory, directory);
18518
+ const relation = path$7.relative(stopDirectory, directory);
18624
18519
  if (relation[0] === "." || relation === directory) return;
18625
18520
  }
18626
- stopDirectory = stopDirectory ? directory.slice(0, stopDirectory.length) : path$6.parse(directory).root;
18521
+ stopDirectory = stopDirectory ? directory.slice(0, stopDirectory.length) : path$7.parse(directory).root;
18627
18522
  while (directory !== stopDirectory) {
18628
18523
  yield directory;
18629
- directory = path$6.dirname(directory);
18524
+ directory = path$7.dirname(directory);
18630
18525
  }
18631
18526
  yield stopDirectory;
18632
18527
  }
@@ -18701,7 +18596,7 @@ var searcher;
18701
18596
  async function findProjectRoot(startDirectory, options8) {
18702
18597
  searcher ?? (searcher = new DirectorySearcher(DIRECTORIES, { allowSymlinks: false }));
18703
18598
  const directory = await searcher.search(startDirectory, { cache: options8.shouldCache });
18704
- return directory ? path$6.dirname(directory) : void 0;
18599
+ return directory ? path$7.dirname(directory) : void 0;
18705
18600
  }
18706
18601
  function clearFindProjectRootCache() {
18707
18602
  searcher?.clearCache();
@@ -18744,13 +18639,13 @@ function clearEditorconfigCache() {
18744
18639
  editorconfigCache.clear();
18745
18640
  }
18746
18641
  async function loadEditorconfigInternal(file, { shouldCache }) {
18747
- const directory = path10.dirname(file);
18642
+ const directory = path$1.dirname(file);
18748
18643
  const root2 = await findProjectRoot(directory, { shouldCache });
18749
18644
  const editorConfig = await import_editorconfig.default.parse(file, { root: root2 });
18750
18645
  return editorconfig_to_prettier_default(editorConfig);
18751
18646
  }
18752
18647
  function loadEditorconfig(file, { shouldCache }) {
18753
- file = path10.resolve(file);
18648
+ file = path$1.resolve(file);
18754
18649
  if (!shouldCache || !editorconfigCache.has(file)) editorconfigCache.set(file, loadEditorconfigInternal(file, { shouldCache }));
18755
18650
  return editorconfigCache.get(file);
18756
18651
  }
@@ -20217,7 +20112,7 @@ async function readFile(file) {
20217
20112
  }
20218
20113
  }
20219
20114
  var read_file_default = readFile;
20220
- async function readJson$1(file) {
20115
+ async function readJson(file) {
20221
20116
  const content = await read_file_default(file);
20222
20117
  try {
20223
20118
  return parseJson(content);
@@ -20232,7 +20127,7 @@ async function importModuleDefault(file) {
20232
20127
  }
20233
20128
  async function readBunPackageJson(file) {
20234
20129
  try {
20235
- return await readJson$1(file);
20130
+ return await readJson(file);
20236
20131
  } catch (error) {
20237
20132
  try {
20238
20133
  return await importModuleDefault(file);
@@ -20244,7 +20139,7 @@ var loadConfigFromPackageJson = process.versions.bun ? async function loadConfig
20244
20139
  const { prettier } = await readBunPackageJson(file);
20245
20140
  return prettier;
20246
20141
  } : async function loadConfigFromPackageJson2(file) {
20247
- const { prettier } = await readJson$1(file);
20142
+ const { prettier } = await readJson(file);
20248
20143
  return prettier;
20249
20144
  };
20250
20145
  async function loadConfigFromPackageYaml(file) {
@@ -20286,7 +20181,7 @@ ${error.message}`;
20286
20181
  var loaders_default = {
20287
20182
  ".toml": loadToml,
20288
20183
  ".json5": loadJson5,
20289
- ".json": readJson$1,
20184
+ ".json": readJson,
20290
20185
  ".js": importModuleDefault,
20291
20186
  ".mjs": importModuleDefault,
20292
20187
  ".cjs": importModuleDefault,
@@ -20616,7 +20511,7 @@ function read2(jsonPath, { base, specifier }) {
20616
20511
  if (existing) return existing;
20617
20512
  let string$2;
20618
20513
  try {
20619
- string$2 = fs3.readFileSync(path10.toNamespacedPath(jsonPath), "utf8");
20514
+ string$2 = fs3.readFileSync(path$1.toNamespacedPath(jsonPath), "utf8");
20620
20515
  } catch (error) {
20621
20516
  const exception = error;
20622
20517
  if (exception.code !== "ENOENT") throw exception;
@@ -20775,7 +20670,7 @@ function emitLegacyIndexDeprecation(url3, packageJsonUrl, base, main) {
20775
20670
  const basePath = fileURLToPath$1(base);
20776
20671
  if (!main) process2.emitWarning(`No "main" or "exports" field defined in the package.json for ${packagePath} resolving the main entry point "${urlPath.slice(packagePath.length)}", imported from ${basePath}.
20777
20672
  Default "index" lookups for the main are deprecated for ES modules.`, "DeprecationWarning", "DEP0151");
20778
- else if (path10.resolve(packagePath, main) !== urlPath) process2.emitWarning(`Package ${packagePath} has a "main" field set to "${main}", excluding the full filename and extension to the resolved file at "${urlPath.slice(packagePath.length)}", imported from ${basePath}.
20673
+ else if (path$1.resolve(packagePath, main) !== urlPath) process2.emitWarning(`Package ${packagePath} has a "main" field set to "${main}", excluding the full filename and extension to the resolved file at "${urlPath.slice(packagePath.length)}", imported from ${basePath}.
20779
20674
  Automatic extension resolution of the "main" field is deprecated for ES modules.`, "DeprecationWarning", "DEP0151");
20780
20675
  }
20781
20676
  function tryStatSync(path14) {
@@ -20854,7 +20749,7 @@ function finalizeResolution(resolved, base, preserveSymlinks) {
20854
20749
  if (!preserveSymlinks) {
20855
20750
  const real = realpathSync$1(filePath);
20856
20751
  const { search, hash } = resolved;
20857
- resolved = pathToFileURL$1(real + (filePath.endsWith(path10.sep) ? "/" : ""));
20752
+ resolved = pathToFileURL$1(real + (filePath.endsWith(path$1.sep) ? "/" : ""));
20858
20753
  resolved.search = search;
20859
20754
  resolved.hash = hash;
20860
20755
  }
@@ -21245,7 +21140,7 @@ async function loadExternalConfig(externalConfig, configFile) {
21245
21140
  }
21246
21141
  var load_external_config_default = loadExternalConfig;
21247
21142
  async function loadConfig(configFile) {
21248
- const { base: fileName, ext: extension$1 } = path10.parse(configFile);
21143
+ const { base: fileName, ext: extension$1 } = path$1.parse(configFile);
21249
21144
  const load$3 = fileName === "package.json" ? loadConfigFromPackageJson : fileName === "package.yaml" ? loadConfigFromPackageYaml : loaders_default[extension$1];
21250
21145
  if (!load$3) throw new Error(`No loader specified for extension "${extension$1 || "noExt"}"`);
21251
21146
  let config = await load$3(configFile);
@@ -21263,12 +21158,12 @@ function clearPrettierConfigCache() {
21263
21158
  searchCache.clear();
21264
21159
  }
21265
21160
  function loadPrettierConfig(configFile, { shouldCache }) {
21266
- configFile = path10.resolve(configFile);
21161
+ configFile = path$1.resolve(configFile);
21267
21162
  if (!shouldCache || !loadCache.has(configFile)) loadCache.set(configFile, load_config_default(configFile));
21268
21163
  return loadCache.get(configFile);
21269
21164
  }
21270
21165
  function getSearchFunction(stopDirectory) {
21271
- stopDirectory = stopDirectory ? path10.resolve(stopDirectory) : void 0;
21166
+ stopDirectory = stopDirectory ? path$1.resolve(stopDirectory) : void 0;
21272
21167
  if (!searchCache.has(stopDirectory)) {
21273
21168
  const searcher2 = config_searcher_default(stopDirectory);
21274
21169
  const searchFunction = searcher2.search.bind(searcher2);
@@ -21277,7 +21172,7 @@ function getSearchFunction(stopDirectory) {
21277
21172
  return searchCache.get(stopDirectory);
21278
21173
  }
21279
21174
  function searchPrettierConfig(startDirectory, options8 = {}) {
21280
- startDirectory = startDirectory ? path10.resolve(startDirectory) : process.cwd();
21175
+ startDirectory = startDirectory ? path$1.resolve(startDirectory) : process.cwd();
21281
21176
  const stopDirectory = mockable_default.getPrettierConfigSearchStopDirectory();
21282
21177
  return getSearchFunction(stopDirectory)(startDirectory, { cache: options8.shouldCache });
21283
21178
  }
@@ -21294,7 +21189,7 @@ async function loadPrettierConfig2(file, options8) {
21294
21189
  const shouldCache = options8.useCache;
21295
21190
  let configFile = options8.config;
21296
21191
  if (!configFile) {
21297
- const directory = file ? path10.dirname(path10.resolve(file)) : void 0;
21192
+ const directory = file ? path$1.dirname(path$1.resolve(file)) : void 0;
21298
21193
  configFile = await searchPrettierConfig(directory, { shouldCache });
21299
21194
  }
21300
21195
  if (!configFile) return;
@@ -21316,18 +21211,18 @@ async function resolveConfig(fileUrlOrPath, options8) {
21316
21211
  ...editorConfigured,
21317
21212
  ...mergeOverrides(result, filePath)
21318
21213
  };
21319
- if (Array.isArray(merged.plugins)) merged.plugins = merged.plugins.map((value) => typeof value === "string" && value.startsWith(".") ? path10.resolve(path10.dirname(result.configFile), value) : value);
21214
+ if (Array.isArray(merged.plugins)) merged.plugins = merged.plugins.map((value) => typeof value === "string" && value.startsWith(".") ? path$1.resolve(path$1.dirname(result.configFile), value) : value);
21320
21215
  return merged;
21321
21216
  }
21322
21217
  async function resolveConfigFile(fileUrlOrPath) {
21323
- const directory = fileUrlOrPath ? path10.dirname(path10.resolve(toPath$1(fileUrlOrPath))) : void 0;
21218
+ const directory = fileUrlOrPath ? path$1.dirname(path$1.resolve(toPath$1(fileUrlOrPath))) : void 0;
21324
21219
  return await searchPrettierConfig(directory, { shouldCache: false }) ?? null;
21325
21220
  }
21326
21221
  function mergeOverrides(configResult, filePath) {
21327
21222
  const { config, configFile } = configResult || {};
21328
21223
  const { overrides,...options8 } = config || {};
21329
21224
  if (filePath && overrides) {
21330
- const relativeFilePath = path10.relative(path10.dirname(configFile), filePath);
21225
+ const relativeFilePath = path$1.relative(path$1.dirname(configFile), filePath);
21331
21226
  for (const override of overrides) if (pathMatchesGlobs(relativeFilePath, override.files, override.excludeFiles)) Object.assign(options8, override.options);
21332
21227
  }
21333
21228
  return options8;
@@ -24850,14 +24745,14 @@ function loadBuiltinPlugins() {
24850
24745
  }
24851
24746
  var load_builtin_plugins_default = loadBuiltinPlugins;
24852
24747
  function importFromDirectory(specifier, directory) {
24853
- return import_from_file_default(specifier, path10.join(directory, "noop.js"));
24748
+ return import_from_file_default(specifier, path$1.join(directory, "noop.js"));
24854
24749
  }
24855
24750
  var import_from_directory_default = importFromDirectory;
24856
24751
  async function importPlugin(name$12, cwd$1) {
24857
24752
  if (isUrl$1(name$12)) return import(name$12);
24858
- if (path10.isAbsolute(name$12)) return import(pathToFileURL$1(name$12).href);
24753
+ if (path$1.isAbsolute(name$12)) return import(pathToFileURL$1(name$12).href);
24859
24754
  try {
24860
- return await import(pathToFileURL$1(path10.resolve(name$12)).href);
24755
+ return await import(pathToFileURL$1(path$1.resolve(name$12)).href);
24861
24756
  } catch {
24862
24757
  return import_from_directory_default(name$12, cwd$1);
24863
24758
  }
@@ -24888,11 +24783,11 @@ function loadPlugins(plugins = []) {
24888
24783
  }
24889
24784
  var load_plugins_default = loadPlugins;
24890
24785
  var import_ignore = __toESM(require_ignore(), 1);
24891
- var slash = path10.sep === "\\" ? (filePath) => string_replace_all_default(false, filePath, "\\", "/") : (filePath) => filePath;
24786
+ var slash = path$1.sep === "\\" ? (filePath) => string_replace_all_default(false, filePath, "\\", "/") : (filePath) => filePath;
24892
24787
  function getRelativePath(file, ignoreFile) {
24893
24788
  const ignoreFilePath = toPath$1(ignoreFile);
24894
- const filePath = isUrl$1(file) ? url2.fileURLToPath(file) : path10.resolve(file);
24895
- return path10.relative(ignoreFilePath ? path10.dirname(ignoreFilePath) : process.cwd(), filePath);
24789
+ const filePath = isUrl$1(file) ? url2.fileURLToPath(file) : path$1.resolve(file);
24790
+ return path$1.relative(ignoreFilePath ? path$1.dirname(ignoreFilePath) : process.cwd(), filePath);
24896
24791
  }
24897
24792
  async function createSingleIsIgnoredFunction(ignoreFile, withNodeModules) {
24898
24793
  let content = "";
@@ -25146,15 +25041,15 @@ var src_default = index_exports;
25146
25041
  const logger = {
25147
25042
  info: (message) => console.log(cyan("[INFO]"), message),
25148
25043
  success: (message) => console.log(green("[SUCCESS]"), message),
25149
- warn: (message) => console.log(yellow("[WARN]"), message),
25044
+ warn: (message) => console.log(yellow$1("[WARN]"), message),
25150
25045
  error: (message) => console.error(red("[ERROR]"), message),
25151
25046
  file: (filePath) => magenta(filePath),
25152
- mode: (mode) => z(mode).with("add", () => green("❇️")).with("modify", () => yellow("✏️")).with("delete", () => red("❌")).with("rename", () => red("🔄")).with("rename+modify", () => red("🔀")).exhaustive(),
25047
+ mode: (mode) => z(mode).with("add", () => green("❇️")).with("modify", () => yellow$1("✏️")).with("delete", () => red("❌")).with("rename", () => red("🔄")).with("rename+modify", () => red("🔀")).exhaustive(),
25153
25048
  commitMessage: (title, detail) => {
25154
25049
  return [
25155
25050
  underline$1(bold(title)),
25156
25051
  "",
25157
- detail.replace(/\*\*(.+?)\*\*/g, (_, v) => bold(v)).replace(/__(.+?)__/g, (_, v) => italic$1(v)).replace(/`(.+?)`/g, (_, v) => yellow(v)),
25052
+ detail.replace(/\*\*(.+?)\*\*/g, (_, v) => bold(v)).replace(/__(.+?)__/g, (_, v) => italic$1(v)).replace(/`(.+?)`/g, (_, v) => yellow$1(v)),
25158
25053
  blue("_".repeat(process.stdout.columns || 40)),
25159
25054
  ""
25160
25055
  ].join("\n");
@@ -25244,7 +25139,7 @@ async function confirmAction(filesToUpdate, options) {
25244
25139
  checked: file.safe || !!options.allowUnsafe
25245
25140
  });
25246
25141
  }
25247
- const selectedFiles = await esm_default$3({
25142
+ const selectedFiles = await esm_default$1({
25248
25143
  message: [options.topMessage, "The following files will be overwritten:\n"].filter(Boolean).join("\n"),
25249
25144
  choices,
25250
25145
  pageSize: process.stdout.rows > 0 ? process.stdout.rows - 4 : filesToUpdate.length
@@ -25885,18 +25780,18 @@ var require_comlink = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/c
25885
25780
  console.warn(`Invalid origin '${ev.origin}' for comlink proxy`);
25886
25781
  return;
25887
25782
  }
25888
- const { id, type: type$1, path: path$7 } = Object.assign({ path: [] }, ev.data);
25783
+ const { id, type: type$1, path: path$8 } = Object.assign({ path: [] }, ev.data);
25889
25784
  const argumentList = (ev.data.argumentList || []).map(fromWireValue);
25890
25785
  let returnValue;
25891
25786
  try {
25892
- const parent = path$7.slice(0, -1).reduce((obj$1, prop) => obj$1[prop], obj);
25893
- const rawValue = path$7.reduce((obj$1, prop) => obj$1[prop], obj);
25787
+ const parent = path$8.slice(0, -1).reduce((obj$1, prop) => obj$1[prop], obj);
25788
+ const rawValue = path$8.reduce((obj$1, prop) => obj$1[prop], obj);
25894
25789
  switch (type$1) {
25895
25790
  case "GET":
25896
25791
  returnValue = rawValue;
25897
25792
  break;
25898
25793
  case "SET":
25899
- parent[path$7.slice(-1)[0]] = fromWireValue(ev.data.value);
25794
+ parent[path$8.slice(-1)[0]] = fromWireValue(ev.data.value);
25900
25795
  returnValue = true;
25901
25796
  break;
25902
25797
  case "APPLY":
@@ -25992,7 +25887,7 @@ var require_comlink = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/c
25992
25887
  function unregisterProxy(proxy$2) {
25993
25888
  if (proxyFinalizers) proxyFinalizers.unregister(proxy$2);
25994
25889
  }
25995
- function createProxy(ep, pendingListeners, path$7 = [], target = function() {}) {
25890
+ function createProxy(ep, pendingListeners, path$8 = [], target = function() {}) {
25996
25891
  let isProxyReleased = false;
25997
25892
  const proxy$2 = new Proxy(target, {
25998
25893
  get(_target, prop) {
@@ -26004,33 +25899,33 @@ var require_comlink = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/c
26004
25899
  isProxyReleased = true;
26005
25900
  };
26006
25901
  if (prop === "then") {
26007
- if (path$7.length === 0) return { then: () => proxy$2 };
25902
+ if (path$8.length === 0) return { then: () => proxy$2 };
26008
25903
  const r = requestResponseMessage(ep, pendingListeners, {
26009
25904
  type: "GET",
26010
- path: path$7.map((p) => p.toString())
25905
+ path: path$8.map((p) => p.toString())
26011
25906
  }).then(fromWireValue);
26012
25907
  return r.then.bind(r);
26013
25908
  }
26014
- return createProxy(ep, pendingListeners, [...path$7, prop]);
25909
+ return createProxy(ep, pendingListeners, [...path$8, prop]);
26015
25910
  },
26016
25911
  set(_target, prop, rawValue) {
26017
25912
  throwIfProxyReleased(isProxyReleased);
26018
25913
  const [value, transferables] = toWireValue(rawValue);
26019
25914
  return requestResponseMessage(ep, pendingListeners, {
26020
25915
  type: "SET",
26021
- path: [...path$7, prop].map((p) => p.toString()),
25916
+ path: [...path$8, prop].map((p) => p.toString()),
26022
25917
  value
26023
25918
  }, transferables).then(fromWireValue);
26024
25919
  },
26025
25920
  apply(_target, _thisArg, rawArgumentList) {
26026
25921
  throwIfProxyReleased(isProxyReleased);
26027
- const last = path$7[path$7.length - 1];
25922
+ const last = path$8[path$8.length - 1];
26028
25923
  if (last === createEndpoint$1) return requestResponseMessage(ep, pendingListeners, { type: "ENDPOINT" }).then(fromWireValue);
26029
- if (last === "bind") return createProxy(ep, pendingListeners, path$7.slice(0, -1));
25924
+ if (last === "bind") return createProxy(ep, pendingListeners, path$8.slice(0, -1));
26030
25925
  const [argumentList, transferables] = processArguments(rawArgumentList);
26031
25926
  return requestResponseMessage(ep, pendingListeners, {
26032
25927
  type: "APPLY",
26033
- path: path$7.map((p) => p.toString()),
25928
+ path: path$8.map((p) => p.toString()),
26034
25929
  argumentList
26035
25930
  }, transferables).then(fromWireValue);
26036
25931
  },
@@ -26039,7 +25934,7 @@ var require_comlink = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/c
26039
25934
  const [argumentList, transferables] = processArguments(rawArgumentList);
26040
25935
  return requestResponseMessage(ep, pendingListeners, {
26041
25936
  type: "CONSTRUCT",
26042
- path: path$7.map((p) => p.toString()),
25937
+ path: path$8.map((p) => p.toString()),
26043
25938
  argumentList
26044
25939
  }, transferables).then(fromWireValue);
26045
25940
  }
@@ -26335,13 +26230,13 @@ var require_polyfills = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm
26335
26230
  fs$10.fstatSync = statFixSync(fs$10.fstatSync);
26336
26231
  fs$10.lstatSync = statFixSync(fs$10.lstatSync);
26337
26232
  if (fs$10.chmod && !fs$10.lchmod) {
26338
- fs$10.lchmod = function(path$7, mode, cb) {
26233
+ fs$10.lchmod = function(path$8, mode, cb) {
26339
26234
  if (cb) process.nextTick(cb);
26340
26235
  };
26341
26236
  fs$10.lchmodSync = function() {};
26342
26237
  }
26343
26238
  if (fs$10.chown && !fs$10.lchown) {
26344
- fs$10.lchown = function(path$7, uid, gid, cb) {
26239
+ fs$10.lchown = function(path$8, uid, gid, cb) {
26345
26240
  if (cb) process.nextTick(cb);
26346
26241
  };
26347
26242
  fs$10.lchownSync = function() {};
@@ -26400,8 +26295,8 @@ var require_polyfills = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm
26400
26295
  };
26401
26296
  })(fs$10.readSync);
26402
26297
  function patchLchmod(fs$11) {
26403
- fs$11.lchmod = function(path$7, mode, callback) {
26404
- fs$11.open(path$7, constants$1.O_WRONLY | constants$1.O_SYMLINK, mode, function(err, fd) {
26298
+ fs$11.lchmod = function(path$8, mode, callback) {
26299
+ fs$11.open(path$8, constants$1.O_WRONLY | constants$1.O_SYMLINK, mode, function(err, fd) {
26405
26300
  if (err) {
26406
26301
  if (callback) callback(err);
26407
26302
  return;
@@ -26413,8 +26308,8 @@ var require_polyfills = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm
26413
26308
  });
26414
26309
  });
26415
26310
  };
26416
- fs$11.lchmodSync = function(path$7, mode) {
26417
- var fd = fs$11.openSync(path$7, constants$1.O_WRONLY | constants$1.O_SYMLINK, mode);
26311
+ fs$11.lchmodSync = function(path$8, mode) {
26312
+ var fd = fs$11.openSync(path$8, constants$1.O_WRONLY | constants$1.O_SYMLINK, mode);
26418
26313
  var threw = true;
26419
26314
  var ret;
26420
26315
  try {
@@ -26431,8 +26326,8 @@ var require_polyfills = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm
26431
26326
  }
26432
26327
  function patchLutimes(fs$11) {
26433
26328
  if (constants$1.hasOwnProperty("O_SYMLINK") && fs$11.futimes) {
26434
- fs$11.lutimes = function(path$7, at$2, mt, cb) {
26435
- fs$11.open(path$7, constants$1.O_SYMLINK, function(er, fd) {
26329
+ fs$11.lutimes = function(path$8, at$2, mt, cb) {
26330
+ fs$11.open(path$8, constants$1.O_SYMLINK, function(er, fd) {
26436
26331
  if (er) {
26437
26332
  if (cb) cb(er);
26438
26333
  return;
@@ -26444,8 +26339,8 @@ var require_polyfills = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm
26444
26339
  });
26445
26340
  });
26446
26341
  };
26447
- fs$11.lutimesSync = function(path$7, at$2, mt) {
26448
- var fd = fs$11.openSync(path$7, constants$1.O_SYMLINK);
26342
+ fs$11.lutimesSync = function(path$8, at$2, mt) {
26343
+ var fd = fs$11.openSync(path$8, constants$1.O_SYMLINK);
26449
26344
  var ret;
26450
26345
  var threw = true;
26451
26346
  try {
@@ -26553,11 +26448,11 @@ var require_legacy_streams = /* @__PURE__ */ __commonJS$1({ "../../node_modules/
26553
26448
  ReadStream,
26554
26449
  WriteStream
26555
26450
  };
26556
- function ReadStream(path$7, options) {
26557
- if (!(this instanceof ReadStream)) return new ReadStream(path$7, options);
26451
+ function ReadStream(path$8, options) {
26452
+ if (!(this instanceof ReadStream)) return new ReadStream(path$8, options);
26558
26453
  Stream.call(this);
26559
26454
  var self$1 = this;
26560
- this.path = path$7;
26455
+ this.path = path$8;
26561
26456
  this.fd = null;
26562
26457
  this.readable = true;
26563
26458
  this.paused = false;
@@ -26595,10 +26490,10 @@ var require_legacy_streams = /* @__PURE__ */ __commonJS$1({ "../../node_modules/
26595
26490
  self$1._read();
26596
26491
  });
26597
26492
  }
26598
- function WriteStream(path$7, options) {
26599
- if (!(this instanceof WriteStream)) return new WriteStream(path$7, options);
26493
+ function WriteStream(path$8, options) {
26494
+ if (!(this instanceof WriteStream)) return new WriteStream(path$8, options);
26600
26495
  Stream.call(this);
26601
- this.path = path$7;
26496
+ this.path = path$8;
26602
26497
  this.fd = null;
26603
26498
  this.writable = true;
26604
26499
  this.flags = "w";
@@ -26722,15 +26617,15 @@ var require_graceful_fs = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pn
26722
26617
  fs$10.createWriteStream = createWriteStream$1;
26723
26618
  var fs$readFile = fs$10.readFile;
26724
26619
  fs$10.readFile = readFile$1;
26725
- function readFile$1(path$7, options, cb) {
26620
+ function readFile$1(path$8, options, cb) {
26726
26621
  if (typeof options === "function") cb = options, options = null;
26727
- return go$readFile(path$7, options, cb);
26728
- function go$readFile(path$8, options$1, cb$1, startTime) {
26729
- return fs$readFile(path$8, options$1, function(err) {
26622
+ return go$readFile(path$8, options, cb);
26623
+ function go$readFile(path$9, options$1, cb$1, startTime) {
26624
+ return fs$readFile(path$9, options$1, function(err) {
26730
26625
  if (err && (err.code === "EMFILE" || err.code === "ENFILE")) enqueue([
26731
26626
  go$readFile,
26732
26627
  [
26733
- path$8,
26628
+ path$9,
26734
26629
  options$1,
26735
26630
  cb$1
26736
26631
  ],
@@ -26744,15 +26639,15 @@ var require_graceful_fs = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pn
26744
26639
  }
26745
26640
  var fs$writeFile = fs$10.writeFile;
26746
26641
  fs$10.writeFile = writeFile$2;
26747
- function writeFile$2(path$7, data, options, cb) {
26642
+ function writeFile$2(path$8, data, options, cb) {
26748
26643
  if (typeof options === "function") cb = options, options = null;
26749
- return go$writeFile(path$7, data, options, cb);
26750
- function go$writeFile(path$8, data$1, options$1, cb$1, startTime) {
26751
- return fs$writeFile(path$8, data$1, options$1, function(err) {
26644
+ return go$writeFile(path$8, data, options, cb);
26645
+ function go$writeFile(path$9, data$1, options$1, cb$1, startTime) {
26646
+ return fs$writeFile(path$9, data$1, options$1, function(err) {
26752
26647
  if (err && (err.code === "EMFILE" || err.code === "ENFILE")) enqueue([
26753
26648
  go$writeFile,
26754
26649
  [
26755
- path$8,
26650
+ path$9,
26756
26651
  data$1,
26757
26652
  options$1,
26758
26653
  cb$1
@@ -26767,15 +26662,15 @@ var require_graceful_fs = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pn
26767
26662
  }
26768
26663
  var fs$appendFile = fs$10.appendFile;
26769
26664
  if (fs$appendFile) fs$10.appendFile = appendFile;
26770
- function appendFile(path$7, data, options, cb) {
26665
+ function appendFile(path$8, data, options, cb) {
26771
26666
  if (typeof options === "function") cb = options, options = null;
26772
- return go$appendFile(path$7, data, options, cb);
26773
- function go$appendFile(path$8, data$1, options$1, cb$1, startTime) {
26774
- return fs$appendFile(path$8, data$1, options$1, function(err) {
26667
+ return go$appendFile(path$8, data, options, cb);
26668
+ function go$appendFile(path$9, data$1, options$1, cb$1, startTime) {
26669
+ return fs$appendFile(path$9, data$1, options$1, function(err) {
26775
26670
  if (err && (err.code === "EMFILE" || err.code === "ENFILE")) enqueue([
26776
26671
  go$appendFile,
26777
26672
  [
26778
- path$8,
26673
+ path$9,
26779
26674
  data$1,
26780
26675
  options$1,
26781
26676
  cb$1
@@ -26817,20 +26712,20 @@ var require_graceful_fs = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pn
26817
26712
  var fs$readdir = fs$10.readdir;
26818
26713
  fs$10.readdir = readdir;
26819
26714
  var noReaddirOptionVersions = /^v[0-5]\./;
26820
- function readdir(path$7, options, cb) {
26715
+ function readdir(path$8, options, cb) {
26821
26716
  if (typeof options === "function") cb = options, options = null;
26822
- var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir$1(path$8, options$1, cb$1, startTime) {
26823
- return fs$readdir(path$8, fs$readdirCallback(path$8, options$1, cb$1, startTime));
26824
- } : function go$readdir$1(path$8, options$1, cb$1, startTime) {
26825
- return fs$readdir(path$8, options$1, fs$readdirCallback(path$8, options$1, cb$1, startTime));
26717
+ var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir$1(path$9, options$1, cb$1, startTime) {
26718
+ return fs$readdir(path$9, fs$readdirCallback(path$9, options$1, cb$1, startTime));
26719
+ } : function go$readdir$1(path$9, options$1, cb$1, startTime) {
26720
+ return fs$readdir(path$9, options$1, fs$readdirCallback(path$9, options$1, cb$1, startTime));
26826
26721
  };
26827
- return go$readdir(path$7, options, cb);
26828
- function fs$readdirCallback(path$8, options$1, cb$1, startTime) {
26722
+ return go$readdir(path$8, options, cb);
26723
+ function fs$readdirCallback(path$9, options$1, cb$1, startTime) {
26829
26724
  return function(err, files$1) {
26830
26725
  if (err && (err.code === "EMFILE" || err.code === "ENFILE")) enqueue([
26831
26726
  go$readdir,
26832
26727
  [
26833
- path$8,
26728
+ path$9,
26834
26729
  options$1,
26835
26730
  cb$1
26836
26731
  ],
@@ -26902,7 +26797,7 @@ var require_graceful_fs = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pn
26902
26797
  enumerable: true,
26903
26798
  configurable: true
26904
26799
  });
26905
- function ReadStream(path$7, options) {
26800
+ function ReadStream(path$8, options) {
26906
26801
  if (this instanceof ReadStream) return fs$ReadStream.apply(this, arguments), this;
26907
26802
  else return ReadStream.apply(Object.create(ReadStream.prototype), arguments);
26908
26803
  }
@@ -26919,7 +26814,7 @@ var require_graceful_fs = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pn
26919
26814
  }
26920
26815
  });
26921
26816
  }
26922
- function WriteStream(path$7, options) {
26817
+ function WriteStream(path$8, options) {
26923
26818
  if (this instanceof WriteStream) return fs$WriteStream.apply(this, arguments), this;
26924
26819
  else return WriteStream.apply(Object.create(WriteStream.prototype), arguments);
26925
26820
  }
@@ -26935,23 +26830,23 @@ var require_graceful_fs = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pn
26935
26830
  }
26936
26831
  });
26937
26832
  }
26938
- function createReadStream$1(path$7, options) {
26939
- return new fs$10.ReadStream(path$7, options);
26833
+ function createReadStream$1(path$8, options) {
26834
+ return new fs$10.ReadStream(path$8, options);
26940
26835
  }
26941
- function createWriteStream$1(path$7, options) {
26942
- return new fs$10.WriteStream(path$7, options);
26836
+ function createWriteStream$1(path$8, options) {
26837
+ return new fs$10.WriteStream(path$8, options);
26943
26838
  }
26944
26839
  var fs$open = fs$10.open;
26945
26840
  fs$10.open = open;
26946
- function open(path$7, flags, mode, cb) {
26841
+ function open(path$8, flags, mode, cb) {
26947
26842
  if (typeof mode === "function") cb = mode, mode = null;
26948
- return go$open(path$7, flags, mode, cb);
26949
- function go$open(path$8, flags$1, mode$1, cb$1, startTime) {
26950
- return fs$open(path$8, flags$1, mode$1, function(err, fd) {
26843
+ return go$open(path$8, flags, mode, cb);
26844
+ function go$open(path$9, flags$1, mode$1, cb$1, startTime) {
26845
+ return fs$open(path$9, flags$1, mode$1, function(err, fd) {
26951
26846
  if (err && (err.code === "EMFILE" || err.code === "ENFILE")) enqueue([
26952
26847
  go$open,
26953
26848
  [
26954
- path$8,
26849
+ path$9,
26955
26850
  flags$1,
26956
26851
  mode$1,
26957
26852
  cb$1
@@ -27364,7 +27259,7 @@ var require_mtime_precision = /* @__PURE__ */ __commonJS$1({ "../../node_modules
27364
27259
  //#endregion
27365
27260
  //#region ../../node_modules/.pnpm/proper-lockfile@4.1.2/node_modules/proper-lockfile/lib/lockfile.js
27366
27261
  var require_lockfile = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/proper-lockfile@4.1.2/node_modules/proper-lockfile/lib/lockfile.js": ((exports, module) => {
27367
- const path$5 = __require$1("path");
27262
+ const path$6 = __require$1("path");
27368
27263
  const fs$7 = require_graceful_fs();
27369
27264
  const retry = require_retry();
27370
27265
  const onExit$1 = require_signal_exit();
@@ -27374,7 +27269,7 @@ var require_lockfile = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/
27374
27269
  return options.lockfilePath || `${file}.lock`;
27375
27270
  }
27376
27271
  function resolveCanonicalPath(file, options, callback) {
27377
- if (!options.realpath) return callback(null, path$5.resolve(file));
27272
+ if (!options.realpath) return callback(null, path$6.resolve(file));
27378
27273
  options.fs.realpath(file, callback);
27379
27274
  }
27380
27275
  function acquireLock(file, options, callback) {
@@ -29043,7 +28938,7 @@ const strikethrough = format$3(9, 29);
29043
28938
  const black = format$3(30, 39);
29044
28939
  const red$1 = format$3(31, 39);
29045
28940
  const green$1 = format$3(32, 39);
29046
- const yellow$1 = format$3(33, 39);
28941
+ const yellow = format$3(33, 39);
29047
28942
  const blue$1 = format$3(34, 39);
29048
28943
  const magenta$1 = format$3(35, 39);
29049
28944
  const cyan$1 = format$3(36, 39);
@@ -29220,28 +29115,28 @@ var require_windows = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/i
29220
29115
  module.exports = isexe$3;
29221
29116
  isexe$3.sync = sync$3;
29222
29117
  var fs$5 = __require$1("fs");
29223
- function checkPathExt(path$7, options) {
29118
+ function checkPathExt(path$8, options) {
29224
29119
  var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT;
29225
29120
  if (!pathext) return true;
29226
29121
  pathext = pathext.split(";");
29227
29122
  if (pathext.indexOf("") !== -1) return true;
29228
29123
  for (var i$1 = 0; i$1 < pathext.length; i$1++) {
29229
29124
  var p = pathext[i$1].toLowerCase();
29230
- if (p && path$7.substr(-p.length).toLowerCase() === p) return true;
29125
+ if (p && path$8.substr(-p.length).toLowerCase() === p) return true;
29231
29126
  }
29232
29127
  return false;
29233
29128
  }
29234
- function checkStat$1(stat, path$7, options) {
29129
+ function checkStat$1(stat, path$8, options) {
29235
29130
  if (!stat.isSymbolicLink() && !stat.isFile()) return false;
29236
- return checkPathExt(path$7, options);
29131
+ return checkPathExt(path$8, options);
29237
29132
  }
29238
- function isexe$3(path$7, options, cb) {
29239
- fs$5.stat(path$7, function(er, stat) {
29240
- cb(er, er ? false : checkStat$1(stat, path$7, options));
29133
+ function isexe$3(path$8, options, cb) {
29134
+ fs$5.stat(path$8, function(er, stat) {
29135
+ cb(er, er ? false : checkStat$1(stat, path$8, options));
29241
29136
  });
29242
29137
  }
29243
- function sync$3(path$7, options) {
29244
- return checkStat$1(fs$5.statSync(path$7), path$7, options);
29138
+ function sync$3(path$8, options) {
29139
+ return checkStat$1(fs$5.statSync(path$8), path$8, options);
29245
29140
  }
29246
29141
  }) });
29247
29142
 
@@ -29251,13 +29146,13 @@ var require_mode = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/isex
29251
29146
  module.exports = isexe$2;
29252
29147
  isexe$2.sync = sync$2;
29253
29148
  var fs$4 = __require$1("fs");
29254
- function isexe$2(path$7, options, cb) {
29255
- fs$4.stat(path$7, function(er, stat) {
29149
+ function isexe$2(path$8, options, cb) {
29150
+ fs$4.stat(path$8, function(er, stat) {
29256
29151
  cb(er, er ? false : checkStat(stat, options));
29257
29152
  });
29258
29153
  }
29259
- function sync$2(path$7, options) {
29260
- return checkStat(fs$4.statSync(path$7), options);
29154
+ function sync$2(path$8, options) {
29155
+ return checkStat(fs$4.statSync(path$8), options);
29261
29156
  }
29262
29157
  function checkStat(stat, options) {
29263
29158
  return stat.isFile() && checkMode(stat, options);
@@ -29285,7 +29180,7 @@ var require_isexe = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/ise
29285
29180
  else core = require_mode();
29286
29181
  module.exports = isexe$1;
29287
29182
  isexe$1.sync = sync$1;
29288
- function isexe$1(path$7, options, cb) {
29183
+ function isexe$1(path$8, options, cb) {
29289
29184
  if (typeof options === "function") {
29290
29185
  cb = options;
29291
29186
  options = {};
@@ -29293,13 +29188,13 @@ var require_isexe = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/ise
29293
29188
  if (!cb) {
29294
29189
  if (typeof Promise !== "function") throw new TypeError("callback not provided");
29295
29190
  return new Promise(function(resolve$1, reject) {
29296
- isexe$1(path$7, options || {}, function(er, is) {
29191
+ isexe$1(path$8, options || {}, function(er, is) {
29297
29192
  if (er) reject(er);
29298
29193
  else resolve$1(is);
29299
29194
  });
29300
29195
  });
29301
29196
  }
29302
- core(path$7, options || {}, function(er, is) {
29197
+ core(path$8, options || {}, function(er, is) {
29303
29198
  if (er) {
29304
29199
  if (er.code === "EACCES" || options && options.ignoreErrors) {
29305
29200
  er = null;
@@ -29309,9 +29204,9 @@ var require_isexe = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/ise
29309
29204
  cb(er, is);
29310
29205
  });
29311
29206
  }
29312
- function sync$1(path$7, options) {
29207
+ function sync$1(path$8, options) {
29313
29208
  try {
29314
- return core.sync(path$7, options || {});
29209
+ return core.sync(path$8, options || {});
29315
29210
  } catch (er) {
29316
29211
  if (options && options.ignoreErrors || er.code === "EACCES") return false;
29317
29212
  else throw er;
@@ -29323,7 +29218,7 @@ var require_isexe = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/ise
29323
29218
  //#region ../../node_modules/.pnpm/which@2.0.2/node_modules/which/which.js
29324
29219
  var require_which = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/which@2.0.2/node_modules/which/which.js": ((exports, module) => {
29325
29220
  const isWindows = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
29326
- const path$4 = __require$1("path");
29221
+ const path$5 = __require$1("path");
29327
29222
  const COLON = isWindows ? ";" : ":";
29328
29223
  const isexe = require_isexe();
29329
29224
  const getNotFoundError = (cmd) => Object.assign(/* @__PURE__ */ new Error(`not found: ${cmd}`), { code: "ENOENT" });
@@ -29353,7 +29248,7 @@ var require_which = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/whi
29353
29248
  if (i$1 === pathEnv.length) return opt.all && found.length ? resolve$1(found) : reject(getNotFoundError(cmd));
29354
29249
  const ppRaw = pathEnv[i$1];
29355
29250
  const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
29356
- const pCmd = path$4.join(pathPart, cmd);
29251
+ const pCmd = path$5.join(pathPart, cmd);
29357
29252
  const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
29358
29253
  resolve$1(subStep(p, i$1, 0));
29359
29254
  });
@@ -29375,7 +29270,7 @@ var require_which = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/whi
29375
29270
  for (let i$1 = 0; i$1 < pathEnv.length; i$1++) {
29376
29271
  const ppRaw = pathEnv[i$1];
29377
29272
  const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
29378
- const pCmd = path$4.join(pathPart, cmd);
29273
+ const pCmd = path$5.join(pathPart, cmd);
29379
29274
  const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
29380
29275
  for (let j = 0; j < pathExt.length; j++) {
29381
29276
  const cur = p + pathExt[j];
@@ -29408,7 +29303,7 @@ var require_path_key = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/
29408
29303
  //#endregion
29409
29304
  //#region ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js
29410
29305
  var require_resolveCommand = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js": ((exports, module) => {
29411
- const path$3 = __require$1("path");
29306
+ const path$4 = __require$1("path");
29412
29307
  const which = require_which();
29413
29308
  const getPathKey = require_path_key();
29414
29309
  function resolveCommandAttempt(parsed, withoutPathExt) {
@@ -29423,12 +29318,12 @@ var require_resolveCommand = /* @__PURE__ */ __commonJS$1({ "../../node_modules/
29423
29318
  try {
29424
29319
  resolved = which.sync(parsed.command, {
29425
29320
  path: env$1[getPathKey({ env: env$1 })],
29426
- pathExt: withoutPathExt ? path$3.delimiter : void 0
29321
+ pathExt: withoutPathExt ? path$4.delimiter : void 0
29427
29322
  });
29428
29323
  } catch (e) {} finally {
29429
29324
  if (shouldSwitchCwd) process.chdir(cwd$1);
29430
29325
  }
29431
- if (resolved) resolved = path$3.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
29326
+ if (resolved) resolved = path$4.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
29432
29327
  return resolved;
29433
29328
  }
29434
29329
  function resolveCommand$1(parsed) {
@@ -29471,8 +29366,8 @@ var require_shebang_command = /* @__PURE__ */ __commonJS$1({ "../../node_modules
29471
29366
  module.exports = (string$2 = "") => {
29472
29367
  const match = string$2.match(shebangRegex);
29473
29368
  if (!match) return null;
29474
- const [path$7, argument] = match[0].replace(/#! ?/, "").split(" ");
29475
- const binary = path$7.split("/").pop();
29369
+ const [path$8, argument] = match[0].replace(/#! ?/, "").split(" ");
29370
+ const binary = path$8.split("/").pop();
29476
29371
  if (binary === "env") return argument;
29477
29372
  return argument ? `${binary} ${argument}` : binary;
29478
29373
  };
@@ -29500,7 +29395,7 @@ var require_readShebang = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pn
29500
29395
  //#endregion
29501
29396
  //#region ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js
29502
29397
  var require_parse = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js": ((exports, module) => {
29503
- const path$2 = __require$1("path");
29398
+ const path$3 = __require$1("path");
29504
29399
  const resolveCommand = require_resolveCommand();
29505
29400
  const escape = require_escape();
29506
29401
  const readShebang = require_readShebang();
@@ -29523,7 +29418,7 @@ var require_parse = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/cro
29523
29418
  const needsShell = !isExecutableRegExp.test(commandFile);
29524
29419
  if (parsed.options.forceShell || needsShell) {
29525
29420
  const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
29526
- parsed.command = path$2.normalize(parsed.command);
29421
+ parsed.command = path$3.normalize(parsed.command);
29527
29422
  parsed.command = escape.command(parsed.command);
29528
29423
  parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
29529
29424
  parsed.args = [
@@ -32635,12 +32530,12 @@ const logOutputSync = ({ serializedResult, fdNumber, state, verboseInfo, encodin
32635
32530
  }
32636
32531
  };
32637
32532
  const writeToFiles = (serializedResult, stdioItems, outputFiles) => {
32638
- for (const { path: path$7, append } of stdioItems.filter(({ type: type$1 }) => FILE_TYPES.has(type$1))) {
32639
- const pathString = typeof path$7 === "string" ? path$7 : path$7.toString();
32640
- if (append || outputFiles.has(pathString)) appendFileSync(path$7, serializedResult);
32533
+ for (const { path: path$8, append } of stdioItems.filter(({ type: type$1 }) => FILE_TYPES.has(type$1))) {
32534
+ const pathString = typeof path$8 === "string" ? path$8 : path$8.toString();
32535
+ if (append || outputFiles.has(pathString)) appendFileSync(path$8, serializedResult);
32641
32536
  else {
32642
32537
  outputFiles.add(pathString);
32643
- writeFileSync(path$7, serializedResult);
32538
+ writeFileSync(path$8, serializedResult);
32644
32539
  }
32645
32540
  }
32646
32541
  };
@@ -35259,7 +35154,7 @@ var SessionAPI = class {
35259
35154
  }
35260
35155
  async resolvePaths(paths) {
35261
35156
  const workDir = await this.getWorkDir();
35262
- return paths.map((p) => path10.resolve(workDir, p));
35157
+ return paths.map((p) => path$1.resolve(workDir, p));
35263
35158
  }
35264
35159
  async globFiles(patterns) {
35265
35160
  const workDir = await this.getWorkDir();
@@ -35473,34 +35368,6 @@ const doGoogleAiStudioAutomation = async ({ watch,...opts }) => {
35473
35368
  });
35474
35369
  };
35475
35370
 
35476
- //#endregion
35477
- //#region ../dev/dist/google-aistudio/jixo/init.js
35478
- const GET_JIXO_TOOLS = func_remember(() => readJson(assetsResolver("tools.json")));
35479
- const copyAssets = async (targetDir, options) => {
35480
- const tools = await GET_JIXO_TOOLS();
35481
- await mkdir(targetDir, { recursive: true });
35482
- for (const filename of obj_props(tools)) {
35483
- const destPath = path.join(targetDir, filename);
35484
- if (existsSync(destPath)) {
35485
- if (options.force === false) {
35486
- console.warn(yellow(`File already exists, skipping: ${filename}`));
35487
- continue;
35488
- }
35489
- if (options.force == null) {
35490
- if (!await esm_default$1({
35491
- message: `File '${blue(filename)}' already exists. Overwrite?`,
35492
- default: false
35493
- })) continue;
35494
- }
35495
- }
35496
- await writeFile$1(destPath, tools[filename]);
35497
- }
35498
- };
35499
- const doInit = (opts) => {
35500
- assetsResolver("bundle", "google-aistudio.browser.js");
35501
- return copyAssets(opts.dir, { force: opts.force });
35502
- };
35503
-
35504
35371
  //#endregion
35505
35372
  //#region ../../node_modules/.pnpm/ws@8.18.3_bufferutil@4.0.9/node_modules/ws/lib/constants.js
35506
35373
  var require_constants = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/ws@8.18.3_bufferutil@4.0.9/node_modules/ws/lib/constants.js": ((exports, module) => {
@@ -35528,7 +35395,7 @@ var require_constants = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm
35528
35395
  //#region ../../node_modules/.pnpm/node-gyp-build@4.8.4/node_modules/node-gyp-build/node-gyp-build.js
35529
35396
  var require_node_gyp_build$1 = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/node-gyp-build@4.8.4/node_modules/node-gyp-build/node-gyp-build.js": ((exports, module) => {
35530
35397
  var fs$2 = __require$1("fs");
35531
- var path$1 = __require$1("path");
35398
+ var path$2 = __require$1("path");
35532
35399
  var os = __require$1("os");
35533
35400
  var runtimeRequire$1 = typeof __webpack_require__ === "function" ? __non_webpack_require__ : __require$1;
35534
35401
  var vars = process.config && process.config.variables || {};
@@ -35545,20 +35412,20 @@ var require_node_gyp_build$1 = /* @__PURE__ */ __commonJS$1({ "../../node_module
35545
35412
  return runtimeRequire$1(load.resolve(dir));
35546
35413
  }
35547
35414
  load.resolve = load.path = function(dir) {
35548
- dir = path$1.resolve(dir || ".");
35415
+ dir = path$2.resolve(dir || ".");
35549
35416
  try {
35550
- var name$12 = runtimeRequire$1(path$1.join(dir, "package.json")).name.toUpperCase().replace(/-/g, "_");
35417
+ var name$12 = runtimeRequire$1(path$2.join(dir, "package.json")).name.toUpperCase().replace(/-/g, "_");
35551
35418
  if (process.env[name$12 + "_PREBUILD"]) dir = process.env[name$12 + "_PREBUILD"];
35552
35419
  } catch (err) {}
35553
35420
  if (!prebuildsOnly) {
35554
- var release = getFirst(path$1.join(dir, "build/Release"), matchBuild);
35421
+ var release = getFirst(path$2.join(dir, "build/Release"), matchBuild);
35555
35422
  if (release) return release;
35556
- var debug$5 = getFirst(path$1.join(dir, "build/Debug"), matchBuild);
35423
+ var debug$5 = getFirst(path$2.join(dir, "build/Debug"), matchBuild);
35557
35424
  if (debug$5) return debug$5;
35558
35425
  }
35559
35426
  var prebuild = resolve$1(dir);
35560
35427
  if (prebuild) return prebuild;
35561
- var nearby = resolve$1(path$1.dirname(process.execPath));
35428
+ var nearby = resolve$1(path$2.dirname(process.execPath));
35562
35429
  if (nearby) return nearby;
35563
35430
  var target = [
35564
35431
  "platform=" + platform$1,
@@ -35574,11 +35441,11 @@ var require_node_gyp_build$1 = /* @__PURE__ */ __commonJS$1({ "../../node_module
35574
35441
  ].filter(Boolean).join(" ");
35575
35442
  throw new Error("No native build was found for " + target + "\n loaded from: " + dir + "\n");
35576
35443
  function resolve$1(dir$1) {
35577
- var tuple = readdirSync$2(path$1.join(dir$1, "prebuilds")).map(parseTuple).filter(matchTuple(platform$1, arch)).sort(compareTuples)[0];
35444
+ var tuple = readdirSync$2(path$2.join(dir$1, "prebuilds")).map(parseTuple).filter(matchTuple(platform$1, arch)).sort(compareTuples)[0];
35578
35445
  if (!tuple) return;
35579
- var prebuilds = path$1.join(dir$1, "prebuilds", tuple.name);
35446
+ var prebuilds = path$2.join(dir$1, "prebuilds", tuple.name);
35580
35447
  var winner = readdirSync$2(prebuilds).map(parseTags).filter(matchTags(runtime, abi)).sort(compareTags(runtime))[0];
35581
- if (winner) return path$1.join(prebuilds, winner.file);
35448
+ if (winner) return path$2.join(prebuilds, winner.file);
35582
35449
  }
35583
35450
  };
35584
35451
  function readdirSync$2(dir) {
@@ -35590,7 +35457,7 @@ var require_node_gyp_build$1 = /* @__PURE__ */ __commonJS$1({ "../../node_module
35590
35457
  }
35591
35458
  function getFirst(dir, filter$1) {
35592
35459
  var files$1 = readdirSync$2(dir).filter(filter$1);
35593
- return files$1[0] && path$1.join(dir, files$1[0]);
35460
+ return files$1[0] && path$2.join(dir, files$1[0]);
35594
35461
  }
35595
35462
  function matchBuild(name$12) {
35596
35463
  return /\.node$/.test(name$12);
@@ -39406,7 +39273,7 @@ function startWsServer(port = 8765) {
39406
39273
  }
39407
39274
  });
39408
39275
  server.on("request", (req, res) => {
39409
- if (req.url?.startsWith("/init-session")) return initSession(req, res);
39276
+ if (req.url?.startsWith("/init-session")) return initSessionByHttp(req, res);
39410
39277
  });
39411
39278
  server.on("upgrade", (request, socket, head) => {
39412
39279
  wss.handleUpgrade(request, socket, head, (ws) => {
@@ -39421,7 +39288,7 @@ function startWsServer(port = 8765) {
39421
39288
  else console.error("HTTP Server error:", err);
39422
39289
  });
39423
39290
  }
39424
- const initSession = (req, res) => {
39291
+ const initSessionByHttp = (req, res) => {
39425
39292
  const url$1 = new URL$1(`http://${process.env.HOST ?? "localhost"}${req.url}`);
39426
39293
  const workDir = url$1.searchParams.get("workDir");
39427
39294
  if (!workDir) return res.writeHead(400).end("workDir is required");
@@ -39433,6 +39300,13 @@ const initSession = (req, res) => {
39433
39300
  session.api.setWorkDir(workDir);
39434
39301
  return res.writeHead(200).end();
39435
39302
  };
39303
+ const initSession = (nid, workDir) => {
39304
+ const sessionId = getSessionByNid(nid)?.api.sessionId;
39305
+ if (!sessionId) throw new Error(`No found sessionId by nid=${nid}`);
39306
+ const session = sessionWsMap.get(sessionId);
39307
+ if (!session) throw new Error("Session not found");
39308
+ session.api.setWorkDir(workDir);
39309
+ };
39436
39310
  const getSessionByNid = (nid) => {
39437
39311
  if (nid == null) return;
39438
39312
  if (typeof nid === "string") nid = parseInt(nid);
@@ -39575,27 +39449,23 @@ const browserCommand = {
39575
39449
  }
39576
39450
  };
39577
39451
  const initCommand = {
39578
- command: "init [dir]",
39452
+ command: "init <nid>",
39579
39453
  aliases: ["i", "I"],
39580
- describe: "init an browser-kit directory for aistudio.google.com",
39581
- builder: (yargs) => yargs.positional("dir", {
39582
- describe: "Directory for aistudio input/output contents",
39583
- type: "string"
39584
- }).option("force", {
39585
- alias: "F",
39586
- type: "boolean",
39587
- describe: "override exits files"
39454
+ describe: "init an chrome ext workspace aistudio.google.com",
39455
+ builder: (yargs) => yargs.positional("nid", {
39456
+ type: "number",
39457
+ demandOption: true
39458
+ }).option("dir", {
39459
+ alias: ["D", "d"],
39460
+ type: "string",
39461
+ describe: "Specify the workspace directory for chrome-ext"
39588
39462
  }),
39589
39463
  handler: async (argv) => {
39590
- let { dir } = argv;
39591
- if (dir == null) dir = await esm_default({
39592
- message: "No directory specified. Do you want to use the default '.ai' directory?",
39593
- default: ".ai"
39594
- });
39595
- doInit({
39596
- ...argv,
39597
- dir
39598
- });
39464
+ try {
39465
+ initSession(argv.nid, argv.dir ?? process.cwd());
39466
+ } catch (e) {
39467
+ console.error(red(e instanceof Error ? e.message : String(e)));
39468
+ }
39599
39469
  }
39600
39470
  };
39601
39471
  /**