sproutkit-code 0.1.2 → 0.2.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.
Files changed (2) hide show
  1. package/dist/index.js +497 -270
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -29,19 +29,19 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
29
29
  // ../../node_modules/electron/index.js
30
30
  var require_electron = __commonJS({
31
31
  "../../node_modules/electron/index.js"(exports2, module2) {
32
- var fs = require("fs");
33
- var path = require("path");
34
- var pathFile = path.join(__dirname, "path.txt");
32
+ var fs2 = require("fs");
33
+ var path2 = require("path");
34
+ var pathFile = path2.join(__dirname, "path.txt");
35
35
  function getElectronPath() {
36
36
  let executablePath;
37
- if (fs.existsSync(pathFile)) {
38
- executablePath = fs.readFileSync(pathFile, "utf-8");
37
+ if (fs2.existsSync(pathFile)) {
38
+ executablePath = fs2.readFileSync(pathFile, "utf-8");
39
39
  }
40
40
  if (process.env.ELECTRON_OVERRIDE_DIST_PATH) {
41
- return path.join(process.env.ELECTRON_OVERRIDE_DIST_PATH, executablePath || "electron");
41
+ return path2.join(process.env.ELECTRON_OVERRIDE_DIST_PATH, executablePath || "electron");
42
42
  }
43
43
  if (executablePath) {
44
- return path.join(__dirname, "dist", executablePath);
44
+ return path2.join(__dirname, "dist", executablePath);
45
45
  } else {
46
46
  throw new Error("Electron failed to install correctly, please delete node_modules/electron and try installing again");
47
47
  }
@@ -982,14 +982,14 @@ var require_url_state_machine = __commonJS({
982
982
  return url.replace(/\u0009|\u000A|\u000D/g, "");
983
983
  }
984
984
  function shortenPath(url) {
985
- const path = url.path;
986
- if (path.length === 0) {
985
+ const path2 = url.path;
986
+ if (path2.length === 0) {
987
987
  return;
988
988
  }
989
- if (url.scheme === "file" && path.length === 1 && isNormalizedWindowsDriveLetter(path[0])) {
989
+ if (url.scheme === "file" && path2.length === 1 && isNormalizedWindowsDriveLetter(path2[0])) {
990
990
  return;
991
991
  }
992
- path.pop();
992
+ path2.pop();
993
993
  }
994
994
  function includesCredentials(url) {
995
995
  return url.username !== "" || url.password !== "";
@@ -10824,14 +10824,14 @@ var require_fileFromPath = __commonJS({
10824
10824
  return "File";
10825
10825
  }
10826
10826
  };
10827
- function createFileFromPath(path, { mtimeMs, size }, filenameOrOptions, options = {}) {
10827
+ function createFileFromPath(path2, { mtimeMs, size }, filenameOrOptions, options = {}) {
10828
10828
  let filename;
10829
10829
  if ((0, isPlainObject_1.default)(filenameOrOptions)) {
10830
10830
  [options, filename] = [filenameOrOptions, void 0];
10831
10831
  } else {
10832
10832
  filename = filenameOrOptions;
10833
10833
  }
10834
- const file = new FileFromPath({ path, size, lastModified: mtimeMs });
10834
+ const file = new FileFromPath({ path: path2, size, lastModified: mtimeMs });
10835
10835
  if (!filename) {
10836
10836
  filename = file.name;
10837
10837
  }
@@ -10840,14 +10840,14 @@ var require_fileFromPath = __commonJS({
10840
10840
  lastModified: file.lastModified
10841
10841
  });
10842
10842
  }
10843
- function fileFromPathSync(path, filenameOrOptions, options = {}) {
10844
- const stats = (0, fs_1.statSync)(path);
10845
- return createFileFromPath(path, stats, filenameOrOptions, options);
10843
+ function fileFromPathSync(path2, filenameOrOptions, options = {}) {
10844
+ const stats = (0, fs_1.statSync)(path2);
10845
+ return createFileFromPath(path2, stats, filenameOrOptions, options);
10846
10846
  }
10847
10847
  exports2.fileFromPathSync = fileFromPathSync;
10848
- async function fileFromPath(path, filenameOrOptions, options) {
10849
- const stats = await fs_1.promises.stat(path);
10850
- return createFileFromPath(path, stats, filenameOrOptions, options);
10848
+ async function fileFromPath(path2, filenameOrOptions, options) {
10849
+ const stats = await fs_1.promises.stat(path2);
10850
+ return createFileFromPath(path2, stats, filenameOrOptions, options);
10851
10851
  }
10852
10852
  exports2.fileFromPath = fileFromPath;
10853
10853
  }
@@ -10899,13 +10899,13 @@ var require_node_runtime = __commonJS({
10899
10899
  var MultipartBody_1 = require_MultipartBody();
10900
10900
  var web_1 = require("node:stream/web");
10901
10901
  var fileFromPathWarned = false;
10902
- async function fileFromPath(path, ...args) {
10902
+ async function fileFromPath(path2, ...args) {
10903
10903
  const { fileFromPath: _fileFromPath } = await Promise.resolve().then(() => __importStar(require_fileFromPath()));
10904
10904
  if (!fileFromPathWarned) {
10905
- console.warn(`fileFromPath is deprecated; use fs.createReadStream(${JSON.stringify(path)}) instead`);
10905
+ console.warn(`fileFromPath is deprecated; use fs.createReadStream(${JSON.stringify(path2)}) instead`);
10906
10906
  fileFromPathWarned = true;
10907
10907
  }
10908
- return await _fileFromPath(path, ...args);
10908
+ return await _fileFromPath(path2, ...args);
10909
10909
  }
10910
10910
  var defaultHttpAgent = new agentkeepalive_1.default({ keepAlive: true, timeout: 5 * 60 * 1e3 });
10911
10911
  var defaultHttpsAgent = new agentkeepalive_1.default.HttpsAgent({ keepAlive: true, timeout: 5 * 60 * 1e3 });
@@ -11670,29 +11670,29 @@ var require_core = __commonJS({
11670
11670
  defaultIdempotencyKey() {
11671
11671
  return `stainless-node-retry-${uuid4()}`;
11672
11672
  }
11673
- get(path, opts) {
11674
- return this.methodRequest("get", path, opts);
11673
+ get(path2, opts) {
11674
+ return this.methodRequest("get", path2, opts);
11675
11675
  }
11676
- post(path, opts) {
11677
- return this.methodRequest("post", path, opts);
11676
+ post(path2, opts) {
11677
+ return this.methodRequest("post", path2, opts);
11678
11678
  }
11679
- patch(path, opts) {
11680
- return this.methodRequest("patch", path, opts);
11679
+ patch(path2, opts) {
11680
+ return this.methodRequest("patch", path2, opts);
11681
11681
  }
11682
- put(path, opts) {
11683
- return this.methodRequest("put", path, opts);
11682
+ put(path2, opts) {
11683
+ return this.methodRequest("put", path2, opts);
11684
11684
  }
11685
- delete(path, opts) {
11686
- return this.methodRequest("delete", path, opts);
11685
+ delete(path2, opts) {
11686
+ return this.methodRequest("delete", path2, opts);
11687
11687
  }
11688
- methodRequest(method, path, opts) {
11688
+ methodRequest(method, path2, opts) {
11689
11689
  return this.request(Promise.resolve(opts).then(async (opts2) => {
11690
11690
  const body = opts2 && (0, uploads_1.isBlobLike)(opts2?.body) ? new DataView(await opts2.body.arrayBuffer()) : opts2?.body instanceof DataView ? opts2.body : opts2?.body instanceof ArrayBuffer ? new DataView(opts2.body) : opts2 && ArrayBuffer.isView(opts2?.body) ? new DataView(opts2.body.buffer) : opts2?.body;
11691
- return { method, path, ...opts2, body };
11691
+ return { method, path: path2, ...opts2, body };
11692
11692
  }));
11693
11693
  }
11694
- getAPIList(path, Page, opts) {
11695
- return this.requestAPIList(Page, { method: "get", path, ...opts });
11694
+ getAPIList(path2, Page, opts) {
11695
+ return this.requestAPIList(Page, { method: "get", path: path2, ...opts });
11696
11696
  }
11697
11697
  calculateContentLength(body) {
11698
11698
  if (typeof body === "string") {
@@ -11710,10 +11710,10 @@ var require_core = __commonJS({
11710
11710
  return null;
11711
11711
  }
11712
11712
  buildRequest(options, { retryCount = 0 } = {}) {
11713
- const { method, path, query, headers = {} } = options;
11713
+ const { method, path: path2, query, headers = {} } = options;
11714
11714
  const body = ArrayBuffer.isView(options.body) || options.__binaryRequest && typeof options.body === "string" ? options.body : (0, uploads_1.isMultipartBody)(options.body) ? options.body.body : options.body ? JSON.stringify(options.body, null, 2) : null;
11715
11715
  const contentLength = this.calculateContentLength(body);
11716
- const url = this.buildURL(path, query);
11716
+ const url = this.buildURL(path2, query);
11717
11717
  if ("timeout" in options)
11718
11718
  validatePositiveInteger("timeout", options.timeout);
11719
11719
  const timeout = options.timeout ?? this.timeout;
@@ -11826,8 +11826,8 @@ var require_core = __commonJS({
11826
11826
  const request = this.makeRequest(options, null);
11827
11827
  return new PagePromise(this, request, Page);
11828
11828
  }
11829
- buildURL(path, query) {
11830
- const url = isAbsoluteURL(path) ? new URL(path) : new URL(this.baseURL + (this.baseURL.endsWith("/") && path.startsWith("/") ? path.slice(1) : path));
11829
+ buildURL(path2, query) {
11830
+ const url = isAbsoluteURL(path2) ? new URL(path2) : new URL(this.baseURL + (this.baseURL.endsWith("/") && path2.startsWith("/") ? path2.slice(1) : path2));
11831
11831
  const defaultQuery = this.defaultQuery();
11832
11832
  if (!isEmptyObj(defaultQuery)) {
11833
11833
  query = { ...defaultQuery, ...query };
@@ -23164,11 +23164,11 @@ var require_mime_types = __commonJS({
23164
23164
  }
23165
23165
  return exts[0];
23166
23166
  }
23167
- function lookup(path) {
23168
- if (!path || typeof path !== "string") {
23167
+ function lookup(path2) {
23168
+ if (!path2 || typeof path2 !== "string") {
23169
23169
  return false;
23170
23170
  }
23171
- var extension2 = extname("x." + path).toLowerCase().substr(1);
23171
+ var extension2 = extname("x." + path2).toLowerCase().substr(1);
23172
23172
  if (!extension2) {
23173
23173
  return false;
23174
23174
  }
@@ -24273,11 +24273,11 @@ var require_form_data = __commonJS({
24273
24273
  "use strict";
24274
24274
  var CombinedStream = require_combined_stream();
24275
24275
  var util = require("util");
24276
- var path = require("path");
24276
+ var path2 = require("path");
24277
24277
  var http = require("http");
24278
24278
  var https = require("https");
24279
24279
  var parseUrl = require("url").parse;
24280
- var fs = require("fs");
24280
+ var fs2 = require("fs");
24281
24281
  var Stream = require("stream").Stream;
24282
24282
  var crypto2 = require("crypto");
24283
24283
  var mime = require_mime_types();
@@ -24344,7 +24344,7 @@ var require_form_data = __commonJS({
24344
24344
  if (value.end != void 0 && value.end != Infinity && value.start != void 0) {
24345
24345
  callback(null, value.end + 1 - (value.start ? value.start : 0));
24346
24346
  } else {
24347
- fs.stat(value.path, function(err, stat) {
24347
+ fs2.stat(value.path, function(err, stat) {
24348
24348
  if (err) {
24349
24349
  callback(err);
24350
24350
  return;
@@ -24401,11 +24401,11 @@ var require_form_data = __commonJS({
24401
24401
  FormData2.prototype._getContentDisposition = function(value, options) {
24402
24402
  var filename;
24403
24403
  if (typeof options.filepath === "string") {
24404
- filename = path.normalize(options.filepath).replace(/\\/g, "/");
24404
+ filename = path2.normalize(options.filepath).replace(/\\/g, "/");
24405
24405
  } else if (options.filename || value && (value.name || value.path)) {
24406
- filename = path.basename(options.filename || value && (value.name || value.path));
24406
+ filename = path2.basename(options.filename || value && (value.name || value.path));
24407
24407
  } else if (value && value.readable && hasOwn(value, "httpVersion")) {
24408
- filename = path.basename(value.client._httpMessage.path || "");
24408
+ filename = path2.basename(value.client._httpMessage.path || "");
24409
24409
  }
24410
24410
  if (filename) {
24411
24411
  return 'filename="' + filename + '"';
@@ -24950,7 +24950,7 @@ var require_has_flag = __commonJS({
24950
24950
  var require_supports_color = __commonJS({
24951
24951
  "../../node_modules/supports-color/index.js"(exports2, module2) {
24952
24952
  "use strict";
24953
- var os2 = require("os");
24953
+ var os3 = require("os");
24954
24954
  var tty = require("tty");
24955
24955
  var hasFlag = require_has_flag();
24956
24956
  var { env } = process;
@@ -24998,7 +24998,7 @@ var require_supports_color = __commonJS({
24998
24998
  return min;
24999
24999
  }
25000
25000
  if (process.platform === "win32") {
25001
- const osRelease = os2.release().split(".");
25001
+ const osRelease = os3.release().split(".");
25002
25002
  if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
25003
25003
  return Number(osRelease[2]) >= 14931 ? 3 : 2;
25004
25004
  }
@@ -26226,7 +26226,7 @@ var require_axios = __commonJS({
26226
26226
  var https = require("https");
26227
26227
  var http2 = require("http2");
26228
26228
  var util = require("util");
26229
- var path = require("path");
26229
+ var path2 = require("path");
26230
26230
  var followRedirects = require_follow_redirects();
26231
26231
  var zlib = require("zlib");
26232
26232
  var stream = require("stream");
@@ -27113,9 +27113,9 @@ var require_axios = __commonJS({
27113
27113
  function removeBrackets(key) {
27114
27114
  return utils$1.endsWith(key, "[]") ? key.slice(0, -2) : key;
27115
27115
  }
27116
- function renderKey(path2, key, dots) {
27117
- if (!path2) return key;
27118
- return path2.concat(key).map(function each(token, i) {
27116
+ function renderKey(path3, key, dots) {
27117
+ if (!path3) return key;
27118
+ return path3.concat(key).map(function each(token, i) {
27119
27119
  token = removeBrackets(token);
27120
27120
  return !dots && i ? "[" + token + "]" : token;
27121
27121
  }).join(dots ? "." : "");
@@ -27164,13 +27164,13 @@ var require_axios = __commonJS({
27164
27164
  }
27165
27165
  return value;
27166
27166
  }
27167
- function defaultVisitor(value, key, path2) {
27167
+ function defaultVisitor(value, key, path3) {
27168
27168
  let arr = value;
27169
27169
  if (utils$1.isReactNative(formData) && utils$1.isReactNativeBlob(value)) {
27170
- formData.append(renderKey(path2, key, dots), convertValue(value));
27170
+ formData.append(renderKey(path3, key, dots), convertValue(value));
27171
27171
  return false;
27172
27172
  }
27173
- if (value && !path2 && typeof value === "object") {
27173
+ if (value && !path3 && typeof value === "object") {
27174
27174
  if (utils$1.endsWith(key, "{}")) {
27175
27175
  key = metaTokens ? key : key.slice(0, -2);
27176
27176
  value = JSON.stringify(value);
@@ -27189,7 +27189,7 @@ var require_axios = __commonJS({
27189
27189
  if (isVisitable(value)) {
27190
27190
  return true;
27191
27191
  }
27192
- formData.append(renderKey(path2, key, dots), convertValue(value));
27192
+ formData.append(renderKey(path3, key, dots), convertValue(value));
27193
27193
  return false;
27194
27194
  }
27195
27195
  const stack = [];
@@ -27198,19 +27198,19 @@ var require_axios = __commonJS({
27198
27198
  convertValue,
27199
27199
  isVisitable
27200
27200
  });
27201
- function build(value, path2, depth = 0) {
27201
+ function build(value, path3, depth = 0) {
27202
27202
  if (utils$1.isUndefined(value)) return;
27203
27203
  if (depth > maxDepth) {
27204
27204
  throw new AxiosError("Object is too deeply nested (" + depth + " levels). Max depth: " + maxDepth, AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED);
27205
27205
  }
27206
27206
  if (stack.indexOf(value) !== -1) {
27207
- throw Error("Circular reference detected in " + path2.join("."));
27207
+ throw Error("Circular reference detected in " + path3.join("."));
27208
27208
  }
27209
27209
  stack.push(value);
27210
27210
  utils$1.forEach(value, function each(el, key) {
27211
- const result = !(utils$1.isUndefined(el) || el === null) && visitor.call(formData, el, utils$1.isString(key) ? key.trim() : key, path2, exposedHelpers);
27211
+ const result = !(utils$1.isUndefined(el) || el === null) && visitor.call(formData, el, utils$1.isString(key) ? key.trim() : key, path3, exposedHelpers);
27212
27212
  if (result === true) {
27213
- build(el, path2 ? path2.concat(key) : [key], depth + 1);
27213
+ build(el, path3 ? path3.concat(key) : [key], depth + 1);
27214
27214
  }
27215
27215
  });
27216
27216
  stack.pop();
@@ -27398,7 +27398,7 @@ var require_axios = __commonJS({
27398
27398
  };
27399
27399
  function toURLEncodedForm(data, options) {
27400
27400
  return toFormData(data, new platform.classes.URLSearchParams(), {
27401
- visitor: function(value, key, path2, helpers) {
27401
+ visitor: function(value, key, path3, helpers) {
27402
27402
  if (platform.isNode && utils$1.isBuffer(value)) {
27403
27403
  this.append(key, value.toString("base64"));
27404
27404
  return false;
@@ -27426,11 +27426,11 @@ var require_axios = __commonJS({
27426
27426
  return obj;
27427
27427
  }
27428
27428
  function formDataToJSON(formData) {
27429
- function buildPath(path2, value, target, index) {
27430
- let name = path2[index++];
27429
+ function buildPath(path3, value, target, index) {
27430
+ let name = path3[index++];
27431
27431
  if (name === "__proto__") return true;
27432
27432
  const isNumericKey = Number.isFinite(+name);
27433
- const isLast = index >= path2.length;
27433
+ const isLast = index >= path3.length;
27434
27434
  name = !name && utils$1.isArray(target) ? target.length : name;
27435
27435
  if (isLast) {
27436
27436
  if (utils$1.hasOwnProp(target, name)) {
@@ -27443,7 +27443,7 @@ var require_axios = __commonJS({
27443
27443
  if (!utils$1.hasOwnProp(target, name) || !utils$1.isObject(target[name])) {
27444
27444
  target[name] = [];
27445
27445
  }
27446
- const result = buildPath(path2, value, target[name], index);
27446
+ const result = buildPath(path3, value, target[name], index);
27447
27447
  if (result && utils$1.isArray(target[name])) {
27448
27448
  target[name] = arrayToObject(target[name]);
27449
27449
  }
@@ -28813,8 +28813,8 @@ var require_axios = __commonJS({
28813
28813
  }
28814
28814
  if (config.allowedSocketPaths != null) {
28815
28815
  const allowed = Array.isArray(config.allowedSocketPaths) ? config.allowedSocketPaths : [config.allowedSocketPaths];
28816
- const resolvedSocket = path.resolve(config.socketPath);
28817
- const isAllowed = allowed.some((entry) => typeof entry === "string" && path.resolve(entry) === resolvedSocket);
28816
+ const resolvedSocket = path2.resolve(config.socketPath);
28817
+ const isAllowed = allowed.some((entry) => typeof entry === "string" && path2.resolve(entry) === resolvedSocket);
28818
28818
  if (!isAllowed) {
28819
28819
  return reject(new AxiosError(`socketPath "${config.socketPath}" is not permitted by allowedSocketPaths`, AxiosError.ERR_BAD_OPTION_VALUE, config));
28820
28820
  }
@@ -29068,14 +29068,14 @@ var require_axios = __commonJS({
29068
29068
  var cookies = platform.hasStandardBrowserEnv ? (
29069
29069
  // Standard browser envs support document.cookie
29070
29070
  {
29071
- write(name, value, expires, path2, domain, secure, sameSite) {
29071
+ write(name, value, expires, path3, domain, secure, sameSite) {
29072
29072
  if (typeof document === "undefined") return;
29073
29073
  const cookie = [`${name}=${encodeURIComponent(value)}`];
29074
29074
  if (utils$1.isNumber(expires)) {
29075
29075
  cookie.push(`expires=${new Date(expires).toUTCString()}`);
29076
29076
  }
29077
- if (utils$1.isString(path2)) {
29078
- cookie.push(`path=${path2}`);
29077
+ if (utils$1.isString(path3)) {
29078
+ cookie.push(`path=${path3}`);
29079
29079
  }
29080
29080
  if (utils$1.isString(domain)) {
29081
29081
  cookie.push(`domain=${domain}`);
@@ -30351,11 +30351,11 @@ var require_models = __commonJS({
30351
30351
  };
30352
30352
  Object.defineProperty(exports2, "__esModule", { value: true });
30353
30353
  exports2.fetchModelsFromAnthropic = fetchModelsFromAnthropic;
30354
- exports2.refreshModels = refreshModels;
30355
- exports2.listCachedModels = listCachedModels;
30354
+ exports2.refreshModels = refreshModels2;
30355
+ exports2.listCachedModels = listCachedModels2;
30356
30356
  exports2.getCacheFetchedAt = getCacheFetchedAt;
30357
- exports2.refreshIfStale = refreshIfStale;
30358
- exports2.getPreferredModel = getPreferredModel;
30357
+ exports2.refreshIfStale = refreshIfStale2;
30358
+ exports2.getPreferredModel = getPreferredModel2;
30359
30359
  var axios_1 = __importDefault(require_axios());
30360
30360
  var db_1 = require_db();
30361
30361
  var CACHE_KEY = "claude_models_cache";
@@ -30398,36 +30398,36 @@ var require_models = __commonJS({
30398
30398
  created_at: m.created_at
30399
30399
  }));
30400
30400
  }
30401
- async function refreshModels(apiKey) {
30402
- const models = await fetchModelsFromAnthropic(apiKey);
30403
- if (models.length === 0)
30401
+ async function refreshModels2(apiKey) {
30402
+ const models2 = await fetchModelsFromAnthropic(apiKey);
30403
+ if (models2.length === 0)
30404
30404
  throw new Error("Anthropic returned no models");
30405
- writeCache({ fetched_at: Date.now(), models });
30406
- return models;
30405
+ writeCache({ fetched_at: Date.now(), models: models2 });
30406
+ return models2;
30407
30407
  }
30408
- function listCachedModels() {
30408
+ function listCachedModels2() {
30409
30409
  const cache = readCache();
30410
30410
  return cache?.models ?? FALLBACK_MODELS;
30411
30411
  }
30412
30412
  function getCacheFetchedAt() {
30413
30413
  return readCache()?.fetched_at ?? null;
30414
30414
  }
30415
- async function refreshIfStale(apiKey) {
30415
+ async function refreshIfStale2(apiKey) {
30416
30416
  if (!apiKey)
30417
30417
  return;
30418
30418
  const cache = readCache();
30419
30419
  if (cache && Date.now() - cache.fetched_at < REFRESH_INTERVAL_MS)
30420
30420
  return;
30421
30421
  try {
30422
- await refreshModels(apiKey);
30422
+ await refreshModels2(apiKey);
30423
30423
  } catch {
30424
30424
  }
30425
30425
  }
30426
- function getPreferredModel() {
30426
+ function getPreferredModel2() {
30427
30427
  const db2 = (0, db_1.getDb)();
30428
30428
  const row = db2.get("SELECT value FROM settings WHERE key = ?", ["claude_model"]);
30429
30429
  const chosen = row?.value;
30430
- const available = listCachedModels();
30430
+ const available = listCachedModels2();
30431
30431
  if (chosen && available.some((m) => m.id === chosen))
30432
30432
  return chosen;
30433
30433
  const sortedByRecency = [...available].sort((a, b) => {
@@ -34676,8 +34676,8 @@ var require_windows = __commonJS({
34676
34676
  "../../node_modules/isexe/windows.js"(exports2, module2) {
34677
34677
  module2.exports = isexe;
34678
34678
  isexe.sync = sync;
34679
- var fs = require("fs");
34680
- function checkPathExt(path, options) {
34679
+ var fs2 = require("fs");
34680
+ function checkPathExt(path2, options) {
34681
34681
  var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT;
34682
34682
  if (!pathext) {
34683
34683
  return true;
@@ -34688,25 +34688,25 @@ var require_windows = __commonJS({
34688
34688
  }
34689
34689
  for (var i = 0; i < pathext.length; i++) {
34690
34690
  var p = pathext[i].toLowerCase();
34691
- if (p && path.substr(-p.length).toLowerCase() === p) {
34691
+ if (p && path2.substr(-p.length).toLowerCase() === p) {
34692
34692
  return true;
34693
34693
  }
34694
34694
  }
34695
34695
  return false;
34696
34696
  }
34697
- function checkStat(stat, path, options) {
34697
+ function checkStat(stat, path2, options) {
34698
34698
  if (!stat.isSymbolicLink() && !stat.isFile()) {
34699
34699
  return false;
34700
34700
  }
34701
- return checkPathExt(path, options);
34701
+ return checkPathExt(path2, options);
34702
34702
  }
34703
- function isexe(path, options, cb) {
34704
- fs.stat(path, function(er, stat) {
34705
- cb(er, er ? false : checkStat(stat, path, options));
34703
+ function isexe(path2, options, cb) {
34704
+ fs2.stat(path2, function(er, stat) {
34705
+ cb(er, er ? false : checkStat(stat, path2, options));
34706
34706
  });
34707
34707
  }
34708
- function sync(path, options) {
34709
- return checkStat(fs.statSync(path), path, options);
34708
+ function sync(path2, options) {
34709
+ return checkStat(fs2.statSync(path2), path2, options);
34710
34710
  }
34711
34711
  }
34712
34712
  });
@@ -34716,14 +34716,14 @@ var require_mode = __commonJS({
34716
34716
  "../../node_modules/isexe/mode.js"(exports2, module2) {
34717
34717
  module2.exports = isexe;
34718
34718
  isexe.sync = sync;
34719
- var fs = require("fs");
34720
- function isexe(path, options, cb) {
34721
- fs.stat(path, function(er, stat) {
34719
+ var fs2 = require("fs");
34720
+ function isexe(path2, options, cb) {
34721
+ fs2.stat(path2, function(er, stat) {
34722
34722
  cb(er, er ? false : checkStat(stat, options));
34723
34723
  });
34724
34724
  }
34725
- function sync(path, options) {
34726
- return checkStat(fs.statSync(path), options);
34725
+ function sync(path2, options) {
34726
+ return checkStat(fs2.statSync(path2), options);
34727
34727
  }
34728
34728
  function checkStat(stat, options) {
34729
34729
  return stat.isFile() && checkMode(stat, options);
@@ -34747,7 +34747,7 @@ var require_mode = __commonJS({
34747
34747
  // ../../node_modules/isexe/index.js
34748
34748
  var require_isexe = __commonJS({
34749
34749
  "../../node_modules/isexe/index.js"(exports2, module2) {
34750
- var fs = require("fs");
34750
+ var fs2 = require("fs");
34751
34751
  var core;
34752
34752
  if (process.platform === "win32" || global.TESTING_WINDOWS) {
34753
34753
  core = require_windows();
@@ -34756,7 +34756,7 @@ var require_isexe = __commonJS({
34756
34756
  }
34757
34757
  module2.exports = isexe;
34758
34758
  isexe.sync = sync;
34759
- function isexe(path, options, cb) {
34759
+ function isexe(path2, options, cb) {
34760
34760
  if (typeof options === "function") {
34761
34761
  cb = options;
34762
34762
  options = {};
@@ -34766,7 +34766,7 @@ var require_isexe = __commonJS({
34766
34766
  throw new TypeError("callback not provided");
34767
34767
  }
34768
34768
  return new Promise(function(resolve, reject) {
34769
- isexe(path, options || {}, function(er, is) {
34769
+ isexe(path2, options || {}, function(er, is) {
34770
34770
  if (er) {
34771
34771
  reject(er);
34772
34772
  } else {
@@ -34775,7 +34775,7 @@ var require_isexe = __commonJS({
34775
34775
  });
34776
34776
  });
34777
34777
  }
34778
- core(path, options || {}, function(er, is) {
34778
+ core(path2, options || {}, function(er, is) {
34779
34779
  if (er) {
34780
34780
  if (er.code === "EACCES" || options && options.ignoreErrors) {
34781
34781
  er = null;
@@ -34785,9 +34785,9 @@ var require_isexe = __commonJS({
34785
34785
  cb(er, is);
34786
34786
  });
34787
34787
  }
34788
- function sync(path, options) {
34788
+ function sync(path2, options) {
34789
34789
  try {
34790
- return core.sync(path, options || {});
34790
+ return core.sync(path2, options || {});
34791
34791
  } catch (er) {
34792
34792
  if (options && options.ignoreErrors || er.code === "EACCES") {
34793
34793
  return false;
@@ -34803,7 +34803,7 @@ var require_isexe = __commonJS({
34803
34803
  var require_which = __commonJS({
34804
34804
  "../../node_modules/which/which.js"(exports2, module2) {
34805
34805
  var isWindows = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
34806
- var path = require("path");
34806
+ var path2 = require("path");
34807
34807
  var COLON = isWindows ? ";" : ":";
34808
34808
  var isexe = require_isexe();
34809
34809
  var getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" });
@@ -34841,7 +34841,7 @@ var require_which = __commonJS({
34841
34841
  return opt.all && found.length ? resolve(found) : reject(getNotFoundError(cmd));
34842
34842
  const ppRaw = pathEnv[i];
34843
34843
  const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
34844
- const pCmd = path.join(pathPart, cmd);
34844
+ const pCmd = path2.join(pathPart, cmd);
34845
34845
  const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
34846
34846
  resolve(subStep(p, i, 0));
34847
34847
  });
@@ -34868,7 +34868,7 @@ var require_which = __commonJS({
34868
34868
  for (let i = 0; i < pathEnv.length; i++) {
34869
34869
  const ppRaw = pathEnv[i];
34870
34870
  const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
34871
- const pCmd = path.join(pathPart, cmd);
34871
+ const pCmd = path2.join(pathPart, cmd);
34872
34872
  const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
34873
34873
  for (let j = 0; j < pathExt.length; j++) {
34874
34874
  const cur = p + pathExt[j];
@@ -34916,7 +34916,7 @@ var require_path_key = __commonJS({
34916
34916
  var require_resolveCommand = __commonJS({
34917
34917
  "../../node_modules/cross-spawn/lib/util/resolveCommand.js"(exports2, module2) {
34918
34918
  "use strict";
34919
- var path = require("path");
34919
+ var path2 = require("path");
34920
34920
  var which = require_which();
34921
34921
  var getPathKey = require_path_key();
34922
34922
  function resolveCommandAttempt(parsed, withoutPathExt) {
@@ -34934,7 +34934,7 @@ var require_resolveCommand = __commonJS({
34934
34934
  try {
34935
34935
  resolved = which.sync(parsed.command, {
34936
34936
  path: env[getPathKey({ env })],
34937
- pathExt: withoutPathExt ? path.delimiter : void 0
34937
+ pathExt: withoutPathExt ? path2.delimiter : void 0
34938
34938
  });
34939
34939
  } catch (e) {
34940
34940
  } finally {
@@ -34943,7 +34943,7 @@ var require_resolveCommand = __commonJS({
34943
34943
  }
34944
34944
  }
34945
34945
  if (resolved) {
34946
- resolved = path.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
34946
+ resolved = path2.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
34947
34947
  }
34948
34948
  return resolved;
34949
34949
  }
@@ -34997,8 +34997,8 @@ var require_shebang_command = __commonJS({
34997
34997
  if (!match) {
34998
34998
  return null;
34999
34999
  }
35000
- const [path, argument] = match[0].replace(/#! ?/, "").split(" ");
35001
- const binary = path.split("/").pop();
35000
+ const [path2, argument] = match[0].replace(/#! ?/, "").split(" ");
35001
+ const binary = path2.split("/").pop();
35002
35002
  if (binary === "env") {
35003
35003
  return argument;
35004
35004
  }
@@ -35011,16 +35011,16 @@ var require_shebang_command = __commonJS({
35011
35011
  var require_readShebang = __commonJS({
35012
35012
  "../../node_modules/cross-spawn/lib/util/readShebang.js"(exports2, module2) {
35013
35013
  "use strict";
35014
- var fs = require("fs");
35014
+ var fs2 = require("fs");
35015
35015
  var shebangCommand = require_shebang_command();
35016
35016
  function readShebang(command) {
35017
35017
  const size = 150;
35018
35018
  const buffer = Buffer.alloc(size);
35019
35019
  let fd;
35020
35020
  try {
35021
- fd = fs.openSync(command, "r");
35022
- fs.readSync(fd, buffer, 0, size, 0);
35023
- fs.closeSync(fd);
35021
+ fd = fs2.openSync(command, "r");
35022
+ fs2.readSync(fd, buffer, 0, size, 0);
35023
+ fs2.closeSync(fd);
35024
35024
  } catch (e) {
35025
35025
  }
35026
35026
  return shebangCommand(buffer.toString());
@@ -35033,7 +35033,7 @@ var require_readShebang = __commonJS({
35033
35033
  var require_parse = __commonJS({
35034
35034
  "../../node_modules/cross-spawn/lib/parse.js"(exports2, module2) {
35035
35035
  "use strict";
35036
- var path = require("path");
35036
+ var path2 = require("path");
35037
35037
  var resolveCommand = require_resolveCommand();
35038
35038
  var escape = require_escape();
35039
35039
  var readShebang = require_readShebang();
@@ -35058,7 +35058,7 @@ var require_parse = __commonJS({
35058
35058
  const needsShell = !isExecutableRegExp.test(commandFile);
35059
35059
  if (parsed.options.forceShell || needsShell) {
35060
35060
  const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
35061
- parsed.command = path.normalize(parsed.command);
35061
+ parsed.command = path2.normalize(parsed.command);
35062
35062
  parsed.command = escape.command(parsed.command);
35063
35063
  parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
35064
35064
  const shellCommand = [parsed.command].concat(parsed.args).join(" ");
@@ -35190,7 +35190,7 @@ var require_strip_final_newline = __commonJS({
35190
35190
  var require_npm_run_path = __commonJS({
35191
35191
  "../../node_modules/npm-run-path/index.js"(exports2, module2) {
35192
35192
  "use strict";
35193
- var path = require("path");
35193
+ var path2 = require("path");
35194
35194
  var pathKey = require_path_key();
35195
35195
  var npmRunPath = (options) => {
35196
35196
  options = {
@@ -35200,16 +35200,16 @@ var require_npm_run_path = __commonJS({
35200
35200
  ...options
35201
35201
  };
35202
35202
  let previous;
35203
- let cwdPath = path.resolve(options.cwd);
35203
+ let cwdPath = path2.resolve(options.cwd);
35204
35204
  const result = [];
35205
35205
  while (previous !== cwdPath) {
35206
- result.push(path.join(cwdPath, "node_modules/.bin"));
35206
+ result.push(path2.join(cwdPath, "node_modules/.bin"));
35207
35207
  previous = cwdPath;
35208
- cwdPath = path.resolve(cwdPath, "..");
35208
+ cwdPath = path2.resolve(cwdPath, "..");
35209
35209
  }
35210
- const execPathDir = path.resolve(options.cwd, options.execPath, "..");
35210
+ const execPathDir = path2.resolve(options.cwd, options.execPath, "..");
35211
35211
  result.push(execPathDir);
35212
- return result.concat(options.path).join(path.delimiter);
35212
+ return result.concat(options.path).join(path2.delimiter);
35213
35213
  };
35214
35214
  module2.exports = npmRunPath;
35215
35215
  module2.exports.default = npmRunPath;
@@ -35219,9 +35219,9 @@ var require_npm_run_path = __commonJS({
35219
35219
  ...options
35220
35220
  };
35221
35221
  const env = { ...options.env };
35222
- const path2 = pathKey({ env });
35223
- options.path = env[path2];
35224
- env[path2] = module2.exports(options);
35222
+ const path3 = pathKey({ env });
35223
+ options.path = env[path3];
35224
+ env[path3] = module2.exports(options);
35225
35225
  return env;
35226
35226
  };
35227
35227
  }
@@ -35997,7 +35997,7 @@ var require_signal_exit = __commonJS({
35997
35997
  var require_kill = __commonJS({
35998
35998
  "../../node_modules/execa/lib/kill.js"(exports2, module2) {
35999
35999
  "use strict";
36000
- var os2 = require("os");
36000
+ var os3 = require("os");
36001
36001
  var onExit = require_signal_exit();
36002
36002
  var DEFAULT_FORCE_KILL_TIMEOUT = 1e3 * 5;
36003
36003
  var spawnedKill = (kill, signal = "SIGTERM", options = {}) => {
@@ -36021,7 +36021,7 @@ var require_kill = __commonJS({
36021
36021
  return isSigterm(signal) && forceKillAfterTimeout !== false && killResult;
36022
36022
  };
36023
36023
  var isSigterm = (signal) => {
36024
- return signal === os2.constants.signals.SIGTERM || typeof signal === "string" && signal.toUpperCase() === "SIGTERM";
36024
+ return signal === os3.constants.signals.SIGTERM || typeof signal === "string" && signal.toUpperCase() === "SIGTERM";
36025
36025
  };
36026
36026
  var getForceKillAfterTimeout = ({ forceKillAfterTimeout = true }) => {
36027
36027
  if (forceKillAfterTimeout === true) {
@@ -36403,7 +36403,7 @@ var require_command = __commonJS({
36403
36403
  var require_execa = __commonJS({
36404
36404
  "../../node_modules/execa/index.js"(exports2, module2) {
36405
36405
  "use strict";
36406
- var path = require("path");
36406
+ var path2 = require("path");
36407
36407
  var childProcess = require("child_process");
36408
36408
  var crossSpawn = require_cross_spawn();
36409
36409
  var stripFinalNewline = require_strip_final_newline();
@@ -36445,7 +36445,7 @@ var require_execa = __commonJS({
36445
36445
  };
36446
36446
  options.env = getEnv(options);
36447
36447
  options.stdio = normalizeStdio(options);
36448
- if (process.platform === "win32" && path.basename(file, ".exe") === "cmd") {
36448
+ if (process.platform === "win32" && path2.basename(file, ".exe") === "cmd") {
36449
36449
  args.unshift("/q");
36450
36450
  }
36451
36451
  return { file, args, options, parsed };
@@ -37891,10 +37891,10 @@ var require_util = __commonJS({
37891
37891
  function cloneDef(schema) {
37892
37892
  return mergeDefs(schema._zod.def);
37893
37893
  }
37894
- function getElementAtPath(obj, path) {
37895
- if (!path)
37894
+ function getElementAtPath(obj, path2) {
37895
+ if (!path2)
37896
37896
  return obj;
37897
- return path.reduce((acc, key) => acc?.[key], obj);
37897
+ return path2.reduce((acc, key) => acc?.[key], obj);
37898
37898
  }
37899
37899
  function promiseAllObject(promisesObj) {
37900
37900
  const keys = Object.keys(promisesObj);
@@ -38256,11 +38256,11 @@ var require_util = __commonJS({
38256
38256
  }
38257
38257
  return false;
38258
38258
  }
38259
- function prefixIssues(path, issues) {
38259
+ function prefixIssues(path2, issues) {
38260
38260
  return issues.map((iss) => {
38261
38261
  var _a;
38262
38262
  (_a = iss).path ?? (_a.path = []);
38263
- iss.path.unshift(path);
38263
+ iss.path.unshift(path2);
38264
38264
  return iss;
38265
38265
  });
38266
38266
  }
@@ -38470,7 +38470,7 @@ var require_errors2 = __commonJS({
38470
38470
  return issue.message;
38471
38471
  };
38472
38472
  const result = { errors: [] };
38473
- const processError = (error2, path = []) => {
38473
+ const processError = (error2, path2 = []) => {
38474
38474
  var _a, _b;
38475
38475
  for (const issue of error2.issues) {
38476
38476
  if (issue.code === "invalid_union" && issue.errors.length) {
@@ -38480,7 +38480,7 @@ var require_errors2 = __commonJS({
38480
38480
  } else if (issue.code === "invalid_element") {
38481
38481
  processError({ issues: issue.issues }, issue.path);
38482
38482
  } else {
38483
- const fullpath = [...path, ...issue.path];
38483
+ const fullpath = [...path2, ...issue.path];
38484
38484
  if (fullpath.length === 0) {
38485
38485
  result.errors.push(mapper(issue));
38486
38486
  continue;
@@ -38512,8 +38512,8 @@ var require_errors2 = __commonJS({
38512
38512
  }
38513
38513
  function toDotPath(_path) {
38514
38514
  const segs = [];
38515
- const path = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
38516
- for (const seg of path) {
38515
+ const path2 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
38516
+ for (const seg of path2) {
38517
38517
  if (typeof seg === "number")
38518
38518
  segs.push(`[${seg}]`);
38519
38519
  else if (typeof seg === "symbol")
@@ -52357,27 +52357,27 @@ var require_schema = __commonJS({
52357
52357
  var require_lib5 = __commonJS({
52358
52358
  "../../node_modules/os-paths/src/lib/index.js"(exports2, module2) {
52359
52359
  "use strict";
52360
- var os2 = require("os");
52360
+ var os3 = require("os");
52361
52361
  var paths = require("path");
52362
52362
  var isWinOS = /^win/i.test(process.platform);
52363
- function normalize_path(path) {
52364
- return paths.normalize(paths.join(path, "."));
52363
+ function normalize_path(path2) {
52364
+ return paths.normalize(paths.join(path2, "."));
52365
52365
  }
52366
52366
  var base = () => {
52367
52367
  const { env } = process;
52368
52368
  const object = {};
52369
- object.home = () => normalize_path(os2.homedir ? os2.homedir() : env.HOME);
52370
- object.temp = () => normalize_path(os2.tmpdir ? os2.tmpdir() : env.TMPDIR || env.TEMP || env.TMP);
52369
+ object.home = () => normalize_path(os3.homedir ? os3.homedir() : env.HOME);
52370
+ object.temp = () => normalize_path(os3.tmpdir ? os3.tmpdir() : env.TMPDIR || env.TEMP || env.TMP);
52371
52371
  return object;
52372
52372
  };
52373
52373
  var windows = () => {
52374
52374
  const { env } = process;
52375
52375
  const object = {};
52376
52376
  object.home = () => normalize_path(
52377
- os2.homedir ? os2.homedir() : env.USERPROFILE || paths.join(env.HOMEDRIVE, env.HOMEPATH) || env.HOME
52377
+ os3.homedir ? os3.homedir() : env.USERPROFILE || paths.join(env.HOMEDRIVE, env.HOMEPATH) || env.HOME
52378
52378
  );
52379
52379
  object.temp = () => normalize_path(
52380
- os2.tmpdir ? os2.tmpdir() : env.TEMP || env.TMP || paths.join(env.LOCALAPPDATA || env.SystemRoot || env.windir, "Temp")
52380
+ os3.tmpdir ? os3.tmpdir() : env.TEMP || env.TMP || paths.join(env.LOCALAPPDATA || env.SystemRoot || env.windir, "Temp")
52381
52381
  );
52382
52382
  return object;
52383
52383
  };
@@ -52402,44 +52402,44 @@ var require_lib5 = __commonJS({
52402
52402
  var require_lib6 = __commonJS({
52403
52403
  "../../node_modules/xdg-portable/src/lib/index.js"(exports2, module2) {
52404
52404
  "use strict";
52405
- var path = require("path");
52405
+ var path2 = require("path");
52406
52406
  var osPaths = require_lib5();
52407
52407
  var linux = () => {
52408
52408
  const object = {};
52409
- object.cache = () => process.env.XDG_CACHE_HOME || path.join(osPaths.home() || osPaths.temp(), ".cache");
52410
- object.config = () => process.env.XDG_CONFIG_HOME || path.join(osPaths.home() || osPaths.temp(), ".config");
52411
- object.data = () => process.env.XDG_DATA_HOME || path.join(osPaths.home() || osPaths.temp(), ".local", "share");
52409
+ object.cache = () => process.env.XDG_CACHE_HOME || path2.join(osPaths.home() || osPaths.temp(), ".cache");
52410
+ object.config = () => process.env.XDG_CONFIG_HOME || path2.join(osPaths.home() || osPaths.temp(), ".config");
52411
+ object.data = () => process.env.XDG_DATA_HOME || path2.join(osPaths.home() || osPaths.temp(), ".local", "share");
52412
52412
  object.runtime = () => process.env.XDG_RUNTIME_DIR || void 0;
52413
- object.state = () => process.env.XDG_STATE_HOME || path.join(osPaths.home() || osPaths.temp(), ".local", "state");
52413
+ object.state = () => process.env.XDG_STATE_HOME || path2.join(osPaths.home() || osPaths.temp(), ".local", "state");
52414
52414
  return object;
52415
52415
  };
52416
52416
  var macos = () => {
52417
52417
  const object = {};
52418
- object.cache = () => process.env.XDG_CACHE_HOME || path.join(path.join(osPaths.home() || osPaths.temp(), "Library"), "Caches");
52419
- object.config = () => process.env.XDG_CONFIG_HOME || path.join(path.join(osPaths.home() || osPaths.temp(), "Library"), "Preferences");
52420
- object.data = () => process.env.XDG_DATA_HOME || path.join(path.join(osPaths.home() || osPaths.temp(), "Library"), "Application Support");
52418
+ object.cache = () => process.env.XDG_CACHE_HOME || path2.join(path2.join(osPaths.home() || osPaths.temp(), "Library"), "Caches");
52419
+ object.config = () => process.env.XDG_CONFIG_HOME || path2.join(path2.join(osPaths.home() || osPaths.temp(), "Library"), "Preferences");
52420
+ object.data = () => process.env.XDG_DATA_HOME || path2.join(path2.join(osPaths.home() || osPaths.temp(), "Library"), "Application Support");
52421
52421
  object.runtime = () => process.env.XDG_RUNTIME_DIR || void 0;
52422
- object.state = () => process.env.XDG_STATE_HOME || path.join(path.join(osPaths.home() || osPaths.temp(), "Library"), "State");
52422
+ object.state = () => process.env.XDG_STATE_HOME || path2.join(path2.join(osPaths.home() || osPaths.temp(), "Library"), "State");
52423
52423
  return object;
52424
52424
  };
52425
52425
  var windows = () => {
52426
52426
  const object = {};
52427
52427
  object.cache = () => {
52428
- const localAppData = process.env.LOCALAPPDATA || path.join(osPaths.home() || osPaths.temp(), "AppData", "Local");
52429
- return process.env.XDG_CACHE_HOME || path.join(localAppData, "xdg.cache");
52428
+ const localAppData = process.env.LOCALAPPDATA || path2.join(osPaths.home() || osPaths.temp(), "AppData", "Local");
52429
+ return process.env.XDG_CACHE_HOME || path2.join(localAppData, "xdg.cache");
52430
52430
  };
52431
52431
  object.config = () => {
52432
- const appData = process.env.APPDATA || path.join(osPaths.home() || osPaths.temp(), "AppData", "Roaming");
52433
- return process.env.XDG_CONFIG_HOME || path.join(appData, "xdg.config");
52432
+ const appData = process.env.APPDATA || path2.join(osPaths.home() || osPaths.temp(), "AppData", "Roaming");
52433
+ return process.env.XDG_CONFIG_HOME || path2.join(appData, "xdg.config");
52434
52434
  };
52435
52435
  object.data = () => {
52436
- const appData = process.env.APPDATA || path.join(osPaths.home() || osPaths.temp(), "AppData", "Roaming");
52437
- return process.env.XDG_DATA_HOME || path.join(appData, "xdg.data");
52436
+ const appData = process.env.APPDATA || path2.join(osPaths.home() || osPaths.temp(), "AppData", "Roaming");
52437
+ return process.env.XDG_DATA_HOME || path2.join(appData, "xdg.data");
52438
52438
  };
52439
52439
  object.runtime = () => process.env.XDG_RUNTIME_DIR || void 0;
52440
52440
  object.state = () => {
52441
- const localAppData = process.env.LOCALAPPDATA || path.join(osPaths.home() || osPaths.temp(), "AppData", "Local");
52442
- return process.env.XDG_STATE_HOME || path.join(localAppData, "xdg.state");
52441
+ const localAppData = process.env.LOCALAPPDATA || path2.join(osPaths.home() || osPaths.temp(), "AppData", "Local");
52442
+ return process.env.XDG_STATE_HOME || path2.join(localAppData, "xdg.state");
52443
52443
  };
52444
52444
  return object;
52445
52445
  };
@@ -52459,7 +52459,7 @@ var require_lib6 = __commonJS({
52459
52459
  const dirs = [];
52460
52460
  dirs.push(extension.config());
52461
52461
  if (process.env.XDG_CONFIG_DIRS) {
52462
- dirs.push(...process.env.XDG_CONFIG_DIRS.split(path.delimiter));
52462
+ dirs.push(...process.env.XDG_CONFIG_DIRS.split(path2.delimiter));
52463
52463
  }
52464
52464
  return dirs;
52465
52465
  };
@@ -52467,7 +52467,7 @@ var require_lib6 = __commonJS({
52467
52467
  const dirs = [];
52468
52468
  dirs.push(extension.data());
52469
52469
  if (process.env.XDG_DATA_DIRS) {
52470
- dirs.push(...process.env.XDG_DATA_DIRS.split(path.delimiter));
52470
+ dirs.push(...process.env.XDG_DATA_DIRS.split(path2.delimiter));
52471
52471
  }
52472
52472
  return dirs;
52473
52473
  };
@@ -52484,7 +52484,7 @@ var require_lib6 = __commonJS({
52484
52484
  var require_lib7 = __commonJS({
52485
52485
  "../../node_modules/xdg-app-paths/src/lib/index.js"(exports2, module2) {
52486
52486
  "use strict";
52487
- var path = require("path");
52487
+ var path2 = require("path");
52488
52488
  var xdg = require_lib6();
52489
52489
  function normalizeOptions_(options, isolated) {
52490
52490
  if (!isObject(options)) {
@@ -52536,38 +52536,38 @@ var require_lib7 = __commonJS({
52536
52536
  throw new TypeError(`Expected string for "name" argument, got ${typeOf(name_)}`);
52537
52537
  }
52538
52538
  if (!name_) {
52539
- name_ = path.parse(require.main && require.main.filename || process.execPath).name;
52539
+ name_ = path2.parse(require.main && require.main.filename || process.execPath).name;
52540
52540
  }
52541
52541
  name_ += suffix_ || "";
52542
52542
  XDGAppPaths.$name = () => name_;
52543
52543
  XDGAppPaths.$isolated = () => isolated_;
52544
52544
  XDGAppPaths.cache = (dirOptions = null) => {
52545
52545
  dirOptions = normalizeOptions_(dirOptions, isolated_);
52546
- return path.join(xdg.cache(), dirOptions.isolated ? name_ : "");
52546
+ return path2.join(xdg.cache(), dirOptions.isolated ? name_ : "");
52547
52547
  };
52548
52548
  XDGAppPaths.config = function(dirOptions = null) {
52549
52549
  dirOptions = normalizeOptions_(dirOptions, isolated_);
52550
- return path.join(xdg.config(), dirOptions.isolated ? name_ : "");
52550
+ return path2.join(xdg.config(), dirOptions.isolated ? name_ : "");
52551
52551
  };
52552
52552
  XDGAppPaths.data = function(dirOptions = null) {
52553
52553
  dirOptions = normalizeOptions_(dirOptions, isolated_);
52554
- return path.join(xdg.data(), dirOptions.isolated ? name_ : "");
52554
+ return path2.join(xdg.data(), dirOptions.isolated ? name_ : "");
52555
52555
  };
52556
52556
  XDGAppPaths.runtime = function(dirOptions = null) {
52557
52557
  dirOptions = normalizeOptions_(dirOptions, isolated_);
52558
- return xdg.runtime() ? path.join(xdg.runtime(), dirOptions.isolated ? name_ : "") : void 0;
52558
+ return xdg.runtime() ? path2.join(xdg.runtime(), dirOptions.isolated ? name_ : "") : void 0;
52559
52559
  };
52560
52560
  XDGAppPaths.state = function(dirOptions = null) {
52561
52561
  dirOptions = normalizeOptions_(dirOptions, isolated_);
52562
- return path.join(xdg.state(), dirOptions.isolated ? name_ : "");
52562
+ return path2.join(xdg.state(), dirOptions.isolated ? name_ : "");
52563
52563
  };
52564
52564
  XDGAppPaths.configDirs = function(dirOptions = null) {
52565
52565
  dirOptions = normalizeOptions_(dirOptions, isolated_);
52566
- return xdg.configDirs().map((s) => path.join(s, dirOptions.isolated ? name_ : ""));
52566
+ return xdg.configDirs().map((s) => path2.join(s, dirOptions.isolated ? name_ : ""));
52567
52567
  };
52568
52568
  XDGAppPaths.dataDirs = function(dirOptions = null) {
52569
52569
  dirOptions = normalizeOptions_(dirOptions, isolated_);
52570
- return xdg.dataDirs().map((s) => path.join(s, dirOptions.isolated ? name_ : ""));
52570
+ return xdg.dataDirs().map((s) => path2.join(s, dirOptions.isolated ? name_ : ""));
52571
52571
  };
52572
52572
  this.fn = XDGAppPaths;
52573
52573
  }
@@ -52888,19 +52888,19 @@ var require_token_io = __commonJS({
52888
52888
  getUserDataDir: () => getUserDataDir
52889
52889
  });
52890
52890
  module2.exports = __toCommonJS(token_io_exports);
52891
- var import_path = __toESM2(require("path"));
52892
- var import_fs = __toESM2(require("fs"));
52893
- var import_os2 = __toESM2(require("os"));
52891
+ var import_path2 = __toESM2(require("path"));
52892
+ var import_fs2 = __toESM2(require("fs"));
52893
+ var import_os3 = __toESM2(require("os"));
52894
52894
  var import_token_error = require_token_error();
52895
52895
  function findRootDir() {
52896
52896
  try {
52897
52897
  let dir = process.cwd();
52898
- while (dir !== import_path.default.dirname(dir)) {
52899
- const pkgPath = import_path.default.join(dir, ".vercel");
52900
- if (import_fs.default.existsSync(pkgPath)) {
52898
+ while (dir !== import_path2.default.dirname(dir)) {
52899
+ const pkgPath = import_path2.default.join(dir, ".vercel");
52900
+ if (import_fs2.default.existsSync(pkgPath)) {
52901
52901
  return dir;
52902
52902
  }
52903
- dir = import_path.default.dirname(dir);
52903
+ dir = import_path2.default.dirname(dir);
52904
52904
  }
52905
52905
  } catch (_e) {
52906
52906
  throw new import_token_error.VercelOidcTokenError(
@@ -52913,11 +52913,11 @@ var require_token_io = __commonJS({
52913
52913
  if (process.env.XDG_DATA_HOME) {
52914
52914
  return process.env.XDG_DATA_HOME;
52915
52915
  }
52916
- switch (import_os2.default.platform()) {
52916
+ switch (import_os3.default.platform()) {
52917
52917
  case "darwin":
52918
- return import_path.default.join(import_os2.default.homedir(), "Library/Application Support");
52918
+ return import_path2.default.join(import_os3.default.homedir(), "Library/Application Support");
52919
52919
  case "linux":
52920
- return import_path.default.join(import_os2.default.homedir(), ".local/share");
52920
+ return import_path2.default.join(import_os3.default.homedir(), ".local/share");
52921
52921
  case "win32":
52922
52922
  if (process.env.LOCALAPPDATA) {
52923
52923
  return process.env.LOCALAPPDATA;
@@ -52957,10 +52957,10 @@ var require_oauth = __commonJS({
52957
52957
  refreshTokenRequest: () => refreshTokenRequest
52958
52958
  });
52959
52959
  module2.exports = __toCommonJS(oauth_exports);
52960
- var import_os2 = require("os");
52960
+ var import_os3 = require("os");
52961
52961
  var VERCEL_ISSUER = "https://vercel.com";
52962
52962
  var VERCEL_CLI_CLIENT_ID = "cl_HYyOPBNtFMfHhaUn9L4QPfTZz6TP47bp";
52963
- var userAgent = `@vercel/oidc node-${process.version} ${(0, import_os2.platform)()} (${(0, import_os2.arch)()}) ${(0, import_os2.hostname)()}`;
52963
+ var userAgent = `@vercel/oidc node-${process.version} ${(0, import_os3.platform)()} (${(0, import_os3.arch)()}) ${(0, import_os3.hostname)()}`;
52964
52964
  var _tokenEndpoint = null;
52965
52965
  async function getTokenEndpoint() {
52966
52966
  if (_tokenEndpoint) {
@@ -53110,8 +53110,8 @@ var require_token_util = __commonJS({
53110
53110
  saveToken: () => saveToken
53111
53111
  });
53112
53112
  module2.exports = __toCommonJS(token_util_exports);
53113
- var path = __toESM2(require("path"));
53114
- var fs = __toESM2(require("fs"));
53113
+ var path2 = __toESM2(require("path"));
53114
+ var fs2 = __toESM2(require("fs"));
53115
53115
  var import_cli_exec = require_dist2();
53116
53116
  var import_cli_config = require_dist3();
53117
53117
  var import_token_error = require_token_error();
@@ -53235,13 +53235,13 @@ ${stderr}`.trim();
53235
53235
  "Unable to find project root directory. Have you linked your project with `vc link?`"
53236
53236
  );
53237
53237
  }
53238
- const prjPath = path.join(dir, ".vercel", "project.json");
53239
- if (!fs.existsSync(prjPath)) {
53238
+ const prjPath = path2.join(dir, ".vercel", "project.json");
53239
+ if (!fs2.existsSync(prjPath)) {
53240
53240
  throw new import_token_error.VercelOidcTokenError(
53241
53241
  "project.json not found, have you linked your project with `vc link?`"
53242
53242
  );
53243
53243
  }
53244
- const prj = JSON.parse(fs.readFileSync(prjPath, "utf8"));
53244
+ const prj = JSON.parse(fs2.readFileSync(prjPath, "utf8"));
53245
53245
  if (typeof prj.projectId !== "string" && typeof prj.orgId !== "string") {
53246
53246
  throw new TypeError(
53247
53247
  "Expected a string-valued projectId property. Try running `vc link` to re-link your project."
@@ -53256,11 +53256,11 @@ ${stderr}`.trim();
53256
53256
  "Unable to find user data directory. Please reach out to Vercel support."
53257
53257
  );
53258
53258
  }
53259
- const tokenPath = path.join(dir, "com.vercel.token", `${projectId}.json`);
53259
+ const tokenPath = path2.join(dir, "com.vercel.token", `${projectId}.json`);
53260
53260
  const tokenJson = JSON.stringify(token);
53261
- fs.mkdirSync(path.dirname(tokenPath), { mode: 504, recursive: true });
53262
- fs.writeFileSync(tokenPath, tokenJson);
53263
- fs.chmodSync(tokenPath, 432);
53261
+ fs2.mkdirSync(path2.dirname(tokenPath), { mode: 504, recursive: true });
53262
+ fs2.writeFileSync(tokenPath, tokenJson);
53263
+ fs2.chmodSync(tokenPath, 432);
53264
53264
  return;
53265
53265
  }
53266
53266
  function loadToken(projectId) {
@@ -53270,11 +53270,11 @@ ${stderr}`.trim();
53270
53270
  "Unable to find user data directory. Please reach out to Vercel support."
53271
53271
  );
53272
53272
  }
53273
- const tokenPath = path.join(dir, "com.vercel.token", `${projectId}.json`);
53274
- if (!fs.existsSync(tokenPath)) {
53273
+ const tokenPath = path2.join(dir, "com.vercel.token", `${projectId}.json`);
53274
+ if (!fs2.existsSync(tokenPath)) {
53275
53275
  return null;
53276
53276
  }
53277
- const token = JSON.parse(fs.readFileSync(tokenPath, "utf8"));
53277
+ const token = JSON.parse(fs2.readFileSync(tokenPath, "utf8"));
53278
53278
  assertVercelOidcTokenResponse(token);
53279
53279
  return token;
53280
53280
  }
@@ -59094,14 +59094,14 @@ var require_util2 = __commonJS({
59094
59094
  }
59095
59095
  const port = url.port != null ? url.port : url.protocol === "https:" ? 443 : 80;
59096
59096
  let origin = url.origin != null ? url.origin : `${url.protocol || ""}//${url.hostname || ""}:${port}`;
59097
- let path = url.path != null ? url.path : `${url.pathname || ""}${url.search || ""}`;
59097
+ let path2 = url.path != null ? url.path : `${url.pathname || ""}${url.search || ""}`;
59098
59098
  if (origin[origin.length - 1] === "/") {
59099
59099
  origin = origin.slice(0, origin.length - 1);
59100
59100
  }
59101
- if (path && path[0] !== "/") {
59102
- path = `/${path}`;
59101
+ if (path2 && path2[0] !== "/") {
59102
+ path2 = `/${path2}`;
59103
59103
  }
59104
- return new URL(`${origin}${path}`);
59104
+ return new URL(`${origin}${path2}`);
59105
59105
  }
59106
59106
  if (!isHttpOrHttpsPrefixed(url.origin || url.protocol)) {
59107
59107
  throw new InvalidArgumentError("Invalid URL protocol: the URL must start with `http:` or `https:`.");
@@ -59552,39 +59552,39 @@ var require_diagnostics = __commonJS({
59552
59552
  });
59553
59553
  diagnosticsChannel.channel("undici:client:sendHeaders").subscribe((evt) => {
59554
59554
  const {
59555
- request: { method, path, origin }
59555
+ request: { method, path: path2, origin }
59556
59556
  } = evt;
59557
- debuglog("sending request to %s %s/%s", method, origin, path);
59557
+ debuglog("sending request to %s %s/%s", method, origin, path2);
59558
59558
  });
59559
59559
  diagnosticsChannel.channel("undici:request:headers").subscribe((evt) => {
59560
59560
  const {
59561
- request: { method, path, origin },
59561
+ request: { method, path: path2, origin },
59562
59562
  response: { statusCode }
59563
59563
  } = evt;
59564
59564
  debuglog(
59565
59565
  "received response to %s %s/%s - HTTP %d",
59566
59566
  method,
59567
59567
  origin,
59568
- path,
59568
+ path2,
59569
59569
  statusCode
59570
59570
  );
59571
59571
  });
59572
59572
  diagnosticsChannel.channel("undici:request:trailers").subscribe((evt) => {
59573
59573
  const {
59574
- request: { method, path, origin }
59574
+ request: { method, path: path2, origin }
59575
59575
  } = evt;
59576
- debuglog("trailers received from %s %s/%s", method, origin, path);
59576
+ debuglog("trailers received from %s %s/%s", method, origin, path2);
59577
59577
  });
59578
59578
  diagnosticsChannel.channel("undici:request:error").subscribe((evt) => {
59579
59579
  const {
59580
- request: { method, path, origin },
59580
+ request: { method, path: path2, origin },
59581
59581
  error
59582
59582
  } = evt;
59583
59583
  debuglog(
59584
59584
  "request to %s %s/%s errored - %s",
59585
59585
  method,
59586
59586
  origin,
59587
- path,
59587
+ path2,
59588
59588
  error.message
59589
59589
  );
59590
59590
  });
@@ -59633,9 +59633,9 @@ var require_diagnostics = __commonJS({
59633
59633
  });
59634
59634
  diagnosticsChannel.channel("undici:client:sendHeaders").subscribe((evt) => {
59635
59635
  const {
59636
- request: { method, path, origin }
59636
+ request: { method, path: path2, origin }
59637
59637
  } = evt;
59638
- debuglog("sending request to %s %s/%s", method, origin, path);
59638
+ debuglog("sending request to %s %s/%s", method, origin, path2);
59639
59639
  });
59640
59640
  }
59641
59641
  diagnosticsChannel.channel("undici:websocket:open").subscribe((evt) => {
@@ -59698,7 +59698,7 @@ var require_request = __commonJS({
59698
59698
  var kHandler = /* @__PURE__ */ Symbol("handler");
59699
59699
  var Request2 = class {
59700
59700
  constructor(origin, {
59701
- path,
59701
+ path: path2,
59702
59702
  method,
59703
59703
  body,
59704
59704
  headers,
@@ -59713,11 +59713,11 @@ var require_request = __commonJS({
59713
59713
  expectContinue,
59714
59714
  servername
59715
59715
  }, handler) {
59716
- if (typeof path !== "string") {
59716
+ if (typeof path2 !== "string") {
59717
59717
  throw new InvalidArgumentError("path must be a string");
59718
- } else if (path[0] !== "/" && !(path.startsWith("http://") || path.startsWith("https://")) && method !== "CONNECT") {
59718
+ } else if (path2[0] !== "/" && !(path2.startsWith("http://") || path2.startsWith("https://")) && method !== "CONNECT") {
59719
59719
  throw new InvalidArgumentError("path must be an absolute URL or start with a slash");
59720
- } else if (invalidPathRegex.test(path)) {
59720
+ } else if (invalidPathRegex.test(path2)) {
59721
59721
  throw new InvalidArgumentError("invalid request path");
59722
59722
  }
59723
59723
  if (typeof method !== "string") {
@@ -59783,7 +59783,7 @@ var require_request = __commonJS({
59783
59783
  this.completed = false;
59784
59784
  this.aborted = false;
59785
59785
  this.upgrade = upgrade || null;
59786
- this.path = query ? buildURL(path, query) : path;
59786
+ this.path = query ? buildURL(path2, query) : path2;
59787
59787
  this.origin = origin;
59788
59788
  this.idempotent = idempotent == null ? method === "HEAD" || method === "GET" : idempotent;
59789
59789
  this.blocking = blocking == null ? false : blocking;
@@ -64405,7 +64405,7 @@ var require_client_h1 = __commonJS({
64405
64405
  return method !== "GET" && method !== "HEAD" && method !== "OPTIONS" && method !== "TRACE" && method !== "CONNECT";
64406
64406
  }
64407
64407
  function writeH1(client, request) {
64408
- const { method, path, host, upgrade, blocking, reset } = request;
64408
+ const { method, path: path2, host, upgrade, blocking, reset } = request;
64409
64409
  let { body, headers, contentLength } = request;
64410
64410
  const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH" || method === "QUERY" || method === "PROPFIND" || method === "PROPPATCH";
64411
64411
  if (util.isFormDataLike(body)) {
@@ -64472,7 +64472,7 @@ var require_client_h1 = __commonJS({
64472
64472
  if (blocking) {
64473
64473
  socket[kBlocking] = true;
64474
64474
  }
64475
- let header = `${method} ${path} HTTP/1.1\r
64475
+ let header = `${method} ${path2} HTTP/1.1\r
64476
64476
  `;
64477
64477
  if (typeof host === "string") {
64478
64478
  header += `host: ${host}\r
@@ -64998,7 +64998,7 @@ var require_client_h2 = __commonJS({
64998
64998
  }
64999
64999
  function writeH2(client, request) {
65000
65000
  const session = client[kHTTP2Session];
65001
- const { method, path, host, upgrade, expectContinue, signal, headers: reqHeaders } = request;
65001
+ const { method, path: path2, host, upgrade, expectContinue, signal, headers: reqHeaders } = request;
65002
65002
  let { body } = request;
65003
65003
  if (upgrade) {
65004
65004
  util.errorRequest(client, request, new Error("Upgrade not supported for H2"));
@@ -65065,7 +65065,7 @@ var require_client_h2 = __commonJS({
65065
65065
  });
65066
65066
  return true;
65067
65067
  }
65068
- headers[HTTP2_HEADER_PATH] = path;
65068
+ headers[HTTP2_HEADER_PATH] = path2;
65069
65069
  headers[HTTP2_HEADER_SCHEME] = "https";
65070
65070
  const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH";
65071
65071
  if (body && typeof body.read === "function") {
@@ -65418,9 +65418,9 @@ var require_redirect_handler = __commonJS({
65418
65418
  return this.handler.onHeaders(statusCode, headers, resume, statusText);
65419
65419
  }
65420
65420
  const { origin, pathname, search } = util.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin)));
65421
- const path = search ? `${pathname}${search}` : pathname;
65421
+ const path2 = search ? `${pathname}${search}` : pathname;
65422
65422
  this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin);
65423
- this.opts.path = path;
65423
+ this.opts.path = path2;
65424
65424
  this.opts.origin = origin;
65425
65425
  this.opts.maxRedirections = 0;
65426
65426
  this.opts.query = null;
@@ -66655,10 +66655,10 @@ var require_proxy_agent = __commonJS({
66655
66655
  };
66656
66656
  const {
66657
66657
  origin,
66658
- path = "/",
66658
+ path: path2 = "/",
66659
66659
  headers = {}
66660
66660
  } = opts;
66661
- opts.path = origin + path;
66661
+ opts.path = origin + path2;
66662
66662
  if (!("host" in headers) && !("Host" in headers)) {
66663
66663
  const { host } = new URL2(origin);
66664
66664
  headers.host = host;
@@ -68579,20 +68579,20 @@ var require_mock_utils = __commonJS({
68579
68579
  }
68580
68580
  return true;
68581
68581
  }
68582
- function safeUrl(path) {
68583
- if (typeof path !== "string") {
68584
- return path;
68582
+ function safeUrl(path2) {
68583
+ if (typeof path2 !== "string") {
68584
+ return path2;
68585
68585
  }
68586
- const pathSegments = path.split("?");
68586
+ const pathSegments = path2.split("?");
68587
68587
  if (pathSegments.length !== 2) {
68588
- return path;
68588
+ return path2;
68589
68589
  }
68590
68590
  const qp = new URLSearchParams(pathSegments.pop());
68591
68591
  qp.sort();
68592
68592
  return [...pathSegments, qp.toString()].join("?");
68593
68593
  }
68594
- function matchKey(mockDispatch2, { path, method, body, headers }) {
68595
- const pathMatch = matchValue(mockDispatch2.path, path);
68594
+ function matchKey(mockDispatch2, { path: path2, method, body, headers }) {
68595
+ const pathMatch = matchValue(mockDispatch2.path, path2);
68596
68596
  const methodMatch = matchValue(mockDispatch2.method, method);
68597
68597
  const bodyMatch = typeof mockDispatch2.body !== "undefined" ? matchValue(mockDispatch2.body, body) : true;
68598
68598
  const headersMatch = matchHeaders(mockDispatch2, headers);
@@ -68614,7 +68614,7 @@ var require_mock_utils = __commonJS({
68614
68614
  function getMockDispatch(mockDispatches, key) {
68615
68615
  const basePath = key.query ? buildURL(key.path, key.query) : key.path;
68616
68616
  const resolvedPath = typeof basePath === "string" ? safeUrl(basePath) : basePath;
68617
- let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path }) => matchValue(safeUrl(path), resolvedPath));
68617
+ let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path2 }) => matchValue(safeUrl(path2), resolvedPath));
68618
68618
  if (matchedMockDispatches.length === 0) {
68619
68619
  throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`);
68620
68620
  }
@@ -68652,9 +68652,9 @@ var require_mock_utils = __commonJS({
68652
68652
  }
68653
68653
  }
68654
68654
  function buildKey(opts) {
68655
- const { path, method, body, headers, query } = opts;
68655
+ const { path: path2, method, body, headers, query } = opts;
68656
68656
  return {
68657
- path,
68657
+ path: path2,
68658
68658
  method,
68659
68659
  body,
68660
68660
  headers,
@@ -69117,10 +69117,10 @@ var require_pending_interceptors_formatter = __commonJS({
69117
69117
  }
69118
69118
  format(pendingInterceptors) {
69119
69119
  const withPrettyHeaders = pendingInterceptors.map(
69120
- ({ method, path, data: { statusCode }, persist: persist2, times, timesInvoked, origin }) => ({
69120
+ ({ method, path: path2, data: { statusCode }, persist: persist2, times, timesInvoked, origin }) => ({
69121
69121
  Method: method,
69122
69122
  Origin: origin,
69123
- Path: path,
69123
+ Path: path2,
69124
69124
  "Status code": statusCode,
69125
69125
  Persistent: persist2 ? PERSISTENT : NOT_PERSISTENT,
69126
69126
  Invocations: timesInvoked,
@@ -74001,9 +74001,9 @@ var require_util7 = __commonJS({
74001
74001
  }
74002
74002
  }
74003
74003
  }
74004
- function validateCookiePath(path) {
74005
- for (let i = 0; i < path.length; ++i) {
74006
- const code = path.charCodeAt(i);
74004
+ function validateCookiePath(path2) {
74005
+ for (let i = 0; i < path2.length; ++i) {
74006
+ const code = path2.charCodeAt(i);
74007
74007
  if (code < 32 || // exclude CTLs (0-31)
74008
74008
  code === 127 || // DEL
74009
74009
  code === 59) {
@@ -76696,11 +76696,11 @@ var require_undici = __commonJS({
76696
76696
  if (typeof opts.path !== "string") {
76697
76697
  throw new InvalidArgumentError("invalid opts.path");
76698
76698
  }
76699
- let path = opts.path;
76699
+ let path2 = opts.path;
76700
76700
  if (!opts.path.startsWith("/")) {
76701
- path = `/${path}`;
76701
+ path2 = `/${path2}`;
76702
76702
  }
76703
- url = new URL(util.parseOrigin(url).origin + path);
76703
+ url = new URL(util.parseOrigin(url).origin + path2);
76704
76704
  } else {
76705
76705
  if (!opts) {
76706
76706
  opts = typeof url === "object" ? url : {};
@@ -79278,8 +79278,8 @@ var require_builder = __commonJS({
79278
79278
  var sdk_1 = __importDefault(require_sdk());
79279
79279
  var axios_1 = __importDefault(require_axios());
79280
79280
  var runtime_1 = require_runtime();
79281
- var fs = __importStar(require("fs"));
79282
- var path = __importStar(require("path"));
79281
+ var fs2 = __importStar(require("fs"));
79282
+ var path2 = __importStar(require("path"));
79283
79283
  var models_1 = require_models();
79284
79284
  var cms_template_1 = require_cms_template();
79285
79285
  var cms_runtime_1 = require_cms_runtime();
@@ -79348,44 +79348,44 @@ var require_builder = __commonJS({
79348
79348
  return code.replace(pattern, "");
79349
79349
  }
79350
79350
  function snapshotDir(leadId) {
79351
- return path.join((0, runtime_1.userDataDir)(), "data", "sites", String(leadId));
79351
+ return path2.join((0, runtime_1.userDataDir)(), "data", "sites", String(leadId));
79352
79352
  }
79353
79353
  function saveSnapshot(leadId, files) {
79354
79354
  const dir = snapshotDir(leadId);
79355
79355
  try {
79356
- fs.mkdirSync(dir, { recursive: true });
79356
+ fs2.mkdirSync(dir, { recursive: true });
79357
79357
  for (const f of files) {
79358
- const target = path.join(dir, f.file);
79359
- fs.mkdirSync(path.dirname(target), { recursive: true });
79358
+ const target = path2.join(dir, f.file);
79359
+ fs2.mkdirSync(path2.dirname(target), { recursive: true });
79360
79360
  if (f.encoding === "base64") {
79361
- fs.writeFileSync(target, Buffer.from(f.data, "base64"));
79361
+ fs2.writeFileSync(target, Buffer.from(f.data, "base64"));
79362
79362
  } else {
79363
- fs.writeFileSync(target, f.data, "utf-8");
79363
+ fs2.writeFileSync(target, f.data, "utf-8");
79364
79364
  }
79365
79365
  }
79366
- fs.writeFileSync(path.join(dir, ".snapshot.json"), JSON.stringify({ savedAt: Date.now() }));
79366
+ fs2.writeFileSync(path2.join(dir, ".snapshot.json"), JSON.stringify({ savedAt: Date.now() }));
79367
79367
  } catch {
79368
79368
  }
79369
79369
  }
79370
79370
  function loadSnapshot(leadId) {
79371
79371
  const dir = snapshotDir(leadId);
79372
- if (!fs.existsSync(dir))
79372
+ if (!fs2.existsSync(dir))
79373
79373
  return null;
79374
79374
  const out = [];
79375
79375
  function walk(rel) {
79376
- const abs = path.join(dir, rel);
79377
- const stat = fs.statSync(abs);
79376
+ const abs = path2.join(dir, rel);
79377
+ const stat = fs2.statSync(abs);
79378
79378
  if (stat.isDirectory()) {
79379
- for (const child of fs.readdirSync(abs)) {
79379
+ for (const child of fs2.readdirSync(abs)) {
79380
79380
  if (child.startsWith("."))
79381
79381
  continue;
79382
79382
  walk(rel ? `${rel}/${child}` : child);
79383
79383
  }
79384
79384
  } else if (stat.isFile()) {
79385
79385
  if (/\.(jpg|jpeg|png|gif|webp|avif)$/i.test(rel)) {
79386
- out.push({ file: rel, data: fs.readFileSync(abs).toString("base64"), encoding: "base64" });
79386
+ out.push({ file: rel, data: fs2.readFileSync(abs).toString("base64"), encoding: "base64" });
79387
79387
  } else {
79388
- out.push({ file: rel, data: fs.readFileSync(abs, "utf-8"), encoding: "utf-8" });
79388
+ out.push({ file: rel, data: fs2.readFileSync(abs, "utf-8"), encoding: "utf-8" });
79389
79389
  }
79390
79390
  }
79391
79391
  }
@@ -79756,7 +79756,13 @@ ${prompt}` : prompt;
79756
79756
  }
79757
79757
  let appCode = await generateOnce();
79758
79758
  if (!appCode.includes("export default App")) {
79759
- throw new Error("Generated code is incomplete (no export default)");
79759
+ onProgress("First attempt came back truncated \u2014 retrying with a leaner build\u2026");
79760
+ const retry = await generateOnce("Your previous attempt was cut off before finishing. Produce a COMPLETE, self-contained App component that ends with `export default App;`. Keep it tighter \u2014 fewer sections, less inline copy \u2014 so it fits comfortably. Do not exceed what you can finish.");
79761
+ if (retry.includes("export default App")) {
79762
+ appCode = retry;
79763
+ } else {
79764
+ throw new Error("The site was too large to generate in one pass (Claude's output was cut off twice). Try again with instructions to keep it simple \u2014 e.g. 'minimal, few sections'.");
79765
+ }
79760
79766
  }
79761
79767
  const stockHosts = findStockImages(appCode);
79762
79768
  if (stockHosts.length > 0) {
@@ -82047,7 +82053,7 @@ var require_package = __commonJS({
82047
82053
  "package.json"(exports2, module2) {
82048
82054
  module2.exports = {
82049
82055
  name: "sproutkit-code",
82050
- version: "0.1.2",
82056
+ version: "0.2.0",
82051
82057
  description: "Sproutkit in your terminal \u2014 find leads, build sites, run outreach, all via chat.",
82052
82058
  bin: {
82053
82059
  sproutkit: "./dist/index.js"
@@ -82093,6 +82099,7 @@ var autoMode = require_auto_mode();
82093
82099
  var cms = require_cms_provision();
82094
82100
  var bookingPreset = require_booking_preset();
82095
82101
  var builder = require_builder();
82102
+ var models = require_models();
82096
82103
  var initDatabase = db.initDatabase;
82097
82104
  var getDb = db.getDb;
82098
82105
  var chatWithTools = chat.chatWithTools;
@@ -82100,6 +82107,10 @@ var startAutoJob = autoMode.startAutoJob;
82100
82107
  var provisionCmsForLead = cms.provisionCmsForLead;
82101
82108
  var generatePreset = bookingPreset.generatePreset;
82102
82109
  var deployBookingOnly = builder.deployBookingOnly;
82110
+ var refreshModels = models.refreshModels;
82111
+ var refreshIfStale = models.refreshIfStale;
82112
+ var listCachedModels = models.listCachedModels;
82113
+ var getPreferredModel = models.getPreferredModel;
82103
82114
 
82104
82115
  // src/config.ts
82105
82116
  var REQUIRED_KEYS = [
@@ -82236,6 +82247,53 @@ function closeTty() {
82236
82247
  function say(msg = "") {
82237
82248
  process.stdout.write(msg + "\n");
82238
82249
  }
82250
+ var FRAMES = ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"];
82251
+ var Status = class {
82252
+ timer = null;
82253
+ frame = 0;
82254
+ label = "";
82255
+ stage = "";
82256
+ tty = process.stdout.isTTY && useColor;
82257
+ start(label) {
82258
+ this.label = label;
82259
+ this.stage = "";
82260
+ if (!this.tty) {
82261
+ say(c.cyan(` \u27F3 ${label}`));
82262
+ return;
82263
+ }
82264
+ this.render();
82265
+ this.timer = setInterval(() => {
82266
+ this.frame = (this.frame + 1) % FRAMES.length;
82267
+ this.render();
82268
+ }, 80);
82269
+ }
82270
+ // Update the current stage (e.g. "Generating site with Claude…").
82271
+ update(stage) {
82272
+ this.stage = stage;
82273
+ if (!this.tty) {
82274
+ say(c.dim(` \u2026 ${stage}`));
82275
+ return;
82276
+ }
82277
+ this.render();
82278
+ }
82279
+ render() {
82280
+ const spin = c.cyan(FRAMES[this.frame]);
82281
+ const stage = this.stage ? c.dim(` \xB7 ${this.stage}`) : "";
82282
+ process.stdout.write(`\r\x1B[2K ${spin} ${this.label}${stage}`);
82283
+ }
82284
+ // Stop with a terminal state, leaving one clean line behind.
82285
+ done(ok, finalLabel) {
82286
+ if (this.timer) {
82287
+ clearInterval(this.timer);
82288
+ this.timer = null;
82289
+ }
82290
+ const label = finalLabel ?? this.label;
82291
+ const mark = ok ? c.green("\u2713") : c.red("\u2717");
82292
+ if (this.tty) process.stdout.write(`\r\x1B[2K ${mark} ${label}
82293
+ `);
82294
+ else say(` ${mark} ${label}`);
82295
+ }
82296
+ };
82239
82297
 
82240
82298
  // src/onboarding.ts
82241
82299
  async function onboardLicense(force) {
@@ -82286,6 +82344,13 @@ async function runOnboarding(force = false) {
82286
82344
  }
82287
82345
  say();
82288
82346
  }
82347
+ const anthropicKey = getSetting("anthropic_key");
82348
+ if (anthropicKey) {
82349
+ try {
82350
+ await refreshModels(anthropicKey);
82351
+ } catch {
82352
+ }
82353
+ }
82289
82354
  const stillMissing = missingRequiredKeys();
82290
82355
  if (stillMissing.length > 0) {
82291
82356
  say(c.amber(` Still missing: ${stillMissing.map((m) => m.label).join(", ")}.`));
@@ -82390,6 +82455,97 @@ function makeInvokeIpc(emit) {
82390
82455
  };
82391
82456
  }
82392
82457
 
82458
+ // src/sync.ts
82459
+ var import_os2 = __toESM(require("os"));
82460
+ var import_path = __toESM(require("path"));
82461
+ var import_fs = __toESM(require("fs"));
82462
+ var COLS = [
82463
+ "place_id",
82464
+ "name",
82465
+ "type",
82466
+ "city",
82467
+ "address",
82468
+ "phone",
82469
+ "website",
82470
+ "rating",
82471
+ "review_count",
82472
+ "lat",
82473
+ "lng",
82474
+ "status",
82475
+ "site_url",
82476
+ "site_built_at",
82477
+ "contacted_at",
82478
+ "notes",
82479
+ "score",
82480
+ "price_level",
82481
+ "business_status"
82482
+ ];
82483
+ function desktopDbPath() {
82484
+ const home = import_os2.default.homedir();
82485
+ const candidates = [];
82486
+ if (process.platform === "darwin") {
82487
+ candidates.push(import_path.default.join(home, "Library", "Application Support", "Sproutkit", "data", "sproutio.db"));
82488
+ } else if (process.platform === "win32") {
82489
+ const appData = process.env.APPDATA || import_path.default.join(home, "AppData", "Roaming");
82490
+ candidates.push(import_path.default.join(appData, "Sproutkit", "data", "sproutio.db"));
82491
+ } else {
82492
+ const cfg = process.env.XDG_CONFIG_HOME || import_path.default.join(home, ".config");
82493
+ candidates.push(import_path.default.join(cfg, "Sproutkit", "data", "sproutio.db"));
82494
+ }
82495
+ return candidates.find((p) => import_fs.default.existsSync(p)) ?? null;
82496
+ }
82497
+ function syncToDesktop(opts = {}) {
82498
+ const dest = desktopDbPath();
82499
+ if (!dest) return { ok: false, reason: "no_desktop_db", inserted: 0, updated: 0 };
82500
+ const cliLeads = getDb().all(
82501
+ `SELECT ${COLS.join(", ")} FROM leads WHERE place_id IS NOT NULL AND place_id != ''`,
82502
+ []
82503
+ );
82504
+ if (cliLeads.length === 0) return { ok: true, inserted: 0, updated: 0 };
82505
+ const { Database } = require("node-sqlite3-wasm");
82506
+ const ddb = new Database(dest);
82507
+ let inserted = 0;
82508
+ let updated = 0;
82509
+ try {
82510
+ for (const lead of cliLeads) {
82511
+ const existing = ddb.get("SELECT id FROM leads WHERE place_id = ?", [lead.place_id]);
82512
+ if (existing) {
82513
+ ddb.run(
82514
+ "UPDATE leads SET status = ?, site_url = ?, site_built_at = ?, score = ? WHERE place_id = ?",
82515
+ [lead.status, lead.site_url, lead.site_built_at, lead.score, lead.place_id].map(
82516
+ (v) => v ?? null
82517
+ )
82518
+ );
82519
+ updated++;
82520
+ } else {
82521
+ const placeholders = COLS.map(() => "?").join(", ");
82522
+ ddb.run(
82523
+ `INSERT INTO leads (${COLS.join(", ")}) VALUES (${placeholders})`,
82524
+ COLS.map((k) => lead[k] ?? null)
82525
+ );
82526
+ inserted++;
82527
+ }
82528
+ }
82529
+ } finally {
82530
+ ddb.close();
82531
+ }
82532
+ if (!opts.quiet) {
82533
+ say(
82534
+ c.green(` \u2713 Synced to desktop: ${inserted} new, ${updated} updated.`)
82535
+ );
82536
+ }
82537
+ return { ok: true, inserted, updated };
82538
+ }
82539
+ function autoSync() {
82540
+ try {
82541
+ const r = syncToDesktop({ quiet: true });
82542
+ if (r.ok && (r.inserted || r.updated)) {
82543
+ say(c.dim(` \u2194 synced to desktop (${r.inserted} new, ${r.updated} updated)`));
82544
+ }
82545
+ } catch {
82546
+ }
82547
+ }
82548
+
82393
82549
  // src/chat-repl.ts
82394
82550
  function loadHistory() {
82395
82551
  const rows = getDb().all(
@@ -82438,12 +82594,14 @@ async function runTurn(userMessage) {
82438
82594
  const history = loadHistory().slice(0, -1);
82439
82595
  const confirmations = {};
82440
82596
  const completedResults = {};
82597
+ const status = new Status();
82598
+ let statusActive = false;
82441
82599
  let lastProgress = "";
82442
- const emit = (channel, payload) => {
82600
+ const emit = (_channel, payload) => {
82443
82601
  const p = payload;
82444
82602
  if (p?.msg && p.msg !== lastProgress) {
82445
82603
  lastProgress = p.msg;
82446
- say(c.dim(` \u2026 ${p.msg}`));
82604
+ if (statusActive) status.update(p.msg);
82447
82605
  }
82448
82606
  };
82449
82607
  const invokeIpc = makeInvokeIpc(emit);
@@ -82462,11 +82620,15 @@ async function runTurn(userMessage) {
82462
82620
  const t = e.data;
82463
82621
  if (t.status === "pending" && !seenRunning.has(t.id)) {
82464
82622
  seenRunning.add(t.id);
82465
- say(c.cyan(` \u27F3 ${labelFor(t)}`));
82623
+ lastProgress = "";
82624
+ status.start(labelFor(t));
82625
+ statusActive = true;
82466
82626
  } else if (t.status === "completed") {
82467
- say(c.green(` \u2713 ${labelFor(t)}`));
82627
+ status.done(true, labelFor(t));
82628
+ statusActive = false;
82468
82629
  } else if (t.status === "error") {
82469
- say(c.red(` \u2717 ${labelFor(t)} \u2014 ${t.error ?? "failed"}`));
82630
+ status.done(false, `${labelFor(t)} \u2014 ${t.error ?? "failed"}`);
82631
+ statusActive = false;
82470
82632
  }
82471
82633
  }
82472
82634
  },
@@ -82481,8 +82643,14 @@ async function runTurn(userMessage) {
82481
82643
  say();
82482
82644
  persist("assistant", result.text, result.toolCalls);
82483
82645
  }
82646
+ const ranSomething = result.toolCalls.some((t) => t.status === "completed");
82647
+ if (ranSomething) autoSync();
82484
82648
  return;
82485
82649
  }
82650
+ if (statusActive) {
82651
+ status.done(false, "paused for confirmation");
82652
+ statusActive = false;
82653
+ }
82486
82654
  say();
82487
82655
  say(c.amber(` ${pending.length} action${pending.length === 1 ? "" : "s"} need confirmation:`));
82488
82656
  for (const t of pending) {
@@ -82558,6 +82726,47 @@ async function notifyIfOutdated() {
82558
82726
  }
82559
82727
  }
82560
82728
 
82729
+ // src/models-cmd.ts
82730
+ async function runModels() {
82731
+ const apiKey = getSetting("anthropic_key");
82732
+ if (!apiKey) {
82733
+ say(c.red(" No Anthropic key set. Run 'sproutkit setup' first."));
82734
+ return;
82735
+ }
82736
+ say(c.dim(" Fetching your available models from Anthropic\u2026"));
82737
+ let models2 = listCachedModels();
82738
+ try {
82739
+ models2 = await refreshModels(apiKey);
82740
+ } catch (e) {
82741
+ say(c.amber(` Couldn't refresh from the API (${e.message}).`));
82742
+ say(c.dim(" Showing the last known list instead."));
82743
+ }
82744
+ if (models2.length === 0) {
82745
+ say(c.red(" No models returned. Check your Anthropic key and connection."));
82746
+ return;
82747
+ }
82748
+ const current = getPreferredModel();
82749
+ say();
82750
+ say(c.bold(" Available models:"));
82751
+ models2.forEach((m, i) => {
82752
+ const active = m.id === current ? c.green(" \u2190 current") : "";
82753
+ say(` ${c.greenBold(String(i + 1).padStart(2))} ${m.display_name ?? m.id} ${c.dim(m.id)}${active}`);
82754
+ });
82755
+ say();
82756
+ const pick = await ask(c.green(" Pick a number to switch (or Enter to keep current): "));
82757
+ if (!pick) {
82758
+ say(c.dim(" Kept current model."));
82759
+ return;
82760
+ }
82761
+ const idx = Number(pick) - 1;
82762
+ if (Number.isNaN(idx) || idx < 0 || idx >= models2.length) {
82763
+ say(c.amber(" Not a valid choice \u2014 no change made."));
82764
+ return;
82765
+ }
82766
+ setSetting("claude_model", models2[idx].id);
82767
+ say(c.green(` \u2713 Now using ${models2[idx].display_name ?? models2[idx].id}.`));
82768
+ }
82769
+
82561
82770
  // src/index.ts
82562
82771
  process.env.SPROUTKIT_HEADLESS = "1";
82563
82772
  async function main() {
@@ -82573,6 +82782,20 @@ async function main() {
82573
82782
  closeTty();
82574
82783
  return;
82575
82784
  }
82785
+ if (arg === "models") {
82786
+ await runModels();
82787
+ closeTty();
82788
+ return;
82789
+ }
82790
+ if (arg === "sync") {
82791
+ const r = syncToDesktop();
82792
+ if (!r.ok && r.reason === "no_desktop_db") {
82793
+ say(c.dim(" No desktop Sproutkit database found \u2014 nothing to sync to."));
82794
+ say(c.dim(" Install the desktop app and run it once to create it."));
82795
+ }
82796
+ closeTty();
82797
+ return;
82798
+ }
82576
82799
  if (arg === "setup") {
82577
82800
  await runOnboarding(true);
82578
82801
  closeTty();
@@ -82585,6 +82808,8 @@ async function main() {
82585
82808
  say();
82586
82809
  say(` ${c.bold("sproutkit")} start the chat`);
82587
82810
  say(` ${c.bold("sproutkit setup")} set or update your keys and licence`);
82811
+ say(` ${c.bold("sproutkit models")} list Claude models and pick one`);
82812
+ say(` ${c.bold("sproutkit sync")} push your leads into the desktop app`);
82588
82813
  say(` ${c.bold("sproutkit update")} update to the latest version`);
82589
82814
  say(` ${c.bold("sproutkit version")} show the installed version`);
82590
82815
  say(` ${c.bold('sproutkit "..."')} run a single message and exit`);
@@ -82612,6 +82837,8 @@ async function main() {
82612
82837
  closeTty();
82613
82838
  return;
82614
82839
  }
82840
+ await refreshIfStale(getSetting("anthropic_key")).catch(() => {
82841
+ });
82615
82842
  await notifyIfOutdated();
82616
82843
  say(c.dim(" Chat with Sproutkit. Type a request, or 'exit' to quit."));
82617
82844
  say();