agentv 2.5.1 → 2.5.2

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.
@@ -1,10 +1,764 @@
1
1
  import {
2
2
  __commonJS,
3
3
  __export,
4
+ __require,
4
5
  __toESM,
5
6
  require_token_error
6
7
  } from "./chunk-UE4GLFVL.js";
7
8
 
9
+ // ../../node_modules/.bun/didyoumean@1.2.2/node_modules/didyoumean/didYouMean-1.2.1.js
10
+ var require_didYouMean_1_2_1 = __commonJS({
11
+ "../../node_modules/.bun/didyoumean@1.2.2/node_modules/didyoumean/didYouMean-1.2.1.js"(exports, module) {
12
+ "use strict";
13
+ (function() {
14
+ "use strict";
15
+ function didYouMean2(str, list, key2) {
16
+ if (!str) return null;
17
+ if (!didYouMean2.caseSensitive) {
18
+ str = str.toLowerCase();
19
+ }
20
+ var thresholdRelative = didYouMean2.threshold === null ? null : didYouMean2.threshold * str.length, thresholdAbsolute = didYouMean2.thresholdAbsolute, winningVal;
21
+ if (thresholdRelative !== null && thresholdAbsolute !== null) winningVal = Math.min(thresholdRelative, thresholdAbsolute);
22
+ else if (thresholdRelative !== null) winningVal = thresholdRelative;
23
+ else if (thresholdAbsolute !== null) winningVal = thresholdAbsolute;
24
+ else winningVal = null;
25
+ var winner, candidate, testCandidate, val, i, len = list.length;
26
+ for (i = 0; i < len; i++) {
27
+ candidate = list[i];
28
+ if (key2) {
29
+ candidate = candidate[key2];
30
+ }
31
+ if (!candidate) {
32
+ continue;
33
+ }
34
+ if (!didYouMean2.caseSensitive) {
35
+ testCandidate = candidate.toLowerCase();
36
+ } else {
37
+ testCandidate = candidate;
38
+ }
39
+ val = getEditDistance(str, testCandidate, winningVal);
40
+ if (winningVal === null || val < winningVal) {
41
+ winningVal = val;
42
+ if (key2 && didYouMean2.returnWinningObject) winner = list[i];
43
+ else winner = candidate;
44
+ if (didYouMean2.returnFirstMatch) return winner;
45
+ }
46
+ }
47
+ return winner || didYouMean2.nullResultValue;
48
+ }
49
+ didYouMean2.threshold = 0.4;
50
+ didYouMean2.thresholdAbsolute = 20;
51
+ didYouMean2.caseSensitive = false;
52
+ didYouMean2.nullResultValue = null;
53
+ didYouMean2.returnWinningObject = null;
54
+ didYouMean2.returnFirstMatch = false;
55
+ if (typeof module !== "undefined" && module.exports) {
56
+ module.exports = didYouMean2;
57
+ } else {
58
+ window.didYouMean = didYouMean2;
59
+ }
60
+ var MAX_INT = Math.pow(2, 32) - 1;
61
+ function getEditDistance(a, b, max) {
62
+ max = max || max === 0 ? max : MAX_INT;
63
+ var lena = a.length;
64
+ var lenb = b.length;
65
+ if (lena === 0) return Math.min(max + 1, lenb);
66
+ if (lenb === 0) return Math.min(max + 1, lena);
67
+ if (Math.abs(lena - lenb) > max) return max + 1;
68
+ var matrix = [], i, j, colMin, minJ, maxJ;
69
+ for (i = 0; i <= lenb; i++) {
70
+ matrix[i] = [i];
71
+ }
72
+ for (j = 0; j <= lena; j++) {
73
+ matrix[0][j] = j;
74
+ }
75
+ for (i = 1; i <= lenb; i++) {
76
+ colMin = MAX_INT;
77
+ minJ = 1;
78
+ if (i > max) minJ = i - max;
79
+ maxJ = lenb + 1;
80
+ if (maxJ > max + i) maxJ = max + i;
81
+ for (j = 1; j <= lena; j++) {
82
+ if (j < minJ || j > maxJ) {
83
+ matrix[i][j] = max + 1;
84
+ } else {
85
+ if (b.charAt(i - 1) === a.charAt(j - 1)) {
86
+ matrix[i][j] = matrix[i - 1][j - 1];
87
+ } else {
88
+ matrix[i][j] = Math.min(
89
+ matrix[i - 1][j - 1] + 1,
90
+ // Substitute
91
+ Math.min(
92
+ matrix[i][j - 1] + 1,
93
+ // Insert
94
+ matrix[i - 1][j] + 1
95
+ )
96
+ );
97
+ }
98
+ }
99
+ if (matrix[i][j] < colMin) colMin = matrix[i][j];
100
+ }
101
+ if (colMin > max) return max + 1;
102
+ }
103
+ return matrix[lenb][lena];
104
+ }
105
+ })();
106
+ }
107
+ });
108
+
109
+ // ../../node_modules/.bun/ms@2.1.3/node_modules/ms/index.js
110
+ var require_ms = __commonJS({
111
+ "../../node_modules/.bun/ms@2.1.3/node_modules/ms/index.js"(exports, module) {
112
+ "use strict";
113
+ var s = 1e3;
114
+ var m = s * 60;
115
+ var h = m * 60;
116
+ var d = h * 24;
117
+ var w = d * 7;
118
+ var y = d * 365.25;
119
+ module.exports = function(val, options) {
120
+ options = options || {};
121
+ var type = typeof val;
122
+ if (type === "string" && val.length > 0) {
123
+ return parse9(val);
124
+ } else if (type === "number" && isFinite(val)) {
125
+ return options.long ? fmtLong(val) : fmtShort(val);
126
+ }
127
+ throw new Error(
128
+ "val is not a non-empty string or a valid number. val=" + JSON.stringify(val)
129
+ );
130
+ };
131
+ function parse9(str) {
132
+ str = String(str);
133
+ if (str.length > 100) {
134
+ return;
135
+ }
136
+ var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
137
+ str
138
+ );
139
+ if (!match) {
140
+ return;
141
+ }
142
+ var n = parseFloat(match[1]);
143
+ var type = (match[2] || "ms").toLowerCase();
144
+ switch (type) {
145
+ case "years":
146
+ case "year":
147
+ case "yrs":
148
+ case "yr":
149
+ case "y":
150
+ return n * y;
151
+ case "weeks":
152
+ case "week":
153
+ case "w":
154
+ return n * w;
155
+ case "days":
156
+ case "day":
157
+ case "d":
158
+ return n * d;
159
+ case "hours":
160
+ case "hour":
161
+ case "hrs":
162
+ case "hr":
163
+ case "h":
164
+ return n * h;
165
+ case "minutes":
166
+ case "minute":
167
+ case "mins":
168
+ case "min":
169
+ case "m":
170
+ return n * m;
171
+ case "seconds":
172
+ case "second":
173
+ case "secs":
174
+ case "sec":
175
+ case "s":
176
+ return n * s;
177
+ case "milliseconds":
178
+ case "millisecond":
179
+ case "msecs":
180
+ case "msec":
181
+ case "ms":
182
+ return n;
183
+ default:
184
+ return void 0;
185
+ }
186
+ }
187
+ function fmtShort(ms) {
188
+ var msAbs = Math.abs(ms);
189
+ if (msAbs >= d) {
190
+ return Math.round(ms / d) + "d";
191
+ }
192
+ if (msAbs >= h) {
193
+ return Math.round(ms / h) + "h";
194
+ }
195
+ if (msAbs >= m) {
196
+ return Math.round(ms / m) + "m";
197
+ }
198
+ if (msAbs >= s) {
199
+ return Math.round(ms / s) + "s";
200
+ }
201
+ return ms + "ms";
202
+ }
203
+ function fmtLong(ms) {
204
+ var msAbs = Math.abs(ms);
205
+ if (msAbs >= d) {
206
+ return plural(ms, msAbs, d, "day");
207
+ }
208
+ if (msAbs >= h) {
209
+ return plural(ms, msAbs, h, "hour");
210
+ }
211
+ if (msAbs >= m) {
212
+ return plural(ms, msAbs, m, "minute");
213
+ }
214
+ if (msAbs >= s) {
215
+ return plural(ms, msAbs, s, "second");
216
+ }
217
+ return ms + " ms";
218
+ }
219
+ function plural(ms, msAbs, n, name16) {
220
+ var isPlural = msAbs >= n * 1.5;
221
+ return Math.round(ms / n) + " " + name16 + (isPlural ? "s" : "");
222
+ }
223
+ }
224
+ });
225
+
226
+ // ../../node_modules/.bun/debug@4.4.3/node_modules/debug/src/common.js
227
+ var require_common = __commonJS({
228
+ "../../node_modules/.bun/debug@4.4.3/node_modules/debug/src/common.js"(exports, module) {
229
+ "use strict";
230
+ function setup(env2) {
231
+ createDebug.debug = createDebug;
232
+ createDebug.default = createDebug;
233
+ createDebug.coerce = coerce2;
234
+ createDebug.disable = disable;
235
+ createDebug.enable = enable;
236
+ createDebug.enabled = enabled;
237
+ createDebug.humanize = require_ms();
238
+ createDebug.destroy = destroy;
239
+ Object.keys(env2).forEach((key2) => {
240
+ createDebug[key2] = env2[key2];
241
+ });
242
+ createDebug.names = [];
243
+ createDebug.skips = [];
244
+ createDebug.formatters = {};
245
+ function selectColor(namespace) {
246
+ let hash = 0;
247
+ for (let i = 0; i < namespace.length; i++) {
248
+ hash = (hash << 5) - hash + namespace.charCodeAt(i);
249
+ hash |= 0;
250
+ }
251
+ return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
252
+ }
253
+ createDebug.selectColor = selectColor;
254
+ function createDebug(namespace) {
255
+ let prevTime;
256
+ let enableOverride = null;
257
+ let namespacesCache;
258
+ let enabledCache;
259
+ function debug2(...args) {
260
+ if (!debug2.enabled) {
261
+ return;
262
+ }
263
+ const self = debug2;
264
+ const curr = Number(/* @__PURE__ */ new Date());
265
+ const ms = curr - (prevTime || curr);
266
+ self.diff = ms;
267
+ self.prev = prevTime;
268
+ self.curr = curr;
269
+ prevTime = curr;
270
+ args[0] = createDebug.coerce(args[0]);
271
+ if (typeof args[0] !== "string") {
272
+ args.unshift("%O");
273
+ }
274
+ let index = 0;
275
+ args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {
276
+ if (match === "%%") {
277
+ return "%";
278
+ }
279
+ index++;
280
+ const formatter = createDebug.formatters[format];
281
+ if (typeof formatter === "function") {
282
+ const val = args[index];
283
+ match = formatter.call(self, val);
284
+ args.splice(index, 1);
285
+ index--;
286
+ }
287
+ return match;
288
+ });
289
+ createDebug.formatArgs.call(self, args);
290
+ const logFn = self.log || createDebug.log;
291
+ logFn.apply(self, args);
292
+ }
293
+ debug2.namespace = namespace;
294
+ debug2.useColors = createDebug.useColors();
295
+ debug2.color = createDebug.selectColor(namespace);
296
+ debug2.extend = extend2;
297
+ debug2.destroy = createDebug.destroy;
298
+ Object.defineProperty(debug2, "enabled", {
299
+ enumerable: true,
300
+ configurable: false,
301
+ get: () => {
302
+ if (enableOverride !== null) {
303
+ return enableOverride;
304
+ }
305
+ if (namespacesCache !== createDebug.namespaces) {
306
+ namespacesCache = createDebug.namespaces;
307
+ enabledCache = createDebug.enabled(namespace);
308
+ }
309
+ return enabledCache;
310
+ },
311
+ set: (v) => {
312
+ enableOverride = v;
313
+ }
314
+ });
315
+ if (typeof createDebug.init === "function") {
316
+ createDebug.init(debug2);
317
+ }
318
+ return debug2;
319
+ }
320
+ function extend2(namespace, delimiter) {
321
+ const newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace);
322
+ newDebug.log = this.log;
323
+ return newDebug;
324
+ }
325
+ function enable(namespaces) {
326
+ createDebug.save(namespaces);
327
+ createDebug.namespaces = namespaces;
328
+ createDebug.names = [];
329
+ createDebug.skips = [];
330
+ const split = (typeof namespaces === "string" ? namespaces : "").trim().replace(/\s+/g, ",").split(",").filter(Boolean);
331
+ for (const ns of split) {
332
+ if (ns[0] === "-") {
333
+ createDebug.skips.push(ns.slice(1));
334
+ } else {
335
+ createDebug.names.push(ns);
336
+ }
337
+ }
338
+ }
339
+ function matchesTemplate(search, template) {
340
+ let searchIndex = 0;
341
+ let templateIndex = 0;
342
+ let starIndex = -1;
343
+ let matchIndex = 0;
344
+ while (searchIndex < search.length) {
345
+ if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === "*")) {
346
+ if (template[templateIndex] === "*") {
347
+ starIndex = templateIndex;
348
+ matchIndex = searchIndex;
349
+ templateIndex++;
350
+ } else {
351
+ searchIndex++;
352
+ templateIndex++;
353
+ }
354
+ } else if (starIndex !== -1) {
355
+ templateIndex = starIndex + 1;
356
+ matchIndex++;
357
+ searchIndex = matchIndex;
358
+ } else {
359
+ return false;
360
+ }
361
+ }
362
+ while (templateIndex < template.length && template[templateIndex] === "*") {
363
+ templateIndex++;
364
+ }
365
+ return templateIndex === template.length;
366
+ }
367
+ function disable() {
368
+ const namespaces = [
369
+ ...createDebug.names,
370
+ ...createDebug.skips.map((namespace) => "-" + namespace)
371
+ ].join(",");
372
+ createDebug.enable("");
373
+ return namespaces;
374
+ }
375
+ function enabled(name16) {
376
+ for (const skip of createDebug.skips) {
377
+ if (matchesTemplate(name16, skip)) {
378
+ return false;
379
+ }
380
+ }
381
+ for (const ns of createDebug.names) {
382
+ if (matchesTemplate(name16, ns)) {
383
+ return true;
384
+ }
385
+ }
386
+ return false;
387
+ }
388
+ function coerce2(val) {
389
+ if (val instanceof Error) {
390
+ return val.stack || val.message;
391
+ }
392
+ return val;
393
+ }
394
+ function destroy() {
395
+ console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
396
+ }
397
+ createDebug.enable(createDebug.load());
398
+ return createDebug;
399
+ }
400
+ module.exports = setup;
401
+ }
402
+ });
403
+
404
+ // ../../node_modules/.bun/debug@4.4.3/node_modules/debug/src/browser.js
405
+ var require_browser = __commonJS({
406
+ "../../node_modules/.bun/debug@4.4.3/node_modules/debug/src/browser.js"(exports, module) {
407
+ "use strict";
408
+ exports.formatArgs = formatArgs;
409
+ exports.save = save;
410
+ exports.load = load;
411
+ exports.useColors = useColors;
412
+ exports.storage = localstorage();
413
+ exports.destroy = /* @__PURE__ */ (() => {
414
+ let warned = false;
415
+ return () => {
416
+ if (!warned) {
417
+ warned = true;
418
+ console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
419
+ }
420
+ };
421
+ })();
422
+ exports.colors = [
423
+ "#0000CC",
424
+ "#0000FF",
425
+ "#0033CC",
426
+ "#0033FF",
427
+ "#0066CC",
428
+ "#0066FF",
429
+ "#0099CC",
430
+ "#0099FF",
431
+ "#00CC00",
432
+ "#00CC33",
433
+ "#00CC66",
434
+ "#00CC99",
435
+ "#00CCCC",
436
+ "#00CCFF",
437
+ "#3300CC",
438
+ "#3300FF",
439
+ "#3333CC",
440
+ "#3333FF",
441
+ "#3366CC",
442
+ "#3366FF",
443
+ "#3399CC",
444
+ "#3399FF",
445
+ "#33CC00",
446
+ "#33CC33",
447
+ "#33CC66",
448
+ "#33CC99",
449
+ "#33CCCC",
450
+ "#33CCFF",
451
+ "#6600CC",
452
+ "#6600FF",
453
+ "#6633CC",
454
+ "#6633FF",
455
+ "#66CC00",
456
+ "#66CC33",
457
+ "#9900CC",
458
+ "#9900FF",
459
+ "#9933CC",
460
+ "#9933FF",
461
+ "#99CC00",
462
+ "#99CC33",
463
+ "#CC0000",
464
+ "#CC0033",
465
+ "#CC0066",
466
+ "#CC0099",
467
+ "#CC00CC",
468
+ "#CC00FF",
469
+ "#CC3300",
470
+ "#CC3333",
471
+ "#CC3366",
472
+ "#CC3399",
473
+ "#CC33CC",
474
+ "#CC33FF",
475
+ "#CC6600",
476
+ "#CC6633",
477
+ "#CC9900",
478
+ "#CC9933",
479
+ "#CCCC00",
480
+ "#CCCC33",
481
+ "#FF0000",
482
+ "#FF0033",
483
+ "#FF0066",
484
+ "#FF0099",
485
+ "#FF00CC",
486
+ "#FF00FF",
487
+ "#FF3300",
488
+ "#FF3333",
489
+ "#FF3366",
490
+ "#FF3399",
491
+ "#FF33CC",
492
+ "#FF33FF",
493
+ "#FF6600",
494
+ "#FF6633",
495
+ "#FF9900",
496
+ "#FF9933",
497
+ "#FFCC00",
498
+ "#FFCC33"
499
+ ];
500
+ function useColors() {
501
+ if (typeof window !== "undefined" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) {
502
+ return true;
503
+ }
504
+ if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
505
+ return false;
506
+ }
507
+ let m;
508
+ return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773
509
+ typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?
510
+ // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
511
+ typeof navigator !== "undefined" && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker
512
+ typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
513
+ }
514
+ function formatArgs(args) {
515
+ args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module.exports.humanize(this.diff);
516
+ if (!this.useColors) {
517
+ return;
518
+ }
519
+ const c3 = "color: " + this.color;
520
+ args.splice(1, 0, c3, "color: inherit");
521
+ let index = 0;
522
+ let lastC = 0;
523
+ args[0].replace(/%[a-zA-Z%]/g, (match) => {
524
+ if (match === "%%") {
525
+ return;
526
+ }
527
+ index++;
528
+ if (match === "%c") {
529
+ lastC = index;
530
+ }
531
+ });
532
+ args.splice(lastC, 0, c3);
533
+ }
534
+ exports.log = console.debug || console.log || (() => {
535
+ });
536
+ function save(namespaces) {
537
+ try {
538
+ if (namespaces) {
539
+ exports.storage.setItem("debug", namespaces);
540
+ } else {
541
+ exports.storage.removeItem("debug");
542
+ }
543
+ } catch (error40) {
544
+ }
545
+ }
546
+ function load() {
547
+ let r;
548
+ try {
549
+ r = exports.storage.getItem("debug") || exports.storage.getItem("DEBUG");
550
+ } catch (error40) {
551
+ }
552
+ if (!r && typeof process !== "undefined" && "env" in process) {
553
+ r = process.env.DEBUG;
554
+ }
555
+ return r;
556
+ }
557
+ function localstorage() {
558
+ try {
559
+ return localStorage;
560
+ } catch (error40) {
561
+ }
562
+ }
563
+ module.exports = require_common()(exports);
564
+ var { formatters } = module.exports;
565
+ formatters.j = function(v) {
566
+ try {
567
+ return JSON.stringify(v);
568
+ } catch (error40) {
569
+ return "[UnexpectedJSONParseError]: " + error40.message;
570
+ }
571
+ };
572
+ }
573
+ });
574
+
575
+ // ../../node_modules/.bun/debug@4.4.3/node_modules/debug/src/node.js
576
+ var require_node = __commonJS({
577
+ "../../node_modules/.bun/debug@4.4.3/node_modules/debug/src/node.js"(exports, module) {
578
+ "use strict";
579
+ var tty2 = __require("tty");
580
+ var util3 = __require("util");
581
+ exports.init = init;
582
+ exports.log = log;
583
+ exports.formatArgs = formatArgs;
584
+ exports.save = save;
585
+ exports.load = load;
586
+ exports.useColors = useColors;
587
+ exports.destroy = util3.deprecate(
588
+ () => {
589
+ },
590
+ "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."
591
+ );
592
+ exports.colors = [6, 2, 3, 4, 5, 1];
593
+ try {
594
+ const supportsColor2 = __require("supports-color");
595
+ if (supportsColor2 && (supportsColor2.stderr || supportsColor2).level >= 2) {
596
+ exports.colors = [
597
+ 20,
598
+ 21,
599
+ 26,
600
+ 27,
601
+ 32,
602
+ 33,
603
+ 38,
604
+ 39,
605
+ 40,
606
+ 41,
607
+ 42,
608
+ 43,
609
+ 44,
610
+ 45,
611
+ 56,
612
+ 57,
613
+ 62,
614
+ 63,
615
+ 68,
616
+ 69,
617
+ 74,
618
+ 75,
619
+ 76,
620
+ 77,
621
+ 78,
622
+ 79,
623
+ 80,
624
+ 81,
625
+ 92,
626
+ 93,
627
+ 98,
628
+ 99,
629
+ 112,
630
+ 113,
631
+ 128,
632
+ 129,
633
+ 134,
634
+ 135,
635
+ 148,
636
+ 149,
637
+ 160,
638
+ 161,
639
+ 162,
640
+ 163,
641
+ 164,
642
+ 165,
643
+ 166,
644
+ 167,
645
+ 168,
646
+ 169,
647
+ 170,
648
+ 171,
649
+ 172,
650
+ 173,
651
+ 178,
652
+ 179,
653
+ 184,
654
+ 185,
655
+ 196,
656
+ 197,
657
+ 198,
658
+ 199,
659
+ 200,
660
+ 201,
661
+ 202,
662
+ 203,
663
+ 204,
664
+ 205,
665
+ 206,
666
+ 207,
667
+ 208,
668
+ 209,
669
+ 214,
670
+ 215,
671
+ 220,
672
+ 221
673
+ ];
674
+ }
675
+ } catch (error40) {
676
+ }
677
+ exports.inspectOpts = Object.keys(process.env).filter((key2) => {
678
+ return /^debug_/i.test(key2);
679
+ }).reduce((obj, key2) => {
680
+ const prop = key2.substring(6).toLowerCase().replace(/_([a-z])/g, (_, k) => {
681
+ return k.toUpperCase();
682
+ });
683
+ let val = process.env[key2];
684
+ if (/^(yes|on|true|enabled)$/i.test(val)) {
685
+ val = true;
686
+ } else if (/^(no|off|false|disabled)$/i.test(val)) {
687
+ val = false;
688
+ } else if (val === "null") {
689
+ val = null;
690
+ } else {
691
+ val = Number(val);
692
+ }
693
+ obj[prop] = val;
694
+ return obj;
695
+ }, {});
696
+ function useColors() {
697
+ return "colors" in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty2.isatty(process.stderr.fd);
698
+ }
699
+ function formatArgs(args) {
700
+ const { namespace: name16, useColors: useColors2 } = this;
701
+ if (useColors2) {
702
+ const c3 = this.color;
703
+ const colorCode = "\x1B[3" + (c3 < 8 ? c3 : "8;5;" + c3);
704
+ const prefix = ` ${colorCode};1m${name16} \x1B[0m`;
705
+ args[0] = prefix + args[0].split("\n").join("\n" + prefix);
706
+ args.push(colorCode + "m+" + module.exports.humanize(this.diff) + "\x1B[0m");
707
+ } else {
708
+ args[0] = getDate() + name16 + " " + args[0];
709
+ }
710
+ }
711
+ function getDate() {
712
+ if (exports.inspectOpts.hideDate) {
713
+ return "";
714
+ }
715
+ return (/* @__PURE__ */ new Date()).toISOString() + " ";
716
+ }
717
+ function log(...args) {
718
+ return process.stderr.write(util3.formatWithOptions(exports.inspectOpts, ...args) + "\n");
719
+ }
720
+ function save(namespaces) {
721
+ if (namespaces) {
722
+ process.env.DEBUG = namespaces;
723
+ } else {
724
+ delete process.env.DEBUG;
725
+ }
726
+ }
727
+ function load() {
728
+ return process.env.DEBUG;
729
+ }
730
+ function init(debug2) {
731
+ debug2.inspectOpts = {};
732
+ const keys = Object.keys(exports.inspectOpts);
733
+ for (let i = 0; i < keys.length; i++) {
734
+ debug2.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
735
+ }
736
+ }
737
+ module.exports = require_common()(exports);
738
+ var { formatters } = module.exports;
739
+ formatters.o = function(v) {
740
+ this.inspectOpts.colors = this.useColors;
741
+ return util3.inspect(v, this.inspectOpts).split("\n").map((str) => str.trim()).join(" ");
742
+ };
743
+ formatters.O = function(v) {
744
+ this.inspectOpts.colors = this.useColors;
745
+ return util3.inspect(v, this.inspectOpts);
746
+ };
747
+ }
748
+ });
749
+
750
+ // ../../node_modules/.bun/debug@4.4.3/node_modules/debug/src/index.js
751
+ var require_src = __commonJS({
752
+ "../../node_modules/.bun/debug@4.4.3/node_modules/debug/src/index.js"(exports, module) {
753
+ "use strict";
754
+ if (typeof process === "undefined" || process.type === "renderer" || process.browser === true || process.__nwjs) {
755
+ module.exports = require_browser();
756
+ } else {
757
+ module.exports = require_node();
758
+ }
759
+ }
760
+ });
761
+
8
762
  // ../../node_modules/.bun/@vercel+oidc@3.0.5/node_modules/@vercel/oidc/dist/get-context.js
9
763
  var require_get_context = __commonJS({
10
764
  "../../node_modules/.bun/@vercel+oidc@3.0.5/node_modules/@vercel/oidc/dist/get-context.js"(exports, module) {
@@ -71,11 +825,11 @@ var require_get_vercel_oidc_token = __commonJS({
71
825
  var import_token_error = require_token_error();
72
826
  async function getVercelOidcToken3() {
73
827
  let token2 = "";
74
- let err;
828
+ let err2;
75
829
  try {
76
830
  token2 = getVercelOidcTokenSync2();
77
831
  } catch (error40) {
78
- err = error40;
832
+ err2 = error40;
79
833
  }
80
834
  try {
81
835
  const [{ getTokenPayload, isExpired }, { refreshToken }] = await Promise.all([
@@ -87,8 +841,8 @@ var require_get_vercel_oidc_token = __commonJS({
87
841
  token2 = getVercelOidcTokenSync2();
88
842
  }
89
843
  } catch (error40) {
90
- if (err?.message && error40 instanceof Error) {
91
- error40.message = `${err.message}
844
+ if (err2?.message && error40 instanceof Error) {
845
+ error40.message = `${err2.message}
92
846
  ${error40.message}`;
93
847
  }
94
848
  throw new import_token_error.VercelOidcTokenError(`Failed to refresh OIDC token`, error40);
@@ -142,11 +896,1816 @@ var require_dist = __commonJS({
142
896
 
143
897
  // src/index.ts
144
898
  import { readFileSync as readFileSync4 } from "node:fs";
145
- import { binary, run, subcommands as subcommands2 } from "cmd-ts";
899
+
900
+ // ../../node_modules/.bun/chalk@5.6.2/node_modules/chalk/source/vendor/ansi-styles/index.js
901
+ var ANSI_BACKGROUND_OFFSET = 10;
902
+ var wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
903
+ var wrapAnsi256 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`;
904
+ var wrapAnsi16m = (offset = 0) => (red, green, blue) => `\x1B[${38 + offset};2;${red};${green};${blue}m`;
905
+ var styles = {
906
+ modifier: {
907
+ reset: [0, 0],
908
+ // 21 isn't widely supported and 22 does the same thing
909
+ bold: [1, 22],
910
+ dim: [2, 22],
911
+ italic: [3, 23],
912
+ underline: [4, 24],
913
+ overline: [53, 55],
914
+ inverse: [7, 27],
915
+ hidden: [8, 28],
916
+ strikethrough: [9, 29]
917
+ },
918
+ color: {
919
+ black: [30, 39],
920
+ red: [31, 39],
921
+ green: [32, 39],
922
+ yellow: [33, 39],
923
+ blue: [34, 39],
924
+ magenta: [35, 39],
925
+ cyan: [36, 39],
926
+ white: [37, 39],
927
+ // Bright color
928
+ blackBright: [90, 39],
929
+ gray: [90, 39],
930
+ // Alias of `blackBright`
931
+ grey: [90, 39],
932
+ // Alias of `blackBright`
933
+ redBright: [91, 39],
934
+ greenBright: [92, 39],
935
+ yellowBright: [93, 39],
936
+ blueBright: [94, 39],
937
+ magentaBright: [95, 39],
938
+ cyanBright: [96, 39],
939
+ whiteBright: [97, 39]
940
+ },
941
+ bgColor: {
942
+ bgBlack: [40, 49],
943
+ bgRed: [41, 49],
944
+ bgGreen: [42, 49],
945
+ bgYellow: [43, 49],
946
+ bgBlue: [44, 49],
947
+ bgMagenta: [45, 49],
948
+ bgCyan: [46, 49],
949
+ bgWhite: [47, 49],
950
+ // Bright color
951
+ bgBlackBright: [100, 49],
952
+ bgGray: [100, 49],
953
+ // Alias of `bgBlackBright`
954
+ bgGrey: [100, 49],
955
+ // Alias of `bgBlackBright`
956
+ bgRedBright: [101, 49],
957
+ bgGreenBright: [102, 49],
958
+ bgYellowBright: [103, 49],
959
+ bgBlueBright: [104, 49],
960
+ bgMagentaBright: [105, 49],
961
+ bgCyanBright: [106, 49],
962
+ bgWhiteBright: [107, 49]
963
+ }
964
+ };
965
+ var modifierNames = Object.keys(styles.modifier);
966
+ var foregroundColorNames = Object.keys(styles.color);
967
+ var backgroundColorNames = Object.keys(styles.bgColor);
968
+ var colorNames = [...foregroundColorNames, ...backgroundColorNames];
969
+ function assembleStyles() {
970
+ const codes = /* @__PURE__ */ new Map();
971
+ for (const [groupName, group] of Object.entries(styles)) {
972
+ for (const [styleName, style] of Object.entries(group)) {
973
+ styles[styleName] = {
974
+ open: `\x1B[${style[0]}m`,
975
+ close: `\x1B[${style[1]}m`
976
+ };
977
+ group[styleName] = styles[styleName];
978
+ codes.set(style[0], style[1]);
979
+ }
980
+ Object.defineProperty(styles, groupName, {
981
+ value: group,
982
+ enumerable: false
983
+ });
984
+ }
985
+ Object.defineProperty(styles, "codes", {
986
+ value: codes,
987
+ enumerable: false
988
+ });
989
+ styles.color.close = "\x1B[39m";
990
+ styles.bgColor.close = "\x1B[49m";
991
+ styles.color.ansi = wrapAnsi16();
992
+ styles.color.ansi256 = wrapAnsi256();
993
+ styles.color.ansi16m = wrapAnsi16m();
994
+ styles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);
995
+ styles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
996
+ styles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
997
+ Object.defineProperties(styles, {
998
+ rgbToAnsi256: {
999
+ value(red, green, blue) {
1000
+ if (red === green && green === blue) {
1001
+ if (red < 8) {
1002
+ return 16;
1003
+ }
1004
+ if (red > 248) {
1005
+ return 231;
1006
+ }
1007
+ return Math.round((red - 8) / 247 * 24) + 232;
1008
+ }
1009
+ return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5);
1010
+ },
1011
+ enumerable: false
1012
+ },
1013
+ hexToRgb: {
1014
+ value(hex) {
1015
+ const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
1016
+ if (!matches) {
1017
+ return [0, 0, 0];
1018
+ }
1019
+ let [colorString] = matches;
1020
+ if (colorString.length === 3) {
1021
+ colorString = [...colorString].map((character) => character + character).join("");
1022
+ }
1023
+ const integer2 = Number.parseInt(colorString, 16);
1024
+ return [
1025
+ /* eslint-disable no-bitwise */
1026
+ integer2 >> 16 & 255,
1027
+ integer2 >> 8 & 255,
1028
+ integer2 & 255
1029
+ /* eslint-enable no-bitwise */
1030
+ ];
1031
+ },
1032
+ enumerable: false
1033
+ },
1034
+ hexToAnsi256: {
1035
+ value: (hex) => styles.rgbToAnsi256(...styles.hexToRgb(hex)),
1036
+ enumerable: false
1037
+ },
1038
+ ansi256ToAnsi: {
1039
+ value(code) {
1040
+ if (code < 8) {
1041
+ return 30 + code;
1042
+ }
1043
+ if (code < 16) {
1044
+ return 90 + (code - 8);
1045
+ }
1046
+ let red;
1047
+ let green;
1048
+ let blue;
1049
+ if (code >= 232) {
1050
+ red = ((code - 232) * 10 + 8) / 255;
1051
+ green = red;
1052
+ blue = red;
1053
+ } else {
1054
+ code -= 16;
1055
+ const remainder = code % 36;
1056
+ red = Math.floor(code / 36) / 5;
1057
+ green = Math.floor(remainder / 6) / 5;
1058
+ blue = remainder % 6 / 5;
1059
+ }
1060
+ const value = Math.max(red, green, blue) * 2;
1061
+ if (value === 0) {
1062
+ return 30;
1063
+ }
1064
+ let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red));
1065
+ if (value === 2) {
1066
+ result += 60;
1067
+ }
1068
+ return result;
1069
+ },
1070
+ enumerable: false
1071
+ },
1072
+ rgbToAnsi: {
1073
+ value: (red, green, blue) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red, green, blue)),
1074
+ enumerable: false
1075
+ },
1076
+ hexToAnsi: {
1077
+ value: (hex) => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)),
1078
+ enumerable: false
1079
+ }
1080
+ });
1081
+ return styles;
1082
+ }
1083
+ var ansiStyles = assembleStyles();
1084
+ var ansi_styles_default = ansiStyles;
1085
+
1086
+ // ../../node_modules/.bun/chalk@5.6.2/node_modules/chalk/source/vendor/supports-color/index.js
1087
+ import process2 from "node:process";
1088
+ import os from "node:os";
1089
+ import tty from "node:tty";
1090
+ function hasFlag(flag2, argv = globalThis.Deno ? globalThis.Deno.args : process2.argv) {
1091
+ const prefix = flag2.startsWith("-") ? "" : flag2.length === 1 ? "-" : "--";
1092
+ const position = argv.indexOf(prefix + flag2);
1093
+ const terminatorPosition = argv.indexOf("--");
1094
+ return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
1095
+ }
1096
+ var { env } = process2;
1097
+ var flagForceColor;
1098
+ if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
1099
+ flagForceColor = 0;
1100
+ } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
1101
+ flagForceColor = 1;
1102
+ }
1103
+ function envForceColor() {
1104
+ if ("FORCE_COLOR" in env) {
1105
+ if (env.FORCE_COLOR === "true") {
1106
+ return 1;
1107
+ }
1108
+ if (env.FORCE_COLOR === "false") {
1109
+ return 0;
1110
+ }
1111
+ return env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
1112
+ }
1113
+ }
1114
+ function translateLevel(level) {
1115
+ if (level === 0) {
1116
+ return false;
1117
+ }
1118
+ return {
1119
+ level,
1120
+ hasBasic: true,
1121
+ has256: level >= 2,
1122
+ has16m: level >= 3
1123
+ };
1124
+ }
1125
+ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
1126
+ const noFlagForceColor = envForceColor();
1127
+ if (noFlagForceColor !== void 0) {
1128
+ flagForceColor = noFlagForceColor;
1129
+ }
1130
+ const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;
1131
+ if (forceColor === 0) {
1132
+ return 0;
1133
+ }
1134
+ if (sniffFlags) {
1135
+ if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
1136
+ return 3;
1137
+ }
1138
+ if (hasFlag("color=256")) {
1139
+ return 2;
1140
+ }
1141
+ }
1142
+ if ("TF_BUILD" in env && "AGENT_NAME" in env) {
1143
+ return 1;
1144
+ }
1145
+ if (haveStream && !streamIsTTY && forceColor === void 0) {
1146
+ return 0;
1147
+ }
1148
+ const min = forceColor || 0;
1149
+ if (env.TERM === "dumb") {
1150
+ return min;
1151
+ }
1152
+ if (process2.platform === "win32") {
1153
+ const osRelease = os.release().split(".");
1154
+ if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
1155
+ return Number(osRelease[2]) >= 14931 ? 3 : 2;
1156
+ }
1157
+ return 1;
1158
+ }
1159
+ if ("CI" in env) {
1160
+ if (["GITHUB_ACTIONS", "GITEA_ACTIONS", "CIRCLECI"].some((key2) => key2 in env)) {
1161
+ return 3;
1162
+ }
1163
+ if (["TRAVIS", "APPVEYOR", "GITLAB_CI", "BUILDKITE", "DRONE"].some((sign2) => sign2 in env) || env.CI_NAME === "codeship") {
1164
+ return 1;
1165
+ }
1166
+ return min;
1167
+ }
1168
+ if ("TEAMCITY_VERSION" in env) {
1169
+ return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
1170
+ }
1171
+ if (env.COLORTERM === "truecolor") {
1172
+ return 3;
1173
+ }
1174
+ if (env.TERM === "xterm-kitty") {
1175
+ return 3;
1176
+ }
1177
+ if (env.TERM === "xterm-ghostty") {
1178
+ return 3;
1179
+ }
1180
+ if (env.TERM === "wezterm") {
1181
+ return 3;
1182
+ }
1183
+ if ("TERM_PROGRAM" in env) {
1184
+ const version2 = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
1185
+ switch (env.TERM_PROGRAM) {
1186
+ case "iTerm.app": {
1187
+ return version2 >= 3 ? 3 : 2;
1188
+ }
1189
+ case "Apple_Terminal": {
1190
+ return 2;
1191
+ }
1192
+ }
1193
+ }
1194
+ if (/-256(color)?$/i.test(env.TERM)) {
1195
+ return 2;
1196
+ }
1197
+ if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
1198
+ return 1;
1199
+ }
1200
+ if ("COLORTERM" in env) {
1201
+ return 1;
1202
+ }
1203
+ return min;
1204
+ }
1205
+ function createSupportsColor(stream, options = {}) {
1206
+ const level = _supportsColor(stream, {
1207
+ streamIsTTY: stream && stream.isTTY,
1208
+ ...options
1209
+ });
1210
+ return translateLevel(level);
1211
+ }
1212
+ var supportsColor = {
1213
+ stdout: createSupportsColor({ isTTY: tty.isatty(1) }),
1214
+ stderr: createSupportsColor({ isTTY: tty.isatty(2) })
1215
+ };
1216
+ var supports_color_default = supportsColor;
1217
+
1218
+ // ../../node_modules/.bun/chalk@5.6.2/node_modules/chalk/source/utilities.js
1219
+ function stringReplaceAll(string5, substring, replacer) {
1220
+ let index = string5.indexOf(substring);
1221
+ if (index === -1) {
1222
+ return string5;
1223
+ }
1224
+ const substringLength = substring.length;
1225
+ let endIndex = 0;
1226
+ let returnValue = "";
1227
+ do {
1228
+ returnValue += string5.slice(endIndex, index) + substring + replacer;
1229
+ endIndex = index + substringLength;
1230
+ index = string5.indexOf(substring, endIndex);
1231
+ } while (index !== -1);
1232
+ returnValue += string5.slice(endIndex);
1233
+ return returnValue;
1234
+ }
1235
+ function stringEncaseCRLFWithFirstIndex(string5, prefix, postfix, index) {
1236
+ let endIndex = 0;
1237
+ let returnValue = "";
1238
+ do {
1239
+ const gotCR = string5[index - 1] === "\r";
1240
+ returnValue += string5.slice(endIndex, gotCR ? index - 1 : index) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
1241
+ endIndex = index + 1;
1242
+ index = string5.indexOf("\n", endIndex);
1243
+ } while (index !== -1);
1244
+ returnValue += string5.slice(endIndex);
1245
+ return returnValue;
1246
+ }
1247
+
1248
+ // ../../node_modules/.bun/chalk@5.6.2/node_modules/chalk/source/index.js
1249
+ var { stdout: stdoutColor, stderr: stderrColor } = supports_color_default;
1250
+ var GENERATOR = Symbol("GENERATOR");
1251
+ var STYLER = Symbol("STYLER");
1252
+ var IS_EMPTY = Symbol("IS_EMPTY");
1253
+ var levelMapping = [
1254
+ "ansi",
1255
+ "ansi",
1256
+ "ansi256",
1257
+ "ansi16m"
1258
+ ];
1259
+ var styles2 = /* @__PURE__ */ Object.create(null);
1260
+ var applyOptions = (object3, options = {}) => {
1261
+ if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
1262
+ throw new Error("The `level` option should be an integer from 0 to 3");
1263
+ }
1264
+ const colorLevel = stdoutColor ? stdoutColor.level : 0;
1265
+ object3.level = options.level === void 0 ? colorLevel : options.level;
1266
+ };
1267
+ var chalkFactory = (options) => {
1268
+ const chalk2 = (...strings) => strings.join(" ");
1269
+ applyOptions(chalk2, options);
1270
+ Object.setPrototypeOf(chalk2, createChalk.prototype);
1271
+ return chalk2;
1272
+ };
1273
+ function createChalk(options) {
1274
+ return chalkFactory(options);
1275
+ }
1276
+ Object.setPrototypeOf(createChalk.prototype, Function.prototype);
1277
+ for (const [styleName, style] of Object.entries(ansi_styles_default)) {
1278
+ styles2[styleName] = {
1279
+ get() {
1280
+ const builder = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]);
1281
+ Object.defineProperty(this, styleName, { value: builder });
1282
+ return builder;
1283
+ }
1284
+ };
1285
+ }
1286
+ styles2.visible = {
1287
+ get() {
1288
+ const builder = createBuilder(this, this[STYLER], true);
1289
+ Object.defineProperty(this, "visible", { value: builder });
1290
+ return builder;
1291
+ }
1292
+ };
1293
+ var getModelAnsi = (model, level, type, ...arguments_) => {
1294
+ if (model === "rgb") {
1295
+ if (level === "ansi16m") {
1296
+ return ansi_styles_default[type].ansi16m(...arguments_);
1297
+ }
1298
+ if (level === "ansi256") {
1299
+ return ansi_styles_default[type].ansi256(ansi_styles_default.rgbToAnsi256(...arguments_));
1300
+ }
1301
+ return ansi_styles_default[type].ansi(ansi_styles_default.rgbToAnsi(...arguments_));
1302
+ }
1303
+ if (model === "hex") {
1304
+ return getModelAnsi("rgb", level, type, ...ansi_styles_default.hexToRgb(...arguments_));
1305
+ }
1306
+ return ansi_styles_default[type][model](...arguments_);
1307
+ };
1308
+ var usedModels = ["rgb", "hex", "ansi256"];
1309
+ for (const model of usedModels) {
1310
+ styles2[model] = {
1311
+ get() {
1312
+ const { level } = this;
1313
+ return function(...arguments_) {
1314
+ const styler = createStyler(getModelAnsi(model, levelMapping[level], "color", ...arguments_), ansi_styles_default.color.close, this[STYLER]);
1315
+ return createBuilder(this, styler, this[IS_EMPTY]);
1316
+ };
1317
+ }
1318
+ };
1319
+ const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
1320
+ styles2[bgModel] = {
1321
+ get() {
1322
+ const { level } = this;
1323
+ return function(...arguments_) {
1324
+ const styler = createStyler(getModelAnsi(model, levelMapping[level], "bgColor", ...arguments_), ansi_styles_default.bgColor.close, this[STYLER]);
1325
+ return createBuilder(this, styler, this[IS_EMPTY]);
1326
+ };
1327
+ }
1328
+ };
1329
+ }
1330
+ var proto = Object.defineProperties(() => {
1331
+ }, {
1332
+ ...styles2,
1333
+ level: {
1334
+ enumerable: true,
1335
+ get() {
1336
+ return this[GENERATOR].level;
1337
+ },
1338
+ set(level) {
1339
+ this[GENERATOR].level = level;
1340
+ }
1341
+ }
1342
+ });
1343
+ var createStyler = (open, close, parent) => {
1344
+ let openAll;
1345
+ let closeAll;
1346
+ if (parent === void 0) {
1347
+ openAll = open;
1348
+ closeAll = close;
1349
+ } else {
1350
+ openAll = parent.openAll + open;
1351
+ closeAll = close + parent.closeAll;
1352
+ }
1353
+ return {
1354
+ open,
1355
+ close,
1356
+ openAll,
1357
+ closeAll,
1358
+ parent
1359
+ };
1360
+ };
1361
+ var createBuilder = (self, _styler, _isEmpty) => {
1362
+ const builder = (...arguments_) => applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
1363
+ Object.setPrototypeOf(builder, proto);
1364
+ builder[GENERATOR] = self;
1365
+ builder[STYLER] = _styler;
1366
+ builder[IS_EMPTY] = _isEmpty;
1367
+ return builder;
1368
+ };
1369
+ var applyStyle = (self, string5) => {
1370
+ if (self.level <= 0 || !string5) {
1371
+ return self[IS_EMPTY] ? "" : string5;
1372
+ }
1373
+ let styler = self[STYLER];
1374
+ if (styler === void 0) {
1375
+ return string5;
1376
+ }
1377
+ const { openAll, closeAll } = styler;
1378
+ if (string5.includes("\x1B")) {
1379
+ while (styler !== void 0) {
1380
+ string5 = stringReplaceAll(string5, styler.close, styler.open);
1381
+ styler = styler.parent;
1382
+ }
1383
+ }
1384
+ const lfIndex = string5.indexOf("\n");
1385
+ if (lfIndex !== -1) {
1386
+ string5 = stringEncaseCRLFWithFirstIndex(string5, closeAll, openAll, lfIndex);
1387
+ }
1388
+ return openAll + string5 + closeAll;
1389
+ };
1390
+ Object.defineProperties(createChalk.prototype, styles2);
1391
+ var chalk = createChalk();
1392
+ var chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 });
1393
+ var source_default = chalk;
1394
+
1395
+ // ../../node_modules/.bun/cmd-ts@0.14.3/node_modules/cmd-ts/dist/esm/subcommands.js
1396
+ var import_didyoumean = __toESM(require_didYouMean_1_2_1());
1397
+
1398
+ // ../../node_modules/.bun/cmd-ts@0.14.3/node_modules/cmd-ts/dist/esm/Result.js
1399
+ function ok(value) {
1400
+ return { _tag: "ok", value };
1401
+ }
1402
+ function err(error40) {
1403
+ return { _tag: "error", error: error40 };
1404
+ }
1405
+ function isOk(result) {
1406
+ return result._tag === "ok";
1407
+ }
1408
+ function isErr(either) {
1409
+ return either._tag === "error";
1410
+ }
1411
+ async function safeAsync(promise2) {
1412
+ try {
1413
+ const value = await promise2;
1414
+ return ok(value);
1415
+ } catch (e) {
1416
+ return err(e);
1417
+ }
1418
+ }
1419
+
1420
+ // ../../node_modules/.bun/cmd-ts@0.14.3/node_modules/cmd-ts/dist/esm/effects.js
1421
+ var Exit = class {
1422
+ constructor(config2) {
1423
+ this.config = config2;
1424
+ }
1425
+ run() {
1426
+ const output = this.output();
1427
+ output(this.config.message);
1428
+ process.exit(this.config.exitCode);
1429
+ }
1430
+ dryRun() {
1431
+ const { into, message, exitCode } = this.config;
1432
+ const coloredExit = source_default.dim(`process exited with status ${exitCode} (${into})`);
1433
+ return `${message}
1434
+
1435
+ ${coloredExit}`;
1436
+ }
1437
+ output() {
1438
+ if (this.config.into === "stderr") {
1439
+ return console.error;
1440
+ }
1441
+ return console.log;
1442
+ }
1443
+ };
1444
+
1445
+ // ../../node_modules/.bun/cmd-ts@0.14.3/node_modules/cmd-ts/dist/esm/newparser/findOption.js
1446
+ function findOption(nodes, opts) {
1447
+ const result = [];
1448
+ for (const node of nodes) {
1449
+ if (node.type === "longOption" && opts.longNames.includes(node.key)) {
1450
+ result.push(node);
1451
+ continue;
1452
+ }
1453
+ if (node.type === "shortOptions" && opts.shortNames.length) {
1454
+ for (const option2 of node.options) {
1455
+ if (opts.shortNames.includes(option2.key)) {
1456
+ result.push(option2);
1457
+ }
1458
+ }
1459
+ }
1460
+ }
1461
+ return result;
1462
+ }
1463
+
1464
+ // ../../node_modules/.bun/cmd-ts@0.14.3/node_modules/cmd-ts/dist/esm/from.js
1465
+ function identity() {
1466
+ return {
1467
+ async from(a) {
1468
+ return a;
1469
+ }
1470
+ };
1471
+ }
1472
+
1473
+ // ../../node_modules/.bun/cmd-ts@0.14.3/node_modules/cmd-ts/dist/esm/type.js
1474
+ function typeDef(from) {
1475
+ if (typeof from === "function") {
1476
+ return {};
1477
+ }
1478
+ return from;
1479
+ }
1480
+ function fromFn(t) {
1481
+ if (typeof t === "function") {
1482
+ return t;
1483
+ }
1484
+ return t.from;
1485
+ }
1486
+ function extendType(base, nextTypeOrDecodingFunction) {
1487
+ const { defaultValue: _defaultValue, onMissing: _onMissing, from: _from, ...t1WithoutDefault } = base;
1488
+ const t2Object = typeDef(nextTypeOrDecodingFunction);
1489
+ const t2From = fromFn(nextTypeOrDecodingFunction);
1490
+ return {
1491
+ ...t1WithoutDefault,
1492
+ ...t2Object,
1493
+ async from(a) {
1494
+ const f1Result = await base.from(a);
1495
+ return await t2From(f1Result);
1496
+ }
1497
+ };
1498
+ }
1499
+
1500
+ // ../../node_modules/.bun/cmd-ts@0.14.3/node_modules/cmd-ts/dist/esm/types.js
1501
+ var number = {
1502
+ async from(str) {
1503
+ const decoded = Number.parseFloat(str);
1504
+ if (Number.isNaN(decoded)) {
1505
+ throw new Error("Not a number");
1506
+ }
1507
+ return decoded;
1508
+ },
1509
+ displayName: "number",
1510
+ description: "a number"
1511
+ };
1512
+ var string = {
1513
+ ...identity(),
1514
+ description: "a string",
1515
+ displayName: "str"
1516
+ };
1517
+ var boolean = {
1518
+ ...identity(),
1519
+ description: "a boolean",
1520
+ displayName: "true/false",
1521
+ defaultValue() {
1522
+ return false;
1523
+ }
1524
+ };
1525
+ function optional(t) {
1526
+ return {
1527
+ ...t,
1528
+ defaultValue() {
1529
+ return void 0;
1530
+ }
1531
+ };
1532
+ }
1533
+
1534
+ // ../../node_modules/.bun/cmd-ts@0.14.3/node_modules/cmd-ts/dist/esm/flag.js
1535
+ var boolean2 = {
1536
+ async from(str) {
1537
+ if (str === "true")
1538
+ return true;
1539
+ if (str === "false")
1540
+ return false;
1541
+ throw new Error(`expected value to be either "true" or "false". got: "${str}"`);
1542
+ },
1543
+ displayName: "true/false",
1544
+ defaultValue: () => false
1545
+ };
1546
+ function fullFlag(config2) {
1547
+ var _a17;
1548
+ const decoder = extendType(boolean2, config2.type);
1549
+ return {
1550
+ description: (_a17 = config2.description) !== null && _a17 !== void 0 ? _a17 : config2.type.description,
1551
+ helpTopics() {
1552
+ var _a18, _b8;
1553
+ let usage = `--${config2.long}`;
1554
+ if (config2.short) {
1555
+ usage += `, -${config2.short}`;
1556
+ }
1557
+ const defaults = [];
1558
+ if (config2.env) {
1559
+ const env2 = process.env[config2.env] === void 0 ? "" : `=${source_default.italic(process.env[config2.env])}`;
1560
+ defaults.push(`env: ${config2.env}${env2}`);
1561
+ }
1562
+ if (config2.defaultValue) {
1563
+ try {
1564
+ const defaultValue = config2.defaultValue();
1565
+ if (config2.defaultValueIsSerializable) {
1566
+ defaults.push(`default: ${source_default.italic(defaultValue)}`);
1567
+ } else {
1568
+ defaults.push("optional");
1569
+ }
1570
+ } catch (e) {
1571
+ }
1572
+ } else if (config2.type.defaultValue) {
1573
+ try {
1574
+ const defaultValue = config2.type.defaultValue();
1575
+ if (config2.type.defaultValueIsSerializable) {
1576
+ defaults.push(`default: ${source_default.italic(defaultValue)}`);
1577
+ } else {
1578
+ defaults.push("optional");
1579
+ }
1580
+ } catch (e) {
1581
+ }
1582
+ } else if (config2.onMissing || config2.type.onMissing) {
1583
+ defaults.push("optional");
1584
+ }
1585
+ return [
1586
+ {
1587
+ category: "flags",
1588
+ usage,
1589
+ defaults,
1590
+ description: (_b8 = (_a18 = config2.description) !== null && _a18 !== void 0 ? _a18 : config2.type.description) !== null && _b8 !== void 0 ? _b8 : "self explanatory"
1591
+ }
1592
+ ];
1593
+ },
1594
+ register(opts) {
1595
+ opts.forceFlagLongNames.add(config2.long);
1596
+ if (config2.short) {
1597
+ opts.forceFlagShortNames.add(config2.short);
1598
+ }
1599
+ },
1600
+ async parse({ nodes, visitedNodes }) {
1601
+ var _a18, _b8;
1602
+ const options = findOption(nodes, {
1603
+ longNames: [config2.long],
1604
+ shortNames: config2.short ? [config2.short] : []
1605
+ }).filter((x) => !visitedNodes.has(x));
1606
+ options.forEach((opt) => visitedNodes.add(opt));
1607
+ if (options.length > 1) {
1608
+ return err({
1609
+ errors: [
1610
+ {
1611
+ nodes: options,
1612
+ message: `Expected 1 occurence, got ${options.length}`
1613
+ }
1614
+ ]
1615
+ });
1616
+ }
1617
+ const valueFromEnv = config2.env ? process.env[config2.env] : void 0;
1618
+ const onMissingFn = config2.onMissing || config2.type.onMissing;
1619
+ let rawValue;
1620
+ let envPrefix = "";
1621
+ if (options.length === 0 && valueFromEnv !== void 0) {
1622
+ rawValue = valueFromEnv;
1623
+ envPrefix = `env[${source_default.italic(config2.env)}]: `;
1624
+ } else if (options.length === 0 && config2.defaultValue) {
1625
+ try {
1626
+ const defaultValue = config2.defaultValue();
1627
+ return ok(defaultValue);
1628
+ } catch (e) {
1629
+ const message = `Default value not found for '--${config2.long}': ${e.message}`;
1630
+ return err({
1631
+ errors: [{ message, nodes: [] }]
1632
+ });
1633
+ }
1634
+ } else if (options.length === 0 && onMissingFn) {
1635
+ try {
1636
+ const missingValue = await onMissingFn();
1637
+ return ok(missingValue);
1638
+ } catch (e) {
1639
+ const message = `Failed to get missing value for '--${config2.long}': ${e.message}`;
1640
+ return err({
1641
+ errors: [{ message, nodes: [] }]
1642
+ });
1643
+ }
1644
+ } else if (options.length === 0 && config2.type.defaultValue) {
1645
+ try {
1646
+ const defaultValue = config2.type.defaultValue();
1647
+ return ok(defaultValue);
1648
+ } catch (e) {
1649
+ const message = `Default value not found for '--${config2.long}': ${e.message}`;
1650
+ return err({
1651
+ errors: [{ message, nodes: [] }]
1652
+ });
1653
+ }
1654
+ } else if (options.length === 1) {
1655
+ rawValue = (_b8 = (_a18 = options[0].value) === null || _a18 === void 0 ? void 0 : _a18.node.raw) !== null && _b8 !== void 0 ? _b8 : "true";
1656
+ } else {
1657
+ return err({
1658
+ errors: [
1659
+ { nodes: [], message: `No value provided for --${config2.long}` }
1660
+ ]
1661
+ });
1662
+ }
1663
+ const decoded = await safeAsync(decoder.from(rawValue));
1664
+ if (isErr(decoded)) {
1665
+ return err({
1666
+ errors: [
1667
+ {
1668
+ nodes: options,
1669
+ message: envPrefix + decoded.error.message
1670
+ }
1671
+ ]
1672
+ });
1673
+ }
1674
+ return decoded;
1675
+ }
1676
+ };
1677
+ }
1678
+ function flag(config2) {
1679
+ return fullFlag({
1680
+ type: boolean,
1681
+ ...config2
1682
+ });
1683
+ }
1684
+
1685
+ // ../../node_modules/.bun/cmd-ts@0.14.3/node_modules/cmd-ts/dist/esm/circuitbreaker.js
1686
+ var helpFlag = flag({
1687
+ long: "help",
1688
+ short: "h",
1689
+ type: boolean,
1690
+ description: "show help"
1691
+ });
1692
+ var versionFlag = flag({
1693
+ long: "version",
1694
+ short: "v",
1695
+ type: boolean,
1696
+ description: "print the version"
1697
+ });
1698
+ function handleCircuitBreaker(context, value, breaker) {
1699
+ if (isErr(breaker)) {
1700
+ return;
1701
+ }
1702
+ if (breaker.value === "help") {
1703
+ const message = value.printHelp(context);
1704
+ throw new Exit({ exitCode: 0, message, into: "stdout" });
1705
+ }
1706
+ if (breaker.value === "version") {
1707
+ const message = value.version || "0.0.0";
1708
+ throw new Exit({ exitCode: 0, message, into: "stdout" });
1709
+ }
1710
+ }
1711
+ function createCircuitBreaker(withVersion) {
1712
+ return {
1713
+ register(opts) {
1714
+ helpFlag.register(opts);
1715
+ if (withVersion) {
1716
+ versionFlag.register(opts);
1717
+ }
1718
+ },
1719
+ helpTopics() {
1720
+ const helpTopics = helpFlag.helpTopics();
1721
+ if (withVersion) {
1722
+ helpTopics.push(...versionFlag.helpTopics());
1723
+ }
1724
+ return helpTopics;
1725
+ },
1726
+ async parse(context) {
1727
+ const help = await helpFlag.parse(context);
1728
+ const version2 = withVersion ? await versionFlag.parse(context) : void 0;
1729
+ if (isErr(help) || version2 && isErr(version2)) {
1730
+ const helpErrors = isErr(help) ? help.error.errors : [];
1731
+ const versionErrors = version2 && isErr(version2) ? version2.error.errors : [];
1732
+ return err({ errors: [...helpErrors, ...versionErrors] });
1733
+ }
1734
+ if (help.value) {
1735
+ return ok("help");
1736
+ }
1737
+ if (version2 === null || version2 === void 0 ? void 0 : version2.value) {
1738
+ return ok("version");
1739
+ }
1740
+ return err({
1741
+ errors: [
1742
+ {
1743
+ nodes: [],
1744
+ message: "Neither help nor version"
1745
+ }
1746
+ ]
1747
+ });
1748
+ }
1749
+ };
1750
+ }
1751
+
1752
+ // ../../node_modules/.bun/cmd-ts@0.14.3/node_modules/cmd-ts/dist/esm/positional.js
1753
+ function fullPositional(config2) {
1754
+ var _a17, _b8, _c;
1755
+ const displayName = (_b8 = (_a17 = config2.displayName) !== null && _a17 !== void 0 ? _a17 : config2.type.displayName) !== null && _b8 !== void 0 ? _b8 : "arg";
1756
+ return {
1757
+ description: (_c = config2.description) !== null && _c !== void 0 ? _c : config2.type.description,
1758
+ helpTopics() {
1759
+ var _a18, _b9, _c2, _d;
1760
+ const defaults = [];
1761
+ const defaultValueFn = (_a18 = config2.defaultValue) !== null && _a18 !== void 0 ? _a18 : config2.type.defaultValue;
1762
+ if (defaultValueFn) {
1763
+ try {
1764
+ const defaultValue = defaultValueFn();
1765
+ if ((_b9 = config2.defaultValueIsSerializable) !== null && _b9 !== void 0 ? _b9 : config2.type.defaultValueIsSerializable) {
1766
+ defaults.push(`default: ${source_default.italic(defaultValue)}`);
1767
+ } else {
1768
+ defaults.push("optional");
1769
+ }
1770
+ } catch (e) {
1771
+ }
1772
+ }
1773
+ const usage = defaults.length > 0 ? `[${displayName}]` : `<${displayName}>`;
1774
+ return [
1775
+ {
1776
+ category: "arguments",
1777
+ usage,
1778
+ description: (_d = (_c2 = config2.description) !== null && _c2 !== void 0 ? _c2 : config2.type.description) !== null && _d !== void 0 ? _d : "self explanatory",
1779
+ defaults
1780
+ }
1781
+ ];
1782
+ },
1783
+ register(_opts) {
1784
+ },
1785
+ async parse({ nodes, visitedNodes }) {
1786
+ var _a18;
1787
+ const positionals = nodes.filter((node) => node.type === "positionalArgument" && !visitedNodes.has(node));
1788
+ const defaultValueFn = (_a18 = config2.defaultValue) !== null && _a18 !== void 0 ? _a18 : config2.type.defaultValue;
1789
+ const positional3 = positionals[0];
1790
+ if (!positional3) {
1791
+ if (defaultValueFn) {
1792
+ return ok(defaultValueFn());
1793
+ }
1794
+ return err({
1795
+ errors: [
1796
+ {
1797
+ nodes: [],
1798
+ message: `No value provided for ${displayName}`
1799
+ }
1800
+ ]
1801
+ });
1802
+ }
1803
+ visitedNodes.add(positional3);
1804
+ const decoded = await safeAsync(config2.type.from(positional3.raw));
1805
+ if (isErr(decoded)) {
1806
+ return err({
1807
+ errors: [
1808
+ {
1809
+ nodes: [positional3],
1810
+ message: decoded.error.message
1811
+ }
1812
+ ]
1813
+ });
1814
+ }
1815
+ return ok(decoded.value);
1816
+ }
1817
+ };
1818
+ }
1819
+ function positional(config2) {
1820
+ return fullPositional({
1821
+ type: string,
1822
+ ...config2
1823
+ });
1824
+ }
1825
+
1826
+ // ../../node_modules/.bun/cmd-ts@0.14.3/node_modules/cmd-ts/dist/esm/subcommands.js
1827
+ function subcommands(config2) {
1828
+ const circuitbreaker = createCircuitBreaker(!!config2.version);
1829
+ const type = {
1830
+ async from(str) {
1831
+ const commands = Object.entries(config2.cmds).map(([name16, cmd2]) => {
1832
+ var _a17;
1833
+ return {
1834
+ cmdName: name16,
1835
+ names: [name16, ...(_a17 = cmd2.aliases) !== null && _a17 !== void 0 ? _a17 : []]
1836
+ };
1837
+ });
1838
+ const cmd = commands.find((x) => x.names.includes(str));
1839
+ if (cmd) {
1840
+ return cmd.cmdName;
1841
+ }
1842
+ let errorMessage = "Not a valid subcommand name";
1843
+ const closeOptions = (0, import_didyoumean.default)(str, flatMap(commands, (x) => x.names));
1844
+ if (closeOptions) {
1845
+ const option2 = Array.isArray(closeOptions) ? closeOptions[0] : closeOptions;
1846
+ errorMessage += `
1847
+ Did you mean ${source_default.italic(option2)}?`;
1848
+ }
1849
+ throw new Error(errorMessage);
1850
+ }
1851
+ };
1852
+ const subcommand = positional({
1853
+ displayName: "subcommand",
1854
+ description: `one of ${Object.keys(config2.cmds).join(", ")}`,
1855
+ type
1856
+ });
1857
+ function normalizeContext(context) {
1858
+ var _a17;
1859
+ if (((_a17 = context.hotPath) === null || _a17 === void 0 ? void 0 : _a17.length) === 0) {
1860
+ context.hotPath.push(config2.name);
1861
+ }
1862
+ if (!context.nodes.some((n) => !context.visitedNodes.has(n))) {
1863
+ context.nodes.push({
1864
+ type: "longOption",
1865
+ index: 0,
1866
+ key: "help",
1867
+ raw: "--help"
1868
+ });
1869
+ }
1870
+ }
1871
+ return {
1872
+ version: config2.version,
1873
+ description: config2.description,
1874
+ name: config2.name,
1875
+ handler: (value) => {
1876
+ const cmd = config2.cmds[value.command];
1877
+ return cmd.handler(value.args);
1878
+ },
1879
+ register(opts) {
1880
+ for (const cmd of Object.values(config2.cmds)) {
1881
+ cmd.register(opts);
1882
+ }
1883
+ circuitbreaker.register(opts);
1884
+ },
1885
+ printHelp(context) {
1886
+ var _a17, _b8, _c, _d;
1887
+ const lines = [];
1888
+ const argsSoFar = (_b8 = (_a17 = context.hotPath) === null || _a17 === void 0 ? void 0 : _a17.join(" ")) !== null && _b8 !== void 0 ? _b8 : "cli";
1889
+ lines.push(source_default.bold(argsSoFar + source_default.italic(" <subcommand>")));
1890
+ if (config2.description) {
1891
+ lines.push(source_default.dim("> ") + config2.description);
1892
+ }
1893
+ lines.push("");
1894
+ lines.push(`where ${source_default.italic("<subcommand>")} can be one of:`);
1895
+ lines.push("");
1896
+ for (const key2 of Object.keys(config2.cmds)) {
1897
+ const cmd = config2.cmds[key2];
1898
+ let description = (_c = cmd.description) !== null && _c !== void 0 ? _c : "";
1899
+ description = description && ` - ${description} `;
1900
+ if ((_d = cmd.aliases) === null || _d === void 0 ? void 0 : _d.length) {
1901
+ const aliasTxt = cmd.aliases.length === 1 ? "alias" : "aliases";
1902
+ const aliases = cmd.aliases.join(", ");
1903
+ description += source_default.dim(`[${aliasTxt}: ${aliases}]`);
1904
+ }
1905
+ const row = source_default.dim("- ") + key2 + description;
1906
+ lines.push(row.trim());
1907
+ }
1908
+ const helpCommand = source_default.yellow(`${argsSoFar} <subcommand> --help`);
1909
+ lines.push("");
1910
+ lines.push(source_default.dim(`For more help, try running \`${helpCommand}\``));
1911
+ return lines.join("\n");
1912
+ },
1913
+ async parse(context) {
1914
+ var _a17;
1915
+ normalizeContext(context);
1916
+ const parsed = await subcommand.parse(context);
1917
+ if (isErr(parsed)) {
1918
+ return err({
1919
+ errors: parsed.error.errors,
1920
+ partialValue: {}
1921
+ });
1922
+ }
1923
+ (_a17 = context.hotPath) === null || _a17 === void 0 ? void 0 : _a17.push(parsed.value);
1924
+ const cmd = config2.cmds[parsed.value];
1925
+ const parsedCommand = await cmd.parse(context);
1926
+ if (isErr(parsedCommand)) {
1927
+ return err({
1928
+ errors: parsedCommand.error.errors,
1929
+ partialValue: {
1930
+ command: parsed.value,
1931
+ args: parsedCommand.error.partialValue
1932
+ }
1933
+ });
1934
+ }
1935
+ return ok({
1936
+ args: parsedCommand.value,
1937
+ command: parsed.value
1938
+ });
1939
+ },
1940
+ async run(context) {
1941
+ var _a17;
1942
+ normalizeContext(context);
1943
+ const parsedSubcommand = await subcommand.parse(context);
1944
+ if (isErr(parsedSubcommand)) {
1945
+ const breaker = await circuitbreaker.parse(context);
1946
+ handleCircuitBreaker(context, this, breaker);
1947
+ return err({ ...parsedSubcommand.error, partialValue: {} });
1948
+ }
1949
+ (_a17 = context.hotPath) === null || _a17 === void 0 ? void 0 : _a17.push(parsedSubcommand.value);
1950
+ const cmd = config2.cmds[parsedSubcommand.value];
1951
+ const commandRun = await cmd.run(context);
1952
+ if (isOk(commandRun)) {
1953
+ return ok({
1954
+ command: parsedSubcommand.value,
1955
+ value: commandRun.value
1956
+ });
1957
+ }
1958
+ return err({
1959
+ ...commandRun.error,
1960
+ partialValue: {
1961
+ command: parsedSubcommand.value,
1962
+ value: commandRun.error.partialValue
1963
+ }
1964
+ });
1965
+ }
1966
+ };
1967
+ }
1968
+ function flatMap(array2, f) {
1969
+ const rs = [];
1970
+ for (const item of array2) {
1971
+ rs.push(...f(item));
1972
+ }
1973
+ return rs;
1974
+ }
1975
+
1976
+ // ../../node_modules/.bun/cmd-ts@0.14.3/node_modules/cmd-ts/dist/esm/binary.js
1977
+ function binary(cmd) {
1978
+ return {
1979
+ ...cmd,
1980
+ run(context) {
1981
+ var _a17;
1982
+ const name16 = cmd.name || context.nodes[1].raw;
1983
+ (_a17 = context.hotPath) === null || _a17 === void 0 ? void 0 : _a17.push(name16);
1984
+ context.nodes.splice(0, 1);
1985
+ context.nodes[0].raw = name16;
1986
+ context.visitedNodes.add(context.nodes[0]);
1987
+ return cmd.run(context);
1988
+ }
1989
+ };
1990
+ }
1991
+
1992
+ // ../../node_modules/.bun/ansi-regex@6.2.2/node_modules/ansi-regex/index.js
1993
+ function ansiRegex({ onlyFirst = false } = {}) {
1994
+ const ST = "(?:\\u0007|\\u001B\\u005C|\\u009C)";
1995
+ const osc = `(?:\\u001B\\][\\s\\S]*?${ST})`;
1996
+ const csi = "[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";
1997
+ const pattern = `${osc}|${csi}`;
1998
+ return new RegExp(pattern, onlyFirst ? void 0 : "g");
1999
+ }
2000
+
2001
+ // ../../node_modules/.bun/strip-ansi@7.1.2/node_modules/strip-ansi/index.js
2002
+ var regex = ansiRegex();
2003
+ function stripAnsi(string5) {
2004
+ if (typeof string5 !== "string") {
2005
+ throw new TypeError(`Expected a \`string\`, got \`${typeof string5}\``);
2006
+ }
2007
+ return string5.replace(regex, "");
2008
+ }
2009
+
2010
+ // ../../node_modules/.bun/cmd-ts@0.14.3/node_modules/cmd-ts/dist/esm/utils.js
2011
+ function padNoAnsi(str, length, place) {
2012
+ const noAnsiStr = stripAnsi(str);
2013
+ if (length < noAnsiStr.length)
2014
+ return str;
2015
+ const pad = Array(length - noAnsiStr.length + 1).join(" ");
2016
+ if (place === "end") {
2017
+ return str + pad;
2018
+ }
2019
+ return pad + str;
2020
+ }
2021
+ function groupBy(objs, f) {
2022
+ var _a17;
2023
+ const result = {};
2024
+ for (const obj of objs) {
2025
+ const key2 = f(obj);
2026
+ result[key2] = (_a17 = result[key2]) !== null && _a17 !== void 0 ? _a17 : [];
2027
+ result[key2].push(obj);
2028
+ }
2029
+ return result;
2030
+ }
2031
+ function entries(obj) {
2032
+ return Object.entries(obj);
2033
+ }
2034
+ function* enumerate(arr) {
2035
+ for (let i = 0; i < arr.length; i++) {
2036
+ yield [i, arr[i]];
2037
+ }
2038
+ }
2039
+ function flatMap2(xs, fn) {
2040
+ const results = [];
2041
+ for (const x of xs) {
2042
+ results.push(...fn(x));
2043
+ }
2044
+ return results;
2045
+ }
2046
+
2047
+ // ../../node_modules/.bun/cmd-ts@0.14.3/node_modules/cmd-ts/dist/esm/command.js
2048
+ function command(config2) {
2049
+ const argEntries = entries(config2.args);
2050
+ const circuitbreaker = createCircuitBreaker(!!config2.version);
2051
+ return {
2052
+ name: config2.name,
2053
+ aliases: config2.aliases,
2054
+ handler: config2.handler,
2055
+ description: config2.description,
2056
+ version: config2.version,
2057
+ helpTopics() {
2058
+ return flatMap2(Object.values(config2.args).concat([circuitbreaker]), (x) => {
2059
+ var _a17, _b8;
2060
+ return (_b8 = (_a17 = x.helpTopics) === null || _a17 === void 0 ? void 0 : _a17.call(x)) !== null && _b8 !== void 0 ? _b8 : [];
2061
+ });
2062
+ },
2063
+ printHelp(context) {
2064
+ var _a17, _b8;
2065
+ const lines = [];
2066
+ let name16 = (_b8 = (_a17 = context.hotPath) === null || _a17 === void 0 ? void 0 : _a17.join(" ")) !== null && _b8 !== void 0 ? _b8 : "";
2067
+ if (!name16) {
2068
+ name16 = config2.name;
2069
+ }
2070
+ name16 = source_default.bold(name16);
2071
+ if (config2.version) {
2072
+ name16 += ` ${source_default.dim(config2.version)}`;
2073
+ }
2074
+ lines.push(name16);
2075
+ if (config2.description) {
2076
+ lines.push(source_default.dim("> ") + config2.description);
2077
+ }
2078
+ const usageBreakdown = groupBy(this.helpTopics(), (x) => x.category);
2079
+ for (const [category, helpTopics] of entries(usageBreakdown)) {
2080
+ lines.push("");
2081
+ lines.push(`${category.toUpperCase()}:`);
2082
+ const widestUsage = helpTopics.reduce((len, curr) => {
2083
+ return Math.max(len, curr.usage.length);
2084
+ }, 0);
2085
+ for (const helpTopic of helpTopics) {
2086
+ let line2 = "";
2087
+ line2 += ` ${padNoAnsi(helpTopic.usage, widestUsage, "end")}`;
2088
+ line2 += " - ";
2089
+ line2 += helpTopic.description;
2090
+ for (const defaultValue of helpTopic.defaults) {
2091
+ line2 += source_default.dim(` [${defaultValue}]`);
2092
+ }
2093
+ lines.push(line2);
2094
+ }
2095
+ }
2096
+ return lines.join("\n");
2097
+ },
2098
+ register(opts) {
2099
+ var _a17;
2100
+ for (const [, arg] of argEntries) {
2101
+ (_a17 = arg.register) === null || _a17 === void 0 ? void 0 : _a17.call(arg, opts);
2102
+ }
2103
+ },
2104
+ async parse(context) {
2105
+ var _a17;
2106
+ if (((_a17 = context.hotPath) === null || _a17 === void 0 ? void 0 : _a17.length) === 0) {
2107
+ context.hotPath.push(config2.name);
2108
+ }
2109
+ const resultObject = {};
2110
+ const errors = [];
2111
+ for (const [argName, arg] of argEntries) {
2112
+ const result = await arg.parse(context);
2113
+ if (isErr(result)) {
2114
+ errors.push(...result.error.errors);
2115
+ } else {
2116
+ resultObject[argName] = result.value;
2117
+ }
2118
+ }
2119
+ const unknownArguments = [];
2120
+ for (const node of context.nodes) {
2121
+ if (context.visitedNodes.has(node)) {
2122
+ continue;
2123
+ }
2124
+ if (node.type === "forcePositional") {
2125
+ } else if (node.type === "shortOptions") {
2126
+ for (const option2 of node.options) {
2127
+ if (context.visitedNodes.has(option2)) {
2128
+ continue;
2129
+ }
2130
+ unknownArguments.push(option2);
2131
+ }
2132
+ } else {
2133
+ unknownArguments.push(node);
2134
+ }
2135
+ }
2136
+ if (unknownArguments.length > 0) {
2137
+ errors.push({
2138
+ message: "Unknown arguments",
2139
+ nodes: unknownArguments
2140
+ });
2141
+ }
2142
+ if (errors.length > 0) {
2143
+ return err({
2144
+ errors,
2145
+ partialValue: resultObject
2146
+ });
2147
+ }
2148
+ return ok(resultObject);
2149
+ },
2150
+ async run(context) {
2151
+ const breaker = await circuitbreaker.parse(context);
2152
+ handleCircuitBreaker(context, this, breaker);
2153
+ const parsed = await this.parse(context);
2154
+ if (isErr(parsed)) {
2155
+ return err(parsed.error);
2156
+ }
2157
+ return ok(await this.handler(parsed.value));
2158
+ }
2159
+ };
2160
+ }
2161
+
2162
+ // ../../node_modules/.bun/cmd-ts@0.14.3/node_modules/cmd-ts/dist/esm/option.js
2163
+ function fullOption(config2) {
2164
+ var _a17;
2165
+ return {
2166
+ description: (_a17 = config2.description) !== null && _a17 !== void 0 ? _a17 : config2.type.description,
2167
+ helpTopics() {
2168
+ var _a18, _b8, _c;
2169
+ const displayName = (_a18 = config2.type.displayName) !== null && _a18 !== void 0 ? _a18 : "value";
2170
+ let usage = `--${config2.long}`;
2171
+ if (config2.short) {
2172
+ usage += `, -${config2.short}`;
2173
+ }
2174
+ usage += ` <${displayName}>`;
2175
+ const defaults = [];
2176
+ if (config2.env) {
2177
+ const env2 = process.env[config2.env] === void 0 ? "" : `=${source_default.italic(process.env[config2.env])}`;
2178
+ defaults.push(`env: ${config2.env}${env2}`);
2179
+ }
2180
+ if (config2.defaultValue) {
2181
+ try {
2182
+ const defaultValue = config2.defaultValue();
2183
+ if (config2.defaultValueIsSerializable) {
2184
+ defaults.push(`default: ${source_default.italic(defaultValue)}`);
2185
+ } else {
2186
+ defaults.push("optional");
2187
+ }
2188
+ } catch (e) {
2189
+ }
2190
+ } else if (config2.type.defaultValue) {
2191
+ try {
2192
+ const defaultValue = config2.type.defaultValue();
2193
+ if (config2.type.defaultValueIsSerializable) {
2194
+ defaults.push(`default: ${source_default.italic(defaultValue)}`);
2195
+ } else {
2196
+ defaults.push("optional");
2197
+ }
2198
+ } catch (e) {
2199
+ }
2200
+ } else if (config2.onMissing || config2.type.onMissing) {
2201
+ defaults.push("optional");
2202
+ }
2203
+ return [
2204
+ {
2205
+ category: "options",
2206
+ usage,
2207
+ defaults,
2208
+ description: (_c = (_b8 = config2.description) !== null && _b8 !== void 0 ? _b8 : config2.type.description) !== null && _c !== void 0 ? _c : "self explanatory"
2209
+ }
2210
+ ];
2211
+ },
2212
+ register(opts) {
2213
+ opts.forceOptionLongNames.add(config2.long);
2214
+ if (config2.short) {
2215
+ opts.forceOptionShortNames.add(config2.short);
2216
+ }
2217
+ },
2218
+ async parse({ nodes, visitedNodes }) {
2219
+ const options = findOption(nodes, {
2220
+ longNames: [config2.long],
2221
+ shortNames: config2.short ? [config2.short] : []
2222
+ }).filter((x) => !visitedNodes.has(x));
2223
+ options.forEach((opt) => visitedNodes.add(opt));
2224
+ if (options.length > 1) {
2225
+ const error40 = {
2226
+ message: `Too many times provided. Expected 1, got: ${options.length}`,
2227
+ nodes: options
2228
+ };
2229
+ return err({ errors: [error40] });
2230
+ }
2231
+ const valueFromEnv = config2.env ? process.env[config2.env] : void 0;
2232
+ const defaultValueFn = config2.defaultValue || config2.type.defaultValue;
2233
+ const onMissingFn = config2.onMissing || config2.type.onMissing;
2234
+ const option2 = options[0];
2235
+ let rawValue;
2236
+ let envPrefix = "";
2237
+ if (option2 === null || option2 === void 0 ? void 0 : option2.value) {
2238
+ rawValue = option2.value.node.raw;
2239
+ } else if (valueFromEnv !== void 0) {
2240
+ rawValue = valueFromEnv;
2241
+ envPrefix = `env[${source_default.italic(config2.env)}]: `;
2242
+ } else if (defaultValueFn) {
2243
+ try {
2244
+ const defaultValue = defaultValueFn();
2245
+ return ok(defaultValue);
2246
+ } catch (e) {
2247
+ const message = `Default value not found for '--${config2.long}': ${e.message}`;
2248
+ return err({
2249
+ errors: [
2250
+ {
2251
+ nodes: [],
2252
+ message
2253
+ }
2254
+ ]
2255
+ });
2256
+ }
2257
+ } else if (onMissingFn) {
2258
+ try {
2259
+ const missingValue = await onMissingFn();
2260
+ return ok(missingValue);
2261
+ } catch (e) {
2262
+ const message = `Failed to get missing value for '--${config2.long}': ${e.message}`;
2263
+ return err({
2264
+ errors: [
2265
+ {
2266
+ nodes: [],
2267
+ message
2268
+ }
2269
+ ]
2270
+ });
2271
+ }
2272
+ } else {
2273
+ const raw = (option2 === null || option2 === void 0 ? void 0 : option2.type) === "shortOption" ? `-${option2 === null || option2 === void 0 ? void 0 : option2.key}` : `--${config2.long}`;
2274
+ return err({
2275
+ errors: [
2276
+ {
2277
+ nodes: options,
2278
+ message: `No value provided for ${raw}`
2279
+ }
2280
+ ]
2281
+ });
2282
+ }
2283
+ const decoded = await safeAsync(config2.type.from(rawValue));
2284
+ if (isErr(decoded)) {
2285
+ return err({
2286
+ errors: [
2287
+ { nodes: options, message: envPrefix + decoded.error.message }
2288
+ ]
2289
+ });
2290
+ }
2291
+ return ok(decoded.value);
2292
+ }
2293
+ };
2294
+ }
2295
+ function option(config2) {
2296
+ return fullOption({
2297
+ type: string,
2298
+ ...config2
2299
+ });
2300
+ }
2301
+
2302
+ // ../../node_modules/.bun/cmd-ts@0.14.3/node_modules/cmd-ts/dist/esm/errorBox.js
2303
+ function highlight(nodes, error40) {
2304
+ const strings = [];
2305
+ let errorIndex = void 0;
2306
+ function foundError() {
2307
+ if (errorIndex !== void 0)
2308
+ return;
2309
+ errorIndex = stripAnsi(strings.join(" ")).length;
2310
+ }
2311
+ if (error40.nodes.length === 0)
2312
+ return;
2313
+ nodes.forEach((node) => {
2314
+ if (error40.nodes.includes(node)) {
2315
+ foundError();
2316
+ return strings.push(source_default.red(node.raw));
2317
+ }
2318
+ if (node.type === "shortOptions") {
2319
+ let failed = false;
2320
+ let s = "";
2321
+ for (const option2 of node.options) {
2322
+ if (error40.nodes.includes(option2)) {
2323
+ s += source_default.red(option2.raw);
2324
+ failed = true;
2325
+ } else {
2326
+ s += source_default.dim(option2.raw);
2327
+ }
2328
+ }
2329
+ const prefix = failed ? source_default.red("-") : source_default.dim("-");
2330
+ if (failed) {
2331
+ foundError();
2332
+ }
2333
+ return strings.push(prefix + s);
2334
+ }
2335
+ return strings.push(source_default.dim(node.raw));
2336
+ });
2337
+ return { colorized: strings.join(" "), errorIndex: errorIndex !== null && errorIndex !== void 0 ? errorIndex : 0 };
2338
+ }
2339
+ function errorBox(nodes, errors, breadcrumbs) {
2340
+ const withHighlight = [];
2341
+ const errorMessages = [];
2342
+ for (const error40 of errors) {
2343
+ const highlighted = highlight(nodes, error40);
2344
+ withHighlight.push({ message: error40.message, highlighted });
2345
+ }
2346
+ let number5 = 1;
2347
+ const maxNumberWidth = String(withHighlight.length).length;
2348
+ errorMessages.push(`${source_default.red.bold("error: ")}found ${source_default.yellow(withHighlight.length)} error${withHighlight.length > 1 ? "s" : ""}`);
2349
+ errorMessages.push("");
2350
+ withHighlight.filter((x) => x.highlighted).forEach((x) => {
2351
+ if (!x.highlighted) {
2352
+ throw new Error("WELP");
2353
+ }
2354
+ const pad = "".padStart(x.highlighted.errorIndex);
2355
+ errorMessages.push(` ${x.highlighted.colorized}`);
2356
+ for (const [index, line2] of enumerate(x.message.split("\n"))) {
2357
+ const prefix = index === 0 ? source_default.bold("^") : " ";
2358
+ const msg = source_default.red(` ${pad} ${prefix} ${line2}`);
2359
+ errorMessages.push(msg);
2360
+ }
2361
+ errorMessages.push("");
2362
+ number5++;
2363
+ });
2364
+ const withNoHighlight = withHighlight.filter((x) => !x.highlighted);
2365
+ if (number5 > 1) {
2366
+ if (withNoHighlight.length === 1) {
2367
+ errorMessages.push("Along with the following error:");
2368
+ } else if (withNoHighlight.length > 1) {
2369
+ errorMessages.push("Along with the following errors:");
2370
+ }
2371
+ }
2372
+ withNoHighlight.forEach(({ message }) => {
2373
+ const num = source_default.red.bold(`${padNoAnsi(number5.toString(), maxNumberWidth, "start")}.`);
2374
+ errorMessages.push(` ${num} ${source_default.red(message)}`);
2375
+ number5++;
2376
+ });
2377
+ const helpCmd = source_default.yellow(`${breadcrumbs.join(" ")} --help`);
2378
+ errorMessages.push("");
2379
+ errorMessages.push(`${source_default.red.bold("hint: ")}for more information, try '${helpCmd}'`);
2380
+ return errorMessages.join("\n");
2381
+ }
2382
+
2383
+ // ../../node_modules/.bun/cmd-ts@0.14.3/node_modules/cmd-ts/dist/esm/newparser/parser.js
2384
+ var import_debug = __toESM(require_src());
2385
+ var debug = (0, import_debug.default)("cmd-ts:parser");
2386
+ function parse(tokens, forceFlag) {
2387
+ if (debug.enabled) {
2388
+ const registered = {
2389
+ shortFlags: [...forceFlag.forceFlagShortNames],
2390
+ longFlags: [...forceFlag.forceFlagLongNames],
2391
+ shortOptions: [...forceFlag.forceOptionShortNames],
2392
+ longOptions: [...forceFlag.forceOptionLongNames]
2393
+ };
2394
+ debug("Registered:", JSON.stringify(registered));
2395
+ }
2396
+ const nodes = [];
2397
+ let index = 0;
2398
+ let forcedPositional = false;
2399
+ function getToken() {
2400
+ return tokens[index++];
2401
+ }
2402
+ function peekToken() {
2403
+ return tokens[index];
2404
+ }
2405
+ while (index < tokens.length) {
2406
+ const currentToken = getToken();
2407
+ if (!currentToken)
2408
+ break;
2409
+ if (currentToken.type === "argumentDivider") {
2410
+ continue;
2411
+ }
2412
+ if (forcedPositional) {
2413
+ let str = currentToken.raw;
2414
+ let nextToken = getToken();
2415
+ while (nextToken && (nextToken === null || nextToken === void 0 ? void 0 : nextToken.type) !== "argumentDivider") {
2416
+ str += nextToken.raw;
2417
+ nextToken = getToken();
2418
+ }
2419
+ nodes.push({
2420
+ type: "positionalArgument",
2421
+ index: currentToken.index,
2422
+ raw: str
2423
+ });
2424
+ continue;
2425
+ }
2426
+ if (currentToken.type === "char") {
2427
+ let str = currentToken.raw;
2428
+ let nextToken = getToken();
2429
+ while (nextToken && (nextToken === null || nextToken === void 0 ? void 0 : nextToken.type) !== "argumentDivider") {
2430
+ str += nextToken.raw;
2431
+ nextToken = getToken();
2432
+ }
2433
+ nodes.push({
2434
+ type: "positionalArgument",
2435
+ index: currentToken.index,
2436
+ raw: str
2437
+ });
2438
+ continue;
2439
+ }
2440
+ if (currentToken.type === "longPrefix") {
2441
+ let nextToken = getToken();
2442
+ if ((nextToken === null || nextToken === void 0 ? void 0 : nextToken.type) === "argumentDivider" || !nextToken) {
2443
+ nodes.push({
2444
+ type: "forcePositional",
2445
+ index: currentToken.index,
2446
+ raw: "--"
2447
+ });
2448
+ forcedPositional = true;
2449
+ continue;
2450
+ }
2451
+ let key2 = "";
2452
+ while (nextToken && (nextToken === null || nextToken === void 0 ? void 0 : nextToken.raw) !== "=" && (nextToken === null || nextToken === void 0 ? void 0 : nextToken.type) !== "argumentDivider") {
2453
+ key2 += nextToken.raw;
2454
+ nextToken = getToken();
2455
+ }
2456
+ const parsedValue = parseOptionValue({
2457
+ key: key2,
2458
+ delimiterToken: nextToken,
2459
+ forceFlag: forceFlag.forceFlagLongNames,
2460
+ getToken,
2461
+ peekToken,
2462
+ forceOption: forceFlag.forceOptionLongNames
2463
+ });
2464
+ let raw = `--${key2}`;
2465
+ if (parsedValue) {
2466
+ raw += parsedValue.raw;
2467
+ }
2468
+ nodes.push({
2469
+ type: "longOption",
2470
+ key: key2,
2471
+ index: currentToken.index,
2472
+ raw,
2473
+ value: parsedValue
2474
+ });
2475
+ continue;
2476
+ }
2477
+ if (currentToken.type === "shortPrefix") {
2478
+ const keys = [];
2479
+ let nextToken = getToken();
2480
+ if ((nextToken === null || nextToken === void 0 ? void 0 : nextToken.type) === "argumentDivider" || !nextToken) {
2481
+ nodes.push({
2482
+ type: "positionalArgument",
2483
+ index: currentToken.index,
2484
+ raw: "-"
2485
+ });
2486
+ continue;
2487
+ }
2488
+ while (nextToken && (nextToken === null || nextToken === void 0 ? void 0 : nextToken.type) !== "argumentDivider" && (nextToken === null || nextToken === void 0 ? void 0 : nextToken.raw) !== "=") {
2489
+ keys.push(nextToken);
2490
+ nextToken = getToken();
2491
+ }
2492
+ const lastKey = keys.pop();
2493
+ const parsedValue = parseOptionValue({
2494
+ key: lastKey.raw,
2495
+ delimiterToken: nextToken,
2496
+ forceFlag: forceFlag.forceFlagShortNames,
2497
+ forceOption: forceFlag.forceOptionShortNames,
2498
+ getToken,
2499
+ peekToken
2500
+ });
2501
+ const options = [];
2502
+ for (const key2 of keys) {
2503
+ options.push({
2504
+ type: "shortOption",
2505
+ index: key2.index,
2506
+ raw: key2.raw,
2507
+ key: key2.raw
2508
+ });
2509
+ }
2510
+ let lastKeyRaw = lastKey.raw;
2511
+ if (parsedValue) {
2512
+ lastKeyRaw += parsedValue.raw;
2513
+ }
2514
+ options.push({
2515
+ type: "shortOption",
2516
+ index: lastKey.index,
2517
+ raw: lastKeyRaw,
2518
+ value: parsedValue,
2519
+ key: lastKey.raw
2520
+ });
2521
+ let optionsRaw = `-${keys.map((x) => x.raw).join("")}${lastKey.raw}`;
2522
+ if (parsedValue) {
2523
+ optionsRaw += parsedValue.raw;
2524
+ }
2525
+ const shortOptions = {
2526
+ type: "shortOptions",
2527
+ index: currentToken.index,
2528
+ raw: optionsRaw,
2529
+ options
2530
+ };
2531
+ nodes.push(shortOptions);
2532
+ continue;
2533
+ }
2534
+ index++;
2535
+ }
2536
+ if (debug.enabled) {
2537
+ const objectNodes = nodes.map((node) => ({ [node.type]: node.raw }));
2538
+ debug("Parsed items:", JSON.stringify(objectNodes));
2539
+ }
2540
+ return nodes;
2541
+ }
2542
+ function parseOptionValue(opts) {
2543
+ var _a17;
2544
+ const { getToken, delimiterToken, forceFlag, key: key2, forceOption } = opts;
2545
+ const shouldReadKeyAsOption = forceOption.has(key2);
2546
+ const shouldReadKeyAsFlag = !shouldReadKeyAsOption && (forceFlag.has(key2) || ((_a17 = opts.peekToken()) === null || _a17 === void 0 ? void 0 : _a17.type) !== "char");
2547
+ if (!delimiterToken || delimiterToken.raw !== "=" && shouldReadKeyAsFlag) {
2548
+ return;
2549
+ }
2550
+ const delimiter = delimiterToken.raw === "=" ? "=" : " ";
2551
+ const delimiterIndex = delimiterToken.index;
2552
+ let nextToken = getToken();
2553
+ if (!nextToken) {
2554
+ return;
2555
+ }
2556
+ let value = "";
2557
+ const valueIndex = nextToken.index;
2558
+ while (nextToken && (nextToken === null || nextToken === void 0 ? void 0 : nextToken.type) !== "argumentDivider") {
2559
+ value += nextToken.raw;
2560
+ nextToken = getToken();
2561
+ }
2562
+ return {
2563
+ type: "optionValue",
2564
+ index: delimiterToken.index,
2565
+ delimiter: { type: "delimiter", raw: delimiter, index: delimiterIndex },
2566
+ node: { type: "value", raw: value, index: valueIndex },
2567
+ raw: `${delimiter}${value}`
2568
+ };
2569
+ }
2570
+
2571
+ // ../../node_modules/.bun/cmd-ts@0.14.3/node_modules/cmd-ts/dist/esm/newparser/tokenizer.js
2572
+ function tokenize(strings) {
2573
+ const tokens = [];
2574
+ let overallIndex = 0;
2575
+ const push2 = (token2) => {
2576
+ tokens.push(token2);
2577
+ overallIndex += token2.raw.length;
2578
+ };
2579
+ for (const [stringIndex, string5] of enumerate(strings)) {
2580
+ const chars = [...string5];
2581
+ for (let i = 0; i < chars.length; i++) {
2582
+ if (chars[i] === "-" && chars[i + 1] === "-") {
2583
+ push2({ type: "longPrefix", raw: "--", index: overallIndex });
2584
+ i++;
2585
+ } else if (chars[i] === "-") {
2586
+ push2({ type: "shortPrefix", raw: "-", index: overallIndex });
2587
+ } else {
2588
+ push2({ type: "char", raw: chars[i], index: overallIndex });
2589
+ }
2590
+ }
2591
+ if (stringIndex + 1 !== strings.length) {
2592
+ push2({ type: "argumentDivider", raw: " ", index: overallIndex });
2593
+ }
2594
+ }
2595
+ return tokens;
2596
+ }
2597
+
2598
+ // ../../node_modules/.bun/cmd-ts@0.14.3/node_modules/cmd-ts/dist/esm/runner.js
2599
+ async function run(ap, strings) {
2600
+ const result = await runSafely(ap, strings);
2601
+ if (isErr(result)) {
2602
+ return result.error.run();
2603
+ }
2604
+ return result.value;
2605
+ }
2606
+ async function runSafely(ap, strings) {
2607
+ const hotPath = [];
2608
+ const nodes = parseCommon(ap, strings);
2609
+ try {
2610
+ const result = await ap.run({ nodes, visitedNodes: /* @__PURE__ */ new Set(), hotPath });
2611
+ if (isErr(result)) {
2612
+ throw new Exit({
2613
+ message: errorBox(nodes, result.error.errors, hotPath),
2614
+ exitCode: 1,
2615
+ into: "stderr"
2616
+ });
2617
+ }
2618
+ return ok(result.value);
2619
+ } catch (e) {
2620
+ if (e instanceof Exit) {
2621
+ return err(e);
2622
+ }
2623
+ throw e;
2624
+ }
2625
+ }
2626
+ function parseCommon(ap, strings) {
2627
+ const longFlagKeys = /* @__PURE__ */ new Set();
2628
+ const shortFlagKeys = /* @__PURE__ */ new Set();
2629
+ const longOptionKeys = /* @__PURE__ */ new Set();
2630
+ const shortOptionKeys = /* @__PURE__ */ new Set();
2631
+ const registerContext = {
2632
+ forceFlagShortNames: shortFlagKeys,
2633
+ forceFlagLongNames: longFlagKeys,
2634
+ forceOptionShortNames: shortOptionKeys,
2635
+ forceOptionLongNames: longOptionKeys
2636
+ };
2637
+ ap.register(registerContext);
2638
+ const tokens = tokenize(strings);
2639
+ return parse(tokens, registerContext);
2640
+ }
2641
+
2642
+ // ../../node_modules/.bun/cmd-ts@0.14.3/node_modules/cmd-ts/dist/esm/restPositionals.js
2643
+ function fullRestPositionals(config2) {
2644
+ return {
2645
+ helpTopics() {
2646
+ var _a17, _b8, _c, _d;
2647
+ const displayName = (_b8 = (_a17 = config2.displayName) !== null && _a17 !== void 0 ? _a17 : config2.type.displayName) !== null && _b8 !== void 0 ? _b8 : "arg";
2648
+ return [
2649
+ {
2650
+ usage: `[...${displayName}]`,
2651
+ category: "arguments",
2652
+ defaults: [],
2653
+ description: (_d = (_c = config2.description) !== null && _c !== void 0 ? _c : config2.type.description) !== null && _d !== void 0 ? _d : ""
2654
+ }
2655
+ ];
2656
+ },
2657
+ register(_opts) {
2658
+ },
2659
+ async parse({ nodes, visitedNodes }) {
2660
+ const positionals = nodes.filter((node) => node.type === "positionalArgument" && !visitedNodes.has(node));
2661
+ const results = [];
2662
+ const errors = [];
2663
+ for (const positional3 of positionals) {
2664
+ visitedNodes.add(positional3);
2665
+ const decoded = await safeAsync(config2.type.from(positional3.raw));
2666
+ if (isOk(decoded)) {
2667
+ results.push(decoded.value);
2668
+ } else {
2669
+ errors.push({
2670
+ nodes: [positional3],
2671
+ message: decoded.error.message
2672
+ });
2673
+ }
2674
+ }
2675
+ if (errors.length > 0) {
2676
+ return err({
2677
+ errors
2678
+ });
2679
+ }
2680
+ return ok(results);
2681
+ }
2682
+ };
2683
+ }
2684
+ function restPositionals(config2) {
2685
+ return fullRestPositionals({
2686
+ type: string,
2687
+ ...config2
2688
+ });
2689
+ }
2690
+
2691
+ // ../../node_modules/.bun/cmd-ts@0.14.3/node_modules/cmd-ts/dist/esm/oneOf.js
2692
+ import { inspect } from "node:util";
2693
+ function oneOf(literals) {
2694
+ const examples = literals.map((x) => inspect(x)).join(", ");
2695
+ return {
2696
+ async from(str) {
2697
+ const value = literals.find((x) => x === str);
2698
+ if (!value) {
2699
+ throw new Error(`Invalid value '${str}'. Expected one of: ${examples}`);
2700
+ }
2701
+ return value;
2702
+ },
2703
+ description: `One of ${examples}`
2704
+ };
2705
+ }
146
2706
 
147
2707
  // src/commands/compare/index.ts
148
2708
  import { readFileSync } from "node:fs";
149
- import { command, flag, number, oneOf, option, optional, positional, string } from "cmd-ts";
150
2709
 
151
2710
  // src/utils/case-conversion.ts
152
2711
  function toSnakeCase(str) {
@@ -264,15 +2823,15 @@ function formatOutcome(outcome) {
264
2823
  }
265
2824
  }
266
2825
  var ansiPattern = new RegExp(`${String.fromCharCode(27)}\\[[0-9;]*m`, "g");
267
- function stripAnsi(str) {
2826
+ function stripAnsi2(str) {
268
2827
  return str.replace(ansiPattern, "");
269
2828
  }
270
2829
  function padRight(str, len) {
271
- const plainLen = stripAnsi(str).length;
2830
+ const plainLen = stripAnsi2(str).length;
272
2831
  return str + " ".repeat(Math.max(0, len - plainLen));
273
2832
  }
274
2833
  function padLeft(str, len) {
275
- const plainLen = stripAnsi(str).length;
2834
+ const plainLen = stripAnsi2(str).length;
276
2835
  return " ".repeat(Math.max(0, len - plainLen)) + str;
277
2836
  }
278
2837
  function formatTable(comparison, file1, file2) {
@@ -1119,8 +3678,8 @@ var ZodType = class {
1119
3678
  } : {
1120
3679
  issues: ctx.common.issues
1121
3680
  };
1122
- } catch (err) {
1123
- if (err?.message?.toLowerCase()?.includes("encountered")) {
3681
+ } catch (err2) {
3682
+ if (err2?.message?.toLowerCase()?.includes("encountered")) {
1124
3683
  this["~standard"].async = true;
1125
3684
  }
1126
3685
  ctx.common = {
@@ -1260,8 +3819,8 @@ var ZodType = class {
1260
3819
  promise() {
1261
3820
  return ZodPromise.create(this, this._def);
1262
3821
  }
1263
- or(option6) {
1264
- return ZodUnion.create([this, option6], this._def);
3822
+ or(option2) {
3823
+ return ZodUnion.create([this, option2], this._def);
1265
3824
  }
1266
3825
  and(incoming) {
1267
3826
  return ZodIntersection.create(this, incoming, this._def);
@@ -1351,13 +3910,13 @@ function timeRegex(args) {
1351
3910
  return new RegExp(`^${timeRegexSource(args)}$`);
1352
3911
  }
1353
3912
  function datetimeRegex(args) {
1354
- let regex = `${dateRegexSource}T${timeRegexSource(args)}`;
3913
+ let regex2 = `${dateRegexSource}T${timeRegexSource(args)}`;
1355
3914
  const opts = [];
1356
3915
  opts.push(args.local ? `Z?` : `Z`);
1357
3916
  if (args.offset)
1358
3917
  opts.push(`([+-]\\d{2}:?\\d{2})`);
1359
- regex = `${regex}(${opts.join("|")})`;
1360
- return new RegExp(`^${regex}$`);
3918
+ regex2 = `${regex2}(${opts.join("|")})`;
3919
+ return new RegExp(`^${regex2}$`);
1361
3920
  }
1362
3921
  function isValidIP(ip, version2) {
1363
3922
  if ((version2 === "v4" || !version2) && ipv4Regex.test(ip)) {
@@ -1603,8 +4162,8 @@ var ZodString = class _ZodString2 extends ZodType {
1603
4162
  status.dirty();
1604
4163
  }
1605
4164
  } else if (check2.kind === "datetime") {
1606
- const regex = datetimeRegex(check2);
1607
- if (!regex.test(input.data)) {
4165
+ const regex2 = datetimeRegex(check2);
4166
+ if (!regex2.test(input.data)) {
1608
4167
  ctx = this._getOrReturnCtx(input, ctx);
1609
4168
  addIssueToContext(ctx, {
1610
4169
  code: ZodIssueCode.invalid_string,
@@ -1614,8 +4173,8 @@ var ZodString = class _ZodString2 extends ZodType {
1614
4173
  status.dirty();
1615
4174
  }
1616
4175
  } else if (check2.kind === "date") {
1617
- const regex = dateRegex;
1618
- if (!regex.test(input.data)) {
4176
+ const regex2 = dateRegex;
4177
+ if (!regex2.test(input.data)) {
1619
4178
  ctx = this._getOrReturnCtx(input, ctx);
1620
4179
  addIssueToContext(ctx, {
1621
4180
  code: ZodIssueCode.invalid_string,
@@ -1625,8 +4184,8 @@ var ZodString = class _ZodString2 extends ZodType {
1625
4184
  status.dirty();
1626
4185
  }
1627
4186
  } else if (check2.kind === "time") {
1628
- const regex = timeRegex(check2);
1629
- if (!regex.test(input.data)) {
4187
+ const regex2 = timeRegex(check2);
4188
+ if (!regex2.test(input.data)) {
1630
4189
  ctx = this._getOrReturnCtx(input, ctx);
1631
4190
  addIssueToContext(ctx, {
1632
4191
  code: ZodIssueCode.invalid_string,
@@ -1701,8 +4260,8 @@ var ZodString = class _ZodString2 extends ZodType {
1701
4260
  }
1702
4261
  return { status: status.value, value: input.data };
1703
4262
  }
1704
- _regex(regex, validation, message) {
1705
- return this.refinement((data) => regex.test(data), {
4263
+ _regex(regex2, validation, message) {
4264
+ return this.refinement((data) => regex2.test(data), {
1706
4265
  validation,
1707
4266
  code: ZodIssueCode.invalid_string,
1708
4267
  ...errorUtil.errToObj(message)
@@ -1794,10 +4353,10 @@ var ZodString = class _ZodString2 extends ZodType {
1794
4353
  duration(message) {
1795
4354
  return this._addCheck({ kind: "duration", ...errorUtil.errToObj(message) });
1796
4355
  }
1797
- regex(regex, message) {
4356
+ regex(regex2, message) {
1798
4357
  return this._addCheck({
1799
4358
  kind: "regex",
1800
- regex,
4359
+ regex: regex2,
1801
4360
  ...errorUtil.errToObj(message)
1802
4361
  });
1803
4362
  }
@@ -3111,7 +5670,7 @@ var ZodUnion = class extends ZodType {
3111
5670
  return INVALID;
3112
5671
  }
3113
5672
  if (ctx.common.async) {
3114
- return Promise.all(options.map(async (option6) => {
5673
+ return Promise.all(options.map(async (option2) => {
3115
5674
  const childCtx = {
3116
5675
  ...ctx,
3117
5676
  common: {
@@ -3121,7 +5680,7 @@ var ZodUnion = class extends ZodType {
3121
5680
  parent: null
3122
5681
  };
3123
5682
  return {
3124
- result: await option6._parseAsync({
5683
+ result: await option2._parseAsync({
3125
5684
  data: ctx.data,
3126
5685
  path: ctx.path,
3127
5686
  parent: childCtx
@@ -3132,7 +5691,7 @@ var ZodUnion = class extends ZodType {
3132
5691
  } else {
3133
5692
  let dirty = void 0;
3134
5693
  const issues = [];
3135
- for (const option6 of options) {
5694
+ for (const option2 of options) {
3136
5695
  const childCtx = {
3137
5696
  ...ctx,
3138
5697
  common: {
@@ -3141,7 +5700,7 @@ var ZodUnion = class extends ZodType {
3141
5700
  },
3142
5701
  parent: null
3143
5702
  };
3144
- const result = option6._parseSync({
5703
+ const result = option2._parseSync({
3145
5704
  data: ctx.data,
3146
5705
  path: ctx.path,
3147
5706
  parent: childCtx
@@ -3222,8 +5781,8 @@ var ZodDiscriminatedUnion = class _ZodDiscriminatedUnion extends ZodType {
3222
5781
  }
3223
5782
  const discriminator = this.discriminator;
3224
5783
  const discriminatorValue = ctx.data[discriminator];
3225
- const option6 = this.optionsMap.get(discriminatorValue);
3226
- if (!option6) {
5784
+ const option2 = this.optionsMap.get(discriminatorValue);
5785
+ if (!option2) {
3227
5786
  addIssueToContext(ctx, {
3228
5787
  code: ZodIssueCode.invalid_union_discriminator,
3229
5788
  options: Array.from(this.optionsMap.keys()),
@@ -3232,13 +5791,13 @@ var ZodDiscriminatedUnion = class _ZodDiscriminatedUnion extends ZodType {
3232
5791
  return INVALID;
3233
5792
  }
3234
5793
  if (ctx.common.async) {
3235
- return option6._parseAsync({
5794
+ return option2._parseAsync({
3236
5795
  data: ctx.data,
3237
5796
  path: ctx.path,
3238
5797
  parent: ctx
3239
5798
  });
3240
5799
  } else {
3241
- return option6._parseSync({
5800
+ return option2._parseSync({
3242
5801
  data: ctx.data,
3243
5802
  path: ctx.path,
3244
5803
  parent: ctx
@@ -4606,11 +7165,11 @@ var CliTargetConfigSchema = external_exports.object({
4606
7165
  verbose: external_exports.boolean().optional(),
4607
7166
  keepTempFiles: external_exports.boolean().optional()
4608
7167
  }).strict();
4609
- function normalizeCliHealthcheck(input, env, targetName, evalFilePath) {
7168
+ function normalizeCliHealthcheck(input, env2, targetName, evalFilePath) {
4610
7169
  const timeoutSeconds = input.timeout_seconds ?? input.timeoutSeconds;
4611
7170
  const timeoutMs = timeoutSeconds !== void 0 ? Math.floor(timeoutSeconds * 1e3) : void 0;
4612
7171
  if (input.type === "http") {
4613
- const url2 = resolveString(input.url, env, `${targetName} healthcheck URL`);
7172
+ const url2 = resolveString(input.url, env2, `${targetName} healthcheck URL`);
4614
7173
  return {
4615
7174
  type: "http",
4616
7175
  url: url2,
@@ -4625,11 +7184,11 @@ function normalizeCliHealthcheck(input, env, targetName, evalFilePath) {
4625
7184
  }
4626
7185
  const commandTemplate = resolveString(
4627
7186
  commandTemplateSource,
4628
- env,
7187
+ env2,
4629
7188
  `${targetName} healthcheck command template`,
4630
7189
  true
4631
7190
  );
4632
- let cwd = resolveOptionalString(input.cwd, env, `${targetName} healthcheck cwd`, {
7191
+ let cwd = resolveOptionalString(input.cwd, env2, `${targetName} healthcheck cwd`, {
4633
7192
  allowLiteral: true,
4634
7193
  optionalEnv: true
4635
7194
  });
@@ -4646,7 +7205,7 @@ function normalizeCliHealthcheck(input, env, targetName, evalFilePath) {
4646
7205
  timeoutMs
4647
7206
  };
4648
7207
  }
4649
- function normalizeCliTargetInput(input, env, evalFilePath) {
7208
+ function normalizeCliTargetInput(input, env2, evalFilePath) {
4650
7209
  const targetName = input.name;
4651
7210
  const commandTemplateSource = input.command_template ?? input.commandTemplate;
4652
7211
  if (commandTemplateSource === void 0) {
@@ -4654,13 +7213,13 @@ function normalizeCliTargetInput(input, env, evalFilePath) {
4654
7213
  }
4655
7214
  const commandTemplate = resolveString(
4656
7215
  commandTemplateSource,
4657
- env,
7216
+ env2,
4658
7217
  `${targetName} CLI command template`,
4659
7218
  true
4660
7219
  );
4661
7220
  const filesFormatSource = input.files_format ?? input.filesFormat ?? input.attachments_format ?? input.attachmentsFormat;
4662
7221
  const filesFormat = resolveOptionalLiteralString(filesFormatSource);
4663
- let cwd = resolveOptionalString(input.cwd, env, `${targetName} working directory`, {
7222
+ let cwd = resolveOptionalString(input.cwd, env2, `${targetName} working directory`, {
4664
7223
  allowLiteral: true,
4665
7224
  optionalEnv: true
4666
7225
  });
@@ -4676,7 +7235,7 @@ function normalizeCliTargetInput(input, env, evalFilePath) {
4676
7235
  const keepTempFiles = resolveOptionalBoolean(
4677
7236
  input.keep_temp_files ?? input.keepTempFiles ?? input.keep_output_files ?? input.keepOutputFiles
4678
7237
  );
4679
- const healthcheck = input.healthcheck ? normalizeCliHealthcheck(input.healthcheck, env, targetName, evalFilePath) : void 0;
7238
+ const healthcheck = input.healthcheck ? normalizeCliHealthcheck(input.healthcheck, env2, targetName, evalFilePath) : void 0;
4680
7239
  return {
4681
7240
  commandTemplate,
4682
7241
  filesFormat,
@@ -4745,7 +7304,7 @@ function resolveRetryConfig(target) {
4745
7304
  retryableStatusCodes
4746
7305
  };
4747
7306
  }
4748
- function resolveTargetDefinition(definition, env = process.env, evalFilePath) {
7307
+ function resolveTargetDefinition(definition, env2 = process.env, evalFilePath) {
4749
7308
  const parsed = BASE_TARGET_SCHEMA.parse(definition);
4750
7309
  const provider = parsed.provider.toLowerCase();
4751
7310
  const providerBatching = resolveOptionalBoolean(
@@ -4760,7 +7319,7 @@ function resolveTargetDefinition(definition, env = process.env, evalFilePath) {
4760
7319
  judgeTarget: parsed.judge_target,
4761
7320
  workers: parsed.workers,
4762
7321
  providerBatching,
4763
- config: resolveAzureConfig(parsed, env)
7322
+ config: resolveAzureConfig(parsed, env2)
4764
7323
  };
4765
7324
  case "anthropic":
4766
7325
  return {
@@ -4769,7 +7328,7 @@ function resolveTargetDefinition(definition, env = process.env, evalFilePath) {
4769
7328
  judgeTarget: parsed.judge_target,
4770
7329
  workers: parsed.workers,
4771
7330
  providerBatching,
4772
- config: resolveAnthropicConfig(parsed, env)
7331
+ config: resolveAnthropicConfig(parsed, env2)
4773
7332
  };
4774
7333
  case "gemini":
4775
7334
  case "google":
@@ -4780,7 +7339,7 @@ function resolveTargetDefinition(definition, env = process.env, evalFilePath) {
4780
7339
  judgeTarget: parsed.judge_target,
4781
7340
  workers: parsed.workers,
4782
7341
  providerBatching,
4783
- config: resolveGeminiConfig(parsed, env)
7342
+ config: resolveGeminiConfig(parsed, env2)
4784
7343
  };
4785
7344
  case "codex":
4786
7345
  case "codex-cli":
@@ -4790,7 +7349,7 @@ function resolveTargetDefinition(definition, env = process.env, evalFilePath) {
4790
7349
  judgeTarget: parsed.judge_target,
4791
7350
  workers: parsed.workers,
4792
7351
  providerBatching,
4793
- config: resolveCodexConfig(parsed, env)
7352
+ config: resolveCodexConfig(parsed, env2)
4794
7353
  };
4795
7354
  case "pi":
4796
7355
  case "pi-coding-agent":
@@ -4800,7 +7359,7 @@ function resolveTargetDefinition(definition, env = process.env, evalFilePath) {
4800
7359
  judgeTarget: parsed.judge_target,
4801
7360
  workers: parsed.workers,
4802
7361
  providerBatching,
4803
- config: resolvePiCodingAgentConfig(parsed, env)
7362
+ config: resolvePiCodingAgentConfig(parsed, env2)
4804
7363
  };
4805
7364
  case "pi-agent-sdk":
4806
7365
  return {
@@ -4809,7 +7368,7 @@ function resolveTargetDefinition(definition, env = process.env, evalFilePath) {
4809
7368
  judgeTarget: parsed.judge_target,
4810
7369
  workers: parsed.workers,
4811
7370
  providerBatching,
4812
- config: resolvePiAgentSdkConfig(parsed, env)
7371
+ config: resolvePiAgentSdkConfig(parsed, env2)
4813
7372
  };
4814
7373
  case "claude-code":
4815
7374
  return {
@@ -4818,7 +7377,7 @@ function resolveTargetDefinition(definition, env = process.env, evalFilePath) {
4818
7377
  judgeTarget: parsed.judge_target,
4819
7378
  workers: parsed.workers,
4820
7379
  providerBatching,
4821
- config: resolveClaudeCodeConfig(parsed, env)
7380
+ config: resolveClaudeCodeConfig(parsed, env2)
4822
7381
  };
4823
7382
  case "mock":
4824
7383
  return {
@@ -4837,7 +7396,7 @@ function resolveTargetDefinition(definition, env = process.env, evalFilePath) {
4837
7396
  judgeTarget: parsed.judge_target,
4838
7397
  workers: parsed.workers,
4839
7398
  providerBatching,
4840
- config: resolveVSCodeConfig(parsed, env, provider === "vscode-insiders")
7399
+ config: resolveVSCodeConfig(parsed, env2, provider === "vscode-insiders")
4841
7400
  };
4842
7401
  case "cli":
4843
7402
  return {
@@ -4846,24 +7405,24 @@ function resolveTargetDefinition(definition, env = process.env, evalFilePath) {
4846
7405
  judgeTarget: parsed.judge_target,
4847
7406
  workers: parsed.workers,
4848
7407
  providerBatching,
4849
- config: resolveCliConfig(parsed, env, evalFilePath)
7408
+ config: resolveCliConfig(parsed, env2, evalFilePath)
4850
7409
  };
4851
7410
  default:
4852
7411
  throw new Error(`Unsupported provider '${parsed.provider}' in target '${parsed.name}'`);
4853
7412
  }
4854
7413
  }
4855
- function resolveAzureConfig(target, env) {
7414
+ function resolveAzureConfig(target, env2) {
4856
7415
  const endpointSource = target.endpoint ?? target.resource ?? target.resourceName;
4857
7416
  const apiKeySource = target.api_key ?? target.apiKey;
4858
7417
  const deploymentSource = target.deployment ?? target.deploymentName ?? target.model;
4859
7418
  const versionSource = target.version ?? target.api_version;
4860
7419
  const temperatureSource = target.temperature;
4861
7420
  const maxTokensSource = target.max_output_tokens ?? target.maxTokens;
4862
- const resourceName = resolveString(endpointSource, env, `${target.name} endpoint`);
4863
- const apiKey = resolveString(apiKeySource, env, `${target.name} api key`);
4864
- const deploymentName = resolveString(deploymentSource, env, `${target.name} deployment`);
7421
+ const resourceName = resolveString(endpointSource, env2, `${target.name} endpoint`);
7422
+ const apiKey = resolveString(apiKeySource, env2, `${target.name} api key`);
7423
+ const deploymentName = resolveString(deploymentSource, env2, `${target.name} deployment`);
4865
7424
  const version2 = normalizeAzureApiVersion(
4866
- resolveOptionalString(versionSource, env, `${target.name} api version`, {
7425
+ resolveOptionalString(versionSource, env2, `${target.name} api version`, {
4867
7426
  allowLiteral: true,
4868
7427
  optionalEnv: true
4869
7428
  })
@@ -4884,14 +7443,14 @@ function resolveAzureConfig(target, env) {
4884
7443
  retry
4885
7444
  };
4886
7445
  }
4887
- function resolveAnthropicConfig(target, env) {
7446
+ function resolveAnthropicConfig(target, env2) {
4888
7447
  const apiKeySource = target.api_key ?? target.apiKey;
4889
7448
  const modelSource = target.model ?? target.deployment ?? target.variant;
4890
7449
  const temperatureSource = target.temperature;
4891
7450
  const maxTokensSource = target.max_output_tokens ?? target.maxTokens;
4892
7451
  const thinkingBudgetSource = target.thinking_budget ?? target.thinkingBudget;
4893
- const apiKey = resolveString(apiKeySource, env, `${target.name} Anthropic api key`);
4894
- const model = resolveString(modelSource, env, `${target.name} Anthropic model`);
7452
+ const apiKey = resolveString(apiKeySource, env2, `${target.name} Anthropic api key`);
7453
+ const model = resolveString(modelSource, env2, `${target.name} Anthropic model`);
4895
7454
  const retry = resolveRetryConfig(target);
4896
7455
  return {
4897
7456
  apiKey,
@@ -4902,13 +7461,13 @@ function resolveAnthropicConfig(target, env) {
4902
7461
  retry
4903
7462
  };
4904
7463
  }
4905
- function resolveGeminiConfig(target, env) {
7464
+ function resolveGeminiConfig(target, env2) {
4906
7465
  const apiKeySource = target.api_key ?? target.apiKey;
4907
7466
  const modelSource = target.model ?? target.deployment ?? target.variant;
4908
7467
  const temperatureSource = target.temperature;
4909
7468
  const maxTokensSource = target.max_output_tokens ?? target.maxTokens;
4910
- const apiKey = resolveString(apiKeySource, env, `${target.name} Google API key`);
4911
- const model = resolveOptionalString(modelSource, env, `${target.name} Gemini model`, {
7469
+ const apiKey = resolveString(apiKeySource, env2, `${target.name} Google API key`);
7470
+ const model = resolveOptionalString(modelSource, env2, `${target.name} Gemini model`, {
4912
7471
  allowLiteral: true,
4913
7472
  optionalEnv: true
4914
7473
  }) ?? "gemini-2.5-flash";
@@ -4921,25 +7480,25 @@ function resolveGeminiConfig(target, env) {
4921
7480
  retry
4922
7481
  };
4923
7482
  }
4924
- function resolveCodexConfig(target, env) {
7483
+ function resolveCodexConfig(target, env2) {
4925
7484
  const executableSource = target.executable ?? target.command ?? target.binary;
4926
7485
  const argsSource = target.args ?? target.arguments;
4927
7486
  const cwdSource = target.cwd;
4928
7487
  const timeoutSource = target.timeout_seconds ?? target.timeoutSeconds;
4929
7488
  const logDirSource = target.log_dir ?? target.logDir ?? target.log_directory ?? target.logDirectory;
4930
- const logFormatSource = target.log_format ?? target.logFormat ?? target.log_output_format ?? target.logOutputFormat ?? env.AGENTV_CODEX_LOG_FORMAT;
7489
+ const logFormatSource = target.log_format ?? target.logFormat ?? target.log_output_format ?? target.logOutputFormat ?? env2.AGENTV_CODEX_LOG_FORMAT;
4931
7490
  const systemPromptSource = target.system_prompt ?? target.systemPrompt;
4932
- const executable = resolveOptionalString(executableSource, env, `${target.name} codex executable`, {
7491
+ const executable = resolveOptionalString(executableSource, env2, `${target.name} codex executable`, {
4933
7492
  allowLiteral: true,
4934
7493
  optionalEnv: true
4935
7494
  }) ?? "codex";
4936
- const args = resolveOptionalStringArray(argsSource, env, `${target.name} codex args`);
4937
- const cwd = resolveOptionalString(cwdSource, env, `${target.name} codex cwd`, {
7495
+ const args = resolveOptionalStringArray(argsSource, env2, `${target.name} codex args`);
7496
+ const cwd = resolveOptionalString(cwdSource, env2, `${target.name} codex cwd`, {
4938
7497
  allowLiteral: true,
4939
7498
  optionalEnv: true
4940
7499
  });
4941
7500
  const timeoutMs = resolveTimeoutMs(timeoutSource, `${target.name} codex timeout`);
4942
- const logDir = resolveOptionalString(logDirSource, env, `${target.name} codex log directory`, {
7501
+ const logDir = resolveOptionalString(logDirSource, env2, `${target.name} codex log directory`, {
4943
7502
  allowLiteral: true,
4944
7503
  optionalEnv: true
4945
7504
  });
@@ -4968,7 +7527,7 @@ function normalizeCodexLogFormat(value) {
4968
7527
  }
4969
7528
  throw new Error("codex log format must be 'summary' or 'json'");
4970
7529
  }
4971
- function resolvePiCodingAgentConfig(target, env) {
7530
+ function resolvePiCodingAgentConfig(target, env2) {
4972
7531
  const executableSource = target.executable ?? target.command ?? target.binary;
4973
7532
  const providerSource = target.pi_provider ?? target.piProvider ?? target.llm_provider;
4974
7533
  const modelSource = target.model ?? target.pi_model ?? target.piModel;
@@ -4981,37 +7540,37 @@ function resolvePiCodingAgentConfig(target, env) {
4981
7540
  const logDirSource = target.log_dir ?? target.logDir ?? target.log_directory ?? target.logDirectory;
4982
7541
  const logFormatSource = target.log_format ?? target.logFormat;
4983
7542
  const systemPromptSource = target.system_prompt ?? target.systemPrompt;
4984
- const executable = resolveOptionalString(executableSource, env, `${target.name} pi executable`, {
7543
+ const executable = resolveOptionalString(executableSource, env2, `${target.name} pi executable`, {
4985
7544
  allowLiteral: true,
4986
7545
  optionalEnv: true
4987
7546
  }) ?? "pi";
4988
- const provider = resolveOptionalString(providerSource, env, `${target.name} pi provider`, {
7547
+ const provider = resolveOptionalString(providerSource, env2, `${target.name} pi provider`, {
4989
7548
  allowLiteral: true,
4990
7549
  optionalEnv: true
4991
7550
  });
4992
- const model = resolveOptionalString(modelSource, env, `${target.name} pi model`, {
7551
+ const model = resolveOptionalString(modelSource, env2, `${target.name} pi model`, {
4993
7552
  allowLiteral: true,
4994
7553
  optionalEnv: true
4995
7554
  });
4996
- const apiKey = resolveOptionalString(apiKeySource, env, `${target.name} pi api key`, {
7555
+ const apiKey = resolveOptionalString(apiKeySource, env2, `${target.name} pi api key`, {
4997
7556
  allowLiteral: false,
4998
7557
  optionalEnv: true
4999
7558
  });
5000
- const tools = resolveOptionalString(toolsSource, env, `${target.name} pi tools`, {
7559
+ const tools = resolveOptionalString(toolsSource, env2, `${target.name} pi tools`, {
5001
7560
  allowLiteral: true,
5002
7561
  optionalEnv: true
5003
7562
  });
5004
- const thinking = resolveOptionalString(thinkingSource, env, `${target.name} pi thinking`, {
7563
+ const thinking = resolveOptionalString(thinkingSource, env2, `${target.name} pi thinking`, {
5005
7564
  allowLiteral: true,
5006
7565
  optionalEnv: true
5007
7566
  });
5008
- const args = resolveOptionalStringArray(argsSource, env, `${target.name} pi args`);
5009
- const cwd = resolveOptionalString(cwdSource, env, `${target.name} pi cwd`, {
7567
+ const args = resolveOptionalStringArray(argsSource, env2, `${target.name} pi args`);
7568
+ const cwd = resolveOptionalString(cwdSource, env2, `${target.name} pi cwd`, {
5010
7569
  allowLiteral: true,
5011
7570
  optionalEnv: true
5012
7571
  });
5013
7572
  const timeoutMs = resolveTimeoutMs(timeoutSource, `${target.name} pi timeout`);
5014
- const logDir = resolveOptionalString(logDirSource, env, `${target.name} pi log directory`, {
7573
+ const logDir = resolveOptionalString(logDirSource, env2, `${target.name} pi log directory`, {
5015
7574
  allowLiteral: true,
5016
7575
  optionalEnv: true
5017
7576
  });
@@ -5032,7 +7591,7 @@ function resolvePiCodingAgentConfig(target, env) {
5032
7591
  systemPrompt
5033
7592
  };
5034
7593
  }
5035
- function resolvePiAgentSdkConfig(target, env) {
7594
+ function resolvePiAgentSdkConfig(target, env2) {
5036
7595
  const providerSource = target.pi_provider ?? target.piProvider ?? target.llm_provider;
5037
7596
  const modelSource = target.model ?? target.pi_model ?? target.piModel;
5038
7597
  const apiKeySource = target.api_key ?? target.apiKey;
@@ -5040,18 +7599,18 @@ function resolvePiAgentSdkConfig(target, env) {
5040
7599
  const systemPromptSource = target.system_prompt ?? target.systemPrompt;
5041
7600
  const provider = resolveOptionalString(
5042
7601
  providerSource,
5043
- env,
7602
+ env2,
5044
7603
  `${target.name} pi-agent-sdk provider`,
5045
7604
  {
5046
7605
  allowLiteral: true,
5047
7606
  optionalEnv: true
5048
7607
  }
5049
7608
  );
5050
- const model = resolveOptionalString(modelSource, env, `${target.name} pi-agent-sdk model`, {
7609
+ const model = resolveOptionalString(modelSource, env2, `${target.name} pi-agent-sdk model`, {
5051
7610
  allowLiteral: true,
5052
7611
  optionalEnv: true
5053
7612
  });
5054
- const apiKey = resolveOptionalString(apiKeySource, env, `${target.name} pi-agent-sdk api key`, {
7613
+ const apiKey = resolveOptionalString(apiKeySource, env2, `${target.name} pi-agent-sdk api key`, {
5055
7614
  allowLiteral: false,
5056
7615
  optionalEnv: true
5057
7616
  });
@@ -5065,32 +7624,32 @@ function resolvePiAgentSdkConfig(target, env) {
5065
7624
  systemPrompt
5066
7625
  };
5067
7626
  }
5068
- function resolveClaudeCodeConfig(target, env) {
7627
+ function resolveClaudeCodeConfig(target, env2) {
5069
7628
  const executableSource = target.executable ?? target.command ?? target.binary;
5070
7629
  const modelSource = target.model;
5071
7630
  const argsSource = target.args ?? target.arguments;
5072
7631
  const cwdSource = target.cwd;
5073
7632
  const timeoutSource = target.timeout_seconds ?? target.timeoutSeconds;
5074
7633
  const logDirSource = target.log_dir ?? target.logDir ?? target.log_directory ?? target.logDirectory;
5075
- const logFormatSource = target.log_format ?? target.logFormat ?? target.log_output_format ?? target.logOutputFormat ?? env.AGENTV_CLAUDE_CODE_LOG_FORMAT;
7634
+ const logFormatSource = target.log_format ?? target.logFormat ?? target.log_output_format ?? target.logOutputFormat ?? env2.AGENTV_CLAUDE_CODE_LOG_FORMAT;
5076
7635
  const systemPromptSource = target.system_prompt ?? target.systemPrompt;
5077
- const executable = resolveOptionalString(executableSource, env, `${target.name} claude-code executable`, {
7636
+ const executable = resolveOptionalString(executableSource, env2, `${target.name} claude-code executable`, {
5078
7637
  allowLiteral: true,
5079
7638
  optionalEnv: true
5080
7639
  }) ?? "claude";
5081
- const model = resolveOptionalString(modelSource, env, `${target.name} claude-code model`, {
7640
+ const model = resolveOptionalString(modelSource, env2, `${target.name} claude-code model`, {
5082
7641
  allowLiteral: true,
5083
7642
  optionalEnv: true
5084
7643
  });
5085
- const args = resolveOptionalStringArray(argsSource, env, `${target.name} claude-code args`);
5086
- const cwd = resolveOptionalString(cwdSource, env, `${target.name} claude-code cwd`, {
7644
+ const args = resolveOptionalStringArray(argsSource, env2, `${target.name} claude-code args`);
7645
+ const cwd = resolveOptionalString(cwdSource, env2, `${target.name} claude-code cwd`, {
5087
7646
  allowLiteral: true,
5088
7647
  optionalEnv: true
5089
7648
  });
5090
7649
  const timeoutMs = resolveTimeoutMs(timeoutSource, `${target.name} claude-code timeout`);
5091
7650
  const logDir = resolveOptionalString(
5092
7651
  logDirSource,
5093
- env,
7652
+ env2,
5094
7653
  `${target.name} claude-code log directory`,
5095
7654
  {
5096
7655
  allowLiteral: true,
@@ -5127,13 +7686,13 @@ function resolveMockConfig(target) {
5127
7686
  const response = typeof target.response === "string" ? target.response : void 0;
5128
7687
  return { response };
5129
7688
  }
5130
- function resolveVSCodeConfig(target, env, insiders) {
7689
+ function resolveVSCodeConfig(target, env2, insiders) {
5131
7690
  const workspaceTemplateEnvVar = resolveOptionalLiteralString(
5132
7691
  target.workspace_template ?? target.workspaceTemplate
5133
7692
  );
5134
7693
  const workspaceTemplate = workspaceTemplateEnvVar ? resolveOptionalString(
5135
7694
  workspaceTemplateEnvVar,
5136
- env,
7695
+ env2,
5137
7696
  `${target.name} workspace template path`,
5138
7697
  {
5139
7698
  allowLiteral: false,
@@ -5145,12 +7704,12 @@ function resolveVSCodeConfig(target, env, insiders) {
5145
7704
  const dryRunSource = target.dry_run ?? target.dryRun;
5146
7705
  const subagentRootSource = target.subagent_root ?? target.subagentRoot;
5147
7706
  const defaultCommand = insiders ? "code-insiders" : "code";
5148
- const command7 = resolveOptionalLiteralString(commandSource) ?? defaultCommand;
7707
+ const command2 = resolveOptionalLiteralString(commandSource) ?? defaultCommand;
5149
7708
  return {
5150
- command: command7,
7709
+ command: command2,
5151
7710
  waitForResponse: resolveOptionalBoolean(waitSource) ?? true,
5152
7711
  dryRun: resolveOptionalBoolean(dryRunSource) ?? false,
5153
- subagentRoot: resolveOptionalString(subagentRootSource, env, `${target.name} subagent root`, {
7712
+ subagentRoot: resolveOptionalString(subagentRootSource, env2, `${target.name} subagent root`, {
5154
7713
  allowLiteral: true,
5155
7714
  optionalEnv: true
5156
7715
  }),
@@ -5169,7 +7728,7 @@ var cliErrorMap = (issue2, ctx) => {
5169
7728
  }
5170
7729
  return { message: ctx.defaultError };
5171
7730
  };
5172
- function resolveCliConfig(target, env, evalFilePath) {
7731
+ function resolveCliConfig(target, env2, evalFilePath) {
5173
7732
  const parseResult = CliTargetInputSchema.safeParse(target, { errorMap: cliErrorMap });
5174
7733
  if (!parseResult.success) {
5175
7734
  const firstError = parseResult.error.errors[0];
@@ -5177,7 +7736,7 @@ function resolveCliConfig(target, env, evalFilePath) {
5177
7736
  const prefix = path34 ? `${target.name} ${path34}: ` : `${target.name}: `;
5178
7737
  throw new Error(`${prefix}${firstError?.message}`);
5179
7738
  }
5180
- const normalized = normalizeCliTargetInput(parseResult.data, env, evalFilePath);
7739
+ const normalized = normalizeCliTargetInput(parseResult.data, env2, evalFilePath);
5181
7740
  assertSupportedCliPlaceholders(normalized.commandTemplate, `${target.name} CLI command template`);
5182
7741
  if (normalized.healthcheck?.type === "command") {
5183
7742
  assertSupportedCliPlaceholders(
@@ -5217,8 +7776,8 @@ function extractCliPlaceholders(template) {
5217
7776
  }
5218
7777
  return results;
5219
7778
  }
5220
- function resolveString(source2, env, description, allowLiteral = false) {
5221
- const value = resolveOptionalString(source2, env, description, {
7779
+ function resolveString(source2, env2, description, allowLiteral = false) {
7780
+ const value = resolveOptionalString(source2, env2, description, {
5222
7781
  allowLiteral,
5223
7782
  optionalEnv: false
5224
7783
  });
@@ -5227,7 +7786,7 @@ function resolveString(source2, env, description, allowLiteral = false) {
5227
7786
  }
5228
7787
  return value;
5229
7788
  }
5230
- function resolveOptionalString(source2, env, description, options) {
7789
+ function resolveOptionalString(source2, env2, description, options) {
5231
7790
  if (source2 === void 0 || source2 === null) {
5232
7791
  return void 0;
5233
7792
  }
@@ -5241,7 +7800,7 @@ function resolveOptionalString(source2, env, description, options) {
5241
7800
  const envVarMatch = trimmed.match(/^\$\{\{\s*([A-Z0-9_]+)\s*\}\}$/i);
5242
7801
  if (envVarMatch) {
5243
7802
  const varName = envVarMatch[1];
5244
- const envValue = env[varName];
7803
+ const envValue = env2[varName];
5245
7804
  const optionalEnv = options?.optionalEnv ?? false;
5246
7805
  if (envValue === void 0 || envValue.trim().length === 0) {
5247
7806
  if (optionalEnv) {
@@ -5303,7 +7862,7 @@ function resolveOptionalBoolean(source2) {
5303
7862
  }
5304
7863
  throw new Error("expected boolean value");
5305
7864
  }
5306
- function resolveOptionalStringArray(source2, env, description) {
7865
+ function resolveOptionalStringArray(source2, env2, description) {
5307
7866
  if (source2 === void 0 || source2 === null) {
5308
7867
  return void 0;
5309
7868
  }
@@ -5326,7 +7885,7 @@ function resolveOptionalStringArray(source2, env, description) {
5326
7885
  const envVarMatch = trimmed.match(/^\$\{\{\s*([A-Z0-9_]+)\s*\}\}$/i);
5327
7886
  if (envVarMatch) {
5328
7887
  const varName = envVarMatch[1];
5329
- const envValue = env[varName];
7888
+ const envValue = env2[varName];
5330
7889
  if (envValue !== void 0) {
5331
7890
  if (envValue.trim().length === 0) {
5332
7891
  throw new Error(`Environment variable '${varName}' for ${description}[${i}] is empty`);
@@ -5425,7 +7984,7 @@ import { parse as parse22 } from "yaml";
5425
7984
  import { readFile as readFile4 } from "node:fs/promises";
5426
7985
  import path22 from "node:path";
5427
7986
  import micromatch from "micromatch";
5428
- import { parse as parse5 } from "yaml";
7987
+ import { parse as parse7 } from "yaml";
5429
7988
  import { constants as constants3 } from "node:fs";
5430
7989
  import { access as access3 } from "node:fs/promises";
5431
7990
  import path13 from "node:path";
@@ -5961,7 +8520,7 @@ __export(external_exports2, {
5961
8520
  base64: () => base642,
5962
8521
  base64url: () => base64url2,
5963
8522
  bigint: () => bigint2,
5964
- boolean: () => boolean2,
8523
+ boolean: () => boolean4,
5965
8524
  catch: () => _catch2,
5966
8525
  check: () => check,
5967
8526
  cidrv4: () => cidrv42,
@@ -6035,7 +8594,7 @@ __export(external_exports2, {
6035
8594
  object: () => object,
6036
8595
  optional: () => optional2,
6037
8596
  overwrite: () => _overwrite,
6038
- parse: () => parse2,
8597
+ parse: () => parse4,
6039
8598
  parseAsync: () => parseAsync2,
6040
8599
  partialRecord: () => partialRecord,
6041
8600
  pipe: () => pipe,
@@ -6318,7 +8877,7 @@ __export(core_exports2, {
6318
8877
  isValidBase64URL: () => isValidBase64URL,
6319
8878
  isValidJWT: () => isValidJWT2,
6320
8879
  locales: () => locales_exports,
6321
- parse: () => parse,
8880
+ parse: () => parse3,
6322
8881
  parseAsync: () => parseAsync,
6323
8882
  prettifyError: () => prettifyError,
6324
8883
  regexes: () => regexes_exports,
@@ -6458,9 +9017,9 @@ function assertNever(_x) {
6458
9017
  }
6459
9018
  function assert(_) {
6460
9019
  }
6461
- function getEnumValues(entries) {
6462
- const numericValues = Object.values(entries).filter((v) => typeof v === "number");
6463
- const values = Object.entries(entries).filter(([k, _]) => numericValues.indexOf(+k) === -1).map(([_, v]) => v);
9020
+ function getEnumValues(entries2) {
9021
+ const numericValues = Object.values(entries2).filter((v) => typeof v === "number");
9022
+ const values = Object.entries(entries2).filter(([k, _]) => numericValues.indexOf(+k) === -1).map(([_, v]) => v);
6464
9023
  return values;
6465
9024
  }
6466
9025
  function joinValues(array2, separator = "|") {
@@ -7074,7 +9633,7 @@ var _parse = (_Err) => (schema, value, _ctx, _params) => {
7074
9633
  }
7075
9634
  return result.value;
7076
9635
  };
7077
- var parse = /* @__PURE__ */ _parse($ZodRealError);
9636
+ var parse3 = /* @__PURE__ */ _parse($ZodRealError);
7078
9637
  var _parseAsync = (_Err) => async (schema, value, _ctx, params) => {
7079
9638
  const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true };
7080
9639
  let result = schema._zod.run({ value, issues: [] }, ctx);
@@ -7119,7 +9678,7 @@ __export(regexes_exports, {
7119
9678
  base64: () => base64,
7120
9679
  base64url: () => base64url,
7121
9680
  bigint: () => bigint,
7122
- boolean: () => boolean,
9681
+ boolean: () => boolean3,
7123
9682
  browserEmail: () => browserEmail,
7124
9683
  cidrv4: () => cidrv4,
7125
9684
  cidrv6: () => cidrv6,
@@ -7196,8 +9755,8 @@ var dateSource = `(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][
7196
9755
  var date = /* @__PURE__ */ new RegExp(`^${dateSource}$`);
7197
9756
  function timeSource(args) {
7198
9757
  const hhmm = `(?:[01]\\d|2[0-3]):[0-5]\\d`;
7199
- const regex = typeof args.precision === "number" ? args.precision === -1 ? `${hhmm}` : args.precision === 0 ? `${hhmm}:[0-5]\\d` : `${hhmm}:[0-5]\\d\\.\\d{${args.precision}}` : `${hhmm}(?::[0-5]\\d(?:\\.\\d+)?)?`;
7200
- return regex;
9758
+ const regex2 = typeof args.precision === "number" ? args.precision === -1 ? `${hhmm}` : args.precision === 0 ? `${hhmm}:[0-5]\\d` : `${hhmm}:[0-5]\\d\\.\\d{${args.precision}}` : `${hhmm}(?::[0-5]\\d(?:\\.\\d+)?)?`;
9759
+ return regex2;
7201
9760
  }
7202
9761
  function time(args) {
7203
9762
  return new RegExp(`^${timeSource(args)}$`);
@@ -7213,13 +9772,13 @@ function datetime(args) {
7213
9772
  return new RegExp(`^${dateSource}T(?:${timeRegex2})$`);
7214
9773
  }
7215
9774
  var string2 = (params) => {
7216
- const regex = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : `[\\s\\S]*`;
7217
- return new RegExp(`^${regex}$`);
9775
+ const regex2 = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : `[\\s\\S]*`;
9776
+ return new RegExp(`^${regex2}$`);
7218
9777
  };
7219
9778
  var bigint = /^\d+n?$/;
7220
9779
  var integer = /^\d+$/;
7221
9780
  var number2 = /^-?\d+(?:\.\d+)?/i;
7222
- var boolean = /true|false/i;
9781
+ var boolean3 = /true|false/i;
7223
9782
  var _null = /null/i;
7224
9783
  var _undefined = /undefined/i;
7225
9784
  var lowercase = /^[^A-Z]*$/;
@@ -8234,7 +10793,7 @@ var $ZodNumberFormat = /* @__PURE__ */ $constructor("$ZodNumber", (inst, def) =>
8234
10793
  });
8235
10794
  var $ZodBoolean = /* @__PURE__ */ $constructor("$ZodBoolean", (inst, def) => {
8236
10795
  $ZodType.init(inst, def);
8237
- inst._zod.pattern = boolean;
10796
+ inst._zod.pattern = boolean3;
8238
10797
  inst._zod.parse = (payload, _ctx) => {
8239
10798
  if (def.coerce)
8240
10799
  try {
@@ -8633,7 +11192,7 @@ var $ZodUnion = /* @__PURE__ */ $constructor("$ZodUnion", (inst, def) => {
8633
11192
  defineLazy(inst._zod, "optout", () => def.options.some((o) => o._zod.optout === "optional") ? "optional" : void 0);
8634
11193
  defineLazy(inst._zod, "values", () => {
8635
11194
  if (def.options.every((o) => o._zod.values)) {
8636
- return new Set(def.options.flatMap((option6) => Array.from(option6._zod.values)));
11195
+ return new Set(def.options.flatMap((option2) => Array.from(option2._zod.values)));
8637
11196
  }
8638
11197
  return void 0;
8639
11198
  });
@@ -8647,8 +11206,8 @@ var $ZodUnion = /* @__PURE__ */ $constructor("$ZodUnion", (inst, def) => {
8647
11206
  inst._zod.parse = (payload, ctx) => {
8648
11207
  let async = false;
8649
11208
  const results = [];
8650
- for (const option6 of def.options) {
8651
- const result = option6._zod.run({
11209
+ for (const option2 of def.options) {
11210
+ const result = option2._zod.run({
8652
11211
  value: payload.value,
8653
11212
  issues: []
8654
11213
  }, ctx);
@@ -8673,10 +11232,10 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
8673
11232
  const _super = inst._zod.parse;
8674
11233
  defineLazy(inst._zod, "propValues", () => {
8675
11234
  const propValues = {};
8676
- for (const option6 of def.options) {
8677
- const pv = option6._zod.propValues;
11235
+ for (const option2 of def.options) {
11236
+ const pv = option2._zod.propValues;
8678
11237
  if (!pv || Object.keys(pv).length === 0)
8679
- throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(option6)}"`);
11238
+ throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(option2)}"`);
8680
11239
  for (const [k, v] of Object.entries(pv)) {
8681
11240
  if (!propValues[k])
8682
11241
  propValues[k] = /* @__PURE__ */ new Set();
@@ -14909,17 +17468,17 @@ function _set(Class2, valueType, params) {
14909
17468
  });
14910
17469
  }
14911
17470
  function _enum(Class2, values, params) {
14912
- const entries = Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values;
17471
+ const entries2 = Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values;
14913
17472
  return new Class2({
14914
17473
  type: "enum",
14915
- entries,
17474
+ entries: entries2,
14916
17475
  ...normalizeParams(params)
14917
17476
  });
14918
17477
  }
14919
- function _nativeEnum(Class2, entries, params) {
17478
+ function _nativeEnum(Class2, entries2, params) {
14920
17479
  return new Class2({
14921
17480
  type: "enum",
14922
- entries,
17481
+ entries: entries2,
14923
17482
  ...normalizeParams(params)
14924
17483
  });
14925
17484
  }
@@ -15117,12 +17676,12 @@ var $ZodFunction = class {
15117
17676
  throw new Error("implement() must be called with a function");
15118
17677
  }
15119
17678
  const impl = (...args) => {
15120
- const parsedArgs = this._def.input ? parse(this._def.input, args, void 0, { callee: impl }) : args;
17679
+ const parsedArgs = this._def.input ? parse3(this._def.input, args, void 0, { callee: impl }) : args;
15121
17680
  if (!Array.isArray(parsedArgs)) {
15122
17681
  throw new Error("Invalid arguments schema: not an array or tuple schema.");
15123
17682
  }
15124
17683
  const output = func(...parsedArgs);
15125
- return this._def.output ? parse(this._def.output, output, void 0, { callee: impl }) : output;
17684
+ return this._def.output ? parse3(this._def.output, output, void 0, { callee: impl }) : output;
15126
17685
  };
15127
17686
  return impl;
15128
17687
  }
@@ -15248,9 +17807,9 @@ var JSONSchemaGenerator = class {
15248
17807
  json2.pattern = regexes[0].source;
15249
17808
  else if (regexes.length > 1) {
15250
17809
  result.schema.allOf = [
15251
- ...regexes.map((regex) => ({
17810
+ ...regexes.map((regex2) => ({
15252
17811
  ...this.target === "draft-7" ? { type: "string" } : {},
15253
- pattern: regex.source
17812
+ pattern: regex2.source
15254
17813
  }))
15255
17814
  ];
15256
17815
  }
@@ -15880,8 +18439,8 @@ function isTransforming(_schema, _ctx) {
15880
18439
  return false;
15881
18440
  }
15882
18441
  case "union": {
15883
- for (const option6 of def.options) {
15884
- if (isTransforming(option6, ctx))
18442
+ for (const option2 of def.options) {
18443
+ if (isTransforming(option2, ctx))
15885
18444
  return true;
15886
18445
  }
15887
18446
  return false;
@@ -16022,7 +18581,7 @@ var ZodRealError = $constructor("ZodError", initializer2, {
16022
18581
  });
16023
18582
 
16024
18583
  // ../../node_modules/.bun/zod@3.25.76/node_modules/zod/v4/classic/parse.js
16025
- var parse2 = /* @__PURE__ */ _parse(ZodRealError);
18584
+ var parse4 = /* @__PURE__ */ _parse(ZodRealError);
16026
18585
  var parseAsync2 = /* @__PURE__ */ _parseAsync(ZodRealError);
16027
18586
  var safeParse2 = /* @__PURE__ */ _safeParse(ZodRealError);
16028
18587
  var safeParseAsync2 = /* @__PURE__ */ _safeParseAsync(ZodRealError);
@@ -16050,7 +18609,7 @@ var ZodType2 = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
16050
18609
  reg.add(inst, meta);
16051
18610
  return inst;
16052
18611
  };
16053
- inst.parse = (data, params) => parse2(inst, data, params, { callee: inst.parse });
18612
+ inst.parse = (data, params) => parse4(inst, data, params, { callee: inst.parse });
16054
18613
  inst.safeParse = (data, params) => safeParse2(inst, data, params);
16055
18614
  inst.parseAsync = async (data, params) => parseAsync2(inst, data, params, { callee: inst.parseAsync });
16056
18615
  inst.safeParseAsync = async (data, params) => safeParseAsync2(inst, data, params);
@@ -16354,7 +18913,7 @@ var ZodBoolean2 = /* @__PURE__ */ $constructor("ZodBoolean", (inst, def) => {
16354
18913
  $ZodBoolean.init(inst, def);
16355
18914
  ZodType2.init(inst, def);
16356
18915
  });
16357
- function boolean2(params) {
18916
+ function boolean4(params) {
16358
18917
  return _boolean(ZodBoolean2, params);
16359
18918
  }
16360
18919
  var ZodBigInt2 = /* @__PURE__ */ $constructor("ZodBigInt", (inst, def) => {
@@ -16664,17 +19223,17 @@ var ZodEnum2 = /* @__PURE__ */ $constructor("ZodEnum", (inst, def) => {
16664
19223
  };
16665
19224
  });
16666
19225
  function _enum2(values, params) {
16667
- const entries = Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values;
19226
+ const entries2 = Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values;
16668
19227
  return new ZodEnum2({
16669
19228
  type: "enum",
16670
- entries,
19229
+ entries: entries2,
16671
19230
  ...util_exports.normalizeParams(params)
16672
19231
  });
16673
19232
  }
16674
- function nativeEnum(entries, params) {
19233
+ function nativeEnum(entries2, params) {
16675
19234
  return new ZodEnum2({
16676
19235
  type: "enum",
16677
- entries,
19236
+ entries: entries2,
16678
19237
  ...util_exports.normalizeParams(params)
16679
19238
  });
16680
19239
  }
@@ -16956,7 +19515,7 @@ var stringbool = (...args) => _stringbool({
16956
19515
  }, ...args);
16957
19516
  function json(params) {
16958
19517
  const jsonSchema2 = lazy(() => {
16959
- return union([string3(params), number3(), boolean2(), _null3(), array(jsonSchema2), record(string3(), jsonSchema2)]);
19518
+ return union([string3(params), number3(), boolean4(), _null3(), array(jsonSchema2), record(string3(), jsonSchema2)]);
16960
19519
  });
16961
19520
  return jsonSchema2;
16962
19521
  }
@@ -16991,7 +19550,7 @@ function getErrorMap2() {
16991
19550
  var coerce_exports = {};
16992
19551
  __export(coerce_exports, {
16993
19552
  bigint: () => bigint3,
16994
- boolean: () => boolean3,
19553
+ boolean: () => boolean5,
16995
19554
  date: () => date4,
16996
19555
  number: () => number4,
16997
19556
  string: () => string4
@@ -17002,7 +19561,7 @@ function string4(params) {
17002
19561
  function number4(params) {
17003
19562
  return _coercedNumber(ZodNumber2, params);
17004
19563
  }
17005
- function boolean3(params) {
19564
+ function boolean5(params) {
17006
19565
  return _coercedBoolean(ZodBoolean2, params);
17007
19566
  }
17008
19567
  function bigint3(params) {
@@ -18286,7 +20845,7 @@ function addFormat(schema, value, message, refs) {
18286
20845
  schema.format = value;
18287
20846
  }
18288
20847
  }
18289
- function addPattern(schema, regex, message, refs) {
20848
+ function addPattern(schema, regex2, message, refs) {
18290
20849
  var _a17;
18291
20850
  if (schema.pattern || ((_a17 = schema.allOf) == null ? void 0 : _a17.some((x) => x.pattern))) {
18292
20851
  if (!schema.allOf) {
@@ -18299,27 +20858,27 @@ function addPattern(schema, regex, message, refs) {
18299
20858
  delete schema.pattern;
18300
20859
  }
18301
20860
  schema.allOf.push({
18302
- pattern: stringifyRegExpWithFlags(regex, refs),
20861
+ pattern: stringifyRegExpWithFlags(regex2, refs),
18303
20862
  ...message && refs.errorMessages && { errorMessage: { pattern: message } }
18304
20863
  });
18305
20864
  } else {
18306
- schema.pattern = stringifyRegExpWithFlags(regex, refs);
20865
+ schema.pattern = stringifyRegExpWithFlags(regex2, refs);
18307
20866
  }
18308
20867
  }
18309
- function stringifyRegExpWithFlags(regex, refs) {
20868
+ function stringifyRegExpWithFlags(regex2, refs) {
18310
20869
  var _a17;
18311
- if (!refs.applyRegexFlags || !regex.flags) {
18312
- return regex.source;
20870
+ if (!refs.applyRegexFlags || !regex2.flags) {
20871
+ return regex2.source;
18313
20872
  }
18314
20873
  const flags = {
18315
- i: regex.flags.includes("i"),
20874
+ i: regex2.flags.includes("i"),
18316
20875
  // Case-insensitive
18317
- m: regex.flags.includes("m"),
20876
+ m: regex2.flags.includes("m"),
18318
20877
  // `^` and `$` matches adjacent to newline characters
18319
- s: regex.flags.includes("s")
20878
+ s: regex2.flags.includes("s")
18320
20879
  // `.` matches newlines
18321
20880
  };
18322
- const source2 = flags.i ? regex.source.toLowerCase() : regex.source;
20881
+ const source2 = flags.i ? regex2.source.toLowerCase() : regex2.source;
18323
20882
  let pattern = "";
18324
20883
  let isEscaped = false;
18325
20884
  let inCharGroup = false;
@@ -18384,7 +20943,7 @@ function stringifyRegExpWithFlags(regex, refs) {
18384
20943
  "/"
18385
20944
  )} to a flag-independent form! Falling back to the flag-ignorant source`
18386
20945
  );
18387
- return regex.source;
20946
+ return regex2.source;
18388
20947
  }
18389
20948
  return pattern;
18390
20949
  }
@@ -29300,13 +31859,13 @@ function registerGlobal(type, instance, diag, allowOverride) {
29300
31859
  version: VERSION6
29301
31860
  };
29302
31861
  if (!allowOverride && api[type]) {
29303
- var err = new Error("@opentelemetry/api: Attempted duplicate registration of API: " + type);
29304
- diag.error(err.stack || err.message);
31862
+ var err2 = new Error("@opentelemetry/api: Attempted duplicate registration of API: " + type);
31863
+ diag.error(err2.stack || err2.message);
29305
31864
  return false;
29306
31865
  }
29307
31866
  if (api.version !== VERSION6) {
29308
- var err = new Error("@opentelemetry/api: Registration of version v" + api.version + " for " + type + " does not match previously registered API v" + VERSION6);
29309
- diag.error(err.stack || err.message);
31867
+ var err2 = new Error("@opentelemetry/api: Registration of version v" + api.version + " for " + type + " does not match previously registered API v" + VERSION6);
31868
+ diag.error(err2.stack || err2.message);
29310
31869
  return false;
29311
31870
  }
29312
31871
  api[type] = instance;
@@ -29497,8 +32056,8 @@ var DiagAPI = (
29497
32056
  optionsOrLogLevel = { logLevel: DiagLogLevel.INFO };
29498
32057
  }
29499
32058
  if (logger === self) {
29500
- var err = new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");
29501
- self.error((_a17 = err.stack) !== null && _a17 !== void 0 ? _a17 : err.message);
32059
+ var err2 = new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");
32060
+ self.error((_a17 = err2.stack) !== null && _a17 !== void 0 ? _a17 : err2.message);
29502
32061
  return false;
29503
32062
  }
29504
32063
  if (typeof optionsOrLogLevel === "number") {
@@ -33034,7 +35593,7 @@ import path92 from "node:path";
33034
35593
  import path82 from "node:path";
33035
35594
  import { exec as execWithCallback } from "node:child_process";
33036
35595
  import fs from "node:fs/promises";
33037
- import os2 from "node:os";
35596
+ import os3 from "node:os";
33038
35597
  import path102 from "node:path";
33039
35598
  import { promisify as promisify2 } from "node:util";
33040
35599
  import { exec as execCallback, spawn as spawn22 } from "node:child_process";
@@ -33072,8 +35631,8 @@ async function ensureDir(target) {
33072
35631
  await mkdir(target, { recursive: true });
33073
35632
  }
33074
35633
  async function readDirEntries(target) {
33075
- const entries = await readdir(target, { withFileTypes: true });
33076
- return entries.map((entry) => ({
35634
+ const entries2 = await readdir(target, { withFileTypes: true });
35635
+ return entries2.map((entry) => ({
33077
35636
  name: entry.name,
33078
35637
  absolutePath: path3.join(target, entry.name),
33079
35638
  isDirectory: entry.isDirectory()
@@ -33304,13 +35863,13 @@ import path8 from "node:path";
33304
35863
  import { promisify } from "node:util";
33305
35864
 
33306
35865
  // ../../node_modules/.bun/subagent@0.5.6/node_modules/subagent/dist/vscode/constants.js
33307
- import os from "node:os";
35866
+ import os2 from "node:os";
33308
35867
  import path7 from "node:path";
33309
35868
  var DEFAULT_LOCK_NAME = "subagent.lock";
33310
35869
  var DEFAULT_ALIVE_FILENAME = ".alive";
33311
35870
  function getDefaultSubagentRoot(vscodeCmd = "code") {
33312
35871
  const folder = vscodeCmd === "code-insiders" ? "vscode-insiders-agents" : "vscode-agents";
33313
- return path7.join(os.homedir(), ".subagent", folder);
35872
+ return path7.join(os2.homedir(), ".subagent", folder);
33314
35873
  }
33315
35874
  var DEFAULT_SUBAGENT_ROOT = getDefaultSubagentRoot();
33316
35875
 
@@ -33455,7 +36014,7 @@ var column;
33455
36014
  var token;
33456
36015
  var key;
33457
36016
  var root;
33458
- var parse3 = function parse4(text2, reviver) {
36017
+ var parse5 = function parse6(text2, reviver) {
33459
36018
  source = String(text2);
33460
36019
  parseState = "start";
33461
36020
  stack = [];
@@ -34281,10 +36840,10 @@ function formatChar(c3) {
34281
36840
  return c3;
34282
36841
  }
34283
36842
  function syntaxError(message) {
34284
- const err = new SyntaxError(message);
34285
- err.lineNumber = line;
34286
- err.columnNumber = column;
34287
- return err;
36843
+ const err2 = new SyntaxError(message);
36844
+ err2.lineNumber = line;
36845
+ err2.columnNumber = column;
36846
+ return err2;
34288
36847
  }
34289
36848
  var stringify = function stringify2(value, replacer, space) {
34290
36849
  const stack2 = [];
@@ -34499,7 +37058,7 @@ var stringify = function stringify2(value, replacer, space) {
34499
37058
  }
34500
37059
  };
34501
37060
  var JSON5 = {
34502
- parse: parse3,
37061
+ parse: parse5,
34503
37062
  stringify
34504
37063
  };
34505
37064
  var lib = JSON5;
@@ -34590,8 +37149,8 @@ async function findUnlockedSubagent(subagentRoot) {
34590
37149
  if (!await pathExists(subagentRoot)) {
34591
37150
  return null;
34592
37151
  }
34593
- const entries = await readDirEntries(subagentRoot);
34594
- const subagents = entries.filter((entry) => entry.isDirectory && entry.name.startsWith("subagent-")).map((entry) => ({
37152
+ const entries2 = await readDirEntries(subagentRoot);
37153
+ const subagents = entries2.filter((entry) => entry.isDirectory && entry.name.startsWith("subagent-")).map((entry) => ({
34595
37154
  absolutePath: entry.absolutePath,
34596
37155
  number: Number.parseInt(entry.name.split("-")[1] ?? "", 10)
34597
37156
  })).filter((entry) => Number.isInteger(entry.number)).sort((a, b) => a.number - b.number);
@@ -34652,8 +37211,8 @@ async function removeSubagentLock(subagentDir) {
34652
37211
  const lockFile = path10.join(subagentDir, DEFAULT_LOCK_NAME);
34653
37212
  await removeIfExists(lockFile);
34654
37213
  }
34655
- async function prepareSubagentDirectory(subagentDir, promptFile, chatId, workspaceTemplate, dryRun) {
34656
- if (dryRun) {
37214
+ async function prepareSubagentDirectory(subagentDir, promptFile, chatId, workspaceTemplate, dryRun2) {
37215
+ if (dryRun2) {
34657
37216
  return 0;
34658
37217
  }
34659
37218
  try {
@@ -34715,7 +37274,7 @@ async function resolveAttachments(extraAttachments) {
34715
37274
  return resolved;
34716
37275
  }
34717
37276
  async function dispatchAgentSession(options) {
34718
- const { userQuery, promptFile, requestTemplate, extraAttachments, workspaceTemplate, dryRun = false, wait = true, vscodeCmd = "code", subagentRoot, silent = false } = options;
37277
+ const { userQuery, promptFile, requestTemplate, extraAttachments, workspaceTemplate, dryRun: dryRun2 = false, wait = true, vscodeCmd = "code", subagentRoot, silent = false } = options;
34719
37278
  try {
34720
37279
  let resolvedPrompt;
34721
37280
  try {
@@ -34737,7 +37296,7 @@ async function dispatchAgentSession(options) {
34737
37296
  }
34738
37297
  const subagentName = path11.basename(subagentDir);
34739
37298
  const chatId = Math.random().toString(16).slice(2, 10);
34740
- const preparationResult = await prepareSubagentDirectory(subagentDir, resolvedPrompt, chatId, workspaceTemplate, dryRun);
37299
+ const preparationResult = await prepareSubagentDirectory(subagentDir, resolvedPrompt, chatId, workspaceTemplate, dryRun2);
34741
37300
  if (preparationResult !== 0) {
34742
37301
  return {
34743
37302
  exitCode: preparationResult,
@@ -34760,7 +37319,7 @@ async function dispatchAgentSession(options) {
34760
37319
  const responseFileTmp = path11.join(messagesDir, `${timestamp}_res.tmp.md`);
34761
37320
  const responseFileFinal = path11.join(messagesDir, `${timestamp}_res.md`);
34762
37321
  const requestInstructions = createRequestPrompt(userQuery, responseFileTmp, responseFileFinal, templateContent);
34763
- if (dryRun) {
37322
+ if (dryRun2) {
34764
37323
  return {
34765
37324
  exitCode: 0,
34766
37325
  subagentName,
@@ -34811,7 +37370,7 @@ async function dispatchAgentSession(options) {
34811
37370
  }
34812
37371
  }
34813
37372
  async function dispatchBatchAgent(options) {
34814
- const { userQueries, promptFile, requestTemplate, extraAttachments, workspaceTemplate, dryRun = false, wait = false, vscodeCmd = "code", subagentRoot, silent = false } = options;
37373
+ const { userQueries, promptFile, requestTemplate, extraAttachments, workspaceTemplate, dryRun: dryRun2 = false, wait = false, vscodeCmd = "code", subagentRoot, silent = false } = options;
34815
37374
  if (!userQueries || userQueries.length === 0) {
34816
37375
  return {
34817
37376
  exitCode: 1,
@@ -34850,7 +37409,7 @@ async function dispatchBatchAgent(options) {
34850
37409
  }
34851
37410
  subagentName = path11.basename(subagentDir);
34852
37411
  const chatId = Math.random().toString(16).slice(2, 10);
34853
- const preparationResult = await prepareSubagentDirectory(subagentDir, resolvedPrompt, chatId, workspaceTemplate, dryRun);
37412
+ const preparationResult = await prepareSubagentDirectory(subagentDir, resolvedPrompt, chatId, workspaceTemplate, dryRun2);
34854
37413
  if (preparationResult !== 0) {
34855
37414
  return {
34856
37415
  exitCode: preparationResult,
@@ -34878,7 +37437,7 @@ async function dispatchBatchAgent(options) {
34878
37437
  const responseTmpFiles = userQueries.map((_, index) => path11.join(messagesDir, `${timestamp}_${index}_res.tmp.md`));
34879
37438
  responseFilesFinal = userQueries.map((_, index) => path11.join(messagesDir, `${timestamp}_${index}_res.md`));
34880
37439
  const orchestratorFile = path11.join(messagesDir, `${timestamp}_orchestrator.md`);
34881
- if (!dryRun) {
37440
+ if (!dryRun2) {
34882
37441
  await Promise.all(userQueries.map((query, index) => writeFile3(requestFiles[index], createBatchRequestPrompt(query, responseTmpFiles[index], responseFilesFinal[index], batchRequestTemplateContent), { encoding: "utf8" })));
34883
37442
  const orchestratorContent = createBatchOrchestratorPrompt(requestFiles, responseFilesFinal, orchestratorTemplateContent);
34884
37443
  await writeFile3(orchestratorFile, orchestratorContent, { encoding: "utf8" });
@@ -34886,7 +37445,7 @@ async function dispatchBatchAgent(options) {
34886
37445
  const chatAttachments = [orchestratorFile, ...attachments];
34887
37446
  const orchestratorUri = pathToFileUri(orchestratorFile);
34888
37447
  const chatInstruction = `Follow instructions in [${timestamp}_orchestrator.md](${orchestratorUri}). Use #runSubagent tool.`;
34889
- if (dryRun) {
37448
+ if (dryRun2) {
34890
37449
  return {
34891
37450
  exitCode: 0,
34892
37451
  subagentName,
@@ -34965,20 +37524,20 @@ tools: ['edit', 'runNotebooks', 'search', 'new', 'runCommands', 'runTasks', 'usa
34965
37524
  model: GPT-4.1 (copilot)
34966
37525
  ---`;
34967
37526
  async function provisionSubagents(options) {
34968
- const { targetRoot, subagents, lockName = DEFAULT_LOCK_NAME, force = false, dryRun = false, workspaceTemplate = DEFAULT_WORKSPACE_TEMPLATE2, wakeupContent = DEFAULT_WAKEUP_CONTENT2 } = options;
37527
+ const { targetRoot, subagents, lockName = DEFAULT_LOCK_NAME, force = false, dryRun: dryRun2 = false, workspaceTemplate = DEFAULT_WORKSPACE_TEMPLATE2, wakeupContent = DEFAULT_WAKEUP_CONTENT2 } = options;
34969
37528
  if (!Number.isInteger(subagents) || subagents < 1) {
34970
37529
  throw new Error("subagents must be a positive integer");
34971
37530
  }
34972
37531
  const targetPath = path12.resolve(targetRoot);
34973
- if (!dryRun) {
37532
+ if (!dryRun2) {
34974
37533
  await ensureDir(targetPath);
34975
37534
  }
34976
37535
  let highestNumber = 0;
34977
37536
  const lockedSubagents = /* @__PURE__ */ new Set();
34978
37537
  const existingSubagents = [];
34979
37538
  if (await pathExists(targetPath)) {
34980
- const entries = await readDirEntries(targetPath);
34981
- for (const entry of entries) {
37539
+ const entries2 = await readDirEntries(targetPath);
37540
+ for (const entry of entries2) {
34982
37541
  if (!entry.isDirectory || !entry.name.startsWith("subagent-")) {
34983
37542
  continue;
34984
37543
  }
@@ -35017,7 +37576,7 @@ async function provisionSubagents(options) {
35017
37576
  continue;
35018
37577
  }
35019
37578
  if (isLocked && force) {
35020
- if (!dryRun) {
37579
+ if (!dryRun2) {
35021
37580
  await removeIfExists(lockFile);
35022
37581
  await ensureDir(githubAgentsDir);
35023
37582
  await writeFile4(workspaceDst, JSON.stringify(workspaceTemplate, null, 2), "utf8");
@@ -35029,7 +37588,7 @@ async function provisionSubagents(options) {
35029
37588
  continue;
35030
37589
  }
35031
37590
  if (!isLocked && force) {
35032
- if (!dryRun) {
37591
+ if (!dryRun2) {
35033
37592
  await ensureDir(githubAgentsDir);
35034
37593
  await writeFile4(workspaceDst, JSON.stringify(workspaceTemplate, null, 2), "utf8");
35035
37594
  await writeFile4(wakeupDst, wakeupContent, "utf8");
@@ -35038,7 +37597,7 @@ async function provisionSubagents(options) {
35038
37597
  subagentsProvisioned += 1;
35039
37598
  continue;
35040
37599
  }
35041
- if (!dryRun && !await pathExists(workspaceDst)) {
37600
+ if (!dryRun2 && !await pathExists(workspaceDst)) {
35042
37601
  await ensureDir(githubAgentsDir);
35043
37602
  await writeFile4(workspaceDst, JSON.stringify(workspaceTemplate, null, 2), "utf8");
35044
37603
  await writeFile4(wakeupDst, wakeupContent, "utf8");
@@ -35054,7 +37613,7 @@ async function provisionSubagents(options) {
35054
37613
  const workspaceDst = path12.join(subagentDir, `${path12.basename(subagentDir)}.code-workspace`);
35055
37614
  const wakeupDst = path12.join(githubAgentsDir, "wakeup.md");
35056
37615
  const subagentDst = path12.join(githubAgentsDir, "subagent.md");
35057
- if (!dryRun) {
37616
+ if (!dryRun2) {
35058
37617
  await ensureDir(subagentDir);
35059
37618
  await ensureDir(githubAgentsDir);
35060
37619
  await writeFile4(workspaceDst, JSON.stringify(workspaceTemplate, null, 2), "utf8");
@@ -35273,7 +37832,7 @@ async function loadConfig(evalFilePath, repoRoot) {
35273
37832
  }
35274
37833
  try {
35275
37834
  const rawConfig = await readFile4(configPath, "utf8");
35276
- const parsed = parse5(rawConfig);
37835
+ const parsed = parse7(rawConfig);
35277
37836
  if (!isJsonObject(parsed)) {
35278
37837
  logWarning(`Invalid .agentv/config.yaml format at ${configPath}`);
35279
37838
  continue;
@@ -35903,11 +38462,11 @@ function asStringArray(value, description) {
35903
38462
  }
35904
38463
  return result;
35905
38464
  }
35906
- function parseCommandToArgv(command7) {
38465
+ function parseCommandToArgv(command2) {
35907
38466
  if (process.platform === "win32") {
35908
- return ["cmd.exe", "/c", command7];
38467
+ return ["cmd.exe", "/c", command2];
35909
38468
  }
35910
- return ["sh", "-lc", command7];
38469
+ return ["sh", "-lc", command2];
35911
38470
  }
35912
38471
  function isJsonObject2(value) {
35913
38472
  return typeof value === "object" && value !== null && !Array.isArray(value);
@@ -36285,8 +38844,8 @@ function asString3(value) {
36285
38844
  return typeof value === "string" ? value : void 0;
36286
38845
  }
36287
38846
  function cloneJsonObject(source2) {
36288
- const entries = Object.entries(source2).map(([key2, value]) => [key2, cloneJsonValue(value)]);
36289
- return Object.fromEntries(entries);
38847
+ const entries2 = Object.entries(source2).map(([key2, value]) => [key2, cloneJsonValue(value)]);
38848
+ return Object.fromEntries(entries2);
36290
38849
  }
36291
38850
  function cloneJsonValue(value) {
36292
38851
  if (value === null) {
@@ -37608,10 +40167,10 @@ ${filesContext}`;
37608
40167
  return args;
37609
40168
  }
37610
40169
  buildEnv() {
37611
- const env = { ...process.env };
37612
- env.CLAUDECODE = void 0;
37613
- env.CLAUDE_CODE_ENTRYPOINT = void 0;
37614
- return env;
40170
+ const env2 = { ...process.env };
40171
+ env2.CLAUDECODE = void 0;
40172
+ env2.CLAUDE_CODE_ENTRYPOINT = void 0;
40173
+ return env2;
37615
40174
  }
37616
40175
  async executeClaudeCode(args, cwd, signal, logger) {
37617
40176
  try {
@@ -37626,8 +40185,8 @@ ${filesContext}`;
37626
40185
  onStderrChunk: logger ? (chunk) => logger.handleStderrChunk(chunk) : void 0
37627
40186
  });
37628
40187
  } catch (error40) {
37629
- const err = error40;
37630
- if (err.code === "ENOENT") {
40188
+ const err2 = error40;
40189
+ if (err2.code === "ENOENT") {
37631
40190
  throw new Error(
37632
40191
  `Claude Code executable '${this.config.executable}' was not found. Update the target settings.executable or add it to PATH.`
37633
40192
  );
@@ -38253,7 +40812,7 @@ function convertOutputMessages(messages) {
38253
40812
  }
38254
40813
  var execAsync2 = promisify2(execWithCallback);
38255
40814
  var DEFAULT_MAX_BUFFER = 10 * 1024 * 1024;
38256
- async function defaultCommandRunner(command7, options) {
40815
+ async function defaultCommandRunner(command2, options) {
38257
40816
  const execOptions = {
38258
40817
  cwd: options.cwd,
38259
40818
  env: options.env,
@@ -38263,7 +40822,7 @@ async function defaultCommandRunner(command7, options) {
38263
40822
  shell: process.platform === "win32" ? "powershell.exe" : void 0
38264
40823
  };
38265
40824
  try {
38266
- const { stdout, stderr } = await execAsync2(command7, execOptions);
40825
+ const { stdout, stderr } = await execAsync2(command2, execOptions);
38267
40826
  return {
38268
40827
  stdout,
38269
40828
  stderr,
@@ -38687,7 +41246,7 @@ function generateOutputFilePath(evalCaseId, extension = ".json") {
38687
41246
  const safeEvalId = evalCaseId || "unknown";
38688
41247
  const timestamp = Date.now();
38689
41248
  const random = Math.random().toString(36).substring(2, 9);
38690
- return path102.join(os2.tmpdir(), `agentv-${safeEvalId}-${timestamp}-${random}${extension}`);
41249
+ return path102.join(os3.tmpdir(), `agentv-${safeEvalId}-${timestamp}-${random}${extension}`);
38691
41250
  }
38692
41251
  function formatTimeoutSuffix2(timeoutMs) {
38693
41252
  if (!timeoutMs || timeoutMs <= 0) {
@@ -38860,8 +41419,8 @@ ${basePrompt}`;
38860
41419
  onStderrChunk: logger ? (chunk) => logger.handleStderrChunk(chunk) : void 0
38861
41420
  });
38862
41421
  } catch (error40) {
38863
- const err = error40;
38864
- if (err.code === "ENOENT") {
41422
+ const err2 = error40;
41423
+ if (err2.code === "ENOENT") {
38865
41424
  throw new Error(
38866
41425
  `Codex executable '${this.config.executable}' was not found. Update the target settings.executable or add it to PATH.`
38867
41426
  );
@@ -39782,8 +42341,8 @@ ${prompt}`;
39782
42341
  onStderrChunk: logger ? (chunk) => logger.handleStderrChunk(chunk) : void 0
39783
42342
  });
39784
42343
  } catch (error40) {
39785
- const err = error40;
39786
- if (err.code === "ENOENT") {
42344
+ const err2 = error40;
42345
+ if (err2.code === "ENOENT") {
39787
42346
  throw new Error(
39788
42347
  `Pi coding agent executable '${this.config.executable}' was not found. Update the target settings.executable or add it to PATH.`
39789
42348
  );
@@ -39792,32 +42351,32 @@ ${prompt}`;
39792
42351
  }
39793
42352
  }
39794
42353
  buildEnv() {
39795
- const env = { ...process.env };
42354
+ const env2 = { ...process.env };
39796
42355
  if (this.config.apiKey) {
39797
42356
  const provider = this.config.provider?.toLowerCase() ?? "google";
39798
42357
  switch (provider) {
39799
42358
  case "google":
39800
42359
  case "gemini":
39801
- env.GEMINI_API_KEY = this.config.apiKey;
42360
+ env2.GEMINI_API_KEY = this.config.apiKey;
39802
42361
  break;
39803
42362
  case "anthropic":
39804
- env.ANTHROPIC_API_KEY = this.config.apiKey;
42363
+ env2.ANTHROPIC_API_KEY = this.config.apiKey;
39805
42364
  break;
39806
42365
  case "openai":
39807
- env.OPENAI_API_KEY = this.config.apiKey;
42366
+ env2.OPENAI_API_KEY = this.config.apiKey;
39808
42367
  break;
39809
42368
  case "groq":
39810
- env.GROQ_API_KEY = this.config.apiKey;
42369
+ env2.GROQ_API_KEY = this.config.apiKey;
39811
42370
  break;
39812
42371
  case "xai":
39813
- env.XAI_API_KEY = this.config.apiKey;
42372
+ env2.XAI_API_KEY = this.config.apiKey;
39814
42373
  break;
39815
42374
  case "openrouter":
39816
- env.OPENROUTER_API_KEY = this.config.apiKey;
42375
+ env2.OPENROUTER_API_KEY = this.config.apiKey;
39817
42376
  break;
39818
42377
  }
39819
42378
  }
39820
- return env;
42379
+ return env2;
39821
42380
  }
39822
42381
  async createWorkspace() {
39823
42382
  return await mkdtemp3(path122.join(tmpdir3(), WORKSPACE_PREFIX3));
@@ -40712,9 +43271,9 @@ async function execFileWithStdin(argv, stdinPayload, options = {}) {
40712
43271
  return execFileWithStdinNode(argv, stdinPayload, options);
40713
43272
  }
40714
43273
  async function execFileWithStdinBun(argv, stdinPayload, options) {
40715
- const command7 = [...argv];
43274
+ const command2 = [...argv];
40716
43275
  const encoder = new TextEncoder();
40717
- const proc = Bun.spawn(command7, {
43276
+ const proc = Bun.spawn(command2, {
40718
43277
  cwd: options.cwd,
40719
43278
  stdin: encoder.encode(stdinPayload),
40720
43279
  stdout: "pipe",
@@ -40792,7 +43351,7 @@ async function execFileWithStdinNode(argv, stdinPayload, options) {
40792
43351
  }
40793
43352
  });
40794
43353
  }
40795
- async function execShellWithStdin(command7, stdinPayload, options = {}) {
43354
+ async function execShellWithStdin(command2, stdinPayload, options = {}) {
40796
43355
  const { mkdir: mkdir42, readFile: readFile82, rm: rm4, writeFile: writeFile42 } = await import("node:fs/promises");
40797
43356
  const { tmpdir: tmpdir4 } = await import("node:os");
40798
43357
  const path162 = await import("node:path");
@@ -40803,7 +43362,7 @@ async function execShellWithStdin(command7, stdinPayload, options = {}) {
40803
43362
  const stdoutPath = path162.join(dir, "stdout.txt");
40804
43363
  const stderrPath = path162.join(dir, "stderr.txt");
40805
43364
  await writeFile42(stdinPath, stdinPayload, "utf8");
40806
- const wrappedCommand = process.platform === "win32" ? `(${command7}) < ${shellEscapePath(stdinPath)} > ${shellEscapePath(stdoutPath)} 2> ${shellEscapePath(stderrPath)}` : `(${command7}) < ${shellEscapePath(stdinPath)} > ${shellEscapePath(stdoutPath)} 2> ${shellEscapePath(stderrPath)}`;
43365
+ const wrappedCommand = process.platform === "win32" ? `(${command2}) < ${shellEscapePath(stdinPath)} > ${shellEscapePath(stdoutPath)} 2> ${shellEscapePath(stderrPath)}` : `(${command2}) < ${shellEscapePath(stdinPath)} > ${shellEscapePath(stdoutPath)} 2> ${shellEscapePath(stderrPath)}`;
40807
43366
  const { spawn: spawn4 } = await import("node:child_process");
40808
43367
  try {
40809
43368
  const exitCode = await new Promise((resolve2, reject) => {
@@ -41007,8 +43566,8 @@ async function createTargetProxy(options) {
41007
43566
  shutdown: async () => {
41008
43567
  isShutdown = true;
41009
43568
  return new Promise((resolve2, reject) => {
41010
- server.close((err) => {
41011
- if (err) reject(err);
43569
+ server.close((err2) => {
43570
+ if (err2) reject(err2);
41012
43571
  else resolve2();
41013
43572
  });
41014
43573
  });
@@ -41185,8 +43744,8 @@ var CodeEvaluator = class {
41185
43744
  }
41186
43745
  }
41187
43746
  };
41188
- async function executeScript(scriptPath, input, agentTimeoutMs, cwd, env) {
41189
- const { stdout, stderr, exitCode } = typeof scriptPath === "string" ? await execShellWithStdin(scriptPath, input, { cwd, timeoutMs: agentTimeoutMs, env }) : await execFileWithStdin(scriptPath, input, { cwd, timeoutMs: agentTimeoutMs, env });
43747
+ async function executeScript(scriptPath, input, agentTimeoutMs, cwd, env2) {
43748
+ const { stdout, stderr, exitCode } = typeof scriptPath === "string" ? await execShellWithStdin(scriptPath, input, { cwd, timeoutMs: agentTimeoutMs, env: env2 }) : await execFileWithStdin(scriptPath, input, { cwd, timeoutMs: agentTimeoutMs, env: env2 });
41190
43749
  if (exitCode !== 0) {
41191
43750
  const trimmedErr = formatStderr(stderr);
41192
43751
  throw new Error(
@@ -42877,7 +45436,7 @@ async function runEvaluation(options) {
42877
45436
  repoRoot,
42878
45437
  target,
42879
45438
  targets,
42880
- env,
45439
+ env: env2,
42881
45440
  providerFactory,
42882
45441
  evaluators,
42883
45442
  maxRetries,
@@ -42905,7 +45464,7 @@ async function runEvaluation(options) {
42905
45464
  for (const definition of targets ?? []) {
42906
45465
  targetDefinitions.set(definition.name, definition);
42907
45466
  }
42908
- const envLookup = env ?? process.env;
45467
+ const envLookup = env2 ?? process.env;
42909
45468
  const providerCache = /* @__PURE__ */ new Map();
42910
45469
  const getOrCreateProvider = (resolved) => {
42911
45470
  const existing = providerCache.get(resolved.name);
@@ -44043,10 +46602,10 @@ function mapChildResults(children) {
44043
46602
  details: child.details
44044
46603
  }));
44045
46604
  }
44046
- function computeWeightedMean(entries) {
46605
+ function computeWeightedMean(entries2) {
44047
46606
  let totalWeight = 0;
44048
46607
  let weightedSum = 0;
44049
- for (const entry of entries) {
46608
+ for (const entry of entries2) {
44050
46609
  const weight = entry.weight ?? 1;
44051
46610
  totalWeight += weight;
44052
46611
  weightedSum += entry.score * weight;
@@ -44131,7 +46690,6 @@ function buildPrompt(expectedOutcome, question, referenceAnswer) {
44131
46690
  }
44132
46691
 
44133
46692
  // src/commands/convert/index.ts
44134
- import { command as command2, option as option2, optional as optional3, positional as positional2, string as string5 } from "cmd-ts";
44135
46693
  import { stringify as stringifyYaml } from "yaml";
44136
46694
  function convertJsonlToYaml(inputPath, outputPath) {
44137
46695
  const content = readFileSync2(inputPath, "utf8");
@@ -44152,17 +46710,17 @@ function convertJsonlToYaml(inputPath, outputPath) {
44152
46710
  writeFileSync(outputPath, yamlOutput);
44153
46711
  return lines.length;
44154
46712
  }
44155
- var convertCommand = command2({
46713
+ var convertCommand = command({
44156
46714
  name: "convert",
44157
46715
  description: "Convert evaluation results from JSONL to YAML format",
44158
46716
  args: {
44159
- input: positional2({
44160
- type: string5,
46717
+ input: positional({
46718
+ type: string,
44161
46719
  displayName: "input",
44162
46720
  description: "Path to input JSONL file"
44163
46721
  }),
44164
- out: option2({
44165
- type: optional3(string5),
46722
+ out: option({
46723
+ type: optional(string),
44166
46724
  long: "out",
44167
46725
  short: "o",
44168
46726
  description: "Output file path (defaults to input path with .yaml extension)"
@@ -44187,15 +46745,6 @@ var convertCommand = command2({
44187
46745
  // src/commands/eval/index.ts
44188
46746
  import { stat as stat4 } from "node:fs/promises";
44189
46747
  import path25 from "node:path";
44190
- import {
44191
- command as command3,
44192
- flag as flag2,
44193
- number as number5,
44194
- option as option3,
44195
- optional as optional4,
44196
- restPositionals,
44197
- string as string6
44198
- } from "cmd-ts";
44199
46748
  import fg from "fast-glob";
44200
46749
 
44201
46750
  // src/commands/eval/run-eval.ts
@@ -44836,7 +47385,7 @@ function formatEvaluationSummary(summary) {
44836
47385
  // ../../packages/core/dist/evaluation/validation/index.js
44837
47386
  import { readFile as readFile8 } from "node:fs/promises";
44838
47387
  import path20 from "node:path";
44839
- import { parse as parse6 } from "yaml";
47388
+ import { parse as parse8 } from "yaml";
44840
47389
  import { readFile as readFile23 } from "node:fs/promises";
44841
47390
  import path23 from "node:path";
44842
47391
  import { parse as parse23 } from "yaml";
@@ -44854,7 +47403,7 @@ var SCHEMA_CONFIG_V2 = "agentv-config-v2";
44854
47403
  async function detectFileType(filePath) {
44855
47404
  try {
44856
47405
  const content = await readFile8(filePath, "utf8");
44857
- const parsed = parse6(content);
47406
+ const parsed = parse8(content);
44858
47407
  if (typeof parsed !== "object" || parsed === null) {
44859
47408
  return inferFileTypeFromPath(filePath);
44860
47409
  }
@@ -45753,11 +48302,11 @@ async function selectTarget(options) {
45753
48302
  cwd,
45754
48303
  explicitTargetsPath,
45755
48304
  cliTargetName,
45756
- dryRun,
48305
+ dryRun: dryRun2,
45757
48306
  dryRunDelay,
45758
48307
  dryRunDelayMin,
45759
48308
  dryRunDelayMax,
45760
- env
48309
+ env: env2
45761
48310
  } = options;
45762
48311
  const targetsFilePath = await discoverTargetsFile({
45763
48312
  explicitPath: explicitTargetsPath,
@@ -45803,7 +48352,7 @@ Errors in ${targetsFilePath}:`);
45803
48352
  `Target '${targetChoice.name}' not found in ${targetsFilePath}. Available targets: ${available}`
45804
48353
  );
45805
48354
  }
45806
- if (dryRun) {
48355
+ if (dryRun2) {
45807
48356
  const mockTarget = {
45808
48357
  kind: "mock",
45809
48358
  name: `${targetDefinition.name}-dry-run`,
@@ -45824,7 +48373,7 @@ Errors in ${targetsFilePath}:`);
45824
48373
  };
45825
48374
  }
45826
48375
  try {
45827
- const resolvedTarget = resolveTargetDefinition(targetDefinition, env, testFilePath);
48376
+ const resolvedTarget = resolveTargetDefinition(targetDefinition, env2, testFilePath);
45828
48377
  return {
45829
48378
  definitions,
45830
48379
  resolvedTarget,
@@ -46219,87 +48768,87 @@ async function resolveEvaluationRunner() {
46219
48768
  }
46220
48769
 
46221
48770
  // src/commands/eval/index.ts
46222
- var evalCommand = command3({
48771
+ var evalCommand = command({
46223
48772
  name: "eval",
46224
48773
  description: "Run eval suites and report results",
46225
48774
  args: {
46226
48775
  evalPaths: restPositionals({
46227
- type: string6,
48776
+ type: string,
46228
48777
  displayName: "eval-paths",
46229
48778
  description: "Path(s) or glob(s) to evaluation .yaml file(s)"
46230
48779
  }),
46231
- target: option3({
46232
- type: string6,
48780
+ target: option({
48781
+ type: string,
46233
48782
  long: "target",
46234
48783
  description: "Override target name from targets.yaml",
46235
48784
  defaultValue: () => "default"
46236
48785
  }),
46237
- targets: option3({
46238
- type: optional4(string6),
48786
+ targets: option({
48787
+ type: optional(string),
46239
48788
  long: "targets",
46240
48789
  description: "Path to targets.yaml (overrides discovery)"
46241
48790
  }),
46242
- evalId: option3({
46243
- type: optional4(string6),
48791
+ evalId: option({
48792
+ type: optional(string),
46244
48793
  long: "eval-id",
46245
48794
  description: 'Filter eval cases by ID pattern (glob supported, e.g., "summary-*")'
46246
48795
  }),
46247
- workers: option3({
46248
- type: number5,
48796
+ workers: option({
48797
+ type: number,
46249
48798
  long: "workers",
46250
48799
  description: "Number of parallel workers (default: 3, max: 50). Can also be set per-target in targets.yaml",
46251
48800
  defaultValue: () => 3
46252
48801
  }),
46253
- out: option3({
46254
- type: optional4(string6),
48802
+ out: option({
48803
+ type: optional(string),
46255
48804
  long: "out",
46256
48805
  description: "Write results to the specified path"
46257
48806
  }),
46258
- outputFormat: option3({
46259
- type: string6,
48807
+ outputFormat: option({
48808
+ type: string,
46260
48809
  long: "output-format",
46261
48810
  description: "Output format: 'jsonl' or 'yaml' (default: jsonl)",
46262
48811
  defaultValue: () => "jsonl"
46263
48812
  }),
46264
- dryRun: flag2({
48813
+ dryRun: flag({
46265
48814
  long: "dry-run",
46266
48815
  description: "Use mock provider responses instead of real LLM calls"
46267
48816
  }),
46268
- dryRunDelay: option3({
46269
- type: number5,
48817
+ dryRunDelay: option({
48818
+ type: number,
46270
48819
  long: "dry-run-delay",
46271
48820
  description: "Fixed delay in milliseconds for dry-run mode (overridden by delay range if specified)",
46272
48821
  defaultValue: () => 0
46273
48822
  }),
46274
- dryRunDelayMin: option3({
46275
- type: number5,
48823
+ dryRunDelayMin: option({
48824
+ type: number,
46276
48825
  long: "dry-run-delay-min",
46277
48826
  description: "Minimum delay in milliseconds for dry-run mode (requires --dry-run-delay-max)",
46278
48827
  defaultValue: () => 0
46279
48828
  }),
46280
- dryRunDelayMax: option3({
46281
- type: number5,
48829
+ dryRunDelayMax: option({
48830
+ type: number,
46282
48831
  long: "dry-run-delay-max",
46283
48832
  description: "Maximum delay in milliseconds for dry-run mode (requires --dry-run-delay-min)",
46284
48833
  defaultValue: () => 0
46285
48834
  }),
46286
- agentTimeout: option3({
46287
- type: number5,
48835
+ agentTimeout: option({
48836
+ type: number,
46288
48837
  long: "agent-timeout",
46289
48838
  description: "Timeout in seconds for provider responses (default: 120)",
46290
48839
  defaultValue: () => 120
46291
48840
  }),
46292
- maxRetries: option3({
46293
- type: number5,
48841
+ maxRetries: option({
48842
+ type: number,
46294
48843
  long: "max-retries",
46295
48844
  description: "Retry count for timeout recoveries (default: 2)",
46296
48845
  defaultValue: () => 2
46297
48846
  }),
46298
- cache: flag2({
48847
+ cache: flag({
46299
48848
  long: "cache",
46300
48849
  description: "Enable in-memory provider response cache"
46301
48850
  }),
46302
- verbose: flag2({
48851
+ verbose: flag({
46303
48852
  long: "verbose",
46304
48853
  description: "Enable verbose logging"
46305
48854
  })
@@ -46372,9 +48921,6 @@ async function resolveEvalPaths(evalPaths, cwd) {
46372
48921
  return sorted;
46373
48922
  }
46374
48923
 
46375
- // src/commands/generate/index.ts
46376
- import { command as command4, flag as flag3, option as option4, optional as optional5, positional as positional4, string as string7, subcommands } from "cmd-ts";
46377
-
46378
48924
  // src/commands/generate/rubrics.ts
46379
48925
  import { readFile as readFile9, writeFile as writeFile6 } from "node:fs/promises";
46380
48926
  import path26 from "node:path";
@@ -46514,22 +49060,22 @@ function extractQuestion(evalCase) {
46514
49060
  }
46515
49061
 
46516
49062
  // src/commands/generate/index.ts
46517
- var rubricsCommand = command4({
49063
+ var rubricsCommand = command({
46518
49064
  name: "rubrics",
46519
49065
  description: "Generate rubrics from expected_outcome in YAML eval file",
46520
49066
  args: {
46521
- file: positional4({
46522
- type: string7,
49067
+ file: positional({
49068
+ type: string,
46523
49069
  displayName: "file",
46524
49070
  description: "Path to YAML eval file"
46525
49071
  }),
46526
- target: option4({
46527
- type: optional5(string7),
49072
+ target: option({
49073
+ type: optional(string),
46528
49074
  long: "target",
46529
49075
  short: "t",
46530
49076
  description: "Override target for rubric generation (default: file target or openai:gpt-4o)"
46531
49077
  }),
46532
- verbose: flag3({
49078
+ verbose: flag({
46533
49079
  long: "verbose",
46534
49080
  short: "v",
46535
49081
  description: "Show detailed progress"
@@ -46560,7 +49106,6 @@ var generateCommand = subcommands({
46560
49106
  import { existsSync, mkdirSync, writeFileSync as writeFileSync2 } from "node:fs";
46561
49107
  import path28 from "node:path";
46562
49108
  import * as readline from "node:readline/promises";
46563
- import { command as command5, option as option5, optional as optional6, string as string8 } from "cmd-ts";
46564
49109
 
46565
49110
  // src/templates/index.ts
46566
49111
  import { readFileSync as readFileSync3, readdirSync, statSync } from "node:fs";
@@ -46616,8 +49161,8 @@ function getRepoRootFromDev() {
46616
49161
  }
46617
49162
  function readTemplatesRecursively(dir, relativePath) {
46618
49163
  const templates = [];
46619
- const entries = readdirSync(dir);
46620
- for (const entry of entries) {
49164
+ const entries2 = readdirSync(dir);
49165
+ for (const entry of entries2) {
46621
49166
  const fullPath = path27.join(dir, entry);
46622
49167
  const stat6 = statSync(fullPath);
46623
49168
  const entryRelativePath = relativePath ? path27.join(relativePath, entry) : entry;
@@ -46768,12 +49313,12 @@ Files installed to ${path28.relative(targetPath, claudeDir)}:`);
46768
49313
  console.log(" 2. Configure targets in .agentv/targets.yaml");
46769
49314
  console.log(" 3. Create eval files using the schema and prompt templates");
46770
49315
  }
46771
- var initCmdTsCommand = command5({
49316
+ var initCmdTsCommand = command({
46772
49317
  name: "init",
46773
49318
  description: "Initialize AgentV in your project (installs prompt templates and schema to .github)",
46774
49319
  args: {
46775
- path: option5({
46776
- type: optional6(string8),
49320
+ path: option({
49321
+ type: optional(string),
46777
49322
  long: "path",
46778
49323
  description: "Target directory for initialization (default: current directory)"
46779
49324
  })
@@ -46788,9 +49333,6 @@ var initCmdTsCommand = command5({
46788
49333
  }
46789
49334
  });
46790
49335
 
46791
- // src/commands/validate/index.ts
46792
- import { command as command6, restPositionals as restPositionals2, string as string9 } from "cmd-ts";
46793
-
46794
49336
  // src/commands/validate/format-output.ts
46795
49337
  var ANSI_RED4 = "\x1B[31m";
46796
49338
  var ANSI_YELLOW9 = "\x1B[33m";
@@ -46939,8 +49481,8 @@ async function expandPaths(paths) {
46939
49481
  async function findYamlFiles(dirPath) {
46940
49482
  const results = [];
46941
49483
  try {
46942
- const entries = await readdir3(dirPath, { withFileTypes: true });
46943
- for (const entry of entries) {
49484
+ const entries2 = await readdir3(dirPath, { withFileTypes: true });
49485
+ for (const entry of entries2) {
46944
49486
  const fullPath = path29.join(dirPath, entry.name);
46945
49487
  if (entry.isDirectory()) {
46946
49488
  if (entry.name === "node_modules" || entry.name.startsWith(".")) {
@@ -46975,12 +49517,12 @@ async function runValidateCommand(paths) {
46975
49517
  process.exit(1);
46976
49518
  }
46977
49519
  }
46978
- var validateCommand = command6({
49520
+ var validateCommand = command({
46979
49521
  name: "validate",
46980
49522
  description: "Validate AgentV eval and targets YAML files",
46981
49523
  args: {
46982
- paths: restPositionals2({
46983
- type: string9,
49524
+ paths: restPositionals({
49525
+ type: string,
46984
49526
  displayName: "paths",
46985
49527
  description: "Files or directories to validate"
46986
49528
  })
@@ -46997,7 +49539,7 @@ var validateCommand = command6({
46997
49539
 
46998
49540
  // src/index.ts
46999
49541
  var packageJson = JSON.parse(readFileSync4(new URL("../package.json", import.meta.url), "utf8"));
47000
- var app = subcommands2({
49542
+ var app = subcommands({
47001
49543
  name: "agentv",
47002
49544
  description: "AgentV CLI",
47003
49545
  version: packageJson.version,
@@ -47018,4 +49560,4 @@ export {
47018
49560
  app,
47019
49561
  runCli
47020
49562
  };
47021
- //# sourceMappingURL=chunk-XREH4WAJ.js.map
49563
+ //# sourceMappingURL=chunk-PQSPRPW4.js.map