claude-code-best 1.1.0 → 1.2.1

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 (542) hide show
  1. package/README.md +66 -75
  2. package/dist/chunk-03hxwxzh.js +344 -0
  3. package/dist/chunk-07069jq1.js +30 -0
  4. package/dist/{chunk-kq098bkj.js → chunk-08g51x43.js} +254 -320
  5. package/dist/{chunk-7tqhx6dr.js → chunk-093r60b7.js} +109 -213
  6. package/dist/{chunk-ahjgghpe.js → chunk-0aya4737.js} +1 -1
  7. package/dist/{chunk-b4mnbry0.js → chunk-0fsdxz74.js} +4 -4
  8. package/dist/chunk-0jzdwbdc.js +14 -0
  9. package/dist/chunk-0mbxeb5q.js +406 -0
  10. package/dist/chunk-0pryepme.js +66 -0
  11. package/dist/chunk-0qsm7jac.js +169 -0
  12. package/dist/{chunk-1cbn5kxf.js → chunk-0rpb2bdp.js} +3 -2
  13. package/dist/chunk-0se7sxd4.js +38 -0
  14. package/dist/{chunk-3m7ge6tj.js → chunk-0xnepnph.js} +14 -12
  15. package/dist/{chunk-q7tvkc86.js → chunk-0zsam7pn.js} +10 -115
  16. package/dist/{chunk-44fpr6jq.js → chunk-168xb8v1.js} +4 -2
  17. package/dist/{chunk-bj0rvnjw.js → chunk-19h3a9pw.js} +40 -30
  18. package/dist/chunk-19wjkpe7.js +115 -0
  19. package/dist/{chunk-wsqhnjj3.js → chunk-1atfzck5.js} +24 -24
  20. package/dist/{chunk-0e1xsncc.js → chunk-1cwdhk7a.js} +1 -1
  21. package/dist/{chunk-c8jv6rtj.js → chunk-1hq59w8z.js} +78 -69
  22. package/dist/chunk-1qzk963z.js +108 -0
  23. package/dist/{chunk-fk06pejm.js → chunk-1rrmvwjn.js} +9 -9
  24. package/dist/{chunk-d18z9pna.js → chunk-1thgdca1.js} +2 -2
  25. package/dist/chunk-1tjnmcw7.js +68 -0
  26. package/dist/chunk-1xj83yc8.js +219 -0
  27. package/dist/chunk-21j2jfen.js +435 -0
  28. package/dist/{chunk-wc6wwwyb.js → chunk-21z7acxh.js} +3 -3
  29. package/dist/chunk-22gbbc5x.js +313 -0
  30. package/dist/chunk-238g70xa.js +1 -1
  31. package/dist/{chunk-vpb723tx.js → chunk-23ad5t92.js} +5 -5
  32. package/dist/{chunk-vbbf707n.js → chunk-24r3gfks.js} +39 -29
  33. package/dist/chunk-24sahbec.js +71 -0
  34. package/dist/chunk-28az45r7.js +112 -0
  35. package/dist/{chunk-9g827w4j.js → chunk-2q39ej51.js} +6 -6
  36. package/dist/chunk-2qwgfjcj.js +5370 -0
  37. package/dist/{chunk-0cpnzx7t.js → chunk-2rgvd09y.js} +118 -151
  38. package/dist/chunk-2wq8q15s.js +475 -0
  39. package/dist/{chunk-bqq4zamw.js → chunk-2ys5wcxk.js} +3 -3
  40. package/dist/{chunk-t24ytdcw.js → chunk-31nce7eh.js} +12 -10
  41. package/dist/chunk-31q6p2ke.js +123 -0
  42. package/dist/chunk-3394wc12.js +1024 -0
  43. package/dist/{chunk-33khw5gy.js → chunk-365zvqv3.js} +7 -7
  44. package/dist/{chunk-9g2ncq68.js → chunk-36gkb95k.js} +124 -128
  45. package/dist/{chunk-khdjg2v9.js → chunk-37y42ayh.js} +39 -29
  46. package/dist/chunk-3816xd5p.js +195 -0
  47. package/dist/chunk-3a6bynts.js +656 -0
  48. package/dist/{chunk-qvd0k5dn.js → chunk-3avfhw6x.js} +190 -348
  49. package/dist/{chunk-660kcy7p.js → chunk-3b25ycrx.js} +14 -8
  50. package/dist/chunk-3b4xhwhp.js +113 -0
  51. package/dist/chunk-3fjzvf0e.js +128 -0
  52. package/dist/chunk-3fvc0a79.js +67 -0
  53. package/dist/chunk-3g50kcwk.js +513 -0
  54. package/dist/chunk-3jnmy0nd.js +114 -0
  55. package/dist/chunk-3jzsxj3v.js +310 -0
  56. package/dist/{chunk-frbv3xqa.js → chunk-3mpfxbab.js} +2 -2
  57. package/dist/{chunk-aqa7w38f.js → chunk-3v03e2kz.js} +5 -5
  58. package/dist/chunk-3x5hdd5g.js +1030 -0
  59. package/dist/{chunk-mecs0gpc.js → chunk-3xv7rjsy.js} +14 -11
  60. package/dist/{chunk-j3215c49.js → chunk-3ygnhge8.js} +232 -372
  61. package/dist/chunk-42x5tjk2.js +42 -0
  62. package/dist/chunk-430tvx8d.js +110 -0
  63. package/dist/{chunk-dh6c8y1j.js → chunk-43h8sw5x.js} +3 -3
  64. package/dist/chunk-44d150tz.js +1175 -0
  65. package/dist/chunk-45dj834r.js +115 -0
  66. package/dist/{chunk-yhd82045.js → chunk-46fcr28b.js} +30 -9
  67. package/dist/{chunk-wm2f2f1z.js → chunk-474y75ga.js} +2 -2
  68. package/dist/{chunk-6fkwz9yk.js → chunk-478rpnqm.js} +8 -8
  69. package/dist/{chunk-83z0wrnz.js → chunk-47j9e6m2.js} +2 -2
  70. package/dist/chunk-47wqjw88.js +112 -0
  71. package/dist/{chunk-v4t6dyyh.js → chunk-4cp6193g.js} +2 -2
  72. package/dist/chunk-4h102wt5.js +65 -0
  73. package/dist/{chunk-3mgywd32.js → chunk-4hv90qcz.js} +1 -1
  74. package/dist/chunk-4k2270je.js +295 -0
  75. package/dist/{chunk-2wcbcdky.js → chunk-4k842par.js} +5 -5
  76. package/dist/chunk-4nspekjp.js +69 -0
  77. package/dist/chunk-4pjqtps4.js +151 -0
  78. package/dist/chunk-4sehjy27.js +112 -0
  79. package/dist/{chunk-pgnnrm2v.js → chunk-4t86n23n.js} +21 -17
  80. package/dist/{chunk-2de1vaxf.js → chunk-4whfjn78.js} +68 -78
  81. package/dist/{chunk-41mpwc8h.js → chunk-53c9gb9c.js} +19 -15
  82. package/dist/chunk-53kt8caz.js +122 -0
  83. package/dist/chunk-5a6ahhvy.js +594 -0
  84. package/dist/{chunk-12pv5fez.js → chunk-5gbqknz6.js} +10 -8
  85. package/dist/{chunk-hfzj1m07.js → chunk-5kkvfgzs.js} +14 -5
  86. package/dist/{chunk-4ycz58wj.js → chunk-5pxygepg.js} +68 -8
  87. package/dist/{chunk-2w8633e3.js → chunk-5rgbq3kf.js} +61 -100
  88. package/dist/{chunk-ggqx30m9.js → chunk-5z28bqne.js} +23 -311
  89. package/dist/{chunk-7ejt5gqq.js → chunk-5z8w2q5k.js} +65 -48
  90. package/dist/chunk-60k6v40t.js +70 -0
  91. package/dist/{chunk-p7g7pf3f.js → chunk-61ahbn23.js} +8 -6
  92. package/dist/{chunk-rmbp2das.js → chunk-64pp4hsr.js} +21 -19
  93. package/dist/{chunk-0sb5scxx.js → chunk-652wnf1z.js} +5 -5
  94. package/dist/{chunk-q25bjaev.js → chunk-677as3nh.js} +2 -2
  95. package/dist/{chunk-xs0hwvpa.js → chunk-68pfxvxt.js} +14 -9
  96. package/dist/{chunk-epmheefa.js → chunk-69hys77v.js} +8 -8
  97. package/dist/{chunk-427m88ms.js → chunk-6p1cptq5.js} +9 -9
  98. package/dist/{chunk-0nqrscrr.js → chunk-6p3mtny2.js} +5 -5
  99. package/dist/{chunk-v1mgv1et.js → chunk-6p4cyhb3.js} +4 -3
  100. package/dist/{chunk-m17y8b22.js → chunk-6rxz872v.js} +39 -29
  101. package/dist/chunk-6sjxvthw.js +106 -0
  102. package/dist/{chunk-6mz58s8p.js → chunk-6xana182.js} +18 -14
  103. package/dist/{chunk-vaebptnz.js → chunk-6zn3fm1k.js} +39 -29
  104. package/dist/chunk-704jkbsp.js +183 -0
  105. package/dist/chunk-71sf47by.js +154 -0
  106. package/dist/chunk-73a5g713.js +78 -0
  107. package/dist/chunk-78p7h20f.js +259 -0
  108. package/dist/chunk-7a3b1d4s.js +75 -0
  109. package/dist/{chunk-fpf4cgbt.js → chunk-7bfach0x.js} +9 -9
  110. package/dist/{chunk-ckcagq32.js → chunk-7gqf9wej.js} +5 -5
  111. package/dist/{chunk-sa7nc0vv.js → chunk-7y25wk51.js} +1 -1
  112. package/dist/{chunk-vyd8jzde.js → chunk-81v55vtd.js} +96 -85
  113. package/dist/{chunk-dv1wfr85.js → chunk-8225arm6.js} +5 -4
  114. package/dist/chunk-86715d2d.js +186 -0
  115. package/dist/chunk-8ah9easf.js +365 -0
  116. package/dist/{chunk-rwexx5ns.js → chunk-8baq1s87.js} +1 -3
  117. package/dist/chunk-8fy8hx84.js +386 -0
  118. package/dist/{chunk-4pbx3g7s.js → chunk-8g747a8x.js} +1 -1
  119. package/dist/{chunk-xyqr1cww.js → chunk-8me0yq6v.js} +12 -12
  120. package/dist/{chunk-sdj9b9wh.js → chunk-8pn8tvgg.js} +9 -154
  121. package/dist/chunk-8qxyxgkb.js +161 -0
  122. package/dist/{chunk-ecsw41df.js → chunk-8xs4yp9x.js} +85 -77
  123. package/dist/{chunk-24x87knx.js → chunk-9000dg9h.js} +1327 -2882
  124. package/dist/{chunk-bmvb57qb.js → chunk-905d2hee.js} +5 -5
  125. package/dist/chunk-90qsc60s.js +378 -0
  126. package/dist/chunk-92x6xgex.js +265 -0
  127. package/dist/{chunk-jknt3rxg.js → chunk-9ctg4x6c.js} +7 -9
  128. package/dist/chunk-9e4z7dx7.js +389 -0
  129. package/dist/chunk-9hy6ejmp.js +151 -0
  130. package/dist/chunk-9jvggd30.js +173 -0
  131. package/dist/{chunk-z9tgzh90.js → chunk-9m729tsn.js} +46 -35
  132. package/dist/chunk-9r90d3jt.js +121 -0
  133. package/dist/chunk-9rx2m3cb.js +124 -0
  134. package/dist/chunk-9sr2etaw.js +110 -0
  135. package/dist/chunk-9z8hzgve.js +68 -0
  136. package/dist/{chunk-yxnwsp4f.js → chunk-9zy607vw.js} +8 -6
  137. package/dist/chunk-a0bz6g5e.js +63 -0
  138. package/dist/chunk-a136cvvz.js +27 -0
  139. package/dist/{chunk-n5t9m8h9.js → chunk-a1bjde7d.js} +7 -7
  140. package/dist/{chunk-mvss16tj.js → chunk-a2aj2mtb.js} +414 -636
  141. package/dist/{chunk-8hsyagr8.js → chunk-a3sfy6as.js} +1 -1
  142. package/dist/{chunk-8hq5kk3y.js → chunk-a4twdmhf.js} +3 -2
  143. package/dist/chunk-ae76ded0.js +30 -0
  144. package/dist/chunk-aegyxcne.js +111 -0
  145. package/dist/chunk-aj1dcvrh.js +131 -0
  146. package/dist/{chunk-1yabrspp.js → chunk-amxm6996.js} +2 -2
  147. package/dist/{chunk-t6h4wf3k.js → chunk-ar39mr9c.js} +11 -11
  148. package/dist/{chunk-r6b58y3x.js → chunk-ase86y73.js} +1 -3
  149. package/dist/chunk-asfxrz4f.js +94 -0
  150. package/dist/chunk-axj46c2c.js +196 -0
  151. package/dist/{chunk-m5eb5pt2.js → chunk-ayz6f38j.js} +6 -6
  152. package/dist/{chunk-5b7119h5.js → chunk-b00zd850.js} +8 -6
  153. package/dist/chunk-b2abjkf7.js +126 -0
  154. package/dist/{chunk-8bedvdm1.js → chunk-b81hd3m6.js} +1 -1
  155. package/dist/chunk-bcfd2zw7.js +20 -0
  156. package/dist/{chunk-n5516f5q.js → chunk-bd8zk9tn.js} +4 -4
  157. package/dist/chunk-bhdt6k7w.js +15 -0
  158. package/dist/{chunk-jy35mvy3.js → chunk-bmjmrk76.js} +7 -7
  159. package/dist/chunk-bqaqz1j1.js +126 -0
  160. package/dist/chunk-bsbmmfyt.js +17 -0
  161. package/dist/{chunk-snvypj85.js → chunk-bt64sq5y.js} +3 -2
  162. package/dist/{chunk-zq9xa1xe.js → chunk-bwevztsj.js} +109 -141
  163. package/dist/{chunk-vyc0rjyx.js → chunk-bwg7582d.js} +1 -1
  164. package/dist/{chunk-3be7ka25.js → chunk-bxcfz5gy.js} +1 -1
  165. package/dist/chunk-c2mn2fyg.js +1406 -0
  166. package/dist/chunk-c2tw0dep.js +1811 -0
  167. package/dist/{chunk-402jrnj6.js → chunk-c5bngssh.js} +8 -8
  168. package/dist/chunk-c6sjhj89.js +1284 -0
  169. package/dist/chunk-cb2hpe6k.js +443 -0
  170. package/dist/{chunk-91r0z5qq.js → chunk-ccr1s7qs.js} +1152 -1771
  171. package/dist/chunk-cewqh6rb.js +111 -0
  172. package/dist/{chunk-k9a8jemz.js → chunk-cg01f3ez.js} +7 -7
  173. package/dist/{chunk-f64npa3b.js → chunk-chsyvavm.js} +704 -4
  174. package/dist/{chunk-z8nbjar4.js → chunk-cmcbatgz.js} +7 -5
  175. package/dist/chunk-cnsj3vq2.js +35 -0
  176. package/dist/{chunk-rj86xm6z.js → chunk-cpwe0yw7.js} +1 -1
  177. package/dist/chunk-cqjmxeqv.js +269 -0
  178. package/dist/{chunk-qpm1tmzz.js → chunk-crefny3c.js} +125 -193
  179. package/dist/{chunk-ks0m9njy.js → chunk-d2jekryq.js} +8 -8
  180. package/dist/chunk-d4mdda98.js +94 -0
  181. package/dist/{chunk-26wtxbdc.js → chunk-d7886r6a.js} +6928 -6928
  182. package/dist/chunk-dfkgpfaj.js +135 -0
  183. package/dist/{chunk-9mfbqw9k.js → chunk-dm3n2qgd.js} +4 -4
  184. package/dist/chunk-dnj95atq.js +66 -0
  185. package/dist/{chunk-vjc1svpc.js → chunk-dqgzpb0q.js} +87 -77
  186. package/dist/chunk-drenq3c7.js +383 -0
  187. package/dist/chunk-drkm8yx2.js +34 -0
  188. package/dist/{chunk-ra8fbt9p.js → chunk-dvjzq9x9.js} +543 -874
  189. package/dist/{chunk-w7h2yphx.js → chunk-dwekpr47.js} +2 -2
  190. package/dist/{chunk-49k5ktrj.js → chunk-e18dg1md.js} +31 -16
  191. package/dist/chunk-e396ak46.js +111 -0
  192. package/dist/{chunk-r55r29js.js → chunk-e3c32vwa.js} +191 -276
  193. package/dist/chunk-e3m7kqkb.js +1185 -0
  194. package/dist/{chunk-9cc60ae5.js → chunk-ea9m4e0k.js} +79 -70
  195. package/dist/chunk-ecsa9nd5.js +63 -0
  196. package/dist/{chunk-cmdsbsb6.js → chunk-edzkkadh.js} +2 -2
  197. package/dist/chunk-ek1jasqg.js +142 -0
  198. package/dist/chunk-ep0hwv07.js +126 -0
  199. package/dist/{chunk-cs6y2pc9.js → chunk-ergam9ft.js} +5 -5
  200. package/dist/{chunk-ptwn7qw7.js → chunk-f2k8b4nd.js} +38 -10
  201. package/dist/{chunk-h0rbjg6x.js → chunk-f2mhrmww.js} +8 -1
  202. package/dist/{chunk-s84smrx4.js → chunk-f32cksgw.js} +155 -190
  203. package/dist/{chunk-vzqrbsd1.js → chunk-f69rgsm2.js} +5 -5
  204. package/dist/{chunk-f3bapa1x.js → chunk-f6rbj3gz.js} +12 -7
  205. package/dist/chunk-f7n3xete.js +113 -0
  206. package/dist/chunk-fbest4vx.js +109 -0
  207. package/dist/{chunk-v0wa5ref.js → chunk-fdtcb8qr.js} +13 -555
  208. package/dist/chunk-feh2j8m2.js +136 -0
  209. package/dist/chunk-feyzykye.js +10 -0
  210. package/dist/chunk-fkkysfev.js +158 -0
  211. package/dist/chunk-fn510gqw.js +216 -0
  212. package/dist/{chunk-ch53fgm5.js → chunk-ft9qsa01.js} +13 -11
  213. package/dist/chunk-fw0ckaxh.js +109 -0
  214. package/dist/{chunk-kd97kxjn.js → chunk-fz0ch109.js} +3 -2
  215. package/dist/{chunk-ks0dm6t3.js → chunk-fzn524wa.js} +17 -71
  216. package/dist/chunk-g1k68z1b.js +15 -0
  217. package/dist/{chunk-9t1x831d.js → chunk-g5nb4xhz.js} +86 -74
  218. package/dist/chunk-g82mdy27.js +429 -0
  219. package/dist/{chunk-68qevppc.js → chunk-g8sz060e.js} +82 -72
  220. package/dist/chunk-g9f19ttm.js +15 -0
  221. package/dist/{chunk-zz21rvr7.js → chunk-gdqxtdh4.js} +9 -6
  222. package/dist/chunk-get9fk3h.js +74 -0
  223. package/dist/{chunk-4x5ym4h2.js → chunk-gf6qjt7j.js} +130 -16
  224. package/dist/{chunk-bq6x1ehp.js → chunk-gpz0ddyz.js} +8 -8
  225. package/dist/{chunk-mwp7sj0q.js → chunk-gs5eeqmc.js} +110336 -114801
  226. package/dist/{chunk-qqfa0dqg.js → chunk-h4b85amj.js} +20 -32
  227. package/dist/{chunk-j4c8s7tn.js → chunk-h5zv78zq.js} +9 -6
  228. package/dist/{chunk-cgn27dqf.js → chunk-ha5d5zfj.js} +3 -3
  229. package/dist/{chunk-crr52hf4.js → chunk-han7cwc0.js} +14 -12
  230. package/dist/{chunk-dnyeb288.js → chunk-hbv0tk35.js} +74 -106
  231. package/dist/{chunk-nxsh6de2.js → chunk-hcgkak1j.js} +20 -125
  232. package/dist/{chunk-224x480q.js → chunk-hd1p4hrd.js} +8 -6
  233. package/dist/{chunk-tjaqa99q.js → chunk-hezj20qy.js} +3 -3
  234. package/dist/{chunk-z7pr85qw.js → chunk-hfdyez7b.js} +3 -3
  235. package/dist/chunk-hh7hqa2c.js +272 -0
  236. package/dist/chunk-hk4a2sks.js +83 -0
  237. package/dist/{chunk-5zh1fbrj.js → chunk-hq85v2s7.js} +3 -3
  238. package/dist/chunk-hr06142m.js +117 -0
  239. package/dist/chunk-j1b3r6v6.js +66 -0
  240. package/dist/{chunk-v8xem37v.js → chunk-j2fgn3kq.js} +8 -6
  241. package/dist/chunk-j2wgj22c.js +441 -0
  242. package/dist/{chunk-9gbamk79.js → chunk-j5bth84e.js} +5 -1
  243. package/dist/{chunk-vratq94g.js → chunk-j9gxwbe3.js} +1 -1
  244. package/dist/{chunk-cettj572.js → chunk-ja87jt56.js} +7 -131
  245. package/dist/{chunk-3r24h7t6.js → chunk-jaaxk89e.js} +1 -1
  246. package/dist/{chunk-f4jcw0ea.js → chunk-jaew3662.js} +18 -14
  247. package/dist/{chunk-e1ge9n4d.js → chunk-jb2nh0m0.js} +2 -2
  248. package/dist/{chunk-f9b4wb89.js → chunk-jb4fc073.js} +84 -75
  249. package/dist/chunk-jba8f3hz.js +108 -0
  250. package/dist/{chunk-er9vzjac.js → chunk-jbt0jgtc.js} +16 -14
  251. package/dist/{chunk-v399mzxk.js → chunk-jf0p00fz.js} +2 -2
  252. package/dist/{chunk-vygf94dw.js → chunk-jg4ge4de.js} +78 -69
  253. package/dist/chunk-jkvy2cmt.js +346 -0
  254. package/dist/{chunk-80qg1pzv.js → chunk-jmdy5vdy.js} +11 -9
  255. package/dist/{chunk-dqh7e4mt.js → chunk-jn08nxj8.js} +52 -42
  256. package/dist/{chunk-av73dywf.js → chunk-jna2tcvj.js} +8 -8
  257. package/dist/chunk-jwh384j5.js +126 -0
  258. package/dist/chunk-jwx2scxy.js +222 -0
  259. package/dist/{chunk-41xeh3t9.js → chunk-jy6c07wa.js} +4 -4
  260. package/dist/{chunk-ctmt7xh1.js → chunk-jy77nthd.js} +740 -907
  261. package/dist/{chunk-hzttn8j7.js → chunk-jyjpaqbt.js} +139 -135
  262. package/dist/chunk-jztjnw31.js +147 -0
  263. package/dist/chunk-k0jhzcwg.js +2540 -0
  264. package/dist/{chunk-myzwt5yw.js → chunk-k0kwfqr8.js} +9 -15
  265. package/dist/{chunk-bqfnp99q.js → chunk-k3s4yk22.js} +1 -1
  266. package/dist/{chunk-1dyeexvn.js → chunk-kd3mmsd2.js} +4 -4
  267. package/dist/{chunk-x51h62jq.js → chunk-ke78h68m.js} +78 -69
  268. package/dist/{chunk-1xkekb9y.js → chunk-kfd89dsd.js} +5 -3
  269. package/dist/chunk-ksvvwa9w.js +111 -0
  270. package/dist/{chunk-jy35z4n0.js → chunk-m1z5td19.js} +9 -9
  271. package/dist/{chunk-jafes477.js → chunk-m2bcpk8j.js} +4 -3
  272. package/dist/{chunk-n6fbyke9.js → chunk-m2mzpskw.js} +3 -3
  273. package/dist/{chunk-s2dmn3yg.js → chunk-m47q5mxt.js} +5 -5
  274. package/dist/{chunk-s7qj2hg5.js → chunk-m8vyp6rw.js} +2 -2
  275. package/dist/chunk-mm4m13ng.js +881 -0
  276. package/dist/{chunk-ghr4s9g6.js → chunk-mq1qrwhq.js} +79 -70
  277. package/dist/{chunk-45e9mkyr.js → chunk-mqqw60br.js} +43 -83
  278. package/dist/chunk-mtcdknc8.js +2842 -0
  279. package/dist/{chunk-cvge4pvp.js → chunk-mzd6frw6.js} +2 -2
  280. package/dist/{chunk-n2874aq5.js → chunk-n1neft0d.js} +13 -7
  281. package/dist/{chunk-bcrxtdcy.js → chunk-n2mysxn1.js} +40 -30
  282. package/dist/chunk-n4wkxbq0.js +365 -0
  283. package/dist/chunk-n57dw6h9.js +128 -0
  284. package/dist/chunk-n5wf3b82.js +118 -0
  285. package/dist/{chunk-zgrg0wk3.js → chunk-n7ce94nd.js} +27 -67
  286. package/dist/{chunk-me2ef6g4.js → chunk-n8mpqdje.js} +1 -1
  287. package/dist/{chunk-g5sg6y9q.js → chunk-na2e0dfj.js} +82 -72
  288. package/dist/chunk-netzwgv1.js +154 -0
  289. package/dist/{chunk-xszk7n10.js → chunk-nh3cd07f.js} +1 -1
  290. package/dist/{chunk-5tx8dsy0.js → chunk-npjsp3z3.js} +10493 -18453
  291. package/dist/{chunk-5hva0tsg.js → chunk-p2yv7m0g.js} +6 -6
  292. package/dist/chunk-p4rmbc1e.js +409 -0
  293. package/dist/chunk-p7jdncj4.js +122 -0
  294. package/dist/{chunk-zk2wsm7d.js → chunk-p7vkh4wx.js} +2 -2
  295. package/dist/{chunk-da4ve9t5.js → chunk-p8crqj70.js} +10 -10
  296. package/dist/{chunk-hy3g1nv8.js → chunk-prw4xz5q.js} +9 -7
  297. package/dist/{chunk-zsfxha74.js → chunk-pshjyzq4.js} +8 -7
  298. package/dist/{chunk-684kdqez.js → chunk-q08sb44h.js} +203 -304
  299. package/dist/{chunk-n7158r58.js → chunk-q78bgdtk.js} +79 -70
  300. package/dist/{chunk-e5pntxye.js → chunk-q7tpyeb3.js} +6 -4
  301. package/dist/{chunk-7ymfj7m3.js → chunk-q82r31er.js} +1 -1
  302. package/dist/chunk-qajrkk97.js +298 -0
  303. package/dist/chunk-qbrsmra3.js +23 -0
  304. package/dist/chunk-qhfn4vgv.js +66 -0
  305. package/dist/{chunk-d7mx1phm.js → chunk-qndzvkdx.js} +61 -103
  306. package/dist/{chunk-35y0r56v.js → chunk-qtfc6wdh.js} +1 -4
  307. package/dist/{chunk-v9y80148.js → chunk-qwcnwn5t.js} +100 -191
  308. package/dist/chunk-qwehvedn.js +440 -0
  309. package/dist/{chunk-2cgdr2n7.js → chunk-qwk9fq7r.js} +78 -69
  310. package/dist/chunk-qy75c2vm.js +70 -0
  311. package/dist/{chunk-rryx19hp.js → chunk-r2k2jy0y.js} +2 -2
  312. package/dist/chunk-r47p0ff0.js +61 -0
  313. package/dist/{chunk-t3bf8hcf.js → chunk-r5tk54yt.js} +2 -2
  314. package/dist/{chunk-bt9krt49.js → chunk-r8q993g6.js} +38 -32
  315. package/dist/{chunk-veb0gkcf.js → chunk-ra2rykps.js} +78 -69
  316. package/dist/{chunk-gbcqdr0x.js → chunk-rav5xp8h.js} +1 -1
  317. package/dist/chunk-rbe0tcn9.js +120 -0
  318. package/dist/chunk-rd5cfz3k.js +68 -0
  319. package/dist/{chunk-cenpqc2t.js → chunk-rdvaan98.js} +8 -6
  320. package/dist/{chunk-dr4qq42x.js → chunk-rgbbtszq.js} +9 -9
  321. package/dist/chunk-rjsb9s3q.js +206 -0
  322. package/dist/{chunk-fdwa7gem.js → chunk-rkak3kjw.js} +7 -7
  323. package/dist/{chunk-a6s8wnhe.js → chunk-rnam0xc5.js} +4 -4
  324. package/dist/chunk-rqkqbppr.js +112 -0
  325. package/dist/{chunk-ye18m1zb.js → chunk-rqvqqrpg.js} +38 -8
  326. package/dist/{chunk-rw466wqn.js → chunk-rvkvehat.js} +5284 -3093
  327. package/dist/chunk-s1baskk7.js +14 -0
  328. package/dist/{chunk-jt0pha6y.js → chunk-s5gnvx67.js} +227 -198
  329. package/dist/chunk-s7dtt7tw.js +109 -0
  330. package/dist/chunk-s9ftt1fh.js +135 -0
  331. package/dist/chunk-sc6sy490.js +240 -0
  332. package/dist/chunk-sh9er84d.js +1073 -0
  333. package/dist/{chunk-faycqscv.js → chunk-sk9xag9g.js} +2 -2
  334. package/dist/{chunk-zpc0kwkb.js → chunk-t0g8wbcq.js} +7 -7
  335. package/dist/chunk-tbgm1v8n.js +146 -0
  336. package/dist/{chunk-35b0ek0j.js → chunk-tcdv4gp8.js} +13 -9
  337. package/dist/{chunk-mt25echc.js → chunk-tezak8rx.js} +1 -1
  338. package/dist/chunk-thk6yn51.js +154 -0
  339. package/dist/{chunk-s2gm9vfk.js → chunk-tkf24yhv.js} +7 -7
  340. package/dist/{chunk-6td4c2eq.js → chunk-tkrjcekq.js} +54 -72
  341. package/dist/{chunk-9rcbyag3.js → chunk-tmdbrszg.js} +2 -2
  342. package/dist/chunk-tw2g1yhq.js +118 -0
  343. package/dist/chunk-twzjxwhf.js +182 -0
  344. package/dist/{chunk-m94pnhfa.js → chunk-v4e4f711.js} +39 -29
  345. package/dist/{chunk-b51jjfh5.js → chunk-v5k7zmqm.js} +43 -32
  346. package/dist/chunk-var1et7e.js +66 -0
  347. package/dist/chunk-vd11xbz3.js +304 -0
  348. package/dist/{chunk-hqmz36b3.js → chunk-vf612n57.js} +21 -101
  349. package/dist/chunk-vfhqj46w.js +144 -0
  350. package/dist/chunk-vkxx8ymr.js +2377 -0
  351. package/dist/{chunk-n9x557ea.js → chunk-vs094cby.js} +2332 -4220
  352. package/dist/{chunk-dxc7begm.js → chunk-vtb8z6as.js} +14 -10
  353. package/dist/{chunk-x51mdzqq.js → chunk-vzd3cjy9.js} +3 -3
  354. package/dist/chunk-w2es9743.js +439 -0
  355. package/dist/{chunk-8z039kef.js → chunk-w92b262y.js} +53 -54
  356. package/dist/chunk-wa1dpga1.js +236 -0
  357. package/dist/{chunk-qf2v384j.js → chunk-wbmacbfb.js} +9 -7
  358. package/dist/{chunk-ryj80g9p.js → chunk-wbn46nb4.js} +136 -178
  359. package/dist/{chunk-t9z6njcr.js → chunk-wtycm8km.js} +9 -9
  360. package/dist/{chunk-q6rax9kh.js → chunk-wymtgh88.js} +5 -5
  361. package/dist/{chunk-pa7saazk.js → chunk-x0aj8rh8.js} +28 -56
  362. package/dist/{chunk-1szr63w0.js → chunk-x69w7xr7.js} +86 -74
  363. package/dist/{chunk-k5gdea6r.js → chunk-x6qmm22r.js} +84 -75
  364. package/dist/{chunk-zrse3zpz.js → chunk-xbprynsc.js} +18 -46
  365. package/dist/chunk-xc0v11v6.js +914 -0
  366. package/dist/chunk-xed18bb5.js +233 -0
  367. package/dist/{chunk-gjyc3293.js → chunk-xj76qk4z.js} +288 -499
  368. package/dist/chunk-xmd9eezd.js +83 -0
  369. package/dist/chunk-xrzrbw0f.js +142 -0
  370. package/dist/{chunk-fzxg8v1y.js → chunk-xycy3c8q.js} +15 -12
  371. package/dist/chunk-y0m0rd5v.js +140 -0
  372. package/dist/chunk-y2vtmzre.js +137 -0
  373. package/dist/{chunk-vybkxr18.js → chunk-y5z1cjbk.js} +42 -32
  374. package/dist/chunk-y60q54ph.js +111 -0
  375. package/dist/{chunk-d7vv2ydf.js → chunk-y78t50v0.js} +2 -2
  376. package/dist/{chunk-xkr7as9h.js → chunk-y9bgt2k1.js} +13 -9
  377. package/dist/chunk-ycwdzwz5.js +233 -0
  378. package/dist/chunk-yfyc2y1v.js +136 -0
  379. package/dist/chunk-yg6gtf9j.js +152 -0
  380. package/dist/{chunk-kyer92r4.js → chunk-yk8vcecd.js} +33 -5
  381. package/dist/{chunk-hkn7tzgv.js → chunk-ym5r3jnk.js} +1 -1
  382. package/dist/chunk-yr6gqw17.js +132 -0
  383. package/dist/chunk-yw62vhjz.js +445 -0
  384. package/dist/{chunk-athjeyrt.js → chunk-yw79dz62.js} +4 -4
  385. package/dist/{chunk-5mrhhmas.js → chunk-yx64nmbh.js} +8 -5
  386. package/dist/chunk-yy232vtj.js +84 -0
  387. package/dist/chunk-z1bs6d7k.js +24 -0
  388. package/dist/chunk-z4mgvsdj.js +456 -0
  389. package/dist/chunk-z6e5jp2w.js +119 -0
  390. package/dist/{chunk-t7cbhqd2.js → chunk-z6zt2ns7.js} +111 -123
  391. package/dist/chunk-z735r3p2.js +114 -0
  392. package/dist/{chunk-rjz6btwk.js → chunk-z7ssqvt6.js} +4972 -4638
  393. package/dist/{chunk-bpts9jbq.js → chunk-z8nv1ah0.js} +39 -31
  394. package/dist/chunk-z9mbssbe.js +128 -0
  395. package/dist/chunk-zdctabq6.js +264 -0
  396. package/dist/{chunk-ve60fbtd.js → chunk-ze6zvkg6.js} +2 -2
  397. package/dist/{chunk-t0rgmccj.js → chunk-zejm280k.js} +1 -1
  398. package/dist/{chunk-krstc7m7.js → chunk-zfapazzd.js} +15 -11
  399. package/dist/{chunk-2j0j79p0.js → chunk-zg4ae27v.js} +8 -8
  400. package/dist/chunk-zqxe8qnw.js +3590 -0
  401. package/dist/{chunk-q6dpqj3z.js → chunk-zs2ddzfv.js} +10 -7
  402. package/dist/chunk-zy80g72r.js +512 -0
  403. package/dist/{chunk-g3t0act8.js → chunk-zzm33q8x.js} +1 -1
  404. package/dist/{chunk-s8fzxy94.js → chunk-zzzc1ead.js} +17 -13
  405. package/dist/cli.js +63 -11
  406. package/dist/vendor/audio-capture/arm64-darwin/audio-capture.node +0 -0
  407. package/dist/vendor/audio-capture/arm64-linux/audio-capture.node +0 -0
  408. package/dist/vendor/audio-capture/arm64-win32/audio-capture.node +0 -0
  409. package/dist/vendor/audio-capture/x64-darwin/audio-capture.node +0 -0
  410. package/dist/vendor/audio-capture/x64-linux/audio-capture.node +0 -0
  411. package/dist/vendor/audio-capture/x64-win32/audio-capture.node +0 -0
  412. package/package.json +8 -5
  413. package/scripts/postinstall.cjs +319 -0
  414. package/dist/chunk-0291smg3.js +0 -42
  415. package/dist/chunk-04g2ty3v.js +0 -104
  416. package/dist/chunk-069x95ne.js +0 -764
  417. package/dist/chunk-06x02eab.js +0 -655
  418. package/dist/chunk-09pjmga5.js +0 -713
  419. package/dist/chunk-0g90je6r.js +0 -145
  420. package/dist/chunk-0paqc2yw.js +0 -15
  421. package/dist/chunk-0rddv9vb.js +0 -328
  422. package/dist/chunk-162w6yv3.js +0 -756
  423. package/dist/chunk-1gjbaa3n.js +0 -128
  424. package/dist/chunk-23wg4mnt.js +0 -404
  425. package/dist/chunk-2gbjtg7c.js +0 -102
  426. package/dist/chunk-2v1q0ezq.js +0 -102
  427. package/dist/chunk-37n7jkxe.js +0 -436
  428. package/dist/chunk-38svjnh4.js +0 -158
  429. package/dist/chunk-3bg1089y.js +0 -616
  430. package/dist/chunk-3d8ck5ne.js +0 -112
  431. package/dist/chunk-3g6rf9sz.js +0 -106
  432. package/dist/chunk-3x3rr2n5.js +0 -57
  433. package/dist/chunk-4f6q3d38.js +0 -117
  434. package/dist/chunk-4h57km3m.js +0 -74
  435. package/dist/chunk-4kyh2618.js +0 -99
  436. package/dist/chunk-4w9vc9vc.js +0 -119
  437. package/dist/chunk-53hqpp5z.js +0 -208
  438. package/dist/chunk-5deqy8r0.js +0 -143
  439. package/dist/chunk-5m2rmc2k.js +0 -128
  440. package/dist/chunk-5wp9pkpt.js +0 -539
  441. package/dist/chunk-5ym9f6w3.js +0 -263
  442. package/dist/chunk-6f938733.js +0 -1027
  443. package/dist/chunk-6nenxecd.js +0 -115
  444. package/dist/chunk-6rja0h86.js +0 -1593
  445. package/dist/chunk-70q6dp4d.js +0 -96
  446. package/dist/chunk-7bn0wzs3.js +0 -1493
  447. package/dist/chunk-7e2e0bfm.js +0 -65
  448. package/dist/chunk-7ywadnax.js +0 -490
  449. package/dist/chunk-7z33j54s.js +0 -142
  450. package/dist/chunk-8yvfkzyh.js +0 -58
  451. package/dist/chunk-9abpx1kv.js +0 -2833
  452. package/dist/chunk-9ks2nswb.js +0 -114
  453. package/dist/chunk-9wrds5tr.js +0 -109
  454. package/dist/chunk-ab2twken.js +0 -102
  455. package/dist/chunk-abncjeag.js +0 -97
  456. package/dist/chunk-am6w4x6y.js +0 -103
  457. package/dist/chunk-b1xt9jqg.js +0 -28
  458. package/dist/chunk-b73bd7db.js +0 -496
  459. package/dist/chunk-bc7nvynh.js +0 -195
  460. package/dist/chunk-br17dhef.js +0 -103
  461. package/dist/chunk-c3k0sdey.js +0 -281
  462. package/dist/chunk-c909bmyv.js +0 -103
  463. package/dist/chunk-cftsv9w4.js +0 -129
  464. package/dist/chunk-cj1a7npk.js +0 -99
  465. package/dist/chunk-cpma9zs5.js +0 -335
  466. package/dist/chunk-cyscs4k5.js +0 -1330
  467. package/dist/chunk-czr7y063.js +0 -348
  468. package/dist/chunk-d93sndem.js +0 -372
  469. package/dist/chunk-ddz8xbpd.js +0 -481
  470. package/dist/chunk-dkhqx4hk.js +0 -84
  471. package/dist/chunk-dsrharmv.js +0 -359
  472. package/dist/chunk-eqmy5d05.js +0 -56
  473. package/dist/chunk-f2crxw2c.js +0 -5400
  474. package/dist/chunk-f8zga40p.js +0 -234
  475. package/dist/chunk-fbgm2ym6.js +0 -990
  476. package/dist/chunk-fcbbsswe.js +0 -119
  477. package/dist/chunk-fda654nt.js +0 -6121
  478. package/dist/chunk-ffmv9ezj.js +0 -104
  479. package/dist/chunk-fmjte7md.js +0 -38
  480. package/dist/chunk-fqtwqxxc.js +0 -293
  481. package/dist/chunk-g8k85nkd.js +0 -802
  482. package/dist/chunk-ge4ak7dj.js +0 -127
  483. package/dist/chunk-gpqemecy.js +0 -126
  484. package/dist/chunk-h19p6s3b.js +0 -131
  485. package/dist/chunk-j0sk1rct.js +0 -998
  486. package/dist/chunk-j1wfpa1a.js +0 -70
  487. package/dist/chunk-j829fx31.js +0 -3458
  488. package/dist/chunk-jqctzrvd.js +0 -722
  489. package/dist/chunk-jx817w05.js +0 -11
  490. package/dist/chunk-ka6sab33.js +0 -174
  491. package/dist/chunk-krjsvmwp.js +0 -101
  492. package/dist/chunk-kvpe50pm.js +0 -311
  493. package/dist/chunk-mez504fj.js +0 -113
  494. package/dist/chunk-mj6wbrae.js +0 -105
  495. package/dist/chunk-n0k8xrey.js +0 -319
  496. package/dist/chunk-n0pg2kpe.js +0 -122
  497. package/dist/chunk-n4qtqkp0.js +0 -295
  498. package/dist/chunk-n9meha2m.js +0 -73
  499. package/dist/chunk-ndk7q5n3.js +0 -169
  500. package/dist/chunk-ng6n9t4h.js +0 -56
  501. package/dist/chunk-p3pz13x2.js +0 -1933
  502. package/dist/chunk-p9ez6zgq.js +0 -2656
  503. package/dist/chunk-ph750kx1.js +0 -550
  504. package/dist/chunk-pxb99zqs.js +0 -117
  505. package/dist/chunk-q1yqc5n3.js +0 -100
  506. package/dist/chunk-q5b91nhh.js +0 -40
  507. package/dist/chunk-qtfqk0jr.js +0 -131
  508. package/dist/chunk-qzfmdh1t.js +0 -388
  509. package/dist/chunk-r3cv0j9n.js +0 -456
  510. package/dist/chunk-rx0pbgym.js +0 -97
  511. package/dist/chunk-s624rd5j.js +0 -531
  512. package/dist/chunk-satndwqj.js +0 -285
  513. package/dist/chunk-ssrxnkd1.js +0 -109
  514. package/dist/chunk-t2pgctqx.js +0 -106
  515. package/dist/chunk-t7sgwf31.js +0 -644
  516. package/dist/chunk-tth904tj.js +0 -53
  517. package/dist/chunk-typpbjhy.js +0 -128
  518. package/dist/chunk-vp6nrhdq.js +0 -102
  519. package/dist/chunk-vtjm53nt.js +0 -432
  520. package/dist/chunk-w412n7tq.js +0 -469
  521. package/dist/chunk-w4153rky.js +0 -1885
  522. package/dist/chunk-wdgv15as.js +0 -212
  523. package/dist/chunk-wgn9kydv.js +0 -58
  524. package/dist/chunk-whknbrk0.js +0 -184
  525. package/dist/chunk-x1k8e1xc.js +0 -56
  526. package/dist/chunk-x45xx6sc.js +0 -105
  527. package/dist/chunk-x4xvqbe5.js +0 -1166
  528. package/dist/chunk-x8b7vft8.js +0 -132
  529. package/dist/chunk-xaycc8qe.js +0 -44
  530. package/dist/chunk-xd4785ks.js +0 -73
  531. package/dist/chunk-xjxgmxhq.js +0 -463
  532. package/dist/chunk-xx2x3tz9.js +0 -166
  533. package/dist/chunk-y2j23eem.js +0 -101
  534. package/dist/chunk-y83j09wv.js +0 -123
  535. package/dist/chunk-yh8460pb.js +0 -119
  536. package/dist/chunk-z6nhchdb.js +0 -60
  537. package/dist/chunk-zbt73sj7.js +0 -192
  538. package/dist/chunk-zmwaatmq.js +0 -118
  539. package/dist/chunk-zvdg9tex.js +0 -135
  540. package/dist/chunk-zwa780cx.js +0 -584
  541. package/dist/{chunk-whvdag1y.js → chunk-3bfs3x0h.js} +9 -9
  542. package/dist/{chunk-27xc1csx.js → chunk-dggvswz1.js} +3 -3
@@ -0,0 +1,2842 @@
1
+ // @bun
2
+ import {
3
+ init_mappers,
4
+ toInternalMessages
5
+ } from "./chunk-rnam0xc5.js";
6
+ import {
7
+ ASK_USER_QUESTION_TOOL_NAME,
8
+ DreamTask,
9
+ EMPTY_LOOKUPS,
10
+ EXIT_PLAN_MODE_V2_TOOL_NAME,
11
+ InProcessTeammateTask,
12
+ LocalAgentTask,
13
+ LocalShellTask,
14
+ Message,
15
+ RemoteAgentTask,
16
+ Select,
17
+ UserPlanMessage,
18
+ extractTag,
19
+ findToolByName,
20
+ getEmptyToolPermissionContext,
21
+ getRainbowColor,
22
+ getRemoteTaskSessionUrl,
23
+ getTaskOutputPath,
24
+ getTools,
25
+ init_AppState,
26
+ init_DreamTask,
27
+ init_InProcessTeammateTask,
28
+ init_LocalAgentTask,
29
+ init_LocalShellTask,
30
+ init_Message,
31
+ init_RemoteAgentTask,
32
+ init_Task,
33
+ init_Tool,
34
+ init_UserPlanMessage,
35
+ init_collapseReadSearch,
36
+ init_constants2,
37
+ init_coordinatorMode,
38
+ init_diskOutput,
39
+ init_ink,
40
+ init_messages1 as init_messages,
41
+ init_overlayContext,
42
+ init_prompt8 as init_prompt,
43
+ init_select,
44
+ init_teleport,
45
+ init_thinking,
46
+ init_tools1 as init_tools,
47
+ init_types1 as init_types,
48
+ init_ultraplan,
49
+ init_useElapsedTime,
50
+ init_useSettings,
51
+ init_useShortcutDisplay,
52
+ init_useTerminalSize,
53
+ isBackgroundTask,
54
+ isCoordinatorMode,
55
+ isPanelAgentTask,
56
+ isTerminalTaskStatus,
57
+ normalizeMessages,
58
+ stopUltraplan,
59
+ summarizeRecentActivities,
60
+ teleportResumeCodeSession,
61
+ toInkColor,
62
+ useAppState,
63
+ useElapsedTime,
64
+ useRegisterOverlay,
65
+ useSetAppState,
66
+ useSettings,
67
+ useShortcutDisplay
68
+ } from "./chunk-gs5eeqmc.js";
69
+ import {
70
+ init_useKeybinding
71
+ } from "./chunk-0jzdwbdc.js";
72
+ import {
73
+ TEAM_LEAD_NAME,
74
+ init_constants as init_constants3
75
+ } from "./chunk-4jm600zv.js";
76
+ import {
77
+ init_browser,
78
+ openBrowser
79
+ } from "./chunk-n8mpqdje.js";
80
+ import {
81
+ AGENT_TOOL_NAME,
82
+ DIAMOND_FILLED,
83
+ DIAMOND_OPEN,
84
+ LEGACY_AGENT_TOOL_NAME,
85
+ init_constants1 as init_constants,
86
+ init_figures as init_figures2,
87
+ init_stringUtils,
88
+ plural
89
+ } from "./chunk-a2aj2mtb.js";
90
+ import {
91
+ count,
92
+ init_array,
93
+ intersperse
94
+ } from "./chunk-1cwdhk7a.js";
95
+ import {
96
+ formatDuration,
97
+ formatFileSize,
98
+ formatNumber,
99
+ init_format,
100
+ truncate,
101
+ truncateToWidth
102
+ } from "./chunk-z4mgvsdj.js";
103
+ import {
104
+ Byline,
105
+ Dialog,
106
+ KeyboardShortcutHint,
107
+ Link,
108
+ ThemedBox_default,
109
+ ThemedText,
110
+ init_src,
111
+ useAnimationFrame,
112
+ useKeybindings,
113
+ useTerminalSize,
114
+ useTheme
115
+ } from "./chunk-rvkvehat.js";
116
+ import {
117
+ require_jsx_dev_runtime,
118
+ require_react
119
+ } from "./chunk-g338npwr.js";
120
+ import {
121
+ init_analytics,
122
+ logEvent
123
+ } from "./chunk-f2mhrmww.js";
124
+ import {
125
+ figures_default,
126
+ init_figures
127
+ } from "./chunk-qajrkk97.js";
128
+ import {
129
+ init_fsOperations,
130
+ tailFile
131
+ } from "./chunk-hcgkak1j.js";
132
+ import {
133
+ errorMessage,
134
+ init_errors
135
+ } from "./chunk-z6e5jp2w.js";
136
+ import {
137
+ __esm,
138
+ __toESM
139
+ } from "./chunk-qp2qdcda.js";
140
+
141
+ // src/state/teammateViewHelpers.ts
142
+ function isLocalAgent(task) {
143
+ return typeof task === "object" && task !== null && "type" in task && task.type === "local_agent";
144
+ }
145
+ function release(task) {
146
+ return {
147
+ ...task,
148
+ retain: false,
149
+ messages: undefined,
150
+ diskLoaded: false,
151
+ evictAfter: isTerminalTaskStatus(task.status) ? Date.now() + PANEL_GRACE_MS : undefined
152
+ };
153
+ }
154
+ function enterTeammateView(taskId, setAppState) {
155
+ logEvent("tengu_transcript_view_enter", {});
156
+ setAppState((prev) => {
157
+ const task = prev.tasks[taskId];
158
+ const prevId = prev.viewingAgentTaskId;
159
+ const prevTask = prevId !== undefined ? prev.tasks[prevId] : undefined;
160
+ const switching = prevId !== undefined && prevId !== taskId && isLocalAgent(prevTask) && prevTask.retain;
161
+ const needsRetain = isLocalAgent(task) && (!task.retain || task.evictAfter !== undefined);
162
+ const needsView = prev.viewingAgentTaskId !== taskId || prev.viewSelectionMode !== "viewing-agent";
163
+ if (!needsRetain && !needsView && !switching)
164
+ return prev;
165
+ let tasks = prev.tasks;
166
+ if (switching || needsRetain) {
167
+ tasks = { ...prev.tasks };
168
+ if (switching)
169
+ tasks[prevId] = release(prevTask);
170
+ if (needsRetain) {
171
+ tasks[taskId] = { ...task, retain: true, evictAfter: undefined };
172
+ }
173
+ }
174
+ return {
175
+ ...prev,
176
+ viewingAgentTaskId: taskId,
177
+ viewSelectionMode: "viewing-agent",
178
+ tasks
179
+ };
180
+ });
181
+ }
182
+ function exitTeammateView(setAppState) {
183
+ logEvent("tengu_transcript_view_exit", {});
184
+ setAppState((prev) => {
185
+ const id = prev.viewingAgentTaskId;
186
+ const cleared = {
187
+ ...prev,
188
+ viewingAgentTaskId: undefined,
189
+ viewSelectionMode: "none"
190
+ };
191
+ if (id === undefined) {
192
+ return prev.viewSelectionMode === "none" ? prev : cleared;
193
+ }
194
+ const task = prev.tasks[id];
195
+ if (!isLocalAgent(task) || !task.retain)
196
+ return cleared;
197
+ return {
198
+ ...cleared,
199
+ tasks: { ...prev.tasks, [id]: release(task) }
200
+ };
201
+ });
202
+ }
203
+ function stopOrDismissAgent(taskId, setAppState) {
204
+ setAppState((prev) => {
205
+ const task = prev.tasks[taskId];
206
+ if (!isLocalAgent(task))
207
+ return prev;
208
+ if (task.status === "running") {
209
+ task.abortController?.abort();
210
+ return prev;
211
+ }
212
+ if (task.evictAfter === 0)
213
+ return prev;
214
+ const viewingThis = prev.viewingAgentTaskId === taskId;
215
+ return {
216
+ ...prev,
217
+ tasks: {
218
+ ...prev.tasks,
219
+ [taskId]: { ...release(task), evictAfter: 0 }
220
+ },
221
+ ...viewingThis && {
222
+ viewingAgentTaskId: undefined,
223
+ viewSelectionMode: "none"
224
+ }
225
+ };
226
+ });
227
+ }
228
+ var PANEL_GRACE_MS = 30000;
229
+ var init_teammateViewHelpers = __esm(() => {
230
+ init_analytics();
231
+ init_Task();
232
+ });
233
+
234
+ // src/components/tasks/renderToolActivity.tsx
235
+ function renderToolActivity(activity, tools, theme) {
236
+ const tool = findToolByName(tools, activity.toolName);
237
+ if (!tool) {
238
+ return activity.toolName;
239
+ }
240
+ try {
241
+ const parsed = tool.inputSchema.safeParse(activity.input);
242
+ const parsedInput = parsed.success ? parsed.data : {};
243
+ const userFacingName = tool.userFacingName(parsedInput);
244
+ if (!userFacingName) {
245
+ return activity.toolName;
246
+ }
247
+ const toolArgs = tool.renderToolUseMessage(parsedInput, {
248
+ theme,
249
+ verbose: false
250
+ });
251
+ if (toolArgs) {
252
+ return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
253
+ children: [
254
+ userFacingName,
255
+ "(",
256
+ toolArgs,
257
+ ")"
258
+ ]
259
+ }, undefined, true, undefined, this);
260
+ }
261
+ return userFacingName;
262
+ } catch {
263
+ return activity.toolName;
264
+ }
265
+ }
266
+ var jsx_dev_runtime;
267
+ var init_renderToolActivity = __esm(() => {
268
+ init_src();
269
+ init_Tool();
270
+ jsx_dev_runtime = __toESM(require_jsx_dev_runtime(), 1);
271
+ });
272
+
273
+ // src/components/tasks/taskStatusUtils.tsx
274
+ function isTerminalStatus(status) {
275
+ return status === "completed" || status === "failed" || status === "killed";
276
+ }
277
+ function getTaskStatusIcon(status, options) {
278
+ const { isIdle, awaitingApproval, hasError, shutdownRequested } = options ?? {};
279
+ if (hasError)
280
+ return figures_default.cross;
281
+ if (awaitingApproval)
282
+ return figures_default.questionMarkPrefix;
283
+ if (shutdownRequested)
284
+ return figures_default.warning;
285
+ if (status === "running") {
286
+ if (isIdle)
287
+ return figures_default.ellipsis;
288
+ return figures_default.play;
289
+ }
290
+ if (status === "completed")
291
+ return figures_default.tick;
292
+ if (status === "failed" || status === "killed")
293
+ return figures_default.cross;
294
+ return figures_default.bullet;
295
+ }
296
+ function getTaskStatusColor(status, options) {
297
+ const { isIdle, awaitingApproval, hasError, shutdownRequested } = options ?? {};
298
+ if (hasError)
299
+ return "error";
300
+ if (awaitingApproval)
301
+ return "warning";
302
+ if (shutdownRequested)
303
+ return "warning";
304
+ if (isIdle)
305
+ return "background";
306
+ if (status === "completed")
307
+ return "success";
308
+ if (status === "failed")
309
+ return "error";
310
+ if (status === "killed")
311
+ return "warning";
312
+ return "background";
313
+ }
314
+ function describeTeammateActivity(t) {
315
+ if (t.shutdownRequested)
316
+ return "stopping";
317
+ if (t.awaitingPlanApproval)
318
+ return "awaiting approval";
319
+ if (t.isIdle)
320
+ return "idle";
321
+ return (t.progress?.recentActivities && summarizeRecentActivities(t.progress.recentActivities)) ?? t.progress?.lastActivity?.activityDescription ?? "working";
322
+ }
323
+ function shouldHideTasksFooter(tasks, showSpinnerTree) {
324
+ if (!showSpinnerTree)
325
+ return false;
326
+ let hasVisibleTask = false;
327
+ for (const t of Object.values(tasks)) {
328
+ if (!isBackgroundTask(t) || process.env.USER_TYPE === "ant" && isPanelAgentTask(t)) {
329
+ continue;
330
+ }
331
+ hasVisibleTask = true;
332
+ if (t.type !== "in_process_teammate")
333
+ return false;
334
+ }
335
+ return hasVisibleTask;
336
+ }
337
+ var init_taskStatusUtils = __esm(() => {
338
+ init_figures();
339
+ init_LocalAgentTask();
340
+ init_types();
341
+ init_collapseReadSearch();
342
+ });
343
+
344
+ // src/components/tasks/AsyncAgentDetailDialog.tsx
345
+ function AsyncAgentDetailDialog({
346
+ agent,
347
+ onDone,
348
+ onKillAgent,
349
+ onBack
350
+ }) {
351
+ const [theme] = useTheme();
352
+ const tools = import_react.useMemo(() => getTools(getEmptyToolPermissionContext()), []);
353
+ const elapsedTime = useElapsedTime(agent.startTime, agent.status === "running", 1000, agent.totalPausedMs ?? 0);
354
+ useKeybindings({
355
+ "confirm:yes": onDone
356
+ }, { context: "Confirmation" });
357
+ const handleKeyDown = (e) => {
358
+ if (e.key === " ") {
359
+ e.preventDefault();
360
+ onDone();
361
+ } else if (e.key === "left" && onBack) {
362
+ e.preventDefault();
363
+ onBack();
364
+ } else if (e.key === "x" && agent.status === "running" && onKillAgent) {
365
+ e.preventDefault();
366
+ onKillAgent();
367
+ }
368
+ };
369
+ const planContent = extractTag(agent.prompt, "plan");
370
+ const displayPrompt = agent.prompt.length > 300 ? agent.prompt.substring(0, 297) + "\u2026" : agent.prompt;
371
+ const tokenCount = agent.result?.totalTokens ?? agent.progress?.tokenCount;
372
+ const toolUseCount = agent.result?.totalToolUseCount ?? agent.progress?.toolUseCount;
373
+ const title = /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
374
+ children: [
375
+ agent.selectedAgent?.agentType ?? "agent",
376
+ " \u203A",
377
+ " ",
378
+ agent.description || "Async agent"
379
+ ]
380
+ }, undefined, true, undefined, this);
381
+ const subtitle = /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
382
+ children: [
383
+ agent.status !== "running" && /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
384
+ color: getTaskStatusColor(agent.status),
385
+ children: [
386
+ getTaskStatusIcon(agent.status),
387
+ " ",
388
+ agent.status === "completed" ? "Completed" : agent.status === "failed" ? "Failed" : "Stopped",
389
+ " \xB7 "
390
+ ]
391
+ }, undefined, true, undefined, this),
392
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
393
+ dimColor: true,
394
+ children: [
395
+ elapsedTime,
396
+ tokenCount !== undefined && tokenCount > 0 && /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(jsx_dev_runtime2.Fragment, {
397
+ children: [
398
+ " \xB7 ",
399
+ formatNumber(tokenCount),
400
+ " tokens"
401
+ ]
402
+ }, undefined, true, undefined, this),
403
+ toolUseCount !== undefined && toolUseCount > 0 && /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(jsx_dev_runtime2.Fragment, {
404
+ children: [
405
+ " ",
406
+ "\xB7 ",
407
+ toolUseCount,
408
+ " ",
409
+ toolUseCount === 1 ? "tool" : "tools"
410
+ ]
411
+ }, undefined, true, undefined, this)
412
+ ]
413
+ }, undefined, true, undefined, this)
414
+ ]
415
+ }, undefined, true, undefined, this);
416
+ return /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
417
+ flexDirection: "column",
418
+ tabIndex: 0,
419
+ autoFocus: true,
420
+ onKeyDown: handleKeyDown,
421
+ children: /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Dialog, {
422
+ title,
423
+ subtitle,
424
+ onCancel: onDone,
425
+ color: "background",
426
+ inputGuide: (exitState) => exitState.pending ? /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
427
+ children: [
428
+ "Press ",
429
+ exitState.keyName,
430
+ " again to exit"
431
+ ]
432
+ }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Byline, {
433
+ children: [
434
+ onBack && /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(KeyboardShortcutHint, {
435
+ shortcut: "\u2190",
436
+ action: "go back"
437
+ }, undefined, false, undefined, this),
438
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(KeyboardShortcutHint, {
439
+ shortcut: "Esc/Enter/Space",
440
+ action: "close"
441
+ }, undefined, false, undefined, this),
442
+ agent.status === "running" && onKillAgent && /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(KeyboardShortcutHint, {
443
+ shortcut: "x",
444
+ action: "stop"
445
+ }, undefined, false, undefined, this)
446
+ ]
447
+ }, undefined, true, undefined, this),
448
+ children: /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
449
+ flexDirection: "column",
450
+ children: [
451
+ agent.status === "running" && agent.progress?.recentActivities && agent.progress.recentActivities.length > 0 && /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
452
+ flexDirection: "column",
453
+ children: [
454
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
455
+ bold: true,
456
+ dimColor: true,
457
+ children: "Progress"
458
+ }, undefined, false, undefined, this),
459
+ agent.progress.recentActivities.map((activity, i) => /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
460
+ dimColor: i < agent.progress.recentActivities.length - 1,
461
+ wrap: "truncate-end",
462
+ children: [
463
+ i === agent.progress.recentActivities.length - 1 ? "\u203A " : " ",
464
+ renderToolActivity(activity, tools, theme)
465
+ ]
466
+ }, i, true, undefined, this))
467
+ ]
468
+ }, undefined, true, undefined, this),
469
+ planContent ? /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
470
+ marginTop: 1,
471
+ children: /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(UserPlanMessage, {
472
+ addMargin: false,
473
+ planContent
474
+ }, undefined, false, undefined, this)
475
+ }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
476
+ flexDirection: "column",
477
+ marginTop: 1,
478
+ children: [
479
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
480
+ bold: true,
481
+ dimColor: true,
482
+ children: "Prompt"
483
+ }, undefined, false, undefined, this),
484
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
485
+ wrap: "wrap",
486
+ children: displayPrompt
487
+ }, undefined, false, undefined, this)
488
+ ]
489
+ }, undefined, true, undefined, this),
490
+ agent.status === "failed" && agent.error && /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
491
+ flexDirection: "column",
492
+ marginTop: 1,
493
+ children: [
494
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
495
+ bold: true,
496
+ color: "error",
497
+ children: "Error"
498
+ }, undefined, false, undefined, this),
499
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
500
+ color: "error",
501
+ wrap: "wrap",
502
+ children: agent.error
503
+ }, undefined, false, undefined, this)
504
+ ]
505
+ }, undefined, true, undefined, this)
506
+ ]
507
+ }, undefined, true, undefined, this)
508
+ }, undefined, false, undefined, this)
509
+ }, undefined, false, undefined, this);
510
+ }
511
+ var import_react, jsx_dev_runtime2;
512
+ var init_AsyncAgentDetailDialog = __esm(() => {
513
+ init_useElapsedTime();
514
+ init_src();
515
+ init_useKeybinding();
516
+ init_Tool();
517
+ init_tools();
518
+ init_format();
519
+ init_messages();
520
+ init_src();
521
+ init_UserPlanMessage();
522
+ init_renderToolActivity();
523
+ init_taskStatusUtils();
524
+ import_react = __toESM(require_react(), 1);
525
+ jsx_dev_runtime2 = __toESM(require_jsx_dev_runtime(), 1);
526
+ });
527
+
528
+ // src/components/tasks/RemoteSessionProgress.tsx
529
+ function formatReviewStageCounts(stage, found, verified, refuted) {
530
+ if (!stage)
531
+ return `${found} found \xB7 ${verified} verified`;
532
+ if (stage === "synthesizing") {
533
+ const parts = [`${verified} verified`];
534
+ if (refuted > 0)
535
+ parts.push(`${refuted} refuted`);
536
+ parts.push("deduping");
537
+ return parts.join(" \xB7 ");
538
+ }
539
+ if (stage === "verifying") {
540
+ const parts = [`${found} found`, `${verified} verified`];
541
+ if (refuted > 0)
542
+ parts.push(`${refuted} refuted`);
543
+ return parts.join(" \xB7 ");
544
+ }
545
+ return found > 0 ? `${found} found` : "finding";
546
+ }
547
+ function RainbowText({
548
+ text,
549
+ phase = 0
550
+ }) {
551
+ return /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(jsx_dev_runtime3.Fragment, {
552
+ children: [...text].map((ch, i) => /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
553
+ color: getRainbowColor(i + phase),
554
+ children: ch
555
+ }, i, false, undefined, this))
556
+ }, undefined, false, undefined, this);
557
+ }
558
+ function useSmoothCount(target, time, snap) {
559
+ const displayed = import_react2.useRef(target);
560
+ const lastTick = import_react2.useRef(time);
561
+ if (snap || target < displayed.current) {
562
+ displayed.current = target;
563
+ } else if (target > displayed.current && time !== lastTick.current) {
564
+ displayed.current += 1;
565
+ lastTick.current = time;
566
+ }
567
+ return displayed.current;
568
+ }
569
+ function ReviewRainbowLine({
570
+ session
571
+ }) {
572
+ const settings = useSettings();
573
+ const reducedMotion = settings.prefersReducedMotion ?? false;
574
+ const p = session.reviewProgress;
575
+ const running = session.status === "running";
576
+ const [, time] = useAnimationFrame(running && !reducedMotion ? TICK_MS : null);
577
+ const targetFound = p?.bugsFound ?? 0;
578
+ const targetVerified = p?.bugsVerified ?? 0;
579
+ const targetRefuted = p?.bugsRefuted ?? 0;
580
+ const snap = reducedMotion || !running;
581
+ const found = useSmoothCount(targetFound, time, snap);
582
+ const verified = useSmoothCount(targetVerified, time, snap);
583
+ const refuted = useSmoothCount(targetRefuted, time, snap);
584
+ const phase = Math.floor(time / (TICK_MS * 3)) % 7;
585
+ if (session.status === "completed") {
586
+ return /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(jsx_dev_runtime3.Fragment, {
587
+ children: [
588
+ /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
589
+ color: "background",
590
+ children: [
591
+ DIAMOND_FILLED,
592
+ " "
593
+ ]
594
+ }, undefined, true, undefined, this),
595
+ /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(RainbowText, {
596
+ text: "ultrareview",
597
+ phase: 0
598
+ }, undefined, false, undefined, this),
599
+ /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
600
+ dimColor: true,
601
+ children: " ready \xB7 shift+\u2193 to view"
602
+ }, undefined, false, undefined, this)
603
+ ]
604
+ }, undefined, true, undefined, this);
605
+ }
606
+ if (session.status === "failed") {
607
+ return /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(jsx_dev_runtime3.Fragment, {
608
+ children: [
609
+ /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
610
+ color: "background",
611
+ children: [
612
+ DIAMOND_FILLED,
613
+ " "
614
+ ]
615
+ }, undefined, true, undefined, this),
616
+ /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(RainbowText, {
617
+ text: "ultrareview",
618
+ phase: 0
619
+ }, undefined, false, undefined, this),
620
+ /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
621
+ color: "error",
622
+ dimColor: true,
623
+ children: [
624
+ " \xB7 ",
625
+ "error"
626
+ ]
627
+ }, undefined, true, undefined, this)
628
+ ]
629
+ }, undefined, true, undefined, this);
630
+ }
631
+ const tail = !p ? "setting up" : formatReviewStageCounts(p.stage, found, verified, refuted);
632
+ return /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(jsx_dev_runtime3.Fragment, {
633
+ children: [
634
+ /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
635
+ color: "background",
636
+ children: [
637
+ DIAMOND_OPEN,
638
+ " "
639
+ ]
640
+ }, undefined, true, undefined, this),
641
+ /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(RainbowText, {
642
+ text: "ultrareview",
643
+ phase: running ? phase : 0
644
+ }, undefined, false, undefined, this),
645
+ /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
646
+ dimColor: true,
647
+ children: [
648
+ " \xB7 ",
649
+ tail
650
+ ]
651
+ }, undefined, true, undefined, this)
652
+ ]
653
+ }, undefined, true, undefined, this);
654
+ }
655
+ function RemoteSessionProgress({
656
+ session
657
+ }) {
658
+ if (session.isRemoteReview) {
659
+ return /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ReviewRainbowLine, {
660
+ session
661
+ }, undefined, false, undefined, this);
662
+ }
663
+ if (session.status === "completed") {
664
+ return /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
665
+ bold: true,
666
+ color: "success",
667
+ dimColor: true,
668
+ children: "done"
669
+ }, undefined, false, undefined, this);
670
+ }
671
+ if (session.status === "failed") {
672
+ return /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
673
+ bold: true,
674
+ color: "error",
675
+ dimColor: true,
676
+ children: "error"
677
+ }, undefined, false, undefined, this);
678
+ }
679
+ if (!session.todoList.length) {
680
+ return /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
681
+ dimColor: true,
682
+ children: [
683
+ session.status,
684
+ "\u2026"
685
+ ]
686
+ }, undefined, true, undefined, this);
687
+ }
688
+ const completed = count(session.todoList, (_) => _.status === "completed");
689
+ const total = session.todoList.length;
690
+ return /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
691
+ dimColor: true,
692
+ children: [
693
+ completed,
694
+ "/",
695
+ total
696
+ ]
697
+ }, undefined, true, undefined, this);
698
+ }
699
+ var import_react2, jsx_dev_runtime3, TICK_MS = 80;
700
+ var init_RemoteSessionProgress = __esm(() => {
701
+ init_figures2();
702
+ init_useSettings();
703
+ init_src();
704
+ init_array();
705
+ init_thinking();
706
+ import_react2 = __toESM(require_react(), 1);
707
+ jsx_dev_runtime3 = __toESM(require_jsx_dev_runtime(), 1);
708
+ });
709
+
710
+ // src/components/tasks/ShellProgress.tsx
711
+ function TaskStatusText({
712
+ status,
713
+ label,
714
+ suffix
715
+ }) {
716
+ const displayLabel = label ?? status;
717
+ const color = status === "completed" ? "success" : status === "failed" ? "error" : status === "killed" ? "warning" : undefined;
718
+ return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
719
+ color,
720
+ dimColor: true,
721
+ children: [
722
+ "(",
723
+ displayLabel,
724
+ suffix,
725
+ ")"
726
+ ]
727
+ }, undefined, true, undefined, this);
728
+ }
729
+ function ShellProgress({
730
+ shell
731
+ }) {
732
+ switch (shell.status) {
733
+ case "completed":
734
+ return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(TaskStatusText, {
735
+ status: "completed",
736
+ label: "done"
737
+ }, undefined, false, undefined, this);
738
+ case "failed":
739
+ return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(TaskStatusText, {
740
+ status: "failed",
741
+ label: "error"
742
+ }, undefined, false, undefined, this);
743
+ case "killed":
744
+ return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(TaskStatusText, {
745
+ status: "killed",
746
+ label: "stopped"
747
+ }, undefined, false, undefined, this);
748
+ case "running":
749
+ case "pending":
750
+ return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(TaskStatusText, {
751
+ status: "running"
752
+ }, undefined, false, undefined, this);
753
+ }
754
+ }
755
+ var jsx_dev_runtime4;
756
+ var init_ShellProgress = __esm(() => {
757
+ init_src();
758
+ jsx_dev_runtime4 = __toESM(require_jsx_dev_runtime(), 1);
759
+ });
760
+
761
+ // src/components/tasks/BackgroundTask.tsx
762
+ function BackgroundTask({
763
+ task,
764
+ maxActivityWidth
765
+ }) {
766
+ const activityLimit = maxActivityWidth ?? 40;
767
+ switch (task.type) {
768
+ case "local_bash":
769
+ return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
770
+ children: [
771
+ truncate(task.kind === "monitor" ? task.description : task.command, activityLimit, true),
772
+ " ",
773
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ShellProgress, {
774
+ shell: task
775
+ }, undefined, false, undefined, this)
776
+ ]
777
+ }, undefined, true, undefined, this);
778
+ case "remote_agent": {
779
+ if (task.isRemoteReview) {
780
+ return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
781
+ children: /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(RemoteSessionProgress, {
782
+ session: task
783
+ }, undefined, false, undefined, this)
784
+ }, undefined, false, undefined, this);
785
+ }
786
+ const running = task.status === "running" || task.status === "pending";
787
+ return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
788
+ children: [
789
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
790
+ dimColor: true,
791
+ children: [
792
+ running ? DIAMOND_OPEN : DIAMOND_FILLED,
793
+ " "
794
+ ]
795
+ }, undefined, true, undefined, this),
796
+ truncate(task.title, activityLimit, true),
797
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
798
+ dimColor: true,
799
+ children: " \xB7 "
800
+ }, undefined, false, undefined, this),
801
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(RemoteSessionProgress, {
802
+ session: task
803
+ }, undefined, false, undefined, this)
804
+ ]
805
+ }, undefined, true, undefined, this);
806
+ }
807
+ case "local_agent":
808
+ return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
809
+ children: [
810
+ truncate(task.description, activityLimit, true),
811
+ " ",
812
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(TaskStatusText, {
813
+ status: task.status,
814
+ label: task.status === "completed" ? "done" : undefined,
815
+ suffix: task.status === "completed" && !task.notified ? ", unread" : undefined
816
+ }, undefined, false, undefined, this)
817
+ ]
818
+ }, undefined, true, undefined, this);
819
+ case "in_process_teammate": {
820
+ const activity = describeTeammateActivity(task);
821
+ return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
822
+ children: [
823
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
824
+ color: toInkColor(task.identity.color),
825
+ children: [
826
+ "@",
827
+ task.identity.agentName
828
+ ]
829
+ }, undefined, true, undefined, this),
830
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
831
+ dimColor: true,
832
+ children: [
833
+ ": ",
834
+ truncate(activity, activityLimit, true)
835
+ ]
836
+ }, undefined, true, undefined, this)
837
+ ]
838
+ }, undefined, true, undefined, this);
839
+ }
840
+ case "local_workflow":
841
+ return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
842
+ children: [
843
+ truncate(task.workflowName ?? task.summary ?? task.description, activityLimit, true),
844
+ " ",
845
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(TaskStatusText, {
846
+ status: task.status,
847
+ label: task.status === "running" ? `${task.agentCount} ${plural(task.agentCount, "agent")}` : task.status === "completed" ? "done" : undefined,
848
+ suffix: task.status === "completed" && !task.notified ? ", unread" : undefined
849
+ }, undefined, false, undefined, this)
850
+ ]
851
+ }, undefined, true, undefined, this);
852
+ case "monitor_mcp":
853
+ return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
854
+ children: [
855
+ truncate(task.description, activityLimit, true),
856
+ " ",
857
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(TaskStatusText, {
858
+ status: task.status,
859
+ label: task.status === "completed" ? "done" : undefined,
860
+ suffix: task.status === "completed" && !task.notified ? ", unread" : undefined
861
+ }, undefined, false, undefined, this)
862
+ ]
863
+ }, undefined, true, undefined, this);
864
+ case "dream": {
865
+ const n = task.filesTouched.length;
866
+ const detail = task.phase === "updating" && n > 0 ? `${n} ${plural(n, "file")}` : `${task.sessionsReviewing} ${plural(task.sessionsReviewing, "session")}`;
867
+ return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
868
+ children: [
869
+ task.description,
870
+ " ",
871
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
872
+ dimColor: true,
873
+ children: [
874
+ "\xB7 ",
875
+ task.phase,
876
+ " \xB7 ",
877
+ detail
878
+ ]
879
+ }, undefined, true, undefined, this),
880
+ " ",
881
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(TaskStatusText, {
882
+ status: task.status,
883
+ label: task.status === "completed" ? "done" : undefined,
884
+ suffix: task.status === "completed" && !task.notified ? ", unread" : undefined
885
+ }, undefined, false, undefined, this)
886
+ ]
887
+ }, undefined, true, undefined, this);
888
+ }
889
+ }
890
+ }
891
+ var jsx_dev_runtime5;
892
+ var init_BackgroundTask = __esm(() => {
893
+ init_src();
894
+ init_ink();
895
+ init_format();
896
+ init_stringUtils();
897
+ init_figures2();
898
+ init_RemoteSessionProgress();
899
+ init_ShellProgress();
900
+ init_taskStatusUtils();
901
+ jsx_dev_runtime5 = __toESM(require_jsx_dev_runtime(), 1);
902
+ });
903
+
904
+ // src/components/tasks/DreamDetailDialog.tsx
905
+ function DreamDetailDialog({
906
+ task,
907
+ onDone,
908
+ onBack,
909
+ onKill
910
+ }) {
911
+ const elapsedTime = useElapsedTime(task.startTime, task.status === "running", 1000, 0);
912
+ useKeybindings({ "confirm:yes": onDone }, { context: "Confirmation" });
913
+ const handleKeyDown = (e) => {
914
+ if (e.key === " ") {
915
+ e.preventDefault();
916
+ onDone();
917
+ } else if (e.key === "left" && onBack) {
918
+ e.preventDefault();
919
+ onBack();
920
+ } else if (e.key === "x" && task.status === "running" && onKill) {
921
+ e.preventDefault();
922
+ onKill();
923
+ }
924
+ };
925
+ const visibleTurns = task.turns.filter((t) => t.text !== "");
926
+ const shown = visibleTurns.slice(-VISIBLE_TURNS);
927
+ const hidden = visibleTurns.length - shown.length;
928
+ return /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedBox_default, {
929
+ flexDirection: "column",
930
+ tabIndex: 0,
931
+ autoFocus: true,
932
+ onKeyDown: handleKeyDown,
933
+ children: /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Dialog, {
934
+ title: "Memory consolidation",
935
+ subtitle: /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedText, {
936
+ dimColor: true,
937
+ children: [
938
+ elapsedTime,
939
+ " \xB7 reviewing ",
940
+ task.sessionsReviewing,
941
+ " ",
942
+ plural(task.sessionsReviewing, "session"),
943
+ task.filesTouched.length > 0 && /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(jsx_dev_runtime6.Fragment, {
944
+ children: [
945
+ " ",
946
+ "\xB7 ",
947
+ task.filesTouched.length,
948
+ " ",
949
+ plural(task.filesTouched.length, "file"),
950
+ " touched"
951
+ ]
952
+ }, undefined, true, undefined, this)
953
+ ]
954
+ }, undefined, true, undefined, this),
955
+ onCancel: onDone,
956
+ color: "background",
957
+ inputGuide: (exitState) => exitState.pending ? /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedText, {
958
+ children: [
959
+ "Press ",
960
+ exitState.keyName,
961
+ " again to exit"
962
+ ]
963
+ }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Byline, {
964
+ children: [
965
+ onBack && /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(KeyboardShortcutHint, {
966
+ shortcut: "\u2190",
967
+ action: "go back"
968
+ }, undefined, false, undefined, this),
969
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(KeyboardShortcutHint, {
970
+ shortcut: "Esc/Enter/Space",
971
+ action: "close"
972
+ }, undefined, false, undefined, this),
973
+ task.status === "running" && onKill && /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(KeyboardShortcutHint, {
974
+ shortcut: "x",
975
+ action: "stop"
976
+ }, undefined, false, undefined, this)
977
+ ]
978
+ }, undefined, true, undefined, this),
979
+ children: /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedBox_default, {
980
+ flexDirection: "column",
981
+ gap: 1,
982
+ children: [
983
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedText, {
984
+ children: [
985
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedText, {
986
+ bold: true,
987
+ children: "Status:"
988
+ }, undefined, false, undefined, this),
989
+ " ",
990
+ task.status === "running" ? /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedText, {
991
+ color: "background",
992
+ children: "running"
993
+ }, undefined, false, undefined, this) : task.status === "completed" ? /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedText, {
994
+ color: "success",
995
+ children: task.status
996
+ }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedText, {
997
+ color: "error",
998
+ children: task.status
999
+ }, undefined, false, undefined, this)
1000
+ ]
1001
+ }, undefined, true, undefined, this),
1002
+ shown.length === 0 ? /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedText, {
1003
+ dimColor: true,
1004
+ children: task.status === "running" ? "Starting\u2026" : "(no text output)"
1005
+ }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(jsx_dev_runtime6.Fragment, {
1006
+ children: [
1007
+ hidden > 0 && /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedText, {
1008
+ dimColor: true,
1009
+ children: [
1010
+ "(",
1011
+ hidden,
1012
+ " earlier ",
1013
+ plural(hidden, "turn"),
1014
+ ")"
1015
+ ]
1016
+ }, undefined, true, undefined, this),
1017
+ shown.map((turn, i) => /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedBox_default, {
1018
+ flexDirection: "column",
1019
+ children: [
1020
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedText, {
1021
+ wrap: "wrap",
1022
+ children: turn.text
1023
+ }, undefined, false, undefined, this),
1024
+ turn.toolUseCount > 0 && /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedText, {
1025
+ dimColor: true,
1026
+ children: [
1027
+ " ",
1028
+ "(",
1029
+ turn.toolUseCount,
1030
+ " ",
1031
+ plural(turn.toolUseCount, "tool"),
1032
+ ")"
1033
+ ]
1034
+ }, undefined, true, undefined, this)
1035
+ ]
1036
+ }, i, true, undefined, this))
1037
+ ]
1038
+ }, undefined, true, undefined, this)
1039
+ ]
1040
+ }, undefined, true, undefined, this)
1041
+ }, undefined, false, undefined, this)
1042
+ }, undefined, false, undefined, this);
1043
+ }
1044
+ var jsx_dev_runtime6, VISIBLE_TURNS = 6;
1045
+ var init_DreamDetailDialog = __esm(() => {
1046
+ init_useElapsedTime();
1047
+ init_src();
1048
+ init_useKeybinding();
1049
+ init_stringUtils();
1050
+ init_src();
1051
+ jsx_dev_runtime6 = __toESM(require_jsx_dev_runtime(), 1);
1052
+ });
1053
+
1054
+ // src/components/tasks/InProcessTeammateDetailDialog.tsx
1055
+ function InProcessTeammateDetailDialog({
1056
+ teammate,
1057
+ onDone,
1058
+ onKill,
1059
+ onBack,
1060
+ onForeground
1061
+ }) {
1062
+ const [theme] = useTheme();
1063
+ const tools = import_react3.useMemo(() => getTools(getEmptyToolPermissionContext()), []);
1064
+ const elapsedTime = useElapsedTime(teammate.startTime, teammate.status === "running", 1000, teammate.totalPausedMs ?? 0);
1065
+ useKeybindings({
1066
+ "confirm:yes": onDone
1067
+ }, { context: "Confirmation" });
1068
+ const handleKeyDown = (e) => {
1069
+ if (e.key === " ") {
1070
+ e.preventDefault();
1071
+ onDone();
1072
+ } else if (e.key === "left" && onBack) {
1073
+ e.preventDefault();
1074
+ onBack();
1075
+ } else if (e.key === "x" && teammate.status === "running" && onKill) {
1076
+ e.preventDefault();
1077
+ onKill();
1078
+ } else if (e.key === "f" && teammate.status === "running" && onForeground) {
1079
+ e.preventDefault();
1080
+ onForeground();
1081
+ }
1082
+ };
1083
+ const activity = describeTeammateActivity(teammate);
1084
+ const tokenCount = teammate.result?.totalTokens ?? teammate.progress?.tokenCount;
1085
+ const toolUseCount = teammate.result?.totalToolUseCount ?? teammate.progress?.toolUseCount;
1086
+ const displayPrompt = truncateToWidth(teammate.prompt, 300);
1087
+ const title = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
1088
+ children: [
1089
+ /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
1090
+ color: toInkColor(teammate.identity.color),
1091
+ children: [
1092
+ "@",
1093
+ teammate.identity.agentName
1094
+ ]
1095
+ }, undefined, true, undefined, this),
1096
+ activity && /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
1097
+ dimColor: true,
1098
+ children: [
1099
+ " (",
1100
+ activity,
1101
+ ")"
1102
+ ]
1103
+ }, undefined, true, undefined, this)
1104
+ ]
1105
+ }, undefined, true, undefined, this);
1106
+ const subtitle = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
1107
+ children: [
1108
+ teammate.status !== "running" && /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
1109
+ color: teammate.status === "completed" ? "success" : teammate.status === "killed" ? "warning" : "error",
1110
+ children: [
1111
+ teammate.status === "completed" ? "Completed" : teammate.status === "failed" ? "Failed" : "Stopped",
1112
+ " \xB7 "
1113
+ ]
1114
+ }, undefined, true, undefined, this),
1115
+ /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
1116
+ dimColor: true,
1117
+ children: [
1118
+ elapsedTime,
1119
+ tokenCount !== undefined && tokenCount > 0 && /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(jsx_dev_runtime7.Fragment, {
1120
+ children: [
1121
+ " \xB7 ",
1122
+ formatNumber(tokenCount),
1123
+ " tokens"
1124
+ ]
1125
+ }, undefined, true, undefined, this),
1126
+ toolUseCount !== undefined && toolUseCount > 0 && /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(jsx_dev_runtime7.Fragment, {
1127
+ children: [
1128
+ " ",
1129
+ "\xB7 ",
1130
+ toolUseCount,
1131
+ " ",
1132
+ toolUseCount === 1 ? "tool" : "tools"
1133
+ ]
1134
+ }, undefined, true, undefined, this)
1135
+ ]
1136
+ }, undefined, true, undefined, this)
1137
+ ]
1138
+ }, undefined, true, undefined, this);
1139
+ return /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedBox_default, {
1140
+ flexDirection: "column",
1141
+ tabIndex: 0,
1142
+ autoFocus: true,
1143
+ onKeyDown: handleKeyDown,
1144
+ children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Dialog, {
1145
+ title,
1146
+ subtitle,
1147
+ onCancel: onDone,
1148
+ color: "background",
1149
+ inputGuide: (exitState) => exitState.pending ? /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
1150
+ children: [
1151
+ "Press ",
1152
+ exitState.keyName,
1153
+ " again to exit"
1154
+ ]
1155
+ }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Byline, {
1156
+ children: [
1157
+ onBack && /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(KeyboardShortcutHint, {
1158
+ shortcut: "\u2190",
1159
+ action: "go back"
1160
+ }, undefined, false, undefined, this),
1161
+ /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(KeyboardShortcutHint, {
1162
+ shortcut: "Esc/Enter/Space",
1163
+ action: "close"
1164
+ }, undefined, false, undefined, this),
1165
+ teammate.status === "running" && onKill && /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(KeyboardShortcutHint, {
1166
+ shortcut: "x",
1167
+ action: "stop"
1168
+ }, undefined, false, undefined, this),
1169
+ teammate.status === "running" && onForeground && /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(KeyboardShortcutHint, {
1170
+ shortcut: "f",
1171
+ action: "foreground"
1172
+ }, undefined, false, undefined, this)
1173
+ ]
1174
+ }, undefined, true, undefined, this),
1175
+ children: [
1176
+ teammate.status === "running" && teammate.progress?.recentActivities && teammate.progress.recentActivities.length > 0 && /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedBox_default, {
1177
+ flexDirection: "column",
1178
+ children: [
1179
+ /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
1180
+ bold: true,
1181
+ dimColor: true,
1182
+ children: "Progress"
1183
+ }, undefined, false, undefined, this),
1184
+ teammate.progress.recentActivities.map((activity2, i) => /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
1185
+ dimColor: i < teammate.progress.recentActivities.length - 1,
1186
+ wrap: "truncate-end",
1187
+ children: [
1188
+ i === teammate.progress.recentActivities.length - 1 ? "\u203A " : " ",
1189
+ renderToolActivity(activity2, tools, theme)
1190
+ ]
1191
+ }, i, true, undefined, this))
1192
+ ]
1193
+ }, undefined, true, undefined, this),
1194
+ /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedBox_default, {
1195
+ flexDirection: "column",
1196
+ marginTop: 1,
1197
+ children: [
1198
+ /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
1199
+ bold: true,
1200
+ dimColor: true,
1201
+ children: "Prompt"
1202
+ }, undefined, false, undefined, this),
1203
+ /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
1204
+ wrap: "wrap",
1205
+ children: displayPrompt
1206
+ }, undefined, false, undefined, this)
1207
+ ]
1208
+ }, undefined, true, undefined, this),
1209
+ teammate.status === "failed" && teammate.error && /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedBox_default, {
1210
+ flexDirection: "column",
1211
+ marginTop: 1,
1212
+ children: [
1213
+ /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
1214
+ bold: true,
1215
+ color: "error",
1216
+ children: "Error"
1217
+ }, undefined, false, undefined, this),
1218
+ /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
1219
+ color: "error",
1220
+ wrap: "wrap",
1221
+ children: teammate.error
1222
+ }, undefined, false, undefined, this)
1223
+ ]
1224
+ }, undefined, true, undefined, this)
1225
+ ]
1226
+ }, undefined, true, undefined, this)
1227
+ }, undefined, false, undefined, this);
1228
+ }
1229
+ var import_react3, jsx_dev_runtime7;
1230
+ var init_InProcessTeammateDetailDialog = __esm(() => {
1231
+ init_useElapsedTime();
1232
+ init_src();
1233
+ init_useKeybinding();
1234
+ init_Tool();
1235
+ init_tools();
1236
+ init_format();
1237
+ init_src();
1238
+ init_ink();
1239
+ init_renderToolActivity();
1240
+ init_taskStatusUtils();
1241
+ import_react3 = __toESM(require_react(), 1);
1242
+ jsx_dev_runtime7 = __toESM(require_jsx_dev_runtime(), 1);
1243
+ });
1244
+
1245
+ // src/components/tasks/RemoteSessionDetailDialog.tsx
1246
+ function formatToolUseSummary(name, input) {
1247
+ if (name === EXIT_PLAN_MODE_V2_TOOL_NAME) {
1248
+ return "Review the plan in Claude Code on the web";
1249
+ }
1250
+ if (!input || typeof input !== "object")
1251
+ return name;
1252
+ if (name === ASK_USER_QUESTION_TOOL_NAME && "questions" in input) {
1253
+ const qs = input.questions;
1254
+ if (Array.isArray(qs) && qs[0] && typeof qs[0] === "object") {
1255
+ const q = "question" in qs[0] && typeof qs[0].question === "string" && qs[0].question ? qs[0].question : ("header" in qs[0]) && typeof qs[0].header === "string" ? qs[0].header : null;
1256
+ if (q) {
1257
+ const oneLine = q.replace(/\s+/g, " ").trim();
1258
+ return `Answer in browser: ${truncateToWidth(oneLine, 50)}`;
1259
+ }
1260
+ }
1261
+ }
1262
+ for (const v of Object.values(input)) {
1263
+ if (typeof v === "string" && v.trim()) {
1264
+ const oneLine = v.replace(/\s+/g, " ").trim();
1265
+ return `${name} ${truncateToWidth(oneLine, 60)}`;
1266
+ }
1267
+ }
1268
+ return name;
1269
+ }
1270
+ function UltraplanSessionDetail({
1271
+ session,
1272
+ onDone,
1273
+ onBack,
1274
+ onKill
1275
+ }) {
1276
+ const running = session.status === "running" || session.status === "pending";
1277
+ const phase = session.ultraplanPhase;
1278
+ const statusText = running ? phase ? PHASE_LABEL[phase] : "running" : session.status;
1279
+ const elapsedTime = useElapsedTime(session.startTime, running, 1000, 0, session.endTime);
1280
+ const { agentsWorking, toolCalls, lastToolCall } = import_react4.useMemo(() => {
1281
+ let spawns = 0;
1282
+ let calls = 0;
1283
+ let lastBlock = null;
1284
+ for (const msg of session.log) {
1285
+ if (msg.type !== "assistant")
1286
+ continue;
1287
+ for (const block of msg.message.content) {
1288
+ if (block.type !== "tool_use")
1289
+ continue;
1290
+ calls++;
1291
+ lastBlock = block;
1292
+ if (block.name === AGENT_TOOL_NAME || block.name === LEGACY_AGENT_TOOL_NAME) {
1293
+ spawns++;
1294
+ }
1295
+ }
1296
+ }
1297
+ return {
1298
+ agentsWorking: 1 + spawns,
1299
+ toolCalls: calls,
1300
+ lastToolCall: lastBlock ? formatToolUseSummary(lastBlock.name, lastBlock.input) : null
1301
+ };
1302
+ }, [session.log]);
1303
+ const sessionUrl = getRemoteTaskSessionUrl(session.sessionId);
1304
+ const goBackOrClose = onBack ?? (() => onDone("Remote session details dismissed", { display: "system" }));
1305
+ const [confirmingStop, setConfirmingStop] = import_react4.useState(false);
1306
+ if (confirmingStop) {
1307
+ return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Dialog, {
1308
+ title: "Stop ultraplan?",
1309
+ onCancel: () => setConfirmingStop(false),
1310
+ color: "background",
1311
+ children: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedBox_default, {
1312
+ flexDirection: "column",
1313
+ gap: 1,
1314
+ children: [
1315
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1316
+ dimColor: true,
1317
+ children: "This will terminate the Claude Code on the web session."
1318
+ }, undefined, false, undefined, this),
1319
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Select, {
1320
+ options: [
1321
+ { label: "Terminate session", value: "stop" },
1322
+ { label: "Back", value: "back" }
1323
+ ],
1324
+ onChange: (v) => {
1325
+ if (v === "stop") {
1326
+ onKill?.();
1327
+ goBackOrClose();
1328
+ } else {
1329
+ setConfirmingStop(false);
1330
+ }
1331
+ }
1332
+ }, undefined, false, undefined, this)
1333
+ ]
1334
+ }, undefined, true, undefined, this)
1335
+ }, undefined, false, undefined, this);
1336
+ }
1337
+ return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Dialog, {
1338
+ title: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1339
+ children: [
1340
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1341
+ color: "background",
1342
+ children: [
1343
+ phase === "plan_ready" ? DIAMOND_FILLED : DIAMOND_OPEN,
1344
+ " "
1345
+ ]
1346
+ }, undefined, true, undefined, this),
1347
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1348
+ bold: true,
1349
+ children: "ultraplan"
1350
+ }, undefined, false, undefined, this),
1351
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1352
+ dimColor: true,
1353
+ children: [
1354
+ " \xB7 ",
1355
+ elapsedTime,
1356
+ " \xB7 ",
1357
+ statusText
1358
+ ]
1359
+ }, undefined, true, undefined, this)
1360
+ ]
1361
+ }, undefined, true, undefined, this),
1362
+ onCancel: goBackOrClose,
1363
+ color: "background",
1364
+ children: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedBox_default, {
1365
+ flexDirection: "column",
1366
+ gap: 1,
1367
+ children: [
1368
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1369
+ children: [
1370
+ phase === "plan_ready" && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1371
+ color: "success",
1372
+ children: [
1373
+ figures_default.tick,
1374
+ " "
1375
+ ]
1376
+ }, undefined, true, undefined, this),
1377
+ agentsWorking,
1378
+ " ",
1379
+ plural(agentsWorking, "agent"),
1380
+ " ",
1381
+ phase ? AGENT_VERB[phase] : "working",
1382
+ " \xB7 ",
1383
+ toolCalls,
1384
+ " tool",
1385
+ " ",
1386
+ plural(toolCalls, "call")
1387
+ ]
1388
+ }, undefined, true, undefined, this),
1389
+ lastToolCall && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1390
+ dimColor: true,
1391
+ children: lastToolCall
1392
+ }, undefined, false, undefined, this),
1393
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Link, {
1394
+ url: sessionUrl,
1395
+ children: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1396
+ dimColor: true,
1397
+ children: sessionUrl
1398
+ }, undefined, false, undefined, this)
1399
+ }, undefined, false, undefined, this),
1400
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Select, {
1401
+ options: [
1402
+ {
1403
+ label: "Review in Claude Code on the web",
1404
+ value: "open"
1405
+ },
1406
+ ...onKill && running ? [{ label: "Stop ultraplan", value: "stop" }] : [],
1407
+ { label: "Back", value: "back" }
1408
+ ],
1409
+ onChange: (v) => {
1410
+ switch (v) {
1411
+ case "open":
1412
+ openBrowser(sessionUrl);
1413
+ onDone();
1414
+ return;
1415
+ case "stop":
1416
+ setConfirmingStop(true);
1417
+ return;
1418
+ case "back":
1419
+ goBackOrClose();
1420
+ return;
1421
+ }
1422
+ }
1423
+ }, undefined, false, undefined, this)
1424
+ ]
1425
+ }, undefined, true, undefined, this)
1426
+ }, undefined, false, undefined, this);
1427
+ }
1428
+ function StagePipeline({
1429
+ stage,
1430
+ completed,
1431
+ hasProgress
1432
+ }) {
1433
+ const currentIdx = stage ? STAGES.indexOf(stage) : -1;
1434
+ const inSetup = !completed && !hasProgress;
1435
+ return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1436
+ children: [
1437
+ inSetup ? /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1438
+ color: "background",
1439
+ children: "Setup"
1440
+ }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1441
+ dimColor: true,
1442
+ children: "Setup"
1443
+ }, undefined, false, undefined, this),
1444
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1445
+ dimColor: true,
1446
+ children: " \u2192 "
1447
+ }, undefined, false, undefined, this),
1448
+ STAGES.map((s, i) => {
1449
+ const isCurrent = !completed && !inSetup && i === currentIdx;
1450
+ return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(import_react4.default.Fragment, {
1451
+ children: [
1452
+ i > 0 && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1453
+ dimColor: true,
1454
+ children: " \u2192 "
1455
+ }, undefined, false, undefined, this),
1456
+ isCurrent ? /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1457
+ color: "background",
1458
+ children: STAGE_LABELS[s]
1459
+ }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1460
+ dimColor: true,
1461
+ children: STAGE_LABELS[s]
1462
+ }, undefined, false, undefined, this)
1463
+ ]
1464
+ }, s, true, undefined, this);
1465
+ }),
1466
+ completed && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1467
+ color: "success",
1468
+ children: " \u2713"
1469
+ }, undefined, false, undefined, this)
1470
+ ]
1471
+ }, undefined, true, undefined, this);
1472
+ }
1473
+ function reviewCountsLine(session) {
1474
+ const p = session.reviewProgress;
1475
+ if (!p)
1476
+ return session.status === "completed" ? "done" : "setting up";
1477
+ const verified = p.bugsVerified;
1478
+ const refuted = p.bugsRefuted ?? 0;
1479
+ if (session.status === "completed") {
1480
+ const parts = [`${verified} ${plural(verified, "finding")}`];
1481
+ if (refuted > 0)
1482
+ parts.push(`${refuted} refuted`);
1483
+ return parts.join(" \xB7 ");
1484
+ }
1485
+ return formatReviewStageCounts(p.stage, p.bugsFound, verified, refuted);
1486
+ }
1487
+ function ReviewSessionDetail({
1488
+ session,
1489
+ onDone,
1490
+ onBack,
1491
+ onKill
1492
+ }) {
1493
+ const completed = session.status === "completed";
1494
+ const running = session.status === "running" || session.status === "pending";
1495
+ const [confirmingStop, setConfirmingStop] = import_react4.useState(false);
1496
+ const elapsedTime = useElapsedTime(session.startTime, running, 1000, 0, session.endTime);
1497
+ const handleClose = () => onDone("Remote session details dismissed", { display: "system" });
1498
+ const goBackOrClose = onBack ?? handleClose;
1499
+ const sessionUrl = getRemoteTaskSessionUrl(session.sessionId);
1500
+ const statusLabel = completed ? "ready" : running ? "running" : session.status;
1501
+ if (confirmingStop) {
1502
+ return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Dialog, {
1503
+ title: "Stop ultrareview?",
1504
+ onCancel: () => setConfirmingStop(false),
1505
+ color: "background",
1506
+ children: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedBox_default, {
1507
+ flexDirection: "column",
1508
+ gap: 1,
1509
+ children: [
1510
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1511
+ dimColor: true,
1512
+ children: "This archives the remote session and stops local tracking. The review will not complete and any findings so far are discarded."
1513
+ }, undefined, false, undefined, this),
1514
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Select, {
1515
+ options: [
1516
+ { label: "Stop ultrareview", value: "stop" },
1517
+ { label: "Back", value: "back" }
1518
+ ],
1519
+ onChange: (v) => {
1520
+ if (v === "stop") {
1521
+ onKill?.();
1522
+ goBackOrClose();
1523
+ } else {
1524
+ setConfirmingStop(false);
1525
+ }
1526
+ }
1527
+ }, undefined, false, undefined, this)
1528
+ ]
1529
+ }, undefined, true, undefined, this)
1530
+ }, undefined, false, undefined, this);
1531
+ }
1532
+ const options = completed ? [
1533
+ { label: "Open in Claude Code on the web", value: "open" },
1534
+ { label: "Dismiss", value: "dismiss" }
1535
+ ] : [
1536
+ { label: "Open in Claude Code on the web", value: "open" },
1537
+ ...onKill && running ? [{ label: "Stop ultrareview", value: "stop" }] : [],
1538
+ { label: "Back", value: "back" }
1539
+ ];
1540
+ const handleSelect = (action) => {
1541
+ switch (action) {
1542
+ case "open":
1543
+ openBrowser(sessionUrl);
1544
+ onDone();
1545
+ break;
1546
+ case "stop":
1547
+ setConfirmingStop(true);
1548
+ break;
1549
+ case "back":
1550
+ goBackOrClose();
1551
+ break;
1552
+ case "dismiss":
1553
+ handleClose();
1554
+ break;
1555
+ }
1556
+ };
1557
+ return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Dialog, {
1558
+ title: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1559
+ children: [
1560
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1561
+ color: "background",
1562
+ children: [
1563
+ completed ? DIAMOND_FILLED : DIAMOND_OPEN,
1564
+ " "
1565
+ ]
1566
+ }, undefined, true, undefined, this),
1567
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1568
+ bold: true,
1569
+ children: "ultrareview"
1570
+ }, undefined, false, undefined, this),
1571
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1572
+ dimColor: true,
1573
+ children: [
1574
+ " \xB7 ",
1575
+ elapsedTime,
1576
+ " \xB7 ",
1577
+ statusLabel
1578
+ ]
1579
+ }, undefined, true, undefined, this)
1580
+ ]
1581
+ }, undefined, true, undefined, this),
1582
+ onCancel: goBackOrClose,
1583
+ color: "background",
1584
+ inputGuide: (exitState) => exitState.pending ? /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1585
+ children: [
1586
+ "Press ",
1587
+ exitState.keyName,
1588
+ " again to exit"
1589
+ ]
1590
+ }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Byline, {
1591
+ children: [
1592
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(KeyboardShortcutHint, {
1593
+ shortcut: "Enter",
1594
+ action: "select"
1595
+ }, undefined, false, undefined, this),
1596
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(KeyboardShortcutHint, {
1597
+ shortcut: "Esc",
1598
+ action: "go back"
1599
+ }, undefined, false, undefined, this)
1600
+ ]
1601
+ }, undefined, true, undefined, this),
1602
+ children: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedBox_default, {
1603
+ flexDirection: "column",
1604
+ gap: 1,
1605
+ children: [
1606
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(StagePipeline, {
1607
+ stage: session.reviewProgress?.stage,
1608
+ completed,
1609
+ hasProgress: !!session.reviewProgress
1610
+ }, undefined, false, undefined, this),
1611
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedBox_default, {
1612
+ flexDirection: "column",
1613
+ children: [
1614
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1615
+ children: reviewCountsLine(session)
1616
+ }, undefined, false, undefined, this),
1617
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Link, {
1618
+ url: sessionUrl,
1619
+ children: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1620
+ dimColor: true,
1621
+ children: sessionUrl
1622
+ }, undefined, false, undefined, this)
1623
+ }, undefined, false, undefined, this)
1624
+ ]
1625
+ }, undefined, true, undefined, this),
1626
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Select, {
1627
+ options,
1628
+ onChange: handleSelect
1629
+ }, undefined, false, undefined, this)
1630
+ ]
1631
+ }, undefined, true, undefined, this)
1632
+ }, undefined, false, undefined, this);
1633
+ }
1634
+ function RemoteSessionDetailDialog({
1635
+ session,
1636
+ toolUseContext,
1637
+ onDone,
1638
+ onBack,
1639
+ onKill
1640
+ }) {
1641
+ const [isTeleporting, setIsTeleporting] = import_react4.useState(false);
1642
+ const [teleportError, setTeleportError] = import_react4.useState(null);
1643
+ const lastMessages = import_react4.useMemo(() => {
1644
+ if (session.isUltraplan || session.isRemoteReview)
1645
+ return [];
1646
+ return normalizeMessages(toInternalMessages(session.log)).filter((_) => _.type !== "progress").slice(-3);
1647
+ }, [session]);
1648
+ if (session.isUltraplan) {
1649
+ return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(UltraplanSessionDetail, {
1650
+ session,
1651
+ onDone,
1652
+ onBack,
1653
+ onKill
1654
+ }, undefined, false, undefined, this);
1655
+ }
1656
+ if (session.isRemoteReview) {
1657
+ return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ReviewSessionDetail, {
1658
+ session,
1659
+ onDone,
1660
+ onBack,
1661
+ onKill
1662
+ }, undefined, false, undefined, this);
1663
+ }
1664
+ const handleClose = () => onDone("Remote session details dismissed", { display: "system" });
1665
+ const handleKeyDown = (e) => {
1666
+ if (e.key === " ") {
1667
+ e.preventDefault();
1668
+ onDone("Remote session details dismissed", { display: "system" });
1669
+ } else if (e.key === "left" && onBack) {
1670
+ e.preventDefault();
1671
+ onBack();
1672
+ } else if (e.key === "t" && !isTeleporting) {
1673
+ e.preventDefault();
1674
+ handleTeleport();
1675
+ } else if (e.key === "return") {
1676
+ e.preventDefault();
1677
+ handleClose();
1678
+ }
1679
+ };
1680
+ async function handleTeleport() {
1681
+ setIsTeleporting(true);
1682
+ setTeleportError(null);
1683
+ try {
1684
+ await teleportResumeCodeSession(session.sessionId);
1685
+ } catch (err) {
1686
+ setTeleportError(errorMessage(err));
1687
+ } finally {
1688
+ setIsTeleporting(false);
1689
+ }
1690
+ }
1691
+ const displayTitle = truncateToWidth(session.title, 50);
1692
+ const displayStatus = session.status === "pending" ? "starting" : session.status;
1693
+ return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedBox_default, {
1694
+ flexDirection: "column",
1695
+ tabIndex: 0,
1696
+ autoFocus: true,
1697
+ onKeyDown: handleKeyDown,
1698
+ children: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Dialog, {
1699
+ title: "Remote session details",
1700
+ onCancel: handleClose,
1701
+ color: "background",
1702
+ inputGuide: (exitState) => exitState.pending ? /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1703
+ children: [
1704
+ "Press ",
1705
+ exitState.keyName,
1706
+ " again to exit"
1707
+ ]
1708
+ }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Byline, {
1709
+ children: [
1710
+ onBack && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(KeyboardShortcutHint, {
1711
+ shortcut: "\u2190",
1712
+ action: "go back"
1713
+ }, undefined, false, undefined, this),
1714
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(KeyboardShortcutHint, {
1715
+ shortcut: "Esc/Enter/Space",
1716
+ action: "close"
1717
+ }, undefined, false, undefined, this),
1718
+ !isTeleporting && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(KeyboardShortcutHint, {
1719
+ shortcut: "t",
1720
+ action: "teleport"
1721
+ }, undefined, false, undefined, this)
1722
+ ]
1723
+ }, undefined, true, undefined, this),
1724
+ children: [
1725
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedBox_default, {
1726
+ flexDirection: "column",
1727
+ children: [
1728
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1729
+ children: [
1730
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1731
+ bold: true,
1732
+ children: "Status"
1733
+ }, undefined, false, undefined, this),
1734
+ ":",
1735
+ " ",
1736
+ displayStatus === "running" || displayStatus === "starting" ? /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1737
+ color: "background",
1738
+ children: displayStatus
1739
+ }, undefined, false, undefined, this) : displayStatus === "completed" ? /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1740
+ color: "success",
1741
+ children: displayStatus
1742
+ }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1743
+ color: "error",
1744
+ children: displayStatus
1745
+ }, undefined, false, undefined, this)
1746
+ ]
1747
+ }, undefined, true, undefined, this),
1748
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1749
+ children: [
1750
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1751
+ bold: true,
1752
+ children: "Runtime"
1753
+ }, undefined, false, undefined, this),
1754
+ ":",
1755
+ " ",
1756
+ formatDuration((session.endTime ?? Date.now()) - session.startTime)
1757
+ ]
1758
+ }, undefined, true, undefined, this),
1759
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1760
+ wrap: "truncate-end",
1761
+ children: [
1762
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1763
+ bold: true,
1764
+ children: "Title"
1765
+ }, undefined, false, undefined, this),
1766
+ ": ",
1767
+ displayTitle
1768
+ ]
1769
+ }, undefined, true, undefined, this),
1770
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1771
+ children: [
1772
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1773
+ bold: true,
1774
+ children: "Progress"
1775
+ }, undefined, false, undefined, this),
1776
+ ":",
1777
+ " ",
1778
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(RemoteSessionProgress, {
1779
+ session
1780
+ }, undefined, false, undefined, this)
1781
+ ]
1782
+ }, undefined, true, undefined, this),
1783
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1784
+ children: [
1785
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1786
+ bold: true,
1787
+ children: "Session URL"
1788
+ }, undefined, false, undefined, this),
1789
+ ":",
1790
+ " ",
1791
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Link, {
1792
+ url: getRemoteTaskSessionUrl(session.sessionId),
1793
+ children: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1794
+ dimColor: true,
1795
+ children: getRemoteTaskSessionUrl(session.sessionId)
1796
+ }, undefined, false, undefined, this)
1797
+ }, undefined, false, undefined, this)
1798
+ ]
1799
+ }, undefined, true, undefined, this)
1800
+ ]
1801
+ }, undefined, true, undefined, this),
1802
+ session.log.length > 0 && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedBox_default, {
1803
+ flexDirection: "column",
1804
+ marginTop: 1,
1805
+ children: [
1806
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1807
+ children: [
1808
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1809
+ bold: true,
1810
+ children: "Recent messages"
1811
+ }, undefined, false, undefined, this),
1812
+ ":"
1813
+ ]
1814
+ }, undefined, true, undefined, this),
1815
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedBox_default, {
1816
+ flexDirection: "column",
1817
+ height: 10,
1818
+ overflowY: "hidden",
1819
+ children: lastMessages.map((msg, i) => /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Message, {
1820
+ message: msg,
1821
+ lookups: EMPTY_LOOKUPS,
1822
+ addMargin: i > 0,
1823
+ tools: toolUseContext.options.tools,
1824
+ commands: toolUseContext.options.commands,
1825
+ verbose: toolUseContext.options.verbose,
1826
+ inProgressToolUseIDs: new Set,
1827
+ progressMessagesForMessage: [],
1828
+ shouldAnimate: false,
1829
+ shouldShowDot: false,
1830
+ style: "condensed",
1831
+ isTranscriptMode: false,
1832
+ isStatic: true
1833
+ }, i, false, undefined, this))
1834
+ }, undefined, false, undefined, this),
1835
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedBox_default, {
1836
+ marginTop: 1,
1837
+ children: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1838
+ dimColor: true,
1839
+ italic: true,
1840
+ children: [
1841
+ "Showing last ",
1842
+ lastMessages.length,
1843
+ " of ",
1844
+ session.log.length,
1845
+ " ",
1846
+ "messages"
1847
+ ]
1848
+ }, undefined, true, undefined, this)
1849
+ }, undefined, false, undefined, this)
1850
+ ]
1851
+ }, undefined, true, undefined, this),
1852
+ teleportError && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedBox_default, {
1853
+ marginTop: 1,
1854
+ children: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1855
+ color: "error",
1856
+ children: [
1857
+ "Teleport failed: ",
1858
+ teleportError
1859
+ ]
1860
+ }, undefined, true, undefined, this)
1861
+ }, undefined, false, undefined, this),
1862
+ isTeleporting && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1863
+ color: "background",
1864
+ children: "Teleporting to session\u2026"
1865
+ }, undefined, false, undefined, this)
1866
+ ]
1867
+ }, undefined, true, undefined, this)
1868
+ }, undefined, false, undefined, this);
1869
+ }
1870
+ var import_react4, jsx_dev_runtime8, PHASE_LABEL, AGENT_VERB, STAGES, STAGE_LABELS;
1871
+ var init_RemoteSessionDetailDialog = __esm(() => {
1872
+ init_figures();
1873
+ init_figures2();
1874
+ init_useElapsedTime();
1875
+ init_src();
1876
+ init_RemoteAgentTask();
1877
+ init_constants();
1878
+ init_prompt();
1879
+ init_constants2();
1880
+ init_browser();
1881
+ init_errors();
1882
+ init_format();
1883
+ init_mappers();
1884
+ init_messages();
1885
+ init_stringUtils();
1886
+ init_teleport();
1887
+ init_select();
1888
+ init_src();
1889
+ init_Message();
1890
+ init_RemoteSessionProgress();
1891
+ import_react4 = __toESM(require_react(), 1);
1892
+ jsx_dev_runtime8 = __toESM(require_jsx_dev_runtime(), 1);
1893
+ PHASE_LABEL = {
1894
+ needs_input: "input required",
1895
+ plan_ready: "ready"
1896
+ };
1897
+ AGENT_VERB = {
1898
+ needs_input: "waiting",
1899
+ plan_ready: "done"
1900
+ };
1901
+ STAGES = ["finding", "verifying", "synthesizing"];
1902
+ STAGE_LABELS = {
1903
+ finding: "Find",
1904
+ verifying: "Verify",
1905
+ synthesizing: "Dedupe"
1906
+ };
1907
+ });
1908
+
1909
+ // src/components/tasks/ShellDetailDialog.tsx
1910
+ async function getTaskOutput(shell) {
1911
+ const path = getTaskOutputPath(shell.id);
1912
+ try {
1913
+ const result = await tailFile(path, SHELL_DETAIL_TAIL_BYTES);
1914
+ return { content: result.content, bytesTotal: result.bytesTotal };
1915
+ } catch {
1916
+ return { content: "", bytesTotal: 0 };
1917
+ }
1918
+ }
1919
+ function ShellDetailDialog({
1920
+ shell,
1921
+ onDone,
1922
+ onKillShell,
1923
+ onBack
1924
+ }) {
1925
+ const { columns } = useTerminalSize();
1926
+ const [outputPromise, setOutputPromise] = import_react5.useState(() => getTaskOutput(shell));
1927
+ const deferredOutputPromise = import_react5.useDeferredValue(outputPromise);
1928
+ import_react5.useEffect(() => {
1929
+ if (shell.status !== "running") {
1930
+ return;
1931
+ }
1932
+ const timer = setInterval((setOutputPromise2, shell2) => setOutputPromise2(getTaskOutput(shell2)), 1000, setOutputPromise, shell);
1933
+ return () => clearInterval(timer);
1934
+ }, [shell.id, shell.status]);
1935
+ const handleClose = () => onDone("Shell details dismissed", { display: "system" });
1936
+ useKeybindings({
1937
+ "confirm:yes": handleClose
1938
+ }, { context: "Confirmation" });
1939
+ const handleKeyDown = (e) => {
1940
+ if (e.key === " ") {
1941
+ e.preventDefault();
1942
+ onDone("Shell details dismissed", { display: "system" });
1943
+ } else if (e.key === "left" && onBack) {
1944
+ e.preventDefault();
1945
+ onBack();
1946
+ } else if (e.key === "x" && shell.status === "running" && onKillShell) {
1947
+ e.preventDefault();
1948
+ onKillShell();
1949
+ }
1950
+ };
1951
+ const isMonitor = shell.kind === "monitor";
1952
+ const displayCommand = truncateToWidth(shell.command, 280);
1953
+ return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedBox_default, {
1954
+ flexDirection: "column",
1955
+ tabIndex: 0,
1956
+ autoFocus: true,
1957
+ onKeyDown: handleKeyDown,
1958
+ children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Dialog, {
1959
+ title: isMonitor ? "Monitor details" : "Shell details",
1960
+ onCancel: handleClose,
1961
+ color: "background",
1962
+ inputGuide: (exitState) => exitState.pending ? /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedText, {
1963
+ children: [
1964
+ "Press ",
1965
+ exitState.keyName,
1966
+ " again to exit"
1967
+ ]
1968
+ }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Byline, {
1969
+ children: [
1970
+ onBack && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(KeyboardShortcutHint, {
1971
+ shortcut: "\u2190",
1972
+ action: "go back"
1973
+ }, undefined, false, undefined, this),
1974
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(KeyboardShortcutHint, {
1975
+ shortcut: "Esc/Enter/Space",
1976
+ action: "close"
1977
+ }, undefined, false, undefined, this),
1978
+ shell.status === "running" && onKillShell && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(KeyboardShortcutHint, {
1979
+ shortcut: "x",
1980
+ action: "stop"
1981
+ }, undefined, false, undefined, this)
1982
+ ]
1983
+ }, undefined, true, undefined, this),
1984
+ children: [
1985
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedBox_default, {
1986
+ flexDirection: "column",
1987
+ children: [
1988
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedText, {
1989
+ children: [
1990
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedText, {
1991
+ bold: true,
1992
+ children: "Status:"
1993
+ }, undefined, false, undefined, this),
1994
+ " ",
1995
+ shell.status === "running" ? /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedText, {
1996
+ color: "background",
1997
+ children: [
1998
+ shell.status,
1999
+ shell.result?.code !== undefined && ` (exit code: ${shell.result.code})`
2000
+ ]
2001
+ }, undefined, true, undefined, this) : shell.status === "completed" ? /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedText, {
2002
+ color: "success",
2003
+ children: [
2004
+ shell.status,
2005
+ shell.result?.code !== undefined && ` (exit code: ${shell.result.code})`
2006
+ ]
2007
+ }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedText, {
2008
+ color: "error",
2009
+ children: [
2010
+ shell.status,
2011
+ shell.result?.code !== undefined && ` (exit code: ${shell.result.code})`
2012
+ ]
2013
+ }, undefined, true, undefined, this)
2014
+ ]
2015
+ }, undefined, true, undefined, this),
2016
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedText, {
2017
+ children: [
2018
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedText, {
2019
+ bold: true,
2020
+ children: "Runtime:"
2021
+ }, undefined, false, undefined, this),
2022
+ " ",
2023
+ formatDuration((shell.endTime ?? Date.now()) - shell.startTime)
2024
+ ]
2025
+ }, undefined, true, undefined, this),
2026
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedText, {
2027
+ wrap: "wrap",
2028
+ children: [
2029
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedText, {
2030
+ bold: true,
2031
+ children: isMonitor ? "Script:" : "Command:"
2032
+ }, undefined, false, undefined, this),
2033
+ " ",
2034
+ displayCommand
2035
+ ]
2036
+ }, undefined, true, undefined, this)
2037
+ ]
2038
+ }, undefined, true, undefined, this),
2039
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedBox_default, {
2040
+ flexDirection: "column",
2041
+ children: [
2042
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedText, {
2043
+ bold: true,
2044
+ children: "Output:"
2045
+ }, undefined, false, undefined, this),
2046
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(import_react5.Suspense, {
2047
+ fallback: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedText, {
2048
+ dimColor: true,
2049
+ children: "Loading output\u2026"
2050
+ }, undefined, false, undefined, this),
2051
+ children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ShellOutputContent, {
2052
+ outputPromise: deferredOutputPromise,
2053
+ columns
2054
+ }, undefined, false, undefined, this)
2055
+ }, undefined, false, undefined, this)
2056
+ ]
2057
+ }, undefined, true, undefined, this)
2058
+ ]
2059
+ }, undefined, true, undefined, this)
2060
+ }, undefined, false, undefined, this);
2061
+ }
2062
+ function ShellOutputContent({
2063
+ outputPromise,
2064
+ columns
2065
+ }) {
2066
+ const { content, bytesTotal } = import_react5.use(outputPromise);
2067
+ if (!content) {
2068
+ return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedText, {
2069
+ dimColor: true,
2070
+ children: "No output available"
2071
+ }, undefined, false, undefined, this);
2072
+ }
2073
+ const starts = [];
2074
+ let pos = content.length;
2075
+ for (let i = 0;i < 10 && pos > 0; i++) {
2076
+ const prev = content.lastIndexOf(`
2077
+ `, pos - 1);
2078
+ starts.push(prev + 1);
2079
+ pos = prev;
2080
+ }
2081
+ starts.reverse();
2082
+ const isIncomplete = bytesTotal > content.length;
2083
+ const rendered = [];
2084
+ for (let i = 0;i < starts.length; i++) {
2085
+ const start = starts[i];
2086
+ const end = i < starts.length - 1 ? starts[i + 1] - 1 : content.length;
2087
+ const line = content.slice(start, end);
2088
+ if (line)
2089
+ rendered.push(line);
2090
+ }
2091
+ return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(jsx_dev_runtime9.Fragment, {
2092
+ children: [
2093
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedBox_default, {
2094
+ borderStyle: "round",
2095
+ paddingX: 1,
2096
+ flexDirection: "column",
2097
+ height: 12,
2098
+ maxWidth: columns - 6,
2099
+ children: rendered.map((line, i) => /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedText, {
2100
+ wrap: "truncate-end",
2101
+ children: line
2102
+ }, i, false, undefined, this))
2103
+ }, undefined, false, undefined, this),
2104
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedText, {
2105
+ dimColor: true,
2106
+ italic: true,
2107
+ children: [
2108
+ `Showing ${rendered.length} lines`,
2109
+ isIncomplete ? ` of ${formatFileSize(bytesTotal)}` : ""
2110
+ ]
2111
+ }, undefined, true, undefined, this)
2112
+ ]
2113
+ }, undefined, true, undefined, this);
2114
+ }
2115
+ var import_react5, jsx_dev_runtime9, SHELL_DETAIL_TAIL_BYTES = 8192;
2116
+ var init_ShellDetailDialog = __esm(() => {
2117
+ init_useTerminalSize();
2118
+ init_src();
2119
+ init_useKeybinding();
2120
+ init_format();
2121
+ init_fsOperations();
2122
+ init_diskOutput();
2123
+ init_src();
2124
+ import_react5 = __toESM(require_react(), 1);
2125
+ jsx_dev_runtime9 = __toESM(require_jsx_dev_runtime(), 1);
2126
+ });
2127
+
2128
+ // src/components/tasks/BackgroundTasksDialog.tsx
2129
+ function getSelectableBackgroundTasks(tasks, foregroundedTaskId) {
2130
+ const backgroundTasks = Object.values(tasks ?? {}).filter(isBackgroundTask);
2131
+ return backgroundTasks.filter((task) => !(task.type === "local_agent" && task.id === foregroundedTaskId));
2132
+ }
2133
+ function BackgroundTasksDialog({
2134
+ onDone,
2135
+ toolUseContext,
2136
+ initialDetailTaskId
2137
+ }) {
2138
+ const tasks = useAppState((s) => s.tasks);
2139
+ const foregroundedTaskId = useAppState((s) => s.foregroundedTaskId);
2140
+ const showSpinnerTree = useAppState((s) => s.expandedView) === "teammates";
2141
+ const setAppState = useSetAppState();
2142
+ const killAgentsShortcut = useShortcutDisplay("chat:killAgents", "Chat", "ctrl+x ctrl+k");
2143
+ const typedTasks = tasks;
2144
+ const skippedListOnMount = import_react6.useRef(false);
2145
+ const [viewState, setViewState] = import_react6.useState(() => {
2146
+ if (initialDetailTaskId) {
2147
+ skippedListOnMount.current = true;
2148
+ return { mode: "detail", itemId: initialDetailTaskId };
2149
+ }
2150
+ const allItems = getSelectableBackgroundTasks(typedTasks, foregroundedTaskId);
2151
+ if (allItems.length === 1) {
2152
+ skippedListOnMount.current = true;
2153
+ return { mode: "detail", itemId: allItems[0].id };
2154
+ }
2155
+ return { mode: "list" };
2156
+ });
2157
+ const [selectedIndex, setSelectedIndex] = import_react6.useState(0);
2158
+ useRegisterOverlay("background-tasks-dialog");
2159
+ const {
2160
+ bashTasks,
2161
+ remoteSessions,
2162
+ agentTasks,
2163
+ teammateTasks,
2164
+ workflowTasks,
2165
+ mcpMonitors,
2166
+ dreamTasks,
2167
+ allSelectableItems
2168
+ } = import_react6.useMemo(() => {
2169
+ const backgroundTasks = Object.values(typedTasks ?? {}).filter(isBackgroundTask);
2170
+ const allItems = backgroundTasks.map(toListItem);
2171
+ const sorted = allItems.sort((a, b) => {
2172
+ const aStatus = a.status;
2173
+ const bStatus = b.status;
2174
+ if (aStatus === "running" && bStatus !== "running")
2175
+ return -1;
2176
+ if (aStatus !== "running" && bStatus === "running")
2177
+ return 1;
2178
+ const aTime = "task" in a ? a.task.startTime : 0;
2179
+ const bTime = "task" in b ? b.task.startTime : 0;
2180
+ return bTime - aTime;
2181
+ });
2182
+ const bash = sorted.filter((item) => item.type === "local_bash");
2183
+ const remote = sorted.filter((item) => item.type === "remote_agent");
2184
+ const agent = sorted.filter((item) => item.type === "local_agent" && item.id !== foregroundedTaskId);
2185
+ const workflows = sorted.filter((item) => item.type === "local_workflow");
2186
+ const monitorMcp = sorted.filter((item) => item.type === "monitor_mcp");
2187
+ const dreamTasks2 = sorted.filter((item) => item.type === "dream");
2188
+ const teammates = showSpinnerTree ? [] : sorted.filter((item) => item.type === "in_process_teammate");
2189
+ const leaderItem = teammates.length > 0 ? [
2190
+ {
2191
+ id: "__leader__",
2192
+ type: "leader",
2193
+ label: `@${TEAM_LEAD_NAME}`,
2194
+ status: "running"
2195
+ }
2196
+ ] : [];
2197
+ return {
2198
+ bashTasks: bash,
2199
+ remoteSessions: remote,
2200
+ agentTasks: agent,
2201
+ workflowTasks: workflows,
2202
+ mcpMonitors: monitorMcp,
2203
+ dreamTasks: dreamTasks2,
2204
+ teammateTasks: [...leaderItem, ...teammates],
2205
+ allSelectableItems: [
2206
+ ...leaderItem,
2207
+ ...teammates,
2208
+ ...bash,
2209
+ ...monitorMcp,
2210
+ ...remote,
2211
+ ...agent,
2212
+ ...workflows,
2213
+ ...dreamTasks2
2214
+ ]
2215
+ };
2216
+ }, [typedTasks, foregroundedTaskId, showSpinnerTree]);
2217
+ const currentSelection = allSelectableItems[selectedIndex] ?? null;
2218
+ useKeybindings({
2219
+ "confirm:previous": () => setSelectedIndex((prev) => Math.max(0, prev - 1)),
2220
+ "confirm:next": () => setSelectedIndex((prev) => Math.min(allSelectableItems.length - 1, prev + 1)),
2221
+ "confirm:yes": () => {
2222
+ const current = allSelectableItems[selectedIndex];
2223
+ if (current) {
2224
+ if (current.type === "leader") {
2225
+ exitTeammateView(setAppState);
2226
+ onDone("Viewing leader", { display: "system" });
2227
+ } else {
2228
+ setViewState({ mode: "detail", itemId: current.id });
2229
+ }
2230
+ }
2231
+ }
2232
+ }, { context: "Confirmation", isActive: viewState.mode === "list" });
2233
+ const handleKeyDown = (e) => {
2234
+ if (viewState.mode !== "list")
2235
+ return;
2236
+ if (e.key === "left") {
2237
+ e.preventDefault();
2238
+ onDone("Background tasks dialog dismissed", { display: "system" });
2239
+ return;
2240
+ }
2241
+ const currentSelection2 = allSelectableItems[selectedIndex];
2242
+ if (!currentSelection2)
2243
+ return;
2244
+ if (e.key === "x") {
2245
+ e.preventDefault();
2246
+ if (currentSelection2.type === "local_bash" && currentSelection2.status === "running") {
2247
+ killShellTask(currentSelection2.id);
2248
+ } else if (currentSelection2.type === "local_agent" && currentSelection2.status === "running") {
2249
+ killAgentTask(currentSelection2.id);
2250
+ } else if (currentSelection2.type === "in_process_teammate" && currentSelection2.status === "running") {
2251
+ killTeammateTask(currentSelection2.id);
2252
+ } else if (currentSelection2.type === "local_workflow" && currentSelection2.status === "running" && killWorkflowTask) {
2253
+ killWorkflowTask(currentSelection2.id, setAppState);
2254
+ } else if (currentSelection2.type === "monitor_mcp" && currentSelection2.status === "running" && killMonitorMcp) {
2255
+ killMonitorMcp(currentSelection2.id, setAppState);
2256
+ } else if (currentSelection2.type === "dream" && currentSelection2.status === "running") {
2257
+ killDreamTask(currentSelection2.id);
2258
+ } else if (currentSelection2.type === "remote_agent" && currentSelection2.status === "running") {
2259
+ if (currentSelection2.task.isUltraplan) {
2260
+ stopUltraplan(currentSelection2.id, currentSelection2.task.sessionId, setAppState);
2261
+ } else {
2262
+ killRemoteAgentTask(currentSelection2.id);
2263
+ }
2264
+ }
2265
+ }
2266
+ if (e.key === "f") {
2267
+ if (currentSelection2.type === "in_process_teammate" && currentSelection2.status === "running") {
2268
+ e.preventDefault();
2269
+ enterTeammateView(currentSelection2.id, setAppState);
2270
+ onDone("Viewing teammate", { display: "system" });
2271
+ } else if (currentSelection2.type === "leader") {
2272
+ e.preventDefault();
2273
+ exitTeammateView(setAppState);
2274
+ onDone("Viewing leader", { display: "system" });
2275
+ }
2276
+ }
2277
+ };
2278
+ async function killShellTask(taskId) {
2279
+ await LocalShellTask.kill(taskId, setAppState);
2280
+ }
2281
+ async function killAgentTask(taskId) {
2282
+ await LocalAgentTask.kill(taskId, setAppState);
2283
+ }
2284
+ async function killTeammateTask(taskId) {
2285
+ await InProcessTeammateTask.kill(taskId, setAppState);
2286
+ }
2287
+ async function killDreamTask(taskId) {
2288
+ await DreamTask.kill(taskId, setAppState);
2289
+ }
2290
+ async function killRemoteAgentTask(taskId) {
2291
+ await RemoteAgentTask.kill(taskId, setAppState);
2292
+ }
2293
+ const onDoneEvent = import_react6.useEffectEvent(onDone);
2294
+ import_react6.useEffect(() => {
2295
+ if (viewState.mode !== "list") {
2296
+ const task = (typedTasks ?? {})[viewState.itemId];
2297
+ if (!task || task.type !== "local_workflow" && !isBackgroundTask(task)) {
2298
+ if (skippedListOnMount.current) {
2299
+ onDoneEvent("Background tasks dialog dismissed", {
2300
+ display: "system"
2301
+ });
2302
+ } else {
2303
+ setViewState({ mode: "list" });
2304
+ }
2305
+ }
2306
+ }
2307
+ const totalItems = allSelectableItems.length;
2308
+ if (selectedIndex >= totalItems && totalItems > 0) {
2309
+ setSelectedIndex(totalItems - 1);
2310
+ }
2311
+ }, [viewState, typedTasks, selectedIndex, allSelectableItems, onDoneEvent]);
2312
+ const goBackToList = () => {
2313
+ if (skippedListOnMount.current && allSelectableItems.length <= 1) {
2314
+ onDone("Background tasks dialog dismissed", { display: "system" });
2315
+ } else {
2316
+ skippedListOnMount.current = false;
2317
+ setViewState({ mode: "list" });
2318
+ }
2319
+ };
2320
+ if (viewState.mode !== "list" && typedTasks) {
2321
+ const task = typedTasks[viewState.itemId];
2322
+ if (!task) {
2323
+ return null;
2324
+ }
2325
+ switch (task.type) {
2326
+ case "local_bash":
2327
+ return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ShellDetailDialog, {
2328
+ shell: task,
2329
+ onDone,
2330
+ onKillShell: () => void killShellTask(task.id),
2331
+ onBack: goBackToList
2332
+ }, `shell-${task.id}`, false, undefined, this);
2333
+ case "local_agent":
2334
+ return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(AsyncAgentDetailDialog, {
2335
+ agent: task,
2336
+ onDone,
2337
+ onKillAgent: () => void killAgentTask(task.id),
2338
+ onBack: goBackToList
2339
+ }, `agent-${task.id}`, false, undefined, this);
2340
+ case "remote_agent":
2341
+ return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(RemoteSessionDetailDialog, {
2342
+ session: task,
2343
+ onDone,
2344
+ toolUseContext,
2345
+ onBack: goBackToList,
2346
+ onKill: task.status !== "running" ? undefined : task.isUltraplan ? () => void stopUltraplan(task.id, task.sessionId, setAppState) : () => void killRemoteAgentTask(task.id)
2347
+ }, `session-${task.id}`, false, undefined, this);
2348
+ case "in_process_teammate":
2349
+ return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(InProcessTeammateDetailDialog, {
2350
+ teammate: task,
2351
+ onDone,
2352
+ onKill: task.status === "running" ? () => void killTeammateTask(task.id) : undefined,
2353
+ onBack: goBackToList,
2354
+ onForeground: task.status === "running" ? () => {
2355
+ enterTeammateView(task.id, setAppState);
2356
+ onDone("Viewing teammate", { display: "system" });
2357
+ } : undefined
2358
+ }, `teammate-${task.id}`, false, undefined, this);
2359
+ case "local_workflow":
2360
+ if (!WorkflowDetailDialog)
2361
+ return null;
2362
+ return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(WorkflowDetailDialog, {
2363
+ workflow: task,
2364
+ onDone,
2365
+ onKill: task.status === "running" && killWorkflowTask ? () => killWorkflowTask(task.id, setAppState) : undefined,
2366
+ onSkipAgent: task.status === "running" && skipWorkflowAgent ? (agentId) => skipWorkflowAgent(task.id, agentId, setAppState) : undefined,
2367
+ onRetryAgent: task.status === "running" && retryWorkflowAgent ? (agentId) => retryWorkflowAgent(task.id, agentId, setAppState) : undefined,
2368
+ onBack: goBackToList
2369
+ }, `workflow-${task.id}`, false, undefined, this);
2370
+ case "monitor_mcp":
2371
+ if (!MonitorMcpDetailDialog)
2372
+ return null;
2373
+ return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(MonitorMcpDetailDialog, {
2374
+ task,
2375
+ onKill: task.status === "running" && killMonitorMcp ? () => killMonitorMcp(task.id, setAppState) : undefined,
2376
+ onBack: goBackToList
2377
+ }, `monitor-mcp-${task.id}`, false, undefined, this);
2378
+ case "dream":
2379
+ return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(DreamDetailDialog, {
2380
+ task,
2381
+ onDone: () => onDone("Background tasks dialog dismissed", {
2382
+ display: "system"
2383
+ }),
2384
+ onBack: goBackToList,
2385
+ onKill: task.status === "running" ? () => void killDreamTask(task.id) : undefined
2386
+ }, `dream-${task.id}`, false, undefined, this);
2387
+ }
2388
+ }
2389
+ const runningBashCount = count(bashTasks, (_) => _.status === "running");
2390
+ const runningAgentCount = count(remoteSessions, (_) => _.status === "running" || _.status === "pending") + count(agentTasks, (_) => _.status === "running");
2391
+ const runningTeammateCount = count(teammateTasks, (_) => _.status === "running");
2392
+ const subtitle = intersperse([
2393
+ ...runningTeammateCount > 0 ? [
2394
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
2395
+ children: [
2396
+ runningTeammateCount,
2397
+ " ",
2398
+ runningTeammateCount !== 1 ? "agents" : "agent"
2399
+ ]
2400
+ }, "teammates", true, undefined, this)
2401
+ ] : [],
2402
+ ...runningBashCount > 0 ? [
2403
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
2404
+ children: [
2405
+ runningBashCount,
2406
+ " ",
2407
+ runningBashCount !== 1 ? "active shells" : "active shell"
2408
+ ]
2409
+ }, "shells", true, undefined, this)
2410
+ ] : [],
2411
+ ...runningAgentCount > 0 ? [
2412
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
2413
+ children: [
2414
+ runningAgentCount,
2415
+ " ",
2416
+ runningAgentCount !== 1 ? "active agents" : "active agent"
2417
+ ]
2418
+ }, "agents", true, undefined, this)
2419
+ ] : []
2420
+ ], (index) => /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
2421
+ children: " \xB7 "
2422
+ }, `separator-${index}`, false, undefined, this));
2423
+ const actions = [
2424
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(KeyboardShortcutHint, {
2425
+ shortcut: "\u2191/\u2193",
2426
+ action: "select"
2427
+ }, "upDown", false, undefined, this),
2428
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(KeyboardShortcutHint, {
2429
+ shortcut: "Enter",
2430
+ action: "view"
2431
+ }, "enter", false, undefined, this),
2432
+ ...currentSelection?.type === "in_process_teammate" && currentSelection.status === "running" ? [
2433
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(KeyboardShortcutHint, {
2434
+ shortcut: "f",
2435
+ action: "foreground"
2436
+ }, "foreground", false, undefined, this)
2437
+ ] : [],
2438
+ ...(currentSelection?.type === "local_bash" || currentSelection?.type === "local_agent" || currentSelection?.type === "in_process_teammate" || currentSelection?.type === "local_workflow" || currentSelection?.type === "monitor_mcp" || currentSelection?.type === "dream" || currentSelection?.type === "remote_agent") && currentSelection.status === "running" ? [/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(KeyboardShortcutHint, {
2439
+ shortcut: "x",
2440
+ action: "stop"
2441
+ }, "kill", false, undefined, this)] : [],
2442
+ ...agentTasks.some((t) => t.status === "running") ? [
2443
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(KeyboardShortcutHint, {
2444
+ shortcut: killAgentsShortcut,
2445
+ action: "stop all agents"
2446
+ }, "kill-all", false, undefined, this)
2447
+ ] : [],
2448
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(KeyboardShortcutHint, {
2449
+ shortcut: "\u2190/Esc",
2450
+ action: "close"
2451
+ }, "esc", false, undefined, this)
2452
+ ];
2453
+ const handleCancel = () => onDone("Background tasks dialog dismissed", { display: "system" });
2454
+ function renderInputGuide(exitState) {
2455
+ if (exitState.pending) {
2456
+ return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
2457
+ children: [
2458
+ "Press ",
2459
+ exitState.keyName,
2460
+ " again to exit"
2461
+ ]
2462
+ }, undefined, true, undefined, this);
2463
+ }
2464
+ return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Byline, {
2465
+ children: actions
2466
+ }, undefined, false, undefined, this);
2467
+ }
2468
+ return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedBox_default, {
2469
+ flexDirection: "column",
2470
+ tabIndex: 0,
2471
+ autoFocus: true,
2472
+ onKeyDown: handleKeyDown,
2473
+ children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Dialog, {
2474
+ title: "Background tasks",
2475
+ subtitle: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(jsx_dev_runtime10.Fragment, {
2476
+ children: subtitle
2477
+ }, undefined, false, undefined, this),
2478
+ onCancel: handleCancel,
2479
+ color: "background",
2480
+ inputGuide: renderInputGuide,
2481
+ children: allSelectableItems.length === 0 ? /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
2482
+ dimColor: true,
2483
+ children: "No tasks currently running"
2484
+ }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedBox_default, {
2485
+ flexDirection: "column",
2486
+ children: [
2487
+ teammateTasks.length > 0 && /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedBox_default, {
2488
+ flexDirection: "column",
2489
+ children: [
2490
+ (bashTasks.length > 0 || remoteSessions.length > 0 || agentTasks.length > 0) && /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
2491
+ dimColor: true,
2492
+ children: [
2493
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
2494
+ bold: true,
2495
+ children: [
2496
+ " ",
2497
+ "Agents"
2498
+ ]
2499
+ }, undefined, true, undefined, this),
2500
+ " (",
2501
+ count(teammateTasks, (i) => i.type !== "leader"),
2502
+ ")"
2503
+ ]
2504
+ }, undefined, true, undefined, this),
2505
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedBox_default, {
2506
+ flexDirection: "column",
2507
+ children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(TeammateTaskGroups, {
2508
+ teammateTasks,
2509
+ currentSelectionId: currentSelection?.id
2510
+ }, undefined, false, undefined, this)
2511
+ }, undefined, false, undefined, this)
2512
+ ]
2513
+ }, undefined, true, undefined, this),
2514
+ bashTasks.length > 0 && /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedBox_default, {
2515
+ flexDirection: "column",
2516
+ marginTop: teammateTasks.length > 0 ? 1 : 0,
2517
+ children: [
2518
+ (teammateTasks.length > 0 || remoteSessions.length > 0 || agentTasks.length > 0) && /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
2519
+ dimColor: true,
2520
+ children: [
2521
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
2522
+ bold: true,
2523
+ children: [
2524
+ " ",
2525
+ "Shells"
2526
+ ]
2527
+ }, undefined, true, undefined, this),
2528
+ " (",
2529
+ bashTasks.length,
2530
+ ")"
2531
+ ]
2532
+ }, undefined, true, undefined, this),
2533
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedBox_default, {
2534
+ flexDirection: "column",
2535
+ children: bashTasks.map((item) => /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Item, {
2536
+ item,
2537
+ isSelected: item.id === currentSelection?.id
2538
+ }, item.id, false, undefined, this))
2539
+ }, undefined, false, undefined, this)
2540
+ ]
2541
+ }, undefined, true, undefined, this),
2542
+ mcpMonitors.length > 0 && /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedBox_default, {
2543
+ flexDirection: "column",
2544
+ marginTop: teammateTasks.length > 0 || bashTasks.length > 0 ? 1 : 0,
2545
+ children: [
2546
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
2547
+ dimColor: true,
2548
+ children: [
2549
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
2550
+ bold: true,
2551
+ children: [
2552
+ " ",
2553
+ "Monitors"
2554
+ ]
2555
+ }, undefined, true, undefined, this),
2556
+ " (",
2557
+ mcpMonitors.length,
2558
+ ")"
2559
+ ]
2560
+ }, undefined, true, undefined, this),
2561
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedBox_default, {
2562
+ flexDirection: "column",
2563
+ children: mcpMonitors.map((item) => /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Item, {
2564
+ item,
2565
+ isSelected: item.id === currentSelection?.id
2566
+ }, item.id, false, undefined, this))
2567
+ }, undefined, false, undefined, this)
2568
+ ]
2569
+ }, undefined, true, undefined, this),
2570
+ remoteSessions.length > 0 && /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedBox_default, {
2571
+ flexDirection: "column",
2572
+ marginTop: teammateTasks.length > 0 || bashTasks.length > 0 || mcpMonitors.length > 0 ? 1 : 0,
2573
+ children: [
2574
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
2575
+ dimColor: true,
2576
+ children: [
2577
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
2578
+ bold: true,
2579
+ children: [
2580
+ " ",
2581
+ "Remote agents"
2582
+ ]
2583
+ }, undefined, true, undefined, this),
2584
+ " (",
2585
+ remoteSessions.length,
2586
+ ")"
2587
+ ]
2588
+ }, undefined, true, undefined, this),
2589
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedBox_default, {
2590
+ flexDirection: "column",
2591
+ children: remoteSessions.map((item) => /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Item, {
2592
+ item,
2593
+ isSelected: item.id === currentSelection?.id
2594
+ }, item.id, false, undefined, this))
2595
+ }, undefined, false, undefined, this)
2596
+ ]
2597
+ }, undefined, true, undefined, this),
2598
+ agentTasks.length > 0 && /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedBox_default, {
2599
+ flexDirection: "column",
2600
+ marginTop: teammateTasks.length > 0 || bashTasks.length > 0 || mcpMonitors.length > 0 || remoteSessions.length > 0 ? 1 : 0,
2601
+ children: [
2602
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
2603
+ dimColor: true,
2604
+ children: [
2605
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
2606
+ bold: true,
2607
+ children: [
2608
+ " ",
2609
+ "Local agents"
2610
+ ]
2611
+ }, undefined, true, undefined, this),
2612
+ " (",
2613
+ agentTasks.length,
2614
+ ")"
2615
+ ]
2616
+ }, undefined, true, undefined, this),
2617
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedBox_default, {
2618
+ flexDirection: "column",
2619
+ children: agentTasks.map((item) => /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Item, {
2620
+ item,
2621
+ isSelected: item.id === currentSelection?.id
2622
+ }, item.id, false, undefined, this))
2623
+ }, undefined, false, undefined, this)
2624
+ ]
2625
+ }, undefined, true, undefined, this),
2626
+ workflowTasks.length > 0 && /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedBox_default, {
2627
+ flexDirection: "column",
2628
+ marginTop: teammateTasks.length > 0 || bashTasks.length > 0 || mcpMonitors.length > 0 || remoteSessions.length > 0 || agentTasks.length > 0 ? 1 : 0,
2629
+ children: [
2630
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
2631
+ dimColor: true,
2632
+ children: [
2633
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
2634
+ bold: true,
2635
+ children: [
2636
+ " ",
2637
+ "Workflows"
2638
+ ]
2639
+ }, undefined, true, undefined, this),
2640
+ " (",
2641
+ workflowTasks.length,
2642
+ ")"
2643
+ ]
2644
+ }, undefined, true, undefined, this),
2645
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedBox_default, {
2646
+ flexDirection: "column",
2647
+ children: workflowTasks.map((item) => /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Item, {
2648
+ item,
2649
+ isSelected: item.id === currentSelection?.id
2650
+ }, item.id, false, undefined, this))
2651
+ }, undefined, false, undefined, this)
2652
+ ]
2653
+ }, undefined, true, undefined, this),
2654
+ dreamTasks.length > 0 && /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedBox_default, {
2655
+ flexDirection: "column",
2656
+ marginTop: teammateTasks.length > 0 || bashTasks.length > 0 || mcpMonitors.length > 0 || remoteSessions.length > 0 || agentTasks.length > 0 || workflowTasks.length > 0 ? 1 : 0,
2657
+ children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedBox_default, {
2658
+ flexDirection: "column",
2659
+ children: dreamTasks.map((item) => /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Item, {
2660
+ item,
2661
+ isSelected: item.id === currentSelection?.id
2662
+ }, item.id, false, undefined, this))
2663
+ }, undefined, false, undefined, this)
2664
+ }, undefined, false, undefined, this)
2665
+ ]
2666
+ }, undefined, true, undefined, this)
2667
+ }, undefined, false, undefined, this)
2668
+ }, undefined, false, undefined, this);
2669
+ }
2670
+ function toListItem(task) {
2671
+ switch (task.type) {
2672
+ case "local_bash":
2673
+ return {
2674
+ id: task.id,
2675
+ type: "local_bash",
2676
+ label: task.kind === "monitor" ? task.description : task.command,
2677
+ status: task.status,
2678
+ task
2679
+ };
2680
+ case "remote_agent":
2681
+ return {
2682
+ id: task.id,
2683
+ type: "remote_agent",
2684
+ label: task.title,
2685
+ status: task.status,
2686
+ task
2687
+ };
2688
+ case "local_agent":
2689
+ return {
2690
+ id: task.id,
2691
+ type: "local_agent",
2692
+ label: task.description,
2693
+ status: task.status,
2694
+ task
2695
+ };
2696
+ case "in_process_teammate":
2697
+ return {
2698
+ id: task.id,
2699
+ type: "in_process_teammate",
2700
+ label: `@${task.identity.agentName}`,
2701
+ status: task.status,
2702
+ task
2703
+ };
2704
+ case "local_workflow":
2705
+ return {
2706
+ id: task.id,
2707
+ type: "local_workflow",
2708
+ label: task.summary ?? task.description,
2709
+ status: task.status,
2710
+ task
2711
+ };
2712
+ case "monitor_mcp":
2713
+ return {
2714
+ id: task.id,
2715
+ type: "monitor_mcp",
2716
+ label: task.description,
2717
+ status: task.status,
2718
+ task
2719
+ };
2720
+ case "dream":
2721
+ return {
2722
+ id: task.id,
2723
+ type: "dream",
2724
+ label: task.description,
2725
+ status: task.status,
2726
+ task
2727
+ };
2728
+ }
2729
+ }
2730
+ function Item({
2731
+ item,
2732
+ isSelected
2733
+ }) {
2734
+ const { columns } = useTerminalSize();
2735
+ const maxActivityWidth = Math.max(30, columns - 26);
2736
+ const useGreyPointer = isCoordinatorMode();
2737
+ return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedBox_default, {
2738
+ flexDirection: "row",
2739
+ children: [
2740
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
2741
+ dimColor: useGreyPointer && isSelected,
2742
+ children: isSelected ? figures_default.pointer + " " : " "
2743
+ }, undefined, false, undefined, this),
2744
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
2745
+ color: isSelected && !useGreyPointer ? "suggestion" : undefined,
2746
+ children: item.type === "leader" ? /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
2747
+ children: [
2748
+ "@",
2749
+ TEAM_LEAD_NAME
2750
+ ]
2751
+ }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(BackgroundTask, {
2752
+ task: item.task,
2753
+ maxActivityWidth
2754
+ }, undefined, false, undefined, this)
2755
+ }, undefined, false, undefined, this)
2756
+ ]
2757
+ }, undefined, true, undefined, this);
2758
+ }
2759
+ function TeammateTaskGroups({
2760
+ teammateTasks,
2761
+ currentSelectionId
2762
+ }) {
2763
+ const leaderItems = teammateTasks.filter((i) => i.type === "leader");
2764
+ const teammateItems = teammateTasks.filter((i) => i.type === "in_process_teammate");
2765
+ const teams = new Map;
2766
+ for (const item of teammateItems) {
2767
+ const teamName = item.task.identity.teamName;
2768
+ const group = teams.get(teamName);
2769
+ if (group) {
2770
+ group.push(item);
2771
+ } else {
2772
+ teams.set(teamName, [item]);
2773
+ }
2774
+ }
2775
+ const teamEntries = [...teams.entries()];
2776
+ return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(jsx_dev_runtime10.Fragment, {
2777
+ children: teamEntries.map(([teamName, items]) => {
2778
+ const memberCount = items.length + leaderItems.length;
2779
+ return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedBox_default, {
2780
+ flexDirection: "column",
2781
+ children: [
2782
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
2783
+ dimColor: true,
2784
+ children: [
2785
+ " ",
2786
+ "Team: ",
2787
+ teamName,
2788
+ " (",
2789
+ memberCount,
2790
+ ")"
2791
+ ]
2792
+ }, undefined, true, undefined, this),
2793
+ leaderItems.map((item) => /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Item, {
2794
+ item,
2795
+ isSelected: item.id === currentSelectionId
2796
+ }, `${item.id}-${teamName}`, false, undefined, this)),
2797
+ items.map((item) => /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Item, {
2798
+ item,
2799
+ isSelected: item.id === currentSelectionId
2800
+ }, item.id, false, undefined, this))
2801
+ ]
2802
+ }, teamName, true, undefined, this);
2803
+ })
2804
+ }, undefined, false, undefined, this);
2805
+ }
2806
+ var import_react6, jsx_dev_runtime10, WorkflowDetailDialog = null, workflowTaskModule = null, killWorkflowTask, skipWorkflowAgent, retryWorkflowAgent, monitorMcpModule = null, killMonitorMcp, MonitorMcpDetailDialog = null;
2807
+ var init_BackgroundTasksDialog = __esm(() => {
2808
+ init_figures();
2809
+ init_coordinatorMode();
2810
+ init_useTerminalSize();
2811
+ init_AppState();
2812
+ init_teammateViewHelpers();
2813
+ init_DreamTask();
2814
+ init_InProcessTeammateTask();
2815
+ init_LocalAgentTask();
2816
+ init_LocalShellTask();
2817
+ init_RemoteAgentTask();
2818
+ init_types();
2819
+ init_array();
2820
+ init_constants3();
2821
+ init_ultraplan();
2822
+ init_overlayContext();
2823
+ init_src();
2824
+ init_useKeybinding();
2825
+ init_useShortcutDisplay();
2826
+ init_array();
2827
+ init_src();
2828
+ init_AsyncAgentDetailDialog();
2829
+ init_BackgroundTask();
2830
+ init_DreamDetailDialog();
2831
+ init_InProcessTeammateDetailDialog();
2832
+ init_RemoteSessionDetailDialog();
2833
+ init_ShellDetailDialog();
2834
+ import_react6 = __toESM(require_react(), 1);
2835
+ jsx_dev_runtime10 = __toESM(require_jsx_dev_runtime(), 1);
2836
+ killWorkflowTask = workflowTaskModule?.killWorkflowTask ?? null;
2837
+ skipWorkflowAgent = workflowTaskModule?.skipWorkflowAgent ?? null;
2838
+ retryWorkflowAgent = workflowTaskModule?.retryWorkflowAgent ?? null;
2839
+ killMonitorMcp = monitorMcpModule?.killMonitorMcp ?? null;
2840
+ });
2841
+
2842
+ export { enterTeammateView, exitTeammateView, stopOrDismissAgent, init_teammateViewHelpers, isTerminalStatus, shouldHideTasksFooter, init_taskStatusUtils, BackgroundTasksDialog, init_BackgroundTasksDialog };