@moberg_hr/work-tree 2.0.9 → 2.0.10
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-QQAEJ5N3.js → answer-6UVHVEGQ.js} +13 -12
- package/dist/{answer-QQAEJ5N3.js.map → answer-6UVHVEGQ.js.map} +1 -1
- package/dist/{attach-XG3Y7QA7.js → attach-6Q6HGPCM.js} +15 -14
- package/dist/{attach-XG3Y7QA7.js.map → attach-6Q6HGPCM.js.map} +1 -1
- package/dist/bin.js +5 -5
- package/dist/{block-WW4BWDN7.js → block-46DPS75I.js} +13 -12
- package/dist/{block-WW4BWDN7.js.map → block-46DPS75I.js.map} +1 -1
- package/dist/{broadcast-LEOMDVSA.js → broadcast-OGOEQX4Z.js} +10 -9
- package/dist/{broadcast-LEOMDVSA.js.map → broadcast-OGOEQX4Z.js.map} +1 -1
- package/dist/{catchup-UBHGEMED.js → catchup-TTAC3GMX.js} +16 -15
- package/dist/{catchup-UBHGEMED.js.map → catchup-TTAC3GMX.js.map} +1 -1
- package/dist/{chunk-WTR5BUGS.js → chunk-26IZBYVL.js} +2 -2
- package/dist/{chunk-NS3HSXF7.js → chunk-3B3UMUE6.js} +2 -2
- package/dist/{chunk-LXM7QFBK.js → chunk-3XY76XBD.js} +24 -11
- package/dist/{chunk-LXM7QFBK.js.map → chunk-3XY76XBD.js.map} +1 -1
- package/dist/{chunk-UNLBHYA5.js → chunk-427RB7E4.js} +6 -6
- package/dist/{chunk-UPR2F7QP.js → chunk-4PP27RI7.js} +9 -9
- package/dist/{chunk-HLXEMPEI.js → chunk-6O6765M7.js} +4 -4
- package/dist/{chunk-JJRPLNLN.js → chunk-7HGABVGR.js} +2 -2
- package/dist/{chunk-G6IJ76DW.js → chunk-ACXPSQJR.js} +3 -3
- package/dist/{chunk-3R4HBEIG.js → chunk-AFV5S6UV.js} +10 -10
- package/dist/{chunk-45XJ4JGE.js → chunk-AVRDRZ4D.js} +12 -12
- package/dist/{chunk-I5CDLVJY.js → chunk-D4FUDMMX.js} +9 -9
- package/dist/{chunk-5XMXZIJS.js → chunk-E35NZVPX.js} +2 -2
- package/dist/chunk-E5EPN3JI.js +656 -0
- package/dist/chunk-E5EPN3JI.js.map +1 -0
- package/dist/{chunk-IC5PFQCV.js → chunk-HBXDIRM4.js} +4 -4
- package/dist/{chunk-BIL3S6XH.js → chunk-HDO3PXCU.js} +5 -5
- package/dist/{chunk-RM6XOZMU.js → chunk-IKYZ5CJZ.js} +2 -2
- package/dist/{chunk-OP5ZIVXO.js → chunk-IVSMEG5M.js} +50 -49
- package/dist/chunk-IVSMEG5M.js.map +1 -0
- package/dist/{chunk-NEZNZM7K.js → chunk-JQXUIKU5.js} +2 -2
- package/dist/{chunk-H5LKMR45.js → chunk-JTHILJFB.js} +2 -2
- package/dist/{chunk-WB2BP2G5.js → chunk-LPJEV4R2.js} +4 -103
- package/dist/chunk-LPJEV4R2.js.map +1 -0
- package/dist/{chunk-SIHAOB4F.js → chunk-MIIJ2HQS.js} +7 -7
- package/dist/chunk-MMPR5QIV.js +9 -0
- package/dist/{chunk-B6V6SV2F.js.map → chunk-MMPR5QIV.js.map} +1 -1
- package/dist/{chunk-QKGZ65TC.js → chunk-MVU7JAKG.js} +3 -3
- package/dist/chunk-NEJVK5CF.js +26 -0
- package/dist/chunk-NEJVK5CF.js.map +1 -0
- package/dist/{chunk-2IE6UUUD.js → chunk-OOCMPS5L.js} +2 -2
- package/dist/{chunk-G5PN5NIS.js → chunk-OQAQMCHF.js} +15 -33
- package/dist/chunk-OQAQMCHF.js.map +1 -0
- package/dist/{chunk-ICVR5M6W.js → chunk-OW46TR4G.js} +5 -5
- package/dist/{chunk-P2U6R35K.js → chunk-PUYXTZ32.js} +7 -7
- package/dist/{chunk-WVZ56EJC.js → chunk-QX4LFFNS.js} +9 -3
- package/dist/{chunk-WVZ56EJC.js.map → chunk-QX4LFFNS.js.map} +1 -1
- package/dist/{chunk-7HEB6SQS.js → chunk-QXUHOISF.js} +146 -3
- package/dist/chunk-QXUHOISF.js.map +1 -0
- package/dist/chunk-R6HAD575.js +797 -0
- package/dist/chunk-R6HAD575.js.map +1 -0
- package/dist/{chunk-6AULWNAN.js → chunk-R7B46WXN.js} +4 -4
- package/dist/{chunk-JYWCNLZN.js → chunk-RG63ACAK.js} +4 -4
- package/dist/{chunk-7NAXFBFI.js → chunk-RKEY4573.js} +2 -2
- package/dist/{chunk-PDF3BZZH.js → chunk-RLR66XLG.js} +3 -3
- package/dist/{chunk-QP6LFMMK.js → chunk-RMICESXA.js} +15 -15
- package/dist/{chunk-TOQZODGI.js → chunk-RQE5UOIW.js} +3 -3
- package/dist/{chunk-WF57CF7A.js → chunk-RT4QZRTC.js} +7 -4
- package/dist/chunk-RT4QZRTC.js.map +1 -0
- package/dist/{chunk-WUWED3LV.js → chunk-SH7NSDRW.js} +2 -2
- package/dist/{chunk-BLLLVWEB.js → chunk-SRIYY5HL.js} +3 -3
- package/dist/{chunk-DW4JPVXB.js → chunk-TMNIOM4Y.js} +2 -2
- package/dist/{chunk-KLK6O54M.js → chunk-UAAH334K.js} +10 -10
- package/dist/{chunk-ULQQ6SXT.js → chunk-WG3BMHKU.js} +4 -4
- package/dist/{chunk-GJDXEHII.js → chunk-WH3SPT3N.js} +2 -2
- package/dist/{chunk-73J2ZJA6.js → chunk-YAZ3GAZY.js} +5 -5
- package/dist/{chunk-H2NVIZ3M.js → chunk-YJVZ5H3I.js} +2 -2
- package/dist/chunk-YXQIGBL6.js +106 -0
- package/dist/chunk-YXQIGBL6.js.map +1 -0
- package/dist/{chunk-7IZW6GLY.js → chunk-YZLNJQAV.js} +3 -3
- package/dist/{chunk-SDE3BZ6P.js → chunk-ZFPV46FA.js} +14 -14
- package/dist/{chunk-N4EYQKSM.js → chunk-ZWD64IDK.js} +2 -2
- package/dist/{cleanup-AEZKR7Q3.js → cleanup-OO3DCPGC.js} +24 -23
- package/dist/{cleanup-AEZKR7Q3.js.map → cleanup-OO3DCPGC.js.map} +1 -1
- package/dist/cli-RYEDO3OH.js +18 -0
- package/dist/{command-hook-installer-SGEJTZ2Y.js → command-hook-installer-7JB3AC2S.js} +4 -4
- package/dist/{config-RF2S4YBA.js → config-SSWYCX4C.js} +10 -9
- package/dist/{config-RF2S4YBA.js.map → config-SSWYCX4C.js.map} +1 -1
- package/dist/{diff-2PPFXZD6.js → diff-76H3Y34M.js} +15 -14
- package/dist/{diff-2PPFXZD6.js.map → diff-76H3Y34M.js.map} +1 -1
- package/dist/{digest-5CRGAAK5.js → digest-WCZD6N7M.js} +12 -11
- package/dist/{digest-5CRGAAK5.js.map → digest-WCZD6N7M.js.map} +1 -1
- package/dist/{fork-W5ZF62UP.js → fork-WTNAUILU.js} +24 -23
- package/dist/{fork-W5ZF62UP.js.map → fork-WTNAUILU.js.map} +1 -1
- package/dist/{hook-U37AFPKY.js → hook-GQQZQ6DK.js} +18 -14
- package/dist/hook-GQQZQ6DK.js.map +1 -0
- package/dist/{hydrate-MAFHTY2W.js → hydrate-Q4FWUQRC.js} +9 -8
- package/dist/{hydrate-MAFHTY2W.js.map → hydrate-Q4FWUQRC.js.map} +1 -1
- package/dist/{init-CJDDD4AS.js → init-AT3BQLXM.js} +12 -11
- package/dist/{init-CJDDD4AS.js.map → init-AT3BQLXM.js.map} +1 -1
- package/dist/{install-skills-2ZAHI73P.js → install-skills-Z76FLXOU.js} +4 -4
- package/dist/install-skills-bin.js +3 -3
- package/dist/{list-KEF73NLQ.js → list-YTK2GLND.js} +5 -5
- package/dist/{move-6J35JMFB.js → move-CE5NIZKL.js} +17 -16
- package/dist/{move-6J35JMFB.js.map → move-CE5NIZKL.js.map} +1 -1
- package/dist/{note-TNC633NG.js → note-2JHWK6CV.js} +13 -12
- package/dist/{note-TNC633NG.js.map → note-2JHWK6CV.js.map} +1 -1
- package/dist/{overlaps-NZL5XFC4.js → overlaps-GXSEH2LG.js} +11 -10
- package/dist/{overlaps-NZL5XFC4.js.map → overlaps-GXSEH2LG.js.map} +1 -1
- package/dist/{pin-E53PGMGD.js → pin-UOW5VW42.js} +13 -12
- package/dist/{pin-E53PGMGD.js.map → pin-UOW5VW42.js.map} +1 -1
- package/dist/{pr-CBLU6UJ2.js → pr-74X5MOPX.js} +13 -12
- package/dist/{pr-CBLU6UJ2.js.map → pr-74X5MOPX.js.map} +1 -1
- package/dist/{prune-FKNNOITA.js → prune-L3VXZUIE.js} +23 -22
- package/dist/{prune-FKNNOITA.js.map → prune-L3VXZUIE.js.map} +1 -1
- package/dist/{pty-host-36Y4XSPP.js → pty-host-5Z3GYXTW.js} +12 -11
- package/dist/{pty-host-36Y4XSPP.js.map → pty-host-5Z3GYXTW.js.map} +1 -1
- package/dist/{read-ESOOJSBO.js → read-G7CVQRH6.js} +11 -10
- package/dist/{read-ESOOJSBO.js.map → read-G7CVQRH6.js.map} +1 -1
- package/dist/{recent-3WYFF36X.js → recent-2LM44HN2.js} +9 -8
- package/dist/{recent-3WYFF36X.js.map → recent-2LM44HN2.js.map} +1 -1
- package/dist/{remove-2CQ4MRSI.js → remove-NVQ2JNMA.js} +24 -23
- package/dist/{remove-2CQ4MRSI.js.map → remove-NVQ2JNMA.js.map} +1 -1
- package/dist/{report-KM4OZCZB.js → report-335HKCCY.js} +4 -4
- package/dist/{resume-NDE6NKKT.js → resume-VA34T7ZR.js} +9 -8
- package/dist/{resume-NDE6NKKT.js.map → resume-VA34T7ZR.js.map} +1 -1
- package/dist/{run-UW4BJCSC.js → run-E2WZPHHK.js} +8 -7
- package/dist/{run-UW4BJCSC.js.map → run-E2WZPHHK.js.map} +1 -1
- package/dist/{screen-5BLTXIKS.js → screen-XSBZHJNW.js} +13 -12
- package/dist/{screen-5BLTXIKS.js.map → screen-XSBZHJNW.js.map} +1 -1
- package/dist/{search-MK6R5VR6.js → search-FJUZPI3P.js} +8 -7
- package/dist/{search-MK6R5VR6.js.map → search-FJUZPI3P.js.map} +1 -1
- package/dist/{section-B4BWRY7K.js → section-BWZW3E2I.js} +13 -12
- package/dist/{section-B4BWRY7K.js.map → section-BWZW3E2I.js.map} +1 -1
- package/dist/{send-OT3OXHHW.js → send-4E7CD6PL.js} +15 -14
- package/dist/{send-OT3OXHHW.js.map → send-4E7CD6PL.js.map} +1 -1
- package/dist/{sessions-6BBMLMPQ.js → sessions-4LFKWTBZ.js} +19 -18
- package/dist/{sessions-6BBMLMPQ.js.map → sessions-4LFKWTBZ.js.map} +1 -1
- package/dist/{snooze-A2BVEYWD.js → snooze-SSSA656T.js} +12 -11
- package/dist/{snooze-A2BVEYWD.js.map → snooze-SSSA656T.js.map} +1 -1
- package/dist/{start-LEYVJWZG.js → start-5LODG4WG.js} +13 -12
- package/dist/{start-LEYVJWZG.js.map → start-5LODG4WG.js.map} +1 -1
- package/dist/{state-FGYNNSDP.js → state-S776FFV5.js} +9 -7
- package/dist/state-S776FFV5.js.map +1 -0
- package/dist/{status-AO653RKW.js → status-U5HKQ7MY.js} +9 -8
- package/dist/{status-AO653RKW.js.map → status-U5HKQ7MY.js.map} +1 -1
- package/dist/{stop-QYIRUR5Y.js → stop-OFQFHRXD.js} +13 -12
- package/dist/{stop-QYIRUR5Y.js.map → stop-OFQFHRXD.js.map} +1 -1
- package/dist/{sync-FE3AEVOP.js → sync-FDXM5EFD.js} +23 -22
- package/dist/{sync-FE3AEVOP.js.map → sync-FDXM5EFD.js.map} +1 -1
- package/dist/{time-4V56YERF.js → time-IIAXBSE7.js} +18 -14
- package/dist/{time-4V56YERF.js.map → time-IIAXBSE7.js.map} +1 -1
- package/dist/time-actions-K5VITQK5.js +15 -0
- package/dist/time-actions-K5VITQK5.js.map +1 -0
- package/dist/timesheet-SS6AA5BC.js +147 -0
- package/dist/timesheet-SS6AA5BC.js.map +1 -0
- package/dist/{todo-Y2BZ65MS.js → todo-2GKRUO4D.js} +6 -6
- package/dist/{tree-PA7BK7F6.js → tree-7S4DUZRZ.js} +20 -19
- package/dist/{tree-PA7BK7F6.js.map → tree-7S4DUZRZ.js.map} +1 -1
- package/dist/{update-EISQJXEI.js → update-7ZE4CG7T.js} +13 -12
- package/dist/{update-EISQJXEI.js.map → update-7ZE4CG7T.js.map} +1 -1
- package/dist/{wait-FW7RARBV.js → wait-TGQLNTE7.js} +13 -12
- package/dist/{wait-FW7RARBV.js.map → wait-TGQLNTE7.js.map} +1 -1
- package/dist/wd-bin.js +7 -7
- package/dist/web/assets/{PtyView-Eh_9_oeq.js → PtyView-VxE2hVXZ.js} +2 -2
- package/dist/web/assets/{PtyView-Eh_9_oeq.js.map → PtyView-VxE2hVXZ.js.map} +1 -1
- package/dist/web/assets/index-DC9qRg0H.css +1 -0
- package/dist/web/assets/index-Dt2LS35B.js +118 -0
- package/dist/web/assets/index-Dt2LS35B.js.map +1 -0
- package/dist/web/index.html +2 -2
- package/dist/{web-EORTIDIA.js → web-W6BZVICE.js} +526 -190
- package/dist/web-W6BZVICE.js.map +1 -0
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/dist/chunk-7HEB6SQS.js.map +0 -1
- package/dist/chunk-B6V6SV2F.js +0 -9
- package/dist/chunk-G5PN5NIS.js.map +0 -1
- package/dist/chunk-OP5ZIVXO.js.map +0 -1
- package/dist/chunk-WB2BP2G5.js.map +0 -1
- package/dist/chunk-WF57CF7A.js.map +0 -1
- package/dist/cli-73A5TR5V.js +0 -18
- package/dist/hook-U37AFPKY.js.map +0 -1
- package/dist/state-FGYNNSDP.js.map +0 -1
- package/dist/web/assets/index-9lt7iidI.css +0 -1
- package/dist/web/assets/index-NvjFIXGV.js +0 -118
- package/dist/web/assets/index-NvjFIXGV.js.map +0 -1
- package/dist/web-EORTIDIA.js.map +0 -1
- /package/dist/{chunk-WTR5BUGS.js.map → chunk-26IZBYVL.js.map} +0 -0
- /package/dist/{chunk-NS3HSXF7.js.map → chunk-3B3UMUE6.js.map} +0 -0
- /package/dist/{chunk-UNLBHYA5.js.map → chunk-427RB7E4.js.map} +0 -0
- /package/dist/{chunk-UPR2F7QP.js.map → chunk-4PP27RI7.js.map} +0 -0
- /package/dist/{chunk-HLXEMPEI.js.map → chunk-6O6765M7.js.map} +0 -0
- /package/dist/{chunk-JJRPLNLN.js.map → chunk-7HGABVGR.js.map} +0 -0
- /package/dist/{chunk-G6IJ76DW.js.map → chunk-ACXPSQJR.js.map} +0 -0
- /package/dist/{chunk-3R4HBEIG.js.map → chunk-AFV5S6UV.js.map} +0 -0
- /package/dist/{chunk-45XJ4JGE.js.map → chunk-AVRDRZ4D.js.map} +0 -0
- /package/dist/{chunk-I5CDLVJY.js.map → chunk-D4FUDMMX.js.map} +0 -0
- /package/dist/{chunk-5XMXZIJS.js.map → chunk-E35NZVPX.js.map} +0 -0
- /package/dist/{chunk-IC5PFQCV.js.map → chunk-HBXDIRM4.js.map} +0 -0
- /package/dist/{chunk-BIL3S6XH.js.map → chunk-HDO3PXCU.js.map} +0 -0
- /package/dist/{chunk-RM6XOZMU.js.map → chunk-IKYZ5CJZ.js.map} +0 -0
- /package/dist/{chunk-NEZNZM7K.js.map → chunk-JQXUIKU5.js.map} +0 -0
- /package/dist/{chunk-H5LKMR45.js.map → chunk-JTHILJFB.js.map} +0 -0
- /package/dist/{chunk-SIHAOB4F.js.map → chunk-MIIJ2HQS.js.map} +0 -0
- /package/dist/{chunk-QKGZ65TC.js.map → chunk-MVU7JAKG.js.map} +0 -0
- /package/dist/{chunk-2IE6UUUD.js.map → chunk-OOCMPS5L.js.map} +0 -0
- /package/dist/{chunk-ICVR5M6W.js.map → chunk-OW46TR4G.js.map} +0 -0
- /package/dist/{chunk-P2U6R35K.js.map → chunk-PUYXTZ32.js.map} +0 -0
- /package/dist/{chunk-6AULWNAN.js.map → chunk-R7B46WXN.js.map} +0 -0
- /package/dist/{chunk-JYWCNLZN.js.map → chunk-RG63ACAK.js.map} +0 -0
- /package/dist/{chunk-7NAXFBFI.js.map → chunk-RKEY4573.js.map} +0 -0
- /package/dist/{chunk-PDF3BZZH.js.map → chunk-RLR66XLG.js.map} +0 -0
- /package/dist/{chunk-QP6LFMMK.js.map → chunk-RMICESXA.js.map} +0 -0
- /package/dist/{chunk-TOQZODGI.js.map → chunk-RQE5UOIW.js.map} +0 -0
- /package/dist/{chunk-WUWED3LV.js.map → chunk-SH7NSDRW.js.map} +0 -0
- /package/dist/{chunk-BLLLVWEB.js.map → chunk-SRIYY5HL.js.map} +0 -0
- /package/dist/{chunk-DW4JPVXB.js.map → chunk-TMNIOM4Y.js.map} +0 -0
- /package/dist/{chunk-KLK6O54M.js.map → chunk-UAAH334K.js.map} +0 -0
- /package/dist/{chunk-ULQQ6SXT.js.map → chunk-WG3BMHKU.js.map} +0 -0
- /package/dist/{chunk-GJDXEHII.js.map → chunk-WH3SPT3N.js.map} +0 -0
- /package/dist/{chunk-73J2ZJA6.js.map → chunk-YAZ3GAZY.js.map} +0 -0
- /package/dist/{chunk-H2NVIZ3M.js.map → chunk-YJVZ5H3I.js.map} +0 -0
- /package/dist/{chunk-7IZW6GLY.js.map → chunk-YZLNJQAV.js.map} +0 -0
- /package/dist/{chunk-SDE3BZ6P.js.map → chunk-ZFPV46FA.js.map} +0 -0
- /package/dist/{chunk-N4EYQKSM.js.map → chunk-ZWD64IDK.js.map} +0 -0
- /package/dist/{cli-73A5TR5V.js.map → cli-RYEDO3OH.js.map} +0 -0
- /package/dist/{command-hook-installer-SGEJTZ2Y.js.map → command-hook-installer-7JB3AC2S.js.map} +0 -0
- /package/dist/{install-skills-2ZAHI73P.js.map → install-skills-Z76FLXOU.js.map} +0 -0
- /package/dist/{list-KEF73NLQ.js.map → list-YTK2GLND.js.map} +0 -0
- /package/dist/{report-KM4OZCZB.js.map → report-335HKCCY.js.map} +0 -0
- /package/dist/{todo-Y2BZ65MS.js.map → todo-2GKRUO4D.js.map} +0 -0
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
addTask,
|
|
4
|
+
completeTask,
|
|
5
|
+
editTask,
|
|
6
|
+
getTasks,
|
|
7
|
+
removeTask,
|
|
8
|
+
uncompleteTask
|
|
9
|
+
} from "./chunk-3B3UMUE6.js";
|
|
2
10
|
import {
|
|
3
11
|
commentInputSchema,
|
|
4
12
|
detectParentBranch,
|
|
@@ -11,7 +19,10 @@ import {
|
|
|
11
19
|
serveSpa,
|
|
12
20
|
sessionBaseForPath,
|
|
13
21
|
submitReviewSchema
|
|
14
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-YAZ3GAZY.js";
|
|
23
|
+
import {
|
|
24
|
+
createDigestSource
|
|
25
|
+
} from "./chunk-PUYXTZ32.js";
|
|
15
26
|
import {
|
|
16
27
|
agentsBySession,
|
|
17
28
|
createBuildFoldersJob,
|
|
@@ -20,18 +31,23 @@ import {
|
|
|
20
31
|
deleteMergedBranches,
|
|
21
32
|
findMergedBranches,
|
|
22
33
|
summarizeAgents
|
|
23
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-D4FUDMMX.js";
|
|
24
35
|
import {
|
|
25
|
-
|
|
26
|
-
|
|
36
|
+
defaultTimeDeps,
|
|
37
|
+
fetchIssueDetail,
|
|
38
|
+
fetchJiraPane,
|
|
39
|
+
fetchMyIssues,
|
|
40
|
+
fetchMyIssuesOrThrow,
|
|
41
|
+
finishDeviceLogin,
|
|
42
|
+
graphAccount,
|
|
43
|
+
graphApp,
|
|
44
|
+
graphProblem,
|
|
45
|
+
signOutGraph,
|
|
46
|
+
startDeviceLogin
|
|
47
|
+
} from "./chunk-E5EPN3JI.js";
|
|
27
48
|
import {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
editTask,
|
|
31
|
-
getTasks,
|
|
32
|
-
removeTask,
|
|
33
|
-
uncompleteTask
|
|
34
|
-
} from "./chunk-NS3HSXF7.js";
|
|
49
|
+
defaultCleanupDeps
|
|
50
|
+
} from "./chunk-AFV5S6UV.js";
|
|
35
51
|
import {
|
|
36
52
|
createArchivedRows,
|
|
37
53
|
prStageWire,
|
|
@@ -39,21 +55,18 @@ import {
|
|
|
39
55
|
reviewThreadsOf,
|
|
40
56
|
sessionWire,
|
|
41
57
|
stageSeenKey
|
|
42
|
-
} from "./chunk-
|
|
58
|
+
} from "./chunk-AVRDRZ4D.js";
|
|
43
59
|
import {
|
|
44
60
|
DiffStatCache,
|
|
45
61
|
findOverlaps,
|
|
46
62
|
wantsDiffStat
|
|
47
|
-
} from "./chunk-
|
|
48
|
-
import {
|
|
49
|
-
createDigestSource
|
|
50
|
-
} from "./chunk-P2U6R35K.js";
|
|
63
|
+
} from "./chunk-YJVZ5H3I.js";
|
|
51
64
|
import {
|
|
52
65
|
MAX_NOTE_CHARS,
|
|
53
66
|
readNote,
|
|
54
67
|
saveNote,
|
|
55
68
|
sessionsWithNotes
|
|
56
|
-
} from "./chunk-
|
|
69
|
+
} from "./chunk-JQXUIKU5.js";
|
|
57
70
|
import {
|
|
58
71
|
addBlocker,
|
|
59
72
|
allBlocks,
|
|
@@ -64,27 +77,42 @@ import {
|
|
|
64
77
|
removeBlocker,
|
|
65
78
|
sweepBlocks,
|
|
66
79
|
unblockedPrompt
|
|
67
|
-
} from "./chunk-
|
|
80
|
+
} from "./chunk-YZLNJQAV.js";
|
|
68
81
|
import {
|
|
69
82
|
jiraWorklogPoster,
|
|
70
83
|
logWorkDay,
|
|
71
84
|
loggedDays,
|
|
72
|
-
sessionWorkTime,
|
|
73
85
|
worklogSettings
|
|
74
|
-
} from "./chunk-
|
|
86
|
+
} from "./chunk-LPJEV4R2.js";
|
|
87
|
+
import {
|
|
88
|
+
sessionWorkTime
|
|
89
|
+
} from "./chunk-YXQIGBL6.js";
|
|
75
90
|
import {
|
|
76
91
|
sendToSession
|
|
77
92
|
} from "./chunk-RYNBBSLY.js";
|
|
93
|
+
import {
|
|
94
|
+
RepoAdminError,
|
|
95
|
+
deleteGroup,
|
|
96
|
+
enrollRepo,
|
|
97
|
+
removeRepo,
|
|
98
|
+
repoInventory,
|
|
99
|
+
saveGroup,
|
|
100
|
+
setRepoIgnored,
|
|
101
|
+
setScanRoot
|
|
102
|
+
} from "./chunk-WH3SPT3N.js";
|
|
78
103
|
import {
|
|
79
104
|
fetchAllPullRequests,
|
|
80
105
|
parsePrRef,
|
|
81
106
|
resolvePrToStart
|
|
82
107
|
} from "./chunk-4MXWNDH7.js";
|
|
108
|
+
import {
|
|
109
|
+
openUrl
|
|
110
|
+
} from "./chunk-E35NZVPX.js";
|
|
83
111
|
import {
|
|
84
112
|
archiveMergedSession,
|
|
85
113
|
archiveWaiting,
|
|
86
114
|
defaultArchiveDeps
|
|
87
|
-
} from "./chunk-
|
|
115
|
+
} from "./chunk-RMICESXA.js";
|
|
88
116
|
import {
|
|
89
117
|
MAX_REPLY_CHARS,
|
|
90
118
|
THREAD_ID,
|
|
@@ -95,7 +123,7 @@ import {
|
|
|
95
123
|
postReply,
|
|
96
124
|
rememberSent,
|
|
97
125
|
saveDraft
|
|
98
|
-
} from "./chunk-
|
|
126
|
+
} from "./chunk-26IZBYVL.js";
|
|
99
127
|
import {
|
|
100
128
|
cleanupVerdict,
|
|
101
129
|
createCleanupJob
|
|
@@ -104,12 +132,12 @@ import {
|
|
|
104
132
|
defaultForkDeps,
|
|
105
133
|
forkSession,
|
|
106
134
|
startSessionWithPrompt
|
|
107
|
-
} from "./chunk-
|
|
135
|
+
} from "./chunk-4PP27RI7.js";
|
|
108
136
|
import {
|
|
109
137
|
createInChild,
|
|
110
138
|
createInProcess,
|
|
111
139
|
oneAtATime
|
|
112
|
-
} from "./chunk-
|
|
140
|
+
} from "./chunk-OW46TR4G.js";
|
|
113
141
|
import {
|
|
114
142
|
resolveWorkBinPath
|
|
115
143
|
} from "./chunk-AH5TM3NB.js";
|
|
@@ -117,7 +145,10 @@ import {
|
|
|
117
145
|
teardownWorktree,
|
|
118
146
|
toBaseSpec,
|
|
119
147
|
wouldRefuseRemoval
|
|
120
|
-
} from "./chunk-
|
|
148
|
+
} from "./chunk-ZFPV46FA.js";
|
|
149
|
+
import {
|
|
150
|
+
isWorktreeFolder
|
|
151
|
+
} from "./chunk-L6RUHCKB.js";
|
|
121
152
|
import {
|
|
122
153
|
configurePtyPool,
|
|
123
154
|
detachPtyPool,
|
|
@@ -139,14 +170,11 @@ import {
|
|
|
139
170
|
subscribeSession,
|
|
140
171
|
syncPtyPool,
|
|
141
172
|
writeToPty
|
|
142
|
-
} from "./chunk-
|
|
173
|
+
} from "./chunk-UAAH334K.js";
|
|
143
174
|
import {
|
|
144
175
|
dbPtySessions
|
|
145
|
-
} from "./chunk-
|
|
146
|
-
import
|
|
147
|
-
isWorktreeFolder
|
|
148
|
-
} from "./chunk-L6RUHCKB.js";
|
|
149
|
-
import "./chunk-G6IJ76DW.js";
|
|
176
|
+
} from "./chunk-SRIYY5HL.js";
|
|
177
|
+
import "./chunk-ACXPSQJR.js";
|
|
150
178
|
import {
|
|
151
179
|
BehindCache,
|
|
152
180
|
behindMain,
|
|
@@ -162,28 +190,28 @@ import {
|
|
|
162
190
|
stackedOn,
|
|
163
191
|
updateFromBase,
|
|
164
192
|
updateFromMain
|
|
165
|
-
} from "./chunk-
|
|
193
|
+
} from "./chunk-HDO3PXCU.js";
|
|
166
194
|
import {
|
|
167
195
|
sessionStatusView,
|
|
168
196
|
shownState
|
|
169
|
-
} from "./chunk-
|
|
197
|
+
} from "./chunk-427RB7E4.js";
|
|
170
198
|
import {
|
|
171
199
|
askCatchUp,
|
|
172
200
|
cachedCatchUp,
|
|
173
201
|
catchUp,
|
|
174
202
|
catchUpFacts,
|
|
175
203
|
forgetCatchUp
|
|
176
|
-
} from "./chunk-
|
|
204
|
+
} from "./chunk-MIIJ2HQS.js";
|
|
177
205
|
import {
|
|
178
206
|
runInternal,
|
|
179
207
|
summarizeCheckpoint,
|
|
180
208
|
throttleTrailing
|
|
181
|
-
} from "./chunk-
|
|
209
|
+
} from "./chunk-R7B46WXN.js";
|
|
182
210
|
import {
|
|
183
211
|
computeDiff,
|
|
184
212
|
computeRangeDiff,
|
|
185
213
|
parseGitDiff
|
|
186
|
-
} from "./chunk-
|
|
214
|
+
} from "./chunk-6O6765M7.js";
|
|
187
215
|
import {
|
|
188
216
|
applyPlacePatch,
|
|
189
217
|
applySectionOp,
|
|
@@ -192,16 +220,35 @@ import {
|
|
|
192
220
|
cleanSectionOp,
|
|
193
221
|
placeSession,
|
|
194
222
|
readRailLayout
|
|
195
|
-
} from "./chunk-
|
|
223
|
+
} from "./chunk-IKYZ5CJZ.js";
|
|
196
224
|
import {
|
|
197
225
|
packageRoot
|
|
198
226
|
} from "./chunk-LNHSBM4L.js";
|
|
199
227
|
import {
|
|
200
228
|
VERSION
|
|
201
|
-
} from "./chunk-
|
|
229
|
+
} from "./chunk-MMPR5QIV.js";
|
|
202
230
|
import {
|
|
203
231
|
resolveProjectTarget
|
|
204
|
-
} from "./chunk-
|
|
232
|
+
} from "./chunk-JTHILJFB.js";
|
|
233
|
+
import {
|
|
234
|
+
DEFAULT_CATCH_UP_DAYS,
|
|
235
|
+
addDays,
|
|
236
|
+
buildDay,
|
|
237
|
+
dayChange,
|
|
238
|
+
dayWire,
|
|
239
|
+
dayWireOf,
|
|
240
|
+
daysBetween,
|
|
241
|
+
daysWire,
|
|
242
|
+
daysWireOf,
|
|
243
|
+
isDay,
|
|
244
|
+
localDay,
|
|
245
|
+
postStoredDay,
|
|
246
|
+
readDays,
|
|
247
|
+
tempoClient,
|
|
248
|
+
tempoSetup,
|
|
249
|
+
timeRange,
|
|
250
|
+
updateDay
|
|
251
|
+
} from "./chunk-R6HAD575.js";
|
|
205
252
|
import {
|
|
206
253
|
isOwnCheckout
|
|
207
254
|
} from "./chunk-TUFQJXXO.js";
|
|
@@ -216,21 +263,21 @@ import {
|
|
|
216
263
|
readWebUrl,
|
|
217
264
|
writeDevWebDiscovery,
|
|
218
265
|
writeWebDiscovery
|
|
219
|
-
} from "./chunk-
|
|
266
|
+
} from "./chunk-QX4LFFNS.js";
|
|
220
267
|
import {
|
|
221
268
|
CONTEXT_WARN,
|
|
222
269
|
describeView,
|
|
223
270
|
writeAssistantContext
|
|
224
|
-
} from "./chunk-
|
|
271
|
+
} from "./chunk-3XY76XBD.js";
|
|
225
272
|
import {
|
|
226
273
|
NOTE_NUDGE,
|
|
227
274
|
findSessionForCwd,
|
|
228
275
|
readPendingForSession
|
|
229
|
-
} from "./chunk-
|
|
276
|
+
} from "./chunk-RG63ACAK.js";
|
|
230
277
|
import "./chunk-ZSHWP2VS.js";
|
|
231
278
|
import {
|
|
232
279
|
getCommentFileStore
|
|
233
|
-
} from "./chunk-
|
|
280
|
+
} from "./chunk-7HGABVGR.js";
|
|
234
281
|
import {
|
|
235
282
|
createCommentStore
|
|
236
283
|
} from "./chunk-HUXS3VAI.js";
|
|
@@ -238,23 +285,7 @@ import {
|
|
|
238
285
|
checkTools,
|
|
239
286
|
saveFolders,
|
|
240
287
|
setupState
|
|
241
|
-
} from "./chunk-
|
|
242
|
-
import {
|
|
243
|
-
git
|
|
244
|
-
} from "./chunk-7NAXFBFI.js";
|
|
245
|
-
import {
|
|
246
|
-
RepoAdminError,
|
|
247
|
-
deleteGroup,
|
|
248
|
-
enrollRepo,
|
|
249
|
-
removeRepo,
|
|
250
|
-
repoInventory,
|
|
251
|
-
saveGroup,
|
|
252
|
-
setRepoIgnored,
|
|
253
|
-
setScanRoot
|
|
254
|
-
} from "./chunk-GJDXEHII.js";
|
|
255
|
-
import {
|
|
256
|
-
openUrl
|
|
257
|
-
} from "./chunk-5XMXZIJS.js";
|
|
288
|
+
} from "./chunk-RLR66XLG.js";
|
|
258
289
|
import {
|
|
259
290
|
enrollProblem,
|
|
260
291
|
groupProblem,
|
|
@@ -267,6 +298,9 @@ import {
|
|
|
267
298
|
runShipAction,
|
|
268
299
|
shipPreflight
|
|
269
300
|
} from "./chunk-4KZBZA5D.js";
|
|
301
|
+
import {
|
|
302
|
+
git
|
|
303
|
+
} from "./chunk-RKEY4573.js";
|
|
270
304
|
import {
|
|
271
305
|
DECISION_MARKER,
|
|
272
306
|
STAGE_WANTS_YOU,
|
|
@@ -286,7 +320,6 @@ import {
|
|
|
286
320
|
compressQuietCopies,
|
|
287
321
|
createFsWatcher,
|
|
288
322
|
createStageTracker,
|
|
289
|
-
dayKey,
|
|
290
323
|
devLogTail,
|
|
291
324
|
devState,
|
|
292
325
|
disposeAllScopes,
|
|
@@ -341,15 +374,7 @@ import {
|
|
|
341
374
|
turnInProgress,
|
|
342
375
|
updateCheckpoint,
|
|
343
376
|
writeArchiveRecord
|
|
344
|
-
} from "./chunk-
|
|
345
|
-
import {
|
|
346
|
-
json,
|
|
347
|
-
pendingMigration,
|
|
348
|
-
revision,
|
|
349
|
-
sessionIdFor,
|
|
350
|
-
tx,
|
|
351
|
-
withDb
|
|
352
|
-
} from "./chunk-WF57CF7A.js";
|
|
377
|
+
} from "./chunk-OQAQMCHF.js";
|
|
353
378
|
import {
|
|
354
379
|
activityRoots,
|
|
355
380
|
agentOf,
|
|
@@ -360,20 +385,33 @@ import {
|
|
|
360
385
|
liveAgents,
|
|
361
386
|
readJsonlSince,
|
|
362
387
|
recentProcessTable
|
|
363
|
-
} from "./chunk-
|
|
388
|
+
} from "./chunk-RQE5UOIW.js";
|
|
364
389
|
import {
|
|
365
390
|
spawn_default
|
|
366
391
|
} from "./chunk-RCYI7SRA.js";
|
|
392
|
+
import {
|
|
393
|
+
dayKey
|
|
394
|
+
} from "./chunk-NEJVK5CF.js";
|
|
395
|
+
import {
|
|
396
|
+
json,
|
|
397
|
+
pendingMigration,
|
|
398
|
+
revision,
|
|
399
|
+
sessionIdFor,
|
|
400
|
+
tx,
|
|
401
|
+
withDb
|
|
402
|
+
} from "./chunk-RT4QZRTC.js";
|
|
367
403
|
import {
|
|
368
404
|
report
|
|
369
|
-
} from "./chunk-
|
|
370
|
-
import "./chunk-
|
|
405
|
+
} from "./chunk-TMNIOM4Y.js";
|
|
406
|
+
import "./chunk-ZWD64IDK.js";
|
|
371
407
|
import {
|
|
372
408
|
DEFAULT_PROMPTS,
|
|
409
|
+
DEFAULT_TIME_SETTINGS,
|
|
373
410
|
atomicWriteFile,
|
|
374
411
|
getConfigDir,
|
|
412
|
+
isWorkday,
|
|
375
413
|
loadConfig
|
|
376
|
-
} from "./chunk-
|
|
414
|
+
} from "./chunk-QXUHOISF.js";
|
|
377
415
|
|
|
378
416
|
// src/commands/web.ts
|
|
379
417
|
import chalk from "chalk";
|
|
@@ -801,6 +839,17 @@ function mountDiffSeenRoutes(app) {
|
|
|
801
839
|
});
|
|
802
840
|
}
|
|
803
841
|
|
|
842
|
+
// src/server/routes/diff-page-routes.ts
|
|
843
|
+
function mountDiffPageRoutes(app, opts) {
|
|
844
|
+
app.post("/api/sessions/:id/diff-page", (c) => {
|
|
845
|
+
const session = findSession2(c.req.param("id"));
|
|
846
|
+
if (!session) return c.json({ error: "unknown session" }, 404);
|
|
847
|
+
if (session.archivedAt) return c.json({ error: "archived: restore it to see its diff" }, 409);
|
|
848
|
+
if (!opts.ensureScope(session)) return c.json({ error: "couldn't set up its diff page" }, 500);
|
|
849
|
+
return c.json({ url: `/diff/${scopeHashForPaths(session.paths)}` });
|
|
850
|
+
});
|
|
851
|
+
}
|
|
852
|
+
|
|
804
853
|
// src/server/routes/setup-routes.ts
|
|
805
854
|
var TOOLS_TTL_MS = 10 * 6e4;
|
|
806
855
|
function mountSetupRoutes(app, opts) {
|
|
@@ -1244,115 +1293,6 @@ function mountBlockRoutes(app, opts) {
|
|
|
1244
1293
|
import fs2 from "fs";
|
|
1245
1294
|
import path3 from "path";
|
|
1246
1295
|
|
|
1247
|
-
// src/core/jira/jira.ts
|
|
1248
|
-
import { execFile } from "child_process";
|
|
1249
|
-
function execAsync(cmd, args, timeout) {
|
|
1250
|
-
return new Promise((resolve, reject) => {
|
|
1251
|
-
execFile(cmd, args, { encoding: "utf-8", timeout, windowsHide: true }, (err, stdout) => {
|
|
1252
|
-
if (err) reject(err);
|
|
1253
|
-
else resolve(stdout ?? "");
|
|
1254
|
-
});
|
|
1255
|
-
});
|
|
1256
|
-
}
|
|
1257
|
-
async function probeAcli() {
|
|
1258
|
-
try {
|
|
1259
|
-
const stdout = await execAsync("acli", ["jira", "auth", "status"], 5e3);
|
|
1260
|
-
const match = stdout.match(/Site:\s+(\S+)/);
|
|
1261
|
-
return {
|
|
1262
|
-
available: true,
|
|
1263
|
-
siteUrl: match ? `https://${match[1]}` : ""
|
|
1264
|
-
};
|
|
1265
|
-
} catch {
|
|
1266
|
-
return { available: false, siteUrl: "" };
|
|
1267
|
-
}
|
|
1268
|
-
}
|
|
1269
|
-
function isStatusCategory(k) {
|
|
1270
|
-
return k === "new" || k === "indeterminate" || k === "done";
|
|
1271
|
-
}
|
|
1272
|
-
function parseIssuesJson(stdout, siteUrl) {
|
|
1273
|
-
const parsed = JSON.parse(stdout);
|
|
1274
|
-
const issues = (Array.isArray(parsed) ? parsed : parsed?.issues) ?? [];
|
|
1275
|
-
return issues.map((issue) => {
|
|
1276
|
-
const fields = issue.fields ?? {};
|
|
1277
|
-
return {
|
|
1278
|
-
key: issue.key ?? "",
|
|
1279
|
-
summary: fields.summary ?? "",
|
|
1280
|
-
status: fields.status?.name ?? "",
|
|
1281
|
-
...isStatusCategory(fields.status?.statusCategory?.key) ? { statusCategory: fields.status.statusCategory.key } : {},
|
|
1282
|
-
issuetype: fields.issuetype?.name ?? "",
|
|
1283
|
-
priority: fields.priority?.name ?? "",
|
|
1284
|
-
url: siteUrl ? `${siteUrl}/browse/${issue.key}` : ""
|
|
1285
|
-
};
|
|
1286
|
-
});
|
|
1287
|
-
}
|
|
1288
|
-
async function searchMyIssues(siteUrl) {
|
|
1289
|
-
try {
|
|
1290
|
-
const stdout = await execAsync(
|
|
1291
|
-
"acli",
|
|
1292
|
-
[
|
|
1293
|
-
"jira",
|
|
1294
|
-
"workitem",
|
|
1295
|
-
"search",
|
|
1296
|
-
"--jql",
|
|
1297
|
-
"assignee = currentUser() AND resolution = Unresolved AND status NOT IN (Archived, Done) ORDER BY updated DESC",
|
|
1298
|
-
"--json",
|
|
1299
|
-
"--limit",
|
|
1300
|
-
"50"
|
|
1301
|
-
],
|
|
1302
|
-
15e3
|
|
1303
|
-
);
|
|
1304
|
-
if (!stdout) return [];
|
|
1305
|
-
return parseIssuesJson(stdout, siteUrl);
|
|
1306
|
-
} catch {
|
|
1307
|
-
return [];
|
|
1308
|
-
}
|
|
1309
|
-
}
|
|
1310
|
-
async function fetchJiraPane() {
|
|
1311
|
-
const probe = await probeAcli();
|
|
1312
|
-
if (!probe.available) return { available: false, issues: [] };
|
|
1313
|
-
const issues = await searchMyIssues(probe.siteUrl);
|
|
1314
|
-
return { available: true, issues };
|
|
1315
|
-
}
|
|
1316
|
-
function adfText(node, max = 4e3) {
|
|
1317
|
-
const out = [];
|
|
1318
|
-
const walk = (n) => {
|
|
1319
|
-
if (!n || typeof n !== "object") return;
|
|
1320
|
-
const o = n;
|
|
1321
|
-
if (o.type === "text" && typeof o.text === "string") out.push(o.text);
|
|
1322
|
-
if (Array.isArray(o.content)) for (const c of o.content) walk(c);
|
|
1323
|
-
if (o.type === "paragraph" || o.type === "heading" || o.type === "listItem" || o.type === "codeBlock") out.push("\n");
|
|
1324
|
-
};
|
|
1325
|
-
walk(node);
|
|
1326
|
-
const text = out.join("").replace(/\n{3,}/g, "\n\n").trim();
|
|
1327
|
-
return text.length > max ? text.slice(0, max) + "\u2026" : text;
|
|
1328
|
-
}
|
|
1329
|
-
async function fetchIssueDetail(key) {
|
|
1330
|
-
if (!/^[A-Z][A-Z0-9_]*-\d+$/.test(key)) return null;
|
|
1331
|
-
try {
|
|
1332
|
-
const stdout = await execAsync(
|
|
1333
|
-
"acli",
|
|
1334
|
-
["jira", "workitem", "view", key, "--json", "--fields", "summary,description,project,components,labels,created"],
|
|
1335
|
-
15e3
|
|
1336
|
-
);
|
|
1337
|
-
const f = JSON.parse(stdout).fields ?? {};
|
|
1338
|
-
const p = f.project;
|
|
1339
|
-
const names = (v) => Array.isArray(v) ? v.map((c) => typeof c === "string" ? c : c?.name).filter((s) => typeof s === "string") : [];
|
|
1340
|
-
return {
|
|
1341
|
-
project: p && typeof p.key === "string" ? { key: p.key, name: typeof p.name === "string" ? p.name : p.key } : null,
|
|
1342
|
-
components: names(f.components),
|
|
1343
|
-
labels: names(f.labels),
|
|
1344
|
-
description: adfText(f.description),
|
|
1345
|
-
created: typeof f.created === "string" ? f.created : null
|
|
1346
|
-
};
|
|
1347
|
-
} catch {
|
|
1348
|
-
return null;
|
|
1349
|
-
}
|
|
1350
|
-
}
|
|
1351
|
-
async function fetchMyIssues() {
|
|
1352
|
-
const r = await fetchJiraPane();
|
|
1353
|
-
return r.issues;
|
|
1354
|
-
}
|
|
1355
|
-
|
|
1356
1296
|
// src/core/jira/jira-prompt.ts
|
|
1357
1297
|
var branchFor = (issue) => `feat/${issue.key}`;
|
|
1358
1298
|
function sessionIsForIssue(s, issue) {
|
|
@@ -1406,6 +1346,7 @@ function setEnabled(enabled, current, now = /* @__PURE__ */ new Date()) {
|
|
|
1406
1346
|
return tx((d) => {
|
|
1407
1347
|
const settings = { enabled, since: enabled ? at : null };
|
|
1408
1348
|
d.prepare("INSERT OR REPLACE INTO meta (key, value) VALUES (?, ?)").run(SETTINGS_KEY, JSON.stringify(settings));
|
|
1349
|
+
if (enabled) d.prepare("INSERT OR REPLACE INTO meta (key, value) VALUES (?, ?)").run(LIST_VERSION_KEY, String(LIST_VERSION));
|
|
1409
1350
|
if (enabled) {
|
|
1410
1351
|
const put = d.prepare("INSERT OR IGNORE INTO jira_watch (issue_key, data) VALUES (?, ?)");
|
|
1411
1352
|
for (const i of current) {
|
|
@@ -1423,6 +1364,28 @@ function setEnabled(enabled, current, now = /* @__PURE__ */ new Date()) {
|
|
|
1423
1364
|
return settings;
|
|
1424
1365
|
});
|
|
1425
1366
|
}
|
|
1367
|
+
var LIST_VERSION = 2;
|
|
1368
|
+
var LIST_VERSION_KEY = "jira-watch:list-version";
|
|
1369
|
+
function adoptListChange(issues, now = /* @__PURE__ */ new Date()) {
|
|
1370
|
+
return tx((d) => {
|
|
1371
|
+
const row = d.prepare("SELECT value FROM meta WHERE key = ?").get(LIST_VERSION_KEY);
|
|
1372
|
+
if (row && Number(row.value) >= LIST_VERSION) return false;
|
|
1373
|
+
const put = d.prepare("INSERT OR IGNORE INTO jira_watch (issue_key, data) VALUES (?, ?)");
|
|
1374
|
+
for (const i of issues) {
|
|
1375
|
+
const decision = {
|
|
1376
|
+
key: i.key,
|
|
1377
|
+
summary: i.summary,
|
|
1378
|
+
url: i.url,
|
|
1379
|
+
at: now.toISOString(),
|
|
1380
|
+
action: "baseline",
|
|
1381
|
+
reason: "already assigned to you; the list now shows open issues by status, not resolution"
|
|
1382
|
+
};
|
|
1383
|
+
put.run(i.key, JSON.stringify(decision));
|
|
1384
|
+
}
|
|
1385
|
+
d.prepare("INSERT OR REPLACE INTO meta (key, value) VALUES (?, ?)").run(LIST_VERSION_KEY, String(LIST_VERSION));
|
|
1386
|
+
return true;
|
|
1387
|
+
});
|
|
1388
|
+
}
|
|
1426
1389
|
function projectHistory(sessions) {
|
|
1427
1390
|
const out = /* @__PURE__ */ new Map();
|
|
1428
1391
|
for (const s of sessions) {
|
|
@@ -1489,6 +1452,7 @@ async function sweepJira(deps) {
|
|
|
1489
1452
|
if (!readSettings().enabled) return out;
|
|
1490
1453
|
const now = deps.now?.() ?? /* @__PURE__ */ new Date();
|
|
1491
1454
|
const issues = await deps.fetchIssues();
|
|
1455
|
+
if (adoptListChange(issues, now)) return out;
|
|
1492
1456
|
const known = new Set(listDecisions().map((d) => d.key));
|
|
1493
1457
|
const fresh = issues.filter((i) => !known.has(i.key));
|
|
1494
1458
|
if (fresh.length === 0) return out;
|
|
@@ -1603,7 +1567,8 @@ function mountJiraWatchRoutes(app, opts) {
|
|
|
1603
1567
|
if (!readSettings().enabled) return;
|
|
1604
1568
|
const run = opts.activity?.start("jira-watch", "Looking for newly assigned Jira issues");
|
|
1605
1569
|
const deps = {
|
|
1606
|
-
|
|
1570
|
+
// Throws when acli can't list them: the sweep fails (said in Activity) rather than reading "none".
|
|
1571
|
+
fetchIssues: fetchMyIssuesOrThrow,
|
|
1607
1572
|
detail: fetchIssueDetail,
|
|
1608
1573
|
targets: () => watchTargets(),
|
|
1609
1574
|
sessions: () => loadHistory(),
|
|
@@ -1654,10 +1619,11 @@ function mountJiraWatchRoutes(app, opts) {
|
|
|
1654
1619
|
if (typeof body?.enabled !== "boolean") return c.json({ error: "enabled (true/false) required" }, 400);
|
|
1655
1620
|
let current = [];
|
|
1656
1621
|
if (body.enabled) {
|
|
1657
|
-
|
|
1658
|
-
|
|
1622
|
+
try {
|
|
1623
|
+
current = await fetchMyIssuesOrThrow();
|
|
1624
|
+
} catch {
|
|
1659
1625
|
return c.json({ error: "Jira CLI (acli) isn't available or logged in: can't tell new issues from the ones you have" }, 409);
|
|
1660
|
-
|
|
1626
|
+
}
|
|
1661
1627
|
}
|
|
1662
1628
|
const settings = setEnabled(body.enabled, current);
|
|
1663
1629
|
opts.activity?.start("jira-watch", body.enabled ? "Jira watch turned on" : "Jira watch turned off").done(
|
|
@@ -3297,13 +3263,14 @@ function mountAssistantRoutes(app, opts = {}) {
|
|
|
3297
3263
|
tab: body.tab.slice(0, 40),
|
|
3298
3264
|
...typeof body.sub === "string" ? { sub: body.sub.slice(0, 40) } : {},
|
|
3299
3265
|
...typeof body.sessionId === "string" ? { sessionId: body.sessionId } : {},
|
|
3300
|
-
...typeof body.note === "string" ? { note: body.note.slice(0, 500) } : {}
|
|
3266
|
+
...typeof body.note === "string" ? { note: body.note.slice(0, 500) } : {},
|
|
3267
|
+
...typeof body.day === "string" && /^\d{4}-\d{2}-\d{2}$/.test(body.day) ? { day: body.day } : {}
|
|
3301
3268
|
};
|
|
3302
3269
|
const s = view.sessionId ? findSession2(view.sessionId) : null;
|
|
3303
3270
|
let wire = s ? sessionWire(s, opts.wireOptions) : null;
|
|
3304
3271
|
const o = wire ? opts.overlapsFor?.(wire.id) : void 0;
|
|
3305
3272
|
if (wire && o) wire = { ...wire, overlaps: o };
|
|
3306
|
-
writeAssistantContext(describeView(view, wire));
|
|
3273
|
+
writeAssistantContext(describeView(view, wire), Date.now(), view.tab === "time" ? view.day : void 0);
|
|
3307
3274
|
return c.json({ ok: true });
|
|
3308
3275
|
});
|
|
3309
3276
|
}
|
|
@@ -3546,6 +3513,204 @@ function dirBytes(dir) {
|
|
|
3546
3513
|
return n;
|
|
3547
3514
|
}
|
|
3548
3515
|
|
|
3516
|
+
// src/core/time/time-keeper.ts
|
|
3517
|
+
var TIME_EVERY_MS = 30 * 6e4;
|
|
3518
|
+
var CATCH_UP_DAYS = DEFAULT_CATCH_UP_DAYS;
|
|
3519
|
+
var AFTER_TURN_MS = 2 * 6e4;
|
|
3520
|
+
function dayEnd(day) {
|
|
3521
|
+
const d = /* @__PURE__ */ new Date(`${day}T00:00:00`);
|
|
3522
|
+
d.setDate(d.getDate() + 1);
|
|
3523
|
+
return d.getTime();
|
|
3524
|
+
}
|
|
3525
|
+
function createTimeKeeper(deps, opts) {
|
|
3526
|
+
const now = opts.now ?? (() => Date.now());
|
|
3527
|
+
let busy = null;
|
|
3528
|
+
let timer = null;
|
|
3529
|
+
async function runNow(what) {
|
|
3530
|
+
deps.fresh?.(what);
|
|
3531
|
+
const today = localDay(now());
|
|
3532
|
+
const settings = deps.settings();
|
|
3533
|
+
const from = addDays(today, -((settings.catchUpDays ?? CATCH_UP_DAYS) - 1));
|
|
3534
|
+
const builtAt = new Map(readDays(from, today).map((r) => [r.day, r.builtAt]));
|
|
3535
|
+
const days = daysBetween(from, today).filter((d) => {
|
|
3536
|
+
if (d === today) return true;
|
|
3537
|
+
const at = builtAt.get(d);
|
|
3538
|
+
return at === void 0 || !at || Date.parse(at) < dayEnd(d);
|
|
3539
|
+
});
|
|
3540
|
+
const run2 = opts.activity?.start("time", days.length === 1 ? "Updating today" : `Building ${days.length} days`);
|
|
3541
|
+
const failed = [];
|
|
3542
|
+
let built = 0;
|
|
3543
|
+
for (const d of days) {
|
|
3544
|
+
try {
|
|
3545
|
+
await buildDay(d, deps);
|
|
3546
|
+
built++;
|
|
3547
|
+
} catch (err) {
|
|
3548
|
+
failed.push(`${d}: ${err.message}`);
|
|
3549
|
+
}
|
|
3550
|
+
}
|
|
3551
|
+
if (built) opts.changed();
|
|
3552
|
+
if (failed.length) run2?.fail(`${failed.length} of ${days.length} not built \u2014 ${failed.join("; ")}`);
|
|
3553
|
+
else run2?.done(days.length === 1 ? "today updated" : `${days.length} days built`);
|
|
3554
|
+
}
|
|
3555
|
+
let again = null;
|
|
3556
|
+
const run = (what = "all") => {
|
|
3557
|
+
if (busy) {
|
|
3558
|
+
again = again === "all" || what === "all" ? "all" : "local";
|
|
3559
|
+
return busy;
|
|
3560
|
+
}
|
|
3561
|
+
busy = (async () => {
|
|
3562
|
+
let next = what;
|
|
3563
|
+
while (next) {
|
|
3564
|
+
const kind = next;
|
|
3565
|
+
again = null;
|
|
3566
|
+
await runNow(kind).catch((err) => {
|
|
3567
|
+
try {
|
|
3568
|
+
opts.activity?.start("time", "Updating the Time tab").fail(err.message);
|
|
3569
|
+
} catch {
|
|
3570
|
+
}
|
|
3571
|
+
});
|
|
3572
|
+
next = again;
|
|
3573
|
+
}
|
|
3574
|
+
})().finally(() => busy = null);
|
|
3575
|
+
return busy;
|
|
3576
|
+
};
|
|
3577
|
+
return {
|
|
3578
|
+
run,
|
|
3579
|
+
soon: () => {
|
|
3580
|
+
if (timer) return;
|
|
3581
|
+
timer = setTimeout(() => {
|
|
3582
|
+
timer = null;
|
|
3583
|
+
void run("local");
|
|
3584
|
+
}, AFTER_TURN_MS);
|
|
3585
|
+
timer.unref?.();
|
|
3586
|
+
},
|
|
3587
|
+
stop: () => {
|
|
3588
|
+
if (timer) clearTimeout(timer);
|
|
3589
|
+
timer = null;
|
|
3590
|
+
}
|
|
3591
|
+
};
|
|
3592
|
+
}
|
|
3593
|
+
|
|
3594
|
+
// src/server/routes/time-routes.ts
|
|
3595
|
+
var realTempo = () => {
|
|
3596
|
+
const s = tempoSetup(loadConfig()?.time?.tempo, process.env);
|
|
3597
|
+
return s.ready ? { api: tempoClient(s.token), accountId: s.accountId } : { why: s.why };
|
|
3598
|
+
};
|
|
3599
|
+
var realGraph = {
|
|
3600
|
+
app: () => graphApp(loadConfig()?.time?.graph, process.env),
|
|
3601
|
+
start: (a) => startDeviceLogin(a),
|
|
3602
|
+
finish: (a, l, cancelled) => finishDeviceLogin(a, l, { cancelled }),
|
|
3603
|
+
account: graphAccount,
|
|
3604
|
+
problem: () => graphProblem(graphApp(loadConfig()?.time?.graph, process.env)),
|
|
3605
|
+
signOut: signOutGraph
|
|
3606
|
+
};
|
|
3607
|
+
function mountTimeRoutes(app, opts) {
|
|
3608
|
+
const graph = opts.graph ?? realGraph;
|
|
3609
|
+
let login = null;
|
|
3610
|
+
let loginError = null;
|
|
3611
|
+
const graphWire = () => {
|
|
3612
|
+
const a = graph.app();
|
|
3613
|
+
return {
|
|
3614
|
+
ready: !("why" in a),
|
|
3615
|
+
why: "why" in a ? a.why : null,
|
|
3616
|
+
account: graph.account(),
|
|
3617
|
+
problem: graph.problem(),
|
|
3618
|
+
login: login ? { userCode: login.userCode, verificationUri: login.verificationUri, expiresAt: new Date(login.expiresAt).toISOString() } : null,
|
|
3619
|
+
error: loginError
|
|
3620
|
+
};
|
|
3621
|
+
};
|
|
3622
|
+
const graphChanged = () => {
|
|
3623
|
+
opts.broadcast("time-graph-changed", {});
|
|
3624
|
+
opts.onGraphChanged?.();
|
|
3625
|
+
};
|
|
3626
|
+
app.get("/api/time/graph", (c) => c.json(graphWire()));
|
|
3627
|
+
app.post("/api/time/graph/connect", async (c) => {
|
|
3628
|
+
const a = graph.app();
|
|
3629
|
+
if ("why" in a) return c.json({ error: a.why }, 409);
|
|
3630
|
+
let l;
|
|
3631
|
+
try {
|
|
3632
|
+
l = await graph.start(a);
|
|
3633
|
+
} catch (err) {
|
|
3634
|
+
return c.json({ error: err.message }, 502);
|
|
3635
|
+
}
|
|
3636
|
+
login = l;
|
|
3637
|
+
loginError = null;
|
|
3638
|
+
void graph.finish(a, l, () => login !== l).then(
|
|
3639
|
+
() => {
|
|
3640
|
+
if (login === l) login = null;
|
|
3641
|
+
graphChanged();
|
|
3642
|
+
},
|
|
3643
|
+
(err) => {
|
|
3644
|
+
if (login !== l) return;
|
|
3645
|
+
login = null;
|
|
3646
|
+
loginError = err.message;
|
|
3647
|
+
graphChanged();
|
|
3648
|
+
}
|
|
3649
|
+
);
|
|
3650
|
+
return c.json(graphWire());
|
|
3651
|
+
});
|
|
3652
|
+
app.post("/api/time/graph/disconnect", (c) => {
|
|
3653
|
+
graph.signOut();
|
|
3654
|
+
login = null;
|
|
3655
|
+
loginError = null;
|
|
3656
|
+
graphChanged();
|
|
3657
|
+
return c.json(graphWire());
|
|
3658
|
+
});
|
|
3659
|
+
const changed = (day) => opts.broadcast("time-changed", { day });
|
|
3660
|
+
const tempo = opts.tempo ?? realTempo;
|
|
3661
|
+
const withPosting = (w) => {
|
|
3662
|
+
const t = tempo();
|
|
3663
|
+
return { ...w, posting: "why" in t ? { ready: false, why: t.why } : { ready: true, why: null } };
|
|
3664
|
+
};
|
|
3665
|
+
app.get("/api/time", (c) => {
|
|
3666
|
+
const settings = opts.deps.settings();
|
|
3667
|
+
const r = timeRange({ from: c.req.query("from"), to: c.req.query("to") }, localDay(), settings.catchUpDays ?? DEFAULT_CATCH_UP_DAYS);
|
|
3668
|
+
if ("error" in r) return c.json({ error: r.error }, 400);
|
|
3669
|
+
return c.json(daysWire(r.from, r.to, settings));
|
|
3670
|
+
});
|
|
3671
|
+
app.get("/api/time/:day", (c) => {
|
|
3672
|
+
const day = c.req.param("day");
|
|
3673
|
+
if (!isDay(day)) return c.json({ error: "day: a real day, YYYY-MM-DD" }, 400);
|
|
3674
|
+
return c.json(withPosting(dayWire(day, opts.deps.settings())));
|
|
3675
|
+
});
|
|
3676
|
+
app.post("/api/time/:day/post", async (c) => {
|
|
3677
|
+
const day = c.req.param("day");
|
|
3678
|
+
if (!isDay(day)) return c.json({ error: "day: a real day, YYYY-MM-DD" }, 400);
|
|
3679
|
+
const t = tempo();
|
|
3680
|
+
if ("why" in t) return c.json({ error: t.why }, 409);
|
|
3681
|
+
let counts;
|
|
3682
|
+
try {
|
|
3683
|
+
counts = await postStoredDay(day, opts.deps, t);
|
|
3684
|
+
} catch (err) {
|
|
3685
|
+
return c.json({ error: err.message }, 502);
|
|
3686
|
+
}
|
|
3687
|
+
changed(day);
|
|
3688
|
+
return c.json({ ...counts, day: withPosting(dayWire(day, opts.deps.settings())) });
|
|
3689
|
+
});
|
|
3690
|
+
app.put("/api/time/:day", async (c) => {
|
|
3691
|
+
const day = c.req.param("day");
|
|
3692
|
+
if (!isDay(day)) return c.json({ error: "day: a real day, YYYY-MM-DD" }, 400);
|
|
3693
|
+
const settings = opts.deps.settings();
|
|
3694
|
+
const change = dayChange(await c.req.json().catch(() => null), settings.stepHours);
|
|
3695
|
+
if ("error" in change) return c.json({ error: change.error }, 400);
|
|
3696
|
+
updateDay(day, change);
|
|
3697
|
+
changed(day);
|
|
3698
|
+
return c.json(withPosting(dayWire(day, settings)));
|
|
3699
|
+
});
|
|
3700
|
+
app.post("/api/time/:day/rebuild", async (c) => {
|
|
3701
|
+
const day = c.req.param("day");
|
|
3702
|
+
if (!isDay(day)) return c.json({ error: "day: a real day, YYYY-MM-DD" }, 400);
|
|
3703
|
+
try {
|
|
3704
|
+
opts.deps.fresh?.();
|
|
3705
|
+
await buildDay(day, opts.deps, { again: true });
|
|
3706
|
+
} catch (err) {
|
|
3707
|
+
return c.json({ error: `Couldn't gather the day: ${err.message}` }, 500);
|
|
3708
|
+
}
|
|
3709
|
+
changed(day);
|
|
3710
|
+
return c.json(withPosting(dayWire(day, opts.deps.settings())));
|
|
3711
|
+
});
|
|
3712
|
+
}
|
|
3713
|
+
|
|
3549
3714
|
// src/server/routes/revert-routes.ts
|
|
3550
3715
|
import path10 from "path";
|
|
3551
3716
|
import { zValidator as zValidator6 } from "@hono/zod-validator";
|
|
@@ -4871,6 +5036,18 @@ async function startWebServer(opts = {}) {
|
|
|
4871
5036
|
};
|
|
4872
5037
|
sleepSchedule?.next(Date.now() + SLEEP_EVERY_MS);
|
|
4873
5038
|
const sleepTimer = !jobs ? null : setInterval(() => void sleepIdle(), SLEEP_EVERY_MS);
|
|
5039
|
+
const timeDeps = defaultTimeDeps();
|
|
5040
|
+
const timeSchedule = !jobs ? null : activity.schedule("time", "Time: today and missing days", TIME_EVERY_MS);
|
|
5041
|
+
const timeKeeper = !jobs ? null : createTimeKeeper(timeDeps, { activity, changed: () => broadcast("time-changed", {}) });
|
|
5042
|
+
const keepTime = () => {
|
|
5043
|
+
timeSchedule?.next(Date.now() + TIME_EVERY_MS);
|
|
5044
|
+
void timeKeeper?.run();
|
|
5045
|
+
};
|
|
5046
|
+
const timeFirst = !jobs ? null : setTimeout(keepTime, 9e4);
|
|
5047
|
+
timeFirst?.unref?.();
|
|
5048
|
+
timeSchedule?.next(Date.now() + 9e4);
|
|
5049
|
+
const timeTimer = !jobs ? null : setInterval(keepTime, TIME_EVERY_MS);
|
|
5050
|
+
timeTimer?.unref?.();
|
|
4874
5051
|
const RETENTION_EVERY_MS = 24 * 36e5;
|
|
4875
5052
|
const retentionSchedule = !jobs ? null : activity.schedule("archive", "Archive upkeep", RETENTION_EVERY_MS);
|
|
4876
5053
|
const archiveUpkeep = () => {
|
|
@@ -5077,6 +5254,7 @@ async function startWebServer(opts = {}) {
|
|
|
5077
5254
|
} : {},
|
|
5078
5255
|
onStatusChanged: (id) => {
|
|
5079
5256
|
diffStats.invalidate(id);
|
|
5257
|
+
timeKeeper?.soon();
|
|
5080
5258
|
if (jobs) void syncStacksAfter(id);
|
|
5081
5259
|
const session = findSession2(id);
|
|
5082
5260
|
if (session) {
|
|
@@ -5091,10 +5269,12 @@ async function startWebServer(opts = {}) {
|
|
|
5091
5269
|
if (s) scopeApi?.releaseSessionScope(s.paths, false);
|
|
5092
5270
|
};
|
|
5093
5271
|
mountShipRoutes(app, { broadcast, onRepoChanged: (id) => diffStats.invalidate(id), release: releaseSession, create: makeWorktree });
|
|
5272
|
+
mountTimeRoutes(app, { deps: timeDeps, broadcast, onGraphChanged: () => void timeKeeper?.run() });
|
|
5094
5273
|
mountSessionOrderRoutes(app, { broadcast });
|
|
5095
5274
|
mountRailRoutes(app, { broadcast });
|
|
5096
5275
|
mountNoteRoutes(app, { broadcast });
|
|
5097
5276
|
mountDiffSeenRoutes(app);
|
|
5277
|
+
mountDiffPageRoutes(app, { ensureScope: sessionScope });
|
|
5098
5278
|
mountRepoRoutes(app, { broadcast, activity, workBin: getWorkBin });
|
|
5099
5279
|
mountSetupRoutes(app, { broadcast });
|
|
5100
5280
|
const updates = createUpdates();
|
|
@@ -5178,6 +5358,9 @@ async function startWebServer(opts = {}) {
|
|
|
5178
5358
|
if (conversationsFirst) clearTimeout(conversationsFirst);
|
|
5179
5359
|
if (updatesFirst) clearTimeout(updatesFirst);
|
|
5180
5360
|
if (updatesTimer) clearInterval(updatesTimer);
|
|
5361
|
+
if (timeFirst) clearTimeout(timeFirst);
|
|
5362
|
+
if (timeTimer) clearInterval(timeTimer);
|
|
5363
|
+
timeKeeper?.stop();
|
|
5181
5364
|
fs10.unwatchFile(desktopFile, onDesktopUpdate);
|
|
5182
5365
|
for (const t of conversationSyncs.values()) clearTimeout(t);
|
|
5183
5366
|
clearTimeout(sweepTimer);
|
|
@@ -6724,6 +6907,94 @@ function createDemoActivity(scenario, emit) {
|
|
|
6724
6907
|
};
|
|
6725
6908
|
}
|
|
6726
6909
|
|
|
6910
|
+
// src/server/demo/demo-time.ts
|
|
6911
|
+
var SETTINGS = { ...DEFAULT_TIME_SETTINGS, gapTicket: "OPS-1", timeOffTicket: "HR-1" };
|
|
6912
|
+
var TITLES = {
|
|
6913
|
+
"PAY-12": "Export invoices as CSV",
|
|
6914
|
+
"PAY-15": "Invoice PDF",
|
|
6915
|
+
"SHOP-7": "Checkout in two steps",
|
|
6916
|
+
"WEB-3": "Price and brand filters in search",
|
|
6917
|
+
"WEB-9": "Login redirect loop",
|
|
6918
|
+
"OPS-1": "Meetings, reviews and support",
|
|
6919
|
+
"HR-1": "Time off"
|
|
6920
|
+
};
|
|
6921
|
+
var WORK = [
|
|
6922
|
+
{ id: "demo-api-feat-invoice-export", label: "api \xB7 feat/invoice-export", key: "PAY-12" },
|
|
6923
|
+
{ id: "demo-api-feat-invoice-pdf", label: "api \xB7 feat/invoice-pdf", key: "PAY-15" },
|
|
6924
|
+
{ id: "demo-shop-feat-checkout-v2", label: "shop \xB7 feat/checkout-v2", key: "SHOP-7" },
|
|
6925
|
+
{ id: "demo-web-feat-search-filters", label: "web \xB7 feat/search-filters", key: "WEB-3" },
|
|
6926
|
+
{ id: "demo-web-fix-login-redirect", label: "web \xB7 fix/login-redirect", key: "WEB-9" }
|
|
6927
|
+
];
|
|
6928
|
+
function evidenceFor(n) {
|
|
6929
|
+
const pick = [WORK[n % WORK.length], WORK[(n + 2) % WORK.length]];
|
|
6930
|
+
return {
|
|
6931
|
+
sessions: [
|
|
6932
|
+
{ sessionId: pick[0].id, label: pick[0].label, key: pick[0].key, minutes: 25 + n * 7 % 30 },
|
|
6933
|
+
{ sessionId: pick[1].id, label: pick[1].label, key: pick[1].key, minutes: 8 + n * 5 % 15 },
|
|
6934
|
+
...n % 3 === 0 ? [{ sessionId: "demo-api-chore-deps-update", label: "api \xB7 chore/deps-update", key: null, minutes: 12 }] : []
|
|
6935
|
+
],
|
|
6936
|
+
commits: [
|
|
6937
|
+
{
|
|
6938
|
+
repo: pick[0].id.split("-")[1],
|
|
6939
|
+
sha: `c0ffee${n}0`,
|
|
6940
|
+
subject: `${pick[0].key}: ${TITLES[pick[0].key].toLowerCase()}, part ${n % 4 + 1}`,
|
|
6941
|
+
keys: [pick[0].key]
|
|
6942
|
+
}
|
|
6943
|
+
],
|
|
6944
|
+
jira: n % 4 === 1 ? [{ key: "WEB-9", summary: TITLES["WEB-9"], what: "moved (now In review)" }] : []
|
|
6945
|
+
};
|
|
6946
|
+
}
|
|
6947
|
+
function createDemoTime(now) {
|
|
6948
|
+
const edits = /* @__PURE__ */ new Map();
|
|
6949
|
+
const record = (day) => {
|
|
6950
|
+
const today = localDay(now());
|
|
6951
|
+
if (day > today) return null;
|
|
6952
|
+
const all = daysBetween(addDays(today, -13), today);
|
|
6953
|
+
const n = all.indexOf(day);
|
|
6954
|
+
const e = edits.get(day) ?? {};
|
|
6955
|
+
if (n < 0 && !e.edited && !e.dayOff) return null;
|
|
6956
|
+
return {
|
|
6957
|
+
day,
|
|
6958
|
+
evidence: n >= 0 && isWorkday(day, SETTINGS) ? evidenceFor(n) : { sessions: [], commits: [], jira: [] },
|
|
6959
|
+
titles: TITLES,
|
|
6960
|
+
builtAt: new Date(now()).toISOString(),
|
|
6961
|
+
edited: e.edited ?? null,
|
|
6962
|
+
dayOff: e.dayOff ?? false,
|
|
6963
|
+
posted: e.posted ?? null
|
|
6964
|
+
};
|
|
6965
|
+
};
|
|
6966
|
+
return {
|
|
6967
|
+
days: (from, to) => daysWireOf(
|
|
6968
|
+
from,
|
|
6969
|
+
to,
|
|
6970
|
+
SETTINGS,
|
|
6971
|
+
daysBetween(from, to).map(record).filter((r) => !!r)
|
|
6972
|
+
),
|
|
6973
|
+
day: (day) => ({ ...dayWireOf(day, SETTINGS, record(day)), posting: { ready: true, why: null } }),
|
|
6974
|
+
update: (day, change) => {
|
|
6975
|
+
edits.set(day, { ...edits.get(day) ?? {}, ...change });
|
|
6976
|
+
return { ...dayWireOf(day, SETTINGS, record(day)), posting: { ready: true, why: null } };
|
|
6977
|
+
},
|
|
6978
|
+
/** "Posting": what the day shows is now what Tempo has (nothing leaves the demo). */
|
|
6979
|
+
post: (day) => {
|
|
6980
|
+
const w = dayWireOf(day, SETTINGS, record(day));
|
|
6981
|
+
const before = record(day)?.posted?.entries ?? [];
|
|
6982
|
+
const kept = w.entries.filter((e) => before.some((b) => b.key === e.key && b.hours === e.hours)).length;
|
|
6983
|
+
edits.set(day, { ...edits.get(day) ?? {}, posted: { at: new Date(now()).toISOString(), entries: w.entries, worklogs: [] } });
|
|
6984
|
+
return {
|
|
6985
|
+
posted: w.entries.length - kept,
|
|
6986
|
+
removed: before.length - kept,
|
|
6987
|
+
kept,
|
|
6988
|
+
coveredByHand: 0,
|
|
6989
|
+
otherByHand: 0,
|
|
6990
|
+
failed: [],
|
|
6991
|
+
day: { ...dayWireOf(day, SETTINGS, record(day)), posting: { ready: true, why: null } }
|
|
6992
|
+
};
|
|
6993
|
+
},
|
|
6994
|
+
settings: SETTINGS
|
|
6995
|
+
};
|
|
6996
|
+
}
|
|
6997
|
+
|
|
6727
6998
|
// src/server/demo/demo-replies.ts
|
|
6728
6999
|
function mountDemoReplies(app, scenario, emit) {
|
|
6729
7000
|
const byId = /* @__PURE__ */ new Map();
|
|
@@ -6958,6 +7229,13 @@ async function startDemoServer(opts) {
|
|
|
6958
7229
|
"/api/sessions/:id/diff-seen",
|
|
6959
7230
|
(c) => scenario.checkpoints(c.req.param("id")) ? c.json({ seen: diffSeen.get(c.req.param("id")) ?? null }) : notFound(c)
|
|
6960
7231
|
);
|
|
7232
|
+
app.post("/api/sessions/:id/diff-page", (c) => {
|
|
7233
|
+
const id = c.req.param("id");
|
|
7234
|
+
const s = scenario.sessions.get(id);
|
|
7235
|
+
if (!s) return c.json({ error: "unknown session" }, 404);
|
|
7236
|
+
if (s.archivedAt) return c.json({ error: "archived: restore it to see its diff" }, 409);
|
|
7237
|
+
return c.json({ url: `/#/s/${encodeURIComponent(id)}/diff` });
|
|
7238
|
+
});
|
|
6961
7239
|
app.post("/api/sessions/:id/diff-seen", async (c) => {
|
|
6962
7240
|
const id = c.req.param("id");
|
|
6963
7241
|
if (!scenario.checkpoints(id)) return notFound(c);
|
|
@@ -7262,6 +7540,64 @@ async function startDemoServer(opts) {
|
|
|
7262
7540
|
const s = scenario.create(body.target, branch, prompt);
|
|
7263
7541
|
return c.json({ sessionId: s.id, launchDir: s.paths[0], paths: s.paths, ...prompt ? { started: "started" } : {} });
|
|
7264
7542
|
});
|
|
7543
|
+
const demoTime = createDemoTime(() => scenario.clockMs());
|
|
7544
|
+
app.get("/api/time", (c) => {
|
|
7545
|
+
const r = timeRange({ from: c.req.query("from"), to: c.req.query("to") }, localDay(scenario.clockMs()), DEFAULT_CATCH_UP_DAYS);
|
|
7546
|
+
if ("error" in r) return c.json({ error: r.error }, 400);
|
|
7547
|
+
return c.json(demoTime.days(r.from, r.to));
|
|
7548
|
+
});
|
|
7549
|
+
let demoGraph = {
|
|
7550
|
+
account: null,
|
|
7551
|
+
login: null
|
|
7552
|
+
};
|
|
7553
|
+
const graphWire = () => ({ ready: true, why: null, ...demoGraph, problem: null, error: null });
|
|
7554
|
+
app.get("/api/time/graph", (c) => c.json(graphWire()));
|
|
7555
|
+
app.post("/api/time/graph/connect", (c) => {
|
|
7556
|
+
demoGraph = {
|
|
7557
|
+
account: null,
|
|
7558
|
+
login: {
|
|
7559
|
+
userCode: "DEMO-1234",
|
|
7560
|
+
verificationUri: "https://microsoft.com/devicelogin",
|
|
7561
|
+
expiresAt: new Date(scenario.clockMs() + 9e5).toISOString()
|
|
7562
|
+
}
|
|
7563
|
+
};
|
|
7564
|
+
setTimeout(() => {
|
|
7565
|
+
demoGraph = { account: "you@example.com", login: null };
|
|
7566
|
+
broadcast({ event: "time-graph-changed", data: {} });
|
|
7567
|
+
}, 4e3).unref?.();
|
|
7568
|
+
return c.json(graphWire());
|
|
7569
|
+
});
|
|
7570
|
+
app.post("/api/time/graph/disconnect", (c) => {
|
|
7571
|
+
demoGraph = { account: null, login: null };
|
|
7572
|
+
broadcast({ event: "time-graph-changed", data: {} });
|
|
7573
|
+
return c.json(graphWire());
|
|
7574
|
+
});
|
|
7575
|
+
app.get("/api/time/:day", (c) => {
|
|
7576
|
+
const day = c.req.param("day");
|
|
7577
|
+
if (!isDay(day)) return c.json({ error: "day: YYYY-MM-DD" }, 400);
|
|
7578
|
+
return c.json(demoTime.day(day));
|
|
7579
|
+
});
|
|
7580
|
+
app.put("/api/time/:day", async (c) => {
|
|
7581
|
+
const day = c.req.param("day");
|
|
7582
|
+
if (!isDay(day)) return c.json({ error: "day: YYYY-MM-DD" }, 400);
|
|
7583
|
+
const change = dayChange(await c.req.json().catch(() => null), demoTime.settings.stepHours);
|
|
7584
|
+
if ("error" in change) return c.json({ error: change.error }, 400);
|
|
7585
|
+
const w = demoTime.update(day, change);
|
|
7586
|
+
broadcast({ event: "time-changed", data: { day } });
|
|
7587
|
+
return c.json(w);
|
|
7588
|
+
});
|
|
7589
|
+
app.post("/api/time/:day/post", (c) => {
|
|
7590
|
+
const day = c.req.param("day");
|
|
7591
|
+
if (!isDay(day)) return c.json({ error: "day: YYYY-MM-DD" }, 400);
|
|
7592
|
+
const r = demoTime.post(day);
|
|
7593
|
+
broadcast({ event: "time-changed", data: { day } });
|
|
7594
|
+
return c.json(r);
|
|
7595
|
+
});
|
|
7596
|
+
app.post("/api/time/:day/rebuild", (c) => {
|
|
7597
|
+
const day = c.req.param("day");
|
|
7598
|
+
if (!isDay(day)) return c.json({ error: "day: YYYY-MM-DD" }, 400);
|
|
7599
|
+
return c.json(demoTime.day(day));
|
|
7600
|
+
});
|
|
7265
7601
|
app.get("/api/pr-start", (c) => {
|
|
7266
7602
|
const ref = parsePrRef(c.req.query("ref") ?? "");
|
|
7267
7603
|
const target = c.req.query("target") || void 0;
|
|
@@ -7855,4 +8191,4 @@ export {
|
|
|
7855
8191
|
stopExisting,
|
|
7856
8192
|
webCommand
|
|
7857
8193
|
};
|
|
7858
|
-
//# sourceMappingURL=web-
|
|
8194
|
+
//# sourceMappingURL=web-W6BZVICE.js.map
|