@moberg_hr/work-tree 2.0.1 → 2.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/dist/{answer-2J4XLIP7.js → answer-ZYRJTGPR.js} +8 -8
- package/dist/{attach-CZKRNPAJ.js → attach-PEOW6HHM.js} +11 -11
- package/dist/bin.js +2 -2
- package/dist/{block-RAIDCJ4F.js → block-EA7LCWBG.js} +8 -8
- package/dist/{broadcast-BSI5NDDB.js → broadcast-VE7WYHDK.js} +5 -5
- package/dist/{catchup-VVOPL2S5.js → catchup-DF7YZFOJ.js} +10 -10
- package/dist/{chunk-HIZBWYPL.js → chunk-2P26VJY3.js} +12 -12
- package/dist/{chunk-ZXPYWZL5.js → chunk-46UD4QBL.js} +10 -6
- package/dist/chunk-46UD4QBL.js.map +1 -0
- package/dist/{chunk-C2BK6EBN.js → chunk-4SK76CPY.js} +4 -4
- package/dist/{chunk-77XFJQGC.js → chunk-4WEYZ3YG.js} +5 -5
- package/dist/{chunk-CVAVYDXO.js → chunk-52ST6RVB.js} +8 -8
- package/dist/{chunk-3JWTO5VZ.js → chunk-5OUTCUYQ.js} +46 -26
- package/dist/chunk-5OUTCUYQ.js.map +1 -0
- package/dist/{chunk-FPKERDK7.js → chunk-6GCF2XWP.js} +2 -2
- package/dist/{chunk-HWUINPIL.js → chunk-AUGWUZR2.js} +6 -6
- package/dist/{chunk-6H3MLDGG.js → chunk-BFLJ6PGX.js} +4 -4
- package/dist/{chunk-R2LN3JJJ.js → chunk-BSCAA322.js} +2 -2
- package/dist/{chunk-WF5SBVPZ.js → chunk-C763EC47.js} +24 -6
- package/dist/chunk-C763EC47.js.map +1 -0
- package/dist/{chunk-QBAZG4CY.js → chunk-DJBOQU56.js} +2 -2
- package/dist/{chunk-JYTMT5DF.js → chunk-DKKXDLMQ.js} +5 -5
- package/dist/{chunk-IXKVCR4Y.js → chunk-E4GZGQWP.js} +3 -3
- package/dist/{chunk-7OLPI334.js → chunk-EF5GZEXK.js} +2 -2
- package/dist/{chunk-YZWADOEW.js → chunk-EY3ZPJT3.js} +3 -3
- package/dist/{chunk-CLGVSX36.js → chunk-EYZG4MR6.js} +4 -4
- package/dist/{chunk-NDWSLQPB.js → chunk-FOG4WG3Y.js} +2 -2
- package/dist/{chunk-YZDD5YGE.js → chunk-G2O7EIKX.js} +2 -2
- package/dist/{chunk-BR6OPEE4.js → chunk-IAOFCBAO.js} +7 -7
- package/dist/{chunk-Q6WZCO45.js → chunk-IISQUS7L.js} +2 -2
- package/dist/{chunk-5QK7GB5K.js → chunk-JJRPLNLN.js} +2 -2
- package/dist/{chunk-FR3EWVXI.js → chunk-KNKXGEPJ.js} +4 -4
- package/dist/{chunk-4BOK2GXL.js → chunk-KPVCQBHZ.js} +3 -3
- package/dist/{chunk-P3BL4EOP.js → chunk-LC2UWKAQ.js} +2 -2
- package/dist/{chunk-O3QTWVSK.js → chunk-LQCYTZ2F.js} +14 -8
- package/dist/chunk-LQCYTZ2F.js.map +1 -0
- package/dist/chunk-LYNBLVEM.js +9 -0
- package/dist/{chunk-C2THFSXA.js → chunk-NDEELC3K.js} +4 -4
- package/dist/{chunk-JNBYNRFS.js → chunk-NEZNZM7K.js} +2 -2
- package/dist/{chunk-UFY7C5PP.js → chunk-NS3HSXF7.js} +2 -2
- package/dist/{chunk-SNAQOHNL.js → chunk-PA2744MS.js} +11 -9
- package/dist/chunk-PA2744MS.js.map +1 -0
- package/dist/{chunk-PN44M5EE.js → chunk-PMA7QPUV.js} +8 -2
- package/dist/chunk-PMA7QPUV.js.map +1 -0
- package/dist/{chunk-SOCPIHCS.js → chunk-REKP6EIC.js} +2 -2
- package/dist/{chunk-TUC4QY4O.js → chunk-RM6XOZMU.js} +2 -2
- package/dist/{chunk-M4FVCAT6.js → chunk-SBL4VVXD.js} +36 -3
- package/dist/{chunk-M4FVCAT6.js.map → chunk-SBL4VVXD.js.map} +1 -1
- package/dist/{chunk-XJDEROHY.js → chunk-T2KX2B6I.js} +2 -2
- package/dist/{chunk-C7W5TMFB.js → chunk-TMUMQRNM.js} +45 -45
- package/dist/{chunk-KGZ6OZ2T.js → chunk-VSX6ICYG.js} +5 -5
- package/dist/{chunk-YNKWLC45.js → chunk-WDVIPH6X.js} +3 -3
- package/dist/{chunk-7NCW3LUT.js → chunk-WF57CF7A.js} +14 -1
- package/dist/chunk-WF57CF7A.js.map +1 -0
- package/dist/{chunk-ZJN5RWZD.js → chunk-XOHJUVU6.js} +3 -3
- package/dist/{chunk-6FTIY5M6.js → chunk-XWJ6BB63.js} +4 -4
- package/dist/{chunk-YKODIG22.js → chunk-YMNFSV5C.js} +4 -4
- package/dist/{chunk-HSICXDMZ.js → chunk-YNB3M2SM.js} +3 -3
- package/dist/{cleanup-LDBGWEKZ.js → cleanup-2FPGGFMO.js} +20 -20
- package/dist/{cli-UATB4RM2.js → cli-PI7WSA4S.js} +3 -3
- package/dist/{config-IEIU7A66.js → config-HZOLEXYK.js} +9 -9
- package/dist/{diff-K47HB6SA.js → diff-3YNZDI65.js} +8 -8
- package/dist/{digest-FBZTBXQO.js → digest-CZG3FZE7.js} +7 -7
- package/dist/{fork-BKI5UNNS.js → fork-QPD5JTUH.js} +18 -18
- package/dist/{hook-SLMZT5OV.js → hook-6GDHRNT6.js} +15 -9
- package/dist/hook-6GDHRNT6.js.map +1 -0
- package/dist/{hydrate-Y2AAMZTA.js → hydrate-YGDWGBXX.js} +4 -4
- package/dist/{init-7ESFTYZC.js → init-MBNE57LN.js} +8 -8
- package/dist/{install-skills-O34BHFHD.js → install-skills-5XINJXYY.js} +3 -3
- package/dist/install-skills-bin.js +2 -2
- package/dist/{move-FKT2P5LY.js → move-HUC4Y4FX.js} +11 -11
- package/dist/{note-WGM6LCP2.js → note-2YE44FRK.js} +8 -8
- package/dist/{overlaps-FRLMMIGC.js → overlaps-75LVGJWA.js} +7 -7
- package/dist/{pin-MQ5ZE37R.js → pin-FWJVLOSH.js} +8 -8
- package/dist/{pr-527S5HXB.js → pr-2XIZWDS2.js} +9 -9
- package/dist/{prune-AIS5YEXP.js → prune-7MSLBWVA.js} +19 -19
- package/dist/{pty-host-RWIS55N4.js → pty-host-HQPWKXVI.js} +65 -16
- package/dist/pty-host-HQPWKXVI.js.map +1 -0
- package/dist/{read-AP6T3ZGN.js → read-PYIADA63.js} +7 -7
- package/dist/{recent-IE3LYQ65.js → recent-JKFUXEKV.js} +5 -5
- package/dist/{remove-YGUTSKZP.js → remove-MGXS7QZ6.js} +18 -18
- package/dist/{resume-UUP6R2IE.js → resume-DMGXYTGC.js} +5 -5
- package/dist/{run-V4755W7C.js → run-3KH6GAOL.js} +4 -4
- package/dist/{screen-DNX4K23V.js → screen-3UMWSHAY.js} +8 -8
- package/dist/{search-3JZXLCR2.js → search-OOJIPNZT.js} +4 -4
- package/dist/{section-TXLC5XO3.js → section-ZHCDMSCB.js} +8 -8
- package/dist/{send-6X46WZLC.js → send-DXNOANZQ.js} +9 -9
- package/dist/{sessions-T3QDTNP7.js → sessions-CLE6ZC23.js} +15 -15
- package/dist/{snooze-KYSFXLPY.js → snooze-OHZFIQEG.js} +7 -7
- package/dist/{start-SQSDQK4F.js → start-LDLKCTBE.js} +8 -8
- package/dist/{state-4DFV6SHG.js → state-FGYNNSDP.js} +2 -2
- package/dist/{status-H5OW4LYE.js → status-MIERES2A.js} +4 -4
- package/dist/{stop-HC7XPSSP.js → stop-BJ2OO6QL.js} +8 -8
- package/dist/{sync-ITK5UYGM.js → sync-HZ6I2EU7.js} +19 -19
- package/dist/{time-GN6B4QD6.js → time-TWCZGQ2W.js} +8 -8
- package/dist/{todo-LWMQY6XW.js → todo-Y2BZ65MS.js} +3 -3
- package/dist/{tree-7BMORJ6J.js → tree-ML343C6O.js} +11 -11
- package/dist/{update-6LQNLRA4.js → update-RNIAUEA6.js} +10 -10
- package/dist/{wait-MZOZQ3CI.js → wait-2M76BDB5.js} +8 -8
- package/dist/wd-bin.js +2 -2
- package/dist/web/assets/{PtyView-DYvawzWb.js → PtyView-C1eEBxiL.js} +2 -2
- package/dist/web/assets/{PtyView-DYvawzWb.js.map → PtyView-C1eEBxiL.js.map} +1 -1
- package/dist/web/assets/index-3TfcsOhs.css +1 -0
- package/dist/web/assets/index-CjoTiPVM.js +117 -0
- package/dist/web/assets/index-CjoTiPVM.js.map +1 -0
- package/dist/web/index.html +2 -2
- package/dist/{web-IC3P7EHZ.js → web-W33235GF.js} +421 -120
- package/dist/web-W33235GF.js.map +1 -0
- package/npm-shrinkwrap.json +2 -2
- package/package.json +3 -1
- package/dist/chunk-3JWTO5VZ.js.map +0 -1
- package/dist/chunk-7NCW3LUT.js.map +0 -1
- package/dist/chunk-LMIEEDDC.js +0 -9
- package/dist/chunk-O3QTWVSK.js.map +0 -1
- package/dist/chunk-PN44M5EE.js.map +0 -1
- package/dist/chunk-SNAQOHNL.js.map +0 -1
- package/dist/chunk-WF5SBVPZ.js.map +0 -1
- package/dist/chunk-ZXPYWZL5.js.map +0 -1
- package/dist/hook-SLMZT5OV.js.map +0 -1
- package/dist/pty-host-RWIS55N4.js.map +0 -1
- package/dist/web/assets/index-C5lJhIwK.js +0 -116
- package/dist/web/assets/index-C5lJhIwK.js.map +0 -1
- package/dist/web/assets/index-L8mjakHP.css +0 -1
- package/dist/web-IC3P7EHZ.js.map +0 -1
- /package/dist/{answer-2J4XLIP7.js.map → answer-ZYRJTGPR.js.map} +0 -0
- /package/dist/{attach-CZKRNPAJ.js.map → attach-PEOW6HHM.js.map} +0 -0
- /package/dist/{block-RAIDCJ4F.js.map → block-EA7LCWBG.js.map} +0 -0
- /package/dist/{broadcast-BSI5NDDB.js.map → broadcast-VE7WYHDK.js.map} +0 -0
- /package/dist/{catchup-VVOPL2S5.js.map → catchup-DF7YZFOJ.js.map} +0 -0
- /package/dist/{chunk-HIZBWYPL.js.map → chunk-2P26VJY3.js.map} +0 -0
- /package/dist/{chunk-C2BK6EBN.js.map → chunk-4SK76CPY.js.map} +0 -0
- /package/dist/{chunk-77XFJQGC.js.map → chunk-4WEYZ3YG.js.map} +0 -0
- /package/dist/{chunk-CVAVYDXO.js.map → chunk-52ST6RVB.js.map} +0 -0
- /package/dist/{chunk-FPKERDK7.js.map → chunk-6GCF2XWP.js.map} +0 -0
- /package/dist/{chunk-HWUINPIL.js.map → chunk-AUGWUZR2.js.map} +0 -0
- /package/dist/{chunk-6H3MLDGG.js.map → chunk-BFLJ6PGX.js.map} +0 -0
- /package/dist/{chunk-R2LN3JJJ.js.map → chunk-BSCAA322.js.map} +0 -0
- /package/dist/{chunk-QBAZG4CY.js.map → chunk-DJBOQU56.js.map} +0 -0
- /package/dist/{chunk-JYTMT5DF.js.map → chunk-DKKXDLMQ.js.map} +0 -0
- /package/dist/{chunk-IXKVCR4Y.js.map → chunk-E4GZGQWP.js.map} +0 -0
- /package/dist/{chunk-7OLPI334.js.map → chunk-EF5GZEXK.js.map} +0 -0
- /package/dist/{chunk-YZWADOEW.js.map → chunk-EY3ZPJT3.js.map} +0 -0
- /package/dist/{chunk-CLGVSX36.js.map → chunk-EYZG4MR6.js.map} +0 -0
- /package/dist/{chunk-NDWSLQPB.js.map → chunk-FOG4WG3Y.js.map} +0 -0
- /package/dist/{chunk-YZDD5YGE.js.map → chunk-G2O7EIKX.js.map} +0 -0
- /package/dist/{chunk-BR6OPEE4.js.map → chunk-IAOFCBAO.js.map} +0 -0
- /package/dist/{chunk-Q6WZCO45.js.map → chunk-IISQUS7L.js.map} +0 -0
- /package/dist/{chunk-5QK7GB5K.js.map → chunk-JJRPLNLN.js.map} +0 -0
- /package/dist/{chunk-FR3EWVXI.js.map → chunk-KNKXGEPJ.js.map} +0 -0
- /package/dist/{chunk-4BOK2GXL.js.map → chunk-KPVCQBHZ.js.map} +0 -0
- /package/dist/{chunk-P3BL4EOP.js.map → chunk-LC2UWKAQ.js.map} +0 -0
- /package/dist/{chunk-LMIEEDDC.js.map → chunk-LYNBLVEM.js.map} +0 -0
- /package/dist/{chunk-C2THFSXA.js.map → chunk-NDEELC3K.js.map} +0 -0
- /package/dist/{chunk-JNBYNRFS.js.map → chunk-NEZNZM7K.js.map} +0 -0
- /package/dist/{chunk-UFY7C5PP.js.map → chunk-NS3HSXF7.js.map} +0 -0
- /package/dist/{chunk-SOCPIHCS.js.map → chunk-REKP6EIC.js.map} +0 -0
- /package/dist/{chunk-TUC4QY4O.js.map → chunk-RM6XOZMU.js.map} +0 -0
- /package/dist/{chunk-XJDEROHY.js.map → chunk-T2KX2B6I.js.map} +0 -0
- /package/dist/{chunk-C7W5TMFB.js.map → chunk-TMUMQRNM.js.map} +0 -0
- /package/dist/{chunk-KGZ6OZ2T.js.map → chunk-VSX6ICYG.js.map} +0 -0
- /package/dist/{chunk-YNKWLC45.js.map → chunk-WDVIPH6X.js.map} +0 -0
- /package/dist/{chunk-ZJN5RWZD.js.map → chunk-XOHJUVU6.js.map} +0 -0
- /package/dist/{chunk-6FTIY5M6.js.map → chunk-XWJ6BB63.js.map} +0 -0
- /package/dist/{chunk-YKODIG22.js.map → chunk-YMNFSV5C.js.map} +0 -0
- /package/dist/{chunk-HSICXDMZ.js.map → chunk-YNB3M2SM.js.map} +0 -0
- /package/dist/{cleanup-LDBGWEKZ.js.map → cleanup-2FPGGFMO.js.map} +0 -0
- /package/dist/{cli-UATB4RM2.js.map → cli-PI7WSA4S.js.map} +0 -0
- /package/dist/{config-IEIU7A66.js.map → config-HZOLEXYK.js.map} +0 -0
- /package/dist/{diff-K47HB6SA.js.map → diff-3YNZDI65.js.map} +0 -0
- /package/dist/{digest-FBZTBXQO.js.map → digest-CZG3FZE7.js.map} +0 -0
- /package/dist/{fork-BKI5UNNS.js.map → fork-QPD5JTUH.js.map} +0 -0
- /package/dist/{hydrate-Y2AAMZTA.js.map → hydrate-YGDWGBXX.js.map} +0 -0
- /package/dist/{init-7ESFTYZC.js.map → init-MBNE57LN.js.map} +0 -0
- /package/dist/{install-skills-O34BHFHD.js.map → install-skills-5XINJXYY.js.map} +0 -0
- /package/dist/{move-FKT2P5LY.js.map → move-HUC4Y4FX.js.map} +0 -0
- /package/dist/{note-WGM6LCP2.js.map → note-2YE44FRK.js.map} +0 -0
- /package/dist/{overlaps-FRLMMIGC.js.map → overlaps-75LVGJWA.js.map} +0 -0
- /package/dist/{pin-MQ5ZE37R.js.map → pin-FWJVLOSH.js.map} +0 -0
- /package/dist/{pr-527S5HXB.js.map → pr-2XIZWDS2.js.map} +0 -0
- /package/dist/{prune-AIS5YEXP.js.map → prune-7MSLBWVA.js.map} +0 -0
- /package/dist/{read-AP6T3ZGN.js.map → read-PYIADA63.js.map} +0 -0
- /package/dist/{recent-IE3LYQ65.js.map → recent-JKFUXEKV.js.map} +0 -0
- /package/dist/{remove-YGUTSKZP.js.map → remove-MGXS7QZ6.js.map} +0 -0
- /package/dist/{resume-UUP6R2IE.js.map → resume-DMGXYTGC.js.map} +0 -0
- /package/dist/{run-V4755W7C.js.map → run-3KH6GAOL.js.map} +0 -0
- /package/dist/{screen-DNX4K23V.js.map → screen-3UMWSHAY.js.map} +0 -0
- /package/dist/{search-3JZXLCR2.js.map → search-OOJIPNZT.js.map} +0 -0
- /package/dist/{section-TXLC5XO3.js.map → section-ZHCDMSCB.js.map} +0 -0
- /package/dist/{send-6X46WZLC.js.map → send-DXNOANZQ.js.map} +0 -0
- /package/dist/{sessions-T3QDTNP7.js.map → sessions-CLE6ZC23.js.map} +0 -0
- /package/dist/{snooze-KYSFXLPY.js.map → snooze-OHZFIQEG.js.map} +0 -0
- /package/dist/{start-SQSDQK4F.js.map → start-LDLKCTBE.js.map} +0 -0
- /package/dist/{state-4DFV6SHG.js.map → state-FGYNNSDP.js.map} +0 -0
- /package/dist/{status-H5OW4LYE.js.map → status-MIERES2A.js.map} +0 -0
- /package/dist/{stop-HC7XPSSP.js.map → stop-BJ2OO6QL.js.map} +0 -0
- /package/dist/{sync-ITK5UYGM.js.map → sync-HZ6I2EU7.js.map} +0 -0
- /package/dist/{time-GN6B4QD6.js.map → time-TWCZGQ2W.js.map} +0 -0
- /package/dist/{todo-LWMQY6XW.js.map → todo-Y2BZ65MS.js.map} +0 -0
- /package/dist/{tree-7BMORJ6J.js.map → tree-ML343C6O.js.map} +0 -0
- /package/dist/{update-6LQNLRA4.js.map → update-RNIAUEA6.js.map} +0 -0
- /package/dist/{wait-MZOZQ3CI.js.map → wait-2M76BDB5.js.map} +0 -0
|
@@ -5,31 +5,33 @@ import {
|
|
|
5
5
|
} from "./chunk-TUFQJXXO.js";
|
|
6
6
|
import {
|
|
7
7
|
readWebUrl
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-5OUTCUYQ.js";
|
|
9
9
|
import {
|
|
10
10
|
readAssistantContext
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-REKP6EIC.js";
|
|
12
12
|
import {
|
|
13
13
|
claimForDelivery,
|
|
14
14
|
findSessionForCwd,
|
|
15
15
|
formatPendingForPrompt,
|
|
16
|
-
readPendingForWorktree
|
|
17
|
-
|
|
16
|
+
readPendingForWorktree,
|
|
17
|
+
resolveAddressed
|
|
18
|
+
} from "./chunk-C763EC47.js";
|
|
18
19
|
import "./chunk-ZSHWP2VS.js";
|
|
19
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-JJRPLNLN.js";
|
|
20
21
|
import "./chunk-HUXS3VAI.js";
|
|
21
22
|
import {
|
|
23
|
+
bestEffort,
|
|
22
24
|
bestEffortAsync,
|
|
23
25
|
readSessionActivity,
|
|
24
26
|
recordStatusEvent
|
|
25
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-SBL4VVXD.js";
|
|
26
28
|
import {
|
|
27
29
|
sessionIdFor
|
|
28
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-WF57CF7A.js";
|
|
29
31
|
import {
|
|
30
32
|
agentById,
|
|
31
33
|
isInternalRun
|
|
32
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-PMA7QPUV.js";
|
|
33
35
|
import "./chunk-RCYI7SRA.js";
|
|
34
36
|
import "./chunk-DW4JPVXB.js";
|
|
35
37
|
import "./chunk-N4EYQKSM.js";
|
|
@@ -161,6 +163,10 @@ async function runTurnHook(start, payload, io = { write: (t) => void process.std
|
|
|
161
163
|
if (note) io.write(note + "\n");
|
|
162
164
|
}
|
|
163
165
|
const handedOn = !start && !!result?.sessionId;
|
|
166
|
+
if (!start && !handedOn) {
|
|
167
|
+
const session = findSessionForCwd(cwd);
|
|
168
|
+
if (session) bestEffort(`resolve addressed comments for ${session.target}:${session.branch}`, () => resolveAddressed(session));
|
|
169
|
+
}
|
|
164
170
|
await Promise.all([
|
|
165
171
|
io.post(start ? "api/checkpoint/seal" : "api/checkpoint", cwd),
|
|
166
172
|
handedOn ? recordStatus("status-stop", payload, cwd, io.post, { kind: "continue", what: "Working on the comments you sent" }, agent) : recordStatus(start ? "status-prompt" : "status-stop", payload, cwd, io.post, void 0, agent)
|
|
@@ -217,4 +223,4 @@ export {
|
|
|
217
223
|
runTurnHook,
|
|
218
224
|
statusEventFor
|
|
219
225
|
};
|
|
220
|
-
//# sourceMappingURL=hook-
|
|
226
|
+
//# sourceMappingURL=hook-6GDHRNT6.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/commands/hook.ts"],"sourcesContent":["import type { CommandModule } from 'yargs';\nimport { readSessionActivity } from '../core/sessions/session-activity.js';\nimport {\n findSessionForCwd,\n formatPendingForPrompt,\n claimForDelivery,\n readPendingForWorktree,\n resolveAddressed,\n sessionIdFor,\n} from '../core/comments/pending-delivery.js';\nimport { isInternalRun } from '../core/platform/internal-run.js';\nimport { isOwnCheckout, ownCheckoutNote } from '../core/worktree/own-checkout.js';\nimport { loadConfig } from '../core/platform/config.js';\nimport { readWebUrl } from '../core/platform/web-discovery.js';\nimport { recordStatusEvent, type StatusEvent } from '../core/status/session-status.js';\nimport { bestEffort, bestEffortAsync } from '../core/platform/best-effort.js';\nimport { readAssistantContext } from '../core/agents/assistant.js';\nimport { agentById, type AgentAdapter, type TurnEdge } from '../core/agents/index.js';\n\n/**\n * `work hook prompt-submit` / `work hook stop` — invoked by Claude Code's\n * UserPromptSubmit / Stop hooks (registered by `work web` on startup).\n * Reads pending review comments for the worktree the user is currently\n * in, prints them in the format Claude Code expects for that event, and\n * marks them delivered so they don't repeat.\n *\n * Exits silently when:\n * - cwd isn't a `work`-managed worktree\n * - there are no pending comments\n * - Claude isn't actively running in this worktree (paranoia — the hook\n * only fires from inside a running Claude, but we double-check)\n */\nexport type HookEvent =\n | 'prompt-submit'\n | 'stop'\n | 'checkpoint'\n | 'checkpoint-seal'\n | 'status-prompt'\n | 'status-stop'\n | 'status-notify'\n | 'assistant-context'\n /** One hook per turn edge: delivery + status + checkpoint (the full dashboard). */\n | 'turn-start'\n | 'turn-end';\n\nconst STATUS_EVENTS = new Set<HookEvent>(['status-prompt', 'status-stop', 'status-notify']);\n\n/**\n * Fire-and-forget POST to the running `work web`. Shared by the two\n * checkpoint hooks: `checkpoint` (Stop) hits `api/checkpoint` to refresh the\n * instruction's live step; `checkpoint-seal` (UserPromptSubmit) hits\n * `api/checkpoint/seal` to close it so the next prompt opens a fresh step.\n * Silent + best-effort — no work web running, or cwd not a tracked scope, is\n * a no-op, and we never block Claude's turn on it.\n */\nasync function postToWeb(route: string, cwd: string): Promise<void> {\n const base = readWebUrl();\n if (!base) return; // no work web running\n const controller = new AbortController();\n const timer = setTimeout(() => controller.abort(), 3000);\n try {\n await fetch(`${base}${route}`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ cwd }),\n signal: controller.signal,\n });\n } catch {\n /* best-effort — never block Claude's turn on a checkpoint */\n } finally {\n clearTimeout(timer);\n }\n}\n\nexport interface HookInput {\n event: HookEvent;\n cwd: string;\n}\n\nexport interface HookOutput {\n /** Plain text appended to the user's prompt (prompt-submit) or\n * raw JSON `{decision:'block', reason}` that prevents stop (stop). */\n stdout: string;\n /** The comment ids surfaced — caller marks them delivered. */\n deliveredIds: string[];\n /** The session id that produced the output, when there was something\n * to deliver. Null otherwise (so the caller knows to skip markDelivered). */\n sessionId: string | null;\n}\n\n/**\n * Pure transformation: given an event and cwd, produce the stdout payload\n * Claude Code expects plus the ids to mark delivered. Returns null when\n * there's nothing to surface. No I/O on stdin/stdout — the caller wraps.\n */\nexport function computeHookOutput(\n input: HookInput,\n /** Which of these ids this caller may deliver. The real hook claims them\n * atomically (claimForDelivery) so a racing PTY push can't send them too;\n * the default keeps this function pure for tests. */\n claim: (sessionId: string, ids: string[]) => string[] = (_s, ids) => ids,\n /** The agent that ran the hook: it says how notes are handed over (its hook output format). */\n agent: AgentAdapter = agentById('claude'),\n): HookOutput | null {\n const session = findSessionForCwd(input.cwd);\n if (!session) return null;\n\n const activity = readSessionActivity(session);\n if (activity.state === 'stale') return null;\n\n const sessionId = sessionIdFor(session);\n const unclaimed = readPendingForWorktree(session);\n if (unclaimed.length === 0) return null;\n const mine = new Set(\n claim(\n sessionId,\n unclaimed.map((c) => c.id),\n ),\n );\n const pending = unclaimed.filter((c) => mine.has(c.id));\n if (pending.length === 0) return null;\n\n const text = formatPendingForPrompt(pending);\n if (!text) return null;\n\n const ids = pending.map((c) => c.id);\n // The agent's way of taking notes from a hook (Claude: added to the prompt; at Stop, `decision: block`).\n const edge = input.event === 'prompt-submit' ? 'turn-start' : 'turn-end';\n const stdout = agent.events ? agent.events.handOver(edge, text) : text + '\\n';\n return { stdout, deliveredIds: ids, sessionId };\n}\n\n/** What an agent sends a hook on stdin: its own shape, read by its adapter (agents/). */\ntype HookPayload = Record<string, unknown>;\n\n/** The turn edge a status hook is for. */\nconst STATUS_EDGE: Partial<Record<HookEvent, TurnEdge>> = {\n 'status-prompt': 'turn-start',\n 'status-stop': 'turn-end',\n 'status-notify': 'notify',\n};\n\n/** Map a status hook + its payload to a status event, through the agent that ran it. Exported for tests. */\nexport function statusEventFor(event: HookEvent, payload: HookPayload, agent: AgentAdapter = agentById('claude')): StatusEvent | null {\n const edge = STATUS_EDGE[event];\n return edge && agent.events ? agent.events.read(edge, payload).status : null;\n}\n\n/** The folder a hook fired in: what the agent says, else the hook's own. */\nfunction hookCwd(payload: HookPayload, agent: AgentAdapter): string {\n return agent.events?.read('turn-start', payload).cwd ?? (typeof payload.cwd === 'string' ? payload.cwd : process.cwd());\n}\n\nasync function readStdinJson(): Promise<HookPayload> {\n if (process.stdin.isTTY) return {};\n return new Promise((resolve) => {\n const chunks: Buffer[] = [];\n let resolved = false;\n // No payload after 1 s (stdin never closed): carry on without one.\n const fallback = setTimeout(() => done({}), 1000);\n const done = (val: HookPayload) => {\n if (resolved) return;\n resolved = true;\n // The fallback timer kept every hook process alive a full second\n // after its work was done — on each of several hooks per turn.\n clearTimeout(fallback);\n resolve(val);\n };\n process.stdin.on('data', (c: Buffer) => chunks.push(c));\n process.stdin.on('end', () => {\n try {\n const raw = Buffer.concat(chunks).toString('utf-8').trim();\n done(raw ? (JSON.parse(raw) as HookPayload) : {});\n } catch {\n done({});\n }\n });\n process.stdin.on('error', () => done({}));\n });\n}\n\nconst HOOK_EVENTS = [\n 'prompt-submit',\n 'stop',\n 'checkpoint',\n 'checkpoint-seal',\n 'status-prompt',\n 'status-stop',\n 'status-notify',\n 'assistant-context',\n 'turn-start',\n 'turn-end',\n] as const;\n\n/** `work hook <event> [--agent <id>]` without the yargs router (bin.ts's fast path). An\n * unknown event is ignored: a hook must never fail an agent's turn. The agent\n * that runs it says so with --agent (Claude Code's hooks, installed before\n * agents had a name here, don't: Claude is the default). */\nexport async function runHookEvent(event: string | undefined, args: readonly string[] = []): Promise<void> {\n if (!event || !(HOOK_EVENTS as readonly string[]).includes(event)) return;\n await handleHook(event as HookEvent, hookAgentArg(args));\n}\n\n/** The agent a hook names (`--agent <id>`; Claude when it names none). */\nexport function hookAgentArg(args: readonly string[]): string {\n const i = args.indexOf('--agent');\n return i >= 0 && args[i + 1] && !args[i + 1].startsWith('-') ? args[i + 1] : 'claude';\n}\n\nexport const hookCommand: CommandModule = {\n command: 'hook <event>',\n describe: false, // hidden — humans don't call this directly\n builder: (y) =>\n y\n .positional('event', {\n type: 'string',\n choices: HOOK_EVENTS,\n describe: 'Hook event name',\n })\n .option('agent', { type: 'string', default: 'claude', describe: 'The agent running the hook' }),\n handler: async (argv) => handleHook(argv.event as HookEvent, String(argv.agent ?? 'claude')),\n};\n\nexport interface TurnHookIo {\n write: (text: string) => void;\n post: (route: string, cwd: string) => Promise<void>;\n /** The own-checkout note for a folder (tests); default: from the session and config. */\n ownCheckoutNote?: (cwd: string) => string | null;\n}\n\n/** The note for a turn starting in a repo's own checkout (the session for that folder), or null. */\nexport function ownCheckoutNoteFor(cwd: string): string | null {\n const session = findSessionForCwd(cwd);\n if (!session || session.isGroup) return null;\n const repos = loadConfig()?.repos ?? {};\n return isOwnCheckout(session, repos) ? ownCheckoutNote(session) : null;\n}\n\n/**\n * `turn-start` / `turn-end`: what three hooks did, in one process. Pending\n * comments are written for Claude first (prompt-submit / stop output), then\n * the checkpoint nudge and the status record run side by side.\n */\nexport async function runTurnHook(\n start: boolean,\n payload: HookPayload,\n io: TurnHookIo = { write: (t) => void process.stdout.write(t), post: postToWeb },\n agent: AgentAdapter = agentById('claude'),\n): Promise<void> {\n const cwd = hookCwd(payload, agent);\n const result = computeHookOutput({ event: start ? 'prompt-submit' : 'stop', cwd }, claimForDelivery, agent);\n if (result?.sessionId) io.write(result.stdout);\n // On a repo's own checkout: stay on its branch — branches are work's (own-checkout.ts).\n if (start) {\n const note = io.ownCheckoutNote ? io.ownCheckoutNote(cwd) : ownCheckoutNoteFor(cwd);\n if (note) io.write(note + '\\n');\n }\n // A Stop that just handed Claude your comments (`decision: block`) is no\n // end of the turn: Claude goes on with them, and its real Stop comes later\n // (recorded as a stop then, so you hear when it is done).\n const handedOn = !start && !!result?.sessionId;\n // The turn's real end: what Claude was handed is done — resolved, not left\n // to pile up on the Diff tab (resolveAddressed). Before the status nudge,\n // so the refresh it causes shows it.\n if (!start && !handedOn) {\n const session = findSessionForCwd(cwd);\n if (session) bestEffort(`resolve addressed comments for ${session.target}:${session.branch}`, () => resolveAddressed(session));\n }\n await Promise.all([\n io.post(start ? 'api/checkpoint/seal' : 'api/checkpoint', cwd),\n handedOn\n ? recordStatus('status-stop', payload, cwd, io.post, { kind: 'continue', what: 'Working on the comments you sent' }, agent)\n : recordStatus(start ? 'status-prompt' : 'status-stop', payload, cwd, io.post, undefined, agent),\n ]);\n}\n\n/** Record a status event for the cwd's session and nudge work web. No-op outside a work session. */\nasync function recordStatus(\n event: HookEvent,\n payload: HookPayload,\n cwd: string,\n post: (route: string, cwd: string) => Promise<void> = postToWeb,\n override?: StatusEvent,\n agent: AgentAdapter = agentById('claude'),\n): Promise<void> {\n const session = findSessionForCwd(cwd);\n const statusEvent = override ?? statusEventFor(event, payload, agent);\n if (!session || !statusEvent) return;\n // Best-effort — never block Claude's turn on bookkeeping — but logged,\n // so \"why does the inbox not show this session?\" has an answer.\n const recorded = await bestEffortAsync(`record status ${event} for ${session.target}:${session.branch}`, async () => {\n await recordStatusEvent(sessionIdFor(session), statusEvent);\n return true;\n });\n if (recorded) await post('api/status-changed', cwd);\n}\n\nasync function handleHook(event: HookEvent, agentId = 'claude'): Promise<void> {\n {\n // Bail when this hook fired from one of work's OWN internal `claude -p`\n // runs (checkpoint naming, Jira slug, CLAUDE.md gen). Those headless\n // Claudes inherit the WORK_INTERNAL_CLAUDE marker; without this guard the\n // checkpoint-naming run recursively seals + spawns checkpoints, fragmenting\n // one Claude round into many spurious steps. See internal-claude.ts.\n if (isInternalRun()) return;\n const payload = await readStdinJson();\n const agent = agentById(agentId);\n const cwd = hookCwd(payload, agent);\n // The dashboard assistant's UserPromptSubmit hook (installed only in its\n // own folder): stdout becomes context for the prompt — what the user is\n // looking at in the dashboard.\n if (event === 'assistant-context') {\n const text = readAssistantContext();\n if (text) process.stdout.write(text + '\\n');\n return;\n }\n // Checkpoint bridges are independent of comment delivery: just nudge work\n // web, emit nothing to Claude's context.\n if (event === 'checkpoint') {\n await postToWeb('api/checkpoint', cwd);\n return;\n }\n if (event === 'checkpoint-seal') {\n await postToWeb('api/checkpoint/seal', cwd);\n return;\n }\n // One hook per turn edge (the full dashboard installs these): delivery,\n // status and checkpoint in ONE process instead of three — each `work`\n // start is a node boot, for every turn of every Claude on the machine.\n // What Claude reads (pending comments) is written first; the\n // bookkeeping runs after, side by side.\n if (event === 'turn-start' || event === 'turn-end') {\n await runTurnHook(event === 'turn-start', payload, undefined, agent);\n return;\n }\n // Attention inbox: record the session's state, then nudge work web so\n // the dashboard (and desktop notification) updates immediately. Emits\n // nothing to Claude. Outside a work session it's a no-op.\n if (STATUS_EVENTS.has(event)) {\n await recordStatus(event, payload, cwd, postToWeb, undefined, agent);\n return;\n }\n // Claimed (= marked delivered) before printing: the process ends right\n // after this write, and a claim is what stops a PTY push racing us from\n // sending the same comments.\n const result = computeHookOutput({ event, cwd }, claimForDelivery, agent);\n if (!result || !result.sessionId) return;\n process.stdout.write(result.stdout);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6CA,IAAM,gBAAgB,oBAAI,IAAe,CAAC,iBAAiB,eAAe,eAAe,CAAC;AAU1F,eAAe,UAAU,OAAe,KAA4B;AAClE,QAAM,OAAO,WAAW;AACxB,MAAI,CAAC,KAAM;AACX,QAAM,aAAa,IAAI,gBAAgB;AACvC,QAAM,QAAQ,WAAW,MAAM,WAAW,MAAM,GAAG,GAAI;AACvD,MAAI;AACF,UAAM,MAAM,GAAG,IAAI,GAAG,KAAK,IAAI;AAAA,MAC7B,QAAQ;AAAA,MACR,SAAS,EAAE,gBAAgB,mBAAmB;AAAA,MAC9C,MAAM,KAAK,UAAU,EAAE,IAAI,CAAC;AAAA,MAC5B,QAAQ,WAAW;AAAA,IACrB,CAAC;AAAA,EACH,QAAQ;AAAA,EAER,UAAE;AACA,iBAAa,KAAK;AAAA,EACpB;AACF;AAuBO,SAAS,kBACd,OAIA,QAAwD,CAAC,IAAI,QAAQ,KAErE,QAAsB,UAAU,QAA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A,UAAM,SAAS,kBAAkB,EAAE,OAAO,IAAI,GAAG,kBAAkB,KAAK;AACxE,QAAI,CAAC,UAAU,CAAC,OAAO,UAAW;AAClC,YAAQ,OAAO,MAAM,OAAO,MAAM;AAAA,EACpC;AACF;","names":[]}
|
|
@@ -4,9 +4,9 @@ import {
|
|
|
4
4
|
} from "./chunk-7NAXFBFI.js";
|
|
5
5
|
import {
|
|
6
6
|
mergeHydratedSessions
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-SBL4VVXD.js";
|
|
8
|
+
import "./chunk-WF57CF7A.js";
|
|
9
|
+
import "./chunk-PMA7QPUV.js";
|
|
10
10
|
import "./chunk-RCYI7SRA.js";
|
|
11
11
|
import "./chunk-DW4JPVXB.js";
|
|
12
12
|
import "./chunk-N4EYQKSM.js";
|
|
@@ -118,4 +118,4 @@ var hydrateCommand = {
|
|
|
118
118
|
export {
|
|
119
119
|
hydrateCommand
|
|
120
120
|
};
|
|
121
|
-
//# sourceMappingURL=hydrate-
|
|
121
|
+
//# sourceMappingURL=hydrate-YGDWGBXX.js.map
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
import {
|
|
8
8
|
DEFAULT_COPY_FILES,
|
|
9
9
|
suggestFolders
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-WDVIPH6X.js";
|
|
11
11
|
import {
|
|
12
12
|
isGitRepo
|
|
13
13
|
} from "./chunk-7NAXFBFI.js";
|
|
@@ -15,14 +15,14 @@ import {
|
|
|
15
15
|
enrollProblem,
|
|
16
16
|
scanForRepos,
|
|
17
17
|
suggestAlias
|
|
18
|
-
} from "./chunk-
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-
|
|
21
|
-
import "./chunk-
|
|
22
|
-
import "./chunk-
|
|
18
|
+
} from "./chunk-BSCAA322.js";
|
|
19
|
+
import "./chunk-FOG4WG3Y.js";
|
|
20
|
+
import "./chunk-46UD4QBL.js";
|
|
21
|
+
import "./chunk-SBL4VVXD.js";
|
|
22
|
+
import "./chunk-WF57CF7A.js";
|
|
23
23
|
import {
|
|
24
24
|
KNOWN_TOOLS
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-PMA7QPUV.js";
|
|
26
26
|
import "./chunk-RCYI7SRA.js";
|
|
27
27
|
import "./chunk-DW4JPVXB.js";
|
|
28
28
|
import "./chunk-N4EYQKSM.js";
|
|
@@ -184,4 +184,4 @@ var initCommand = {
|
|
|
184
184
|
export {
|
|
185
185
|
initCommand
|
|
186
186
|
};
|
|
187
|
-
//# sourceMappingURL=init-
|
|
187
|
+
//# sourceMappingURL=init-MBNE57LN.js.map
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
import {
|
|
3
3
|
installSkillsCommand,
|
|
4
4
|
runInstallSkills
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-IISQUS7L.js";
|
|
6
6
|
import "./chunk-LNHSBM4L.js";
|
|
7
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-PMA7QPUV.js";
|
|
8
8
|
import "./chunk-RCYI7SRA.js";
|
|
9
9
|
import "./chunk-7HEB6SQS.js";
|
|
10
10
|
export {
|
|
11
11
|
installSkillsCommand,
|
|
12
12
|
runInstallSkills
|
|
13
13
|
};
|
|
14
|
-
//# sourceMappingURL=install-skills-
|
|
14
|
+
//# sourceMappingURL=install-skills-5XINJXYY.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
runInstallSkills
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-IISQUS7L.js";
|
|
5
5
|
import "./chunk-LNHSBM4L.js";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-PMA7QPUV.js";
|
|
7
7
|
import "./chunk-RCYI7SRA.js";
|
|
8
8
|
import "./chunk-7HEB6SQS.js";
|
|
9
9
|
|
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
createInProcess
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-4SK76CPY.js";
|
|
5
|
+
import "./chunk-EYZG4MR6.js";
|
|
6
6
|
import {
|
|
7
7
|
findHost
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-DJBOQU56.js";
|
|
9
9
|
import "./chunk-H5LKMR45.js";
|
|
10
10
|
import {
|
|
11
11
|
readWebUrl,
|
|
12
12
|
webServerResponds
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-5OUTCUYQ.js";
|
|
14
14
|
import "./chunk-7NAXFBFI.js";
|
|
15
15
|
import {
|
|
16
16
|
originUrl
|
|
17
|
-
} from "./chunk-
|
|
18
|
-
import "./chunk-
|
|
17
|
+
} from "./chunk-BSCAA322.js";
|
|
18
|
+
import "./chunk-FOG4WG3Y.js";
|
|
19
19
|
import {
|
|
20
20
|
defaultRunner
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-46UD4QBL.js";
|
|
22
22
|
import {
|
|
23
23
|
loadHistory,
|
|
24
24
|
saveHistory
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-SBL4VVXD.js";
|
|
26
26
|
import {
|
|
27
27
|
replaceDb,
|
|
28
28
|
sessionIdFor,
|
|
29
29
|
snapshotDb,
|
|
30
30
|
withDb
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-WF57CF7A.js";
|
|
32
32
|
import {
|
|
33
33
|
agentOf
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-PMA7QPUV.js";
|
|
35
35
|
import "./chunk-RCYI7SRA.js";
|
|
36
36
|
import "./chunk-DW4JPVXB.js";
|
|
37
37
|
import "./chunk-N4EYQKSM.js";
|
|
@@ -310,4 +310,4 @@ var moveCommand = {
|
|
|
310
310
|
export {
|
|
311
311
|
moveCommand
|
|
312
312
|
};
|
|
313
|
-
//# sourceMappingURL=move-
|
|
313
|
+
//# sourceMappingURL=move-HUC4Y4FX.js.map
|
|
@@ -4,21 +4,21 @@ import {
|
|
|
4
4
|
appendNote,
|
|
5
5
|
readNote,
|
|
6
6
|
saveNote
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-NEZNZM7K.js";
|
|
8
8
|
import {
|
|
9
9
|
sessionFromArgs,
|
|
10
10
|
sessionPositionals
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-YNB3M2SM.js";
|
|
12
12
|
import "./chunk-6AQRYLOB.js";
|
|
13
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-C763EC47.js";
|
|
14
14
|
import "./chunk-ZSHWP2VS.js";
|
|
15
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-JJRPLNLN.js";
|
|
16
16
|
import "./chunk-HUXS3VAI.js";
|
|
17
|
-
import "./chunk-
|
|
17
|
+
import "./chunk-SBL4VVXD.js";
|
|
18
18
|
import {
|
|
19
19
|
sessionIdFor
|
|
20
|
-
} from "./chunk-
|
|
21
|
-
import "./chunk-
|
|
20
|
+
} from "./chunk-WF57CF7A.js";
|
|
21
|
+
import "./chunk-PMA7QPUV.js";
|
|
22
22
|
import "./chunk-RCYI7SRA.js";
|
|
23
23
|
import "./chunk-DW4JPVXB.js";
|
|
24
24
|
import "./chunk-N4EYQKSM.js";
|
|
@@ -75,4 +75,4 @@ var noteCommand = {
|
|
|
75
75
|
export {
|
|
76
76
|
noteCommand
|
|
77
77
|
};
|
|
78
|
-
//# sourceMappingURL=note-
|
|
78
|
+
//# sourceMappingURL=note-2YE44FRK.js.map
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
scanChanges
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-NDEELC3K.js";
|
|
5
|
+
import "./chunk-KPVCQBHZ.js";
|
|
6
6
|
import "./chunk-AKMPF72Y.js";
|
|
7
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-46UD4QBL.js";
|
|
8
8
|
import {
|
|
9
9
|
loadHistory
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-SBL4VVXD.js";
|
|
11
11
|
import {
|
|
12
12
|
sessionIdFor
|
|
13
|
-
} from "./chunk-
|
|
14
|
-
import "./chunk-
|
|
13
|
+
} from "./chunk-WF57CF7A.js";
|
|
14
|
+
import "./chunk-PMA7QPUV.js";
|
|
15
15
|
import "./chunk-RCYI7SRA.js";
|
|
16
16
|
import "./chunk-DW4JPVXB.js";
|
|
17
17
|
import "./chunk-N4EYQKSM.js";
|
|
@@ -53,4 +53,4 @@ var overlapsCommand = {
|
|
|
53
53
|
export {
|
|
54
54
|
overlapsCommand
|
|
55
55
|
};
|
|
56
|
-
//# sourceMappingURL=overlaps-
|
|
56
|
+
//# sourceMappingURL=overlaps-75LVGJWA.js.map
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
placeSession
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-RM6XOZMU.js";
|
|
5
5
|
import {
|
|
6
6
|
sessionFromArgs,
|
|
7
7
|
sessionPositionals
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-YNB3M2SM.js";
|
|
9
9
|
import "./chunk-6AQRYLOB.js";
|
|
10
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-C763EC47.js";
|
|
11
11
|
import "./chunk-ZSHWP2VS.js";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-JJRPLNLN.js";
|
|
13
13
|
import "./chunk-HUXS3VAI.js";
|
|
14
|
-
import "./chunk-
|
|
14
|
+
import "./chunk-SBL4VVXD.js";
|
|
15
15
|
import {
|
|
16
16
|
sessionIdFor
|
|
17
|
-
} from "./chunk-
|
|
18
|
-
import "./chunk-
|
|
17
|
+
} from "./chunk-WF57CF7A.js";
|
|
18
|
+
import "./chunk-PMA7QPUV.js";
|
|
19
19
|
import "./chunk-RCYI7SRA.js";
|
|
20
20
|
import "./chunk-DW4JPVXB.js";
|
|
21
21
|
import "./chunk-N4EYQKSM.js";
|
|
@@ -42,4 +42,4 @@ var pinCommand = {
|
|
|
42
42
|
export {
|
|
43
43
|
pinCommand
|
|
44
44
|
};
|
|
45
|
-
//# sourceMappingURL=pin-
|
|
45
|
+
//# sourceMappingURL=pin-FWJVLOSH.js.map
|
|
@@ -3,24 +3,24 @@ import {
|
|
|
3
3
|
listReplies,
|
|
4
4
|
postDrafts,
|
|
5
5
|
saveDraft
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-6GCF2XWP.js";
|
|
7
7
|
import {
|
|
8
8
|
readWebUrl
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-5OUTCUYQ.js";
|
|
10
10
|
import {
|
|
11
11
|
findSessionForCwd
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-C763EC47.js";
|
|
13
13
|
import "./chunk-ZSHWP2VS.js";
|
|
14
|
-
import "./chunk-
|
|
14
|
+
import "./chunk-JJRPLNLN.js";
|
|
15
15
|
import "./chunk-HUXS3VAI.js";
|
|
16
16
|
import {
|
|
17
17
|
defaultRunner
|
|
18
|
-
} from "./chunk-
|
|
19
|
-
import "./chunk-
|
|
18
|
+
} from "./chunk-46UD4QBL.js";
|
|
19
|
+
import "./chunk-SBL4VVXD.js";
|
|
20
20
|
import {
|
|
21
21
|
sessionIdFor
|
|
22
|
-
} from "./chunk-
|
|
23
|
-
import "./chunk-
|
|
22
|
+
} from "./chunk-WF57CF7A.js";
|
|
23
|
+
import "./chunk-PMA7QPUV.js";
|
|
24
24
|
import "./chunk-RCYI7SRA.js";
|
|
25
25
|
import "./chunk-DW4JPVXB.js";
|
|
26
26
|
import "./chunk-N4EYQKSM.js";
|
|
@@ -119,4 +119,4 @@ var prCommand = {
|
|
|
119
119
|
export {
|
|
120
120
|
prCommand
|
|
121
121
|
};
|
|
122
|
-
//# sourceMappingURL=pr-
|
|
122
|
+
//# sourceMappingURL=pr-2XIZWDS2.js.map
|
|
@@ -5,32 +5,32 @@ import {
|
|
|
5
5
|
} from "./chunk-ABQYKTG4.js";
|
|
6
6
|
import {
|
|
7
7
|
defaultCleanupDeps
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-IAOFCBAO.js";
|
|
9
|
+
import "./chunk-2P26VJY3.js";
|
|
10
|
+
import "./chunk-6GCF2XWP.js";
|
|
11
11
|
import {
|
|
12
12
|
applyCleanup,
|
|
13
13
|
scanCleanup
|
|
14
14
|
} from "./chunk-AKMPF72Y.js";
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-
|
|
21
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-EYZG4MR6.js";
|
|
16
|
+
import "./chunk-LQCYTZ2F.js";
|
|
17
|
+
import "./chunk-XOHJUVU6.js";
|
|
18
|
+
import "./chunk-DJBOQU56.js";
|
|
19
|
+
import "./chunk-BFLJ6PGX.js";
|
|
20
|
+
import "./chunk-KNKXGEPJ.js";
|
|
21
|
+
import "./chunk-EF5GZEXK.js";
|
|
22
22
|
import "./chunk-H5LKMR45.js";
|
|
23
|
-
import "./chunk-
|
|
24
|
-
import "./chunk-
|
|
23
|
+
import "./chunk-REKP6EIC.js";
|
|
24
|
+
import "./chunk-C763EC47.js";
|
|
25
25
|
import "./chunk-ZSHWP2VS.js";
|
|
26
|
-
import "./chunk-
|
|
26
|
+
import "./chunk-JJRPLNLN.js";
|
|
27
27
|
import "./chunk-HUXS3VAI.js";
|
|
28
28
|
import "./chunk-7NAXFBFI.js";
|
|
29
|
-
import "./chunk-
|
|
30
|
-
import "./chunk-
|
|
31
|
-
import "./chunk-
|
|
32
|
-
import "./chunk-
|
|
33
|
-
import "./chunk-
|
|
29
|
+
import "./chunk-FOG4WG3Y.js";
|
|
30
|
+
import "./chunk-46UD4QBL.js";
|
|
31
|
+
import "./chunk-SBL4VVXD.js";
|
|
32
|
+
import "./chunk-WF57CF7A.js";
|
|
33
|
+
import "./chunk-PMA7QPUV.js";
|
|
34
34
|
import "./chunk-RCYI7SRA.js";
|
|
35
35
|
import "./chunk-DW4JPVXB.js";
|
|
36
36
|
import "./chunk-N4EYQKSM.js";
|
|
@@ -89,4 +89,4 @@ var pruneCommand = {
|
|
|
89
89
|
export {
|
|
90
90
|
pruneCommand
|
|
91
91
|
};
|
|
92
|
-
//# sourceMappingURL=prune-
|
|
92
|
+
//# sourceMappingURL=prune-7MSLBWVA.js.map
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
adoptLegacyRestoreList,
|
|
7
7
|
dbPtySessions
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-XOHJUVU6.js";
|
|
9
9
|
import {
|
|
10
10
|
PROTOCOL_VERSION,
|
|
11
11
|
PtyHostBusyError,
|
|
@@ -19,21 +19,21 @@ import {
|
|
|
19
19
|
keepEnv,
|
|
20
20
|
probeHostDetailed,
|
|
21
21
|
readHostInfo
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-DJBOQU56.js";
|
|
23
23
|
import {
|
|
24
24
|
bestEffort,
|
|
25
25
|
loadHistory,
|
|
26
26
|
logSwallowed,
|
|
27
27
|
swallow
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-SBL4VVXD.js";
|
|
29
29
|
import {
|
|
30
30
|
sessionIdFor
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-WF57CF7A.js";
|
|
32
32
|
import {
|
|
33
33
|
agentById,
|
|
34
34
|
buildAiLaunchArgs,
|
|
35
35
|
killTree
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-PMA7QPUV.js";
|
|
37
37
|
import "./chunk-RCYI7SRA.js";
|
|
38
38
|
import {
|
|
39
39
|
report
|
|
@@ -50,17 +50,17 @@ import {
|
|
|
50
50
|
} from "./chunk-7HEB6SQS.js";
|
|
51
51
|
|
|
52
52
|
// src/commands/pty-host.ts
|
|
53
|
-
import
|
|
53
|
+
import fs4 from "fs";
|
|
54
54
|
import chalk from "chalk";
|
|
55
55
|
|
|
56
56
|
// src/core/pty/pty-host.ts
|
|
57
57
|
import http from "http";
|
|
58
58
|
import crypto from "crypto";
|
|
59
|
-
import
|
|
59
|
+
import fs3 from "fs";
|
|
60
60
|
import { WebSocketServer } from "ws";
|
|
61
61
|
|
|
62
62
|
// src/core/pty/pty-registry.ts
|
|
63
|
-
import
|
|
63
|
+
import fs2 from "fs";
|
|
64
64
|
|
|
65
65
|
// src/core/pty/pty-session.ts
|
|
66
66
|
import pty from "node-pty";
|
|
@@ -68,6 +68,37 @@ import crossSpawn from "cross-spawn";
|
|
|
68
68
|
import xtermHeadless from "@xterm/headless";
|
|
69
69
|
import xtermSerialize from "@xterm/addon-serialize";
|
|
70
70
|
import childProcess from "child_process";
|
|
71
|
+
import { createRequire } from "module";
|
|
72
|
+
import path2 from "path";
|
|
73
|
+
|
|
74
|
+
// src/core/pty/spawn-helper.ts
|
|
75
|
+
import fs from "fs";
|
|
76
|
+
import path from "path";
|
|
77
|
+
function makeSpawnHelperExecutable(ptyDir, platform = process.platform, arch = process.arch, f = fs) {
|
|
78
|
+
const out = { fixed: [], failed: [] };
|
|
79
|
+
if (platform === "win32") return out;
|
|
80
|
+
for (const file of [
|
|
81
|
+
path.join(ptyDir, "prebuilds", `${platform}-${arch}`, "spawn-helper"),
|
|
82
|
+
path.join(ptyDir, "build", "Release", "spawn-helper")
|
|
83
|
+
]) {
|
|
84
|
+
let mode;
|
|
85
|
+
try {
|
|
86
|
+
mode = f.statSync(file).mode;
|
|
87
|
+
} catch {
|
|
88
|
+
continue;
|
|
89
|
+
}
|
|
90
|
+
if ((mode & 73) === 73) continue;
|
|
91
|
+
try {
|
|
92
|
+
f.chmodSync(file, mode & 511 | 493);
|
|
93
|
+
out.fixed.push(file);
|
|
94
|
+
} catch (err) {
|
|
95
|
+
out.failed.push({ file, error: err.message });
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return out;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// src/core/pty/pty-session.ts
|
|
71
102
|
var HIDDEN = /* @__PURE__ */ Symbol.for("work.forkHidesConsole");
|
|
72
103
|
function hideForkConsoles(cp) {
|
|
73
104
|
if (cp.fork[HIDDEN]) return;
|
|
@@ -81,6 +112,23 @@ function hideForkConsoles(cp) {
|
|
|
81
112
|
cp.fork = wrapped;
|
|
82
113
|
}
|
|
83
114
|
if (process.platform === "win32") hideForkConsoles(childProcess);
|
|
115
|
+
var spawnHelperChecked = false;
|
|
116
|
+
function ensureSpawnHelper() {
|
|
117
|
+
if (spawnHelperChecked) return;
|
|
118
|
+
spawnHelperChecked = true;
|
|
119
|
+
try {
|
|
120
|
+
const dir = path2.dirname(createRequire(import.meta.url).resolve("node-pty/package.json"));
|
|
121
|
+
const { fixed, failed } = makeSpawnHelperExecutable(dir);
|
|
122
|
+
for (const file of fixed) debug("made node-pty spawn-helper executable", file);
|
|
123
|
+
for (const { file, error } of failed)
|
|
124
|
+
report(
|
|
125
|
+
"warn",
|
|
126
|
+
`node-pty's spawn-helper isn't executable and couldn't be made so (${error}): terminals can't start. Run: chmod +x "${file}"`
|
|
127
|
+
);
|
|
128
|
+
} catch (err) {
|
|
129
|
+
debug("spawn-helper check failed", err.message);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
84
132
|
var { Terminal } = xtermHeadless;
|
|
85
133
|
var { SerializeAddon } = xtermSerialize;
|
|
86
134
|
function resolvePtyCommand(cmd, args, opts = {}) {
|
|
@@ -136,6 +184,7 @@ var PtySession = class {
|
|
|
136
184
|
}
|
|
137
185
|
const { file: spawnCmd, args: spawnArgs } = resolvePtyCommand(rawCmd, rawArgs, { env, cwd });
|
|
138
186
|
debug("PtySession spawn", { spawnCmd, spawnArgs, cwd, cols, rows });
|
|
187
|
+
ensureSpawnHelper();
|
|
139
188
|
this.pty = pty.spawn(spawnCmd, spawnArgs, {
|
|
140
189
|
name: "xterm-256color",
|
|
141
190
|
cwd,
|
|
@@ -258,7 +307,7 @@ function fileSessionsStore(file) {
|
|
|
258
307
|
read() {
|
|
259
308
|
const out = {};
|
|
260
309
|
try {
|
|
261
|
-
const raw = JSON.parse(
|
|
310
|
+
const raw = JSON.parse(fs2.readFileSync(file, "utf-8"));
|
|
262
311
|
if (raw && typeof raw === "object") {
|
|
263
312
|
for (const [id, entry] of Object.entries(raw)) if (isPersistedPty(entry)) out[id] = entry;
|
|
264
313
|
}
|
|
@@ -285,7 +334,7 @@ var PtyRegistry = class {
|
|
|
285
334
|
this.spawner = deps.spawner ?? defaultSpawner;
|
|
286
335
|
this.hasConversation = deps.hasConversation ?? ((cwd, tool) => agentById(tool).launch.canResume(cwd));
|
|
287
336
|
this.store = deps.sessions ?? (deps.sessionsPath ? fileSessionsStore(deps.sessionsPath) : dbPtySessions);
|
|
288
|
-
this.cwdExists = deps.cwdExists ?? ((p) =>
|
|
337
|
+
this.cwdExists = deps.cwdExists ?? ((p) => fs2.existsSync(p));
|
|
289
338
|
this.keepEnvNames = deps.keepEnvNames ?? (() => loadConfig()?.hostEnv ?? []);
|
|
290
339
|
}
|
|
291
340
|
list() {
|
|
@@ -593,7 +642,7 @@ async function startPtyHost(opts = {}) {
|
|
|
593
642
|
if (!m[2] && req.method === "POST") {
|
|
594
643
|
const spec = await readBody(req);
|
|
595
644
|
if (!isSpawnSpec(spec)) return send(res, 400, { error: "invalid spawn spec" });
|
|
596
|
-
if (!
|
|
645
|
+
if (!fs3.existsSync(spec.cwd)) return send(res, 400, { error: "cwd does not exist" });
|
|
597
646
|
return send(res, 200, registry.spawn(id, spec));
|
|
598
647
|
}
|
|
599
648
|
if (!m[2] && req.method === "GET") {
|
|
@@ -705,8 +754,8 @@ async function startPtyHost(opts = {}) {
|
|
|
705
754
|
await new Promise((r) => server.close(() => r()));
|
|
706
755
|
if (opts.writeInfo !== false) {
|
|
707
756
|
try {
|
|
708
|
-
const cur = JSON.parse(
|
|
709
|
-
if (cur.pid === process.pid)
|
|
757
|
+
const cur = JSON.parse(fs3.readFileSync(hostInfoPath(), "utf-8"));
|
|
758
|
+
if (cur.pid === process.pid) fs3.unlinkSync(hostInfoPath());
|
|
710
759
|
} catch {
|
|
711
760
|
}
|
|
712
761
|
}
|
|
@@ -727,14 +776,14 @@ async function stopHost(kill = killTree, probeTimeoutMs = 5e3) {
|
|
|
727
776
|
}
|
|
728
777
|
if (probe.kind !== "host" || probe.pid !== hostInfo.pid) {
|
|
729
778
|
try {
|
|
730
|
-
|
|
779
|
+
fs4.unlinkSync(hostInfoPath());
|
|
731
780
|
} catch {
|
|
732
781
|
}
|
|
733
782
|
return "stale-file";
|
|
734
783
|
}
|
|
735
784
|
const ok = kill(hostInfo.pid);
|
|
736
785
|
try {
|
|
737
|
-
|
|
786
|
+
fs4.unlinkSync(hostInfoPath());
|
|
738
787
|
} catch {
|
|
739
788
|
}
|
|
740
789
|
return ok ? "stopped" : "failed";
|
|
@@ -823,4 +872,4 @@ export {
|
|
|
823
872
|
ptyHostCommand,
|
|
824
873
|
stopHost
|
|
825
874
|
};
|
|
826
|
-
//# sourceMappingURL=pty-host-
|
|
875
|
+
//# sourceMappingURL=pty-host-HQPWKXVI.js.map
|