sproutkit-code 0.3.1 → 0.5.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/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 fs2 = require("fs");
33
- var path2 = require("path");
34
- var pathFile = path2.join(__dirname, "path.txt");
32
+ var fs3 = require("fs");
33
+ var path3 = require("path");
34
+ var pathFile = path3.join(__dirname, "path.txt");
35
35
  function getElectronPath() {
36
36
  let executablePath;
37
- if (fs2.existsSync(pathFile)) {
38
- executablePath = fs2.readFileSync(pathFile, "utf-8");
37
+ if (fs3.existsSync(pathFile)) {
38
+ executablePath = fs3.readFileSync(pathFile, "utf-8");
39
39
  }
40
40
  if (process.env.ELECTRON_OVERRIDE_DIST_PATH) {
41
- return path2.join(process.env.ELECTRON_OVERRIDE_DIST_PATH, executablePath || "electron");
41
+ return path3.join(process.env.ELECTRON_OVERRIDE_DIST_PATH, executablePath || "electron");
42
42
  }
43
43
  if (executablePath) {
44
- return path2.join(__dirname, "dist", executablePath);
44
+ return path3.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 path2 = url.path;
986
- if (path2.length === 0) {
985
+ const path3 = url.path;
986
+ if (path3.length === 0) {
987
987
  return;
988
988
  }
989
- if (url.scheme === "file" && path2.length === 1 && isNormalizedWindowsDriveLetter(path2[0])) {
989
+ if (url.scheme === "file" && path3.length === 1 && isNormalizedWindowsDriveLetter(path3[0])) {
990
990
  return;
991
991
  }
992
- path2.pop();
992
+ path3.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(path2, { mtimeMs, size }, filenameOrOptions, options = {}) {
10827
+ function createFileFromPath(path3, { 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: path2, size, lastModified: mtimeMs });
10834
+ const file = new FileFromPath({ path: path3, 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(path2, filenameOrOptions, options = {}) {
10844
- const stats = (0, fs_1.statSync)(path2);
10845
- return createFileFromPath(path2, stats, filenameOrOptions, options);
10843
+ function fileFromPathSync(path3, filenameOrOptions, options = {}) {
10844
+ const stats = (0, fs_1.statSync)(path3);
10845
+ return createFileFromPath(path3, stats, filenameOrOptions, options);
10846
10846
  }
10847
10847
  exports2.fileFromPathSync = fileFromPathSync;
10848
- async function fileFromPath(path2, filenameOrOptions, options) {
10849
- const stats = await fs_1.promises.stat(path2);
10850
- return createFileFromPath(path2, stats, filenameOrOptions, options);
10848
+ async function fileFromPath(path3, filenameOrOptions, options) {
10849
+ const stats = await fs_1.promises.stat(path3);
10850
+ return createFileFromPath(path3, 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(path2, ...args) {
10902
+ async function fileFromPath(path3, ...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(path2)}) instead`);
10905
+ console.warn(`fileFromPath is deprecated; use fs.createReadStream(${JSON.stringify(path3)}) instead`);
10906
10906
  fileFromPathWarned = true;
10907
10907
  }
10908
- return await _fileFromPath(path2, ...args);
10908
+ return await _fileFromPath(path3, ...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(path2, opts) {
11674
- return this.methodRequest("get", path2, opts);
11673
+ get(path3, opts) {
11674
+ return this.methodRequest("get", path3, opts);
11675
11675
  }
11676
- post(path2, opts) {
11677
- return this.methodRequest("post", path2, opts);
11676
+ post(path3, opts) {
11677
+ return this.methodRequest("post", path3, opts);
11678
11678
  }
11679
- patch(path2, opts) {
11680
- return this.methodRequest("patch", path2, opts);
11679
+ patch(path3, opts) {
11680
+ return this.methodRequest("patch", path3, opts);
11681
11681
  }
11682
- put(path2, opts) {
11683
- return this.methodRequest("put", path2, opts);
11682
+ put(path3, opts) {
11683
+ return this.methodRequest("put", path3, opts);
11684
11684
  }
11685
- delete(path2, opts) {
11686
- return this.methodRequest("delete", path2, opts);
11685
+ delete(path3, opts) {
11686
+ return this.methodRequest("delete", path3, opts);
11687
11687
  }
11688
- methodRequest(method, path2, opts) {
11688
+ methodRequest(method, path3, 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: path2, ...opts2, body };
11691
+ return { method, path: path3, ...opts2, body };
11692
11692
  }));
11693
11693
  }
11694
- getAPIList(path2, Page, opts) {
11695
- return this.requestAPIList(Page, { method: "get", path: path2, ...opts });
11694
+ getAPIList(path3, Page, opts) {
11695
+ return this.requestAPIList(Page, { method: "get", path: path3, ...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: path2, query, headers = {} } = options;
11713
+ const { method, path: path3, 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(path2, query);
11716
+ const url = this.buildURL(path3, 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(path2, query) {
11830
- const url = isAbsoluteURL(path2) ? new URL(path2) : new URL(this.baseURL + (this.baseURL.endsWith("/") && path2.startsWith("/") ? path2.slice(1) : path2));
11829
+ buildURL(path3, query) {
11830
+ const url = isAbsoluteURL(path3) ? new URL(path3) : new URL(this.baseURL + (this.baseURL.endsWith("/") && path3.startsWith("/") ? path3.slice(1) : path3));
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(path2) {
23168
- if (!path2 || typeof path2 !== "string") {
23167
+ function lookup(path3) {
23168
+ if (!path3 || typeof path3 !== "string") {
23169
23169
  return false;
23170
23170
  }
23171
- var extension2 = extname("x." + path2).toLowerCase().substr(1);
23171
+ var extension2 = extname("x." + path3).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 path2 = require("path");
24276
+ var path3 = require("path");
24277
24277
  var http = require("http");
24278
24278
  var https = require("https");
24279
24279
  var parseUrl = require("url").parse;
24280
- var fs2 = require("fs");
24280
+ var fs3 = 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
- fs2.stat(value.path, function(err, stat) {
24347
+ fs3.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 = path2.normalize(options.filepath).replace(/\\/g, "/");
24404
+ filename = path3.normalize(options.filepath).replace(/\\/g, "/");
24405
24405
  } else if (options.filename || value && (value.name || value.path)) {
24406
- filename = path2.basename(options.filename || value && (value.name || value.path));
24406
+ filename = path3.basename(options.filename || value && (value.name || value.path));
24407
24407
  } else if (value && value.readable && hasOwn(value, "httpVersion")) {
24408
- filename = path2.basename(value.client._httpMessage.path || "");
24408
+ filename = path3.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 os3 = require("os");
24953
+ var os4 = 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 = os3.release().split(".");
25001
+ const osRelease = os4.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 path2 = require("path");
26229
+ var path3 = 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(path3, key, dots) {
27117
- if (!path3) return key;
27118
- return path3.concat(key).map(function each(token, i) {
27116
+ function renderKey(path4, key, dots) {
27117
+ if (!path4) return key;
27118
+ return path4.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, path3) {
27167
+ function defaultVisitor(value, key, path4) {
27168
27168
  let arr = value;
27169
27169
  if (utils$1.isReactNative(formData) && utils$1.isReactNativeBlob(value)) {
27170
- formData.append(renderKey(path3, key, dots), convertValue(value));
27170
+ formData.append(renderKey(path4, key, dots), convertValue(value));
27171
27171
  return false;
27172
27172
  }
27173
- if (value && !path3 && typeof value === "object") {
27173
+ if (value && !path4 && 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(path3, key, dots), convertValue(value));
27192
+ formData.append(renderKey(path4, 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, path3, depth = 0) {
27201
+ function build(value, path4, 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 " + path3.join("."));
27207
+ throw Error("Circular reference detected in " + path4.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, path3, exposedHelpers);
27211
+ const result = !(utils$1.isUndefined(el) || el === null) && visitor.call(formData, el, utils$1.isString(key) ? key.trim() : key, path4, exposedHelpers);
27212
27212
  if (result === true) {
27213
- build(el, path3 ? path3.concat(key) : [key], depth + 1);
27213
+ build(el, path4 ? path4.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, path3, helpers) {
27401
+ visitor: function(value, key, path4, 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(path3, value, target, index) {
27430
- let name = path3[index++];
27429
+ function buildPath(path4, value, target, index) {
27430
+ let name = path4[index++];
27431
27431
  if (name === "__proto__") return true;
27432
27432
  const isNumericKey = Number.isFinite(+name);
27433
- const isLast = index >= path3.length;
27433
+ const isLast = index >= path4.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(path3, value, target[name], index);
27446
+ const result = buildPath(path4, 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 = path2.resolve(config.socketPath);
28817
- const isAllowed = allowed.some((entry) => typeof entry === "string" && path2.resolve(entry) === resolvedSocket);
28816
+ const resolvedSocket = path3.resolve(config.socketPath);
28817
+ const isAllowed = allowed.some((entry) => typeof entry === "string" && path3.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, path3, domain, secure, sameSite) {
29071
+ write(name, value, expires, path4, 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(path3)) {
29078
- cookie.push(`path=${path3}`);
29077
+ if (utils$1.isString(path4)) {
29078
+ cookie.push(`path=${path4}`);
29079
29079
  }
29080
29080
  if (utils$1.isString(domain)) {
29081
29081
  cookie.push(`domain=${domain}`);
@@ -30441,14 +30441,20 @@ var require_llm = __commonJS({
30441
30441
  }
30442
30442
  }))
30443
30443
  ] : args.prompt;
30444
- const res = await anthropic.messages.create({
30444
+ const req = {
30445
30445
  model: args.model || "claude-sonnet-4-6",
30446
30446
  max_tokens: args.maxTokens ?? 8192,
30447
30447
  messages: [{ role: "user", content }]
30448
- });
30449
- const textBlock = res.content.find((b) => b.type === "text");
30448
+ };
30449
+ if (args.allowWebSearch) {
30450
+ req.tools = [
30451
+ { type: "web_search_20250305", name: "web_search", max_uses: 3 }
30452
+ ];
30453
+ }
30454
+ const res = await anthropic.messages.create(req);
30455
+ const text = res.content.filter((b) => b.type === "text").map((b) => b.text).join("\n").trim();
30450
30456
  return {
30451
- text: textBlock?.text ?? "",
30457
+ text,
30452
30458
  stopReason: res.stop_reason ?? null,
30453
30459
  backend: "api"
30454
30460
  };
@@ -30461,6 +30467,8 @@ var require_llm = __commonJS({
30461
30467
  const alias = getClaudeCodeModel2();
30462
30468
  if (alias)
30463
30469
  cliArgs.push("--model", alias);
30470
+ if (args.allowWebSearch)
30471
+ cliArgs.push("--allowedTools", "WebSearch");
30464
30472
  const bin = claudeBin2();
30465
30473
  const timeoutMs = args.timeoutMs ?? 18e4;
30466
30474
  return new Promise((resolve, reject) => {
@@ -34875,8 +34883,8 @@ var require_windows = __commonJS({
34875
34883
  "../../node_modules/isexe/windows.js"(exports2, module2) {
34876
34884
  module2.exports = isexe;
34877
34885
  isexe.sync = sync;
34878
- var fs2 = require("fs");
34879
- function checkPathExt(path2, options) {
34886
+ var fs3 = require("fs");
34887
+ function checkPathExt(path3, options) {
34880
34888
  var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT;
34881
34889
  if (!pathext) {
34882
34890
  return true;
@@ -34887,25 +34895,25 @@ var require_windows = __commonJS({
34887
34895
  }
34888
34896
  for (var i = 0; i < pathext.length; i++) {
34889
34897
  var p = pathext[i].toLowerCase();
34890
- if (p && path2.substr(-p.length).toLowerCase() === p) {
34898
+ if (p && path3.substr(-p.length).toLowerCase() === p) {
34891
34899
  return true;
34892
34900
  }
34893
34901
  }
34894
34902
  return false;
34895
34903
  }
34896
- function checkStat(stat, path2, options) {
34904
+ function checkStat(stat, path3, options) {
34897
34905
  if (!stat.isSymbolicLink() && !stat.isFile()) {
34898
34906
  return false;
34899
34907
  }
34900
- return checkPathExt(path2, options);
34908
+ return checkPathExt(path3, options);
34901
34909
  }
34902
- function isexe(path2, options, cb) {
34903
- fs2.stat(path2, function(er, stat) {
34904
- cb(er, er ? false : checkStat(stat, path2, options));
34910
+ function isexe(path3, options, cb) {
34911
+ fs3.stat(path3, function(er, stat) {
34912
+ cb(er, er ? false : checkStat(stat, path3, options));
34905
34913
  });
34906
34914
  }
34907
- function sync(path2, options) {
34908
- return checkStat(fs2.statSync(path2), path2, options);
34915
+ function sync(path3, options) {
34916
+ return checkStat(fs3.statSync(path3), path3, options);
34909
34917
  }
34910
34918
  }
34911
34919
  });
@@ -34915,14 +34923,14 @@ var require_mode = __commonJS({
34915
34923
  "../../node_modules/isexe/mode.js"(exports2, module2) {
34916
34924
  module2.exports = isexe;
34917
34925
  isexe.sync = sync;
34918
- var fs2 = require("fs");
34919
- function isexe(path2, options, cb) {
34920
- fs2.stat(path2, function(er, stat) {
34926
+ var fs3 = require("fs");
34927
+ function isexe(path3, options, cb) {
34928
+ fs3.stat(path3, function(er, stat) {
34921
34929
  cb(er, er ? false : checkStat(stat, options));
34922
34930
  });
34923
34931
  }
34924
- function sync(path2, options) {
34925
- return checkStat(fs2.statSync(path2), options);
34932
+ function sync(path3, options) {
34933
+ return checkStat(fs3.statSync(path3), options);
34926
34934
  }
34927
34935
  function checkStat(stat, options) {
34928
34936
  return stat.isFile() && checkMode(stat, options);
@@ -34946,7 +34954,7 @@ var require_mode = __commonJS({
34946
34954
  // ../../node_modules/isexe/index.js
34947
34955
  var require_isexe = __commonJS({
34948
34956
  "../../node_modules/isexe/index.js"(exports2, module2) {
34949
- var fs2 = require("fs");
34957
+ var fs3 = require("fs");
34950
34958
  var core;
34951
34959
  if (process.platform === "win32" || global.TESTING_WINDOWS) {
34952
34960
  core = require_windows();
@@ -34955,7 +34963,7 @@ var require_isexe = __commonJS({
34955
34963
  }
34956
34964
  module2.exports = isexe;
34957
34965
  isexe.sync = sync;
34958
- function isexe(path2, options, cb) {
34966
+ function isexe(path3, options, cb) {
34959
34967
  if (typeof options === "function") {
34960
34968
  cb = options;
34961
34969
  options = {};
@@ -34965,7 +34973,7 @@ var require_isexe = __commonJS({
34965
34973
  throw new TypeError("callback not provided");
34966
34974
  }
34967
34975
  return new Promise(function(resolve, reject) {
34968
- isexe(path2, options || {}, function(er, is) {
34976
+ isexe(path3, options || {}, function(er, is) {
34969
34977
  if (er) {
34970
34978
  reject(er);
34971
34979
  } else {
@@ -34974,7 +34982,7 @@ var require_isexe = __commonJS({
34974
34982
  });
34975
34983
  });
34976
34984
  }
34977
- core(path2, options || {}, function(er, is) {
34985
+ core(path3, options || {}, function(er, is) {
34978
34986
  if (er) {
34979
34987
  if (er.code === "EACCES" || options && options.ignoreErrors) {
34980
34988
  er = null;
@@ -34984,9 +34992,9 @@ var require_isexe = __commonJS({
34984
34992
  cb(er, is);
34985
34993
  });
34986
34994
  }
34987
- function sync(path2, options) {
34995
+ function sync(path3, options) {
34988
34996
  try {
34989
- return core.sync(path2, options || {});
34997
+ return core.sync(path3, options || {});
34990
34998
  } catch (er) {
34991
34999
  if (options && options.ignoreErrors || er.code === "EACCES") {
34992
35000
  return false;
@@ -35002,7 +35010,7 @@ var require_isexe = __commonJS({
35002
35010
  var require_which = __commonJS({
35003
35011
  "../../node_modules/which/which.js"(exports2, module2) {
35004
35012
  var isWindows = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
35005
- var path2 = require("path");
35013
+ var path3 = require("path");
35006
35014
  var COLON = isWindows ? ";" : ":";
35007
35015
  var isexe = require_isexe();
35008
35016
  var getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" });
@@ -35040,7 +35048,7 @@ var require_which = __commonJS({
35040
35048
  return opt.all && found.length ? resolve(found) : reject(getNotFoundError(cmd));
35041
35049
  const ppRaw = pathEnv[i];
35042
35050
  const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
35043
- const pCmd = path2.join(pathPart, cmd);
35051
+ const pCmd = path3.join(pathPart, cmd);
35044
35052
  const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
35045
35053
  resolve(subStep(p, i, 0));
35046
35054
  });
@@ -35067,7 +35075,7 @@ var require_which = __commonJS({
35067
35075
  for (let i = 0; i < pathEnv.length; i++) {
35068
35076
  const ppRaw = pathEnv[i];
35069
35077
  const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
35070
- const pCmd = path2.join(pathPart, cmd);
35078
+ const pCmd = path3.join(pathPart, cmd);
35071
35079
  const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
35072
35080
  for (let j = 0; j < pathExt.length; j++) {
35073
35081
  const cur = p + pathExt[j];
@@ -35115,7 +35123,7 @@ var require_path_key = __commonJS({
35115
35123
  var require_resolveCommand = __commonJS({
35116
35124
  "../../node_modules/cross-spawn/lib/util/resolveCommand.js"(exports2, module2) {
35117
35125
  "use strict";
35118
- var path2 = require("path");
35126
+ var path3 = require("path");
35119
35127
  var which = require_which();
35120
35128
  var getPathKey = require_path_key();
35121
35129
  function resolveCommandAttempt(parsed, withoutPathExt) {
@@ -35133,7 +35141,7 @@ var require_resolveCommand = __commonJS({
35133
35141
  try {
35134
35142
  resolved = which.sync(parsed.command, {
35135
35143
  path: env[getPathKey({ env })],
35136
- pathExt: withoutPathExt ? path2.delimiter : void 0
35144
+ pathExt: withoutPathExt ? path3.delimiter : void 0
35137
35145
  });
35138
35146
  } catch (e) {
35139
35147
  } finally {
@@ -35142,7 +35150,7 @@ var require_resolveCommand = __commonJS({
35142
35150
  }
35143
35151
  }
35144
35152
  if (resolved) {
35145
- resolved = path2.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
35153
+ resolved = path3.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
35146
35154
  }
35147
35155
  return resolved;
35148
35156
  }
@@ -35196,8 +35204,8 @@ var require_shebang_command = __commonJS({
35196
35204
  if (!match) {
35197
35205
  return null;
35198
35206
  }
35199
- const [path2, argument] = match[0].replace(/#! ?/, "").split(" ");
35200
- const binary = path2.split("/").pop();
35207
+ const [path3, argument] = match[0].replace(/#! ?/, "").split(" ");
35208
+ const binary = path3.split("/").pop();
35201
35209
  if (binary === "env") {
35202
35210
  return argument;
35203
35211
  }
@@ -35210,16 +35218,16 @@ var require_shebang_command = __commonJS({
35210
35218
  var require_readShebang = __commonJS({
35211
35219
  "../../node_modules/cross-spawn/lib/util/readShebang.js"(exports2, module2) {
35212
35220
  "use strict";
35213
- var fs2 = require("fs");
35221
+ var fs3 = require("fs");
35214
35222
  var shebangCommand = require_shebang_command();
35215
35223
  function readShebang(command) {
35216
35224
  const size = 150;
35217
35225
  const buffer = Buffer.alloc(size);
35218
35226
  let fd;
35219
35227
  try {
35220
- fd = fs2.openSync(command, "r");
35221
- fs2.readSync(fd, buffer, 0, size, 0);
35222
- fs2.closeSync(fd);
35228
+ fd = fs3.openSync(command, "r");
35229
+ fs3.readSync(fd, buffer, 0, size, 0);
35230
+ fs3.closeSync(fd);
35223
35231
  } catch (e) {
35224
35232
  }
35225
35233
  return shebangCommand(buffer.toString());
@@ -35232,7 +35240,7 @@ var require_readShebang = __commonJS({
35232
35240
  var require_parse = __commonJS({
35233
35241
  "../../node_modules/cross-spawn/lib/parse.js"(exports2, module2) {
35234
35242
  "use strict";
35235
- var path2 = require("path");
35243
+ var path3 = require("path");
35236
35244
  var resolveCommand = require_resolveCommand();
35237
35245
  var escape = require_escape();
35238
35246
  var readShebang = require_readShebang();
@@ -35257,7 +35265,7 @@ var require_parse = __commonJS({
35257
35265
  const needsShell = !isExecutableRegExp.test(commandFile);
35258
35266
  if (parsed.options.forceShell || needsShell) {
35259
35267
  const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
35260
- parsed.command = path2.normalize(parsed.command);
35268
+ parsed.command = path3.normalize(parsed.command);
35261
35269
  parsed.command = escape.command(parsed.command);
35262
35270
  parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
35263
35271
  const shellCommand = [parsed.command].concat(parsed.args).join(" ");
@@ -35389,7 +35397,7 @@ var require_strip_final_newline = __commonJS({
35389
35397
  var require_npm_run_path = __commonJS({
35390
35398
  "../../node_modules/npm-run-path/index.js"(exports2, module2) {
35391
35399
  "use strict";
35392
- var path2 = require("path");
35400
+ var path3 = require("path");
35393
35401
  var pathKey = require_path_key();
35394
35402
  var npmRunPath = (options) => {
35395
35403
  options = {
@@ -35399,16 +35407,16 @@ var require_npm_run_path = __commonJS({
35399
35407
  ...options
35400
35408
  };
35401
35409
  let previous;
35402
- let cwdPath = path2.resolve(options.cwd);
35410
+ let cwdPath = path3.resolve(options.cwd);
35403
35411
  const result = [];
35404
35412
  while (previous !== cwdPath) {
35405
- result.push(path2.join(cwdPath, "node_modules/.bin"));
35413
+ result.push(path3.join(cwdPath, "node_modules/.bin"));
35406
35414
  previous = cwdPath;
35407
- cwdPath = path2.resolve(cwdPath, "..");
35415
+ cwdPath = path3.resolve(cwdPath, "..");
35408
35416
  }
35409
- const execPathDir = path2.resolve(options.cwd, options.execPath, "..");
35417
+ const execPathDir = path3.resolve(options.cwd, options.execPath, "..");
35410
35418
  result.push(execPathDir);
35411
- return result.concat(options.path).join(path2.delimiter);
35419
+ return result.concat(options.path).join(path3.delimiter);
35412
35420
  };
35413
35421
  module2.exports = npmRunPath;
35414
35422
  module2.exports.default = npmRunPath;
@@ -35418,9 +35426,9 @@ var require_npm_run_path = __commonJS({
35418
35426
  ...options
35419
35427
  };
35420
35428
  const env = { ...options.env };
35421
- const path3 = pathKey({ env });
35422
- options.path = env[path3];
35423
- env[path3] = module2.exports(options);
35429
+ const path4 = pathKey({ env });
35430
+ options.path = env[path4];
35431
+ env[path4] = module2.exports(options);
35424
35432
  return env;
35425
35433
  };
35426
35434
  }
@@ -36196,7 +36204,7 @@ var require_signal_exit = __commonJS({
36196
36204
  var require_kill = __commonJS({
36197
36205
  "../../node_modules/execa/lib/kill.js"(exports2, module2) {
36198
36206
  "use strict";
36199
- var os3 = require("os");
36207
+ var os4 = require("os");
36200
36208
  var onExit = require_signal_exit();
36201
36209
  var DEFAULT_FORCE_KILL_TIMEOUT = 1e3 * 5;
36202
36210
  var spawnedKill = (kill, signal = "SIGTERM", options = {}) => {
@@ -36220,7 +36228,7 @@ var require_kill = __commonJS({
36220
36228
  return isSigterm(signal) && forceKillAfterTimeout !== false && killResult;
36221
36229
  };
36222
36230
  var isSigterm = (signal) => {
36223
- return signal === os3.constants.signals.SIGTERM || typeof signal === "string" && signal.toUpperCase() === "SIGTERM";
36231
+ return signal === os4.constants.signals.SIGTERM || typeof signal === "string" && signal.toUpperCase() === "SIGTERM";
36224
36232
  };
36225
36233
  var getForceKillAfterTimeout = ({ forceKillAfterTimeout = true }) => {
36226
36234
  if (forceKillAfterTimeout === true) {
@@ -36602,7 +36610,7 @@ var require_command = __commonJS({
36602
36610
  var require_execa = __commonJS({
36603
36611
  "../../node_modules/execa/index.js"(exports2, module2) {
36604
36612
  "use strict";
36605
- var path2 = require("path");
36613
+ var path3 = require("path");
36606
36614
  var childProcess = require("child_process");
36607
36615
  var crossSpawn = require_cross_spawn();
36608
36616
  var stripFinalNewline = require_strip_final_newline();
@@ -36644,7 +36652,7 @@ var require_execa = __commonJS({
36644
36652
  };
36645
36653
  options.env = getEnv(options);
36646
36654
  options.stdio = normalizeStdio(options);
36647
- if (process.platform === "win32" && path2.basename(file, ".exe") === "cmd") {
36655
+ if (process.platform === "win32" && path3.basename(file, ".exe") === "cmd") {
36648
36656
  args.unshift("/q");
36649
36657
  }
36650
36658
  return { file, args, options, parsed };
@@ -38090,10 +38098,10 @@ var require_util = __commonJS({
38090
38098
  function cloneDef(schema) {
38091
38099
  return mergeDefs(schema._zod.def);
38092
38100
  }
38093
- function getElementAtPath(obj, path2) {
38094
- if (!path2)
38101
+ function getElementAtPath(obj, path3) {
38102
+ if (!path3)
38095
38103
  return obj;
38096
- return path2.reduce((acc, key) => acc?.[key], obj);
38104
+ return path3.reduce((acc, key) => acc?.[key], obj);
38097
38105
  }
38098
38106
  function promiseAllObject(promisesObj) {
38099
38107
  const keys = Object.keys(promisesObj);
@@ -38455,11 +38463,11 @@ var require_util = __commonJS({
38455
38463
  }
38456
38464
  return false;
38457
38465
  }
38458
- function prefixIssues(path2, issues) {
38466
+ function prefixIssues(path3, issues) {
38459
38467
  return issues.map((iss) => {
38460
38468
  var _a;
38461
38469
  (_a = iss).path ?? (_a.path = []);
38462
- iss.path.unshift(path2);
38470
+ iss.path.unshift(path3);
38463
38471
  return iss;
38464
38472
  });
38465
38473
  }
@@ -38669,7 +38677,7 @@ var require_errors2 = __commonJS({
38669
38677
  return issue.message;
38670
38678
  };
38671
38679
  const result = { errors: [] };
38672
- const processError = (error2, path2 = []) => {
38680
+ const processError = (error2, path3 = []) => {
38673
38681
  var _a, _b;
38674
38682
  for (const issue of error2.issues) {
38675
38683
  if (issue.code === "invalid_union" && issue.errors.length) {
@@ -38679,7 +38687,7 @@ var require_errors2 = __commonJS({
38679
38687
  } else if (issue.code === "invalid_element") {
38680
38688
  processError({ issues: issue.issues }, issue.path);
38681
38689
  } else {
38682
- const fullpath = [...path2, ...issue.path];
38690
+ const fullpath = [...path3, ...issue.path];
38683
38691
  if (fullpath.length === 0) {
38684
38692
  result.errors.push(mapper(issue));
38685
38693
  continue;
@@ -38711,8 +38719,8 @@ var require_errors2 = __commonJS({
38711
38719
  }
38712
38720
  function toDotPath(_path) {
38713
38721
  const segs = [];
38714
- const path2 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
38715
- for (const seg of path2) {
38722
+ const path3 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
38723
+ for (const seg of path3) {
38716
38724
  if (typeof seg === "number")
38717
38725
  segs.push(`[${seg}]`);
38718
38726
  else if (typeof seg === "symbol")
@@ -52556,27 +52564,27 @@ var require_schema = __commonJS({
52556
52564
  var require_lib5 = __commonJS({
52557
52565
  "../../node_modules/os-paths/src/lib/index.js"(exports2, module2) {
52558
52566
  "use strict";
52559
- var os3 = require("os");
52567
+ var os4 = require("os");
52560
52568
  var paths = require("path");
52561
52569
  var isWinOS = /^win/i.test(process.platform);
52562
- function normalize_path(path2) {
52563
- return paths.normalize(paths.join(path2, "."));
52570
+ function normalize_path(path3) {
52571
+ return paths.normalize(paths.join(path3, "."));
52564
52572
  }
52565
52573
  var base = () => {
52566
52574
  const { env } = process;
52567
52575
  const object = {};
52568
- object.home = () => normalize_path(os3.homedir ? os3.homedir() : env.HOME);
52569
- object.temp = () => normalize_path(os3.tmpdir ? os3.tmpdir() : env.TMPDIR || env.TEMP || env.TMP);
52576
+ object.home = () => normalize_path(os4.homedir ? os4.homedir() : env.HOME);
52577
+ object.temp = () => normalize_path(os4.tmpdir ? os4.tmpdir() : env.TMPDIR || env.TEMP || env.TMP);
52570
52578
  return object;
52571
52579
  };
52572
52580
  var windows = () => {
52573
52581
  const { env } = process;
52574
52582
  const object = {};
52575
52583
  object.home = () => normalize_path(
52576
- os3.homedir ? os3.homedir() : env.USERPROFILE || paths.join(env.HOMEDRIVE, env.HOMEPATH) || env.HOME
52584
+ os4.homedir ? os4.homedir() : env.USERPROFILE || paths.join(env.HOMEDRIVE, env.HOMEPATH) || env.HOME
52577
52585
  );
52578
52586
  object.temp = () => normalize_path(
52579
- os3.tmpdir ? os3.tmpdir() : env.TEMP || env.TMP || paths.join(env.LOCALAPPDATA || env.SystemRoot || env.windir, "Temp")
52587
+ os4.tmpdir ? os4.tmpdir() : env.TEMP || env.TMP || paths.join(env.LOCALAPPDATA || env.SystemRoot || env.windir, "Temp")
52580
52588
  );
52581
52589
  return object;
52582
52590
  };
@@ -52601,44 +52609,44 @@ var require_lib5 = __commonJS({
52601
52609
  var require_lib6 = __commonJS({
52602
52610
  "../../node_modules/xdg-portable/src/lib/index.js"(exports2, module2) {
52603
52611
  "use strict";
52604
- var path2 = require("path");
52612
+ var path3 = require("path");
52605
52613
  var osPaths = require_lib5();
52606
52614
  var linux = () => {
52607
52615
  const object = {};
52608
- object.cache = () => process.env.XDG_CACHE_HOME || path2.join(osPaths.home() || osPaths.temp(), ".cache");
52609
- object.config = () => process.env.XDG_CONFIG_HOME || path2.join(osPaths.home() || osPaths.temp(), ".config");
52610
- object.data = () => process.env.XDG_DATA_HOME || path2.join(osPaths.home() || osPaths.temp(), ".local", "share");
52616
+ object.cache = () => process.env.XDG_CACHE_HOME || path3.join(osPaths.home() || osPaths.temp(), ".cache");
52617
+ object.config = () => process.env.XDG_CONFIG_HOME || path3.join(osPaths.home() || osPaths.temp(), ".config");
52618
+ object.data = () => process.env.XDG_DATA_HOME || path3.join(osPaths.home() || osPaths.temp(), ".local", "share");
52611
52619
  object.runtime = () => process.env.XDG_RUNTIME_DIR || void 0;
52612
- object.state = () => process.env.XDG_STATE_HOME || path2.join(osPaths.home() || osPaths.temp(), ".local", "state");
52620
+ object.state = () => process.env.XDG_STATE_HOME || path3.join(osPaths.home() || osPaths.temp(), ".local", "state");
52613
52621
  return object;
52614
52622
  };
52615
52623
  var macos = () => {
52616
52624
  const object = {};
52617
- object.cache = () => process.env.XDG_CACHE_HOME || path2.join(path2.join(osPaths.home() || osPaths.temp(), "Library"), "Caches");
52618
- object.config = () => process.env.XDG_CONFIG_HOME || path2.join(path2.join(osPaths.home() || osPaths.temp(), "Library"), "Preferences");
52619
- object.data = () => process.env.XDG_DATA_HOME || path2.join(path2.join(osPaths.home() || osPaths.temp(), "Library"), "Application Support");
52625
+ object.cache = () => process.env.XDG_CACHE_HOME || path3.join(path3.join(osPaths.home() || osPaths.temp(), "Library"), "Caches");
52626
+ object.config = () => process.env.XDG_CONFIG_HOME || path3.join(path3.join(osPaths.home() || osPaths.temp(), "Library"), "Preferences");
52627
+ object.data = () => process.env.XDG_DATA_HOME || path3.join(path3.join(osPaths.home() || osPaths.temp(), "Library"), "Application Support");
52620
52628
  object.runtime = () => process.env.XDG_RUNTIME_DIR || void 0;
52621
- object.state = () => process.env.XDG_STATE_HOME || path2.join(path2.join(osPaths.home() || osPaths.temp(), "Library"), "State");
52629
+ object.state = () => process.env.XDG_STATE_HOME || path3.join(path3.join(osPaths.home() || osPaths.temp(), "Library"), "State");
52622
52630
  return object;
52623
52631
  };
52624
52632
  var windows = () => {
52625
52633
  const object = {};
52626
52634
  object.cache = () => {
52627
- const localAppData = process.env.LOCALAPPDATA || path2.join(osPaths.home() || osPaths.temp(), "AppData", "Local");
52628
- return process.env.XDG_CACHE_HOME || path2.join(localAppData, "xdg.cache");
52635
+ const localAppData = process.env.LOCALAPPDATA || path3.join(osPaths.home() || osPaths.temp(), "AppData", "Local");
52636
+ return process.env.XDG_CACHE_HOME || path3.join(localAppData, "xdg.cache");
52629
52637
  };
52630
52638
  object.config = () => {
52631
- const appData = process.env.APPDATA || path2.join(osPaths.home() || osPaths.temp(), "AppData", "Roaming");
52632
- return process.env.XDG_CONFIG_HOME || path2.join(appData, "xdg.config");
52639
+ const appData = process.env.APPDATA || path3.join(osPaths.home() || osPaths.temp(), "AppData", "Roaming");
52640
+ return process.env.XDG_CONFIG_HOME || path3.join(appData, "xdg.config");
52633
52641
  };
52634
52642
  object.data = () => {
52635
- const appData = process.env.APPDATA || path2.join(osPaths.home() || osPaths.temp(), "AppData", "Roaming");
52636
- return process.env.XDG_DATA_HOME || path2.join(appData, "xdg.data");
52643
+ const appData = process.env.APPDATA || path3.join(osPaths.home() || osPaths.temp(), "AppData", "Roaming");
52644
+ return process.env.XDG_DATA_HOME || path3.join(appData, "xdg.data");
52637
52645
  };
52638
52646
  object.runtime = () => process.env.XDG_RUNTIME_DIR || void 0;
52639
52647
  object.state = () => {
52640
- const localAppData = process.env.LOCALAPPDATA || path2.join(osPaths.home() || osPaths.temp(), "AppData", "Local");
52641
- return process.env.XDG_STATE_HOME || path2.join(localAppData, "xdg.state");
52648
+ const localAppData = process.env.LOCALAPPDATA || path3.join(osPaths.home() || osPaths.temp(), "AppData", "Local");
52649
+ return process.env.XDG_STATE_HOME || path3.join(localAppData, "xdg.state");
52642
52650
  };
52643
52651
  return object;
52644
52652
  };
@@ -52658,7 +52666,7 @@ var require_lib6 = __commonJS({
52658
52666
  const dirs = [];
52659
52667
  dirs.push(extension.config());
52660
52668
  if (process.env.XDG_CONFIG_DIRS) {
52661
- dirs.push(...process.env.XDG_CONFIG_DIRS.split(path2.delimiter));
52669
+ dirs.push(...process.env.XDG_CONFIG_DIRS.split(path3.delimiter));
52662
52670
  }
52663
52671
  return dirs;
52664
52672
  };
@@ -52666,7 +52674,7 @@ var require_lib6 = __commonJS({
52666
52674
  const dirs = [];
52667
52675
  dirs.push(extension.data());
52668
52676
  if (process.env.XDG_DATA_DIRS) {
52669
- dirs.push(...process.env.XDG_DATA_DIRS.split(path2.delimiter));
52677
+ dirs.push(...process.env.XDG_DATA_DIRS.split(path3.delimiter));
52670
52678
  }
52671
52679
  return dirs;
52672
52680
  };
@@ -52683,7 +52691,7 @@ var require_lib6 = __commonJS({
52683
52691
  var require_lib7 = __commonJS({
52684
52692
  "../../node_modules/xdg-app-paths/src/lib/index.js"(exports2, module2) {
52685
52693
  "use strict";
52686
- var path2 = require("path");
52694
+ var path3 = require("path");
52687
52695
  var xdg = require_lib6();
52688
52696
  function normalizeOptions_(options, isolated) {
52689
52697
  if (!isObject(options)) {
@@ -52735,38 +52743,38 @@ var require_lib7 = __commonJS({
52735
52743
  throw new TypeError(`Expected string for "name" argument, got ${typeOf(name_)}`);
52736
52744
  }
52737
52745
  if (!name_) {
52738
- name_ = path2.parse(require.main && require.main.filename || process.execPath).name;
52746
+ name_ = path3.parse(require.main && require.main.filename || process.execPath).name;
52739
52747
  }
52740
52748
  name_ += suffix_ || "";
52741
52749
  XDGAppPaths.$name = () => name_;
52742
52750
  XDGAppPaths.$isolated = () => isolated_;
52743
52751
  XDGAppPaths.cache = (dirOptions = null) => {
52744
52752
  dirOptions = normalizeOptions_(dirOptions, isolated_);
52745
- return path2.join(xdg.cache(), dirOptions.isolated ? name_ : "");
52753
+ return path3.join(xdg.cache(), dirOptions.isolated ? name_ : "");
52746
52754
  };
52747
52755
  XDGAppPaths.config = function(dirOptions = null) {
52748
52756
  dirOptions = normalizeOptions_(dirOptions, isolated_);
52749
- return path2.join(xdg.config(), dirOptions.isolated ? name_ : "");
52757
+ return path3.join(xdg.config(), dirOptions.isolated ? name_ : "");
52750
52758
  };
52751
52759
  XDGAppPaths.data = function(dirOptions = null) {
52752
52760
  dirOptions = normalizeOptions_(dirOptions, isolated_);
52753
- return path2.join(xdg.data(), dirOptions.isolated ? name_ : "");
52761
+ return path3.join(xdg.data(), dirOptions.isolated ? name_ : "");
52754
52762
  };
52755
52763
  XDGAppPaths.runtime = function(dirOptions = null) {
52756
52764
  dirOptions = normalizeOptions_(dirOptions, isolated_);
52757
- return xdg.runtime() ? path2.join(xdg.runtime(), dirOptions.isolated ? name_ : "") : void 0;
52765
+ return xdg.runtime() ? path3.join(xdg.runtime(), dirOptions.isolated ? name_ : "") : void 0;
52758
52766
  };
52759
52767
  XDGAppPaths.state = function(dirOptions = null) {
52760
52768
  dirOptions = normalizeOptions_(dirOptions, isolated_);
52761
- return path2.join(xdg.state(), dirOptions.isolated ? name_ : "");
52769
+ return path3.join(xdg.state(), dirOptions.isolated ? name_ : "");
52762
52770
  };
52763
52771
  XDGAppPaths.configDirs = function(dirOptions = null) {
52764
52772
  dirOptions = normalizeOptions_(dirOptions, isolated_);
52765
- return xdg.configDirs().map((s) => path2.join(s, dirOptions.isolated ? name_ : ""));
52773
+ return xdg.configDirs().map((s) => path3.join(s, dirOptions.isolated ? name_ : ""));
52766
52774
  };
52767
52775
  XDGAppPaths.dataDirs = function(dirOptions = null) {
52768
52776
  dirOptions = normalizeOptions_(dirOptions, isolated_);
52769
- return xdg.dataDirs().map((s) => path2.join(s, dirOptions.isolated ? name_ : ""));
52777
+ return xdg.dataDirs().map((s) => path3.join(s, dirOptions.isolated ? name_ : ""));
52770
52778
  };
52771
52779
  this.fn = XDGAppPaths;
52772
52780
  }
@@ -53087,19 +53095,19 @@ var require_token_io = __commonJS({
53087
53095
  getUserDataDir: () => getUserDataDir
53088
53096
  });
53089
53097
  module2.exports = __toCommonJS(token_io_exports);
53090
- var import_path2 = __toESM2(require("path"));
53091
- var import_fs2 = __toESM2(require("fs"));
53092
- var import_os3 = __toESM2(require("os"));
53098
+ var import_path3 = __toESM2(require("path"));
53099
+ var import_fs3 = __toESM2(require("fs"));
53100
+ var import_os4 = __toESM2(require("os"));
53093
53101
  var import_token_error = require_token_error();
53094
53102
  function findRootDir() {
53095
53103
  try {
53096
53104
  let dir = process.cwd();
53097
- while (dir !== import_path2.default.dirname(dir)) {
53098
- const pkgPath = import_path2.default.join(dir, ".vercel");
53099
- if (import_fs2.default.existsSync(pkgPath)) {
53105
+ while (dir !== import_path3.default.dirname(dir)) {
53106
+ const pkgPath = import_path3.default.join(dir, ".vercel");
53107
+ if (import_fs3.default.existsSync(pkgPath)) {
53100
53108
  return dir;
53101
53109
  }
53102
- dir = import_path2.default.dirname(dir);
53110
+ dir = import_path3.default.dirname(dir);
53103
53111
  }
53104
53112
  } catch (_e) {
53105
53113
  throw new import_token_error.VercelOidcTokenError(
@@ -53112,11 +53120,11 @@ var require_token_io = __commonJS({
53112
53120
  if (process.env.XDG_DATA_HOME) {
53113
53121
  return process.env.XDG_DATA_HOME;
53114
53122
  }
53115
- switch (import_os3.default.platform()) {
53123
+ switch (import_os4.default.platform()) {
53116
53124
  case "darwin":
53117
- return import_path2.default.join(import_os3.default.homedir(), "Library/Application Support");
53125
+ return import_path3.default.join(import_os4.default.homedir(), "Library/Application Support");
53118
53126
  case "linux":
53119
- return import_path2.default.join(import_os3.default.homedir(), ".local/share");
53127
+ return import_path3.default.join(import_os4.default.homedir(), ".local/share");
53120
53128
  case "win32":
53121
53129
  if (process.env.LOCALAPPDATA) {
53122
53130
  return process.env.LOCALAPPDATA;
@@ -53156,10 +53164,10 @@ var require_oauth = __commonJS({
53156
53164
  refreshTokenRequest: () => refreshTokenRequest
53157
53165
  });
53158
53166
  module2.exports = __toCommonJS(oauth_exports);
53159
- var import_os3 = require("os");
53167
+ var import_os4 = require("os");
53160
53168
  var VERCEL_ISSUER = "https://vercel.com";
53161
53169
  var VERCEL_CLI_CLIENT_ID = "cl_HYyOPBNtFMfHhaUn9L4QPfTZz6TP47bp";
53162
- var userAgent = `@vercel/oidc node-${process.version} ${(0, import_os3.platform)()} (${(0, import_os3.arch)()}) ${(0, import_os3.hostname)()}`;
53170
+ var userAgent = `@vercel/oidc node-${process.version} ${(0, import_os4.platform)()} (${(0, import_os4.arch)()}) ${(0, import_os4.hostname)()}`;
53163
53171
  var _tokenEndpoint = null;
53164
53172
  async function getTokenEndpoint() {
53165
53173
  if (_tokenEndpoint) {
@@ -53309,8 +53317,8 @@ var require_token_util = __commonJS({
53309
53317
  saveToken: () => saveToken
53310
53318
  });
53311
53319
  module2.exports = __toCommonJS(token_util_exports);
53312
- var path2 = __toESM2(require("path"));
53313
- var fs2 = __toESM2(require("fs"));
53320
+ var path3 = __toESM2(require("path"));
53321
+ var fs3 = __toESM2(require("fs"));
53314
53322
  var import_cli_exec = require_dist2();
53315
53323
  var import_cli_config = require_dist3();
53316
53324
  var import_token_error = require_token_error();
@@ -53434,13 +53442,13 @@ ${stderr}`.trim();
53434
53442
  "Unable to find project root directory. Have you linked your project with `vc link?`"
53435
53443
  );
53436
53444
  }
53437
- const prjPath = path2.join(dir, ".vercel", "project.json");
53438
- if (!fs2.existsSync(prjPath)) {
53445
+ const prjPath = path3.join(dir, ".vercel", "project.json");
53446
+ if (!fs3.existsSync(prjPath)) {
53439
53447
  throw new import_token_error.VercelOidcTokenError(
53440
53448
  "project.json not found, have you linked your project with `vc link?`"
53441
53449
  );
53442
53450
  }
53443
- const prj = JSON.parse(fs2.readFileSync(prjPath, "utf8"));
53451
+ const prj = JSON.parse(fs3.readFileSync(prjPath, "utf8"));
53444
53452
  if (typeof prj.projectId !== "string" && typeof prj.orgId !== "string") {
53445
53453
  throw new TypeError(
53446
53454
  "Expected a string-valued projectId property. Try running `vc link` to re-link your project."
@@ -53455,11 +53463,11 @@ ${stderr}`.trim();
53455
53463
  "Unable to find user data directory. Please reach out to Vercel support."
53456
53464
  );
53457
53465
  }
53458
- const tokenPath = path2.join(dir, "com.vercel.token", `${projectId}.json`);
53466
+ const tokenPath = path3.join(dir, "com.vercel.token", `${projectId}.json`);
53459
53467
  const tokenJson = JSON.stringify(token);
53460
- fs2.mkdirSync(path2.dirname(tokenPath), { mode: 504, recursive: true });
53461
- fs2.writeFileSync(tokenPath, tokenJson);
53462
- fs2.chmodSync(tokenPath, 432);
53468
+ fs3.mkdirSync(path3.dirname(tokenPath), { mode: 504, recursive: true });
53469
+ fs3.writeFileSync(tokenPath, tokenJson);
53470
+ fs3.chmodSync(tokenPath, 432);
53463
53471
  return;
53464
53472
  }
53465
53473
  function loadToken(projectId) {
@@ -53469,11 +53477,11 @@ ${stderr}`.trim();
53469
53477
  "Unable to find user data directory. Please reach out to Vercel support."
53470
53478
  );
53471
53479
  }
53472
- const tokenPath = path2.join(dir, "com.vercel.token", `${projectId}.json`);
53473
- if (!fs2.existsSync(tokenPath)) {
53480
+ const tokenPath = path3.join(dir, "com.vercel.token", `${projectId}.json`);
53481
+ if (!fs3.existsSync(tokenPath)) {
53474
53482
  return null;
53475
53483
  }
53476
- const token = JSON.parse(fs2.readFileSync(tokenPath, "utf8"));
53484
+ const token = JSON.parse(fs3.readFileSync(tokenPath, "utf8"));
53477
53485
  assertVercelOidcTokenResponse(token);
53478
53486
  return token;
53479
53487
  }
@@ -59293,14 +59301,14 @@ var require_util2 = __commonJS({
59293
59301
  }
59294
59302
  const port = url.port != null ? url.port : url.protocol === "https:" ? 443 : 80;
59295
59303
  let origin = url.origin != null ? url.origin : `${url.protocol || ""}//${url.hostname || ""}:${port}`;
59296
- let path2 = url.path != null ? url.path : `${url.pathname || ""}${url.search || ""}`;
59304
+ let path3 = url.path != null ? url.path : `${url.pathname || ""}${url.search || ""}`;
59297
59305
  if (origin[origin.length - 1] === "/") {
59298
59306
  origin = origin.slice(0, origin.length - 1);
59299
59307
  }
59300
- if (path2 && path2[0] !== "/") {
59301
- path2 = `/${path2}`;
59308
+ if (path3 && path3[0] !== "/") {
59309
+ path3 = `/${path3}`;
59302
59310
  }
59303
- return new URL(`${origin}${path2}`);
59311
+ return new URL(`${origin}${path3}`);
59304
59312
  }
59305
59313
  if (!isHttpOrHttpsPrefixed(url.origin || url.protocol)) {
59306
59314
  throw new InvalidArgumentError("Invalid URL protocol: the URL must start with `http:` or `https:`.");
@@ -59751,39 +59759,39 @@ var require_diagnostics = __commonJS({
59751
59759
  });
59752
59760
  diagnosticsChannel.channel("undici:client:sendHeaders").subscribe((evt) => {
59753
59761
  const {
59754
- request: { method, path: path2, origin }
59762
+ request: { method, path: path3, origin }
59755
59763
  } = evt;
59756
- debuglog("sending request to %s %s/%s", method, origin, path2);
59764
+ debuglog("sending request to %s %s/%s", method, origin, path3);
59757
59765
  });
59758
59766
  diagnosticsChannel.channel("undici:request:headers").subscribe((evt) => {
59759
59767
  const {
59760
- request: { method, path: path2, origin },
59768
+ request: { method, path: path3, origin },
59761
59769
  response: { statusCode }
59762
59770
  } = evt;
59763
59771
  debuglog(
59764
59772
  "received response to %s %s/%s - HTTP %d",
59765
59773
  method,
59766
59774
  origin,
59767
- path2,
59775
+ path3,
59768
59776
  statusCode
59769
59777
  );
59770
59778
  });
59771
59779
  diagnosticsChannel.channel("undici:request:trailers").subscribe((evt) => {
59772
59780
  const {
59773
- request: { method, path: path2, origin }
59781
+ request: { method, path: path3, origin }
59774
59782
  } = evt;
59775
- debuglog("trailers received from %s %s/%s", method, origin, path2);
59783
+ debuglog("trailers received from %s %s/%s", method, origin, path3);
59776
59784
  });
59777
59785
  diagnosticsChannel.channel("undici:request:error").subscribe((evt) => {
59778
59786
  const {
59779
- request: { method, path: path2, origin },
59787
+ request: { method, path: path3, origin },
59780
59788
  error
59781
59789
  } = evt;
59782
59790
  debuglog(
59783
59791
  "request to %s %s/%s errored - %s",
59784
59792
  method,
59785
59793
  origin,
59786
- path2,
59794
+ path3,
59787
59795
  error.message
59788
59796
  );
59789
59797
  });
@@ -59832,9 +59840,9 @@ var require_diagnostics = __commonJS({
59832
59840
  });
59833
59841
  diagnosticsChannel.channel("undici:client:sendHeaders").subscribe((evt) => {
59834
59842
  const {
59835
- request: { method, path: path2, origin }
59843
+ request: { method, path: path3, origin }
59836
59844
  } = evt;
59837
- debuglog("sending request to %s %s/%s", method, origin, path2);
59845
+ debuglog("sending request to %s %s/%s", method, origin, path3);
59838
59846
  });
59839
59847
  }
59840
59848
  diagnosticsChannel.channel("undici:websocket:open").subscribe((evt) => {
@@ -59897,7 +59905,7 @@ var require_request = __commonJS({
59897
59905
  var kHandler = Symbol("handler");
59898
59906
  var Request2 = class {
59899
59907
  constructor(origin, {
59900
- path: path2,
59908
+ path: path3,
59901
59909
  method,
59902
59910
  body,
59903
59911
  headers,
@@ -59912,11 +59920,11 @@ var require_request = __commonJS({
59912
59920
  expectContinue,
59913
59921
  servername
59914
59922
  }, handler) {
59915
- if (typeof path2 !== "string") {
59923
+ if (typeof path3 !== "string") {
59916
59924
  throw new InvalidArgumentError("path must be a string");
59917
- } else if (path2[0] !== "/" && !(path2.startsWith("http://") || path2.startsWith("https://")) && method !== "CONNECT") {
59925
+ } else if (path3[0] !== "/" && !(path3.startsWith("http://") || path3.startsWith("https://")) && method !== "CONNECT") {
59918
59926
  throw new InvalidArgumentError("path must be an absolute URL or start with a slash");
59919
- } else if (invalidPathRegex.test(path2)) {
59927
+ } else if (invalidPathRegex.test(path3)) {
59920
59928
  throw new InvalidArgumentError("invalid request path");
59921
59929
  }
59922
59930
  if (typeof method !== "string") {
@@ -59982,7 +59990,7 @@ var require_request = __commonJS({
59982
59990
  this.completed = false;
59983
59991
  this.aborted = false;
59984
59992
  this.upgrade = upgrade || null;
59985
- this.path = query ? buildURL(path2, query) : path2;
59993
+ this.path = query ? buildURL(path3, query) : path3;
59986
59994
  this.origin = origin;
59987
59995
  this.idempotent = idempotent == null ? method === "HEAD" || method === "GET" : idempotent;
59988
59996
  this.blocking = blocking == null ? false : blocking;
@@ -64604,7 +64612,7 @@ var require_client_h1 = __commonJS({
64604
64612
  return method !== "GET" && method !== "HEAD" && method !== "OPTIONS" && method !== "TRACE" && method !== "CONNECT";
64605
64613
  }
64606
64614
  function writeH1(client, request) {
64607
- const { method, path: path2, host, upgrade, blocking, reset } = request;
64615
+ const { method, path: path3, host, upgrade, blocking, reset } = request;
64608
64616
  let { body, headers, contentLength } = request;
64609
64617
  const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH" || method === "QUERY" || method === "PROPFIND" || method === "PROPPATCH";
64610
64618
  if (util.isFormDataLike(body)) {
@@ -64671,7 +64679,7 @@ var require_client_h1 = __commonJS({
64671
64679
  if (blocking) {
64672
64680
  socket[kBlocking] = true;
64673
64681
  }
64674
- let header = `${method} ${path2} HTTP/1.1\r
64682
+ let header = `${method} ${path3} HTTP/1.1\r
64675
64683
  `;
64676
64684
  if (typeof host === "string") {
64677
64685
  header += `host: ${host}\r
@@ -65197,7 +65205,7 @@ var require_client_h2 = __commonJS({
65197
65205
  }
65198
65206
  function writeH2(client, request) {
65199
65207
  const session = client[kHTTP2Session];
65200
- const { method, path: path2, host, upgrade, expectContinue, signal, headers: reqHeaders } = request;
65208
+ const { method, path: path3, host, upgrade, expectContinue, signal, headers: reqHeaders } = request;
65201
65209
  let { body } = request;
65202
65210
  if (upgrade) {
65203
65211
  util.errorRequest(client, request, new Error("Upgrade not supported for H2"));
@@ -65264,7 +65272,7 @@ var require_client_h2 = __commonJS({
65264
65272
  });
65265
65273
  return true;
65266
65274
  }
65267
- headers[HTTP2_HEADER_PATH] = path2;
65275
+ headers[HTTP2_HEADER_PATH] = path3;
65268
65276
  headers[HTTP2_HEADER_SCHEME] = "https";
65269
65277
  const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH";
65270
65278
  if (body && typeof body.read === "function") {
@@ -65617,9 +65625,9 @@ var require_redirect_handler = __commonJS({
65617
65625
  return this.handler.onHeaders(statusCode, headers, resume, statusText);
65618
65626
  }
65619
65627
  const { origin, pathname, search } = util.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin)));
65620
- const path2 = search ? `${pathname}${search}` : pathname;
65628
+ const path3 = search ? `${pathname}${search}` : pathname;
65621
65629
  this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin);
65622
- this.opts.path = path2;
65630
+ this.opts.path = path3;
65623
65631
  this.opts.origin = origin;
65624
65632
  this.opts.maxRedirections = 0;
65625
65633
  this.opts.query = null;
@@ -66854,10 +66862,10 @@ var require_proxy_agent = __commonJS({
66854
66862
  };
66855
66863
  const {
66856
66864
  origin,
66857
- path: path2 = "/",
66865
+ path: path3 = "/",
66858
66866
  headers = {}
66859
66867
  } = opts;
66860
- opts.path = origin + path2;
66868
+ opts.path = origin + path3;
66861
66869
  if (!("host" in headers) && !("Host" in headers)) {
66862
66870
  const { host } = new URL2(origin);
66863
66871
  headers.host = host;
@@ -68778,20 +68786,20 @@ var require_mock_utils = __commonJS({
68778
68786
  }
68779
68787
  return true;
68780
68788
  }
68781
- function safeUrl(path2) {
68782
- if (typeof path2 !== "string") {
68783
- return path2;
68789
+ function safeUrl(path3) {
68790
+ if (typeof path3 !== "string") {
68791
+ return path3;
68784
68792
  }
68785
- const pathSegments = path2.split("?");
68793
+ const pathSegments = path3.split("?");
68786
68794
  if (pathSegments.length !== 2) {
68787
- return path2;
68795
+ return path3;
68788
68796
  }
68789
68797
  const qp = new URLSearchParams(pathSegments.pop());
68790
68798
  qp.sort();
68791
68799
  return [...pathSegments, qp.toString()].join("?");
68792
68800
  }
68793
- function matchKey(mockDispatch2, { path: path2, method, body, headers }) {
68794
- const pathMatch = matchValue(mockDispatch2.path, path2);
68801
+ function matchKey(mockDispatch2, { path: path3, method, body, headers }) {
68802
+ const pathMatch = matchValue(mockDispatch2.path, path3);
68795
68803
  const methodMatch = matchValue(mockDispatch2.method, method);
68796
68804
  const bodyMatch = typeof mockDispatch2.body !== "undefined" ? matchValue(mockDispatch2.body, body) : true;
68797
68805
  const headersMatch = matchHeaders(mockDispatch2, headers);
@@ -68813,7 +68821,7 @@ var require_mock_utils = __commonJS({
68813
68821
  function getMockDispatch(mockDispatches, key) {
68814
68822
  const basePath = key.query ? buildURL(key.path, key.query) : key.path;
68815
68823
  const resolvedPath = typeof basePath === "string" ? safeUrl(basePath) : basePath;
68816
- let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path2 }) => matchValue(safeUrl(path2), resolvedPath));
68824
+ let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path3 }) => matchValue(safeUrl(path3), resolvedPath));
68817
68825
  if (matchedMockDispatches.length === 0) {
68818
68826
  throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`);
68819
68827
  }
@@ -68851,9 +68859,9 @@ var require_mock_utils = __commonJS({
68851
68859
  }
68852
68860
  }
68853
68861
  function buildKey(opts) {
68854
- const { path: path2, method, body, headers, query } = opts;
68862
+ const { path: path3, method, body, headers, query } = opts;
68855
68863
  return {
68856
- path: path2,
68864
+ path: path3,
68857
68865
  method,
68858
68866
  body,
68859
68867
  headers,
@@ -69316,10 +69324,10 @@ var require_pending_interceptors_formatter = __commonJS({
69316
69324
  }
69317
69325
  format(pendingInterceptors) {
69318
69326
  const withPrettyHeaders = pendingInterceptors.map(
69319
- ({ method, path: path2, data: { statusCode }, persist: persist2, times, timesInvoked, origin }) => ({
69327
+ ({ method, path: path3, data: { statusCode }, persist: persist2, times, timesInvoked, origin }) => ({
69320
69328
  Method: method,
69321
69329
  Origin: origin,
69322
- Path: path2,
69330
+ Path: path3,
69323
69331
  "Status code": statusCode,
69324
69332
  Persistent: persist2 ? PERSISTENT : NOT_PERSISTENT,
69325
69333
  Invocations: timesInvoked,
@@ -74200,9 +74208,9 @@ var require_util7 = __commonJS({
74200
74208
  }
74201
74209
  }
74202
74210
  }
74203
- function validateCookiePath(path2) {
74204
- for (let i = 0; i < path2.length; ++i) {
74205
- const code = path2.charCodeAt(i);
74211
+ function validateCookiePath(path3) {
74212
+ for (let i = 0; i < path3.length; ++i) {
74213
+ const code = path3.charCodeAt(i);
74206
74214
  if (code < 32 || // exclude CTLs (0-31)
74207
74215
  code === 127 || // DEL
74208
74216
  code === 59) {
@@ -76895,11 +76903,11 @@ var require_undici = __commonJS({
76895
76903
  if (typeof opts.path !== "string") {
76896
76904
  throw new InvalidArgumentError("invalid opts.path");
76897
76905
  }
76898
- let path2 = opts.path;
76906
+ let path3 = opts.path;
76899
76907
  if (!opts.path.startsWith("/")) {
76900
- path2 = `/${path2}`;
76908
+ path3 = `/${path3}`;
76901
76909
  }
76902
- url = new URL(util.parseOrigin(url).origin + path2);
76910
+ url = new URL(util.parseOrigin(url).origin + path3);
76903
76911
  } else {
76904
76912
  if (!opts) {
76905
76913
  opts = typeof url === "object" ? url : {};
@@ -79478,8 +79486,8 @@ var require_builder = __commonJS({
79478
79486
  var axios_1 = __importDefault(require_axios());
79479
79487
  var runtime_1 = require_runtime();
79480
79488
  var llm_1 = require_llm();
79481
- var fs2 = __importStar(require("fs"));
79482
- var path2 = __importStar(require("path"));
79489
+ var fs3 = __importStar(require("fs"));
79490
+ var path3 = __importStar(require("path"));
79483
79491
  var models_1 = require_models();
79484
79492
  var cms_template_1 = require_cms_template();
79485
79493
  var cms_runtime_1 = require_cms_runtime();
@@ -79548,44 +79556,44 @@ var require_builder = __commonJS({
79548
79556
  return code.replace(pattern, "");
79549
79557
  }
79550
79558
  function snapshotDir(leadId) {
79551
- return path2.join((0, runtime_1.userDataDir)(), "data", "sites", String(leadId));
79559
+ return path3.join((0, runtime_1.userDataDir)(), "data", "sites", String(leadId));
79552
79560
  }
79553
79561
  function saveSnapshot(leadId, files) {
79554
79562
  const dir = snapshotDir(leadId);
79555
79563
  try {
79556
- fs2.mkdirSync(dir, { recursive: true });
79564
+ fs3.mkdirSync(dir, { recursive: true });
79557
79565
  for (const f of files) {
79558
- const target = path2.join(dir, f.file);
79559
- fs2.mkdirSync(path2.dirname(target), { recursive: true });
79566
+ const target = path3.join(dir, f.file);
79567
+ fs3.mkdirSync(path3.dirname(target), { recursive: true });
79560
79568
  if (f.encoding === "base64") {
79561
- fs2.writeFileSync(target, Buffer.from(f.data, "base64"));
79569
+ fs3.writeFileSync(target, Buffer.from(f.data, "base64"));
79562
79570
  } else {
79563
- fs2.writeFileSync(target, f.data, "utf-8");
79571
+ fs3.writeFileSync(target, f.data, "utf-8");
79564
79572
  }
79565
79573
  }
79566
- fs2.writeFileSync(path2.join(dir, ".snapshot.json"), JSON.stringify({ savedAt: Date.now() }));
79574
+ fs3.writeFileSync(path3.join(dir, ".snapshot.json"), JSON.stringify({ savedAt: Date.now() }));
79567
79575
  } catch {
79568
79576
  }
79569
79577
  }
79570
79578
  function loadSnapshot(leadId) {
79571
79579
  const dir = snapshotDir(leadId);
79572
- if (!fs2.existsSync(dir))
79580
+ if (!fs3.existsSync(dir))
79573
79581
  return null;
79574
79582
  const out = [];
79575
79583
  function walk(rel) {
79576
- const abs = path2.join(dir, rel);
79577
- const stat = fs2.statSync(abs);
79584
+ const abs = path3.join(dir, rel);
79585
+ const stat = fs3.statSync(abs);
79578
79586
  if (stat.isDirectory()) {
79579
- for (const child of fs2.readdirSync(abs)) {
79587
+ for (const child of fs3.readdirSync(abs)) {
79580
79588
  if (child.startsWith("."))
79581
79589
  continue;
79582
79590
  walk(rel ? `${rel}/${child}` : child);
79583
79591
  }
79584
79592
  } else if (stat.isFile()) {
79585
79593
  if (/\.(jpg|jpeg|png|gif|webp|avif)$/i.test(rel)) {
79586
- out.push({ file: rel, data: fs2.readFileSync(abs).toString("base64"), encoding: "base64" });
79594
+ out.push({ file: rel, data: fs3.readFileSync(abs).toString("base64"), encoding: "base64" });
79587
79595
  } else {
79588
- out.push({ file: rel, data: fs2.readFileSync(abs, "utf-8"), encoding: "utf-8" });
79596
+ out.push({ file: rel, data: fs3.readFileSync(abs, "utf-8"), encoding: "utf-8" });
79589
79597
  }
79590
79598
  }
79591
79599
  }
@@ -80767,7 +80775,7 @@ var require_chat_tools = __commonJS({
80767
80775
  "use strict";
80768
80776
  Object.defineProperty(exports2, "__esModule", { value: true });
80769
80777
  exports2.TOOLS = void 0;
80770
- exports2.runTool = runTool;
80778
+ exports2.runTool = runTool2;
80771
80779
  var db_1 = require_db();
80772
80780
  var runtime_1 = require_runtime();
80773
80781
  var builder_1 = require_builder();
@@ -81067,7 +81075,7 @@ Interested?`;
81067
81075
  }
81068
81076
  return `sms:${e164}?&body=${encodeURIComponent(message)}`;
81069
81077
  }
81070
- async function runTool(name, input, ctx) {
81078
+ async function runTool2(name, input, ctx) {
81071
81079
  const db2 = (0, db_1.getDb)();
81072
81080
  switch (name) {
81073
81081
  case "find_leads": {
@@ -82264,7 +82272,7 @@ var require_package = __commonJS({
82264
82272
  "package.json"(exports2, module2) {
82265
82273
  module2.exports = {
82266
82274
  name: "sproutkit-code",
82267
- version: "0.3.1",
82275
+ version: "0.5.0",
82268
82276
  description: "Sproutkit in your terminal \u2014 find leads, build sites, run outreach, all via chat.",
82269
82277
  bin: {
82270
82278
  sproutkit: "./dist/index.js"
@@ -82306,6 +82314,7 @@ var require_package = __commonJS({
82306
82314
  // src/engine.ts
82307
82315
  var db = require_db();
82308
82316
  var chat = require_chat();
82317
+ var chatTools = require_chat_tools();
82309
82318
  var autoMode = require_auto_mode();
82310
82319
  var cms = require_cms_provision();
82311
82320
  var bookingPreset = require_booking_preset();
@@ -82315,6 +82324,7 @@ var llm = require_llm();
82315
82324
  var initDatabase = db.initDatabase;
82316
82325
  var getDb = db.getDb;
82317
82326
  var chatWithTools = chat.chatWithTools;
82327
+ var runTool = chatTools.runTool;
82318
82328
  var startAutoJob = autoMode.startAutoJob;
82319
82329
  var provisionCmsForLead = cms.provisionCmsForLead;
82320
82330
  var generatePreset = bookingPreset.generatePreset;
@@ -82518,6 +82528,115 @@ var Status = class {
82518
82528
  else say(` ${mark} ${label}`);
82519
82529
  }
82520
82530
  };
82531
+ var STATE_MARK = {
82532
+ queued: () => c.dim("\xB7"),
82533
+ building: () => c.cyan(""),
82534
+ // spinner frame filled in at render time
82535
+ built: () => c.green("\u2713"),
82536
+ failed: () => c.red("\u2717"),
82537
+ skipped: () => c.dim("\u2013")
82538
+ };
82539
+ var StatusBoard = class {
82540
+ rows = [];
82541
+ frame = 0;
82542
+ timer = null;
82543
+ lastLineCount = 0;
82544
+ tty = process.stdout.isTTY && useColor;
82545
+ // Non-TTY: remember the last printed signature per row so we only log changes.
82546
+ lastSig = /* @__PURE__ */ new Map();
82547
+ header = "";
82548
+ start(header, rows) {
82549
+ this.header = header;
82550
+ this.rows = rows;
82551
+ if (!this.tty) {
82552
+ say(c.cyan(` \u27F3 ${header}`));
82553
+ this.rows.forEach((r) => this.logRowIfChanged(r));
82554
+ return;
82555
+ }
82556
+ say(c.cyan(` \u27F3 ${header}`));
82557
+ this.render();
82558
+ this.timer = setInterval(() => {
82559
+ this.frame = (this.frame + 1) % FRAMES.length;
82560
+ this.render();
82561
+ }, 90);
82562
+ }
82563
+ update(row) {
82564
+ const i = this.rows.findIndex((r) => r.key === row.key);
82565
+ if (i >= 0) this.rows[i] = row;
82566
+ else this.rows.push(row);
82567
+ if (!this.tty) this.logRowIfChanged(row);
82568
+ else this.render();
82569
+ }
82570
+ // Replace the whole set at once (e.g. from a job snapshot).
82571
+ set(rows) {
82572
+ this.rows = rows;
82573
+ if (!this.tty) rows.forEach((r) => this.logRowIfChanged(r));
82574
+ else this.render();
82575
+ }
82576
+ line(r) {
82577
+ const mark = r.state === "building" ? c.cyan(FRAMES[this.frame]) : STATE_MARK[r.state]();
82578
+ const detail = r.detail ? c.dim(` \xB7 ${r.detail}`) : "";
82579
+ return ` ${mark} ${r.label}${detail}`;
82580
+ }
82581
+ logRowIfChanged(r) {
82582
+ const sig = `${r.state}:${r.detail ?? ""}`;
82583
+ if (this.lastSig.get(r.key) === sig) return;
82584
+ this.lastSig.set(r.key, sig);
82585
+ const mark = r.state === "built" ? "\u2713" : r.state === "failed" ? "\u2717" : r.state === "skipped" ? "\u2013" : "\u2026";
82586
+ say(` ${mark} ${r.label}${r.detail ? ` \xB7 ${r.detail}` : ""}`);
82587
+ }
82588
+ render() {
82589
+ if (this.lastLineCount > 0) process.stdout.write(`\x1B[${this.lastLineCount}A`);
82590
+ const out = this.rows.map((r) => `\x1B[2K${this.line(r)}`).join("\n");
82591
+ process.stdout.write(out + "\n");
82592
+ this.lastLineCount = this.rows.length;
82593
+ }
82594
+ stop() {
82595
+ if (this.timer) {
82596
+ clearInterval(this.timer);
82597
+ this.timer = null;
82598
+ }
82599
+ if (this.tty) this.render();
82600
+ }
82601
+ };
82602
+
82603
+ // src/skill-install.ts
82604
+ var import_fs = __toESM(require("fs"));
82605
+ var import_path = __toESM(require("path"));
82606
+ var import_os2 = __toESM(require("os"));
82607
+ function bundledSkillDir() {
82608
+ const candidates = [
82609
+ import_path.default.join(__dirname, "skill"),
82610
+ import_path.default.join(__dirname, "..", "dist", "skill"),
82611
+ import_path.default.join(__dirname, "..", "skill")
82612
+ ];
82613
+ for (const c2 of candidates) {
82614
+ if (import_fs.default.existsSync(import_path.default.join(c2, "SKILL.md"))) return c2;
82615
+ }
82616
+ return candidates[0];
82617
+ }
82618
+ function skillTargetDir() {
82619
+ return import_path.default.join(import_os2.default.homedir(), ".claude", "skills", "sproutkit");
82620
+ }
82621
+ function skillInstalled() {
82622
+ return import_fs.default.existsSync(import_path.default.join(skillTargetDir(), "SKILL.md"));
82623
+ }
82624
+ function installSkill() {
82625
+ try {
82626
+ const src = bundledSkillDir();
82627
+ if (!import_fs.default.existsSync(import_path.default.join(src, "SKILL.md"))) {
82628
+ return { ok: false, error: `Skill source not found (looked in ${src}).` };
82629
+ }
82630
+ const dest = skillTargetDir();
82631
+ import_fs.default.mkdirSync(dest, { recursive: true });
82632
+ for (const f of import_fs.default.readdirSync(src)) {
82633
+ import_fs.default.copyFileSync(import_path.default.join(src, f), import_path.default.join(dest, f));
82634
+ }
82635
+ return { ok: true, path: dest };
82636
+ } catch (e) {
82637
+ return { ok: false, error: e.message };
82638
+ }
82639
+ }
82521
82640
 
82522
82641
  // src/onboarding.ts
82523
82642
  var import_child_process = require("child_process");
@@ -82571,8 +82690,35 @@ async function chooseBackend(force) {
82571
82690
  setBackend("claude_code");
82572
82691
  say(c.green(" \u2713 Using your Claude subscription \u2014 no API key needed for generation."));
82573
82692
  say();
82693
+ await offerSkillInstall(force);
82574
82694
  return "claude_code";
82575
82695
  }
82696
+ async function offerSkillInstall(force) {
82697
+ const already = skillInstalled();
82698
+ say(` ${c.bold("Conversational mode (optional)")}`);
82699
+ say(
82700
+ c.dim(
82701
+ " Install a Claude Code skill so you can just talk to `claude` \u2014 \u201Cfind barbers"
82702
+ )
82703
+ );
82704
+ say(c.dim(" in Leeds and build the best two\u201D \u2014 and it drives Sproutkit for you."));
82705
+ const prompt = already ? c.green(" Skill already installed \u2014 reinstall/update it? [y/N] ") : c.green(" Install it now? [Y/n] ");
82706
+ const ans = (await ask(prompt)).trim().toLowerCase();
82707
+ const wants = already ? ans === "y" || ans === "yes" : ans !== "n" && ans !== "no";
82708
+ if (!wants) {
82709
+ say(c.dim(" Skipped \u2014 you can add it later by re-running 'sproutkit setup'."));
82710
+ say();
82711
+ return;
82712
+ }
82713
+ const res = installSkill();
82714
+ if (res.ok) {
82715
+ say(c.green(` \u2713 Skill installed to ${res.path}`));
82716
+ say(c.dim(" Now run `claude` in any terminal and ask it to find or build leads."));
82717
+ } else {
82718
+ say(c.amber(` Couldn't install the skill: ${res.error}`));
82719
+ }
82720
+ say();
82721
+ }
82576
82722
  async function onboardLicense(force) {
82577
82723
  if (!force) {
82578
82724
  const state = await check();
@@ -82735,9 +82881,9 @@ function makeInvokeIpc(emit) {
82735
82881
  }
82736
82882
 
82737
82883
  // src/sync.ts
82738
- var import_os2 = __toESM(require("os"));
82739
- var import_path = __toESM(require("path"));
82740
- var import_fs = __toESM(require("fs"));
82884
+ var import_os3 = __toESM(require("os"));
82885
+ var import_path2 = __toESM(require("path"));
82886
+ var import_fs2 = __toESM(require("fs"));
82741
82887
  var COLS = [
82742
82888
  "place_id",
82743
82889
  "name",
@@ -82760,18 +82906,18 @@ var COLS = [
82760
82906
  "business_status"
82761
82907
  ];
82762
82908
  function desktopDbPath() {
82763
- const home = import_os2.default.homedir();
82909
+ const home = import_os3.default.homedir();
82764
82910
  const candidates = [];
82765
82911
  if (process.platform === "darwin") {
82766
- candidates.push(import_path.default.join(home, "Library", "Application Support", "Sproutkit", "data", "sproutio.db"));
82912
+ candidates.push(import_path2.default.join(home, "Library", "Application Support", "Sproutkit", "data", "sproutio.db"));
82767
82913
  } else if (process.platform === "win32") {
82768
- const appData = process.env.APPDATA || import_path.default.join(home, "AppData", "Roaming");
82769
- candidates.push(import_path.default.join(appData, "Sproutkit", "data", "sproutio.db"));
82914
+ const appData = process.env.APPDATA || import_path2.default.join(home, "AppData", "Roaming");
82915
+ candidates.push(import_path2.default.join(appData, "Sproutkit", "data", "sproutio.db"));
82770
82916
  } else {
82771
- const cfg = process.env.XDG_CONFIG_HOME || import_path.default.join(home, ".config");
82772
- candidates.push(import_path.default.join(cfg, "Sproutkit", "data", "sproutio.db"));
82917
+ const cfg = process.env.XDG_CONFIG_HOME || import_path2.default.join(home, ".config");
82918
+ candidates.push(import_path2.default.join(cfg, "Sproutkit", "data", "sproutio.db"));
82773
82919
  }
82774
- return candidates.find((p) => import_fs.default.existsSync(p)) ?? null;
82920
+ return candidates.find((p) => import_fs2.default.existsSync(p)) ?? null;
82775
82921
  }
82776
82922
  function syncToDesktop(opts = {}) {
82777
82923
  const dest = desktopDbPath();
@@ -83085,6 +83231,233 @@ async function runModels() {
83085
83231
  say(c.green(` \u2713 Now using ${models2[idx].display_name ?? models2[idx].id}.`));
83086
83232
  }
83087
83233
 
83234
+ // src/commands.ts
83235
+ function makeCtx(opts) {
83236
+ const emit = (channel, payload) => {
83237
+ if (opts.json) return;
83238
+ const p = payload;
83239
+ if (p?.msg && opts.status) opts.status.update(p.msg);
83240
+ };
83241
+ return {
83242
+ invokeIpc: makeInvokeIpc(emit),
83243
+ emitProgress: (e) => emit(e.channel, e.payload)
83244
+ };
83245
+ }
83246
+ function parseArgs(argv) {
83247
+ const flags = {};
83248
+ const rest = [];
83249
+ for (let i = 0; i < argv.length; i++) {
83250
+ const a = argv[i];
83251
+ if (a.startsWith("--")) {
83252
+ const body = a.slice(2);
83253
+ const eq = body.indexOf("=");
83254
+ if (eq >= 0) {
83255
+ flags[body.slice(0, eq)] = body.slice(eq + 1);
83256
+ } else if (i + 1 < argv.length && !argv[i + 1].startsWith("--")) {
83257
+ flags[body] = argv[++i];
83258
+ } else {
83259
+ flags[body] = true;
83260
+ }
83261
+ } else {
83262
+ rest.push(a);
83263
+ }
83264
+ }
83265
+ return { flags, rest };
83266
+ }
83267
+ function emitJson(v) {
83268
+ process.stdout.write(JSON.stringify(v, null, 2) + "\n");
83269
+ }
83270
+ async function cmdFind(argv) {
83271
+ const { flags, rest } = parseArgs(argv);
83272
+ const json = !!flags.json;
83273
+ const location = String(flags.location ?? rest.join(" ")).trim();
83274
+ if (!location) {
83275
+ const err = 'Usage: sproutkit find "<location>" --categories "barber shop,cafe"';
83276
+ json ? emitJson({ ok: false, error: err }) : say(c.red(" " + err));
83277
+ return;
83278
+ }
83279
+ const categories = String(flags.categories ?? "").split(",").map((s) => s.trim()).filter(Boolean);
83280
+ const status = json ? void 0 : new Status();
83281
+ if (status) status.start(`Finding leads in ${location}`);
83282
+ try {
83283
+ const result = await runTool(
83284
+ "find_leads",
83285
+ {
83286
+ location,
83287
+ categories: categories.length ? categories : [location],
83288
+ maxResults: flags.max ? Number(flags.max) : void 0,
83289
+ radiusMeters: flags.radius ? Number(flags.radius) : void 0
83290
+ },
83291
+ makeCtx({ json, status })
83292
+ );
83293
+ if (status) status.done(true, `Found ${result.found ?? 0}, saved ${result.saved ?? 0} new`);
83294
+ autoSync();
83295
+ if (json) emitJson(result);
83296
+ else if (result.note) say(c.dim(" " + result.note));
83297
+ } catch (e) {
83298
+ if (status) status.done(false, "Find failed");
83299
+ json ? emitJson({ ok: false, error: e.message }) : say(c.red(" " + e.message));
83300
+ process.exitCode = 1;
83301
+ }
83302
+ }
83303
+ async function cmdList(argv) {
83304
+ const { flags } = parseArgs(argv);
83305
+ const json = !!flags.json;
83306
+ const rows = await runTool(
83307
+ "list_leads",
83308
+ {
83309
+ status: flags.status ? String(flags.status) : void 0,
83310
+ city: flags.city ? String(flags.city) : void 0,
83311
+ limit: flags.limit ? Number(flags.limit) : void 0
83312
+ },
83313
+ makeCtx({ json })
83314
+ );
83315
+ if (json) {
83316
+ emitJson(rows);
83317
+ return;
83318
+ }
83319
+ if (rows.length === 0) {
83320
+ say(c.dim(' No leads yet. Try: sproutkit find "barbers in <area>"'));
83321
+ return;
83322
+ }
83323
+ say();
83324
+ for (const r of rows) {
83325
+ const site = r.site_url ? c.dim(` ${r.site_url}`) : "";
83326
+ say(` ${c.greenBold("#" + r.id)} ${c.bold(r.name)} ${c.dim(`\xB7 ${r.status} \xB7 ${r.type}, ${r.city}`)}${site}`);
83327
+ }
83328
+ say();
83329
+ }
83330
+ async function cmdBuild(argv) {
83331
+ const { flags, rest } = parseArgs(argv);
83332
+ const json = !!flags.json;
83333
+ const id = Number(flags.id ?? rest[0]);
83334
+ if (!id || Number.isNaN(id)) {
83335
+ const err = 'Usage: sproutkit build <leadId> [--instructions "..."] [--cms]';
83336
+ json ? emitJson({ ok: false, error: err }) : say(c.red(" " + err));
83337
+ process.exitCode = 1;
83338
+ return;
83339
+ }
83340
+ const status = json ? void 0 : new Status();
83341
+ if (status) status.start(`Building website for lead #${id}`);
83342
+ try {
83343
+ const result = await runTool(
83344
+ "build_site",
83345
+ {
83346
+ id,
83347
+ instructions: flags.instructions ? String(flags.instructions) : void 0,
83348
+ includeCms: !!flags.cms
83349
+ },
83350
+ makeCtx({ json, status })
83351
+ );
83352
+ if (result && result.ok === false) {
83353
+ if (status) status.done(false, result.error ?? "Build failed");
83354
+ if (json) emitJson(result);
83355
+ process.exitCode = 1;
83356
+ return;
83357
+ }
83358
+ if (status) status.done(true, result.url ? `Live at ${result.url}` : `Built lead #${id}`);
83359
+ autoSync();
83360
+ if (json) emitJson(result);
83361
+ } catch (e) {
83362
+ if (status) status.done(false, "Build failed");
83363
+ json ? emitJson({ ok: false, error: e.message }) : say(c.red(" " + e.message));
83364
+ process.exitCode = 1;
83365
+ }
83366
+ }
83367
+ async function cmdOutreach(argv) {
83368
+ const { flags } = parseArgs(argv);
83369
+ const json = !!flags.json;
83370
+ const ids = String(flags.ids ?? "").split(",").map((s) => Number(s.trim())).filter((n) => !Number.isNaN(n) && n > 0);
83371
+ const result = await runTool(
83372
+ "prepare_outreach",
83373
+ { ids: ids.length ? ids : void 0 },
83374
+ makeCtx({ json })
83375
+ );
83376
+ if (json) {
83377
+ emitJson(result);
83378
+ if (!result.ok) process.exitCode = 1;
83379
+ return;
83380
+ }
83381
+ if (!result.ok) {
83382
+ say(c.red(" " + (result.error ?? "Nothing to send.")));
83383
+ process.exitCode = 1;
83384
+ return;
83385
+ }
83386
+ autoSync();
83387
+ say();
83388
+ say(c.green(` ${result.count} lead${result.count === 1 ? "" : "s"} moved to Contacted (${result.channel}).`));
83389
+ for (const o of result.outreach ?? []) {
83390
+ if (o.url) say(` ${c.greenBold("#" + o.id)} ${c.bold(o.name)} \u2014 open: ${c.dim(o.url)}`);
83391
+ else say(` ${c.greenBold("#" + o.id)} ${c.bold(o.name)} \u2014 ${c.amber("no phone on file")}`);
83392
+ }
83393
+ if (result.noPhone) say(c.dim(` ${result.noPhone} had no phone number and were skipped for messaging.`));
83394
+ say();
83395
+ }
83396
+ async function cmdBuildAll(argv) {
83397
+ const { flags } = parseArgs(argv);
83398
+ const json = !!flags.json;
83399
+ const ids = String(flags.ids ?? "").split(",").map((s) => Number(s.trim())).filter((n) => !Number.isNaN(n) && n > 0);
83400
+ const leadIds = ids.length ? ids : (await runTool("list_leads", { limit: 100 }, makeCtx({ json }))).filter((l) => !l.site_url).map((l) => l.id);
83401
+ if (leadIds.length === 0) {
83402
+ const msg = "No unbuilt leads to build. Find some first, or pass --ids.";
83403
+ json ? emitJson({ ok: false, error: msg }) : say(c.amber(" " + msg));
83404
+ return;
83405
+ }
83406
+ const anthropicKey = getSetting("anthropic_key");
83407
+ const vercelToken = getSetting("vercel_token");
83408
+ if (!vercelToken) {
83409
+ const msg = "Vercel token not set. Run 'sproutkit setup'.";
83410
+ json ? emitJson({ ok: false, error: msg }) : say(c.red(" " + msg));
83411
+ process.exitCode = 1;
83412
+ return;
83413
+ }
83414
+ if (getBackend() === "api" && !anthropicKey) {
83415
+ const msg = "Anthropic API key not set. Run 'sproutkit setup'.";
83416
+ json ? emitJson({ ok: false, error: msg }) : say(c.red(" " + msg));
83417
+ process.exitCode = 1;
83418
+ return;
83419
+ }
83420
+ const concurrency = Math.min(Math.max(Number(flags.concurrency ?? 3), 1), 4);
83421
+ const board = json ? null : new StatusBoard();
83422
+ const stateToRow = (l) => ({
83423
+ key: l.leadId,
83424
+ label: `#${l.leadId} ${l.name}`,
83425
+ state: l.status,
83426
+ detail: l.status === "built" ? l.siteUrl : l.status === "failed" ? l.error : l.message
83427
+ });
83428
+ await new Promise((resolve) => {
83429
+ const emit = (channel, payload) => {
83430
+ const snap2 = payload;
83431
+ if (channel === "auto:progress" && board) board.set(snap2.leads.map(stateToRow));
83432
+ if (channel === "auto:done") {
83433
+ if (board) {
83434
+ board.set(snap2.leads.map(stateToRow));
83435
+ board.stop();
83436
+ }
83437
+ if (json) emitJson(snap2);
83438
+ else {
83439
+ say();
83440
+ say(
83441
+ c.green(` Done \u2014 ${snap2.completed} built`) + (snap2.failed ? c.red(`, ${snap2.failed} failed`) : "") + c.dim(` (concurrency ${snap2.concurrency}).`)
83442
+ );
83443
+ say();
83444
+ }
83445
+ autoSync();
83446
+ resolve();
83447
+ }
83448
+ };
83449
+ const snap = startAutoJob({
83450
+ leadIds,
83451
+ concurrency,
83452
+ anthropicKey: anthropicKey ?? "",
83453
+ vercelToken,
83454
+ placesKey: getSetting("places_key"),
83455
+ emit
83456
+ });
83457
+ if (board) board.start(`Building ${leadIds.length} sites (up to ${concurrency} at once)`, snap.leads.map(stateToRow));
83458
+ });
83459
+ }
83460
+
83088
83461
  // src/index.ts
83089
83462
  process.env.SPROUTKIT_HEADLESS = "1";
83090
83463
  async function main() {
@@ -83119,19 +83492,44 @@ async function main() {
83119
83492
  closeTty();
83120
83493
  return;
83121
83494
  }
83495
+ if (arg === "find" || arg === "list" || arg === "build" || arg === "build-all" || arg === "outreach") {
83496
+ const subArgs = process.argv.slice(3);
83497
+ const lic2 = await check();
83498
+ if (lic2.status !== "active") {
83499
+ const msg = lic2.status === "offline_grace_expired" ? "Licence check offline and grace expired \u2014 reconnect and retry." : "No active licence. Run 'sproutkit setup' first.";
83500
+ if (subArgs.includes("--json")) process.stdout.write(JSON.stringify({ ok: false, error: msg }) + "\n");
83501
+ else say(c.red(` ${msg}`));
83502
+ closeTty();
83503
+ process.exitCode = 1;
83504
+ return;
83505
+ }
83506
+ if (arg === "find") await cmdFind(subArgs);
83507
+ else if (arg === "list") await cmdList(subArgs);
83508
+ else if (arg === "build") await cmdBuild(subArgs);
83509
+ else if (arg === "build-all") await cmdBuildAll(subArgs);
83510
+ else await cmdOutreach(subArgs);
83511
+ closeTty();
83512
+ return;
83513
+ }
83122
83514
  if (arg === "--help" || arg === "-h") {
83123
83515
  say();
83124
83516
  say(c.greenBold(" Sproutkit Code"));
83125
83517
  say(" Find leads, build sites and run outreach from your terminal.");
83126
83518
  say();
83127
- say(` ${c.bold("sproutkit")} start the chat`);
83128
- say(` ${c.bold("sproutkit setup")} set or update your keys and licence`);
83129
- say(` ${c.bold("sproutkit models")} list Claude models and pick one`);
83130
- say(` ${c.bold("sproutkit sync")} push your leads into the desktop app`);
83131
- say(` ${c.bold("sproutkit update")} update to the latest version`);
83132
- say(` ${c.bold("sproutkit version")} show the installed version`);
83133
- say(` ${c.bold('sproutkit "..."')} run a single message and exit`);
83519
+ say(` ${c.bold("sproutkit")} start the chat`);
83520
+ say(` ${c.bold('sproutkit find "<area>"')} find leads (--categories "barber shop,cafe")`);
83521
+ say(` ${c.bold("sproutkit list")} list leads (--status, --city, --json)`);
83522
+ say(` ${c.bold("sproutkit build <id>")} build a website (--instructions, --cms)`);
83523
+ say(` ${c.bold("sproutkit build-all")} build many at once (--ids, --concurrency 3)`);
83524
+ say(` ${c.bold("sproutkit outreach")} prep outreach links (--ids 3,5)`);
83525
+ say(` ${c.bold("sproutkit setup")} set or update keys, licence, backend`);
83526
+ say(` ${c.bold("sproutkit models")} list Claude models and pick one`);
83527
+ say(` ${c.bold("sproutkit sync")} push your leads into the desktop app`);
83528
+ say(` ${c.bold("sproutkit update")} update to the latest version`);
83529
+ say(` ${c.bold("sproutkit version")} show the installed version`);
83530
+ say(` ${c.bold('sproutkit "..."')} run a single message and exit`);
83134
83531
  say();
83532
+ say(c.dim(" Add --json to find/list/build/outreach for machine-readable output."));
83135
83533
  say(c.dim(" In chat: type a request, Ctrl+C to quit. Actions that spend money ask y/N first."));
83136
83534
  say();
83137
83535
  closeTty();