@swmansion/argent 0.27.1-next.20 → 0.27.1-next.21

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.
@@ -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 path51 = require("path");
238
+ var path52 = 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 = path51.resolve(process.cwd(), ".env.vault");
377
+ possibleVaultPath = path52.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] === "~" ? path51.join(os21.homedir(), envPath.slice(1)) : envPath;
385
+ return envPath[0] === "~" ? path52.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 = path51.resolve(process.cwd(), ".env");
402
+ const dotenvPath = path52.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 path52 of optionPaths) {
430
+ for (const path53 of optionPaths) {
431
431
  try {
432
- const parsed = DotenvModule.parse(fs69.readFileSync(path52, { encoding }));
432
+ const parsed = DotenvModule.parse(fs69.readFileSync(path53, { encoding }));
433
433
  DotenvModule.populate(parsedAll, parsed, options);
434
434
  } catch (e) {
435
435
  if (debug) {
436
- _debug(`failed to load ${path52} ${e.message}`);
436
+ _debug(`failed to load ${path53} ${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 = path51.relative(process.cwd(), filePath);
449
+ const relative5 = path52.relative(process.cwd(), filePath);
450
450
  shortPaths.push(relative5);
451
451
  } catch (e) {
452
452
  if (debug) {
@@ -1150,6 +1150,10 @@ function completeRunExtension(value) {
1150
1150
  const candidate = `${value}.yaml`;
1151
1151
  return FLOW_FILE_NAME_PATTERN.test(path5.posix.basename(candidate)) ? candidate : value;
1152
1152
  }
1153
+ function baselineKeyFor(canonicalPath, flowName) {
1154
+ const stem = path5.basename(canonicalPath, ".yaml");
1155
+ return FLOW_NAME_PATTERN.test(stem) ? stem : flowName;
1156
+ }
1153
1157
  function flowMemberKey(anchorDir, target) {
1154
1158
  return `${anchorDir}\0${target}`;
1155
1159
  }
@@ -1929,10 +1933,10 @@ function mergeDefs(...defs) {
1929
1933
  function cloneDef(schema) {
1930
1934
  return mergeDefs(schema._zod.def);
1931
1935
  }
1932
- function getElementAtPath(obj, path51) {
1933
- if (!path51)
1936
+ function getElementAtPath(obj, path52) {
1937
+ if (!path52)
1934
1938
  return obj;
1935
- return path51.reduce((acc, key2) => acc?.[key2], obj);
1939
+ return path52.reduce((acc, key2) => acc?.[key2], obj);
1936
1940
  }
1937
1941
  function promiseAllObject(promisesObj) {
1938
1942
  const keys = Object.keys(promisesObj);
@@ -2260,11 +2264,11 @@ function explicitlyAborted(x, startIndex = 0) {
2260
2264
  }
2261
2265
  return false;
2262
2266
  }
2263
- function prefixIssues(path51, issues) {
2267
+ function prefixIssues(path52, issues) {
2264
2268
  return issues.map((iss) => {
2265
2269
  var _a3;
2266
2270
  (_a3 = iss).path ?? (_a3.path = []);
2267
- iss.path.unshift(path51);
2271
+ iss.path.unshift(path52);
2268
2272
  return iss;
2269
2273
  });
2270
2274
  }
@@ -2481,16 +2485,16 @@ function flattenError(error52, mapper = (issue2) => issue2.message) {
2481
2485
  }
2482
2486
  function formatError(error52, mapper = (issue2) => issue2.message) {
2483
2487
  const fieldErrors = { _errors: [] };
2484
- const processError = (error53, path51 = []) => {
2488
+ const processError = (error53, path52 = []) => {
2485
2489
  for (const issue2 of error53.issues) {
2486
2490
  if (issue2.code === "invalid_union" && issue2.errors.length) {
2487
- issue2.errors.map((issues) => processError({ issues }, [...path51, ...issue2.path]));
2491
+ issue2.errors.map((issues) => processError({ issues }, [...path52, ...issue2.path]));
2488
2492
  } else if (issue2.code === "invalid_key") {
2489
- processError({ issues: issue2.issues }, [...path51, ...issue2.path]);
2493
+ processError({ issues: issue2.issues }, [...path52, ...issue2.path]);
2490
2494
  } else if (issue2.code === "invalid_element") {
2491
- processError({ issues: issue2.issues }, [...path51, ...issue2.path]);
2495
+ processError({ issues: issue2.issues }, [...path52, ...issue2.path]);
2492
2496
  } else {
2493
- const fullpath = [...path51, ...issue2.path];
2497
+ const fullpath = [...path52, ...issue2.path];
2494
2498
  if (fullpath.length === 0) {
2495
2499
  fieldErrors._errors.push(mapper(issue2));
2496
2500
  } else {
@@ -2517,17 +2521,17 @@ function formatError(error52, mapper = (issue2) => issue2.message) {
2517
2521
  }
2518
2522
  function treeifyError(error52, mapper = (issue2) => issue2.message) {
2519
2523
  const result = { errors: [] };
2520
- const processError = (error53, path51 = []) => {
2524
+ const processError = (error53, path52 = []) => {
2521
2525
  var _a3, _b;
2522
2526
  for (const issue2 of error53.issues) {
2523
2527
  if (issue2.code === "invalid_union" && issue2.errors.length) {
2524
- issue2.errors.map((issues) => processError({ issues }, [...path51, ...issue2.path]));
2528
+ issue2.errors.map((issues) => processError({ issues }, [...path52, ...issue2.path]));
2525
2529
  } else if (issue2.code === "invalid_key") {
2526
- processError({ issues: issue2.issues }, [...path51, ...issue2.path]);
2530
+ processError({ issues: issue2.issues }, [...path52, ...issue2.path]);
2527
2531
  } else if (issue2.code === "invalid_element") {
2528
- processError({ issues: issue2.issues }, [...path51, ...issue2.path]);
2532
+ processError({ issues: issue2.issues }, [...path52, ...issue2.path]);
2529
2533
  } else {
2530
- const fullpath = [...path51, ...issue2.path];
2534
+ const fullpath = [...path52, ...issue2.path];
2531
2535
  if (fullpath.length === 0) {
2532
2536
  result.errors.push(mapper(issue2));
2533
2537
  continue;
@@ -2559,8 +2563,8 @@ function treeifyError(error52, mapper = (issue2) => issue2.message) {
2559
2563
  }
2560
2564
  function toDotPath(_path) {
2561
2565
  const segs = [];
2562
- const path51 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
2563
- for (const seg of path51) {
2566
+ const path52 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
2567
+ for (const seg of path52) {
2564
2568
  if (typeof seg === "number")
2565
2569
  segs.push(`[${seg}]`);
2566
2570
  else if (typeof seg === "symbol")
@@ -15990,13 +15994,13 @@ function resolveRef(ref, ctx) {
15990
15994
  if (!ref.startsWith("#")) {
15991
15995
  throw new Error("External $ref is not supported, only local refs (#/...) are allowed");
15992
15996
  }
15993
- const path51 = ref.slice(1).split("/").filter(Boolean);
15994
- if (path51.length === 0) {
15997
+ const path52 = ref.slice(1).split("/").filter(Boolean);
15998
+ if (path52.length === 0) {
15995
15999
  return ctx.rootSchema;
15996
16000
  }
15997
16001
  const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions";
15998
- if (path51[0] === defsKey) {
15999
- const key2 = path51[1];
16002
+ if (path52[0] === defsKey) {
16003
+ const key2 = path52[1];
16000
16004
  if (!key2 || !ctx.defs[key2]) {
16001
16005
  throw new Error(`Reference not found: ${ref}`);
16002
16006
  }
@@ -16788,9 +16792,9 @@ function terminatingSignalCause(message) {
16788
16792
  error_kind: "unknown"
16789
16793
  });
16790
16794
  }
16791
- function valueAtPath(root, path51) {
16795
+ function valueAtPath(root, path52) {
16792
16796
  let current = root;
16793
- for (const key2 of path51) {
16797
+ for (const key2 of path52) {
16794
16798
  if (current === null || typeof current !== "object") return void 0;
16795
16799
  if (!Object.hasOwn(current, key2)) return void 0;
16796
16800
  current = current[key2];
@@ -33468,11 +33472,11 @@ var require_mime_types = __commonJS({
33468
33472
  }
33469
33473
  return exts[0];
33470
33474
  }
33471
- function lookup(path51) {
33472
- if (!path51 || typeof path51 !== "string") {
33475
+ function lookup(path52) {
33476
+ if (!path52 || typeof path52 !== "string") {
33473
33477
  return false;
33474
33478
  }
33475
- var extension3 = extname6("x." + path51).toLowerCase().slice(1);
33479
+ var extension3 = extname6("x." + path52).toLowerCase().slice(1);
33476
33480
  if (!extension3) {
33477
33481
  return false;
33478
33482
  }
@@ -37096,13 +37100,13 @@ var require_view = __commonJS({
37096
37100
  "../../node_modules/express/lib/view.js"(exports2, module2) {
37097
37101
  "use strict";
37098
37102
  var debug = require_src()("express:view");
37099
- var path51 = require("node:path");
37103
+ var path52 = require("node:path");
37100
37104
  var fs69 = require("node:fs");
37101
- var dirname17 = path51.dirname;
37102
- var basename14 = path51.basename;
37103
- var extname6 = path51.extname;
37104
- var join55 = path51.join;
37105
- var resolve14 = path51.resolve;
37105
+ var dirname18 = path52.dirname;
37106
+ var basename14 = path52.basename;
37107
+ var extname6 = path52.extname;
37108
+ var join55 = path52.join;
37109
+ var resolve14 = path52.resolve;
37106
37110
  module2.exports = View;
37107
37111
  function View(name, options) {
37108
37112
  var opts = options || {};
@@ -37131,17 +37135,17 @@ var require_view = __commonJS({
37131
37135
  this.path = this.lookup(fileName);
37132
37136
  }
37133
37137
  View.prototype.lookup = function lookup(name) {
37134
- var path52;
37138
+ var path53;
37135
37139
  var roots = [].concat(this.root);
37136
37140
  debug('lookup "%s"', name);
37137
- for (var i = 0; i < roots.length && !path52; i++) {
37141
+ for (var i = 0; i < roots.length && !path53; i++) {
37138
37142
  var root = roots[i];
37139
37143
  var loc = resolve14(root, name);
37140
- var dir = dirname17(loc);
37144
+ var dir = dirname18(loc);
37141
37145
  var file2 = basename14(loc);
37142
- path52 = this.resolve(dir, file2);
37146
+ path53 = this.resolve(dir, file2);
37143
37147
  }
37144
- return path52;
37148
+ return path53;
37145
37149
  };
37146
37150
  View.prototype.render = function render(options, callback) {
37147
37151
  var sync = true;
@@ -37163,21 +37167,21 @@ var require_view = __commonJS({
37163
37167
  };
37164
37168
  View.prototype.resolve = function resolve15(dir, file2) {
37165
37169
  var ext = this.ext;
37166
- var path52 = join55(dir, file2);
37167
- var stat6 = tryStat(path52);
37170
+ var path53 = join55(dir, file2);
37171
+ var stat6 = tryStat(path53);
37168
37172
  if (stat6 && stat6.isFile()) {
37169
- return path52;
37173
+ return path53;
37170
37174
  }
37171
- path52 = join55(dir, basename14(file2, ext), "index" + ext);
37172
- stat6 = tryStat(path52);
37175
+ path53 = join55(dir, basename14(file2, ext), "index" + ext);
37176
+ stat6 = tryStat(path53);
37173
37177
  if (stat6 && stat6.isFile()) {
37174
- return path52;
37178
+ return path53;
37175
37179
  }
37176
37180
  };
37177
- function tryStat(path52) {
37178
- debug('stat "%s"', path52);
37181
+ function tryStat(path53) {
37182
+ debug('stat "%s"', path53);
37179
37183
  try {
37180
- return fs69.statSync(path52);
37184
+ return fs69.statSync(path53);
37181
37185
  } catch (e) {
37182
37186
  return void 0;
37183
37187
  }
@@ -46787,11 +46791,11 @@ var require_mime_types2 = __commonJS({
46787
46791
  }
46788
46792
  return exts[0];
46789
46793
  }
46790
- function lookup(path51) {
46791
- if (!path51 || typeof path51 !== "string") {
46794
+ function lookup(path52) {
46795
+ if (!path52 || typeof path52 !== "string") {
46792
46796
  return false;
46793
46797
  }
46794
- var extension3 = extname6("x." + path51).toLowerCase().slice(1);
46798
+ var extension3 = extname6("x." + path52).toLowerCase().slice(1);
46795
46799
  if (!extension3) {
46796
46800
  return false;
46797
46801
  }
@@ -47922,15 +47926,15 @@ var require_dist3 = __commonJS({
47922
47926
  let index = 0;
47923
47927
  function consumeUntil(end) {
47924
47928
  const output = [];
47925
- let path51 = "";
47929
+ let path52 = "";
47926
47930
  function writePath() {
47927
- if (!path51)
47931
+ if (!path52)
47928
47932
  return;
47929
47933
  output.push({
47930
47934
  type: "text",
47931
- value: encodePath(path51)
47935
+ value: encodePath(path52)
47932
47936
  });
47933
- path51 = "";
47937
+ path52 = "";
47934
47938
  }
47935
47939
  while (index < chars.length) {
47936
47940
  const value = chars[index++];
@@ -47942,7 +47946,7 @@ var require_dist3 = __commonJS({
47942
47946
  if (index === chars.length) {
47943
47947
  throw new PathError(`Unexpected end after \\ at index ${index}`, str);
47944
47948
  }
47945
- path51 += chars[index++];
47949
+ path52 += chars[index++];
47946
47950
  continue;
47947
47951
  }
47948
47952
  if (value === ":" || value === "*") {
@@ -47986,7 +47990,7 @@ var require_dist3 = __commonJS({
47986
47990
  if (value === "}" || value === "(" || value === ")" || value === "[" || value === "]" || value === "+" || value === "?" || value === "!") {
47987
47991
  throw new PathError(`Unexpected ${value} at index ${index - 1}`, str);
47988
47992
  }
47989
- path51 += value;
47993
+ path52 += value;
47990
47994
  }
47991
47995
  if (end) {
47992
47996
  throw new PathError(`Unexpected end at index ${index}, expected ${end}`, str);
@@ -47996,17 +48000,17 @@ var require_dist3 = __commonJS({
47996
48000
  }
47997
48001
  return new TokenData(consumeUntil(""), str);
47998
48002
  }
47999
- function compile(path51, options = {}) {
48003
+ function compile(path52, options = {}) {
48000
48004
  const { encode: encode9 = encodeURIComponent, delimiter = DEFAULT_DELIMITER } = options;
48001
- const data = typeof path51 === "object" ? path51 : parse4(path51, options);
48005
+ const data = typeof path52 === "object" ? path52 : parse4(path52, options);
48002
48006
  const fn = tokensToFunction(data.tokens, delimiter, encode9);
48003
- return function path52(params = {}) {
48007
+ return function path53(params = {}) {
48004
48008
  const missing = [];
48005
- const path53 = fn(params, missing);
48009
+ const path54 = fn(params, missing);
48006
48010
  if (missing.length) {
48007
48011
  throw new TypeError(`Missing parameters: ${missing.join(", ")}`);
48008
48012
  }
48009
- return path53;
48013
+ return path54;
48010
48014
  };
48011
48015
  }
48012
48016
  function tokensToFunction(tokens, delimiter, encode9) {
@@ -48068,9 +48072,9 @@ var require_dist3 = __commonJS({
48068
48072
  return encodeValue(value);
48069
48073
  };
48070
48074
  }
48071
- function match(path51, options = {}) {
48075
+ function match(path52, options = {}) {
48072
48076
  const { decode: decode9 = decodeURIComponent, delimiter = DEFAULT_DELIMITER } = options;
48073
- const { regexp, keys } = pathToRegexp(path51, options);
48077
+ const { regexp, keys } = pathToRegexp(path52, options);
48074
48078
  const decoders = keys.map((key2) => {
48075
48079
  if (decode9 === false)
48076
48080
  return NOOP_VALUE;
@@ -48082,7 +48086,7 @@ var require_dist3 = __commonJS({
48082
48086
  const m = regexp.exec(input);
48083
48087
  if (!m)
48084
48088
  return false;
48085
- const path52 = m[0];
48089
+ const path53 = m[0];
48086
48090
  const params = /* @__PURE__ */ Object.create(null);
48087
48091
  for (let i = 1; i < m.length; i++) {
48088
48092
  if (m[i] === void 0)
@@ -48091,21 +48095,21 @@ var require_dist3 = __commonJS({
48091
48095
  const decoder = decoders[i - 1];
48092
48096
  params[key2.name] = decoder(m[i]);
48093
48097
  }
48094
- return { path: path52, params };
48098
+ return { path: path53, params };
48095
48099
  };
48096
48100
  }
48097
- function pathToRegexp(path51, options = {}) {
48101
+ function pathToRegexp(path52, options = {}) {
48098
48102
  const { delimiter = DEFAULT_DELIMITER, end = true, sensitive = false, trailing = true } = options;
48099
48103
  const keys = [];
48100
48104
  let source = "";
48101
48105
  let combinations = 0;
48102
- function process3(path52) {
48103
- if (Array.isArray(path52)) {
48104
- for (const p of path52)
48106
+ function process3(path53) {
48107
+ if (Array.isArray(path53)) {
48108
+ for (const p of path53)
48105
48109
  process3(p);
48106
48110
  return;
48107
48111
  }
48108
- const data = typeof path52 === "object" ? path52 : parse4(path52, options);
48112
+ const data = typeof path53 === "object" ? path53 : parse4(path53, options);
48109
48113
  flatten(data.tokens, 0, [], (tokens) => {
48110
48114
  if (combinations >= 256) {
48111
48115
  throw new PathError("Too many path combinations", data.originalPath);
@@ -48116,7 +48120,7 @@ var require_dist3 = __commonJS({
48116
48120
  combinations++;
48117
48121
  });
48118
48122
  }
48119
- process3(path51);
48123
+ process3(path52);
48120
48124
  let pattern = `^(?:${source})`;
48121
48125
  if (trailing)
48122
48126
  pattern += "(?:" + escape2(delimiter) + "$)?";
@@ -48256,18 +48260,18 @@ var require_layer = __commonJS({
48256
48260
  var TRAILING_SLASH_REGEXP = /\/+$/;
48257
48261
  var MATCHING_GROUP_REGEXP = /\((?:\?<(.*?)>)?(?!\?)/g;
48258
48262
  module2.exports = Layer;
48259
- function Layer(path51, options, fn) {
48263
+ function Layer(path52, options, fn) {
48260
48264
  if (!(this instanceof Layer)) {
48261
- return new Layer(path51, options, fn);
48265
+ return new Layer(path52, options, fn);
48262
48266
  }
48263
- debug("new %o", path51);
48267
+ debug("new %o", path52);
48264
48268
  const opts = options || {};
48265
48269
  this.handle = fn;
48266
48270
  this.keys = [];
48267
48271
  this.name = fn.name || "<anonymous>";
48268
48272
  this.params = void 0;
48269
48273
  this.path = void 0;
48270
- this.slash = path51 === "/" && opts.end === false;
48274
+ this.slash = path52 === "/" && opts.end === false;
48271
48275
  function matcher(_path) {
48272
48276
  if (_path instanceof RegExp) {
48273
48277
  const keys = [];
@@ -48306,7 +48310,7 @@ var require_layer = __commonJS({
48306
48310
  decode: decodeParam
48307
48311
  });
48308
48312
  }
48309
- this.matchers = Array.isArray(path51) ? path51.map(matcher) : [matcher(path51)];
48313
+ this.matchers = Array.isArray(path52) ? path52.map(matcher) : [matcher(path52)];
48310
48314
  }
48311
48315
  Layer.prototype.handleError = function handleError(error52, req, res, next) {
48312
48316
  const fn = this.handle;
@@ -48346,9 +48350,9 @@ var require_layer = __commonJS({
48346
48350
  next(err);
48347
48351
  }
48348
48352
  };
48349
- Layer.prototype.match = function match(path51) {
48353
+ Layer.prototype.match = function match(path52) {
48350
48354
  let match2;
48351
- if (path51 != null) {
48355
+ if (path52 != null) {
48352
48356
  if (this.slash) {
48353
48357
  this.params = {};
48354
48358
  this.path = "";
@@ -48356,7 +48360,7 @@ var require_layer = __commonJS({
48356
48360
  }
48357
48361
  let i = 0;
48358
48362
  while (!match2 && i < this.matchers.length) {
48359
- match2 = this.matchers[i](path51);
48363
+ match2 = this.matchers[i](path52);
48360
48364
  i++;
48361
48365
  }
48362
48366
  }
@@ -48384,13 +48388,13 @@ var require_layer = __commonJS({
48384
48388
  throw err;
48385
48389
  }
48386
48390
  }
48387
- function loosen(path51) {
48388
- if (path51 instanceof RegExp || path51 === "/") {
48389
- return path51;
48391
+ function loosen(path52) {
48392
+ if (path52 instanceof RegExp || path52 === "/") {
48393
+ return path52;
48390
48394
  }
48391
- return Array.isArray(path51) ? path51.map(function(p) {
48395
+ return Array.isArray(path52) ? path52.map(function(p) {
48392
48396
  return loosen(p);
48393
- }) : String(path51).replace(TRAILING_SLASH_REGEXP, "");
48397
+ }) : String(path52).replace(TRAILING_SLASH_REGEXP, "");
48394
48398
  }
48395
48399
  }
48396
48400
  });
@@ -48406,9 +48410,9 @@ var require_route = __commonJS({
48406
48410
  var flatten = Array.prototype.flat;
48407
48411
  var methods = METHODS.map((method) => method.toLowerCase());
48408
48412
  module2.exports = Route2;
48409
- function Route2(path51) {
48410
- debug("new %o", path51);
48411
- this.path = path51;
48413
+ function Route2(path52) {
48414
+ debug("new %o", path52);
48415
+ this.path = path52;
48412
48416
  this.stack = [];
48413
48417
  this.methods = /* @__PURE__ */ Object.create(null);
48414
48418
  }
@@ -48616,8 +48620,8 @@ var require_router = __commonJS({
48616
48620
  if (++sync > 100) {
48617
48621
  return setImmediate(next, err);
48618
48622
  }
48619
- const path51 = getPathname(req);
48620
- if (path51 == null) {
48623
+ const path52 = getPathname(req);
48624
+ if (path52 == null) {
48621
48625
  return done(layerError);
48622
48626
  }
48623
48627
  let layer;
@@ -48625,7 +48629,7 @@ var require_router = __commonJS({
48625
48629
  let route;
48626
48630
  while (match !== true && idx < stack.length) {
48627
48631
  layer = stack[idx++];
48628
- match = matchLayer(layer, path51);
48632
+ match = matchLayer(layer, path52);
48629
48633
  route = layer.route;
48630
48634
  if (typeof match !== "boolean") {
48631
48635
  layerError = layerError || match;
@@ -48663,18 +48667,18 @@ var require_router = __commonJS({
48663
48667
  } else if (route) {
48664
48668
  layer.handleRequest(req, res, next);
48665
48669
  } else {
48666
- trimPrefix(layer, layerError, layerPath, path51);
48670
+ trimPrefix(layer, layerError, layerPath, path52);
48667
48671
  }
48668
48672
  sync = 0;
48669
48673
  });
48670
48674
  }
48671
- function trimPrefix(layer, layerError, layerPath, path51) {
48675
+ function trimPrefix(layer, layerError, layerPath, path52) {
48672
48676
  if (layerPath.length !== 0) {
48673
- if (layerPath !== path51.substring(0, layerPath.length)) {
48677
+ if (layerPath !== path52.substring(0, layerPath.length)) {
48674
48678
  next(layerError);
48675
48679
  return;
48676
48680
  }
48677
- const c = path51[layerPath.length];
48681
+ const c = path52[layerPath.length];
48678
48682
  if (c && c !== "/") {
48679
48683
  next(layerError);
48680
48684
  return;
@@ -48698,7 +48702,7 @@ var require_router = __commonJS({
48698
48702
  };
48699
48703
  Router2.prototype.use = function use(handler) {
48700
48704
  let offset = 0;
48701
- let path51 = "/";
48705
+ let path52 = "/";
48702
48706
  if (typeof handler !== "function") {
48703
48707
  let arg = handler;
48704
48708
  while (Array.isArray(arg) && arg.length !== 0) {
@@ -48706,7 +48710,7 @@ var require_router = __commonJS({
48706
48710
  }
48707
48711
  if (typeof arg !== "function") {
48708
48712
  offset = 1;
48709
- path51 = handler;
48713
+ path52 = handler;
48710
48714
  }
48711
48715
  }
48712
48716
  const callbacks = flatten.call(slice.call(arguments, offset), Infinity);
@@ -48718,8 +48722,8 @@ var require_router = __commonJS({
48718
48722
  if (typeof fn !== "function") {
48719
48723
  throw new TypeError("argument handler must be a function");
48720
48724
  }
48721
- debug("use %o %s", path51, fn.name || "<anonymous>");
48722
- const layer = new Layer(path51, {
48725
+ debug("use %o %s", path52, fn.name || "<anonymous>");
48726
+ const layer = new Layer(path52, {
48723
48727
  sensitive: this.caseSensitive,
48724
48728
  strict: false,
48725
48729
  end: false
@@ -48729,9 +48733,9 @@ var require_router = __commonJS({
48729
48733
  }
48730
48734
  return this;
48731
48735
  };
48732
- Router2.prototype.route = function route(path51) {
48733
- const route2 = new Route2(path51);
48734
- const layer = new Layer(path51, {
48736
+ Router2.prototype.route = function route(path52) {
48737
+ const route2 = new Route2(path52);
48738
+ const layer = new Layer(path52, {
48735
48739
  sensitive: this.caseSensitive,
48736
48740
  strict: this.strict,
48737
48741
  end: true
@@ -48744,8 +48748,8 @@ var require_router = __commonJS({
48744
48748
  return route2;
48745
48749
  };
48746
48750
  methods.concat("all").forEach(function(method) {
48747
- Router2.prototype[method] = function(path51) {
48748
- const route = this.route(path51);
48751
+ Router2.prototype[method] = function(path52) {
48752
+ const route = this.route(path52);
48749
48753
  route[method].apply(route, slice.call(arguments, 1));
48750
48754
  return this;
48751
48755
  };
@@ -48774,9 +48778,9 @@ var require_router = __commonJS({
48774
48778
  const fqdnIndex = url2.substring(0, pathLength).indexOf("://");
48775
48779
  return fqdnIndex !== -1 ? url2.substring(0, url2.indexOf("/", 3 + fqdnIndex)) : void 0;
48776
48780
  }
48777
- function matchLayer(layer, path51) {
48781
+ function matchLayer(layer, path52) {
48778
48782
  try {
48779
- return layer.match(path51);
48783
+ return layer.match(path52);
48780
48784
  } catch (err) {
48781
48785
  return err;
48782
48786
  }
@@ -49004,7 +49008,7 @@ var require_application = __commonJS({
49004
49008
  };
49005
49009
  app.use = function use(fn) {
49006
49010
  var offset = 0;
49007
- var path51 = "/";
49011
+ var path52 = "/";
49008
49012
  if (typeof fn !== "function") {
49009
49013
  var arg = fn;
49010
49014
  while (Array.isArray(arg) && arg.length !== 0) {
@@ -49012,7 +49016,7 @@ var require_application = __commonJS({
49012
49016
  }
49013
49017
  if (typeof arg !== "function") {
49014
49018
  offset = 1;
49015
- path51 = fn;
49019
+ path52 = fn;
49016
49020
  }
49017
49021
  }
49018
49022
  var fns = flatten.call(slice.call(arguments, offset), Infinity);
@@ -49022,12 +49026,12 @@ var require_application = __commonJS({
49022
49026
  var router = this.router;
49023
49027
  fns.forEach(function(fn2) {
49024
49028
  if (!fn2 || !fn2.handle || !fn2.set) {
49025
- return router.use(path51, fn2);
49029
+ return router.use(path52, fn2);
49026
49030
  }
49027
- debug(".use app under %s", path51);
49028
- fn2.mountpath = path51;
49031
+ debug(".use app under %s", path52);
49032
+ fn2.mountpath = path52;
49029
49033
  fn2.parent = this;
49030
- router.use(path51, function mounted_app(req, res, next) {
49034
+ router.use(path52, function mounted_app(req, res, next) {
49031
49035
  var orig = req.app;
49032
49036
  fn2.handle(req, res, function(err) {
49033
49037
  Object.setPrototypeOf(req, orig.request);
@@ -49039,8 +49043,8 @@ var require_application = __commonJS({
49039
49043
  }, this);
49040
49044
  return this;
49041
49045
  };
49042
- app.route = function route(path51) {
49043
- return this.router.route(path51);
49046
+ app.route = function route(path52) {
49047
+ return this.router.route(path52);
49044
49048
  };
49045
49049
  app.engine = function engine(ext, fn) {
49046
49050
  if (typeof fn !== "function") {
@@ -49083,7 +49087,7 @@ var require_application = __commonJS({
49083
49087
  }
49084
49088
  return this;
49085
49089
  };
49086
- app.path = function path51() {
49090
+ app.path = function path52() {
49087
49091
  return this.parent ? this.parent.path() + this.mountpath : "";
49088
49092
  };
49089
49093
  app.enabled = function enabled(setting) {
@@ -49099,17 +49103,17 @@ var require_application = __commonJS({
49099
49103
  return this.set(setting, false);
49100
49104
  };
49101
49105
  methods.forEach(function(method) {
49102
- app[method] = function(path51) {
49106
+ app[method] = function(path52) {
49103
49107
  if (method === "get" && arguments.length === 1) {
49104
- return this.set(path51);
49108
+ return this.set(path52);
49105
49109
  }
49106
- var route = this.route(path51);
49110
+ var route = this.route(path52);
49107
49111
  route[method].apply(route, slice.call(arguments, 1));
49108
49112
  return this;
49109
49113
  };
49110
49114
  });
49111
- app.all = function all(path51) {
49112
- var route = this.route(path51);
49115
+ app.all = function all(path52) {
49116
+ var route = this.route(path52);
49113
49117
  var args = slice.call(arguments, 1);
49114
49118
  for (var i = 0; i < methods.length; i++) {
49115
49119
  route[methods[i]].apply(route, args);
@@ -59143,11 +59147,11 @@ var require_mime_types3 = __commonJS({
59143
59147
  }
59144
59148
  return exts[0];
59145
59149
  }
59146
- function lookup(path51) {
59147
- if (!path51 || typeof path51 !== "string") {
59150
+ function lookup(path52) {
59151
+ if (!path52 || typeof path52 !== "string") {
59148
59152
  return false;
59149
59153
  }
59150
- var extension3 = extname6("x." + path51).toLowerCase().slice(1);
59154
+ var extension3 = extname6("x." + path52).toLowerCase().slice(1);
59151
59155
  if (!extension3) {
59152
59156
  return false;
59153
59157
  }
@@ -59524,7 +59528,7 @@ var require_request = __commonJS({
59524
59528
  var subdomains2 = !isIP(hostname3) ? hostname3.split(".").reverse() : [hostname3];
59525
59529
  return subdomains2.slice(offset);
59526
59530
  });
59527
- defineGetter(req, "path", function path51() {
59531
+ defineGetter(req, "path", function path52() {
59528
59532
  return parse4(this).pathname;
59529
59533
  });
59530
59534
  defineGetter(req, "host", function host() {
@@ -59735,8 +59739,8 @@ var require_content_disposition = __commonJS({
59735
59739
  this.type = type;
59736
59740
  this.parameters = parameters;
59737
59741
  }
59738
- function basename14(path51) {
59739
- const normalized = path51.replaceAll("\\", "/");
59742
+ function basename14(path52) {
59743
+ const normalized = path52.replaceAll("\\", "/");
59740
59744
  let end = normalized.length;
59741
59745
  while (end > 0 && normalized[end - 1] === "/") {
59742
59746
  end--;
@@ -69423,11 +69427,11 @@ var require_mime_types4 = __commonJS({
69423
69427
  }
69424
69428
  return exts[0];
69425
69429
  }
69426
- function lookup(path51) {
69427
- if (!path51 || typeof path51 !== "string") {
69430
+ function lookup(path52) {
69431
+ if (!path52 || typeof path52 !== "string") {
69428
69432
  return false;
69429
69433
  }
69430
- var extension3 = extname6("x." + path51).toLowerCase().slice(1);
69434
+ var extension3 = extname6("x." + path52).toLowerCase().slice(1);
69431
69435
  if (!extension3) {
69432
69436
  return false;
69433
69437
  }
@@ -69487,27 +69491,27 @@ var require_send = __commonJS({
69487
69491
  var ms = require_ms();
69488
69492
  var onFinished = require_on_finished();
69489
69493
  var parseRange = require_range_parser();
69490
- var path51 = require("path");
69494
+ var path52 = require("path");
69491
69495
  var statuses = require_statuses();
69492
69496
  var Stream2 = require("stream");
69493
69497
  var util = require("util");
69494
- var extname6 = path51.extname;
69495
- var join55 = path51.join;
69496
- var normalize = path51.normalize;
69497
- var resolve14 = path51.resolve;
69498
- var sep5 = path51.sep;
69498
+ var extname6 = path52.extname;
69499
+ var join55 = path52.join;
69500
+ var normalize = path52.normalize;
69501
+ var resolve14 = path52.resolve;
69502
+ var sep5 = path52.sep;
69499
69503
  var BYTES_RANGE_REGEXP = /^ *bytes=/;
69500
69504
  var MAX_MAXAGE = 60 * 60 * 24 * 365 * 1e3;
69501
69505
  var UP_PATH_REGEXP = /(?:^|[\\/])\.\.(?:[\\/]|$)/;
69502
69506
  module2.exports = send;
69503
- function send(req, path52, options) {
69504
- return new SendStream(req, path52, options);
69507
+ function send(req, path53, options) {
69508
+ return new SendStream(req, path53, options);
69505
69509
  }
69506
- function SendStream(req, path52, options) {
69510
+ function SendStream(req, path53, options) {
69507
69511
  Stream2.call(this);
69508
69512
  var opts = options || {};
69509
69513
  this.options = opts;
69510
- this.path = path52;
69514
+ this.path = path53;
69511
69515
  this.req = req;
69512
69516
  this._acceptRanges = opts.acceptRanges !== void 0 ? Boolean(opts.acceptRanges) : true;
69513
69517
  this._cacheControl = opts.cacheControl !== void 0 ? Boolean(opts.cacheControl) : true;
@@ -69621,10 +69625,10 @@ var require_send = __commonJS({
69621
69625
  var lastModified = this.res.getHeader("Last-Modified");
69622
69626
  return parseHttpDate(lastModified) <= parseHttpDate(ifRange);
69623
69627
  };
69624
- SendStream.prototype.redirect = function redirect(path52) {
69628
+ SendStream.prototype.redirect = function redirect(path53) {
69625
69629
  var res = this.res;
69626
69630
  if (hasListeners(this, "directory")) {
69627
- this.emit("directory", res, path52);
69631
+ this.emit("directory", res, path53);
69628
69632
  return;
69629
69633
  }
69630
69634
  if (this.hasTrailingSlash()) {
@@ -69644,38 +69648,38 @@ var require_send = __commonJS({
69644
69648
  SendStream.prototype.pipe = function pipe2(res) {
69645
69649
  var root = this._root;
69646
69650
  this.res = res;
69647
- var path52 = decode9(this.path);
69648
- if (path52 === -1) {
69651
+ var path53 = decode9(this.path);
69652
+ if (path53 === -1) {
69649
69653
  this.error(400);
69650
69654
  return res;
69651
69655
  }
69652
- if (~path52.indexOf("\0")) {
69656
+ if (~path53.indexOf("\0")) {
69653
69657
  this.error(400);
69654
69658
  return res;
69655
69659
  }
69656
69660
  var parts2;
69657
69661
  if (root !== null) {
69658
- if (path52) {
69659
- path52 = normalize("." + sep5 + path52);
69662
+ if (path53) {
69663
+ path53 = normalize("." + sep5 + path53);
69660
69664
  }
69661
- if (UP_PATH_REGEXP.test(path52)) {
69662
- debug('malicious path "%s"', path52);
69665
+ if (UP_PATH_REGEXP.test(path53)) {
69666
+ debug('malicious path "%s"', path53);
69663
69667
  this.error(403);
69664
69668
  return res;
69665
69669
  }
69666
- parts2 = path52.split(sep5);
69667
- path52 = normalize(join55(root, path52));
69670
+ parts2 = path53.split(sep5);
69671
+ path53 = normalize(join55(root, path53));
69668
69672
  } else {
69669
- if (UP_PATH_REGEXP.test(path52)) {
69670
- debug('malicious path "%s"', path52);
69673
+ if (UP_PATH_REGEXP.test(path53)) {
69674
+ debug('malicious path "%s"', path53);
69671
69675
  this.error(403);
69672
69676
  return res;
69673
69677
  }
69674
- parts2 = normalize(path52).split(sep5);
69675
- path52 = resolve14(path52);
69678
+ parts2 = normalize(path53).split(sep5);
69679
+ path53 = resolve14(path53);
69676
69680
  }
69677
69681
  if (containsDotFile(parts2)) {
69678
- debug('%s dotfile "%s"', this._dotfiles, path52);
69682
+ debug('%s dotfile "%s"', this._dotfiles, path53);
69679
69683
  switch (this._dotfiles) {
69680
69684
  case "allow":
69681
69685
  break;
@@ -69689,13 +69693,13 @@ var require_send = __commonJS({
69689
69693
  }
69690
69694
  }
69691
69695
  if (this._index.length && this.hasTrailingSlash()) {
69692
- this.sendIndex(path52);
69696
+ this.sendIndex(path53);
69693
69697
  return res;
69694
69698
  }
69695
- this.sendFile(path52);
69699
+ this.sendFile(path53);
69696
69700
  return res;
69697
69701
  };
69698
- SendStream.prototype.send = function send2(path52, stat6) {
69702
+ SendStream.prototype.send = function send2(path53, stat6) {
69699
69703
  var len = stat6.size;
69700
69704
  var options = this.options;
69701
69705
  var opts = {};
@@ -69707,9 +69711,9 @@ var require_send = __commonJS({
69707
69711
  this.headersAlreadySent();
69708
69712
  return;
69709
69713
  }
69710
- debug('pipe "%s"', path52);
69711
- this.setHeader(path52, stat6);
69712
- this.type(path52);
69714
+ debug('pipe "%s"', path53);
69715
+ this.setHeader(path53, stat6);
69716
+ this.type(path53);
69713
69717
  if (this.isConditionalGET()) {
69714
69718
  if (this.isPreconditionFailure()) {
69715
69719
  this.error(412);
@@ -69758,28 +69762,28 @@ var require_send = __commonJS({
69758
69762
  res.end();
69759
69763
  return;
69760
69764
  }
69761
- this.stream(path52, opts);
69765
+ this.stream(path53, opts);
69762
69766
  };
69763
- SendStream.prototype.sendFile = function sendFile(path52) {
69767
+ SendStream.prototype.sendFile = function sendFile(path53) {
69764
69768
  var i = 0;
69765
69769
  var self2 = this;
69766
- debug('stat "%s"', path52);
69767
- fs69.stat(path52, function onstat(err, stat6) {
69768
- var pathEndsWithSep = path52[path52.length - 1] === sep5;
69769
- if (err && err.code === "ENOENT" && !extname6(path52) && !pathEndsWithSep) {
69770
+ debug('stat "%s"', path53);
69771
+ fs69.stat(path53, function onstat(err, stat6) {
69772
+ var pathEndsWithSep = path53[path53.length - 1] === sep5;
69773
+ if (err && err.code === "ENOENT" && !extname6(path53) && !pathEndsWithSep) {
69770
69774
  return next(err);
69771
69775
  }
69772
69776
  if (err) return self2.onStatError(err);
69773
- if (stat6.isDirectory()) return self2.redirect(path52);
69777
+ if (stat6.isDirectory()) return self2.redirect(path53);
69774
69778
  if (pathEndsWithSep) return self2.error(404);
69775
- self2.emit("file", path52, stat6);
69776
- self2.send(path52, stat6);
69779
+ self2.emit("file", path53, stat6);
69780
+ self2.send(path53, stat6);
69777
69781
  });
69778
69782
  function next(err) {
69779
69783
  if (self2._extensions.length <= i) {
69780
69784
  return err ? self2.onStatError(err) : self2.error(404);
69781
69785
  }
69782
- var p = path52 + "." + self2._extensions[i++];
69786
+ var p = path53 + "." + self2._extensions[i++];
69783
69787
  debug('stat "%s"', p);
69784
69788
  fs69.stat(p, function(err2, stat6) {
69785
69789
  if (err2) return next(err2);
@@ -69789,7 +69793,7 @@ var require_send = __commonJS({
69789
69793
  });
69790
69794
  }
69791
69795
  };
69792
- SendStream.prototype.sendIndex = function sendIndex(path52) {
69796
+ SendStream.prototype.sendIndex = function sendIndex(path53) {
69793
69797
  var i = -1;
69794
69798
  var self2 = this;
69795
69799
  function next(err) {
@@ -69797,7 +69801,7 @@ var require_send = __commonJS({
69797
69801
  if (err) return self2.onStatError(err);
69798
69802
  return self2.error(404);
69799
69803
  }
69800
- var p = join55(path52, self2._index[i]);
69804
+ var p = join55(path53, self2._index[i]);
69801
69805
  debug('stat "%s"', p);
69802
69806
  fs69.stat(p, function(err2, stat6) {
69803
69807
  if (err2) return next(err2);
@@ -69808,10 +69812,10 @@ var require_send = __commonJS({
69808
69812
  }
69809
69813
  next();
69810
69814
  };
69811
- SendStream.prototype.stream = function stream(path52, options) {
69815
+ SendStream.prototype.stream = function stream(path53, options) {
69812
69816
  var self2 = this;
69813
69817
  var res = this.res;
69814
- var stream2 = fs69.createReadStream(path52, options);
69818
+ var stream2 = fs69.createReadStream(path53, options);
69815
69819
  this.emit("stream", stream2);
69816
69820
  stream2.pipe(res);
69817
69821
  function cleanup() {
@@ -69826,17 +69830,17 @@ var require_send = __commonJS({
69826
69830
  self2.emit("end");
69827
69831
  });
69828
69832
  };
69829
- SendStream.prototype.type = function type(path52) {
69833
+ SendStream.prototype.type = function type(path53) {
69830
69834
  var res = this.res;
69831
69835
  if (res.getHeader("Content-Type")) return;
69832
- var ext = extname6(path52);
69836
+ var ext = extname6(path53);
69833
69837
  var type2 = mime.contentType(ext) || "application/octet-stream";
69834
69838
  debug("content-type %s", type2);
69835
69839
  res.setHeader("Content-Type", type2);
69836
69840
  };
69837
- SendStream.prototype.setHeader = function setHeader(path52, stat6) {
69841
+ SendStream.prototype.setHeader = function setHeader(path53, stat6) {
69838
69842
  var res = this.res;
69839
- this.emit("headers", res, path52, stat6);
69843
+ this.emit("headers", res, path53, stat6);
69840
69844
  if (this._acceptRanges && !res.getHeader("Accept-Ranges")) {
69841
69845
  debug("accept ranges");
69842
69846
  res.setHeader("Accept-Ranges", "bytes");
@@ -69894,9 +69898,9 @@ var require_send = __commonJS({
69894
69898
  }
69895
69899
  return err instanceof Error ? createError(status, err, { expose: false }) : createError(status, err);
69896
69900
  }
69897
- function decode9(path52) {
69901
+ function decode9(path53) {
69898
69902
  try {
69899
- return decodeURIComponent(path52);
69903
+ return decodeURIComponent(path53);
69900
69904
  } catch (err) {
69901
69905
  return -1;
69902
69906
  }
@@ -70040,7 +70044,7 @@ var require_response = __commonJS({
70040
70044
  var http6 = require("node:http");
70041
70045
  var onFinished = require_on_finished();
70042
70046
  var mime = require_mime_types2();
70043
- var path51 = require("node:path");
70047
+ var path52 = require("node:path");
70044
70048
  var pathIsAbsolute = require("node:path").isAbsolute;
70045
70049
  var statuses = require_statuses();
70046
70050
  var sign = require_cookie_signature().sign;
@@ -70049,8 +70053,8 @@ var require_response = __commonJS({
70049
70053
  var setCharset = require_utils3().setCharset;
70050
70054
  var cookie = require_cookie();
70051
70055
  var send = require_send();
70052
- var extname6 = path51.extname;
70053
- var resolve14 = path51.resolve;
70056
+ var extname6 = path52.extname;
70057
+ var resolve14 = path52.resolve;
70054
70058
  var vary = require_vary();
70055
70059
  var { Buffer: Buffer2 } = require("node:buffer");
70056
70060
  var res = Object.create(http6.ServerResponse.prototype);
@@ -70196,26 +70200,26 @@ var require_response = __commonJS({
70196
70200
  this.type("txt");
70197
70201
  return this.send(body);
70198
70202
  };
70199
- res.sendFile = function sendFile(path52, options, callback) {
70203
+ res.sendFile = function sendFile(path53, options, callback) {
70200
70204
  var done = callback;
70201
70205
  var req = this.req;
70202
70206
  var res2 = this;
70203
70207
  var next = req.next;
70204
70208
  var opts = options || {};
70205
- if (!path52) {
70209
+ if (!path53) {
70206
70210
  throw new TypeError("path argument is required to res.sendFile");
70207
70211
  }
70208
- if (typeof path52 !== "string") {
70212
+ if (typeof path53 !== "string") {
70209
70213
  throw new TypeError("path must be a string to res.sendFile");
70210
70214
  }
70211
70215
  if (typeof options === "function") {
70212
70216
  done = options;
70213
70217
  opts = {};
70214
70218
  }
70215
- if (!opts.root && !pathIsAbsolute(path52)) {
70219
+ if (!opts.root && !pathIsAbsolute(path53)) {
70216
70220
  throw new TypeError("path must be absolute or specify root to res.sendFile");
70217
70221
  }
70218
- var pathname = encodeURI(path52);
70222
+ var pathname = encodeURI(path53);
70219
70223
  opts.etag = this.app.enabled("etag");
70220
70224
  var file2 = send(req, pathname, opts);
70221
70225
  sendfile(res2, file2, opts, function(err) {
@@ -70226,7 +70230,7 @@ var require_response = __commonJS({
70226
70230
  }
70227
70231
  });
70228
70232
  };
70229
- res.download = function download(path52, filename, options, callback) {
70233
+ res.download = function download(path53, filename, options, callback) {
70230
70234
  var done = callback;
70231
70235
  var name = filename;
70232
70236
  var opts = options || null;
@@ -70243,7 +70247,7 @@ var require_response = __commonJS({
70243
70247
  opts = filename;
70244
70248
  }
70245
70249
  var headers = {
70246
- "Content-Disposition": contentDisposition(name || path52)
70250
+ "Content-Disposition": contentDisposition(name || path53)
70247
70251
  };
70248
70252
  if (opts && opts.headers) {
70249
70253
  var keys = Object.keys(opts.headers);
@@ -70256,7 +70260,7 @@ var require_response = __commonJS({
70256
70260
  }
70257
70261
  opts = Object.create(opts);
70258
70262
  opts.headers = headers;
70259
- var fullPath = !opts.root ? resolve14(path52) : path52;
70263
+ var fullPath = !opts.root ? resolve14(path53) : path53;
70260
70264
  return this.sendFile(fullPath, opts, done);
70261
70265
  };
70262
70266
  res.contentType = res.type = function contentType(type) {
@@ -70539,11 +70543,11 @@ var require_serve_static = __commonJS({
70539
70543
  }
70540
70544
  var forwardError = !fallthrough;
70541
70545
  var originalUrl = parseUrl.original(req);
70542
- var path51 = parseUrl(req).pathname;
70543
- if (path51 === "/" && originalUrl.pathname.substr(-1) !== "/") {
70544
- path51 = "";
70546
+ var path52 = parseUrl(req).pathname;
70547
+ if (path52 === "/" && originalUrl.pathname.substr(-1) !== "/") {
70548
+ path52 = "";
70545
70549
  }
70546
- var stream = send(req, path51, opts);
70550
+ var stream = send(req, path52, opts);
70547
70551
  stream.on("directory", onDirectory);
70548
70552
  if (setHeaders) {
70549
70553
  stream.on("headers", setHeaders);
@@ -77637,8 +77641,8 @@ __export(adb_exports, {
77637
77641
  waitForBootCompleted: () => waitForBootCompleted
77638
77642
  });
77639
77643
  async function resolveAdbOrThrow() {
77640
- const path51 = await resolveAndroidBinary("adb");
77641
- if (!path51) {
77644
+ const path52 = await resolveAndroidBinary("adb");
77645
+ if (!path52) {
77642
77646
  throw new FailureError(
77643
77647
  "`adb` not found on PATH or under `$ANDROID_HOME/platform-tools`. Install Android SDK Platform Tools or set `$ANDROID_HOME` to your SDK root.",
77644
77648
  {
@@ -77649,11 +77653,11 @@ async function resolveAdbOrThrow() {
77649
77653
  }
77650
77654
  );
77651
77655
  }
77652
- return path51;
77656
+ return path52;
77653
77657
  }
77654
77658
  async function resolveEmulatorOrThrow() {
77655
- const path51 = await resolveAndroidBinary("emulator");
77656
- if (!path51) {
77659
+ const path52 = await resolveAndroidBinary("emulator");
77660
+ if (!path52) {
77657
77661
  throw new FailureError(
77658
77662
  "`emulator` not found on PATH or under `$ANDROID_HOME/emulator`. Install the Android Emulator package or set `$ANDROID_HOME` to your SDK root.",
77659
77663
  {
@@ -77664,7 +77668,7 @@ async function resolveEmulatorOrThrow() {
77664
77668
  }
77665
77669
  );
77666
77670
  }
77667
- return path51;
77671
+ return path52;
77668
77672
  }
77669
77673
  async function emulatorSupportsFlag(flag, options = {}) {
77670
77674
  let emulatorPath;
@@ -78098,7 +78102,7 @@ var require_safe_json_stringify = __commonJS({
78098
78102
  var require_ncp = __commonJS({
78099
78103
  "../../node_modules/ncp/lib/ncp.js"(exports2, module2) {
78100
78104
  var fs69 = require("fs");
78101
- var path51 = require("path");
78105
+ var path52 = require("path");
78102
78106
  module2.exports = ncp;
78103
78107
  ncp.ncp = ncp;
78104
78108
  function ncp(source, dest, options, callback) {
@@ -78107,7 +78111,7 @@ var require_ncp = __commonJS({
78107
78111
  cback = options;
78108
78112
  options = {};
78109
78113
  }
78110
- var basePath = process.cwd(), currentPath = path51.resolve(basePath, source), targetPath = path51.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;
78114
+ var basePath = process.cwd(), currentPath = path52.resolve(basePath, source), targetPath = path52.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;
78111
78115
  limit = limit < 1 ? 1 : limit > 512 ? 512 : limit;
78112
78116
  startCopy(currentPath);
78113
78117
  function startCopy(source2) {
@@ -78158,18 +78162,18 @@ var require_ncp = __commonJS({
78158
78162
  }
78159
78163
  isWritable2(target, function(writable) {
78160
78164
  if (writable) {
78161
- return copyFile2(file2, target);
78165
+ return copyFile(file2, target);
78162
78166
  }
78163
78167
  if (clobber) {
78164
78168
  rmFile(target, function() {
78165
- copyFile2(file2, target);
78169
+ copyFile(file2, target);
78166
78170
  });
78167
78171
  }
78168
78172
  if (modified) {
78169
78173
  var stat6 = dereference ? fs69.stat : fs69.lstat;
78170
78174
  stat6(target, function(err, stats) {
78171
78175
  if (file2.mtime.getTime() > stats.mtime.getTime())
78172
- copyFile2(file2, target);
78176
+ copyFile(file2, target);
78173
78177
  else return cb();
78174
78178
  });
78175
78179
  } else {
@@ -78177,7 +78181,7 @@ var require_ncp = __commonJS({
78177
78181
  }
78178
78182
  });
78179
78183
  }
78180
- function copyFile2(file2, target) {
78184
+ function copyFile(file2, target) {
78181
78185
  var readStream = fs69.createReadStream(file2.name), writeStream = fs69.createWriteStream(target, { mode: file2.mode });
78182
78186
  readStream.on("error", onError);
78183
78187
  writeStream.on("error", onError);
@@ -78226,7 +78230,7 @@ var require_ncp = __commonJS({
78226
78230
  return onError(err);
78227
78231
  }
78228
78232
  items.forEach(function(item) {
78229
- startCopy(path51.join(dir, item));
78233
+ startCopy(path52.join(dir, item));
78230
78234
  });
78231
78235
  return cb();
78232
78236
  });
@@ -78242,7 +78246,7 @@ var require_ncp = __commonJS({
78242
78246
  }
78243
78247
  function checkLink(resolvedPath, target) {
78244
78248
  if (dereference) {
78245
- resolvedPath = path51.resolve(basePath, resolvedPath);
78249
+ resolvedPath = path52.resolve(basePath, resolvedPath);
78246
78250
  }
78247
78251
  isWritable2(target, function(writable) {
78248
78252
  if (writable) {
@@ -78253,7 +78257,7 @@ var require_ncp = __commonJS({
78253
78257
  return onError(err);
78254
78258
  }
78255
78259
  if (dereference) {
78256
- targetDest = path51.resolve(basePath, targetDest);
78260
+ targetDest = path52.resolve(basePath, targetDest);
78257
78261
  }
78258
78262
  if (targetDest === resolvedPath) {
78259
78263
  return cb();
@@ -78272,8 +78276,8 @@ var require_ncp = __commonJS({
78272
78276
  return cb();
78273
78277
  });
78274
78278
  }
78275
- function isWritable2(path52, done) {
78276
- fs69.lstat(path52, function(err) {
78279
+ function isWritable2(path53, done) {
78280
+ fs69.lstat(path53, function(err) {
78277
78281
  if (err) {
78278
78282
  if (err.code === "ENOENT") return done(true);
78279
78283
  return done(false);
@@ -78536,7 +78540,7 @@ var require_minimatch = __commonJS({
78536
78540
  "../../node_modules/glob/node_modules/minimatch/minimatch.js"(exports2, module2) {
78537
78541
  module2.exports = minimatch;
78538
78542
  minimatch.Minimatch = Minimatch;
78539
- var path51 = (function() {
78543
+ var path52 = (function() {
78540
78544
  try {
78541
78545
  return require("path");
78542
78546
  } catch (e) {
@@ -78544,7 +78548,7 @@ var require_minimatch = __commonJS({
78544
78548
  })() || {
78545
78549
  sep: "/"
78546
78550
  };
78547
- minimatch.sep = path51.sep;
78551
+ minimatch.sep = path52.sep;
78548
78552
  var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {};
78549
78553
  var expand = require_brace_expansion();
78550
78554
  var plTypes = {
@@ -78633,8 +78637,8 @@ var require_minimatch = __commonJS({
78633
78637
  assertValidPattern(pattern);
78634
78638
  if (!options) options = {};
78635
78639
  pattern = pattern.trim();
78636
- if (!options.allowWindowsEscape && path51.sep !== "/") {
78637
- pattern = pattern.split(path51.sep).join("/");
78640
+ if (!options.allowWindowsEscape && path52.sep !== "/") {
78641
+ pattern = pattern.split(path52.sep).join("/");
78638
78642
  }
78639
78643
  this.options = options;
78640
78644
  this.maxGlobstarRecursion = options.maxGlobstarRecursion !== void 0 ? options.maxGlobstarRecursion : 200;
@@ -79005,8 +79009,8 @@ var require_minimatch = __commonJS({
79005
79009
  if (this.empty) return f === "";
79006
79010
  if (f === "/" && partial2) return true;
79007
79011
  var options = this.options;
79008
- if (path51.sep !== "/") {
79009
- f = f.split(path51.sep).join("/");
79012
+ if (path52.sep !== "/") {
79013
+ f = f.split(path52.sep).join("/");
79010
79014
  }
79011
79015
  f = f.split(slashSplit);
79012
79016
  this.debug(this.pattern, "split", f);
@@ -79207,18 +79211,18 @@ var require_minimatch = __commonJS({
79207
79211
  var require_path_is_absolute = __commonJS({
79208
79212
  "../../node_modules/path-is-absolute/index.js"(exports2, module2) {
79209
79213
  "use strict";
79210
- function posix6(path51) {
79211
- return path51.charAt(0) === "/";
79214
+ function posix7(path52) {
79215
+ return path52.charAt(0) === "/";
79212
79216
  }
79213
- function win322(path51) {
79217
+ function win322(path52) {
79214
79218
  var splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/;
79215
- var result = splitDeviceRe.exec(path51);
79219
+ var result = splitDeviceRe.exec(path52);
79216
79220
  var device = result[1] || "";
79217
79221
  var isUnc = Boolean(device && device.charAt(1) !== ":");
79218
79222
  return Boolean(result[2] || isUnc);
79219
79223
  }
79220
- module2.exports = process.platform === "win32" ? win322 : posix6;
79221
- module2.exports.posix = posix6;
79224
+ module2.exports = process.platform === "win32" ? win322 : posix7;
79225
+ module2.exports.posix = posix7;
79222
79226
  module2.exports.win32 = win322;
79223
79227
  }
79224
79228
  });
@@ -79238,7 +79242,7 @@ var require_common2 = __commonJS({
79238
79242
  function ownProp(obj, field) {
79239
79243
  return Object.prototype.hasOwnProperty.call(obj, field);
79240
79244
  }
79241
- var path51 = require("path");
79245
+ var path52 = require("path");
79242
79246
  var minimatch = require_minimatch();
79243
79247
  var isAbsolute9 = require_path_is_absolute();
79244
79248
  var Minimatch = minimatch.Minimatch;
@@ -79305,10 +79309,10 @@ var require_common2 = __commonJS({
79305
79309
  self2.cwd = cwd;
79306
79310
  else {
79307
79311
  self2.cwd = options.cwd;
79308
- self2.changedCwd = path51.resolve(options.cwd) !== cwd;
79312
+ self2.changedCwd = path52.resolve(options.cwd) !== cwd;
79309
79313
  }
79310
- self2.root = options.root || path51.resolve(self2.cwd, "/");
79311
- self2.root = path51.resolve(self2.root);
79314
+ self2.root = options.root || path52.resolve(self2.cwd, "/");
79315
+ self2.root = path52.resolve(self2.root);
79312
79316
  if (process.platform === "win32")
79313
79317
  self2.root = self2.root.replace(/\\/g, "/");
79314
79318
  self2.nomount = !!options.nomount;
@@ -79382,28 +79386,28 @@ var require_common2 = __commonJS({
79382
79386
  function makeAbs(self2, f) {
79383
79387
  var abs = f;
79384
79388
  if (f.charAt(0) === "/") {
79385
- abs = path51.join(self2.root, f);
79389
+ abs = path52.join(self2.root, f);
79386
79390
  } else if (isAbsolute9(f) || f === "") {
79387
79391
  abs = f;
79388
79392
  } else if (self2.changedCwd) {
79389
- abs = path51.resolve(self2.cwd, f);
79393
+ abs = path52.resolve(self2.cwd, f);
79390
79394
  } else {
79391
- abs = path51.resolve(f);
79395
+ abs = path52.resolve(f);
79392
79396
  }
79393
79397
  return abs;
79394
79398
  }
79395
- function isIgnored(self2, path52) {
79399
+ function isIgnored(self2, path53) {
79396
79400
  if (!self2.ignore.length)
79397
79401
  return false;
79398
79402
  return self2.ignore.some(function(item) {
79399
- return item.matcher.match(path52) || !!(item.gmatcher && item.gmatcher.match(path52));
79403
+ return item.matcher.match(path53) || !!(item.gmatcher && item.gmatcher.match(path53));
79400
79404
  });
79401
79405
  }
79402
- function childrenIgnored(self2, path52) {
79406
+ function childrenIgnored(self2, path53) {
79403
79407
  if (!self2.ignore.length)
79404
79408
  return false;
79405
79409
  return self2.ignore.some(function(item) {
79406
- return !!(item.gmatcher && item.gmatcher.match(path52));
79410
+ return !!(item.gmatcher && item.gmatcher.match(path53));
79407
79411
  });
79408
79412
  }
79409
79413
  }
@@ -79419,7 +79423,7 @@ var require_sync = __commonJS({
79419
79423
  var Minimatch = minimatch.Minimatch;
79420
79424
  var Glob = require_glob().Glob;
79421
79425
  var util = require("util");
79422
- var path51 = require("path");
79426
+ var path52 = require("path");
79423
79427
  var assert2 = require("assert");
79424
79428
  var isAbsolute9 = require_path_is_absolute();
79425
79429
  var common = require_common2();
@@ -79547,7 +79551,7 @@ var require_sync = __commonJS({
79547
79551
  e = prefix + e;
79548
79552
  }
79549
79553
  if (e.charAt(0) === "/" && !this.nomount) {
79550
- e = path51.join(this.root, e);
79554
+ e = path52.join(this.root, e);
79551
79555
  }
79552
79556
  this.matches[index][e] = true;
79553
79557
  }
@@ -79684,9 +79688,9 @@ var require_sync = __commonJS({
79684
79688
  if (prefix && isAbsolute9(prefix) && !this.nomount) {
79685
79689
  var trail = /[\/\\]$/.test(prefix);
79686
79690
  if (prefix.charAt(0) === "/") {
79687
- prefix = path51.join(this.root, prefix);
79691
+ prefix = path52.join(this.root, prefix);
79688
79692
  } else {
79689
- prefix = path51.resolve(this.root, prefix);
79693
+ prefix = path52.resolve(this.root, prefix);
79690
79694
  if (trail)
79691
79695
  prefix += "/";
79692
79696
  }
@@ -79799,7 +79803,7 @@ var require_glob = __commonJS({
79799
79803
  var Minimatch = minimatch.Minimatch;
79800
79804
  var inherits = require_inherits();
79801
79805
  var EE = require("events").EventEmitter;
79802
- var path51 = require("path");
79806
+ var path52 = require("path");
79803
79807
  var assert2 = require("assert");
79804
79808
  var isAbsolute9 = require_path_is_absolute();
79805
79809
  var globSync = require_sync();
@@ -80072,7 +80076,7 @@ var require_glob = __commonJS({
80072
80076
  e = prefix + e;
80073
80077
  }
80074
80078
  if (e.charAt(0) === "/" && !this.nomount) {
80075
- e = path51.join(this.root, e);
80079
+ e = path52.join(this.root, e);
80076
80080
  }
80077
80081
  this._emitMatch(index, e);
80078
80082
  }
@@ -80251,9 +80255,9 @@ var require_glob = __commonJS({
80251
80255
  if (prefix && isAbsolute9(prefix) && !this.nomount) {
80252
80256
  var trail = /[\/\\]$/.test(prefix);
80253
80257
  if (prefix.charAt(0) === "/") {
80254
- prefix = path51.join(this.root, prefix);
80258
+ prefix = path52.join(this.root, prefix);
80255
80259
  } else {
80256
- prefix = path51.resolve(this.root, prefix);
80260
+ prefix = path52.resolve(this.root, prefix);
80257
80261
  if (trail)
80258
80262
  prefix += "/";
80259
80263
  }
@@ -80331,7 +80335,7 @@ var require_rimraf = __commonJS({
80331
80335
  module2.exports = rimraf;
80332
80336
  rimraf.sync = rimrafSync;
80333
80337
  var assert2 = require("assert");
80334
- var path51 = require("path");
80338
+ var path52 = require("path");
80335
80339
  var fs69 = require("fs");
80336
80340
  var glob = require_glob();
80337
80341
  var globOpts = {
@@ -80510,7 +80514,7 @@ var require_rimraf = __commonJS({
80510
80514
  return options.rmdir(p, cb);
80511
80515
  var errState;
80512
80516
  files.forEach(function(f) {
80513
- rimraf(path51.join(p, f), options, function(er2) {
80517
+ rimraf(path52.join(p, f), options, function(er2) {
80514
80518
  if (errState)
80515
80519
  return;
80516
80520
  if (er2)
@@ -80585,7 +80589,7 @@ var require_rimraf = __commonJS({
80585
80589
  assert2(p);
80586
80590
  assert2(options);
80587
80591
  options.readdirSync(p).forEach(function(f) {
80588
- rimrafSync(path51.join(p, f), options);
80592
+ rimrafSync(path52.join(p, f), options);
80589
80593
  });
80590
80594
  options.rmdirSync(p, options);
80591
80595
  }
@@ -80595,7 +80599,7 @@ var require_rimraf = __commonJS({
80595
80599
  // ../../node_modules/mkdirp/index.js
80596
80600
  var require_mkdirp = __commonJS({
80597
80601
  "../../node_modules/mkdirp/index.js"(exports2, module2) {
80598
- var path51 = require("path");
80602
+ var path52 = require("path");
80599
80603
  var fs69 = require("fs");
80600
80604
  var _0777 = parseInt("0777", 8);
80601
80605
  module2.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP;
@@ -80615,7 +80619,7 @@ var require_mkdirp = __commonJS({
80615
80619
  var cb = f || /* istanbul ignore next */
80616
80620
  function() {
80617
80621
  };
80618
- p = path51.resolve(p);
80622
+ p = path52.resolve(p);
80619
80623
  xfs.mkdir(p, mode, function(er) {
80620
80624
  if (!er) {
80621
80625
  made = made || p;
@@ -80623,8 +80627,8 @@ var require_mkdirp = __commonJS({
80623
80627
  }
80624
80628
  switch (er.code) {
80625
80629
  case "ENOENT":
80626
- if (path51.dirname(p) === p) return cb(er);
80627
- mkdirP(path51.dirname(p), opts, function(er2, made2) {
80630
+ if (path52.dirname(p) === p) return cb(er);
80631
+ mkdirP(path52.dirname(p), opts, function(er2, made2) {
80628
80632
  if (er2) cb(er2, made2);
80629
80633
  else mkdirP(p, opts, cb, made2);
80630
80634
  });
@@ -80651,14 +80655,14 @@ var require_mkdirp = __commonJS({
80651
80655
  mode = _0777;
80652
80656
  }
80653
80657
  if (!made) made = null;
80654
- p = path51.resolve(p);
80658
+ p = path52.resolve(p);
80655
80659
  try {
80656
80660
  xfs.mkdirSync(p, mode);
80657
80661
  made = made || p;
80658
80662
  } catch (err0) {
80659
80663
  switch (err0.code) {
80660
80664
  case "ENOENT":
80661
- made = sync(path51.dirname(p), opts, made);
80665
+ made = sync(path52.dirname(p), opts, made);
80662
80666
  sync(p, opts, made);
80663
80667
  break;
80664
80668
  // In the case of any other error, just see if there's a dir
@@ -80685,7 +80689,7 @@ var require_mv = __commonJS({
80685
80689
  "../../node_modules/mv/index.js"(exports2, module2) {
80686
80690
  var fs69 = require("fs");
80687
80691
  var ncp = require_ncp().ncp;
80688
- var path51 = require("path");
80692
+ var path52 = require("path");
80689
80693
  var rimraf = require_rimraf();
80690
80694
  var mkdirp = require_mkdirp();
80691
80695
  module2.exports = mv;
@@ -80703,7 +80707,7 @@ var require_mv = __commonJS({
80703
80707
  doRename();
80704
80708
  }
80705
80709
  function mkdirs() {
80706
- mkdirp(path51.dirname(dest), function(err) {
80710
+ mkdirp(path52.dirname(dest), function(err) {
80707
80711
  if (err) return cb(err);
80708
80712
  doRename();
80709
80713
  });
@@ -84073,17 +84077,17 @@ var require_visit = __commonJS({
84073
84077
  visit.BREAK = BREAK;
84074
84078
  visit.SKIP = SKIP;
84075
84079
  visit.REMOVE = REMOVE;
84076
- function visit_(key2, node, visitor, path51) {
84077
- const ctrl = callVisitor(key2, node, visitor, path51);
84080
+ function visit_(key2, node, visitor, path52) {
84081
+ const ctrl = callVisitor(key2, node, visitor, path52);
84078
84082
  if (identity2.isNode(ctrl) || identity2.isPair(ctrl)) {
84079
- replaceNode(key2, path51, ctrl);
84080
- return visit_(key2, ctrl, visitor, path51);
84083
+ replaceNode(key2, path52, ctrl);
84084
+ return visit_(key2, ctrl, visitor, path52);
84081
84085
  }
84082
84086
  if (typeof ctrl !== "symbol") {
84083
84087
  if (identity2.isCollection(node)) {
84084
- path51 = Object.freeze(path51.concat(node));
84088
+ path52 = Object.freeze(path52.concat(node));
84085
84089
  for (let i = 0; i < node.items.length; ++i) {
84086
- const ci = visit_(i, node.items[i], visitor, path51);
84090
+ const ci = visit_(i, node.items[i], visitor, path52);
84087
84091
  if (typeof ci === "number")
84088
84092
  i = ci - 1;
84089
84093
  else if (ci === BREAK)
@@ -84094,13 +84098,13 @@ var require_visit = __commonJS({
84094
84098
  }
84095
84099
  }
84096
84100
  } else if (identity2.isPair(node)) {
84097
- path51 = Object.freeze(path51.concat(node));
84098
- const ck = visit_("key", node.key, visitor, path51);
84101
+ path52 = Object.freeze(path52.concat(node));
84102
+ const ck = visit_("key", node.key, visitor, path52);
84099
84103
  if (ck === BREAK)
84100
84104
  return BREAK;
84101
84105
  else if (ck === REMOVE)
84102
84106
  node.key = null;
84103
- const cv = visit_("value", node.value, visitor, path51);
84107
+ const cv = visit_("value", node.value, visitor, path52);
84104
84108
  if (cv === BREAK)
84105
84109
  return BREAK;
84106
84110
  else if (cv === REMOVE)
@@ -84121,17 +84125,17 @@ var require_visit = __commonJS({
84121
84125
  visitAsync.BREAK = BREAK;
84122
84126
  visitAsync.SKIP = SKIP;
84123
84127
  visitAsync.REMOVE = REMOVE;
84124
- async function visitAsync_(key2, node, visitor, path51) {
84125
- const ctrl = await callVisitor(key2, node, visitor, path51);
84128
+ async function visitAsync_(key2, node, visitor, path52) {
84129
+ const ctrl = await callVisitor(key2, node, visitor, path52);
84126
84130
  if (identity2.isNode(ctrl) || identity2.isPair(ctrl)) {
84127
- replaceNode(key2, path51, ctrl);
84128
- return visitAsync_(key2, ctrl, visitor, path51);
84131
+ replaceNode(key2, path52, ctrl);
84132
+ return visitAsync_(key2, ctrl, visitor, path52);
84129
84133
  }
84130
84134
  if (typeof ctrl !== "symbol") {
84131
84135
  if (identity2.isCollection(node)) {
84132
- path51 = Object.freeze(path51.concat(node));
84136
+ path52 = Object.freeze(path52.concat(node));
84133
84137
  for (let i = 0; i < node.items.length; ++i) {
84134
- const ci = await visitAsync_(i, node.items[i], visitor, path51);
84138
+ const ci = await visitAsync_(i, node.items[i], visitor, path52);
84135
84139
  if (typeof ci === "number")
84136
84140
  i = ci - 1;
84137
84141
  else if (ci === BREAK)
@@ -84142,13 +84146,13 @@ var require_visit = __commonJS({
84142
84146
  }
84143
84147
  }
84144
84148
  } else if (identity2.isPair(node)) {
84145
- path51 = Object.freeze(path51.concat(node));
84146
- const ck = await visitAsync_("key", node.key, visitor, path51);
84149
+ path52 = Object.freeze(path52.concat(node));
84150
+ const ck = await visitAsync_("key", node.key, visitor, path52);
84147
84151
  if (ck === BREAK)
84148
84152
  return BREAK;
84149
84153
  else if (ck === REMOVE)
84150
84154
  node.key = null;
84151
- const cv = await visitAsync_("value", node.value, visitor, path51);
84155
+ const cv = await visitAsync_("value", node.value, visitor, path52);
84152
84156
  if (cv === BREAK)
84153
84157
  return BREAK;
84154
84158
  else if (cv === REMOVE)
@@ -84175,23 +84179,23 @@ var require_visit = __commonJS({
84175
84179
  }
84176
84180
  return visitor;
84177
84181
  }
84178
- function callVisitor(key2, node, visitor, path51) {
84182
+ function callVisitor(key2, node, visitor, path52) {
84179
84183
  if (typeof visitor === "function")
84180
- return visitor(key2, node, path51);
84184
+ return visitor(key2, node, path52);
84181
84185
  if (identity2.isMap(node))
84182
- return visitor.Map?.(key2, node, path51);
84186
+ return visitor.Map?.(key2, node, path52);
84183
84187
  if (identity2.isSeq(node))
84184
- return visitor.Seq?.(key2, node, path51);
84188
+ return visitor.Seq?.(key2, node, path52);
84185
84189
  if (identity2.isPair(node))
84186
- return visitor.Pair?.(key2, node, path51);
84190
+ return visitor.Pair?.(key2, node, path52);
84187
84191
  if (identity2.isScalar(node))
84188
- return visitor.Scalar?.(key2, node, path51);
84192
+ return visitor.Scalar?.(key2, node, path52);
84189
84193
  if (identity2.isAlias(node))
84190
- return visitor.Alias?.(key2, node, path51);
84194
+ return visitor.Alias?.(key2, node, path52);
84191
84195
  return void 0;
84192
84196
  }
84193
- function replaceNode(key2, path51, node) {
84194
- const parent = path51[path51.length - 1];
84197
+ function replaceNode(key2, path52, node) {
84198
+ const parent = path52[path52.length - 1];
84195
84199
  if (identity2.isCollection(parent)) {
84196
84200
  parent.items[key2] = node;
84197
84201
  } else if (identity2.isPair(parent)) {
@@ -84801,10 +84805,10 @@ var require_Collection = __commonJS({
84801
84805
  var createNode = require_createNode();
84802
84806
  var identity2 = require_identity();
84803
84807
  var Node = require_Node();
84804
- function collectionFromPath(schema, path51, value) {
84808
+ function collectionFromPath(schema, path52, value) {
84805
84809
  let v = value;
84806
- for (let i = path51.length - 1; i >= 0; --i) {
84807
- const k = path51[i];
84810
+ for (let i = path52.length - 1; i >= 0; --i) {
84811
+ const k = path52[i];
84808
84812
  if (typeof k === "number" && Number.isInteger(k) && k >= 0) {
84809
84813
  const a = [];
84810
84814
  a[k] = v;
@@ -84823,7 +84827,7 @@ var require_Collection = __commonJS({
84823
84827
  sourceObjects: /* @__PURE__ */ new Map()
84824
84828
  });
84825
84829
  }
84826
- var isEmptyPath = (path51) => path51 == null || typeof path51 === "object" && !!path51[Symbol.iterator]().next().done;
84830
+ var isEmptyPath = (path52) => path52 == null || typeof path52 === "object" && !!path52[Symbol.iterator]().next().done;
84827
84831
  var Collection = class extends Node.NodeBase {
84828
84832
  constructor(type, schema) {
84829
84833
  super(type);
@@ -84853,11 +84857,11 @@ var require_Collection = __commonJS({
84853
84857
  * be a Pair instance or a `{ key, value }` object, which may not have a key
84854
84858
  * that already exists in the map.
84855
84859
  */
84856
- addIn(path51, value) {
84857
- if (isEmptyPath(path51))
84860
+ addIn(path52, value) {
84861
+ if (isEmptyPath(path52))
84858
84862
  this.add(value);
84859
84863
  else {
84860
- const [key2, ...rest] = path51;
84864
+ const [key2, ...rest] = path52;
84861
84865
  const node = this.get(key2, true);
84862
84866
  if (identity2.isCollection(node))
84863
84867
  node.addIn(rest, value);
@@ -84871,8 +84875,8 @@ var require_Collection = __commonJS({
84871
84875
  * Removes a value from the collection.
84872
84876
  * @returns `true` if the item was found and removed.
84873
84877
  */
84874
- deleteIn(path51) {
84875
- const [key2, ...rest] = path51;
84878
+ deleteIn(path52) {
84879
+ const [key2, ...rest] = path52;
84876
84880
  if (rest.length === 0)
84877
84881
  return this.delete(key2);
84878
84882
  const node = this.get(key2, true);
@@ -84886,8 +84890,8 @@ var require_Collection = __commonJS({
84886
84890
  * scalar values from their surrounding node; to disable set `keepScalar` to
84887
84891
  * `true` (collections are always returned intact).
84888
84892
  */
84889
- getIn(path51, keepScalar) {
84890
- const [key2, ...rest] = path51;
84893
+ getIn(path52, keepScalar) {
84894
+ const [key2, ...rest] = path52;
84891
84895
  const node = this.get(key2, true);
84892
84896
  if (rest.length === 0)
84893
84897
  return !keepScalar && identity2.isScalar(node) ? node.value : node;
@@ -84905,8 +84909,8 @@ var require_Collection = __commonJS({
84905
84909
  /**
84906
84910
  * Checks if the collection includes a value with the key `key`.
84907
84911
  */
84908
- hasIn(path51) {
84909
- const [key2, ...rest] = path51;
84912
+ hasIn(path52) {
84913
+ const [key2, ...rest] = path52;
84910
84914
  if (rest.length === 0)
84911
84915
  return this.has(key2);
84912
84916
  const node = this.get(key2, true);
@@ -84916,8 +84920,8 @@ var require_Collection = __commonJS({
84916
84920
  * Sets a value in this collection. For `!!set`, `value` needs to be a
84917
84921
  * boolean to add/remove the item from the set.
84918
84922
  */
84919
- setIn(path51, value) {
84920
- const [key2, ...rest] = path51;
84923
+ setIn(path52, value) {
84924
+ const [key2, ...rest] = path52;
84921
84925
  if (rest.length === 0) {
84922
84926
  this.set(key2, value);
84923
84927
  } else {
@@ -87432,9 +87436,9 @@ var require_Document = __commonJS({
87432
87436
  this.contents.add(value);
87433
87437
  }
87434
87438
  /** Adds a value to the document. */
87435
- addIn(path51, value) {
87439
+ addIn(path52, value) {
87436
87440
  if (assertCollection(this.contents))
87437
- this.contents.addIn(path51, value);
87441
+ this.contents.addIn(path52, value);
87438
87442
  }
87439
87443
  /**
87440
87444
  * Create a new `Alias` node, ensuring that the target `node` has the required anchor.
@@ -87509,14 +87513,14 @@ var require_Document = __commonJS({
87509
87513
  * Removes a value from the document.
87510
87514
  * @returns `true` if the item was found and removed.
87511
87515
  */
87512
- deleteIn(path51) {
87513
- if (Collection.isEmptyPath(path51)) {
87516
+ deleteIn(path52) {
87517
+ if (Collection.isEmptyPath(path52)) {
87514
87518
  if (this.contents == null)
87515
87519
  return false;
87516
87520
  this.contents = null;
87517
87521
  return true;
87518
87522
  }
87519
- return assertCollection(this.contents) ? this.contents.deleteIn(path51) : false;
87523
+ return assertCollection(this.contents) ? this.contents.deleteIn(path52) : false;
87520
87524
  }
87521
87525
  /**
87522
87526
  * Returns item at `key`, or `undefined` if not found. By default unwraps
@@ -87531,10 +87535,10 @@ var require_Document = __commonJS({
87531
87535
  * scalar values from their surrounding node; to disable set `keepScalar` to
87532
87536
  * `true` (collections are always returned intact).
87533
87537
  */
87534
- getIn(path51, keepScalar) {
87535
- if (Collection.isEmptyPath(path51))
87538
+ getIn(path52, keepScalar) {
87539
+ if (Collection.isEmptyPath(path52))
87536
87540
  return !keepScalar && identity2.isScalar(this.contents) ? this.contents.value : this.contents;
87537
- return identity2.isCollection(this.contents) ? this.contents.getIn(path51, keepScalar) : void 0;
87541
+ return identity2.isCollection(this.contents) ? this.contents.getIn(path52, keepScalar) : void 0;
87538
87542
  }
87539
87543
  /**
87540
87544
  * Checks if the document includes a value with the key `key`.
@@ -87545,10 +87549,10 @@ var require_Document = __commonJS({
87545
87549
  /**
87546
87550
  * Checks if the document includes a value at `path`.
87547
87551
  */
87548
- hasIn(path51) {
87549
- if (Collection.isEmptyPath(path51))
87552
+ hasIn(path52) {
87553
+ if (Collection.isEmptyPath(path52))
87550
87554
  return this.contents !== void 0;
87551
- return identity2.isCollection(this.contents) ? this.contents.hasIn(path51) : false;
87555
+ return identity2.isCollection(this.contents) ? this.contents.hasIn(path52) : false;
87552
87556
  }
87553
87557
  /**
87554
87558
  * Sets a value in this document. For `!!set`, `value` needs to be a
@@ -87565,13 +87569,13 @@ var require_Document = __commonJS({
87565
87569
  * Sets a value in this document. For `!!set`, `value` needs to be a
87566
87570
  * boolean to add/remove the item from the set.
87567
87571
  */
87568
- setIn(path51, value) {
87569
- if (Collection.isEmptyPath(path51)) {
87572
+ setIn(path52, value) {
87573
+ if (Collection.isEmptyPath(path52)) {
87570
87574
  this.contents = value;
87571
87575
  } else if (this.contents == null) {
87572
- this.contents = Collection.collectionFromPath(this.schema, Array.from(path51), value);
87576
+ this.contents = Collection.collectionFromPath(this.schema, Array.from(path52), value);
87573
87577
  } else if (assertCollection(this.contents)) {
87574
- this.contents.setIn(path51, value);
87578
+ this.contents.setIn(path52, value);
87575
87579
  }
87576
87580
  }
87577
87581
  /**
@@ -89531,9 +89535,9 @@ var require_cst_visit = __commonJS({
89531
89535
  visit.BREAK = BREAK;
89532
89536
  visit.SKIP = SKIP;
89533
89537
  visit.REMOVE = REMOVE;
89534
- visit.itemAtPath = (cst, path51) => {
89538
+ visit.itemAtPath = (cst, path52) => {
89535
89539
  let item = cst;
89536
- for (const [field, index] of path51) {
89540
+ for (const [field, index] of path52) {
89537
89541
  const tok = item?.[field];
89538
89542
  if (tok && "items" in tok) {
89539
89543
  item = tok.items[index];
@@ -89542,23 +89546,23 @@ var require_cst_visit = __commonJS({
89542
89546
  }
89543
89547
  return item;
89544
89548
  };
89545
- visit.parentCollection = (cst, path51) => {
89546
- const parent = visit.itemAtPath(cst, path51.slice(0, -1));
89547
- const field = path51[path51.length - 1][0];
89549
+ visit.parentCollection = (cst, path52) => {
89550
+ const parent = visit.itemAtPath(cst, path52.slice(0, -1));
89551
+ const field = path52[path52.length - 1][0];
89548
89552
  const coll = parent?.[field];
89549
89553
  if (coll && "items" in coll)
89550
89554
  return coll;
89551
89555
  throw new Error("Parent collection not found");
89552
89556
  };
89553
- function _visit(path51, item, visitor) {
89554
- let ctrl = visitor(item, path51);
89557
+ function _visit(path52, item, visitor) {
89558
+ let ctrl = visitor(item, path52);
89555
89559
  if (typeof ctrl === "symbol")
89556
89560
  return ctrl;
89557
89561
  for (const field of ["key", "value"]) {
89558
89562
  const token = item[field];
89559
89563
  if (token && "items" in token) {
89560
89564
  for (let i = 0; i < token.items.length; ++i) {
89561
- const ci = _visit(Object.freeze(path51.concat([[field, i]])), token.items[i], visitor);
89565
+ const ci = _visit(Object.freeze(path52.concat([[field, i]])), token.items[i], visitor);
89562
89566
  if (typeof ci === "number")
89563
89567
  i = ci - 1;
89564
89568
  else if (ci === BREAK)
@@ -89569,10 +89573,10 @@ var require_cst_visit = __commonJS({
89569
89573
  }
89570
89574
  }
89571
89575
  if (typeof ctrl === "function" && field === "key")
89572
- ctrl = ctrl(item, path51);
89576
+ ctrl = ctrl(item, path52);
89573
89577
  }
89574
89578
  }
89575
- return typeof ctrl === "function" ? ctrl(item, path51) : ctrl;
89579
+ return typeof ctrl === "function" ? ctrl(item, path52) : ctrl;
89576
89580
  }
89577
89581
  exports2.visit = visit;
89578
89582
  }
@@ -91330,7 +91334,7 @@ __export(index_exports, {
91330
91334
  start: () => start
91331
91335
  });
91332
91336
  module.exports = __toCommonJS(index_exports);
91333
- var path50 = __toESM(require("node:path"));
91337
+ var path51 = __toESM(require("node:path"));
91334
91338
  var import_node_os14 = require("node:os");
91335
91339
  init_src();
91336
91340
  init_src2();
@@ -93779,7 +93783,7 @@ function appendRootPathToUrlIfNeeded(url2) {
93779
93783
  return void 0;
93780
93784
  }
93781
93785
  }
93782
- function appendResourcePathToUrl(url2, path51) {
93786
+ function appendResourcePathToUrl(url2, path52) {
93783
93787
  try {
93784
93788
  new URL(url2);
93785
93789
  } catch {
@@ -93789,11 +93793,11 @@ function appendResourcePathToUrl(url2, path51) {
93789
93793
  if (!url2.endsWith("/")) {
93790
93794
  url2 = url2 + "/";
93791
93795
  }
93792
- url2 += path51;
93796
+ url2 += path52;
93793
93797
  try {
93794
93798
  new URL(url2);
93795
93799
  } catch {
93796
- diag2.warn(`Configuration: Provided URL appended with '${path51}' is not a valid URL, using 'undefined' instead of '${url2}'`);
93800
+ diag2.warn(`Configuration: Provided URL appended with '${path52}' is not a valid URL, using 'undefined' instead of '${url2}'`);
93797
93801
  return void 0;
93798
93802
  }
93799
93803
  return url2;
@@ -94454,9 +94458,9 @@ function isReplitAgent(env) {
94454
94458
  }
94455
94459
  var DEVIN_MARKER_PATH = "/opt/.devin";
94456
94460
  var JULES_MARKER_PATH = "/opt/environment_summary.sh";
94457
- function safeExists(fileExists, path51) {
94461
+ function safeExists(fileExists, path52) {
94458
94462
  try {
94459
- return fileExists(path51);
94463
+ return fileExists(path52);
94460
94464
  } catch {
94461
94465
  return false;
94462
94466
  }
@@ -94877,7 +94881,7 @@ var _CI_VENDOR_COUNT_FOR_TEST = vendors_default.length;
94877
94881
  var SESSION_ID = (0, import_node_crypto3.randomUUID)();
94878
94882
  function readCliVersion() {
94879
94883
  if (true) {
94880
- return "0.27.1-next.20";
94884
+ return "0.27.1-next.21";
94881
94885
  }
94882
94886
  return "0.0.0";
94883
94887
  }
@@ -95840,18 +95844,18 @@ async function resolveVegaBinary() {
95840
95844
  }
95841
95845
  const onPath = await commandOnPath("vega") ?? await commandOnPath("kepler");
95842
95846
  const fallback = (0, import_node_path5.join)((0, import_node_os3.homedir)(), "vega", "bin", "vega");
95843
- const path51 = onPath ?? (await isExecutable(fallback) ? fallback : null);
95844
- cachedVegaBinary = { path: path51, checkedAt: now };
95845
- return path51;
95847
+ const path52 = onPath ?? (await isExecutable(fallback) ? fallback : null);
95848
+ cachedVegaBinary = { path: path52, checkedAt: now };
95849
+ return path52;
95846
95850
  }
95847
95851
  async function resolveVegaOrThrow() {
95848
- const path51 = await resolveVegaBinary();
95849
- if (!path51) {
95852
+ const path52 = await resolveVegaBinary();
95853
+ if (!path52) {
95850
95854
  throw new Error(
95851
95855
  "`vega` (or `kepler`) not found on PATH or under `~/vega/bin`. Install the Vega SDK and run `source ~/vega/env`, then retry."
95852
95856
  );
95853
95857
  }
95854
- return path51;
95858
+ return path52;
95855
95859
  }
95856
95860
  var VEGA_KILL_SIGNAL = "SIGKILL";
95857
95861
  async function reapVegaGroup(child) {
@@ -98359,50 +98363,50 @@ function from(...paths) {
98359
98363
  const joined = paths.join("/");
98360
98364
  return joined.replace(/\/+/g, "/").replace(/^\/+/, "").replace(/\/+$/, "");
98361
98365
  }
98362
- function parts(path51) {
98363
- return path51 === "" ? [] : path51.split("/");
98366
+ function parts(path52) {
98367
+ return path52 === "" ? [] : path52.split("/");
98364
98368
  }
98365
98369
  function decode3(raw) {
98366
- const path51 = from(raw);
98367
- return encode3(path51);
98370
+ const path52 = from(raw);
98371
+ return encode3(path52);
98368
98372
  }
98369
- function encode3(path51) {
98370
- if (parts(path51).length > MAX_PARTS) {
98373
+ function encode3(path52) {
98374
+ if (parts(path52).length > MAX_PARTS) {
98371
98375
  throw new Error(`path exceeds ${MAX_PARTS} parts`);
98372
98376
  }
98373
- return path51;
98377
+ return path52;
98374
98378
  }
98375
- function hasPrefix(prefix, path51) {
98379
+ function hasPrefix(prefix, path52) {
98376
98380
  if (prefix === "") {
98377
98381
  return true;
98378
98382
  }
98379
- if (!path51.startsWith(prefix)) {
98383
+ if (!path52.startsWith(prefix)) {
98380
98384
  return false;
98381
98385
  }
98382
- if (path51.length === prefix.length) {
98386
+ if (path52.length === prefix.length) {
98383
98387
  return true;
98384
98388
  }
98385
- return path51[prefix.length] === "/";
98389
+ return path52[prefix.length] === "/";
98386
98390
  }
98387
- function stripPrefix(prefix, path51) {
98388
- if (!hasPrefix(prefix, path51)) {
98391
+ function stripPrefix(prefix, path52) {
98392
+ if (!hasPrefix(prefix, path52)) {
98389
98393
  return null;
98390
98394
  }
98391
98395
  if (prefix === "") {
98392
- return path51;
98396
+ return path52;
98393
98397
  }
98394
- if (path51.length === prefix.length) {
98398
+ if (path52.length === prefix.length) {
98395
98399
  return "";
98396
98400
  }
98397
- return path51.slice(prefix.length + 1);
98401
+ return path52.slice(prefix.length + 1);
98398
98402
  }
98399
- function join13(path51, other) {
98400
- if (path51 === "") {
98403
+ function join13(path52, other) {
98404
+ if (path52 === "") {
98401
98405
  return other;
98402
98406
  } else if (other === "") {
98403
- return path51;
98407
+ return path52;
98404
98408
  } else {
98405
- return `${path51}/${other}`;
98409
+ return `${path52}/${other}`;
98406
98410
  }
98407
98411
  }
98408
98412
  function empty() {
@@ -101707,12 +101711,12 @@ var Publisher = class {
101707
101711
  * Publishes a broadcast with any associated tracks.
101708
101712
  * Opens a bidi stream to send PublishNamespace and waits for response.
101709
101713
  */
101710
- publish(path51, broadcast) {
101711
- this.#broadcasts.set(path51, broadcast);
101712
- this.#notifyConsumers(path51, true);
101713
- void this.#runPublish(path51, broadcast);
101714
+ publish(path52, broadcast) {
101715
+ this.#broadcasts.set(path52, broadcast);
101716
+ this.#notifyConsumers(path52, true);
101717
+ void this.#runPublish(path52, broadcast);
101714
101718
  }
101715
- async #runPublish(path51, broadcast) {
101719
+ async #runPublish(path52, broadcast) {
101716
101720
  try {
101717
101721
  const requestId = await this.#session.nextRequestId();
101718
101722
  if (requestId === void 0)
@@ -101720,7 +101724,7 @@ var Publisher = class {
101720
101724
  const stream = await this.#session.openBi();
101721
101725
  try {
101722
101726
  await stream.writer.u53(PublishNamespace.id);
101723
- const msg = new PublishNamespace({ requestId, trackNamespace: path51 });
101727
+ const msg = new PublishNamespace({ requestId, trackNamespace: path52 });
101724
101728
  await msg.encode(stream.writer, this.#session.version);
101725
101729
  const respTypeId = await stream.reader.u53();
101726
101730
  if (respTypeId === RequestOk.id) {
@@ -101736,7 +101740,7 @@ var Publisher = class {
101736
101740
  if (this.#session.version === Version.DRAFT_14 || this.#session.version === Version.DRAFT_15 || this.#session.version === Version.DRAFT_16) {
101737
101741
  try {
101738
101742
  await stream.writer.u53(PublishNamespaceDone.id);
101739
- const done = new PublishNamespaceDone({ trackNamespace: path51, requestId });
101743
+ const done = new PublishNamespaceDone({ trackNamespace: path52, requestId });
101740
101744
  await done.encode(stream.writer, this.#session.version);
101741
101745
  } catch {
101742
101746
  }
@@ -101748,11 +101752,11 @@ var Publisher = class {
101748
101752
  }
101749
101753
  } catch (err) {
101750
101754
  const e = error51(err);
101751
- console.warn(`announce failed: broadcast=${path51} error=${e.message}`);
101755
+ console.warn(`announce failed: broadcast=${path52} error=${e.message}`);
101752
101756
  } finally {
101753
101757
  broadcast.close();
101754
- this.#broadcasts.delete(path51);
101755
- this.#notifyConsumers(path51, false);
101758
+ this.#broadcasts.delete(path52);
101759
+ this.#notifyConsumers(path52, false);
101756
101760
  }
101757
101761
  }
101758
101762
  /**
@@ -101944,9 +101948,9 @@ var Publisher = class {
101944
101948
  }
101945
101949
  stream.close();
101946
101950
  }
101947
- #notifyConsumers(path51, active) {
101951
+ #notifyConsumers(path52, active) {
101948
101952
  for (const consumer of this.#announcedConsumers) {
101949
- const suffix = stripPrefix(consumer.prefix, path51);
101953
+ const suffix = stripPrefix(consumer.prefix, path52);
101950
101954
  if (suffix === null)
101951
101955
  continue;
101952
101956
  try {
@@ -102075,23 +102079,23 @@ var Subscriber = class {
102075
102079
  const msgType = await stream.reader.u53();
102076
102080
  if (msgType === SubscribeNamespaceEntry.id) {
102077
102081
  const entry = await SubscribeNamespaceEntry.decode(stream.reader, version3);
102078
- const path51 = join13(prefix, entry.suffix);
102079
- console.debug(`announced: broadcast=${path51} active=true`);
102080
- this.#announced.add(path51);
102082
+ const path52 = join13(prefix, entry.suffix);
102083
+ console.debug(`announced: broadcast=${path52} active=true`);
102084
+ this.#announced.add(path52);
102081
102085
  for (const consumer of this.#announcedConsumers) {
102082
- if (!hasPrefix(consumer.prefix, path51))
102086
+ if (!hasPrefix(consumer.prefix, path52))
102083
102087
  continue;
102084
- consumer.append({ path: path51, active: true });
102088
+ consumer.append({ path: path52, active: true });
102085
102089
  }
102086
102090
  } else if (msgType === SubscribeNamespaceEntryDone.id) {
102087
102091
  const entry = await SubscribeNamespaceEntryDone.decode(stream.reader, version3);
102088
- const path51 = join13(prefix, entry.suffix);
102089
- console.debug(`announced: broadcast=${path51} active=false`);
102090
- this.#announced.delete(path51);
102092
+ const path52 = join13(prefix, entry.suffix);
102093
+ console.debug(`announced: broadcast=${path52} active=false`);
102094
+ this.#announced.delete(path52);
102091
102095
  for (const consumer of this.#announcedConsumers) {
102092
- if (!hasPrefix(consumer.prefix, path51))
102096
+ if (!hasPrefix(consumer.prefix, path52))
102093
102097
  continue;
102094
- consumer.append({ path: path51, active: false });
102098
+ consumer.append({ path: path52, active: false });
102095
102099
  }
102096
102100
  } else if (msgType === PublishBlocked.id && version3 === Version.DRAFT_17) {
102097
102101
  const blocked = await PublishBlocked.decode(stream.reader, version3);
@@ -102123,14 +102127,14 @@ var Subscriber = class {
102123
102127
  /**
102124
102128
  * Consumes a broadcast from the connection.
102125
102129
  */
102126
- consume(path51) {
102130
+ consume(path52) {
102127
102131
  const broadcast = new Broadcast();
102128
102132
  void (async () => {
102129
102133
  for (; ; ) {
102130
102134
  const request3 = await broadcast.requested();
102131
102135
  if (!request3)
102132
102136
  break;
102133
- void this.#runSubscribe(path51, request3);
102137
+ void this.#runSubscribe(path52, request3);
102134
102138
  }
102135
102139
  })();
102136
102140
  return broadcast;
@@ -102210,8 +102214,8 @@ var Subscriber = class {
102210
102214
  */
102211
102215
  async runPublishNamespace(msg, stream) {
102212
102216
  const version3 = this.#session.version;
102213
- const path51 = msg.trackNamespace;
102214
- if (this.#announced.has(path51)) {
102217
+ const path52 = msg.trackNamespace;
102218
+ if (this.#announced.has(path52)) {
102215
102219
  console.warn("duplicate PublishNamespace");
102216
102220
  if (version3 === Version.DRAFT_14) {
102217
102221
  await stream.writer.u53(PublishNamespaceError.id);
@@ -102233,7 +102237,7 @@ var Subscriber = class {
102233
102237
  stream.close();
102234
102238
  return;
102235
102239
  }
102236
- this.#announced.add(path51);
102240
+ this.#announced.add(path52);
102237
102241
  try {
102238
102242
  if (version3 === Version.DRAFT_14) {
102239
102243
  await stream.writer.u53(PublishNamespaceOk.id);
@@ -102246,25 +102250,25 @@ var Subscriber = class {
102246
102250
  });
102247
102251
  await ok.encode(stream.writer, version3);
102248
102252
  }
102249
- console.debug(`announced: broadcast=${path51} active=true`);
102253
+ console.debug(`announced: broadcast=${path52} active=true`);
102250
102254
  for (const consumer of this.#announcedConsumers) {
102251
- const suffix = stripPrefix(consumer.prefix, path51);
102255
+ const suffix = stripPrefix(consumer.prefix, path52);
102252
102256
  if (suffix === null)
102253
102257
  continue;
102254
- consumer.append({ path: path51, active: true });
102258
+ consumer.append({ path: path52, active: true });
102255
102259
  }
102256
- console.debug(`runPublishNamespace: awaiting stream.reader.closed for ${path51}`);
102260
+ console.debug(`runPublishNamespace: awaiting stream.reader.closed for ${path52}`);
102257
102261
  await stream.reader.closed;
102258
- console.debug(`runPublishNamespace: stream.reader.closed resolved for ${path51}`);
102262
+ console.debug(`runPublishNamespace: stream.reader.closed resolved for ${path52}`);
102259
102263
  } finally {
102260
- this.#announced.delete(path51);
102261
- console.debug(`announced: broadcast=${path51} active=false`);
102264
+ this.#announced.delete(path52);
102265
+ console.debug(`announced: broadcast=${path52} active=false`);
102262
102266
  for (const consumer of this.#announcedConsumers) {
102263
- const suffix = stripPrefix(consumer.prefix, path51);
102267
+ const suffix = stripPrefix(consumer.prefix, path52);
102264
102268
  if (suffix === null)
102265
102269
  continue;
102266
102270
  try {
102267
- consumer.append({ path: path51, active: false });
102271
+ consumer.append({ path: path52, active: false });
102268
102272
  } catch {
102269
102273
  }
102270
102274
  }
@@ -102403,8 +102407,8 @@ var Connection = class {
102403
102407
  * @param name - The broadcast path to publish
102404
102408
  * @param broadcast - The broadcast to publish
102405
102409
  */
102406
- publish(path51, broadcast) {
102407
- this.#publisher.publish(path51, broadcast);
102410
+ publish(path52, broadcast) {
102411
+ this.#publisher.publish(path52, broadcast);
102408
102412
  }
102409
102413
  /**
102410
102414
  * Gets an announced reader for the specified prefix.
@@ -102916,8 +102920,8 @@ var AnnounceInit = class _AnnounceInit {
102916
102920
  }
102917
102921
  async #encode(w) {
102918
102922
  await w.u53(this.suffixes.length);
102919
- for (const path51 of this.suffixes) {
102920
- await w.string(encode3(path51));
102923
+ for (const path52 of this.suffixes) {
102924
+ await w.string(encode3(path52));
102921
102925
  }
102922
102926
  }
102923
102927
  static async #decode(r) {
@@ -103471,15 +103475,15 @@ var Publisher2 = class {
103471
103475
  * Publishes a broadcast with any associated tracks.
103472
103476
  * @param name - The broadcast to publish
103473
103477
  */
103474
- publish(path51, broadcast) {
103478
+ publish(path52, broadcast) {
103475
103479
  this.#broadcasts.mutate((broadcasts) => {
103476
103480
  if (!broadcasts)
103477
103481
  throw new Error("closed");
103478
- broadcasts.set(path51, broadcast);
103482
+ broadcasts.set(path52, broadcast);
103479
103483
  });
103480
103484
  void broadcast.closed.finally(() => {
103481
103485
  this.#broadcasts.mutate((broadcasts) => {
103482
- broadcasts?.delete(path51);
103486
+ broadcasts?.delete(path52);
103483
103487
  });
103484
103488
  });
103485
103489
  }
@@ -103799,16 +103803,16 @@ var Setup2 = class _Setup {
103799
103803
  }
103800
103804
  static async #decode(r) {
103801
103805
  const count2 = await r.u53();
103802
- let path51;
103806
+ let path52;
103803
103807
  for (let i = 0; i < count2; i++) {
103804
103808
  const id = await r.u53();
103805
103809
  const len = await r.u53();
103806
103810
  const value = await r.read(len);
103807
103811
  if (id === PARAM_PATH) {
103808
- path51 = new TextDecoder().decode(value);
103812
+ path52 = new TextDecoder().decode(value);
103809
103813
  }
103810
103814
  }
103811
- return new _Setup({ path: path51 });
103815
+ return new _Setup({ path: path52 });
103812
103816
  }
103813
103817
  async encode(w, version3) {
103814
103818
  if (!hasSetupStream(version3))
@@ -103898,9 +103902,9 @@ var Subscriber2 = class {
103898
103902
  case Version2.DRAFT_02: {
103899
103903
  const init2 = await AnnounceInit.decode(stream.reader, this.version);
103900
103904
  for (const suffix of init2.suffixes) {
103901
- const path51 = join13(prefix, suffix);
103902
- console.debug(`announced: broadcast=${path51} active=true`);
103903
- announced2.append({ path: path51, active: true });
103905
+ const path52 = join13(prefix, suffix);
103906
+ console.debug(`announced: broadcast=${path52} active=true`);
103907
+ announced2.append({ path: path52, active: true });
103904
103908
  }
103905
103909
  break;
103906
103910
  }
@@ -103919,9 +103923,9 @@ var Subscriber2 = class {
103919
103923
  if (options.ignoreSelf && announce.hops.includes(this.origin)) {
103920
103924
  continue;
103921
103925
  }
103922
- const path51 = join13(prefix, announce.suffix);
103923
- console.debug(`announced: broadcast=${path51} active=${announce.active}`);
103924
- announced2.append({ path: path51, active: announce.active });
103926
+ const path52 = join13(prefix, announce.suffix);
103927
+ console.debug(`announced: broadcast=${path52} active=${announce.active}`);
103928
+ announced2.append({ path: path52, active: announce.active });
103925
103929
  }
103926
103930
  announced2.close();
103927
103931
  } catch (err) {
@@ -103934,14 +103938,14 @@ var Subscriber2 = class {
103934
103938
  * @param name - The name of the broadcast to consume
103935
103939
  * @returns A Broadcast instance
103936
103940
  */
103937
- consume(path51) {
103941
+ consume(path52) {
103938
103942
  const broadcast = new Broadcast();
103939
103943
  void (async () => {
103940
103944
  for (; ; ) {
103941
103945
  const request3 = await broadcast.requested();
103942
103946
  if (!request3)
103943
103947
  break;
103944
- void this.#runSubscribe(path51, request3);
103948
+ void this.#runSubscribe(path52, request3);
103945
103949
  }
103946
103950
  })();
103947
103951
  return broadcast;
@@ -104198,8 +104202,8 @@ var Connection2 = class {
104198
104202
  this.close();
104199
104203
  }
104200
104204
  }
104201
- publish(path51, broadcast) {
104202
- this.#publisher.publish(path51, broadcast);
104205
+ publish(path52, broadcast) {
104206
+ this.#publisher.publish(path52, broadcast);
104203
104207
  }
104204
104208
  announced(prefix = empty()) {
104205
104209
  return this.#subscriber.announced(prefix);
@@ -114975,11 +114979,12 @@ function countMemberBytes(member, taken, bytes) {
114975
114979
  );
114976
114980
  }
114977
114981
  }
114978
- async function memberText(member, tempDirs, lookupUpload, taken) {
114982
+ async function materializeMember(member, tempDirs, lookupUpload) {
114983
+ const wire = member;
114979
114984
  if (typeof member.content === "string") {
114980
- const data = decodeContent(member);
114981
- countMemberBytes(member, taken, data.length);
114982
- return data.toString("utf8");
114985
+ const { filePath, dir } = await materializeUpload(wire);
114986
+ tempDirs.push(dir);
114987
+ return filePath;
114983
114988
  }
114984
114989
  if (typeof member.uploadId !== "string") return void 0;
114985
114990
  const unused = {
@@ -114987,17 +114992,26 @@ async function memberText(member, tempDirs, lookupUpload, taken) {
114987
114992
  presentOnHost: false,
114988
114993
  viaUpload: true
114989
114994
  };
114990
- const wire = member;
114991
114995
  const { value } = await extractTarUpload(wire, member.uploadId, unused, tempDirs, lookupUpload);
114996
+ return value;
114997
+ }
114998
+ async function memberText(member, tempDirs, lookupUpload, taken) {
114999
+ if (typeof member.content === "string") {
115000
+ const data = decodeContent(member);
115001
+ countMemberBytes(member, taken, data.length);
115002
+ return data.toString("utf8");
115003
+ }
115004
+ const file2 = await materializeMember(member, tempDirs, lookupUpload);
115005
+ if (file2 === void 0) return void 0;
114992
115006
  const unreadable = (err) => {
114993
115007
  throw new FileInputError(
114994
115008
  `Could not read the uploaded file "${member.path}": ${errorText(err)}`
114995
115009
  );
114996
115010
  };
114997
- const { size } = await (0, import_promises8.stat)(value).catch(unreadable);
115011
+ const { size } = await (0, import_promises8.stat)(file2).catch(unreadable);
114998
115012
  checkUploadSize(member, size);
114999
115013
  countMemberBytes(member, taken, size);
115000
- return (0, import_promises8.readFile)(value, "utf8").catch(unreadable);
115014
+ return (0, import_promises8.readFile)(file2, "utf8").catch(unreadable);
115001
115015
  }
115002
115016
  async function resolveMembers(members, tempDirs, lookupUpload) {
115003
115017
  const out = {};
@@ -115005,10 +115019,11 @@ async function resolveMembers(members, tempDirs, lookupUpload) {
115005
115019
  for (const raw of members) {
115006
115020
  if (typeof raw !== "object" || raw === null) continue;
115007
115021
  const member = raw;
115008
- if (member.role !== "flow" || typeof member.key !== "string" || Object.hasOwn(out, member.key)) {
115022
+ if (member.role !== "flow" && member.role !== "baseline" || typeof member.key !== "string" || Object.hasOwn(out, member.key)) {
115009
115023
  continue;
115010
115024
  }
115011
- if (typeof member.canonical !== "string" || !isSpelling(member.spelling)) {
115025
+ const flow = member.role === "flow";
115026
+ if (flow && (typeof member.canonical !== "string" || !isSpelling(member.spelling)) || flow && member.state === "listed") {
115012
115027
  out[member.key] = {
115013
115028
  role: member.role,
115014
115029
  state: "refused",
@@ -115018,9 +115033,9 @@ async function resolveMembers(members, tempDirs, lookupUpload) {
115018
115033
  };
115019
115034
  continue;
115020
115035
  }
115021
- const base = { role: member.role, canonical: member.canonical, spelling: member.spelling };
115022
- if (member.state === "missing") {
115023
- out[member.key] = { ...base, state: "missing" };
115036
+ const base = flow ? { role: member.role, canonical: member.canonical, spelling: member.spelling } : { role: member.role };
115037
+ if (member.state === "missing" || member.state === "listed") {
115038
+ out[member.key] = { ...base, state: member.state };
115024
115039
  } else if (member.state === "refused") {
115025
115040
  out[member.key] = {
115026
115041
  ...base,
@@ -115028,8 +115043,8 @@ async function resolveMembers(members, tempDirs, lookupUpload) {
115028
115043
  error: typeof member.error === "string" ? member.error : "the client did not send it"
115029
115044
  };
115030
115045
  } else {
115031
- const text = await memberText(member, tempDirs, lookupUpload, taken);
115032
- out[member.key] = text === void 0 ? { ...base, state: "refused", error: `the client sent no content for "${member.path}"` } : { ...base, state: "present", text };
115046
+ const sent = flow ? { text: await memberText(member, tempDirs, lookupUpload, taken) } : { hostPath: await materializeMember(member, tempDirs, lookupUpload) };
115047
+ out[member.key] = sent.text === void 0 && sent.hostPath === void 0 ? { ...base, state: "refused", error: `the client sent no content for "${member.path}"` } : { ...base, state: "present", ...sent };
115033
115048
  }
115034
115049
  }
115035
115050
  return out;
@@ -115144,8 +115159,8 @@ async function resolveFileInputs(def, body, lookupUpload) {
115144
115159
  delete args[spec.target];
115145
115160
  continue;
115146
115161
  }
115147
- const { value: path51, meta: meta3 } = await resolveOne(spec, value, tempDirs, lookupUpload);
115148
- args[spec.target] = path51;
115162
+ const { value: path52, meta: meta3 } = await resolveOne(spec, value, tempDirs, lookupUpload);
115163
+ args[spec.target] = path52;
115149
115164
  resolved = { ...resolved ?? {}, [spec.target]: meta3 };
115150
115165
  }
115151
115166
  } catch (err) {
@@ -123737,10 +123752,10 @@ function captureRotationForSurface(rotation) {
123737
123752
  if (rotation === null || rotation === 0) return void 0;
123738
123753
  return SURFACE_ROTATION_TO_NAME[rotation];
123739
123754
  }
123740
- async function readPngSize2(path51) {
123755
+ async function readPngSize2(path52) {
123741
123756
  let handle;
123742
123757
  try {
123743
- handle = await import_node_fs13.promises.open(path51, "r");
123758
+ handle = await import_node_fs13.promises.open(path52, "r");
123744
123759
  const buf = Buffer.alloc(24);
123745
123760
  const { bytesRead } = await handle.read(buf, 0, 24, 0);
123746
123761
  if (bytesRead < 24) return null;
@@ -127737,13 +127752,13 @@ async function fetchVegaPageSource(timeoutMs = 15e3) {
127737
127752
  });
127738
127753
  }
127739
127754
  }
127740
- function postJson(host, port, path51, body, timeoutMs) {
127755
+ function postJson(host, port, path52, body, timeoutMs) {
127741
127756
  return new Promise((resolve14, reject) => {
127742
127757
  const req = (0, import_node_http3.request)(
127743
127758
  {
127744
127759
  host,
127745
127760
  port,
127746
- path: path51,
127761
+ path: path52,
127747
127762
  method: "POST",
127748
127763
  headers: {
127749
127764
  "Content-Type": "application/json",
@@ -130841,16 +130856,16 @@ var MatcherView = class {
130841
130856
  * @returns {string|undefined}
130842
130857
  */
130843
130858
  getCurrentTag() {
130844
- const path51 = this._matcher.path;
130845
- return path51.length > 0 ? path51[path51.length - 1].tag : void 0;
130859
+ const path52 = this._matcher.path;
130860
+ return path52.length > 0 ? path52[path52.length - 1].tag : void 0;
130846
130861
  }
130847
130862
  /**
130848
130863
  * Get current namespace.
130849
130864
  * @returns {string|undefined}
130850
130865
  */
130851
130866
  getCurrentNamespace() {
130852
- const path51 = this._matcher.path;
130853
- return path51.length > 0 ? path51[path51.length - 1].namespace : void 0;
130867
+ const path52 = this._matcher.path;
130868
+ return path52.length > 0 ? path52[path52.length - 1].namespace : void 0;
130854
130869
  }
130855
130870
  /**
130856
130871
  * Get current node's attribute value.
@@ -130858,9 +130873,9 @@ var MatcherView = class {
130858
130873
  * @returns {*}
130859
130874
  */
130860
130875
  getAttrValue(attrName) {
130861
- const path51 = this._matcher.path;
130862
- if (path51.length === 0) return void 0;
130863
- return path51[path51.length - 1].values?.[attrName];
130876
+ const path52 = this._matcher.path;
130877
+ if (path52.length === 0) return void 0;
130878
+ return path52[path52.length - 1].values?.[attrName];
130864
130879
  }
130865
130880
  /**
130866
130881
  * Check if current node has an attribute.
@@ -130868,9 +130883,9 @@ var MatcherView = class {
130868
130883
  * @returns {boolean}
130869
130884
  */
130870
130885
  hasAttr(attrName) {
130871
- const path51 = this._matcher.path;
130872
- if (path51.length === 0) return false;
130873
- const current = path51[path51.length - 1];
130886
+ const path52 = this._matcher.path;
130887
+ if (path52.length === 0) return false;
130888
+ const current = path52[path52.length - 1];
130874
130889
  return current.values !== void 0 && attrName in current.values;
130875
130890
  }
130876
130891
  /**
@@ -130878,18 +130893,18 @@ var MatcherView = class {
130878
130893
  * @returns {number}
130879
130894
  */
130880
130895
  getPosition() {
130881
- const path51 = this._matcher.path;
130882
- if (path51.length === 0) return -1;
130883
- return path51[path51.length - 1].position ?? 0;
130896
+ const path52 = this._matcher.path;
130897
+ if (path52.length === 0) return -1;
130898
+ return path52[path52.length - 1].position ?? 0;
130884
130899
  }
130885
130900
  /**
130886
130901
  * Get current node's repeat counter (occurrence count of this tag name).
130887
130902
  * @returns {number}
130888
130903
  */
130889
130904
  getCounter() {
130890
- const path51 = this._matcher.path;
130891
- if (path51.length === 0) return -1;
130892
- return path51[path51.length - 1].counter ?? 0;
130905
+ const path52 = this._matcher.path;
130906
+ if (path52.length === 0) return -1;
130907
+ return path52[path52.length - 1].counter ?? 0;
130893
130908
  }
130894
130909
  /**
130895
130910
  * Get current node's sibling index (alias for getPosition).
@@ -137251,46 +137266,46 @@ var jsonReplacer = (_key, value) => {
137251
137266
  };
137252
137267
  async function writeDump(dir, filename, data) {
137253
137268
  try {
137254
- const path51 = (0, import_path2.join)(dir, filename);
137269
+ const path52 = (0, import_path2.join)(dir, filename);
137255
137270
  const json2 = JSON.stringify(data, jsonReplacer, 2);
137256
- await import_fs.promises.writeFile(path51, json2, "utf8");
137257
- return path51;
137271
+ await import_fs.promises.writeFile(path52, json2, "utf8");
137272
+ return path52;
137258
137273
  } catch {
137259
137274
  return null;
137260
137275
  }
137261
137276
  }
137262
137277
  async function writeDumpCompact(dir, filename, data) {
137263
137278
  try {
137264
- const path51 = (0, import_path2.join)(dir, filename);
137279
+ const path52 = (0, import_path2.join)(dir, filename);
137265
137280
  const json2 = JSON.stringify(data, jsonReplacer);
137266
- await import_fs.promises.writeFile(path51, json2, "utf8");
137267
- return path51;
137281
+ await import_fs.promises.writeFile(path52, json2, "utf8");
137282
+ return path52;
137268
137283
  } catch {
137269
137284
  return null;
137270
137285
  }
137271
137286
  }
137272
- async function readCpuProfile(path51) {
137273
- const json2 = await import_fs.promises.readFile(path51, "utf8");
137287
+ async function readCpuProfile(path52) {
137288
+ const json2 = await import_fs.promises.readFile(path52, "utf8");
137274
137289
  const parsed = JSON.parse(json2);
137275
137290
  if (!parsed || typeof parsed !== "object") {
137276
137291
  throw new Error(
137277
- `On-disk CPU profile at ${path51} 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.`
137292
+ `On-disk CPU profile at ${path52} 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.`
137278
137293
  );
137279
137294
  }
137280
137295
  if (!Array.isArray(parsed.samples) || !Array.isArray(parsed.nodes) || !Array.isArray(parsed.timeDeltas)) {
137281
137296
  throw new Error(
137282
- `On-disk CPU profile at ${path51} 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.`
137297
+ `On-disk CPU profile at ${path52} 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.`
137283
137298
  );
137284
137299
  }
137285
137300
  if (typeof parsed.startTime !== "number" || typeof parsed.endTime !== "number") {
137286
137301
  throw new Error(
137287
- `On-disk CPU profile at ${path51} is missing startTime/endTime timestamps; the recording is incomplete and cannot be analysed.`
137302
+ `On-disk CPU profile at ${path52} is missing startTime/endTime timestamps; the recording is incomplete and cannot be analysed.`
137288
137303
  );
137289
137304
  }
137290
137305
  return parsed;
137291
137306
  }
137292
- async function readCommitTree(path51) {
137293
- const json2 = await import_fs.promises.readFile(path51, "utf8");
137307
+ async function readCommitTree(path52) {
137308
+ const json2 = await import_fs.promises.readFile(path52, "utf8");
137294
137309
  return JSON.parse(json2);
137295
137310
  }
137296
137311
 
@@ -137740,9 +137755,9 @@ init_src2();
137740
137755
  var import_fs2 = require("fs");
137741
137756
  var import_path3 = require("path");
137742
137757
  var import_semver4 = __toESM(require_semver2());
137743
- async function readFileSafe(path51) {
137758
+ async function readFileSafe(path52) {
137744
137759
  try {
137745
- return await import_fs2.promises.readFile(path51, "utf8");
137760
+ return await import_fs2.promises.readFile(path52, "utf8");
137746
137761
  } catch {
137747
137762
  return null;
137748
137763
  }
@@ -139219,9 +139234,9 @@ function shortenPath(file2) {
139219
139234
  const parts2 = file2.replace(/\\/g, "/").split("/");
139220
139235
  return parts2.slice(-2).join("/");
139221
139236
  }
139222
- async function writeReport(path51, content) {
139237
+ async function writeReport(path52, content) {
139223
139238
  try {
139224
- await import_fs4.promises.writeFile(path51, content, "utf8");
139239
+ await import_fs4.promises.writeFile(path52, content, "utf8");
139225
139240
  return true;
139226
139241
  } catch {
139227
139242
  return false;
@@ -140468,8 +140483,8 @@ function extractRows(xml) {
140468
140483
  }
140469
140484
  return rows;
140470
140485
  }
140471
- function isSystemLibraryPath(path51) {
140472
- return SYSTEM_LIBRARY_PATH_PREFIXES.some((prefix) => path51.startsWith(prefix));
140486
+ function isSystemLibraryPath(path52) {
140487
+ return SYSTEM_LIBRARY_PATH_PREFIXES.some((prefix) => path52.startsWith(prefix));
140473
140488
  }
140474
140489
  function parseCpuXml(xml, targetPid = null) {
140475
140490
  const frameRegistry = /* @__PURE__ */ new Map();
@@ -148862,9 +148877,9 @@ function* outputReferenceFields(step) {
148862
148877
  case "pinch":
148863
148878
  case "rotate": {
148864
148879
  if (!step.selector) return;
148865
- const { path: path51, alt } = gestureTargetPath(step);
148866
- for (const field of selectorFields(step.selector, path51)) {
148867
- yield alt ? { ...field, altWhere: `${alt}${field.where.slice(path51.length)}` } : field;
148880
+ const { path: path52, alt } = gestureTargetPath(step);
148881
+ for (const field of selectorFields(step.selector, path52)) {
148882
+ yield alt ? { ...field, altWhere: `${alt}${field.where.slice(path52.length)}` } : field;
148868
148883
  }
148869
148884
  return;
148870
148885
  }
@@ -150398,8 +150413,8 @@ async function captureFile(env, budgetMs) {
150398
150413
  const ref = simulatorServerRef(env.device);
150399
150414
  const api = await env.registry.resolveService(ref.urn, ref.options);
150400
150415
  const panel = await resolveCapturePanel(api);
150401
- const { path: path51 } = await httpScreenshot(api, void 0, void 0, CAPTURE_SCALE, panel?.screen);
150402
- return { path: path51, ...panel?.warning !== void 0 ? { warning: panel.warning } : {} };
150416
+ const { path: path52 } = await httpScreenshot(api, void 0, void 0, CAPTURE_SCALE, panel?.screen);
150417
+ return { path: path52, ...panel?.warning !== void 0 ? { warning: panel.warning } : {} };
150403
150418
  }
150404
150419
  async function captureIosDeviceFile(env, budgetMs) {
150405
150420
  const ref = iosDeviceRunnerRef(env.device);
@@ -153844,15 +153859,22 @@ You can still edit the .yaml file directly afterwards to remove or reorder steps
153844
153859
  // ../tool-server/src/tools/flows/flow-run.ts
153845
153860
  init_zod();
153846
153861
  var fs63 = __toESM(require("node:fs/promises"));
153847
- var path46 = __toESM(require("node:path"));
153862
+ var path47 = __toESM(require("node:path"));
153848
153863
  init_src2();
153849
153864
 
153850
153865
  // ../tool-server/src/tools/flows/project-access.ts
153851
153866
  var fs60 = __toESM(require("node:fs/promises"));
153867
+ var path44 = __toESM(require("node:path"));
153852
153868
  init_src2();
153869
+ function clientBaselinePath(clientFlowPath, key2, file2) {
153870
+ return path44.posix.join(path44.posix.dirname(clientFlowPath), "__baselines__", key2, file2);
153871
+ }
153853
153872
  function isEnoent(err) {
153854
153873
  return err?.code === "ENOENT";
153855
153874
  }
153875
+ function isNothingThere(err) {
153876
+ return isEnoent(err) || err?.code === "ENOTDIR";
153877
+ }
153856
153878
  var HostProjectAccess = class {
153857
153879
  mode = "host";
153858
153880
  async resolveFlowFile(anchorDir, target) {
@@ -153874,9 +153896,27 @@ var HostProjectAccess = class {
153874
153896
  }
153875
153897
  };
153876
153898
  }
153899
+ async readFile(filePath) {
153900
+ try {
153901
+ return await fs60.readFile(filePath);
153902
+ } catch (err) {
153903
+ if (!isNothingThere(err)) throw err;
153904
+ return null;
153905
+ }
153906
+ }
153907
+ async writeBaseline(filePath, bytes) {
153908
+ const replaced = await fs60.access(filePath).then(
153909
+ () => true,
153910
+ () => false
153911
+ );
153912
+ await fs60.mkdir(path44.dirname(filePath), { recursive: true });
153913
+ await fs60.writeFile(filePath, bytes);
153914
+ return { replaced };
153915
+ }
153877
153916
  };
153878
- function clientRefusal(target, reason) {
153879
- return new FailureError(`the client refused to send "${target}": ${reason}`, {
153917
+ var BASELINE_CAP_BYTES = 32 * 1024 * 1024;
153918
+ function clientRefusal(subject2, reason, verb = "send") {
153919
+ return new FailureError(`the client refused to ${verb} "${subject2}": ${reason}`, {
153880
153920
  error_code: FAILURE_CODES.FLOW_FILE_INVALID,
153881
153921
  failure_stage: "client_member_refused",
153882
153922
  failure_area: "tool_server",
@@ -153889,6 +153929,8 @@ var ClientProjectAccess = class {
153889
153929
  }
153890
153930
  members;
153891
153931
  mode = "client";
153932
+ /** Baselines this call wrote, by client path. */
153933
+ overlay = /* @__PURE__ */ new Map();
153892
153934
  /** The member the runner reaches for this pair, or undefined when the client did not send one. */
153893
153935
  member(anchorDir, target) {
153894
153936
  const key2 = flowMemberKey(anchorDir, target);
@@ -153896,19 +153938,75 @@ var ClientProjectAccess = class {
153896
153938
  }
153897
153939
  async resolveFlowFile(anchorDir, target) {
153898
153940
  const member = this.member(anchorDir, target);
153899
- if (member?.role !== "flow") {
153941
+ if (member?.role !== "flow" || member.canonical === void 0) {
153900
153942
  throw clientRefusal(target, `${target} is not a run: target of a flow this client sent`);
153901
153943
  }
153902
153944
  const text = member.state === "present" ? member.text ?? "" : null;
153903
153945
  return {
153904
153946
  canonical: member.canonical,
153905
- spelling: member.spelling,
153947
+ spelling: member.spelling ?? { state: "listed" },
153906
153948
  read: async () => {
153907
153949
  if (member.state !== "refused") return text;
153908
153950
  throw clientRefusal(target, member.error ?? "the client did not send it");
153909
153951
  }
153910
153952
  };
153911
153953
  }
153954
+ baseline(filePath) {
153955
+ const member = Object.hasOwn(this.members, filePath) ? this.members[filePath] : void 0;
153956
+ return member?.role === "baseline" ? member : void 0;
153957
+ }
153958
+ /**
153959
+ * A baseline of this run: the bytes this call wrote there, else the file
153960
+ * the client sent, else null, the "no baseline" outcome: a compare run gets
153961
+ * every baseline of its snapshots the client has.
153962
+ */
153963
+ async readFile(filePath) {
153964
+ const written = this.overlay.get(filePath);
153965
+ if (written !== void 0) return written;
153966
+ const member = this.baseline(filePath);
153967
+ if (member === void 0 || member.state === "missing") return null;
153968
+ if (member.state === "present" && member.hostPath !== void 0) {
153969
+ return fs60.readFile(member.hostPath);
153970
+ }
153971
+ throw clientRefusal(
153972
+ filePath,
153973
+ member.error ?? "the client sent only its name, for a run that updates baselines"
153974
+ );
153975
+ }
153976
+ /**
153977
+ * Keep a new baseline for the result and for later reads in this call.
153978
+ * `replaced` says whether one was there before: written earlier in this
153979
+ * call, or on the client.
153980
+ */
153981
+ async writeBaseline(filePath, bytes) {
153982
+ if (bytes.length > BASELINE_CAP_BYTES) {
153983
+ throw new FailureError(
153984
+ `the baseline for "${filePath}" is larger than the 32 MiB cap on a file the client writes, so this tool-server did not keep it`,
153985
+ {
153986
+ error_code: FAILURE_CODES.FLOW_FILE_INVALID,
153987
+ failure_stage: "client_content_cap",
153988
+ failure_area: "tool_server",
153989
+ error_kind: "validation"
153990
+ }
153991
+ );
153992
+ }
153993
+ const member = this.baseline(filePath);
153994
+ if (member?.state === "refused") {
153995
+ throw clientRefusal(filePath, member.error ?? "refused", "write");
153996
+ }
153997
+ const replaced = this.overlay.has(filePath) || member !== void 0 && member.state !== "missing";
153998
+ this.overlay.set(filePath, bytes);
153999
+ return { replaced };
154000
+ }
154001
+ /** The baselines this call wrote, last bytes per path, as directives for the result. */
154002
+ baselineDirectives() {
154003
+ return [...this.overlay].map(([filePath, bytes]) => ({
154004
+ [CLIENT_FILE_MARKER]: true,
154005
+ path: filePath,
154006
+ content: bytes.toString("base64"),
154007
+ encoding: "base64"
154008
+ }));
154009
+ }
153912
154010
  };
153913
154011
 
153914
154012
  // ../tool-server/src/tools/flows/flow-nested-outcome.ts
@@ -153991,8 +154089,9 @@ init_device_info();
153991
154089
  var import_node_crypto12 = require("node:crypto");
153992
154090
  var fs62 = __toESM(require("node:fs/promises"));
153993
154091
  var os18 = __toESM(require("node:os"));
153994
- var path45 = __toESM(require("node:path"));
154092
+ var path46 = __toESM(require("node:path"));
153995
154093
  var import_pngjs4 = __toESM(require_png());
154094
+ init_src2();
153996
154095
 
153997
154096
  // ../tool-server/src/tools/screenshot-diff/screenshot-diff.ts
153998
154097
  var import_promises11 = __toESM(require("fs/promises"));
@@ -156090,7 +156189,7 @@ function cropIdentity(s) {
156090
156189
  return JSON.stringify(cropIdentityParts(s));
156091
156190
  }
156092
156191
  function baselineDir(flowsDir, flowName) {
156093
- return path45.join(flowsDir, "__baselines__", flowName);
156192
+ return path46.join(flowsDir, "__baselines__", flowName);
156094
156193
  }
156095
156194
  async function cleanupDiffDir(dir, keep) {
156096
156195
  try {
@@ -156099,12 +156198,17 @@ async function cleanupDiffDir(dir, keep) {
156099
156198
  return;
156100
156199
  }
156101
156200
  for (const entry of await fs62.readdir(dir)) {
156102
- const entryPath = path45.join(dir, entry);
156201
+ const entryPath = path46.join(dir, entry);
156103
156202
  if (entryPath !== keep) await fs62.rm(entryPath, { recursive: true, force: true });
156104
156203
  }
156105
156204
  } catch {
156106
156205
  }
156107
156206
  }
156207
+ function namingClientBaseline(err, copy, clientPath) {
156208
+ const signal = getFailureSignal(err);
156209
+ if (!(err instanceof Error) || signal === null || !err.message.includes(copy)) return err;
156210
+ return new FailureError(err.message.split(copy).join(clientPath), signal);
156211
+ }
156108
156212
  async function cropPngFile(src, dest, frame) {
156109
156213
  const png = import_pngjs4.PNG.sync.read(await fs62.readFile(src));
156110
156214
  const left = Math.max(0, Math.round(frame.x * png.width));
@@ -156150,8 +156254,7 @@ async function runSnapshot(env, opts) {
156150
156254
  const cropSuffix = opts.cropOn === void 0 ? "" : `-crop-${(0, import_node_crypto12.createHash)("sha256").update(cropIdentity(opts.cropOn)).digest("hex").slice(0, 8)}`;
156151
156255
  const snapshotKey = `${opts.name}__${authoringPlatform(env.device.platform)}-${w}x${h}${cropSuffix}`;
156152
156256
  const key2 = `${snapshotKey}.png`;
156153
- const dir = baselineDir(opts.flowsDir, opts.flowName);
156154
- const baselinePath = path45.join(dir, key2);
156257
+ const baselinePath = opts.clientFlowPath === void 0 ? path46.join(baselineDir(opts.flowsDir, opts.flowName), key2) : clientBaselinePath(opts.clientFlowPath, opts.flowName, key2);
156155
156258
  const priorApp = opts.seenKeys.get(snapshotKey);
156156
156259
  if (priorApp !== void 0 && priorApp !== opts.appIdentity) {
156157
156260
  return {
@@ -156175,10 +156278,23 @@ async function runSnapshot(env, opts) {
156175
156278
  filename: `${snapshotKey}-current.png`
156176
156279
  });
156177
156280
  };
156281
+ let baselineCopyDir;
156282
+ let keepBaselineCopy = false;
156283
+ const hostBaseline = async (bytes) => {
156284
+ if (opts.clientFlowPath === void 0) return baselinePath;
156285
+ baselineCopyDir = await fs62.mkdtemp(path46.join(os18.tmpdir(), "argent-flow-baseline-"));
156286
+ const copy = path46.join(baselineCopyDir, key2);
156287
+ await fs62.writeFile(copy, bytes);
156288
+ return copy;
156289
+ };
156290
+ const baselineArtifact = (hostPath) => {
156291
+ keepBaselineCopy = true;
156292
+ return store.register({ hostPath, kind: "screenshot", mimeType: "image/png" });
156293
+ };
156178
156294
  try {
156179
156295
  if (cropFrame !== void 0) {
156180
- cropDir = await fs62.mkdtemp(path45.join(os18.tmpdir(), "argent-flow-crop-"));
156181
- const croppedPath = path45.join(cropDir, key2);
156296
+ cropDir = await fs62.mkdtemp(path46.join(os18.tmpdir(), "argent-flow-crop-"));
156297
+ const croppedPath = path46.join(cropDir, key2);
156182
156298
  const cropped = await cropPngFile(shot.image.hostPath, croppedPath, cropFrame);
156183
156299
  if (cropped === null) {
156184
156300
  return {
@@ -156192,25 +156308,43 @@ async function runSnapshot(env, opts) {
156192
156308
  }
156193
156309
  currentPath = croppedPath;
156194
156310
  }
156195
- const exists2 = await fs62.access(baselinePath).then(() => true).catch(() => false);
156196
156311
  if (opts.updateBaselines) {
156197
- await fs62.mkdir(dir, { recursive: true });
156198
- await fs62.copyFile(currentPath, baselinePath);
156312
+ const { replaced } = await opts.project.writeBaseline(
156313
+ baselinePath,
156314
+ await fs62.readFile(currentPath)
156315
+ );
156316
+ const source = env.device.platform === "ios-remote" ? " from a remote simulator" : "";
156317
+ if (opts.clientFlowPath !== void 0) {
156318
+ const write = replaced ? "updates" : "writes";
156319
+ return {
156320
+ ...captureWarned,
156321
+ status: "pass",
156322
+ reason: `baseline captured${source}; the client ${write} it when the run ends (${baselinePath})`,
156323
+ snapshotKey
156324
+ };
156325
+ }
156326
+ const written = replaced ? `baseline updated${source}` : `baseline written${source}`;
156199
156327
  const baseline = await store.register({
156200
156328
  hostPath: baselinePath,
156201
156329
  kind: "screenshot",
156202
- mimeType: "image/png"
156330
+ mimeType: "image/png",
156331
+ filename: key2
156203
156332
  });
156204
- const source = env.device.platform === "ios-remote" ? " from a remote simulator" : "";
156205
156333
  return {
156206
156334
  ...captureWarned,
156207
156335
  status: "pass",
156208
- reason: exists2 ? `baseline updated${source} (${key2})` : `baseline written${source} (${key2})`,
156336
+ reason: `${written} (${key2})`,
156209
156337
  snapshotKey,
156210
156338
  artifacts: { baseline }
156211
156339
  };
156212
156340
  }
156213
- if (!exists2) {
156341
+ const stored = await opts.project.readFile(baselinePath).catch((err) => {
156342
+ if (opts.project.mode !== "host" || !(err instanceof Error) || err.message.includes(baselinePath)) {
156343
+ throw err;
156344
+ }
156345
+ throw new Error(`Could not read PNG at ${baselinePath}: ${err.message}`, { cause: err });
156346
+ });
156347
+ if (stored === null) {
156214
156348
  return {
156215
156349
  ...captureWarned,
156216
156350
  status: "fail",
@@ -156219,11 +156353,12 @@ async function runSnapshot(env, opts) {
156219
156353
  artifacts: { current: await currentArtifact() }
156220
156354
  };
156221
156355
  }
156222
- const outputDir = await fs62.mkdtemp(path45.join(os18.tmpdir(), "argent-flow-diff-"));
156356
+ const localBaseline = await hostBaseline(stored);
156357
+ const outputDir = await fs62.mkdtemp(path46.join(os18.tmpdir(), "argent-flow-diff-"));
156223
156358
  let keepInOutputDir;
156224
156359
  try {
156225
156360
  const result = await diffPngFiles({
156226
- baselinePath,
156361
+ baselinePath: localBaseline,
156227
156362
  currentPath,
156228
156363
  outputDir,
156229
156364
  // A crop compares EVERY pixel of the element's region, wherever it
@@ -156235,6 +156370,8 @@ async function runSnapshot(env, opts) {
156235
156370
  // Crop dimensions track the element — size drift must hard-fail below
156236
156371
  // instead of being resampled away like a full-screen scale difference.
156237
156372
  ...cropFrame !== void 0 && { normalizeSizes: false }
156373
+ }).catch((err) => {
156374
+ throw opts.clientFlowPath === void 0 ? err : namingClientBaseline(err, localBaseline, baselinePath);
156238
156375
  });
156239
156376
  if (result.dimensionMismatch) {
156240
156377
  const { expected, actual } = result.dimensionMismatch;
@@ -156245,11 +156382,7 @@ async function runSnapshot(env, opts) {
156245
156382
  reason: `baseline is ${expected.width}x${expected.height} but the ${opts.cropOn ? "cropOn region" : "capture"} is ${actual.width}x${actual.height} (${key2}) \u2014 nothing was compared` + (opts.cropOn ? `. The element's size drifted \u2014 crop a fixed-size container, or re-adopt with updateBaselines` : "") + (posture ? `. ${posture}` : ""),
156246
156383
  snapshotKey,
156247
156384
  artifacts: {
156248
- baseline: await store.register({
156249
- hostPath: baselinePath,
156250
- kind: "screenshot",
156251
- mimeType: "image/png"
156252
- }),
156385
+ baseline: await baselineArtifact(localBaseline),
156253
156386
  current: await currentArtifact()
156254
156387
  }
156255
156388
  };
@@ -156260,11 +156393,7 @@ async function runSnapshot(env, opts) {
156260
156393
  return { status: "pass", reason, ...captureWarned };
156261
156394
  }
156262
156395
  const artifacts = {
156263
- baseline: await store.register({
156264
- hostPath: baselinePath,
156265
- kind: "screenshot",
156266
- mimeType: "image/png"
156267
- }),
156396
+ baseline: await baselineArtifact(localBaseline),
156268
156397
  current: await currentArtifact()
156269
156398
  };
156270
156399
  if (result.contextDiffPath) {
@@ -156284,6 +156413,12 @@ async function runSnapshot(env, opts) {
156284
156413
  if (cropDir !== void 0) {
156285
156414
  await cleanupDiffDir(cropDir, keepCropped ? currentPath : void 0);
156286
156415
  }
156416
+ if (baselineCopyDir !== void 0) {
156417
+ await cleanupDiffDir(
156418
+ baselineCopyDir,
156419
+ keepBaselineCopy ? path46.join(baselineCopyDir, key2) : void 0
156420
+ );
156421
+ }
156287
156422
  }
156288
156423
  }
156289
156424
 
@@ -156385,7 +156520,7 @@ var zodSchema68 = external_exports.object({
156385
156520
  "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."
156386
156521
  ),
156387
156522
  flow_path: external_exports.string().optional().describe(
156388
- "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 and its run: fragments, and the tool-server runs those copies. Keep run: fragments under project_root or beside the flow file. Over a link, the flow and its fragments must not have script: or snapshot: steps, or tool: steps that take a file or record a flow. Without a link, the tool-server reads the files in place and all step kinds run."
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, or tool: steps that take a file or record a flow. Without a link, the tool-server reads the files in place and all step kinds run."
156389
156524
  ),
156390
156525
  device: external_exports.string().optional().describe(
156391
156526
  "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."
@@ -156700,7 +156835,7 @@ function deviceEnv(state3) {
156700
156835
  return { ...state3, device: state3.device };
156701
156836
  }
156702
156837
  function displayFlowName(params) {
156703
- const stem = params.flow_path === void 0 ? void 0 : path46.basename(params.flow_path, ".yaml");
156838
+ const stem = params.flow_path === void 0 ? void 0 : path47.basename(params.flow_path, ".yaml");
156704
156839
  return params.name || stem || params.flow_path || "(unspecified)";
156705
156840
  }
156706
156841
  function* walkSteps(steps, within = "") {
@@ -156804,14 +156939,14 @@ function assertUploadSelfContained(registry2, flow, closure) {
156804
156939
  continue;
156805
156940
  }
156806
156941
  if (file2.hop + 1 >= MAX_RUN_DEPTH) continue;
156807
- const anchorDir = path46.dirname(file2.canonical);
156942
+ const anchorDir = path47.dirname(file2.canonical);
156808
156943
  const key2 = flowMemberKey(anchorDir, step.flow);
156809
156944
  if (seen.has(key2)) continue;
156810
156945
  seen.add(key2);
156811
156946
  const member = closure.project.member(anchorDir, step.flow);
156812
156947
  if (member?.state === "refused") {
156813
156948
  offending.push({ kind: "run", line: `${where}: run: ${step.flow} (${member.error})` });
156814
- } else if (member?.state === "present") {
156949
+ } else if (member?.state === "present" && member.canonical !== void 0) {
156815
156950
  let fragment;
156816
156951
  try {
156817
156952
  fragment = parseFlow(member.text ?? "");
@@ -156828,6 +156963,7 @@ function assertUploadSelfContained(registry2, flow, closure) {
156828
156963
  } else if (step.kind === "script") {
156829
156964
  offending.push({ kind: "script", line: `${where}: script: { path: ${step.path} }` });
156830
156965
  } else if (step.kind === "snapshot") {
156966
+ if (closure) continue;
156831
156967
  offending.push({ kind: "snapshot", line: `${where}: snapshot: ${step.name}` });
156832
156968
  } else if (step.kind === "tool" && step.name === "flow-execute") {
156833
156969
  offending.push({
@@ -156851,7 +156987,11 @@ function assertUploadSelfContained(registry2, flow, closure) {
156851
156987
  }
156852
156988
  }
156853
156989
  if (offending.length === 0) return;
156854
- const updateHint = !closure && offending.some((o) => o.kind === "run") ? ` This tool-server runs run: steps for a client that sends their fragments with the call. Update the argent CLI or MCP adapter on the client.` : "";
156990
+ const servable = [
156991
+ ...!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"] : []
156993
+ ];
156994
+ const updateHint = servable.length > 0 ? ` This tool-server runs ${servable.join(", and ")}. Update the argent CLI or MCP adapter on the client.` : "";
156855
156995
  throw new FailureError(
156856
156996
  `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:
156857
156997
  ` + offending.map((o) => ` - ${o.line}`).join("\n") + `
@@ -156893,7 +157033,7 @@ Returns a per-step report: the first failure stops the run and the rest report a
156893
157033
  const clientProject = rootInput?.members ? new ClientProjectAccess(rootInput.members) : void 0;
156894
157034
  const project = clientProject ?? new HostProjectAccess();
156895
157035
  const canonicalPath = await canonicalFlowPath(filePath);
156896
- const flowsDir = path46.dirname(canonicalPath);
157036
+ const flowsDir = path47.dirname(canonicalPath);
156897
157037
  const flow = parseFlow(await fs63.readFile(canonicalPath, "utf8"));
156898
157038
  if (viaUpload) {
156899
157039
  assertUploadSelfContained(
@@ -156974,7 +157114,15 @@ Returns a per-step report: the first failure stops the run and the rest report a
156974
157114
  flowsDir,
156975
157115
  viaUpload,
156976
157116
  project,
156977
- baselineKey: baselineKeyFor(canonicalPath, flowName),
157117
+ // In client mode the baselines live beside the root flow's real file
157118
+ // on the client, so they anchor and key on that path: the stem of the
157119
+ // temp copy is the sanitized basename of the client's spelling, which
157120
+ // a symlinked root flow does not share with its real file.
157121
+ ...project.mode === "client" ? { clientFlowPath: rootEntry.canonical } : {},
157122
+ baselineKey: baselineKeyFor(
157123
+ project.mode === "client" ? rootEntry.canonical : canonicalPath,
157124
+ flowName
157125
+ ),
156978
157126
  updateBaselines: Boolean(params.updateBaselines),
156979
157127
  reports: [],
156980
157128
  stopped: false,
@@ -157001,7 +157149,7 @@ Returns a per-step report: the first failure stops the run and the rest report a
157001
157149
  await teardownBootedChromium(registry2, state3.owned[i]);
157002
157150
  }
157003
157151
  }
157004
- return summarize(
157152
+ const result = summarize(
157005
157153
  flowName,
157006
157154
  device?.id ?? "",
157007
157155
  flow.executionPrerequisite,
@@ -157009,6 +157157,8 @@ Returns a per-step report: the first failure stops the run and the rest report a
157009
157157
  aborted2,
157010
157158
  { startedAt: runStartedAt, durationMs: Date.now() - runStartedAt }
157011
157159
  );
157160
+ const baselineWrites = clientProject?.baselineDirectives() ?? [];
157161
+ return baselineWrites.length > 0 ? { ...result, baselineWrites } : result;
157012
157162
  }
157013
157163
  };
157014
157164
  }
@@ -157058,8 +157208,10 @@ function chromiumPinnable(app, platform) {
157058
157208
  }
157059
157209
  var NO_EXECUTABLE_STEP = "no-executable-step";
157060
157210
  function clientRootCanonical(root, name, flow) {
157061
- const composes = [...walkSteps(flow.steps)].some(({ step }) => step.kind === "run");
157062
- if (!composes) return root.clientPath;
157211
+ const anchors = [...walkSteps(flow.steps)].some(
157212
+ ({ step }) => step.kind === "run" || step.kind === "snapshot"
157213
+ );
157214
+ if (!anchors) return root.clientPath;
157063
157215
  if (root.spelling?.state === "case_folded") {
157064
157216
  throw name === void 0 ? flowPathCasingError(root.clientPath, root.spelling) : flowNameCasingError(name, root.spelling);
157065
157217
  }
@@ -157078,7 +157230,7 @@ async function scanLeadingLaunch(flow, stack, env) {
157078
157230
  let nested;
157079
157231
  let canonical;
157080
157232
  try {
157081
- const hop = await env.project.resolveFlowFile(path46.dirname(top.canonical), step.flow);
157233
+ const hop = await env.project.resolveFlowFile(path47.dirname(top.canonical), step.flow);
157082
157234
  canonical = hop.canonical;
157083
157235
  if (stack.some((entry) => entry.canonical === canonical)) return null;
157084
157236
  if (stack.length >= MAX_RUN_DEPTH) return null;
@@ -157112,7 +157264,7 @@ function launchTargetPlatform(launch, platform) {
157112
157264
  return null;
157113
157265
  }
157114
157266
  async function resolveAppPath(specPath, flowDir) {
157115
- const lexical = path46.resolve(flowDir, specPath);
157267
+ const lexical = path47.resolve(flowDir, specPath);
157116
157268
  try {
157117
157269
  return await fs63.realpath(lexical);
157118
157270
  } catch {
@@ -157120,7 +157272,7 @@ async function resolveAppPath(specPath, flowDir) {
157120
157272
  }
157121
157273
  }
157122
157274
  async function bootChromiumForFlow(spec, flowDir, viaUpload) {
157123
- if (viaUpload && !path46.isAbsolute(spec.path)) {
157275
+ if (viaUpload && !path47.isAbsolute(spec.path)) {
157124
157276
  throw new FailureError(
157125
157277
  `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.`,
157126
157278
  {
@@ -157206,7 +157358,7 @@ function stepFlow(step, scope) {
157206
157358
  return step.kind === "run" ? runDisplayName(step.flow, scope) : scopeFlow(scope);
157207
157359
  }
157208
157360
  function scopeFlowDir(scope) {
157209
- return path46.dirname(scope.runStack[scope.runStack.length - 1].canonical);
157361
+ return path47.dirname(scope.runStack[scope.runStack.length - 1].canonical);
157210
157362
  }
157211
157363
  function childScope(scope, overrides = {}) {
157212
157364
  return { ...scope, ...overrides, depth: scope.depth + 1 };
@@ -157385,10 +157537,6 @@ async function execWhenStep(state3, step, scope) {
157385
157537
  });
157386
157538
  await execSteps(state3, step.steps, inner);
157387
157539
  }
157388
- function baselineKeyFor(canonicalPath, flowName) {
157389
- const stem = path46.basename(canonicalPath, ".yaml");
157390
- return FLOW_NAME_PATTERN.test(stem) ? stem : flowName;
157391
- }
157392
157540
  async function execRunStep(state3, step, scope) {
157393
157541
  const index = state3.reports.length;
157394
157542
  const target = step.flow;
@@ -157422,7 +157570,7 @@ async function execRunStep(state3, step, scope) {
157422
157570
  if (scope.runStack.length >= MAX_RUN_DEPTH) {
157423
157571
  return fail("max run depth exceeded");
157424
157572
  }
157425
- const suppliedBase = path46.posix.basename(target);
157573
+ const suppliedBase = path47.posix.basename(target);
157426
157574
  if (spelling.state === "case_folded") {
157427
157575
  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`;
157428
157576
  return fail(
@@ -157560,6 +157708,8 @@ async function execLeafStep(state3, step, index, scope) {
157560
157708
  const r = await runSnapshot(deviceEnv(state3), {
157561
157709
  flowsDir: state3.flowsDir,
157562
157710
  flowName: state3.baselineKey,
157711
+ project: state3.project,
157712
+ ...state3.clientFlowPath !== void 0 ? { clientFlowPath: state3.clientFlowPath } : {},
157563
157713
  name: step.name,
157564
157714
  maxMismatch: step.maxMismatch ?? DEFAULT_MAX_MISMATCH,
157565
157715
  updateBaselines: state3.updateBaselines,
@@ -157689,7 +157839,7 @@ function assertFlowPathShape(flowPath) {
157689
157839
  error_kind: "validation"
157690
157840
  });
157691
157841
  }
157692
- if (!path46.isAbsolute(flowPath)) {
157842
+ if (!path47.isAbsolute(flowPath)) {
157693
157843
  throw new FailureError(
157694
157844
  `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.`,
157695
157845
  {
@@ -157713,8 +157863,8 @@ function assertFlowPathShape(flowPath) {
157713
157863
  }
157714
157864
  }
157715
157865
  function flowNameOf(clientPath) {
157716
- const clientExt = path46.extname(clientPath);
157717
- const bareExtension = path46.basename(clientPath).toLowerCase() === ".yaml";
157866
+ const clientExt = path47.extname(clientPath);
157867
+ const bareExtension = path47.basename(clientPath).toLowerCase() === ".yaml";
157718
157868
  if (!bareExtension && clientExt !== ".yaml") {
157719
157869
  const detail = clientExt.toLowerCase() === ".yaml" ? `flow files must use the lowercase .yaml extension, not "${clientExt}".` : `flow files must use the .yaml extension.`;
157720
157870
  throw new FailureError(`Invalid flow_path "${clientPath}": ${detail}`, {
@@ -157724,12 +157874,12 @@ function flowNameOf(clientPath) {
157724
157874
  error_kind: "validation"
157725
157875
  });
157726
157876
  }
157727
- const flowName = bareExtension ? "" : path46.basename(clientPath, ".yaml");
157877
+ const flowName = bareExtension ? "" : path47.basename(clientPath, ".yaml");
157728
157878
  assertSafeFlowName(flowName);
157729
157879
  return flowName;
157730
157880
  }
157731
157881
  function flowPathCasingError(clientPath, spelling) {
157732
- const suppliedBase = path46.basename(clientPath);
157882
+ const suppliedBase = path47.basename(clientPath);
157733
157883
  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.`;
157734
157884
  return new FailureError(
157735
157885
  `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}`,
@@ -157742,7 +157892,7 @@ function flowPathCasingError(clientPath, spelling) {
157742
157892
  );
157743
157893
  }
157744
157894
  function flowNameCasingError(flowName, spelling) {
157745
- const recovery = spelling.addressable ? `Pass name "${path46.basename(spelling.actual, ".yaml")}".` : `Rename "${spelling.actual}" to "${flowName}.yaml" to run it \u2014 flow files must be lowercase .yaml.`;
157895
+ const recovery = spelling.addressable ? `Pass name "${path47.basename(spelling.actual, ".yaml")}".` : `Rename "${spelling.actual}" to "${flowName}.yaml" to run it \u2014 flow files must be lowercase .yaml.`;
157746
157896
  return new FailureError(
157747
157897
  `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,
157748
157898
  {
@@ -157769,7 +157919,7 @@ async function resolveFlowSource(params, fileInput, flowPathInput) {
157769
157919
  assertFlowPathShape(clientPath2);
157770
157920
  return { filePath: params.flow_path, flowName: flowNameOf(clientPath2), viaUpload: true };
157771
157921
  }
157772
- const isVerifiedHostPath = flowPathInput?.presentOnHost === true && flowPathInput.statVerified === true && path46.resolve(params.flow_path) === path46.resolve(flowPathInput.clientPath);
157922
+ const isVerifiedHostPath = flowPathInput?.presentOnHost === true && flowPathInput.statVerified === true && path47.resolve(params.flow_path) === path47.resolve(flowPathInput.clientPath);
157773
157923
  if (!isVerifiedHostPath) {
157774
157924
  throw new FailureError(
157775
157925
  `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.`,
@@ -157785,8 +157935,8 @@ async function resolveFlowSource(params, fileInput, flowPathInput) {
157785
157935
  const clientPath = flowPathInput.clientPath;
157786
157936
  const flowName2 = flowNameOf(clientPath);
157787
157937
  const spelling2 = await classifyOnDiskSpelling(
157788
- path46.dirname(params.flow_path),
157789
- path46.basename(clientPath)
157938
+ path47.dirname(params.flow_path),
157939
+ path47.basename(clientPath)
157790
157940
  );
157791
157941
  if (spelling2.state !== "listed") throw flowPathCasingError(clientPath, spelling2);
157792
157942
  return { filePath: params.flow_path, flowName: flowName2, viaUpload: false };
@@ -157796,7 +157946,7 @@ async function resolveFlowSource(params, fileInput, flowPathInput) {
157796
157946
  const expected = getFlowPath(params.project_root, flowName);
157797
157947
  if (params.flow_file && fileInput?.viaUpload)
157798
157948
  return { filePath: params.flow_file, flowName, viaUpload: true };
157799
- if (params.flow_file && (!path46.isAbsolute(params.flow_file) || params.flow_file.split(/[\\/]+/).includes("..") || path46.resolve(params.flow_file) !== path46.resolve(expected))) {
157949
+ if (params.flow_file && (!path47.isAbsolute(params.flow_file) || params.flow_file.split(/[\\/]+/).includes("..") || path47.resolve(params.flow_file) !== path47.resolve(expected))) {
157800
157950
  throw new FailureError(
157801
157951
  `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.`,
157802
157952
  {
@@ -157807,7 +157957,7 @@ async function resolveFlowSource(params, fileInput, flowPathInput) {
157807
157957
  }
157808
157958
  );
157809
157959
  }
157810
- const spelling = await classifyOnDiskSpelling(path46.dirname(expected), `${flowName}.yaml`);
157960
+ const spelling = await classifyOnDiskSpelling(path47.dirname(expected), `${flowName}.yaml`);
157811
157961
  if (spelling.state === "case_folded") throw flowNameCasingError(flowName, spelling);
157812
157962
  return { filePath: params.flow_file || expected, flowName, viaUpload: false };
157813
157963
  }
@@ -157896,40 +158046,40 @@ var import_promises12 = require("node:fs/promises");
157896
158046
  var import_node_path23 = require("node:path");
157897
158047
  var import_node_child_process37 = require("node:child_process");
157898
158048
  var import_dotenv2 = __toESM(require_main());
157899
- async function exists(path51) {
158049
+ async function exists(path52) {
157900
158050
  try {
157901
- await (0, import_promises12.access)(path51);
158051
+ await (0, import_promises12.access)(path52);
157902
158052
  return true;
157903
158053
  } catch {
157904
158054
  return false;
157905
158055
  }
157906
158056
  }
157907
- async function isDirectory(path51) {
158057
+ async function isDirectory(path52) {
157908
158058
  try {
157909
- const s = await (0, import_promises12.stat)(path51);
158059
+ const s = await (0, import_promises12.stat)(path52);
157910
158060
  return s.isDirectory();
157911
158061
  } catch {
157912
158062
  return false;
157913
158063
  }
157914
158064
  }
157915
- async function readJsonFile(path51) {
158065
+ async function readJsonFile(path52) {
157916
158066
  try {
157917
- const raw = await (0, import_promises12.readFile)(path51, "utf-8");
158067
+ const raw = await (0, import_promises12.readFile)(path52, "utf-8");
157918
158068
  return JSON.parse(raw);
157919
158069
  } catch {
157920
158070
  return null;
157921
158071
  }
157922
158072
  }
157923
- async function readTextFile(path51) {
158073
+ async function readTextFile(path52) {
157924
158074
  try {
157925
- return await (0, import_promises12.readFile)(path51, "utf-8");
158075
+ return await (0, import_promises12.readFile)(path52, "utf-8");
157926
158076
  } catch {
157927
158077
  return null;
157928
158078
  }
157929
158079
  }
157930
- async function listDir(path51) {
158080
+ async function listDir(path52) {
157931
158081
  try {
157932
- const entries = await (0, import_promises12.readdir)(path51);
158082
+ const entries = await (0, import_promises12.readdir)(path52);
157933
158083
  return entries;
157934
158084
  } catch {
157935
158085
  return null;
@@ -158229,11 +158379,11 @@ Fails if the workspacePath is not an absolute path or the directory cannot be ac
158229
158379
  // ../tool-server/src/tools/system/update-argent.ts
158230
158380
  var import_node_child_process38 = require("node:child_process");
158231
158381
  var fs65 = __toESM(require("node:fs"));
158232
- var path47 = __toESM(require("node:path"));
158382
+ var path48 = __toESM(require("node:path"));
158233
158383
  init_zod();
158234
158384
  function resolveCliEntry() {
158235
158385
  try {
158236
- const entry = path47.join(__dirname, "cli.js");
158386
+ const entry = path48.join(__dirname, "cli.js");
158237
158387
  return fs65.existsSync(entry) ? entry : null;
158238
158388
  } catch {
158239
158389
  return null;
@@ -158248,20 +158398,20 @@ function classifyRunningInstall() {
158248
158398
  }
158249
158399
  let runningRoot;
158250
158400
  try {
158251
- runningRoot = fs65.realpathSync(path47.dirname(__dirname));
158401
+ runningRoot = fs65.realpathSync(path48.dirname(__dirname));
158252
158402
  } catch {
158253
158403
  return { kind: "global", projectRoot: null };
158254
158404
  }
158255
158405
  let dir = process.cwd();
158256
158406
  while (true) {
158257
158407
  try {
158258
- const nmReal = fs65.realpathSync(path47.join(dir, "node_modules"));
158259
- if (runningRoot === nmReal || runningRoot.startsWith(nmReal + path47.sep)) {
158408
+ const nmReal = fs65.realpathSync(path48.join(dir, "node_modules"));
158409
+ if (runningRoot === nmReal || runningRoot.startsWith(nmReal + path48.sep)) {
158260
158410
  return { kind: "local", projectRoot: dir };
158261
158411
  }
158262
158412
  } catch {
158263
158413
  }
158264
- const parent = path47.dirname(dir);
158414
+ const parent = path48.dirname(dir);
158265
158415
  if (parent === dir) break;
158266
158416
  dir = parent;
158267
158417
  }
@@ -158275,15 +158425,15 @@ function findDeclaringProjectRoot(startDir) {
158275
158425
  return null;
158276
158426
  }
158277
158427
  while (true) {
158278
- if (fs65.existsSync(path47.join(dir, ".argent", "install.json"))) return dir;
158428
+ if (fs65.existsSync(path48.join(dir, ".argent", "install.json"))) return dir;
158279
158429
  try {
158280
- const manifest = JSON.parse(fs65.readFileSync(path47.join(dir, "package.json"), "utf8"));
158430
+ const manifest = JSON.parse(fs65.readFileSync(path48.join(dir, "package.json"), "utf8"));
158281
158431
  if (manifest.devDependencies?.[PACKAGE_NAME2] || manifest.dependencies?.[PACKAGE_NAME2] || manifest.optionalDependencies?.[PACKAGE_NAME2]) {
158282
158432
  return dir;
158283
158433
  }
158284
158434
  } catch {
158285
158435
  }
158286
- const parent = path47.dirname(dir);
158436
+ const parent = path48.dirname(dir);
158287
158437
  if (parent === dir) return null;
158288
158438
  dir = parent;
158289
158439
  }
@@ -159521,33 +159671,33 @@ function startSimulatorWatcher(registry2) {
159521
159671
  var import_node_child_process40 = require("node:child_process");
159522
159672
  var fs68 = __toESM(require("node:fs"));
159523
159673
  var os20 = __toESM(require("node:os"));
159524
- var path49 = __toESM(require("node:path"));
159674
+ var path50 = __toESM(require("node:path"));
159525
159675
  function ensureLensAppBundle(electronBin) {
159526
159676
  if (process.platform !== "darwin") return null;
159527
159677
  try {
159528
159678
  const realApp = electronBin.replace(/\/Contents\/MacOS\/[^/]+$/, "");
159529
159679
  if (!realApp.endsWith(".app")) return null;
159530
- const realContents = path49.join(realApp, "Contents");
159531
- const wrapperContents = path49.join(
159680
+ const realContents = path50.join(realApp, "Contents");
159681
+ const wrapperContents = path50.join(
159532
159682
  os20.tmpdir(),
159533
159683
  "argent-lens-app",
159534
159684
  "Argent Lens.app",
159535
159685
  "Contents"
159536
159686
  );
159537
- const wrapperExec = path49.join(wrapperContents, "MacOS", "Electron");
159687
+ const wrapperExec = path50.join(wrapperContents, "MacOS", "Electron");
159538
159688
  try {
159539
159689
  if (fs68.realpathSync(wrapperExec) === fs68.realpathSync(electronBin)) return wrapperExec;
159540
159690
  } catch {
159541
159691
  }
159542
- fs68.rmSync(path49.dirname(wrapperContents), { recursive: true, force: true });
159543
- fs68.mkdirSync(path49.join(wrapperContents, "MacOS"), { recursive: true });
159544
- fs68.symlinkSync(path49.join(realContents, "Frameworks"), path49.join(wrapperContents, "Frameworks"));
159545
- fs68.symlinkSync(path49.join(realContents, "Resources"), path49.join(wrapperContents, "Resources"));
159692
+ fs68.rmSync(path50.dirname(wrapperContents), { recursive: true, force: true });
159693
+ fs68.mkdirSync(path50.join(wrapperContents, "MacOS"), { recursive: true });
159694
+ fs68.symlinkSync(path50.join(realContents, "Frameworks"), path50.join(wrapperContents, "Frameworks"));
159695
+ fs68.symlinkSync(path50.join(realContents, "Resources"), path50.join(wrapperContents, "Resources"));
159546
159696
  fs68.symlinkSync(electronBin, wrapperExec);
159547
- const pkgInfo = path49.join(realContents, "PkgInfo");
159548
- if (fs68.existsSync(pkgInfo)) fs68.copyFileSync(pkgInfo, path49.join(wrapperContents, "PkgInfo"));
159549
- const plist = path49.join(wrapperContents, "Info.plist");
159550
- fs68.copyFileSync(path49.join(realContents, "Info.plist"), plist);
159697
+ const pkgInfo = path50.join(realContents, "PkgInfo");
159698
+ if (fs68.existsSync(pkgInfo)) fs68.copyFileSync(pkgInfo, path50.join(wrapperContents, "PkgInfo"));
159699
+ const plist = path50.join(wrapperContents, "Info.plist");
159700
+ fs68.copyFileSync(path50.join(realContents, "Info.plist"), plist);
159551
159701
  const setPlist = (entry, value) => {
159552
159702
  try {
159553
159703
  (0, import_node_child_process40.execFileSync)("/usr/libexec/PlistBuddy", ["-c", `Set :${entry} ${value}`, plist]);
@@ -159588,7 +159738,7 @@ function createPreviewWindowManager(opts = {}) {
159588
159738
  };
159589
159739
  const resolveMainScript = () => {
159590
159740
  if (opts.mainScript) return opts.mainScript;
159591
- const bundled = path49.join(__dirname, "preview-window", "main.cjs");
159741
+ const bundled = path50.join(__dirname, "preview-window", "main.cjs");
159592
159742
  if (fs68.existsSync(bundled)) return bundled;
159593
159743
  return require.resolve("@argent/preview-window/dist/main.js");
159594
159744
  };
@@ -159735,7 +159885,7 @@ function start() {
159735
159885
  attachRegistryLogger(registry2);
159736
159886
  let eventLog = null;
159737
159887
  if (isFlagEnabled("tool-server-event-log")) {
159738
- const eventLogPath = process.env.ARGENT_EVENT_LOG || path50.join((0, import_node_os14.homedir)(), ".argent", "tool-server-events.jsonl");
159888
+ const eventLogPath = process.env.ARGENT_EVENT_LOG || path51.join((0, import_node_os14.homedir)(), ".argent", "tool-server-events.jsonl");
159739
159889
  try {
159740
159890
  eventLog = createToolServerEventLog({ filePath: eventLogPath });
159741
159891
  } catch (err) {