@moberg_hr/work-tree 2.1.0 → 2.2.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-EGNJ2KYK.js → answer-OF2QNF4A.js} +6 -6
- package/dist/{attach-64ILZMTD.js → attach-PAFAZ2EH.js} +9 -9
- package/dist/bin.js +2 -2
- package/dist/{block-H74FYSLK.js → block-3LEG4LKJ.js} +6 -6
- package/dist/{broadcast-WRHZWOQN.js → broadcast-ZDIL7UBP.js} +3 -3
- package/dist/{catchup-7QBOC5JJ.js → catchup-ZZ5HZJIT.js} +8 -8
- package/dist/{chunk-E35NZVPX.js → chunk-2GX3IOSV.js} +15 -2
- package/dist/chunk-2GX3IOSV.js.map +1 -0
- package/dist/{chunk-A3M5WTVC.js → chunk-3GAYLP7W.js} +4 -4
- package/dist/{chunk-MXIFBNCV.js → chunk-453EGT2R.js} +11 -7
- package/dist/chunk-453EGT2R.js.map +1 -0
- package/dist/{chunk-NPVMYGT7.js → chunk-46VAWZZX.js} +2 -2
- package/dist/{chunk-3D7MELCW.js → chunk-4CVUV2SE.js} +2 -2
- package/dist/{chunk-3NPEMTQT.js → chunk-62C3CJ5M.js} +2 -2
- package/dist/{chunk-YEEDWV4H.js → chunk-77SVSNME.js} +4 -4
- package/dist/{chunk-723C3D5X.js → chunk-C7OK4XEZ.js} +58 -9
- package/dist/chunk-C7OK4XEZ.js.map +1 -0
- package/dist/{chunk-ATBH7QW3.js → chunk-DLSAAP3S.js} +2 -2
- package/dist/{chunk-SSVVCHJB.js → chunk-EDAOG56H.js} +3 -3
- package/dist/{chunk-2LIVAJLK.js → chunk-EXJYPF64.js} +3 -3
- package/dist/{chunk-37I2GFXK.js → chunk-INVFNKU7.js} +4 -4
- package/dist/{chunk-DXHZWRVE.js → chunk-ISZM5C22.js} +15 -9
- package/dist/chunk-ISZM5C22.js.map +1 -0
- package/dist/{chunk-S45H7N6X.js → chunk-KSVZVHTI.js} +6 -6
- package/dist/{chunk-S45H7N6X.js.map → chunk-KSVZVHTI.js.map} +1 -1
- package/dist/{chunk-RQE5UOIW.js → chunk-KTFDSJUD.js} +16 -1
- package/dist/chunk-KTFDSJUD.js.map +1 -0
- package/dist/{chunk-ONEXQW7Q.js → chunk-KWU35O5S.js} +3 -3
- package/dist/{chunk-U4UB4LG6.js → chunk-LBQR7KTC.js} +2 -2
- package/dist/{chunk-DXAIGNWF.js → chunk-LGDECE7V.js} +3 -3
- package/dist/{chunk-2QZ3RZOY.js → chunk-M4YXBQZN.js} +5 -5
- package/dist/{chunk-OOCMPS5L.js → chunk-MRXD2NSO.js} +2 -2
- package/dist/{chunk-6OG3W3PY.js → chunk-NBI2INQS.js} +3 -3
- package/dist/{chunk-HY566NNR.js → chunk-OCDHKDUN.js} +45 -45
- package/dist/{chunk-MLTMXVLD.js → chunk-OE34YZFO.js} +2 -2
- package/dist/{chunk-POTGMLPV.js → chunk-OIQY4OKO.js} +2 -2
- package/dist/{chunk-OND6YRWZ.js → chunk-R4M5DDSN.js} +4 -4
- package/dist/{chunk-QXDBVVSC.js → chunk-RK6NHIL6.js} +2 -2
- package/dist/chunk-THJGDJVO.js +9 -0
- package/dist/chunk-TN2TXRHS.js +249 -0
- package/dist/chunk-TN2TXRHS.js.map +1 -0
- package/dist/{chunk-4Y35ABCO.js → chunk-TROTIHD5.js} +3 -3
- package/dist/{chunk-XILMZRNS.js → chunk-U4YUMSJY.js} +3 -3
- package/dist/{chunk-KFSLF65S.js → chunk-U5V5J237.js} +6 -6
- package/dist/{chunk-LCSWFGIM.js → chunk-UDOXLAE7.js} +2 -2
- package/dist/{chunk-MI3PS2SH.js → chunk-UOSZFFNY.js} +2 -2
- package/dist/{chunk-6DWPIK7D.js → chunk-X6VBITXV.js} +4 -4
- package/dist/{chunk-PYOSW6X5.js → chunk-XIL4QZFW.js} +3 -3
- package/dist/{chunk-QX4LFFNS.js → chunk-ZR2KWY6V.js} +2 -2
- package/dist/{chunk-4MXWNDH7.js → chunk-ZVJEWMJN.js} +39 -1
- package/dist/chunk-ZVJEWMJN.js.map +1 -0
- package/dist/{cleanup-YSVZAGJF.js → cleanup-W5RGZ3Q6.js} +17 -15
- package/dist/{cleanup-YSVZAGJF.js.map → cleanup-W5RGZ3Q6.js.map} +1 -1
- package/dist/{cli-XT4AS3M2.js → cli-64TLWGRH.js} +3 -3
- package/dist/{config-GQRUETZ6.js → config-MR7UZCST.js} +4 -4
- package/dist/{diff-L3TWGBA4.js → diff-URDY6YMT.js} +7 -7
- package/dist/{digest-R52JZ3AK.js → digest-D4FEZNLU.js} +6 -6
- package/dist/{fork-MCPMOGS5.js → fork-7EUVNEB7.js} +15 -15
- package/dist/{hook-S64C4G2C.js → hook-6AD3FRKZ.js} +6 -6
- package/dist/{hydrate-G5AMKHRD.js → hydrate-ZJZPM6YW.js} +3 -3
- package/dist/{init-PCZCSRZI.js → init-LWL4WVSJ.js} +4 -4
- package/dist/{install-skills-Z76FLXOU.js → install-skills-TQVWZDUD.js} +3 -3
- package/dist/install-skills-bin.js +2 -2
- package/dist/{move-MMGOA7MV.js → move-URV7XIDT.js} +7 -7
- package/dist/{note-WVKK65IH.js → note-S6EGTEIL.js} +5 -5
- package/dist/{overlaps-REVVBZCX.js → overlaps-4T7NLTJH.js} +5 -5
- package/dist/{pin-NRSD2ZT7.js → pin-KKQZ3AR6.js} +5 -5
- package/dist/{pr-JYOI7LCK.js → pr-5ZILTVDM.js} +5 -5
- package/dist/{prune-AGZ24MPD.js → prune-OK23KLHG.js} +16 -14
- package/dist/{prune-AGZ24MPD.js.map → prune-OK23KLHG.js.map} +1 -1
- package/dist/{pty-host-AZ2ORVV2.js → pty-host-I5OJGWYA.js} +5 -5
- package/dist/{read-A7LFAPPZ.js → read-NHK26F22.js} +5 -5
- package/dist/{recent-H2LD5JOK.js → recent-DNSOJQVQ.js} +4 -4
- package/dist/{remove-3HQTJQWN.js → remove-TZQVN2EG.js} +15 -13
- package/dist/{remove-3HQTJQWN.js.map → remove-TZQVN2EG.js.map} +1 -1
- package/dist/{restart-BTUO4DTI.js → restart-WHJDPDQA.js} +6 -6
- package/dist/{resume-I7GXT2II.js → resume-BXIYEZM3.js} +4 -4
- package/dist/{run-TE2AFYA6.js → run-4MQLY3XF.js} +3 -3
- package/dist/{screen-XZPDSK65.js → screen-URKN7PU6.js} +6 -6
- package/dist/{search-MGTME3CE.js → search-MNBYJEL7.js} +3 -3
- package/dist/{section-YVBDU5MO.js → section-B3OQFADP.js} +5 -5
- package/dist/{send-WKIX3AT5.js → send-2QTMQQ6E.js} +7 -7
- package/dist/{sessions-2OWYXO55.js → sessions-4B22O45G.js} +12 -12
- package/dist/{snooze-WKY2T4VZ.js → snooze-LSCCM3QT.js} +5 -5
- package/dist/{start-ZCQT7G4C.js → start-KVNLZRF5.js} +6 -6
- package/dist/{status-INIBC7GA.js → status-UEMXFLZZ.js} +3 -3
- package/dist/{stop-H4PTRFNX.js → stop-NEQBEYEY.js} +6 -6
- package/dist/{sync-6SHCY6LZ.js → sync-BHEY6RXE.js} +16 -14
- package/dist/{sync-6SHCY6LZ.js.map → sync-BHEY6RXE.js.map} +1 -1
- package/dist/{time-XQ2R7Z33.js → time-ON27QFG4.js} +6 -6
- package/dist/{timesheet-DX2TLHIB.js → timesheet-HK5CHAA7.js} +8 -8
- package/dist/{tree-5AAHU4K5.js → tree-C5BEEKLO.js} +18 -11
- package/dist/tree-C5BEEKLO.js.map +1 -0
- package/dist/{update-6G2E5QXG.js → update-M4KS23HB.js} +7 -7
- package/dist/{wait-LFFXWBY7.js → wait-5QVWSCOL.js} +6 -6
- package/dist/wd-bin.js +2 -2
- package/dist/web/assets/{PtyView-l4za-VIj.js → PtyView-TjC4VYWv.js} +2 -2
- package/dist/web/assets/{PtyView-l4za-VIj.js.map → PtyView-TjC4VYWv.js.map} +1 -1
- package/dist/web/assets/index-BPadZeCm.js +119 -0
- package/dist/web/assets/index-BPadZeCm.js.map +1 -0
- package/dist/web/assets/index-YbJdcXjZ.css +1 -0
- package/dist/web/index.html +2 -2
- package/dist/{web-MWSFIUIJ.js → web-5YGNY6MI.js} +746 -147
- package/dist/web-5YGNY6MI.js.map +1 -0
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/dist/chunk-4MXWNDH7.js.map +0 -1
- package/dist/chunk-723C3D5X.js.map +0 -1
- package/dist/chunk-DXHZWRVE.js.map +0 -1
- package/dist/chunk-E35NZVPX.js.map +0 -1
- package/dist/chunk-MXIFBNCV.js.map +0 -1
- package/dist/chunk-RQE5UOIW.js.map +0 -1
- package/dist/chunk-UIZEMKED.js +0 -9
- package/dist/tree-5AAHU4K5.js.map +0 -1
- package/dist/web/assets/index-B4wFhe7U.css +0 -1
- package/dist/web/assets/index-DaCK_AAw.js +0 -118
- package/dist/web/assets/index-DaCK_AAw.js.map +0 -1
- package/dist/web-MWSFIUIJ.js.map +0 -1
- /package/dist/{answer-EGNJ2KYK.js.map → answer-OF2QNF4A.js.map} +0 -0
- /package/dist/{attach-64ILZMTD.js.map → attach-PAFAZ2EH.js.map} +0 -0
- /package/dist/{block-H74FYSLK.js.map → block-3LEG4LKJ.js.map} +0 -0
- /package/dist/{broadcast-WRHZWOQN.js.map → broadcast-ZDIL7UBP.js.map} +0 -0
- /package/dist/{catchup-7QBOC5JJ.js.map → catchup-ZZ5HZJIT.js.map} +0 -0
- /package/dist/{chunk-A3M5WTVC.js.map → chunk-3GAYLP7W.js.map} +0 -0
- /package/dist/{chunk-NPVMYGT7.js.map → chunk-46VAWZZX.js.map} +0 -0
- /package/dist/{chunk-3D7MELCW.js.map → chunk-4CVUV2SE.js.map} +0 -0
- /package/dist/{chunk-3NPEMTQT.js.map → chunk-62C3CJ5M.js.map} +0 -0
- /package/dist/{chunk-YEEDWV4H.js.map → chunk-77SVSNME.js.map} +0 -0
- /package/dist/{chunk-ATBH7QW3.js.map → chunk-DLSAAP3S.js.map} +0 -0
- /package/dist/{chunk-SSVVCHJB.js.map → chunk-EDAOG56H.js.map} +0 -0
- /package/dist/{chunk-2LIVAJLK.js.map → chunk-EXJYPF64.js.map} +0 -0
- /package/dist/{chunk-37I2GFXK.js.map → chunk-INVFNKU7.js.map} +0 -0
- /package/dist/{chunk-ONEXQW7Q.js.map → chunk-KWU35O5S.js.map} +0 -0
- /package/dist/{chunk-U4UB4LG6.js.map → chunk-LBQR7KTC.js.map} +0 -0
- /package/dist/{chunk-DXAIGNWF.js.map → chunk-LGDECE7V.js.map} +0 -0
- /package/dist/{chunk-2QZ3RZOY.js.map → chunk-M4YXBQZN.js.map} +0 -0
- /package/dist/{chunk-OOCMPS5L.js.map → chunk-MRXD2NSO.js.map} +0 -0
- /package/dist/{chunk-6OG3W3PY.js.map → chunk-NBI2INQS.js.map} +0 -0
- /package/dist/{chunk-HY566NNR.js.map → chunk-OCDHKDUN.js.map} +0 -0
- /package/dist/{chunk-MLTMXVLD.js.map → chunk-OE34YZFO.js.map} +0 -0
- /package/dist/{chunk-POTGMLPV.js.map → chunk-OIQY4OKO.js.map} +0 -0
- /package/dist/{chunk-OND6YRWZ.js.map → chunk-R4M5DDSN.js.map} +0 -0
- /package/dist/{chunk-QXDBVVSC.js.map → chunk-RK6NHIL6.js.map} +0 -0
- /package/dist/{chunk-UIZEMKED.js.map → chunk-THJGDJVO.js.map} +0 -0
- /package/dist/{chunk-4Y35ABCO.js.map → chunk-TROTIHD5.js.map} +0 -0
- /package/dist/{chunk-XILMZRNS.js.map → chunk-U4YUMSJY.js.map} +0 -0
- /package/dist/{chunk-KFSLF65S.js.map → chunk-U5V5J237.js.map} +0 -0
- /package/dist/{chunk-LCSWFGIM.js.map → chunk-UDOXLAE7.js.map} +0 -0
- /package/dist/{chunk-MI3PS2SH.js.map → chunk-UOSZFFNY.js.map} +0 -0
- /package/dist/{chunk-6DWPIK7D.js.map → chunk-X6VBITXV.js.map} +0 -0
- /package/dist/{chunk-PYOSW6X5.js.map → chunk-XIL4QZFW.js.map} +0 -0
- /package/dist/{chunk-QX4LFFNS.js.map → chunk-ZR2KWY6V.js.map} +0 -0
- /package/dist/{cli-XT4AS3M2.js.map → cli-64TLWGRH.js.map} +0 -0
- /package/dist/{config-GQRUETZ6.js.map → config-MR7UZCST.js.map} +0 -0
- /package/dist/{diff-L3TWGBA4.js.map → diff-URDY6YMT.js.map} +0 -0
- /package/dist/{digest-R52JZ3AK.js.map → digest-D4FEZNLU.js.map} +0 -0
- /package/dist/{fork-MCPMOGS5.js.map → fork-7EUVNEB7.js.map} +0 -0
- /package/dist/{hook-S64C4G2C.js.map → hook-6AD3FRKZ.js.map} +0 -0
- /package/dist/{hydrate-G5AMKHRD.js.map → hydrate-ZJZPM6YW.js.map} +0 -0
- /package/dist/{init-PCZCSRZI.js.map → init-LWL4WVSJ.js.map} +0 -0
- /package/dist/{install-skills-Z76FLXOU.js.map → install-skills-TQVWZDUD.js.map} +0 -0
- /package/dist/{move-MMGOA7MV.js.map → move-URV7XIDT.js.map} +0 -0
- /package/dist/{note-WVKK65IH.js.map → note-S6EGTEIL.js.map} +0 -0
- /package/dist/{overlaps-REVVBZCX.js.map → overlaps-4T7NLTJH.js.map} +0 -0
- /package/dist/{pin-NRSD2ZT7.js.map → pin-KKQZ3AR6.js.map} +0 -0
- /package/dist/{pr-JYOI7LCK.js.map → pr-5ZILTVDM.js.map} +0 -0
- /package/dist/{pty-host-AZ2ORVV2.js.map → pty-host-I5OJGWYA.js.map} +0 -0
- /package/dist/{read-A7LFAPPZ.js.map → read-NHK26F22.js.map} +0 -0
- /package/dist/{recent-H2LD5JOK.js.map → recent-DNSOJQVQ.js.map} +0 -0
- /package/dist/{restart-BTUO4DTI.js.map → restart-WHJDPDQA.js.map} +0 -0
- /package/dist/{resume-I7GXT2II.js.map → resume-BXIYEZM3.js.map} +0 -0
- /package/dist/{run-TE2AFYA6.js.map → run-4MQLY3XF.js.map} +0 -0
- /package/dist/{screen-XZPDSK65.js.map → screen-URKN7PU6.js.map} +0 -0
- /package/dist/{search-MGTME3CE.js.map → search-MNBYJEL7.js.map} +0 -0
- /package/dist/{section-YVBDU5MO.js.map → section-B3OQFADP.js.map} +0 -0
- /package/dist/{send-WKIX3AT5.js.map → send-2QTMQQ6E.js.map} +0 -0
- /package/dist/{sessions-2OWYXO55.js.map → sessions-4B22O45G.js.map} +0 -0
- /package/dist/{snooze-WKY2T4VZ.js.map → snooze-LSCCM3QT.js.map} +0 -0
- /package/dist/{start-ZCQT7G4C.js.map → start-KVNLZRF5.js.map} +0 -0
- /package/dist/{status-INIBC7GA.js.map → status-UEMXFLZZ.js.map} +0 -0
- /package/dist/{stop-H4PTRFNX.js.map → stop-NEQBEYEY.js.map} +0 -0
- /package/dist/{time-XQ2R7Z33.js.map → time-ON27QFG4.js.map} +0 -0
- /package/dist/{timesheet-DX2TLHIB.js.map → timesheet-HK5CHAA7.js.map} +0 -0
- /package/dist/{update-6G2E5QXG.js.map → update-M4KS23HB.js.map} +0 -0
- /package/dist/{wait-LFFXWBY7.js.map → wait-5QVWSCOL.js.map} +0 -0
|
@@ -5,19 +5,19 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
sessionFromArgs,
|
|
7
7
|
sessionPositionals
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-EXJYPF64.js";
|
|
9
9
|
import "./chunk-6AQRYLOB.js";
|
|
10
10
|
import {
|
|
11
11
|
callWorkWeb
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-
|
|
12
|
+
} from "./chunk-ZR2KWY6V.js";
|
|
13
|
+
import "./chunk-UDOXLAE7.js";
|
|
14
14
|
import "./chunk-ZSHWP2VS.js";
|
|
15
15
|
import "./chunk-E3Y4ZACK.js";
|
|
16
16
|
import "./chunk-HUXS3VAI.js";
|
|
17
17
|
import {
|
|
18
18
|
readStatus
|
|
19
|
-
} from "./chunk-
|
|
20
|
-
import "./chunk-
|
|
19
|
+
} from "./chunk-C7OK4XEZ.js";
|
|
20
|
+
import "./chunk-KTFDSJUD.js";
|
|
21
21
|
import "./chunk-RCYI7SRA.js";
|
|
22
22
|
import "./chunk-NEJVK5CF.js";
|
|
23
23
|
import {
|
|
@@ -61,4 +61,4 @@ var answerCommand = {
|
|
|
61
61
|
export {
|
|
62
62
|
answerCommand
|
|
63
63
|
};
|
|
64
|
-
//# sourceMappingURL=answer-
|
|
64
|
+
//# sourceMappingURL=answer-OF2QNF4A.js.map
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
attachSession
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-U4YUMSJY.js";
|
|
5
5
|
import "./chunk-AH5TM3NB.js";
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-U5V5J237.js";
|
|
7
|
+
import "./chunk-LBQR7KTC.js";
|
|
8
|
+
import "./chunk-UOSZFFNY.js";
|
|
9
9
|
import {
|
|
10
10
|
baseCheckoutSession
|
|
11
11
|
} from "./chunk-6AQRYLOB.js";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-62C3CJ5M.js";
|
|
13
13
|
import {
|
|
14
14
|
findSessionForCwd
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-UDOXLAE7.js";
|
|
16
16
|
import "./chunk-ZSHWP2VS.js";
|
|
17
17
|
import "./chunk-E3Y4ZACK.js";
|
|
18
18
|
import "./chunk-HUXS3VAI.js";
|
|
19
19
|
import {
|
|
20
20
|
findSession,
|
|
21
21
|
loadHistory
|
|
22
|
-
} from "./chunk-
|
|
23
|
-
import "./chunk-
|
|
22
|
+
} from "./chunk-C7OK4XEZ.js";
|
|
23
|
+
import "./chunk-KTFDSJUD.js";
|
|
24
24
|
import "./chunk-RCYI7SRA.js";
|
|
25
25
|
import "./chunk-NEJVK5CF.js";
|
|
26
26
|
import "./chunk-RT4QZRTC.js";
|
|
@@ -57,4 +57,4 @@ export {
|
|
|
57
57
|
attachCommand,
|
|
58
58
|
baseCheckoutSession
|
|
59
59
|
};
|
|
60
|
-
//# sourceMappingURL=attach-
|
|
60
|
+
//# sourceMappingURL=attach-PAFAZ2EH.js.map
|
package/dist/bin.js
CHANGED
|
@@ -41,12 +41,12 @@ process.on("uncaughtException", handleFatalError);
|
|
|
41
41
|
process.on("unhandledRejection", handleFatalError);
|
|
42
42
|
var args = process.argv.slice(2);
|
|
43
43
|
if (args[0] === "hook") {
|
|
44
|
-
const { runHookEvent } = await import("./hook-
|
|
44
|
+
const { runHookEvent } = await import("./hook-6AD3FRKZ.js");
|
|
45
45
|
await runHookEvent(args[1], args.slice(2));
|
|
46
46
|
} else {
|
|
47
47
|
const { default: chalk } = await import("chalk");
|
|
48
48
|
if (!process.env.NO_COLOR && chalk.level === 0) chalk.level = 1;
|
|
49
|
-
const { run } = await import("./cli-
|
|
49
|
+
const { run } = await import("./cli-64TLWGRH.js");
|
|
50
50
|
const { withReporter } = await import("./report-335HKCCY.js");
|
|
51
51
|
const { consoleReporter, reportStreamFor } = await import("./console-reporter-XU6VFUZE.js");
|
|
52
52
|
await withReporter(consoleReporter(reportStreamFor(args)), () => run(args));
|
|
@@ -5,21 +5,21 @@ import {
|
|
|
5
5
|
blockRefFrom,
|
|
6
6
|
readBlock,
|
|
7
7
|
removeBlocker
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-DLSAAP3S.js";
|
|
9
9
|
import {
|
|
10
10
|
sessionFromArgs,
|
|
11
11
|
sessionPositionals
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-EXJYPF64.js";
|
|
13
13
|
import "./chunk-6AQRYLOB.js";
|
|
14
|
-
import "./chunk-
|
|
14
|
+
import "./chunk-UDOXLAE7.js";
|
|
15
15
|
import "./chunk-ZSHWP2VS.js";
|
|
16
16
|
import "./chunk-E3Y4ZACK.js";
|
|
17
17
|
import "./chunk-HUXS3VAI.js";
|
|
18
18
|
import {
|
|
19
19
|
findSession,
|
|
20
20
|
loadHistory
|
|
21
|
-
} from "./chunk-
|
|
22
|
-
import "./chunk-
|
|
21
|
+
} from "./chunk-C7OK4XEZ.js";
|
|
22
|
+
import "./chunk-KTFDSJUD.js";
|
|
23
23
|
import "./chunk-RCYI7SRA.js";
|
|
24
24
|
import "./chunk-NEJVK5CF.js";
|
|
25
25
|
import {
|
|
@@ -82,4 +82,4 @@ var blockCommand = {
|
|
|
82
82
|
export {
|
|
83
83
|
blockCommand
|
|
84
84
|
};
|
|
85
|
-
//# sourceMappingURL=block-
|
|
85
|
+
//# sourceMappingURL=block-3LEG4LKJ.js.map
|
|
@@ -8,8 +8,8 @@ import {
|
|
|
8
8
|
import "./chunk-HUXS3VAI.js";
|
|
9
9
|
import {
|
|
10
10
|
loadHistory
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-C7OK4XEZ.js";
|
|
12
|
+
import "./chunk-KTFDSJUD.js";
|
|
13
13
|
import "./chunk-RCYI7SRA.js";
|
|
14
14
|
import "./chunk-NEJVK5CF.js";
|
|
15
15
|
import {
|
|
@@ -102,4 +102,4 @@ var broadcastCommand = {
|
|
|
102
102
|
export {
|
|
103
103
|
broadcastCommand
|
|
104
104
|
};
|
|
105
|
-
//# sourceMappingURL=broadcast-
|
|
105
|
+
//# sourceMappingURL=broadcast-ZDIL7UBP.js.map
|
|
@@ -3,21 +3,21 @@ import {
|
|
|
3
3
|
askCatchUp,
|
|
4
4
|
catchUp,
|
|
5
5
|
catchUpFacts
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-77SVSNME.js";
|
|
7
|
+
import "./chunk-3GAYLP7W.js";
|
|
8
|
+
import "./chunk-OIQY4OKO.js";
|
|
9
9
|
import {
|
|
10
10
|
sessionFromArgs,
|
|
11
11
|
sessionPositionals
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-EXJYPF64.js";
|
|
13
13
|
import "./chunk-6AQRYLOB.js";
|
|
14
|
-
import "./chunk-
|
|
14
|
+
import "./chunk-UDOXLAE7.js";
|
|
15
15
|
import "./chunk-ZSHWP2VS.js";
|
|
16
16
|
import "./chunk-E3Y4ZACK.js";
|
|
17
17
|
import "./chunk-HUXS3VAI.js";
|
|
18
18
|
import "./chunk-RKEY4573.js";
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-
|
|
19
|
+
import "./chunk-C7OK4XEZ.js";
|
|
20
|
+
import "./chunk-KTFDSJUD.js";
|
|
21
21
|
import "./chunk-RCYI7SRA.js";
|
|
22
22
|
import "./chunk-NEJVK5CF.js";
|
|
23
23
|
import {
|
|
@@ -49,4 +49,4 @@ var catchupCommand = {
|
|
|
49
49
|
export {
|
|
50
50
|
catchupCommand
|
|
51
51
|
};
|
|
52
|
-
//# sourceMappingURL=catchup-
|
|
52
|
+
//# sourceMappingURL=catchup-ZZ5HZJIT.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
buildAiLaunchArgs
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-KTFDSJUD.js";
|
|
5
5
|
import {
|
|
6
6
|
spawn_default
|
|
7
7
|
} from "./chunk-RCYI7SRA.js";
|
|
@@ -19,6 +19,18 @@ function openUrl(url) {
|
|
|
19
19
|
const args = process.platform === "win32" ? ["/c", "start", "", url] : [url];
|
|
20
20
|
spawn_default(cmd, args, { stdio: "ignore", detached: true }).unref();
|
|
21
21
|
}
|
|
22
|
+
var VSCODE_LIKE = /^(code|code-insiders|codium|vscodium|cursor|windsurf)$/i;
|
|
23
|
+
var JETBRAINS = /^(idea|rider|webstorm|pycharm|goland|clion|phpstorm|rubymine|datagrip)(64)?$/i;
|
|
24
|
+
var SUBLIME = /^(subl|sublime_text)$/i;
|
|
25
|
+
function editorArgs(editor, folder, file) {
|
|
26
|
+
if (!file) return [folder];
|
|
27
|
+
const name = (editor.trim().split(/[\\/]/).pop() ?? "").replace(/\.(cmd|bat|exe|sh)$/i, "");
|
|
28
|
+
const line = file.line && file.line > 0 ? Math.floor(file.line) : void 0;
|
|
29
|
+
if (VSCODE_LIKE.test(name)) return [folder, "--goto", line ? `${file.path}:${line}` : file.path];
|
|
30
|
+
if (JETBRAINS.test(name)) return line ? [folder, "--line", String(line), file.path] : [folder, file.path];
|
|
31
|
+
if (SUBLIME.test(name)) return [folder, line ? `${file.path}:${line}` : file.path];
|
|
32
|
+
return [file.path];
|
|
33
|
+
}
|
|
22
34
|
function openVSCode(dir) {
|
|
23
35
|
spawn_default.sync("code", ["."], { cwd: dir, stdio: "inherit" });
|
|
24
36
|
}
|
|
@@ -31,7 +43,8 @@ function launchAi(cwd, tool, opts = {}, port) {
|
|
|
31
43
|
export {
|
|
32
44
|
openInEditor,
|
|
33
45
|
openUrl,
|
|
46
|
+
editorArgs,
|
|
34
47
|
openVSCode,
|
|
35
48
|
launchAi
|
|
36
49
|
};
|
|
37
|
-
//# sourceMappingURL=chunk-
|
|
50
|
+
//# sourceMappingURL=chunk-2GX3IOSV.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/core/platform/launch.ts"],"sourcesContent":["import spawn from './spawn.js';\nimport { buildAiLaunchArgs, type AiLaunchOpts, type AiToolSpec } from './ai-launcher.js';\n\n/** Get the platform-appropriate default editor. */\nexport function getEditor(): string {\n return process.env.EDITOR ?? process.env.VISUAL ?? (process.platform === 'win32' ? 'notepad' : 'vi');\n}\n\n/** Open a file in the user's editor. */\nexport function openInEditor(filePath: string): void {\n const editor = getEditor();\n spawn.sync(editor, [filePath], { stdio: 'inherit' });\n}\n\n/** Open a URL in the default browser. */\nexport function openUrl(url: string): void {\n const cmd = process.platform === 'win32' ? 'cmd' : process.platform === 'darwin' ? 'open' : 'xdg-open';\n const args = process.platform === 'win32' ? ['/c', 'start', '', url] : [url];\n spawn(cmd, args, { stdio: 'ignore', detached: true }).unref();\n}\n\n/** VS Code and the editors built on it: the folder, then `--goto file:line`, opens the file at its line in that folder's window. */\nconst VSCODE_LIKE = /^(code|code-insiders|codium|vscodium|cursor|windsurf)$/i;\n/** JetBrains' launchers: `--line N file`. */\nconst JETBRAINS = /^(idea|rider|webstorm|pycharm|goland|clion|phpstorm|rubymine|datagrip)(64)?$/i;\n/** Sublime Text: `file:line`. */\nconst SUBLIME = /^(subl|sublime_text)$/i;\n\n/**\n * The arguments that open `folder` in `editor`, or a file in it at a line. An editor work doesn't know how to send\n * to a line gets the file alone (it opens at the top); with no file, the folder, as before.\n */\nexport function editorArgs(editor: string, folder: string, file?: { path: string; line?: number }): string[] {\n if (!file) return [folder];\n // Either separator, whatever this platform's: a config written on Windows names `C:\\…\\code.cmd`.\n const name = (editor.trim().split(/[\\\\/]/).pop() ?? '').replace(/\\.(cmd|bat|exe|sh)$/i, '');\n const line = file.line && file.line > 0 ? Math.floor(file.line) : undefined;\n if (VSCODE_LIKE.test(name)) return [folder, '--goto', line ? `${file.path}:${line}` : file.path];\n if (JETBRAINS.test(name)) return line ? [folder, '--line', String(line), file.path] : [folder, file.path];\n if (SUBLIME.test(name)) return [folder, line ? `${file.path}:${line}` : file.path];\n return [file.path];\n}\n\n/** Open VS Code in the given directory. */\nexport function openVSCode(dir: string): void {\n spawn.sync('code', ['.'], { cwd: dir, stdio: 'inherit' });\n}\n\n/**\n * Launch the configured AI tool in the given directory.\n *\n * When `port` is provided it is injected as `$PORT` into the launched process\n * so dev servers started by parallel agent sessions don't collide.\n */\nexport function launchAi(cwd: string, tool: AiToolSpec, opts: AiLaunchOpts = {}, port?: number): void {\n const { cmd, args } = buildAiLaunchArgs(tool, opts);\n const spawnOpts: Parameters<typeof spawn.sync>[2] =\n port !== undefined ? { cwd, stdio: 'inherit', env: { ...process.env, PORT: String(port) } } : { cwd, stdio: 'inherit' };\n spawn.sync(cmd, args, spawnOpts);\n}\n"],"mappings":";;;;;;;;;AAIO,SAAS,YAAoB;AAClC,SAAO,QAAQ,IAAI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KAAK,KAAK,OAAO,UAAU,CAAC;AAC1D;AAQO,SAAS,SAAS,KAAa,MAAkB,OAAqB,CAAC,GAAG,MAAqB;AACpG,QAAM,EAAE,KAAK,KAAK,IAAI,kBAAkB,MAAM,IAAI;AAClD,QAAM,YACJ,SAAS,SAAY,EAAE,KAAK,OAAO,WAAW,KAAK,EAAE,GAAG,QAAQ,KAAK,MAAM,OAAO,IAAI,EAAE,EAAE,IAAI,EAAE,KAAK,OAAO,UAAU;AACxH,gBAAM,KAAK,KAAK,MAAM,SAAS;AACjC;","names":[]}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
computeRangeDiff
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-OIQY4OKO.js";
|
|
5
5
|
import {
|
|
6
6
|
loadManifest
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-C7OK4XEZ.js";
|
|
8
8
|
import {
|
|
9
9
|
agentSettings,
|
|
10
10
|
internalAgent,
|
|
11
11
|
internalRunEnv,
|
|
12
12
|
killTree
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-KTFDSJUD.js";
|
|
14
14
|
import {
|
|
15
15
|
spawn_default
|
|
16
16
|
} from "./chunk-RCYI7SRA.js";
|
|
@@ -185,4 +185,4 @@ export {
|
|
|
185
185
|
runInternal,
|
|
186
186
|
summarizeCheckpoint
|
|
187
187
|
};
|
|
188
|
-
//# sourceMappingURL=chunk-
|
|
188
|
+
//# sourceMappingURL=chunk-3GAYLP7W.js.map
|
|
@@ -4,21 +4,22 @@ import {
|
|
|
4
4
|
} from "./chunk-L6RUHCKB.js";
|
|
5
5
|
import {
|
|
6
6
|
peekPty
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-U5V5J237.js";
|
|
8
8
|
import {
|
|
9
9
|
sessionStatusView
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-TROTIHD5.js";
|
|
11
11
|
import {
|
|
12
12
|
checkedOutBranch,
|
|
13
13
|
readPendingForWorktree,
|
|
14
14
|
scopeStoreIdsForPaths
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-UDOXLAE7.js";
|
|
16
16
|
import {
|
|
17
17
|
readStoresComments
|
|
18
18
|
} from "./chunk-E3Y4ZACK.js";
|
|
19
19
|
import {
|
|
20
20
|
STAGE_WANTS_YOU,
|
|
21
21
|
archiveDirFor,
|
|
22
|
+
archivedByOf,
|
|
22
23
|
bestEffort,
|
|
23
24
|
keptList,
|
|
24
25
|
prStageOf,
|
|
@@ -28,12 +29,12 @@ import {
|
|
|
28
29
|
readStatus,
|
|
29
30
|
snoozeActive,
|
|
30
31
|
withLiveClaude
|
|
31
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-C7OK4XEZ.js";
|
|
32
33
|
import {
|
|
33
34
|
agentOf,
|
|
34
35
|
agentWire,
|
|
35
36
|
readJsonlTail
|
|
36
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-KTFDSJUD.js";
|
|
37
38
|
import {
|
|
38
39
|
sessionIdFor
|
|
39
40
|
} from "./chunk-RT4QZRTC.js";
|
|
@@ -294,8 +295,11 @@ function savedFiles(saved) {
|
|
|
294
295
|
function archiveInfo(id) {
|
|
295
296
|
const rec = readArchive(id);
|
|
296
297
|
if (!rec) return {};
|
|
298
|
+
const by = archivedByOf(rec);
|
|
299
|
+
const kept = keptList(rec.kept);
|
|
297
300
|
return {
|
|
298
301
|
archive: {
|
|
302
|
+
...by ? { by } : {},
|
|
299
303
|
worktreeRemoved: rec.worktreeRemoved,
|
|
300
304
|
keptBecause: rec.keptBecause,
|
|
301
305
|
promptCount: rec.summary.promptCount,
|
|
@@ -304,7 +308,7 @@ function archiveInfo(id) {
|
|
|
304
308
|
...rec.summary.written ? { written: rec.summary.written } : {},
|
|
305
309
|
...rec.buildFolders ? { buildFolders: rec.buildFolders } : {},
|
|
306
310
|
...savedFiles(rec.uncommitted),
|
|
307
|
-
...
|
|
311
|
+
...kept ? { kept } : {}
|
|
308
312
|
}
|
|
309
313
|
};
|
|
310
314
|
}
|
|
@@ -345,4 +349,4 @@ export {
|
|
|
345
349
|
lastActiveMs,
|
|
346
350
|
createArchivedRows
|
|
347
351
|
};
|
|
348
|
-
//# sourceMappingURL=chunk-
|
|
352
|
+
//# sourceMappingURL=chunk-453EGT2R.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/core/sessions/session-wire.ts","../src/core/comments/linked-stores.ts","../src/core/sessions/session-meta.ts","../src/core/conversations/context-usage.ts","../src/core/conversations/session-title.ts"],"sourcesContent":["import fs from 'node:fs';\nimport { agentOf, agentWire } from '../agents/index.js';\nimport { readStatus } from '../status/session-status.js';\nimport { snoozeActive, type Snooze } from '../rail/snooze.js';\nimport { withLiveClaude } from '../status/session-status.js';\nimport path from 'node:path';\nimport { readSessionMeta } from './session-meta.js';\nimport { checkedOutBranch } from '../git/git-head.js';\nimport { sessionIdFor } from './web-state.js';\nimport { readContextUsage } from '../conversations/context-usage.js';\nimport { bestEffort } from '../platform/best-effort.js';\nimport type { WorktreeSession } from './history.js';\nimport type {\n DiffStat,\n SessionArchiveInfo,\n SessionAttention,\n SessionClaudes,\n SessionWire,\n BlockerWire,\n PrStageWire,\n} from '../api-types.js';\nimport { archiveDirFor, archivedByOf, keptList, readArchive } from '../archive/session-archive.js';\nimport { sessionTitle } from '../conversations/session-title.js';\nimport { prStageOf, STAGE_WANTS_YOU, type StagePr } from '../pr/pr-stage.js';\nimport { isLeftover } from '../worktree/leftover.js';\n\n/**\n * One session as every client sees it — the dashboard's /api/sessions rows\n * and `work sessions --json` alike: identity, status, activity, comments,\n * context, archive state. Built in one place so the two can't drift.\n */\nexport interface SessionWireOptions {\n /** The session's `+N −M`, when the caller has one (the web cache). */\n diffStatFor?: (id: string, s: WorktreeSession, hasStatus: boolean) => DiffStat | null;\n /** Whether its Claude runs in the PTY host (the CLI asks the host; the\n * web server's pool knows it already). */\n ptyLive?: (id: string) => boolean;\n /** Its running Claudes, wherever they were started (live-claudes.ts). */\n claudesFor?: (id: string) => SessionClaudes | null;\n /** It shares its folder with another session that owns it\n * (shared-folders.ts): the folder's activity isn't this one's. */\n shadowed?: (id: string) => boolean;\n /** Unresolved review threads on its open PRs (the PR watch's last check). */\n reviewThreadsFor?: (id: string) => number;\n /** Reply drafts its Claude wrote for you to post (pr-replies.ts). */\n replyDraftsFor?: (id: string) => number;\n /** Where its PR stands (pr-stage.ts over the PR watch's last check), and whether you've seen it there. */\n prStageFor?: (id: string) => PrStageWire | null;\n /** You have notes on it (session-notes.ts). */\n hasNote?: (id: string) => boolean;\n /** What it waits on that isn't done yet (session-blocks.ts). */\n blockedByFor?: (id: string) => BlockerWire[];\n /** The running Claudes were read against a real process list, so \"none\" means none. */\n liveKnown?: boolean;\n /** A Claude of ours runs for it (PTY host), whether or not Claude Code's file shows it yet. */\n hostedLive?: (id: string) => boolean;\n /** A status read from its terminal output, for a tool with no hooks (output-status.ts). */\n outputStatusFor?: (id: string) => SessionAttention | null;\n /** Its snooze, if any (snooze-store.ts); shown only while it holds. */\n snoozeFor?: (id: string) => Snooze | null;\n /** How far behind main — or the session it is stacked on — it is (behind-main.ts's cache). */\n behindFor?: (id: string, s: WorktreeSession) => { base: string; commits: number; conflicts: boolean; stacked?: true } | null;\n /** Where it sits in a stack (stack-sessions.ts). */\n stackFor?: (id: string) => {\n parent: { id: string; branch: string; title?: string } | null;\n children: number;\n merged?: { id: string; branch: string } | null;\n };\n}\n\nexport function sessionWire(s: WorktreeSession, opts: SessionWireOptions = {}): SessionWire {\n const id = sessionIdFor(s);\n const meta = readSessionMeta(id, s);\n const shadowed = opts.shadowed?.(id) ?? false;\n const claudes = shadowed ? null : (opts.claudesFor?.(id) ?? null);\n const reviewThreads = s.archivedAt ? 0 : (opts.reviewThreadsFor?.(id) ?? 0);\n const replyDrafts = s.archivedAt ? 0 : (opts.replyDraftsFor?.(id) ?? 0);\n const prStage = s.archivedAt ? null : (opts.prStageFor?.(id) ?? null);\n const wire: SessionWire = {\n id,\n target: s.target,\n branch: s.branch,\n isGroup: s.isGroup,\n paths: s.paths,\n baseBranch: s.baseBranch,\n jiraKey: s.jiraKey,\n createdAt: s.createdAt,\n lastAccessedAt: s.lastAccessedAt,\n draftCount: meta.draftCount,\n commentCount: meta.commentCount,\n claudeCount: meta.claudeCount,\n ptyStatus: opts.ptyLive ? (opts.ptyLive(id) ? 'running' : 'idle') : meta.ptyStatus,\n lastActivity: shadowed ? null : meta.lastActivity,\n // A running Claude is open even when it writes nothing (idle at its prompt).\n activityState: shadowed\n ? 'stale'\n : claudes\n ? claudes.busy\n ? 'active'\n : meta.activityState === 'active'\n ? 'active'\n : 'open'\n : meta.activityState,\n ...(claudes ? { agents: claudes, claudes } : {}),\n agent: agentWire(agentOf(s)),\n ...(s.archivedAt ? archiveInfo(id) : {}),\n title: bestEffort(\n `title of ${s.target}:${s.branch}`,\n () => sessionTitle(s, s.archivedAt ? readArchive(id)?.summary.prompts[0]?.text : null),\n null,\n ),\n ...(s.title ? { titleIsYours: true } : {}),\n pendingForClaudeCount: meta.pendingForClaudeCount,\n // Claude Code's own state file over what the hooks recorded, when newer.\n attention:\n meta.attention && !shadowed && opts.claudesFor\n ? withLiveClaude(meta.attention, claudes, { known: opts.liveKnown === true, hosted: opts.hostedLive?.(id) ?? true })\n : (meta.attention ?? (shadowed || s.archivedAt ? null : (opts.outputStatusFor?.(id) ?? null))),\n diffStat: opts.diffStatFor ? opts.diffStatFor(id, s, meta.attention !== null) : null,\n archivedAt: s.archivedAt ?? null,\n port: s.port ?? null,\n context: s.archivedAt ? null : bestEffort(`context usage for ${s.target}:${s.branch}`, () => readContextUsage(s), null),\n ...(reviewThreads > 0 ? { openReviewThreads: reviewThreads } : {}),\n ...(replyDrafts > 0 ? { replyDrafts } : {}),\n ...(prStage ? { prStage } : {}),\n ...otherBranches(s),\n };\n // Snoozed: only while it holds (a time not yet reached, or the status it\n // was snoozed in). \"Its status\" is what the hooks recorded — the same the\n // snooze was taken against — not the shown one, which a live Claude's state\n // file can override (that would end a snooze the moment it was set).\n const snooze = s.archivedAt ? null : (opts.snoozeFor?.(id) ?? null);\n if (snooze && snoozeActive(snooze, { attention: readStatus(id), openReviewThreads: wire.openReviewThreads, prStage: wire.prStage }))\n wire.snoozed = { until: snooze.until };\n const behind = s.archivedAt ? null : (opts.behindFor?.(id, s) ?? null);\n if (behind && behind.commits > 0) wire.behind = behind;\n const stack = s.archivedAt ? null : (opts.stackFor?.(id) ?? null);\n if (stack?.parent) wire.stackedOn = stack.parent;\n if (stack?.children) wire.stackedChildren = stack.children;\n if (stack?.merged) wire.stackParentMerged = stack.merged;\n if (opts.hasNote?.(id)) wire.hasNote = true;\n const blockers = s.archivedAt ? [] : (opts.blockedByFor?.(id) ?? []);\n if (blockers.length) wire.blockedBy = blockers;\n return wire;\n}\n\n/**\n * Repos of the session checked out on another branch than the session's\n * (read from HEAD files, no git). Ship and the PR watch follow the real\n * branch already; this is so the dashboard says so.\n */\nexport function otherBranches(s: Pick<WorktreeSession, 'branch' | 'paths' | 'target' | 'isGroup' | 'archivedAt'>): {\n onOtherBranch?: Array<{ repo: string; branch: string | null; noGit?: true }>;\n} {\n if (s.archivedAt || !s.branch) return {};\n const out: Array<{ repo: string; branch: string | null; noGit?: true }> = [];\n for (const p of s.paths) {\n if (!fs.existsSync(p)) continue;\n // A folder with no git left in it (a removal that stopped halfway) is on no branch at all.\n if (isLeftover(p)) {\n out.push({ repo: s.isGroup ? path.basename(p) : s.target, branch: null, noGit: true });\n continue;\n }\n const branch = checkedOutBranch(p);\n if (branch !== s.branch) out.push({ repo: s.isGroup ? path.basename(p) : s.target, branch });\n }\n return out.length ? { onOtherBranch: out } : {};\n}\n\n/** A session's unresolved review threads, from the PR watch's per-repo counts (open PRs only). */\nexport function reviewThreadsOf(ci: { repos: Array<{ pr: { state: string } | null; openThreads?: number }> } | null | undefined): number {\n return (ci?.repos ?? []).reduce((n, r) => n + (r.pr?.state === 'OPEN' ? (r.openThreads ?? 0) : 0), 0);\n}\n\n/** The `pr_watch_seen` key that says you saw a session at a PR stage. */\nexport const stageSeenKey = (stageKey: string) => `stage:${stageKey}`;\n\n/**\n * A session's PR stage from the PR watch's last check, with `seen` read only\n * for a stage that would bring it back to the Inbox (one lookup, not one per row).\n */\nexport function prStageWire(\n ci: { repos: Array<{ name: string; pr: StagePr | null }> } | null | undefined,\n seen: (key: string) => boolean,\n): PrStageWire | null {\n const stage = prStageOf(ci?.repos ?? []);\n if (!stage) return null;\n return STAGE_WANTS_YOU.has(stage.kind) && seen(stageSeenKey(stage.key)) ? { ...stage, seen: true } : stage;\n}\n\n/** Saved uncommitted files a Restore hasn't put back yet. */\nfunction savedFiles(saved: Record<string, { files: number; restoredAt?: string; restoreError?: string }> | undefined): {\n savedUncommitted?: number;\n} {\n const n = Object.values(saved ?? {})\n .filter((u) => !u.restoredAt && !u.restoreError)\n .reduce((sum, u) => sum + u.files, 0);\n return n ? { savedUncommitted: n } : {};\n}\n\nfunction archiveInfo(id: string): { archive?: SessionArchiveInfo } {\n const rec = readArchive(id);\n if (!rec) return {};\n const by = archivedByOf(rec);\n const kept = keptList(rec.kept);\n return {\n archive: {\n ...(by ? { by } : {}),\n worktreeRemoved: rec.worktreeRemoved,\n keptBecause: rec.keptBecause,\n promptCount: rec.summary.promptCount,\n prompts: rec.summary.prompts.map((p) => p.text),\n lastSummary: rec.summary.lastSummary,\n ...(rec.summary.written ? { written: rec.summary.written } : {}),\n ...(rec.buildFolders ? { buildFolders: rec.buildFolders } : {}),\n ...savedFiles(rec.uncommitted),\n ...(kept ? { kept } : {}),\n },\n };\n}\n\n/** Newest sign of life (ms): the hook update, Claude's last write, the\n * `work tree` entry — the same rule as the dashboard's \"Last active\". */\nexport function lastActiveMs(w: Pick<SessionWire, 'lastAccessedAt' | 'lastActivity' | 'attention'>): number {\n return Math.max(Date.parse(w.lastAccessedAt) || 0, w.lastActivity ?? 0, w.attention ? Date.parse(w.attention.updatedAt) || 0 : 0);\n}\n\n/**\n * Archived sessions' rows, kept between builds of the list: an archived\n * session doesn't change — its Claude is stopped, its worktree mostly gone —\n * and building its row reads its archive (2/3 of /api/sessions' time with\n * fifty of them). A row is built again when its archive file was written\n * (the summary lands after archiving, a Restore records what came back), it\n * was renamed or entered, or your note on it came or went.\n */\nexport function createArchivedRows(\n archiveFile: (id: string) => string = (id) => path.join(archiveDirFor(id), 'archive.json'),\n): (s: WorktreeSession, extra: { hasNote: boolean }, build: () => SessionWire) => SessionWire {\n const rows = new Map<string, { key: string; row: SessionWire }>();\n return (s, extra, build) => {\n if (!s.archivedAt) return build();\n const id = sessionIdFor(s);\n let mtime = 0;\n try {\n mtime = fs.statSync(archiveFile(id)).mtimeMs;\n } catch {\n /* none yet */\n }\n const key = `${s.archivedAt}|${mtime}|${s.title ?? ''}|${s.lastAccessedAt}|${extra.hasNote}`;\n const hit = rows.get(id);\n if (hit?.key === key) return hit.row;\n const row = build();\n rows.set(id, { key, row });\n return row;\n };\n}\n","import type { WorktreeSession } from '../sessions/history.js';\nimport { sessionIdFor } from '../sessions/session-id.js';\nimport { readStoresComments } from './comment-file-store.js';\nimport { scopeStoreIdsForPaths } from './pending-delivery.js';\nimport type { Comment } from './comment-types.js';\n\n/**\n * One worktree's comments live in two kinds of store: the session's own (the\n * dashboard's Diff tab posts there) and a `wd` scope's (`scope-<hash>`: the\n * browser diff page, `/diff/<hash>`, posts there). Claude was handed both\n * (`readPendingForWorktree`), but each view showed only its own, so a comment\n * made on one wasn't there on the other. Each view now lists its own store\n * first and the linked ones after: the session's view its scope stores, a\n * scope's view the session(s) whose worktree it covers.\n *\n * The stores stay separate — a new `wd -c` run clears its scope's comments\n * (`ensureScope`), which must never clear the session's.\n */\n\n/** A session as these lookups need it: its id (its store's) and its worktree paths. */\nexport interface LinkedSession {\n id: string;\n paths: string[];\n}\n\nexport const linkedSession = (s: WorktreeSession): LinkedSession => ({ id: sessionIdFor(s), paths: s.paths });\n\n/** The session's store, then every scope store over its paths. */\nexport function sessionLinkedStoreIds(session: LinkedSession): string[] {\n return [session.id, ...scopeStoreIdsForPaths(session.paths)];\n}\n\n/** The scope's store, then each session whose paths that scope covers (the whole worktree, or one repo of a group). */\nexport function scopeLinkedStoreIds(hash: string, sessions: LinkedSession[]): string[] {\n const own = `scope-${hash}`;\n return [own, ...new Set(sessions.filter((s) => scopeStoreIdsForPaths(s.paths).includes(own)).map((s) => s.id))];\n}\n\nexport type Read = (storeId: string) => Comment[];\n\n/** These stores read in one query (they're mostly empty: a scope store has rows only once its page was commented on). */\nexport function readerFor(storeIds: string[]): Read {\n const rows = readStoresComments(storeIds);\n return (id) => rows.get(id) ?? [];\n}\n\n/**\n * Every comment the view shows: the first store's whole, the linked ones'\n * without their drafts (a draft is that view's unsent review; this view's\n * Submit wouldn't send it). Oldest first, each comment once.\n */\nexport function linkedComments(storeIds: string[], read: Read = readerFor(storeIds)): Comment[] {\n const seen = new Set<string>();\n const out: Comment[] = [];\n storeIds.forEach((id, i) => {\n for (const c of read(id)) {\n if (seen.has(c.id) || (i > 0 && c.status === 'draft')) continue;\n seen.add(c.id);\n out.push(c);\n }\n });\n return out.sort((a, b) => a.createdAt.localeCompare(b.createdAt));\n}\n\n/** Which of these stores holds the comment (a delete, a resolve or a reply acts there), or null. */\nexport function storeHolding(storeIds: string[], commentId: string, read: Read = readerFor(storeIds)): string | null {\n return storeIds.find((id) => read(id).some((c) => c.id === commentId)) ?? null;\n}\n\n/** Who to tell a store changed: the sessions and scopes whose views list it. */\nexport function viewersOf(storeId: string, sessions: LinkedSession[]): { sessionIds: string[]; scopeHashes: string[] } {\n if (storeId.startsWith('scope-')) {\n return {\n sessionIds: [...new Set(sessions.filter((s) => scopeStoreIdsForPaths(s.paths).includes(storeId)).map((s) => s.id))],\n scopeHashes: [storeId.slice('scope-'.length)],\n };\n }\n const session = sessions.find((s) => s.id === storeId);\n return {\n sessionIds: [storeId],\n scopeHashes: session ? scopeStoreIdsForPaths(session.paths).map((id) => id.slice('scope-'.length)) : [],\n };\n}\n\n/** How a front-end tells a view its comments changed: a session's Diff tab by id, a scope page on its own stream. */\nexport interface Tell {\n session: (sessionId: string, data: Record<string, unknown>) => void;\n scope: (scopeHash: string, data: Record<string, unknown>) => void;\n}\n\n/** A store changed: every view listing it is told (both comment routes use this, so they can't drift apart). */\nexport function announceChange(storeId: string, sessions: LinkedSession[], tell: Tell, data: Record<string, unknown>): void {\n const { sessionIds, scopeHashes } = viewersOf(storeId, sessions);\n for (const sessionId of sessionIds) tell.session(sessionId, { ...data, sessionId });\n for (const scopeHash of scopeHashes) tell.scope(scopeHash, { ...data, scopeHash });\n}\n","import { peekPty } from '../pty/pty-pool.js';\nimport { sessionStatusView } from '../status/turn-activity.js';\nimport type { ActivityState } from '../api-types.js';\nimport { readSessionActivity } from './session-activity.js';\nimport { linkedComments, sessionLinkedStoreIds } from '../comments/linked-stores.js';\nimport { readPendingForWorktree } from '../comments/pending-delivery.js';\nimport type { WorktreeSession } from './history.js';\nimport { readStatus, type EffectiveStatus } from '../status/session-status.js';\n\nexport type { PtyStatus } from '../api-types.js';\nimport type { PtyStatus } from '../api-types.js';\n\nexport interface SessionMeta {\n draftCount: number;\n /** Open comment threads (top-level, not resolved): the Diff tab's badge. */\n commentCount: number;\n /** Comments authored by claude — used by the client to compute unread. */\n claudeCount: number;\n /** Set when *our* PTY pool has a live Claude for this session. Doesn't\n * catch external terminals — `activityState` does. */\n ptyStatus: PtyStatus;\n /** ms since epoch of Claude's last write across this worktree, or null. */\n lastActivity: number | null;\n /** Derived from `lastActivity`: 'active' (≤30 s), 'open' (≤5 min), 'stale'. */\n activityState: ActivityState;\n /** Published user comments not yet surfaced to Claude via the\n * UserPromptSubmit hook. Drops to zero after Claude takes its next turn. */\n pendingForClaudeCount: number;\n /** Hook-driven agent status for the attention inbox; null until the\n * session's Claude has fired a hook under a full `work web`. */\n attention: EffectiveStatus | null;\n}\n\n/**\n * Cheap per-session metadata. Goes through the file-store cache so badge\n * counts reflect in-flight writes that haven't yet hit disk — reading the\n * raw JSON behind the cache's back produced stale counts under load.\n *\n * `session` is required because we need the worktree paths to look up\n * Claude's transcript directory (the sessionId hash alone isn't enough).\n */\nexport function readSessionMeta(sessionId: string, session: WorktreeSession): SessionMeta {\n // As the Diff tab lists them: with those made on the browser diff page (linked-stores.ts).\n const comments = linkedComments(sessionLinkedStoreIds({ id: sessionId, paths: session.paths }));\n let drafts = 0;\n let claude = 0;\n let open = 0;\n for (const c of comments) {\n if (c.status === 'draft') drafts++;\n if (c.author === 'claude') claude++;\n // The Diff tab's badge: threads still open. One Claude worked through is resolved (resolveAddressed).\n if (!c.parentId && !c.resolved) open++;\n }\n const activity = readSessionActivity(session);\n // What the hooks will hand over: the session's and its scopes' (readPendingForWorktree), as the badges count.\n const pending = readPendingForWorktree(session, sessionId).length;\n const status = readStatus(sessionId);\n return {\n draftCount: drafts,\n commentCount: open,\n claudeCount: claude,\n ptyStatus: peekPty(sessionId) ? 'running' : 'idle',\n lastActivity: activity.lastActivity,\n activityState: activity.state,\n pendingForClaudeCount: pending,\n attention: status ? sessionStatusView(status, session, activity.lastActivity ?? 0) : null,\n };\n}\n","import { readJsonlTail } from './jsonl.js';\nimport { agentOf } from '../agents/index.js';\nimport type { ConversationEntry } from '../agents/types.js';\nimport type { ContextUsage } from '../api-types.js';\nimport type { WorktreeSession } from '../sessions/session-types.js';\n\nexport type { ContextUsage } from '../api-types.js';\n\n/**\n * How full a session's conversation is. Every assistant message in the\n * transcript carries the token usage of the request that produced it, so\n * the newest one says how big the context is now: its prompt (input +\n * cache reads + cache writes) plus its reply, which the next turn carries.\n * Near the window Claude Code compacts the conversation, and answers get\n * worse before that — the dashboard shows when to start fresh.\n */\n\n/** From conversation entries (oldest first): the newest main-thread usage, in the agent's window (`window`). */\nexport function contextUsageFrom(\n entries: readonly ConversationEntry[],\n window: (model: string | undefined, used: number) => number,\n): ContextUsage | null {\n for (let i = entries.length - 1; i >= 0; i--) {\n const e = entries[i];\n // Subagent (Task) turns run in their own context.\n if (e.role !== 'agent' || e.sidechain || !e.usage) continue;\n const used = e.usage.prompt + e.usage.reply;\n if (used === 0) continue;\n return { used, window: window(e.model, used), ...(e.model ? { model: e.model } : {}) };\n }\n return null;\n}\n\n// Claude Code's transcript files, for the callers that still read Claude's own records (turn activity): agents/claude-files.ts.\nexport type { ConversationFile as TranscriptFile } from '../agents/types.js';\n\n/** Only the tail is read — a usage line is always near the end. */\nconst USAGE_TAIL_BYTES = 64 * 1024;\nconst cache = new Map<string, { key: string; usage: ContextUsage | null }>();\n\n/** The session's context usage now, through its agent; re-reads a conversation only after it changed. Null when work can't read its agent's conversations. */\nexport function readContextUsage(session: WorktreeSession): ContextUsage | null {\n const conv = agentOf(session).conversation;\n if (!conv) return null;\n let t: { file: string; size: number; mtimeMs: number } | null = null;\n for (const f of conv.files(session)) if (!t || f.mtimeMs > t.mtimeMs) t = f;\n if (!t) return null;\n const key = `${t.file}:${t.size}:${t.mtimeMs}`;\n const id = session.paths.join('|');\n const hit = cache.get(id);\n if (hit?.key === key) return hit.usage;\n const usage = contextUsageFrom(conv.entries(readJsonlTail(t.file, USAGE_TAIL_BYTES)), conv.contextWindow);\n cache.set(id, { key, usage });\n return usage;\n}\n","import fs from 'node:fs';\nimport { promptsSince } from './digest.js';\nimport { agentOf } from '../agents/index.js';\nimport type { ConversationEntry } from '../agents/types.js';\nimport type { WorktreeSession } from '../sessions/session-types.js';\n\n/**\n * A human name for a session, beside its branch: the name you gave it, or\n * else what you first asked its Claude (\"Rotate the terminal encryption\n * keys\"), or else its Jira key. Worked out when read — the first prompt is\n * read from the start of its oldest transcript, cached per file — so a GET\n * writes nothing; only a rename is stored.\n */\n\nconst TITLE_CHARS = 80;\nconst HEAD_BYTES = 256 * 1024;\nconst cache = new Map<string, { size: number; title: string | null }>();\n\n/** The first prompt in a conversation file (read from its start), its lines read by `toEntries` (the agent's). */\nexport function firstPromptOf(file: string, toEntries: (lines: readonly unknown[]) => ConversationEntry[]): string | null {\n let size: number;\n try {\n size = fs.statSync(file).size;\n } catch {\n return null;\n }\n const hit = cache.get(file);\n // The start of a file doesn't change as it grows, unless it was replaced\n // (smaller). \"No prompt in it\" holds as long as the file is the same, or\n // its whole head was read already: re-reading 256 KB of every such\n // transcript on every session-list build cost the most of all.\n if (hit && size >= hit.size && (hit.title !== null || size === hit.size || hit.size >= HEAD_BYTES)) return hit.title;\n let text: string;\n try {\n const fd = fs.openSync(file, 'r');\n try {\n const buf = Buffer.alloc(Math.min(size, HEAD_BYTES));\n fs.readSync(fd, buf, 0, buf.length, 0);\n text = buf.toString('utf8');\n } finally {\n fs.closeSync(fd);\n }\n } catch {\n return null;\n }\n const lines: unknown[] = [];\n for (const line of text.split('\\n')) {\n try {\n lines.push(JSON.parse(line));\n } catch {\n /* the last, cut-off line */\n }\n }\n const first = promptsSince([toEntries(lines)], 0)[0]?.text ?? null;\n const readable = first ? titleText(first) : null;\n const title = readable ? clip(readable) : null;\n cache.set(file, { size, title });\n return title;\n}\n\nconst clip = (s: string) => (s.length > TITLE_CHARS ? s.slice(0, TITLE_CHARS - 1).trimEnd() + '…' : s);\n\n/**\n * A prompt as a name: what you wrote, without markup. A pasted block\n * (`<pasted_content …>…</pasted_content>`, a log or code you pasted) is left\n * out when you also wrote something; a prompt that is only a paste keeps its\n * text. Other tags are dropped, their text kept. Null when nothing is left.\n */\nexport function titleText(prompt: string): string | null {\n const flat = (s: string) =>\n s\n .replace(/<\\/?[A-Za-z][\\w-]*(?:\\s[^>]*)?>/g, ' ')\n .replace(/\\s+/g, ' ')\n .trim();\n const outside = flat(prompt.replace(/<pasted_content\\b[^>]*>[\\s\\S]*?<\\/pasted_content>/g, ' '));\n const text = outside || flat(prompt);\n return text ? text : null;\n}\n\n/** The session's name: yours, else its first prompt, else its Jira key. */\nexport function sessionTitle(s: WorktreeSession, fallbackPrompt?: string | null): string | null {\n if (s.title?.trim()) return s.title.trim();\n const conv = agentOf(s).conversation;\n const oldestFirst = (conv?.files(s) ?? []).sort((a, b) => a.mtimeMs - b.mtimeMs);\n for (const t of oldestFirst) {\n const p = firstPromptOf(t.file, conv!.entries);\n if (p) return p;\n }\n const fallback = fallbackPrompt ? titleText(fallbackPrompt) : null;\n if (fallback) return clip(fallback);\n return s.jiraKey ?? null;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAOA,SAAQ;AAKf,OAAO,UAAU;;;ACoBV,IAAM,gBAAgB,CAAC,OAAuC,EAAE,IAAI,aAAa,CAAC,GAAG,OAAO,EAAE,MAAM;AAGpG,SAAS,sBAAsB,SAAkC;AACtE,SAAO,CAAC,QAAQ,IAAI,GAAG,sBAAsB,QAAQ,KAAK,CAAC;AAC7D;AAGO,SAAS,oBAAoB,MAAc,UAAqC;AACrF,QAAM,MAAM,SAAS,IAAI;AACzB,SAAO,CAAC,KAAK,GAAG,IAAI,IAAI,SAAS,OAAO,CAAC,MAAM,sBAAsB,EAAE,KAAK,EAAE,SAAS,GAAG,CAAC,EAAE,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AAChH;AAKO,SAAS,UAAU,UAA0B;AAClD,QAAM,OAAO,mBAAmB,QAAQ;AACxC,SAAO,CAAC,OAAO,KAAK,IAAI,EAAE,KAAK,CAAC;AAClC;AAOO,SAAS,eAAe,UAAoB,OAAa,UAAU,QAAQ,GAAc;AAC9F,QAAM,OAAO,oBAAI,IAAY;AAC7B,QAAM,MAAiB,CAAC;AACxB,WAAS,QAAQ,CAAC,IAAI,MAAM;AAC1B,eAAW,KAAK,KAAK,EAAE,GAAG;AACxB,UAAI,KAAK,IAAI,EAAE,EAAE,KAAM,IAAI,KAAK,EAAE,WAAW,QAAU;AACvD,WAAK,IAAI,EAAE,EAAE;AACb,UAAI,KAAK,CAAC;AAAA,IACZ;AAAA,EACF,CAAC;AACD,SAAO,IAAI,KAAK,CAAC,GAAG,MAAM,EAAE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AE,UAAU,IAAI,KAAK,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,cAAc,IAAI,MAAM,OAAO;AAC1F,UAAM,MAAM,KAAK,IAAI,EAAE;AACvB,QAAI,KAAK,QAAQ,IAAK,QAAO,IAAI;AACjC,UAAM,MAAM,MAAM;AAClB,SAAK,IAAI,IAAI,EAAE,KAAK,IAAI,CAAC;AACzB,WAAO;AAAA,EACT;AACF;","names":["fs","cache","fs"]}
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./chunk-4KZBZA5D.js";
|
|
5
5
|
import {
|
|
6
6
|
loadHistory
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-C7OK4XEZ.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-46VAWZZX.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
readStatus
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-C7OK4XEZ.js";
|
|
5
5
|
|
|
6
6
|
// src/commands/shared/turn-wait.ts
|
|
7
7
|
var cliWaitDeps = {
|
|
@@ -16,4 +16,4 @@ var cliWaitDeps = {
|
|
|
16
16
|
export {
|
|
17
17
|
cliWaitDeps
|
|
18
18
|
};
|
|
19
|
-
//# sourceMappingURL=chunk-
|
|
19
|
+
//# sourceMappingURL=chunk-4CVUV2SE.js.map
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
stageWaiting,
|
|
4
4
|
stageWantsYou
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-C7OK4XEZ.js";
|
|
6
6
|
import {
|
|
7
7
|
atomicWriteFile,
|
|
8
8
|
getConfigDir
|
|
@@ -191,4 +191,4 @@ export {
|
|
|
191
191
|
assistantContextDay,
|
|
192
192
|
readAssistantContext
|
|
193
193
|
};
|
|
194
|
-
//# sourceMappingURL=chunk-
|
|
194
|
+
//# sourceMappingURL=chunk-62C3CJ5M.js.map
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
runInternal
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-3GAYLP7W.js";
|
|
5
5
|
import {
|
|
6
6
|
messageOf,
|
|
7
7
|
readStatus
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-C7OK4XEZ.js";
|
|
9
9
|
import {
|
|
10
10
|
agentOf,
|
|
11
11
|
lineTimeOf,
|
|
12
12
|
readJsonlSince
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-KTFDSJUD.js";
|
|
14
14
|
import {
|
|
15
15
|
sessionIdFor
|
|
16
16
|
} from "./chunk-RT4QZRTC.js";
|
|
@@ -100,4 +100,4 @@ export {
|
|
|
100
100
|
cachedCatchUp,
|
|
101
101
|
catchUp
|
|
102
102
|
};
|
|
103
|
-
//# sourceMappingURL=chunk-
|
|
103
|
+
//# sourceMappingURL=chunk-77SVSNME.js.map
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
killTree,
|
|
8
8
|
processName,
|
|
9
9
|
readJsonlTail
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-KTFDSJUD.js";
|
|
11
11
|
import {
|
|
12
12
|
spawn_default
|
|
13
13
|
} from "./chunk-RCYI7SRA.js";
|
|
@@ -459,6 +459,9 @@ import fs4 from "fs";
|
|
|
459
459
|
import path4 from "path";
|
|
460
460
|
import zlib2 from "zlib";
|
|
461
461
|
|
|
462
|
+
// src/core/api-types.ts
|
|
463
|
+
var ARCHIVED_BY = ["you", "shipped", "pr-merged", "cleanup"];
|
|
464
|
+
|
|
462
465
|
// src/core/archive/session-archive.ts
|
|
463
466
|
import fs3 from "fs";
|
|
464
467
|
|
|
@@ -802,6 +805,9 @@ function buildDigest(inputs, sinceMs) {
|
|
|
802
805
|
}
|
|
803
806
|
|
|
804
807
|
// src/core/archive/session-archive.ts
|
|
808
|
+
function archivedByOf(rec) {
|
|
809
|
+
return ARCHIVED_BY.find((b) => b === rec.archivedBy);
|
|
810
|
+
}
|
|
805
811
|
var SUMMARY_PROMPTS = 40;
|
|
806
812
|
var archiveRoot = () => path3.join(getConfigDir(), "archive");
|
|
807
813
|
var archiveDirFor = (id, root = archiveRoot()) => path3.join(root, id);
|
|
@@ -875,7 +881,10 @@ async function archiveSteps(s, deps, opts) {
|
|
|
875
881
|
let leftovers = [];
|
|
876
882
|
let ignored = {};
|
|
877
883
|
const ignoredDir = path3.join(dir, "ignored");
|
|
878
|
-
|
|
884
|
+
let stopped = [];
|
|
885
|
+
const runningThere = verdict.ok && opts.unattended ? await deps.runningFrom?.(s).catch(() => ["(couldn't tell: the process list didn't answer)"]) ?? [] : [];
|
|
886
|
+
if (verdict.ok && runningThere.length === 0) {
|
|
887
|
+
if (!opts.unattended) stopped = await deps.stopRunningFrom?.(s).catch(() => []) ?? [];
|
|
879
888
|
fs3.rmSync(ignoredDir, { recursive: true, force: true });
|
|
880
889
|
ignored = deps.saveIgnored ? await deps.saveIgnored(s, dir).catch(() => ({})) : {};
|
|
881
890
|
worktreeRemoved = await deps.removeWorktree(s);
|
|
@@ -884,7 +893,7 @@ async function archiveSteps(s, deps, opts) {
|
|
|
884
893
|
else if (!worktreeRemoved)
|
|
885
894
|
keptBecause = leftovers.length ? `git removed ${leftovers.join(", ")} only in part (a file in use) and kept the rest` : "git refused to remove the worktree";
|
|
886
895
|
} else {
|
|
887
|
-
keptBecause = saving.error && !verdict.reason.includes(saving.error) ? `${verdict.reason} (${saving.error})` : verdict.reason;
|
|
896
|
+
keptBecause = runningThere.length ? `still running from it: ${runningThere.join(", ")}` : saving.error && !verdict.reason.includes(saving.error) ? `${verdict.reason} (${saving.error})` : verdict.reason;
|
|
888
897
|
}
|
|
889
898
|
if (!worktreeRemoved && !leftovers.length && Object.keys(saved).length) {
|
|
890
899
|
await deps.dropSaved?.(s, saved, dir).catch(() => {
|
|
@@ -901,7 +910,7 @@ async function archiveSteps(s, deps, opts) {
|
|
|
901
910
|
let branchesDeleted = [];
|
|
902
911
|
let buildFolders;
|
|
903
912
|
if (worktreeRemoved) branchesDeleted = await deps.tidy?.(s, heads).catch(() => []) ?? [];
|
|
904
|
-
else if (keptBecause !== "it is the repo's own checkout" && deps.clearBuildFolders) {
|
|
913
|
+
else if (keptBecause !== "it is the repo's own checkout" && runningThere.length === 0 && deps.clearBuildFolders) {
|
|
905
914
|
buildFolders = await deps.clearBuildFolders(s).catch(() => void 0);
|
|
906
915
|
}
|
|
907
916
|
const all = promptsSince(entries, 0);
|
|
@@ -913,6 +922,7 @@ async function archiveSteps(s, deps, opts) {
|
|
|
913
922
|
isGroup: s.isGroup,
|
|
914
923
|
paths: s.paths,
|
|
915
924
|
archivedAt: new Date(now()).toISOString(),
|
|
925
|
+
...opts.by ? { archivedBy: opts.by } : {},
|
|
916
926
|
worktreeRemoved,
|
|
917
927
|
keptBecause,
|
|
918
928
|
...leftovers.length ? { leftovers } : {},
|
|
@@ -946,7 +956,7 @@ async function archiveSteps(s, deps, opts) {
|
|
|
946
956
|
worktreeRemoved,
|
|
947
957
|
keptBecause,
|
|
948
958
|
transcripts: copied.length,
|
|
949
|
-
message: (worktreeRemoved ? `Archived; worktree removed, conversation kept${savedFiles(saved) ? `, ${savedFiles(saved)} uncommitted file${savedFiles(saved) === 1 ? "" : "s"} saved for Restore` : ""}${leftovers.length ? `; git stopped at a file in use, so part of the folder is left (${leftovers.join(", ")}): close what holds it and delete it, or Restore puts it back` : ""}` : `Archived; worktree kept (${keptBecause})`) + (keptList(kept) ? `; kept for Restore: ${keptList(kept)}` : ""),
|
|
959
|
+
message: (worktreeRemoved ? `Archived; worktree removed, conversation kept${savedFiles(saved) ? `, ${savedFiles(saved)} uncommitted file${savedFiles(saved) === 1 ? "" : "s"} saved for Restore` : ""}${leftovers.length ? `; git stopped at a file in use, so part of the folder is left (${leftovers.join(", ")}): close what holds it and delete it, or Restore puts it back` : ""}` : `Archived; worktree kept (${keptBecause})`) + (keptList(kept) ? `; kept for Restore: ${keptList(kept)}` : "") + (stopped.length ? `; stopped what still ran from it: ${stopped.join(", ")}` : ""),
|
|
950
960
|
...keptList(kept) ? { kept: keptList(kept) } : {}
|
|
951
961
|
};
|
|
952
962
|
}
|
|
@@ -1026,13 +1036,32 @@ function isArchiveRecord(x) {
|
|
|
1026
1036
|
const r = x;
|
|
1027
1037
|
return !!r && typeof r === "object" && typeof r.sessionId === "string" && typeof r.worktreeRemoved === "boolean" && Array.isArray(r.transcripts) && !!r.summary && Array.isArray(r.summary.prompts);
|
|
1028
1038
|
}
|
|
1039
|
+
var RESTORED_AGE_MS = 10 * 6e4;
|
|
1040
|
+
function lastEntryTime(file, entries) {
|
|
1041
|
+
for (const bytes of [64 * 1024, 4 * 1024 * 1024]) {
|
|
1042
|
+
let t = 0;
|
|
1043
|
+
for (const e of entries(readJsonlTail(file, bytes))) {
|
|
1044
|
+
const at = Date.parse(e.at);
|
|
1045
|
+
if (Number.isFinite(at) && at > t) t = at;
|
|
1046
|
+
}
|
|
1047
|
+
if (t || fileSize(file) <= bytes) return t;
|
|
1048
|
+
}
|
|
1049
|
+
return 0;
|
|
1050
|
+
}
|
|
1051
|
+
function fileSize(file) {
|
|
1052
|
+
try {
|
|
1053
|
+
return fs3.statSync(file).size;
|
|
1054
|
+
} catch {
|
|
1055
|
+
return 0;
|
|
1056
|
+
}
|
|
1057
|
+
}
|
|
1029
1058
|
function restoreArchivedTranscripts(s, root = archiveRoot(), restoreDir = (x) => agentOf(x).conversation?.restoreDir?.(x) ?? null) {
|
|
1030
1059
|
const id = sessionIdFor(s);
|
|
1031
1060
|
const rec = readArchive(id, root);
|
|
1032
1061
|
if (!rec) return 0;
|
|
1033
1062
|
const dest = restoreDir(s);
|
|
1034
1063
|
if (!dest) return 0;
|
|
1035
|
-
|
|
1064
|
+
const written = /* @__PURE__ */ new Set();
|
|
1036
1065
|
for (const t of rec.transcripts) {
|
|
1037
1066
|
const to = path3.join(dest, t.file);
|
|
1038
1067
|
if (fs3.existsSync(to)) continue;
|
|
@@ -1040,9 +1069,28 @@ function restoreArchivedTranscripts(s, root = archiveRoot(), restoreDir = (x) =>
|
|
|
1040
1069
|
if (text === null) continue;
|
|
1041
1070
|
fs3.mkdirSync(dest, { recursive: true });
|
|
1042
1071
|
fs3.writeFileSync(to, text);
|
|
1043
|
-
|
|
1072
|
+
written.add(to);
|
|
1073
|
+
}
|
|
1074
|
+
if (written.size === 0) return 0;
|
|
1075
|
+
const entries = agentOf(s).conversation?.entries ?? (() => []);
|
|
1076
|
+
const files = [];
|
|
1077
|
+
for (const t of rec.transcripts) {
|
|
1078
|
+
const file = path3.join(dest, t.file);
|
|
1079
|
+
try {
|
|
1080
|
+
files.push({ file, last: lastEntryTime(file, entries) || (written.has(file) ? 0 : fs3.statSync(file).mtimeMs) });
|
|
1081
|
+
} catch {
|
|
1082
|
+
}
|
|
1083
|
+
}
|
|
1084
|
+
files.sort((a, b) => a.last - b.last);
|
|
1085
|
+
const newest = Date.now() - RESTORED_AGE_MS;
|
|
1086
|
+
for (const [i, { file }] of files.entries()) {
|
|
1087
|
+
const at = new Date(newest - (files.length - 1 - i) * 1e3);
|
|
1088
|
+
try {
|
|
1089
|
+
fs3.utimesSync(file, at, at);
|
|
1090
|
+
} catch {
|
|
1091
|
+
}
|
|
1044
1092
|
}
|
|
1045
|
-
return
|
|
1093
|
+
return written.size;
|
|
1046
1094
|
}
|
|
1047
1095
|
|
|
1048
1096
|
// src/core/archive/archive-search.ts
|
|
@@ -2391,6 +2439,7 @@ export {
|
|
|
2391
2439
|
promptEntries,
|
|
2392
2440
|
promptsSince,
|
|
2393
2441
|
buildDigest,
|
|
2442
|
+
archivedByOf,
|
|
2394
2443
|
archiveRoot,
|
|
2395
2444
|
archiveDirFor,
|
|
2396
2445
|
onArchived,
|
|
@@ -2450,4 +2499,4 @@ export {
|
|
|
2450
2499
|
mergeHydratedSessions,
|
|
2451
2500
|
forgetOtherBaseCheckoutEntries
|
|
2452
2501
|
};
|
|
2453
|
-
//# sourceMappingURL=chunk-
|
|
2502
|
+
//# sourceMappingURL=chunk-C7OK4XEZ.js.map
|