@moberg_hr/work-tree 2.0.7 → 2.0.9

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.
Files changed (179) hide show
  1. package/dist/{answer-AX2VHEXS.js → answer-QQAEJ5N3.js} +4 -4
  2. package/dist/{attach-WLJVKXOJ.js → attach-XG3Y7QA7.js} +6 -6
  3. package/dist/bin.js +2 -2
  4. package/dist/{block-NZJC7GVM.js → block-WW4BWDN7.js} +5 -5
  5. package/dist/{broadcast-JPVHPQ6Y.js → broadcast-LEOMDVSA.js} +2 -2
  6. package/dist/{catchup-RUNKM6ZH.js → catchup-UBHGEMED.js} +7 -7
  7. package/dist/{chunk-IOO2OAUC.js → chunk-3R4HBEIG.js} +6 -6
  8. package/dist/{chunk-KZQDONTU.js → chunk-45XJ4JGE.js} +12 -5
  9. package/dist/chunk-45XJ4JGE.js.map +1 -0
  10. package/dist/{chunk-5RRKVAIZ.js → chunk-4KZBZA5D.js} +3 -2
  11. package/dist/chunk-4KZBZA5D.js.map +1 -0
  12. package/dist/{chunk-QWIGFAKZ.js → chunk-4MXWNDH7.js} +6 -5
  13. package/dist/chunk-4MXWNDH7.js.map +1 -0
  14. package/dist/{chunk-CNFPZVNO.js → chunk-5PAPD6VT.js} +6 -2
  15. package/dist/chunk-5PAPD6VT.js.map +1 -0
  16. package/dist/{chunk-EK3WRCQX.js → chunk-6AULWNAN.js} +3 -3
  17. package/dist/{chunk-UI5MPBIH.js → chunk-73J2ZJA6.js} +3 -3
  18. package/dist/{chunk-ES3KY6YT.js → chunk-7IZW6GLY.js} +2 -2
  19. package/dist/chunk-B6V6SV2F.js +9 -0
  20. package/dist/{chunk-DH2PLKCW.js → chunk-BIL3S6XH.js} +4 -4
  21. package/dist/{chunk-7Z2USU3A.js → chunk-BZA7NKWU.js} +2 -2
  22. package/dist/{chunk-DUUH6FPH.js → chunk-G5PN5NIS.js} +28 -4
  23. package/dist/chunk-G5PN5NIS.js.map +1 -0
  24. package/dist/{chunk-J2ZJ2DIJ.js → chunk-GJDXEHII.js} +2 -2
  25. package/dist/{chunk-HB2I7GF7.js → chunk-H2NVIZ3M.js} +3 -3
  26. package/dist/{chunk-65DPISNE.js → chunk-HLXEMPEI.js} +2 -2
  27. package/dist/{chunk-VICXQQ5X.js → chunk-I5CDLVJY.js} +6 -6
  28. package/dist/{chunk-CK2QC2UF.js → chunk-IC5PFQCV.js} +2 -2
  29. package/dist/{chunk-6HDVRMCX.js → chunk-ICVR5M6W.js} +4 -4
  30. package/dist/{chunk-ED7E2WKK.js → chunk-JYWCNLZN.js} +2 -2
  31. package/dist/{chunk-LZHCTPBF.js → chunk-KLK6O54M.js} +3 -3
  32. package/dist/chunk-L6RUHCKB.js +78 -0
  33. package/dist/chunk-L6RUHCKB.js.map +1 -0
  34. package/dist/{chunk-67IZNVDI.js → chunk-LXM7QFBK.js} +2 -2
  35. package/dist/{chunk-YXTJVPOI.js → chunk-OP5ZIVXO.js} +42 -42
  36. package/dist/{chunk-HZEYGMYK.js → chunk-P2U6R35K.js} +3 -3
  37. package/dist/{chunk-LDCY457K.js → chunk-PDF3BZZH.js} +3 -3
  38. package/dist/{chunk-K3ESY6OJ.js → chunk-QKGZ65TC.js} +3 -3
  39. package/dist/{chunk-QDNCUUNQ.js → chunk-QP6LFMMK.js} +28 -20
  40. package/dist/chunk-QP6LFMMK.js.map +1 -0
  41. package/dist/{chunk-N23HFT4X.js → chunk-SDE3BZ6P.js} +244 -54
  42. package/dist/chunk-SDE3BZ6P.js.map +1 -0
  43. package/dist/{chunk-YCDULFF5.js → chunk-SIHAOB4F.js} +3 -3
  44. package/dist/{chunk-MODMK7WQ.js → chunk-ULQQ6SXT.js} +3 -3
  45. package/dist/{chunk-R7BXN427.js → chunk-UNLBHYA5.js} +2 -2
  46. package/dist/{chunk-M2QL43DS.js → chunk-UPR2F7QP.js} +4 -4
  47. package/dist/{chunk-QQJF4R6J.js → chunk-WB2BP2G5.js} +2 -2
  48. package/dist/{chunk-6GCF2XWP.js → chunk-WTR5BUGS.js} +20 -1
  49. package/dist/chunk-WTR5BUGS.js.map +1 -0
  50. package/dist/{chunk-WQMY4AJR.js → chunk-WUWED3LV.js} +2 -2
  51. package/dist/{cleanup-YVQOAMSK.js → cleanup-AEZKR7Q3.js} +16 -15
  52. package/dist/{cleanup-YVQOAMSK.js.map → cleanup-AEZKR7Q3.js.map} +1 -1
  53. package/dist/{cli-VSCHBZRS.js → cli-73A5TR5V.js} +3 -3
  54. package/dist/{config-4W5MMHLU.js → config-RF2S4YBA.js} +6 -6
  55. package/dist/{diff-IDF3K74H.js → diff-2PPFXZD6.js} +4 -4
  56. package/dist/{digest-AXSMYBYS.js → digest-5CRGAAK5.js} +4 -4
  57. package/dist/{fork-ZBEMNEPA.js → fork-W5ZF62UP.js} +15 -13
  58. package/dist/{fork-ZBEMNEPA.js.map → fork-W5ZF62UP.js.map} +1 -1
  59. package/dist/{hook-QMW5HHNP.js → hook-U37AFPKY.js} +4 -4
  60. package/dist/{hydrate-XMHHC5EG.js → hydrate-MAFHTY2W.js} +2 -2
  61. package/dist/{init-J2AB37DO.js → init-CJDDD4AS.js} +6 -6
  62. package/dist/{move-O7NEJZQV.js → move-6J35JMFB.js} +11 -8
  63. package/dist/move-6J35JMFB.js.map +1 -0
  64. package/dist/{note-C4RNIDRJ.js → note-TNC633NG.js} +4 -4
  65. package/dist/{overlaps-SKKGH6EG.js → overlaps-NZL5XFC4.js} +5 -5
  66. package/dist/{pin-TJBCJGPQ.js → pin-E53PGMGD.js} +4 -4
  67. package/dist/{pr-AC44DGJY.js → pr-CBLU6UJ2.js} +5 -5
  68. package/dist/{prune-NQOVBIFT.js → prune-FKNNOITA.js} +15 -14
  69. package/dist/{prune-NQOVBIFT.js.map → prune-FKNNOITA.js.map} +1 -1
  70. package/dist/{pty-host-MQSUN6EI.js → pty-host-36Y4XSPP.js} +14 -7
  71. package/dist/pty-host-36Y4XSPP.js.map +1 -0
  72. package/dist/{read-NU4WZ3J5.js → read-ESOOJSBO.js} +4 -4
  73. package/dist/{recent-ZW4WDGCK.js → recent-3WYFF36X.js} +2 -2
  74. package/dist/{remove-JESX7RCN.js → remove-2CQ4MRSI.js} +14 -13
  75. package/dist/{remove-JESX7RCN.js.map → remove-2CQ4MRSI.js.map} +1 -1
  76. package/dist/{resume-SLNE75JO.js → resume-NDE6NKKT.js} +2 -2
  77. package/dist/{run-MD77Z2BV.js → run-UW4BJCSC.js} +2 -2
  78. package/dist/{screen-RCUGD52V.js → screen-5BLTXIKS.js} +4 -4
  79. package/dist/{search-5GK5HL4Y.js → search-MK6R5VR6.js} +2 -2
  80. package/dist/{section-OAMRNSO7.js → section-B4BWRY7K.js} +4 -4
  81. package/dist/{send-TT6U64HQ.js → send-OT3OXHHW.js} +5 -5
  82. package/dist/{sessions-T6UXM2OX.js → sessions-6BBMLMPQ.js} +12 -10
  83. package/dist/{sessions-T6UXM2OX.js.map → sessions-6BBMLMPQ.js.map} +1 -1
  84. package/dist/{snooze-DBJJD6ZM.js → snooze-A2BVEYWD.js} +4 -4
  85. package/dist/{start-2KUDSMBM.js → start-LEYVJWZG.js} +4 -4
  86. package/dist/{status-S3NZTRG3.js → status-AO653RKW.js} +2 -2
  87. package/dist/{stop-KJHXWYZ2.js → stop-QYIRUR5Y.js} +4 -4
  88. package/dist/{sync-E4CU4IHG.js → sync-FE3AEVOP.js} +15 -14
  89. package/dist/{sync-E4CU4IHG.js.map → sync-FE3AEVOP.js.map} +1 -1
  90. package/dist/{time-MWABXPA6.js → time-4V56YERF.js} +5 -5
  91. package/dist/{tree-RAN6SQKW.js → tree-PA7BK7F6.js} +11 -10
  92. package/dist/{tree-RAN6SQKW.js.map → tree-PA7BK7F6.js.map} +1 -1
  93. package/dist/{update-5DM5V2E3.js → update-EISQJXEI.js} +7 -7
  94. package/dist/{wait-JZIJB6P6.js → wait-FW7RARBV.js} +5 -5
  95. package/dist/wd-bin.js +2 -2
  96. package/dist/web/assets/PtyView-Eh_9_oeq.js +90 -0
  97. package/dist/web/assets/PtyView-Eh_9_oeq.js.map +1 -0
  98. package/dist/web/assets/index-9lt7iidI.css +1 -0
  99. package/dist/web/assets/index-NvjFIXGV.js +118 -0
  100. package/dist/web/assets/index-NvjFIXGV.js.map +1 -0
  101. package/dist/web/index.html +2 -2
  102. package/dist/{web-EUI5U2H4.js → web-EORTIDIA.js} +88 -69
  103. package/dist/web-EORTIDIA.js.map +1 -0
  104. package/npm-shrinkwrap.json +2 -2
  105. package/package.json +1 -1
  106. package/dist/chunk-5RRKVAIZ.js.map +0 -1
  107. package/dist/chunk-6GCF2XWP.js.map +0 -1
  108. package/dist/chunk-C4LRHXEB.js +0 -9
  109. package/dist/chunk-CNFPZVNO.js.map +0 -1
  110. package/dist/chunk-DUUH6FPH.js.map +0 -1
  111. package/dist/chunk-KZQDONTU.js.map +0 -1
  112. package/dist/chunk-N23HFT4X.js.map +0 -1
  113. package/dist/chunk-QDNCUUNQ.js.map +0 -1
  114. package/dist/chunk-QWIGFAKZ.js.map +0 -1
  115. package/dist/move-O7NEJZQV.js.map +0 -1
  116. package/dist/pty-host-MQSUN6EI.js.map +0 -1
  117. package/dist/web/assets/PtyView-Ci395OL2.js +0 -90
  118. package/dist/web/assets/PtyView-Ci395OL2.js.map +0 -1
  119. package/dist/web/assets/index-D-_oxT3O.css +0 -1
  120. package/dist/web/assets/index-DjdfILvB.js +0 -118
  121. package/dist/web/assets/index-DjdfILvB.js.map +0 -1
  122. package/dist/web-EUI5U2H4.js.map +0 -1
  123. /package/dist/{answer-AX2VHEXS.js.map → answer-QQAEJ5N3.js.map} +0 -0
  124. /package/dist/{attach-WLJVKXOJ.js.map → attach-XG3Y7QA7.js.map} +0 -0
  125. /package/dist/{block-NZJC7GVM.js.map → block-WW4BWDN7.js.map} +0 -0
  126. /package/dist/{broadcast-JPVHPQ6Y.js.map → broadcast-LEOMDVSA.js.map} +0 -0
  127. /package/dist/{catchup-RUNKM6ZH.js.map → catchup-UBHGEMED.js.map} +0 -0
  128. /package/dist/{chunk-IOO2OAUC.js.map → chunk-3R4HBEIG.js.map} +0 -0
  129. /package/dist/{chunk-EK3WRCQX.js.map → chunk-6AULWNAN.js.map} +0 -0
  130. /package/dist/{chunk-UI5MPBIH.js.map → chunk-73J2ZJA6.js.map} +0 -0
  131. /package/dist/{chunk-ES3KY6YT.js.map → chunk-7IZW6GLY.js.map} +0 -0
  132. /package/dist/{chunk-C4LRHXEB.js.map → chunk-B6V6SV2F.js.map} +0 -0
  133. /package/dist/{chunk-DH2PLKCW.js.map → chunk-BIL3S6XH.js.map} +0 -0
  134. /package/dist/{chunk-7Z2USU3A.js.map → chunk-BZA7NKWU.js.map} +0 -0
  135. /package/dist/{chunk-J2ZJ2DIJ.js.map → chunk-GJDXEHII.js.map} +0 -0
  136. /package/dist/{chunk-HB2I7GF7.js.map → chunk-H2NVIZ3M.js.map} +0 -0
  137. /package/dist/{chunk-65DPISNE.js.map → chunk-HLXEMPEI.js.map} +0 -0
  138. /package/dist/{chunk-VICXQQ5X.js.map → chunk-I5CDLVJY.js.map} +0 -0
  139. /package/dist/{chunk-CK2QC2UF.js.map → chunk-IC5PFQCV.js.map} +0 -0
  140. /package/dist/{chunk-6HDVRMCX.js.map → chunk-ICVR5M6W.js.map} +0 -0
  141. /package/dist/{chunk-ED7E2WKK.js.map → chunk-JYWCNLZN.js.map} +0 -0
  142. /package/dist/{chunk-LZHCTPBF.js.map → chunk-KLK6O54M.js.map} +0 -0
  143. /package/dist/{chunk-67IZNVDI.js.map → chunk-LXM7QFBK.js.map} +0 -0
  144. /package/dist/{chunk-YXTJVPOI.js.map → chunk-OP5ZIVXO.js.map} +0 -0
  145. /package/dist/{chunk-HZEYGMYK.js.map → chunk-P2U6R35K.js.map} +0 -0
  146. /package/dist/{chunk-LDCY457K.js.map → chunk-PDF3BZZH.js.map} +0 -0
  147. /package/dist/{chunk-K3ESY6OJ.js.map → chunk-QKGZ65TC.js.map} +0 -0
  148. /package/dist/{chunk-YCDULFF5.js.map → chunk-SIHAOB4F.js.map} +0 -0
  149. /package/dist/{chunk-MODMK7WQ.js.map → chunk-ULQQ6SXT.js.map} +0 -0
  150. /package/dist/{chunk-R7BXN427.js.map → chunk-UNLBHYA5.js.map} +0 -0
  151. /package/dist/{chunk-M2QL43DS.js.map → chunk-UPR2F7QP.js.map} +0 -0
  152. /package/dist/{chunk-QQJF4R6J.js.map → chunk-WB2BP2G5.js.map} +0 -0
  153. /package/dist/{chunk-WQMY4AJR.js.map → chunk-WUWED3LV.js.map} +0 -0
  154. /package/dist/{cli-VSCHBZRS.js.map → cli-73A5TR5V.js.map} +0 -0
  155. /package/dist/{config-4W5MMHLU.js.map → config-RF2S4YBA.js.map} +0 -0
  156. /package/dist/{diff-IDF3K74H.js.map → diff-2PPFXZD6.js.map} +0 -0
  157. /package/dist/{digest-AXSMYBYS.js.map → digest-5CRGAAK5.js.map} +0 -0
  158. /package/dist/{hook-QMW5HHNP.js.map → hook-U37AFPKY.js.map} +0 -0
  159. /package/dist/{hydrate-XMHHC5EG.js.map → hydrate-MAFHTY2W.js.map} +0 -0
  160. /package/dist/{init-J2AB37DO.js.map → init-CJDDD4AS.js.map} +0 -0
  161. /package/dist/{note-C4RNIDRJ.js.map → note-TNC633NG.js.map} +0 -0
  162. /package/dist/{overlaps-SKKGH6EG.js.map → overlaps-NZL5XFC4.js.map} +0 -0
  163. /package/dist/{pin-TJBCJGPQ.js.map → pin-E53PGMGD.js.map} +0 -0
  164. /package/dist/{pr-AC44DGJY.js.map → pr-CBLU6UJ2.js.map} +0 -0
  165. /package/dist/{read-NU4WZ3J5.js.map → read-ESOOJSBO.js.map} +0 -0
  166. /package/dist/{recent-ZW4WDGCK.js.map → recent-3WYFF36X.js.map} +0 -0
  167. /package/dist/{resume-SLNE75JO.js.map → resume-NDE6NKKT.js.map} +0 -0
  168. /package/dist/{run-MD77Z2BV.js.map → run-UW4BJCSC.js.map} +0 -0
  169. /package/dist/{screen-RCUGD52V.js.map → screen-5BLTXIKS.js.map} +0 -0
  170. /package/dist/{search-5GK5HL4Y.js.map → search-MK6R5VR6.js.map} +0 -0
  171. /package/dist/{section-OAMRNSO7.js.map → section-B4BWRY7K.js.map} +0 -0
  172. /package/dist/{send-TT6U64HQ.js.map → send-OT3OXHHW.js.map} +0 -0
  173. /package/dist/{snooze-DBJJD6ZM.js.map → snooze-A2BVEYWD.js.map} +0 -0
  174. /package/dist/{start-2KUDSMBM.js.map → start-LEYVJWZG.js.map} +0 -0
  175. /package/dist/{status-S3NZTRG3.js.map → status-AO653RKW.js.map} +0 -0
  176. /package/dist/{stop-KJHXWYZ2.js.map → stop-QYIRUR5Y.js.map} +0 -0
  177. /package/dist/{time-MWABXPA6.js.map → time-4V56YERF.js.map} +0 -0
  178. /package/dist/{update-5DM5V2E3.js.map → update-EISQJXEI.js.map} +0 -0
  179. /package/dist/{wait-JZIJB6P6.js.map → wait-FW7RARBV.js.map} +0 -0
@@ -1,14 +1,14 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  createDigestSource
4
- } from "./chunk-HZEYGMYK.js";
5
- import "./chunk-R7BXN427.js";
4
+ } from "./chunk-P2U6R35K.js";
5
+ import "./chunk-UNLBHYA5.js";
6
6
  import {
7
7
  askWorkWeb
8
8
  } from "./chunk-WVZ56EJC.js";
9
9
  import {
10
10
  formatWorked
11
- } from "./chunk-DUUH6FPH.js";
11
+ } from "./chunk-G5PN5NIS.js";
12
12
  import "./chunk-WF57CF7A.js";
13
13
  import "./chunk-TOQZODGI.js";
14
14
  import "./chunk-RCYI7SRA.js";
@@ -97,4 +97,4 @@ export {
97
97
  digestCommand,
98
98
  parseSince
99
99
  };
100
- //# sourceMappingURL=digest-AXSMYBYS.js.map
100
+ //# sourceMappingURL=digest-5CRGAAK5.js.map
@@ -4,37 +4,39 @@ import {
4
4
  forkSession,
5
5
  startSessionWithPrompt,
6
6
  uncommittedFiles
7
- } from "./chunk-M2QL43DS.js";
8
- import "./chunk-6HDVRMCX.js";
7
+ } from "./chunk-UPR2F7QP.js";
8
+ import "./chunk-ICVR5M6W.js";
9
9
  import {
10
10
  attachSession
11
- } from "./chunk-CK2QC2UF.js";
11
+ } from "./chunk-IC5PFQCV.js";
12
12
  import "./chunk-AH5TM3NB.js";
13
- import "./chunk-N23HFT4X.js";
14
- import "./chunk-LZHCTPBF.js";
13
+ import "./chunk-SDE3BZ6P.js";
14
+ import "./chunk-KLK6O54M.js";
15
15
  import "./chunk-BLLLVWEB.js";
16
+ import "./chunk-L6RUHCKB.js";
16
17
  import "./chunk-G6IJ76DW.js";
17
18
  import {
18
19
  askCatchUp,
19
20
  catchUp,
20
21
  catchUpFacts
21
- } from "./chunk-YCDULFF5.js";
22
- import "./chunk-EK3WRCQX.js";
23
- import "./chunk-65DPISNE.js";
22
+ } from "./chunk-SIHAOB4F.js";
23
+ import "./chunk-6AULWNAN.js";
24
+ import "./chunk-HLXEMPEI.js";
24
25
  import "./chunk-H5LKMR45.js";
25
- import "./chunk-67IZNVDI.js";
26
+ import "./chunk-LXM7QFBK.js";
26
27
  import {
27
28
  findSessionForCwd
28
- } from "./chunk-ED7E2WKK.js";
29
+ } from "./chunk-JYWCNLZN.js";
29
30
  import "./chunk-ZSHWP2VS.js";
30
31
  import "./chunk-JJRPLNLN.js";
31
32
  import "./chunk-HUXS3VAI.js";
32
33
  import "./chunk-7NAXFBFI.js";
33
- import "./chunk-5RRKVAIZ.js";
34
+ import "./chunk-5PAPD6VT.js";
35
+ import "./chunk-4KZBZA5D.js";
34
36
  import {
35
37
  findSession,
36
38
  loadHistory
37
- } from "./chunk-DUUH6FPH.js";
39
+ } from "./chunk-G5PN5NIS.js";
38
40
  import {
39
41
  sessionIdFor
40
42
  } from "./chunk-WF57CF7A.js";
@@ -117,4 +119,4 @@ var forkCommand = {
117
119
  export {
118
120
  forkCommand
119
121
  };
120
- //# sourceMappingURL=fork-ZBEMNEPA.js.map
122
+ //# sourceMappingURL=fork-W5ZF62UP.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/commands/fork.ts"],"sourcesContent":["import chalk from 'chalk';\nimport type { CommandModule } from 'yargs';\nimport { askCatchUp, catchUpFacts } from '../core/conversations/catch-up-deps.js';\nimport { catchUp } from '../core/conversations/catch-up.js';\nimport { forkSession } from '../core/sessions/fork.js';\nimport { defaultForkDeps, uncommittedFiles } from '../core/sessions/fork-deps.js';\nimport { findSession, loadHistory } from '../core/sessions/history.js';\nimport { findSessionForCwd } from '../core/comments/pending-delivery.js';\nimport { sessionIdFor } from '../core/sessions/session-id.js';\nimport { startSessionWithPrompt } from '../core/sessions/session-start.js';\nimport { attachSession } from './shared/attach-session.js';\n\n/**\n * `work fork <new-branch>` — the dashboard's Fork… (core/fork.ts) from a\n * terminal: a new branch and worktree from where this session is, its Claude\n * started with a summary of this conversation; then this terminal is\n * attached to it, as `work tree` does (`--no-attach`: start it and leave it).\n */\nexport const forkCommand: CommandModule = {\n command: 'fork <branch>',\n describe: 'Fork the current session: a new branch from where it is, its Claude given a summary of this conversation',\n builder: (yargs) =>\n yargs\n .positional('branch', { type: 'string', demandOption: true, describe: 'The new branch' })\n .option('target', { type: 'string', describe: 'The session to fork: its repo or group (default: the session for this folder)' })\n .option('from', { type: 'string', describe: \"With --target: the session's branch\" })\n .option('prompt', { type: 'string', describe: 'What to try in the fork (default: read the summary and wait)' })\n .option('name', { type: 'string', describe: 'A name for the new session' })\n .option('attach', {\n type: 'boolean',\n default: true,\n describe: 'Attach this terminal to the new Claude (--no-attach: start it in the PTY host and return)',\n }),\n handler: async (argv) => {\n const history = loadHistory();\n const target = argv.target as string | undefined;\n const from = argv.from as string | undefined;\n if (!!target !== !!from) {\n console.error(chalk.red('Give both --target and --from, or neither (the session for this folder).'));\n process.exitCode = 1;\n return;\n }\n const parent = target && from ? findSession(history, target, from) : findSessionForCwd(process.cwd(), history);\n if (!parent) {\n console.error(\n chalk.red(target ? `No session for ${target} ${from}.` : 'This folder is not inside a work session: pass --target and --from.'),\n );\n process.exitCode = 1;\n return;\n }\n const branch = argv.branch as string;\n const attach = argv.attach !== false;\n let firstPrompt: string | null = null;\n console.log(chalk.cyan(`Forking ${parent.target} · ${parent.branch} into ${branch}…`));\n const r = await forkSession(\n parent,\n { branch, prompt: argv.prompt as string | undefined, name: argv.name as string | undefined },\n defaultForkDeps({\n summarize: async (s) => {\n console.log(chalk.gray('Writing a summary of the conversation…'));\n return (await catchUp(s, askCatchUp, catchUpFacts(sessionIdFor(s))))?.text ?? null;\n },\n uncommitted: uncommittedFiles,\n // Attaching starts it with the prompt (below); otherwise the host starts it now.\n start: async (id, prompt) => {\n firstPrompt = prompt;\n if (!attach) await startSessionWithPrompt(id, prompt);\n },\n }),\n );\n if (!r.ok) {\n console.error(chalk.red(`Not forked: ${r.error}`));\n process.exitCode = 1;\n return;\n }\n console.log(\n chalk.green(`Forked into ${r.paths.join(', ')}`) +\n chalk.gray(r.summarized ? ' — its Claude gets a summary of this conversation.' : ' — no recent conversation to summarize.'),\n );\n const fork = findSession(loadHistory(), parent.target, branch);\n if (r.startError || !fork) {\n console.error(\n chalk.yellow(`Its Claude didn't start: ${r.startError ?? 'session not found'}. Run \\`work tree ${parent.target} ${branch}\\`.`),\n );\n process.exitCode = 1;\n return;\n }\n if (!attach) {\n console.log(chalk.gray(`Running in the PTY host: \\`work attach ${parent.target} ${branch}\\` to see it.`));\n return;\n }\n process.exitCode = await attachSession(fork, { initialPrompt: firstPrompt ?? undefined, forwardEnv: true });\n },\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,WAAW;AAkBX,IAAM,cAA6B;AAAA,EACxC,SAAS;AAAA,EACT,UAAU;AAAA,EACV,SAAS,CAAC,UACR,MACG,WAAW,UAAU,EAAE,MAAM,UAAU,cAAc,MAAM,UAAU,iBAAiB,CAAC,EACvF,OAAO,UAAU,EAAE,MAAM,UAAU,UAAU,gFAAgF,CAAC,EAC9H,OAAO,QAAQ,EAAE,MAAM,UAAU,UAAU,sCAAsC,CAAC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OAAQ,OAAM,uBAAuB,IAAI,MAAM;AAAA,QACtD;AAAA,MACF,CAAC;AAAA,IACH;AACA,QAAI,CAAC,EAAE,IAAI;AACT,cAAQ,MAAM,MAAM,IAAI,eAAe,EAAE,KAAK,EAAE,CAAC;AACjD,cAAQ,WAAW;AACnB;AAAA,IACF;AACA,YAAQ;AAAA,MACN,MAAM,MAAM,eAAe,EAAE,MAAM,KAAK,IAAI,CAAC,EAAE,IAC7C,MAAM,KAAK,EAAE,aAAa,4DAAuD,8CAAyC;AAAA,IAC9H;AACA,UAAM,OAAO,YAAY,YAAY,GAAG,OAAO,QAAQ,MAAM;AAC7D,QAAI,EAAE,cAAc,CAAC,MAAM;AACzB,cAAQ;AAAA,QACN,MAAM,OAAO,4BAA4B,EAAE,cAAc,mBAAmB,qBAAqB,OAAO,MAAM,IAAI,MAAM,KAAK;AAAA,MAC/H;AACA,cAAQ,WAAW;AACnB;AAAA,IACF;AACA,QAAI,CAAC,QAAQ;AACX,cAAQ,IAAI,MAAM,KAAK,0CAA0C,OAAO,MAAM,IAAI,MAAM,eAAe,CAAC;AACxG;AAAA,IACF;AACA,YAAQ,WAAW,MAAM,cAAc,MAAM,EAAE,eAAe,eAAe,QAAW,YAAY,KAAK,CAAC;AAAA,EAC5G;AACF;","names":[]}
1
+ {"version":3,"sources":["../src/commands/fork.ts"],"sourcesContent":["import chalk from 'chalk';\nimport type { CommandModule } from 'yargs';\nimport { askCatchUp, catchUpFacts } from '../core/conversations/catch-up-deps.js';\nimport { catchUp } from '../core/conversations/catch-up.js';\nimport { forkSession } from '../core/sessions/fork.js';\nimport { defaultForkDeps, uncommittedFiles } from '../core/sessions/fork-deps.js';\nimport { findSession, loadHistory } from '../core/sessions/history.js';\nimport { findSessionForCwd } from '../core/comments/pending-delivery.js';\nimport { sessionIdFor } from '../core/sessions/session-id.js';\nimport { startSessionWithPrompt } from '../core/sessions/session-start.js';\nimport { attachSession } from './shared/attach-session.js';\n\n/**\n * `work fork <new-branch>` — the dashboard's Fork… (core/fork.ts) from a\n * terminal: a new branch and worktree from where this session is, its Claude\n * started with a summary of this conversation; then this terminal is\n * attached to it, as `work tree` does (`--no-attach`: start it and leave it).\n */\nexport const forkCommand: CommandModule = {\n command: 'fork <branch>',\n describe: 'Fork the current session: a new branch from where it is, its Claude given a summary of this conversation',\n builder: (yargs) =>\n yargs\n .positional('branch', { type: 'string', demandOption: true, describe: 'The new branch' })\n .option('target', { type: 'string', describe: 'The session to fork: its repo or group (default: the session for this folder)' })\n .option('from', { type: 'string', describe: \"With --target: the session's branch\" })\n .option('prompt', { type: 'string', describe: 'What to try in the fork (default: read the summary and wait)' })\n .option('name', { type: 'string', describe: 'A name for the new session' })\n .option('attach', {\n type: 'boolean',\n default: true,\n describe: 'Attach this terminal to the new Claude (--no-attach: start it in the PTY host and return)',\n }),\n handler: async (argv) => {\n const history = loadHistory();\n const target = argv.target as string | undefined;\n const from = argv.from as string | undefined;\n if (!!target !== !!from) {\n console.error(chalk.red('Give both --target and --from, or neither (the session for this folder).'));\n process.exitCode = 1;\n return;\n }\n const parent = target && from ? findSession(history, target, from) : findSessionForCwd(process.cwd(), history);\n if (!parent) {\n console.error(\n chalk.red(target ? `No session for ${target} ${from}.` : 'This folder is not inside a work session: pass --target and --from.'),\n );\n process.exitCode = 1;\n return;\n }\n const branch = argv.branch as string;\n const attach = argv.attach !== false;\n let firstPrompt: string | null = null;\n console.log(chalk.cyan(`Forking ${parent.target} · ${parent.branch} into ${branch}…`));\n const r = await forkSession(\n parent,\n { branch, prompt: argv.prompt as string | undefined, name: argv.name as string | undefined },\n defaultForkDeps({\n summarize: async (s) => {\n console.log(chalk.gray('Writing a summary of the conversation…'));\n return (await catchUp(s, askCatchUp, catchUpFacts(sessionIdFor(s))))?.text ?? null;\n },\n uncommitted: uncommittedFiles,\n // Attaching starts it with the prompt (below); otherwise the host starts it now.\n start: async (id, prompt) => {\n firstPrompt = prompt;\n if (!attach) await startSessionWithPrompt(id, prompt);\n },\n }),\n );\n if (!r.ok) {\n console.error(chalk.red(`Not forked: ${r.error}`));\n process.exitCode = 1;\n return;\n }\n console.log(\n chalk.green(`Forked into ${r.paths.join(', ')}`) +\n chalk.gray(r.summarized ? ' — its Claude gets a summary of this conversation.' : ' — no recent conversation to summarize.'),\n );\n const fork = findSession(loadHistory(), parent.target, branch);\n if (r.startError || !fork) {\n console.error(\n chalk.yellow(`Its Claude didn't start: ${r.startError ?? 'session not found'}. Run \\`work tree ${parent.target} ${branch}\\`.`),\n );\n process.exitCode = 1;\n return;\n }\n if (!attach) {\n console.log(chalk.gray(`Running in the PTY host: \\`work attach ${parent.target} ${branch}\\` to see it.`));\n return;\n }\n process.exitCode = await attachSession(fork, { initialPrompt: firstPrompt ?? undefined, forwardEnv: true });\n },\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,WAAW;AAkBX,IAAM,cAA6B;AAAA,EACxC,SAAS;AAAA,EACT,UAAU;AAAA,EACV,SAAS,CAAC,UACR,MACG,WAAW,UAAU,EAAE,MAAM,UAAU,cAAc,MAAM,UAAU,iBAAiB,CAAC,EACvF,OAAO,UAAU,EAAE,MAAM,UAAU,UAAU,gFAAgF,CAAC,EAC9H,OAAO,QAAQ,EAAE,MAAM,UAAU,UAAU,sCAAsC,CAAC,EAClF,OAAO,UAAU,EAAE,MAAM,UAAU,UAAU,+DAA+D,CAAC,EAC7G,OAAO,QAAQ,EAAE,MAAM,UAAU,UAAU,6BAA6B,CAAC,EACzE,OAAO,UAAU;AAAA,IAChB,MAAM;AAAA,IACN,SAAS;AAAA,IACT,UAAU;AAAA,EACZ,CAAC;AAAA,EACL,SAAS,OAAO,SAAS;AACvB,UAAM,UAAU,YAAY;AAC5B,UAAM,SAAS,KAAK;AACpB,UAAM,OAAO,KAAK;AAClB,QAAI,CAAC,CAAC,WAAW,CAAC,CAAC,MAAM;AACvB,cAAQ,MAAM,MAAM,IAAI,0EAA0E,CAAC;AACn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EAAE,cAAc,CAAC,MAAM;AACzB,cAAQ;AAAA,QACN,MAAM,OAAO,4BAA4B,EAAE,cAAc,mBAAmB,qBAAqB,OAAO,MAAM,IAAI,MAAM,KAAK;AAAA,MAC/H;AACA,cAAQ,WAAW;AACnB;AAAA,IACF;AACA,QAAI,CAAC,QAAQ;AACX,cAAQ,IAAI,MAAM,KAAK,0CAA0C,OAAO,MAAM,IAAI,MAAM,eAAe,CAAC;AACxG;AAAA,IACF;AACA,YAAQ,WAAW,MAAM,cAAc,MAAM,EAAE,eAAe,eAAe,QAAW,YAAY,KAAK,CAAC;AAAA,EAC5G;AACF;","names":[]}
@@ -8,14 +8,14 @@ import {
8
8
  } from "./chunk-WVZ56EJC.js";
9
9
  import {
10
10
  readAssistantContext
11
- } from "./chunk-67IZNVDI.js";
11
+ } from "./chunk-LXM7QFBK.js";
12
12
  import {
13
13
  claimForDelivery,
14
14
  findSessionForCwd,
15
15
  formatPendingForPrompt,
16
16
  readPendingForWorktree,
17
17
  resolveAddressed
18
- } from "./chunk-ED7E2WKK.js";
18
+ } from "./chunk-JYWCNLZN.js";
19
19
  import "./chunk-ZSHWP2VS.js";
20
20
  import "./chunk-JJRPLNLN.js";
21
21
  import "./chunk-HUXS3VAI.js";
@@ -24,7 +24,7 @@ import {
24
24
  bestEffortAsync,
25
25
  readSessionActivity,
26
26
  recordStatusEvent
27
- } from "./chunk-DUUH6FPH.js";
27
+ } from "./chunk-G5PN5NIS.js";
28
28
  import {
29
29
  sessionIdFor
30
30
  } from "./chunk-WF57CF7A.js";
@@ -223,4 +223,4 @@ export {
223
223
  runTurnHook,
224
224
  statusEventFor
225
225
  };
226
- //# sourceMappingURL=hook-QMW5HHNP.js.map
226
+ //# sourceMappingURL=hook-U37AFPKY.js.map
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-7NAXFBFI.js";
5
5
  import {
6
6
  mergeHydratedSessions
7
- } from "./chunk-DUUH6FPH.js";
7
+ } from "./chunk-G5PN5NIS.js";
8
8
  import "./chunk-WF57CF7A.js";
9
9
  import "./chunk-TOQZODGI.js";
10
10
  import "./chunk-RCYI7SRA.js";
@@ -118,4 +118,4 @@ var hydrateCommand = {
118
118
  export {
119
119
  hydrateCommand
120
120
  };
121
- //# sourceMappingURL=hydrate-XMHHC5EG.js.map
121
+ //# sourceMappingURL=hydrate-MAFHTY2W.js.map
@@ -7,7 +7,7 @@ import {
7
7
  import {
8
8
  DEFAULT_COPY_FILES,
9
9
  suggestFolders
10
- } from "./chunk-LDCY457K.js";
10
+ } from "./chunk-PDF3BZZH.js";
11
11
  import {
12
12
  isGitRepo
13
13
  } from "./chunk-7NAXFBFI.js";
@@ -15,10 +15,10 @@ import {
15
15
  enrollProblem,
16
16
  scanForRepos,
17
17
  suggestAlias
18
- } from "./chunk-7Z2USU3A.js";
19
- import "./chunk-CNFPZVNO.js";
20
- import "./chunk-5RRKVAIZ.js";
21
- import "./chunk-DUUH6FPH.js";
18
+ } from "./chunk-BZA7NKWU.js";
19
+ import "./chunk-5PAPD6VT.js";
20
+ import "./chunk-4KZBZA5D.js";
21
+ import "./chunk-G5PN5NIS.js";
22
22
  import "./chunk-WF57CF7A.js";
23
23
  import {
24
24
  KNOWN_TOOLS
@@ -184,4 +184,4 @@ var initCommand = {
184
184
  export {
185
185
  initCommand
186
186
  };
187
- //# sourceMappingURL=init-J2AB37DO.js.map
187
+ //# sourceMappingURL=init-CJDDD4AS.js.map
@@ -1,8 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  createInProcess
4
- } from "./chunk-6HDVRMCX.js";
5
- import "./chunk-N23HFT4X.js";
4
+ } from "./chunk-ICVR5M6W.js";
5
+ import "./chunk-SDE3BZ6P.js";
6
+ import "./chunk-L6RUHCKB.js";
6
7
  import {
7
8
  findHost
8
9
  } from "./chunk-G6IJ76DW.js";
@@ -15,15 +16,15 @@ import "./chunk-7NAXFBFI.js";
15
16
  import {
16
17
  originUrl,
17
18
  readGitConfig
18
- } from "./chunk-7Z2USU3A.js";
19
- import "./chunk-CNFPZVNO.js";
19
+ } from "./chunk-BZA7NKWU.js";
20
+ import "./chunk-5PAPD6VT.js";
20
21
  import {
21
22
  defaultRunner
22
- } from "./chunk-5RRKVAIZ.js";
23
+ } from "./chunk-4KZBZA5D.js";
23
24
  import {
24
25
  loadHistory,
25
26
  saveHistory
26
- } from "./chunk-DUUH6FPH.js";
27
+ } from "./chunk-G5PN5NIS.js";
27
28
  import {
28
29
  replaceDb,
29
30
  sessionIdFor,
@@ -85,7 +86,9 @@ function exportBundle(dest, now = /* @__PURE__ */ new Date()) {
85
86
  snapshotDb(path.join(dest, "state.db"));
86
87
  fs.copyFileSync(getConfigPath(), path.join(dest, "config.json"));
87
88
  for (const dir of ["conversations", "archive"]) {
88
- if (exists(path.join(home, dir))) fs.cpSync(path.join(home, dir), path.join(dest, dir), { recursive: true });
89
+ const from = path.join(home, dir);
90
+ const notIgnored = (src) => dir !== "archive" || path.relative(from, src).split(path.sep)[1] !== "ignored";
91
+ if (exists(from)) fs.cpSync(from, path.join(dest, dir), { recursive: true, filter: notIgnored });
89
92
  }
90
93
  for (const f of fs.readdirSync(home).filter((n) => n.endsWith(".claude.md"))) {
91
94
  fs.mkdirSync(path.join(dest, "instructions"), { recursive: true });
@@ -306,4 +309,4 @@ var moveCommand = {
306
309
  export {
307
310
  moveCommand
308
311
  };
309
- //# sourceMappingURL=move-O7NEJZQV.js.map
312
+ //# sourceMappingURL=move-6J35JMFB.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/commands/move.ts","../src/core/move/move.ts"],"sourcesContent":["import path from 'node:path';\nimport chalk from 'chalk';\nimport type { CommandModule } from 'yargs';\nimport { exportBundle, importBundle, MoveError, runningHere, unsavedWork } from '../core/move/move.js';\nimport { loadHistory } from '../core/sessions/history.js';\n\n/**\n * `work move export <dir>` / `work move import <dir>` — take your sessions,\n * conversations and setup to another computer (core/move/move.ts).\n */\nexport const moveCommand: CommandModule = {\n command: 'move <action> <dir>',\n describe: 'Move work to another computer: export a bundle here, import it there',\n builder: (y) =>\n y\n .positional('action', { choices: ['export', 'import'] as const, describe: 'export a bundle here, or import one' })\n .positional('dir', { type: 'string', describe: 'The bundle folder (new for export)' })\n .option('force', { type: 'boolean', describe: 'export: even with work not pushed; import: replace the sessions here' })\n .option('repos-root', { type: 'string', describe: 'import: where the repos are on this computer (each in its folder name)' })\n .option('worktrees-root', { type: 'string', describe: 'import: where worktrees go on this computer' })\n .option('clone', { type: 'boolean', describe: \"import: clone repos that aren't here from their origin\" }),\n handler: async (argv) => {\n const dir = path.resolve(argv.dir as string);\n try {\n if (argv.action === 'export') {\n const unsaved = await unsavedWork(loadHistory());\n if (unsaved.length) {\n console.log(chalk.yellow(\"Work that's only on this computer (the other one gets worktrees from origin):\"));\n for (const u of unsaved) console.log(` ${u.session}: ${u.what} ${chalk.gray(u.path)}`);\n if (!argv.force) {\n console.log(chalk.gray('Commit and push it (or ask its Claude), then export again — or --force to leave it behind.'));\n process.exitCode = 1;\n return;\n }\n }\n const r = exportBundle(dir);\n console.log(chalk.green(`Exported ${r.sessions} session(s) and ${r.transcripts} conversation file(s) to ${r.dir}`));\n console.log(chalk.gray('Copy the folder to the other computer and run `work move import <folder>` there (with work web stopped).'));\n return;\n }\n const running = await runningHere();\n if (running.length) {\n console.error(chalk.red(`Stop ${running.join(' and ')} first: an import replaces the database they hold.`));\n process.exitCode = 1;\n return;\n }\n const r = await importBundle(dir, {\n force: argv.force === true,\n clone: argv.clone === true,\n reposRoot: typeof argv['repos-root'] === 'string' ? path.resolve(argv['repos-root']) : undefined,\n worktreesRoot: typeof argv['worktrees-root'] === 'string' ? path.resolve(argv['worktrees-root']) : undefined,\n });\n console.log(chalk.green(`Imported ${r.sessions} session(s); ${r.transcripts} conversation file(s) put back for Claude.`));\n if (r.repos.cloned.length) console.log(`Cloned: ${r.repos.cloned.join(', ')}`);\n if (r.repos.missing.length)\n console.log(chalk.yellow(`Not on this computer: ${r.repos.missing.join(', ')} — clone them (or run again with --clone).`));\n if (r.worktrees.created.length) console.log(`Worktrees recreated: ${r.worktrees.created.join(', ')}`);\n for (const f of r.worktrees.failed) console.log(chalk.yellow(` ${f.session}: ${f.error}`));\n console.log(chalk.gray('Start `work web`: sessions resume their conversations when you open them.'));\n } catch (err) {\n if (!(err instanceof MoveError)) throw err;\n console.error(chalk.red(err.message));\n process.exitCode = 1;\n }\n },\n};\n","import fs from 'node:fs';\nimport os from 'node:os';\nimport path from 'node:path';\nimport { getConfigDir, getConfigPath, loadConfig } from '../platform/config.js';\nimport { replaceDb, snapshotDb, withDb } from '../platform/db.js';\nimport { atomicWriteFile } from '../platform/fs-safe.js';\nimport { loadHistory, saveHistory, type WorktreeSession } from '../sessions/history.js';\nimport { sessionIdFor } from '../sessions/session-id.js';\nimport { agentOf } from '../agents/index.js';\nimport { originUrl, readGitConfig } from '../worktree/repo-scan.js';\nimport { defaultRunner, type CommandRunner } from '../pr/ship.js';\nimport { createInProcess, type CreateWorktree } from '../worktree/setup-child.js';\nimport { readWebUrl, webServerResponds } from '../platform/web-discovery.js';\nimport { findHost } from '../pty/pty-host-client.js';\n\n/**\n * Moving work to another computer (`work move export` / `import`). A bundle\n * is a folder you carry over (OneDrive, a USB stick): a snapshot of\n * state.db, config.json, work's own conversation copies and archives, the\n * groups' instruction files, every live session's agent transcripts, and a\n * manifest with each repo's origin. Never `~/.work` itself live in a synced\n * folder: syncing a database corrupts it, and two computers would both run\n * the PR and Jira watches.\n *\n * Import writes it all back with paths moved to the new computer (another\n * home folder, or other repo / worktree roots), clones repos that aren't\n * there (`--clone`), recreates live sessions' worktrees from their branches\n * on origin — so export first checks nothing is uncommitted or unpushed —\n * and puts the transcripts back where the agent looks, so conversations\n * resume. Checkpoint refs and wd's own review scopes stay behind (they live\n * in the old repos, keyed by old paths).\n */\n\nexport const BUNDLE_VERSION = 1;\n\nexport interface MoveManifest {\n version: number;\n exportedAt: string;\n from: { home: string; platform: string; worktreesRoot: string };\n /** Each repo's folder and origin URL, so a missing one can be cloned. */\n repos: Record<string, { path: string; origin: string | null }>;\n sessions: Array<{ id: string; target: string; branch: string; archived: boolean; transcripts: number }>;\n}\n\n/** A refusal, in words for the CLI. */\nexport class MoveError extends Error {}\n\nconst exists = (p: string) => fs.existsSync(p);\n\n// ---- before export: what wouldn't survive the move -------------------------------\n\nexport interface Unsaved {\n session: string;\n repo: string;\n path: string;\n what: string;\n}\n\n/**\n * Work only this computer has, per live session's repo: uncommitted files,\n * commits not on origin. Import recreates worktrees from origin, so these\n * would stay behind.\n */\nexport async function unsavedWork(sessions: WorktreeSession[], run: CommandRunner = defaultRunner): Promise<Unsaved[]> {\n const out: Unsaved[] = [];\n for (const s of sessions) {\n if (s.archivedAt) continue;\n for (const p of s.paths) {\n if (!exists(p)) continue;\n const at = { session: `${s.target} · ${s.branch || '(its checkout)'}`, repo: s.isGroup ? path.basename(p) : s.target, path: p };\n const status = await run('git', ['status', '--porcelain'], p);\n const dirty = status.code === 0 ? status.stdout.split('\\n').filter((l) => l.trim()).length : 0;\n if (dirty) out.push({ ...at, what: `${dirty} uncommitted file${dirty === 1 ? '' : 's'}` });\n const branch = (await run('git', ['rev-parse', '--abbrev-ref', 'HEAD'], p)).stdout.trim();\n if (!branch || branch === 'HEAD') continue;\n const onOrigin = (await run('git', ['rev-parse', '--verify', '--quiet', `refs/remotes/origin/${branch}`], p)).code === 0;\n const against = onOrigin ? `origin/${branch}` : 'origin/HEAD';\n const ahead = Number((await run('git', ['rev-list', '--count', `${against}..HEAD`], p)).stdout.trim()) || 0;\n if (ahead)\n out.push({ ...at, what: `${ahead} commit${ahead === 1 ? '' : 's'} not pushed${onOrigin ? '' : ` (${branch} isn't on origin)`}` });\n }\n }\n return out;\n}\n\n// ---- export ------------------------------------------------------------------------\n\nexport interface ExportResult {\n dir: string;\n sessions: number;\n transcripts: number;\n}\n\n/** Write the bundle into `dest` (a new or empty folder). */\nexport function exportBundle(dest: string, now = new Date()): ExportResult {\n if (exists(dest) && fs.readdirSync(dest).length) throw new MoveError(`${dest} isn't empty: give a new folder`);\n const home = getConfigDir();\n const config = loadConfig();\n if (!config) throw new MoveError('nothing to move: work has no config here');\n fs.mkdirSync(dest, { recursive: true });\n snapshotDb(path.join(dest, 'state.db'));\n fs.copyFileSync(getConfigPath(), path.join(dest, 'config.json'));\n for (const dir of ['conversations', 'archive']) {\n const from = path.join(home, dir);\n // An archive's copied git-ignored files (archive-ignored.ts) can hold secrets: they stay\n // on this computer, not in a bundle meant for a stick or a synced folder.\n const notIgnored = (src: string) => dir !== 'archive' || path.relative(from, src).split(path.sep)[1] !== 'ignored';\n if (exists(from)) fs.cpSync(from, path.join(dest, dir), { recursive: true, filter: notIgnored });\n }\n for (const f of fs.readdirSync(home).filter((n) => n.endsWith('.claude.md'))) {\n fs.mkdirSync(path.join(dest, 'instructions'), { recursive: true });\n fs.copyFileSync(path.join(home, f), path.join(dest, 'instructions', f));\n }\n\n const history = loadHistory();\n let transcripts = 0;\n const sessions: MoveManifest['sessions'] = [];\n for (const s of history) {\n const id = sessionIdFor(s);\n // An archived session's conversation is in its archive already.\n const files = s.archivedAt ? [] : (agentOf(s).conversation?.files(s) ?? []);\n for (const f of files) {\n fs.mkdirSync(path.join(dest, 'transcripts', id), { recursive: true });\n fs.copyFileSync(f.file, path.join(dest, 'transcripts', id, path.basename(f.file)));\n }\n transcripts += files.length;\n sessions.push({ id, target: s.target, branch: s.branch, archived: !!s.archivedAt, transcripts: files.length });\n }\n const repos: MoveManifest['repos'] = {};\n for (const [alias, p] of Object.entries(config.repos)) {\n repos[alias] = { path: p, origin: originUrl(readGitConfig(p) ?? '') };\n }\n const manifest: MoveManifest = {\n version: BUNDLE_VERSION,\n exportedAt: now.toISOString(),\n from: { home: os.homedir(), platform: process.platform, worktreesRoot: config.worktreesRoot },\n repos,\n sessions,\n };\n fs.writeFileSync(path.join(dest, 'manifest.json'), JSON.stringify(manifest, null, 2));\n return { dir: dest, sessions: history.length, transcripts };\n}\n\n// ---- paths on the new computer (pure) ---------------------------------------------\n\nexport interface PathRule {\n from: string;\n to: string;\n}\n\nconst norm = (p: string, caseless: boolean) => {\n const n = p.replace(/\\\\/g, '/').replace(/\\/+$/, '');\n return caseless ? n.toLowerCase() : n;\n};\n\n/**\n * Where things go: the worktrees root and each repo to the folders given\n * (`--worktrees-root`, `--repos-root` + its folder name), else the same\n * place under the new home folder; anything else under the old home moves\n * with it. Longest first, so the most specific rule wins. Pure.\n */\nexport function remapRules(\n m: Pick<MoveManifest, 'from' | 'repos'>,\n opts: { reposRoot?: string; worktreesRoot?: string },\n newHome: string,\n join: (...parts: string[]) => string = path.join,\n): PathRule[] {\n const caseless = m.from.platform === 'win32';\n const homeSwap = (p: string) => remapPath(p, [{ from: m.from.home, to: newHome }], caseless, join);\n const base = (p: string) =>\n p\n .replace(/[\\\\/]+$/, '')\n .split(/[\\\\/]/)\n .pop() ?? p;\n const rules: PathRule[] = [\n { from: m.from.worktreesRoot, to: opts.worktreesRoot ?? homeSwap(m.from.worktreesRoot) },\n ...Object.values(m.repos).map((r) => ({ from: r.path, to: opts.reposRoot ? join(opts.reposRoot, base(r.path)) : homeSwap(r.path) })),\n { from: m.from.home, to: newHome },\n ];\n return rules.sort((a, b) => b.from.length - a.from.length);\n}\n\n/** `p` under the first rule whose folder holds it, written for this computer; unchanged when none does. Pure. */\nexport function remapPath(p: string, rules: PathRule[], caseless: boolean, join: (...parts: string[]) => string = path.join): string {\n const key = norm(p, caseless);\n for (const r of rules) {\n const from = norm(r.from, caseless);\n if (key !== from && !key.startsWith(`${from}/`)) continue;\n const rest = p.replace(/\\\\/g, '/').slice(from.length).split('/').filter(Boolean);\n return rest.length ? join(r.to, ...rest) : r.to;\n }\n return p;\n}\n\n/** A session with its paths (and per-repo bases, keyed by path) moved. Pure. */\nexport function remapSession(s: WorktreeSession, move: (p: string) => string): WorktreeSession {\n const out: WorktreeSession = { ...s, paths: s.paths.map(move) };\n if (s.baseBranches) out.baseBranches = Object.fromEntries(Object.entries(s.baseBranches).map(([p, b]) => [move(p), b]));\n return out;\n}\n\n// ---- import ------------------------------------------------------------------------\n\n/**\n * What holds the database open here and must stop before an import replaces\n * it: work web, the PTY host. A host that doesn't answer counts as running.\n */\nexport async function runningHere(): Promise<string[]> {\n const out: string[] = [];\n const url = readWebUrl();\n if (url && (await webServerResponds(url))) out.push('work web (`work web --stop`)');\n try {\n if (await findHost()) out.push('the PTY host (`work pty-host --stop`)');\n } catch {\n out.push('the PTY host (`work pty-host --stop`)');\n }\n return out;\n}\n\nexport function readManifest(dir: string): MoveManifest {\n let raw: unknown;\n try {\n raw = JSON.parse(fs.readFileSync(path.join(dir, 'manifest.json'), 'utf-8'));\n } catch {\n throw new MoveError(`${dir} isn't a work bundle (no manifest.json): make one with \\`work move export\\``);\n }\n const m = raw as MoveManifest;\n if (!m || typeof m !== 'object' || typeof m.from?.home !== 'string' || typeof m.repos !== 'object')\n throw new MoveError(`${dir}/manifest.json isn't one work can read`);\n if (m.version > BUNDLE_VERSION) throw new MoveError(`this bundle is from a newer work (v${m.version}): update work first`);\n if (!exists(path.join(dir, 'state.db')) || !exists(path.join(dir, 'config.json')))\n throw new MoveError(`${dir} is missing state.db or config.json`);\n return m;\n}\n\nexport interface ImportOptions {\n reposRoot?: string;\n worktreesRoot?: string;\n /** Clone repos that aren't on this computer, from their origin. */\n clone?: boolean;\n /** Replace what this computer has already. */\n force?: boolean;\n}\n\nexport interface ImportReport {\n sessions: number;\n repos: { cloned: string[]; missing: string[] };\n worktrees: { created: string[]; failed: Array<{ session: string; error: string }> };\n transcripts: number;\n}\n\nexport interface ImportDeps {\n run: CommandRunner;\n create: CreateWorktree;\n /** Where a session's agent looks for its conversations (null: it starts fresh). */\n restoreDir: (s: WorktreeSession) => string | null;\n}\n\nconst defaultImportDeps = (): ImportDeps => ({\n run: defaultRunner,\n create: createInProcess,\n restoreDir: (s) => agentOf(s).conversation?.restoreDir?.(s) ?? null,\n});\n\n/** Bring a bundle in. The caller makes sure no work web or PTY host runs (they hold the database). */\nexport async function importBundle(dir: string, opts: ImportOptions = {}, deps: ImportDeps = defaultImportDeps()): Promise<ImportReport> {\n const m = readManifest(dir);\n if (!opts.force && exists(getConfigPath()) && loadHistory().length)\n throw new MoveError('work here has sessions already; importing replaces them (--force to do it anyway)');\n const caseless = m.from.platform === 'win32';\n const rules = remapRules(m, opts, os.homedir());\n const move = (p: string) => remapPath(p, rules, caseless);\n\n // config.json, as JSON: keys this version doesn't know come along.\n const raw = JSON.parse(fs.readFileSync(path.join(dir, 'config.json'), 'utf-8')) as Record<string, unknown>;\n if (typeof raw.worktreesRoot === 'string') raw.worktreesRoot = move(raw.worktreesRoot);\n if (raw.repos && typeof raw.repos === 'object')\n raw.repos = Object.fromEntries(\n Object.entries(raw.repos as Record<string, unknown>).map(([a, p]) => [a, typeof p === 'string' ? move(p) : p]),\n );\n for (const key of ['scanRoots', 'ignoredRepos'])\n if (Array.isArray(raw[key])) raw[key] = (raw[key] as unknown[]).map((p) => (typeof p === 'string' ? move(p) : p));\n fs.mkdirSync(getConfigDir(), { recursive: true });\n atomicWriteFile(getConfigPath(), JSON.stringify(raw, null, 2));\n\n // The database, then its sessions' paths. Its Claudes start when you open them here.\n replaceDb(path.join(dir, 'state.db'));\n const history = loadHistory().map((s) => remapSession(s, move));\n saveHistory(history);\n withDb((d) => d.prepare('DELETE FROM pty_sessions').run());\n\n // work's own files.\n for (const sub of ['conversations', 'archive'])\n if (exists(path.join(dir, sub))) fs.cpSync(path.join(dir, sub), path.join(getConfigDir(), sub), { recursive: true, force: false });\n if (exists(path.join(dir, 'instructions')))\n for (const f of fs.readdirSync(path.join(dir, 'instructions')))\n fs.copyFileSync(path.join(dir, 'instructions', f), path.join(getConfigDir(), f));\n\n const report: ImportReport = {\n sessions: history.length,\n repos: { cloned: [], missing: [] },\n worktrees: { created: [], failed: [] },\n transcripts: 0,\n };\n const config = loadConfig()!;\n for (const [alias, p] of Object.entries(config.repos)) {\n if (exists(p)) continue;\n const origin = m.repos[alias]?.origin;\n if (opts.clone && origin) {\n fs.mkdirSync(path.dirname(p), { recursive: true });\n const r = await deps.run('git', ['clone', origin, p], path.dirname(p));\n if (r.code === 0) {\n report.repos.cloned.push(alias);\n continue;\n }\n }\n report.repos.missing.push(alias);\n }\n\n // Live sessions get their worktrees back, from their branches on origin.\n const missing = new Set(report.repos.missing);\n for (const s of history) {\n if (s.archivedAt || !s.branch || s.paths.every(exists)) continue;\n const label = `${s.target} · ${s.branch}`;\n const repos = s.isGroup ? (config.groups[s.target] ?? []) : [s.target];\n if (repos.some((r) => missing.has(r))) {\n report.worktrees.failed.push({ session: label, error: `its repo isn't here (${repos.filter((r) => missing.has(r)).join(', ')})` });\n continue;\n }\n // A repo's own checkout (`work tree <repo>`) comes with the repo.\n if (!s.isGroup && config.repos[s.target] && s.paths[0] === config.repos[s.target]) continue;\n const r = await deps.create({ target: s.target, branch: s.branch }, config);\n if (r.ok) report.worktrees.created.push(label);\n else report.worktrees.failed.push({ session: label, error: r.error });\n }\n\n // Conversations back where the agent looks, so they resume.\n for (const s of loadHistory()) {\n const from = path.join(dir, 'transcripts', sessionIdFor(s));\n const to = exists(from) ? deps.restoreDir(s) : null;\n if (!to) continue;\n fs.mkdirSync(to, { recursive: true });\n for (const f of fs.readdirSync(from)) {\n if (exists(path.join(to, f))) continue;\n fs.copyFileSync(path.join(from, f), path.join(to, f));\n report.transcripts++;\n }\n }\n return report;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAOA,WAAU;AACjB,OAAO,WAAW;;;ACDlB,OAAO,QAAQ;AACf,OAAO,QAAQ;AACf,OAAO,UAAU;AA+BV,IAAM,iBAAiB;AAYvB,IAAM,YAAN,cAAwB,MAAM;AAAC;AAEtC,IAAM,SAAS,CAAC,MAAc,GAAG,WAAW,CAAC;AAgB7C,eAAsB,YAAY,UAA6B,MAAqB,eAAmC;AACrH,QAAM,MAAiB,CAAC;AACxB,aAAW,KAAK,UAAU;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ACrG,CAAC;AACD,cAAQ,IAAI,MAAM,MAAM,YAAY,EAAE,QAAQ,gBAAgB,EAAE,WAAW,4CAA4C,CAAC;AACxH,UAAI,EAAE,MAAM,OAAO,OAAQ,SAAQ,IAAI,WAAW,EAAE,MAAM,OAAO,KAAK,IAAI,CAAC,EAAE;AAC7E,UAAI,EAAE,MAAM,QAAQ;AAClB,gBAAQ,IAAI,MAAM,OAAO,yBAAyB,EAAE,MAAM,QAAQ,KAAK,IAAI,CAAC,iDAA4C,CAAC;AAC3H,UAAI,EAAE,UAAU,QAAQ,OAAQ,SAAQ,IAAI,wBAAwB,EAAE,UAAU,QAAQ,KAAK,IAAI,CAAC,EAAE;AACpG,iBAAW,KAAK,EAAE,UAAU,OAAQ,SAAQ,IAAI,MAAM,OAAO,KAAK,EAAE,OAAO,KAAK,EAAE,KAAK,EAAE,CAAC;AAC1F,cAAQ,IAAI,MAAM,KAAK,2EAA2E,CAAC;AAAA,IACrG,SAAS,KAAK;AACZ,UAAI,EAAE,eAAe,WAAY,OAAM;AACvC,cAAQ,MAAM,MAAM,IAAI,IAAI,OAAO,CAAC;AACpC,cAAQ,WAAW;AAAA,IACrB;AAAA,EACF;AACF;","names":["path","r","path","r"]}
@@ -8,13 +8,13 @@ import {
8
8
  import {
9
9
  sessionFromArgs,
10
10
  sessionPositionals
11
- } from "./chunk-MODMK7WQ.js";
11
+ } from "./chunk-ULQQ6SXT.js";
12
12
  import "./chunk-6AQRYLOB.js";
13
- import "./chunk-ED7E2WKK.js";
13
+ import "./chunk-JYWCNLZN.js";
14
14
  import "./chunk-ZSHWP2VS.js";
15
15
  import "./chunk-JJRPLNLN.js";
16
16
  import "./chunk-HUXS3VAI.js";
17
- import "./chunk-DUUH6FPH.js";
17
+ import "./chunk-G5PN5NIS.js";
18
18
  import {
19
19
  sessionIdFor
20
20
  } from "./chunk-WF57CF7A.js";
@@ -75,4 +75,4 @@ var noteCommand = {
75
75
  export {
76
76
  noteCommand
77
77
  };
78
- //# sourceMappingURL=note-C4RNIDRJ.js.map
78
+ //# sourceMappingURL=note-TNC633NG.js.map
@@ -1,13 +1,13 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  scanChanges
4
- } from "./chunk-K3ESY6OJ.js";
5
- import "./chunk-HB2I7GF7.js";
4
+ } from "./chunk-QKGZ65TC.js";
5
+ import "./chunk-H2NVIZ3M.js";
6
6
  import "./chunk-AKMPF72Y.js";
7
- import "./chunk-5RRKVAIZ.js";
7
+ import "./chunk-4KZBZA5D.js";
8
8
  import {
9
9
  loadHistory
10
- } from "./chunk-DUUH6FPH.js";
10
+ } from "./chunk-G5PN5NIS.js";
11
11
  import {
12
12
  sessionIdFor
13
13
  } from "./chunk-WF57CF7A.js";
@@ -53,4 +53,4 @@ var overlapsCommand = {
53
53
  export {
54
54
  overlapsCommand
55
55
  };
56
- //# sourceMappingURL=overlaps-SKKGH6EG.js.map
56
+ //# sourceMappingURL=overlaps-NZL5XFC4.js.map
@@ -5,13 +5,13 @@ import {
5
5
  import {
6
6
  sessionFromArgs,
7
7
  sessionPositionals
8
- } from "./chunk-MODMK7WQ.js";
8
+ } from "./chunk-ULQQ6SXT.js";
9
9
  import "./chunk-6AQRYLOB.js";
10
- import "./chunk-ED7E2WKK.js";
10
+ import "./chunk-JYWCNLZN.js";
11
11
  import "./chunk-ZSHWP2VS.js";
12
12
  import "./chunk-JJRPLNLN.js";
13
13
  import "./chunk-HUXS3VAI.js";
14
- import "./chunk-DUUH6FPH.js";
14
+ import "./chunk-G5PN5NIS.js";
15
15
  import {
16
16
  sessionIdFor
17
17
  } from "./chunk-WF57CF7A.js";
@@ -42,4 +42,4 @@ var pinCommand = {
42
42
  export {
43
43
  pinCommand
44
44
  };
45
- //# sourceMappingURL=pin-TJBCJGPQ.js.map
45
+ //# sourceMappingURL=pin-E53PGMGD.js.map
@@ -3,20 +3,20 @@ import {
3
3
  listReplies,
4
4
  postDrafts,
5
5
  saveDraft
6
- } from "./chunk-6GCF2XWP.js";
6
+ } from "./chunk-WTR5BUGS.js";
7
7
  import {
8
8
  readWebUrl
9
9
  } from "./chunk-WVZ56EJC.js";
10
10
  import {
11
11
  findSessionForCwd
12
- } from "./chunk-ED7E2WKK.js";
12
+ } from "./chunk-JYWCNLZN.js";
13
13
  import "./chunk-ZSHWP2VS.js";
14
14
  import "./chunk-JJRPLNLN.js";
15
15
  import "./chunk-HUXS3VAI.js";
16
16
  import {
17
17
  defaultRunner
18
- } from "./chunk-5RRKVAIZ.js";
19
- import "./chunk-DUUH6FPH.js";
18
+ } from "./chunk-4KZBZA5D.js";
19
+ import "./chunk-G5PN5NIS.js";
20
20
  import {
21
21
  sessionIdFor
22
22
  } from "./chunk-WF57CF7A.js";
@@ -119,4 +119,4 @@ var prCommand = {
119
119
  export {
120
120
  prCommand
121
121
  };
122
- //# sourceMappingURL=pr-AC44DGJY.js.map
122
+ //# sourceMappingURL=pr-CBLU6UJ2.js.map
@@ -5,30 +5,31 @@ import {
5
5
  } from "./chunk-ABQYKTG4.js";
6
6
  import {
7
7
  defaultCleanupDeps
8
- } from "./chunk-IOO2OAUC.js";
9
- import "./chunk-QDNCUUNQ.js";
10
- import "./chunk-6GCF2XWP.js";
8
+ } from "./chunk-3R4HBEIG.js";
9
+ import "./chunk-QP6LFMMK.js";
10
+ import "./chunk-WTR5BUGS.js";
11
11
  import {
12
12
  applyCleanup,
13
13
  scanCleanup
14
14
  } from "./chunk-AKMPF72Y.js";
15
- import "./chunk-N23HFT4X.js";
16
- import "./chunk-LZHCTPBF.js";
15
+ import "./chunk-SDE3BZ6P.js";
16
+ import "./chunk-KLK6O54M.js";
17
17
  import "./chunk-BLLLVWEB.js";
18
+ import "./chunk-L6RUHCKB.js";
18
19
  import "./chunk-G6IJ76DW.js";
19
- import "./chunk-R7BXN427.js";
20
- import "./chunk-EK3WRCQX.js";
21
- import "./chunk-65DPISNE.js";
20
+ import "./chunk-UNLBHYA5.js";
21
+ import "./chunk-6AULWNAN.js";
22
+ import "./chunk-HLXEMPEI.js";
22
23
  import "./chunk-H5LKMR45.js";
23
- import "./chunk-67IZNVDI.js";
24
- import "./chunk-ED7E2WKK.js";
24
+ import "./chunk-LXM7QFBK.js";
25
+ import "./chunk-JYWCNLZN.js";
25
26
  import "./chunk-ZSHWP2VS.js";
26
27
  import "./chunk-JJRPLNLN.js";
27
28
  import "./chunk-HUXS3VAI.js";
28
29
  import "./chunk-7NAXFBFI.js";
29
- import "./chunk-CNFPZVNO.js";
30
- import "./chunk-5RRKVAIZ.js";
31
- import "./chunk-DUUH6FPH.js";
30
+ import "./chunk-5PAPD6VT.js";
31
+ import "./chunk-4KZBZA5D.js";
32
+ import "./chunk-G5PN5NIS.js";
32
33
  import "./chunk-WF57CF7A.js";
33
34
  import "./chunk-TOQZODGI.js";
34
35
  import "./chunk-RCYI7SRA.js";
@@ -89,4 +90,4 @@ var pruneCommand = {
89
90
  export {
90
91
  pruneCommand
91
92
  };
92
- //# sourceMappingURL=prune-NQOVBIFT.js.map
93
+ //# sourceMappingURL=prune-FKNNOITA.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/commands/prune.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { checkbox } from '@inquirer/prompts';\nimport type { CommandModule } from 'yargs';\nimport { ensureConfig } from '../core/platform/config.js';\nimport { applyCleanup, scanCleanup } from '../core/cleanup/cleanup.js';\nimport { defaultCleanupDeps } from '../core/cleanup/cleanup-deps.js';\nimport type { CleanupCandidate } from '../core/api-types.js';\nimport { printCleanupResults, removable } from './shared/cleanup-print.js';\n\nexport const pruneCommand: CommandModule = {\n command: 'prune',\n describe: 'Remove worktrees that are merged (or never committed to), picking from a list',\n builder: (yargs) =>\n yargs.option('force', {\n describe: 'Skip the picker and remove every one that is safe to remove',\n type: 'boolean',\n default: false,\n }),\n handler: async (argv) => {\n const force = argv.force as boolean;\n ensureConfig();\n const deps = defaultCleanupDeps();\n console.log(chalk.gray('Fetching and checking worktrees…\\n'));\n const scan = await scanCleanup(deps);\n for (const f of scan.fetchFailed) console.log(chalk.yellow(` Could not fetch ${f.alias}; its worktrees were not checked: ${f.error}`));\n // Interactive prune is human-confirmed (you see the list and pick), so\n // squash-merged branches are offered too.\n const candidates = removable(scan.candidates, { includeSquash: true });\n if (candidates.length === 0) {\n console.log(chalk.green('Nothing to prune: no worktree is merged, clean and unused for a day.'));\n return;\n }\n const label = (c: CleanupCandidate) => `${c.target}: ${c.branch}${c.isGroup ? ' [group]' : ''} — ${c.reason}`;\n let selected: CleanupCandidate[];\n if (force) {\n selected = candidates;\n console.log(chalk.cyan(`Removing ${selected.length} worktree(s):`));\n for (const c of selected) console.log(` ${label(c)}`);\n } else {\n selected = await checkbox({\n message: 'Select worktrees to remove (the branches are kept)',\n choices: candidates.map((c) => ({ name: label(c), value: c, checked: true })),\n pageSize: Math.min(candidates.length, 25),\n });\n if (selected.length === 0) {\n console.log(chalk.yellow('Nothing selected.'));\n return;\n }\n }\n console.log('');\n const results = await applyCleanup(\n deps,\n selected.map((c) => ({ sessionId: c.sessionId, action: c.verdict === 'gone' ? 'forget' : 'delete' })),\n );\n printCleanupResults(selected, results);\n },\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,WAAW;AAClB,SAAS,gBAAgB;AAQlB,IAAM,eAA8B;AAAA,EACzC,SAAS;AAAA,EACT,UAAU;AAAA,EACV,SAAS,CAAC,UACR,MAAM,OAAO,SAAS;AAAA,IACpB,UAAU;AAAA,IACV,MAAM;AAAA,IACN,SAAS;AAAA,EACX,CAAC;AAAA,EACH,SAAS,OAAO,SAAS;AACvB,UAAM,QAAQ,KAAK;AACnB,iBAAa;AACb,UAAM,OAAO,mBAAmB;AAChC,YAAQ,IAAI,MAAM,KAAK,yCAAoC,CAAC;AAC5D,UAAM,OAAO,MAAM,YAAY,IAAI;AACnC,eAAW,KAAK,KAAK,YAAa,SAAQ,IAAI,MAAM,OAAO,qBAAqB,EAAE,KAAK,qCAAqC,EAAE,KAAK,EAAE,CAAC;AAGtI,UAAM,aAAa,UAAU,KAAK,YAAY,EAAE,eAAe,KAAK,CAAC;AACrE,QAAI,WAAW,WAAW,GAAG;AAC3B,cAAQ,IAAI,MAAM,MAAM,sEAAsE,CAAC;AAC/F;AAAA,IACF;AACA,UAAM,QAAQ,CAAC,MAAwB,GAAG,EAAE,MAAM,KAAK,EAAE,MAAM,GAAG,EAAE,UAAU,aAAa,EAAE,WAAM,EAAE,MAAM;AAC3G,QAAI;AACJ,QAAI,OAAO;AACT,iBAAW;AACX,cAAQ,IAAI,MAAM,KAAK,YAAY,SAAS,MAAM,eAAe,CAAC;AAClE,iBAAW,KAAK,SAAU,SAAQ,IAAI,KAAK,MAAM,CAAC,CAAC,EAAE;AAAA,IACvD,OAAO;AACL,iBAAW,MAAM,SAAS;AAAA,QACxB,SAAS;AAAA,QACT,SAAS,WAAW,IAAI,CAAC,OAAO,EAAE,MAAM,MAAM,CAAC,GAAG,OAAO,GAAG,SAAS,KAAK,EAAE;AAAA,QAC5E,UAAU,KAAK,IAAI,WAAW,QAAQ,EAAE;AAAA,MAC1C,CAAC;AACD,UAAI,SAAS,WAAW,GAAG;AACzB,gBAAQ,IAAI,MAAM,OAAO,mBAAmB,CAAC;AAC7C;AAAA,MACF;AAAA,IACF;AACA,YAAQ,IAAI,EAAE;AACd,UAAM,UAAU,MAAM;AAAA,MACpB;AAAA,MACA,SAAS,IAAI,CAAC,OAAO,EAAE,WAAW,EAAE,WAAW,QAAQ,EAAE,YAAY,SAAS,WAAW,SAAS,EAAE;AAAA,IACtG;AACA,wBAAoB,UAAU,OAAO;AAAA,EACvC;AACF;","names":[]}
1
+ {"version":3,"sources":["../src/commands/prune.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { checkbox } from '@inquirer/prompts';\nimport type { CommandModule } from 'yargs';\nimport { ensureConfig } from '../core/platform/config.js';\nimport { applyCleanup, scanCleanup } from '../core/cleanup/cleanup.js';\nimport { defaultCleanupDeps } from '../core/cleanup/cleanup-deps.js';\nimport type { CleanupCandidate } from '../core/api-types.js';\nimport { printCleanupResults, removable } from './shared/cleanup-print.js';\n\nexport const pruneCommand: CommandModule = {\n command: 'prune',\n describe: 'Remove worktrees that are merged (or never committed to), picking from a list',\n builder: (yargs) =>\n yargs.option('force', {\n describe: 'Skip the picker and remove every one that is safe to remove',\n type: 'boolean',\n default: false,\n }),\n handler: async (argv) => {\n const force = argv.force as boolean;\n ensureConfig();\n const deps = defaultCleanupDeps();\n console.log(chalk.gray('Fetching and checking worktrees…\\n'));\n const scan = await scanCleanup(deps);\n for (const f of scan.fetchFailed) console.log(chalk.yellow(` Could not fetch ${f.alias}; its worktrees were not checked: ${f.error}`));\n // Interactive prune is human-confirmed (you see the list and pick), so\n // squash-merged branches are offered too.\n const candidates = removable(scan.candidates, { includeSquash: true });\n if (candidates.length === 0) {\n console.log(chalk.green('Nothing to prune: no worktree is merged, clean and unused for a day.'));\n return;\n }\n const label = (c: CleanupCandidate) => `${c.target}: ${c.branch}${c.isGroup ? ' [group]' : ''} — ${c.reason}`;\n let selected: CleanupCandidate[];\n if (force) {\n selected = candidates;\n console.log(chalk.cyan(`Removing ${selected.length} worktree(s):`));\n for (const c of selected) console.log(` ${label(c)}`);\n } else {\n selected = await checkbox({\n message: 'Select worktrees to remove (the branches are kept)',\n choices: candidates.map((c) => ({ name: label(c), value: c, checked: true })),\n pageSize: Math.min(candidates.length, 25),\n });\n if (selected.length === 0) {\n console.log(chalk.yellow('Nothing selected.'));\n return;\n }\n }\n console.log('');\n const results = await applyCleanup(\n deps,\n selected.map((c) => ({ sessionId: c.sessionId, action: c.verdict === 'gone' ? 'forget' : 'delete' })),\n );\n printCleanupResults(selected, results);\n },\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,WAAW;AAClB,SAAS,gBAAgB;AAQlB,IAAM,eAA8B;AAAA,EACzC,SAAS;AAAA,EACT,UAAU;AAAA,EACV,SAAS,CAAC,UACR,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CAAC,OAAO,EAAE,WAAW,EAAE,WAAW,QAAQ,EAAE,YAAY,SAAS,WAAW,SAAS,EAAE;AAAA,IACtG;AACA,wBAAoB,UAAU,OAAO;AAAA,EACvC;AACF;","names":[]}
@@ -25,7 +25,7 @@ import {
25
25
  loadHistory,
26
26
  logSwallowed,
27
27
  swallow
28
- } from "./chunk-DUUH6FPH.js";
28
+ } from "./chunk-G5PN5NIS.js";
29
29
  import {
30
30
  sessionIdFor
31
31
  } from "./chunk-WF57CF7A.js";
@@ -490,17 +490,24 @@ var PtyRegistry = class {
490
490
  const e = this.entries.get(id);
491
491
  if (!e) return;
492
492
  this.entries.delete(id);
493
+ const attached = [...e.exitSubscribers];
493
494
  e.subscribers.clear();
494
495
  e.exitSubscribers.clear();
495
- const exited = e.pty.exited ? Promise.resolve() : new Promise((resolve) => {
496
- const timer = setTimeout(resolve, timeoutMs);
497
- e.pty.onExit = () => {
496
+ const exited = e.pty.exited ? Promise.resolve(e.exitCode ?? 0) : new Promise((resolve) => {
497
+ const timer = setTimeout(() => resolve(0), timeoutMs);
498
+ e.pty.onExit = (code2) => {
498
499
  clearTimeout(timer);
499
- resolve();
500
+ resolve(code2);
500
501
  };
501
502
  });
502
503
  e.pty.dispose();
503
- await Promise.all([exited, this.persist()]);
504
+ const [code] = await Promise.all([exited, this.persist()]);
505
+ for (const cb of attached) {
506
+ try {
507
+ cb(code);
508
+ } catch {
509
+ }
510
+ }
504
511
  }
505
512
  /**
506
513
  * Respawn everything in the persisted list. Called once at host startup.
@@ -872,4 +879,4 @@ export {
872
879
  ptyHostCommand,
873
880
  stopHost
874
881
  };
875
- //# sourceMappingURL=pty-host-MQSUN6EI.js.map
882
+ //# sourceMappingURL=pty-host-36Y4XSPP.js.map