@exodus/xqa 5.0.0 → 5.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/xqa.cjs CHANGED
@@ -161,7 +161,7 @@ var require_index_cjs = __commonJS({
161
161
  }, reject);
162
162
  }
163
163
  }
164
- var ResultAsync21 = class _ResultAsync {
164
+ var ResultAsync28 = class _ResultAsync {
165
165
  constructor(res) {
166
166
  this._promise = res;
167
167
  }
@@ -262,8 +262,8 @@ var require_index_cjs = __commonJS({
262
262
  return new Ok(res.value);
263
263
  })));
264
264
  }
265
- match(ok45, _err) {
266
- return this._promise.then((res) => res.match(ok45, _err));
265
+ match(ok46, _err) {
266
+ return this._promise.then((res) => res.match(ok46, _err));
267
267
  }
268
268
  unwrapOr(t) {
269
269
  return this._promise.then((res) => res.unwrapOr(t));
@@ -300,19 +300,19 @@ var require_index_cjs = __commonJS({
300
300
  }
301
301
  };
302
302
  function okAsync12(value) {
303
- return new ResultAsync21(Promise.resolve(new Ok(value)));
303
+ return new ResultAsync28(Promise.resolve(new Ok(value)));
304
304
  }
305
- function errAsync12(err41) {
306
- return new ResultAsync21(Promise.resolve(new Err(err41)));
305
+ function errAsync12(err45) {
306
+ return new ResultAsync28(Promise.resolve(new Err(err45)));
307
307
  }
308
- var fromPromise = ResultAsync21.fromPromise;
309
- var fromSafePromise2 = ResultAsync21.fromSafePromise;
310
- var fromAsyncThrowable9 = ResultAsync21.fromThrowable;
308
+ var fromPromise = ResultAsync28.fromPromise;
309
+ var fromSafePromise2 = ResultAsync28.fromSafePromise;
310
+ var fromAsyncThrowable9 = ResultAsync28.fromThrowable;
311
311
  var combineResultList = (resultList) => {
312
- let acc = ok41([]);
312
+ let acc = ok45([]);
313
313
  for (const result of resultList) {
314
314
  if (result.isErr()) {
315
- acc = err40(result.error);
315
+ acc = err41(result.error);
316
316
  break;
317
317
  } else {
318
318
  acc.map((list) => list.push(result.value));
@@ -320,30 +320,30 @@ var require_index_cjs = __commonJS({
320
320
  }
321
321
  return acc;
322
322
  };
323
- var combineResultAsyncList = (asyncResultList) => ResultAsync21.fromSafePromise(Promise.all(asyncResultList)).andThen(combineResultList);
323
+ var combineResultAsyncList = (asyncResultList) => ResultAsync28.fromSafePromise(Promise.all(asyncResultList)).andThen(combineResultList);
324
324
  var combineResultListWithAllErrors = (resultList) => {
325
- let acc = ok41([]);
325
+ let acc = ok45([]);
326
326
  for (const result of resultList) {
327
327
  if (result.isErr() && acc.isErr()) {
328
328
  acc.error.push(result.error);
329
329
  } else if (result.isErr() && acc.isOk()) {
330
- acc = err40([result.error]);
330
+ acc = err41([result.error]);
331
331
  } else if (result.isOk() && acc.isOk()) {
332
332
  acc.value.push(result.value);
333
333
  }
334
334
  }
335
335
  return acc;
336
336
  };
337
- var combineResultAsyncListWithAllErrors = (asyncResultList) => ResultAsync21.fromSafePromise(Promise.all(asyncResultList)).andThen(combineResultListWithAllErrors);
337
+ var combineResultAsyncListWithAllErrors = (asyncResultList) => ResultAsync28.fromSafePromise(Promise.all(asyncResultList)).andThen(combineResultListWithAllErrors);
338
338
  exports2.Result = void 0;
339
339
  (function(Result3) {
340
340
  function fromThrowable21(fn, errorFn) {
341
341
  return (...args) => {
342
342
  try {
343
343
  const result = fn(...args);
344
- return ok41(result);
344
+ return ok45(result);
345
345
  } catch (e3) {
346
- return err40(errorFn ? errorFn(e3) : e3);
346
+ return err41(errorFn ? errorFn(e3) : e3);
347
347
  }
348
348
  };
349
349
  }
@@ -357,16 +357,16 @@ var require_index_cjs = __commonJS({
357
357
  }
358
358
  Result3.combineWithAllErrors = combineWithAllErrors;
359
359
  })(exports2.Result || (exports2.Result = {}));
360
- function ok41(value) {
360
+ function ok45(value) {
361
361
  return new Ok(value);
362
362
  }
363
- function err40(err41) {
364
- return new Err(err41);
363
+ function err41(err45) {
364
+ return new Err(err45);
365
365
  }
366
366
  function safeTry(body) {
367
367
  const n3 = body().next();
368
368
  if (n3 instanceof Promise) {
369
- return new ResultAsync21(n3.then((r3) => r3.value));
369
+ return new ResultAsync28(n3.then((r3) => r3.value));
370
370
  }
371
371
  return n3.value;
372
372
  }
@@ -381,11 +381,11 @@ var require_index_cjs = __commonJS({
381
381
  return !this.isOk();
382
382
  }
383
383
  map(f6) {
384
- return ok41(f6(this.value));
384
+ return ok45(f6(this.value));
385
385
  }
386
386
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
387
387
  mapErr(_f) {
388
- return ok41(this.value);
388
+ return ok45(this.value);
389
389
  }
390
390
  // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
391
391
  andThen(f6) {
@@ -400,14 +400,14 @@ var require_index_cjs = __commonJS({
400
400
  f6(this.value);
401
401
  } catch (e3) {
402
402
  }
403
- return ok41(this.value);
403
+ return ok45(this.value);
404
404
  }
405
405
  orTee(_f) {
406
- return ok41(this.value);
406
+ return ok45(this.value);
407
407
  }
408
408
  // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
409
409
  orElse(_f) {
410
- return ok41(this.value);
410
+ return ok45(this.value);
411
411
  }
412
412
  asyncAndThen(f6) {
413
413
  return f6(this.value);
@@ -417,15 +417,15 @@ var require_index_cjs = __commonJS({
417
417
  return f6(this.value).map(() => this.value);
418
418
  }
419
419
  asyncMap(f6) {
420
- return ResultAsync21.fromSafePromise(f6(this.value));
420
+ return ResultAsync28.fromSafePromise(f6(this.value));
421
421
  }
422
422
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
423
423
  unwrapOr(_v) {
424
424
  return this.value;
425
425
  }
426
426
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
427
- match(ok45, _err) {
428
- return ok45(this.value);
427
+ match(ok46, _err) {
428
+ return ok46(this.value);
429
429
  }
430
430
  safeUnwrap() {
431
431
  const value = this.value;
@@ -456,27 +456,27 @@ var require_index_cjs = __commonJS({
456
456
  }
457
457
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
458
458
  map(_f) {
459
- return err40(this.error);
459
+ return err41(this.error);
460
460
  }
461
461
  mapErr(f6) {
462
- return err40(f6(this.error));
462
+ return err41(f6(this.error));
463
463
  }
464
464
  andThrough(_f) {
465
- return err40(this.error);
465
+ return err41(this.error);
466
466
  }
467
467
  andTee(_f) {
468
- return err40(this.error);
468
+ return err41(this.error);
469
469
  }
470
470
  orTee(f6) {
471
471
  try {
472
472
  f6(this.error);
473
473
  } catch (e3) {
474
474
  }
475
- return err40(this.error);
475
+ return err41(this.error);
476
476
  }
477
477
  // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
478
478
  andThen(_f) {
479
- return err40(this.error);
479
+ return err41(this.error);
480
480
  }
481
481
  // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
482
482
  orElse(f6) {
@@ -496,13 +496,13 @@ var require_index_cjs = __commonJS({
496
496
  unwrapOr(v2) {
497
497
  return v2;
498
498
  }
499
- match(_ok, err41) {
500
- return err41(this.error);
499
+ match(_ok, err45) {
500
+ return err45(this.error);
501
501
  }
502
502
  safeUnwrap() {
503
503
  const error48 = this.error;
504
504
  return (function* () {
505
- yield err40(error48);
505
+ yield err41(error48);
506
506
  throw new Error("Do not use this generator out of `safeTry`");
507
507
  })();
508
508
  }
@@ -521,14 +521,14 @@ var require_index_cjs = __commonJS({
521
521
  var fromThrowable20 = exports2.Result.fromThrowable;
522
522
  exports2.Err = Err;
523
523
  exports2.Ok = Ok;
524
- exports2.ResultAsync = ResultAsync21;
525
- exports2.err = err40;
524
+ exports2.ResultAsync = ResultAsync28;
525
+ exports2.err = err41;
526
526
  exports2.errAsync = errAsync12;
527
527
  exports2.fromAsyncThrowable = fromAsyncThrowable9;
528
528
  exports2.fromPromise = fromPromise;
529
529
  exports2.fromSafePromise = fromSafePromise2;
530
530
  exports2.fromThrowable = fromThrowable20;
531
- exports2.ok = ok41;
531
+ exports2.ok = ok45;
532
532
  exports2.okAsync = okAsync12;
533
533
  exports2.safeTry = safeTry;
534
534
  }
@@ -611,17 +611,17 @@ var require_visit = __commonJS({
611
611
  visit.BREAK = BREAK;
612
612
  visit.SKIP = SKIP;
613
613
  visit.REMOVE = REMOVE;
614
- function visit_(key, node, visitor, path39) {
615
- const ctrl = callVisitor(key, node, visitor, path39);
614
+ function visit_(key, node, visitor, path40) {
615
+ const ctrl = callVisitor(key, node, visitor, path40);
616
616
  if (identity.isNode(ctrl) || identity.isPair(ctrl)) {
617
- replaceNode(key, path39, ctrl);
618
- return visit_(key, ctrl, visitor, path39);
617
+ replaceNode(key, path40, ctrl);
618
+ return visit_(key, ctrl, visitor, path40);
619
619
  }
620
620
  if (typeof ctrl !== "symbol") {
621
621
  if (identity.isCollection(node)) {
622
- path39 = Object.freeze(path39.concat(node));
622
+ path40 = Object.freeze(path40.concat(node));
623
623
  for (let i3 = 0; i3 < node.items.length; ++i3) {
624
- const ci = visit_(i3, node.items[i3], visitor, path39);
624
+ const ci = visit_(i3, node.items[i3], visitor, path40);
625
625
  if (typeof ci === "number")
626
626
  i3 = ci - 1;
627
627
  else if (ci === BREAK)
@@ -632,13 +632,13 @@ var require_visit = __commonJS({
632
632
  }
633
633
  }
634
634
  } else if (identity.isPair(node)) {
635
- path39 = Object.freeze(path39.concat(node));
636
- const ck = visit_("key", node.key, visitor, path39);
635
+ path40 = Object.freeze(path40.concat(node));
636
+ const ck = visit_("key", node.key, visitor, path40);
637
637
  if (ck === BREAK)
638
638
  return BREAK;
639
639
  else if (ck === REMOVE)
640
640
  node.key = null;
641
- const cv = visit_("value", node.value, visitor, path39);
641
+ const cv = visit_("value", node.value, visitor, path40);
642
642
  if (cv === BREAK)
643
643
  return BREAK;
644
644
  else if (cv === REMOVE)
@@ -659,17 +659,17 @@ var require_visit = __commonJS({
659
659
  visitAsync.BREAK = BREAK;
660
660
  visitAsync.SKIP = SKIP;
661
661
  visitAsync.REMOVE = REMOVE;
662
- async function visitAsync_(key, node, visitor, path39) {
663
- const ctrl = await callVisitor(key, node, visitor, path39);
662
+ async function visitAsync_(key, node, visitor, path40) {
663
+ const ctrl = await callVisitor(key, node, visitor, path40);
664
664
  if (identity.isNode(ctrl) || identity.isPair(ctrl)) {
665
- replaceNode(key, path39, ctrl);
666
- return visitAsync_(key, ctrl, visitor, path39);
665
+ replaceNode(key, path40, ctrl);
666
+ return visitAsync_(key, ctrl, visitor, path40);
667
667
  }
668
668
  if (typeof ctrl !== "symbol") {
669
669
  if (identity.isCollection(node)) {
670
- path39 = Object.freeze(path39.concat(node));
670
+ path40 = Object.freeze(path40.concat(node));
671
671
  for (let i3 = 0; i3 < node.items.length; ++i3) {
672
- const ci = await visitAsync_(i3, node.items[i3], visitor, path39);
672
+ const ci = await visitAsync_(i3, node.items[i3], visitor, path40);
673
673
  if (typeof ci === "number")
674
674
  i3 = ci - 1;
675
675
  else if (ci === BREAK)
@@ -680,13 +680,13 @@ var require_visit = __commonJS({
680
680
  }
681
681
  }
682
682
  } else if (identity.isPair(node)) {
683
- path39 = Object.freeze(path39.concat(node));
684
- const ck = await visitAsync_("key", node.key, visitor, path39);
683
+ path40 = Object.freeze(path40.concat(node));
684
+ const ck = await visitAsync_("key", node.key, visitor, path40);
685
685
  if (ck === BREAK)
686
686
  return BREAK;
687
687
  else if (ck === REMOVE)
688
688
  node.key = null;
689
- const cv = await visitAsync_("value", node.value, visitor, path39);
689
+ const cv = await visitAsync_("value", node.value, visitor, path40);
690
690
  if (cv === BREAK)
691
691
  return BREAK;
692
692
  else if (cv === REMOVE)
@@ -713,23 +713,23 @@ var require_visit = __commonJS({
713
713
  }
714
714
  return visitor;
715
715
  }
716
- function callVisitor(key, node, visitor, path39) {
716
+ function callVisitor(key, node, visitor, path40) {
717
717
  if (typeof visitor === "function")
718
- return visitor(key, node, path39);
718
+ return visitor(key, node, path40);
719
719
  if (identity.isMap(node))
720
- return visitor.Map?.(key, node, path39);
720
+ return visitor.Map?.(key, node, path40);
721
721
  if (identity.isSeq(node))
722
- return visitor.Seq?.(key, node, path39);
722
+ return visitor.Seq?.(key, node, path40);
723
723
  if (identity.isPair(node))
724
- return visitor.Pair?.(key, node, path39);
724
+ return visitor.Pair?.(key, node, path40);
725
725
  if (identity.isScalar(node))
726
- return visitor.Scalar?.(key, node, path39);
726
+ return visitor.Scalar?.(key, node, path40);
727
727
  if (identity.isAlias(node))
728
- return visitor.Alias?.(key, node, path39);
728
+ return visitor.Alias?.(key, node, path40);
729
729
  return void 0;
730
730
  }
731
- function replaceNode(key, path39, node) {
732
- const parent = path39[path39.length - 1];
731
+ function replaceNode(key, path40, node) {
732
+ const parent = path40[path40.length - 1];
733
733
  if (identity.isCollection(parent)) {
734
734
  parent.items[key] = node;
735
735
  } else if (identity.isPair(parent)) {
@@ -1337,10 +1337,10 @@ var require_Collection = __commonJS({
1337
1337
  var createNode = require_createNode();
1338
1338
  var identity = require_identity();
1339
1339
  var Node = require_Node();
1340
- function collectionFromPath(schema2, path39, value) {
1340
+ function collectionFromPath(schema2, path40, value) {
1341
1341
  let v2 = value;
1342
- for (let i3 = path39.length - 1; i3 >= 0; --i3) {
1343
- const k3 = path39[i3];
1342
+ for (let i3 = path40.length - 1; i3 >= 0; --i3) {
1343
+ const k3 = path40[i3];
1344
1344
  if (typeof k3 === "number" && Number.isInteger(k3) && k3 >= 0) {
1345
1345
  const a3 = [];
1346
1346
  a3[k3] = v2;
@@ -1359,7 +1359,7 @@ var require_Collection = __commonJS({
1359
1359
  sourceObjects: /* @__PURE__ */ new Map()
1360
1360
  });
1361
1361
  }
1362
- var isEmptyPath = (path39) => path39 == null || typeof path39 === "object" && !!path39[Symbol.iterator]().next().done;
1362
+ var isEmptyPath = (path40) => path40 == null || typeof path40 === "object" && !!path40[Symbol.iterator]().next().done;
1363
1363
  var Collection2 = class extends Node.NodeBase {
1364
1364
  constructor(type2, schema2) {
1365
1365
  super(type2);
@@ -1389,11 +1389,11 @@ var require_Collection = __commonJS({
1389
1389
  * be a Pair instance or a `{ key, value }` object, which may not have a key
1390
1390
  * that already exists in the map.
1391
1391
  */
1392
- addIn(path39, value) {
1393
- if (isEmptyPath(path39))
1392
+ addIn(path40, value) {
1393
+ if (isEmptyPath(path40))
1394
1394
  this.add(value);
1395
1395
  else {
1396
- const [key, ...rest] = path39;
1396
+ const [key, ...rest] = path40;
1397
1397
  const node = this.get(key, true);
1398
1398
  if (identity.isCollection(node))
1399
1399
  node.addIn(rest, value);
@@ -1407,8 +1407,8 @@ var require_Collection = __commonJS({
1407
1407
  * Removes a value from the collection.
1408
1408
  * @returns `true` if the item was found and removed.
1409
1409
  */
1410
- deleteIn(path39) {
1411
- const [key, ...rest] = path39;
1410
+ deleteIn(path40) {
1411
+ const [key, ...rest] = path40;
1412
1412
  if (rest.length === 0)
1413
1413
  return this.delete(key);
1414
1414
  const node = this.get(key, true);
@@ -1422,8 +1422,8 @@ var require_Collection = __commonJS({
1422
1422
  * scalar values from their surrounding node; to disable set `keepScalar` to
1423
1423
  * `true` (collections are always returned intact).
1424
1424
  */
1425
- getIn(path39, keepScalar) {
1426
- const [key, ...rest] = path39;
1425
+ getIn(path40, keepScalar) {
1426
+ const [key, ...rest] = path40;
1427
1427
  const node = this.get(key, true);
1428
1428
  if (rest.length === 0)
1429
1429
  return !keepScalar && identity.isScalar(node) ? node.value : node;
@@ -1441,8 +1441,8 @@ var require_Collection = __commonJS({
1441
1441
  /**
1442
1442
  * Checks if the collection includes a value with the key `key`.
1443
1443
  */
1444
- hasIn(path39) {
1445
- const [key, ...rest] = path39;
1444
+ hasIn(path40) {
1445
+ const [key, ...rest] = path40;
1446
1446
  if (rest.length === 0)
1447
1447
  return this.has(key);
1448
1448
  const node = this.get(key, true);
@@ -1452,8 +1452,8 @@ var require_Collection = __commonJS({
1452
1452
  * Sets a value in this collection. For `!!set`, `value` needs to be a
1453
1453
  * boolean to add/remove the item from the set.
1454
1454
  */
1455
- setIn(path39, value) {
1456
- const [key, ...rest] = path39;
1455
+ setIn(path40, value) {
1456
+ const [key, ...rest] = path40;
1457
1457
  if (rest.length === 0) {
1458
1458
  this.set(key, value);
1459
1459
  } else {
@@ -3965,9 +3965,9 @@ var require_Document = __commonJS({
3965
3965
  this.contents.add(value);
3966
3966
  }
3967
3967
  /** Adds a value to the document. */
3968
- addIn(path39, value) {
3968
+ addIn(path40, value) {
3969
3969
  if (assertCollection(this.contents))
3970
- this.contents.addIn(path39, value);
3970
+ this.contents.addIn(path40, value);
3971
3971
  }
3972
3972
  /**
3973
3973
  * Create a new `Alias` node, ensuring that the target `node` has the required anchor.
@@ -4042,14 +4042,14 @@ var require_Document = __commonJS({
4042
4042
  * Removes a value from the document.
4043
4043
  * @returns `true` if the item was found and removed.
4044
4044
  */
4045
- deleteIn(path39) {
4046
- if (Collection2.isEmptyPath(path39)) {
4045
+ deleteIn(path40) {
4046
+ if (Collection2.isEmptyPath(path40)) {
4047
4047
  if (this.contents == null)
4048
4048
  return false;
4049
4049
  this.contents = null;
4050
4050
  return true;
4051
4051
  }
4052
- return assertCollection(this.contents) ? this.contents.deleteIn(path39) : false;
4052
+ return assertCollection(this.contents) ? this.contents.deleteIn(path40) : false;
4053
4053
  }
4054
4054
  /**
4055
4055
  * Returns item at `key`, or `undefined` if not found. By default unwraps
@@ -4064,10 +4064,10 @@ var require_Document = __commonJS({
4064
4064
  * scalar values from their surrounding node; to disable set `keepScalar` to
4065
4065
  * `true` (collections are always returned intact).
4066
4066
  */
4067
- getIn(path39, keepScalar) {
4068
- if (Collection2.isEmptyPath(path39))
4067
+ getIn(path40, keepScalar) {
4068
+ if (Collection2.isEmptyPath(path40))
4069
4069
  return !keepScalar && identity.isScalar(this.contents) ? this.contents.value : this.contents;
4070
- return identity.isCollection(this.contents) ? this.contents.getIn(path39, keepScalar) : void 0;
4070
+ return identity.isCollection(this.contents) ? this.contents.getIn(path40, keepScalar) : void 0;
4071
4071
  }
4072
4072
  /**
4073
4073
  * Checks if the document includes a value with the key `key`.
@@ -4078,10 +4078,10 @@ var require_Document = __commonJS({
4078
4078
  /**
4079
4079
  * Checks if the document includes a value at `path`.
4080
4080
  */
4081
- hasIn(path39) {
4082
- if (Collection2.isEmptyPath(path39))
4081
+ hasIn(path40) {
4082
+ if (Collection2.isEmptyPath(path40))
4083
4083
  return this.contents !== void 0;
4084
- return identity.isCollection(this.contents) ? this.contents.hasIn(path39) : false;
4084
+ return identity.isCollection(this.contents) ? this.contents.hasIn(path40) : false;
4085
4085
  }
4086
4086
  /**
4087
4087
  * Sets a value in this document. For `!!set`, `value` needs to be a
@@ -4098,13 +4098,13 @@ var require_Document = __commonJS({
4098
4098
  * Sets a value in this document. For `!!set`, `value` needs to be a
4099
4099
  * boolean to add/remove the item from the set.
4100
4100
  */
4101
- setIn(path39, value) {
4102
- if (Collection2.isEmptyPath(path39)) {
4101
+ setIn(path40, value) {
4102
+ if (Collection2.isEmptyPath(path40)) {
4103
4103
  this.contents = value;
4104
4104
  } else if (this.contents == null) {
4105
- this.contents = Collection2.collectionFromPath(this.schema, Array.from(path39), value);
4105
+ this.contents = Collection2.collectionFromPath(this.schema, Array.from(path40), value);
4106
4106
  } else if (assertCollection(this.contents)) {
4107
- this.contents.setIn(path39, value);
4107
+ this.contents.setIn(path40, value);
4108
4108
  }
4109
4109
  }
4110
4110
  /**
@@ -5321,8 +5321,8 @@ var require_resolve_flow_scalar = __commonJS({
5321
5321
  };
5322
5322
  function parseCharCode(source, offset, length, onError) {
5323
5323
  const cc = source.substr(offset, length);
5324
- const ok41 = cc.length === length && /^[0-9a-fA-F]+$/.test(cc);
5325
- const code = ok41 ? parseInt(cc, 16) : NaN;
5324
+ const ok45 = cc.length === length && /^[0-9a-fA-F]+$/.test(cc);
5325
+ const code = ok45 ? parseInt(cc, 16) : NaN;
5326
5326
  if (isNaN(code)) {
5327
5327
  const raw = source.substr(offset - 2, length + 2);
5328
5328
  onError(offset - 2, "BAD_DQ_ESCAPE", `Invalid escape sequence ${raw}`);
@@ -6061,9 +6061,9 @@ var require_cst_visit = __commonJS({
6061
6061
  visit.BREAK = BREAK;
6062
6062
  visit.SKIP = SKIP;
6063
6063
  visit.REMOVE = REMOVE;
6064
- visit.itemAtPath = (cst, path39) => {
6064
+ visit.itemAtPath = (cst, path40) => {
6065
6065
  let item = cst;
6066
- for (const [field, index] of path39) {
6066
+ for (const [field, index] of path40) {
6067
6067
  const tok = item?.[field];
6068
6068
  if (tok && "items" in tok) {
6069
6069
  item = tok.items[index];
@@ -6072,23 +6072,23 @@ var require_cst_visit = __commonJS({
6072
6072
  }
6073
6073
  return item;
6074
6074
  };
6075
- visit.parentCollection = (cst, path39) => {
6076
- const parent = visit.itemAtPath(cst, path39.slice(0, -1));
6077
- const field = path39[path39.length - 1][0];
6075
+ visit.parentCollection = (cst, path40) => {
6076
+ const parent = visit.itemAtPath(cst, path40.slice(0, -1));
6077
+ const field = path40[path40.length - 1][0];
6078
6078
  const coll = parent?.[field];
6079
6079
  if (coll && "items" in coll)
6080
6080
  return coll;
6081
6081
  throw new Error("Parent collection not found");
6082
6082
  };
6083
- function _visit(path39, item, visitor) {
6084
- let ctrl = visitor(item, path39);
6083
+ function _visit(path40, item, visitor) {
6084
+ let ctrl = visitor(item, path40);
6085
6085
  if (typeof ctrl === "symbol")
6086
6086
  return ctrl;
6087
6087
  for (const field of ["key", "value"]) {
6088
6088
  const token = item[field];
6089
6089
  if (token && "items" in token) {
6090
6090
  for (let i3 = 0; i3 < token.items.length; ++i3) {
6091
- const ci = _visit(Object.freeze(path39.concat([[field, i3]])), token.items[i3], visitor);
6091
+ const ci = _visit(Object.freeze(path40.concat([[field, i3]])), token.items[i3], visitor);
6092
6092
  if (typeof ci === "number")
6093
6093
  i3 = ci - 1;
6094
6094
  else if (ci === BREAK)
@@ -6099,10 +6099,10 @@ var require_cst_visit = __commonJS({
6099
6099
  }
6100
6100
  }
6101
6101
  if (typeof ctrl === "function" && field === "key")
6102
- ctrl = ctrl(item, path39);
6102
+ ctrl = ctrl(item, path40);
6103
6103
  }
6104
6104
  }
6105
- return typeof ctrl === "function" ? ctrl(item, path39) : ctrl;
6105
+ return typeof ctrl === "function" ? ctrl(item, path40) : ctrl;
6106
6106
  }
6107
6107
  exports2.visit = visit;
6108
6108
  }
@@ -7387,14 +7387,14 @@ var require_parser = __commonJS({
7387
7387
  case "scalar":
7388
7388
  case "single-quoted-scalar":
7389
7389
  case "double-quoted-scalar": {
7390
- const fs4 = this.flowScalar(this.type);
7390
+ const fs5 = this.flowScalar(this.type);
7391
7391
  if (atNextItem || it.value) {
7392
- map3.items.push({ start, key: fs4, sep: [] });
7392
+ map3.items.push({ start, key: fs5, sep: [] });
7393
7393
  this.onKeyLine = true;
7394
7394
  } else if (it.sep) {
7395
- this.stack.push(fs4);
7395
+ this.stack.push(fs5);
7396
7396
  } else {
7397
- Object.assign(it, { key: fs4, sep: [] });
7397
+ Object.assign(it, { key: fs5, sep: [] });
7398
7398
  this.onKeyLine = true;
7399
7399
  }
7400
7400
  return;
@@ -7522,13 +7522,13 @@ var require_parser = __commonJS({
7522
7522
  case "scalar":
7523
7523
  case "single-quoted-scalar":
7524
7524
  case "double-quoted-scalar": {
7525
- const fs4 = this.flowScalar(this.type);
7525
+ const fs5 = this.flowScalar(this.type);
7526
7526
  if (!it || it.value)
7527
- fc.items.push({ start: [], key: fs4, sep: [] });
7527
+ fc.items.push({ start: [], key: fs5, sep: [] });
7528
7528
  else if (it.sep)
7529
- this.stack.push(fs4);
7529
+ this.stack.push(fs5);
7530
7530
  else
7531
- Object.assign(it, { key: fs4, sep: [] });
7531
+ Object.assign(it, { key: fs5, sep: [] });
7532
7532
  return;
7533
7533
  }
7534
7534
  case "flow-map-end":
@@ -8999,8 +8999,8 @@ var require_command = __commonJS({
8999
8999
  "../../node_modules/.pnpm/commander@14.0.3/node_modules/commander/lib/command.js"(exports2) {
9000
9000
  var EventEmitter = require("node:events").EventEmitter;
9001
9001
  var childProcess = require("node:child_process");
9002
- var path39 = require("node:path");
9003
- var fs4 = require("node:fs");
9002
+ var path40 = require("node:path");
9003
+ var fs5 = require("node:fs");
9004
9004
  var process6 = require("node:process");
9005
9005
  var { Argument: Argument2, humanReadableArgName } = require_argument();
9006
9006
  var { CommanderError: CommanderError2 } = require_error();
@@ -9426,9 +9426,9 @@ Expecting one of '${allowedValues.join("', '")}'`);
9426
9426
  if (fn) {
9427
9427
  this._exitCallback = fn;
9428
9428
  } else {
9429
- this._exitCallback = (err40) => {
9430
- if (err40.code !== "commander.executeSubCommandAsync") {
9431
- throw err40;
9429
+ this._exitCallback = (err41) => {
9430
+ if (err41.code !== "commander.executeSubCommandAsync") {
9431
+ throw err41;
9432
9432
  } else {
9433
9433
  }
9434
9434
  };
@@ -9504,12 +9504,12 @@ Expecting one of '${allowedValues.join("', '")}'`);
9504
9504
  _callParseArg(target, value, previous, invalidArgumentMessage) {
9505
9505
  try {
9506
9506
  return target.parseArg(value, previous);
9507
- } catch (err40) {
9508
- if (err40.code === "commander.invalidArgument") {
9509
- const message = `${invalidArgumentMessage} ${err40.message}`;
9510
- this.error(message, { exitCode: err40.exitCode, code: err40.code });
9507
+ } catch (err41) {
9508
+ if (err41.code === "commander.invalidArgument") {
9509
+ const message = `${invalidArgumentMessage} ${err41.message}`;
9510
+ this.error(message, { exitCode: err41.exitCode, code: err41.code });
9511
9511
  }
9512
- throw err40;
9512
+ throw err41;
9513
9513
  }
9514
9514
  }
9515
9515
  /**
@@ -9994,7 +9994,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
9994
9994
  * @param {string} subcommandName
9995
9995
  */
9996
9996
  _checkForMissingExecutable(executableFile, executableDir, subcommandName) {
9997
- if (fs4.existsSync(executableFile)) return;
9997
+ if (fs5.existsSync(executableFile)) return;
9998
9998
  const executableDirMessage = executableDir ? `searched for local subcommand relative to directory '${executableDir}'` : "no directory for search for local subcommand, use .executableDir() to supply a custom directory";
9999
9999
  const executableMissing = `'${executableFile}' does not exist
10000
10000
  - if '${subcommandName}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
@@ -10012,11 +10012,11 @@ Expecting one of '${allowedValues.join("', '")}'`);
10012
10012
  let launchWithNode = false;
10013
10013
  const sourceExt = [".js", ".ts", ".tsx", ".mjs", ".cjs"];
10014
10014
  function findFile(baseDir, baseName) {
10015
- const localBin = path39.resolve(baseDir, baseName);
10016
- if (fs4.existsSync(localBin)) return localBin;
10017
- if (sourceExt.includes(path39.extname(baseName))) return void 0;
10015
+ const localBin = path40.resolve(baseDir, baseName);
10016
+ if (fs5.existsSync(localBin)) return localBin;
10017
+ if (sourceExt.includes(path40.extname(baseName))) return void 0;
10018
10018
  const foundExt = sourceExt.find(
10019
- (ext2) => fs4.existsSync(`${localBin}${ext2}`)
10019
+ (ext2) => fs5.existsSync(`${localBin}${ext2}`)
10020
10020
  );
10021
10021
  if (foundExt) return `${localBin}${foundExt}`;
10022
10022
  return void 0;
@@ -10028,21 +10028,21 @@ Expecting one of '${allowedValues.join("', '")}'`);
10028
10028
  if (this._scriptPath) {
10029
10029
  let resolvedScriptPath;
10030
10030
  try {
10031
- resolvedScriptPath = fs4.realpathSync(this._scriptPath);
10031
+ resolvedScriptPath = fs5.realpathSync(this._scriptPath);
10032
10032
  } catch {
10033
10033
  resolvedScriptPath = this._scriptPath;
10034
10034
  }
10035
- executableDir = path39.resolve(
10036
- path39.dirname(resolvedScriptPath),
10035
+ executableDir = path40.resolve(
10036
+ path40.dirname(resolvedScriptPath),
10037
10037
  executableDir
10038
10038
  );
10039
10039
  }
10040
10040
  if (executableDir) {
10041
10041
  let localFile = findFile(executableDir, executableFile);
10042
10042
  if (!localFile && !subcommand._executableFile && this._scriptPath) {
10043
- const legacyName = path39.basename(
10043
+ const legacyName = path40.basename(
10044
10044
  this._scriptPath,
10045
- path39.extname(this._scriptPath)
10045
+ path40.extname(this._scriptPath)
10046
10046
  );
10047
10047
  if (legacyName !== this._name) {
10048
10048
  localFile = findFile(
@@ -10053,7 +10053,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
10053
10053
  }
10054
10054
  executableFile = localFile || executableFile;
10055
10055
  }
10056
- launchWithNode = sourceExt.includes(path39.extname(executableFile));
10056
+ launchWithNode = sourceExt.includes(path40.extname(executableFile));
10057
10057
  let proc;
10058
10058
  if (process6.platform !== "win32") {
10059
10059
  if (launchWithNode) {
@@ -10098,14 +10098,14 @@ Expecting one of '${allowedValues.join("', '")}'`);
10098
10098
  );
10099
10099
  }
10100
10100
  });
10101
- proc.on("error", (err40) => {
10102
- if (err40.code === "ENOENT") {
10101
+ proc.on("error", (err41) => {
10102
+ if (err41.code === "ENOENT") {
10103
10103
  this._checkForMissingExecutable(
10104
10104
  executableFile,
10105
10105
  executableDir,
10106
10106
  subcommand._name
10107
10107
  );
10108
- } else if (err40.code === "EACCES") {
10108
+ } else if (err41.code === "EACCES") {
10109
10109
  throw new Error(`'${executableFile}' not executable`);
10110
10110
  }
10111
10111
  if (!exitCallback) {
@@ -10116,7 +10116,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
10116
10116
  "commander.executeSubCommandAsync",
10117
10117
  "(error)"
10118
10118
  );
10119
- wrappedError.nestedError = err40;
10119
+ wrappedError.nestedError = err41;
10120
10120
  exitCallback(wrappedError);
10121
10121
  }
10122
10122
  });
@@ -10968,7 +10968,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
10968
10968
  * @return {Command}
10969
10969
  */
10970
10970
  nameFromFilename(filename) {
10971
- this._name = path39.basename(filename, path39.extname(filename));
10971
+ this._name = path40.basename(filename, path40.extname(filename));
10972
10972
  return this;
10973
10973
  }
10974
10974
  /**
@@ -10982,9 +10982,9 @@ Expecting one of '${allowedValues.join("', '")}'`);
10982
10982
  * @param {string} [path]
10983
10983
  * @return {(string|null|Command)}
10984
10984
  */
10985
- executableDir(path40) {
10986
- if (path40 === void 0) return this._executableDir;
10987
- this._executableDir = path40;
10985
+ executableDir(path41) {
10986
+ if (path41 === void 0) return this._executableDir;
10987
+ this._executableDir = path41;
10988
10988
  return this;
10989
10989
  }
10990
10990
  /**
@@ -12354,15 +12354,15 @@ var require_route = __commonJS({
12354
12354
  };
12355
12355
  }
12356
12356
  function wrapConversion(toModel, graph) {
12357
- const path39 = [graph[toModel].parent, toModel];
12357
+ const path40 = [graph[toModel].parent, toModel];
12358
12358
  let fn = conversions[graph[toModel].parent][toModel];
12359
12359
  let cur = graph[toModel].parent;
12360
12360
  while (graph[cur].parent) {
12361
- path39.unshift(graph[cur].parent);
12361
+ path40.unshift(graph[cur].parent);
12362
12362
  fn = link(conversions[graph[cur].parent][cur], fn);
12363
12363
  cur = graph[cur].parent;
12364
12364
  }
12365
- fn.conversion = path39;
12365
+ fn.conversion = path40;
12366
12366
  return fn;
12367
12367
  }
12368
12368
  module2.exports = function(fromModel) {
@@ -18418,13 +18418,13 @@ var require_lib2 = __commonJS({
18418
18418
  exports2.analyse = analyse;
18419
18419
  var detectFile = (filepath, opts = {}) => new Promise((resolve, reject) => {
18420
18420
  let fd;
18421
- const fs4 = (0, node_1.default)();
18422
- const handler2 = (err40, buffer) => {
18421
+ const fs5 = (0, node_1.default)();
18422
+ const handler2 = (err41, buffer) => {
18423
18423
  if (fd) {
18424
- fs4.closeSync(fd);
18424
+ fs5.closeSync(fd);
18425
18425
  }
18426
- if (err40) {
18427
- reject(err40);
18426
+ if (err41) {
18427
+ reject(err41);
18428
18428
  } else if (buffer) {
18429
18429
  resolve((0, exports2.detect)(buffer));
18430
18430
  } else {
@@ -18433,11 +18433,11 @@ var require_lib2 = __commonJS({
18433
18433
  };
18434
18434
  const sampleSize = (opts === null || opts === void 0 ? void 0 : opts.sampleSize) || 0;
18435
18435
  if (sampleSize > 0) {
18436
- fd = fs4.openSync(filepath, "r");
18436
+ fd = fs5.openSync(filepath, "r");
18437
18437
  let sample = Buffer.allocUnsafe(sampleSize);
18438
- fs4.read(fd, sample, 0, sampleSize, opts.offset, (err40, bytesRead) => {
18439
- if (err40) {
18440
- handler2(err40, null);
18438
+ fs5.read(fd, sample, 0, sampleSize, opts.offset, (err41, bytesRead) => {
18439
+ if (err41) {
18440
+ handler2(err41, null);
18441
18441
  } else {
18442
18442
  if (bytesRead < sampleSize) {
18443
18443
  sample = sample.subarray(0, bytesRead);
@@ -18447,22 +18447,22 @@ var require_lib2 = __commonJS({
18447
18447
  });
18448
18448
  return;
18449
18449
  }
18450
- fs4.readFile(filepath, handler2);
18450
+ fs5.readFile(filepath, handler2);
18451
18451
  });
18452
18452
  exports2.detectFile = detectFile;
18453
18453
  var detectFileSync = (filepath, opts = {}) => {
18454
- const fs4 = (0, node_1.default)();
18454
+ const fs5 = (0, node_1.default)();
18455
18455
  if (opts && opts.sampleSize) {
18456
- const fd = fs4.openSync(filepath, "r");
18456
+ const fd = fs5.openSync(filepath, "r");
18457
18457
  let sample = Buffer.allocUnsafe(opts.sampleSize);
18458
- const bytesRead = fs4.readSync(fd, sample, 0, opts.sampleSize, opts.offset);
18458
+ const bytesRead = fs5.readSync(fd, sample, 0, opts.sampleSize, opts.offset);
18459
18459
  if (bytesRead < opts.sampleSize) {
18460
18460
  sample = sample.subarray(0, bytesRead);
18461
18461
  }
18462
- fs4.closeSync(fd);
18462
+ fs5.closeSync(fd);
18463
18463
  return (0, exports2.detect)(sample);
18464
18464
  }
18465
- return (0, exports2.detect)(fs4.readFileSync(filepath));
18465
+ return (0, exports2.detect)(fs5.readFileSync(filepath));
18466
18466
  };
18467
18467
  exports2.detectFileSync = detectFileSync;
18468
18468
  exports2.default = {
@@ -22328,7 +22328,7 @@ var require_path = __commonJS({
22328
22328
  Object.defineProperty(exports2, "__esModule", { value: true });
22329
22329
  exports2.convertPosixPathToPattern = exports2.convertWindowsPathToPattern = exports2.convertPathToPattern = exports2.escapePosixPath = exports2.escapeWindowsPath = exports2.escape = exports2.removeLeadingDotSegment = exports2.makeAbsolute = exports2.unixify = void 0;
22330
22330
  var os4 = require("os");
22331
- var path39 = require("path");
22331
+ var path40 = require("path");
22332
22332
  var IS_WINDOWS_PLATFORM = os4.platform() === "win32";
22333
22333
  var LEADING_DOT_SEGMENT_CHARACTERS_COUNT = 2;
22334
22334
  var POSIX_UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()*?[\]{|}]|^!|[!+@](?=\()|\\(?![!()*+?@[\]{|}]))/g;
@@ -22340,7 +22340,7 @@ var require_path = __commonJS({
22340
22340
  }
22341
22341
  exports2.unixify = unixify;
22342
22342
  function makeAbsolute(cwd, filepath) {
22343
- return path39.resolve(cwd, filepath);
22343
+ return path40.resolve(cwd, filepath);
22344
22344
  }
22345
22345
  exports2.makeAbsolute = makeAbsolute;
22346
22346
  function removeLeadingDotSegment(entry) {
@@ -23637,7 +23637,7 @@ var require_braces = __commonJS({
23637
23637
  var require_constants2 = __commonJS({
23638
23638
  "../../node_modules/.pnpm/picomatch@2.3.2/node_modules/picomatch/lib/constants.js"(exports2, module2) {
23639
23639
  "use strict";
23640
- var path39 = require("path");
23640
+ var path40 = require("path");
23641
23641
  var WIN_SLASH = "\\\\/";
23642
23642
  var WIN_NO_SLASH = `[^${WIN_SLASH}]`;
23643
23643
  var DEFAULT_MAX_EXTGLOB_RECURSION = 0;
@@ -23811,7 +23811,7 @@ var require_constants2 = __commonJS({
23811
23811
  /* | */
23812
23812
  CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279,
23813
23813
  /* \uFEFF */
23814
- SEP: path39.sep,
23814
+ SEP: path40.sep,
23815
23815
  /**
23816
23816
  * Create EXTGLOB_CHARS
23817
23817
  */
@@ -23838,7 +23838,7 @@ var require_constants2 = __commonJS({
23838
23838
  var require_utils3 = __commonJS({
23839
23839
  "../../node_modules/.pnpm/picomatch@2.3.2/node_modules/picomatch/lib/utils.js"(exports2) {
23840
23840
  "use strict";
23841
- var path39 = require("path");
23841
+ var path40 = require("path");
23842
23842
  var win32 = process.platform === "win32";
23843
23843
  var {
23844
23844
  REGEX_BACKSLASH,
@@ -23867,7 +23867,7 @@ var require_utils3 = __commonJS({
23867
23867
  if (options2 && typeof options2.windows === "boolean") {
23868
23868
  return options2.windows;
23869
23869
  }
23870
- return win32 === true || path39.sep === "\\";
23870
+ return win32 === true || path40.sep === "\\";
23871
23871
  };
23872
23872
  exports2.escapeLast = (input, char, lastIdx) => {
23873
23873
  const idx = input.lastIndexOf(char, lastIdx);
@@ -25231,7 +25231,7 @@ var require_parse2 = __commonJS({
25231
25231
  var require_picomatch = __commonJS({
25232
25232
  "../../node_modules/.pnpm/picomatch@2.3.2/node_modules/picomatch/lib/picomatch.js"(exports2, module2) {
25233
25233
  "use strict";
25234
- var path39 = require("path");
25234
+ var path40 = require("path");
25235
25235
  var scan = require_scan();
25236
25236
  var parse6 = require_parse2();
25237
25237
  var utils = require_utils3();
@@ -25316,7 +25316,7 @@ var require_picomatch = __commonJS({
25316
25316
  };
25317
25317
  picomatch.matchBase = (input, glob, options2, posix = utils.isWindows(options2)) => {
25318
25318
  const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options2);
25319
- return regex.test(path39.basename(input));
25319
+ return regex.test(path40.basename(input));
25320
25320
  };
25321
25321
  picomatch.isMatch = (str3, patterns, options2) => picomatch(patterns, options2)(str3);
25322
25322
  picomatch.parse = (pattern, options2) => {
@@ -25358,8 +25358,8 @@ var require_picomatch = __commonJS({
25358
25358
  try {
25359
25359
  const opts = options2 || {};
25360
25360
  return new RegExp(source, opts.flags || (opts.nocase ? "i" : ""));
25361
- } catch (err40) {
25362
- if (options2 && options2.debug === true) throw err40;
25361
+ } catch (err41) {
25362
+ if (options2 && options2.debug === true) throw err41;
25363
25363
  return /$^/;
25364
25364
  }
25365
25365
  };
@@ -25543,7 +25543,7 @@ var require_pattern = __commonJS({
25543
25543
  "use strict";
25544
25544
  Object.defineProperty(exports2, "__esModule", { value: true });
25545
25545
  exports2.isAbsolute = exports2.partitionAbsoluteAndRelative = exports2.removeDuplicateSlashes = exports2.matchAny = exports2.convertPatternsToRe = exports2.makeRe = exports2.getPatternParts = exports2.expandBraceExpansion = exports2.expandPatternsWithBraceExpansion = exports2.isAffectDepthOfReadingPattern = exports2.endsWithSlashGlobStar = exports2.hasGlobStar = exports2.getBaseDirectory = exports2.isPatternRelatedToParentDirectory = exports2.getPatternsOutsideCurrentDirectory = exports2.getPatternsInsideCurrentDirectory = exports2.getPositivePatterns = exports2.getNegativePatterns = exports2.isPositivePattern = exports2.isNegativePattern = exports2.convertToNegativePattern = exports2.convertToPositivePattern = exports2.isDynamicPattern = exports2.isStaticPattern = void 0;
25546
- var path39 = require("path");
25546
+ var path40 = require("path");
25547
25547
  var globParent = require_glob_parent();
25548
25548
  var micromatch = require_micromatch();
25549
25549
  var GLOBSTAR2 = "**";
@@ -25638,7 +25638,7 @@ var require_pattern = __commonJS({
25638
25638
  }
25639
25639
  exports2.endsWithSlashGlobStar = endsWithSlashGlobStar;
25640
25640
  function isAffectDepthOfReadingPattern(pattern) {
25641
- const basename = path39.basename(pattern);
25641
+ const basename = path40.basename(pattern);
25642
25642
  return endsWithSlashGlobStar(pattern) || isStaticPattern(basename);
25643
25643
  }
25644
25644
  exports2.isAffectDepthOfReadingPattern = isAffectDepthOfReadingPattern;
@@ -25696,7 +25696,7 @@ var require_pattern = __commonJS({
25696
25696
  }
25697
25697
  exports2.partitionAbsoluteAndRelative = partitionAbsoluteAndRelative;
25698
25698
  function isAbsolute(pattern) {
25699
- return path39.isAbsolute(pattern);
25699
+ return path40.isAbsolute(pattern);
25700
25700
  }
25701
25701
  exports2.isAbsolute = isAbsolute;
25702
25702
  }
@@ -25766,8 +25766,8 @@ var require_merge2 = __commonJS({
25766
25766
  }
25767
25767
  next();
25768
25768
  }
25769
- function onerror(err40) {
25770
- mergedStream.emit("error", err40);
25769
+ function onerror(err41) {
25770
+ mergedStream.emit("error", err41);
25771
25771
  }
25772
25772
  if (stream._readableState.endEmitted) {
25773
25773
  return next();
@@ -25871,10 +25871,10 @@ var require_utils4 = __commonJS({
25871
25871
  exports2.array = array2;
25872
25872
  var errno = require_errno();
25873
25873
  exports2.errno = errno;
25874
- var fs4 = require_fs();
25875
- exports2.fs = fs4;
25876
- var path39 = require_path();
25877
- exports2.path = path39;
25874
+ var fs5 = require_fs();
25875
+ exports2.fs = fs5;
25876
+ var path40 = require_path();
25877
+ exports2.path = path40;
25878
25878
  var pattern = require_pattern();
25879
25879
  exports2.pattern = pattern;
25880
25880
  var stream = require_stream();
@@ -25986,8 +25986,8 @@ var require_async = __commonJS({
25986
25986
  "use strict";
25987
25987
  Object.defineProperty(exports2, "__esModule", { value: true });
25988
25988
  exports2.read = void 0;
25989
- function read(path39, settings, callback) {
25990
- settings.fs.lstat(path39, (lstatError, lstat) => {
25989
+ function read(path40, settings, callback) {
25990
+ settings.fs.lstat(path40, (lstatError, lstat) => {
25991
25991
  if (lstatError !== null) {
25992
25992
  callFailureCallback(callback, lstatError);
25993
25993
  return;
@@ -25996,7 +25996,7 @@ var require_async = __commonJS({
25996
25996
  callSuccessCallback(callback, lstat);
25997
25997
  return;
25998
25998
  }
25999
- settings.fs.stat(path39, (statError, stat3) => {
25999
+ settings.fs.stat(path40, (statError, stat3) => {
26000
26000
  if (statError !== null) {
26001
26001
  if (settings.throwErrorOnBrokenSymbolicLink) {
26002
26002
  callFailureCallback(callback, statError);
@@ -26028,13 +26028,13 @@ var require_sync = __commonJS({
26028
26028
  "use strict";
26029
26029
  Object.defineProperty(exports2, "__esModule", { value: true });
26030
26030
  exports2.read = void 0;
26031
- function read(path39, settings) {
26032
- const lstat = settings.fs.lstatSync(path39);
26031
+ function read(path40, settings) {
26032
+ const lstat = settings.fs.lstatSync(path40);
26033
26033
  if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) {
26034
26034
  return lstat;
26035
26035
  }
26036
26036
  try {
26037
- const stat3 = settings.fs.statSync(path39);
26037
+ const stat3 = settings.fs.statSync(path40);
26038
26038
  if (settings.markSymbolicLink) {
26039
26039
  stat3.isSymbolicLink = () => true;
26040
26040
  }
@@ -26056,12 +26056,12 @@ var require_fs2 = __commonJS({
26056
26056
  "use strict";
26057
26057
  Object.defineProperty(exports2, "__esModule", { value: true });
26058
26058
  exports2.createFileSystemAdapter = exports2.FILE_SYSTEM_ADAPTER = void 0;
26059
- var fs4 = require("fs");
26059
+ var fs5 = require("fs");
26060
26060
  exports2.FILE_SYSTEM_ADAPTER = {
26061
- lstat: fs4.lstat,
26062
- stat: fs4.stat,
26063
- lstatSync: fs4.lstatSync,
26064
- statSync: fs4.statSync
26061
+ lstat: fs5.lstat,
26062
+ stat: fs5.stat,
26063
+ lstatSync: fs5.lstatSync,
26064
+ statSync: fs5.statSync
26065
26065
  };
26066
26066
  function createFileSystemAdapter(fsMethods) {
26067
26067
  if (fsMethods === void 0) {
@@ -26078,12 +26078,12 @@ var require_settings = __commonJS({
26078
26078
  "../../node_modules/.pnpm/@nodelib+fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/settings.js"(exports2) {
26079
26079
  "use strict";
26080
26080
  Object.defineProperty(exports2, "__esModule", { value: true });
26081
- var fs4 = require_fs2();
26081
+ var fs5 = require_fs2();
26082
26082
  var Settings = class {
26083
26083
  constructor(_options = {}) {
26084
26084
  this._options = _options;
26085
26085
  this.followSymbolicLink = this._getValue(this._options.followSymbolicLink, true);
26086
- this.fs = fs4.createFileSystemAdapter(this._options.fs);
26086
+ this.fs = fs5.createFileSystemAdapter(this._options.fs);
26087
26087
  this.markSymbolicLink = this._getValue(this._options.markSymbolicLink, false);
26088
26088
  this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true);
26089
26089
  }
@@ -26105,17 +26105,17 @@ var require_out = __commonJS({
26105
26105
  var sync = require_sync();
26106
26106
  var settings_1 = require_settings();
26107
26107
  exports2.Settings = settings_1.default;
26108
- function stat3(path39, optionsOrSettingsOrCallback, callback) {
26108
+ function stat3(path40, optionsOrSettingsOrCallback, callback) {
26109
26109
  if (typeof optionsOrSettingsOrCallback === "function") {
26110
- async.read(path39, getSettings(), optionsOrSettingsOrCallback);
26110
+ async.read(path40, getSettings(), optionsOrSettingsOrCallback);
26111
26111
  return;
26112
26112
  }
26113
- async.read(path39, getSettings(optionsOrSettingsOrCallback), callback);
26113
+ async.read(path40, getSettings(optionsOrSettingsOrCallback), callback);
26114
26114
  }
26115
26115
  exports2.stat = stat3;
26116
- function statSync2(path39, optionsOrSettings) {
26116
+ function statSync2(path40, optionsOrSettings) {
26117
26117
  const settings = getSettings(optionsOrSettings);
26118
- return sync.read(path39, settings);
26118
+ return sync.read(path40, settings);
26119
26119
  }
26120
26120
  exports2.statSync = statSync2;
26121
26121
  function getSettings(settingsOrOptions = {}) {
@@ -26131,8 +26131,8 @@ var require_out = __commonJS({
26131
26131
  var require_queue_microtask = __commonJS({
26132
26132
  "../../node_modules/.pnpm/queue-microtask@1.2.3/node_modules/queue-microtask/index.js"(exports2, module2) {
26133
26133
  var promise2;
26134
- module2.exports = typeof queueMicrotask === "function" ? queueMicrotask.bind(typeof window !== "undefined" ? window : global) : (cb2) => (promise2 || (promise2 = Promise.resolve())).then(cb2).catch((err40) => setTimeout(() => {
26135
- throw err40;
26134
+ module2.exports = typeof queueMicrotask === "function" ? queueMicrotask.bind(typeof window !== "undefined" ? window : global) : (cb2) => (promise2 || (promise2 = Promise.resolve())).then(cb2).catch((err41) => setTimeout(() => {
26135
+ throw err41;
26136
26136
  }, 0));
26137
26137
  }
26138
26138
  });
@@ -26153,32 +26153,32 @@ var require_run_parallel = __commonJS({
26153
26153
  results = {};
26154
26154
  pending = keys.length;
26155
26155
  }
26156
- function done(err40) {
26156
+ function done(err41) {
26157
26157
  function end() {
26158
- if (cb2) cb2(err40, results);
26158
+ if (cb2) cb2(err41, results);
26159
26159
  cb2 = null;
26160
26160
  }
26161
26161
  if (isSync) queueMicrotask2(end);
26162
26162
  else end();
26163
26163
  }
26164
- function each(i3, err40, result) {
26164
+ function each(i3, err41, result) {
26165
26165
  results[i3] = result;
26166
- if (--pending === 0 || err40) {
26167
- done(err40);
26166
+ if (--pending === 0 || err41) {
26167
+ done(err41);
26168
26168
  }
26169
26169
  }
26170
26170
  if (!pending) {
26171
26171
  done(null);
26172
26172
  } else if (keys) {
26173
26173
  keys.forEach(function(key) {
26174
- tasks[key](function(err40, result) {
26175
- each(key, err40, result);
26174
+ tasks[key](function(err41, result) {
26175
+ each(key, err41, result);
26176
26176
  });
26177
26177
  });
26178
26178
  } else {
26179
26179
  tasks.forEach(function(task, i3) {
26180
- task(function(err40, result) {
26181
- each(i3, err40, result);
26180
+ task(function(err41, result) {
26181
+ each(i3, err41, result);
26182
26182
  });
26183
26183
  });
26184
26184
  }
@@ -26238,8 +26238,8 @@ var require_utils5 = __commonJS({
26238
26238
  "use strict";
26239
26239
  Object.defineProperty(exports2, "__esModule", { value: true });
26240
26240
  exports2.fs = void 0;
26241
- var fs4 = require_fs3();
26242
- exports2.fs = fs4;
26241
+ var fs5 = require_fs3();
26242
+ exports2.fs = fs5;
26243
26243
  }
26244
26244
  });
26245
26245
 
@@ -26331,16 +26331,16 @@ var require_async2 = __commonJS({
26331
26331
  return;
26332
26332
  }
26333
26333
  const tasks = names.map((name) => {
26334
- const path39 = common3.joinPathSegments(directory, name, settings.pathSegmentSeparator);
26334
+ const path40 = common3.joinPathSegments(directory, name, settings.pathSegmentSeparator);
26335
26335
  return (done) => {
26336
- fsStat.stat(path39, settings.fsStatSettings, (error48, stats) => {
26336
+ fsStat.stat(path40, settings.fsStatSettings, (error48, stats) => {
26337
26337
  if (error48 !== null) {
26338
26338
  done(error48);
26339
26339
  return;
26340
26340
  }
26341
26341
  const entry = {
26342
26342
  name,
26343
- path: path39,
26343
+ path: path40,
26344
26344
  dirent: utils.fs.createDirentFromStats(name, stats)
26345
26345
  };
26346
26346
  if (settings.stats) {
@@ -26434,14 +26434,14 @@ var require_fs4 = __commonJS({
26434
26434
  "use strict";
26435
26435
  Object.defineProperty(exports2, "__esModule", { value: true });
26436
26436
  exports2.createFileSystemAdapter = exports2.FILE_SYSTEM_ADAPTER = void 0;
26437
- var fs4 = require("fs");
26437
+ var fs5 = require("fs");
26438
26438
  exports2.FILE_SYSTEM_ADAPTER = {
26439
- lstat: fs4.lstat,
26440
- stat: fs4.stat,
26441
- lstatSync: fs4.lstatSync,
26442
- statSync: fs4.statSync,
26443
- readdir: fs4.readdir,
26444
- readdirSync: fs4.readdirSync
26439
+ lstat: fs5.lstat,
26440
+ stat: fs5.stat,
26441
+ lstatSync: fs5.lstatSync,
26442
+ statSync: fs5.statSync,
26443
+ readdir: fs5.readdir,
26444
+ readdirSync: fs5.readdirSync
26445
26445
  };
26446
26446
  function createFileSystemAdapter(fsMethods) {
26447
26447
  if (fsMethods === void 0) {
@@ -26458,15 +26458,15 @@ var require_settings2 = __commonJS({
26458
26458
  "../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/settings.js"(exports2) {
26459
26459
  "use strict";
26460
26460
  Object.defineProperty(exports2, "__esModule", { value: true });
26461
- var path39 = require("path");
26461
+ var path40 = require("path");
26462
26462
  var fsStat = require_out();
26463
- var fs4 = require_fs4();
26463
+ var fs5 = require_fs4();
26464
26464
  var Settings = class {
26465
26465
  constructor(_options = {}) {
26466
26466
  this._options = _options;
26467
26467
  this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, false);
26468
- this.fs = fs4.createFileSystemAdapter(this._options.fs);
26469
- this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path39.sep);
26468
+ this.fs = fs5.createFileSystemAdapter(this._options.fs);
26469
+ this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path40.sep);
26470
26470
  this.stats = this._getValue(this._options.stats, false);
26471
26471
  this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true);
26472
26472
  this.fsStatSettings = new fsStat.Settings({
@@ -26493,17 +26493,17 @@ var require_out2 = __commonJS({
26493
26493
  var sync = require_sync2();
26494
26494
  var settings_1 = require_settings2();
26495
26495
  exports2.Settings = settings_1.default;
26496
- function scandir(path39, optionsOrSettingsOrCallback, callback) {
26496
+ function scandir(path40, optionsOrSettingsOrCallback, callback) {
26497
26497
  if (typeof optionsOrSettingsOrCallback === "function") {
26498
- async.read(path39, getSettings(), optionsOrSettingsOrCallback);
26498
+ async.read(path40, getSettings(), optionsOrSettingsOrCallback);
26499
26499
  return;
26500
26500
  }
26501
- async.read(path39, getSettings(optionsOrSettingsOrCallback), callback);
26501
+ async.read(path40, getSettings(optionsOrSettingsOrCallback), callback);
26502
26502
  }
26503
26503
  exports2.scandir = scandir;
26504
- function scandirSync(path39, optionsOrSettings) {
26504
+ function scandirSync(path40, optionsOrSettings) {
26505
26505
  const settings = getSettings(optionsOrSettings);
26506
- return sync.read(path39, settings);
26506
+ return sync.read(path40, settings);
26507
26507
  }
26508
26508
  exports2.scandirSync = scandirSync;
26509
26509
  function getSettings(settingsOrOptions = {}) {
@@ -26750,16 +26750,16 @@ var require_queue = __commonJS({
26750
26750
  this.context = null;
26751
26751
  this.errorHandler = null;
26752
26752
  var self2 = this;
26753
- this.worked = function worked(err40, result) {
26753
+ this.worked = function worked(err41, result) {
26754
26754
  var callback = self2.callback;
26755
26755
  var errorHandler = self2.errorHandler;
26756
26756
  var val = self2.value;
26757
26757
  self2.value = null;
26758
26758
  self2.callback = noop3;
26759
26759
  if (self2.errorHandler) {
26760
- errorHandler(err40, val);
26760
+ errorHandler(err41, val);
26761
26761
  }
26762
- callback.call(self2.context, err40, result);
26762
+ callback.call(self2.context, err41, result);
26763
26763
  self2.release(self2);
26764
26764
  };
26765
26765
  }
@@ -26783,9 +26783,9 @@ var require_queue = __commonJS({
26783
26783
  return queue;
26784
26784
  function push(value) {
26785
26785
  var p = new Promise(function(resolve, reject) {
26786
- pushCb(value, function(err40, result) {
26787
- if (err40) {
26788
- reject(err40);
26786
+ pushCb(value, function(err41, result) {
26787
+ if (err41) {
26788
+ reject(err41);
26789
26789
  return;
26790
26790
  }
26791
26791
  resolve(result);
@@ -26796,9 +26796,9 @@ var require_queue = __commonJS({
26796
26796
  }
26797
26797
  function unshift(value) {
26798
26798
  var p = new Promise(function(resolve, reject) {
26799
- unshiftCb(value, function(err40, result) {
26800
- if (err40) {
26801
- reject(err40);
26799
+ unshiftCb(value, function(err41, result) {
26800
+ if (err41) {
26801
+ reject(err41);
26802
26802
  return;
26803
26803
  }
26804
26804
  resolve(result);
@@ -27150,7 +27150,7 @@ var require_settings3 = __commonJS({
27150
27150
  "../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/settings.js"(exports2) {
27151
27151
  "use strict";
27152
27152
  Object.defineProperty(exports2, "__esModule", { value: true });
27153
- var path39 = require("path");
27153
+ var path40 = require("path");
27154
27154
  var fsScandir = require_out2();
27155
27155
  var Settings = class {
27156
27156
  constructor(_options = {}) {
@@ -27160,7 +27160,7 @@ var require_settings3 = __commonJS({
27160
27160
  this.deepFilter = this._getValue(this._options.deepFilter, null);
27161
27161
  this.entryFilter = this._getValue(this._options.entryFilter, null);
27162
27162
  this.errorFilter = this._getValue(this._options.errorFilter, null);
27163
- this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path39.sep);
27163
+ this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path40.sep);
27164
27164
  this.fsScandirSettings = new fsScandir.Settings({
27165
27165
  followSymbolicLinks: this._options.followSymbolicLinks,
27166
27166
  fs: this._options.fs,
@@ -27222,7 +27222,7 @@ var require_reader2 = __commonJS({
27222
27222
  "../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/readers/reader.js"(exports2) {
27223
27223
  "use strict";
27224
27224
  Object.defineProperty(exports2, "__esModule", { value: true });
27225
- var path39 = require("path");
27225
+ var path40 = require("path");
27226
27226
  var fsStat = require_out();
27227
27227
  var utils = require_utils4();
27228
27228
  var Reader = class {
@@ -27235,7 +27235,7 @@ var require_reader2 = __commonJS({
27235
27235
  });
27236
27236
  }
27237
27237
  _getFullEntryPath(filepath) {
27238
- return path39.resolve(this._settings.cwd, filepath);
27238
+ return path40.resolve(this._settings.cwd, filepath);
27239
27239
  }
27240
27240
  _makeEntry(stats, pattern) {
27241
27241
  const entry = {
@@ -27651,7 +27651,7 @@ var require_provider = __commonJS({
27651
27651
  "../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/providers/provider.js"(exports2) {
27652
27652
  "use strict";
27653
27653
  Object.defineProperty(exports2, "__esModule", { value: true });
27654
- var path39 = require("path");
27654
+ var path40 = require("path");
27655
27655
  var deep_1 = require_deep();
27656
27656
  var entry_1 = require_entry();
27657
27657
  var error_1 = require_error2();
@@ -27665,7 +27665,7 @@ var require_provider = __commonJS({
27665
27665
  this.entryTransformer = new entry_2.default(this._settings);
27666
27666
  }
27667
27667
  _getRootDirectory(task) {
27668
- return path39.resolve(this._settings.cwd, task.base);
27668
+ return path40.resolve(this._settings.cwd, task.base);
27669
27669
  }
27670
27670
  _getReaderOptions(task) {
27671
27671
  const basePath = task.base === "." ? "" : task.base;
@@ -27846,16 +27846,16 @@ var require_settings4 = __commonJS({
27846
27846
  "use strict";
27847
27847
  Object.defineProperty(exports2, "__esModule", { value: true });
27848
27848
  exports2.DEFAULT_FILE_SYSTEM_ADAPTER = void 0;
27849
- var fs4 = require("fs");
27849
+ var fs5 = require("fs");
27850
27850
  var os4 = require("os");
27851
27851
  var CPU_COUNT = Math.max(os4.cpus().length, 1);
27852
27852
  exports2.DEFAULT_FILE_SYSTEM_ADAPTER = {
27853
- lstat: fs4.lstat,
27854
- lstatSync: fs4.lstatSync,
27855
- stat: fs4.stat,
27856
- statSync: fs4.statSync,
27857
- readdir: fs4.readdir,
27858
- readdirSync: fs4.readdirSync
27853
+ lstat: fs5.lstat,
27854
+ lstatSync: fs5.lstatSync,
27855
+ stat: fs5.stat,
27856
+ statSync: fs5.statSync,
27857
+ readdir: fs5.readdir,
27858
+ readdirSync: fs5.readdirSync
27859
27859
  };
27860
27860
  var Settings = class {
27861
27861
  constructor(_options = {}) {
@@ -28106,8 +28106,8 @@ var require_kind_of = __commonJS({
28106
28106
  if (typeof val.length === "number" && typeof val.callee === "function") {
28107
28107
  return true;
28108
28108
  }
28109
- } catch (err40) {
28110
- if (err40.message.indexOf("callee") !== -1) {
28109
+ } catch (err41) {
28110
+ if (err41.message.indexOf("callee") !== -1) {
28111
28111
  return true;
28112
28112
  }
28113
28113
  }
@@ -29330,7 +29330,7 @@ var require_function = __commonJS({
29330
29330
  return false;
29331
29331
  }
29332
29332
  return true;
29333
- } catch (err40) {
29333
+ } catch (err41) {
29334
29334
  return false;
29335
29335
  }
29336
29336
  }
@@ -31117,11 +31117,11 @@ var require_engines = __commonJS({
31117
31117
  str = "(function() {\nreturn " + str.trim() + ";\n}());";
31118
31118
  }
31119
31119
  return eval(str) || {};
31120
- } catch (err40) {
31121
- if (wrap !== false && /(unexpected|identifier)/i.test(err40.message)) {
31120
+ } catch (err41) {
31121
+ if (wrap !== false && /(unexpected|identifier)/i.test(err41.message)) {
31122
31122
  return parse(str, options, false);
31123
31123
  }
31124
- throw new SyntaxError(err40);
31124
+ throw new SyntaxError(err41);
31125
31125
  }
31126
31126
  },
31127
31127
  stringify: function() {
@@ -31372,7 +31372,7 @@ var require_parse3 = __commonJS({
31372
31372
  var require_gray_matter = __commonJS({
31373
31373
  "../../node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/index.js"(exports2, module2) {
31374
31374
  "use strict";
31375
- var fs4 = require("fs");
31375
+ var fs5 = require("fs");
31376
31376
  var sections = require_section_matter();
31377
31377
  var defaults2 = require_defaults();
31378
31378
  var stringify2 = require_stringify3();
@@ -31456,7 +31456,7 @@ var require_gray_matter = __commonJS({
31456
31456
  return stringify2(file2, data, options2);
31457
31457
  };
31458
31458
  matter2.read = function(filepath, options2) {
31459
- const str3 = fs4.readFileSync(filepath, "utf8");
31459
+ const str3 = fs5.readFileSync(filepath, "utf8");
31460
31460
  const file2 = matter2(str3, options2);
31461
31461
  file2.path = filepath;
31462
31462
  return file2;
@@ -31651,8 +31651,8 @@ var require_package = __commonJS({
31651
31651
  // ../../node_modules/.pnpm/dotenv@16.6.1/node_modules/dotenv/lib/main.js
31652
31652
  var require_main = __commonJS({
31653
31653
  "../../node_modules/.pnpm/dotenv@16.6.1/node_modules/dotenv/lib/main.js"(exports2, module2) {
31654
- var fs4 = require("fs");
31655
- var path39 = require("path");
31654
+ var fs5 = require("fs");
31655
+ var path40 = require("path");
31656
31656
  var os4 = require("os");
31657
31657
  var crypto2 = require("crypto");
31658
31658
  var packageJson = require_package();
@@ -31683,9 +31683,9 @@ var require_main = __commonJS({
31683
31683
  options2.path = vaultPath;
31684
31684
  const result = DotenvModule.configDotenv(options2);
31685
31685
  if (!result.parsed) {
31686
- const err40 = new Error(`MISSING_DATA: Cannot parse ${vaultPath} for an unknown reason`);
31687
- err40.code = "MISSING_DATA";
31688
- throw err40;
31686
+ const err41 = new Error(`MISSING_DATA: Cannot parse ${vaultPath} for an unknown reason`);
31687
+ err41.code = "MISSING_DATA";
31688
+ throw err41;
31689
31689
  }
31690
31690
  const keys = _dotenvKey(options2).split(",");
31691
31691
  const length = keys.length;
@@ -31728,30 +31728,30 @@ var require_main = __commonJS({
31728
31728
  uri = new URL(dotenvKey);
31729
31729
  } catch (error48) {
31730
31730
  if (error48.code === "ERR_INVALID_URL") {
31731
- const err40 = new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");
31732
- err40.code = "INVALID_DOTENV_KEY";
31733
- throw err40;
31731
+ const err41 = new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");
31732
+ err41.code = "INVALID_DOTENV_KEY";
31733
+ throw err41;
31734
31734
  }
31735
31735
  throw error48;
31736
31736
  }
31737
31737
  const key = uri.password;
31738
31738
  if (!key) {
31739
- const err40 = new Error("INVALID_DOTENV_KEY: Missing key part");
31740
- err40.code = "INVALID_DOTENV_KEY";
31741
- throw err40;
31739
+ const err41 = new Error("INVALID_DOTENV_KEY: Missing key part");
31740
+ err41.code = "INVALID_DOTENV_KEY";
31741
+ throw err41;
31742
31742
  }
31743
31743
  const environment = uri.searchParams.get("environment");
31744
31744
  if (!environment) {
31745
- const err40 = new Error("INVALID_DOTENV_KEY: Missing environment part");
31746
- err40.code = "INVALID_DOTENV_KEY";
31747
- throw err40;
31745
+ const err41 = new Error("INVALID_DOTENV_KEY: Missing environment part");
31746
+ err41.code = "INVALID_DOTENV_KEY";
31747
+ throw err41;
31748
31748
  }
31749
31749
  const environmentKey = `DOTENV_VAULT_${environment.toUpperCase()}`;
31750
31750
  const ciphertext = result.parsed[environmentKey];
31751
31751
  if (!ciphertext) {
31752
- const err40 = new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${environmentKey} in your .env.vault file.`);
31753
- err40.code = "NOT_FOUND_DOTENV_ENVIRONMENT";
31754
- throw err40;
31752
+ const err41 = new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${environmentKey} in your .env.vault file.`);
31753
+ err41.code = "NOT_FOUND_DOTENV_ENVIRONMENT";
31754
+ throw err41;
31755
31755
  }
31756
31756
  return { ciphertext, key };
31757
31757
  }
@@ -31760,7 +31760,7 @@ var require_main = __commonJS({
31760
31760
  if (options2 && options2.path && options2.path.length > 0) {
31761
31761
  if (Array.isArray(options2.path)) {
31762
31762
  for (const filepath of options2.path) {
31763
- if (fs4.existsSync(filepath)) {
31763
+ if (fs5.existsSync(filepath)) {
31764
31764
  possibleVaultPath = filepath.endsWith(".vault") ? filepath : `${filepath}.vault`;
31765
31765
  }
31766
31766
  }
@@ -31768,15 +31768,15 @@ var require_main = __commonJS({
31768
31768
  possibleVaultPath = options2.path.endsWith(".vault") ? options2.path : `${options2.path}.vault`;
31769
31769
  }
31770
31770
  } else {
31771
- possibleVaultPath = path39.resolve(process.cwd(), ".env.vault");
31771
+ possibleVaultPath = path40.resolve(process.cwd(), ".env.vault");
31772
31772
  }
31773
- if (fs4.existsSync(possibleVaultPath)) {
31773
+ if (fs5.existsSync(possibleVaultPath)) {
31774
31774
  return possibleVaultPath;
31775
31775
  }
31776
31776
  return null;
31777
31777
  }
31778
31778
  function _resolveHome(envPath) {
31779
- return envPath[0] === "~" ? path39.join(os4.homedir(), envPath.slice(1)) : envPath;
31779
+ return envPath[0] === "~" ? path40.join(os4.homedir(), envPath.slice(1)) : envPath;
31780
31780
  }
31781
31781
  function _configVault(options2) {
31782
31782
  const debug = Boolean(options2 && options2.debug);
@@ -31793,7 +31793,7 @@ var require_main = __commonJS({
31793
31793
  return { parsed };
31794
31794
  }
31795
31795
  function configDotenv(options2) {
31796
- const dotenvPath = path39.resolve(process.cwd(), ".env");
31796
+ const dotenvPath = path40.resolve(process.cwd(), ".env");
31797
31797
  let encoding = "utf8";
31798
31798
  const debug = Boolean(options2 && options2.debug);
31799
31799
  const quiet = options2 && "quiet" in options2 ? options2.quiet : true;
@@ -31817,13 +31817,13 @@ var require_main = __commonJS({
31817
31817
  }
31818
31818
  let lastError;
31819
31819
  const parsedAll = {};
31820
- for (const path40 of optionPaths) {
31820
+ for (const path41 of optionPaths) {
31821
31821
  try {
31822
- const parsed = DotenvModule.parse(fs4.readFileSync(path40, { encoding }));
31822
+ const parsed = DotenvModule.parse(fs5.readFileSync(path41, { encoding }));
31823
31823
  DotenvModule.populate(parsedAll, parsed, options2);
31824
31824
  } catch (e3) {
31825
31825
  if (debug) {
31826
- _debug(`Failed to load ${path40} ${e3.message}`);
31826
+ _debug(`Failed to load ${path41} ${e3.message}`);
31827
31827
  }
31828
31828
  lastError = e3;
31829
31829
  }
@@ -31838,7 +31838,7 @@ var require_main = __commonJS({
31838
31838
  const shortPaths = [];
31839
31839
  for (const filePath of optionPaths) {
31840
31840
  try {
31841
- const relative = path39.relative(process.cwd(), filePath);
31841
+ const relative = path40.relative(process.cwd(), filePath);
31842
31842
  shortPaths.push(relative);
31843
31843
  } catch (e3) {
31844
31844
  if (debug) {
@@ -31881,13 +31881,13 @@ var require_main = __commonJS({
31881
31881
  const invalidKeyLength = error48.message === "Invalid key length";
31882
31882
  const decryptionFailed = error48.message === "Unsupported state or unable to authenticate data";
31883
31883
  if (isRange || invalidKeyLength) {
31884
- const err40 = new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");
31885
- err40.code = "INVALID_DOTENV_KEY";
31886
- throw err40;
31884
+ const err41 = new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");
31885
+ err41.code = "INVALID_DOTENV_KEY";
31886
+ throw err41;
31887
31887
  } else if (decryptionFailed) {
31888
- const err40 = new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");
31889
- err40.code = "DECRYPTION_FAILED";
31890
- throw err40;
31888
+ const err41 = new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");
31889
+ err41.code = "DECRYPTION_FAILED";
31890
+ throw err41;
31891
31891
  } else {
31892
31892
  throw error48;
31893
31893
  }
@@ -31897,9 +31897,9 @@ var require_main = __commonJS({
31897
31897
  const debug = Boolean(options2 && options2.debug);
31898
31898
  const override = Boolean(options2 && options2.override);
31899
31899
  if (typeof parsed !== "object") {
31900
- const err40 = new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");
31901
- err40.code = "OBJECT_REQUIRED";
31902
- throw err40;
31900
+ const err41 = new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");
31901
+ err41.code = "OBJECT_REQUIRED";
31902
+ throw err41;
31903
31903
  }
31904
31904
  for (const key of Object.keys(parsed)) {
31905
31905
  if (Object.prototype.hasOwnProperty.call(processEnv, key)) {
@@ -31967,6 +31967,8 @@ agents:
31967
31967
  viewUiServer: true
31968
31968
  # Save per-finding screenshots to the run output directory.
31969
31969
  findingScreenshots: true
31970
+ # Allow the agent to read the simulator pasteboard via the read_pasteboard tool. Off by default \u2014 pasteboard contents (including any secrets copied during the run) are sent to the model provider verbatim.
31971
+ readPasteboard: false
31970
31972
 
31971
31973
  analyser:
31972
31974
  # Requires GOOGLE_GENERATIVE_AI_API_KEY in environment.
@@ -31986,8 +31988,8 @@ agents:
31986
31988
  `;
31987
31989
 
31988
31990
  // ../../packages/config/dist/core/redact-issues.js
31989
- function normalizePath(path39) {
31990
- return path39.map((segment) => typeof segment === "symbol" ? segment.toString() : segment);
31991
+ function normalizePath(path40) {
31992
+ return path40.map((segment) => typeof segment === "symbol" ? segment.toString() : segment);
31991
31993
  }
31992
31994
  function redactIssues(issues) {
31993
31995
  return issues.map((issue2) => ({
@@ -32764,10 +32766,10 @@ function mergeDefs(...defs) {
32764
32766
  function cloneDef(schema2) {
32765
32767
  return mergeDefs(schema2._zod.def);
32766
32768
  }
32767
- function getElementAtPath(obj, path39) {
32768
- if (!path39)
32769
+ function getElementAtPath(obj, path40) {
32770
+ if (!path40)
32769
32771
  return obj;
32770
- return path39.reduce((acc, key) => acc?.[key], obj);
32772
+ return path40.reduce((acc, key) => acc?.[key], obj);
32771
32773
  }
32772
32774
  function promiseAllObject(promisesObj) {
32773
32775
  const keys = Object.keys(promisesObj);
@@ -33150,11 +33152,11 @@ function aborted(x, startIndex = 0) {
33150
33152
  }
33151
33153
  return false;
33152
33154
  }
33153
- function prefixIssues(path39, issues) {
33155
+ function prefixIssues(path40, issues) {
33154
33156
  return issues.map((iss) => {
33155
33157
  var _a4;
33156
33158
  (_a4 = iss).path ?? (_a4.path = []);
33157
- iss.path.unshift(path39);
33159
+ iss.path.unshift(path40);
33158
33160
  return iss;
33159
33161
  });
33160
33162
  }
@@ -33337,7 +33339,7 @@ function formatError(error48, mapper = (issue2) => issue2.message) {
33337
33339
  }
33338
33340
  function treeifyError(error48, mapper = (issue2) => issue2.message) {
33339
33341
  const result = { errors: [] };
33340
- const processError = (error49, path39 = []) => {
33342
+ const processError = (error49, path40 = []) => {
33341
33343
  var _a4, _b2;
33342
33344
  for (const issue2 of error49.issues) {
33343
33345
  if (issue2.code === "invalid_union" && issue2.errors.length) {
@@ -33347,7 +33349,7 @@ function treeifyError(error48, mapper = (issue2) => issue2.message) {
33347
33349
  } else if (issue2.code === "invalid_element") {
33348
33350
  processError({ issues: issue2.issues }, issue2.path);
33349
33351
  } else {
33350
- const fullpath = [...path39, ...issue2.path];
33352
+ const fullpath = [...path40, ...issue2.path];
33351
33353
  if (fullpath.length === 0) {
33352
33354
  result.errors.push(mapper(issue2));
33353
33355
  continue;
@@ -33379,8 +33381,8 @@ function treeifyError(error48, mapper = (issue2) => issue2.message) {
33379
33381
  }
33380
33382
  function toDotPath(_path) {
33381
33383
  const segs = [];
33382
- const path39 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
33383
- for (const seg of path39) {
33384
+ const path40 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
33385
+ for (const seg of path40) {
33384
33386
  if (typeof seg === "number")
33385
33387
  segs.push(`[${seg}]`);
33386
33388
  else if (typeof seg === "symbol")
@@ -45357,13 +45359,13 @@ function resolveRef(ref, ctx) {
45357
45359
  if (!ref.startsWith("#")) {
45358
45360
  throw new Error("External $ref is not supported, only local refs (#/...) are allowed");
45359
45361
  }
45360
- const path39 = ref.slice(1).split("/").filter(Boolean);
45361
- if (path39.length === 0) {
45362
+ const path40 = ref.slice(1).split("/").filter(Boolean);
45363
+ if (path40.length === 0) {
45362
45364
  return ctx.rootSchema;
45363
45365
  }
45364
45366
  const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions";
45365
- if (path39[0] === defsKey) {
45366
- const key = path39[1];
45367
+ if (path40[0] === defsKey) {
45368
+ const key = path40[1];
45367
45369
  if (!key || !ctx.defs[key]) {
45368
45370
  throw new Error(`Reference not found: ${ref}`);
45369
45371
  }
@@ -46039,7 +46041,7 @@ var {
46039
46041
  } = import_index.default;
46040
46042
 
46041
46043
  // src/bootstrap.ts
46042
- var import_neverthrow96 = __toESM(require_index_cjs(), 1);
46044
+ var import_neverthrow100 = __toESM(require_index_cjs(), 1);
46043
46045
 
46044
46046
  // src/config/error-formatter.ts
46045
46047
  function formatIssues(issues) {
@@ -46120,8 +46122,8 @@ function requireVideoPath(input) {
46120
46122
  if (input.videoPath === void 0) {
46121
46123
  return (0, import_neverthrow5.errAsync)({ type: "MISSING_VIDEO_PATH" });
46122
46124
  }
46123
- const path39 = input.videoPath;
46124
- return checkFileExists(path39).map(() => path39).mapErr(() => ({ type: "VIDEO_NOT_FOUND", path: path39 }));
46125
+ const path40 = input.videoPath;
46126
+ return checkFileExists(path40).map(() => path40).mapErr(() => ({ type: "VIDEO_NOT_FOUND", path: path40 }));
46125
46127
  }
46126
46128
  function validateAnalyseInput(input) {
46127
46129
  return requireApiKey(input).andThen(
@@ -49494,9 +49496,9 @@ var tq = k((oq) => {
49494
49496
  });
49495
49497
  var sq = k((aq) => {
49496
49498
  Object.defineProperty(aq, "__esModule", { value: true });
49497
- var ok41 = Q$(), tk = { keyword: "not", schemaType: ["object", "boolean"], trackErrors: true, code($) {
49499
+ var ok45 = Q$(), tk = { keyword: "not", schemaType: ["object", "boolean"], trackErrors: true, code($) {
49498
49500
  let { gen: X, schema: J, it: Q } = $;
49499
- if ((0, ok41.alwaysValidSchema)(Q, J)) {
49501
+ if ((0, ok45.alwaysValidSchema)(Q, J)) {
49500
49502
  $.fail();
49501
49503
  return;
49502
49504
  }
@@ -63957,6 +63959,41 @@ function createPressButtonTool(udid = "booted") {
63957
63959
  async ({ button }) => handlePressButton(udid, button)
63958
63960
  );
63959
63961
  }
63962
+ var READ_PASTEBOARD_TOOL_NAME = "mcp__mobile-ios__read_pasteboard";
63963
+ var MAX_PASTEBOARD_LENGTH = 4096;
63964
+ var READ_PASTEBOARD_SCHEMA = {};
63965
+ var READ_PASTEBOARD_DESCRIPTION = [
63966
+ "Read current simulator pasteboard (clipboard) as text.",
63967
+ 'Use ONLY to verify a copy-to-clipboard action the user just performed (e.g. confirm a "Copy address" button wrote the expected value).',
63968
+ 'DO NOT call on screens showing secrets, seed phrases, recovery words, private keys, passwords, or 2FA codes, or after any "reveal/backup/export" flow \u2014 pasteboard contents are sent to the model provider verbatim.',
63969
+ `Output is truncated to ${String(MAX_PASTEBOARD_LENGTH)} characters; trailing newlines are stripped; returns empty string when the pasteboard is empty.`
63970
+ ].join(" ");
63971
+ function truncatePasteboard(raw) {
63972
+ const trimmed = raw.replace(/\r?\n+$/, "");
63973
+ if (trimmed.length <= MAX_PASTEBOARD_LENGTH) {
63974
+ return trimmed;
63975
+ }
63976
+ const overflow = trimmed.length - MAX_PASTEBOARD_LENGTH;
63977
+ return `${trimmed.slice(0, MAX_PASTEBOARD_LENGTH)}
63978
+ [truncated: ${String(overflow)} more chars]`;
63979
+ }
63980
+ async function handleReadPasteboard(udid) {
63981
+ return resolveUdid(udid).andThen((resolvedUdid) => runCommand("xcrun", ["simctl", "pbpaste", resolvedUdid])).match(
63982
+ (value) => ({ content: [{ type: "text", text: truncatePasteboard(value) }] }),
63983
+ (error48) => ({
63984
+ content: [{ type: "text", text: `Error: ${String(error48.cause)}` }],
63985
+ isError: true
63986
+ })
63987
+ );
63988
+ }
63989
+ function createReadPasteboardTool(udid = "booted") {
63990
+ return _x(
63991
+ "read_pasteboard",
63992
+ READ_PASTEBOARD_DESCRIPTION,
63993
+ READ_PASTEBOARD_SCHEMA,
63994
+ async () => handleReadPasteboard(udid)
63995
+ );
63996
+ }
63960
63997
  var cache2 = /* @__PURE__ */ new Map();
63961
63998
  function parseDeviceInfo(raw) {
63962
63999
  const parsed = JSON.parse(raw);
@@ -64196,25 +64233,29 @@ function discoverBootedSimulators() {
64196
64233
  function checkIdbAvailable() {
64197
64234
  return runCommand("which", ["idb"]).mapErr(() => ({ type: "IDB_NOT_FOUND" }));
64198
64235
  }
64199
- function createMobileIosServer(udid = "booted", extraTools = []) {
64236
+ function buildBaseTools(udid) {
64237
+ return [
64238
+ createScreenshotTool(udid),
64239
+ createAccessibilitySnapshotTool(udid),
64240
+ createTapTool(udid),
64241
+ createDoubleTapTool(udid),
64242
+ createLongPressTool(udid),
64243
+ createSwipeTool(udid),
64244
+ createTypeTextTool(udid),
64245
+ createPressButtonTool(udid),
64246
+ createLaunchAppTool(udid),
64247
+ createTerminateAppTool(udid),
64248
+ createListAppsTool(udid),
64249
+ createWaitSecondsTool()
64250
+ ];
64251
+ }
64252
+ function createMobileIosServer(udid = "booted", options2 = {}) {
64253
+ const { extraTools = [], enableReadPasteboard = false } = options2;
64254
+ const pasteboardTools = enableReadPasteboard ? [createReadPasteboardTool(udid)] : [];
64200
64255
  return xx({
64201
64256
  name: "mobile-ios",
64202
64257
  version: "0.0.0",
64203
- tools: [
64204
- createScreenshotTool(udid),
64205
- createAccessibilitySnapshotTool(udid),
64206
- createTapTool(udid),
64207
- createDoubleTapTool(udid),
64208
- createLongPressTool(udid),
64209
- createSwipeTool(udid),
64210
- createTypeTextTool(udid),
64211
- createPressButtonTool(udid),
64212
- createLaunchAppTool(udid),
64213
- createTerminateAppTool(udid),
64214
- createListAppsTool(udid),
64215
- createWaitSecondsTool(),
64216
- ...extraTools
64217
- ]
64258
+ tools: [...buildBaseTools(udid), ...pasteboardTools, ...extraTools]
64218
64259
  });
64219
64260
  }
64220
64261
 
@@ -66156,15 +66197,15 @@ async function makeRequest(url2, fetchOptions, fetchFn = fetch) {
66156
66197
  return response;
66157
66198
  }
66158
66199
  function handleResponseError(e3, url2) {
66159
- let err40 = e3;
66160
- if (err40.name === "AbortError") {
66161
- err40 = new GoogleGenerativeAIAbortError(`Request aborted when fetching ${url2.toString()}: ${e3.message}`);
66162
- err40.stack = e3.stack;
66200
+ let err41 = e3;
66201
+ if (err41.name === "AbortError") {
66202
+ err41 = new GoogleGenerativeAIAbortError(`Request aborted when fetching ${url2.toString()}: ${e3.message}`);
66203
+ err41.stack = e3.stack;
66163
66204
  } else if (!(e3 instanceof GoogleGenerativeAIFetchError || e3 instanceof GoogleGenerativeAIRequestInputError)) {
66164
- err40 = new GoogleGenerativeAIError(`Error fetching from ${url2.toString()}: ${e3.message}`);
66165
- err40.stack = e3.stack;
66205
+ err41 = new GoogleGenerativeAIError(`Error fetching from ${url2.toString()}: ${e3.message}`);
66206
+ err41.stack = e3.stack;
66166
66207
  }
66167
- throw err40;
66208
+ throw err41;
66168
66209
  }
66169
66210
  async function handleResponseNotOk(response, url2) {
66170
66211
  let message = "";
@@ -66411,14 +66452,14 @@ function getResponseStream(inputStream) {
66411
66452
  }
66412
66453
  return pump();
66413
66454
  }).catch((e3) => {
66414
- let err40 = e3;
66415
- err40.stack = e3.stack;
66416
- if (err40.name === "AbortError") {
66417
- err40 = new GoogleGenerativeAIAbortError("Request aborted when reading from the stream");
66455
+ let err41 = e3;
66456
+ err41.stack = e3.stack;
66457
+ if (err41.name === "AbortError") {
66458
+ err41 = new GoogleGenerativeAIAbortError("Request aborted when reading from the stream");
66418
66459
  } else {
66419
- err40 = new GoogleGenerativeAIError("Error reading from the stream");
66460
+ err41 = new GoogleGenerativeAIError("Error reading from the stream");
66420
66461
  }
66421
- throw err40;
66462
+ throw err41;
66422
66463
  });
66423
66464
  }
66424
66465
  }
@@ -67014,15 +67055,15 @@ async function makeRequest2(url2, fetchOptions, fetchFn = fetch) {
67014
67055
  return response;
67015
67056
  }
67016
67057
  function handleResponseError2(e3, url2) {
67017
- let err40 = e3;
67018
- if (err40.name === "AbortError") {
67019
- err40 = new GoogleGenerativeAIAbortError2(`Request aborted when fetching ${url2.toString()}: ${e3.message}`);
67020
- err40.stack = e3.stack;
67058
+ let err41 = e3;
67059
+ if (err41.name === "AbortError") {
67060
+ err41 = new GoogleGenerativeAIAbortError2(`Request aborted when fetching ${url2.toString()}: ${e3.message}`);
67061
+ err41.stack = e3.stack;
67021
67062
  } else if (!(e3 instanceof GoogleGenerativeAIFetchError2 || e3 instanceof GoogleGenerativeAIRequestInputError2)) {
67022
- err40 = new GoogleGenerativeAIError2(`Error fetching from ${url2.toString()}: ${e3.message}`);
67023
- err40.stack = e3.stack;
67063
+ err41 = new GoogleGenerativeAIError2(`Error fetching from ${url2.toString()}: ${e3.message}`);
67064
+ err41.stack = e3.stack;
67024
67065
  }
67025
- throw err40;
67066
+ throw err41;
67026
67067
  }
67027
67068
  async function handleResponseNotOk2(response, url2) {
67028
67069
  let message = "";
@@ -67061,8 +67102,8 @@ var ServerRequestUrl = class {
67061
67102
  this.apiKey = apiKey;
67062
67103
  this.requestOptions = requestOptions;
67063
67104
  }
67064
- appendPath(path39) {
67065
- this._url.pathname = this._url.pathname + `/${path39}`;
67105
+ appendPath(path40) {
67106
+ this._url.pathname = this._url.pathname + `/${path40}`;
67066
67107
  }
67067
67108
  appendParam(key, value) {
67068
67109
  this._url.searchParams.append(key, value);
@@ -67642,34 +67683,34 @@ var uuid42 = function() {
67642
67683
  };
67643
67684
 
67644
67685
  // ../../node_modules/.pnpm/@anthropic-ai+sdk@0.87.0_zod@4.3.6/node_modules/@anthropic-ai/sdk/internal/errors.mjs
67645
- function isAbortError(err40) {
67646
- return typeof err40 === "object" && err40 !== null && // Spec-compliant fetch implementations
67647
- ("name" in err40 && err40.name === "AbortError" || // Expo fetch
67648
- "message" in err40 && String(err40.message).includes("FetchRequestCanceledException"));
67649
- }
67650
- var castToError = (err40) => {
67651
- if (err40 instanceof Error)
67652
- return err40;
67653
- if (typeof err40 === "object" && err40 !== null) {
67686
+ function isAbortError(err41) {
67687
+ return typeof err41 === "object" && err41 !== null && // Spec-compliant fetch implementations
67688
+ ("name" in err41 && err41.name === "AbortError" || // Expo fetch
67689
+ "message" in err41 && String(err41.message).includes("FetchRequestCanceledException"));
67690
+ }
67691
+ var castToError = (err41) => {
67692
+ if (err41 instanceof Error)
67693
+ return err41;
67694
+ if (typeof err41 === "object" && err41 !== null) {
67654
67695
  try {
67655
- if (Object.prototype.toString.call(err40) === "[object Error]") {
67656
- const error48 = new Error(err40.message, err40.cause ? { cause: err40.cause } : {});
67657
- if (err40.stack)
67658
- error48.stack = err40.stack;
67659
- if (err40.cause && !error48.cause)
67660
- error48.cause = err40.cause;
67661
- if (err40.name)
67662
- error48.name = err40.name;
67696
+ if (Object.prototype.toString.call(err41) === "[object Error]") {
67697
+ const error48 = new Error(err41.message, err41.cause ? { cause: err41.cause } : {});
67698
+ if (err41.stack)
67699
+ error48.stack = err41.stack;
67700
+ if (err41.cause && !error48.cause)
67701
+ error48.cause = err41.cause;
67702
+ if (err41.name)
67703
+ error48.name = err41.name;
67663
67704
  return error48;
67664
67705
  }
67665
67706
  } catch {
67666
67707
  }
67667
67708
  try {
67668
- return new Error(JSON.stringify(err40));
67709
+ return new Error(JSON.stringify(err41));
67669
67710
  } catch {
67670
67711
  }
67671
67712
  }
67672
- return new Error(err40);
67713
+ return new Error(err41);
67673
67714
  };
67674
67715
 
67675
67716
  // ../../node_modules/.pnpm/@anthropic-ai+sdk@0.87.0_zod@4.3.6/node_modules/@anthropic-ai/sdk/core/error.mjs
@@ -67799,7 +67840,7 @@ var validatePositiveInteger = (name, n3) => {
67799
67840
  var safeJSON = (text) => {
67800
67841
  try {
67801
67842
  return JSON.parse(text);
67802
- } catch (err40) {
67843
+ } catch (err41) {
67803
67844
  return void 0;
67804
67845
  }
67805
67846
  };
@@ -68363,8 +68404,8 @@ var Stream = class _Stream {
68363
68404
  return ctrl.close();
68364
68405
  const bytes = encodeUTF8(JSON.stringify(value) + "\n");
68365
68406
  ctrl.enqueue(bytes);
68366
- } catch (err40) {
68367
- ctrl.error(err40);
68407
+ } catch (err41) {
68408
+ ctrl.error(err41);
68368
68409
  }
68369
68410
  },
68370
68411
  async cancel() {
@@ -68912,12 +68953,12 @@ function encodeURIPath(str3) {
68912
68953
  return str3.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g, encodeURIComponent);
68913
68954
  }
68914
68955
  var EMPTY = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.create(null));
68915
- var createPathTagFunction = (pathEncoder = encodeURIPath) => function path39(statics, ...params) {
68956
+ var createPathTagFunction = (pathEncoder = encodeURIPath) => function path40(statics, ...params) {
68916
68957
  if (statics.length === 1)
68917
68958
  return statics[0];
68918
68959
  let postPath = false;
68919
68960
  const invalidSegments = [];
68920
- const path40 = statics.reduce((previousValue, currentValue, index) => {
68961
+ const path41 = statics.reduce((previousValue, currentValue, index) => {
68921
68962
  if (/[?#]/.test(currentValue)) {
68922
68963
  postPath = true;
68923
68964
  }
@@ -68934,7 +68975,7 @@ var createPathTagFunction = (pathEncoder = encodeURIPath) => function path39(sta
68934
68975
  }
68935
68976
  return previousValue + currentValue + (index === params.length ? "" : encoded);
68936
68977
  }, "");
68937
- const pathOnly = path40.split(/[?#]/, 1)[0];
68978
+ const pathOnly = path41.split(/[?#]/, 1)[0];
68938
68979
  const invalidSegmentPattern = /(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi;
68939
68980
  let match2;
68940
68981
  while ((match2 = invalidSegmentPattern.exec(pathOnly)) !== null) {
@@ -68955,10 +68996,10 @@ var createPathTagFunction = (pathEncoder = encodeURIPath) => function path39(sta
68955
68996
  }, "");
68956
68997
  throw new AnthropicError(`Path parameters result in path with invalid segments:
68957
68998
  ${invalidSegments.map((e3) => e3.error).join("\n")}
68958
- ${path40}
68999
+ ${path41}
68959
69000
  ${underline}`);
68960
69001
  }
68961
- return path40;
69002
+ return path41;
68962
69003
  };
68963
69004
  var path5 = /* @__PURE__ */ createPathTagFunction(encodeURIPath);
68964
69005
 
@@ -70271,8 +70312,8 @@ var BetaMessageStream = class _BetaMessageStream {
70271
70312
  if (jsonBuf) {
70272
70313
  try {
70273
70314
  newContent.input = partialParse(jsonBuf);
70274
- } catch (err40) {
70275
- const error48 = new AnthropicError(`Unable to parse tool parameter JSON from model. Please retry your request or adjust your prompt. Error: ${err40}. JSON: ${jsonBuf}`);
70315
+ } catch (err41) {
70316
+ const error48 = new AnthropicError(`Unable to parse tool parameter JSON from model. Please retry your request or adjust your prompt. Error: ${err41}. JSON: ${jsonBuf}`);
70276
70317
  __classPrivateFieldGet(this, _BetaMessageStream_handleError, "f").call(this, error48);
70277
70318
  }
70278
70319
  }
@@ -70334,17 +70375,17 @@ var BetaMessageStream = class _BetaMessageStream {
70334
70375
  }
70335
70376
  readQueue.length = 0;
70336
70377
  });
70337
- this.on("abort", (err40) => {
70378
+ this.on("abort", (err41) => {
70338
70379
  done = true;
70339
70380
  for (const reader of readQueue) {
70340
- reader.reject(err40);
70381
+ reader.reject(err41);
70341
70382
  }
70342
70383
  readQueue.length = 0;
70343
70384
  });
70344
- this.on("error", (err40) => {
70385
+ this.on("error", (err41) => {
70345
70386
  done = true;
70346
70387
  for (const reader of readQueue) {
70347
- reader.reject(err40);
70388
+ reader.reject(err41);
70348
70389
  }
70349
70390
  readQueue.length = 0;
70350
70391
  });
@@ -72587,17 +72628,17 @@ var MessageStream = class _MessageStream {
72587
72628
  }
72588
72629
  readQueue.length = 0;
72589
72630
  });
72590
- this.on("abort", (err40) => {
72631
+ this.on("abort", (err41) => {
72591
72632
  done = true;
72592
72633
  for (const reader of readQueue) {
72593
- reader.reject(err40);
72634
+ reader.reject(err41);
72594
72635
  }
72595
72636
  readQueue.length = 0;
72596
72637
  });
72597
- this.on("error", (err40) => {
72638
+ this.on("error", (err41) => {
72598
72639
  done = true;
72599
72640
  for (const reader of readQueue) {
72600
- reader.reject(err40);
72641
+ reader.reject(err41);
72601
72642
  }
72602
72643
  readQueue.length = 0;
72603
72644
  });
@@ -73046,9 +73087,9 @@ var BaseAnthropic = class {
73046
73087
  makeStatusError(status, error48, message, headers) {
73047
73088
  return APIError.generate(status, error48, message, headers);
73048
73089
  }
73049
- buildURL(path39, query, defaultBaseURL) {
73090
+ buildURL(path40, query, defaultBaseURL) {
73050
73091
  const baseURL = !__classPrivateFieldGet(this, _BaseAnthropic_instances, "m", _BaseAnthropic_baseURLOverridden).call(this) && defaultBaseURL || this.baseURL;
73051
- const url2 = isAbsoluteURL(path39) ? new URL(path39) : new URL(baseURL + (baseURL.endsWith("/") && path39.startsWith("/") ? path39.slice(1) : path39));
73092
+ const url2 = isAbsoluteURL(path40) ? new URL(path40) : new URL(baseURL + (baseURL.endsWith("/") && path40.startsWith("/") ? path40.slice(1) : path40));
73052
73093
  const defaultQuery = this.defaultQuery();
73053
73094
  const pathQuery = Object.fromEntries(url2.searchParams);
73054
73095
  if (!isEmptyObj(defaultQuery) || !isEmptyObj(pathQuery)) {
@@ -73080,24 +73121,24 @@ var BaseAnthropic = class {
73080
73121
  */
73081
73122
  async prepareRequest(request2, { url: url2, options: options2 }) {
73082
73123
  }
73083
- get(path39, opts) {
73084
- return this.methodRequest("get", path39, opts);
73124
+ get(path40, opts) {
73125
+ return this.methodRequest("get", path40, opts);
73085
73126
  }
73086
- post(path39, opts) {
73087
- return this.methodRequest("post", path39, opts);
73127
+ post(path40, opts) {
73128
+ return this.methodRequest("post", path40, opts);
73088
73129
  }
73089
- patch(path39, opts) {
73090
- return this.methodRequest("patch", path39, opts);
73130
+ patch(path40, opts) {
73131
+ return this.methodRequest("patch", path40, opts);
73091
73132
  }
73092
- put(path39, opts) {
73093
- return this.methodRequest("put", path39, opts);
73133
+ put(path40, opts) {
73134
+ return this.methodRequest("put", path40, opts);
73094
73135
  }
73095
- delete(path39, opts) {
73096
- return this.methodRequest("delete", path39, opts);
73136
+ delete(path40, opts) {
73137
+ return this.methodRequest("delete", path40, opts);
73097
73138
  }
73098
- methodRequest(method, path39, opts) {
73139
+ methodRequest(method, path40, opts) {
73099
73140
  return this.request(Promise.resolve(opts).then((opts2) => {
73100
- return { method, path: path39, ...opts2 };
73141
+ return { method, path: path40, ...opts2 };
73101
73142
  }));
73102
73143
  }
73103
73144
  request(options2, remainingRetries = null) {
@@ -73177,7 +73218,7 @@ var BaseAnthropic = class {
73177
73218
  }
73178
73219
  const retryMessage = shouldRetry ? `error; no more retries left` : `error; not retryable`;
73179
73220
  loggerFor(this).info(`${responseInfo} - ${retryMessage}`);
73180
- const errText = await response.text().catch((err41) => castToError(err41).message);
73221
+ const errText = await response.text().catch((err45) => castToError(err45).message);
73181
73222
  const errJSON = safeJSON(errText);
73182
73223
  const errMessage = errJSON ? void 0 : errText;
73183
73224
  loggerFor(this).debug(`[${requestLogID}] response error (${retryMessage})`, formatRequestDetails({
@@ -73188,8 +73229,8 @@ var BaseAnthropic = class {
73188
73229
  message: errMessage,
73189
73230
  durationMs: Date.now() - startTime
73190
73231
  }));
73191
- const err40 = this.makeStatusError(response.status, errJSON, errMessage, response.headers);
73192
- throw err40;
73232
+ const err41 = this.makeStatusError(response.status, errJSON, errMessage, response.headers);
73233
+ throw err41;
73193
73234
  }
73194
73235
  loggerFor(this).info(responseInfo);
73195
73236
  loggerFor(this).debug(`[${requestLogID}] response start`, formatRequestDetails({
@@ -73201,8 +73242,8 @@ var BaseAnthropic = class {
73201
73242
  }));
73202
73243
  return { response, options: options2, controller, requestLogID, retryOfRequestLogID, startTime };
73203
73244
  }
73204
- getAPIList(path39, Page2, opts) {
73205
- return this.requestAPIList(Page2, opts && "then" in opts ? opts.then((opts2) => ({ method: "get", path: path39, ...opts2 })) : { method: "get", path: path39, ...opts });
73245
+ getAPIList(path40, Page2, opts) {
73246
+ return this.requestAPIList(Page2, opts && "then" in opts ? opts.then((opts2) => ({ method: "get", path: path40, ...opts2 })) : { method: "get", path: path40, ...opts });
73206
73247
  }
73207
73248
  requestAPIList(Page2, options2) {
73208
73249
  const request2 = this.makeRequest(options2, null, void 0);
@@ -73290,8 +73331,8 @@ var BaseAnthropic = class {
73290
73331
  }
73291
73332
  async buildRequest(inputOptions, { retryCount = 0 } = {}) {
73292
73333
  const options2 = { ...inputOptions };
73293
- const { method, path: path39, query, defaultBaseURL } = options2;
73294
- const url2 = this.buildURL(path39, query, defaultBaseURL);
73334
+ const { method, path: path40, query, defaultBaseURL } = options2;
73335
+ const url2 = this.buildURL(path40, query, defaultBaseURL);
73295
73336
  if ("timeout" in options2)
73296
73337
  validatePositiveInteger("timeout", options2.timeout);
73297
73338
  options2.timeout = options2.timeout ?? this.timeout;
@@ -73478,6 +73519,21 @@ function dismissalsPath(baseDirectory, override) {
73478
73519
  return import_node_path6.default.join(baseDirectory, ".xqa", "dismissals.json");
73479
73520
  }
73480
73521
 
73522
+ // ../../packages/shared/dist/scenario-run.js
73523
+ var scenarioRunOutcomeSchema = external_exports.enum(["completed", "errored", "timed_out", "aborted"]);
73524
+ var scenarioRunRecordSchema = external_exports.object({
73525
+ scenarioId: external_exports.string(),
73526
+ specPath: external_exports.string(),
73527
+ outcome: scenarioRunOutcomeSchema,
73528
+ errorType: external_exports.string().optional(),
73529
+ startedAt: external_exports.string(),
73530
+ finishedAt: external_exports.string()
73531
+ });
73532
+ var scenarioRunsFileSchema = external_exports.object({
73533
+ version: external_exports.literal(1),
73534
+ records: external_exports.array(scenarioRunRecordSchema)
73535
+ });
73536
+
73481
73537
  // ../../packages/tools/dist/index.js
73482
73538
  var import_neverthrow18 = __toESM(require_index_cjs(), 1);
73483
73539
  function buildGetOutputTool() {
@@ -74414,8 +74470,12 @@ function buildReportFindingTool(config2, state) {
74414
74470
  }
74415
74471
  function buildMobileIosServer(config2, state) {
74416
74472
  const reportFindingTool = buildReportFindingTool(config2, state);
74473
+ const enableReadPasteboard = config2.capabilities.readPasteboard;
74417
74474
  if (!config2.capabilities.viewUiServer) {
74418
- return createMobileIosServer(config2.udid ?? "booted", [reportFindingTool]);
74475
+ return createMobileIosServer(config2.udid ?? "booted", {
74476
+ extraTools: [reportFindingTool],
74477
+ enableReadPasteboard
74478
+ });
74419
74479
  }
74420
74480
  const viewUiTool = createViewUiTool({
74421
74481
  udid: config2.udid,
@@ -74424,15 +74484,23 @@ function buildMobileIosServer(config2, state) {
74424
74484
  onEvent: config2.onEvent,
74425
74485
  screenshotsDir: config2.screenshotsDir
74426
74486
  });
74427
- return createMobileIosServer(config2.udid ?? "booted", [viewUiTool, reportFindingTool]);
74487
+ return createMobileIosServer(config2.udid ?? "booted", {
74488
+ extraTools: [viewUiTool, reportFindingTool],
74489
+ enableReadPasteboard
74490
+ });
74428
74491
  }
74429
- function setupQuery(config2) {
74430
- const baseAllowedTools = [
74492
+ function buildAllowedTools(config2) {
74493
+ const tools = [
74431
74494
  ...config2.allowedTools ?? [],
74432
74495
  REPORT_FINDING_TOOL_NAME,
74433
- WAIT_SECONDS_TOOL_NAME
74496
+ WAIT_SECONDS_TOOL_NAME,
74497
+ config2.capabilities.viewUiServer ? VIEW_UI_TOOL_NAME : void 0,
74498
+ config2.capabilities.readPasteboard ? READ_PASTEBOARD_TOOL_NAME : void 0
74434
74499
  ];
74435
- const allowedTools = (config2.capabilities.viewUiServer ? [...baseAllowedTools, VIEW_UI_TOOL_NAME] : baseAllowedTools).filter((tool3) => typeof tool3 === "string");
74500
+ return tools.filter((tool3) => typeof tool3 === "string");
74501
+ }
74502
+ function setupQuery(config2) {
74503
+ const allowedTools = buildAllowedTools(config2);
74436
74504
  const inputQueue = new MessageQueue();
74437
74505
  const state = buildAgentState({ config: config2, inputQueue });
74438
74506
  const mobileIosServer = buildMobileIosServer(config2, state);
@@ -74717,8 +74785,8 @@ ${initialState2}` : void 0,
74717
74785
  WORKING_STATE_SECTION
74718
74786
  ].filter((section) => section !== void 0).join("\n\n");
74719
74787
  }
74720
- function buildEnvSection(buildEnv2) {
74721
- return buildEnv2 === "dev" ? `
74788
+ function buildEnvSection(buildEnv3) {
74789
+ return buildEnv3 === "dev" ? `
74722
74790
 
74723
74791
  ${DEV_ENVIRONMENT_SECTION}` : "";
74724
74792
  }
@@ -74785,9 +74853,9 @@ ${FINDING_TAXONOMY_SECTION}${environmentSection}
74785
74853
  ${reportingSection}`;
74786
74854
  }
74787
74855
  var FREESTYLE_TEMPLATE = (options2) => {
74788
- const { appContext, initialState: initialState2, buildEnv: buildEnv2, scenarioId } = options2 ?? {};
74856
+ const { appContext, initialState: initialState2, buildEnv: buildEnv3, scenarioId } = options2 ?? {};
74789
74857
  const contextBlock = buildContextSections(appContext, initialState2);
74790
- const environmentSection = buildEnvSection(buildEnv2);
74858
+ const environmentSection = buildEnvSection(buildEnv3);
74791
74859
  const reportingSection = buildReportFindingSection(scenarioId);
74792
74860
  return buildFreestyleBody({ contextBlock, environmentSection, reportingSection });
74793
74861
  };
@@ -74928,10 +74996,10 @@ function generateExplorerPrompt({
74928
74996
  specs,
74929
74997
  appContext,
74930
74998
  initialState: initialState2,
74931
- buildEnv: buildEnv2,
74999
+ buildEnv: buildEnv3,
74932
75000
  scenarioId
74933
75001
  }) {
74934
- return mode === "spec" ? buildSpecModePrompt(specs, { appContext, initialState: initialState2, buildEnv: buildEnv2, scenarioId }) : FREESTYLE_TEMPLATE({ appContext, initialState: initialState2, buildEnv: buildEnv2, scenarioId });
75002
+ return mode === "spec" ? buildSpecModePrompt(specs, { appContext, initialState: initialState2, buildEnv: buildEnv3, scenarioId }) : FREESTYLE_TEMPLATE({ appContext, initialState: initialState2, buildEnv: buildEnv3, scenarioId });
74935
75003
  }
74936
75004
  var FRONTMATTER_FENCE = "---";
74937
75005
  var INLINE_ASSERTION_DELIMITER = " \u2192 ";
@@ -75113,11 +75181,11 @@ function readEntries(entries) {
75113
75181
  );
75114
75182
  }
75115
75183
  function readEntry(entry) {
75116
- const safeReadFile7 = (0, import_neverthrow31.fromAsyncThrowable)(
75184
+ const safeReadFile8 = (0, import_neverthrow31.fromAsyncThrowable)(
75117
75185
  async () => (0, import_promises16.readFile)(entry.path, "utf8"),
75118
75186
  (cause) => ({ type: "FILE_READ_FAILED", path: entry.path, cause })
75119
75187
  );
75120
- return safeReadFile7().map((content) => [{ name: entry.name, content }]).orElse((error48) => entry.required ? (0, import_neverthrow31.errAsync)(error48) : (0, import_neverthrow31.okAsync)([]));
75188
+ return safeReadFile8().map((content) => [{ name: entry.name, content }]).orElse((error48) => entry.required ? (0, import_neverthrow31.errAsync)(error48) : (0, import_neverthrow31.okAsync)([]));
75121
75189
  }
75122
75190
  function specNameFromPath(filePath) {
75123
75191
  const parts = filePath.split("/");
@@ -75253,7 +75321,8 @@ function runExplorer(config2) {
75253
75321
  var explorerCapabilitiesSchema = external_exports.object({
75254
75322
  videoRecording: external_exports.boolean().default(false),
75255
75323
  viewUiServer: external_exports.boolean().default(true),
75256
- findingScreenshots: external_exports.boolean().default(true)
75324
+ findingScreenshots: external_exports.boolean().default(true),
75325
+ readPasteboard: external_exports.boolean().default(false)
75257
75326
  }).strict();
75258
75327
  var DEFAULT_EXPLORER_CAPABILITIES = explorerCapabilitiesSchema.parse({});
75259
75328
  var explorerConfigSchema = agentBaseConfigSchema.extend({
@@ -76243,7 +76312,7 @@ var directiveHandlers = {
76243
76312
  }
76244
76313
  try {
76245
76314
  prefix = decodeURIComponent(prefix);
76246
- } catch (err40) {
76315
+ } catch (err41) {
76247
76316
  throwError(state, "tag prefix is malformed: " + prefix);
76248
76317
  }
76249
76318
  state.tagMap[handle] = prefix;
@@ -76924,7 +76993,7 @@ function readTagProperty(state) {
76924
76993
  }
76925
76994
  try {
76926
76995
  tagName = decodeURIComponent(tagName);
76927
- } catch (err40) {
76996
+ } catch (err41) {
76928
76997
  throwError(state, "tag name is malformed: " + tagName);
76929
76998
  }
76930
76999
  if (isVerbatim) {
@@ -80299,20 +80368,24 @@ var import_neverthrow61 = __toESM(require_index_cjs(), 1);
80299
80368
  var import_promises23 = require("node:fs/promises");
80300
80369
  var import_neverthrow62 = __toESM(require_index_cjs(), 1);
80301
80370
  var import_neverthrow63 = __toESM(require_index_cjs(), 1);
80371
+ var import_neverthrow64 = __toESM(require_index_cjs(), 1);
80302
80372
  var import_node_child_process6 = require("node:child_process");
80303
80373
  var import_node_util = require("node:util");
80304
- var import_neverthrow64 = __toESM(require_index_cjs(), 1);
80305
- var import_node_process2 = require("node:process");
80306
80374
  var import_neverthrow65 = __toESM(require_index_cjs(), 1);
80375
+ var import_node_process2 = require("node:process");
80376
+ var import_node_child_process7 = require("node:child_process");
80377
+ var import_node_util2 = require("node:util");
80307
80378
  var import_neverthrow66 = __toESM(require_index_cjs(), 1);
80379
+ var import_neverthrow67 = __toESM(require_index_cjs(), 1);
80380
+ var import_neverthrow68 = __toESM(require_index_cjs(), 1);
80308
80381
  var import_promises24 = require("node:fs/promises");
80309
80382
  var import_node_path20 = __toESM(require("node:path"), 1);
80310
- var import_neverthrow67 = __toESM(require_index_cjs(), 1);
80383
+ var import_neverthrow69 = __toESM(require_index_cjs(), 1);
80311
80384
  var import_promises25 = require("node:fs/promises");
80312
80385
  var import_node_path21 = __toESM(require("node:path"), 1);
80313
- var import_neverthrow68 = __toESM(require_index_cjs(), 1);
80386
+ var import_neverthrow70 = __toESM(require_index_cjs(), 1);
80314
80387
  var import_promises26 = require("node:fs/promises");
80315
- var import_neverthrow69 = __toESM(require_index_cjs(), 1);
80388
+ var import_neverthrow71 = __toESM(require_index_cjs(), 1);
80316
80389
  function isEmptySummary(summary) {
80317
80390
  return summary.touchedFiles.length === 0 && summary.uncommittedFiles.length === 0;
80318
80391
  }
@@ -80590,6 +80663,25 @@ function classifyActionability(summary, rawDiff) {
80590
80663
  }
80591
80664
  return { kind: "actionable" };
80592
80665
  }
80666
+ function summarizeChangeSummary(summary) {
80667
+ const hints = summary.hints.length > 0 ? summary.hints.join(",") : "none";
80668
+ return [
80669
+ `files=${String(summary.touchedFiles.length)}`,
80670
+ `uncommitted=${String(summary.uncommittedFiles.length)}`,
80671
+ `+${String(summary.addedLines)}/-${String(summary.deletedLines)}`,
80672
+ `hints=${hints}`
80673
+ ].join(" ");
80674
+ }
80675
+ function emitClassificationDebug(input) {
80676
+ if (input.emitDebug === void 0) {
80677
+ return;
80678
+ }
80679
+ if (input.kind === "empty") {
80680
+ input.emitDebug(`[plan] classification=empty reason=${input.reason ?? "unknown"}`);
80681
+ return;
80682
+ }
80683
+ input.emitDebug("[plan] classification=actionable");
80684
+ }
80593
80685
  var PORCELAIN_PATH_OFFSET = 3;
80594
80686
  var PORCELAIN_RENAME_SEPARATOR = " -> ";
80595
80687
  function extractPorcelainPath(line) {
@@ -80610,7 +80702,10 @@ function branchReferenceToString(reference) {
80610
80702
  return reference.sha;
80611
80703
  }
80612
80704
  function resolveBaseReference(context) {
80613
- return context.deps.gitSymbolicReferenceOriginHead(context.input.gitContext);
80705
+ if (context.input.baseOverride !== void 0) {
80706
+ return (0, import_neverthrow56.okAsync)(context.input.baseOverride);
80707
+ }
80708
+ return context.deps.resolveBaseBranch(context.input.gitContext);
80614
80709
  }
80615
80710
  function assertNonEmptyDiff(state) {
80616
80711
  if (isEmptySummary(state.summary)) {
@@ -80620,15 +80715,16 @@ function assertNonEmptyDiff(state) {
80620
80715
  }
80621
80716
  function emitDrafts(input) {
80622
80717
  const { context, summary } = input;
80623
- return recoverPlanMissing(context.deps.readPlan({ directory: context.input.outputDirectory })).map((entries) => toSpecSummaries(entries)).andThen(
80624
- (existingSpecs) => context.deps.emitScenarios({
80718
+ return recoverPlanMissing(context.deps.readPlan({ directory: context.input.outputDirectory })).map((entries) => toSpecSummaries(entries)).andThen((existingSpecs) => {
80719
+ context.deps.emitDebug?.(`[plan] existing-specs count=${String(existingSpecs.length)}`);
80720
+ return context.deps.emitScenarios({
80625
80721
  summary,
80626
80722
  intent: context.input.intent,
80627
80723
  appContext: context.input.appContext,
80628
80724
  existingSpecs,
80629
80725
  aiConfig: context.input.aiConfig
80630
- })
80631
- );
80726
+ });
80727
+ });
80632
80728
  }
80633
80729
  function persistScenarios(input) {
80634
80730
  return input.context.deps.writeScenarios({
@@ -80645,6 +80741,7 @@ function persistScenarios(input) {
80645
80741
  function runEmitAndPersist(input) {
80646
80742
  const { state, context } = input;
80647
80743
  return emitDrafts({ summary: state.summary, context }).andThen((drafts) => {
80744
+ context.deps.emitDebug?.(`[plan] drafts count=${String(drafts.length)}`);
80648
80745
  if (drafts.length === 0) {
80649
80746
  return (0, import_neverthrow56.okAsync)({
80650
80747
  specs: [],
@@ -80658,9 +80755,12 @@ function runEmitAndPersist(input) {
80658
80755
  }
80659
80756
  function dispatchClassification(input) {
80660
80757
  const classification = classifyActionability(input.state.summary, input.state.rawDiff);
80758
+ const emitDebug = input.context.deps.emitDebug;
80661
80759
  if (classification.kind === "empty") {
80760
+ emitClassificationDebug({ emitDebug, kind: "empty", reason: classification.reason });
80662
80761
  return (0, import_neverthrow56.okAsync)({ specs: [], emptyReason: classification.reason });
80663
80762
  }
80763
+ emitClassificationDebug({ emitDebug, kind: "actionable" });
80664
80764
  return runEmitAndPersist(input);
80665
80765
  }
80666
80766
  function combineReferences(context) {
@@ -80668,7 +80768,10 @@ function combineReferences(context) {
80668
80768
  (baseReference) => resolveHead({
80669
80769
  gitContext: context.input.gitContext,
80670
80770
  gitBranchReference: context.deps.gitBranchReference
80671
- }).map((head) => ({ baseRef: baseReference, head }))
80771
+ }).map((head) => {
80772
+ context.deps.emitDebug?.(`[plan] base=${baseReference} head=${head}`);
80773
+ return { baseRef: baseReference, head };
80774
+ })
80672
80775
  );
80673
80776
  }
80674
80777
  function buildSummaryState(context, references) {
@@ -80677,11 +80780,16 @@ function buildSummaryState(context, references) {
80677
80780
  gitContext: context.input.gitContext,
80678
80781
  gitDiff: context.deps.gitDiff,
80679
80782
  gitStatusPorcelain: context.deps.gitStatusPorcelain
80680
- }).map((collected) => ({
80681
- ...references,
80682
- rawDiff: collected.rawDiff,
80683
- summary: collected.summary
80684
- }));
80783
+ }).map((collected) => {
80784
+ context.deps.emitDebug?.(
80785
+ `[plan] diff-bytes=${String(collected.rawDiff.length)} ${summarizeChangeSummary(collected.summary)}`
80786
+ );
80787
+ return {
80788
+ ...references,
80789
+ rawDiff: collected.rawDiff,
80790
+ summary: collected.summary
80791
+ };
80792
+ });
80685
80793
  }
80686
80794
  function resolveHead(input) {
80687
80795
  return input.gitBranchReference(input.gitContext).map((reference) => branchReferenceToString(reference));
@@ -81175,6 +81283,65 @@ var rawAtomicWrite = import_neverthrow62.ResultAsync.fromThrowable(
81175
81283
  function atomicWrite(input) {
81176
81284
  return rawAtomicWrite(input).map(() => void 0).mapErr(({ cause }) => ({ type: "SPEC_WRITE_FAILED", path: input.path, cause }));
81177
81285
  }
81286
+ function toScenarioDraft2(spec) {
81287
+ const draft = {
81288
+ feature: spec.feature,
81289
+ setup: spec.setup,
81290
+ steps: spec.steps
81291
+ };
81292
+ if (spec.assertions !== void 0) {
81293
+ draft.assertions = spec.assertions;
81294
+ }
81295
+ if (spec.timeout !== void 0) {
81296
+ draft.timeout = spec.timeout;
81297
+ }
81298
+ return draft;
81299
+ }
81300
+ function toScenarioMeta2(spec) {
81301
+ return {
81302
+ scenarioId: spec.scenarioId,
81303
+ baseCommit: spec.baseCommit,
81304
+ generatedFromHead: spec.generatedFromHead,
81305
+ createdAt: spec.createdAt
81306
+ };
81307
+ }
81308
+ function toScenario(entry) {
81309
+ if (!isMetaComplete(entry.spec)) {
81310
+ return (0, import_neverthrow63.err)({
81311
+ type: "SPEC_PARSE_FAILED",
81312
+ path: entry.path,
81313
+ reason: "missing required meta field"
81314
+ });
81315
+ }
81316
+ return (0, import_neverthrow63.ok)({ ...toScenarioDraft2(entry.spec), ...toScenarioMeta2(entry.spec) });
81317
+ }
81318
+ function collectScenarios(entries) {
81319
+ const scenarios = [];
81320
+ for (const entry of entries) {
81321
+ const result = toScenario(entry);
81322
+ if (result.isErr()) {
81323
+ return (0, import_neverthrow63.err)(result.error);
81324
+ }
81325
+ scenarios.push(result.value);
81326
+ }
81327
+ return (0, import_neverthrow63.ok)(scenarios);
81328
+ }
81329
+ function buildFilesMap(entries) {
81330
+ const pairs2 = entries.flatMap((entry) => {
81331
+ const id = entry.spec.scenarioId;
81332
+ if (id === void 0) {
81333
+ return [];
81334
+ }
81335
+ return [[id, entry.path]];
81336
+ });
81337
+ return Object.fromEntries(pairs2);
81338
+ }
81339
+ function buildScenarioPair(entries) {
81340
+ return collectScenarios(entries).map((scenarios) => ({
81341
+ scenarios,
81342
+ filesByScenarioId: buildFilesMap(entries)
81343
+ }));
81344
+ }
81178
81345
  function matchByScenarioId(finding, scenario) {
81179
81346
  return finding.scenarioId !== void 0 && finding.scenarioId === scenario.scenarioId;
81180
81347
  }
@@ -81214,31 +81381,38 @@ function pickFindingsForScenario(pairs2, scenarioId) {
81214
81381
  function pickUnmatched(pairs2) {
81215
81382
  return pairs2.filter((pair) => pair.scenarioId === void 0).map((pair) => pair.finding);
81216
81383
  }
81217
- function deriveStatus(findingsForScenario) {
81218
- return findingsForScenario.length > 0 ? "has_findings" : "not_run";
81384
+ function deriveStatus(findingsForScenario, runRecord) {
81385
+ if (findingsForScenario.length > 0) {
81386
+ return "failed";
81387
+ }
81388
+ if (runRecord?.outcome === "completed") {
81389
+ return "passed";
81390
+ }
81391
+ return "not_run";
81219
81392
  }
81220
81393
  function buildCorrelatedSteps(scenario) {
81221
81394
  return scenario.steps.map((step) => ({ text: step.intent, status: "unknown" }));
81222
81395
  }
81223
81396
  function buildCorrelatedScenario(input) {
81224
- const { scenario, findings, specFilesByScenarioId } = input;
81397
+ const { scenario, findings, specFilesByScenarioId, runRecord } = input;
81225
81398
  return {
81226
81399
  scenarioId: scenario.scenarioId,
81227
81400
  file: specFilesByScenarioId?.[scenario.scenarioId] ?? "",
81228
81401
  feature: scenario.feature,
81229
- status: deriveStatus(findings),
81402
+ status: deriveStatus(findings, runRecord),
81230
81403
  steps: buildCorrelatedSteps(scenario),
81231
81404
  findings
81232
81405
  };
81233
81406
  }
81234
81407
  function correlate(input) {
81235
- const { scenarios, findings, specFilesByScenarioId } = input;
81408
+ const { scenarios, findings, specFilesByScenarioId, runRecordsByScenarioId } = input;
81236
81409
  const pairs2 = pairFindingsWithScenarios(scenarios, findings);
81237
81410
  const correlatedScenarios = scenarios.map(
81238
81411
  (scenario) => buildCorrelatedScenario({
81239
81412
  scenario,
81240
81413
  findings: pickFindingsForScenario(pairs2, scenario.scenarioId),
81241
- specFilesByScenarioId
81414
+ specFilesByScenarioId,
81415
+ runRecord: runRecordsByScenarioId?.[scenario.scenarioId]
81242
81416
  })
81243
81417
  );
81244
81418
  return {
@@ -81248,116 +81422,138 @@ function correlate(input) {
81248
81422
  }
81249
81423
  var REPORT_INDENT = 2;
81250
81424
  var REPORT_FILENAME = "report.json";
81425
+ var RUNS_FILENAME = "scenario-runs.json";
81426
+ var ENOENT_CODE = "ENOENT";
81251
81427
  var findingsArraySchema = external_exports.array(findingSchema);
81252
81428
  var safeJsonParse4 = (0, import_neverthrow61.fromThrowable)(
81253
81429
  JSON.parse,
81254
81430
  (cause) => ({ cause })
81255
81431
  );
81256
- function toScenarioDraft2(spec) {
81257
- const draft = {
81258
- feature: spec.feature,
81259
- setup: spec.setup,
81260
- steps: spec.steps
81261
- };
81262
- if (spec.assertions !== void 0) {
81263
- draft.assertions = spec.assertions;
81264
- }
81265
- if (spec.timeout !== void 0) {
81266
- draft.timeout = spec.timeout;
81267
- }
81268
- return draft;
81269
- }
81270
- function toScenarioMeta2(spec) {
81271
- return {
81272
- scenarioId: spec.scenarioId,
81273
- baseCommit: spec.baseCommit,
81274
- generatedFromHead: spec.generatedFromHead,
81275
- createdAt: spec.createdAt
81276
- };
81277
- }
81278
- function toScenario(entry) {
81279
- if (!isMetaComplete(entry.spec)) {
81280
- return (0, import_neverthrow61.err)({
81281
- type: "SPEC_PARSE_FAILED",
81282
- path: entry.path,
81283
- reason: "missing required meta field"
81284
- });
81285
- }
81286
- return (0, import_neverthrow61.ok)({ ...toScenarioDraft2(entry.spec), ...toScenarioMeta2(entry.spec) });
81287
- }
81288
- function collectScenarios(entries) {
81289
- const scenarios = [];
81290
- for (const entry of entries) {
81291
- const result = toScenario(entry);
81292
- if (result.isErr()) {
81293
- return (0, import_neverthrow61.err)(result.error);
81294
- }
81295
- scenarios.push(result.value);
81296
- }
81297
- return (0, import_neverthrow61.ok)(scenarios);
81432
+ var rawReadFile = import_neverthrow61.ResultAsync.fromThrowable(
81433
+ async (filePath) => (0, import_promises22.readFile)(filePath, "utf8"),
81434
+ (cause) => ({ cause })
81435
+ );
81436
+ function isEnoentError2(error48) {
81437
+ const nodeError = error48;
81438
+ return nodeError.code === ENOENT_CODE;
81298
81439
  }
81299
- function buildFilesMap(entries) {
81300
- const pairs2 = entries.flatMap((entry) => {
81301
- const id = entry.spec.scenarioId;
81302
- if (id === void 0) {
81303
- return [];
81440
+ function readFileOptional(filePath) {
81441
+ return rawReadFile(filePath).map((content) => content).orElse(({ cause }) => {
81442
+ if (isEnoentError2(cause)) {
81443
+ return (0, import_neverthrow61.ok)(void 0);
81304
81444
  }
81305
- return [[id, entry.path]];
81445
+ return (0, import_neverthrow61.err)({ type: "FINDINGS_READ_FAILED", path: filePath, cause });
81306
81446
  });
81307
- return Object.fromEntries(pairs2);
81308
- }
81309
- function buildScenarioPair(entries) {
81310
- return collectScenarios(entries).map((scenarios) => ({
81311
- scenarios,
81312
- filesByScenarioId: buildFilesMap(entries)
81313
- }));
81314
81447
  }
81315
81448
  function parseFindingsJson(input) {
81316
81449
  return safeJsonParse4(input.raw).mapErr(
81317
81450
  ({ cause }) => ({ type: "FINDINGS_READ_FAILED", path: input.path, cause })
81318
81451
  );
81319
81452
  }
81320
- function validateFindingsSchema(data, path43) {
81453
+ function validateFindingsSchema(data, filePath) {
81321
81454
  const parsed = findingsArraySchema.safeParse(data);
81322
81455
  if (!parsed.success) {
81323
- return (0, import_neverthrow61.err)({ type: "FINDINGS_READ_FAILED", path: path43, cause: parsed.error });
81456
+ return (0, import_neverthrow61.err)({ type: "FINDINGS_READ_FAILED", path: filePath, cause: parsed.error });
81324
81457
  }
81325
81458
  return (0, import_neverthrow61.ok)(parsed.data);
81326
81459
  }
81327
81460
  function validateFindings(input) {
81328
81461
  return parseFindingsJson(input).andThen((data) => validateFindingsSchema(data, input.path));
81329
81462
  }
81463
+ function parseRunsSchema(data, filePath) {
81464
+ const parsed = scenarioRunsFileSchema.safeParse(data);
81465
+ if (!parsed.success) {
81466
+ return (0, import_neverthrow61.err)({ type: "FINDINGS_READ_FAILED", path: filePath, cause: parsed.error });
81467
+ }
81468
+ const entries = parsed.data.records.map(
81469
+ (record2) => [record2.scenarioId, record2]
81470
+ );
81471
+ return (0, import_neverthrow61.ok)(Object.fromEntries(entries));
81472
+ }
81473
+ function parseRunsJson(raw, filePath) {
81474
+ return safeJsonParse4(raw).mapErr(({ cause }) => ({ type: "FINDINGS_READ_FAILED", path: filePath, cause })).andThen((data) => parseRunsSchema(data, filePath));
81475
+ }
81330
81476
  function reportPathFor(findingsPath) {
81331
81477
  return import_node_path19.default.join(import_node_path19.default.dirname(findingsPath), REPORT_FILENAME);
81332
81478
  }
81479
+ function runsPathFor(findingsPath, runsPath) {
81480
+ if (runsPath !== void 0) {
81481
+ return runsPath;
81482
+ }
81483
+ return import_node_path19.default.join(import_node_path19.default.dirname(findingsPath), RUNS_FILENAME);
81484
+ }
81333
81485
  function buildReport(input) {
81334
- return correlate({
81486
+ const base = {
81335
81487
  scenarios: input.pair.scenarios,
81336
81488
  findings: input.findings,
81337
81489
  specFilesByScenarioId: input.pair.filesByScenarioId
81338
- });
81490
+ };
81491
+ if (input.runRecordsByScenarioId !== void 0) {
81492
+ return correlate({ ...base, runRecordsByScenarioId: input.runRecordsByScenarioId });
81493
+ }
81494
+ return correlate(base);
81339
81495
  }
81340
81496
  function writeReport(input) {
81341
81497
  const content = JSON.stringify(input.report, void 0, REPORT_INDENT);
81342
81498
  return input.writeReportFile({ path: reportPathFor(input.findingsPath), content }).map(() => input.report);
81343
81499
  }
81344
81500
  function correlateAndPersist(input) {
81345
- const report = buildReport({ findings: input.findings, pair: input.pair });
81501
+ const report = buildReport({
81502
+ findings: input.findings,
81503
+ pair: input.pair,
81504
+ runRecordsByScenarioId: input.runRecordsByScenarioId
81505
+ });
81346
81506
  return writeReport({
81347
81507
  report,
81348
81508
  findingsPath: input.findingsPath,
81349
81509
  writeReportFile: input.writeReportFile
81350
81510
  });
81351
81511
  }
81352
- var rawReadFindings = import_neverthrow61.ResultAsync.fromThrowable(
81353
- async (filePath) => (0, import_promises22.readFile)(filePath, "utf8"),
81354
- (cause) => ({ cause })
81355
- );
81512
+ function loadRunRecords(input) {
81513
+ if (input.readRunsFileFn === void 0) {
81514
+ return import_neverthrow61.ResultAsync.fromSafePromise(
81515
+ Promise.resolve(void 0)
81516
+ );
81517
+ }
81518
+ const resolvedRunsPath = runsPathFor(input.findingsPath, input.runsPath);
81519
+ return input.readRunsFileFn(resolvedRunsPath).andThen((raw) => {
81520
+ if (raw === void 0) {
81521
+ return (0, import_neverthrow61.ok)(void 0);
81522
+ }
81523
+ return parseRunsJson(raw, resolvedRunsPath);
81524
+ });
81525
+ }
81526
+ function buildCorrelateStep(input) {
81527
+ return (runRecordsByScenarioId) => correlateAndPersist({
81528
+ findings: input.findings,
81529
+ pair: input.pair,
81530
+ findingsPath: input.findingsPath,
81531
+ runRecordsByScenarioId,
81532
+ writeReportFile: input.writeReportFile
81533
+ });
81534
+ }
81535
+ function loadAndCorrelate(input) {
81536
+ return loadRunRecords({
81537
+ findingsPath: input.findingsPath,
81538
+ runsPath: input.runsPath,
81539
+ readRunsFileFn: input.readRunsFileFn
81540
+ }).andThen(
81541
+ buildCorrelateStep({
81542
+ findings: input.findings,
81543
+ pair: input.pair,
81544
+ findingsPath: input.findingsPath,
81545
+ writeReportFile: input.writeReportFile
81546
+ })
81547
+ );
81548
+ }
81356
81549
  function readFindingsFile(filePath) {
81357
- return rawReadFindings(filePath).mapErr(
81550
+ return rawReadFile(filePath).mapErr(
81358
81551
  ({ cause }) => ({ type: "FINDINGS_READ_FAILED", path: filePath, cause })
81359
81552
  );
81360
81553
  }
81554
+ function readRunsFile(filePath) {
81555
+ return readFileOptional(filePath);
81556
+ }
81361
81557
  function writeReportFile(input) {
81362
81558
  return atomicWrite(input);
81363
81559
  }
@@ -81365,10 +81561,12 @@ function reportRun(input, deps) {
81365
81561
  return deps.readFindingsFile(input.findingsPath).andThen((raw) => validateFindings({ raw, path: input.findingsPath })).andThen(
81366
81562
  (findings) => deps.readPlan({ directory: input.specsDirectory }).andThen((entries) => buildScenarioPair(entries)).map((pair) => ({ findings, pair }))
81367
81563
  ).andThen(
81368
- ({ findings, pair }) => correlateAndPersist({
81564
+ ({ findings, pair }) => loadAndCorrelate({
81369
81565
  findings,
81370
81566
  pair,
81371
81567
  findingsPath: input.findingsPath,
81568
+ runsPath: input.runsPath,
81569
+ readRunsFileFn: deps.readRunsFile,
81372
81570
  writeReportFile: deps.writeReportFile
81373
81571
  })
81374
81572
  );
@@ -81387,13 +81585,13 @@ async function createMessage(input) {
81387
81585
  function extractText(message, operation) {
81388
81586
  const firstBlock = message.content[0];
81389
81587
  if (firstBlock?.type !== "text") {
81390
- return (0, import_neverthrow63.err)({
81588
+ return (0, import_neverthrow64.err)({
81391
81589
  type: "AI_RESPONSE_INVALID",
81392
81590
  operation,
81393
81591
  raw: JSON.stringify(message.content)
81394
81592
  });
81395
81593
  }
81396
- return (0, import_neverthrow63.ok)(firstBlock.text);
81594
+ return (0, import_neverthrow64.ok)(firstBlock.text);
81397
81595
  }
81398
81596
  function buildClient(apiKey) {
81399
81597
  return new Anthropic({ apiKey });
@@ -81401,7 +81599,7 @@ function buildClient(apiKey) {
81401
81599
  function invokeAi(arguments_) {
81402
81600
  const { input, operation } = arguments_;
81403
81601
  const client = buildClient(input.config.apiKey);
81404
- const callMessage = (0, import_neverthrow63.fromAsyncThrowable)(
81602
+ const callMessage = (0, import_neverthrow64.fromAsyncThrowable)(
81405
81603
  createMessage,
81406
81604
  (cause) => ({ type: "AI_CALL_FAILED", operation, cause })
81407
81605
  );
@@ -81452,7 +81650,7 @@ async function runGit(input) {
81452
81650
  }
81453
81651
  function execGit(commandArguments, context) {
81454
81652
  const command = `git ${commandArguments.join(" ")}`;
81455
- return (0, import_neverthrow64.fromAsyncThrowable)(
81653
+ return (0, import_neverthrow65.fromAsyncThrowable)(
81456
81654
  runGit,
81457
81655
  (cause) => toExecError(cause, command)
81458
81656
  )({ commandArguments, context });
@@ -81466,9 +81664,9 @@ function splitNonEmptyLines(value) {
81466
81664
  }
81467
81665
  function foldCommitExists(error48) {
81468
81666
  if (error48.type === "GIT_EXEC_FAILED") {
81469
- return (0, import_neverthrow64.okAsync)(false);
81667
+ return (0, import_neverthrow65.okAsync)(false);
81470
81668
  }
81471
- return (0, import_neverthrow64.errAsync)(error48);
81669
+ return (0, import_neverthrow65.errAsync)(error48);
81472
81670
  }
81473
81671
  function resolveDetachedHead(context) {
81474
81672
  return execGit(["rev-parse", "HEAD"], context).map(
@@ -81498,6 +81696,48 @@ function gitStatusPorcelain(context) {
81498
81696
  function gitSymbolicReferenceOriginHead(context) {
81499
81697
  return execGit(["symbolic-ref", "--short", "refs/remotes/origin/HEAD"], context).map((result) => stripOriginPrefix(result.stdout)).mapErr(() => ({ type: "GIT_NO_BASE_BRANCH" }));
81500
81698
  }
81699
+ var NON_INTERACTIVE_ENV = {
81700
+ PAGER: "",
81701
+ GH_PAGER: "",
81702
+ GH_FORCE_TTY: "",
81703
+ GH_PROMPT_DISABLED: "1"
81704
+ };
81705
+ var execFileAsync2 = (0, import_node_util2.promisify)(
81706
+ import_node_child_process7.execFile
81707
+ );
81708
+ function buildEnv2(context) {
81709
+ return {
81710
+ ...readProcessEnv(),
81711
+ ...NON_INTERACTIVE_ENV,
81712
+ ...context.env
81713
+ };
81714
+ }
81715
+ async function runGh(input) {
81716
+ const { stdout, stderr } = await execFileAsync2("gh", [...input.commandArguments], {
81717
+ cwd: input.context.cwd,
81718
+ env: buildEnv2(input.context)
81719
+ });
81720
+ return { stdout, stderr };
81721
+ }
81722
+ var safeRunGh = (0, import_neverthrow66.fromAsyncThrowable)(
81723
+ runGh,
81724
+ (cause) => ({ type: "GH_PR_LOOKUP_FAILED", cause })
81725
+ );
81726
+ function ghDetectPrBaseBranch(context) {
81727
+ return safeRunGh({
81728
+ commandArguments: ["pr", "view", "--json", "baseRefName", "-q", ".baseRefName"],
81729
+ context
81730
+ }).andThen((result) => {
81731
+ const value = result.stdout.trim();
81732
+ if (value.length === 0) {
81733
+ return (0, import_neverthrow66.errAsync)({ type: "GH_PR_LOOKUP_FAILED", cause: "empty-output" });
81734
+ }
81735
+ return (0, import_neverthrow66.okAsync)(value);
81736
+ });
81737
+ }
81738
+ function resolveBaseBranch(gitContext, deps) {
81739
+ return deps.ghDetectPrBaseBranch(gitContext).orElse(() => deps.gitSymbolicReferenceOriginHead(gitContext));
81740
+ }
81501
81741
  var MAX_EXISTING_SPECS = 30;
81502
81742
  function renderList(items, emptyLabel) {
81503
81743
  if (items.length === 0) {
@@ -81559,6 +81799,29 @@ ${intent || "(none provided)"}
81559
81799
 
81560
81800
  ${appContext || "(none provided)"}`;
81561
81801
  }
81802
+ function renderSetupVocabularyRule() {
81803
+ return `8. setup MUST be a canonical noun phrase \u2014 never a sentence, never instructions. Prefer these exact forms:
81804
+ - "No wallet"
81805
+ - "Wallet imported, empty"
81806
+ - "Wallet created, empty"
81807
+ - "Wallet imported, funded (any balance > 0)"
81808
+ - "Wallet created, funded (any balance > 0)"
81809
+ - "Wallet imported, holds <asset name>"
81810
+ - "Wallet imported, <feature> enabled" or "Wallet imported, <feature> disabled"
81811
+ Use "Wallet imported" when the scenario requires a known seed; use "Wallet created" when the scenario requires a freshly-generated wallet; use either when the scenario is agnostic.
81812
+ If none apply, write the shortest accurate noun phrase. Never write prose instructions in setup \u2014 those belong in steps.
81813
+
81814
+ Choose the LEAST privileged state the scenario actually requires. Scenarios MUST NOT demand more than necessary \u2014 unnecessary setup burdens the tester and masks real regressions.
81815
+
81816
+ Ordered preference (pick the earliest that still lets the scenario complete):
81817
+ 1. "No wallet" \u2014 ONLY when the flow explicitly depends on absence of a wallet (onboarding, fresh install, import/create flows)
81818
+ 2. "Wallet imported, empty" or "Wallet created, empty" \u2014 when the flow works without any balance (Settings, Profile, notifications, non-financial screens, UI warnings, theme toggles, language switcher, etc.)
81819
+ 3. "Wallet imported, funded" or "Wallet created, funded" \u2014 ONLY when the flow needs a non-zero balance to render or exercise (send flow, transaction history with populated entries, staking, swap quotes, balance-dependent UI)
81820
+ 4. "Wallet imported, holds <asset>" \u2014 ONLY when the flow needs a specific asset (asset-specific charts, asset-specific actions)
81821
+ 5. Feature flags \u2014 ONLY when the flow depends on a feature state
81822
+
81823
+ Rule of thumb: if the scenario can be completed by a user with zero balance, the setup MUST be "empty", not "funded". Demanding funded-wallet for non-financial scenarios is a bug.`;
81824
+ }
81562
81825
  function renderRulesSection() {
81563
81826
  return `## Rules
81564
81827
 
@@ -81578,7 +81841,8 @@ function renderRulesSection() {
81578
81841
  4. If the diff is rename-only or comments-only (no behavioural change), return {"scenarios": []}. Example: \`utils/foo.ts\` \u2192 \`helpers/foo.ts\` with no logic change \u2192 return {"scenarios": []}.
81579
81842
  5. Every interactive step MUST include an outcome describing the observable post-condition.
81580
81843
  6. Ground each scenario strictly in the Change Summary \u2014 do not invent flows that the touched files cannot reach.
81581
- 7. If user intent is empty, derive scenarios solely from the Change Summary. Do not speculate beyond what touched files imply.`;
81844
+ 7. If user intent is empty, derive scenarios solely from the Change Summary. Do not speculate beyond what touched files imply.
81845
+ ${renderSetupVocabularyRule()}`;
81582
81846
  }
81583
81847
  function buildScenarioEmitterPrompt(input) {
81584
81848
  const summarySection = renderSummarySection(input.summary);
@@ -81615,20 +81879,20 @@ var scenarioDraftSchema = external_exports.object({
81615
81879
  coverageNote: external_exports.string().optional()
81616
81880
  });
81617
81881
  var payloadSchema = external_exports.object({ scenarios: external_exports.array(scenarioDraftSchema) });
81618
- var safeParseJson3 = (0, import_neverthrow65.fromThrowable)(
81882
+ var safeParseJson3 = (0, import_neverthrow67.fromThrowable)(
81619
81883
  (raw) => JSON.parse(raw),
81620
81884
  () => ({ type: "AI_RESPONSE_JSON_PARSE" })
81621
81885
  );
81622
81886
  function validatePayload(raw) {
81623
81887
  const parsed = safeParseJson3(raw);
81624
81888
  if (parsed.isErr()) {
81625
- return (0, import_neverthrow65.err)({ type: "AI_RESPONSE_INVALID", operation: "scenario-emit", raw });
81889
+ return (0, import_neverthrow67.err)({ type: "AI_RESPONSE_INVALID", operation: "scenario-emit", raw });
81626
81890
  }
81627
81891
  const validated = payloadSchema.safeParse(parsed.value);
81628
81892
  if (!validated.success) {
81629
- return (0, import_neverthrow65.err)({ type: "AI_RESPONSE_INVALID", operation: "scenario-emit", raw });
81893
+ return (0, import_neverthrow67.err)({ type: "AI_RESPONSE_INVALID", operation: "scenario-emit", raw });
81630
81894
  }
81631
- return (0, import_neverthrow65.ok)(validated.data.scenarios);
81895
+ return (0, import_neverthrow67.ok)(validated.data.scenarios);
81632
81896
  }
81633
81897
  function emitScenarios(input, deps) {
81634
81898
  const prompt = buildScenarioEmitterPrompt({
@@ -81637,7 +81901,13 @@ function emitScenarios(input, deps) {
81637
81901
  appContext: input.appContext,
81638
81902
  existingSpecs: input.existingSpecs
81639
81903
  });
81640
- return deps.callAi({ prompt, config: input.aiConfig }).andThen((raw) => validatePayload(raw));
81904
+ deps.emitDebug?.(`[plan] prompt chars=${String(prompt.length)}
81905
+ ${prompt}`);
81906
+ return deps.callAi({ prompt, config: input.aiConfig }).andThen((raw) => {
81907
+ deps.emitDebug?.(`[plan] ai-response chars=${String(raw.length)}
81908
+ ${raw}`);
81909
+ return validatePayload(raw);
81910
+ });
81641
81911
  }
81642
81912
  function renderExistingSpecSection(existingSpec) {
81643
81913
  const feature = existingSpec.feature;
@@ -81704,14 +81974,14 @@ function validateCandidate(validateInput) {
81704
81974
  const { raw, existingSpec, specPath } = validateInput;
81705
81975
  const parsed = parseSpec(raw, specPath);
81706
81976
  if (parsed.isErr()) {
81707
- return (0, import_neverthrow66.err)({ type: "AI_RESPONSE_INVALID", operation: "edit-apply", raw });
81977
+ return (0, import_neverthrow68.err)({ type: "AI_RESPONSE_INVALID", operation: "edit-apply", raw });
81708
81978
  }
81709
81979
  const candidate = parsed.value;
81710
81980
  const violated = findMissingOrChangedKey(candidate, existingSpec);
81711
81981
  if (violated !== void 0) {
81712
- return (0, import_neverthrow66.err)({ type: "SCENARIO_ID_LOST_IN_EDIT", path: specPath });
81982
+ return (0, import_neverthrow68.err)({ type: "SCENARIO_ID_LOST_IN_EDIT", path: specPath });
81713
81983
  }
81714
- return (0, import_neverthrow66.ok)(candidate);
81984
+ return (0, import_neverthrow68.ok)(candidate);
81715
81985
  }
81716
81986
  function applyEdit(input, deps) {
81717
81987
  const prompt = buildEditApplierPrompt(input.existingSpec, input.userFeedback);
@@ -81729,19 +81999,19 @@ function mapReaddirError(input) {
81729
81999
  }
81730
82000
  return { type: "SPEC_READ_FAILED", path: input.directory, cause: input.cause };
81731
82001
  }
81732
- var rawReaddir = import_neverthrow67.ResultAsync.fromThrowable(
82002
+ var rawReaddir = import_neverthrow69.ResultAsync.fromThrowable(
81733
82003
  async (directory) => (0, import_promises24.readdir)(directory),
81734
82004
  (cause) => ({ cause })
81735
82005
  );
81736
82006
  function safeReaddir(directory) {
81737
82007
  return rawReaddir(directory).mapErr(({ cause }) => mapReaddirError({ directory, cause }));
81738
82008
  }
81739
- var rawReadFile = import_neverthrow67.ResultAsync.fromThrowable(
82009
+ var rawReadFile2 = import_neverthrow69.ResultAsync.fromThrowable(
81740
82010
  async (input) => (0, import_promises24.readFile)(input.path, "utf8"),
81741
82011
  (cause) => ({ cause })
81742
82012
  );
81743
82013
  function safeReadFile3(input) {
81744
- return rawReadFile(input).mapErr(
82014
+ return rawReadFile2(input).mapErr(
81745
82015
  ({ cause }) => ({ type: "SPEC_READ_FAILED", path: input.path, cause })
81746
82016
  );
81747
82017
  }
@@ -81756,17 +82026,17 @@ function readEntry2(input) {
81756
82026
  }
81757
82027
  function readEntries2(directory, filenames) {
81758
82028
  const tasks = filenames.map((filename) => readEntry2({ directory, filename }));
81759
- return import_neverthrow67.ResultAsync.combine([...tasks]);
82029
+ return import_neverthrow69.ResultAsync.combine([...tasks]);
81760
82030
  }
81761
82031
  function readPlan(input) {
81762
82032
  return safeReaddir(input.directory).map((filenames) => filterAndSortSpecs(filenames)).andThen((filenames) => readEntries2(input.directory, filenames));
81763
82033
  }
81764
82034
  var SCENARIO_FILENAME_PATTERN = /^scenario-(\d+)\.test\.md$/;
81765
- var safeMkdir = import_neverthrow68.ResultAsync.fromThrowable(
82035
+ var safeMkdir = import_neverthrow70.ResultAsync.fromThrowable(
81766
82036
  async (path43) => (0, import_promises25.mkdir)(path43, { recursive: true }),
81767
82037
  (cause) => ({ type: "SPEC_WRITE_FAILED", path: "", cause })
81768
82038
  );
81769
- var safeReaddir2 = import_neverthrow68.ResultAsync.fromThrowable(
82039
+ var safeReaddir2 = import_neverthrow70.ResultAsync.fromThrowable(
81770
82040
  async (path43) => (0, import_promises25.readdir)(path43),
81771
82041
  (cause) => ({ type: "SPEC_WRITE_FAILED", path: "", cause })
81772
82042
  );
@@ -81817,12 +82087,12 @@ function writeAllScenarios(input, startIndex) {
81817
82087
  context: input.context
81818
82088
  })
81819
82089
  );
81820
- return import_neverthrow68.ResultAsync.combine([...tasks]);
82090
+ return import_neverthrow70.ResultAsync.combine([...tasks]);
81821
82091
  }
81822
82092
  function writeScenarios(input) {
81823
82093
  return ensureDirectory(input.directory).andThen(() => listScenarioIndices(input.directory)).map((indices) => computeNextIndex(indices)).andThen((startIndex) => writeAllScenarios(input, startIndex));
81824
82094
  }
81825
- var readFileByPath = import_neverthrow69.ResultAsync.fromThrowable(
82095
+ var readFileByPath = import_neverthrow71.ResultAsync.fromThrowable(
81826
82096
  async (path43) => (0, import_promises26.readFile)(path43, "utf8"),
81827
82097
  (cause) => ({ cause })
81828
82098
  );
@@ -81858,10 +82128,10 @@ var EXIT_PLAN_EMPTY = 45;
81858
82128
  var EXIT_SCENARIO_ID_LOST_IN_EDIT = 51;
81859
82129
 
81860
82130
  // src/commands/plan/format-diagnostic.ts
81861
- var import_neverthrow70 = __toESM(require_index_cjs(), 1);
82131
+ var import_neverthrow72 = __toESM(require_index_cjs(), 1);
81862
82132
  var RAW_TRUNCATION_LIMIT = 200;
81863
82133
  var UNSERIALIZABLE2 = "[unserializable]";
81864
- var safeStringify2 = (0, import_neverthrow70.fromThrowable)(
82134
+ var safeStringify2 = (0, import_neverthrow72.fromThrowable)(
81865
82135
  (value) => JSON.stringify(value),
81866
82136
  () => UNSERIALIZABLE2
81867
82137
  );
@@ -82106,15 +82376,23 @@ function runPlanExtend(input, options2) {
82106
82376
  }
82107
82377
 
82108
82378
  // src/commands/plan/generate-command.ts
82109
- var DEPS3 = {
82110
- gitBranchReference,
82111
- gitSymbolicReferenceOriginHead,
82112
- gitDiff,
82113
- gitStatusPorcelain,
82114
- emitScenarios: (input) => emitScenarios(input, { callAi: callScenarioEmitter }),
82115
- writeScenarios,
82116
- readPlan
82117
- };
82379
+ function stderrDebug(message) {
82380
+ process.stderr.write(`${message}
82381
+ `);
82382
+ }
82383
+ function buildDeps(input) {
82384
+ const emitDebug = input.debug === true ? stderrDebug : void 0;
82385
+ return {
82386
+ gitBranchReference,
82387
+ resolveBaseBranch: (gitContext) => resolveBaseBranch(gitContext, { ghDetectPrBaseBranch, gitSymbolicReferenceOriginHead }),
82388
+ gitDiff,
82389
+ gitStatusPorcelain,
82390
+ emitScenarios: (emitInput) => emitScenarios(emitInput, { callAi: callScenarioEmitter, emitDebug }),
82391
+ writeScenarios,
82392
+ readPlan,
82393
+ emitDebug
82394
+ };
82395
+ }
82118
82396
  function buildPlannerInput3(arguments_, appContext) {
82119
82397
  return {
82120
82398
  gitContext: { cwd: process.cwd() },
@@ -82129,12 +82407,13 @@ function buildPlannerInput3(arguments_, appContext) {
82129
82407
  model: PLANNER_MODEL
82130
82408
  },
82131
82409
  idGenerator: () => ulid3(),
82132
- now: () => (/* @__PURE__ */ new Date()).toISOString()
82410
+ now: () => (/* @__PURE__ */ new Date()).toISOString(),
82411
+ baseOverride: arguments_.input.baseOverride
82133
82412
  };
82134
82413
  }
82135
82414
  function executePipeline4(arguments_) {
82136
82415
  return readAppContextOrDiagnose(arguments_.input.xqaDirectory).andThen(
82137
- (appContext) => generatePlan(buildPlannerInput3(arguments_, appContext ?? ""), DEPS3)
82416
+ (appContext) => generatePlan(buildPlannerInput3(arguments_, appContext ?? ""), buildDeps(arguments_.input))
82138
82417
  );
82139
82418
  }
82140
82419
  function runPlanGenerate(input, options2) {
@@ -82143,32 +82422,44 @@ function runPlanGenerate(input, options2) {
82143
82422
 
82144
82423
  // src/commands/plan/report-command.ts
82145
82424
  var import_node_path24 = __toESM(require("node:path"), 1);
82146
- var DEPS4 = {
82425
+ var DEPS3 = {
82147
82426
  readPlan,
82148
82427
  readFindingsFile,
82149
- writeReportFile
82428
+ writeReportFile,
82429
+ readRunsFile
82150
82430
  };
82151
82431
  function buildReportInput(input) {
82152
- return {
82153
- findingsPath: import_node_path24.default.resolve(process.cwd(), input.findingsPath),
82432
+ const resolvedFindingsPath = import_node_path24.default.resolve(process.cwd(), input.findingsPath);
82433
+ const base = {
82434
+ findingsPath: resolvedFindingsPath,
82154
82435
  specsDirectory: resolveOutputDirectory(input.xqaDirectory, input.specsDirectory)
82155
82436
  };
82437
+ if (input.runsPath !== void 0) {
82438
+ return { ...base, runsPath: import_node_path24.default.resolve(process.cwd(), input.runsPath) };
82439
+ }
82440
+ return base;
82156
82441
  }
82157
82442
  function executePipeline5(input) {
82158
- return reportRun(buildReportInput(input), DEPS4);
82443
+ return reportRun(buildReportInput(input), DEPS3);
82159
82444
  }
82160
82445
  function runPlanReport(input) {
82161
82446
  void executePipeline5(input).match(emitSuccess, emitFailure);
82162
82447
  }
82163
82448
 
82164
82449
  // src/commands/register/plan.ts
82450
+ function normalizeBaseOverride(value) {
82451
+ const trimmed = value?.trim();
82452
+ return trimmed !== void 0 && trimmed.length > 0 ? trimmed : void 0;
82453
+ }
82165
82454
  function invokePlanGenerate(context, options2) {
82166
82455
  const xqaDirectory = resolveXqaDirectory();
82167
82456
  runPlanGenerate(
82168
82457
  {
82169
82458
  intent: options2.intent ?? "",
82170
82459
  outputDirectory: options2.out,
82171
- xqaDirectory
82460
+ xqaDirectory,
82461
+ baseOverride: normalizeBaseOverride(options2.base),
82462
+ debug: options2.debug
82172
82463
  },
82173
82464
  { config: context.config }
82174
82465
  );
@@ -82182,7 +82473,12 @@ function invokePlanExtend(context, options2) {
82182
82473
  }
82183
82474
  function invokePlanReport(options2) {
82184
82475
  const xqaDirectory = resolveXqaDirectory();
82185
- runPlanReport({ findingsPath: options2.findings, specsDirectory: options2.specs, xqaDirectory });
82476
+ const base = { findingsPath: options2.findings, specsDirectory: options2.specs, xqaDirectory };
82477
+ if (options2.runs !== void 0) {
82478
+ runPlanReport({ ...base, runsPath: options2.runs });
82479
+ return;
82480
+ }
82481
+ runPlanReport(base);
82186
82482
  }
82187
82483
  function registerExtendSubcommand(plan, loader2) {
82188
82484
  plan.command("extend").description("Append new scenarios to the existing plan for commits since the last generation").option("--intent <text>", "Optional focus hint for the planner", "").option("--out <dir>", "Plan directory (default: <xqa>/test-plan/default)").action((options2) => {
@@ -82197,12 +82493,12 @@ function registerEditSubcommand(plan, loader2) {
82197
82493
  });
82198
82494
  }
82199
82495
  function registerReportSubcommand(plan) {
82200
- plan.command("report").description("Correlate findings with scenarios and write a report.json").requiredOption("--findings <path>", "Path to the findings.json to correlate").option("--specs <dir>", "Scenarios directory (default: <xqa>/test-plan/default)").action((options2) => {
82496
+ plan.command("report").description("Correlate findings with scenarios and write a report.json").requiredOption("--findings <path>", "Path to the findings.json to correlate").option("--specs <dir>", "Scenarios directory (default: <xqa>/test-plan/default)").option("--runs <path>", "Path to scenario-runs.json (auto-discovered next to findings.json)").action((options2) => {
82201
82497
  invokePlanReport(options2);
82202
82498
  });
82203
82499
  }
82204
82500
  function registerPlanCommand(program3, loader2) {
82205
- const plan = program3.command("plan").description("Generate or evolve the manual test plan for the current branch").option("--intent <text>", "Optional focus hint for the planner", "").option("--out <dir>", "Output directory for the generated scenarios").action((options2) => {
82501
+ const plan = program3.command("plan").description("Generate or evolve the manual test plan for the current branch").option("--intent <text>", "Optional focus hint for the planner", "").option("--out <dir>", "Output directory for the generated scenarios").option("--base <ref>", "Base git ref to diff against (defaults to origin/HEAD)").option("--debug", "Log base ref, diff summary, prompt, and AI response to stderr").action((options2) => {
82206
82502
  const context = resolveContextOrExit(loader2);
82207
82503
  invokePlanGenerate(context, options2);
82208
82504
  });
@@ -82214,7 +82510,7 @@ function registerPlanCommand(program3, loader2) {
82214
82510
  // src/commands/review-command.ts
82215
82511
  var import_node_fs10 = require("node:fs");
82216
82512
  var import_node_path26 = __toESM(require("node:path"), 1);
82217
- var import_neverthrow72 = __toESM(require_index_cjs(), 1);
82513
+ var import_neverthrow74 = __toESM(require_index_cjs(), 1);
82218
82514
 
82219
82515
  // ../../node_modules/.pnpm/@inquirer+core@10.3.2_@types+node@22.19.15/node_modules/@inquirer/core/dist/esm/lib/key.js
82220
82516
  var isUpKey = (key, keybindings = []) => (
@@ -83165,7 +83461,7 @@ var {
83165
83461
  } = signalExitWrap(processOk(process5) ? new SignalExit(process5) : new SignalExitFallback());
83166
83462
 
83167
83463
  // ../../node_modules/.pnpm/@inquirer+core@10.3.2_@types+node@22.19.15/node_modules/@inquirer/core/dist/esm/lib/screen-manager.js
83168
- var import_node_util2 = require("node:util");
83464
+ var import_node_util3 = require("node:util");
83169
83465
 
83170
83466
  // ../../node_modules/.pnpm/@inquirer+ansi@1.0.2/node_modules/@inquirer/ansi/dist/esm/index.js
83171
83467
  var ESC2 = "\x1B[";
@@ -83203,7 +83499,7 @@ var ScreenManager = class {
83203
83499
  }
83204
83500
  render(content, bottomContent = "") {
83205
83501
  const promptLine = lastLine(content);
83206
- const rawPromptLine = (0, import_node_util2.stripVTControlCharacters)(promptLine);
83502
+ const rawPromptLine = (0, import_node_util3.stripVTControlCharacters)(promptLine);
83207
83503
  let prompt = rawPromptLine;
83208
83504
  if (this.rl.line.length > 0) {
83209
83505
  prompt = prompt.slice(0, -this.rl.line.length);
@@ -83596,9 +83892,9 @@ var RemoveFileError = class extends Error {
83596
83892
  // ../../node_modules/.pnpm/@inquirer+external-editor@1.0.3_@types+node@22.19.15/node_modules/@inquirer/external-editor/dist/esm/index.js
83597
83893
  function editAsync(text = "", callback, fileOptions) {
83598
83894
  const editor = new ExternalEditor(text, fileOptions);
83599
- editor.runAsync((err40, result) => {
83600
- if (err40) {
83601
- setImmediate(callback, err40, void 0);
83895
+ editor.runAsync((err41, result) => {
83896
+ if (err41) {
83897
+ setImmediate(callback, err41, void 0);
83602
83898
  } else {
83603
83899
  try {
83604
83900
  editor.cleanup();
@@ -84619,7 +84915,7 @@ var esm_default11 = createPrompt((config2, done) => {
84619
84915
  });
84620
84916
 
84621
84917
  // src/review-session.ts
84622
- var import_neverthrow71 = __toESM(require_index_cjs(), 1);
84918
+ var import_neverthrow73 = __toESM(require_index_cjs(), 1);
84623
84919
  var FLOW_COL_WIDTH = 35;
84624
84920
  var TRIGGER_COL_WIDTH = 16;
84625
84921
  var CONFIDENCE_COL_WIDTH = 6;
@@ -84767,15 +85063,15 @@ async function runInteractiveLoop(findings, existing) {
84767
85063
  }
84768
85064
  return { staged: state.staged, undoneKeys: state.undoneKeys };
84769
85065
  }
84770
- var safeRunInteractiveLoop = (0, import_neverthrow71.fromAsyncThrowable)(
85066
+ var safeRunInteractiveLoop = (0, import_neverthrow73.fromAsyncThrowable)(
84771
85067
  runInteractiveLoop,
84772
85068
  (error48) => error48 instanceof Error && error48.name === "ExitPromptError" ? "exit-prompt" : "unexpected"
84773
85069
  );
84774
85070
 
84775
85071
  // src/commands/review-command.ts
84776
- var safeReadFile4 = (0, import_neverthrow72.fromThrowable)((filePath) => (0, import_node_fs10.readFileSync)(filePath, "utf8"));
84777
- var safeParseJson4 = (0, import_neverthrow72.fromThrowable)(JSON.parse);
84778
- var safeWrite = (0, import_neverthrow72.fromThrowable)((filePath, content) => {
85072
+ var safeReadFile4 = (0, import_neverthrow74.fromThrowable)((filePath) => (0, import_node_fs10.readFileSync)(filePath, "utf8"));
85073
+ var safeParseJson4 = (0, import_neverthrow74.fromThrowable)(JSON.parse);
85074
+ var safeWrite = (0, import_neverthrow74.fromThrowable)((filePath, content) => {
84779
85075
  (0, import_node_fs10.writeFileSync)(filePath, content);
84780
85076
  });
84781
85077
  function readLastPath(xqaDirectory) {
@@ -84792,13 +85088,13 @@ function isPipelineOutput(data) {
84792
85088
  function readFindings(filePath) {
84793
85089
  const readResult = safeReadFile4(filePath);
84794
85090
  if (readResult.isErr()) {
84795
- return (0, import_neverthrow72.err)("not-found");
85091
+ return (0, import_neverthrow74.err)("not-found");
84796
85092
  }
84797
85093
  return safeParseJson4(readResult.value).mapErr(() => "invalid").andThen((data) => {
84798
85094
  if (!isPipelineOutput(data)) {
84799
- return (0, import_neverthrow72.err)("invalid");
85095
+ return (0, import_neverthrow74.err)("invalid");
84800
85096
  }
84801
- return (0, import_neverthrow72.ok)(data);
85097
+ return (0, import_neverthrow74.ok)(data);
84802
85098
  });
84803
85099
  }
84804
85100
  function loadExistingDismissals(filePath) {
@@ -84871,7 +85167,7 @@ function resolveAndReadFindings(findingsPath, xqaDirectory) {
84871
85167
  "No findings path provided and no last path found. Run: xqa review <findings-path>\n"
84872
85168
  );
84873
85169
  process.exit(1);
84874
- return (0, import_neverthrow72.err)();
85170
+ return (0, import_neverthrow74.err)();
84875
85171
  }
84876
85172
  const resolvedPath = resolvedPathResult.value;
84877
85173
  const findingsResult = readFindings(resolvedPath);
@@ -84884,9 +85180,9 @@ function resolveAndReadFindings(findingsPath, xqaDirectory) {
84884
85180
  `);
84885
85181
  }
84886
85182
  process.exit(1);
84887
- return (0, import_neverthrow72.err)();
85183
+ return (0, import_neverthrow74.err)();
84888
85184
  }
84889
- return (0, import_neverthrow72.ok)({ resolvedPath, output: findingsResult.value });
85185
+ return (0, import_neverthrow74.ok)({ resolvedPath, output: findingsResult.value });
84890
85186
  }
84891
85187
  async function runReviewLoop({
84892
85188
  findings,
@@ -84959,11 +85255,11 @@ function discoverSimulators(udidOverride) {
84959
85255
  var import_promises27 = __toESM(require("node:fs/promises"), 1);
84960
85256
  var import_node_path27 = __toESM(require("node:path"), 1);
84961
85257
  var import_fast_glob = __toESM(require_out4(), 1);
84962
- var import_neverthrow75 = __toESM(require_index_cjs(), 1);
85258
+ var import_neverthrow77 = __toESM(require_index_cjs(), 1);
84963
85259
 
84964
85260
  // src/suite/core/suite-config-parser.ts
84965
- var import_neverthrow73 = __toESM(require_index_cjs(), 1);
84966
- var import_neverthrow74 = __toESM(require_index_cjs(), 1);
85261
+ var import_neverthrow75 = __toESM(require_index_cjs(), 1);
85262
+ var import_neverthrow76 = __toESM(require_index_cjs(), 1);
84967
85263
  var RESERVED_HOOK_ENV_KEYS = [
84968
85264
  "XQA_SIM_UDID",
84969
85265
  "XQA_ITEM_ID",
@@ -85015,7 +85311,7 @@ var suiteConfigSchema = external_exports.object({
85015
85311
  }).refine((data) => data.specs.length > 0 || data.freestyle.length > 0, {
85016
85312
  message: "Suite must declare at least one spec or freestyle entry"
85017
85313
  });
85018
- var safeJsonParse5 = (0, import_neverthrow73.fromThrowable)(
85314
+ var safeJsonParse5 = (0, import_neverthrow75.fromThrowable)(
85019
85315
  JSON.parse,
85020
85316
  (cause) => ({
85021
85317
  type: "INVALID_SUITE_CONFIG",
@@ -85049,16 +85345,16 @@ function parseSuiteConfig(raw) {
85049
85345
  return safeJsonParse5(raw).andThen((data) => {
85050
85346
  const parsed = suiteConfigSchema.safeParse(data);
85051
85347
  if (!parsed.success) {
85052
- return (0, import_neverthrow74.err)({ type: "INVALID_SUITE_CONFIG", cause: parsed.error });
85348
+ return (0, import_neverthrow76.err)({ type: "INVALID_SUITE_CONFIG", cause: parsed.error });
85053
85349
  }
85054
85350
  const hooks = normalizeHooks(parsed.data.hooks);
85055
85351
  if (hooks === void 0) {
85056
- return (0, import_neverthrow74.ok)({
85352
+ return (0, import_neverthrow76.ok)({
85057
85353
  specs: parsed.data.specs,
85058
85354
  freestyle: parsed.data.freestyle
85059
85355
  });
85060
85356
  }
85061
- return (0, import_neverthrow74.ok)({
85357
+ return (0, import_neverthrow76.ok)({
85062
85358
  specs: parsed.data.specs,
85063
85359
  freestyle: parsed.data.freestyle,
85064
85360
  hooks
@@ -85106,7 +85402,7 @@ function buildFreestyleItems(entries) {
85106
85402
  }
85107
85403
 
85108
85404
  // src/suite/commands/run/resolve-work-items.ts
85109
- var safeReadFile5 = import_neverthrow75.ResultAsync.fromThrowable(
85405
+ var safeReadFile5 = import_neverthrow77.ResultAsync.fromThrowable(
85110
85406
  async (filePath) => import_promises27.default.readFile(filePath, "utf8"),
85111
85407
  () => "READ_FAILED"
85112
85408
  );
@@ -85174,7 +85470,7 @@ async function resolveAndFilterItems(input) {
85174
85470
  }
85175
85471
 
85176
85472
  // src/suite/shell/worker-pool.ts
85177
- var import_neverthrow78 = __toESM(require_index_cjs(), 1);
85473
+ var import_neverthrow80 = __toESM(require_index_cjs(), 1);
85178
85474
 
85179
85475
  // src/suite/core/priority-queue.ts
85180
85476
  var PriorityQueue = class {
@@ -85421,7 +85717,7 @@ function recordHookFailure(input) {
85421
85717
  }
85422
85718
 
85423
85719
  // src/suite/shell/hook-invoker.ts
85424
- var import_neverthrow77 = __toESM(require_index_cjs(), 1);
85720
+ var import_neverthrow79 = __toESM(require_index_cjs(), 1);
85425
85721
 
85426
85722
  // src/suite/core/hook-env-builder.ts
85427
85723
  function buildReservedKeys(input) {
@@ -85447,8 +85743,8 @@ function buildHookEnv(input) {
85447
85743
  }
85448
85744
 
85449
85745
  // src/suite/shell/hook-runner.ts
85450
- var import_node_child_process7 = require("node:child_process");
85451
- var import_neverthrow76 = __toESM(require_index_cjs(), 1);
85746
+ var import_node_child_process8 = require("node:child_process");
85747
+ var import_neverthrow78 = __toESM(require_index_cjs(), 1);
85452
85748
  function makeDeferred() {
85453
85749
  const raw = Promise.withResolvers();
85454
85750
  return { promise: raw.promise, resolve: raw.resolve };
@@ -85468,7 +85764,7 @@ var HookRuntime = class {
85468
85764
  onAbort;
85469
85765
  constructor(options2) {
85470
85766
  const { script, cwd, env: env3, baseEnv, nodeExecPath, timeoutMs, signal } = options2;
85471
- this.child = (0, import_node_child_process7.spawn)(nodeExecPath, [script], {
85767
+ this.child = (0, import_node_child_process8.spawn)(nodeExecPath, [script], {
85472
85768
  cwd,
85473
85769
  env: { ...baseEnv, ...env3 },
85474
85770
  stdio: ["ignore", "inherit", "pipe"]
@@ -85478,7 +85774,7 @@ var HookRuntime = class {
85478
85774
  this.deferred = makeDeferred();
85479
85775
  this.onAbort = () => {
85480
85776
  this.child.kill("SIGTERM");
85481
- this.settle((0, import_neverthrow76.err)({ type: "HOOK_ABORTED" }));
85777
+ this.settle((0, import_neverthrow78.err)({ type: "HOOK_ABORTED" }));
85482
85778
  };
85483
85779
  }
85484
85780
  async start() {
@@ -85503,20 +85799,20 @@ var HookRuntime = class {
85503
85799
  attachTimeout() {
85504
85800
  this.timeoutHandle = setTimeout(() => {
85505
85801
  this.child.kill("SIGTERM");
85506
- this.settle((0, import_neverthrow76.err)({ type: "HOOK_TIMEOUT", timeoutMs: this.timeoutMs }));
85802
+ this.settle((0, import_neverthrow78.err)({ type: "HOOK_TIMEOUT", timeoutMs: this.timeoutMs }));
85507
85803
  }, this.timeoutMs);
85508
85804
  }
85509
85805
  attachChildListeners() {
85510
85806
  this.child.on("error", (cause) => {
85511
- this.settle((0, import_neverthrow76.err)({ type: "HOOK_SPAWN_FAILED", cause }));
85807
+ this.settle((0, import_neverthrow78.err)({ type: "HOOK_SPAWN_FAILED", cause }));
85512
85808
  });
85513
85809
  this.child.on("exit", (code) => {
85514
85810
  if (code === 0) {
85515
- this.settle((0, import_neverthrow76.ok)());
85811
+ this.settle((0, import_neverthrow78.ok)());
85516
85812
  return;
85517
85813
  }
85518
85814
  this.settle(
85519
- (0, import_neverthrow76.err)({
85815
+ (0, import_neverthrow78.err)({
85520
85816
  type: "HOOK_EXIT_NONZERO",
85521
85817
  code: code ?? -1,
85522
85818
  stderr: this.stderrBuffer
@@ -85539,7 +85835,7 @@ var HookRuntime = class {
85539
85835
  this.signal.removeEventListener("abort", this.onAbort);
85540
85836
  }
85541
85837
  };
85542
- var safeSpawn = import_neverthrow76.ResultAsync.fromThrowable(
85838
+ var safeSpawn = import_neverthrow78.ResultAsync.fromThrowable(
85543
85839
  spawnHook,
85544
85840
  (cause) => ({ type: "HOOK_SPAWN_FAILED", cause })
85545
85841
  );
@@ -85567,7 +85863,7 @@ async function invokeHook(input) {
85567
85863
  async function maybeInvokeHook(input) {
85568
85864
  const { hook: hook2 } = input;
85569
85865
  if (hook2 === void 0) {
85570
- return (0, import_neverthrow77.ok)();
85866
+ return (0, import_neverthrow79.ok)();
85571
85867
  }
85572
85868
  return invokeHook({ ...input, hook: hook2 });
85573
85869
  }
@@ -85661,7 +85957,7 @@ async function processItem(workerContext, item) {
85661
85957
  workerContext.inFlight.delete(item.id);
85662
85958
  return failCount;
85663
85959
  }
85664
- var safeProcessItem = import_neverthrow78.ResultAsync.fromThrowable(
85960
+ var safeProcessItem = import_neverthrow80.ResultAsync.fromThrowable(
85665
85961
  processItem,
85666
85962
  (cause) => ({
85667
85963
  type: "PROCESS_ITEM_FAILED",
@@ -85726,7 +86022,7 @@ function runWorkerPool(config2) {
85726
86022
  const results = [];
85727
86023
  const inFlight = /* @__PURE__ */ new Map();
85728
86024
  const suiteStartMs = Date.now();
85729
- const safeRun = import_neverthrow78.ResultAsync.fromThrowable(
86025
+ const safeRun = import_neverthrow80.ResultAsync.fromThrowable(
85730
86026
  async () => runAllWorkers({ config: config2, queue, results, suiteStartMs, inFlight }),
85731
86027
  (cause) => ({ type: "WORKER_POOL_FAILED", cause })
85732
86028
  );
@@ -85870,6 +86166,44 @@ async function runPool(input) {
85870
86166
  return poolResult;
85871
86167
  }
85872
86168
 
86169
+ // src/suite/core/scenario-run-builder.ts
86170
+ var ITEM_STATUS_TO_OUTCOME = {
86171
+ completed: "completed",
86172
+ failed: "errored",
86173
+ timeout: "timed_out",
86174
+ aborted: "aborted"
86175
+ };
86176
+ function computeFinishedAt(startedAt, durationMs) {
86177
+ return new Date(new Date(startedAt).getTime() + durationMs).toISOString();
86178
+ }
86179
+ function buildRunRecord(input) {
86180
+ const { item, scenarioIdBySpecPath } = input;
86181
+ if (item.specPath === null) {
86182
+ return void 0;
86183
+ }
86184
+ const scenarioId = scenarioIdBySpecPath[item.specPath];
86185
+ if (scenarioId === void 0) {
86186
+ return void 0;
86187
+ }
86188
+ return {
86189
+ scenarioId,
86190
+ specPath: item.specPath,
86191
+ outcome: ITEM_STATUS_TO_OUTCOME[item.status],
86192
+ startedAt: item.startedAt,
86193
+ finishedAt: computeFinishedAt(item.startedAt, item.durationMs)
86194
+ };
86195
+ }
86196
+ function buildScenarioRunsFile(items, scenarioIdBySpecPath) {
86197
+ const records = items.flatMap((item) => {
86198
+ const record2 = buildRunRecord({ item, scenarioIdBySpecPath });
86199
+ if (record2 === void 0) {
86200
+ return [];
86201
+ }
86202
+ return [record2];
86203
+ });
86204
+ return { version: 1, records };
86205
+ }
86206
+
85873
86207
  // src/suite/core/suite-findings-builder.ts
85874
86208
  function buildSuiteFindings(input) {
85875
86209
  const base = { suiteId: input.suiteId, runId: input.runId, items: input.items };
@@ -85879,10 +86213,52 @@ function buildSuiteFindings(input) {
85879
86213
  return base;
85880
86214
  }
85881
86215
 
86216
+ // src/suite/shell/spec-scenario-id-reader.ts
86217
+ var import_promises28 = require("node:fs/promises");
86218
+ var import_neverthrow81 = __toESM(require_index_cjs(), 1);
86219
+ var safeReadFile6 = import_neverthrow81.ResultAsync.fromThrowable(
86220
+ async (filePath) => (0, import_promises28.readFile)(filePath, "utf8"),
86221
+ (cause) => ({ specPath: "", cause })
86222
+ );
86223
+ function extractScenarioId(specPath, raw) {
86224
+ return parseSpec(raw, specPath).match(
86225
+ (spec) => spec.scenarioId,
86226
+ () => void 0
86227
+ );
86228
+ }
86229
+ function readOneSpecEntry(specPath) {
86230
+ return safeReadFile6(specPath).mapErr(
86231
+ ({ cause }) => ({
86232
+ type: "SPEC_SCENARIO_ID_READ_FAILED",
86233
+ specPath,
86234
+ cause
86235
+ })
86236
+ ).map((raw) => [specPath, extractScenarioId(specPath, raw)]);
86237
+ }
86238
+ function entriesToRecord(results) {
86239
+ const entries = [];
86240
+ for (const result of results) {
86241
+ if (result.isErr()) {
86242
+ return (0, import_neverthrow81.err)(result.error);
86243
+ }
86244
+ entries.push(result.value);
86245
+ }
86246
+ return (0, import_neverthrow81.ok)(Object.fromEntries(entries));
86247
+ }
86248
+ function readScenarioIdsBySpecPaths(specPaths) {
86249
+ if (specPaths.length === 0) {
86250
+ return import_neverthrow81.ResultAsync.fromSafePromise(Promise.resolve({}));
86251
+ }
86252
+ const awaitAll = import_neverthrow81.ResultAsync.fromSafePromise(
86253
+ Promise.all(specPaths.map((specPath) => readOneSpecEntry(specPath)))
86254
+ );
86255
+ return awaitAll.andThen(entriesToRecord);
86256
+ }
86257
+
85882
86258
  // src/suite/shell/suite-findings-writer.ts
85883
- var import_promises28 = __toESM(require("node:fs/promises"), 1);
86259
+ var import_promises29 = __toESM(require("node:fs/promises"), 1);
85884
86260
  var import_node_path29 = __toESM(require("node:path"), 1);
85885
- var import_neverthrow79 = __toESM(require_index_cjs(), 1);
86261
+ var import_neverthrow82 = __toESM(require_index_cjs(), 1);
85886
86262
  var INDENT_SPACES = 2;
85887
86263
  function writeSuiteFindings(findings, options2) {
85888
86264
  const directory = import_node_path29.default.join(
@@ -85894,11 +86270,11 @@ function writeSuiteFindings(findings, options2) {
85894
86270
  );
85895
86271
  const finalPath = import_node_path29.default.join(directory, "findings.json");
85896
86272
  const temporaryPath = `${finalPath}.tmp`;
85897
- const safeWriteAtomically = import_neverthrow79.ResultAsync.fromThrowable(
86273
+ const safeWriteAtomically = import_neverthrow82.ResultAsync.fromThrowable(
85898
86274
  async () => {
85899
- await import_promises28.default.mkdir(directory, { recursive: true });
85900
- await import_promises28.default.writeFile(temporaryPath, JSON.stringify(findings, void 0, INDENT_SPACES));
85901
- await import_promises28.default.rename(temporaryPath, finalPath);
86275
+ await import_promises29.default.mkdir(directory, { recursive: true });
86276
+ await import_promises29.default.writeFile(temporaryPath, JSON.stringify(findings, void 0, INDENT_SPACES));
86277
+ await import_promises29.default.rename(temporaryPath, finalPath);
85902
86278
  return finalPath;
85903
86279
  },
85904
86280
  (cause) => ({ type: "FINDINGS_WRITE_FAILED", cause })
@@ -85906,7 +86282,55 @@ function writeSuiteFindings(findings, options2) {
85906
86282
  return safeWriteAtomically();
85907
86283
  }
85908
86284
 
86285
+ // src/suite/shell/suite-runs-writer.ts
86286
+ var import_promises30 = __toESM(require("node:fs/promises"), 1);
86287
+ var import_node_path30 = __toESM(require("node:path"), 1);
86288
+ var import_neverthrow83 = __toESM(require_index_cjs(), 1);
86289
+ var INDENT_SPACES2 = 2;
86290
+ var RUNS_FILENAME2 = "scenario-runs.json";
86291
+ function writeSuiteRuns(runsFile, options2) {
86292
+ const directory = import_node_path30.default.join(
86293
+ options2.outputDirectory,
86294
+ "suite",
86295
+ options2.suiteId,
86296
+ options2.date,
86297
+ options2.runId
86298
+ );
86299
+ const finalPath = import_node_path30.default.join(directory, RUNS_FILENAME2);
86300
+ const temporaryPath = `${finalPath}.tmp`;
86301
+ const safeWriteAtomically = import_neverthrow83.ResultAsync.fromThrowable(
86302
+ async () => {
86303
+ await import_promises30.default.mkdir(directory, { recursive: true });
86304
+ await import_promises30.default.writeFile(temporaryPath, JSON.stringify(runsFile, void 0, INDENT_SPACES2));
86305
+ await import_promises30.default.rename(temporaryPath, finalPath);
86306
+ return finalPath;
86307
+ },
86308
+ (cause) => ({ type: "RUNS_WRITE_FAILED", cause })
86309
+ );
86310
+ return safeWriteAtomically();
86311
+ }
86312
+
85909
86313
  // src/suite/commands/run/write-and-report.ts
86314
+ function collectSpecPaths(items) {
86315
+ const paths = items.flatMap((item) => item.specPath === null ? [] : [item.specPath]);
86316
+ return [...new Set(paths)];
86317
+ }
86318
+ async function writeRunsFile(input, items) {
86319
+ const { suiteId, runId, outputDirectory, date: date5 } = input;
86320
+ const specPaths = collectSpecPaths(items);
86321
+ const scenarioIdsResult = await readScenarioIdsBySpecPaths(specPaths);
86322
+ if (scenarioIdsResult.isErr()) {
86323
+ process.stderr.write(`Failed to read scenario IDs: ${String(scenarioIdsResult.error.cause)}
86324
+ `);
86325
+ return;
86326
+ }
86327
+ const runsFile = buildScenarioRunsFile(items, scenarioIdsResult.value);
86328
+ const writeResult = await writeSuiteRuns(runsFile, { suiteId, runId, outputDirectory, date: date5 });
86329
+ if (writeResult.isErr()) {
86330
+ process.stderr.write(`Failed to write scenario runs: ${String(writeResult.error.cause)}
86331
+ `);
86332
+ }
86333
+ }
85910
86334
  async function writeAndReport(input) {
85911
86335
  const { suiteId, runId, outputDirectory, date: date5, items, aborted: aborted2 } = input;
85912
86336
  const suiteFindings = buildSuiteFindings({ suiteId, runId, items, aborted: aborted2 });
@@ -85918,6 +86342,7 @@ async function writeAndReport(input) {
85918
86342
  }
85919
86343
  process.stdout.write(`Suite complete. Findings: ${writeResult.value}
85920
86344
  `);
86345
+ await writeRunsFile(input, items);
85921
86346
  if (aborted2) {
85922
86347
  return DEFAULT_ABORT_EXIT_CODE;
85923
86348
  }
@@ -85926,9 +86351,9 @@ async function writeAndReport(input) {
85926
86351
  }
85927
86352
 
85928
86353
  // src/suite/commands/suite-run-context.ts
85929
- var import_promises29 = __toESM(require("node:fs/promises"), 1);
85930
- var import_node_path30 = __toESM(require("node:path"), 1);
85931
- var import_neverthrow80 = __toESM(require_index_cjs(), 1);
86354
+ var import_promises31 = __toESM(require("node:fs/promises"), 1);
86355
+ var import_node_path31 = __toESM(require("node:path"), 1);
86356
+ var import_neverthrow84 = __toESM(require_index_cjs(), 1);
85932
86357
 
85933
86358
  // src/suite/core/run-id.ts
85934
86359
  var RUN_ID_PAD_LENGTH2 = 4;
@@ -85963,16 +86388,16 @@ function deriveSuiteId(input) {
85963
86388
 
85964
86389
  // src/suite/commands/suite-run-context.ts
85965
86390
  var ISO_DATE_LENGTH3 = 10;
85966
- var safeReaddir3 = import_neverthrow80.ResultAsync.fromThrowable(
86391
+ var safeReaddir3 = import_neverthrow84.ResultAsync.fromThrowable(
85967
86392
  async (directoryPath) => {
85968
- const entries = await import_promises29.default.readdir(directoryPath, { withFileTypes: true });
86393
+ const entries = await import_promises31.default.readdir(directoryPath, { withFileTypes: true });
85969
86394
  return entries.filter((entry) => entry.isDirectory()).map((entry) => entry.name);
85970
86395
  },
85971
86396
  () => "READDIR_FAILED"
85972
86397
  );
85973
86398
  async function listRunDirectories(input) {
85974
86399
  const { outputDirectory, suiteId, date: date5 } = input;
85975
- const directoryPath = import_node_path30.default.join(outputDirectory, "suite", suiteId, date5);
86400
+ const directoryPath = import_node_path31.default.join(outputDirectory, "suite", suiteId, date5);
85976
86401
  const result = await safeReaddir3(directoryPath);
85977
86402
  return result.unwrapOr([]);
85978
86403
  }
@@ -85996,7 +86421,7 @@ ${cause}
85996
86421
  async function buildSuiteRunContext(input) {
85997
86422
  const suiteId = deriveSuiteIdFromMode(input.mode);
85998
86423
  const date5 = (/* @__PURE__ */ new Date()).toISOString().slice(0, ISO_DATE_LENGTH3);
85999
- const outputDirectory = import_node_path30.default.join(input.xqaDirectory, "output");
86424
+ const outputDirectory = import_node_path31.default.join(input.xqaDirectory, "output");
86000
86425
  const existingDirectories = await listRunDirectories({ outputDirectory, suiteId, date: date5 });
86001
86426
  const runId = computeNextRunId2(existingDirectories);
86002
86427
  const appContext = await loadAppContext(input.xqaDirectory);
@@ -86098,18 +86523,18 @@ async function runSuiteCommand(input) {
86098
86523
  }
86099
86524
 
86100
86525
  // src/suite/commands/validate-run-arguments.ts
86101
- var import_neverthrow81 = __toESM(require_index_cjs(), 1);
86526
+ var import_neverthrow85 = __toESM(require_index_cjs(), 1);
86102
86527
  function validateRunArguments(options2) {
86103
86528
  if (options2.suite === void 0 && options2.spec === void 0) {
86104
- return (0, import_neverthrow81.err)({ type: "MISSING_SUITE_OR_SPEC" });
86529
+ return (0, import_neverthrow85.err)({ type: "MISSING_SUITE_OR_SPEC" });
86105
86530
  }
86106
86531
  if (options2.suite !== void 0 && options2.spec !== void 0) {
86107
- return (0, import_neverthrow81.err)({ type: "BOTH_SUITE_AND_SPEC" });
86532
+ return (0, import_neverthrow85.err)({ type: "BOTH_SUITE_AND_SPEC" });
86108
86533
  }
86109
86534
  if (options2.only !== void 0 && options2.suite === void 0) {
86110
- return (0, import_neverthrow81.err)({ type: "ONLY_REQUIRES_SUITE" });
86535
+ return (0, import_neverthrow85.err)({ type: "ONLY_REQUIRES_SUITE" });
86111
86536
  }
86112
- return (0, import_neverthrow81.ok)(
86537
+ return (0, import_neverthrow85.ok)(
86113
86538
  options2.suite === void 0 ? { type: "spec", globs: options2.spec ?? [] } : { type: "suite", name: options2.suite }
86114
86539
  );
86115
86540
  }
@@ -86157,10 +86582,10 @@ function registerRunCommand(program3, loader2) {
86157
86582
  }
86158
86583
 
86159
86584
  // src/commands/spec/runner.ts
86160
- var import_node_path34 = __toESM(require("node:path"), 1);
86585
+ var import_node_path35 = __toESM(require("node:path"), 1);
86161
86586
 
86162
86587
  // src/commands/spec/pipeline-config.ts
86163
- var import_node_path31 = __toESM(require("node:path"), 1);
86588
+ var import_node_path32 = __toESM(require("node:path"), 1);
86164
86589
  function buildInspector3(context) {
86165
86590
  const { inspector } = context.rootConfig.agents;
86166
86591
  if (!inspector.enabled) {
@@ -86185,7 +86610,7 @@ function buildSpecExplorer2(context) {
86185
86610
  }
86186
86611
  function buildPipelineConfig3({ input, context, onEvent }) {
86187
86612
  return {
86188
- outputDir: import_node_path31.default.join(context.xqaDirectory, "output", context.slug),
86613
+ outputDir: import_node_path32.default.join(context.xqaDirectory, "output", context.slug),
86189
86614
  signal: input.signal,
86190
86615
  onEvent,
86191
86616
  inspector: buildInspector3(context),
@@ -86244,13 +86669,13 @@ function handleSpecResult(state, context) {
86244
86669
  }
86245
86670
 
86246
86671
  // src/spec-slug.ts
86247
- var import_node_path32 = __toESM(require("node:path"), 1);
86672
+ var import_node_path33 = __toESM(require("node:path"), 1);
86248
86673
  var SPECS_DIR = "specs";
86249
86674
  function stripExtensions(filename) {
86250
86675
  return filename.replace(/\.test\.md$/, "").replace(/\.[^.]+$/, "");
86251
86676
  }
86252
86677
  function deriveSpecSlug(specFilePath) {
86253
- const parts = specFilePath.split(import_node_path32.default.sep);
86678
+ const parts = specFilePath.split(import_node_path33.default.sep);
86254
86679
  const specsIndex = parts.lastIndexOf(SPECS_DIR);
86255
86680
  if (specsIndex !== -1) {
86256
86681
  const relativeParts = parts.slice(specsIndex + 1);
@@ -86258,60 +86683,60 @@ function deriveSpecSlug(specFilePath) {
86258
86683
  relativeParts[relativeParts.length - 1] = stripExtensions(last);
86259
86684
  return relativeParts.join("__");
86260
86685
  }
86261
- return stripExtensions(import_node_path32.default.basename(specFilePath));
86686
+ return stripExtensions(import_node_path33.default.basename(specFilePath));
86262
86687
  }
86263
86688
 
86264
86689
  // src/commands/spec-resolver.ts
86265
86690
  var import_node_fs12 = require("node:fs");
86266
- var import_node_path33 = __toESM(require("node:path"), 1);
86267
- var import_neverthrow83 = __toESM(require_index_cjs(), 1);
86691
+ var import_node_path34 = __toESM(require("node:path"), 1);
86692
+ var import_neverthrow87 = __toESM(require_index_cjs(), 1);
86268
86693
 
86269
86694
  // src/spec-frontmatter.ts
86270
86695
  var import_gray_matter = __toESM(require_gray_matter(), 1);
86271
- var import_neverthrow82 = __toESM(require_index_cjs(), 1);
86696
+ var import_neverthrow86 = __toESM(require_index_cjs(), 1);
86272
86697
  var frontmatterSchema = external_exports.object({
86273
86698
  feature: external_exports.string().min(1),
86274
86699
  timeout: external_exports.number().int().positive().optional()
86275
86700
  });
86276
- var safeParseMatter = (0, import_neverthrow82.fromThrowable)(
86701
+ var safeParseMatter = (0, import_neverthrow86.fromThrowable)(
86277
86702
  import_gray_matter.default,
86278
86703
  (cause) => ({ type: "SPEC_FRONTMATTER_INVALID", cause })
86279
86704
  );
86280
86705
  function validate(data) {
86281
86706
  const parsed = frontmatterSchema.safeParse(data);
86282
86707
  if (!parsed.success) {
86283
- return (0, import_neverthrow82.err)({ type: "SPEC_FRONTMATTER_INVALID", cause: parsed.error });
86708
+ return (0, import_neverthrow86.err)({ type: "SPEC_FRONTMATTER_INVALID", cause: parsed.error });
86284
86709
  }
86285
86710
  const { feature, timeout } = parsed.data;
86286
86711
  if (timeout === void 0) {
86287
- return (0, import_neverthrow82.ok)({ feature });
86712
+ return (0, import_neverthrow86.ok)({ feature });
86288
86713
  }
86289
- return (0, import_neverthrow82.ok)({ feature, timeoutSeconds: timeout });
86714
+ return (0, import_neverthrow86.ok)({ feature, timeoutSeconds: timeout });
86290
86715
  }
86291
86716
  function parseSpecFrontmatter(raw) {
86292
86717
  return safeParseMatter(raw).andThen((parsed) => validate(parsed.data));
86293
86718
  }
86294
86719
 
86295
86720
  // src/commands/spec-resolver.ts
86296
- var safeReadFile6 = (0, import_neverthrow83.fromThrowable)((filePath) => (0, import_node_fs12.readFileSync)(filePath, "utf8"));
86297
- var safeReaddir4 = (0, import_neverthrow83.fromThrowable)(
86721
+ var safeReadFile7 = (0, import_neverthrow87.fromThrowable)((filePath) => (0, import_node_fs12.readFileSync)(filePath, "utf8"));
86722
+ var safeReaddir4 = (0, import_neverthrow87.fromThrowable)(
86298
86723
  (directory) => (0, import_node_fs12.readdirSync)(directory, { recursive: true, encoding: "utf8" })
86299
86724
  );
86300
86725
  var CANCEL = "xqa:cancel";
86301
- var safeSelect = import_neverthrow83.ResultAsync.fromThrowable(
86726
+ var safeSelect = import_neverthrow87.ResultAsync.fromThrowable(
86302
86727
  esm_default11,
86303
86728
  (error48) => error48 instanceof Error && error48.name === "ExitPromptError" ? "cancelled" : "failed"
86304
86729
  );
86305
86730
  function findSpecFiles(xqaDirectory) {
86306
- const specsDirectory = import_node_path33.default.join(xqaDirectory, "specs");
86307
- return safeReaddir4(specsDirectory).unwrapOr([]).filter((file2) => file2.endsWith(".test.md")).map((file2) => import_node_path33.default.join(specsDirectory, file2));
86731
+ const specsDirectory = import_node_path34.default.join(xqaDirectory, "specs");
86732
+ return safeReaddir4(specsDirectory).unwrapOr([]).filter((file2) => file2.endsWith(".test.md")).map((file2) => import_node_path34.default.join(specsDirectory, file2));
86308
86733
  }
86309
86734
  async function promptForSpec(specFiles, xqaDirectory) {
86310
86735
  const result = await safeSelect({
86311
86736
  message: "Select a spec",
86312
86737
  choices: [
86313
86738
  ...specFiles.map((specFile) => ({
86314
- name: import_node_path33.default.relative(xqaDirectory, specFile),
86739
+ name: import_node_path34.default.relative(xqaDirectory, specFile),
86315
86740
  value: specFile
86316
86741
  })),
86317
86742
  new Separator(),
@@ -86325,7 +86750,7 @@ async function promptForSpec(specFiles, xqaDirectory) {
86325
86750
  return result.value;
86326
86751
  }
86327
86752
  function readAndParseSpec(absolutePath) {
86328
- const readResult = safeReadFile6(absolutePath);
86753
+ const readResult = safeReadFile7(absolutePath);
86329
86754
  if (readResult.isErr()) {
86330
86755
  const isEnoent4 = readResult.error.code === "ENOENT";
86331
86756
  const message = isEnoent4 ? `Spec file not found: ${absolutePath}` : `Failed to read spec file: ${absolutePath}`;
@@ -86361,7 +86786,7 @@ async function executeSpec(input, context) {
86361
86786
  const identity = {
86362
86787
  display: createSoloDisplay(input.verbose),
86363
86788
  itemId: "spec",
86364
- itemName: import_node_path34.default.basename(context.absolutePath, ".test.md"),
86789
+ itemName: import_node_path35.default.basename(context.absolutePath, ".test.md"),
86365
86790
  simulatorUdid: ""
86366
86791
  };
86367
86792
  const startedAt = Date.now();
@@ -86396,7 +86821,7 @@ async function resolveSpecContext(input, options2) {
86396
86821
  if (resolvedSpecFile === void 0) {
86397
86822
  return;
86398
86823
  }
86399
- const absolutePath = import_node_path34.default.resolve(resolvedSpecFile);
86824
+ const absolutePath = import_node_path35.default.resolve(resolvedSpecFile);
86400
86825
  const frontmatter = readAndParseSpec(absolutePath);
86401
86826
  if (frontmatter === void 0) {
86402
86827
  return;
@@ -86441,7 +86866,7 @@ function registerSpecCommand(program3, loader2) {
86441
86866
  }
86442
86867
 
86443
86868
  // ../../agents/triager/dist/index.js
86444
- var import_neverthrow84 = __toESM(require_index_cjs(), 1);
86869
+ var import_neverthrow88 = __toESM(require_index_cjs(), 1);
86445
86870
 
86446
86871
  // ../../node_modules/.pnpm/balanced-match@4.0.4/node_modules/balanced-match/dist/esm/index.js
86447
86872
  var balanced = (a3, b, str3) => {
@@ -87495,11 +87920,11 @@ var qmarksTestNoExtDot = ([$02]) => {
87495
87920
  return (f6) => f6.length === len && f6 !== "." && f6 !== "..";
87496
87921
  };
87497
87922
  var defaultPlatform = typeof process === "object" && process ? typeof process.env === "object" && process.env && process.env.__MINIMATCH_TESTING_PLATFORM__ || process.platform : "posix";
87498
- var path34 = {
87923
+ var path35 = {
87499
87924
  win32: { sep: "\\" },
87500
87925
  posix: { sep: "/" }
87501
87926
  };
87502
- var sep = defaultPlatform === "win32" ? path34.win32.sep : path34.posix.sep;
87927
+ var sep = defaultPlatform === "win32" ? path35.win32.sep : path35.posix.sep;
87503
87928
  minimatch.sep = sep;
87504
87929
  var GLOBSTAR = Symbol("globstar **");
87505
87930
  minimatch.GLOBSTAR = GLOBSTAR;
@@ -88246,14 +88671,14 @@ minimatch.escape = escape2;
88246
88671
  minimatch.unescape = unescape2;
88247
88672
 
88248
88673
  // ../../agents/triager/dist/index.js
88249
- var import_neverthrow85 = __toESM(require_index_cjs(), 1);
88250
- var import_promises30 = require("node:fs/promises");
88251
- var import_neverthrow86 = __toESM(require_index_cjs(), 1);
88252
- var import_node_child_process8 = require("node:child_process");
88253
- var import_promises31 = require("node:fs/promises");
88254
- var import_node_path35 = __toESM(require("node:path"), 1);
88255
- var import_neverthrow87 = __toESM(require_index_cjs(), 1);
88256
- var import_neverthrow88 = __toESM(require_index_cjs(), 1);
88674
+ var import_neverthrow89 = __toESM(require_index_cjs(), 1);
88675
+ var import_promises32 = require("node:fs/promises");
88676
+ var import_neverthrow90 = __toESM(require_index_cjs(), 1);
88677
+ var import_node_child_process9 = require("node:child_process");
88678
+ var import_promises33 = require("node:fs/promises");
88679
+ var import_node_path36 = __toESM(require("node:path"), 1);
88680
+ var import_neverthrow91 = __toESM(require_index_cjs(), 1);
88681
+ var import_neverthrow92 = __toESM(require_index_cjs(), 1);
88257
88682
  function resolveConfidence2(selected) {
88258
88683
  if (selected.some((pick2) => pick2.confidence === "HIGH")) {
88259
88684
  return "high";
@@ -88872,7 +89297,7 @@ function buildMcpServer(state, options2) {
88872
89297
  });
88873
89298
  return xx({ name: TRIAGER_MCP_SERVER_NAME, version: "0.0.0", tools });
88874
89299
  }
88875
- function buildAllowedTools() {
89300
+ function buildAllowedTools2() {
88876
89301
  return [
88877
89302
  `${TOOL_PREFIX}read_spec`,
88878
89303
  `${TOOL_PREFIX}read_app_section`,
@@ -88883,7 +89308,7 @@ function buildAllowedTools() {
88883
89308
  function buildQueryOptions2(input) {
88884
89309
  return {
88885
89310
  mcpServers: { [TRIAGER_MCP_SERVER_NAME]: input.server },
88886
- allowedTools: buildAllowedTools(),
89311
+ allowedTools: buildAllowedTools2(),
88887
89312
  tools: [],
88888
89313
  permissionMode: "bypassPermissions",
88889
89314
  allowDangerouslySkipPermissions: true,
@@ -88918,7 +89343,7 @@ async function drainMessages(runner, state) {
88918
89343
  }
88919
89344
  }
88920
89345
  }
88921
- var safeDrainMessages = import_neverthrow85.ResultAsync.fromThrowable(
89346
+ var safeDrainMessages = import_neverthrow89.ResultAsync.fromThrowable(
88922
89347
  drainMessages,
88923
89348
  (cause) => ({ type: "AI_CALL_FAILED", cause })
88924
89349
  );
@@ -88944,25 +89369,25 @@ function finalizeRun(bootstrap) {
88944
89369
  const telemetry = buildTelemetry(bootstrap.telemetryInput, bootstrap.state);
88945
89370
  const error48 = resolveError(bootstrap.state);
88946
89371
  if (error48 !== void 0) {
88947
- return (0, import_neverthrow85.errAsync)(error48);
89372
+ return (0, import_neverthrow89.errAsync)(error48);
88948
89373
  }
88949
89374
  const output = bootstrap.state.output;
88950
89375
  if (output === void 0) {
88951
- return (0, import_neverthrow85.errAsync)({ type: "AI_NO_FINAL_TOOL_CALL" });
89376
+ return (0, import_neverthrow89.errAsync)({ type: "AI_NO_FINAL_TOOL_CALL" });
88952
89377
  }
88953
89378
  bootstrap.reportTelemetry(telemetry);
88954
- return (0, import_neverthrow85.okAsync)({ picks: output.picks, metaPr: output.metaPr, telemetry });
89379
+ return (0, import_neverthrow89.okAsync)({ picks: output.picks, metaPr: output.metaPr, telemetry });
88955
89380
  }
88956
89381
  function launchQuery(input) {
88957
- const safeLaunch = (0, import_neverthrow85.fromThrowable)(
89382
+ const safeLaunch = (0, import_neverthrow89.fromThrowable)(
88958
89383
  input.queryRunner,
88959
89384
  (cause) => ({ type: "AI_CALL_FAILED", cause })
88960
89385
  );
88961
89386
  const result = safeLaunch({ prompt: input.inputQueue, options: input.queryOptions });
88962
89387
  if (result.isErr()) {
88963
- return (0, import_neverthrow85.errAsync)(result.error);
89388
+ return (0, import_neverthrow89.errAsync)(result.error);
88964
89389
  }
88965
- return (0, import_neverthrow85.okAsync)(result.value);
89390
+ return (0, import_neverthrow89.okAsync)(result.value);
88966
89391
  }
88967
89392
  function runPipeline4(bootstrap) {
88968
89393
  return launchQuery({
@@ -89016,9 +89441,9 @@ var STATIC_ONLY_FIELDS = {
89016
89441
  freestyleByGroup: /* @__PURE__ */ new Map(),
89017
89442
  appIndex: [],
89018
89443
  handlers: {
89019
- readSpec: () => (0, import_neverthrow84.errAsync)({ type: "FILE_NOT_FOUND", path: "" }),
89020
- readAppSection: () => (0, import_neverthrow84.errAsync)({ type: "FILE_NOT_FOUND", path: "" }),
89021
- grepCodebase: () => (0, import_neverthrow84.errAsync)({ type: "FILE_NOT_FOUND", path: "" })
89444
+ readSpec: () => (0, import_neverthrow88.errAsync)({ type: "FILE_NOT_FOUND", path: "" }),
89445
+ readAppSection: () => (0, import_neverthrow88.errAsync)({ type: "FILE_NOT_FOUND", path: "" }),
89446
+ grepCodebase: () => (0, import_neverthrow88.errAsync)({ type: "FILE_NOT_FOUND", path: "" })
89022
89447
  }
89023
89448
  };
89024
89449
  function resolveAiFields(config2) {
@@ -89139,24 +89564,24 @@ function runAiTiebreaker(context, staticPicks) {
89139
89564
  function runTriager(options2) {
89140
89565
  const { groups, config: config2 } = options2;
89141
89566
  if (groups.length === 0) {
89142
- return (0, import_neverthrow84.errAsync)({ type: "NO_GROUPS" });
89567
+ return (0, import_neverthrow88.errAsync)({ type: "NO_GROUPS" });
89143
89568
  }
89144
89569
  if (config2?.useAi === true && config2.ai === void 0) {
89145
- return (0, import_neverthrow84.errAsync)({ type: "AI_CONFIG_MISSING" });
89570
+ return (0, import_neverthrow88.errAsync)({ type: "AI_CONFIG_MISSING" });
89146
89571
  }
89147
89572
  const context = buildContext2(options2);
89148
89573
  const staticPicks = scoreGroups(context.diff, context.groups);
89149
89574
  if (!context.useAi) {
89150
- return (0, import_neverthrow84.okAsync)(buildDecision({ picks: staticPicks, metaPr: false }));
89575
+ return (0, import_neverthrow88.okAsync)(buildDecision({ picks: staticPicks, metaPr: false }));
89151
89576
  }
89152
89577
  return runAiTiebreaker(context, staticPicks);
89153
89578
  }
89154
89579
  var HEADING_PATTERN = /^##\s+(.+?)\s*$/;
89155
89580
  var UTF8 = "utf8";
89156
- var ENOENT_CODE = "ENOENT";
89581
+ var ENOENT_CODE2 = "ENOENT";
89157
89582
  function classifyReadError(cause, filePath) {
89158
89583
  const nodeError = cause;
89159
- if (nodeError.code === ENOENT_CODE) {
89584
+ if (nodeError.code === ENOENT_CODE2) {
89160
89585
  return { type: "APP_MD_NOT_FOUND", path: filePath };
89161
89586
  }
89162
89587
  return { type: "APP_MD_UNREADABLE", path: filePath, cause };
@@ -89208,17 +89633,17 @@ function parseSections(text) {
89208
89633
  function lookupSection(sections, screenName) {
89209
89634
  const section = sections.get(screenName);
89210
89635
  if (section === void 0) {
89211
- return (0, import_neverthrow86.errAsync)({ type: "SECTION_NOT_FOUND", screenName });
89636
+ return (0, import_neverthrow90.errAsync)({ type: "SECTION_NOT_FOUND", screenName });
89212
89637
  }
89213
- return (0, import_neverthrow86.okAsync)(section);
89638
+ return (0, import_neverthrow90.okAsync)(section);
89214
89639
  }
89215
89640
  async function readUtf8File(filePath) {
89216
- return (0, import_promises30.readFile)(filePath, UTF8);
89641
+ return (0, import_promises32.readFile)(filePath, UTF8);
89217
89642
  }
89218
89643
  function createAppMdReader(options2) {
89219
89644
  const filePath = options2.path;
89220
89645
  let sectionCache;
89221
- const safeReadFile7 = import_neverthrow86.ResultAsync.fromThrowable(
89646
+ const safeReadFile8 = import_neverthrow90.ResultAsync.fromThrowable(
89222
89647
  readUtf8File,
89223
89648
  (cause) => classifyReadError(cause, filePath)
89224
89649
  );
@@ -89226,7 +89651,7 @@ function createAppMdReader(options2) {
89226
89651
  if (sectionCache !== void 0) {
89227
89652
  return lookupSection(sectionCache, screenName);
89228
89653
  }
89229
- return safeReadFile7(filePath).andThen((text) => {
89654
+ return safeReadFile8(filePath).andThen((text) => {
89230
89655
  sectionCache = parseSections(text);
89231
89656
  return lookupSection(sectionCache, screenName);
89232
89657
  });
@@ -89243,7 +89668,7 @@ var RIPGREP_BASE_ARGUMENTS = [
89243
89668
  "never",
89244
89669
  `--max-count=${String(MAX_MATCHES)}`
89245
89670
  ];
89246
- var ENOENT_CODE2 = "ENOENT";
89671
+ var ENOENT_CODE22 = "ENOENT";
89247
89672
  var RIPGREP_NO_MATCH_CODE = 1;
89248
89673
  function buildSpawnExitError(code, stderr) {
89249
89674
  return {
@@ -89255,7 +89680,7 @@ function buildSpawnExitError(code, stderr) {
89255
89680
  }
89256
89681
  async function runExecFile(request2) {
89257
89682
  const { promise: promise2, resolve, reject } = Promise.withResolvers();
89258
- const child = (0, import_node_child_process8.spawn)(request2.binary, [...request2.arguments_], { cwd: request2.cwd });
89683
+ const child = (0, import_node_child_process9.spawn)(request2.binary, [...request2.arguments_], { cwd: request2.cwd });
89259
89684
  const stdoutChunks = [];
89260
89685
  const stderrChunks = [];
89261
89686
  child.stdout.on("data", (chunk) => {
@@ -89279,14 +89704,14 @@ async function runExecFile(request2) {
89279
89704
  return promise2;
89280
89705
  }
89281
89706
  function resolveFilePath(filePath, cwd) {
89282
- if (import_node_path35.default.isAbsolute(filePath)) {
89707
+ if (import_node_path36.default.isAbsolute(filePath)) {
89283
89708
  return filePath;
89284
89709
  }
89285
- return import_node_path35.default.resolve(cwd, filePath);
89710
+ return import_node_path36.default.resolve(cwd, filePath);
89286
89711
  }
89287
89712
  function classifyReadError2(cause, resolvedPath) {
89288
89713
  const nodeError = cause;
89289
- if (nodeError.code === ENOENT_CODE2) {
89714
+ if (nodeError.code === ENOENT_CODE22) {
89290
89715
  return { type: "FILE_NOT_FOUND", path: resolvedPath };
89291
89716
  }
89292
89717
  return { type: "FILE_UNREADABLE", path: resolvedPath, cause };
@@ -89325,7 +89750,7 @@ function parseRipgrepOutput(stdout) {
89325
89750
  }
89326
89751
  function classifyRawExecError(cause) {
89327
89752
  const execError = cause;
89328
- if (execError.code === ENOENT_CODE2) {
89753
+ if (execError.code === ENOENT_CODE22) {
89329
89754
  return { type: "RIPGREP_MISSING" };
89330
89755
  }
89331
89756
  return { type: "GREP_FAILED", cause, stderr: execError.stderr ?? "" };
@@ -89336,24 +89761,24 @@ async function invokeRipgrep(options2) {
89336
89761
  return runExecFile({ binary: binary2, arguments_, cwd });
89337
89762
  }
89338
89763
  function execRipgrepRaw(options2) {
89339
- const safeExec = import_neverthrow87.ResultAsync.fromThrowable(invokeRipgrep, classifyRawExecError);
89764
+ const safeExec = import_neverthrow91.ResultAsync.fromThrowable(invokeRipgrep, classifyRawExecError);
89340
89765
  return safeExec(options2);
89341
89766
  }
89342
89767
  function handleExecResult(options2) {
89343
89768
  return execRipgrepRaw(options2).orElse((error48) => {
89344
89769
  if (error48.type === "GREP_FAILED" && error48.cause.code === RIPGREP_NO_MATCH_CODE) {
89345
- return (0, import_neverthrow87.ok)({ stdout: "", stderr: "" });
89770
+ return (0, import_neverthrow91.ok)({ stdout: "", stderr: "" });
89346
89771
  }
89347
- return (0, import_neverthrow87.err)(error48);
89772
+ return (0, import_neverthrow91.err)(error48);
89348
89773
  });
89349
89774
  }
89350
89775
  async function readUtf8File2(filePath) {
89351
- return (0, import_promises31.readFile)(filePath, "utf8");
89776
+ return (0, import_promises33.readFile)(filePath, "utf8");
89352
89777
  }
89353
89778
  function makeReadFile(cwd) {
89354
89779
  return (filePath) => {
89355
89780
  const resolvedPath = resolveFilePath(filePath, cwd);
89356
- const safeRead = import_neverthrow87.ResultAsync.fromThrowable(
89781
+ const safeRead = import_neverthrow91.ResultAsync.fromThrowable(
89357
89782
  readUtf8File2,
89358
89783
  (cause) => classifyReadError2(cause, resolvedPath)
89359
89784
  );
@@ -89420,9 +89845,9 @@ function applyHeading(state, screenName) {
89420
89845
  function handleHeading(state, indexed) {
89421
89846
  const screenName = indexed.text.slice(LEVEL_2_HEADING_MARKER.length).trim();
89422
89847
  if (screenName.length === 0) {
89423
- return (0, import_neverthrow88.err)({ type: "APP_MD_MALFORMED", line: indexed.number });
89848
+ return (0, import_neverthrow92.err)({ type: "APP_MD_MALFORMED", line: indexed.number });
89424
89849
  }
89425
- return (0, import_neverthrow88.ok)(applyHeading(state, screenName));
89850
+ return (0, import_neverthrow92.ok)(applyHeading(state, screenName));
89426
89851
  }
89427
89852
  function handleFenceLine(state, lineNumber) {
89428
89853
  if (state.insideFence) {
@@ -89456,23 +89881,23 @@ function isLevel2Heading(line) {
89456
89881
  }
89457
89882
  function processLine2(state, indexed) {
89458
89883
  if (indexed.text.startsWith(FENCE_MARKER)) {
89459
- return (0, import_neverthrow88.ok)(handleFenceLine(state, indexed.number));
89884
+ return (0, import_neverthrow92.ok)(handleFenceLine(state, indexed.number));
89460
89885
  }
89461
89886
  if (state.insideFence) {
89462
- return (0, import_neverthrow88.ok)(state);
89887
+ return (0, import_neverthrow92.ok)(state);
89463
89888
  }
89464
89889
  if (isLevel2Heading(indexed.text)) {
89465
89890
  return handleHeading(state, indexed);
89466
89891
  }
89467
89892
  if (indexed.text.trim().length === 0) {
89468
- return (0, import_neverthrow88.ok)(handleBlankLine(state));
89893
+ return (0, import_neverthrow92.ok)(handleBlankLine(state));
89469
89894
  }
89470
- return (0, import_neverthrow88.ok)(handleContentLine(state, indexed.text));
89895
+ return (0, import_neverthrow92.ok)(handleContentLine(state, indexed.text));
89471
89896
  }
89472
89897
  function processIndexedLines(indexedLines, state) {
89473
89898
  const [head, ...tail] = indexedLines;
89474
89899
  if (head === void 0) {
89475
- return (0, import_neverthrow88.ok)(state);
89900
+ return (0, import_neverthrow92.ok)(state);
89476
89901
  }
89477
89902
  return processLine2(state, head).andThen((next) => processIndexedLines(tail, next));
89478
89903
  }
@@ -89484,9 +89909,9 @@ function buildFinalEntries(state) {
89484
89909
  }
89485
89910
  function finaliseState(state) {
89486
89911
  if (state.insideFence) {
89487
- return (0, import_neverthrow88.err)({ type: "APP_MD_MALFORMED", line: state.fenceOpenLine });
89912
+ return (0, import_neverthrow92.err)({ type: "APP_MD_MALFORMED", line: state.fenceOpenLine });
89488
89913
  }
89489
- return (0, import_neverthrow88.ok)([...buildFinalEntries(state)]);
89914
+ return (0, import_neverthrow92.ok)([...buildFinalEntries(state)]);
89490
89915
  }
89491
89916
  function buildAppIndex(appMd) {
89492
89917
  const indexedLines = toIndexedLines(appMd.split("\n"));
@@ -89517,11 +89942,11 @@ function summariseSpec(input) {
89517
89942
  var triagerConfigSchema = agentBaseConfigSchema.extend({ enabled: external_exports.boolean().default(false) }).strict();
89518
89943
 
89519
89944
  // src/commands/triage-command.ts
89520
- var import_neverthrow93 = __toESM(require_index_cjs(), 1);
89945
+ var import_neverthrow97 = __toESM(require_index_cjs(), 1);
89521
89946
 
89522
89947
  // src/triage/ai-context-builder.ts
89523
- var import_node_path36 = __toESM(require("node:path"), 1);
89524
- var import_neverthrow89 = __toESM(require_index_cjs(), 1);
89948
+ var import_node_path37 = __toESM(require("node:path"), 1);
89949
+ var import_neverthrow93 = __toESM(require_index_cjs(), 1);
89525
89950
  var PROMPT_VERSION = "v1";
89526
89951
  var MAX_GREP_PATTERN_LENGTH = 200;
89527
89952
  var DENIED_SAMPLE_PATHS = [
@@ -89600,11 +90025,11 @@ function isDeniedGlob(pathGlob) {
89600
90025
  return normalized !== pathGlob && matchesDeniedSample(normalized);
89601
90026
  }
89602
90027
  function pathDenied(reason) {
89603
- return (0, import_neverthrow89.errAsync)({ type: "PATH_DENIED", reason });
90028
+ return (0, import_neverthrow93.errAsync)({ type: "PATH_DENIED", reason });
89604
90029
  }
89605
90030
  function buildHandlers(cwd, validSpecIds) {
89606
90031
  const reader = createCodebaseReader({ cwd });
89607
- const appMdPath = import_node_path36.default.join(cwd, "app.md");
90032
+ const appMdPath = import_node_path37.default.join(cwd, "app.md");
89608
90033
  const appMdReader = createAppMdReader({ path: appMdPath });
89609
90034
  return {
89610
90035
  readSpec: (id) => {
@@ -89626,20 +90051,20 @@ function buildHandlers(cwd, validSpecIds) {
89626
90051
  };
89627
90052
  }
89628
90053
  function resolveAppMdPath(suitesDirectory) {
89629
- return import_node_path36.default.join(import_node_path36.default.dirname(import_node_path36.default.resolve(suitesDirectory)), "app.md");
90054
+ return import_node_path37.default.join(import_node_path37.default.dirname(import_node_path37.default.resolve(suitesDirectory)), "app.md");
89630
90055
  }
89631
90056
  function loadAppIndex(appMdPath) {
89632
- const appMdReader = createCodebaseReader({ cwd: import_node_path36.default.dirname(appMdPath) });
90057
+ const appMdReader = createCodebaseReader({ cwd: import_node_path37.default.dirname(appMdPath) });
89633
90058
  return appMdReader.readFile(appMdPath).mapErr(() => ({ type: "SPEC_NOT_FOUND", path: appMdPath })).andThen((content) => {
89634
90059
  const indexResult = buildAppIndex(content);
89635
90060
  if (indexResult.isErr()) {
89636
- return (0, import_neverthrow89.errAsync)({
90061
+ return (0, import_neverthrow93.errAsync)({
89637
90062
  type: "SUITE_INVALID",
89638
90063
  path: appMdPath,
89639
90064
  cause: indexResult.error
89640
90065
  });
89641
90066
  }
89642
- return (0, import_neverthrow89.okAsync)(indexResult.value);
90067
+ return (0, import_neverthrow93.okAsync)(indexResult.value);
89643
90068
  });
89644
90069
  }
89645
90070
  function collectSpecIds(specSummariesByGroup) {
@@ -90262,7 +90687,7 @@ async function getResponseData(response) {
90262
90687
  try {
90263
90688
  text = await response.text();
90264
90689
  return JSON.parse(text);
90265
- } catch (err40) {
90690
+ } catch (err41) {
90266
90691
  return text;
90267
90692
  }
90268
90693
  } else if (mimetype.type.startsWith("text/") || mimetype.parameters.charset?.toLowerCase() === "utf-8") {
@@ -90610,17 +91035,17 @@ function requestLog(octokit) {
90610
91035
  octokit.log.debug("request", options2);
90611
91036
  const start = Date.now();
90612
91037
  const requestOptions = octokit.request.endpoint.parse(options2);
90613
- const path39 = requestOptions.url.replace(options2.baseUrl, "");
91038
+ const path40 = requestOptions.url.replace(options2.baseUrl, "");
90614
91039
  return request2(options2).then((response) => {
90615
91040
  const requestId = response.headers["x-github-request-id"];
90616
91041
  octokit.log.info(
90617
- `${requestOptions.method} ${path39} - ${response.status} with id ${requestId} in ${Date.now() - start}ms`
91042
+ `${requestOptions.method} ${path40} - ${response.status} with id ${requestId} in ${Date.now() - start}ms`
90618
91043
  );
90619
91044
  return response;
90620
91045
  }).catch((error48) => {
90621
91046
  const requestId = error48.response?.headers["x-github-request-id"] || "UNKNOWN";
90622
91047
  octokit.log.error(
90623
- `${requestOptions.method} ${path39} - ${error48.status} with id ${requestId} in ${Date.now() - start}ms`
91048
+ `${requestOptions.method} ${path40} - ${error48.status} with id ${requestId} in ${Date.now() - start}ms`
90624
91049
  );
90625
91050
  throw error48;
90626
91051
  });
@@ -93214,7 +93639,7 @@ var Octokit2 = Octokit.plugin(requestLog, legacyRestEndpointMethods, paginateRes
93214
93639
  );
93215
93640
 
93216
93641
  // src/triage/github-pr-fetcher.ts
93217
- var import_neverthrow90 = __toESM(require_index_cjs(), 1);
93642
+ var import_neverthrow94 = __toESM(require_index_cjs(), 1);
93218
93643
  var STATUS_MAP = {
93219
93644
  added: "added",
93220
93645
  modified: "modified",
@@ -93250,11 +93675,11 @@ async function runListFiles(octokit, options2) {
93250
93675
  per_page: 100
93251
93676
  });
93252
93677
  }
93253
- var safeGet = import_neverthrow90.ResultAsync.fromThrowable(
93678
+ var safeGet = import_neverthrow94.ResultAsync.fromThrowable(
93254
93679
  runPullRequestGet,
93255
93680
  (cause) => ({ type: "PR_FETCH_FAILED", cause })
93256
93681
  );
93257
- var safeList = import_neverthrow90.ResultAsync.fromThrowable(
93682
+ var safeList = import_neverthrow94.ResultAsync.fromThrowable(
93258
93683
  runListFiles,
93259
93684
  (cause) => ({ type: "PR_FETCH_FAILED", cause })
93260
93685
  );
@@ -93268,13 +93693,13 @@ function toDiff(summary, files) {
93268
93693
  }
93269
93694
  function fetchPullRequestDiff(options2) {
93270
93695
  const octokit = new Octokit2({ auth: options2.token });
93271
- return import_neverthrow90.ResultAsync.combine([safeGet(octokit, options2), safeList(octokit, options2)]).map(
93696
+ return import_neverthrow94.ResultAsync.combine([safeGet(octokit, options2), safeList(octokit, options2)]).map(
93272
93697
  ([summary, files]) => toDiff(summary, files)
93273
93698
  );
93274
93699
  }
93275
93700
 
93276
93701
  // src/triage/github-pr-labeller.ts
93277
- var import_neverthrow91 = __toESM(require_index_cjs(), 1);
93702
+ var import_neverthrow95 = __toESM(require_index_cjs(), 1);
93278
93703
  async function runAddLabels(octokit, options2) {
93279
93704
  await octokit.issues.addLabels({
93280
93705
  owner: options2.owner,
@@ -93283,7 +93708,7 @@ async function runAddLabels(octokit, options2) {
93283
93708
  labels: [...options2.labels]
93284
93709
  });
93285
93710
  }
93286
- var safeAddLabels = import_neverthrow91.ResultAsync.fromThrowable(
93711
+ var safeAddLabels = import_neverthrow95.ResultAsync.fromThrowable(
93287
93712
  runAddLabels,
93288
93713
  (cause) => ({ type: "LABEL_APPLY_FAILED", cause })
93289
93714
  );
@@ -93321,9 +93746,9 @@ function formatXqaLabels(decision) {
93321
93746
  }
93322
93747
 
93323
93748
  // src/triage/suite-loader.ts
93324
- var import_promises32 = require("node:fs/promises");
93325
- var import_node_path37 = __toESM(require("node:path"), 1);
93326
- var import_neverthrow92 = __toESM(require_index_cjs(), 1);
93749
+ var import_promises34 = require("node:fs/promises");
93750
+ var import_node_path38 = __toESM(require("node:path"), 1);
93751
+ var import_neverthrow96 = __toESM(require_index_cjs(), 1);
93327
93752
  var SUITE_FILE_SUFFIX = ".suite.json";
93328
93753
  var freestyleEntrySchema2 = external_exports.object({
93329
93754
  timeoutSeconds: external_exports.number().int().positive(),
@@ -93334,39 +93759,39 @@ var suiteFileSchema = external_exports.object({
93334
93759
  freestyle: external_exports.array(freestyleEntrySchema2).optional(),
93335
93760
  hooks: external_exports.record(external_exports.string(), external_exports.unknown()).optional()
93336
93761
  });
93337
- var safeJsonParse6 = (0, import_neverthrow92.fromThrowable)(JSON.parse);
93762
+ var safeJsonParse6 = (0, import_neverthrow96.fromThrowable)(JSON.parse);
93338
93763
  async function runReadFile(filePath) {
93339
- return (0, import_promises32.readFile)(filePath, "utf8");
93764
+ return (0, import_promises34.readFile)(filePath, "utf8");
93340
93765
  }
93341
93766
  async function runStat(filePath) {
93342
- return (0, import_promises32.stat)(filePath);
93767
+ return (0, import_promises34.stat)(filePath);
93343
93768
  }
93344
93769
  async function runReadDirectory(filePath) {
93345
- return (0, import_promises32.readdir)(filePath);
93770
+ return (0, import_promises34.readdir)(filePath);
93346
93771
  }
93347
93772
  function readSuiteFile(filePath) {
93348
- const safeRead = import_neverthrow92.ResultAsync.fromThrowable(
93773
+ const safeRead = import_neverthrow96.ResultAsync.fromThrowable(
93349
93774
  runReadFile,
93350
93775
  (cause) => ({ type: "SUITE_READ_FAILED", path: filePath, cause })
93351
93776
  );
93352
93777
  return safeRead(filePath);
93353
93778
  }
93354
93779
  function readSpecFile2(filePath) {
93355
- const safeRead = import_neverthrow92.ResultAsync.fromThrowable(
93780
+ const safeRead = import_neverthrow96.ResultAsync.fromThrowable(
93356
93781
  runReadFile,
93357
93782
  () => ({ type: "SPEC_NOT_FOUND", path: filePath })
93358
93783
  );
93359
93784
  return safeRead(filePath);
93360
93785
  }
93361
93786
  function statDirectory(directory) {
93362
- const safeStat = import_neverthrow92.ResultAsync.fromThrowable(
93787
+ const safeStat = import_neverthrow96.ResultAsync.fromThrowable(
93363
93788
  runStat,
93364
93789
  () => ({ type: "SUITE_DIR_MISSING", path: directory })
93365
93790
  );
93366
93791
  return safeStat(directory);
93367
93792
  }
93368
93793
  function readDirectoryEntries(directory) {
93369
- const safeReadDirectory = import_neverthrow92.ResultAsync.fromThrowable(
93794
+ const safeReadDirectory = import_neverthrow96.ResultAsync.fromThrowable(
93370
93795
  runReadDirectory,
93371
93796
  (cause) => ({ type: "SUITE_READ_FAILED", path: directory, cause })
93372
93797
  );
@@ -93375,34 +93800,34 @@ function readDirectoryEntries(directory) {
93375
93800
  function listSuiteFiles(directory) {
93376
93801
  return statDirectory(directory).andThen((stats) => {
93377
93802
  if (!stats.isDirectory()) {
93378
- return (0, import_neverthrow92.errAsync)({ type: "SUITE_DIR_MISSING", path: directory });
93803
+ return (0, import_neverthrow96.errAsync)({ type: "SUITE_DIR_MISSING", path: directory });
93379
93804
  }
93380
93805
  return readDirectoryEntries(directory);
93381
93806
  }).map(
93382
- (entries) => entries.filter((entry) => entry.endsWith(SUITE_FILE_SUFFIX)).map((entry) => import_node_path37.default.resolve(directory, entry)).toSorted()
93807
+ (entries) => entries.filter((entry) => entry.endsWith(SUITE_FILE_SUFFIX)).map((entry) => import_node_path38.default.resolve(directory, entry)).toSorted()
93383
93808
  );
93384
93809
  }
93385
93810
  function parseSuiteFile(filePath, raw) {
93386
93811
  const parsed = safeJsonParse6(raw);
93387
93812
  if (parsed.isErr()) {
93388
- return (0, import_neverthrow92.err)({ type: "SUITE_INVALID", path: filePath, cause: parsed.error });
93813
+ return (0, import_neverthrow96.err)({ type: "SUITE_INVALID", path: filePath, cause: parsed.error });
93389
93814
  }
93390
93815
  const validated = suiteFileSchema.safeParse(parsed.value);
93391
93816
  if (!validated.success) {
93392
- return (0, import_neverthrow92.err)({ type: "SUITE_INVALID", path: filePath, cause: validated.error });
93817
+ return (0, import_neverthrow96.err)({ type: "SUITE_INVALID", path: filePath, cause: validated.error });
93393
93818
  }
93394
- return (0, import_neverthrow92.ok)(validated.data);
93819
+ return (0, import_neverthrow96.ok)(validated.data);
93395
93820
  }
93396
93821
  function suiteIdFromPath(filePath) {
93397
- const name = import_node_path37.default.basename(filePath);
93822
+ const name = import_node_path38.default.basename(filePath);
93398
93823
  return name.slice(0, name.length - SUITE_FILE_SUFFIX.length);
93399
93824
  }
93400
93825
  function loadSpecReference(xqaDirectory, specPath) {
93401
- const absolute = import_node_path37.default.resolve(xqaDirectory, specPath);
93826
+ const absolute = import_node_path38.default.resolve(xqaDirectory, specPath);
93402
93827
  return readSpecFile2(absolute).andThen((raw) => {
93403
93828
  const parsed = parseSpecFrontmatter(raw);
93404
93829
  if (parsed.isErr()) {
93405
- return (0, import_neverthrow92.err)({
93830
+ return (0, import_neverthrow96.err)({
93406
93831
  type: "SPEC_FRONTMATTER_INVALID",
93407
93832
  path: absolute,
93408
93833
  cause: parsed.error.cause
@@ -93410,19 +93835,19 @@ function loadSpecReference(xqaDirectory, specPath) {
93410
93835
  }
93411
93836
  const { feature, timeoutSeconds } = parsed.value;
93412
93837
  if (timeoutSeconds === void 0) {
93413
- return (0, import_neverthrow92.ok)({ path: specPath, feature });
93838
+ return (0, import_neverthrow96.ok)({ path: specPath, feature });
93414
93839
  }
93415
- return (0, import_neverthrow92.ok)({ path: specPath, feature, timeoutSeconds });
93840
+ return (0, import_neverthrow96.ok)({ path: specPath, feature, timeoutSeconds });
93416
93841
  });
93417
93842
  }
93418
93843
  function loadSpecReferences(xqaDirectory, specs) {
93419
93844
  if (specs.length === 0) {
93420
- return (0, import_neverthrow92.okAsync)([]);
93845
+ return (0, import_neverthrow96.okAsync)([]);
93421
93846
  }
93422
- return import_neverthrow92.ResultAsync.combine(specs.map((specPath) => loadSpecReference(xqaDirectory, specPath)));
93847
+ return import_neverthrow96.ResultAsync.combine(specs.map((specPath) => loadSpecReference(xqaDirectory, specPath)));
93423
93848
  }
93424
93849
  function addSpecTokens(tokens, spec) {
93425
- const stem = import_node_path37.default.basename(spec.path).replace(/\.test\.md$/u, "");
93850
+ const stem = import_node_path38.default.basename(spec.path).replace(/\.test\.md$/u, "");
93426
93851
  for (const part of stem.split(".")) {
93427
93852
  if (part.length > 0) {
93428
93853
  tokens.add(part);
@@ -93495,12 +93920,12 @@ function loadSuite(suiteFilePath, xqaDirectory) {
93495
93920
  );
93496
93921
  }
93497
93922
  function loadXqaSuites(directory) {
93498
- const xqaDirectory = import_node_path37.default.dirname(import_node_path37.default.resolve(directory));
93923
+ const xqaDirectory = import_node_path38.default.dirname(import_node_path38.default.resolve(directory));
93499
93924
  return listSuiteFiles(directory).andThen((files) => {
93500
93925
  if (files.length === 0) {
93501
- return (0, import_neverthrow92.okAsync)([]);
93926
+ return (0, import_neverthrow96.okAsync)([]);
93502
93927
  }
93503
- return import_neverthrow92.ResultAsync.combine(files.map((file2) => loadSuite(file2, xqaDirectory)));
93928
+ return import_neverthrow96.ResultAsync.combine(files.map((file2) => loadSuite(file2, xqaDirectory)));
93504
93929
  });
93505
93930
  }
93506
93931
 
@@ -93511,27 +93936,27 @@ function parseRepo(input) {
93511
93936
  const parts = input.split("/");
93512
93937
  const [owner, repo] = parts;
93513
93938
  if (parts.length !== 2 || owner === void 0 || owner === "" || repo === void 0 || repo === "") {
93514
- return (0, import_neverthrow93.err)({ type: "CLI_INVALID_ARG", message: `invalid --repo value: ${input}` });
93939
+ return (0, import_neverthrow97.err)({ type: "CLI_INVALID_ARG", message: `invalid --repo value: ${input}` });
93515
93940
  }
93516
- return (0, import_neverthrow93.ok)({ owner, repo });
93941
+ return (0, import_neverthrow97.ok)({ owner, repo });
93517
93942
  }
93518
93943
  function parsePrNumber(input) {
93519
93944
  const parsed = Number.parseInt(input, 10);
93520
93945
  if (!Number.isFinite(parsed) || parsed <= 0) {
93521
- return (0, import_neverthrow93.err)({ type: "CLI_INVALID_ARG", message: `invalid --pr value: ${input}` });
93946
+ return (0, import_neverthrow97.err)({ type: "CLI_INVALID_ARG", message: `invalid --pr value: ${input}` });
93522
93947
  }
93523
- return (0, import_neverthrow93.ok)(parsed);
93948
+ return (0, import_neverthrow97.ok)(parsed);
93524
93949
  }
93525
93950
  function parseCliInputs(options2) {
93526
93951
  const repoResult = parseRepo(options2.repo);
93527
93952
  if (repoResult.isErr()) {
93528
- return (0, import_neverthrow93.err)(repoResult.error);
93953
+ return (0, import_neverthrow97.err)(repoResult.error);
93529
93954
  }
93530
93955
  const prResult = parsePrNumber(options2.pr);
93531
93956
  if (prResult.isErr()) {
93532
- return (0, import_neverthrow93.err)(prResult.error);
93957
+ return (0, import_neverthrow97.err)(prResult.error);
93533
93958
  }
93534
- return (0, import_neverthrow93.ok)({
93959
+ return (0, import_neverthrow97.ok)({
93535
93960
  owner: repoResult.value.owner,
93536
93961
  repo: repoResult.value.repo,
93537
93962
  prNumber: prResult.value
@@ -93539,23 +93964,23 @@ function parseCliInputs(options2) {
93539
93964
  }
93540
93965
  function resolveGithubToken(context) {
93541
93966
  if (!context.rootConfig.agents.triager.enabled) {
93542
- return (0, import_neverthrow93.err)({ type: "TRIAGER_DISABLED" });
93967
+ return (0, import_neverthrow97.err)({ type: "TRIAGER_DISABLED" });
93543
93968
  }
93544
93969
  if (context.config.GITHUB_TOKEN === void 0) {
93545
- return (0, import_neverthrow93.err)({ type: "CONFIG_MISSING", key: "GITHUB_TOKEN" });
93970
+ return (0, import_neverthrow97.err)({ type: "CONFIG_MISSING", key: "GITHUB_TOKEN" });
93546
93971
  }
93547
- return (0, import_neverthrow93.ok)(context.config.GITHUB_TOKEN);
93972
+ return (0, import_neverthrow97.ok)(context.config.GITHUB_TOKEN);
93548
93973
  }
93549
93974
  function buildInputs(options2, context) {
93550
93975
  const tokenResult = resolveGithubToken(context);
93551
93976
  if (tokenResult.isErr()) {
93552
- return (0, import_neverthrow93.err)(tokenResult.error);
93977
+ return (0, import_neverthrow97.err)(tokenResult.error);
93553
93978
  }
93554
93979
  const parsed = parseCliInputs(options2);
93555
93980
  if (parsed.isErr()) {
93556
- return (0, import_neverthrow93.err)(parsed.error);
93981
+ return (0, import_neverthrow97.err)(parsed.error);
93557
93982
  }
93558
- return (0, import_neverthrow93.ok)({
93983
+ return (0, import_neverthrow97.ok)({
93559
93984
  owner: parsed.value.owner,
93560
93985
  repo: parsed.value.repo,
93561
93986
  prNumber: parsed.value.prNumber,
@@ -93583,7 +94008,7 @@ function callTriager(options2) {
93583
94008
  }
93584
94009
  function maybeApplyLabels(inputs, labels) {
93585
94010
  if (!inputs.applyLabels || labels.length === 0) {
93586
- return import_neverthrow93.ResultAsync.fromSafePromise(Promise.resolve(labels));
94011
+ return import_neverthrow97.ResultAsync.fromSafePromise(Promise.resolve(labels));
93587
94012
  }
93588
94013
  return applyPullRequestLabels({
93589
94014
  owner: inputs.owner,
@@ -93594,7 +94019,7 @@ function maybeApplyLabels(inputs, labels) {
93594
94019
  }).map(() => labels);
93595
94020
  }
93596
94021
  function runPipeline5(inputs) {
93597
- return import_neverthrow93.ResultAsync.combine([
94022
+ return import_neverthrow97.ResultAsync.combine([
93598
94023
  loadXqaSuites(inputs.suitesDir),
93599
94024
  fetchPullRequestDiff({
93600
94025
  owner: inputs.owner,
@@ -93688,10 +94113,10 @@ var rootConfigSchema = external_exports.object({
93688
94113
  }).strict();
93689
94114
 
93690
94115
  // src/config.ts
93691
- var import_node_path38 = __toESM(require("node:path"), 1);
94116
+ var import_node_path39 = __toESM(require("node:path"), 1);
93692
94117
  var import_node_url2 = require("node:url");
93693
94118
  var import_dotenv = __toESM(require_main(), 1);
93694
- var import_neverthrow94 = __toESM(require_index_cjs(), 1);
94119
+ var import_neverthrow98 = __toESM(require_index_cjs(), 1);
93695
94120
 
93696
94121
  // src/config-schema.ts
93697
94122
  var configSchema = external_exports.object({
@@ -93701,23 +94126,23 @@ var configSchema = external_exports.object({
93701
94126
  });
93702
94127
 
93703
94128
  // src/config.ts
93704
- var packageDirectory = import_node_path38.default.dirname((0, import_node_url2.fileURLToPath)(__importMetaUrl));
94129
+ var packageDirectory = import_node_path39.default.dirname((0, import_node_url2.fileURLToPath)(__importMetaUrl));
93705
94130
  function loadConfig2() {
93706
- (0, import_dotenv.config)({ path: import_node_path38.default.resolve(packageDirectory, "..", ".env.local") });
94131
+ (0, import_dotenv.config)({ path: import_node_path39.default.resolve(packageDirectory, "..", ".env.local") });
93707
94132
  const result = configSchema.safeParse(process.env);
93708
94133
  if (!result.success) {
93709
94134
  const messages = result.error.issues.map(
93710
94135
  (issue2) => ` - ${issue2.path.join(".")}: ${issue2.message}`
93711
94136
  );
93712
- return (0, import_neverthrow94.err)({ type: "INVALID_CONFIG", message: `Configuration error:
94137
+ return (0, import_neverthrow98.err)({ type: "INVALID_CONFIG", message: `Configuration error:
93713
94138
  ${messages.join("\n")}` });
93714
94139
  }
93715
- return (0, import_neverthrow94.ok)(result.data);
94140
+ return (0, import_neverthrow98.ok)(result.data);
93716
94141
  }
93717
94142
 
93718
94143
  // src/pid-lock.ts
93719
94144
  var import_node_fs13 = require("node:fs");
93720
- var import_neverthrow95 = __toESM(require_index_cjs(), 1);
94145
+ var import_neverthrow99 = __toESM(require_index_cjs(), 1);
93721
94146
  var PID_FILE = "/tmp/xqa.pid";
93722
94147
  var SIGINT_EXIT_CODE = 130;
93723
94148
  var SIGTERM_EXIT_CODE = 143;
@@ -93726,7 +94151,7 @@ var HARD_TIMEOUT_MS = 1e4;
93726
94151
  var cleanup = () => {
93727
94152
  (0, import_node_fs13.rmSync)(PID_FILE, { force: true });
93728
94153
  };
93729
- var checkProcessRunning = (0, import_neverthrow95.fromThrowable)(
94154
+ var checkProcessRunning = (0, import_neverthrow99.fromThrowable)(
93730
94155
  (pid) => {
93731
94156
  process.kill(pid, 0);
93732
94157
  return true;
@@ -93793,16 +94218,16 @@ function acquireLock() {
93793
94218
  function loadCliContext(signal) {
93794
94219
  const configResult = loadConfig2();
93795
94220
  if (configResult.isErr()) {
93796
- return (0, import_neverthrow96.err)(configResult.error);
94221
+ return (0, import_neverthrow100.err)(configResult.error);
93797
94222
  }
93798
94223
  const rootConfigResult = loadConfigSync({
93799
94224
  cwd: process.cwd(),
93800
94225
  schema: rootConfigSchema
93801
94226
  });
93802
94227
  if (rootConfigResult.isErr()) {
93803
- return (0, import_neverthrow96.err)(rootConfigResult.error);
94228
+ return (0, import_neverthrow100.err)(rootConfigResult.error);
93804
94229
  }
93805
- return (0, import_neverthrow96.ok)({
94230
+ return (0, import_neverthrow100.ok)({
93806
94231
  config: configResult.value,
93807
94232
  rootConfig: rootConfigResult.value,
93808
94233
  signal
@@ -93834,7 +94259,7 @@ function buildProgram(options2) {
93834
94259
 
93835
94260
  // src/index.ts
93836
94261
  process.title = "xqa";
93837
- var version2 = `${"5.0.0"}${false ? ` (dev build +${"1701986"})` : ""}`;
94262
+ var version2 = `${"5.2.0"}${false ? ` (dev build +${"a4407af"})` : ""}`;
93838
94263
  var program2 = buildProgram({ version: version2 });
93839
94264
  void program2.parseAsync(process.argv);
93840
94265
  /*! Bundled license information: