@stigmer/server-slim 0.1.0

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 (564) hide show
  1. package/README.md +3 -0
  2. package/console/404.html +1 -0
  3. package/console/__next.__PAGE__.txt +54 -0
  4. package/console/__next._full.txt +71 -0
  5. package/console/__next._index.txt +62 -0
  6. package/console/__next._tree.txt +6 -0
  7. package/console/_next/static/GjBokeF86FffwftazOhh6/_buildManifest.js +11 -0
  8. package/console/_next/static/GjBokeF86FffwftazOhh6/_clientMiddlewareManifest.js +1 -0
  9. package/console/_next/static/GjBokeF86FffwftazOhh6/_ssgManifest.js +1 -0
  10. package/console/_next/static/chunks/0376wi8qbsw94.js +1 -0
  11. package/console/_next/static/chunks/04cglffeuwumk.js +1 -0
  12. package/console/_next/static/chunks/04d276dp3qb52.js +1 -0
  13. package/console/_next/static/chunks/05526ws9tzwim.js +1 -0
  14. package/console/_next/static/chunks/05t5235u7o-c4.js +25 -0
  15. package/console/_next/static/chunks/06fz-g9t73bd6.js +4 -0
  16. package/console/_next/static/chunks/0789xt7opwvm-.js +24 -0
  17. package/console/_next/static/chunks/07twy5plc911w.js +1 -0
  18. package/console/_next/static/chunks/08-p5zefc1rea.js +1 -0
  19. package/console/_next/static/chunks/085db4op75mf5.js +1 -0
  20. package/console/_next/static/chunks/0923388wak11-.js +1 -0
  21. package/console/_next/static/chunks/0_7s7fzux7kiv.js +1 -0
  22. package/console/_next/static/chunks/0_bjj6hug8d9a.js +1 -0
  23. package/console/_next/static/chunks/0_zscrk6o0d0-.js +1 -0
  24. package/console/_next/static/chunks/0a4x97q7frgj3.js +1 -0
  25. package/console/_next/static/chunks/0ab5jlm8l0aud.js +1 -0
  26. package/console/_next/static/chunks/0c_c2b4z1yc02.js +1 -0
  27. package/console/_next/static/chunks/0cuyycns49hl4.js +1 -0
  28. package/console/_next/static/chunks/0cz1d0mv5g_q7.js +1 -0
  29. package/console/_next/static/chunks/0d8f3-znyc_to.js +1 -0
  30. package/console/_next/static/chunks/0e-f1rkyz_u2k.js +1 -0
  31. package/console/_next/static/chunks/0ffx83gbnwq09.js +28 -0
  32. package/console/_next/static/chunks/0fyno0jk61txk.js +115 -0
  33. package/console/_next/static/chunks/0ggwoicp90w_s.js +1 -0
  34. package/console/_next/static/chunks/0h_7_i44vofe3.js +1 -0
  35. package/console/_next/static/chunks/0hagmppwo8s-f.js +1 -0
  36. package/console/_next/static/chunks/0hfvbn6c9k3pf.js +1 -0
  37. package/console/_next/static/chunks/0hw7vilkfpzlc.js +1 -0
  38. package/console/_next/static/chunks/0kb63xcvghh_3.js +1 -0
  39. package/console/_next/static/chunks/0ko5wsi6kukgd.js +1 -0
  40. package/console/_next/static/chunks/0kq99qin4db-q.js +1 -0
  41. package/console/_next/static/chunks/0kqg4u5n17gje.js +1 -0
  42. package/console/_next/static/chunks/0ky9qppyx1n57.js +62 -0
  43. package/console/_next/static/chunks/0og4_5pph-mhm.js +1 -0
  44. package/console/_next/static/chunks/0p7p-bpdrqx75.js +1 -0
  45. package/console/_next/static/chunks/0q2bnr94vvuc2.js +1 -0
  46. package/console/_next/static/chunks/0q3sxhnylk_gn.js +1 -0
  47. package/console/_next/static/chunks/0qg6l3tattq3j.js +1 -0
  48. package/console/_next/static/chunks/0qwyk_70quvjh.js +1 -0
  49. package/console/_next/static/chunks/0qzyqii8_m5r2.js +1 -0
  50. package/console/_next/static/chunks/0rlfx91598uvc.js +1 -0
  51. package/console/_next/static/chunks/0s9njms3lumhx.js +1 -0
  52. package/console/_next/static/chunks/0srualwd948m1.js +29 -0
  53. package/console/_next/static/chunks/0u4m2805tgi7x.js +1 -0
  54. package/console/_next/static/chunks/0udcs-1vq74rp.js +1 -0
  55. package/console/_next/static/chunks/0vno04lmwdchj.js +1 -0
  56. package/console/_next/static/chunks/0vt1_fu_q116n.js +1 -0
  57. package/console/_next/static/chunks/0vuq85gcb9zcl.js +1 -0
  58. package/console/_next/static/chunks/0wxazby0i4xu3.js +5 -0
  59. package/console/_next/static/chunks/0yeh2zqwmmec0.js +22 -0
  60. package/console/_next/static/chunks/0zvl88sijsrqk.js +1 -0
  61. package/console/_next/static/chunks/110bgpy30m6m6.js +1 -0
  62. package/console/_next/static/chunks/14ipylvs6qyyw.js +1 -0
  63. package/console/_next/static/chunks/1745jt9onokna.js +1 -0
  64. package/console/_next/static/chunks/177rfq0tsoku9.js +4 -0
  65. package/console/_next/static/chunks/17mfsiiquey1d.js +1 -0
  66. package/console/_next/static/chunks/197iuvi8udifl.js +1 -0
  67. package/console/_next/static/chunks/1_2-z0tjk0xio.js +1 -0
  68. package/console/_next/static/chunks/1_gh5a14dqnji.js +1 -0
  69. package/console/_next/static/chunks/1ame8n7x9g3xc.js +1 -0
  70. package/console/_next/static/chunks/1apepr-7dz16b.js +1 -0
  71. package/console/_next/static/chunks/1dtukwrl8nulc.js +1 -0
  72. package/console/_next/static/chunks/1e0br64ibniud.js +24 -0
  73. package/console/_next/static/chunks/1fm-45g777ifx.js +1 -0
  74. package/console/_next/static/chunks/1g_iha5barqef.js +1 -0
  75. package/console/_next/static/chunks/1glr_lki18csr.js +2 -0
  76. package/console/_next/static/chunks/1hl355w6m5bp5.js +1 -0
  77. package/console/_next/static/chunks/1id3p9v9v5knn.js +1 -0
  78. package/console/_next/static/chunks/1j6kp4gg0_ylt.js +80 -0
  79. package/console/_next/static/chunks/1jssq3ch7qgd6.js +60 -0
  80. package/console/_next/static/chunks/1jzfyfh-3gqlb.js +1 -0
  81. package/console/_next/static/chunks/1k3d5c49mpp-2.js +1 -0
  82. package/console/_next/static/chunks/1kte_bxw9m-ie.js +1 -0
  83. package/console/_next/static/chunks/1lw52jm27gon2.js +1 -0
  84. package/console/_next/static/chunks/1m9e28v8syzxx.js +34 -0
  85. package/console/_next/static/chunks/1mrmq_pigo_yb.js +1 -0
  86. package/console/_next/static/chunks/1muf1a96cgbv5.js +1 -0
  87. package/console/_next/static/chunks/1n1x0ykt8by6w.js +1 -0
  88. package/console/_next/static/chunks/1qu0tqybdtj0_.js +1 -0
  89. package/console/_next/static/chunks/1r8itpdfffwxa.js +1 -0
  90. package/console/_next/static/chunks/1r_opkrpbuykx.js +1 -0
  91. package/console/_next/static/chunks/1tl0h3c_bp62t.js +1 -0
  92. package/console/_next/static/chunks/1v1m1fr8f0yle.js +1 -0
  93. package/console/_next/static/chunks/1v34vj52v7q0g.js +1 -0
  94. package/console/_next/static/chunks/1wztfxoxnu5_9.js +1 -0
  95. package/console/_next/static/chunks/1x7exm5d_hhb8.js +153 -0
  96. package/console/_next/static/chunks/1xwdphzrhi9cn.js +1 -0
  97. package/console/_next/static/chunks/1yc4gdqzxa5ie.js +1 -0
  98. package/console/_next/static/chunks/1zunrzvni97zi.js +1 -0
  99. package/console/_next/static/chunks/1zv6mtmekep40.js +36 -0
  100. package/console/_next/static/chunks/2-jaie5wchnsy.js +1 -0
  101. package/console/_next/static/chunks/20aa5hen470pm.js +1 -0
  102. package/console/_next/static/chunks/2116ko93nwgx8.js +1 -0
  103. package/console/_next/static/chunks/23vk0ig36j0he.js +1 -0
  104. package/console/_next/static/chunks/245vlws7l85dk.js +1 -0
  105. package/console/_next/static/chunks/24__o4dkdytc8.js +1 -0
  106. package/console/_next/static/chunks/24iwqo9ejhxl8.js +127 -0
  107. package/console/_next/static/chunks/24o9ia1be2cze.js +1 -0
  108. package/console/_next/static/chunks/25aea0bgjydel.css +1 -0
  109. package/console/_next/static/chunks/26-p2jxr4f20d.js +1 -0
  110. package/console/_next/static/chunks/28c--yt2jaxxf.js +1 -0
  111. package/console/_next/static/chunks/28vym848oh1ng.js +1 -0
  112. package/console/_next/static/chunks/29ou6qb6p1lni.js +1 -0
  113. package/console/_next/static/chunks/2aalpmeu_tni-.js +3 -0
  114. package/console/_next/static/chunks/2c4ifddi2dal0.js +20 -0
  115. package/console/_next/static/chunks/2ckm4edha_gkb.js +43 -0
  116. package/console/_next/static/chunks/2d5ods6a8n6yd.js +1 -0
  117. package/console/_next/static/chunks/2dm5g7ylrulvb.js +15 -0
  118. package/console/_next/static/chunks/2dtosus35_o5k.js +1 -0
  119. package/console/_next/static/chunks/2e0_cm1_wv-b4.js +1 -0
  120. package/console/_next/static/chunks/2fh_0n31hibdi.js +226 -0
  121. package/console/_next/static/chunks/2fjsaw5pgjcqb.js +1 -0
  122. package/console/_next/static/chunks/2h5pk3yu15nwr.js +1 -0
  123. package/console/_next/static/chunks/2i7w4yyf77gzw.js +1 -0
  124. package/console/_next/static/chunks/2jo3q7mfk65kd.js +1 -0
  125. package/console/_next/static/chunks/2jutbapb-t64n.js +31 -0
  126. package/console/_next/static/chunks/2k6tx8-w1creu.js +148 -0
  127. package/console/_next/static/chunks/2kh_m5onqedc5.js +1 -0
  128. package/console/_next/static/chunks/2ltzdgpjq3v6a.js +1 -0
  129. package/console/_next/static/chunks/2o2ftjhtb8od3.js +2 -0
  130. package/console/_next/static/chunks/2pyn841-jq-oo.js +10 -0
  131. package/console/_next/static/chunks/2rn289343m-y_.js +139 -0
  132. package/console/_next/static/chunks/2t2l3h2w_04bb.js +1 -0
  133. package/console/_next/static/chunks/2v11hooq3xd5t.js +15 -0
  134. package/console/_next/static/chunks/2vsg5t3fnqmfn.js +1 -0
  135. package/console/_next/static/chunks/2wayafjfoiq7q.css +6 -0
  136. package/console/_next/static/chunks/2xsvteosdtsb-.js +1 -0
  137. package/console/_next/static/chunks/2y-x8nhnufxzb.js +1 -0
  138. package/console/_next/static/chunks/2za4b-si894xj.js +1 -0
  139. package/console/_next/static/chunks/3-igvp1-n4pxs.js +104 -0
  140. package/console/_next/static/chunks/3-k25f-adpe5f.js +1 -0
  141. package/console/_next/static/chunks/3-pzmot7dbrfa.js +1 -0
  142. package/console/_next/static/chunks/3-x5lrgs3wcpl.js +80 -0
  143. package/console/_next/static/chunks/30nrkrr9518_z.js +1 -0
  144. package/console/_next/static/chunks/316lh1-hzgnod.js +1 -0
  145. package/console/_next/static/chunks/31wj1au8smjge.js +1 -0
  146. package/console/_next/static/chunks/329o6uup9qmb3.js +1 -0
  147. package/console/_next/static/chunks/34_1w929-5o6r.js +287 -0
  148. package/console/_next/static/chunks/35szx1ga574xu.js +1 -0
  149. package/console/_next/static/chunks/36tg522pkl8hm.js +1 -0
  150. package/console/_next/static/chunks/37-y9fgnir35a.js +1 -0
  151. package/console/_next/static/chunks/39wss1g0ffaqt.js +1 -0
  152. package/console/_next/static/chunks/3_cv0gj1bm3l6.js +1 -0
  153. package/console/_next/static/chunks/3_f8gd_6816re.js +101 -0
  154. package/console/_next/static/chunks/3a4qfuhsxefh2.js +12 -0
  155. package/console/_next/static/chunks/3asb3ztrvogwl.js +1 -0
  156. package/console/_next/static/chunks/3bsxbw10qhvqo.js +1 -0
  157. package/console/_next/static/chunks/3by94g38ljxl1.js +1 -0
  158. package/console/_next/static/chunks/3c_6owv8m4rta.js +90 -0
  159. package/console/_next/static/chunks/3ea2eo8b5gmju.js +2 -0
  160. package/console/_next/static/chunks/3ercnb2rksl_a.js +1 -0
  161. package/console/_next/static/chunks/3esxfmmm0ypxb.js +2 -0
  162. package/console/_next/static/chunks/3exiw74xbmika.js +1 -0
  163. package/console/_next/static/chunks/3f88-tc5u2heg.js +1 -0
  164. package/console/_next/static/chunks/3f_axahrombdp.js +1 -0
  165. package/console/_next/static/chunks/3gz91kn_v2lfa.js +1 -0
  166. package/console/_next/static/chunks/3i9z3x7tka5x2.js +1 -0
  167. package/console/_next/static/chunks/3ih4kfufd47st.js +1 -0
  168. package/console/_next/static/chunks/3itfi41ayfopd.js +15 -0
  169. package/console/_next/static/chunks/3iwgig-fgcscf.js +15 -0
  170. package/console/_next/static/chunks/3jf8qh1ev3gb4.js +2 -0
  171. package/console/_next/static/chunks/3l6svfyqdsq6o.js +1 -0
  172. package/console/_next/static/chunks/3lj0i-qlb4ah2.js +64 -0
  173. package/console/_next/static/chunks/3lmx6tkunfd3u.js +1 -0
  174. package/console/_next/static/chunks/3lp4d64he__am.js +152 -0
  175. package/console/_next/static/chunks/3m_jz3b2j38nn.js +1 -0
  176. package/console/_next/static/chunks/3oe9w1b39nzmn.js +3 -0
  177. package/console/_next/static/chunks/3on7r_d8o-kna.js +1 -0
  178. package/console/_next/static/chunks/3pbpowf3kdu5z.js +119 -0
  179. package/console/_next/static/chunks/3pwwv0u29nk8c.js +23 -0
  180. package/console/_next/static/chunks/3rweyye6o1z6b.js +79 -0
  181. package/console/_next/static/chunks/3sdqgrmvxm_u4.js +201 -0
  182. package/console/_next/static/chunks/3t3vbs-x5hixj.js +1 -0
  183. package/console/_next/static/chunks/3thqnz0a5zy-h.js +9 -0
  184. package/console/_next/static/chunks/3udubdawo7583.js +1 -0
  185. package/console/_next/static/chunks/3uz4lg6e199sb.js +1 -0
  186. package/console/_next/static/chunks/3v2mkz_46uei2.js +1 -0
  187. package/console/_next/static/chunks/3w5crjmhb-3um.js +1 -0
  188. package/console/_next/static/chunks/3waxhrmr_82j5.js +93 -0
  189. package/console/_next/static/chunks/3zmlzef_jxopu.js +1 -0
  190. package/console/_next/static/chunks/3zqvalj8nr-1y.js +1 -0
  191. package/console/_next/static/chunks/40igag4gq4k0a.js +77 -0
  192. package/console/_next/static/chunks/40wq034qcdji_.js +1 -0
  193. package/console/_next/static/chunks/44crhetqymq_e.js +34 -0
  194. package/console/_next/static/chunks/44q2pv6a3w19q.js +1 -0
  195. package/console/_next/static/chunks/turbopack-2u1d16houkiyo.js +1 -0
  196. package/console/_next/static/media/GeistMono_Variable-s.p.21mfa-4xv0w3g.woff2 +0 -0
  197. package/console/_next/static/media/Geist_Variable-s.p.217kyf1h_p0cg.woff2 +0 -0
  198. package/console/_next/static/media/IBMPlexMono_Medium-s.2v25u5rd2tsaf.woff2 +0 -0
  199. package/console/_next/static/media/IBMPlexMono_Regular-s.09u63wo58kris.woff2 +0 -0
  200. package/console/_next/static/media/IBMPlexSans_Bold-s.3iicodgz0epim.woff2 +0 -0
  201. package/console/_next/static/media/IBMPlexSans_Light-s.3ntejfdcyftfg.woff2 +0 -0
  202. package/console/_next/static/media/IBMPlexSans_Medium-s.3n25cgfiu6qss.woff2 +0 -0
  203. package/console/_next/static/media/IBMPlexSans_Regular-s.2e_-c_m03txvi.woff2 +0 -0
  204. package/console/_next/static/media/IBMPlexSans_SemiBold-s.2sutjpuns2xc5.woff2 +0 -0
  205. package/console/_next/static/media/Inter_Variable-s.2-lfiv6s83kzn.woff2 +0 -0
  206. package/console/_next/static/media/Nunito_Variable-s.3r4_r9s3kxd_-.woff2 +0 -0
  207. package/console/_not-found/__next._full.txt +73 -0
  208. package/console/_not-found/__next._index.txt +62 -0
  209. package/console/_not-found/__next._not-found.__PAGE__.txt +61 -0
  210. package/console/_not-found/__next._tree.txt +5 -0
  211. package/console/_not-found.html +1 -0
  212. package/console/_not-found.txt +73 -0
  213. package/console/apple-touch-icon-dark.png +0 -0
  214. package/console/apple-touch-icon-light.png +0 -0
  215. package/console/auth/callback/__next._full.txt +82 -0
  216. package/console/auth/callback/__next._index.txt +62 -0
  217. package/console/auth/callback/__next._tree.txt +8 -0
  218. package/console/auth/callback/__next.auth.callback.__PAGE__.txt +67 -0
  219. package/console/auth/callback.html +1 -0
  220. package/console/auth/callback.txt +82 -0
  221. package/console/auth/oauth/callback/__next._full.txt +84 -0
  222. package/console/auth/oauth/callback/__next._index.txt +62 -0
  223. package/console/auth/oauth/callback/__next._tree.txt +9 -0
  224. package/console/auth/oauth/callback/__next.auth.oauth.callback.__PAGE__.txt +69 -0
  225. package/console/auth/oauth/callback.html +1 -0
  226. package/console/auth/oauth/callback.txt +84 -0
  227. package/console/brand-avatar.png +0 -0
  228. package/console/chat/__placeholder__/__next._full.txt +80 -0
  229. package/console/chat/__placeholder__/__next._index.txt +62 -0
  230. package/console/chat/__placeholder__/__next._tree.txt +8 -0
  231. package/console/chat/__placeholder__/__next.chat.$d$channel.__PAGE__.txt +65 -0
  232. package/console/chat/__placeholder__.html +1 -0
  233. package/console/chat/__placeholder__.txt +80 -0
  234. package/console/connect/__placeholder__/__next._full.txt +79 -0
  235. package/console/connect/__placeholder__/__next._index.txt +62 -0
  236. package/console/connect/__placeholder__/__next._tree.txt +8 -0
  237. package/console/connect/__placeholder__/__next.connect.$d$token.__PAGE__.txt +64 -0
  238. package/console/connect/__placeholder__.html +1 -0
  239. package/console/connect/__placeholder__.txt +79 -0
  240. package/console/conversations/__next._full.txt +79 -0
  241. package/console/conversations/__next._index.txt +62 -0
  242. package/console/conversations/__next._tree.txt +7 -0
  243. package/console/conversations/__next.conversations.__PAGE__.txt +64 -0
  244. package/console/conversations/__placeholder__/__placeholder__/__next._full.txt +83 -0
  245. package/console/conversations/__placeholder__/__placeholder__/__next._index.txt +62 -0
  246. package/console/conversations/__placeholder__/__placeholder__/__next._tree.txt +9 -0
  247. package/console/conversations/__placeholder__/__placeholder__/__next.conversations.$d$channelId.$d$key.__PAGE__.txt +68 -0
  248. package/console/conversations/__placeholder__/__placeholder__.html +1 -0
  249. package/console/conversations/__placeholder__/__placeholder__.txt +83 -0
  250. package/console/conversations.html +1 -0
  251. package/console/conversations.txt +79 -0
  252. package/console/dashboard/__next._full.txt +77 -0
  253. package/console/dashboard/__next._index.txt +62 -0
  254. package/console/dashboard/__next._tree.txt +7 -0
  255. package/console/dashboard/__next.dashboard.__PAGE__.txt +62 -0
  256. package/console/dashboard.html +1 -0
  257. package/console/dashboard.txt +77 -0
  258. package/console/desktop/billing/__next._full.txt +82 -0
  259. package/console/desktop/billing/__next._index.txt +62 -0
  260. package/console/desktop/billing/__next._tree.txt +8 -0
  261. package/console/desktop/billing/__next.desktop.billing.__PAGE__.txt +67 -0
  262. package/console/desktop/billing.html +1 -0
  263. package/console/desktop/billing.txt +82 -0
  264. package/console/embed.js +1 -0
  265. package/console/favicon-dark-16x16.png +0 -0
  266. package/console/favicon-dark-32x32.png +0 -0
  267. package/console/favicon-dark.ico +0 -0
  268. package/console/favicon-dark.svg +1 -0
  269. package/console/favicon-light-16x16.png +0 -0
  270. package/console/favicon-light-32x32.png +0 -0
  271. package/console/favicon-light.ico +0 -0
  272. package/console/favicon-light.svg +1 -0
  273. package/console/index.html +1 -0
  274. package/console/index.txt +71 -0
  275. package/console/invite/__placeholder__/__next._full.txt +80 -0
  276. package/console/invite/__placeholder__/__next._index.txt +62 -0
  277. package/console/invite/__placeholder__/__next._tree.txt +8 -0
  278. package/console/invite/__placeholder__/__next.invite.$d$token.__PAGE__.txt +65 -0
  279. package/console/invite/__placeholder__.html +1 -0
  280. package/console/invite/__placeholder__.txt +80 -0
  281. package/console/library/__next._full.txt +89 -0
  282. package/console/library/__next._index.txt +62 -0
  283. package/console/library/__next._tree.txt +7 -0
  284. package/console/library/__next.library.__PAGE__.txt +74 -0
  285. package/console/library/agents/__next._full.txt +94 -0
  286. package/console/library/agents/__next._index.txt +62 -0
  287. package/console/library/agents/__next._tree.txt +8 -0
  288. package/console/library/agents/__next.library.agents.__PAGE__.txt +79 -0
  289. package/console/library/agents/__placeholder__/__placeholder__/__next._full.txt +96 -0
  290. package/console/library/agents/__placeholder__/__placeholder__/__next._index.txt +62 -0
  291. package/console/library/agents/__placeholder__/__placeholder__/__next._tree.txt +10 -0
  292. package/console/library/agents/__placeholder__/__placeholder__/__next.library.agents.$d$org.$d$slug.__PAGE__.txt +81 -0
  293. package/console/library/agents/__placeholder__/__placeholder__.html +1 -0
  294. package/console/library/agents/__placeholder__/__placeholder__.txt +96 -0
  295. package/console/library/agents/new/__next._full.txt +99 -0
  296. package/console/library/agents/new/__next._index.txt +62 -0
  297. package/console/library/agents/new/__next._tree.txt +9 -0
  298. package/console/library/agents/new/__next.library.agents.new.__PAGE__.txt +84 -0
  299. package/console/library/agents/new.html +1 -0
  300. package/console/library/agents/new.txt +99 -0
  301. package/console/library/agents.html +1 -0
  302. package/console/library/agents.txt +94 -0
  303. package/console/library/environments/__next._full.txt +95 -0
  304. package/console/library/environments/__next._index.txt +62 -0
  305. package/console/library/environments/__next._tree.txt +8 -0
  306. package/console/library/environments/__next.library.environments.__PAGE__.txt +80 -0
  307. package/console/library/environments/__placeholder__/__placeholder__/__next._full.txt +97 -0
  308. package/console/library/environments/__placeholder__/__placeholder__/__next._index.txt +62 -0
  309. package/console/library/environments/__placeholder__/__placeholder__/__next._tree.txt +10 -0
  310. package/console/library/environments/__placeholder__/__placeholder__/__next.library.environments.$d$org.$d$slug.__PAGE__.txt +82 -0
  311. package/console/library/environments/__placeholder__/__placeholder__.html +1 -0
  312. package/console/library/environments/__placeholder__/__placeholder__.txt +97 -0
  313. package/console/library/environments/new/__next._full.txt +99 -0
  314. package/console/library/environments/new/__next._index.txt +62 -0
  315. package/console/library/environments/new/__next._tree.txt +9 -0
  316. package/console/library/environments/new/__next.library.environments.new.__PAGE__.txt +84 -0
  317. package/console/library/environments/new.html +1 -0
  318. package/console/library/environments/new.txt +99 -0
  319. package/console/library/environments.html +1 -0
  320. package/console/library/environments.txt +95 -0
  321. package/console/library/files/__next._full.txt +94 -0
  322. package/console/library/files/__next._index.txt +62 -0
  323. package/console/library/files/__next._tree.txt +8 -0
  324. package/console/library/files/__next.library.files.__PAGE__.txt +79 -0
  325. package/console/library/files.html +1 -0
  326. package/console/library/files.txt +94 -0
  327. package/console/library/plugins/__next._full.txt +94 -0
  328. package/console/library/plugins/__next._index.txt +62 -0
  329. package/console/library/plugins/__next._tree.txt +8 -0
  330. package/console/library/plugins/__next.library.plugins.__PAGE__.txt +79 -0
  331. package/console/library/plugins/__placeholder__/__placeholder__/__next._full.txt +97 -0
  332. package/console/library/plugins/__placeholder__/__placeholder__/__next._index.txt +62 -0
  333. package/console/library/plugins/__placeholder__/__placeholder__/__next._tree.txt +10 -0
  334. package/console/library/plugins/__placeholder__/__placeholder__/__next.library.plugins.$d$org.$d$slug.__PAGE__.txt +82 -0
  335. package/console/library/plugins/__placeholder__/__placeholder__.html +1 -0
  336. package/console/library/plugins/__placeholder__/__placeholder__.txt +97 -0
  337. package/console/library/plugins/upload/__next._full.txt +99 -0
  338. package/console/library/plugins/upload/__next._index.txt +62 -0
  339. package/console/library/plugins/upload/__next._tree.txt +9 -0
  340. package/console/library/plugins/upload/__next.library.plugins.upload.__PAGE__.txt +84 -0
  341. package/console/library/plugins/upload.html +1 -0
  342. package/console/library/plugins/upload.txt +99 -0
  343. package/console/library/plugins.html +1 -0
  344. package/console/library/plugins.txt +94 -0
  345. package/console/library/routines/__next._full.txt +94 -0
  346. package/console/library/routines/__next._index.txt +62 -0
  347. package/console/library/routines/__next._tree.txt +8 -0
  348. package/console/library/routines/__next.library.routines.__PAGE__.txt +79 -0
  349. package/console/library/routines/__placeholder__/__placeholder__/__next._full.txt +97 -0
  350. package/console/library/routines/__placeholder__/__placeholder__/__next._index.txt +62 -0
  351. package/console/library/routines/__placeholder__/__placeholder__/__next._tree.txt +10 -0
  352. package/console/library/routines/__placeholder__/__placeholder__/__next.library.routines.$d$org.$d$slug.__PAGE__.txt +82 -0
  353. package/console/library/routines/__placeholder__/__placeholder__.html +1 -0
  354. package/console/library/routines/__placeholder__/__placeholder__.txt +97 -0
  355. package/console/library/routines/new/__next._full.txt +98 -0
  356. package/console/library/routines/new/__next._index.txt +62 -0
  357. package/console/library/routines/new/__next._tree.txt +9 -0
  358. package/console/library/routines/new/__next.library.routines.new.__PAGE__.txt +83 -0
  359. package/console/library/routines/new.html +1 -0
  360. package/console/library/routines/new.txt +98 -0
  361. package/console/library/routines.html +1 -0
  362. package/console/library/routines.txt +94 -0
  363. package/console/library/skills/__next._full.txt +94 -0
  364. package/console/library/skills/__next._index.txt +62 -0
  365. package/console/library/skills/__next._tree.txt +8 -0
  366. package/console/library/skills/__next.library.skills.__PAGE__.txt +79 -0
  367. package/console/library/skills/__placeholder__/__placeholder__/__next._full.txt +96 -0
  368. package/console/library/skills/__placeholder__/__placeholder__/__next._index.txt +62 -0
  369. package/console/library/skills/__placeholder__/__placeholder__/__next._tree.txt +10 -0
  370. package/console/library/skills/__placeholder__/__placeholder__/__next.library.skills.$d$org.$d$slug.__PAGE__.txt +81 -0
  371. package/console/library/skills/__placeholder__/__placeholder__.html +1 -0
  372. package/console/library/skills/__placeholder__/__placeholder__.txt +96 -0
  373. package/console/library/skills/new/__next._full.txt +98 -0
  374. package/console/library/skills/new/__next._index.txt +62 -0
  375. package/console/library/skills/new/__next._tree.txt +9 -0
  376. package/console/library/skills/new/__next.library.skills.new.__PAGE__.txt +83 -0
  377. package/console/library/skills/new.html +1 -0
  378. package/console/library/skills/new.txt +98 -0
  379. package/console/library/skills.html +1 -0
  380. package/console/library/skills.txt +94 -0
  381. package/console/library.html +1 -0
  382. package/console/library.txt +89 -0
  383. package/console/login/__next._full.txt +81 -0
  384. package/console/login/__next._index.txt +62 -0
  385. package/console/login/__next._tree.txt +7 -0
  386. package/console/login/__next.login.__PAGE__.txt +66 -0
  387. package/console/login.html +1 -0
  388. package/console/login.txt +81 -0
  389. package/console/marketplace/__next._full.txt +81 -0
  390. package/console/marketplace/__next._index.txt +62 -0
  391. package/console/marketplace/__next._tree.txt +7 -0
  392. package/console/marketplace/__next.marketplace.__PAGE__.txt +66 -0
  393. package/console/marketplace.html +1 -0
  394. package/console/marketplace.txt +81 -0
  395. package/console/models/__next._full.txt +77 -0
  396. package/console/models/__next._index.txt +62 -0
  397. package/console/models/__next._tree.txt +7 -0
  398. package/console/models/__next.models.__PAGE__.txt +62 -0
  399. package/console/models.html +1 -0
  400. package/console/models.txt +77 -0
  401. package/console/oauth/slack/callback/__next._full.txt +84 -0
  402. package/console/oauth/slack/callback/__next._index.txt +62 -0
  403. package/console/oauth/slack/callback/__next._tree.txt +9 -0
  404. package/console/oauth/slack/callback/__next.oauth.slack.callback.__PAGE__.txt +69 -0
  405. package/console/oauth/slack/callback.html +1 -0
  406. package/console/oauth/slack/callback.txt +84 -0
  407. package/console/runs/__placeholder__/__next._full.txt +77 -0
  408. package/console/runs/__placeholder__/__next._index.txt +62 -0
  409. package/console/runs/__placeholder__/__next._tree.txt +8 -0
  410. package/console/runs/__placeholder__/__next.runs.$d$id.__PAGE__.txt +62 -0
  411. package/console/runs/__placeholder__.html +1 -0
  412. package/console/runs/__placeholder__.txt +77 -0
  413. package/console/sessions/__placeholder__/__next._full.txt +77 -0
  414. package/console/sessions/__placeholder__/__next._index.txt +62 -0
  415. package/console/sessions/__placeholder__/__next._tree.txt +8 -0
  416. package/console/sessions/__placeholder__/__next.sessions.$d$id.__PAGE__.txt +62 -0
  417. package/console/sessions/__placeholder__.html +1 -0
  418. package/console/sessions/__placeholder__.txt +77 -0
  419. package/console/settings/__next._full.txt +85 -0
  420. package/console/settings/__next._index.txt +62 -0
  421. package/console/settings/__next._tree.txt +7 -0
  422. package/console/settings/__next.settings.__PAGE__.txt +70 -0
  423. package/console/settings/access-history/__next._full.txt +87 -0
  424. package/console/settings/access-history/__next._index.txt +62 -0
  425. package/console/settings/access-history/__next._tree.txt +8 -0
  426. package/console/settings/access-history/__next.settings.access-history.__PAGE__.txt +72 -0
  427. package/console/settings/access-history.html +1 -0
  428. package/console/settings/access-history.txt +87 -0
  429. package/console/settings/account-preferences/__next._full.txt +87 -0
  430. package/console/settings/account-preferences/__next._index.txt +62 -0
  431. package/console/settings/account-preferences/__next._tree.txt +8 -0
  432. package/console/settings/account-preferences/__next.settings.account-preferences.__PAGE__.txt +72 -0
  433. package/console/settings/account-preferences.html +1 -0
  434. package/console/settings/account-preferences.txt +87 -0
  435. package/console/settings/api-keys/__next._full.txt +86 -0
  436. package/console/settings/api-keys/__next._index.txt +62 -0
  437. package/console/settings/api-keys/__next._tree.txt +8 -0
  438. package/console/settings/api-keys/__next.settings.api-keys.__PAGE__.txt +71 -0
  439. package/console/settings/api-keys.html +1 -0
  440. package/console/settings/api-keys.txt +86 -0
  441. package/console/settings/billing/__next._full.txt +89 -0
  442. package/console/settings/billing/__next._index.txt +62 -0
  443. package/console/settings/billing/__next._tree.txt +8 -0
  444. package/console/settings/billing/__next.settings.billing.__PAGE__.txt +74 -0
  445. package/console/settings/billing.html +1 -0
  446. package/console/settings/billing.txt +89 -0
  447. package/console/settings/channel-apps/__next._full.txt +87 -0
  448. package/console/settings/channel-apps/__next._index.txt +62 -0
  449. package/console/settings/channel-apps/__next._tree.txt +8 -0
  450. package/console/settings/channel-apps/__next.settings.channel-apps.__PAGE__.txt +72 -0
  451. package/console/settings/channel-apps.html +1 -0
  452. package/console/settings/channel-apps.txt +87 -0
  453. package/console/settings/federation-issuers/__next._full.txt +88 -0
  454. package/console/settings/federation-issuers/__next._index.txt +62 -0
  455. package/console/settings/federation-issuers/__next._tree.txt +8 -0
  456. package/console/settings/federation-issuers/__next.settings.federation-issuers.__PAGE__.txt +73 -0
  457. package/console/settings/federation-issuers.html +1 -0
  458. package/console/settings/federation-issuers.txt +88 -0
  459. package/console/settings/invitations/__next._full.txt +87 -0
  460. package/console/settings/invitations/__next._index.txt +62 -0
  461. package/console/settings/invitations/__next._tree.txt +8 -0
  462. package/console/settings/invitations/__next.settings.invitations.__PAGE__.txt +72 -0
  463. package/console/settings/invitations.html +1 -0
  464. package/console/settings/invitations.txt +87 -0
  465. package/console/settings/licenses/__next._full.txt +90 -0
  466. package/console/settings/licenses/__next._index.txt +62 -0
  467. package/console/settings/licenses/__next._tree.txt +8 -0
  468. package/console/settings/licenses/__next.settings.licenses.__PAGE__.txt +75 -0
  469. package/console/settings/licenses.html +1 -0
  470. package/console/settings/licenses.txt +90 -0
  471. package/console/settings/members/__next._full.txt +86 -0
  472. package/console/settings/members/__next._index.txt +62 -0
  473. package/console/settings/members/__next._tree.txt +8 -0
  474. package/console/settings/members/__next.settings.members.__PAGE__.txt +71 -0
  475. package/console/settings/members.html +1 -0
  476. package/console/settings/members.txt +86 -0
  477. package/console/settings/memory/__next._full.txt +86 -0
  478. package/console/settings/memory/__next._index.txt +62 -0
  479. package/console/settings/memory/__next._tree.txt +8 -0
  480. package/console/settings/memory/__next.settings.memory.__PAGE__.txt +71 -0
  481. package/console/settings/memory.html +1 -0
  482. package/console/settings/memory.txt +86 -0
  483. package/console/settings/model-catalog/__next._full.txt +89 -0
  484. package/console/settings/model-catalog/__next._index.txt +62 -0
  485. package/console/settings/model-catalog/__next._tree.txt +8 -0
  486. package/console/settings/model-catalog/__next.settings.model-catalog.__PAGE__.txt +74 -0
  487. package/console/settings/model-catalog.html +1 -0
  488. package/console/settings/model-catalog.txt +89 -0
  489. package/console/settings/notifications/__next._full.txt +89 -0
  490. package/console/settings/notifications/__next._index.txt +62 -0
  491. package/console/settings/notifications/__next._tree.txt +8 -0
  492. package/console/settings/notifications/__next.settings.notifications.__PAGE__.txt +74 -0
  493. package/console/settings/notifications.html +1 -0
  494. package/console/settings/notifications.txt +89 -0
  495. package/console/settings/oauth-apps/__next._full.txt +87 -0
  496. package/console/settings/oauth-apps/__next._index.txt +62 -0
  497. package/console/settings/oauth-apps/__next._tree.txt +8 -0
  498. package/console/settings/oauth-apps/__next.settings.oauth-apps.__PAGE__.txt +72 -0
  499. package/console/settings/oauth-apps.html +1 -0
  500. package/console/settings/oauth-apps.txt +87 -0
  501. package/console/settings/org-embedding/__next._full.txt +87 -0
  502. package/console/settings/org-embedding/__next._index.txt +62 -0
  503. package/console/settings/org-embedding/__next._tree.txt +8 -0
  504. package/console/settings/org-embedding/__next.settings.org-embedding.__PAGE__.txt +72 -0
  505. package/console/settings/org-embedding.html +1 -0
  506. package/console/settings/org-embedding.txt +87 -0
  507. package/console/settings/org-policies/__next._full.txt +87 -0
  508. package/console/settings/org-policies/__next._index.txt +62 -0
  509. package/console/settings/org-policies/__next._tree.txt +8 -0
  510. package/console/settings/org-policies/__next.settings.org-policies.__PAGE__.txt +72 -0
  511. package/console/settings/org-policies.html +1 -0
  512. package/console/settings/org-policies.txt +87 -0
  513. package/console/settings/org-preferences/__next._full.txt +87 -0
  514. package/console/settings/org-preferences/__next._index.txt +62 -0
  515. package/console/settings/org-preferences/__next._tree.txt +8 -0
  516. package/console/settings/org-preferences/__next.settings.org-preferences.__PAGE__.txt +72 -0
  517. package/console/settings/org-preferences.html +1 -0
  518. package/console/settings/org-preferences.txt +87 -0
  519. package/console/settings/org-profile/__next._full.txt +89 -0
  520. package/console/settings/org-profile/__next._index.txt +62 -0
  521. package/console/settings/org-profile/__next._tree.txt +8 -0
  522. package/console/settings/org-profile/__next.settings.org-profile.__PAGE__.txt +74 -0
  523. package/console/settings/org-profile.html +1 -0
  524. package/console/settings/org-profile.txt +89 -0
  525. package/console/settings/plans/__next._full.txt +89 -0
  526. package/console/settings/plans/__next._index.txt +62 -0
  527. package/console/settings/plans/__next._tree.txt +8 -0
  528. package/console/settings/plans/__next.settings.plans.__PAGE__.txt +74 -0
  529. package/console/settings/plans.html +1 -0
  530. package/console/settings/plans.txt +89 -0
  531. package/console/settings/service-accounts/__next._full.txt +87 -0
  532. package/console/settings/service-accounts/__next._index.txt +62 -0
  533. package/console/settings/service-accounts/__next._tree.txt +8 -0
  534. package/console/settings/service-accounts/__next.settings.service-accounts.__PAGE__.txt +72 -0
  535. package/console/settings/service-accounts.html +1 -0
  536. package/console/settings/service-accounts.txt +87 -0
  537. package/console/settings/teams/__next._full.txt +86 -0
  538. package/console/settings/teams/__next._index.txt +62 -0
  539. package/console/settings/teams/__next._tree.txt +8 -0
  540. package/console/settings/teams/__next.settings.teams.__PAGE__.txt +71 -0
  541. package/console/settings/teams.html +1 -0
  542. package/console/settings/teams.txt +86 -0
  543. package/console/settings/usage/__next._full.txt +86 -0
  544. package/console/settings/usage/__next._index.txt +62 -0
  545. package/console/settings/usage/__next._tree.txt +8 -0
  546. package/console/settings/usage/__next.settings.usage.__PAGE__.txt +71 -0
  547. package/console/settings/usage.html +1 -0
  548. package/console/settings/usage.txt +86 -0
  549. package/console/settings/vaults/__next._full.txt +86 -0
  550. package/console/settings/vaults/__next._index.txt +62 -0
  551. package/console/settings/vaults/__next._tree.txt +8 -0
  552. package/console/settings/vaults/__next.settings.vaults.__PAGE__.txt +71 -0
  553. package/console/settings/vaults.html +1 -0
  554. package/console/settings/vaults.txt +86 -0
  555. package/console/settings.html +1 -0
  556. package/console/settings.txt +85 -0
  557. package/main.js +1656 -0
  558. package/mappings.wasm +0 -0
  559. package/package.json +25 -0
  560. package/workflow-bundle-agent-execution.js +29297 -0
  561. package/workflow-bundle-evals.js +11997 -0
  562. package/workflow-bundle-grading.js +11155 -0
  563. package/workflow-bundle-routine.js +11300 -0
  564. package/workflow-worker-thread.cjs +111 -0
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,644731,e=>{"use strict";var t=e.i(857844);e.s(["f",()=>t.C])},128278,e=>{"use strict";var t=e.i(394327);let s={pending:t.A.RUN_PENDING,running:t.A.RUN_IN_PROGRESS,waiting:t.A.RUN_WAITING_FOR_APPROVAL,paused:t.A.RUN_PAUSED,completed:t.A.RUN_COMPLETED,failed:t.A.RUN_FAILED,cancelled:t.A.RUN_CANCELLED,terminated:t.A.RUN_TERMINATED};e.s(["f",0,function(e){return s[e]??t.A.RUN_PHASE_UNSPECIFIED}])},719705,e=>{"use strict";var t=e.i(974265),s=e.i(651023),r=e.i(893976),n=e.i(411570),i=e.i(679239);e.s(["f",0,function({children:e,maxHeightClass:l="stg:max-h-48",cursorTarget:a,className:o}){let[d,u]=(0,s.useState)(!1),g=!d,{ref:c,isOverflowing:f}=(0,n.f)(g),m=f||d,x=g&&f;return(0,t.jsxs)("div",{className:o,children:[(0,t.jsxs)("div",{ref:c,className:(0,r.f)("stg:relative stg:overflow-hidden",g&&l),children:[e,x&&(0,t.jsx)("div",{"aria-hidden":"true",className:"stg:pointer-events-none stg:absolute stg:inset-x-0 stg:bottom-0 stg:h-8 stg:bg-gradient-to-t stg:from-background stg:to-transparent"})]}),m&&(0,t.jsx)(i.f,{expanded:d,onToggle:()=>u(e=>!e),cursorTarget:a})]})}])},679239,e=>{"use strict";var t=e.i(974265),s=e.i(893976);function r({expanded:e}){return(0,t.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:(0,s.f)("stg:shrink-0 stg:transition-transform stg:duration-150",e&&"stg:rotate-180"),"aria-hidden":"true",children:(0,t.jsx)("path",{d:"M2.5 3.5L5 6.5L7.5 3.5"})})}e.s(["f",0,function({expanded:e,onToggle:n,moreLabel:i="Show more",lessLabel:l="Show less",cursorTarget:a,className:o}){return(0,t.jsxs)("button",{type:"button",onClick:n,"aria-expanded":e,"data-cursor-target":a,className:(0,s.f)("stg:mt-1 stg:flex stg:w-full stg:items-center stg:justify-center stg:gap-1 stg:rounded stg:py-0.5","stg:text-xs stg:font-medium stg:text-muted-foreground stg:transition-colors stg:hover:text-foreground","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring",o),children:[(0,t.jsx)("span",{children:e?l:i}),(0,t.jsx)(r,{expanded:e})]})}])},411570,e=>{"use strict";var t=e.i(651023);e.s(["f",0,function(e){let s=(0,t.useRef)(null),[r,n]=(0,t.useState)(!1);return(0,t.useLayoutEffect)(()=>{if(!e)return void n(e=>!e&&e);let t=s.current;if(!t)return;let r=()=>{let e=t.scrollHeight>t.clientHeight+1;n(t=>t===e?t:e)};r();let i=new ResizeObserver(r);return i.observe(t),()=>i.disconnect()},[e]),{ref:s,isOverflowing:r}}])},353799,438301,935010,775570,651427,57841,e=>{"use strict";var t=e.i(974265),s=e.i(651023),r=e.i(893976),n=e.i(719705),i=e.i(19395),l=e.i(598529),a=e.i(873428),o=e.i(188482),d=e.i(193799),u=e.i(866047),g=e.i(165971);function c({path:e,dirDisplay:n="hide",className:i}){let{resources:l,onFilePathClick:a}=(0,s.useContext)(u.f),{copy:x,copied:h}=(0,d.f)(),p=(0,s.useMemo)(()=>(0,g.Z)(e,l),[e,l]),{dir:b,base:v}=(0,s.useMemo)(()=>(0,g.V)(e),[e]),j="copy"===p.action?p.value:e,y=`${p.tooltip}: ${j}`,k=(0,s.useCallback)(()=>{x("copy"===p.action?p.value:e)},[p,e,x]),w=(0,s.useCallback)(t=>{if(t.stopPropagation(),a&&!1!==a(e,p)){"link"===p.action&&t.preventDefault();return}"copy"===p.action&&k()},[a,e,p,k]),N=(0,r.f)("stg:inline-flex stg:min-w-0 stg:items-center stg:gap-1 stg:font-mono stg:text-foreground","stg:transition-colors stg:hover:text-primary stg:hover:underline","stg:focus-visible:outline-none stg:focus-visible:ring-1 stg:focus-visible:ring-ring stg:focus-visible:rounded-sm",i),C=h?(0,t.jsx)("span",{className:"stg:min-w-0 stg:truncate",children:"Copied"}):(0,t.jsxs)(t.Fragment,{children:["dim"===n&&b&&(0,t.jsx)("span",{className:"stg:min-w-0 stg:truncate stg:text-muted-foreground",children:b}),(0,t.jsx)("span",{className:"stg:shrink-0",children:v})]});return"link"===p.action?(0,t.jsxs)(o.W,{children:[(0,t.jsxs)(o.y,{render:(0,t.jsx)("a",{href:p.url,target:"_blank",rel:"noopener noreferrer",onClick:w,"aria-label":y,className:(0,r.f)(N,"stg:group/fpl")}),children:[C,(0,t.jsx)(f,{})]}),(0,t.jsx)(o.Y,{side:"top",className:"stg:break-all",children:j})]}):(0,t.jsxs)(o.W,{children:[(0,t.jsxs)(o.y,{render:(0,t.jsx)("button",{type:"button",onClick:w,"aria-label":y,className:(0,r.f)(N,"stg:group/fpl stg:cursor-pointer")}),children:[C,!h&&(0,t.jsx)(m,{})]}),(0,t.jsx)(o.Y,{side:"top",className:"stg:break-all",children:j})]})}function f(){return(0,t.jsxs)("svg",{width:"10",height:"10",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round",className:"stg:shrink-0 stg:opacity-0 stg:transition-opacity stg:group-hover/fpl:opacity-70","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M9 3L5 7"}),(0,t.jsx)("path",{d:"M7 3H9V5"}),(0,t.jsx)("path",{d:"M5 3H3.5C2.95 3 2.5 3.45 2.5 4V8.5C2.5 9.05 2.95 9.5 3.5 9.5H8C8.55 9.5 9 9.05 9 8.5V7"})]})}function m(){return(0,t.jsxs)("svg",{width:"10",height:"10",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round",className:"stg:shrink-0 stg:opacity-0 stg:transition-opacity stg:group-hover/fpl:opacity-70","aria-hidden":"true",children:[(0,t.jsx)("rect",{x:"4",y:"4",width:"6.5",height:"6.5",rx:"1"}),(0,t.jsx)("path",{d:"M8 4V2.5C8 1.95 7.55 1.5 7 1.5H2.5C1.95 1.5 1.5 1.95 1.5 2.5V7C1.5 7.55 1.95 8 2.5 8H4"})]})}e.s(["f",0,c],438301);let x={"empty-create":"New empty file",create:"New file — preview unavailable","no-preview":"No preview available for this change"};function h({kind:e,className:s}){return(0,t.jsx)("div",{role:"status","data-cursor-target":"empty-change-notice",className:(0,r.f)("stg:rounded-md stg:border stg:border-border stg:bg-muted-subtle stg:px-3 stg:py-2 stg:text-xs stg:text-muted-foreground",s),children:x[e]})}e.s(["f",0,h],935010);var p=e.i(781126),b=e.i(891287),v=e.i(269285),j=e.i(255817),y=e.i(616701);let k={content:null,contentType:null,isTruncated:!1};function w(e,t,s,r,n){let i=(0,j.f)(),{data:l,isLoading:a,isRefetching:o,error:d,refetch:u}=(0,y.f)(e&&t?()=>i.run.getArtifactContent((0,b.f)(v.B,{runId:e,storageKey:t,...s?{entryPath:s}:{}})).then(e=>({content:new TextDecoder().decode(e.content),contentType:e.contentType||null,isTruncated:e.truncated})):null,[e,t,s,r,i],k,n?{cacheKey:n}:void 0);return{content:l.content,contentType:l.contentType,isTruncated:l.isTruncated,isLoading:a,isRefetching:o,error:d,refetch:u}}e.s(["f",0,w],775570);let N={url:null};function C(e,t,r){let n=(0,j.f)(),i=(r?.enabled??!0)&&!!e&&!!t,{data:l,isLoading:a,isRefetching:o,error:d,refetch:u}=(0,y.f)(i?()=>n.run.getArtifactDownloadUrl((0,b.f)(v.i,{runId:e,storageKey:t})).then(e=>({url:e.downloadUrl||null})):null,[e,t,i,n],N,{cacheKey:t?`artifact-url:${t}`:void 0});return(0,s.useMemo)(()=>({url:l.url,isLoading:a,isRefetching:o,error:d,refetch:u}),[l.url,a,o,d,u])}function M(e){let t=L(e.before),r=L(e.after),n=w(t?(0,p.K)(t.storageKey):null,t?t.storageKey:null,null,t?.contentHash),i=w(r?(0,p.K)(r.storageKey):null,r?r.storageKey:null,null,r?.contentHash),l=n.isTruncated||i.isTruncated,a=r??t,{url:o}=C(a?(0,p.K)(a.storageKey):null,a?a.storageKey:null,{enabled:l});return(0,s.useMemo)(()=>({beforeText:S(e.before,n.content),afterText:S(e.after,i.content),isBinary:!!(e.before?.isBinary||e.after?.isBinary),isLoading:n.isLoading||i.isLoading,error:n.error??i.error,isTruncated:l,downloadUrl:o}),[e.before,e.after,n.content,i.content,n.isLoading,i.isLoading,n.error,i.error,l,o])}function L(e){return!e||e.isBinary?null:"ref"===e.body.case?e.body.value:null}function S(e,t){return!e||e.isBinary?"":"inline"===e.body.case?e.body.value:t}function A({change:e,hunks:s,isBinary:r,isLoading:i,error:a,isTruncated:o,downloadUrl:d,bodyClassName:u,bounded:g}){let c,f="added"===e.changeType?"empty-create":"no-preview";return r?(0,t.jsx)($,{children:"Binary file changed."}):o?(0,t.jsxs)($,{children:["This file is too large to diff inline."," ",d&&(0,t.jsx)("a",{href:d,target:"_blank",rel:"noreferrer",className:"stg:font-medium stg:text-primary stg:underline-offset-2 stg:hover:underline stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring",children:"Download the full file"})]}):i?(0,t.jsx)($,{children:"Loading diff…"}):a?(0,t.jsx)($,{variant:"error",children:"Could not load this file's contents."}):0===s.length?(0,t.jsx)(h,{kind:f,className:u}):(c=(0,t.jsx)(l.f,{hunks:s,className:u}),g?(0,t.jsx)(n.f,{cursorTarget:"file-diff-expand",children:c}):c)}function $({children:e,variant:s="muted"}){return(0,t.jsx)("div",{role:"status",className:(0,r.f)("stg:rounded-md stg:border stg:border-border stg:bg-muted-subtle stg:px-3 stg:py-2 stg:text-xs","error"===s?"stg:text-destructive":"stg:text-muted-foreground"),children:e})}e.s(["f",0,C],651427),e.s(["f",0,M],57841),e.s(["f",0,function({change:e,className:n,bodyClassName:l,bounded:o=!1,showFileName:d=!0,showStats:u=!0}){let{beforeText:g,afterText:f,isBinary:m,isLoading:x,error:h,isTruncated:p,downloadUrl:b}=M(e),v=(0,s.useMemo)(()=>null===g||null===f?[]:(0,i.f)(g,f),[g,f]),j=(0,s.useMemo)(()=>{let t=(0,a.L)(v);return t.additions>0||t.deletions>0?t:{additions:e.linesAdded,deletions:e.linesRemoved}},[e.linesAdded,e.linesRemoved,v]),y=u&&(j.additions>0||j.deletions>0);return(0,t.jsxs)("div",{className:(0,r.f)("stg:flex stg:flex-col stg:gap-1.5",n),"data-cursor-target":"file-diff",children:[(d||y)&&(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-2 stg:text-xs stg:text-muted-foreground",children:[d&&"renamed"===e.changeType&&e.renameFrom&&(0,t.jsxs)("span",{className:"stg:min-w-0 stg:truncate stg:font-mono stg:text-muted-foreground-faint",children:[e.renameFrom," →"]}),d&&(0,t.jsx)(c,{path:e.path,dirDisplay:"dim",className:"stg:text-xs"}),y&&(0,t.jsxs)("span",{className:"stg:shrink-0 stg:tabular-nums",children:[(0,t.jsxs)("span",{className:"stg:text-diff-added-fg",children:["+",j.additions]})," ",(0,t.jsxs)("span",{className:"stg:text-diff-removed-fg",children:["-",j.deletions]})]})]}),(0,t.jsx)(A,{change:e,hunks:v,isBinary:m,isLoading:x,error:h,isTruncated:p,downloadUrl:b,bodyClassName:l,bounded:o})]})}],353799)},740886,687523,568039,465722,770166,364949,863714,e=>{"use strict";var t=e.i(974265),s=e.i(651023);e.i(146696);var r=e.i(644731),n=e.i(893976),i=e.i(61855),l=e.i(394327);let a=(0,s.memo)(function({mode:e,className:s}){return e!==l.H.PLAN?null:(0,t.jsxs)("span",{role:"status","aria-label":"Plan mode",className:(0,n.f)("stg:inline-flex stg:items-center stg:gap-1 stg:rounded-md stg:px-1.5 stg:py-0.5 stg:text-2xs stg:font-medium","stg:bg-accent stg:text-muted-foreground",s),children:[(0,t.jsx)(o,{}),"Plan"]})});function o(){return(0,t.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:(0,t.jsx)("path",{d:"M2 3h8M2 6h5M2 9h6"})})}var d=e.i(309826),u=e.i(209803),g=e.i(933221),c=e.i(188482),f=e.i(364802),m=e.i(14480);let x=[],h=new WeakMap;function p({files:e,runId:r,className:i}){let[l,a]=(0,s.useState)(null),o=void 0!==r,d=null!==l?e.find(e=>e.fileId===l)??null:null;return 0===e.length?null:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:(0,n.f)("stg:flex stg:flex-wrap stg:items-center stg:gap-1.5",i),role:"list","aria-label":"Files sent with this message",children:e.map((e,s)=>{let r=e.fileId??`${e.filename??"file"}-${s}`;if("image"===e.kind&&o&&e.fileId){let s=e.fileId;return(0,t.jsx)(v,{view:e,fileId:s,onPreview:()=>a(s)},r)}return"image"===e.kind?(0,t.jsx)(j,{name:e.filename??"image"},r):(0,t.jsx)(y,{view:e,live:o},r)})}),d?.fileId&&(0,t.jsx)(k,{view:d,fileId:d.fileId,onClose:()=>a(null)})]})}function b(e,t){let{file:s}=(0,u.V)(t?e.fileId??null:null),r=s?.spec?.filename||e.filename||"file",n=s?.status?.sizeBytes;return{name:r,sizeBytes:void 0!==n?Number(n):null}}function v({view:e,fileId:s,onPreview:r}){let{url:i,error:l}=(0,u.f)(s),{name:a}=b(e,!0);return l?(0,t.jsx)(y,{view:e,live:!0}):(0,t.jsxs)(c.W,{children:[(0,t.jsx)(c.y,{render:(0,t.jsx)("span",{role:"listitem","aria-label":a,className:"stg:inline-flex"}),children:(0,t.jsx)("button",{type:"button",onClick:r,"aria-label":`Preview ${a}`,className:(0,n.f)(g.s,"stg:relative stg:block stg:h-14 stg:w-14 stg:overflow-hidden stg:rounded-md stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring"),children:i?(0,t.jsx)("img",{src:i,alt:"","aria-hidden":"true",loading:"lazy",className:"stg:h-full stg:w-full stg:object-cover"}):(0,t.jsx)("span",{className:"stg:block stg:h-full stg:w-full stg:animate-pulse stg:bg-muted","aria-hidden":"true"})})}),(0,t.jsx)(c.Y,{side:"top",className:"stg:break-all",children:a})]})}function j({name:e}){return(0,t.jsxs)(c.W,{children:[(0,t.jsx)(c.y,{render:(0,t.jsx)("span",{role:"listitem","aria-label":e,className:"stg:inline-flex stg:h-14 stg:w-14 stg:items-center stg:justify-center stg:rounded-md stg:bg-muted-subtle"}),children:(0,t.jsx)(w,{})}),(0,t.jsx)(c.Y,{side:"top",className:"stg:break-all",children:e})]})}function y({view:e,live:s}){let{download:r,isDownloading:i}=(0,u.G)(),{name:l,sizeBytes:a}=b(e,s),o=s?e.fileId:void 0,d=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(N,{}),(0,t.jsx)(f.f,{text:l,className:"stg:min-w-0"}),null!==a&&(0,t.jsx)("span",{className:"stg:shrink-0 stg:text-muted-foreground",children:(0,m.f)(a)})]});return(0,t.jsx)("span",{role:"listitem","aria-label":l,className:"stg:inline-flex stg:max-w-[200px] stg:items-center stg:rounded-md stg:bg-muted-subtle stg:px-2 stg:py-0.5 stg:text-xs stg:text-foreground",children:o?(0,t.jsx)("button",{type:"button",onClick:()=>void r(o,l),disabled:i,"aria-label":`Download ${l}`,className:(0,n.f)(g.s,"stg:flex stg:min-w-0 stg:items-center stg:gap-1 stg:rounded-sm stg:hover:text-accent-foreground stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring",i&&"stg:opacity-70"),children:d}):(0,t.jsx)("span",{className:"stg:flex stg:min-w-0 stg:items-center stg:gap-1",children:d})})}function k({view:e,fileId:s,onClose:r}){let{url:n}=(0,u.f)(s),{name:i}=b(e,!0);return(0,t.jsx)(d.f,{src:n,filename:i,open:!0,onClose:r})}function w(){return(0,t.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:"stg:shrink-0 stg:text-muted-foreground","aria-hidden":"true",children:[(0,t.jsx)("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),(0,t.jsx)("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),(0,t.jsx)("path",{d:"M21 15l-5-5L5 21"})]})}function N(){return(0,t.jsxs)("svg",{width:"10",height:"10",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:"stg:shrink-0 stg:text-muted-foreground","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M8 1H4C3.45 1 3 1.45 3 2V12C3 12.55 3.45 13 4 13H10C10.55 13 11 12.55 11 12V4L8 1Z"}),(0,t.jsx)("path",{d:"M8 1V4H11"})]})}e.s(["e",0,p,"F",0,function(e){if(0===e.length)return x;let t=h.get(e);if(t)return t;let s=e.flatMap(e=>{let t=e.source?.type==="file"?e.source.fileId:"";return t?[{fileId:t,filename:e.title||void 0,kind:"image"===e.type?"image":"document"}]:[]});return h.set(e,s),s}],687523);let C=(0,s.memo)(function({content:e,className:l}){let{title:a,body:o}=(0,s.useMemo)(()=>(0,i.w)((0,i.B)(e,!0)),[e]);return(0,t.jsx)("div",{role:"article","aria-label":"Plan document",className:(0,n.f)("stg:mx-4",l),children:(0,t.jsxs)("div",{className:"stg:overflow-hidden stg:rounded-lg stg:border stg:border-border-muted stg:bg-card",children:[(0,t.jsxs)("header",{className:"stg:flex stg:items-center stg:gap-2 stg:border-b stg:border-border-muted stg:bg-muted-faint stg:px-4 stg:py-2.5",children:[(0,t.jsx)(M,{}),(0,t.jsx)("span",{className:"stg:min-w-0 stg:flex-1 stg:truncate stg:text-sm stg:font-semibold stg:text-foreground",children:a??"Plan"})]}),(0,t.jsx)("div",{className:"stgm-prose stg:px-4 stg:py-4",children:(0,t.jsx)(r.f,{components:i.r,isAnimating:!1,children:o})})]})})});function M(){return(0,t.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:"stg:shrink-0 stg:text-muted-foreground","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M3 4h10M3 8h7M3 12h8"}),(0,t.jsx)("path",{d:"M12.5 10.5l1.5 1.5-1.5 1.5"})]})}var L=e.i(282838),S=e.i(193799);let A=(0,s.memo)(function({message:e,className:s,onEdit:r,isPlanDocument:n,interactionMode:i,files:l,runId:a,actions:o}){switch((0,L.f)("MessageEntry",{messageType:e.kind,contentLength:e.text.length,isStreaming:"user"!==e.kind&&"note"!==e.kind&&e.live}),e.kind){case"user":return(0,t.jsx)($,{content:e.text,className:s,onEdit:r,interactionMode:i,files:l,executionId:a});case"message":if(n)return(0,t.jsx)(C,{content:e.text,className:s});return(0,t.jsx)(T,{content:e.text,isStreaming:e.live,className:s,actions:o});case"thinking":return(0,t.jsx)(E,{content:e.text,isStreaming:e.live,className:s});case"note":return(0,t.jsx)(W,{content:e.text,className:s})}});function $({content:e,className:s,onEdit:r,interactionMode:i,files:l,executionId:o}){return(0,t.jsxs)("div",{role:"article","aria-label":"User message",className:(0,n.f)("stg:group stg:relative stg:ms-[20%] stg:rounded-lg stg:bg-muted-subtle stg:px-4 stg:py-3",s),children:[void 0!==i&&(0,t.jsx)(a,{mode:i,className:"stg:mb-1.5"}),l&&l.length>0&&(0,t.jsx)(p,{files:l,runId:o,className:"stg:mb-2"}),(0,t.jsx)("p",{className:"stg:text-sm stg:text-foreground stg:whitespace-pre-wrap",children:e}),(0,t.jsxs)("div",{className:"stg:absolute stg:-top-2.5 stg:-right-2.5 stg:flex stg:gap-1",children:[(0,t.jsx)(F,{text:e,variant:"bubble"}),r&&(0,t.jsxs)(c.W,{children:[(0,t.jsx)(c.y,{render:(0,t.jsx)("button",{type:"button",onClick:r,"aria-label":"Edit message",className:I}),children:(0,t.jsx)(_,{})}),(0,t.jsx)(c.Y,{side:"top",children:"Edit"})]})]})]})}function _(){return(0,t.jsxs)("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M12 20h9"}),(0,t.jsx)("path",{d:"M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4Z"})]})}function T({content:e,isStreaming:l,className:a,actions:o}){(0,L.f)("AiMessage",{contentLength:e.length,isStreaming:l});let d=(0,s.useMemo)(()=>(0,i.B)(e),[e]);return(0,t.jsxs)("div",{role:"article","aria-label":"AI response","aria-busy":l,className:(0,n.f)("stg:group stg:px-4 stg:py-3",a),children:[(0,t.jsx)("div",{className:"stgm-prose",children:(0,t.jsx)(r.f,{components:i.u,isAnimating:l,caret:"block",children:d})}),!l&&d.trim().length>0&&(0,t.jsxs)("div",{className:"stg:mt-1 stg:flex stg:min-h-6 stg:items-start stg:gap-1",children:[(0,t.jsx)(F,{text:d,variant:"quiet"}),o]})]})}let I=(0,n.f)("stg:inline-flex stg:h-7 stg:w-7 stg:items-center stg:justify-center stg:rounded-full","stg:border stg:border-border stg:bg-card stg:text-muted-foreground stg:shadow-sm stg:transition","stg:hover:text-foreground stg:hover:bg-accent-hover","stg:opacity-0 stg:group-hover:opacity-100 stg:focus-visible:opacity-100","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring"),R=(0,n.f)("stg:inline-flex stg:h-6 stg:w-6 stg:items-center stg:justify-center stg:rounded-md","stg:text-muted-foreground-subtle stg:transition","stg:hover:text-muted-foreground stg:hover:bg-accent-hover","stg:opacity-0 stg:group-hover:opacity-100 stg:focus-visible:opacity-100","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring");function F({text:e,variant:s}){let{copy:r,copied:n}=(0,S.f)();return(0,t.jsxs)(c.W,{children:[(0,t.jsx)(c.y,{render:(0,t.jsx)("button",{type:"button",onClick:()=>void r(e),"aria-label":n?"Copied":"Copy message",className:"bubble"===s?I:R}),children:n?(0,t.jsx)(U,{}):(0,t.jsx)(B,{})}),(0,t.jsx)(c.Y,{side:"top",children:n?"Copied":"Copy"})]})}function B(){return(0,t.jsxs)("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,t.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2"}),(0,t.jsx)("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})}function U(){return(0,t.jsx)("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M20 6 9 17l-5-5"})})}function E({content:e,isStreaming:r,className:i}){let[l,a]=(0,s.useState)(!1),o=e.trim().length>0;if(!o&&!r)return null;let d=e.length>80?e.slice(0,80).trimEnd()+"...":e;return(0,t.jsxs)("div",{role:"article","aria-label":"Model thinking",className:(0,n.f)("stg:px-4 stg:py-1.5",i),children:[(0,t.jsxs)("button",{type:"button","aria-expanded":l,onClick:()=>a(e=>!e),className:(0,n.f)("stg:flex stg:items-center stg:gap-1.5 stg:text-xs stg:text-muted-foreground stg:transition-colors","stg:hover:text-foreground stg:cursor-pointer"),children:[(0,t.jsx)(P,{isStreaming:r}),(0,t.jsx)("span",{className:(0,n.f)("stg:min-w-0 stg:truncate",r&&"stgm-shimmer-label"),children:r&&!o?"Thinking...":l?"Thinking":d}),o&&(0,t.jsx)(D,{expanded:l})]}),l&&o&&(0,t.jsx)("div",{className:"stg:mt-1.5 stg:border-l-2 stg:border-muted-foreground/20 stg:pl-3",children:(0,t.jsxs)("p",{className:"stg:text-xs stg:text-muted-foreground stg:whitespace-pre-wrap stg:leading-relaxed",children:[e,r&&(0,t.jsx)("span",{className:"stg:inline-block stg:w-[2px] stg:h-[0.8em] stg:bg-muted-foreground stg:align-text-bottom stg:animate-pulse stg:ml-0.5","aria-hidden":"true"})]})})]})}function W({content:e,className:s}){return(0,t.jsx)("div",{role:"article","aria-label":"System message",className:(0,n.f)("stg:px-4 stg:py-2",s),children:(0,t.jsx)("p",{className:"stg:text-xs stg:text-muted-foreground stg:italic",children:e})})}function P({isStreaming:e}){return e?(0,t.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"stg:shrink-0 stg:animate-spin","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M6 1.5A4.5 4.5 0 1 1 1.5 6",strokeLinecap:"round"})}):(0,t.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:"stg:shrink-0","aria-hidden":"true",children:[(0,t.jsx)("circle",{cx:"6",cy:"5",r:"3.5"}),(0,t.jsx)("path",{d:"M4.5 9.5C4.5 8.5 5 8 6 8s1.5.5 1.5 1.5"}),(0,t.jsx)("circle",{cx:"5",cy:"4.5",r:"0.5",fill:"currentColor"}),(0,t.jsx)("circle",{cx:"7",cy:"4.5",r:"0.5",fill:"currentColor"})]})}function D({expanded:e}){return(0,t.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:(0,n.f)("stg:shrink-0 stg:transition-transform stg:duration-150",e&&"stg:rotate-90"),"aria-hidden":"true",children:(0,t.jsx)("path",{d:"M3.5 2L6.5 5L3.5 8"})})}e.s(["f",0,A],740886);var O=e.i(869803),H=e.i(891287),K=e.i(31994),V=e.i(170255),z=e.i(976676),q=e.i(255817),J=e.i(745176);let G=(0,n.f)("stg:inline-flex stg:h-7 stg:items-center stg:rounded-md stg:border stg:border-border stg:px-2 stg:text-xs stg:text-foreground stg:transition","stg:hover:bg-accent-hover","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring","stg:disabled:cursor-not-allowed stg:disabled:opacity-50");function Y({runId:e,org:r}){let i=(0,q.f)(),{evals:l,isLoading:a,error:o,hasMore:d,loadMore:u,isLoadingMore:g,loadMoreError:c}=(0,z.f)(r),[f,m]=(0,s.useState)(""),[x,h]=(0,s.useState)(!1),[p,b]=(0,s.useState)(null),[v,j]=(0,s.useState)([]),[y,k]=(0,s.useState)(null),w=""!==f?f:l[0]?.metadata?.id??"",N=async e=>{h(!0),k(null),b(null);try{await e()}catch(e){k(e instanceof Error?e.message:String(e))}finally{h(!1)}};return(0,t.jsxs)("div",{role:"group","aria-label":"Make a test case",className:"stg:flex stg:flex-col stg:gap-2 stg:rounded-md stg:border stg:border-border stg:p-2 stg:text-xs stg:text-muted-foreground",children:[(0,t.jsx)("p",{children:"A test case from this answer: its request, the conversation before it and the answers its tools gave, with a rubric to fill in."}),(0,t.jsxs)("div",{className:"stg:flex stg:flex-wrap stg:items-center stg:gap-2",children:[(0,t.jsx)("button",{type:"button",disabled:x,onClick:()=>void N(async()=>{let t=await i.eval.buildCaseFromRun((0,H.f)(K.c,{runId:e}));(0,J._)(t.artifact,`${t.caseName}.zip`,"application/zip"),j(t.notes),b(`Downloaded ${t.caseName}.zip. Unzip it into an evals/ folder and fill in its rubric.`)}),className:G,children:"Download the case folder"}),l.length>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("select",{"aria-label":"Eval",value:w,disabled:x,onChange:e=>m(e.target.value),className:"stg:h-7 stg:rounded-md stg:border stg:border-border stg:bg-background stg:px-1 stg:text-xs stg:text-foreground",children:l.map(e=>(0,t.jsx)("option",{value:e.metadata?.id??"",children:e.metadata?.slug},e.metadata?.id))}),(0,t.jsx)("button",{type:"button",disabled:x,onClick:()=>void N(async()=>{let t=await i.eval.addCaseFromRun((0,H.f)(K.Z,{runId:e,eval:{kind:V.X.eval,org:r,id:w}}));j([]),b(`Added to ${t.metadata?.slug??"the eval"} as a new version.`)}),className:G,children:"Add to eval"})]}),d&&(0,t.jsx)("button",{type:"button",disabled:g,onClick:u,className:G,children:"Load more evals"})]}),a?(0,t.jsx)("p",{children:"Loading the organization's evals…"}):null!==o?(0,t.jsxs)("p",{role:"alert",className:"stg:text-destructive",children:["The organization's evals could not be listed: ",o.message]}):l.length>0?(0,t.jsx)("p",{children:"Everyone who can read the eval will see this conversation."}):(0,t.jsx)("p",{children:"No evals in this organization yet: push one with stigmer push eval to add cases to it here."}),null!==c&&(0,t.jsxs)("p",{role:"alert",className:"stg:text-destructive",children:["More evals could not be listed: ",c.message]}),null!==p&&(0,t.jsx)("p",{role:"status",children:p}),v.length>0&&(0,t.jsx)("ul",{"aria-label":"What the case leaves out",className:(0,n.f)(O.J,"stg:flex stg:flex-col stg:gap-0.5"),children:v.map(e=>(0,t.jsx)("li",{children:e},e))}),null!==y&&(0,t.jsx)("p",{role:"alert",className:"stg:text-destructive",children:y})]})}var Z=e.i(51427),X=e.i(29168),Q=e.i(934149),ee=e.i(766330),et=e.i(616701);let es=[],er=(0,s.createContext)(null),en=(0,s.createContext)(!1);function ei(){return(0,s.useContext)(er)}let el=[750,1500,3e3],ea=[];e.s(["j",0,function({runs:e,children:r}){var n,i,a;let o,d,u,g,{scores:c,refetch:f}=function(e){var t,r;let n,i,l,a=(0,q.f)(),{data:o,isLoading:d,isRefetching:u,error:g,refetch:c}=(0,et.f)(e?()=>(0,ee.a)(t=>a.score.listBySession((0,H.f)(Q.x,{sessionId:e,pageSize:ee.J,pageToken:t}))):null,[e,a],es);return t=o,r=c,n=t.some(X.c),i=(0,s.useRef)(null),l=(0,s.useRef)(0),(0,s.useEffect)(()=>{if(!n){i.current=null,l.current=0;return}let e=Date.now();if(i.current??=e,e-i.current>18e4)return;let t=Math.min(2e3*2**l.current,15e3);l.current+=1;let s=setTimeout(r,t);return()=>clearTimeout(s)},[t,n,r]),(0,s.useMemo)(()=>({scores:o,isLoading:d,isRefetching:u,error:g,refetch:c}),[o,d,u,g,c])}(function(e){for(let t of e){let e=t.spec?.target;if(e?.case==="sessionId"&&""!==e.value)return e.value}return null}(e)),{account:m}=(0,Z.f)(),x=(0,s.useMemo)(()=>(0,X.j)(c),[c]),h=(0,s.useMemo)(()=>{let t=new Map;for(let s of e){let e=s.metadata?.id??"";""!==e&&t.set(e,s.metadata?.org??"")}return t},[e]),p=(0,s.useMemo)(()=>{let t=new Map;for(let s of e){let e=s.metadata?.id??"";""!==e&&t.set(e,s.spec?.message??"")}return t},[e]),b=(0,s.useMemo)(()=>null===m?null:{accountId:m.metadata?.id??"",subject:m.spec?.idpId??""},[m]);n=e,i=x,a=f,o=(0,s.useRef)(new Map),d=(0,s.useRef)(new Set),u=(0,s.useRef)([]),g=(0,s.useRef)(i),(0,s.useEffect)(()=>{g.current=i},[i]),(0,s.useEffect)(()=>{for(let e of n){let t=e.metadata?.id??"";if(""===t)continue;let s=e.status?.phase??l.A.RUN_PHASE_UNSPECIFIED,r=o.current.get(t);if(o.current.set(t,s),void 0!==r&&r!==l.A.RUN_COMPLETED&&s===l.A.RUN_COMPLETED)for(let e of(d.current.add(t),el))u.current.push(setTimeout(()=>{let e=g.current.get(t)??ea;void 0!==(0,X.I)(e)&&void 0!==(0,X.$)(e)?d.current.delete(t):d.current.has(t)&&a()},e))}},[n,a]),(0,s.useEffect)(()=>{let e=u.current;return()=>{for(let t of e)clearTimeout(t)}},[]);let v=(0,s.useMemo)(()=>({scoresOf:e=>x.get(e)??ea,orgOf:e=>h.get(e)??"",requestOf:e=>p.get(e)??"",viewer:b,refetch:f}),[x,h,p,b,f]);return(0,t.jsx)(en.Provider,{value:!0,children:(0,t.jsx)(er.Provider,{value:v,children:r})})},"b",0,ei,"O",0,function(){return(0,s.useContext)(en)}],568039);var eo=e.i(815453);let ed=["spec.passed","spec.comment"];var eu=e.i(610595),eg=e.i(781836);let ec=(0,n.f)("stg:inline-flex stg:h-6 stg:w-6 stg:items-center stg:justify-center stg:rounded-md stg:transition","stg:hover:text-muted-foreground stg:hover:bg-accent-hover","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring","stg:disabled:cursor-not-allowed");function ef({up:e,pressed:s,disabled:r,onClick:i}){return(0,t.jsx)("button",{type:"button","aria-label":e?"Good answer":"Bad answer","aria-pressed":s,disabled:r,onClick:i,className:(0,n.f)(ec,s?"stg:text-foreground":"stg:text-muted-foreground-subtle stg:opacity-0 stg:group-hover:opacity-100 stg:focus-visible:opacity-100"),children:(0,t.jsx)(ej,{up:e})})}function em({view:e}){let[r,i]=(0,s.useState)(!1);if("pending"===e.kind||"healthy"===e.kind)return null;if("not-graded"===e.kind)return(0,t.jsxs)("span",{className:"stg:ml-1 stg:text-xs stg:text-muted-foreground-subtle",children:["Not graded",""!==e.reason?`: ${e.reason}`:""]});let l=`${e.flags.length} ${1===e.flags.length?"flag":"flags"}`;return(0,t.jsxs)("span",{className:"stg:ml-1 stg:inline-flex stg:flex-col stg:gap-1",children:[(0,t.jsx)("button",{type:"button","aria-expanded":r,onClick:()=>i(e=>!e),className:(0,n.f)("stg:inline-flex stg:h-6 stg:items-center stg:rounded-full stg:border stg:border-border stg:px-2 stg:text-xs stg:text-status-degraded","stg:hover:bg-accent-hover stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring"),children:l}),r&&(0,t.jsx)("ul",{className:(0,n.f)(O.J,"stg:flex stg:flex-col stg:gap-0.5 stg:text-xs stg:text-muted-foreground"),children:e.flags.map(e=>(0,t.jsx)("li",{children:""!==e.reason?e.reason:e.name},e.name))})]})}let ex={"did-the-task":"Did the task","made-nothing-up":"Made nothing up","acted-only-as-asked":"Did only what was asked","asked-when-unclear":"Asked when unclear"},eh={[eo.a.unspecified]:"",[eo.a.passed]:"passed",[eo.a.failed]:"failed",[eo.a.not_applicable]:"not applicable"};function ep({view:e}){let[r,i]=(0,s.useState)(!1);if("none"===e.kind)return null;if("grading"===e.kind)return(0,t.jsx)("span",{role:"status",className:"stg:ml-1 stg:text-xs stg:text-muted-foreground-subtle",children:"Judge: grading…"});if("not-graded"===e.kind)return(0,t.jsxs)("span",{className:"stg:ml-1 stg:text-xs stg:text-muted-foreground-subtle",children:["Judge: not graded",""!==e.reason?`: ${e.reason}`:""]});let l=e.passed?"Judge: passed":`Judge: ${e.failed} of ${e.criteria.length} failed`;return(0,t.jsxs)("span",{className:"stg:ml-1 stg:inline-flex stg:flex-col stg:gap-1",children:[(0,t.jsx)("button",{type:"button","aria-expanded":r,onClick:()=>i(e=>!e),className:(0,n.f)("stg:inline-flex stg:h-6 stg:items-center stg:rounded-full stg:border stg:border-border stg:px-2 stg:text-xs",e.passed?"stg:text-muted-foreground":"stg:text-status-degraded","stg:hover:bg-accent-hover stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring"),children:l}),r&&(0,t.jsxs)("ul",{className:(0,n.f)(O.J,"stg:flex stg:flex-col stg:gap-0.5 stg:text-xs stg:text-muted-foreground"),children:[e.criteria.map(e=>(0,t.jsxs)("li",{children:[ex[e.name]??e.name,":"," ",eh[e.result],""!==e.reason?` — ${e.reason}`:""]},e.name)),""!==e.model&&(0,t.jsxs)("li",{className:"stg:text-muted-foreground-subtle",children:["Graded by ",e.model]})]})]})}function eb({view:e}){let[r,i]=(0,s.useState)(!1);if("none"===e.kind)return null;if("not-graded"===e.kind)return(0,t.jsxs)("span",{className:"stg:ml-1 stg:text-xs stg:text-muted-foreground-subtle",children:["Eval: not graded",""!==e.reason?`: ${e.reason}`:""]});let l=e.passed?"Eval: passed":`Eval: ${e.failed} of ${e.criteria.length} failed`;return(0,t.jsxs)("span",{className:"stg:ml-1 stg:inline-flex stg:flex-col stg:gap-1",children:[(0,t.jsx)("button",{type:"button","aria-expanded":r,onClick:()=>i(e=>!e),className:(0,n.f)("stg:inline-flex stg:h-6 stg:items-center stg:rounded-full stg:border stg:border-border stg:px-2 stg:text-xs",e.passed?"stg:text-muted-foreground":"stg:text-status-degraded","stg:hover:bg-accent-hover stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring"),children:l}),r&&(0,t.jsx)("ul",{className:(0,n.f)(O.J,"stg:flex stg:flex-col stg:gap-0.5 stg:text-xs stg:text-muted-foreground"),children:e.criteria.map(e=>(0,t.jsxs)("li",{children:[e.name,": ",eh[e.result],""!==e.reason?` — ${e.reason}`:""]},e.name))})]})}function ev({open:e,onToggle:s}){return(0,t.jsx)("button",{type:"button","aria-expanded":e,onClick:s,className:(0,n.f)("stg:ml-1 stg:inline-flex stg:h-6 stg:items-center stg:rounded-md stg:px-2 stg:text-xs stg:transition","stg:hover:bg-accent-hover stg:hover:text-foreground","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring",e?"stg:text-muted-foreground":"stg:text-muted-foreground-subtle stg:opacity-0 stg:group-hover:opacity-100 stg:focus-visible:opacity-100"),children:"Make a test case"})}function ej({up:e}){return(0,t.jsxs)("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:e?void 0:"stg:rotate-180",children:[(0,t.jsx)("path",{d:"M7 10v12"}),(0,t.jsx)("path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z"})]})}e.s(["f",0,function({runId:e,className:r}){let i=ei(),{rateRun:l,isRating:a,error:o}=function(){let e=(0,q.f)(),[t,r]=(0,s.useState)(!1),[n,i]=(0,s.useState)(null),l=(0,s.useCallback)(()=>i(null),[]),a=(0,s.useCallback)(async t=>{r(!0),i(null);try{var s;try{return await e.score.create({name:"",org:t.org,runId:t.runId,metric:X.C,source:eo.j.human,passed:t.passed,comment:t.comment??""})}catch(a){let r=(0,eu.k)(a),n=r?.metadata.score_id??"";if(r?.reason!==X.p||""===n)throw a;let{resource:i,paths:l}=(s=await e.score.get(n),{resource:{metadata:{id:s.metadata?.id??"",etag:s.metadata?.etag??""},spec:{value:{case:"passed",value:t.passed},comment:t.comment??""}},paths:[...ed]});return await e.score.update(i,l)}}catch(e){throw i((0,eg.f)(e)),e}finally{r(!1)}},[e]);return(0,s.useMemo)(()=>({rateRun:a,isRating:t,error:n,clearError:l}),[a,t,n,l])}(),[d,u]=(0,s.useState)(void 0),[g,c]=(0,s.useState)(!1),[f,m]=(0,s.useState)(""),[x,h]=(0,s.useState)(!1);if(null===i)return null;let p=i.scoresOf(e),b=d??(0,X.s)(p,i.viewer),v=(0,X.X)(b),j=(0,X.g)(p),y=(0,X.i)(p),k=(0,X.y)(p),w=i.orgOf(e),N=i.requestOf(e),C=async(t,s)=>{try{let r=await l({org:w,runId:e,passed:t,comment:s});u(r),i.refetch()}catch{}},M=e=>{let t=b?.spec?.comment??"";m(t),c(!0),C(e,t)};return(0,t.jsxs)("div",{className:(0,n.f)("stg:flex stg:flex-col stg:gap-1",r),children:[(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-1",children:[(0,t.jsx)(ef,{up:!0,pressed:!0===v,disabled:a,onClick:()=>M(!0)}),(0,t.jsx)(ef,{up:!1,pressed:!1===v,disabled:a,onClick:()=>M(!1)}),(0,t.jsx)(em,{view:j}),(0,t.jsx)(ep,{view:y}),(0,t.jsx)(eb,{view:k}),""!==N&&(0,t.jsx)(ev,{open:x,onToggle:()=>h(e=>!e)})]}),x&&""!==N&&(0,t.jsx)(Y,{runId:e,org:w}),g&&void 0!==v&&(0,t.jsxs)("form",{onSubmit:e=>{e.preventDefault(),C(v,f.trim()),c(!1)},className:"stg:flex stg:items-center stg:gap-2",children:[(0,t.jsx)("input",{type:"text",value:f,onChange:e=>m(e.target.value),maxLength:500,placeholder:"Add a note (optional)","aria-label":"Note on this answer",disabled:a,className:(0,n.f)("stg:h-7 stg:min-w-0 stg:flex-1 stg:rounded-md stg:border stg:border-border stg:bg-background stg:px-2 stg:text-xs stg:text-foreground","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring")}),(0,t.jsx)("button",{type:"submit",disabled:a,className:"stg:h-7 stg:rounded-md stg:px-2 stg:text-xs stg:text-muted-foreground stg:hover:bg-accent-hover stg:hover:text-foreground",children:"Save"})]}),null!==o&&(0,t.jsx)("p",{role:"alert",className:"stg:text-xs stg:text-destructive",children:o.message})]})}],465722),e.s(["f",0,function(e,t){let[r,n]=(0,s.useState)(t?.initialOpen??e),i=(0,s.useRef)(!1),l=(0,s.useRef)(e);return(0,s.useEffect)(()=>{l.current===e||(l.current=e,i.current||n(e))},[e]),[r,(0,s.useRef)(()=>{i.current=!0,n(e=>!e)}).current]}],770166),e.s(["f",0,function(e){let t=(0,s.useRef)(null),[r,n]=(0,s.useState)(!1);return(0,s.useLayoutEffect)(()=>{if(!e)return void n(e=>!e&&e);let s=t.current;if(!s)return;let r=()=>{let e=s.scrollWidth>s.clientWidth+1;n(t=>t===e?t:e)};r();let i=new ResizeObserver(r);return i.observe(s),()=>i.disconnect()},[e]),{ref:t,isTruncated:r}}],364949);var ey=e.i(422891);let ek={row:"stg:border-b stg:border-border-muted stg:last:border-b-0",quiet:""},ew="stg:relative stg:isolate stg:flex stg:w-full stg:items-center stg:gap-2 stg:px-2.5 stg:py-1.5 stg:text-xs",eN=(0,n.f)("stg:absolute stg:inset-0 stg:z-1 stg:cursor-pointer","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-inset stg:focus-visible:ring-ring");e.s(["b",0,function({id:e,cursorTarget:s,rail:r=!1,children:n}){return(0,t.jsx)("div",{id:e,"data-cursor-target":s,className:r?"stg:ml-1.5 stg:border-l-2 stg:border-border-muted stg:py-1 stg:pl-3 stg:pr-2.5":"stg:px-2.5 stg:pb-2.5 stg:pt-1",children:n})},"A",0,function({gesture:e={kind:"none"},children:s}){if("none"===e.kind)return(0,t.jsx)("div",{className:ew,children:s});let r=(0,t.jsx)("button",{type:"button","aria-label":e.label,"aria-expanded":e.expanded,onClick:e.onToggle,"data-cursor-target":"thread-card-toggle",className:eN});return(0,t.jsxs)("div",{className:(0,n.f)(ew,"stg:transition-colors stg:hover:bg-muted-subtle",e.expanded&&"stg:bg-muted-faint"),children:[(0,t.jsxs)(c.W,{disabled:void 0===e.hint,children:[(0,t.jsx)(c.y,{render:r}),void 0!==e.hint&&(0,t.jsx)(c.Y,{side:"top",className:"stg:break-all",children:e.hint})]}),s,(0,t.jsx)(ey.e,{expanded:e.expanded})]})},"$",0,function({className:e,children:s}){return(0,t.jsx)("span",{className:(0,n.f)("stg:relative stg:z-10",e),children:s})},"J",0,function({variant:e="card",accent:s=null,cursorTarget:r,className:i,ref:l,children:a}){let o="card"===e?(0,n.f)("stg:rounded-lg stg:border stg:border-border-prominent stg:overflow-hidden","warning"===s&&"stg:border-l-2 stg:border-l-warning","destructive"===s&&"stg:border-l-2 stg:border-l-destructive"):ek[e];return(0,t.jsx)("div",{ref:l,"data-cursor-target":r,className:(0,n.f)(o,i),children:a})}],863714)},905630,341698,793322,283393,122801,480751,e=>{"use strict";var t=e.i(974265),s=e.i(651023),r=e.i(394327),n=e.i(170255),i=e.i(504788),l=e.i(803023),a=e.i(781126),o=e.i(893976),d=e.i(128278),u=e.i(740886),g=e.i(465722),c=e.i(568039),f=e.i(687523),m=e.i(264843),x=e.i(916790),h=e.i(899924),p=e.i(335204),b=e.i(992109),v=e.i(682302),j=e.i(490960),y=e.i(389962),k=e.i(290924),w=e.i(361254),N=e.i(656244),C=e.i(212703),M=e.i(299992),L=e.i(251568);let S=(0,s.memo)(function({onImplement:e,disabled:s,className:r}){let n=(0,L.f)(e,s);return e?(0,t.jsxs)("div",{role:"status","aria-label":"Plan complete",onKeyDown:n,className:(0,o.f)("stg:mx-4 stg:flex stg:items-center stg:gap-3 stg:rounded-md stg:border stg:border-border-muted","stg:bg-muted-faint stg:px-3 stg:py-2.5",r),children:[(0,t.jsx)(A,{}),(0,t.jsx)("span",{className:"stg:min-w-0 stg:flex-1 stg:text-xs stg:font-medium stg:text-muted-foreground",children:"Plan complete — ready to build?"}),(0,t.jsxs)("button",{type:"button",disabled:s,onClick:e,className:(0,o.f)("stg:inline-flex stg:items-center stg:gap-1.5 stg:rounded-md stg:px-3 stg:py-1.5","stg:text-xs stg:font-medium stg:transition-colors","stg:bg-primary stg:text-primary-foreground","stg:hover:bg-primary-hover","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring","stg:disabled:pointer-events-none stg:disabled:opacity-50"),children:[(0,t.jsx)($,{}),"Build"]})]}):null});function A(){return(0,t.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:"stg:shrink-0 stg:text-muted-foreground/70","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M3 4h10M3 8h7M3 12h8"}),(0,t.jsx)("path",{d:"M12.5 10.5l1.5 1.5-1.5 1.5"})]})}function $(){return(0,t.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M2 6h8M7 3l3 3-3 3"})})}var _=e.i(891287),T=e.i(487021),I=e.i(188482),R=e.i(193799),F=e.i(255817),B=e.i(209803),U=e.i(354999),E=e.i(14480);let W=(0,s.memo)(function({file:e,title:r,org:n,onImplement:i,onOpenPlan:l,disabled:a,buildPending:d,className:u}){let[g,c]=(0,s.useState)(!1),f=(0,L.f)(i,a),{copy:m,isCopying:x,copied:h}=function(){let e=(0,F.f)(),{copy:t,copied:r}=(0,R.f)(),[n,i]=(0,s.useState)(!1);return{copy:(0,s.useCallback)(async s=>{i(!0);try{let r=await e.file.getContent((0,_.f)(T.W,{id:s}));await t(new TextDecoder().decode(r.data))}catch{}finally{i(!1)}},[e,t]),isCopying:n,copied:r}}(),{download:p,isDownloading:b}=(0,B.G)(),v=e.metadata?.id??"",j=e.spec?.filename??"";return(0,t.jsxs)("div",{role:"region","aria-label":"Plan",onKeyDown:f,className:(0,o.f)("stg:mx-4 stg:flex stg:flex-wrap stg:items-center stg:gap-x-3 stg:gap-y-2 stg:rounded-lg","stg:border stg:border-border-muted stg:bg-card stg:px-3 stg:py-2.5",u),children:[(0,t.jsx)(D,{}),(0,t.jsxs)("div",{className:"stg:min-w-0 stg:flex-1 stg:basis-48",children:[(0,t.jsx)("div",{className:"stg:truncate stg:text-sm stg:font-medium stg:text-foreground",children:r??"Plan"}),(0,t.jsxs)("div",{className:"stg:text-2xs stg:text-muted-foreground-faint",children:[j,(0,t.jsx)("span",{"aria-hidden":"true",children:" · "}),(0,t.jsx)("span",{className:"stg:tabular-nums",children:(0,E.f)(e.status?.sizeBytes??BigInt(0))})]})]}),(0,t.jsxs)("div",{className:"stg:ml-auto stg:flex stg:flex-wrap stg:items-center stg:gap-x-1.5 stg:gap-y-1.5",children:[l?(0,t.jsx)(P,{label:"Open plan",onClick:l,icon:(0,t.jsx)(z,{})}):n&&(0,t.jsx)(P,{label:"Open plan",onClick:()=>c(!0),icon:(0,t.jsx)(z,{})}),(0,t.jsx)(P,{label:h?"Copied":x?"Copying…":"Copy plan",onClick:()=>m(v),disabled:x,icon:h?(0,t.jsx)(V,{}):(0,t.jsx)(K,{})}),(0,t.jsx)(P,{label:b?"Preparing…":`Download ${j}`,onClick:()=>p(v,j),disabled:b,icon:(0,t.jsx)(H,{})}),i&&(0,t.jsxs)("button",{type:"button",disabled:a,onClick:i,className:(0,o.f)("stg:ml-1.5 stg:inline-flex stg:items-center stg:gap-1.5 stg:rounded-md stg:px-3 stg:py-1.5","stg:text-xs stg:font-medium stg:transition-colors","stg:bg-primary stg:text-primary-foreground stg:hover:bg-primary-hover","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring","stg:disabled:pointer-events-none stg:disabled:opacity-50"),children:[(0,t.jsx)(O,{}),d?"Starting build…":"Build"]})]}),(0,t.jsx)("div",{role:"status","aria-live":"polite","aria-atomic":"true",className:"stg:sr-only",children:h&&"Plan copied to clipboard"}),n&&g&&(0,t.jsx)(U.f,{file:e,org:n,isTerminal:!0,open:!0,onClose:()=>c(!1),onImplement:i})]})});function P({label:e,onClick:s,icon:r,disabled:n}){return(0,t.jsxs)(I.W,{children:[(0,t.jsx)(I.y,{render:(0,t.jsx)("span",{className:"stg:inline-flex"}),children:(0,t.jsx)("button",{type:"button","aria-label":e,onClick:s,disabled:n,className:(0,o.f)("stg:inline-flex stg:items-center stg:rounded-md stg:p-1.5 stg:text-muted-foreground","stg:transition-colors stg:hover:bg-accent-hover stg:hover:text-foreground","stg:disabled:pointer-events-none stg:disabled:opacity-50","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring stg:focus-visible:rounded-sm"),children:r})}),(0,t.jsx)(I.Y,{side:"top",children:e})]})}function D(){return(0,t.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:"stg:shrink-0 stg:text-muted-foreground-faint","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M3 4h10M3 8h7M3 12h8"}),(0,t.jsx)("path",{d:"M12.5 10.5l1.5 1.5-1.5 1.5"})]})}function O(){return(0,t.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M2 6h8M7 3l3 3-3 3"})})}function H(){return(0,t.jsxs)("svg",{width:"13",height:"13",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:"stg:shrink-0","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M6 1.5V8.5"}),(0,t.jsx)("path",{d:"M3 6L6 9L9 6"}),(0,t.jsx)("path",{d:"M2 10.5H10"})]})}function K(){return(0,t.jsxs)("svg",{width:"13",height:"13",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round",className:"stg:shrink-0","aria-hidden":"true",children:[(0,t.jsx)("rect",{x:"4",y:"4",width:"6.5",height:"6.5",rx:"1"}),(0,t.jsx)("path",{d:"M8 4V2.5C8 1.95 7.55 1.5 7 1.5H2.5C1.95 1.5 1.5 1.95 1.5 2.5V7C1.5 7.55 1.95 8 2.5 8H4"})]})}function V(){return(0,t.jsx)("svg",{width:"13",height:"13",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:"stg:shrink-0 stg:text-status-ready","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M2 6.5L4.5 9L10 3"})})}function z(){return(0,t.jsxs)("svg",{width:"13",height:"13",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:"stg:shrink-0","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M1.5 8S4 3.5 8 3.5s6.5 4.5 6.5 4.5-2.5 4.5-6.5 4.5S1.5 8 1.5 8Z"}),(0,t.jsx)("circle",{cx:"8",cy:"8",r:"1.75"})]})}let q=(0,s.memo)(function({title:e,sizeBytes:s,onOpenPlan:r,className:n}){return(0,t.jsxs)("div",{role:"region","aria-label":"Plan being written","aria-busy":"true",className:(0,o.f)("stg:mx-4 stg:flex stg:flex-wrap stg:items-center stg:gap-x-3 stg:gap-y-2 stg:rounded-lg","stg:border stg:border-border-muted stg:bg-card stg:px-3 stg:py-2.5",n),children:[(0,t.jsx)(J,{className:"stg:animate-pulse"}),(0,t.jsxs)("div",{className:"stg:min-w-0 stg:flex-1 stg:basis-48",children:[(0,t.jsx)("div",{className:"stg:truncate stg:text-sm stg:font-medium stg:text-foreground",children:e??"Writing plan…"}),(0,t.jsxs)("div",{className:"stg:text-2xs stg:text-muted-foreground-faint",children:[(0,t.jsx)("span",{role:"status",children:"Writing…"}),(0,t.jsx)("span",{"aria-hidden":"true",children:" · "}),(0,t.jsx)("span",{className:"stg:tabular-nums",children:(0,E.f)(s)})]})]}),r&&(0,t.jsxs)("button",{type:"button",onClick:r,className:(0,o.f)("stg:ml-auto stg:inline-flex stg:items-center stg:gap-1 stg:text-xs stg:font-medium stg:text-muted-foreground stg:transition-colors stg:hover:text-foreground","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring stg:focus-visible:rounded-sm"),children:[(0,t.jsx)(G,{}),"Open plan"]})]})});function J({className:e}){return(0,t.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:(0,o.f)("stg:shrink-0 stg:text-muted-foreground-faint",e),"aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M3 4h10M3 8h7M3 12h8"}),(0,t.jsx)("path",{d:"M12.5 10.5l1.5 1.5-1.5 1.5"})]})}function G(){return(0,t.jsxs)("svg",{width:"11",height:"11",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:"stg:shrink-0","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M1.5 8S4 3.5 8 3.5s6.5 4.5 6.5 4.5-2.5 4.5-6.5 4.5S1.5 8 1.5 8Z"}),(0,t.jsx)("circle",{cx:"8",cy:"8",r:"1.75"})]})}var Y=e.i(282838),Z=e.i(770166),X=e.i(869803);let Q={in_progress:0,pending:1,completed:2,cancelled:3};function ee({todos:e,className:r,TodoRow:n=et}){let i=(0,s.useMemo)(()=>e.slice().sort((e,t)=>Q[e.status]-Q[t.status]),[e]);return 0===i.length?null:(0,t.jsx)("ul",{role:"list",className:(0,o.f)(X.J,"stg:flex stg:flex-col stg:gap-1",r),"aria-label":"Tasks",children:i.map(e=>(0,t.jsx)(n,{item:e},e.id))})}function et({item:e}){let s=es[e.status],r=er[e.status],n="cancelled"===e.status;return(0,t.jsxs)("li",{className:"stg:flex stg:items-start stg:gap-1.5 stg:text-xs",children:[(0,t.jsx)("span",{className:(0,o.f)("stg:mt-0.5 stg:shrink-0",r),"aria-hidden":"true",children:(0,t.jsx)(s,{})}),(0,t.jsx)("span",{className:(0,o.f)("stg:min-w-0 stg:break-words",n?"stg:text-muted-foreground stg:line-through":"stg:text-foreground"),children:e.content})]})}let es={pending:function(){return(0,t.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:(0,t.jsx)("circle",{cx:"6",cy:"6",r:"4.5"})})},in_progress:function(){return(0,t.jsxs)("span",{className:"stg:relative stg:flex stg:h-3 stg:w-3 stg:items-center stg:justify-center",children:[(0,t.jsx)("span",{className:"stg:absolute stg:inline-flex stg:h-2 stg:w-2 stg:animate-ping stg:rounded-full stg:bg-current stg:opacity-75"}),(0,t.jsx)("span",{className:"stg:relative stg:inline-flex stg:h-2 stg:w-2 stg:rounded-full stg:bg-current"})]})},completed:function(){return(0,t.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,t.jsx)("path",{d:"M2.5 6L5 8.5L9.5 3.5"})})},cancelled:function(){return(0,t.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,t.jsx)("path",{d:"M3 3L9 9M9 3L3 9"})})}},er={pending:"stg:text-muted-foreground",in_progress:"stg:text-foreground",completed:"stg:text-status-ready",cancelled:"stg:text-muted-foreground"},en=(0,s.memo)(function({todos:e,className:r,TodoRow:n}){(0,Y.f)("TodoCard",{todos:e});let i=e.length,l=null!=(e.find(e=>"in_progress"===e.status)??null),a=function(e){if(0===e.length)return null;let t=e.filter(e=>"completed"===e.status).length;return`${t}/${e.length} completed`}(e),d=(0,s.useMemo)(()=>i>0&&e.every(e=>"completed"===e.status||"cancelled"===e.status),[e,i]),[u,g]=(0,Z.f)(l);return 0===i?null:(0,t.jsxs)("div",{role:"region","aria-label":"Agent to-dos","data-cursor-target":"todo-card",className:(0,o.f)("stg:rounded-lg stg:border stg:border-border-prominent stg:overflow-hidden",r),children:[(0,t.jsxs)("button",{type:"button","aria-expanded":u,onClick:g,className:(0,o.f)("stg:flex stg:w-full stg:cursor-pointer stg:items-center stg:gap-2 stg:px-2.5 stg:py-1.5 stg:text-left stg:text-xs stg:text-muted-foreground stg:transition-colors","stg:hover:bg-muted-subtle","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-inset stg:focus-visible:ring-ring"),children:[(0,t.jsx)("span",{className:(0,o.f)("stg:shrink-0",d?"stg:text-status-ready":"stg:text-muted-foreground"),"aria-hidden":"true",children:(0,t.jsx)(ei,{})}),(0,t.jsx)("span",{className:"stg:min-w-0 stg:flex-1 stg:truncate stg:font-medium stg:text-foreground",children:"To-dos"}),a&&(0,t.jsx)("span",{className:"stg:shrink-0 stg:tabular-nums stg:text-muted-foreground",children:a}),(0,t.jsx)(el,{expanded:u})]}),u&&(0,t.jsx)("div",{className:"stg:border-t stg:border-border-muted stg:px-2.5 stg:py-2",children:(0,t.jsx)(ee,{todos:e,TodoRow:n})})]})},function(e,t){return e.todos===t.todos&&e.className===t.className&&e.TodoRow===t.TodoRow});function ei(){return(0,t.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:(0,t.jsx)("path",{d:"M2 3h8M2 6h6M2 9h7"})})}function el({expanded:e}){return(0,t.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:(0,o.f)("stg:shrink-0 stg:text-muted-foreground stg:transition-transform stg:duration-150",e&&"stg:rotate-90"),"aria-hidden":"true",children:(0,t.jsx)("path",{d:"M3.5 2L6.5 5L3.5 8"})})}let ea=/^(`{3,})(?:markdown|md)?[ \t]*\r?\n/,eo=/^#[ \t]/;function ed(e,t){if(e&&!e.ended&&t?.spec?.interactionMode===r.H.PLAN)for(let t=e.items.length-1;t>=0;t--){let s=e.items[t];if("message"!==s.kind||0===s.text.trim().length)continue;let r=function(e){let t=e.trim(),s=ea.exec(t);if(!s)return e;let r=t.slice(s[0].length),n=RegExp(`(?:^|\\r?\\n)${s[1]}[ \\t]*$`).exec(r);return n?r.slice(0,n.index):r}(s.text);return eo.test(r.trimStart())?{messageId:s.id,displayText:r}:void 0}}e.s(["f",0,ed],341698);var eu=e.i(627756),eg=e.i(684133),ec=e.i(866047),ef=e.i(368762),em=e.i(151373),ex=e.i(945317),eh=e.i(727937),ep=e.i(61855),eb=e.i(699078);function ev(e,t){let r=(0,s.useRef)(0);(0,s.useEffect)(()=>{if(!(0,eb.f)()||(r.current+=1,r.current%10!=0))return;let s=e.current;if(!s)return;let n=()=>{let e=s.querySelectorAll("*").length;console.debug(`[stgm:perf:dom] ${t} nodes=${e}`)};if("function"==typeof requestIdleCallback){let e=requestIdleCallback(n);return()=>cancelIdleCallback(e)}let i=setTimeout(n,0);return()=>clearTimeout(i)})}e.s(["f",0,ev],793322);let ej=0,ey=(e,t,s,r)=>{((ej+=1)%10==0||1===ej)&&console.debug(`[stgm:perf:profiler] ${e} phase=${t} actualDuration=${s.toFixed(1)}ms baseDuration=${r.toFixed(1)}ms`)};function ek({id:e,children:r}){return(0,eb.f)()?(0,t.jsx)(s.Profiler,{id:e,onRender:ey,children:r}):r}e.s(["f",0,ek],283393);var ew=e.i(106909),eN=e.i(901982);function eC({visible:e,count:s,onClick:r}){let n=1===s?"1 approval needed":`${s} approvals needed`;return(0,t.jsx)("button",{type:"button",onClick:r,"aria-label":`${n} — jump to it`,"aria-hidden":!e,tabIndex:e?0:-1,className:(0,o.f)("stg:absolute stg:bottom-3 stg:left-1/2 stg:z-10 stg:-translate-x-1/2","stg:group stg:flex stg:rounded-full","stg:border stg:border-border stg:bg-card stg:shadow-md","stg:transition-[opacity,transform] stg:duration-[var(--stgm-motion-duration)]","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring",e?"stg:pointer-events-auto stg:translate-y-0 stg:opacity-100":"stg:pointer-events-none stg:translate-y-2 stg:opacity-0"),children:(0,t.jsxs)("span",{className:(0,o.f)("stg:flex stg:items-center stg:gap-1.5 stg:rounded-full","stg:bg-status-degraded-subtle stg:px-3 stg:py-1.5","stg:text-xs stg:font-medium stg:text-status-degraded","stg:group-hover:bg-status-degraded stg:group-hover:text-status-degraded-foreground"),children:[(0,t.jsx)(eM,{}),n]})})}function eM(){return(0,t.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,t.jsx)("circle",{cx:"6",cy:"6",r:"4.5"}),(0,t.jsx)("path",{d:"M6 3.5V6L7.5 7.5"})]})}function eL({animate:e,children:r}){let[n,i]=(0,s.useState)(e),l=(0,s.useRef)(void 0),a=(0,s.useCallback)(()=>{i(!1),void 0!==l.current&&(clearTimeout(l.current),l.current=void 0)},[]),d=(0,s.useCallback)(e=>{void 0!==l.current&&(clearTimeout(l.current),l.current=void 0),e&&n&&(l.current=setTimeout(()=>{i(!1),l.current=void 0},300))},[n]);return(0,t.jsx)("div",{ref:d,className:(0,o.f)("stg:empty:hidden",n&&"stgm-thread-item-enter"),onAnimationEnd:a,children:r})}e.s(["f",0,eC],122801),e.s(["f",0,eL],480751);let eS=(0,s.lazy)(()=>e.A(714587).then(e=>({default:e.VirtualizedThread}))),eA=new Set,e$=new Map,e_=[];function eT(e){return null!=e&&(0,o.f)("stg:w-full stg:max-w-3xl stg:px-4","center"===e&&"stg:mx-auto")}let eI=new Set(["failed","cancelled","terminated"]);function eR(e,t){return e.status?.phase==="completed"&&t?.spec?.interactionMode===r.H.PLAN}function eF(e){for(let t=e.length-1;t>=0;t--){let s=e[t];if("message"===s.kind&&s.text.trim().length>0)return s.id}}function eB({items:e,className:s,contentColumn:r,formatToolCallSummary:n,onAnswerToolUse:i,answeringToolUseIds:l,answerErrors:a,filePathCtx:d,sandboxCtx:u,approvalCtx:g,fileReviewCtx:c,unresolvedApprovalCount:f,onBuildFromPlan:m,onOpenPlan:x,org:h,planActionsDisabled:p,planBuildPending:b,onRetrySend:v,onRetryRun:j,onEditMessage:y,slots:k,pinToLatestSignal:w}){let{scrollRef:N,sentinelRef:C,contentRef:M,isFollowing:L,jumpToLatest:S}=(0,ew.i)();return(0,ew.L)(w,S),ev(N,"MessageThread"),(0,t.jsxs)("div",{className:(0,o.f)("stg:relative stg:min-h-0",s),children:[(0,t.jsxs)("div",{ref:N,role:"log","aria-live":"polite","aria-relevant":"additions",className:(0,o.f)("stg:h-full stg:overflow-y-auto stg:pt-6 stg:pb-4 stg:[overflow-anchor:none]","stg:[scrollbar-width:thin] stg:[scrollbar-color:var(--color-border)_transparent]","stg:[&::-webkit-scrollbar]:w-1.5","stg:[&::-webkit-scrollbar-track]:bg-transparent","stg:[&::-webkit-scrollbar-thumb]:rounded-full stg:[&::-webkit-scrollbar-thumb]:bg-border/40"),children:[(0,t.jsx)(ef.n.Provider,{value:u,children:(0,t.jsx)(ec.f.Provider,{value:d,children:(0,t.jsx)(em.E.Provider,{value:g,children:(0,t.jsx)(eh.y.Provider,{value:c,children:(0,t.jsx)(ek,{id:"MessageThread",children:(0,t.jsx)("div",{ref:M,className:(0,o.f)("stg:flex stg:flex-col stg:gap-4",eT(r)),children:e.map(e=>(0,t.jsx)(eL,{animate:!0,children:(0,t.jsx)(eU,{item:e,formatToolCallSummary:n,onAnswerToolUse:i,answeringToolUseIds:l,answerErrors:a,onBuildFromPlan:m,onOpenPlan:x,org:h,planActionsDisabled:p,planBuildPending:b,onRetrySend:v,onRetryRun:j,onEditMessage:y,slots:k})},e.key))})})})})})}),(0,t.jsx)("div",{ref:C,"aria-hidden":"true"})]}),(0,t.jsx)(eN.f,{onClick:S,visible:!L&&0===f}),(0,t.jsx)(eC,{visible:!L&&f>0,count:f,onClick:S})]})}function eU({item:e,formatToolCallSummary:s,onAnswerToolUse:r,answeringToolUseIds:n,answerErrors:i,onBuildFromPlan:l,onOpenPlan:a,org:o,planActionsDisabled:d,planBuildPending:f,onRetrySend:m,onRetryRun:x,onEditMessage:h,slots:p}){let C=(0,c.O)();switch(e.kind){case"message":{let s=p?.MessageEntry??u.f;if(e.isFailed)return(0,t.jsx)(eH,{message:e.message,files:e.files,onRetry:m,MessageEntryComponent:s});return(0,t.jsx)(s,{message:e.message,className:e.isPending?"stg:opacity-70":void 0,isPlanDocument:e.isPlanDocument,interactionMode:e.interactionMode,files:e.files,runId:e.executionId,onEdit:e.isEditable&&h?()=>h(e.message.text):void 0,actions:C&&void 0!==e.scoresRunId?(0,t.jsx)(g.f,{runId:e.scoresRunId}):void 0})}case"tool-group":return(0,t.jsx)(eE,{toolUses:e.toolUses,formatSummary:s});case"outcome":return(0,t.jsx)(eW,{turn:e.turn});case"subagent":return(0,t.jsx)(b.f,{thread:e.thread,subject:(0,eu.Y)(e.toolUse),startedAt:e.toolUse.processedAt,completedAt:e.toolUse.result?.processedAt,className:"stg:mx-4"});case"phase-badge":return(0,t.jsx)("div",{className:"stg:flex stg:justify-center stg:py-3",children:(0,t.jsx)(v.f,{phase:e.phase})});case"execution-error":{let s=p?.RunErrorNotice??N.f;return(0,t.jsx)(s,{error:e.error,retryMessage:e.retryMessage,onRetry:x})}case"approval-request":return(0,t.jsx)(eK,{toolUse:e.toolUse,onAnswerToolUse:r,isSubmitting:n?.has(e.toolUse.id)??!1,error:i?.get(e.toolUse.id)??null,ApprovalCardComponent:p?.ApprovalCard??w.o});case"file-review-record":return(0,t.jsx)(eV,{fileReviewSet:e.fileReviewSet});case"setup-progress":{let s=p?.SetupProgress??j.f;return(0,t.jsx)(s,{resources:e.resources,serverPhase:e.serverPhase,isAwaitingResponse:e.isAwaitingResponse})}case"recalled-memories":{let s=p?.RecalledMemoriesCard??y.f;return(0,t.jsx)(s,{recall:e.recall,facts:e.facts})}case"context-compacted":return(0,t.jsx)(M.f,{compacted:e.compacted});case"agent-version":return(0,t.jsx)(eP,{label:e.label});case"loaded-versions":return(0,t.jsx)(eO,{changes:e.changes});case"liveness":{let s=p?.LivenessStatusLine??k.f;return e.waitingOn.length>0?(0,t.jsx)(s,{waitingOn:e.waitingOn}):(0,t.jsx)(s,{})}case"queued-message":{let s=p?.MessageEntry??u.f;return(0,t.jsxs)("div",{className:"stg:opacity-60",children:[(0,t.jsx)(s,{message:{kind:"user",id:e.message.id,text:e.message.text}}),(0,t.jsx)("p",{className:"stg:px-4 stg:text-right stg:text-xs stg:text-muted-foreground",children:"waiting"===e.message.state?"Queued — read at the agent's next step":"Not read — the turn was stopped"})]})}case"todos":{let s=p?.TodoCard??en;return(0,t.jsx)(s,{todos:e.todos,className:"stg:mx-4",TodoRow:p?.TodoRow})}case"plan-completion":{let s=p?.PlanFileCard??W,r=p?.PlanCompletionCard??S;return e.planFile&&e.executionId?(0,t.jsx)(s,{file:e.planFile,title:e.planTitle,org:o,onImplement:e.isLatestPlan?l:void 0,onOpenPlan:a?()=>a(e.executionId):void 0,disabled:d,buildPending:f}):(0,t.jsx)(r,{onImplement:e.isLatestPlan?l:void 0,disabled:d})}case"plan-writing":{let s=p?.PlanStreamingCard??q;return(0,t.jsx)(s,{title:e.planTitle,sizeBytes:e.planSize,onOpenPlan:a?()=>a(e.executionId):void 0})}}}function eE({toolUses:e,formatSummary:s}){let{foldSettledSteps:r}=(0,p.n)();return!r||e.some(e=>void 0===e.result)?(0,t.jsx)(m.f,{toolUses:e,formatSummary:s,className:"stg:mx-4"}):(0,t.jsx)(h.f,{toolUses:e,children:(0,t.jsx)(m.f,{toolUses:e,formatSummary:s})})}function eW({turn:e}){let{turnOutcome:s}=(0,p.n)();return(0,t.jsx)(t.Fragment,{children:s?.(e)})}function eP({label:e}){return(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-3 stg:px-4 stg:py-2 stg:text-xs stg:text-muted-foreground","data-testid":"agent-version-marker",children:[(0,t.jsx)("span",{"aria-hidden":"true",className:"stg:h-px stg:flex-1 stg:bg-border"}),(0,t.jsxs)("span",{children:["Agent version ",e]}),(0,t.jsx)("span",{"aria-hidden":"true",className:"stg:h-px stg:flex-1 stg:bg-border"})]})}function eD(e){return(0,i.Q)(e)?`A ${(0,i.$)(e.kind)} was updated`:`${e.kind===n.X.skill?"Skill":"Plugin"} ${e.slug} updated`}function eO({changes:e}){return(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-3 stg:px-4 stg:py-2 stg:text-xs stg:text-muted-foreground","data-testid":"loaded-versions-marker",children:[(0,t.jsx)("span",{"aria-hidden":"true",className:"stg:h-px stg:flex-1 stg:bg-border"}),(0,t.jsx)("span",{children:e.map(eD).join(" · ")}),(0,t.jsx)("span",{"aria-hidden":"true",className:"stg:h-px stg:flex-1 stg:bg-border"})]})}function eH({message:e,files:s,onRetry:r,MessageEntryComponent:n}){return(0,t.jsxs)("div",{className:"stg:flex stg:flex-col stg:gap-1",children:[(0,t.jsx)(n,{message:e,files:s}),(0,t.jsxs)("div",{role:"alert",className:"stg:mx-4 stg:flex stg:items-center stg:gap-2 stg:text-xs stg:text-destructive",children:[(0,t.jsx)("span",{className:"stg:min-w-0 stg:flex-1 stg:truncate",children:"Couldn’t send."}),r&&(0,t.jsx)("button",{type:"button",onClick:r,className:"stg:shrink-0 stg:rounded stg:font-medium stg:underline-offset-2 stg:hover:underline stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring",children:"Retry"})]})]})}let eK=(0,s.memo)(function({toolUse:e,onAnswerToolUse:r,isSubmitting:n,error:i=null,ApprovalCardComponent:l}){let a=(0,s.useCallback)((t,s)=>{r(e.id,t,s)},[r,e.id]);return(0,t.jsx)(l,{toolUse:e,onAnswer:a,isSubmitting:n,error:i,className:"stg:mx-4"})}),eV=(0,s.memo)(function({fileReviewSet:e}){let{changeSetsById:r}=(0,s.useContext)(eh.y);return(0,t.jsx)(C.f,{fileReviewSet:e,capture:r.get(e.changeSetId)??null,interactive:!1,showDiffs:!1,className:"stg:mx-4"})});e.s(["K",0,function({turns:e,runs:r=e_,planFiles:i,pendingUserMessage:u,pendingFiles:g,queued:m,pendingMessageFailed:h=!1,onRetrySend:b,scrollOnSend:v=!0,onRetryRun:j,onEditMessage:y,className:k,formatToolCallSummary:w,onAnswerToolUse:N,answeringToolUseIds:C,answerErrors:M,onStopBackgroundCommand:L,stoppingBackgroundToolUseIds:S,stopBackgroundErrors:A,showFileReviewRecords:$=!1,resources:_,onFilePathClick:T,sandboxWorkspaceRoot:I,agentVersionLabel:R,virtualized:F=!1,onBuildFromPlan:B,onOpenPlan:U,org:E,planActionsDisabled:W,planBuildPending:P,contentColumn:D,slots:O,runScores:H=!1,turnOutcome:K,foldSettledSteps:V=!1,ambientLiveness:z=!0}){(0,Y.f)("MessageThread",{turns:e,runs:r});let q=null!=N,J=null!=y,G=null!=U,Z=(0,s.useMemo)(()=>(function(e,t,s={}){let r,{pendingUserMessage:i,includeApprovals:l=!1,resources:o,pendingMessageFailed:u=!1,editableActiveTurn:g=!1,includeFileReviewRecords:c=!1,collapseStreamingPlan:m=!1,pendingFiles:h,queued:p=[],agentVersionLabel:b,planFiles:v,includeOutcomes:j=!1,includeLiveness:y=!0}=s,k=new Map;for(let e of t){let t=e.metadata?.id;t&&k.set(t,e)}let w=[],N="",C=new Set,M=e.filter(e=>k.get(e.runId)?.spec?.reconcileFileReview!==!0),L=M.at(-1),S=void 0===L||L.ended?void 0:L,A=null;for(let e=M.length-1;e>=0;e--){let t=M[e];if(eR(t,k.get(t.runId))){A=t.runId;break}}for(let e of M){let t=k.get(e.runId),s=e.runId,l=e===S,o=eR(e,t),d=o?eF(e.items):void 0,u=o?v?.get(s):void 0,x=void 0!==d&&void 0!==u,h=e.status?.phase==="completed"&&void 0===d?eF(e.items):void 0,p=m&&l?ed(e,t):void 0,y=new Map,M=c?e.fileReview:[],T=!1;function $(){T||0===e.todos.length||(T=!0,w.push({kind:"todos",executionId:s,todos:e.todos,key:`${s}-todos`}))}let I=t?.status?.agentVersionHash??"";void 0!==b&&""!==I&&I!==N&&(N=I,w.push({kind:"agent-version",versionHash:I,label:b(I),key:`${s}-agent-version`}));let R=t?function(e){let t=e.status?.loadedVersions;if(void 0===t||0===t.skills.length&&0===t.plugins.length)return;let s=new Map;for(let[e,r]of[[n.X.skill,t.skills],[n.X.plugin,t.plugins]])for(let t of r)s.set(`${e}/${t.id}`,{kind:e,id:t.id,slug:t.slug,version:t.version});return s}(t):void 0;if(void 0!==R){let e=r,t=void 0===e?[]:[...R.entries()].flatMap(([t,s])=>{let r=e.get(t);return void 0!==r&&r.version!==s.version?[s]:[]});t.length>0&&w.push({kind:"loaded-versions",changes:t,key:`${s}-loaded-versions`}),r=R}let F=t?(0,a.L)(t):e.userMessage?.text??"";if(F){let r=l&&null!=i&&F===i,n=(0,f.F)(t?.status?.messageFiles??[]);w.push({kind:"message",message:{kind:"user",id:e.userMessage?.id??`${s}.user`,text:F},key:r?"pending-user-turn":`${s}-spec`,isEditable:l&&g,interactionMode:t?.spec?.interactionMode,files:n.length>0?n:void 0,executionId:s})}e.memory?.selectionActive&&w.push({kind:"recalled-memories",recall:e.memory,facts:t?.status?.recalledMemories?.facts??[],key:`${s}-recalled-memories`});let B=[],U=()=>{if(0!==B.length){$(),w.push({kind:"tool-group",toolUses:B,key:`${B[0].id}-tc`});var e=B,t=w.length-1;if(0!==M.length)for(let s of e){let e=(0,eu.S)(s).category;if("write"!==e&&"edit"!==e&&"delete"!==e)continue;let r=(0,eu.v)(s);if(r)for(let e of M)(0,eg.p)(e,r)&&y.set(e.changeSetId,t)}for(let e of B)C.add(e.id);B=[]}};for(let t of e.items)switch(t.kind){case"tool_use":if((0,eu.i)(t.name))break;void 0!==t.thread?(U(),$(),w.push({kind:"subagent",toolUse:t,thread:t.thread,key:`sa-${t.id}`}),function e(t,s){for(let r of t.items)!("tool_use"!==r.kind||(0,eu.i)(r.name))&&(s.add(r.id),r.thread&&e(r.thread,s))}(t.thread,C)):B.push(t);break;case"message":if(U(),0===t.text.trim().length)break;x&&t.id===d||t.id===p?.messageId||w.push({kind:"message",message:t,key:t.id,isPlanDocument:!x&&t.id===d,...t.id===h?{scoresRunId:s}:{}}),$();break;case"thinking":U(),w.push({kind:"message",message:t,key:t.id}),$();break;case"note":U(),w.push({kind:"message",message:t,key:t.id});break;case"compacted":U(),w.push({kind:"context-compacted",compacted:t,key:t.id});break;case"user_message":U(),w.push({kind:"message",message:{kind:"user",id:t.id,text:t.text},key:t.id})}if(U(),o){let t=s===A;if(u||t){var _;let r=e.items.find(e=>e.id===d);w.push({kind:"plan-completion",key:`${s}-plan-completion`,executionId:s,planFile:u,planTitle:x&&r?.kind==="message"?(_=r.text,(0,ep.w)((0,ep.B)(_,!0)).title??void 0):void 0,isLatestPlan:t})}}else p&&w.push({kind:"plan-writing",key:`${s}-plan-completion`,executionId:s,planTitle:(0,ep.w)(p.displayText).title??void 0,planSize:p.displayText.length});$(),M.length>0&&function(e,t,s,r){let n=[],i=[];for(let e of t){if(0===e.files.length||!r&&e.undecided)continue;let t={kind:"file-review-record",fileReviewSet:e,key:`file-review-${e.changeSetId}`},l=s.get(e.changeSetId);void 0!==l?n.push({index:l,item:t}):i.push(t)}n.sort((e,t)=>e.index-t.index);let l=0;for(let{index:t,item:s}of n)e.splice(t+1+l,0,s),l++;e.push(...i)}(w,M,y,e.ended),j&&e.ended&&e!==L&&w.push({kind:"outcome",turn:e,key:`outcome-${e.runId}`})}let T=L?k.get(L.runId):void 0,I=L?.status?.phase;if(S&&!(0,x.m)(S)){let e=S.status?.phase;void 0===e||"pending"===e?w.push({kind:"setup-progress",resources:o??[],serverPhase:T?.status?.setupProgress?.currentPhase||void 0,key:"setup-progress"}):"running"===e&&w.push({kind:"setup-progress",resources:o??[],isAwaitingResponse:!0,key:"setup-progress"})}if(L?.ended&&void 0!==I&&eI.has(I)){j||w.push({kind:"phase-badge",phase:(0,d.f)(I),key:`phase-${I}`});let e=L.status?.error;if(e&&"cancelled"!==I){let t=T?.spec?.message,s=T?.spec?.buildFromPlan===!0;w.push({kind:"execution-error",error:e,retryMessage:t&&"execute"!==t&&!s?t:void 0,key:`execution-error-${L.runId}`})}}if(j&&L?.ended&&w.push({kind:"outcome",turn:L,key:`outcome-${L.runId}`}),l&&L)for(let e of L.asks)C.has(e.id)||w.push({kind:"approval-request",toolUse:e,key:`approval-${e.id}`});if(S&&(0,x.m)(S)&&S.status?.phase==="running"&&0===S.asks.length&&!(0,x.T)(S.items)){let e=(0,x.Y)(S);(y||e.length>0)&&w.push({kind:"liveness",key:"liveness-status",waitingOn:e})}for(let e of p)w.push({kind:"queued-message",message:e,key:`queued-${e.id}`});return i&&(!u&&(L?.userMessage?.text===i||p.some(e=>e.text===i))||w.push({kind:"message",message:{kind:"user",id:"pending-user-turn",text:i},key:"pending-user-turn",isPending:!u,isFailed:u,files:h&&h.length>0?h:void 0})),w})(e,r,{pendingUserMessage:u,includeApprovals:q,resources:_,pendingMessageFailed:h,editableActiveTurn:J,includeFileReviewRecords:$,collapseStreamingPlan:G,pendingFiles:g,queued:m,agentVersionLabel:R,planFiles:i,includeOutcomes:void 0!==K,includeLiveness:z}),[e,r,u,q,_,h,J,$,G,g,m,R,i,K,z]),X=(0,s.useMemo)(()=>({foldSettledSteps:V,turnOutcome:K}),[V,K]);!function(e){let t=(0,s.useRef)(null);if(!(0,eb.f)())return;let r=new Map;for(let t=0;t<e.length;t++){let s=r.get(e[t].key);void 0!==s?console.warn(`[stgm:perf:keys] Duplicate key "${e[t].key}" at indices ${s} and ${t} (${e[s].kind}, ${e[t].kind}). React will silently drop one.`):r.set(e[t].key,t)}let n=t.current;if(t.current=e,!n||0===n.length)return;let i=new Map;for(let e=0;e<n.length;e++)i.set(n[e].key,e);let l=new Set(r.keys()),a=[];for(let e of i.keys())l.has(e)||a.push(e);if(0===a.length)return;let o=0;for(let t of a){let s=i.get(t);if(s<e.length){let r=e[s];i.has(r.key)||(o++,console.warn(`[stgm:perf:keys] Key swap at index ${s}: "${t}" (${n[s].kind}) → "${r.key}" (${r.kind}). This causes React to unmount/remount the row.`))}}o>3&&console.warn(`[stgm:perf:keys] ${o} key swaps detected in a single render. Thread items may be using unstable keys.`)}(Z);let[Q,ee]=(0,s.useState)(0),et=(0,s.useRef)(!1);(0,s.useEffect)(()=>{let e=!!u;e&&!et.current&&ee(e=>e+1),et.current=e},[u]);let es=v?Q:void 0,er=(0,s.useMemo)(()=>({resources:_??[],onFilePathClick:T}),[_,T]),en=(0,s.useMemo)(()=>({sandboxWorkspaceRoot:I??""}),[I]),ei=(0,s.useMemo)(()=>({onAnswer:N,submittingIds:C??eA,errorsByToolUseId:M??e$}),[N,C,M]),el=(0,s.useMemo)(()=>({onStop:L,stoppingIds:S??eA,errorsByToolUseId:A??e$}),[L,S,A]),ea=(0,s.useMemo)(()=>(function(e,t){let s=new Map;for(let t of e)t.fileReview.length>0&&s.set(t.runId,t.fileReview);let r=new Map;for(let e of t)for(let t of(0,l.f)(e.status))r.set(t.id,t);return{fileReviewByRunId:s,changeSetsById:r}})(e,r),[e,r]),eo=q?e.at(-1)?.asks.length??0:0,ec=e=>(0,t.jsx)(p.h.Provider,{value:X,children:(0,t.jsx)(ex.$.Provider,{value:el,children:H?(0,t.jsx)(c.j,{runs:r,children:e}):e})});return ec(F?(0,t.jsx)("div",{className:(0,o.f)("stg:relative stg:min-h-0",k),children:(0,t.jsx)(s.Suspense,{fallback:null,children:(0,t.jsx)(eS,{items:Z,formatToolCallSummary:w,onAnswerToolUse:N,answeringToolUseIds:C,answerErrors:M,filePathCtx:er,sandboxCtx:en,approvalCtx:ei,fileReviewCtx:ea,unresolvedApprovalCount:eo,onBuildFromPlan:B,onOpenPlan:U,org:E,planActionsDisabled:W,planBuildPending:P,contentColumn:D,onRetrySend:b,onRetryRun:j,onEditMessage:y,slots:O,pinToLatestSignal:es})})}):(0,t.jsx)(eB,{items:Z,className:k,contentColumn:D,formatToolCallSummary:w,onAnswerToolUse:N,answeringToolUseIds:C,answerErrors:M,filePathCtx:er,sandboxCtx:en,approvalCtx:ei,fileReviewCtx:ea,unresolvedApprovalCount:eo,onBuildFromPlan:B,onOpenPlan:U,org:E,planActionsDisabled:W,planBuildPending:P,onRetrySend:b,onRetryRun:j,onEditMessage:y,slots:O,pinToLatestSignal:es}))},"I",0,eU,"l",0,eT],905630)},74108,609297,368762,e=>{"use strict";var t=e.i(974265),s=e.i(893976),r=e.i(651023),n=e.i(679239);function i({content:e,className:l}){let a=e.split("\n"),o=a.length>10,[d,u]=(0,r.useState)(!1),g=o&&!d?a.slice(0,10).join("\n")+"\n…":e;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("pre",{className:(0,s.f)("stg:whitespace-pre-wrap stg:break-words stg:font-mono",l),children:g}),o&&(0,t.jsx)(n.f,{expanded:d,onToggle:()=>u(e=>!e),moreLabel:`Show all ${a.length} lines`})]})}e.s(["z",0,function({label:e,content:i,className:l}){let a=i.split("\n"),o=a.length>10,[d,u]=(0,r.useState)(!1),g=o&&!d?a.slice(0,10).join("\n")+"\n…":i;return(0,t.jsxs)("div",{className:(0,s.f)("stg:space-y-1",l),children:[(0,t.jsx)("span",{className:"stg:font-medium stg:text-muted-foreground",children:e}),(0,t.jsx)("pre",{className:"stg:max-h-80 stg:overflow-auto stg:whitespace-pre-wrap stg:break-words stg:rounded-md stg:border stg:border-border stg:bg-muted-subtle stg:p-2 stg:font-mono stg:text-foreground",children:g}),o&&(0,t.jsx)(n.f,{expanded:d,onToggle:()=>u(e=>!e),moreLabel:`Show all ${a.length} lines`})]})},"p",0,function({label:e,content:n}){let[i,l]=(0,r.useState)(!1),a=n.split("\n"),o=a.length>3;return(0,t.jsxs)("div",{className:"stg:space-y-1",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>l(e=>!e),className:"stg:flex stg:items-center stg:gap-1 stg:font-medium stg:text-muted-foreground stg:transition-colors stg:hover:text-foreground",children:[(0,t.jsx)("svg",{width:"8",height:"8",viewBox:"0 0 8 8",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:(0,s.f)("stg:shrink-0 stg:transition-transform stg:duration-150",i&&"stg:rotate-90"),"aria-hidden":"true",children:(0,t.jsx)("path",{d:"M2 1L6 4L2 7"})}),e,!i&&o&&(0,t.jsxs)("span",{className:"stg:font-normal stg:text-muted-foreground-subtle",children:["(",a.length," lines)"]})]}),i&&(0,t.jsx)("pre",{className:"stg:max-h-80 stg:overflow-auto stg:whitespace-pre-wrap stg:break-words stg:rounded-md stg:border stg:border-border stg:bg-muted-subtle stg:p-2 stg:font-mono stg:text-foreground",children:n})]})},"n",0,i,"N",0,function(){return(0,t.jsxs)("svg",{width:"10",height:"10",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round",className:"stg:shrink-0 stg:text-muted-foreground","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M7 1H3C2.45 1 2 1.45 2 2V10C2 10.55 2.45 11 3 11H9C9.55 11 10 10.55 10 10V4L7 1Z"}),(0,t.jsx)("path",{d:"M7 1V4H10"})]})},"l",0,function(){return(0,t.jsxs)("svg",{width:"10",height:"10",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round",className:"stg:shrink-0","aria-hidden":"true",children:[(0,t.jsx)("circle",{cx:"6",cy:"3",r:"1.5"}),(0,t.jsx)("circle",{cx:"6",cy:"9",r:"1.5"}),(0,t.jsx)("path",{d:"M6 4.5V7.5"}),(0,t.jsx)("path",{d:"M3 6H4.5"}),(0,t.jsx)("path",{d:"M7.5 6H9"})]})},"f",0,10,"u",0,function(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}},"v",0,function(e){return e.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").replace(/\b[a-z]/g,e=>e.toUpperCase())},"e",0,function(e){let t=typeof e;return"string"===t||"number"===t||"boolean"===t}],609297);var l=e.i(244908);function a(e,t,s){if(!t)return e;let r=e,n=r.indexOf(t);for(;-1!==n;)n=(r=r.slice(0,n)+s+r.slice(n+t.length)).indexOf(t,n+s.length);return r}let o=(0,r.createContext)({sandboxWorkspaceRoot:""});function d(){let{sandboxWorkspaceRoot:e}=(0,r.useContext)(o);return(0,r.useCallback)(t=>(function(e,t){if(!e||!t)return e;let s=(0,l.f)(t,"/");e=a(e,s+"/",""),e=a(e,s,".");let r=s.lastIndexOf("/");if(r>0){let t=s.slice(0,r);e=a(e,t+"/","~/"),e=a(e,t,"~")}return e})(t,e),[e])}function u({content:e}){let s=e.trimEnd().split("\n"),r=s.slice(-10),n=s.length-r.length;return(0,t.jsxs)("pre",{"data-cursor-target":"terminal-live-output",className:"stg:whitespace-pre-wrap stg:break-words stg:font-mono stg:text-foreground",children:[n>0&&(0,t.jsxs)("span",{className:"stg:block stg:select-none stg:text-muted-foreground-subtle",children:["… +",n," ",1===n?"line":"lines"]}),r.join("\n")]})}function g({exitCode:e}){return(0,t.jsxs)("div",{children:[(0,t.jsxs)("span",{className:"stg:sr-only",children:["Command exited with code ",e]}),(0,t.jsxs)("span",{"aria-hidden":"true",className:"stg:inline-block stg:rounded stg:bg-destructive-subtle stg:px-1 stg:py-0.5 stg:text-2xs stg:font-medium stg:leading-none stg:tabular-nums stg:text-destructive",children:["exit ",e]})]})}e.s(["n",0,o,"h",0,d],368762),e.s(["U",0,function({command:e,stdout:r,stderr:n,exitCode:l,live:a=!1,className:o}){let c=d();return(0,t.jsxs)("div",{"data-cursor-target":"terminal-session",className:(0,s.f)("stg:space-y-1 stg:rounded-md stg:border stg:border-border stg:bg-muted-subtle stg:p-2.5 stg:font-mono stg:text-xs",o),children:[e&&(0,t.jsxs)("pre",{className:"stg:whitespace-pre-wrap stg:break-words stg:text-foreground",children:[(0,t.jsx)("span",{className:"stg:select-none stg:text-muted-foreground",children:"$ "}),c(e)]}),r&&a&&(0,t.jsx)(u,{content:c(r)}),r&&!a&&(0,t.jsx)(i,{content:c(r),className:"stg:text-foreground"}),n&&(0,t.jsx)(i,{content:c(n),className:"stg:text-destructive"}),void 0!==l&&0!==l&&(0,t.jsx)(g,{exitCode:l})]})},"P",0,function({command:e,stdout:r,stderr:n,exitCode:i,className:l}){let a=d(),o=[r,n].filter(e=>!!e).join("\n").trimEnd(),u=o?a(o).split("\n"):[],c=u.slice(-3),f=u.length-c.length;return(0,t.jsxs)("div",{"data-cursor-target":"terminal-tail",className:(0,s.f)("stg:space-y-1 stg:rounded-md stg:border stg:border-border stg:bg-muted-subtle stg:p-2.5 stg:font-mono stg:text-xs",l),children:[e&&(0,t.jsxs)("pre",{className:"stg:whitespace-pre-wrap stg:break-words stg:text-foreground",children:[(0,t.jsx)("span",{className:"stg:select-none stg:text-muted-foreground",children:"$ "}),a(e)]}),c.length>0&&(0,t.jsxs)("pre",{className:"stg:whitespace-pre-wrap stg:break-words stg:text-muted-foreground",children:[f>0&&(0,t.jsxs)("span",{className:"stg:block stg:select-none stg:text-muted-foreground-subtle",children:["… +",f," ",1===f?"line":"lines"]}),c.join("\n")]}),void 0!==i&&0!==i&&(0,t.jsx)(g,{exitCode:i})]})}],74108)},264843,684133,727937,494768,627756,992109,361254,151373,945317,916790,346982,899924,335204,682302,490960,389962,290924,656244,483944,336208,212703,299992,e=>{"use strict";e.s(["f",()=>sj],264843),e.s(["f",()=>tL],992109),e.s(["o",()=>tD,"y",()=>tH],361254);var t=e.i(974265),s=e.i(651023),r=e.i(893976),n=e.i(282838),i=e.i(214254),l=e.i(770166),a=e.i(364949),o=e.i(863714),d=e.i(422891),u=e.i(74108),g=e.i(849695),c=e.i(719705),f=e.i(353799),m=e.i(394327);function x(e){switch(e.reviewable){case"complete":return{kind:"reviewable"};case"binary":return{kind:"binary"};case"secret":return{kind:"unavailable",reason:"secret"};default:return{kind:"unavailable",reason:"partial"}}}function h(e){let t=!1;for(let s of e.files){let e=x(s).kind;if("unavailable"===e)return"blocked";"binary"===e&&(t=!0)}return t?"binary-only":"complete"}function p(e,t){let s=e.replace(/\\/g,"/");return""!==t&&(s===t||s.endsWith(`/${t}`))}function b(e,t){return t?e.files.find(e=>p(t,e.path))??null:null}let v={undecided:"pending",kept:"kept",undoing:"discarded",undone:"discarded",undo_failed:"failed"};function j(e,t){if(!t)return null;for(let s=e.length-1;s>=0;s--){let r=b(e[s],t);if(r)return v[r.state]}return null}function y(e,t){if(!e||!t)return null;let s=function(e,t){if(!t)return null;for(let s of e.changes)if(p(t,s.pathAfter||s.pathBefore))return s;return null}(e,t);return s?.diffComplete?s:null}let k=new Map([["added",m.O.ADD],["modified",m.O.MODIFY],["deleted",m.O.DELETE],["renamed",m.O.RENAME]]);function w(e){return k.get(e)??m.O.UNSPECIFIED}e.s(["S",0,h,"R",0,w,"p",0,b,"x",0,y,"V",0,j,"r",0,x],684133);let N={fileReviewByRunId:new Map,changeSetsById:new Map},C=(0,s.createContext)(N),M=[];function L(e,t){let{fileReviewByRunId:r}=(0,s.useContext)(C);return j(r.get(e)??M,t)}function S(e,t){let{fileReviewByRunId:r,changeSetsById:n}=(0,s.useContext)(C);if(!t)return null;let i=r.get(e)??M;for(let e=i.length-1;e>=0;e--){let s=i[e];if(b(s,t))return y(n.get(s.changeSetId),t)}return null}e.s(["y",0,C,"k",0,S,"G",0,L],727937);let A=new Map([["read","file_read"],["read_file","file_read"],["Read","file_read"],["write","file_write"],["write_file","file_write"],["create_file","file_write"],["overwrite_file","file_write"],["Write","file_write"],["edit","file_edit"],["edit_file","file_edit"],["str_replace_editor","file_edit"],["Edit","file_edit"],["NotebookEdit","file_edit"],["delete","file_delete"],["delete_file","file_delete"],["remove_file","file_delete"],["shell","shell"],["bash","shell"],["execute","shell"],["execute_command","shell"],["run_command","shell"],["terminal","shell"],["Bash","shell"],["grep","search"],["glob","search"],["search","search"],["ripgrep","search"],["find_files","search"],["Grep","search"],["Glob","search"],["ls","list"],["list_directory","list"],["web_fetch","fetch"],["WebFetch","fetch"],["WebSearch","web_search"],["think","think"],["write_todos","todo"],["TodoWrite","todo"],["task","subagent"],["Task","subagent"],["Agent","subagent"],["stop_background_command","background_stop"],["Skill","skill"]]);function $(e){return _(e.name,e.mcpServerName)}function _(e,t){if("remember"===e&&"stigmer-memory"===t)return"memory";let s=A.get(e);return void 0!==s?s:t&&t.length>0?"mcp":"unknown"}function T(e,t){if("shell"!==e||!t)return null;let s=t.description;if("string"!=typeof s)return null;let r=s.trim();return r.length>0?r:null}function I(e){return T($(e),e.input)}let R=new Set(["password","token","secret","api_key","apikey","credentials","auth","authorization"]);function F(e){return R.has(e.toLowerCase())}function B(e){if(!Object.keys(e).some(F))return e;let t={};for(let[s,r]of Object.entries(e))t[s]=F(s)?"[REDACTED]":r;return t}let U=["path","file_path","file","filename"],E=["old_string","old_text","oldText"],W=["new_string","new_text","newText","replacement"],P=["content","file_content"],D="\n\n[output truncated — ";function O(e){let t=e.result?.text??"",s=e.input;if(e.result?.isError===!0&&""!==t)return{type:"error",message:t};if(void 0!==e.background){var r,n,i,l,a,o,d,u,g,c,f=e.background,m=s;let t=Z(m,["command"]);switch(f.state){case"running":return{type:"terminal",command:t,stdout:f.liveOutput,stderr:""};case"failed_to_start":return{type:"error",message:f.output};default:{let e=J(f.output,m);return"terminal"===e.type&&void 0!==f.exitCode?{...e,exitCode:f.exitCode}:e}}}if(void 0!==e.fullOutput&&""!==e.fullOutput.storageKey){let s,r=e.fullOutput;return{type:"outputRef",storageKey:r.storageKey,contentHash:r.contentHash,isImage:r.isImage,mimeType:r.mimeType,sizeBytes:Number(r.sizeBytes),preview:r.isImage?"":(s=t.lastIndexOf(D))<0||!t.endsWith("]")||t.slice(s+D.length,-1).includes("]")?t:t.slice(0,s)}}switch($(e)){case"file_edit":return{type:"diff",path:Z(r=s,U)??"",oldText:Z(r,E),newText:Z(r,W)};case"file_write":let x;return{type:"file",path:x=Z(n=s,U)??"",content:Z(n,P)??"",language:en(x),truncated:!1};case"file_read":let h,p;return i=s,l=t,h=Z(i,U)??"",p=function(e){let t=e.split("\n"),s=0;for(;H.test(t[s]??"");)s+=1;let r=function(e){if(!e.startsWith("@@ ")||!e.endsWith(" @@")||e.length<7)return;let t=e.slice(3,-3);return K.test(t)?t:void 0}(t[s]??"");if(void 0!==r)return{body:t.slice(s+1).join("\n"),truncated:r.includes("truncated")}}(l)??function(e){let t=e.split("\n"),s=V.exec(t[0]??"");if(null===s)return;let r=Number(s[1]),n=[];for(let[e,s]of t.entries()){let t=V.exec(s);if(null===t||Number(t[1])!==r+e)return;n.push(s.slice(t[0].length))}return{body:n.join("\n"),truncated:!1}}(l),{type:"file",path:h,content:p?.body??l,language:en(h),truncated:p?.truncated||(a=l,/\[truncated: \d+ chars total\]/.test(a))};case"file_delete":return t?{type:"text",text:t}:{type:"empty"};case"shell":return J(t,s);case"search":let b;return void 0!==(b=Q(o=t))&&(et(b)||Array.isArray(b))?{type:"json",value:b}:function(e){let t=X(e),s=t.filter(e=>G.test(e));if(s.length>0){let e=s.map(e=>({text:e.trim()}));return{type:"search",matches:e,count:e.length,kind:"content"}}let r=t.filter(e=>!/^no (files|matches|results)/i.test(e)).map(e=>({file:e,text:e}));return{type:"search",matches:r,count:r.length,kind:"files"}}(o);case"list":let v;return{type:"list",entries:v=X(t),count:v.length};case"think":return d=s,u=t,{type:"text",text:Z(d,["thought"])??u};case"mcp":let j,y;return g=t,c=e.mcpServerName,(y=ee(j=Q(g)))?{type:"contentBlocks",blocks:y,mcpServerSlug:c}:void 0!==j&&(et(j)||Array.isArray(j))?{type:"json",value:j}:g?{type:"text",text:g}:{type:"empty"};case"memory":return function(e){let t=Q(e),s=ee(t),r=s?Q(s.find(e=>"text"===e.type)?.text??""):t;if(et(r)&&et(r.memory)){let e=r.memory,t=et(e.metadata)?e.metadata:void 0,s=et(e.spec)?e.spec:void 0,n=es(t?.id)??"",i=es(s?.content)??"";if(""!==n&&""!==i)return{type:"memoryProposal",memoryId:n,fact:i}}return Y(e)}(t);default:return Y(t)}}let H=/^\[.*\]$/,K=/^(?:lines \d+-\d+|truncated)/,V=/^ *(\d+)\t/,z=/\n?\[Command (?:succeeded|failed with exit code (\d+))\]\s*$/,q=/\n\nExit code: (\d+)$/;function J(e,t){var s,r;let n=Z(t,["command"]),i=Q(e);if(et(s=i)&&("stdout"in s||"exitCode"in s)){return{type:"terminal",command:n,stdout:es(i.stdout)??"",stderr:es(i.stderr)??"",exitCode:"number"==typeof(r=i.exitCode)&&Number.isFinite(r)?r:void 0}}let l=e.match(z);if(l)return{type:"terminal",command:n,stdout:e.replace(z,""),stderr:"",exitCode:void 0!==l[1]?Number(l[1]):0};let a=e.match(q);return{type:"terminal",command:n,stdout:e.replace(q,""),stderr:"",exitCode:null!==a?Number(a[1]):0}}let G=/^\s*\d+[:\t]/;function Y(e){if(!e)return{type:"empty"};let t=Q(e);return void 0!==t&&(et(t)||Array.isArray(t))?{type:"json",value:t}:{type:"text",text:e}}function Z(e,t){if(e)for(let s of t){let t=e[s];if("string"==typeof t&&t.length>0)return t}}function X(e){return e.split("\n").map(e=>e.trimEnd()).filter(e=>e.trim().length>0)}function Q(e){let t=e.trim();if(t&&("{"===t[0]||"["===t[0]))try{return JSON.parse(t)}catch{return}}function ee(e){let t=et(e)?e.content:Array.isArray(e)?e:void 0;if(!Array.isArray(t))return null;let s=[];for(let e of t)et(e)&&"string"==typeof e.type&&s.push({type:e.type,text:es(e.text)});return s.length>0?s:null}function et(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function es(e){return"string"==typeof e?e:void 0}let er=new Map([["ts","typescript"],["tsx","tsx"],["js","javascript"],["jsx","jsx"],["py","python"],["go","go"],["rs","rust"],["java","java"],["rb","ruby"],["sh","bash"],["md","markdown"],["json","json"],["yaml","yaml"],["yml","yaml"],["proto","protobuf"],["sql","sql"],["css","css"],["html","html"],["toml","toml"]]);function en(e){let t=e.lastIndexOf(".");if(!(t<0))return er.get(e.slice(t+1).toLowerCase())}e.s(["v",0,I,"N",0,F,"h",0,O,"w",0,B,"D",0,$,"o",0,_,"C",0,T],494768);var ei=e.i(364802);let el=new Set(["read","list","search","think","background-stop","skill"]);function ea(e){return el.has(e)?"quiet":"card"}let eo=new Set(["edit","write","mcp","web-search","fetch","memory","unknown"]),ed=new Set(["shell"]),eu=new Set(["read","list","search"]);function eg(e){return ed.has(e)?"tail":eo.has(e)?"preview":"summary"}function ec(e){return eu.has(e)}function ef(e){return"read"===e||"write"===e||"edit"===e||"delete"===e}let em={file_read:{category:"read",label:"Read",primaryField:"path",fallbackFields:["file_path","file"]},file_write:{category:"write",label:"Write",primaryField:"path",fallbackFields:["file_path","file","filename"]},file_edit:{category:"edit",label:"Edit",primaryField:"path",fallbackFields:["file_path","file","filename"]},file_delete:{category:"delete",label:"Delete",primaryField:"path",fallbackFields:["file_path","file","filename"]},shell:{category:"shell",label:"Shell",primaryField:"command",intentField:"description"},search:{category:"search",label:"Search",primaryField:"pattern",fallbackFields:["query","q"]},list:{category:"list",label:"List",primaryField:"path"},fetch:{category:"fetch",label:"Fetch",primaryField:"url",fallbackFields:["uri"]},web_search:{category:"web-search",label:"Web Search",primaryField:"query",fallbackFields:["q","search_term"]},think:{category:"think",label:"Thinking",primaryField:"thought"},subagent:{category:"subagent",label:"Subagent",primaryField:"description",fallbackFields:["prompt"]},todo:{category:"internal",label:"Todos",primaryField:"todos"},memory:{category:"memory",label:"Remember",primaryField:"fact"},background_stop:{category:"background-stop",label:"Stop command",primaryField:""},skill:{category:"skill",label:"Use skill",primaryField:"skill"}};function ex(e){return"todo"===_(e)}function eh(e,t){let s=em[e];return s?{category:s.category,label:s.label,primaryArgField:s.primaryField,fallbackArgFields:s.fallbackFields??[],...s.intentField?{intentArgField:s.intentField}:{}}:"mcp"===e?{category:"mcp",label:ev(t),primaryArgField:"slug",fallbackArgFields:["name","org"]}:{category:"unknown",label:ev(t),primaryArgField:"",fallbackArgFields:[]}}function ep(e,t){return eh(_(e,t),e)}function eb(e){return eh($(e),e.name)}function ev(e){return e.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").replace(/\b[a-z]/g,e=>e.toUpperCase()).replace(/\bMcp\b/gi,"MCP").replace(/\bApi\b/gi,"API").replace(/\bId\b/gi,"ID").replace(/\bUrl\b/gi,"URL").replace(/\bIam\b/gi,"IAM")}function ej(e,t,s){if(!e)return null;let r=t=>{let s=e[t];return"string"==typeof s&&s.length>0?s:null};if(t){let e=r(t);if(e)return e}for(let e of s){let t=r(e);if(t)return t}return null}function ey(e){let t=e.input.description;return"string"==typeof t?t:""}function ek(e){let t=eb(e),s=ej(e.input,t.primaryArgField,t.fallbackArgFields);if(s)return s;if("unknown"===t.category||"mcp"===t.category){let t=Object.keys(e.input).find(e=>!F(e));if(void 0!==t){let s=e.input[t];if("string"==typeof s)return s}}return null}function ew(e,t,s,r){if(!t)return null;try{let n=JSON.parse(t);if("object"!=typeof n||null===n)return null;let i=void 0!==r?eh("unknown"!==r?r:_(e,s),e):ep(e,s);return ej(n,i.primaryArgField,i.fallbackArgFields)}catch{return null}}function eN(e,t,s,r){if(!t)return null;let n=void 0!==r&&"unknown"!==r?r:_(e,s);if("shell"!==n)return null;try{let e=JSON.parse(t);if("object"!=typeof e||null===e)return null;return T(n,e)}catch{return null}}let eC=["content","file_content","new_string","replacement"];function eM(e){for(let t of eC){let s=e[t];if("string"==typeof s&&s.length>0)return{field:t,value:s}}return null}function eL(e){return eM(e)?.value??null}function eS(e){if(!e)return null;try{let t=JSON.parse(e);return"object"!=typeof t||null===t||Array.isArray(t)?null:t}catch{return null}}function eA(e,t){let s=t?eM(t):null;return s?{...e,[s.field]:s.value}:e}e.s(["j",0,ea,"E",0,eg,"v",0,ek,"P",0,ew,"o",0,eN,"e",0,eL,"X",0,ev,"d",0,ef,"i",0,ex,"A",0,ec,"J",0,eS,"$",0,ep,"S",0,eb,"Y",0,ey,"r",0,eA],627756);var e$=e.i(609297),e_=e.i(781126),eT=e.i(651427),eI=e.i(582666),eR=e.i(775570);function eF(e,t=!0){let r=e?.storageKey||null,n=t&&!!r,i=n?(0,e_.K)(r):null,{content:l,isLoading:a,isTruncated:o,error:d}=(0,eR.f)(n?i:null,n?r:null,null,e?.contentHash||void 0);return(0,s.useMemo)(()=>({content:l,isLoading:a,isTruncated:o,error:d}),[l,a,o,d])}var eB=e.i(996675);function eU({toolUse:e,className:n}){let i=tk(e.processedAt,e.result?.processedAt??""),l=(0,s.useMemo)(()=>O(e),[e]),a=e.result?.text??"";return(0,t.jsxs)("div",{className:(0,r.f)("stg:space-y-3 stg:text-xs",n),children:[(0,t.jsx)(eD,{mcpServerSlug:e.mcpServerName,toolName:e.name,duration:i}),Object.keys(e.input).length>0&&(0,t.jsx)(eO,{args:e.input}),void 0!==e.fullOutput&&""!==e.fullOutput.storageKey?(0,t.jsx)(eE,{fullOutput:e.fullOutput,preview:"outputRef"===l.type?l.preview:""}):a&&(0,t.jsx)(eK,{result:a})]})}function eE({fullOutput:e,preview:s}){return(0,t.jsxs)("div",{className:"stg:space-y-1",children:[(0,t.jsx)("span",{className:"stg:font-medium stg:text-muted-foreground",children:"Result"}),e.isImage?(0,t.jsx)(eW,{storageKey:e.storageKey}):(0,t.jsx)(eP,{fullOutput:e,preview:s})]})}function eW({storageKey:e}){let r=(0,s.useMemo)(()=>(0,e_.K)(e),[e]),{url:n,error:i}=(0,eT.f)(r,e);return i?(0,t.jsx)("p",{className:"stg:text-xs stg:text-destructive",children:"Couldn't load image output."}):n?(0,t.jsx)("a",{href:n,target:"_blank",rel:"noreferrer",className:"stg:inline-block stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring",children:(0,t.jsx)("img",{src:n,alt:"Tool output screenshot",loading:"lazy",className:"stg:max-h-96 stg:w-auto stg:rounded-md stg:border stg:border-border"})}):(0,t.jsx)(eB.f,{className:"stg:h-40 stg:w-64 stg:animate-pulse stg:rounded-md stg:border stg:border-border stg:bg-muted",label:"Loading image output"})}function eP({fullOutput:e,preview:n}){let[i,l]=(0,s.useState)(!1),a=(0,s.useMemo)(()=>(0,e_.K)(e.storageKey),[e.storageKey]),{content:o,isLoading:d,isTruncated:u,error:g}=eF(e,i),{download:c,isDownloading:f}=(0,eI.R)(a),m=Number(e.sizeBytes),x=m?` (${m>=1048576?`${(m/1048576).toFixed(1)} MB`:m>=1024?`${(m/1024).toFixed(1)} KB`:`${m} B`})`:"",h="stg:max-h-80 stg:overflow-auto stg:rounded-md stg:border stg:border-border stg:bg-muted-subtle stg:p-2 stg:text-foreground",p="stg:inline-block stg:text-xs stg:font-medium stg:text-primary stg:underline-offset-2 stg:hover:underline stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring";return(0,t.jsx)("div",{className:"stg:space-y-1",children:i?d?(0,t.jsx)("p",{className:"stg:text-xs stg:text-muted-foreground",children:"Loading full output…"}):g?(0,t.jsx)("p",{className:"stg:text-xs stg:text-destructive",children:"Couldn't load full output. Try again."}):null!==o?(0,t.jsxs)("div",{className:"stg:space-y-1",children:[(0,t.jsx)(e$.n,{content:o,className:h}),u&&(0,t.jsx)("button",{type:"button",onClick:()=>c(e.storageKey),disabled:f,className:(0,r.f)(p,"stg:disabled:opacity-50"),children:f?"Preparing download…":`Output truncated — download full file${x}`})]}):null:(0,t.jsxs)(t.Fragment,{children:[n&&(0,t.jsx)(e$.n,{content:n,className:h}),(0,t.jsxs)("button",{type:"button",onClick:()=>l(!0),className:p,children:["View full output",x]})]})})}function eD({mcpServerSlug:e,toolName:s,duration:r}){return e||r?(0,t.jsxs)("div",{className:"stg:flex stg:flex-wrap stg:items-center stg:gap-x-3 stg:gap-y-1 stg:text-muted-foreground",children:[e&&(0,t.jsxs)("span",{className:"stg:inline-flex stg:items-center stg:gap-1.5 stg:rounded stg:bg-muted stg:px-1.5 stg:py-0.5 stg:font-mono",children:[(0,t.jsx)(e$.l,{}),e,(0,t.jsx)("span",{className:"stg:text-muted-foreground-subtle",children:"/"}),(0,t.jsx)("span",{className:"stg:text-foreground",children:ev(s)})]}),r&&(0,t.jsx)("span",{children:r})]}):null}function eO({args:e}){let s=Object.entries(B(e));if(0===s.length)return null;let r=[],n=[];for(let[e,t]of s)(0,e$.e)(t)?r.push([e,String(t)]):n.push([e,t]);return(0,t.jsxs)("div",{className:"stg:space-y-2",children:[(0,t.jsx)("span",{className:"stg:font-medium stg:text-muted-foreground",children:"Arguments"}),r.length>0&&(0,t.jsx)("dl",{className:"stg:grid stg:grid-cols-[auto_1fr] stg:gap-x-3 stg:gap-y-1 stg:rounded-md stg:border stg:border-border stg:bg-muted-faint stg:px-2.5 stg:py-2",children:r.map(([e,s])=>(0,t.jsx)(eH,{label:e,value:s},e))}),n.map(([e,s])=>(0,t.jsx)(e$.p,{label:(0,e$.v)(e),content:(0,e$.u)(s)},e))]})}function eH({label:e,value:s}){let r=s.includes("\n");return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("dt",{className:"stg:whitespace-nowrap stg:font-mono stg:text-muted-foreground",children:(0,e$.v)(e)}),r?(0,t.jsx)("dd",{className:"stg:min-w-0",children:(0,t.jsx)("pre",{className:"stg:whitespace-pre-wrap stg:break-words stg:rounded stg:border stg:border-border stg:bg-muted-subtle stg:px-2 stg:py-1 stg:font-mono stg:text-foreground",children:s})}):(0,t.jsx)("dd",{className:"stg:min-w-0",children:(0,t.jsx)(ei.f,{text:s,className:"stg:block stg:font-mono stg:text-foreground"})})]})}function eK({result:e}){let s=function(e){let t=e.trim(),s=ez(t);if(void 0!==s){let e=eV(s);return null!==e?e:JSON.stringify(s,null,2)}let r=function(e){if(!e.startsWith("[")&&!e.startsWith("{"))return;let t=e.replace(/'/g,'"').replace(/\bTrue\b/g,"true").replace(/\bFalse\b/g,"false").replace(/\bNone\b/g,"null");return ez(t=t.replace(/,\s*([}\]])/g,"$1"))}(t);if(void 0!==r){let e=eV(r);return null!==e?e:JSON.stringify(r,null,2)}return t}(e);return(0,t.jsxs)("div",{className:"stg:space-y-1",children:[(0,t.jsx)("span",{className:"stg:font-medium stg:text-muted-foreground",children:"Result"}),(0,t.jsx)(e$.n,{content:s,className:"stg:max-h-80 stg:overflow-auto stg:rounded-md stg:border stg:border-border stg:bg-muted-subtle stg:p-2 stg:text-foreground"})]})}function eV(e){if(!(Array.isArray(e)&&0!==e.length&&e.every(e=>"object"==typeof e&&null!==e&&"type"in e&&"string"==typeof e.type)))return null;let t=[];for(let s of e)if("text"===s.type&&"string"==typeof s.text){let e=ez(s.text.trim());void 0!==e?t.push(JSON.stringify(e,null,2)):t.push(s.text)}return t.length>0?t.join("\n\n"):null}function ez(e){try{return JSON.parse(e)}catch{return}}var eq=e.i(438301);function eJ({toolName:e,args:n,mcpServerSlug:i,showFileName:l=!0,className:a}){let o=(0,s.useMemo)(()=>ep(e,i),[e,i]),d=(0,s.useMemo)(()=>(function(e,t){if(!e)return null;let s=t=>{let s=e[t];return"string"==typeof s&&s.length>0?s:null};if(t.primaryArgField){let e=s(t.primaryArgField);if(e)return e}for(let e of t.fallbackArgFields){let t=s(e);if(t)return t}if("unknown"===t.category||"mcp"===t.category){let t=Object.keys(e).find(e=>!F(e));if(void 0!==t){let s=e[t];if("string"==typeof s)return s}}return null})(n,o),[n,o]);return(0,t.jsx)("div",{className:(0,r.f)("stg:text-xs",a),children:(0,t.jsx)(eG,{category:o.category,toolName:e,args:n,primaryArg:d,mcpServerSlug:i,showFileName:l})})}function eG({category:e,toolName:s,args:r,primaryArg:n,mcpServerSlug:i,showFileName:l}){switch(e){case"shell":return n?(0,t.jsx)(eY,{command:n}):null;case"read":case"write":case"edit":case"delete":return n?(0,t.jsx)(eZ,{path:n,category:e,args:r,showFileName:l}):null;case"search":case"list":return n?(0,t.jsx)(eX,{pattern:n}):null;case"mcp":return(0,t.jsx)(eQ,{toolName:s,args:r,mcpServerSlug:i??""});default:return r&&Object.keys(r).length>0?(0,t.jsx)(e0,{args:r}):null}}function eY({command:e}){return(0,t.jsx)(u.U,{command:e})}function eZ({path:e,category:r,args:n,showFileName:i=!0}){let l=(0,s.useMemo)(()=>("write"===r||"edit"===r)&&n?eL(n):null,[r,n]);return(0,t.jsxs)("div",{className:"stg:space-y-1.5",children:[i&&(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-1.5 stg:text-xs",children:[(0,t.jsx)(e$.N,{}),(0,t.jsx)(eq.f,{path:e,className:"stg:text-xs"})]}),l&&(0,t.jsx)(e$.z,{label:"Content",content:l})]})}function eX({pattern:e}){return(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-1.5 stg:text-xs",children:[(0,t.jsx)("span",{className:"stg:text-muted-foreground",children:"Pattern:"}),(0,t.jsx)("code",{className:"stg:rounded stg:bg-muted stg:px-1.5 stg:py-0.5 stg:font-mono stg:text-foreground",children:e})]})}function eQ({toolName:e,args:s,mcpServerSlug:r}){return(0,t.jsxs)("div",{className:"stg:space-y-2",children:[(0,t.jsx)(eD,{mcpServerSlug:r,toolName:e,duration:null}),s&&Object.keys(s).length>0&&(0,t.jsx)(eO,{args:s})]})}function e0({args:e}){return(0,t.jsx)(e$.z,{label:"Arguments",content:(0,e$.u)(B(e))})}var e1=e.i(19395),e2=e.i(598529),e5=e.i(935010);function e3({view:e,showFileName:s=!0,showStats:n=!0,live:i=!1,className:l}){switch(e.type){case"diff":return(0,t.jsx)(e6,{view:e,showFileName:s,showStats:n,className:l});case"terminal":return(0,t.jsx)(e8,{view:e,live:i,className:l});case"search":return(0,t.jsx)(e9,{view:e,showCount:n,className:l});case"list":return(0,t.jsx)(tr,{entries:e.entries,count:e.count,showCount:n,className:l});case"file":return(0,t.jsx)(tn,{view:e,showFileName:s,className:l});case"contentBlocks":return(0,t.jsx)(ti,{blocks:e.blocks,className:l});case"outputRef":return(0,t.jsx)(tl,{view:e,className:l});case"text":return e.text?(0,t.jsx)(e$.n,{content:e.text,className:(0,r.f)("stg:text-foreground",l)}):null;case"json":return(0,t.jsx)(e$.z,{label:"Result",content:(0,e$.u)(e.value),className:l});case"memoryProposal":return(0,t.jsx)(e$.n,{content:e.fact,className:(0,r.f)("stg:text-foreground",l)});case"error":return(0,t.jsx)(td,{message:e.message,className:l});case"empty":return null}}function e4(e){let t=0,s=0;for(let r of e)for(let e of r.lines)"added"===e.type?t++:"removed"===e.type&&s++;return{added:t,removed:s}}function e6({view:e,showFileName:n=!0,showStats:i=!0,className:l}){let a=(0,s.useMemo)(()=>void 0!==e.oldText&&void 0!==e.newText?(0,e1.f)(e.oldText,e.newText):[],[e.oldText,e.newText]),o=(0,s.useMemo)(()=>a.length>0?e4(a):null,[a]),d=n&&!!e.path,u=i&&null!=o;return(0,t.jsxs)("div",{className:(0,r.f)("stg:space-y-1",l),"data-cursor-target":"file-diff",children:[(d||u)&&(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-2 stg:text-muted-foreground",children:[d&&(0,t.jsx)(eq.f,{path:e.path,dirDisplay:"dim",className:"stg:text-xs"}),u&&o&&(0,t.jsxs)("span",{className:"stg:shrink-0 stg:tabular-nums stg:text-xs",children:[(0,t.jsxs)("span",{className:"stg:text-diff-added-fg",children:["+",o.added]})," ",(0,t.jsxs)("span",{className:"stg:text-diff-removed-fg",children:["-",o.removed]})]})]}),a.length>0?(0,t.jsx)(e2.f,{hunks:a}):(0,t.jsx)(e5.f,{kind:"no-preview"})]})}function e8({view:e,live:s,className:r}){return(0,t.jsx)(u.U,{command:e.command,stdout:e.stdout,stderr:e.stderr,exitCode:e.exitCode,live:s,className:r})}function e7(e,t){return"files"===t?`${e} ${1===e?"file":"files"}`:`${e} ${1===e?"match":"matches"}`}function e9({view:e,showCount:s=!0,className:n}){let{matches:i,count:l,kind:a,truncated:o}=e;if(0===l&&0===i.length)return(0,t.jsx)("p",{className:(0,r.f)("stg:text-xs stg:text-muted-foreground",n),children:"files"===a?"No files found":"No matches"});let d=s?`${e7(l,a)}${o?` \xb7 showing first ${i.length}`:""}`:o?`Showing first ${i.length} of ${l}`:null;return(0,t.jsxs)("div",{className:(0,r.f)("stg:space-y-1",n),children:[d&&(0,t.jsx)("span",{className:"stg:font-medium stg:text-muted-foreground",children:d}),"files"===a?(0,t.jsx)(tt,{matches:i}):(0,t.jsx)(ts,{matches:i})]})}function te({children:e}){return(0,t.jsx)("div",{className:"stg:max-h-80 stg:overflow-auto stg:rounded-md stg:border stg:border-border stg:bg-muted-subtle stg:text-xs",children:e})}function tt({matches:e}){return(0,t.jsx)(te,{children:e.map((e,s)=>(0,t.jsx)("div",{className:"stg:border-b stg:border-border-muted stg:px-2 stg:py-0.5 stg:last:border-b-0",children:(0,t.jsx)(eq.f,{path:e.file??e.text,dirDisplay:"dim",className:"stg:text-xs"})},s))})}function ts({matches:e}){let r=(0,s.useMemo)(()=>(function(e){let t=[];for(let s of e){let e=t[t.length-1];e&&e.file===s.file?e.matches.push(s):t.push({file:s.file,matches:[s]})}return t})(e),[e]);return(0,t.jsx)(te,{children:r.map((e,s)=>(0,t.jsxs)("div",{className:"stg:border-b stg:border-border-muted stg:last:border-b-0",children:[e.file&&(0,t.jsx)("div",{className:"stg:bg-muted-faint stg:px-2 stg:py-0.5",children:(0,t.jsx)(eq.f,{path:e.file,dirDisplay:"dim",className:"stg:text-xs"})}),e.matches.map((e,s)=>(0,t.jsxs)("div",{className:"stg:whitespace-pre-wrap stg:break-words stg:px-2 stg:py-0.5 stg:font-mono stg:text-foreground",children:[void 0!==e.line&&(0,t.jsxs)("span",{className:"stg:select-none stg:text-muted-foreground-subtle",children:[e.line,": "]}),e.text]},s))]},s))})}function tr({entries:e,count:s,showCount:n=!0,className:i}){return 0===s?(0,t.jsx)("p",{className:(0,r.f)("stg:text-xs stg:text-muted-foreground",i),children:"Empty"}):(0,t.jsxs)("div",{className:(0,r.f)("stg:space-y-1",i),children:[n&&(0,t.jsxs)("span",{className:"stg:font-medium stg:text-muted-foreground",children:[s," ",1===s?"item":"items"]}),(0,t.jsx)("div",{className:"stg:max-h-80 stg:overflow-auto stg:rounded-md stg:border stg:border-border stg:bg-muted-subtle stg:font-mono stg:text-xs",children:e.map((e,s)=>(0,t.jsx)("div",{className:"stg:truncate stg:px-2 stg:py-0.5 stg:text-foreground",children:e},s))})]})}function tn({view:e,showFileName:s=!0,className:n}){return e.content?(0,t.jsxs)("div",{className:(0,r.f)("stg:space-y-1",n),children:[s&&e.path&&(0,t.jsx)(eq.f,{path:e.path,className:"stg:text-xs"}),(0,t.jsx)(e$.z,{label:e.truncated?"Content (truncated)":"Content",content:e.content})]}):s&&e.path?(0,t.jsx)("div",{className:(0,r.f)("stg:flex stg:items-center stg:gap-1.5 stg:text-xs",n),children:(0,t.jsx)(eq.f,{path:e.path,className:"stg:text-xs"})}):s?null:(0,t.jsx)(e5.f,{kind:"no-preview",className:n})}function ti({blocks:e,className:n}){let i=(0,s.useMemo)(()=>e.map(e=>"text"===e.type&&e.text?e.text:`[${e.type}]`).join("\n"),[e]);return(0,t.jsx)(e$.n,{content:i,className:(0,r.f)("stg:text-foreground",n)})}function tl({view:e,className:s}){return e.isImage?(0,t.jsx)(ta,{storageKey:e.storageKey,className:s}):(0,t.jsx)(to,{view:e,className:s})}function ta({storageKey:e,className:n}){let i=(0,s.useMemo)(()=>(0,e_.K)(e),[e]),{url:l,error:a}=(0,eT.f)(i,e);return a?(0,t.jsx)("p",{className:(0,r.f)("stg:text-xs stg:text-destructive",n),children:"Couldn't load image output."}):l?(0,t.jsx)("div",{className:(0,r.f)("stg:space-y-1",n),children:(0,t.jsx)("a",{href:l,target:"_blank",rel:"noreferrer",className:"stg:inline-block stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring",children:(0,t.jsx)("img",{src:l,alt:"Tool output screenshot",loading:"lazy",className:"stg:max-h-96 stg:w-auto stg:rounded-md stg:border stg:border-border"})})}):(0,t.jsx)(eB.f,{className:(0,r.f)("stg:h-40 stg:w-64 stg:animate-pulse stg:rounded-md stg:border stg:border-border stg:bg-muted",n),label:"Loading image output"})}function to({view:e,className:n}){var i;let[l,a]=(0,s.useState)(!1),o=(0,s.useMemo)(()=>(0,e_.K)(e.storageKey),[e.storageKey]),{content:d,isLoading:u,isTruncated:g,error:c}=eF({storageKey:e.storageKey,contentHash:e.contentHash},l),{download:f,isDownloading:m}=(0,eI.R)(o),x=e.sizeBytes?` (${(i=e.sizeBytes)>=1048576?`${(i/1048576).toFixed(1)} MB`:i>=1024?`${(i/1024).toFixed(1)} KB`:`${i} B`})`:"";return(0,t.jsx)("div",{className:(0,r.f)("stg:space-y-1",n),children:l?u?(0,t.jsx)("p",{className:"stg:text-xs stg:text-muted-foreground",children:"Loading full output…"}):c?(0,t.jsx)("p",{className:"stg:text-xs stg:text-destructive",children:"Couldn't load full output. Try again."}):null!==d?(0,t.jsxs)("div",{className:"stg:space-y-1",children:[(0,t.jsx)(e$.n,{content:d,className:"stg:text-foreground"}),g&&(0,t.jsx)("button",{type:"button",onClick:()=>f(e.storageKey),disabled:m,className:"stg:inline-block stg:text-xs stg:font-medium stg:text-primary stg:underline-offset-2 stg:hover:underline stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring stg:disabled:opacity-50",children:m?"Preparing download…":`Output truncated — download full file${x}`})]}):null:(0,t.jsxs)(t.Fragment,{children:[e.preview&&(0,t.jsx)(e$.n,{content:e.preview,className:"stg:text-foreground"}),(0,t.jsxs)("button",{type:"button",onClick:()=>a(!0),className:"stg:inline-block stg:text-xs stg:font-medium stg:text-primary stg:underline-offset-2 stg:hover:underline stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring",children:["View full output",x]})]})})}function td({message:e,className:s}){return(0,t.jsxs)("div",{className:(0,r.f)("stg:space-y-1",s),children:[(0,t.jsx)("span",{className:"stg:font-medium stg:text-destructive",children:"Error"}),(0,t.jsx)("pre",{className:"stg:whitespace-pre-wrap stg:break-words stg:rounded-md stg:border stg:border-destructive/20 stg:bg-destructive-subtle stg:p-2 stg:font-mono stg:text-destructive",children:e})]})}function tu(e){let t=e.input.command;if("string"!=typeof t)return"";let s=t.replace(/\s+/g," ").trim();return s.length>80?`${s.slice(0,80)}…`:s}let tg=new Map;function tc(e){return(0,s.useMemo)(()=>{let t=$(e),s=eb(e),r=O(e),n=tg.get(t),i=n?.label?.(e),l=i??s.label,a=I(e),o="background-stop"===s.category?function(e){let t=e.stoppedBackground;if(void 0!==t){let e=tu({input:t.input});return{title:"Stopped",primaryArg:""===e?null:e}}return{title:"running"===e.state?"Stopping a command":void 0,primaryArg:null}}(e):void 0,d=i??a??o?.title??s.label,u=n?.summary?.(e,r)??function(e){switch(e.type){case"diff":{var t;let s=void 0!==(t=e).oldText&&void 0!==t.newText?e4((0,e1.f)(t.oldText,t.newText)):null;return s?`+${s.added} -${s.removed}`:null}case"terminal":return void 0!==e.exitCode&&0!==e.exitCode?`exit ${e.exitCode}`:null;case"search":return e7(e.count,e.kind);case"list":return`${e.count} ${1===e.count?"item":"items"}`;default:return null}}(r),g=n?.disclosure?.(e,r)??eg(s.category),c=n?.chrome?.(e,r)??ea(s.category),f=n?.runGroupable?.(e)??ec(s.category);return{kind:t,category:s.category,label:l,intent:a,title:d,primaryArg:void 0!==o?o.primaryArg:ek(e),result:r,resultSummary:u,disclosure:g,chrome:c,runGroupable:f}},[e])}function tf(e,t=""){switch(e){case"hook":return""===t?"decided by the agent's hook":`decided by the ${t} plugin's hook`;case"builtin_category":return"required by built-in tool policy";case"annotation_destructive_tighten":return"required: marked destructive by the server";case"auto_approve_all":return"auto-approved by a run-wide bypass";case"approval_lease":return"auto-approved by a run lease";case"unattended_skip":return"skipped: approval not available on this surface";default:return null}}function tm(e){switch(e){case"annotation_destructive_tighten":case"auto_approve_all":case"approval_lease":case"unattended_skip":case"hook":return!0;default:return!1}}function tx({toolUse:e,primaryArgTruncated:s=!1,className:n}){let{category:i,result:l,primaryArg:a}=tc(e),o=S(e.runId,"write"===i?a:null);return(0,t.jsx)("div",{className:(0,r.f)("stg:space-y-2 stg:text-xs",n),children:(0,t.jsx)(th,{toolUse:e,category:i,result:l,primaryArg:a,primaryArgTruncated:s,capturedChange:o})})}function th({toolUse:e,category:s,result:r,primaryArg:n,primaryArgTruncated:l,capturedChange:a}){let o=(0,t.jsx)(tb,{toolUse:e});switch(s){case"think":return(0,t.jsx)(tv,{toolUse:e});case"mcp":return(0,t.jsx)(eU,{toolUse:e});case"search":case"list":return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ty,{toolUse:e}),l&&n&&(0,t.jsx)(tp,{category:s,value:n}),(0,t.jsx)(e3,{view:r,showStats:!1})]});case"edit":case"write":{if("write"===s&&a)return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ty,{toolUse:e}),(0,t.jsx)(tj,{change:a})]});let n=(0,t.jsx)(e3,{view:r,showFileName:!1,showStats:!1});return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ty,{toolUse:e}),"file"===r.type?n:(0,t.jsx)(c.f,{cursorTarget:"tool-detail-expand",children:n})]})}case"read":case"delete":return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ty,{toolUse:e}),o,"error"===r.type&&(0,t.jsx)(e3,{view:r})]});case"shell":if((0,i.s)(e)&&"terminal"===r.type)return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ty,{toolUse:e}),(0,t.jsx)(e3,{view:r,live:!0})]});if("running"===e.state&&""!==e.liveOutput&&"terminal"===r.type)return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ty,{toolUse:e}),(0,t.jsx)(e3,{view:{...r,stdout:e.liveOutput},live:!0})]});return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ty,{toolUse:e}),"error"===r.type?(0,t.jsxs)(t.Fragment,{children:[o,(0,t.jsx)(e3,{view:r})]}):(0,t.jsx)(e3,{view:r})]});default:return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ty,{toolUse:e}),o,(0,t.jsx)(e3,{view:r})]})}}function tp({category:e,value:s}){return(0,t.jsxs)("div",{className:"stg:space-y-1",children:[(0,t.jsx)("span",{className:"stg:font-medium stg:text-muted-foreground",children:"list"===e?"Path":"Query"}),(0,t.jsx)("code",{className:"stg:block stg:whitespace-pre-wrap stg:break-words stg:rounded stg:bg-muted stg:px-1.5 stg:py-0.5 stg:font-mono stg:text-foreground",children:s})]})}function tb({toolUse:e}){return(0,t.jsx)(eJ,{toolName:e.name,args:e.input,mcpServerSlug:e.mcpServerName})}function tv({toolUse:e}){let s=e.input.thought,r=("string"==typeof s?s:"")||(e.result?.text??"");return r?(0,t.jsx)("div",{className:"stg:rounded-md stg:border stg:border-border-muted stg:bg-muted-faint stg:p-3",children:(0,t.jsx)(e$.n,{content:r,className:"stg:italic stg:text-muted-foreground stg:whitespace-pre-wrap"})}):null}function tj({change:e}){let r=(0,s.useMemo)(()=>(0,g.f)(e),[e]);return(0,t.jsx)(f.f,{change:r,bounded:!0,showFileName:!1})}function ty({toolUse:e}){let s=e.ask?.policySource??"";if(!tm(s))return null;let r=tf(s,e.ask?.policyHook??"");return r?(0,t.jsx)("p",{className:"stg:text-2xs stg:italic stg:text-muted-foreground",children:r}):null}function tk(e,t){if(!e||!t)return null;let s=new Date(e).getTime(),r=new Date(t).getTime();if(Number.isNaN(s)||Number.isNaN(r))return null;let n=r-s;if(n<0)return null;if(n<1e3)return`${n}ms`;if(n<6e4)return`${(n/1e3).toFixed(1)}s`;let i=Math.floor(n/6e4),l=Math.round(n%6e4/1e3);return l>0?`${i}m ${l}s`:`${i}m`}function tw(e,t){let s=tk(e,t);return null===s||s.endsWith("ms")?null:s}function tN(e){let t=(0,s.useMemo)(()=>{if(!e)return null;let t=new Date(e).getTime();return Number.isNaN(t)?null:t},[e]),[r,n]=(0,s.useState)(null);return(0,s.useEffect)(()=>{if(null===t)return void n(null);n(Math.max(0,Date.now()-t));let e=setInterval(()=>{n(Math.max(0,Date.now()-t))},1e3);return()=>clearInterval(e)},[t]),null===t?null:r}function tC(e){if(e<1e3)return"just now";let t=Math.floor(e/1e3);if(t<60)return`${t}s`;let s=Math.floor(t/60),r=t%60;if(s<60)return r>0?`${s}m ${r}s`:`${s}m`;let n=Math.floor(s/60),i=s%60;return i>0?`${n}h ${i}m`:`${n}h`}var tM=e.i(740886);let tL=(0,s.memo)(function({thread:e,subject:r="",startedAt:i="",completedAt:l="",collapsible:a=!0,className:o}){(0,n.f)("SubagentSection",{status:e.state,name:e.agentName});let d=tw(i,l),u=tT[e.state],g=u.icon,c=(0,s.useMemo)(()=>(function(e){let t=[],s=[],r=()=>{0!==s.length&&(t.push({kind:"tool-group",toolUses:s,key:`${s[0].id}-tc`}),s=[])};for(let n of e)switch(n.kind){case"tool_use":ex(n.name)||s.push(n);break;case"message":case"thinking":case"note":r(),t.push({kind:"message",message:n,key:n.id})}return r(),t})(e.items),[e.items]),f="failed"===e.state?e.reply:"",m=r||e.agentName;return a?(0,t.jsx)(tS,{thread:e,statusInfo:u,displayLabel:m,startedAt:i,duration:d,threadItems:c,error:f,className:o}):(0,t.jsx)(t$,{thread:e,subject:r,statusInfo:u,StatusIcon:g,duration:d,threadItems:c,error:f,className:o})});function tS({thread:e,statusInfo:n,displayLabel:i,startedAt:a,duration:o,threadItems:u,error:g,className:c}){let f="running"===e.state,m=(0,s.useMemo)(()=>(function e(t){return t.items.some(t=>"tool_use"===t.kind&&("waiting"===t.state||void 0!==t.thread&&e(t.thread)))})(e),[e]),[x,h]=(0,l.f)(f||m),p=`Subagent: ${i}, ${n.label}`;return(0,t.jsxs)("div",{role:"group","aria-label":p,className:(0,r.f)("stg:rounded-md stg:border stg:border-border stg:border-l-2 stg:border-l-primary/30 stg:bg-muted-faint",c),children:[(0,t.jsxs)("button",{type:"button","aria-expanded":x,onClick:h,className:(0,r.f)("stg:flex stg:w-full stg:items-center stg:gap-2 stg:px-2.5 stg:py-1.5 stg:text-left stg:text-xs stg:text-muted-foreground stg:transition-colors","stg:hover:bg-muted-subtle","stg:cursor-pointer"),children:[(0,t.jsx)("span",{className:"stg:shrink-0 stg:text-primary-muted","aria-hidden":"true",children:(0,t.jsx)(tR,{})}),(0,t.jsx)("span",{className:"stg:min-w-0 stg:flex-1 stg:truncate",children:i}),f&&(0,t.jsx)("span",{className:"stg:shrink-0 stg:text-muted-foreground","aria-hidden":"true",children:(0,t.jsx)(d.L,{size:12})}),(0,t.jsx)("span",{className:(0,r.f)("stg:shrink-0 stg:rounded stg:px-1 stg:py-0.5 stg:text-2xs stg:font-medium stg:leading-none",n.badgeClass),children:n.label}),f?(0,t.jsx)(tA,{startedAt:a}):o&&(0,t.jsx)("span",{className:"stg:shrink-0 stg:tabular-nums stg:text-muted-foreground",children:o}),(0,t.jsx)(tF,{expanded:x})]}),(0,t.jsx)("div",{className:(0,r.f)("stg:grid stg:transition-[grid-template-rows] stg:duration-150 stg:ease-out",x?"stg:grid-rows-[1fr]":"stg:grid-rows-[0fr]"),children:(0,t.jsx)("div",{className:"stg:overflow-hidden",children:x&&(0,t.jsx)("div",{className:"stg:border-t stg:border-border-muted stg:px-2.5 stg:pb-2 stg:pt-1.5",children:(0,t.jsx)(t_,{threadItems:u,input:e.input,error:g})})})})]})}function tA({startedAt:e}){let s=tN(e);return null===s?null:(0,t.jsx)("span",{className:"stg:shrink-0 stg:tabular-nums stg:text-muted-foreground",children:tC(s)})}function t$({thread:e,subject:s,statusInfo:n,StatusIcon:i,duration:l,threadItems:a,error:o,className:d}){return(0,t.jsxs)("div",{className:(0,r.f)("stg:border-l-2 stg:border-primary/20 stg:pl-3",d),children:[(0,t.jsxs)("div",{className:"stg:flex stg:flex-wrap stg:items-center stg:gap-x-2 stg:gap-y-1 stg:py-1.5 stg:text-xs",children:[(0,t.jsx)("span",{className:(0,r.f)("stg:shrink-0",n.colorClass),"aria-hidden":"true",children:(0,t.jsx)(i,{})}),(0,t.jsx)("span",{className:"stg:font-medium stg:text-foreground",children:e.agentName}),s&&(0,t.jsx)("span",{className:"stg:text-muted-foreground",children:s}),l&&(0,t.jsx)("span",{className:"stg:tabular-nums stg:text-muted-foreground",children:l})]}),(0,t.jsx)(t_,{threadItems:a,input:e.input,error:o})]})}function t_({threadItems:e,input:s,error:r}){return(0,t.jsxs)(t.Fragment,{children:[s&&(0,t.jsx)("div",{className:"stg:border-l-2 stg:border-muted-foreground/25 stg:pl-2.5 stg:text-xs stg:text-muted-foreground stg:whitespace-pre-wrap stg:mb-1",children:s}),e.length>0&&(0,t.jsx)("div",{className:"stg:flex stg:flex-col stg:gap-1 stg:pb-1",children:e.map(e=>{switch(e.kind){case"message":return(0,t.jsx)(tM.f,{message:e.message},e.key);case"tool-group":return(0,t.jsx)(sj,{toolUses:e.toolUses},e.key)}})}),r&&(0,t.jsx)("div",{className:"stg:rounded-md stg:border stg:border-destructive/20 stg:bg-destructive-subtle stg:px-2 stg:py-1.5 stg:text-xs stg:text-destructive",children:r})]})}let tT={running:{label:"Running",colorClass:"stg:text-foreground",badgeClass:"stg:bg-muted stg:text-foreground",icon:()=>(0,t.jsx)(d.L,{size:12})},completed:{label:"Completed",colorClass:"stg:text-status-ready",badgeClass:"stg:bg-status-ready-subtle stg:text-status-ready",icon:function(){return(0,t.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("circle",{cx:"6",cy:"6",r:"4.5"}),(0,t.jsx)("path",{d:"M4 6L5.5 7.5L8 4.5"})]})}},failed:{label:"Failed",colorClass:"stg:text-destructive",badgeClass:"stg:bg-status-failed-subtle stg:text-status-failed",icon:tI},stopped:{label:"Stopped",colorClass:"stg:text-muted-foreground",badgeClass:"stg:bg-muted stg:text-muted-foreground",icon:tI}};function tI(){return(0,t.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("circle",{cx:"6",cy:"6",r:"4.5"}),(0,t.jsx)("path",{d:"M4.5 4.5L7.5 7.5M7.5 4.5L4.5 7.5"})]})}function tR(){return(0,t.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("rect",{x:"2",y:"6",width:"12",height:"8",rx:"2"}),(0,t.jsx)("path",{d:"M5.5 10H5.51M10.5 10H10.51",strokeWidth:"2"}),(0,t.jsx)("path",{d:"M8 2V6"}),(0,t.jsx)("circle",{cx:"8",cy:"1.5",r:"1"}),(0,t.jsx)("path",{d:"M0.5 9.5H2M14 9.5H15.5"})]})}function tF({expanded:e}){return(0,t.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:(0,r.f)("stg:shrink-0 stg:text-muted-foreground stg:transition-transform stg:duration-150",e&&"stg:rotate-90"),"aria-hidden":"true",children:(0,t.jsx)("path",{d:"M4.5 2.5L7.5 6L4.5 9.5"})})}let tB=(0,r.f)("stg:inline-flex stg:items-center stg:justify-center stg:gap-1.5 stg:rounded-md stg:px-3 stg:py-1.5","stg:text-xs stg:font-medium stg:transition-colors","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring stg:focus-visible:ring-offset-2","stg:disabled:cursor-not-allowed stg:disabled:opacity-50 stg:disabled:pointer-events-none"),tU={primary:"stg:border stg:border-border stg:bg-accent stg:text-accent-foreground stg:hover:bg-accent-hover",ghost:"stg:text-muted-foreground stg:hover:text-foreground stg:hover:bg-accent-hover",danger:(0,r.f)("stg:text-muted-foreground","stg:hover:bg-destructive-subtle stg:hover:text-destructive","stg:focus-visible:bg-destructive-subtle stg:focus-visible:text-destructive")};function tE({label:e,variant:s,onClick:n,isSubmitting:i=!1,isActive:l=!1,disabled:a=!1,className:o,cursorTarget:u,ariaDescribedby:g}){return(0,t.jsxs)("button",{type:"button",disabled:i||a,onClick:n,"aria-label":e,"aria-describedby":g,"data-cursor-target":u,className:(0,r.f)(tB,tU[s],o),children:[l&&i?(0,t.jsx)(d.L,{}):null,e]})}function tW({error:e,leadIn:s,cursorTarget:r}){return(0,t.jsxs)("p",{role:"alert",className:"stg:text-2xs stg:text-destructive","data-cursor-target":r,children:["Couldn’t ",s," — ",e.message]})}var tP=e.i(933221);let tD=(0,s.memo)(function({toolUse:e,onAnswer:s,isSubmitting:n=!1,error:i=null,className:l}){let a="delete"===eb(e).category?"stg:border-l-2 stg:border-l-destructive":"stg:border-l-2 stg:border-l-warning";return(0,t.jsxs)("div",{role:"alert","aria-label":`Approval required for ${e.name}`,className:(0,r.f)("stg:rounded-lg stg:border stg:border-border-prominent",a,l),children:[(0,t.jsx)(tO,{toolUse:e,bordered:!0}),(0,t.jsx)(tH,{toolUse:e,onAnswer:s,isSubmitting:n,error:i})]})});function tO({toolUse:e,bordered:n=!1}){let i=eb(e),l=sg[i.category],a=e.ask?.argsPreview??"",o=(0,s.useMemo)(()=>ew(e.name,a,e.mcpServerName),[e.name,a,e.mcpServerName]),d=(0,s.useMemo)(()=>eN(e.name,a,e.mcpServerName),[e.name,a,e.mcpServerName]);return(0,t.jsxs)("div",{className:(0,r.f)("stg:flex stg:items-center stg:gap-2 stg:px-2.5 stg:py-1.5 stg:text-xs",n&&"stg:border-b stg:border-border-muted"),children:[(0,t.jsx)("span",{className:"stg:shrink-0 stg:text-status-degraded","aria-hidden":"true",children:(0,t.jsx)(l,{})}),(0,t.jsxs)("span",{className:"stg:min-w-0 stg:flex-1 stg:flex stg:items-center stg:gap-1.5 stg:overflow-hidden",children:[(0,t.jsx)("span",{className:"stg:shrink-0 stg:font-medium stg:text-foreground",children:d??i.label}),o&&"shell"!==i.category&&(ef(i.category)?(0,t.jsx)(eq.f,{path:o,className:"stg:min-w-0 stg:text-xs stg:text-muted-foreground"}):(0,t.jsx)("span",{className:"stg:min-w-0 stg:truncate stg:font-mono stg:text-muted-foreground",children:o}))]}),(0,t.jsx)(tV,{requestedAt:e.ask?.processedAt??e.processedAt}),(0,t.jsx)("span",{className:"stg:shrink-0 stg:text-status-degraded","aria-hidden":"true",children:(0,t.jsx)(tz,{})})]})}function tH({toolUse:e,onAnswer:n,isSubmitting:i=!1,error:l=null,className:a}){let[o,d]=(0,s.useState)(null),[u,g]=(0,s.useState)(!1),[c,f]=(0,s.useState)(""),m=(0,s.useId)(),x=(0,s.useCallback)((e,t)=>{d(e),n(e,t)},[n]),h=(0,s.useCallback)(e=>{e.preventDefault();let t=c.trim();x("deny",""===t?void 0:t)},[c,x]);(0,s.useEffect)(()=>{i||d(null)},[i]);let p=e.ask,b=p?.argsPreview??"",v=p?.policySource??"",j=p?.policyHook??"",y=eb(e),k=(0,s.useMemo)(()=>{let t=eS(b);return t?eA(t,e.input):null},[b,e.input]),w=(0,s.useMemo)(()=>(function(e,t){let{mcpServerName:s}=t;if("hook"===t.policySource){var r,n;return r=function(e,t,s){if(s)return`${t} calls`;switch(e){case"shell":return"shell commands";case"delete":return"file deletions";case"write":return"file writes";case"edit":return"file edits";default:return`${t} calls`}}(e,t.name,s),""===(n=t.policyHook)?`Approve all ${r} the agent's hooks ask about`:`Approve all ${r} the ${n} plugin asks about`}if(s)return`Approve all ${s} tools`;switch(e){case"shell":return"Approve all shell commands";case"delete":return"Approve all file deletions";case"write":case"edit":return"Approve all file edits";default:return"Approve all of this kind"}})(y.category,{name:e.name,mcpServerName:e.mcpServerName,policySource:v,policyHook:j}),[y.category,e.name,e.mcpServerName,v,j]),N=(0,s.useMemo)(()=>tf(v,j),[v,j]),C=null!=N&&tm(v),M=p?.message??"",L=""!==M&&"shell"!==y.category&&!ef(y.category),S="write"===y.category||"edit"===y.category,A=(0,s.useMemo)(()=>k?eL(k):null,[k]),_=null;if(S&&null===A){let s="file_write"===$(e)?"create":"no-preview";_=(0,t.jsx)(e5.f,{kind:s})}else k&&(_=(0,t.jsx)(eJ,{toolName:e.name,args:k,mcpServerSlug:e.mcpServerName,showFileName:!S}));return(0,t.jsxs)("div",{className:(0,r.f)("stg:px-3 stg:py-2.5 stg:space-y-2",a),children:[L&&(0,t.jsx)("p",{className:"stg:text-xs stg:text-foreground",children:M}),_,"shell"===y.category&&(0,t.jsx)("p",{className:"stg:text-2xs stg:italic stg:text-muted-foreground",children:"Files this command creates or changes are covered by this approval — they are kept automatically, with no second review."}),"shell"===y.category&&!0===e.input.background&&(0,t.jsx)("p",{className:"stg:text-2xs stg:italic stg:text-muted-foreground","data-cursor-target":"approval-background-note",children:"Runs in the background while the agent works; it stops when the turn ends or pauses for approval."}),u?(0,t.jsxs)("form",{onSubmit:h,className:"stg:flex stg:items-center stg:gap-2 stg:pt-1","data-cursor-target":"deny-reason-form",children:[(0,t.jsx)("label",{htmlFor:m,className:"stg:sr-only",children:"Reason for denying (optional)"}),(0,t.jsx)("input",{id:m,type:"text",autoFocus:!0,value:c,onChange:e=>f(e.target.value),placeholder:"Tell the agent why (optional)",maxLength:2e3,disabled:i,className:(0,r.f)(tP.a,"stg:min-w-0 stg:flex-1")}),(0,t.jsx)("button",{type:"submit",disabled:i,"aria-label":"Deny","data-cursor-target":"deny-confirm-button",className:tK,children:"Deny"}),(0,t.jsx)(tE,{label:"Cancel",variant:"ghost",onClick:()=>{g(!1),f("")},isSubmitting:i})]}):(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-2 stg:pt-1",children:[(0,t.jsx)(tE,{label:"Approve",variant:"primary",onClick:()=>x("allow"),isActive:"allow"===o,isSubmitting:i,cursorTarget:"approve-button"}),(0,t.jsx)(tE,{label:"Deny",variant:"danger",onClick:()=>g(!0),isSubmitting:i,cursorTarget:"deny-button"}),(0,t.jsx)(tE,{label:w,variant:"ghost",onClick:()=>x("grant"),isActive:"grant"===o,isSubmitting:i,className:"stg:ml-auto",cursorTarget:"approve-all-button"})]}),C&&(0,t.jsx)("p",{className:"stg:text-2xs stg:italic stg:text-muted-foreground","data-cursor-target":"approval-gate-reason",children:N}),l&&(0,t.jsx)(tW,{error:l,leadIn:"submit decision",cursorTarget:"approval-error"})]})}let tK=(0,r.f)("stg:inline-flex stg:shrink-0 stg:items-center stg:justify-center stg:gap-1.5 stg:rounded-md stg:px-3 stg:py-1.5","stg:text-xs stg:font-medium stg:transition-colors stg:text-destructive","stg:hover:bg-destructive-subtle","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring stg:focus-visible:ring-offset-2","stg:disabled:cursor-not-allowed stg:disabled:opacity-50 stg:disabled:pointer-events-none");function tV({requestedAt:e}){let s=tN(e);return null===s?null:(0,t.jsx)("span",{className:"stg:shrink-0 stg:text-xs stg:text-muted-foreground",children:tC(s)})}function tz(){return(0,t.jsxs)("svg",{width:"10",height:"10",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("circle",{cx:"6",cy:"6",r:"4.5"}),(0,t.jsx)("path",{d:"M6 3.5V6L7.5 7.5"})]})}var tq=e.i(610595),tJ=e.i(564138),tG=e.i(379410),tY=e.i(832981),tZ=e.i(689960),tX=e.i(910304),tQ=e.i(255817),t0=e.i(616701);let t1={memory:null,notFound:!1};var t2=e.i(631829);function t5({memoryId:e,fact:n,className:i}){let{memory:l,isLoading:a,notFound:o,error:d}=function(e){let t=(0,tQ.f)(),{data:s,isLoading:r,error:n,refetch:i}=(0,t0.f)(e?()=>t.memory.get(e).then(e=>({memory:e,notFound:!1}),e=>{if((0,tX.c)(e))return{memory:null,notFound:!0};throw e}):null,[t,e],t1);return{memory:s.memory,isLoading:r,notFound:s.notFound,error:n,refetch:i}}(e),{confirmMemory:u,isConfirming:g,error:c}=(0,tZ.f)(),{rejectMemory:f,isRejecting:m,error:x}=(0,t2.f)(),[h,p]=(0,s.useState)(null),b=(0,s.useCallback)(async t=>{try{p(await t(e))}catch{}},[e]),v=h??l,j=v?.status?.lifecycleState,y=v?.spec?.content||n,k=v?(0,tY.A)(v):null,w=c??x,N=g||m,C=!o&&null==d&&(void 0===j||j===tJ._.lifecycle_state_unspecified||j===tJ._.lifecycle_state_proposed);return(0,t.jsxs)("div",{className:(0,r.f)("stg:space-y-2",i),"data-cursor-target":"memory-proposal",children:[(0,t.jsx)("p",{className:"stg:text-sm stg:text-foreground stg:whitespace-pre-wrap",children:y}),(0,t.jsxs)("p",{className:"stg:text-xs stg:text-muted-foreground",children:[k?`${k} \xb7 `:"","Proposed to remember — nothing is stored in your sessions until you confirm it."]}),o?(0,t.jsx)("p",{className:"stg:text-xs stg:text-muted-foreground",role:"status",children:"No longer stored."}):d?(0,t.jsx)("p",{className:"stg:text-xs stg:text-muted-foreground",role:"status",children:"Couldn't load this proposal's current state — review it in Settings → Memory."}):C?(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-1.5",children:[(0,t.jsxs)(t3,{label:`Confirm memory: ${y}`,onClick:()=>void b(u),disabled:N||a,emphasis:"primary",children:[g&&(0,t.jsx)(tG.f,{size:12}),"Confirm"]}),(0,t.jsxs)(t3,{label:`Reject memory: ${y}`,onClick:()=>void b(f),disabled:N||a,children:[m&&(0,t.jsx)(tG.f,{size:12}),"Reject"]})]}):(0,t.jsx)("p",{className:"stg:text-xs stg:text-muted-foreground",role:"status",children:j===tJ._.lifecycle_state_confirmed?"Confirmed — recalled in your future sessions.":"Rejected — not stored."}),w&&(0,t.jsx)("p",{className:"stg:text-2xs stg:text-destructive",role:"alert",children:(0,tq.g)(w)})]})}function t3({label:e,onClick:s,disabled:n,emphasis:i,children:l}){return(0,t.jsx)("button",{type:"button","aria-label":e,onClick:s,disabled:n,className:(0,r.f)("stg:inline-flex stg:items-center stg:gap-1 stg:rounded-md stg:px-2.5 stg:py-1 stg:text-xs stg:font-medium","primary"===i?"stg:bg-primary stg:text-primary-foreground stg:hover:bg-primary-hover":"stg:border stg:border-input stg:bg-background stg:text-foreground stg:hover:bg-accent stg:hover:text-accent-foreground","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring","stg:disabled:pointer-events-none stg:disabled:opacity-50"),children:l})}let t4={submittingIds:new Set,errorsByToolUseId:new Map},t6=(0,s.createContext)(t4);function t8(e){let{onAnswer:t,submittingIds:r,errorsByToolUseId:n}=(0,s.useContext)(t6),i=e.id,l=(0,s.useCallback)((e,s)=>{t?.(i,e,s)},[t,i]);return"waiting"===e.state&&t?{toolUse:e,onAnswer:l,isSubmitting:r.has(i),error:n.get(i)??null}:null}e.s(["E",0,t6,"x",0,t8],151373);let t7={stoppingIds:new Set,errorsByToolUseId:new Map},t9=(0,s.createContext)(t7);function se(e){let{onStop:t,stoppingIds:r,errorsByToolUseId:n}=(0,s.useContext)(t9),l=e.id,a=(0,s.useCallback)(()=>{t?.(l)},[t,l]);return(0,i.s)(e)&&t?{onStop:a,isStopping:r.has(l)||e.background?.stopRequested===!0,error:n.get(l)??null}:null}function st(e){switch(e.state){case"running":return"Running in the background";case"exited":return`Exited \xb7 code ${e.exitCode??0}`;case"timed_out":return"Timed out";case"failed_to_start":return"Failed to start";case"stopped":switch(e.stoppedBy){case"person":return"Stopped by a person";case"agent":return"Stopped by the agent";case"approval":return"Stopped when the turn paused for approval";default:return"Stopped with the turn"}}}function ss({toolUse:e}){let s=e.background,n=s?.state==="running",i=tN(n?s?.startedAt??"":""),l=se(e);if(void 0===s)return null;let a="running"!==s.state,d="failed_to_start"===s.state||"timed_out"===s.state||"exited"===s.state&&0!==s.exitCode;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"stg:shrink-0 stg:rounded stg:bg-muted stg:px-1 stg:py-0.5 stg:text-2xs stg:font-medium stg:leading-none stg:text-muted-foreground","data-cursor-target":"background-command-chip",children:"Background"}),(0,t.jsx)("span",{className:(0,r.f)("stg:shrink-0 stg:tabular-nums",a&&d?"stg:text-destructive":"stg:text-muted-foreground"),"data-cursor-target":"background-command-status",children:n?`${st(s)}${null!==i&&i>=1e3?` \xb7 ${tC(i)}`:""}`:st(s)}),l&&(0,t.jsx)(o.$,{className:"stg:shrink-0",children:(0,t.jsx)(tE,{label:l.isStopping?"Stopping…":"Stop",variant:"danger",onClick:l.onStop,isSubmitting:l.isStopping,isActive:l.isStopping,className:"stg:px-2 stg:py-0.5",cursorTarget:"background-command-stop"})})]})}function sr({toolUse:e}){let s=se(e);return s?.error==null?null:(0,t.jsx)(tW,{error:s.error,leadIn:"stop the command",cursorTarget:"background-command-stop-error"})}e.s(["$",0,t9,"L",0,se],945317);var sn=e.i(165971),si=e.i(188482);let sl=(0,s.memo)(function({toolUse:e,defaultExpanded:s=!1,bordered:d=!0,className:g}){var c,f,m,x,h;let p;(0,n.f)("ToolCallItem",{status:e.state,id:e.id});let b=(0,i.s)(e),v=b?"running":sd[e.state],j=sx[v],y=tw(e.processedAt,e.result?.processedAt??""),k=e.thread,w=void 0!==k,{category:N,label:C,intent:M,title:S,primaryArg:A,result:$,resultSummary:_,disclosure:T,chrome:I}=tc(e),R=sg[N],F=t8(e),B=!w&&"tail"===T,U=B&&("failed"===e.state||"error"===$.type||"terminal"===$.type&&void 0!==$.exitCode&&0!==$.exitCode),E="running"===e.state||b||null!=F||U,[W,P]=(0,l.f)(E,{initialOpen:s||E}),D=w?ey(e)||k.agentName||C:S,O=void 0===(c=e).ask?null:c.confirmation?.result==="deny"?{label:"Denied",colorClass:"stg:bg-status-failed-subtle stg:text-status-failed"}:c.confirmation?.result==="allow"||void 0!==c.grant?{label:"Approved",colorClass:"stg:bg-status-ready-subtle stg:text-status-ready"}:null,H=L(e.runId,"write"===(f=N)||"edit"===f||"delete"===f?A:null),K=H?so[H]:null,V=!w&&"read"===N&&("completed"===e.state||"denied"===e.state),z=w?null:"shell"===N?M?A:null:A,q=!w&&null!=A&&ef(N),J=B&&null==F&&"terminal"===$.type?$:null,G=!w&&("preview"===T||B&&null==J),Y=!V&&!G,Z=!q&&z?z:null,X="search"===N||"list"===N,Q=null!==Z&&(X||Y),{ref:ee,isTruncated:et}=(0,a.f)(Q),es=null!=F?"delete"===N?"destructive":"warning":null,er="failed"===e.state||"error"===$.type,en=d?"quiet"!==I||w||null!=F||er?"card":"quiet":"row",ei=(0,t.jsxs)(t.Fragment,{children:[O&&(0,t.jsx)("span",{className:(0,r.f)("stg:shrink-0 stg:rounded stg:px-1 stg:py-0.5 stg:text-2xs stg:font-medium stg:leading-none",O.colorClass),children:O.label}),K&&(0,t.jsx)("span",{className:(0,r.f)("stg:shrink-0 stg:rounded stg:px-1 stg:py-0.5 stg:text-2xs stg:font-medium stg:leading-none",K.colorClass),"data-cursor-target":"file-review-row-badge",children:K.label}),e.mcpServerName&&(0,t.jsx)("span",{className:"stg:shrink-0 stg:rounded stg:bg-muted stg:px-1 stg:py-0.5 stg:font-mono stg:text-muted-foreground",children:e.mcpServerName}),(0,t.jsx)(ss,{toolUse:e}),j&&(0,t.jsx)("span",{className:(0,r.f)("stg:shrink-0",su[v]),"aria-hidden":"true",children:(0,t.jsx)(j,{})}),y&&(0,t.jsx)("span",{className:"stg:shrink-0 stg:tabular-nums stg:text-muted-foreground",children:y})]});if(V)return(0,t.jsx)(o.J,{variant:en,accent:es,cursorTarget:"tool-call-row",className:g,children:(0,t.jsxs)(o.A,{children:[(0,t.jsx)("span",{className:"stg:shrink-0 stg:text-muted-foreground","aria-hidden":"true",children:(0,t.jsx)(R,{})}),(0,t.jsxs)("span",{className:"stg:min-w-0 stg:flex-1 stg:flex stg:items-center stg:gap-1.5 stg:overflow-hidden",children:[(0,t.jsx)("span",{className:"stg:shrink-0 stg:font-medium stg:text-foreground",children:D}),A&&(0,t.jsx)(eq.f,{path:A,className:"stg:min-w-0 stg:text-xs"})]}),ei]})});let el=w?(0,t.jsx)(tL,{thread:k,subject:ey(e),startedAt:e.processedAt,completedAt:e.result?.processedAt,collapsible:!1}):F?(0,t.jsx)(tH,{toolUse:F.toolUse,onAnswer:F.onAnswer,isSubmitting:F.isSubmitting,error:F.error}):"memoryProposal"===$.type?(0,t.jsx)(t5,{memoryId:$.memoryId,fact:$.fact}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(sr,{toolUse:e}),(0,t.jsx)(tx,{toolUse:e,primaryArgTruncated:X&&et})]}),ea=w||"shell"===N?null:_,eo=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"stg:shrink-0 stg:text-muted-foreground","aria-hidden":"true",children:(0,t.jsx)(R,{})}),(0,t.jsxs)("span",{className:"stg:min-w-0 stg:flex-1 stg:flex stg:items-baseline stg:gap-1.5 stg:overflow-hidden",children:[(0,t.jsx)("span",{className:(0,r.f)("stg:shrink-0 stg:font-medium","running"===v?"stgm-shimmer-label":"stg:text-foreground"),children:D}),q&&A?(0,t.jsx)(o.$,{className:"stg:inline-flex stg:min-w-0",children:(0,t.jsx)(eq.f,{path:A,className:"stg:min-w-0 stg:text-xs stg:text-muted-foreground"})}):Z&&(Y?(0,t.jsx)("span",{ref:Q?ee:void 0,className:sa,children:Z}):(0,t.jsxs)(si.W,{children:[(0,t.jsx)(si.y,{render:(0,t.jsx)("span",{ref:Q?ee:void 0,className:sa}),children:Z}),(0,t.jsx)(si.Y,{side:"top",className:"stg:break-all",children:Z})]})),ea&&(0,t.jsx)("span",{className:"stg:shrink-0 stg:tabular-nums stg:text-muted-foreground",children:ea})]}),ei]});if(G){let e=null!=F||"empty"!==$.type;return(0,t.jsxs)(o.J,{variant:en,accent:es,cursorTarget:"tool-call-row",className:g,children:[(0,t.jsx)(o.A,{children:eo}),e&&(0,t.jsx)(o.b,{cursorTarget:"tool-preview",rail:"quiet"===en,children:el})]})}let ed={kind:"expand",expanded:W,onToggle:P,label:(m=D,x=q&&A?(0,sn.V)(A).base:Z,h=ea,p=x?`${m} ${x}`:m,h?`${p}, ${h}`:p),...Z&&et?{hint:Z}:{}};return J?(0,t.jsxs)(o.J,{variant:en,accent:es,cursorTarget:"tool-call-row",className:g,children:[(0,t.jsx)(o.A,{gesture:ed,children:eo}),W?(0,t.jsx)(o.b,{cursorTarget:"tool-preview",children:el}):(0,t.jsx)(o.b,{children:(0,t.jsx)(u.P,{command:J.command,stdout:J.stdout,stderr:J.stderr,exitCode:J.exitCode})})]}):(0,t.jsxs)(o.J,{variant:en,accent:es,cursorTarget:"tool-call-row",className:g,children:[(0,t.jsx)(o.A,{gesture:ed,children:eo}),W&&(0,t.jsx)(o.b,{rail:"quiet"===en,children:el})]})}),sa="stg:min-w-0 stg:truncate stg:text-muted-foreground stg:font-mono",so={pending:{label:"Pending review",colorClass:"stg:bg-status-degraded-subtle stg:text-status-degraded"},kept:{label:"Kept",colorClass:"stg:bg-status-ready-subtle stg:text-status-ready"},discarded:{label:"Discarded",colorClass:"stg:bg-status-failed-subtle stg:text-status-failed"},failed:{label:"Review failed",colorClass:"stg:bg-status-failed-subtle stg:text-status-failed"}},sd={running:"running",waiting:"waiting",failed:"failed",completed:"completed",denied:"completed",stopped:"interrupted"},su={running:"stg:text-foreground",waiting:"stg:text-status-degraded",failed:"stg:text-destructive",completed:"stg:text-status-ready",interrupted:"stg:text-muted-foreground"},sg={shell:function(){return(0,t.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("rect",{x:"1",y:"1.5",width:"10",height:"9",rx:"1.5"}),(0,t.jsx)("path",{d:"M3 4.5L5 6.5L3 8.5"}),(0,t.jsx)("path",{d:"M6.5 8.5H9"})]})},read:function(){return(0,t.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("path",{d:"M7 1H3C2.45 1 2 1.45 2 2V10C2 10.55 2.45 11 3 11H9C9.55 11 10 10.55 10 10V4L7 1Z"}),(0,t.jsx)("path",{d:"M7 1V4H10"})]})},write:sf,edit:sf,delete:function(){return(0,t.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("path",{d:"M2 3H10"}),(0,t.jsx)("path",{d:"M3 3V10C3 10.55 3.45 11 4 11H8C8.55 11 9 10.55 9 10V3"}),(0,t.jsx)("path",{d:"M4.5 1H7.5"})]})},search:function(){return(0,t.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("circle",{cx:"5.5",cy:"5.5",r:"3.5"}),(0,t.jsx)("path",{d:"M8 8L10.5 10.5"})]})},list:function(){return(0,t.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,t.jsx)("path",{d:"M1.5 3V9.5C1.5 10.05 1.95 10.5 2.5 10.5H9.5C10.05 10.5 10.5 10.05 10.5 9.5V4.5C10.5 3.95 10.05 3.5 9.5 3.5H6L5 2H2.5C1.95 2 1.5 2.45 1.5 3Z"})})},fetch:sc,"web-search":sc,think:function(){return(0,t.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("path",{d:"M6 2C4.9 2 4 2.9 4 4C3.17 4 2.5 4.67 2.5 5.5C2.5 6.33 3 6.87 3 6.87C2.5 7.37 2.5 8.13 3 8.63C3.5 9.13 4.3 9.13 4.8 8.63L6 7.5"}),(0,t.jsx)("path",{d:"M6 2C7.1 2 8 2.9 8 4C8.83 4 9.5 4.67 9.5 5.5C9.5 6.33 9 6.87 9 6.87C9.5 7.37 9.5 8.13 9 8.63C8.5 9.13 7.7 9.13 7.2 8.63L6 7.5"}),(0,t.jsx)("path",{d:"M6 7.5V11"})]})},subagent:function(){return(0,t.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("rect",{x:"2",y:"4",width:"8",height:"6",rx:"1.5"}),(0,t.jsx)("circle",{cx:"4.5",cy:"7",r:"0.75",fill:"currentColor",stroke:"none"}),(0,t.jsx)("circle",{cx:"7.5",cy:"7",r:"0.75",fill:"currentColor",stroke:"none"}),(0,t.jsx)("path",{d:"M6 1V4"}),(0,t.jsx)("circle",{cx:"6",cy:"1",r:"0.75"})]})},internal:sm,mcp:function(){return(0,t.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("path",{d:"M4 1.5V4"}),(0,t.jsx)("path",{d:"M8 1.5V4"}),(0,t.jsx)("path",{d:"M2.5 4H9.5V6.5C9.5 8.43 7.93 10 6 10C4.07 10 2.5 8.43 2.5 6.5V4Z"}),(0,t.jsx)("path",{d:"M6 10V11"})]})},memory:function(){return(0,t.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,t.jsx)("path",{d:"M9 11L6 8.5L3 11V2.5C3 1.95 3.45 1.5 4 1.5H8C8.55 1.5 9 1.95 9 2.5V11Z"})})},"background-stop":function(){return(0,t.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,t.jsx)("rect",{x:"3",y:"3",width:"6",height:"6",rx:"1"})})},skill:function(){return(0,t.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("path",{d:"M2 2.5a1 1 0 0 1 1-1h6.5v8H3a1 1 0 0 0-1 1z"}),(0,t.jsx)("path",{d:"M2 10.5a1 1 0 0 1 1-1h6.5v1.5H3a1 1 0 0 1-1-1z"})]})},unknown:sm};function sc(){return(0,t.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("circle",{cx:"6",cy:"6",r:"4.5"}),(0,t.jsx)("path",{d:"M1.5 6H10.5"}),(0,t.jsx)("path",{d:"M6 1.5C7.5 3 7.5 9 6 10.5C4.5 9 4.5 3 6 1.5Z"})]})}function sf(){return(0,t.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("path",{d:"M7 1H3C2.45 1 2 1.45 2 2V10C2 10.55 2.45 11 3 11H9C9.55 11 10 10.55 10 10V4L7 1Z"}),(0,t.jsx)("path",{d:"M7 1V4H10"}),(0,t.jsx)("path",{d:"M5 7L8 7"}),(0,t.jsx)("path",{d:"M5 9L7 9"})]})}function sm(){return(0,t.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,t.jsx)("path",{d:"M8.5 2C7.67 2 7 2.67 7 3.5C7 3.78 7.08 4.04 7.22 4.26L3.74 7.74C3.52 7.6 3.27 7.5 3 7.5C2.17 7.5 1.5 8.17 1.5 9C1.5 9.83 2.17 10.5 3 10.5C3.83 10.5 4.5 9.83 4.5 9C4.5 8.73 4.4 8.48 4.26 8.26L7.74 4.78C7.96 4.92 8.22 5 8.5 5C9.33 5 10 4.33 10 3.5C10 3.22 9.92 2.96 9.78 2.74L8.5 4L7.5 3L8.76 1.72C8.54 1.58 8.28 1.5 8 1.5"})})}let sx={running:d.L,waiting:d.P,failed:d.M,completed:null,interrupted:d.q},sh=(0,s.memo)(function({category:e,toolUses:s,formatLabel:i,className:a}){var o;(0,n.f)("ToolRunGroup",{category:e,count:s.length});let d=(o=s).some(e=>"running"===e.state)?"running":o.some(e=>"waiting"===e.state)?"waiting":o.some(e=>"failed"===e.state)?"failed":"completed",u="running"===d,[g,c]=(0,l.f)(u||"waiting"===d),f=i?i(s):function(e,t){switch(e){case"read":return`Read ${t} files`;case"list":return`Listed ${t} directories`;case"search":return`Searched ${t} times`;default:return`${t} calls`}}(e,s.length),m=sg[e],x=sb[d];return(0,t.jsxs)("div",{role:"group","aria-label":f,"data-cursor-target":"tool-run-group",className:a,children:[(0,t.jsxs)("button",{type:"button","aria-expanded":g,onClick:c,className:(0,r.f)("stg:flex stg:w-full stg:cursor-pointer stg:items-center stg:gap-2 stg:px-2.5 stg:py-1.5 stg:text-left stg:text-xs stg:text-muted-foreground stg:transition-colors","stg:hover:bg-muted-subtle","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-inset stg:focus-visible:ring-ring"),children:[(0,t.jsx)("span",{className:"stg:shrink-0 stg:text-muted-foreground","aria-hidden":"true",children:(0,t.jsx)(m,{})}),(0,t.jsx)("span",{className:(0,r.f)("stg:min-w-0 stg:flex-1 stg:truncate stg:font-medium",u?"stgm-shimmer-label":"stg:text-foreground"),children:f}),x&&(0,t.jsx)("span",{className:(0,r.f)("stg:shrink-0",sp[d]),"aria-hidden":"true",children:(0,t.jsx)(x,{})}),(0,t.jsx)(sv,{expanded:g})]}),g&&(0,t.jsx)("div",{className:"stg:ml-1.5 stg:border-l-2 stg:border-border-muted stg:pl-2",children:s.map(e=>(0,t.jsx)(sl,{toolUse:e,bordered:!1},e.id))})]})},function(e,t){if(e.category!==t.category||e.toolUses.length!==t.toolUses.length)return!1;for(let s=0;s<e.toolUses.length;s++)if(e.toolUses[s]!==t.toolUses[s])return!1;return e.formatLabel===t.formatLabel&&e.className===t.className}),sp={running:"stg:text-foreground",waiting:"stg:text-status-degraded",failed:"stg:text-destructive",completed:"stg:text-status-ready"},sb={running:d.L,waiting:function(){return(0,t.jsxs)("svg",{width:"10",height:"10",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("circle",{cx:"6",cy:"6",r:"4.5"}),(0,t.jsx)("path",{d:"M6 3.5V6L7.5 7.5"})]})},failed:function(){return(0,t.jsxs)("svg",{width:"10",height:"10",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("circle",{cx:"6",cy:"6",r:"4.5"}),(0,t.jsx)("path",{d:"M4.5 4.5L7.5 7.5M7.5 4.5L4.5 7.5"})]})},completed:null};function sv({expanded:e}){return(0,t.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:(0,r.f)("stg:shrink-0 stg:text-muted-foreground stg:transition-transform stg:duration-150",e&&"stg:rotate-90"),"aria-hidden":"true",children:(0,t.jsx)("path",{d:"M3.5 2L6.5 5L3.5 8"})})}let sj=(0,s.memo)(function({toolUses:e,formatSummary:i,className:l}){(0,n.f)("ToolCallGroup",{toolCallCount:e.length});let a=(0,s.useMemo)(()=>(function(e){let t=[],s=e.map(e=>eb(e).category),r=e.map(e=>{let t,s;return t=$(e),(s=tg.get(t)?.runGroupable)?s(e):ec(eb(e).category)}),n=0;for(;n<e.length;){let i=s[n];if(r[n]){let l=n+1;for(;l<e.length&&r[l]&&s[l]===i;)l++;if(l-n>=2){let s=e.slice(n,l);t.push({kind:"run",category:i,toolUses:s,key:`run-${i}-${s[0].id}`}),n=l;continue}}t.push({kind:"row",toolUse:e[n],key:e[n].id}),n++}return t})(e),[e]);if(0===e.length)return null;let o=`${e.length} tool ${1===e.length?"call":"calls"}`;return(0,t.jsx)("div",{role:"group","aria-label":o,"data-cursor-target":"tool-call-group",className:(0,r.f)("stg:flex stg:flex-col stg:gap-2",l),children:a.map(e=>"run"===e.kind?(0,t.jsx)(sh,{category:e.category,toolUses:e.toolUses,formatLabel:i},e.key):(0,t.jsx)(sl,{toolUse:e.toolUse},e.key))})},function(e,t){if(e.toolUses.length!==t.toolUses.length)return!1;for(let s=0;s<e.toolUses.length;s++)if(e.toolUses[s]!==t.toolUses[s])return!1;return e.formatSummary===t.formatSummary&&e.className===t.className});function sy(e){return e.items.some(e=>{switch(e.kind){case"tool_use":return!0;case"message":return e.text.trim().length>0;case"thinking":return e.live||e.text.trim().length>0;default:return!1}})}function sk(e){return e.some(e=>"tool_use"===e.kind&&("running"===e.state||void 0!==e.thread&&("running"===e.thread.state||sk(e.thread.items))))}function sw(e){return void 0!==e.liveness&&void 0===e.liveness.awaitingModelMs?function e(t){return t.flatMap(t=>"tool_use"!==t.kind?[]:[...(0,i.s)(t)?[t]:[],...void 0===t.thread?[]:e(t.thread.items)]).sort((e,t)=>(e.background?.startedAt??"").localeCompare(t.background?.startedAt??""))}(e.items):[]}function sN(e){return"todo"===$(e)}function sC(e){let t=e.input,s=e=>{let s=t[e];return"string"==typeof s?s:""},r=$(e);switch(r){case"file_read":case"file_write":case"file_edit":case"file_delete":return sL(sM(s("path")||s("file_path")||s("notebook_path")));case"search":return sL(s("pattern")||s("query"));case"fetch":return sL(function(e){try{return new URL(e).host}catch{return""}}(s("url")));case"web_search":return sL(s("query"));case"subagent":return sL(s("description"));case"mcp":return sL(e.name);case"skill":return sL(s("skill")||s("name"));case"list":return sL(sM(s("path")));case"shell":case"think":case"todo":case"memory":case"background_stop":case"unknown":return"";default:return r}}function sM(e){let t=e.length;for(;t>0&&("/"===e[t-1]||"\\"===e[t-1]);)t-=1;let s=e.slice(0,t);return s.slice(Math.max(s.lastIndexOf("/"),s.lastIndexOf("\\"))+1)}function sL(e){let t=e.replace(/\s+/g," ").trim();return t.length<=48?t:`${t.slice(0,47)}…`}e.s(["Y",0,sw,"m",0,sy,"T",0,sk,"a",0,function(e){return sy(e)&&e.status?.phase==="running"&&0===e.asks.length&&!sk(e.items)&&sw(e).length>0}],916790);let sS={file_read:["read","file"],file_write:["wrote","file"],file_edit:["edited","file"],file_delete:["deleted","file"],shell:["ran","command"],search:["searched","pattern"],list:["looked through","folder"],fetch:["read","page"],web_search:["searched the web","time"],mcp:["used","tool"],skill:["used","skill"],unknown:["used","tool"]};function sA(e){let t=new Map;for(let s of e){let e=$(s);void 0!==sS[e]&&t.set(e,[...t.get(e)??[],s])}let s=[...t].map(([e,t])=>{let[s,r]=sS[e],n=1===t.length?sC(t[0]):"";return"file_edit"===e&&""!==n?`${s} ${n}`:`${s} ${t.length} ${r}${1===t.length?"":"s"}`}).join(", ");return s.charAt(0).toUpperCase()+s.slice(1)}function s$(e){let t=Date.parse(e[0]?.processedAt??""),s=e.map(e=>Date.parse(e.result?.processedAt??e.processedAt)).filter(e=>!Number.isNaN(e));return Number.isNaN(t)||0===s.length?0:Math.max(0,Math.max(...s)-t)}e.s(["N",0,function(e){switch(e.kind){case"waiting_for_you":return"Waiting for you";case"writing":return"Writing the answer";case"thinking":return"Thinking";case"waiting_on_model":return"Working";case"tool":return function(e,t){let s=(e,s)=>""===t?s:`${e} ${t}`;switch(e){case"file_read":return s("Reading","Reading a file");case"file_write":return s("Writing","Writing a file");case"file_edit":return s("Editing","Editing a file");case"file_delete":return s("Deleting","Deleting a file");case"shell":return"Running a command";case"search":return s("Searching for","Searching");case"list":return s("Looking in","Looking through files");case"fetch":return s("Reading","Reading a page");case"web_search":return s("Searching the web for","Searching the web");case"think":return"Thinking";case"todo":return"Planning";case"subagent":return""===t?"A helper is working":`A helper is working on ${t}`;case"mcp":return s("Using","Using a tool");case"memory":return"Remembering";case"background_stop":return"Stopping a command";case"skill":return s("Using the skill","Using a skill");case"unknown":return"Working";default:return e}}(e.toolKind,e.target);default:return e}},"v",0,function(e,t){let s=e.items.filter(e=>"tool_use"===e.kind),r=s.filter(e=>void 0===e.result&&!sN(e)),n=s.filter(e=>void 0!==e.result&&!sN(e)),i=e.userMessage?.processedAt??e.items[0]?.processedAt??e.status?.processedAt??"",l=Date.parse(i),a=e.ended&&void 0!==e.status?Date.parse(e.status.processedAt):t;return{activity:function(e,t){if(e.asks.length>0)return{kind:"waiting_for_you",count:e.asks.length};let s=e.items.at(-1);if(s?.kind==="message"&&s.live)return{kind:"writing"};if(s?.kind==="thinking"&&s.live)return{kind:"thinking"};let r=t.at(-1);return void 0!==r?{kind:"tool",toolKind:$(r),target:sC(r),toolUseId:r.id}:{kind:"waiting_on_model"}}(e,r),startedAt:Number.isNaN(l)?"":i,elapsedMs:Number.isNaN(l)||Number.isNaN(a)?0:Math.max(0,a-l),stepsSettled:n.length,openOperations:r.length,todos:function(e){let t=e.todos.filter(e=>"cancelled"!==e.status);if(0!==t.length)return{done:t.filter(e=>"completed"===e.status).length,total:t.length,current:t.find(e=>"in_progress"===e.status)?.content}}(e)}},"Y",0,sA,"K",0,s$],346982);var s_=e.i(332250);e.s(["f",0,function({toolUses:e,children:r}){let[n,i]=(0,s.useState)(!1),l=(0,s.useId)(),a=sA(e);return""===a?(0,t.jsx)("div",{className:"stg:mx-4",children:r}):(0,t.jsxs)("div",{className:"stg:mx-4",children:[(0,t.jsxs)("button",{type:"button","aria-expanded":n,"aria-controls":l,onClick:()=>i(e=>!e),className:"stg:flex stg:w-full stg:items-center stg:gap-2 stg:rounded-md stg:px-2 stg:py-1.5 stg:text-left stg:text-sm stg:text-muted-foreground stg:hover:bg-muted",children:[(0,t.jsx)("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:n?"stg:h-3 stg:w-3 stg:rotate-90":"stg:h-3 stg:w-3",children:(0,t.jsx)("path",{d:"M6 4l4 4-4 4",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),(0,t.jsx)("span",{className:"stg:min-w-0 stg:flex-1 stg:truncate",children:a}),(0,t.jsx)("span",{className:"stg:shrink-0 stg:text-xs",children:(0,s_.f)(s$(e))})]}),n&&(0,t.jsx)("div",{id:l,className:"stg:mt-1",children:r})]})}],899924);let sT=(0,s.createContext)({foldSettledSteps:!1});e.s(["h",0,sT,"n",0,function(){return(0,s.useContext)(sT)}],335204);let sI=new Map([[m.A.RUN_PENDING,{label:"Pending",icon:sF,colorClass:"stg:text-muted-foreground"}],[m.A.RUN_IN_PROGRESS,{label:"Running",icon:sF,colorClass:"stg:text-foreground"}],[m.A.RUN_COMPLETED,{label:"Completed",icon:function(){return(0,t.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,t.jsx)("path",{d:"M2.5 6L5 8.5L9.5 3.5"})})},colorClass:"stg:text-status-ready"}],[m.A.RUN_FAILED,{label:"Failed",icon:sB,colorClass:"stg:text-destructive"}],[m.A.RUN_CANCELLED,{label:"Cancelled",icon:sB,colorClass:"stg:text-muted-foreground"}],[m.A.RUN_TERMINATED,{label:"Terminated",icon:function(){return(0,t.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"currentColor",children:(0,t.jsx)("rect",{x:"2",y:"2",width:"8",height:"8",rx:"1"})})},colorClass:"stg:text-destructive"}],[m.A.RUN_WAITING_FOR_APPROVAL,{label:"Waiting for approval",icon:function(){return(0,t.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("circle",{cx:"6",cy:"6",r:"4.5"}),(0,t.jsx)("path",{d:"M6 3.5V6L7.5 7.5"})]})},colorClass:"stg:text-status-degraded"}],[m.A.RUN_PAUSED,{label:"Paused",icon:function(){return(0,t.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"currentColor",children:[(0,t.jsx)("rect",{x:"2.5",y:"2",width:"2.5",height:"8",rx:"0.5"}),(0,t.jsx)("rect",{x:"7",y:"2",width:"2.5",height:"8",rx:"0.5"})]})},colorClass:"stg:text-muted-foreground"}]]),sR=(0,s.memo)(function({phase:e,className:s}){let n=sI.get(e);if(!n)return null;let i=n.icon;return(0,t.jsxs)("span",{role:"status","aria-label":n.label,className:(0,r.f)("stg:inline-flex stg:items-center stg:gap-1.5 stg:text-xs stg:font-medium",n.colorClass,s),children:[(0,t.jsx)("span",{"aria-hidden":"true",children:(0,t.jsx)(i,{})}),n.label]})});function sF(){return(0,t.jsxs)("span",{className:"stg:relative stg:flex stg:h-2 stg:w-2",children:[(0,t.jsx)("span",{className:"stg:absolute stg:inline-flex stg:h-full stg:w-full stg:animate-ping stg:rounded-full stg:bg-current stg:opacity-75"}),(0,t.jsx)("span",{className:"stg:relative stg:inline-flex stg:h-2 stg:w-2 stg:rounded-full stg:bg-current"})]})}function sB(){return(0,t.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,t.jsx)("path",{d:"M3 3L9 9M9 3L3 9"})})}e.s(["f",0,sR],682302);let sU=(0,s.memo)(function({resources:e,serverPhase:n,isAwaitingResponse:i,className:l}){let a,o=!i&&!!n,d=(0,s.useMemo)(()=>{let t,s;return t=e?.some(e=>"gitRepository"===e.resource.case),s=[{message:"Initializing run…",durationMs:4e3}],t&&s.push({message:"Setting up workspace…",durationMs:4e3}),s.push({message:"Preparing agent environment…",durationMs:4e3},{message:"Almost ready…",durationMs:4e3}),s},[e]),[u,g]=(0,s.useState)(0);return(0,s.useEffect)(()=>{g(0)},[d]),(0,s.useEffect)(()=>{if(i||o||u>=d.length-1)return;let e=setTimeout(()=>{g(e=>Math.min(e+1,d.length-1))},d[u].durationMs);return()=>clearTimeout(e)},[i,o,u,d]),a=i?"Thinking…":n||d[Math.min(u,d.length-1)].message,(0,t.jsxs)("div",{role:"status","aria-label":a,className:(0,r.f)("stg:flex stg:items-center stg:gap-2.5 stg:px-4 stg:py-2",l),children:[(0,t.jsx)(sE,{}),(0,t.jsx)("span",{className:"stg:text-sm stg:animate-in stg:fade-in stg:duration-300 stgm-shimmer-label",children:a})]})});function sE(){return(0,t.jsxs)("span",{className:"stg:relative stg:flex stg:h-2 stg:w-2 stg:shrink-0","aria-hidden":"true",children:[(0,t.jsx)("span",{className:"stg:absolute stg:inline-flex stg:h-full stg:w-full stg:animate-ping stg:rounded-full stg:bg-muted-foreground stg:opacity-75"}),(0,t.jsx)("span",{className:"stg:relative stg:inline-flex stg:h-2 stg:w-2 stg:rounded-full stg:bg-muted-foreground"})]})}e.s(["f",0,sU],490960);let sW=(0,s.memo)(function({recall:e,facts:n,className:i}){let[l,a]=(0,s.useState)(!1),o=(0,s.useId)(),d=(0,s.useMemo)(()=>{let t;return t=new Set(e.injectedMemoryIds),n.filter(e=>t.has(e.memoryId))},[e,n]);if(!e.selectionActive)return null;let u=e.injectedMemoryIds.length,g=`Recalled ${u} of ${n.length} memories`;return(0,t.jsxs)("div",{role:"status","aria-label":g,className:(0,r.f)("stg:mx-4 stg:rounded-md stg:border stg:border-border/50 stg:bg-muted/30",i),children:[(0,t.jsxs)("button",{type:"button","aria-expanded":l,"aria-controls":o,onClick:()=>a(e=>!e),className:(0,r.f)("stg:flex stg:w-full stg:items-center stg:gap-3 stg:px-3 stg:py-2 stg:text-left","stg:text-xs stg:text-muted-foreground stg:hover:text-foreground"),children:[(0,t.jsx)(sP,{}),(0,t.jsxs)("span",{className:"stg:flex stg:min-w-0 stg:flex-1 stg:flex-wrap stg:items-baseline stg:gap-x-2",children:[(0,t.jsx)("span",{className:"stg:font-medium",children:g}),e.embeddingModel&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{"aria-hidden":"true",className:"stg:text-muted-foreground/50",children:"·"}),(0,t.jsx)("span",{className:"stg:text-muted-foreground/80",children:e.embeddingModel})]})]}),(0,t.jsx)(sD,{expanded:l})]}),l&&(0,t.jsx)("ul",{id:o,className:"stg:m-0 stg:flex stg:list-none stg:flex-col stg:gap-1.5 stg:border-t stg:border-border/50 stg:px-3 stg:py-2",children:d.map(e=>(0,t.jsx)("li",{className:"stg:text-xs stg:leading-relaxed stg:text-muted-foreground",children:e.content},e.memoryId))})]})});function sP(){return(0,t.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:"stg:shrink-0 stg:text-muted-foreground/70","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M8 2a3 3 0 0 0-3 3c-1.2.4-2 1.5-2 2.8 0 1 .5 1.9 1.3 2.4A2.8 2.8 0 0 0 7 13.8c.4.1.7.2 1 .2s.6-.1 1-.2a2.8 2.8 0 0 0 2.7-3.6c.8-.5 1.3-1.4 1.3-2.4 0-1.3-.8-2.4-2-2.8a3 3 0 0 0-3-3z"}),(0,t.jsx)("path",{d:"M8 2v12"})]})}function sD({expanded:e}){return(0,t.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:"stg:shrink-0 stg:text-muted-foreground/70","aria-hidden":"true",children:e?(0,t.jsx)("path",{d:"M4 10l4-4 4 4"}):(0,t.jsx)("path",{d:"M4 6l4 4 4-4"})})}e.s(["f",0,sW],389962);let sO=(0,s.memo)(function({label:e="Working…",waitingOn:s,className:n}){return void 0!==s&&s.length>0?(0,t.jsx)(sH,{waitingOn:s,className:n}):(0,t.jsx)("div",{role:"status","aria-label":e,"data-cursor-target":"liveness-status-line",className:(0,r.f)("stg:flex stg:items-center stg:px-4 stg:py-1.5",n),children:(0,t.jsx)("span",{className:"stg:text-xs stgm-shimmer-label",children:e})})});function sH({waitingOn:e,className:s}){let n=e[0],i=tN(n.background?.startedAt??""),l=se(n),a=function(e,t){let[s,...r]=e,n=void 0===s?"":tu(s),i=""===n?"a background command":`\`${n}\``,l=r.length>0?` and ${r.length} more`:"",a=null!==t&&t>=1e3?` \xb7 ${tC(t)}`:"";return`Waiting for ${i}${l}${a}`}(e,i);return(0,t.jsxs)("div",{role:"status","aria-label":a,"data-cursor-target":"liveness-status-line",className:(0,r.f)("stg:flex stg:items-center stg:gap-2 stg:px-4 stg:py-1.5",s),children:[(0,t.jsx)("span",{className:"stg:min-w-0 stg:truncate stg:text-xs stgm-shimmer-label",children:a}),1===e.length&&l&&(0,t.jsx)(tE,{label:l.isStopping?"Stopping…":"Stop",variant:"danger",onClick:l.onStop,isSubmitting:l.isStopping,isActive:l.isStopping,className:"stg:px-2 stg:py-0.5",cursorTarget:"background-wait-stop"})]})}function sK({linesAdded:e,linesRemoved:s}){return 0===e&&0===s?null:(0,t.jsxs)("span",{className:"stg:shrink-0 stg:text-xs stg:tabular-nums","aria-label":`${e} added, ${s} removed`,"data-cursor-target":"file-review-line-stats",children:[(0,t.jsxs)("span",{className:"stg:text-diff-added-fg",children:["+",e]})," ",(0,t.jsxs)("span",{className:"stg:text-diff-removed-fg",children:["-",s]})]})}e.s(["f",0,sO],290924),e.s(["f",0,function({error:e,retryMessage:n,onRetry:i}){let[l,a]=(0,s.useState)(!1),o=/\[StallTimeoutError\]|execution interrupted|retry or resume/i.test(e);return(0,t.jsxs)("div",{role:o?"status":"alert",className:(0,r.f)("stg:mx-4 stg:flex stg:flex-col stg:gap-1.5 stg:rounded-md stg:px-3 stg:py-2",o?"stg:bg-muted":"stg:bg-destructive-subtle"),children:[(0,t.jsx)("p",{className:(0,r.f)("stg:text-xs stg:whitespace-pre-wrap stg:break-words",o?"stg:text-foreground":"stg:text-destructive",!l&&"stg:line-clamp-3"),children:e}),(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-3 stg:text-xs",children:[(0,t.jsx)("button",{type:"button",onClick:()=>a(e=>!e),className:"stg:font-medium stg:text-muted-foreground stg:underline-offset-2 stg:hover:underline stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring",children:l?"Show less":"Show more"}),!!i&&!!n&&(0,t.jsx)("button",{type:"button",onClick:()=>i(n),className:"stg:font-medium stg:text-foreground stg:underline-offset-2 stg:hover:underline stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring",children:o?"Resume":"Retry"})]})]})}],656244);let sV={[m.O.ADD]:{letter:"A",colorClass:"stg:text-diff-added-fg",label:"added"},[m.O.MODIFY]:{letter:"M",colorClass:"stg:text-diff-hunk-header-fg",label:"modified"},[m.O.DELETE]:{letter:"D",colorClass:"stg:text-diff-removed-fg",label:"deleted"},[m.O.RENAME]:{letter:"R",colorClass:"stg:text-diff-hunk-header-fg",label:"renamed"},[m.O.BINARY_CHANGE]:{letter:"M",colorClass:"stg:text-diff-hunk-header-fg",label:"modified (binary)"}};function sz({kind:e}){let s=sV[e];return s?(0,t.jsx)("span",{className:(0,r.f)("stg:shrink-0 stg:font-mono stg:text-2xs stg:font-bold",s.colorClass),"aria-label":s.label,children:s.letter}):null}e.s(["f",0,sz,"w",0,sK],483944);var sq=e.i(676951),sJ=e.i(891287),sG=e.i(577817),sY=e.i(781836);function sZ(e,t){return t?`${e}:${t}`:e}let sX=new Map;e.s(["J",0,sZ,"z",0,function(){let e=(0,tQ.f)(),[t,r]=(0,s.useState)(new Set),[n,i]=(0,s.useState)(sX),[l,a]=(0,s.useState)(null),o=(0,s.useCallback)(e=>{i(t=>{if(!t.has(e))return t;let s=new Map(t);return s.delete(e),s})},[]),d=(0,s.useCallback)(()=>{i(sX),a(null)},[]),u=(0,s.useCallback)(async(t,s,n,l)=>{let d=l.fileChangeId??"",u=l.scope??(d?"file":"change_set"),g=sZ(s,d||void 0);r(e=>{let t=new Set(e);return t.add(g),t}),o(g),a(null);try{await e.session.reviewFileChanges((0,sJ.f)(sG.n,{sessionId:t,changeSetId:s,scope:u,fileChangeId:d,action:n,expectedDigest:l.expectedDigest,reason:l.reason??"",acknowledgeUnreviewable:l.acknowledgeUnreviewable??!1}))}catch(t){let e=(0,sY.f)(t);throw i(t=>new Map(t).set(g,e)),a(e),t}finally{r(e=>{let t=new Set(e);return t.delete(g),t})}},[e,o]);return(0,s.useMemo)(()=>({reviewFileChanges:u,submittingDecisionKeys:t,decisionErrors:n,clearDecisionError:o,error:l,clearError:d}),[u,t,n,o,l,d])}],336208);var sQ=e.i(803023);let s0=new Set,s1=new Map,s2=(0,s.memo)(function({fileReviewSet:e,capture:n,onSubmit:i,submittingDecisionKeys:l=s0,decisionErrors:a=s1,interactive:o=!0,showDiffs:d=!0,className:u}){var g,c,f,m;let p,b=e.files,v=b.length,j=e.changeSetId,y=(0,s.useMemo)(()=>b.filter(e=>"undecided"!==e.state).length,[b]),k=h(e),w="complete"!==k,N="binary-only"===k,C=v>1||w,M=v>1||!w,[L,S]=(0,s.useState)(()=>o&&(w||y>0||v>1&&!d)),A=(0,s.useId)(),$=function(e,t,r){let n=(0,tQ.f)(),i=r&&""!==e,{data:l,isLoading:a,error:o}=(0,t0.f)(i?()=>n.run.get(e):null,[e,n,i],null,{cacheKey:i?`agent-execution:${e}`:void 0}),d=(0,s.useMemo)(()=>(0,sQ.f)(l?.status).find(e=>e.id===t)??null,[l,t]);return(0,s.useMemo)(()=>({capture:d,isLoading:i&&a,error:o}),[d,i,a,o])}(e.runId,j,void 0===n&&d&&L),_=void 0===n?$.capture:n,T=(0,s.useMemo)(()=>{let e=new Map;for(let t of _?.changes??[])e.set(t.id,t);return e},[_]),I=$.error?"error":$.isLoading?"loading":"ready",R=l.has(j),F=a.get(j)??null,[B,U]=(0,s.useState)(null);(0,s.useEffect)(()=>{R||U(null)},[R]);let E=(0,s.useCallback)(t=>{U(t),i?.(t,{scope:"change_set",expectedDigest:e.aggregateDigest,acknowledgeUnreviewable:"keep"===t&&N})},[i,e.aggregateDigest,N]),W=(0,s.useCallback)((e,t)=>{i?.(t,{scope:"file",fileChangeId:e.fileChangeId,expectedDigest:e.digest,acknowledgeUnreviewable:"keep"===t&&"binary"===x(e).kind})},[i]),P=(0,s.useMemo)(()=>{let e=0,t=0;for(let s of b)e+=s.linesAdded,t+=s.linesRemoved;return{additions:e,deletions:t}},[b]),D=(0,s.useMemo)(()=>{let e=!1,t=!1;for(let s of b){let r=x(s);"binary"===r.kind?e=!0:"unavailable"===r.kind&&(t=!0)}return{hasBinary:e,hasUnavailable:t}},[b]),O=(0,s.useId)(),H=(g=v,c=y,p=N?"Keep":"Approve",g<=1?{approve:p,reject:"Reject"}:c>0&&c<g?{approve:`${p} remaining`,reject:"Reject remaining"}:{approve:`${p} all`,reject:"Reject all"}),K=o?void 0:function(e){for(let t of e.decisions)if("approved_command"===t.origin||"eval_try"===t.origin)return t.origin}(e),V=o?`${v} file${1===v?"":"s"} awaiting review`:"approved_command"===K?"Kept automatically — produced by a command you approved":"eval_try"===K?"Kept automatically — an eval's try keeps its edits":function(e){let t=e.length,s=0,r=0,n=0;for(let t of e)"kept"===t.state?s++:"undone"===t.state||"undoing"===t.state?r++:"undo_failed"===t.state&&n++;let i=t-s-r-n;if(i===t)return`${t} file${1===t?"":"s"} changed`;let l=[];return s>0&&l.push(`${s} kept`),r>0&&l.push(`${r} discarded`),n>0&&l.push(`${n} could not be put back`),i>0&&l.push(`${i} not reviewed`),l.join(" · ")}(b);return(0,t.jsxs)("div",{role:o?"alert":"group","aria-label":o?`Review ${v} file change${1===v?"":"s"}`:`${v} file change${1===v?"":"s"}`,className:(0,r.f)("stg:rounded-lg stg:border stg:border-border-prominent",o&&"stg:border-l-2 stg:border-l-warning",u),children:[(0,t.jsxs)("div",{className:"stg:flex stg:flex-wrap stg:items-center stg:gap-2 stg:px-2.5 stg:py-1.5 stg:text-xs",children:[(0,t.jsx)("span",{className:"stg:shrink-0 stg:font-medium stg:text-foreground",children:o?"Review file changes":"File changes"}),(0,t.jsxs)("span",{className:"stg:flex stg:min-w-0 stg:flex-1 stg:items-center stg:gap-2",children:[(0,t.jsx)("span",{className:"stg:min-w-0 stg:truncate stg:text-muted-foreground",children:V}),(0,t.jsx)(sK,{linesAdded:P.additions,linesRemoved:P.deletions})]}),o&&M&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(tE,{label:H.approve,variant:"primary",onClick:()=>E("keep"),isActive:"keep"===B,isSubmitting:R,disabled:w&&!N,ariaDescribedby:w?O:void 0,cursorTarget:"file-review-approve"}),(0,t.jsx)(tE,{label:H.reject,variant:"danger",onClick:()=>E("undo"),isActive:"undo"===B,isSubmitting:R,cursorTarget:"file-review-reject"})]}),(0,t.jsxs)("button",{type:"button","aria-expanded":L,"aria-controls":A,onClick:()=>S(e=>!e),"data-cursor-target":"file-review-expander",className:(0,r.f)("stg:inline-flex stg:shrink-0 stg:items-center stg:gap-1 stg:rounded-md stg:border stg:border-border stg:px-2 stg:py-1","stg:text-xs stg:font-medium stg:text-muted-foreground stg:transition-colors","stg:hover:bg-accent-hover stg:hover:text-foreground","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring"),children:[L?"Hide":o?d?"Review":"Files":"Show",(0,t.jsx)(s5,{expanded:L})]})]}),o&&w&&M&&(0,t.jsx)("p",{id:O,className:"stg:px-2.5 stg:pb-1.5 stg:text-2xs stg:italic stg:text-muted-foreground",children:(f=C,m=D,N?f?"This set includes binary files with no text diff. Keep all keeps every file as-is (their exact bytes are applied), or decide each file below.":"This is a binary change with no text diff. Keep it as-is (its exact bytes are applied) or discard it.":f?m.hasUnavailable?"Part of this change isn't available to review, so the whole set can't be approved — keep the reviewable files and discard the rest.":m.hasBinary?"This set includes a binary change with no text diff, so it can't be approved at once — decide each file below (keep the reviewable ones; keep or discard the binary).":"Some files can't be reviewed completely, so the whole set can't be approved at once — keep the reviewable files and discard the rest.":m.hasUnavailable?"This change isn't available to review, so it can't be approved — it can only be discarded.":m.hasBinary?"This is a binary change with no text diff, so it can't be approved as a complete change — it can only be discarded.":"This change can't be reviewed completely, so it can't be approved as a complete change.")}),o&&F&&(0,t.jsx)("div",{className:"stg:px-2.5 stg:pb-1.5",children:(0,t.jsx)(tW,{error:F,leadIn:"submit decision",cursorTarget:"file-review-error"})}),L&&(0,t.jsxs)("div",{id:A,className:"stg:space-y-2 stg:border-t stg:border-border-muted stg:px-3 stg:py-2.5",children:[d&&(0,t.jsx)(sq.f,{fileCount:v,additions:P.additions,deletions:P.deletions}),o?C?b.map(e=>(0,t.jsx)(s3,{file:e,captured:T.get(e.fileChangeId),diffState:I,isSubmitting:l.has(sZ(j,e.fileChangeId))||R,error:a.get(sZ(j,e.fileChangeId))??null,onDecide:W,showDiffs:d},e.fileChangeId)):b.map(e=>d?(0,t.jsxs)("div",{className:"stg:space-y-1.5",children:[(0,t.jsx)(rn,{captured:T.get(e.fileChangeId)}),(0,t.jsx)(s6,{captured:T.get(e.fileChangeId),diffState:I})]},e.fileChangeId):(0,t.jsx)(s8,{file:e,captured:T.get(e.fileChangeId)},e.fileChangeId)):b.map(e=>(0,t.jsx)(s4,{file:e,captured:T.get(e.fileChangeId),diffState:I,showDiffs:d},e.fileChangeId)),o&&C&&(0,t.jsx)(rl,{decided:y,total:v})]})]})});function s5({expanded:e}){return(0,t.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:(0,r.f)("stg:shrink-0 stg:transition-transform stg:duration-150",e&&"stg:rotate-90"),"aria-hidden":"true",children:(0,t.jsx)("path",{d:"M3.5 2L6.5 5L3.5 8"})})}let s3=(0,s.memo)(function({file:e,captured:r,diffState:n,isSubmitting:i,error:l,onDecide:a,showDiffs:o}){let d=x(e),u="reviewable"!==d.kind,g=(0,s.useId)(),c=(0,t.jsx)(s9,{file:e,reviewability:d,verdict:function(e){switch(e.state){case"kept":return"keep";case"undecided":return null;default:return"undo"}}(e),isSubmitting:i,onDecide:a,describedById:u?g:void 0});return(0,t.jsxs)("div",{className:"stg:space-y-1.5",children:[o?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(rn,{captured:r}),(0,t.jsx)(s6,{captured:r,diffState:n}),c]}):(0,t.jsx)(s8,{file:e,captured:r,trailing:c}),u&&(0,t.jsx)(ri,{reviewability:d,id:g}),l&&(0,t.jsx)(tW,{error:l,leadIn:"save",cursorTarget:"file-review-file-error"})]})}),s4=(0,s.memo)(function({file:e,captured:s,diffState:r,showDiffs:n}){return n?(0,t.jsxs)("div",{className:"stg:space-y-1.5",children:[(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-2",children:[(0,t.jsx)(rn,{captured:s}),(0,t.jsx)(s7,{state:e.state})]}),(0,t.jsx)(s6,{captured:s,diffState:r})]}):(0,t.jsx)(s8,{file:e,captured:s,trailing:(0,t.jsx)(s7,{state:e.state})})});function s6({captured:e,diffState:r}){let n=(0,s.useMemo)(()=>e?(0,g.f)(e):null,[e]);return n?(0,t.jsx)(f.f,{change:n,bounded:!0}):(0,t.jsx)("p",{className:"stg:text-2xs stg:italic stg:text-muted-foreground",children:"loading"===r?"Loading the diff…":"error"===r?"Couldn't load the diff.":"The diff isn't available."})}function s8({file:e,captured:s,trailing:r}){let n="renamed"===e.change&&e.previousPath!==e.path?e.previousPath:"";return(0,t.jsxs)("div",{className:"stg:flex stg:flex-wrap stg:items-center stg:gap-x-2 stg:gap-y-1","data-cursor-target":"file-review-list-row",children:[(0,t.jsx)(sz,{kind:w(e.change)}),n&&(0,t.jsxs)("span",{className:"stg:min-w-0 stg:truncate stg:font-mono stg:text-xs stg:text-muted-foreground-faint",children:[n," → "]}),(0,t.jsx)(eq.f,{path:e.path,dirDisplay:"dim",className:"stg:min-w-0 stg:flex-1 stg:text-xs"}),(0,t.jsx)(sK,{linesAdded:e.linesAdded,linesRemoved:e.linesRemoved}),(0,t.jsx)(rn,{captured:s}),r]})}function s7({state:e}){switch(e){case"kept":return(0,t.jsx)("span",{className:"stg:shrink-0 stg:text-2xs stg:font-medium stg:text-diff-added-fg",children:"Kept"});case"undoing":case"undone":return(0,t.jsx)("span",{className:"stg:shrink-0 stg:text-2xs stg:font-medium stg:text-diff-removed-fg",children:"Discarded"});case"undo_failed":return(0,t.jsx)("span",{className:"stg:shrink-0 stg:text-2xs stg:font-medium stg:text-destructive",children:"Undo failed"});case"undecided":return(0,t.jsx)("span",{className:"stg:shrink-0 stg:text-2xs stg:italic stg:text-muted-foreground",children:"Not reviewed"})}}function s9({file:e,reviewability:r,verdict:n,isSubmitting:i,onDecide:l,describedById:a}){let[o,d]=(0,s.useState)(null);(0,s.useEffect)(()=>{i||d(null)},[i]);let u=o??n,g=e.path,c="binary"===r.kind,f="unavailable"===r.kind,m=c?`Keep ${g} anyway (binary — no text diff)`:`Keep ${g}`,x=(0,s.useCallback)(t=>{i||(d(t),l(e,t))},[i,l,e]);return(0,t.jsxs)("div",{role:"radiogroup","aria-label":`Decision for ${g}`,"aria-describedby":a,className:"stg:flex stg:items-center stg:gap-1.5",children:[(0,t.jsx)(rs,{label:c?"Keep anyway":"Keep",accessibleLabel:m,tone:"keep",selected:"keep"===u,busy:i&&"keep"===o,disabled:i||f,onClick:()=>x("keep")}),(0,t.jsx)(rs,{label:"Discard",accessibleLabel:`Discard ${g}`,tone:"discard",selected:"undo"===u,busy:i&&"undo"===o,disabled:i,onClick:()=>x("undo")})]})}let re=(0,r.f)("stg:inline-flex stg:items-center stg:justify-center stg:gap-1.5 stg:rounded-md stg:border stg:px-2.5 stg:py-1","stg:text-xs stg:font-medium stg:transition-colors","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring stg:focus-visible:ring-offset-2","stg:disabled:cursor-not-allowed stg:disabled:opacity-50"),rt={keep:"stg:border-success stg:bg-success-subtle stg:text-status-ready",discard:"stg:border-destructive stg:bg-destructive-subtle stg:text-destructive"};function rs({label:e,accessibleLabel:s,tone:n,selected:i,busy:l,disabled:a,onClick:o}){return(0,t.jsxs)("button",{type:"button",role:"radio","aria-checked":i,"aria-label":s,disabled:a,onClick:o,"data-cursor-target":`file-review-${n}`,className:(0,r.f)(re,i?rt[n]:"stg:border-border stg:text-muted-foreground stg:hover:bg-accent-hover stg:hover:text-foreground"),children:[l?(0,t.jsx)(d.L,{}):null,e]})}let rr={[m.k.GIT_IGNORED_CAPTURED]:{label:"gitignored",aria:"This file is ignored by git; the change was captured for review"},[m.k.NON_GIT_CAS]:{label:"outside git",aria:"This file is outside the git repository; the change was captured for review"}};function rn({captured:e}){if(!e)return null;let s=rr[e.captureClass];return s?(0,t.jsx)("span",{className:"stg:inline-flex stg:w-fit stg:items-center stg:rounded stg:border stg:border-border stg:bg-muted-subtle stg:px-1.5 stg:py-0.5 stg:text-2xs stg:font-medium stg:text-muted-foreground","aria-label":s.aria,"data-cursor-target":"file-review-capture",children:s.label}):null}function ri({reviewability:e,id:s}){let r=function(e){switch(e.kind){case"binary":return"Binary file — no text diff to review. Keep it as-is (its exact bytes are applied) or discard it.";case"unavailable":return"secret"===e.reason?"Contents withheld — this path looks like a secret, so it was never captured for review and can only be discarded.":"The full diff isn't available to review (it was too large or could not be captured), so this change can only be discarded.";default:return null}}(e);return r?(0,t.jsx)("p",{id:s,className:"stg:text-2xs stg:italic stg:text-muted-foreground","data-cursor-target":"file-review-block-reason",children:r}):null}function rl({decided:e,total:s}){return(0,t.jsxs)("p",{role:"status",className:"stg:text-2xs stg:text-muted-foreground",children:[e," of ",s," files reviewed",e>0&&e<s&&" — decide the rest to continue"]})}e.s(["f",0,s2],212703);let ra=(0,s.memo)(function({compacted:e,className:s}){var n;let i;return(0,t.jsxs)("div",{role:"status","aria-label":"Context compacted",className:(0,r.f)("stg:mx-4 stg:flex stg:items-center stg:gap-3 stg:rounded-md stg:border stg:border-border-muted","stg:bg-muted-faint stg:px-3 stg:py-2",s),children:[(0,t.jsx)(ro,{}),(0,t.jsxs)("div",{className:"stg:flex stg:min-w-0 stg:flex-1 stg:items-baseline stg:gap-1.5 stg:text-xs stg:font-medium stg:text-muted-foreground",children:[(0,t.jsx)("span",{children:"Context compacted"}),e.processedAt&&(0,t.jsx)("time",{dateTime:e.processedAt,className:"stg:ml-auto stg:tabular-nums stg:text-muted-foreground-subtle",children:Number.isNaN((i=new Date(n=e.processedAt)).getTime())?n:i.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})})]})]})});function ro(){return(0,t.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:"stg:shrink-0 stg:text-muted-foreground-subtle","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M4 2v4l4-2-4-2zM12 14v-4l-4 2 4 2z"}),(0,t.jsx)("path",{d:"M4 8h8"})]})}e.s(["f",0,ra],299992)},873428,866047,e=>{"use strict";var t=e.i(803023),s=e.i(849695);function r(e){var t;if(1===e.length)return e[0];let s=e[0],r=e[e.length-1],n=(t=s,"deleted"===r.changeType?"deleted":"added"===t.changeType?"added":"renamed"===t.changeType?"renamed":"modified");return{path:r.path,changeType:n,before:s.before,after:r.after,linesAdded:0,linesRemoved:0,renameFrom:"renamed"===n?s.renameFrom:""}}let n={modified:0,added:1,renamed:1,deleted:2};function i(e,t){let s=n[e.changeType]-n[t.changeType];return 0!==s?s:e.path.localeCompare(t.path,void 0,{sensitivity:"base"})}e.s(["L",0,function(e){let t=0,s=0;for(let r of e)for(let e of r.lines)"added"===e.type?t++:"removed"===e.type&&s++;return{additions:t,deletions:s}},"h",0,function(e){let n=new Map,l=e=>{let t=e.path;if(!t)return;let s=n.get(t);s?s.push(e):n.set(t,[e])};for(let r of e)for(let e of(0,t.f)(r.status))for(let t of e.changes)l((0,s.f)(t));let a=Array.from(n.values(),r);return a.sort(i),a}],873428);let l=(0,e.i(651023).createContext)({resources:[]});e.s(["f",0,l],866047)},165971,e=>{"use strict";var t=e.i(244908);let s=".stigmer/";function r(e){let t=e.replace(/^\/+/,"");return t.startsWith(s)?{kind:"platform",subpath:t.slice(s.length)}:".stigmer"===t?{kind:"platform",subpath:""}:{kind:"workspace",remainder:t}}e.s(["_",0,r,"Z",0,function(e,s){if(!e)return{action:"copy",value:e,tooltip:"Copy path"};let n=r(e);if("platform"===n.kind)return{action:"copy",value:e,tooltip:"Copy path"};let{remainder:i}=n,l=s.filter(e=>"file"!==e.resource.case);if(0===l.length)return{action:"copy",value:e,tooltip:"Copy path"};let{entry:a,relPath:o}=function(e,t){if(1===t.length)return{entry:t[0],relPath:e};let s=e.split("/");for(let e=0;e<s.length;e++)for(let r of t)if(r.name===s[e])return{entry:r,relPath:s.slice(e+1).join("/")};return{entry:t[0],relPath:e}}(i,l),d=a.resource;if("gitRepository"===d.case){let e=function(e,t,s,r){let n;try{n=new URL(e)}catch{return null}if("github.com"!==n.hostname)return null;let i=n.pathname.replace(/\.git$/,"").replace(/^\/|\/$/g,"");if(!i)return null;let l=r.replace(/^\/+/,"");return l.startsWith(i+"/")&&(l=l.slice(i.length+1)),`https://github.com/${i}/blob/${s||t||"HEAD"}/${l}`}(d.value.url,d.value.branch,d.value.commit,o);if(e)return{action:"link",url:e,tooltip:"Open on GitHub"}}return"localPath"===d.case?{action:"copy",value:function(e,s){if(!s)return e;let r=(0,t.f)(e,"/"),n=s.replace(/^\/+/,"");return`${r}/${n}`}(d.value.path,o),tooltip:"Copy path"}:{action:"copy",value:e,tooltip:"Copy path"}},"V",0,function(e){if(!e)return{dir:"",base:""};let s=(0,t.f)(e,"/"),r=s.lastIndexOf("/");if(r<0)return{dir:"",base:s};let n=s.slice(r+1);return n?{dir:s.slice(0,r+1),base:n}:{dir:"",base:s}}])},251568,e=>{"use strict";var t=e.i(651023);e.s(["f",0,function(e,s){return(0,t.useCallback)(t=>{e&&!s&&"Enter"===t.key&&(t.metaKey||t.ctrlKey)&&(t.preventDefault(),e())},[e,s])}])},803023,e=>{"use strict";e.s(["f",0,function(e){return e?.fileChanges??[]}])},849695,e=>{"use strict";var t=e.i(394327);e.s(["f",0,function(e){return{path:e.pathAfter||e.pathBefore,changeType:function(e){switch(e){case t.O.ADD:return"added";case t.O.DELETE:return"deleted";case t.O.RENAME:return"renamed";default:return"modified"}}(e.kind),before:e.before,after:e.after,linesAdded:e.linesAdded,linesRemoved:e.linesRemoved,renameFrom:e.kind===t.O.RENAME?e.pathBefore:""}}])}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,791738,e=>{"use strict";var t=e.i(974265),n=e.i(651023),r=e.i(768079);function a(e){}var i=e.i(470858);let s="stigmer:auth:redirect_path";async function o(e){try{await e.removeUser()}catch{}}let l=null;async function c(e){let t=await e.signinRedirectCallback(),n=sessionStorage.getItem(s)??"/";return sessionStorage.removeItem(s),{user:t,redirectPath:n}}e.s(["default",0,function({config:e,children:u}){let d=(0,n.useRef)(null);d.current??=(0,i.f)(e);let[m,f]=(0,n.useState)(null),[p,h]=(0,n.useState)(!0),[g,v]=(0,n.useState)(!1),[x,w]=(0,n.useState)(null);(0,n.useEffect)(()=>{let e=d.current,t="/auth/callback"===window.location.pathname;(async()=>{try{if(t){var n;let{user:t,redirectPath:r}=await (n=e,l??=c(n));f(t),a(t.access_token),window.location.replace(r);return}let r=await e.getUser();r&&!r.expired&&(f(r),a(r.access_token))}catch(e){if(t){let t=e instanceof Error?e.message:"Authentication failed";console.error("[auth] callback exchange failed:",e),w(t)}else console.error("[auth] session restore failed:",e)}h(!1)})();let n=e=>{f(e),a(e.access_token)},r=()=>{f(null),a(null)},i=()=>{f(null),a(null)};return e.events.addUserLoaded(n),e.events.addUserUnloaded(r),e.events.addAccessTokenExpired(i),()=>{e.events.removeUserLoaded(n),e.events.removeUserUnloaded(r),e.events.removeAccessTokenExpired(i)}},[]);let y=(0,n.useCallback)(()=>{let e=window.location.pathname+window.location.search;sessionStorage.setItem(s,e),d.current.signinRedirect()},[]),k=(0,n.useCallback)(async()=>{v(!0),a(null);let e=d.current;if(void 0!==await e.metadataService.getEndSessionEndpoint().catch(()=>void 0))try{await e.signoutRedirect();return}catch(e){console.error("[auth] signoutRedirect failed; signing out locally:",e)}await o(e),window.location.replace("/login")},[]),b=(0,n.useMemo)(()=>m?.profile?{email:m.profile.email??"",name:m.profile.name??void 0,picture:m.profile.picture??void 0}:null,[m]),S=(0,n.useMemo)(()=>({isAuthenticated:null!==m&&!m.expired,isLoading:p||g,user:b,accessToken:m?.access_token??null,login:y,logout:k}),[m,p,g,b,y,k]);return x?(0,t.jsxs)("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 p-8",children:[(0,t.jsx)("p",{className:"text-destructive text-sm font-medium",children:"Login Failed"}),(0,t.jsx)("p",{className:"text-muted-foreground max-w-md text-center text-sm",children:x}),(0,t.jsx)("button",{onClick:y,className:"bg-primary text-primary-foreground hover:bg-primary-hover rounded-md px-4 py-2 text-sm font-medium transition-colors",children:"Try Again"})]}):(0,t.jsx)(r.f.Provider,{value:S,children:u})}],791738)}]);