sproutkit-code 0.1.2 → 0.1.3
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 +353 -250
- 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
|
|
33
|
-
var
|
|
34
|
-
var pathFile =
|
|
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 (
|
|
38
|
-
executablePath =
|
|
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
|
|
41
|
+
return path2.join(process.env.ELECTRON_OVERRIDE_DIST_PATH, executablePath || "electron");
|
|
42
42
|
}
|
|
43
43
|
if (executablePath) {
|
|
44
|
-
return
|
|
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
|
|
986
|
-
if (
|
|
985
|
+
const path2 = url.path;
|
|
986
|
+
if (path2.length === 0) {
|
|
987
987
|
return;
|
|
988
988
|
}
|
|
989
|
-
if (url.scheme === "file" &&
|
|
989
|
+
if (url.scheme === "file" && path2.length === 1 && isNormalizedWindowsDriveLetter(path2[0])) {
|
|
990
990
|
return;
|
|
991
991
|
}
|
|
992
|
-
|
|
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(
|
|
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(
|
|
10844
|
-
const stats = (0, fs_1.statSync)(
|
|
10845
|
-
return createFileFromPath(
|
|
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(
|
|
10849
|
-
const stats = await fs_1.promises.stat(
|
|
10850
|
-
return createFileFromPath(
|
|
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(
|
|
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(
|
|
10905
|
+
console.warn(`fileFromPath is deprecated; use fs.createReadStream(${JSON.stringify(path2)}) instead`);
|
|
10906
10906
|
fileFromPathWarned = true;
|
|
10907
10907
|
}
|
|
10908
|
-
return await _fileFromPath(
|
|
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(
|
|
11674
|
-
return this.methodRequest("get",
|
|
11673
|
+
get(path2, opts) {
|
|
11674
|
+
return this.methodRequest("get", path2, opts);
|
|
11675
11675
|
}
|
|
11676
|
-
post(
|
|
11677
|
-
return this.methodRequest("post",
|
|
11676
|
+
post(path2, opts) {
|
|
11677
|
+
return this.methodRequest("post", path2, opts);
|
|
11678
11678
|
}
|
|
11679
|
-
patch(
|
|
11680
|
-
return this.methodRequest("patch",
|
|
11679
|
+
patch(path2, opts) {
|
|
11680
|
+
return this.methodRequest("patch", path2, opts);
|
|
11681
11681
|
}
|
|
11682
|
-
put(
|
|
11683
|
-
return this.methodRequest("put",
|
|
11682
|
+
put(path2, opts) {
|
|
11683
|
+
return this.methodRequest("put", path2, opts);
|
|
11684
11684
|
}
|
|
11685
|
-
delete(
|
|
11686
|
-
return this.methodRequest("delete",
|
|
11685
|
+
delete(path2, opts) {
|
|
11686
|
+
return this.methodRequest("delete", path2, opts);
|
|
11687
11687
|
}
|
|
11688
|
-
methodRequest(method,
|
|
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(
|
|
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(
|
|
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(
|
|
11830
|
-
const url = isAbsoluteURL(
|
|
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(
|
|
23168
|
-
if (!
|
|
23167
|
+
function lookup(path2) {
|
|
23168
|
+
if (!path2 || typeof path2 !== "string") {
|
|
23169
23169
|
return false;
|
|
23170
23170
|
}
|
|
23171
|
-
var extension2 = extname("x." +
|
|
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
|
|
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
|
|
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
|
-
|
|
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 =
|
|
24404
|
+
filename = path2.normalize(options.filepath).replace(/\\/g, "/");
|
|
24405
24405
|
} else if (options.filename || value && (value.name || value.path)) {
|
|
24406
|
-
filename =
|
|
24406
|
+
filename = path2.basename(options.filename || value && (value.name || value.path));
|
|
24407
24407
|
} else if (value && value.readable && hasOwn(value, "httpVersion")) {
|
|
24408
|
-
filename =
|
|
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
|
|
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 =
|
|
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
|
|
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(
|
|
27117
|
-
if (!
|
|
27118
|
-
return
|
|
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,
|
|
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(
|
|
27170
|
+
formData.append(renderKey(path3, key, dots), convertValue(value));
|
|
27171
27171
|
return false;
|
|
27172
27172
|
}
|
|
27173
|
-
if (value && !
|
|
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(
|
|
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,
|
|
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 " +
|
|
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,
|
|
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,
|
|
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,
|
|
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(
|
|
27430
|
-
let name =
|
|
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 >=
|
|
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(
|
|
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 =
|
|
28817
|
-
const isAllowed = allowed.some((entry) => typeof entry === "string" &&
|
|
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,
|
|
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(
|
|
29078
|
-
cookie.push(`path=${
|
|
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}`);
|
|
@@ -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
|
|
34680
|
-
function checkPathExt(
|
|
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 &&
|
|
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,
|
|
34697
|
+
function checkStat(stat, path2, options) {
|
|
34698
34698
|
if (!stat.isSymbolicLink() && !stat.isFile()) {
|
|
34699
34699
|
return false;
|
|
34700
34700
|
}
|
|
34701
|
-
return checkPathExt(
|
|
34701
|
+
return checkPathExt(path2, options);
|
|
34702
34702
|
}
|
|
34703
|
-
function isexe(
|
|
34704
|
-
|
|
34705
|
-
cb(er, er ? false : checkStat(stat,
|
|
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(
|
|
34709
|
-
return checkStat(
|
|
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
|
|
34720
|
-
function isexe(
|
|
34721
|
-
|
|
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(
|
|
34726
|
-
return checkStat(
|
|
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
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
34788
|
+
function sync(path2, options) {
|
|
34789
34789
|
try {
|
|
34790
|
-
return core.sync(
|
|
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
|
|
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 =
|
|
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 =
|
|
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
|
|
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 ?
|
|
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 =
|
|
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 [
|
|
35001
|
-
const binary =
|
|
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
|
|
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 =
|
|
35022
|
-
|
|
35023
|
-
|
|
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
|
|
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 =
|
|
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
|
|
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 =
|
|
35203
|
+
let cwdPath = path2.resolve(options.cwd);
|
|
35204
35204
|
const result = [];
|
|
35205
35205
|
while (previous !== cwdPath) {
|
|
35206
|
-
result.push(
|
|
35206
|
+
result.push(path2.join(cwdPath, "node_modules/.bin"));
|
|
35207
35207
|
previous = cwdPath;
|
|
35208
|
-
cwdPath =
|
|
35208
|
+
cwdPath = path2.resolve(cwdPath, "..");
|
|
35209
35209
|
}
|
|
35210
|
-
const execPathDir =
|
|
35210
|
+
const execPathDir = path2.resolve(options.cwd, options.execPath, "..");
|
|
35211
35211
|
result.push(execPathDir);
|
|
35212
|
-
return result.concat(options.path).join(
|
|
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
|
|
35223
|
-
options.path = env[
|
|
35224
|
-
env[
|
|
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
|
|
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 ===
|
|
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
|
|
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" &&
|
|
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,
|
|
37895
|
-
if (!
|
|
37894
|
+
function getElementAtPath(obj, path2) {
|
|
37895
|
+
if (!path2)
|
|
37896
37896
|
return obj;
|
|
37897
|
-
return
|
|
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(
|
|
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(
|
|
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,
|
|
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 = [...
|
|
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
|
|
38516
|
-
for (const seg of
|
|
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
|
|
52360
|
+
var os3 = require("os");
|
|
52361
52361
|
var paths = require("path");
|
|
52362
52362
|
var isWinOS = /^win/i.test(process.platform);
|
|
52363
|
-
function normalize_path(
|
|
52364
|
-
return paths.normalize(paths.join(
|
|
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(
|
|
52370
|
-
object.temp = () => normalize_path(
|
|
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
|
-
|
|
52377
|
+
os3.homedir ? os3.homedir() : env.USERPROFILE || paths.join(env.HOMEDRIVE, env.HOMEPATH) || env.HOME
|
|
52378
52378
|
);
|
|
52379
52379
|
object.temp = () => normalize_path(
|
|
52380
|
-
|
|
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
|
|
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 ||
|
|
52410
|
-
object.config = () => process.env.XDG_CONFIG_HOME ||
|
|
52411
|
-
object.data = () => process.env.XDG_DATA_HOME ||
|
|
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 ||
|
|
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 ||
|
|
52419
|
-
object.config = () => process.env.XDG_CONFIG_HOME ||
|
|
52420
|
-
object.data = () => process.env.XDG_DATA_HOME ||
|
|
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 ||
|
|
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 ||
|
|
52429
|
-
return process.env.XDG_CACHE_HOME ||
|
|
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 ||
|
|
52433
|
-
return process.env.XDG_CONFIG_HOME ||
|
|
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 ||
|
|
52437
|
-
return process.env.XDG_DATA_HOME ||
|
|
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 ||
|
|
52442
|
-
return process.env.XDG_STATE_HOME ||
|
|
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(
|
|
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(
|
|
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
|
|
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_ =
|
|
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
|
|
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
|
|
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
|
|
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() ?
|
|
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
|
|
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) =>
|
|
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) =>
|
|
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
|
|
52892
|
-
var
|
|
52893
|
-
var
|
|
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 !==
|
|
52899
|
-
const pkgPath =
|
|
52900
|
-
if (
|
|
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 =
|
|
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 (
|
|
52916
|
+
switch (import_os3.default.platform()) {
|
|
52917
52917
|
case "darwin":
|
|
52918
|
-
return
|
|
52918
|
+
return import_path2.default.join(import_os3.default.homedir(), "Library/Application Support");
|
|
52919
52919
|
case "linux":
|
|
52920
|
-
return
|
|
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
|
|
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,
|
|
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
|
|
53114
|
-
var
|
|
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 =
|
|
53239
|
-
if (!
|
|
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(
|
|
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 =
|
|
53259
|
+
const tokenPath = path2.join(dir, "com.vercel.token", `${projectId}.json`);
|
|
53260
53260
|
const tokenJson = JSON.stringify(token);
|
|
53261
|
-
|
|
53262
|
-
|
|
53263
|
-
|
|
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 =
|
|
53274
|
-
if (!
|
|
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(
|
|
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
|
|
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 (
|
|
59102
|
-
|
|
59101
|
+
if (path2 && path2[0] !== "/") {
|
|
59102
|
+
path2 = `/${path2}`;
|
|
59103
59103
|
}
|
|
59104
|
-
return new URL(`${origin}${
|
|
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,
|
|
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
|
-
|
|
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,
|
|
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
|
-
|
|
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,
|
|
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
|
|
59716
|
+
if (typeof path2 !== "string") {
|
|
59717
59717
|
throw new InvalidArgumentError("path must be a string");
|
|
59718
|
-
} else if (
|
|
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(
|
|
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(
|
|
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} ${
|
|
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] =
|
|
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
|
|
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 =
|
|
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 +
|
|
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(
|
|
68583
|
-
if (typeof
|
|
68584
|
-
return
|
|
68582
|
+
function safeUrl(path2) {
|
|
68583
|
+
if (typeof path2 !== "string") {
|
|
68584
|
+
return path2;
|
|
68585
68585
|
}
|
|
68586
|
-
const pathSegments =
|
|
68586
|
+
const pathSegments = path2.split("?");
|
|
68587
68587
|
if (pathSegments.length !== 2) {
|
|
68588
|
-
return
|
|
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,
|
|
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(
|
|
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:
|
|
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(
|
|
74005
|
-
for (let i = 0; i <
|
|
74006
|
-
const code =
|
|
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
|
|
76699
|
+
let path2 = opts.path;
|
|
76700
76700
|
if (!opts.path.startsWith("/")) {
|
|
76701
|
-
|
|
76701
|
+
path2 = `/${path2}`;
|
|
76702
76702
|
}
|
|
76703
|
-
url = new URL(util.parseOrigin(url).origin +
|
|
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
|
|
79282
|
-
var
|
|
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
|
|
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
|
-
|
|
79356
|
+
fs2.mkdirSync(dir, { recursive: true });
|
|
79357
79357
|
for (const f of files) {
|
|
79358
|
-
const target =
|
|
79359
|
-
|
|
79358
|
+
const target = path2.join(dir, f.file);
|
|
79359
|
+
fs2.mkdirSync(path2.dirname(target), { recursive: true });
|
|
79360
79360
|
if (f.encoding === "base64") {
|
|
79361
|
-
|
|
79361
|
+
fs2.writeFileSync(target, Buffer.from(f.data, "base64"));
|
|
79362
79362
|
} else {
|
|
79363
|
-
|
|
79363
|
+
fs2.writeFileSync(target, f.data, "utf-8");
|
|
79364
79364
|
}
|
|
79365
79365
|
}
|
|
79366
|
-
|
|
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 (!
|
|
79372
|
+
if (!fs2.existsSync(dir))
|
|
79373
79373
|
return null;
|
|
79374
79374
|
const out = [];
|
|
79375
79375
|
function walk(rel) {
|
|
79376
|
-
const abs =
|
|
79377
|
-
const stat =
|
|
79376
|
+
const abs = path2.join(dir, rel);
|
|
79377
|
+
const stat = fs2.statSync(abs);
|
|
79378
79378
|
if (stat.isDirectory()) {
|
|
79379
|
-
for (const child of
|
|
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:
|
|
79386
|
+
out.push({ file: rel, data: fs2.readFileSync(abs).toString("base64"), encoding: "base64" });
|
|
79387
79387
|
} else {
|
|
79388
|
-
out.push({ file: rel, data:
|
|
79388
|
+
out.push({ file: rel, data: fs2.readFileSync(abs, "utf-8"), encoding: "utf-8" });
|
|
79389
79389
|
}
|
|
79390
79390
|
}
|
|
79391
79391
|
}
|
|
@@ -82047,7 +82047,7 @@ var require_package = __commonJS({
|
|
|
82047
82047
|
"package.json"(exports2, module2) {
|
|
82048
82048
|
module2.exports = {
|
|
82049
82049
|
name: "sproutkit-code",
|
|
82050
|
-
version: "0.1.
|
|
82050
|
+
version: "0.1.3",
|
|
82051
82051
|
description: "Sproutkit in your terminal \u2014 find leads, build sites, run outreach, all via chat.",
|
|
82052
82052
|
bin: {
|
|
82053
82053
|
sproutkit: "./dist/index.js"
|
|
@@ -82390,6 +82390,97 @@ function makeInvokeIpc(emit) {
|
|
|
82390
82390
|
};
|
|
82391
82391
|
}
|
|
82392
82392
|
|
|
82393
|
+
// src/sync.ts
|
|
82394
|
+
var import_os2 = __toESM(require("os"));
|
|
82395
|
+
var import_path = __toESM(require("path"));
|
|
82396
|
+
var import_fs = __toESM(require("fs"));
|
|
82397
|
+
var COLS = [
|
|
82398
|
+
"place_id",
|
|
82399
|
+
"name",
|
|
82400
|
+
"type",
|
|
82401
|
+
"city",
|
|
82402
|
+
"address",
|
|
82403
|
+
"phone",
|
|
82404
|
+
"website",
|
|
82405
|
+
"rating",
|
|
82406
|
+
"review_count",
|
|
82407
|
+
"lat",
|
|
82408
|
+
"lng",
|
|
82409
|
+
"status",
|
|
82410
|
+
"site_url",
|
|
82411
|
+
"site_built_at",
|
|
82412
|
+
"contacted_at",
|
|
82413
|
+
"notes",
|
|
82414
|
+
"score",
|
|
82415
|
+
"price_level",
|
|
82416
|
+
"business_status"
|
|
82417
|
+
];
|
|
82418
|
+
function desktopDbPath() {
|
|
82419
|
+
const home = import_os2.default.homedir();
|
|
82420
|
+
const candidates = [];
|
|
82421
|
+
if (process.platform === "darwin") {
|
|
82422
|
+
candidates.push(import_path.default.join(home, "Library", "Application Support", "Sproutkit", "data", "sproutio.db"));
|
|
82423
|
+
} else if (process.platform === "win32") {
|
|
82424
|
+
const appData = process.env.APPDATA || import_path.default.join(home, "AppData", "Roaming");
|
|
82425
|
+
candidates.push(import_path.default.join(appData, "Sproutkit", "data", "sproutio.db"));
|
|
82426
|
+
} else {
|
|
82427
|
+
const cfg = process.env.XDG_CONFIG_HOME || import_path.default.join(home, ".config");
|
|
82428
|
+
candidates.push(import_path.default.join(cfg, "Sproutkit", "data", "sproutio.db"));
|
|
82429
|
+
}
|
|
82430
|
+
return candidates.find((p) => import_fs.default.existsSync(p)) ?? null;
|
|
82431
|
+
}
|
|
82432
|
+
function syncToDesktop(opts = {}) {
|
|
82433
|
+
const dest = desktopDbPath();
|
|
82434
|
+
if (!dest) return { ok: false, reason: "no_desktop_db", inserted: 0, updated: 0 };
|
|
82435
|
+
const cliLeads = getDb().all(
|
|
82436
|
+
`SELECT ${COLS.join(", ")} FROM leads WHERE place_id IS NOT NULL AND place_id != ''`,
|
|
82437
|
+
[]
|
|
82438
|
+
);
|
|
82439
|
+
if (cliLeads.length === 0) return { ok: true, inserted: 0, updated: 0 };
|
|
82440
|
+
const { Database } = require("node-sqlite3-wasm");
|
|
82441
|
+
const ddb = new Database(dest);
|
|
82442
|
+
let inserted = 0;
|
|
82443
|
+
let updated = 0;
|
|
82444
|
+
try {
|
|
82445
|
+
for (const lead of cliLeads) {
|
|
82446
|
+
const existing = ddb.get("SELECT id FROM leads WHERE place_id = ?", [lead.place_id]);
|
|
82447
|
+
if (existing) {
|
|
82448
|
+
ddb.run(
|
|
82449
|
+
"UPDATE leads SET status = ?, site_url = ?, site_built_at = ?, score = ? WHERE place_id = ?",
|
|
82450
|
+
[lead.status, lead.site_url, lead.site_built_at, lead.score, lead.place_id].map(
|
|
82451
|
+
(v) => v ?? null
|
|
82452
|
+
)
|
|
82453
|
+
);
|
|
82454
|
+
updated++;
|
|
82455
|
+
} else {
|
|
82456
|
+
const placeholders = COLS.map(() => "?").join(", ");
|
|
82457
|
+
ddb.run(
|
|
82458
|
+
`INSERT INTO leads (${COLS.join(", ")}) VALUES (${placeholders})`,
|
|
82459
|
+
COLS.map((k) => lead[k] ?? null)
|
|
82460
|
+
);
|
|
82461
|
+
inserted++;
|
|
82462
|
+
}
|
|
82463
|
+
}
|
|
82464
|
+
} finally {
|
|
82465
|
+
ddb.close();
|
|
82466
|
+
}
|
|
82467
|
+
if (!opts.quiet) {
|
|
82468
|
+
say(
|
|
82469
|
+
c.green(` \u2713 Synced to desktop: ${inserted} new, ${updated} updated.`)
|
|
82470
|
+
);
|
|
82471
|
+
}
|
|
82472
|
+
return { ok: true, inserted, updated };
|
|
82473
|
+
}
|
|
82474
|
+
function autoSync() {
|
|
82475
|
+
try {
|
|
82476
|
+
const r = syncToDesktop({ quiet: true });
|
|
82477
|
+
if (r.ok && (r.inserted || r.updated)) {
|
|
82478
|
+
say(c.dim(` \u2194 synced to desktop (${r.inserted} new, ${r.updated} updated)`));
|
|
82479
|
+
}
|
|
82480
|
+
} catch {
|
|
82481
|
+
}
|
|
82482
|
+
}
|
|
82483
|
+
|
|
82393
82484
|
// src/chat-repl.ts
|
|
82394
82485
|
function loadHistory() {
|
|
82395
82486
|
const rows = getDb().all(
|
|
@@ -82481,6 +82572,8 @@ async function runTurn(userMessage) {
|
|
|
82481
82572
|
say();
|
|
82482
82573
|
persist("assistant", result.text, result.toolCalls);
|
|
82483
82574
|
}
|
|
82575
|
+
const ranSomething = result.toolCalls.some((t) => t.status === "completed");
|
|
82576
|
+
if (ranSomething) autoSync();
|
|
82484
82577
|
return;
|
|
82485
82578
|
}
|
|
82486
82579
|
say();
|
|
@@ -82573,6 +82666,15 @@ async function main() {
|
|
|
82573
82666
|
closeTty();
|
|
82574
82667
|
return;
|
|
82575
82668
|
}
|
|
82669
|
+
if (arg === "sync") {
|
|
82670
|
+
const r = syncToDesktop();
|
|
82671
|
+
if (!r.ok && r.reason === "no_desktop_db") {
|
|
82672
|
+
say(c.dim(" No desktop Sproutkit database found \u2014 nothing to sync to."));
|
|
82673
|
+
say(c.dim(" Install the desktop app and run it once to create it."));
|
|
82674
|
+
}
|
|
82675
|
+
closeTty();
|
|
82676
|
+
return;
|
|
82677
|
+
}
|
|
82576
82678
|
if (arg === "setup") {
|
|
82577
82679
|
await runOnboarding(true);
|
|
82578
82680
|
closeTty();
|
|
@@ -82585,6 +82687,7 @@ async function main() {
|
|
|
82585
82687
|
say();
|
|
82586
82688
|
say(` ${c.bold("sproutkit")} start the chat`);
|
|
82587
82689
|
say(` ${c.bold("sproutkit setup")} set or update your keys and licence`);
|
|
82690
|
+
say(` ${c.bold("sproutkit sync")} push your leads into the desktop app`);
|
|
82588
82691
|
say(` ${c.bold("sproutkit update")} update to the latest version`);
|
|
82589
82692
|
say(` ${c.bold("sproutkit version")} show the installed version`);
|
|
82590
82693
|
say(` ${c.bold('sproutkit "..."')} run a single message and exit`);
|