@caspian2026/agent-sdk 0.0.24 → 0.0.26

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 (362) hide show
  1. package/dist/gateway/index.js +98 -22
  2. package/dist/gateway/worker.js +196 -47
  3. package/dist/sdk/query.cjs +2 -362
  4. package/dist/sdk/query.js +2 -367
  5. package/package.json +4 -6
  6. package/dist/chunk-05kvhzd7.js +0 -3561
  7. package/dist/chunk-07069jq1.js +0 -30
  8. package/dist/chunk-0731m51q.js +0 -8
  9. package/dist/chunk-08bspa4b.js +0 -673
  10. package/dist/chunk-0brkf8q8.js +0 -89
  11. package/dist/chunk-0n843xh7.js +0 -261
  12. package/dist/chunk-0nbp5jwx.js +0 -8583
  13. package/dist/chunk-0nj16az9.js +0 -169
  14. package/dist/chunk-0paqc2yw.js +0 -15
  15. package/dist/chunk-0q6b50ps.js +0 -111
  16. package/dist/chunk-0r5bb9j4.js +0 -477
  17. package/dist/chunk-0rpz1wgn.js +0 -1030
  18. package/dist/chunk-0t81d427.js +0 -41
  19. package/dist/chunk-0vaw02wq.js +0 -24
  20. package/dist/chunk-0vkfrmqm.js +0 -690
  21. package/dist/chunk-0vp3wfab.js +0 -12
  22. package/dist/chunk-0vr10742.js +0 -1809
  23. package/dist/chunk-0xjaqda8.js +0 -1124
  24. package/dist/chunk-13ehyphg.js +0 -223
  25. package/dist/chunk-15jsw9bb.js +0 -349
  26. package/dist/chunk-16m7eyyw.js +0 -1385
  27. package/dist/chunk-1ae3nt9j.js +0 -31
  28. package/dist/chunk-1gq4r3v1.js +0 -308
  29. package/dist/chunk-1gx78081.js +0 -66
  30. package/dist/chunk-1h2famwb.js +0 -49
  31. package/dist/chunk-1n546sfg.js +0 -200
  32. package/dist/chunk-1qg06d60.js +0 -494
  33. package/dist/chunk-1t0rqstn.js +0 -146
  34. package/dist/chunk-1z8p2eqd.js +0 -40
  35. package/dist/chunk-1zjh9cc5.js +0 -266
  36. package/dist/chunk-20ahkkrb.js +0 -132
  37. package/dist/chunk-21pbfch8.js +0 -105
  38. package/dist/chunk-26wtxbdc.js +0 -13870
  39. package/dist/chunk-2fwze72g.js +0 -24
  40. package/dist/chunk-2gcbr1c7.js +0 -107
  41. package/dist/chunk-2grc1yr8.js +0 -654
  42. package/dist/chunk-2gzv8nrw.js +0 -205
  43. package/dist/chunk-2r212cvt.js +0 -253
  44. package/dist/chunk-2s74bt6e.js +0 -317
  45. package/dist/chunk-2v385w7r.js +0 -7422
  46. package/dist/chunk-2wtkvpp2.js +0 -167
  47. package/dist/chunk-31rsspfr.js +0 -418
  48. package/dist/chunk-3c25bcsw.js +0 -17
  49. package/dist/chunk-3jm08aaw.js +0 -91
  50. package/dist/chunk-3mgywd32.js +0 -8
  51. package/dist/chunk-3nk79af8.js +0 -8
  52. package/dist/chunk-3v4sk2py.js +0 -101
  53. package/dist/chunk-3vwft0eh.js +0 -349
  54. package/dist/chunk-3vy1jt9p.js +0 -1010
  55. package/dist/chunk-3wvqzq9w.js +0 -92
  56. package/dist/chunk-3wvv2s8d.js +0 -336
  57. package/dist/chunk-4060b3s2.js +0 -108
  58. package/dist/chunk-434e0vh4.js +0 -275
  59. package/dist/chunk-46dm23zs.js +0 -344
  60. package/dist/chunk-4bh4qs70.js +0 -209
  61. package/dist/chunk-4cxzbqws.js +0 -94
  62. package/dist/chunk-4jm600zv.js +0 -13
  63. package/dist/chunk-4k9d7gxv.js +0 -118
  64. package/dist/chunk-4nc3t6ms.js +0 -396
  65. package/dist/chunk-4pbx3g7s.js +0 -26
  66. package/dist/chunk-4qhh8bpa.js +0 -54
  67. package/dist/chunk-4v63px9y.js +0 -133
  68. package/dist/chunk-4xnnzt3j.js +0 -74
  69. package/dist/chunk-4zchh01h.js +0 -201
  70. package/dist/chunk-5216fha8.js +0 -1163
  71. package/dist/chunk-55raexh7.js +0 -14358
  72. package/dist/chunk-5bffhf64.js +0 -81
  73. package/dist/chunk-5ccdsxgy.js +0 -74
  74. package/dist/chunk-5ddh2hyn.js +0 -91
  75. package/dist/chunk-5e6ncq5j.js +0 -61
  76. package/dist/chunk-5ekyhb1w.js +0 -422
  77. package/dist/chunk-5fy4r8rv.js +0 -52
  78. package/dist/chunk-5h5kx2jd.js +0 -34
  79. package/dist/chunk-5mbgdvyz.js +0 -847
  80. package/dist/chunk-5n1jc02d.js +0 -87
  81. package/dist/chunk-5pysjah8.js +0 -1543
  82. package/dist/chunk-5ssfz438.js +0 -323
  83. package/dist/chunk-5z28bqne.js +0 -6748
  84. package/dist/chunk-603y0mmg.js +0 -50
  85. package/dist/chunk-62v5kkff.js +0 -90
  86. package/dist/chunk-64c1avct.js +0 -13
  87. package/dist/chunk-64r16v22.js +0 -162
  88. package/dist/chunk-64smdx4a.js +0 -418
  89. package/dist/chunk-66zry909.js +0 -11
  90. package/dist/chunk-68ffk5qa.js +0 -14
  91. package/dist/chunk-69n11zng.js +0 -436
  92. package/dist/chunk-6dj5t602.js +0 -341
  93. package/dist/chunk-6dngjwkh.js +0 -63
  94. package/dist/chunk-6nsd9606.js +0 -790
  95. package/dist/chunk-6pkh8frk.js +0 -253
  96. package/dist/chunk-6qcmt5eb.js +0 -251
  97. package/dist/chunk-6ww7451s.js +0 -60
  98. package/dist/chunk-6xgb0kqz.js +0 -90
  99. package/dist/chunk-72ys9m07.js +0 -121
  100. package/dist/chunk-741sgvtx.js +0 -121
  101. package/dist/chunk-7aw745vx.js +0 -40175
  102. package/dist/chunk-7c8b8cfb.js +0 -219
  103. package/dist/chunk-7mwt4e1z.js +0 -234
  104. package/dist/chunk-7sgtxrsc.js +0 -1059
  105. package/dist/chunk-7wm5s02e.js +0 -216
  106. package/dist/chunk-7xyswgjh.js +0 -8
  107. package/dist/chunk-80a197ez.js +0 -1438
  108. package/dist/chunk-83hfzbx3.js +0 -10
  109. package/dist/chunk-8akrsgad.js +0 -55
  110. package/dist/chunk-8g5pe1gr.js +0 -37
  111. package/dist/chunk-8s07t4k7.js +0 -40
  112. package/dist/chunk-8yhf030a.js +0 -69
  113. package/dist/chunk-928tzaa8.js +0 -107
  114. package/dist/chunk-949pjzj9.js +0 -266
  115. package/dist/chunk-9aycd4z9.js +0 -490
  116. package/dist/chunk-9bzqvsz5.js +0 -211
  117. package/dist/chunk-9q3xfy27.js +0 -460
  118. package/dist/chunk-9vzg1360.js +0 -153
  119. package/dist/chunk-9wbh8n1y.js +0 -63
  120. package/dist/chunk-9x5zgy22.js +0 -12
  121. package/dist/chunk-9zdj4ypz.js +0 -206
  122. package/dist/chunk-a0bvcgyd.js +0 -127
  123. package/dist/chunk-a4m3yr2q.js +0 -117
  124. package/dist/chunk-a8jd4gee.js +0 -227
  125. package/dist/chunk-ase86y73.js +0 -15
  126. package/dist/chunk-atfzpm6r.js +0 -325
  127. package/dist/chunk-awqsddp2.js +0 -338
  128. package/dist/chunk-awrgzpk6.js +0 -29
  129. package/dist/chunk-b0kf00ff.js +0 -637
  130. package/dist/chunk-b1kcd3ss.js +0 -27
  131. package/dist/chunk-b4hy21c4.js +0 -140
  132. package/dist/chunk-b9mkm8mg.js +0 -111
  133. package/dist/chunk-bdjx14rd.js +0 -594
  134. package/dist/chunk-bfb41q9h.js +0 -295
  135. package/dist/chunk-bg4x9ex0.js +0 -21
  136. package/dist/chunk-bh5zqvyc.js +0 -36
  137. package/dist/chunk-bn0zv2y2.js +0 -1154
  138. package/dist/chunk-bn7t681c.js +0 -2669
  139. package/dist/chunk-br4wgffc.js +0 -393
  140. package/dist/chunk-brjd9zmk.js +0 -42
  141. package/dist/chunk-byfawrfx.js +0 -121
  142. package/dist/chunk-c6sjhj89.js +0 -1284
  143. package/dist/chunk-c7jwbe76.js +0 -29030
  144. package/dist/chunk-cdef9v7b.js +0 -27
  145. package/dist/chunk-cdz5yb0r.js +0 -57
  146. package/dist/chunk-cevq1787.js +0 -2718
  147. package/dist/chunk-cgfdkzhb.js +0 -12
  148. package/dist/chunk-cgqw4x5z.js +0 -155
  149. package/dist/chunk-cmmmc8e0.js +0 -212
  150. package/dist/chunk-cnsj3vq2.js +0 -35
  151. package/dist/chunk-cxrktb5g.js +0 -51
  152. package/dist/chunk-cyhrb0bk.js +0 -251
  153. package/dist/chunk-d23rmn8r.js +0 -62
  154. package/dist/chunk-d4mdda98.js +0 -94
  155. package/dist/chunk-dcwp94cj.js +0 -152
  156. package/dist/chunk-ddsjkqs4.js +0 -39
  157. package/dist/chunk-ddv56j39.js +0 -148
  158. package/dist/chunk-dfq6pbq7.js +0 -5822
  159. package/dist/chunk-dfzkwynj.js +0 -5368
  160. package/dist/chunk-dkgkd8b7.js +0 -516
  161. package/dist/chunk-dpnmf0pq.js +0 -312
  162. package/dist/chunk-dygx7vcc.js +0 -226
  163. package/dist/chunk-e0abab5b.js +0 -445
  164. package/dist/chunk-e5qhvhjy.js +0 -168
  165. package/dist/chunk-e60y6r1n.js +0 -20
  166. package/dist/chunk-e68kgvcq.js +0 -79
  167. package/dist/chunk-e9w9zc0g.js +0 -392
  168. package/dist/chunk-ecj9w6tm.js +0 -558
  169. package/dist/chunk-ehtwnxpg.js +0 -1591
  170. package/dist/chunk-eqp1rfft.js +0 -17
  171. package/dist/chunk-etdt1xz3.js +0 -19
  172. package/dist/chunk-ewadzrm8.js +0 -103
  173. package/dist/chunk-f03s83vj.js +0 -91
  174. package/dist/chunk-f3kk0p3s.js +0 -150
  175. package/dist/chunk-f3pjerx4.js +0 -4265
  176. package/dist/chunk-f6h5weh6.js +0 -61
  177. package/dist/chunk-fajg8x36.js +0 -8158
  178. package/dist/chunk-fbv4apne.js +0 -51
  179. package/dist/chunk-fcynwjpm.js +0 -1072
  180. package/dist/chunk-fdvaf6nn.js +0 -20
  181. package/dist/chunk-feyzykye.js +0 -10
  182. package/dist/chunk-ff85rwvc.js +0 -180
  183. package/dist/chunk-fqak69ft.js +0 -458
  184. package/dist/chunk-fxdkbabd.js +0 -195
  185. package/dist/chunk-fyc5fepv.js +0 -10
  186. package/dist/chunk-g78c6ztj.js +0 -89
  187. package/dist/chunk-g8ee7yza.js +0 -105
  188. package/dist/chunk-g9f19ttm.js +0 -15
  189. package/dist/chunk-gcktsbxb.js +0 -77
  190. package/dist/chunk-gdwdqewd.js +0 -19
  191. package/dist/chunk-gg55fns0.js +0 -6440
  192. package/dist/chunk-gnpt1t6q.js +0 -209364
  193. package/dist/chunk-gsbw2j2b.js +0 -276
  194. package/dist/chunk-gybt680f.js +0 -9114
  195. package/dist/chunk-gz1e8y1w.js +0 -33
  196. package/dist/chunk-gz7vn2gg.js +0 -114
  197. package/dist/chunk-h0d5eat0.js +0 -101
  198. package/dist/chunk-h27tjbp3.js +0 -33118
  199. package/dist/chunk-h2yy8k4c.js +0 -58
  200. package/dist/chunk-h5acpdqt.js +0 -103
  201. package/dist/chunk-h63r8vps.js +0 -2840
  202. package/dist/chunk-h64x5b04.js +0 -860
  203. package/dist/chunk-h92snc84.js +0 -420
  204. package/dist/chunk-h9n54swm.js +0 -27
  205. package/dist/chunk-hafcrnpc.js +0 -145
  206. package/dist/chunk-hakdhagh.js +0 -16606
  207. package/dist/chunk-hk4phsaw.js +0 -388
  208. package/dist/chunk-hph1bmqw.js +0 -65
  209. package/dist/chunk-hvnztnp3.js +0 -71
  210. package/dist/chunk-hwfknpxv.js +0 -39
  211. package/dist/chunk-j2xxd002.js +0 -1052
  212. package/dist/chunk-j3qbygme.js +0 -105
  213. package/dist/chunk-j5bth84e.js +0 -97
  214. package/dist/chunk-j64ga6ta.js +0 -8035
  215. package/dist/chunk-jbwgyskk.js +0 -385
  216. package/dist/chunk-jd32zbps.js +0 -15
  217. package/dist/chunk-jdhkh2bb.js +0 -618
  218. package/dist/chunk-jeqcwgt7.js +0 -177
  219. package/dist/chunk-jf75p9ap.js +0 -445
  220. package/dist/chunk-jgvk0za1.js +0 -260
  221. package/dist/chunk-jhpaevah.js +0 -565
  222. package/dist/chunk-jmjwrbwd.js +0 -635
  223. package/dist/chunk-jpdbfwvq.js +0 -100
  224. package/dist/chunk-jps4m6sz.js +0 -183
  225. package/dist/chunk-jwf0s51s.js +0 -867
  226. package/dist/chunk-jxge4dgh.js +0 -83
  227. package/dist/chunk-jz71gv95.js +0 -1161
  228. package/dist/chunk-jzthz1bx.js +0 -15
  229. package/dist/chunk-jzvd2ycp.js +0 -120
  230. package/dist/chunk-k0p9w03v.js +0 -4957
  231. package/dist/chunk-k4dcreh0.js +0 -442
  232. package/dist/chunk-k7akhwkn.js +0 -151
  233. package/dist/chunk-k8vp0atq.js +0 -2331
  234. package/dist/chunk-kgd7gfvk.js +0 -407
  235. package/dist/chunk-km5ycg1j.js +0 -87
  236. package/dist/chunk-kvyrxzj8.js +0 -26
  237. package/dist/chunk-kwekc97v.js +0 -18
  238. package/dist/chunk-ky1z78ve.js +0 -119
  239. package/dist/chunk-mcws22k3.js +0 -42
  240. package/dist/chunk-mjazvyd8.js +0 -528
  241. package/dist/chunk-mswx2nma.js +0 -103
  242. package/dist/chunk-mz6a0phh.js +0 -2962
  243. package/dist/chunk-n2tg12hg.js +0 -374
  244. package/dist/chunk-n3fv4ya7.js +0 -146
  245. package/dist/chunk-n4eabmqd.js +0 -93
  246. package/dist/chunk-n4tx7baq.js +0 -193
  247. package/dist/chunk-n6g4jbeh.js +0 -289
  248. package/dist/chunk-n6wzfxf1.js +0 -100
  249. package/dist/chunk-ndcmqfkv.js +0 -244
  250. package/dist/chunk-netzwgv1.js +0 -154
  251. package/dist/chunk-nhcg04jt.js +0 -120
  252. package/dist/chunk-nhsm3ntd.js +0 -439
  253. package/dist/chunk-njev89d1.js +0 -2335
  254. package/dist/chunk-nmgj86tt.js +0 -24
  255. package/dist/chunk-ns7x6xam.js +0 -22820
  256. package/dist/chunk-p7vkh4wx.js +0 -15
  257. package/dist/chunk-p8na2wwp.js +0 -14
  258. package/dist/chunk-p97fd5af.js +0 -684
  259. package/dist/chunk-pe3rkfp2.js +0 -74
  260. package/dist/chunk-pgtnj1mt.js +0 -705
  261. package/dist/chunk-phmnkw9y.js +0 -283
  262. package/dist/chunk-pnds7g1q.js +0 -130
  263. package/dist/chunk-ppwjyveh.js +0 -8
  264. package/dist/chunk-pqqxdk5f.js +0 -543
  265. package/dist/chunk-ps49ymvj.js +0 -43
  266. package/dist/chunk-pwwa7s62.js +0 -11
  267. package/dist/chunk-q3hfrat2.js +0 -313
  268. package/dist/chunk-qajrkk97.js +0 -298
  269. package/dist/chunk-qatfdxvd.js +0 -34
  270. package/dist/chunk-qb5qcctj.js +0 -206
  271. package/dist/chunk-qb6k2afy.js +0 -153
  272. package/dist/chunk-qgk93a75.js +0 -85
  273. package/dist/chunk-qkczt8cr.js +0 -24
  274. package/dist/chunk-qn1be1vf.js +0 -267
  275. package/dist/chunk-qnfx3qtx.js +0 -617
  276. package/dist/chunk-qnwne2m4.js +0 -87
  277. package/dist/chunk-qp2qdcda.js +0 -100
  278. package/dist/chunk-qpp3wwh5.js +0 -697
  279. package/dist/chunk-r0bx1gc7.js +0 -174
  280. package/dist/chunk-radnwk8x.js +0 -107
  281. package/dist/chunk-rkv5jq0y.js +0 -71
  282. package/dist/chunk-rmbbmd3s.js +0 -68
  283. package/dist/chunk-rmgbs5an.js +0 -640
  284. package/dist/chunk-rn0v1hk8.js +0 -34
  285. package/dist/chunk-rnxctq9p.js +0 -1646
  286. package/dist/chunk-rtd39n81.js +0 -95
  287. package/dist/chunk-s8gy4ky9.js +0 -122
  288. package/dist/chunk-s8kj6ajy.js +0 -32
  289. package/dist/chunk-sd36yzx8.js +0 -954
  290. package/dist/chunk-sdenh194.js +0 -121
  291. package/dist/chunk-sdtqp75c.js +0 -55
  292. package/dist/chunk-sedbc8ep.js +0 -212
  293. package/dist/chunk-sfrb15b2.js +0 -321
  294. package/dist/chunk-sgpmpn90.js +0 -35
  295. package/dist/chunk-sh02d2qn.js +0 -38
  296. package/dist/chunk-shd4yhsf.js +0 -32
  297. package/dist/chunk-shkycj1q.js +0 -178
  298. package/dist/chunk-sk7h93je.js +0 -153
  299. package/dist/chunk-sm8g6fsm.js +0 -122
  300. package/dist/chunk-snrjy66h.js +0 -671
  301. package/dist/chunk-sq4a0yjh.js +0 -116
  302. package/dist/chunk-sr3t4thh.js +0 -895
  303. package/dist/chunk-srj6qnf6.js +0 -107
  304. package/dist/chunk-sz62n77p.js +0 -155
  305. package/dist/chunk-szj5wvdy.js +0 -28
  306. package/dist/chunk-t29a6zb5.js +0 -45
  307. package/dist/chunk-t2ecddwj.js +0 -731
  308. package/dist/chunk-t33hmmmm.js +0 -113
  309. package/dist/chunk-t4khqff1.js +0 -16
  310. package/dist/chunk-t9p85zff.js +0 -24
  311. package/dist/chunk-ta3jyvxs.js +0 -984
  312. package/dist/chunk-tkx5eec8.js +0 -54
  313. package/dist/chunk-v1kzp02e.js +0 -785
  314. package/dist/chunk-v4t6dyyh.js +0 -9076
  315. package/dist/chunk-v78fj8by.js +0 -145
  316. package/dist/chunk-v8kjswxt.js +0 -61
  317. package/dist/chunk-v9smspw2.js +0 -4301
  318. package/dist/chunk-vf612n57.js +0 -472
  319. package/dist/chunk-vkhrrvfq.js +0 -44
  320. package/dist/chunk-vt5wm07k.js +0 -74
  321. package/dist/chunk-vvvrv61g.js +0 -875
  322. package/dist/chunk-vyjeh50y.js +0 -2149
  323. package/dist/chunk-w0kxcv73.js +0 -97
  324. package/dist/chunk-w6m6trzq.js +0 -58
  325. package/dist/chunk-wa8yn2p0.js +0 -2007
  326. package/dist/chunk-wb18cecv.js +0 -995
  327. package/dist/chunk-wgk9sxk7.js +0 -329
  328. package/dist/chunk-wh0ev1bw.js +0 -111
  329. package/dist/chunk-wka1647p.js +0 -98
  330. package/dist/chunk-wnwfwyj4.js +0 -90
  331. package/dist/chunk-wpdchyy2.js +0 -97
  332. package/dist/chunk-x3g44n7k.js +0 -114
  333. package/dist/chunk-x47h283a.js +0 -56
  334. package/dist/chunk-x6r4v44b.js +0 -8
  335. package/dist/chunk-x7fdwq3d.js +0 -33
  336. package/dist/chunk-x8d2ehd7.js +0 -19
  337. package/dist/chunk-xbeg2hej.js +0 -257
  338. package/dist/chunk-xeb6075z.js +0 -3435
  339. package/dist/chunk-xhfmdq1y.js +0 -147
  340. package/dist/chunk-xhscn33a.js +0 -138
  341. package/dist/chunk-xv3era3s.js +0 -8
  342. package/dist/chunk-xz5gbhc3.js +0 -93
  343. package/dist/chunk-y1784krc.js +0 -19
  344. package/dist/chunk-y1vyezct.js +0 -123
  345. package/dist/chunk-y45ecntg.js +0 -942
  346. package/dist/chunk-y4ca9kqz.js +0 -3830
  347. package/dist/chunk-y9bhjjdz.js +0 -145
  348. package/dist/chunk-yb3bxv3w.js +0 -30
  349. package/dist/chunk-ye2q9gqj.js +0 -332
  350. package/dist/chunk-yfg3adfq.js +0 -88
  351. package/dist/chunk-yst0wmgw.js +0 -269
  352. package/dist/chunk-ywe9dbnz.js +0 -460
  353. package/dist/chunk-yyex5gsf.js +0 -269
  354. package/dist/chunk-yz2kzqk5.js +0 -439
  355. package/dist/chunk-z263ehpg.js +0 -131
  356. package/dist/chunk-z2dp53wn.js +0 -17
  357. package/dist/chunk-zaq348h2.js +0 -281
  358. package/dist/chunk-zr0qx9q0.js +0 -642
  359. package/dist/chunk-zxh62ved.js +0 -31
  360. package/dist/chunk-zy5vn8sd.js +0 -329
  361. package/dist/chunk-zzm33q8x.js +0 -8
  362. package/dist/cli.js +0 -91
@@ -1,2840 +0,0 @@
1
- // @bun
2
- import {
3
- init_mappers,
4
- toInternalMessages
5
- } from "./chunk-f3kk0p3s.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_prompt7 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-gnpt1t6q.js";
69
- import {
70
- init_useKeybinding
71
- } from "./chunk-68ffk5qa.js";
72
- import {
73
- init_browser,
74
- openBrowser
75
- } from "./chunk-v8kjswxt.js";
76
- import {
77
- AGENT_TOOL_NAME,
78
- DIAMOND_FILLED,
79
- DIAMOND_OPEN,
80
- LEGACY_AGENT_TOOL_NAME,
81
- init_constants1 as init_constants,
82
- init_figures as init_figures2,
83
- init_stringUtils,
84
- plural
85
- } from "./chunk-dfq6pbq7.js";
86
- import {
87
- count,
88
- init_array,
89
- intersperse
90
- } from "./chunk-6nsd9606.js";
91
- import {
92
- TEAM_LEAD_NAME,
93
- init_constants as init_constants3
94
- } from "./chunk-4jm600zv.js";
95
- import {
96
- formatDuration,
97
- formatFileSize,
98
- formatNumber,
99
- init_format,
100
- truncate,
101
- truncateToWidth
102
- } from "./chunk-fqak69ft.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-c7jwbe76.js";
116
- import {
117
- require_jsx_dev_runtime,
118
- require_react
119
- } from "./chunk-7sgtxrsc.js";
120
- import {
121
- init_analytics,
122
- logEvent
123
- } from "./chunk-x8d2ehd7.js";
124
- import {
125
- figures_default,
126
- init_figures
127
- } from "./chunk-qajrkk97.js";
128
- import {
129
- errorMessage,
130
- init_errors,
131
- init_fsOperations,
132
- tailFile
133
- } from "./chunk-gg55fns0.js";
134
- import {
135
- __esm,
136
- __toESM
137
- } from "./chunk-qp2qdcda.js";
138
-
139
- // src/state/teammateViewHelpers.ts
140
- function isLocalAgent(task) {
141
- return typeof task === "object" && task !== null && "type" in task && task.type === "local_agent";
142
- }
143
- function release(task) {
144
- return {
145
- ...task,
146
- retain: false,
147
- messages: undefined,
148
- diskLoaded: false,
149
- evictAfter: isTerminalTaskStatus(task.status) ? Date.now() + PANEL_GRACE_MS : undefined
150
- };
151
- }
152
- function enterTeammateView(taskId, setAppState) {
153
- logEvent("tengu_transcript_view_enter", {});
154
- setAppState((prev) => {
155
- const task = prev.tasks[taskId];
156
- const prevId = prev.viewingAgentTaskId;
157
- const prevTask = prevId !== undefined ? prev.tasks[prevId] : undefined;
158
- const switching = prevId !== undefined && prevId !== taskId && isLocalAgent(prevTask) && prevTask.retain;
159
- const needsRetain = isLocalAgent(task) && (!task.retain || task.evictAfter !== undefined);
160
- const needsView = prev.viewingAgentTaskId !== taskId || prev.viewSelectionMode !== "viewing-agent";
161
- if (!needsRetain && !needsView && !switching)
162
- return prev;
163
- let tasks = prev.tasks;
164
- if (switching || needsRetain) {
165
- tasks = { ...prev.tasks };
166
- if (switching)
167
- tasks[prevId] = release(prevTask);
168
- if (needsRetain) {
169
- tasks[taskId] = { ...task, retain: true, evictAfter: undefined };
170
- }
171
- }
172
- return {
173
- ...prev,
174
- viewingAgentTaskId: taskId,
175
- viewSelectionMode: "viewing-agent",
176
- tasks
177
- };
178
- });
179
- }
180
- function exitTeammateView(setAppState) {
181
- logEvent("tengu_transcript_view_exit", {});
182
- setAppState((prev) => {
183
- const id = prev.viewingAgentTaskId;
184
- const cleared = {
185
- ...prev,
186
- viewingAgentTaskId: undefined,
187
- viewSelectionMode: "none"
188
- };
189
- if (id === undefined) {
190
- return prev.viewSelectionMode === "none" ? prev : cleared;
191
- }
192
- const task = prev.tasks[id];
193
- if (!isLocalAgent(task) || !task.retain)
194
- return cleared;
195
- return {
196
- ...cleared,
197
- tasks: { ...prev.tasks, [id]: release(task) }
198
- };
199
- });
200
- }
201
- function stopOrDismissAgent(taskId, setAppState) {
202
- setAppState((prev) => {
203
- const task = prev.tasks[taskId];
204
- if (!isLocalAgent(task))
205
- return prev;
206
- if (task.status === "running") {
207
- task.abortController?.abort();
208
- return prev;
209
- }
210
- if (task.evictAfter === 0)
211
- return prev;
212
- const viewingThis = prev.viewingAgentTaskId === taskId;
213
- return {
214
- ...prev,
215
- tasks: {
216
- ...prev.tasks,
217
- [taskId]: { ...release(task), evictAfter: 0 }
218
- },
219
- ...viewingThis && {
220
- viewingAgentTaskId: undefined,
221
- viewSelectionMode: "none"
222
- }
223
- };
224
- });
225
- }
226
- var PANEL_GRACE_MS = 30000;
227
- var init_teammateViewHelpers = __esm(() => {
228
- init_analytics();
229
- init_Task();
230
- });
231
-
232
- // src/components/tasks/renderToolActivity.tsx
233
- function renderToolActivity(activity, tools, theme) {
234
- const tool = findToolByName(tools, activity.toolName);
235
- if (!tool) {
236
- return activity.toolName;
237
- }
238
- try {
239
- const parsed = tool.inputSchema.safeParse(activity.input);
240
- const parsedInput = parsed.success ? parsed.data : {};
241
- const userFacingName = tool.userFacingName(parsedInput);
242
- if (!userFacingName) {
243
- return activity.toolName;
244
- }
245
- const toolArgs = tool.renderToolUseMessage(parsedInput, {
246
- theme,
247
- verbose: false
248
- });
249
- if (toolArgs) {
250
- return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
251
- children: [
252
- userFacingName,
253
- "(",
254
- toolArgs,
255
- ")"
256
- ]
257
- }, undefined, true, undefined, this);
258
- }
259
- return userFacingName;
260
- } catch {
261
- return activity.toolName;
262
- }
263
- }
264
- var jsx_dev_runtime;
265
- var init_renderToolActivity = __esm(() => {
266
- init_src();
267
- init_Tool();
268
- jsx_dev_runtime = __toESM(require_jsx_dev_runtime(), 1);
269
- });
270
-
271
- // src/components/tasks/taskStatusUtils.tsx
272
- function isTerminalStatus(status) {
273
- return status === "completed" || status === "failed" || status === "killed";
274
- }
275
- function getTaskStatusIcon(status, options) {
276
- const { isIdle, awaitingApproval, hasError, shutdownRequested } = options ?? {};
277
- if (hasError)
278
- return figures_default.cross;
279
- if (awaitingApproval)
280
- return figures_default.questionMarkPrefix;
281
- if (shutdownRequested)
282
- return figures_default.warning;
283
- if (status === "running") {
284
- if (isIdle)
285
- return figures_default.ellipsis;
286
- return figures_default.play;
287
- }
288
- if (status === "completed")
289
- return figures_default.tick;
290
- if (status === "failed" || status === "killed")
291
- return figures_default.cross;
292
- return figures_default.bullet;
293
- }
294
- function getTaskStatusColor(status, options) {
295
- const { isIdle, awaitingApproval, hasError, shutdownRequested } = options ?? {};
296
- if (hasError)
297
- return "error";
298
- if (awaitingApproval)
299
- return "warning";
300
- if (shutdownRequested)
301
- return "warning";
302
- if (isIdle)
303
- return "background";
304
- if (status === "completed")
305
- return "success";
306
- if (status === "failed")
307
- return "error";
308
- if (status === "killed")
309
- return "warning";
310
- return "background";
311
- }
312
- function describeTeammateActivity(t) {
313
- if (t.shutdownRequested)
314
- return "stopping";
315
- if (t.awaitingPlanApproval)
316
- return "awaiting approval";
317
- if (t.isIdle)
318
- return "idle";
319
- return (t.progress?.recentActivities && summarizeRecentActivities(t.progress.recentActivities)) ?? t.progress?.lastActivity?.activityDescription ?? "working";
320
- }
321
- function shouldHideTasksFooter(tasks, showSpinnerTree) {
322
- if (!showSpinnerTree)
323
- return false;
324
- let hasVisibleTask = false;
325
- for (const t of Object.values(tasks)) {
326
- if (!isBackgroundTask(t) || process.env.USER_TYPE === "ant" && isPanelAgentTask(t)) {
327
- continue;
328
- }
329
- hasVisibleTask = true;
330
- if (t.type !== "in_process_teammate")
331
- return false;
332
- }
333
- return hasVisibleTask;
334
- }
335
- var init_taskStatusUtils = __esm(() => {
336
- init_figures();
337
- init_LocalAgentTask();
338
- init_types();
339
- init_collapseReadSearch();
340
- });
341
-
342
- // src/components/tasks/AsyncAgentDetailDialog.tsx
343
- function AsyncAgentDetailDialog({
344
- agent,
345
- onDone,
346
- onKillAgent,
347
- onBack
348
- }) {
349
- const [theme] = useTheme();
350
- const tools = import_react.useMemo(() => getTools(getEmptyToolPermissionContext()), []);
351
- const elapsedTime = useElapsedTime(agent.startTime, agent.status === "running", 1000, agent.totalPausedMs ?? 0);
352
- useKeybindings({
353
- "confirm:yes": onDone
354
- }, { context: "Confirmation" });
355
- const handleKeyDown = (e) => {
356
- if (e.key === " ") {
357
- e.preventDefault();
358
- onDone();
359
- } else if (e.key === "left" && onBack) {
360
- e.preventDefault();
361
- onBack();
362
- } else if (e.key === "x" && agent.status === "running" && onKillAgent) {
363
- e.preventDefault();
364
- onKillAgent();
365
- }
366
- };
367
- const planContent = extractTag(agent.prompt, "plan");
368
- const displayPrompt = agent.prompt.length > 300 ? agent.prompt.substring(0, 297) + "\u2026" : agent.prompt;
369
- const tokenCount = agent.result?.totalTokens ?? agent.progress?.tokenCount;
370
- const toolUseCount = agent.result?.totalToolUseCount ?? agent.progress?.toolUseCount;
371
- const title = /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
372
- children: [
373
- agent.selectedAgent?.agentType ?? "agent",
374
- " \u203A",
375
- " ",
376
- agent.description || "Async agent"
377
- ]
378
- }, undefined, true, undefined, this);
379
- const subtitle = /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
380
- children: [
381
- agent.status !== "running" && /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
382
- color: getTaskStatusColor(agent.status),
383
- children: [
384
- getTaskStatusIcon(agent.status),
385
- " ",
386
- agent.status === "completed" ? "Completed" : agent.status === "failed" ? "Failed" : "Stopped",
387
- " \xB7 "
388
- ]
389
- }, undefined, true, undefined, this),
390
- /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
391
- dimColor: true,
392
- children: [
393
- elapsedTime,
394
- tokenCount !== undefined && tokenCount > 0 && /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(jsx_dev_runtime2.Fragment, {
395
- children: [
396
- " \xB7 ",
397
- formatNumber(tokenCount),
398
- " tokens"
399
- ]
400
- }, undefined, true, undefined, this),
401
- toolUseCount !== undefined && toolUseCount > 0 && /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(jsx_dev_runtime2.Fragment, {
402
- children: [
403
- " ",
404
- "\xB7 ",
405
- toolUseCount,
406
- " ",
407
- toolUseCount === 1 ? "tool" : "tools"
408
- ]
409
- }, undefined, true, undefined, this)
410
- ]
411
- }, undefined, true, undefined, this)
412
- ]
413
- }, undefined, true, undefined, this);
414
- return /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
415
- flexDirection: "column",
416
- tabIndex: 0,
417
- autoFocus: true,
418
- onKeyDown: handleKeyDown,
419
- children: /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Dialog, {
420
- title,
421
- subtitle,
422
- onCancel: onDone,
423
- color: "background",
424
- inputGuide: (exitState) => exitState.pending ? /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
425
- children: [
426
- "Press ",
427
- exitState.keyName,
428
- " again to exit"
429
- ]
430
- }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Byline, {
431
- children: [
432
- onBack && /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(KeyboardShortcutHint, {
433
- shortcut: "\u2190",
434
- action: "go back"
435
- }, undefined, false, undefined, this),
436
- /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(KeyboardShortcutHint, {
437
- shortcut: "Esc/Enter/Space",
438
- action: "close"
439
- }, undefined, false, undefined, this),
440
- agent.status === "running" && onKillAgent && /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(KeyboardShortcutHint, {
441
- shortcut: "x",
442
- action: "stop"
443
- }, undefined, false, undefined, this)
444
- ]
445
- }, undefined, true, undefined, this),
446
- children: /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
447
- flexDirection: "column",
448
- children: [
449
- agent.status === "running" && agent.progress?.recentActivities && agent.progress.recentActivities.length > 0 && /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
450
- flexDirection: "column",
451
- children: [
452
- /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
453
- bold: true,
454
- dimColor: true,
455
- children: "Progress"
456
- }, undefined, false, undefined, this),
457
- agent.progress.recentActivities.map((activity, i) => /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
458
- dimColor: i < agent.progress.recentActivities.length - 1,
459
- wrap: "truncate-end",
460
- children: [
461
- i === agent.progress.recentActivities.length - 1 ? "\u203A " : " ",
462
- renderToolActivity(activity, tools, theme)
463
- ]
464
- }, i, true, undefined, this))
465
- ]
466
- }, undefined, true, undefined, this),
467
- planContent ? /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
468
- marginTop: 1,
469
- children: /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(UserPlanMessage, {
470
- addMargin: false,
471
- planContent
472
- }, undefined, false, undefined, this)
473
- }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
474
- flexDirection: "column",
475
- marginTop: 1,
476
- children: [
477
- /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
478
- bold: true,
479
- dimColor: true,
480
- children: "Prompt"
481
- }, undefined, false, undefined, this),
482
- /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
483
- wrap: "wrap",
484
- children: displayPrompt
485
- }, undefined, false, undefined, this)
486
- ]
487
- }, undefined, true, undefined, this),
488
- agent.status === "failed" && agent.error && /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
489
- flexDirection: "column",
490
- marginTop: 1,
491
- children: [
492
- /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
493
- bold: true,
494
- color: "error",
495
- children: "Error"
496
- }, undefined, false, undefined, this),
497
- /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
498
- color: "error",
499
- wrap: "wrap",
500
- children: agent.error
501
- }, undefined, false, undefined, this)
502
- ]
503
- }, undefined, true, undefined, this)
504
- ]
505
- }, undefined, true, undefined, this)
506
- }, undefined, false, undefined, this)
507
- }, undefined, false, undefined, this);
508
- }
509
- var import_react, jsx_dev_runtime2;
510
- var init_AsyncAgentDetailDialog = __esm(() => {
511
- init_useElapsedTime();
512
- init_src();
513
- init_useKeybinding();
514
- init_Tool();
515
- init_tools();
516
- init_format();
517
- init_messages();
518
- init_src();
519
- init_UserPlanMessage();
520
- init_renderToolActivity();
521
- init_taskStatusUtils();
522
- import_react = __toESM(require_react(), 1);
523
- jsx_dev_runtime2 = __toESM(require_jsx_dev_runtime(), 1);
524
- });
525
-
526
- // src/components/tasks/RemoteSessionProgress.tsx
527
- function formatReviewStageCounts(stage, found, verified, refuted) {
528
- if (!stage)
529
- return `${found} found \xB7 ${verified} verified`;
530
- if (stage === "synthesizing") {
531
- const parts = [`${verified} verified`];
532
- if (refuted > 0)
533
- parts.push(`${refuted} refuted`);
534
- parts.push("deduping");
535
- return parts.join(" \xB7 ");
536
- }
537
- if (stage === "verifying") {
538
- const parts = [`${found} found`, `${verified} verified`];
539
- if (refuted > 0)
540
- parts.push(`${refuted} refuted`);
541
- return parts.join(" \xB7 ");
542
- }
543
- return found > 0 ? `${found} found` : "finding";
544
- }
545
- function RainbowText({
546
- text,
547
- phase = 0
548
- }) {
549
- return /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(jsx_dev_runtime3.Fragment, {
550
- children: [...text].map((ch, i) => /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
551
- color: getRainbowColor(i + phase),
552
- children: ch
553
- }, i, false, undefined, this))
554
- }, undefined, false, undefined, this);
555
- }
556
- function useSmoothCount(target, time, snap) {
557
- const displayed = import_react2.useRef(target);
558
- const lastTick = import_react2.useRef(time);
559
- if (snap || target < displayed.current) {
560
- displayed.current = target;
561
- } else if (target > displayed.current && time !== lastTick.current) {
562
- displayed.current += 1;
563
- lastTick.current = time;
564
- }
565
- return displayed.current;
566
- }
567
- function ReviewRainbowLine({
568
- session
569
- }) {
570
- const settings = useSettings();
571
- const reducedMotion = settings.prefersReducedMotion ?? false;
572
- const p = session.reviewProgress;
573
- const running = session.status === "running";
574
- const [, time] = useAnimationFrame(running && !reducedMotion ? TICK_MS : null);
575
- const targetFound = p?.bugsFound ?? 0;
576
- const targetVerified = p?.bugsVerified ?? 0;
577
- const targetRefuted = p?.bugsRefuted ?? 0;
578
- const snap = reducedMotion || !running;
579
- const found = useSmoothCount(targetFound, time, snap);
580
- const verified = useSmoothCount(targetVerified, time, snap);
581
- const refuted = useSmoothCount(targetRefuted, time, snap);
582
- const phase = Math.floor(time / (TICK_MS * 3)) % 7;
583
- if (session.status === "completed") {
584
- return /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(jsx_dev_runtime3.Fragment, {
585
- children: [
586
- /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
587
- color: "background",
588
- children: [
589
- DIAMOND_FILLED,
590
- " "
591
- ]
592
- }, undefined, true, undefined, this),
593
- /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(RainbowText, {
594
- text: "ultrareview",
595
- phase: 0
596
- }, undefined, false, undefined, this),
597
- /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
598
- dimColor: true,
599
- children: " ready \xB7 shift+\u2193 to view"
600
- }, undefined, false, undefined, this)
601
- ]
602
- }, undefined, true, undefined, this);
603
- }
604
- if (session.status === "failed") {
605
- return /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(jsx_dev_runtime3.Fragment, {
606
- children: [
607
- /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
608
- color: "background",
609
- children: [
610
- DIAMOND_FILLED,
611
- " "
612
- ]
613
- }, undefined, true, undefined, this),
614
- /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(RainbowText, {
615
- text: "ultrareview",
616
- phase: 0
617
- }, undefined, false, undefined, this),
618
- /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
619
- color: "error",
620
- dimColor: true,
621
- children: [
622
- " \xB7 ",
623
- "error"
624
- ]
625
- }, undefined, true, undefined, this)
626
- ]
627
- }, undefined, true, undefined, this);
628
- }
629
- const tail = !p ? "setting up" : formatReviewStageCounts(p.stage, found, verified, refuted);
630
- return /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(jsx_dev_runtime3.Fragment, {
631
- children: [
632
- /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
633
- color: "background",
634
- children: [
635
- DIAMOND_OPEN,
636
- " "
637
- ]
638
- }, undefined, true, undefined, this),
639
- /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(RainbowText, {
640
- text: "ultrareview",
641
- phase: running ? phase : 0
642
- }, undefined, false, undefined, this),
643
- /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
644
- dimColor: true,
645
- children: [
646
- " \xB7 ",
647
- tail
648
- ]
649
- }, undefined, true, undefined, this)
650
- ]
651
- }, undefined, true, undefined, this);
652
- }
653
- function RemoteSessionProgress({
654
- session
655
- }) {
656
- if (session.isRemoteReview) {
657
- return /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ReviewRainbowLine, {
658
- session
659
- }, undefined, false, undefined, this);
660
- }
661
- if (session.status === "completed") {
662
- return /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
663
- bold: true,
664
- color: "success",
665
- dimColor: true,
666
- children: "done"
667
- }, undefined, false, undefined, this);
668
- }
669
- if (session.status === "failed") {
670
- return /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
671
- bold: true,
672
- color: "error",
673
- dimColor: true,
674
- children: "error"
675
- }, undefined, false, undefined, this);
676
- }
677
- if (!session.todoList.length) {
678
- return /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
679
- dimColor: true,
680
- children: [
681
- session.status,
682
- "\u2026"
683
- ]
684
- }, undefined, true, undefined, this);
685
- }
686
- const completed = count(session.todoList, (_) => _.status === "completed");
687
- const total = session.todoList.length;
688
- return /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
689
- dimColor: true,
690
- children: [
691
- completed,
692
- "/",
693
- total
694
- ]
695
- }, undefined, true, undefined, this);
696
- }
697
- var import_react2, jsx_dev_runtime3, TICK_MS = 80;
698
- var init_RemoteSessionProgress = __esm(() => {
699
- init_figures2();
700
- init_useSettings();
701
- init_src();
702
- init_array();
703
- init_thinking();
704
- import_react2 = __toESM(require_react(), 1);
705
- jsx_dev_runtime3 = __toESM(require_jsx_dev_runtime(), 1);
706
- });
707
-
708
- // src/components/tasks/ShellProgress.tsx
709
- function TaskStatusText({
710
- status,
711
- label,
712
- suffix
713
- }) {
714
- const displayLabel = label ?? status;
715
- const color = status === "completed" ? "success" : status === "failed" ? "error" : status === "killed" ? "warning" : undefined;
716
- return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
717
- color,
718
- dimColor: true,
719
- children: [
720
- "(",
721
- displayLabel,
722
- suffix,
723
- ")"
724
- ]
725
- }, undefined, true, undefined, this);
726
- }
727
- function ShellProgress({
728
- shell
729
- }) {
730
- switch (shell.status) {
731
- case "completed":
732
- return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(TaskStatusText, {
733
- status: "completed",
734
- label: "done"
735
- }, undefined, false, undefined, this);
736
- case "failed":
737
- return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(TaskStatusText, {
738
- status: "failed",
739
- label: "error"
740
- }, undefined, false, undefined, this);
741
- case "killed":
742
- return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(TaskStatusText, {
743
- status: "killed",
744
- label: "stopped"
745
- }, undefined, false, undefined, this);
746
- case "running":
747
- case "pending":
748
- return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(TaskStatusText, {
749
- status: "running"
750
- }, undefined, false, undefined, this);
751
- }
752
- }
753
- var jsx_dev_runtime4;
754
- var init_ShellProgress = __esm(() => {
755
- init_src();
756
- jsx_dev_runtime4 = __toESM(require_jsx_dev_runtime(), 1);
757
- });
758
-
759
- // src/components/tasks/BackgroundTask.tsx
760
- function BackgroundTask({
761
- task,
762
- maxActivityWidth
763
- }) {
764
- const activityLimit = maxActivityWidth ?? 40;
765
- switch (task.type) {
766
- case "local_bash":
767
- return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
768
- children: [
769
- truncate(task.kind === "monitor" ? task.description : task.command, activityLimit, true),
770
- " ",
771
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ShellProgress, {
772
- shell: task
773
- }, undefined, false, undefined, this)
774
- ]
775
- }, undefined, true, undefined, this);
776
- case "remote_agent": {
777
- if (task.isRemoteReview) {
778
- return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
779
- children: /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(RemoteSessionProgress, {
780
- session: task
781
- }, undefined, false, undefined, this)
782
- }, undefined, false, undefined, this);
783
- }
784
- const running = task.status === "running" || task.status === "pending";
785
- return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
786
- children: [
787
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
788
- dimColor: true,
789
- children: [
790
- running ? DIAMOND_OPEN : DIAMOND_FILLED,
791
- " "
792
- ]
793
- }, undefined, true, undefined, this),
794
- truncate(task.title, activityLimit, true),
795
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
796
- dimColor: true,
797
- children: " \xB7 "
798
- }, undefined, false, undefined, this),
799
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(RemoteSessionProgress, {
800
- session: task
801
- }, undefined, false, undefined, this)
802
- ]
803
- }, undefined, true, undefined, this);
804
- }
805
- case "local_agent":
806
- return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
807
- children: [
808
- truncate(task.description, activityLimit, true),
809
- " ",
810
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(TaskStatusText, {
811
- status: task.status,
812
- label: task.status === "completed" ? "done" : undefined,
813
- suffix: task.status === "completed" && !task.notified ? ", unread" : undefined
814
- }, undefined, false, undefined, this)
815
- ]
816
- }, undefined, true, undefined, this);
817
- case "in_process_teammate": {
818
- const activity = describeTeammateActivity(task);
819
- return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
820
- children: [
821
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
822
- color: toInkColor(task.identity.color),
823
- children: [
824
- "@",
825
- task.identity.agentName
826
- ]
827
- }, undefined, true, undefined, this),
828
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
829
- dimColor: true,
830
- children: [
831
- ": ",
832
- truncate(activity, activityLimit, true)
833
- ]
834
- }, undefined, true, undefined, this)
835
- ]
836
- }, undefined, true, undefined, this);
837
- }
838
- case "local_workflow":
839
- return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
840
- children: [
841
- truncate(task.workflowName ?? task.summary ?? task.description, activityLimit, true),
842
- " ",
843
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(TaskStatusText, {
844
- status: task.status,
845
- label: task.status === "running" ? `${task.agentCount} ${plural(task.agentCount, "agent")}` : task.status === "completed" ? "done" : undefined,
846
- suffix: task.status === "completed" && !task.notified ? ", unread" : undefined
847
- }, undefined, false, undefined, this)
848
- ]
849
- }, undefined, true, undefined, this);
850
- case "monitor_mcp":
851
- return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
852
- children: [
853
- truncate(task.description, activityLimit, true),
854
- " ",
855
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(TaskStatusText, {
856
- status: task.status,
857
- label: task.status === "completed" ? "done" : undefined,
858
- suffix: task.status === "completed" && !task.notified ? ", unread" : undefined
859
- }, undefined, false, undefined, this)
860
- ]
861
- }, undefined, true, undefined, this);
862
- case "dream": {
863
- const n = task.filesTouched.length;
864
- const detail = task.phase === "updating" && n > 0 ? `${n} ${plural(n, "file")}` : `${task.sessionsReviewing} ${plural(task.sessionsReviewing, "session")}`;
865
- return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
866
- children: [
867
- task.description,
868
- " ",
869
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
870
- dimColor: true,
871
- children: [
872
- "\xB7 ",
873
- task.phase,
874
- " \xB7 ",
875
- detail
876
- ]
877
- }, undefined, true, undefined, this),
878
- " ",
879
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(TaskStatusText, {
880
- status: task.status,
881
- label: task.status === "completed" ? "done" : undefined,
882
- suffix: task.status === "completed" && !task.notified ? ", unread" : undefined
883
- }, undefined, false, undefined, this)
884
- ]
885
- }, undefined, true, undefined, this);
886
- }
887
- }
888
- }
889
- var jsx_dev_runtime5;
890
- var init_BackgroundTask = __esm(() => {
891
- init_src();
892
- init_ink();
893
- init_format();
894
- init_stringUtils();
895
- init_figures2();
896
- init_RemoteSessionProgress();
897
- init_ShellProgress();
898
- init_taskStatusUtils();
899
- jsx_dev_runtime5 = __toESM(require_jsx_dev_runtime(), 1);
900
- });
901
-
902
- // src/components/tasks/DreamDetailDialog.tsx
903
- function DreamDetailDialog({
904
- task,
905
- onDone,
906
- onBack,
907
- onKill
908
- }) {
909
- const elapsedTime = useElapsedTime(task.startTime, task.status === "running", 1000, 0);
910
- useKeybindings({ "confirm:yes": onDone }, { context: "Confirmation" });
911
- const handleKeyDown = (e) => {
912
- if (e.key === " ") {
913
- e.preventDefault();
914
- onDone();
915
- } else if (e.key === "left" && onBack) {
916
- e.preventDefault();
917
- onBack();
918
- } else if (e.key === "x" && task.status === "running" && onKill) {
919
- e.preventDefault();
920
- onKill();
921
- }
922
- };
923
- const visibleTurns = task.turns.filter((t) => t.text !== "");
924
- const shown = visibleTurns.slice(-VISIBLE_TURNS);
925
- const hidden = visibleTurns.length - shown.length;
926
- return /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedBox_default, {
927
- flexDirection: "column",
928
- tabIndex: 0,
929
- autoFocus: true,
930
- onKeyDown: handleKeyDown,
931
- children: /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Dialog, {
932
- title: "Memory consolidation",
933
- subtitle: /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedText, {
934
- dimColor: true,
935
- children: [
936
- elapsedTime,
937
- " \xB7 reviewing ",
938
- task.sessionsReviewing,
939
- " ",
940
- plural(task.sessionsReviewing, "session"),
941
- task.filesTouched.length > 0 && /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(jsx_dev_runtime6.Fragment, {
942
- children: [
943
- " ",
944
- "\xB7 ",
945
- task.filesTouched.length,
946
- " ",
947
- plural(task.filesTouched.length, "file"),
948
- " touched"
949
- ]
950
- }, undefined, true, undefined, this)
951
- ]
952
- }, undefined, true, undefined, this),
953
- onCancel: onDone,
954
- color: "background",
955
- inputGuide: (exitState) => exitState.pending ? /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedText, {
956
- children: [
957
- "Press ",
958
- exitState.keyName,
959
- " again to exit"
960
- ]
961
- }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Byline, {
962
- children: [
963
- onBack && /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(KeyboardShortcutHint, {
964
- shortcut: "\u2190",
965
- action: "go back"
966
- }, undefined, false, undefined, this),
967
- /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(KeyboardShortcutHint, {
968
- shortcut: "Esc/Enter/Space",
969
- action: "close"
970
- }, undefined, false, undefined, this),
971
- task.status === "running" && onKill && /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(KeyboardShortcutHint, {
972
- shortcut: "x",
973
- action: "stop"
974
- }, undefined, false, undefined, this)
975
- ]
976
- }, undefined, true, undefined, this),
977
- children: /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedBox_default, {
978
- flexDirection: "column",
979
- gap: 1,
980
- children: [
981
- /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedText, {
982
- children: [
983
- /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedText, {
984
- bold: true,
985
- children: "Status:"
986
- }, undefined, false, undefined, this),
987
- " ",
988
- task.status === "running" ? /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedText, {
989
- color: "background",
990
- children: "running"
991
- }, undefined, false, undefined, this) : task.status === "completed" ? /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedText, {
992
- color: "success",
993
- children: task.status
994
- }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedText, {
995
- color: "error",
996
- children: task.status
997
- }, undefined, false, undefined, this)
998
- ]
999
- }, undefined, true, undefined, this),
1000
- shown.length === 0 ? /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedText, {
1001
- dimColor: true,
1002
- children: task.status === "running" ? "Starting\u2026" : "(no text output)"
1003
- }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(jsx_dev_runtime6.Fragment, {
1004
- children: [
1005
- hidden > 0 && /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedText, {
1006
- dimColor: true,
1007
- children: [
1008
- "(",
1009
- hidden,
1010
- " earlier ",
1011
- plural(hidden, "turn"),
1012
- ")"
1013
- ]
1014
- }, undefined, true, undefined, this),
1015
- shown.map((turn, i) => /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedBox_default, {
1016
- flexDirection: "column",
1017
- children: [
1018
- /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedText, {
1019
- wrap: "wrap",
1020
- children: turn.text
1021
- }, undefined, false, undefined, this),
1022
- turn.toolUseCount > 0 && /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedText, {
1023
- dimColor: true,
1024
- children: [
1025
- " ",
1026
- "(",
1027
- turn.toolUseCount,
1028
- " ",
1029
- plural(turn.toolUseCount, "tool"),
1030
- ")"
1031
- ]
1032
- }, undefined, true, undefined, this)
1033
- ]
1034
- }, i, true, undefined, this))
1035
- ]
1036
- }, undefined, true, undefined, this)
1037
- ]
1038
- }, undefined, true, undefined, this)
1039
- }, undefined, false, undefined, this)
1040
- }, undefined, false, undefined, this);
1041
- }
1042
- var jsx_dev_runtime6, VISIBLE_TURNS = 6;
1043
- var init_DreamDetailDialog = __esm(() => {
1044
- init_useElapsedTime();
1045
- init_src();
1046
- init_useKeybinding();
1047
- init_stringUtils();
1048
- init_src();
1049
- jsx_dev_runtime6 = __toESM(require_jsx_dev_runtime(), 1);
1050
- });
1051
-
1052
- // src/components/tasks/InProcessTeammateDetailDialog.tsx
1053
- function InProcessTeammateDetailDialog({
1054
- teammate,
1055
- onDone,
1056
- onKill,
1057
- onBack,
1058
- onForeground
1059
- }) {
1060
- const [theme] = useTheme();
1061
- const tools = import_react3.useMemo(() => getTools(getEmptyToolPermissionContext()), []);
1062
- const elapsedTime = useElapsedTime(teammate.startTime, teammate.status === "running", 1000, teammate.totalPausedMs ?? 0);
1063
- useKeybindings({
1064
- "confirm:yes": onDone
1065
- }, { context: "Confirmation" });
1066
- const handleKeyDown = (e) => {
1067
- if (e.key === " ") {
1068
- e.preventDefault();
1069
- onDone();
1070
- } else if (e.key === "left" && onBack) {
1071
- e.preventDefault();
1072
- onBack();
1073
- } else if (e.key === "x" && teammate.status === "running" && onKill) {
1074
- e.preventDefault();
1075
- onKill();
1076
- } else if (e.key === "f" && teammate.status === "running" && onForeground) {
1077
- e.preventDefault();
1078
- onForeground();
1079
- }
1080
- };
1081
- const activity = describeTeammateActivity(teammate);
1082
- const tokenCount = teammate.result?.totalTokens ?? teammate.progress?.tokenCount;
1083
- const toolUseCount = teammate.result?.totalToolUseCount ?? teammate.progress?.toolUseCount;
1084
- const displayPrompt = truncateToWidth(teammate.prompt, 300);
1085
- const title = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
1086
- children: [
1087
- /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
1088
- color: toInkColor(teammate.identity.color),
1089
- children: [
1090
- "@",
1091
- teammate.identity.agentName
1092
- ]
1093
- }, undefined, true, undefined, this),
1094
- activity && /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
1095
- dimColor: true,
1096
- children: [
1097
- " (",
1098
- activity,
1099
- ")"
1100
- ]
1101
- }, undefined, true, undefined, this)
1102
- ]
1103
- }, undefined, true, undefined, this);
1104
- const subtitle = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
1105
- children: [
1106
- teammate.status !== "running" && /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
1107
- color: teammate.status === "completed" ? "success" : teammate.status === "killed" ? "warning" : "error",
1108
- children: [
1109
- teammate.status === "completed" ? "Completed" : teammate.status === "failed" ? "Failed" : "Stopped",
1110
- " \xB7 "
1111
- ]
1112
- }, undefined, true, undefined, this),
1113
- /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
1114
- dimColor: true,
1115
- children: [
1116
- elapsedTime,
1117
- tokenCount !== undefined && tokenCount > 0 && /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(jsx_dev_runtime7.Fragment, {
1118
- children: [
1119
- " \xB7 ",
1120
- formatNumber(tokenCount),
1121
- " tokens"
1122
- ]
1123
- }, undefined, true, undefined, this),
1124
- toolUseCount !== undefined && toolUseCount > 0 && /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(jsx_dev_runtime7.Fragment, {
1125
- children: [
1126
- " ",
1127
- "\xB7 ",
1128
- toolUseCount,
1129
- " ",
1130
- toolUseCount === 1 ? "tool" : "tools"
1131
- ]
1132
- }, undefined, true, undefined, this)
1133
- ]
1134
- }, undefined, true, undefined, this)
1135
- ]
1136
- }, undefined, true, undefined, this);
1137
- return /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedBox_default, {
1138
- flexDirection: "column",
1139
- tabIndex: 0,
1140
- autoFocus: true,
1141
- onKeyDown: handleKeyDown,
1142
- children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Dialog, {
1143
- title,
1144
- subtitle,
1145
- onCancel: onDone,
1146
- color: "background",
1147
- inputGuide: (exitState) => exitState.pending ? /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
1148
- children: [
1149
- "Press ",
1150
- exitState.keyName,
1151
- " again to exit"
1152
- ]
1153
- }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Byline, {
1154
- children: [
1155
- onBack && /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(KeyboardShortcutHint, {
1156
- shortcut: "\u2190",
1157
- action: "go back"
1158
- }, undefined, false, undefined, this),
1159
- /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(KeyboardShortcutHint, {
1160
- shortcut: "Esc/Enter/Space",
1161
- action: "close"
1162
- }, undefined, false, undefined, this),
1163
- teammate.status === "running" && onKill && /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(KeyboardShortcutHint, {
1164
- shortcut: "x",
1165
- action: "stop"
1166
- }, undefined, false, undefined, this),
1167
- teammate.status === "running" && onForeground && /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(KeyboardShortcutHint, {
1168
- shortcut: "f",
1169
- action: "foreground"
1170
- }, undefined, false, undefined, this)
1171
- ]
1172
- }, undefined, true, undefined, this),
1173
- children: [
1174
- teammate.status === "running" && teammate.progress?.recentActivities && teammate.progress.recentActivities.length > 0 && /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedBox_default, {
1175
- flexDirection: "column",
1176
- children: [
1177
- /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
1178
- bold: true,
1179
- dimColor: true,
1180
- children: "Progress"
1181
- }, undefined, false, undefined, this),
1182
- teammate.progress.recentActivities.map((activity2, i) => /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
1183
- dimColor: i < teammate.progress.recentActivities.length - 1,
1184
- wrap: "truncate-end",
1185
- children: [
1186
- i === teammate.progress.recentActivities.length - 1 ? "\u203A " : " ",
1187
- renderToolActivity(activity2, tools, theme)
1188
- ]
1189
- }, i, true, undefined, this))
1190
- ]
1191
- }, undefined, true, undefined, this),
1192
- /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedBox_default, {
1193
- flexDirection: "column",
1194
- marginTop: 1,
1195
- children: [
1196
- /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
1197
- bold: true,
1198
- dimColor: true,
1199
- children: "Prompt"
1200
- }, undefined, false, undefined, this),
1201
- /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
1202
- wrap: "wrap",
1203
- children: displayPrompt
1204
- }, undefined, false, undefined, this)
1205
- ]
1206
- }, undefined, true, undefined, this),
1207
- teammate.status === "failed" && teammate.error && /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedBox_default, {
1208
- flexDirection: "column",
1209
- marginTop: 1,
1210
- children: [
1211
- /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
1212
- bold: true,
1213
- color: "error",
1214
- children: "Error"
1215
- }, undefined, false, undefined, this),
1216
- /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedText, {
1217
- color: "error",
1218
- wrap: "wrap",
1219
- children: teammate.error
1220
- }, undefined, false, undefined, this)
1221
- ]
1222
- }, undefined, true, undefined, this)
1223
- ]
1224
- }, undefined, true, undefined, this)
1225
- }, undefined, false, undefined, this);
1226
- }
1227
- var import_react3, jsx_dev_runtime7;
1228
- var init_InProcessTeammateDetailDialog = __esm(() => {
1229
- init_useElapsedTime();
1230
- init_src();
1231
- init_useKeybinding();
1232
- init_Tool();
1233
- init_tools();
1234
- init_format();
1235
- init_src();
1236
- init_ink();
1237
- init_renderToolActivity();
1238
- init_taskStatusUtils();
1239
- import_react3 = __toESM(require_react(), 1);
1240
- jsx_dev_runtime7 = __toESM(require_jsx_dev_runtime(), 1);
1241
- });
1242
-
1243
- // src/components/tasks/RemoteSessionDetailDialog.tsx
1244
- function formatToolUseSummary(name, input) {
1245
- if (name === EXIT_PLAN_MODE_V2_TOOL_NAME) {
1246
- return "Review the plan in Claude Code on the web";
1247
- }
1248
- if (!input || typeof input !== "object")
1249
- return name;
1250
- if (name === ASK_USER_QUESTION_TOOL_NAME && "questions" in input) {
1251
- const qs = input.questions;
1252
- if (Array.isArray(qs) && qs[0] && typeof qs[0] === "object") {
1253
- 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;
1254
- if (q) {
1255
- const oneLine = q.replace(/\s+/g, " ").trim();
1256
- return `Answer in browser: ${truncateToWidth(oneLine, 50)}`;
1257
- }
1258
- }
1259
- }
1260
- for (const v of Object.values(input)) {
1261
- if (typeof v === "string" && v.trim()) {
1262
- const oneLine = v.replace(/\s+/g, " ").trim();
1263
- return `${name} ${truncateToWidth(oneLine, 60)}`;
1264
- }
1265
- }
1266
- return name;
1267
- }
1268
- function UltraplanSessionDetail({
1269
- session,
1270
- onDone,
1271
- onBack,
1272
- onKill
1273
- }) {
1274
- const running = session.status === "running" || session.status === "pending";
1275
- const phase = session.ultraplanPhase;
1276
- const statusText = running ? phase ? PHASE_LABEL[phase] : "running" : session.status;
1277
- const elapsedTime = useElapsedTime(session.startTime, running, 1000, 0, session.endTime);
1278
- const { agentsWorking, toolCalls, lastToolCall } = import_react4.useMemo(() => {
1279
- let spawns = 0;
1280
- let calls = 0;
1281
- let lastBlock = null;
1282
- for (const msg of session.log) {
1283
- if (msg.type !== "assistant")
1284
- continue;
1285
- for (const block of msg.message.content) {
1286
- if (block.type !== "tool_use")
1287
- continue;
1288
- calls++;
1289
- lastBlock = block;
1290
- if (block.name === AGENT_TOOL_NAME || block.name === LEGACY_AGENT_TOOL_NAME) {
1291
- spawns++;
1292
- }
1293
- }
1294
- }
1295
- return {
1296
- agentsWorking: 1 + spawns,
1297
- toolCalls: calls,
1298
- lastToolCall: lastBlock ? formatToolUseSummary(lastBlock.name, lastBlock.input) : null
1299
- };
1300
- }, [session.log]);
1301
- const sessionUrl = getRemoteTaskSessionUrl(session.sessionId);
1302
- const goBackOrClose = onBack ?? (() => onDone("Remote session details dismissed", { display: "system" }));
1303
- const [confirmingStop, setConfirmingStop] = import_react4.useState(false);
1304
- if (confirmingStop) {
1305
- return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Dialog, {
1306
- title: "Stop ultraplan?",
1307
- onCancel: () => setConfirmingStop(false),
1308
- color: "background",
1309
- children: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedBox_default, {
1310
- flexDirection: "column",
1311
- gap: 1,
1312
- children: [
1313
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1314
- dimColor: true,
1315
- children: "This will terminate the Claude Code on the web session."
1316
- }, undefined, false, undefined, this),
1317
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Select, {
1318
- options: [
1319
- { label: "Terminate session", value: "stop" },
1320
- { label: "Back", value: "back" }
1321
- ],
1322
- onChange: (v) => {
1323
- if (v === "stop") {
1324
- onKill?.();
1325
- goBackOrClose();
1326
- } else {
1327
- setConfirmingStop(false);
1328
- }
1329
- }
1330
- }, undefined, false, undefined, this)
1331
- ]
1332
- }, undefined, true, undefined, this)
1333
- }, undefined, false, undefined, this);
1334
- }
1335
- return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Dialog, {
1336
- title: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1337
- children: [
1338
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1339
- color: "background",
1340
- children: [
1341
- phase === "plan_ready" ? DIAMOND_FILLED : DIAMOND_OPEN,
1342
- " "
1343
- ]
1344
- }, undefined, true, undefined, this),
1345
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1346
- bold: true,
1347
- children: "ultraplan"
1348
- }, undefined, false, undefined, this),
1349
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1350
- dimColor: true,
1351
- children: [
1352
- " \xB7 ",
1353
- elapsedTime,
1354
- " \xB7 ",
1355
- statusText
1356
- ]
1357
- }, undefined, true, undefined, this)
1358
- ]
1359
- }, undefined, true, undefined, this),
1360
- onCancel: goBackOrClose,
1361
- color: "background",
1362
- children: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedBox_default, {
1363
- flexDirection: "column",
1364
- gap: 1,
1365
- children: [
1366
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1367
- children: [
1368
- phase === "plan_ready" && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1369
- color: "success",
1370
- children: [
1371
- figures_default.tick,
1372
- " "
1373
- ]
1374
- }, undefined, true, undefined, this),
1375
- agentsWorking,
1376
- " ",
1377
- plural(agentsWorking, "agent"),
1378
- " ",
1379
- phase ? AGENT_VERB[phase] : "working",
1380
- " \xB7 ",
1381
- toolCalls,
1382
- " tool",
1383
- " ",
1384
- plural(toolCalls, "call")
1385
- ]
1386
- }, undefined, true, undefined, this),
1387
- lastToolCall && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1388
- dimColor: true,
1389
- children: lastToolCall
1390
- }, undefined, false, undefined, this),
1391
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Link, {
1392
- url: sessionUrl,
1393
- children: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1394
- dimColor: true,
1395
- children: sessionUrl
1396
- }, undefined, false, undefined, this)
1397
- }, undefined, false, undefined, this),
1398
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Select, {
1399
- options: [
1400
- {
1401
- label: "Review in Claude Code on the web",
1402
- value: "open"
1403
- },
1404
- ...onKill && running ? [{ label: "Stop ultraplan", value: "stop" }] : [],
1405
- { label: "Back", value: "back" }
1406
- ],
1407
- onChange: (v) => {
1408
- switch (v) {
1409
- case "open":
1410
- openBrowser(sessionUrl);
1411
- onDone();
1412
- return;
1413
- case "stop":
1414
- setConfirmingStop(true);
1415
- return;
1416
- case "back":
1417
- goBackOrClose();
1418
- return;
1419
- }
1420
- }
1421
- }, undefined, false, undefined, this)
1422
- ]
1423
- }, undefined, true, undefined, this)
1424
- }, undefined, false, undefined, this);
1425
- }
1426
- function StagePipeline({
1427
- stage,
1428
- completed,
1429
- hasProgress
1430
- }) {
1431
- const currentIdx = stage ? STAGES.indexOf(stage) : -1;
1432
- const inSetup = !completed && !hasProgress;
1433
- return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1434
- children: [
1435
- inSetup ? /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1436
- color: "background",
1437
- children: "Setup"
1438
- }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1439
- dimColor: true,
1440
- children: "Setup"
1441
- }, undefined, false, undefined, this),
1442
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1443
- dimColor: true,
1444
- children: " \u2192 "
1445
- }, undefined, false, undefined, this),
1446
- STAGES.map((s, i) => {
1447
- const isCurrent = !completed && !inSetup && i === currentIdx;
1448
- return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(import_react4.default.Fragment, {
1449
- children: [
1450
- i > 0 && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1451
- dimColor: true,
1452
- children: " \u2192 "
1453
- }, undefined, false, undefined, this),
1454
- isCurrent ? /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1455
- color: "background",
1456
- children: STAGE_LABELS[s]
1457
- }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1458
- dimColor: true,
1459
- children: STAGE_LABELS[s]
1460
- }, undefined, false, undefined, this)
1461
- ]
1462
- }, s, true, undefined, this);
1463
- }),
1464
- completed && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1465
- color: "success",
1466
- children: " \u2713"
1467
- }, undefined, false, undefined, this)
1468
- ]
1469
- }, undefined, true, undefined, this);
1470
- }
1471
- function reviewCountsLine(session) {
1472
- const p = session.reviewProgress;
1473
- if (!p)
1474
- return session.status === "completed" ? "done" : "setting up";
1475
- const verified = p.bugsVerified;
1476
- const refuted = p.bugsRefuted ?? 0;
1477
- if (session.status === "completed") {
1478
- const parts = [`${verified} ${plural(verified, "finding")}`];
1479
- if (refuted > 0)
1480
- parts.push(`${refuted} refuted`);
1481
- return parts.join(" \xB7 ");
1482
- }
1483
- return formatReviewStageCounts(p.stage, p.bugsFound, verified, refuted);
1484
- }
1485
- function ReviewSessionDetail({
1486
- session,
1487
- onDone,
1488
- onBack,
1489
- onKill
1490
- }) {
1491
- const completed = session.status === "completed";
1492
- const running = session.status === "running" || session.status === "pending";
1493
- const [confirmingStop, setConfirmingStop] = import_react4.useState(false);
1494
- const elapsedTime = useElapsedTime(session.startTime, running, 1000, 0, session.endTime);
1495
- const handleClose = () => onDone("Remote session details dismissed", { display: "system" });
1496
- const goBackOrClose = onBack ?? handleClose;
1497
- const sessionUrl = getRemoteTaskSessionUrl(session.sessionId);
1498
- const statusLabel = completed ? "ready" : running ? "running" : session.status;
1499
- if (confirmingStop) {
1500
- return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Dialog, {
1501
- title: "Stop ultrareview?",
1502
- onCancel: () => setConfirmingStop(false),
1503
- color: "background",
1504
- children: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedBox_default, {
1505
- flexDirection: "column",
1506
- gap: 1,
1507
- children: [
1508
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1509
- dimColor: true,
1510
- children: "This archives the remote session and stops local tracking. The review will not complete and any findings so far are discarded."
1511
- }, undefined, false, undefined, this),
1512
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Select, {
1513
- options: [
1514
- { label: "Stop ultrareview", value: "stop" },
1515
- { label: "Back", value: "back" }
1516
- ],
1517
- onChange: (v) => {
1518
- if (v === "stop") {
1519
- onKill?.();
1520
- goBackOrClose();
1521
- } else {
1522
- setConfirmingStop(false);
1523
- }
1524
- }
1525
- }, undefined, false, undefined, this)
1526
- ]
1527
- }, undefined, true, undefined, this)
1528
- }, undefined, false, undefined, this);
1529
- }
1530
- const options = completed ? [
1531
- { label: "Open in Claude Code on the web", value: "open" },
1532
- { label: "Dismiss", value: "dismiss" }
1533
- ] : [
1534
- { label: "Open in Claude Code on the web", value: "open" },
1535
- ...onKill && running ? [{ label: "Stop ultrareview", value: "stop" }] : [],
1536
- { label: "Back", value: "back" }
1537
- ];
1538
- const handleSelect = (action) => {
1539
- switch (action) {
1540
- case "open":
1541
- openBrowser(sessionUrl);
1542
- onDone();
1543
- break;
1544
- case "stop":
1545
- setConfirmingStop(true);
1546
- break;
1547
- case "back":
1548
- goBackOrClose();
1549
- break;
1550
- case "dismiss":
1551
- handleClose();
1552
- break;
1553
- }
1554
- };
1555
- return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Dialog, {
1556
- title: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1557
- children: [
1558
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1559
- color: "background",
1560
- children: [
1561
- completed ? DIAMOND_FILLED : DIAMOND_OPEN,
1562
- " "
1563
- ]
1564
- }, undefined, true, undefined, this),
1565
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1566
- bold: true,
1567
- children: "ultrareview"
1568
- }, undefined, false, undefined, this),
1569
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1570
- dimColor: true,
1571
- children: [
1572
- " \xB7 ",
1573
- elapsedTime,
1574
- " \xB7 ",
1575
- statusLabel
1576
- ]
1577
- }, undefined, true, undefined, this)
1578
- ]
1579
- }, undefined, true, undefined, this),
1580
- onCancel: goBackOrClose,
1581
- color: "background",
1582
- inputGuide: (exitState) => exitState.pending ? /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1583
- children: [
1584
- "Press ",
1585
- exitState.keyName,
1586
- " again to exit"
1587
- ]
1588
- }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Byline, {
1589
- children: [
1590
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(KeyboardShortcutHint, {
1591
- shortcut: "Enter",
1592
- action: "select"
1593
- }, undefined, false, undefined, this),
1594
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(KeyboardShortcutHint, {
1595
- shortcut: "Esc",
1596
- action: "go back"
1597
- }, undefined, false, undefined, this)
1598
- ]
1599
- }, undefined, true, undefined, this),
1600
- children: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedBox_default, {
1601
- flexDirection: "column",
1602
- gap: 1,
1603
- children: [
1604
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(StagePipeline, {
1605
- stage: session.reviewProgress?.stage,
1606
- completed,
1607
- hasProgress: !!session.reviewProgress
1608
- }, undefined, false, undefined, this),
1609
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedBox_default, {
1610
- flexDirection: "column",
1611
- children: [
1612
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1613
- children: reviewCountsLine(session)
1614
- }, undefined, false, undefined, this),
1615
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Link, {
1616
- url: sessionUrl,
1617
- children: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1618
- dimColor: true,
1619
- children: sessionUrl
1620
- }, undefined, false, undefined, this)
1621
- }, undefined, false, undefined, this)
1622
- ]
1623
- }, undefined, true, undefined, this),
1624
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Select, {
1625
- options,
1626
- onChange: handleSelect
1627
- }, undefined, false, undefined, this)
1628
- ]
1629
- }, undefined, true, undefined, this)
1630
- }, undefined, false, undefined, this);
1631
- }
1632
- function RemoteSessionDetailDialog({
1633
- session,
1634
- toolUseContext,
1635
- onDone,
1636
- onBack,
1637
- onKill
1638
- }) {
1639
- const [isTeleporting, setIsTeleporting] = import_react4.useState(false);
1640
- const [teleportError, setTeleportError] = import_react4.useState(null);
1641
- const lastMessages = import_react4.useMemo(() => {
1642
- if (session.isUltraplan || session.isRemoteReview)
1643
- return [];
1644
- return normalizeMessages(toInternalMessages(session.log)).filter((_) => _.type !== "progress").slice(-3);
1645
- }, [session]);
1646
- if (session.isUltraplan) {
1647
- return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(UltraplanSessionDetail, {
1648
- session,
1649
- onDone,
1650
- onBack,
1651
- onKill
1652
- }, undefined, false, undefined, this);
1653
- }
1654
- if (session.isRemoteReview) {
1655
- return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ReviewSessionDetail, {
1656
- session,
1657
- onDone,
1658
- onBack,
1659
- onKill
1660
- }, undefined, false, undefined, this);
1661
- }
1662
- const handleClose = () => onDone("Remote session details dismissed", { display: "system" });
1663
- const handleKeyDown = (e) => {
1664
- if (e.key === " ") {
1665
- e.preventDefault();
1666
- onDone("Remote session details dismissed", { display: "system" });
1667
- } else if (e.key === "left" && onBack) {
1668
- e.preventDefault();
1669
- onBack();
1670
- } else if (e.key === "t" && !isTeleporting) {
1671
- e.preventDefault();
1672
- handleTeleport();
1673
- } else if (e.key === "return") {
1674
- e.preventDefault();
1675
- handleClose();
1676
- }
1677
- };
1678
- async function handleTeleport() {
1679
- setIsTeleporting(true);
1680
- setTeleportError(null);
1681
- try {
1682
- await teleportResumeCodeSession(session.sessionId);
1683
- } catch (err) {
1684
- setTeleportError(errorMessage(err));
1685
- } finally {
1686
- setIsTeleporting(false);
1687
- }
1688
- }
1689
- const displayTitle = truncateToWidth(session.title, 50);
1690
- const displayStatus = session.status === "pending" ? "starting" : session.status;
1691
- return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedBox_default, {
1692
- flexDirection: "column",
1693
- tabIndex: 0,
1694
- autoFocus: true,
1695
- onKeyDown: handleKeyDown,
1696
- children: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Dialog, {
1697
- title: "Remote session details",
1698
- onCancel: handleClose,
1699
- color: "background",
1700
- inputGuide: (exitState) => exitState.pending ? /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1701
- children: [
1702
- "Press ",
1703
- exitState.keyName,
1704
- " again to exit"
1705
- ]
1706
- }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Byline, {
1707
- children: [
1708
- onBack && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(KeyboardShortcutHint, {
1709
- shortcut: "\u2190",
1710
- action: "go back"
1711
- }, undefined, false, undefined, this),
1712
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(KeyboardShortcutHint, {
1713
- shortcut: "Esc/Enter/Space",
1714
- action: "close"
1715
- }, undefined, false, undefined, this),
1716
- !isTeleporting && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(KeyboardShortcutHint, {
1717
- shortcut: "t",
1718
- action: "teleport"
1719
- }, undefined, false, undefined, this)
1720
- ]
1721
- }, undefined, true, undefined, this),
1722
- children: [
1723
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedBox_default, {
1724
- flexDirection: "column",
1725
- children: [
1726
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1727
- children: [
1728
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1729
- bold: true,
1730
- children: "Status"
1731
- }, undefined, false, undefined, this),
1732
- ":",
1733
- " ",
1734
- displayStatus === "running" || displayStatus === "starting" ? /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1735
- color: "background",
1736
- children: displayStatus
1737
- }, undefined, false, undefined, this) : displayStatus === "completed" ? /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1738
- color: "success",
1739
- children: displayStatus
1740
- }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1741
- color: "error",
1742
- children: displayStatus
1743
- }, undefined, false, undefined, this)
1744
- ]
1745
- }, undefined, true, undefined, this),
1746
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1747
- children: [
1748
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1749
- bold: true,
1750
- children: "Runtime"
1751
- }, undefined, false, undefined, this),
1752
- ":",
1753
- " ",
1754
- formatDuration((session.endTime ?? Date.now()) - session.startTime)
1755
- ]
1756
- }, undefined, true, undefined, this),
1757
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1758
- wrap: "truncate-end",
1759
- children: [
1760
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1761
- bold: true,
1762
- children: "Title"
1763
- }, undefined, false, undefined, this),
1764
- ": ",
1765
- displayTitle
1766
- ]
1767
- }, undefined, true, undefined, this),
1768
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1769
- children: [
1770
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1771
- bold: true,
1772
- children: "Progress"
1773
- }, undefined, false, undefined, this),
1774
- ":",
1775
- " ",
1776
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(RemoteSessionProgress, {
1777
- session
1778
- }, undefined, false, undefined, this)
1779
- ]
1780
- }, undefined, true, undefined, this),
1781
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1782
- children: [
1783
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1784
- bold: true,
1785
- children: "Session URL"
1786
- }, undefined, false, undefined, this),
1787
- ":",
1788
- " ",
1789
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Link, {
1790
- url: getRemoteTaskSessionUrl(session.sessionId),
1791
- children: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1792
- dimColor: true,
1793
- children: getRemoteTaskSessionUrl(session.sessionId)
1794
- }, undefined, false, undefined, this)
1795
- }, undefined, false, undefined, this)
1796
- ]
1797
- }, undefined, true, undefined, this)
1798
- ]
1799
- }, undefined, true, undefined, this),
1800
- session.log.length > 0 && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedBox_default, {
1801
- flexDirection: "column",
1802
- marginTop: 1,
1803
- children: [
1804
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1805
- children: [
1806
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1807
- bold: true,
1808
- children: "Recent messages"
1809
- }, undefined, false, undefined, this),
1810
- ":"
1811
- ]
1812
- }, undefined, true, undefined, this),
1813
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedBox_default, {
1814
- flexDirection: "column",
1815
- height: 10,
1816
- overflowY: "hidden",
1817
- children: lastMessages.map((msg, i) => /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Message, {
1818
- message: msg,
1819
- lookups: EMPTY_LOOKUPS,
1820
- addMargin: i > 0,
1821
- tools: toolUseContext.options.tools,
1822
- commands: toolUseContext.options.commands,
1823
- verbose: toolUseContext.options.verbose,
1824
- inProgressToolUseIDs: new Set,
1825
- progressMessagesForMessage: [],
1826
- shouldAnimate: false,
1827
- shouldShowDot: false,
1828
- style: "condensed",
1829
- isTranscriptMode: false,
1830
- isStatic: true
1831
- }, i, false, undefined, this))
1832
- }, undefined, false, undefined, this),
1833
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedBox_default, {
1834
- marginTop: 1,
1835
- children: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1836
- dimColor: true,
1837
- italic: true,
1838
- children: [
1839
- "Showing last ",
1840
- lastMessages.length,
1841
- " of ",
1842
- session.log.length,
1843
- " ",
1844
- "messages"
1845
- ]
1846
- }, undefined, true, undefined, this)
1847
- }, undefined, false, undefined, this)
1848
- ]
1849
- }, undefined, true, undefined, this),
1850
- teleportError && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedBox_default, {
1851
- marginTop: 1,
1852
- children: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1853
- color: "error",
1854
- children: [
1855
- "Teleport failed: ",
1856
- teleportError
1857
- ]
1858
- }, undefined, true, undefined, this)
1859
- }, undefined, false, undefined, this),
1860
- isTeleporting && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1861
- color: "background",
1862
- children: "Teleporting to session\u2026"
1863
- }, undefined, false, undefined, this)
1864
- ]
1865
- }, undefined, true, undefined, this)
1866
- }, undefined, false, undefined, this);
1867
- }
1868
- var import_react4, jsx_dev_runtime8, PHASE_LABEL, AGENT_VERB, STAGES, STAGE_LABELS;
1869
- var init_RemoteSessionDetailDialog = __esm(() => {
1870
- init_figures();
1871
- init_figures2();
1872
- init_useElapsedTime();
1873
- init_src();
1874
- init_RemoteAgentTask();
1875
- init_constants();
1876
- init_prompt();
1877
- init_constants2();
1878
- init_browser();
1879
- init_errors();
1880
- init_format();
1881
- init_mappers();
1882
- init_messages();
1883
- init_stringUtils();
1884
- init_teleport();
1885
- init_select();
1886
- init_src();
1887
- init_Message();
1888
- init_RemoteSessionProgress();
1889
- import_react4 = __toESM(require_react(), 1);
1890
- jsx_dev_runtime8 = __toESM(require_jsx_dev_runtime(), 1);
1891
- PHASE_LABEL = {
1892
- needs_input: "input required",
1893
- plan_ready: "ready"
1894
- };
1895
- AGENT_VERB = {
1896
- needs_input: "waiting",
1897
- plan_ready: "done"
1898
- };
1899
- STAGES = ["finding", "verifying", "synthesizing"];
1900
- STAGE_LABELS = {
1901
- finding: "Find",
1902
- verifying: "Verify",
1903
- synthesizing: "Dedupe"
1904
- };
1905
- });
1906
-
1907
- // src/components/tasks/ShellDetailDialog.tsx
1908
- async function getTaskOutput(shell) {
1909
- const path = getTaskOutputPath(shell.id);
1910
- try {
1911
- const result = await tailFile(path, SHELL_DETAIL_TAIL_BYTES);
1912
- return { content: result.content, bytesTotal: result.bytesTotal };
1913
- } catch {
1914
- return { content: "", bytesTotal: 0 };
1915
- }
1916
- }
1917
- function ShellDetailDialog({
1918
- shell,
1919
- onDone,
1920
- onKillShell,
1921
- onBack
1922
- }) {
1923
- const { columns } = useTerminalSize();
1924
- const [outputPromise, setOutputPromise] = import_react5.useState(() => getTaskOutput(shell));
1925
- const deferredOutputPromise = import_react5.useDeferredValue(outputPromise);
1926
- import_react5.useEffect(() => {
1927
- if (shell.status !== "running") {
1928
- return;
1929
- }
1930
- const timer = setInterval((setOutputPromise2, shell2) => setOutputPromise2(getTaskOutput(shell2)), 1000, setOutputPromise, shell);
1931
- return () => clearInterval(timer);
1932
- }, [shell.id, shell.status]);
1933
- const handleClose = () => onDone("Shell details dismissed", { display: "system" });
1934
- useKeybindings({
1935
- "confirm:yes": handleClose
1936
- }, { context: "Confirmation" });
1937
- const handleKeyDown = (e) => {
1938
- if (e.key === " ") {
1939
- e.preventDefault();
1940
- onDone("Shell details dismissed", { display: "system" });
1941
- } else if (e.key === "left" && onBack) {
1942
- e.preventDefault();
1943
- onBack();
1944
- } else if (e.key === "x" && shell.status === "running" && onKillShell) {
1945
- e.preventDefault();
1946
- onKillShell();
1947
- }
1948
- };
1949
- const isMonitor = shell.kind === "monitor";
1950
- const displayCommand = truncateToWidth(shell.command, 280);
1951
- return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedBox_default, {
1952
- flexDirection: "column",
1953
- tabIndex: 0,
1954
- autoFocus: true,
1955
- onKeyDown: handleKeyDown,
1956
- children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Dialog, {
1957
- title: isMonitor ? "Monitor details" : "Shell details",
1958
- onCancel: handleClose,
1959
- color: "background",
1960
- inputGuide: (exitState) => exitState.pending ? /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedText, {
1961
- children: [
1962
- "Press ",
1963
- exitState.keyName,
1964
- " again to exit"
1965
- ]
1966
- }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Byline, {
1967
- children: [
1968
- onBack && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(KeyboardShortcutHint, {
1969
- shortcut: "\u2190",
1970
- action: "go back"
1971
- }, undefined, false, undefined, this),
1972
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(KeyboardShortcutHint, {
1973
- shortcut: "Esc/Enter/Space",
1974
- action: "close"
1975
- }, undefined, false, undefined, this),
1976
- shell.status === "running" && onKillShell && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(KeyboardShortcutHint, {
1977
- shortcut: "x",
1978
- action: "stop"
1979
- }, undefined, false, undefined, this)
1980
- ]
1981
- }, undefined, true, undefined, this),
1982
- children: [
1983
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedBox_default, {
1984
- flexDirection: "column",
1985
- children: [
1986
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedText, {
1987
- children: [
1988
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedText, {
1989
- bold: true,
1990
- children: "Status:"
1991
- }, undefined, false, undefined, this),
1992
- " ",
1993
- shell.status === "running" ? /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedText, {
1994
- color: "background",
1995
- children: [
1996
- shell.status,
1997
- shell.result?.code !== undefined && ` (exit code: ${shell.result.code})`
1998
- ]
1999
- }, undefined, true, undefined, this) : shell.status === "completed" ? /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedText, {
2000
- color: "success",
2001
- children: [
2002
- shell.status,
2003
- shell.result?.code !== undefined && ` (exit code: ${shell.result.code})`
2004
- ]
2005
- }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedText, {
2006
- color: "error",
2007
- children: [
2008
- shell.status,
2009
- shell.result?.code !== undefined && ` (exit code: ${shell.result.code})`
2010
- ]
2011
- }, undefined, true, undefined, this)
2012
- ]
2013
- }, undefined, true, undefined, this),
2014
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedText, {
2015
- children: [
2016
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedText, {
2017
- bold: true,
2018
- children: "Runtime:"
2019
- }, undefined, false, undefined, this),
2020
- " ",
2021
- formatDuration((shell.endTime ?? Date.now()) - shell.startTime)
2022
- ]
2023
- }, undefined, true, undefined, this),
2024
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedText, {
2025
- wrap: "wrap",
2026
- children: [
2027
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedText, {
2028
- bold: true,
2029
- children: isMonitor ? "Script:" : "Command:"
2030
- }, undefined, false, undefined, this),
2031
- " ",
2032
- displayCommand
2033
- ]
2034
- }, undefined, true, undefined, this)
2035
- ]
2036
- }, undefined, true, undefined, this),
2037
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedBox_default, {
2038
- flexDirection: "column",
2039
- children: [
2040
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedText, {
2041
- bold: true,
2042
- children: "Output:"
2043
- }, undefined, false, undefined, this),
2044
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(import_react5.Suspense, {
2045
- fallback: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedText, {
2046
- dimColor: true,
2047
- children: "Loading output\u2026"
2048
- }, undefined, false, undefined, this),
2049
- children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ShellOutputContent, {
2050
- outputPromise: deferredOutputPromise,
2051
- columns
2052
- }, undefined, false, undefined, this)
2053
- }, undefined, false, undefined, this)
2054
- ]
2055
- }, undefined, true, undefined, this)
2056
- ]
2057
- }, undefined, true, undefined, this)
2058
- }, undefined, false, undefined, this);
2059
- }
2060
- function ShellOutputContent({
2061
- outputPromise,
2062
- columns
2063
- }) {
2064
- const { content, bytesTotal } = import_react5.use(outputPromise);
2065
- if (!content) {
2066
- return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedText, {
2067
- dimColor: true,
2068
- children: "No output available"
2069
- }, undefined, false, undefined, this);
2070
- }
2071
- const starts = [];
2072
- let pos = content.length;
2073
- for (let i = 0;i < 10 && pos > 0; i++) {
2074
- const prev = content.lastIndexOf(`
2075
- `, pos - 1);
2076
- starts.push(prev + 1);
2077
- pos = prev;
2078
- }
2079
- starts.reverse();
2080
- const isIncomplete = bytesTotal > content.length;
2081
- const rendered = [];
2082
- for (let i = 0;i < starts.length; i++) {
2083
- const start = starts[i];
2084
- const end = i < starts.length - 1 ? starts[i + 1] - 1 : content.length;
2085
- const line = content.slice(start, end);
2086
- if (line)
2087
- rendered.push(line);
2088
- }
2089
- return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(jsx_dev_runtime9.Fragment, {
2090
- children: [
2091
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedBox_default, {
2092
- borderStyle: "round",
2093
- paddingX: 1,
2094
- flexDirection: "column",
2095
- height: 12,
2096
- maxWidth: columns - 6,
2097
- children: rendered.map((line, i) => /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedText, {
2098
- wrap: "truncate-end",
2099
- children: line
2100
- }, i, false, undefined, this))
2101
- }, undefined, false, undefined, this),
2102
- /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedText, {
2103
- dimColor: true,
2104
- italic: true,
2105
- children: [
2106
- `Showing ${rendered.length} lines`,
2107
- isIncomplete ? ` of ${formatFileSize(bytesTotal)}` : ""
2108
- ]
2109
- }, undefined, true, undefined, this)
2110
- ]
2111
- }, undefined, true, undefined, this);
2112
- }
2113
- var import_react5, jsx_dev_runtime9, SHELL_DETAIL_TAIL_BYTES = 8192;
2114
- var init_ShellDetailDialog = __esm(() => {
2115
- init_useTerminalSize();
2116
- init_src();
2117
- init_useKeybinding();
2118
- init_format();
2119
- init_fsOperations();
2120
- init_diskOutput();
2121
- init_src();
2122
- import_react5 = __toESM(require_react(), 1);
2123
- jsx_dev_runtime9 = __toESM(require_jsx_dev_runtime(), 1);
2124
- });
2125
-
2126
- // src/components/tasks/BackgroundTasksDialog.tsx
2127
- function getSelectableBackgroundTasks(tasks, foregroundedTaskId) {
2128
- const backgroundTasks = Object.values(tasks ?? {}).filter(isBackgroundTask);
2129
- return backgroundTasks.filter((task) => !(task.type === "local_agent" && task.id === foregroundedTaskId));
2130
- }
2131
- function BackgroundTasksDialog({
2132
- onDone,
2133
- toolUseContext,
2134
- initialDetailTaskId
2135
- }) {
2136
- const tasks = useAppState((s) => s.tasks);
2137
- const foregroundedTaskId = useAppState((s) => s.foregroundedTaskId);
2138
- const showSpinnerTree = useAppState((s) => s.expandedView) === "teammates";
2139
- const setAppState = useSetAppState();
2140
- const killAgentsShortcut = useShortcutDisplay("chat:killAgents", "Chat", "ctrl+x ctrl+k");
2141
- const typedTasks = tasks;
2142
- const skippedListOnMount = import_react6.useRef(false);
2143
- const [viewState, setViewState] = import_react6.useState(() => {
2144
- if (initialDetailTaskId) {
2145
- skippedListOnMount.current = true;
2146
- return { mode: "detail", itemId: initialDetailTaskId };
2147
- }
2148
- const allItems = getSelectableBackgroundTasks(typedTasks, foregroundedTaskId);
2149
- if (allItems.length === 1) {
2150
- skippedListOnMount.current = true;
2151
- return { mode: "detail", itemId: allItems[0].id };
2152
- }
2153
- return { mode: "list" };
2154
- });
2155
- const [selectedIndex, setSelectedIndex] = import_react6.useState(0);
2156
- useRegisterOverlay("background-tasks-dialog");
2157
- const {
2158
- bashTasks,
2159
- remoteSessions,
2160
- agentTasks,
2161
- teammateTasks,
2162
- workflowTasks,
2163
- mcpMonitors,
2164
- dreamTasks,
2165
- allSelectableItems
2166
- } = import_react6.useMemo(() => {
2167
- const backgroundTasks = Object.values(typedTasks ?? {}).filter(isBackgroundTask);
2168
- const allItems = backgroundTasks.map(toListItem);
2169
- const sorted = allItems.sort((a, b) => {
2170
- const aStatus = a.status;
2171
- const bStatus = b.status;
2172
- if (aStatus === "running" && bStatus !== "running")
2173
- return -1;
2174
- if (aStatus !== "running" && bStatus === "running")
2175
- return 1;
2176
- const aTime = "task" in a ? a.task.startTime : 0;
2177
- const bTime = "task" in b ? b.task.startTime : 0;
2178
- return bTime - aTime;
2179
- });
2180
- const bash = sorted.filter((item) => item.type === "local_bash");
2181
- const remote = sorted.filter((item) => item.type === "remote_agent");
2182
- const agent = sorted.filter((item) => item.type === "local_agent" && item.id !== foregroundedTaskId);
2183
- const workflows = sorted.filter((item) => item.type === "local_workflow");
2184
- const monitorMcp = sorted.filter((item) => item.type === "monitor_mcp");
2185
- const dreamTasks2 = sorted.filter((item) => item.type === "dream");
2186
- const teammates = showSpinnerTree ? [] : sorted.filter((item) => item.type === "in_process_teammate");
2187
- const leaderItem = teammates.length > 0 ? [
2188
- {
2189
- id: "__leader__",
2190
- type: "leader",
2191
- label: `@${TEAM_LEAD_NAME}`,
2192
- status: "running"
2193
- }
2194
- ] : [];
2195
- return {
2196
- bashTasks: bash,
2197
- remoteSessions: remote,
2198
- agentTasks: agent,
2199
- workflowTasks: workflows,
2200
- mcpMonitors: monitorMcp,
2201
- dreamTasks: dreamTasks2,
2202
- teammateTasks: [...leaderItem, ...teammates],
2203
- allSelectableItems: [
2204
- ...leaderItem,
2205
- ...teammates,
2206
- ...bash,
2207
- ...monitorMcp,
2208
- ...remote,
2209
- ...agent,
2210
- ...workflows,
2211
- ...dreamTasks2
2212
- ]
2213
- };
2214
- }, [typedTasks, foregroundedTaskId, showSpinnerTree]);
2215
- const currentSelection = allSelectableItems[selectedIndex] ?? null;
2216
- useKeybindings({
2217
- "confirm:previous": () => setSelectedIndex((prev) => Math.max(0, prev - 1)),
2218
- "confirm:next": () => setSelectedIndex((prev) => Math.min(allSelectableItems.length - 1, prev + 1)),
2219
- "confirm:yes": () => {
2220
- const current = allSelectableItems[selectedIndex];
2221
- if (current) {
2222
- if (current.type === "leader") {
2223
- exitTeammateView(setAppState);
2224
- onDone("Viewing leader", { display: "system" });
2225
- } else {
2226
- setViewState({ mode: "detail", itemId: current.id });
2227
- }
2228
- }
2229
- }
2230
- }, { context: "Confirmation", isActive: viewState.mode === "list" });
2231
- const handleKeyDown = (e) => {
2232
- if (viewState.mode !== "list")
2233
- return;
2234
- if (e.key === "left") {
2235
- e.preventDefault();
2236
- onDone("Background tasks dialog dismissed", { display: "system" });
2237
- return;
2238
- }
2239
- const currentSelection2 = allSelectableItems[selectedIndex];
2240
- if (!currentSelection2)
2241
- return;
2242
- if (e.key === "x") {
2243
- e.preventDefault();
2244
- if (currentSelection2.type === "local_bash" && currentSelection2.status === "running") {
2245
- killShellTask(currentSelection2.id);
2246
- } else if (currentSelection2.type === "local_agent" && currentSelection2.status === "running") {
2247
- killAgentTask(currentSelection2.id);
2248
- } else if (currentSelection2.type === "in_process_teammate" && currentSelection2.status === "running") {
2249
- killTeammateTask(currentSelection2.id);
2250
- } else if (currentSelection2.type === "local_workflow" && currentSelection2.status === "running" && killWorkflowTask) {
2251
- killWorkflowTask(currentSelection2.id, setAppState);
2252
- } else if (currentSelection2.type === "monitor_mcp" && currentSelection2.status === "running" && killMonitorMcp) {
2253
- killMonitorMcp(currentSelection2.id, setAppState);
2254
- } else if (currentSelection2.type === "dream" && currentSelection2.status === "running") {
2255
- killDreamTask(currentSelection2.id);
2256
- } else if (currentSelection2.type === "remote_agent" && currentSelection2.status === "running") {
2257
- if (currentSelection2.task.isUltraplan) {
2258
- stopUltraplan(currentSelection2.id, currentSelection2.task.sessionId, setAppState);
2259
- } else {
2260
- killRemoteAgentTask(currentSelection2.id);
2261
- }
2262
- }
2263
- }
2264
- if (e.key === "f") {
2265
- if (currentSelection2.type === "in_process_teammate" && currentSelection2.status === "running") {
2266
- e.preventDefault();
2267
- enterTeammateView(currentSelection2.id, setAppState);
2268
- onDone("Viewing teammate", { display: "system" });
2269
- } else if (currentSelection2.type === "leader") {
2270
- e.preventDefault();
2271
- exitTeammateView(setAppState);
2272
- onDone("Viewing leader", { display: "system" });
2273
- }
2274
- }
2275
- };
2276
- async function killShellTask(taskId) {
2277
- await LocalShellTask.kill(taskId, setAppState);
2278
- }
2279
- async function killAgentTask(taskId) {
2280
- await LocalAgentTask.kill(taskId, setAppState);
2281
- }
2282
- async function killTeammateTask(taskId) {
2283
- await InProcessTeammateTask.kill(taskId, setAppState);
2284
- }
2285
- async function killDreamTask(taskId) {
2286
- await DreamTask.kill(taskId, setAppState);
2287
- }
2288
- async function killRemoteAgentTask(taskId) {
2289
- await RemoteAgentTask.kill(taskId, setAppState);
2290
- }
2291
- const onDoneEvent = import_react6.useEffectEvent(onDone);
2292
- import_react6.useEffect(() => {
2293
- if (viewState.mode !== "list") {
2294
- const task = (typedTasks ?? {})[viewState.itemId];
2295
- if (!task || task.type !== "local_workflow" && !isBackgroundTask(task)) {
2296
- if (skippedListOnMount.current) {
2297
- onDoneEvent("Background tasks dialog dismissed", {
2298
- display: "system"
2299
- });
2300
- } else {
2301
- setViewState({ mode: "list" });
2302
- }
2303
- }
2304
- }
2305
- const totalItems = allSelectableItems.length;
2306
- if (selectedIndex >= totalItems && totalItems > 0) {
2307
- setSelectedIndex(totalItems - 1);
2308
- }
2309
- }, [viewState, typedTasks, selectedIndex, allSelectableItems, onDoneEvent]);
2310
- const goBackToList = () => {
2311
- if (skippedListOnMount.current && allSelectableItems.length <= 1) {
2312
- onDone("Background tasks dialog dismissed", { display: "system" });
2313
- } else {
2314
- skippedListOnMount.current = false;
2315
- setViewState({ mode: "list" });
2316
- }
2317
- };
2318
- if (viewState.mode !== "list" && typedTasks) {
2319
- const task = typedTasks[viewState.itemId];
2320
- if (!task) {
2321
- return null;
2322
- }
2323
- switch (task.type) {
2324
- case "local_bash":
2325
- return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ShellDetailDialog, {
2326
- shell: task,
2327
- onDone,
2328
- onKillShell: () => void killShellTask(task.id),
2329
- onBack: goBackToList
2330
- }, `shell-${task.id}`, false, undefined, this);
2331
- case "local_agent":
2332
- return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(AsyncAgentDetailDialog, {
2333
- agent: task,
2334
- onDone,
2335
- onKillAgent: () => void killAgentTask(task.id),
2336
- onBack: goBackToList
2337
- }, `agent-${task.id}`, false, undefined, this);
2338
- case "remote_agent":
2339
- return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(RemoteSessionDetailDialog, {
2340
- session: task,
2341
- onDone,
2342
- toolUseContext,
2343
- onBack: goBackToList,
2344
- onKill: task.status !== "running" ? undefined : task.isUltraplan ? () => void stopUltraplan(task.id, task.sessionId, setAppState) : () => void killRemoteAgentTask(task.id)
2345
- }, `session-${task.id}`, false, undefined, this);
2346
- case "in_process_teammate":
2347
- return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(InProcessTeammateDetailDialog, {
2348
- teammate: task,
2349
- onDone,
2350
- onKill: task.status === "running" ? () => void killTeammateTask(task.id) : undefined,
2351
- onBack: goBackToList,
2352
- onForeground: task.status === "running" ? () => {
2353
- enterTeammateView(task.id, setAppState);
2354
- onDone("Viewing teammate", { display: "system" });
2355
- } : undefined
2356
- }, `teammate-${task.id}`, false, undefined, this);
2357
- case "local_workflow":
2358
- if (!WorkflowDetailDialog)
2359
- return null;
2360
- return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(WorkflowDetailDialog, {
2361
- workflow: task,
2362
- onDone,
2363
- onKill: task.status === "running" && killWorkflowTask ? () => killWorkflowTask(task.id, setAppState) : undefined,
2364
- onSkipAgent: task.status === "running" && skipWorkflowAgent ? (agentId) => skipWorkflowAgent(task.id, agentId, setAppState) : undefined,
2365
- onRetryAgent: task.status === "running" && retryWorkflowAgent ? (agentId) => retryWorkflowAgent(task.id, agentId, setAppState) : undefined,
2366
- onBack: goBackToList
2367
- }, `workflow-${task.id}`, false, undefined, this);
2368
- case "monitor_mcp":
2369
- if (!MonitorMcpDetailDialog)
2370
- return null;
2371
- return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(MonitorMcpDetailDialog, {
2372
- task,
2373
- onKill: task.status === "running" && killMonitorMcp ? () => killMonitorMcp(task.id, setAppState) : undefined,
2374
- onBack: goBackToList
2375
- }, `monitor-mcp-${task.id}`, false, undefined, this);
2376
- case "dream":
2377
- return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(DreamDetailDialog, {
2378
- task,
2379
- onDone: () => onDone("Background tasks dialog dismissed", {
2380
- display: "system"
2381
- }),
2382
- onBack: goBackToList,
2383
- onKill: task.status === "running" ? () => void killDreamTask(task.id) : undefined
2384
- }, `dream-${task.id}`, false, undefined, this);
2385
- }
2386
- }
2387
- const runningBashCount = count(bashTasks, (_) => _.status === "running");
2388
- const runningAgentCount = count(remoteSessions, (_) => _.status === "running" || _.status === "pending") + count(agentTasks, (_) => _.status === "running");
2389
- const runningTeammateCount = count(teammateTasks, (_) => _.status === "running");
2390
- const subtitle = intersperse([
2391
- ...runningTeammateCount > 0 ? [
2392
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
2393
- children: [
2394
- runningTeammateCount,
2395
- " ",
2396
- runningTeammateCount !== 1 ? "agents" : "agent"
2397
- ]
2398
- }, "teammates", true, undefined, this)
2399
- ] : [],
2400
- ...runningBashCount > 0 ? [
2401
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
2402
- children: [
2403
- runningBashCount,
2404
- " ",
2405
- runningBashCount !== 1 ? "active shells" : "active shell"
2406
- ]
2407
- }, "shells", true, undefined, this)
2408
- ] : [],
2409
- ...runningAgentCount > 0 ? [
2410
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
2411
- children: [
2412
- runningAgentCount,
2413
- " ",
2414
- runningAgentCount !== 1 ? "active agents" : "active agent"
2415
- ]
2416
- }, "agents", true, undefined, this)
2417
- ] : []
2418
- ], (index) => /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
2419
- children: " \xB7 "
2420
- }, `separator-${index}`, false, undefined, this));
2421
- const actions = [
2422
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(KeyboardShortcutHint, {
2423
- shortcut: "\u2191/\u2193",
2424
- action: "select"
2425
- }, "upDown", false, undefined, this),
2426
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(KeyboardShortcutHint, {
2427
- shortcut: "Enter",
2428
- action: "view"
2429
- }, "enter", false, undefined, this),
2430
- ...currentSelection?.type === "in_process_teammate" && currentSelection.status === "running" ? [
2431
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(KeyboardShortcutHint, {
2432
- shortcut: "f",
2433
- action: "foreground"
2434
- }, "foreground", false, undefined, this)
2435
- ] : [],
2436
- ...(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, {
2437
- shortcut: "x",
2438
- action: "stop"
2439
- }, "kill", false, undefined, this)] : [],
2440
- ...agentTasks.some((t) => t.status === "running") ? [
2441
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(KeyboardShortcutHint, {
2442
- shortcut: killAgentsShortcut,
2443
- action: "stop all agents"
2444
- }, "kill-all", false, undefined, this)
2445
- ] : [],
2446
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(KeyboardShortcutHint, {
2447
- shortcut: "\u2190/Esc",
2448
- action: "close"
2449
- }, "esc", false, undefined, this)
2450
- ];
2451
- const handleCancel = () => onDone("Background tasks dialog dismissed", { display: "system" });
2452
- function renderInputGuide(exitState) {
2453
- if (exitState.pending) {
2454
- return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
2455
- children: [
2456
- "Press ",
2457
- exitState.keyName,
2458
- " again to exit"
2459
- ]
2460
- }, undefined, true, undefined, this);
2461
- }
2462
- return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Byline, {
2463
- children: actions
2464
- }, undefined, false, undefined, this);
2465
- }
2466
- return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedBox_default, {
2467
- flexDirection: "column",
2468
- tabIndex: 0,
2469
- autoFocus: true,
2470
- onKeyDown: handleKeyDown,
2471
- children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Dialog, {
2472
- title: "Background tasks",
2473
- subtitle: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(jsx_dev_runtime10.Fragment, {
2474
- children: subtitle
2475
- }, undefined, false, undefined, this),
2476
- onCancel: handleCancel,
2477
- color: "background",
2478
- inputGuide: renderInputGuide,
2479
- children: allSelectableItems.length === 0 ? /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
2480
- dimColor: true,
2481
- children: "No tasks currently running"
2482
- }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedBox_default, {
2483
- flexDirection: "column",
2484
- children: [
2485
- teammateTasks.length > 0 && /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedBox_default, {
2486
- flexDirection: "column",
2487
- children: [
2488
- (bashTasks.length > 0 || remoteSessions.length > 0 || agentTasks.length > 0) && /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
2489
- dimColor: true,
2490
- children: [
2491
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
2492
- bold: true,
2493
- children: [
2494
- " ",
2495
- "Agents"
2496
- ]
2497
- }, undefined, true, undefined, this),
2498
- " (",
2499
- count(teammateTasks, (i) => i.type !== "leader"),
2500
- ")"
2501
- ]
2502
- }, undefined, true, undefined, this),
2503
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedBox_default, {
2504
- flexDirection: "column",
2505
- children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(TeammateTaskGroups, {
2506
- teammateTasks,
2507
- currentSelectionId: currentSelection?.id
2508
- }, undefined, false, undefined, this)
2509
- }, undefined, false, undefined, this)
2510
- ]
2511
- }, undefined, true, undefined, this),
2512
- bashTasks.length > 0 && /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedBox_default, {
2513
- flexDirection: "column",
2514
- marginTop: teammateTasks.length > 0 ? 1 : 0,
2515
- children: [
2516
- (teammateTasks.length > 0 || remoteSessions.length > 0 || agentTasks.length > 0) && /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
2517
- dimColor: true,
2518
- children: [
2519
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
2520
- bold: true,
2521
- children: [
2522
- " ",
2523
- "Shells"
2524
- ]
2525
- }, undefined, true, undefined, this),
2526
- " (",
2527
- bashTasks.length,
2528
- ")"
2529
- ]
2530
- }, undefined, true, undefined, this),
2531
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedBox_default, {
2532
- flexDirection: "column",
2533
- children: bashTasks.map((item) => /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Item, {
2534
- item,
2535
- isSelected: item.id === currentSelection?.id
2536
- }, item.id, false, undefined, this))
2537
- }, undefined, false, undefined, this)
2538
- ]
2539
- }, undefined, true, undefined, this),
2540
- mcpMonitors.length > 0 && /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedBox_default, {
2541
- flexDirection: "column",
2542
- marginTop: teammateTasks.length > 0 || bashTasks.length > 0 ? 1 : 0,
2543
- children: [
2544
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
2545
- dimColor: true,
2546
- children: [
2547
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
2548
- bold: true,
2549
- children: [
2550
- " ",
2551
- "Monitors"
2552
- ]
2553
- }, undefined, true, undefined, this),
2554
- " (",
2555
- mcpMonitors.length,
2556
- ")"
2557
- ]
2558
- }, undefined, true, undefined, this),
2559
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedBox_default, {
2560
- flexDirection: "column",
2561
- children: mcpMonitors.map((item) => /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Item, {
2562
- item,
2563
- isSelected: item.id === currentSelection?.id
2564
- }, item.id, false, undefined, this))
2565
- }, undefined, false, undefined, this)
2566
- ]
2567
- }, undefined, true, undefined, this),
2568
- remoteSessions.length > 0 && /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedBox_default, {
2569
- flexDirection: "column",
2570
- marginTop: teammateTasks.length > 0 || bashTasks.length > 0 || mcpMonitors.length > 0 ? 1 : 0,
2571
- children: [
2572
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
2573
- dimColor: true,
2574
- children: [
2575
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
2576
- bold: true,
2577
- children: [
2578
- " ",
2579
- "Remote agents"
2580
- ]
2581
- }, undefined, true, undefined, this),
2582
- " (",
2583
- remoteSessions.length,
2584
- ")"
2585
- ]
2586
- }, undefined, true, undefined, this),
2587
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedBox_default, {
2588
- flexDirection: "column",
2589
- children: remoteSessions.map((item) => /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Item, {
2590
- item,
2591
- isSelected: item.id === currentSelection?.id
2592
- }, item.id, false, undefined, this))
2593
- }, undefined, false, undefined, this)
2594
- ]
2595
- }, undefined, true, undefined, this),
2596
- agentTasks.length > 0 && /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedBox_default, {
2597
- flexDirection: "column",
2598
- marginTop: teammateTasks.length > 0 || bashTasks.length > 0 || mcpMonitors.length > 0 || remoteSessions.length > 0 ? 1 : 0,
2599
- children: [
2600
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
2601
- dimColor: true,
2602
- children: [
2603
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
2604
- bold: true,
2605
- children: [
2606
- " ",
2607
- "Local agents"
2608
- ]
2609
- }, undefined, true, undefined, this),
2610
- " (",
2611
- agentTasks.length,
2612
- ")"
2613
- ]
2614
- }, undefined, true, undefined, this),
2615
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedBox_default, {
2616
- flexDirection: "column",
2617
- children: agentTasks.map((item) => /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Item, {
2618
- item,
2619
- isSelected: item.id === currentSelection?.id
2620
- }, item.id, false, undefined, this))
2621
- }, undefined, false, undefined, this)
2622
- ]
2623
- }, undefined, true, undefined, this),
2624
- workflowTasks.length > 0 && /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedBox_default, {
2625
- flexDirection: "column",
2626
- marginTop: teammateTasks.length > 0 || bashTasks.length > 0 || mcpMonitors.length > 0 || remoteSessions.length > 0 || agentTasks.length > 0 ? 1 : 0,
2627
- children: [
2628
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
2629
- dimColor: true,
2630
- children: [
2631
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
2632
- bold: true,
2633
- children: [
2634
- " ",
2635
- "Workflows"
2636
- ]
2637
- }, undefined, true, undefined, this),
2638
- " (",
2639
- workflowTasks.length,
2640
- ")"
2641
- ]
2642
- }, undefined, true, undefined, this),
2643
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedBox_default, {
2644
- flexDirection: "column",
2645
- children: workflowTasks.map((item) => /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Item, {
2646
- item,
2647
- isSelected: item.id === currentSelection?.id
2648
- }, item.id, false, undefined, this))
2649
- }, undefined, false, undefined, this)
2650
- ]
2651
- }, undefined, true, undefined, this),
2652
- dreamTasks.length > 0 && /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedBox_default, {
2653
- flexDirection: "column",
2654
- marginTop: teammateTasks.length > 0 || bashTasks.length > 0 || mcpMonitors.length > 0 || remoteSessions.length > 0 || agentTasks.length > 0 || workflowTasks.length > 0 ? 1 : 0,
2655
- children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedBox_default, {
2656
- flexDirection: "column",
2657
- children: dreamTasks.map((item) => /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Item, {
2658
- item,
2659
- isSelected: item.id === currentSelection?.id
2660
- }, item.id, false, undefined, this))
2661
- }, undefined, false, undefined, this)
2662
- }, undefined, false, undefined, this)
2663
- ]
2664
- }, undefined, true, undefined, this)
2665
- }, undefined, false, undefined, this)
2666
- }, undefined, false, undefined, this);
2667
- }
2668
- function toListItem(task) {
2669
- switch (task.type) {
2670
- case "local_bash":
2671
- return {
2672
- id: task.id,
2673
- type: "local_bash",
2674
- label: task.kind === "monitor" ? task.description : task.command,
2675
- status: task.status,
2676
- task
2677
- };
2678
- case "remote_agent":
2679
- return {
2680
- id: task.id,
2681
- type: "remote_agent",
2682
- label: task.title,
2683
- status: task.status,
2684
- task
2685
- };
2686
- case "local_agent":
2687
- return {
2688
- id: task.id,
2689
- type: "local_agent",
2690
- label: task.description,
2691
- status: task.status,
2692
- task
2693
- };
2694
- case "in_process_teammate":
2695
- return {
2696
- id: task.id,
2697
- type: "in_process_teammate",
2698
- label: `@${task.identity.agentName}`,
2699
- status: task.status,
2700
- task
2701
- };
2702
- case "local_workflow":
2703
- return {
2704
- id: task.id,
2705
- type: "local_workflow",
2706
- label: task.summary ?? task.description,
2707
- status: task.status,
2708
- task
2709
- };
2710
- case "monitor_mcp":
2711
- return {
2712
- id: task.id,
2713
- type: "monitor_mcp",
2714
- label: task.description,
2715
- status: task.status,
2716
- task
2717
- };
2718
- case "dream":
2719
- return {
2720
- id: task.id,
2721
- type: "dream",
2722
- label: task.description,
2723
- status: task.status,
2724
- task
2725
- };
2726
- }
2727
- }
2728
- function Item({
2729
- item,
2730
- isSelected
2731
- }) {
2732
- const { columns } = useTerminalSize();
2733
- const maxActivityWidth = Math.max(30, columns - 26);
2734
- const useGreyPointer = isCoordinatorMode();
2735
- return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedBox_default, {
2736
- flexDirection: "row",
2737
- children: [
2738
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
2739
- dimColor: useGreyPointer && isSelected,
2740
- children: isSelected ? figures_default.pointer + " " : " "
2741
- }, undefined, false, undefined, this),
2742
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
2743
- color: isSelected && !useGreyPointer ? "suggestion" : undefined,
2744
- children: item.type === "leader" ? /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
2745
- children: [
2746
- "@",
2747
- TEAM_LEAD_NAME
2748
- ]
2749
- }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(BackgroundTask, {
2750
- task: item.task,
2751
- maxActivityWidth
2752
- }, undefined, false, undefined, this)
2753
- }, undefined, false, undefined, this)
2754
- ]
2755
- }, undefined, true, undefined, this);
2756
- }
2757
- function TeammateTaskGroups({
2758
- teammateTasks,
2759
- currentSelectionId
2760
- }) {
2761
- const leaderItems = teammateTasks.filter((i) => i.type === "leader");
2762
- const teammateItems = teammateTasks.filter((i) => i.type === "in_process_teammate");
2763
- const teams = new Map;
2764
- for (const item of teammateItems) {
2765
- const teamName = item.task.identity.teamName;
2766
- const group = teams.get(teamName);
2767
- if (group) {
2768
- group.push(item);
2769
- } else {
2770
- teams.set(teamName, [item]);
2771
- }
2772
- }
2773
- const teamEntries = [...teams.entries()];
2774
- return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(jsx_dev_runtime10.Fragment, {
2775
- children: teamEntries.map(([teamName, items]) => {
2776
- const memberCount = items.length + leaderItems.length;
2777
- return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedBox_default, {
2778
- flexDirection: "column",
2779
- children: [
2780
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
2781
- dimColor: true,
2782
- children: [
2783
- " ",
2784
- "Team: ",
2785
- teamName,
2786
- " (",
2787
- memberCount,
2788
- ")"
2789
- ]
2790
- }, undefined, true, undefined, this),
2791
- leaderItems.map((item) => /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Item, {
2792
- item,
2793
- isSelected: item.id === currentSelectionId
2794
- }, `${item.id}-${teamName}`, false, undefined, this)),
2795
- items.map((item) => /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Item, {
2796
- item,
2797
- isSelected: item.id === currentSelectionId
2798
- }, item.id, false, undefined, this))
2799
- ]
2800
- }, teamName, true, undefined, this);
2801
- })
2802
- }, undefined, false, undefined, this);
2803
- }
2804
- var import_react6, jsx_dev_runtime10, WorkflowDetailDialog = null, workflowTaskModule = null, killWorkflowTask, skipWorkflowAgent, retryWorkflowAgent, monitorMcpModule = null, killMonitorMcp, MonitorMcpDetailDialog = null;
2805
- var init_BackgroundTasksDialog = __esm(() => {
2806
- init_figures();
2807
- init_coordinatorMode();
2808
- init_useTerminalSize();
2809
- init_AppState();
2810
- init_teammateViewHelpers();
2811
- init_DreamTask();
2812
- init_InProcessTeammateTask();
2813
- init_LocalAgentTask();
2814
- init_LocalShellTask();
2815
- init_RemoteAgentTask();
2816
- init_types();
2817
- init_array();
2818
- init_constants3();
2819
- init_ultraplan();
2820
- init_overlayContext();
2821
- init_src();
2822
- init_useKeybinding();
2823
- init_useShortcutDisplay();
2824
- init_array();
2825
- init_src();
2826
- init_AsyncAgentDetailDialog();
2827
- init_BackgroundTask();
2828
- init_DreamDetailDialog();
2829
- init_InProcessTeammateDetailDialog();
2830
- init_RemoteSessionDetailDialog();
2831
- init_ShellDetailDialog();
2832
- import_react6 = __toESM(require_react(), 1);
2833
- jsx_dev_runtime10 = __toESM(require_jsx_dev_runtime(), 1);
2834
- killWorkflowTask = workflowTaskModule?.killWorkflowTask ?? null;
2835
- skipWorkflowAgent = workflowTaskModule?.skipWorkflowAgent ?? null;
2836
- retryWorkflowAgent = workflowTaskModule?.retryWorkflowAgent ?? null;
2837
- killMonitorMcp = monitorMcpModule?.killMonitorMcp ?? null;
2838
- });
2839
-
2840
- export { enterTeammateView, exitTeammateView, stopOrDismissAgent, init_teammateViewHelpers, isTerminalStatus, shouldHideTasksFooter, init_taskStatusUtils, BackgroundTasksDialog, init_BackgroundTasksDialog };