@norman-else/dsh-claude 0.1.21 → 0.1.23
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/README.md +1 -1
- package/lib/bin.mjs +1 -1
- package/lib/client.d.ts +26 -1
- package/lib/client.js +1212 -218
- package/lib/client.js.map +1 -1
- package/lib/{command-bridge-C10-lz6A.mjs → command-bridge-Br25ODdm.mjs} +2 -2
- package/lib/{command-bridge-C10-lz6A.mjs.map → command-bridge-Br25ODdm.mjs.map} +1 -1
- package/lib/{events-BdDs9ebF.mjs → events-DhrAr5gh.mjs} +3 -2
- package/lib/events-DhrAr5gh.mjs.map +1 -0
- package/lib/index.mjs +511 -100
- package/lib/index.mjs.map +1 -1
- package/lib/{preset-installer-DMANIjwu.mjs → preset-installer-B_Cb0RG6.mjs} +2 -2
- package/lib/{preset-installer-DMANIjwu.mjs.map → preset-installer-B_Cb0RG6.mjs.map} +1 -1
- package/lib/preset-route.mjs +2 -2
- package/package.json +1 -1
- package/lib/events-BdDs9ebF.mjs.map +0 -1
package/lib/client.js
CHANGED
|
@@ -4,7 +4,7 @@ window.__ModuleLoader__.load({
|
|
|
4
4
|
var module = { exports: {} };
|
|
5
5
|
module.exports;
|
|
6
6
|
var { Fragment, useCallback, useEffect, useId, useLayoutEffect, useMemo, useRef, useState, useSyncExternalStore } = require("react");
|
|
7
|
-
var { DiffBlock, DisclosureRow, HoverCard, IconApiOutline14, IconBranchOutline16, IconCheckOutline14, IconChevronDownOutline14, IconCloseOutline16, IconFullscreenOutline16, IconSearchOutline16, IconThinkOutline14, MarkdownText, Menu, Modal, StateDot } = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
7
|
+
var { DiffBlock, DisclosureRow, HoverCard, IconApiOutline14, IconBranchOutline16, IconCheckOutline14, IconChevronDownOutline14, IconCloseOutline16, IconFullscreenOutline16, IconSearchOutline16, IconThinkOutline14, MarkdownText, Menu, Modal, StateDot, Tooltip } = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
8
8
|
var { Fragment: Fragment$1, jsx, jsxs } = require("react/jsx-runtime");
|
|
9
9
|
var { createPortal } = require("react-dom");
|
|
10
10
|
/** Claude's subagent dispatch tools; rendered as plugin-owned group cards
|
|
@@ -18,6 +18,7 @@ window.__ModuleLoader__.load({
|
|
|
18
18
|
const CLAUDE_REPOSITORY_SETUP_PATH = "/plugins/dsh-claude/repository/setup";
|
|
19
19
|
const CLAUDE_REPOSITORY_ACTION_PATH = "/plugins/dsh-claude/repository/action";
|
|
20
20
|
const CLAUDE_REVIEW_COMMENT_PATH = "/plugins/dsh-claude/review-comments";
|
|
21
|
+
const CLAUDE_REPOSITORY_FEEDBACK_PATH = "/plugins/dsh-claude/repository/feedback";
|
|
21
22
|
//#endregion
|
|
22
23
|
//#region src/client/task-projection.ts
|
|
23
24
|
/** Tasks UI is reserved for detached work and genuine Claude subagents. */
|
|
@@ -577,15 +578,15 @@ window.__ModuleLoader__.load({
|
|
|
577
578
|
const settingsBody = {
|
|
578
579
|
margin: 0,
|
|
579
580
|
color: "var(--dsw-alias-label-secondary)",
|
|
580
|
-
fontSize:
|
|
581
|
-
lineHeight: "
|
|
581
|
+
fontSize: 14,
|
|
582
|
+
lineHeight: "22px"
|
|
582
583
|
};
|
|
583
584
|
const settingsCard = {
|
|
584
585
|
display: "flex",
|
|
585
586
|
flexDirection: "column",
|
|
586
587
|
gap: 14,
|
|
587
588
|
padding: 18,
|
|
588
|
-
border: "1px solid var(--dsw-alias-border-l2)",
|
|
589
|
+
border: "1px solid var(--dsw-alias-border-l2, color-mix(in srgb, currentColor 16%, transparent))",
|
|
589
590
|
borderRadius: 14,
|
|
590
591
|
background: "var(--dsw-alias-bg-layer-1)"
|
|
591
592
|
};
|
|
@@ -600,8 +601,8 @@ window.__ModuleLoader__.load({
|
|
|
600
601
|
gridTemplateColumns: "minmax(130px, 0.36fr) minmax(0, 1fr)",
|
|
601
602
|
gap: "10px 18px",
|
|
602
603
|
padding: "14px 0",
|
|
603
|
-
borderTop: "1px solid var(--dsw-alias-border-l2)",
|
|
604
|
-
borderBottom: "1px solid var(--dsw-alias-border-l2)",
|
|
604
|
+
borderTop: "1px solid var(--dsw-alias-border-l2, color-mix(in srgb, currentColor 16%, transparent))",
|
|
605
|
+
borderBottom: "1px solid var(--dsw-alias-border-l2, color-mix(in srgb, currentColor 16%, transparent))",
|
|
605
606
|
fontSize: 13
|
|
606
607
|
};
|
|
607
608
|
const diagnosticLabel = { color: "var(--dsw-alias-label-tertiary)" };
|
|
@@ -620,13 +621,13 @@ window.__ModuleLoader__.load({
|
|
|
620
621
|
boxSizing: "border-box",
|
|
621
622
|
minHeight: 38,
|
|
622
623
|
padding: "7px 13px",
|
|
623
|
-
border: "1px solid var(--dsw-alias-border-l2)",
|
|
624
|
+
border: "1px solid var(--dsw-alias-border-l2, color-mix(in srgb, currentColor 16%, transparent))",
|
|
624
625
|
borderRadius: 10,
|
|
625
626
|
background: "var(--dsw-alias-bg-layer-2)",
|
|
626
627
|
color: "var(--dsw-alias-label-primary)",
|
|
627
628
|
font: "inherit",
|
|
628
|
-
fontSize:
|
|
629
|
-
lineHeight: "
|
|
629
|
+
fontSize: 14,
|
|
630
|
+
lineHeight: "22px"
|
|
630
631
|
};
|
|
631
632
|
const settingSelectTrigger = {
|
|
632
633
|
width: "100%",
|
|
@@ -636,14 +637,14 @@ window.__ModuleLoader__.load({
|
|
|
636
637
|
justifyContent: "space-between",
|
|
637
638
|
gap: 12,
|
|
638
639
|
padding: "7px 11px 7px 13px",
|
|
639
|
-
border: "1px solid var(--dsw-alias-border-l2)",
|
|
640
|
+
border: "1px solid var(--dsw-alias-border-l2, color-mix(in srgb, currentColor 16%, transparent))",
|
|
640
641
|
borderRadius: 10,
|
|
641
642
|
background: "var(--dsw-alias-bg-layer-2)",
|
|
642
643
|
color: "var(--dsw-alias-label-primary)",
|
|
643
644
|
boxShadow: "0 1px 2px color-mix(in srgb, var(--dsw-alias-label-primary) 5%, transparent)",
|
|
644
645
|
font: "inherit",
|
|
645
|
-
fontSize:
|
|
646
|
-
lineHeight: "
|
|
646
|
+
fontSize: 14,
|
|
647
|
+
lineHeight: "22px",
|
|
647
648
|
textAlign: "left",
|
|
648
649
|
cursor: "pointer",
|
|
649
650
|
transition: "border-color 120ms ease, box-shadow 120ms ease, background 120ms ease"
|
|
@@ -657,8 +658,7 @@ window.__ModuleLoader__.load({
|
|
|
657
658
|
flex: 1,
|
|
658
659
|
overflow: "hidden",
|
|
659
660
|
textOverflow: "ellipsis",
|
|
660
|
-
whiteSpace: "nowrap"
|
|
661
|
-
fontWeight: 550
|
|
661
|
+
whiteSpace: "nowrap"
|
|
662
662
|
};
|
|
663
663
|
const settingSelectChevron = {
|
|
664
664
|
flex: "none",
|
|
@@ -678,7 +678,7 @@ window.__ModuleLoader__.load({
|
|
|
678
678
|
maxHeight: 240,
|
|
679
679
|
overflowY: "auto",
|
|
680
680
|
padding: 5,
|
|
681
|
-
border: "1px solid var(--dsw-alias-border-l2)",
|
|
681
|
+
border: "1px solid var(--dsw-alias-border-l2, color-mix(in srgb, currentColor 16%, transparent))",
|
|
682
682
|
borderRadius: 11,
|
|
683
683
|
background: "var(--dsw-alias-bg-layer-1)",
|
|
684
684
|
boxShadow: "0 12px 32px color-mix(in srgb, var(--dsw-alias-label-primary) 16%, transparent), 0 2px 8px color-mix(in srgb, var(--dsw-alias-label-primary) 8%, transparent)"
|
|
@@ -695,8 +695,8 @@ window.__ModuleLoader__.load({
|
|
|
695
695
|
background: "transparent",
|
|
696
696
|
color: "var(--dsw-alias-label-primary)",
|
|
697
697
|
font: "inherit",
|
|
698
|
-
fontSize:
|
|
699
|
-
lineHeight: "
|
|
698
|
+
fontSize: 14,
|
|
699
|
+
lineHeight: "22px",
|
|
700
700
|
textAlign: "left",
|
|
701
701
|
cursor: "pointer"
|
|
702
702
|
};
|
|
@@ -728,7 +728,7 @@ window.__ModuleLoader__.load({
|
|
|
728
728
|
flex: "none",
|
|
729
729
|
minHeight: 34,
|
|
730
730
|
padding: "6px 14px",
|
|
731
|
-
border: "1px solid var(--dsw-alias-border-l2)",
|
|
731
|
+
border: "1px solid var(--dsw-alias-border-l2, color-mix(in srgb, currentColor 16%, transparent))",
|
|
732
732
|
borderRadius: 9,
|
|
733
733
|
background: "var(--dsw-alias-bg-layer-2)",
|
|
734
734
|
color: "var(--dsw-alias-label-primary)",
|
|
@@ -752,7 +752,7 @@ window.__ModuleLoader__.load({
|
|
|
752
752
|
minWidth: 0,
|
|
753
753
|
margin: 8,
|
|
754
754
|
overflow: "hidden",
|
|
755
|
-
border: "1px solid var(--dsw-alias-border-l2)",
|
|
755
|
+
border: "1px solid var(--dsw-alias-border-l2, color-mix(in srgb, currentColor 16%, transparent))",
|
|
756
756
|
borderRadius: 12,
|
|
757
757
|
background: "var(--dsw-alias-bg-layer-1)",
|
|
758
758
|
boxShadow: "0 4px 16px color-mix(in srgb, #000 12%, transparent)"
|
|
@@ -766,7 +766,7 @@ window.__ModuleLoader__.load({
|
|
|
766
766
|
justifyContent: "space-between",
|
|
767
767
|
gap: 10,
|
|
768
768
|
padding: "9px 12px",
|
|
769
|
-
borderBottom: "1px solid var(--dsw-alias-border-l2)"
|
|
769
|
+
borderBottom: "1px solid var(--dsw-alias-border-l2, color-mix(in srgb, currentColor 16%, transparent))"
|
|
770
770
|
};
|
|
771
771
|
const tasksHeading = {
|
|
772
772
|
display: "block",
|
|
@@ -830,8 +830,8 @@ window.__ModuleLoader__.load({
|
|
|
830
830
|
alignItems: "center",
|
|
831
831
|
gap: 6,
|
|
832
832
|
color: "var(--dsw-alias-label-secondary)",
|
|
833
|
-
fontSize:
|
|
834
|
-
lineHeight: "
|
|
833
|
+
fontSize: 14,
|
|
834
|
+
lineHeight: "22px",
|
|
835
835
|
fontWeight: 600
|
|
836
836
|
};
|
|
837
837
|
const tasksGroupToggle = {
|
|
@@ -843,8 +843,8 @@ window.__ModuleLoader__.load({
|
|
|
843
843
|
background: "transparent",
|
|
844
844
|
color: "var(--dsw-alias-label-secondary)",
|
|
845
845
|
font: "inherit",
|
|
846
|
-
fontSize:
|
|
847
|
-
lineHeight: "
|
|
846
|
+
fontSize: 14,
|
|
847
|
+
lineHeight: "22px",
|
|
848
848
|
fontWeight: 600,
|
|
849
849
|
cursor: "pointer"
|
|
850
850
|
};
|
|
@@ -868,7 +868,7 @@ window.__ModuleLoader__.load({
|
|
|
868
868
|
const tasksFinishedSection = {
|
|
869
869
|
marginTop: 12,
|
|
870
870
|
paddingTop: 8,
|
|
871
|
-
borderTop: "1px solid var(--dsw-alias-border-l2)"
|
|
871
|
+
borderTop: "1px solid var(--dsw-alias-border-l2, color-mix(in srgb, currentColor 16%, transparent))"
|
|
872
872
|
};
|
|
873
873
|
const taskCardList = {
|
|
874
874
|
display: "flex",
|
|
@@ -878,12 +878,12 @@ window.__ModuleLoader__.load({
|
|
|
878
878
|
};
|
|
879
879
|
const taskCard = {
|
|
880
880
|
padding: "11px 12px",
|
|
881
|
-
border: "1px solid var(--dsw-alias-border-l2)",
|
|
881
|
+
border: "1px solid var(--dsw-alias-border-l2, color-mix(in srgb, currentColor 16%, transparent))",
|
|
882
882
|
borderRadius: 10,
|
|
883
883
|
background: "var(--dsw-alias-bg-layer-1)",
|
|
884
884
|
boxShadow: "0 1px 3px color-mix(in srgb, #000 7%, transparent)"
|
|
885
885
|
};
|
|
886
|
-
const taskCardRunning = { borderColor: "var(--dsw-alias-border-l3)" };
|
|
886
|
+
const taskCardRunning = { borderColor: "var(--dsw-alias-border-l3, color-mix(in srgb, currentColor 24%, transparent))" };
|
|
887
887
|
const taskCardTop = {
|
|
888
888
|
display: "flex",
|
|
889
889
|
alignItems: "flex-start",
|
|
@@ -994,7 +994,7 @@ window.__ModuleLoader__.load({
|
|
|
994
994
|
};
|
|
995
995
|
const tasksBadgeWrap = {
|
|
996
996
|
display: "flex",
|
|
997
|
-
justifyContent: "flex-
|
|
997
|
+
justifyContent: "flex-start",
|
|
998
998
|
margin: "8px 0 4px"
|
|
999
999
|
};
|
|
1000
1000
|
const tasksBadgeSeat = {
|
|
@@ -1009,15 +1009,15 @@ window.__ModuleLoader__.load({
|
|
|
1009
1009
|
border: "none",
|
|
1010
1010
|
borderRadius: 6,
|
|
1011
1011
|
background: "transparent",
|
|
1012
|
-
color: "var(--dsw-
|
|
1012
|
+
color: "var(--dsw-static-blue-450)",
|
|
1013
1013
|
font: "inherit",
|
|
1014
|
-
fontSize:
|
|
1015
|
-
lineHeight: "
|
|
1014
|
+
fontSize: 14,
|
|
1015
|
+
lineHeight: "22px",
|
|
1016
1016
|
fontVariantNumeric: "tabular-nums",
|
|
1017
1017
|
cursor: "pointer",
|
|
1018
1018
|
transition: "color 120ms ease, opacity 120ms ease"
|
|
1019
1019
|
};
|
|
1020
|
-
const tasksBadgeHovered = {
|
|
1020
|
+
const tasksBadgeHovered = { textDecoration: "underline" };
|
|
1021
1021
|
const tasksBadgeDone = { opacity: .7 };
|
|
1022
1022
|
const tasksBadgeDot = {
|
|
1023
1023
|
width: 8,
|
|
@@ -1028,10 +1028,10 @@ window.__ModuleLoader__.load({
|
|
|
1028
1028
|
};
|
|
1029
1029
|
const tasksBadgeDotError = { background: "var(--dsw-alias-state-error-primary)" };
|
|
1030
1030
|
const tasksBadgeDotDone = { background: "var(--dsw-alias-state-success-primary, var(--dsw-static-green-500))" };
|
|
1031
|
-
const
|
|
1031
|
+
const tasksBadgeLabel = { fontWeight: 500 };
|
|
1032
1032
|
const tasksHoverCard = {
|
|
1033
1033
|
position: "absolute",
|
|
1034
|
-
|
|
1034
|
+
left: 0,
|
|
1035
1035
|
bottom: "calc(100% + 8px)",
|
|
1036
1036
|
zIndex: 40,
|
|
1037
1037
|
minWidth: 240,
|
|
@@ -1041,7 +1041,7 @@ window.__ModuleLoader__.load({
|
|
|
1041
1041
|
flexDirection: "column",
|
|
1042
1042
|
gap: 6,
|
|
1043
1043
|
padding: "10px 12px",
|
|
1044
|
-
border: "1px solid var(--dsw-alias-border-l2)",
|
|
1044
|
+
border: "1px solid var(--dsw-alias-border-l2, color-mix(in srgb, currentColor 16%, transparent))",
|
|
1045
1045
|
borderRadius: 12,
|
|
1046
1046
|
background: "var(--dsw-alias-bg-layer-2)",
|
|
1047
1047
|
boxShadow: "0 8px 24px color-mix(in srgb, #000 24%, transparent)",
|
|
@@ -1087,7 +1087,7 @@ window.__ModuleLoader__.load({
|
|
|
1087
1087
|
const tasksHoverHint = {
|
|
1088
1088
|
marginTop: 2,
|
|
1089
1089
|
paddingTop: 6,
|
|
1090
|
-
borderTop: "1px solid var(--dsw-alias-border-l1)",
|
|
1090
|
+
borderTop: "1px solid var(--dsw-alias-border-l1, color-mix(in srgb, currentColor 12%, transparent))",
|
|
1091
1091
|
color: "var(--dsw-alias-label-tertiary)",
|
|
1092
1092
|
fontSize: 11
|
|
1093
1093
|
};
|
|
@@ -1104,7 +1104,7 @@ window.__ModuleLoader__.load({
|
|
|
1104
1104
|
alignItems: "center",
|
|
1105
1105
|
minWidth: 0,
|
|
1106
1106
|
padding: 2,
|
|
1107
|
-
border: "1px solid var(--dsw-alias-border-l1)",
|
|
1107
|
+
border: "1px solid var(--dsw-alias-border-l1, color-mix(in srgb, currentColor 12%, transparent))",
|
|
1108
1108
|
borderRadius: 10,
|
|
1109
1109
|
background: "var(--dsw-alias-interactive-bg-base, var(--dsw-alias-bg-layer-1))",
|
|
1110
1110
|
color: "var(--dsw-alias-label-secondary)"
|
|
@@ -1149,7 +1149,7 @@ window.__ModuleLoader__.load({
|
|
|
1149
1149
|
flexDirection: "column",
|
|
1150
1150
|
gap: 4,
|
|
1151
1151
|
padding: 4,
|
|
1152
|
-
border: "1px solid var(--dsw-alias-border-
|
|
1152
|
+
border: "1px solid var(--dsw-alias-border-l2, color-mix(in srgb, currentColor 16%, transparent))",
|
|
1153
1153
|
borderRadius: 10,
|
|
1154
1154
|
background: "var(--dsw-specific-menu)",
|
|
1155
1155
|
boxShadow: "var(--dsw-shadow-lv3)"
|
|
@@ -1161,7 +1161,7 @@ window.__ModuleLoader__.load({
|
|
|
1161
1161
|
alignItems: "center",
|
|
1162
1162
|
gap: 6,
|
|
1163
1163
|
padding: "0 8px",
|
|
1164
|
-
border: "1px solid var(--dsw-alias-border-l2)",
|
|
1164
|
+
border: "1px solid var(--dsw-alias-border-l2, color-mix(in srgb, currentColor 16%, transparent))",
|
|
1165
1165
|
borderRadius: 7,
|
|
1166
1166
|
background: "var(--dsw-alias-bg-layer-1)",
|
|
1167
1167
|
color: "var(--dsw-alias-label-tertiary)"
|
|
@@ -1221,7 +1221,7 @@ window.__ModuleLoader__.load({
|
|
|
1221
1221
|
width: 1,
|
|
1222
1222
|
height: 16,
|
|
1223
1223
|
flex: "none",
|
|
1224
|
-
background: "var(--dsw-alias-border-l2)"
|
|
1224
|
+
background: "var(--dsw-alias-border-l2, color-mix(in srgb, currentColor 16%, transparent))"
|
|
1225
1225
|
};
|
|
1226
1226
|
const heroWorktreeToggle = {
|
|
1227
1227
|
height: 26,
|
|
@@ -1253,7 +1253,7 @@ window.__ModuleLoader__.load({
|
|
|
1253
1253
|
display: "grid",
|
|
1254
1254
|
placeItems: "center",
|
|
1255
1255
|
flex: "none",
|
|
1256
|
-
border: "1px solid var(--dsw-alias-border-
|
|
1256
|
+
border: "1px solid var(--dsw-alias-border-l2, color-mix(in srgb, currentColor 16%, transparent))",
|
|
1257
1257
|
borderRadius: 4,
|
|
1258
1258
|
background: "var(--dsw-alias-bg-layer-2)",
|
|
1259
1259
|
boxShadow: "inset 0 1px 1px rgba(0, 0, 0, 0.08)",
|
|
@@ -1281,7 +1281,7 @@ window.__ModuleLoader__.load({
|
|
|
1281
1281
|
flexDirection: "column",
|
|
1282
1282
|
gap: 12,
|
|
1283
1283
|
padding: 14,
|
|
1284
|
-
border: "1px solid var(--dsw-alias-border-l2)",
|
|
1284
|
+
border: "1px solid var(--dsw-alias-border-l2, color-mix(in srgb, currentColor 16%, transparent))",
|
|
1285
1285
|
borderRadius: 12,
|
|
1286
1286
|
background: "var(--dsw-alias-bg-layer-1)",
|
|
1287
1287
|
boxShadow: "var(--dsw-shadow-lv3)"
|
|
@@ -1401,18 +1401,18 @@ window.__ModuleLoader__.load({
|
|
|
1401
1401
|
alignItems: "center",
|
|
1402
1402
|
gap: 9,
|
|
1403
1403
|
padding: "7px 11px",
|
|
1404
|
-
border: "1px solid var(--dsw-alias-border-l2)",
|
|
1404
|
+
border: "1px solid var(--dsw-alias-border-l2, color-mix(in srgb, currentColor 16%, transparent))",
|
|
1405
1405
|
borderRadius: 11,
|
|
1406
1406
|
background: "var(--dsw-alias-bg-layer-1)",
|
|
1407
1407
|
color: "var(--dsw-alias-label-primary)",
|
|
1408
1408
|
boxShadow: "0 1px 2px color-mix(in srgb, var(--dsw-alias-label-primary) 4%, transparent)",
|
|
1409
1409
|
font: "inherit",
|
|
1410
|
-
fontSize:
|
|
1411
|
-
lineHeight: "
|
|
1410
|
+
fontSize: 14,
|
|
1411
|
+
lineHeight: "22px",
|
|
1412
1412
|
textAlign: "left"
|
|
1413
1413
|
};
|
|
1414
1414
|
const repositoryBarMerged = {
|
|
1415
|
-
borderColor: "color-mix(in srgb, #a78bfa 30%, var(--dsw-alias-border-l2))",
|
|
1415
|
+
borderColor: "color-mix(in srgb, #a78bfa 30%, var(--dsw-alias-border-l2, color-mix(in srgb, currentColor 16%, transparent)))",
|
|
1416
1416
|
background: "color-mix(in srgb, #a78bfa 5%, var(--dsw-alias-bg-layer-1))"
|
|
1417
1417
|
};
|
|
1418
1418
|
const repositoryPrIcon = {
|
|
@@ -1457,7 +1457,7 @@ window.__ModuleLoader__.load({
|
|
|
1457
1457
|
flexDirection: "column",
|
|
1458
1458
|
gap: 10,
|
|
1459
1459
|
padding: "13px 14px",
|
|
1460
|
-
border: "1px solid var(--dsw-alias-border-l2)",
|
|
1460
|
+
border: "1px solid var(--dsw-alias-border-l2, color-mix(in srgb, currentColor 16%, transparent))",
|
|
1461
1461
|
borderRadius: 12,
|
|
1462
1462
|
background: "var(--dsw-alias-bg-layer-1)",
|
|
1463
1463
|
boxShadow: "0 14px 38px color-mix(in srgb, #000 34%, transparent)",
|
|
@@ -1590,6 +1590,11 @@ window.__ModuleLoader__.load({
|
|
|
1590
1590
|
fontWeight: 550,
|
|
1591
1591
|
whiteSpace: "nowrap"
|
|
1592
1592
|
};
|
|
1593
|
+
const repositoryItemLabel = {
|
|
1594
|
+
minWidth: 0,
|
|
1595
|
+
overflow: "hidden",
|
|
1596
|
+
textOverflow: "ellipsis"
|
|
1597
|
+
};
|
|
1593
1598
|
const repositoryItemDot = {
|
|
1594
1599
|
width: 6,
|
|
1595
1600
|
height: 6,
|
|
@@ -1632,7 +1637,7 @@ window.__ModuleLoader__.load({
|
|
|
1632
1637
|
gap: 4,
|
|
1633
1638
|
minHeight: 26,
|
|
1634
1639
|
padding: "3px 8px",
|
|
1635
|
-
border: "1px solid var(--dsw-alias-border-l2)",
|
|
1640
|
+
border: "1px solid var(--dsw-alias-border-l2, color-mix(in srgb, currentColor 16%, transparent))",
|
|
1636
1641
|
borderRadius: 7,
|
|
1637
1642
|
background: "var(--dsw-alias-bg-layer-2)",
|
|
1638
1643
|
font: "inherit",
|
|
@@ -1645,6 +1650,193 @@ window.__ModuleLoader__.load({
|
|
|
1645
1650
|
background: "transparent",
|
|
1646
1651
|
color: "var(--dsw-alias-label-tertiary)"
|
|
1647
1652
|
};
|
|
1653
|
+
const repositoryAutoFix = {
|
|
1654
|
+
width: 26,
|
|
1655
|
+
minHeight: 26,
|
|
1656
|
+
flex: "none",
|
|
1657
|
+
display: "inline-flex",
|
|
1658
|
+
alignItems: "center",
|
|
1659
|
+
justifyContent: "center",
|
|
1660
|
+
padding: 0,
|
|
1661
|
+
border: "1px solid var(--dsw-alias-border-l2, color-mix(in srgb, currentColor 16%, transparent))",
|
|
1662
|
+
borderRadius: 7,
|
|
1663
|
+
outline: "none",
|
|
1664
|
+
background: "var(--dsw-alias-bg-layer-2)",
|
|
1665
|
+
color: "var(--dsw-alias-label-tertiary)",
|
|
1666
|
+
font: "inherit",
|
|
1667
|
+
lineHeight: "18px",
|
|
1668
|
+
cursor: "pointer"
|
|
1669
|
+
};
|
|
1670
|
+
const repositoryAutoFixActive = {
|
|
1671
|
+
borderColor: "color-mix(in srgb, var(--dsw-static-blue-450) 45%, transparent)",
|
|
1672
|
+
background: "color-mix(in srgb, var(--dsw-static-blue-450) 12%, transparent)",
|
|
1673
|
+
color: "var(--dsw-static-blue-450)"
|
|
1674
|
+
};
|
|
1675
|
+
const repositoryUpdateTrigger = {
|
|
1676
|
+
flex: "none",
|
|
1677
|
+
display: "inline-flex",
|
|
1678
|
+
alignItems: "center",
|
|
1679
|
+
gap: 4,
|
|
1680
|
+
minHeight: 26,
|
|
1681
|
+
padding: "3px 8px",
|
|
1682
|
+
border: "1px solid color-mix(in srgb, var(--dsw-static-blue-450) 45%, transparent)",
|
|
1683
|
+
borderRadius: 7,
|
|
1684
|
+
background: "color-mix(in srgb, var(--dsw-static-blue-450) 12%, transparent)",
|
|
1685
|
+
color: "var(--dsw-static-blue-450)",
|
|
1686
|
+
font: "inherit",
|
|
1687
|
+
fontSize: 12,
|
|
1688
|
+
lineHeight: "18px",
|
|
1689
|
+
fontWeight: 650,
|
|
1690
|
+
whiteSpace: "nowrap",
|
|
1691
|
+
cursor: "pointer"
|
|
1692
|
+
};
|
|
1693
|
+
const repositoryChecksFrame = {
|
|
1694
|
+
position: "relative",
|
|
1695
|
+
display: "inline-flex",
|
|
1696
|
+
minWidth: 0
|
|
1697
|
+
};
|
|
1698
|
+
const repositoryChecksTrigger = {
|
|
1699
|
+
display: "inline-flex",
|
|
1700
|
+
alignItems: "center",
|
|
1701
|
+
minWidth: 0,
|
|
1702
|
+
padding: 0,
|
|
1703
|
+
border: "none",
|
|
1704
|
+
background: "transparent",
|
|
1705
|
+
font: "inherit",
|
|
1706
|
+
color: "inherit",
|
|
1707
|
+
cursor: "pointer"
|
|
1708
|
+
};
|
|
1709
|
+
const repositoryChecksCard = {
|
|
1710
|
+
position: "absolute",
|
|
1711
|
+
zIndex: 1100,
|
|
1712
|
+
bottom: "calc(100% + 8px)",
|
|
1713
|
+
right: 0,
|
|
1714
|
+
width: 320,
|
|
1715
|
+
boxSizing: "border-box",
|
|
1716
|
+
display: "flex",
|
|
1717
|
+
flexDirection: "column",
|
|
1718
|
+
alignItems: "stretch",
|
|
1719
|
+
gap: 8,
|
|
1720
|
+
padding: 12,
|
|
1721
|
+
border: "1px solid var(--dsw-alias-border-l2, color-mix(in srgb, currentColor 16%, transparent))",
|
|
1722
|
+
borderRadius: 10,
|
|
1723
|
+
background: "var(--dsw-specific-menu, var(--dsw-alias-bg-layer-1))",
|
|
1724
|
+
boxShadow: "var(--dsw-shadow-lv3)",
|
|
1725
|
+
textAlign: "left",
|
|
1726
|
+
cursor: "default"
|
|
1727
|
+
};
|
|
1728
|
+
const repositoryChecksTitle = {
|
|
1729
|
+
color: "var(--dsw-alias-label-primary)",
|
|
1730
|
+
fontSize: 12,
|
|
1731
|
+
fontWeight: 650
|
|
1732
|
+
};
|
|
1733
|
+
const repositoryChecksHint = {
|
|
1734
|
+
color: "var(--dsw-alias-label-tertiary)",
|
|
1735
|
+
fontSize: 12
|
|
1736
|
+
};
|
|
1737
|
+
const repositoryChecksError = {
|
|
1738
|
+
color: "var(--dsw-alias-state-error-primary)",
|
|
1739
|
+
fontSize: 12
|
|
1740
|
+
};
|
|
1741
|
+
const repositoryChecksItem = {
|
|
1742
|
+
display: "flex",
|
|
1743
|
+
flexDirection: "column",
|
|
1744
|
+
gap: 2,
|
|
1745
|
+
minWidth: 0
|
|
1746
|
+
};
|
|
1747
|
+
const repositoryChecksName = {
|
|
1748
|
+
color: "var(--dsw-alias-label-primary)",
|
|
1749
|
+
fontSize: 12,
|
|
1750
|
+
fontWeight: 600,
|
|
1751
|
+
overflow: "hidden",
|
|
1752
|
+
textOverflow: "ellipsis",
|
|
1753
|
+
whiteSpace: "nowrap"
|
|
1754
|
+
};
|
|
1755
|
+
const repositoryChecksDesc = {
|
|
1756
|
+
color: "var(--dsw-alias-label-tertiary)",
|
|
1757
|
+
fontSize: 11,
|
|
1758
|
+
overflow: "hidden",
|
|
1759
|
+
textOverflow: "ellipsis",
|
|
1760
|
+
whiteSpace: "nowrap"
|
|
1761
|
+
};
|
|
1762
|
+
const repositoryChecksFix = {
|
|
1763
|
+
alignSelf: "flex-end",
|
|
1764
|
+
minHeight: 26,
|
|
1765
|
+
padding: "3px 10px",
|
|
1766
|
+
border: "none",
|
|
1767
|
+
borderRadius: 7,
|
|
1768
|
+
background: "var(--dsw-static-blue-450)",
|
|
1769
|
+
color: "var(--dsw-alias-label-on-accent, #fff)",
|
|
1770
|
+
font: "inherit",
|
|
1771
|
+
fontSize: 12,
|
|
1772
|
+
fontWeight: 650,
|
|
1773
|
+
cursor: "pointer"
|
|
1774
|
+
};
|
|
1775
|
+
const diffPrCommentsButton = {
|
|
1776
|
+
minHeight: 28,
|
|
1777
|
+
display: "inline-flex",
|
|
1778
|
+
alignItems: "center",
|
|
1779
|
+
gap: 4,
|
|
1780
|
+
padding: "4px 8px",
|
|
1781
|
+
border: "1px solid var(--dsw-alias-border-l2, color-mix(in srgb, currentColor 16%, transparent))",
|
|
1782
|
+
borderRadius: 7,
|
|
1783
|
+
background: "var(--dsw-alias-bg-layer-2)",
|
|
1784
|
+
font: "inherit",
|
|
1785
|
+
fontSize: 12,
|
|
1786
|
+
fontWeight: 650,
|
|
1787
|
+
whiteSpace: "nowrap",
|
|
1788
|
+
cursor: "pointer"
|
|
1789
|
+
};
|
|
1790
|
+
const diffGhCommentAuthor = {
|
|
1791
|
+
color: "var(--dsw-alias-label-tertiary)",
|
|
1792
|
+
fontWeight: 600
|
|
1793
|
+
};
|
|
1794
|
+
const diffGhCommentLink = {
|
|
1795
|
+
color: "var(--dsw-static-blue-450)",
|
|
1796
|
+
textDecoration: "none",
|
|
1797
|
+
fontWeight: 650
|
|
1798
|
+
};
|
|
1799
|
+
const diffModalConflicts = {
|
|
1800
|
+
display: "flex",
|
|
1801
|
+
flexDirection: "column",
|
|
1802
|
+
gap: 4,
|
|
1803
|
+
margin: 0,
|
|
1804
|
+
padding: "8px 10px",
|
|
1805
|
+
borderRadius: 8,
|
|
1806
|
+
background: "var(--dsw-alias-bg-layer-2)",
|
|
1807
|
+
fontSize: 12,
|
|
1808
|
+
listStyle: "none"
|
|
1809
|
+
};
|
|
1810
|
+
const diffModalConflictResolve = {
|
|
1811
|
+
alignSelf: "flex-start",
|
|
1812
|
+
minHeight: 28,
|
|
1813
|
+
padding: "4px 12px",
|
|
1814
|
+
border: "none",
|
|
1815
|
+
borderRadius: 7,
|
|
1816
|
+
background: "var(--dsw-static-blue-450)",
|
|
1817
|
+
color: "var(--dsw-alias-label-on-accent, #fff)",
|
|
1818
|
+
font: "inherit",
|
|
1819
|
+
fontSize: 12,
|
|
1820
|
+
fontWeight: 650,
|
|
1821
|
+
cursor: "pointer"
|
|
1822
|
+
};
|
|
1823
|
+
const repositoryMergeTrigger = {
|
|
1824
|
+
flex: "none",
|
|
1825
|
+
display: "inline-flex",
|
|
1826
|
+
alignItems: "center",
|
|
1827
|
+
gap: 4,
|
|
1828
|
+
minHeight: 26,
|
|
1829
|
+
padding: "3px 8px",
|
|
1830
|
+
border: "1px solid color-mix(in srgb, var(--dsw-alias-state-success-primary) 45%, transparent)",
|
|
1831
|
+
borderRadius: 7,
|
|
1832
|
+
background: "color-mix(in srgb, var(--dsw-alias-state-success-primary) 12%, transparent)",
|
|
1833
|
+
color: "var(--dsw-alias-state-success-primary)",
|
|
1834
|
+
font: "inherit",
|
|
1835
|
+
fontSize: 12,
|
|
1836
|
+
lineHeight: "18px",
|
|
1837
|
+
fontWeight: 650,
|
|
1838
|
+
cursor: "pointer"
|
|
1839
|
+
};
|
|
1648
1840
|
const diffAdd = { color: "var(--dsw-alias-state-success-primary)" };
|
|
1649
1841
|
const diffDelete = { color: "var(--dsw-alias-state-error-primary)" };
|
|
1650
1842
|
const diffCommentButtonClass = "dshClaudeDiffCommentButton";
|
|
@@ -1690,7 +1882,7 @@ window.__ModuleLoader__.load({
|
|
|
1690
1882
|
left: 62,
|
|
1691
1883
|
margin: "4px 8px 8px 62px",
|
|
1692
1884
|
padding: "8px 10px",
|
|
1693
|
-
border: "1px solid var(--dsw-alias-border-l2)",
|
|
1885
|
+
border: "1px solid var(--dsw-alias-border-l2, color-mix(in srgb, currentColor 16%, transparent))",
|
|
1694
1886
|
borderRadius: 8,
|
|
1695
1887
|
background: "var(--dsw-alias-bg-layer-1)",
|
|
1696
1888
|
fontFamily: "var(--dsw-font-family, system-ui)",
|
|
@@ -1717,7 +1909,7 @@ window.__ModuleLoader__.load({
|
|
|
1717
1909
|
minHeight: 56,
|
|
1718
1910
|
boxSizing: "border-box",
|
|
1719
1911
|
padding: "6px 8px",
|
|
1720
|
-
border: "1px solid var(--dsw-alias-border-l2)",
|
|
1912
|
+
border: "1px solid var(--dsw-alias-border-l2, color-mix(in srgb, currentColor 16%, transparent))",
|
|
1721
1913
|
borderRadius: 6,
|
|
1722
1914
|
background: "var(--dsw-alias-bg-base)",
|
|
1723
1915
|
color: "var(--dsw-alias-label-primary)",
|
|
@@ -1733,7 +1925,7 @@ window.__ModuleLoader__.load({
|
|
|
1733
1925
|
const diffCommentActionButton = {
|
|
1734
1926
|
minHeight: 24,
|
|
1735
1927
|
padding: "2px 10px",
|
|
1736
|
-
border: "1px solid var(--dsw-alias-border-l2)",
|
|
1928
|
+
border: "1px solid var(--dsw-alias-border-l2, color-mix(in srgb, currentColor 16%, transparent))",
|
|
1737
1929
|
borderRadius: 6,
|
|
1738
1930
|
background: "transparent",
|
|
1739
1931
|
color: "var(--dsw-alias-label-secondary)",
|
|
@@ -1768,7 +1960,7 @@ window.__ModuleLoader__.load({
|
|
|
1768
1960
|
alignItems: "center",
|
|
1769
1961
|
gap: 8,
|
|
1770
1962
|
padding: "7px 11px",
|
|
1771
|
-
border: "1px solid var(--dsw-alias-border-l2)",
|
|
1963
|
+
border: "1px solid var(--dsw-alias-border-l2, color-mix(in srgb, currentColor 16%, transparent))",
|
|
1772
1964
|
borderRadius: 11,
|
|
1773
1965
|
background: "var(--dsw-alias-bg-layer-1)",
|
|
1774
1966
|
boxShadow: "0 1px 2px color-mix(in srgb, var(--dsw-alias-label-primary) 4%, transparent)",
|
|
@@ -1856,7 +2048,7 @@ window.__ModuleLoader__.load({
|
|
|
1856
2048
|
minWidth: 0,
|
|
1857
2049
|
margin: 8,
|
|
1858
2050
|
overflow: "hidden",
|
|
1859
|
-
border: "1px solid var(--dsw-alias-border-l2)",
|
|
2051
|
+
border: "1px solid var(--dsw-alias-border-l2, color-mix(in srgb, currentColor 16%, transparent))",
|
|
1860
2052
|
borderRadius: 12,
|
|
1861
2053
|
background: "var(--dsw-alias-bg-layer-1)",
|
|
1862
2054
|
boxShadow: "0 4px 16px color-mix(in srgb, #000 12%, transparent)"
|
|
@@ -1875,18 +2067,26 @@ window.__ModuleLoader__.load({
|
|
|
1875
2067
|
justifyContent: "space-between",
|
|
1876
2068
|
gap: 10,
|
|
1877
2069
|
padding: "9px 12px",
|
|
1878
|
-
borderBottom: "1px solid var(--dsw-alias-border-l2)"
|
|
2070
|
+
borderBottom: "1px solid var(--dsw-alias-border-l2, color-mix(in srgb, currentColor 16%, transparent))"
|
|
1879
2071
|
};
|
|
1880
2072
|
const diffHeaderTitle = {
|
|
1881
2073
|
minWidth: 0,
|
|
1882
2074
|
display: "flex",
|
|
1883
2075
|
alignItems: "center",
|
|
1884
2076
|
gap: 8,
|
|
2077
|
+
overflow: "hidden",
|
|
1885
2078
|
color: "var(--dsw-alias-label-primary)",
|
|
1886
2079
|
fontSize: 15,
|
|
1887
|
-
fontWeight: 650
|
|
2080
|
+
fontWeight: 650,
|
|
2081
|
+
whiteSpace: "nowrap"
|
|
2082
|
+
};
|
|
2083
|
+
const diffHeaderLabel = {
|
|
2084
|
+
minWidth: 0,
|
|
2085
|
+
overflow: "hidden",
|
|
2086
|
+
textOverflow: "ellipsis"
|
|
1888
2087
|
};
|
|
1889
2088
|
const diffHeaderActions = {
|
|
2089
|
+
flex: "none",
|
|
1890
2090
|
display: "flex",
|
|
1891
2091
|
alignItems: "center",
|
|
1892
2092
|
gap: 5
|
|
@@ -1939,7 +2139,7 @@ window.__ModuleLoader__.load({
|
|
|
1939
2139
|
alignItems: "center",
|
|
1940
2140
|
gap: 7,
|
|
1941
2141
|
padding: "6px 12px",
|
|
1942
|
-
borderBottom: "1px solid var(--dsw-alias-border-l2)",
|
|
2142
|
+
borderBottom: "1px solid var(--dsw-alias-border-l2, color-mix(in srgb, currentColor 16%, transparent))",
|
|
1943
2143
|
color: "var(--dsw-alias-label-tertiary)",
|
|
1944
2144
|
fontSize: 12
|
|
1945
2145
|
};
|
|
@@ -1949,7 +2149,7 @@ window.__ModuleLoader__.load({
|
|
|
1949
2149
|
overflow: "auto",
|
|
1950
2150
|
background: "var(--dsw-alias-bg-base)"
|
|
1951
2151
|
};
|
|
1952
|
-
const diffFile = { borderBottom: "1px solid var(--dsw-alias-border-l2)" };
|
|
2152
|
+
const diffFile = { borderBottom: "1px solid var(--dsw-alias-border-l2, color-mix(in srgb, currentColor 16%, transparent))" };
|
|
1953
2153
|
const diffFileHeader = {
|
|
1954
2154
|
width: "100%",
|
|
1955
2155
|
minHeight: 38,
|
|
@@ -1984,8 +2184,8 @@ window.__ModuleLoader__.load({
|
|
|
1984
2184
|
padding: "4px 0 8px",
|
|
1985
2185
|
background: "var(--dsw-alias-bg-base)",
|
|
1986
2186
|
fontFamily: "var(--dsw-font-family-mono, ui-monospace, SFMono-Regular, Consolas, monospace)",
|
|
1987
|
-
fontSize:
|
|
1988
|
-
lineHeight: "
|
|
2187
|
+
fontSize: 14,
|
|
2188
|
+
lineHeight: "22px"
|
|
1989
2189
|
};
|
|
1990
2190
|
const diffLine = {
|
|
1991
2191
|
minHeight: 17,
|
|
@@ -2099,7 +2299,7 @@ window.__ModuleLoader__.load({
|
|
|
2099
2299
|
maxHeight: 300,
|
|
2100
2300
|
overflowX: "hidden",
|
|
2101
2301
|
overflowY: "auto",
|
|
2102
|
-
border: "1px solid var(--dsw-alias-border-l2)",
|
|
2302
|
+
border: "1px solid var(--dsw-alias-border-l2, color-mix(in srgb, currentColor 16%, transparent))",
|
|
2103
2303
|
borderRadius: 8
|
|
2104
2304
|
};
|
|
2105
2305
|
const diffModalFile = {
|
|
@@ -2108,7 +2308,7 @@ window.__ModuleLoader__.load({
|
|
|
2108
2308
|
gap: 12,
|
|
2109
2309
|
minWidth: 0,
|
|
2110
2310
|
padding: "10px 14px",
|
|
2111
|
-
borderBottom: "1px solid var(--dsw-alias-border-l2)",
|
|
2311
|
+
borderBottom: "1px solid var(--dsw-alias-border-l2, color-mix(in srgb, currentColor 16%, transparent))",
|
|
2112
2312
|
color: "var(--dsw-alias-label-secondary)",
|
|
2113
2313
|
fontSize: 15,
|
|
2114
2314
|
lineHeight: "22px"
|
|
@@ -2576,8 +2776,8 @@ window.__ModuleLoader__.load({
|
|
|
2576
2776
|
},
|
|
2577
2777
|
"aria-hidden": "true"
|
|
2578
2778
|
}), /* @__PURE__ */ jsx("span", {
|
|
2579
|
-
style:
|
|
2580
|
-
children:
|
|
2779
|
+
style: tasksBadgeLabel,
|
|
2780
|
+
children: label
|
|
2581
2781
|
})]
|
|
2582
2782
|
})]
|
|
2583
2783
|
})
|
|
@@ -2630,7 +2830,7 @@ window.__ModuleLoader__.load({
|
|
|
2630
2830
|
const MAX_REVIEW_COMMENTS = 50;
|
|
2631
2831
|
const MAX_REVIEW_COMMENT_CHARS = 2e3;
|
|
2632
2832
|
const MAX_TRANSCRIPT_CHARS = 64e3;
|
|
2633
|
-
function record$
|
|
2833
|
+
function record$5(value) {
|
|
2634
2834
|
return value !== null && typeof value === "object" && !Array.isArray(value) ? value : void 0;
|
|
2635
2835
|
}
|
|
2636
2836
|
function nonNegativeInteger(value) {
|
|
@@ -2640,18 +2840,18 @@ window.__ModuleLoader__.load({
|
|
|
2640
2840
|
return value === void 0 || typeof value === "string" && value.length <= MAX_REPOSITORY_TEXT_CHARS;
|
|
2641
2841
|
}
|
|
2642
2842
|
function validateRepository(value) {
|
|
2643
|
-
const repository = record$
|
|
2843
|
+
const repository = record$5(value);
|
|
2644
2844
|
if (repository === void 0 || ![
|
|
2645
2845
|
"ready",
|
|
2646
2846
|
"not-repository",
|
|
2647
2847
|
"unavailable"
|
|
2648
2848
|
].includes(String(repository.status)) || typeof repository.cwd !== "string" || repository.cwd.length > MAX_REPOSITORY_TEXT_CHARS || !optionalBoundedString(repository.root) || !optionalBoundedString(repository.branch) || !optionalBoundedString(repository.remote) || repository.detached !== void 0 && typeof repository.detached !== "boolean" || repository.worktree !== void 0 && typeof repository.worktree !== "boolean" || repository.dirty !== void 0 && typeof repository.dirty !== "boolean" || repository.upstream !== void 0 && typeof repository.upstream !== "boolean" || repository.ahead !== void 0 && !nonNegativeInteger(repository.ahead) || repository.behind !== void 0 && !nonNegativeInteger(repository.behind)) return false;
|
|
2649
2849
|
if (repository.diff !== void 0) {
|
|
2650
|
-
const diff = record$
|
|
2850
|
+
const diff = record$5(repository.diff);
|
|
2651
2851
|
if (diff === void 0 || !nonNegativeInteger(diff.additions) || !nonNegativeInteger(diff.deletions) || !nonNegativeInteger(diff.files) || typeof diff.truncated !== "boolean" || diff.patch !== void 0 && (typeof diff.patch !== "string" || diff.patch.length > MAX_DIFF_CHARS)) return false;
|
|
2652
2852
|
}
|
|
2653
2853
|
if (repository.pullRequest === void 0) return true;
|
|
2654
|
-
const pullRequest = record$
|
|
2854
|
+
const pullRequest = record$5(repository.pullRequest);
|
|
2655
2855
|
if (pullRequest === void 0 || !Number.isSafeInteger(pullRequest.number) || Number(pullRequest.number) <= 0 || typeof pullRequest.title !== "string" || pullRequest.title.length > MAX_REPOSITORY_TEXT_CHARS || typeof pullRequest.url !== "string" || pullRequest.url.length > MAX_REPOSITORY_TEXT_CHARS || ![
|
|
2656
2856
|
"open",
|
|
2657
2857
|
"closed",
|
|
@@ -2676,24 +2876,24 @@ window.__ModuleLoader__.load({
|
|
|
2676
2876
|
}
|
|
2677
2877
|
/** Validate the public route envelope before publishing it to UI components. */
|
|
2678
2878
|
function parseClaudeClientProjection(value) {
|
|
2679
|
-
const input = record$
|
|
2879
|
+
const input = record$5(value);
|
|
2680
2880
|
if (input === void 0 || input.schemaVersion !== 1 || !nonNegativeInteger(input.revision) || typeof input.owned !== "boolean" || !Array.isArray(input.commands) || input.commands.length > MAX_COMMANDS || !Array.isArray(input.activities) || input.activities.length > MAX_ACTIVITIES) throw new Error("invalid Claude sidecar projection");
|
|
2681
2881
|
for (const item of input.commands) {
|
|
2682
|
-
const command = record$
|
|
2882
|
+
const command = record$5(item);
|
|
2683
2883
|
if (command === void 0 || typeof command.publicName !== "string" || typeof command.claudeName !== "string" || typeof command.description !== "string" || command.hint !== void 0 && typeof command.hint !== "string" || typeof command.prefixed !== "boolean") throw new Error("invalid Claude command projection");
|
|
2684
2884
|
}
|
|
2685
2885
|
for (const item of input.activities) {
|
|
2686
|
-
const activity = record$
|
|
2886
|
+
const activity = record$5(item);
|
|
2687
2887
|
if (activity === void 0 || !nonNegativeInteger(activity.turn) || !nonNegativeInteger(activity.step) || !nonNegativeInteger(activity.ordinal) || typeof activity.kind !== "string") throw new Error("invalid Claude sidecar activity");
|
|
2688
2888
|
}
|
|
2689
|
-
if (input.contextUsage !== void 0 && record$
|
|
2690
|
-
const tasks = input.tasks === void 0 ? void 0 : record$
|
|
2889
|
+
if (input.contextUsage !== void 0 && record$5(input.contextUsage) === void 0) throw new Error("invalid Claude context projection");
|
|
2890
|
+
const tasks = input.tasks === void 0 ? void 0 : record$5(input.tasks);
|
|
2691
2891
|
if (tasks !== void 0 && !Array.isArray(tasks.tasks)) throw new Error("invalid Claude tasks projection");
|
|
2692
2892
|
if (input.repository !== void 0 && !validateRepository(input.repository)) throw new Error("invalid Claude repository projection");
|
|
2693
2893
|
if (input.reviewComments !== void 0) {
|
|
2694
2894
|
if (!Array.isArray(input.reviewComments) || input.reviewComments.length > MAX_REVIEW_COMMENTS) throw new Error("invalid Claude review comment projection");
|
|
2695
2895
|
for (const item of input.reviewComments) {
|
|
2696
|
-
const comment = record$
|
|
2896
|
+
const comment = record$5(item);
|
|
2697
2897
|
if (comment === void 0 || typeof comment.id !== "string" || comment.id.length === 0 || comment.id.length > 128 || typeof comment.path !== "string" || comment.path.length === 0 || comment.path.length > MAX_REPOSITORY_TEXT_CHARS || !nonNegativeInteger(comment.line) || comment.side !== "old" && comment.side !== "new" || typeof comment.text !== "string" || comment.text.length > MAX_REVIEW_COMMENT_CHARS) throw new Error("invalid Claude review comment projection");
|
|
2698
2898
|
}
|
|
2699
2899
|
}
|
|
@@ -2891,7 +3091,7 @@ window.__ModuleLoader__.load({
|
|
|
2891
3091
|
} catch {
|
|
2892
3092
|
return;
|
|
2893
3093
|
}
|
|
2894
|
-
const event = record$
|
|
3094
|
+
const event = record$5(value);
|
|
2895
3095
|
if (event === void 0 || typeof event.type !== "string") return;
|
|
2896
3096
|
try {
|
|
2897
3097
|
switch (event.type) {
|
|
@@ -3033,8 +3233,8 @@ window.__ModuleLoader__.load({
|
|
|
3033
3233
|
".dsh-claude-transcript-text{color:var(--dsw-alias-label-primary);font-size:15px;line-height:24px;overflow-wrap:anywhere}",
|
|
3034
3234
|
".dsh-claude-tool-group-native{overflow:visible}",
|
|
3035
3235
|
".dsh-claude-tool-group-native>.dsh-claude-flow-row{padding:0}",
|
|
3036
|
-
".dsh-claude-tool-list{max-height:min(420px,calc(100vh - 320px));overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;margin-top:4px;border:1px solid var(--dsw-alias-border-l1);border-radius:10px;scrollbar-gutter:stable}",
|
|
3037
|
-
".dsh-claude-tool-item{border-top:1px solid var(--dsw-alias-border-l1)}",
|
|
3236
|
+
".dsh-claude-tool-list{max-height:min(420px,calc(100vh - 320px));overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;margin-top:4px;border:1px solid var(--dsw-alias-border-l1, color-mix(in srgb, currentColor 12%, transparent));border-radius:10px;scrollbar-gutter:stable}",
|
|
3237
|
+
".dsh-claude-tool-item{border-top:1px solid var(--dsw-alias-border-l1, color-mix(in srgb, currentColor 12%, transparent))}",
|
|
3038
3238
|
".dsh-claude-tool-item:first-child{border-top:0}",
|
|
3039
3239
|
".dsh-claude-tool-summary-row{display:flex;align-items:center;min-height:34px;gap:8px;padding:0 10px;cursor:pointer;list-style:none}",
|
|
3040
3240
|
".dsh-claude-tool-summary-row::-webkit-details-marker{display:none}",
|
|
@@ -3051,7 +3251,7 @@ window.__ModuleLoader__.load({
|
|
|
3051
3251
|
".dsh-claude-tool-path{overflow-wrap:anywhere;color:var(--dsw-alias-label-primary)}",
|
|
3052
3252
|
".dsh-claude-tool-code{max-height:260px;overflow:auto;margin:0;padding:8px 0;border-radius:8px;background:var(--dsw-alias-markdown-code-block);font:var(--dsw-font-markdown-code-block-small)}",
|
|
3053
3253
|
".dsh-claude-tool-code-line{display:grid;grid-template-columns:44px minmax(max-content,1fr);min-height:18px}",
|
|
3054
|
-
".dsh-claude-tool-line-number{padding-right:10px;text-align:right;user-select:none;color:var(--dsw-alias-label-caption);border-right:1px solid var(--dsw-alias-border-l1)}",
|
|
3254
|
+
".dsh-claude-tool-line-number{padding-right:10px;text-align:right;user-select:none;color:var(--dsw-alias-label-caption);border-right:1px solid var(--dsw-alias-border-l1, color-mix(in srgb, currentColor 12%, transparent))}",
|
|
3055
3255
|
".dsh-claude-tool-line-text{padding:0 10px;white-space:pre}",
|
|
3056
3256
|
".dsh-claude-tool-label{width:72px;flex:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px;line-height:20px;color:var(--dsw-alias-label-tertiary)}",
|
|
3057
3257
|
".dsh-claude-tool-description{min-width:0;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px;line-height:20px;color:var(--dsw-alias-label-primary)}",
|
|
@@ -3069,7 +3269,7 @@ window.__ModuleLoader__.load({
|
|
|
3069
3269
|
".dsh-claude-flow-summary{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--dsw-alias-label-tertiary);font-size:14px;line-height:24px;flex:auto}",
|
|
3070
3270
|
".dsh-claude-flow-summary[data-error]{color:var(--dsw-alias-state-error-primary)}",
|
|
3071
3271
|
".dsh-claude-flow-body{margin:4px 0 4px 22px;color:var(--dsw-alias-label-tertiary);font-size:14px;line-height:24px;white-space:pre-wrap;overflow-wrap:anywhere}",
|
|
3072
|
-
".dsh-claude-flow-detail{max-height:260px;overflow:auto;margin:4px 0 4px 4px;padding:12px 16px;border:1px solid var(--dsw-alias-border-l1);border-radius:12px;background:var(--dsw-alias-markdown-code-block);color:var(--dsw-alias-label-primary);font:var(--dsw-font-markdown-code-block-small);white-space:pre-wrap}",
|
|
3272
|
+
".dsh-claude-flow-detail{max-height:260px;overflow:auto;margin:4px 0 4px 4px;padding:12px 16px;border:1px solid var(--dsw-alias-border-l1, color-mix(in srgb, currentColor 12%, transparent));border-radius:12px;background:var(--dsw-alias-markdown-code-block);color:var(--dsw-alias-label-primary);font:var(--dsw-font-markdown-code-block-small);white-space:pre-wrap}",
|
|
3073
3273
|
".dsh-claude-flow-subcalls{display:flex;flex-direction:column;gap:2px;margin:4px 0 4px 22px;color:var(--dsw-alias-label-tertiary);font-size:13px;line-height:22px}",
|
|
3074
3274
|
".dsh-claude-act-running{animation:dsh-claude-act-pulse 1.2s ease-in-out infinite}",
|
|
3075
3275
|
"@keyframes dsh-claude-act-pulse{0%,100%{opacity:1}50%{opacity:.3}}"
|
|
@@ -3150,7 +3350,7 @@ window.__ModuleLoader__.load({
|
|
|
3150
3350
|
return value;
|
|
3151
3351
|
}
|
|
3152
3352
|
}
|
|
3153
|
-
function record$
|
|
3353
|
+
function record$4(value) {
|
|
3154
3354
|
return value !== null && typeof value === "object" && !Array.isArray(value) ? value : void 0;
|
|
3155
3355
|
}
|
|
3156
3356
|
function text(value) {
|
|
@@ -3164,7 +3364,7 @@ window.__ModuleLoader__.load({
|
|
|
3164
3364
|
if (typeof value === "string") return value;
|
|
3165
3365
|
if (typeof value === "number" || typeof value === "boolean") return String(value);
|
|
3166
3366
|
if (Array.isArray(value)) return value.map(displayValue).join(", ");
|
|
3167
|
-
return record$
|
|
3367
|
+
return record$4(value) === void 0 ? String(value) : Object.entries(value).map(([key, item]) => `${key}: ${displayValue(item)}`).join("\n");
|
|
3168
3368
|
}
|
|
3169
3369
|
function Section({ title, children }) {
|
|
3170
3370
|
return /* @__PURE__ */ jsxs("section", {
|
|
@@ -3234,15 +3434,15 @@ window.__ModuleLoader__.load({
|
|
|
3234
3434
|
function ToolPresentation({ tool, t }) {
|
|
3235
3435
|
const inputValue = parsedValue(tool.input);
|
|
3236
3436
|
const outputValue = parsedValue(tool.output);
|
|
3237
|
-
const input = record$
|
|
3238
|
-
const output = record$
|
|
3437
|
+
const input = record$4(inputValue);
|
|
3438
|
+
const output = record$4(outputValue);
|
|
3239
3439
|
const outputTitle = tool.isError === true ? t("toolError") : t("toolOutput");
|
|
3240
3440
|
if (tool.diffs !== void 0) return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(DiffBlock, { diffs: [...tool.diffs] }), /* @__PURE__ */ jsx(TextDetail, {
|
|
3241
3441
|
title: outputTitle,
|
|
3242
3442
|
value: typeof outputValue === "string" ? outputValue : void 0
|
|
3243
3443
|
})] });
|
|
3244
3444
|
if (tool.toolName === "Read") {
|
|
3245
|
-
const file = record$
|
|
3445
|
+
const file = record$4(output?.file);
|
|
3246
3446
|
const path = text(file?.filePath) ?? text(input?.file_path);
|
|
3247
3447
|
const content = text(file?.content) ?? (typeof outputValue === "string" ? outputValue : void 0);
|
|
3248
3448
|
const offset = numberValue(input?.offset) ?? 1;
|
|
@@ -3793,7 +3993,7 @@ window.__ModuleLoader__.load({
|
|
|
3793
3993
|
style: diagnosticGrid,
|
|
3794
3994
|
children: [/* @__PURE__ */ jsx("span", {
|
|
3795
3995
|
style: diagnosticLabel,
|
|
3796
|
-
children: setting.key === "outputStyle" ? t("outputStyle") : setting.key === "worktreeBranchPrefix" ? t("worktreeBranchPrefix") : setting.key
|
|
3996
|
+
children: setting.key === "outputStyle" ? t("outputStyle") : setting.key === "worktreeBranchPrefix" ? t("worktreeBranchPrefix") : setting.key === "maxProcesses" ? t("maxProcessesSetting") : setting.key === "idleTimeoutMinutes" ? t("idleTimeoutSetting") : setting.key
|
|
3797
3997
|
}), setting.kind === "select" ? /* @__PURE__ */ jsx(GlobalSettingSelect, {
|
|
3798
3998
|
setting,
|
|
3799
3999
|
disabled: globalSettingsBusy,
|
|
@@ -3816,6 +4016,10 @@ window.__ModuleLoader__.load({
|
|
|
3816
4016
|
style: notice,
|
|
3817
4017
|
children: t("worktreeBranchPrefixEffect")
|
|
3818
4018
|
}) : null,
|
|
4019
|
+
globalSettings?.settings.some((setting) => setting.key === "maxProcesses") === true ? /* @__PURE__ */ jsx("p", {
|
|
4020
|
+
style: notice,
|
|
4021
|
+
children: t("limitsSettingEffect")
|
|
4022
|
+
}) : null,
|
|
3819
4023
|
globalSettingsError === void 0 ? null : /* @__PURE__ */ jsxs("p", {
|
|
3820
4024
|
role: "alert",
|
|
3821
4025
|
style: {
|
|
@@ -3935,37 +4139,222 @@ window.__ModuleLoader__.load({
|
|
|
3935
4139
|
});
|
|
3936
4140
|
}
|
|
3937
4141
|
//#endregion
|
|
3938
|
-
//#region src/client/
|
|
3939
|
-
|
|
3940
|
-
|
|
3941
|
-
|
|
3942
|
-
|
|
3943
|
-
|
|
3944
|
-
|
|
3945
|
-
if (
|
|
4142
|
+
//#region src/client/repository-action-api.ts
|
|
4143
|
+
var RepositoryActionClientError = class extends Error {
|
|
4144
|
+
code;
|
|
4145
|
+
commit;
|
|
4146
|
+
constructor(message, code, commit) {
|
|
4147
|
+
super(message);
|
|
4148
|
+
this.name = "RepositoryActionClientError";
|
|
4149
|
+
if (code !== void 0) this.code = code;
|
|
4150
|
+
if (commit !== void 0) this.commit = commit;
|
|
3946
4151
|
}
|
|
3947
|
-
|
|
4152
|
+
};
|
|
4153
|
+
function record$3(value) {
|
|
4154
|
+
return value !== null && typeof value === "object" && !Array.isArray(value) ? value : void 0;
|
|
3948
4155
|
}
|
|
3949
|
-
function
|
|
3950
|
-
const
|
|
3951
|
-
|
|
3952
|
-
|
|
3953
|
-
|
|
3954
|
-
|
|
3955
|
-
|
|
3956
|
-
|
|
3957
|
-
style: repositoryItemDot,
|
|
3958
|
-
"aria-hidden": "true"
|
|
3959
|
-
}), label]
|
|
3960
|
-
});
|
|
4156
|
+
async function response$1(pending) {
|
|
4157
|
+
const result = await pending;
|
|
4158
|
+
const body = await result.json();
|
|
4159
|
+
if (!result.ok) {
|
|
4160
|
+
const error = record$3(body);
|
|
4161
|
+
throw new RepositoryActionClientError(typeof error?.message === "string" ? error.message : "Repository action failed.", typeof error?.error === "string" ? error.error : void 0, typeof error?.commit === "string" ? error.commit : void 0);
|
|
4162
|
+
}
|
|
4163
|
+
return body;
|
|
3961
4164
|
}
|
|
3962
|
-
function
|
|
3963
|
-
|
|
3964
|
-
|
|
3965
|
-
|
|
3966
|
-
|
|
3967
|
-
|
|
3968
|
-
|
|
4165
|
+
function preview(value) {
|
|
4166
|
+
const input = record$3(value);
|
|
4167
|
+
if (input === void 0 || typeof input.root !== "string" || typeof input.branch !== "string" || typeof input.head !== "string" || typeof input.fingerprint !== "string" || !Array.isArray(input.files) || typeof input.patch !== "string" || typeof input.truncated !== "boolean" || typeof input.hasStaged !== "boolean" || typeof input.hasUnstaged !== "boolean" || typeof input.hasUntracked !== "boolean" || input.upstream !== void 0 && typeof input.upstream !== "string" || !Array.isArray(input.unpushedCommits) || typeof input.unpushedTruncated !== "boolean") throw new Error("Invalid repository action preview.");
|
|
4168
|
+
for (const file of input.files) {
|
|
4169
|
+
const item = record$3(file);
|
|
4170
|
+
if (item === void 0 || typeof item.path !== "string" || typeof item.staged !== "boolean" || typeof item.unstaged !== "boolean" || typeof item.untracked !== "boolean") throw new Error("Invalid repository action file.");
|
|
4171
|
+
}
|
|
4172
|
+
for (const commit of input.unpushedCommits) {
|
|
4173
|
+
const item = record$3(commit);
|
|
4174
|
+
if (item === void 0 || typeof item.hash !== "string" || typeof item.subject !== "string") throw new Error("Invalid repository action commit.");
|
|
4175
|
+
}
|
|
4176
|
+
return input;
|
|
4177
|
+
}
|
|
4178
|
+
function result(value) {
|
|
4179
|
+
const input = record$3(value);
|
|
4180
|
+
if (input === void 0 || typeof input.commit !== "string" || typeof input.pushed !== "boolean" || input.pullRequestUrl !== void 0 && typeof input.pullRequestUrl !== "string" || input.conflicts !== void 0 && (!Array.isArray(input.conflicts) || input.conflicts.some((item) => typeof item !== "string"))) throw new Error("Invalid repository action result.");
|
|
4181
|
+
return input;
|
|
4182
|
+
}
|
|
4183
|
+
function endpoint(path, sessionId) {
|
|
4184
|
+
return `${CLAUDE_REPOSITORY_ACTION_PATH}${path}?sessionId=${encodeURIComponent(sessionId)}`;
|
|
4185
|
+
}
|
|
4186
|
+
async function loadRepositoryActionPreview(sessionId, signal) {
|
|
4187
|
+
return preview(await response$1(fetch(endpoint("/preview", sessionId), {
|
|
4188
|
+
method: "GET",
|
|
4189
|
+
credentials: "same-origin",
|
|
4190
|
+
headers: { accept: "application/json" },
|
|
4191
|
+
...signal === void 0 ? {} : { signal }
|
|
4192
|
+
})));
|
|
4193
|
+
}
|
|
4194
|
+
async function generateCommitMessage(sessionId, fingerprint, signal) {
|
|
4195
|
+
const value = record$3(await response$1(fetch(endpoint("/message", sessionId), {
|
|
4196
|
+
method: "POST",
|
|
4197
|
+
credentials: "same-origin",
|
|
4198
|
+
headers: {
|
|
4199
|
+
accept: "application/json",
|
|
4200
|
+
"content-type": "application/json"
|
|
4201
|
+
},
|
|
4202
|
+
body: JSON.stringify({ fingerprint }),
|
|
4203
|
+
...signal === void 0 ? {} : { signal }
|
|
4204
|
+
})));
|
|
4205
|
+
if (typeof value?.message !== "string") throw new Error("Invalid generated commit message.");
|
|
4206
|
+
return value.message;
|
|
4207
|
+
}
|
|
4208
|
+
function executeRepositoryAction(sessionId, request) {
|
|
4209
|
+
return response$1(fetch(endpoint("", sessionId), {
|
|
4210
|
+
method: "POST",
|
|
4211
|
+
credentials: "same-origin",
|
|
4212
|
+
headers: {
|
|
4213
|
+
accept: "application/json",
|
|
4214
|
+
"content-type": "application/json"
|
|
4215
|
+
},
|
|
4216
|
+
body: JSON.stringify(request)
|
|
4217
|
+
})).then(result);
|
|
4218
|
+
}
|
|
4219
|
+
//#endregion
|
|
4220
|
+
//#region src/client/pr-feedback-api.ts
|
|
4221
|
+
function record$2(value) {
|
|
4222
|
+
return value !== null && typeof value === "object" && !Array.isArray(value) ? value : void 0;
|
|
4223
|
+
}
|
|
4224
|
+
async function loadJson(path, sessionId, pullNumber, signal) {
|
|
4225
|
+
const response = await fetch(`${CLAUDE_REPOSITORY_FEEDBACK_PATH}${path}?sessionId=${encodeURIComponent(sessionId)}&number=${pullNumber}`, {
|
|
4226
|
+
method: "GET",
|
|
4227
|
+
credentials: "same-origin",
|
|
4228
|
+
headers: { accept: "application/json" },
|
|
4229
|
+
...signal === void 0 ? {} : { signal }
|
|
4230
|
+
});
|
|
4231
|
+
const body = record$2(await response.json());
|
|
4232
|
+
if (!response.ok) throw new Error(typeof body?.message === "string" ? body.message : "Pull request feedback is unavailable.");
|
|
4233
|
+
if (body === void 0) throw new Error("Invalid pull request feedback response.");
|
|
4234
|
+
return body;
|
|
4235
|
+
}
|
|
4236
|
+
async function loadPullRequestComments(sessionId, pullNumber, signal) {
|
|
4237
|
+
const body = await loadJson("/comments", sessionId, pullNumber, signal);
|
|
4238
|
+
if (!Array.isArray(body.comments)) throw new Error("Invalid pull request comments response.");
|
|
4239
|
+
const comments = [];
|
|
4240
|
+
for (const item of body.comments) {
|
|
4241
|
+
const input = record$2(item);
|
|
4242
|
+
if (input === void 0 || typeof input.id !== "number" || typeof input.path !== "string" || typeof input.author !== "string" || typeof input.body !== "string" || typeof input.url !== "string" || input.side !== "new" && input.side !== "old" || input.line !== void 0 && typeof input.line !== "number") continue;
|
|
4243
|
+
comments.push(input);
|
|
4244
|
+
}
|
|
4245
|
+
return comments;
|
|
4246
|
+
}
|
|
4247
|
+
async function loadFailingChecks(sessionId, pullNumber, signal) {
|
|
4248
|
+
const body = await loadJson("/checks", sessionId, pullNumber, signal);
|
|
4249
|
+
if (!Array.isArray(body.checks)) throw new Error("Invalid pull request checks response.");
|
|
4250
|
+
const checks = [];
|
|
4251
|
+
for (const item of body.checks) {
|
|
4252
|
+
const input = record$2(item);
|
|
4253
|
+
if (input === void 0 || typeof input.name !== "string" || input.link !== void 0 && typeof input.link !== "string" || input.description !== void 0 && typeof input.description !== "string" || input.log !== void 0 && typeof input.log !== "string") continue;
|
|
4254
|
+
checks.push(input);
|
|
4255
|
+
}
|
|
4256
|
+
return checks;
|
|
4257
|
+
}
|
|
4258
|
+
/** Draft handed to Claude when the user forwards GitHub review comments. */
|
|
4259
|
+
function composeCommentsPrompt(comments) {
|
|
4260
|
+
return `Please address the following GitHub pull request review comments. Make the requested changes, or explain briefly when a comment should not be applied.\n\n${comments.map((comment) => `- ${comment.path}${comment.line === void 0 ? "" : `:${comment.line}`} (@${comment.author}): ${comment.body.replaceAll("\n", "\n ")}`).join("\n")}`;
|
|
4261
|
+
}
|
|
4262
|
+
/** Draft handed to Claude when the user forwards failing CI checks. */
|
|
4263
|
+
function composeChecksPrompt(checks) {
|
|
4264
|
+
return `The following CI checks are failing on the current pull request. Investigate the failure logs, fix the underlying problems, and re-run the relevant commands locally when possible.\n\n${checks.map((check) => {
|
|
4265
|
+
return `${`## ${check.name}${check.link === void 0 ? "" : ` (${check.link})`}`}${check.description === void 0 ? "" : `\n${check.description}`}${check.log === void 0 ? "" : `\n\n\`\`\`\n${check.log}\n\`\`\``}`;
|
|
4266
|
+
}).join("\n\n")}`;
|
|
4267
|
+
}
|
|
4268
|
+
/** Draft handed to Claude after an update-branch merge left conflicts behind. */
|
|
4269
|
+
function composeConflictsPrompt(baseBranch, conflicts) {
|
|
4270
|
+
return `Merging origin/${baseBranch} into the current branch left merge conflicts in the files below. Resolve each conflict preserving the intent of both sides, then commit the merge.\n\n${conflicts.map((file) => `- ${file}`).join("\n")}`;
|
|
4271
|
+
}
|
|
4272
|
+
//#endregion
|
|
4273
|
+
//#region src/client/auto-fix.ts
|
|
4274
|
+
const AUTO_FIX_INTERVAL_MS = 3e4;
|
|
4275
|
+
const AUTO_FIX_FOOTER = "This request was generated automatically by the pull request watcher. After making the changes, commit and push to the pull request branch so the checks re-run.";
|
|
4276
|
+
const EMPTY_MEMORY = { handledCommentIds: /* @__PURE__ */ new Set() };
|
|
4277
|
+
const sessions = /* @__PURE__ */ new Map();
|
|
4278
|
+
function session(sessionId) {
|
|
4279
|
+
let entry = sessions.get(sessionId);
|
|
4280
|
+
if (entry === void 0) {
|
|
4281
|
+
entry = {
|
|
4282
|
+
enabled: false,
|
|
4283
|
+
memory: EMPTY_MEMORY
|
|
4284
|
+
};
|
|
4285
|
+
sessions.set(sessionId, entry);
|
|
4286
|
+
}
|
|
4287
|
+
return entry;
|
|
4288
|
+
}
|
|
4289
|
+
function autoFixEnabled(sessionId) {
|
|
4290
|
+
return session(sessionId).enabled;
|
|
4291
|
+
}
|
|
4292
|
+
function setAutoFixEnabled(sessionId, enabled) {
|
|
4293
|
+
session(sessionId).enabled = enabled;
|
|
4294
|
+
}
|
|
4295
|
+
function autoFixMemory(sessionId) {
|
|
4296
|
+
return session(sessionId).memory;
|
|
4297
|
+
}
|
|
4298
|
+
function rememberAutoFix(sessionId, memory) {
|
|
4299
|
+
session(sessionId).memory = memory;
|
|
4300
|
+
}
|
|
4301
|
+
/** One failing CI run yields one fix attempt: run links change when CI re-runs. */
|
|
4302
|
+
function checksSignature(checks) {
|
|
4303
|
+
if (checks.length === 0) return void 0;
|
|
4304
|
+
return checks.map((check) => `${check.name}|${check.link ?? ""}`).sort().join("\n");
|
|
4305
|
+
}
|
|
4306
|
+
function planAutoFix(memory, comments, checks) {
|
|
4307
|
+
const fresh = comments.filter((comment) => !memory.handledCommentIds.has(comment.id));
|
|
4308
|
+
const signature = checksSignature(checks);
|
|
4309
|
+
const checksChanged = signature !== void 0 && signature !== memory.handledChecksSignature;
|
|
4310
|
+
const sections = [];
|
|
4311
|
+
if (fresh.length > 0) sections.push(composeCommentsPrompt(fresh));
|
|
4312
|
+
if (checksChanged) sections.push(composeChecksPrompt(checks));
|
|
4313
|
+
if (sections.length === 0) return { memory };
|
|
4314
|
+
const nextSignature = checksChanged ? signature : memory.handledChecksSignature;
|
|
4315
|
+
return {
|
|
4316
|
+
prompt: `${sections.join("\n\n")}\n\n${AUTO_FIX_FOOTER}`,
|
|
4317
|
+
memory: {
|
|
4318
|
+
handledCommentIds: /* @__PURE__ */ new Set([...memory.handledCommentIds, ...fresh.map((comment) => comment.id)]),
|
|
4319
|
+
...nextSignature === void 0 ? {} : { handledChecksSignature: nextSignature }
|
|
4320
|
+
}
|
|
4321
|
+
};
|
|
4322
|
+
}
|
|
4323
|
+
//#endregion
|
|
4324
|
+
//#region src/client/ClaudeRepositoryStatus.tsx
|
|
4325
|
+
const RATE_LIMIT_TITLE_PREFIX = "Claude rate limit";
|
|
4326
|
+
const RATE_LIMIT_BLOCKING_TITLE = "Claude rate limit is blocking requests";
|
|
4327
|
+
/** Whether the newest quota update in the activity feed reports a blocked state. */
|
|
4328
|
+
function rateLimitBlocked(activities) {
|
|
4329
|
+
for (let index = activities.length - 1; index >= 0; index -= 1) {
|
|
4330
|
+
const title = activities[index]?.title;
|
|
4331
|
+
if (title?.startsWith(RATE_LIMIT_TITLE_PREFIX) === true) return title === RATE_LIMIT_BLOCKING_TITLE;
|
|
4332
|
+
}
|
|
4333
|
+
return false;
|
|
4334
|
+
}
|
|
4335
|
+
function StatusItem({ label, tone = "neutral" }) {
|
|
4336
|
+
const toneStyle = tone === "success" ? repositoryItemSuccess : tone === "warning" ? repositoryItemWarning : tone === "error" ? repositoryItemError : {};
|
|
4337
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
4338
|
+
style: {
|
|
4339
|
+
...repositoryItem,
|
|
4340
|
+
...toneStyle
|
|
4341
|
+
},
|
|
4342
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
4343
|
+
style: repositoryItemDot,
|
|
4344
|
+
"aria-hidden": "true"
|
|
4345
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
4346
|
+
style: repositoryItemLabel,
|
|
4347
|
+
children: label
|
|
4348
|
+
})]
|
|
4349
|
+
});
|
|
4350
|
+
}
|
|
4351
|
+
function PullRequestIcon({ size = 16, merged = false }) {
|
|
4352
|
+
if (merged) return /* @__PURE__ */ jsxs("svg", {
|
|
4353
|
+
width: size,
|
|
4354
|
+
height: size,
|
|
4355
|
+
viewBox: "0 0 16 16",
|
|
4356
|
+
fill: "none",
|
|
4357
|
+
stroke: "currentColor",
|
|
3969
4358
|
strokeWidth: "1.8",
|
|
3970
4359
|
strokeLinecap: "round",
|
|
3971
4360
|
strokeLinejoin: "round",
|
|
@@ -4060,7 +4449,8 @@ window.__ModuleLoader__.load({
|
|
|
4060
4449
|
children: [
|
|
4061
4450
|
repositoryName(repository.remote),
|
|
4062
4451
|
" #",
|
|
4063
|
-
pullRequest.number
|
|
4452
|
+
pullRequest.number,
|
|
4453
|
+
pullRequest.baseBranch === void 0 ? "" : ` → ${pullRequest.baseBranch}`
|
|
4064
4454
|
]
|
|
4065
4455
|
}),
|
|
4066
4456
|
age === void 0 ? null : /* @__PURE__ */ jsx("span", {
|
|
@@ -4153,8 +4543,532 @@ window.__ModuleLoader__.load({
|
|
|
4153
4543
|
})]
|
|
4154
4544
|
});
|
|
4155
4545
|
}
|
|
4156
|
-
|
|
4546
|
+
/** Watches an open pull request and hands new review comments and failing
|
|
4547
|
+
* CI runs to Claude automatically until the user switches it off. */
|
|
4548
|
+
function AutoFixControl({ sessionId, repository, running, t, submitPrompt }) {
|
|
4549
|
+
const pullRequest = repository.pullRequest;
|
|
4550
|
+
const open = pullRequest?.state === "open";
|
|
4551
|
+
const number = pullRequest?.number;
|
|
4552
|
+
const checks = pullRequest?.checks;
|
|
4553
|
+
const [enabled, setEnabled] = useState(() => autoFixEnabled(sessionId));
|
|
4554
|
+
const [focused, setFocused] = useState(false);
|
|
4555
|
+
useEffect(() => {
|
|
4556
|
+
setEnabled(autoFixEnabled(sessionId));
|
|
4557
|
+
}, [sessionId]);
|
|
4558
|
+
useEffect(() => {
|
|
4559
|
+
if (!enabled || !open || running || number === void 0 || submitPrompt === void 0) return;
|
|
4560
|
+
let cancelled = false;
|
|
4561
|
+
const tick = async () => {
|
|
4562
|
+
const [comments, failing] = await Promise.all([loadPullRequestComments(sessionId, number).catch(() => []), checks === "failing" ? loadFailingChecks(sessionId, number).catch(() => []) : Promise.resolve([])]);
|
|
4563
|
+
if (cancelled) return;
|
|
4564
|
+
const plan = planAutoFix(autoFixMemory(sessionId), comments, failing);
|
|
4565
|
+
if (plan.prompt !== void 0 && submitPrompt(plan.prompt, "idle")) rememberAutoFix(sessionId, plan.memory);
|
|
4566
|
+
};
|
|
4567
|
+
tick();
|
|
4568
|
+
const timer = setInterval(() => {
|
|
4569
|
+
tick();
|
|
4570
|
+
}, AUTO_FIX_INTERVAL_MS);
|
|
4571
|
+
return () => {
|
|
4572
|
+
cancelled = true;
|
|
4573
|
+
clearInterval(timer);
|
|
4574
|
+
};
|
|
4575
|
+
}, [
|
|
4576
|
+
checks,
|
|
4577
|
+
enabled,
|
|
4578
|
+
number,
|
|
4579
|
+
open,
|
|
4580
|
+
running,
|
|
4581
|
+
sessionId,
|
|
4582
|
+
submitPrompt
|
|
4583
|
+
]);
|
|
4584
|
+
if (!open || submitPrompt === void 0) return null;
|
|
4585
|
+
const toggle = () => {
|
|
4586
|
+
const next = !enabled;
|
|
4587
|
+
setEnabled(next);
|
|
4588
|
+
setAutoFixEnabled(sessionId, next);
|
|
4589
|
+
};
|
|
4590
|
+
return /* @__PURE__ */ jsx(Tooltip, {
|
|
4591
|
+
label: `${t("autoFixLabel")} · ${t("autoFixTitle")}`,
|
|
4592
|
+
side: "top",
|
|
4593
|
+
delayMs: 250,
|
|
4594
|
+
maxWidth: 320,
|
|
4595
|
+
children: /* @__PURE__ */ jsx("button", {
|
|
4596
|
+
type: "button",
|
|
4597
|
+
role: "switch",
|
|
4598
|
+
"aria-checked": enabled,
|
|
4599
|
+
"aria-label": t("autoFixLabel"),
|
|
4600
|
+
style: {
|
|
4601
|
+
...repositoryAutoFix,
|
|
4602
|
+
...enabled ? repositoryAutoFixActive : {},
|
|
4603
|
+
...focused ? heroWorktreeToggleFocused : {}
|
|
4604
|
+
},
|
|
4605
|
+
onFocus: () => {
|
|
4606
|
+
setFocused(true);
|
|
4607
|
+
},
|
|
4608
|
+
onBlur: () => {
|
|
4609
|
+
setFocused(false);
|
|
4610
|
+
},
|
|
4611
|
+
onClick: (event) => {
|
|
4612
|
+
toggle();
|
|
4613
|
+
event.currentTarget.blur();
|
|
4614
|
+
},
|
|
4615
|
+
children: /* @__PURE__ */ jsxs("svg", {
|
|
4616
|
+
width: "14",
|
|
4617
|
+
height: "14",
|
|
4618
|
+
viewBox: "0 0 16 16",
|
|
4619
|
+
fill: "none",
|
|
4620
|
+
stroke: "currentColor",
|
|
4621
|
+
strokeWidth: "1.6",
|
|
4622
|
+
strokeLinecap: "round",
|
|
4623
|
+
strokeLinejoin: "round",
|
|
4624
|
+
"aria-hidden": "true",
|
|
4625
|
+
children: [/* @__PURE__ */ jsx("path", { d: "M13.3 6.5A5.5 5.5 0 0 0 3.6 4.6M2.7 9.5a5.5 5.5 0 0 0 9.7 1.9" }), /* @__PURE__ */ jsx("path", { d: "M13.5 2.8v3.7H9.8M2.5 13.2V9.5h3.7" })]
|
|
4626
|
+
})
|
|
4627
|
+
})
|
|
4628
|
+
});
|
|
4629
|
+
}
|
|
4630
|
+
function FailingChecksControl({ sessionId, pullNumber, t, submitPrompt }) {
|
|
4631
|
+
const [open, setOpen] = useState(false);
|
|
4632
|
+
const [loading, setLoading] = useState(false);
|
|
4633
|
+
const [checks, setChecks] = useState([]);
|
|
4634
|
+
const [error, setError] = useState();
|
|
4635
|
+
const frameRef = useRef(null);
|
|
4636
|
+
const controller = useRef();
|
|
4637
|
+
useEffect(() => () => controller.current?.abort(), []);
|
|
4638
|
+
useEffect(() => {
|
|
4639
|
+
if (!open) return;
|
|
4640
|
+
const closeOnOutsidePointer = (event) => {
|
|
4641
|
+
if (event.target instanceof Node && frameRef.current?.contains(event.target) !== true) setOpen(false);
|
|
4642
|
+
};
|
|
4643
|
+
document.addEventListener("pointerdown", closeOnOutsidePointer);
|
|
4644
|
+
return () => {
|
|
4645
|
+
document.removeEventListener("pointerdown", closeOnOutsidePointer);
|
|
4646
|
+
};
|
|
4647
|
+
}, [open]);
|
|
4648
|
+
const toggle = () => {
|
|
4649
|
+
const next = !open;
|
|
4650
|
+
setOpen(next);
|
|
4651
|
+
if (!next) return;
|
|
4652
|
+
controller.current?.abort();
|
|
4653
|
+
const aborter = new AbortController();
|
|
4654
|
+
controller.current = aborter;
|
|
4655
|
+
setLoading(true);
|
|
4656
|
+
setError(void 0);
|
|
4657
|
+
loadFailingChecks(sessionId, pullNumber, aborter.signal).then((value) => {
|
|
4658
|
+
setChecks(value);
|
|
4659
|
+
setLoading(false);
|
|
4660
|
+
}, (reason) => {
|
|
4661
|
+
if (aborter.signal.aborted) return;
|
|
4662
|
+
setError(reason instanceof Error ? reason.message : t("diffActionFailed"));
|
|
4663
|
+
setLoading(false);
|
|
4664
|
+
});
|
|
4665
|
+
};
|
|
4666
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
4667
|
+
ref: frameRef,
|
|
4668
|
+
style: repositoryChecksFrame,
|
|
4669
|
+
children: [/* @__PURE__ */ jsx("button", {
|
|
4670
|
+
type: "button",
|
|
4671
|
+
style: repositoryChecksTrigger,
|
|
4672
|
+
"aria-haspopup": "dialog",
|
|
4673
|
+
"aria-expanded": open,
|
|
4674
|
+
"aria-label": t("repositoryChecksOpen"),
|
|
4675
|
+
onClick: toggle,
|
|
4676
|
+
children: /* @__PURE__ */ jsx(StatusItem, {
|
|
4677
|
+
label: t("repositoryChecks_failing"),
|
|
4678
|
+
tone: "error"
|
|
4679
|
+
})
|
|
4680
|
+
}), open ? /* @__PURE__ */ jsxs("span", {
|
|
4681
|
+
role: "dialog",
|
|
4682
|
+
"aria-label": t("checksCardTitle"),
|
|
4683
|
+
style: repositoryChecksCard,
|
|
4684
|
+
children: [
|
|
4685
|
+
/* @__PURE__ */ jsx("strong", {
|
|
4686
|
+
style: repositoryChecksTitle,
|
|
4687
|
+
children: t("checksCardTitle")
|
|
4688
|
+
}),
|
|
4689
|
+
loading ? /* @__PURE__ */ jsx("span", {
|
|
4690
|
+
style: repositoryChecksHint,
|
|
4691
|
+
children: t("checksCardLoading")
|
|
4692
|
+
}) : null,
|
|
4693
|
+
error === void 0 ? null : /* @__PURE__ */ jsx("span", {
|
|
4694
|
+
role: "alert",
|
|
4695
|
+
style: repositoryChecksError,
|
|
4696
|
+
children: error
|
|
4697
|
+
}),
|
|
4698
|
+
checks.map((check) => /* @__PURE__ */ jsxs("span", {
|
|
4699
|
+
style: repositoryChecksItem,
|
|
4700
|
+
children: [check.link === void 0 ? /* @__PURE__ */ jsx("span", {
|
|
4701
|
+
style: repositoryChecksName,
|
|
4702
|
+
children: check.name
|
|
4703
|
+
}) : /* @__PURE__ */ jsx("a", {
|
|
4704
|
+
href: check.link,
|
|
4705
|
+
target: "_blank",
|
|
4706
|
+
rel: "noopener noreferrer",
|
|
4707
|
+
style: repositoryChecksName,
|
|
4708
|
+
children: check.name
|
|
4709
|
+
}), check.description === void 0 ? null : /* @__PURE__ */ jsx("span", {
|
|
4710
|
+
style: repositoryChecksDesc,
|
|
4711
|
+
children: check.description
|
|
4712
|
+
})]
|
|
4713
|
+
}, check.name)),
|
|
4714
|
+
!loading && error === void 0 && checks.length === 0 ? /* @__PURE__ */ jsx("span", {
|
|
4715
|
+
style: repositoryChecksHint,
|
|
4716
|
+
children: t("checksCardEmpty")
|
|
4717
|
+
}) : null,
|
|
4718
|
+
submitPrompt !== void 0 && checks.length > 0 ? /* @__PURE__ */ jsx("button", {
|
|
4719
|
+
type: "button",
|
|
4720
|
+
style: repositoryChecksFix,
|
|
4721
|
+
onClick: () => {
|
|
4722
|
+
submitPrompt(composeChecksPrompt(checks));
|
|
4723
|
+
setOpen(false);
|
|
4724
|
+
},
|
|
4725
|
+
children: t("checksCardFix")
|
|
4726
|
+
}) : null
|
|
4727
|
+
]
|
|
4728
|
+
}) : null]
|
|
4729
|
+
});
|
|
4730
|
+
}
|
|
4731
|
+
function UpdateBranchControl({ sessionId, repository, t, submitPrompt }) {
|
|
4732
|
+
const [dialog, setDialog] = useState();
|
|
4733
|
+
const controller = useRef();
|
|
4734
|
+
const pullRequest = repository.pullRequest;
|
|
4735
|
+
const base = pullRequest?.baseBranch;
|
|
4736
|
+
const behind = repository.baseBehind ?? 0;
|
|
4737
|
+
useEffect(() => () => controller.current?.abort(), []);
|
|
4738
|
+
useEffect(() => {
|
|
4739
|
+
if (dialog?.pushed === void 0 || dialog.error !== void 0) return;
|
|
4740
|
+
const timer = setTimeout(() => setDialog(void 0), 1200);
|
|
4741
|
+
return () => clearTimeout(timer);
|
|
4742
|
+
}, [dialog?.error, dialog?.pushed]);
|
|
4743
|
+
if (pullRequest === void 0 || pullRequest.state !== "open" || base === void 0 || repository.detached === true || repository.dirty === true || behind <= 0) return null;
|
|
4744
|
+
const openDialog = () => {
|
|
4745
|
+
controller.current?.abort();
|
|
4746
|
+
setDialog({
|
|
4747
|
+
loading: true,
|
|
4748
|
+
submitting: false
|
|
4749
|
+
});
|
|
4750
|
+
const aborter = new AbortController();
|
|
4751
|
+
controller.current = aborter;
|
|
4752
|
+
loadRepositoryActionPreview(sessionId, aborter.signal).then((preview) => {
|
|
4753
|
+
setDialog({
|
|
4754
|
+
loading: false,
|
|
4755
|
+
submitting: false,
|
|
4756
|
+
fingerprint: preview.fingerprint
|
|
4757
|
+
});
|
|
4758
|
+
}, (reason) => {
|
|
4759
|
+
if (!aborter.signal.aborted) setDialog({
|
|
4760
|
+
loading: false,
|
|
4761
|
+
submitting: false,
|
|
4762
|
+
error: reason instanceof Error ? reason.message : t("diffActionFailed")
|
|
4763
|
+
});
|
|
4764
|
+
});
|
|
4765
|
+
};
|
|
4766
|
+
const closeDialog = () => {
|
|
4767
|
+
if (dialog?.submitting === true) return;
|
|
4768
|
+
controller.current?.abort();
|
|
4769
|
+
controller.current = void 0;
|
|
4770
|
+
setDialog(void 0);
|
|
4771
|
+
};
|
|
4772
|
+
const confirmUpdate = () => {
|
|
4773
|
+
if (dialog?.fingerprint === void 0 || dialog.submitting) return;
|
|
4774
|
+
const { error: _error, ...pending } = dialog;
|
|
4775
|
+
setDialog({
|
|
4776
|
+
...pending,
|
|
4777
|
+
submitting: true
|
|
4778
|
+
});
|
|
4779
|
+
executeRepositoryAction(sessionId, {
|
|
4780
|
+
action: "update-branch",
|
|
4781
|
+
fingerprint: dialog.fingerprint,
|
|
4782
|
+
message: "",
|
|
4783
|
+
includeUnstaged: false,
|
|
4784
|
+
baseBranch: base
|
|
4785
|
+
}).then((result) => {
|
|
4786
|
+
setDialog({
|
|
4787
|
+
...pending,
|
|
4788
|
+
submitting: false,
|
|
4789
|
+
...result.conflicts !== void 0 && result.conflicts.length > 0 ? { conflicts: result.conflicts } : { pushed: result.commit }
|
|
4790
|
+
});
|
|
4791
|
+
}, (reason) => {
|
|
4792
|
+
setDialog({
|
|
4793
|
+
...pending,
|
|
4794
|
+
submitting: false,
|
|
4795
|
+
error: reason instanceof Error ? reason.message : t("diffActionFailed")
|
|
4796
|
+
});
|
|
4797
|
+
});
|
|
4798
|
+
};
|
|
4799
|
+
const settled = dialog?.pushed !== void 0 || dialog?.conflicts !== void 0;
|
|
4800
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
4801
|
+
/* @__PURE__ */ jsxs("button", {
|
|
4802
|
+
type: "button",
|
|
4803
|
+
style: repositoryUpdateTrigger,
|
|
4804
|
+
"aria-label": t("repositoryUpdateBranch"),
|
|
4805
|
+
title: `${t("diffUpdateBranchBehind", {
|
|
4806
|
+
base,
|
|
4807
|
+
count: behind
|
|
4808
|
+
})} · ${t("repositoryUpdateBranch")}`,
|
|
4809
|
+
onClick: openDialog,
|
|
4810
|
+
children: ["↓", behind]
|
|
4811
|
+
}),
|
|
4812
|
+
dialog === void 0 ? null : /* @__PURE__ */ jsx("style", {
|
|
4813
|
+
"data-dsh-claude-repository-modal-styles": true,
|
|
4814
|
+
children: diffModalCss
|
|
4815
|
+
}),
|
|
4816
|
+
/* @__PURE__ */ jsx(Modal, {
|
|
4817
|
+
className: "dshClaudeRepositoryActionModal",
|
|
4818
|
+
contentClassName: "dshClaudeRepositoryActionModalContent",
|
|
4819
|
+
open: dialog !== void 0,
|
|
4820
|
+
onClose: closeDialog,
|
|
4821
|
+
title: t("repositoryUpdateBranch"),
|
|
4822
|
+
closeLabel: t("diffCancel"),
|
|
4823
|
+
description: t("diffUpdateBranchDescription", { base }),
|
|
4824
|
+
footer: /* @__PURE__ */ jsxs("div", {
|
|
4825
|
+
style: diffModalFooter,
|
|
4826
|
+
children: [/* @__PURE__ */ jsx("button", {
|
|
4827
|
+
type: "button",
|
|
4828
|
+
style: {
|
|
4829
|
+
...button,
|
|
4830
|
+
...diffModalButton
|
|
4831
|
+
},
|
|
4832
|
+
disabled: dialog?.submitting === true,
|
|
4833
|
+
onClick: closeDialog,
|
|
4834
|
+
children: settled ? t("diffDone") : t("diffCancel")
|
|
4835
|
+
}), !settled ? /* @__PURE__ */ jsx("button", {
|
|
4836
|
+
type: "button",
|
|
4837
|
+
style: {
|
|
4838
|
+
...primaryButton,
|
|
4839
|
+
...diffModalButton
|
|
4840
|
+
},
|
|
4841
|
+
disabled: dialog?.loading === true || dialog?.submitting === true || dialog?.fingerprint === void 0,
|
|
4842
|
+
onClick: confirmUpdate,
|
|
4843
|
+
children: dialog?.submitting === true ? t("diffSubmitting") : t("diffConfirm")
|
|
4844
|
+
}) : null]
|
|
4845
|
+
}),
|
|
4846
|
+
children: dialog === void 0 ? null : /* @__PURE__ */ jsxs("div", {
|
|
4847
|
+
style: diffModalBody,
|
|
4848
|
+
children: [
|
|
4849
|
+
/* @__PURE__ */ jsxs("div", {
|
|
4850
|
+
style: diffModalMeta,
|
|
4851
|
+
children: [/* @__PURE__ */ jsxs("strong", {
|
|
4852
|
+
style: diffModalMetaText,
|
|
4853
|
+
title: pullRequest.title,
|
|
4854
|
+
children: [
|
|
4855
|
+
repository.branch ?? t("repositoryUnknownBranch"),
|
|
4856
|
+
" ← origin/",
|
|
4857
|
+
base
|
|
4858
|
+
]
|
|
4859
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
4860
|
+
style: diffModalFileState,
|
|
4861
|
+
children: t("diffUpdateBranchBehind", {
|
|
4862
|
+
base,
|
|
4863
|
+
count: behind
|
|
4864
|
+
})
|
|
4865
|
+
})]
|
|
4866
|
+
}),
|
|
4867
|
+
dialog.pushed === void 0 ? null : /* @__PURE__ */ jsx("p", {
|
|
4868
|
+
style: diffModalSuccess,
|
|
4869
|
+
children: t("diffUpdateBranchCompleted", { commit: dialog.pushed.slice(0, 8) })
|
|
4870
|
+
}),
|
|
4871
|
+
dialog.conflicts === void 0 ? null : /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
4872
|
+
/* @__PURE__ */ jsx("p", {
|
|
4873
|
+
style: diffModalStatus,
|
|
4874
|
+
children: t("diffUpdateBranchConflicts")
|
|
4875
|
+
}),
|
|
4876
|
+
/* @__PURE__ */ jsx("ul", {
|
|
4877
|
+
style: diffModalConflicts,
|
|
4878
|
+
children: dialog.conflicts.map((file) => /* @__PURE__ */ jsx("li", { children: file }, file))
|
|
4879
|
+
}),
|
|
4880
|
+
submitPrompt === void 0 ? null : /* @__PURE__ */ jsx("button", {
|
|
4881
|
+
type: "button",
|
|
4882
|
+
style: diffModalConflictResolve,
|
|
4883
|
+
onClick: () => {
|
|
4884
|
+
submitPrompt(composeConflictsPrompt(base, dialog.conflicts ?? []));
|
|
4885
|
+
closeDialog();
|
|
4886
|
+
},
|
|
4887
|
+
children: t("diffUpdateBranchResolve")
|
|
4888
|
+
})
|
|
4889
|
+
] }),
|
|
4890
|
+
dialog.error === void 0 ? null : /* @__PURE__ */ jsx("p", {
|
|
4891
|
+
role: "alert",
|
|
4892
|
+
style: diffModalError,
|
|
4893
|
+
children: dialog.error
|
|
4894
|
+
})
|
|
4895
|
+
]
|
|
4896
|
+
})
|
|
4897
|
+
})
|
|
4898
|
+
] });
|
|
4899
|
+
}
|
|
4900
|
+
const MERGE_METHODS = [
|
|
4901
|
+
"merge",
|
|
4902
|
+
"squash",
|
|
4903
|
+
"rebase"
|
|
4904
|
+
];
|
|
4905
|
+
function MergePullRequestControl({ sessionId, repository, t }) {
|
|
4906
|
+
const [menuOpen, setMenuOpen] = useState(false);
|
|
4907
|
+
const [dialog, setDialog] = useState();
|
|
4908
|
+
const controller = useRef();
|
|
4909
|
+
const pullRequest = repository.pullRequest;
|
|
4910
|
+
useEffect(() => () => controller.current?.abort(), []);
|
|
4911
|
+
useEffect(() => {
|
|
4912
|
+
if (dialog?.merged !== true || dialog.error !== void 0) return;
|
|
4913
|
+
const timer = setTimeout(() => setDialog(void 0), 1200);
|
|
4914
|
+
return () => clearTimeout(timer);
|
|
4915
|
+
}, [dialog?.error, dialog?.merged]);
|
|
4916
|
+
if (pullRequest === void 0 || pullRequest.state !== "open" || pullRequest.draft || repository.detached === true) return null;
|
|
4917
|
+
const openMerge = (method) => {
|
|
4918
|
+
controller.current?.abort();
|
|
4919
|
+
setMenuOpen(false);
|
|
4920
|
+
setDialog({
|
|
4921
|
+
method,
|
|
4922
|
+
loading: true,
|
|
4923
|
+
submitting: false
|
|
4924
|
+
});
|
|
4925
|
+
const aborter = new AbortController();
|
|
4926
|
+
controller.current = aborter;
|
|
4927
|
+
loadRepositoryActionPreview(sessionId, aborter.signal).then((preview) => {
|
|
4928
|
+
setDialog({
|
|
4929
|
+
method,
|
|
4930
|
+
loading: false,
|
|
4931
|
+
submitting: false,
|
|
4932
|
+
fingerprint: preview.fingerprint
|
|
4933
|
+
});
|
|
4934
|
+
}, (error) => {
|
|
4935
|
+
if (!aborter.signal.aborted) setDialog({
|
|
4936
|
+
method,
|
|
4937
|
+
loading: false,
|
|
4938
|
+
submitting: false,
|
|
4939
|
+
error: error instanceof Error ? error.message : t("diffActionFailed")
|
|
4940
|
+
});
|
|
4941
|
+
});
|
|
4942
|
+
};
|
|
4943
|
+
const closeDialog = () => {
|
|
4944
|
+
if (dialog?.submitting === true) return;
|
|
4945
|
+
controller.current?.abort();
|
|
4946
|
+
controller.current = void 0;
|
|
4947
|
+
setDialog(void 0);
|
|
4948
|
+
};
|
|
4949
|
+
const confirmMerge = () => {
|
|
4950
|
+
if (dialog?.fingerprint === void 0 || dialog.submitting) return;
|
|
4951
|
+
const { error: _error, ...pending } = dialog;
|
|
4952
|
+
setDialog({
|
|
4953
|
+
...pending,
|
|
4954
|
+
submitting: true
|
|
4955
|
+
});
|
|
4956
|
+
executeRepositoryAction(sessionId, {
|
|
4957
|
+
action: "merge-pr",
|
|
4958
|
+
fingerprint: dialog.fingerprint,
|
|
4959
|
+
message: "",
|
|
4960
|
+
includeUnstaged: false,
|
|
4961
|
+
mergeMethod: dialog.method
|
|
4962
|
+
}).then(() => {
|
|
4963
|
+
setDialog({
|
|
4964
|
+
...pending,
|
|
4965
|
+
submitting: false,
|
|
4966
|
+
merged: true
|
|
4967
|
+
});
|
|
4968
|
+
}, (error) => {
|
|
4969
|
+
setDialog({
|
|
4970
|
+
...pending,
|
|
4971
|
+
submitting: false,
|
|
4972
|
+
error: error instanceof Error ? error.message : t("diffActionFailed")
|
|
4973
|
+
});
|
|
4974
|
+
});
|
|
4975
|
+
};
|
|
4976
|
+
const items = MERGE_METHODS.map((method) => ({
|
|
4977
|
+
id: method,
|
|
4978
|
+
label: t(`diffMerge_${method}`)
|
|
4979
|
+
}));
|
|
4980
|
+
const merged = dialog?.merged === true;
|
|
4981
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
4982
|
+
/* @__PURE__ */ jsx(Menu, {
|
|
4983
|
+
open: menuOpen,
|
|
4984
|
+
items,
|
|
4985
|
+
onSelect: (id) => openMerge(id),
|
|
4986
|
+
onClose: () => setMenuOpen(false),
|
|
4987
|
+
align: "end",
|
|
4988
|
+
portal: true,
|
|
4989
|
+
anchor: /* @__PURE__ */ jsxs("button", {
|
|
4990
|
+
type: "button",
|
|
4991
|
+
style: repositoryMergeTrigger,
|
|
4992
|
+
"aria-label": t("repositoryMergeMenu"),
|
|
4993
|
+
"aria-haspopup": "menu",
|
|
4994
|
+
"aria-expanded": menuOpen,
|
|
4995
|
+
onClick: () => setMenuOpen((value) => !value),
|
|
4996
|
+
children: [t("diffMergePr"), /* @__PURE__ */ jsx(IconChevronDownOutline14, {})]
|
|
4997
|
+
})
|
|
4998
|
+
}),
|
|
4999
|
+
dialog === void 0 ? null : /* @__PURE__ */ jsx("style", {
|
|
5000
|
+
"data-dsh-claude-repository-modal-styles": true,
|
|
5001
|
+
children: diffModalCss
|
|
5002
|
+
}),
|
|
5003
|
+
/* @__PURE__ */ jsx(Modal, {
|
|
5004
|
+
className: "dshClaudeRepositoryActionModal",
|
|
5005
|
+
contentClassName: "dshClaudeRepositoryActionModalContent",
|
|
5006
|
+
open: dialog !== void 0,
|
|
5007
|
+
onClose: closeDialog,
|
|
5008
|
+
title: t("diffMergePr"),
|
|
5009
|
+
closeLabel: t("diffCancel"),
|
|
5010
|
+
description: t("diffMergeDescription"),
|
|
5011
|
+
footer: /* @__PURE__ */ jsxs("div", {
|
|
5012
|
+
style: diffModalFooter,
|
|
5013
|
+
children: [/* @__PURE__ */ jsx("button", {
|
|
5014
|
+
type: "button",
|
|
5015
|
+
style: {
|
|
5016
|
+
...button,
|
|
5017
|
+
...diffModalButton
|
|
5018
|
+
},
|
|
5019
|
+
disabled: dialog?.submitting === true,
|
|
5020
|
+
onClick: closeDialog,
|
|
5021
|
+
children: merged ? t("diffDone") : t("diffCancel")
|
|
5022
|
+
}), !merged ? /* @__PURE__ */ jsx("button", {
|
|
5023
|
+
type: "button",
|
|
5024
|
+
style: {
|
|
5025
|
+
...primaryButton,
|
|
5026
|
+
...diffModalButton
|
|
5027
|
+
},
|
|
5028
|
+
disabled: dialog?.loading === true || dialog?.submitting === true || dialog?.fingerprint === void 0,
|
|
5029
|
+
onClick: confirmMerge,
|
|
5030
|
+
children: dialog?.submitting === true ? t("diffSubmitting") : t("diffConfirm")
|
|
5031
|
+
}) : null]
|
|
5032
|
+
}),
|
|
5033
|
+
children: dialog === void 0 ? null : /* @__PURE__ */ jsxs("div", {
|
|
5034
|
+
style: diffModalBody,
|
|
5035
|
+
children: [
|
|
5036
|
+
/* @__PURE__ */ jsxs("div", {
|
|
5037
|
+
style: diffModalMeta,
|
|
5038
|
+
children: [/* @__PURE__ */ jsxs("strong", {
|
|
5039
|
+
style: diffModalMetaText,
|
|
5040
|
+
title: pullRequest.title,
|
|
5041
|
+
children: [
|
|
5042
|
+
t("repositoryPr", { number: pullRequest.number }),
|
|
5043
|
+
" → ",
|
|
5044
|
+
pullRequest.baseBranch ?? t("diffPrBaseDefault")
|
|
5045
|
+
]
|
|
5046
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
5047
|
+
style: diffModalFileState,
|
|
5048
|
+
children: t(`diffMerge_${dialog.method}`)
|
|
5049
|
+
})]
|
|
5050
|
+
}),
|
|
5051
|
+
/* @__PURE__ */ jsx("p", {
|
|
5052
|
+
style: diffModalStatus,
|
|
5053
|
+
children: pullRequest.title
|
|
5054
|
+
}),
|
|
5055
|
+
merged ? /* @__PURE__ */ jsx("p", {
|
|
5056
|
+
style: diffModalSuccess,
|
|
5057
|
+
children: t("diffMergeCompleted", { number: pullRequest.number })
|
|
5058
|
+
}) : null,
|
|
5059
|
+
dialog.error === void 0 ? null : /* @__PURE__ */ jsx("p", {
|
|
5060
|
+
role: "alert",
|
|
5061
|
+
style: diffModalError,
|
|
5062
|
+
children: dialog.error
|
|
5063
|
+
})
|
|
5064
|
+
]
|
|
5065
|
+
})
|
|
5066
|
+
})
|
|
5067
|
+
] });
|
|
5068
|
+
}
|
|
5069
|
+
function ClaudeRepositoryStatus({ sessionId, useSessions, useClaudeProjection, t, openDiff, submitPrompt }) {
|
|
4157
5070
|
const blank = useSessions((value) => value.byId[sessionId]?.blank === true);
|
|
5071
|
+
const running = useSessions((value) => value.byId[sessionId]?.running === true);
|
|
4158
5072
|
const projection = useClaudeProjection((value) => value);
|
|
4159
5073
|
const repository = projection.repository;
|
|
4160
5074
|
if (blank || !projection.owned || repository === void 0) return null;
|
|
@@ -4250,19 +5164,45 @@ window.__ModuleLoader__.load({
|
|
|
4250
5164
|
style: repositoryMergedDot,
|
|
4251
5165
|
"aria-hidden": "true"
|
|
4252
5166
|
}),
|
|
4253
|
-
t("
|
|
5167
|
+
t("repositoryState_merged"),
|
|
4254
5168
|
mergedAge === void 0 ? null : /* @__PURE__ */ jsxs("span", {
|
|
4255
5169
|
style: repositoryMergedAge,
|
|
4256
5170
|
children: ["· ", t("repositoryMergedAgo", { age: mergedAge })]
|
|
4257
5171
|
})
|
|
4258
5172
|
]
|
|
4259
|
-
}) : /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
4260
|
-
|
|
4261
|
-
|
|
4262
|
-
|
|
4263
|
-
|
|
4264
|
-
|
|
4265
|
-
|
|
5173
|
+
}) : /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
5174
|
+
pullRequest.checks === "failing" ? /* @__PURE__ */ jsx(FailingChecksControl, {
|
|
5175
|
+
sessionId,
|
|
5176
|
+
pullNumber: pullRequest.number,
|
|
5177
|
+
t,
|
|
5178
|
+
...submitPrompt === void 0 ? {} : { submitPrompt }
|
|
5179
|
+
}) : pullRequest.checks === "none" ? null : /* @__PURE__ */ jsx(StatusItem, {
|
|
5180
|
+
label: t(`repositoryChecks_${pullRequest.checks}`),
|
|
5181
|
+
tone: pullRequest.checks === "passing" ? "success" : "warning"
|
|
5182
|
+
}),
|
|
5183
|
+
pullRequest.review === "none" ? null : /* @__PURE__ */ jsx(StatusItem, {
|
|
5184
|
+
label: t(`repositoryReview_${pullRequest.review}`),
|
|
5185
|
+
tone: pullRequest.review === "approved" ? "success" : pullRequest.review === "changes-requested" ? "error" : "neutral"
|
|
5186
|
+
}),
|
|
5187
|
+
/* @__PURE__ */ jsx(AutoFixControl, {
|
|
5188
|
+
sessionId,
|
|
5189
|
+
repository,
|
|
5190
|
+
running,
|
|
5191
|
+
t,
|
|
5192
|
+
...submitPrompt === void 0 ? {} : { submitPrompt }
|
|
5193
|
+
}),
|
|
5194
|
+
/* @__PURE__ */ jsx(UpdateBranchControl, {
|
|
5195
|
+
sessionId,
|
|
5196
|
+
repository,
|
|
5197
|
+
t,
|
|
5198
|
+
...submitPrompt === void 0 ? {} : { submitPrompt }
|
|
5199
|
+
}),
|
|
5200
|
+
/* @__PURE__ */ jsx(MergePullRequestControl, {
|
|
5201
|
+
sessionId,
|
|
5202
|
+
repository,
|
|
5203
|
+
t
|
|
5204
|
+
})
|
|
5205
|
+
] })
|
|
4266
5206
|
]
|
|
4267
5207
|
})
|
|
4268
5208
|
]
|
|
@@ -4271,7 +5211,7 @@ window.__ModuleLoader__.load({
|
|
|
4271
5211
|
}
|
|
4272
5212
|
//#endregion
|
|
4273
5213
|
//#region src/client/review-comment-api.ts
|
|
4274
|
-
function record$
|
|
5214
|
+
function record$1(value) {
|
|
4275
5215
|
return value !== null && typeof value === "object" && !Array.isArray(value) ? value : void 0;
|
|
4276
5216
|
}
|
|
4277
5217
|
async function post(path, sessionId, body) {
|
|
@@ -4286,13 +5226,13 @@ window.__ModuleLoader__.load({
|
|
|
4286
5226
|
});
|
|
4287
5227
|
const value = await response.json();
|
|
4288
5228
|
if (!response.ok) {
|
|
4289
|
-
const error = record$
|
|
5229
|
+
const error = record$1(value);
|
|
4290
5230
|
throw new Error(typeof error?.message === "string" ? error.message : "Review comment request failed.");
|
|
4291
5231
|
}
|
|
4292
5232
|
return value;
|
|
4293
5233
|
}
|
|
4294
5234
|
async function addReviewComment(sessionId, comment) {
|
|
4295
|
-
const created = record$
|
|
5235
|
+
const created = record$1(record$1(await post("", sessionId, comment))?.comment);
|
|
4296
5236
|
if (created === void 0 || typeof created.id !== "string") throw new Error("Invalid review comment response.");
|
|
4297
5237
|
return created;
|
|
4298
5238
|
}
|
|
@@ -4446,84 +5386,6 @@ window.__ModuleLoader__.load({
|
|
|
4446
5386
|
});
|
|
4447
5387
|
}
|
|
4448
5388
|
//#endregion
|
|
4449
|
-
//#region src/client/repository-action-api.ts
|
|
4450
|
-
var RepositoryActionClientError = class extends Error {
|
|
4451
|
-
code;
|
|
4452
|
-
commit;
|
|
4453
|
-
constructor(message, code, commit) {
|
|
4454
|
-
super(message);
|
|
4455
|
-
this.name = "RepositoryActionClientError";
|
|
4456
|
-
if (code !== void 0) this.code = code;
|
|
4457
|
-
if (commit !== void 0) this.commit = commit;
|
|
4458
|
-
}
|
|
4459
|
-
};
|
|
4460
|
-
function record$1(value) {
|
|
4461
|
-
return value !== null && typeof value === "object" && !Array.isArray(value) ? value : void 0;
|
|
4462
|
-
}
|
|
4463
|
-
async function response$1(pending) {
|
|
4464
|
-
const result = await pending;
|
|
4465
|
-
const body = await result.json();
|
|
4466
|
-
if (!result.ok) {
|
|
4467
|
-
const error = record$1(body);
|
|
4468
|
-
throw new RepositoryActionClientError(typeof error?.message === "string" ? error.message : "Repository action failed.", typeof error?.error === "string" ? error.error : void 0, typeof error?.commit === "string" ? error.commit : void 0);
|
|
4469
|
-
}
|
|
4470
|
-
return body;
|
|
4471
|
-
}
|
|
4472
|
-
function preview(value) {
|
|
4473
|
-
const input = record$1(value);
|
|
4474
|
-
if (input === void 0 || typeof input.root !== "string" || typeof input.branch !== "string" || typeof input.head !== "string" || typeof input.fingerprint !== "string" || !Array.isArray(input.files) || typeof input.patch !== "string" || typeof input.truncated !== "boolean" || typeof input.hasStaged !== "boolean" || typeof input.hasUnstaged !== "boolean" || typeof input.hasUntracked !== "boolean" || input.upstream !== void 0 && typeof input.upstream !== "string" || !Array.isArray(input.unpushedCommits) || typeof input.unpushedTruncated !== "boolean") throw new Error("Invalid repository action preview.");
|
|
4475
|
-
for (const file of input.files) {
|
|
4476
|
-
const item = record$1(file);
|
|
4477
|
-
if (item === void 0 || typeof item.path !== "string" || typeof item.staged !== "boolean" || typeof item.unstaged !== "boolean" || typeof item.untracked !== "boolean") throw new Error("Invalid repository action file.");
|
|
4478
|
-
}
|
|
4479
|
-
for (const commit of input.unpushedCommits) {
|
|
4480
|
-
const item = record$1(commit);
|
|
4481
|
-
if (item === void 0 || typeof item.hash !== "string" || typeof item.subject !== "string") throw new Error("Invalid repository action commit.");
|
|
4482
|
-
}
|
|
4483
|
-
return input;
|
|
4484
|
-
}
|
|
4485
|
-
function result(value) {
|
|
4486
|
-
const input = record$1(value);
|
|
4487
|
-
if (input === void 0 || typeof input.commit !== "string" || typeof input.pushed !== "boolean" || input.pullRequestUrl !== void 0 && typeof input.pullRequestUrl !== "string") throw new Error("Invalid repository action result.");
|
|
4488
|
-
return input;
|
|
4489
|
-
}
|
|
4490
|
-
function endpoint(path, sessionId) {
|
|
4491
|
-
return `${CLAUDE_REPOSITORY_ACTION_PATH}${path}?sessionId=${encodeURIComponent(sessionId)}`;
|
|
4492
|
-
}
|
|
4493
|
-
async function loadRepositoryActionPreview(sessionId, signal) {
|
|
4494
|
-
return preview(await response$1(fetch(endpoint("/preview", sessionId), {
|
|
4495
|
-
method: "GET",
|
|
4496
|
-
credentials: "same-origin",
|
|
4497
|
-
headers: { accept: "application/json" },
|
|
4498
|
-
...signal === void 0 ? {} : { signal }
|
|
4499
|
-
})));
|
|
4500
|
-
}
|
|
4501
|
-
async function generateCommitMessage(sessionId, fingerprint, signal) {
|
|
4502
|
-
const value = record$1(await response$1(fetch(endpoint("/message", sessionId), {
|
|
4503
|
-
method: "POST",
|
|
4504
|
-
credentials: "same-origin",
|
|
4505
|
-
headers: {
|
|
4506
|
-
accept: "application/json",
|
|
4507
|
-
"content-type": "application/json"
|
|
4508
|
-
},
|
|
4509
|
-
body: JSON.stringify({ fingerprint }),
|
|
4510
|
-
...signal === void 0 ? {} : { signal }
|
|
4511
|
-
})));
|
|
4512
|
-
if (typeof value?.message !== "string") throw new Error("Invalid generated commit message.");
|
|
4513
|
-
return value.message;
|
|
4514
|
-
}
|
|
4515
|
-
function executeRepositoryAction(sessionId, request) {
|
|
4516
|
-
return response$1(fetch(endpoint("", sessionId), {
|
|
4517
|
-
method: "POST",
|
|
4518
|
-
credentials: "same-origin",
|
|
4519
|
-
headers: {
|
|
4520
|
-
accept: "application/json",
|
|
4521
|
-
"content-type": "application/json"
|
|
4522
|
-
},
|
|
4523
|
-
body: JSON.stringify(request)
|
|
4524
|
-
})).then(result);
|
|
4525
|
-
}
|
|
4526
|
-
//#endregion
|
|
4527
5389
|
//#region src/client/ClaudeDiffPanel.tsx
|
|
4528
5390
|
function pathFromHeader(line) {
|
|
4529
5391
|
return /^diff --git a\/(.+) b\/(.+)$/u.exec(line)?.[2];
|
|
@@ -4643,7 +5505,7 @@ window.__ModuleLoader__.load({
|
|
|
4643
5505
|
]
|
|
4644
5506
|
});
|
|
4645
5507
|
}
|
|
4646
|
-
function DiffFileSection({ file, initiallyOpen, t, comments, editorAnchor, editorNode, onOpenEditor, onRemoveComment }) {
|
|
5508
|
+
function DiffFileSection({ file, initiallyOpen, t, comments, ghComments, editorAnchor, editorNode, onOpenEditor, onRemoveComment }) {
|
|
4647
5509
|
const [open, setOpen] = useState(initiallyOpen);
|
|
4648
5510
|
return /* @__PURE__ */ jsxs("section", {
|
|
4649
5511
|
style: diffFile,
|
|
@@ -4680,6 +5542,7 @@ window.__ModuleLoader__.load({
|
|
|
4680
5542
|
children: numberDiffLines(file.lines).map((entry, index) => {
|
|
4681
5543
|
const anchor = commentAnchorForLine(entry);
|
|
4682
5544
|
const lineComments = anchor === void 0 ? [] : comments.filter((comment) => comment.line === anchor.line && comment.side === anchor.side);
|
|
5545
|
+
const ghLineComments = anchor === void 0 ? [] : ghComments.filter((comment) => comment.line === anchor.line && comment.side === anchor.side);
|
|
4683
5546
|
const editorOpen = anchor !== void 0 && editorAnchor !== void 0 && editorAnchor.line === anchor.line && editorAnchor.side === anchor.side;
|
|
4684
5547
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4685
5548
|
/* @__PURE__ */ jsx(DiffLine, {
|
|
@@ -4703,6 +5566,26 @@ window.__ModuleLoader__.load({
|
|
|
4703
5566
|
children: comment.text
|
|
4704
5567
|
})]
|
|
4705
5568
|
}, comment.id)),
|
|
5569
|
+
ghLineComments.map((comment) => /* @__PURE__ */ jsxs("div", {
|
|
5570
|
+
style: diffCommentBlock,
|
|
5571
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
5572
|
+
style: diffCommentCardMeta,
|
|
5573
|
+
children: [/* @__PURE__ */ jsxs("span", {
|
|
5574
|
+
style: diffGhCommentAuthor,
|
|
5575
|
+
children: ["GitHub · @", comment.author]
|
|
5576
|
+
}), /* @__PURE__ */ jsx("a", {
|
|
5577
|
+
href: comment.url,
|
|
5578
|
+
target: "_blank",
|
|
5579
|
+
rel: "noopener noreferrer",
|
|
5580
|
+
style: diffGhCommentLink,
|
|
5581
|
+
"aria-label": comment.url,
|
|
5582
|
+
children: "↗"
|
|
5583
|
+
})]
|
|
5584
|
+
}), /* @__PURE__ */ jsx("p", {
|
|
5585
|
+
style: diffCommentCardText,
|
|
5586
|
+
children: comment.body
|
|
5587
|
+
})]
|
|
5588
|
+
}, `gh-${comment.id}`)),
|
|
4706
5589
|
editorOpen ? editorNode : null
|
|
4707
5590
|
] }, `${index}:${entry.line}`);
|
|
4708
5591
|
})
|
|
@@ -4710,7 +5593,7 @@ window.__ModuleLoader__.load({
|
|
|
4710
5593
|
});
|
|
4711
5594
|
}
|
|
4712
5595
|
function actionLabel(action, t) {
|
|
4713
|
-
return (action === "commit" ? t("diffCommit") : action === "commit-push" ? t("diffCommitPush") : action === "push" ? t("diffPush") : t("diffCreatePr")).replace(/[….]+$/u, "");
|
|
5596
|
+
return (action === "commit" ? t("diffCommit") : action === "commit-push" ? t("diffCommitPush") : action === "push" ? t("diffPush") : action === "merge-pr" ? t("diffMergePr") : action === "update-branch" ? t("diffUpdateBranch") : t("diffCreatePr")).replace(/[….]+$/u, "");
|
|
4714
5597
|
}
|
|
4715
5598
|
function repositoryActionAvailability(repository) {
|
|
4716
5599
|
const ready = repository?.status === "ready" && repository.detached !== true;
|
|
@@ -4722,7 +5605,9 @@ window.__ModuleLoader__.load({
|
|
|
4722
5605
|
"commit": committable,
|
|
4723
5606
|
"commit-push": committable && hasRemote,
|
|
4724
5607
|
"push": pushable,
|
|
4725
|
-
"create-pr": (committable || pushable) && hasRemote && !hasOpenPullRequest
|
|
5608
|
+
"create-pr": (committable || pushable) && hasRemote && !hasOpenPullRequest,
|
|
5609
|
+
"merge-pr": ready && hasOpenPullRequest && repository?.pullRequest?.draft !== true,
|
|
5610
|
+
"update-branch": ready && hasOpenPullRequest && repository?.dirty !== true && (repository?.baseBehind ?? 0) > 0
|
|
4726
5611
|
};
|
|
4727
5612
|
}
|
|
4728
5613
|
function RestorePanelIcon() {
|
|
@@ -4735,7 +5620,7 @@ window.__ModuleLoader__.load({
|
|
|
4735
5620
|
children: /* @__PURE__ */ jsx("path", { d: "M1.5 5h3V2h1.4v4.4H1.5V5Zm9.9-3h1.4v3h3v1.4h-4.4V2ZM1.5 9.6h4.4V14H4.5v-3h-3V9.6Zm9.9 0h4.4V11h-3v3h-1.4V9.6Z" })
|
|
4736
5621
|
});
|
|
4737
5622
|
}
|
|
4738
|
-
function ClaudeDiffPanel({ useClaudeProjection, t, sessionId, maximized, closeDetails, toggleMaximized }) {
|
|
5623
|
+
function ClaudeDiffPanel({ useClaudeProjection, t, sessionId, maximized, closeDetails, toggleMaximized, submitPrompt }) {
|
|
4739
5624
|
const projection = useClaudeProjection((value) => value);
|
|
4740
5625
|
const repository = projection.repository;
|
|
4741
5626
|
const diff = repository?.diff;
|
|
@@ -4755,6 +5640,17 @@ window.__ModuleLoader__.load({
|
|
|
4755
5640
|
const [localComments, setLocalComments] = useState([]);
|
|
4756
5641
|
const [removedCommentIds, setRemovedCommentIds] = useState(() => /* @__PURE__ */ new Set());
|
|
4757
5642
|
const actionController = useRef();
|
|
5643
|
+
const [ghComments, setGhComments] = useState([]);
|
|
5644
|
+
const pullNumber = repository?.pullRequest?.state === "open" ? repository.pullRequest.number : void 0;
|
|
5645
|
+
useEffect(() => {
|
|
5646
|
+
setGhComments([]);
|
|
5647
|
+
if (pullNumber === void 0) return;
|
|
5648
|
+
const controller = new AbortController();
|
|
5649
|
+
loadPullRequestComments(sessionId, pullNumber, controller.signal).then(setGhComments, () => void 0);
|
|
5650
|
+
return () => {
|
|
5651
|
+
controller.abort();
|
|
5652
|
+
};
|
|
5653
|
+
}, [pullNumber, sessionId]);
|
|
4758
5654
|
const diffViewportObserver = useRef();
|
|
4759
5655
|
const diffBodyRef = useCallback((element) => {
|
|
4760
5656
|
diffViewportObserver.current?.disconnect();
|
|
@@ -5048,7 +5944,10 @@ window.__ModuleLoader__.load({
|
|
|
5048
5944
|
"aria-hidden": "true",
|
|
5049
5945
|
children: "›"
|
|
5050
5946
|
}),
|
|
5051
|
-
/* @__PURE__ */ jsx("span", {
|
|
5947
|
+
/* @__PURE__ */ jsx("span", {
|
|
5948
|
+
style: diffHeaderLabel,
|
|
5949
|
+
children: t("diffWorkingTree")
|
|
5950
|
+
})
|
|
5052
5951
|
]
|
|
5053
5952
|
}), /* @__PURE__ */ jsxs("div", {
|
|
5054
5953
|
style: diffHeaderActions,
|
|
@@ -5087,6 +5986,25 @@ window.__ModuleLoader__.load({
|
|
|
5087
5986
|
})
|
|
5088
5987
|
})]
|
|
5089
5988
|
}),
|
|
5989
|
+
ghComments.length > 0 && submitPrompt !== void 0 ? /* @__PURE__ */ jsxs("button", {
|
|
5990
|
+
type: "button",
|
|
5991
|
+
style: diffPrCommentsButton,
|
|
5992
|
+
title: t("prCommentsSend"),
|
|
5993
|
+
"aria-label": t("prCommentsButton", { count: ghComments.length }),
|
|
5994
|
+
onClick: () => submitPrompt(composeCommentsPrompt(ghComments)),
|
|
5995
|
+
children: [/* @__PURE__ */ jsx("svg", {
|
|
5996
|
+
width: "14",
|
|
5997
|
+
height: "14",
|
|
5998
|
+
viewBox: "0 0 16 16",
|
|
5999
|
+
fill: "none",
|
|
6000
|
+
stroke: "currentColor",
|
|
6001
|
+
strokeWidth: "1.5",
|
|
6002
|
+
strokeLinecap: "round",
|
|
6003
|
+
strokeLinejoin: "round",
|
|
6004
|
+
"aria-hidden": "true",
|
|
6005
|
+
children: /* @__PURE__ */ jsx("path", { d: "M2.75 2.75h10.5a1 1 0 0 1 1 1v6.5a1 1 0 0 1-1 1H8.2l-3.2 2.9v-2.9H2.75a1 1 0 0 1-1-1v-6.5a1 1 0 0 1 1-1Z" })
|
|
6006
|
+
}), ghComments.length]
|
|
6007
|
+
}) : null,
|
|
5090
6008
|
/* @__PURE__ */ jsx("button", {
|
|
5091
6009
|
type: "button",
|
|
5092
6010
|
className: panelIconButtonClass,
|
|
@@ -5132,6 +6050,7 @@ window.__ModuleLoader__.load({
|
|
|
5132
6050
|
initiallyOpen: index === 0,
|
|
5133
6051
|
t,
|
|
5134
6052
|
comments: reviewComments.filter((comment) => comment.path === file.path),
|
|
6053
|
+
ghComments: ghComments.filter((comment) => comment.path === file.path),
|
|
5135
6054
|
editorAnchor: commentEditor !== void 0 && commentEditor.path === file.path ? commentEditor : void 0,
|
|
5136
6055
|
editorNode: commentEditorNode,
|
|
5137
6056
|
onOpenEditor: (anchor) => openCommentEditor(file.path, anchor),
|
|
@@ -6282,6 +7201,9 @@ window.__ModuleLoader__.load({
|
|
|
6282
7201
|
outputStyle: "Output Style",
|
|
6283
7202
|
worktreeBranchPrefix: "Worktree 分支前缀",
|
|
6284
7203
|
worktreeBranchPrefixEffect: "分支前缀修改会应用于之后自动创建的 Worktree 分支;显式指定的完整分支名不会被修改。",
|
|
7204
|
+
maxProcessesSetting: "Claude 进程上限",
|
|
7205
|
+
idleTimeoutSetting: "闲置回收时长(分钟)",
|
|
7206
|
+
limitsSettingEffect: "进程上限在下次启动 Claude 进程时生效;闲置回收时长在下一次回合结束后生效。留空或非法值会被拒绝。",
|
|
6285
7207
|
pluginUpdate: "插件更新",
|
|
6286
7208
|
pluginUpdateBody: "检查 npm 上的新版本。只有可唯一识别的 npm 安装才能直接更新;本地开发链接不会被替换。",
|
|
6287
7209
|
updateNotChecked: "尚未检查更新。",
|
|
@@ -6375,7 +7297,6 @@ window.__ModuleLoader__.load({
|
|
|
6375
7297
|
repositoryState_open: "开放",
|
|
6376
7298
|
repositoryState_closed: "已关闭",
|
|
6377
7299
|
repositoryState_merged: "已合并",
|
|
6378
|
-
repositoryMergedInto: "已合并到 {branch}",
|
|
6379
7300
|
repositoryMergedAgo: "{age}前",
|
|
6380
7301
|
repositoryChecks: "检查",
|
|
6381
7302
|
repositoryChecks_passing: "检查通过",
|
|
@@ -6429,6 +7350,29 @@ window.__ModuleLoader__.load({
|
|
|
6429
7350
|
diffCommitCompleted: "已创建 commit {commit}",
|
|
6430
7351
|
diffCommitPreserved: "本地 commit {commit} 已保留。",
|
|
6431
7352
|
diffOpenPr: "打开 Pull Request",
|
|
7353
|
+
diffMergePr: "Merge",
|
|
7354
|
+
repositoryMergeMenu: "打开 PR 合并选项",
|
|
7355
|
+
diffMerge_merge: "合并提交 (merge)",
|
|
7356
|
+
diffMerge_squash: "Squash 合并",
|
|
7357
|
+
diffMerge_rebase: "Rebase 合并",
|
|
7358
|
+
diffMergeDescription: "使用所选方式合并当前分支的 Pull Request。",
|
|
7359
|
+
diffMergeCompleted: "已合并 PR #{number}",
|
|
7360
|
+
diffUpdateBranch: "Update branch…",
|
|
7361
|
+
repositoryUpdateBranch: "Update branch",
|
|
7362
|
+
diffUpdateBranchDescription: "将 origin/{base} 合并进当前分支并推送;出现冲突时可交给 Claude 解决。",
|
|
7363
|
+
diffUpdateBranchBehind: "落后 origin/{base} {count} 个 commit",
|
|
7364
|
+
diffUpdateBranchCompleted: "已合并并推送 commit {commit}",
|
|
7365
|
+
diffUpdateBranchConflicts: "合并产生冲突,以下文件需要解决:",
|
|
7366
|
+
diffUpdateBranchResolve: "让 Claude 解决冲突",
|
|
7367
|
+
repositoryChecksOpen: "查看失败的检查",
|
|
7368
|
+
checksCardTitle: "失败的检查",
|
|
7369
|
+
checksCardLoading: "正在读取检查详情…",
|
|
7370
|
+
checksCardEmpty: "未能读取失败详情",
|
|
7371
|
+
checksCardFix: "让 Claude 修复",
|
|
7372
|
+
prCommentsButton: "GitHub 评论 ({count})",
|
|
7373
|
+
prCommentsSend: "让 Claude 处理 GitHub 上的 PR 评论",
|
|
7374
|
+
autoFixLabel: "Auto fix",
|
|
7375
|
+
autoFixTitle: "自动监听这个 PR 的 review 评论与 CI 失败,交给 Claude 修复并推送,直到全部通过;取消勾选即停止。",
|
|
6432
7376
|
reviewCommentAdd: "添加行评论",
|
|
6433
7377
|
reviewCommentPlaceholder: "请求更改",
|
|
6434
7378
|
reviewCommentSubmit: "注释",
|
|
@@ -6484,6 +7428,9 @@ window.__ModuleLoader__.load({
|
|
|
6484
7428
|
outputStyle: "Output Style",
|
|
6485
7429
|
worktreeBranchPrefix: "Worktree branch prefix",
|
|
6486
7430
|
worktreeBranchPrefixEffect: "Prefix changes apply to subsequently generated Worktree branches. Explicit full branch names remain unchanged.",
|
|
7431
|
+
maxProcessesSetting: "Claude process limit",
|
|
7432
|
+
idleTimeoutSetting: "Idle timeout (minutes)",
|
|
7433
|
+
limitsSettingEffect: "The process limit applies when the next Claude process is admitted; the idle timeout applies after the next completed turn.",
|
|
6487
7434
|
pluginUpdate: "Plugin updates",
|
|
6488
7435
|
pluginUpdateBody: "Check npm for new releases. Only a uniquely identified npm installation can update in place; local development links are never replaced.",
|
|
6489
7436
|
updateNotChecked: "Updates have not been checked yet.",
|
|
@@ -6577,7 +7524,6 @@ window.__ModuleLoader__.load({
|
|
|
6577
7524
|
repositoryState_open: "Open",
|
|
6578
7525
|
repositoryState_closed: "Closed",
|
|
6579
7526
|
repositoryState_merged: "Merged",
|
|
6580
|
-
repositoryMergedInto: "Merged into {branch}",
|
|
6581
7527
|
repositoryMergedAgo: "{age} ago",
|
|
6582
7528
|
repositoryChecks: "Checks",
|
|
6583
7529
|
repositoryChecks_passing: "Checks passing",
|
|
@@ -6631,6 +7577,29 @@ window.__ModuleLoader__.load({
|
|
|
6631
7577
|
diffCommitCompleted: "Created commit {commit}",
|
|
6632
7578
|
diffCommitPreserved: "Local commit {commit} was preserved.",
|
|
6633
7579
|
diffOpenPr: "Open pull request",
|
|
7580
|
+
diffMergePr: "Merge",
|
|
7581
|
+
repositoryMergeMenu: "Open merge options",
|
|
7582
|
+
diffMerge_merge: "Create a merge commit",
|
|
7583
|
+
diffMerge_squash: "Squash and merge",
|
|
7584
|
+
diffMerge_rebase: "Rebase and merge",
|
|
7585
|
+
diffMergeDescription: "Merge the pull request for this branch with the selected method.",
|
|
7586
|
+
diffMergeCompleted: "Merged PR #{number}",
|
|
7587
|
+
diffUpdateBranch: "Update branch…",
|
|
7588
|
+
repositoryUpdateBranch: "Update branch",
|
|
7589
|
+
diffUpdateBranchDescription: "Merge origin/{base} into the current branch and push; hand any conflicts to Claude.",
|
|
7590
|
+
diffUpdateBranchBehind: "{count} commit(s) behind origin/{base}",
|
|
7591
|
+
diffUpdateBranchCompleted: "Merged and pushed commit {commit}",
|
|
7592
|
+
diffUpdateBranchConflicts: "The merge left conflicts in these files:",
|
|
7593
|
+
diffUpdateBranchResolve: "Have Claude resolve the conflicts",
|
|
7594
|
+
repositoryChecksOpen: "Show failing checks",
|
|
7595
|
+
checksCardTitle: "Failing checks",
|
|
7596
|
+
checksCardLoading: "Loading check details…",
|
|
7597
|
+
checksCardEmpty: "No failure details available",
|
|
7598
|
+
checksCardFix: "Have Claude fix these",
|
|
7599
|
+
prCommentsButton: "GitHub comments ({count})",
|
|
7600
|
+
prCommentsSend: "Have Claude address the GitHub pull request comments",
|
|
7601
|
+
autoFixLabel: "Auto fix",
|
|
7602
|
+
autoFixTitle: "Watch this pull request for review comments and failing checks, hand them to Claude to fix and push until everything passes; uncheck to stop.",
|
|
6634
7603
|
reviewCommentAdd: "Add line comment",
|
|
6635
7604
|
reviewCommentPlaceholder: "Request changes",
|
|
6636
7605
|
reviewCommentSubmit: "Comment",
|
|
@@ -6645,7 +7614,7 @@ window.__ModuleLoader__.load({
|
|
|
6645
7614
|
};
|
|
6646
7615
|
//#endregion
|
|
6647
7616
|
//#region src/client/index.tsx
|
|
6648
|
-
function MaximizedDiff({ source, t, sessionId, closeDetails, restore }) {
|
|
7617
|
+
function MaximizedDiff({ source, t, sessionId, closeDetails, restore, submitPrompt }) {
|
|
6649
7618
|
const snapshot = useSyncExternalStore(source.subscribe, source.getSnapshot, source.getSnapshot);
|
|
6650
7619
|
const useClaudeProjection = (selector) => selector(snapshot);
|
|
6651
7620
|
return /* @__PURE__ */ jsx(ClaudeDiffOverlay, {
|
|
@@ -6656,7 +7625,8 @@ window.__ModuleLoader__.load({
|
|
|
6656
7625
|
sessionId,
|
|
6657
7626
|
maximized: true,
|
|
6658
7627
|
closeDetails,
|
|
6659
|
-
toggleMaximized: restore
|
|
7628
|
+
toggleMaximized: restore,
|
|
7629
|
+
...submitPrompt === void 0 ? {} : { submitPrompt }
|
|
6660
7630
|
})
|
|
6661
7631
|
});
|
|
6662
7632
|
}
|
|
@@ -6684,6 +7654,23 @@ window.__ModuleLoader__.load({
|
|
|
6684
7654
|
const workspaces = ctx.get("workspaces");
|
|
6685
7655
|
const conversation = ctx.get("conversation");
|
|
6686
7656
|
const connection = ctx.get("connection");
|
|
7657
|
+
/** Composer submit hook shared by the repository feedback affordances.
|
|
7658
|
+
* 'append' keeps any user draft and adds the prompt below it; 'idle'
|
|
7659
|
+
* submits only when the composer is empty and reports false otherwise. */
|
|
7660
|
+
const submitPromptFor = (sessionId) => {
|
|
7661
|
+
if (sessions === void 0 || conversation === void 0) return void 0;
|
|
7662
|
+
return (draft, mode = "append") => {
|
|
7663
|
+
const scope = sessions.scope(sessionId);
|
|
7664
|
+
if (scope === void 0) return false;
|
|
7665
|
+
const input = conversation.input.for(scope);
|
|
7666
|
+
const current = input.state.getSnapshot().draft;
|
|
7667
|
+
if (current.trim() === "") input.setDraft(draft);
|
|
7668
|
+
else if (mode === "append") input.setDraft(`${current}\n\n${draft}`);
|
|
7669
|
+
else return false;
|
|
7670
|
+
input.submit();
|
|
7671
|
+
return true;
|
|
7672
|
+
};
|
|
7673
|
+
};
|
|
6687
7674
|
if (sessions !== void 0) ctx.effect(() => sessions.provide({
|
|
6688
7675
|
hooks: ["claudeProjection"],
|
|
6689
7676
|
resolve: (binding) => ({ hooks: { claudeProjection: projections.source(binding.sessionId) } })
|
|
@@ -6746,6 +7733,7 @@ window.__ModuleLoader__.load({
|
|
|
6746
7733
|
const openDiffPanel = (sessionId) => {
|
|
6747
7734
|
closePluginDetails();
|
|
6748
7735
|
detailsSessionId = sessionId;
|
|
7736
|
+
const submitPrompt = submitPromptFor(sessionId);
|
|
6749
7737
|
const registerDetails = () => {
|
|
6750
7738
|
try {
|
|
6751
7739
|
disposePluginDetails = ctx.slots.register({
|
|
@@ -6757,7 +7745,8 @@ window.__ModuleLoader__.load({
|
|
|
6757
7745
|
sessionId,
|
|
6758
7746
|
maximized: false,
|
|
6759
7747
|
closeDetails: closePluginDetails,
|
|
6760
|
-
toggleMaximized: maximizeDiff
|
|
7748
|
+
toggleMaximized: maximizeDiff,
|
|
7749
|
+
...submitPrompt === void 0 ? {} : { submitPrompt }
|
|
6761
7750
|
})
|
|
6762
7751
|
}, ClaudeDiffPanel);
|
|
6763
7752
|
} catch {
|
|
@@ -6785,7 +7774,8 @@ window.__ModuleLoader__.load({
|
|
|
6785
7774
|
t,
|
|
6786
7775
|
sessionId,
|
|
6787
7776
|
closeDetails: closePluginDetails,
|
|
6788
|
-
restore: restoreDiff
|
|
7777
|
+
restore: restoreDiff,
|
|
7778
|
+
...submitPrompt === void 0 ? {} : { submitPrompt }
|
|
6789
7779
|
}));
|
|
6790
7780
|
} catch {
|
|
6791
7781
|
disposeDiffOverlay = void 0;
|
|
@@ -6850,10 +7840,14 @@ window.__ModuleLoader__.load({
|
|
|
6850
7840
|
id: "claude-repository-status",
|
|
6851
7841
|
order: 20.5,
|
|
6852
7842
|
locale: namespace,
|
|
6853
|
-
inject: (sessionId) =>
|
|
6854
|
-
|
|
6855
|
-
|
|
6856
|
-
|
|
7843
|
+
inject: (sessionId) => {
|
|
7844
|
+
const submitPrompt = submitPromptFor(sessionId);
|
|
7845
|
+
return {
|
|
7846
|
+
t,
|
|
7847
|
+
openDiff: () => openDiffPanel(sessionId),
|
|
7848
|
+
...submitPrompt === void 0 ? {} : { submitPrompt }
|
|
7849
|
+
};
|
|
7850
|
+
}
|
|
6857
7851
|
}, ClaudeRepositoryStatus));
|
|
6858
7852
|
if (sessions !== void 0 && workspaces !== void 0 && conversation !== void 0 && connection !== void 0) ctx.slots.inject("conversation.input.dock", () => ctx.slots.register({
|
|
6859
7853
|
name: "conversation.input.dock",
|