@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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/core/time/time-deps.ts","../src/core/jira/jira.ts","../src/core/time/graph.ts"],"sourcesContent":["import fs from 'node:fs';\nimport { loadConfig } from '../platform/config.js';\nimport type { WorktreeSession } from '../sessions/session-types.js';\nimport { loadHistory } from '../sessions/history.js';\nimport { sessionIdFor } from '../sessions/session-id.js';\nimport { sessionWorkTime } from '../conversations/work-time-source.js';\nimport { runGitAsync } from '../diff/git-tree-snapshot.js';\nimport { fetchMyIssuesOrThrow, issueIdOf, myAccountId, searchIssuesOrThrow } from '../jira/jira.js';\nimport { runInternal } from '../diff/checkpoint-summary.js';\nimport { chatsOf, chatsSince, graphApp, graphToken, meetingsOn, type ChatsRead } from './graph.js';\nimport type { TimeJiraEvidence } from '../api-types.js';\nimport { readIssueIds, rememberIssueId } from './time-store.js';\nimport { isIssueKey } from './allocate.js';\nimport type { TimeDeps } from './time-days.js';\nimport { addDays, DEFAULT_CATCH_UP_DAYS, localDay, timeSettings } from './time-view.js';\n\n/**\n * The Time tab's real I/O: the sessions in state.db and their transcripts,\n * `git log` in every enrolled repo (your commits, by each repo's\n * `user.email`), and Jira through `acli` (what you moved; titles).\n */\nasync function graphTokenNow(): Promise<string | null> {\n const app = graphApp(loadConfig()?.time?.graph, process.env);\n return 'why' in app ? null : graphToken(app);\n}\n\n/**\n * The commits of a `git log --format=%H%x09%aI%x09%ce%x09%s` written on the\n * day: by author date, so a rebase, an amend or a cherry-pick counts on the\n * day of the work, not of the rewrite; and none GitHub committed (a squash\n * merge: the work is already counted by its own commits), nor a stash's own\n * commits. Pure.\n */\nexport function commitsWrittenOn(stdout: string, day: string): Array<{ sha: string; subject: string }> {\n const out: Array<{ sha: string; subject: string }> = [];\n for (const line of stdout.split('\\n').filter(Boolean)) {\n const [sha, authored, committer, ...rest] = line.split('\\t');\n if (committer === 'noreply@github.com') continue;\n // A stash's helper commits, should something other than refs/stash (left out of the log) still reach them.\n if (/^(index|untracked files) on /.test(rest.join('\\t'))) continue;\n const at = Date.parse(authored ?? '');\n if (Number.isNaN(at) || localDay(at) !== day) continue;\n out.push({ sha, subject: rest.join('\\t') });\n }\n return out;\n}\n\n/**\n * How long one read (a session's working time, a repo's commits, the Teams\n * chats, your assigned issues) serves the days after it, at most: a run of the\n * keeper starts fresh (`fresh`), and a catch-up of slow days (the AI step can\n * take a minute) reads each once, not once per day.\n */\nconst READ_FRESH_MS = 30 * 60_000;\n\n/** Issues one day's Jira search returns at most (the default 50 would cut a sprint's close or a triage short). */\nexport const JIRA_DAY_LIMIT = 500;\n\n/** What you did in Jira that day: status changes, and anything else you updated (a comment, an edit) — `updatedBy()`, by account id. */\nexport async function jiraOn(day: string): Promise<TimeJiraEvidence[]> {\n const d = day.replace(/-/g, '/');\n // To the next day's start, not 23:59: a change in a day's last minute would be on no day at all.\n const end = addDays(day, 1).replace(/-/g, '/');\n // Throws when acli can't answer: the day keeps what it had (time-days.ts), rather than \"did nothing\".\n const moved = await searchIssuesOrThrow(`status CHANGED BY currentUser() DURING (\"${d} 00:00\", \"${end} 00:00\")`, JIRA_DAY_LIMIT);\n const out: TimeJiraEvidence[] = moved.map((i) => ({ key: i.key, summary: i.summary, what: `moved (now ${i.status || 'changed'})` }));\n const account = loadConfig()?.time?.tempo?.accountId || process.env.JIRA_ACCOUNT_ID || (await myAccountId());\n if (account && /^[\\w:-]+$/.test(account)) {\n // The same bounds, with times (a bare end date may mean the whole of that day, or its start).\n // A failure throws too: half the answer would drop the day's commented-on issues.\n const updated = await searchIssuesOrThrow(`issuekey IN updatedBy(\"${account}\", \"${d} 00:00\", \"${end} 00:00\")`, JIRA_DAY_LIMIT);\n for (const i of updated)\n if (!out.some((o) => o.key === i.key)) out.push({ key: i.key, summary: i.summary, what: 'updated by you (a comment or an edit)' });\n }\n return out;\n}\n\n/**\n * Titles of these keys and whether each is done, in one search; when that is\n * refused (one key that doesn't exist fails the whole JQL — a branch's\n * `FOO-12`), each key alone, keeping the ones found. Throws when none could be\n * asked about (acli down): the day keeps what it had.\n */\nexport async function titlesOf(\n keys: string[],\n search: (jql: string, limit: number) => Promise<Array<{ key: string; summary: string; statusCategory?: string }>>,\n now = Date.now(),\n): Promise<Record<string, { title: string; done: boolean }>> {\n // Keys Jira said it doesn't have stay out of the search for an hour: one such key would send every rebuild\n // of the day down the one-key-at-a-time path.\n for (const [k, at] of refused) if (now - at > REFUSED_FOR_MS) refused.delete(k);\n const valid = keys.filter((k) => isIssueKey(k) && !refused.has(k));\n if (!valid.length) return {};\n const of = (issues: Array<{ key: string; summary: string; statusCategory?: string }>) =>\n issues.map((i) => [i.key, { title: i.summary, done: i.statusCategory === 'done' }] as const);\n try {\n return Object.fromEntries(of(await search(`key in (${valid.join(', ')})`, valid.length)));\n } catch (err) {\n if (valid.length === 1) throw err;\n // A few at a time (each is an acli process).\n const one: Array<ReturnType<typeof of> | null> = [];\n for (let i = 0; i < valid.length; i += TITLES_AT_ONCE)\n one.push(...(await Promise.all(valid.slice(i, i + TITLES_AT_ONCE).map((k) => search(`key = ${k}`, 1).then(of, () => null)))));\n if (one.every((r) => r === null)) throw err;\n // Asked alone and still refused, while others answered: Jira doesn't have it.\n one.forEach((r, i) => r === null && refused.set(valid[i], now));\n return Object.fromEntries(one.flatMap((r) => r ?? []));\n }\n}\n\nconst TITLES_AT_ONCE = 3;\nconst REFUSED_FOR_MS = 60 * 60_000;\nconst refused = new Map<string, number>();\n\n/** Forget the keys Jira refused (tests). */\nexport function resetRefusedKeys(): void {\n refused.clear();\n}\n\n/** What `defaultTimeDeps` reads with (tests pass their own). */\nexport interface TimeIo {\n git: (cwd: string, args: string[]) => Promise<{ status: number | null; stdout: string }>;\n workTime: (s: WorktreeSession, now: number, days: number) => Promise<{ byDay: Array<{ day: string; ms: number }> }>;\n /** Enrolled repos: alias → folder. */\n repos: () => Record<string, string>;\n exists: (folder: string) => boolean;\n}\n\nconst realIo: TimeIo = {\n git: (cwd, args) => runGitAsync(cwd, { args }),\n workTime: (s, now, days) => sessionWorkTime(s, now, days),\n repos: () => loadConfig()?.repos ?? {},\n exists: (folder) => fs.existsSync(folder),\n};\n\n/**\n * Your commits in one repo since a day, read once (a catch-up asks day by day,\n * oldest first: one `git log` from the oldest serves the rest).\n * `--exclude=refs/stash` keeps a stash's commits out; `--since` is the\n * committer date, never before the author date, so every commit written\n * since is in (and more, which `commitsWrittenOn` drops); `--fixed-strings`:\n * the email as it is (`jane+work@corp.com` isn't a pattern), whole (`<…>`). No email set:\n * none of yours to find (''). A git that fails throws: the day keeps the\n * commits it had.\n */\nasync function commitLog(git: TimeIo['git'], repo: string, from: string): Promise<string> {\n const email = (await git(repo, ['config', 'user.email'])).stdout.trim();\n if (!email) return '';\n const log = await git(repo, [\n 'log',\n '--exclude=refs/stash',\n '--all',\n '--no-merges',\n '--fixed-strings',\n `--since=${from} 00:00:00`,\n // The address in its angle brackets: --author matches anywhere in \"Name <email>\", and `an@corp` is in `ivan@corp`.\n `--author=<${email}>`,\n '--format=%H%x09%aI%x09%ce%x09%s',\n ]);\n if (log.status !== 0) throw new Error(`git log failed in ${repo}`);\n return log.stdout;\n}\n\nexport function defaultTimeDeps(io: TimeIo = realIo): TimeDeps {\n const catchUpDays = () => timeSettings(loadConfig()?.time).catchUpDays ?? DEFAULT_CATCH_UP_DAYS;\n // A session's working time, read once for every day a run builds (each read goes through all its transcripts).\n const workTime = new Map<string, { at: number; byDay: Promise<Map<string, number>> }>();\n const logs = new Map<string, { from: string; at: number; out: Promise<string> }>();\n // One read of the chats serves every day after its first: a 14-day catch-up is one read, not fourteen.\n let chats: { from: string; at: number; read: Promise<ChatsRead> } | null = null;\n let assigned: { at: number; list: Promise<Array<{ key: string; title: string }>> } | null = null;\n // What a turn doesn't move, read once until the next full run: a day's meetings, its Jira, its tickets' titles\n // (network: Graph and acli, every two minutes while Claude works otherwise).\n const slow = new Map<string, { at: number; read: Promise<unknown> }>();\n const once = <T>(key: string, read: () => Promise<T>): Promise<T> => {\n const c = slow.get(key);\n if (c && Date.now() - c.at <= READ_FRESH_MS) return c.read as Promise<T>;\n const p = read();\n slow.set(key, { at: Date.now(), read: p });\n p.catch(() => slow.delete(key)); // a failed read isn't kept\n return p;\n };\n return {\n fresh: (what = 'all') => {\n workTime.clear();\n logs.clear();\n if (what === 'local') return;\n chats = null;\n slow.clear();\n assigned = null;\n },\n sessions: () => loadHistory(),\n minutesOn: async (s, day) => {\n const id = sessionIdFor(s);\n let w = workTime.get(id);\n if (!w || Date.now() - w.at > READ_FRESH_MS) {\n const byDay = io.workTime(s, Date.now(), catchUpDays()).then((t) => new Map(t.byDay.map((d) => [d.day, d.ms])));\n w = { at: Date.now(), byDay };\n workTime.set(id, w);\n byDay.catch(() => workTime.delete(id)); // a failed read isn't kept\n }\n return ((await w.byDay).get(day) ?? 0) / 60_000;\n },\n minutesFrom: () => addDays(localDay(), -(catchUpDays() - 1)),\n commits: async (day) => {\n const repos = io.repos();\n const aliasOf = new Map<string, string>();\n for (const [alias, folder] of Object.entries(repos)) if (!aliasOf.has(folder)) aliasOf.set(folder, alias);\n const seen = new Set<string>();\n const out: Array<{ repo: string; sha: string; subject: string }> = [];\n // Every repo's read started at once (each a git process), then taken in order.\n const reads = [...aliasOf.keys()]\n .filter((repo) => io.exists(repo)) // a folder gone: nothing to read there (not a failure)\n .map((repo) => {\n let l = logs.get(repo);\n if (!l || day < l.from || Date.now() - l.at > READ_FRESH_MS) {\n const read = commitLog(io.git, repo, day);\n l = { from: day, at: Date.now(), out: read };\n logs.set(repo, l);\n read.catch(() => logs.delete(repo)); // a failed read isn't kept\n }\n return { repo, out: l.out };\n });\n for (const { repo, out: log } of reads) {\n for (const c of commitsWrittenOn(await log, day)) {\n if (seen.has(c.sha)) continue;\n seen.add(c.sha);\n out.push({ repo: aliasOf.get(repo) ?? repo, ...c });\n }\n }\n return out;\n },\n jiraMoved: (day) => once(`jira:${day}`, () => jiraOn(day)),\n titles: (keys) => once(`titles:${[...keys].sort().join(',')}`, () => titlesOf(keys, searchIssuesOrThrow)),\n settings: () => timeSettings(loadConfig()?.time),\n // Outlook and Teams only once you signed in (the Time tab's Connect): none otherwise. A sign-in that stopped\n // working, or no network, throws (graphToken): the day keeps the meetings and chats it had.\n meetings: async (day) => {\n const token = await graphTokenNow();\n return token ? once(`meetings:${day}`, () => meetingsOn(day, token)) : undefined;\n },\n chats: async (day) => {\n const token = await graphTokenNow();\n if (!token) return undefined;\n if (!chats || day < chats.from || Date.now() - chats.at > READ_FRESH_MS) {\n const read = chatsSince(day, token);\n chats = { from: day, at: Date.now(), read };\n read.catch(() => (chats = null)); // a failed read isn't kept\n }\n // A chat busier than was read reached back only so far: a day before that isn't known, and keeps what it had.\n return chatsOf(await chats.read, day);\n },\n // Throws when acli can't list them: the day keeps its AI answer and the projects it knew (time-days.ts).\n candidates: () => {\n if (!assigned || Date.now() - assigned.at > READ_FRESH_MS) {\n const list = fetchMyIssuesOrThrow().then((is) => is.map((i) => ({ key: i.key, title: i.summary })));\n assigned = { at: Date.now(), list };\n list.catch(() => (assigned = null)); // a failed read isn't kept\n }\n return assigned.list;\n },\n classify: (prompt) => runInternal(prompt, 60_000, { small: true }),\n issueId: async (key) => {\n const known = readIssueIds()[key];\n if (known !== undefined) return known;\n const id = await issueIdOf(key);\n if (id !== null) rememberIssueId(key, id);\n return id;\n },\n };\n}\n","import { execFile } from 'node:child_process';\n\nexport interface JiraIssue {\n key: string;\n summary: string;\n status: string;\n /** Jira's category for the status: new (to do), indeterminate (in progress, review…), done. Orders the board's columns. */\n statusCategory?: 'new' | 'indeterminate' | 'done';\n issuetype: string;\n priority: string;\n url: string;\n}\n\nfunction execAsync(cmd: string, args: string[], timeout: number): Promise<string> {\n return new Promise((resolve, reject) => {\n // `windowsHide: true` prevents a console window from flashing on\n // Windows whenever the Jira pane refreshes (every 120 s when open).\n // Without it, opening the Jira pane in `work web` triggers a\n // visible terminal popup.\n execFile(cmd, args, { encoding: 'utf-8', timeout, windowsHide: true }, (err, stdout) => {\n if (err) reject(err);\n else resolve(stdout ?? '');\n });\n });\n}\n\n/** Run `acli jira auth status` once and parse it for both availability\n * AND the site URL. Replaces the previous two-call pattern where\n * `isAcliAvailable` and `getJiraSiteUrl` each shelled out independently. */\nasync function probeAcli(): Promise<{ available: boolean; siteUrl: string }> {\n try {\n const stdout = await execAsync('acli', ['jira', 'auth', 'status'], 5000);\n const match = stdout.match(/Site:\\s+(\\S+)/);\n return {\n available: true,\n siteUrl: match ? `https://${match[1]}` : '',\n };\n } catch {\n return { available: false, siteUrl: '' };\n }\n}\n\n/** The fields of `acli jira workitem search --json` this reads; all optional — it is someone else's output. */\ninterface AcliIssue {\n key?: string;\n fields?: {\n summary?: string;\n status?: { name?: string; statusCategory?: { key?: string } };\n issuetype?: { name?: string };\n priority?: { name?: string };\n };\n}\n\n/** Jira's three status categories (the board's column order); anything else isn't one. */\nfunction isStatusCategory(k: unknown): k is NonNullable<JiraIssue['statusCategory']> {\n return k === 'new' || k === 'indeterminate' || k === 'done';\n}\n\nfunction parseIssuesJson(stdout: string, siteUrl: string): JiraIssue[] {\n const parsed = JSON.parse(stdout) as { issues?: AcliIssue[] } | AcliIssue[] | null;\n const issues: AcliIssue[] = (Array.isArray(parsed) ? parsed : parsed?.issues) ?? [];\n\n return issues.map((issue) => {\n const fields = issue.fields ?? {};\n return {\n key: issue.key ?? '',\n summary: fields.summary ?? '',\n status: fields.status?.name ?? '',\n ...(isStatusCategory(fields.status?.statusCategory?.key) ? { statusCategory: fields.status.statusCategory.key } : {}),\n issuetype: fields.issuetype?.name ?? '',\n priority: fields.priority?.name ?? '',\n url: siteUrl ? `${siteUrl}/browse/${issue.key}` : '',\n };\n });\n}\n\n/**\n * Your open issues: by the status's category, not `resolution = Unresolved` — service-desk workflows set a\n * resolution on issues still open (\"Waiting for feedback\", a Review), which hid them from the Jira tab (SSD-2465).\n */\nexport const MY_ISSUES_JQL = 'assignee = currentUser() AND statusCategory != Done AND status NOT IN (Archived) ORDER BY updated DESC';\n\nasync function searchMyIssues(siteUrl: string): Promise<JiraIssue[]> {\n try {\n const stdout = await execAsync('acli', ['jira', 'workitem', 'search', '--jql', MY_ISSUES_JQL, '--json', '--limit', '50'], 15000);\n if (!stdout) return [];\n return parseIssuesJson(stdout, siteUrl);\n } catch {\n return [];\n }\n}\n\n/**\n * Your open issues, or a throw when acli can't list them (not there, signed\n * out, offline) — for the Jira watch, where \"none\" and \"couldn't ask\" must\n * differ: an empty list taken for the truth would use up the one-time\n * adoption of issues the list newly shows (`adoptListChange`).\n */\nexport async function fetchMyIssuesOrThrow(): Promise<JiraIssue[]> {\n const probe = await probeAcli();\n if (!probe.available) throw new Error('acli is not available (installed and signed in?)');\n // All of them, not the 50 most recently updated: one the watch never saw would look newly assigned once it's updated.\n const stdout = await execAsync('acli', ['jira', 'workitem', 'search', '--jql', MY_ISSUES_JQL, '--json', '--paginate'], 60_000);\n return stdout ? parseIssuesJson(stdout, probe.siteUrl) : [];\n}\n\n/** An issue's numeric id (Tempo wants it); null when acli can't say. */\nexport async function issueIdOf(key: string): Promise<number | null> {\n try {\n const stdout = await execAsync('acli', ['jira', 'workitem', 'view', key, '--json'], 15000);\n const j = JSON.parse(stdout) as { id?: unknown };\n const id = typeof j.id === 'string' ? Number(j.id) : j.id;\n return typeof id === 'number' && Number.isFinite(id) ? id : null;\n } catch {\n return null;\n }\n}\n\nlet accountIdCache: string | null = null;\n/** When it last couldn't tell: not asked again for a while (each ask is an acli process, and every Jira lookup asks). */\nlet accountIdMissedAt = 0;\nconst ACCOUNT_RETRY_MS = 10 * 60_000;\n\n/**\n * Your Jira account id (what `updatedBy()` wants: acli refuses `currentUser()`\n * inside it), from an issue assigned to you; cached for the process. Null\n * when it can't tell.\n */\nexport async function myAccountId(): Promise<string | null> {\n if (accountIdCache) return accountIdCache;\n if (Date.now() - accountIdMissedAt < ACCOUNT_RETRY_MS) return null;\n try {\n const stdout = await execAsync(\n 'acli',\n [\n 'jira',\n 'workitem',\n 'search',\n '--jql',\n 'assignee = currentUser() ORDER BY updated DESC',\n '--fields',\n 'assignee',\n '--json',\n '--limit',\n '1',\n ],\n 15000,\n );\n const parsed = JSON.parse(stdout) as unknown;\n const list = (Array.isArray(parsed) ? parsed : (parsed as { issues?: unknown[] } | null)?.issues) ?? [];\n const id = (list[0] as { fields?: { assignee?: { accountId?: unknown } } } | undefined)?.fields?.assignee?.accountId;\n accountIdCache = typeof id === 'string' && id ? id : null;\n } catch {\n accountIdCache = null;\n }\n if (!accountIdCache) accountIdMissedAt = Date.now();\n return accountIdCache;\n}\n\n/** The same, but a failure (no acli, signed out, no network) throws: for callers that must tell \"none\" from \"couldn't ask\". */\nexport async function searchIssuesOrThrow(jql: string, limit = 50): Promise<JiraIssue[]> {\n const stdout = await execAsync('acli', ['jira', 'workitem', 'search', '--jql', jql, '--json', '--limit', String(limit)], 15000);\n return stdout ? parseIssuesJson(stdout, '') : [];\n}\n\n/**\n * Combined availability check + issue fetch in one acli probe. Used by\n * the dashboard's Jira pane so a refresh only spawns `acli jira auth\n * status` once instead of twice. The pane needs `available` separately\n * from `issues` so it can render the \"acli not configured\" hint.\n */\nexport async function fetchJiraPane(): Promise<{\n available: boolean;\n issues: JiraIssue[];\n}> {\n const probe = await probeAcli();\n if (!probe.available) return { available: false, issues: [] };\n const issues = await searchMyIssues(probe.siteUrl);\n return { available: true, issues };\n}\n\n/** What the Jira watch reads to decide where an issue belongs. */\nexport interface JiraIssueDetail {\n project: { key: string; name: string } | null;\n components: string[];\n labels: string[];\n /** The description as plain text (from Jira's document format), cut to a few thousand characters. */\n description: string;\n created: string | null;\n}\n\n/** Jira's document format (ADF) as plain text: paragraphs and list items on their own lines. Pure. */\nexport function adfText(node: unknown, max = 4000): string {\n const out: string[] = [];\n const walk = (n: unknown): void => {\n if (!n || typeof n !== 'object') return;\n const o = n as { type?: unknown; text?: unknown; content?: unknown };\n if (o.type === 'text' && typeof o.text === 'string') out.push(o.text);\n if (Array.isArray(o.content)) for (const c of o.content) walk(c);\n if (o.type === 'paragraph' || o.type === 'heading' || o.type === 'listItem' || o.type === 'codeBlock') out.push('\\n');\n };\n walk(node);\n const text = out\n .join('')\n .replace(/\\n{3,}/g, '\\n\\n')\n .trim();\n return text.length > max ? text.slice(0, max) + '…' : text;\n}\n\n/** One issue's project, components, labels and description (`acli jira workitem view`). Null when acli can't say. */\nexport async function fetchIssueDetail(key: string): Promise<JiraIssueDetail | null> {\n if (!/^[A-Z][A-Z0-9_]*-\\d+$/.test(key)) return null;\n try {\n const stdout = await execAsync(\n 'acli',\n ['jira', 'workitem', 'view', key, '--json', '--fields', 'summary,description,project,components,labels,created'],\n 15000,\n );\n const f = (JSON.parse(stdout) as { fields?: Record<string, unknown> }).fields ?? {};\n const p = f.project as { key?: unknown; name?: unknown } | undefined;\n const names = (v: unknown) =>\n Array.isArray(v)\n ? v.map((c) => (typeof c === 'string' ? c : (c as { name?: unknown })?.name)).filter((s): s is string => typeof s === 'string')\n : [];\n return {\n project: p && typeof p.key === 'string' ? { key: p.key, name: typeof p.name === 'string' ? p.name : p.key } : null,\n components: names(f.components),\n labels: names(f.labels),\n description: adfText(f.description),\n created: typeof f.created === 'string' ? f.created : null,\n };\n } catch {\n return null;\n }\n}\n\n/** Your assigned, unresolved issues (the Jira tab's list); [] when acli isn't there or fails. */\nexport async function fetchMyIssues(): Promise<JiraIssue[]> {\n const r = await fetchJiraPane();\n return r.issues;\n}\n","import fs from 'node:fs';\nimport path from 'node:path';\nimport { getConfigDir } from '../platform/config.js';\nimport { atomicWriteFile, ensureFile, withFileLockSync } from '../platform/fs-safe.js';\nimport { issueKeys } from './allocate.js';\nimport { localDay } from './time-view.js';\nimport type { TimeChatEvidence, TimeMeetingEvidence } from '../api-types.js';\n\n/**\n * Outlook meetings and Teams chats for the Time tab, from Microsoft Graph\n * as you (delegated): the device-code sign-in the timesheet tool uses — a\n * code you enter at microsoft.com — with its app registration (config\n * `time.graph.clientId` / `tenantId`, else GRAPH_CLIENT_ID / GRAPH_TENANT_ID).\n * The refresh token is kept in ~/.work/graph-token.json (only your user can\n * read it) and never reaches the browser. Read only: Calendars.Read,\n * Chat.Read. Chats are your own messages that day, shortened: what the\n * Time tab's AI step reads to place them on a ticket (classify.ts).\n */\n\nexport const GRAPH_SCOPES = 'offline_access User.Read Calendars.Read Chat.Read';\nconst GRAPH = 'https://graph.microsoft.com/v1.0';\nconst loginUrl = (tenant: string, what: string) => `https://login.microsoftonline.com/${encodeURIComponent(tenant)}/oauth2/v2.0/${what}`;\n\nexport interface GraphApp {\n clientId: string;\n tenantId: string;\n}\n\n/** The app registration to sign in with, or why there's none. Pure over config and env. */\nexport function graphApp(\n cfg: { clientId?: string; tenantId?: string } | undefined,\n env: Record<string, string | undefined>,\n): GraphApp | { why: string } {\n const clientId = cfg?.clientId?.trim() || env.GRAPH_CLIENT_ID?.trim();\n if (!clientId) return { why: 'No app to sign in to Microsoft with: set time.graph.clientId (and tenantId) in config.json.' };\n return { clientId, tenantId: cfg?.tenantId?.trim() || env.GRAPH_TENANT_ID?.trim() || 'organizations' };\n}\n\ninterface TokenFile {\n refreshToken: string;\n accessToken: string;\n expiresAt: number;\n account: string;\n clientId: string;\n /** Why the sign-in stopped working (a refused refresh): connect again. */\n problem?: string;\n}\n\nconst tokenPath = () => path.join(getConfigDir(), 'graph-token.json');\n\nfunction readTokens(): TokenFile | null {\n try {\n const v = JSON.parse(fs.readFileSync(tokenPath(), 'utf8')) as Partial<TokenFile>;\n return typeof v.refreshToken === 'string' && typeof v.accessToken === 'string' && typeof v.expiresAt === 'number'\n ? {\n refreshToken: v.refreshToken,\n accessToken: v.accessToken,\n expiresAt: v.expiresAt,\n account: v.account ?? '',\n clientId: v.clientId ?? '',\n ...(typeof v.problem === 'string' ? { problem: v.problem } : {}),\n }\n : null;\n } catch {\n return null;\n }\n}\n\n/**\n * Under the file's lock, atomically (work web and a `work timesheet` may\n * refresh at once). Only you can read it: the file is made 0600 before\n * anything is in it, and the atomic write keeps the mode it finds.\n */\nfunction writeTokens(t: TokenFile): void {\n const file = tokenPath();\n fs.mkdirSync(path.dirname(file), { recursive: true });\n ensureFile(file, '{}');\n fs.chmodSync(file, 0o600);\n withFileLockSync(file, () => atomicWriteFile(file, JSON.stringify(t)));\n}\n\n/**\n * Change the tokens as they are now, under the lock (a read-modify-write: the\n * keeper and a `work timesheet` may refresh at once). `change` gets what's\n * there and returns what to write, or null to leave it. Not signed in (the\n * file gone — Disconnect): nothing is written, so a refresh that was under way\n * can't sign you back in.\n */\nfunction updateTokens(change: (cur: TokenFile) => TokenFile | null): void {\n const file = tokenPath();\n if (!fs.existsSync(file)) return;\n withFileLockSync(file, () => {\n const cur = readTokens();\n const next = cur && change(cur);\n if (next) atomicWriteFile(file, JSON.stringify(next));\n });\n}\n\n/** Signed in as whom, if at all. */\nexport function graphAccount(): string | null {\n return readTokens()?.account || null;\n}\n\nexport const EXPIRED = 'The Microsoft sign-in stopped working (expired or revoked): connect again.';\nexport const OTHER_APP = 'Signed in with another app registration than time.graph names now: connect again.';\n\n/** Signed in, but it no longer works, and why (a refused refresh, another app registration); null when fine or not signed in. */\nexport function graphProblem(app: GraphApp | { why: string }): string | null {\n const t = readTokens();\n if (!t) return null;\n if (t.problem) return t.problem;\n if (!('why' in app) && t.clientId && t.clientId !== app.clientId) return OTHER_APP;\n return null;\n}\n\nexport function signOutGraph(): void {\n const file = tokenPath();\n if (!fs.existsSync(file)) return;\n // Under the lock, so a refresh writing at that moment finishes first (and then finds no file).\n withFileLockSync(file, () => fs.rmSync(file, { force: true }));\n}\n\ntype Fetch = typeof fetch;\n\n/** The code to enter at microsoft.com, and what to poll with. */\nexport interface DeviceLogin {\n userCode: string;\n verificationUri: string;\n deviceCode: string;\n expiresAt: number;\n intervalMs: number;\n}\n\n/** Every call to Microsoft gives up after this: a hung connection must not hold a day's build (and the keeper) for ever. */\nexport const TIMEOUT_MS = 30_000;\n\n/** Token-endpoint errors that mean the sign-in itself is gone (expired, revoked, a changed password). Others (throttling, a server error) pass. */\nconst SIGN_IN_GONE = new Set(['invalid_grant', 'interaction_required', 'invalid_client', 'unauthorized_client', 'consent_required']);\n\n/** A form POST to the sign-in endpoints, with the timeout. */\nconst postForm = (fetchImpl: Fetch, url: string, form: Record<string, string>) =>\n fetchImpl(url, {\n method: 'POST',\n headers: { 'Content-Type': 'application/x-www-form-urlencoded' },\n body: new URLSearchParams(form).toString(),\n signal: AbortSignal.timeout(TIMEOUT_MS),\n });\n\nexport async function startDeviceLogin(app: GraphApp, fetchImpl: Fetch = fetch, now = Date.now()): Promise<DeviceLogin> {\n const res = await postForm(fetchImpl, loginUrl(app.tenantId, 'devicecode'), { client_id: app.clientId, scope: GRAPH_SCOPES });\n const j = (await res.json().catch(() => ({}))) as {\n user_code?: string;\n device_code?: string;\n verification_uri?: string;\n expires_in?: number;\n interval?: number;\n error_description?: string;\n };\n if (!res.ok || !j.user_code || !j.device_code) throw new Error(`Microsoft sign-in: ${j.error_description?.split('\\n')[0] ?? res.status}`);\n return {\n userCode: j.user_code,\n verificationUri: j.verification_uri ?? 'https://microsoft.com/devicelogin',\n deviceCode: j.device_code,\n expiresAt: now + (j.expires_in ?? 900) * 1000,\n intervalMs: (j.interval ?? 5) * 1000,\n };\n}\n\nexport const CANCELLED = 'The sign-in was cancelled.';\n/** Who a new sign-in is, until Microsoft says (`/me`). */\nexport const NEW_ACCOUNT = 'your Microsoft account';\n\n/** Wait for the code to be entered (polling as Microsoft asks); keeps the tokens. Resolves with the account, or throws why not. */\nexport async function finishDeviceLogin(\n app: GraphApp,\n login: DeviceLogin,\n opts: { fetchImpl?: Fetch; sleep?: (ms: number) => Promise<void>; now?: () => number; cancelled?: () => boolean } = {},\n): Promise<string> {\n const fetchImpl = opts.fetchImpl ?? fetch;\n const sleep = opts.sleep ?? ((ms: number) => new Promise((r) => setTimeout(r, ms)));\n const now = opts.now ?? (() => Date.now());\n let interval = login.intervalMs;\n while (now() < login.expiresAt) {\n await sleep(interval);\n // Disconnected, or another sign-in started: this one keeps nothing.\n if (opts.cancelled?.()) throw new Error(CANCELLED);\n const res = await postForm(fetchImpl, loginUrl(app.tenantId, 'token'), {\n grant_type: 'urn:ietf:params:oauth:grant-type:device_code',\n client_id: app.clientId,\n device_code: login.deviceCode,\n });\n const j = (await res.json().catch(() => ({}))) as TokenAnswer & { error?: string; error_description?: string };\n if (res.ok && j.access_token) {\n if (opts.cancelled?.()) throw new Error(CANCELLED);\n return keep(app, j, now(), fetchImpl);\n }\n if (j.error === 'authorization_pending') continue;\n if (j.error === 'slow_down') {\n interval += 5000;\n continue;\n }\n throw new Error(\n j.error === 'expired_token'\n ? 'The sign-in code expired: connect again.'\n : `Microsoft sign-in: ${j.error_description?.split('\\n')[0] ?? j.error ?? res.status}`,\n );\n }\n throw new Error('The sign-in code expired: connect again.');\n}\n\ninterface TokenAnswer {\n access_token?: string;\n refresh_token?: string;\n expires_in?: number;\n}\n\n/**\n * Keep the tokens Microsoft just gave — first, before anything else can fail:\n * a refresh rotates the refresh token, and losing the new one would leave the\n * old. Then who you are (`/me`), best effort: a failure keeps the account\n * known before.\n */\nasync function keep(app: GraphApp, j: TokenAnswer, now: number, fetchImpl: Fetch, opts: { refresh?: boolean } = {}): Promise<string> {\n const before = readTokens();\n const tokens: TokenFile = {\n refreshToken: j.refresh_token ?? before?.refreshToken ?? '',\n accessToken: j.access_token!,\n expiresAt: now + ((j.expires_in ?? 3600) - 60) * 1000,\n // A refresh keeps who it was; a new sign-in may be another account: not the old one's name (until /me says).\n account: opts.refresh ? (before?.account ?? '') : NEW_ACCOUNT,\n clientId: app.clientId,\n };\n // A refresh only updates a sign-in that's still there (Disconnect meanwhile wins); a new sign-in writes it.\n if (opts.refresh) updateTokens(() => tokens);\n else writeTokens(tokens);\n const who = await fetchImpl(`${GRAPH}/me?$select=userPrincipalName,id`, {\n headers: { Authorization: `Bearer ${j.access_token}` },\n signal: AbortSignal.timeout(TIMEOUT_MS),\n })\n .then((me) => me.json() as Promise<{ userPrincipalName?: string }>)\n .catch(() => ({}) as { userPrincipalName?: string });\n if (who.userPrincipalName && who.userPrincipalName !== tokens.account)\n updateTokens((cur) => (cur.accessToken === tokens.accessToken ? { ...cur, account: who.userPrincipalName! } : null));\n return who.userPrincipalName ?? tokens.account;\n}\n\n/**\n * An access token, refreshed when it ran out; null when not signed in.\n * Signed in but not working (a refused refresh — recorded, so the tab says\n * \"connect again\" —, another app registration, no network) throws: the day\n * then keeps the meetings and chats it had, rather than losing them.\n */\nexport async function graphToken(app: GraphApp, fetchImpl: Fetch = fetch, now = Date.now()): Promise<string | null> {\n const t = readTokens();\n if (!t) return null;\n if (t.problem) throw new Error(t.problem);\n if (t.clientId && t.clientId !== app.clientId) throw new Error(OTHER_APP);\n if (t.expiresAt > now) return t.accessToken;\n const res = await postForm(fetchImpl, loginUrl(app.tenantId, 'token'), {\n grant_type: 'refresh_token',\n client_id: app.clientId,\n refresh_token: t.refreshToken,\n scope: GRAPH_SCOPES,\n });\n const j = (await res.json().catch(() => ({}))) as TokenAnswer & { error?: string };\n if (!res.ok || !j.access_token) {\n // The sign-in itself refused: said until you connect again. Throttling (429) or a server error may pass: tried again next time.\n const gone = !!j.error && SIGN_IN_GONE.has(j.error);\n if (gone) {\n // Another refresh may have just rotated it (the keeper and a Gather at once): its new tokens stand.\n let renewed: string | null = null;\n updateTokens((cur) => {\n if (cur.refreshToken !== t.refreshToken) {\n renewed = cur.expiresAt > now ? cur.accessToken : null;\n return null;\n }\n return { ...cur, problem: EXPIRED };\n });\n if (renewed) return renewed;\n }\n throw new Error(gone ? EXPIRED : `Microsoft sign-in: ${res.status}${j.error ? ` ${j.error}` : ''}`);\n }\n await keep(app, j, now, fetchImpl, { refresh: true });\n return j.access_token;\n}\n\nasync function getJson<T>(url: string, token: string, fetchImpl: Fetch, headers: Record<string, string> = {}): Promise<T> {\n const res = await fetchImpl(url, { headers: { Authorization: `Bearer ${token}`, ...headers }, signal: AbortSignal.timeout(TIMEOUT_MS) });\n if (!res.ok) throw new Error(`Microsoft Graph: ${res.status} ${(await res.text().catch(() => '')).slice(0, 200)}`);\n return (await res.json()) as T;\n}\n\n/** A local day's bounds as instants. */\nconst dayBounds = (day: string) => {\n const from = new Date(`${day}T00:00:00`);\n const to = new Date(from);\n to.setDate(to.getDate() + 1);\n return { from, to };\n};\n\n/** Meetings you had that day: not cancelled, not declined, not free, not all day. */\nexport async function meetingsOn(day: string, token: string, fetchImpl: Fetch = fetch): Promise<TimeMeetingEvidence[]> {\n const { from, to } = dayBounds(day);\n const tz = Intl.DateTimeFormat().resolvedOptions().timeZone;\n type Event = {\n id?: string;\n subject?: string;\n start?: { dateTime?: string; timeZone?: string };\n end?: { dateTime?: string; timeZone?: string };\n isAllDay?: boolean;\n isCancelled?: boolean;\n showAs?: string;\n responseStatus?: { response?: string };\n };\n // Page by page: a day with shared calendars and holds can have more than a page.\n const all: Event[] = [];\n let next: string | undefined =\n `${GRAPH}/me/calendarView?startDateTime=${from.toISOString()}&endDateTime=${to.toISOString()}` +\n '&$select=id,subject,start,end,isAllDay,isCancelled,showAs,responseStatus&$top=100';\n for (let page = 0; next && page < MAX_PAGES; page++) {\n const p: Paged<Event> = await getJson(next, token, fetchImpl, { Prefer: `outlook.timezone=\"${tz}\"` });\n all.push(...(p.value ?? []));\n next = p['@odata.nextLink'];\n }\n // Cut at the page limit: not the whole day — a failed read, so the day keeps the meetings it had.\n if (next) throw new Error(`more calendar items than ${MAX_PAGES} pages`);\n // Each meeting within the day (a three-day offsite is this day's part of it), in order; time two meetings\n // share counts once (the later one gets only what the earlier didn't cover), so a day never holds more than it has.\n const events = all\n .filter((e) => !(e.isAllDay || e.isCancelled || e.showAs === 'free' || e.responseStatus?.response === 'declined'))\n .map((e) => ({\n e,\n start: Math.max(graphTime(e.start), from.getTime()),\n end: Math.min(graphTime(e.end), to.getTime()),\n }))\n .filter((x) => x.end > x.start)\n .sort((a, b) => a.start - b.start);\n const out: TimeMeetingEvidence[] = [];\n let covered = -Infinity;\n for (const { e, start, end } of events) {\n const minutes = Math.round((end - Math.max(start, Math.min(covered, end))) / 60_000);\n covered = Math.max(covered, end);\n if (!(minutes > 0)) continue;\n out.push({\n ...(e.id ? { id: e.id } : {}),\n subject: e.subject?.trim() || '(no subject)',\n start: hhmm(start),\n end: end >= to.getTime() ? '24:00' : hhmm(end),\n minutes,\n });\n }\n return out;\n}\n\n/** A local time as `HH:MM`. */\nconst hhmm = (ms: number) => {\n const d = new Date(ms);\n return `${String(d.getHours()).padStart(2, '0')}:${String(d.getMinutes()).padStart(2, '0')}`;\n};\n\n/**\n * A calendar time as Graph gives it: a `dateTime` with no offset, in the zone\n * `timeZone` names — local when it honoured our `Prefer: outlook.timezone`,\n * UTC when it didn't (it falls back to UTC): read as such, not as local,\n * which would shift every meeting by the offset. NaN when unreadable.\n */\nexport function graphTime(t: { dateTime?: string; timeZone?: string } | undefined): number {\n const dt = t?.dateTime ?? '';\n if (!dt) return NaN;\n if (/[zZ]|[+-]\\d\\d:?\\d\\d$/.test(dt.slice(19))) return Date.parse(dt); // carries its own offset\n return /^(utc|etc\\/utc|coordinated universal time|gmt)$/i.test(t?.timeZone ?? '') ? Date.parse(`${dt}Z`) : Date.parse(dt);\n}\n\n/** How many pages of chats, and of one chat's messages, are read at most (50 each). */\nexport const MAX_PAGES = 10;\n\ntype Paged<T> = { value?: T[]; '@odata.nextLink'?: string };\ntype Chat = { id?: string; topic?: string | null; chatType?: string; lastMessagePreview?: { createdDateTime?: string } | null };\ntype Msg = {\n createdDateTime?: string;\n lastModifiedDateTime?: string;\n from?: { user?: { id?: string } } | null;\n body?: { content?: string };\n};\n\n/** The earliest of these times (none: -Infinity, so no further page). */\nconst oldestAt = (times: Array<string | undefined>) => {\n const ms = times.map((t) => Date.parse(t ?? '')).filter((n) => !Number.isNaN(n));\n return ms.length ? Math.min(...ms) : -Infinity;\n};\n\n/** Teams chats where you wrote that day: who with, how many messages, a few of yours, shortened. */\nexport async function chatsOn(day: string, token: string, fetchImpl: Fetch = fetch): Promise<TimeChatEvidence[]> {\n return chatsOf(await chatsSince(day, token, fetchImpl), day);\n}\n\n/** A day's chats from a read; throws for a day the read may have missed messages of (it keeps what it had). */\nexport function chatsOf(r: ChatsRead, day: string): TimeChatEvidence[] {\n if (r.incompleteThrough && day <= r.incompleteThrough) throw new Error('more Teams messages than were read for that day');\n return r.byDay.get(day) ?? [];\n}\n\n/** A read of the chats: per day, and the last day it may have missed messages of (a chat busier than MAX_PAGES), if any. */\nexport interface ChatsRead {\n byDay: Map<string, TimeChatEvidence[]>;\n /** Days up to this one may lack messages: not to be taken as the day's chats (it keeps what it had). */\n incompleteThrough: string | null;\n}\n\n/**\n * Every day's Teams chats from `firstDay` to now, read once: the chats with\n * a message since, each paged back to that day (newest first). Per day, the\n * chats you wrote in — how many of your messages, a few of them shortened —\n * and the issue keys anyone there named that day (`mentions`: only the keys\n * are taken from others' messages; their text is neither kept nor given to\n * the AI step). A whole catch-up costs one read, not one per day.\n */\nexport async function chatsSince(firstDay: string, token: string, fetchImpl: Fetch = fetch): Promise<ChatsRead> {\n const from = dayBounds(firstDay).from.getTime();\n const me = await getJson<{ id?: string }>(`${GRAPH}/me?$select=id`, token, fetchImpl);\n // Without your id nothing can be told yours (a bot's message has no user either: undefined === undefined).\n if (!me.id) throw new Error('Microsoft Graph: no id for you');\n const active: Chat[] = [];\n let next: string | undefined = `${GRAPH}/me/chats?$top=50&$expand=lastMessagePreview&$orderby=lastMessagePreview/createdDateTime desc`;\n for (let page = 0; next && page < MAX_PAGES; page++) {\n const j: Paged<Chat> = await getJson(next, token, fetchImpl);\n const value = j.value ?? [];\n active.push(...value.filter((c) => Date.parse(c.lastMessagePreview?.createdDateTime ?? '') >= from));\n next = oldestAt(value.map((c) => c.lastMessagePreview?.createdDateTime)) >= from ? j['@odata.nextLink'] : undefined;\n }\n const out = new Map<string, TimeChatEvidence[]>();\n let incompleteThrough: string | null = null;\n for (const c of active) {\n if (!c.id) continue;\n const msgs: Msg[] = [];\n let more: string | undefined = `${GRAPH}/me/chats/${encodeURIComponent(c.id)}/messages?$top=50`;\n for (let page = 0; more && page < MAX_PAGES; page++) {\n const j: Paged<Msg> = await getJson(more, token, fetchImpl);\n const value = j.value ?? [];\n msgs.push(...value);\n // Graph lists them by last change, newest first: an old message edited today sits on the first page, so\n // the stop is by that order's own time — nothing changed before the day's start can be from it.\n more = oldestAt(value.map((m) => m.lastModifiedDateTime ?? m.createdDateTime)) >= from ? j['@odata.nextLink'] : undefined;\n }\n // Stopped at the page limit with more to go: the days back to the oldest message read may be missing some.\n if (more) {\n const reached = localDay(oldestAt(msgs.map((m) => m.lastModifiedDateTime ?? m.createdDateTime)));\n if (!incompleteThrough || reached > incompleteThrough) incompleteThrough = reached;\n }\n const byDay = new Map<string, Msg[]>();\n for (const m of msgs) {\n const at = Date.parse(m.createdDateTime ?? '');\n if (!(at >= from)) continue;\n const d = localDay(at);\n byDay.set(d, [...(byDay.get(d) ?? []), m]);\n }\n for (const [d, dayMsgs] of byDay) {\n const mine = dayMsgs.filter((m) => m.from?.user?.id === me.id);\n if (!mine.length) continue;\n const list = out.get(d) ?? [];\n if (list.length >= 20) continue;\n const mentions = [...new Set(dayMsgs.flatMap((m) => issueKeys(plain(m.body?.content ?? ''))))];\n list.push({\n id: c.id,\n chat: c.topic?.trim() || (c.chatType === 'oneOnOne' ? 'a one-on-one chat' : 'a group chat'),\n messages: mine.length,\n sample: mine.slice(0, 5).map((m) => plain(m.body?.content ?? '').slice(0, 200)),\n ...(mentions.length ? { mentions } : {}),\n });\n out.set(d, list);\n }\n }\n return { byDay: out, incompleteThrough };\n}\n\n/** A message's HTML as plain text. */\nexport function plain(html: string): string {\n return html\n .replace(/<[^>]+>/g, ' ')\n .replace(/ /g, ' ')\n .replace(/</g, '<')\n .replace(/>/g, '>')\n .replace(/"/g, '\"')\n .replace(/'/g, \"'\")\n .replace(/&/g, '&') // last: `&lt;` is the text \"<\", not \"<\"\n .replace(/\\s+/g, ' ')\n .trim();\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAOA,SAAQ;;;ACAf,SAAS,gBAAgB;AAazB,SAAS,UAAU,KAAa,MAAgB,SAAkC;AAChF,SAAO,IAAI,QAAQ,CAAC,SAAS,WAAW;AAKtC,aAAS,KAAK,MAAM,EAAE,UAAU,SAAS,SAAS,aAAa,KAAK,GAAG,CA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UAAI,CAAC,SAAS,MAAM,MAAM,QAAQ,KAAK,IAAI,IAAI,MAAM,KAAK,eAAe;AACvE,cAAM,OAAO,WAAW,KAAK,KAAK;AAClC,gBAAQ,EAAE,MAAM,KAAK,IAAI,KAAK,IAAI,GAAG,KAAK;AAC1C,aAAK,MAAM,MAAO,QAAQ,IAAK;AAAA,MACjC;AAEA,aAAO,QAAQ,MAAM,MAAM,MAAM,GAAG;AAAA,IACtC;AAAA;AAAA,IAEA,YAAY,MAAM;AAChB,UAAI,CAAC,YAAY,KAAK,IAAI,IAAI,SAAS,KAAK,eAAe;AACzD,cAAM,OAAO,qBAAqB,EAAE,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,EAAE,KAAK,EAAE,KAAK,OAAO,EAAE,QAAQ,EAAE,CAAC;AAClG,mBAAW,EAAE,IAAI,KAAK,IAAI,GAAG,KAAK;AAClC,aAAK,MAAM,MAAO,WAAW,IAAK;AAAA,MACpC;AACA,aAAO,SAAS;AAAA,IAClB;AAAA,IACA,UAAU,CAAC,WAAW,YAAY,QAAQ,KAAQ,EAAE,OAAO,KAAK,CAAC;AAAA,IACjE,SAAS,OAAO,QAAQ;AACtB,YAAM,QAAQ,aAAa,EAAE,GAAG;AAChC,UAAI,UAAU,OAAW,QAAO;AAChC,YAAM,KAAK,MAAM,UAAU,GAAG;AAC9B,UAAI,OAAO,KAAM,iBAAgB,KAAK,EAAE;AACxC,aAAO;AAAA,IACT;AAAA,EACF;AACF;","names":["fs","fs"]}
|
|
@@ -4,14 +4,14 @@ import {
|
|
|
4
4
|
} from "./chunk-AH5TM3NB.js";
|
|
5
5
|
import {
|
|
6
6
|
spawnSpecFor
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-UAAH334K.js";
|
|
8
8
|
import {
|
|
9
9
|
PtyHostClient,
|
|
10
10
|
ensureHost
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-ACXPSQJR.js";
|
|
12
12
|
import {
|
|
13
13
|
sessionIdFor
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-RT4QZRTC.js";
|
|
15
15
|
|
|
16
16
|
// src/commands/shared/attach-session.ts
|
|
17
17
|
import chalk from "chalk";
|
|
@@ -117,4 +117,4 @@ async function attachSession(session, launch = {}) {
|
|
|
117
117
|
export {
|
|
118
118
|
attachSession
|
|
119
119
|
};
|
|
120
|
-
//# sourceMappingURL=chunk-
|
|
120
|
+
//# sourceMappingURL=chunk-HBXDIRM4.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
shownState
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-427RB7E4.js";
|
|
5
5
|
import {
|
|
6
6
|
defaultRunner
|
|
7
7
|
} from "./chunk-4KZBZA5D.js";
|
|
@@ -11,13 +11,13 @@ import {
|
|
|
11
11
|
logSwallowed,
|
|
12
12
|
readArchive,
|
|
13
13
|
setSessionBase
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-OQAQMCHF.js";
|
|
15
15
|
import {
|
|
16
16
|
sessionIdFor
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-RT4QZRTC.js";
|
|
18
18
|
import {
|
|
19
19
|
loadConfig
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-QXUHOISF.js";
|
|
21
21
|
|
|
22
22
|
// src/core/stacks/session-update.ts
|
|
23
23
|
import path4 from "path";
|
|
@@ -418,4 +418,4 @@ export {
|
|
|
418
418
|
moveOntoMain,
|
|
419
419
|
updateSession
|
|
420
420
|
};
|
|
421
|
-
//# sourceMappingURL=chunk-
|
|
421
|
+
//# sourceMappingURL=chunk-HDO3PXCU.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
json,
|
|
4
4
|
tx,
|
|
5
5
|
withDb
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-RT4QZRTC.js";
|
|
7
7
|
|
|
8
8
|
// src/core/rail/rail-layout.ts
|
|
9
9
|
var MAX_SECTIONS = 30;
|
|
@@ -144,4 +144,4 @@ export {
|
|
|
144
144
|
changeRailSections,
|
|
145
145
|
placeSession
|
|
146
146
|
};
|
|
147
|
-
//# sourceMappingURL=chunk-
|
|
147
|
+
//# sourceMappingURL=chunk-IKYZ5CJZ.js.map
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
VERSION
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-MMPR5QIV.js";
|
|
5
5
|
import {
|
|
6
6
|
resolveProjectTarget
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-JTHILJFB.js";
|
|
8
8
|
import {
|
|
9
9
|
getCurrentBranch,
|
|
10
10
|
parseWorktreeList
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-RKEY4573.js";
|
|
12
12
|
import {
|
|
13
13
|
loadConfig
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-QXUHOISF.js";
|
|
15
15
|
|
|
16
16
|
// src/cli.ts
|
|
17
17
|
import chalk from "chalk";
|
|
@@ -162,50 +162,51 @@ function completeGroupBranches(groupName, repoAliases, current, config, done) {
|
|
|
162
162
|
|
|
163
163
|
// src/cli.ts
|
|
164
164
|
var COMMANDS = [
|
|
165
|
-
{ names: ["init"], load: async () => (await import("./init-
|
|
166
|
-
{ names: ["config"], load: async () => (await import("./config-
|
|
167
|
-
{ names: ["tree", "t"], load: async () => (await import("./tree-
|
|
168
|
-
{ names: ["remove"], load: async () => (await import("./remove-
|
|
169
|
-
{ names: ["fork"], load: async () => (await import("./fork-
|
|
170
|
-
{ names: ["update"], load: async () => (await import("./update-
|
|
171
|
-
{ names: ["catchup"], load: async () => (await import("./catchup-
|
|
172
|
-
{ names: ["snooze"], load: async () => (await import("./snooze-
|
|
173
|
-
{ names: ["pin"], load: async () => (await import("./pin-
|
|
174
|
-
{ names: ["section"], load: async () => (await import("./section-
|
|
175
|
-
{ names: ["note"], load: async () => (await import("./note-
|
|
176
|
-
{ names: ["block"], load: async () => (await import("./block-
|
|
177
|
-
{ names: ["time"], load: async () => (await import("./time-
|
|
178
|
-
{ names: ["read"], load: async () => (await import("./read-
|
|
179
|
-
{ names: ["screen"], load: async () => (await import("./screen-
|
|
180
|
-
{ names: ["send"], load: async () => (await import("./send-
|
|
181
|
-
{ names: ["wait"], load: async () => (await import("./wait-
|
|
182
|
-
{ names: ["start"], load: async () => (await import("./start-
|
|
183
|
-
{ names: ["stop"], load: async () => (await import("./stop-
|
|
184
|
-
{ names: ["answer"], load: async () => (await import("./answer-
|
|
185
|
-
{ names: ["list"], load: async () => (await import("./list-
|
|
186
|
-
{ names: ["status"], load: async () => (await import("./status-
|
|
187
|
-
{ names: ["recent"], load: async () => (await import("./recent-
|
|
188
|
-
{ names: ["resume"], load: async () => (await import("./resume-
|
|
189
|
-
{ names: ["sessions"], load: async () => (await import("./sessions-
|
|
190
|
-
{ names: ["digest"], load: async () => (await import("./digest-
|
|
191
|
-
{ names: ["cleanup"], load: async () => (await import("./cleanup-
|
|
192
|
-
{ names: ["overlaps"], load: async () => (await import("./overlaps-
|
|
193
|
-
{ names: ["search"], load: async () => (await import("./search-
|
|
194
|
-
{ names: ["pr"], load: async () => (await import("./pr-
|
|
195
|
-
{ names: ["
|
|
196
|
-
{ names: ["
|
|
197
|
-
{ names: ["
|
|
198
|
-
{ names: ["
|
|
199
|
-
{ names: ["
|
|
200
|
-
{ names: ["
|
|
201
|
-
{ names: ["
|
|
202
|
-
{ names: ["
|
|
203
|
-
{ names: ["
|
|
204
|
-
{ names: ["
|
|
205
|
-
{ names: ["
|
|
206
|
-
{ names: ["
|
|
207
|
-
{ names: ["
|
|
208
|
-
{ names: ["
|
|
165
|
+
{ names: ["init"], load: async () => (await import("./init-AT3BQLXM.js")).initCommand },
|
|
166
|
+
{ names: ["config"], load: async () => (await import("./config-SSWYCX4C.js")).configCommand },
|
|
167
|
+
{ names: ["tree", "t"], load: async () => (await import("./tree-7S4DUZRZ.js")).treeCommand },
|
|
168
|
+
{ names: ["remove"], load: async () => (await import("./remove-NVQ2JNMA.js")).removeCommand },
|
|
169
|
+
{ names: ["fork"], load: async () => (await import("./fork-WTNAUILU.js")).forkCommand },
|
|
170
|
+
{ names: ["update"], load: async () => (await import("./update-7ZE4CG7T.js")).updateCommand },
|
|
171
|
+
{ names: ["catchup"], load: async () => (await import("./catchup-TTAC3GMX.js")).catchupCommand },
|
|
172
|
+
{ names: ["snooze"], load: async () => (await import("./snooze-SSSA656T.js")).snoozeCommand },
|
|
173
|
+
{ names: ["pin"], load: async () => (await import("./pin-UOW5VW42.js")).pinCommand },
|
|
174
|
+
{ names: ["section"], load: async () => (await import("./section-BWZW3E2I.js")).sectionCommand },
|
|
175
|
+
{ names: ["note"], load: async () => (await import("./note-2JHWK6CV.js")).noteCommand },
|
|
176
|
+
{ names: ["block"], load: async () => (await import("./block-46DPS75I.js")).blockCommand },
|
|
177
|
+
{ names: ["time"], load: async () => (await import("./time-IIAXBSE7.js")).timeCommand },
|
|
178
|
+
{ names: ["read"], load: async () => (await import("./read-G7CVQRH6.js")).readCommand },
|
|
179
|
+
{ names: ["screen"], load: async () => (await import("./screen-XSBZHJNW.js")).screenCommand },
|
|
180
|
+
{ names: ["send"], load: async () => (await import("./send-4E7CD6PL.js")).sendCommand },
|
|
181
|
+
{ names: ["wait"], load: async () => (await import("./wait-TGQLNTE7.js")).waitCommand },
|
|
182
|
+
{ names: ["start"], load: async () => (await import("./start-5LODG4WG.js")).startCommand },
|
|
183
|
+
{ names: ["stop"], load: async () => (await import("./stop-OFQFHRXD.js")).stopCommand },
|
|
184
|
+
{ names: ["answer"], load: async () => (await import("./answer-6UVHVEGQ.js")).answerCommand },
|
|
185
|
+
{ names: ["list"], load: async () => (await import("./list-YTK2GLND.js")).listCommand },
|
|
186
|
+
{ names: ["status"], load: async () => (await import("./status-U5HKQ7MY.js")).statusCommand },
|
|
187
|
+
{ names: ["recent"], load: async () => (await import("./recent-2LM44HN2.js")).recentCommand },
|
|
188
|
+
{ names: ["resume"], load: async () => (await import("./resume-VA34T7ZR.js")).resumeCommand },
|
|
189
|
+
{ names: ["sessions"], load: async () => (await import("./sessions-4LFKWTBZ.js")).sessionsCommand },
|
|
190
|
+
{ names: ["digest"], load: async () => (await import("./digest-WCZD6N7M.js")).digestCommand },
|
|
191
|
+
{ names: ["cleanup"], load: async () => (await import("./cleanup-OO3DCPGC.js")).cleanupCommand },
|
|
192
|
+
{ names: ["overlaps"], load: async () => (await import("./overlaps-GXSEH2LG.js")).overlapsCommand },
|
|
193
|
+
{ names: ["search"], load: async () => (await import("./search-FJUZPI3P.js")).searchCommand },
|
|
194
|
+
{ names: ["pr"], load: async () => (await import("./pr-74X5MOPX.js")).prCommand },
|
|
195
|
+
{ names: ["timesheet"], load: async () => (await import("./timesheet-SS6AA5BC.js")).timesheetCommand },
|
|
196
|
+
{ names: ["prune"], load: async () => (await import("./prune-L3VXZUIE.js")).pruneCommand },
|
|
197
|
+
{ names: ["sync"], load: async () => (await import("./sync-FDXM5EFD.js")).syncCommand },
|
|
198
|
+
{ names: ["todo"], load: async () => (await import("./todo-2GKRUO4D.js")).todoCommand },
|
|
199
|
+
{ names: ["hydrate"], load: async () => (await import("./hydrate-Q4FWUQRC.js")).hydrateCommand },
|
|
200
|
+
{ names: ["diff"], load: async () => (await import("./diff-76H3Y34M.js")).diffCommand },
|
|
201
|
+
{ names: ["web"], load: async () => (await import("./web-W6BZVICE.js")).webCommand },
|
|
202
|
+
{ names: ["hook"], load: async () => (await import("./hook-GQQZQ6DK.js")).hookCommand },
|
|
203
|
+
{ names: ["run"], load: async () => (await import("./run-E2WZPHHK.js")).runCommand },
|
|
204
|
+
{ names: ["broadcast"], load: async () => (await import("./broadcast-OGOEQX4Z.js")).broadcastCommand },
|
|
205
|
+
{ names: ["attach", "a"], load: async () => (await import("./attach-6Q6HGPCM.js")).attachCommand },
|
|
206
|
+
{ names: ["pty-host"], load: async () => (await import("./pty-host-5Z3GYXTW.js")).ptyHostCommand },
|
|
207
|
+
{ names: ["state"], load: async () => (await import("./state-S776FFV5.js")).stateCommand },
|
|
208
|
+
{ names: ["move"], load: async () => (await import("./move-CE5NIZKL.js")).moveCommand },
|
|
209
|
+
{ names: ["install-skills"], load: async () => (await import("./install-skills-Z76FLXOU.js")).installSkillsCommand },
|
|
209
210
|
{ names: ["completion"], load: async () => (await import("./completion-MXX5TRIV.js")).completionCommand }
|
|
210
211
|
];
|
|
211
212
|
async function commandsFor(argv) {
|
|
@@ -305,4 +306,4 @@ export {
|
|
|
305
306
|
commandsFor,
|
|
306
307
|
run
|
|
307
308
|
};
|
|
308
|
-
//# sourceMappingURL=chunk-
|
|
309
|
+
//# sourceMappingURL=chunk-IVSMEG5M.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/cli.ts","../src/completions/index.ts"],"sourcesContent":["import chalk from 'chalk';\nimport yargs from 'yargs';\nimport type { CommandModule } from 'yargs';\nimport { completionHandler } from './completions/index.js';\nimport { VERSION } from './version.js';\n\n/**\n * Every command, in the order `work --help` lists them, by the words that\n * run it. `work <verb>` imports only that verb's module: loading all of them\n * (node-pty, the servers, SQLite, the prompts) made every command — and\n * Claude's `work sessions --json` — start in ~430 ms. Help, completion and\n * anything unknown load them all. A test keeps the words equal to the\n * commands' own names and aliases.\n */\nexport const COMMANDS: Array<{ names: string[]; load: () => Promise<CommandModule> }> = [\n { names: ['init'], load: async () => (await import('./commands/init.js')).initCommand },\n { names: ['config'], load: async () => (await import('./commands/config.js')).configCommand },\n { names: ['tree', 't'], load: async () => (await import('./commands/tree.js')).treeCommand },\n { names: ['remove'], load: async () => (await import('./commands/remove.js')).removeCommand },\n { names: ['fork'], load: async () => (await import('./commands/fork.js')).forkCommand },\n { names: ['update'], load: async () => (await import('./commands/update.js')).updateCommand },\n { names: ['catchup'], load: async () => (await import('./commands/catchup.js')).catchupCommand },\n { names: ['snooze'], load: async () => (await import('./commands/snooze.js')).snoozeCommand },\n { names: ['pin'], load: async () => (await import('./commands/pin.js')).pinCommand },\n { names: ['section'], load: async () => (await import('./commands/section.js')).sectionCommand },\n { names: ['note'], load: async () => (await import('./commands/note.js')).noteCommand },\n { names: ['block'], load: async () => (await import('./commands/block.js')).blockCommand },\n { names: ['time'], load: async () => (await import('./commands/time.js')).timeCommand },\n { names: ['read'], load: async () => (await import('./commands/read.js')).readCommand },\n { names: ['screen'], load: async () => (await import('./commands/screen.js')).screenCommand },\n { names: ['send'], load: async () => (await import('./commands/send.js')).sendCommand },\n { names: ['wait'], load: async () => (await import('./commands/wait.js')).waitCommand },\n { names: ['start'], load: async () => (await import('./commands/start.js')).startCommand },\n { names: ['stop'], load: async () => (await import('./commands/stop.js')).stopCommand },\n { names: ['answer'], load: async () => (await import('./commands/answer.js')).answerCommand },\n { names: ['list'], load: async () => (await import('./commands/list.js')).listCommand },\n { names: ['status'], load: async () => (await import('./commands/status.js')).statusCommand },\n { names: ['recent'], load: async () => (await import('./commands/recent.js')).recentCommand },\n { names: ['resume'], load: async () => (await import('./commands/resume.js')).resumeCommand },\n { names: ['sessions'], load: async () => (await import('./commands/sessions.js')).sessionsCommand },\n { names: ['digest'], load: async () => (await import('./commands/digest.js')).digestCommand },\n { names: ['cleanup'], load: async () => (await import('./commands/cleanup.js')).cleanupCommand },\n { names: ['overlaps'], load: async () => (await import('./commands/overlaps.js')).overlapsCommand },\n { names: ['search'], load: async () => (await import('./commands/search.js')).searchCommand },\n { names: ['pr'], load: async () => (await import('./commands/pr.js')).prCommand },\n { names: ['timesheet'], load: async () => (await import('./commands/timesheet.js')).timesheetCommand },\n { names: ['prune'], load: async () => (await import('./commands/prune.js')).pruneCommand },\n { names: ['sync'], load: async () => (await import('./commands/sync.js')).syncCommand },\n { names: ['todo'], load: async () => (await import('./commands/todo.js')).todoCommand },\n { names: ['hydrate'], load: async () => (await import('./commands/hydrate.js')).hydrateCommand },\n { names: ['diff'], load: async () => (await import('./commands/diff.js')).diffCommand },\n { names: ['web'], load: async () => (await import('./commands/web.js')).webCommand },\n { names: ['hook'], load: async () => (await import('./commands/hook.js')).hookCommand },\n { names: ['run'], load: async () => (await import('./commands/run.js')).runCommand },\n { names: ['broadcast'], load: async () => (await import('./commands/broadcast.js')).broadcastCommand },\n { names: ['attach', 'a'], load: async () => (await import('./commands/attach.js')).attachCommand },\n { names: ['pty-host'], load: async () => (await import('./commands/pty-host.js')).ptyHostCommand },\n { names: ['state'], load: async () => (await import('./commands/state.js')).stateCommand },\n { names: ['move'], load: async () => (await import('./commands/move.js')).moveCommand },\n { names: ['install-skills'], load: async () => (await import('./commands/install-skills.js')).installSkillsCommand },\n { names: ['completion'], load: async () => (await import('./commands/completion.js')).completionCommand },\n];\n\n/** The commands to register for these arguments: the one named, else all. */\nexport async function commandsFor(argv: string[]): Promise<CommandModule[]> {\n const one = COMMANDS.find((c) => c.names.includes(argv[0] ?? ''));\n return Promise.all((one ? [one] : COMMANDS).map((c) => c.load()));\n}\n\nfunction showHelp() {\n console.log('');\n console.log(chalk.cyan(`Work - Git Worktree Manager ${chalk.gray(`v${VERSION}`)}`));\n console.log(chalk.cyan('============================'));\n console.log('');\n console.log(chalk.green('Usage:'));\n console.log(' work init - Set up configuration');\n console.log(' work config <action> - Manage configuration');\n console.log(' work list [project|group] - List all worktrees');\n console.log(' work tree|t <project|group> <branch> - Create/switch to worktree');\n console.log(' work tree <project|group> <branch> --base <branch> - Create from a specific base branch');\n console.log(' work tree <project|group> <branch> --open - Also open VS Code');\n console.log(' work tree <project|group> <branch> --unsafe - Skip AI tool permission checks');\n console.log(' work remove <project|group> <branch> - Remove worktree');\n console.log(' work remove <project|group> <branch> --force - Force remove worktree');\n console.log(' work status [project|group] [branch] - Show worktree status');\n console.log(' work status --prune - Remove stale entries');\n console.log(' work recent [count] - List recent sessions');\n console.log(' work resume - Resume a recent session');\n console.log(' work sessions [project] [--json] [--changes] - Every session with its status, as the dashboard shows it');\n console.log(' work digest [--since today|yesterday|week] - What each session did (Markdown for a standup; --json)');\n console.log(' work overlaps [--json] - Live sessions changing the same files');\n console.log(' work cleanup [--json] - Which worktrees can go, and why');\n console.log(' work cleanup --apply <id...> [--action …] - Remove / archive / forget them, after a fresh check');\n console.log(' work web - Browser dashboard (one tab, every session)');\n console.log(' work prune - Remove merged worktrees');\n console.log(' work prune --force - Remove all merged (no prompt)');\n console.log(' work sync - Fetch all repos and prune merged (non-interactive)');\n console.log(' work sync --dry-run - Show what sync would prune, remove nothing');\n console.log(' work sync --force - Also remove merged worktrees with uncommitted changes');\n console.log(' work sync --include-squash - Also prune squash-merged branches (lower confidence)');\n console.log(' work hydrate - Seed history from worktrees on disk');\n console.log(' work diff [base] - Open a GitHub-PR-style diff in your browser');\n console.log(' work run <cmd...> - Run a command in every worktree');\n console.log(' work run <cmd...> --target <alias> --parallel - Filter + run concurrently');\n console.log(' work broadcast <prompt> - Queue a prompt to every live session');\n console.log(' work attach [target] [branch] - Attach this terminal to a session (Ctrl+] detaches)');\n console.log(' work todo - List tasks');\n console.log(' work todo add <text> - Add a task');\n console.log(' work todo done <id> - Mark task complete');\n console.log(' work todo rm <id> - Remove a task');\n console.log(' work completion --install - Install shell completions');\n console.log('');\n console.log(chalk.green('Config Actions:'));\n console.log(' work config add <alias> <path> - Add a repository');\n console.log(' work config remove <alias> - Remove a repository');\n console.log(' work config list - List repos and groups');\n console.log(' work config group add <name> <alias1> <alias2> ... - Create a repository group');\n console.log(' work config group remove <name> - Remove a repository group');\n console.log(' work config group regen <name> - Regenerate group CLAUDE.md');\n console.log('');\n console.log(chalk.green('Examples:'));\n console.log(' work init');\n console.log(' work list');\n console.log(' work list ai');\n console.log(' work tree ai feature/login');\n console.log(' work tree frontend feature/login --open');\n console.log(' work tree ai feature/hotfix --unsafe');\n console.log(' work remove ai feature/login');\n console.log('');\n console.log(chalk.gray(' # Groups (multi-repo worktrees):'));\n console.log(' work config group add fullstack api frontend');\n console.log(' work tree fullstack feature/login');\n console.log(' work remove fullstack feature/login');\n console.log('');\n}\n\nexport async function run(argv: string[]): Promise<void> {\n // Show custom colored help when no args given\n if (argv.length === 0) {\n showHelp();\n return;\n }\n\n let cli = yargs(argv).scriptName('work').usage('$0 <command> [options]');\n for (const c of await commandsFor(argv)) cli = cli.command(c);\n cli = cli\n // Hidden: yargs uses this internally for --get-yargs-completions\n .completion('__completions', false, completionHandler)\n .demandCommand(1, 'You need to specify a command. Run work --help for usage.')\n .strict()\n .fail((msg, err, yargs) => {\n if (err?.name === 'ExitPromptError') {\n console.log('\\nCancelled.');\n process.exit(0);\n }\n if (msg) {\n yargs.showHelp();\n console.error('\\n' + msg);\n }\n if (err) console.error(err);\n process.exit(1);\n })\n .help()\n .alias('h', 'help')\n .version(VERSION)\n .alias('v', 'version')\n .wrap(Math.min(100, process.stdout.columns || 80));\n\n // Async handlers' failures land in .fail() above (and the fatal handlers in bin.ts).\n void cli.parse();\n}\n","import fs from 'node:fs';\nimport path from 'node:path';\nimport { loadConfig } from '../core/platform/config.js';\nimport { parseWorktreeList, getCurrentBranch } from '../core/git/git.js';\nimport { resolveProjectTarget } from '../core/worktree/resolve.js';\n\ntype Done = (completions: string[]) => void;\n\n/**\n * Dynamic completion handler for yargs.\n * Called when the user presses TAB (via --get-yargs-completions).\n *\n * argv._ = ['<scriptName>', '<command>', '<arg1>', ...., '<current>']\n * We skip the script name and the trailing current word to get the \"completed\" args.\n */\nexport function completionHandler(current: string, argv: Record<string, unknown>, done: Done): void {\n const rawArgs = argv._ as string[];\n\n // Skip the script name (first element) and the trailing current word (last element)\n const args = rawArgs.slice(1, -1);\n const command = args[0] as string | undefined;\n\n const config = loadConfig();\n if (!config) {\n done([]);\n return;\n }\n\n if (!command) {\n done(\n [\n 'tree',\n 't',\n 'remove',\n 'list',\n 'status',\n 'recent',\n 'resume',\n 'prune',\n 'todo',\n 'attach',\n 'hydrate',\n 'diff',\n 'web',\n 'init',\n 'config',\n 'completion',\n ].filter((c) => c.startsWith(current)),\n );\n return;\n }\n\n switch (command) {\n case 'config':\n completeConfig(args, current, config, done);\n return;\n\n case 'tree':\n case 't':\n case 'remove':\n case 'list':\n case 'status':\n completeTreeRemoveList(command, args, current, config, done);\n return;\n\n default:\n done([]);\n }\n}\n\nfunction completeConfig(args: string[], current: string, config: NonNullable<ReturnType<typeof loadConfig>>, done: Done): void {\n const subAction = args[1] as string | undefined;\n\n if (!subAction) {\n const actions = ['add', 'remove', 'list', 'group', 'show', 'edit'];\n done(actions.filter((a) => a.startsWith(current)));\n return;\n }\n\n if (subAction === 'remove' && args.length === 2) {\n const aliases = Object.keys(config.repos);\n done(aliases.filter((a) => a.startsWith(current)));\n return;\n }\n\n if (subAction === 'group') {\n const groupSub = args[2] as string | undefined;\n\n if (!groupSub) {\n const subs = ['add', 'remove', 'regen'];\n done(subs.filter((s) => s.startsWith(current)));\n return;\n }\n\n if ((groupSub === 'remove' || groupSub === 'regen') && args.length === 3) {\n const groups = Object.keys(config.groups);\n done(groups.filter((g) => g.startsWith(current)));\n return;\n }\n\n if (groupSub === 'add' && args.length >= 4) {\n const alreadyUsed = args.slice(3);\n const aliases = Object.keys(config.repos).filter((a) => !alreadyUsed.includes(a));\n done(aliases.filter((a) => a.startsWith(current)));\n return;\n }\n\n done([]);\n return;\n }\n\n done([]);\n}\n\nfunction completeTreeRemoveList(\n command: string,\n args: string[],\n current: string,\n config: NonNullable<ReturnType<typeof loadConfig>>,\n done: Done,\n): void {\n const targetName = args[1] as string | undefined;\n\n if (!targetName) {\n const names = [...Object.keys(config.repos), ...Object.keys(config.groups)];\n done(names.filter((n) => n.startsWith(current)));\n return;\n }\n\n if (args.length === 2) {\n const target = resolveProjectTarget(targetName, config);\n if (!target) {\n done([]);\n return;\n }\n\n if (target.isGroup) {\n completeGroupBranches(target.name, target.repoAliases, current, config, done);\n } else {\n completeRepoBranches(targetName, current, config, done);\n }\n return;\n }\n\n done([]);\n}\n\nfunction completeRepoBranches(alias: string, current: string, config: NonNullable<ReturnType<typeof loadConfig>>, done: Done): void {\n const repoPath = config.repos[alias];\n if (!repoPath || !fs.existsSync(repoPath)) {\n done([]);\n return;\n }\n\n const worktrees = parseWorktreeList(repoPath);\n const branches = worktrees.map((wt) => wt.branch).filter((b): b is string => !!b && b.startsWith(current));\n done(branches);\n}\n\nfunction completeGroupBranches(\n groupName: string,\n repoAliases: string[],\n current: string,\n config: NonNullable<ReturnType<typeof loadConfig>>,\n done: Done,\n): void {\n const groupDir = path.join(config.worktreesRoot, groupName);\n if (!fs.existsSync(groupDir)) {\n done([]);\n return;\n }\n\n try {\n const branchDirs = fs\n .readdirSync(groupDir, { withFileTypes: true })\n .filter((d) => d.isDirectory())\n .map((d) => {\n const bdPath = path.join(groupDir, d.name);\n for (const alias of repoAliases) {\n const repoPath = config.repos[alias];\n if (!repoPath) continue;\n const subPath = path.join(bdPath, path.basename(repoPath));\n if (fs.existsSync(subPath)) {\n const branch = getCurrentBranch(subPath);\n if (branch) return branch;\n }\n }\n return d.name;\n });\n\n done(branchDirs.filter((b) => b.startsWith(current)));\n } catch {\n done([]);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA,OAAO,WAAW;AAClB,OAAO,WAAW;;;ACDlB,OAAO,QAAQ;AACf,OAAO,UAAU;AAcV,SAAS,kBAAkB,SAAiB,MAA+B,MAAkB;AAClG,QAAM,UAAU,KAAK;AAGrB,QAAM,OAAO,QAAQ,MAAM,GAAG,EAAE;AAChC,QAAM,UAAU,KAAK,CAAC;AAEtB,QAAM,SAAS,WAAW;AAC1B,MAAI,CAAC,QAAQ;AACX,SAAK,CAAC,CAAC;AACP;AAAA,EACF;AAEA,MAAI,CAAC,SAAS;AACZ;AAAA,MACE;AAAA,QACE;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,Q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WAAU;AACzB,QAAI,KAAK,SAAS,mBAAmB;AACnC,cAAQ,IAAI,cAAc;AAC1B,cAAQ,KAAK,CAAC;AAAA,IAChB;AACA,QAAI,KAAK;AACP,MAAAA,OAAM,SAAS;AACf,cAAQ,MAAM,OAAO,GAAG;AAAA,IAC1B;AACA,QAAI,IAAK,SAAQ,MAAM,GAAG;AAC1B,YAAQ,KAAK,CAAC;AAAA,EAChB,CAAC,EACA,KAAK,EACL,MAAM,KAAK,MAAM,EACjB,QAAQ,OAAO,EACf,MAAM,KAAK,SAAS,EACpB,KAAK,KAAK,IAAI,KAAK,QAAQ,OAAO,WAAW,EAAE,CAAC;AAGnD,OAAK,IAAI,MAAM;AACjB;","names":["yargs"]}
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
json,
|
|
4
4
|
tx,
|
|
5
5
|
withDb
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-RT4QZRTC.js";
|
|
7
7
|
|
|
8
8
|
// src/core/rail/session-notes.ts
|
|
9
9
|
var MAX_NOTE_CHARS = 2e4;
|
|
@@ -51,4 +51,4 @@ export {
|
|
|
51
51
|
saveNote,
|
|
52
52
|
appendNote
|
|
53
53
|
};
|
|
54
|
-
//# sourceMappingURL=chunk-
|
|
54
|
+
//# sourceMappingURL=chunk-JQXUIKU5.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
getCurrentBranch,
|
|
4
4
|
getMainRepoRoot,
|
|
5
5
|
getWorktreeRoot
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-RKEY4573.js";
|
|
7
7
|
|
|
8
8
|
// src/core/worktree/resolve.ts
|
|
9
9
|
import fs from "fs";
|
|
@@ -114,4 +114,4 @@ export {
|
|
|
114
114
|
getAllTargetNames,
|
|
115
115
|
resolveFromCwd
|
|
116
116
|
};
|
|
117
|
-
//# sourceMappingURL=chunk-
|
|
117
|
+
//# sourceMappingURL=chunk-JTHILJFB.js.map
|
|
@@ -1,19 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
|
-
mergeSteps,
|
|
4
|
-
workSteps,
|
|
5
|
-
workedBetween,
|
|
6
|
-
workedByDay,
|
|
7
3
|
worklogTime
|
|
8
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-NEJVK5CF.js";
|
|
9
5
|
import {
|
|
10
6
|
json,
|
|
11
7
|
tx,
|
|
12
8
|
withDb
|
|
13
|
-
} from "./chunk-
|
|
14
|
-
import {
|
|
15
|
-
agentOf
|
|
16
|
-
} from "./chunk-TOQZODGI.js";
|
|
9
|
+
} from "./chunk-RT4QZRTC.js";
|
|
17
10
|
|
|
18
11
|
// src/core/jira/jira-worklog.ts
|
|
19
12
|
function worklogSettings(config, env = process.env) {
|
|
@@ -120,102 +113,10 @@ function jiraWorklogPoster(s, fetchImpl = fetch) {
|
|
|
120
113
|
};
|
|
121
114
|
}
|
|
122
115
|
|
|
123
|
-
// src/core/conversations/work-time-source.ts
|
|
124
|
-
import fs from "fs";
|
|
125
|
-
var CHUNK = 1 << 20;
|
|
126
|
-
var DAYS_SHOWN = 14;
|
|
127
|
-
var MAX_FILES = 400;
|
|
128
|
-
var HEAD_BYTES = 256;
|
|
129
|
-
var files = /* @__PURE__ */ new Map();
|
|
130
|
-
async function readHead(fh, size) {
|
|
131
|
-
const buf = Buffer.alloc(Math.min(HEAD_BYTES, size));
|
|
132
|
-
const { bytesRead } = await fh.read(buf, 0, buf.length, 0);
|
|
133
|
-
return buf.subarray(0, bytesRead).toString("base64");
|
|
134
|
-
}
|
|
135
|
-
async function readOn(file, size, mtimeMs, st, toEntries) {
|
|
136
|
-
const fh = await fs.promises.open(file, "r");
|
|
137
|
-
try {
|
|
138
|
-
const head = await readHead(fh, size);
|
|
139
|
-
const appended = !!st && size >= st.offset && !(size === st.offset && mtimeMs !== st.mtimeMs) && head.startsWith(st.head.slice(0, head.length)) && st.head.startsWith(head.slice(0, st.head.length));
|
|
140
|
-
const state = appended ? { ...st, steps: [...st.steps], mtimeMs, head } : { offset: 0, mtimeMs, lastMs: null, steps: [], prompts: 0, firstMs: null, head };
|
|
141
|
-
let carry = Buffer.alloc(0);
|
|
142
|
-
while (state.offset + carry.length < size) {
|
|
143
|
-
const at = state.offset + carry.length;
|
|
144
|
-
const buf = Buffer.alloc(Math.min(CHUNK, size - at));
|
|
145
|
-
const { bytesRead } = await fh.read(buf, 0, buf.length, at);
|
|
146
|
-
if (bytesRead === 0) break;
|
|
147
|
-
const data = Buffer.concat([carry, buf.subarray(0, bytesRead)]);
|
|
148
|
-
const cut = data.lastIndexOf(10);
|
|
149
|
-
if (cut === -1) {
|
|
150
|
-
carry = data;
|
|
151
|
-
continue;
|
|
152
|
-
}
|
|
153
|
-
const whole = data.subarray(0, cut).toString("utf8");
|
|
154
|
-
carry = data.subarray(cut + 1);
|
|
155
|
-
state.offset += cut + 1;
|
|
156
|
-
const lines = [];
|
|
157
|
-
for (const line of whole.split("\n")) {
|
|
158
|
-
if (!line.trim()) continue;
|
|
159
|
-
try {
|
|
160
|
-
lines.push(JSON.parse(line));
|
|
161
|
-
} catch {
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
const entries = toEntries(lines);
|
|
165
|
-
const r = workSteps(entries, state.lastMs);
|
|
166
|
-
state.steps.push(...r.steps);
|
|
167
|
-
state.lastMs = r.lastMs;
|
|
168
|
-
if (state.firstMs === null) {
|
|
169
|
-
const first = entries.find((e) => Number.isFinite(Date.parse(e.at)));
|
|
170
|
-
if (first) state.firstMs = Date.parse(first.at);
|
|
171
|
-
}
|
|
172
|
-
state.prompts += entries.filter((e) => e.role === "you" && !e.sidechain).length;
|
|
173
|
-
await new Promise((r2) => setImmediate(r2));
|
|
174
|
-
}
|
|
175
|
-
return state;
|
|
176
|
-
} finally {
|
|
177
|
-
await fh.close();
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
async function sessionWorkTime(s, now = Date.now()) {
|
|
181
|
-
const steps = [];
|
|
182
|
-
let prompts = 0;
|
|
183
|
-
let firstMs = null;
|
|
184
|
-
let lastMs = null;
|
|
185
|
-
const conv = agentOf(s).conversation;
|
|
186
|
-
for (const t of conv?.files(s) ?? []) {
|
|
187
|
-
let st = files.get(t.file);
|
|
188
|
-
if (!st || st.offset !== t.size || st.mtimeMs !== t.mtimeMs) {
|
|
189
|
-
try {
|
|
190
|
-
st = await readOn(t.file, t.size, t.mtimeMs, st, conv.entries);
|
|
191
|
-
} catch {
|
|
192
|
-
continue;
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
files.delete(t.file);
|
|
196
|
-
files.set(t.file, st);
|
|
197
|
-
while (files.size > MAX_FILES) files.delete(files.keys().next().value);
|
|
198
|
-
steps.push(...st.steps);
|
|
199
|
-
prompts += st.prompts;
|
|
200
|
-
if (st.firstMs !== null) firstMs = firstMs === null ? st.firstMs : Math.min(firstMs, st.firstMs);
|
|
201
|
-
if (st.lastMs !== null) lastMs = lastMs === null ? st.lastMs : Math.max(lastMs, st.lastMs);
|
|
202
|
-
}
|
|
203
|
-
const since = now - DAYS_SHOWN * 24 * 36e5;
|
|
204
|
-
const merged = mergeSteps(steps);
|
|
205
|
-
return {
|
|
206
|
-
workedMs: workedBetween(merged),
|
|
207
|
-
prompts,
|
|
208
|
-
byDay: workedByDay(merged, since),
|
|
209
|
-
firstAt: firstMs === null ? null : new Date(firstMs).toISOString(),
|
|
210
|
-
lastAt: lastMs === null ? null : new Date(lastMs).toISOString()
|
|
211
|
-
};
|
|
212
|
-
}
|
|
213
|
-
|
|
214
116
|
export {
|
|
215
117
|
worklogSettings,
|
|
216
118
|
loggedDays,
|
|
217
119
|
logWorkDay,
|
|
218
|
-
jiraWorklogPoster
|
|
219
|
-
sessionWorkTime
|
|
120
|
+
jiraWorklogPoster
|
|
220
121
|
};
|
|
221
|
-
//# sourceMappingURL=chunk-
|
|
122
|
+
//# sourceMappingURL=chunk-LPJEV4R2.js.map
|