@exodus/xqa 5.1.0 → 5.3.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/skills/xqa-test-plan/SKILL.md +705 -55
- package/dist/skills/xqa-test-plan/SKILL.test.md +122 -0
- package/dist/xqa.cjs +984 -709
- package/package.json +2 -2
package/dist/xqa.cjs
CHANGED
|
@@ -161,7 +161,7 @@ var require_index_cjs = __commonJS({
|
|
|
161
161
|
}, reject);
|
|
162
162
|
}
|
|
163
163
|
}
|
|
164
|
-
var
|
|
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(
|
|
266
|
-
return this._promise.then((res) => res.match(
|
|
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
|
|
303
|
+
return new ResultAsync28(Promise.resolve(new Ok(value)));
|
|
304
304
|
}
|
|
305
|
-
function errAsync12(
|
|
306
|
-
return new
|
|
305
|
+
function errAsync12(err45) {
|
|
306
|
+
return new ResultAsync28(Promise.resolve(new Err(err45)));
|
|
307
307
|
}
|
|
308
|
-
var fromPromise =
|
|
309
|
-
var fromSafePromise2 =
|
|
310
|
-
var fromAsyncThrowable9 =
|
|
308
|
+
var fromPromise = ResultAsync28.fromPromise;
|
|
309
|
+
var fromSafePromise2 = ResultAsync28.fromSafePromise;
|
|
310
|
+
var fromAsyncThrowable9 = ResultAsync28.fromThrowable;
|
|
311
311
|
var combineResultList = (resultList) => {
|
|
312
|
-
let acc =
|
|
312
|
+
let acc = ok45([]);
|
|
313
313
|
for (const result of resultList) {
|
|
314
314
|
if (result.isErr()) {
|
|
315
|
-
acc =
|
|
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) =>
|
|
323
|
+
var combineResultAsyncList = (asyncResultList) => ResultAsync28.fromSafePromise(Promise.all(asyncResultList)).andThen(combineResultList);
|
|
324
324
|
var combineResultListWithAllErrors = (resultList) => {
|
|
325
|
-
let acc =
|
|
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 =
|
|
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) =>
|
|
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
|
|
344
|
+
return ok45(result);
|
|
345
345
|
} catch (e3) {
|
|
346
|
-
return
|
|
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
|
|
360
|
+
function ok45(value) {
|
|
361
361
|
return new Ok(value);
|
|
362
362
|
}
|
|
363
|
-
function
|
|
364
|
-
return new Err(
|
|
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
|
|
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
|
|
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
|
|
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
|
|
403
|
+
return ok45(this.value);
|
|
404
404
|
}
|
|
405
405
|
orTee(_f) {
|
|
406
|
-
return
|
|
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
|
|
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
|
|
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(
|
|
428
|
-
return
|
|
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
|
|
459
|
+
return err41(this.error);
|
|
460
460
|
}
|
|
461
461
|
mapErr(f6) {
|
|
462
|
-
return
|
|
462
|
+
return err41(f6(this.error));
|
|
463
463
|
}
|
|
464
464
|
andThrough(_f) {
|
|
465
|
-
return
|
|
465
|
+
return err41(this.error);
|
|
466
466
|
}
|
|
467
467
|
andTee(_f) {
|
|
468
|
-
return
|
|
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
|
|
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
|
|
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,
|
|
500
|
-
return
|
|
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
|
|
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 =
|
|
525
|
-
exports2.err =
|
|
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 =
|
|
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,
|
|
615
|
-
const ctrl = callVisitor(key, node, visitor,
|
|
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,
|
|
618
|
-
return visit_(key, ctrl, visitor,
|
|
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
|
-
|
|
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,
|
|
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
|
-
|
|
636
|
-
const ck = visit_("key", node.key, visitor,
|
|
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,
|
|
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,
|
|
663
|
-
const ctrl = await callVisitor(key, node, visitor,
|
|
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,
|
|
666
|
-
return visitAsync_(key, ctrl, visitor,
|
|
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
|
-
|
|
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,
|
|
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
|
-
|
|
684
|
-
const ck = await visitAsync_("key", node.key, visitor,
|
|
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,
|
|
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,
|
|
716
|
+
function callVisitor(key, node, visitor, path40) {
|
|
717
717
|
if (typeof visitor === "function")
|
|
718
|
-
return visitor(key, node,
|
|
718
|
+
return visitor(key, node, path40);
|
|
719
719
|
if (identity.isMap(node))
|
|
720
|
-
return visitor.Map?.(key, node,
|
|
720
|
+
return visitor.Map?.(key, node, path40);
|
|
721
721
|
if (identity.isSeq(node))
|
|
722
|
-
return visitor.Seq?.(key, node,
|
|
722
|
+
return visitor.Seq?.(key, node, path40);
|
|
723
723
|
if (identity.isPair(node))
|
|
724
|
-
return visitor.Pair?.(key, node,
|
|
724
|
+
return visitor.Pair?.(key, node, path40);
|
|
725
725
|
if (identity.isScalar(node))
|
|
726
|
-
return visitor.Scalar?.(key, node,
|
|
726
|
+
return visitor.Scalar?.(key, node, path40);
|
|
727
727
|
if (identity.isAlias(node))
|
|
728
|
-
return visitor.Alias?.(key, node,
|
|
728
|
+
return visitor.Alias?.(key, node, path40);
|
|
729
729
|
return void 0;
|
|
730
730
|
}
|
|
731
|
-
function replaceNode(key,
|
|
732
|
-
const parent =
|
|
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,
|
|
1340
|
+
function collectionFromPath(schema2, path40, value) {
|
|
1341
1341
|
let v2 = value;
|
|
1342
|
-
for (let i3 =
|
|
1343
|
-
const k3 =
|
|
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 = (
|
|
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(
|
|
1393
|
-
if (isEmptyPath(
|
|
1392
|
+
addIn(path40, value) {
|
|
1393
|
+
if (isEmptyPath(path40))
|
|
1394
1394
|
this.add(value);
|
|
1395
1395
|
else {
|
|
1396
|
-
const [key, ...rest] =
|
|
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(
|
|
1411
|
-
const [key, ...rest] =
|
|
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(
|
|
1426
|
-
const [key, ...rest] =
|
|
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(
|
|
1445
|
-
const [key, ...rest] =
|
|
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(
|
|
1456
|
-
const [key, ...rest] =
|
|
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(
|
|
3968
|
+
addIn(path40, value) {
|
|
3969
3969
|
if (assertCollection(this.contents))
|
|
3970
|
-
this.contents.addIn(
|
|
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(
|
|
4046
|
-
if (Collection2.isEmptyPath(
|
|
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(
|
|
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(
|
|
4068
|
-
if (Collection2.isEmptyPath(
|
|
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(
|
|
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(
|
|
4082
|
-
if (Collection2.isEmptyPath(
|
|
4081
|
+
hasIn(path40) {
|
|
4082
|
+
if (Collection2.isEmptyPath(path40))
|
|
4083
4083
|
return this.contents !== void 0;
|
|
4084
|
-
return identity.isCollection(this.contents) ? this.contents.hasIn(
|
|
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(
|
|
4102
|
-
if (Collection2.isEmptyPath(
|
|
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(
|
|
4105
|
+
this.contents = Collection2.collectionFromPath(this.schema, Array.from(path40), value);
|
|
4106
4106
|
} else if (assertCollection(this.contents)) {
|
|
4107
|
-
this.contents.setIn(
|
|
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
|
|
5325
|
-
const code =
|
|
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,
|
|
6064
|
+
visit.itemAtPath = (cst, path40) => {
|
|
6065
6065
|
let item = cst;
|
|
6066
|
-
for (const [field, index] of
|
|
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,
|
|
6076
|
-
const parent = visit.itemAtPath(cst,
|
|
6077
|
-
const field =
|
|
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(
|
|
6084
|
-
let ctrl = visitor(item,
|
|
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(
|
|
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,
|
|
6102
|
+
ctrl = ctrl(item, path40);
|
|
6103
6103
|
}
|
|
6104
6104
|
}
|
|
6105
|
-
return typeof ctrl === "function" ? ctrl(item,
|
|
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
|
|
7390
|
+
const fs5 = this.flowScalar(this.type);
|
|
7391
7391
|
if (atNextItem || it.value) {
|
|
7392
|
-
map3.items.push({ start, key:
|
|
7392
|
+
map3.items.push({ start, key: fs5, sep: [] });
|
|
7393
7393
|
this.onKeyLine = true;
|
|
7394
7394
|
} else if (it.sep) {
|
|
7395
|
-
this.stack.push(
|
|
7395
|
+
this.stack.push(fs5);
|
|
7396
7396
|
} else {
|
|
7397
|
-
Object.assign(it, { key:
|
|
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
|
|
7525
|
+
const fs5 = this.flowScalar(this.type);
|
|
7526
7526
|
if (!it || it.value)
|
|
7527
|
-
fc.items.push({ start: [], key:
|
|
7527
|
+
fc.items.push({ start: [], key: fs5, sep: [] });
|
|
7528
7528
|
else if (it.sep)
|
|
7529
|
-
this.stack.push(
|
|
7529
|
+
this.stack.push(fs5);
|
|
7530
7530
|
else
|
|
7531
|
-
Object.assign(it, { key:
|
|
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
|
|
9003
|
-
var
|
|
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 = (
|
|
9430
|
-
if (
|
|
9431
|
-
throw
|
|
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 (
|
|
9508
|
-
if (
|
|
9509
|
-
const message = `${invalidArgumentMessage} ${
|
|
9510
|
-
this.error(message, { exitCode:
|
|
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
|
|
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 (
|
|
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 =
|
|
10016
|
-
if (
|
|
10017
|
-
if (sourceExt.includes(
|
|
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) =>
|
|
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 =
|
|
10031
|
+
resolvedScriptPath = fs5.realpathSync(this._scriptPath);
|
|
10032
10032
|
} catch {
|
|
10033
10033
|
resolvedScriptPath = this._scriptPath;
|
|
10034
10034
|
}
|
|
10035
|
-
executableDir =
|
|
10036
|
-
|
|
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 =
|
|
10043
|
+
const legacyName = path40.basename(
|
|
10044
10044
|
this._scriptPath,
|
|
10045
|
-
|
|
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(
|
|
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", (
|
|
10102
|
-
if (
|
|
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 (
|
|
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 =
|
|
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 =
|
|
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(
|
|
10986
|
-
if (
|
|
10987
|
-
this._executableDir =
|
|
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
|
|
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
|
-
|
|
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 =
|
|
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
|
|
18422
|
-
const handler2 = (
|
|
18421
|
+
const fs5 = (0, node_1.default)();
|
|
18422
|
+
const handler2 = (err41, buffer) => {
|
|
18423
18423
|
if (fd) {
|
|
18424
|
-
|
|
18424
|
+
fs5.closeSync(fd);
|
|
18425
18425
|
}
|
|
18426
|
-
if (
|
|
18427
|
-
reject(
|
|
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 =
|
|
18436
|
+
fd = fs5.openSync(filepath, "r");
|
|
18437
18437
|
let sample = Buffer.allocUnsafe(sampleSize);
|
|
18438
|
-
|
|
18439
|
-
if (
|
|
18440
|
-
handler2(
|
|
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
|
-
|
|
18450
|
+
fs5.readFile(filepath, handler2);
|
|
18451
18451
|
});
|
|
18452
18452
|
exports2.detectFile = detectFile;
|
|
18453
18453
|
var detectFileSync = (filepath, opts = {}) => {
|
|
18454
|
-
const
|
|
18454
|
+
const fs5 = (0, node_1.default)();
|
|
18455
18455
|
if (opts && opts.sampleSize) {
|
|
18456
|
-
const fd =
|
|
18456
|
+
const fd = fs5.openSync(filepath, "r");
|
|
18457
18457
|
let sample = Buffer.allocUnsafe(opts.sampleSize);
|
|
18458
|
-
const bytesRead =
|
|
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
|
-
|
|
18462
|
+
fs5.closeSync(fd);
|
|
18463
18463
|
return (0, exports2.detect)(sample);
|
|
18464
18464
|
}
|
|
18465
|
-
return (0, exports2.detect)(
|
|
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
|
|
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
|
|
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
|
|
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:
|
|
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
|
|
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 ||
|
|
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
|
|
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(
|
|
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 (
|
|
25362
|
-
if (options2 && options2.debug === true) throw
|
|
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
|
|
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 =
|
|
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
|
|
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(
|
|
25770
|
-
mergedStream.emit("error",
|
|
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
|
|
25875
|
-
exports2.fs =
|
|
25876
|
-
var
|
|
25877
|
-
exports2.path =
|
|
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(
|
|
25990
|
-
settings.fs.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(
|
|
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(
|
|
26032
|
-
const lstat = settings.fs.lstatSync(
|
|
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(
|
|
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
|
|
26059
|
+
var fs5 = require("fs");
|
|
26060
26060
|
exports2.FILE_SYSTEM_ADAPTER = {
|
|
26061
|
-
lstat:
|
|
26062
|
-
stat:
|
|
26063
|
-
lstatSync:
|
|
26064
|
-
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
|
|
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 =
|
|
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(
|
|
26108
|
+
function stat3(path40, optionsOrSettingsOrCallback, callback) {
|
|
26109
26109
|
if (typeof optionsOrSettingsOrCallback === "function") {
|
|
26110
|
-
async.read(
|
|
26110
|
+
async.read(path40, getSettings(), optionsOrSettingsOrCallback);
|
|
26111
26111
|
return;
|
|
26112
26112
|
}
|
|
26113
|
-
async.read(
|
|
26113
|
+
async.read(path40, getSettings(optionsOrSettingsOrCallback), callback);
|
|
26114
26114
|
}
|
|
26115
26115
|
exports2.stat = stat3;
|
|
26116
|
-
function statSync2(
|
|
26116
|
+
function statSync2(path40, optionsOrSettings) {
|
|
26117
26117
|
const settings = getSettings(optionsOrSettings);
|
|
26118
|
-
return sync.read(
|
|
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((
|
|
26135
|
-
throw
|
|
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(
|
|
26156
|
+
function done(err41) {
|
|
26157
26157
|
function end() {
|
|
26158
|
-
if (cb2) cb2(
|
|
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,
|
|
26164
|
+
function each(i3, err41, result) {
|
|
26165
26165
|
results[i3] = result;
|
|
26166
|
-
if (--pending === 0 ||
|
|
26167
|
-
done(
|
|
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(
|
|
26175
|
-
each(key,
|
|
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(
|
|
26181
|
-
each(i3,
|
|
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
|
|
26242
|
-
exports2.fs =
|
|
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
|
|
26334
|
+
const path40 = common3.joinPathSegments(directory, name, settings.pathSegmentSeparator);
|
|
26335
26335
|
return (done) => {
|
|
26336
|
-
fsStat.stat(
|
|
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:
|
|
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
|
|
26437
|
+
var fs5 = require("fs");
|
|
26438
26438
|
exports2.FILE_SYSTEM_ADAPTER = {
|
|
26439
|
-
lstat:
|
|
26440
|
-
stat:
|
|
26441
|
-
lstatSync:
|
|
26442
|
-
statSync:
|
|
26443
|
-
readdir:
|
|
26444
|
-
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
|
|
26461
|
+
var path40 = require("path");
|
|
26462
26462
|
var fsStat = require_out();
|
|
26463
|
-
var
|
|
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 =
|
|
26469
|
-
this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator,
|
|
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(
|
|
26496
|
+
function scandir(path40, optionsOrSettingsOrCallback, callback) {
|
|
26497
26497
|
if (typeof optionsOrSettingsOrCallback === "function") {
|
|
26498
|
-
async.read(
|
|
26498
|
+
async.read(path40, getSettings(), optionsOrSettingsOrCallback);
|
|
26499
26499
|
return;
|
|
26500
26500
|
}
|
|
26501
|
-
async.read(
|
|
26501
|
+
async.read(path40, getSettings(optionsOrSettingsOrCallback), callback);
|
|
26502
26502
|
}
|
|
26503
26503
|
exports2.scandir = scandir;
|
|
26504
|
-
function scandirSync(
|
|
26504
|
+
function scandirSync(path40, optionsOrSettings) {
|
|
26505
26505
|
const settings = getSettings(optionsOrSettings);
|
|
26506
|
-
return sync.read(
|
|
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(
|
|
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(
|
|
26760
|
+
errorHandler(err41, val);
|
|
26761
26761
|
}
|
|
26762
|
-
callback.call(self2.context,
|
|
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(
|
|
26787
|
-
if (
|
|
26788
|
-
reject(
|
|
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(
|
|
26800
|
-
if (
|
|
26801
|
-
reject(
|
|
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
|
|
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,
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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:
|
|
27854
|
-
lstatSync:
|
|
27855
|
-
stat:
|
|
27856
|
-
statSync:
|
|
27857
|
-
readdir:
|
|
27858
|
-
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 (
|
|
28110
|
-
if (
|
|
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 (
|
|
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 (
|
|
31121
|
-
if (wrap !== false && /(unexpected|identifier)/i.test(
|
|
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(
|
|
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
|
|
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 =
|
|
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
|
|
31655
|
-
var
|
|
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
|
|
31687
|
-
|
|
31688
|
-
throw
|
|
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
|
|
31732
|
-
|
|
31733
|
-
throw
|
|
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
|
|
31740
|
-
|
|
31741
|
-
throw
|
|
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
|
|
31746
|
-
|
|
31747
|
-
throw
|
|
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
|
|
31753
|
-
|
|
31754
|
-
throw
|
|
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 (
|
|
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 =
|
|
31771
|
+
possibleVaultPath = path40.resolve(process.cwd(), ".env.vault");
|
|
31772
31772
|
}
|
|
31773
|
-
if (
|
|
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] === "~" ?
|
|
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 =
|
|
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
|
|
31820
|
+
for (const path41 of optionPaths) {
|
|
31821
31821
|
try {
|
|
31822
|
-
const parsed = DotenvModule.parse(
|
|
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 ${
|
|
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 =
|
|
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
|
|
31885
|
-
|
|
31886
|
-
throw
|
|
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
|
|
31889
|
-
|
|
31890
|
-
throw
|
|
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
|
|
31901
|
-
|
|
31902
|
-
throw
|
|
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)) {
|
|
@@ -31988,8 +31988,8 @@ agents:
|
|
|
31988
31988
|
`;
|
|
31989
31989
|
|
|
31990
31990
|
// ../../packages/config/dist/core/redact-issues.js
|
|
31991
|
-
function normalizePath(
|
|
31992
|
-
return
|
|
31991
|
+
function normalizePath(path40) {
|
|
31992
|
+
return path40.map((segment) => typeof segment === "symbol" ? segment.toString() : segment);
|
|
31993
31993
|
}
|
|
31994
31994
|
function redactIssues(issues) {
|
|
31995
31995
|
return issues.map((issue2) => ({
|
|
@@ -32766,10 +32766,10 @@ function mergeDefs(...defs) {
|
|
|
32766
32766
|
function cloneDef(schema2) {
|
|
32767
32767
|
return mergeDefs(schema2._zod.def);
|
|
32768
32768
|
}
|
|
32769
|
-
function getElementAtPath(obj,
|
|
32770
|
-
if (!
|
|
32769
|
+
function getElementAtPath(obj, path40) {
|
|
32770
|
+
if (!path40)
|
|
32771
32771
|
return obj;
|
|
32772
|
-
return
|
|
32772
|
+
return path40.reduce((acc, key) => acc?.[key], obj);
|
|
32773
32773
|
}
|
|
32774
32774
|
function promiseAllObject(promisesObj) {
|
|
32775
32775
|
const keys = Object.keys(promisesObj);
|
|
@@ -33152,11 +33152,11 @@ function aborted(x, startIndex = 0) {
|
|
|
33152
33152
|
}
|
|
33153
33153
|
return false;
|
|
33154
33154
|
}
|
|
33155
|
-
function prefixIssues(
|
|
33155
|
+
function prefixIssues(path40, issues) {
|
|
33156
33156
|
return issues.map((iss) => {
|
|
33157
33157
|
var _a4;
|
|
33158
33158
|
(_a4 = iss).path ?? (_a4.path = []);
|
|
33159
|
-
iss.path.unshift(
|
|
33159
|
+
iss.path.unshift(path40);
|
|
33160
33160
|
return iss;
|
|
33161
33161
|
});
|
|
33162
33162
|
}
|
|
@@ -33339,7 +33339,7 @@ function formatError(error48, mapper = (issue2) => issue2.message) {
|
|
|
33339
33339
|
}
|
|
33340
33340
|
function treeifyError(error48, mapper = (issue2) => issue2.message) {
|
|
33341
33341
|
const result = { errors: [] };
|
|
33342
|
-
const processError = (error49,
|
|
33342
|
+
const processError = (error49, path40 = []) => {
|
|
33343
33343
|
var _a4, _b2;
|
|
33344
33344
|
for (const issue2 of error49.issues) {
|
|
33345
33345
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
@@ -33349,7 +33349,7 @@ function treeifyError(error48, mapper = (issue2) => issue2.message) {
|
|
|
33349
33349
|
} else if (issue2.code === "invalid_element") {
|
|
33350
33350
|
processError({ issues: issue2.issues }, issue2.path);
|
|
33351
33351
|
} else {
|
|
33352
|
-
const fullpath = [...
|
|
33352
|
+
const fullpath = [...path40, ...issue2.path];
|
|
33353
33353
|
if (fullpath.length === 0) {
|
|
33354
33354
|
result.errors.push(mapper(issue2));
|
|
33355
33355
|
continue;
|
|
@@ -33381,8 +33381,8 @@ function treeifyError(error48, mapper = (issue2) => issue2.message) {
|
|
|
33381
33381
|
}
|
|
33382
33382
|
function toDotPath(_path) {
|
|
33383
33383
|
const segs = [];
|
|
33384
|
-
const
|
|
33385
|
-
for (const seg of
|
|
33384
|
+
const path40 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
|
|
33385
|
+
for (const seg of path40) {
|
|
33386
33386
|
if (typeof seg === "number")
|
|
33387
33387
|
segs.push(`[${seg}]`);
|
|
33388
33388
|
else if (typeof seg === "symbol")
|
|
@@ -45359,13 +45359,13 @@ function resolveRef(ref, ctx) {
|
|
|
45359
45359
|
if (!ref.startsWith("#")) {
|
|
45360
45360
|
throw new Error("External $ref is not supported, only local refs (#/...) are allowed");
|
|
45361
45361
|
}
|
|
45362
|
-
const
|
|
45363
|
-
if (
|
|
45362
|
+
const path40 = ref.slice(1).split("/").filter(Boolean);
|
|
45363
|
+
if (path40.length === 0) {
|
|
45364
45364
|
return ctx.rootSchema;
|
|
45365
45365
|
}
|
|
45366
45366
|
const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions";
|
|
45367
|
-
if (
|
|
45368
|
-
const key =
|
|
45367
|
+
if (path40[0] === defsKey) {
|
|
45368
|
+
const key = path40[1];
|
|
45369
45369
|
if (!key || !ctx.defs[key]) {
|
|
45370
45370
|
throw new Error(`Reference not found: ${ref}`);
|
|
45371
45371
|
}
|
|
@@ -46041,7 +46041,7 @@ var {
|
|
|
46041
46041
|
} = import_index.default;
|
|
46042
46042
|
|
|
46043
46043
|
// src/bootstrap.ts
|
|
46044
|
-
var
|
|
46044
|
+
var import_neverthrow100 = __toESM(require_index_cjs(), 1);
|
|
46045
46045
|
|
|
46046
46046
|
// src/config/error-formatter.ts
|
|
46047
46047
|
function formatIssues(issues) {
|
|
@@ -46122,8 +46122,8 @@ function requireVideoPath(input) {
|
|
|
46122
46122
|
if (input.videoPath === void 0) {
|
|
46123
46123
|
return (0, import_neverthrow5.errAsync)({ type: "MISSING_VIDEO_PATH" });
|
|
46124
46124
|
}
|
|
46125
|
-
const
|
|
46126
|
-
return checkFileExists(
|
|
46125
|
+
const path40 = input.videoPath;
|
|
46126
|
+
return checkFileExists(path40).map(() => path40).mapErr(() => ({ type: "VIDEO_NOT_FOUND", path: path40 }));
|
|
46127
46127
|
}
|
|
46128
46128
|
function validateAnalyseInput(input) {
|
|
46129
46129
|
return requireApiKey(input).andThen(
|
|
@@ -49496,9 +49496,9 @@ var tq = k((oq) => {
|
|
|
49496
49496
|
});
|
|
49497
49497
|
var sq = k((aq) => {
|
|
49498
49498
|
Object.defineProperty(aq, "__esModule", { value: true });
|
|
49499
|
-
var
|
|
49499
|
+
var ok45 = Q$(), tk = { keyword: "not", schemaType: ["object", "boolean"], trackErrors: true, code($) {
|
|
49500
49500
|
let { gen: X, schema: J, it: Q } = $;
|
|
49501
|
-
if ((0,
|
|
49501
|
+
if ((0, ok45.alwaysValidSchema)(Q, J)) {
|
|
49502
49502
|
$.fail();
|
|
49503
49503
|
return;
|
|
49504
49504
|
}
|
|
@@ -66197,15 +66197,15 @@ async function makeRequest(url2, fetchOptions, fetchFn = fetch) {
|
|
|
66197
66197
|
return response;
|
|
66198
66198
|
}
|
|
66199
66199
|
function handleResponseError(e3, url2) {
|
|
66200
|
-
let
|
|
66201
|
-
if (
|
|
66202
|
-
|
|
66203
|
-
|
|
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;
|
|
66204
66204
|
} else if (!(e3 instanceof GoogleGenerativeAIFetchError || e3 instanceof GoogleGenerativeAIRequestInputError)) {
|
|
66205
|
-
|
|
66206
|
-
|
|
66205
|
+
err41 = new GoogleGenerativeAIError(`Error fetching from ${url2.toString()}: ${e3.message}`);
|
|
66206
|
+
err41.stack = e3.stack;
|
|
66207
66207
|
}
|
|
66208
|
-
throw
|
|
66208
|
+
throw err41;
|
|
66209
66209
|
}
|
|
66210
66210
|
async function handleResponseNotOk(response, url2) {
|
|
66211
66211
|
let message = "";
|
|
@@ -66452,14 +66452,14 @@ function getResponseStream(inputStream) {
|
|
|
66452
66452
|
}
|
|
66453
66453
|
return pump();
|
|
66454
66454
|
}).catch((e3) => {
|
|
66455
|
-
let
|
|
66456
|
-
|
|
66457
|
-
if (
|
|
66458
|
-
|
|
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");
|
|
66459
66459
|
} else {
|
|
66460
|
-
|
|
66460
|
+
err41 = new GoogleGenerativeAIError("Error reading from the stream");
|
|
66461
66461
|
}
|
|
66462
|
-
throw
|
|
66462
|
+
throw err41;
|
|
66463
66463
|
});
|
|
66464
66464
|
}
|
|
66465
66465
|
}
|
|
@@ -67055,15 +67055,15 @@ async function makeRequest2(url2, fetchOptions, fetchFn = fetch) {
|
|
|
67055
67055
|
return response;
|
|
67056
67056
|
}
|
|
67057
67057
|
function handleResponseError2(e3, url2) {
|
|
67058
|
-
let
|
|
67059
|
-
if (
|
|
67060
|
-
|
|
67061
|
-
|
|
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;
|
|
67062
67062
|
} else if (!(e3 instanceof GoogleGenerativeAIFetchError2 || e3 instanceof GoogleGenerativeAIRequestInputError2)) {
|
|
67063
|
-
|
|
67064
|
-
|
|
67063
|
+
err41 = new GoogleGenerativeAIError2(`Error fetching from ${url2.toString()}: ${e3.message}`);
|
|
67064
|
+
err41.stack = e3.stack;
|
|
67065
67065
|
}
|
|
67066
|
-
throw
|
|
67066
|
+
throw err41;
|
|
67067
67067
|
}
|
|
67068
67068
|
async function handleResponseNotOk2(response, url2) {
|
|
67069
67069
|
let message = "";
|
|
@@ -67102,8 +67102,8 @@ var ServerRequestUrl = class {
|
|
|
67102
67102
|
this.apiKey = apiKey;
|
|
67103
67103
|
this.requestOptions = requestOptions;
|
|
67104
67104
|
}
|
|
67105
|
-
appendPath(
|
|
67106
|
-
this._url.pathname = this._url.pathname + `/${
|
|
67105
|
+
appendPath(path40) {
|
|
67106
|
+
this._url.pathname = this._url.pathname + `/${path40}`;
|
|
67107
67107
|
}
|
|
67108
67108
|
appendParam(key, value) {
|
|
67109
67109
|
this._url.searchParams.append(key, value);
|
|
@@ -67683,34 +67683,34 @@ var uuid42 = function() {
|
|
|
67683
67683
|
};
|
|
67684
67684
|
|
|
67685
67685
|
// ../../node_modules/.pnpm/@anthropic-ai+sdk@0.87.0_zod@4.3.6/node_modules/@anthropic-ai/sdk/internal/errors.mjs
|
|
67686
|
-
function isAbortError(
|
|
67687
|
-
return typeof
|
|
67688
|
-
("name" in
|
|
67689
|
-
"message" in
|
|
67690
|
-
}
|
|
67691
|
-
var castToError = (
|
|
67692
|
-
if (
|
|
67693
|
-
return
|
|
67694
|
-
if (typeof
|
|
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) {
|
|
67695
67695
|
try {
|
|
67696
|
-
if (Object.prototype.toString.call(
|
|
67697
|
-
const error48 = new Error(
|
|
67698
|
-
if (
|
|
67699
|
-
error48.stack =
|
|
67700
|
-
if (
|
|
67701
|
-
error48.cause =
|
|
67702
|
-
if (
|
|
67703
|
-
error48.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;
|
|
67704
67704
|
return error48;
|
|
67705
67705
|
}
|
|
67706
67706
|
} catch {
|
|
67707
67707
|
}
|
|
67708
67708
|
try {
|
|
67709
|
-
return new Error(JSON.stringify(
|
|
67709
|
+
return new Error(JSON.stringify(err41));
|
|
67710
67710
|
} catch {
|
|
67711
67711
|
}
|
|
67712
67712
|
}
|
|
67713
|
-
return new Error(
|
|
67713
|
+
return new Error(err41);
|
|
67714
67714
|
};
|
|
67715
67715
|
|
|
67716
67716
|
// ../../node_modules/.pnpm/@anthropic-ai+sdk@0.87.0_zod@4.3.6/node_modules/@anthropic-ai/sdk/core/error.mjs
|
|
@@ -67840,7 +67840,7 @@ var validatePositiveInteger = (name, n3) => {
|
|
|
67840
67840
|
var safeJSON = (text) => {
|
|
67841
67841
|
try {
|
|
67842
67842
|
return JSON.parse(text);
|
|
67843
|
-
} catch (
|
|
67843
|
+
} catch (err41) {
|
|
67844
67844
|
return void 0;
|
|
67845
67845
|
}
|
|
67846
67846
|
};
|
|
@@ -68404,8 +68404,8 @@ var Stream = class _Stream {
|
|
|
68404
68404
|
return ctrl.close();
|
|
68405
68405
|
const bytes = encodeUTF8(JSON.stringify(value) + "\n");
|
|
68406
68406
|
ctrl.enqueue(bytes);
|
|
68407
|
-
} catch (
|
|
68408
|
-
ctrl.error(
|
|
68407
|
+
} catch (err41) {
|
|
68408
|
+
ctrl.error(err41);
|
|
68409
68409
|
}
|
|
68410
68410
|
},
|
|
68411
68411
|
async cancel() {
|
|
@@ -68953,12 +68953,12 @@ function encodeURIPath(str3) {
|
|
|
68953
68953
|
return str3.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g, encodeURIComponent);
|
|
68954
68954
|
}
|
|
68955
68955
|
var EMPTY = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.create(null));
|
|
68956
|
-
var createPathTagFunction = (pathEncoder = encodeURIPath) => function
|
|
68956
|
+
var createPathTagFunction = (pathEncoder = encodeURIPath) => function path40(statics, ...params) {
|
|
68957
68957
|
if (statics.length === 1)
|
|
68958
68958
|
return statics[0];
|
|
68959
68959
|
let postPath = false;
|
|
68960
68960
|
const invalidSegments = [];
|
|
68961
|
-
const
|
|
68961
|
+
const path41 = statics.reduce((previousValue, currentValue, index) => {
|
|
68962
68962
|
if (/[?#]/.test(currentValue)) {
|
|
68963
68963
|
postPath = true;
|
|
68964
68964
|
}
|
|
@@ -68975,7 +68975,7 @@ var createPathTagFunction = (pathEncoder = encodeURIPath) => function path39(sta
|
|
|
68975
68975
|
}
|
|
68976
68976
|
return previousValue + currentValue + (index === params.length ? "" : encoded);
|
|
68977
68977
|
}, "");
|
|
68978
|
-
const pathOnly =
|
|
68978
|
+
const pathOnly = path41.split(/[?#]/, 1)[0];
|
|
68979
68979
|
const invalidSegmentPattern = /(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi;
|
|
68980
68980
|
let match2;
|
|
68981
68981
|
while ((match2 = invalidSegmentPattern.exec(pathOnly)) !== null) {
|
|
@@ -68996,10 +68996,10 @@ var createPathTagFunction = (pathEncoder = encodeURIPath) => function path39(sta
|
|
|
68996
68996
|
}, "");
|
|
68997
68997
|
throw new AnthropicError(`Path parameters result in path with invalid segments:
|
|
68998
68998
|
${invalidSegments.map((e3) => e3.error).join("\n")}
|
|
68999
|
-
${
|
|
68999
|
+
${path41}
|
|
69000
69000
|
${underline}`);
|
|
69001
69001
|
}
|
|
69002
|
-
return
|
|
69002
|
+
return path41;
|
|
69003
69003
|
};
|
|
69004
69004
|
var path5 = /* @__PURE__ */ createPathTagFunction(encodeURIPath);
|
|
69005
69005
|
|
|
@@ -70312,8 +70312,8 @@ var BetaMessageStream = class _BetaMessageStream {
|
|
|
70312
70312
|
if (jsonBuf) {
|
|
70313
70313
|
try {
|
|
70314
70314
|
newContent.input = partialParse(jsonBuf);
|
|
70315
|
-
} catch (
|
|
70316
|
-
const error48 = new AnthropicError(`Unable to parse tool parameter JSON from model. Please retry your request or adjust your prompt. Error: ${
|
|
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}`);
|
|
70317
70317
|
__classPrivateFieldGet(this, _BetaMessageStream_handleError, "f").call(this, error48);
|
|
70318
70318
|
}
|
|
70319
70319
|
}
|
|
@@ -70375,17 +70375,17 @@ var BetaMessageStream = class _BetaMessageStream {
|
|
|
70375
70375
|
}
|
|
70376
70376
|
readQueue.length = 0;
|
|
70377
70377
|
});
|
|
70378
|
-
this.on("abort", (
|
|
70378
|
+
this.on("abort", (err41) => {
|
|
70379
70379
|
done = true;
|
|
70380
70380
|
for (const reader of readQueue) {
|
|
70381
|
-
reader.reject(
|
|
70381
|
+
reader.reject(err41);
|
|
70382
70382
|
}
|
|
70383
70383
|
readQueue.length = 0;
|
|
70384
70384
|
});
|
|
70385
|
-
this.on("error", (
|
|
70385
|
+
this.on("error", (err41) => {
|
|
70386
70386
|
done = true;
|
|
70387
70387
|
for (const reader of readQueue) {
|
|
70388
|
-
reader.reject(
|
|
70388
|
+
reader.reject(err41);
|
|
70389
70389
|
}
|
|
70390
70390
|
readQueue.length = 0;
|
|
70391
70391
|
});
|
|
@@ -72628,17 +72628,17 @@ var MessageStream = class _MessageStream {
|
|
|
72628
72628
|
}
|
|
72629
72629
|
readQueue.length = 0;
|
|
72630
72630
|
});
|
|
72631
|
-
this.on("abort", (
|
|
72631
|
+
this.on("abort", (err41) => {
|
|
72632
72632
|
done = true;
|
|
72633
72633
|
for (const reader of readQueue) {
|
|
72634
|
-
reader.reject(
|
|
72634
|
+
reader.reject(err41);
|
|
72635
72635
|
}
|
|
72636
72636
|
readQueue.length = 0;
|
|
72637
72637
|
});
|
|
72638
|
-
this.on("error", (
|
|
72638
|
+
this.on("error", (err41) => {
|
|
72639
72639
|
done = true;
|
|
72640
72640
|
for (const reader of readQueue) {
|
|
72641
|
-
reader.reject(
|
|
72641
|
+
reader.reject(err41);
|
|
72642
72642
|
}
|
|
72643
72643
|
readQueue.length = 0;
|
|
72644
72644
|
});
|
|
@@ -73087,9 +73087,9 @@ var BaseAnthropic = class {
|
|
|
73087
73087
|
makeStatusError(status, error48, message, headers) {
|
|
73088
73088
|
return APIError.generate(status, error48, message, headers);
|
|
73089
73089
|
}
|
|
73090
|
-
buildURL(
|
|
73090
|
+
buildURL(path40, query, defaultBaseURL) {
|
|
73091
73091
|
const baseURL = !__classPrivateFieldGet(this, _BaseAnthropic_instances, "m", _BaseAnthropic_baseURLOverridden).call(this) && defaultBaseURL || this.baseURL;
|
|
73092
|
-
const url2 = isAbsoluteURL(
|
|
73092
|
+
const url2 = isAbsoluteURL(path40) ? new URL(path40) : new URL(baseURL + (baseURL.endsWith("/") && path40.startsWith("/") ? path40.slice(1) : path40));
|
|
73093
73093
|
const defaultQuery = this.defaultQuery();
|
|
73094
73094
|
const pathQuery = Object.fromEntries(url2.searchParams);
|
|
73095
73095
|
if (!isEmptyObj(defaultQuery) || !isEmptyObj(pathQuery)) {
|
|
@@ -73121,24 +73121,24 @@ var BaseAnthropic = class {
|
|
|
73121
73121
|
*/
|
|
73122
73122
|
async prepareRequest(request2, { url: url2, options: options2 }) {
|
|
73123
73123
|
}
|
|
73124
|
-
get(
|
|
73125
|
-
return this.methodRequest("get",
|
|
73124
|
+
get(path40, opts) {
|
|
73125
|
+
return this.methodRequest("get", path40, opts);
|
|
73126
73126
|
}
|
|
73127
|
-
post(
|
|
73128
|
-
return this.methodRequest("post",
|
|
73127
|
+
post(path40, opts) {
|
|
73128
|
+
return this.methodRequest("post", path40, opts);
|
|
73129
73129
|
}
|
|
73130
|
-
patch(
|
|
73131
|
-
return this.methodRequest("patch",
|
|
73130
|
+
patch(path40, opts) {
|
|
73131
|
+
return this.methodRequest("patch", path40, opts);
|
|
73132
73132
|
}
|
|
73133
|
-
put(
|
|
73134
|
-
return this.methodRequest("put",
|
|
73133
|
+
put(path40, opts) {
|
|
73134
|
+
return this.methodRequest("put", path40, opts);
|
|
73135
73135
|
}
|
|
73136
|
-
delete(
|
|
73137
|
-
return this.methodRequest("delete",
|
|
73136
|
+
delete(path40, opts) {
|
|
73137
|
+
return this.methodRequest("delete", path40, opts);
|
|
73138
73138
|
}
|
|
73139
|
-
methodRequest(method,
|
|
73139
|
+
methodRequest(method, path40, opts) {
|
|
73140
73140
|
return this.request(Promise.resolve(opts).then((opts2) => {
|
|
73141
|
-
return { method, path:
|
|
73141
|
+
return { method, path: path40, ...opts2 };
|
|
73142
73142
|
}));
|
|
73143
73143
|
}
|
|
73144
73144
|
request(options2, remainingRetries = null) {
|
|
@@ -73218,7 +73218,7 @@ var BaseAnthropic = class {
|
|
|
73218
73218
|
}
|
|
73219
73219
|
const retryMessage = shouldRetry ? `error; no more retries left` : `error; not retryable`;
|
|
73220
73220
|
loggerFor(this).info(`${responseInfo} - ${retryMessage}`);
|
|
73221
|
-
const errText = await response.text().catch((
|
|
73221
|
+
const errText = await response.text().catch((err45) => castToError(err45).message);
|
|
73222
73222
|
const errJSON = safeJSON(errText);
|
|
73223
73223
|
const errMessage = errJSON ? void 0 : errText;
|
|
73224
73224
|
loggerFor(this).debug(`[${requestLogID}] response error (${retryMessage})`, formatRequestDetails({
|
|
@@ -73229,8 +73229,8 @@ var BaseAnthropic = class {
|
|
|
73229
73229
|
message: errMessage,
|
|
73230
73230
|
durationMs: Date.now() - startTime
|
|
73231
73231
|
}));
|
|
73232
|
-
const
|
|
73233
|
-
throw
|
|
73232
|
+
const err41 = this.makeStatusError(response.status, errJSON, errMessage, response.headers);
|
|
73233
|
+
throw err41;
|
|
73234
73234
|
}
|
|
73235
73235
|
loggerFor(this).info(responseInfo);
|
|
73236
73236
|
loggerFor(this).debug(`[${requestLogID}] response start`, formatRequestDetails({
|
|
@@ -73242,8 +73242,8 @@ var BaseAnthropic = class {
|
|
|
73242
73242
|
}));
|
|
73243
73243
|
return { response, options: options2, controller, requestLogID, retryOfRequestLogID, startTime };
|
|
73244
73244
|
}
|
|
73245
|
-
getAPIList(
|
|
73246
|
-
return this.requestAPIList(Page2, opts && "then" in opts ? opts.then((opts2) => ({ method: "get", path:
|
|
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 });
|
|
73247
73247
|
}
|
|
73248
73248
|
requestAPIList(Page2, options2) {
|
|
73249
73249
|
const request2 = this.makeRequest(options2, null, void 0);
|
|
@@ -73331,8 +73331,8 @@ var BaseAnthropic = class {
|
|
|
73331
73331
|
}
|
|
73332
73332
|
async buildRequest(inputOptions, { retryCount = 0 } = {}) {
|
|
73333
73333
|
const options2 = { ...inputOptions };
|
|
73334
|
-
const { method, path:
|
|
73335
|
-
const url2 = this.buildURL(
|
|
73334
|
+
const { method, path: path40, query, defaultBaseURL } = options2;
|
|
73335
|
+
const url2 = this.buildURL(path40, query, defaultBaseURL);
|
|
73336
73336
|
if ("timeout" in options2)
|
|
73337
73337
|
validatePositiveInteger("timeout", options2.timeout);
|
|
73338
73338
|
options2.timeout = options2.timeout ?? this.timeout;
|
|
@@ -73519,6 +73519,21 @@ function dismissalsPath(baseDirectory, override) {
|
|
|
73519
73519
|
return import_node_path6.default.join(baseDirectory, ".xqa", "dismissals.json");
|
|
73520
73520
|
}
|
|
73521
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
|
+
|
|
73522
73537
|
// ../../packages/tools/dist/index.js
|
|
73523
73538
|
var import_neverthrow18 = __toESM(require_index_cjs(), 1);
|
|
73524
73539
|
function buildGetOutputTool() {
|
|
@@ -75166,11 +75181,11 @@ function readEntries(entries) {
|
|
|
75166
75181
|
);
|
|
75167
75182
|
}
|
|
75168
75183
|
function readEntry(entry) {
|
|
75169
|
-
const
|
|
75184
|
+
const safeReadFile8 = (0, import_neverthrow31.fromAsyncThrowable)(
|
|
75170
75185
|
async () => (0, import_promises16.readFile)(entry.path, "utf8"),
|
|
75171
75186
|
(cause) => ({ type: "FILE_READ_FAILED", path: entry.path, cause })
|
|
75172
75187
|
);
|
|
75173
|
-
return
|
|
75188
|
+
return safeReadFile8().map((content) => [{ name: entry.name, content }]).orElse((error48) => entry.required ? (0, import_neverthrow31.errAsync)(error48) : (0, import_neverthrow31.okAsync)([]));
|
|
75174
75189
|
}
|
|
75175
75190
|
function specNameFromPath(filePath) {
|
|
75176
75191
|
const parts = filePath.split("/");
|
|
@@ -76297,7 +76312,7 @@ var directiveHandlers = {
|
|
|
76297
76312
|
}
|
|
76298
76313
|
try {
|
|
76299
76314
|
prefix = decodeURIComponent(prefix);
|
|
76300
|
-
} catch (
|
|
76315
|
+
} catch (err41) {
|
|
76301
76316
|
throwError(state, "tag prefix is malformed: " + prefix);
|
|
76302
76317
|
}
|
|
76303
76318
|
state.tagMap[handle] = prefix;
|
|
@@ -76978,7 +76993,7 @@ function readTagProperty(state) {
|
|
|
76978
76993
|
}
|
|
76979
76994
|
try {
|
|
76980
76995
|
tagName = decodeURIComponent(tagName);
|
|
76981
|
-
} catch (
|
|
76996
|
+
} catch (err41) {
|
|
76982
76997
|
throwError(state, "tag name is malformed: " + tagName);
|
|
76983
76998
|
}
|
|
76984
76999
|
if (isVerbatim) {
|
|
@@ -80353,23 +80368,24 @@ var import_neverthrow61 = __toESM(require_index_cjs(), 1);
|
|
|
80353
80368
|
var import_promises23 = require("node:fs/promises");
|
|
80354
80369
|
var import_neverthrow62 = __toESM(require_index_cjs(), 1);
|
|
80355
80370
|
var import_neverthrow63 = __toESM(require_index_cjs(), 1);
|
|
80371
|
+
var import_neverthrow64 = __toESM(require_index_cjs(), 1);
|
|
80356
80372
|
var import_node_child_process6 = require("node:child_process");
|
|
80357
80373
|
var import_node_util = require("node:util");
|
|
80358
|
-
var
|
|
80374
|
+
var import_neverthrow65 = __toESM(require_index_cjs(), 1);
|
|
80359
80375
|
var import_node_process2 = require("node:process");
|
|
80360
80376
|
var import_node_child_process7 = require("node:child_process");
|
|
80361
80377
|
var import_node_util2 = require("node:util");
|
|
80362
|
-
var import_neverthrow65 = __toESM(require_index_cjs(), 1);
|
|
80363
80378
|
var import_neverthrow66 = __toESM(require_index_cjs(), 1);
|
|
80364
80379
|
var import_neverthrow67 = __toESM(require_index_cjs(), 1);
|
|
80380
|
+
var import_neverthrow68 = __toESM(require_index_cjs(), 1);
|
|
80365
80381
|
var import_promises24 = require("node:fs/promises");
|
|
80366
80382
|
var import_node_path20 = __toESM(require("node:path"), 1);
|
|
80367
|
-
var
|
|
80383
|
+
var import_neverthrow69 = __toESM(require_index_cjs(), 1);
|
|
80368
80384
|
var import_promises25 = require("node:fs/promises");
|
|
80369
80385
|
var import_node_path21 = __toESM(require("node:path"), 1);
|
|
80370
|
-
var import_neverthrow69 = __toESM(require_index_cjs(), 1);
|
|
80371
|
-
var import_promises26 = require("node:fs/promises");
|
|
80372
80386
|
var import_neverthrow70 = __toESM(require_index_cjs(), 1);
|
|
80387
|
+
var import_promises26 = require("node:fs/promises");
|
|
80388
|
+
var import_neverthrow71 = __toESM(require_index_cjs(), 1);
|
|
80373
80389
|
function isEmptySummary(summary) {
|
|
80374
80390
|
return summary.touchedFiles.length === 0 && summary.uncommittedFiles.length === 0;
|
|
80375
80391
|
}
|
|
@@ -81267,6 +81283,65 @@ var rawAtomicWrite = import_neverthrow62.ResultAsync.fromThrowable(
|
|
|
81267
81283
|
function atomicWrite(input) {
|
|
81268
81284
|
return rawAtomicWrite(input).map(() => void 0).mapErr(({ cause }) => ({ type: "SPEC_WRITE_FAILED", path: input.path, cause }));
|
|
81269
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
|
+
}
|
|
81270
81345
|
function matchByScenarioId(finding, scenario) {
|
|
81271
81346
|
return finding.scenarioId !== void 0 && finding.scenarioId === scenario.scenarioId;
|
|
81272
81347
|
}
|
|
@@ -81306,31 +81381,38 @@ function pickFindingsForScenario(pairs2, scenarioId) {
|
|
|
81306
81381
|
function pickUnmatched(pairs2) {
|
|
81307
81382
|
return pairs2.filter((pair) => pair.scenarioId === void 0).map((pair) => pair.finding);
|
|
81308
81383
|
}
|
|
81309
|
-
function deriveStatus(findingsForScenario) {
|
|
81310
|
-
|
|
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";
|
|
81311
81392
|
}
|
|
81312
81393
|
function buildCorrelatedSteps(scenario) {
|
|
81313
81394
|
return scenario.steps.map((step) => ({ text: step.intent, status: "unknown" }));
|
|
81314
81395
|
}
|
|
81315
81396
|
function buildCorrelatedScenario(input) {
|
|
81316
|
-
const { scenario, findings, specFilesByScenarioId } = input;
|
|
81397
|
+
const { scenario, findings, specFilesByScenarioId, runRecord } = input;
|
|
81317
81398
|
return {
|
|
81318
81399
|
scenarioId: scenario.scenarioId,
|
|
81319
81400
|
file: specFilesByScenarioId?.[scenario.scenarioId] ?? "",
|
|
81320
81401
|
feature: scenario.feature,
|
|
81321
|
-
status: deriveStatus(findings),
|
|
81402
|
+
status: deriveStatus(findings, runRecord),
|
|
81322
81403
|
steps: buildCorrelatedSteps(scenario),
|
|
81323
81404
|
findings
|
|
81324
81405
|
};
|
|
81325
81406
|
}
|
|
81326
81407
|
function correlate(input) {
|
|
81327
|
-
const { scenarios, findings, specFilesByScenarioId } = input;
|
|
81408
|
+
const { scenarios, findings, specFilesByScenarioId, runRecordsByScenarioId } = input;
|
|
81328
81409
|
const pairs2 = pairFindingsWithScenarios(scenarios, findings);
|
|
81329
81410
|
const correlatedScenarios = scenarios.map(
|
|
81330
81411
|
(scenario) => buildCorrelatedScenario({
|
|
81331
81412
|
scenario,
|
|
81332
81413
|
findings: pickFindingsForScenario(pairs2, scenario.scenarioId),
|
|
81333
|
-
specFilesByScenarioId
|
|
81414
|
+
specFilesByScenarioId,
|
|
81415
|
+
runRecord: runRecordsByScenarioId?.[scenario.scenarioId]
|
|
81334
81416
|
})
|
|
81335
81417
|
);
|
|
81336
81418
|
return {
|
|
@@ -81340,116 +81422,138 @@ function correlate(input) {
|
|
|
81340
81422
|
}
|
|
81341
81423
|
var REPORT_INDENT = 2;
|
|
81342
81424
|
var REPORT_FILENAME = "report.json";
|
|
81425
|
+
var RUNS_FILENAME = "scenario-runs.json";
|
|
81426
|
+
var ENOENT_CODE = "ENOENT";
|
|
81343
81427
|
var findingsArraySchema = external_exports.array(findingSchema);
|
|
81344
81428
|
var safeJsonParse4 = (0, import_neverthrow61.fromThrowable)(
|
|
81345
81429
|
JSON.parse,
|
|
81346
81430
|
(cause) => ({ cause })
|
|
81347
81431
|
);
|
|
81348
|
-
|
|
81349
|
-
|
|
81350
|
-
|
|
81351
|
-
|
|
81352
|
-
|
|
81353
|
-
|
|
81354
|
-
|
|
81355
|
-
draft.assertions = spec.assertions;
|
|
81356
|
-
}
|
|
81357
|
-
if (spec.timeout !== void 0) {
|
|
81358
|
-
draft.timeout = spec.timeout;
|
|
81359
|
-
}
|
|
81360
|
-
return draft;
|
|
81361
|
-
}
|
|
81362
|
-
function toScenarioMeta2(spec) {
|
|
81363
|
-
return {
|
|
81364
|
-
scenarioId: spec.scenarioId,
|
|
81365
|
-
baseCommit: spec.baseCommit,
|
|
81366
|
-
generatedFromHead: spec.generatedFromHead,
|
|
81367
|
-
createdAt: spec.createdAt
|
|
81368
|
-
};
|
|
81369
|
-
}
|
|
81370
|
-
function toScenario(entry) {
|
|
81371
|
-
if (!isMetaComplete(entry.spec)) {
|
|
81372
|
-
return (0, import_neverthrow61.err)({
|
|
81373
|
-
type: "SPEC_PARSE_FAILED",
|
|
81374
|
-
path: entry.path,
|
|
81375
|
-
reason: "missing required meta field"
|
|
81376
|
-
});
|
|
81377
|
-
}
|
|
81378
|
-
return (0, import_neverthrow61.ok)({ ...toScenarioDraft2(entry.spec), ...toScenarioMeta2(entry.spec) });
|
|
81379
|
-
}
|
|
81380
|
-
function collectScenarios(entries) {
|
|
81381
|
-
const scenarios = [];
|
|
81382
|
-
for (const entry of entries) {
|
|
81383
|
-
const result = toScenario(entry);
|
|
81384
|
-
if (result.isErr()) {
|
|
81385
|
-
return (0, import_neverthrow61.err)(result.error);
|
|
81386
|
-
}
|
|
81387
|
-
scenarios.push(result.value);
|
|
81388
|
-
}
|
|
81389
|
-
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;
|
|
81390
81439
|
}
|
|
81391
|
-
function
|
|
81392
|
-
|
|
81393
|
-
|
|
81394
|
-
|
|
81395
|
-
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);
|
|
81396
81444
|
}
|
|
81397
|
-
return
|
|
81445
|
+
return (0, import_neverthrow61.err)({ type: "FINDINGS_READ_FAILED", path: filePath, cause });
|
|
81398
81446
|
});
|
|
81399
|
-
return Object.fromEntries(pairs2);
|
|
81400
|
-
}
|
|
81401
|
-
function buildScenarioPair(entries) {
|
|
81402
|
-
return collectScenarios(entries).map((scenarios) => ({
|
|
81403
|
-
scenarios,
|
|
81404
|
-
filesByScenarioId: buildFilesMap(entries)
|
|
81405
|
-
}));
|
|
81406
81447
|
}
|
|
81407
81448
|
function parseFindingsJson(input) {
|
|
81408
81449
|
return safeJsonParse4(input.raw).mapErr(
|
|
81409
81450
|
({ cause }) => ({ type: "FINDINGS_READ_FAILED", path: input.path, cause })
|
|
81410
81451
|
);
|
|
81411
81452
|
}
|
|
81412
|
-
function validateFindingsSchema(data,
|
|
81453
|
+
function validateFindingsSchema(data, filePath) {
|
|
81413
81454
|
const parsed = findingsArraySchema.safeParse(data);
|
|
81414
81455
|
if (!parsed.success) {
|
|
81415
|
-
return (0, import_neverthrow61.err)({ type: "FINDINGS_READ_FAILED", path:
|
|
81456
|
+
return (0, import_neverthrow61.err)({ type: "FINDINGS_READ_FAILED", path: filePath, cause: parsed.error });
|
|
81416
81457
|
}
|
|
81417
81458
|
return (0, import_neverthrow61.ok)(parsed.data);
|
|
81418
81459
|
}
|
|
81419
81460
|
function validateFindings(input) {
|
|
81420
81461
|
return parseFindingsJson(input).andThen((data) => validateFindingsSchema(data, input.path));
|
|
81421
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
|
+
}
|
|
81422
81476
|
function reportPathFor(findingsPath) {
|
|
81423
81477
|
return import_node_path19.default.join(import_node_path19.default.dirname(findingsPath), REPORT_FILENAME);
|
|
81424
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
|
+
}
|
|
81425
81485
|
function buildReport(input) {
|
|
81426
|
-
|
|
81486
|
+
const base = {
|
|
81427
81487
|
scenarios: input.pair.scenarios,
|
|
81428
81488
|
findings: input.findings,
|
|
81429
81489
|
specFilesByScenarioId: input.pair.filesByScenarioId
|
|
81430
|
-
}
|
|
81490
|
+
};
|
|
81491
|
+
if (input.runRecordsByScenarioId !== void 0) {
|
|
81492
|
+
return correlate({ ...base, runRecordsByScenarioId: input.runRecordsByScenarioId });
|
|
81493
|
+
}
|
|
81494
|
+
return correlate(base);
|
|
81431
81495
|
}
|
|
81432
81496
|
function writeReport(input) {
|
|
81433
81497
|
const content = JSON.stringify(input.report, void 0, REPORT_INDENT);
|
|
81434
81498
|
return input.writeReportFile({ path: reportPathFor(input.findingsPath), content }).map(() => input.report);
|
|
81435
81499
|
}
|
|
81436
81500
|
function correlateAndPersist(input) {
|
|
81437
|
-
const report = buildReport({
|
|
81501
|
+
const report = buildReport({
|
|
81502
|
+
findings: input.findings,
|
|
81503
|
+
pair: input.pair,
|
|
81504
|
+
runRecordsByScenarioId: input.runRecordsByScenarioId
|
|
81505
|
+
});
|
|
81438
81506
|
return writeReport({
|
|
81439
81507
|
report,
|
|
81440
81508
|
findingsPath: input.findingsPath,
|
|
81441
81509
|
writeReportFile: input.writeReportFile
|
|
81442
81510
|
});
|
|
81443
81511
|
}
|
|
81444
|
-
|
|
81445
|
-
|
|
81446
|
-
|
|
81447
|
-
)
|
|
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
|
+
}
|
|
81448
81549
|
function readFindingsFile(filePath) {
|
|
81449
|
-
return
|
|
81550
|
+
return rawReadFile(filePath).mapErr(
|
|
81450
81551
|
({ cause }) => ({ type: "FINDINGS_READ_FAILED", path: filePath, cause })
|
|
81451
81552
|
);
|
|
81452
81553
|
}
|
|
81554
|
+
function readRunsFile(filePath) {
|
|
81555
|
+
return readFileOptional(filePath);
|
|
81556
|
+
}
|
|
81453
81557
|
function writeReportFile(input) {
|
|
81454
81558
|
return atomicWrite(input);
|
|
81455
81559
|
}
|
|
@@ -81457,10 +81561,12 @@ function reportRun(input, deps) {
|
|
|
81457
81561
|
return deps.readFindingsFile(input.findingsPath).andThen((raw) => validateFindings({ raw, path: input.findingsPath })).andThen(
|
|
81458
81562
|
(findings) => deps.readPlan({ directory: input.specsDirectory }).andThen((entries) => buildScenarioPair(entries)).map((pair) => ({ findings, pair }))
|
|
81459
81563
|
).andThen(
|
|
81460
|
-
({ findings, pair }) =>
|
|
81564
|
+
({ findings, pair }) => loadAndCorrelate({
|
|
81461
81565
|
findings,
|
|
81462
81566
|
pair,
|
|
81463
81567
|
findingsPath: input.findingsPath,
|
|
81568
|
+
runsPath: input.runsPath,
|
|
81569
|
+
readRunsFileFn: deps.readRunsFile,
|
|
81464
81570
|
writeReportFile: deps.writeReportFile
|
|
81465
81571
|
})
|
|
81466
81572
|
);
|
|
@@ -81479,13 +81585,13 @@ async function createMessage(input) {
|
|
|
81479
81585
|
function extractText(message, operation) {
|
|
81480
81586
|
const firstBlock = message.content[0];
|
|
81481
81587
|
if (firstBlock?.type !== "text") {
|
|
81482
|
-
return (0,
|
|
81588
|
+
return (0, import_neverthrow64.err)({
|
|
81483
81589
|
type: "AI_RESPONSE_INVALID",
|
|
81484
81590
|
operation,
|
|
81485
81591
|
raw: JSON.stringify(message.content)
|
|
81486
81592
|
});
|
|
81487
81593
|
}
|
|
81488
|
-
return (0,
|
|
81594
|
+
return (0, import_neverthrow64.ok)(firstBlock.text);
|
|
81489
81595
|
}
|
|
81490
81596
|
function buildClient(apiKey) {
|
|
81491
81597
|
return new Anthropic({ apiKey });
|
|
@@ -81493,7 +81599,7 @@ function buildClient(apiKey) {
|
|
|
81493
81599
|
function invokeAi(arguments_) {
|
|
81494
81600
|
const { input, operation } = arguments_;
|
|
81495
81601
|
const client = buildClient(input.config.apiKey);
|
|
81496
|
-
const callMessage = (0,
|
|
81602
|
+
const callMessage = (0, import_neverthrow64.fromAsyncThrowable)(
|
|
81497
81603
|
createMessage,
|
|
81498
81604
|
(cause) => ({ type: "AI_CALL_FAILED", operation, cause })
|
|
81499
81605
|
);
|
|
@@ -81544,7 +81650,7 @@ async function runGit(input) {
|
|
|
81544
81650
|
}
|
|
81545
81651
|
function execGit(commandArguments, context) {
|
|
81546
81652
|
const command = `git ${commandArguments.join(" ")}`;
|
|
81547
|
-
return (0,
|
|
81653
|
+
return (0, import_neverthrow65.fromAsyncThrowable)(
|
|
81548
81654
|
runGit,
|
|
81549
81655
|
(cause) => toExecError(cause, command)
|
|
81550
81656
|
)({ commandArguments, context });
|
|
@@ -81558,9 +81664,9 @@ function splitNonEmptyLines(value) {
|
|
|
81558
81664
|
}
|
|
81559
81665
|
function foldCommitExists(error48) {
|
|
81560
81666
|
if (error48.type === "GIT_EXEC_FAILED") {
|
|
81561
|
-
return (0,
|
|
81667
|
+
return (0, import_neverthrow65.okAsync)(false);
|
|
81562
81668
|
}
|
|
81563
|
-
return (0,
|
|
81669
|
+
return (0, import_neverthrow65.errAsync)(error48);
|
|
81564
81670
|
}
|
|
81565
81671
|
function resolveDetachedHead(context) {
|
|
81566
81672
|
return execGit(["rev-parse", "HEAD"], context).map(
|
|
@@ -81613,7 +81719,7 @@ async function runGh(input) {
|
|
|
81613
81719
|
});
|
|
81614
81720
|
return { stdout, stderr };
|
|
81615
81721
|
}
|
|
81616
|
-
var safeRunGh = (0,
|
|
81722
|
+
var safeRunGh = (0, import_neverthrow66.fromAsyncThrowable)(
|
|
81617
81723
|
runGh,
|
|
81618
81724
|
(cause) => ({ type: "GH_PR_LOOKUP_FAILED", cause })
|
|
81619
81725
|
);
|
|
@@ -81624,9 +81730,9 @@ function ghDetectPrBaseBranch(context) {
|
|
|
81624
81730
|
}).andThen((result) => {
|
|
81625
81731
|
const value = result.stdout.trim();
|
|
81626
81732
|
if (value.length === 0) {
|
|
81627
|
-
return (0,
|
|
81733
|
+
return (0, import_neverthrow66.errAsync)({ type: "GH_PR_LOOKUP_FAILED", cause: "empty-output" });
|
|
81628
81734
|
}
|
|
81629
|
-
return (0,
|
|
81735
|
+
return (0, import_neverthrow66.okAsync)(value);
|
|
81630
81736
|
});
|
|
81631
81737
|
}
|
|
81632
81738
|
function resolveBaseBranch(gitContext, deps) {
|
|
@@ -81693,6 +81799,29 @@ ${intent || "(none provided)"}
|
|
|
81693
81799
|
|
|
81694
81800
|
${appContext || "(none provided)"}`;
|
|
81695
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
|
+
}
|
|
81696
81825
|
function renderRulesSection() {
|
|
81697
81826
|
return `## Rules
|
|
81698
81827
|
|
|
@@ -81712,7 +81841,8 @@ function renderRulesSection() {
|
|
|
81712
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": []}.
|
|
81713
81842
|
5. Every interactive step MUST include an outcome describing the observable post-condition.
|
|
81714
81843
|
6. Ground each scenario strictly in the Change Summary \u2014 do not invent flows that the touched files cannot reach.
|
|
81715
|
-
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()}`;
|
|
81716
81846
|
}
|
|
81717
81847
|
function buildScenarioEmitterPrompt(input) {
|
|
81718
81848
|
const summarySection = renderSummarySection(input.summary);
|
|
@@ -81749,20 +81879,20 @@ var scenarioDraftSchema = external_exports.object({
|
|
|
81749
81879
|
coverageNote: external_exports.string().optional()
|
|
81750
81880
|
});
|
|
81751
81881
|
var payloadSchema = external_exports.object({ scenarios: external_exports.array(scenarioDraftSchema) });
|
|
81752
|
-
var safeParseJson3 = (0,
|
|
81882
|
+
var safeParseJson3 = (0, import_neverthrow67.fromThrowable)(
|
|
81753
81883
|
(raw) => JSON.parse(raw),
|
|
81754
81884
|
() => ({ type: "AI_RESPONSE_JSON_PARSE" })
|
|
81755
81885
|
);
|
|
81756
81886
|
function validatePayload(raw) {
|
|
81757
81887
|
const parsed = safeParseJson3(raw);
|
|
81758
81888
|
if (parsed.isErr()) {
|
|
81759
|
-
return (0,
|
|
81889
|
+
return (0, import_neverthrow67.err)({ type: "AI_RESPONSE_INVALID", operation: "scenario-emit", raw });
|
|
81760
81890
|
}
|
|
81761
81891
|
const validated = payloadSchema.safeParse(parsed.value);
|
|
81762
81892
|
if (!validated.success) {
|
|
81763
|
-
return (0,
|
|
81893
|
+
return (0, import_neverthrow67.err)({ type: "AI_RESPONSE_INVALID", operation: "scenario-emit", raw });
|
|
81764
81894
|
}
|
|
81765
|
-
return (0,
|
|
81895
|
+
return (0, import_neverthrow67.ok)(validated.data.scenarios);
|
|
81766
81896
|
}
|
|
81767
81897
|
function emitScenarios(input, deps) {
|
|
81768
81898
|
const prompt = buildScenarioEmitterPrompt({
|
|
@@ -81844,14 +81974,14 @@ function validateCandidate(validateInput) {
|
|
|
81844
81974
|
const { raw, existingSpec, specPath } = validateInput;
|
|
81845
81975
|
const parsed = parseSpec(raw, specPath);
|
|
81846
81976
|
if (parsed.isErr()) {
|
|
81847
|
-
return (0,
|
|
81977
|
+
return (0, import_neverthrow68.err)({ type: "AI_RESPONSE_INVALID", operation: "edit-apply", raw });
|
|
81848
81978
|
}
|
|
81849
81979
|
const candidate = parsed.value;
|
|
81850
81980
|
const violated = findMissingOrChangedKey(candidate, existingSpec);
|
|
81851
81981
|
if (violated !== void 0) {
|
|
81852
|
-
return (0,
|
|
81982
|
+
return (0, import_neverthrow68.err)({ type: "SCENARIO_ID_LOST_IN_EDIT", path: specPath });
|
|
81853
81983
|
}
|
|
81854
|
-
return (0,
|
|
81984
|
+
return (0, import_neverthrow68.ok)(candidate);
|
|
81855
81985
|
}
|
|
81856
81986
|
function applyEdit(input, deps) {
|
|
81857
81987
|
const prompt = buildEditApplierPrompt(input.existingSpec, input.userFeedback);
|
|
@@ -81869,19 +81999,19 @@ function mapReaddirError(input) {
|
|
|
81869
81999
|
}
|
|
81870
82000
|
return { type: "SPEC_READ_FAILED", path: input.directory, cause: input.cause };
|
|
81871
82001
|
}
|
|
81872
|
-
var rawReaddir =
|
|
82002
|
+
var rawReaddir = import_neverthrow69.ResultAsync.fromThrowable(
|
|
81873
82003
|
async (directory) => (0, import_promises24.readdir)(directory),
|
|
81874
82004
|
(cause) => ({ cause })
|
|
81875
82005
|
);
|
|
81876
82006
|
function safeReaddir(directory) {
|
|
81877
82007
|
return rawReaddir(directory).mapErr(({ cause }) => mapReaddirError({ directory, cause }));
|
|
81878
82008
|
}
|
|
81879
|
-
var
|
|
82009
|
+
var rawReadFile2 = import_neverthrow69.ResultAsync.fromThrowable(
|
|
81880
82010
|
async (input) => (0, import_promises24.readFile)(input.path, "utf8"),
|
|
81881
82011
|
(cause) => ({ cause })
|
|
81882
82012
|
);
|
|
81883
82013
|
function safeReadFile3(input) {
|
|
81884
|
-
return
|
|
82014
|
+
return rawReadFile2(input).mapErr(
|
|
81885
82015
|
({ cause }) => ({ type: "SPEC_READ_FAILED", path: input.path, cause })
|
|
81886
82016
|
);
|
|
81887
82017
|
}
|
|
@@ -81896,17 +82026,17 @@ function readEntry2(input) {
|
|
|
81896
82026
|
}
|
|
81897
82027
|
function readEntries2(directory, filenames) {
|
|
81898
82028
|
const tasks = filenames.map((filename) => readEntry2({ directory, filename }));
|
|
81899
|
-
return
|
|
82029
|
+
return import_neverthrow69.ResultAsync.combine([...tasks]);
|
|
81900
82030
|
}
|
|
81901
82031
|
function readPlan(input) {
|
|
81902
82032
|
return safeReaddir(input.directory).map((filenames) => filterAndSortSpecs(filenames)).andThen((filenames) => readEntries2(input.directory, filenames));
|
|
81903
82033
|
}
|
|
81904
82034
|
var SCENARIO_FILENAME_PATTERN = /^scenario-(\d+)\.test\.md$/;
|
|
81905
|
-
var safeMkdir =
|
|
82035
|
+
var safeMkdir = import_neverthrow70.ResultAsync.fromThrowable(
|
|
81906
82036
|
async (path43) => (0, import_promises25.mkdir)(path43, { recursive: true }),
|
|
81907
82037
|
(cause) => ({ type: "SPEC_WRITE_FAILED", path: "", cause })
|
|
81908
82038
|
);
|
|
81909
|
-
var safeReaddir2 =
|
|
82039
|
+
var safeReaddir2 = import_neverthrow70.ResultAsync.fromThrowable(
|
|
81910
82040
|
async (path43) => (0, import_promises25.readdir)(path43),
|
|
81911
82041
|
(cause) => ({ type: "SPEC_WRITE_FAILED", path: "", cause })
|
|
81912
82042
|
);
|
|
@@ -81957,12 +82087,12 @@ function writeAllScenarios(input, startIndex) {
|
|
|
81957
82087
|
context: input.context
|
|
81958
82088
|
})
|
|
81959
82089
|
);
|
|
81960
|
-
return
|
|
82090
|
+
return import_neverthrow70.ResultAsync.combine([...tasks]);
|
|
81961
82091
|
}
|
|
81962
82092
|
function writeScenarios(input) {
|
|
81963
82093
|
return ensureDirectory(input.directory).andThen(() => listScenarioIndices(input.directory)).map((indices) => computeNextIndex(indices)).andThen((startIndex) => writeAllScenarios(input, startIndex));
|
|
81964
82094
|
}
|
|
81965
|
-
var readFileByPath =
|
|
82095
|
+
var readFileByPath = import_neverthrow71.ResultAsync.fromThrowable(
|
|
81966
82096
|
async (path43) => (0, import_promises26.readFile)(path43, "utf8"),
|
|
81967
82097
|
(cause) => ({ cause })
|
|
81968
82098
|
);
|
|
@@ -81998,10 +82128,10 @@ var EXIT_PLAN_EMPTY = 45;
|
|
|
81998
82128
|
var EXIT_SCENARIO_ID_LOST_IN_EDIT = 51;
|
|
81999
82129
|
|
|
82000
82130
|
// src/commands/plan/format-diagnostic.ts
|
|
82001
|
-
var
|
|
82131
|
+
var import_neverthrow72 = __toESM(require_index_cjs(), 1);
|
|
82002
82132
|
var RAW_TRUNCATION_LIMIT = 200;
|
|
82003
82133
|
var UNSERIALIZABLE2 = "[unserializable]";
|
|
82004
|
-
var safeStringify2 = (0,
|
|
82134
|
+
var safeStringify2 = (0, import_neverthrow72.fromThrowable)(
|
|
82005
82135
|
(value) => JSON.stringify(value),
|
|
82006
82136
|
() => UNSERIALIZABLE2
|
|
82007
82137
|
);
|
|
@@ -82295,13 +82425,19 @@ var import_node_path24 = __toESM(require("node:path"), 1);
|
|
|
82295
82425
|
var DEPS3 = {
|
|
82296
82426
|
readPlan,
|
|
82297
82427
|
readFindingsFile,
|
|
82298
|
-
writeReportFile
|
|
82428
|
+
writeReportFile,
|
|
82429
|
+
readRunsFile
|
|
82299
82430
|
};
|
|
82300
82431
|
function buildReportInput(input) {
|
|
82301
|
-
|
|
82302
|
-
|
|
82432
|
+
const resolvedFindingsPath = import_node_path24.default.resolve(process.cwd(), input.findingsPath);
|
|
82433
|
+
const base = {
|
|
82434
|
+
findingsPath: resolvedFindingsPath,
|
|
82303
82435
|
specsDirectory: resolveOutputDirectory(input.xqaDirectory, input.specsDirectory)
|
|
82304
82436
|
};
|
|
82437
|
+
if (input.runsPath !== void 0) {
|
|
82438
|
+
return { ...base, runsPath: import_node_path24.default.resolve(process.cwd(), input.runsPath) };
|
|
82439
|
+
}
|
|
82440
|
+
return base;
|
|
82305
82441
|
}
|
|
82306
82442
|
function executePipeline5(input) {
|
|
82307
82443
|
return reportRun(buildReportInput(input), DEPS3);
|
|
@@ -82337,7 +82473,12 @@ function invokePlanExtend(context, options2) {
|
|
|
82337
82473
|
}
|
|
82338
82474
|
function invokePlanReport(options2) {
|
|
82339
82475
|
const xqaDirectory = resolveXqaDirectory();
|
|
82340
|
-
|
|
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);
|
|
82341
82482
|
}
|
|
82342
82483
|
function registerExtendSubcommand(plan, loader2) {
|
|
82343
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) => {
|
|
@@ -82352,7 +82493,7 @@ function registerEditSubcommand(plan, loader2) {
|
|
|
82352
82493
|
});
|
|
82353
82494
|
}
|
|
82354
82495
|
function registerReportSubcommand(plan) {
|
|
82355
|
-
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) => {
|
|
82356
82497
|
invokePlanReport(options2);
|
|
82357
82498
|
});
|
|
82358
82499
|
}
|
|
@@ -82369,7 +82510,7 @@ function registerPlanCommand(program3, loader2) {
|
|
|
82369
82510
|
// src/commands/review-command.ts
|
|
82370
82511
|
var import_node_fs10 = require("node:fs");
|
|
82371
82512
|
var import_node_path26 = __toESM(require("node:path"), 1);
|
|
82372
|
-
var
|
|
82513
|
+
var import_neverthrow74 = __toESM(require_index_cjs(), 1);
|
|
82373
82514
|
|
|
82374
82515
|
// ../../node_modules/.pnpm/@inquirer+core@10.3.2_@types+node@22.19.15/node_modules/@inquirer/core/dist/esm/lib/key.js
|
|
82375
82516
|
var isUpKey = (key, keybindings = []) => (
|
|
@@ -83751,9 +83892,9 @@ var RemoveFileError = class extends Error {
|
|
|
83751
83892
|
// ../../node_modules/.pnpm/@inquirer+external-editor@1.0.3_@types+node@22.19.15/node_modules/@inquirer/external-editor/dist/esm/index.js
|
|
83752
83893
|
function editAsync(text = "", callback, fileOptions) {
|
|
83753
83894
|
const editor = new ExternalEditor(text, fileOptions);
|
|
83754
|
-
editor.runAsync((
|
|
83755
|
-
if (
|
|
83756
|
-
setImmediate(callback,
|
|
83895
|
+
editor.runAsync((err41, result) => {
|
|
83896
|
+
if (err41) {
|
|
83897
|
+
setImmediate(callback, err41, void 0);
|
|
83757
83898
|
} else {
|
|
83758
83899
|
try {
|
|
83759
83900
|
editor.cleanup();
|
|
@@ -84774,7 +84915,7 @@ var esm_default11 = createPrompt((config2, done) => {
|
|
|
84774
84915
|
});
|
|
84775
84916
|
|
|
84776
84917
|
// src/review-session.ts
|
|
84777
|
-
var
|
|
84918
|
+
var import_neverthrow73 = __toESM(require_index_cjs(), 1);
|
|
84778
84919
|
var FLOW_COL_WIDTH = 35;
|
|
84779
84920
|
var TRIGGER_COL_WIDTH = 16;
|
|
84780
84921
|
var CONFIDENCE_COL_WIDTH = 6;
|
|
@@ -84922,15 +85063,15 @@ async function runInteractiveLoop(findings, existing) {
|
|
|
84922
85063
|
}
|
|
84923
85064
|
return { staged: state.staged, undoneKeys: state.undoneKeys };
|
|
84924
85065
|
}
|
|
84925
|
-
var safeRunInteractiveLoop = (0,
|
|
85066
|
+
var safeRunInteractiveLoop = (0, import_neverthrow73.fromAsyncThrowable)(
|
|
84926
85067
|
runInteractiveLoop,
|
|
84927
85068
|
(error48) => error48 instanceof Error && error48.name === "ExitPromptError" ? "exit-prompt" : "unexpected"
|
|
84928
85069
|
);
|
|
84929
85070
|
|
|
84930
85071
|
// src/commands/review-command.ts
|
|
84931
|
-
var safeReadFile4 = (0,
|
|
84932
|
-
var safeParseJson4 = (0,
|
|
84933
|
-
var safeWrite = (0,
|
|
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) => {
|
|
84934
85075
|
(0, import_node_fs10.writeFileSync)(filePath, content);
|
|
84935
85076
|
});
|
|
84936
85077
|
function readLastPath(xqaDirectory) {
|
|
@@ -84947,13 +85088,13 @@ function isPipelineOutput(data) {
|
|
|
84947
85088
|
function readFindings(filePath) {
|
|
84948
85089
|
const readResult = safeReadFile4(filePath);
|
|
84949
85090
|
if (readResult.isErr()) {
|
|
84950
|
-
return (0,
|
|
85091
|
+
return (0, import_neverthrow74.err)("not-found");
|
|
84951
85092
|
}
|
|
84952
85093
|
return safeParseJson4(readResult.value).mapErr(() => "invalid").andThen((data) => {
|
|
84953
85094
|
if (!isPipelineOutput(data)) {
|
|
84954
|
-
return (0,
|
|
85095
|
+
return (0, import_neverthrow74.err)("invalid");
|
|
84955
85096
|
}
|
|
84956
|
-
return (0,
|
|
85097
|
+
return (0, import_neverthrow74.ok)(data);
|
|
84957
85098
|
});
|
|
84958
85099
|
}
|
|
84959
85100
|
function loadExistingDismissals(filePath) {
|
|
@@ -85026,7 +85167,7 @@ function resolveAndReadFindings(findingsPath, xqaDirectory) {
|
|
|
85026
85167
|
"No findings path provided and no last path found. Run: xqa review <findings-path>\n"
|
|
85027
85168
|
);
|
|
85028
85169
|
process.exit(1);
|
|
85029
|
-
return (0,
|
|
85170
|
+
return (0, import_neverthrow74.err)();
|
|
85030
85171
|
}
|
|
85031
85172
|
const resolvedPath = resolvedPathResult.value;
|
|
85032
85173
|
const findingsResult = readFindings(resolvedPath);
|
|
@@ -85039,9 +85180,9 @@ function resolveAndReadFindings(findingsPath, xqaDirectory) {
|
|
|
85039
85180
|
`);
|
|
85040
85181
|
}
|
|
85041
85182
|
process.exit(1);
|
|
85042
|
-
return (0,
|
|
85183
|
+
return (0, import_neverthrow74.err)();
|
|
85043
85184
|
}
|
|
85044
|
-
return (0,
|
|
85185
|
+
return (0, import_neverthrow74.ok)({ resolvedPath, output: findingsResult.value });
|
|
85045
85186
|
}
|
|
85046
85187
|
async function runReviewLoop({
|
|
85047
85188
|
findings,
|
|
@@ -85114,11 +85255,11 @@ function discoverSimulators(udidOverride) {
|
|
|
85114
85255
|
var import_promises27 = __toESM(require("node:fs/promises"), 1);
|
|
85115
85256
|
var import_node_path27 = __toESM(require("node:path"), 1);
|
|
85116
85257
|
var import_fast_glob = __toESM(require_out4(), 1);
|
|
85117
|
-
var
|
|
85258
|
+
var import_neverthrow77 = __toESM(require_index_cjs(), 1);
|
|
85118
85259
|
|
|
85119
85260
|
// src/suite/core/suite-config-parser.ts
|
|
85120
|
-
var import_neverthrow74 = __toESM(require_index_cjs(), 1);
|
|
85121
85261
|
var import_neverthrow75 = __toESM(require_index_cjs(), 1);
|
|
85262
|
+
var import_neverthrow76 = __toESM(require_index_cjs(), 1);
|
|
85122
85263
|
var RESERVED_HOOK_ENV_KEYS = [
|
|
85123
85264
|
"XQA_SIM_UDID",
|
|
85124
85265
|
"XQA_ITEM_ID",
|
|
@@ -85170,7 +85311,7 @@ var suiteConfigSchema = external_exports.object({
|
|
|
85170
85311
|
}).refine((data) => data.specs.length > 0 || data.freestyle.length > 0, {
|
|
85171
85312
|
message: "Suite must declare at least one spec or freestyle entry"
|
|
85172
85313
|
});
|
|
85173
|
-
var safeJsonParse5 = (0,
|
|
85314
|
+
var safeJsonParse5 = (0, import_neverthrow75.fromThrowable)(
|
|
85174
85315
|
JSON.parse,
|
|
85175
85316
|
(cause) => ({
|
|
85176
85317
|
type: "INVALID_SUITE_CONFIG",
|
|
@@ -85204,16 +85345,16 @@ function parseSuiteConfig(raw) {
|
|
|
85204
85345
|
return safeJsonParse5(raw).andThen((data) => {
|
|
85205
85346
|
const parsed = suiteConfigSchema.safeParse(data);
|
|
85206
85347
|
if (!parsed.success) {
|
|
85207
|
-
return (0,
|
|
85348
|
+
return (0, import_neverthrow76.err)({ type: "INVALID_SUITE_CONFIG", cause: parsed.error });
|
|
85208
85349
|
}
|
|
85209
85350
|
const hooks = normalizeHooks(parsed.data.hooks);
|
|
85210
85351
|
if (hooks === void 0) {
|
|
85211
|
-
return (0,
|
|
85352
|
+
return (0, import_neverthrow76.ok)({
|
|
85212
85353
|
specs: parsed.data.specs,
|
|
85213
85354
|
freestyle: parsed.data.freestyle
|
|
85214
85355
|
});
|
|
85215
85356
|
}
|
|
85216
|
-
return (0,
|
|
85357
|
+
return (0, import_neverthrow76.ok)({
|
|
85217
85358
|
specs: parsed.data.specs,
|
|
85218
85359
|
freestyle: parsed.data.freestyle,
|
|
85219
85360
|
hooks
|
|
@@ -85261,7 +85402,7 @@ function buildFreestyleItems(entries) {
|
|
|
85261
85402
|
}
|
|
85262
85403
|
|
|
85263
85404
|
// src/suite/commands/run/resolve-work-items.ts
|
|
85264
|
-
var safeReadFile5 =
|
|
85405
|
+
var safeReadFile5 = import_neverthrow77.ResultAsync.fromThrowable(
|
|
85265
85406
|
async (filePath) => import_promises27.default.readFile(filePath, "utf8"),
|
|
85266
85407
|
() => "READ_FAILED"
|
|
85267
85408
|
);
|
|
@@ -85329,7 +85470,7 @@ async function resolveAndFilterItems(input) {
|
|
|
85329
85470
|
}
|
|
85330
85471
|
|
|
85331
85472
|
// src/suite/shell/worker-pool.ts
|
|
85332
|
-
var
|
|
85473
|
+
var import_neverthrow80 = __toESM(require_index_cjs(), 1);
|
|
85333
85474
|
|
|
85334
85475
|
// src/suite/core/priority-queue.ts
|
|
85335
85476
|
var PriorityQueue = class {
|
|
@@ -85576,7 +85717,7 @@ function recordHookFailure(input) {
|
|
|
85576
85717
|
}
|
|
85577
85718
|
|
|
85578
85719
|
// src/suite/shell/hook-invoker.ts
|
|
85579
|
-
var
|
|
85720
|
+
var import_neverthrow79 = __toESM(require_index_cjs(), 1);
|
|
85580
85721
|
|
|
85581
85722
|
// src/suite/core/hook-env-builder.ts
|
|
85582
85723
|
function buildReservedKeys(input) {
|
|
@@ -85603,7 +85744,7 @@ function buildHookEnv(input) {
|
|
|
85603
85744
|
|
|
85604
85745
|
// src/suite/shell/hook-runner.ts
|
|
85605
85746
|
var import_node_child_process8 = require("node:child_process");
|
|
85606
|
-
var
|
|
85747
|
+
var import_neverthrow78 = __toESM(require_index_cjs(), 1);
|
|
85607
85748
|
function makeDeferred() {
|
|
85608
85749
|
const raw = Promise.withResolvers();
|
|
85609
85750
|
return { promise: raw.promise, resolve: raw.resolve };
|
|
@@ -85633,7 +85774,7 @@ var HookRuntime = class {
|
|
|
85633
85774
|
this.deferred = makeDeferred();
|
|
85634
85775
|
this.onAbort = () => {
|
|
85635
85776
|
this.child.kill("SIGTERM");
|
|
85636
|
-
this.settle((0,
|
|
85777
|
+
this.settle((0, import_neverthrow78.err)({ type: "HOOK_ABORTED" }));
|
|
85637
85778
|
};
|
|
85638
85779
|
}
|
|
85639
85780
|
async start() {
|
|
@@ -85658,20 +85799,20 @@ var HookRuntime = class {
|
|
|
85658
85799
|
attachTimeout() {
|
|
85659
85800
|
this.timeoutHandle = setTimeout(() => {
|
|
85660
85801
|
this.child.kill("SIGTERM");
|
|
85661
|
-
this.settle((0,
|
|
85802
|
+
this.settle((0, import_neverthrow78.err)({ type: "HOOK_TIMEOUT", timeoutMs: this.timeoutMs }));
|
|
85662
85803
|
}, this.timeoutMs);
|
|
85663
85804
|
}
|
|
85664
85805
|
attachChildListeners() {
|
|
85665
85806
|
this.child.on("error", (cause) => {
|
|
85666
|
-
this.settle((0,
|
|
85807
|
+
this.settle((0, import_neverthrow78.err)({ type: "HOOK_SPAWN_FAILED", cause }));
|
|
85667
85808
|
});
|
|
85668
85809
|
this.child.on("exit", (code) => {
|
|
85669
85810
|
if (code === 0) {
|
|
85670
|
-
this.settle((0,
|
|
85811
|
+
this.settle((0, import_neverthrow78.ok)());
|
|
85671
85812
|
return;
|
|
85672
85813
|
}
|
|
85673
85814
|
this.settle(
|
|
85674
|
-
(0,
|
|
85815
|
+
(0, import_neverthrow78.err)({
|
|
85675
85816
|
type: "HOOK_EXIT_NONZERO",
|
|
85676
85817
|
code: code ?? -1,
|
|
85677
85818
|
stderr: this.stderrBuffer
|
|
@@ -85694,7 +85835,7 @@ var HookRuntime = class {
|
|
|
85694
85835
|
this.signal.removeEventListener("abort", this.onAbort);
|
|
85695
85836
|
}
|
|
85696
85837
|
};
|
|
85697
|
-
var safeSpawn =
|
|
85838
|
+
var safeSpawn = import_neverthrow78.ResultAsync.fromThrowable(
|
|
85698
85839
|
spawnHook,
|
|
85699
85840
|
(cause) => ({ type: "HOOK_SPAWN_FAILED", cause })
|
|
85700
85841
|
);
|
|
@@ -85722,7 +85863,7 @@ async function invokeHook(input) {
|
|
|
85722
85863
|
async function maybeInvokeHook(input) {
|
|
85723
85864
|
const { hook: hook2 } = input;
|
|
85724
85865
|
if (hook2 === void 0) {
|
|
85725
|
-
return (0,
|
|
85866
|
+
return (0, import_neverthrow79.ok)();
|
|
85726
85867
|
}
|
|
85727
85868
|
return invokeHook({ ...input, hook: hook2 });
|
|
85728
85869
|
}
|
|
@@ -85816,7 +85957,7 @@ async function processItem(workerContext, item) {
|
|
|
85816
85957
|
workerContext.inFlight.delete(item.id);
|
|
85817
85958
|
return failCount;
|
|
85818
85959
|
}
|
|
85819
|
-
var safeProcessItem =
|
|
85960
|
+
var safeProcessItem = import_neverthrow80.ResultAsync.fromThrowable(
|
|
85820
85961
|
processItem,
|
|
85821
85962
|
(cause) => ({
|
|
85822
85963
|
type: "PROCESS_ITEM_FAILED",
|
|
@@ -85881,7 +86022,7 @@ function runWorkerPool(config2) {
|
|
|
85881
86022
|
const results = [];
|
|
85882
86023
|
const inFlight = /* @__PURE__ */ new Map();
|
|
85883
86024
|
const suiteStartMs = Date.now();
|
|
85884
|
-
const safeRun =
|
|
86025
|
+
const safeRun = import_neverthrow80.ResultAsync.fromThrowable(
|
|
85885
86026
|
async () => runAllWorkers({ config: config2, queue, results, suiteStartMs, inFlight }),
|
|
85886
86027
|
(cause) => ({ type: "WORKER_POOL_FAILED", cause })
|
|
85887
86028
|
);
|
|
@@ -86025,6 +86166,44 @@ async function runPool(input) {
|
|
|
86025
86166
|
return poolResult;
|
|
86026
86167
|
}
|
|
86027
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
|
+
|
|
86028
86207
|
// src/suite/core/suite-findings-builder.ts
|
|
86029
86208
|
function buildSuiteFindings(input) {
|
|
86030
86209
|
const base = { suiteId: input.suiteId, runId: input.runId, items: input.items };
|
|
@@ -86034,10 +86213,52 @@ function buildSuiteFindings(input) {
|
|
|
86034
86213
|
return base;
|
|
86035
86214
|
}
|
|
86036
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
|
+
|
|
86037
86258
|
// src/suite/shell/suite-findings-writer.ts
|
|
86038
|
-
var
|
|
86259
|
+
var import_promises29 = __toESM(require("node:fs/promises"), 1);
|
|
86039
86260
|
var import_node_path29 = __toESM(require("node:path"), 1);
|
|
86040
|
-
var
|
|
86261
|
+
var import_neverthrow82 = __toESM(require_index_cjs(), 1);
|
|
86041
86262
|
var INDENT_SPACES = 2;
|
|
86042
86263
|
function writeSuiteFindings(findings, options2) {
|
|
86043
86264
|
const directory = import_node_path29.default.join(
|
|
@@ -86049,11 +86270,11 @@ function writeSuiteFindings(findings, options2) {
|
|
|
86049
86270
|
);
|
|
86050
86271
|
const finalPath = import_node_path29.default.join(directory, "findings.json");
|
|
86051
86272
|
const temporaryPath = `${finalPath}.tmp`;
|
|
86052
|
-
const safeWriteAtomically =
|
|
86273
|
+
const safeWriteAtomically = import_neverthrow82.ResultAsync.fromThrowable(
|
|
86053
86274
|
async () => {
|
|
86054
|
-
await
|
|
86055
|
-
await
|
|
86056
|
-
await
|
|
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);
|
|
86057
86278
|
return finalPath;
|
|
86058
86279
|
},
|
|
86059
86280
|
(cause) => ({ type: "FINDINGS_WRITE_FAILED", cause })
|
|
@@ -86061,7 +86282,55 @@ function writeSuiteFindings(findings, options2) {
|
|
|
86061
86282
|
return safeWriteAtomically();
|
|
86062
86283
|
}
|
|
86063
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
|
+
|
|
86064
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
|
+
}
|
|
86065
86334
|
async function writeAndReport(input) {
|
|
86066
86335
|
const { suiteId, runId, outputDirectory, date: date5, items, aborted: aborted2 } = input;
|
|
86067
86336
|
const suiteFindings = buildSuiteFindings({ suiteId, runId, items, aborted: aborted2 });
|
|
@@ -86073,6 +86342,7 @@ async function writeAndReport(input) {
|
|
|
86073
86342
|
}
|
|
86074
86343
|
process.stdout.write(`Suite complete. Findings: ${writeResult.value}
|
|
86075
86344
|
`);
|
|
86345
|
+
await writeRunsFile(input, items);
|
|
86076
86346
|
if (aborted2) {
|
|
86077
86347
|
return DEFAULT_ABORT_EXIT_CODE;
|
|
86078
86348
|
}
|
|
@@ -86081,9 +86351,9 @@ async function writeAndReport(input) {
|
|
|
86081
86351
|
}
|
|
86082
86352
|
|
|
86083
86353
|
// src/suite/commands/suite-run-context.ts
|
|
86084
|
-
var
|
|
86085
|
-
var
|
|
86086
|
-
var
|
|
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);
|
|
86087
86357
|
|
|
86088
86358
|
// src/suite/core/run-id.ts
|
|
86089
86359
|
var RUN_ID_PAD_LENGTH2 = 4;
|
|
@@ -86118,16 +86388,16 @@ function deriveSuiteId(input) {
|
|
|
86118
86388
|
|
|
86119
86389
|
// src/suite/commands/suite-run-context.ts
|
|
86120
86390
|
var ISO_DATE_LENGTH3 = 10;
|
|
86121
|
-
var safeReaddir3 =
|
|
86391
|
+
var safeReaddir3 = import_neverthrow84.ResultAsync.fromThrowable(
|
|
86122
86392
|
async (directoryPath) => {
|
|
86123
|
-
const entries = await
|
|
86393
|
+
const entries = await import_promises31.default.readdir(directoryPath, { withFileTypes: true });
|
|
86124
86394
|
return entries.filter((entry) => entry.isDirectory()).map((entry) => entry.name);
|
|
86125
86395
|
},
|
|
86126
86396
|
() => "READDIR_FAILED"
|
|
86127
86397
|
);
|
|
86128
86398
|
async function listRunDirectories(input) {
|
|
86129
86399
|
const { outputDirectory, suiteId, date: date5 } = input;
|
|
86130
|
-
const directoryPath =
|
|
86400
|
+
const directoryPath = import_node_path31.default.join(outputDirectory, "suite", suiteId, date5);
|
|
86131
86401
|
const result = await safeReaddir3(directoryPath);
|
|
86132
86402
|
return result.unwrapOr([]);
|
|
86133
86403
|
}
|
|
@@ -86151,7 +86421,7 @@ ${cause}
|
|
|
86151
86421
|
async function buildSuiteRunContext(input) {
|
|
86152
86422
|
const suiteId = deriveSuiteIdFromMode(input.mode);
|
|
86153
86423
|
const date5 = (/* @__PURE__ */ new Date()).toISOString().slice(0, ISO_DATE_LENGTH3);
|
|
86154
|
-
const outputDirectory =
|
|
86424
|
+
const outputDirectory = import_node_path31.default.join(input.xqaDirectory, "output");
|
|
86155
86425
|
const existingDirectories = await listRunDirectories({ outputDirectory, suiteId, date: date5 });
|
|
86156
86426
|
const runId = computeNextRunId2(existingDirectories);
|
|
86157
86427
|
const appContext = await loadAppContext(input.xqaDirectory);
|
|
@@ -86253,18 +86523,18 @@ async function runSuiteCommand(input) {
|
|
|
86253
86523
|
}
|
|
86254
86524
|
|
|
86255
86525
|
// src/suite/commands/validate-run-arguments.ts
|
|
86256
|
-
var
|
|
86526
|
+
var import_neverthrow85 = __toESM(require_index_cjs(), 1);
|
|
86257
86527
|
function validateRunArguments(options2) {
|
|
86258
86528
|
if (options2.suite === void 0 && options2.spec === void 0) {
|
|
86259
|
-
return (0,
|
|
86529
|
+
return (0, import_neverthrow85.err)({ type: "MISSING_SUITE_OR_SPEC" });
|
|
86260
86530
|
}
|
|
86261
86531
|
if (options2.suite !== void 0 && options2.spec !== void 0) {
|
|
86262
|
-
return (0,
|
|
86532
|
+
return (0, import_neverthrow85.err)({ type: "BOTH_SUITE_AND_SPEC" });
|
|
86263
86533
|
}
|
|
86264
86534
|
if (options2.only !== void 0 && options2.suite === void 0) {
|
|
86265
|
-
return (0,
|
|
86535
|
+
return (0, import_neverthrow85.err)({ type: "ONLY_REQUIRES_SUITE" });
|
|
86266
86536
|
}
|
|
86267
|
-
return (0,
|
|
86537
|
+
return (0, import_neverthrow85.ok)(
|
|
86268
86538
|
options2.suite === void 0 ? { type: "spec", globs: options2.spec ?? [] } : { type: "suite", name: options2.suite }
|
|
86269
86539
|
);
|
|
86270
86540
|
}
|
|
@@ -86312,10 +86582,10 @@ function registerRunCommand(program3, loader2) {
|
|
|
86312
86582
|
}
|
|
86313
86583
|
|
|
86314
86584
|
// src/commands/spec/runner.ts
|
|
86315
|
-
var
|
|
86585
|
+
var import_node_path35 = __toESM(require("node:path"), 1);
|
|
86316
86586
|
|
|
86317
86587
|
// src/commands/spec/pipeline-config.ts
|
|
86318
|
-
var
|
|
86588
|
+
var import_node_path32 = __toESM(require("node:path"), 1);
|
|
86319
86589
|
function buildInspector3(context) {
|
|
86320
86590
|
const { inspector } = context.rootConfig.agents;
|
|
86321
86591
|
if (!inspector.enabled) {
|
|
@@ -86340,7 +86610,7 @@ function buildSpecExplorer2(context) {
|
|
|
86340
86610
|
}
|
|
86341
86611
|
function buildPipelineConfig3({ input, context, onEvent }) {
|
|
86342
86612
|
return {
|
|
86343
|
-
outputDir:
|
|
86613
|
+
outputDir: import_node_path32.default.join(context.xqaDirectory, "output", context.slug),
|
|
86344
86614
|
signal: input.signal,
|
|
86345
86615
|
onEvent,
|
|
86346
86616
|
inspector: buildInspector3(context),
|
|
@@ -86399,13 +86669,13 @@ function handleSpecResult(state, context) {
|
|
|
86399
86669
|
}
|
|
86400
86670
|
|
|
86401
86671
|
// src/spec-slug.ts
|
|
86402
|
-
var
|
|
86672
|
+
var import_node_path33 = __toESM(require("node:path"), 1);
|
|
86403
86673
|
var SPECS_DIR = "specs";
|
|
86404
86674
|
function stripExtensions(filename) {
|
|
86405
86675
|
return filename.replace(/\.test\.md$/, "").replace(/\.[^.]+$/, "");
|
|
86406
86676
|
}
|
|
86407
86677
|
function deriveSpecSlug(specFilePath) {
|
|
86408
|
-
const parts = specFilePath.split(
|
|
86678
|
+
const parts = specFilePath.split(import_node_path33.default.sep);
|
|
86409
86679
|
const specsIndex = parts.lastIndexOf(SPECS_DIR);
|
|
86410
86680
|
if (specsIndex !== -1) {
|
|
86411
86681
|
const relativeParts = parts.slice(specsIndex + 1);
|
|
@@ -86413,60 +86683,60 @@ function deriveSpecSlug(specFilePath) {
|
|
|
86413
86683
|
relativeParts[relativeParts.length - 1] = stripExtensions(last);
|
|
86414
86684
|
return relativeParts.join("__");
|
|
86415
86685
|
}
|
|
86416
|
-
return stripExtensions(
|
|
86686
|
+
return stripExtensions(import_node_path33.default.basename(specFilePath));
|
|
86417
86687
|
}
|
|
86418
86688
|
|
|
86419
86689
|
// src/commands/spec-resolver.ts
|
|
86420
86690
|
var import_node_fs12 = require("node:fs");
|
|
86421
|
-
var
|
|
86422
|
-
var
|
|
86691
|
+
var import_node_path34 = __toESM(require("node:path"), 1);
|
|
86692
|
+
var import_neverthrow87 = __toESM(require_index_cjs(), 1);
|
|
86423
86693
|
|
|
86424
86694
|
// src/spec-frontmatter.ts
|
|
86425
86695
|
var import_gray_matter = __toESM(require_gray_matter(), 1);
|
|
86426
|
-
var
|
|
86696
|
+
var import_neverthrow86 = __toESM(require_index_cjs(), 1);
|
|
86427
86697
|
var frontmatterSchema = external_exports.object({
|
|
86428
86698
|
feature: external_exports.string().min(1),
|
|
86429
86699
|
timeout: external_exports.number().int().positive().optional()
|
|
86430
86700
|
});
|
|
86431
|
-
var safeParseMatter = (0,
|
|
86701
|
+
var safeParseMatter = (0, import_neverthrow86.fromThrowable)(
|
|
86432
86702
|
import_gray_matter.default,
|
|
86433
86703
|
(cause) => ({ type: "SPEC_FRONTMATTER_INVALID", cause })
|
|
86434
86704
|
);
|
|
86435
86705
|
function validate(data) {
|
|
86436
86706
|
const parsed = frontmatterSchema.safeParse(data);
|
|
86437
86707
|
if (!parsed.success) {
|
|
86438
|
-
return (0,
|
|
86708
|
+
return (0, import_neverthrow86.err)({ type: "SPEC_FRONTMATTER_INVALID", cause: parsed.error });
|
|
86439
86709
|
}
|
|
86440
86710
|
const { feature, timeout } = parsed.data;
|
|
86441
86711
|
if (timeout === void 0) {
|
|
86442
|
-
return (0,
|
|
86712
|
+
return (0, import_neverthrow86.ok)({ feature });
|
|
86443
86713
|
}
|
|
86444
|
-
return (0,
|
|
86714
|
+
return (0, import_neverthrow86.ok)({ feature, timeoutSeconds: timeout });
|
|
86445
86715
|
}
|
|
86446
86716
|
function parseSpecFrontmatter(raw) {
|
|
86447
86717
|
return safeParseMatter(raw).andThen((parsed) => validate(parsed.data));
|
|
86448
86718
|
}
|
|
86449
86719
|
|
|
86450
86720
|
// src/commands/spec-resolver.ts
|
|
86451
|
-
var
|
|
86452
|
-
var safeReaddir4 = (0,
|
|
86721
|
+
var safeReadFile7 = (0, import_neverthrow87.fromThrowable)((filePath) => (0, import_node_fs12.readFileSync)(filePath, "utf8"));
|
|
86722
|
+
var safeReaddir4 = (0, import_neverthrow87.fromThrowable)(
|
|
86453
86723
|
(directory) => (0, import_node_fs12.readdirSync)(directory, { recursive: true, encoding: "utf8" })
|
|
86454
86724
|
);
|
|
86455
86725
|
var CANCEL = "xqa:cancel";
|
|
86456
|
-
var safeSelect =
|
|
86726
|
+
var safeSelect = import_neverthrow87.ResultAsync.fromThrowable(
|
|
86457
86727
|
esm_default11,
|
|
86458
86728
|
(error48) => error48 instanceof Error && error48.name === "ExitPromptError" ? "cancelled" : "failed"
|
|
86459
86729
|
);
|
|
86460
86730
|
function findSpecFiles(xqaDirectory) {
|
|
86461
|
-
const specsDirectory =
|
|
86462
|
-
return safeReaddir4(specsDirectory).unwrapOr([]).filter((file2) => file2.endsWith(".test.md")).map((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));
|
|
86463
86733
|
}
|
|
86464
86734
|
async function promptForSpec(specFiles, xqaDirectory) {
|
|
86465
86735
|
const result = await safeSelect({
|
|
86466
86736
|
message: "Select a spec",
|
|
86467
86737
|
choices: [
|
|
86468
86738
|
...specFiles.map((specFile) => ({
|
|
86469
|
-
name:
|
|
86739
|
+
name: import_node_path34.default.relative(xqaDirectory, specFile),
|
|
86470
86740
|
value: specFile
|
|
86471
86741
|
})),
|
|
86472
86742
|
new Separator(),
|
|
@@ -86480,7 +86750,7 @@ async function promptForSpec(specFiles, xqaDirectory) {
|
|
|
86480
86750
|
return result.value;
|
|
86481
86751
|
}
|
|
86482
86752
|
function readAndParseSpec(absolutePath) {
|
|
86483
|
-
const readResult =
|
|
86753
|
+
const readResult = safeReadFile7(absolutePath);
|
|
86484
86754
|
if (readResult.isErr()) {
|
|
86485
86755
|
const isEnoent4 = readResult.error.code === "ENOENT";
|
|
86486
86756
|
const message = isEnoent4 ? `Spec file not found: ${absolutePath}` : `Failed to read spec file: ${absolutePath}`;
|
|
@@ -86516,7 +86786,7 @@ async function executeSpec(input, context) {
|
|
|
86516
86786
|
const identity = {
|
|
86517
86787
|
display: createSoloDisplay(input.verbose),
|
|
86518
86788
|
itemId: "spec",
|
|
86519
|
-
itemName:
|
|
86789
|
+
itemName: import_node_path35.default.basename(context.absolutePath, ".test.md"),
|
|
86520
86790
|
simulatorUdid: ""
|
|
86521
86791
|
};
|
|
86522
86792
|
const startedAt = Date.now();
|
|
@@ -86551,7 +86821,7 @@ async function resolveSpecContext(input, options2) {
|
|
|
86551
86821
|
if (resolvedSpecFile === void 0) {
|
|
86552
86822
|
return;
|
|
86553
86823
|
}
|
|
86554
|
-
const absolutePath =
|
|
86824
|
+
const absolutePath = import_node_path35.default.resolve(resolvedSpecFile);
|
|
86555
86825
|
const frontmatter = readAndParseSpec(absolutePath);
|
|
86556
86826
|
if (frontmatter === void 0) {
|
|
86557
86827
|
return;
|
|
@@ -86596,7 +86866,7 @@ function registerSpecCommand(program3, loader2) {
|
|
|
86596
86866
|
}
|
|
86597
86867
|
|
|
86598
86868
|
// ../../agents/triager/dist/index.js
|
|
86599
|
-
var
|
|
86869
|
+
var import_neverthrow88 = __toESM(require_index_cjs(), 1);
|
|
86600
86870
|
|
|
86601
86871
|
// ../../node_modules/.pnpm/balanced-match@4.0.4/node_modules/balanced-match/dist/esm/index.js
|
|
86602
86872
|
var balanced = (a3, b, str3) => {
|
|
@@ -87650,11 +87920,11 @@ var qmarksTestNoExtDot = ([$02]) => {
|
|
|
87650
87920
|
return (f6) => f6.length === len && f6 !== "." && f6 !== "..";
|
|
87651
87921
|
};
|
|
87652
87922
|
var defaultPlatform = typeof process === "object" && process ? typeof process.env === "object" && process.env && process.env.__MINIMATCH_TESTING_PLATFORM__ || process.platform : "posix";
|
|
87653
|
-
var
|
|
87923
|
+
var path35 = {
|
|
87654
87924
|
win32: { sep: "\\" },
|
|
87655
87925
|
posix: { sep: "/" }
|
|
87656
87926
|
};
|
|
87657
|
-
var sep = defaultPlatform === "win32" ?
|
|
87927
|
+
var sep = defaultPlatform === "win32" ? path35.win32.sep : path35.posix.sep;
|
|
87658
87928
|
minimatch.sep = sep;
|
|
87659
87929
|
var GLOBSTAR = Symbol("globstar **");
|
|
87660
87930
|
minimatch.GLOBSTAR = GLOBSTAR;
|
|
@@ -88401,14 +88671,14 @@ minimatch.escape = escape2;
|
|
|
88401
88671
|
minimatch.unescape = unescape2;
|
|
88402
88672
|
|
|
88403
88673
|
// ../../agents/triager/dist/index.js
|
|
88404
|
-
var import_neverthrow86 = __toESM(require_index_cjs(), 1);
|
|
88405
|
-
var import_promises30 = require("node:fs/promises");
|
|
88406
|
-
var import_neverthrow87 = __toESM(require_index_cjs(), 1);
|
|
88407
|
-
var import_node_child_process9 = require("node:child_process");
|
|
88408
|
-
var import_promises31 = require("node:fs/promises");
|
|
88409
|
-
var import_node_path35 = __toESM(require("node:path"), 1);
|
|
88410
|
-
var import_neverthrow88 = __toESM(require_index_cjs(), 1);
|
|
88411
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);
|
|
88412
88682
|
function resolveConfidence2(selected) {
|
|
88413
88683
|
if (selected.some((pick2) => pick2.confidence === "HIGH")) {
|
|
88414
88684
|
return "high";
|
|
@@ -89073,7 +89343,7 @@ async function drainMessages(runner, state) {
|
|
|
89073
89343
|
}
|
|
89074
89344
|
}
|
|
89075
89345
|
}
|
|
89076
|
-
var safeDrainMessages =
|
|
89346
|
+
var safeDrainMessages = import_neverthrow89.ResultAsync.fromThrowable(
|
|
89077
89347
|
drainMessages,
|
|
89078
89348
|
(cause) => ({ type: "AI_CALL_FAILED", cause })
|
|
89079
89349
|
);
|
|
@@ -89099,25 +89369,25 @@ function finalizeRun(bootstrap) {
|
|
|
89099
89369
|
const telemetry = buildTelemetry(bootstrap.telemetryInput, bootstrap.state);
|
|
89100
89370
|
const error48 = resolveError(bootstrap.state);
|
|
89101
89371
|
if (error48 !== void 0) {
|
|
89102
|
-
return (0,
|
|
89372
|
+
return (0, import_neverthrow89.errAsync)(error48);
|
|
89103
89373
|
}
|
|
89104
89374
|
const output = bootstrap.state.output;
|
|
89105
89375
|
if (output === void 0) {
|
|
89106
|
-
return (0,
|
|
89376
|
+
return (0, import_neverthrow89.errAsync)({ type: "AI_NO_FINAL_TOOL_CALL" });
|
|
89107
89377
|
}
|
|
89108
89378
|
bootstrap.reportTelemetry(telemetry);
|
|
89109
|
-
return (0,
|
|
89379
|
+
return (0, import_neverthrow89.okAsync)({ picks: output.picks, metaPr: output.metaPr, telemetry });
|
|
89110
89380
|
}
|
|
89111
89381
|
function launchQuery(input) {
|
|
89112
|
-
const safeLaunch = (0,
|
|
89382
|
+
const safeLaunch = (0, import_neverthrow89.fromThrowable)(
|
|
89113
89383
|
input.queryRunner,
|
|
89114
89384
|
(cause) => ({ type: "AI_CALL_FAILED", cause })
|
|
89115
89385
|
);
|
|
89116
89386
|
const result = safeLaunch({ prompt: input.inputQueue, options: input.queryOptions });
|
|
89117
89387
|
if (result.isErr()) {
|
|
89118
|
-
return (0,
|
|
89388
|
+
return (0, import_neverthrow89.errAsync)(result.error);
|
|
89119
89389
|
}
|
|
89120
|
-
return (0,
|
|
89390
|
+
return (0, import_neverthrow89.okAsync)(result.value);
|
|
89121
89391
|
}
|
|
89122
89392
|
function runPipeline4(bootstrap) {
|
|
89123
89393
|
return launchQuery({
|
|
@@ -89171,9 +89441,9 @@ var STATIC_ONLY_FIELDS = {
|
|
|
89171
89441
|
freestyleByGroup: /* @__PURE__ */ new Map(),
|
|
89172
89442
|
appIndex: [],
|
|
89173
89443
|
handlers: {
|
|
89174
|
-
readSpec: () => (0,
|
|
89175
|
-
readAppSection: () => (0,
|
|
89176
|
-
grepCodebase: () => (0,
|
|
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: "" })
|
|
89177
89447
|
}
|
|
89178
89448
|
};
|
|
89179
89449
|
function resolveAiFields(config2) {
|
|
@@ -89294,24 +89564,24 @@ function runAiTiebreaker(context, staticPicks) {
|
|
|
89294
89564
|
function runTriager(options2) {
|
|
89295
89565
|
const { groups, config: config2 } = options2;
|
|
89296
89566
|
if (groups.length === 0) {
|
|
89297
|
-
return (0,
|
|
89567
|
+
return (0, import_neverthrow88.errAsync)({ type: "NO_GROUPS" });
|
|
89298
89568
|
}
|
|
89299
89569
|
if (config2?.useAi === true && config2.ai === void 0) {
|
|
89300
|
-
return (0,
|
|
89570
|
+
return (0, import_neverthrow88.errAsync)({ type: "AI_CONFIG_MISSING" });
|
|
89301
89571
|
}
|
|
89302
89572
|
const context = buildContext2(options2);
|
|
89303
89573
|
const staticPicks = scoreGroups(context.diff, context.groups);
|
|
89304
89574
|
if (!context.useAi) {
|
|
89305
|
-
return (0,
|
|
89575
|
+
return (0, import_neverthrow88.okAsync)(buildDecision({ picks: staticPicks, metaPr: false }));
|
|
89306
89576
|
}
|
|
89307
89577
|
return runAiTiebreaker(context, staticPicks);
|
|
89308
89578
|
}
|
|
89309
89579
|
var HEADING_PATTERN = /^##\s+(.+?)\s*$/;
|
|
89310
89580
|
var UTF8 = "utf8";
|
|
89311
|
-
var
|
|
89581
|
+
var ENOENT_CODE2 = "ENOENT";
|
|
89312
89582
|
function classifyReadError(cause, filePath) {
|
|
89313
89583
|
const nodeError = cause;
|
|
89314
|
-
if (nodeError.code ===
|
|
89584
|
+
if (nodeError.code === ENOENT_CODE2) {
|
|
89315
89585
|
return { type: "APP_MD_NOT_FOUND", path: filePath };
|
|
89316
89586
|
}
|
|
89317
89587
|
return { type: "APP_MD_UNREADABLE", path: filePath, cause };
|
|
@@ -89363,17 +89633,17 @@ function parseSections(text) {
|
|
|
89363
89633
|
function lookupSection(sections, screenName) {
|
|
89364
89634
|
const section = sections.get(screenName);
|
|
89365
89635
|
if (section === void 0) {
|
|
89366
|
-
return (0,
|
|
89636
|
+
return (0, import_neverthrow90.errAsync)({ type: "SECTION_NOT_FOUND", screenName });
|
|
89367
89637
|
}
|
|
89368
|
-
return (0,
|
|
89638
|
+
return (0, import_neverthrow90.okAsync)(section);
|
|
89369
89639
|
}
|
|
89370
89640
|
async function readUtf8File(filePath) {
|
|
89371
|
-
return (0,
|
|
89641
|
+
return (0, import_promises32.readFile)(filePath, UTF8);
|
|
89372
89642
|
}
|
|
89373
89643
|
function createAppMdReader(options2) {
|
|
89374
89644
|
const filePath = options2.path;
|
|
89375
89645
|
let sectionCache;
|
|
89376
|
-
const
|
|
89646
|
+
const safeReadFile8 = import_neverthrow90.ResultAsync.fromThrowable(
|
|
89377
89647
|
readUtf8File,
|
|
89378
89648
|
(cause) => classifyReadError(cause, filePath)
|
|
89379
89649
|
);
|
|
@@ -89381,7 +89651,7 @@ function createAppMdReader(options2) {
|
|
|
89381
89651
|
if (sectionCache !== void 0) {
|
|
89382
89652
|
return lookupSection(sectionCache, screenName);
|
|
89383
89653
|
}
|
|
89384
|
-
return
|
|
89654
|
+
return safeReadFile8(filePath).andThen((text) => {
|
|
89385
89655
|
sectionCache = parseSections(text);
|
|
89386
89656
|
return lookupSection(sectionCache, screenName);
|
|
89387
89657
|
});
|
|
@@ -89398,7 +89668,7 @@ var RIPGREP_BASE_ARGUMENTS = [
|
|
|
89398
89668
|
"never",
|
|
89399
89669
|
`--max-count=${String(MAX_MATCHES)}`
|
|
89400
89670
|
];
|
|
89401
|
-
var
|
|
89671
|
+
var ENOENT_CODE22 = "ENOENT";
|
|
89402
89672
|
var RIPGREP_NO_MATCH_CODE = 1;
|
|
89403
89673
|
function buildSpawnExitError(code, stderr) {
|
|
89404
89674
|
return {
|
|
@@ -89434,14 +89704,14 @@ async function runExecFile(request2) {
|
|
|
89434
89704
|
return promise2;
|
|
89435
89705
|
}
|
|
89436
89706
|
function resolveFilePath(filePath, cwd) {
|
|
89437
|
-
if (
|
|
89707
|
+
if (import_node_path36.default.isAbsolute(filePath)) {
|
|
89438
89708
|
return filePath;
|
|
89439
89709
|
}
|
|
89440
|
-
return
|
|
89710
|
+
return import_node_path36.default.resolve(cwd, filePath);
|
|
89441
89711
|
}
|
|
89442
89712
|
function classifyReadError2(cause, resolvedPath) {
|
|
89443
89713
|
const nodeError = cause;
|
|
89444
|
-
if (nodeError.code ===
|
|
89714
|
+
if (nodeError.code === ENOENT_CODE22) {
|
|
89445
89715
|
return { type: "FILE_NOT_FOUND", path: resolvedPath };
|
|
89446
89716
|
}
|
|
89447
89717
|
return { type: "FILE_UNREADABLE", path: resolvedPath, cause };
|
|
@@ -89480,7 +89750,7 @@ function parseRipgrepOutput(stdout) {
|
|
|
89480
89750
|
}
|
|
89481
89751
|
function classifyRawExecError(cause) {
|
|
89482
89752
|
const execError = cause;
|
|
89483
|
-
if (execError.code ===
|
|
89753
|
+
if (execError.code === ENOENT_CODE22) {
|
|
89484
89754
|
return { type: "RIPGREP_MISSING" };
|
|
89485
89755
|
}
|
|
89486
89756
|
return { type: "GREP_FAILED", cause, stderr: execError.stderr ?? "" };
|
|
@@ -89491,24 +89761,24 @@ async function invokeRipgrep(options2) {
|
|
|
89491
89761
|
return runExecFile({ binary: binary2, arguments_, cwd });
|
|
89492
89762
|
}
|
|
89493
89763
|
function execRipgrepRaw(options2) {
|
|
89494
|
-
const safeExec =
|
|
89764
|
+
const safeExec = import_neverthrow91.ResultAsync.fromThrowable(invokeRipgrep, classifyRawExecError);
|
|
89495
89765
|
return safeExec(options2);
|
|
89496
89766
|
}
|
|
89497
89767
|
function handleExecResult(options2) {
|
|
89498
89768
|
return execRipgrepRaw(options2).orElse((error48) => {
|
|
89499
89769
|
if (error48.type === "GREP_FAILED" && error48.cause.code === RIPGREP_NO_MATCH_CODE) {
|
|
89500
|
-
return (0,
|
|
89770
|
+
return (0, import_neverthrow91.ok)({ stdout: "", stderr: "" });
|
|
89501
89771
|
}
|
|
89502
|
-
return (0,
|
|
89772
|
+
return (0, import_neverthrow91.err)(error48);
|
|
89503
89773
|
});
|
|
89504
89774
|
}
|
|
89505
89775
|
async function readUtf8File2(filePath) {
|
|
89506
|
-
return (0,
|
|
89776
|
+
return (0, import_promises33.readFile)(filePath, "utf8");
|
|
89507
89777
|
}
|
|
89508
89778
|
function makeReadFile(cwd) {
|
|
89509
89779
|
return (filePath) => {
|
|
89510
89780
|
const resolvedPath = resolveFilePath(filePath, cwd);
|
|
89511
|
-
const safeRead =
|
|
89781
|
+
const safeRead = import_neverthrow91.ResultAsync.fromThrowable(
|
|
89512
89782
|
readUtf8File2,
|
|
89513
89783
|
(cause) => classifyReadError2(cause, resolvedPath)
|
|
89514
89784
|
);
|
|
@@ -89575,9 +89845,9 @@ function applyHeading(state, screenName) {
|
|
|
89575
89845
|
function handleHeading(state, indexed) {
|
|
89576
89846
|
const screenName = indexed.text.slice(LEVEL_2_HEADING_MARKER.length).trim();
|
|
89577
89847
|
if (screenName.length === 0) {
|
|
89578
|
-
return (0,
|
|
89848
|
+
return (0, import_neverthrow92.err)({ type: "APP_MD_MALFORMED", line: indexed.number });
|
|
89579
89849
|
}
|
|
89580
|
-
return (0,
|
|
89850
|
+
return (0, import_neverthrow92.ok)(applyHeading(state, screenName));
|
|
89581
89851
|
}
|
|
89582
89852
|
function handleFenceLine(state, lineNumber) {
|
|
89583
89853
|
if (state.insideFence) {
|
|
@@ -89611,23 +89881,23 @@ function isLevel2Heading(line) {
|
|
|
89611
89881
|
}
|
|
89612
89882
|
function processLine2(state, indexed) {
|
|
89613
89883
|
if (indexed.text.startsWith(FENCE_MARKER)) {
|
|
89614
|
-
return (0,
|
|
89884
|
+
return (0, import_neverthrow92.ok)(handleFenceLine(state, indexed.number));
|
|
89615
89885
|
}
|
|
89616
89886
|
if (state.insideFence) {
|
|
89617
|
-
return (0,
|
|
89887
|
+
return (0, import_neverthrow92.ok)(state);
|
|
89618
89888
|
}
|
|
89619
89889
|
if (isLevel2Heading(indexed.text)) {
|
|
89620
89890
|
return handleHeading(state, indexed);
|
|
89621
89891
|
}
|
|
89622
89892
|
if (indexed.text.trim().length === 0) {
|
|
89623
|
-
return (0,
|
|
89893
|
+
return (0, import_neverthrow92.ok)(handleBlankLine(state));
|
|
89624
89894
|
}
|
|
89625
|
-
return (0,
|
|
89895
|
+
return (0, import_neverthrow92.ok)(handleContentLine(state, indexed.text));
|
|
89626
89896
|
}
|
|
89627
89897
|
function processIndexedLines(indexedLines, state) {
|
|
89628
89898
|
const [head, ...tail] = indexedLines;
|
|
89629
89899
|
if (head === void 0) {
|
|
89630
|
-
return (0,
|
|
89900
|
+
return (0, import_neverthrow92.ok)(state);
|
|
89631
89901
|
}
|
|
89632
89902
|
return processLine2(state, head).andThen((next) => processIndexedLines(tail, next));
|
|
89633
89903
|
}
|
|
@@ -89639,9 +89909,9 @@ function buildFinalEntries(state) {
|
|
|
89639
89909
|
}
|
|
89640
89910
|
function finaliseState(state) {
|
|
89641
89911
|
if (state.insideFence) {
|
|
89642
|
-
return (0,
|
|
89912
|
+
return (0, import_neverthrow92.err)({ type: "APP_MD_MALFORMED", line: state.fenceOpenLine });
|
|
89643
89913
|
}
|
|
89644
|
-
return (0,
|
|
89914
|
+
return (0, import_neverthrow92.ok)([...buildFinalEntries(state)]);
|
|
89645
89915
|
}
|
|
89646
89916
|
function buildAppIndex(appMd) {
|
|
89647
89917
|
const indexedLines = toIndexedLines(appMd.split("\n"));
|
|
@@ -89672,11 +89942,11 @@ function summariseSpec(input) {
|
|
|
89672
89942
|
var triagerConfigSchema = agentBaseConfigSchema.extend({ enabled: external_exports.boolean().default(false) }).strict();
|
|
89673
89943
|
|
|
89674
89944
|
// src/commands/triage-command.ts
|
|
89675
|
-
var
|
|
89945
|
+
var import_neverthrow97 = __toESM(require_index_cjs(), 1);
|
|
89676
89946
|
|
|
89677
89947
|
// src/triage/ai-context-builder.ts
|
|
89678
|
-
var
|
|
89679
|
-
var
|
|
89948
|
+
var import_node_path37 = __toESM(require("node:path"), 1);
|
|
89949
|
+
var import_neverthrow93 = __toESM(require_index_cjs(), 1);
|
|
89680
89950
|
var PROMPT_VERSION = "v1";
|
|
89681
89951
|
var MAX_GREP_PATTERN_LENGTH = 200;
|
|
89682
89952
|
var DENIED_SAMPLE_PATHS = [
|
|
@@ -89755,11 +90025,11 @@ function isDeniedGlob(pathGlob) {
|
|
|
89755
90025
|
return normalized !== pathGlob && matchesDeniedSample(normalized);
|
|
89756
90026
|
}
|
|
89757
90027
|
function pathDenied(reason) {
|
|
89758
|
-
return (0,
|
|
90028
|
+
return (0, import_neverthrow93.errAsync)({ type: "PATH_DENIED", reason });
|
|
89759
90029
|
}
|
|
89760
90030
|
function buildHandlers(cwd, validSpecIds) {
|
|
89761
90031
|
const reader = createCodebaseReader({ cwd });
|
|
89762
|
-
const appMdPath =
|
|
90032
|
+
const appMdPath = import_node_path37.default.join(cwd, "app.md");
|
|
89763
90033
|
const appMdReader = createAppMdReader({ path: appMdPath });
|
|
89764
90034
|
return {
|
|
89765
90035
|
readSpec: (id) => {
|
|
@@ -89781,20 +90051,20 @@ function buildHandlers(cwd, validSpecIds) {
|
|
|
89781
90051
|
};
|
|
89782
90052
|
}
|
|
89783
90053
|
function resolveAppMdPath(suitesDirectory) {
|
|
89784
|
-
return
|
|
90054
|
+
return import_node_path37.default.join(import_node_path37.default.dirname(import_node_path37.default.resolve(suitesDirectory)), "app.md");
|
|
89785
90055
|
}
|
|
89786
90056
|
function loadAppIndex(appMdPath) {
|
|
89787
|
-
const appMdReader = createCodebaseReader({ cwd:
|
|
90057
|
+
const appMdReader = createCodebaseReader({ cwd: import_node_path37.default.dirname(appMdPath) });
|
|
89788
90058
|
return appMdReader.readFile(appMdPath).mapErr(() => ({ type: "SPEC_NOT_FOUND", path: appMdPath })).andThen((content) => {
|
|
89789
90059
|
const indexResult = buildAppIndex(content);
|
|
89790
90060
|
if (indexResult.isErr()) {
|
|
89791
|
-
return (0,
|
|
90061
|
+
return (0, import_neverthrow93.errAsync)({
|
|
89792
90062
|
type: "SUITE_INVALID",
|
|
89793
90063
|
path: appMdPath,
|
|
89794
90064
|
cause: indexResult.error
|
|
89795
90065
|
});
|
|
89796
90066
|
}
|
|
89797
|
-
return (0,
|
|
90067
|
+
return (0, import_neverthrow93.okAsync)(indexResult.value);
|
|
89798
90068
|
});
|
|
89799
90069
|
}
|
|
89800
90070
|
function collectSpecIds(specSummariesByGroup) {
|
|
@@ -90417,7 +90687,7 @@ async function getResponseData(response) {
|
|
|
90417
90687
|
try {
|
|
90418
90688
|
text = await response.text();
|
|
90419
90689
|
return JSON.parse(text);
|
|
90420
|
-
} catch (
|
|
90690
|
+
} catch (err41) {
|
|
90421
90691
|
return text;
|
|
90422
90692
|
}
|
|
90423
90693
|
} else if (mimetype.type.startsWith("text/") || mimetype.parameters.charset?.toLowerCase() === "utf-8") {
|
|
@@ -90765,17 +91035,17 @@ function requestLog(octokit) {
|
|
|
90765
91035
|
octokit.log.debug("request", options2);
|
|
90766
91036
|
const start = Date.now();
|
|
90767
91037
|
const requestOptions = octokit.request.endpoint.parse(options2);
|
|
90768
|
-
const
|
|
91038
|
+
const path40 = requestOptions.url.replace(options2.baseUrl, "");
|
|
90769
91039
|
return request2(options2).then((response) => {
|
|
90770
91040
|
const requestId = response.headers["x-github-request-id"];
|
|
90771
91041
|
octokit.log.info(
|
|
90772
|
-
`${requestOptions.method} ${
|
|
91042
|
+
`${requestOptions.method} ${path40} - ${response.status} with id ${requestId} in ${Date.now() - start}ms`
|
|
90773
91043
|
);
|
|
90774
91044
|
return response;
|
|
90775
91045
|
}).catch((error48) => {
|
|
90776
91046
|
const requestId = error48.response?.headers["x-github-request-id"] || "UNKNOWN";
|
|
90777
91047
|
octokit.log.error(
|
|
90778
|
-
`${requestOptions.method} ${
|
|
91048
|
+
`${requestOptions.method} ${path40} - ${error48.status} with id ${requestId} in ${Date.now() - start}ms`
|
|
90779
91049
|
);
|
|
90780
91050
|
throw error48;
|
|
90781
91051
|
});
|
|
@@ -93369,7 +93639,7 @@ var Octokit2 = Octokit.plugin(requestLog, legacyRestEndpointMethods, paginateRes
|
|
|
93369
93639
|
);
|
|
93370
93640
|
|
|
93371
93641
|
// src/triage/github-pr-fetcher.ts
|
|
93372
|
-
var
|
|
93642
|
+
var import_neverthrow94 = __toESM(require_index_cjs(), 1);
|
|
93373
93643
|
var STATUS_MAP = {
|
|
93374
93644
|
added: "added",
|
|
93375
93645
|
modified: "modified",
|
|
@@ -93405,11 +93675,11 @@ async function runListFiles(octokit, options2) {
|
|
|
93405
93675
|
per_page: 100
|
|
93406
93676
|
});
|
|
93407
93677
|
}
|
|
93408
|
-
var safeGet =
|
|
93678
|
+
var safeGet = import_neverthrow94.ResultAsync.fromThrowable(
|
|
93409
93679
|
runPullRequestGet,
|
|
93410
93680
|
(cause) => ({ type: "PR_FETCH_FAILED", cause })
|
|
93411
93681
|
);
|
|
93412
|
-
var safeList =
|
|
93682
|
+
var safeList = import_neverthrow94.ResultAsync.fromThrowable(
|
|
93413
93683
|
runListFiles,
|
|
93414
93684
|
(cause) => ({ type: "PR_FETCH_FAILED", cause })
|
|
93415
93685
|
);
|
|
@@ -93423,13 +93693,13 @@ function toDiff(summary, files) {
|
|
|
93423
93693
|
}
|
|
93424
93694
|
function fetchPullRequestDiff(options2) {
|
|
93425
93695
|
const octokit = new Octokit2({ auth: options2.token });
|
|
93426
|
-
return
|
|
93696
|
+
return import_neverthrow94.ResultAsync.combine([safeGet(octokit, options2), safeList(octokit, options2)]).map(
|
|
93427
93697
|
([summary, files]) => toDiff(summary, files)
|
|
93428
93698
|
);
|
|
93429
93699
|
}
|
|
93430
93700
|
|
|
93431
93701
|
// src/triage/github-pr-labeller.ts
|
|
93432
|
-
var
|
|
93702
|
+
var import_neverthrow95 = __toESM(require_index_cjs(), 1);
|
|
93433
93703
|
async function runAddLabels(octokit, options2) {
|
|
93434
93704
|
await octokit.issues.addLabels({
|
|
93435
93705
|
owner: options2.owner,
|
|
@@ -93438,7 +93708,7 @@ async function runAddLabels(octokit, options2) {
|
|
|
93438
93708
|
labels: [...options2.labels]
|
|
93439
93709
|
});
|
|
93440
93710
|
}
|
|
93441
|
-
var safeAddLabels =
|
|
93711
|
+
var safeAddLabels = import_neverthrow95.ResultAsync.fromThrowable(
|
|
93442
93712
|
runAddLabels,
|
|
93443
93713
|
(cause) => ({ type: "LABEL_APPLY_FAILED", cause })
|
|
93444
93714
|
);
|
|
@@ -93476,9 +93746,9 @@ function formatXqaLabels(decision) {
|
|
|
93476
93746
|
}
|
|
93477
93747
|
|
|
93478
93748
|
// src/triage/suite-loader.ts
|
|
93479
|
-
var
|
|
93480
|
-
var
|
|
93481
|
-
var
|
|
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);
|
|
93482
93752
|
var SUITE_FILE_SUFFIX = ".suite.json";
|
|
93483
93753
|
var freestyleEntrySchema2 = external_exports.object({
|
|
93484
93754
|
timeoutSeconds: external_exports.number().int().positive(),
|
|
@@ -93489,39 +93759,39 @@ var suiteFileSchema = external_exports.object({
|
|
|
93489
93759
|
freestyle: external_exports.array(freestyleEntrySchema2).optional(),
|
|
93490
93760
|
hooks: external_exports.record(external_exports.string(), external_exports.unknown()).optional()
|
|
93491
93761
|
});
|
|
93492
|
-
var safeJsonParse6 = (0,
|
|
93762
|
+
var safeJsonParse6 = (0, import_neverthrow96.fromThrowable)(JSON.parse);
|
|
93493
93763
|
async function runReadFile(filePath) {
|
|
93494
|
-
return (0,
|
|
93764
|
+
return (0, import_promises34.readFile)(filePath, "utf8");
|
|
93495
93765
|
}
|
|
93496
93766
|
async function runStat(filePath) {
|
|
93497
|
-
return (0,
|
|
93767
|
+
return (0, import_promises34.stat)(filePath);
|
|
93498
93768
|
}
|
|
93499
93769
|
async function runReadDirectory(filePath) {
|
|
93500
|
-
return (0,
|
|
93770
|
+
return (0, import_promises34.readdir)(filePath);
|
|
93501
93771
|
}
|
|
93502
93772
|
function readSuiteFile(filePath) {
|
|
93503
|
-
const safeRead =
|
|
93773
|
+
const safeRead = import_neverthrow96.ResultAsync.fromThrowable(
|
|
93504
93774
|
runReadFile,
|
|
93505
93775
|
(cause) => ({ type: "SUITE_READ_FAILED", path: filePath, cause })
|
|
93506
93776
|
);
|
|
93507
93777
|
return safeRead(filePath);
|
|
93508
93778
|
}
|
|
93509
93779
|
function readSpecFile2(filePath) {
|
|
93510
|
-
const safeRead =
|
|
93780
|
+
const safeRead = import_neverthrow96.ResultAsync.fromThrowable(
|
|
93511
93781
|
runReadFile,
|
|
93512
93782
|
() => ({ type: "SPEC_NOT_FOUND", path: filePath })
|
|
93513
93783
|
);
|
|
93514
93784
|
return safeRead(filePath);
|
|
93515
93785
|
}
|
|
93516
93786
|
function statDirectory(directory) {
|
|
93517
|
-
const safeStat =
|
|
93787
|
+
const safeStat = import_neverthrow96.ResultAsync.fromThrowable(
|
|
93518
93788
|
runStat,
|
|
93519
93789
|
() => ({ type: "SUITE_DIR_MISSING", path: directory })
|
|
93520
93790
|
);
|
|
93521
93791
|
return safeStat(directory);
|
|
93522
93792
|
}
|
|
93523
93793
|
function readDirectoryEntries(directory) {
|
|
93524
|
-
const safeReadDirectory =
|
|
93794
|
+
const safeReadDirectory = import_neverthrow96.ResultAsync.fromThrowable(
|
|
93525
93795
|
runReadDirectory,
|
|
93526
93796
|
(cause) => ({ type: "SUITE_READ_FAILED", path: directory, cause })
|
|
93527
93797
|
);
|
|
@@ -93530,34 +93800,34 @@ function readDirectoryEntries(directory) {
|
|
|
93530
93800
|
function listSuiteFiles(directory) {
|
|
93531
93801
|
return statDirectory(directory).andThen((stats) => {
|
|
93532
93802
|
if (!stats.isDirectory()) {
|
|
93533
|
-
return (0,
|
|
93803
|
+
return (0, import_neverthrow96.errAsync)({ type: "SUITE_DIR_MISSING", path: directory });
|
|
93534
93804
|
}
|
|
93535
93805
|
return readDirectoryEntries(directory);
|
|
93536
93806
|
}).map(
|
|
93537
|
-
(entries) => entries.filter((entry) => entry.endsWith(SUITE_FILE_SUFFIX)).map((entry) =>
|
|
93807
|
+
(entries) => entries.filter((entry) => entry.endsWith(SUITE_FILE_SUFFIX)).map((entry) => import_node_path38.default.resolve(directory, entry)).toSorted()
|
|
93538
93808
|
);
|
|
93539
93809
|
}
|
|
93540
93810
|
function parseSuiteFile(filePath, raw) {
|
|
93541
93811
|
const parsed = safeJsonParse6(raw);
|
|
93542
93812
|
if (parsed.isErr()) {
|
|
93543
|
-
return (0,
|
|
93813
|
+
return (0, import_neverthrow96.err)({ type: "SUITE_INVALID", path: filePath, cause: parsed.error });
|
|
93544
93814
|
}
|
|
93545
93815
|
const validated = suiteFileSchema.safeParse(parsed.value);
|
|
93546
93816
|
if (!validated.success) {
|
|
93547
|
-
return (0,
|
|
93817
|
+
return (0, import_neverthrow96.err)({ type: "SUITE_INVALID", path: filePath, cause: validated.error });
|
|
93548
93818
|
}
|
|
93549
|
-
return (0,
|
|
93819
|
+
return (0, import_neverthrow96.ok)(validated.data);
|
|
93550
93820
|
}
|
|
93551
93821
|
function suiteIdFromPath(filePath) {
|
|
93552
|
-
const name =
|
|
93822
|
+
const name = import_node_path38.default.basename(filePath);
|
|
93553
93823
|
return name.slice(0, name.length - SUITE_FILE_SUFFIX.length);
|
|
93554
93824
|
}
|
|
93555
93825
|
function loadSpecReference(xqaDirectory, specPath) {
|
|
93556
|
-
const absolute =
|
|
93826
|
+
const absolute = import_node_path38.default.resolve(xqaDirectory, specPath);
|
|
93557
93827
|
return readSpecFile2(absolute).andThen((raw) => {
|
|
93558
93828
|
const parsed = parseSpecFrontmatter(raw);
|
|
93559
93829
|
if (parsed.isErr()) {
|
|
93560
|
-
return (0,
|
|
93830
|
+
return (0, import_neverthrow96.err)({
|
|
93561
93831
|
type: "SPEC_FRONTMATTER_INVALID",
|
|
93562
93832
|
path: absolute,
|
|
93563
93833
|
cause: parsed.error.cause
|
|
@@ -93565,19 +93835,19 @@ function loadSpecReference(xqaDirectory, specPath) {
|
|
|
93565
93835
|
}
|
|
93566
93836
|
const { feature, timeoutSeconds } = parsed.value;
|
|
93567
93837
|
if (timeoutSeconds === void 0) {
|
|
93568
|
-
return (0,
|
|
93838
|
+
return (0, import_neverthrow96.ok)({ path: specPath, feature });
|
|
93569
93839
|
}
|
|
93570
|
-
return (0,
|
|
93840
|
+
return (0, import_neverthrow96.ok)({ path: specPath, feature, timeoutSeconds });
|
|
93571
93841
|
});
|
|
93572
93842
|
}
|
|
93573
93843
|
function loadSpecReferences(xqaDirectory, specs) {
|
|
93574
93844
|
if (specs.length === 0) {
|
|
93575
|
-
return (0,
|
|
93845
|
+
return (0, import_neverthrow96.okAsync)([]);
|
|
93576
93846
|
}
|
|
93577
|
-
return
|
|
93847
|
+
return import_neverthrow96.ResultAsync.combine(specs.map((specPath) => loadSpecReference(xqaDirectory, specPath)));
|
|
93578
93848
|
}
|
|
93579
93849
|
function addSpecTokens(tokens, spec) {
|
|
93580
|
-
const stem =
|
|
93850
|
+
const stem = import_node_path38.default.basename(spec.path).replace(/\.test\.md$/u, "");
|
|
93581
93851
|
for (const part of stem.split(".")) {
|
|
93582
93852
|
if (part.length > 0) {
|
|
93583
93853
|
tokens.add(part);
|
|
@@ -93650,12 +93920,12 @@ function loadSuite(suiteFilePath, xqaDirectory) {
|
|
|
93650
93920
|
);
|
|
93651
93921
|
}
|
|
93652
93922
|
function loadXqaSuites(directory) {
|
|
93653
|
-
const xqaDirectory =
|
|
93923
|
+
const xqaDirectory = import_node_path38.default.dirname(import_node_path38.default.resolve(directory));
|
|
93654
93924
|
return listSuiteFiles(directory).andThen((files) => {
|
|
93655
93925
|
if (files.length === 0) {
|
|
93656
|
-
return (0,
|
|
93926
|
+
return (0, import_neverthrow96.okAsync)([]);
|
|
93657
93927
|
}
|
|
93658
|
-
return
|
|
93928
|
+
return import_neverthrow96.ResultAsync.combine(files.map((file2) => loadSuite(file2, xqaDirectory)));
|
|
93659
93929
|
});
|
|
93660
93930
|
}
|
|
93661
93931
|
|
|
@@ -93666,27 +93936,27 @@ function parseRepo(input) {
|
|
|
93666
93936
|
const parts = input.split("/");
|
|
93667
93937
|
const [owner, repo] = parts;
|
|
93668
93938
|
if (parts.length !== 2 || owner === void 0 || owner === "" || repo === void 0 || repo === "") {
|
|
93669
|
-
return (0,
|
|
93939
|
+
return (0, import_neverthrow97.err)({ type: "CLI_INVALID_ARG", message: `invalid --repo value: ${input}` });
|
|
93670
93940
|
}
|
|
93671
|
-
return (0,
|
|
93941
|
+
return (0, import_neverthrow97.ok)({ owner, repo });
|
|
93672
93942
|
}
|
|
93673
93943
|
function parsePrNumber(input) {
|
|
93674
93944
|
const parsed = Number.parseInt(input, 10);
|
|
93675
93945
|
if (!Number.isFinite(parsed) || parsed <= 0) {
|
|
93676
|
-
return (0,
|
|
93946
|
+
return (0, import_neverthrow97.err)({ type: "CLI_INVALID_ARG", message: `invalid --pr value: ${input}` });
|
|
93677
93947
|
}
|
|
93678
|
-
return (0,
|
|
93948
|
+
return (0, import_neverthrow97.ok)(parsed);
|
|
93679
93949
|
}
|
|
93680
93950
|
function parseCliInputs(options2) {
|
|
93681
93951
|
const repoResult = parseRepo(options2.repo);
|
|
93682
93952
|
if (repoResult.isErr()) {
|
|
93683
|
-
return (0,
|
|
93953
|
+
return (0, import_neverthrow97.err)(repoResult.error);
|
|
93684
93954
|
}
|
|
93685
93955
|
const prResult = parsePrNumber(options2.pr);
|
|
93686
93956
|
if (prResult.isErr()) {
|
|
93687
|
-
return (0,
|
|
93957
|
+
return (0, import_neverthrow97.err)(prResult.error);
|
|
93688
93958
|
}
|
|
93689
|
-
return (0,
|
|
93959
|
+
return (0, import_neverthrow97.ok)({
|
|
93690
93960
|
owner: repoResult.value.owner,
|
|
93691
93961
|
repo: repoResult.value.repo,
|
|
93692
93962
|
prNumber: prResult.value
|
|
@@ -93694,23 +93964,23 @@ function parseCliInputs(options2) {
|
|
|
93694
93964
|
}
|
|
93695
93965
|
function resolveGithubToken(context) {
|
|
93696
93966
|
if (!context.rootConfig.agents.triager.enabled) {
|
|
93697
|
-
return (0,
|
|
93967
|
+
return (0, import_neverthrow97.err)({ type: "TRIAGER_DISABLED" });
|
|
93698
93968
|
}
|
|
93699
93969
|
if (context.config.GITHUB_TOKEN === void 0) {
|
|
93700
|
-
return (0,
|
|
93970
|
+
return (0, import_neverthrow97.err)({ type: "CONFIG_MISSING", key: "GITHUB_TOKEN" });
|
|
93701
93971
|
}
|
|
93702
|
-
return (0,
|
|
93972
|
+
return (0, import_neverthrow97.ok)(context.config.GITHUB_TOKEN);
|
|
93703
93973
|
}
|
|
93704
93974
|
function buildInputs(options2, context) {
|
|
93705
93975
|
const tokenResult = resolveGithubToken(context);
|
|
93706
93976
|
if (tokenResult.isErr()) {
|
|
93707
|
-
return (0,
|
|
93977
|
+
return (0, import_neverthrow97.err)(tokenResult.error);
|
|
93708
93978
|
}
|
|
93709
93979
|
const parsed = parseCliInputs(options2);
|
|
93710
93980
|
if (parsed.isErr()) {
|
|
93711
|
-
return (0,
|
|
93981
|
+
return (0, import_neverthrow97.err)(parsed.error);
|
|
93712
93982
|
}
|
|
93713
|
-
return (0,
|
|
93983
|
+
return (0, import_neverthrow97.ok)({
|
|
93714
93984
|
owner: parsed.value.owner,
|
|
93715
93985
|
repo: parsed.value.repo,
|
|
93716
93986
|
prNumber: parsed.value.prNumber,
|
|
@@ -93738,7 +94008,7 @@ function callTriager(options2) {
|
|
|
93738
94008
|
}
|
|
93739
94009
|
function maybeApplyLabels(inputs, labels) {
|
|
93740
94010
|
if (!inputs.applyLabels || labels.length === 0) {
|
|
93741
|
-
return
|
|
94011
|
+
return import_neverthrow97.ResultAsync.fromSafePromise(Promise.resolve(labels));
|
|
93742
94012
|
}
|
|
93743
94013
|
return applyPullRequestLabels({
|
|
93744
94014
|
owner: inputs.owner,
|
|
@@ -93749,7 +94019,7 @@ function maybeApplyLabels(inputs, labels) {
|
|
|
93749
94019
|
}).map(() => labels);
|
|
93750
94020
|
}
|
|
93751
94021
|
function runPipeline5(inputs) {
|
|
93752
|
-
return
|
|
94022
|
+
return import_neverthrow97.ResultAsync.combine([
|
|
93753
94023
|
loadXqaSuites(inputs.suitesDir),
|
|
93754
94024
|
fetchPullRequestDiff({
|
|
93755
94025
|
owner: inputs.owner,
|
|
@@ -93835,18 +94105,23 @@ var agentsSchema = external_exports.object({
|
|
|
93835
94105
|
consolidator: consolidatorConfigSchema,
|
|
93836
94106
|
triager: triagerConfigSchema
|
|
93837
94107
|
}).strict();
|
|
94108
|
+
var planPrObjectSchema = external_exports.object({
|
|
94109
|
+
enabled: external_exports.boolean().default(true)
|
|
94110
|
+
}).strict();
|
|
94111
|
+
var planPrSchema = external_exports.preprocess((value) => value ?? {}, planPrObjectSchema).default({ enabled: true });
|
|
93838
94112
|
var rootConfigSchema = external_exports.object({
|
|
93839
94113
|
version: external_exports.literal(1),
|
|
93840
94114
|
run: runSchema,
|
|
93841
94115
|
suites: suitesSchema,
|
|
93842
|
-
agents: agentsSchema
|
|
94116
|
+
agents: agentsSchema,
|
|
94117
|
+
planPr: planPrSchema
|
|
93843
94118
|
}).strict();
|
|
93844
94119
|
|
|
93845
94120
|
// src/config.ts
|
|
93846
|
-
var
|
|
94121
|
+
var import_node_path39 = __toESM(require("node:path"), 1);
|
|
93847
94122
|
var import_node_url2 = require("node:url");
|
|
93848
94123
|
var import_dotenv = __toESM(require_main(), 1);
|
|
93849
|
-
var
|
|
94124
|
+
var import_neverthrow98 = __toESM(require_index_cjs(), 1);
|
|
93850
94125
|
|
|
93851
94126
|
// src/config-schema.ts
|
|
93852
94127
|
var configSchema = external_exports.object({
|
|
@@ -93856,23 +94131,23 @@ var configSchema = external_exports.object({
|
|
|
93856
94131
|
});
|
|
93857
94132
|
|
|
93858
94133
|
// src/config.ts
|
|
93859
|
-
var packageDirectory =
|
|
94134
|
+
var packageDirectory = import_node_path39.default.dirname((0, import_node_url2.fileURLToPath)(__importMetaUrl));
|
|
93860
94135
|
function loadConfig2() {
|
|
93861
|
-
(0, import_dotenv.config)({ path:
|
|
94136
|
+
(0, import_dotenv.config)({ path: import_node_path39.default.resolve(packageDirectory, "..", ".env.local") });
|
|
93862
94137
|
const result = configSchema.safeParse(process.env);
|
|
93863
94138
|
if (!result.success) {
|
|
93864
94139
|
const messages = result.error.issues.map(
|
|
93865
94140
|
(issue2) => ` - ${issue2.path.join(".")}: ${issue2.message}`
|
|
93866
94141
|
);
|
|
93867
|
-
return (0,
|
|
94142
|
+
return (0, import_neverthrow98.err)({ type: "INVALID_CONFIG", message: `Configuration error:
|
|
93868
94143
|
${messages.join("\n")}` });
|
|
93869
94144
|
}
|
|
93870
|
-
return (0,
|
|
94145
|
+
return (0, import_neverthrow98.ok)(result.data);
|
|
93871
94146
|
}
|
|
93872
94147
|
|
|
93873
94148
|
// src/pid-lock.ts
|
|
93874
94149
|
var import_node_fs13 = require("node:fs");
|
|
93875
|
-
var
|
|
94150
|
+
var import_neverthrow99 = __toESM(require_index_cjs(), 1);
|
|
93876
94151
|
var PID_FILE = "/tmp/xqa.pid";
|
|
93877
94152
|
var SIGINT_EXIT_CODE = 130;
|
|
93878
94153
|
var SIGTERM_EXIT_CODE = 143;
|
|
@@ -93881,7 +94156,7 @@ var HARD_TIMEOUT_MS = 1e4;
|
|
|
93881
94156
|
var cleanup = () => {
|
|
93882
94157
|
(0, import_node_fs13.rmSync)(PID_FILE, { force: true });
|
|
93883
94158
|
};
|
|
93884
|
-
var checkProcessRunning = (0,
|
|
94159
|
+
var checkProcessRunning = (0, import_neverthrow99.fromThrowable)(
|
|
93885
94160
|
(pid) => {
|
|
93886
94161
|
process.kill(pid, 0);
|
|
93887
94162
|
return true;
|
|
@@ -93948,16 +94223,16 @@ function acquireLock() {
|
|
|
93948
94223
|
function loadCliContext(signal) {
|
|
93949
94224
|
const configResult = loadConfig2();
|
|
93950
94225
|
if (configResult.isErr()) {
|
|
93951
|
-
return (0,
|
|
94226
|
+
return (0, import_neverthrow100.err)(configResult.error);
|
|
93952
94227
|
}
|
|
93953
94228
|
const rootConfigResult = loadConfigSync({
|
|
93954
94229
|
cwd: process.cwd(),
|
|
93955
94230
|
schema: rootConfigSchema
|
|
93956
94231
|
});
|
|
93957
94232
|
if (rootConfigResult.isErr()) {
|
|
93958
|
-
return (0,
|
|
94233
|
+
return (0, import_neverthrow100.err)(rootConfigResult.error);
|
|
93959
94234
|
}
|
|
93960
|
-
return (0,
|
|
94235
|
+
return (0, import_neverthrow100.ok)({
|
|
93961
94236
|
config: configResult.value,
|
|
93962
94237
|
rootConfig: rootConfigResult.value,
|
|
93963
94238
|
signal
|
|
@@ -93989,7 +94264,7 @@ function buildProgram(options2) {
|
|
|
93989
94264
|
|
|
93990
94265
|
// src/index.ts
|
|
93991
94266
|
process.title = "xqa";
|
|
93992
|
-
var version2 = `${"5.
|
|
94267
|
+
var version2 = `${"5.3.0"}${false ? ` (dev build +${"2cb661f"})` : ""}`;
|
|
93993
94268
|
var program2 = buildProgram({ version: version2 });
|
|
93994
94269
|
void program2.parseAsync(process.argv);
|
|
93995
94270
|
/*! Bundled license information:
|