@moberg_hr/work-tree 2.0.6 → 2.0.8
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-AX2VHEXS.js → answer-QQAEJ5N3.js} +4 -4
- package/dist/{attach-WLJVKXOJ.js → attach-XG3Y7QA7.js} +6 -6
- package/dist/bin.js +2 -2
- package/dist/{block-NZJC7GVM.js → block-WW4BWDN7.js} +5 -5
- package/dist/{broadcast-JPVHPQ6Y.js → broadcast-LEOMDVSA.js} +2 -2
- package/dist/{catchup-RUNKM6ZH.js → catchup-UBHGEMED.js} +7 -7
- package/dist/chunk-34QBYOHC.js +9 -0
- package/dist/{chunk-BSCAA322.js → chunk-4V7C3O6V.js} +22 -8
- package/dist/chunk-4V7C3O6V.js.map +1 -0
- package/dist/{chunk-46UD4QBL.js → chunk-5RRKVAIZ.js} +3 -2
- package/dist/chunk-5RRKVAIZ.js.map +1 -0
- package/dist/{chunk-EK3WRCQX.js → chunk-6AULWNAN.js} +3 -3
- package/dist/{chunk-UI5MPBIH.js → chunk-73J2ZJA6.js} +3 -3
- package/dist/{chunk-ES3KY6YT.js → chunk-7IZW6GLY.js} +2 -2
- package/dist/chunk-BLCAZAU5.js +334 -0
- package/dist/chunk-BLCAZAU5.js.map +1 -0
- package/dist/{chunk-G2O7EIKX.js → chunk-E72ETFAB.js} +2 -2
- package/dist/{chunk-7OUBCJVJ.js → chunk-E74YIDHX.js} +6 -6
- package/dist/{chunk-X5EMINGT.js → chunk-EN24GJCO.js} +4 -4
- package/dist/{chunk-5S3ORHTD.js → chunk-F3SPCHLH.js} +6 -6
- package/dist/{chunk-DUUH6FPH.js → chunk-G5PN5NIS.js} +28 -4
- package/dist/chunk-G5PN5NIS.js.map +1 -0
- package/dist/{chunk-65DPISNE.js → chunk-HLXEMPEI.js} +2 -2
- package/dist/{chunk-52IEEAYJ.js → chunk-I5HHTEAA.js} +4 -4
- package/dist/{chunk-CK2QC2UF.js → chunk-IC5PFQCV.js} +2 -2
- package/dist/{chunk-ED7E2WKK.js → chunk-JYWCNLZN.js} +2 -2
- package/dist/{chunk-LZHCTPBF.js → chunk-KLK6O54M.js} +3 -3
- package/dist/{chunk-FOG4WG3Y.js → chunk-LNMIG35F.js} +6 -2
- package/dist/chunk-LNMIG35F.js.map +1 -0
- package/dist/{chunk-67IZNVDI.js → chunk-LXM7QFBK.js} +2 -2
- package/dist/chunk-MFSKRN2J.js +78 -0
- package/dist/chunk-MFSKRN2J.js.map +1 -0
- package/dist/{chunk-HIXC67MU.js → chunk-MXZRFWC3.js} +3 -3
- package/dist/{chunk-KZQDONTU.js → chunk-NIRVJMJL.js} +12 -5
- package/dist/chunk-NIRVJMJL.js.map +1 -0
- package/dist/{chunk-HZEYGMYK.js → chunk-P2U6R35K.js} +3 -3
- package/dist/{chunk-ESPZRTUB.js → chunk-PG2MPTZD.js} +4 -4
- package/dist/{chunk-XHOQ7BWT.js → chunk-QQNI3K3V.js} +3 -3
- package/dist/{chunk-YCDULFF5.js → chunk-SIHAOB4F.js} +3 -3
- package/dist/{chunk-MODMK7WQ.js → chunk-ULQQ6SXT.js} +3 -3
- package/dist/{chunk-R7BXN427.js → chunk-UNLBHYA5.js} +2 -2
- package/dist/{chunk-XBNLSKTX.js → chunk-UZROMRQM.js} +3 -3
- package/dist/{chunk-UNPEZODB.js → chunk-V4RQ72HY.js} +28 -20
- package/dist/chunk-V4RQ72HY.js.map +1 -0
- package/dist/{chunk-QQJF4R6J.js → chunk-WB2BP2G5.js} +2 -2
- package/dist/{chunk-5653XPLJ.js → chunk-WOCS6MLE.js} +42 -42
- package/dist/{chunk-6GCF2XWP.js → chunk-WTR5BUGS.js} +20 -1
- package/dist/chunk-WTR5BUGS.js.map +1 -0
- package/dist/{chunk-WQMY4AJR.js → chunk-WUWED3LV.js} +2 -2
- package/dist/{chunk-N23HFT4X.js → chunk-YZSSYD2G.js} +244 -54
- package/dist/chunk-YZSSYD2G.js.map +1 -0
- package/dist/{cleanup-QLN3C3H5.js → cleanup-6LIZ3BQF.js} +16 -15
- package/dist/{cleanup-QLN3C3H5.js.map → cleanup-6LIZ3BQF.js.map} +1 -1
- package/dist/{cli-MIBNJRX6.js → cli-R3FITDNB.js} +3 -3
- package/dist/{config-TPYNBTVM.js → config-DULJPECI.js} +6 -6
- package/dist/{diff-IDF3K74H.js → diff-2PPFXZD6.js} +4 -4
- package/dist/{digest-AXSMYBYS.js → digest-5CRGAAK5.js} +4 -4
- package/dist/{fork-Y4PJNRUB.js → fork-FYEV4TU2.js} +15 -13
- package/dist/{fork-Y4PJNRUB.js.map → fork-FYEV4TU2.js.map} +1 -1
- package/dist/{hook-QMW5HHNP.js → hook-U37AFPKY.js} +4 -4
- package/dist/{hydrate-XMHHC5EG.js → hydrate-MAFHTY2W.js} +2 -2
- package/dist/{init-NGL64E3F.js → init-276XRZS2.js} +6 -6
- package/dist/{move-FFQR5TEI.js → move-QHCDO2R5.js} +14 -15
- package/dist/move-QHCDO2R5.js.map +1 -0
- package/dist/{note-C4RNIDRJ.js → note-TNC633NG.js} +4 -4
- package/dist/{overlaps-3LZXSDYZ.js → overlaps-SEK7H2YB.js} +5 -5
- package/dist/{pin-TJBCJGPQ.js → pin-E53PGMGD.js} +4 -4
- package/dist/{pr-JM4DRRIV.js → pr-JMMUGCKS.js} +5 -5
- package/dist/{prune-63N3QNDR.js → prune-MR37KLIW.js} +15 -14
- package/dist/{prune-63N3QNDR.js.map → prune-MR37KLIW.js.map} +1 -1
- package/dist/{pty-host-MQSUN6EI.js → pty-host-36Y4XSPP.js} +14 -7
- package/dist/pty-host-36Y4XSPP.js.map +1 -0
- package/dist/{read-NU4WZ3J5.js → read-ESOOJSBO.js} +4 -4
- package/dist/{recent-ZW4WDGCK.js → recent-3WYFF36X.js} +2 -2
- package/dist/{remove-ADWLTOFS.js → remove-5IZVMK4V.js} +14 -13
- package/dist/{remove-ADWLTOFS.js.map → remove-5IZVMK4V.js.map} +1 -1
- package/dist/{resume-SLNE75JO.js → resume-NDE6NKKT.js} +2 -2
- package/dist/{run-MD77Z2BV.js → run-UW4BJCSC.js} +2 -2
- package/dist/{screen-RCUGD52V.js → screen-5BLTXIKS.js} +4 -4
- package/dist/{search-5GK5HL4Y.js → search-MK6R5VR6.js} +2 -2
- package/dist/{section-OAMRNSO7.js → section-B4BWRY7K.js} +4 -4
- package/dist/{send-TT6U64HQ.js → send-OT3OXHHW.js} +5 -5
- package/dist/{sessions-CAOAXKKG.js → sessions-LHMTS6KT.js} +12 -10
- package/dist/{sessions-CAOAXKKG.js.map → sessions-LHMTS6KT.js.map} +1 -1
- package/dist/{snooze-DBJJD6ZM.js → snooze-A2BVEYWD.js} +4 -4
- package/dist/{start-2KUDSMBM.js → start-LEYVJWZG.js} +4 -4
- package/dist/{status-S3NZTRG3.js → status-AO653RKW.js} +2 -2
- package/dist/{stop-KJHXWYZ2.js → stop-QYIRUR5Y.js} +4 -4
- package/dist/{sync-EVPQVVWT.js → sync-SAZVBQIH.js} +15 -14
- package/dist/{sync-EVPQVVWT.js.map → sync-SAZVBQIH.js.map} +1 -1
- package/dist/{time-MWABXPA6.js → time-4V56YERF.js} +5 -5
- package/dist/{tree-O4VADOFG.js → tree-WFOG72Z3.js} +37 -6
- package/dist/tree-WFOG72Z3.js.map +1 -0
- package/dist/{update-K73WHYY3.js → update-NU5EMISM.js} +7 -7
- package/dist/{wait-JZIJB6P6.js → wait-FW7RARBV.js} +5 -5
- package/dist/wd-bin.js +2 -2
- package/dist/web/assets/PtyView-DQw8g-PN.js +90 -0
- package/dist/web/assets/PtyView-DQw8g-PN.js.map +1 -0
- package/dist/web/assets/index-CO_OtClq.js +118 -0
- package/dist/web/assets/index-CO_OtClq.js.map +1 -0
- package/dist/web/assets/index-D-_oxT3O.css +1 -0
- package/dist/web/index.html +2 -2
- package/dist/{web-GN2ATEXW.js → web-DTVGZZDZ.js} +199 -335
- package/dist/web-DTVGZZDZ.js.map +1 -0
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/dist/chunk-46UD4QBL.js.map +0 -1
- package/dist/chunk-6GCF2XWP.js.map +0 -1
- package/dist/chunk-BSCAA322.js.map +0 -1
- package/dist/chunk-DUUH6FPH.js.map +0 -1
- package/dist/chunk-FOG4WG3Y.js.map +0 -1
- package/dist/chunk-KZQDONTU.js.map +0 -1
- package/dist/chunk-MNZOOANK.js +0 -9
- package/dist/chunk-N23HFT4X.js.map +0 -1
- package/dist/chunk-UNPEZODB.js.map +0 -1
- package/dist/move-FFQR5TEI.js.map +0 -1
- package/dist/pty-host-MQSUN6EI.js.map +0 -1
- package/dist/tree-O4VADOFG.js.map +0 -1
- package/dist/web/assets/PtyView-DBMOq3Ro.js +0 -90
- package/dist/web/assets/PtyView-DBMOq3Ro.js.map +0 -1
- package/dist/web/assets/index-CV8NpZB8.css +0 -1
- package/dist/web/assets/index-DvFWtkAs.js +0 -117
- package/dist/web/assets/index-DvFWtkAs.js.map +0 -1
- package/dist/web-GN2ATEXW.js.map +0 -1
- /package/dist/{answer-AX2VHEXS.js.map → answer-QQAEJ5N3.js.map} +0 -0
- /package/dist/{attach-WLJVKXOJ.js.map → attach-XG3Y7QA7.js.map} +0 -0
- /package/dist/{block-NZJC7GVM.js.map → block-WW4BWDN7.js.map} +0 -0
- /package/dist/{broadcast-JPVHPQ6Y.js.map → broadcast-LEOMDVSA.js.map} +0 -0
- /package/dist/{catchup-RUNKM6ZH.js.map → catchup-UBHGEMED.js.map} +0 -0
- /package/dist/{chunk-MNZOOANK.js.map → chunk-34QBYOHC.js.map} +0 -0
- /package/dist/{chunk-EK3WRCQX.js.map → chunk-6AULWNAN.js.map} +0 -0
- /package/dist/{chunk-UI5MPBIH.js.map → chunk-73J2ZJA6.js.map} +0 -0
- /package/dist/{chunk-ES3KY6YT.js.map → chunk-7IZW6GLY.js.map} +0 -0
- /package/dist/{chunk-G2O7EIKX.js.map → chunk-E72ETFAB.js.map} +0 -0
- /package/dist/{chunk-7OUBCJVJ.js.map → chunk-E74YIDHX.js.map} +0 -0
- /package/dist/{chunk-X5EMINGT.js.map → chunk-EN24GJCO.js.map} +0 -0
- /package/dist/{chunk-5S3ORHTD.js.map → chunk-F3SPCHLH.js.map} +0 -0
- /package/dist/{chunk-65DPISNE.js.map → chunk-HLXEMPEI.js.map} +0 -0
- /package/dist/{chunk-52IEEAYJ.js.map → chunk-I5HHTEAA.js.map} +0 -0
- /package/dist/{chunk-CK2QC2UF.js.map → chunk-IC5PFQCV.js.map} +0 -0
- /package/dist/{chunk-ED7E2WKK.js.map → chunk-JYWCNLZN.js.map} +0 -0
- /package/dist/{chunk-LZHCTPBF.js.map → chunk-KLK6O54M.js.map} +0 -0
- /package/dist/{chunk-67IZNVDI.js.map → chunk-LXM7QFBK.js.map} +0 -0
- /package/dist/{chunk-HIXC67MU.js.map → chunk-MXZRFWC3.js.map} +0 -0
- /package/dist/{chunk-HZEYGMYK.js.map → chunk-P2U6R35K.js.map} +0 -0
- /package/dist/{chunk-ESPZRTUB.js.map → chunk-PG2MPTZD.js.map} +0 -0
- /package/dist/{chunk-XHOQ7BWT.js.map → chunk-QQNI3K3V.js.map} +0 -0
- /package/dist/{chunk-YCDULFF5.js.map → chunk-SIHAOB4F.js.map} +0 -0
- /package/dist/{chunk-MODMK7WQ.js.map → chunk-ULQQ6SXT.js.map} +0 -0
- /package/dist/{chunk-R7BXN427.js.map → chunk-UNLBHYA5.js.map} +0 -0
- /package/dist/{chunk-XBNLSKTX.js.map → chunk-UZROMRQM.js.map} +0 -0
- /package/dist/{chunk-QQJF4R6J.js.map → chunk-WB2BP2G5.js.map} +0 -0
- /package/dist/{chunk-5653XPLJ.js.map → chunk-WOCS6MLE.js.map} +0 -0
- /package/dist/{chunk-WQMY4AJR.js.map → chunk-WUWED3LV.js.map} +0 -0
- /package/dist/{cli-MIBNJRX6.js.map → cli-R3FITDNB.js.map} +0 -0
- /package/dist/{config-TPYNBTVM.js.map → config-DULJPECI.js.map} +0 -0
- /package/dist/{diff-IDF3K74H.js.map → diff-2PPFXZD6.js.map} +0 -0
- /package/dist/{digest-AXSMYBYS.js.map → digest-5CRGAAK5.js.map} +0 -0
- /package/dist/{hook-QMW5HHNP.js.map → hook-U37AFPKY.js.map} +0 -0
- /package/dist/{hydrate-XMHHC5EG.js.map → hydrate-MAFHTY2W.js.map} +0 -0
- /package/dist/{init-NGL64E3F.js.map → init-276XRZS2.js.map} +0 -0
- /package/dist/{note-C4RNIDRJ.js.map → note-TNC633NG.js.map} +0 -0
- /package/dist/{overlaps-3LZXSDYZ.js.map → overlaps-SEK7H2YB.js.map} +0 -0
- /package/dist/{pin-TJBCJGPQ.js.map → pin-E53PGMGD.js.map} +0 -0
- /package/dist/{pr-JM4DRRIV.js.map → pr-JMMUGCKS.js.map} +0 -0
- /package/dist/{read-NU4WZ3J5.js.map → read-ESOOJSBO.js.map} +0 -0
- /package/dist/{recent-ZW4WDGCK.js.map → recent-3WYFF36X.js.map} +0 -0
- /package/dist/{resume-SLNE75JO.js.map → resume-NDE6NKKT.js.map} +0 -0
- /package/dist/{run-MD77Z2BV.js.map → run-UW4BJCSC.js.map} +0 -0
- /package/dist/{screen-RCUGD52V.js.map → screen-5BLTXIKS.js.map} +0 -0
- /package/dist/{search-5GK5HL4Y.js.map → search-MK6R5VR6.js.map} +0 -0
- /package/dist/{section-OAMRNSO7.js.map → section-B4BWRY7K.js.map} +0 -0
- /package/dist/{send-TT6U64HQ.js.map → send-OT3OXHHW.js.map} +0 -0
- /package/dist/{snooze-DBJJD6ZM.js.map → snooze-A2BVEYWD.js.map} +0 -0
- /package/dist/{start-2KUDSMBM.js.map → start-LEYVJWZG.js.map} +0 -0
- /package/dist/{status-S3NZTRG3.js.map → status-AO653RKW.js.map} +0 -0
- /package/dist/{stop-KJHXWYZ2.js.map → stop-QYIRUR5Y.js.map} +0 -0
- /package/dist/{time-MWABXPA6.js.map → time-4V56YERF.js.map} +0 -0
- /package/dist/{update-K73WHYY3.js.map → update-NU5EMISM.js.map} +0 -0
- /package/dist/{wait-JZIJB6P6.js.map → wait-FW7RARBV.js.map} +0 -0
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
serveSpa,
|
|
12
12
|
sessionBaseForPath,
|
|
13
13
|
submitReviewSchema
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-73J2ZJA6.js";
|
|
15
15
|
import {
|
|
16
16
|
agentsBySession,
|
|
17
17
|
createBuildFoldersJob,
|
|
@@ -20,10 +20,10 @@ import {
|
|
|
20
20
|
deleteMergedBranches,
|
|
21
21
|
findMergedBranches,
|
|
22
22
|
summarizeAgents
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-F3SPCHLH.js";
|
|
24
24
|
import {
|
|
25
25
|
defaultCleanupDeps
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-E74YIDHX.js";
|
|
27
27
|
import {
|
|
28
28
|
addTask,
|
|
29
29
|
completeTask,
|
|
@@ -39,15 +39,15 @@ import {
|
|
|
39
39
|
reviewThreadsOf,
|
|
40
40
|
sessionWire,
|
|
41
41
|
stageSeenKey
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-NIRVJMJL.js";
|
|
43
43
|
import {
|
|
44
44
|
DiffStatCache,
|
|
45
45
|
findOverlaps,
|
|
46
46
|
wantsDiffStat
|
|
47
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-QQNI3K3V.js";
|
|
48
48
|
import {
|
|
49
49
|
createDigestSource
|
|
50
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-P2U6R35K.js";
|
|
51
51
|
import {
|
|
52
52
|
MAX_NOTE_CHARS,
|
|
53
53
|
readNote,
|
|
@@ -64,22 +64,27 @@ import {
|
|
|
64
64
|
removeBlocker,
|
|
65
65
|
sweepBlocks,
|
|
66
66
|
unblockedPrompt
|
|
67
|
-
} from "./chunk-
|
|
67
|
+
} from "./chunk-7IZW6GLY.js";
|
|
68
68
|
import {
|
|
69
69
|
jiraWorklogPoster,
|
|
70
70
|
logWorkDay,
|
|
71
71
|
loggedDays,
|
|
72
72
|
sessionWorkTime,
|
|
73
73
|
worklogSettings
|
|
74
|
-
} from "./chunk-
|
|
74
|
+
} from "./chunk-WB2BP2G5.js";
|
|
75
75
|
import {
|
|
76
76
|
sendToSession
|
|
77
77
|
} from "./chunk-RYNBBSLY.js";
|
|
78
|
+
import {
|
|
79
|
+
fetchAllPullRequests,
|
|
80
|
+
parsePrRef,
|
|
81
|
+
resolvePrToStart
|
|
82
|
+
} from "./chunk-BLCAZAU5.js";
|
|
78
83
|
import {
|
|
79
84
|
archiveMergedSession,
|
|
80
85
|
archiveWaiting,
|
|
81
86
|
defaultArchiveDeps
|
|
82
|
-
} from "./chunk-
|
|
87
|
+
} from "./chunk-V4RQ72HY.js";
|
|
83
88
|
import {
|
|
84
89
|
MAX_REPLY_CHARS,
|
|
85
90
|
THREAD_ID,
|
|
@@ -90,7 +95,7 @@ import {
|
|
|
90
95
|
postReply,
|
|
91
96
|
rememberSent,
|
|
92
97
|
saveDraft
|
|
93
|
-
} from "./chunk-
|
|
98
|
+
} from "./chunk-WTR5BUGS.js";
|
|
94
99
|
import {
|
|
95
100
|
cleanupVerdict,
|
|
96
101
|
createCleanupJob
|
|
@@ -99,12 +104,12 @@ import {
|
|
|
99
104
|
defaultForkDeps,
|
|
100
105
|
forkSession,
|
|
101
106
|
startSessionWithPrompt
|
|
102
|
-
} from "./chunk-
|
|
107
|
+
} from "./chunk-I5HHTEAA.js";
|
|
103
108
|
import {
|
|
104
109
|
createInChild,
|
|
105
110
|
createInProcess,
|
|
106
111
|
oneAtATime
|
|
107
|
-
} from "./chunk-
|
|
112
|
+
} from "./chunk-EN24GJCO.js";
|
|
108
113
|
import {
|
|
109
114
|
resolveWorkBinPath
|
|
110
115
|
} from "./chunk-AH5TM3NB.js";
|
|
@@ -112,7 +117,7 @@ import {
|
|
|
112
117
|
teardownWorktree,
|
|
113
118
|
toBaseSpec,
|
|
114
119
|
wouldRefuseRemoval
|
|
115
|
-
} from "./chunk-
|
|
120
|
+
} from "./chunk-YZSSYD2G.js";
|
|
116
121
|
import {
|
|
117
122
|
configurePtyPool,
|
|
118
123
|
detachPtyPool,
|
|
@@ -134,10 +139,13 @@ import {
|
|
|
134
139
|
subscribeSession,
|
|
135
140
|
syncPtyPool,
|
|
136
141
|
writeToPty
|
|
137
|
-
} from "./chunk-
|
|
142
|
+
} from "./chunk-KLK6O54M.js";
|
|
138
143
|
import {
|
|
139
144
|
dbPtySessions
|
|
140
145
|
} from "./chunk-BLLLVWEB.js";
|
|
146
|
+
import {
|
|
147
|
+
isWorktreeFolder
|
|
148
|
+
} from "./chunk-MFSKRN2J.js";
|
|
141
149
|
import "./chunk-G6IJ76DW.js";
|
|
142
150
|
import {
|
|
143
151
|
BehindCache,
|
|
@@ -154,28 +162,28 @@ import {
|
|
|
154
162
|
stackedOn,
|
|
155
163
|
updateFromBase,
|
|
156
164
|
updateFromMain
|
|
157
|
-
} from "./chunk-
|
|
165
|
+
} from "./chunk-PG2MPTZD.js";
|
|
158
166
|
import {
|
|
159
167
|
sessionStatusView,
|
|
160
168
|
shownState
|
|
161
|
-
} from "./chunk-
|
|
169
|
+
} from "./chunk-UNLBHYA5.js";
|
|
162
170
|
import {
|
|
163
171
|
askCatchUp,
|
|
164
172
|
cachedCatchUp,
|
|
165
173
|
catchUp,
|
|
166
174
|
catchUpFacts,
|
|
167
175
|
forgetCatchUp
|
|
168
|
-
} from "./chunk-
|
|
176
|
+
} from "./chunk-SIHAOB4F.js";
|
|
169
177
|
import {
|
|
170
178
|
runInternal,
|
|
171
179
|
summarizeCheckpoint,
|
|
172
180
|
throttleTrailing
|
|
173
|
-
} from "./chunk-
|
|
181
|
+
} from "./chunk-6AULWNAN.js";
|
|
174
182
|
import {
|
|
175
183
|
computeDiff,
|
|
176
184
|
computeRangeDiff,
|
|
177
185
|
parseGitDiff
|
|
178
|
-
} from "./chunk-
|
|
186
|
+
} from "./chunk-HLXEMPEI.js";
|
|
179
187
|
import {
|
|
180
188
|
applyPlacePatch,
|
|
181
189
|
applySectionOp,
|
|
@@ -190,7 +198,7 @@ import {
|
|
|
190
198
|
} from "./chunk-LNHSBM4L.js";
|
|
191
199
|
import {
|
|
192
200
|
VERSION
|
|
193
|
-
} from "./chunk-
|
|
201
|
+
} from "./chunk-34QBYOHC.js";
|
|
194
202
|
import {
|
|
195
203
|
resolveProjectTarget
|
|
196
204
|
} from "./chunk-H5LKMR45.js";
|
|
@@ -213,12 +221,12 @@ import {
|
|
|
213
221
|
CONTEXT_WARN,
|
|
214
222
|
describeView,
|
|
215
223
|
writeAssistantContext
|
|
216
|
-
} from "./chunk-
|
|
224
|
+
} from "./chunk-LXM7QFBK.js";
|
|
217
225
|
import {
|
|
218
226
|
NOTE_NUDGE,
|
|
219
227
|
findSessionForCwd,
|
|
220
228
|
readPendingForSession
|
|
221
|
-
} from "./chunk-
|
|
229
|
+
} from "./chunk-JYWCNLZN.js";
|
|
222
230
|
import "./chunk-ZSHWP2VS.js";
|
|
223
231
|
import {
|
|
224
232
|
getCommentFileStore
|
|
@@ -230,7 +238,7 @@ import {
|
|
|
230
238
|
checkTools,
|
|
231
239
|
saveFolders,
|
|
232
240
|
setupState
|
|
233
|
-
} from "./chunk-
|
|
241
|
+
} from "./chunk-MXZRFWC3.js";
|
|
234
242
|
import {
|
|
235
243
|
git
|
|
236
244
|
} from "./chunk-7NAXFBFI.js";
|
|
@@ -243,24 +251,22 @@ import {
|
|
|
243
251
|
saveGroup,
|
|
244
252
|
setRepoIgnored,
|
|
245
253
|
setScanRoot
|
|
246
|
-
} from "./chunk-
|
|
254
|
+
} from "./chunk-E72ETFAB.js";
|
|
247
255
|
import {
|
|
248
256
|
openUrl
|
|
249
257
|
} from "./chunk-5XMXZIJS.js";
|
|
250
258
|
import {
|
|
251
259
|
enrollProblem,
|
|
252
260
|
groupProblem,
|
|
253
|
-
originUrl,
|
|
254
|
-
ownerRepo,
|
|
255
261
|
suggestAlias
|
|
256
|
-
} from "./chunk-
|
|
257
|
-
import "./chunk-
|
|
262
|
+
} from "./chunk-4V7C3O6V.js";
|
|
263
|
+
import "./chunk-LNMIG35F.js";
|
|
258
264
|
import {
|
|
259
265
|
defaultRunner,
|
|
260
266
|
mergeSelected,
|
|
261
267
|
runShipAction,
|
|
262
268
|
shipPreflight
|
|
263
|
-
} from "./chunk-
|
|
269
|
+
} from "./chunk-5RRKVAIZ.js";
|
|
264
270
|
import {
|
|
265
271
|
DECISION_MARKER,
|
|
266
272
|
STAGE_WANTS_YOU,
|
|
@@ -335,7 +341,7 @@ import {
|
|
|
335
341
|
turnInProgress,
|
|
336
342
|
updateCheckpoint,
|
|
337
343
|
writeArchiveRecord
|
|
338
|
-
} from "./chunk-
|
|
344
|
+
} from "./chunk-G5PN5NIS.js";
|
|
339
345
|
import {
|
|
340
346
|
json,
|
|
341
347
|
pendingMigration,
|
|
@@ -373,7 +379,7 @@ import {
|
|
|
373
379
|
import chalk from "chalk";
|
|
374
380
|
|
|
375
381
|
// src/server/web-server.ts
|
|
376
|
-
import
|
|
382
|
+
import fs10 from "fs";
|
|
377
383
|
|
|
378
384
|
// src/server/routes/session-control-routes.ts
|
|
379
385
|
function realDeps(app) {
|
|
@@ -1735,7 +1741,7 @@ function describeStall(s) {
|
|
|
1735
1741
|
}
|
|
1736
1742
|
|
|
1737
1743
|
// src/server/web-server.ts
|
|
1738
|
-
import
|
|
1744
|
+
import path13 from "path";
|
|
1739
1745
|
import { Hono } from "hono";
|
|
1740
1746
|
import { streamSSE as streamSSE2 } from "hono/streaming";
|
|
1741
1747
|
|
|
@@ -1862,226 +1868,6 @@ function checkBranch(target, branch, config, deps = realBranchCheckDeps) {
|
|
|
1862
1868
|
};
|
|
1863
1869
|
}
|
|
1864
1870
|
|
|
1865
|
-
// src/core/pr/pr.ts
|
|
1866
|
-
import { execFile as execFile2 } from "child_process";
|
|
1867
|
-
import fs3 from "fs";
|
|
1868
|
-
import path4 from "path";
|
|
1869
|
-
function execAsync2(cmd, args, cwd, timeout) {
|
|
1870
|
-
return new Promise((resolve, reject) => {
|
|
1871
|
-
execFile2(cmd, args, { cwd, encoding: "utf-8", timeout, windowsHide: true }, (err, stdout) => {
|
|
1872
|
-
if (err) reject(err);
|
|
1873
|
-
else resolve(stdout ?? "");
|
|
1874
|
-
});
|
|
1875
|
-
});
|
|
1876
|
-
}
|
|
1877
|
-
function parsePrJson(stdout, repoAlias, currentUser) {
|
|
1878
|
-
const parsed = JSON.parse(stdout);
|
|
1879
|
-
const prs = Array.isArray(parsed) ? parsed : [];
|
|
1880
|
-
return prs.map((pr) => toPrInfo(pr, repoAlias, currentUser));
|
|
1881
|
-
}
|
|
1882
|
-
function toPrInfo(pr, repoAlias, currentUser) {
|
|
1883
|
-
{
|
|
1884
|
-
let checksStatus = "NONE";
|
|
1885
|
-
const checks = pr.statusCheckRollup ?? [];
|
|
1886
|
-
if (checks.length > 0) {
|
|
1887
|
-
const hasFailure = checks.some((c) => c.conclusion === "FAILURE" || c.conclusion === "TIMED_OUT" || c.conclusion === "CANCELLED");
|
|
1888
|
-
const hasPending = checks.some((c) => c.status === "IN_PROGRESS" || c.status === "QUEUED" || c.status === "PENDING");
|
|
1889
|
-
if (hasFailure) checksStatus = "FAILURE";
|
|
1890
|
-
else if (hasPending) checksStatus = "PENDING";
|
|
1891
|
-
else checksStatus = "SUCCESS";
|
|
1892
|
-
}
|
|
1893
|
-
let reviewDecision = "NONE";
|
|
1894
|
-
if (pr.reviewDecision === "APPROVED") reviewDecision = "APPROVED";
|
|
1895
|
-
else if (pr.reviewDecision === "CHANGES_REQUESTED") reviewDecision = "CHANGES_REQUESTED";
|
|
1896
|
-
else if (pr.reviewDecision === "REVIEW_REQUIRED") reviewDecision = "REVIEW_REQUIRED";
|
|
1897
|
-
let myReview = "NONE";
|
|
1898
|
-
if (currentUser) {
|
|
1899
|
-
const reviews = pr.reviews ?? [];
|
|
1900
|
-
for (let i = reviews.length - 1; i >= 0; i--) {
|
|
1901
|
-
if (reviews[i].author?.login?.toLowerCase() === currentUser.toLowerCase()) {
|
|
1902
|
-
const state = reviews[i].state;
|
|
1903
|
-
if (state === "APPROVED") myReview = "APPROVED";
|
|
1904
|
-
else if (state === "CHANGES_REQUESTED") myReview = "CHANGES_REQUESTED";
|
|
1905
|
-
else if (state === "COMMENTED") myReview = "COMMENTED";
|
|
1906
|
-
break;
|
|
1907
|
-
}
|
|
1908
|
-
}
|
|
1909
|
-
}
|
|
1910
|
-
return {
|
|
1911
|
-
number: pr.number ?? 0,
|
|
1912
|
-
title: pr.title ?? "",
|
|
1913
|
-
branch: pr.headRefName ?? "",
|
|
1914
|
-
url: pr.url ?? "",
|
|
1915
|
-
isDraft: pr.isDraft ?? false,
|
|
1916
|
-
checksStatus,
|
|
1917
|
-
reviewDecision,
|
|
1918
|
-
myReview,
|
|
1919
|
-
isMine: currentUser ? pr.author?.login?.toLowerCase() === currentUser.toLowerCase() : false,
|
|
1920
|
-
conflicting: pr.mergeable === "CONFLICTING",
|
|
1921
|
-
reviewRequested: !!currentUser && (pr.reviewRequests ?? []).some((r) => r?.login?.toLowerCase() === currentUser.toLowerCase()),
|
|
1922
|
-
repoAlias
|
|
1923
|
-
};
|
|
1924
|
-
}
|
|
1925
|
-
}
|
|
1926
|
-
var PR_SEARCH_QUERY = `query($mine: String!, $asked: String!) {
|
|
1927
|
-
viewer { login }
|
|
1928
|
-
mine: search(query: $mine, type: ISSUE, first: 100) { issueCount nodes { ...pr } }
|
|
1929
|
-
asked: search(query: $asked, type: ISSUE, first: 100) { issueCount nodes { ...pr } }
|
|
1930
|
-
}
|
|
1931
|
-
fragment pr on PullRequest {
|
|
1932
|
-
number title url isDraft headRefName mergeable reviewDecision
|
|
1933
|
-
author { login }
|
|
1934
|
-
repository { nameWithOwner }
|
|
1935
|
-
commits(last: 1) { nodes { commit { statusCheckRollup { state } } } }
|
|
1936
|
-
reviewRequests(first: 20) { nodes { requestedReviewer { ... on User { login } } } }
|
|
1937
|
-
latestReviews(first: 20) { nodes { author { login } state } }
|
|
1938
|
-
}`;
|
|
1939
|
-
var PR_SEARCH_VARS = {
|
|
1940
|
-
mine: "is:pr is:open archived:false author:@me",
|
|
1941
|
-
asked: "is:pr is:open archived:false review-requested:@me"
|
|
1942
|
-
};
|
|
1943
|
-
function rollupAsChecks(state) {
|
|
1944
|
-
if (state === "FAILURE" || state === "ERROR") return [{ conclusion: "FAILURE", status: "COMPLETED" }];
|
|
1945
|
-
if (state === "PENDING" || state === "EXPECTED") return [{ conclusion: null, status: "PENDING" }];
|
|
1946
|
-
if (state === "SUCCESS") return [{ conclusion: "SUCCESS", status: "COMPLETED" }];
|
|
1947
|
-
return [];
|
|
1948
|
-
}
|
|
1949
|
-
function parsePrSearch(stdout, aliasesOf) {
|
|
1950
|
-
const data = JSON.parse(stdout)?.data ?? {};
|
|
1951
|
-
const user = (data.viewer?.login ?? "").trim();
|
|
1952
|
-
const seen = /* @__PURE__ */ new Set();
|
|
1953
|
-
const prs = [];
|
|
1954
|
-
let incomplete = false;
|
|
1955
|
-
for (const key of ["mine", "asked"]) {
|
|
1956
|
-
const result = data[key];
|
|
1957
|
-
const nodes = (result?.nodes ?? []).filter((n) => !!n && typeof n.number === "number");
|
|
1958
|
-
if ((result?.issueCount ?? 0) > nodes.length) incomplete = true;
|
|
1959
|
-
for (const n of nodes) {
|
|
1960
|
-
const pr = {
|
|
1961
|
-
...n,
|
|
1962
|
-
statusCheckRollup: rollupAsChecks(n.commits?.nodes?.[0]?.commit?.statusCheckRollup?.state),
|
|
1963
|
-
reviews: (n.latestReviews?.nodes ?? []).filter((r) => !!r),
|
|
1964
|
-
reviewRequests: (n.reviewRequests?.nodes ?? []).map((r) => r?.requestedReviewer ?? null)
|
|
1965
|
-
};
|
|
1966
|
-
for (const alias of aliasesOf(n.repository?.nameWithOwner ?? "")) {
|
|
1967
|
-
const id = `${alias}#${n.number}`;
|
|
1968
|
-
if (seen.has(id)) continue;
|
|
1969
|
-
seen.add(id);
|
|
1970
|
-
prs.push(toPrInfo(pr, alias, user));
|
|
1971
|
-
}
|
|
1972
|
-
}
|
|
1973
|
-
}
|
|
1974
|
-
return { prs, incomplete };
|
|
1975
|
-
}
|
|
1976
|
-
function readSearch(stdout, aliasesOf) {
|
|
1977
|
-
try {
|
|
1978
|
-
return parsePrSearch(stdout, aliasesOf);
|
|
1979
|
-
} catch {
|
|
1980
|
-
return null;
|
|
1981
|
-
}
|
|
1982
|
-
}
|
|
1983
|
-
function githubRepoOf(configText) {
|
|
1984
|
-
const url = originUrl(configText);
|
|
1985
|
-
if (!url || !/(^|[@/.])github\.com[:/]/i.test(url)) return null;
|
|
1986
|
-
return ownerRepo(url)?.toLowerCase() ?? null;
|
|
1987
|
-
}
|
|
1988
|
-
var PR_LIST_LIMIT = 100;
|
|
1989
|
-
async function fetchPullRequests(repoPath, repoAlias, currentUser) {
|
|
1990
|
-
try {
|
|
1991
|
-
const stdout = await execAsync2(
|
|
1992
|
-
"gh",
|
|
1993
|
-
[
|
|
1994
|
-
"pr",
|
|
1995
|
-
"list",
|
|
1996
|
-
"--state",
|
|
1997
|
-
"open",
|
|
1998
|
-
"--json",
|
|
1999
|
-
"number,title,headRefName,url,isDraft,statusCheckRollup,reviewDecision,reviews,reviewRequests,mergeable,author",
|
|
2000
|
-
"--limit",
|
|
2001
|
-
String(PR_LIST_LIMIT)
|
|
2002
|
-
],
|
|
2003
|
-
repoPath,
|
|
2004
|
-
15e3
|
|
2005
|
-
);
|
|
2006
|
-
if (!stdout) return [];
|
|
2007
|
-
return parsePrJson(stdout, repoAlias, currentUser);
|
|
2008
|
-
} catch {
|
|
2009
|
-
return null;
|
|
2010
|
-
}
|
|
2011
|
-
}
|
|
2012
|
-
async function getCurrentUser() {
|
|
2013
|
-
try {
|
|
2014
|
-
const stdout = await execAsync2("gh", ["api", "user", "--jq", ".login"], process.cwd(), 5e3);
|
|
2015
|
-
return stdout.trim();
|
|
2016
|
-
} catch {
|
|
2017
|
-
return "";
|
|
2018
|
-
}
|
|
2019
|
-
}
|
|
2020
|
-
function defaultPrListDeps() {
|
|
2021
|
-
let user = null;
|
|
2022
|
-
return {
|
|
2023
|
-
search: async () => {
|
|
2024
|
-
try {
|
|
2025
|
-
return await execAsync2(
|
|
2026
|
-
"gh",
|
|
2027
|
-
["api", "graphql", "-f", `query=${PR_SEARCH_QUERY}`, "-f", `mine=${PR_SEARCH_VARS.mine}`, "-f", `asked=${PR_SEARCH_VARS.asked}`],
|
|
2028
|
-
process.cwd(),
|
|
2029
|
-
2e4
|
|
2030
|
-
);
|
|
2031
|
-
} catch {
|
|
2032
|
-
return null;
|
|
2033
|
-
}
|
|
2034
|
-
},
|
|
2035
|
-
listRepo: async (repoPath, alias) => fetchPullRequests(repoPath, alias, await (user ??= getCurrentUser())),
|
|
2036
|
-
gitConfig: (repoPath) => {
|
|
2037
|
-
try {
|
|
2038
|
-
return fs3.readFileSync(path4.join(repoPath, ".git", "config"), "utf-8");
|
|
2039
|
-
} catch {
|
|
2040
|
-
return null;
|
|
2041
|
-
}
|
|
2042
|
-
}
|
|
2043
|
-
};
|
|
2044
|
-
}
|
|
2045
|
-
async function fetchAllPullRequests(repos, deps = defaultPrListDeps()) {
|
|
2046
|
-
const entries = Object.entries(repos);
|
|
2047
|
-
const onGithub = /* @__PURE__ */ new Map();
|
|
2048
|
-
const elsewhere = [];
|
|
2049
|
-
for (const [alias, repoPath] of entries) {
|
|
2050
|
-
const text = deps.gitConfig(repoPath);
|
|
2051
|
-
const gh = text ? githubRepoOf(text) : null;
|
|
2052
|
-
if (gh) onGithub.set(gh, [...onGithub.get(gh) ?? [], alias]);
|
|
2053
|
-
else elsewhere.push([alias, repoPath]);
|
|
2054
|
-
}
|
|
2055
|
-
const results = [];
|
|
2056
|
-
const incomplete = [];
|
|
2057
|
-
if (onGithub.size) {
|
|
2058
|
-
const out = await deps.search();
|
|
2059
|
-
const parsed = out ? readSearch(out, (repo) => onGithub.get(repo.toLowerCase()) ?? []) : null;
|
|
2060
|
-
if (parsed) {
|
|
2061
|
-
results.push(parsed.prs);
|
|
2062
|
-
if (parsed.incomplete) incomplete.push(...[...onGithub.values()].flat());
|
|
2063
|
-
} else {
|
|
2064
|
-
const asked = new Set(elsewhere.map(([a]) => a));
|
|
2065
|
-
for (const [alias, repoPath] of entries) if (!asked.has(alias)) elsewhere.push([alias, repoPath]);
|
|
2066
|
-
}
|
|
2067
|
-
}
|
|
2068
|
-
const listed = await Promise.all(elsewhere.map(([alias, repoPath]) => deps.listRepo(repoPath, alias)));
|
|
2069
|
-
results.push(...listed);
|
|
2070
|
-
incomplete.push(...elsewhere.filter((_, i) => listed[i] === null || listed[i].length >= PR_LIST_LIMIT).map(([alias]) => alias));
|
|
2071
|
-
const map = /* @__PURE__ */ new Map();
|
|
2072
|
-
for (const prList of results) {
|
|
2073
|
-
for (const pr of prList ?? []) {
|
|
2074
|
-
const existing = map.get(pr.branch);
|
|
2075
|
-
if (existing) {
|
|
2076
|
-
existing.push(pr);
|
|
2077
|
-
} else {
|
|
2078
|
-
map.set(pr.branch, [pr]);
|
|
2079
|
-
}
|
|
2080
|
-
}
|
|
2081
|
-
}
|
|
2082
|
-
return { map, incomplete };
|
|
2083
|
-
}
|
|
2084
|
-
|
|
2085
1871
|
// src/server/shared-fetch.ts
|
|
2086
1872
|
function createSharedFetch(fetch2, ttlMs, now = Date.now) {
|
|
2087
1873
|
let last = null;
|
|
@@ -2245,8 +2031,8 @@ function mountPanesRoutes(app, opts) {
|
|
|
2245
2031
|
}
|
|
2246
2032
|
|
|
2247
2033
|
// src/server/routes/worktree-routes.ts
|
|
2248
|
-
import
|
|
2249
|
-
import
|
|
2034
|
+
import fs3 from "fs";
|
|
2035
|
+
import path4 from "path";
|
|
2250
2036
|
import { spawn } from "child_process";
|
|
2251
2037
|
import crossSpawn2 from "cross-spawn";
|
|
2252
2038
|
import { zValidator as zValidator4 } from "@hono/zod-validator";
|
|
@@ -2265,6 +2051,12 @@ function mountWorktreeRoutes(app, opts) {
|
|
|
2265
2051
|
});
|
|
2266
2052
|
const startSession = opts.startSession ?? startSessionWithPrompt;
|
|
2267
2053
|
const create = opts.create ?? createInProcess;
|
|
2054
|
+
const resolvePr = opts.resolvePr ?? ((ref, target) => resolvePrToStart(ref, loadConfig() ?? { repos: {}, groups: {} }, target));
|
|
2055
|
+
app.get("/api/pr-start", async (c) => {
|
|
2056
|
+
const ref = c.req.query("ref") ?? "";
|
|
2057
|
+
const r = await resolvePr(ref, c.req.query("target") || void 0);
|
|
2058
|
+
return r.ok ? c.json({ pr: r.pr }) : c.json({ error: r.error }, 400);
|
|
2059
|
+
});
|
|
2268
2060
|
app.post("/api/worktrees", zValidator4("json", createSchema), async (c) => {
|
|
2269
2061
|
const { target, base, jiraKey, prompt, name } = c.req.valid("json");
|
|
2270
2062
|
const config = loadConfig();
|
|
@@ -2335,7 +2127,7 @@ function mountWorktreeRoutes(app, opts) {
|
|
|
2335
2127
|
if (waiting.length) return { body: { error: `Not deleted: ${waiting.join("; ")}.`, blocked: waiting }, status: 409 };
|
|
2336
2128
|
}
|
|
2337
2129
|
try {
|
|
2338
|
-
const onDisk = session.paths.some((p) =>
|
|
2130
|
+
const onDisk = session.paths.some((p) => fs3.existsSync(p));
|
|
2339
2131
|
if (!sessionOnly && onDisk && session.paths.some((p) => wouldRefuseRemoval(p, force ?? false))) {
|
|
2340
2132
|
return { body: { error: REFUSED }, status: 409 };
|
|
2341
2133
|
}
|
|
@@ -2397,7 +2189,7 @@ function mountWorktreeRoutes(app, opts) {
|
|
|
2397
2189
|
const id = c.req.param("id");
|
|
2398
2190
|
const session = findSession2(id);
|
|
2399
2191
|
if (!session) return c.json({ error: "unknown session" }, 404);
|
|
2400
|
-
const target = session.isGroup ?
|
|
2192
|
+
const target = session.isGroup ? path4.dirname(session.paths[0]) : session.paths[0];
|
|
2401
2193
|
const editor = loadConfig()?.editor?.trim() || "code";
|
|
2402
2194
|
const failed = await new Promise((resolve) => {
|
|
2403
2195
|
try {
|
|
@@ -2451,7 +2243,7 @@ function mountWorktreeRoutes(app, opts) {
|
|
|
2451
2243
|
import { zValidator as zValidator5 } from "@hono/zod-validator";
|
|
2452
2244
|
import { z as z4 } from "zod";
|
|
2453
2245
|
import { EventEmitter } from "events";
|
|
2454
|
-
import
|
|
2246
|
+
import path5 from "path";
|
|
2455
2247
|
import { streamSSE } from "hono/streaming";
|
|
2456
2248
|
function mountScopeRoutes(app, opts) {
|
|
2457
2249
|
const checkpointWatched = /* @__PURE__ */ new Set();
|
|
@@ -2691,7 +2483,7 @@ function mountScopeRoutes(app, opts) {
|
|
|
2691
2483
|
const fromSha = fromEntry.repos[p] ?? "HEAD";
|
|
2692
2484
|
const toSha = toEntry === void 0 ? "working" : toEntry.repos[p] ?? "HEAD";
|
|
2693
2485
|
return {
|
|
2694
|
-
name:
|
|
2486
|
+
name: path5.basename(p),
|
|
2695
2487
|
root: p,
|
|
2696
2488
|
files: computeRangeDiff({ root: p, fromRef: fromSha, toRef: toSha })
|
|
2697
2489
|
};
|
|
@@ -2708,7 +2500,7 @@ function mountScopeRoutes(app, opts) {
|
|
|
2708
2500
|
}
|
|
2709
2501
|
const resolved = scope.paths.map((p) => resolveRepoDiff(p, base, sessionBaseForPath(p)));
|
|
2710
2502
|
const repos = scope.paths.map((p, i) => ({
|
|
2711
|
-
name:
|
|
2503
|
+
name: path5.basename(p),
|
|
2712
2504
|
root: p,
|
|
2713
2505
|
resolvedBase: resolved[i].resolvedBase,
|
|
2714
2506
|
files: computeDiff({ root: p, diffArg: resolved[i].diffArg })
|
|
@@ -2739,7 +2531,7 @@ function mountScopeRoutes(app, opts) {
|
|
|
2739
2531
|
if (!relPath || !Number.isInteger(start) || !Number.isInteger(end)) {
|
|
2740
2532
|
return c.json({ error: "bad path/start/end" }, 400);
|
|
2741
2533
|
}
|
|
2742
|
-
const root = scope.paths.length === 1 ? scope.paths[0] : scope.paths.find((p) =>
|
|
2534
|
+
const root = scope.paths.length === 1 ? scope.paths[0] : scope.paths.find((p) => path5.basename(p) === repoName);
|
|
2743
2535
|
if (!root) return c.json({ error: "unknown repo" }, 404);
|
|
2744
2536
|
const result = readContextLines({ root, relPath, start, end, ref });
|
|
2745
2537
|
if (!result) return c.json({ error: "cannot read file" }, 400);
|
|
@@ -2923,7 +2715,7 @@ function mountTerminalRoutes(app) {
|
|
|
2923
2715
|
}
|
|
2924
2716
|
|
|
2925
2717
|
// src/server/routes/status-routes.ts
|
|
2926
|
-
import
|
|
2718
|
+
import path6 from "path";
|
|
2927
2719
|
|
|
2928
2720
|
// src/core/pr/pr-watch-store.ts
|
|
2929
2721
|
function createSeenStores() {
|
|
@@ -3079,7 +2871,7 @@ function mountStatusRoutes(app, opts) {
|
|
|
3079
2871
|
const kind = notifyKindForTransition(status.prevState ? { state: status.prevState } : null, status);
|
|
3080
2872
|
if (kind) {
|
|
3081
2873
|
const config = loadConfig();
|
|
3082
|
-
const launchDir = session.isGroup && session.paths[0] ?
|
|
2874
|
+
const launchDir = session.isGroup && session.paths[0] ? path6.dirname(session.paths[0]) : session.paths[0] ?? body.cwd;
|
|
3083
2875
|
const name = `${session.target} \xB7 ${session.branch}`;
|
|
3084
2876
|
const snooze = readSnooze(id);
|
|
3085
2877
|
const route = snooze?.until && snoozeActive(snooze, { attention: status }) ? "none" : presence.route(id);
|
|
@@ -3176,7 +2968,6 @@ function mountStatusRoutes(app, opts) {
|
|
|
3176
2968
|
}
|
|
3177
2969
|
|
|
3178
2970
|
// src/server/routes/ship-routes.ts
|
|
3179
|
-
import fs5 from "fs";
|
|
3180
2971
|
var ACTIONS = /* @__PURE__ */ new Set(["push", "create-pr", "merge"]);
|
|
3181
2972
|
var METHODS = /* @__PURE__ */ new Set(["squash", "merge", "rebase"]);
|
|
3182
2973
|
function mountShipRoutes(app, opts) {
|
|
@@ -3188,9 +2979,12 @@ function mountShipRoutes(app, opts) {
|
|
|
3188
2979
|
const out = await archiveSession(session, defaultArchiveDeps({ release: opts.release }), { force, merged });
|
|
3189
2980
|
if (out.blocked) return { ok: false, blocked: out.blocked, message: out.message };
|
|
3190
2981
|
ok = out.ok;
|
|
3191
|
-
} else if (session.paths.some((p) => !
|
|
2982
|
+
} else if (session.paths.some((p) => !isWorktreeFolder(p))) {
|
|
3192
2983
|
const config = loadConfig();
|
|
3193
|
-
|
|
2984
|
+
if (!config) return { ok: false, error: "no config" };
|
|
2985
|
+
const made = await (opts.create ?? createInProcess)({ target: session.target, branch: session.branch }, config);
|
|
2986
|
+
if (!made.ok) return { ok: false, error: `Couldn't restore it: ${made.error}` };
|
|
2987
|
+
ok = true;
|
|
3194
2988
|
} else {
|
|
3195
2989
|
restoreArchivedTranscripts(session);
|
|
3196
2990
|
ok = await setSessionArchived(session.target, session.branch, false);
|
|
@@ -3249,6 +3043,7 @@ function mountShipRoutes(app, opts) {
|
|
|
3249
3043
|
if (typeof body.archived !== "boolean") return c.json({ error: "archived (boolean) required" }, 400);
|
|
3250
3044
|
const r = await archive(c.req.param("id"), body.archived, body.force === true);
|
|
3251
3045
|
if (r.blocked) return c.json({ error: r.message, blocked: r.blocked }, 409);
|
|
3046
|
+
if (r.error) return c.json({ error: r.error }, 500);
|
|
3252
3047
|
return r.ok ? c.json({ ok: true }) : c.json({ error: "unknown session" }, 404);
|
|
3253
3048
|
});
|
|
3254
3049
|
}
|
|
@@ -3343,9 +3138,9 @@ function mountRailRoutes(app, opts) {
|
|
|
3343
3138
|
}
|
|
3344
3139
|
|
|
3345
3140
|
// src/core/worktree/shared-folders.ts
|
|
3346
|
-
import
|
|
3347
|
-
import
|
|
3348
|
-
var norm = (p) =>
|
|
3141
|
+
import fs4 from "fs";
|
|
3142
|
+
import path7 from "path";
|
|
3143
|
+
var norm = (p) => path7.resolve(p).replace(/\\/g, "/").toLowerCase();
|
|
3349
3144
|
function shadowedSessions(sessions, branchCheckedOut2) {
|
|
3350
3145
|
const byFolder = /* @__PURE__ */ new Map();
|
|
3351
3146
|
for (const s of sessions) {
|
|
@@ -3364,14 +3159,14 @@ function shadowedSessions(sessions, branchCheckedOut2) {
|
|
|
3364
3159
|
}
|
|
3365
3160
|
function branchCheckedOut(dir) {
|
|
3366
3161
|
try {
|
|
3367
|
-
const dotGit =
|
|
3162
|
+
const dotGit = path7.join(dir, ".git");
|
|
3368
3163
|
let gitDir = dotGit;
|
|
3369
|
-
if (
|
|
3370
|
-
const m = /^gitdir:\s*(.+)$/m.exec(
|
|
3164
|
+
if (fs4.statSync(dotGit).isFile()) {
|
|
3165
|
+
const m = /^gitdir:\s*(.+)$/m.exec(fs4.readFileSync(dotGit, "utf8"));
|
|
3371
3166
|
if (!m) return null;
|
|
3372
|
-
gitDir =
|
|
3167
|
+
gitDir = path7.resolve(dir, m[1].trim());
|
|
3373
3168
|
}
|
|
3374
|
-
const head =
|
|
3169
|
+
const head = fs4.readFileSync(path7.join(gitDir, "HEAD"), "utf8");
|
|
3375
3170
|
const ref = /^ref:\s*refs\/heads\/(.+)$/m.exec(head);
|
|
3376
3171
|
return ref ? ref[1].trim() : null;
|
|
3377
3172
|
} catch {
|
|
@@ -3380,14 +3175,14 @@ function branchCheckedOut(dir) {
|
|
|
3380
3175
|
}
|
|
3381
3176
|
|
|
3382
3177
|
// src/core/platform/build-stamp.ts
|
|
3383
|
-
import
|
|
3178
|
+
import fs5 from "fs";
|
|
3384
3179
|
var cached = null;
|
|
3385
3180
|
function buildStamp() {
|
|
3386
3181
|
if (cached) return cached;
|
|
3387
3182
|
const forced = process.env.WORK_BUILD_STAMP;
|
|
3388
3183
|
if (forced) return cached = forced;
|
|
3389
3184
|
try {
|
|
3390
|
-
cached = String(Math.floor(
|
|
3185
|
+
cached = String(Math.floor(fs5.statSync(process.argv[1]).mtimeMs));
|
|
3391
3186
|
} catch {
|
|
3392
3187
|
cached = "unknown";
|
|
3393
3188
|
}
|
|
@@ -3684,8 +3479,8 @@ function mountPrReplyRoutes(app, opts) {
|
|
|
3684
3479
|
}
|
|
3685
3480
|
|
|
3686
3481
|
// src/core/archive/archive-retention.ts
|
|
3687
|
-
import
|
|
3688
|
-
import
|
|
3482
|
+
import fs6 from "fs";
|
|
3483
|
+
import path8 from "path";
|
|
3689
3484
|
import zlib from "zlib";
|
|
3690
3485
|
var DEFAULT_COMPRESS_AFTER_DAYS = 30;
|
|
3691
3486
|
var DAY_MS = 24 * 36e5;
|
|
@@ -3697,19 +3492,26 @@ function applyArchiveRetention(opts) {
|
|
|
3697
3492
|
const out = { compressed: [], dropped: [], bytesSaved: 0 };
|
|
3698
3493
|
let ids;
|
|
3699
3494
|
try {
|
|
3700
|
-
ids =
|
|
3495
|
+
ids = fs6.readdirSync(root, { withFileTypes: true }).filter((d) => d.isDirectory()).map((d) => d.name);
|
|
3701
3496
|
} catch {
|
|
3702
3497
|
return out;
|
|
3703
3498
|
}
|
|
3704
3499
|
for (const id of ids) {
|
|
3705
3500
|
const rec = readArchive(id, root);
|
|
3706
|
-
if (!rec
|
|
3501
|
+
if (!rec) continue;
|
|
3707
3502
|
const age = now - Date.parse(rec.archivedAt);
|
|
3708
3503
|
if (!Number.isFinite(age)) continue;
|
|
3709
|
-
const
|
|
3504
|
+
const ignored = path8.join(archiveDirFor(id, root), "ignored");
|
|
3505
|
+
if (compressAfter > 0 && age >= compressAfter * DAY_MS && !rec.ignoredDroppedAt && fs6.existsSync(ignored)) {
|
|
3506
|
+
fs6.rmSync(ignored, { recursive: true, force: true });
|
|
3507
|
+
rec.ignoredDroppedAt = new Date(now).toISOString();
|
|
3508
|
+
writeArchiveRecord(rec, root);
|
|
3509
|
+
}
|
|
3510
|
+
if (rec.transcriptsDroppedAt) continue;
|
|
3511
|
+
const dir = path8.join(archiveDirFor(id, root), "transcripts");
|
|
3710
3512
|
if (dropAfter > 0 && age >= dropAfter * DAY_MS) {
|
|
3711
3513
|
out.bytesSaved += dirBytes(dir);
|
|
3712
|
-
|
|
3514
|
+
fs6.rmSync(dir, { recursive: true, force: true });
|
|
3713
3515
|
rec.transcriptsDroppedAt = new Date(now).toISOString();
|
|
3714
3516
|
writeArchiveRecord(rec, root);
|
|
3715
3517
|
out.dropped.push(id);
|
|
@@ -3717,16 +3519,16 @@ function applyArchiveRetention(opts) {
|
|
|
3717
3519
|
}
|
|
3718
3520
|
if (compressAfter <= 0 || rec.compressedAt || age < compressAfter * DAY_MS) continue;
|
|
3719
3521
|
for (const t of rec.transcripts) {
|
|
3720
|
-
const plain =
|
|
3721
|
-
if (!
|
|
3722
|
-
const data =
|
|
3522
|
+
const plain = path8.join(dir, t.file);
|
|
3523
|
+
if (!fs6.existsSync(plain)) continue;
|
|
3524
|
+
const data = fs6.readFileSync(plain);
|
|
3723
3525
|
const gz = zlib.gzipSync(data);
|
|
3724
|
-
|
|
3725
|
-
if (!zlib.gunzipSync(
|
|
3726
|
-
|
|
3526
|
+
fs6.writeFileSync(`${plain}.gz`, gz);
|
|
3527
|
+
if (!zlib.gunzipSync(fs6.readFileSync(`${plain}.gz`)).equals(data)) {
|
|
3528
|
+
fs6.rmSync(`${plain}.gz`, { force: true });
|
|
3727
3529
|
continue;
|
|
3728
3530
|
}
|
|
3729
|
-
|
|
3531
|
+
fs6.rmSync(plain, { force: true });
|
|
3730
3532
|
out.bytesSaved += data.length - gz.length;
|
|
3731
3533
|
}
|
|
3732
3534
|
rec.compressedAt = new Date(now).toISOString();
|
|
@@ -3738,24 +3540,24 @@ function applyArchiveRetention(opts) {
|
|
|
3738
3540
|
function dirBytes(dir) {
|
|
3739
3541
|
let n = 0;
|
|
3740
3542
|
try {
|
|
3741
|
-
for (const f of
|
|
3543
|
+
for (const f of fs6.readdirSync(dir)) n += fs6.statSync(path8.join(dir, f)).size;
|
|
3742
3544
|
} catch {
|
|
3743
3545
|
}
|
|
3744
3546
|
return n;
|
|
3745
3547
|
}
|
|
3746
3548
|
|
|
3747
3549
|
// src/server/routes/revert-routes.ts
|
|
3748
|
-
import
|
|
3550
|
+
import path10 from "path";
|
|
3749
3551
|
import { zValidator as zValidator6 } from "@hono/zod-validator";
|
|
3750
3552
|
import { z as z5 } from "zod";
|
|
3751
3553
|
|
|
3752
3554
|
// src/core/diff/revert.ts
|
|
3753
|
-
import
|
|
3754
|
-
import
|
|
3555
|
+
import fs7 from "fs";
|
|
3556
|
+
import path9 from "path";
|
|
3755
3557
|
function inside(root, rel) {
|
|
3756
|
-
const abs =
|
|
3757
|
-
const back =
|
|
3758
|
-
if (!back || back.startsWith("..") ||
|
|
3558
|
+
const abs = path9.resolve(root, rel);
|
|
3559
|
+
const back = path9.relative(path9.resolve(root), abs);
|
|
3560
|
+
if (!back || back.startsWith("..") || path9.isAbsolute(back)) return null;
|
|
3759
3561
|
return abs;
|
|
3760
3562
|
}
|
|
3761
3563
|
function inHead(root, rel) {
|
|
@@ -3765,7 +3567,7 @@ function removeNew(root, rel) {
|
|
|
3765
3567
|
const abs = inside(root, rel);
|
|
3766
3568
|
if (!abs) return { ok: false, status: 400, error: `path escapes the worktree: ${rel}` };
|
|
3767
3569
|
git(["rm", "--cached", "-q", "--ignore-unmatch", "--", rel], root);
|
|
3768
|
-
|
|
3570
|
+
fs7.rmSync(abs, { force: true });
|
|
3769
3571
|
return null;
|
|
3770
3572
|
}
|
|
3771
3573
|
function revertFile(root, file) {
|
|
@@ -3868,8 +3670,8 @@ function mountRevertRoutes(app, opts) {
|
|
|
3868
3670
|
if (!session) return c.json({ error: "unknown session" }, 404);
|
|
3869
3671
|
const body = c.req.valid("json");
|
|
3870
3672
|
const repo = opts.uncommitted(session).find((r) => r.name === body.repo);
|
|
3871
|
-
const allowed = new Set(session.paths.map((p) =>
|
|
3872
|
-
if (!repo || !allowed.has(
|
|
3673
|
+
const allowed = new Set(session.paths.map((p) => path10.resolve(p).toLowerCase()));
|
|
3674
|
+
if (!repo || !allowed.has(path10.resolve(repo.root).toLowerCase())) {
|
|
3873
3675
|
return c.json({ error: `unknown repo: ${body.repo}` }, 404);
|
|
3874
3676
|
}
|
|
3875
3677
|
const file = repo.files.find((f) => f.path === body.path);
|
|
@@ -3926,7 +3728,7 @@ function mountDevRoutes(app, opts) {
|
|
|
3926
3728
|
}
|
|
3927
3729
|
|
|
3928
3730
|
// src/server/routes/ci-routes.ts
|
|
3929
|
-
import
|
|
3731
|
+
import fs8 from "fs";
|
|
3930
3732
|
|
|
3931
3733
|
// src/core/pr/review-quote.ts
|
|
3932
3734
|
function quoteForAgent(s, max = 600) {
|
|
@@ -3962,9 +3764,9 @@ function parseReviewFeedback(stdout) {
|
|
|
3962
3764
|
try {
|
|
3963
3765
|
const j = JSON.parse(stdout);
|
|
3964
3766
|
const pr = j.data?.repository?.pullRequest;
|
|
3965
|
-
if (!pr) return null;
|
|
3767
|
+
if (!pr || !j.data?.viewer?.login) return null;
|
|
3966
3768
|
return {
|
|
3967
|
-
viewer: j.data
|
|
3769
|
+
viewer: j.data.viewer.login,
|
|
3968
3770
|
threads: (pr.reviewThreads?.nodes ?? []).map((t) => ({
|
|
3969
3771
|
id: t.id,
|
|
3970
3772
|
isResolved: !!t.isResolved,
|
|
@@ -3980,6 +3782,16 @@ function parseReviewFeedback(stdout) {
|
|
|
3980
3782
|
return null;
|
|
3981
3783
|
}
|
|
3982
3784
|
}
|
|
3785
|
+
function viewerLogin(run) {
|
|
3786
|
+
let known = null;
|
|
3787
|
+
return async () => {
|
|
3788
|
+
if (known) return known;
|
|
3789
|
+
const r = await run("gh", ["api", "user", "--jq", ".login"], process.cwd()).catch(() => null);
|
|
3790
|
+
const login = r?.code === 0 ? r.stdout.trim() : "";
|
|
3791
|
+
if (login) known = login;
|
|
3792
|
+
return known;
|
|
3793
|
+
};
|
|
3794
|
+
}
|
|
3983
3795
|
async function fetchReviewFeedback(repoPath, prNumber, run) {
|
|
3984
3796
|
const res = await run(
|
|
3985
3797
|
"gh",
|
|
@@ -3993,6 +3805,7 @@ var DEFAULT_TRUSTED_BOTS = ["copilot-pull-request-reviewer", "github-actions"];
|
|
|
3993
3805
|
var botName = (login) => login.toLowerCase().replace(/^app\//, "").replace(/\[bot\]$/, "");
|
|
3994
3806
|
var isTrusted = (c, trustedBots = /* @__PURE__ */ new Set()) => TRUSTED_ASSOCIATIONS.has(c.association.toUpperCase()) || !!c.author && trustedBots.has(botName(c.author));
|
|
3995
3807
|
function newFeedback(fb, scope, seen, opts = {}) {
|
|
3808
|
+
if (!fb.viewer.trim()) return [];
|
|
3996
3809
|
const mine = (a) => a.toLowerCase() === fb.viewer.toLowerCase();
|
|
3997
3810
|
const bots = new Set((opts.trustedBots ?? []).map(botName));
|
|
3998
3811
|
const trusted = (c) => isTrusted(c, bots);
|
|
@@ -4027,6 +3840,7 @@ function openThreadCount(fb) {
|
|
|
4027
3840
|
}
|
|
4028
3841
|
function openThreadsOf(fb, trustedBots = []) {
|
|
4029
3842
|
const bots = new Set(trustedBots.map(botName));
|
|
3843
|
+
if (!fb.viewer.trim()) return [];
|
|
4030
3844
|
return fb.threads.filter((t) => {
|
|
4031
3845
|
const last = t.comments[t.comments.length - 1];
|
|
4032
3846
|
return !t.isResolved && last && last.author.toLowerCase() !== fb.viewer.toLowerCase();
|
|
@@ -4192,6 +4006,10 @@ function createPrWatch(deps) {
|
|
|
4192
4006
|
return states.get(id) ?? null;
|
|
4193
4007
|
}
|
|
4194
4008
|
const opts = deps.options();
|
|
4009
|
+
const viewer = pre.repos.some((r) => r.pr?.author) ? await (deps.viewer?.() ?? Promise.resolve(null)).catch(() => null) : null;
|
|
4010
|
+
const theirs = new Set(
|
|
4011
|
+
pre.repos.filter((r) => r.pr?.author && viewer && r.pr.author.toLowerCase() !== viewer.toLowerCase()).map((r) => r.name)
|
|
4012
|
+
);
|
|
4195
4013
|
const feedback = [];
|
|
4196
4014
|
const feedbackSeen = staged(id);
|
|
4197
4015
|
const threads = /* @__PURE__ */ new Map();
|
|
@@ -4199,7 +4017,7 @@ function createPrWatch(deps) {
|
|
|
4199
4017
|
const deliverReviews = !session.launchedUnsafe && !deps.runsUnsafe?.(id);
|
|
4200
4018
|
if (deps.reviewFeedback && opts.reviewComments) {
|
|
4201
4019
|
for (const r of pre.repos) {
|
|
4202
|
-
if (r.pr?.state !== "OPEN") continue;
|
|
4020
|
+
if (r.pr?.state !== "OPEN" || theirs.has(r.name)) continue;
|
|
4203
4021
|
const key = `${id}:${r.name}`;
|
|
4204
4022
|
const cached2 = feedbackCache.get(key);
|
|
4205
4023
|
const fresh = cached2 && r.pr.updatedAt && cached2.number === r.pr.number && cached2.updatedAt === r.pr.updatedAt;
|
|
@@ -4262,7 +4080,7 @@ function createPrWatch(deps) {
|
|
|
4262
4080
|
} else note(`couldn't hand ${what} to its Claude; trying again next time`, "warn");
|
|
4263
4081
|
} else feedbackSeen.commit();
|
|
4264
4082
|
if (opts.fixCi) {
|
|
4265
|
-
const fresh = failingOf(ci).filter((f) => !deps.told(id).has(`${id}:${f.repo}:${f.headSha}`));
|
|
4083
|
+
const fresh = failingOf(ci).filter((f) => !theirs.has(f.repo) && !deps.told(id).has(`${id}:${f.repo}:${f.headSha}`));
|
|
4266
4084
|
if (fresh.length) {
|
|
4267
4085
|
const ciSeen = staged(id);
|
|
4268
4086
|
for (const f of fresh) ciSeen.add(`${id}:${f.repo}:${f.headSha}`);
|
|
@@ -4413,7 +4231,7 @@ function mountCiRoutes(app, opts) {
|
|
|
4413
4231
|
lookOnly: opts.lookOnly,
|
|
4414
4232
|
sessions: () => {
|
|
4415
4233
|
const cutoff = Date.now() - RECENT_MS;
|
|
4416
|
-
return loadHistory().filter((s) => !s.archivedAt && Date.parse(s.lastAccessedAt) >= cutoff && s.paths.some((p) =>
|
|
4234
|
+
return loadHistory().filter((s) => !s.archivedAt && Date.parse(s.lastAccessedAt) >= cutoff && s.paths.some((p) => fs8.existsSync(p))).map((session) => ({ id: sessionIdFor(session), session }));
|
|
4417
4235
|
},
|
|
4418
4236
|
// Never-pushed branches can't have a PR: don't ask GitHub about them,
|
|
4419
4237
|
// unless the watch already knows one (a merged PR whose branch is gone).
|
|
@@ -4424,6 +4242,7 @@ function mountCiRoutes(app, opts) {
|
|
|
4424
4242
|
});
|
|
4425
4243
|
},
|
|
4426
4244
|
reviewFeedback: (repoPath, n) => fetchReviewFeedback(repoPath, n, defaultRunner),
|
|
4245
|
+
viewer: viewerLogin(defaultRunner),
|
|
4427
4246
|
runsUnsafe: (id) => dbPtySessions.read()[id]?.unsafe === true,
|
|
4428
4247
|
...opts.activity ? { activity: opts.activity } : {},
|
|
4429
4248
|
busy: midTurn,
|
|
@@ -4477,27 +4296,27 @@ function mountCiRoutes(app, opts) {
|
|
|
4477
4296
|
}
|
|
4478
4297
|
|
|
4479
4298
|
// src/core/diff/diffs-sweep.ts
|
|
4480
|
-
import
|
|
4481
|
-
import
|
|
4299
|
+
import fs9 from "fs";
|
|
4300
|
+
import path11 from "path";
|
|
4482
4301
|
var SWEEP_AFTER_DAYS = 30;
|
|
4483
4302
|
var DISPOSABLE = /\.(html|log)$/i;
|
|
4484
|
-
function sweepOldDiffArtifacts(now = Date.now(), maxAgeDays = SWEEP_AFTER_DAYS, dir =
|
|
4303
|
+
function sweepOldDiffArtifacts(now = Date.now(), maxAgeDays = SWEEP_AFTER_DAYS, dir = path11.join(getConfigDir(), "diffs")) {
|
|
4485
4304
|
const cutoff = now - maxAgeDays * 24 * 60 * 60 * 1e3;
|
|
4486
4305
|
let removed = 0;
|
|
4487
4306
|
let bytes = 0;
|
|
4488
4307
|
let names;
|
|
4489
4308
|
try {
|
|
4490
|
-
names =
|
|
4309
|
+
names = fs9.readdirSync(dir);
|
|
4491
4310
|
} catch {
|
|
4492
4311
|
return { removed, bytes };
|
|
4493
4312
|
}
|
|
4494
4313
|
for (const name of names) {
|
|
4495
4314
|
if (!DISPOSABLE.test(name)) continue;
|
|
4496
|
-
const file =
|
|
4315
|
+
const file = path11.join(dir, name);
|
|
4497
4316
|
try {
|
|
4498
|
-
const st =
|
|
4317
|
+
const st = fs9.statSync(file);
|
|
4499
4318
|
if (!st.isFile() || st.mtimeMs >= cutoff) continue;
|
|
4500
|
-
|
|
4319
|
+
fs9.rmSync(file, { force: true });
|
|
4501
4320
|
removed++;
|
|
4502
4321
|
bytes += st.size;
|
|
4503
4322
|
} catch {
|
|
@@ -4507,7 +4326,7 @@ function sweepOldDiffArtifacts(now = Date.now(), maxAgeDays = SWEEP_AFTER_DAYS,
|
|
|
4507
4326
|
}
|
|
4508
4327
|
|
|
4509
4328
|
// src/core/diff/session-history.ts
|
|
4510
|
-
import
|
|
4329
|
+
import path12 from "path";
|
|
4511
4330
|
|
|
4512
4331
|
// src/core/diff/diff-points.ts
|
|
4513
4332
|
var SHA = /^[0-9a-f]{7,40}$/;
|
|
@@ -4577,7 +4396,7 @@ function sessionCommits(session) {
|
|
|
4577
4396
|
if (log.exitCode !== 0 || !log.stdout) continue;
|
|
4578
4397
|
for (const line of log.stdout.split("\n")) {
|
|
4579
4398
|
const [sha, at, subject] = line.split("");
|
|
4580
|
-
if (sha && at) out.push({ repo:
|
|
4399
|
+
if (sha && at) out.push({ repo: path12.basename(root), sha, at, subject: subject ?? "" });
|
|
4581
4400
|
}
|
|
4582
4401
|
}
|
|
4583
4402
|
if (commitCache.size >= COMMIT_CACHE_MAX) commitCache.delete(commitCache.keys().next().value);
|
|
@@ -4585,7 +4404,7 @@ function sessionCommits(session) {
|
|
|
4585
4404
|
return out;
|
|
4586
4405
|
}
|
|
4587
4406
|
function computeSessionRange(session, from, to) {
|
|
4588
|
-
const paths = session.paths.map((p) =>
|
|
4407
|
+
const paths = session.paths.map((p) => path12.resolve(p));
|
|
4589
4408
|
const refs = rangeRefs(paths, loadManifest(scopeHashForPaths(paths)).entries, from, to);
|
|
4590
4409
|
if ("error" in refs) return refs;
|
|
4591
4410
|
return { repos: refs.map((r) => ({ name: r.name, root: r.root, files: computeRangeDiff(r) })) };
|
|
@@ -4773,7 +4592,7 @@ function sleepCandidates(ptys, now, afterMs, busy, keep = /* @__PURE__ */ new Se
|
|
|
4773
4592
|
function computeSessionDiff(s, base) {
|
|
4774
4593
|
const resolved = s.paths.map((p) => resolveRepoDiff(p, base, s.baseBranches?.[p] ?? s.baseBranch));
|
|
4775
4594
|
const repos = s.paths.map((p, i) => ({
|
|
4776
|
-
name:
|
|
4595
|
+
name: path13.basename(p),
|
|
4777
4596
|
root: p,
|
|
4778
4597
|
resolvedBase: resolved[i].resolvedBase,
|
|
4779
4598
|
files: computeDiff({ root: p, diffArg: resolved[i].diffArg })
|
|
@@ -4824,7 +4643,7 @@ async function startWebServer(opts = {}) {
|
|
|
4824
4643
|
let activityWatcher = null;
|
|
4825
4644
|
if (!lean) {
|
|
4826
4645
|
try {
|
|
4827
|
-
const roots = activityRoots().filter((r) =>
|
|
4646
|
+
const roots = activityRoots().filter((r) => fs10.existsSync(r));
|
|
4828
4647
|
if (roots.length > 0) {
|
|
4829
4648
|
activityWatcher = createFsWatcher({
|
|
4830
4649
|
roots,
|
|
@@ -4875,7 +4694,7 @@ async function startWebServer(opts = {}) {
|
|
|
4875
4694
|
}, 500);
|
|
4876
4695
|
}
|
|
4877
4696
|
});
|
|
4878
|
-
const repoNames = (s) => s.isGroup ? s.paths.map((p) =>
|
|
4697
|
+
const repoNames = (s) => s.isGroup ? s.paths.map((p) => path13.basename(p)) : [s.target];
|
|
4879
4698
|
const diffStatFor = (id, s, hasStatus) => wantsDiffStat(s, hasStatus) ? diffStats.get(id, s.paths, repoNames(s)) : null;
|
|
4880
4699
|
const archivedRow = createArchivedRows();
|
|
4881
4700
|
app.get("/api/sessions", (c) => {
|
|
@@ -5296,7 +5115,7 @@ async function startWebServer(opts = {}) {
|
|
|
5296
5115
|
updatesTimer?.unref?.();
|
|
5297
5116
|
const desktopFile = desktopUpdatePath();
|
|
5298
5117
|
const onDesktopUpdate = () => broadcast("updates-changed", { ts: Date.now() });
|
|
5299
|
-
if (jobs)
|
|
5118
|
+
if (jobs) fs10.watchFile(desktopFile, { interval: 3e3 }, onDesktopUpdate);
|
|
5300
5119
|
app.get("/api/pty-host/health", (c) => c.json(hostHealth(hostBeat())));
|
|
5301
5120
|
let lastHostState = hostHealth(hostBeat()).state;
|
|
5302
5121
|
const hostTick = lean ? null : setInterval(() => {
|
|
@@ -5358,7 +5177,7 @@ async function startWebServer(opts = {}) {
|
|
|
5358
5177
|
if (conversationsFirst) clearTimeout(conversationsFirst);
|
|
5359
5178
|
if (updatesFirst) clearTimeout(updatesFirst);
|
|
5360
5179
|
if (updatesTimer) clearInterval(updatesTimer);
|
|
5361
|
-
|
|
5180
|
+
fs10.unwatchFile(desktopFile, onDesktopUpdate);
|
|
5362
5181
|
for (const t of conversationSyncs.values()) clearTimeout(t);
|
|
5363
5182
|
clearTimeout(sweepTimer);
|
|
5364
5183
|
activityWatcher?.stop();
|
|
@@ -5381,11 +5200,11 @@ async function startWebServer(opts = {}) {
|
|
|
5381
5200
|
}
|
|
5382
5201
|
|
|
5383
5202
|
// src/core/platform/autostart.ts
|
|
5384
|
-
import
|
|
5385
|
-
import
|
|
5203
|
+
import fs11 from "fs";
|
|
5204
|
+
import path14 from "path";
|
|
5386
5205
|
function startupScriptPath() {
|
|
5387
5206
|
if (process.platform !== "win32" || !process.env.APPDATA) return null;
|
|
5388
|
-
return
|
|
5207
|
+
return path14.join(process.env.APPDATA, "Microsoft", "Windows", "Start Menu", "Programs", "Startup", "work-web.vbs");
|
|
5389
5208
|
}
|
|
5390
5209
|
function vbsQuote(s) {
|
|
5391
5210
|
return '"' + s.replace(/"/g, '""') + '"';
|
|
@@ -5403,11 +5222,11 @@ function setAutostart(enabled, workBin) {
|
|
|
5403
5222
|
const file = startupScriptPath();
|
|
5404
5223
|
if (!file) throw new Error("Autostart is only supported on Windows so far.");
|
|
5405
5224
|
if (enabled) {
|
|
5406
|
-
|
|
5407
|
-
|
|
5225
|
+
fs11.mkdirSync(path14.dirname(file), { recursive: true });
|
|
5226
|
+
fs11.writeFileSync(file, buildStartupScript(process.execPath, workBin), "utf-8");
|
|
5408
5227
|
} else {
|
|
5409
5228
|
try {
|
|
5410
|
-
|
|
5229
|
+
fs11.unlinkSync(file);
|
|
5411
5230
|
} catch {
|
|
5412
5231
|
}
|
|
5413
5232
|
}
|
|
@@ -5451,7 +5270,7 @@ function createDemoRepos(liveTargets) {
|
|
|
5451
5270
|
/** GET /api/projects: what New worktree offers, as the real one reads config. */
|
|
5452
5271
|
projects() {
|
|
5453
5272
|
return {
|
|
5454
|
-
singles: Object.entries(repos).map(([name,
|
|
5273
|
+
singles: Object.entries(repos).map(([name, path15]) => ({ name, kind: "single", path: path15 })),
|
|
5455
5274
|
groups: Object.entries(groups).map(([name, members]) => ({ name, kind: "group", members }))
|
|
5456
5275
|
};
|
|
5457
5276
|
},
|
|
@@ -5493,12 +5312,12 @@ function createDemoRepos(liveTargets) {
|
|
|
5493
5312
|
}));
|
|
5494
5313
|
return { roots: [root], repos: rows, groups: groupRows };
|
|
5495
5314
|
},
|
|
5496
|
-
enroll(alias,
|
|
5497
|
-
if (!found.some((f) => f.path ===
|
|
5498
|
-
const problem = enrollProblem(alias,
|
|
5315
|
+
enroll(alias, path15) {
|
|
5316
|
+
if (!found.some((f) => f.path === path15)) throw new DemoRepoError(`${path15} is not the top folder of a git repository`);
|
|
5317
|
+
const problem = enrollProblem(alias, path15, config());
|
|
5499
5318
|
if (problem) throw new DemoRepoError(problem);
|
|
5500
|
-
repos[alias] =
|
|
5501
|
-
ignored.delete(
|
|
5319
|
+
repos[alias] = path15;
|
|
5320
|
+
ignored.delete(path15);
|
|
5502
5321
|
},
|
|
5503
5322
|
remove(alias, force) {
|
|
5504
5323
|
if (!(alias in repos)) throw new DemoRepoError(`no repo \u201C${alias}\u201D`);
|
|
@@ -5507,9 +5326,9 @@ function createDemoRepos(liveTargets) {
|
|
|
5507
5326
|
delete repos[alias];
|
|
5508
5327
|
for (const g of Object.keys(groups)) groups[g] = groups[g].filter((m) => m !== alias);
|
|
5509
5328
|
},
|
|
5510
|
-
ignore(
|
|
5511
|
-
if (on) ignored.add(
|
|
5512
|
-
else ignored.delete(
|
|
5329
|
+
ignore(path15, on) {
|
|
5330
|
+
if (on) ignored.add(path15);
|
|
5331
|
+
else ignored.delete(path15);
|
|
5513
5332
|
},
|
|
5514
5333
|
saveGroup(name, members, creating) {
|
|
5515
5334
|
const problem = groupProblem(name, members, config(), { creating });
|
|
@@ -6727,6 +6546,7 @@ ${reply}\r
|
|
|
6727
6546
|
reviewDecision: "APPROVED",
|
|
6728
6547
|
myReview: "APPROVED",
|
|
6729
6548
|
isMine: false,
|
|
6549
|
+
author: "ivana",
|
|
6730
6550
|
conflicting: false,
|
|
6731
6551
|
reviewRequested: false,
|
|
6732
6552
|
repoAlias: "web"
|
|
@@ -6741,10 +6561,27 @@ ${reply}\r
|
|
|
6741
6561
|
reviewDecision: "REVIEW_REQUIRED",
|
|
6742
6562
|
myReview: "NONE",
|
|
6743
6563
|
isMine: false,
|
|
6564
|
+
author: "dana",
|
|
6744
6565
|
conflicting: false,
|
|
6745
6566
|
reviewRequested: true,
|
|
6746
6567
|
repoAlias: "api"
|
|
6747
6568
|
});
|
|
6569
|
+
out.push({
|
|
6570
|
+
number: 219,
|
|
6571
|
+
title: "Fix a typo in the invoice footer",
|
|
6572
|
+
branch: "patch-1",
|
|
6573
|
+
url: "https://github.com/example/web/pull/219",
|
|
6574
|
+
isDraft: false,
|
|
6575
|
+
checksStatus: "SUCCESS",
|
|
6576
|
+
reviewDecision: "REVIEW_REQUIRED",
|
|
6577
|
+
myReview: "NONE",
|
|
6578
|
+
isMine: false,
|
|
6579
|
+
author: "outside-dev",
|
|
6580
|
+
fork: true,
|
|
6581
|
+
conflicting: false,
|
|
6582
|
+
reviewRequested: true,
|
|
6583
|
+
repoAlias: "web"
|
|
6584
|
+
});
|
|
6748
6585
|
return out;
|
|
6749
6586
|
}
|
|
6750
6587
|
jira() {
|
|
@@ -7421,6 +7258,33 @@ async function startDemoServer(opts) {
|
|
|
7421
7258
|
const s = scenario.create(body.target, branch, prompt);
|
|
7422
7259
|
return c.json({ sessionId: s.id, launchDir: s.paths[0], paths: s.paths, ...prompt ? { started: "started" } : {} });
|
|
7423
7260
|
});
|
|
7261
|
+
app.get("/api/pr-start", (c) => {
|
|
7262
|
+
const ref = parsePrRef(c.req.query("ref") ?? "");
|
|
7263
|
+
const target = c.req.query("target") || void 0;
|
|
7264
|
+
if (!ref)
|
|
7265
|
+
return c.json(
|
|
7266
|
+
{ error: "Give a pull request link (https://github.com/owner/repo/pull/123), or its number with a repo." },
|
|
7267
|
+
400
|
|
7268
|
+
);
|
|
7269
|
+
const pr = scenario.prs().find((p) => p.number === ref.number && (ref.repo ? ref.repo.endsWith(`/${p.repoAlias}`) : !target || p.repoAlias === target));
|
|
7270
|
+
if (!pr) return c.json({ error: `PR #${ref.number} isn't open in your repos.` }, 400);
|
|
7271
|
+
if (pr.fork)
|
|
7272
|
+
return c.json(
|
|
7273
|
+
{ error: `PR #${ref.number} comes from a fork: its branch isn't on origin, so a session couldn't push to it.` },
|
|
7274
|
+
400
|
|
7275
|
+
);
|
|
7276
|
+
return c.json({
|
|
7277
|
+
pr: {
|
|
7278
|
+
alias: pr.repoAlias,
|
|
7279
|
+
number: pr.number,
|
|
7280
|
+
title: pr.title,
|
|
7281
|
+
url: pr.url,
|
|
7282
|
+
branch: pr.branch,
|
|
7283
|
+
base: "main",
|
|
7284
|
+
author: pr.author || "dana"
|
|
7285
|
+
}
|
|
7286
|
+
});
|
|
7287
|
+
});
|
|
7424
7288
|
app.delete(
|
|
7425
7289
|
"/api/sessions/:id/worktree",
|
|
7426
7290
|
(c) => scenario.remove(c.req.param("id")) ? c.json({ ok: true, worktreeRemoved: true }) : notFound(c)
|
|
@@ -7987,4 +7851,4 @@ export {
|
|
|
7987
7851
|
stopExisting,
|
|
7988
7852
|
webCommand
|
|
7989
7853
|
};
|
|
7990
|
-
//# sourceMappingURL=web-
|
|
7854
|
+
//# sourceMappingURL=web-DTVGZZDZ.js.map
|