@moberg_hr/work-tree 2.9.1 → 2.9.3
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/{account-RTOXCLE6.js → account-NG75VLRU.js} +14 -13
- package/dist/{account-RTOXCLE6.js.map → account-NG75VLRU.js.map} +1 -1
- package/dist/{add-repo-AA3XTOZT.js → add-repo-EDU3QEYI.js} +9 -9
- package/dist/{answer-NT62U5MY.js → answer-MHOJ2J6S.js} +7 -7
- package/dist/{attach-HKVFNOOK.js → attach-37JOJ4C3.js} +12 -11
- package/dist/{attach-HKVFNOOK.js.map → attach-37JOJ4C3.js.map} +1 -1
- package/dist/bin.js +3 -3
- package/dist/{block-YZQGJMLI.js → block-D5CAR53T.js} +8 -8
- package/dist/{broadcast-2NOVIUZI.js → broadcast-LLYHUWXA.js} +5 -5
- package/dist/{catchup-LZ5FMXEO.js → catchup-2SL3JGA7.js} +10 -10
- package/dist/{chunk-ODBA4PVE.js → chunk-26OVU2AE.js} +4 -4
- package/dist/{chunk-PDWEPIL6.js → chunk-2JNW2AQ2.js} +2 -1
- package/dist/chunk-2JNW2AQ2.js.map +1 -0
- package/dist/{chunk-RVT4435Z.js → chunk-37XQIG7F.js} +63 -97
- package/dist/chunk-37XQIG7F.js.map +1 -0
- package/dist/{chunk-GEGRI67Z.js → chunk-3C3BKZ3H.js} +3 -3
- package/dist/{chunk-BDFAIHTM.js → chunk-63VY4YJM.js} +4 -4
- package/dist/{chunk-VNNAKJZA.js → chunk-6E2I2FBJ.js} +10 -10
- package/dist/{chunk-FK2ZZUR5.js → chunk-6FVYSW3E.js} +4 -73
- package/dist/chunk-6FVYSW3E.js.map +1 -0
- package/dist/{chunk-BNGX2JGD.js → chunk-72IBYKIY.js} +2 -2
- package/dist/{chunk-SXPC4FQM.js → chunk-7OUIZ2YQ.js} +53 -53
- package/dist/{chunk-3NXRBRRJ.js → chunk-AAYWHIIT.js} +11 -4
- package/dist/chunk-AAYWHIIT.js.map +1 -0
- package/dist/{chunk-BGKHI4FC.js → chunk-ATED7SAH.js} +3 -3
- package/dist/{chunk-T6BX6B5B.js → chunk-BSP2Z7B7.js} +2 -2
- package/dist/{chunk-PGZMPB2Q.js → chunk-CCTALU3C.js} +2 -2
- package/dist/{chunk-N7EHLEYG.js → chunk-CLBQ7ZC4.js} +2 -2
- package/dist/{chunk-4GVXOUVN.js → chunk-CMO5YUZR.js} +2 -2
- package/dist/{chunk-JAU62YN5.js → chunk-CYWI3ZW7.js} +4 -4
- package/dist/{chunk-QNH6ZRFV.js → chunk-DQCUYCMX.js} +2 -2
- package/dist/{chunk-ZJSEDIFT.js → chunk-GRLKPVTP.js} +11 -8
- package/dist/chunk-GRLKPVTP.js.map +1 -0
- package/dist/{chunk-IGC64EGV.js → chunk-HCVONKJI.js} +6 -6
- package/dist/{chunk-4OK2WJ2B.js → chunk-HEPBANFJ.js} +5 -5
- package/dist/{chunk-AHA65ZCO.js → chunk-INQQGV2G.js} +3 -3
- package/dist/{chunk-AQJSY4CI.js → chunk-IPGH7TXJ.js} +2 -2
- package/dist/{chunk-HJZSMSP4.js → chunk-IWJXFNM4.js} +6 -6
- package/dist/{chunk-JFN67PRA.js → chunk-KSUOVFO3.js} +2 -2
- package/dist/{chunk-7NSQVIIK.js → chunk-MG5TTLYZ.js} +2 -2
- package/dist/chunk-NWIVXGSL.js +9 -0
- package/dist/chunk-OTAZOIXK.js +78 -0
- package/dist/chunk-OTAZOIXK.js.map +1 -0
- package/dist/{chunk-HKK3WUPZ.js → chunk-P6BHOAQG.js} +2 -2
- package/dist/{chunk-RCZZAQFN.js → chunk-PRDRRU2B.js} +4 -4
- package/dist/{chunk-CYXMVMVO.js → chunk-PTWVOT7A.js} +223 -9
- package/dist/chunk-PTWVOT7A.js.map +1 -0
- package/dist/{chunk-6KOJSRML.js → chunk-QEVYCCKD.js} +2 -2
- package/dist/{chunk-7NZC7EAP.js → chunk-QHTXLCG7.js} +7 -7
- package/dist/{chunk-A633PJUP.js → chunk-QL36KN7X.js} +3 -3
- package/dist/{chunk-7POCHRUP.js → chunk-QSOEMCWQ.js} +6 -6
- package/dist/{chunk-J4Y7DKQN.js → chunk-RFINYWID.js} +3 -3
- package/dist/{chunk-4WG66W6U.js → chunk-S3FMTEFR.js} +4 -4
- package/dist/{chunk-MVMLNEHM.js → chunk-T7AFYEQ7.js} +4 -4
- package/dist/{chunk-JT5AR7PO.js → chunk-TPSFJSO7.js} +72 -3
- package/dist/chunk-TPSFJSO7.js.map +1 -0
- package/dist/{chunk-MPY2ZQBL.js → chunk-VUAVPBFR.js} +4 -4
- package/dist/{chunk-T22E35FV.js → chunk-WC534PXU.js} +5 -5
- package/dist/{chunk-T22E35FV.js.map → chunk-WC534PXU.js.map} +1 -1
- package/dist/{chunk-UJWMBDFX.js → chunk-WTQ2QCAG.js} +3 -3
- package/dist/{chunk-7OTYC7T5.js → chunk-WXE7D44E.js} +3 -3
- package/dist/{chunk-IJSW2U6U.js → chunk-WXMWZRBH.js} +2 -2
- package/dist/{chunk-FXWY22ZP.js → chunk-XVNRP7XE.js} +6 -6
- package/dist/{chunk-2Z2O5LEA.js → chunk-ZI2KXTKM.js} +2 -2
- package/dist/{cleanup-6NOT6VTS.js → cleanup-5PSLKZLF.js} +20 -19
- package/dist/{cleanup-6NOT6VTS.js.map → cleanup-5PSLKZLF.js.map} +1 -1
- package/dist/{cli-PAICDKJT.js → cli-AF7636FA.js} +4 -4
- package/dist/{config-U4SGJ7RB.js → config-6MSITKGB.js} +7 -7
- package/dist/{diff-CYXW5YWD.js → diff-Q7MV6YGJ.js} +8 -8
- package/dist/{digest-KRIBJHII.js → digest-KUMVYXKZ.js} +7 -7
- package/dist/{fork-LQYEB4A4.js → fork-OFENISEM.js} +18 -17
- package/dist/{fork-LQYEB4A4.js.map → fork-OFENISEM.js.map} +1 -1
- package/dist/{history-DCALTZMM.js → history-5WKRWARZ.js} +5 -5
- package/dist/{hook-MDFVVCD2.js → hook-ARS32DG2.js} +9 -8
- package/dist/{hook-MDFVVCD2.js.map → hook-ARS32DG2.js.map} +1 -1
- package/dist/{hydrate-KBWZSSBL.js → hydrate-LCT6DVB3.js} +5 -5
- package/dist/{init-R47WGD62.js → init-FJKPEY5N.js} +6 -6
- package/dist/{install-skills-IIMTRQ4K.js → install-skills-UYAFVJBA.js} +5 -5
- package/dist/install-skills-bin.js +4 -4
- package/dist/{list-X5YB4JRL.js → list-GTKP5FAW.js} +5 -5
- package/dist/{move-WSK5UU5T.js → move-GOCLEFGZ.js} +8 -8
- package/dist/{note-VMO2PKYX.js → note-B7TQBXQF.js} +7 -7
- package/dist/{overlaps-ZNZTQHU7.js → overlaps-UKQHIJMU.js} +7 -7
- package/dist/{pin-RGRNNJUL.js → pin-UZZCDK7M.js} +7 -7
- package/dist/{pr-B2V3N3SV.js → pr-NU2ME2XW.js} +8 -7
- package/dist/{pr-B2V3N3SV.js.map → pr-NU2ME2XW.js.map} +1 -1
- package/dist/{prune-M2MYPNI6.js → prune-IZGEYTSB.js} +18 -17
- package/dist/{prune-M2MYPNI6.js.map → prune-IZGEYTSB.js.map} +1 -1
- package/dist/{pty-host-I2I7SVOL.js → pty-host-AWDIKPQN.js} +46 -41
- package/dist/pty-host-AWDIKPQN.js.map +1 -0
- package/dist/{read-E22APCUR.js → read-U6GBGA5E.js} +7 -7
- package/dist/{recent-F3Z3JXFX.js → recent-2DUMLUDG.js} +6 -6
- package/dist/{remove-YGVUESDY.js → remove-OXUP4O33.js} +17 -16
- package/dist/{remove-YGVUESDY.js.map → remove-OXUP4O33.js.map} +1 -1
- package/dist/{restart-BAGGJDD2.js → restart-QEW4DJC3.js} +7 -7
- package/dist/{resume-PIFCI727.js → resume-K45IT4QO.js} +6 -6
- package/dist/{run-MW3QTOXU.js → run-42LORGPS.js} +5 -5
- package/dist/{screen-UILBPWSR.js → screen-2TLIUH3G.js} +7 -7
- package/dist/{search-DLZEPI4I.js → search-7E4B2KX6.js} +5 -5
- package/dist/{section-A5JKTX4J.js → section-OVA5VD7L.js} +7 -7
- package/dist/{send-EPPQKYOK.js → send-BJY5CYLO.js} +8 -8
- package/dist/{sessions-3HLVK6HG.js → sessions-4A24ZORW.js} +15 -14
- package/dist/{sessions-3HLVK6HG.js.map → sessions-4A24ZORW.js.map} +1 -1
- package/dist/{snooze-GA46Z56G.js → snooze-WIVKB3GH.js} +7 -7
- package/dist/{start-L6G3NC2J.js → start-G6GR533S.js} +7 -7
- package/dist/{state-OZF4S7PG.js → state-S3DGLT4J.js} +2 -2
- package/dist/{status-H5S3DZBI.js → status-BTAWY6JQ.js} +5 -5
- package/dist/{statusline-RSQMMCRN.js → statusline-WLXEU5DM.js} +3 -3
- package/dist/{stop-HQLHTY5V.js → stop-FN6EPFJ4.js} +7 -7
- package/dist/{sync-N2CDSJA4.js → sync-T3BSHX6Q.js} +18 -17
- package/dist/{sync-N2CDSJA4.js.map → sync-T3BSHX6Q.js.map} +1 -1
- package/dist/{time-H54NH62B.js → time-5CH5O5MZ.js} +8 -8
- package/dist/{time-actions-DB7OQ2IS.js → time-actions-XEUQ3UF7.js} +3 -3
- package/dist/{timesheet-PAS5SHPD.js → timesheet-FMQKPS5S.js} +10 -10
- package/dist/{todo-ODF7RI27.js → todo-23COLGR2.js} +2 -2
- package/dist/{tree-7EBS7PVA.js → tree-T33VU473.js} +14 -13
- package/dist/{tree-7EBS7PVA.js.map → tree-T33VU473.js.map} +1 -1
- package/dist/{update-M7ECF7UE.js → update-PJRSKQZ2.js} +9 -9
- package/dist/{usage-IFKUY6LC.js → usage-TL66LWO4.js} +7 -7
- package/dist/{wait-K3NSSNFR.js → wait-YIEJO6YM.js} +8 -8
- package/dist/wd-bin.js +3 -3
- package/dist/web/assets/PtyView-DnDd6jLI.js +96 -0
- package/dist/web/assets/PtyView-DnDd6jLI.js.map +1 -0
- package/dist/web/assets/index-DxozAoUO.css +1 -0
- package/dist/web/assets/index-InmdAx6g.js +120 -0
- package/dist/web/assets/index-InmdAx6g.js.map +1 -0
- package/dist/web/index.html +2 -2
- package/dist/{web-U34XTVBA.js → web-IYUNJMQD.js} +241 -263
- package/dist/web-IYUNJMQD.js.map +1 -0
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/dist/chunk-3NXRBRRJ.js.map +0 -1
- package/dist/chunk-CYXMVMVO.js.map +0 -1
- package/dist/chunk-FK2ZZUR5.js.map +0 -1
- package/dist/chunk-JT5AR7PO.js.map +0 -1
- package/dist/chunk-MYXLQMF7.js +0 -9
- package/dist/chunk-PDWEPIL6.js.map +0 -1
- package/dist/chunk-RVT4435Z.js.map +0 -1
- package/dist/chunk-ZJSEDIFT.js.map +0 -1
- package/dist/pty-host-I2I7SVOL.js.map +0 -1
- package/dist/web/assets/PtyView-Cg5gjgaQ.js +0 -96
- package/dist/web/assets/PtyView-Cg5gjgaQ.js.map +0 -1
- package/dist/web/assets/index-BOyg0f4L.css +0 -1
- package/dist/web/assets/index-CBK3PI8Y.js +0 -119
- package/dist/web/assets/index-CBK3PI8Y.js.map +0 -1
- package/dist/web-U34XTVBA.js.map +0 -1
- /package/dist/{add-repo-AA3XTOZT.js.map → add-repo-EDU3QEYI.js.map} +0 -0
- /package/dist/{answer-NT62U5MY.js.map → answer-MHOJ2J6S.js.map} +0 -0
- /package/dist/{block-YZQGJMLI.js.map → block-D5CAR53T.js.map} +0 -0
- /package/dist/{broadcast-2NOVIUZI.js.map → broadcast-LLYHUWXA.js.map} +0 -0
- /package/dist/{catchup-LZ5FMXEO.js.map → catchup-2SL3JGA7.js.map} +0 -0
- /package/dist/{chunk-ODBA4PVE.js.map → chunk-26OVU2AE.js.map} +0 -0
- /package/dist/{chunk-GEGRI67Z.js.map → chunk-3C3BKZ3H.js.map} +0 -0
- /package/dist/{chunk-BDFAIHTM.js.map → chunk-63VY4YJM.js.map} +0 -0
- /package/dist/{chunk-VNNAKJZA.js.map → chunk-6E2I2FBJ.js.map} +0 -0
- /package/dist/{chunk-BNGX2JGD.js.map → chunk-72IBYKIY.js.map} +0 -0
- /package/dist/{chunk-SXPC4FQM.js.map → chunk-7OUIZ2YQ.js.map} +0 -0
- /package/dist/{chunk-BGKHI4FC.js.map → chunk-ATED7SAH.js.map} +0 -0
- /package/dist/{chunk-T6BX6B5B.js.map → chunk-BSP2Z7B7.js.map} +0 -0
- /package/dist/{chunk-PGZMPB2Q.js.map → chunk-CCTALU3C.js.map} +0 -0
- /package/dist/{chunk-N7EHLEYG.js.map → chunk-CLBQ7ZC4.js.map} +0 -0
- /package/dist/{chunk-4GVXOUVN.js.map → chunk-CMO5YUZR.js.map} +0 -0
- /package/dist/{chunk-JAU62YN5.js.map → chunk-CYWI3ZW7.js.map} +0 -0
- /package/dist/{chunk-QNH6ZRFV.js.map → chunk-DQCUYCMX.js.map} +0 -0
- /package/dist/{chunk-IGC64EGV.js.map → chunk-HCVONKJI.js.map} +0 -0
- /package/dist/{chunk-4OK2WJ2B.js.map → chunk-HEPBANFJ.js.map} +0 -0
- /package/dist/{chunk-AHA65ZCO.js.map → chunk-INQQGV2G.js.map} +0 -0
- /package/dist/{chunk-AQJSY4CI.js.map → chunk-IPGH7TXJ.js.map} +0 -0
- /package/dist/{chunk-HJZSMSP4.js.map → chunk-IWJXFNM4.js.map} +0 -0
- /package/dist/{chunk-JFN67PRA.js.map → chunk-KSUOVFO3.js.map} +0 -0
- /package/dist/{chunk-7NSQVIIK.js.map → chunk-MG5TTLYZ.js.map} +0 -0
- /package/dist/{chunk-MYXLQMF7.js.map → chunk-NWIVXGSL.js.map} +0 -0
- /package/dist/{chunk-HKK3WUPZ.js.map → chunk-P6BHOAQG.js.map} +0 -0
- /package/dist/{chunk-RCZZAQFN.js.map → chunk-PRDRRU2B.js.map} +0 -0
- /package/dist/{chunk-6KOJSRML.js.map → chunk-QEVYCCKD.js.map} +0 -0
- /package/dist/{chunk-7NZC7EAP.js.map → chunk-QHTXLCG7.js.map} +0 -0
- /package/dist/{chunk-A633PJUP.js.map → chunk-QL36KN7X.js.map} +0 -0
- /package/dist/{chunk-7POCHRUP.js.map → chunk-QSOEMCWQ.js.map} +0 -0
- /package/dist/{chunk-J4Y7DKQN.js.map → chunk-RFINYWID.js.map} +0 -0
- /package/dist/{chunk-4WG66W6U.js.map → chunk-S3FMTEFR.js.map} +0 -0
- /package/dist/{chunk-MVMLNEHM.js.map → chunk-T7AFYEQ7.js.map} +0 -0
- /package/dist/{chunk-MPY2ZQBL.js.map → chunk-VUAVPBFR.js.map} +0 -0
- /package/dist/{chunk-UJWMBDFX.js.map → chunk-WTQ2QCAG.js.map} +0 -0
- /package/dist/{chunk-7OTYC7T5.js.map → chunk-WXE7D44E.js.map} +0 -0
- /package/dist/{chunk-IJSW2U6U.js.map → chunk-WXMWZRBH.js.map} +0 -0
- /package/dist/{chunk-FXWY22ZP.js.map → chunk-XVNRP7XE.js.map} +0 -0
- /package/dist/{chunk-2Z2O5LEA.js.map → chunk-ZI2KXTKM.js.map} +0 -0
- /package/dist/{cli-PAICDKJT.js.map → cli-AF7636FA.js.map} +0 -0
- /package/dist/{config-U4SGJ7RB.js.map → config-6MSITKGB.js.map} +0 -0
- /package/dist/{diff-CYXW5YWD.js.map → diff-Q7MV6YGJ.js.map} +0 -0
- /package/dist/{digest-KRIBJHII.js.map → digest-KUMVYXKZ.js.map} +0 -0
- /package/dist/{history-DCALTZMM.js.map → history-5WKRWARZ.js.map} +0 -0
- /package/dist/{hydrate-KBWZSSBL.js.map → hydrate-LCT6DVB3.js.map} +0 -0
- /package/dist/{init-R47WGD62.js.map → init-FJKPEY5N.js.map} +0 -0
- /package/dist/{install-skills-IIMTRQ4K.js.map → install-skills-UYAFVJBA.js.map} +0 -0
- /package/dist/{list-X5YB4JRL.js.map → list-GTKP5FAW.js.map} +0 -0
- /package/dist/{move-WSK5UU5T.js.map → move-GOCLEFGZ.js.map} +0 -0
- /package/dist/{note-VMO2PKYX.js.map → note-B7TQBXQF.js.map} +0 -0
- /package/dist/{overlaps-ZNZTQHU7.js.map → overlaps-UKQHIJMU.js.map} +0 -0
- /package/dist/{pin-RGRNNJUL.js.map → pin-UZZCDK7M.js.map} +0 -0
- /package/dist/{read-E22APCUR.js.map → read-U6GBGA5E.js.map} +0 -0
- /package/dist/{recent-F3Z3JXFX.js.map → recent-2DUMLUDG.js.map} +0 -0
- /package/dist/{restart-BAGGJDD2.js.map → restart-QEW4DJC3.js.map} +0 -0
- /package/dist/{resume-PIFCI727.js.map → resume-K45IT4QO.js.map} +0 -0
- /package/dist/{run-MW3QTOXU.js.map → run-42LORGPS.js.map} +0 -0
- /package/dist/{screen-UILBPWSR.js.map → screen-2TLIUH3G.js.map} +0 -0
- /package/dist/{search-DLZEPI4I.js.map → search-7E4B2KX6.js.map} +0 -0
- /package/dist/{section-A5JKTX4J.js.map → section-OVA5VD7L.js.map} +0 -0
- /package/dist/{send-EPPQKYOK.js.map → send-BJY5CYLO.js.map} +0 -0
- /package/dist/{snooze-GA46Z56G.js.map → snooze-WIVKB3GH.js.map} +0 -0
- /package/dist/{start-L6G3NC2J.js.map → start-G6GR533S.js.map} +0 -0
- /package/dist/{state-OZF4S7PG.js.map → state-S3DGLT4J.js.map} +0 -0
- /package/dist/{status-H5S3DZBI.js.map → status-BTAWY6JQ.js.map} +0 -0
- /package/dist/{statusline-RSQMMCRN.js.map → statusline-WLXEU5DM.js.map} +0 -0
- /package/dist/{stop-HQLHTY5V.js.map → stop-FN6EPFJ4.js.map} +0 -0
- /package/dist/{time-H54NH62B.js.map → time-5CH5O5MZ.js.map} +0 -0
- /package/dist/{time-actions-DB7OQ2IS.js.map → time-actions-XEUQ3UF7.js.map} +0 -0
- /package/dist/{timesheet-PAS5SHPD.js.map → timesheet-FMQKPS5S.js.map} +0 -0
- /package/dist/{todo-ODF7RI27.js.map → todo-23COLGR2.js.map} +0 -0
- /package/dist/{update-M7ECF7UE.js.map → update-PJRSKQZ2.js.map} +0 -0
- /package/dist/{usage-IFKUY6LC.js.map → usage-TL66LWO4.js.map} +0 -0
- /package/dist/{wait-K3NSSNFR.js.map → wait-YIEJO6YM.js.map} +0 -0
|
@@ -4,14 +4,14 @@ import {
|
|
|
4
4
|
} from "./chunk-6AQRYLOB.js";
|
|
5
5
|
import {
|
|
6
6
|
findSessionForCwd
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-QEVYCCKD.js";
|
|
8
8
|
import {
|
|
9
9
|
findSession,
|
|
10
10
|
loadHistory
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-37XQIG7F.js";
|
|
12
12
|
import {
|
|
13
13
|
loadConfig
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-2JNW2AQ2.js";
|
|
15
15
|
|
|
16
16
|
// src/commands/shared/session-arg.ts
|
|
17
17
|
import chalk from "chalk";
|
|
@@ -38,4 +38,4 @@ export {
|
|
|
38
38
|
sessionPositionals,
|
|
39
39
|
sessionFromArgs
|
|
40
40
|
};
|
|
41
|
-
//# sourceMappingURL=chunk-
|
|
41
|
+
//# sourceMappingURL=chunk-CYWI3ZW7.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
findSessionForCwd
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-QEVYCCKD.js";
|
|
5
5
|
import {
|
|
6
6
|
sessionIdFor
|
|
7
7
|
} from "./chunk-YYBXQBW2.js";
|
|
@@ -40,4 +40,4 @@ export {
|
|
|
40
40
|
agentsBySession,
|
|
41
41
|
summarizeAgents
|
|
42
42
|
};
|
|
43
|
-
//# sourceMappingURL=chunk-
|
|
43
|
+
//# sourceMappingURL=chunk-DQCUYCMX.js.map
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
dbPtySessions,
|
|
4
4
|
forgetPersistedSession
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-MG5TTLYZ.js";
|
|
6
6
|
import {
|
|
7
7
|
PtyHostBusyError,
|
|
8
8
|
PtyHostClient,
|
|
@@ -11,18 +11,18 @@ import {
|
|
|
11
11
|
findHost,
|
|
12
12
|
findHostPatient,
|
|
13
13
|
hostStartLockPath
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-AAYWHIIT.js";
|
|
15
15
|
import {
|
|
16
16
|
ASSISTANT_ID,
|
|
17
17
|
prepareAssistantDir
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-6FVYSW3E.js";
|
|
19
19
|
import {
|
|
20
20
|
createFsWatcher,
|
|
21
21
|
findSessionById,
|
|
22
22
|
logSwallowed,
|
|
23
23
|
noClaudeBecause,
|
|
24
24
|
swallow
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-37XQIG7F.js";
|
|
26
26
|
import {
|
|
27
27
|
sessionIdFor
|
|
28
28
|
} from "./chunk-YYBXQBW2.js";
|
|
@@ -31,10 +31,10 @@ import {
|
|
|
31
31
|
agentSettings,
|
|
32
32
|
assistantAgent,
|
|
33
33
|
hasEnvDelta
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-VUAVPBFR.js";
|
|
35
35
|
import {
|
|
36
36
|
loadConfig
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-2JNW2AQ2.js";
|
|
38
38
|
import {
|
|
39
39
|
ensureFile,
|
|
40
40
|
withFileLock
|
|
@@ -126,7 +126,7 @@ var live = /* @__PURE__ */ new Set();
|
|
|
126
126
|
var livePids = /* @__PURE__ */ new Set();
|
|
127
127
|
var outputs = /* @__PURE__ */ new Map();
|
|
128
128
|
var refreshTimer = null;
|
|
129
|
-
var beat = { known: false, lastOkAt: null, latencyMs: null, lastError: null };
|
|
129
|
+
var beat = { known: false, lastOkAt: null, latencyMs: null, lastError: null, hostVersion: null };
|
|
130
130
|
function hostBeat() {
|
|
131
131
|
return { ...beat };
|
|
132
132
|
}
|
|
@@ -158,6 +158,7 @@ async function refresh() {
|
|
|
158
158
|
const c = await getClient(false);
|
|
159
159
|
if (!c) {
|
|
160
160
|
beat.known = false;
|
|
161
|
+
beat.hostVersion = null;
|
|
161
162
|
live = /* @__PURE__ */ new Set();
|
|
162
163
|
livePids = /* @__PURE__ */ new Set();
|
|
163
164
|
outputs = /* @__PURE__ */ new Map();
|
|
@@ -168,6 +169,7 @@ async function refresh() {
|
|
|
168
169
|
beat.lastOkAt = Date.now();
|
|
169
170
|
beat.latencyMs = beat.lastOkAt - t0;
|
|
170
171
|
beat.lastError = null;
|
|
172
|
+
beat.hostVersion = await c.workVersion();
|
|
171
173
|
live = new Set(ptys.filter((p) => !p.exited).map((p) => p.id));
|
|
172
174
|
livePids = new Set(ptys.filter((p) => !p.exited).map((p) => p.pid));
|
|
173
175
|
outputs = new Map(
|
|
@@ -177,6 +179,7 @@ async function refresh() {
|
|
|
177
179
|
beat.known = beat.known || err instanceof PtyHostBusyError;
|
|
178
180
|
beat.lastError = err.message;
|
|
179
181
|
client = null;
|
|
182
|
+
beat.hostVersion = null;
|
|
180
183
|
live = /* @__PURE__ */ new Set();
|
|
181
184
|
livePids = /* @__PURE__ */ new Set();
|
|
182
185
|
outputs = /* @__PURE__ */ new Map();
|
|
@@ -433,4 +436,4 @@ export {
|
|
|
433
436
|
stopSessionPty,
|
|
434
437
|
detachPtyPool
|
|
435
438
|
};
|
|
436
|
-
//# sourceMappingURL=chunk-
|
|
439
|
+
//# sourceMappingURL=chunk-GRLKPVTP.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/core/pty/output-status.ts","../src/core/pty/pty-pool.ts","../src/core/sessions/web-state.ts"],"sourcesContent":["import type { SessionAttention } from '../api-types.js';\n\n/**\n * A status for a session whose tool isn't Claude Code (config `aiCommand`,\n * e.g. opencode): no hooks report its turns, so the PTY host's \"last printed\n * anything\" stands in — a working agent redraws its spinner, an idle one\n * prints nothing. Working while it printed in the last `OUTPUT_WORKING_MS`,\n * idle after; never \"done, unseen\" or \"needs input\" (output can't tell a\n * finished turn from a question). Pure.\n */\n\nexport const OUTPUT_WORKING_MS = 10_000;\n\nexport interface PtyOutput {\n /** The tool's binary (the host's spawn spec). */\n tool?: string;\n /** When it last printed (ISO). */\n lastOutputAt?: string;\n startedAt: string;\n}\n\nexport function statusFromOutput(p: PtyOutput, now: number): SessionAttention | null {\n if (!p.tool || p.tool === 'claude' || !p.lastOutputAt) return null;\n const at = Date.parse(p.lastOutputAt);\n if (!Number.isFinite(at)) return null;\n const working = now - at < OUTPUT_WORKING_MS;\n return {\n state: working ? 'working' : 'idle',\n seen: true,\n since: p.lastOutputAt,\n updatedAt: p.lastOutputAt,\n stale: false,\n summary: `${working ? 'Printing' : 'Quiet'} — from its terminal output (${p.tool} has no status hooks)`,\n };\n}\n","import path from 'node:path';\nimport type { AgentAdapter } from '../agents/types.js';\nimport { agentFor, agentSettings, assistantAgent } from '../agents/index.js';\nimport { statusFromOutput, type PtyOutput } from './output-status.js';\nimport type { SessionAttention } from '../api-types.js';\nimport type { HostBeat } from './host-health.js';\nimport { PtyHostBusyError } from './pty-host-client.js';\nimport { noClaudeBecause } from '../archive/archiving.js';\nimport { findSession, sessionIdFor } from '../sessions/web-state.js';\nimport type { WorktreeSession } from '../sessions/history.js';\nimport { hostStartLockPath, type SpawnSpec, type HostInfo, type PtyInfo } from './pty-host-protocol.js';\nimport { dbPtySessions } from './pty-sessions-file.js';\nimport { ensureFile, withFileLock } from '../platform/fs-safe.js';\nimport { forgetPersistedSession } from './pty-sessions-file.js';\nimport { loadConfig } from '../platform/config.js';\nimport { hasEnvDelta, type EnvDelta } from '../platform/env-delta.js';\nimport { ensureHost, findHost, PtyHostClient, findHostPatient, PtyHostVersionError } from './pty-host-client.js';\nimport { logSwallowed, swallow } from '../platform/best-effort.js';\nimport { ASSISTANT_ID, prepareAssistantDir } from '../agents/assistant.js';\n\n/**\n * `work web`'s view of the Claude PTYs. The PTYs themselves live in the\n * PTY host (`work pty-host`, see core/pty-host.ts), a separate long-lived\n * process — so restarting or rebuilding `work web` never kills an agent,\n * and a real terminal (`work attach`) can share the same session.\n *\n * This module resolves a dashboard session to a spawn spec, asks the host\n * to spawn it on first attach, and keeps a small cache of which sessions\n * have a live PTY for the synchronous badge path (`peekPty`).\n */\n\nlet workBin = process.argv[1] ?? '';\n/** Whether this server may start the PTY host when none runs (not the dev server: see configurePtyPool). */\nlet mayStartHost = true;\nlet client: PtyHostClient | null = null;\nlet live = new Set<string>();\n/** The pids of those PTYs' processes (the Claudes the app runs). */\nlet livePids = new Set<number>();\n/** Each live PTY's tool and last output (for output-status.ts). */\nlet outputs = new Map<string, PtyOutput & { pid: number }>();\nlet refreshTimer: NodeJS.Timeout | null = null;\n/** The heartbeat (host-health.ts): each list request is one. */\nconst beat: HostBeat = { known: false, lastOkAt: null, latencyMs: null, lastError: null, hostVersion: null };\n\n/** How the host answered lately (for GET /api/pty-host/health). */\nexport function hostBeat(): HostBeat {\n return { ...beat };\n}\nconst REFRESH_MS = 2000;\n\n/** Called by `work web` at startup with the resolved `work` binary path,\n * which is what the host is spawned from. */\nexport function configurePtyPool(opts: { workBin: string; startHost?: boolean }): void {\n workBin = opts.workBin;\n // The dev server (`work web --dev`) uses the host that runs and never starts one: started\n // from a checkout's build, the long-lived host that owns every Claude would outlive it,\n // and the installed work would become a client of the checkout's code.\n mayStartHost = opts.startHost ?? true;\n}\n\n/** The `work` binary path, for routes that launch `work attach`. */\nexport function getWorkBin(): string {\n return workBin;\n}\n\nasync function getClient(spawnIfMissing: boolean): Promise<PtyHostClient | null> {\n if (client) {\n // Cheap liveness re-check happens in refresh(); a dead host surfaces\n // as a failed call, which resets `client` below.\n return client;\n }\n const info = spawnIfMissing && mayStartHost ? await ensureHost(workBin) : await findHost();\n if (!info && spawnIfMissing && !mayStartHost)\n throw new Error(\n \"No PTY host is running, and the dev server doesn't start one: start the installed work (its app or `work web`) first.\",\n );\n if (!info) return null;\n client = new PtyHostClient(info);\n startRefresh();\n return client;\n}\n\nasync function refresh(): Promise<void> {\n const t0 = Date.now();\n try {\n const c = await getClient(false);\n if (!c) {\n beat.known = false;\n beat.hostVersion = null; // gone: the next host says its own\n live = new Set();\n livePids = new Set();\n outputs = new Map();\n return;\n }\n beat.known = true;\n const ptys = await c.list();\n beat.lastOkAt = Date.now();\n beat.latencyMs = beat.lastOkAt - t0;\n beat.lastError = null;\n // Asked once per host (the client keeps it): the release it runs, to say when it's older than this work.\n beat.hostVersion = await c.workVersion();\n live = new Set(ptys.filter((p) => !p.exited).map((p) => p.id));\n livePids = new Set(ptys.filter((p) => !p.exited).map((p) => p.pid));\n outputs = new Map(\n ptys.filter((p) => !p.exited).map((p) => [p.id, { tool: p.tool, lastOutputAt: p.lastOutputAt, startedAt: p.startedAt, pid: p.pid }]),\n );\n } catch (err) {\n // Host went away (or was restarted on a new port) — rediscover next tick.\n // A busy host is still a host (it is there, just not answering).\n beat.known = beat.known || err instanceof PtyHostBusyError;\n beat.lastError = (err as Error).message;\n client = null;\n beat.hostVersion = null;\n live = new Set();\n livePids = new Set();\n outputs = new Map();\n }\n}\n\nfunction startRefresh(): void {\n if (refreshTimer) return;\n refreshTimer = setInterval(() => void refresh(), REFRESH_MS);\n refreshTimer.unref?.();\n}\n\n/** Connect to an already-running host at `work web` startup so badges for\n * PTYs that survived a web restart show immediately. Never spawns. */\n/** Re-read the host's PTY list now (the periodic refresh can be seconds old,\n * or not have run at all right after `work web` started). */\nexport async function syncPtyPool(): Promise<void> {\n await refresh();\n}\n\nexport async function initPtyPool(): Promise<void> {\n await refresh().catch(() => {});\n startRefresh();\n}\n\n/**\n * After a reboot (or a host crash) nothing is running but\n * `pty-sessions.json` still lists the sessions that were live. Starting the\n * host restores them; do that when there's something to restore, so\n * reopening `work web` picks up where you left off. Returns how many\n * sessions the host will bring back (0 = nothing to do).\n */\nexport async function resumePersistedSessions(): Promise<number> {\n let count: number;\n try {\n count = Object.keys(dbPtySessions.read()).length;\n } catch {\n return 0;\n }\n if (count === 0) return 0;\n if (await findHost().catch(() => true)) return 0; // already running\n await getClient(true);\n await refresh();\n return count;\n}\n\n/**\n * Where Claude runs for a session — the same directory `work tree` launches\n * in: the worktree for a single repo, the group root (parent of the\n * sub-repos) for a group.\n */\nexport { ASSISTANT_ID };\n\n/** The assistant runs config `assistantAgent` (Claude Code by default), in its folder written for that agent. */\nexport function assistantSpec(): { cwd: string; tool: ReturnType<AgentAdapter['launch']['tool']>; agentEnv?: EnvDelta } {\n const settings = agentSettings();\n const agent = assistantAgent(settings);\n // Work's own session, not any session's: the configured default account (`launch.env(null)`).\n const agentEnv = agent.launch.env?.(null);\n return { cwd: prepareAssistantDir(agent), tool: agent.launch.tool(settings), ...(hasEnvDelta(agentEnv) ? { agentEnv } : {}) };\n}\n\nexport function spawnSpecFor(session: WorktreeSession): SpawnSpec | null {\n const first = session.paths[0];\n if (!first) return null;\n const cwd = session.isGroup ? path.dirname(first) : first;\n const config = loadConfig();\n const launch = agentFor(config, session).launch;\n // The session's account: its agent's folder env, applied by the host over whatever environment it starts with.\n const agentEnv = launch.env?.(session);\n return { cwd, tool: launch.tool(config), port: session.port, ...(hasEnvDelta(agentEnv) ? { agentEnv } : {}) };\n}\n\n/**\n * Ensure a live PTY exists for the session (spawning Claude in the host if\n * needed) and return the host WebSocket URL to attach to. Null for an\n * unknown session.\n */\nexport async function ensurePty(sessionId: string, extra: { initialPrompt?: string } = {}): Promise<string | null> {\n // The dashboard assistant (Ctrl+K) is not a worktree: it runs in its own\n // folder, which is (re)written first (assistant.ts).\n const session = sessionId === ASSISTANT_ID ? null : findSession(sessionId);\n // Not for a session being archived, or archived: its Claude was stopped on\n // purpose (a Terminal tab still open on it reconnects and would start it).\n const refused = sessionId === ASSISTANT_ID ? null : noClaudeBecause(session, sessionId);\n if (refused) throw new Error(refused);\n const base = sessionId === ASSISTANT_ID ? assistantSpec() : session ? spawnSpecFor(session) : null;\n if (!base) return null;\n // The first prompt only applies to a fresh spawn (the host ignores the\n // spec when the session's PTY is already running).\n const spec = extra.initialPrompt ? { ...base, initialPrompt: extra.initialPrompt } : base;\n\n let c = await getClient(true);\n if (!c) return null;\n // A host from before accounts would start it on its own environment — another account than the session's.\n if (setsEnv(spec.agentEnv) && !(await hostTakesAgentEnv(c)) && !(await runsIn(c, sessionId))) throw new Error(OLD_HOST_ACCOUNTS);\n try {\n await c.spawn(sessionId, spec);\n } catch (err) {\n // Stale client (host restarted on a new port) — retry once, fresh.\n client = null;\n c = await getClient(true);\n if (!c) throw err;\n await c.spawn(sessionId, spec);\n }\n live.add(sessionId);\n return c.attachUrl(sessionId);\n}\n\n/** Side-effect-free check: does an active (non-exited) PTY exist for this\n * session? Served from the refresh cache — used by session-meta for the\n * \"running/idle\" badge, which must stay synchronous. */\n/** Every PTY in the host, fresh (never starts a host; [] without one). */\nexport async function listHostPtys(): Promise<PtyInfo[]> {\n const c = await getClient(false);\n return c ? c.list() : [];\n}\n\n/** Pids of the Claudes running in the PTY host (from the refresh cache). */\nexport function ptyPids(): ReadonlySet<number> {\n return livePids;\n}\n\n/** A status from its terminal output, for a session whose tool has no hooks (output-status.ts); null for Claude or no PTY. */\nexport function outputStatus(sessionId: string, now = Date.now()): SessionAttention | null {\n const o = outputs.get(sessionId);\n return o ? statusFromOutput(o, now) : null;\n}\n\n/** When a session's terminal last printed (ms, from the refresh cache); null with no PTY or a host that doesn't say. */\nexport function ptyLastOutputMs(sessionId: string): number | null {\n const at = outputs.get(sessionId)?.lastOutputAt;\n const ms = at ? Date.parse(at) : NaN;\n return Number.isFinite(ms) ? ms : null;\n}\n\n/** Its agent's process id in the host (from the refresh cache); null with no PTY. */\nexport function ptyPid(sessionId: string): number | null {\n return outputs.get(sessionId)?.pid ?? null;\n}\n\nexport function peekPty(sessionId: string): boolean {\n return live.has(sessionId);\n}\n\n/** A session's live PTY screen as text; null when there is none (never spawns). */\nexport async function readPtyScreen(sessionId: string): Promise<string | null> {\n if (!live.has(sessionId)) return null;\n const c = await getClient(false);\n return c ? c.screen(sessionId) : null;\n}\n\n/** Write to a session's live PTY. False when there is none (never spawns). */\nexport async function writeToPty(sessionId: string, data: string): Promise<boolean> {\n if (!live.has(sessionId)) return false;\n const c = await getClient(false);\n return c ? c.write(sessionId, data) : false;\n}\n\n/**\n * Restart a session's agent in the host, resuming its conversation, its terminals\n * kept attached (agent-restart.ts). A host from before that call: stopped and\n * started again (an open Terminal tab then offers Enter, as after a stop).\n */\nexport async function restartPty(sessionId: string): Promise<string | void> {\n let c = await getClient(false);\n if (!c) throw new Error('the PTY host is not running');\n let how: Awaited<ReturnType<PtyHostClient['restart']>>;\n try {\n how = await c.restart(sessionId);\n } catch (err) {\n // A stale client (the host restarted on a new port before the refresh noticed): once more, fresh.\n client = null;\n c = await getClient(false);\n if (!c) throw err;\n how = await c.restart(sessionId);\n }\n if (how === 'not-running') throw new Error('its agent is not running in the PTY host');\n if (how === 'unsupported') {\n await disposePty(sessionId);\n if (!(await ensurePty(sessionId))) throw new Error('its agent could not be started again');\n return OLD_HOST_RESTART;\n }\n}\n\n/**\n * Stop a session's agent and keep its session in the host (entry, restore record, attached terminals) until `resumePty`:\n * a switch of account moves its conversation files in between. `stopped`: a host from before the call stopped it the old\n * way (its terminals were told it ended; `resumePtyOnAccount` then starts it fresh); `gone`: nothing was running.\n */\nexport async function haltPty(sessionId: string): Promise<'halted' | 'stopped' | 'gone'> {\n let c = await getClient(false);\n if (!c) throw new Error('the PTY host is not running');\n let how: Awaited<ReturnType<PtyHostClient['halt']>>;\n try {\n how = await c.halt(sessionId);\n } catch (err) {\n // A stale client (the host restarted on a new port before the refresh noticed): once more, fresh.\n client = null;\n c = await getClient(false);\n if (!c) throw err;\n how = await c.halt(sessionId);\n }\n if (how === 'not-running') return 'gone';\n if (how === 'unsupported') {\n await disposePty(sessionId);\n return 'stopped';\n }\n return 'halted';\n}\n\n/** Why a switch of account can't be done in this PTY host now (it is from before accounts), or null: asked before halting. */\nexport async function accountSwitchRefusal(): Promise<string | null> {\n const c = await getClient(false);\n return c && !(await hostTakesAgentEnv(c)) ? OLD_HOST_ACCOUNTS : null;\n}\n\n/**\n * Start a halted session's agent again in place, on `opts.agentEnv` (its terminals carry on). `not-halted`: it isn't\n * halted any more — the host started it again by itself (HALT_RESUME_MS) or restarted, on its old spec.\n */\nexport async function resumePty(sessionId: string, opts: { agentEnv?: EnvDelta } = {}): Promise<'resumed' | 'not-halted'> {\n let c = await getClient(false);\n if (!c) throw new Error('the PTY host is not running');\n if (hasEnvDelta(opts.agentEnv) && !(await hostTakesAgentEnv(c))) throw new Error(OLD_HOST_ACCOUNTS);\n let how: Awaited<ReturnType<PtyHostClient['resume']>>;\n try {\n how = await c.resume(sessionId, opts);\n } catch (err) {\n client = null;\n c = await getClient(false);\n if (!c) throw err;\n how = await c.resume(sessionId, opts);\n }\n return how;\n}\n\n/**\n * Start the agent of a session `haltPty` stopped, on the account the session records NOW (after a switch: the new one;\n * after one that failed: the old): resumed in place with that environment, or — `stopped`, an older host — started\n * again from a fresh spec (its terminals show it ended; opening the session reconnects).\n */\nexport async function resumePtyOnAccount(sessionId: string, how: 'halted' | 'stopped'): Promise<string | void> {\n if (how === 'stopped') {\n if (!(await ensurePty(sessionId))) throw new Error('its agent could not be started again');\n return OLD_HOST_RESTART;\n }\n const session = findSession(sessionId);\n const spec = session ? spawnSpecFor(session) : null;\n if (!spec) throw new Error('unknown session');\n // Nothing in the delta means no account change to apply (the default, with no accounts configured): a plain resume.\n const agentEnv = hasEnvDelta(spec.agentEnv) ? spec.agentEnv : undefined;\n if ((await resumePty(sessionId, agentEnv ? { agentEnv } : {})) === 'resumed') return;\n // Started again meanwhile on its OLD spec (the host's own resume after HALT_RESUME_MS — a long move —, or a host\n // restart's restore): restarted in place on the account the session records now, so it doesn't stay on the old one.\n const c = await getClient(false);\n if (!c) throw new Error('the PTY host is not running');\n const restarted = await c.restart(sessionId, agentEnv ? { agentEnv } : {});\n if (restarted === 'restarted') return RESTARTED_AFTER_AUTO_RESUME;\n // Not running now (it ended), or a host that couldn't take the environment in place: started fresh from the new spec.\n if (restarted === 'unsupported') await disposePty(sessionId);\n if (!(await ensurePty(sessionId))) throw new Error('its agent could not be started again');\n return RESTARTED_AFTER_AUTO_RESUME;\n}\n\n/** What a switch says when its halted Claude had been started again (on the old account) before the move was done. */\nexport const RESTARTED_AFTER_AUTO_RESUME =\n 'it had been started again on its old account while the conversation moved, so it was restarted on the new one';\n\n/** Said when a session on a named account would start in a PTY host that drops the account (one from before accounts). */\nexport const OLD_HOST_ACCOUNTS = 'the PTY host is from before Claude accounts: run `work pty-host --restart`';\n\n/** The delta sets a variable (a session on a named account): what an older host would drop, starting it elsewhere. */\nconst setsEnv = (d: EnvDelta | undefined): boolean => !!d && Object.values(d).some((v) => typeof v === 'string');\n\n/** The host applies `agentEnv`; one that can't be asked right now is given the benefit of the doubt (its restart says). */\nasync function hostTakesAgentEnv(c: PtyHostClient): Promise<boolean> {\n const f = await c.features();\n return f === null || f.includes('agentEnv');\n}\n\n/** Its agent runs in this host now (a spawn would only attach to it). */\nasync function runsIn(c: PtyHostClient, sessionId: string): Promise<boolean> {\n return (await c.list()).some((p) => p.id === sessionId && !p.exited);\n}\n\n/** How a restart on a PTY host from before restart-in-place went: what differs, and the way to the real thing. */\nexport const OLD_HOST_RESTART =\n 'stopped and started again (an older PTY host: open terminals show it ended, and it runs with only the variables `hostEnv` keeps; `work pty-host --restart` gets restarts in place)';\n\n/** Kill one session's PTY (if any). Called before removing a worktree so\n * the Claude process doesn't hold its cwd open (Windows refuses to delete\n * a directory that is some process's working directory). */\nexport async function disposePty(sessionId: string): Promise<void> {\n live.delete(sessionId);\n let c = client;\n if (!c) {\n // A busy host (mid-restore) is waited for, not skipped: skipping left\n // Claude running inside the worktree about to be deleted. A host from\n // another build can't be talked to — nothing to do but proceed.\n let info: HostInfo | null;\n try {\n info = await findHostPatient();\n } catch (err) {\n if (err instanceof PtyHostVersionError) return;\n throw err; // still busy after waiting: let the caller report it\n }\n if (!info) return;\n c = new PtyHostClient(info);\n }\n await c.kill(sessionId).catch(swallow(`stop session ${sessionId} in the PTY host`));\n}\n\n/**\n * Stop a session's Claude in the PTY host before its worktree is deleted —\n * from any caller, including the CLI (`work remove` / prune / sync), which\n * doesn't run a pool. Never starts a host; waits for the process to exit\n * (the host's kill does) so Windows can then delete the directory.\n * Best-effort: no host, or a host that can't be reached, is a no-op.\n */\nexport async function stopSessionPty(target: string, branch: string): Promise<void> {\n const id = sessionIdFor({ target, branch } as WorktreeSession);\n live.delete(id);\n // Under the host START lock: a host that's starting holds it until it has\n // restored, so we either see it running (and kill the session) or know\n // none is — and then drop the session from the saved list so a later\n // start doesn't restore Claude into a worktree that's being deleted.\n const lock = hostStartLockPath();\n ensureFile(lock, '');\n await withFileLock(lock, async () => {\n let info;\n try {\n info = await findHostPatient();\n } catch (err) {\n // A host from another build can't be talked to; one still busy after\n // waiting is running and owns the session — leave both alone (and\n // never drop the saved entry: the host is what it belongs to).\n logSwallowed(`stop session ${id}: PTY host`, err);\n return;\n }\n if (info) await new PtyHostClient(info).kill(id).catch(swallow(`stop session ${id} in the PTY host`));\n else await forgetPersistedSession(id).catch(swallow(`forget saved session ${id}`));\n }).catch(swallow(`stop session ${id}: host start lock`));\n}\n\n/** `work web` shutdown. Deliberately does NOT kill anything: the PTYs belong\n * to the host and outlive the dashboard. Just stops polling. */\nexport function detachPtyPool(): void {\n if (refreshTimer) clearInterval(refreshTimer);\n refreshTimer = null;\n client = null;\n live = new Set();\n livePids = new Set();\n}\n","import { createFsWatcher, type FsWatcher } from '../platform/fs-watcher.js';\nimport { findSessionById, type WorktreeSession } from './history.js';\n\nexport { sessionIdFor } from './session-id.js';\n\n/** A session by id — a primary-key lookup (every /api/sessions/:id/*\n * request does one; it used to load and hash every row). */\nexport function findSession(sessionId: string): WorktreeSession | null {\n return findSessionById(sessionId);\n}\n\ninterface WatcherEntry {\n watcher: FsWatcher;\n subscribers: Set<() => void>;\n}\n\nconst sessionWatchers = new Map<string, WatcherEntry>();\nconst DEBOUNCE_MS = 150;\n\n/**\n * Subscribe to filesystem changes for a session's worktree(s). The watch is\n * started on first subscriber and stopped when the last one leaves —\n * reference-counted so the cost stays proportional to what's actually being\n * viewed in the browser. It is the shared fs-watcher: dependency and build\n * folders (node_modules, bin/obj, dist, …) are left out, and on Windows and\n * macOS it is one recursive OS watch per root. A chokidar watch over the\n * whole worktree used to open one watch per folder, node_modules included.\n *\n * Returns an unsubscribe function. Safe to call multiple times.\n */\nexport function subscribeSession(sessionId: string, onChange: () => void): () => void {\n const session = findSession(sessionId);\n if (!session)\n return () => {\n /* unknown session */\n };\n\n let entry = sessionWatchers.get(sessionId);\n if (!entry) {\n const subscribers = new Set<() => void>();\n const newEntry: WatcherEntry = {\n subscribers,\n watcher: createFsWatcher({\n roots: session.paths,\n debounceMs: DEBOUNCE_MS,\n onChange: () => {\n for (const cb of subscribers) {\n try {\n cb();\n } catch {\n /* swallow */\n }\n }\n },\n }),\n };\n sessionWatchers.set(sessionId, newEntry);\n entry = newEntry;\n }\n\n entry.subscribers.add(onChange);\n\n let released = false;\n return () => {\n if (released) return;\n released = true;\n entry!.subscribers.delete(onChange);\n if (entry!.subscribers.size === 0) {\n entry!.watcher.stop();\n if (sessionWatchers.get(sessionId) === entry) {\n sessionWatchers.delete(sessionId);\n }\n }\n };\n}\n\n/**\n * Force-stop one session's watcher regardless of subscribers. Used before\n * removing a worktree: on Windows an open directory watch keeps a handle\n * on the tree and makes `git worktree remove` fail. Late unsubscribes from\n * the orphaned entry are harmless (see the identity check above).\n */\nexport async function disposeSessionWatcher(sessionId: string): Promise<void> {\n const entry = sessionWatchers.get(sessionId);\n if (!entry) return;\n sessionWatchers.delete(sessionId);\n entry.subscribers.clear();\n entry.watcher.stop();\n}\n\n/** Stop every active session watcher. Called on server shutdown. */\nexport function disposeAllWatchers(): void {\n for (const [, entry] of sessionWatchers) entry.watcher.stop();\n sessionWatchers.clear();\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWO,IAAM,oBAAoB;AAU1B,SAAS,iBAAiB,GAAc,KAAsC;AACnF,MAAI,C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MAAM,QAAQ,gBAAgB,EAAE,kBAAkB,CAAC;AAAA,QAC/F,OAAM,uBAAuB,EAAE,EAAE,MAAM,QAAQ,wBAAwB,EAAE,EAAE,CAAC;AAAA,EACnF,CAAC,EAAE,MAAM,QAAQ,gBAAgB,EAAE,mBAAmB,CAAC;AACzD;AAIO,SAAS,gBAAsB;AACpC,MAAI,aAAc,eAAc,YAAY;AAC5C,iBAAe;AACf,WAAS;AACT,SAAO,oBAAI,IAAI;AACf,aAAW,oBAAI,IAAI;AACrB;","names":[]}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
createInProcess
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-WXE7D44E.js";
|
|
5
5
|
import {
|
|
6
6
|
ensurePty,
|
|
7
7
|
peekPty
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-GRLKPVTP.js";
|
|
9
9
|
import {
|
|
10
10
|
checkedOutBranch
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-QEVYCCKD.js";
|
|
12
12
|
import {
|
|
13
13
|
getCommentFileStore
|
|
14
14
|
} from "./chunk-5QGCF3PS.js";
|
|
@@ -22,14 +22,14 @@ import {
|
|
|
22
22
|
import {
|
|
23
23
|
recordedRepos,
|
|
24
24
|
sessionAliases
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-37XQIG7F.js";
|
|
26
26
|
import {
|
|
27
27
|
sessionIdFor
|
|
28
28
|
} from "./chunk-YYBXQBW2.js";
|
|
29
29
|
import {
|
|
30
30
|
DEFAULT_ACCOUNT,
|
|
31
31
|
loadConfig
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-2JNW2AQ2.js";
|
|
33
33
|
|
|
34
34
|
// src/core/sessions/fork.ts
|
|
35
35
|
import path from "path";
|
|
@@ -174,4 +174,4 @@ export {
|
|
|
174
174
|
uncommittedFiles,
|
|
175
175
|
defaultForkDeps
|
|
176
176
|
};
|
|
177
|
-
//# sourceMappingURL=chunk-
|
|
177
|
+
//# sourceMappingURL=chunk-HCVONKJI.js.map
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./chunk-ZDMJPEBO.js";
|
|
5
5
|
import {
|
|
6
6
|
agentsBySession
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-DQCUYCMX.js";
|
|
8
8
|
import {
|
|
9
9
|
LATER_TEXT,
|
|
10
10
|
restartCountsText
|
|
@@ -17,16 +17,16 @@ import {
|
|
|
17
17
|
ptyPid,
|
|
18
18
|
ptyPids,
|
|
19
19
|
resumePtyOnAccount
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-GRLKPVTP.js";
|
|
21
21
|
import {
|
|
22
22
|
isArchiving,
|
|
23
23
|
loadHistory,
|
|
24
24
|
setSessionAccount
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-37XQIG7F.js";
|
|
26
26
|
import {
|
|
27
27
|
agentOf,
|
|
28
28
|
liveAgents
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-VUAVPBFR.js";
|
|
30
30
|
|
|
31
31
|
// src/core/pty/agent-restart.ts
|
|
32
32
|
import fs from "fs";
|
|
@@ -439,4 +439,4 @@ export {
|
|
|
439
439
|
accountSwitchNote,
|
|
440
440
|
defaultAccountSwitchDeps
|
|
441
441
|
};
|
|
442
|
-
//# sourceMappingURL=chunk-
|
|
442
|
+
//# sourceMappingURL=chunk-HEPBANFJ.js.map
|
|
@@ -6,14 +6,14 @@ import {
|
|
|
6
6
|
lastTurnEntryMs,
|
|
7
7
|
readSessionActivity,
|
|
8
8
|
readStatus
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-37XQIG7F.js";
|
|
10
10
|
import {
|
|
11
11
|
sessionIdFor
|
|
12
12
|
} from "./chunk-YYBXQBW2.js";
|
|
13
13
|
import {
|
|
14
14
|
agentOf,
|
|
15
15
|
readJsonlTail
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-VUAVPBFR.js";
|
|
17
17
|
|
|
18
18
|
// src/core/status/turn-activity.ts
|
|
19
19
|
var cache = /* @__PURE__ */ new Map();
|
|
@@ -45,4 +45,4 @@ export {
|
|
|
45
45
|
sessionStatusView,
|
|
46
46
|
shownState
|
|
47
47
|
};
|
|
48
|
-
//# sourceMappingURL=chunk-
|
|
48
|
+
//# sourceMappingURL=chunk-INQQGV2G.js.map
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./chunk-LNHSBM4L.js";
|
|
5
5
|
import {
|
|
6
6
|
knownAgents
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-VUAVPBFR.js";
|
|
8
8
|
|
|
9
9
|
// src/commands/install-skills.ts
|
|
10
10
|
import chalk from "chalk";
|
|
@@ -44,4 +44,4 @@ export {
|
|
|
44
44
|
runInstallSkills,
|
|
45
45
|
installSkillsCommand
|
|
46
46
|
};
|
|
47
|
-
//# sourceMappingURL=chunk-
|
|
47
|
+
//# sourceMappingURL=chunk-IPGH7TXJ.js.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
defaultCleanupDeps
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-XVNRP7XE.js";
|
|
5
5
|
import {
|
|
6
6
|
agentsBySession
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-DQCUYCMX.js";
|
|
8
8
|
import {
|
|
9
9
|
normPath
|
|
10
10
|
} from "./chunk-AKMPF72Y.js";
|
|
@@ -18,16 +18,16 @@ import {
|
|
|
18
18
|
import {
|
|
19
19
|
loadHistory,
|
|
20
20
|
sessionAliases
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-37XQIG7F.js";
|
|
22
22
|
import {
|
|
23
23
|
sessionIdFor
|
|
24
24
|
} from "./chunk-YYBXQBW2.js";
|
|
25
25
|
import {
|
|
26
26
|
liveAgents
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-VUAVPBFR.js";
|
|
28
28
|
import {
|
|
29
29
|
loadConfig
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-2JNW2AQ2.js";
|
|
31
31
|
|
|
32
32
|
// src/core/cleanup/build-folders-scan.ts
|
|
33
33
|
import fs from "fs";
|
|
@@ -261,4 +261,4 @@ export {
|
|
|
261
261
|
deleteMergedBranches,
|
|
262
262
|
defaultBranchTidyDeps
|
|
263
263
|
};
|
|
264
|
-
//# sourceMappingURL=chunk-
|
|
264
|
+
//# sourceMappingURL=chunk-IWJXFNM4.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
applyEnvDelta,
|
|
4
4
|
buildAiLaunchArgs,
|
|
5
5
|
hasEnvDelta
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-VUAVPBFR.js";
|
|
7
7
|
import {
|
|
8
8
|
detachHere
|
|
9
9
|
} from "./chunk-4NITDMDH.js";
|
|
@@ -56,4 +56,4 @@ export {
|
|
|
56
56
|
openVSCode,
|
|
57
57
|
launchAi
|
|
58
58
|
};
|
|
59
|
-
//# sourceMappingURL=chunk-
|
|
59
|
+
//# sourceMappingURL=chunk-KSUOVFO3.js.map
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
isPersistedPty,
|
|
4
4
|
ptySessionsPath
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-AAYWHIIT.js";
|
|
6
6
|
import {
|
|
7
7
|
json,
|
|
8
8
|
tx,
|
|
@@ -73,4 +73,4 @@ export {
|
|
|
73
73
|
adoptLegacyRestoreList,
|
|
74
74
|
forgetPersistedSession
|
|
75
75
|
};
|
|
76
|
-
//# sourceMappingURL=chunk-
|
|
76
|
+
//# sourceMappingURL=chunk-MG5TTLYZ.js.map
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
owedToYou,
|
|
4
|
+
stageWaiting
|
|
5
|
+
} from "./chunk-37XQIG7F.js";
|
|
6
|
+
|
|
7
|
+
// src/core/sessions/session-view.ts
|
|
8
|
+
var RECENT_MS = 24 * 36e5;
|
|
9
|
+
function lastActiveAt(s) {
|
|
10
|
+
const candidates = [Date.parse(s.lastAccessedAt) || 0, s.lastActivity ?? 0, s.attention ? Date.parse(s.attention.updatedAt) || 0 : 0];
|
|
11
|
+
return new Date(Math.max(...candidates)).toISOString();
|
|
12
|
+
}
|
|
13
|
+
function displayStatus(s, now = Date.now()) {
|
|
14
|
+
if (s.archiving) return "archiving";
|
|
15
|
+
if (s.restoring) return "restoring";
|
|
16
|
+
const a = s.attention;
|
|
17
|
+
if (a) {
|
|
18
|
+
if (a.state === "needs_input") return "needs_input";
|
|
19
|
+
if (a.state === "working") return a.background ? "background" : "working";
|
|
20
|
+
}
|
|
21
|
+
if (s.asleep) return "asleep";
|
|
22
|
+
if (a) return "quiet";
|
|
23
|
+
if (s.activityState === "active") return "active";
|
|
24
|
+
if (s.activityState === "open") return "open";
|
|
25
|
+
return now - Date.parse(lastActiveAt(s)) < RECENT_MS ? "recent" : "stale";
|
|
26
|
+
}
|
|
27
|
+
var DISPLAY_LABEL = {
|
|
28
|
+
archiving: "Archiving",
|
|
29
|
+
restoring: "Restoring",
|
|
30
|
+
needs_input: "Needs your input",
|
|
31
|
+
done: "Done",
|
|
32
|
+
working: "Working",
|
|
33
|
+
background: "In background",
|
|
34
|
+
asleep: "Asleep",
|
|
35
|
+
quiet: "Idle",
|
|
36
|
+
active: "Active",
|
|
37
|
+
open: "Open",
|
|
38
|
+
recent: "Idle",
|
|
39
|
+
stale: "Stale"
|
|
40
|
+
};
|
|
41
|
+
var CONTEXT_WARN = 0.7;
|
|
42
|
+
var AGE_LABEL = {
|
|
43
|
+
now: "Now",
|
|
44
|
+
week: "This week",
|
|
45
|
+
older: "Older"
|
|
46
|
+
};
|
|
47
|
+
var WEEK_MS = 7 * 24 * 36e5;
|
|
48
|
+
function ageBucket(s, now = Date.now()) {
|
|
49
|
+
const kind = displayStatus(s, now);
|
|
50
|
+
if (owedToYou(s).length) return "now";
|
|
51
|
+
if (kind === "needs_input" || kind === "done" || kind === "working" || kind === "background" || kind === "archiving" || kind === "restoring" || kind === "active" || kind === "open")
|
|
52
|
+
return "now";
|
|
53
|
+
const age = now - Date.parse(lastActiveAt(s));
|
|
54
|
+
if (age < RECENT_MS) return "now";
|
|
55
|
+
return age < WEEK_MS ? "week" : "older";
|
|
56
|
+
}
|
|
57
|
+
var OWED_LONG = {
|
|
58
|
+
turn: () => "a finished turn to review",
|
|
59
|
+
reply: (n) => `${n} ${n === 1 ? "reply" : "replies"} to post`,
|
|
60
|
+
thread: (n) => `${n} review ${n === 1 ? "thread" : "threads"} with no answer`,
|
|
61
|
+
conflict: (n) => n === 1 ? "a merge conflict" : `${n} PRs with merge conflicts`,
|
|
62
|
+
checks: (n) => n === 1 ? "checks failing" : `${n} PRs with checks failing`,
|
|
63
|
+
merge: () => "ready to merge"
|
|
64
|
+
};
|
|
65
|
+
function waitingOnOthers(s) {
|
|
66
|
+
return !owedToYou(s).length && stageWaiting(s.prStage);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export {
|
|
70
|
+
displayStatus,
|
|
71
|
+
DISPLAY_LABEL,
|
|
72
|
+
CONTEXT_WARN,
|
|
73
|
+
AGE_LABEL,
|
|
74
|
+
ageBucket,
|
|
75
|
+
OWED_LONG,
|
|
76
|
+
waitingOnOthers
|
|
77
|
+
};
|
|
78
|
+
//# sourceMappingURL=chunk-OTAZOIXK.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/core/sessions/session-view.ts"],"sourcesContent":["import type { SessionAttention, ActivityState } from '../api-types.js';\nimport { stageWaiting, type PrStageKind } from '../pr/pr-stage.js';\nimport { owedToYou, type Owed } from '../status/attention.js';\n\n/** What the status vocabulary reads from a session: a dashboard row or\n * a `work sessions` row (both are SessionWire-shaped). */\nexport interface SessionLike {\n lastAccessedAt: string;\n lastActivity?: number | null;\n activityState?: ActivityState;\n attention?: SessionAttention | null;\n /** Unresolved review threads on its open PRs (SessionWire). */\n openReviewThreads?: number;\n /** Replies drafted to its review threads, waiting for your Post (SessionWire). */\n replyDrafts?: number;\n /** Where its pull request stands (SessionWire, pr-stage.ts). */\n prStage?: { kind: PrStageKind; text: string; seen?: boolean; prs?: ReadonlyArray<{ kind: PrStageKind; checks?: string }> } | null;\n /** Being archived right now (SessionWire.archiving). */\n archiving?: boolean;\n /** Being restored right now (SessionWire.restoring). */\n restoring?: boolean;\n /** Its Claude was stopped while idle and hasn't run since (SessionWire.asleep). */\n asleep?: boolean;\n}\n\n/**\n * ONE status vocabulary for every view — pure, so the dashboard (it imports\n * this) and `work sessions` say the same thing — (rail, Sessions table, inbox, header\n * strip). Hook-driven attention wins when a session has it; otherwise we fall\n * back to the older transcript-activity signal, so a session never shows two\n * contradicting states in two places.\n *\n * archiving — being archived right now (its Claude stopped, the rest\n * being saved); it leaves the list when done\n * restoring — being restored (its worktree made again, the conversation\n * put back); in the rail again from the click\n * needs_input — blocked on you (permission / question)\n * done — finished a turn you haven't looked at\n * working — mid-turn\n * background — its turn ended, a background agent that turn started is\n * still at it: still busy, but its prompt is free\n * asleep — its Claude was stopped while idle (idle sleep, `work stop`)\n * and hasn't run since: opening it starts it again\n * quiet — finished, and you've seen it\n * active/open/recent/stale — no hook status yet (its Claude has not\n * taken a turn since the dashboard's hooks went in, or runs a tool\n * without them): transcript activity only. Active ≤ 30 s, Open ≤ 5 min,\n * Idle (recent) within a day, Stale after that.\n */\nexport type DisplayKind =\n | 'archiving'\n | 'restoring'\n | 'needs_input'\n | 'done'\n | 'working'\n | 'background'\n | 'asleep'\n | 'quiet'\n | 'active'\n | 'open'\n | 'recent'\n | 'stale';\n\n/** Used today = not stale, whatever the hooks know. */\nexport const RECENT_MS = 24 * 3_600_000;\n\n/** When the session last did anything: the newest of its hook update,\n * Claude's last transcript write and the `work tree` entry. (Reading only\n * the entry time called a session Active and \"1d\" at once.) */\nexport function lastActiveAt(s: SessionLike): string {\n const candidates = [Date.parse(s.lastAccessedAt) || 0, s.lastActivity ?? 0, s.attention ? Date.parse(s.attention.updatedAt) || 0 : 0];\n return new Date(Math.max(...candidates)).toISOString();\n}\n\nexport function displayStatus(s: SessionLike, now: number = Date.now()): DisplayKind {\n if (s.archiving) return 'archiving';\n if (s.restoring) return 'restoring';\n const a = s.attention;\n if (a) {\n if (a.state === 'needs_input') return 'needs_input';\n if (a.state === 'working') return a.background ? 'background' : 'working';\n }\n // A finished turn you haven't looked at is yours to review, not Claude's state: the blue \"review\" badge says it\n // (owedToYou's 'turn'); the icon says what its Claude is — idle, or asleep.\n if (s.asleep) return 'asleep';\n if (a) return 'quiet';\n if (s.activityState === 'active') return 'active';\n if (s.activityState === 'open') return 'open';\n return now - Date.parse(lastActiveAt(s)) < RECENT_MS ? 'recent' : 'stale';\n}\n\nexport const DISPLAY_LABEL: Record<DisplayKind, string> = {\n archiving: 'Archiving',\n restoring: 'Restoring',\n needs_input: 'Needs your input',\n done: 'Done',\n working: 'Working',\n background: 'In background',\n asleep: 'Asleep',\n quiet: 'Idle',\n active: 'Active',\n open: 'Open',\n recent: 'Idle',\n stale: 'Stale',\n};\n\n/** What each status means, in words — the legend and the dots' tooltips. */\nexport const DISPLAY_MEANING: Record<DisplayKind, string> = {\n archiving:\n 'Being archived: its Claude is stopped, its conversation and uncommitted files are saved, and its worktree goes once nothing would be lost. It leaves the list when done; Restore brings it back.',\n restoring:\n 'Being restored: its worktree is made again from its branch, with its uncommitted files and conversation put back. Then it carries on where it was.',\n needs_input: 'Its Claude is waiting for you: a permission prompt or a question.',\n done: \"Its Claude finished a turn you haven't looked at yet: the Inbox's Done section. On a row it's the blue review badge, beside what its Claude is now.\",\n working: 'Its Claude is working on your last instruction right now.',\n background:\n 'Its Claude finished its turn, and a background agent that turn started is still at work. Its prompt is free: you can talk to it. The agent’s result comes back as a new turn.',\n asleep:\n 'Its Claude was stopped to free memory: idle for a while, nothing attached, nothing of it still running. Opening the session starts it again, where it left off.',\n quiet: \"Its Claude finished, and you've seen it. Nothing to do.\",\n active: \"Its Claude wrote in the last 30 seconds (it isn't reporting its status, so this is from its transcript).\",\n open: 'Its Claude wrote in the last 5 minutes, or is open and idle at its prompt.',\n recent: 'Used in the last day; nothing running now.',\n stale: 'Not used for over a day.',\n};\n\n/** The legend's rows, most urgent first. Idle covers `quiet` and `recent` (same colour, same word). */\nexport const LEGEND_KINDS: readonly DisplayKind[] = [\n 'needs_input',\n 'done',\n 'working',\n 'background',\n 'asleep',\n 'archiving',\n 'restoring',\n 'active',\n 'open',\n 'quiet',\n 'stale',\n];\n\n/**\n * How full a Claude conversation may get before it matters: past WARN the\n * header shows it amber and the PR watch's notes ask Claude to hand\n * mechanical work to a sub-agent; past FULL it's red (Claude compacts near\n * the window, and answers get vaguer before that).\n */\nexport const CONTEXT_WARN = 0.7;\nexport const CONTEXT_FULL = 0.9;\n\n/** How long ago a session was used, for the Sessions table's sections. */\nexport type AgeBucket = 'now' | 'week' | 'older';\n\nexport const AGE_LABEL: Record<AgeBucket, string> = {\n now: 'Now',\n week: 'This week',\n older: 'Older',\n};\n\nexport const WEEK_MS = 7 * 24 * 3_600_000;\n\n/** Now: wants you, is working, or was used in the last day. This week:\n * used within 7 days. Older: everything else — cleanup material. */\nexport function ageBucket(s: SessionLike, now: number = Date.now()): AgeBucket {\n const kind = displayStatus(s, now);\n if (owedToYou(s).length) return 'now';\n if (\n kind === 'needs_input' ||\n kind === 'done' ||\n kind === 'working' ||\n kind === 'background' ||\n kind === 'archiving' ||\n kind === 'restoring' ||\n kind === 'active' ||\n kind === 'open'\n )\n return 'now';\n const age = now - Date.parse(lastActiveAt(s));\n if (age < RECENT_MS) return 'now';\n return age < WEEK_MS ? 'week' : 'older';\n}\n\n/** Coarse buckets the Sessions header counts and filters by. */\nexport type StatusBucket = 'needs' | 'working' | 'idle' | 'stale';\n\nexport function statusBucket(kind: DisplayKind): StatusBucket {\n switch (kind) {\n case 'needs_input':\n case 'done':\n return 'needs';\n case 'working':\n case 'background':\n case 'archiving':\n case 'restoring':\n case 'active':\n return 'working';\n case 'quiet':\n case 'asleep':\n case 'open':\n case 'recent':\n return 'idle';\n case 'stale':\n return 'stale';\n default: {\n // Every kind is named above: a new one fails the type check here instead of landing in \"stale\" unasked.\n const unknown: never = kind;\n return unknown;\n }\n }\n}\n\n/** Why a session shows Active / Open / Idle(recent) / Stale instead of a\n * real status: its Claude isn't reporting through work web's hooks. */\nexport const NO_HOOKS_HINT =\n \"Its Claude isn't reporting its status (it was started before work web's hooks were installed, or it isn't Claude), so this is from its transcript activity: Active = wrote in the last 30 s, Open = last 5 min. Restart it with `work tree <target> <branch>` (the conversation continues) to get Working / Needs your input / Done.\";\n\n/** The hint for a status that comes from activity only; undefined otherwise. */\nexport function statusHint(kind: DisplayKind): string | undefined {\n return kind === 'active' || kind === 'open' || kind === 'recent' || kind === 'stale' ? NO_HOOKS_HINT : undefined;\n}\n\n/**\n * The second signal: what waits on you about a session, beside what its\n * Claude is doing (attention.ts `owedToYou`), in words. The rail's badge is\n * the first thing (\"1 reply\", \"merge\"; \"+1\" when there's more), its tooltip\n * all of them; the Sessions table and the Inbox say the same.\n */\nexport const OWED_SHORT: Record<Owed['kind'], (n: number) => string> = {\n turn: () => 'review',\n reply: (n) => `${n} ${n === 1 ? 'reply' : 'replies'}`,\n thread: (n) => `${n} ${n === 1 ? 'thread' : 'threads'}`,\n conflict: () => 'conflict',\n checks: () => 'CI',\n merge: () => 'merge',\n};\nexport const OWED_LONG: Record<Owed['kind'], (n: number) => string> = {\n turn: () => 'a finished turn to review',\n reply: (n) => `${n} ${n === 1 ? 'reply' : 'replies'} to post`,\n thread: (n) => `${n} review ${n === 1 ? 'thread' : 'threads'} with no answer`,\n conflict: (n) => (n === 1 ? 'a merge conflict' : `${n} PRs with merge conflicts`),\n checks: (n) => (n === 1 ? 'checks failing' : `${n} PRs with checks failing`),\n merge: () => 'ready to merge',\n};\n\nexport interface OwedBadge {\n /** \"1 reply\", \"merge +1\", \"review\". */\n text: string;\n /** What it leads with: a finished turn to review is blue (Done's colour), the rest pink. */\n kind: Owed['kind'];\n /** \"Needs you: 1 reply to post · ready to merge\". */\n title: string;\n}\n\n/** The badge for what waits on you, or null when nothing does. */\nexport function owedBadge(s: SessionLike): OwedBadge | null {\n const owed = owedToYou(s);\n if (!owed.length) return null;\n const [first, ...more] = owed;\n return {\n kind: first.kind,\n text: OWED_SHORT[first.kind](first.count) + (more.length ? ` +${more.length}` : ''),\n title: `Needs you: ${owed.map((o) => OWED_LONG[o.kind](o.count)).join(' · ')}`,\n };\n}\n\n/** Nothing waits on you, and its PR waits on others (reviewers, checks): \"in review\", said quietly. */\nexport function waitingOnOthers(s: SessionLike): boolean {\n return !owedToYou(s).length && stageWaiting(s.prStage);\n}\n\n/** The Sessions table's status filter: what waits on you counts as \"needs you\", whatever Claude is doing. */\nexport function sessionBucket(s: SessionLike, now: number = Date.now()): StatusBucket {\n return owedToYou(s).length ? 'needs' : statusBucket(displayStatus(s, now));\n}\n"],"mappings":";;;;;;;AAgEO,IAAM,YAAY,KAAK;AAKvB,SAAS,aAAa,GAAwB;AACnD,QAAM,aAAa,CAAC,KAAK,MAAM,EAAE,cAAc,KAAK,GAAG,EAAE,gBAAgB,GAAG,EAAE,YAAY,KAAK,MAAM,EAAE,UAAU,SAAS,KAAK,IAAI,CAAC;AACpI,SAAO,IAAI,KAAK,KAAK,IAAI,GAAG,UAAU,CAAC,EAAE,YAAY;AACvD;AAEO,SAAS,cAAc,GAAgB,MAAc,KAAK,IAAI,GAAgB;AACnF,MAAI,EAAE,UAAW,QAAO;AACxB,MAAI,EAAE,UAAW,QAAO;AACxB,QAAM,IAAI,EAAE;AACZ,MAAI,GAAG;AACL,QAAI,EAAE,UAAU,c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,qBAAqB,GAAG,CAAC;AAAA,EACrD,QAAQ,CAAC,MAAO,MAAM,IAAI,mBAAmB,GAAG,CAAC;AAAA,EACjD,OAAO,MAAM;AACf;AAwBO,SAAS,gBAAgB,GAAyB;AACvD,SAAO,CAAC,UAAU,CAAC,EAAE,UAAU,aAAa,EAAE,OAAO;AACvD;","names":[]}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
isFolderSession,
|
|
4
4
|
sessionRepos
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-37XQIG7F.js";
|
|
6
6
|
|
|
7
7
|
// src/core/worktree/add-repo-rules.ts
|
|
8
8
|
import path from "path";
|
|
@@ -36,4 +36,4 @@ export {
|
|
|
36
36
|
addRepoRefusal,
|
|
37
37
|
addedRepoNote
|
|
38
38
|
};
|
|
39
|
-
//# sourceMappingURL=chunk-
|
|
39
|
+
//# sourceMappingURL=chunk-P6BHOAQG.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
sessionStatusView
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-INQQGV2G.js";
|
|
5
5
|
import {
|
|
6
6
|
buildDigest,
|
|
7
7
|
loadHistory,
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
readStatus,
|
|
12
12
|
scopeHashForPaths,
|
|
13
13
|
workSteps
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-37XQIG7F.js";
|
|
15
15
|
import {
|
|
16
16
|
sessionIdFor
|
|
17
17
|
} from "./chunk-YYBXQBW2.js";
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
agentOf,
|
|
20
20
|
lineTimeOf,
|
|
21
21
|
readJsonlSince
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-VUAVPBFR.js";
|
|
23
23
|
|
|
24
24
|
// src/core/conversations/digest-source.ts
|
|
25
25
|
function digestWindow(sinceMs, now = Date.now()) {
|
|
@@ -99,4 +99,4 @@ function createDigestSource(deps = {}) {
|
|
|
99
99
|
export {
|
|
100
100
|
createDigestSource
|
|
101
101
|
};
|
|
102
|
-
//# sourceMappingURL=chunk-
|
|
102
|
+
//# sourceMappingURL=chunk-PRDRRU2B.js.map
|