@swmansion/argent 0.27.1-next.21 → 0.27.1-next.22
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/cli-cmds.mjs +86 -11
- package/dist/client.js +76 -5
- package/dist/installer.mjs +1 -1
- package/dist/mcp-server.mjs +76 -5
- package/dist/tool-args.generated.d.ts +1 -1
- package/dist/tool-server.cjs +663 -551
- package/package.json +1 -1
- package/skills/argent-create-flow/references/live-authoring.md +9 -1
package/dist/tool-server.cjs
CHANGED
|
@@ -235,7 +235,7 @@ var init_config = __esm({
|
|
|
235
235
|
var require_main = __commonJS({
|
|
236
236
|
"../../node_modules/dotenv/lib/main.js"(exports2, module2) {
|
|
237
237
|
var fs69 = require("fs");
|
|
238
|
-
var
|
|
238
|
+
var path53 = require("path");
|
|
239
239
|
var os21 = require("os");
|
|
240
240
|
var crypto8 = require("crypto");
|
|
241
241
|
var TIPS = [
|
|
@@ -374,7 +374,7 @@ var require_main = __commonJS({
|
|
|
374
374
|
possibleVaultPath = options.path.endsWith(".vault") ? options.path : `${options.path}.vault`;
|
|
375
375
|
}
|
|
376
376
|
} else {
|
|
377
|
-
possibleVaultPath =
|
|
377
|
+
possibleVaultPath = path53.resolve(process.cwd(), ".env.vault");
|
|
378
378
|
}
|
|
379
379
|
if (fs69.existsSync(possibleVaultPath)) {
|
|
380
380
|
return possibleVaultPath;
|
|
@@ -382,7 +382,7 @@ var require_main = __commonJS({
|
|
|
382
382
|
return null;
|
|
383
383
|
}
|
|
384
384
|
function _resolveHome(envPath) {
|
|
385
|
-
return envPath[0] === "~" ?
|
|
385
|
+
return envPath[0] === "~" ? path53.join(os21.homedir(), envPath.slice(1)) : envPath;
|
|
386
386
|
}
|
|
387
387
|
function _configVault(options) {
|
|
388
388
|
const debug = parseBoolean(process.env.DOTENV_CONFIG_DEBUG || options && options.debug);
|
|
@@ -399,7 +399,7 @@ var require_main = __commonJS({
|
|
|
399
399
|
return { parsed };
|
|
400
400
|
}
|
|
401
401
|
function configDotenv(options) {
|
|
402
|
-
const dotenvPath =
|
|
402
|
+
const dotenvPath = path53.resolve(process.cwd(), ".env");
|
|
403
403
|
let encoding = "utf8";
|
|
404
404
|
let processEnv = process.env;
|
|
405
405
|
if (options && options.processEnv != null) {
|
|
@@ -427,13 +427,13 @@ var require_main = __commonJS({
|
|
|
427
427
|
}
|
|
428
428
|
let lastError;
|
|
429
429
|
const parsedAll = {};
|
|
430
|
-
for (const
|
|
430
|
+
for (const path54 of optionPaths) {
|
|
431
431
|
try {
|
|
432
|
-
const parsed = DotenvModule.parse(fs69.readFileSync(
|
|
432
|
+
const parsed = DotenvModule.parse(fs69.readFileSync(path54, { encoding }));
|
|
433
433
|
DotenvModule.populate(parsedAll, parsed, options);
|
|
434
434
|
} catch (e) {
|
|
435
435
|
if (debug) {
|
|
436
|
-
_debug(`failed to load ${
|
|
436
|
+
_debug(`failed to load ${path54} ${e.message}`);
|
|
437
437
|
}
|
|
438
438
|
lastError = e;
|
|
439
439
|
}
|
|
@@ -446,7 +446,7 @@ var require_main = __commonJS({
|
|
|
446
446
|
const shortPaths = [];
|
|
447
447
|
for (const filePath of optionPaths) {
|
|
448
448
|
try {
|
|
449
|
-
const relative5 =
|
|
449
|
+
const relative5 = path53.relative(process.cwd(), filePath);
|
|
450
450
|
shortPaths.push(relative5);
|
|
451
451
|
} catch (e) {
|
|
452
452
|
if (debug) {
|
|
@@ -1120,7 +1120,23 @@ function interpolateFileInputPath(template, args) {
|
|
|
1120
1120
|
});
|
|
1121
1121
|
return missing ? null : out;
|
|
1122
1122
|
}
|
|
1123
|
-
|
|
1123
|
+
function hasToolFileExtension(file2) {
|
|
1124
|
+
const name = file2.toLowerCase();
|
|
1125
|
+
return TOOL_FILE_EXTENSIONS.some((extension2) => name.endsWith(extension2));
|
|
1126
|
+
}
|
|
1127
|
+
function toolStepFiles(specs, args) {
|
|
1128
|
+
const files = [];
|
|
1129
|
+
for (const spec of specs ?? []) {
|
|
1130
|
+
if (spec.skipWhenSet !== void 0 && args[spec.skipWhenSet] !== void 0) continue;
|
|
1131
|
+
const filled = interpolateFileInputPath(spec.path, args);
|
|
1132
|
+
if (filled !== null) files.push({ spec, path: filled });
|
|
1133
|
+
}
|
|
1134
|
+
return files;
|
|
1135
|
+
}
|
|
1136
|
+
function isClientFileArgument({ spec, path: path53 }) {
|
|
1137
|
+
return spec.kind === "file" && spec.path === `\${${spec.target}}` && path53.startsWith("/") && hasToolFileExtension(path53);
|
|
1138
|
+
}
|
|
1139
|
+
var FILE_INPUT_MARKER, FLOW_NAME_CHARSET, FLOW_NAME_PATTERN, FLOW_FILE_NAME_PATTERN, SCRIPT_FILE_NAME_PATTERN, CLIENT_FILE_MARKER, TOOL_FILE_EXTENSIONS;
|
|
1124
1140
|
var init_file_inputs = __esm({
|
|
1125
1141
|
"../registry/src/file-inputs.ts"() {
|
|
1126
1142
|
"use strict";
|
|
@@ -1130,6 +1146,7 @@ var init_file_inputs = __esm({
|
|
|
1130
1146
|
FLOW_FILE_NAME_PATTERN = new RegExp(`^${FLOW_NAME_CHARSET}\\.yaml$`);
|
|
1131
1147
|
SCRIPT_FILE_NAME_PATTERN = new RegExp(`^${FLOW_NAME_CHARSET}\\.mjs$`);
|
|
1132
1148
|
CLIENT_FILE_MARKER = "__argentClientFile";
|
|
1149
|
+
TOOL_FILE_EXTENSIONS = [".png", ".yaml"];
|
|
1133
1150
|
}
|
|
1134
1151
|
});
|
|
1135
1152
|
|
|
@@ -1933,10 +1950,10 @@ function mergeDefs(...defs) {
|
|
|
1933
1950
|
function cloneDef(schema) {
|
|
1934
1951
|
return mergeDefs(schema._zod.def);
|
|
1935
1952
|
}
|
|
1936
|
-
function getElementAtPath(obj,
|
|
1937
|
-
if (!
|
|
1953
|
+
function getElementAtPath(obj, path53) {
|
|
1954
|
+
if (!path53)
|
|
1938
1955
|
return obj;
|
|
1939
|
-
return
|
|
1956
|
+
return path53.reduce((acc, key2) => acc?.[key2], obj);
|
|
1940
1957
|
}
|
|
1941
1958
|
function promiseAllObject(promisesObj) {
|
|
1942
1959
|
const keys = Object.keys(promisesObj);
|
|
@@ -2264,11 +2281,11 @@ function explicitlyAborted(x, startIndex = 0) {
|
|
|
2264
2281
|
}
|
|
2265
2282
|
return false;
|
|
2266
2283
|
}
|
|
2267
|
-
function prefixIssues(
|
|
2284
|
+
function prefixIssues(path53, issues) {
|
|
2268
2285
|
return issues.map((iss) => {
|
|
2269
2286
|
var _a3;
|
|
2270
2287
|
(_a3 = iss).path ?? (_a3.path = []);
|
|
2271
|
-
iss.path.unshift(
|
|
2288
|
+
iss.path.unshift(path53);
|
|
2272
2289
|
return iss;
|
|
2273
2290
|
});
|
|
2274
2291
|
}
|
|
@@ -2485,16 +2502,16 @@ function flattenError(error52, mapper = (issue2) => issue2.message) {
|
|
|
2485
2502
|
}
|
|
2486
2503
|
function formatError(error52, mapper = (issue2) => issue2.message) {
|
|
2487
2504
|
const fieldErrors = { _errors: [] };
|
|
2488
|
-
const processError = (error53,
|
|
2505
|
+
const processError = (error53, path53 = []) => {
|
|
2489
2506
|
for (const issue2 of error53.issues) {
|
|
2490
2507
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
2491
|
-
issue2.errors.map((issues) => processError({ issues }, [...
|
|
2508
|
+
issue2.errors.map((issues) => processError({ issues }, [...path53, ...issue2.path]));
|
|
2492
2509
|
} else if (issue2.code === "invalid_key") {
|
|
2493
|
-
processError({ issues: issue2.issues }, [...
|
|
2510
|
+
processError({ issues: issue2.issues }, [...path53, ...issue2.path]);
|
|
2494
2511
|
} else if (issue2.code === "invalid_element") {
|
|
2495
|
-
processError({ issues: issue2.issues }, [...
|
|
2512
|
+
processError({ issues: issue2.issues }, [...path53, ...issue2.path]);
|
|
2496
2513
|
} else {
|
|
2497
|
-
const fullpath = [...
|
|
2514
|
+
const fullpath = [...path53, ...issue2.path];
|
|
2498
2515
|
if (fullpath.length === 0) {
|
|
2499
2516
|
fieldErrors._errors.push(mapper(issue2));
|
|
2500
2517
|
} else {
|
|
@@ -2521,17 +2538,17 @@ function formatError(error52, mapper = (issue2) => issue2.message) {
|
|
|
2521
2538
|
}
|
|
2522
2539
|
function treeifyError(error52, mapper = (issue2) => issue2.message) {
|
|
2523
2540
|
const result = { errors: [] };
|
|
2524
|
-
const processError = (error53,
|
|
2541
|
+
const processError = (error53, path53 = []) => {
|
|
2525
2542
|
var _a3, _b;
|
|
2526
2543
|
for (const issue2 of error53.issues) {
|
|
2527
2544
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
2528
|
-
issue2.errors.map((issues) => processError({ issues }, [...
|
|
2545
|
+
issue2.errors.map((issues) => processError({ issues }, [...path53, ...issue2.path]));
|
|
2529
2546
|
} else if (issue2.code === "invalid_key") {
|
|
2530
|
-
processError({ issues: issue2.issues }, [...
|
|
2547
|
+
processError({ issues: issue2.issues }, [...path53, ...issue2.path]);
|
|
2531
2548
|
} else if (issue2.code === "invalid_element") {
|
|
2532
|
-
processError({ issues: issue2.issues }, [...
|
|
2549
|
+
processError({ issues: issue2.issues }, [...path53, ...issue2.path]);
|
|
2533
2550
|
} else {
|
|
2534
|
-
const fullpath = [...
|
|
2551
|
+
const fullpath = [...path53, ...issue2.path];
|
|
2535
2552
|
if (fullpath.length === 0) {
|
|
2536
2553
|
result.errors.push(mapper(issue2));
|
|
2537
2554
|
continue;
|
|
@@ -2563,8 +2580,8 @@ function treeifyError(error52, mapper = (issue2) => issue2.message) {
|
|
|
2563
2580
|
}
|
|
2564
2581
|
function toDotPath(_path) {
|
|
2565
2582
|
const segs = [];
|
|
2566
|
-
const
|
|
2567
|
-
for (const seg of
|
|
2583
|
+
const path53 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
|
|
2584
|
+
for (const seg of path53) {
|
|
2568
2585
|
if (typeof seg === "number")
|
|
2569
2586
|
segs.push(`[${seg}]`);
|
|
2570
2587
|
else if (typeof seg === "symbol")
|
|
@@ -15994,13 +16011,13 @@ function resolveRef(ref, ctx) {
|
|
|
15994
16011
|
if (!ref.startsWith("#")) {
|
|
15995
16012
|
throw new Error("External $ref is not supported, only local refs (#/...) are allowed");
|
|
15996
16013
|
}
|
|
15997
|
-
const
|
|
15998
|
-
if (
|
|
16014
|
+
const path53 = ref.slice(1).split("/").filter(Boolean);
|
|
16015
|
+
if (path53.length === 0) {
|
|
15999
16016
|
return ctx.rootSchema;
|
|
16000
16017
|
}
|
|
16001
16018
|
const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions";
|
|
16002
|
-
if (
|
|
16003
|
-
const key2 =
|
|
16019
|
+
if (path53[0] === defsKey) {
|
|
16020
|
+
const key2 = path53[1];
|
|
16004
16021
|
if (!key2 || !ctx.defs[key2]) {
|
|
16005
16022
|
throw new Error(`Reference not found: ${ref}`);
|
|
16006
16023
|
}
|
|
@@ -16792,9 +16809,9 @@ function terminatingSignalCause(message) {
|
|
|
16792
16809
|
error_kind: "unknown"
|
|
16793
16810
|
});
|
|
16794
16811
|
}
|
|
16795
|
-
function valueAtPath(root,
|
|
16812
|
+
function valueAtPath(root, path53) {
|
|
16796
16813
|
let current = root;
|
|
16797
|
-
for (const key2 of
|
|
16814
|
+
for (const key2 of path53) {
|
|
16798
16815
|
if (current === null || typeof current !== "object") return void 0;
|
|
16799
16816
|
if (!Object.hasOwn(current, key2)) return void 0;
|
|
16800
16817
|
current = current[key2];
|
|
@@ -33472,11 +33489,11 @@ var require_mime_types = __commonJS({
|
|
|
33472
33489
|
}
|
|
33473
33490
|
return exts[0];
|
|
33474
33491
|
}
|
|
33475
|
-
function lookup(
|
|
33476
|
-
if (!
|
|
33492
|
+
function lookup(path53) {
|
|
33493
|
+
if (!path53 || typeof path53 !== "string") {
|
|
33477
33494
|
return false;
|
|
33478
33495
|
}
|
|
33479
|
-
var extension3 = extname6("x." +
|
|
33496
|
+
var extension3 = extname6("x." + path53).toLowerCase().slice(1);
|
|
33480
33497
|
if (!extension3) {
|
|
33481
33498
|
return false;
|
|
33482
33499
|
}
|
|
@@ -37100,13 +37117,13 @@ var require_view = __commonJS({
|
|
|
37100
37117
|
"../../node_modules/express/lib/view.js"(exports2, module2) {
|
|
37101
37118
|
"use strict";
|
|
37102
37119
|
var debug = require_src()("express:view");
|
|
37103
|
-
var
|
|
37120
|
+
var path53 = require("node:path");
|
|
37104
37121
|
var fs69 = require("node:fs");
|
|
37105
|
-
var dirname18 =
|
|
37106
|
-
var basename14 =
|
|
37107
|
-
var extname6 =
|
|
37108
|
-
var join55 =
|
|
37109
|
-
var resolve14 =
|
|
37122
|
+
var dirname18 = path53.dirname;
|
|
37123
|
+
var basename14 = path53.basename;
|
|
37124
|
+
var extname6 = path53.extname;
|
|
37125
|
+
var join55 = path53.join;
|
|
37126
|
+
var resolve14 = path53.resolve;
|
|
37110
37127
|
module2.exports = View;
|
|
37111
37128
|
function View(name, options) {
|
|
37112
37129
|
var opts = options || {};
|
|
@@ -37135,17 +37152,17 @@ var require_view = __commonJS({
|
|
|
37135
37152
|
this.path = this.lookup(fileName);
|
|
37136
37153
|
}
|
|
37137
37154
|
View.prototype.lookup = function lookup(name) {
|
|
37138
|
-
var
|
|
37155
|
+
var path54;
|
|
37139
37156
|
var roots = [].concat(this.root);
|
|
37140
37157
|
debug('lookup "%s"', name);
|
|
37141
|
-
for (var i = 0; i < roots.length && !
|
|
37158
|
+
for (var i = 0; i < roots.length && !path54; i++) {
|
|
37142
37159
|
var root = roots[i];
|
|
37143
37160
|
var loc = resolve14(root, name);
|
|
37144
37161
|
var dir = dirname18(loc);
|
|
37145
37162
|
var file2 = basename14(loc);
|
|
37146
|
-
|
|
37163
|
+
path54 = this.resolve(dir, file2);
|
|
37147
37164
|
}
|
|
37148
|
-
return
|
|
37165
|
+
return path54;
|
|
37149
37166
|
};
|
|
37150
37167
|
View.prototype.render = function render(options, callback) {
|
|
37151
37168
|
var sync = true;
|
|
@@ -37167,21 +37184,21 @@ var require_view = __commonJS({
|
|
|
37167
37184
|
};
|
|
37168
37185
|
View.prototype.resolve = function resolve15(dir, file2) {
|
|
37169
37186
|
var ext = this.ext;
|
|
37170
|
-
var
|
|
37171
|
-
var stat6 = tryStat(
|
|
37187
|
+
var path54 = join55(dir, file2);
|
|
37188
|
+
var stat6 = tryStat(path54);
|
|
37172
37189
|
if (stat6 && stat6.isFile()) {
|
|
37173
|
-
return
|
|
37190
|
+
return path54;
|
|
37174
37191
|
}
|
|
37175
|
-
|
|
37176
|
-
stat6 = tryStat(
|
|
37192
|
+
path54 = join55(dir, basename14(file2, ext), "index" + ext);
|
|
37193
|
+
stat6 = tryStat(path54);
|
|
37177
37194
|
if (stat6 && stat6.isFile()) {
|
|
37178
|
-
return
|
|
37195
|
+
return path54;
|
|
37179
37196
|
}
|
|
37180
37197
|
};
|
|
37181
|
-
function tryStat(
|
|
37182
|
-
debug('stat "%s"',
|
|
37198
|
+
function tryStat(path54) {
|
|
37199
|
+
debug('stat "%s"', path54);
|
|
37183
37200
|
try {
|
|
37184
|
-
return fs69.statSync(
|
|
37201
|
+
return fs69.statSync(path54);
|
|
37185
37202
|
} catch (e) {
|
|
37186
37203
|
return void 0;
|
|
37187
37204
|
}
|
|
@@ -46791,11 +46808,11 @@ var require_mime_types2 = __commonJS({
|
|
|
46791
46808
|
}
|
|
46792
46809
|
return exts[0];
|
|
46793
46810
|
}
|
|
46794
|
-
function lookup(
|
|
46795
|
-
if (!
|
|
46811
|
+
function lookup(path53) {
|
|
46812
|
+
if (!path53 || typeof path53 !== "string") {
|
|
46796
46813
|
return false;
|
|
46797
46814
|
}
|
|
46798
|
-
var extension3 = extname6("x." +
|
|
46815
|
+
var extension3 = extname6("x." + path53).toLowerCase().slice(1);
|
|
46799
46816
|
if (!extension3) {
|
|
46800
46817
|
return false;
|
|
46801
46818
|
}
|
|
@@ -47926,15 +47943,15 @@ var require_dist3 = __commonJS({
|
|
|
47926
47943
|
let index = 0;
|
|
47927
47944
|
function consumeUntil(end) {
|
|
47928
47945
|
const output = [];
|
|
47929
|
-
let
|
|
47946
|
+
let path53 = "";
|
|
47930
47947
|
function writePath() {
|
|
47931
|
-
if (!
|
|
47948
|
+
if (!path53)
|
|
47932
47949
|
return;
|
|
47933
47950
|
output.push({
|
|
47934
47951
|
type: "text",
|
|
47935
|
-
value: encodePath(
|
|
47952
|
+
value: encodePath(path53)
|
|
47936
47953
|
});
|
|
47937
|
-
|
|
47954
|
+
path53 = "";
|
|
47938
47955
|
}
|
|
47939
47956
|
while (index < chars.length) {
|
|
47940
47957
|
const value = chars[index++];
|
|
@@ -47946,7 +47963,7 @@ var require_dist3 = __commonJS({
|
|
|
47946
47963
|
if (index === chars.length) {
|
|
47947
47964
|
throw new PathError(`Unexpected end after \\ at index ${index}`, str);
|
|
47948
47965
|
}
|
|
47949
|
-
|
|
47966
|
+
path53 += chars[index++];
|
|
47950
47967
|
continue;
|
|
47951
47968
|
}
|
|
47952
47969
|
if (value === ":" || value === "*") {
|
|
@@ -47990,7 +48007,7 @@ var require_dist3 = __commonJS({
|
|
|
47990
48007
|
if (value === "}" || value === "(" || value === ")" || value === "[" || value === "]" || value === "+" || value === "?" || value === "!") {
|
|
47991
48008
|
throw new PathError(`Unexpected ${value} at index ${index - 1}`, str);
|
|
47992
48009
|
}
|
|
47993
|
-
|
|
48010
|
+
path53 += value;
|
|
47994
48011
|
}
|
|
47995
48012
|
if (end) {
|
|
47996
48013
|
throw new PathError(`Unexpected end at index ${index}, expected ${end}`, str);
|
|
@@ -48000,17 +48017,17 @@ var require_dist3 = __commonJS({
|
|
|
48000
48017
|
}
|
|
48001
48018
|
return new TokenData(consumeUntil(""), str);
|
|
48002
48019
|
}
|
|
48003
|
-
function compile(
|
|
48020
|
+
function compile(path53, options = {}) {
|
|
48004
48021
|
const { encode: encode9 = encodeURIComponent, delimiter = DEFAULT_DELIMITER } = options;
|
|
48005
|
-
const data = typeof
|
|
48022
|
+
const data = typeof path53 === "object" ? path53 : parse4(path53, options);
|
|
48006
48023
|
const fn = tokensToFunction(data.tokens, delimiter, encode9);
|
|
48007
|
-
return function
|
|
48024
|
+
return function path54(params = {}) {
|
|
48008
48025
|
const missing = [];
|
|
48009
|
-
const
|
|
48026
|
+
const path55 = fn(params, missing);
|
|
48010
48027
|
if (missing.length) {
|
|
48011
48028
|
throw new TypeError(`Missing parameters: ${missing.join(", ")}`);
|
|
48012
48029
|
}
|
|
48013
|
-
return
|
|
48030
|
+
return path55;
|
|
48014
48031
|
};
|
|
48015
48032
|
}
|
|
48016
48033
|
function tokensToFunction(tokens, delimiter, encode9) {
|
|
@@ -48072,9 +48089,9 @@ var require_dist3 = __commonJS({
|
|
|
48072
48089
|
return encodeValue(value);
|
|
48073
48090
|
};
|
|
48074
48091
|
}
|
|
48075
|
-
function match(
|
|
48092
|
+
function match(path53, options = {}) {
|
|
48076
48093
|
const { decode: decode9 = decodeURIComponent, delimiter = DEFAULT_DELIMITER } = options;
|
|
48077
|
-
const { regexp, keys } = pathToRegexp(
|
|
48094
|
+
const { regexp, keys } = pathToRegexp(path53, options);
|
|
48078
48095
|
const decoders = keys.map((key2) => {
|
|
48079
48096
|
if (decode9 === false)
|
|
48080
48097
|
return NOOP_VALUE;
|
|
@@ -48086,7 +48103,7 @@ var require_dist3 = __commonJS({
|
|
|
48086
48103
|
const m = regexp.exec(input);
|
|
48087
48104
|
if (!m)
|
|
48088
48105
|
return false;
|
|
48089
|
-
const
|
|
48106
|
+
const path54 = m[0];
|
|
48090
48107
|
const params = /* @__PURE__ */ Object.create(null);
|
|
48091
48108
|
for (let i = 1; i < m.length; i++) {
|
|
48092
48109
|
if (m[i] === void 0)
|
|
@@ -48095,21 +48112,21 @@ var require_dist3 = __commonJS({
|
|
|
48095
48112
|
const decoder = decoders[i - 1];
|
|
48096
48113
|
params[key2.name] = decoder(m[i]);
|
|
48097
48114
|
}
|
|
48098
|
-
return { path:
|
|
48115
|
+
return { path: path54, params };
|
|
48099
48116
|
};
|
|
48100
48117
|
}
|
|
48101
|
-
function pathToRegexp(
|
|
48118
|
+
function pathToRegexp(path53, options = {}) {
|
|
48102
48119
|
const { delimiter = DEFAULT_DELIMITER, end = true, sensitive = false, trailing = true } = options;
|
|
48103
48120
|
const keys = [];
|
|
48104
48121
|
let source = "";
|
|
48105
48122
|
let combinations = 0;
|
|
48106
|
-
function process3(
|
|
48107
|
-
if (Array.isArray(
|
|
48108
|
-
for (const p of
|
|
48123
|
+
function process3(path54) {
|
|
48124
|
+
if (Array.isArray(path54)) {
|
|
48125
|
+
for (const p of path54)
|
|
48109
48126
|
process3(p);
|
|
48110
48127
|
return;
|
|
48111
48128
|
}
|
|
48112
|
-
const data = typeof
|
|
48129
|
+
const data = typeof path54 === "object" ? path54 : parse4(path54, options);
|
|
48113
48130
|
flatten(data.tokens, 0, [], (tokens) => {
|
|
48114
48131
|
if (combinations >= 256) {
|
|
48115
48132
|
throw new PathError("Too many path combinations", data.originalPath);
|
|
@@ -48120,7 +48137,7 @@ var require_dist3 = __commonJS({
|
|
|
48120
48137
|
combinations++;
|
|
48121
48138
|
});
|
|
48122
48139
|
}
|
|
48123
|
-
process3(
|
|
48140
|
+
process3(path53);
|
|
48124
48141
|
let pattern = `^(?:${source})`;
|
|
48125
48142
|
if (trailing)
|
|
48126
48143
|
pattern += "(?:" + escape2(delimiter) + "$)?";
|
|
@@ -48260,18 +48277,18 @@ var require_layer = __commonJS({
|
|
|
48260
48277
|
var TRAILING_SLASH_REGEXP = /\/+$/;
|
|
48261
48278
|
var MATCHING_GROUP_REGEXP = /\((?:\?<(.*?)>)?(?!\?)/g;
|
|
48262
48279
|
module2.exports = Layer;
|
|
48263
|
-
function Layer(
|
|
48280
|
+
function Layer(path53, options, fn) {
|
|
48264
48281
|
if (!(this instanceof Layer)) {
|
|
48265
|
-
return new Layer(
|
|
48282
|
+
return new Layer(path53, options, fn);
|
|
48266
48283
|
}
|
|
48267
|
-
debug("new %o",
|
|
48284
|
+
debug("new %o", path53);
|
|
48268
48285
|
const opts = options || {};
|
|
48269
48286
|
this.handle = fn;
|
|
48270
48287
|
this.keys = [];
|
|
48271
48288
|
this.name = fn.name || "<anonymous>";
|
|
48272
48289
|
this.params = void 0;
|
|
48273
48290
|
this.path = void 0;
|
|
48274
|
-
this.slash =
|
|
48291
|
+
this.slash = path53 === "/" && opts.end === false;
|
|
48275
48292
|
function matcher(_path) {
|
|
48276
48293
|
if (_path instanceof RegExp) {
|
|
48277
48294
|
const keys = [];
|
|
@@ -48310,7 +48327,7 @@ var require_layer = __commonJS({
|
|
|
48310
48327
|
decode: decodeParam
|
|
48311
48328
|
});
|
|
48312
48329
|
}
|
|
48313
|
-
this.matchers = Array.isArray(
|
|
48330
|
+
this.matchers = Array.isArray(path53) ? path53.map(matcher) : [matcher(path53)];
|
|
48314
48331
|
}
|
|
48315
48332
|
Layer.prototype.handleError = function handleError(error52, req, res, next) {
|
|
48316
48333
|
const fn = this.handle;
|
|
@@ -48350,9 +48367,9 @@ var require_layer = __commonJS({
|
|
|
48350
48367
|
next(err);
|
|
48351
48368
|
}
|
|
48352
48369
|
};
|
|
48353
|
-
Layer.prototype.match = function match(
|
|
48370
|
+
Layer.prototype.match = function match(path53) {
|
|
48354
48371
|
let match2;
|
|
48355
|
-
if (
|
|
48372
|
+
if (path53 != null) {
|
|
48356
48373
|
if (this.slash) {
|
|
48357
48374
|
this.params = {};
|
|
48358
48375
|
this.path = "";
|
|
@@ -48360,7 +48377,7 @@ var require_layer = __commonJS({
|
|
|
48360
48377
|
}
|
|
48361
48378
|
let i = 0;
|
|
48362
48379
|
while (!match2 && i < this.matchers.length) {
|
|
48363
|
-
match2 = this.matchers[i](
|
|
48380
|
+
match2 = this.matchers[i](path53);
|
|
48364
48381
|
i++;
|
|
48365
48382
|
}
|
|
48366
48383
|
}
|
|
@@ -48388,13 +48405,13 @@ var require_layer = __commonJS({
|
|
|
48388
48405
|
throw err;
|
|
48389
48406
|
}
|
|
48390
48407
|
}
|
|
48391
|
-
function loosen(
|
|
48392
|
-
if (
|
|
48393
|
-
return
|
|
48408
|
+
function loosen(path53) {
|
|
48409
|
+
if (path53 instanceof RegExp || path53 === "/") {
|
|
48410
|
+
return path53;
|
|
48394
48411
|
}
|
|
48395
|
-
return Array.isArray(
|
|
48412
|
+
return Array.isArray(path53) ? path53.map(function(p) {
|
|
48396
48413
|
return loosen(p);
|
|
48397
|
-
}) : String(
|
|
48414
|
+
}) : String(path53).replace(TRAILING_SLASH_REGEXP, "");
|
|
48398
48415
|
}
|
|
48399
48416
|
}
|
|
48400
48417
|
});
|
|
@@ -48410,9 +48427,9 @@ var require_route = __commonJS({
|
|
|
48410
48427
|
var flatten = Array.prototype.flat;
|
|
48411
48428
|
var methods = METHODS.map((method) => method.toLowerCase());
|
|
48412
48429
|
module2.exports = Route2;
|
|
48413
|
-
function Route2(
|
|
48414
|
-
debug("new %o",
|
|
48415
|
-
this.path =
|
|
48430
|
+
function Route2(path53) {
|
|
48431
|
+
debug("new %o", path53);
|
|
48432
|
+
this.path = path53;
|
|
48416
48433
|
this.stack = [];
|
|
48417
48434
|
this.methods = /* @__PURE__ */ Object.create(null);
|
|
48418
48435
|
}
|
|
@@ -48620,8 +48637,8 @@ var require_router = __commonJS({
|
|
|
48620
48637
|
if (++sync > 100) {
|
|
48621
48638
|
return setImmediate(next, err);
|
|
48622
48639
|
}
|
|
48623
|
-
const
|
|
48624
|
-
if (
|
|
48640
|
+
const path53 = getPathname(req);
|
|
48641
|
+
if (path53 == null) {
|
|
48625
48642
|
return done(layerError);
|
|
48626
48643
|
}
|
|
48627
48644
|
let layer;
|
|
@@ -48629,7 +48646,7 @@ var require_router = __commonJS({
|
|
|
48629
48646
|
let route;
|
|
48630
48647
|
while (match !== true && idx < stack.length) {
|
|
48631
48648
|
layer = stack[idx++];
|
|
48632
|
-
match = matchLayer(layer,
|
|
48649
|
+
match = matchLayer(layer, path53);
|
|
48633
48650
|
route = layer.route;
|
|
48634
48651
|
if (typeof match !== "boolean") {
|
|
48635
48652
|
layerError = layerError || match;
|
|
@@ -48667,18 +48684,18 @@ var require_router = __commonJS({
|
|
|
48667
48684
|
} else if (route) {
|
|
48668
48685
|
layer.handleRequest(req, res, next);
|
|
48669
48686
|
} else {
|
|
48670
|
-
trimPrefix(layer, layerError, layerPath,
|
|
48687
|
+
trimPrefix(layer, layerError, layerPath, path53);
|
|
48671
48688
|
}
|
|
48672
48689
|
sync = 0;
|
|
48673
48690
|
});
|
|
48674
48691
|
}
|
|
48675
|
-
function trimPrefix(layer, layerError, layerPath,
|
|
48692
|
+
function trimPrefix(layer, layerError, layerPath, path53) {
|
|
48676
48693
|
if (layerPath.length !== 0) {
|
|
48677
|
-
if (layerPath !==
|
|
48694
|
+
if (layerPath !== path53.substring(0, layerPath.length)) {
|
|
48678
48695
|
next(layerError);
|
|
48679
48696
|
return;
|
|
48680
48697
|
}
|
|
48681
|
-
const c =
|
|
48698
|
+
const c = path53[layerPath.length];
|
|
48682
48699
|
if (c && c !== "/") {
|
|
48683
48700
|
next(layerError);
|
|
48684
48701
|
return;
|
|
@@ -48702,7 +48719,7 @@ var require_router = __commonJS({
|
|
|
48702
48719
|
};
|
|
48703
48720
|
Router2.prototype.use = function use(handler) {
|
|
48704
48721
|
let offset = 0;
|
|
48705
|
-
let
|
|
48722
|
+
let path53 = "/";
|
|
48706
48723
|
if (typeof handler !== "function") {
|
|
48707
48724
|
let arg = handler;
|
|
48708
48725
|
while (Array.isArray(arg) && arg.length !== 0) {
|
|
@@ -48710,7 +48727,7 @@ var require_router = __commonJS({
|
|
|
48710
48727
|
}
|
|
48711
48728
|
if (typeof arg !== "function") {
|
|
48712
48729
|
offset = 1;
|
|
48713
|
-
|
|
48730
|
+
path53 = handler;
|
|
48714
48731
|
}
|
|
48715
48732
|
}
|
|
48716
48733
|
const callbacks = flatten.call(slice.call(arguments, offset), Infinity);
|
|
@@ -48722,8 +48739,8 @@ var require_router = __commonJS({
|
|
|
48722
48739
|
if (typeof fn !== "function") {
|
|
48723
48740
|
throw new TypeError("argument handler must be a function");
|
|
48724
48741
|
}
|
|
48725
|
-
debug("use %o %s",
|
|
48726
|
-
const layer = new Layer(
|
|
48742
|
+
debug("use %o %s", path53, fn.name || "<anonymous>");
|
|
48743
|
+
const layer = new Layer(path53, {
|
|
48727
48744
|
sensitive: this.caseSensitive,
|
|
48728
48745
|
strict: false,
|
|
48729
48746
|
end: false
|
|
@@ -48733,9 +48750,9 @@ var require_router = __commonJS({
|
|
|
48733
48750
|
}
|
|
48734
48751
|
return this;
|
|
48735
48752
|
};
|
|
48736
|
-
Router2.prototype.route = function route(
|
|
48737
|
-
const route2 = new Route2(
|
|
48738
|
-
const layer = new Layer(
|
|
48753
|
+
Router2.prototype.route = function route(path53) {
|
|
48754
|
+
const route2 = new Route2(path53);
|
|
48755
|
+
const layer = new Layer(path53, {
|
|
48739
48756
|
sensitive: this.caseSensitive,
|
|
48740
48757
|
strict: this.strict,
|
|
48741
48758
|
end: true
|
|
@@ -48748,8 +48765,8 @@ var require_router = __commonJS({
|
|
|
48748
48765
|
return route2;
|
|
48749
48766
|
};
|
|
48750
48767
|
methods.concat("all").forEach(function(method) {
|
|
48751
|
-
Router2.prototype[method] = function(
|
|
48752
|
-
const route = this.route(
|
|
48768
|
+
Router2.prototype[method] = function(path53) {
|
|
48769
|
+
const route = this.route(path53);
|
|
48753
48770
|
route[method].apply(route, slice.call(arguments, 1));
|
|
48754
48771
|
return this;
|
|
48755
48772
|
};
|
|
@@ -48778,9 +48795,9 @@ var require_router = __commonJS({
|
|
|
48778
48795
|
const fqdnIndex = url2.substring(0, pathLength).indexOf("://");
|
|
48779
48796
|
return fqdnIndex !== -1 ? url2.substring(0, url2.indexOf("/", 3 + fqdnIndex)) : void 0;
|
|
48780
48797
|
}
|
|
48781
|
-
function matchLayer(layer,
|
|
48798
|
+
function matchLayer(layer, path53) {
|
|
48782
48799
|
try {
|
|
48783
|
-
return layer.match(
|
|
48800
|
+
return layer.match(path53);
|
|
48784
48801
|
} catch (err) {
|
|
48785
48802
|
return err;
|
|
48786
48803
|
}
|
|
@@ -49008,7 +49025,7 @@ var require_application = __commonJS({
|
|
|
49008
49025
|
};
|
|
49009
49026
|
app.use = function use(fn) {
|
|
49010
49027
|
var offset = 0;
|
|
49011
|
-
var
|
|
49028
|
+
var path53 = "/";
|
|
49012
49029
|
if (typeof fn !== "function") {
|
|
49013
49030
|
var arg = fn;
|
|
49014
49031
|
while (Array.isArray(arg) && arg.length !== 0) {
|
|
@@ -49016,7 +49033,7 @@ var require_application = __commonJS({
|
|
|
49016
49033
|
}
|
|
49017
49034
|
if (typeof arg !== "function") {
|
|
49018
49035
|
offset = 1;
|
|
49019
|
-
|
|
49036
|
+
path53 = fn;
|
|
49020
49037
|
}
|
|
49021
49038
|
}
|
|
49022
49039
|
var fns = flatten.call(slice.call(arguments, offset), Infinity);
|
|
@@ -49026,12 +49043,12 @@ var require_application = __commonJS({
|
|
|
49026
49043
|
var router = this.router;
|
|
49027
49044
|
fns.forEach(function(fn2) {
|
|
49028
49045
|
if (!fn2 || !fn2.handle || !fn2.set) {
|
|
49029
|
-
return router.use(
|
|
49046
|
+
return router.use(path53, fn2);
|
|
49030
49047
|
}
|
|
49031
|
-
debug(".use app under %s",
|
|
49032
|
-
fn2.mountpath =
|
|
49048
|
+
debug(".use app under %s", path53);
|
|
49049
|
+
fn2.mountpath = path53;
|
|
49033
49050
|
fn2.parent = this;
|
|
49034
|
-
router.use(
|
|
49051
|
+
router.use(path53, function mounted_app(req, res, next) {
|
|
49035
49052
|
var orig = req.app;
|
|
49036
49053
|
fn2.handle(req, res, function(err) {
|
|
49037
49054
|
Object.setPrototypeOf(req, orig.request);
|
|
@@ -49043,8 +49060,8 @@ var require_application = __commonJS({
|
|
|
49043
49060
|
}, this);
|
|
49044
49061
|
return this;
|
|
49045
49062
|
};
|
|
49046
|
-
app.route = function route(
|
|
49047
|
-
return this.router.route(
|
|
49063
|
+
app.route = function route(path53) {
|
|
49064
|
+
return this.router.route(path53);
|
|
49048
49065
|
};
|
|
49049
49066
|
app.engine = function engine(ext, fn) {
|
|
49050
49067
|
if (typeof fn !== "function") {
|
|
@@ -49087,7 +49104,7 @@ var require_application = __commonJS({
|
|
|
49087
49104
|
}
|
|
49088
49105
|
return this;
|
|
49089
49106
|
};
|
|
49090
|
-
app.path = function
|
|
49107
|
+
app.path = function path53() {
|
|
49091
49108
|
return this.parent ? this.parent.path() + this.mountpath : "";
|
|
49092
49109
|
};
|
|
49093
49110
|
app.enabled = function enabled(setting) {
|
|
@@ -49103,17 +49120,17 @@ var require_application = __commonJS({
|
|
|
49103
49120
|
return this.set(setting, false);
|
|
49104
49121
|
};
|
|
49105
49122
|
methods.forEach(function(method) {
|
|
49106
|
-
app[method] = function(
|
|
49123
|
+
app[method] = function(path53) {
|
|
49107
49124
|
if (method === "get" && arguments.length === 1) {
|
|
49108
|
-
return this.set(
|
|
49125
|
+
return this.set(path53);
|
|
49109
49126
|
}
|
|
49110
|
-
var route = this.route(
|
|
49127
|
+
var route = this.route(path53);
|
|
49111
49128
|
route[method].apply(route, slice.call(arguments, 1));
|
|
49112
49129
|
return this;
|
|
49113
49130
|
};
|
|
49114
49131
|
});
|
|
49115
|
-
app.all = function all(
|
|
49116
|
-
var route = this.route(
|
|
49132
|
+
app.all = function all(path53) {
|
|
49133
|
+
var route = this.route(path53);
|
|
49117
49134
|
var args = slice.call(arguments, 1);
|
|
49118
49135
|
for (var i = 0; i < methods.length; i++) {
|
|
49119
49136
|
route[methods[i]].apply(route, args);
|
|
@@ -59147,11 +59164,11 @@ var require_mime_types3 = __commonJS({
|
|
|
59147
59164
|
}
|
|
59148
59165
|
return exts[0];
|
|
59149
59166
|
}
|
|
59150
|
-
function lookup(
|
|
59151
|
-
if (!
|
|
59167
|
+
function lookup(path53) {
|
|
59168
|
+
if (!path53 || typeof path53 !== "string") {
|
|
59152
59169
|
return false;
|
|
59153
59170
|
}
|
|
59154
|
-
var extension3 = extname6("x." +
|
|
59171
|
+
var extension3 = extname6("x." + path53).toLowerCase().slice(1);
|
|
59155
59172
|
if (!extension3) {
|
|
59156
59173
|
return false;
|
|
59157
59174
|
}
|
|
@@ -59528,7 +59545,7 @@ var require_request = __commonJS({
|
|
|
59528
59545
|
var subdomains2 = !isIP(hostname3) ? hostname3.split(".").reverse() : [hostname3];
|
|
59529
59546
|
return subdomains2.slice(offset);
|
|
59530
59547
|
});
|
|
59531
|
-
defineGetter(req, "path", function
|
|
59548
|
+
defineGetter(req, "path", function path53() {
|
|
59532
59549
|
return parse4(this).pathname;
|
|
59533
59550
|
});
|
|
59534
59551
|
defineGetter(req, "host", function host() {
|
|
@@ -59739,8 +59756,8 @@ var require_content_disposition = __commonJS({
|
|
|
59739
59756
|
this.type = type;
|
|
59740
59757
|
this.parameters = parameters;
|
|
59741
59758
|
}
|
|
59742
|
-
function basename14(
|
|
59743
|
-
const normalized =
|
|
59759
|
+
function basename14(path53) {
|
|
59760
|
+
const normalized = path53.replaceAll("\\", "/");
|
|
59744
59761
|
let end = normalized.length;
|
|
59745
59762
|
while (end > 0 && normalized[end - 1] === "/") {
|
|
59746
59763
|
end--;
|
|
@@ -69427,11 +69444,11 @@ var require_mime_types4 = __commonJS({
|
|
|
69427
69444
|
}
|
|
69428
69445
|
return exts[0];
|
|
69429
69446
|
}
|
|
69430
|
-
function lookup(
|
|
69431
|
-
if (!
|
|
69447
|
+
function lookup(path53) {
|
|
69448
|
+
if (!path53 || typeof path53 !== "string") {
|
|
69432
69449
|
return false;
|
|
69433
69450
|
}
|
|
69434
|
-
var extension3 = extname6("x." +
|
|
69451
|
+
var extension3 = extname6("x." + path53).toLowerCase().slice(1);
|
|
69435
69452
|
if (!extension3) {
|
|
69436
69453
|
return false;
|
|
69437
69454
|
}
|
|
@@ -69491,27 +69508,27 @@ var require_send = __commonJS({
|
|
|
69491
69508
|
var ms = require_ms();
|
|
69492
69509
|
var onFinished = require_on_finished();
|
|
69493
69510
|
var parseRange = require_range_parser();
|
|
69494
|
-
var
|
|
69511
|
+
var path53 = require("path");
|
|
69495
69512
|
var statuses = require_statuses();
|
|
69496
69513
|
var Stream2 = require("stream");
|
|
69497
69514
|
var util = require("util");
|
|
69498
|
-
var extname6 =
|
|
69499
|
-
var join55 =
|
|
69500
|
-
var normalize =
|
|
69501
|
-
var resolve14 =
|
|
69502
|
-
var sep5 =
|
|
69515
|
+
var extname6 = path53.extname;
|
|
69516
|
+
var join55 = path53.join;
|
|
69517
|
+
var normalize = path53.normalize;
|
|
69518
|
+
var resolve14 = path53.resolve;
|
|
69519
|
+
var sep5 = path53.sep;
|
|
69503
69520
|
var BYTES_RANGE_REGEXP = /^ *bytes=/;
|
|
69504
69521
|
var MAX_MAXAGE = 60 * 60 * 24 * 365 * 1e3;
|
|
69505
69522
|
var UP_PATH_REGEXP = /(?:^|[\\/])\.\.(?:[\\/]|$)/;
|
|
69506
69523
|
module2.exports = send;
|
|
69507
|
-
function send(req,
|
|
69508
|
-
return new SendStream(req,
|
|
69524
|
+
function send(req, path54, options) {
|
|
69525
|
+
return new SendStream(req, path54, options);
|
|
69509
69526
|
}
|
|
69510
|
-
function SendStream(req,
|
|
69527
|
+
function SendStream(req, path54, options) {
|
|
69511
69528
|
Stream2.call(this);
|
|
69512
69529
|
var opts = options || {};
|
|
69513
69530
|
this.options = opts;
|
|
69514
|
-
this.path =
|
|
69531
|
+
this.path = path54;
|
|
69515
69532
|
this.req = req;
|
|
69516
69533
|
this._acceptRanges = opts.acceptRanges !== void 0 ? Boolean(opts.acceptRanges) : true;
|
|
69517
69534
|
this._cacheControl = opts.cacheControl !== void 0 ? Boolean(opts.cacheControl) : true;
|
|
@@ -69625,10 +69642,10 @@ var require_send = __commonJS({
|
|
|
69625
69642
|
var lastModified = this.res.getHeader("Last-Modified");
|
|
69626
69643
|
return parseHttpDate(lastModified) <= parseHttpDate(ifRange);
|
|
69627
69644
|
};
|
|
69628
|
-
SendStream.prototype.redirect = function redirect(
|
|
69645
|
+
SendStream.prototype.redirect = function redirect(path54) {
|
|
69629
69646
|
var res = this.res;
|
|
69630
69647
|
if (hasListeners(this, "directory")) {
|
|
69631
|
-
this.emit("directory", res,
|
|
69648
|
+
this.emit("directory", res, path54);
|
|
69632
69649
|
return;
|
|
69633
69650
|
}
|
|
69634
69651
|
if (this.hasTrailingSlash()) {
|
|
@@ -69648,38 +69665,38 @@ var require_send = __commonJS({
|
|
|
69648
69665
|
SendStream.prototype.pipe = function pipe2(res) {
|
|
69649
69666
|
var root = this._root;
|
|
69650
69667
|
this.res = res;
|
|
69651
|
-
var
|
|
69652
|
-
if (
|
|
69668
|
+
var path54 = decode9(this.path);
|
|
69669
|
+
if (path54 === -1) {
|
|
69653
69670
|
this.error(400);
|
|
69654
69671
|
return res;
|
|
69655
69672
|
}
|
|
69656
|
-
if (~
|
|
69673
|
+
if (~path54.indexOf("\0")) {
|
|
69657
69674
|
this.error(400);
|
|
69658
69675
|
return res;
|
|
69659
69676
|
}
|
|
69660
69677
|
var parts2;
|
|
69661
69678
|
if (root !== null) {
|
|
69662
|
-
if (
|
|
69663
|
-
|
|
69679
|
+
if (path54) {
|
|
69680
|
+
path54 = normalize("." + sep5 + path54);
|
|
69664
69681
|
}
|
|
69665
|
-
if (UP_PATH_REGEXP.test(
|
|
69666
|
-
debug('malicious path "%s"',
|
|
69682
|
+
if (UP_PATH_REGEXP.test(path54)) {
|
|
69683
|
+
debug('malicious path "%s"', path54);
|
|
69667
69684
|
this.error(403);
|
|
69668
69685
|
return res;
|
|
69669
69686
|
}
|
|
69670
|
-
parts2 =
|
|
69671
|
-
|
|
69687
|
+
parts2 = path54.split(sep5);
|
|
69688
|
+
path54 = normalize(join55(root, path54));
|
|
69672
69689
|
} else {
|
|
69673
|
-
if (UP_PATH_REGEXP.test(
|
|
69674
|
-
debug('malicious path "%s"',
|
|
69690
|
+
if (UP_PATH_REGEXP.test(path54)) {
|
|
69691
|
+
debug('malicious path "%s"', path54);
|
|
69675
69692
|
this.error(403);
|
|
69676
69693
|
return res;
|
|
69677
69694
|
}
|
|
69678
|
-
parts2 = normalize(
|
|
69679
|
-
|
|
69695
|
+
parts2 = normalize(path54).split(sep5);
|
|
69696
|
+
path54 = resolve14(path54);
|
|
69680
69697
|
}
|
|
69681
69698
|
if (containsDotFile(parts2)) {
|
|
69682
|
-
debug('%s dotfile "%s"', this._dotfiles,
|
|
69699
|
+
debug('%s dotfile "%s"', this._dotfiles, path54);
|
|
69683
69700
|
switch (this._dotfiles) {
|
|
69684
69701
|
case "allow":
|
|
69685
69702
|
break;
|
|
@@ -69693,13 +69710,13 @@ var require_send = __commonJS({
|
|
|
69693
69710
|
}
|
|
69694
69711
|
}
|
|
69695
69712
|
if (this._index.length && this.hasTrailingSlash()) {
|
|
69696
|
-
this.sendIndex(
|
|
69713
|
+
this.sendIndex(path54);
|
|
69697
69714
|
return res;
|
|
69698
69715
|
}
|
|
69699
|
-
this.sendFile(
|
|
69716
|
+
this.sendFile(path54);
|
|
69700
69717
|
return res;
|
|
69701
69718
|
};
|
|
69702
|
-
SendStream.prototype.send = function send2(
|
|
69719
|
+
SendStream.prototype.send = function send2(path54, stat6) {
|
|
69703
69720
|
var len = stat6.size;
|
|
69704
69721
|
var options = this.options;
|
|
69705
69722
|
var opts = {};
|
|
@@ -69711,9 +69728,9 @@ var require_send = __commonJS({
|
|
|
69711
69728
|
this.headersAlreadySent();
|
|
69712
69729
|
return;
|
|
69713
69730
|
}
|
|
69714
|
-
debug('pipe "%s"',
|
|
69715
|
-
this.setHeader(
|
|
69716
|
-
this.type(
|
|
69731
|
+
debug('pipe "%s"', path54);
|
|
69732
|
+
this.setHeader(path54, stat6);
|
|
69733
|
+
this.type(path54);
|
|
69717
69734
|
if (this.isConditionalGET()) {
|
|
69718
69735
|
if (this.isPreconditionFailure()) {
|
|
69719
69736
|
this.error(412);
|
|
@@ -69762,28 +69779,28 @@ var require_send = __commonJS({
|
|
|
69762
69779
|
res.end();
|
|
69763
69780
|
return;
|
|
69764
69781
|
}
|
|
69765
|
-
this.stream(
|
|
69782
|
+
this.stream(path54, opts);
|
|
69766
69783
|
};
|
|
69767
|
-
SendStream.prototype.sendFile = function sendFile(
|
|
69784
|
+
SendStream.prototype.sendFile = function sendFile(path54) {
|
|
69768
69785
|
var i = 0;
|
|
69769
69786
|
var self2 = this;
|
|
69770
|
-
debug('stat "%s"',
|
|
69771
|
-
fs69.stat(
|
|
69772
|
-
var pathEndsWithSep =
|
|
69773
|
-
if (err && err.code === "ENOENT" && !extname6(
|
|
69787
|
+
debug('stat "%s"', path54);
|
|
69788
|
+
fs69.stat(path54, function onstat(err, stat6) {
|
|
69789
|
+
var pathEndsWithSep = path54[path54.length - 1] === sep5;
|
|
69790
|
+
if (err && err.code === "ENOENT" && !extname6(path54) && !pathEndsWithSep) {
|
|
69774
69791
|
return next(err);
|
|
69775
69792
|
}
|
|
69776
69793
|
if (err) return self2.onStatError(err);
|
|
69777
|
-
if (stat6.isDirectory()) return self2.redirect(
|
|
69794
|
+
if (stat6.isDirectory()) return self2.redirect(path54);
|
|
69778
69795
|
if (pathEndsWithSep) return self2.error(404);
|
|
69779
|
-
self2.emit("file",
|
|
69780
|
-
self2.send(
|
|
69796
|
+
self2.emit("file", path54, stat6);
|
|
69797
|
+
self2.send(path54, stat6);
|
|
69781
69798
|
});
|
|
69782
69799
|
function next(err) {
|
|
69783
69800
|
if (self2._extensions.length <= i) {
|
|
69784
69801
|
return err ? self2.onStatError(err) : self2.error(404);
|
|
69785
69802
|
}
|
|
69786
|
-
var p =
|
|
69803
|
+
var p = path54 + "." + self2._extensions[i++];
|
|
69787
69804
|
debug('stat "%s"', p);
|
|
69788
69805
|
fs69.stat(p, function(err2, stat6) {
|
|
69789
69806
|
if (err2) return next(err2);
|
|
@@ -69793,7 +69810,7 @@ var require_send = __commonJS({
|
|
|
69793
69810
|
});
|
|
69794
69811
|
}
|
|
69795
69812
|
};
|
|
69796
|
-
SendStream.prototype.sendIndex = function sendIndex(
|
|
69813
|
+
SendStream.prototype.sendIndex = function sendIndex(path54) {
|
|
69797
69814
|
var i = -1;
|
|
69798
69815
|
var self2 = this;
|
|
69799
69816
|
function next(err) {
|
|
@@ -69801,7 +69818,7 @@ var require_send = __commonJS({
|
|
|
69801
69818
|
if (err) return self2.onStatError(err);
|
|
69802
69819
|
return self2.error(404);
|
|
69803
69820
|
}
|
|
69804
|
-
var p = join55(
|
|
69821
|
+
var p = join55(path54, self2._index[i]);
|
|
69805
69822
|
debug('stat "%s"', p);
|
|
69806
69823
|
fs69.stat(p, function(err2, stat6) {
|
|
69807
69824
|
if (err2) return next(err2);
|
|
@@ -69812,10 +69829,10 @@ var require_send = __commonJS({
|
|
|
69812
69829
|
}
|
|
69813
69830
|
next();
|
|
69814
69831
|
};
|
|
69815
|
-
SendStream.prototype.stream = function stream(
|
|
69832
|
+
SendStream.prototype.stream = function stream(path54, options) {
|
|
69816
69833
|
var self2 = this;
|
|
69817
69834
|
var res = this.res;
|
|
69818
|
-
var stream2 = fs69.createReadStream(
|
|
69835
|
+
var stream2 = fs69.createReadStream(path54, options);
|
|
69819
69836
|
this.emit("stream", stream2);
|
|
69820
69837
|
stream2.pipe(res);
|
|
69821
69838
|
function cleanup() {
|
|
@@ -69830,17 +69847,17 @@ var require_send = __commonJS({
|
|
|
69830
69847
|
self2.emit("end");
|
|
69831
69848
|
});
|
|
69832
69849
|
};
|
|
69833
|
-
SendStream.prototype.type = function type(
|
|
69850
|
+
SendStream.prototype.type = function type(path54) {
|
|
69834
69851
|
var res = this.res;
|
|
69835
69852
|
if (res.getHeader("Content-Type")) return;
|
|
69836
|
-
var ext = extname6(
|
|
69853
|
+
var ext = extname6(path54);
|
|
69837
69854
|
var type2 = mime.contentType(ext) || "application/octet-stream";
|
|
69838
69855
|
debug("content-type %s", type2);
|
|
69839
69856
|
res.setHeader("Content-Type", type2);
|
|
69840
69857
|
};
|
|
69841
|
-
SendStream.prototype.setHeader = function setHeader(
|
|
69858
|
+
SendStream.prototype.setHeader = function setHeader(path54, stat6) {
|
|
69842
69859
|
var res = this.res;
|
|
69843
|
-
this.emit("headers", res,
|
|
69860
|
+
this.emit("headers", res, path54, stat6);
|
|
69844
69861
|
if (this._acceptRanges && !res.getHeader("Accept-Ranges")) {
|
|
69845
69862
|
debug("accept ranges");
|
|
69846
69863
|
res.setHeader("Accept-Ranges", "bytes");
|
|
@@ -69898,9 +69915,9 @@ var require_send = __commonJS({
|
|
|
69898
69915
|
}
|
|
69899
69916
|
return err instanceof Error ? createError(status, err, { expose: false }) : createError(status, err);
|
|
69900
69917
|
}
|
|
69901
|
-
function decode9(
|
|
69918
|
+
function decode9(path54) {
|
|
69902
69919
|
try {
|
|
69903
|
-
return decodeURIComponent(
|
|
69920
|
+
return decodeURIComponent(path54);
|
|
69904
69921
|
} catch (err) {
|
|
69905
69922
|
return -1;
|
|
69906
69923
|
}
|
|
@@ -70044,7 +70061,7 @@ var require_response = __commonJS({
|
|
|
70044
70061
|
var http6 = require("node:http");
|
|
70045
70062
|
var onFinished = require_on_finished();
|
|
70046
70063
|
var mime = require_mime_types2();
|
|
70047
|
-
var
|
|
70064
|
+
var path53 = require("node:path");
|
|
70048
70065
|
var pathIsAbsolute = require("node:path").isAbsolute;
|
|
70049
70066
|
var statuses = require_statuses();
|
|
70050
70067
|
var sign = require_cookie_signature().sign;
|
|
@@ -70053,8 +70070,8 @@ var require_response = __commonJS({
|
|
|
70053
70070
|
var setCharset = require_utils3().setCharset;
|
|
70054
70071
|
var cookie = require_cookie();
|
|
70055
70072
|
var send = require_send();
|
|
70056
|
-
var extname6 =
|
|
70057
|
-
var resolve14 =
|
|
70073
|
+
var extname6 = path53.extname;
|
|
70074
|
+
var resolve14 = path53.resolve;
|
|
70058
70075
|
var vary = require_vary();
|
|
70059
70076
|
var { Buffer: Buffer2 } = require("node:buffer");
|
|
70060
70077
|
var res = Object.create(http6.ServerResponse.prototype);
|
|
@@ -70200,26 +70217,26 @@ var require_response = __commonJS({
|
|
|
70200
70217
|
this.type("txt");
|
|
70201
70218
|
return this.send(body);
|
|
70202
70219
|
};
|
|
70203
|
-
res.sendFile = function sendFile(
|
|
70220
|
+
res.sendFile = function sendFile(path54, options, callback) {
|
|
70204
70221
|
var done = callback;
|
|
70205
70222
|
var req = this.req;
|
|
70206
70223
|
var res2 = this;
|
|
70207
70224
|
var next = req.next;
|
|
70208
70225
|
var opts = options || {};
|
|
70209
|
-
if (!
|
|
70226
|
+
if (!path54) {
|
|
70210
70227
|
throw new TypeError("path argument is required to res.sendFile");
|
|
70211
70228
|
}
|
|
70212
|
-
if (typeof
|
|
70229
|
+
if (typeof path54 !== "string") {
|
|
70213
70230
|
throw new TypeError("path must be a string to res.sendFile");
|
|
70214
70231
|
}
|
|
70215
70232
|
if (typeof options === "function") {
|
|
70216
70233
|
done = options;
|
|
70217
70234
|
opts = {};
|
|
70218
70235
|
}
|
|
70219
|
-
if (!opts.root && !pathIsAbsolute(
|
|
70236
|
+
if (!opts.root && !pathIsAbsolute(path54)) {
|
|
70220
70237
|
throw new TypeError("path must be absolute or specify root to res.sendFile");
|
|
70221
70238
|
}
|
|
70222
|
-
var pathname = encodeURI(
|
|
70239
|
+
var pathname = encodeURI(path54);
|
|
70223
70240
|
opts.etag = this.app.enabled("etag");
|
|
70224
70241
|
var file2 = send(req, pathname, opts);
|
|
70225
70242
|
sendfile(res2, file2, opts, function(err) {
|
|
@@ -70230,7 +70247,7 @@ var require_response = __commonJS({
|
|
|
70230
70247
|
}
|
|
70231
70248
|
});
|
|
70232
70249
|
};
|
|
70233
|
-
res.download = function download(
|
|
70250
|
+
res.download = function download(path54, filename, options, callback) {
|
|
70234
70251
|
var done = callback;
|
|
70235
70252
|
var name = filename;
|
|
70236
70253
|
var opts = options || null;
|
|
@@ -70247,7 +70264,7 @@ var require_response = __commonJS({
|
|
|
70247
70264
|
opts = filename;
|
|
70248
70265
|
}
|
|
70249
70266
|
var headers = {
|
|
70250
|
-
"Content-Disposition": contentDisposition(name ||
|
|
70267
|
+
"Content-Disposition": contentDisposition(name || path54)
|
|
70251
70268
|
};
|
|
70252
70269
|
if (opts && opts.headers) {
|
|
70253
70270
|
var keys = Object.keys(opts.headers);
|
|
@@ -70260,7 +70277,7 @@ var require_response = __commonJS({
|
|
|
70260
70277
|
}
|
|
70261
70278
|
opts = Object.create(opts);
|
|
70262
70279
|
opts.headers = headers;
|
|
70263
|
-
var fullPath = !opts.root ? resolve14(
|
|
70280
|
+
var fullPath = !opts.root ? resolve14(path54) : path54;
|
|
70264
70281
|
return this.sendFile(fullPath, opts, done);
|
|
70265
70282
|
};
|
|
70266
70283
|
res.contentType = res.type = function contentType(type) {
|
|
@@ -70543,11 +70560,11 @@ var require_serve_static = __commonJS({
|
|
|
70543
70560
|
}
|
|
70544
70561
|
var forwardError = !fallthrough;
|
|
70545
70562
|
var originalUrl = parseUrl.original(req);
|
|
70546
|
-
var
|
|
70547
|
-
if (
|
|
70548
|
-
|
|
70563
|
+
var path53 = parseUrl(req).pathname;
|
|
70564
|
+
if (path53 === "/" && originalUrl.pathname.substr(-1) !== "/") {
|
|
70565
|
+
path53 = "";
|
|
70549
70566
|
}
|
|
70550
|
-
var stream = send(req,
|
|
70567
|
+
var stream = send(req, path53, opts);
|
|
70551
70568
|
stream.on("directory", onDirectory);
|
|
70552
70569
|
if (setHeaders) {
|
|
70553
70570
|
stream.on("headers", setHeaders);
|
|
@@ -77641,8 +77658,8 @@ __export(adb_exports, {
|
|
|
77641
77658
|
waitForBootCompleted: () => waitForBootCompleted
|
|
77642
77659
|
});
|
|
77643
77660
|
async function resolveAdbOrThrow() {
|
|
77644
|
-
const
|
|
77645
|
-
if (!
|
|
77661
|
+
const path53 = await resolveAndroidBinary("adb");
|
|
77662
|
+
if (!path53) {
|
|
77646
77663
|
throw new FailureError(
|
|
77647
77664
|
"`adb` not found on PATH or under `$ANDROID_HOME/platform-tools`. Install Android SDK Platform Tools or set `$ANDROID_HOME` to your SDK root.",
|
|
77648
77665
|
{
|
|
@@ -77653,11 +77670,11 @@ async function resolveAdbOrThrow() {
|
|
|
77653
77670
|
}
|
|
77654
77671
|
);
|
|
77655
77672
|
}
|
|
77656
|
-
return
|
|
77673
|
+
return path53;
|
|
77657
77674
|
}
|
|
77658
77675
|
async function resolveEmulatorOrThrow() {
|
|
77659
|
-
const
|
|
77660
|
-
if (!
|
|
77676
|
+
const path53 = await resolveAndroidBinary("emulator");
|
|
77677
|
+
if (!path53) {
|
|
77661
77678
|
throw new FailureError(
|
|
77662
77679
|
"`emulator` not found on PATH or under `$ANDROID_HOME/emulator`. Install the Android Emulator package or set `$ANDROID_HOME` to your SDK root.",
|
|
77663
77680
|
{
|
|
@@ -77668,7 +77685,7 @@ async function resolveEmulatorOrThrow() {
|
|
|
77668
77685
|
}
|
|
77669
77686
|
);
|
|
77670
77687
|
}
|
|
77671
|
-
return
|
|
77688
|
+
return path53;
|
|
77672
77689
|
}
|
|
77673
77690
|
async function emulatorSupportsFlag(flag, options = {}) {
|
|
77674
77691
|
let emulatorPath;
|
|
@@ -78102,7 +78119,7 @@ var require_safe_json_stringify = __commonJS({
|
|
|
78102
78119
|
var require_ncp = __commonJS({
|
|
78103
78120
|
"../../node_modules/ncp/lib/ncp.js"(exports2, module2) {
|
|
78104
78121
|
var fs69 = require("fs");
|
|
78105
|
-
var
|
|
78122
|
+
var path53 = require("path");
|
|
78106
78123
|
module2.exports = ncp;
|
|
78107
78124
|
ncp.ncp = ncp;
|
|
78108
78125
|
function ncp(source, dest, options, callback) {
|
|
@@ -78111,7 +78128,7 @@ var require_ncp = __commonJS({
|
|
|
78111
78128
|
cback = options;
|
|
78112
78129
|
options = {};
|
|
78113
78130
|
}
|
|
78114
|
-
var basePath = process.cwd(), currentPath =
|
|
78131
|
+
var basePath = process.cwd(), currentPath = path53.resolve(basePath, source), targetPath = path53.resolve(basePath, dest), filter = options.filter, rename2 = options.rename, transform2 = options.transform, clobber = options.clobber !== false, modified = options.modified, dereference = options.dereference, errs = null, started = 0, finished = 0, running = 0, limit = options.limit || ncp.limit || 16;
|
|
78115
78132
|
limit = limit < 1 ? 1 : limit > 512 ? 512 : limit;
|
|
78116
78133
|
startCopy(currentPath);
|
|
78117
78134
|
function startCopy(source2) {
|
|
@@ -78230,7 +78247,7 @@ var require_ncp = __commonJS({
|
|
|
78230
78247
|
return onError(err);
|
|
78231
78248
|
}
|
|
78232
78249
|
items.forEach(function(item) {
|
|
78233
|
-
startCopy(
|
|
78250
|
+
startCopy(path53.join(dir, item));
|
|
78234
78251
|
});
|
|
78235
78252
|
return cb();
|
|
78236
78253
|
});
|
|
@@ -78246,7 +78263,7 @@ var require_ncp = __commonJS({
|
|
|
78246
78263
|
}
|
|
78247
78264
|
function checkLink(resolvedPath, target) {
|
|
78248
78265
|
if (dereference) {
|
|
78249
|
-
resolvedPath =
|
|
78266
|
+
resolvedPath = path53.resolve(basePath, resolvedPath);
|
|
78250
78267
|
}
|
|
78251
78268
|
isWritable2(target, function(writable) {
|
|
78252
78269
|
if (writable) {
|
|
@@ -78257,7 +78274,7 @@ var require_ncp = __commonJS({
|
|
|
78257
78274
|
return onError(err);
|
|
78258
78275
|
}
|
|
78259
78276
|
if (dereference) {
|
|
78260
|
-
targetDest =
|
|
78277
|
+
targetDest = path53.resolve(basePath, targetDest);
|
|
78261
78278
|
}
|
|
78262
78279
|
if (targetDest === resolvedPath) {
|
|
78263
78280
|
return cb();
|
|
@@ -78276,8 +78293,8 @@ var require_ncp = __commonJS({
|
|
|
78276
78293
|
return cb();
|
|
78277
78294
|
});
|
|
78278
78295
|
}
|
|
78279
|
-
function isWritable2(
|
|
78280
|
-
fs69.lstat(
|
|
78296
|
+
function isWritable2(path54, done) {
|
|
78297
|
+
fs69.lstat(path54, function(err) {
|
|
78281
78298
|
if (err) {
|
|
78282
78299
|
if (err.code === "ENOENT") return done(true);
|
|
78283
78300
|
return done(false);
|
|
@@ -78540,7 +78557,7 @@ var require_minimatch = __commonJS({
|
|
|
78540
78557
|
"../../node_modules/glob/node_modules/minimatch/minimatch.js"(exports2, module2) {
|
|
78541
78558
|
module2.exports = minimatch;
|
|
78542
78559
|
minimatch.Minimatch = Minimatch;
|
|
78543
|
-
var
|
|
78560
|
+
var path53 = (function() {
|
|
78544
78561
|
try {
|
|
78545
78562
|
return require("path");
|
|
78546
78563
|
} catch (e) {
|
|
@@ -78548,7 +78565,7 @@ var require_minimatch = __commonJS({
|
|
|
78548
78565
|
})() || {
|
|
78549
78566
|
sep: "/"
|
|
78550
78567
|
};
|
|
78551
|
-
minimatch.sep =
|
|
78568
|
+
minimatch.sep = path53.sep;
|
|
78552
78569
|
var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {};
|
|
78553
78570
|
var expand = require_brace_expansion();
|
|
78554
78571
|
var plTypes = {
|
|
@@ -78637,8 +78654,8 @@ var require_minimatch = __commonJS({
|
|
|
78637
78654
|
assertValidPattern(pattern);
|
|
78638
78655
|
if (!options) options = {};
|
|
78639
78656
|
pattern = pattern.trim();
|
|
78640
|
-
if (!options.allowWindowsEscape &&
|
|
78641
|
-
pattern = pattern.split(
|
|
78657
|
+
if (!options.allowWindowsEscape && path53.sep !== "/") {
|
|
78658
|
+
pattern = pattern.split(path53.sep).join("/");
|
|
78642
78659
|
}
|
|
78643
78660
|
this.options = options;
|
|
78644
78661
|
this.maxGlobstarRecursion = options.maxGlobstarRecursion !== void 0 ? options.maxGlobstarRecursion : 200;
|
|
@@ -79009,8 +79026,8 @@ var require_minimatch = __commonJS({
|
|
|
79009
79026
|
if (this.empty) return f === "";
|
|
79010
79027
|
if (f === "/" && partial2) return true;
|
|
79011
79028
|
var options = this.options;
|
|
79012
|
-
if (
|
|
79013
|
-
f = f.split(
|
|
79029
|
+
if (path53.sep !== "/") {
|
|
79030
|
+
f = f.split(path53.sep).join("/");
|
|
79014
79031
|
}
|
|
79015
79032
|
f = f.split(slashSplit);
|
|
79016
79033
|
this.debug(this.pattern, "split", f);
|
|
@@ -79211,18 +79228,18 @@ var require_minimatch = __commonJS({
|
|
|
79211
79228
|
var require_path_is_absolute = __commonJS({
|
|
79212
79229
|
"../../node_modules/path-is-absolute/index.js"(exports2, module2) {
|
|
79213
79230
|
"use strict";
|
|
79214
|
-
function
|
|
79215
|
-
return
|
|
79231
|
+
function posix8(path53) {
|
|
79232
|
+
return path53.charAt(0) === "/";
|
|
79216
79233
|
}
|
|
79217
|
-
function win322(
|
|
79234
|
+
function win322(path53) {
|
|
79218
79235
|
var splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/;
|
|
79219
|
-
var result = splitDeviceRe.exec(
|
|
79236
|
+
var result = splitDeviceRe.exec(path53);
|
|
79220
79237
|
var device = result[1] || "";
|
|
79221
79238
|
var isUnc = Boolean(device && device.charAt(1) !== ":");
|
|
79222
79239
|
return Boolean(result[2] || isUnc);
|
|
79223
79240
|
}
|
|
79224
|
-
module2.exports = process.platform === "win32" ? win322 :
|
|
79225
|
-
module2.exports.posix =
|
|
79241
|
+
module2.exports = process.platform === "win32" ? win322 : posix8;
|
|
79242
|
+
module2.exports.posix = posix8;
|
|
79226
79243
|
module2.exports.win32 = win322;
|
|
79227
79244
|
}
|
|
79228
79245
|
});
|
|
@@ -79242,7 +79259,7 @@ var require_common2 = __commonJS({
|
|
|
79242
79259
|
function ownProp(obj, field) {
|
|
79243
79260
|
return Object.prototype.hasOwnProperty.call(obj, field);
|
|
79244
79261
|
}
|
|
79245
|
-
var
|
|
79262
|
+
var path53 = require("path");
|
|
79246
79263
|
var minimatch = require_minimatch();
|
|
79247
79264
|
var isAbsolute9 = require_path_is_absolute();
|
|
79248
79265
|
var Minimatch = minimatch.Minimatch;
|
|
@@ -79309,10 +79326,10 @@ var require_common2 = __commonJS({
|
|
|
79309
79326
|
self2.cwd = cwd;
|
|
79310
79327
|
else {
|
|
79311
79328
|
self2.cwd = options.cwd;
|
|
79312
|
-
self2.changedCwd =
|
|
79329
|
+
self2.changedCwd = path53.resolve(options.cwd) !== cwd;
|
|
79313
79330
|
}
|
|
79314
|
-
self2.root = options.root ||
|
|
79315
|
-
self2.root =
|
|
79331
|
+
self2.root = options.root || path53.resolve(self2.cwd, "/");
|
|
79332
|
+
self2.root = path53.resolve(self2.root);
|
|
79316
79333
|
if (process.platform === "win32")
|
|
79317
79334
|
self2.root = self2.root.replace(/\\/g, "/");
|
|
79318
79335
|
self2.nomount = !!options.nomount;
|
|
@@ -79386,28 +79403,28 @@ var require_common2 = __commonJS({
|
|
|
79386
79403
|
function makeAbs(self2, f) {
|
|
79387
79404
|
var abs = f;
|
|
79388
79405
|
if (f.charAt(0) === "/") {
|
|
79389
|
-
abs =
|
|
79406
|
+
abs = path53.join(self2.root, f);
|
|
79390
79407
|
} else if (isAbsolute9(f) || f === "") {
|
|
79391
79408
|
abs = f;
|
|
79392
79409
|
} else if (self2.changedCwd) {
|
|
79393
|
-
abs =
|
|
79410
|
+
abs = path53.resolve(self2.cwd, f);
|
|
79394
79411
|
} else {
|
|
79395
|
-
abs =
|
|
79412
|
+
abs = path53.resolve(f);
|
|
79396
79413
|
}
|
|
79397
79414
|
return abs;
|
|
79398
79415
|
}
|
|
79399
|
-
function isIgnored(self2,
|
|
79416
|
+
function isIgnored(self2, path54) {
|
|
79400
79417
|
if (!self2.ignore.length)
|
|
79401
79418
|
return false;
|
|
79402
79419
|
return self2.ignore.some(function(item) {
|
|
79403
|
-
return item.matcher.match(
|
|
79420
|
+
return item.matcher.match(path54) || !!(item.gmatcher && item.gmatcher.match(path54));
|
|
79404
79421
|
});
|
|
79405
79422
|
}
|
|
79406
|
-
function childrenIgnored(self2,
|
|
79423
|
+
function childrenIgnored(self2, path54) {
|
|
79407
79424
|
if (!self2.ignore.length)
|
|
79408
79425
|
return false;
|
|
79409
79426
|
return self2.ignore.some(function(item) {
|
|
79410
|
-
return !!(item.gmatcher && item.gmatcher.match(
|
|
79427
|
+
return !!(item.gmatcher && item.gmatcher.match(path54));
|
|
79411
79428
|
});
|
|
79412
79429
|
}
|
|
79413
79430
|
}
|
|
@@ -79423,7 +79440,7 @@ var require_sync = __commonJS({
|
|
|
79423
79440
|
var Minimatch = minimatch.Minimatch;
|
|
79424
79441
|
var Glob = require_glob().Glob;
|
|
79425
79442
|
var util = require("util");
|
|
79426
|
-
var
|
|
79443
|
+
var path53 = require("path");
|
|
79427
79444
|
var assert2 = require("assert");
|
|
79428
79445
|
var isAbsolute9 = require_path_is_absolute();
|
|
79429
79446
|
var common = require_common2();
|
|
@@ -79551,7 +79568,7 @@ var require_sync = __commonJS({
|
|
|
79551
79568
|
e = prefix + e;
|
|
79552
79569
|
}
|
|
79553
79570
|
if (e.charAt(0) === "/" && !this.nomount) {
|
|
79554
|
-
e =
|
|
79571
|
+
e = path53.join(this.root, e);
|
|
79555
79572
|
}
|
|
79556
79573
|
this.matches[index][e] = true;
|
|
79557
79574
|
}
|
|
@@ -79688,9 +79705,9 @@ var require_sync = __commonJS({
|
|
|
79688
79705
|
if (prefix && isAbsolute9(prefix) && !this.nomount) {
|
|
79689
79706
|
var trail = /[\/\\]$/.test(prefix);
|
|
79690
79707
|
if (prefix.charAt(0) === "/") {
|
|
79691
|
-
prefix =
|
|
79708
|
+
prefix = path53.join(this.root, prefix);
|
|
79692
79709
|
} else {
|
|
79693
|
-
prefix =
|
|
79710
|
+
prefix = path53.resolve(this.root, prefix);
|
|
79694
79711
|
if (trail)
|
|
79695
79712
|
prefix += "/";
|
|
79696
79713
|
}
|
|
@@ -79803,7 +79820,7 @@ var require_glob = __commonJS({
|
|
|
79803
79820
|
var Minimatch = minimatch.Minimatch;
|
|
79804
79821
|
var inherits = require_inherits();
|
|
79805
79822
|
var EE = require("events").EventEmitter;
|
|
79806
|
-
var
|
|
79823
|
+
var path53 = require("path");
|
|
79807
79824
|
var assert2 = require("assert");
|
|
79808
79825
|
var isAbsolute9 = require_path_is_absolute();
|
|
79809
79826
|
var globSync = require_sync();
|
|
@@ -80076,7 +80093,7 @@ var require_glob = __commonJS({
|
|
|
80076
80093
|
e = prefix + e;
|
|
80077
80094
|
}
|
|
80078
80095
|
if (e.charAt(0) === "/" && !this.nomount) {
|
|
80079
|
-
e =
|
|
80096
|
+
e = path53.join(this.root, e);
|
|
80080
80097
|
}
|
|
80081
80098
|
this._emitMatch(index, e);
|
|
80082
80099
|
}
|
|
@@ -80255,9 +80272,9 @@ var require_glob = __commonJS({
|
|
|
80255
80272
|
if (prefix && isAbsolute9(prefix) && !this.nomount) {
|
|
80256
80273
|
var trail = /[\/\\]$/.test(prefix);
|
|
80257
80274
|
if (prefix.charAt(0) === "/") {
|
|
80258
|
-
prefix =
|
|
80275
|
+
prefix = path53.join(this.root, prefix);
|
|
80259
80276
|
} else {
|
|
80260
|
-
prefix =
|
|
80277
|
+
prefix = path53.resolve(this.root, prefix);
|
|
80261
80278
|
if (trail)
|
|
80262
80279
|
prefix += "/";
|
|
80263
80280
|
}
|
|
@@ -80335,7 +80352,7 @@ var require_rimraf = __commonJS({
|
|
|
80335
80352
|
module2.exports = rimraf;
|
|
80336
80353
|
rimraf.sync = rimrafSync;
|
|
80337
80354
|
var assert2 = require("assert");
|
|
80338
|
-
var
|
|
80355
|
+
var path53 = require("path");
|
|
80339
80356
|
var fs69 = require("fs");
|
|
80340
80357
|
var glob = require_glob();
|
|
80341
80358
|
var globOpts = {
|
|
@@ -80514,7 +80531,7 @@ var require_rimraf = __commonJS({
|
|
|
80514
80531
|
return options.rmdir(p, cb);
|
|
80515
80532
|
var errState;
|
|
80516
80533
|
files.forEach(function(f) {
|
|
80517
|
-
rimraf(
|
|
80534
|
+
rimraf(path53.join(p, f), options, function(er2) {
|
|
80518
80535
|
if (errState)
|
|
80519
80536
|
return;
|
|
80520
80537
|
if (er2)
|
|
@@ -80589,7 +80606,7 @@ var require_rimraf = __commonJS({
|
|
|
80589
80606
|
assert2(p);
|
|
80590
80607
|
assert2(options);
|
|
80591
80608
|
options.readdirSync(p).forEach(function(f) {
|
|
80592
|
-
rimrafSync(
|
|
80609
|
+
rimrafSync(path53.join(p, f), options);
|
|
80593
80610
|
});
|
|
80594
80611
|
options.rmdirSync(p, options);
|
|
80595
80612
|
}
|
|
@@ -80599,7 +80616,7 @@ var require_rimraf = __commonJS({
|
|
|
80599
80616
|
// ../../node_modules/mkdirp/index.js
|
|
80600
80617
|
var require_mkdirp = __commonJS({
|
|
80601
80618
|
"../../node_modules/mkdirp/index.js"(exports2, module2) {
|
|
80602
|
-
var
|
|
80619
|
+
var path53 = require("path");
|
|
80603
80620
|
var fs69 = require("fs");
|
|
80604
80621
|
var _0777 = parseInt("0777", 8);
|
|
80605
80622
|
module2.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP;
|
|
@@ -80619,7 +80636,7 @@ var require_mkdirp = __commonJS({
|
|
|
80619
80636
|
var cb = f || /* istanbul ignore next */
|
|
80620
80637
|
function() {
|
|
80621
80638
|
};
|
|
80622
|
-
p =
|
|
80639
|
+
p = path53.resolve(p);
|
|
80623
80640
|
xfs.mkdir(p, mode, function(er) {
|
|
80624
80641
|
if (!er) {
|
|
80625
80642
|
made = made || p;
|
|
@@ -80627,8 +80644,8 @@ var require_mkdirp = __commonJS({
|
|
|
80627
80644
|
}
|
|
80628
80645
|
switch (er.code) {
|
|
80629
80646
|
case "ENOENT":
|
|
80630
|
-
if (
|
|
80631
|
-
mkdirP(
|
|
80647
|
+
if (path53.dirname(p) === p) return cb(er);
|
|
80648
|
+
mkdirP(path53.dirname(p), opts, function(er2, made2) {
|
|
80632
80649
|
if (er2) cb(er2, made2);
|
|
80633
80650
|
else mkdirP(p, opts, cb, made2);
|
|
80634
80651
|
});
|
|
@@ -80655,14 +80672,14 @@ var require_mkdirp = __commonJS({
|
|
|
80655
80672
|
mode = _0777;
|
|
80656
80673
|
}
|
|
80657
80674
|
if (!made) made = null;
|
|
80658
|
-
p =
|
|
80675
|
+
p = path53.resolve(p);
|
|
80659
80676
|
try {
|
|
80660
80677
|
xfs.mkdirSync(p, mode);
|
|
80661
80678
|
made = made || p;
|
|
80662
80679
|
} catch (err0) {
|
|
80663
80680
|
switch (err0.code) {
|
|
80664
80681
|
case "ENOENT":
|
|
80665
|
-
made = sync(
|
|
80682
|
+
made = sync(path53.dirname(p), opts, made);
|
|
80666
80683
|
sync(p, opts, made);
|
|
80667
80684
|
break;
|
|
80668
80685
|
// In the case of any other error, just see if there's a dir
|
|
@@ -80689,7 +80706,7 @@ var require_mv = __commonJS({
|
|
|
80689
80706
|
"../../node_modules/mv/index.js"(exports2, module2) {
|
|
80690
80707
|
var fs69 = require("fs");
|
|
80691
80708
|
var ncp = require_ncp().ncp;
|
|
80692
|
-
var
|
|
80709
|
+
var path53 = require("path");
|
|
80693
80710
|
var rimraf = require_rimraf();
|
|
80694
80711
|
var mkdirp = require_mkdirp();
|
|
80695
80712
|
module2.exports = mv;
|
|
@@ -80707,7 +80724,7 @@ var require_mv = __commonJS({
|
|
|
80707
80724
|
doRename();
|
|
80708
80725
|
}
|
|
80709
80726
|
function mkdirs() {
|
|
80710
|
-
mkdirp(
|
|
80727
|
+
mkdirp(path53.dirname(dest), function(err) {
|
|
80711
80728
|
if (err) return cb(err);
|
|
80712
80729
|
doRename();
|
|
80713
80730
|
});
|
|
@@ -84077,17 +84094,17 @@ var require_visit = __commonJS({
|
|
|
84077
84094
|
visit.BREAK = BREAK;
|
|
84078
84095
|
visit.SKIP = SKIP;
|
|
84079
84096
|
visit.REMOVE = REMOVE;
|
|
84080
|
-
function visit_(key2, node, visitor,
|
|
84081
|
-
const ctrl = callVisitor(key2, node, visitor,
|
|
84097
|
+
function visit_(key2, node, visitor, path53) {
|
|
84098
|
+
const ctrl = callVisitor(key2, node, visitor, path53);
|
|
84082
84099
|
if (identity2.isNode(ctrl) || identity2.isPair(ctrl)) {
|
|
84083
|
-
replaceNode(key2,
|
|
84084
|
-
return visit_(key2, ctrl, visitor,
|
|
84100
|
+
replaceNode(key2, path53, ctrl);
|
|
84101
|
+
return visit_(key2, ctrl, visitor, path53);
|
|
84085
84102
|
}
|
|
84086
84103
|
if (typeof ctrl !== "symbol") {
|
|
84087
84104
|
if (identity2.isCollection(node)) {
|
|
84088
|
-
|
|
84105
|
+
path53 = Object.freeze(path53.concat(node));
|
|
84089
84106
|
for (let i = 0; i < node.items.length; ++i) {
|
|
84090
|
-
const ci = visit_(i, node.items[i], visitor,
|
|
84107
|
+
const ci = visit_(i, node.items[i], visitor, path53);
|
|
84091
84108
|
if (typeof ci === "number")
|
|
84092
84109
|
i = ci - 1;
|
|
84093
84110
|
else if (ci === BREAK)
|
|
@@ -84098,13 +84115,13 @@ var require_visit = __commonJS({
|
|
|
84098
84115
|
}
|
|
84099
84116
|
}
|
|
84100
84117
|
} else if (identity2.isPair(node)) {
|
|
84101
|
-
|
|
84102
|
-
const ck = visit_("key", node.key, visitor,
|
|
84118
|
+
path53 = Object.freeze(path53.concat(node));
|
|
84119
|
+
const ck = visit_("key", node.key, visitor, path53);
|
|
84103
84120
|
if (ck === BREAK)
|
|
84104
84121
|
return BREAK;
|
|
84105
84122
|
else if (ck === REMOVE)
|
|
84106
84123
|
node.key = null;
|
|
84107
|
-
const cv = visit_("value", node.value, visitor,
|
|
84124
|
+
const cv = visit_("value", node.value, visitor, path53);
|
|
84108
84125
|
if (cv === BREAK)
|
|
84109
84126
|
return BREAK;
|
|
84110
84127
|
else if (cv === REMOVE)
|
|
@@ -84125,17 +84142,17 @@ var require_visit = __commonJS({
|
|
|
84125
84142
|
visitAsync.BREAK = BREAK;
|
|
84126
84143
|
visitAsync.SKIP = SKIP;
|
|
84127
84144
|
visitAsync.REMOVE = REMOVE;
|
|
84128
|
-
async function visitAsync_(key2, node, visitor,
|
|
84129
|
-
const ctrl = await callVisitor(key2, node, visitor,
|
|
84145
|
+
async function visitAsync_(key2, node, visitor, path53) {
|
|
84146
|
+
const ctrl = await callVisitor(key2, node, visitor, path53);
|
|
84130
84147
|
if (identity2.isNode(ctrl) || identity2.isPair(ctrl)) {
|
|
84131
|
-
replaceNode(key2,
|
|
84132
|
-
return visitAsync_(key2, ctrl, visitor,
|
|
84148
|
+
replaceNode(key2, path53, ctrl);
|
|
84149
|
+
return visitAsync_(key2, ctrl, visitor, path53);
|
|
84133
84150
|
}
|
|
84134
84151
|
if (typeof ctrl !== "symbol") {
|
|
84135
84152
|
if (identity2.isCollection(node)) {
|
|
84136
|
-
|
|
84153
|
+
path53 = Object.freeze(path53.concat(node));
|
|
84137
84154
|
for (let i = 0; i < node.items.length; ++i) {
|
|
84138
|
-
const ci = await visitAsync_(i, node.items[i], visitor,
|
|
84155
|
+
const ci = await visitAsync_(i, node.items[i], visitor, path53);
|
|
84139
84156
|
if (typeof ci === "number")
|
|
84140
84157
|
i = ci - 1;
|
|
84141
84158
|
else if (ci === BREAK)
|
|
@@ -84146,13 +84163,13 @@ var require_visit = __commonJS({
|
|
|
84146
84163
|
}
|
|
84147
84164
|
}
|
|
84148
84165
|
} else if (identity2.isPair(node)) {
|
|
84149
|
-
|
|
84150
|
-
const ck = await visitAsync_("key", node.key, visitor,
|
|
84166
|
+
path53 = Object.freeze(path53.concat(node));
|
|
84167
|
+
const ck = await visitAsync_("key", node.key, visitor, path53);
|
|
84151
84168
|
if (ck === BREAK)
|
|
84152
84169
|
return BREAK;
|
|
84153
84170
|
else if (ck === REMOVE)
|
|
84154
84171
|
node.key = null;
|
|
84155
|
-
const cv = await visitAsync_("value", node.value, visitor,
|
|
84172
|
+
const cv = await visitAsync_("value", node.value, visitor, path53);
|
|
84156
84173
|
if (cv === BREAK)
|
|
84157
84174
|
return BREAK;
|
|
84158
84175
|
else if (cv === REMOVE)
|
|
@@ -84179,23 +84196,23 @@ var require_visit = __commonJS({
|
|
|
84179
84196
|
}
|
|
84180
84197
|
return visitor;
|
|
84181
84198
|
}
|
|
84182
|
-
function callVisitor(key2, node, visitor,
|
|
84199
|
+
function callVisitor(key2, node, visitor, path53) {
|
|
84183
84200
|
if (typeof visitor === "function")
|
|
84184
|
-
return visitor(key2, node,
|
|
84201
|
+
return visitor(key2, node, path53);
|
|
84185
84202
|
if (identity2.isMap(node))
|
|
84186
|
-
return visitor.Map?.(key2, node,
|
|
84203
|
+
return visitor.Map?.(key2, node, path53);
|
|
84187
84204
|
if (identity2.isSeq(node))
|
|
84188
|
-
return visitor.Seq?.(key2, node,
|
|
84205
|
+
return visitor.Seq?.(key2, node, path53);
|
|
84189
84206
|
if (identity2.isPair(node))
|
|
84190
|
-
return visitor.Pair?.(key2, node,
|
|
84207
|
+
return visitor.Pair?.(key2, node, path53);
|
|
84191
84208
|
if (identity2.isScalar(node))
|
|
84192
|
-
return visitor.Scalar?.(key2, node,
|
|
84209
|
+
return visitor.Scalar?.(key2, node, path53);
|
|
84193
84210
|
if (identity2.isAlias(node))
|
|
84194
|
-
return visitor.Alias?.(key2, node,
|
|
84211
|
+
return visitor.Alias?.(key2, node, path53);
|
|
84195
84212
|
return void 0;
|
|
84196
84213
|
}
|
|
84197
|
-
function replaceNode(key2,
|
|
84198
|
-
const parent =
|
|
84214
|
+
function replaceNode(key2, path53, node) {
|
|
84215
|
+
const parent = path53[path53.length - 1];
|
|
84199
84216
|
if (identity2.isCollection(parent)) {
|
|
84200
84217
|
parent.items[key2] = node;
|
|
84201
84218
|
} else if (identity2.isPair(parent)) {
|
|
@@ -84805,10 +84822,10 @@ var require_Collection = __commonJS({
|
|
|
84805
84822
|
var createNode = require_createNode();
|
|
84806
84823
|
var identity2 = require_identity();
|
|
84807
84824
|
var Node = require_Node();
|
|
84808
|
-
function collectionFromPath(schema,
|
|
84825
|
+
function collectionFromPath(schema, path53, value) {
|
|
84809
84826
|
let v = value;
|
|
84810
|
-
for (let i =
|
|
84811
|
-
const k =
|
|
84827
|
+
for (let i = path53.length - 1; i >= 0; --i) {
|
|
84828
|
+
const k = path53[i];
|
|
84812
84829
|
if (typeof k === "number" && Number.isInteger(k) && k >= 0) {
|
|
84813
84830
|
const a = [];
|
|
84814
84831
|
a[k] = v;
|
|
@@ -84827,7 +84844,7 @@ var require_Collection = __commonJS({
|
|
|
84827
84844
|
sourceObjects: /* @__PURE__ */ new Map()
|
|
84828
84845
|
});
|
|
84829
84846
|
}
|
|
84830
|
-
var isEmptyPath = (
|
|
84847
|
+
var isEmptyPath = (path53) => path53 == null || typeof path53 === "object" && !!path53[Symbol.iterator]().next().done;
|
|
84831
84848
|
var Collection = class extends Node.NodeBase {
|
|
84832
84849
|
constructor(type, schema) {
|
|
84833
84850
|
super(type);
|
|
@@ -84857,11 +84874,11 @@ var require_Collection = __commonJS({
|
|
|
84857
84874
|
* be a Pair instance or a `{ key, value }` object, which may not have a key
|
|
84858
84875
|
* that already exists in the map.
|
|
84859
84876
|
*/
|
|
84860
|
-
addIn(
|
|
84861
|
-
if (isEmptyPath(
|
|
84877
|
+
addIn(path53, value) {
|
|
84878
|
+
if (isEmptyPath(path53))
|
|
84862
84879
|
this.add(value);
|
|
84863
84880
|
else {
|
|
84864
|
-
const [key2, ...rest] =
|
|
84881
|
+
const [key2, ...rest] = path53;
|
|
84865
84882
|
const node = this.get(key2, true);
|
|
84866
84883
|
if (identity2.isCollection(node))
|
|
84867
84884
|
node.addIn(rest, value);
|
|
@@ -84875,8 +84892,8 @@ var require_Collection = __commonJS({
|
|
|
84875
84892
|
* Removes a value from the collection.
|
|
84876
84893
|
* @returns `true` if the item was found and removed.
|
|
84877
84894
|
*/
|
|
84878
|
-
deleteIn(
|
|
84879
|
-
const [key2, ...rest] =
|
|
84895
|
+
deleteIn(path53) {
|
|
84896
|
+
const [key2, ...rest] = path53;
|
|
84880
84897
|
if (rest.length === 0)
|
|
84881
84898
|
return this.delete(key2);
|
|
84882
84899
|
const node = this.get(key2, true);
|
|
@@ -84890,8 +84907,8 @@ var require_Collection = __commonJS({
|
|
|
84890
84907
|
* scalar values from their surrounding node; to disable set `keepScalar` to
|
|
84891
84908
|
* `true` (collections are always returned intact).
|
|
84892
84909
|
*/
|
|
84893
|
-
getIn(
|
|
84894
|
-
const [key2, ...rest] =
|
|
84910
|
+
getIn(path53, keepScalar) {
|
|
84911
|
+
const [key2, ...rest] = path53;
|
|
84895
84912
|
const node = this.get(key2, true);
|
|
84896
84913
|
if (rest.length === 0)
|
|
84897
84914
|
return !keepScalar && identity2.isScalar(node) ? node.value : node;
|
|
@@ -84909,8 +84926,8 @@ var require_Collection = __commonJS({
|
|
|
84909
84926
|
/**
|
|
84910
84927
|
* Checks if the collection includes a value with the key `key`.
|
|
84911
84928
|
*/
|
|
84912
|
-
hasIn(
|
|
84913
|
-
const [key2, ...rest] =
|
|
84929
|
+
hasIn(path53) {
|
|
84930
|
+
const [key2, ...rest] = path53;
|
|
84914
84931
|
if (rest.length === 0)
|
|
84915
84932
|
return this.has(key2);
|
|
84916
84933
|
const node = this.get(key2, true);
|
|
@@ -84920,8 +84937,8 @@ var require_Collection = __commonJS({
|
|
|
84920
84937
|
* Sets a value in this collection. For `!!set`, `value` needs to be a
|
|
84921
84938
|
* boolean to add/remove the item from the set.
|
|
84922
84939
|
*/
|
|
84923
|
-
setIn(
|
|
84924
|
-
const [key2, ...rest] =
|
|
84940
|
+
setIn(path53, value) {
|
|
84941
|
+
const [key2, ...rest] = path53;
|
|
84925
84942
|
if (rest.length === 0) {
|
|
84926
84943
|
this.set(key2, value);
|
|
84927
84944
|
} else {
|
|
@@ -87436,9 +87453,9 @@ var require_Document = __commonJS({
|
|
|
87436
87453
|
this.contents.add(value);
|
|
87437
87454
|
}
|
|
87438
87455
|
/** Adds a value to the document. */
|
|
87439
|
-
addIn(
|
|
87456
|
+
addIn(path53, value) {
|
|
87440
87457
|
if (assertCollection(this.contents))
|
|
87441
|
-
this.contents.addIn(
|
|
87458
|
+
this.contents.addIn(path53, value);
|
|
87442
87459
|
}
|
|
87443
87460
|
/**
|
|
87444
87461
|
* Create a new `Alias` node, ensuring that the target `node` has the required anchor.
|
|
@@ -87513,14 +87530,14 @@ var require_Document = __commonJS({
|
|
|
87513
87530
|
* Removes a value from the document.
|
|
87514
87531
|
* @returns `true` if the item was found and removed.
|
|
87515
87532
|
*/
|
|
87516
|
-
deleteIn(
|
|
87517
|
-
if (Collection.isEmptyPath(
|
|
87533
|
+
deleteIn(path53) {
|
|
87534
|
+
if (Collection.isEmptyPath(path53)) {
|
|
87518
87535
|
if (this.contents == null)
|
|
87519
87536
|
return false;
|
|
87520
87537
|
this.contents = null;
|
|
87521
87538
|
return true;
|
|
87522
87539
|
}
|
|
87523
|
-
return assertCollection(this.contents) ? this.contents.deleteIn(
|
|
87540
|
+
return assertCollection(this.contents) ? this.contents.deleteIn(path53) : false;
|
|
87524
87541
|
}
|
|
87525
87542
|
/**
|
|
87526
87543
|
* Returns item at `key`, or `undefined` if not found. By default unwraps
|
|
@@ -87535,10 +87552,10 @@ var require_Document = __commonJS({
|
|
|
87535
87552
|
* scalar values from their surrounding node; to disable set `keepScalar` to
|
|
87536
87553
|
* `true` (collections are always returned intact).
|
|
87537
87554
|
*/
|
|
87538
|
-
getIn(
|
|
87539
|
-
if (Collection.isEmptyPath(
|
|
87555
|
+
getIn(path53, keepScalar) {
|
|
87556
|
+
if (Collection.isEmptyPath(path53))
|
|
87540
87557
|
return !keepScalar && identity2.isScalar(this.contents) ? this.contents.value : this.contents;
|
|
87541
|
-
return identity2.isCollection(this.contents) ? this.contents.getIn(
|
|
87558
|
+
return identity2.isCollection(this.contents) ? this.contents.getIn(path53, keepScalar) : void 0;
|
|
87542
87559
|
}
|
|
87543
87560
|
/**
|
|
87544
87561
|
* Checks if the document includes a value with the key `key`.
|
|
@@ -87549,10 +87566,10 @@ var require_Document = __commonJS({
|
|
|
87549
87566
|
/**
|
|
87550
87567
|
* Checks if the document includes a value at `path`.
|
|
87551
87568
|
*/
|
|
87552
|
-
hasIn(
|
|
87553
|
-
if (Collection.isEmptyPath(
|
|
87569
|
+
hasIn(path53) {
|
|
87570
|
+
if (Collection.isEmptyPath(path53))
|
|
87554
87571
|
return this.contents !== void 0;
|
|
87555
|
-
return identity2.isCollection(this.contents) ? this.contents.hasIn(
|
|
87572
|
+
return identity2.isCollection(this.contents) ? this.contents.hasIn(path53) : false;
|
|
87556
87573
|
}
|
|
87557
87574
|
/**
|
|
87558
87575
|
* Sets a value in this document. For `!!set`, `value` needs to be a
|
|
@@ -87569,13 +87586,13 @@ var require_Document = __commonJS({
|
|
|
87569
87586
|
* Sets a value in this document. For `!!set`, `value` needs to be a
|
|
87570
87587
|
* boolean to add/remove the item from the set.
|
|
87571
87588
|
*/
|
|
87572
|
-
setIn(
|
|
87573
|
-
if (Collection.isEmptyPath(
|
|
87589
|
+
setIn(path53, value) {
|
|
87590
|
+
if (Collection.isEmptyPath(path53)) {
|
|
87574
87591
|
this.contents = value;
|
|
87575
87592
|
} else if (this.contents == null) {
|
|
87576
|
-
this.contents = Collection.collectionFromPath(this.schema, Array.from(
|
|
87593
|
+
this.contents = Collection.collectionFromPath(this.schema, Array.from(path53), value);
|
|
87577
87594
|
} else if (assertCollection(this.contents)) {
|
|
87578
|
-
this.contents.setIn(
|
|
87595
|
+
this.contents.setIn(path53, value);
|
|
87579
87596
|
}
|
|
87580
87597
|
}
|
|
87581
87598
|
/**
|
|
@@ -89535,9 +89552,9 @@ var require_cst_visit = __commonJS({
|
|
|
89535
89552
|
visit.BREAK = BREAK;
|
|
89536
89553
|
visit.SKIP = SKIP;
|
|
89537
89554
|
visit.REMOVE = REMOVE;
|
|
89538
|
-
visit.itemAtPath = (cst,
|
|
89555
|
+
visit.itemAtPath = (cst, path53) => {
|
|
89539
89556
|
let item = cst;
|
|
89540
|
-
for (const [field, index] of
|
|
89557
|
+
for (const [field, index] of path53) {
|
|
89541
89558
|
const tok = item?.[field];
|
|
89542
89559
|
if (tok && "items" in tok) {
|
|
89543
89560
|
item = tok.items[index];
|
|
@@ -89546,23 +89563,23 @@ var require_cst_visit = __commonJS({
|
|
|
89546
89563
|
}
|
|
89547
89564
|
return item;
|
|
89548
89565
|
};
|
|
89549
|
-
visit.parentCollection = (cst,
|
|
89550
|
-
const parent = visit.itemAtPath(cst,
|
|
89551
|
-
const field =
|
|
89566
|
+
visit.parentCollection = (cst, path53) => {
|
|
89567
|
+
const parent = visit.itemAtPath(cst, path53.slice(0, -1));
|
|
89568
|
+
const field = path53[path53.length - 1][0];
|
|
89552
89569
|
const coll = parent?.[field];
|
|
89553
89570
|
if (coll && "items" in coll)
|
|
89554
89571
|
return coll;
|
|
89555
89572
|
throw new Error("Parent collection not found");
|
|
89556
89573
|
};
|
|
89557
|
-
function _visit(
|
|
89558
|
-
let ctrl = visitor(item,
|
|
89574
|
+
function _visit(path53, item, visitor) {
|
|
89575
|
+
let ctrl = visitor(item, path53);
|
|
89559
89576
|
if (typeof ctrl === "symbol")
|
|
89560
89577
|
return ctrl;
|
|
89561
89578
|
for (const field of ["key", "value"]) {
|
|
89562
89579
|
const token = item[field];
|
|
89563
89580
|
if (token && "items" in token) {
|
|
89564
89581
|
for (let i = 0; i < token.items.length; ++i) {
|
|
89565
|
-
const ci = _visit(Object.freeze(
|
|
89582
|
+
const ci = _visit(Object.freeze(path53.concat([[field, i]])), token.items[i], visitor);
|
|
89566
89583
|
if (typeof ci === "number")
|
|
89567
89584
|
i = ci - 1;
|
|
89568
89585
|
else if (ci === BREAK)
|
|
@@ -89573,10 +89590,10 @@ var require_cst_visit = __commonJS({
|
|
|
89573
89590
|
}
|
|
89574
89591
|
}
|
|
89575
89592
|
if (typeof ctrl === "function" && field === "key")
|
|
89576
|
-
ctrl = ctrl(item,
|
|
89593
|
+
ctrl = ctrl(item, path53);
|
|
89577
89594
|
}
|
|
89578
89595
|
}
|
|
89579
|
-
return typeof ctrl === "function" ? ctrl(item,
|
|
89596
|
+
return typeof ctrl === "function" ? ctrl(item, path53) : ctrl;
|
|
89580
89597
|
}
|
|
89581
89598
|
exports2.visit = visit;
|
|
89582
89599
|
}
|
|
@@ -91334,7 +91351,7 @@ __export(index_exports, {
|
|
|
91334
91351
|
start: () => start
|
|
91335
91352
|
});
|
|
91336
91353
|
module.exports = __toCommonJS(index_exports);
|
|
91337
|
-
var
|
|
91354
|
+
var path52 = __toESM(require("node:path"));
|
|
91338
91355
|
var import_node_os14 = require("node:os");
|
|
91339
91356
|
init_src();
|
|
91340
91357
|
init_src2();
|
|
@@ -93783,7 +93800,7 @@ function appendRootPathToUrlIfNeeded(url2) {
|
|
|
93783
93800
|
return void 0;
|
|
93784
93801
|
}
|
|
93785
93802
|
}
|
|
93786
|
-
function appendResourcePathToUrl(url2,
|
|
93803
|
+
function appendResourcePathToUrl(url2, path53) {
|
|
93787
93804
|
try {
|
|
93788
93805
|
new URL(url2);
|
|
93789
93806
|
} catch {
|
|
@@ -93793,11 +93810,11 @@ function appendResourcePathToUrl(url2, path52) {
|
|
|
93793
93810
|
if (!url2.endsWith("/")) {
|
|
93794
93811
|
url2 = url2 + "/";
|
|
93795
93812
|
}
|
|
93796
|
-
url2 +=
|
|
93813
|
+
url2 += path53;
|
|
93797
93814
|
try {
|
|
93798
93815
|
new URL(url2);
|
|
93799
93816
|
} catch {
|
|
93800
|
-
diag2.warn(`Configuration: Provided URL appended with '${
|
|
93817
|
+
diag2.warn(`Configuration: Provided URL appended with '${path53}' is not a valid URL, using 'undefined' instead of '${url2}'`);
|
|
93801
93818
|
return void 0;
|
|
93802
93819
|
}
|
|
93803
93820
|
return url2;
|
|
@@ -94458,9 +94475,9 @@ function isReplitAgent(env) {
|
|
|
94458
94475
|
}
|
|
94459
94476
|
var DEVIN_MARKER_PATH = "/opt/.devin";
|
|
94460
94477
|
var JULES_MARKER_PATH = "/opt/environment_summary.sh";
|
|
94461
|
-
function safeExists(fileExists,
|
|
94478
|
+
function safeExists(fileExists, path53) {
|
|
94462
94479
|
try {
|
|
94463
|
-
return fileExists(
|
|
94480
|
+
return fileExists(path53);
|
|
94464
94481
|
} catch {
|
|
94465
94482
|
return false;
|
|
94466
94483
|
}
|
|
@@ -94881,7 +94898,7 @@ var _CI_VENDOR_COUNT_FOR_TEST = vendors_default.length;
|
|
|
94881
94898
|
var SESSION_ID = (0, import_node_crypto3.randomUUID)();
|
|
94882
94899
|
function readCliVersion() {
|
|
94883
94900
|
if (true) {
|
|
94884
|
-
return "0.27.1-next.
|
|
94901
|
+
return "0.27.1-next.22";
|
|
94885
94902
|
}
|
|
94886
94903
|
return "0.0.0";
|
|
94887
94904
|
}
|
|
@@ -95844,18 +95861,18 @@ async function resolveVegaBinary() {
|
|
|
95844
95861
|
}
|
|
95845
95862
|
const onPath = await commandOnPath("vega") ?? await commandOnPath("kepler");
|
|
95846
95863
|
const fallback = (0, import_node_path5.join)((0, import_node_os3.homedir)(), "vega", "bin", "vega");
|
|
95847
|
-
const
|
|
95848
|
-
cachedVegaBinary = { path:
|
|
95849
|
-
return
|
|
95864
|
+
const path53 = onPath ?? (await isExecutable(fallback) ? fallback : null);
|
|
95865
|
+
cachedVegaBinary = { path: path53, checkedAt: now };
|
|
95866
|
+
return path53;
|
|
95850
95867
|
}
|
|
95851
95868
|
async function resolveVegaOrThrow() {
|
|
95852
|
-
const
|
|
95853
|
-
if (!
|
|
95869
|
+
const path53 = await resolveVegaBinary();
|
|
95870
|
+
if (!path53) {
|
|
95854
95871
|
throw new Error(
|
|
95855
95872
|
"`vega` (or `kepler`) not found on PATH or under `~/vega/bin`. Install the Vega SDK and run `source ~/vega/env`, then retry."
|
|
95856
95873
|
);
|
|
95857
95874
|
}
|
|
95858
|
-
return
|
|
95875
|
+
return path53;
|
|
95859
95876
|
}
|
|
95860
95877
|
var VEGA_KILL_SIGNAL = "SIGKILL";
|
|
95861
95878
|
async function reapVegaGroup(child) {
|
|
@@ -98363,50 +98380,50 @@ function from(...paths) {
|
|
|
98363
98380
|
const joined = paths.join("/");
|
|
98364
98381
|
return joined.replace(/\/+/g, "/").replace(/^\/+/, "").replace(/\/+$/, "");
|
|
98365
98382
|
}
|
|
98366
|
-
function parts(
|
|
98367
|
-
return
|
|
98383
|
+
function parts(path53) {
|
|
98384
|
+
return path53 === "" ? [] : path53.split("/");
|
|
98368
98385
|
}
|
|
98369
98386
|
function decode3(raw) {
|
|
98370
|
-
const
|
|
98371
|
-
return encode3(
|
|
98387
|
+
const path53 = from(raw);
|
|
98388
|
+
return encode3(path53);
|
|
98372
98389
|
}
|
|
98373
|
-
function encode3(
|
|
98374
|
-
if (parts(
|
|
98390
|
+
function encode3(path53) {
|
|
98391
|
+
if (parts(path53).length > MAX_PARTS) {
|
|
98375
98392
|
throw new Error(`path exceeds ${MAX_PARTS} parts`);
|
|
98376
98393
|
}
|
|
98377
|
-
return
|
|
98394
|
+
return path53;
|
|
98378
98395
|
}
|
|
98379
|
-
function hasPrefix(prefix,
|
|
98396
|
+
function hasPrefix(prefix, path53) {
|
|
98380
98397
|
if (prefix === "") {
|
|
98381
98398
|
return true;
|
|
98382
98399
|
}
|
|
98383
|
-
if (!
|
|
98400
|
+
if (!path53.startsWith(prefix)) {
|
|
98384
98401
|
return false;
|
|
98385
98402
|
}
|
|
98386
|
-
if (
|
|
98403
|
+
if (path53.length === prefix.length) {
|
|
98387
98404
|
return true;
|
|
98388
98405
|
}
|
|
98389
|
-
return
|
|
98406
|
+
return path53[prefix.length] === "/";
|
|
98390
98407
|
}
|
|
98391
|
-
function stripPrefix(prefix,
|
|
98392
|
-
if (!hasPrefix(prefix,
|
|
98408
|
+
function stripPrefix(prefix, path53) {
|
|
98409
|
+
if (!hasPrefix(prefix, path53)) {
|
|
98393
98410
|
return null;
|
|
98394
98411
|
}
|
|
98395
98412
|
if (prefix === "") {
|
|
98396
|
-
return
|
|
98413
|
+
return path53;
|
|
98397
98414
|
}
|
|
98398
|
-
if (
|
|
98415
|
+
if (path53.length === prefix.length) {
|
|
98399
98416
|
return "";
|
|
98400
98417
|
}
|
|
98401
|
-
return
|
|
98418
|
+
return path53.slice(prefix.length + 1);
|
|
98402
98419
|
}
|
|
98403
|
-
function join13(
|
|
98404
|
-
if (
|
|
98420
|
+
function join13(path53, other) {
|
|
98421
|
+
if (path53 === "") {
|
|
98405
98422
|
return other;
|
|
98406
98423
|
} else if (other === "") {
|
|
98407
|
-
return
|
|
98424
|
+
return path53;
|
|
98408
98425
|
} else {
|
|
98409
|
-
return `${
|
|
98426
|
+
return `${path53}/${other}`;
|
|
98410
98427
|
}
|
|
98411
98428
|
}
|
|
98412
98429
|
function empty() {
|
|
@@ -101711,12 +101728,12 @@ var Publisher = class {
|
|
|
101711
101728
|
* Publishes a broadcast with any associated tracks.
|
|
101712
101729
|
* Opens a bidi stream to send PublishNamespace and waits for response.
|
|
101713
101730
|
*/
|
|
101714
|
-
publish(
|
|
101715
|
-
this.#broadcasts.set(
|
|
101716
|
-
this.#notifyConsumers(
|
|
101717
|
-
void this.#runPublish(
|
|
101731
|
+
publish(path53, broadcast) {
|
|
101732
|
+
this.#broadcasts.set(path53, broadcast);
|
|
101733
|
+
this.#notifyConsumers(path53, true);
|
|
101734
|
+
void this.#runPublish(path53, broadcast);
|
|
101718
101735
|
}
|
|
101719
|
-
async #runPublish(
|
|
101736
|
+
async #runPublish(path53, broadcast) {
|
|
101720
101737
|
try {
|
|
101721
101738
|
const requestId = await this.#session.nextRequestId();
|
|
101722
101739
|
if (requestId === void 0)
|
|
@@ -101724,7 +101741,7 @@ var Publisher = class {
|
|
|
101724
101741
|
const stream = await this.#session.openBi();
|
|
101725
101742
|
try {
|
|
101726
101743
|
await stream.writer.u53(PublishNamespace.id);
|
|
101727
|
-
const msg = new PublishNamespace({ requestId, trackNamespace:
|
|
101744
|
+
const msg = new PublishNamespace({ requestId, trackNamespace: path53 });
|
|
101728
101745
|
await msg.encode(stream.writer, this.#session.version);
|
|
101729
101746
|
const respTypeId = await stream.reader.u53();
|
|
101730
101747
|
if (respTypeId === RequestOk.id) {
|
|
@@ -101740,7 +101757,7 @@ var Publisher = class {
|
|
|
101740
101757
|
if (this.#session.version === Version.DRAFT_14 || this.#session.version === Version.DRAFT_15 || this.#session.version === Version.DRAFT_16) {
|
|
101741
101758
|
try {
|
|
101742
101759
|
await stream.writer.u53(PublishNamespaceDone.id);
|
|
101743
|
-
const done = new PublishNamespaceDone({ trackNamespace:
|
|
101760
|
+
const done = new PublishNamespaceDone({ trackNamespace: path53, requestId });
|
|
101744
101761
|
await done.encode(stream.writer, this.#session.version);
|
|
101745
101762
|
} catch {
|
|
101746
101763
|
}
|
|
@@ -101752,11 +101769,11 @@ var Publisher = class {
|
|
|
101752
101769
|
}
|
|
101753
101770
|
} catch (err) {
|
|
101754
101771
|
const e = error51(err);
|
|
101755
|
-
console.warn(`announce failed: broadcast=${
|
|
101772
|
+
console.warn(`announce failed: broadcast=${path53} error=${e.message}`);
|
|
101756
101773
|
} finally {
|
|
101757
101774
|
broadcast.close();
|
|
101758
|
-
this.#broadcasts.delete(
|
|
101759
|
-
this.#notifyConsumers(
|
|
101775
|
+
this.#broadcasts.delete(path53);
|
|
101776
|
+
this.#notifyConsumers(path53, false);
|
|
101760
101777
|
}
|
|
101761
101778
|
}
|
|
101762
101779
|
/**
|
|
@@ -101948,9 +101965,9 @@ var Publisher = class {
|
|
|
101948
101965
|
}
|
|
101949
101966
|
stream.close();
|
|
101950
101967
|
}
|
|
101951
|
-
#notifyConsumers(
|
|
101968
|
+
#notifyConsumers(path53, active) {
|
|
101952
101969
|
for (const consumer of this.#announcedConsumers) {
|
|
101953
|
-
const suffix = stripPrefix(consumer.prefix,
|
|
101970
|
+
const suffix = stripPrefix(consumer.prefix, path53);
|
|
101954
101971
|
if (suffix === null)
|
|
101955
101972
|
continue;
|
|
101956
101973
|
try {
|
|
@@ -102079,23 +102096,23 @@ var Subscriber = class {
|
|
|
102079
102096
|
const msgType = await stream.reader.u53();
|
|
102080
102097
|
if (msgType === SubscribeNamespaceEntry.id) {
|
|
102081
102098
|
const entry = await SubscribeNamespaceEntry.decode(stream.reader, version3);
|
|
102082
|
-
const
|
|
102083
|
-
console.debug(`announced: broadcast=${
|
|
102084
|
-
this.#announced.add(
|
|
102099
|
+
const path53 = join13(prefix, entry.suffix);
|
|
102100
|
+
console.debug(`announced: broadcast=${path53} active=true`);
|
|
102101
|
+
this.#announced.add(path53);
|
|
102085
102102
|
for (const consumer of this.#announcedConsumers) {
|
|
102086
|
-
if (!hasPrefix(consumer.prefix,
|
|
102103
|
+
if (!hasPrefix(consumer.prefix, path53))
|
|
102087
102104
|
continue;
|
|
102088
|
-
consumer.append({ path:
|
|
102105
|
+
consumer.append({ path: path53, active: true });
|
|
102089
102106
|
}
|
|
102090
102107
|
} else if (msgType === SubscribeNamespaceEntryDone.id) {
|
|
102091
102108
|
const entry = await SubscribeNamespaceEntryDone.decode(stream.reader, version3);
|
|
102092
|
-
const
|
|
102093
|
-
console.debug(`announced: broadcast=${
|
|
102094
|
-
this.#announced.delete(
|
|
102109
|
+
const path53 = join13(prefix, entry.suffix);
|
|
102110
|
+
console.debug(`announced: broadcast=${path53} active=false`);
|
|
102111
|
+
this.#announced.delete(path53);
|
|
102095
102112
|
for (const consumer of this.#announcedConsumers) {
|
|
102096
|
-
if (!hasPrefix(consumer.prefix,
|
|
102113
|
+
if (!hasPrefix(consumer.prefix, path53))
|
|
102097
102114
|
continue;
|
|
102098
|
-
consumer.append({ path:
|
|
102115
|
+
consumer.append({ path: path53, active: false });
|
|
102099
102116
|
}
|
|
102100
102117
|
} else if (msgType === PublishBlocked.id && version3 === Version.DRAFT_17) {
|
|
102101
102118
|
const blocked = await PublishBlocked.decode(stream.reader, version3);
|
|
@@ -102127,14 +102144,14 @@ var Subscriber = class {
|
|
|
102127
102144
|
/**
|
|
102128
102145
|
* Consumes a broadcast from the connection.
|
|
102129
102146
|
*/
|
|
102130
|
-
consume(
|
|
102147
|
+
consume(path53) {
|
|
102131
102148
|
const broadcast = new Broadcast();
|
|
102132
102149
|
void (async () => {
|
|
102133
102150
|
for (; ; ) {
|
|
102134
102151
|
const request3 = await broadcast.requested();
|
|
102135
102152
|
if (!request3)
|
|
102136
102153
|
break;
|
|
102137
|
-
void this.#runSubscribe(
|
|
102154
|
+
void this.#runSubscribe(path53, request3);
|
|
102138
102155
|
}
|
|
102139
102156
|
})();
|
|
102140
102157
|
return broadcast;
|
|
@@ -102214,8 +102231,8 @@ var Subscriber = class {
|
|
|
102214
102231
|
*/
|
|
102215
102232
|
async runPublishNamespace(msg, stream) {
|
|
102216
102233
|
const version3 = this.#session.version;
|
|
102217
|
-
const
|
|
102218
|
-
if (this.#announced.has(
|
|
102234
|
+
const path53 = msg.trackNamespace;
|
|
102235
|
+
if (this.#announced.has(path53)) {
|
|
102219
102236
|
console.warn("duplicate PublishNamespace");
|
|
102220
102237
|
if (version3 === Version.DRAFT_14) {
|
|
102221
102238
|
await stream.writer.u53(PublishNamespaceError.id);
|
|
@@ -102237,7 +102254,7 @@ var Subscriber = class {
|
|
|
102237
102254
|
stream.close();
|
|
102238
102255
|
return;
|
|
102239
102256
|
}
|
|
102240
|
-
this.#announced.add(
|
|
102257
|
+
this.#announced.add(path53);
|
|
102241
102258
|
try {
|
|
102242
102259
|
if (version3 === Version.DRAFT_14) {
|
|
102243
102260
|
await stream.writer.u53(PublishNamespaceOk.id);
|
|
@@ -102250,25 +102267,25 @@ var Subscriber = class {
|
|
|
102250
102267
|
});
|
|
102251
102268
|
await ok.encode(stream.writer, version3);
|
|
102252
102269
|
}
|
|
102253
|
-
console.debug(`announced: broadcast=${
|
|
102270
|
+
console.debug(`announced: broadcast=${path53} active=true`);
|
|
102254
102271
|
for (const consumer of this.#announcedConsumers) {
|
|
102255
|
-
const suffix = stripPrefix(consumer.prefix,
|
|
102272
|
+
const suffix = stripPrefix(consumer.prefix, path53);
|
|
102256
102273
|
if (suffix === null)
|
|
102257
102274
|
continue;
|
|
102258
|
-
consumer.append({ path:
|
|
102275
|
+
consumer.append({ path: path53, active: true });
|
|
102259
102276
|
}
|
|
102260
|
-
console.debug(`runPublishNamespace: awaiting stream.reader.closed for ${
|
|
102277
|
+
console.debug(`runPublishNamespace: awaiting stream.reader.closed for ${path53}`);
|
|
102261
102278
|
await stream.reader.closed;
|
|
102262
|
-
console.debug(`runPublishNamespace: stream.reader.closed resolved for ${
|
|
102279
|
+
console.debug(`runPublishNamespace: stream.reader.closed resolved for ${path53}`);
|
|
102263
102280
|
} finally {
|
|
102264
|
-
this.#announced.delete(
|
|
102265
|
-
console.debug(`announced: broadcast=${
|
|
102281
|
+
this.#announced.delete(path53);
|
|
102282
|
+
console.debug(`announced: broadcast=${path53} active=false`);
|
|
102266
102283
|
for (const consumer of this.#announcedConsumers) {
|
|
102267
|
-
const suffix = stripPrefix(consumer.prefix,
|
|
102284
|
+
const suffix = stripPrefix(consumer.prefix, path53);
|
|
102268
102285
|
if (suffix === null)
|
|
102269
102286
|
continue;
|
|
102270
102287
|
try {
|
|
102271
|
-
consumer.append({ path:
|
|
102288
|
+
consumer.append({ path: path53, active: false });
|
|
102272
102289
|
} catch {
|
|
102273
102290
|
}
|
|
102274
102291
|
}
|
|
@@ -102407,8 +102424,8 @@ var Connection = class {
|
|
|
102407
102424
|
* @param name - The broadcast path to publish
|
|
102408
102425
|
* @param broadcast - The broadcast to publish
|
|
102409
102426
|
*/
|
|
102410
|
-
publish(
|
|
102411
|
-
this.#publisher.publish(
|
|
102427
|
+
publish(path53, broadcast) {
|
|
102428
|
+
this.#publisher.publish(path53, broadcast);
|
|
102412
102429
|
}
|
|
102413
102430
|
/**
|
|
102414
102431
|
* Gets an announced reader for the specified prefix.
|
|
@@ -102920,8 +102937,8 @@ var AnnounceInit = class _AnnounceInit {
|
|
|
102920
102937
|
}
|
|
102921
102938
|
async #encode(w) {
|
|
102922
102939
|
await w.u53(this.suffixes.length);
|
|
102923
|
-
for (const
|
|
102924
|
-
await w.string(encode3(
|
|
102940
|
+
for (const path53 of this.suffixes) {
|
|
102941
|
+
await w.string(encode3(path53));
|
|
102925
102942
|
}
|
|
102926
102943
|
}
|
|
102927
102944
|
static async #decode(r) {
|
|
@@ -103475,15 +103492,15 @@ var Publisher2 = class {
|
|
|
103475
103492
|
* Publishes a broadcast with any associated tracks.
|
|
103476
103493
|
* @param name - The broadcast to publish
|
|
103477
103494
|
*/
|
|
103478
|
-
publish(
|
|
103495
|
+
publish(path53, broadcast) {
|
|
103479
103496
|
this.#broadcasts.mutate((broadcasts) => {
|
|
103480
103497
|
if (!broadcasts)
|
|
103481
103498
|
throw new Error("closed");
|
|
103482
|
-
broadcasts.set(
|
|
103499
|
+
broadcasts.set(path53, broadcast);
|
|
103483
103500
|
});
|
|
103484
103501
|
void broadcast.closed.finally(() => {
|
|
103485
103502
|
this.#broadcasts.mutate((broadcasts) => {
|
|
103486
|
-
broadcasts?.delete(
|
|
103503
|
+
broadcasts?.delete(path53);
|
|
103487
103504
|
});
|
|
103488
103505
|
});
|
|
103489
103506
|
}
|
|
@@ -103803,16 +103820,16 @@ var Setup2 = class _Setup {
|
|
|
103803
103820
|
}
|
|
103804
103821
|
static async #decode(r) {
|
|
103805
103822
|
const count2 = await r.u53();
|
|
103806
|
-
let
|
|
103823
|
+
let path53;
|
|
103807
103824
|
for (let i = 0; i < count2; i++) {
|
|
103808
103825
|
const id = await r.u53();
|
|
103809
103826
|
const len = await r.u53();
|
|
103810
103827
|
const value = await r.read(len);
|
|
103811
103828
|
if (id === PARAM_PATH) {
|
|
103812
|
-
|
|
103829
|
+
path53 = new TextDecoder().decode(value);
|
|
103813
103830
|
}
|
|
103814
103831
|
}
|
|
103815
|
-
return new _Setup({ path:
|
|
103832
|
+
return new _Setup({ path: path53 });
|
|
103816
103833
|
}
|
|
103817
103834
|
async encode(w, version3) {
|
|
103818
103835
|
if (!hasSetupStream(version3))
|
|
@@ -103902,9 +103919,9 @@ var Subscriber2 = class {
|
|
|
103902
103919
|
case Version2.DRAFT_02: {
|
|
103903
103920
|
const init2 = await AnnounceInit.decode(stream.reader, this.version);
|
|
103904
103921
|
for (const suffix of init2.suffixes) {
|
|
103905
|
-
const
|
|
103906
|
-
console.debug(`announced: broadcast=${
|
|
103907
|
-
announced2.append({ path:
|
|
103922
|
+
const path53 = join13(prefix, suffix);
|
|
103923
|
+
console.debug(`announced: broadcast=${path53} active=true`);
|
|
103924
|
+
announced2.append({ path: path53, active: true });
|
|
103908
103925
|
}
|
|
103909
103926
|
break;
|
|
103910
103927
|
}
|
|
@@ -103923,9 +103940,9 @@ var Subscriber2 = class {
|
|
|
103923
103940
|
if (options.ignoreSelf && announce.hops.includes(this.origin)) {
|
|
103924
103941
|
continue;
|
|
103925
103942
|
}
|
|
103926
|
-
const
|
|
103927
|
-
console.debug(`announced: broadcast=${
|
|
103928
|
-
announced2.append({ path:
|
|
103943
|
+
const path53 = join13(prefix, announce.suffix);
|
|
103944
|
+
console.debug(`announced: broadcast=${path53} active=${announce.active}`);
|
|
103945
|
+
announced2.append({ path: path53, active: announce.active });
|
|
103929
103946
|
}
|
|
103930
103947
|
announced2.close();
|
|
103931
103948
|
} catch (err) {
|
|
@@ -103938,14 +103955,14 @@ var Subscriber2 = class {
|
|
|
103938
103955
|
* @param name - The name of the broadcast to consume
|
|
103939
103956
|
* @returns A Broadcast instance
|
|
103940
103957
|
*/
|
|
103941
|
-
consume(
|
|
103958
|
+
consume(path53) {
|
|
103942
103959
|
const broadcast = new Broadcast();
|
|
103943
103960
|
void (async () => {
|
|
103944
103961
|
for (; ; ) {
|
|
103945
103962
|
const request3 = await broadcast.requested();
|
|
103946
103963
|
if (!request3)
|
|
103947
103964
|
break;
|
|
103948
|
-
void this.#runSubscribe(
|
|
103965
|
+
void this.#runSubscribe(path53, request3);
|
|
103949
103966
|
}
|
|
103950
103967
|
})();
|
|
103951
103968
|
return broadcast;
|
|
@@ -104202,8 +104219,8 @@ var Connection2 = class {
|
|
|
104202
104219
|
this.close();
|
|
104203
104220
|
}
|
|
104204
104221
|
}
|
|
104205
|
-
publish(
|
|
104206
|
-
this.#publisher.publish(
|
|
104222
|
+
publish(path53, broadcast) {
|
|
104223
|
+
this.#publisher.publish(path53, broadcast);
|
|
104207
104224
|
}
|
|
104208
104225
|
announced(prefix = empty()) {
|
|
104209
104226
|
return this.#subscriber.announced(prefix);
|
|
@@ -115019,7 +115036,7 @@ async function resolveMembers(members, tempDirs, lookupUpload) {
|
|
|
115019
115036
|
for (const raw of members) {
|
|
115020
115037
|
if (typeof raw !== "object" || raw === null) continue;
|
|
115021
115038
|
const member = raw;
|
|
115022
|
-
if (member.role !== "flow" && member.role !== "baseline" || typeof member.key !== "string" || Object.hasOwn(out, member.key)) {
|
|
115039
|
+
if (member.role !== "flow" && member.role !== "baseline" && member.role !== "tool" || typeof member.key !== "string" || Object.hasOwn(out, member.key)) {
|
|
115023
115040
|
continue;
|
|
115024
115041
|
}
|
|
115025
115042
|
const flow = member.role === "flow";
|
|
@@ -115159,8 +115176,8 @@ async function resolveFileInputs(def, body, lookupUpload) {
|
|
|
115159
115176
|
delete args[spec.target];
|
|
115160
115177
|
continue;
|
|
115161
115178
|
}
|
|
115162
|
-
const { value:
|
|
115163
|
-
args[spec.target] =
|
|
115179
|
+
const { value: path53, meta: meta3 } = await resolveOne(spec, value, tempDirs, lookupUpload);
|
|
115180
|
+
args[spec.target] = path53;
|
|
115164
115181
|
resolved = { ...resolved ?? {}, [spec.target]: meta3 };
|
|
115165
115182
|
}
|
|
115166
115183
|
} catch (err) {
|
|
@@ -123752,10 +123769,10 @@ function captureRotationForSurface(rotation) {
|
|
|
123752
123769
|
if (rotation === null || rotation === 0) return void 0;
|
|
123753
123770
|
return SURFACE_ROTATION_TO_NAME[rotation];
|
|
123754
123771
|
}
|
|
123755
|
-
async function readPngSize2(
|
|
123772
|
+
async function readPngSize2(path53) {
|
|
123756
123773
|
let handle;
|
|
123757
123774
|
try {
|
|
123758
|
-
handle = await import_node_fs13.promises.open(
|
|
123775
|
+
handle = await import_node_fs13.promises.open(path53, "r");
|
|
123759
123776
|
const buf = Buffer.alloc(24);
|
|
123760
123777
|
const { bytesRead } = await handle.read(buf, 0, 24, 0);
|
|
123761
123778
|
if (bytesRead < 24) return null;
|
|
@@ -127049,11 +127066,12 @@ init_device_info();
|
|
|
127049
127066
|
// ../tool-server/src/utils/sub-invoke.ts
|
|
127050
127067
|
var import_node_crypto11 = require("node:crypto");
|
|
127051
127068
|
init_src2();
|
|
127052
|
-
async function invokeSubTool(registry2, ctx, toolId, args) {
|
|
127069
|
+
async function invokeSubTool(registry2, ctx, toolId, args, extra) {
|
|
127053
127070
|
const signal = ctx?.signal;
|
|
127054
127071
|
const recordChildInvocation = ctx?.recordChildInvocation;
|
|
127072
|
+
const fileInputs7 = extra?.fileInputs ? { fileInputs: extra.fileInputs } : {};
|
|
127055
127073
|
if (!recordChildInvocation) {
|
|
127056
|
-
return signal ? registry2.invokeTool(toolId, args, { signal }) : registry2.invokeTool(toolId, args);
|
|
127074
|
+
return signal || extra?.fileInputs ? registry2.invokeTool(toolId, args, { ...signal ? { signal } : {}, ...fileInputs7 }) : registry2.invokeTool(toolId, args);
|
|
127057
127075
|
}
|
|
127058
127076
|
const toolInvocationId = (0, import_node_crypto11.randomUUID)();
|
|
127059
127077
|
const release = recordChildInvocation(toolInvocationId, args);
|
|
@@ -127061,7 +127079,8 @@ async function invokeSubTool(registry2, ctx, toolId, args) {
|
|
|
127061
127079
|
return await registry2.invokeTool(toolId, args, {
|
|
127062
127080
|
signal,
|
|
127063
127081
|
toolInvocationId,
|
|
127064
|
-
recordChildInvocation
|
|
127082
|
+
recordChildInvocation,
|
|
127083
|
+
...fileInputs7
|
|
127065
127084
|
});
|
|
127066
127085
|
} finally {
|
|
127067
127086
|
release();
|
|
@@ -127752,13 +127771,13 @@ async function fetchVegaPageSource(timeoutMs = 15e3) {
|
|
|
127752
127771
|
});
|
|
127753
127772
|
}
|
|
127754
127773
|
}
|
|
127755
|
-
function postJson(host, port,
|
|
127774
|
+
function postJson(host, port, path53, body, timeoutMs) {
|
|
127756
127775
|
return new Promise((resolve14, reject) => {
|
|
127757
127776
|
const req = (0, import_node_http3.request)(
|
|
127758
127777
|
{
|
|
127759
127778
|
host,
|
|
127760
127779
|
port,
|
|
127761
|
-
path:
|
|
127780
|
+
path: path53,
|
|
127762
127781
|
method: "POST",
|
|
127763
127782
|
headers: {
|
|
127764
127783
|
"Content-Type": "application/json",
|
|
@@ -130856,16 +130875,16 @@ var MatcherView = class {
|
|
|
130856
130875
|
* @returns {string|undefined}
|
|
130857
130876
|
*/
|
|
130858
130877
|
getCurrentTag() {
|
|
130859
|
-
const
|
|
130860
|
-
return
|
|
130878
|
+
const path53 = this._matcher.path;
|
|
130879
|
+
return path53.length > 0 ? path53[path53.length - 1].tag : void 0;
|
|
130861
130880
|
}
|
|
130862
130881
|
/**
|
|
130863
130882
|
* Get current namespace.
|
|
130864
130883
|
* @returns {string|undefined}
|
|
130865
130884
|
*/
|
|
130866
130885
|
getCurrentNamespace() {
|
|
130867
|
-
const
|
|
130868
|
-
return
|
|
130886
|
+
const path53 = this._matcher.path;
|
|
130887
|
+
return path53.length > 0 ? path53[path53.length - 1].namespace : void 0;
|
|
130869
130888
|
}
|
|
130870
130889
|
/**
|
|
130871
130890
|
* Get current node's attribute value.
|
|
@@ -130873,9 +130892,9 @@ var MatcherView = class {
|
|
|
130873
130892
|
* @returns {*}
|
|
130874
130893
|
*/
|
|
130875
130894
|
getAttrValue(attrName) {
|
|
130876
|
-
const
|
|
130877
|
-
if (
|
|
130878
|
-
return
|
|
130895
|
+
const path53 = this._matcher.path;
|
|
130896
|
+
if (path53.length === 0) return void 0;
|
|
130897
|
+
return path53[path53.length - 1].values?.[attrName];
|
|
130879
130898
|
}
|
|
130880
130899
|
/**
|
|
130881
130900
|
* Check if current node has an attribute.
|
|
@@ -130883,9 +130902,9 @@ var MatcherView = class {
|
|
|
130883
130902
|
* @returns {boolean}
|
|
130884
130903
|
*/
|
|
130885
130904
|
hasAttr(attrName) {
|
|
130886
|
-
const
|
|
130887
|
-
if (
|
|
130888
|
-
const current =
|
|
130905
|
+
const path53 = this._matcher.path;
|
|
130906
|
+
if (path53.length === 0) return false;
|
|
130907
|
+
const current = path53[path53.length - 1];
|
|
130889
130908
|
return current.values !== void 0 && attrName in current.values;
|
|
130890
130909
|
}
|
|
130891
130910
|
/**
|
|
@@ -130893,18 +130912,18 @@ var MatcherView = class {
|
|
|
130893
130912
|
* @returns {number}
|
|
130894
130913
|
*/
|
|
130895
130914
|
getPosition() {
|
|
130896
|
-
const
|
|
130897
|
-
if (
|
|
130898
|
-
return
|
|
130915
|
+
const path53 = this._matcher.path;
|
|
130916
|
+
if (path53.length === 0) return -1;
|
|
130917
|
+
return path53[path53.length - 1].position ?? 0;
|
|
130899
130918
|
}
|
|
130900
130919
|
/**
|
|
130901
130920
|
* Get current node's repeat counter (occurrence count of this tag name).
|
|
130902
130921
|
* @returns {number}
|
|
130903
130922
|
*/
|
|
130904
130923
|
getCounter() {
|
|
130905
|
-
const
|
|
130906
|
-
if (
|
|
130907
|
-
return
|
|
130924
|
+
const path53 = this._matcher.path;
|
|
130925
|
+
if (path53.length === 0) return -1;
|
|
130926
|
+
return path53[path53.length - 1].counter ?? 0;
|
|
130908
130927
|
}
|
|
130909
130928
|
/**
|
|
130910
130929
|
* Get current node's sibling index (alias for getPosition).
|
|
@@ -137266,46 +137285,46 @@ var jsonReplacer = (_key, value) => {
|
|
|
137266
137285
|
};
|
|
137267
137286
|
async function writeDump(dir, filename, data) {
|
|
137268
137287
|
try {
|
|
137269
|
-
const
|
|
137288
|
+
const path53 = (0, import_path2.join)(dir, filename);
|
|
137270
137289
|
const json2 = JSON.stringify(data, jsonReplacer, 2);
|
|
137271
|
-
await import_fs.promises.writeFile(
|
|
137272
|
-
return
|
|
137290
|
+
await import_fs.promises.writeFile(path53, json2, "utf8");
|
|
137291
|
+
return path53;
|
|
137273
137292
|
} catch {
|
|
137274
137293
|
return null;
|
|
137275
137294
|
}
|
|
137276
137295
|
}
|
|
137277
137296
|
async function writeDumpCompact(dir, filename, data) {
|
|
137278
137297
|
try {
|
|
137279
|
-
const
|
|
137298
|
+
const path53 = (0, import_path2.join)(dir, filename);
|
|
137280
137299
|
const json2 = JSON.stringify(data, jsonReplacer);
|
|
137281
|
-
await import_fs.promises.writeFile(
|
|
137282
|
-
return
|
|
137300
|
+
await import_fs.promises.writeFile(path53, json2, "utf8");
|
|
137301
|
+
return path53;
|
|
137283
137302
|
} catch {
|
|
137284
137303
|
return null;
|
|
137285
137304
|
}
|
|
137286
137305
|
}
|
|
137287
|
-
async function readCpuProfile(
|
|
137288
|
-
const json2 = await import_fs.promises.readFile(
|
|
137306
|
+
async function readCpuProfile(path53) {
|
|
137307
|
+
const json2 = await import_fs.promises.readFile(path53, "utf8");
|
|
137289
137308
|
const parsed = JSON.parse(json2);
|
|
137290
137309
|
if (!parsed || typeof parsed !== "object") {
|
|
137291
137310
|
throw new Error(
|
|
137292
|
-
`On-disk CPU profile at ${
|
|
137311
|
+
`On-disk CPU profile at ${path53} is missing or not an object. The session dump is corrupt or was written by an incompatible tool-server version; rerun react-profiler-start/stop to capture a fresh session.`
|
|
137293
137312
|
);
|
|
137294
137313
|
}
|
|
137295
137314
|
if (!Array.isArray(parsed.samples) || !Array.isArray(parsed.nodes) || !Array.isArray(parsed.timeDeltas)) {
|
|
137296
137315
|
throw new Error(
|
|
137297
|
-
`On-disk CPU profile at ${
|
|
137316
|
+
`On-disk CPU profile at ${path53} is malformed (missing samples/nodes/timeDeltas). The session was likely recorded against a release build where Hermes CPU sampling never started, or the dump was truncated. Rerun react-profiler-start on a dev build and retry.`
|
|
137298
137317
|
);
|
|
137299
137318
|
}
|
|
137300
137319
|
if (typeof parsed.startTime !== "number" || typeof parsed.endTime !== "number") {
|
|
137301
137320
|
throw new Error(
|
|
137302
|
-
`On-disk CPU profile at ${
|
|
137321
|
+
`On-disk CPU profile at ${path53} is missing startTime/endTime timestamps; the recording is incomplete and cannot be analysed.`
|
|
137303
137322
|
);
|
|
137304
137323
|
}
|
|
137305
137324
|
return parsed;
|
|
137306
137325
|
}
|
|
137307
|
-
async function readCommitTree(
|
|
137308
|
-
const json2 = await import_fs.promises.readFile(
|
|
137326
|
+
async function readCommitTree(path53) {
|
|
137327
|
+
const json2 = await import_fs.promises.readFile(path53, "utf8");
|
|
137309
137328
|
return JSON.parse(json2);
|
|
137310
137329
|
}
|
|
137311
137330
|
|
|
@@ -137755,9 +137774,9 @@ init_src2();
|
|
|
137755
137774
|
var import_fs2 = require("fs");
|
|
137756
137775
|
var import_path3 = require("path");
|
|
137757
137776
|
var import_semver4 = __toESM(require_semver2());
|
|
137758
|
-
async function readFileSafe(
|
|
137777
|
+
async function readFileSafe(path53) {
|
|
137759
137778
|
try {
|
|
137760
|
-
return await import_fs2.promises.readFile(
|
|
137779
|
+
return await import_fs2.promises.readFile(path53, "utf8");
|
|
137761
137780
|
} catch {
|
|
137762
137781
|
return null;
|
|
137763
137782
|
}
|
|
@@ -139234,9 +139253,9 @@ function shortenPath(file2) {
|
|
|
139234
139253
|
const parts2 = file2.replace(/\\/g, "/").split("/");
|
|
139235
139254
|
return parts2.slice(-2).join("/");
|
|
139236
139255
|
}
|
|
139237
|
-
async function writeReport(
|
|
139256
|
+
async function writeReport(path53, content) {
|
|
139238
139257
|
try {
|
|
139239
|
-
await import_fs4.promises.writeFile(
|
|
139258
|
+
await import_fs4.promises.writeFile(path53, content, "utf8");
|
|
139240
139259
|
return true;
|
|
139241
139260
|
} catch {
|
|
139242
139261
|
return false;
|
|
@@ -140483,8 +140502,8 @@ function extractRows(xml) {
|
|
|
140483
140502
|
}
|
|
140484
140503
|
return rows;
|
|
140485
140504
|
}
|
|
140486
|
-
function isSystemLibraryPath(
|
|
140487
|
-
return SYSTEM_LIBRARY_PATH_PREFIXES.some((prefix) =>
|
|
140505
|
+
function isSystemLibraryPath(path53) {
|
|
140506
|
+
return SYSTEM_LIBRARY_PATH_PREFIXES.some((prefix) => path53.startsWith(prefix));
|
|
140488
140507
|
}
|
|
140489
140508
|
function parseCpuXml(xml, targetPid = null) {
|
|
140490
140509
|
const frameRegistry = /* @__PURE__ */ new Map();
|
|
@@ -148877,9 +148896,9 @@ function* outputReferenceFields(step) {
|
|
|
148877
148896
|
case "pinch":
|
|
148878
148897
|
case "rotate": {
|
|
148879
148898
|
if (!step.selector) return;
|
|
148880
|
-
const { path:
|
|
148881
|
-
for (const field of selectorFields(step.selector,
|
|
148882
|
-
yield alt ? { ...field, altWhere: `${alt}${field.where.slice(
|
|
148899
|
+
const { path: path53, alt } = gestureTargetPath(step);
|
|
148900
|
+
for (const field of selectorFields(step.selector, path53)) {
|
|
148901
|
+
yield alt ? { ...field, altWhere: `${alt}${field.where.slice(path53.length)}` } : field;
|
|
148883
148902
|
}
|
|
148884
148903
|
return;
|
|
148885
148904
|
}
|
|
@@ -150413,8 +150432,8 @@ async function captureFile(env, budgetMs) {
|
|
|
150413
150432
|
const ref = simulatorServerRef(env.device);
|
|
150414
150433
|
const api = await env.registry.resolveService(ref.urn, ref.options);
|
|
150415
150434
|
const panel = await resolveCapturePanel(api);
|
|
150416
|
-
const { path:
|
|
150417
|
-
return { path:
|
|
150435
|
+
const { path: path53 } = await httpScreenshot(api, void 0, void 0, CAPTURE_SCALE, panel?.screen);
|
|
150436
|
+
return { path: path53, ...panel?.warning !== void 0 ? { warning: panel.warning } : {} };
|
|
150418
150437
|
}
|
|
150419
150438
|
async function captureIosDeviceFile(env, budgetMs) {
|
|
150420
150439
|
const ref = iosDeviceRunnerRef(env.device);
|
|
@@ -153859,7 +153878,7 @@ You can still edit the .yaml file directly afterwards to remove or reorder steps
|
|
|
153859
153878
|
// ../tool-server/src/tools/flows/flow-run.ts
|
|
153860
153879
|
init_zod();
|
|
153861
153880
|
var fs63 = __toESM(require("node:fs/promises"));
|
|
153862
|
-
var
|
|
153881
|
+
var path48 = __toESM(require("node:path"));
|
|
153863
153882
|
init_src2();
|
|
153864
153883
|
|
|
153865
153884
|
// ../tool-server/src/tools/flows/project-access.ts
|
|
@@ -153951,19 +153970,25 @@ var ClientProjectAccess = class {
|
|
|
153951
153970
|
}
|
|
153952
153971
|
};
|
|
153953
153972
|
}
|
|
153954
|
-
|
|
153973
|
+
/**
|
|
153974
|
+
* A file the client sent by its path: a baseline, or a file argument of a
|
|
153975
|
+
* `tool:` step. The client sends one path once, so a tool file at a
|
|
153976
|
+
* baseline's path stands for that baseline too.
|
|
153977
|
+
*/
|
|
153978
|
+
file(filePath) {
|
|
153955
153979
|
const member = Object.hasOwn(this.members, filePath) ? this.members[filePath] : void 0;
|
|
153956
|
-
return member?.role === "baseline" ? member : void 0;
|
|
153980
|
+
return member?.role === "baseline" || member?.role === "tool" ? member : void 0;
|
|
153957
153981
|
}
|
|
153958
153982
|
/**
|
|
153959
|
-
* A baseline of this run
|
|
153960
|
-
* the client sent, else null, the "no
|
|
153961
|
-
* every baseline of its snapshots the
|
|
153983
|
+
* A baseline of this run or a file argument of a `tool:` step: the bytes
|
|
153984
|
+
* this call wrote there, else the file the client sent, else null, the "no
|
|
153985
|
+
* baseline" outcome: a compare run gets every baseline of its snapshots the
|
|
153986
|
+
* client has, and every file a `tool:` step names.
|
|
153962
153987
|
*/
|
|
153963
153988
|
async readFile(filePath) {
|
|
153964
153989
|
const written = this.overlay.get(filePath);
|
|
153965
153990
|
if (written !== void 0) return written;
|
|
153966
|
-
const member = this.
|
|
153991
|
+
const member = this.file(filePath);
|
|
153967
153992
|
if (member === void 0 || member.state === "missing") return null;
|
|
153968
153993
|
if (member.state === "present" && member.hostPath !== void 0) {
|
|
153969
153994
|
return fs60.readFile(member.hostPath);
|
|
@@ -153990,7 +154015,7 @@ var ClientProjectAccess = class {
|
|
|
153990
154015
|
}
|
|
153991
154016
|
);
|
|
153992
154017
|
}
|
|
153993
|
-
const member = this.
|
|
154018
|
+
const member = this.file(filePath);
|
|
153994
154019
|
if (member?.state === "refused") {
|
|
153995
154020
|
throw clientRefusal(filePath, member.error ?? "refused", "write");
|
|
153996
154021
|
}
|
|
@@ -154009,6 +154034,68 @@ var ClientProjectAccess = class {
|
|
|
154009
154034
|
}
|
|
154010
154035
|
};
|
|
154011
154036
|
|
|
154037
|
+
// ../tool-server/src/tools/flows/flow-tool-inputs.ts
|
|
154038
|
+
var path45 = __toESM(require("node:path"));
|
|
154039
|
+
init_src2();
|
|
154040
|
+
function toolStepFilePaths(registry2, tool, args) {
|
|
154041
|
+
return toolStepFiles(registry2.getTool(tool)?.fileInputs, args);
|
|
154042
|
+
}
|
|
154043
|
+
function isFileArgument({ spec }) {
|
|
154044
|
+
return spec.kind === "file" && spec.path === `\${${spec.target}}`;
|
|
154045
|
+
}
|
|
154046
|
+
function servedToolInput(file2, withFiles) {
|
|
154047
|
+
return isClientFileArgument(file2) && withFiles;
|
|
154048
|
+
}
|
|
154049
|
+
function refusedToolInputFix(file2) {
|
|
154050
|
+
if (isClientFileArgument(file2)) return "update";
|
|
154051
|
+
if (!isFileArgument(file2)) return void 0;
|
|
154052
|
+
return path45.posix.isAbsolute(file2.path) ? "extension" : "relative";
|
|
154053
|
+
}
|
|
154054
|
+
function withClientPaths(prepared, text) {
|
|
154055
|
+
let out = text;
|
|
154056
|
+
for (const [target, input] of Object.entries(prepared.fileInputs ?? {})) {
|
|
154057
|
+
const tempPath = prepared.args[target];
|
|
154058
|
+
if (typeof tempPath === "string" && input.viaUpload) {
|
|
154059
|
+
out = out.split(tempPath).join(input.clientPath);
|
|
154060
|
+
}
|
|
154061
|
+
}
|
|
154062
|
+
return out;
|
|
154063
|
+
}
|
|
154064
|
+
async function prepareToolStepInputs(registry2, project, toolId, args) {
|
|
154065
|
+
const files = project.mode === "client" && toolId !== "flow-execute" ? toolStepFilePaths(registry2, toolId, args).filter(
|
|
154066
|
+
({ spec }) => spec.unwrapWhenSet === void 0 || args[spec.unwrapWhenSet] === void 0
|
|
154067
|
+
) : [];
|
|
154068
|
+
if (files.length === 0) return { args, cleanup: async () => {
|
|
154069
|
+
} };
|
|
154070
|
+
const wrapped = { ...args };
|
|
154071
|
+
for (const file2 of files) {
|
|
154072
|
+
if (!isClientFileArgument(file2)) {
|
|
154073
|
+
throw new FileInputError(
|
|
154074
|
+
`"${file2.path}" (argument ${file2.spec.target} of ${toolId}) cannot be read from the client`
|
|
154075
|
+
);
|
|
154076
|
+
}
|
|
154077
|
+
const bytes = await project.readFile(file2.path);
|
|
154078
|
+
if (bytes === null) {
|
|
154079
|
+
throw new FileInputError(
|
|
154080
|
+
`the client has no file at "${file2.path}" (argument ${file2.spec.target} of ${toolId})`
|
|
154081
|
+
);
|
|
154082
|
+
}
|
|
154083
|
+
const wire = {
|
|
154084
|
+
[FILE_INPUT_MARKER]: true,
|
|
154085
|
+
path: file2.path,
|
|
154086
|
+
size: bytes.length,
|
|
154087
|
+
content: bytes.toString("base64")
|
|
154088
|
+
};
|
|
154089
|
+
wrapped[file2.spec.target] = wire;
|
|
154090
|
+
}
|
|
154091
|
+
const resolved = await resolveFileInputs({ fileInputs: files.map((f) => f.spec) }, wrapped);
|
|
154092
|
+
return {
|
|
154093
|
+
args: resolved.args,
|
|
154094
|
+
...resolved.fileInputs ? { fileInputs: resolved.fileInputs } : {},
|
|
154095
|
+
cleanup: resolved.cleanup
|
|
154096
|
+
};
|
|
154097
|
+
}
|
|
154098
|
+
|
|
154012
154099
|
// ../tool-server/src/tools/flows/flow-nested-outcome.ts
|
|
154013
154100
|
var FLOW_EXECUTE_TOOL_ID = "flow-execute";
|
|
154014
154101
|
var RUN_SEQUENCE_TOOL_ID = "run-sequence";
|
|
@@ -154089,7 +154176,7 @@ init_device_info();
|
|
|
154089
154176
|
var import_node_crypto12 = require("node:crypto");
|
|
154090
154177
|
var fs62 = __toESM(require("node:fs/promises"));
|
|
154091
154178
|
var os18 = __toESM(require("node:os"));
|
|
154092
|
-
var
|
|
154179
|
+
var path47 = __toESM(require("node:path"));
|
|
154093
154180
|
var import_pngjs4 = __toESM(require_png());
|
|
154094
154181
|
init_src2();
|
|
154095
154182
|
|
|
@@ -156189,7 +156276,7 @@ function cropIdentity(s) {
|
|
|
156189
156276
|
return JSON.stringify(cropIdentityParts(s));
|
|
156190
156277
|
}
|
|
156191
156278
|
function baselineDir(flowsDir, flowName) {
|
|
156192
|
-
return
|
|
156279
|
+
return path47.join(flowsDir, "__baselines__", flowName);
|
|
156193
156280
|
}
|
|
156194
156281
|
async function cleanupDiffDir(dir, keep) {
|
|
156195
156282
|
try {
|
|
@@ -156198,7 +156285,7 @@ async function cleanupDiffDir(dir, keep) {
|
|
|
156198
156285
|
return;
|
|
156199
156286
|
}
|
|
156200
156287
|
for (const entry of await fs62.readdir(dir)) {
|
|
156201
|
-
const entryPath =
|
|
156288
|
+
const entryPath = path47.join(dir, entry);
|
|
156202
156289
|
if (entryPath !== keep) await fs62.rm(entryPath, { recursive: true, force: true });
|
|
156203
156290
|
}
|
|
156204
156291
|
} catch {
|
|
@@ -156254,7 +156341,7 @@ async function runSnapshot(env, opts) {
|
|
|
156254
156341
|
const cropSuffix = opts.cropOn === void 0 ? "" : `-crop-${(0, import_node_crypto12.createHash)("sha256").update(cropIdentity(opts.cropOn)).digest("hex").slice(0, 8)}`;
|
|
156255
156342
|
const snapshotKey = `${opts.name}__${authoringPlatform(env.device.platform)}-${w}x${h}${cropSuffix}`;
|
|
156256
156343
|
const key2 = `${snapshotKey}.png`;
|
|
156257
|
-
const baselinePath = opts.clientFlowPath === void 0 ?
|
|
156344
|
+
const baselinePath = opts.clientFlowPath === void 0 ? path47.join(baselineDir(opts.flowsDir, opts.flowName), key2) : clientBaselinePath(opts.clientFlowPath, opts.flowName, key2);
|
|
156258
156345
|
const priorApp = opts.seenKeys.get(snapshotKey);
|
|
156259
156346
|
if (priorApp !== void 0 && priorApp !== opts.appIdentity) {
|
|
156260
156347
|
return {
|
|
@@ -156282,8 +156369,8 @@ async function runSnapshot(env, opts) {
|
|
|
156282
156369
|
let keepBaselineCopy = false;
|
|
156283
156370
|
const hostBaseline = async (bytes) => {
|
|
156284
156371
|
if (opts.clientFlowPath === void 0) return baselinePath;
|
|
156285
|
-
baselineCopyDir = await fs62.mkdtemp(
|
|
156286
|
-
const copy =
|
|
156372
|
+
baselineCopyDir = await fs62.mkdtemp(path47.join(os18.tmpdir(), "argent-flow-baseline-"));
|
|
156373
|
+
const copy = path47.join(baselineCopyDir, key2);
|
|
156287
156374
|
await fs62.writeFile(copy, bytes);
|
|
156288
156375
|
return copy;
|
|
156289
156376
|
};
|
|
@@ -156293,8 +156380,8 @@ async function runSnapshot(env, opts) {
|
|
|
156293
156380
|
};
|
|
156294
156381
|
try {
|
|
156295
156382
|
if (cropFrame !== void 0) {
|
|
156296
|
-
cropDir = await fs62.mkdtemp(
|
|
156297
|
-
const croppedPath =
|
|
156383
|
+
cropDir = await fs62.mkdtemp(path47.join(os18.tmpdir(), "argent-flow-crop-"));
|
|
156384
|
+
const croppedPath = path47.join(cropDir, key2);
|
|
156298
156385
|
const cropped = await cropPngFile(shot.image.hostPath, croppedPath, cropFrame);
|
|
156299
156386
|
if (cropped === null) {
|
|
156300
156387
|
return {
|
|
@@ -156354,7 +156441,7 @@ async function runSnapshot(env, opts) {
|
|
|
156354
156441
|
};
|
|
156355
156442
|
}
|
|
156356
156443
|
const localBaseline = await hostBaseline(stored);
|
|
156357
|
-
const outputDir = await fs62.mkdtemp(
|
|
156444
|
+
const outputDir = await fs62.mkdtemp(path47.join(os18.tmpdir(), "argent-flow-diff-"));
|
|
156358
156445
|
let keepInOutputDir;
|
|
156359
156446
|
try {
|
|
156360
156447
|
const result = await diffPngFiles({
|
|
@@ -156416,7 +156503,7 @@ async function runSnapshot(env, opts) {
|
|
|
156416
156503
|
if (baselineCopyDir !== void 0) {
|
|
156417
156504
|
await cleanupDiffDir(
|
|
156418
156505
|
baselineCopyDir,
|
|
156419
|
-
keepBaselineCopy ?
|
|
156506
|
+
keepBaselineCopy ? path47.join(baselineCopyDir, key2) : void 0
|
|
156420
156507
|
);
|
|
156421
156508
|
}
|
|
156422
156509
|
}
|
|
@@ -156520,7 +156607,7 @@ var zodSchema68 = external_exports.object({
|
|
|
156520
156607
|
"Path to the flow .yaml as readable by the tool-server. Internal \u2014 the argent client derives it from project_root and name automatically; leave unset."
|
|
156521
156608
|
),
|
|
156522
156609
|
flow_path: external_exports.string().optional().describe(
|
|
156523
|
-
"Omit when name is set. Absolute path to a flow .yaml on the client. Over a link (argent link or ARGENT_TOOLS_URL), the argent client uploads the file, its run: fragments and the snapshot baselines that the run compares, and the tool-server runs those copies. Keep run: fragments under project_root or beside the flow file. With updateBaselines, the client writes the new baselines when the run ends. Over a link, the flow and its fragments must not have script: steps
|
|
156610
|
+
"Omit when name is set. Absolute path to a flow .yaml on the client. Over a link (argent link or ARGENT_TOOLS_URL), the argent client uploads the file, its run: fragments and the snapshot baselines that the run compares, and the tool-server runs those copies. Keep run: fragments under project_root or beside the flow file. With updateBaselines, the client writes the new baselines when the run ends. The client also uploads each absolute .png or .yaml path that a tool: step takes as a file argument, when the file is under project_root or beside the flow file. Over a link, the flow and its fragments must not have: script: steps; tool: steps that run or record a flow; tool: steps that take a directory, an app or an output directory; tool: steps whose tool builds a file path from several arguments; tool: steps that name a relative path or a file other than .png or .yaml. Without a link, the tool-server reads the files in place and all step kinds run."
|
|
156524
156611
|
),
|
|
156525
156612
|
device: external_exports.string().optional().describe(
|
|
156526
156613
|
"Device id to run against (iOS UDID, Android/Vega serial, Chromium id) \u2014 the id list-devices reports. Auto-detected when omitted, but only when exactly one booted device matches (optionally narrowed by `platform`); with several booted the run fails and lists them, so pass this explicitly whenever more than one device is up."
|
|
@@ -156835,7 +156922,7 @@ function deviceEnv(state3) {
|
|
|
156835
156922
|
return { ...state3, device: state3.device };
|
|
156836
156923
|
}
|
|
156837
156924
|
function displayFlowName(params) {
|
|
156838
|
-
const stem = params.flow_path === void 0 ? void 0 :
|
|
156925
|
+
const stem = params.flow_path === void 0 ? void 0 : path48.basename(params.flow_path, ".yaml");
|
|
156839
156926
|
return params.name || stem || params.flow_path || "(unspecified)";
|
|
156840
156927
|
}
|
|
156841
156928
|
function* walkSteps(steps, within = "") {
|
|
@@ -156918,17 +157005,9 @@ function nestedFlowRef(args) {
|
|
|
156918
157005
|
if (typeof args.flow_path === "string") return ` (flow_path: ${args.flow_path})`;
|
|
156919
157006
|
return "";
|
|
156920
157007
|
}
|
|
156921
|
-
function toolStepFilePaths(registry2, tool, args) {
|
|
156922
|
-
const paths = [];
|
|
156923
|
-
for (const spec of registry2.getTool(tool)?.fileInputs ?? []) {
|
|
156924
|
-
if (spec.skipWhenSet !== void 0 && args[spec.skipWhenSet] !== void 0) continue;
|
|
156925
|
-
const filled = interpolateFileInputPath(spec.path, args);
|
|
156926
|
-
if (filled !== null) paths.push(filled);
|
|
156927
|
-
}
|
|
156928
|
-
return paths;
|
|
156929
|
-
}
|
|
156930
157008
|
function assertUploadSelfContained(registry2, flow, closure) {
|
|
156931
157009
|
const offending = [];
|
|
157010
|
+
const toolFileFixes = /* @__PURE__ */ new Set();
|
|
156932
157011
|
const queue = [{ flow, canonical: closure?.rootCanonical ?? "", within: "", hop: 0 }];
|
|
156933
157012
|
const seen = /* @__PURE__ */ new Set();
|
|
156934
157013
|
for (let file2 = queue.shift(); file2 !== void 0; file2 = queue.shift()) {
|
|
@@ -156939,7 +157018,7 @@ function assertUploadSelfContained(registry2, flow, closure) {
|
|
|
156939
157018
|
continue;
|
|
156940
157019
|
}
|
|
156941
157020
|
if (file2.hop + 1 >= MAX_RUN_DEPTH) continue;
|
|
156942
|
-
const anchorDir =
|
|
157021
|
+
const anchorDir = path48.dirname(file2.canonical);
|
|
156943
157022
|
const key2 = flowMemberKey(anchorDir, step.flow);
|
|
156944
157023
|
if (seen.has(key2)) continue;
|
|
156945
157024
|
seen.add(key2);
|
|
@@ -156976,12 +157055,18 @@ function assertUploadSelfContained(registry2, flow, closure) {
|
|
|
156976
157055
|
line: `${where}: tool: ${step.name} (records a flow)`
|
|
156977
157056
|
});
|
|
156978
157057
|
} else if (step.kind === "tool") {
|
|
156979
|
-
const
|
|
156980
|
-
|
|
157058
|
+
const refused = toolStepFilePaths(registry2, step.name, step.args).filter(
|
|
157059
|
+
(input) => !servedToolInput(input, closure !== void 0)
|
|
157060
|
+
);
|
|
157061
|
+
if (refused.length > 0) {
|
|
156981
157062
|
offending.push({
|
|
156982
157063
|
kind: "toolFile",
|
|
156983
|
-
line: `${where}: tool: ${step.name} (${
|
|
157064
|
+
line: `${where}: tool: ${step.name} (${refused.map((input) => input.path).join(", ")})`
|
|
156984
157065
|
});
|
|
157066
|
+
for (const input of refused) {
|
|
157067
|
+
const fix = refusedToolInputFix(input);
|
|
157068
|
+
if (fix !== void 0) toolFileFixes.add(fix);
|
|
157069
|
+
}
|
|
156985
157070
|
}
|
|
156986
157071
|
}
|
|
156987
157072
|
}
|
|
@@ -156989,13 +157074,18 @@ function assertUploadSelfContained(registry2, flow, closure) {
|
|
|
156989
157074
|
if (offending.length === 0) return;
|
|
156990
157075
|
const servable = [
|
|
156991
157076
|
...!closure && offending.some((o) => o.kind === "run") ? ["run: steps for a client that sends their fragments with the call"] : [],
|
|
156992
|
-
...!closure && offending.some((o) => o.kind === "snapshot") ? ["snapshot: steps for a client that sends their baselines with the call"] : []
|
|
157077
|
+
...!closure && offending.some((o) => o.kind === "snapshot") ? ["snapshot: steps for a client that sends their baselines with the call"] : [],
|
|
157078
|
+
...toolFileFixes.has("update") ? ["tool: steps with file arguments for a client that sends them with the call"] : []
|
|
156993
157079
|
];
|
|
156994
157080
|
const updateHint = servable.length > 0 ? ` This tool-server runs ${servable.join(", and ")}. Update the argent CLI or MCP adapter on the client.` : "";
|
|
157081
|
+
const pathHints = [
|
|
157082
|
+
...toolFileFixes.has("relative") ? [" Over a link, a tool: step must name a file by an absolute path."] : [],
|
|
157083
|
+
...toolFileFixes.has("extension") ? [" Over a link, a tool: step can name only a .png or .yaml file."] : []
|
|
157084
|
+
].join("");
|
|
156995
157085
|
throw new FailureError(
|
|
156996
157086
|
`This flow is not self-contained, and it arrived as an upload. The steps below read or write project files, which stay on the client:
|
|
156997
157087
|
` + offending.map((o) => ` - ${o.line}`).join("\n") + `
|
|
156998
|
-
Run the flow on the computer that runs the tool-server, with no link and no ARGENT_TOOLS_URL, so that the tool-server reads the files in place.${updateHint}`,
|
|
157088
|
+
Run the flow on the computer that runs the tool-server, with no link and no ARGENT_TOOLS_URL, so that the tool-server reads the files in place.${updateHint}${pathHints}`,
|
|
156999
157089
|
{
|
|
157000
157090
|
error_code: FAILURE_CODES.FLOW_FILE_INVALID,
|
|
157001
157091
|
failure_stage: UPLOAD_STAGE_BY_KIND[offending[0].kind],
|
|
@@ -157033,7 +157123,7 @@ Returns a per-step report: the first failure stops the run and the rest report a
|
|
|
157033
157123
|
const clientProject = rootInput?.members ? new ClientProjectAccess(rootInput.members) : void 0;
|
|
157034
157124
|
const project = clientProject ?? new HostProjectAccess();
|
|
157035
157125
|
const canonicalPath = await canonicalFlowPath(filePath);
|
|
157036
|
-
const flowsDir =
|
|
157126
|
+
const flowsDir = path48.dirname(canonicalPath);
|
|
157037
157127
|
const flow = parseFlow(await fs63.readFile(canonicalPath, "utf8"));
|
|
157038
157128
|
if (viaUpload) {
|
|
157039
157129
|
assertUploadSelfContained(
|
|
@@ -157230,7 +157320,7 @@ async function scanLeadingLaunch(flow, stack, env) {
|
|
|
157230
157320
|
let nested;
|
|
157231
157321
|
let canonical;
|
|
157232
157322
|
try {
|
|
157233
|
-
const hop = await env.project.resolveFlowFile(
|
|
157323
|
+
const hop = await env.project.resolveFlowFile(path48.dirname(top.canonical), step.flow);
|
|
157234
157324
|
canonical = hop.canonical;
|
|
157235
157325
|
if (stack.some((entry) => entry.canonical === canonical)) return null;
|
|
157236
157326
|
if (stack.length >= MAX_RUN_DEPTH) return null;
|
|
@@ -157264,7 +157354,7 @@ function launchTargetPlatform(launch, platform) {
|
|
|
157264
157354
|
return null;
|
|
157265
157355
|
}
|
|
157266
157356
|
async function resolveAppPath(specPath, flowDir) {
|
|
157267
|
-
const lexical =
|
|
157357
|
+
const lexical = path48.resolve(flowDir, specPath);
|
|
157268
157358
|
try {
|
|
157269
157359
|
return await fs63.realpath(lexical);
|
|
157270
157360
|
} catch {
|
|
@@ -157272,7 +157362,7 @@ async function resolveAppPath(specPath, flowDir) {
|
|
|
157272
157362
|
}
|
|
157273
157363
|
}
|
|
157274
157364
|
async function bootChromiumForFlow(spec, flowDir, viaUpload) {
|
|
157275
|
-
if (viaUpload && !
|
|
157365
|
+
if (viaUpload && !path48.isAbsolute(spec.path)) {
|
|
157276
157366
|
throw new FailureError(
|
|
157277
157367
|
`A relative chromium app path ("${spec.path}") resolves against the flow file's directory, which requires a run with no link and no ARGENT_TOOLS_URL \u2014 an uploaded flow has no real flow directory on this host. Use an absolute tool-server path instead.`,
|
|
157278
157368
|
{
|
|
@@ -157358,7 +157448,7 @@ function stepFlow(step, scope) {
|
|
|
157358
157448
|
return step.kind === "run" ? runDisplayName(step.flow, scope) : scopeFlow(scope);
|
|
157359
157449
|
}
|
|
157360
157450
|
function scopeFlowDir(scope) {
|
|
157361
|
-
return
|
|
157451
|
+
return path48.dirname(scope.runStack[scope.runStack.length - 1].canonical);
|
|
157362
157452
|
}
|
|
157363
157453
|
function childScope(scope, overrides = {}) {
|
|
157364
157454
|
return { ...scope, ...overrides, depth: scope.depth + 1 };
|
|
@@ -157570,7 +157660,7 @@ async function execRunStep(state3, step, scope) {
|
|
|
157570
157660
|
if (scope.runStack.length >= MAX_RUN_DEPTH) {
|
|
157571
157661
|
return fail("max run depth exceeded");
|
|
157572
157662
|
}
|
|
157573
|
-
const suppliedBase =
|
|
157663
|
+
const suppliedBase = path48.posix.basename(target);
|
|
157574
157664
|
if (spelling.state === "case_folded") {
|
|
157575
157665
|
const recovery = spelling.addressable ? `reference it as "${target.slice(0, target.length - suppliedBase.length)}${spelling.actual}"` : `rename "${spelling.actual}" to "${suppliedBase}" to compose it \u2014 flow files must be lowercase .yaml`;
|
|
157576
157666
|
return fail(
|
|
@@ -157755,8 +157845,16 @@ async function execLeafStep(state3, step, index, scope) {
|
|
|
157755
157845
|
if (UI_TURNING_TOOLS.has(step.name) && state3.lastRead) {
|
|
157756
157846
|
state3.lastRead.uiOrientation = void 0;
|
|
157757
157847
|
}
|
|
157848
|
+
let prepared;
|
|
157758
157849
|
try {
|
|
157759
|
-
|
|
157850
|
+
prepared = await prepareToolStepInputs(registry2, state3.project, step.name, args);
|
|
157851
|
+
const result = await invokeSubTool(
|
|
157852
|
+
registry2,
|
|
157853
|
+
ctx,
|
|
157854
|
+
step.name,
|
|
157855
|
+
prepared.args,
|
|
157856
|
+
prepared.fileInputs ? { fileInputs: prepared.fileInputs } : void 0
|
|
157857
|
+
);
|
|
157760
157858
|
if (isUnmetUiWaitResult(step.name, result)) {
|
|
157761
157859
|
const note = result.note;
|
|
157762
157860
|
return {
|
|
@@ -157811,8 +157909,22 @@ async function execLeafStep(state3, step, index, scope) {
|
|
|
157811
157909
|
if (signal?.aborted) {
|
|
157812
157910
|
return { ...base, status: "skip", tool: step.name, reason: ABORTED_OUTCOME.reason };
|
|
157813
157911
|
}
|
|
157814
|
-
const reframed = describeNestedParamError(
|
|
157815
|
-
|
|
157912
|
+
const reframed = describeNestedParamError(
|
|
157913
|
+
registry2,
|
|
157914
|
+
err,
|
|
157915
|
+
step.name,
|
|
157916
|
+
prepared?.args ?? args,
|
|
157917
|
+
step.args ?? {}
|
|
157918
|
+
);
|
|
157919
|
+
const reason = reframed ?? errMsg4(err);
|
|
157920
|
+
return {
|
|
157921
|
+
...base,
|
|
157922
|
+
status: "error",
|
|
157923
|
+
tool: step.name,
|
|
157924
|
+
reason: prepared ? withClientPaths(prepared, reason) : reason
|
|
157925
|
+
};
|
|
157926
|
+
} finally {
|
|
157927
|
+
await prepared?.cleanup();
|
|
157816
157928
|
}
|
|
157817
157929
|
}
|
|
157818
157930
|
case "script": {
|
|
@@ -157839,7 +157951,7 @@ function assertFlowPathShape(flowPath) {
|
|
|
157839
157951
|
error_kind: "validation"
|
|
157840
157952
|
});
|
|
157841
157953
|
}
|
|
157842
|
-
if (!
|
|
157954
|
+
if (!path48.isAbsolute(flowPath)) {
|
|
157843
157955
|
throw new FailureError(
|
|
157844
157956
|
`Invalid flow_path "${flowPath}": flow paths must be absolute \u2014 a relative path is resolved against the tool server's working directory, not the caller's. Pass the absolute path to the flow's YAML.`,
|
|
157845
157957
|
{
|
|
@@ -157863,8 +157975,8 @@ function assertFlowPathShape(flowPath) {
|
|
|
157863
157975
|
}
|
|
157864
157976
|
}
|
|
157865
157977
|
function flowNameOf(clientPath) {
|
|
157866
|
-
const clientExt =
|
|
157867
|
-
const bareExtension =
|
|
157978
|
+
const clientExt = path48.extname(clientPath);
|
|
157979
|
+
const bareExtension = path48.basename(clientPath).toLowerCase() === ".yaml";
|
|
157868
157980
|
if (!bareExtension && clientExt !== ".yaml") {
|
|
157869
157981
|
const detail = clientExt.toLowerCase() === ".yaml" ? `flow files must use the lowercase .yaml extension, not "${clientExt}".` : `flow files must use the .yaml extension.`;
|
|
157870
157982
|
throw new FailureError(`Invalid flow_path "${clientPath}": ${detail}`, {
|
|
@@ -157874,12 +157986,12 @@ function flowNameOf(clientPath) {
|
|
|
157874
157986
|
error_kind: "validation"
|
|
157875
157987
|
});
|
|
157876
157988
|
}
|
|
157877
|
-
const flowName = bareExtension ? "" :
|
|
157989
|
+
const flowName = bareExtension ? "" : path48.basename(clientPath, ".yaml");
|
|
157878
157990
|
assertSafeFlowName(flowName);
|
|
157879
157991
|
return flowName;
|
|
157880
157992
|
}
|
|
157881
157993
|
function flowPathCasingError(clientPath, spelling) {
|
|
157882
|
-
const suppliedBase =
|
|
157994
|
+
const suppliedBase = path48.basename(clientPath);
|
|
157883
157995
|
const recovery = spelling.state === "absent" ? `Pass the basename exactly as it appears on disk.` : spelling.addressable ? `Pass flow_path with the on-disk basename "${spelling.actual}".` : `Rename "${spelling.actual}" to "${suppliedBase}" to run it \u2014 flow files must be lowercase .yaml.`;
|
|
157884
157996
|
return new FailureError(
|
|
157885
157997
|
`Invalid flow_path "${clientPath}": the file must be named as it appears on disk \u2014 this filesystem matched "${suppliedBase}" case-insensitively` + (spelling.state === "case_folded" ? ` to "${spelling.actual}"` : "") + `, so the flow name (which keys the report and __baselines__/) would be one no directory entry carries. ${recovery}`,
|
|
@@ -157892,7 +158004,7 @@ function flowPathCasingError(clientPath, spelling) {
|
|
|
157892
158004
|
);
|
|
157893
158005
|
}
|
|
157894
158006
|
function flowNameCasingError(flowName, spelling) {
|
|
157895
|
-
const recovery = spelling.addressable ? `Pass name "${
|
|
158007
|
+
const recovery = spelling.addressable ? `Pass name "${path48.basename(spelling.actual, ".yaml")}".` : `Rename "${spelling.actual}" to "${flowName}.yaml" to run it \u2014 flow files must be lowercase .yaml.`;
|
|
157896
158008
|
return new FailureError(
|
|
157897
158009
|
`Invalid flow name "${flowName}": no saved flow is named "${flowName}.yaml" \u2014 this filesystem matched it case-insensitively to "${spelling.actual}", so the flow name (which keys the report and __baselines__/) would be one no directory entry carries. ` + recovery,
|
|
157898
158010
|
{
|
|
@@ -157919,7 +158031,7 @@ async function resolveFlowSource(params, fileInput, flowPathInput) {
|
|
|
157919
158031
|
assertFlowPathShape(clientPath2);
|
|
157920
158032
|
return { filePath: params.flow_path, flowName: flowNameOf(clientPath2), viaUpload: true };
|
|
157921
158033
|
}
|
|
157922
|
-
const isVerifiedHostPath = flowPathInput?.presentOnHost === true && flowPathInput.statVerified === true &&
|
|
158034
|
+
const isVerifiedHostPath = flowPathInput?.presentOnHost === true && flowPathInput.statVerified === true && path48.resolve(params.flow_path) === path48.resolve(flowPathInput.clientPath);
|
|
157923
158035
|
if (!isVerifiedHostPath) {
|
|
157924
158036
|
throw new FailureError(
|
|
157925
158037
|
`Invalid flow_path "${params.flow_path}": explicit flow paths must be supplied through the flow_path file-input boundary. Pass the client-local path and let the argent client resolve it.`,
|
|
@@ -157935,8 +158047,8 @@ async function resolveFlowSource(params, fileInput, flowPathInput) {
|
|
|
157935
158047
|
const clientPath = flowPathInput.clientPath;
|
|
157936
158048
|
const flowName2 = flowNameOf(clientPath);
|
|
157937
158049
|
const spelling2 = await classifyOnDiskSpelling(
|
|
157938
|
-
|
|
157939
|
-
|
|
158050
|
+
path48.dirname(params.flow_path),
|
|
158051
|
+
path48.basename(clientPath)
|
|
157940
158052
|
);
|
|
157941
158053
|
if (spelling2.state !== "listed") throw flowPathCasingError(clientPath, spelling2);
|
|
157942
158054
|
return { filePath: params.flow_path, flowName: flowName2, viaUpload: false };
|
|
@@ -157946,7 +158058,7 @@ async function resolveFlowSource(params, fileInput, flowPathInput) {
|
|
|
157946
158058
|
const expected = getFlowPath(params.project_root, flowName);
|
|
157947
158059
|
if (params.flow_file && fileInput?.viaUpload)
|
|
157948
158060
|
return { filePath: params.flow_file, flowName, viaUpload: true };
|
|
157949
|
-
if (params.flow_file && (!
|
|
158061
|
+
if (params.flow_file && (!path48.isAbsolute(params.flow_file) || params.flow_file.split(/[\\/]+/).includes("..") || path48.resolve(params.flow_file) !== path48.resolve(expected))) {
|
|
157950
158062
|
throw new FailureError(
|
|
157951
158063
|
`Invalid flow_file "${params.flow_file}": it must resolve to the flow's path under the project root ("${expected}"). flow_file is internal \u2014 leave it unset and pass project_root + name.`,
|
|
157952
158064
|
{
|
|
@@ -157957,7 +158069,7 @@ async function resolveFlowSource(params, fileInput, flowPathInput) {
|
|
|
157957
158069
|
}
|
|
157958
158070
|
);
|
|
157959
158071
|
}
|
|
157960
|
-
const spelling = await classifyOnDiskSpelling(
|
|
158072
|
+
const spelling = await classifyOnDiskSpelling(path48.dirname(expected), `${flowName}.yaml`);
|
|
157961
158073
|
if (spelling.state === "case_folded") throw flowNameCasingError(flowName, spelling);
|
|
157962
158074
|
return { filePath: params.flow_file || expected, flowName, viaUpload: false };
|
|
157963
158075
|
}
|
|
@@ -158046,40 +158158,40 @@ var import_promises12 = require("node:fs/promises");
|
|
|
158046
158158
|
var import_node_path23 = require("node:path");
|
|
158047
158159
|
var import_node_child_process37 = require("node:child_process");
|
|
158048
158160
|
var import_dotenv2 = __toESM(require_main());
|
|
158049
|
-
async function exists(
|
|
158161
|
+
async function exists(path53) {
|
|
158050
158162
|
try {
|
|
158051
|
-
await (0, import_promises12.access)(
|
|
158163
|
+
await (0, import_promises12.access)(path53);
|
|
158052
158164
|
return true;
|
|
158053
158165
|
} catch {
|
|
158054
158166
|
return false;
|
|
158055
158167
|
}
|
|
158056
158168
|
}
|
|
158057
|
-
async function isDirectory(
|
|
158169
|
+
async function isDirectory(path53) {
|
|
158058
158170
|
try {
|
|
158059
|
-
const s = await (0, import_promises12.stat)(
|
|
158171
|
+
const s = await (0, import_promises12.stat)(path53);
|
|
158060
158172
|
return s.isDirectory();
|
|
158061
158173
|
} catch {
|
|
158062
158174
|
return false;
|
|
158063
158175
|
}
|
|
158064
158176
|
}
|
|
158065
|
-
async function readJsonFile(
|
|
158177
|
+
async function readJsonFile(path53) {
|
|
158066
158178
|
try {
|
|
158067
|
-
const raw = await (0, import_promises12.readFile)(
|
|
158179
|
+
const raw = await (0, import_promises12.readFile)(path53, "utf-8");
|
|
158068
158180
|
return JSON.parse(raw);
|
|
158069
158181
|
} catch {
|
|
158070
158182
|
return null;
|
|
158071
158183
|
}
|
|
158072
158184
|
}
|
|
158073
|
-
async function readTextFile(
|
|
158185
|
+
async function readTextFile(path53) {
|
|
158074
158186
|
try {
|
|
158075
|
-
return await (0, import_promises12.readFile)(
|
|
158187
|
+
return await (0, import_promises12.readFile)(path53, "utf-8");
|
|
158076
158188
|
} catch {
|
|
158077
158189
|
return null;
|
|
158078
158190
|
}
|
|
158079
158191
|
}
|
|
158080
|
-
async function listDir(
|
|
158192
|
+
async function listDir(path53) {
|
|
158081
158193
|
try {
|
|
158082
|
-
const entries = await (0, import_promises12.readdir)(
|
|
158194
|
+
const entries = await (0, import_promises12.readdir)(path53);
|
|
158083
158195
|
return entries;
|
|
158084
158196
|
} catch {
|
|
158085
158197
|
return null;
|
|
@@ -158379,11 +158491,11 @@ Fails if the workspacePath is not an absolute path or the directory cannot be ac
|
|
|
158379
158491
|
// ../tool-server/src/tools/system/update-argent.ts
|
|
158380
158492
|
var import_node_child_process38 = require("node:child_process");
|
|
158381
158493
|
var fs65 = __toESM(require("node:fs"));
|
|
158382
|
-
var
|
|
158494
|
+
var path49 = __toESM(require("node:path"));
|
|
158383
158495
|
init_zod();
|
|
158384
158496
|
function resolveCliEntry() {
|
|
158385
158497
|
try {
|
|
158386
|
-
const entry =
|
|
158498
|
+
const entry = path49.join(__dirname, "cli.js");
|
|
158387
158499
|
return fs65.existsSync(entry) ? entry : null;
|
|
158388
158500
|
} catch {
|
|
158389
158501
|
return null;
|
|
@@ -158398,20 +158510,20 @@ function classifyRunningInstall() {
|
|
|
158398
158510
|
}
|
|
158399
158511
|
let runningRoot;
|
|
158400
158512
|
try {
|
|
158401
|
-
runningRoot = fs65.realpathSync(
|
|
158513
|
+
runningRoot = fs65.realpathSync(path49.dirname(__dirname));
|
|
158402
158514
|
} catch {
|
|
158403
158515
|
return { kind: "global", projectRoot: null };
|
|
158404
158516
|
}
|
|
158405
158517
|
let dir = process.cwd();
|
|
158406
158518
|
while (true) {
|
|
158407
158519
|
try {
|
|
158408
|
-
const nmReal = fs65.realpathSync(
|
|
158409
|
-
if (runningRoot === nmReal || runningRoot.startsWith(nmReal +
|
|
158520
|
+
const nmReal = fs65.realpathSync(path49.join(dir, "node_modules"));
|
|
158521
|
+
if (runningRoot === nmReal || runningRoot.startsWith(nmReal + path49.sep)) {
|
|
158410
158522
|
return { kind: "local", projectRoot: dir };
|
|
158411
158523
|
}
|
|
158412
158524
|
} catch {
|
|
158413
158525
|
}
|
|
158414
|
-
const parent =
|
|
158526
|
+
const parent = path49.dirname(dir);
|
|
158415
158527
|
if (parent === dir) break;
|
|
158416
158528
|
dir = parent;
|
|
158417
158529
|
}
|
|
@@ -158425,15 +158537,15 @@ function findDeclaringProjectRoot(startDir) {
|
|
|
158425
158537
|
return null;
|
|
158426
158538
|
}
|
|
158427
158539
|
while (true) {
|
|
158428
|
-
if (fs65.existsSync(
|
|
158540
|
+
if (fs65.existsSync(path49.join(dir, ".argent", "install.json"))) return dir;
|
|
158429
158541
|
try {
|
|
158430
|
-
const manifest = JSON.parse(fs65.readFileSync(
|
|
158542
|
+
const manifest = JSON.parse(fs65.readFileSync(path49.join(dir, "package.json"), "utf8"));
|
|
158431
158543
|
if (manifest.devDependencies?.[PACKAGE_NAME2] || manifest.dependencies?.[PACKAGE_NAME2] || manifest.optionalDependencies?.[PACKAGE_NAME2]) {
|
|
158432
158544
|
return dir;
|
|
158433
158545
|
}
|
|
158434
158546
|
} catch {
|
|
158435
158547
|
}
|
|
158436
|
-
const parent =
|
|
158548
|
+
const parent = path49.dirname(dir);
|
|
158437
158549
|
if (parent === dir) return null;
|
|
158438
158550
|
dir = parent;
|
|
158439
158551
|
}
|
|
@@ -159671,33 +159783,33 @@ function startSimulatorWatcher(registry2) {
|
|
|
159671
159783
|
var import_node_child_process40 = require("node:child_process");
|
|
159672
159784
|
var fs68 = __toESM(require("node:fs"));
|
|
159673
159785
|
var os20 = __toESM(require("node:os"));
|
|
159674
|
-
var
|
|
159786
|
+
var path51 = __toESM(require("node:path"));
|
|
159675
159787
|
function ensureLensAppBundle(electronBin) {
|
|
159676
159788
|
if (process.platform !== "darwin") return null;
|
|
159677
159789
|
try {
|
|
159678
159790
|
const realApp = electronBin.replace(/\/Contents\/MacOS\/[^/]+$/, "");
|
|
159679
159791
|
if (!realApp.endsWith(".app")) return null;
|
|
159680
|
-
const realContents =
|
|
159681
|
-
const wrapperContents =
|
|
159792
|
+
const realContents = path51.join(realApp, "Contents");
|
|
159793
|
+
const wrapperContents = path51.join(
|
|
159682
159794
|
os20.tmpdir(),
|
|
159683
159795
|
"argent-lens-app",
|
|
159684
159796
|
"Argent Lens.app",
|
|
159685
159797
|
"Contents"
|
|
159686
159798
|
);
|
|
159687
|
-
const wrapperExec =
|
|
159799
|
+
const wrapperExec = path51.join(wrapperContents, "MacOS", "Electron");
|
|
159688
159800
|
try {
|
|
159689
159801
|
if (fs68.realpathSync(wrapperExec) === fs68.realpathSync(electronBin)) return wrapperExec;
|
|
159690
159802
|
} catch {
|
|
159691
159803
|
}
|
|
159692
|
-
fs68.rmSync(
|
|
159693
|
-
fs68.mkdirSync(
|
|
159694
|
-
fs68.symlinkSync(
|
|
159695
|
-
fs68.symlinkSync(
|
|
159804
|
+
fs68.rmSync(path51.dirname(wrapperContents), { recursive: true, force: true });
|
|
159805
|
+
fs68.mkdirSync(path51.join(wrapperContents, "MacOS"), { recursive: true });
|
|
159806
|
+
fs68.symlinkSync(path51.join(realContents, "Frameworks"), path51.join(wrapperContents, "Frameworks"));
|
|
159807
|
+
fs68.symlinkSync(path51.join(realContents, "Resources"), path51.join(wrapperContents, "Resources"));
|
|
159696
159808
|
fs68.symlinkSync(electronBin, wrapperExec);
|
|
159697
|
-
const pkgInfo =
|
|
159698
|
-
if (fs68.existsSync(pkgInfo)) fs68.copyFileSync(pkgInfo,
|
|
159699
|
-
const plist =
|
|
159700
|
-
fs68.copyFileSync(
|
|
159809
|
+
const pkgInfo = path51.join(realContents, "PkgInfo");
|
|
159810
|
+
if (fs68.existsSync(pkgInfo)) fs68.copyFileSync(pkgInfo, path51.join(wrapperContents, "PkgInfo"));
|
|
159811
|
+
const plist = path51.join(wrapperContents, "Info.plist");
|
|
159812
|
+
fs68.copyFileSync(path51.join(realContents, "Info.plist"), plist);
|
|
159701
159813
|
const setPlist = (entry, value) => {
|
|
159702
159814
|
try {
|
|
159703
159815
|
(0, import_node_child_process40.execFileSync)("/usr/libexec/PlistBuddy", ["-c", `Set :${entry} ${value}`, plist]);
|
|
@@ -159738,7 +159850,7 @@ function createPreviewWindowManager(opts = {}) {
|
|
|
159738
159850
|
};
|
|
159739
159851
|
const resolveMainScript = () => {
|
|
159740
159852
|
if (opts.mainScript) return opts.mainScript;
|
|
159741
|
-
const bundled =
|
|
159853
|
+
const bundled = path51.join(__dirname, "preview-window", "main.cjs");
|
|
159742
159854
|
if (fs68.existsSync(bundled)) return bundled;
|
|
159743
159855
|
return require.resolve("@argent/preview-window/dist/main.js");
|
|
159744
159856
|
};
|
|
@@ -159885,7 +159997,7 @@ function start() {
|
|
|
159885
159997
|
attachRegistryLogger(registry2);
|
|
159886
159998
|
let eventLog = null;
|
|
159887
159999
|
if (isFlagEnabled("tool-server-event-log")) {
|
|
159888
|
-
const eventLogPath = process.env.ARGENT_EVENT_LOG ||
|
|
160000
|
+
const eventLogPath = process.env.ARGENT_EVENT_LOG || path52.join((0, import_node_os14.homedir)(), ".argent", "tool-server-events.jsonl");
|
|
159889
160001
|
try {
|
|
159890
160002
|
eventLog = createToolServerEventLog({ filePath: eventLogPath });
|
|
159891
160003
|
} catch (err) {
|