webmux 0.29.0 → 0.31.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/backend/dist/server.js +499 -177
- package/bin/webmux.js +1430 -989
- package/frontend/dist/assets/{DiffDialog-1-WiuIC4.js → DiffDialog-AFwqV11h.js} +1 -1
- package/frontend/dist/assets/index-CDyziN6b.js +33 -0
- package/frontend/dist/assets/index-yjEx8o8T.css +1 -0
- package/frontend/dist/index.html +2 -2
- package/package.json +1 -1
- package/frontend/dist/assets/index-CqUU8MH2.css +0 -1
- package/frontend/dist/assets/index-D4JuH244.js +0 -33
package/bin/webmux.js
CHANGED
|
@@ -440,6 +440,7 @@ _webmux() {
|
|
|
440
440
|
'close:Close a worktree session'
|
|
441
441
|
'archive:Hide a worktree from the default list'
|
|
442
442
|
'unarchive:Show an archived worktree again'
|
|
443
|
+
'label:Set or clear a workspace label'
|
|
443
444
|
'remove:Remove a worktree'
|
|
444
445
|
'merge:Merge a worktree into main'
|
|
445
446
|
'send:Send a prompt to a running worktree agent'
|
|
@@ -453,7 +454,7 @@ _webmux() {
|
|
|
453
454
|
fi
|
|
454
455
|
|
|
455
456
|
case "\${words[2]}" in
|
|
456
|
-
open|close|archive|unarchive|remove|merge|send)
|
|
457
|
+
open|close|archive|unarchive|label|remove|merge|send)
|
|
457
458
|
if (( CURRENT == 3 )); then
|
|
458
459
|
local -a branches
|
|
459
460
|
branches=(\${(f)"$(webmux --completions "\${words[2]}" 2>/dev/null)"})
|
|
@@ -491,12 +492,12 @@ compdef _webmux webmux`, BASH_SCRIPT = `_webmux() {
|
|
|
491
492
|
prev="\${COMP_WORDS[COMP_CWORD-1]}"
|
|
492
493
|
|
|
493
494
|
if [[ \${COMP_CWORD} -eq 1 ]]; then
|
|
494
|
-
COMPREPLY=($(compgen -W "serve init service update add list open close archive unarchive remove merge send prune completion" -- "\${cur}"))
|
|
495
|
+
COMPREPLY=($(compgen -W "serve init service update add list open close archive unarchive label remove merge send prune completion" -- "\${cur}"))
|
|
495
496
|
return
|
|
496
497
|
fi
|
|
497
498
|
|
|
498
499
|
case "\${COMP_WORDS[1]}" in
|
|
499
|
-
open|close|archive|unarchive|remove|merge|send)
|
|
500
|
+
open|close|archive|unarchive|label|remove|merge|send)
|
|
500
501
|
if [[ \${COMP_CWORD} -eq 2 ]]; then
|
|
501
502
|
local branches
|
|
502
503
|
branches=$(webmux --completions "\${COMP_WORDS[1]}" 2>/dev/null)
|
|
@@ -519,32 +520,49 @@ compdef _webmux webmux`, BASH_SCRIPT = `_webmux() {
|
|
|
519
520
|
complete -F _webmux webmux`;
|
|
520
521
|
var init_completions = __esm(() => {
|
|
521
522
|
init_git();
|
|
522
|
-
BRANCH_SUBCOMMANDS = new Set(["open", "close", "archive", "unarchive", "remove", "merge", "send"]);
|
|
523
|
+
BRANCH_SUBCOMMANDS = new Set(["open", "close", "archive", "unarchive", "label", "remove", "merge", "send"]);
|
|
523
524
|
});
|
|
524
525
|
|
|
525
|
-
// node_modules/.bun/fast-string-truncated-width@
|
|
526
|
-
var
|
|
527
|
-
return x === 161 || x === 164 || x === 167 || x === 168 || x === 170 || x === 173 || x === 174 || x >= 176 && x <= 180 || x >= 182 && x <= 186 || x >= 188 && x <= 191 || x === 198 || x === 208 || x === 215 || x === 216 || x >= 222 && x <= 225 || x === 230 || x >= 232 && x <= 234 || x === 236 || x === 237 || x === 240 || x === 242 || x === 243 || x >= 247 && x <= 250 || x === 252 || x === 254 || x === 257 || x === 273 || x === 275 || x === 283 || x === 294 || x === 295 || x === 299 || x >= 305 && x <= 307 || x === 312 || x >= 319 && x <= 322 || x === 324 || x >= 328 && x <= 331 || x === 333 || x === 338 || x === 339 || x === 358 || x === 359 || x === 363 || x === 462 || x === 464 || x === 466 || x === 468 || x === 470 || x === 472 || x === 474 || x === 476 || x === 593 || x === 609 || x === 708 || x === 711 || x >= 713 && x <= 715 || x === 717 || x === 720 || x >= 728 && x <= 731 || x === 733 || x === 735 || x >= 768 && x <= 879 || x >= 913 && x <= 929 || x >= 931 && x <= 937 || x >= 945 && x <= 961 || x >= 963 && x <= 969 || x === 1025 || x >= 1040 && x <= 1103 || x === 1105 || x === 8208 || x >= 8211 && x <= 8214 || x === 8216 || x === 8217 || x === 8220 || x === 8221 || x >= 8224 && x <= 8226 || x >= 8228 && x <= 8231 || x === 8240 || x === 8242 || x === 8243 || x === 8245 || x === 8251 || x === 8254 || x === 8308 || x === 8319 || x >= 8321 && x <= 8324 || x === 8364 || x === 8451 || x === 8453 || x === 8457 || x === 8467 || x === 8470 || x === 8481 || x === 8482 || x === 8486 || x === 8491 || x === 8531 || x === 8532 || x >= 8539 && x <= 8542 || x >= 8544 && x <= 8555 || x >= 8560 && x <= 8569 || x === 8585 || x >= 8592 && x <= 8601 || x === 8632 || x === 8633 || x === 8658 || x === 8660 || x === 8679 || x === 8704 || x === 8706 || x === 8707 || x === 8711 || x === 8712 || x === 8715 || x === 8719 || x === 8721 || x === 8725 || x === 8730 || x >= 8733 && x <= 8736 || x === 8739 || x === 8741 || x >= 8743 && x <= 8748 || x === 8750 || x >= 8756 && x <= 8759 || x === 8764 || x === 8765 || x === 8776 || x === 8780 || x === 8786 || x === 8800 || x === 8801 || x >= 8804 && x <= 8807 || x === 8810 || x === 8811 || x === 8814 || x === 8815 || x === 8834 || x === 8835 || x === 8838 || x === 8839 || x === 8853 || x === 8857 || x === 8869 || x === 8895 || x === 8978 || x >= 9312 && x <= 9449 || x >= 9451 && x <= 9547 || x >= 9552 && x <= 9587 || x >= 9600 && x <= 9615 || x >= 9618 && x <= 9621 || x === 9632 || x === 9633 || x >= 9635 && x <= 9641 || x === 9650 || x === 9651 || x === 9654 || x === 9655 || x === 9660 || x === 9661 || x === 9664 || x === 9665 || x >= 9670 && x <= 9672 || x === 9675 || x >= 9678 && x <= 9681 || x >= 9698 && x <= 9701 || x === 9711 || x === 9733 || x === 9734 || x === 9737 || x === 9742 || x === 9743 || x === 9756 || x === 9758 || x === 9792 || x === 9794 || x === 9824 || x === 9825 || x >= 9827 && x <= 9829 || x >= 9831 && x <= 9834 || x === 9836 || x === 9837 || x === 9839 || x === 9886 || x === 9887 || x === 9919 || x >= 9926 && x <= 9933 || x >= 9935 && x <= 9939 || x >= 9941 && x <= 9953 || x === 9955 || x === 9960 || x === 9961 || x >= 9963 && x <= 9969 || x === 9972 || x >= 9974 && x <= 9977 || x === 9979 || x === 9980 || x === 9982 || x === 9983 || x === 10045 || x >= 10102 && x <= 10111 || x >= 11094 && x <= 11097 || x >= 12872 && x <= 12879 || x >= 57344 && x <= 63743 || x >= 65024 && x <= 65039 || x === 65533 || x >= 127232 && x <= 127242 || x >= 127248 && x <= 127277 || x >= 127280 && x <= 127337 || x >= 127344 && x <= 127373 || x === 127375 || x === 127376 || x >= 127387 && x <= 127404 || x >= 917760 && x <= 917999 || x >= 983040 && x <= 1048573 || x >= 1048576 && x <= 1114109;
|
|
528
|
-
}, isFullWidth = (x) => {
|
|
526
|
+
// node_modules/.bun/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/utils.js
|
|
527
|
+
var getCodePointsLength, isFullWidth = (x) => {
|
|
529
528
|
return x === 12288 || x >= 65281 && x <= 65376 || x >= 65504 && x <= 65510;
|
|
530
|
-
},
|
|
531
|
-
return x
|
|
529
|
+
}, isWideNotCJKTNotEmoji = (x) => {
|
|
530
|
+
return x === 8987 || x === 9001 || x >= 12272 && x <= 12287 || x >= 12289 && x <= 12350 || x >= 12441 && x <= 12543 || x >= 12549 && x <= 12591 || x >= 12593 && x <= 12686 || x >= 12688 && x <= 12771 || x >= 12783 && x <= 12830 || x >= 12832 && x <= 12871 || x >= 12880 && x <= 19903 || x >= 65040 && x <= 65049 || x >= 65072 && x <= 65106 || x >= 65108 && x <= 65126 || x >= 65128 && x <= 65131 || x >= 127488 && x <= 127490 || x >= 127504 && x <= 127547 || x >= 127552 && x <= 127560 || x >= 131072 && x <= 196605 || x >= 196608 && x <= 262141;
|
|
532
531
|
};
|
|
533
|
-
var init_utils = () => {
|
|
532
|
+
var init_utils = __esm(() => {
|
|
533
|
+
getCodePointsLength = (() => {
|
|
534
|
+
const SURROGATE_PAIR_RE = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
|
|
535
|
+
return (input) => {
|
|
536
|
+
let surrogatePairsNr = 0;
|
|
537
|
+
SURROGATE_PAIR_RE.lastIndex = 0;
|
|
538
|
+
while (SURROGATE_PAIR_RE.test(input)) {
|
|
539
|
+
surrogatePairsNr += 1;
|
|
540
|
+
}
|
|
541
|
+
return input.length - surrogatePairsNr;
|
|
542
|
+
};
|
|
543
|
+
})();
|
|
544
|
+
});
|
|
534
545
|
|
|
535
|
-
// node_modules/.bun/fast-string-truncated-width@
|
|
536
|
-
var ANSI_RE, CONTROL_RE, TAB_RE, EMOJI_RE, LATIN_RE, MODIFIER_RE, NO_TRUNCATION, getStringTruncatedWidth = (input, truncationOptions = {}, widthOptions = {}) => {
|
|
546
|
+
// node_modules/.bun/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/index.js
|
|
547
|
+
var ANSI_RE, CONTROL_RE, CJKT_WIDE_RE, TAB_RE, EMOJI_RE, LATIN_RE, MODIFIER_RE, NO_TRUNCATION, getStringTruncatedWidth = (input, truncationOptions = {}, widthOptions = {}) => {
|
|
537
548
|
const LIMIT = truncationOptions.limit ?? Infinity;
|
|
538
549
|
const ELLIPSIS = truncationOptions.ellipsis ?? "";
|
|
539
550
|
const ELLIPSIS_WIDTH = truncationOptions?.ellipsisWidth ?? (ELLIPSIS ? getStringTruncatedWidth(ELLIPSIS, NO_TRUNCATION, widthOptions).width : 0);
|
|
540
|
-
const ANSI_WIDTH =
|
|
551
|
+
const ANSI_WIDTH = 0;
|
|
541
552
|
const CONTROL_WIDTH = widthOptions.controlWidth ?? 0;
|
|
542
553
|
const TAB_WIDTH = widthOptions.tabWidth ?? 8;
|
|
543
|
-
const AMBIGUOUS_WIDTH = widthOptions.ambiguousWidth ?? 1;
|
|
544
554
|
const EMOJI_WIDTH = widthOptions.emojiWidth ?? 2;
|
|
545
|
-
const FULL_WIDTH_WIDTH =
|
|
555
|
+
const FULL_WIDTH_WIDTH = 2;
|
|
546
556
|
const REGULAR_WIDTH = widthOptions.regularWidth ?? 1;
|
|
547
|
-
const WIDE_WIDTH = widthOptions.wideWidth ??
|
|
557
|
+
const WIDE_WIDTH = widthOptions.wideWidth ?? FULL_WIDTH_WIDTH;
|
|
558
|
+
const PARSE_BLOCKS = [
|
|
559
|
+
[LATIN_RE, REGULAR_WIDTH],
|
|
560
|
+
[ANSI_RE, ANSI_WIDTH],
|
|
561
|
+
[CONTROL_RE, CONTROL_WIDTH],
|
|
562
|
+
[TAB_RE, TAB_WIDTH],
|
|
563
|
+
[EMOJI_RE, EMOJI_WIDTH],
|
|
564
|
+
[CJKT_WIDE_RE, WIDE_WIDTH]
|
|
565
|
+
];
|
|
548
566
|
let indexPrev = 0;
|
|
549
567
|
let index = 0;
|
|
550
568
|
let length = input.length;
|
|
@@ -565,10 +583,8 @@ var ANSI_RE, CONTROL_RE, TAB_RE, EMOJI_RE, LATIN_RE, MODIFIER_RE, NO_TRUNCATION,
|
|
|
565
583
|
const codePoint = char.codePointAt(0) || 0;
|
|
566
584
|
if (isFullWidth(codePoint)) {
|
|
567
585
|
widthExtra = FULL_WIDTH_WIDTH;
|
|
568
|
-
} else if (
|
|
586
|
+
} else if (isWideNotCJKTNotEmoji(codePoint)) {
|
|
569
587
|
widthExtra = WIDE_WIDTH;
|
|
570
|
-
} else if (AMBIGUOUS_WIDTH !== REGULAR_WIDTH && isAmbiguous(codePoint)) {
|
|
571
|
-
widthExtra = AMBIGUOUS_WIDTH;
|
|
572
588
|
} else {
|
|
573
589
|
widthExtra = REGULAR_WIDTH;
|
|
574
590
|
}
|
|
@@ -584,88 +600,28 @@ var ANSI_RE, CONTROL_RE, TAB_RE, EMOJI_RE, LATIN_RE, MODIFIER_RE, NO_TRUNCATION,
|
|
|
584
600
|
}
|
|
585
601
|
unmatchedStart = unmatchedEnd = 0;
|
|
586
602
|
}
|
|
587
|
-
if (index >= length)
|
|
588
|
-
break;
|
|
589
|
-
LATIN_RE.lastIndex = index;
|
|
590
|
-
if (LATIN_RE.test(input)) {
|
|
591
|
-
lengthExtra = LATIN_RE.lastIndex - index;
|
|
592
|
-
widthExtra = lengthExtra * REGULAR_WIDTH;
|
|
593
|
-
if (width + widthExtra > truncationLimit) {
|
|
594
|
-
truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / REGULAR_WIDTH));
|
|
595
|
-
}
|
|
596
|
-
if (width + widthExtra > LIMIT) {
|
|
597
|
-
truncationEnabled = true;
|
|
598
|
-
break;
|
|
599
|
-
}
|
|
600
|
-
width += widthExtra;
|
|
601
|
-
unmatchedStart = indexPrev;
|
|
602
|
-
unmatchedEnd = index;
|
|
603
|
-
index = indexPrev = LATIN_RE.lastIndex;
|
|
604
|
-
continue;
|
|
605
|
-
}
|
|
606
|
-
ANSI_RE.lastIndex = index;
|
|
607
|
-
if (ANSI_RE.test(input)) {
|
|
608
|
-
if (width + ANSI_WIDTH > truncationLimit) {
|
|
609
|
-
truncationIndex = Math.min(truncationIndex, index);
|
|
610
|
-
}
|
|
611
|
-
if (width + ANSI_WIDTH > LIMIT) {
|
|
612
|
-
truncationEnabled = true;
|
|
613
|
-
break;
|
|
614
|
-
}
|
|
615
|
-
width += ANSI_WIDTH;
|
|
616
|
-
unmatchedStart = indexPrev;
|
|
617
|
-
unmatchedEnd = index;
|
|
618
|
-
index = indexPrev = ANSI_RE.lastIndex;
|
|
619
|
-
continue;
|
|
603
|
+
if (index >= length) {
|
|
604
|
+
break outer;
|
|
620
605
|
}
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
if (TAB_RE.test(input)) {
|
|
640
|
-
lengthExtra = TAB_RE.lastIndex - index;
|
|
641
|
-
widthExtra = lengthExtra * TAB_WIDTH;
|
|
642
|
-
if (width + widthExtra > truncationLimit) {
|
|
643
|
-
truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / TAB_WIDTH));
|
|
644
|
-
}
|
|
645
|
-
if (width + widthExtra > LIMIT) {
|
|
646
|
-
truncationEnabled = true;
|
|
647
|
-
break;
|
|
648
|
-
}
|
|
649
|
-
width += widthExtra;
|
|
650
|
-
unmatchedStart = indexPrev;
|
|
651
|
-
unmatchedEnd = index;
|
|
652
|
-
index = indexPrev = TAB_RE.lastIndex;
|
|
653
|
-
continue;
|
|
654
|
-
}
|
|
655
|
-
EMOJI_RE.lastIndex = index;
|
|
656
|
-
if (EMOJI_RE.test(input)) {
|
|
657
|
-
if (width + EMOJI_WIDTH > truncationLimit) {
|
|
658
|
-
truncationIndex = Math.min(truncationIndex, index);
|
|
659
|
-
}
|
|
660
|
-
if (width + EMOJI_WIDTH > LIMIT) {
|
|
661
|
-
truncationEnabled = true;
|
|
662
|
-
break;
|
|
606
|
+
for (let i = 0, l = PARSE_BLOCKS.length;i < l; i++) {
|
|
607
|
+
const [BLOCK_RE, BLOCK_WIDTH] = PARSE_BLOCKS[i];
|
|
608
|
+
BLOCK_RE.lastIndex = index;
|
|
609
|
+
if (BLOCK_RE.test(input)) {
|
|
610
|
+
lengthExtra = BLOCK_RE === CJKT_WIDE_RE ? getCodePointsLength(input.slice(index, BLOCK_RE.lastIndex)) : BLOCK_RE === EMOJI_RE ? 1 : BLOCK_RE.lastIndex - index;
|
|
611
|
+
widthExtra = lengthExtra * BLOCK_WIDTH;
|
|
612
|
+
if (width + widthExtra > truncationLimit) {
|
|
613
|
+
truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / BLOCK_WIDTH));
|
|
614
|
+
}
|
|
615
|
+
if (width + widthExtra > LIMIT) {
|
|
616
|
+
truncationEnabled = true;
|
|
617
|
+
break outer;
|
|
618
|
+
}
|
|
619
|
+
width += widthExtra;
|
|
620
|
+
unmatchedStart = indexPrev;
|
|
621
|
+
unmatchedEnd = index;
|
|
622
|
+
index = indexPrev = BLOCK_RE.lastIndex;
|
|
623
|
+
continue outer;
|
|
663
624
|
}
|
|
664
|
-
width += EMOJI_WIDTH;
|
|
665
|
-
unmatchedStart = indexPrev;
|
|
666
|
-
unmatchedEnd = index;
|
|
667
|
-
index = indexPrev = EMOJI_RE.lastIndex;
|
|
668
|
-
continue;
|
|
669
625
|
}
|
|
670
626
|
index += 1;
|
|
671
627
|
}
|
|
@@ -678,8 +634,9 @@ var ANSI_RE, CONTROL_RE, TAB_RE, EMOJI_RE, LATIN_RE, MODIFIER_RE, NO_TRUNCATION,
|
|
|
678
634
|
}, dist_default;
|
|
679
635
|
var init_dist = __esm(() => {
|
|
680
636
|
init_utils();
|
|
681
|
-
ANSI_RE = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y;
|
|
637
|
+
ANSI_RE = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y;
|
|
682
638
|
CONTROL_RE = /[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y;
|
|
639
|
+
CJKT_WIDE_RE = /(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/yu;
|
|
683
640
|
TAB_RE = /\t{1,1000}/y;
|
|
684
641
|
EMOJI_RE = /[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/yu;
|
|
685
642
|
LATIN_RE = /(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y;
|
|
@@ -688,7 +645,7 @@ var init_dist = __esm(() => {
|
|
|
688
645
|
dist_default = getStringTruncatedWidth;
|
|
689
646
|
});
|
|
690
647
|
|
|
691
|
-
// node_modules/.bun/fast-string-width@
|
|
648
|
+
// node_modules/.bun/fast-string-width@3.0.2/node_modules/fast-string-width/dist/index.js
|
|
692
649
|
var NO_TRUNCATION2, fastStringWidth = (input, options = {}) => {
|
|
693
650
|
return dist_default(input, NO_TRUNCATION2, options).width;
|
|
694
651
|
}, dist_default2;
|
|
@@ -702,7 +659,7 @@ var init_dist2 = __esm(() => {
|
|
|
702
659
|
dist_default2 = fastStringWidth;
|
|
703
660
|
});
|
|
704
661
|
|
|
705
|
-
// node_modules/.bun/fast-wrap-ansi@0.
|
|
662
|
+
// node_modules/.bun/fast-wrap-ansi@0.2.0/node_modules/fast-wrap-ansi/lib/main.js
|
|
706
663
|
function wrapAnsi(string, columns, options) {
|
|
707
664
|
return String(string).normalize().split(CRLF_OR_LF).map((line) => exec(line, columns, options)).join(`
|
|
708
665
|
`);
|
|
@@ -860,8 +817,11 @@ var ESC = "\x1B", CSI = "\x9B", END_CODE = 39, ANSI_ESCAPE_BELL = "\x07", ANSI_C
|
|
|
860
817
|
returnValue += character;
|
|
861
818
|
if (!inSurrogate) {
|
|
862
819
|
inSurrogate = character >= "\uD800" && character <= "\uDBFF";
|
|
820
|
+
if (inSurrogate) {
|
|
821
|
+
continue;
|
|
822
|
+
}
|
|
863
823
|
} else {
|
|
864
|
-
|
|
824
|
+
inSurrogate = false;
|
|
865
825
|
}
|
|
866
826
|
if (character === ESC || character === CSI) {
|
|
867
827
|
GROUP_REGEX.lastIndex = i + 1;
|
|
@@ -960,96 +920,118 @@ var require_src = __commonJS((exports, module) => {
|
|
|
960
920
|
module.exports = { cursor, scroll, erase, beep };
|
|
961
921
|
});
|
|
962
922
|
|
|
963
|
-
// node_modules/.bun/@clack+core@1.
|
|
964
|
-
import { styleText as
|
|
965
|
-
import { stdout as
|
|
966
|
-
import
|
|
967
|
-
function
|
|
968
|
-
if (!
|
|
923
|
+
// node_modules/.bun/@clack+core@1.3.1/node_modules/@clack/core/dist/index.mjs
|
|
924
|
+
import { styleText as v } from "util";
|
|
925
|
+
import { stdout as x, stdin as D } from "process";
|
|
926
|
+
import E from "readline";
|
|
927
|
+
function f(r, t, s) {
|
|
928
|
+
if (!s.some((o) => !o.disabled))
|
|
969
929
|
return r;
|
|
970
|
-
const
|
|
971
|
-
return
|
|
930
|
+
const e = r + t, i = Math.max(s.length - 1, 0), n = e < 0 ? i : e > i ? 0 : e;
|
|
931
|
+
return s[n].disabled ? f(n, t < 0 ? -1 : 1, s) : n;
|
|
972
932
|
}
|
|
973
|
-
function
|
|
933
|
+
function I(r, t, s, e) {
|
|
934
|
+
const i = e.split(`
|
|
935
|
+
`);
|
|
936
|
+
let n = 0, o = r;
|
|
937
|
+
for (const a of i) {
|
|
938
|
+
if (o <= a.length)
|
|
939
|
+
break;
|
|
940
|
+
o -= a.length + 1, n++;
|
|
941
|
+
}
|
|
942
|
+
for (n = Math.max(0, Math.min(i.length - 1, n + s)), o = Math.min(o, i[n].length) + t;o < 0 && n > 0; )
|
|
943
|
+
n--, o += i[n].length + 1;
|
|
944
|
+
for (;o > i[n].length && n < i.length - 1; )
|
|
945
|
+
o -= i[n].length + 1, n++;
|
|
946
|
+
o = Math.max(0, Math.min(i[n].length, o));
|
|
947
|
+
let u = 0;
|
|
948
|
+
for (let a = 0;a < n; a++)
|
|
949
|
+
u += i[a].length + 1;
|
|
950
|
+
return u + o;
|
|
951
|
+
}
|
|
952
|
+
function C(r, t) {
|
|
974
953
|
if (typeof r == "string")
|
|
975
|
-
return
|
|
976
|
-
for (const
|
|
977
|
-
if (
|
|
954
|
+
return h.aliases.get(r) === t;
|
|
955
|
+
for (const s of r)
|
|
956
|
+
if (s !== undefined && C(s, t))
|
|
978
957
|
return true;
|
|
979
958
|
return false;
|
|
980
959
|
}
|
|
981
|
-
function
|
|
960
|
+
function z(r, t) {
|
|
982
961
|
if (r === t)
|
|
983
962
|
return;
|
|
984
|
-
const
|
|
985
|
-
`),
|
|
986
|
-
`), i = Math.max(
|
|
963
|
+
const s = r.split(`
|
|
964
|
+
`), e = t.split(`
|
|
965
|
+
`), i = Math.max(s.length, e.length), n = [];
|
|
987
966
|
for (let o = 0;o < i; o++)
|
|
988
|
-
|
|
989
|
-
return { lines: n, numLinesBefore:
|
|
967
|
+
s[o] !== e[o] && n.push(o);
|
|
968
|
+
return { lines: n, numLinesBefore: s.length, numLinesAfter: e.length, numLines: i };
|
|
990
969
|
}
|
|
991
970
|
function q(r) {
|
|
992
|
-
return r ===
|
|
971
|
+
return r === k;
|
|
993
972
|
}
|
|
994
973
|
function w(r, t) {
|
|
995
|
-
const
|
|
996
|
-
|
|
997
|
-
}
|
|
998
|
-
function
|
|
999
|
-
const
|
|
1000
|
-
return wrapAnsi(t,
|
|
1001
|
-
`).map((
|
|
974
|
+
const s = r;
|
|
975
|
+
s.isTTY && s.setRawMode(t);
|
|
976
|
+
}
|
|
977
|
+
function W(r, t, s, e = s, i = s, n) {
|
|
978
|
+
const o = A(r ?? x);
|
|
979
|
+
return wrapAnsi(t, o - s.length, { hard: true, trim: false }).split(`
|
|
980
|
+
`).map((u, a, l) => {
|
|
981
|
+
const c = n ? n(u, a) : u;
|
|
982
|
+
return a === 0 ? `${e}${c}` : a === l.length - 1 ? `${i}${c}` : `${s}${c}`;
|
|
983
|
+
}).join(`
|
|
1002
984
|
`);
|
|
1003
985
|
}
|
|
1004
|
-
function
|
|
986
|
+
function B(r, t) {
|
|
1005
987
|
if (r === undefined || t.length === 0)
|
|
1006
988
|
return 0;
|
|
1007
|
-
const
|
|
1008
|
-
return
|
|
989
|
+
const s = t.findIndex((e) => e.value === r);
|
|
990
|
+
return s !== -1 ? s : 0;
|
|
1009
991
|
}
|
|
1010
|
-
function
|
|
992
|
+
function J(r, t) {
|
|
1011
993
|
return (t.label ?? String(t.value)).toLowerCase().includes(r.toLowerCase());
|
|
1012
994
|
}
|
|
1013
|
-
function
|
|
995
|
+
function H(r, t) {
|
|
1014
996
|
if (t)
|
|
1015
997
|
return r ? t : t[0];
|
|
1016
998
|
}
|
|
1017
|
-
function
|
|
1018
|
-
return [...r].map((t) =>
|
|
999
|
+
function P(r) {
|
|
1000
|
+
return [...r].map((t) => Z[t]);
|
|
1019
1001
|
}
|
|
1020
|
-
function
|
|
1021
|
-
const t = new Intl.DateTimeFormat(r, { year: "numeric", month: "2-digit", day: "2-digit" }).formatToParts(new Date(2000, 0, 15)),
|
|
1022
|
-
let
|
|
1002
|
+
function tt(r) {
|
|
1003
|
+
const t = new Intl.DateTimeFormat(r, { year: "numeric", month: "2-digit", day: "2-digit" }).formatToParts(new Date(2000, 0, 15)), s = [];
|
|
1004
|
+
let e = "/";
|
|
1023
1005
|
for (const i of t)
|
|
1024
|
-
i.type === "literal" ?
|
|
1025
|
-
return { segments:
|
|
1006
|
+
i.type === "literal" ? e = i.value.trim() || i.value : (i.type === "year" || i.type === "month" || i.type === "day") && s.push({ type: i.type, len: i.type === "year" ? 4 : 2 });
|
|
1007
|
+
return { segments: s, separator: e };
|
|
1026
1008
|
}
|
|
1027
|
-
function
|
|
1009
|
+
function $(r) {
|
|
1028
1010
|
return Number.parseInt((r || "0").replace(/_/g, "0"), 10) || 0;
|
|
1029
1011
|
}
|
|
1030
|
-
function
|
|
1031
|
-
return { year:
|
|
1012
|
+
function S(r) {
|
|
1013
|
+
return { year: $(r.year), month: $(r.month), day: $(r.day) };
|
|
1032
1014
|
}
|
|
1033
|
-
function
|
|
1015
|
+
function U(r, t) {
|
|
1034
1016
|
return new Date(r || 2001, t || 1, 0).getDate();
|
|
1035
1017
|
}
|
|
1036
1018
|
function F(r) {
|
|
1037
|
-
const { year: t, month:
|
|
1038
|
-
if (!t || t < 0 || t > 9999 || !
|
|
1019
|
+
const { year: t, month: s, day: e } = S(r);
|
|
1020
|
+
if (!t || t < 0 || t > 9999 || !s || s < 1 || s > 12 || !e || e < 1)
|
|
1039
1021
|
return;
|
|
1040
|
-
const i = new Date(Date.UTC(t,
|
|
1041
|
-
if (!(i.getUTCFullYear() !== t || i.getUTCMonth() !==
|
|
1042
|
-
return { year: t, month:
|
|
1022
|
+
const i = new Date(Date.UTC(t, s - 1, e));
|
|
1023
|
+
if (!(i.getUTCFullYear() !== t || i.getUTCMonth() !== s - 1 || i.getUTCDate() !== e))
|
|
1024
|
+
return { year: t, month: s, day: e };
|
|
1043
1025
|
}
|
|
1044
1026
|
function N(r) {
|
|
1045
1027
|
const t = F(r);
|
|
1046
1028
|
return t ? new Date(Date.UTC(t.year, t.month - 1, t.day)) : undefined;
|
|
1047
1029
|
}
|
|
1048
|
-
function
|
|
1049
|
-
const i =
|
|
1050
|
-
return r === "year" ? { min: i?.year ?? 1, max: n?.year ?? 9999 } : r === "month" ? { min: i && t.year === i.year ? i.month : 1, max: n && t.year === n.year ? n.month : 12 } : { min: i && t.year === i.year && t.month === i.month ? i.day : 1, max: n && t.year === n.year && t.month === n.month ? n.day :
|
|
1030
|
+
function st(r, t, s, e) {
|
|
1031
|
+
const i = s ? { year: s.getUTCFullYear(), month: s.getUTCMonth() + 1, day: s.getUTCDate() } : null, n = e ? { year: e.getUTCFullYear(), month: e.getUTCMonth() + 1, day: e.getUTCDate() } : null;
|
|
1032
|
+
return r === "year" ? { min: i?.year ?? 1, max: n?.year ?? 9999 } : r === "month" ? { min: i && t.year === i.year ? i.month : 1, max: n && t.year === n.year ? n.month : 12 } : { min: i && t.year === i.year && t.month === i.month ? i.day : 1, max: n && t.year === n.year && t.month === n.month ? n.day : U(t.year, t.month) };
|
|
1051
1033
|
}
|
|
1052
|
-
var import_sisteransi,
|
|
1034
|
+
var import_sisteransi, G, K, h, Y, k, A = (r) => ("columns" in r) && typeof r.columns == "number" ? r.columns : 80, L = (r) => ("rows" in r) && typeof r.rows == "number" ? r.rows : 20, m = class {
|
|
1053
1035
|
input;
|
|
1054
1036
|
output;
|
|
1055
1037
|
_abortSignal;
|
|
@@ -1064,27 +1046,27 @@ var import_sisteransi, E, G, u, Y, C, O = (r) => ("columns" in r) && typeof r.co
|
|
|
1064
1046
|
error = "";
|
|
1065
1047
|
value;
|
|
1066
1048
|
userInput = "";
|
|
1067
|
-
constructor(t,
|
|
1068
|
-
const { input:
|
|
1069
|
-
this.opts =
|
|
1049
|
+
constructor(t, s = true) {
|
|
1050
|
+
const { input: e = D, output: i = x, render: n, signal: o, ...u } = t;
|
|
1051
|
+
this.opts = u, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = n.bind(this), this._track = s, this._abortSignal = o, this.input = e, this.output = i;
|
|
1070
1052
|
}
|
|
1071
1053
|
unsubscribe() {
|
|
1072
1054
|
this._subscribers.clear();
|
|
1073
1055
|
}
|
|
1074
|
-
setSubscriber(t,
|
|
1075
|
-
const
|
|
1076
|
-
|
|
1056
|
+
setSubscriber(t, s) {
|
|
1057
|
+
const e = this._subscribers.get(t) ?? [];
|
|
1058
|
+
e.push(s), this._subscribers.set(t, e);
|
|
1077
1059
|
}
|
|
1078
|
-
on(t,
|
|
1079
|
-
this.setSubscriber(t, { cb:
|
|
1060
|
+
on(t, s) {
|
|
1061
|
+
this.setSubscriber(t, { cb: s });
|
|
1080
1062
|
}
|
|
1081
|
-
once(t,
|
|
1082
|
-
this.setSubscriber(t, { cb:
|
|
1063
|
+
once(t, s) {
|
|
1064
|
+
this.setSubscriber(t, { cb: s, once: true });
|
|
1083
1065
|
}
|
|
1084
|
-
emit(t, ...
|
|
1085
|
-
const
|
|
1086
|
-
for (const n of
|
|
1087
|
-
n.cb(...
|
|
1066
|
+
emit(t, ...s) {
|
|
1067
|
+
const e = this._subscribers.get(t) ?? [], i = [];
|
|
1068
|
+
for (const n of e)
|
|
1069
|
+
n.cb(...s), n.once && i.push(() => e.splice(e.indexOf(n), 1));
|
|
1088
1070
|
for (const n of i)
|
|
1089
1071
|
n();
|
|
1090
1072
|
}
|
|
@@ -1092,39 +1074,42 @@ var import_sisteransi, E, G, u, Y, C, O = (r) => ("columns" in r) && typeof r.co
|
|
|
1092
1074
|
return new Promise((t) => {
|
|
1093
1075
|
if (this._abortSignal) {
|
|
1094
1076
|
if (this._abortSignal.aborted)
|
|
1095
|
-
return this.state = "cancel", this.close(), t(
|
|
1077
|
+
return this.state = "cancel", this.close(), t(k);
|
|
1096
1078
|
this._abortSignal.addEventListener("abort", () => {
|
|
1097
1079
|
this.state = "cancel", this.close();
|
|
1098
1080
|
}, { once: true });
|
|
1099
1081
|
}
|
|
1100
|
-
this.rl =
|
|
1082
|
+
this.rl = E.createInterface({ input: this.input, tabSize: 2, prompt: "", escapeCodeTimeout: 50, terminal: true }), this.rl.prompt(), this.opts.initialUserInput !== undefined && this._setUserInput(this.opts.initialUserInput, true), this.input.on("keypress", this.onKeypress), w(this.input, true), this.output.on("resize", this.render), this.render(), this.once("submit", () => {
|
|
1101
1083
|
this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), w(this.input, false), t(this.value);
|
|
1102
1084
|
}), this.once("cancel", () => {
|
|
1103
|
-
this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), w(this.input, false), t(
|
|
1085
|
+
this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), w(this.input, false), t(k);
|
|
1104
1086
|
});
|
|
1105
1087
|
});
|
|
1106
1088
|
}
|
|
1107
|
-
_isActionKey(t,
|
|
1089
|
+
_isActionKey(t, s) {
|
|
1108
1090
|
return t === "\t";
|
|
1109
1091
|
}
|
|
1092
|
+
_shouldSubmit(t, s) {
|
|
1093
|
+
return true;
|
|
1094
|
+
}
|
|
1110
1095
|
_setValue(t) {
|
|
1111
1096
|
this.value = t, this.emit("value", this.value);
|
|
1112
1097
|
}
|
|
1113
|
-
_setUserInput(t,
|
|
1114
|
-
this.userInput = t ?? "", this.emit("userInput", this.userInput),
|
|
1098
|
+
_setUserInput(t, s) {
|
|
1099
|
+
this.userInput = t ?? "", this.emit("userInput", this.userInput), s && this._track && this.rl && (this.rl.write(this.userInput), this._cursor = this.rl.cursor);
|
|
1115
1100
|
}
|
|
1116
1101
|
_clearUserInput() {
|
|
1117
1102
|
this.rl?.write(null, { ctrl: true, name: "u" }), this._setUserInput("");
|
|
1118
1103
|
}
|
|
1119
|
-
onKeypress(t,
|
|
1120
|
-
if (this._track &&
|
|
1104
|
+
onKeypress(t, s) {
|
|
1105
|
+
if (this._track && s.name !== "return" && (s.name && this._isActionKey(t, s) && this.rl?.write(null, { ctrl: true, name: "h" }), this._cursor = this.rl?.cursor ?? 0, this._setUserInput(this.rl?.line)), this.state === "error" && (this.state = "active"), s?.name && (!this._track && h.aliases.has(s.name) && this.emit("cursor", h.aliases.get(s.name)), h.actions.has(s.name) && this.emit("cursor", s.name)), t && (t.toLowerCase() === "y" || t.toLowerCase() === "n") && this.emit("confirm", t.toLowerCase() === "y"), this.emit("key", t?.toLowerCase(), s), s?.name === "return" && this._shouldSubmit(t, s)) {
|
|
1121
1106
|
if (this.opts.validate) {
|
|
1122
|
-
const
|
|
1123
|
-
|
|
1107
|
+
const e = this.opts.validate(this.value);
|
|
1108
|
+
e && (this.error = e instanceof Error ? e.message : e, this.state = "error", this.rl?.write(this.userInput));
|
|
1124
1109
|
}
|
|
1125
1110
|
this.state !== "error" && (this.state = "submit");
|
|
1126
1111
|
}
|
|
1127
|
-
|
|
1112
|
+
C([t, s?.name, s?.sequence], "cancel") && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close();
|
|
1128
1113
|
}
|
|
1129
1114
|
close() {
|
|
1130
1115
|
this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write(`
|
|
@@ -1141,31 +1126,31 @@ var import_sisteransi, E, G, u, Y, C, O = (r) => ("columns" in r) && typeof r.co
|
|
|
1141
1126
|
if (this.state === "initial")
|
|
1142
1127
|
this.output.write(import_sisteransi.cursor.hide);
|
|
1143
1128
|
else {
|
|
1144
|
-
const
|
|
1145
|
-
if (this.restoreCursor(),
|
|
1146
|
-
const i = Math.max(0,
|
|
1147
|
-
let o =
|
|
1129
|
+
const s = z(this._prevFrame, t), e = L(this.output);
|
|
1130
|
+
if (this.restoreCursor(), s) {
|
|
1131
|
+
const i = Math.max(0, s.numLinesAfter - e), n = Math.max(0, s.numLinesBefore - e);
|
|
1132
|
+
let o = s.lines.find((u) => u >= i);
|
|
1148
1133
|
if (o === undefined) {
|
|
1149
1134
|
this._prevFrame = t;
|
|
1150
1135
|
return;
|
|
1151
1136
|
}
|
|
1152
|
-
if (
|
|
1137
|
+
if (s.lines.length === 1) {
|
|
1153
1138
|
this.output.write(import_sisteransi.cursor.move(0, o - n)), this.output.write(import_sisteransi.erase.lines(1));
|
|
1154
|
-
const
|
|
1139
|
+
const u = t.split(`
|
|
1155
1140
|
`);
|
|
1156
|
-
this.output.write(
|
|
1141
|
+
this.output.write(u[o]), this._prevFrame = t, this.output.write(import_sisteransi.cursor.move(0, u.length - o - 1));
|
|
1157
1142
|
return;
|
|
1158
|
-
} else if (
|
|
1143
|
+
} else if (s.lines.length > 1) {
|
|
1159
1144
|
if (i < n)
|
|
1160
1145
|
o = i;
|
|
1161
1146
|
else {
|
|
1162
|
-
const
|
|
1163
|
-
|
|
1147
|
+
const a = o - n;
|
|
1148
|
+
a > 0 && this.output.write(import_sisteransi.cursor.move(0, a));
|
|
1164
1149
|
}
|
|
1165
1150
|
this.output.write(import_sisteransi.erase.down());
|
|
1166
|
-
const
|
|
1151
|
+
const u = t.split(`
|
|
1167
1152
|
`).slice(o);
|
|
1168
|
-
this.output.write(
|
|
1153
|
+
this.output.write(u.join(`
|
|
1169
1154
|
`)), this._prevFrame = t;
|
|
1170
1155
|
return;
|
|
1171
1156
|
}
|
|
@@ -1175,82 +1160,82 @@ var import_sisteransi, E, G, u, Y, C, O = (r) => ("columns" in r) && typeof r.co
|
|
|
1175
1160
|
this.output.write(t), this.state === "initial" && (this.state = "active"), this._prevFrame = t;
|
|
1176
1161
|
}
|
|
1177
1162
|
}
|
|
1178
|
-
},
|
|
1163
|
+
}, Q, X, Z, et, it, rt, ut;
|
|
1179
1164
|
var init_dist3 = __esm(() => {
|
|
1180
1165
|
init_main();
|
|
1181
1166
|
import_sisteransi = __toESM(require_src(), 1);
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1167
|
+
G = ["up", "down", "left", "right", "space", "enter", "cancel"];
|
|
1168
|
+
K = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
|
|
1169
|
+
h = { actions: new Set(G), aliases: new Map([["k", "up"], ["j", "down"], ["h", "left"], ["l", "right"], ["\x03", "cancel"], ["escape", "cancel"]]), messages: { cancel: "Canceled", error: "Something went wrong" }, withGuide: true, date: { monthNames: [...K], messages: { required: "Please enter a valid date", invalidMonth: "There are only 12 months in a year", invalidDay: (r, t) => `There are only ${r} days in ${t}`, afterMin: (r) => `Date must be on or after ${r.toISOString().slice(0, 10)}`, beforeMax: (r) => `Date must be on or before ${r.toISOString().slice(0, 10)}` } } };
|
|
1185
1170
|
Y = globalThis.process.platform.startsWith("win");
|
|
1186
|
-
|
|
1187
|
-
|
|
1171
|
+
k = Symbol("clack:cancel");
|
|
1172
|
+
Q = class extends m {
|
|
1188
1173
|
filteredOptions;
|
|
1189
1174
|
multiple;
|
|
1190
1175
|
isNavigating = false;
|
|
1191
1176
|
selectedValues = [];
|
|
1192
1177
|
focusedValue;
|
|
1193
|
-
#
|
|
1194
|
-
#
|
|
1178
|
+
#s = 0;
|
|
1179
|
+
#r = "";
|
|
1195
1180
|
#t;
|
|
1196
1181
|
#n;
|
|
1197
|
-
#
|
|
1182
|
+
#u;
|
|
1198
1183
|
get cursor() {
|
|
1199
|
-
return this.#
|
|
1184
|
+
return this.#s;
|
|
1200
1185
|
}
|
|
1201
1186
|
get userInputWithCursor() {
|
|
1202
1187
|
if (!this.userInput)
|
|
1203
|
-
return
|
|
1188
|
+
return v(["inverse", "hidden"], "_");
|
|
1204
1189
|
if (this._cursor >= this.userInput.length)
|
|
1205
1190
|
return `${this.userInput}\u2588`;
|
|
1206
|
-
const t = this.userInput.slice(0, this._cursor), [
|
|
1207
|
-
return `${t}${
|
|
1191
|
+
const t = this.userInput.slice(0, this._cursor), [s, ...e] = this.userInput.slice(this._cursor);
|
|
1192
|
+
return `${t}${v("inverse", s)}${e.join("")}`;
|
|
1208
1193
|
}
|
|
1209
1194
|
get options() {
|
|
1210
1195
|
return typeof this.#n == "function" ? this.#n() : this.#n;
|
|
1211
1196
|
}
|
|
1212
1197
|
constructor(t) {
|
|
1213
|
-
super(t), this.#n = t.options, this.#
|
|
1214
|
-
const
|
|
1215
|
-
this.filteredOptions = [...
|
|
1216
|
-
let
|
|
1217
|
-
if (t.initialValue && Array.isArray(t.initialValue) ? this.multiple ?
|
|
1218
|
-
for (const i of
|
|
1219
|
-
const n =
|
|
1220
|
-
n !== -1 && (this.toggleSelected(i), this.#
|
|
1198
|
+
super(t), this.#n = t.options, this.#u = t.placeholder;
|
|
1199
|
+
const s = this.options;
|
|
1200
|
+
this.filteredOptions = [...s], this.multiple = t.multiple === true, this.#t = typeof t.options == "function" ? t.filter : t.filter ?? J;
|
|
1201
|
+
let e;
|
|
1202
|
+
if (t.initialValue && Array.isArray(t.initialValue) ? this.multiple ? e = t.initialValue : e = t.initialValue.slice(0, 1) : !this.multiple && this.options.length > 0 && (e = [this.options[0].value]), e)
|
|
1203
|
+
for (const i of e) {
|
|
1204
|
+
const n = s.findIndex((o) => o.value === i);
|
|
1205
|
+
n !== -1 && (this.toggleSelected(i), this.#s = n);
|
|
1221
1206
|
}
|
|
1222
|
-
this.focusedValue = this.options[this.#
|
|
1207
|
+
this.focusedValue = this.options[this.#s]?.value, this.on("key", (i, n) => this.#e(i, n)), this.on("userInput", (i) => this.#i(i));
|
|
1223
1208
|
}
|
|
1224
|
-
_isActionKey(t,
|
|
1225
|
-
return t === "\t" || this.multiple && this.isNavigating &&
|
|
1209
|
+
_isActionKey(t, s) {
|
|
1210
|
+
return t === "\t" || this.multiple && this.isNavigating && s.name === "space" && t !== undefined && t !== "";
|
|
1226
1211
|
}
|
|
1227
|
-
#
|
|
1228
|
-
const
|
|
1229
|
-
if (
|
|
1230
|
-
this.userInput === "\t" && this._clearUserInput(), this._setUserInput(
|
|
1212
|
+
#e(t, s) {
|
|
1213
|
+
const e = s.name === "up", i = s.name === "down", n = s.name === "return", o = this.userInput === "" || this.userInput === "\t", u = this.#u, a = this.options, l = u !== undefined && u !== "" && a.some((c) => !c.disabled && (this.#t ? this.#t(u, c) : true));
|
|
1214
|
+
if (s.name === "tab" && o && l) {
|
|
1215
|
+
this.userInput === "\t" && this._clearUserInput(), this._setUserInput(u, true), this.isNavigating = false;
|
|
1231
1216
|
return;
|
|
1232
1217
|
}
|
|
1233
|
-
|
|
1218
|
+
e || i ? (this.#s = f(this.#s, e ? -1 : 1, this.filteredOptions), this.focusedValue = this.filteredOptions[this.#s]?.value, this.multiple || (this.selectedValues = [this.focusedValue]), this.isNavigating = true) : n ? this.value = H(this.multiple, this.selectedValues) : this.multiple ? this.focusedValue !== undefined && (s.name === "tab" || this.isNavigating && s.name === "space") ? this.toggleSelected(this.focusedValue) : this.isNavigating = false : (this.focusedValue && (this.selectedValues = [this.focusedValue]), this.isNavigating = false);
|
|
1234
1219
|
}
|
|
1235
1220
|
deselectAll() {
|
|
1236
1221
|
this.selectedValues = [];
|
|
1237
1222
|
}
|
|
1238
1223
|
toggleSelected(t) {
|
|
1239
|
-
this.filteredOptions.length !== 0 && (this.multiple ? this.selectedValues.includes(t) ? this.selectedValues = this.selectedValues.filter((
|
|
1224
|
+
this.filteredOptions.length !== 0 && (this.multiple ? this.selectedValues.includes(t) ? this.selectedValues = this.selectedValues.filter((s) => s !== t) : this.selectedValues = [...this.selectedValues, t] : this.selectedValues = [t]);
|
|
1240
1225
|
}
|
|
1241
1226
|
#i(t) {
|
|
1242
|
-
if (t !== this.#
|
|
1243
|
-
this.#
|
|
1244
|
-
const
|
|
1245
|
-
t && this.#t ? this.filteredOptions =
|
|
1246
|
-
const
|
|
1247
|
-
this.#
|
|
1248
|
-
const i = this.filteredOptions[this.#
|
|
1227
|
+
if (t !== this.#r) {
|
|
1228
|
+
this.#r = t;
|
|
1229
|
+
const s = this.options;
|
|
1230
|
+
t && this.#t ? this.filteredOptions = s.filter((n) => this.#t?.(t, n)) : this.filteredOptions = [...s];
|
|
1231
|
+
const e = B(this.focusedValue, this.filteredOptions);
|
|
1232
|
+
this.#s = f(e, 0, this.filteredOptions);
|
|
1233
|
+
const i = this.filteredOptions[this.#s];
|
|
1249
1234
|
i && !i.disabled ? this.focusedValue = i.value : this.focusedValue = undefined, this.multiple || (this.focusedValue !== undefined ? this.toggleSelected(this.focusedValue) : this.deselectAll());
|
|
1250
1235
|
}
|
|
1251
1236
|
}
|
|
1252
1237
|
};
|
|
1253
|
-
|
|
1238
|
+
X = class X extends m {
|
|
1254
1239
|
get cursor() {
|
|
1255
1240
|
return this.value ? 0 : 1;
|
|
1256
1241
|
}
|
|
@@ -1260,66 +1245,66 @@ var init_dist3 = __esm(() => {
|
|
|
1260
1245
|
constructor(t) {
|
|
1261
1246
|
super(t, false), this.value = !!t.initialValue, this.on("userInput", () => {
|
|
1262
1247
|
this.value = this._value;
|
|
1263
|
-
}), this.on("confirm", (
|
|
1264
|
-
this.output.write(import_sisteransi.cursor.move(0, -1)), this.value =
|
|
1248
|
+
}), this.on("confirm", (s) => {
|
|
1249
|
+
this.output.write(import_sisteransi.cursor.move(0, -1)), this.value = s, this.state = "submit", this.close();
|
|
1265
1250
|
}), this.on("cursor", () => {
|
|
1266
1251
|
this.value = !this.value;
|
|
1267
1252
|
});
|
|
1268
1253
|
}
|
|
1269
1254
|
};
|
|
1270
|
-
|
|
1271
|
-
et = class et extends
|
|
1272
|
-
#
|
|
1273
|
-
#
|
|
1255
|
+
Z = { Y: { type: "year", len: 4 }, M: { type: "month", len: 2 }, D: { type: "day", len: 2 } };
|
|
1256
|
+
et = class et extends m {
|
|
1257
|
+
#s;
|
|
1258
|
+
#r;
|
|
1274
1259
|
#t;
|
|
1275
1260
|
#n;
|
|
1276
|
-
#
|
|
1277
|
-
#
|
|
1261
|
+
#u;
|
|
1262
|
+
#e = { segmentIndex: 0, positionInSegment: 0 };
|
|
1278
1263
|
#i = true;
|
|
1279
|
-
#
|
|
1264
|
+
#o = null;
|
|
1280
1265
|
inlineError = "";
|
|
1281
1266
|
get segmentCursor() {
|
|
1282
|
-
return { ...this.#
|
|
1267
|
+
return { ...this.#e };
|
|
1283
1268
|
}
|
|
1284
1269
|
get segmentValues() {
|
|
1285
1270
|
return { ...this.#t };
|
|
1286
1271
|
}
|
|
1287
1272
|
get segments() {
|
|
1288
|
-
return this.#
|
|
1273
|
+
return this.#s;
|
|
1289
1274
|
}
|
|
1290
1275
|
get separator() {
|
|
1291
|
-
return this.#
|
|
1276
|
+
return this.#r;
|
|
1292
1277
|
}
|
|
1293
1278
|
get formattedValue() {
|
|
1294
1279
|
return this.#c(this.#t);
|
|
1295
1280
|
}
|
|
1296
1281
|
#c(t) {
|
|
1297
|
-
return this.#
|
|
1282
|
+
return this.#s.map((s) => t[s.type]).join(this.#r);
|
|
1298
1283
|
}
|
|
1299
|
-
#
|
|
1284
|
+
#a() {
|
|
1300
1285
|
this._setUserInput(this.#c(this.#t)), this._setValue(N(this.#t) ?? undefined);
|
|
1301
1286
|
}
|
|
1302
1287
|
constructor(t) {
|
|
1303
|
-
const
|
|
1304
|
-
super({ ...t, initialUserInput:
|
|
1288
|
+
const s = t.format ? { segments: P(t.format), separator: t.separator ?? "/" } : tt(t.locale), e = t.separator ?? s.separator, i = t.format ? P(t.format) : s.segments, n = t.initialValue ?? t.defaultValue, o = n ? { year: String(n.getUTCFullYear()).padStart(4, "0"), month: String(n.getUTCMonth() + 1).padStart(2, "0"), day: String(n.getUTCDate()).padStart(2, "0") } : { year: "____", month: "__", day: "__" }, u = i.map((a) => o[a.type]).join(e);
|
|
1289
|
+
super({ ...t, initialUserInput: u }, false), this.#s = i, this.#r = e, this.#t = o, this.#n = t.minDate, this.#u = t.maxDate, this.#a(), this.on("cursor", (a) => this.#d(a)), this.on("key", (a, l) => this.#f(a, l)), this.on("finalize", () => this.#g(t));
|
|
1305
1290
|
}
|
|
1306
|
-
#
|
|
1307
|
-
const t = Math.max(0, Math.min(this.#
|
|
1308
|
-
if (
|
|
1309
|
-
return this.#
|
|
1291
|
+
#h() {
|
|
1292
|
+
const t = Math.max(0, Math.min(this.#e.segmentIndex, this.#s.length - 1)), s = this.#s[t];
|
|
1293
|
+
if (s)
|
|
1294
|
+
return this.#e.positionInSegment = Math.max(0, Math.min(this.#e.positionInSegment, s.len - 1)), { segment: s, index: t };
|
|
1310
1295
|
}
|
|
1311
1296
|
#l(t) {
|
|
1312
|
-
this.inlineError = "", this.#
|
|
1313
|
-
const
|
|
1314
|
-
|
|
1297
|
+
this.inlineError = "", this.#o = null;
|
|
1298
|
+
const s = this.#h();
|
|
1299
|
+
s && (this.#e.segmentIndex = Math.max(0, Math.min(this.#s.length - 1, s.index + t)), this.#e.positionInSegment = 0, this.#i = true);
|
|
1315
1300
|
}
|
|
1316
1301
|
#p(t) {
|
|
1317
|
-
const
|
|
1318
|
-
if (!
|
|
1302
|
+
const s = this.#h();
|
|
1303
|
+
if (!s)
|
|
1319
1304
|
return;
|
|
1320
|
-
const { segment:
|
|
1321
|
-
let
|
|
1322
|
-
n ?
|
|
1305
|
+
const { segment: e } = s, i = this.#t[e.type], n = !i || i.replace(/_/g, "") === "", o = Number.parseInt((i || "0").replace(/_/g, "0"), 10) || 0, u = st(e.type, S(this.#t), this.#n, this.#u);
|
|
1306
|
+
let a;
|
|
1307
|
+
n ? a = t === 1 ? u.min : u.max : a = Math.max(Math.min(u.max, o + t), u.min), this.#t = { ...this.#t, [e.type]: a.toString().padStart(e.len, "0") }, this.#i = true, this.#o = null, this.#a();
|
|
1323
1308
|
}
|
|
1324
1309
|
#d(t) {
|
|
1325
1310
|
if (t)
|
|
@@ -1334,123 +1319,123 @@ var init_dist3 = __esm(() => {
|
|
|
1334
1319
|
return this.#p(-1);
|
|
1335
1320
|
}
|
|
1336
1321
|
}
|
|
1337
|
-
#f(t,
|
|
1338
|
-
if (
|
|
1322
|
+
#f(t, s) {
|
|
1323
|
+
if (s?.name === "backspace" || s?.sequence === "\x7F" || s?.sequence === "\b" || t === "\x7F" || t === "\b") {
|
|
1339
1324
|
this.inlineError = "";
|
|
1340
|
-
const
|
|
1341
|
-
if (!
|
|
1325
|
+
const e = this.#h();
|
|
1326
|
+
if (!e)
|
|
1342
1327
|
return;
|
|
1343
|
-
if (!this.#t[
|
|
1328
|
+
if (!this.#t[e.segment.type].replace(/_/g, "")) {
|
|
1344
1329
|
this.#l(-1);
|
|
1345
1330
|
return;
|
|
1346
1331
|
}
|
|
1347
|
-
this.#t[
|
|
1332
|
+
this.#t[e.segment.type] = "_".repeat(e.segment.len), this.#i = true, this.#e.positionInSegment = 0, this.#a();
|
|
1348
1333
|
return;
|
|
1349
1334
|
}
|
|
1350
|
-
if (
|
|
1335
|
+
if (s?.name === "tab") {
|
|
1351
1336
|
this.inlineError = "";
|
|
1352
|
-
const
|
|
1353
|
-
if (!
|
|
1337
|
+
const e = this.#h();
|
|
1338
|
+
if (!e)
|
|
1354
1339
|
return;
|
|
1355
|
-
const i =
|
|
1356
|
-
n >= 0 && n < this.#
|
|
1340
|
+
const i = s.shift ? -1 : 1, n = e.index + i;
|
|
1341
|
+
n >= 0 && n < this.#s.length && (this.#e.segmentIndex = n, this.#e.positionInSegment = 0, this.#i = true);
|
|
1357
1342
|
return;
|
|
1358
1343
|
}
|
|
1359
1344
|
if (t && /^[0-9]$/.test(t)) {
|
|
1360
|
-
const
|
|
1361
|
-
if (!
|
|
1345
|
+
const e = this.#h();
|
|
1346
|
+
if (!e)
|
|
1362
1347
|
return;
|
|
1363
|
-
const { segment: i } =
|
|
1364
|
-
if (this.#i && this.#
|
|
1365
|
-
const
|
|
1366
|
-
if (
|
|
1367
|
-
this.inlineError =
|
|
1348
|
+
const { segment: i } = e, n = !this.#t[i.type].replace(/_/g, "");
|
|
1349
|
+
if (this.#i && this.#o !== null && !n) {
|
|
1350
|
+
const d = this.#o + t, g = { ...this.#t, [i.type]: d }, _ = this.#m(g, i);
|
|
1351
|
+
if (_) {
|
|
1352
|
+
this.inlineError = _, this.#o = null, this.#i = false;
|
|
1368
1353
|
return;
|
|
1369
1354
|
}
|
|
1370
|
-
this.inlineError = "", this.#t[i.type] =
|
|
1355
|
+
this.inlineError = "", this.#t[i.type] = d, this.#o = null, this.#i = false, this.#a(), e.index < this.#s.length - 1 && (this.#e.segmentIndex = e.index + 1, this.#e.positionInSegment = 0, this.#i = true);
|
|
1371
1356
|
return;
|
|
1372
1357
|
}
|
|
1373
|
-
this.#i && !n && (this.#t[i.type] = "_".repeat(i.len), this.#
|
|
1374
|
-
const o = this.#t[i.type],
|
|
1375
|
-
if (
|
|
1358
|
+
this.#i && !n && (this.#t[i.type] = "_".repeat(i.len), this.#e.positionInSegment = 0), this.#i = false, this.#o = null;
|
|
1359
|
+
const o = this.#t[i.type], u = o.indexOf("_"), a = u >= 0 ? u : Math.min(this.#e.positionInSegment, i.len - 1);
|
|
1360
|
+
if (a < 0 || a >= i.len)
|
|
1376
1361
|
return;
|
|
1377
|
-
let l = o.slice(0,
|
|
1378
|
-
if (
|
|
1379
|
-
const
|
|
1380
|
-
l = `0${t}`,
|
|
1362
|
+
let l = o.slice(0, a) + t + o.slice(a + 1), c = false;
|
|
1363
|
+
if (a === 0 && o === "__" && (i.type === "month" || i.type === "day")) {
|
|
1364
|
+
const d = Number.parseInt(t, 10);
|
|
1365
|
+
l = `0${t}`, c = d <= (i.type === "month" ? 1 : 2);
|
|
1381
1366
|
}
|
|
1382
1367
|
if (i.type === "year" && (l = (o.replace(/_/g, "") + t).padStart(i.len, "_")), !l.includes("_")) {
|
|
1383
|
-
const
|
|
1368
|
+
const d = { ...this.#t, [i.type]: l }, g = this.#m(d, i);
|
|
1384
1369
|
if (g) {
|
|
1385
1370
|
this.inlineError = g;
|
|
1386
1371
|
return;
|
|
1387
1372
|
}
|
|
1388
1373
|
}
|
|
1389
1374
|
this.inlineError = "", this.#t[i.type] = l;
|
|
1390
|
-
const
|
|
1391
|
-
if (
|
|
1392
|
-
const { year:
|
|
1393
|
-
this.#t = { year: String(Math.max(0, Math.min(9999,
|
|
1375
|
+
const y = l.includes("_") ? undefined : F(this.#t);
|
|
1376
|
+
if (y) {
|
|
1377
|
+
const { year: d, month: g } = y, _ = U(d, g);
|
|
1378
|
+
this.#t = { year: String(Math.max(0, Math.min(9999, d))).padStart(4, "0"), month: String(Math.max(1, Math.min(12, g))).padStart(2, "0"), day: String(Math.max(1, Math.min(_, y.day))).padStart(2, "0") };
|
|
1394
1379
|
}
|
|
1395
|
-
this.#
|
|
1396
|
-
const
|
|
1397
|
-
|
|
1380
|
+
this.#a();
|
|
1381
|
+
const T = l.indexOf("_");
|
|
1382
|
+
c ? (this.#i = true, this.#o = t) : T >= 0 ? this.#e.positionInSegment = T : u >= 0 && e.index < this.#s.length - 1 ? (this.#e.segmentIndex = e.index + 1, this.#e.positionInSegment = 0, this.#i = true) : this.#e.positionInSegment = Math.min(a + 1, i.len - 1);
|
|
1398
1383
|
}
|
|
1399
1384
|
}
|
|
1400
|
-
#m(t,
|
|
1401
|
-
const { month:
|
|
1402
|
-
if (
|
|
1403
|
-
return
|
|
1404
|
-
if (
|
|
1405
|
-
return
|
|
1385
|
+
#m(t, s) {
|
|
1386
|
+
const { month: e, day: i } = S(t);
|
|
1387
|
+
if (s.type === "month" && (e < 0 || e > 12))
|
|
1388
|
+
return h.date.messages.invalidMonth;
|
|
1389
|
+
if (s.type === "day" && (i < 0 || i > 31))
|
|
1390
|
+
return h.date.messages.invalidDay(31, "any month");
|
|
1406
1391
|
}
|
|
1407
1392
|
#g(t) {
|
|
1408
|
-
const { year:
|
|
1409
|
-
if (
|
|
1410
|
-
const n =
|
|
1393
|
+
const { year: s, month: e, day: i } = S(this.#t);
|
|
1394
|
+
if (s && e && i) {
|
|
1395
|
+
const n = U(s, e);
|
|
1411
1396
|
this.#t = { ...this.#t, day: String(Math.min(i, n)).padStart(2, "0") };
|
|
1412
1397
|
}
|
|
1413
1398
|
this.value = N(this.#t) ?? t.defaultValue ?? undefined;
|
|
1414
1399
|
}
|
|
1415
1400
|
};
|
|
1416
|
-
|
|
1401
|
+
it = class it extends m {
|
|
1417
1402
|
options;
|
|
1418
1403
|
cursor = 0;
|
|
1419
|
-
#
|
|
1404
|
+
#s;
|
|
1420
1405
|
getGroupItems(t) {
|
|
1421
|
-
return this.options.filter((
|
|
1406
|
+
return this.options.filter((s) => s.group === t);
|
|
1422
1407
|
}
|
|
1423
1408
|
isGroupSelected(t) {
|
|
1424
|
-
const
|
|
1425
|
-
return
|
|
1409
|
+
const s = this.getGroupItems(t), e = this.value;
|
|
1410
|
+
return e === undefined ? false : s.every((i) => e.includes(i.value));
|
|
1426
1411
|
}
|
|
1427
1412
|
toggleValue() {
|
|
1428
1413
|
const t = this.options[this.cursor];
|
|
1429
1414
|
if (this.value === undefined && (this.value = []), t.group === true) {
|
|
1430
|
-
const
|
|
1431
|
-
this.isGroupSelected(
|
|
1415
|
+
const s = t.value, e = this.getGroupItems(s);
|
|
1416
|
+
this.isGroupSelected(s) ? this.value = this.value.filter((i) => e.findIndex((n) => n.value === i) === -1) : this.value = [...this.value, ...e.map((i) => i.value)], this.value = Array.from(new Set(this.value));
|
|
1432
1417
|
} else {
|
|
1433
|
-
const
|
|
1434
|
-
this.value =
|
|
1418
|
+
const s = this.value.includes(t.value);
|
|
1419
|
+
this.value = s ? this.value.filter((e) => e !== t.value) : [...this.value, t.value];
|
|
1435
1420
|
}
|
|
1436
1421
|
}
|
|
1437
1422
|
constructor(t) {
|
|
1438
1423
|
super(t, false);
|
|
1439
|
-
const { options:
|
|
1440
|
-
this.#
|
|
1441
|
-
switch (
|
|
1424
|
+
const { options: s } = t;
|
|
1425
|
+
this.#s = t.selectableGroups !== false, this.options = Object.entries(s).flatMap(([e, i]) => [{ value: e, group: true, label: e }, ...i.map((n) => ({ ...n, group: e }))]), this.value = [...t.initialValues ?? []], this.cursor = Math.max(this.options.findIndex(({ value: e }) => e === t.cursorAt), this.#s ? 0 : 1), this.on("cursor", (e) => {
|
|
1426
|
+
switch (e) {
|
|
1442
1427
|
case "left":
|
|
1443
1428
|
case "up": {
|
|
1444
1429
|
this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
|
|
1445
1430
|
const i = this.options[this.cursor]?.group === true;
|
|
1446
|
-
!this.#
|
|
1431
|
+
!this.#s && i && (this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1);
|
|
1447
1432
|
break;
|
|
1448
1433
|
}
|
|
1449
1434
|
case "down":
|
|
1450
1435
|
case "right": {
|
|
1451
1436
|
this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
|
|
1452
1437
|
const i = this.options[this.cursor]?.group === true;
|
|
1453
|
-
!this.#
|
|
1438
|
+
!this.#s && i && (this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1);
|
|
1454
1439
|
break;
|
|
1455
1440
|
}
|
|
1456
1441
|
case "space":
|
|
@@ -1460,7 +1445,86 @@ var init_dist3 = __esm(() => {
|
|
|
1460
1445
|
});
|
|
1461
1446
|
}
|
|
1462
1447
|
};
|
|
1463
|
-
|
|
1448
|
+
rt = class rt extends m {
|
|
1449
|
+
#s = false;
|
|
1450
|
+
#r;
|
|
1451
|
+
focused = "editor";
|
|
1452
|
+
get userInputWithCursor() {
|
|
1453
|
+
if (this.state === "submit")
|
|
1454
|
+
return this.userInput;
|
|
1455
|
+
const t = this.userInput;
|
|
1456
|
+
if (this.cursor >= t.length)
|
|
1457
|
+
return `${t}\u2588`;
|
|
1458
|
+
const s = t.slice(0, this.cursor), e = t[this.cursor], i = t.slice(this.cursor + 1);
|
|
1459
|
+
return e === `
|
|
1460
|
+
` ? `${s}\u2588
|
|
1461
|
+
${i}` : `${s}${v("inverse", e)}${i}`;
|
|
1462
|
+
}
|
|
1463
|
+
get cursor() {
|
|
1464
|
+
return this._cursor;
|
|
1465
|
+
}
|
|
1466
|
+
#t(t) {
|
|
1467
|
+
if (this.userInput.length === 0) {
|
|
1468
|
+
this._setUserInput(t);
|
|
1469
|
+
return;
|
|
1470
|
+
}
|
|
1471
|
+
this._setUserInput(this.userInput.slice(0, this.cursor) + t + this.userInput.slice(this.cursor));
|
|
1472
|
+
}
|
|
1473
|
+
#n(t) {
|
|
1474
|
+
const s = this.value ?? "";
|
|
1475
|
+
switch (t) {
|
|
1476
|
+
case "up":
|
|
1477
|
+
this._cursor = I(this._cursor, 0, -1, s);
|
|
1478
|
+
return;
|
|
1479
|
+
case "down":
|
|
1480
|
+
this._cursor = I(this._cursor, 0, 1, s);
|
|
1481
|
+
return;
|
|
1482
|
+
case "left":
|
|
1483
|
+
this._cursor = I(this._cursor, -1, 0, s);
|
|
1484
|
+
return;
|
|
1485
|
+
case "right":
|
|
1486
|
+
this._cursor = I(this._cursor, 1, 0, s);
|
|
1487
|
+
return;
|
|
1488
|
+
}
|
|
1489
|
+
}
|
|
1490
|
+
_shouldSubmit(t, s) {
|
|
1491
|
+
if (this.#r)
|
|
1492
|
+
return this.focused === "submit" ? true : (this.#t(`
|
|
1493
|
+
`), this._cursor++, false);
|
|
1494
|
+
const e = this.#s;
|
|
1495
|
+
return this.#s = true, e ? (this.userInput[this.cursor - 1] === `
|
|
1496
|
+
` && (this._setUserInput(this.userInput.slice(0, this.cursor - 1) + this.userInput.slice(this.cursor)), this._cursor--), true) : (this.#t(`
|
|
1497
|
+
`), this._cursor++, false);
|
|
1498
|
+
}
|
|
1499
|
+
constructor(t) {
|
|
1500
|
+
super(t, false), this.#r = t.showSubmit ?? false, this.on("key", (s, e) => {
|
|
1501
|
+
if (e?.name && h.actions.has(e.name)) {
|
|
1502
|
+
this.#n(e.name);
|
|
1503
|
+
return;
|
|
1504
|
+
}
|
|
1505
|
+
if (s === "\t" && this.#r) {
|
|
1506
|
+
this.focused = this.focused === "editor" ? "submit" : "editor";
|
|
1507
|
+
return;
|
|
1508
|
+
}
|
|
1509
|
+
if (e?.name !== "return") {
|
|
1510
|
+
if (this.#s = false, e?.name === "backspace" && this.cursor > 0) {
|
|
1511
|
+
this._setUserInput(this.userInput.slice(0, this.cursor - 1) + this.userInput.slice(this.cursor)), this._cursor--;
|
|
1512
|
+
return;
|
|
1513
|
+
}
|
|
1514
|
+
if (e?.name === "delete" && this.cursor < this.userInput.length) {
|
|
1515
|
+
this._setUserInput(this.userInput.slice(0, this.cursor) + this.userInput.slice(this.cursor + 1));
|
|
1516
|
+
return;
|
|
1517
|
+
}
|
|
1518
|
+
s && (this.#r && this.focused === "submit" && (this.focused = "editor"), this.#t(s ?? ""), this._cursor++);
|
|
1519
|
+
}
|
|
1520
|
+
}), this.on("userInput", (s) => {
|
|
1521
|
+
this._setValue(s);
|
|
1522
|
+
}), this.on("finalize", () => {
|
|
1523
|
+
this.value || (this.value = t.defaultValue), this.value === undefined && (this.value = "");
|
|
1524
|
+
});
|
|
1525
|
+
}
|
|
1526
|
+
};
|
|
1527
|
+
ut = class ut extends m {
|
|
1464
1528
|
options;
|
|
1465
1529
|
cursor = 0;
|
|
1466
1530
|
get _selectedValue() {
|
|
@@ -1471,16 +1535,16 @@ var init_dist3 = __esm(() => {
|
|
|
1471
1535
|
}
|
|
1472
1536
|
constructor(t) {
|
|
1473
1537
|
super(t, false), this.options = t.options;
|
|
1474
|
-
const
|
|
1475
|
-
this.cursor = this.options[
|
|
1538
|
+
const s = this.options.findIndex(({ value: i }) => i === t.initialValue), e = s === -1 ? 0 : s;
|
|
1539
|
+
this.cursor = this.options[e].disabled ? f(e, 1, this.options) : e, this.changeValue(), this.on("cursor", (i) => {
|
|
1476
1540
|
switch (i) {
|
|
1477
1541
|
case "left":
|
|
1478
1542
|
case "up":
|
|
1479
|
-
this.cursor =
|
|
1543
|
+
this.cursor = f(this.cursor, -1, this.options);
|
|
1480
1544
|
break;
|
|
1481
1545
|
case "down":
|
|
1482
1546
|
case "right":
|
|
1483
|
-
this.cursor =
|
|
1547
|
+
this.cursor = f(this.cursor, 1, this.options);
|
|
1484
1548
|
break;
|
|
1485
1549
|
}
|
|
1486
1550
|
this.changeValue();
|
|
@@ -1489,227 +1553,230 @@ var init_dist3 = __esm(() => {
|
|
|
1489
1553
|
};
|
|
1490
1554
|
});
|
|
1491
1555
|
|
|
1492
|
-
// node_modules/.bun/@clack+prompts@1.
|
|
1493
|
-
import { styleText as
|
|
1494
|
-
import
|
|
1495
|
-
function
|
|
1496
|
-
return
|
|
1497
|
-
}
|
|
1498
|
-
var import_sisteransi2,
|
|
1499
|
-
switch (
|
|
1556
|
+
// node_modules/.bun/@clack+prompts@1.4.0/node_modules/@clack/prompts/dist/index.mjs
|
|
1557
|
+
import { styleText as e, stripVTControlCharacters as nt2 } from "util";
|
|
1558
|
+
import V2 from "process";
|
|
1559
|
+
function ee() {
|
|
1560
|
+
return V2.platform !== "win32" ? V2.env.TERM !== "linux" : !!V2.env.CI || !!V2.env.WT_SESSION || !!V2.env.TERMINUS_SUBLIME || V2.env.ConEmuTask === "{cmd::Cmder}" || V2.env.TERM_PROGRAM === "Terminus-Sublime" || V2.env.TERM_PROGRAM === "vscode" || V2.env.TERM === "xterm-256color" || V2.env.TERM === "alacritty" || V2.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
|
|
1561
|
+
}
|
|
1562
|
+
var import_sisteransi2, tt2, w2 = (t, i) => tt2 ? t : i, Tt, at2, ut2, H2, lt, $2, x2, _t, xt, z2, U2, et2, K2, Y2, Et, st2, ct, Gt, $t, dt, Mt, ht2, pt, mt, gt, P2 = (t) => {
|
|
1563
|
+
switch (t) {
|
|
1500
1564
|
case "initial":
|
|
1501
1565
|
case "active":
|
|
1502
|
-
return
|
|
1566
|
+
return e("cyan", Tt);
|
|
1503
1567
|
case "cancel":
|
|
1504
|
-
return
|
|
1568
|
+
return e("red", at2);
|
|
1505
1569
|
case "error":
|
|
1506
|
-
return
|
|
1570
|
+
return e("yellow", ut2);
|
|
1507
1571
|
case "submit":
|
|
1508
|
-
return
|
|
1572
|
+
return e("green", H2);
|
|
1509
1573
|
}
|
|
1510
|
-
},
|
|
1511
|
-
switch (
|
|
1574
|
+
}, yt = (t) => {
|
|
1575
|
+
switch (t) {
|
|
1512
1576
|
case "initial":
|
|
1513
1577
|
case "active":
|
|
1514
|
-
return
|
|
1578
|
+
return e("cyan", $2);
|
|
1515
1579
|
case "cancel":
|
|
1516
|
-
return
|
|
1580
|
+
return e("red", $2);
|
|
1517
1581
|
case "error":
|
|
1518
|
-
return
|
|
1582
|
+
return e("yellow", $2);
|
|
1519
1583
|
case "submit":
|
|
1520
|
-
return
|
|
1521
|
-
}
|
|
1522
|
-
},
|
|
1523
|
-
let
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1584
|
+
return e("green", $2);
|
|
1585
|
+
}
|
|
1586
|
+
}, Ot = (t, i, s, r, u, n = false) => {
|
|
1587
|
+
let a = i, c = 0;
|
|
1588
|
+
if (n)
|
|
1589
|
+
for (let o = r - 1;o >= s && (a -= t[o].length, c++, !(a <= u)); o--)
|
|
1590
|
+
;
|
|
1591
|
+
else
|
|
1592
|
+
for (let o = s;o < r && (a -= t[o].length, c++, !(a <= u)); o++)
|
|
1593
|
+
;
|
|
1594
|
+
return { lineCount: a, removals: c };
|
|
1595
|
+
}, F2 = ({ cursor: t, options: i, style: s, output: r = process.stdout, maxItems: u = Number.POSITIVE_INFINITY, columnPadding: n = 0, rowPadding: a = 4 }) => {
|
|
1596
|
+
const c = A(r) - n, o = L(r), l = e("dim", "..."), d = Math.max(o - a, 0), g = Math.max(Math.min(u, d), 5);
|
|
1532
1597
|
let p2 = 0;
|
|
1533
|
-
|
|
1534
|
-
let
|
|
1535
|
-
const
|
|
1536
|
-
let
|
|
1537
|
-
|
|
1538
|
-
const
|
|
1539
|
-
for (let b =
|
|
1540
|
-
const
|
|
1598
|
+
t >= g - 3 && (p2 = Math.max(Math.min(t - g + 3, i.length - g), 0));
|
|
1599
|
+
let f2 = g < i.length && p2 > 0, h2 = g < i.length && p2 + g < i.length;
|
|
1600
|
+
const I2 = Math.min(p2 + g, i.length), m2 = [];
|
|
1601
|
+
let y = 0;
|
|
1602
|
+
f2 && y++, h2 && y++;
|
|
1603
|
+
const v2 = p2 + (f2 ? 1 : 0), C2 = I2 - (h2 ? 1 : 0);
|
|
1604
|
+
for (let b = v2;b < C2; b++) {
|
|
1605
|
+
const G2 = wrapAnsi(s(i[b], b === t), c, { hard: true, trim: false }).split(`
|
|
1541
1606
|
`);
|
|
1542
|
-
|
|
1543
|
-
}
|
|
1544
|
-
if (
|
|
1545
|
-
let b = 0,
|
|
1546
|
-
const
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1607
|
+
m2.push(G2), y += G2.length;
|
|
1608
|
+
}
|
|
1609
|
+
if (y > d) {
|
|
1610
|
+
let b = 0, G2 = 0, M = y;
|
|
1611
|
+
const N2 = t - v2;
|
|
1612
|
+
let O = d;
|
|
1613
|
+
const j2 = () => Ot(m2, M, 0, N2, O), k2 = () => Ot(m2, M, N2 + 1, m2.length, O, true);
|
|
1614
|
+
f2 ? ({ lineCount: M, removals: b } = j2(), M > O && (h2 || (O -= 1), { lineCount: M, removals: G2 } = k2())) : (h2 || (O -= 1), { lineCount: M, removals: G2 } = k2(), M > O && (O -= 1, { lineCount: M, removals: b } = j2())), b > 0 && (f2 = true, m2.splice(0, b)), G2 > 0 && (h2 = true, m2.splice(m2.length - G2, G2));
|
|
1615
|
+
}
|
|
1616
|
+
const S2 = [];
|
|
1617
|
+
f2 && S2.push(l);
|
|
1618
|
+
for (const b of m2)
|
|
1619
|
+
for (const G2 of b)
|
|
1620
|
+
S2.push(G2);
|
|
1621
|
+
return h2 && S2.push(l), S2;
|
|
1622
|
+
}, ue = (t) => {
|
|
1623
|
+
const i = t.active ?? "Yes", s = t.inactive ?? "No";
|
|
1624
|
+
return new X({ active: i, inactive: s, signal: t.signal, input: t.input, output: t.output, initialValue: t.initialValue ?? true, render() {
|
|
1625
|
+
const r = t.withGuide ?? h.withGuide, u = `${P2(this.state)} `, n = r ? `${e("gray", $2)} ` : "", a = W(t.output, t.message, n, u), c = `${r ? `${e("gray", $2)}
|
|
1626
|
+
` : ""}${a}
|
|
1627
|
+
`, o = this.value ? i : s;
|
|
1561
1628
|
switch (this.state) {
|
|
1562
1629
|
case "submit": {
|
|
1563
|
-
const l = r ? `${
|
|
1564
|
-
return `${
|
|
1630
|
+
const l = r ? `${e("gray", $2)} ` : "";
|
|
1631
|
+
return `${c}${l}${e("dim", o)}`;
|
|
1565
1632
|
}
|
|
1566
1633
|
case "cancel": {
|
|
1567
|
-
const l = r ? `${
|
|
1568
|
-
return `${
|
|
1569
|
-
${
|
|
1634
|
+
const l = r ? `${e("gray", $2)} ` : "";
|
|
1635
|
+
return `${c}${l}${e(["strikethrough", "dim"], o)}${r ? `
|
|
1636
|
+
${e("gray", $2)}` : ""}`;
|
|
1570
1637
|
}
|
|
1571
1638
|
default: {
|
|
1572
|
-
const l = r ? `${
|
|
1573
|
-
return `${
|
|
1574
|
-
${
|
|
1575
|
-
` : ` ${
|
|
1576
|
-
${
|
|
1639
|
+
const l = r ? `${e("cyan", $2)} ` : "", d = r ? e("cyan", x2) : "";
|
|
1640
|
+
return `${c}${l}${this.value ? `${e("green", z2)} ${i}` : `${e("dim", U2)} ${e("dim", i)}`}${t.vertical ? r ? `
|
|
1641
|
+
${e("cyan", $2)} ` : `
|
|
1642
|
+
` : ` ${e("dim", "/")} `}${this.value ? `${e("dim", U2)} ${e("dim", s)}` : `${e("green", z2)} ${s}`}
|
|
1643
|
+
${d}
|
|
1577
1644
|
`;
|
|
1578
1645
|
}
|
|
1579
1646
|
}
|
|
1580
1647
|
} }).prompt();
|
|
1581
|
-
},
|
|
1582
|
-
const s = i?.output ?? process.stdout, r = i?.withGuide ??
|
|
1583
|
-
s.write(`${r}${
|
|
1648
|
+
}, R2, ge = (t = "", i) => {
|
|
1649
|
+
const s = i?.output ?? process.stdout, r = i?.withGuide ?? h.withGuide ? `${e("gray", lt)} ` : "";
|
|
1650
|
+
s.write(`${r}${t}
|
|
1584
1651
|
`);
|
|
1585
|
-
},
|
|
1586
|
-
const s = i?.output ?? process.stdout, r = i?.withGuide ??
|
|
1587
|
-
${
|
|
1588
|
-
s.write(`${r}${
|
|
1652
|
+
}, ye = (t = "", i) => {
|
|
1653
|
+
const s = i?.output ?? process.stdout, r = i?.withGuide ?? h.withGuide ? `${e("gray", $2)}
|
|
1654
|
+
${e("gray", x2)} ` : "";
|
|
1655
|
+
s.write(`${r}${t}
|
|
1589
1656
|
|
|
1590
1657
|
`);
|
|
1591
|
-
},
|
|
1592
|
-
const r = { hard: true, trim: false },
|
|
1593
|
-
`), n =
|
|
1594
|
-
return wrapAnsi(
|
|
1595
|
-
},
|
|
1596
|
-
const r = s?.output ??
|
|
1597
|
-
`).map(n), ""],
|
|
1598
|
-
const
|
|
1599
|
-
return
|
|
1600
|
-
}, 0),
|
|
1601
|
-
`),
|
|
1602
|
-
` : "",
|
|
1603
|
-
r.write(`${
|
|
1658
|
+
}, we = (t) => e("dim", t), be = (t, i, s) => {
|
|
1659
|
+
const r = { hard: true, trim: false }, u = wrapAnsi(t, i, r).split(`
|
|
1660
|
+
`), n = u.reduce((o, l) => Math.max(dist_default2(l), o), 0), a = u.map(s).reduce((o, l) => Math.max(dist_default2(l), o), 0), c = i - (a - n);
|
|
1661
|
+
return wrapAnsi(t, c, r);
|
|
1662
|
+
}, Se = (t = "", i = "", s) => {
|
|
1663
|
+
const r = s?.output ?? V2.stdout, u = s?.withGuide ?? h.withGuide, n = s?.format ?? we, a = ["", ...be(t, A(r) - 6, n).split(`
|
|
1664
|
+
`).map(n), ""], c = dist_default2(i), o = Math.max(a.reduce((p2, f2) => {
|
|
1665
|
+
const h2 = dist_default2(f2);
|
|
1666
|
+
return h2 > p2 ? h2 : p2;
|
|
1667
|
+
}, 0), c) + 2, l = a.map((p2) => `${e("gray", $2)} ${p2}${" ".repeat(o - dist_default2(p2))}${e("gray", $2)}`).join(`
|
|
1668
|
+
`), d = u ? `${e("gray", $2)}
|
|
1669
|
+
` : "", g = u ? Gt : dt;
|
|
1670
|
+
r.write(`${d}${e("green", H2)} ${e("reset", i)} ${e("gray", st2.repeat(Math.max(o - c - 1, 1)) + ct)}
|
|
1604
1671
|
${l}
|
|
1605
|
-
${
|
|
1672
|
+
${e("gray", g + st2.repeat(o + 2) + $t)}
|
|
1606
1673
|
`);
|
|
1607
|
-
},
|
|
1608
|
-
`) ?
|
|
1674
|
+
}, jt, it2 = (t, i) => t.includes(`
|
|
1675
|
+
`) ? t.split(`
|
|
1609
1676
|
`).map((s) => i(s)).join(`
|
|
1610
|
-
`) : i(
|
|
1677
|
+
`) : i(t), xe = (t) => {
|
|
1611
1678
|
const i = (s, r) => {
|
|
1612
|
-
const
|
|
1679
|
+
const u = s.label ?? String(s.value);
|
|
1613
1680
|
switch (r) {
|
|
1614
1681
|
case "disabled":
|
|
1615
|
-
return `${
|
|
1682
|
+
return `${e("gray", U2)} ${it2(u, (n) => e("gray", n))}${s.hint ? ` ${e("dim", `(${s.hint ?? "disabled"})`)}` : ""}`;
|
|
1616
1683
|
case "selected":
|
|
1617
|
-
return `${
|
|
1684
|
+
return `${it2(u, (n) => e("dim", n))}`;
|
|
1618
1685
|
case "active":
|
|
1619
|
-
return `${
|
|
1686
|
+
return `${e("green", z2)} ${u}${s.hint ? ` ${e("dim", `(${s.hint})`)}` : ""}`;
|
|
1620
1687
|
case "cancelled":
|
|
1621
|
-
return `${
|
|
1688
|
+
return `${it2(u, (n) => e(["strikethrough", "dim"], n))}`;
|
|
1622
1689
|
default:
|
|
1623
|
-
return `${
|
|
1690
|
+
return `${e("dim", U2)} ${it2(u, (n) => e("dim", n))}`;
|
|
1624
1691
|
}
|
|
1625
1692
|
};
|
|
1626
|
-
return new
|
|
1627
|
-
const s =
|
|
1693
|
+
return new ut({ options: t.options, signal: t.signal, input: t.input, output: t.output, initialValue: t.initialValue, render() {
|
|
1694
|
+
const s = t.withGuide ?? h.withGuide, r = `${P2(this.state)} `, u = `${yt(this.state)} `, n = W(t.output, t.message, u, r), a = `${s ? `${e("gray", $2)}
|
|
1628
1695
|
` : ""}${n}
|
|
1629
1696
|
`;
|
|
1630
1697
|
switch (this.state) {
|
|
1631
1698
|
case "submit": {
|
|
1632
|
-
const
|
|
1633
|
-
return `${
|
|
1699
|
+
const c = s ? `${e("gray", $2)} ` : "", o = W(t.output, i(this.options[this.cursor], "selected"), c);
|
|
1700
|
+
return `${a}${o}`;
|
|
1634
1701
|
}
|
|
1635
1702
|
case "cancel": {
|
|
1636
|
-
const
|
|
1637
|
-
return `${
|
|
1638
|
-
${
|
|
1703
|
+
const c = s ? `${e("gray", $2)} ` : "", o = W(t.output, i(this.options[this.cursor], "cancelled"), c);
|
|
1704
|
+
return `${a}${o}${s ? `
|
|
1705
|
+
${e("gray", $2)}` : ""}`;
|
|
1639
1706
|
}
|
|
1640
1707
|
default: {
|
|
1641
|
-
const
|
|
1642
|
-
`).length,
|
|
1643
|
-
return `${
|
|
1644
|
-
${
|
|
1645
|
-
${
|
|
1708
|
+
const c = s ? `${e("cyan", $2)} ` : "", o = s ? e("cyan", x2) : "", l = a.split(`
|
|
1709
|
+
`).length, d = s ? 2 : 1;
|
|
1710
|
+
return `${a}${c}${F2({ output: t.output, cursor: this.cursor, options: this.options, maxItems: t.maxItems, columnPadding: c.length, rowPadding: l + d, style: (g, p2) => i(g, g.disabled ? "disabled" : p2 ? "active" : "inactive") }).join(`
|
|
1711
|
+
${c}`)}
|
|
1712
|
+
${o}
|
|
1646
1713
|
`;
|
|
1647
1714
|
}
|
|
1648
1715
|
}
|
|
1649
1716
|
} }).prompt();
|
|
1650
|
-
},
|
|
1717
|
+
}, Nt;
|
|
1651
1718
|
var init_dist4 = __esm(() => {
|
|
1652
1719
|
init_dist3();
|
|
1653
1720
|
init_dist3();
|
|
1654
1721
|
init_main();
|
|
1655
1722
|
init_dist2();
|
|
1656
1723
|
import_sisteransi2 = __toESM(require_src(), 1);
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1724
|
+
tt2 = ee();
|
|
1725
|
+
Tt = w2("\u25C6", "*");
|
|
1726
|
+
at2 = w2("\u25A0", "x");
|
|
1727
|
+
ut2 = w2("\u25B2", "x");
|
|
1728
|
+
H2 = w2("\u25C7", "o");
|
|
1729
|
+
lt = w2("\u250C", "T");
|
|
1730
|
+
$2 = w2("\u2502", "|");
|
|
1731
|
+
x2 = w2("\u2514", "\u2014");
|
|
1732
|
+
_t = w2("\u2510", "T");
|
|
1733
|
+
xt = w2("\u2518", "\u2014");
|
|
1667
1734
|
z2 = w2("\u25CF", ">");
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
$
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
const
|
|
1685
|
-
for (let p2 = 0;p2 <
|
|
1686
|
-
|
|
1687
|
-
const
|
|
1735
|
+
U2 = w2("\u25CB", " ");
|
|
1736
|
+
et2 = w2("\u25FB", "[\u2022]");
|
|
1737
|
+
K2 = w2("\u25FC", "[+]");
|
|
1738
|
+
Y2 = w2("\u25FB", "[ ]");
|
|
1739
|
+
Et = w2("\u25AA", "\u2022");
|
|
1740
|
+
st2 = w2("\u2500", "-");
|
|
1741
|
+
ct = w2("\u256E", "+");
|
|
1742
|
+
Gt = w2("\u251C", "+");
|
|
1743
|
+
$t = w2("\u256F", "+");
|
|
1744
|
+
dt = w2("\u2570", "+");
|
|
1745
|
+
Mt = w2("\u256D", "+");
|
|
1746
|
+
ht2 = w2("\u25CF", "\u2022");
|
|
1747
|
+
pt = w2("\u25C6", "*");
|
|
1748
|
+
mt = w2("\u25B2", "!");
|
|
1749
|
+
gt = w2("\u25A0", "x");
|
|
1750
|
+
R2 = { message: (t = [], { symbol: i = e("gray", $2), secondarySymbol: s = e("gray", $2), output: r = process.stdout, spacing: u = 1, withGuide: n } = {}) => {
|
|
1751
|
+
const a = [], c = n ?? h.withGuide, o = c ? s : "", l = c ? `${i} ` : "", d = c ? `${s} ` : "";
|
|
1752
|
+
for (let p2 = 0;p2 < u; p2++)
|
|
1753
|
+
a.push(o);
|
|
1754
|
+
const g = Array.isArray(t) ? t : t.split(`
|
|
1688
1755
|
`);
|
|
1689
|
-
if (
|
|
1690
|
-
const [p2, ...
|
|
1691
|
-
p2.length > 0 ?
|
|
1692
|
-
for (const
|
|
1693
|
-
|
|
1756
|
+
if (g.length > 0) {
|
|
1757
|
+
const [p2, ...f2] = g;
|
|
1758
|
+
p2.length > 0 ? a.push(`${l}${p2}`) : a.push(c ? i : "");
|
|
1759
|
+
for (const h2 of f2)
|
|
1760
|
+
h2.length > 0 ? a.push(`${d}${h2}`) : a.push(c ? s : "");
|
|
1694
1761
|
}
|
|
1695
|
-
r.write(`${
|
|
1762
|
+
r.write(`${a.join(`
|
|
1696
1763
|
`)}
|
|
1697
1764
|
`);
|
|
1698
|
-
}, info: (
|
|
1699
|
-
|
|
1700
|
-
}, success: (
|
|
1701
|
-
|
|
1702
|
-
}, step: (
|
|
1703
|
-
|
|
1704
|
-
}, warn: (
|
|
1705
|
-
|
|
1706
|
-
}, warning: (
|
|
1707
|
-
|
|
1708
|
-
}, error: (
|
|
1709
|
-
|
|
1765
|
+
}, info: (t, i) => {
|
|
1766
|
+
R2.message(t, { ...i, symbol: e("blue", ht2) });
|
|
1767
|
+
}, success: (t, i) => {
|
|
1768
|
+
R2.message(t, { ...i, symbol: e("green", pt) });
|
|
1769
|
+
}, step: (t, i) => {
|
|
1770
|
+
R2.message(t, { ...i, symbol: e("green", H2) });
|
|
1771
|
+
}, warn: (t, i) => {
|
|
1772
|
+
R2.message(t, { ...i, symbol: e("yellow", mt) });
|
|
1773
|
+
}, warning: (t, i) => {
|
|
1774
|
+
R2.warn(t, i);
|
|
1775
|
+
}, error: (t, i) => {
|
|
1776
|
+
R2.message(t, { ...i, symbol: e("red", gt) });
|
|
1710
1777
|
} };
|
|
1711
|
-
|
|
1712
|
-
|
|
1778
|
+
jt = { light: w2("\u2500", "-"), heavy: w2("\u2501", "="), block: w2("\u2588", "#") };
|
|
1779
|
+
Nt = `${e("gray", $2)} `;
|
|
1713
1780
|
});
|
|
1714
1781
|
|
|
1715
1782
|
// bin/src/shared.ts
|
|
@@ -2432,21 +2499,21 @@ var init_init = __esm(async () => {
|
|
|
2432
2499
|
{ tool: "codex", required: false, hint: "Install the Codex CLI to let Codex scaffold .webmux.yaml" },
|
|
2433
2500
|
{ tool: "docker", required: false, hint: "https://docs.docker.com/get-started/get-docker/" }
|
|
2434
2501
|
];
|
|
2435
|
-
|
|
2502
|
+
ge("webmux init");
|
|
2436
2503
|
gitRoot = getGitRoot();
|
|
2437
2504
|
if (!gitRoot) {
|
|
2438
|
-
|
|
2439
|
-
|
|
2505
|
+
R2.error("Not inside a git repository. Run this from within a project.");
|
|
2506
|
+
ye("Aborted.");
|
|
2440
2507
|
process.exit(1);
|
|
2441
2508
|
}
|
|
2442
|
-
|
|
2443
|
-
|
|
2509
|
+
R2.success(`Git root: ${gitRoot}`);
|
|
2510
|
+
R2.step("Checking dependencies...");
|
|
2444
2511
|
missing = checkDeps();
|
|
2445
2512
|
if (missing.length > 0) {
|
|
2446
|
-
const lines = missing.map((
|
|
2513
|
+
const lines = missing.map((d) => ` ${d.tool}: ${d.hint}`).join(`
|
|
2447
2514
|
`);
|
|
2448
|
-
|
|
2449
|
-
|
|
2515
|
+
Se(lines, "Install these required dependencies, then re-run webmux init");
|
|
2516
|
+
ye("Setup incomplete.");
|
|
2450
2517
|
process.exit(1);
|
|
2451
2518
|
}
|
|
2452
2519
|
bunVersionResult = run("bun", ["--version"]);
|
|
@@ -2456,28 +2523,28 @@ var init_init = __esm(async () => {
|
|
|
2456
2523
|
const [reqMajor, reqMinor, reqPatch] = MIN_BUN_VERSION.split(".").map(Number);
|
|
2457
2524
|
const tooOld = major < reqMajor || major === reqMajor && minor < reqMinor || major === reqMajor && minor === reqMinor && patch < reqPatch;
|
|
2458
2525
|
if (tooOld) {
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2526
|
+
R2.error(`Bun ${bunVersion} is too old. webmux requires Bun >= ${MIN_BUN_VERSION}.`);
|
|
2527
|
+
R2.info("Upgrade with: bun upgrade");
|
|
2528
|
+
ye("Setup incomplete.");
|
|
2462
2529
|
process.exit(1);
|
|
2463
2530
|
}
|
|
2464
2531
|
}
|
|
2465
2532
|
if (which("gh")) {
|
|
2466
2533
|
const ghAuth = run("gh", ["auth", "status"]);
|
|
2467
2534
|
if (!ghAuth.success) {
|
|
2468
|
-
|
|
2535
|
+
R2.warning("gh is installed but not authenticated. Run: gh auth login");
|
|
2469
2536
|
} else {
|
|
2470
|
-
|
|
2537
|
+
R2.success("gh \u2014 authenticated");
|
|
2471
2538
|
}
|
|
2472
2539
|
}
|
|
2473
|
-
|
|
2540
|
+
R2.step("Checking config files...");
|
|
2474
2541
|
webmuxYaml = join4(gitRoot, ".webmux.yaml");
|
|
2475
2542
|
if (existsSync3(webmuxYaml)) {
|
|
2476
|
-
|
|
2543
|
+
R2.info(".webmux.yaml already exists, skipping");
|
|
2477
2544
|
} else {
|
|
2478
2545
|
const claudeAvailable = which("claude");
|
|
2479
2546
|
const codexAvailable = which("codex");
|
|
2480
|
-
const choice = await
|
|
2547
|
+
const choice = await xe({
|
|
2481
2548
|
message: "No .webmux.yaml found. How should webmux create it?",
|
|
2482
2549
|
initialValue: claudeAvailable ? "claude" : codexAvailable ? "codex" : "manual",
|
|
2483
2550
|
options: [
|
|
@@ -2501,7 +2568,7 @@ var init_init = __esm(async () => {
|
|
|
2501
2568
|
]
|
|
2502
2569
|
});
|
|
2503
2570
|
if (q(choice)) {
|
|
2504
|
-
|
|
2571
|
+
ye("Aborted.");
|
|
2505
2572
|
process.exit(1);
|
|
2506
2573
|
}
|
|
2507
2574
|
const selectedAgent = choice === "codex" ? "codex" : defaultTemplateAgent();
|
|
@@ -2513,7 +2580,7 @@ var init_init = __esm(async () => {
|
|
|
2513
2580
|
defaultAgent: context.defaultAgent,
|
|
2514
2581
|
packageManager: context.packageManager
|
|
2515
2582
|
}));
|
|
2516
|
-
|
|
2583
|
+
R2.success(".webmux.yaml starter template created");
|
|
2517
2584
|
} else {
|
|
2518
2585
|
const label = agentLabel(choice);
|
|
2519
2586
|
const starterTemplate = buildStarterTemplate({
|
|
@@ -2526,11 +2593,11 @@ var init_init = __esm(async () => {
|
|
|
2526
2593
|
const prompt = buildInitPromptSpec({ ...context, defaultAgent: choice });
|
|
2527
2594
|
const command = buildInitAgentCommand(choice, prompt);
|
|
2528
2595
|
const streamPrinter = createAgentStreamPrinter(label);
|
|
2529
|
-
|
|
2596
|
+
R2.step(`Running ${label} to adapt the starter .webmux.yaml...`);
|
|
2530
2597
|
const result = await runInitAgentCommand(command, gitRoot, { onEvent: streamPrinter.onEvent });
|
|
2531
2598
|
streamPrinter.finish();
|
|
2532
2599
|
if (!existsSync3(webmuxYaml)) {
|
|
2533
|
-
|
|
2600
|
+
R2.error(`${label} removed .webmux.yaml`);
|
|
2534
2601
|
const details = [
|
|
2535
2602
|
result.summary ? `Summary:
|
|
2536
2603
|
${result.summary}` : "",
|
|
@@ -2540,35 +2607,35 @@ ${result.stderr.trim()}` : ""
|
|
|
2540
2607
|
|
|
2541
2608
|
`);
|
|
2542
2609
|
if (details) {
|
|
2543
|
-
|
|
2610
|
+
Se(details, `${label} output`);
|
|
2544
2611
|
}
|
|
2545
|
-
|
|
2612
|
+
ye("Setup incomplete.");
|
|
2546
2613
|
process.exit(1);
|
|
2547
2614
|
}
|
|
2548
2615
|
const finalYaml = await Bun.file(webmuxYaml).text();
|
|
2549
2616
|
const changedTemplate = finalYaml !== starterTemplate;
|
|
2550
2617
|
if (result.exitCode === 0 && changedTemplate) {
|
|
2551
|
-
|
|
2618
|
+
R2.success(`${label} adapted .webmux.yaml`);
|
|
2552
2619
|
} else if (result.exitCode === 0) {
|
|
2553
|
-
|
|
2554
|
-
|
|
2620
|
+
R2.warning(`${label} left the starter template unchanged`);
|
|
2621
|
+
R2.warning(`${label} did not change the starter template. Review .webmux.yaml manually.`);
|
|
2555
2622
|
} else if (changedTemplate) {
|
|
2556
|
-
|
|
2557
|
-
|
|
2623
|
+
R2.warning(`${label} updated .webmux.yaml`);
|
|
2624
|
+
R2.warning(`${label} exited with code ${result.exitCode}. Review the generated file before using it.`);
|
|
2558
2625
|
} else {
|
|
2559
|
-
|
|
2560
|
-
|
|
2626
|
+
R2.warning(`${label} left the starter template in place`);
|
|
2627
|
+
R2.warning(`${label} exited with code ${result.exitCode}. The starter template is still there for manual editing.`);
|
|
2561
2628
|
}
|
|
2562
2629
|
if (result.summary && !streamPrinter.sawAssistantText()) {
|
|
2563
|
-
|
|
2630
|
+
Se(result.summary, `${label} summary`);
|
|
2564
2631
|
}
|
|
2565
2632
|
const trimmedStderr = result.stderr.trim();
|
|
2566
2633
|
if (trimmedStderr) {
|
|
2567
|
-
|
|
2634
|
+
Se(trimmedStderr, `${label} stderr`);
|
|
2568
2635
|
}
|
|
2569
2636
|
}
|
|
2570
2637
|
}
|
|
2571
|
-
|
|
2638
|
+
ye("You're all set! Next steps:");
|
|
2572
2639
|
console.log();
|
|
2573
2640
|
console.log(" 1. Review .webmux.yaml and adjust panes, ports, and profiles if needed");
|
|
2574
2641
|
console.log(" 2. Run: webmux");
|
|
@@ -2714,9 +2781,9 @@ function isInstalled(config) {
|
|
|
2714
2781
|
async function install(config) {
|
|
2715
2782
|
const filePath = serviceFilePath(config);
|
|
2716
2783
|
if (isInstalled(config)) {
|
|
2717
|
-
const reinstall = await
|
|
2784
|
+
const reinstall = await ue({ message: "Service is already installed. Reinstall?" });
|
|
2718
2785
|
if (q(reinstall) || !reinstall) {
|
|
2719
|
-
|
|
2786
|
+
R2.info("Aborted.");
|
|
2720
2787
|
return;
|
|
2721
2788
|
}
|
|
2722
2789
|
for (const cmd of uninstallCommands(config)) {
|
|
@@ -2725,77 +2792,77 @@ async function install(config) {
|
|
|
2725
2792
|
}
|
|
2726
2793
|
const content = generateServiceFile(config);
|
|
2727
2794
|
const commands = installCommands(config);
|
|
2728
|
-
|
|
2795
|
+
Se([
|
|
2729
2796
|
`File: ${filePath}`,
|
|
2730
2797
|
"",
|
|
2731
2798
|
"Contents:",
|
|
2732
2799
|
content,
|
|
2733
2800
|
"Commands to run:",
|
|
2734
|
-
...commands.map((
|
|
2801
|
+
...commands.map((c) => ` $ ${formatCommand(c)}`)
|
|
2735
2802
|
].join(`
|
|
2736
2803
|
`), "Install service");
|
|
2737
|
-
const ok = await
|
|
2804
|
+
const ok = await ue({ message: "Proceed?" });
|
|
2738
2805
|
if (q(ok) || !ok) {
|
|
2739
|
-
|
|
2806
|
+
R2.info("Aborted.");
|
|
2740
2807
|
return;
|
|
2741
2808
|
}
|
|
2742
2809
|
mkdirSync(filePath.substring(0, filePath.lastIndexOf("/")), { recursive: true });
|
|
2743
2810
|
await Bun.write(filePath, content);
|
|
2744
|
-
|
|
2811
|
+
R2.success(`Wrote ${filePath}`);
|
|
2745
2812
|
for (const cmd of commands) {
|
|
2746
2813
|
const result = runCommand(cmd);
|
|
2747
2814
|
if (!result.success) {
|
|
2748
|
-
|
|
2815
|
+
R2.error(`Command failed: ${formatCommand(cmd)}
|
|
2749
2816
|
${result.stderr.toString()}`);
|
|
2750
2817
|
return;
|
|
2751
2818
|
}
|
|
2752
|
-
|
|
2819
|
+
R2.success(`$ ${formatCommand(cmd)}`);
|
|
2753
2820
|
}
|
|
2754
|
-
|
|
2821
|
+
R2.success("Service installed and started!");
|
|
2755
2822
|
if (config.platform === "linux") {
|
|
2756
|
-
|
|
2823
|
+
Se(`To keep the service running after logout, run:
|
|
2757
2824
|
loginctl enable-linger $USER
|
|
2758
2825
|
|
|
2759
2826
|
(May require admin privileges on some systems.)`, "Tip");
|
|
2760
2827
|
}
|
|
2761
|
-
|
|
2762
|
-
|
|
2828
|
+
R2.info(`Check status: webmux service status`);
|
|
2829
|
+
R2.info(`View logs: webmux service logs`);
|
|
2763
2830
|
}
|
|
2764
2831
|
async function uninstall(config) {
|
|
2765
2832
|
const filePath = serviceFilePath(config);
|
|
2766
2833
|
if (!isInstalled(config)) {
|
|
2767
|
-
|
|
2834
|
+
R2.error("Service is not installed.");
|
|
2768
2835
|
return;
|
|
2769
2836
|
}
|
|
2770
2837
|
const commands = uninstallCommands(config);
|
|
2771
|
-
|
|
2838
|
+
Se([
|
|
2772
2839
|
`File to remove: ${filePath}`,
|
|
2773
2840
|
"",
|
|
2774
2841
|
"Commands to run:",
|
|
2775
|
-
...commands.map((
|
|
2842
|
+
...commands.map((c) => ` $ ${formatCommand(c)}`)
|
|
2776
2843
|
].join(`
|
|
2777
2844
|
`), "Uninstall service");
|
|
2778
|
-
const ok = await
|
|
2845
|
+
const ok = await ue({ message: "Proceed?" });
|
|
2779
2846
|
if (q(ok) || !ok) {
|
|
2780
|
-
|
|
2847
|
+
R2.info("Aborted.");
|
|
2781
2848
|
return;
|
|
2782
2849
|
}
|
|
2783
2850
|
for (const cmd of commands) {
|
|
2784
2851
|
const result = runCommand(cmd);
|
|
2785
2852
|
if (!result.success) {
|
|
2786
|
-
|
|
2853
|
+
R2.warning(`Command failed: ${formatCommand(cmd)}
|
|
2787
2854
|
${result.stderr.toString()}`);
|
|
2788
2855
|
} else {
|
|
2789
|
-
|
|
2856
|
+
R2.success(`$ ${formatCommand(cmd)}`);
|
|
2790
2857
|
}
|
|
2791
2858
|
}
|
|
2792
2859
|
unlinkSync(filePath);
|
|
2793
|
-
|
|
2794
|
-
|
|
2860
|
+
R2.success(`Removed ${filePath}`);
|
|
2861
|
+
R2.success("Service uninstalled.");
|
|
2795
2862
|
}
|
|
2796
2863
|
function status(config) {
|
|
2797
2864
|
if (!isInstalled(config)) {
|
|
2798
|
-
|
|
2865
|
+
R2.error("Service is not installed.");
|
|
2799
2866
|
return;
|
|
2800
2867
|
}
|
|
2801
2868
|
if (config.platform === "linux") {
|
|
@@ -2806,7 +2873,7 @@ function status(config) {
|
|
|
2806
2873
|
}
|
|
2807
2874
|
function logs(config) {
|
|
2808
2875
|
if (!isInstalled(config)) {
|
|
2809
|
-
|
|
2876
|
+
R2.error("Service is not installed.");
|
|
2810
2877
|
return;
|
|
2811
2878
|
}
|
|
2812
2879
|
let proc;
|
|
@@ -2815,7 +2882,7 @@ function logs(config) {
|
|
|
2815
2882
|
} else {
|
|
2816
2883
|
const logPath = join5(homedir(), "Library", "Logs", `webmux-${config.serviceName}.log`);
|
|
2817
2884
|
if (!existsSync4(logPath)) {
|
|
2818
|
-
|
|
2885
|
+
R2.error(`Log file not found: ${logPath}`);
|
|
2819
2886
|
return;
|
|
2820
2887
|
}
|
|
2821
2888
|
proc = Bun.spawn(["tail", "-f", logPath], {
|
|
@@ -2844,29 +2911,29 @@ async function service(args) {
|
|
|
2844
2911
|
return;
|
|
2845
2912
|
}
|
|
2846
2913
|
if (!["install", "uninstall", "status", "logs"].includes(action)) {
|
|
2847
|
-
|
|
2914
|
+
R2.error(`Unknown action: ${action}`);
|
|
2848
2915
|
usage();
|
|
2849
2916
|
return;
|
|
2850
2917
|
}
|
|
2851
2918
|
const platform = getPlatform();
|
|
2852
2919
|
if (!platform) {
|
|
2853
|
-
|
|
2920
|
+
R2.error(`Unsupported platform: ${process.platform}. Only linux and macOS are supported.`);
|
|
2854
2921
|
return;
|
|
2855
2922
|
}
|
|
2856
2923
|
const gitRoot2 = getGitRoot();
|
|
2857
2924
|
if (!gitRoot2) {
|
|
2858
|
-
|
|
2925
|
+
R2.error("Not inside a git repository.");
|
|
2859
2926
|
return;
|
|
2860
2927
|
}
|
|
2861
2928
|
const serviceManager = platform === "linux" ? "systemctl" : "launchctl";
|
|
2862
2929
|
const smResult = run("which", [serviceManager]);
|
|
2863
2930
|
if (!smResult.success) {
|
|
2864
|
-
|
|
2931
|
+
R2.error(`${serviceManager} not found. Cannot manage services on this system.`);
|
|
2865
2932
|
return;
|
|
2866
2933
|
}
|
|
2867
2934
|
const webmuxPath = resolveWebmuxPath();
|
|
2868
2935
|
if (!webmuxPath) {
|
|
2869
|
-
|
|
2936
|
+
R2.error("Could not find webmux in PATH.");
|
|
2870
2937
|
return;
|
|
2871
2938
|
}
|
|
2872
2939
|
let port = parseInt(process.env.PORT || "5111");
|
|
@@ -2874,7 +2941,7 @@ async function service(args) {
|
|
|
2874
2941
|
if (args[i] === "--port" && args[i + 1]) {
|
|
2875
2942
|
const parsed = parseInt(args[++i]);
|
|
2876
2943
|
if (Number.isNaN(parsed)) {
|
|
2877
|
-
|
|
2944
|
+
R2.error("--port requires a numeric value");
|
|
2878
2945
|
return;
|
|
2879
2946
|
}
|
|
2880
2947
|
port = parsed;
|
|
@@ -2912,8 +2979,8 @@ var init_service = __esm(() => {
|
|
|
2912
2979
|
|
|
2913
2980
|
// node_modules/.bun/zod@3.25.76/node_modules/zod/v3/helpers/util.js
|
|
2914
2981
|
var util, objectUtil, ZodParsedType, getParsedType = (data) => {
|
|
2915
|
-
const
|
|
2916
|
-
switch (
|
|
2982
|
+
const t = typeof data;
|
|
2983
|
+
switch (t) {
|
|
2917
2984
|
case "undefined":
|
|
2918
2985
|
return ZodParsedType.undefined;
|
|
2919
2986
|
case "string":
|
|
@@ -2977,8 +3044,8 @@ var init_util = __esm(() => {
|
|
|
2977
3044
|
return util2.objectValues(filtered);
|
|
2978
3045
|
};
|
|
2979
3046
|
util2.objectValues = (obj) => {
|
|
2980
|
-
return util2.objectKeys(obj).map(function(
|
|
2981
|
-
return obj[
|
|
3047
|
+
return util2.objectKeys(obj).map(function(e2) {
|
|
3048
|
+
return obj[e2];
|
|
2982
3049
|
});
|
|
2983
3050
|
};
|
|
2984
3051
|
util2.objectKeys = typeof Object.keys === "function" ? (obj) => Object.keys(obj) : (object) => {
|
|
@@ -3294,7 +3361,7 @@ function addIssueToContext(ctx, issueData) {
|
|
|
3294
3361
|
ctx.schemaErrorMap,
|
|
3295
3362
|
overrideMap,
|
|
3296
3363
|
overrideMap === en_default ? undefined : en_default
|
|
3297
|
-
].filter((
|
|
3364
|
+
].filter((x3) => !!x3)
|
|
3298
3365
|
});
|
|
3299
3366
|
ctx.common.issues.push(issue);
|
|
3300
3367
|
}
|
|
@@ -3368,7 +3435,7 @@ var makeIssue = (params) => {
|
|
|
3368
3435
|
};
|
|
3369
3436
|
}
|
|
3370
3437
|
let errorMessage2 = "";
|
|
3371
|
-
const maps = errorMaps.filter((
|
|
3438
|
+
const maps = errorMaps.filter((m2) => !!m2).slice().reverse();
|
|
3372
3439
|
for (const map of maps) {
|
|
3373
3440
|
errorMessage2 = map(fullIssue, { data, defaultError: errorMessage2 }).message;
|
|
3374
3441
|
}
|
|
@@ -3377,7 +3444,7 @@ var makeIssue = (params) => {
|
|
|
3377
3444
|
path: fullPath,
|
|
3378
3445
|
message: errorMessage2
|
|
3379
3446
|
};
|
|
3380
|
-
}, EMPTY_PATH, INVALID, DIRTY = (value) => ({ status: "dirty", value }), OK = (value) => ({ status: "valid", value }), isAborted = (
|
|
3447
|
+
}, EMPTY_PATH, INVALID, DIRTY = (value) => ({ status: "dirty", value }), OK = (value) => ({ status: "valid", value }), isAborted = (x3) => x3.status === "aborted", isDirty = (x3) => x3.status === "dirty", isValid = (x3) => x3.status === "valid", isAsync = (x3) => typeof Promise !== "undefined" && x3 instanceof Promise;
|
|
3381
3448
|
var init_parseUtil = __esm(() => {
|
|
3382
3449
|
init_errors();
|
|
3383
3450
|
init_en();
|
|
@@ -5781,7 +5848,7 @@ var init_types = __esm(() => {
|
|
|
5781
5848
|
if (!schema)
|
|
5782
5849
|
return null;
|
|
5783
5850
|
return schema._parse(new ParseInputLazyPath(ctx, item, ctx.path, itemIndex));
|
|
5784
|
-
}).filter((
|
|
5851
|
+
}).filter((x3) => !!x3);
|
|
5785
5852
|
if (ctx.common.async) {
|
|
5786
5853
|
return Promise.all(items).then((results) => {
|
|
5787
5854
|
return ParseStatus.mergeArray(status2, results);
|
|
@@ -6034,7 +6101,7 @@ var init_types = __esm(() => {
|
|
|
6034
6101
|
return makeIssue({
|
|
6035
6102
|
data: args,
|
|
6036
6103
|
path: ctx.path,
|
|
6037
|
-
errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, getErrorMap(), en_default].filter((
|
|
6104
|
+
errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, getErrorMap(), en_default].filter((x3) => !!x3),
|
|
6038
6105
|
issueData: {
|
|
6039
6106
|
code: ZodIssueCode.invalid_arguments,
|
|
6040
6107
|
argumentsError: error
|
|
@@ -6045,7 +6112,7 @@ var init_types = __esm(() => {
|
|
|
6045
6112
|
return makeIssue({
|
|
6046
6113
|
data: returns,
|
|
6047
6114
|
path: ctx.path,
|
|
6048
|
-
errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, getErrorMap(), en_default].filter((
|
|
6115
|
+
errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, getErrorMap(), en_default].filter((x3) => !!x3),
|
|
6049
6116
|
issueData: {
|
|
6050
6117
|
code: ZodIssueCode.invalid_return_type,
|
|
6051
6118
|
returnTypeError: error
|
|
@@ -6055,29 +6122,29 @@ var init_types = __esm(() => {
|
|
|
6055
6122
|
const params = { errorMap: ctx.common.contextualErrorMap };
|
|
6056
6123
|
const fn = ctx.data;
|
|
6057
6124
|
if (this._def.returns instanceof ZodPromise) {
|
|
6058
|
-
const
|
|
6125
|
+
const me = this;
|
|
6059
6126
|
return OK(async function(...args) {
|
|
6060
6127
|
const error = new ZodError([]);
|
|
6061
|
-
const parsedArgs = await
|
|
6062
|
-
error.addIssue(makeArgsIssue(args,
|
|
6128
|
+
const parsedArgs = await me._def.args.parseAsync(args, params).catch((e2) => {
|
|
6129
|
+
error.addIssue(makeArgsIssue(args, e2));
|
|
6063
6130
|
throw error;
|
|
6064
6131
|
});
|
|
6065
6132
|
const result = await Reflect.apply(fn, this, parsedArgs);
|
|
6066
|
-
const parsedReturns = await
|
|
6067
|
-
error.addIssue(makeReturnsIssue(result,
|
|
6133
|
+
const parsedReturns = await me._def.returns._def.type.parseAsync(result, params).catch((e2) => {
|
|
6134
|
+
error.addIssue(makeReturnsIssue(result, e2));
|
|
6068
6135
|
throw error;
|
|
6069
6136
|
});
|
|
6070
6137
|
return parsedReturns;
|
|
6071
6138
|
});
|
|
6072
6139
|
} else {
|
|
6073
|
-
const
|
|
6140
|
+
const me = this;
|
|
6074
6141
|
return OK(function(...args) {
|
|
6075
|
-
const parsedArgs =
|
|
6142
|
+
const parsedArgs = me._def.args.safeParse(args, params);
|
|
6076
6143
|
if (!parsedArgs.success) {
|
|
6077
6144
|
throw new ZodError([makeArgsIssue(args, parsedArgs.error)]);
|
|
6078
6145
|
}
|
|
6079
6146
|
const result = Reflect.apply(fn, this, parsedArgs.data);
|
|
6080
|
-
const parsedReturns =
|
|
6147
|
+
const parsedReturns = me._def.returns.safeParse(result, params);
|
|
6081
6148
|
if (!parsedReturns.success) {
|
|
6082
6149
|
throw new ZodError([makeReturnsIssue(result, parsedReturns.error)]);
|
|
6083
6150
|
}
|
|
@@ -6876,7 +6943,7 @@ var init_zod = __esm(() => {
|
|
|
6876
6943
|
init_external();
|
|
6877
6944
|
});
|
|
6878
6945
|
|
|
6879
|
-
// node_modules/.bun/@ts-rest+core@3.52.1+
|
|
6946
|
+
// node_modules/.bun/@ts-rest+core@3.52.1+1c8a9bbc689bc595/node_modules/@ts-rest/core/index.esm.mjs
|
|
6880
6947
|
var isZodType = (obj) => {
|
|
6881
6948
|
return typeof (obj === null || obj === undefined ? undefined : obj.safeParse) === "function";
|
|
6882
6949
|
}, isZodObjectStrict = (obj) => {
|
|
@@ -6963,7 +7030,7 @@ var isZodType = (obj) => {
|
|
|
6963
7030
|
}).join("&");
|
|
6964
7031
|
}, tokeniseValue = (key, value) => {
|
|
6965
7032
|
if (Array.isArray(value)) {
|
|
6966
|
-
return value.flatMap((
|
|
7033
|
+
return value.flatMap((v2, idx) => tokeniseValue(`${key}[${idx}]`, v2));
|
|
6967
7034
|
}
|
|
6968
7035
|
if (value instanceof Date) {
|
|
6969
7036
|
return [[`${key}`, value.toISOString()]];
|
|
@@ -7033,7 +7100,7 @@ var isZodType = (obj) => {
|
|
|
7033
7100
|
});
|
|
7034
7101
|
return formData;
|
|
7035
7102
|
}, normalizeHeaders = (headers) => {
|
|
7036
|
-
return Object.fromEntries(Object.entries(headers).map(([k2,
|
|
7103
|
+
return Object.fromEntries(Object.entries(headers).map(([k2, v2]) => [k2.toLowerCase(), v2]));
|
|
7037
7104
|
}, fetchApi = (options) => {
|
|
7038
7105
|
const { path, clientArgs, route, body, query, extraInputArgs, headers, fetchOptions } = options;
|
|
7039
7106
|
const apiFetcher = clientArgs.api || tsRestFetchApi;
|
|
@@ -7190,7 +7257,7 @@ var init_index_esm = __esm(() => {
|
|
|
7190
7257
|
});
|
|
7191
7258
|
|
|
7192
7259
|
// packages/api-contract/src/schemas.ts
|
|
7193
|
-
var BooleanLikeSchema, ErrorResponseSchema, OkResponseSchema, EnabledResponseSchema, BuiltInAgentIdSchema, AgentIdSchema, WorktreeCreateModeSchema, AgentCapabilitiesSchema, AgentSummarySchema, AgentDetailsSchema, AgentListResponseSchema, UpsertCustomAgentRequestSchema, AgentResponseSchema, ValidateCustomAgentResponseSchema, WorktreeCreationPhaseSchema, AvailableBranchSchema, AvailableBranchesQuerySchema, NumberLikePathParamSchema, BranchListResponseSchema, CreateWorktreeRequestSchema, CreateWorktreeResponseSchema, SetWorktreeArchivedRequestSchema, SetWorktreeArchivedResponseSchema, ToggleEnabledRequestSchema, SendWorktreePromptRequestSchema, AgentsSendMessageRequestSchema, PullMainRequestSchema, PullMainStatusSchema, PullMainResponseSchema, ServiceStatusSchema, PrCommentSchema, CiCheckSchema, PrEntrySchema, LinearIssueLabelSchema, LinearIssueStateSchema, LinkedLinearIssueSchema, LinearIssueSchema, LinearIssueAvailabilitySchema, LinearIssuesResponseSchema, WorktreeCreationStateSchema, AppNotificationSchema, ProjectWorktreeSnapshotSchema, ProjectSnapshotSchema, WorktreeConversationProviderSchema, CodexWorktreeConversationRefSchema, ClaudeWorktreeConversationRefSchema, WorktreeConversationRefSchema, AgentsUiWorktreeSummarySchema, AgentsUiConversationMessageRoleSchema, AgentsUiConversationMessageStatusSchema, AgentsUiConversationMessageSchema, AgentsUiConversationStateSchema, AgentsUiWorktreeConversationResponseSchema, AgentsUiSendMessageResponseSchema, AgentsUiInterruptResponseSchema, AgentsUiConversationSnapshotEventSchema, AgentsUiConversationMessageDeltaEventSchema, AgentsUiConversationErrorEventSchema, AgentsUiConversationEventSchema, WorktreeListResponseSchema, UnpushedCommitSchema, WorktreeDiffResponseSchema, ServiceConfigSchema, ProfileConfigSchema, LinkedRepoInfoSchema, AppConfigSchema, CiLogsResponseSchema, WorktreeNameParamsSchema, NotificationIdParamsSchema, AgentIdParamsSchema, RunIdParamsSchema;
|
|
7260
|
+
var BooleanLikeSchema, ErrorResponseSchema, OkResponseSchema, EnabledResponseSchema, BuiltInAgentIdSchema, AgentIdSchema, WorktreeCreateModeSchema, AgentCapabilitiesSchema, AgentSummarySchema, AgentDetailsSchema, AgentListResponseSchema, UpsertCustomAgentRequestSchema, AgentResponseSchema, ValidateCustomAgentResponseSchema, WorktreeCreationPhaseSchema, AvailableBranchSchema, AvailableBranchesQuerySchema, NumberLikePathParamSchema, BranchListResponseSchema, CreateWorktreeRequestSchema, CreateWorktreeResponseSchema, SetWorktreeArchivedRequestSchema, SetWorktreeArchivedResponseSchema, SetWorktreeLabelRequestSchema, SetWorktreeLabelResponseSchema, ToggleEnabledRequestSchema, SendWorktreePromptRequestSchema, AgentsSendMessageRequestSchema, PullMainRequestSchema, PullMainStatusSchema, PullMainResponseSchema, ServiceStatusSchema, PrCommentSchema, CiCheckSchema, PrEntrySchema, LinearIssueLabelSchema, LinearIssueStateSchema, LinkedLinearIssueSchema, LinearIssueSchema, LinearIssueAvailabilitySchema, LinearIssuesResponseSchema, WorktreeCreationStateSchema, AppNotificationSchema, ProjectWorktreeSnapshotSchema, ProjectSnapshotSchema, WorktreeConversationProviderSchema, CodexWorktreeConversationRefSchema, ClaudeWorktreeConversationRefSchema, WorktreeConversationRefSchema, AgentsUiWorktreeSummarySchema, AgentsUiConversationMessageRoleSchema, AgentsUiConversationMessageStatusSchema, AgentsUiConversationMessageSchema, AgentsUiConversationStateSchema, AgentsUiWorktreeConversationResponseSchema, AgentsUiSendMessageResponseSchema, AgentsUiInterruptResponseSchema, AgentsUiConversationSnapshotEventSchema, AgentsUiConversationMessageDeltaEventSchema, AgentsUiConversationErrorEventSchema, AgentsUiConversationEventSchema, WorktreeListResponseSchema, UnpushedCommitSchema, WorktreeDiffResponseSchema, ServiceConfigSchema, ProfileConfigSchema, LinkedRepoInfoSchema, AppConfigSchema, CiLogsResponseSchema, WorktreeNameParamsSchema, NotificationIdParamsSchema, AgentIdParamsSchema, RunIdParamsSchema;
|
|
7194
7261
|
var init_schemas = __esm(() => {
|
|
7195
7262
|
init_zod();
|
|
7196
7263
|
BooleanLikeSchema = exports_external.union([
|
|
@@ -7290,6 +7357,13 @@ var init_schemas = __esm(() => {
|
|
|
7290
7357
|
ok: exports_external.literal(true),
|
|
7291
7358
|
archived: exports_external.boolean()
|
|
7292
7359
|
});
|
|
7360
|
+
SetWorktreeLabelRequestSchema = exports_external.object({
|
|
7361
|
+
label: exports_external.string().trim().max(80).nullable()
|
|
7362
|
+
});
|
|
7363
|
+
SetWorktreeLabelResponseSchema = exports_external.object({
|
|
7364
|
+
ok: exports_external.literal(true),
|
|
7365
|
+
label: exports_external.string().nullable()
|
|
7366
|
+
});
|
|
7293
7367
|
ToggleEnabledRequestSchema = exports_external.object({
|
|
7294
7368
|
enabled: exports_external.boolean()
|
|
7295
7369
|
});
|
|
@@ -7399,6 +7473,7 @@ var init_schemas = __esm(() => {
|
|
|
7399
7473
|
});
|
|
7400
7474
|
ProjectWorktreeSnapshotSchema = exports_external.object({
|
|
7401
7475
|
branch: exports_external.string(),
|
|
7476
|
+
label: exports_external.string().nullable(),
|
|
7402
7477
|
baseBranch: exports_external.string().optional(),
|
|
7403
7478
|
path: exports_external.string(),
|
|
7404
7479
|
dir: exports_external.string(),
|
|
@@ -7573,11 +7648,11 @@ var init_schemas = __esm(() => {
|
|
|
7573
7648
|
});
|
|
7574
7649
|
|
|
7575
7650
|
// packages/api-contract/src/contract.ts
|
|
7576
|
-
var
|
|
7651
|
+
var c, apiPaths, commonErrorResponses, apiContract;
|
|
7577
7652
|
var init_contract = __esm(() => {
|
|
7578
7653
|
init_index_esm();
|
|
7579
7654
|
init_schemas();
|
|
7580
|
-
|
|
7655
|
+
c = initContract();
|
|
7581
7656
|
apiPaths = {
|
|
7582
7657
|
fetchConfig: "/api/config",
|
|
7583
7658
|
fetchAvailableBranches: "/api/branches",
|
|
@@ -7599,6 +7674,7 @@ var init_contract = __esm(() => {
|
|
|
7599
7674
|
openWorktree: "/api/worktrees/:name/open",
|
|
7600
7675
|
closeWorktree: "/api/worktrees/:name/close",
|
|
7601
7676
|
setWorktreeArchived: "/api/worktrees/:name/archive",
|
|
7677
|
+
setWorktreeLabel: "/api/worktrees/:name/label",
|
|
7602
7678
|
sendWorktreePrompt: "/api/worktrees/:name/send",
|
|
7603
7679
|
mergeWorktree: "/api/worktrees/:name/merge",
|
|
7604
7680
|
fetchWorktreeDiff: "/api/worktrees/:name/diff",
|
|
@@ -7617,7 +7693,7 @@ var init_contract = __esm(() => {
|
|
|
7617
7693
|
502: ErrorResponseSchema,
|
|
7618
7694
|
503: ErrorResponseSchema
|
|
7619
7695
|
};
|
|
7620
|
-
apiContract =
|
|
7696
|
+
apiContract = c.router({
|
|
7621
7697
|
fetchConfig: {
|
|
7622
7698
|
method: "GET",
|
|
7623
7699
|
path: apiPaths.fetchConfig,
|
|
@@ -7688,7 +7764,7 @@ var init_contract = __esm(() => {
|
|
|
7688
7764
|
method: "DELETE",
|
|
7689
7765
|
path: apiPaths.deleteAgent,
|
|
7690
7766
|
pathParams: AgentIdParamsSchema,
|
|
7691
|
-
body:
|
|
7767
|
+
body: c.noBody(),
|
|
7692
7768
|
responses: {
|
|
7693
7769
|
200: OkResponseSchema,
|
|
7694
7770
|
400: ErrorResponseSchema,
|
|
@@ -7710,7 +7786,7 @@ var init_contract = __esm(() => {
|
|
|
7710
7786
|
method: "POST",
|
|
7711
7787
|
path: apiPaths.attachAgentsWorktreeConversation,
|
|
7712
7788
|
pathParams: WorktreeNameParamsSchema,
|
|
7713
|
-
body:
|
|
7789
|
+
body: c.noBody(),
|
|
7714
7790
|
responses: {
|
|
7715
7791
|
200: AgentsUiWorktreeConversationResponseSchema,
|
|
7716
7792
|
...commonErrorResponses
|
|
@@ -7739,7 +7815,7 @@ var init_contract = __esm(() => {
|
|
|
7739
7815
|
method: "POST",
|
|
7740
7816
|
path: apiPaths.interruptAgentsWorktreeConversation,
|
|
7741
7817
|
pathParams: WorktreeNameParamsSchema,
|
|
7742
|
-
body:
|
|
7818
|
+
body: c.noBody(),
|
|
7743
7819
|
responses: {
|
|
7744
7820
|
200: AgentsUiInterruptResponseSchema,
|
|
7745
7821
|
...commonErrorResponses
|
|
@@ -7776,7 +7852,7 @@ var init_contract = __esm(() => {
|
|
|
7776
7852
|
method: "POST",
|
|
7777
7853
|
path: apiPaths.openWorktree,
|
|
7778
7854
|
pathParams: WorktreeNameParamsSchema,
|
|
7779
|
-
body:
|
|
7855
|
+
body: c.noBody(),
|
|
7780
7856
|
responses: {
|
|
7781
7857
|
200: OkResponseSchema,
|
|
7782
7858
|
...commonErrorResponses
|
|
@@ -7786,7 +7862,7 @@ var init_contract = __esm(() => {
|
|
|
7786
7862
|
method: "POST",
|
|
7787
7863
|
path: apiPaths.closeWorktree,
|
|
7788
7864
|
pathParams: WorktreeNameParamsSchema,
|
|
7789
|
-
body:
|
|
7865
|
+
body: c.noBody(),
|
|
7790
7866
|
responses: {
|
|
7791
7867
|
200: OkResponseSchema,
|
|
7792
7868
|
...commonErrorResponses
|
|
@@ -7802,6 +7878,16 @@ var init_contract = __esm(() => {
|
|
|
7802
7878
|
...commonErrorResponses
|
|
7803
7879
|
}
|
|
7804
7880
|
},
|
|
7881
|
+
setWorktreeLabel: {
|
|
7882
|
+
method: "PUT",
|
|
7883
|
+
path: apiPaths.setWorktreeLabel,
|
|
7884
|
+
pathParams: WorktreeNameParamsSchema,
|
|
7885
|
+
body: SetWorktreeLabelRequestSchema,
|
|
7886
|
+
responses: {
|
|
7887
|
+
200: SetWorktreeLabelResponseSchema,
|
|
7888
|
+
...commonErrorResponses
|
|
7889
|
+
}
|
|
7890
|
+
},
|
|
7805
7891
|
sendWorktreePrompt: {
|
|
7806
7892
|
method: "POST",
|
|
7807
7893
|
path: apiPaths.sendWorktreePrompt,
|
|
@@ -7816,7 +7902,7 @@ var init_contract = __esm(() => {
|
|
|
7816
7902
|
method: "POST",
|
|
7817
7903
|
path: apiPaths.mergeWorktree,
|
|
7818
7904
|
pathParams: WorktreeNameParamsSchema,
|
|
7819
|
-
body:
|
|
7905
|
+
body: c.noBody(),
|
|
7820
7906
|
responses: {
|
|
7821
7907
|
200: OkResponseSchema,
|
|
7822
7908
|
...commonErrorResponses
|
|
@@ -7880,7 +7966,7 @@ var init_contract = __esm(() => {
|
|
|
7880
7966
|
method: "POST",
|
|
7881
7967
|
path: apiPaths.dismissNotification,
|
|
7882
7968
|
pathParams: NotificationIdParamsSchema,
|
|
7883
|
-
body:
|
|
7969
|
+
body: c.noBody(),
|
|
7884
7970
|
responses: {
|
|
7885
7971
|
200: OkResponseSchema,
|
|
7886
7972
|
400: ErrorResponseSchema,
|
|
@@ -8147,11 +8233,22 @@ function normalizeConversationMeta(raw) {
|
|
|
8147
8233
|
};
|
|
8148
8234
|
return normalized;
|
|
8149
8235
|
}
|
|
8236
|
+
function normalizeOptionalString(raw) {
|
|
8237
|
+
return typeof raw === "string" && raw.trim() ? raw.trim() : undefined;
|
|
8238
|
+
}
|
|
8150
8239
|
function normalizeWorktreeMeta(meta) {
|
|
8151
8240
|
const conversation = normalizeConversationMeta(meta.conversation);
|
|
8152
|
-
|
|
8153
|
-
|
|
8154
|
-
|
|
8241
|
+
const normalizedLabel = normalizeOptionalString(meta.label);
|
|
8242
|
+
if (conversation === meta.conversation && normalizedLabel === meta.label) {
|
|
8243
|
+
return meta;
|
|
8244
|
+
}
|
|
8245
|
+
const rest = { ...meta };
|
|
8246
|
+
delete rest.label;
|
|
8247
|
+
delete rest.conversation;
|
|
8248
|
+
return {
|
|
8249
|
+
...rest,
|
|
8250
|
+
...normalizedLabel ? { label: normalizedLabel } : {},
|
|
8251
|
+
...conversation !== undefined ? { conversation } : {}
|
|
8155
8252
|
};
|
|
8156
8253
|
}
|
|
8157
8254
|
function isPrComment(raw) {
|
|
@@ -8370,7 +8467,7 @@ function pruneArchivedWorktreeState(input) {
|
|
|
8370
8467
|
}
|
|
8371
8468
|
var init_archive_service = () => {};
|
|
8372
8469
|
|
|
8373
|
-
// node_modules/.bun/yaml@2.
|
|
8470
|
+
// node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/nodes/identity.js
|
|
8374
8471
|
var require_identity = __commonJS((exports) => {
|
|
8375
8472
|
var ALIAS = Symbol.for("yaml.alias");
|
|
8376
8473
|
var DOC = Symbol.for("yaml.document");
|
|
@@ -8424,7 +8521,7 @@ var require_identity = __commonJS((exports) => {
|
|
|
8424
8521
|
exports.isSeq = isSeq;
|
|
8425
8522
|
});
|
|
8426
8523
|
|
|
8427
|
-
// node_modules/.bun/yaml@2.
|
|
8524
|
+
// node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/visit.js
|
|
8428
8525
|
var require_visit = __commonJS((exports) => {
|
|
8429
8526
|
var identity = require_identity();
|
|
8430
8527
|
var BREAK = Symbol("break visit");
|
|
@@ -8571,15 +8668,15 @@ var require_visit = __commonJS((exports) => {
|
|
|
8571
8668
|
} else if (identity.isDocument(parent)) {
|
|
8572
8669
|
parent.contents = node;
|
|
8573
8670
|
} else {
|
|
8574
|
-
const
|
|
8575
|
-
throw new Error(`Cannot replace node with ${
|
|
8671
|
+
const pt2 = identity.isAlias(parent) ? "alias" : "scalar";
|
|
8672
|
+
throw new Error(`Cannot replace node with ${pt2} parent`);
|
|
8576
8673
|
}
|
|
8577
8674
|
}
|
|
8578
8675
|
exports.visit = visit;
|
|
8579
8676
|
exports.visitAsync = visitAsync;
|
|
8580
8677
|
});
|
|
8581
8678
|
|
|
8582
|
-
// node_modules/.bun/yaml@2.
|
|
8679
|
+
// node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/doc/directives.js
|
|
8583
8680
|
var require_directives = __commonJS((exports) => {
|
|
8584
8681
|
var identity = require_identity();
|
|
8585
8682
|
var visit = require_visit();
|
|
@@ -8731,7 +8828,7 @@ var require_directives = __commonJS((exports) => {
|
|
|
8731
8828
|
exports.Directives = Directives;
|
|
8732
8829
|
});
|
|
8733
8830
|
|
|
8734
|
-
// node_modules/.bun/yaml@2.
|
|
8831
|
+
// node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/doc/anchors.js
|
|
8735
8832
|
var require_anchors = __commonJS((exports) => {
|
|
8736
8833
|
var identity = require_identity();
|
|
8737
8834
|
var visit = require_visit();
|
|
@@ -8793,7 +8890,7 @@ var require_anchors = __commonJS((exports) => {
|
|
|
8793
8890
|
exports.findNewAnchor = findNewAnchor;
|
|
8794
8891
|
});
|
|
8795
8892
|
|
|
8796
|
-
// node_modules/.bun/yaml@2.
|
|
8893
|
+
// node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/doc/applyReviver.js
|
|
8797
8894
|
var require_applyReviver = __commonJS((exports) => {
|
|
8798
8895
|
function applyReviver(reviver, obj, key, val) {
|
|
8799
8896
|
if (val && typeof val === "object") {
|
|
@@ -8840,12 +8937,12 @@ var require_applyReviver = __commonJS((exports) => {
|
|
|
8840
8937
|
exports.applyReviver = applyReviver;
|
|
8841
8938
|
});
|
|
8842
8939
|
|
|
8843
|
-
// node_modules/.bun/yaml@2.
|
|
8940
|
+
// node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/nodes/toJS.js
|
|
8844
8941
|
var require_toJS = __commonJS((exports) => {
|
|
8845
8942
|
var identity = require_identity();
|
|
8846
8943
|
function toJS(value, arg, ctx) {
|
|
8847
8944
|
if (Array.isArray(value))
|
|
8848
|
-
return value.map((
|
|
8945
|
+
return value.map((v2, i) => toJS(v2, String(i), ctx));
|
|
8849
8946
|
if (value && typeof value.toJSON === "function") {
|
|
8850
8947
|
if (!ctx || !identity.hasAnchor(value))
|
|
8851
8948
|
return value.toJSON(arg, ctx);
|
|
@@ -8867,7 +8964,7 @@ var require_toJS = __commonJS((exports) => {
|
|
|
8867
8964
|
exports.toJS = toJS;
|
|
8868
8965
|
});
|
|
8869
8966
|
|
|
8870
|
-
// node_modules/.bun/yaml@2.
|
|
8967
|
+
// node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/nodes/Node.js
|
|
8871
8968
|
var require_Node = __commonJS((exports) => {
|
|
8872
8969
|
var applyReviver = require_applyReviver();
|
|
8873
8970
|
var identity = require_identity();
|
|
@@ -8904,7 +9001,7 @@ var require_Node = __commonJS((exports) => {
|
|
|
8904
9001
|
exports.NodeBase = NodeBase;
|
|
8905
9002
|
});
|
|
8906
9003
|
|
|
8907
|
-
// node_modules/.bun/yaml@2.
|
|
9004
|
+
// node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/nodes/Alias.js
|
|
8908
9005
|
var require_Alias = __commonJS((exports) => {
|
|
8909
9006
|
var anchors = require_anchors();
|
|
8910
9007
|
var visit = require_visit();
|
|
@@ -8923,6 +9020,8 @@ var require_Alias = __commonJS((exports) => {
|
|
|
8923
9020
|
});
|
|
8924
9021
|
}
|
|
8925
9022
|
resolve(doc, ctx) {
|
|
9023
|
+
if (ctx?.maxAliasCount === 0)
|
|
9024
|
+
throw new ReferenceError("Alias resolution is disabled");
|
|
8926
9025
|
let nodes;
|
|
8927
9026
|
if (ctx?.aliasResolveCache) {
|
|
8928
9027
|
nodes = ctx.aliasResolveCache;
|
|
@@ -8997,9 +9096,9 @@ var require_Alias = __commonJS((exports) => {
|
|
|
8997
9096
|
} else if (identity.isCollection(node)) {
|
|
8998
9097
|
let count = 0;
|
|
8999
9098
|
for (const item of node.items) {
|
|
9000
|
-
const
|
|
9001
|
-
if (
|
|
9002
|
-
count =
|
|
9099
|
+
const c2 = getAliasCount(doc, item, anchors2);
|
|
9100
|
+
if (c2 > count)
|
|
9101
|
+
count = c2;
|
|
9003
9102
|
}
|
|
9004
9103
|
return count;
|
|
9005
9104
|
} else if (identity.isPair(node)) {
|
|
@@ -9012,7 +9111,7 @@ var require_Alias = __commonJS((exports) => {
|
|
|
9012
9111
|
exports.Alias = Alias;
|
|
9013
9112
|
});
|
|
9014
9113
|
|
|
9015
|
-
// node_modules/.bun/yaml@2.
|
|
9114
|
+
// node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/nodes/Scalar.js
|
|
9016
9115
|
var require_Scalar = __commonJS((exports) => {
|
|
9017
9116
|
var identity = require_identity();
|
|
9018
9117
|
var Node = require_Node();
|
|
@@ -9040,7 +9139,7 @@ var require_Scalar = __commonJS((exports) => {
|
|
|
9040
9139
|
exports.isScalarValue = isScalarValue;
|
|
9041
9140
|
});
|
|
9042
9141
|
|
|
9043
|
-
// node_modules/.bun/yaml@2.
|
|
9142
|
+
// node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/doc/createNode.js
|
|
9044
9143
|
var require_createNode = __commonJS((exports) => {
|
|
9045
9144
|
var Alias = require_Alias();
|
|
9046
9145
|
var identity = require_identity();
|
|
@@ -9048,13 +9147,13 @@ var require_createNode = __commonJS((exports) => {
|
|
|
9048
9147
|
var defaultTagPrefix = "tag:yaml.org,2002:";
|
|
9049
9148
|
function findTagObject(value, tagName, tags) {
|
|
9050
9149
|
if (tagName) {
|
|
9051
|
-
const match = tags.filter((
|
|
9052
|
-
const tagObj = match.find((
|
|
9150
|
+
const match = tags.filter((t) => t.tag === tagName);
|
|
9151
|
+
const tagObj = match.find((t) => !t.format) ?? match[0];
|
|
9053
9152
|
if (!tagObj)
|
|
9054
9153
|
throw new Error(`Tag ${tagName} not found`);
|
|
9055
9154
|
return tagObj;
|
|
9056
9155
|
}
|
|
9057
|
-
return tags.find((
|
|
9156
|
+
return tags.find((t) => t.identify?.(value) && !t.format);
|
|
9058
9157
|
}
|
|
9059
9158
|
function createNode(value, tagName, ctx) {
|
|
9060
9159
|
if (identity.isDocument(value))
|
|
@@ -9112,24 +9211,24 @@ var require_createNode = __commonJS((exports) => {
|
|
|
9112
9211
|
exports.createNode = createNode;
|
|
9113
9212
|
});
|
|
9114
9213
|
|
|
9115
|
-
// node_modules/.bun/yaml@2.
|
|
9214
|
+
// node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/nodes/Collection.js
|
|
9116
9215
|
var require_Collection = __commonJS((exports) => {
|
|
9117
9216
|
var createNode = require_createNode();
|
|
9118
9217
|
var identity = require_identity();
|
|
9119
9218
|
var Node = require_Node();
|
|
9120
9219
|
function collectionFromPath(schema, path, value) {
|
|
9121
|
-
let
|
|
9220
|
+
let v2 = value;
|
|
9122
9221
|
for (let i = path.length - 1;i >= 0; --i) {
|
|
9123
9222
|
const k2 = path[i];
|
|
9124
9223
|
if (typeof k2 === "number" && Number.isInteger(k2) && k2 >= 0) {
|
|
9125
9224
|
const a = [];
|
|
9126
|
-
a[k2] =
|
|
9127
|
-
|
|
9225
|
+
a[k2] = v2;
|
|
9226
|
+
v2 = a;
|
|
9128
9227
|
} else {
|
|
9129
|
-
|
|
9228
|
+
v2 = new Map([[k2, v2]]);
|
|
9130
9229
|
}
|
|
9131
9230
|
}
|
|
9132
|
-
return createNode.createNode(
|
|
9231
|
+
return createNode.createNode(v2, undefined, {
|
|
9133
9232
|
aliasDuplicateObjects: false,
|
|
9134
9233
|
keepUndefined: false,
|
|
9135
9234
|
onAnchor: () => {
|
|
@@ -9155,7 +9254,7 @@ var require_Collection = __commonJS((exports) => {
|
|
|
9155
9254
|
const copy = Object.create(Object.getPrototypeOf(this), Object.getOwnPropertyDescriptors(this));
|
|
9156
9255
|
if (schema)
|
|
9157
9256
|
copy.schema = schema;
|
|
9158
|
-
copy.items = copy.items.map((
|
|
9257
|
+
copy.items = copy.items.map((it3) => identity.isNode(it3) || identity.isPair(it3) ? it3.clone(schema) : it3);
|
|
9159
9258
|
if (this.range)
|
|
9160
9259
|
copy.range = this.range.slice();
|
|
9161
9260
|
return copy;
|
|
@@ -9227,7 +9326,7 @@ var require_Collection = __commonJS((exports) => {
|
|
|
9227
9326
|
exports.isEmptyPath = isEmptyPath;
|
|
9228
9327
|
});
|
|
9229
9328
|
|
|
9230
|
-
// node_modules/.bun/yaml@2.
|
|
9329
|
+
// node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/stringify/stringifyComment.js
|
|
9231
9330
|
var require_stringifyComment = __commonJS((exports) => {
|
|
9232
9331
|
var stringifyComment = (str) => str.replace(/^(?!$)(?: $)?/gm, "#");
|
|
9233
9332
|
function indentComment(comment, indent) {
|
|
@@ -9244,7 +9343,7 @@ var require_stringifyComment = __commonJS((exports) => {
|
|
|
9244
9343
|
exports.stringifyComment = stringifyComment;
|
|
9245
9344
|
});
|
|
9246
9345
|
|
|
9247
|
-
// node_modules/.bun/yaml@2.
|
|
9346
|
+
// node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/stringify/foldFlowLines.js
|
|
9248
9347
|
var require_foldFlowLines = __commonJS((exports) => {
|
|
9249
9348
|
var FOLD_FLOW = "flow";
|
|
9250
9349
|
var FOLD_BLOCK = "block";
|
|
@@ -9381,7 +9480,7 @@ ${indent}${text.slice(fold + 1, end2)}`;
|
|
|
9381
9480
|
exports.foldFlowLines = foldFlowLines;
|
|
9382
9481
|
});
|
|
9383
9482
|
|
|
9384
|
-
// node_modules/.bun/yaml@2.
|
|
9483
|
+
// node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/stringify/stringifyString.js
|
|
9385
9484
|
var require_stringifyString = __commonJS((exports) => {
|
|
9386
9485
|
var Scalar = require_Scalar();
|
|
9387
9486
|
var foldFlowLines = require_foldFlowLines();
|
|
@@ -9669,17 +9768,17 @@ ${indent}`);
|
|
|
9669
9768
|
let res = _stringify(type);
|
|
9670
9769
|
if (res === null) {
|
|
9671
9770
|
const { defaultKeyType, defaultStringType } = ctx.options;
|
|
9672
|
-
const
|
|
9673
|
-
res = _stringify(
|
|
9771
|
+
const t = implicitKey && defaultKeyType || defaultStringType;
|
|
9772
|
+
res = _stringify(t);
|
|
9674
9773
|
if (res === null)
|
|
9675
|
-
throw new Error(`Unsupported default string type ${
|
|
9774
|
+
throw new Error(`Unsupported default string type ${t}`);
|
|
9676
9775
|
}
|
|
9677
9776
|
return res;
|
|
9678
9777
|
}
|
|
9679
9778
|
exports.stringifyString = stringifyString;
|
|
9680
9779
|
});
|
|
9681
9780
|
|
|
9682
|
-
// node_modules/.bun/yaml@2.
|
|
9781
|
+
// node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/stringify/stringify.js
|
|
9683
9782
|
var require_stringify = __commonJS((exports) => {
|
|
9684
9783
|
var anchors = require_anchors();
|
|
9685
9784
|
var identity = require_identity();
|
|
@@ -9729,24 +9828,24 @@ var require_stringify = __commonJS((exports) => {
|
|
|
9729
9828
|
}
|
|
9730
9829
|
function getTagObject(tags, item) {
|
|
9731
9830
|
if (item.tag) {
|
|
9732
|
-
const match = tags.filter((
|
|
9831
|
+
const match = tags.filter((t) => t.tag === item.tag);
|
|
9733
9832
|
if (match.length > 0)
|
|
9734
|
-
return match.find((
|
|
9833
|
+
return match.find((t) => t.format === item.format) ?? match[0];
|
|
9735
9834
|
}
|
|
9736
9835
|
let tagObj = undefined;
|
|
9737
9836
|
let obj;
|
|
9738
9837
|
if (identity.isScalar(item)) {
|
|
9739
9838
|
obj = item.value;
|
|
9740
|
-
let match = tags.filter((
|
|
9839
|
+
let match = tags.filter((t) => t.identify?.(obj));
|
|
9741
9840
|
if (match.length > 1) {
|
|
9742
|
-
const testMatch = match.filter((
|
|
9841
|
+
const testMatch = match.filter((t) => t.test);
|
|
9743
9842
|
if (testMatch.length > 0)
|
|
9744
9843
|
match = testMatch;
|
|
9745
9844
|
}
|
|
9746
|
-
tagObj = match.find((
|
|
9845
|
+
tagObj = match.find((t) => t.format === item.format) ?? match.find((t) => !t.format);
|
|
9747
9846
|
} else {
|
|
9748
9847
|
obj = item;
|
|
9749
|
-
tagObj = tags.find((
|
|
9848
|
+
tagObj = tags.find((t) => t.nodeClass && obj instanceof t.nodeClass);
|
|
9750
9849
|
}
|
|
9751
9850
|
if (!tagObj) {
|
|
9752
9851
|
const name = obj?.constructor?.name ?? (obj === null ? "null" : typeof obj);
|
|
@@ -9800,7 +9899,7 @@ ${ctx.indent}${str}`;
|
|
|
9800
9899
|
exports.stringify = stringify;
|
|
9801
9900
|
});
|
|
9802
9901
|
|
|
9803
|
-
// node_modules/.bun/yaml@2.
|
|
9902
|
+
// node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/stringify/stringifyPair.js
|
|
9804
9903
|
var require_stringifyPair = __commonJS((exports) => {
|
|
9805
9904
|
var identity = require_identity();
|
|
9806
9905
|
var Scalar = require_Scalar();
|
|
@@ -9936,7 +10035,7 @@ ${ctx.indent}`;
|
|
|
9936
10035
|
exports.stringifyPair = stringifyPair;
|
|
9937
10036
|
});
|
|
9938
10037
|
|
|
9939
|
-
// node_modules/.bun/yaml@2.
|
|
10038
|
+
// node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/log.js
|
|
9940
10039
|
var require_log = __commonJS((exports) => {
|
|
9941
10040
|
var node_process = __require("process");
|
|
9942
10041
|
function debug(logLevel, ...messages) {
|
|
@@ -9955,7 +10054,7 @@ var require_log = __commonJS((exports) => {
|
|
|
9955
10054
|
exports.warn = warn;
|
|
9956
10055
|
});
|
|
9957
10056
|
|
|
9958
|
-
// node_modules/.bun/yaml@2.
|
|
10057
|
+
// node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/schema/yaml-1.1/merge.js
|
|
9959
10058
|
var require_merge = __commonJS((exports) => {
|
|
9960
10059
|
var identity = require_identity();
|
|
9961
10060
|
var Scalar = require_Scalar();
|
|
@@ -9972,18 +10071,18 @@ var require_merge = __commonJS((exports) => {
|
|
|
9972
10071
|
};
|
|
9973
10072
|
var isMergeKey = (ctx, key) => (merge.identify(key) || identity.isScalar(key) && (!key.type || key.type === Scalar.Scalar.PLAIN) && merge.identify(key.value)) && ctx?.doc.schema.tags.some((tag) => tag.tag === merge.tag && tag.default);
|
|
9974
10073
|
function addMergeToJSMap(ctx, map, value) {
|
|
9975
|
-
|
|
9976
|
-
if (identity.isSeq(
|
|
9977
|
-
for (const
|
|
9978
|
-
mergeValue(ctx, map,
|
|
9979
|
-
else if (Array.isArray(
|
|
9980
|
-
for (const
|
|
9981
|
-
mergeValue(ctx, map,
|
|
10074
|
+
const source = resolveAliasValue(ctx, value);
|
|
10075
|
+
if (identity.isSeq(source))
|
|
10076
|
+
for (const it3 of source.items)
|
|
10077
|
+
mergeValue(ctx, map, it3);
|
|
10078
|
+
else if (Array.isArray(source))
|
|
10079
|
+
for (const it3 of source)
|
|
10080
|
+
mergeValue(ctx, map, it3);
|
|
9982
10081
|
else
|
|
9983
|
-
mergeValue(ctx, map,
|
|
10082
|
+
mergeValue(ctx, map, source);
|
|
9984
10083
|
}
|
|
9985
10084
|
function mergeValue(ctx, map, value) {
|
|
9986
|
-
const source = ctx
|
|
10085
|
+
const source = resolveAliasValue(ctx, value);
|
|
9987
10086
|
if (!identity.isMap(source))
|
|
9988
10087
|
throw new Error("Merge sources must be maps or map aliases");
|
|
9989
10088
|
const srcMap = source.toJSON(null, ctx, Map);
|
|
@@ -10004,12 +10103,15 @@ var require_merge = __commonJS((exports) => {
|
|
|
10004
10103
|
}
|
|
10005
10104
|
return map;
|
|
10006
10105
|
}
|
|
10106
|
+
function resolveAliasValue(ctx, value) {
|
|
10107
|
+
return ctx && identity.isAlias(value) ? value.resolve(ctx.doc, ctx) : value;
|
|
10108
|
+
}
|
|
10007
10109
|
exports.addMergeToJSMap = addMergeToJSMap;
|
|
10008
10110
|
exports.isMergeKey = isMergeKey;
|
|
10009
10111
|
exports.merge = merge;
|
|
10010
10112
|
});
|
|
10011
10113
|
|
|
10012
|
-
// node_modules/.bun/yaml@2.
|
|
10114
|
+
// node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/nodes/addPairToJSMap.js
|
|
10013
10115
|
var require_addPairToJSMap = __commonJS((exports) => {
|
|
10014
10116
|
var log = require_log();
|
|
10015
10117
|
var merge = require_merge();
|
|
@@ -10070,7 +10172,7 @@ var require_addPairToJSMap = __commonJS((exports) => {
|
|
|
10070
10172
|
exports.addPairToJSMap = addPairToJSMap;
|
|
10071
10173
|
});
|
|
10072
10174
|
|
|
10073
|
-
// node_modules/.bun/yaml@2.
|
|
10175
|
+
// node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/nodes/Pair.js
|
|
10074
10176
|
var require_Pair = __commonJS((exports) => {
|
|
10075
10177
|
var createNode = require_createNode();
|
|
10076
10178
|
var stringifyPair = require_stringifyPair();
|
|
@@ -10078,8 +10180,8 @@ var require_Pair = __commonJS((exports) => {
|
|
|
10078
10180
|
var identity = require_identity();
|
|
10079
10181
|
function createPair(key, value, ctx) {
|
|
10080
10182
|
const k2 = createNode.createNode(key, undefined, ctx);
|
|
10081
|
-
const
|
|
10082
|
-
return new Pair(k2,
|
|
10183
|
+
const v2 = createNode.createNode(value, undefined, ctx);
|
|
10184
|
+
return new Pair(k2, v2);
|
|
10083
10185
|
}
|
|
10084
10186
|
|
|
10085
10187
|
class Pair {
|
|
@@ -10108,7 +10210,7 @@ var require_Pair = __commonJS((exports) => {
|
|
|
10108
10210
|
exports.createPair = createPair;
|
|
10109
10211
|
});
|
|
10110
10212
|
|
|
10111
|
-
// node_modules/.bun/yaml@2.
|
|
10213
|
+
// node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/stringify/stringifyCollection.js
|
|
10112
10214
|
var require_stringifyCollection = __commonJS((exports) => {
|
|
10113
10215
|
var identity = require_identity();
|
|
10114
10216
|
var stringify = require_stringify();
|
|
@@ -10260,7 +10362,7 @@ ${indent}${end}`;
|
|
|
10260
10362
|
exports.stringifyCollection = stringifyCollection;
|
|
10261
10363
|
});
|
|
10262
10364
|
|
|
10263
|
-
// node_modules/.bun/yaml@2.
|
|
10365
|
+
// node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/nodes/YAMLMap.js
|
|
10264
10366
|
var require_YAMLMap = __commonJS((exports) => {
|
|
10265
10367
|
var stringifyCollection = require_stringifyCollection();
|
|
10266
10368
|
var addPairToJSMap = require_addPairToJSMap();
|
|
@@ -10270,12 +10372,12 @@ var require_YAMLMap = __commonJS((exports) => {
|
|
|
10270
10372
|
var Scalar = require_Scalar();
|
|
10271
10373
|
function findPair(items, key) {
|
|
10272
10374
|
const k2 = identity.isScalar(key) ? key.value : key;
|
|
10273
|
-
for (const
|
|
10274
|
-
if (identity.isPair(
|
|
10275
|
-
if (
|
|
10276
|
-
return
|
|
10277
|
-
if (identity.isScalar(
|
|
10278
|
-
return
|
|
10375
|
+
for (const it3 of items) {
|
|
10376
|
+
if (identity.isPair(it3)) {
|
|
10377
|
+
if (it3.key === key || it3.key === k2)
|
|
10378
|
+
return it3;
|
|
10379
|
+
if (identity.isScalar(it3.key) && it3.key.value === k2)
|
|
10380
|
+
return it3;
|
|
10279
10381
|
}
|
|
10280
10382
|
}
|
|
10281
10383
|
return;
|
|
@@ -10340,15 +10442,15 @@ var require_YAMLMap = __commonJS((exports) => {
|
|
|
10340
10442
|
}
|
|
10341
10443
|
}
|
|
10342
10444
|
delete(key) {
|
|
10343
|
-
const
|
|
10344
|
-
if (!
|
|
10445
|
+
const it3 = findPair(this.items, key);
|
|
10446
|
+
if (!it3)
|
|
10345
10447
|
return false;
|
|
10346
|
-
const del = this.items.splice(this.items.indexOf(
|
|
10448
|
+
const del = this.items.splice(this.items.indexOf(it3), 1);
|
|
10347
10449
|
return del.length > 0;
|
|
10348
10450
|
}
|
|
10349
10451
|
get(key, keepScalar) {
|
|
10350
|
-
const
|
|
10351
|
-
const node =
|
|
10452
|
+
const it3 = findPair(this.items, key);
|
|
10453
|
+
const node = it3?.value;
|
|
10352
10454
|
return (!keepScalar && identity.isScalar(node) ? node.value : node) ?? undefined;
|
|
10353
10455
|
}
|
|
10354
10456
|
has(key) {
|
|
@@ -10387,7 +10489,7 @@ var require_YAMLMap = __commonJS((exports) => {
|
|
|
10387
10489
|
exports.findPair = findPair;
|
|
10388
10490
|
});
|
|
10389
10491
|
|
|
10390
|
-
// node_modules/.bun/yaml@2.
|
|
10492
|
+
// node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/schema/common/map.js
|
|
10391
10493
|
var require_map = __commonJS((exports) => {
|
|
10392
10494
|
var identity = require_identity();
|
|
10393
10495
|
var YAMLMap = require_YAMLMap();
|
|
@@ -10406,7 +10508,7 @@ var require_map = __commonJS((exports) => {
|
|
|
10406
10508
|
exports.map = map;
|
|
10407
10509
|
});
|
|
10408
10510
|
|
|
10409
|
-
// node_modules/.bun/yaml@2.
|
|
10511
|
+
// node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/nodes/YAMLSeq.js
|
|
10410
10512
|
var require_YAMLSeq = __commonJS((exports) => {
|
|
10411
10513
|
var createNode = require_createNode();
|
|
10412
10514
|
var stringifyCollection = require_stringifyCollection();
|
|
@@ -10437,8 +10539,8 @@ var require_YAMLSeq = __commonJS((exports) => {
|
|
|
10437
10539
|
const idx = asItemIndex(key);
|
|
10438
10540
|
if (typeof idx !== "number")
|
|
10439
10541
|
return;
|
|
10440
|
-
const
|
|
10441
|
-
return !keepScalar && identity.isScalar(
|
|
10542
|
+
const it3 = this.items[idx];
|
|
10543
|
+
return !keepScalar && identity.isScalar(it3) ? it3.value : it3;
|
|
10442
10544
|
}
|
|
10443
10545
|
has(key) {
|
|
10444
10546
|
const idx = asItemIndex(key);
|
|
@@ -10479,12 +10581,12 @@ var require_YAMLSeq = __commonJS((exports) => {
|
|
|
10479
10581
|
const seq = new this(schema);
|
|
10480
10582
|
if (obj && Symbol.iterator in Object(obj)) {
|
|
10481
10583
|
let i = 0;
|
|
10482
|
-
for (let
|
|
10584
|
+
for (let it3 of obj) {
|
|
10483
10585
|
if (typeof replacer === "function") {
|
|
10484
|
-
const key = obj instanceof Set ?
|
|
10485
|
-
|
|
10586
|
+
const key = obj instanceof Set ? it3 : String(i++);
|
|
10587
|
+
it3 = replacer.call(obj, key, it3);
|
|
10486
10588
|
}
|
|
10487
|
-
seq.items.push(createNode.createNode(
|
|
10589
|
+
seq.items.push(createNode.createNode(it3, undefined, ctx));
|
|
10488
10590
|
}
|
|
10489
10591
|
}
|
|
10490
10592
|
return seq;
|
|
@@ -10499,7 +10601,7 @@ var require_YAMLSeq = __commonJS((exports) => {
|
|
|
10499
10601
|
exports.YAMLSeq = YAMLSeq;
|
|
10500
10602
|
});
|
|
10501
10603
|
|
|
10502
|
-
// node_modules/.bun/yaml@2.
|
|
10604
|
+
// node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/schema/common/seq.js
|
|
10503
10605
|
var require_seq = __commonJS((exports) => {
|
|
10504
10606
|
var identity = require_identity();
|
|
10505
10607
|
var YAMLSeq = require_YAMLSeq();
|
|
@@ -10518,7 +10620,7 @@ var require_seq = __commonJS((exports) => {
|
|
|
10518
10620
|
exports.seq = seq;
|
|
10519
10621
|
});
|
|
10520
10622
|
|
|
10521
|
-
// node_modules/.bun/yaml@2.
|
|
10623
|
+
// node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/schema/common/string.js
|
|
10522
10624
|
var require_string = __commonJS((exports) => {
|
|
10523
10625
|
var stringifyString = require_stringifyString();
|
|
10524
10626
|
var string = {
|
|
@@ -10534,7 +10636,7 @@ var require_string = __commonJS((exports) => {
|
|
|
10534
10636
|
exports.string = string;
|
|
10535
10637
|
});
|
|
10536
10638
|
|
|
10537
|
-
// node_modules/.bun/yaml@2.
|
|
10639
|
+
// node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/schema/common/null.js
|
|
10538
10640
|
var require_null = __commonJS((exports) => {
|
|
10539
10641
|
var Scalar = require_Scalar();
|
|
10540
10642
|
var nullTag = {
|
|
@@ -10549,7 +10651,7 @@ var require_null = __commonJS((exports) => {
|
|
|
10549
10651
|
exports.nullTag = nullTag;
|
|
10550
10652
|
});
|
|
10551
10653
|
|
|
10552
|
-
// node_modules/.bun/yaml@2.
|
|
10654
|
+
// node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/schema/core/bool.js
|
|
10553
10655
|
var require_bool = __commonJS((exports) => {
|
|
10554
10656
|
var Scalar = require_Scalar();
|
|
10555
10657
|
var boolTag = {
|
|
@@ -10570,7 +10672,7 @@ var require_bool = __commonJS((exports) => {
|
|
|
10570
10672
|
exports.boolTag = boolTag;
|
|
10571
10673
|
});
|
|
10572
10674
|
|
|
10573
|
-
// node_modules/.bun/yaml@2.
|
|
10675
|
+
// node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/stringify/stringifyNumber.js
|
|
10574
10676
|
var require_stringifyNumber = __commonJS((exports) => {
|
|
10575
10677
|
function stringifyNumber({ format, minFractionDigits, tag, value }) {
|
|
10576
10678
|
if (typeof value === "bigint")
|
|
@@ -10579,14 +10681,14 @@ var require_stringifyNumber = __commonJS((exports) => {
|
|
|
10579
10681
|
if (!isFinite(num))
|
|
10580
10682
|
return isNaN(num) ? ".nan" : num < 0 ? "-.inf" : ".inf";
|
|
10581
10683
|
let n = Object.is(value, -0) ? "-0" : JSON.stringify(value);
|
|
10582
|
-
if (!format && minFractionDigits && (!tag || tag === "tag:yaml.org,2002:float") &&
|
|
10684
|
+
if (!format && minFractionDigits && (!tag || tag === "tag:yaml.org,2002:float") && /^-?\d/.test(n) && !n.includes("e")) {
|
|
10583
10685
|
let i = n.indexOf(".");
|
|
10584
10686
|
if (i < 0) {
|
|
10585
10687
|
i = n.length;
|
|
10586
10688
|
n += ".";
|
|
10587
10689
|
}
|
|
10588
|
-
let
|
|
10589
|
-
while (
|
|
10690
|
+
let d = minFractionDigits - (n.length - i - 1);
|
|
10691
|
+
while (d-- > 0)
|
|
10590
10692
|
n += "0";
|
|
10591
10693
|
}
|
|
10592
10694
|
return n;
|
|
@@ -10594,7 +10696,7 @@ var require_stringifyNumber = __commonJS((exports) => {
|
|
|
10594
10696
|
exports.stringifyNumber = stringifyNumber;
|
|
10595
10697
|
});
|
|
10596
10698
|
|
|
10597
|
-
// node_modules/.bun/yaml@2.
|
|
10699
|
+
// node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/schema/core/float.js
|
|
10598
10700
|
var require_float = __commonJS((exports) => {
|
|
10599
10701
|
var Scalar = require_Scalar();
|
|
10600
10702
|
var stringifyNumber = require_stringifyNumber();
|
|
@@ -10637,7 +10739,7 @@ var require_float = __commonJS((exports) => {
|
|
|
10637
10739
|
exports.floatNaN = floatNaN;
|
|
10638
10740
|
});
|
|
10639
10741
|
|
|
10640
|
-
// node_modules/.bun/yaml@2.
|
|
10742
|
+
// node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/schema/core/int.js
|
|
10641
10743
|
var require_int = __commonJS((exports) => {
|
|
10642
10744
|
var stringifyNumber = require_stringifyNumber();
|
|
10643
10745
|
var intIdentify = (value) => typeof value === "bigint" || Number.isInteger(value);
|
|
@@ -10679,7 +10781,7 @@ var require_int = __commonJS((exports) => {
|
|
|
10679
10781
|
exports.intOct = intOct;
|
|
10680
10782
|
});
|
|
10681
10783
|
|
|
10682
|
-
// node_modules/.bun/yaml@2.
|
|
10784
|
+
// node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/schema/core/schema.js
|
|
10683
10785
|
var require_schema = __commonJS((exports) => {
|
|
10684
10786
|
var map = require_map();
|
|
10685
10787
|
var _null = require_null();
|
|
@@ -10704,7 +10806,7 @@ var require_schema = __commonJS((exports) => {
|
|
|
10704
10806
|
exports.schema = schema;
|
|
10705
10807
|
});
|
|
10706
10808
|
|
|
10707
|
-
// node_modules/.bun/yaml@2.
|
|
10809
|
+
// node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/schema/json/schema.js
|
|
10708
10810
|
var require_schema2 = __commonJS((exports) => {
|
|
10709
10811
|
var Scalar = require_Scalar();
|
|
10710
10812
|
var map = require_map();
|
|
@@ -10768,7 +10870,7 @@ var require_schema2 = __commonJS((exports) => {
|
|
|
10768
10870
|
exports.schema = schema;
|
|
10769
10871
|
});
|
|
10770
10872
|
|
|
10771
|
-
// node_modules/.bun/yaml@2.
|
|
10873
|
+
// node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/schema/yaml-1.1/binary.js
|
|
10772
10874
|
var require_binary = __commonJS((exports) => {
|
|
10773
10875
|
var node_buffer = __require("buffer");
|
|
10774
10876
|
var Scalar = require_Scalar();
|
|
@@ -10823,7 +10925,7 @@ var require_binary = __commonJS((exports) => {
|
|
|
10823
10925
|
exports.binary = binary;
|
|
10824
10926
|
});
|
|
10825
10927
|
|
|
10826
|
-
// node_modules/.bun/yaml@2.
|
|
10928
|
+
// node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/schema/yaml-1.1/pairs.js
|
|
10827
10929
|
var require_pairs = __commonJS((exports) => {
|
|
10828
10930
|
var identity = require_identity();
|
|
10829
10931
|
var Pair = require_Pair();
|
|
@@ -10861,26 +10963,26 @@ ${cn.comment}` : item.comment;
|
|
|
10861
10963
|
pairs2.tag = "tag:yaml.org,2002:pairs";
|
|
10862
10964
|
let i = 0;
|
|
10863
10965
|
if (iterable && Symbol.iterator in Object(iterable))
|
|
10864
|
-
for (let
|
|
10966
|
+
for (let it3 of iterable) {
|
|
10865
10967
|
if (typeof replacer === "function")
|
|
10866
|
-
|
|
10968
|
+
it3 = replacer.call(iterable, String(i++), it3);
|
|
10867
10969
|
let key, value;
|
|
10868
|
-
if (Array.isArray(
|
|
10869
|
-
if (
|
|
10870
|
-
key =
|
|
10871
|
-
value =
|
|
10970
|
+
if (Array.isArray(it3)) {
|
|
10971
|
+
if (it3.length === 2) {
|
|
10972
|
+
key = it3[0];
|
|
10973
|
+
value = it3[1];
|
|
10872
10974
|
} else
|
|
10873
|
-
throw new TypeError(`Expected [key, value] tuple: ${
|
|
10874
|
-
} else if (
|
|
10875
|
-
const keys = Object.keys(
|
|
10975
|
+
throw new TypeError(`Expected [key, value] tuple: ${it3}`);
|
|
10976
|
+
} else if (it3 && it3 instanceof Object) {
|
|
10977
|
+
const keys = Object.keys(it3);
|
|
10876
10978
|
if (keys.length === 1) {
|
|
10877
10979
|
key = keys[0];
|
|
10878
|
-
value =
|
|
10980
|
+
value = it3[key];
|
|
10879
10981
|
} else {
|
|
10880
10982
|
throw new TypeError(`Expected tuple with one key, not ${keys.length} keys`);
|
|
10881
10983
|
}
|
|
10882
10984
|
} else {
|
|
10883
|
-
key =
|
|
10985
|
+
key = it3;
|
|
10884
10986
|
}
|
|
10885
10987
|
pairs2.items.push(Pair.createPair(key, value, ctx));
|
|
10886
10988
|
}
|
|
@@ -10898,7 +11000,7 @@ ${cn.comment}` : item.comment;
|
|
|
10898
11000
|
exports.resolvePairs = resolvePairs;
|
|
10899
11001
|
});
|
|
10900
11002
|
|
|
10901
|
-
// node_modules/.bun/yaml@2.
|
|
11003
|
+
// node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/schema/yaml-1.1/omap.js
|
|
10902
11004
|
var require_omap = __commonJS((exports) => {
|
|
10903
11005
|
var identity = require_identity();
|
|
10904
11006
|
var toJS = require_toJS();
|
|
@@ -10970,7 +11072,7 @@ var require_omap = __commonJS((exports) => {
|
|
|
10970
11072
|
exports.omap = omap;
|
|
10971
11073
|
});
|
|
10972
11074
|
|
|
10973
|
-
// node_modules/.bun/yaml@2.
|
|
11075
|
+
// node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/schema/yaml-1.1/bool.js
|
|
10974
11076
|
var require_bool2 = __commonJS((exports) => {
|
|
10975
11077
|
var Scalar = require_Scalar();
|
|
10976
11078
|
function boolStringify({ value, source }, ctx) {
|
|
@@ -10999,7 +11101,7 @@ var require_bool2 = __commonJS((exports) => {
|
|
|
10999
11101
|
exports.trueTag = trueTag;
|
|
11000
11102
|
});
|
|
11001
11103
|
|
|
11002
|
-
// node_modules/.bun/yaml@2.
|
|
11104
|
+
// node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/schema/yaml-1.1/float.js
|
|
11003
11105
|
var require_float2 = __commonJS((exports) => {
|
|
11004
11106
|
var Scalar = require_Scalar();
|
|
11005
11107
|
var stringifyNumber = require_stringifyNumber();
|
|
@@ -11032,9 +11134,9 @@ var require_float2 = __commonJS((exports) => {
|
|
|
11032
11134
|
const node = new Scalar.Scalar(parseFloat(str.replace(/_/g, "")));
|
|
11033
11135
|
const dot = str.indexOf(".");
|
|
11034
11136
|
if (dot !== -1) {
|
|
11035
|
-
const
|
|
11036
|
-
if (
|
|
11037
|
-
node.minFractionDigits =
|
|
11137
|
+
const f2 = str.substring(dot + 1).replace(/_/g, "");
|
|
11138
|
+
if (f2[f2.length - 1] === "0")
|
|
11139
|
+
node.minFractionDigits = f2.length;
|
|
11038
11140
|
}
|
|
11039
11141
|
return node;
|
|
11040
11142
|
},
|
|
@@ -11045,7 +11147,7 @@ var require_float2 = __commonJS((exports) => {
|
|
|
11045
11147
|
exports.floatNaN = floatNaN;
|
|
11046
11148
|
});
|
|
11047
11149
|
|
|
11048
|
-
// node_modules/.bun/yaml@2.
|
|
11150
|
+
// node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/schema/yaml-1.1/int.js
|
|
11049
11151
|
var require_int2 = __commonJS((exports) => {
|
|
11050
11152
|
var stringifyNumber = require_stringifyNumber();
|
|
11051
11153
|
var intIdentify = (value) => typeof value === "bigint" || Number.isInteger(value);
|
|
@@ -11121,7 +11223,7 @@ var require_int2 = __commonJS((exports) => {
|
|
|
11121
11223
|
exports.intOct = intOct;
|
|
11122
11224
|
});
|
|
11123
11225
|
|
|
11124
|
-
// node_modules/.bun/yaml@2.
|
|
11226
|
+
// node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/schema/yaml-1.1/set.js
|
|
11125
11227
|
var require_set = __commonJS((exports) => {
|
|
11126
11228
|
var identity = require_identity();
|
|
11127
11229
|
var Pair = require_Pair();
|
|
@@ -11204,7 +11306,7 @@ var require_set = __commonJS((exports) => {
|
|
|
11204
11306
|
exports.set = set;
|
|
11205
11307
|
});
|
|
11206
11308
|
|
|
11207
|
-
// node_modules/.bun/yaml@2.
|
|
11309
|
+
// node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/schema/yaml-1.1/timestamp.js
|
|
11208
11310
|
var require_timestamp = __commonJS((exports) => {
|
|
11209
11311
|
var stringifyNumber = require_stringifyNumber();
|
|
11210
11312
|
function parseSexagesimal(str, asBigInt) {
|
|
@@ -11272,10 +11374,10 @@ var require_timestamp = __commonJS((exports) => {
|
|
|
11272
11374
|
let date = Date.UTC(year, month - 1, day, hour || 0, minute || 0, second || 0, millisec);
|
|
11273
11375
|
const tz = match[8];
|
|
11274
11376
|
if (tz && tz !== "Z") {
|
|
11275
|
-
let
|
|
11276
|
-
if (Math.abs(
|
|
11277
|
-
|
|
11278
|
-
date -= 60000 *
|
|
11377
|
+
let d = parseSexagesimal(tz, false);
|
|
11378
|
+
if (Math.abs(d) < 30)
|
|
11379
|
+
d *= 60;
|
|
11380
|
+
date -= 60000 * d;
|
|
11279
11381
|
}
|
|
11280
11382
|
return new Date(date);
|
|
11281
11383
|
},
|
|
@@ -11286,7 +11388,7 @@ var require_timestamp = __commonJS((exports) => {
|
|
|
11286
11388
|
exports.timestamp = timestamp;
|
|
11287
11389
|
});
|
|
11288
11390
|
|
|
11289
|
-
// node_modules/.bun/yaml@2.
|
|
11391
|
+
// node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/schema/yaml-1.1/schema.js
|
|
11290
11392
|
var require_schema3 = __commonJS((exports) => {
|
|
11291
11393
|
var map = require_map();
|
|
11292
11394
|
var _null = require_null();
|
|
@@ -11327,7 +11429,7 @@ var require_schema3 = __commonJS((exports) => {
|
|
|
11327
11429
|
exports.schema = schema;
|
|
11328
11430
|
});
|
|
11329
11431
|
|
|
11330
|
-
// node_modules/.bun/yaml@2.
|
|
11432
|
+
// node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/schema/tags.js
|
|
11331
11433
|
var require_tags = __commonJS((exports) => {
|
|
11332
11434
|
var map = require_map();
|
|
11333
11435
|
var _null = require_null();
|
|
@@ -11418,7 +11520,7 @@ var require_tags = __commonJS((exports) => {
|
|
|
11418
11520
|
exports.getTags = getTags;
|
|
11419
11521
|
});
|
|
11420
11522
|
|
|
11421
|
-
// node_modules/.bun/yaml@2.
|
|
11523
|
+
// node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/schema/Schema.js
|
|
11422
11524
|
var require_Schema = __commonJS((exports) => {
|
|
11423
11525
|
var identity = require_identity();
|
|
11424
11526
|
var map = require_map();
|
|
@@ -11448,7 +11550,7 @@ var require_Schema = __commonJS((exports) => {
|
|
|
11448
11550
|
exports.Schema = Schema;
|
|
11449
11551
|
});
|
|
11450
11552
|
|
|
11451
|
-
// node_modules/.bun/yaml@2.
|
|
11553
|
+
// node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/stringify/stringifyDocument.js
|
|
11452
11554
|
var require_stringifyDocument = __commonJS((exports) => {
|
|
11453
11555
|
var identity = require_identity();
|
|
11454
11556
|
var stringify = require_stringify();
|
|
@@ -11528,7 +11630,7 @@ var require_stringifyDocument = __commonJS((exports) => {
|
|
|
11528
11630
|
exports.stringifyDocument = stringifyDocument;
|
|
11529
11631
|
});
|
|
11530
11632
|
|
|
11531
|
-
// node_modules/.bun/yaml@2.
|
|
11633
|
+
// node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/doc/Document.js
|
|
11532
11634
|
var require_Document = __commonJS((exports) => {
|
|
11533
11635
|
var Alias = require_Alias();
|
|
11534
11636
|
var Collection = require_Collection();
|
|
@@ -11615,7 +11717,7 @@ var require_Document = __commonJS((exports) => {
|
|
|
11615
11717
|
value = replacer.call({ "": value }, "", value);
|
|
11616
11718
|
_replacer = replacer;
|
|
11617
11719
|
} else if (Array.isArray(replacer)) {
|
|
11618
|
-
const keyToStr = (
|
|
11720
|
+
const keyToStr = (v2) => typeof v2 === "number" || v2 instanceof String || v2 instanceof Number;
|
|
11619
11721
|
const asStr = replacer.filter(keyToStr).map(String);
|
|
11620
11722
|
if (asStr.length > 0)
|
|
11621
11723
|
replacer = replacer.concat(asStr);
|
|
@@ -11643,8 +11745,8 @@ var require_Document = __commonJS((exports) => {
|
|
|
11643
11745
|
}
|
|
11644
11746
|
createPair(key, value, options = {}) {
|
|
11645
11747
|
const k2 = this.createNode(key, null, options);
|
|
11646
|
-
const
|
|
11647
|
-
return new Pair.Pair(k2,
|
|
11748
|
+
const v2 = this.createNode(value, null, options);
|
|
11749
|
+
return new Pair.Pair(k2, v2);
|
|
11648
11750
|
}
|
|
11649
11751
|
delete(key) {
|
|
11650
11752
|
return assertCollection(this.contents) ? this.contents.delete(key) : false;
|
|
@@ -11763,7 +11865,7 @@ var require_Document = __commonJS((exports) => {
|
|
|
11763
11865
|
exports.Document = Document;
|
|
11764
11866
|
});
|
|
11765
11867
|
|
|
11766
|
-
// node_modules/.bun/yaml@2.
|
|
11868
|
+
// node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/errors.js
|
|
11767
11869
|
var require_errors = __commonJS((exports) => {
|
|
11768
11870
|
class YAMLError extends Error {
|
|
11769
11871
|
constructor(name, pos, code, message) {
|
|
@@ -11828,7 +11930,7 @@ ${pointer}
|
|
|
11828
11930
|
exports.prettifyError = prettifyError;
|
|
11829
11931
|
});
|
|
11830
11932
|
|
|
11831
|
-
// node_modules/.bun/yaml@2.
|
|
11933
|
+
// node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/compose/resolve-props.js
|
|
11832
11934
|
var require_resolve_props = __commonJS((exports) => {
|
|
11833
11935
|
function resolveProps(tokens, { flow, indicator, next, offset, onError, parentIndent, startOnNewline }) {
|
|
11834
11936
|
let spaceBefore = false;
|
|
@@ -11958,7 +12060,7 @@ var require_resolve_props = __commonJS((exports) => {
|
|
|
11958
12060
|
exports.resolveProps = resolveProps;
|
|
11959
12061
|
});
|
|
11960
12062
|
|
|
11961
|
-
// node_modules/.bun/yaml@2.
|
|
12063
|
+
// node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/compose/util-contains-newline.js
|
|
11962
12064
|
var require_util_contains_newline = __commonJS((exports) => {
|
|
11963
12065
|
function containsNewline(key) {
|
|
11964
12066
|
if (!key)
|
|
@@ -11972,22 +12074,22 @@ var require_util_contains_newline = __commonJS((exports) => {
|
|
|
11972
12074
|
`))
|
|
11973
12075
|
return true;
|
|
11974
12076
|
if (key.end) {
|
|
11975
|
-
for (const
|
|
11976
|
-
if (
|
|
12077
|
+
for (const st3 of key.end)
|
|
12078
|
+
if (st3.type === "newline")
|
|
11977
12079
|
return true;
|
|
11978
12080
|
}
|
|
11979
12081
|
return false;
|
|
11980
12082
|
case "flow-collection":
|
|
11981
|
-
for (const
|
|
11982
|
-
for (const
|
|
11983
|
-
if (
|
|
12083
|
+
for (const it3 of key.items) {
|
|
12084
|
+
for (const st3 of it3.start)
|
|
12085
|
+
if (st3.type === "newline")
|
|
11984
12086
|
return true;
|
|
11985
|
-
if (
|
|
11986
|
-
for (const
|
|
11987
|
-
if (
|
|
12087
|
+
if (it3.sep) {
|
|
12088
|
+
for (const st3 of it3.sep)
|
|
12089
|
+
if (st3.type === "newline")
|
|
11988
12090
|
return true;
|
|
11989
12091
|
}
|
|
11990
|
-
if (containsNewline(
|
|
12092
|
+
if (containsNewline(it3.key) || containsNewline(it3.value))
|
|
11991
12093
|
return true;
|
|
11992
12094
|
}
|
|
11993
12095
|
return false;
|
|
@@ -11998,7 +12100,7 @@ var require_util_contains_newline = __commonJS((exports) => {
|
|
|
11998
12100
|
exports.containsNewline = containsNewline;
|
|
11999
12101
|
});
|
|
12000
12102
|
|
|
12001
|
-
// node_modules/.bun/yaml@2.
|
|
12103
|
+
// node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/compose/util-flow-indent-check.js
|
|
12002
12104
|
var require_util_flow_indent_check = __commonJS((exports) => {
|
|
12003
12105
|
var utilContainsNewline = require_util_contains_newline();
|
|
12004
12106
|
function flowIndentCheck(indent, fc, onError) {
|
|
@@ -12013,7 +12115,7 @@ var require_util_flow_indent_check = __commonJS((exports) => {
|
|
|
12013
12115
|
exports.flowIndentCheck = flowIndentCheck;
|
|
12014
12116
|
});
|
|
12015
12117
|
|
|
12016
|
-
// node_modules/.bun/yaml@2.
|
|
12118
|
+
// node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/compose/util-map-includes.js
|
|
12017
12119
|
var require_util_map_includes = __commonJS((exports) => {
|
|
12018
12120
|
var identity = require_identity();
|
|
12019
12121
|
function mapIncludes(ctx, items, search) {
|
|
@@ -12026,7 +12128,7 @@ var require_util_map_includes = __commonJS((exports) => {
|
|
|
12026
12128
|
exports.mapIncludes = mapIncludes;
|
|
12027
12129
|
});
|
|
12028
12130
|
|
|
12029
|
-
// node_modules/.bun/yaml@2.
|
|
12131
|
+
// node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/compose/resolve-block-map.js
|
|
12030
12132
|
var require_resolve_block_map = __commonJS((exports) => {
|
|
12031
12133
|
var Pair = require_Pair();
|
|
12032
12134
|
var YAMLMap = require_YAMLMap();
|
|
@@ -12133,7 +12235,7 @@ var require_resolve_block_map = __commonJS((exports) => {
|
|
|
12133
12235
|
exports.resolveBlockMap = resolveBlockMap;
|
|
12134
12236
|
});
|
|
12135
12237
|
|
|
12136
|
-
// node_modules/.bun/yaml@2.
|
|
12238
|
+
// node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/compose/resolve-block-seq.js
|
|
12137
12239
|
var require_resolve_block_seq = __commonJS((exports) => {
|
|
12138
12240
|
var YAMLSeq = require_YAMLSeq();
|
|
12139
12241
|
var resolveProps = require_resolve_props();
|
|
@@ -12181,7 +12283,7 @@ var require_resolve_block_seq = __commonJS((exports) => {
|
|
|
12181
12283
|
exports.resolveBlockSeq = resolveBlockSeq;
|
|
12182
12284
|
});
|
|
12183
12285
|
|
|
12184
|
-
// node_modules/.bun/yaml@2.
|
|
12286
|
+
// node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/compose/resolve-end.js
|
|
12185
12287
|
var require_resolve_end = __commonJS((exports) => {
|
|
12186
12288
|
function resolveEnd(end, offset, reqSpace, onError) {
|
|
12187
12289
|
let comment = "";
|
|
@@ -12221,7 +12323,7 @@ var require_resolve_end = __commonJS((exports) => {
|
|
|
12221
12323
|
exports.resolveEnd = resolveEnd;
|
|
12222
12324
|
});
|
|
12223
12325
|
|
|
12224
|
-
// node_modules/.bun/yaml@2.
|
|
12326
|
+
// node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/compose/resolve-flow-collection.js
|
|
12225
12327
|
var require_resolve_flow_collection = __commonJS((exports) => {
|
|
12226
12328
|
var identity = require_identity();
|
|
12227
12329
|
var Pair = require_Pair();
|
|
@@ -12285,13 +12387,13 @@ var require_resolve_flow_collection = __commonJS((exports) => {
|
|
|
12285
12387
|
if (props.comment) {
|
|
12286
12388
|
let prevItemComment = "";
|
|
12287
12389
|
loop:
|
|
12288
|
-
for (const
|
|
12289
|
-
switch (
|
|
12390
|
+
for (const st3 of start) {
|
|
12391
|
+
switch (st3.type) {
|
|
12290
12392
|
case "comma":
|
|
12291
12393
|
case "space":
|
|
12292
12394
|
break;
|
|
12293
12395
|
case "comment":
|
|
12294
|
-
prevItemComment =
|
|
12396
|
+
prevItemComment = st3.source.substring(1);
|
|
12295
12397
|
break loop;
|
|
12296
12398
|
default:
|
|
12297
12399
|
break loop;
|
|
@@ -12335,11 +12437,11 @@ var require_resolve_flow_collection = __commonJS((exports) => {
|
|
|
12335
12437
|
if (valueProps.found) {
|
|
12336
12438
|
if (!isMap && !props.found && ctx.options.strict) {
|
|
12337
12439
|
if (sep)
|
|
12338
|
-
for (const
|
|
12339
|
-
if (
|
|
12440
|
+
for (const st3 of sep) {
|
|
12441
|
+
if (st3 === valueProps.found)
|
|
12340
12442
|
break;
|
|
12341
|
-
if (
|
|
12342
|
-
onError(
|
|
12443
|
+
if (st3.type === "newline") {
|
|
12444
|
+
onError(st3, "MULTILINE_IMPLICIT_KEY", "Implicit keys of flow sequence pairs need to be on a single line");
|
|
12343
12445
|
break;
|
|
12344
12446
|
}
|
|
12345
12447
|
}
|
|
@@ -12383,16 +12485,16 @@ var require_resolve_flow_collection = __commonJS((exports) => {
|
|
|
12383
12485
|
}
|
|
12384
12486
|
}
|
|
12385
12487
|
const expectedEnd = isMap ? "}" : "]";
|
|
12386
|
-
const [
|
|
12488
|
+
const [ce, ...ee2] = fc.end;
|
|
12387
12489
|
let cePos = offset;
|
|
12388
|
-
if (
|
|
12389
|
-
cePos =
|
|
12490
|
+
if (ce?.source === expectedEnd)
|
|
12491
|
+
cePos = ce.offset + ce.source.length;
|
|
12390
12492
|
else {
|
|
12391
12493
|
const name = fcName[0].toUpperCase() + fcName.substring(1);
|
|
12392
12494
|
const msg = atRoot ? `${name} must end with a ${expectedEnd}` : `${name} in block collection must be sufficiently indented and end with a ${expectedEnd}`;
|
|
12393
12495
|
onError(offset, atRoot ? "MISSING_CHAR" : "BAD_INDENT", msg);
|
|
12394
|
-
if (
|
|
12395
|
-
ee2.unshift(
|
|
12496
|
+
if (ce && ce.source.length !== 1)
|
|
12497
|
+
ee2.unshift(ce);
|
|
12396
12498
|
}
|
|
12397
12499
|
if (ee2.length > 0) {
|
|
12398
12500
|
const end = resolveEnd.resolveEnd(ee2, cePos, ctx.options.strict, onError);
|
|
@@ -12412,7 +12514,7 @@ var require_resolve_flow_collection = __commonJS((exports) => {
|
|
|
12412
12514
|
exports.resolveFlowCollection = resolveFlowCollection;
|
|
12413
12515
|
});
|
|
12414
12516
|
|
|
12415
|
-
// node_modules/.bun/yaml@2.
|
|
12517
|
+
// node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/compose/compose-collection.js
|
|
12416
12518
|
var require_compose_collection = __commonJS((exports) => {
|
|
12417
12519
|
var identity = require_identity();
|
|
12418
12520
|
var Scalar = require_Scalar();
|
|
@@ -12447,7 +12549,7 @@ var require_compose_collection = __commonJS((exports) => {
|
|
|
12447
12549
|
if (!tagToken || !tagName || tagName === "!" || tagName === YAMLMap.YAMLMap.tagName && expType === "map" || tagName === YAMLSeq.YAMLSeq.tagName && expType === "seq") {
|
|
12448
12550
|
return resolveCollection(CN, ctx, token, onError, tagName);
|
|
12449
12551
|
}
|
|
12450
|
-
let tag = ctx.schema.tags.find((
|
|
12552
|
+
let tag = ctx.schema.tags.find((t) => t.tag === tagName && t.collection === expType);
|
|
12451
12553
|
if (!tag) {
|
|
12452
12554
|
const kt = ctx.schema.knownTags[tagName];
|
|
12453
12555
|
if (kt?.collection === expType) {
|
|
@@ -12474,7 +12576,7 @@ var require_compose_collection = __commonJS((exports) => {
|
|
|
12474
12576
|
exports.composeCollection = composeCollection;
|
|
12475
12577
|
});
|
|
12476
12578
|
|
|
12477
|
-
// node_modules/.bun/yaml@2.
|
|
12579
|
+
// node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/compose/resolve-block-scalar.js
|
|
12478
12580
|
var require_resolve_block_scalar = __commonJS((exports) => {
|
|
12479
12581
|
var Scalar = require_Scalar();
|
|
12480
12582
|
function resolveBlockScalar(ctx, scalar, onError) {
|
|
@@ -12657,8 +12759,8 @@ var require_resolve_block_scalar = __commonJS((exports) => {
|
|
|
12657
12759
|
function splitLines(source) {
|
|
12658
12760
|
const split = source.split(/\n( *)/);
|
|
12659
12761
|
const first = split[0];
|
|
12660
|
-
const
|
|
12661
|
-
const line0 =
|
|
12762
|
+
const m2 = first.match(/^( *)/);
|
|
12763
|
+
const line0 = m2?.[1] ? [m2[1], first.slice(m2[1].length)] : ["", first];
|
|
12662
12764
|
const lines = [line0];
|
|
12663
12765
|
for (let i = 1;i < split.length; i += 2)
|
|
12664
12766
|
lines.push([split[i], split[i + 1]]);
|
|
@@ -12667,7 +12769,7 @@ var require_resolve_block_scalar = __commonJS((exports) => {
|
|
|
12667
12769
|
exports.resolveBlockScalar = resolveBlockScalar;
|
|
12668
12770
|
});
|
|
12669
12771
|
|
|
12670
|
-
// node_modules/.bun/yaml@2.
|
|
12772
|
+
// node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/compose/resolve-flow-scalar.js
|
|
12671
12773
|
var require_resolve_flow_scalar = __commonJS((exports) => {
|
|
12672
12774
|
var Scalar = require_Scalar();
|
|
12673
12775
|
var resolveEnd = require_resolve_end();
|
|
@@ -12699,12 +12801,12 @@ var require_resolve_flow_scalar = __commonJS((exports) => {
|
|
|
12699
12801
|
};
|
|
12700
12802
|
}
|
|
12701
12803
|
const valueEnd = offset + source.length;
|
|
12702
|
-
const
|
|
12804
|
+
const re = resolveEnd.resolveEnd(end, valueEnd, strict, onError);
|
|
12703
12805
|
return {
|
|
12704
12806
|
value,
|
|
12705
12807
|
type: _type,
|
|
12706
|
-
comment:
|
|
12707
|
-
range: [offset, valueEnd,
|
|
12808
|
+
comment: re.comment,
|
|
12809
|
+
range: [offset, valueEnd, re.offset]
|
|
12708
12810
|
};
|
|
12709
12811
|
}
|
|
12710
12812
|
function plainValue(source, onError) {
|
|
@@ -12804,7 +12906,7 @@ var require_resolve_flow_scalar = __commonJS((exports) => {
|
|
|
12804
12906
|
while (next === " " || next === "\t")
|
|
12805
12907
|
next = source[++i + 1];
|
|
12806
12908
|
} else if (next === "x" || next === "u" || next === "U") {
|
|
12807
|
-
const length =
|
|
12909
|
+
const length = next === "x" ? 2 : next === "u" ? 4 : 8;
|
|
12808
12910
|
res += parseCharCode(source, i + 1, length, onError);
|
|
12809
12911
|
i += length;
|
|
12810
12912
|
} else {
|
|
@@ -12873,17 +12975,18 @@ var require_resolve_flow_scalar = __commonJS((exports) => {
|
|
|
12873
12975
|
const cc = source.substr(offset, length);
|
|
12874
12976
|
const ok = cc.length === length && /^[0-9a-fA-F]+$/.test(cc);
|
|
12875
12977
|
const code = ok ? parseInt(cc, 16) : NaN;
|
|
12876
|
-
|
|
12978
|
+
try {
|
|
12979
|
+
return String.fromCodePoint(code);
|
|
12980
|
+
} catch {
|
|
12877
12981
|
const raw = source.substr(offset - 2, length + 2);
|
|
12878
12982
|
onError(offset - 2, "BAD_DQ_ESCAPE", `Invalid escape sequence ${raw}`);
|
|
12879
12983
|
return raw;
|
|
12880
12984
|
}
|
|
12881
|
-
return String.fromCodePoint(code);
|
|
12882
12985
|
}
|
|
12883
12986
|
exports.resolveFlowScalar = resolveFlowScalar;
|
|
12884
12987
|
});
|
|
12885
12988
|
|
|
12886
|
-
// node_modules/.bun/yaml@2.
|
|
12989
|
+
// node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/compose/compose-scalar.js
|
|
12887
12990
|
var require_compose_scalar = __commonJS((exports) => {
|
|
12888
12991
|
var identity = require_identity();
|
|
12889
12992
|
var Scalar = require_Scalar();
|
|
@@ -12961,24 +13064,24 @@ var require_compose_scalar = __commonJS((exports) => {
|
|
|
12961
13064
|
exports.composeScalar = composeScalar;
|
|
12962
13065
|
});
|
|
12963
13066
|
|
|
12964
|
-
// node_modules/.bun/yaml@2.
|
|
13067
|
+
// node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/compose/util-empty-scalar-position.js
|
|
12965
13068
|
var require_util_empty_scalar_position = __commonJS((exports) => {
|
|
12966
13069
|
function emptyScalarPosition(offset, before, pos) {
|
|
12967
13070
|
if (before) {
|
|
12968
13071
|
pos ?? (pos = before.length);
|
|
12969
13072
|
for (let i = pos - 1;i >= 0; --i) {
|
|
12970
|
-
let
|
|
12971
|
-
switch (
|
|
13073
|
+
let st3 = before[i];
|
|
13074
|
+
switch (st3.type) {
|
|
12972
13075
|
case "space":
|
|
12973
13076
|
case "comment":
|
|
12974
13077
|
case "newline":
|
|
12975
|
-
offset -=
|
|
13078
|
+
offset -= st3.source.length;
|
|
12976
13079
|
continue;
|
|
12977
13080
|
}
|
|
12978
|
-
|
|
12979
|
-
while (
|
|
12980
|
-
offset +=
|
|
12981
|
-
|
|
13081
|
+
st3 = before[++i];
|
|
13082
|
+
while (st3?.type === "space") {
|
|
13083
|
+
offset += st3.source.length;
|
|
13084
|
+
st3 = before[++i];
|
|
12982
13085
|
}
|
|
12983
13086
|
break;
|
|
12984
13087
|
}
|
|
@@ -12988,7 +13091,7 @@ var require_util_empty_scalar_position = __commonJS((exports) => {
|
|
|
12988
13091
|
exports.emptyScalarPosition = emptyScalarPosition;
|
|
12989
13092
|
});
|
|
12990
13093
|
|
|
12991
|
-
// node_modules/.bun/yaml@2.
|
|
13094
|
+
// node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/compose/compose-node.js
|
|
12992
13095
|
var require_compose_node = __commonJS((exports) => {
|
|
12993
13096
|
var Alias = require_Alias();
|
|
12994
13097
|
var identity = require_identity();
|
|
@@ -13081,17 +13184,17 @@ var require_compose_node = __commonJS((exports) => {
|
|
|
13081
13184
|
if (alias.source.endsWith(":"))
|
|
13082
13185
|
onError(offset + source.length - 1, "BAD_ALIAS", "Alias ending in : is ambiguous", true);
|
|
13083
13186
|
const valueEnd = offset + source.length;
|
|
13084
|
-
const
|
|
13085
|
-
alias.range = [offset, valueEnd,
|
|
13086
|
-
if (
|
|
13087
|
-
alias.comment =
|
|
13187
|
+
const re = resolveEnd.resolveEnd(end, valueEnd, options.strict, onError);
|
|
13188
|
+
alias.range = [offset, valueEnd, re.offset];
|
|
13189
|
+
if (re.comment)
|
|
13190
|
+
alias.comment = re.comment;
|
|
13088
13191
|
return alias;
|
|
13089
13192
|
}
|
|
13090
13193
|
exports.composeEmptyNode = composeEmptyNode;
|
|
13091
13194
|
exports.composeNode = composeNode;
|
|
13092
13195
|
});
|
|
13093
13196
|
|
|
13094
|
-
// node_modules/.bun/yaml@2.
|
|
13197
|
+
// node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/compose/compose-doc.js
|
|
13095
13198
|
var require_compose_doc = __commonJS((exports) => {
|
|
13096
13199
|
var Document = require_Document();
|
|
13097
13200
|
var composeNode = require_compose_node();
|
|
@@ -13122,16 +13225,16 @@ var require_compose_doc = __commonJS((exports) => {
|
|
|
13122
13225
|
}
|
|
13123
13226
|
doc.contents = value ? composeNode.composeNode(ctx, value, props, onError) : composeNode.composeEmptyNode(ctx, props.end, start, null, props, onError);
|
|
13124
13227
|
const contentEnd = doc.contents.range[2];
|
|
13125
|
-
const
|
|
13126
|
-
if (
|
|
13127
|
-
doc.comment =
|
|
13128
|
-
doc.range = [offset, contentEnd,
|
|
13228
|
+
const re = resolveEnd.resolveEnd(end, contentEnd, false, onError);
|
|
13229
|
+
if (re.comment)
|
|
13230
|
+
doc.comment = re.comment;
|
|
13231
|
+
doc.range = [offset, contentEnd, re.offset];
|
|
13129
13232
|
return doc;
|
|
13130
13233
|
}
|
|
13131
13234
|
exports.composeDoc = composeDoc;
|
|
13132
13235
|
});
|
|
13133
13236
|
|
|
13134
|
-
// node_modules/.bun/yaml@2.
|
|
13237
|
+
// node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/compose/composer.js
|
|
13135
13238
|
var require_composer = __commonJS((exports) => {
|
|
13136
13239
|
var node_process = __require("process");
|
|
13137
13240
|
var directives = require_directives();
|
|
@@ -13204,11 +13307,11 @@ ${comment}` : comment;
|
|
|
13204
13307
|
} else if (afterEmptyLine || doc.directives.docStart || !dc) {
|
|
13205
13308
|
doc.commentBefore = comment;
|
|
13206
13309
|
} else if (identity.isCollection(dc) && !dc.flow && dc.items.length > 0) {
|
|
13207
|
-
let
|
|
13208
|
-
if (identity.isPair(
|
|
13209
|
-
|
|
13210
|
-
const cb =
|
|
13211
|
-
|
|
13310
|
+
let it3 = dc.items[0];
|
|
13311
|
+
if (identity.isPair(it3))
|
|
13312
|
+
it3 = it3.key;
|
|
13313
|
+
const cb = it3.commentBefore;
|
|
13314
|
+
it3.commentBefore = cb ? `${comment}
|
|
13212
13315
|
${cb}` : comment;
|
|
13213
13316
|
} else {
|
|
13214
13317
|
const cb = dc.commentBefore;
|
|
@@ -13217,8 +13320,10 @@ ${cb}` : comment;
|
|
|
13217
13320
|
}
|
|
13218
13321
|
}
|
|
13219
13322
|
if (afterDoc) {
|
|
13220
|
-
|
|
13221
|
-
|
|
13323
|
+
for (let i = 0;i < this.errors.length; ++i)
|
|
13324
|
+
doc.errors.push(this.errors[i]);
|
|
13325
|
+
for (let i = 0;i < this.warnings.length; ++i)
|
|
13326
|
+
doc.warnings.push(this.warnings[i]);
|
|
13222
13327
|
} else {
|
|
13223
13328
|
doc.errors = this.errors;
|
|
13224
13329
|
doc.warnings = this.warnings;
|
|
@@ -13320,7 +13425,7 @@ ${end.comment}` : end.comment;
|
|
|
13320
13425
|
exports.Composer = Composer;
|
|
13321
13426
|
});
|
|
13322
13427
|
|
|
13323
|
-
// node_modules/.bun/yaml@2.
|
|
13428
|
+
// node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/parse/cst-scalar.js
|
|
13324
13429
|
var require_cst_scalar = __commonJS((exports) => {
|
|
13325
13430
|
var resolveBlockScalar = require_resolve_block_scalar();
|
|
13326
13431
|
var resolveFlowScalar = require_resolve_flow_scalar();
|
|
@@ -13361,10 +13466,10 @@ var require_cst_scalar = __commonJS((exports) => {
|
|
|
13361
13466
|
switch (source[0]) {
|
|
13362
13467
|
case "|":
|
|
13363
13468
|
case ">": {
|
|
13364
|
-
const
|
|
13469
|
+
const he = source.indexOf(`
|
|
13365
13470
|
`);
|
|
13366
|
-
const head = source.substring(0,
|
|
13367
|
-
const body = source.substring(
|
|
13471
|
+
const head = source.substring(0, he);
|
|
13472
|
+
const body = source.substring(he + 1) + `
|
|
13368
13473
|
`;
|
|
13369
13474
|
const props = [
|
|
13370
13475
|
{ type: "block-scalar-header", offset, indent, source: head }
|
|
@@ -13427,10 +13532,10 @@ var require_cst_scalar = __commonJS((exports) => {
|
|
|
13427
13532
|
}
|
|
13428
13533
|
}
|
|
13429
13534
|
function setBlockScalarValue(token, source) {
|
|
13430
|
-
const
|
|
13535
|
+
const he = source.indexOf(`
|
|
13431
13536
|
`);
|
|
13432
|
-
const head = source.substring(0,
|
|
13433
|
-
const body = source.substring(
|
|
13537
|
+
const head = source.substring(0, he);
|
|
13538
|
+
const body = source.substring(he + 1) + `
|
|
13434
13539
|
`;
|
|
13435
13540
|
if (token.type === "block-scalar") {
|
|
13436
13541
|
const header = token.props[0];
|
|
@@ -13455,14 +13560,14 @@ var require_cst_scalar = __commonJS((exports) => {
|
|
|
13455
13560
|
}
|
|
13456
13561
|
function addEndtoBlockProps(props, end) {
|
|
13457
13562
|
if (end)
|
|
13458
|
-
for (const
|
|
13459
|
-
switch (
|
|
13563
|
+
for (const st3 of end)
|
|
13564
|
+
switch (st3.type) {
|
|
13460
13565
|
case "space":
|
|
13461
13566
|
case "comment":
|
|
13462
|
-
props.push(
|
|
13567
|
+
props.push(st3);
|
|
13463
13568
|
break;
|
|
13464
13569
|
case "newline":
|
|
13465
|
-
props.push(
|
|
13570
|
+
props.push(st3);
|
|
13466
13571
|
return true;
|
|
13467
13572
|
}
|
|
13468
13573
|
return false;
|
|
@@ -13497,7 +13602,7 @@ var require_cst_scalar = __commonJS((exports) => {
|
|
|
13497
13602
|
}
|
|
13498
13603
|
default: {
|
|
13499
13604
|
const indent = "indent" in token ? token.indent : -1;
|
|
13500
|
-
const end = "end" in token && Array.isArray(token.end) ? token.end.filter((
|
|
13605
|
+
const end = "end" in token && Array.isArray(token.end) ? token.end.filter((st3) => st3.type === "space" || st3.type === "comment" || st3.type === "newline") : [];
|
|
13501
13606
|
for (const key of Object.keys(token))
|
|
13502
13607
|
if (key !== "type" && key !== "offset")
|
|
13503
13608
|
delete token[key];
|
|
@@ -13510,7 +13615,7 @@ var require_cst_scalar = __commonJS((exports) => {
|
|
|
13510
13615
|
exports.setScalarValue = setScalarValue;
|
|
13511
13616
|
});
|
|
13512
13617
|
|
|
13513
|
-
// node_modules/.bun/yaml@2.
|
|
13618
|
+
// node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/parse/cst-stringify.js
|
|
13514
13619
|
var require_cst_stringify = __commonJS((exports) => {
|
|
13515
13620
|
var stringify = (cst) => ("type" in cst) ? stringifyToken(cst) : stringifyItem(cst);
|
|
13516
13621
|
function stringifyToken(token) {
|
|
@@ -13532,35 +13637,35 @@ var require_cst_stringify = __commonJS((exports) => {
|
|
|
13532
13637
|
let res = token.start.source;
|
|
13533
13638
|
for (const item of token.items)
|
|
13534
13639
|
res += stringifyItem(item);
|
|
13535
|
-
for (const
|
|
13536
|
-
res +=
|
|
13640
|
+
for (const st3 of token.end)
|
|
13641
|
+
res += st3.source;
|
|
13537
13642
|
return res;
|
|
13538
13643
|
}
|
|
13539
13644
|
case "document": {
|
|
13540
13645
|
let res = stringifyItem(token);
|
|
13541
13646
|
if (token.end)
|
|
13542
|
-
for (const
|
|
13543
|
-
res +=
|
|
13647
|
+
for (const st3 of token.end)
|
|
13648
|
+
res += st3.source;
|
|
13544
13649
|
return res;
|
|
13545
13650
|
}
|
|
13546
13651
|
default: {
|
|
13547
13652
|
let res = token.source;
|
|
13548
13653
|
if ("end" in token && token.end)
|
|
13549
|
-
for (const
|
|
13550
|
-
res +=
|
|
13654
|
+
for (const st3 of token.end)
|
|
13655
|
+
res += st3.source;
|
|
13551
13656
|
return res;
|
|
13552
13657
|
}
|
|
13553
13658
|
}
|
|
13554
13659
|
}
|
|
13555
13660
|
function stringifyItem({ start, key, sep, value }) {
|
|
13556
13661
|
let res = "";
|
|
13557
|
-
for (const
|
|
13558
|
-
res +=
|
|
13662
|
+
for (const st3 of start)
|
|
13663
|
+
res += st3.source;
|
|
13559
13664
|
if (key)
|
|
13560
13665
|
res += stringifyToken(key);
|
|
13561
13666
|
if (sep)
|
|
13562
|
-
for (const
|
|
13563
|
-
res +=
|
|
13667
|
+
for (const st3 of sep)
|
|
13668
|
+
res += st3.source;
|
|
13564
13669
|
if (value)
|
|
13565
13670
|
res += stringifyToken(value);
|
|
13566
13671
|
return res;
|
|
@@ -13568,7 +13673,7 @@ var require_cst_stringify = __commonJS((exports) => {
|
|
|
13568
13673
|
exports.stringify = stringify;
|
|
13569
13674
|
});
|
|
13570
13675
|
|
|
13571
|
-
// node_modules/.bun/yaml@2.
|
|
13676
|
+
// node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/parse/cst-visit.js
|
|
13572
13677
|
var require_cst_visit = __commonJS((exports) => {
|
|
13573
13678
|
var BREAK = Symbol("break visit");
|
|
13574
13679
|
var SKIP = Symbol("skip children");
|
|
@@ -13627,7 +13732,7 @@ var require_cst_visit = __commonJS((exports) => {
|
|
|
13627
13732
|
exports.visit = visit;
|
|
13628
13733
|
});
|
|
13629
13734
|
|
|
13630
|
-
// node_modules/.bun/yaml@2.
|
|
13735
|
+
// node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/parse/cst.js
|
|
13631
13736
|
var require_cst = __commonJS((exports) => {
|
|
13632
13737
|
var cstScalar = require_cst_scalar();
|
|
13633
13738
|
var cstStringify = require_cst_stringify();
|
|
@@ -13728,7 +13833,7 @@ var require_cst = __commonJS((exports) => {
|
|
|
13728
13833
|
exports.tokenType = tokenType;
|
|
13729
13834
|
});
|
|
13730
13835
|
|
|
13731
|
-
// node_modules/.bun/yaml@2.
|
|
13836
|
+
// node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/parse/lexer.js
|
|
13732
13837
|
var require_lexer = __commonJS((exports) => {
|
|
13733
13838
|
var cst = require_cst();
|
|
13734
13839
|
function isEmpty(ch) {
|
|
@@ -13809,8 +13914,8 @@ var require_lexer = __commonJS((exports) => {
|
|
|
13809
13914
|
` || indent >= this.indentNext || !ch && !this.atEnd ? offset + indent : -1;
|
|
13810
13915
|
}
|
|
13811
13916
|
if (ch === "-" || ch === ".") {
|
|
13812
|
-
const
|
|
13813
|
-
if ((
|
|
13917
|
+
const dt2 = this.buffer.substr(offset, 3);
|
|
13918
|
+
if ((dt2 === "---" || dt2 === "...") && isEmpty(this.buffer[offset + 3]))
|
|
13814
13919
|
return -1;
|
|
13815
13920
|
}
|
|
13816
13921
|
return offset;
|
|
@@ -13930,7 +14035,7 @@ var require_lexer = __commonJS((exports) => {
|
|
|
13930
14035
|
const n = (yield* this.pushCount(1)) + (yield* this.pushSpaces(true));
|
|
13931
14036
|
this.indentNext = this.indentValue + 1;
|
|
13932
14037
|
this.indentValue += n;
|
|
13933
|
-
return
|
|
14038
|
+
return "block-start";
|
|
13934
14039
|
}
|
|
13935
14040
|
return "doc";
|
|
13936
14041
|
}
|
|
@@ -14237,26 +14342,37 @@ var require_lexer = __commonJS((exports) => {
|
|
|
14237
14342
|
return 0;
|
|
14238
14343
|
}
|
|
14239
14344
|
*pushIndicators() {
|
|
14240
|
-
|
|
14241
|
-
|
|
14242
|
-
|
|
14243
|
-
|
|
14244
|
-
|
|
14245
|
-
|
|
14246
|
-
|
|
14247
|
-
|
|
14248
|
-
|
|
14249
|
-
|
|
14250
|
-
|
|
14251
|
-
|
|
14252
|
-
|
|
14253
|
-
|
|
14254
|
-
|
|
14255
|
-
|
|
14345
|
+
let n = 0;
|
|
14346
|
+
loop:
|
|
14347
|
+
while (true) {
|
|
14348
|
+
switch (this.charAt(0)) {
|
|
14349
|
+
case "!":
|
|
14350
|
+
n += yield* this.pushTag();
|
|
14351
|
+
n += yield* this.pushSpaces(true);
|
|
14352
|
+
continue loop;
|
|
14353
|
+
case "&":
|
|
14354
|
+
n += yield* this.pushUntil(isNotAnchorChar);
|
|
14355
|
+
n += yield* this.pushSpaces(true);
|
|
14356
|
+
continue loop;
|
|
14357
|
+
case "-":
|
|
14358
|
+
case "?":
|
|
14359
|
+
case ":": {
|
|
14360
|
+
const inFlow = this.flowLevel > 0;
|
|
14361
|
+
const ch1 = this.charAt(1);
|
|
14362
|
+
if (isEmpty(ch1) || inFlow && flowIndicatorChars.has(ch1)) {
|
|
14363
|
+
if (!inFlow)
|
|
14364
|
+
this.indentNext = this.indentValue + 1;
|
|
14365
|
+
else if (this.flowKey)
|
|
14366
|
+
this.flowKey = false;
|
|
14367
|
+
n += yield* this.pushCount(1);
|
|
14368
|
+
n += yield* this.pushSpaces(true);
|
|
14369
|
+
continue loop;
|
|
14370
|
+
}
|
|
14371
|
+
}
|
|
14256
14372
|
}
|
|
14373
|
+
break loop;
|
|
14257
14374
|
}
|
|
14258
|
-
|
|
14259
|
-
return 0;
|
|
14375
|
+
return n;
|
|
14260
14376
|
}
|
|
14261
14377
|
*pushTag() {
|
|
14262
14378
|
if (this.charAt(1) === "<") {
|
|
@@ -14314,7 +14430,7 @@ var require_lexer = __commonJS((exports) => {
|
|
|
14314
14430
|
exports.Lexer = Lexer;
|
|
14315
14431
|
});
|
|
14316
14432
|
|
|
14317
|
-
// node_modules/.bun/yaml@2.
|
|
14433
|
+
// node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/parse/line-counter.js
|
|
14318
14434
|
var require_line_counter = __commonJS((exports) => {
|
|
14319
14435
|
class LineCounter {
|
|
14320
14436
|
constructor() {
|
|
@@ -14342,7 +14458,7 @@ var require_line_counter = __commonJS((exports) => {
|
|
|
14342
14458
|
exports.LineCounter = LineCounter;
|
|
14343
14459
|
});
|
|
14344
14460
|
|
|
14345
|
-
// node_modules/.bun/yaml@2.
|
|
14461
|
+
// node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/parse/parser.js
|
|
14346
14462
|
var require_parser = __commonJS((exports) => {
|
|
14347
14463
|
var node_process = __require("process");
|
|
14348
14464
|
var cst = require_cst();
|
|
@@ -14383,8 +14499,8 @@ var require_parser = __commonJS((exports) => {
|
|
|
14383
14499
|
case "document":
|
|
14384
14500
|
return parent.start;
|
|
14385
14501
|
case "block-map": {
|
|
14386
|
-
const
|
|
14387
|
-
return
|
|
14502
|
+
const it3 = parent.items[parent.items.length - 1];
|
|
14503
|
+
return it3.sep ?? it3.start;
|
|
14388
14504
|
}
|
|
14389
14505
|
case "block-seq":
|
|
14390
14506
|
return parent.items[parent.items.length - 1].start;
|
|
@@ -14410,21 +14526,28 @@ var require_parser = __commonJS((exports) => {
|
|
|
14410
14526
|
while (prev[++i]?.type === "space") {}
|
|
14411
14527
|
return prev.splice(i, prev.length);
|
|
14412
14528
|
}
|
|
14529
|
+
function arrayPushArray(target, source) {
|
|
14530
|
+
if (source.length < 1e5)
|
|
14531
|
+
Array.prototype.push.apply(target, source);
|
|
14532
|
+
else
|
|
14533
|
+
for (let i = 0;i < source.length; ++i)
|
|
14534
|
+
target.push(source[i]);
|
|
14535
|
+
}
|
|
14413
14536
|
function fixFlowSeqItems(fc) {
|
|
14414
14537
|
if (fc.start.type === "flow-seq-start") {
|
|
14415
|
-
for (const
|
|
14416
|
-
if (
|
|
14417
|
-
if (
|
|
14418
|
-
|
|
14419
|
-
delete
|
|
14420
|
-
if (isFlowToken(
|
|
14421
|
-
if (
|
|
14422
|
-
|
|
14538
|
+
for (const it3 of fc.items) {
|
|
14539
|
+
if (it3.sep && !it3.value && !includesToken(it3.start, "explicit-key-ind") && !includesToken(it3.sep, "map-value-ind")) {
|
|
14540
|
+
if (it3.key)
|
|
14541
|
+
it3.value = it3.key;
|
|
14542
|
+
delete it3.key;
|
|
14543
|
+
if (isFlowToken(it3.value)) {
|
|
14544
|
+
if (it3.value.end)
|
|
14545
|
+
arrayPushArray(it3.value.end, it3.sep);
|
|
14423
14546
|
else
|
|
14424
|
-
|
|
14547
|
+
it3.value.end = it3.sep;
|
|
14425
14548
|
} else
|
|
14426
|
-
|
|
14427
|
-
delete
|
|
14549
|
+
arrayPushArray(it3.start, it3.sep);
|
|
14550
|
+
delete it3.sep;
|
|
14428
14551
|
}
|
|
14429
14552
|
}
|
|
14430
14553
|
}
|
|
@@ -14504,13 +14627,13 @@ var require_parser = __commonJS((exports) => {
|
|
|
14504
14627
|
yield* this.pop();
|
|
14505
14628
|
}
|
|
14506
14629
|
get sourceToken() {
|
|
14507
|
-
const
|
|
14630
|
+
const st3 = {
|
|
14508
14631
|
type: this.type,
|
|
14509
14632
|
offset: this.offset,
|
|
14510
14633
|
indent: this.indent,
|
|
14511
14634
|
source: this.source
|
|
14512
14635
|
};
|
|
14513
|
-
return
|
|
14636
|
+
return st3;
|
|
14514
14637
|
}
|
|
14515
14638
|
*step() {
|
|
14516
14639
|
const top = this.peek(1);
|
|
@@ -14574,36 +14697,36 @@ var require_parser = __commonJS((exports) => {
|
|
|
14574
14697
|
top.props.push(token);
|
|
14575
14698
|
break;
|
|
14576
14699
|
case "block-map": {
|
|
14577
|
-
const
|
|
14578
|
-
if (
|
|
14700
|
+
const it3 = top.items[top.items.length - 1];
|
|
14701
|
+
if (it3.value) {
|
|
14579
14702
|
top.items.push({ start: [], key: token, sep: [] });
|
|
14580
14703
|
this.onKeyLine = true;
|
|
14581
14704
|
return;
|
|
14582
|
-
} else if (
|
|
14583
|
-
|
|
14705
|
+
} else if (it3.sep) {
|
|
14706
|
+
it3.value = token;
|
|
14584
14707
|
} else {
|
|
14585
|
-
Object.assign(
|
|
14586
|
-
this.onKeyLine = !
|
|
14708
|
+
Object.assign(it3, { key: token, sep: [] });
|
|
14709
|
+
this.onKeyLine = !it3.explicitKey;
|
|
14587
14710
|
return;
|
|
14588
14711
|
}
|
|
14589
14712
|
break;
|
|
14590
14713
|
}
|
|
14591
14714
|
case "block-seq": {
|
|
14592
|
-
const
|
|
14593
|
-
if (
|
|
14715
|
+
const it3 = top.items[top.items.length - 1];
|
|
14716
|
+
if (it3.value)
|
|
14594
14717
|
top.items.push({ start: [], value: token });
|
|
14595
14718
|
else
|
|
14596
|
-
|
|
14719
|
+
it3.value = token;
|
|
14597
14720
|
break;
|
|
14598
14721
|
}
|
|
14599
14722
|
case "flow-collection": {
|
|
14600
|
-
const
|
|
14601
|
-
if (!
|
|
14723
|
+
const it3 = top.items[top.items.length - 1];
|
|
14724
|
+
if (!it3 || it3.value)
|
|
14602
14725
|
top.items.push({ start: [], key: token, sep: [] });
|
|
14603
|
-
else if (
|
|
14604
|
-
|
|
14726
|
+
else if (it3.sep)
|
|
14727
|
+
it3.value = token;
|
|
14605
14728
|
else
|
|
14606
|
-
Object.assign(
|
|
14729
|
+
Object.assign(it3, { key: token, sep: [] });
|
|
14607
14730
|
return;
|
|
14608
14731
|
}
|
|
14609
14732
|
default:
|
|
@@ -14612,7 +14735,7 @@ var require_parser = __commonJS((exports) => {
|
|
|
14612
14735
|
}
|
|
14613
14736
|
if ((top.type === "document" || top.type === "block-map" || top.type === "block-seq") && (token.type === "block-map" || token.type === "block-seq")) {
|
|
14614
14737
|
const last = token.items[token.items.length - 1];
|
|
14615
|
-
if (last && !last.sep && !last.value && last.start.length > 0 && findNonEmptyIndex(last.start) === -1 && (token.indent === 0 || last.start.every((
|
|
14738
|
+
if (last && !last.sep && !last.value && last.start.length > 0 && findNonEmptyIndex(last.start) === -1 && (token.indent === 0 || last.start.every((st3) => st3.type !== "comment" || st3.indent < token.indent))) {
|
|
14616
14739
|
if (top.type === "document")
|
|
14617
14740
|
top.end = last.start;
|
|
14618
14741
|
else
|
|
@@ -14735,60 +14858,60 @@ var require_parser = __commonJS((exports) => {
|
|
|
14735
14858
|
}
|
|
14736
14859
|
}
|
|
14737
14860
|
*blockMap(map) {
|
|
14738
|
-
const
|
|
14861
|
+
const it3 = map.items[map.items.length - 1];
|
|
14739
14862
|
switch (this.type) {
|
|
14740
14863
|
case "newline":
|
|
14741
14864
|
this.onKeyLine = false;
|
|
14742
|
-
if (
|
|
14743
|
-
const end = "end" in
|
|
14865
|
+
if (it3.value) {
|
|
14866
|
+
const end = "end" in it3.value ? it3.value.end : undefined;
|
|
14744
14867
|
const last = Array.isArray(end) ? end[end.length - 1] : undefined;
|
|
14745
14868
|
if (last?.type === "comment")
|
|
14746
14869
|
end?.push(this.sourceToken);
|
|
14747
14870
|
else
|
|
14748
14871
|
map.items.push({ start: [this.sourceToken] });
|
|
14749
|
-
} else if (
|
|
14750
|
-
|
|
14872
|
+
} else if (it3.sep) {
|
|
14873
|
+
it3.sep.push(this.sourceToken);
|
|
14751
14874
|
} else {
|
|
14752
|
-
|
|
14875
|
+
it3.start.push(this.sourceToken);
|
|
14753
14876
|
}
|
|
14754
14877
|
return;
|
|
14755
14878
|
case "space":
|
|
14756
14879
|
case "comment":
|
|
14757
|
-
if (
|
|
14880
|
+
if (it3.value) {
|
|
14758
14881
|
map.items.push({ start: [this.sourceToken] });
|
|
14759
|
-
} else if (
|
|
14760
|
-
|
|
14882
|
+
} else if (it3.sep) {
|
|
14883
|
+
it3.sep.push(this.sourceToken);
|
|
14761
14884
|
} else {
|
|
14762
|
-
if (this.atIndentedComment(
|
|
14885
|
+
if (this.atIndentedComment(it3.start, map.indent)) {
|
|
14763
14886
|
const prev = map.items[map.items.length - 2];
|
|
14764
14887
|
const end = prev?.value?.end;
|
|
14765
14888
|
if (Array.isArray(end)) {
|
|
14766
|
-
|
|
14889
|
+
arrayPushArray(end, it3.start);
|
|
14767
14890
|
end.push(this.sourceToken);
|
|
14768
14891
|
map.items.pop();
|
|
14769
14892
|
return;
|
|
14770
14893
|
}
|
|
14771
14894
|
}
|
|
14772
|
-
|
|
14895
|
+
it3.start.push(this.sourceToken);
|
|
14773
14896
|
}
|
|
14774
14897
|
return;
|
|
14775
14898
|
}
|
|
14776
14899
|
if (this.indent >= map.indent) {
|
|
14777
14900
|
const atMapIndent = !this.onKeyLine && this.indent === map.indent;
|
|
14778
|
-
const atNextItem = atMapIndent && (
|
|
14901
|
+
const atNextItem = atMapIndent && (it3.sep || it3.explicitKey) && this.type !== "seq-item-ind";
|
|
14779
14902
|
let start = [];
|
|
14780
|
-
if (atNextItem &&
|
|
14903
|
+
if (atNextItem && it3.sep && !it3.value) {
|
|
14781
14904
|
const nl = [];
|
|
14782
|
-
for (let i = 0;i <
|
|
14783
|
-
const
|
|
14784
|
-
switch (
|
|
14905
|
+
for (let i = 0;i < it3.sep.length; ++i) {
|
|
14906
|
+
const st3 = it3.sep[i];
|
|
14907
|
+
switch (st3.type) {
|
|
14785
14908
|
case "newline":
|
|
14786
14909
|
nl.push(i);
|
|
14787
14910
|
break;
|
|
14788
14911
|
case "space":
|
|
14789
14912
|
break;
|
|
14790
14913
|
case "comment":
|
|
14791
|
-
if (
|
|
14914
|
+
if (st3.indent > map.indent)
|
|
14792
14915
|
nl.length = 0;
|
|
14793
14916
|
break;
|
|
14794
14917
|
default:
|
|
@@ -14796,26 +14919,26 @@ var require_parser = __commonJS((exports) => {
|
|
|
14796
14919
|
}
|
|
14797
14920
|
}
|
|
14798
14921
|
if (nl.length >= 2)
|
|
14799
|
-
start =
|
|
14922
|
+
start = it3.sep.splice(nl[1]);
|
|
14800
14923
|
}
|
|
14801
14924
|
switch (this.type) {
|
|
14802
14925
|
case "anchor":
|
|
14803
14926
|
case "tag":
|
|
14804
|
-
if (atNextItem ||
|
|
14927
|
+
if (atNextItem || it3.value) {
|
|
14805
14928
|
start.push(this.sourceToken);
|
|
14806
14929
|
map.items.push({ start });
|
|
14807
14930
|
this.onKeyLine = true;
|
|
14808
|
-
} else if (
|
|
14809
|
-
|
|
14931
|
+
} else if (it3.sep) {
|
|
14932
|
+
it3.sep.push(this.sourceToken);
|
|
14810
14933
|
} else {
|
|
14811
|
-
|
|
14934
|
+
it3.start.push(this.sourceToken);
|
|
14812
14935
|
}
|
|
14813
14936
|
return;
|
|
14814
14937
|
case "explicit-key-ind":
|
|
14815
|
-
if (!
|
|
14816
|
-
|
|
14817
|
-
|
|
14818
|
-
} else if (atNextItem ||
|
|
14938
|
+
if (!it3.sep && !it3.explicitKey) {
|
|
14939
|
+
it3.start.push(this.sourceToken);
|
|
14940
|
+
it3.explicitKey = true;
|
|
14941
|
+
} else if (atNextItem || it3.value) {
|
|
14819
14942
|
start.push(this.sourceToken);
|
|
14820
14943
|
map.items.push({ start, explicitKey: true });
|
|
14821
14944
|
} else {
|
|
@@ -14829,12 +14952,12 @@ var require_parser = __commonJS((exports) => {
|
|
|
14829
14952
|
this.onKeyLine = true;
|
|
14830
14953
|
return;
|
|
14831
14954
|
case "map-value-ind":
|
|
14832
|
-
if (
|
|
14833
|
-
if (!
|
|
14834
|
-
if (includesToken(
|
|
14835
|
-
Object.assign(
|
|
14955
|
+
if (it3.explicitKey) {
|
|
14956
|
+
if (!it3.sep) {
|
|
14957
|
+
if (includesToken(it3.start, "newline")) {
|
|
14958
|
+
Object.assign(it3, { key: null, sep: [this.sourceToken] });
|
|
14836
14959
|
} else {
|
|
14837
|
-
const start2 = getFirstKeyStartProps(
|
|
14960
|
+
const start2 = getFirstKeyStartProps(it3.start);
|
|
14838
14961
|
this.stack.push({
|
|
14839
14962
|
type: "block-map",
|
|
14840
14963
|
offset: this.offset,
|
|
@@ -14842,22 +14965,22 @@ var require_parser = __commonJS((exports) => {
|
|
|
14842
14965
|
items: [{ start: start2, key: null, sep: [this.sourceToken] }]
|
|
14843
14966
|
});
|
|
14844
14967
|
}
|
|
14845
|
-
} else if (
|
|
14968
|
+
} else if (it3.value) {
|
|
14846
14969
|
map.items.push({ start: [], key: null, sep: [this.sourceToken] });
|
|
14847
|
-
} else if (includesToken(
|
|
14970
|
+
} else if (includesToken(it3.sep, "map-value-ind")) {
|
|
14848
14971
|
this.stack.push({
|
|
14849
14972
|
type: "block-map",
|
|
14850
14973
|
offset: this.offset,
|
|
14851
14974
|
indent: this.indent,
|
|
14852
14975
|
items: [{ start, key: null, sep: [this.sourceToken] }]
|
|
14853
14976
|
});
|
|
14854
|
-
} else if (isFlowToken(
|
|
14855
|
-
const start2 = getFirstKeyStartProps(
|
|
14856
|
-
const key =
|
|
14857
|
-
const sep =
|
|
14977
|
+
} else if (isFlowToken(it3.key) && !includesToken(it3.sep, "newline")) {
|
|
14978
|
+
const start2 = getFirstKeyStartProps(it3.start);
|
|
14979
|
+
const key = it3.key;
|
|
14980
|
+
const sep = it3.sep;
|
|
14858
14981
|
sep.push(this.sourceToken);
|
|
14859
|
-
delete
|
|
14860
|
-
delete
|
|
14982
|
+
delete it3.key;
|
|
14983
|
+
delete it3.sep;
|
|
14861
14984
|
this.stack.push({
|
|
14862
14985
|
type: "block-map",
|
|
14863
14986
|
offset: this.offset,
|
|
@@ -14865,16 +14988,16 @@ var require_parser = __commonJS((exports) => {
|
|
|
14865
14988
|
items: [{ start: start2, key, sep }]
|
|
14866
14989
|
});
|
|
14867
14990
|
} else if (start.length > 0) {
|
|
14868
|
-
|
|
14991
|
+
it3.sep = it3.sep.concat(start, this.sourceToken);
|
|
14869
14992
|
} else {
|
|
14870
|
-
|
|
14993
|
+
it3.sep.push(this.sourceToken);
|
|
14871
14994
|
}
|
|
14872
14995
|
} else {
|
|
14873
|
-
if (!
|
|
14874
|
-
Object.assign(
|
|
14875
|
-
} else if (
|
|
14996
|
+
if (!it3.sep) {
|
|
14997
|
+
Object.assign(it3, { key: null, sep: [this.sourceToken] });
|
|
14998
|
+
} else if (it3.value || atNextItem) {
|
|
14876
14999
|
map.items.push({ start, key: null, sep: [this.sourceToken] });
|
|
14877
|
-
} else if (includesToken(
|
|
15000
|
+
} else if (includesToken(it3.sep, "map-value-ind")) {
|
|
14878
15001
|
this.stack.push({
|
|
14879
15002
|
type: "block-map",
|
|
14880
15003
|
offset: this.offset,
|
|
@@ -14882,7 +15005,7 @@ var require_parser = __commonJS((exports) => {
|
|
|
14882
15005
|
items: [{ start: [], key: null, sep: [this.sourceToken] }]
|
|
14883
15006
|
});
|
|
14884
15007
|
} else {
|
|
14885
|
-
|
|
15008
|
+
it3.sep.push(this.sourceToken);
|
|
14886
15009
|
}
|
|
14887
15010
|
}
|
|
14888
15011
|
this.onKeyLine = true;
|
|
@@ -14892,13 +15015,13 @@ var require_parser = __commonJS((exports) => {
|
|
|
14892
15015
|
case "single-quoted-scalar":
|
|
14893
15016
|
case "double-quoted-scalar": {
|
|
14894
15017
|
const fs = this.flowScalar(this.type);
|
|
14895
|
-
if (atNextItem ||
|
|
15018
|
+
if (atNextItem || it3.value) {
|
|
14896
15019
|
map.items.push({ start, key: fs, sep: [] });
|
|
14897
15020
|
this.onKeyLine = true;
|
|
14898
|
-
} else if (
|
|
15021
|
+
} else if (it3.sep) {
|
|
14899
15022
|
this.stack.push(fs);
|
|
14900
15023
|
} else {
|
|
14901
|
-
Object.assign(
|
|
15024
|
+
Object.assign(it3, { key: fs, sep: [] });
|
|
14902
15025
|
this.onKeyLine = true;
|
|
14903
15026
|
}
|
|
14904
15027
|
return;
|
|
@@ -14907,7 +15030,7 @@ var require_parser = __commonJS((exports) => {
|
|
|
14907
15030
|
const bv = this.startBlockValue(map);
|
|
14908
15031
|
if (bv) {
|
|
14909
15032
|
if (bv.type === "block-seq") {
|
|
14910
|
-
if (!
|
|
15033
|
+
if (!it3.explicitKey && it3.sep && !includesToken(it3.sep, "newline")) {
|
|
14911
15034
|
yield* this.pop({
|
|
14912
15035
|
type: "error",
|
|
14913
15036
|
offset: this.offset,
|
|
@@ -14929,50 +15052,50 @@ var require_parser = __commonJS((exports) => {
|
|
|
14929
15052
|
yield* this.step();
|
|
14930
15053
|
}
|
|
14931
15054
|
*blockSequence(seq) {
|
|
14932
|
-
const
|
|
15055
|
+
const it3 = seq.items[seq.items.length - 1];
|
|
14933
15056
|
switch (this.type) {
|
|
14934
15057
|
case "newline":
|
|
14935
|
-
if (
|
|
14936
|
-
const end = "end" in
|
|
15058
|
+
if (it3.value) {
|
|
15059
|
+
const end = "end" in it3.value ? it3.value.end : undefined;
|
|
14937
15060
|
const last = Array.isArray(end) ? end[end.length - 1] : undefined;
|
|
14938
15061
|
if (last?.type === "comment")
|
|
14939
15062
|
end?.push(this.sourceToken);
|
|
14940
15063
|
else
|
|
14941
15064
|
seq.items.push({ start: [this.sourceToken] });
|
|
14942
15065
|
} else
|
|
14943
|
-
|
|
15066
|
+
it3.start.push(this.sourceToken);
|
|
14944
15067
|
return;
|
|
14945
15068
|
case "space":
|
|
14946
15069
|
case "comment":
|
|
14947
|
-
if (
|
|
15070
|
+
if (it3.value)
|
|
14948
15071
|
seq.items.push({ start: [this.sourceToken] });
|
|
14949
15072
|
else {
|
|
14950
|
-
if (this.atIndentedComment(
|
|
15073
|
+
if (this.atIndentedComment(it3.start, seq.indent)) {
|
|
14951
15074
|
const prev = seq.items[seq.items.length - 2];
|
|
14952
15075
|
const end = prev?.value?.end;
|
|
14953
15076
|
if (Array.isArray(end)) {
|
|
14954
|
-
|
|
15077
|
+
arrayPushArray(end, it3.start);
|
|
14955
15078
|
end.push(this.sourceToken);
|
|
14956
15079
|
seq.items.pop();
|
|
14957
15080
|
return;
|
|
14958
15081
|
}
|
|
14959
15082
|
}
|
|
14960
|
-
|
|
15083
|
+
it3.start.push(this.sourceToken);
|
|
14961
15084
|
}
|
|
14962
15085
|
return;
|
|
14963
15086
|
case "anchor":
|
|
14964
15087
|
case "tag":
|
|
14965
|
-
if (
|
|
15088
|
+
if (it3.value || this.indent <= seq.indent)
|
|
14966
15089
|
break;
|
|
14967
|
-
|
|
15090
|
+
it3.start.push(this.sourceToken);
|
|
14968
15091
|
return;
|
|
14969
15092
|
case "seq-item-ind":
|
|
14970
15093
|
if (this.indent !== seq.indent)
|
|
14971
15094
|
break;
|
|
14972
|
-
if (
|
|
15095
|
+
if (it3.value || includesToken(it3.start, "seq-item-ind"))
|
|
14973
15096
|
seq.items.push({ start: [this.sourceToken] });
|
|
14974
15097
|
else
|
|
14975
|
-
|
|
15098
|
+
it3.start.push(this.sourceToken);
|
|
14976
15099
|
return;
|
|
14977
15100
|
}
|
|
14978
15101
|
if (this.indent > seq.indent) {
|
|
@@ -14986,7 +15109,7 @@ var require_parser = __commonJS((exports) => {
|
|
|
14986
15109
|
yield* this.step();
|
|
14987
15110
|
}
|
|
14988
15111
|
*flowCollection(fc) {
|
|
14989
|
-
const
|
|
15112
|
+
const it3 = fc.items[fc.items.length - 1];
|
|
14990
15113
|
if (this.type === "flow-error-end") {
|
|
14991
15114
|
let top;
|
|
14992
15115
|
do {
|
|
@@ -14997,42 +15120,42 @@ var require_parser = __commonJS((exports) => {
|
|
|
14997
15120
|
switch (this.type) {
|
|
14998
15121
|
case "comma":
|
|
14999
15122
|
case "explicit-key-ind":
|
|
15000
|
-
if (!
|
|
15123
|
+
if (!it3 || it3.sep)
|
|
15001
15124
|
fc.items.push({ start: [this.sourceToken] });
|
|
15002
15125
|
else
|
|
15003
|
-
|
|
15126
|
+
it3.start.push(this.sourceToken);
|
|
15004
15127
|
return;
|
|
15005
15128
|
case "map-value-ind":
|
|
15006
|
-
if (!
|
|
15129
|
+
if (!it3 || it3.value)
|
|
15007
15130
|
fc.items.push({ start: [], key: null, sep: [this.sourceToken] });
|
|
15008
|
-
else if (
|
|
15009
|
-
|
|
15131
|
+
else if (it3.sep)
|
|
15132
|
+
it3.sep.push(this.sourceToken);
|
|
15010
15133
|
else
|
|
15011
|
-
Object.assign(
|
|
15134
|
+
Object.assign(it3, { key: null, sep: [this.sourceToken] });
|
|
15012
15135
|
return;
|
|
15013
15136
|
case "space":
|
|
15014
15137
|
case "comment":
|
|
15015
15138
|
case "newline":
|
|
15016
15139
|
case "anchor":
|
|
15017
15140
|
case "tag":
|
|
15018
|
-
if (!
|
|
15141
|
+
if (!it3 || it3.value)
|
|
15019
15142
|
fc.items.push({ start: [this.sourceToken] });
|
|
15020
|
-
else if (
|
|
15021
|
-
|
|
15143
|
+
else if (it3.sep)
|
|
15144
|
+
it3.sep.push(this.sourceToken);
|
|
15022
15145
|
else
|
|
15023
|
-
|
|
15146
|
+
it3.start.push(this.sourceToken);
|
|
15024
15147
|
return;
|
|
15025
15148
|
case "alias":
|
|
15026
15149
|
case "scalar":
|
|
15027
15150
|
case "single-quoted-scalar":
|
|
15028
15151
|
case "double-quoted-scalar": {
|
|
15029
15152
|
const fs = this.flowScalar(this.type);
|
|
15030
|
-
if (!
|
|
15153
|
+
if (!it3 || it3.value)
|
|
15031
15154
|
fc.items.push({ start: [], key: fs, sep: [] });
|
|
15032
|
-
else if (
|
|
15155
|
+
else if (it3.sep)
|
|
15033
15156
|
this.stack.push(fs);
|
|
15034
15157
|
else
|
|
15035
|
-
Object.assign(
|
|
15158
|
+
Object.assign(it3, { key: fs, sep: [] });
|
|
15036
15159
|
return;
|
|
15037
15160
|
}
|
|
15038
15161
|
case "flow-map-end":
|
|
@@ -15151,7 +15274,7 @@ var require_parser = __commonJS((exports) => {
|
|
|
15151
15274
|
return false;
|
|
15152
15275
|
if (this.indent <= indent)
|
|
15153
15276
|
return false;
|
|
15154
|
-
return start.every((
|
|
15277
|
+
return start.every((st3) => st3.type === "newline" || st3.type === "space");
|
|
15155
15278
|
}
|
|
15156
15279
|
*documentEnd(docEnd) {
|
|
15157
15280
|
if (this.type !== "doc-mode") {
|
|
@@ -15191,7 +15314,7 @@ var require_parser = __commonJS((exports) => {
|
|
|
15191
15314
|
exports.Parser = Parser;
|
|
15192
15315
|
});
|
|
15193
15316
|
|
|
15194
|
-
// node_modules/.bun/yaml@2.
|
|
15317
|
+
// node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/public-api.js
|
|
15195
15318
|
var require_public_api = __commonJS((exports) => {
|
|
15196
15319
|
var composer = require_composer();
|
|
15197
15320
|
var Document = require_Document();
|
|
@@ -15285,7 +15408,7 @@ var require_public_api = __commonJS((exports) => {
|
|
|
15285
15408
|
exports.stringify = stringify;
|
|
15286
15409
|
});
|
|
15287
15410
|
|
|
15288
|
-
// node_modules/.bun/yaml@2.
|
|
15411
|
+
// node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/index.js
|
|
15289
15412
|
var composer, Document, Schema, errors2, Alias, identity, Pair, Scalar, YAMLMap, YAMLSeq, cst, lexer, lineCounter, parser, publicApi, visit, $Composer, $Document, $Schema, $YAMLError, $YAMLParseError, $YAMLWarning, $Alias, $isAlias, $isCollection, $isDocument, $isMap, $isNode, $isPair, $isScalar, $isSeq, $Pair, $Scalar, $YAMLMap, $YAMLSeq, $Lexer, $LineCounter, $Parser, $parse, $parseAllDocuments, $parseDocument, $stringify, $visit, $visitAsync;
|
|
15290
15413
|
var init_dist5 = __esm(() => {
|
|
15291
15414
|
composer = require_composer();
|
|
@@ -15968,8 +16091,8 @@ async function launchContainer(opts) {
|
|
|
15968
16091
|
let sshAuthSock = Bun.env.SSH_AUTH_SOCK;
|
|
15969
16092
|
if (sshAuthSock) {
|
|
15970
16093
|
try {
|
|
15971
|
-
const
|
|
15972
|
-
if (!
|
|
16094
|
+
const st3 = await stat(sshAuthSock);
|
|
16095
|
+
if (!st3.isSocket() || (st3.mode & 7) === 0) {
|
|
15973
16096
|
log.debug(`[docker] skipping SSH_AUTH_SOCK (not world-accessible): ${sshAuthSock}`);
|
|
15974
16097
|
sshAuthSock = undefined;
|
|
15975
16098
|
}
|
|
@@ -16413,7 +16536,7 @@ var init_archive_state_service = __esm(() => {
|
|
|
16413
16536
|
|
|
16414
16537
|
// backend/src/adapters/agent-runtime.ts
|
|
16415
16538
|
import { chmod as chmod2, mkdir as mkdir3 } from "fs/promises";
|
|
16416
|
-
import { dirname as dirname4, join as join9 } from "path";
|
|
16539
|
+
import { dirname as dirname4, join as join9, resolve as resolve6 } from "path";
|
|
16417
16540
|
function shellQuote(value) {
|
|
16418
16541
|
return `'${value.replaceAll("'", "'\\''")}'`;
|
|
16419
16542
|
}
|
|
@@ -16432,6 +16555,7 @@ from pathlib import Path
|
|
|
16432
16555
|
|
|
16433
16556
|
|
|
16434
16557
|
CONTROL_ENV_PATH = Path(__file__).resolve().with_name("control.env")
|
|
16558
|
+
CONTROL_REQUEST_TIMEOUT_SECONDS = 2
|
|
16435
16559
|
|
|
16436
16560
|
|
|
16437
16561
|
def read_control_env():
|
|
@@ -16461,6 +16585,7 @@ def build_parser():
|
|
|
16461
16585
|
|
|
16462
16586
|
status_changed = subparsers.add_parser("status-changed")
|
|
16463
16587
|
status_changed.add_argument("--lifecycle", choices=["starting", "running", "idle", "stopped"], required=True)
|
|
16588
|
+
status_changed.add_argument("--best-effort", action="store_true")
|
|
16464
16589
|
|
|
16465
16590
|
pr_opened = subparsers.add_parser("pr-opened")
|
|
16466
16591
|
pr_opened.add_argument("--url")
|
|
@@ -16470,6 +16595,11 @@ def build_parser():
|
|
|
16470
16595
|
|
|
16471
16596
|
subparsers.add_parser("claude-user-prompt-submit")
|
|
16472
16597
|
subparsers.add_parser("claude-post-tool-use")
|
|
16598
|
+
subparsers.add_parser("codex-session-start")
|
|
16599
|
+
subparsers.add_parser("codex-user-prompt-submit")
|
|
16600
|
+
subparsers.add_parser("codex-permission-request")
|
|
16601
|
+
subparsers.add_parser("codex-post-tool-use")
|
|
16602
|
+
subparsers.add_parser("codex-stop")
|
|
16473
16603
|
|
|
16474
16604
|
return parser
|
|
16475
16605
|
|
|
@@ -16512,6 +16642,41 @@ def read_hook_payload():
|
|
|
16512
16642
|
return parsed if isinstance(parsed, dict) else {}
|
|
16513
16643
|
|
|
16514
16644
|
|
|
16645
|
+
def iter_string_values(value):
|
|
16646
|
+
if isinstance(value, str):
|
|
16647
|
+
yield value
|
|
16648
|
+
return
|
|
16649
|
+
if isinstance(value, dict):
|
|
16650
|
+
for child in value.values():
|
|
16651
|
+
yield from iter_string_values(child)
|
|
16652
|
+
return
|
|
16653
|
+
if isinstance(value, list):
|
|
16654
|
+
for child in value:
|
|
16655
|
+
yield from iter_string_values(child)
|
|
16656
|
+
|
|
16657
|
+
|
|
16658
|
+
def find_pr_url(value):
|
|
16659
|
+
for text in iter_string_values(value):
|
|
16660
|
+
match = re.search(r"https://github\\.com/[^\\s\\"]+/pull/\\d+", text)
|
|
16661
|
+
if match:
|
|
16662
|
+
return match.group(0)
|
|
16663
|
+
return None
|
|
16664
|
+
|
|
16665
|
+
|
|
16666
|
+
def maybe_send_pr_opened(hook_payload, control_env):
|
|
16667
|
+
tool_name = hook_payload.get("tool_name")
|
|
16668
|
+
tool_input = hook_payload.get("tool_input")
|
|
16669
|
+
if not isinstance(tool_input, dict) or tool_name != "Bash":
|
|
16670
|
+
return True
|
|
16671
|
+
|
|
16672
|
+
command = tool_input.get("command")
|
|
16673
|
+
if not isinstance(command, str) or "gh pr create" not in command:
|
|
16674
|
+
return True
|
|
16675
|
+
|
|
16676
|
+
pr_args = argparse.Namespace(url=find_pr_url(hook_payload.get("tool_response")))
|
|
16677
|
+
return send_payload(build_payload("pr-opened", pr_args, control_env), control_env)
|
|
16678
|
+
|
|
16679
|
+
|
|
16515
16680
|
def send_payload(payload, control_env):
|
|
16516
16681
|
request = urllib.request.Request(
|
|
16517
16682
|
control_env["WEBMUX_CONTROL_URL"],
|
|
@@ -16524,7 +16689,7 @@ def send_payload(payload, control_env):
|
|
|
16524
16689
|
)
|
|
16525
16690
|
|
|
16526
16691
|
try:
|
|
16527
|
-
with urllib.request.urlopen(request, timeout=
|
|
16692
|
+
with urllib.request.urlopen(request, timeout=CONTROL_REQUEST_TIMEOUT_SECONDS) as response:
|
|
16528
16693
|
if response.status < 200 or response.status >= 300:
|
|
16529
16694
|
print(f"control endpoint returned HTTP {response.status}", file=sys.stderr)
|
|
16530
16695
|
return False
|
|
@@ -16558,34 +16723,40 @@ def main():
|
|
|
16558
16723
|
print(f"missing control env keys: {', '.join(missing)}", file=sys.stderr)
|
|
16559
16724
|
return 1
|
|
16560
16725
|
|
|
16726
|
+
if parsed.command == "codex-session-start":
|
|
16727
|
+
send_payload(build_payload("status-changed", argparse.Namespace(lifecycle="idle"), control_env), control_env)
|
|
16728
|
+
return 0
|
|
16729
|
+
|
|
16730
|
+
if parsed.command == "codex-user-prompt-submit":
|
|
16731
|
+
send_payload(build_payload("status-changed", argparse.Namespace(lifecycle="running"), control_env), control_env)
|
|
16732
|
+
return 0
|
|
16733
|
+
|
|
16561
16734
|
if parsed.command == "claude-user-prompt-submit":
|
|
16562
16735
|
if not send_payload(build_payload("status-changed", argparse.Namespace(lifecycle="running"), control_env), control_env):
|
|
16563
16736
|
return 1
|
|
16564
16737
|
return 0
|
|
16565
16738
|
|
|
16566
|
-
if parsed.command == "
|
|
16567
|
-
|
|
16568
|
-
|
|
16569
|
-
tool_input = hook_payload.get("tool_input")
|
|
16570
|
-
if not isinstance(tool_input, dict) or tool_name != "Bash":
|
|
16571
|
-
return 0
|
|
16739
|
+
if parsed.command == "codex-permission-request":
|
|
16740
|
+
send_payload(build_payload("status-changed", argparse.Namespace(lifecycle="idle"), control_env), control_env)
|
|
16741
|
+
return 0
|
|
16572
16742
|
|
|
16573
|
-
|
|
16574
|
-
|
|
16575
|
-
|
|
16743
|
+
if parsed.command == "codex-post-tool-use":
|
|
16744
|
+
hook_payload = read_hook_payload()
|
|
16745
|
+
maybe_send_pr_opened(hook_payload, control_env)
|
|
16746
|
+
return 0
|
|
16576
16747
|
|
|
16577
|
-
|
|
16578
|
-
|
|
16579
|
-
if
|
|
16580
|
-
match = re.search(r"https://github\\.com/[^\\s\\"]+/pull/\\d+", tool_response)
|
|
16581
|
-
if match:
|
|
16582
|
-
pr_args.url = match.group(0)
|
|
16748
|
+
if parsed.command == "claude-post-tool-use":
|
|
16749
|
+
hook_payload = read_hook_payload()
|
|
16750
|
+
return 0 if maybe_send_pr_opened(hook_payload, control_env) else 1
|
|
16583
16751
|
|
|
16584
|
-
|
|
16752
|
+
if parsed.command == "codex-stop":
|
|
16753
|
+
send_payload(build_payload("agent-stopped", parsed, control_env), control_env)
|
|
16754
|
+
print(json.dumps({}))
|
|
16755
|
+
return 0
|
|
16585
16756
|
|
|
16586
16757
|
payload = build_payload(parsed.command, parsed, control_env)
|
|
16587
16758
|
if not send_payload(payload, control_env):
|
|
16588
|
-
return 1
|
|
16759
|
+
return 0 if getattr(parsed, "best_effort", False) else 1
|
|
16589
16760
|
|
|
16590
16761
|
return 0
|
|
16591
16762
|
|
|
@@ -16655,6 +16826,81 @@ function buildClaudeHookSettings(input) {
|
|
|
16655
16826
|
}
|
|
16656
16827
|
};
|
|
16657
16828
|
}
|
|
16829
|
+
function buildCodexHookSettings(input) {
|
|
16830
|
+
const statusCommand = `${shellQuote(input.agentCtlPath)} status-changed --lifecycle running --best-effort`;
|
|
16831
|
+
return {
|
|
16832
|
+
hooks: {
|
|
16833
|
+
SessionStart: [
|
|
16834
|
+
{
|
|
16835
|
+
matcher: "startup|resume|clear",
|
|
16836
|
+
hooks: [
|
|
16837
|
+
{
|
|
16838
|
+
type: "command",
|
|
16839
|
+
command: `${shellQuote(input.agentCtlPath)} codex-session-start`,
|
|
16840
|
+
timeout: 30
|
|
16841
|
+
}
|
|
16842
|
+
]
|
|
16843
|
+
}
|
|
16844
|
+
],
|
|
16845
|
+
UserPromptSubmit: [
|
|
16846
|
+
{
|
|
16847
|
+
hooks: [
|
|
16848
|
+
{
|
|
16849
|
+
type: "command",
|
|
16850
|
+
command: `${shellQuote(input.agentCtlPath)} codex-user-prompt-submit`,
|
|
16851
|
+
timeout: 30
|
|
16852
|
+
}
|
|
16853
|
+
]
|
|
16854
|
+
}
|
|
16855
|
+
],
|
|
16856
|
+
PermissionRequest: [
|
|
16857
|
+
{
|
|
16858
|
+
hooks: [
|
|
16859
|
+
{
|
|
16860
|
+
type: "command",
|
|
16861
|
+
command: `${shellQuote(input.agentCtlPath)} codex-permission-request`,
|
|
16862
|
+
timeout: 30
|
|
16863
|
+
}
|
|
16864
|
+
]
|
|
16865
|
+
}
|
|
16866
|
+
],
|
|
16867
|
+
PreToolUse: [
|
|
16868
|
+
{
|
|
16869
|
+
hooks: [
|
|
16870
|
+
{
|
|
16871
|
+
type: "command",
|
|
16872
|
+
command: statusCommand,
|
|
16873
|
+
timeout: 30
|
|
16874
|
+
}
|
|
16875
|
+
]
|
|
16876
|
+
}
|
|
16877
|
+
],
|
|
16878
|
+
PostToolUse: [
|
|
16879
|
+
{
|
|
16880
|
+
matcher: "Bash",
|
|
16881
|
+
hooks: [
|
|
16882
|
+
{
|
|
16883
|
+
type: "command",
|
|
16884
|
+
command: `${shellQuote(input.agentCtlPath)} codex-post-tool-use`,
|
|
16885
|
+
timeout: 30
|
|
16886
|
+
}
|
|
16887
|
+
]
|
|
16888
|
+
}
|
|
16889
|
+
],
|
|
16890
|
+
Stop: [
|
|
16891
|
+
{
|
|
16892
|
+
hooks: [
|
|
16893
|
+
{
|
|
16894
|
+
type: "command",
|
|
16895
|
+
command: `${shellQuote(input.agentCtlPath)} codex-stop`,
|
|
16896
|
+
timeout: 30
|
|
16897
|
+
}
|
|
16898
|
+
]
|
|
16899
|
+
}
|
|
16900
|
+
]
|
|
16901
|
+
}
|
|
16902
|
+
};
|
|
16903
|
+
}
|
|
16658
16904
|
async function mergeClaudeSettings(settingsPath, hookSettings) {
|
|
16659
16905
|
let existing = {};
|
|
16660
16906
|
try {
|
|
@@ -16674,13 +16920,77 @@ async function mergeClaudeSettings(settingsPath, hookSettings) {
|
|
|
16674
16920
|
await Bun.write(settingsPath, JSON.stringify(merged, null, 2) + `
|
|
16675
16921
|
`);
|
|
16676
16922
|
}
|
|
16923
|
+
function commandStartsWithAgentCtl(command, agentCtlPath) {
|
|
16924
|
+
const trimmedCommand = command.trimStart();
|
|
16925
|
+
const quotedAgentCtlPath = shellQuote(agentCtlPath);
|
|
16926
|
+
return trimmedCommand === agentCtlPath || trimmedCommand.startsWith(`${agentCtlPath} `) || trimmedCommand === quotedAgentCtlPath || trimmedCommand.startsWith(`${quotedAgentCtlPath} `);
|
|
16927
|
+
}
|
|
16928
|
+
function isWebmuxHookGroup(group, agentCtlPath) {
|
|
16929
|
+
if (!isRecord5(group) || !Array.isArray(group.hooks))
|
|
16930
|
+
return false;
|
|
16931
|
+
return group.hooks.some((hook) => isRecord5(hook) && typeof hook.command === "string" && commandStartsWithAgentCtl(hook.command, agentCtlPath));
|
|
16932
|
+
}
|
|
16933
|
+
async function mergeCodexHooksFile(hooksPath, hookSettings, agentCtlPath) {
|
|
16934
|
+
let existing = {};
|
|
16935
|
+
try {
|
|
16936
|
+
const file = Bun.file(hooksPath);
|
|
16937
|
+
if (await file.exists()) {
|
|
16938
|
+
const parsed = await file.json();
|
|
16939
|
+
if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) {
|
|
16940
|
+
existing = parsed;
|
|
16941
|
+
}
|
|
16942
|
+
}
|
|
16943
|
+
} catch {
|
|
16944
|
+
existing = {};
|
|
16945
|
+
}
|
|
16946
|
+
const existingHooks = isRecord5(existing.hooks) ? existing.hooks : {};
|
|
16947
|
+
const mergedHooks = { ...existingHooks };
|
|
16948
|
+
for (const [eventName, groups] of Object.entries(hookSettings)) {
|
|
16949
|
+
const eventGroups = existingHooks[eventName];
|
|
16950
|
+
const preservedGroups = Array.isArray(eventGroups) ? eventGroups.filter((group) => !isWebmuxHookGroup(group, agentCtlPath)) : [];
|
|
16951
|
+
mergedHooks[eventName] = [...preservedGroups, ...groups];
|
|
16952
|
+
}
|
|
16953
|
+
await Bun.write(hooksPath, JSON.stringify({ ...existing, hooks: mergedHooks }, null, 2) + `
|
|
16954
|
+
`);
|
|
16955
|
+
}
|
|
16956
|
+
async function resolveGitCommonDir(gitDir) {
|
|
16957
|
+
try {
|
|
16958
|
+
const commonDir = (await Bun.file(join9(gitDir, "commondir")).text()).trim();
|
|
16959
|
+
if (!commonDir)
|
|
16960
|
+
return gitDir;
|
|
16961
|
+
return commonDir.startsWith("/") ? commonDir : resolve6(gitDir, commonDir);
|
|
16962
|
+
} catch {
|
|
16963
|
+
return gitDir;
|
|
16964
|
+
}
|
|
16965
|
+
}
|
|
16966
|
+
async function ensureGeneratedCodexHooksIgnored(gitDir) {
|
|
16967
|
+
const commonDir = await resolveGitCommonDir(gitDir);
|
|
16968
|
+
const excludePath = join9(commonDir, "info", "exclude");
|
|
16969
|
+
let existing = "";
|
|
16970
|
+
try {
|
|
16971
|
+
existing = await Bun.file(excludePath).text();
|
|
16972
|
+
} catch {
|
|
16973
|
+
existing = "";
|
|
16974
|
+
}
|
|
16975
|
+
const lines = existing.split(/\r?\n/).map((line) => line.trim());
|
|
16976
|
+
if (lines.includes(GENERATED_CODEX_HOOKS_EXCLUDE))
|
|
16977
|
+
return;
|
|
16978
|
+
await mkdir3(dirname4(excludePath), { recursive: true });
|
|
16979
|
+
const separator = existing.length > 0 && !existing.endsWith(`
|
|
16980
|
+
`) ? `
|
|
16981
|
+
` : "";
|
|
16982
|
+
await Bun.write(excludePath, `${existing}${separator}${GENERATED_CODEX_HOOKS_EXCLUDE}
|
|
16983
|
+
`);
|
|
16984
|
+
}
|
|
16677
16985
|
async function ensureAgentRuntimeArtifacts(input) {
|
|
16678
16986
|
const storagePaths = getWorktreeStoragePaths(input.gitDir);
|
|
16679
16987
|
const artifacts = {
|
|
16680
16988
|
agentCtlPath: join9(storagePaths.webmuxDir, "webmux-agentctl"),
|
|
16681
|
-
claudeSettingsPath: join9(input.worktreePath, ".claude", "settings.local.json")
|
|
16989
|
+
claudeSettingsPath: join9(input.worktreePath, ".claude", "settings.local.json"),
|
|
16990
|
+
codexHooksPath: join9(input.worktreePath, ".codex", "hooks.json")
|
|
16682
16991
|
};
|
|
16683
16992
|
await mkdir3(dirname4(artifacts.claudeSettingsPath), { recursive: true });
|
|
16993
|
+
await mkdir3(dirname4(artifacts.codexHooksPath), { recursive: true });
|
|
16684
16994
|
await Bun.write(artifacts.agentCtlPath, buildAgentCtlScript());
|
|
16685
16995
|
await chmod2(artifacts.agentCtlPath, 493);
|
|
16686
16996
|
const hookSettings = buildClaudeHookSettings(artifacts);
|
|
@@ -16689,8 +16999,11 @@ async function ensureAgentRuntimeArtifacts(input) {
|
|
|
16689
16999
|
throw new Error("Invalid Claude hook settings");
|
|
16690
17000
|
}
|
|
16691
17001
|
await mergeClaudeSettings(artifacts.claudeSettingsPath, hooks);
|
|
17002
|
+
await ensureGeneratedCodexHooksIgnored(input.gitDir);
|
|
17003
|
+
await mergeCodexHooksFile(artifacts.codexHooksPath, buildCodexHookSettings(artifacts).hooks, artifacts.agentCtlPath);
|
|
16692
17004
|
return artifacts;
|
|
16693
17005
|
}
|
|
17006
|
+
var GENERATED_CODEX_HOOKS_EXCLUDE = ".codex/hooks.json";
|
|
16694
17007
|
var init_agent_runtime = __esm(() => {
|
|
16695
17008
|
init_fs();
|
|
16696
17009
|
});
|
|
@@ -16707,15 +17020,16 @@ function buildDockerRuntimeBootstrap(runtimeEnvPath) {
|
|
|
16707
17020
|
}
|
|
16708
17021
|
function buildBuiltInAgentInvocation(input) {
|
|
16709
17022
|
if (input.agent === "codex") {
|
|
17023
|
+
const hooksFlag = " --enable codex_hooks";
|
|
16710
17024
|
const yoloFlag2 = input.yolo ? " --yolo" : "";
|
|
16711
17025
|
if (input.launchMode === "resume") {
|
|
16712
|
-
return `codex${yoloFlag2} resume --last`;
|
|
17026
|
+
return `codex${hooksFlag}${yoloFlag2} resume --last`;
|
|
16713
17027
|
}
|
|
16714
17028
|
const promptSuffix2 = input.prompt ? ` -- ${quoteShell(input.prompt)}` : "";
|
|
16715
17029
|
if (input.systemPrompt) {
|
|
16716
|
-
return `codex${yoloFlag2} -c ${quoteShell(`developer_instructions=${input.systemPrompt}`)}${promptSuffix2}`;
|
|
17030
|
+
return `codex${hooksFlag}${yoloFlag2} -c ${quoteShell(`developer_instructions=${input.systemPrompt}`)}${promptSuffix2}`;
|
|
16717
17031
|
}
|
|
16718
|
-
return `codex${yoloFlag2}${promptSuffix2}`;
|
|
17032
|
+
return `codex${hooksFlag}${yoloFlag2}${promptSuffix2}`;
|
|
16719
17033
|
}
|
|
16720
17034
|
const yoloFlag = input.yolo ? " --dangerously-skip-permissions" : "";
|
|
16721
17035
|
if (input.launchMode === "resume") {
|
|
@@ -16891,7 +17205,7 @@ var init_agent_registry = __esm(() => {
|
|
|
16891
17205
|
});
|
|
16892
17206
|
|
|
16893
17207
|
// backend/src/services/session-service.ts
|
|
16894
|
-
import { resolve as
|
|
17208
|
+
import { resolve as resolve7 } from "path";
|
|
16895
17209
|
function quoteShell2(value) {
|
|
16896
17210
|
return `'${value.replaceAll("'", "'\\''")}'`;
|
|
16897
17211
|
}
|
|
@@ -16905,7 +17219,7 @@ function buildCommandPaneStartupCommand(template, ctx) {
|
|
|
16905
17219
|
if (!template.workingDir) {
|
|
16906
17220
|
return template.command;
|
|
16907
17221
|
}
|
|
16908
|
-
const workingDir =
|
|
17222
|
+
const workingDir = resolve7(resolvePaneCwd(template, ctx), template.workingDir);
|
|
16909
17223
|
return `cd -- ${quoteShell2(workingDir)} && ${template.command}`;
|
|
16910
17224
|
}
|
|
16911
17225
|
function resolvePaneStartupCommand(template, ctx) {
|
|
@@ -17135,7 +17449,7 @@ var init_worktree_service = __esm(() => {
|
|
|
17135
17449
|
|
|
17136
17450
|
// backend/src/services/lifecycle-service.ts
|
|
17137
17451
|
import { mkdir as mkdir4 } from "fs/promises";
|
|
17138
|
-
import { dirname as dirname5, resolve as
|
|
17452
|
+
import { dirname as dirname5, resolve as resolve8 } from "path";
|
|
17139
17453
|
function toErrorMessage2(error) {
|
|
17140
17454
|
return error instanceof Error ? error.message : String(error);
|
|
17141
17455
|
}
|
|
@@ -17145,6 +17459,15 @@ function stringifyStartupEnvValue(value) {
|
|
|
17145
17459
|
function trimTrailingSlashes(value) {
|
|
17146
17460
|
return value.replace(/\/+$/, "");
|
|
17147
17461
|
}
|
|
17462
|
+
function normalizeWorktreeLabel(label) {
|
|
17463
|
+
const trimmed = label?.trim() ?? "";
|
|
17464
|
+
if (!trimmed)
|
|
17465
|
+
return null;
|
|
17466
|
+
if (trimmed.length > MAX_WORKTREE_LABEL_LENGTH) {
|
|
17467
|
+
throw new LifecycleError(`Worktree label must be ${MAX_WORKTREE_LABEL_LENGTH} characters or fewer`, 400);
|
|
17468
|
+
}
|
|
17469
|
+
return trimmed;
|
|
17470
|
+
}
|
|
17148
17471
|
function isLoopbackHostname(hostname) {
|
|
17149
17472
|
return hostname === "127.0.0.1" || hostname === "localhost" || hostname === "::1" || hostname === "[::1]";
|
|
17150
17473
|
}
|
|
@@ -17311,6 +17634,21 @@ class LifecycleService {
|
|
|
17311
17634
|
throw this.wrapOperationError(error);
|
|
17312
17635
|
}
|
|
17313
17636
|
}
|
|
17637
|
+
async setWorktreeLabel(branch, label) {
|
|
17638
|
+
try {
|
|
17639
|
+
const normalizedLabel = normalizeWorktreeLabel(label);
|
|
17640
|
+
const resolved = await this.resolveExistingWorktree(branch);
|
|
17641
|
+
if (!resolved.meta) {
|
|
17642
|
+
throw new LifecycleError(`Worktree ${branch} has no managed metadata to label`, 409);
|
|
17643
|
+
}
|
|
17644
|
+
const nextMeta = this.withUpdatedLabel(resolved.meta, normalizedLabel);
|
|
17645
|
+
await writeWorktreeMeta(resolved.gitDir, nextMeta);
|
|
17646
|
+
await this.deps.reconciliation.reconcile(this.deps.projectRoot, { force: true });
|
|
17647
|
+
return { label: normalizedLabel };
|
|
17648
|
+
} catch (error) {
|
|
17649
|
+
throw this.wrapOperationError(error);
|
|
17650
|
+
}
|
|
17651
|
+
}
|
|
17314
17652
|
listAvailableBranches(options = {}) {
|
|
17315
17653
|
const localBranches = this.listLocalBranches().filter((branch) => isValidBranchName(branch));
|
|
17316
17654
|
const remoteBranches = options.includeRemote ? this.listRemoteBranches().filter((branch) => isValidBranchName(branch)) : [];
|
|
@@ -17403,20 +17741,20 @@ class LifecycleService {
|
|
|
17403
17741
|
return allocateServicePorts(metas, this.deps.config.services);
|
|
17404
17742
|
}
|
|
17405
17743
|
resolveWorktreePath(branch) {
|
|
17406
|
-
return
|
|
17744
|
+
return resolve8(this.deps.projectRoot, this.deps.config.workspace.worktreeRoot, branch);
|
|
17407
17745
|
}
|
|
17408
17746
|
listLocalBranches() {
|
|
17409
|
-
return this.deps.git.listLocalBranches(
|
|
17747
|
+
return this.deps.git.listLocalBranches(resolve8(this.deps.projectRoot));
|
|
17410
17748
|
}
|
|
17411
17749
|
listRemoteBranches() {
|
|
17412
|
-
return this.deps.git.listRemoteBranches(
|
|
17750
|
+
return this.deps.git.listRemoteBranches(resolve8(this.deps.projectRoot));
|
|
17413
17751
|
}
|
|
17414
17752
|
listCheckedOutBranches() {
|
|
17415
|
-
return new Set(this.deps.git.listWorktrees(
|
|
17753
|
+
return new Set(this.deps.git.listWorktrees(resolve8(this.deps.projectRoot)).filter((entry) => !entry.bare && entry.branch !== null).map((entry) => entry.branch));
|
|
17416
17754
|
}
|
|
17417
17755
|
listProjectWorktrees() {
|
|
17418
|
-
const projectRoot2 =
|
|
17419
|
-
return this.deps.git.listWorktrees(projectRoot2).filter((entry) => !entry.bare &&
|
|
17756
|
+
const projectRoot2 = resolve8(this.deps.projectRoot);
|
|
17757
|
+
return this.deps.git.listWorktrees(projectRoot2).filter((entry) => !entry.bare && resolve8(entry.path) !== projectRoot2);
|
|
17420
17758
|
}
|
|
17421
17759
|
async readManagedMetas() {
|
|
17422
17760
|
const metas = await Promise.all(this.listProjectWorktrees().map(async (entry) => {
|
|
@@ -17492,6 +17830,15 @@ class LifecycleService {
|
|
|
17492
17830
|
async updateWorktreeArchivedState(path, archived) {
|
|
17493
17831
|
await this.deps.archiveState.setArchived(path, archived);
|
|
17494
17832
|
}
|
|
17833
|
+
withUpdatedLabel(meta, label) {
|
|
17834
|
+
const nextMeta = { ...meta };
|
|
17835
|
+
if (label) {
|
|
17836
|
+
nextMeta.label = label;
|
|
17837
|
+
} else {
|
|
17838
|
+
delete nextMeta.label;
|
|
17839
|
+
}
|
|
17840
|
+
return nextMeta;
|
|
17841
|
+
}
|
|
17495
17842
|
async closeBranchWindow(branch) {
|
|
17496
17843
|
this.deps.tmux.killWindow(buildProjectSessionName(this.deps.projectRoot), buildWorktreeWindowName(branch));
|
|
17497
17844
|
await this.deps.reconciliation.reconcile(this.deps.projectRoot, { force: true });
|
|
@@ -17784,7 +18131,7 @@ class LifecycleService {
|
|
|
17784
18131
|
return new LifecycleError(toErrorMessage2(error), 422);
|
|
17785
18132
|
}
|
|
17786
18133
|
}
|
|
17787
|
-
var DOCKER_CONTROL_HOST = "host.docker.internal", LifecycleError;
|
|
18134
|
+
var DOCKER_CONTROL_HOST = "host.docker.internal", MAX_WORKTREE_LABEL_LENGTH = 80, LifecycleError;
|
|
17788
18135
|
var init_lifecycle_service = __esm(() => {
|
|
17789
18136
|
init_agent_runtime();
|
|
17790
18137
|
init_fs();
|
|
@@ -17911,6 +18258,7 @@ function makeDefaultState(input) {
|
|
|
17911
18258
|
return {
|
|
17912
18259
|
worktreeId: input.worktreeId,
|
|
17913
18260
|
branch: input.branch,
|
|
18261
|
+
label: input.label ?? null,
|
|
17914
18262
|
baseBranch: input.baseBranch ?? null,
|
|
17915
18263
|
path: input.path,
|
|
17916
18264
|
profile: input.profile ?? null,
|
|
@@ -17956,6 +18304,8 @@ class ProjectRuntime {
|
|
|
17956
18304
|
this.reindexBranch(existing.branch, input.branch, input.worktreeId);
|
|
17957
18305
|
existing.path = input.path;
|
|
17958
18306
|
existing.branch = input.branch;
|
|
18307
|
+
if (input.label !== undefined)
|
|
18308
|
+
existing.label = input.label;
|
|
17959
18309
|
if (input.baseBranch !== undefined)
|
|
17960
18310
|
existing.baseBranch = input.baseBranch;
|
|
17961
18311
|
existing.profile = input.profile ?? existing.profile;
|
|
@@ -18088,9 +18438,9 @@ async function mapWithConcurrency(items, limit, fn) {
|
|
|
18088
18438
|
}
|
|
18089
18439
|
|
|
18090
18440
|
// backend/src/services/reconciliation-service.ts
|
|
18091
|
-
import { basename as basename4, resolve as
|
|
18441
|
+
import { basename as basename4, resolve as resolve9 } from "path";
|
|
18092
18442
|
function makeUnmanagedWorktreeId(path) {
|
|
18093
|
-
return `unmanaged:${
|
|
18443
|
+
return `unmanaged:${resolve9(path)}`;
|
|
18094
18444
|
}
|
|
18095
18445
|
function isValidPort2(port) {
|
|
18096
18446
|
return port !== null && Number.isInteger(port) && port >= 1 && port <= 65535;
|
|
@@ -18147,7 +18497,7 @@ class ReconciliationService {
|
|
|
18147
18497
|
if (!options.force && this.now() - this.lastReconciledAt < this.freshnessMs) {
|
|
18148
18498
|
return;
|
|
18149
18499
|
}
|
|
18150
|
-
const normalizedRepoRoot =
|
|
18500
|
+
const normalizedRepoRoot = resolve9(repoRoot);
|
|
18151
18501
|
const reconcilePromise = this.runReconcile(normalizedRepoRoot).then(() => {
|
|
18152
18502
|
this.lastReconciledAt = this.now();
|
|
18153
18503
|
});
|
|
@@ -18166,7 +18516,7 @@ class ReconciliationService {
|
|
|
18166
18516
|
windows = [];
|
|
18167
18517
|
}
|
|
18168
18518
|
const seenWorktreeIds = new Set;
|
|
18169
|
-
const candidateEntries = worktrees.filter((entry) => !entry.bare &&
|
|
18519
|
+
const candidateEntries = worktrees.filter((entry) => !entry.bare && resolve9(entry.path) !== normalizedRepoRoot);
|
|
18170
18520
|
const reconciledStates = await mapWithConcurrency(candidateEntries, this.concurrency, async (entry) => {
|
|
18171
18521
|
const gitDir = this.deps.git.resolveWorktreeGitDir(entry.path);
|
|
18172
18522
|
const meta = await readWorktreeMeta(gitDir);
|
|
@@ -18177,6 +18527,7 @@ class ReconciliationService {
|
|
|
18177
18527
|
return {
|
|
18178
18528
|
worktreeId,
|
|
18179
18529
|
branch,
|
|
18530
|
+
label: meta?.label ?? null,
|
|
18180
18531
|
baseBranch: meta?.baseBranch ?? null,
|
|
18181
18532
|
path: entry.path,
|
|
18182
18533
|
profile: meta?.profile ?? null,
|
|
@@ -18209,6 +18560,7 @@ class ReconciliationService {
|
|
|
18209
18560
|
this.deps.runtime.upsertWorktree({
|
|
18210
18561
|
worktreeId: state.worktreeId,
|
|
18211
18562
|
branch: state.branch,
|
|
18563
|
+
label: state.label,
|
|
18212
18564
|
baseBranch: state.baseBranch,
|
|
18213
18565
|
path: state.path,
|
|
18214
18566
|
profile: state.profile,
|
|
@@ -18348,11 +18700,12 @@ __export(exports_worktree_commands, {
|
|
|
18348
18700
|
runWorktreeCommand: () => runWorktreeCommand,
|
|
18349
18701
|
parseSendCommandArgs: () => parseSendCommandArgs,
|
|
18350
18702
|
parseListCommandArgs: () => parseListCommandArgs,
|
|
18703
|
+
parseLabelCommandArgs: () => parseLabelCommandArgs,
|
|
18351
18704
|
parseBranchCommandArgs: () => parseBranchCommandArgs,
|
|
18352
18705
|
parseAddCommandArgs: () => parseAddCommandArgs,
|
|
18353
18706
|
getWorktreeCommandUsage: () => getWorktreeCommandUsage
|
|
18354
18707
|
});
|
|
18355
|
-
import { basename as basename5, resolve as
|
|
18708
|
+
import { basename as basename5, resolve as resolve10 } from "path";
|
|
18356
18709
|
function getWorktreeCommandUsage(command) {
|
|
18357
18710
|
switch (command) {
|
|
18358
18711
|
case "add":
|
|
@@ -18395,6 +18748,18 @@ function getWorktreeCommandUsage(command) {
|
|
|
18395
18748
|
case "unarchive":
|
|
18396
18749
|
return `Usage:
|
|
18397
18750
|
webmux unarchive <branch>`;
|
|
18751
|
+
case "label":
|
|
18752
|
+
return [
|
|
18753
|
+
"Usage:",
|
|
18754
|
+
" webmux label <branch> <label>",
|
|
18755
|
+
" webmux label <branch> --clear",
|
|
18756
|
+
"",
|
|
18757
|
+
"Options:",
|
|
18758
|
+
" --clear Clear the workspace label",
|
|
18759
|
+
" --label <text> Label text",
|
|
18760
|
+
" --help Show this help message"
|
|
18761
|
+
].join(`
|
|
18762
|
+
`);
|
|
18398
18763
|
case "remove":
|
|
18399
18764
|
return `Usage:
|
|
18400
18765
|
webmux remove <branch>`;
|
|
@@ -18537,6 +18902,64 @@ function parseBranchCommandArgs(args) {
|
|
|
18537
18902
|
}
|
|
18538
18903
|
return branch;
|
|
18539
18904
|
}
|
|
18905
|
+
function parseLabelCommandArgs(args) {
|
|
18906
|
+
let branch = null;
|
|
18907
|
+
let clear = false;
|
|
18908
|
+
let optionLabel = null;
|
|
18909
|
+
const labelParts = [];
|
|
18910
|
+
for (let index = 0;index < args.length; index++) {
|
|
18911
|
+
const arg = args[index];
|
|
18912
|
+
if (!arg)
|
|
18913
|
+
continue;
|
|
18914
|
+
if (arg === "--help" || arg === "-h") {
|
|
18915
|
+
return null;
|
|
18916
|
+
}
|
|
18917
|
+
if (arg === "--clear") {
|
|
18918
|
+
clear = true;
|
|
18919
|
+
continue;
|
|
18920
|
+
}
|
|
18921
|
+
if (arg === "--label" || arg.startsWith("--label=")) {
|
|
18922
|
+
if (optionLabel !== null) {
|
|
18923
|
+
throw new CommandUsageError("Cannot use --label more than once");
|
|
18924
|
+
}
|
|
18925
|
+
const { value, nextIndex } = readOptionValue(args, index, "--label");
|
|
18926
|
+
optionLabel = value;
|
|
18927
|
+
index = nextIndex;
|
|
18928
|
+
continue;
|
|
18929
|
+
}
|
|
18930
|
+
if (arg.startsWith("-")) {
|
|
18931
|
+
throw new CommandUsageError(`Unknown option: ${arg}`);
|
|
18932
|
+
}
|
|
18933
|
+
if (!branch) {
|
|
18934
|
+
branch = arg;
|
|
18935
|
+
continue;
|
|
18936
|
+
}
|
|
18937
|
+
if (optionLabel !== null) {
|
|
18938
|
+
throw new CommandUsageError("Cannot use --label with a positional label");
|
|
18939
|
+
}
|
|
18940
|
+
labelParts.push(arg);
|
|
18941
|
+
}
|
|
18942
|
+
if (!branch) {
|
|
18943
|
+
throw new CommandUsageError("Missing required argument: <branch>");
|
|
18944
|
+
}
|
|
18945
|
+
if (!isValidWorktreeName(branch)) {
|
|
18946
|
+
throw new CommandUsageError("Invalid worktree name");
|
|
18947
|
+
}
|
|
18948
|
+
if (optionLabel !== null && labelParts.length > 0) {
|
|
18949
|
+
throw new CommandUsageError("Cannot use --label with a positional label");
|
|
18950
|
+
}
|
|
18951
|
+
const label = (optionLabel ?? labelParts.join(" ")).trim();
|
|
18952
|
+
if (clear && label) {
|
|
18953
|
+
throw new CommandUsageError("Cannot use --clear with a label");
|
|
18954
|
+
}
|
|
18955
|
+
if (!clear && !label) {
|
|
18956
|
+
throw new CommandUsageError("Missing required argument: <label>");
|
|
18957
|
+
}
|
|
18958
|
+
return {
|
|
18959
|
+
branch,
|
|
18960
|
+
label: clear ? null : label
|
|
18961
|
+
};
|
|
18962
|
+
}
|
|
18540
18963
|
function parseSendCommandArgs(args) {
|
|
18541
18964
|
let branch = null;
|
|
18542
18965
|
let text = null;
|
|
@@ -18633,18 +19056,18 @@ function parseListCommandArgs(args) {
|
|
|
18633
19056
|
return { mode, search };
|
|
18634
19057
|
}
|
|
18635
19058
|
function listProjectWorktrees(runtime) {
|
|
18636
|
-
const projectDir =
|
|
18637
|
-
return runtime.git.listWorktrees(projectDir).filter((entry) => !entry.bare &&
|
|
19059
|
+
const projectDir = resolve10(runtime.projectDir);
|
|
19060
|
+
return runtime.git.listWorktrees(projectDir).filter((entry) => !entry.bare && resolve10(entry.path) !== projectDir);
|
|
18638
19061
|
}
|
|
18639
19062
|
async function defaultConfirmPrune(worktreeCount) {
|
|
18640
|
-
const response = await
|
|
19063
|
+
const response = await ue({
|
|
18641
19064
|
message: `Prune all ${worktreeCount} worktree${worktreeCount === 1 ? "" : "s"}? This action cannot be undone.`,
|
|
18642
19065
|
initialValue: false
|
|
18643
19066
|
});
|
|
18644
19067
|
return !q(response) && response;
|
|
18645
19068
|
}
|
|
18646
19069
|
function defaultSwitchToTmuxWindow(projectDir, branch) {
|
|
18647
|
-
const sessionName = buildProjectSessionName(
|
|
19070
|
+
const sessionName = buildProjectSessionName(resolve10(projectDir));
|
|
18648
19071
|
const windowName = buildWorktreeWindowName(branch);
|
|
18649
19072
|
const target = `${sessionName}:${windowName}`;
|
|
18650
19073
|
const selectResult = Bun.spawnSync(["tmux", "select-window", "-t", target], {
|
|
@@ -18676,7 +19099,7 @@ function matchesListSearch(row, query) {
|
|
|
18676
19099
|
return query.length === 0 || row.searchText.toLowerCase().includes(query.toLowerCase());
|
|
18677
19100
|
}
|
|
18678
19101
|
async function listWorktrees(runtime, stdout, options) {
|
|
18679
|
-
const projectDir =
|
|
19102
|
+
const projectDir = resolve10(runtime.projectDir);
|
|
18680
19103
|
const entries = listProjectWorktrees(runtime);
|
|
18681
19104
|
if (entries.length === 0) {
|
|
18682
19105
|
stdout("No worktrees found.");
|
|
@@ -18700,10 +19123,12 @@ async function listWorktrees(runtime, stdout, options) {
|
|
|
18700
19123
|
const info = meta ? `${meta.profile} / ${meta.agent}` : "";
|
|
18701
19124
|
return {
|
|
18702
19125
|
branch,
|
|
19126
|
+
label: meta?.label ?? null,
|
|
18703
19127
|
isOpen,
|
|
18704
|
-
archived: archivedPaths.has(
|
|
19128
|
+
archived: archivedPaths.has(resolve10(entry.path)),
|
|
18705
19129
|
info,
|
|
18706
19130
|
searchText: [
|
|
19131
|
+
meta?.label ?? "",
|
|
18707
19132
|
branch,
|
|
18708
19133
|
meta?.baseBranch ?? "",
|
|
18709
19134
|
meta?.profile ?? "",
|
|
@@ -18732,10 +19157,11 @@ async function listWorktrees(runtime, stdout, options) {
|
|
|
18732
19157
|
stdout(options.search.trim() ? `No worktrees found for "${options.search.trim()}".` : "No worktrees found.");
|
|
18733
19158
|
return;
|
|
18734
19159
|
}
|
|
18735
|
-
const
|
|
19160
|
+
const maxName = Math.max(...visibleRows.map((row) => (row.label ? `${row.label} (${row.branch})` : row.branch).length));
|
|
18736
19161
|
for (const row of visibleRows) {
|
|
18737
19162
|
const status2 = `${row.isOpen ? "open" : "closed"}${row.archived ? " archived" : ""}`;
|
|
18738
|
-
|
|
19163
|
+
const name = row.label ? `${row.label} (${row.branch})` : row.branch;
|
|
19164
|
+
stdout(`${name.padEnd(maxName + 2)} ${status2.padEnd(15)} ${row.info}`.trimEnd());
|
|
18739
19165
|
}
|
|
18740
19166
|
if (options.mode === "active") {
|
|
18741
19167
|
const hiddenArchivedCount = matchingRows.filter((row) => row.archived).length;
|
|
@@ -18842,6 +19268,20 @@ async function runWorktreeCommand(context, deps2 = {}) {
|
|
|
18842
19268
|
stdout(`Sent prompt to ${parsed.branch}`);
|
|
18843
19269
|
return 0;
|
|
18844
19270
|
}
|
|
19271
|
+
if (context.command === "label") {
|
|
19272
|
+
const parsed = parseLabelCommandArgs(context.args);
|
|
19273
|
+
if (!parsed) {
|
|
19274
|
+
stdout(getWorktreeCommandUsage("label"));
|
|
19275
|
+
return 0;
|
|
19276
|
+
}
|
|
19277
|
+
const runtime2 = createRuntime({
|
|
19278
|
+
projectDir: context.projectDir,
|
|
19279
|
+
port: context.port
|
|
19280
|
+
});
|
|
19281
|
+
const result = await runtime2.lifecycleService.setWorktreeLabel(parsed.branch, parsed.label);
|
|
19282
|
+
stdout(result.label ? `Labeled worktree ${parsed.branch} as "${result.label}"` : `Cleared label for ${parsed.branch}`);
|
|
19283
|
+
return 0;
|
|
19284
|
+
}
|
|
18845
19285
|
const command = context.command;
|
|
18846
19286
|
const branch = parseBranchCommandArgs(context.args);
|
|
18847
19287
|
if (!branch) {
|
|
@@ -18905,13 +19345,13 @@ var init_worktree_commands = __esm(() => {
|
|
|
18905
19345
|
});
|
|
18906
19346
|
|
|
18907
19347
|
// bin/src/webmux.ts
|
|
18908
|
-
import { resolve as
|
|
19348
|
+
import { resolve as resolve11, dirname as dirname6, join as join11 } from "path";
|
|
18909
19349
|
import { existsSync as existsSync5 } from "fs";
|
|
18910
19350
|
import { fileURLToPath } from "url";
|
|
18911
19351
|
// package.json
|
|
18912
19352
|
var package_default = {
|
|
18913
19353
|
name: "webmux",
|
|
18914
|
-
version: "0.
|
|
19354
|
+
version: "0.31.0",
|
|
18915
19355
|
description: "Web dashboard for workmux \u2014 browser UI with embedded terminals, PR monitoring, and CI integration",
|
|
18916
19356
|
type: "module",
|
|
18917
19357
|
repository: {
|
|
@@ -18968,7 +19408,7 @@ var package_default = {
|
|
|
18968
19408
|
};
|
|
18969
19409
|
|
|
18970
19410
|
// bin/src/webmux.ts
|
|
18971
|
-
var PKG_ROOT =
|
|
19411
|
+
var PKG_ROOT = resolve11(dirname6(fileURLToPath(import.meta.url)), "..");
|
|
18972
19412
|
function usage2() {
|
|
18973
19413
|
console.log(`
|
|
18974
19414
|
webmux \u2014 Dev dashboard for managing Git worktrees
|
|
@@ -18984,6 +19424,7 @@ Usage:
|
|
|
18984
19424
|
webmux close Close a worktree session without removing it
|
|
18985
19425
|
webmux archive Hide a worktree from the default list
|
|
18986
19426
|
webmux unarchive Show an archived worktree again
|
|
19427
|
+
webmux label Set or clear a workspace label
|
|
18987
19428
|
webmux remove Remove a worktree
|
|
18988
19429
|
webmux merge Merge a worktree into the main branch and remove it
|
|
18989
19430
|
webmux send Send a prompt to a running worktree agent
|
|
@@ -19002,7 +19443,7 @@ Environment:
|
|
|
19002
19443
|
`);
|
|
19003
19444
|
}
|
|
19004
19445
|
function isRootCommand(value) {
|
|
19005
|
-
return value === "serve" || value === "init" || value === "service" || value === "update" || value === "add" || value === "list" || value === "open" || value === "close" || value === "archive" || value === "unarchive" || value === "remove" || value === "merge" || value === "send" || value === "prune" || value === "completion";
|
|
19446
|
+
return value === "serve" || value === "init" || value === "service" || value === "update" || value === "add" || value === "list" || value === "open" || value === "close" || value === "archive" || value === "unarchive" || value === "label" || value === "remove" || value === "merge" || value === "send" || value === "prune" || value === "completion";
|
|
19006
19447
|
}
|
|
19007
19448
|
function isServeRootOption(value) {
|
|
19008
19449
|
return value === "--port" || value === "--app" || value === "--debug" || value === "--help" || value === "-h" || value === "--version" || value === "-V";
|
|
@@ -19066,7 +19507,7 @@ Run webmux --help for usage.`);
|
|
|
19066
19507
|
};
|
|
19067
19508
|
}
|
|
19068
19509
|
function isWorktreeCommand(command) {
|
|
19069
|
-
return command === "add" || command === "list" || command === "open" || command === "close" || command === "archive" || command === "unarchive" || command === "remove" || command === "merge" || command === "send" || command === "prune";
|
|
19510
|
+
return command === "add" || command === "list" || command === "open" || command === "close" || command === "archive" || command === "unarchive" || command === "label" || command === "remove" || command === "merge" || command === "send" || command === "prune";
|
|
19070
19511
|
}
|
|
19071
19512
|
async function loadEnvFile(path) {
|
|
19072
19513
|
if (!existsSync5(path))
|
|
@@ -19183,8 +19624,8 @@ async function main(args = process.argv.slice(2)) {
|
|
|
19183
19624
|
const code = await proc.exited;
|
|
19184
19625
|
process.exit(code);
|
|
19185
19626
|
}
|
|
19186
|
-
await loadEnvFile(
|
|
19187
|
-
await loadEnvFile(
|
|
19627
|
+
await loadEnvFile(resolve11(process.cwd(), ".env.local"));
|
|
19628
|
+
await loadEnvFile(resolve11(process.cwd(), ".env"));
|
|
19188
19629
|
if (isWorktreeCommand(parsed.command)) {
|
|
19189
19630
|
const { runWorktreeCommand: runWorktreeCommand2 } = await Promise.resolve().then(() => (init_worktree_commands(), exports_worktree_commands));
|
|
19190
19631
|
const exitCode2 = await runWorktreeCommand2({
|
|
@@ -19199,7 +19640,7 @@ async function main(args = process.argv.slice(2)) {
|
|
|
19199
19640
|
usage2();
|
|
19200
19641
|
process.exit(0);
|
|
19201
19642
|
}
|
|
19202
|
-
if (!existsSync5(
|
|
19643
|
+
if (!existsSync5(resolve11(process.cwd(), ".webmux.yaml"))) {
|
|
19203
19644
|
console.error("No .webmux.yaml found in this directory.\nRun `webmux init` to set up your project.");
|
|
19204
19645
|
process.exit(1);
|
|
19205
19646
|
}
|
|
@@ -19240,22 +19681,22 @@ async function main(args = process.argv.slice(2)) {
|
|
|
19240
19681
|
process.exit(1);
|
|
19241
19682
|
}
|
|
19242
19683
|
console.log(`Starting webmux on port ${parsed.port}...`);
|
|
19243
|
-
const
|
|
19684
|
+
const be2 = Bun.spawn(["bun", backendEntry], {
|
|
19244
19685
|
env: { ...baseEnv, WEBMUX_STATIC_DIR: staticDir },
|
|
19245
19686
|
stdout: "pipe",
|
|
19246
19687
|
stderr: "pipe"
|
|
19247
19688
|
});
|
|
19248
|
-
children.push(
|
|
19689
|
+
children.push(be2);
|
|
19249
19690
|
if (parsed.app) {
|
|
19250
|
-
pipeWithPrefix(
|
|
19691
|
+
pipeWithPrefix(be2.stdout, "[BE]", {
|
|
19251
19692
|
text: "Dev Dashboard API running at",
|
|
19252
19693
|
callback: () => openAppMode(`http://localhost:${parsed.port}`)
|
|
19253
19694
|
});
|
|
19254
19695
|
} else {
|
|
19255
|
-
pipeWithPrefix(
|
|
19696
|
+
pipeWithPrefix(be2.stdout, "[BE]");
|
|
19256
19697
|
}
|
|
19257
|
-
pipeWithPrefix(
|
|
19258
|
-
cleanup(await
|
|
19698
|
+
pipeWithPrefix(be2.stderr, "[BE]");
|
|
19699
|
+
cleanup(await be2.exited);
|
|
19259
19700
|
}
|
|
19260
19701
|
if (import.meta.main) {
|
|
19261
19702
|
await main();
|