@moberg_hr/work-tree 2.0.12 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{answer-IL5AQHRO.js → answer-EGNJ2KYK.js} +4 -4
- package/dist/{attach-M2UXWUMO.js → attach-64ILZMTD.js} +8 -8
- package/dist/bin.js +2 -2
- package/dist/{block-OXGEQ2PZ.js → block-H74FYSLK.js} +5 -5
- package/dist/{broadcast-UJURJNEK.js → broadcast-WRHZWOQN.js} +2 -2
- package/dist/{catchup-HN4VL5XK.js → catchup-7QBOC5JJ.js} +7 -7
- package/dist/{chunk-EU3BS5A6.js → chunk-2LIVAJLK.js} +3 -3
- package/dist/{chunk-HBCL77AR.js → chunk-2QZ3RZOY.js} +4 -4
- package/dist/{chunk-PUYXTZ32.js → chunk-37I2GFXK.js} +3 -3
- package/dist/{chunk-SH7NSDRW.js → chunk-3D7MELCW.js} +2 -2
- package/dist/{chunk-3XY76XBD.js → chunk-3NPEMTQT.js} +2 -2
- package/dist/{chunk-427RB7E4.js → chunk-4Y35ABCO.js} +2 -2
- package/dist/{chunk-GWJVU4AS.js → chunk-6DWPIK7D.js} +4 -4
- package/dist/{chunk-ZFPV46FA.js → chunk-6OG3W3PY.js} +21 -12
- package/dist/chunk-6OG3W3PY.js.map +1 -0
- package/dist/{chunk-OQAQMCHF.js → chunk-723C3D5X.js} +1 -1
- package/dist/chunk-723C3D5X.js.map +1 -0
- package/dist/{chunk-R7B46WXN.js → chunk-A3M5WTVC.js} +3 -3
- package/dist/{chunk-YZLNJQAV.js → chunk-ATBH7QW3.js} +2 -2
- package/dist/{chunk-YXQIGBL6.js → chunk-DXAIGNWF.js} +2 -2
- package/dist/{chunk-TZWXQ4YZ.js → chunk-DXHZWRVE.js} +10 -10
- package/dist/{chunk-5LZZ73MS.js → chunk-HY566NNR.js} +44 -43
- package/dist/chunk-HY566NNR.js.map +1 -0
- package/dist/{chunk-UAAH334K.js → chunk-KFSLF65S.js} +37 -6
- package/dist/chunk-KFSLF65S.js.map +1 -0
- package/dist/{chunk-PVN5IGDZ.js → chunk-LCSWFGIM.js} +2 -2
- package/dist/{chunk-ACXPSQJR.js → chunk-MI3PS2SH.js} +18 -1
- package/dist/{chunk-ACXPSQJR.js.map → chunk-MI3PS2SH.js.map} +1 -1
- package/dist/{chunk-MVU7JAKG.js → chunk-MLTMXVLD.js} +2 -2
- package/dist/{chunk-TVMZ4NYY.js → chunk-MXIFBNCV.js} +5 -5
- package/dist/{chunk-RLR66XLG.js → chunk-NPVMYGT7.js} +2 -2
- package/dist/{chunk-M7AUWYOP.js → chunk-OND6YRWZ.js} +4 -4
- package/dist/{chunk-HDO3PXCU.js → chunk-ONEXQW7Q.js} +3 -3
- package/dist/{chunk-6O6765M7.js → chunk-POTGMLPV.js} +2 -2
- package/dist/{chunk-OW46TR4G.js → chunk-PYOSW6X5.js} +3 -3
- package/dist/{chunk-YJVZ5H3I.js → chunk-QXDBVVSC.js} +2 -2
- package/dist/{chunk-7UU5LPDM.js → chunk-S45H7N6X.js} +5 -5
- package/dist/{chunk-B2RCWZUW.js → chunk-SSVVCHJB.js} +35 -7
- package/dist/chunk-SSVVCHJB.js.map +1 -0
- package/dist/chunk-TNJF7T33.js +17 -0
- package/dist/chunk-TNJF7T33.js.map +1 -0
- package/dist/{chunk-SRIYY5HL.js → chunk-U4UB4LG6.js} +2 -2
- package/dist/chunk-UIZEMKED.js +9 -0
- package/dist/{chunk-4U52S7AZ.js.map → chunk-UIZEMKED.js.map} +1 -1
- package/dist/{chunk-HBXDIRM4.js → chunk-XILMZRNS.js} +3 -3
- package/dist/{chunk-MIIJ2HQS.js → chunk-YEEDWV4H.js} +3 -3
- package/dist/{cleanup-MHPHSM5I.js → cleanup-YSVZAGJF.js} +15 -15
- package/dist/{cli-QF7GRSWT.js → cli-XT4AS3M2.js} +3 -3
- package/dist/{config-SSWYCX4C.js → config-GQRUETZ6.js} +2 -2
- package/dist/{diff-JBCBQM4I.js → diff-L3TWGBA4.js} +4 -4
- package/dist/{digest-WCZD6N7M.js → digest-R52JZ3AK.js} +4 -4
- package/dist/{fork-CISFOOAQ.js → fork-MCPMOGS5.js} +14 -14
- package/dist/{hook-CA5X3VKU.js → hook-S64C4G2C.js} +4 -4
- package/dist/{hydrate-Q4FWUQRC.js → hydrate-G5AMKHRD.js} +2 -2
- package/dist/{init-AT3BQLXM.js → init-PCZCSRZI.js} +3 -3
- package/dist/{move-CE5NIZKL.js → move-MMGOA7MV.js} +5 -5
- package/dist/{note-JOR53JP4.js → note-WVKK65IH.js} +4 -4
- package/dist/{overlaps-GXSEH2LG.js → overlaps-REVVBZCX.js} +4 -4
- package/dist/{pin-DAWKCVB2.js → pin-NRSD2ZT7.js} +4 -4
- package/dist/{pr-RKOVRSHC.js → pr-JYOI7LCK.js} +3 -3
- package/dist/{prune-DS73W7LT.js → prune-AGZ24MPD.js} +14 -14
- package/dist/{pty-host-5Z3GYXTW.js → pty-host-AZ2ORVV2.js} +116 -15
- package/dist/pty-host-AZ2ORVV2.js.map +1 -0
- package/dist/{read-IKDSIDJD.js → read-A7LFAPPZ.js} +4 -4
- package/dist/{recent-2LM44HN2.js → recent-H2LD5JOK.js} +2 -2
- package/dist/{remove-DEDH57GP.js → remove-3HQTJQWN.js} +13 -13
- package/dist/restart-BTUO4DTI.js +70 -0
- package/dist/restart-BTUO4DTI.js.map +1 -0
- package/dist/{resume-VA34T7ZR.js → resume-I7GXT2II.js} +2 -2
- package/dist/{run-E2WZPHHK.js → run-TE2AFYA6.js} +2 -2
- package/dist/{screen-KUXSDDLB.js → screen-XZPDSK65.js} +4 -4
- package/dist/{search-FJUZPI3P.js → search-MGTME3CE.js} +2 -2
- package/dist/{section-QLUIAYAV.js → section-YVBDU5MO.js} +4 -4
- package/dist/{send-V6LL6YR6.js → send-WKIX3AT5.js} +5 -5
- package/dist/{sessions-AGFO7W5U.js → sessions-2OWYXO55.js} +11 -11
- package/dist/{snooze-JXI7VZJ4.js → snooze-WKY2T4VZ.js} +4 -4
- package/dist/{start-5XFUYT6I.js → start-ZCQT7G4C.js} +4 -4
- package/dist/{status-U5HKQ7MY.js → status-INIBC7GA.js} +2 -2
- package/dist/{stop-PFI7J2CS.js → stop-H4PTRFNX.js} +4 -4
- package/dist/{sync-S4IJT2WR.js → sync-6SHCY6LZ.js} +14 -14
- package/dist/{time-VDRCEIYQ.js → time-XQ2R7Z33.js} +5 -5
- package/dist/{timesheet-LSRRWV7Z.js → timesheet-DX2TLHIB.js} +6 -6
- package/dist/{tree-7S4DUZRZ.js → tree-5AAHU4K5.js} +8 -8
- package/dist/{update-DXIY6BEX.js → update-6G2E5QXG.js} +6 -6
- package/dist/{wait-KPH5BQUD.js → wait-LFFXWBY7.js} +5 -5
- package/dist/wd-bin.js +2 -2
- package/dist/web/assets/{PtyView-CKEfBQ3-.js → PtyView-l4za-VIj.js} +2 -2
- package/dist/web/assets/{PtyView-CKEfBQ3-.js.map → PtyView-l4za-VIj.js.map} +1 -1
- package/dist/web/assets/{index-DJsnmqYW.css → index-B4wFhe7U.css} +1 -1
- package/dist/web/assets/index-DaCK_AAw.js +118 -0
- package/dist/web/assets/index-DaCK_AAw.js.map +1 -0
- package/dist/web/index.html +2 -2
- package/dist/{web-ISGYHCTC.js → web-MWSFIUIJ.js} +415 -87
- package/dist/web-MWSFIUIJ.js.map +1 -0
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/dist/chunk-4U52S7AZ.js +0 -9
- package/dist/chunk-5LZZ73MS.js.map +0 -1
- package/dist/chunk-B2RCWZUW.js.map +0 -1
- package/dist/chunk-OQAQMCHF.js.map +0 -1
- package/dist/chunk-UAAH334K.js.map +0 -1
- package/dist/chunk-ZFPV46FA.js.map +0 -1
- package/dist/pty-host-5Z3GYXTW.js.map +0 -1
- package/dist/web/assets/index-CHA-bad8.js +0 -118
- package/dist/web/assets/index-CHA-bad8.js.map +0 -1
- package/dist/web-ISGYHCTC.js.map +0 -1
- /package/dist/{answer-IL5AQHRO.js.map → answer-EGNJ2KYK.js.map} +0 -0
- /package/dist/{attach-M2UXWUMO.js.map → attach-64ILZMTD.js.map} +0 -0
- /package/dist/{block-OXGEQ2PZ.js.map → block-H74FYSLK.js.map} +0 -0
- /package/dist/{broadcast-UJURJNEK.js.map → broadcast-WRHZWOQN.js.map} +0 -0
- /package/dist/{catchup-HN4VL5XK.js.map → catchup-7QBOC5JJ.js.map} +0 -0
- /package/dist/{chunk-EU3BS5A6.js.map → chunk-2LIVAJLK.js.map} +0 -0
- /package/dist/{chunk-HBCL77AR.js.map → chunk-2QZ3RZOY.js.map} +0 -0
- /package/dist/{chunk-PUYXTZ32.js.map → chunk-37I2GFXK.js.map} +0 -0
- /package/dist/{chunk-SH7NSDRW.js.map → chunk-3D7MELCW.js.map} +0 -0
- /package/dist/{chunk-3XY76XBD.js.map → chunk-3NPEMTQT.js.map} +0 -0
- /package/dist/{chunk-427RB7E4.js.map → chunk-4Y35ABCO.js.map} +0 -0
- /package/dist/{chunk-GWJVU4AS.js.map → chunk-6DWPIK7D.js.map} +0 -0
- /package/dist/{chunk-R7B46WXN.js.map → chunk-A3M5WTVC.js.map} +0 -0
- /package/dist/{chunk-YZLNJQAV.js.map → chunk-ATBH7QW3.js.map} +0 -0
- /package/dist/{chunk-YXQIGBL6.js.map → chunk-DXAIGNWF.js.map} +0 -0
- /package/dist/{chunk-TZWXQ4YZ.js.map → chunk-DXHZWRVE.js.map} +0 -0
- /package/dist/{chunk-PVN5IGDZ.js.map → chunk-LCSWFGIM.js.map} +0 -0
- /package/dist/{chunk-MVU7JAKG.js.map → chunk-MLTMXVLD.js.map} +0 -0
- /package/dist/{chunk-TVMZ4NYY.js.map → chunk-MXIFBNCV.js.map} +0 -0
- /package/dist/{chunk-RLR66XLG.js.map → chunk-NPVMYGT7.js.map} +0 -0
- /package/dist/{chunk-M7AUWYOP.js.map → chunk-OND6YRWZ.js.map} +0 -0
- /package/dist/{chunk-HDO3PXCU.js.map → chunk-ONEXQW7Q.js.map} +0 -0
- /package/dist/{chunk-6O6765M7.js.map → chunk-POTGMLPV.js.map} +0 -0
- /package/dist/{chunk-OW46TR4G.js.map → chunk-PYOSW6X5.js.map} +0 -0
- /package/dist/{chunk-YJVZ5H3I.js.map → chunk-QXDBVVSC.js.map} +0 -0
- /package/dist/{chunk-7UU5LPDM.js.map → chunk-S45H7N6X.js.map} +0 -0
- /package/dist/{chunk-SRIYY5HL.js.map → chunk-U4UB4LG6.js.map} +0 -0
- /package/dist/{chunk-HBXDIRM4.js.map → chunk-XILMZRNS.js.map} +0 -0
- /package/dist/{chunk-MIIJ2HQS.js.map → chunk-YEEDWV4H.js.map} +0 -0
- /package/dist/{cleanup-MHPHSM5I.js.map → cleanup-YSVZAGJF.js.map} +0 -0
- /package/dist/{cli-QF7GRSWT.js.map → cli-XT4AS3M2.js.map} +0 -0
- /package/dist/{config-SSWYCX4C.js.map → config-GQRUETZ6.js.map} +0 -0
- /package/dist/{diff-JBCBQM4I.js.map → diff-L3TWGBA4.js.map} +0 -0
- /package/dist/{digest-WCZD6N7M.js.map → digest-R52JZ3AK.js.map} +0 -0
- /package/dist/{fork-CISFOOAQ.js.map → fork-MCPMOGS5.js.map} +0 -0
- /package/dist/{hook-CA5X3VKU.js.map → hook-S64C4G2C.js.map} +0 -0
- /package/dist/{hydrate-Q4FWUQRC.js.map → hydrate-G5AMKHRD.js.map} +0 -0
- /package/dist/{init-AT3BQLXM.js.map → init-PCZCSRZI.js.map} +0 -0
- /package/dist/{move-CE5NIZKL.js.map → move-MMGOA7MV.js.map} +0 -0
- /package/dist/{note-JOR53JP4.js.map → note-WVKK65IH.js.map} +0 -0
- /package/dist/{overlaps-GXSEH2LG.js.map → overlaps-REVVBZCX.js.map} +0 -0
- /package/dist/{pin-DAWKCVB2.js.map → pin-NRSD2ZT7.js.map} +0 -0
- /package/dist/{pr-RKOVRSHC.js.map → pr-JYOI7LCK.js.map} +0 -0
- /package/dist/{prune-DS73W7LT.js.map → prune-AGZ24MPD.js.map} +0 -0
- /package/dist/{read-IKDSIDJD.js.map → read-A7LFAPPZ.js.map} +0 -0
- /package/dist/{recent-2LM44HN2.js.map → recent-H2LD5JOK.js.map} +0 -0
- /package/dist/{remove-DEDH57GP.js.map → remove-3HQTJQWN.js.map} +0 -0
- /package/dist/{resume-VA34T7ZR.js.map → resume-I7GXT2II.js.map} +0 -0
- /package/dist/{run-E2WZPHHK.js.map → run-TE2AFYA6.js.map} +0 -0
- /package/dist/{screen-KUXSDDLB.js.map → screen-XZPDSK65.js.map} +0 -0
- /package/dist/{search-FJUZPI3P.js.map → search-MGTME3CE.js.map} +0 -0
- /package/dist/{section-QLUIAYAV.js.map → section-YVBDU5MO.js.map} +0 -0
- /package/dist/{send-V6LL6YR6.js.map → send-WKIX3AT5.js.map} +0 -0
- /package/dist/{sessions-AGFO7W5U.js.map → sessions-2OWYXO55.js.map} +0 -0
- /package/dist/{snooze-JXI7VZJ4.js.map → snooze-WKY2T4VZ.js.map} +0 -0
- /package/dist/{start-5XFUYT6I.js.map → start-ZCQT7G4C.js.map} +0 -0
- /package/dist/{status-U5HKQ7MY.js.map → status-INIBC7GA.js.map} +0 -0
- /package/dist/{stop-PFI7J2CS.js.map → stop-H4PTRFNX.js.map} +0 -0
- /package/dist/{sync-S4IJT2WR.js.map → sync-6SHCY6LZ.js.map} +0 -0
- /package/dist/{time-VDRCEIYQ.js.map → time-XQ2R7Z33.js.map} +0 -0
- /package/dist/{timesheet-LSRRWV7Z.js.map → timesheet-DX2TLHIB.js.map} +0 -0
- /package/dist/{tree-7S4DUZRZ.js.map → tree-5AAHU4K5.js.map} +0 -0
- /package/dist/{update-DXIY6BEX.js.map → update-6G2E5QXG.js.map} +0 -0
- /package/dist/{wait-KPH5BQUD.js.map → wait-LFFXWBY7.js.map} +0 -0
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
computeChanges,
|
|
4
4
|
findOverlaps,
|
|
5
5
|
wantsDiffStat
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-QXDBVVSC.js";
|
|
7
7
|
import {
|
|
8
8
|
pool
|
|
9
9
|
} from "./chunk-AKMPF72Y.js";
|
|
@@ -34,4 +34,4 @@ async function scanChanges(sessions, opts = {}) {
|
|
|
34
34
|
export {
|
|
35
35
|
scanChanges
|
|
36
36
|
};
|
|
37
|
-
//# sourceMappingURL=chunk-
|
|
37
|
+
//# sourceMappingURL=chunk-MLTMXVLD.js.map
|
|
@@ -4,15 +4,15 @@ import {
|
|
|
4
4
|
} from "./chunk-L6RUHCKB.js";
|
|
5
5
|
import {
|
|
6
6
|
peekPty
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-KFSLF65S.js";
|
|
8
8
|
import {
|
|
9
9
|
sessionStatusView
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-4Y35ABCO.js";
|
|
11
11
|
import {
|
|
12
12
|
checkedOutBranch,
|
|
13
13
|
readPendingForWorktree,
|
|
14
14
|
scopeStoreIdsForPaths
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-LCSWFGIM.js";
|
|
16
16
|
import {
|
|
17
17
|
readStoresComments
|
|
18
18
|
} from "./chunk-E3Y4ZACK.js";
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
readStatus,
|
|
29
29
|
snoozeActive,
|
|
30
30
|
withLiveClaude
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-723C3D5X.js";
|
|
32
32
|
import {
|
|
33
33
|
agentOf,
|
|
34
34
|
agentWire,
|
|
@@ -345,4 +345,4 @@ export {
|
|
|
345
345
|
lastActiveMs,
|
|
346
346
|
createArchivedRows
|
|
347
347
|
};
|
|
348
|
-
//# sourceMappingURL=chunk-
|
|
348
|
+
//# sourceMappingURL=chunk-MXIFBNCV.js.map
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./chunk-4KZBZA5D.js";
|
|
5
5
|
import {
|
|
6
6
|
loadHistory
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-723C3D5X.js";
|
|
8
8
|
import {
|
|
9
9
|
atomicWriteFile,
|
|
10
10
|
getConfigDir,
|
|
@@ -119,4 +119,4 @@ export {
|
|
|
119
119
|
checkTools,
|
|
120
120
|
setupState
|
|
121
121
|
};
|
|
122
|
-
//# sourceMappingURL=chunk-
|
|
122
|
+
//# sourceMappingURL=chunk-NPVMYGT7.js.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
sessionWorkTime
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-DXAIGNWF.js";
|
|
5
5
|
import {
|
|
6
6
|
runInternal
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-A3M5WTVC.js";
|
|
8
8
|
import {
|
|
9
9
|
DEFAULT_CATCH_UP_DAYS,
|
|
10
10
|
addDays,
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
import {
|
|
17
17
|
loadHistory,
|
|
18
18
|
runGitAsync
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-723C3D5X.js";
|
|
20
20
|
import {
|
|
21
21
|
sessionIdFor
|
|
22
22
|
} from "./chunk-RT4QZRTC.js";
|
|
@@ -653,4 +653,4 @@ export {
|
|
|
653
653
|
finishDeviceLogin,
|
|
654
654
|
defaultTimeDeps
|
|
655
655
|
};
|
|
656
|
-
//# sourceMappingURL=chunk-
|
|
656
|
+
//# sourceMappingURL=chunk-OND6YRWZ.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
shownState
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-4Y35ABCO.js";
|
|
5
5
|
import {
|
|
6
6
|
defaultRunner
|
|
7
7
|
} from "./chunk-4KZBZA5D.js";
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
logSwallowed,
|
|
12
12
|
readArchive,
|
|
13
13
|
setSessionBase
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-723C3D5X.js";
|
|
15
15
|
import {
|
|
16
16
|
sessionIdFor
|
|
17
17
|
} from "./chunk-RT4QZRTC.js";
|
|
@@ -418,4 +418,4 @@ export {
|
|
|
418
418
|
moveOntoMain,
|
|
419
419
|
updateSession
|
|
420
420
|
};
|
|
421
|
-
//# sourceMappingURL=chunk-
|
|
421
|
+
//# sourceMappingURL=chunk-ONEXQW7Q.js.map
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./chunk-RKEY4573.js";
|
|
5
5
|
import {
|
|
6
6
|
writeTempTree
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-723C3D5X.js";
|
|
8
8
|
import {
|
|
9
9
|
spawn_default
|
|
10
10
|
} from "./chunk-RCYI7SRA.js";
|
|
@@ -534,4 +534,4 @@ export {
|
|
|
534
534
|
computeDiff,
|
|
535
535
|
computeRangeDiff
|
|
536
536
|
};
|
|
537
|
-
//# sourceMappingURL=chunk-
|
|
537
|
+
//# sourceMappingURL=chunk-POTGMLPV.js.map
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
openBaseCheckout,
|
|
4
4
|
setupWorktree
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-6OG3W3PY.js";
|
|
6
6
|
import {
|
|
7
7
|
resolveProjectTarget
|
|
8
8
|
} from "./chunk-JTHILJFB.js";
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
import {
|
|
13
13
|
findSession,
|
|
14
14
|
loadHistory
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-723C3D5X.js";
|
|
16
16
|
import {
|
|
17
17
|
spawn_default
|
|
18
18
|
} from "./chunk-RCYI7SRA.js";
|
|
@@ -159,4 +159,4 @@ export {
|
|
|
159
159
|
createInChild,
|
|
160
160
|
createInProcess
|
|
161
161
|
};
|
|
162
|
-
//# sourceMappingURL=chunk-
|
|
162
|
+
//# sourceMappingURL=chunk-PYOSW6X5.js.map
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./chunk-4KZBZA5D.js";
|
|
5
5
|
import {
|
|
6
6
|
logSwallowed
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-723C3D5X.js";
|
|
8
8
|
|
|
9
9
|
// src/core/diff/diff-stat.ts
|
|
10
10
|
import fs from "fs";
|
|
@@ -207,4 +207,4 @@ export {
|
|
|
207
207
|
wantsDiffStat,
|
|
208
208
|
findOverlaps
|
|
209
209
|
};
|
|
210
|
-
//# sourceMappingURL=chunk-
|
|
210
|
+
//# sourceMappingURL=chunk-QXDBVVSC.js.map
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
defaultArchiveDeps
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-DXHZWRVE.js";
|
|
5
5
|
import {
|
|
6
6
|
normPath
|
|
7
7
|
} from "./chunk-AKMPF72Y.js";
|
|
8
8
|
import {
|
|
9
9
|
teardownWorktree
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-6OG3W3PY.js";
|
|
11
11
|
import {
|
|
12
12
|
disposePty
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-KFSLF65S.js";
|
|
14
14
|
import {
|
|
15
15
|
defaultRunner
|
|
16
16
|
} from "./chunk-4KZBZA5D.js";
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
readSessionActivity,
|
|
24
24
|
readStatus,
|
|
25
25
|
removeSession
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-723C3D5X.js";
|
|
27
27
|
import {
|
|
28
28
|
sessionIdFor
|
|
29
29
|
} from "./chunk-RT4QZRTC.js";
|
|
@@ -159,4 +159,4 @@ function defaultCleanupDeps(opts = {}) {
|
|
|
159
159
|
export {
|
|
160
160
|
defaultCleanupDeps
|
|
161
161
|
};
|
|
162
|
-
//# sourceMappingURL=chunk-
|
|
162
|
+
//# sourceMappingURL=chunk-S45H7N6X.js.map
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
computeDiff,
|
|
4
4
|
isInsideRoot
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-POTGMLPV.js";
|
|
6
6
|
import {
|
|
7
7
|
packageRoot
|
|
8
8
|
} from "./chunk-LNHSBM4L.js";
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
import {
|
|
13
13
|
createFsWatcher,
|
|
14
14
|
loadHistory
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-723C3D5X.js";
|
|
16
16
|
import {
|
|
17
17
|
spawn_default
|
|
18
18
|
} from "./chunk-RCYI7SRA.js";
|
|
@@ -89,11 +89,13 @@ function findAnyParentBranch(cwd) {
|
|
|
89
89
|
function detectParentBranch(cwd) {
|
|
90
90
|
return findParent(cwd, true);
|
|
91
91
|
}
|
|
92
|
+
var PARENT_CANDIDATES = ["main", "master", "dev", "develop"].flatMap((name) => [name, `origin/${name}`]);
|
|
92
93
|
function findParent(cwd, requireAheadOfParent) {
|
|
93
94
|
const currentResult = git(["rev-parse", "--abbrev-ref", "HEAD"], cwd);
|
|
94
95
|
const currentBranch = currentResult.exitCode === 0 ? currentResult.stdout : "";
|
|
95
|
-
const candidates =
|
|
96
|
+
const candidates = PARENT_CANDIDATES;
|
|
96
97
|
let best = null;
|
|
98
|
+
let fresh;
|
|
97
99
|
for (const ref of candidates) {
|
|
98
100
|
if (ref === currentBranch) continue;
|
|
99
101
|
const exists = git(["rev-parse", "--verify", "--quiet", ref], cwd);
|
|
@@ -102,18 +104,42 @@ function findParent(cwd, requireAheadOfParent) {
|
|
|
102
104
|
if (mb.exitCode !== 0 || !mb.stdout) continue;
|
|
103
105
|
if (requireAheadOfParent) {
|
|
104
106
|
const headSha = git(["rev-parse", "HEAD"], cwd).stdout;
|
|
105
|
-
if (mb.stdout === headSha) continue;
|
|
107
|
+
if (mb.stdout === headSha && !(fresh ??= stillAtCreation(cwd, currentBranch, headSha))) continue;
|
|
106
108
|
}
|
|
107
109
|
const timeResult = git(["show", "-s", "--format=%ct", mb.stdout], cwd);
|
|
108
110
|
if (timeResult.exitCode !== 0) continue;
|
|
109
111
|
const time = Number(timeResult.stdout);
|
|
110
112
|
if (!Number.isFinite(time)) continue;
|
|
111
|
-
|
|
113
|
+
const later = !!best && time === best.time && mb.stdout !== best.sha && git(["merge-base", "--is-ancestor", best.sha, mb.stdout], cwd).exitCode === 0;
|
|
114
|
+
if (!best || time > best.time || later) {
|
|
112
115
|
best = { ref, sha: mb.stdout, time };
|
|
113
116
|
}
|
|
114
117
|
}
|
|
115
118
|
return best?.ref ?? null;
|
|
116
119
|
}
|
|
120
|
+
function stillAtCreation(cwd, branch, headSha) {
|
|
121
|
+
if (!branch || branch === "HEAD") return false;
|
|
122
|
+
const log = git(["reflog", "show", "--format=%H %gs", `refs/heads/${branch}`, "--"], cwd);
|
|
123
|
+
if (log.exitCode !== 0 || !log.stdout) return false;
|
|
124
|
+
const lines = log.stdout.split("\n").filter(Boolean);
|
|
125
|
+
const m = /^(\S+) branch: Created from (\S+)$/.exec(lines[lines.length - 1] ?? "");
|
|
126
|
+
if (!m || m[1] !== headSha) return false;
|
|
127
|
+
const from = m[2].replace(/^refs\/(heads|remotes)\//, "");
|
|
128
|
+
return from === "HEAD" || PARENT_CANDIDATES.includes(from);
|
|
129
|
+
}
|
|
130
|
+
function recordedBase(cwd, name) {
|
|
131
|
+
const refs = name.startsWith("origin/") ? [name] : [name, `origin/${name}`];
|
|
132
|
+
let best = null;
|
|
133
|
+
for (const ref of refs) {
|
|
134
|
+
if (git(["rev-parse", "--verify", "--quiet", ref], cwd).exitCode !== 0) continue;
|
|
135
|
+
const mb = git(["merge-base", ref, "HEAD"], cwd);
|
|
136
|
+
if (mb.exitCode !== 0 || !mb.stdout) continue;
|
|
137
|
+
if (!best || mb.stdout !== best.mb && git(["merge-base", "--is-ancestor", best.mb, mb.stdout], cwd).exitCode === 0) {
|
|
138
|
+
best = { ref, mb: mb.stdout };
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
return best;
|
|
142
|
+
}
|
|
117
143
|
function resolveBase(scope, argv) {
|
|
118
144
|
if (argv.base) return { base: argv.base, source: "arg" };
|
|
119
145
|
if (argv.branch) {
|
|
@@ -144,7 +170,9 @@ function resolveRepoDiff(root, base, sessionBaseBranch) {
|
|
|
144
170
|
if (base === "uncommitted") {
|
|
145
171
|
return { resolvedBase: "HEAD", diffArg: "HEAD" };
|
|
146
172
|
}
|
|
147
|
-
const
|
|
173
|
+
const recorded = sessionBaseBranch ? recordedBase(root, sessionBaseBranch) : null;
|
|
174
|
+
if (recorded) return { resolvedBase: recorded.ref, diffArg: recorded.mb };
|
|
175
|
+
const parent = detectParentBranch(root) ?? findAnyParentBranch(root);
|
|
148
176
|
if (!parent) return { resolvedBase: "HEAD", diffArg: "HEAD" };
|
|
149
177
|
let diffArg = "HEAD";
|
|
150
178
|
const mb = git(["merge-base", parent, "HEAD"], root);
|
|
@@ -484,4 +512,4 @@ export {
|
|
|
484
512
|
submitReviewSchema,
|
|
485
513
|
resolveSchema
|
|
486
514
|
};
|
|
487
|
-
//# sourceMappingURL=chunk-
|
|
515
|
+
//# sourceMappingURL=chunk-SSVVCHJB.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/core/diff/diff-scope.ts","../src/core/platform/web-static.ts","../src/server/local-origin.ts","../src/server/local-server.ts","../src/server/spa-handler.ts","../src/server/diff-server.ts","../src/core/diff/file-context.ts","../src/core/comments/comment-schemas.ts"],"sourcesContent":["import fs from 'node:fs';\nimport path from 'node:path';\nimport { git } from '../git/git.js';\nimport { loadHistory, type WorktreeSession } from '../sessions/history.js';\nimport type { RepoSpec } from './repo-spec.js';\nimport { report } from '../platform/report.js';\n\nexport interface DiffScope {\n isGroup: boolean;\n session: WorktreeSession | null;\n /** Repos to diff (1 for single, N for group). */\n repos: { name: string; root: string }[];\n /** Name of the repo whose subtree the user is in (initial active tab). */\n activeRepoName: string | null;\n}\n\nexport interface ResolvedBase {\n base: string;\n source: 'arg' | 'session' | 'auto-detected' | 'default';\n}\n\nfunction normPath(p: string): string {\n return path.resolve(p).replace(/\\\\/g, '/').toLowerCase();\n}\n\n/**\n * Like {@link normPath} but resolves to the OS-canonical real path.\n * `git rev-parse --show-toplevel` returns the realpath (e.g. macOS `/var` →\n * `/private/var`, and on Windows the long-form name), so comparing it to a\n * stored session path must canonicalize both sides the same way.\n *\n * Uses `realpathSync.native`: the plain `realpathSync` does NOT expand Windows\n * 8.3 short names (`SAMDEV~1` → `SamDev`), so a session path under a\n * short-name parent would never match git's long-form toplevel. `.native`\n * resolves both 8.3 and symlinks. Falls back to {@link normPath} for paths\n * that don't exist (e.g. unit-test fixtures).\n */\nfunction realNorm(p: string): string {\n try {\n return normPath(fs.realpathSync.native(p));\n } catch {\n return normPath(p);\n }\n}\n\n/**\n * Resolve what scope to diff based on cwd. Handles single-repo worktrees,\n * group worktrees (cwd at group root or anywhere inside a sub-repo), and\n * \"random\" git repos not managed by `work`.\n */\nexport function resolveScope(cwd: string): DiffScope | null {\n const normCwd = normPath(cwd);\n const sessions = loadHistory();\n\n // cwd's own git worktree root. Used to reject session-path matches that are\n // really a *parent* repo: linked worktrees often live physically inside\n // another repo (e.g. `<repo>/.claude/worktrees/<branch>`), so a naive prefix\n // match collapses every nested worktree onto the parent's scope — they'd\n // share one daemon and show each other's diff.\n const top = git(['rev-parse', '--show-toplevel'], cwd);\n const toplevel = top.exitCode === 0 && top.stdout ? top.stdout : null;\n const realTop = toplevel ? realNorm(toplevel) : null;\n\n // 1. cwd is at or inside one of a session's repo paths.\n for (const s of sessions) {\n for (const p of s.paths) {\n const np = normPath(p);\n if (normCwd === np || normCwd.startsWith(np + '/')) {\n // Only honour the match if this session path is cwd's actual worktree\n // root. When cwd is in a nested worktree, its toplevel is deeper than\n // `np` — skip so we resolve the real (nested) worktree below.\n if (realTop && realNorm(p) !== realTop) continue;\n if (s.isGroup) {\n return {\n isGroup: true,\n session: s,\n repos: s.paths.map((rp) => ({ name: path.basename(rp), root: rp })),\n activeRepoName: path.basename(p),\n };\n }\n return {\n isGroup: false,\n session: s,\n repos: [{ name: path.basename(p), root: p }],\n activeRepoName: path.basename(p),\n };\n }\n }\n }\n\n // 2. cwd is at the group root (parent of all of a group's repo paths).\n for (const s of sessions) {\n if (!s.isGroup || s.paths.length === 0) continue;\n const parents = s.paths.map((p) => normPath(path.dirname(p)));\n const groupRoot = parents[0];\n if (!parents.every((par) => par === groupRoot)) continue;\n if (normCwd === groupRoot || normCwd.startsWith(groupRoot + '/')) {\n return {\n isGroup: true,\n session: s,\n repos: s.paths.map((rp) => ({ name: path.basename(rp), root: rp })),\n activeRepoName: null,\n };\n }\n }\n\n // 3. Fall back to git rev-parse for repos not managed by `work`.\n if (!toplevel) return null;\n return {\n isGroup: false,\n session: null,\n repos: [{ name: path.basename(toplevel), root: toplevel }],\n activeRepoName: path.basename(toplevel),\n };\n}\n\n/**\n * Find any plausible parent branch — same candidate list as\n * `detectParentBranch`, but DOESN'T require the parent to have commits\n * past HEAD. Returns the candidate with the most-recent merge-base (or\n * null only if no candidates exist at all).\n *\n * Used by the static renderer and the diff server's `?base=branch`\n * route to decide whether to offer the \"Since branch\" tab. `detectParentBranch`\n * skips parents where merge-base == HEAD (correct for the CLI's \"show\n * me what I added past parent\" semantic — empty diff), but the toggle\n * should still appear in that case so the user can confirm \"no, there's\n * nothing committed yet\".\n */\nexport function findAnyParentBranch(cwd: string): string | null {\n return findParent(cwd, false);\n}\n\n/** Walk candidate base branches and pick the one with the most recent merge-base. */\nexport function detectParentBranch(cwd: string): string | null {\n return findParent(cwd, true);\n}\n\nconst PARENT_CANDIDATES = ['main', 'master', 'dev', 'develop'].flatMap((name) => [name, `origin/${name}`]);\n\nfunction findParent(cwd: string, requireAheadOfParent: boolean): string | null {\n const currentResult = git(['rev-parse', '--abbrev-ref', 'HEAD'], cwd);\n const currentBranch = currentResult.exitCode === 0 ? currentResult.stdout : '';\n\n const candidates = PARENT_CANDIDATES;\n\n let best: { ref: string; sha: string; time: number } | null = null;\n let fresh: boolean | undefined;\n\n for (const ref of candidates) {\n if (ref === currentBranch) continue;\n const exists = git(['rev-parse', '--verify', '--quiet', ref], cwd);\n if (exists.exitCode !== 0 || !exists.stdout) continue;\n\n const mb = git(['merge-base', ref, 'HEAD'], cwd);\n if (mb.exitCode !== 0 || !mb.stdout) continue;\n\n // Skip parents where the merge-base IS HEAD only when the caller\n // asked us to (CLI \"show me what I added\" semantics): a `dev` that\n // already contains this branch's commits isn't where it came from. When\n // called for the toggle UI, we want to surface the parent even though\n // the diff will be empty. A branch with no commits of its own yet is\n // the exception: there every parent it was made from contains HEAD, and\n // skipping them picked an older mainline — a branch just made from dev\n // showed all of dev's commits since main.\n if (requireAheadOfParent) {\n const headSha = git(['rev-parse', 'HEAD'], cwd).stdout;\n if (mb.stdout === headSha && !(fresh ??= stillAtCreation(cwd, currentBranch, headSha))) continue;\n }\n\n const timeResult = git(['show', '-s', '--format=%ct', mb.stdout], cwd);\n if (timeResult.exitCode !== 0) continue;\n const time = Number(timeResult.stdout);\n if (!Number.isFinite(time)) continue;\n\n // A tie in time (commits made in the same second): the later of the two, the one the other is an ancestor of.\n const later =\n !!best &&\n time === best.time &&\n mb.stdout !== best.sha &&\n git(['merge-base', '--is-ancestor', best.sha, mb.stdout], cwd).exitCode === 0;\n if (!best || time > best.time || later) {\n best = { ref, sha: mb.stdout, time };\n }\n }\n\n return best?.ref ?? null;\n}\n\n/**\n * The branch has no commits of its own: it was made here from HEAD or a\n * mainline (its reflog's oldest entry, \"branch: Created from dev\") and HEAD is\n * still that commit. One made from its own `origin/<branch>` (a PR, someone's\n * branch) or at a commit (Restore) carries commits that are its own, though\n * they weren't made here. No reflog (expired, a detached HEAD) says no.\n */\nfunction stillAtCreation(cwd: string, branch: string, headSha: string): boolean {\n if (!branch || branch === 'HEAD') return false;\n const log = git(['reflog', 'show', '--format=%H %gs', `refs/heads/${branch}`, '--'], cwd);\n if (log.exitCode !== 0 || !log.stdout) return false;\n const lines = log.stdout.split('\\n').filter(Boolean);\n const m = /^(\\S+) branch: Created from (\\S+)$/.exec(lines[lines.length - 1] ?? '');\n if (!m || m[1] !== headSha) return false;\n const from = m[2].replace(/^refs\\/(heads|remotes)\\//, '');\n return from === 'HEAD' || PARENT_CANDIDATES.includes(from);\n}\n\n/**\n * A recorded base, as fresh as this clone has it: the branch or its\n * `origin/` copy, whichever shares the later commit with HEAD (the local one\n * is pulled only when a worktree is made from it, so it falls behind a branch\n * that merged origin's since). Null when neither exists (deleted since).\n */\nfunction recordedBase(cwd: string, name: string): { ref: string; mb: string } | null {\n const refs = name.startsWith('origin/') ? [name] : [name, `origin/${name}`];\n let best: { ref: string; mb: string } | null = null;\n for (const ref of refs) {\n if (git(['rev-parse', '--verify', '--quiet', ref], cwd).exitCode !== 0) continue;\n const mb = git(['merge-base', ref, 'HEAD'], cwd);\n if (mb.exitCode !== 0 || !mb.stdout) continue;\n if (!best || (mb.stdout !== best.mb && git(['merge-base', '--is-ancestor', best.mb, mb.stdout], cwd).exitCode === 0)) {\n best = { ref, mb: mb.stdout };\n }\n }\n return best;\n}\n\nexport function resolveBase(scope: DiffScope, argv: { base?: string; branch?: boolean }): ResolvedBase {\n if (argv.base) return { base: argv.base, source: 'arg' };\n\n if (argv.branch) {\n if (scope.session?.baseBranch) {\n return { base: scope.session.baseBranch, source: 'session' };\n }\n const primaryRoot = scope.repos.find((r) => r.name === scope.activeRepoName)?.root ?? scope.repos[0].root;\n const detected = detectParentBranch(primaryRoot);\n if (detected) return { base: detected, source: 'auto-detected' };\n\n report('error', 'Could not determine a parent branch for this worktree.');\n report('detail', 'Pass one explicitly: diff <ref>');\n process.exit(1);\n }\n\n return { base: 'HEAD', source: 'default' };\n}\n\n/**\n * Compute per-repo merge-base when comparing against a non-HEAD ref.\n *\n * `perRepoBase` (keyed by repo root) overrides `base` for individual repos —\n * used by group worktrees forked with different bases per repo\n * (`work tree --base backend=dev --base frontend=feat/x`). A repo without an\n * override falls back to the shared `base`.\n */\nexport function buildRepoSpecs(scope: DiffScope, base: string, perRepoBase?: Record<string, string>): RepoSpec[] {\n return scope.repos.map((r) => {\n const repoBase = perRepoBase?.[r.root] ?? base;\n let diffArg = repoBase;\n if (repoBase !== 'HEAD') {\n const mb = git(['merge-base', repoBase, 'HEAD'], r.root);\n if (mb.exitCode === 0 && mb.stdout) diffArg = mb.stdout;\n }\n return { name: r.name, root: r.root, diffArg };\n });\n}\n\nexport interface ResolvedRepoDiff {\n /** The git ref the diff was computed against. `HEAD` for uncommitted,\n * the resolved parent (e.g. `origin/main`) for branch mode. */\n resolvedBase: string;\n /** The actual argument passed to `git diff` — typically the merge-base\n * sha for branch mode, or `HEAD` for uncommitted. */\n diffArg: string;\n}\n\n/**\n * Resolve the diff target for a single repo. Centralises the\n * \"find-parent → merge-base → fall back to HEAD\" dance that previously\n * lived in three places (scope-routes, web-server, the static renderer).\n *\n * For `base === 'uncommitted'` this is trivially `HEAD`. For\n * `base === 'branch'` it prefers an explicit `sessionBaseBranch` (the\n * value the user recorded with `work tree --base`), falling back to\n * `findAnyParentBranch` (so the toggle stays available even when the\n * branch has no commits past parent yet — diff just renders empty).\n */\nexport function resolveRepoDiff(root: string, base: 'uncommitted' | 'branch', sessionBaseBranch?: string | null): ResolvedRepoDiff {\n if (base === 'uncommitted') {\n return { resolvedBase: 'HEAD', diffArg: 'HEAD' };\n }\n // Prefer a parent we're actually *ahead of* (`detectParentBranch` skips\n // candidates whose merge-base is HEAD, e.g. a `dev` that already contains\n // this branch — unless the branch has no commits yet, when the one it was\n // made from is right). `findAnyParentBranch` would pick the most-recent merge-base\n // even when it's HEAD — yielding a useless 0-commit \"since branch\" diff.\n // Fall back to it only so the toggle still resolves to *something*.\n // A recorded base wins, at its freshest; one that's gone (merged and deleted) leaves it to detection.\n const recorded = sessionBaseBranch ? recordedBase(root, sessionBaseBranch) : null;\n if (recorded) return { resolvedBase: recorded.ref, diffArg: recorded.mb };\n const parent = detectParentBranch(root) ?? findAnyParentBranch(root);\n if (!parent) return { resolvedBase: 'HEAD', diffArg: 'HEAD' };\n let diffArg = 'HEAD';\n const mb = git(['merge-base', parent, 'HEAD'], root);\n if (mb.exitCode === 0 && mb.stdout) diffArg = mb.stdout;\n return { resolvedBase: parent, diffArg };\n}\n\n/**\n * Look up the recorded fork point for a worktree path from session history.\n * Prefers the per-repo base (`baseBranches`) for that exact path, falling\n * back to the session's representative `baseBranch`. Returns undefined when\n * the path isn't a known worktree — callers then auto-detect.\n *\n * Used by the scope diff route, which only carries repo paths (no session),\n * so a `wd` forked with `--base feat/x` still diffs against `feat/x` even\n * though auto-detection wouldn't find a non-mainline parent.\n */\nexport function sessionBaseForPath(root: string): string | undefined {\n const norm = normPath(root);\n for (const s of loadHistory()) {\n for (const p of s.paths) {\n if (normPath(p) === norm) {\n return s.baseBranches?.[p] ?? s.baseBranch;\n }\n }\n }\n return undefined;\n}\n","import fs from 'node:fs';\nimport { packageRoot } from './package-root.js';\nimport http from 'node:http';\nimport path from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\nconst MIME: Record<string, string> = {\n '.html': 'text/html; charset=utf-8',\n '.js': 'application/javascript; charset=utf-8',\n '.mjs': 'application/javascript; charset=utf-8',\n '.css': 'text/css; charset=utf-8',\n '.json': 'application/json; charset=utf-8',\n '.svg': 'image/svg+xml',\n '.ico': 'image/x-icon',\n '.map': 'application/json; charset=utf-8',\n};\n\n/** Resolve the directory shipped by the Vite build. */\nexport function resolveWebRoot(): string | null {\n const entryDir = path.dirname(process.argv[1] ?? '');\n const moduleDir = path.dirname(fileURLToPath(import.meta.url));\n const candidates = [\n path.join(entryDir, 'web'),\n // bundled: this module is inlined into dist/<bin>.js, so dist/web is a\n // sibling of the bundle. Works even when argv[1] is an npm bin symlink\n // (which is not realpath'd, so the entryDir candidate above misses).\n path.join(moduleDir, 'web'),\n // dev/tsx: the package's dist/web (wherever under src/ this module sits).\n ...(packageRoot() ? [path.join(packageRoot()!, 'dist', 'web')] : []),\n ];\n for (const c of candidates) {\n if (fs.existsSync(path.join(c, 'index.html'))) return c;\n }\n return null;\n}\n\n/**\n * Serve a static file under `root`. Returns true if it served a file. Does\n * NOT do SPA fallback — caller decides whether to re-try with /index.html\n * on miss.\n */\nexport function serveStatic(root: string, urlPath: string, res: http.ServerResponse): boolean {\n const clean = urlPath.split('?')[0];\n const requested = clean === '/' ? '/index.html' : clean;\n const filePath = path.join(root, requested);\n const norm = path.normalize(filePath);\n const base = path.normalize(root);\n if (norm !== base && !norm.startsWith(base + path.sep)) return false;\n let stat: fs.Stats;\n try {\n stat = fs.statSync(norm);\n } catch {\n return false;\n }\n if (!stat.isFile()) return false;\n const ext = path.extname(norm).toLowerCase();\n res.writeHead(200, {\n 'Content-Type': MIME[ext] ?? 'application/octet-stream',\n 'Cache-Control': 'no-cache',\n });\n fs.createReadStream(norm).pipe(res);\n return true;\n}\n\n/** Convenience: serve the file if it exists, else fall back to index.html. */\nexport function serveStaticOrShell(root: string, urlPath: string, res: http.ServerResponse): boolean {\n if (serveStatic(root, urlPath, res)) return true;\n if (serveStatic(root, '/index.html', res)) return true;\n return false;\n}\n","/**\n * Who may talk to our localhost servers (work web / wd / comment server).\n *\n * Binding to 127.0.0.1 keeps the network out, and the Host check stops DNS\n * rebinding — but neither stops a web page you have open from making YOUR\n * browser send requests to 127.0.0.1:<port> (cross-site request forgery).\n * The port is predictable and session ids are guessable, and the terminal\n * WebSocket types straight into Claude — so every request that changes\n * something, and every WebSocket upgrade, must come from our own origin.\n *\n * Rules:\n * - Host must be 127.0.0.1:<port> or localhost:<port> (DNS rebinding).\n * - A browser marking the request `Sec-Fetch-Site: cross-site` (or\n * `same-site`: another localhost port) is refused,\n * except a top-level page load (GET/HEAD, `Sec-Fetch-Mode: navigate`,\n * `Sec-Fetch-Dest: document`): clicking a dashboard or diff link in\n * GitHub, Jira or Slack must open it. The opening site can't read the\n * response and a GET changes nothing; frames stay refused, so no other\n * page can embed the dashboard.\n * - Mutating requests (anything but GET/HEAD/OPTIONS) and WebSocket\n * upgrades: `Origin` must be absent (non-browser callers — the Claude\n * hooks, `wd`, the CLI — send none) or exactly our own origin. Browsers\n * always send Origin on cross-origin POSTs and on every WebSocket, and a\n * page can't forge it. `Origin: null` (sandboxed frames, file://) is\n * refused.\n */\n\nexport function allowedHost(host: string | undefined, port: number): boolean {\n return host === `127.0.0.1:${port}` || host === `localhost:${port}`;\n}\n\nexport function allowedOrigin(origin: string | undefined, port: number): boolean {\n if (origin === undefined || origin === '') return true;\n return origin === `http://127.0.0.1:${port}` || origin === `http://localhost:${port}`;\n}\n\nconst SAFE_METHODS = new Set(['GET', 'HEAD', 'OPTIONS']);\n\nexport interface RequestFacts {\n method: string;\n host?: string;\n origin?: string;\n secFetchSite?: string;\n secFetchMode?: string;\n secFetchDest?: string;\n /** A WebSocket upgrade — always checked like a mutating request. */\n upgrade?: boolean;\n}\n\n/** Null when allowed, else a short reason (for the 403 body / logs). */\nexport function refuseReason(req: RequestFacts, port: number): string | null {\n if (!allowedHost(req.host, port)) return 'bad host';\n const mutating = req.upgrade || !SAFE_METHODS.has(req.method.toUpperCase());\n const pageLoad =\n !req.upgrade &&\n ['GET', 'HEAD'].includes(req.method.toUpperCase()) &&\n req.secFetchMode === 'navigate' &&\n req.secFetchDest === 'document';\n // same-site = another localhost port (your dev servers, say): the\n // dashboard itself is always same-origin, so treat it like cross-site.\n if ((req.secFetchSite === 'cross-site' || req.secFetchSite === 'same-site') && !pageLoad) return 'cross-site request';\n if (mutating && !allowedOrigin(req.origin, port)) return 'foreign origin';\n return null;\n}\n","import { report } from '../core/platform/report.js';\nimport { Hono } from 'hono';\nimport { serve, type ServerType } from '@hono/node-server';\nimport { refuseReason } from './local-origin.js';\n\n// The one way to start a local HTTP server (work web, wd, the comment\n// server, the demo): 127.0.0.1 only, random port, behind the Host/Origin\n// guard. Its own module so a server that needs no git/fs — the demo — can\n// use it without importing the diff server.\n\nexport interface DiffServerHandle {\n url: string;\n port: number;\n stop(): Promise<void>;\n}\n\n/** Start a Hono app on a random port; resolve when it's listening. The\n * raw Node server is exposed via `httpServer` so callers can attach\n * WebSocket upgrade handlers (the terminal bridge).\n *\n * Installs a guard (core/local-origin.ts): Host must be ours (DNS\n * rebinding), and mutating requests must not come from another origin\n * (cross-site request forgery from any page open in the browser). The SPA\n * is served same-origin, and Node callers send no Origin, so both pass.\n */\nexport function launch(app: Hono): Promise<DiffServerHandle & { httpServer: ServerType }> {\n return new Promise((resolve) => {\n // Captured before serve() resolves; first guarded request runs after\n // this is set because serve() doesn't accept connections until it's\n // bound, and bind precedes the info-callback.\n let listenPort = 0;\n const guard = new Hono();\n guard.use('*', async (c, next) => {\n // Host (DNS rebinding) + Origin / Sec-Fetch-Site (cross-site request\n // forgery from any page open in the browser) — see local-origin.ts.\n const reason = refuseReason(\n {\n method: c.req.method,\n host: c.req.header('host'),\n origin: c.req.header('origin'),\n secFetchSite: c.req.header('sec-fetch-site'),\n secFetchMode: c.req.header('sec-fetch-mode'),\n secFetchDest: c.req.header('sec-fetch-dest'),\n },\n listenPort,\n );\n if (reason) return c.text(`Forbidden (${reason})`, 403);\n await next();\n });\n guard.route('/', app);\n\n const server: ServerType = serve({ fetch: guard.fetch, port: 0, hostname: '127.0.0.1' }, (info) => {\n listenPort = info.port;\n const url = `http://127.0.0.1:${info.port}/`;\n report('detail', `[server] listening at ${url}`);\n resolve({\n url,\n port: info.port,\n httpServer: server,\n stop: () =>\n new Promise<void>((res) => {\n server.close(() => res());\n }),\n });\n });\n });\n}\n","import fs from 'node:fs';\nimport path from 'node:path';\nimport type { Context } from 'hono';\n\nconst MIME: Record<string, string> = {\n '.html': 'text/html; charset=utf-8',\n '.js': 'application/javascript; charset=utf-8',\n '.mjs': 'application/javascript; charset=utf-8',\n '.css': 'text/css; charset=utf-8',\n '.json': 'application/json; charset=utf-8',\n '.svg': 'image/svg+xml',\n '.ico': 'image/x-icon',\n '.map': 'application/json; charset=utf-8',\n};\n\nfunction readFile(root: string, relPath: string): { body: Buffer; ext: string } | null {\n const clean = relPath.split('?')[0];\n const requested = clean === '/' ? '/index.html' : clean;\n const filePath = path.join(root, requested);\n const norm = path.normalize(filePath);\n if (!norm.startsWith(path.normalize(root))) return null;\n let stat: fs.Stats;\n try {\n stat = fs.statSync(norm);\n } catch {\n return null;\n }\n if (!stat.isFile()) return null;\n const ext = path.extname(norm).toLowerCase();\n return { body: fs.readFileSync(norm), ext };\n}\n\n/**\n * Hono handler for the bundled SPA. Tries to serve the requested file; if it\n * doesn't exist, falls back to index.html so client-side routing works on\n * deep links. Skips /api/* paths entirely (those should be handled by\n * earlier routes; if we reach here it's a 404).\n */\nexport function serveSpa(c: Context, webRoot: string): Response {\n const url = new URL(c.req.url);\n if (url.pathname.startsWith('/api/')) {\n return c.json({ error: 'not found' }, 404);\n }\n const hit = readFile(webRoot, url.pathname) ?? readFile(webRoot, '/index.html');\n if (!hit) return c.json({ error: 'not found' }, 404);\n return new Response(new Uint8Array(hit.body), {\n status: 200,\n headers: {\n 'Content-Type': MIME[hit.ext] ?? 'application/octet-stream',\n 'Cache-Control': 'no-cache',\n },\n });\n}\n","import { launch, type DiffServerHandle } from './local-server.js';\n\nexport { launch, type DiffServerHandle } from './local-server.js';\nimport { Hono, type Context } from 'hono';\nimport { streamSSE } from 'hono/streaming';\nimport { computeDiff } from '../core/diff/diff-pipeline.js';\nimport { readContextLines } from '../core/diff/file-context.js';\nimport { createFsWatcher } from '../core/platform/fs-watcher.js';\nimport { resolveRepoDiff } from '../core/diff/diff-scope.js';\nimport { git } from '../core/git/git.js';\nimport { resolveWebRoot } from '../core/platform/web-static.js';\nimport { serveSpa } from './spa-handler.js';\nimport type { RepoSpec } from '../core/diff/repo-spec.js';\n\nexport interface DiffServerOptions {\n /** Repos this server scopes to. */\n repos: RepoSpec[];\n /** Short human-readable label for /api/context. */\n scopeLabel: string;\n /** Optional session baseBranch (the value captured at `work tree --base`).\n * When set, the `?base=branch` route uses it instead of auto-detection,\n * so the diff matches what the user actually declared. */\n sessionBaseBranch?: string;\n /** Per-repo fork points keyed by repo root. Overrides `sessionBaseBranch`\n * for individual repos in a group forked with different bases per repo. */\n sessionBaseBranches?: Record<string, string>;\n /** Debounce for fs.watch events before broadcasting diff-changed. */\n watchDebounceMs?: number;\n /** When true, /api/context advertises readOnly=true and the SPA hides\n * the comment UI. Default false. */\n readOnly?: boolean;\n /** Called once the base app is built so feature apps (e.g. comments) can\n * mount themselves and emit events via the SSE hub. */\n attachRoutes?: (api: DiffServerApi) => void;\n}\n\n/** A typed SSE event broadcast to every connected client. */\nexport interface SseEvent {\n event: string;\n data: unknown;\n}\n\nexport interface DiffServerApi {\n /** Mount a Hono sub-app at the given path prefix. */\n route(prefix: string, app: Hono): void;\n /** Broadcast on the shared SSE hub. Fan-out is one-shot per client. */\n broadcast(event: string, data: unknown): void;\n}\n\n/**\n * The shared local HTTP server used by both `wd` (read-only) and `wd -c`\n * (comments). Owns the fs watcher, the SSE hub, and the three routes every\n * mode needs: GET /api/context, GET /api/diff, GET /events. Comment routes\n * register themselves via `attachRoutes`.\n */\nexport async function startDiffServer(opts: DiffServerOptions): Promise<DiffServerHandle> {\n const webRoot = resolveWebRoot();\n if (!webRoot) {\n throw new Error('Could not find dist/web/. Run `npm run build` first.');\n }\n\n const sseListeners = new Set<(e: SseEvent) => void>();\n const watcher = createFsWatcher({\n roots: opts.repos.map((r) => r.root),\n debounceMs: opts.watchDebounceMs,\n onChange: () => broadcast('diff-changed', { ts: Date.now() }),\n });\n\n function broadcast(event: string, data: unknown): void {\n const payload: SseEvent = { event, data };\n for (const cb of sseListeners) cb(payload);\n }\n\n const app = new Hono();\n // No CORS headers and no OPTIONS preflight handler — the SPA is served\n // same-origin so its requests don't trigger preflight. The Host guard in\n // `launch` rejects cross-origin requests before they reach any handler.\n\n app.get('/api/context', (c) => {\n // Current branch of the primary repo, for the \"<branch> vs <base>\" title.\n const primaryRoot = opts.repos[0]?.root;\n let headBranch: string | undefined;\n if (primaryRoot) {\n const head = git(['rev-parse', '--abbrev-ref', 'HEAD'], primaryRoot);\n if (head.exitCode === 0 && head.stdout && head.stdout !== 'HEAD') {\n headBranch = head.stdout;\n }\n }\n return c.json({\n mode: 'review',\n scopeLabel: opts.scopeLabel,\n repos: opts.repos.map((r) => ({ name: r.name })),\n readOnly: !!opts.readOnly,\n headBranch,\n });\n });\n\n app.get('/api/diff', (c) => {\n const base = c.req.query('base') === 'branch' ? 'branch' : 'uncommitted';\n try {\n // For 'uncommitted' we honour the configured `diffArg` (typically\n // HEAD) so single-repo callers preserve whatever ref they\n // configured. For 'branch' we delegate to `resolveRepoDiff` per\n // repo — each one resolves its own parent and merge-base. The\n // top-level `resolvedBase` is the primary repo's value (matches\n // scope-routes and web-server behavior for the badge label).\n const resolved = opts.repos.map((r) =>\n base === 'uncommitted'\n ? { resolvedBase: 'HEAD', diffArg: r.diffArg }\n : resolveRepoDiff(r.root, 'branch', opts.sessionBaseBranches?.[r.root] ?? opts.sessionBaseBranch),\n );\n const repos = opts.repos.map((r, i) => ({\n name: r.name,\n root: r.root,\n resolvedBase: resolved[i].resolvedBase,\n files: computeDiff({ root: r.root, diffArg: resolved[i].diffArg }),\n }));\n const resolvedBase = resolved[0]?.resolvedBase ?? 'HEAD';\n return c.json({ repos, base, resolvedBase });\n } catch (err) {\n return c.json({ error: (err as Error).message }, 500);\n }\n });\n\n // Reveal unchanged context lines around a hunk (\"expand lines\"). Maps the\n // SPA's repo name back to its RepoSpec root; single-repo scopes (the\n // common standalone case) skip the lookup.\n app.get('/api/file-lines', (c) => {\n const repoName = c.req.query('repo') ?? '';\n const relPath = c.req.query('path') ?? '';\n const start = Number(c.req.query('start'));\n const end = Number(c.req.query('end'));\n const ref = c.req.query('ref') || undefined;\n if (!relPath || !Number.isInteger(start) || !Number.isInteger(end)) {\n return c.json({ error: 'bad path/start/end' }, 400);\n }\n const root = opts.repos.length === 1 ? opts.repos[0].root : opts.repos.find((r) => r.name === repoName)?.root;\n if (!root) return c.json({ error: 'unknown repo' }, 404);\n const result = readContextLines({ root, relPath, start, end, ref });\n if (!result) return c.json({ error: 'cannot read file' }, 400);\n return c.json(result);\n });\n\n app.get('/events', (c) =>\n streamSSE(c, async (stream) => {\n const listener = (e: SseEvent) => {\n stream.writeSSE({ event: e.event, data: JSON.stringify(e.data) }).catch(() => {\n /* client gone */\n });\n };\n sseListeners.add(listener);\n await stream.writeSSE({ event: 'connected', data: '' });\n // Keep the stream open until the client disconnects.\n await new Promise<void>((resolve) => {\n stream.onAbort(() => {\n sseListeners.delete(listener);\n resolve();\n });\n });\n }),\n );\n\n // attachRoutes can mount Hono sub-apps with their own routes.\n if (opts.attachRoutes) {\n opts.attachRoutes({\n route: (prefix, sub) => app.route(prefix, sub),\n broadcast,\n });\n }\n\n // SPA fallback for the bundled web assets.\n app.get('*', (c: Context) => serveSpa(c, webRoot));\n\n // Wrap the handle so server shutdown also tears down our chokidar watcher.\n // Without this the watcher keeps Node's event loop open after `stop()` —\n // a real test/teardown leak (vitest hangs after a suite that exercises\n // the server) and a wasteful long-running ghost in dev.\n const handle = await launch(app);\n const baseStop = handle.stop;\n return {\n ...handle,\n stop: async () => {\n try {\n watcher.stop();\n } catch {\n /* */\n }\n await baseStop();\n },\n };\n}\n","import fs from 'node:fs';\nimport path from 'node:path';\nimport spawn from '../platform/spawn.js';\nimport { isInsideRoot } from './diff-pipeline.js';\n\nexport interface ContextLinesOptions {\n /** Git toplevel (repo root) the file lives under. */\n root: string;\n /** Repo-relative path of the file. */\n relPath: string;\n /** 1-based inclusive first line to return. */\n start: number;\n /** 1-based inclusive last line to return. */\n end: number;\n /** When omitted or `'working'`, read the working-tree file. Otherwise the\n * content comes from `git show <ref>:<relPath>` — used when the diff's\n * \"new\" side is a committed snapshot (checkpoint range) rather than the\n * live tree. */\n ref?: string;\n}\n\nexport interface ContextLinesResult {\n /** The requested slice. Shorter than `end - start + 1` when the file ends\n * before `end`. */\n lines: string[];\n /** Echoed 1-based first line of `lines` (clamped to >= 1). */\n start: number;\n /** Total line count of the file at this ref. */\n totalLines: number;\n /** True when `end` reached (or passed) the last line — there is nothing\n * further below to expand. */\n eof: boolean;\n}\n\n/**\n * Read a contiguous range of lines from a file so the diff viewer can\n * reveal the unchanged context around hunks (\"expand lines\" in GitHub's\n * UI). The expandable region is, by definition, identical on both diff\n * sides, so a single read of the appropriate side is enough — the caller\n * maps the old line numbers via the constant gap offset.\n *\n * Path safety mirrors `readMarkdownContent` in diff-pipeline: the textual\n * `relPath` is rejected if it escapes `root`, and the working-tree read is\n * symlink-canonicalised so a `notes.md -> /etc/passwd` symlink can't\n * exfiltrate an out-of-tree file into the payload.\n *\n * Returns `null` when the path is rejected or the content can't be read\n * (missing file, unknown ref, binary). Callers surface that as a 404/400.\n */\nexport function readContextLines(opts: ContextLinesOptions): ContextLinesResult | null {\n const { root, relPath, ref } = opts;\n if (!relPath || !isInsideRoot(root, relPath)) return null;\n\n const start = Math.max(1, Math.floor(opts.start));\n const end = Math.max(start, Math.floor(opts.end));\n\n const content = !ref || ref === 'working' ? readWorkingTree(root, relPath) : readAtRef(root, ref, relPath);\n if (content === null) return null;\n\n // Split on either line ending; drop the trailing empty element a final\n // newline produces so `totalLines` matches the line count git/editors\n // report. Matches how `parseGitDiff` strips line endings from hunk text,\n // so revealed context lines render identically to diff context lines.\n const all = content.split(/\\r?\\n/);\n if (all.length > 0 && all[all.length - 1] === '') all.pop();\n\n const totalLines = all.length;\n // start past EOF → empty slice, eof true.\n const slice = all.slice(start - 1, end);\n return {\n lines: slice,\n start,\n totalLines,\n eof: end >= totalLines,\n };\n}\n\n/** Symlink-safe working-tree read. Returns null on any failure. */\nfunction readWorkingTree(root: string, relPath: string): string | null {\n try {\n const absPath = path.join(root, relPath);\n const realRoot = fs.realpathSync(path.resolve(root));\n const realPath = fs.realpathSync(absPath);\n const sep = path.sep;\n if (realPath !== realRoot && !realPath.startsWith(realRoot + sep)) {\n return null;\n }\n return fs.readFileSync(absPath, 'utf-8');\n } catch {\n return null;\n }\n}\n\n/**\n * A ref we may hand to `git show`: a commit id, or a plain ref name. It\n * comes from a query string, and `git show` takes options — a ref of\n * `--output=/some/file` would make it WRITE a file. So nothing that starts\n * with `-`, and only characters refs actually use.\n */\nexport function isSafeRef(ref: string): boolean {\n return /^[A-Za-z0-9_][A-Za-z0-9._/~^@{}+-]{0,199}$/.test(ref) && !ref.includes('..');\n}\n\n/** `git show <ref>:<relPath>`. Uses cross-spawn directly (not the trimming\n * `git()` helper) so trailing newlines survive. Returns null on failure\n * (including a ref that isn't safe to pass — see isSafeRef). */\nfunction readAtRef(root: string, ref: string, relPath: string): string | null {\n if (!isSafeRef(ref)) return null;\n const r = spawn.sync('git', ['show', '--end-of-options', `${ref}:${relPath}`], {\n cwd: root,\n encoding: 'utf-8',\n maxBuffer: 64 * 1024 * 1024,\n windowsHide: true,\n });\n if (r.status === 0 && typeof r.stdout === 'string') return r.stdout;\n return null;\n}\n","/**\n * Shared zod schemas for the comment HTTP surface. Kept separate from\n * `comment-types.ts` because the SPA imports `comment-types.ts` for the\n * type-only exports and pulling zod into the SPA bundle is wasteful —\n * the schemas are server-side validation only.\n */\n\nimport { z } from 'zod';\n\nexport const commentInputSchema = z.object({\n repo: z.string().optional(),\n file: z.string().optional(),\n line: z.number().int().optional(),\n side: z.enum(['left', 'right', 'general', 'file']).optional(),\n body: z.string().min(1),\n status: z.enum(['published', 'draft']).optional(),\n lineContent: z.string().optional(),\n parentId: z.string().optional(),\n author: z.enum(['user', 'claude']).optional(),\n});\n\nexport const submitReviewSchema = z.object({\n summary: z.string().optional(),\n});\n\nexport const resolveSchema = z.object({\n resolved: z.boolean(),\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ;A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jB;AAAA,EACF;AACF;;;AEvLA,SAAS,SAAS;AAEX,IAAM,qBAAqB,EAAE,OAAO;AAAA,EACzC,MAAM,EAAE,OAAO,EAAE,SAAS;AAAA,EAC1B,MAAM,EAAE,OAAO,EAAE,SAAS;AAAA,EAC1B,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS;AAAA,EAChC,MAAM,EAAE,KAAK,CAAC,QAAQ,SAAS,WAAW,MAAM,CAAC,EAAE,SAAS;AAAA,EAC5D,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC;AAAA,EACtB,QAAQ,EAAE,KAAK,CAAC,aAAa,OAAO,CAAC,EAAE,SAAS;AAAA,EAChD,aAAa,EAAE,OAAO,EAAE,SAAS;AAAA,EACjC,UAAU,EAAE,OAAO,EAAE,SAAS;AAAA,EAC9B,QAAQ,EAAE,KAAK,CAAC,QAAQ,QAAQ,CAAC,EAAE,SAAS;AAC9C,CAAC;AAEM,IAAM,qBAAqB,EAAE,OAAO;AAAA,EACzC,SAAS,EAAE,OAAO,EAAE,SAAS;AAC/B,CAAC;AAEM,IAAM,gBAAgB,EAAE,OAAO;AAAA,EACpC,UAAU,EAAE,QAAQ;AACtB,CAAC;","names":["fs","path","path","fs","fs","path","Hono","fs","path","path","fs","Hono"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// src/core/pty/restart-view.ts
|
|
4
|
+
var LATER_TEXT = "restarts when its turn ends";
|
|
5
|
+
function restartCountsText(c) {
|
|
6
|
+
const parts = [];
|
|
7
|
+
if (c.restarted) parts.push(`${c.restarted} session${c.restarted === 1 ? "" : "s"} restarted`);
|
|
8
|
+
if (c.later) parts.push(`${c.later} ${c.later === 1 ? LATER_TEXT : "restart when their turns end"}`);
|
|
9
|
+
if (c.failed) parts.push(`${c.failed} couldn't${c.firstError ? `: ${c.firstError}` : ""}`);
|
|
10
|
+
return parts.length ? `${parts.join(" \xB7 ")}.` : "Nothing to restart.";
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export {
|
|
14
|
+
LATER_TEXT,
|
|
15
|
+
restartCountsText
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=chunk-TNJF7T33.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/core/pty/restart-view.ts"],"sourcesContent":["/**\n * How a restart of agents is said (agent-restart.ts), the same in the dashboard,\n * the Activity panel and `work restart`. Pure: the SPA imports it.\n */\n\n/** What a session waiting for its turn is told it will do. */\nexport const LATER_TEXT = 'restarts when its turn ends';\n\n/** \"2 sessions restarted · 1 restarts when its turn ends · 1 couldn't: <why>.\" */\nexport function restartCountsText(c: { restarted: number; later: number; failed: number; firstError?: string }): string {\n const parts: string[] = [];\n if (c.restarted) parts.push(`${c.restarted} session${c.restarted === 1 ? '' : 's'} restarted`);\n if (c.later) parts.push(`${c.later} ${c.later === 1 ? LATER_TEXT : 'restart when their turns end'}`);\n if (c.failed) parts.push(`${c.failed} couldn't${c.firstError ? `: ${c.firstError}` : ''}`);\n return parts.length ? `${parts.join(' · ')}.` : 'Nothing to restart.';\n}\n"],"mappings":";;;AAMO,IAAM,aAAa;AAGnB,SAAS,kBAAkB,GAAsF;AACtH,QAAM,QAAkB,CAAC;AACzB,MAAI,EAAE,UAAW,OAAM,KAAK,GAAG,EAAE,SAAS,WAAW,EAAE,cAAc,IAAI,KAAK,GAAG,YAAY;AAC7F,MAAI,EAAE,MAAO,OAAM,KAAK,GAAG,EAAE,KAAK,IAAI,EAAE,UAAU,IAAI,aAAa,8BAA8B,EAAE;AACnG,MAAI,EAAE,OAAQ,OAAM,KAAK,GAAG,EAAE,MAAM,YAAY,EAAE,aAAa,KAAK,EAAE,UAAU,KAAK,EAAE,EAAE;AACzF,SAAO,MAAM,SAAS,GAAG,MAAM,KAAK,QAAK,CAAC,MAAM;AAClD;","names":[]}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
isPersistedPty,
|
|
4
4
|
ptySessionsPath
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-MI3PS2SH.js";
|
|
6
6
|
import {
|
|
7
7
|
json,
|
|
8
8
|
tx,
|
|
@@ -73,4 +73,4 @@ export {
|
|
|
73
73
|
adoptLegacyRestoreList,
|
|
74
74
|
forgetPersistedSession
|
|
75
75
|
};
|
|
76
|
-
//# sourceMappingURL=chunk-
|
|
76
|
+
//# sourceMappingURL=chunk-U4UB4LG6.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/version.ts"],"sourcesContent":["declare const __WORK2_VERSION__: string;\n\n/**\n * Inlined at build time from package.json#version. When running via `tsx`\n * (dev mode) the define isn't applied, so we fall back to a placeholder.\n */\nexport const VERSION: string = typeof __WORK2_VERSION__ !== 'undefined' ? __WORK2_VERSION__ : 'dev';\n"],"mappings":";;;AAMO,IAAM,UAAkB,OAA2C,
|
|
1
|
+
{"version":3,"sources":["../src/version.ts"],"sourcesContent":["declare const __WORK2_VERSION__: string;\n\n/**\n * Inlined at build time from package.json#version. When running via `tsx`\n * (dev mode) the define isn't applied, so we fall back to a placeholder.\n */\nexport const VERSION: string = typeof __WORK2_VERSION__ !== 'undefined' ? __WORK2_VERSION__ : 'dev';\n"],"mappings":";;;AAMO,IAAM,UAAkB,OAA2C,UAAoB;","names":[]}
|
|
@@ -4,11 +4,11 @@ import {
|
|
|
4
4
|
} from "./chunk-AH5TM3NB.js";
|
|
5
5
|
import {
|
|
6
6
|
spawnSpecFor
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-KFSLF65S.js";
|
|
8
8
|
import {
|
|
9
9
|
PtyHostClient,
|
|
10
10
|
ensureHost
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-MI3PS2SH.js";
|
|
12
12
|
import {
|
|
13
13
|
sessionIdFor
|
|
14
14
|
} from "./chunk-RT4QZRTC.js";
|
|
@@ -117,4 +117,4 @@ async function attachSession(session, launch = {}) {
|
|
|
117
117
|
export {
|
|
118
118
|
attachSession
|
|
119
119
|
};
|
|
120
|
-
//# sourceMappingURL=chunk-
|
|
120
|
+
//# sourceMappingURL=chunk-XILMZRNS.js.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
runInternal
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-A3M5WTVC.js";
|
|
5
5
|
import {
|
|
6
6
|
messageOf,
|
|
7
7
|
readStatus
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-723C3D5X.js";
|
|
9
9
|
import {
|
|
10
10
|
agentOf,
|
|
11
11
|
lineTimeOf,
|
|
@@ -100,4 +100,4 @@ export {
|
|
|
100
100
|
cachedCatchUp,
|
|
101
101
|
catchUp
|
|
102
102
|
};
|
|
103
|
-
//# sourceMappingURL=chunk-
|
|
103
|
+
//# sourceMappingURL=chunk-YEEDWV4H.js.map
|
|
@@ -6,37 +6,37 @@ import {
|
|
|
6
6
|
deleteMergedBranches,
|
|
7
7
|
findMergedBranches,
|
|
8
8
|
scanBuildFolders
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-2QZ3RZOY.js";
|
|
10
10
|
import {
|
|
11
11
|
defaultCleanupDeps
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-S45H7N6X.js";
|
|
13
13
|
import {
|
|
14
14
|
timeAgo
|
|
15
15
|
} from "./chunk-UQ35KLHH.js";
|
|
16
|
-
import "./chunk-
|
|
17
|
-
import "./chunk-26IZBYVL.js";
|
|
16
|
+
import "./chunk-DXHZWRVE.js";
|
|
18
17
|
import {
|
|
19
18
|
applyCleanup,
|
|
20
19
|
scanCleanup
|
|
21
20
|
} from "./chunk-AKMPF72Y.js";
|
|
22
|
-
import "./chunk-
|
|
21
|
+
import "./chunk-26IZBYVL.js";
|
|
22
|
+
import "./chunk-6OG3W3PY.js";
|
|
23
23
|
import "./chunk-L6RUHCKB.js";
|
|
24
|
-
import "./chunk-
|
|
25
|
-
import "./chunk-
|
|
26
|
-
import "./chunk-
|
|
27
|
-
import "./chunk-
|
|
28
|
-
import "./chunk-
|
|
29
|
-
import "./chunk-
|
|
24
|
+
import "./chunk-KFSLF65S.js";
|
|
25
|
+
import "./chunk-U4UB4LG6.js";
|
|
26
|
+
import "./chunk-MI3PS2SH.js";
|
|
27
|
+
import "./chunk-4Y35ABCO.js";
|
|
28
|
+
import "./chunk-A3M5WTVC.js";
|
|
29
|
+
import "./chunk-POTGMLPV.js";
|
|
30
30
|
import "./chunk-JTHILJFB.js";
|
|
31
|
-
import "./chunk-
|
|
32
|
-
import "./chunk-
|
|
31
|
+
import "./chunk-3NPEMTQT.js";
|
|
32
|
+
import "./chunk-LCSWFGIM.js";
|
|
33
33
|
import "./chunk-ZSHWP2VS.js";
|
|
34
34
|
import "./chunk-E3Y4ZACK.js";
|
|
35
35
|
import "./chunk-HUXS3VAI.js";
|
|
36
36
|
import "./chunk-5PAPD6VT.js";
|
|
37
37
|
import "./chunk-4KZBZA5D.js";
|
|
38
38
|
import "./chunk-RKEY4573.js";
|
|
39
|
-
import "./chunk-
|
|
39
|
+
import "./chunk-723C3D5X.js";
|
|
40
40
|
import "./chunk-RQE5UOIW.js";
|
|
41
41
|
import "./chunk-RCYI7SRA.js";
|
|
42
42
|
import "./chunk-NEJVK5CF.js";
|
|
@@ -191,4 +191,4 @@ var cleanupCommand = {
|
|
|
191
191
|
export {
|
|
192
192
|
cleanupCommand
|
|
193
193
|
};
|
|
194
|
-
//# sourceMappingURL=cleanup-
|
|
194
|
+
//# sourceMappingURL=cleanup-YSVZAGJF.js.map
|
|
@@ -3,8 +3,8 @@ import {
|
|
|
3
3
|
COMMANDS,
|
|
4
4
|
commandsFor,
|
|
5
5
|
run
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-HY566NNR.js";
|
|
7
|
+
import "./chunk-UIZEMKED.js";
|
|
8
8
|
import "./chunk-JTHILJFB.js";
|
|
9
9
|
import "./chunk-RKEY4573.js";
|
|
10
10
|
import "./chunk-RCYI7SRA.js";
|
|
@@ -15,4 +15,4 @@ export {
|
|
|
15
15
|
commandsFor,
|
|
16
16
|
run
|
|
17
17
|
};
|
|
18
|
-
//# sourceMappingURL=cli-
|
|
18
|
+
//# sourceMappingURL=cli-XT4AS3M2.js.map
|
|
@@ -14,7 +14,7 @@ import "./chunk-5PAPD6VT.js";
|
|
|
14
14
|
import "./chunk-4KZBZA5D.js";
|
|
15
15
|
import {
|
|
16
16
|
loadHistory
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-723C3D5X.js";
|
|
18
18
|
import {
|
|
19
19
|
agentFor,
|
|
20
20
|
internalAgent
|
|
@@ -408,4 +408,4 @@ function showGroupHelp() {
|
|
|
408
408
|
export {
|
|
409
409
|
configCommand
|
|
410
410
|
};
|
|
411
|
-
//# sourceMappingURL=config-
|
|
411
|
+
//# sourceMappingURL=config-GQRUETZ6.js.map
|