@stigmer/server-slim 3.13.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 (738) hide show
  1. package/README.md +3 -0
  2. package/console/404.html +1 -0
  3. package/console/Icon-bw.svg +10 -0
  4. package/console/Icon-light.svg +10 -0
  5. package/console/__next.__PAGE__.txt +5 -0
  6. package/console/__next._full.txt +28 -0
  7. package/console/__next._head.txt +6 -0
  8. package/console/__next._index.txt +17 -0
  9. package/console/__next._tree.txt +5 -0
  10. package/console/_next/static/XrBnttPHHP5Wmi7mT4uLM/_buildManifest.js +11 -0
  11. package/console/_next/static/XrBnttPHHP5Wmi7mT4uLM/_clientMiddlewareManifest.js +1 -0
  12. package/console/_next/static/XrBnttPHHP5Wmi7mT4uLM/_ssgManifest.js +1 -0
  13. package/console/_next/static/chunks/0-6znc4v4kg4~.js +1 -0
  14. package/console/_next/static/chunks/0-73gkqs33_.~.js +1 -0
  15. package/console/_next/static/chunks/0-l4jzu40dd8w.js +1 -0
  16. package/console/_next/static/chunks/0-z-fnjdx4ulh.js +1 -0
  17. package/console/_next/static/chunks/0-zcgxw8vt51~.js +1 -0
  18. package/console/_next/static/chunks/0.f-b71h~m9l_.js +1 -0
  19. package/console/_next/static/chunks/0.p57pbuzo8j7.js +90 -0
  20. package/console/_next/static/chunks/0.qu8zg6yocro.js +1 -0
  21. package/console/_next/static/chunks/00-fpv~l3r27l.js +1 -0
  22. package/console/_next/static/chunks/005ctashl3n1r.js +1 -0
  23. package/console/_next/static/chunks/0068d1zb538z~.js +1 -0
  24. package/console/_next/static/chunks/008b.zzs.t4bw.js +139 -0
  25. package/console/_next/static/chunks/00d~s.n2ue-_h.js +1 -0
  26. package/console/_next/static/chunks/00o8ud2dmna2j.js +1 -0
  27. package/console/_next/static/chunks/00r~itj4ekq5y.js +1 -0
  28. package/console/_next/static/chunks/01.9x7hzkgv7j.js +1 -0
  29. package/console/_next/static/chunks/016uwj-o-jqap.js +1 -0
  30. package/console/_next/static/chunks/01f1gh.2dzexy.js +1 -0
  31. package/console/_next/static/chunks/01ontipw7_pn-.js +1 -0
  32. package/console/_next/static/chunks/02fsq8lsaeu8j.js +1 -0
  33. package/console/_next/static/chunks/02qsbdquvk64o.js +1 -0
  34. package/console/_next/static/chunks/03.b9z-1o34dx.js +1 -0
  35. package/console/_next/static/chunks/038jxymv2x4u-.js +148 -0
  36. package/console/_next/static/chunks/03f2f6enzzhsy.js +1 -0
  37. package/console/_next/static/chunks/03l_lqxocp3uj.js +1 -0
  38. package/console/_next/static/chunks/03lth2le32c6r.js +201 -0
  39. package/console/_next/static/chunks/03v0v690_bw8u.js +62 -0
  40. package/console/_next/static/chunks/03yru4-m-450t.js +1 -0
  41. package/console/_next/static/chunks/03~yq9q893hmn.js +1 -0
  42. package/console/_next/static/chunks/04nu-nyhd8yfk.js +18 -0
  43. package/console/_next/static/chunks/04uzf6wcrofgt.js +1 -0
  44. package/console/_next/static/chunks/056bfxvkb8fd~.js +1 -0
  45. package/console/_next/static/chunks/06huuay3x3z07.js +1 -0
  46. package/console/_next/static/chunks/06o.rsm2b~dht.js +60 -0
  47. package/console/_next/static/chunks/07.l7154cu7z-.js +1 -0
  48. package/console/_next/static/chunks/07wnm1~gr1rx~.js +1 -0
  49. package/console/_next/static/chunks/08.rk-nar1l2t.js +25 -0
  50. package/console/_next/static/chunks/08iibm2~7e.mj.js +1 -0
  51. package/console/_next/static/chunks/08o5wsrurx9ux.js +5 -0
  52. package/console/_next/static/chunks/09~n7y-jkmjlj.js +152 -0
  53. package/console/_next/static/chunks/0_mhv9_2_g.-d.js +119 -0
  54. package/console/_next/static/chunks/0af53k.rxu1kn.js +1 -0
  55. package/console/_next/static/chunks/0amugang-25bm.js +1 -0
  56. package/console/_next/static/chunks/0awsj.h.eiuen.js +1 -0
  57. package/console/_next/static/chunks/0axtn1ln1j35_.js +79 -0
  58. package/console/_next/static/chunks/0c5xj4q0jmdu0.js +1 -0
  59. package/console/_next/static/chunks/0c7llz2igr3w7.js +1 -0
  60. package/console/_next/static/chunks/0cgp87bgoglgv.js +1 -0
  61. package/console/_next/static/chunks/0co3~00k0sae5.js +1 -0
  62. package/console/_next/static/chunks/0cq0zrqlu~xa7.js +1 -0
  63. package/console/_next/static/chunks/0cs_h74-ljzlt.js +77 -0
  64. package/console/_next/static/chunks/0cu8k_dz43e4y.js +1 -0
  65. package/console/_next/static/chunks/0d05q_m7mqj4o.js +1 -0
  66. package/console/_next/static/chunks/0dsde0n1co0l..js +1 -0
  67. package/console/_next/static/chunks/0e4xdug~7dxzk.js +1 -0
  68. package/console/_next/static/chunks/0e7hldxv930hc.js +12 -0
  69. package/console/_next/static/chunks/0ed3hfv95qark.js +10 -0
  70. package/console/_next/static/chunks/0f1nokqa6poai.js +1 -0
  71. package/console/_next/static/chunks/0f8bbcvfh6x_j.js +64 -0
  72. package/console/_next/static/chunks/0fy2-q-5a0j3r.js +1 -0
  73. package/console/_next/static/chunks/0g-98wql22rf4.css +1 -0
  74. package/console/_next/static/chunks/0g167wye7-x6z.js +1 -0
  75. package/console/_next/static/chunks/0g4_345f39a55.js +1 -0
  76. package/console/_next/static/chunks/0ge0mq0ea60lx.js +1 -0
  77. package/console/_next/static/chunks/0gepanyj709pr.js +1 -0
  78. package/console/_next/static/chunks/0glne1asott9e.js +2 -0
  79. package/console/_next/static/chunks/0hb.-vcj2w6kf.js +1 -0
  80. package/console/_next/static/chunks/0hdh_2akzrlxi.js +287 -0
  81. package/console/_next/static/chunks/0hhe78mplcj67.js +1 -0
  82. package/console/_next/static/chunks/0hori02zn~h3o.js +1 -0
  83. package/console/_next/static/chunks/0hq~c-~dp2g~1.js +1 -0
  84. package/console/_next/static/chunks/0i.l9589uvx0j.js +1 -0
  85. package/console/_next/static/chunks/0i8pgzf~hu-3m.js +24 -0
  86. package/console/_next/static/chunks/0icpvuwlmnlty.js +43 -0
  87. package/console/_next/static/chunks/0icsogze8wb_v.js +3 -0
  88. package/console/_next/static/chunks/0ij17mw0v0qd-.js +1 -0
  89. package/console/_next/static/chunks/0io-wgdji~5d0.js +1 -0
  90. package/console/_next/static/chunks/0ipk1er3w80bj.js +24 -0
  91. package/console/_next/static/chunks/0irq1yd9ix16u.js +1 -0
  92. package/console/_next/static/chunks/0iwpyv2wbln6f.js +1 -0
  93. package/console/_next/static/chunks/0ixo5_jc~m0~2.js +1 -0
  94. package/console/_next/static/chunks/0jxlubusvmdjm.js +1 -0
  95. package/console/_next/static/chunks/0j~3z.dgn_8ff.css +6 -0
  96. package/console/_next/static/chunks/0k9_1v72yx36d.js +226 -0
  97. package/console/_next/static/chunks/0ka-.7dww7nze.js +101 -0
  98. package/console/_next/static/chunks/0kt3942_0py-t.js +1 -0
  99. package/console/_next/static/chunks/0l3uvjh3oslhq.js +1 -0
  100. package/console/_next/static/chunks/0lp.du_t-~cqs.js +2 -0
  101. package/console/_next/static/chunks/0lq22-4n7_uyt.js +34 -0
  102. package/console/_next/static/chunks/0lypu-.xpph9..js +15 -0
  103. package/console/_next/static/chunks/0mb.pnhflhw95.js +1 -0
  104. package/console/_next/static/chunks/0mcz_room09fj.js +1 -0
  105. package/console/_next/static/chunks/0mo3-obfy2_6v.js +15 -0
  106. package/console/_next/static/chunks/0mtfbfe5xd3.6.js +1 -0
  107. package/console/_next/static/chunks/0mvcspqlkvjri.js +1 -0
  108. package/console/_next/static/chunks/0n2qydw3oc1oj.js +1 -0
  109. package/console/_next/static/chunks/0nnkdto25tilf.js +1 -0
  110. package/console/_next/static/chunks/0npm9l63~4j0v.js +1 -0
  111. package/console/_next/static/chunks/0nu6llqvg4741.js +1 -0
  112. package/console/_next/static/chunks/0n~glqz40m6gv.js +1 -0
  113. package/console/_next/static/chunks/0o-.19qua6web.js +5 -0
  114. package/console/_next/static/chunks/0omq5mq8dkd24.js +1 -0
  115. package/console/_next/static/chunks/0oprw5m.lmqln.js +1 -0
  116. package/console/_next/static/chunks/0ortphe030oky.js +1 -0
  117. package/console/_next/static/chunks/0oufb2b491l23.js +153 -0
  118. package/console/_next/static/chunks/0owq59irnycu5.js +1 -0
  119. package/console/_next/static/chunks/0ptwwlt0l20~o.js +1 -0
  120. package/console/_next/static/chunks/0q2tc-vqxe1_n.js +1 -0
  121. package/console/_next/static/chunks/0qfu4h5g.k-yt.js +1 -0
  122. package/console/_next/static/chunks/0qji_.pm~u8x3.js +1 -0
  123. package/console/_next/static/chunks/0qm2930z0c.8m.js +80 -0
  124. package/console/_next/static/chunks/0q~1rz_i~v0vs.js +1 -0
  125. package/console/_next/static/chunks/0r4lipg4xb6fx.js +1 -0
  126. package/console/_next/static/chunks/0rhvismtjivza.js +104 -0
  127. package/console/_next/static/chunks/0rmt10l3458p_.js +93 -0
  128. package/console/_next/static/chunks/0rob~86j~8vge.js +1 -0
  129. package/console/_next/static/chunks/0r~zu0c3j_b7p.js +1 -0
  130. package/console/_next/static/chunks/0s0v8xobo-2ok.js +34 -0
  131. package/console/_next/static/chunks/0s8nwq43gep9_.js +15 -0
  132. package/console/_next/static/chunks/0spswjguxbqfn.js +1 -0
  133. package/console/_next/static/chunks/0t6aq14rpn1.w.js +1 -0
  134. package/console/_next/static/chunks/0taiwi2j.k7mm.js +1 -0
  135. package/console/_next/static/chunks/0tj3k0t29gpn7.js +1 -0
  136. package/console/_next/static/chunks/0tq77.56bu2eu.js +1 -0
  137. package/console/_next/static/chunks/0ulcdeu8yx-cn.js +1 -0
  138. package/console/_next/static/chunks/0uvbqsa~x3_x6.js +1 -0
  139. package/console/_next/static/chunks/0uw8zy_zoej6s.js +1 -0
  140. package/console/_next/static/chunks/0uz5-~rqk9vr..js +1 -0
  141. package/console/_next/static/chunks/0w3ug0~zih~j2.js +1 -0
  142. package/console/_next/static/chunks/0wfrz3x.bxehc.js +1 -0
  143. package/console/_next/static/chunks/0wyb4nqlt6his.js +1 -0
  144. package/console/_next/static/chunks/0x.4919xjicc5.js +75 -0
  145. package/console/_next/static/chunks/0xr1dk~mec2dn.js +1 -0
  146. package/console/_next/static/chunks/0xxouzzjw_a6q.js +115 -0
  147. package/console/_next/static/chunks/0y0u4wm.3~_ac.js +1 -0
  148. package/console/_next/static/chunks/0y4vop46pw7ip.js +2 -0
  149. package/console/_next/static/chunks/0y5z3t-z1c8ks.js.map +5 -0
  150. package/console/_next/static/chunks/0y99xmlf_e2si.js +1 -0
  151. package/console/_next/static/chunks/0ydl92ezt_ppz.js +1 -0
  152. package/console/_next/static/chunks/0ywlzawl2ml3h.js +1 -0
  153. package/console/_next/static/chunks/0yysdfbgz-l8n.js +1 -0
  154. package/console/_next/static/chunks/0zjs5hlwbvch9.js +4 -0
  155. package/console/_next/static/chunks/0zsntdh42--v1.js +1 -0
  156. package/console/_next/static/chunks/104yvyc1ce3q5.js +1 -0
  157. package/console/_next/static/chunks/1051z1rwyse00.js +1 -0
  158. package/console/_next/static/chunks/10h6g4u9i~5h8.js +1 -0
  159. package/console/_next/static/chunks/10isn5~-bj4w5.js +4 -0
  160. package/console/_next/static/chunks/10ymqudg~95gr.js +1 -0
  161. package/console/_next/static/chunks/111eimn8nia.7.js +1 -0
  162. package/console/_next/static/chunks/1155_-gh-rcvi.js +1 -0
  163. package/console/_next/static/chunks/117cg_x8i7.ol.js +1 -0
  164. package/console/_next/static/chunks/11_7qxlc92f5s.js +1 -0
  165. package/console/_next/static/chunks/11h85j-8~tny3.js +36 -0
  166. package/console/_next/static/chunks/11t~35bechtea.js +1 -0
  167. package/console/_next/static/chunks/11uh-ttx4zin-.js +9 -0
  168. package/console/_next/static/chunks/11xfx57fbi3md.js +2 -0
  169. package/console/_next/static/chunks/12329wyw7127c.js +1 -0
  170. package/console/_next/static/chunks/123jshjvn0ocr.js +31 -0
  171. package/console/_next/static/chunks/128ahbvhdeeq-.js +1 -0
  172. package/console/_next/static/chunks/13hl4dngamd3l.js +127 -0
  173. package/console/_next/static/chunks/14.38bpm-d3-l.js +1 -0
  174. package/console/_next/static/chunks/14i46k409qlt0.js +1 -0
  175. package/console/_next/static/chunks/14j238ax8coge.js +29 -0
  176. package/console/_next/static/chunks/159151ghv9-cc.js +1 -0
  177. package/console/_next/static/chunks/15hlb71q~xfev.js +1 -0
  178. package/console/_next/static/chunks/15r_pfbdb2jhp.js +23 -0
  179. package/console/_next/static/chunks/15wc.2zpsy4wc.js +4 -0
  180. package/console/_next/static/chunks/16pzrphqjtyli.js +1 -0
  181. package/console/_next/static/chunks/16ukgtm3fhab~.js +1071 -0
  182. package/console/_next/static/chunks/170p3g7_6_620.js +2 -0
  183. package/console/_next/static/chunks/175hd_pl41_vh.js +15 -0
  184. package/console/_next/static/chunks/17glhyaxi4vs-.js +1 -0
  185. package/console/_next/static/chunks/17jhgtykn778_.js +1 -0
  186. package/console/_next/static/chunks/17v4twif7y~.b.js +1 -0
  187. package/console/_next/static/chunks/182b_f_n0-cdr.js +1 -0
  188. package/console/_next/static/chunks/187v8dzyf1l-f.js +80 -0
  189. package/console/_next/static/chunks/turbopack-0cvnq9zq1g68-.js +1 -0
  190. package/console/_next/static/chunks/turbopack-172c~.rma.yso.js +1 -0
  191. package/console/_next/static/chunks/turbopack-worker-0sjn--fhq~1cg.js +1 -0
  192. package/console/_next/static/media/02263ebadd758ea4-s.0qg7j5o.yrclm.woff2 +0 -0
  193. package/console/_next/static/media/03fc1b4a8d284b5e-s.09.f.n_ccld80.woff2 +0 -0
  194. package/console/_next/static/media/07454f8ad8aaac57-s.0tqkxa-w3pk~c.woff2 +0 -0
  195. package/console/_next/static/media/1bcd0e671759a44c-s.0vnh8.d8wxa2x.woff2 +0 -0
  196. package/console/_next/static/media/1bffadaabf893a1e-s.16ipb6fqu393i.woff2 +0 -0
  197. package/console/_next/static/media/224e262ef877bfa4-s.0mo8vqgr8yagc.woff2 +0 -0
  198. package/console/_next/static/media/2bbe8d2671613f1f-s.067x_6k0k23tk.woff2 +0 -0
  199. package/console/_next/static/media/2c55a0e60120577a-s.0bjc5tiuqdqro.woff2 +0 -0
  200. package/console/_next/static/media/2fe89d53234c61d4-s.0k_.i63k_i_qa.woff2 +0 -0
  201. package/console/_next/static/media/4fa387ec64143e14-s.0wkzw~je483f-.woff2 +0 -0
  202. package/console/_next/static/media/53b9e256198e5412-s.0-wfv7uh4i7h9.woff2 +0 -0
  203. package/console/_next/static/media/5476f68d60460930-s.0wxq9webf.ew4.woff2 +0 -0
  204. package/console/_next/static/media/57215795b8570f5c-s.0vwgtotjdgnhr.woff2 +0 -0
  205. package/console/_next/static/media/59b15b4bcd7b1eb5-s.0x08jh8vondwt.woff2 +0 -0
  206. package/console/_next/static/media/5ce348bf30bf5439-s.0zgw-jeven.3w.woff2 +0 -0
  207. package/console/_next/static/media/5e05ae5b48faa55e-s.0m9hhkgdlzukj.woff2 +0 -0
  208. package/console/_next/static/media/6306c77e7c8268e4-s.0rhz0arwfsn~5.woff2 +0 -0
  209. package/console/_next/static/media/68757d6cddeff913-s.0hkrq11n-dhos.woff2 +0 -0
  210. package/console/_next/static/media/7178b3e590c64307-s.0nx0ww8fni_q3.woff2 +0 -0
  211. package/console/_next/static/media/797e433ab948586e-s.p.08e28id.o-okb.woff2 +0 -0
  212. package/console/_next/static/media/7d817b4c03b0c5f1-s.0l76wvqk9d84w.woff2 +0 -0
  213. package/console/_next/static/media/7f11d98043fdedc9-s.0r4w1y.tjq0ay.woff2 +0 -0
  214. package/console/_next/static/media/7fea77d1d19108bf-s.0xyeb7czu1stb.woff2 +0 -0
  215. package/console/_next/static/media/83afe278b6a6bb3c-s.0q-301v4kxxnr.woff2 +0 -0
  216. package/console/_next/static/media/8a480f0b521d4e75-s.0jzbimsg8vl84.woff2 +0 -0
  217. package/console/_next/static/media/90c51ce8fb754fe8-s.00z~hoalba5dm.woff2 +0 -0
  218. package/console/_next/static/media/99e609270109b47d-s.16-z~2sp29ex6.woff2 +0 -0
  219. package/console/_next/static/media/9c72aa0f40e4eef8-s.0m6w47a4e5dy9.woff2 +0 -0
  220. package/console/_next/static/media/a7afbb44bec2bb18-s.0juuwbcf7uz~t.woff2 +0 -0
  221. package/console/_next/static/media/ad66f9afd8947f86-s.11u06r12fd6v_.woff2 +0 -0
  222. package/console/_next/static/media/bbc41e54d2fcbd21-s.0k4k9394f2q-k.woff2 +0 -0
  223. package/console/_next/static/media/caa3a2e1cccd8315-s.p.09~u27dqhyhd6.woff2 +0 -0
  224. package/console/_next/static/media/d8cb5ab3660140cd-s.0ri_id_kcagyz.woff2 +0 -0
  225. package/console/_next/static/media/e15f58668ad64cb8-s.0~.8lt~vdqmc3.woff2 +0 -0
  226. package/console/_next/static/media/e390973e931a41c5-s.08hd0g.321csk.woff2 +0 -0
  227. package/console/_next/static/media/e532fa1b9921e1cd-s.0~wrfy7sm-h4g.woff2 +0 -0
  228. package/console/_next/static/media/e6d00ff86ef9e699-s.0lcb62h0-.jh3.woff2 +0 -0
  229. package/console/_next/static/media/effe91970fc4db64-s.07ig5l8azj~hy.woff2 +0 -0
  230. package/console/_next/static/media/elk-worker.min.13hrbirt7_.ef.js +6401 -0
  231. package/console/_next/static/media/favicon.0x3dzn~oxb6tn.ico +0 -0
  232. package/console/_next/static/media/fef07dbb0973bf53-s.12tyk43_3sh9u.woff2 +0 -0
  233. package/console/_not-found/__next._full.txt +29 -0
  234. package/console/_not-found/__next._head.txt +6 -0
  235. package/console/_not-found/__next._index.txt +17 -0
  236. package/console/_not-found/__next._not-found.__PAGE__.txt +6 -0
  237. package/console/_not-found/__next._not-found.txt +5 -0
  238. package/console/_not-found/__next._tree.txt +3 -0
  239. package/console/_not-found.html +1 -0
  240. package/console/_not-found.txt +29 -0
  241. package/console/apple-touch-icon-dark.png +0 -0
  242. package/console/apple-touch-icon-light.png +0 -0
  243. package/console/auth/callback/__next._full.txt +36 -0
  244. package/console/auth/callback/__next._head.txt +6 -0
  245. package/console/auth/callback/__next._index.txt +17 -0
  246. package/console/auth/callback/__next._tree.txt +5 -0
  247. package/console/auth/callback/__next.auth.callback.__PAGE__.txt +9 -0
  248. package/console/auth/callback/__next.auth.callback.txt +5 -0
  249. package/console/auth/callback/__next.auth.txt +5 -0
  250. package/console/auth/callback.html +1 -0
  251. package/console/auth/callback.txt +36 -0
  252. package/console/auth/github/callback/__next._full.txt +37 -0
  253. package/console/auth/github/callback/__next._head.txt +6 -0
  254. package/console/auth/github/callback/__next._index.txt +17 -0
  255. package/console/auth/github/callback/__next._tree.txt +5 -0
  256. package/console/auth/github/callback/__next.auth.github.callback.__PAGE__.txt +9 -0
  257. package/console/auth/github/callback/__next.auth.github.callback.txt +5 -0
  258. package/console/auth/github/callback/__next.auth.github.txt +5 -0
  259. package/console/auth/github/callback/__next.auth.txt +5 -0
  260. package/console/auth/github/callback.html +1 -0
  261. package/console/auth/github/callback.txt +37 -0
  262. package/console/auth/oauth/callback/__next._full.txt +37 -0
  263. package/console/auth/oauth/callback/__next._head.txt +6 -0
  264. package/console/auth/oauth/callback/__next._index.txt +17 -0
  265. package/console/auth/oauth/callback/__next._tree.txt +5 -0
  266. package/console/auth/oauth/callback/__next.auth.oauth.callback.__PAGE__.txt +9 -0
  267. package/console/auth/oauth/callback/__next.auth.oauth.callback.txt +5 -0
  268. package/console/auth/oauth/callback/__next.auth.oauth.txt +5 -0
  269. package/console/auth/oauth/callback/__next.auth.txt +5 -0
  270. package/console/auth/oauth/callback.html +1 -0
  271. package/console/auth/oauth/callback.txt +37 -0
  272. package/console/chat/__placeholder__/__placeholder__/__next._full.txt +35 -0
  273. package/console/chat/__placeholder__/__placeholder__/__next._head.txt +6 -0
  274. package/console/chat/__placeholder__/__placeholder__/__next._index.txt +17 -0
  275. package/console/chat/__placeholder__/__placeholder__/__next._tree.txt +5 -0
  276. package/console/chat/__placeholder__/__placeholder__/__next.chat.$d$org.$d$slug.__PAGE__.txt +6 -0
  277. package/console/chat/__placeholder__/__placeholder__/__next.chat.$d$org.$d$slug.txt +5 -0
  278. package/console/chat/__placeholder__/__placeholder__/__next.chat.$d$org.txt +5 -0
  279. package/console/chat/__placeholder__/__placeholder__/__next.chat.txt +5 -0
  280. package/console/chat/__placeholder__/__placeholder__.html +1 -0
  281. package/console/chat/__placeholder__/__placeholder__.txt +35 -0
  282. package/console/conversations/__next._full.txt +32 -0
  283. package/console/conversations/__next._head.txt +6 -0
  284. package/console/conversations/__next._index.txt +17 -0
  285. package/console/conversations/__next._tree.txt +5 -0
  286. package/console/conversations/__next.conversations.__PAGE__.txt +6 -0
  287. package/console/conversations/__next.conversations.txt +5 -0
  288. package/console/conversations/__placeholder__/__placeholder__/__next._full.txt +35 -0
  289. package/console/conversations/__placeholder__/__placeholder__/__next._head.txt +6 -0
  290. package/console/conversations/__placeholder__/__placeholder__/__next._index.txt +17 -0
  291. package/console/conversations/__placeholder__/__placeholder__/__next._tree.txt +5 -0
  292. package/console/conversations/__placeholder__/__placeholder__/__next.conversations.$d$channelId.$d$key.__PAGE__.txt +6 -0
  293. package/console/conversations/__placeholder__/__placeholder__/__next.conversations.$d$channelId.$d$key.txt +5 -0
  294. package/console/conversations/__placeholder__/__placeholder__/__next.conversations.$d$channelId.txt +5 -0
  295. package/console/conversations/__placeholder__/__placeholder__/__next.conversations.txt +5 -0
  296. package/console/conversations/__placeholder__/__placeholder__.html +1 -0
  297. package/console/conversations/__placeholder__/__placeholder__.txt +35 -0
  298. package/console/conversations.html +1 -0
  299. package/console/conversations.txt +32 -0
  300. package/console/dashboard/__next._full.txt +32 -0
  301. package/console/dashboard/__next._head.txt +6 -0
  302. package/console/dashboard/__next._index.txt +17 -0
  303. package/console/dashboard/__next._tree.txt +5 -0
  304. package/console/dashboard/__next.dashboard.__PAGE__.txt +6 -0
  305. package/console/dashboard/__next.dashboard.txt +5 -0
  306. package/console/dashboard.html +1 -0
  307. package/console/dashboard.txt +32 -0
  308. package/console/embed.js +1 -0
  309. package/console/executions/__placeholder__/__next._full.txt +32 -0
  310. package/console/executions/__placeholder__/__next._head.txt +6 -0
  311. package/console/executions/__placeholder__/__next._index.txt +17 -0
  312. package/console/executions/__placeholder__/__next._tree.txt +5 -0
  313. package/console/executions/__placeholder__/__next.executions.$d$id.__PAGE__.txt +5 -0
  314. package/console/executions/__placeholder__/__next.executions.$d$id.txt +5 -0
  315. package/console/executions/__placeholder__/__next.executions.txt +5 -0
  316. package/console/executions/__placeholder__.html +1 -0
  317. package/console/executions/__placeholder__.txt +32 -0
  318. package/console/favicon-dark-16x16.png +0 -0
  319. package/console/favicon-dark-32x32.png +0 -0
  320. package/console/favicon-dark.ico +0 -0
  321. package/console/favicon-dark.svg +11 -0
  322. package/console/favicon-light-16x16.png +0 -0
  323. package/console/favicon-light-32x32.png +0 -0
  324. package/console/favicon-light.ico +0 -0
  325. package/console/favicon-light.svg +11 -0
  326. package/console/favicon.ico +0 -0
  327. package/console/index.html +1 -0
  328. package/console/index.txt +28 -0
  329. package/console/invite/__placeholder__/__next._full.txt +33 -0
  330. package/console/invite/__placeholder__/__next._head.txt +6 -0
  331. package/console/invite/__placeholder__/__next._index.txt +17 -0
  332. package/console/invite/__placeholder__/__next._tree.txt +5 -0
  333. package/console/invite/__placeholder__/__next.invite.$d$token.__PAGE__.txt +6 -0
  334. package/console/invite/__placeholder__/__next.invite.$d$token.txt +5 -0
  335. package/console/invite/__placeholder__/__next.invite.txt +5 -0
  336. package/console/invite/__placeholder__.html +1 -0
  337. package/console/invite/__placeholder__.txt +33 -0
  338. package/console/library/__next._full.txt +33 -0
  339. package/console/library/__next._head.txt +6 -0
  340. package/console/library/__next._index.txt +17 -0
  341. package/console/library/__next._tree.txt +5 -0
  342. package/console/library/__next.library.__PAGE__.txt +6 -0
  343. package/console/library/__next.library.txt +7 -0
  344. package/console/library/agents/__next._full.txt +36 -0
  345. package/console/library/agents/__next._head.txt +6 -0
  346. package/console/library/agents/__next._index.txt +17 -0
  347. package/console/library/agents/__next._tree.txt +5 -0
  348. package/console/library/agents/__next.library.agents.__PAGE__.txt +6 -0
  349. package/console/library/agents/__next.library.agents.txt +5 -0
  350. package/console/library/agents/__next.library.txt +7 -0
  351. package/console/library/agents/__placeholder__/__placeholder__/__next._full.txt +39 -0
  352. package/console/library/agents/__placeholder__/__placeholder__/__next._head.txt +6 -0
  353. package/console/library/agents/__placeholder__/__placeholder__/__next._index.txt +17 -0
  354. package/console/library/agents/__placeholder__/__placeholder__/__next._tree.txt +5 -0
  355. package/console/library/agents/__placeholder__/__placeholder__/__next.library.agents.$d$org.$d$slug.__PAGE__.txt +6 -0
  356. package/console/library/agents/__placeholder__/__placeholder__/__next.library.agents.$d$org.$d$slug.txt +5 -0
  357. package/console/library/agents/__placeholder__/__placeholder__/__next.library.agents.$d$org.txt +5 -0
  358. package/console/library/agents/__placeholder__/__placeholder__/__next.library.agents.txt +5 -0
  359. package/console/library/agents/__placeholder__/__placeholder__/__next.library.txt +7 -0
  360. package/console/library/agents/__placeholder__/__placeholder__.html +1 -0
  361. package/console/library/agents/__placeholder__/__placeholder__.txt +39 -0
  362. package/console/library/agents/new/__next._full.txt +40 -0
  363. package/console/library/agents/new/__next._head.txt +6 -0
  364. package/console/library/agents/new/__next._index.txt +17 -0
  365. package/console/library/agents/new/__next._tree.txt +5 -0
  366. package/console/library/agents/new/__next.library.agents.new.__PAGE__.txt +9 -0
  367. package/console/library/agents/new/__next.library.agents.new.txt +5 -0
  368. package/console/library/agents/new/__next.library.agents.txt +5 -0
  369. package/console/library/agents/new/__next.library.txt +7 -0
  370. package/console/library/agents/new.html +1 -0
  371. package/console/library/agents/new.txt +40 -0
  372. package/console/library/agents.html +1 -0
  373. package/console/library/agents.txt +36 -0
  374. package/console/library/mcp-servers/__next._full.txt +36 -0
  375. package/console/library/mcp-servers/__next._head.txt +6 -0
  376. package/console/library/mcp-servers/__next._index.txt +17 -0
  377. package/console/library/mcp-servers/__next._tree.txt +5 -0
  378. package/console/library/mcp-servers/__next.library.mcp-servers.__PAGE__.txt +6 -0
  379. package/console/library/mcp-servers/__next.library.mcp-servers.txt +5 -0
  380. package/console/library/mcp-servers/__next.library.txt +7 -0
  381. package/console/library/mcp-servers/__placeholder__/__placeholder__/__next._full.txt +39 -0
  382. package/console/library/mcp-servers/__placeholder__/__placeholder__/__next._head.txt +6 -0
  383. package/console/library/mcp-servers/__placeholder__/__placeholder__/__next._index.txt +17 -0
  384. package/console/library/mcp-servers/__placeholder__/__placeholder__/__next._tree.txt +5 -0
  385. package/console/library/mcp-servers/__placeholder__/__placeholder__/__next.library.mcp-servers.$d$org.$d$slug.__PAGE__.txt +6 -0
  386. package/console/library/mcp-servers/__placeholder__/__placeholder__/__next.library.mcp-servers.$d$org.$d$slug.txt +5 -0
  387. package/console/library/mcp-servers/__placeholder__/__placeholder__/__next.library.mcp-servers.$d$org.txt +5 -0
  388. package/console/library/mcp-servers/__placeholder__/__placeholder__/__next.library.mcp-servers.txt +5 -0
  389. package/console/library/mcp-servers/__placeholder__/__placeholder__/__next.library.txt +7 -0
  390. package/console/library/mcp-servers/__placeholder__/__placeholder__.html +1 -0
  391. package/console/library/mcp-servers/__placeholder__/__placeholder__.txt +39 -0
  392. package/console/library/mcp-servers/new/__next._full.txt +40 -0
  393. package/console/library/mcp-servers/new/__next._head.txt +6 -0
  394. package/console/library/mcp-servers/new/__next._index.txt +17 -0
  395. package/console/library/mcp-servers/new/__next._tree.txt +5 -0
  396. package/console/library/mcp-servers/new/__next.library.mcp-servers.new.__PAGE__.txt +9 -0
  397. package/console/library/mcp-servers/new/__next.library.mcp-servers.new.txt +5 -0
  398. package/console/library/mcp-servers/new/__next.library.mcp-servers.txt +5 -0
  399. package/console/library/mcp-servers/new/__next.library.txt +7 -0
  400. package/console/library/mcp-servers/new.html +1 -0
  401. package/console/library/mcp-servers/new.txt +40 -0
  402. package/console/library/mcp-servers.html +1 -0
  403. package/console/library/mcp-servers.txt +36 -0
  404. package/console/library/schedules/__next._full.txt +36 -0
  405. package/console/library/schedules/__next._head.txt +6 -0
  406. package/console/library/schedules/__next._index.txt +17 -0
  407. package/console/library/schedules/__next._tree.txt +5 -0
  408. package/console/library/schedules/__next.library.schedules.__PAGE__.txt +6 -0
  409. package/console/library/schedules/__next.library.schedules.txt +5 -0
  410. package/console/library/schedules/__next.library.txt +7 -0
  411. package/console/library/schedules/__placeholder__/__placeholder__/__next._full.txt +39 -0
  412. package/console/library/schedules/__placeholder__/__placeholder__/__next._head.txt +6 -0
  413. package/console/library/schedules/__placeholder__/__placeholder__/__next._index.txt +17 -0
  414. package/console/library/schedules/__placeholder__/__placeholder__/__next._tree.txt +5 -0
  415. package/console/library/schedules/__placeholder__/__placeholder__/__next.library.schedules.$d$org.$d$slug.__PAGE__.txt +6 -0
  416. package/console/library/schedules/__placeholder__/__placeholder__/__next.library.schedules.$d$org.$d$slug.txt +5 -0
  417. package/console/library/schedules/__placeholder__/__placeholder__/__next.library.schedules.$d$org.txt +5 -0
  418. package/console/library/schedules/__placeholder__/__placeholder__/__next.library.schedules.txt +5 -0
  419. package/console/library/schedules/__placeholder__/__placeholder__/__next.library.txt +7 -0
  420. package/console/library/schedules/__placeholder__/__placeholder__.html +1 -0
  421. package/console/library/schedules/__placeholder__/__placeholder__.txt +39 -0
  422. package/console/library/schedules/new/__next._full.txt +40 -0
  423. package/console/library/schedules/new/__next._head.txt +6 -0
  424. package/console/library/schedules/new/__next._index.txt +17 -0
  425. package/console/library/schedules/new/__next._tree.txt +5 -0
  426. package/console/library/schedules/new/__next.library.schedules.new.__PAGE__.txt +9 -0
  427. package/console/library/schedules/new/__next.library.schedules.new.txt +5 -0
  428. package/console/library/schedules/new/__next.library.schedules.txt +5 -0
  429. package/console/library/schedules/new/__next.library.txt +7 -0
  430. package/console/library/schedules/new.html +1 -0
  431. package/console/library/schedules/new.txt +40 -0
  432. package/console/library/schedules.html +1 -0
  433. package/console/library/schedules.txt +36 -0
  434. package/console/library/skills/__next._full.txt +36 -0
  435. package/console/library/skills/__next._head.txt +6 -0
  436. package/console/library/skills/__next._index.txt +17 -0
  437. package/console/library/skills/__next._tree.txt +5 -0
  438. package/console/library/skills/__next.library.skills.__PAGE__.txt +6 -0
  439. package/console/library/skills/__next.library.skills.txt +5 -0
  440. package/console/library/skills/__next.library.txt +7 -0
  441. package/console/library/skills/__placeholder__/__placeholder__/__next._full.txt +39 -0
  442. package/console/library/skills/__placeholder__/__placeholder__/__next._head.txt +6 -0
  443. package/console/library/skills/__placeholder__/__placeholder__/__next._index.txt +17 -0
  444. package/console/library/skills/__placeholder__/__placeholder__/__next._tree.txt +5 -0
  445. package/console/library/skills/__placeholder__/__placeholder__/__next.library.skills.$d$org.$d$slug.__PAGE__.txt +6 -0
  446. package/console/library/skills/__placeholder__/__placeholder__/__next.library.skills.$d$org.$d$slug.txt +5 -0
  447. package/console/library/skills/__placeholder__/__placeholder__/__next.library.skills.$d$org.txt +5 -0
  448. package/console/library/skills/__placeholder__/__placeholder__/__next.library.skills.txt +5 -0
  449. package/console/library/skills/__placeholder__/__placeholder__/__next.library.txt +7 -0
  450. package/console/library/skills/__placeholder__/__placeholder__.html +1 -0
  451. package/console/library/skills/__placeholder__/__placeholder__.txt +39 -0
  452. package/console/library/skills/new/__next._full.txt +40 -0
  453. package/console/library/skills/new/__next._head.txt +6 -0
  454. package/console/library/skills/new/__next._index.txt +17 -0
  455. package/console/library/skills/new/__next._tree.txt +5 -0
  456. package/console/library/skills/new/__next.library.skills.new.__PAGE__.txt +9 -0
  457. package/console/library/skills/new/__next.library.skills.new.txt +5 -0
  458. package/console/library/skills/new/__next.library.skills.txt +5 -0
  459. package/console/library/skills/new/__next.library.txt +7 -0
  460. package/console/library/skills/new.html +1 -0
  461. package/console/library/skills/new.txt +40 -0
  462. package/console/library/skills.html +1 -0
  463. package/console/library/skills.txt +36 -0
  464. package/console/library/workflows/__next._full.txt +36 -0
  465. package/console/library/workflows/__next._head.txt +6 -0
  466. package/console/library/workflows/__next._index.txt +17 -0
  467. package/console/library/workflows/__next._tree.txt +5 -0
  468. package/console/library/workflows/__next.library.txt +7 -0
  469. package/console/library/workflows/__next.library.workflows.__PAGE__.txt +6 -0
  470. package/console/library/workflows/__next.library.workflows.txt +5 -0
  471. package/console/library/workflows/__placeholder__/__placeholder__/__next._full.txt +39 -0
  472. package/console/library/workflows/__placeholder__/__placeholder__/__next._head.txt +6 -0
  473. package/console/library/workflows/__placeholder__/__placeholder__/__next._index.txt +17 -0
  474. package/console/library/workflows/__placeholder__/__placeholder__/__next._tree.txt +5 -0
  475. package/console/library/workflows/__placeholder__/__placeholder__/__next.library.txt +7 -0
  476. package/console/library/workflows/__placeholder__/__placeholder__/__next.library.workflows.$d$org.$d$slug.__PAGE__.txt +6 -0
  477. package/console/library/workflows/__placeholder__/__placeholder__/__next.library.workflows.$d$org.$d$slug.txt +5 -0
  478. package/console/library/workflows/__placeholder__/__placeholder__/__next.library.workflows.$d$org.txt +5 -0
  479. package/console/library/workflows/__placeholder__/__placeholder__/__next.library.workflows.txt +5 -0
  480. package/console/library/workflows/__placeholder__/__placeholder__.html +1 -0
  481. package/console/library/workflows/__placeholder__/__placeholder__.txt +39 -0
  482. package/console/library/workflows/executions/__next._full.txt +37 -0
  483. package/console/library/workflows/executions/__next._head.txt +6 -0
  484. package/console/library/workflows/executions/__next._index.txt +17 -0
  485. package/console/library/workflows/executions/__next._tree.txt +5 -0
  486. package/console/library/workflows/executions/__next.library.txt +7 -0
  487. package/console/library/workflows/executions/__next.library.workflows.executions.__PAGE__.txt +6 -0
  488. package/console/library/workflows/executions/__next.library.workflows.executions.txt +5 -0
  489. package/console/library/workflows/executions/__next.library.workflows.txt +5 -0
  490. package/console/library/workflows/executions.html +1 -0
  491. package/console/library/workflows/executions.txt +37 -0
  492. package/console/library/workflows/new/__next._full.txt +40 -0
  493. package/console/library/workflows/new/__next._head.txt +6 -0
  494. package/console/library/workflows/new/__next._index.txt +17 -0
  495. package/console/library/workflows/new/__next._tree.txt +5 -0
  496. package/console/library/workflows/new/__next.library.txt +7 -0
  497. package/console/library/workflows/new/__next.library.workflows.new.__PAGE__.txt +9 -0
  498. package/console/library/workflows/new/__next.library.workflows.new.txt +5 -0
  499. package/console/library/workflows/new/__next.library.workflows.txt +5 -0
  500. package/console/library/workflows/new.html +1 -0
  501. package/console/library/workflows/new.txt +40 -0
  502. package/console/library/workflows.html +1 -0
  503. package/console/library/workflows.txt +36 -0
  504. package/console/library.html +1 -0
  505. package/console/library.txt +33 -0
  506. package/console/login/__next._full.txt +35 -0
  507. package/console/login/__next._head.txt +6 -0
  508. package/console/login/__next._index.txt +17 -0
  509. package/console/login/__next._tree.txt +5 -0
  510. package/console/login/__next.login.__PAGE__.txt +9 -0
  511. package/console/login/__next.login.txt +5 -0
  512. package/console/login.html +1 -0
  513. package/console/login.txt +35 -0
  514. package/console/logo.svg +1 -0
  515. package/console/oauth/slack/callback/__next._full.txt +37 -0
  516. package/console/oauth/slack/callback/__next._head.txt +6 -0
  517. package/console/oauth/slack/callback/__next._index.txt +17 -0
  518. package/console/oauth/slack/callback/__next._tree.txt +5 -0
  519. package/console/oauth/slack/callback/__next.oauth.slack.callback.__PAGE__.txt +9 -0
  520. package/console/oauth/slack/callback/__next.oauth.slack.callback.txt +5 -0
  521. package/console/oauth/slack/callback/__next.oauth.slack.txt +5 -0
  522. package/console/oauth/slack/callback/__next.oauth.txt +5 -0
  523. package/console/oauth/slack/callback.html +1 -0
  524. package/console/oauth/slack/callback.txt +37 -0
  525. package/console/sessions/__placeholder__/__next._full.txt +32 -0
  526. package/console/sessions/__placeholder__/__next._head.txt +6 -0
  527. package/console/sessions/__placeholder__/__next._index.txt +17 -0
  528. package/console/sessions/__placeholder__/__next._tree.txt +5 -0
  529. package/console/sessions/__placeholder__/__next.sessions.$d$id.__PAGE__.txt +5 -0
  530. package/console/sessions/__placeholder__/__next.sessions.$d$id.txt +5 -0
  531. package/console/sessions/__placeholder__/__next.sessions.txt +5 -0
  532. package/console/sessions/__placeholder__.html +1 -0
  533. package/console/sessions/__placeholder__.txt +32 -0
  534. package/console/settings/__next._full.txt +35 -0
  535. package/console/settings/__next._head.txt +6 -0
  536. package/console/settings/__next._index.txt +17 -0
  537. package/console/settings/__next._tree.txt +5 -0
  538. package/console/settings/__next.settings.__PAGE__.txt +9 -0
  539. package/console/settings/__next.settings.txt +6 -0
  540. package/console/settings/account-preferences/__next._full.txt +35 -0
  541. package/console/settings/account-preferences/__next._head.txt +6 -0
  542. package/console/settings/account-preferences/__next._index.txt +17 -0
  543. package/console/settings/account-preferences/__next._tree.txt +5 -0
  544. package/console/settings/account-preferences/__next.settings.account-preferences.__PAGE__.txt +6 -0
  545. package/console/settings/account-preferences/__next.settings.account-preferences.txt +5 -0
  546. package/console/settings/account-preferences/__next.settings.txt +6 -0
  547. package/console/settings/account-preferences.html +1 -0
  548. package/console/settings/account-preferences.txt +35 -0
  549. package/console/settings/api-keys/__next._full.txt +35 -0
  550. package/console/settings/api-keys/__next._head.txt +6 -0
  551. package/console/settings/api-keys/__next._index.txt +17 -0
  552. package/console/settings/api-keys/__next._tree.txt +5 -0
  553. package/console/settings/api-keys/__next.settings.api-keys.__PAGE__.txt +6 -0
  554. package/console/settings/api-keys/__next.settings.api-keys.txt +5 -0
  555. package/console/settings/api-keys/__next.settings.txt +6 -0
  556. package/console/settings/api-keys.html +1 -0
  557. package/console/settings/api-keys.txt +35 -0
  558. package/console/settings/billing/__next._full.txt +38 -0
  559. package/console/settings/billing/__next._head.txt +6 -0
  560. package/console/settings/billing/__next._index.txt +17 -0
  561. package/console/settings/billing/__next._tree.txt +5 -0
  562. package/console/settings/billing/__next.settings.billing.__PAGE__.txt +9 -0
  563. package/console/settings/billing/__next.settings.billing.txt +5 -0
  564. package/console/settings/billing/__next.settings.txt +6 -0
  565. package/console/settings/billing.html +1 -0
  566. package/console/settings/billing.txt +38 -0
  567. package/console/settings/channel-apps/__next._full.txt +35 -0
  568. package/console/settings/channel-apps/__next._head.txt +6 -0
  569. package/console/settings/channel-apps/__next._index.txt +17 -0
  570. package/console/settings/channel-apps/__next._tree.txt +5 -0
  571. package/console/settings/channel-apps/__next.settings.channel-apps.__PAGE__.txt +6 -0
  572. package/console/settings/channel-apps/__next.settings.channel-apps.txt +5 -0
  573. package/console/settings/channel-apps/__next.settings.txt +6 -0
  574. package/console/settings/channel-apps.html +1 -0
  575. package/console/settings/channel-apps.txt +35 -0
  576. package/console/settings/cursor-accounts/__next._full.txt +38 -0
  577. package/console/settings/cursor-accounts/__next._head.txt +6 -0
  578. package/console/settings/cursor-accounts/__next._index.txt +17 -0
  579. package/console/settings/cursor-accounts/__next._tree.txt +5 -0
  580. package/console/settings/cursor-accounts/__next.settings.cursor-accounts.__PAGE__.txt +9 -0
  581. package/console/settings/cursor-accounts/__next.settings.cursor-accounts.txt +5 -0
  582. package/console/settings/cursor-accounts/__next.settings.txt +6 -0
  583. package/console/settings/cursor-accounts.html +1 -0
  584. package/console/settings/cursor-accounts.txt +38 -0
  585. package/console/settings/environments/__next._full.txt +35 -0
  586. package/console/settings/environments/__next._head.txt +6 -0
  587. package/console/settings/environments/__next._index.txt +17 -0
  588. package/console/settings/environments/__next._tree.txt +5 -0
  589. package/console/settings/environments/__next.settings.environments.__PAGE__.txt +6 -0
  590. package/console/settings/environments/__next.settings.environments.txt +5 -0
  591. package/console/settings/environments/__next.settings.txt +6 -0
  592. package/console/settings/environments.html +1 -0
  593. package/console/settings/environments.txt +35 -0
  594. package/console/settings/identity-providers/__next._full.txt +35 -0
  595. package/console/settings/identity-providers/__next._head.txt +6 -0
  596. package/console/settings/identity-providers/__next._index.txt +17 -0
  597. package/console/settings/identity-providers/__next._tree.txt +5 -0
  598. package/console/settings/identity-providers/__next.settings.identity-providers.__PAGE__.txt +6 -0
  599. package/console/settings/identity-providers/__next.settings.identity-providers.txt +5 -0
  600. package/console/settings/identity-providers/__next.settings.txt +6 -0
  601. package/console/settings/identity-providers.html +1 -0
  602. package/console/settings/identity-providers.txt +35 -0
  603. package/console/settings/invitations/__next._full.txt +35 -0
  604. package/console/settings/invitations/__next._head.txt +6 -0
  605. package/console/settings/invitations/__next._index.txt +17 -0
  606. package/console/settings/invitations/__next._tree.txt +5 -0
  607. package/console/settings/invitations/__next.settings.invitations.__PAGE__.txt +6 -0
  608. package/console/settings/invitations/__next.settings.invitations.txt +5 -0
  609. package/console/settings/invitations/__next.settings.txt +6 -0
  610. package/console/settings/invitations.html +1 -0
  611. package/console/settings/invitations.txt +35 -0
  612. package/console/settings/members/__next._full.txt +35 -0
  613. package/console/settings/members/__next._head.txt +6 -0
  614. package/console/settings/members/__next._index.txt +17 -0
  615. package/console/settings/members/__next._tree.txt +5 -0
  616. package/console/settings/members/__next.settings.members.__PAGE__.txt +6 -0
  617. package/console/settings/members/__next.settings.members.txt +5 -0
  618. package/console/settings/members/__next.settings.txt +6 -0
  619. package/console/settings/members.html +1 -0
  620. package/console/settings/members.txt +35 -0
  621. package/console/settings/memory/__next._full.txt +35 -0
  622. package/console/settings/memory/__next._head.txt +6 -0
  623. package/console/settings/memory/__next._index.txt +17 -0
  624. package/console/settings/memory/__next._tree.txt +5 -0
  625. package/console/settings/memory/__next.settings.memory.__PAGE__.txt +6 -0
  626. package/console/settings/memory/__next.settings.memory.txt +5 -0
  627. package/console/settings/memory/__next.settings.txt +6 -0
  628. package/console/settings/memory.html +1 -0
  629. package/console/settings/memory.txt +35 -0
  630. package/console/settings/oauth-apps/__next._full.txt +35 -0
  631. package/console/settings/oauth-apps/__next._head.txt +6 -0
  632. package/console/settings/oauth-apps/__next._index.txt +17 -0
  633. package/console/settings/oauth-apps/__next._tree.txt +5 -0
  634. package/console/settings/oauth-apps/__next.settings.oauth-apps.__PAGE__.txt +6 -0
  635. package/console/settings/oauth-apps/__next.settings.oauth-apps.txt +5 -0
  636. package/console/settings/oauth-apps/__next.settings.txt +6 -0
  637. package/console/settings/oauth-apps.html +1 -0
  638. package/console/settings/oauth-apps.txt +35 -0
  639. package/console/settings/org-preferences/__next._full.txt +35 -0
  640. package/console/settings/org-preferences/__next._head.txt +6 -0
  641. package/console/settings/org-preferences/__next._index.txt +17 -0
  642. package/console/settings/org-preferences/__next._tree.txt +5 -0
  643. package/console/settings/org-preferences/__next.settings.org-preferences.__PAGE__.txt +6 -0
  644. package/console/settings/org-preferences/__next.settings.org-preferences.txt +5 -0
  645. package/console/settings/org-preferences/__next.settings.txt +6 -0
  646. package/console/settings/org-preferences.html +1 -0
  647. package/console/settings/org-preferences.txt +35 -0
  648. package/console/settings/org-profile/__next._full.txt +35 -0
  649. package/console/settings/org-profile/__next._head.txt +6 -0
  650. package/console/settings/org-profile/__next._index.txt +17 -0
  651. package/console/settings/org-profile/__next._tree.txt +5 -0
  652. package/console/settings/org-profile/__next.settings.org-profile.__PAGE__.txt +6 -0
  653. package/console/settings/org-profile/__next.settings.org-profile.txt +5 -0
  654. package/console/settings/org-profile/__next.settings.txt +6 -0
  655. package/console/settings/org-profile.html +1 -0
  656. package/console/settings/org-profile.txt +35 -0
  657. package/console/settings/platform-clients/__next._full.txt +35 -0
  658. package/console/settings/platform-clients/__next._head.txt +6 -0
  659. package/console/settings/platform-clients/__next._index.txt +17 -0
  660. package/console/settings/platform-clients/__next._tree.txt +5 -0
  661. package/console/settings/platform-clients/__next.settings.platform-clients.__PAGE__.txt +6 -0
  662. package/console/settings/platform-clients/__next.settings.platform-clients.txt +5 -0
  663. package/console/settings/platform-clients/__next.settings.txt +6 -0
  664. package/console/settings/platform-clients.html +1 -0
  665. package/console/settings/platform-clients.txt +35 -0
  666. package/console/settings/pricing-governance/__next._full.txt +38 -0
  667. package/console/settings/pricing-governance/__next._head.txt +6 -0
  668. package/console/settings/pricing-governance/__next._index.txt +17 -0
  669. package/console/settings/pricing-governance/__next._tree.txt +5 -0
  670. package/console/settings/pricing-governance/__next.settings.pricing-governance.__PAGE__.txt +9 -0
  671. package/console/settings/pricing-governance/__next.settings.pricing-governance.txt +5 -0
  672. package/console/settings/pricing-governance/__next.settings.txt +6 -0
  673. package/console/settings/pricing-governance.html +1 -0
  674. package/console/settings/pricing-governance.txt +38 -0
  675. package/console/settings/provider-standing/__next._full.txt +38 -0
  676. package/console/settings/provider-standing/__next._head.txt +6 -0
  677. package/console/settings/provider-standing/__next._index.txt +17 -0
  678. package/console/settings/provider-standing/__next._tree.txt +5 -0
  679. package/console/settings/provider-standing/__next.settings.provider-standing.__PAGE__.txt +9 -0
  680. package/console/settings/provider-standing/__next.settings.provider-standing.txt +5 -0
  681. package/console/settings/provider-standing/__next.settings.txt +6 -0
  682. package/console/settings/provider-standing.html +1 -0
  683. package/console/settings/provider-standing.txt +38 -0
  684. package/console/settings/usage/__next._full.txt +35 -0
  685. package/console/settings/usage/__next._head.txt +6 -0
  686. package/console/settings/usage/__next._index.txt +17 -0
  687. package/console/settings/usage/__next._tree.txt +5 -0
  688. package/console/settings/usage/__next.settings.txt +6 -0
  689. package/console/settings/usage/__next.settings.usage.__PAGE__.txt +6 -0
  690. package/console/settings/usage/__next.settings.usage.txt +5 -0
  691. package/console/settings/usage.html +1 -0
  692. package/console/settings/usage.txt +35 -0
  693. package/console/settings.html +1 -0
  694. package/console/settings.txt +35 -0
  695. package/console/workflows/__next._full.txt +32 -0
  696. package/console/workflows/__next._head.txt +6 -0
  697. package/console/workflows/__next._index.txt +17 -0
  698. package/console/workflows/__next._tree.txt +5 -0
  699. package/console/workflows/__next.workflows.__PAGE__.txt +6 -0
  700. package/console/workflows/__next.workflows.txt +5 -0
  701. package/console/workflows/__placeholder__/__placeholder__/__next._full.txt +35 -0
  702. package/console/workflows/__placeholder__/__placeholder__/__next._head.txt +6 -0
  703. package/console/workflows/__placeholder__/__placeholder__/__next._index.txt +17 -0
  704. package/console/workflows/__placeholder__/__placeholder__/__next._tree.txt +5 -0
  705. package/console/workflows/__placeholder__/__placeholder__/__next.workflows.$d$org.$d$slug.__PAGE__.txt +6 -0
  706. package/console/workflows/__placeholder__/__placeholder__/__next.workflows.$d$org.$d$slug.txt +5 -0
  707. package/console/workflows/__placeholder__/__placeholder__/__next.workflows.$d$org.txt +5 -0
  708. package/console/workflows/__placeholder__/__placeholder__/__next.workflows.txt +5 -0
  709. package/console/workflows/__placeholder__/__placeholder__.html +1 -0
  710. package/console/workflows/__placeholder__/__placeholder__.txt +35 -0
  711. package/console/workflows/executions/__next._full.txt +33 -0
  712. package/console/workflows/executions/__next._head.txt +6 -0
  713. package/console/workflows/executions/__next._index.txt +17 -0
  714. package/console/workflows/executions/__next._tree.txt +5 -0
  715. package/console/workflows/executions/__next.workflows.executions.__PAGE__.txt +6 -0
  716. package/console/workflows/executions/__next.workflows.executions.txt +5 -0
  717. package/console/workflows/executions/__next.workflows.txt +5 -0
  718. package/console/workflows/executions/__placeholder__/__next._full.txt +34 -0
  719. package/console/workflows/executions/__placeholder__/__next._head.txt +6 -0
  720. package/console/workflows/executions/__placeholder__/__next._index.txt +17 -0
  721. package/console/workflows/executions/__placeholder__/__next._tree.txt +5 -0
  722. package/console/workflows/executions/__placeholder__/__next.workflows.executions.$d$id.__PAGE__.txt +6 -0
  723. package/console/workflows/executions/__placeholder__/__next.workflows.executions.$d$id.txt +5 -0
  724. package/console/workflows/executions/__placeholder__/__next.workflows.executions.txt +5 -0
  725. package/console/workflows/executions/__placeholder__/__next.workflows.txt +5 -0
  726. package/console/workflows/executions/__placeholder__.html +1 -0
  727. package/console/workflows/executions/__placeholder__.txt +34 -0
  728. package/console/workflows/executions.html +1 -0
  729. package/console/workflows/executions.txt +33 -0
  730. package/console/workflows.html +1 -0
  731. package/console/workflows.txt +32 -0
  732. package/main.js +1138 -0
  733. package/mappings.wasm +0 -0
  734. package/package.json +25 -0
  735. package/workflow-bundle-agent-execution.js +31729 -0
  736. package/workflow-bundle-schedule.js +11315 -0
  737. package/workflow-bundle-workflow-execution.js +29297 -0
  738. package/workflow-worker-thread.cjs +111 -0
@@ -0,0 +1,3 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,67407,800692,282155,671010,e=>{"use strict";var t=e.i(271645),s=e.i(768079);function r(){let e=(0,t.useContext)(s.AuthContext);if(!e)throw Error("useAuth must be used within <AuthProvider>");return e}e.s(["useAuth",0,r],800692);var n=e.i(843476),i=e.i(531278),a=e.i(35127);let o=()=>{};function l({children:e}){let r=(0,t.useMemo)(()=>({isAuthenticated:!0,isLoading:!1,user:null,accessToken:null,login:o,logout:o}),[]);return(0,n.jsx)(s.AuthContext.Provider,{value:r,children:e})}let g=(0,t.lazy)(()=>e.A(781195));function c(){return(0,n.jsx)("div",{className:"flex min-h-screen flex-col items-center justify-center gap-3",children:(0,n.jsx)(i.Loader2,{className:"text-muted-foreground size-8 animate-spin"})})}e.s(["AuthProvider",0,function({children:e}){let s=(0,t.useMemo)(()=>(0,a.resolveAuthConfig)(),[]);switch(s.mode){case"disabled":return(0,n.jsx)(l,{children:e});case"oidc":return(0,n.jsx)(t.Suspense,{fallback:(0,n.jsx)(c,{}),children:(0,n.jsx)(g,{config:s.oidc,children:e})})}}],282155),e.s(["AuthGuard",0,function({children:e}){let{isAuthenticated:s,isLoading:a,login:o}=r();return((0,t.useEffect)(()=>{a||s||o()},[a,s,o]),a||!s)?(0,n.jsxs)("div",{className:"flex min-h-screen flex-col items-center justify-center gap-3",children:[(0,n.jsx)(i.Loader2,{className:"text-muted-foreground size-8 animate-spin"}),(0,n.jsx)("p",{className:"text-muted-foreground text-sm",children:"Loading..."})]}):(0,n.jsx)(n.Fragment,{children:e})}],671010),e.s([],67407)},275051,776526,850429,603115,227989,262045,337249,524067,644389,352082,440160,766895,e=>{"use strict";var t=e.i(843476),s=e.i(271645),r=e.i(893976),n=e.i(610595),i=e.i(973621),a=e.i(188482),o=e.i(506213),l=e.i(364354);function g({icon:e,label:s,count:n,children:i,disabled:c,open:u,onOpenChange:d}){let m=(0,l.useStigmerPortalContainer)();return(0,t.jsxs)(o.Popover.Root,{open:u,onOpenChange:d,children:[(0,t.jsxs)(a.Tooltip,{children:[(0,t.jsx)(a.TooltipTrigger,{render:(0,t.jsx)("span",{className:"stg:inline-flex"}),children:(0,t.jsx)(o.Popover.Trigger,{disabled:c,"aria-label":s,className:(0,r.cn)("stg:inline-flex stg:h-8 stg:w-8 stg:items-center stg:justify-center stg:rounded-md stg:text-xs stg:transition-colors","stg:text-muted-foreground stg:hover:text-foreground stg:hover:bg-accent-hover","stg:disabled:pointer-events-none stg:disabled:opacity-50"),children:(0,t.jsxs)("span",{className:"stg:relative",children:[e,n>0&&(0,t.jsx)("span",{className:"stg:absolute stg:-right-1.5 stg:-top-1.5 stg:flex stg:h-3.5 stg:min-w-3.5 stg:items-center stg:justify-center stg:rounded-full stg:bg-primary stg:px-0.5 stg:text-[0.5rem] stg:font-medium stg:leading-none stg:text-primary-foreground",children:n})]})})}),(0,t.jsx)(a.TooltipContent,{side:"top",children:s})]}),(0,t.jsx)(o.Popover.Portal,{container:m,children:(0,t.jsx)(o.Popover.Positioner,{sideOffset:8,align:"start",children:(0,t.jsx)(o.Popover.Popup,{className:"stg:z-popover stg:overflow-x-hidden stg:overflow-y-auto stg:rounded-lg stg:border stg:border-border stg:bg-popover stg:p-3 stg:shadow-md stg:text-popover-foreground stg:max-h-[80vh]",children:i})})})]})}function c(){return(0,t.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",className:"stg:shrink-0 stg:animate-spin stg:text-muted-foreground","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M8 2a6 6 0 1 0 6 6"})})}function u(){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","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M8 1.5 1.5 13.5h13L8 1.5z"}),(0,t.jsx)("path",{d:"M8 6v3"}),(0,t.jsx)("circle",{cx:"8",cy:"11",r:"0.5",fill:"currentColor",stroke:"none"})]})}function d(){return(0,t.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M8 12V4M4 7l4-4 4 4"})})}function m(){return(0,t.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:(0,t.jsx)("rect",{x:"3",y:"3",width:"10",height:"10",rx:"2.5"})})}function h(){return(0,t.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M4 4L10 10M10 4L4 10"})})}function p(){return(0,t.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M12.5 7L7 12.5a3.536 3.536 0 0 1-5-5L7.5 2a2.357 2.357 0 0 1 3.333 3.333L5.5 10.667a1.179 1.179 0 0 1-1.667-1.667L9 3.833"})})}function f(){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","aria-hidden":"true",children:[(0,t.jsx)("rect",{x:"3",y:"5",width:"10",height:"8",rx:"2"}),(0,t.jsx)("circle",{cx:"6",cy:"9",r:"1",fill:"currentColor",stroke:"none"}),(0,t.jsx)("circle",{cx:"10",cy:"9",r:"1",fill:"currentColor",stroke:"none"}),(0,t.jsx)("path",{d:"M8 1v4"}),(0,t.jsx)("circle",{cx:"8",cy:"1",r:"1"})]})}function x(){return(0,t.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M1.5 3.5V11a1 1 0 001 1h9a1 1 0 001-1V5.5a1 1 0 00-1-1H7L5.5 3H2.5a1 1 0 00-1 .5z"})})}function v(){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","aria-hidden":"true",children:[(0,t.jsx)("rect",{x:"2",y:"2",width:"12",height:"4",rx:"1"}),(0,t.jsx)("rect",{x:"2",y:"10",width:"12",height:"4",rx:"1"}),(0,t.jsx)("circle",{cx:"5",cy:"4",r:"0.75",fill:"currentColor",stroke:"none"}),(0,t.jsx)("circle",{cx:"5",cy:"12",r:"0.75",fill:"currentColor",stroke:"none"})]})}function b(){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","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M2 3h12M2 7h8M2 11h10M2 15h6"})})}function j(){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","aria-hidden":"true",children:[(0,t.jsx)("rect",{x:"3",y:"8",width:"10",height:"6",rx:"1.5"}),(0,t.jsx)("path",{d:"M5 8V5.5a3 3 0 0 1 6 0V8"}),(0,t.jsx)("circle",{cx:"8",cy:"11.5",r:"1",fill:"currentColor",stroke:"none"})]})}function y(){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","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M2 4h4m4 0h4M2 8h8m4 0h0M2 12h2m4 0h6"}),(0,t.jsx)("circle",{cx:"8",cy:"4",r:"2"}),(0,t.jsx)("circle",{cx:"12",cy:"8",r:"2"}),(0,t.jsx)("circle",{cx:"6",cy:"12",r:"2"})]})}function k(){return(0,t.jsxs)("div",{className:"stg:flex stg:flex-col stg:items-center stg:gap-1.5",children:[(0,t.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",className:"stg:animate-spin stg:text-muted-foreground","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M8 2a6 6 0 1 0 6 6"})}),(0,t.jsx)("span",{className:"stg:text-[0.6rem] stg:text-muted-foreground",children:"Checking agent requirements..."})]})}function w({open:e,onOpenChange:s,activePanel:n,onActivePanelChange:i,items:g,renderPanel:c,disabled:u}){let d=g.reduce((e,t)=>e+t.count,0),m=g.some(e=>e.hasWarning),h=(0,l.useStigmerPortalContainer)();if(0===g.length)return null;let p=n?g.find(e=>e.id===n):null;return(0,t.jsxs)(o.Popover.Root,{open:e,onOpenChange:e=>{s(e),e||i(null)},children:[(0,t.jsxs)(a.Tooltip,{children:[(0,t.jsx)(a.TooltipTrigger,{render:(0,t.jsx)("span",{className:"stg:inline-flex"}),children:(0,t.jsx)(o.Popover.Trigger,{disabled:u,className:(0,r.cn)("stg:inline-flex stg:h-8 stg:w-8 stg:items-center stg:justify-center stg:rounded-md stg:text-xs stg:transition-colors","stg:text-muted-foreground stg:hover:text-foreground stg:hover:bg-accent-hover","stg:disabled:pointer-events-none stg:disabled:opacity-50"),"aria-label":"Configure agent, tools, and skills",children:(0,t.jsxs)("span",{className:"stg:relative",children:[(0,t.jsx)(y,{}),d>0&&(0,t.jsx)("span",{className:"stg:absolute stg:-right-1.5 stg:-top-1.5 stg:flex stg:h-3.5 stg:min-w-3.5 stg:items-center stg:justify-center stg:rounded-full stg:bg-primary stg:px-0.5 stg:text-[0.5rem] stg:font-medium stg:leading-none stg:text-primary-foreground",children:d}),m&&0===d&&(0,t.jsx)("span",{className:"stg:absolute stg:-right-0.5 stg:-top-0.5 stg:inline-block stg:h-2 stg:w-2 stg:rounded-full stg:bg-warning","aria-label":"Configuration needed"})]})})}),(0,t.jsx)(a.TooltipContent,{side:"top",children:"Configure"})]}),(0,t.jsx)(o.Popover.Portal,{container:h,children:(0,t.jsx)(o.Popover.Positioner,{sideOffset:8,align:"start",children:(0,t.jsx)(o.Popover.Popup,{className:(0,r.cn)("stg:z-popover stg:overflow-x-hidden stg:overflow-y-auto stg:rounded-lg stg:border stg:border-border","stg:bg-popover stg:shadow-md stg:text-popover-foreground","stg:max-h-[80vh]"),children:p?(0,t.jsx)(N,{item:p,onBack:()=>i(null),children:c(n)}):(0,t.jsx)(S,{items:g,onSelect:i})})})})]})}function S({items:e,onSelect:s}){return(0,t.jsx)("div",{className:"stg:py-1",role:"menu",children:e.map(e=>(0,t.jsxs)("button",{type:"button",role:"menuitem",onClick:()=>s(e.id),className:(0,r.cn)("stg:flex stg:w-full stg:items-center stg:gap-2.5 stg:px-3 stg:py-2 stg:text-sm stg:transition-colors","stg:text-foreground stg:hover:bg-accent-hover"),children:[(0,t.jsx)("span",{className:"stg:shrink-0 stg:text-muted-foreground",children:e.icon}),(0,t.jsx)("span",{className:"stg:flex-1 stg:text-left",children:e.label}),e.hasWarning&&(0,t.jsx)("span",{className:"stg:inline-block stg:h-1.5 stg:w-1.5 stg:shrink-0 stg:rounded-full stg:bg-warning","aria-label":"Needs configuration"}),e.count>0&&(0,t.jsx)("span",{className:"stg:rounded-full stg:bg-primary-subtle stg:px-1.5 stg:text-[0.6rem] stg:font-medium stg:text-primary",children:e.count}),(0,t.jsx)(C,{})]},e.id))})}function N({item:e,onBack:s,children:r}){return(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-2 stg:border-b stg:border-border-muted stg:px-3 stg:py-2",children:[(0,t.jsx)("button",{type:"button",onClick:s,className:"stg:shrink-0 stg:rounded stg:p-0.5 stg:text-muted-foreground stg:transition-colors stg:hover:bg-accent-hover stg:hover:text-foreground","aria-label":"Back to configuration menu",children:(0,t.jsx)(E,{})}),(0,t.jsx)("span",{className:"stg:shrink-0 stg:text-muted-foreground",children:e.icon}),(0,t.jsx)("span",{className:"stg:text-sm stg:font-medium stg:text-foreground",children:e.label})]}),(0,t.jsx)("div",{className:"stg:p-3",children:r})]})}function C(){return(0,t.jsx)("svg",{width:"12",height:"12",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:"M6 4l4 4-4 4"})})}function 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","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M10 4l-4 4 4 4"})})}var R=e.i(216386),A=e.i(287237);let T=["native","cursor"];function M({value:e,onValueChange:r,className:n,disabled:i}){let a=(0,s.useRef)(null),o=(0,s.useCallback)(t=>{let s;if(i)return;let n=T.indexOf(e);if("ArrowRight"===t.key||"ArrowDown"===t.key?s=(n+1)%T.length:("ArrowLeft"===t.key||"ArrowUp"===t.key)&&(s=(n-1+T.length)%T.length),void 0!==s){t.preventDefault(),r(T[s]);let e=a.current?.querySelectorAll("[role=radio]");e?.[s]?.focus()}},[e,r,i]);return(0,t.jsx)("div",{ref:a,role:"radiogroup","aria-label":"Execution engine",onKeyDown:o,className:["stg:inline-flex stg:items-center stg:rounded-md stg:border stg:border-border stg:bg-background stg:p-0.5",i?"stg:pointer-events-none stg:opacity-50":void 0,n].filter(Boolean).join(" "),children:T.map(s=>{let n=e===s;return(0,t.jsxs)("button",{type:"button",role:"radio","aria-checked":n,"aria-label":A.HARNESS_LABELS[s],tabIndex:n?0:-1,disabled:i,onClick:()=>{n||r(s)},className:["stg:inline-flex stg:items-center stg:gap-1 stg:rounded-[5px] stg:px-2 stg:py-1 stg:text-xs stg:transition-colors stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring stg:disabled:pointer-events-none",n?"stg:bg-accent stg:font-medium stg:text-foreground stg:shadow-sm":"stg:text-muted-foreground stg:hover:text-foreground"].join(" "),children:[A.HARNESS_LABELS[s],"cursor"===s&&(0,t.jsx)("span",{"aria-label":"premium",className:"stg:text-[0.6rem] stg:text-muted-foreground",children:"$$$"})]},s)})})}let L=["agent","plan"],I={agent:{label:"Agent",description:"Full tool access — read, write, and execute"},plan:{label:"Plan",description:"Read-only analysis — search and reason only"}};function P({value:e,onValueChange:n,className:i,disabled:a}){let g=(0,l.useStigmerPortalContainer)(),[c,u]=(0,s.useState)(!1),d=(0,s.useCallback)(e=>{n(e),u(!1)},[n]),m=(0,s.useCallback)(t=>{let s,r=L.indexOf(e);switch(t.key){case"ArrowDown":t.preventDefault(),s=r<L.length-1?r+1:0;break;case"ArrowUp":t.preventDefault(),s=r>0?r-1:L.length-1;break;case"Escape":t.preventDefault(),u(!1);return}void 0!==s&&d(L[s])},[e,d]);return(0,t.jsxs)(o.Popover.Root,{open:c,onOpenChange:u,children:[(0,t.jsxs)(o.Popover.Trigger,{disabled:a,className:(0,r.cn)("stg:inline-flex stg:items-center stg:gap-1 stg:rounded-md stg:px-2 stg:py-1.5 stg:text-xs stg:transition-colors","stg:text-muted-foreground stg:hover:text-foreground stg:hover:bg-accent-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",i),children:[(0,t.jsx)("span",{className:"stg:font-medium stg:text-foreground",children:I[e].label}),(0,t.jsx)(D,{})]}),(0,t.jsx)(o.Popover.Portal,{container:g,children:(0,t.jsx)(o.Popover.Positioner,{sideOffset:4,children:(0,t.jsx)(o.Popover.Popup,{role:"listbox","aria-label":"Interaction mode",onKeyDown:m,className:(0,r.cn)("stg:z-50 stg:w-56 stg:rounded-lg stg:border stg:border-border stg:bg-popover stg:p-1 stg:shadow-md","stg:animate-in stg:fade-in-0 stg:zoom-in-95"),children:L.map(s=>{let n=I[s],i=e===s;return(0,t.jsxs)("button",{type:"button",role:"option","aria-selected":i,onClick:()=>d(s),className:(0,r.cn)("stg:flex stg:w-full stg:flex-col stg:gap-0.5 stg:rounded-md stg:px-2.5 stg:py-2 stg:text-left stg:transition-colors","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring",i?"stg:bg-accent stg:text-foreground":"stg:text-foreground stg:hover:bg-accent-hover"),children:[(0,t.jsx)("span",{className:"stg:text-xs stg:font-medium",children:n.label}),(0,t.jsx)("span",{className:"stg:text-[0.65rem] stg:leading-snug stg:text-muted-foreground",children:n.description})]},s)})})})})]})}function D(){return(0,t.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",className:"stg:shrink-0 stg:text-muted-foreground","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M3 4.5L6 7.5L9 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}var F=e.i(379410);function O({disabled:e,isSubmitting:s,canSend:n,onSend:i,onStop:o,isStopping:l=!1,showAttach:c,attachmentCount:u,onAttachClick:h,showWorkspace:f,workspaceCount:v,workspaceContent:b,onWorkspaceDirectAction:j,configureItems:y,configOpen:k,onConfigOpenChange:S,configActivePanel:N,onConfigActivePanelChange:C,renderConfigPanel:E,showHarnessSelector:A,harness:T,onHarnessChange:L,showInteractionModePicker:I,interactionMode:D,onInteractionModeChange:B,showModelSelector:$,modelId:V,onModelChange:_,serviceTier:U,onServiceTierChange:W,thinkingMode:z,onThinkingModeChange:K}){return(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:justify-between stg:gap-2 stg:border-t stg:border-border-muted stg:px-3 stg:py-2",children:[(0,t.jsxs)("div",{className:"stg:flex stg:min-w-0 stg:items-center stg:gap-1.5",children:[I&&(0,t.jsx)(P,{value:D??"agent",onValueChange:B,disabled:e}),A&&!$&&(0,t.jsx)(M,{value:T??"native",onValueChange:L,disabled:e}),$&&(0,t.jsx)(R.ModelSelector,{value:V,onValueChange:_,harness:A?void 0:T,initialHarness:A?T:void 0,onHarnessChange:A?L:void 0,serviceTier:U,onServiceTierChange:W,thinkingMode:z,onThinkingModeChange:K,disabled:e})]}),(0,t.jsx)(a.TooltipProvider,{children:(0,t.jsxs)("div",{className:"stg:flex stg:shrink-0 stg:items-center stg:gap-1",children:[f&&(j?(0,t.jsxs)(a.Tooltip,{children:[(0,t.jsx)(a.TooltipTrigger,{render:(0,t.jsx)("span",{className:"stg:inline-flex"}),children:(0,t.jsx)("button",{type:"button",disabled:e,onClick:j,className:(0,r.cn)("stg:inline-flex stg:h-8 stg:w-8 stg:items-center stg:justify-center stg:rounded-md stg:text-xs stg:transition-colors","stg:text-muted-foreground stg:hover:text-foreground stg:hover:bg-accent-hover","stg:disabled:pointer-events-none stg:disabled:opacity-50"),"aria-label":"Workspace",children:(0,t.jsxs)("span",{className:"stg:relative",children:[(0,t.jsx)(x,{}),v>0&&(0,t.jsx)("span",{className:"stg:absolute stg:-right-1.5 stg:-top-1.5 stg:flex stg:h-3.5 stg:min-w-3.5 stg:items-center stg:justify-center stg:rounded-full stg:bg-primary stg:px-0.5 stg:text-[0.5rem] stg:font-medium stg:leading-none stg:text-primary-foreground",children:v})]})})}),(0,t.jsx)(a.TooltipContent,{side:"top",children:"Workspace"})]}):(0,t.jsx)(g,{icon:(0,t.jsx)(x,{}),label:"Workspace",count:v,disabled:e,children:b})),c&&(0,t.jsxs)(a.Tooltip,{children:[(0,t.jsx)(a.TooltipTrigger,{render:(0,t.jsx)("span",{className:"stg:inline-flex"}),children:(0,t.jsx)("button",{type:"button",disabled:e,onClick:h,className:(0,r.cn)("stg:inline-flex stg:h-8 stg:w-8 stg:items-center stg:justify-center stg:rounded-md stg:text-xs stg:transition-colors","stg:text-muted-foreground stg:hover:text-foreground stg:hover:bg-accent-hover","stg:disabled:pointer-events-none stg:disabled:opacity-50"),"aria-label":"Attach files",children:(0,t.jsxs)("span",{className:"stg:relative",children:[(0,t.jsx)(p,{}),u>0&&(0,t.jsx)("span",{className:"stg:absolute stg:-right-1.5 stg:-top-1.5 stg:flex stg:h-3.5 stg:min-w-3.5 stg:items-center stg:justify-center stg:rounded-full stg:bg-primary stg:px-0.5 stg:text-[0.5rem] stg:font-medium stg:leading-none stg:text-primary-foreground",children:u})]})})}),(0,t.jsx)(a.TooltipContent,{side:"top",children:"Attach files"})]}),(0,t.jsx)(w,{open:k,onOpenChange:S,activePanel:N,onActivePanelChange:C,items:y,renderPanel:E,disabled:e}),o?(0,t.jsxs)(a.Tooltip,{children:[(0,t.jsx)(a.TooltipTrigger,{render:(0,t.jsx)("button",{type:"button",onClick:o,className:"stg:flex stg:h-8 stg:w-8 stg:shrink-0 stg:items-center stg:justify-center stg:rounded-full stg:bg-primary stg:text-primary-foreground stg:transition-colors stg:hover:bg-primary-hover","aria-label":"Stop generating"}),children:l?(0,t.jsx)(F.SpinnerIcon,{}):(0,t.jsx)(m,{})}),(0,t.jsx)(a.TooltipContent,{side:"top",children:"Stop"})]}):(0,t.jsx)("button",{type:"button",disabled:!n,onClick:i,className:"stg:flex stg:h-8 stg:w-8 stg:shrink-0 stg:items-center stg:justify-center stg:rounded-lg stg:bg-primary stg:text-primary-foreground stg:transition-colors stg:hover:bg-primary-hover stg:disabled:pointer-events-none stg:disabled:opacity-40","aria-label":"Send message",children:s?(0,t.jsx)(F.SpinnerIcon,{}):(0,t.jsx)(d,{})})]})})]})}var B=e.i(444857),$=e.i(614920),V=e.i(557702),_=e.i(711364);let U=new Set(["image/png","image/jpeg","image/webp","image/gif"]),W={warnings:[],modelCannotSeeImages:!1};var z=e.i(356965),K=e.i(954884),H=e.i(351240);function q({agentName:e,...s}){return(0,t.jsx)(H.EnvVarForm,{title:e,description:"Enter required credentials to use this agent.",ariaLabel:`Configure ${e}`,...s})}var Y=e.i(891287),G=e.i(486277),J=e.i(170255),X=e.i(586108),Z=e.i(326283),Q=e.i(207344),ee=e.i(367539),et=e.i(288270);let es={status:"idle",error:null};function er(e,t){switch(t.type){case"RESOLVE_START":return{status:"resolving",agentRef:t.agentRef,error:null};case"RESOLVE_NEEDS_ENV":return{status:"needsEnvVars",agentRef:t.agentRef,agentId:t.agentId,agentName:t.agentName,missingVariables:t.missingVariables,error:null};case"RESOLVE_READY":case"SUBMIT_READY":return{status:"ready",agentRef:t.agentRef,agentName:t.agentName,resolution:t.resolution,error:null};case"POOL_RESOLVE":if("needsEnvVars"!==e.status)return e;if(0===t.missingVariables.length)return{status:"ready",agentRef:e.agentRef,agentName:e.agentName,resolution:{mode:"direct"},error:null};return{...e,missingVariables:t.missingVariables};case"SUBMIT_START":if("needsEnvVars"!==e.status)return e;return{status:"submitting",agentRef:e.agentRef,agentId:e.agentId,agentName:e.agentName,missingVariables:e.missingVariables,error:null};case"ERROR":if("submitting"===e.status)return{status:"needsEnvVars",agentRef:e.agentRef,agentId:e.agentId,agentName:e.agentName,missingVariables:e.missingVariables,error:t.error};return{...e,error:t.error};case"CLEAR_ERROR":return{...e,error:null};case"RESET":return es;default:return e}}let en="stigmer.ai/personal",ei="stigmer.ai/for-agent";async function ea(e,t){let{org:s,agentId:r,agentSlug:n,agentLabel:i,environmentRef:a}=t,o=await e.agentInstance.list((0,Y.create)(G.ListAgentInstancesRequestSchema,{org:s,labels:{[en]:"true",[ei]:i}}));return o.items.length>0?o.items[0]:e.agentInstance.create(function(e){let{org:t,agentId:s,agentSlug:r,environmentRef:n}=e;return{name:`${r} Personal`,slug:`${r}-personal-${(0,ee.generateSlugSuffix)()}`,org:t,agentId:s,labels:{"stigmer.ai/personal":"true","stigmer.ai/for-agent":`${t}/${r}`},environmentRefs:[n]}}({org:s,agentId:r,agentSlug:n,environmentRef:a}))}var eo=e.i(910304),el=e.i(869803);let eg=/MCP server '([^']+)' requires environment variable '([^']+)'/g;function ec(e){let t,s=[];for(;null!==(t=eg.exec(e));)s.push({serverName:t[1],variableName:t[2]});return eg.lastIndex=0,s}function eu(e){return e instanceof eo.StigmerError&&"failed-precondition"===e.code}function ed({error:e,className:n}){let i=(0,s.useMemo)(()=>{if(!e||!eu(e))return null;let t=ec(e.message);return 0===t.length?null:t},[e]);if(!i)return null;let a=(0,s.useMemo)(()=>{let e=new Map;for(let{serverName:t,variableName:s}of i){let r=e.get(t)??[];r.push(s),e.set(t,r)}return e},[i]);return(0,t.jsx)("div",{role:"alert",className:(0,r.cn)("stg:rounded-lg stg:border stg:border-amber-500/30 stg:bg-amber-500/5 stg:p-4",n),children:(0,t.jsxs)("div",{className:"stg:flex stg:items-start stg:gap-3",children:[(0,t.jsx)(eh,{className:"stg:mt-0.5 stg:size-4 stg:shrink-0 stg:text-amber-600 stg:dark:text-amber-400"}),(0,t.jsxs)("div",{className:"stg:min-w-0 stg:flex-1 stg:space-y-2",children:[(0,t.jsx)("p",{className:"stg:text-sm stg:font-medium stg:text-amber-800 stg:dark:text-amber-200",children:"Missing environment variables"}),(0,t.jsx)("div",{className:"stg:space-y-1.5",children:Array.from(a).map(([e,s])=>(0,t.jsxs)("div",{children:[(0,t.jsxs)("p",{className:"stg:text-xs stg:text-amber-700 stg:dark:text-amber-300",children:[(0,t.jsx)("span",{className:"stg:font-medium",children:e})," requires:"]}),(0,t.jsx)("ul",{className:(0,r.cn)(el.UNSTYLED_LIST,"stg:mt-0.5 stg:space-y-0.5"),children:s.map(e=>(0,t.jsx)("li",{className:"stg:text-xs stg:font-mono stg:text-amber-800/80 stg:dark:text-amber-200/80 stg:pl-3",children:e},e))})]},e))}),(0,t.jsxs)("div",{className:"stg:border-t stg:border-amber-500/20 stg:pt-2",children:[(0,t.jsx)("p",{className:"stg:text-xs stg:text-amber-700/90 stg:dark:text-amber-300/90",children:"You can provide these values in two ways:"}),(0,t.jsxs)("ul",{className:(0,r.cn)(el.UNSTYLED_LIST,"stg:mt-1 stg:space-y-0.5 stg:text-xs stg:text-amber-700/80 stg:dark:text-amber-300/80"),children:[(0,t.jsxs)("li",{className:"stg:flex stg:items-start stg:gap-1.5",children:[(0,t.jsx)("span",{className:"stg:mt-px stg:shrink-0",children:"•"}),(0,t.jsxs)("span",{children:["Add them to your"," ",(0,t.jsx)("strong",{className:"stg:font-medium",children:"personal environment"})," ","in Settings for automatic reuse across sessions."]})]}),(0,t.jsxs)("li",{className:"stg:flex stg:items-start stg:gap-1.5",children:[(0,t.jsx)("span",{className:"stg:mt-px stg:shrink-0",children:"•"}),(0,t.jsxs)("span",{children:["Provide them as"," ",(0,t.jsx)("strong",{className:"stg:font-medium",children:"session variables"})," ","when sending a message."]})]})]})]})]})]})})}function em(e){return!!e&&!!eu(e)&&ec(e.message).length>0}function eh({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:e,"aria-hidden":"true",children:[(0,t.jsx)("circle",{cx:"10.5",cy:"5.5",r:"3"}),(0,t.jsx)("path",{d:"M8.5 7.5L3 13l1.5 1.5"}),(0,t.jsx)("path",{d:"M5.5 11l1.5 1.5"})]})}var ep=e.i(348728),ef=e.i(336973);function ex(e){return`${e.org}/${e.slug}`}let ev={};function eb(e,t){switch(t.type){case"ADD_SERVER":return{...e,[t.key]:{status:"loading",error:null}};case"RESOLVE_NEEDS_SETUP":{let s=e[t.key];if(s?.status!=="loading")return e;return{...e,[t.key]:{status:"needsSetup",mcpServer:t.mcpServer,missingVariables:t.missingVariables,discoveredTools:t.discoveredTools,toolApprovals:t.toolApprovals,oauthConnectionHealth:t.oauthConnectionHealth,error:null}}}case"RESOLVE_READY":{let s=e[t.key];if(s?.status!=="loading")return e;return{...e,[t.key]:{status:"ready",mcpServer:t.mcpServer,discoveredTools:t.discoveredTools,toolApprovals:t.toolApprovals,enabledTools:t.enabledTools,oauthConnectionHealth:t.oauthConnectionHealth,error:null}}}case"POOL_RESOLVE":{let s=e[t.key];if(s?.status!=="needsSetup")return e;if(0===t.missingVariables.length)return{...e,[t.key]:{status:"ready",mcpServer:s.mcpServer,discoveredTools:s.discoveredTools,toolApprovals:s.toolApprovals,enabledTools:t.enabledTools,oauthConnectionHealth:s.oauthConnectionHealth,error:null}};return{...e,[t.key]:{...s,missingVariables:t.missingVariables}}}case"SUBMIT_START":{let s=e[t.key];if(s?.status!=="needsSetup")return e;return{...e,[t.key]:{status:"submitting",mcpServer:s.mcpServer,missingVariables:s.missingVariables,discoveredTools:s.discoveredTools,toolApprovals:s.toolApprovals,oauthConnectionHealth:s.oauthConnectionHealth,error:null}}}case"SUBMIT_DONE":{let s=e[t.key];if(s?.status!=="submitting")return e;return{...e,[t.key]:{status:"ready",mcpServer:s.mcpServer,discoveredTools:s.discoveredTools,toolApprovals:s.toolApprovals,enabledTools:t.enabledTools,oauthConnectionHealth:s.oauthConnectionHealth,error:null}}}case"SUBMIT_FAIL":{let s=e[t.key];if(s?.status!=="submitting")return e;return{...e,[t.key]:{status:"needsSetup",mcpServer:s.mcpServer,missingVariables:s.missingVariables,discoveredTools:s.discoveredTools,toolApprovals:s.toolApprovals,oauthConnectionHealth:s.oauthConnectionHealth,error:t.error}}}case"SET_ENABLED_TOOLS":{let s=e[t.key];if(s?.status!=="ready")return e;return{...e,[t.key]:{...s,enabledTools:t.enabledTools}}}case"SET_ERROR":{let s=e[t.key];if(!s)return e;return{...e,[t.key]:{...s,error:t.error}}}case"CLEAR_ERROR":{let s=e[t.key];if(!s)return e;return{...e,[t.key]:{...s,error:null}}}case"REMOVE_SERVER":{if(!(t.key in e))return e;let{[t.key]:s,...r}=e;return r}case"RESET":return ev;default:return e}}function ej(e,t){let s=e.spec?.defaultEnabledTools;return s&&s.length>0?[...s]:t.map(e=>e.name)}var ey=e.i(841358),ek=e.i(230849),ew=e.i(4144);function eS({sessionVariables:e,disabled:n=!1,className:i,requiredByMap:a}){let o=(0,ek.useScrollShadows)(),l=(0,s.useMemo)(()=>{let t=new Set,s=new Set;for(let r of e.entries){let e=r.key.trim();""!==e&&(t.has(e)&&s.add(e),t.add(e))}return s},[e.entries]);return(0,t.jsxs)("div",{className:(0,r.cn)("stg:w-80 stg:space-y-3",i),"aria-label":"Session variables",children:[(0,t.jsxs)("div",{className:"stg:space-y-0.5",children:[(0,t.jsx)("h3",{className:"stg:text-xs stg:font-medium stg:text-foreground",children:"Session variables"}),(0,t.jsx)("p",{className:"stg:text-[0.65rem] stg:text-muted-foreground",children:"Additional environment variables for this session."})]}),e.entries.length>0?(0,t.jsxs)("div",{className:"stg:relative",children:[o.canScrollUp&&(0,t.jsx)(ew.ScrollFade,{position:"top"}),(0,t.jsx)("div",{ref:o.scrollRef,className:"stg:max-h-64 stg:space-y-2.5 stg:overflow-y-auto",children:e.entries.map(s=>{let r=l.has(s.key.trim());return(0,t.jsx)(eN,{id:s.id,entryKey:s.key,value:s.value,isSecret:s.isSecret,saveForFuture:s.saveForFuture,isDuplicate:r,disabled:n,onUpdate:e.updateEntry,onRemove:e.removeEntry,requiredBy:s.key.trim()?a?.[s.key.trim()]:void 0},s.id)})}),o.canScrollDown&&(0,t.jsx)(ew.ScrollFade,{position:"bottom"})]}):(0,t.jsx)("p",{className:"stg:py-2 stg:text-center stg:text-[0.65rem] stg:text-muted-foreground-subtle",children:"No variables added."}),(0,t.jsxs)("button",{type:"button",onClick:e.addEntry,disabled:n,className:(0,r.cn)("stg:inline-flex stg:w-full stg:items-center stg:justify-center stg:gap-1 stg:rounded-md stg:py-1.5 stg:text-xs","stg:border stg:border-dashed stg:border-border stg:text-muted-foreground","stg:hover:border-border stg:hover:bg-accent-hover stg:hover:text-foreground","stg:disabled:pointer-events-none stg:disabled:opacity-50"),children:[(0,t.jsx)(eE,{}),(0,t.jsx)("span",{children:"Add variable"})]})]})}function eN({id:e,entryKey:s,value:n,isSecret:i,saveForFuture:a,isDuplicate:o,disabled:l,onUpdate:g,onRemove:c,requiredBy:u}){let d=`stgm-sv-key-${e}`,m=`stgm-sv-val-${e}`,h=s.trim()||"entry";return(0,t.jsxs)("div",{className:"stg:space-y-1.5",children:[(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-1.5",children:[(0,t.jsx)("input",{id:d,type:"text",value:s,onChange:t=>g(e,{key:t.target.value}),disabled:l,placeholder:"VARIABLE_NAME",autoComplete:"off",spellCheck:!1,"aria-label":"Variable name",className:(0,r.cn)("stg:min-w-0 stg:flex-1 stg:rounded-md stg:border stg:border-input stg:bg-background stg:px-2.5 stg:py-1.5 stg:font-mono stg:text-xs stg:text-foreground","stg:placeholder:text-muted-foreground-faint","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring","stg:disabled:pointer-events-none stg:disabled:opacity-50",o&&"stg:border-warning")}),(0,t.jsx)(eC,{checked:i,disabled:l,onChange:t=>g(e,{isSecret:t})}),(0,t.jsx)("button",{type:"button",onClick:()=>c(e),disabled:l,className:"stg:shrink-0 stg:rounded stg:p-0.5 stg:text-muted-foreground stg:hover:text-destructive stg:disabled:pointer-events-none stg:disabled:opacity-50","aria-label":`Remove ${h}`,children:(0,t.jsx)(eR,{})})]}),(0,t.jsx)("div",{className:"stg:relative",children:(0,t.jsx)("input",{id:m,type:i?"password":"text",value:n,onChange:t=>g(e,{value:t.target.value}),disabled:l,placeholder:i?"••••••••":"value",autoComplete:"off","aria-label":`Variable value${s.trim()?` for ${s.trim()}`:""}`,className:(0,r.cn)("stg:w-full stg:rounded-md stg:border stg:border-input stg:bg-background stg:px-2.5 stg:py-1.5 stg:text-xs stg:text-foreground","stg:placeholder:text-muted-foreground-faint","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring","stg:disabled:pointer-events-none stg:disabled:opacity-50")})}),(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-1.5",children:[(0,t.jsx)("button",{type:"button",role:"switch","aria-checked":a,"aria-label":a?"Saved for future runs":"Used once only",disabled:l,onClick:()=>g(e,{saveForFuture:!a}),className:(0,r.cn)("stg:relative stg:inline-flex stg:h-3.5 stg:w-6 stg:shrink-0 stg:cursor-pointer stg:rounded-full stg:transition-colors","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring stg:focus-visible:ring-offset-1","stg:disabled:pointer-events-none stg:disabled:opacity-50",a?"stg:bg-primary":"stg:bg-input"),children:(0,t.jsx)("span",{className:(0,r.cn)("stg:pointer-events-none stg:block stg:h-2.5 stg:w-2.5 stg:translate-y-0.5 stg:rounded-full stg:bg-background stg:shadow-sm stg:ring-0 stg:transition-transform",a?"stg:translate-x-3":"stg:translate-x-0.5")})}),(0,t.jsx)("span",{className:"stg:text-[0.6rem] stg:text-muted-foreground",children:a?"Save for future runs":"This run only"})]}),u&&u.length>0&&(0,t.jsxs)("p",{className:"stg:text-[0.55rem] stg:text-primary-muted",children:["Used by: ",u.join(", ")]}),o&&(0,t.jsx)("p",{className:"stg:text-[0.6rem] stg:text-warning",role:"alert",children:"Duplicate key — last value wins."})]})}function eC({checked:e,disabled:s,onChange:n}){return(0,t.jsxs)("button",{type:"button",role:"switch","aria-checked":e,"aria-label":e?"Marked as secret":"Not marked as secret",disabled:s,onClick:()=>n(!e),className:(0,r.cn)("stg:inline-flex stg:shrink-0 stg:items-center stg:gap-0.5 stg:rounded-md stg:px-1.5 stg:py-1 stg:text-[0.55rem] stg:font-medium stg:uppercase stg:tracking-wider stg:transition-colors","stg:disabled:pointer-events-none stg:disabled:opacity-50",e?"stg:bg-primary-subtle stg:text-primary":"stg:bg-muted-subtle stg:text-muted-foreground stg:hover:bg-muted"),children:[(0,t.jsx)(eA,{}),(0,t.jsx)("span",{children:e?"secret":"plain"})]})}function eE(){return(0,t.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M8 3v10M3 8h10"})})}function eR(){return(0,t.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M4 4L10 10M10 4L4 10"})})}function eA(){return(0,t.jsxs)("svg",{width:"8",height:"8",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,t.jsx)("rect",{x:"3",y:"8",width:"10",height:"7",rx:"1.5"}),(0,t.jsx)("path",{d:"M5 8V5a3 3 0 0 1 6 0v3"})]})}var eT=e.i(261024);function eM(e,t){return e*t>115e4||Math.max(e,t)>1568}let eL=new Set(["image/png","image/jpeg"]);function eI(e,t,s){return new Promise(r=>{try{e.toBlob(r,t,s)}catch{r(null)}})}async function eP(e){let t,s=e.type.toLowerCase();if(!s.startsWith("image/")||"function"!=typeof createImageBitmap||"u"<typeof document)return e;try{t=await createImageBitmap(e,{imageOrientation:"from-image"})}catch{return e}try{var r;let n,i,a,o,l=eM(t.width,t.height),g="image/gif"===s;if(!l&&(eL.has(s)||g))return e;let c=l?function(e,t){if(!Number.isFinite(e)||!Number.isFinite(t)||e<=0||t<=0||!eM(e,t))return{width:e,height:t};let s=e/t,r=Math.sqrt(115e4/s),n=r*s;return Math.max(n,r)>1568&&(n>=r?r=(n=1568)/s:n=(r=1568)*s),{width:Math.max(1,Math.floor(Math.min(n,e))),height:Math.max(1,Math.floor(Math.min(r,t)))}}(t.width,t.height):{width:t.width,height:t.height},u=document.createElement("canvas");u.width=c.width,u.height=c.height;let d=u.getContext("2d");if(!d)return e;if(d.drawImage(t,0,0,c.width,c.height),"image/jpeg"===s)i="image/jpeg",n=await eI(u,i,.9);else{let e=await eI(u,"image/png"),t=e?e.size/(c.width*c.height):1/0;if(e&&t<=1)i="image/png",n=e;else{d.globalCompositeOperation="destination-over",d.fillStyle="#ffffff",d.fillRect(0,0,c.width,c.height);let t=await eI(u,"image/jpeg",.9);n=t??e,i=t?"image/jpeg":"image/png"}}if(!n||i===s&&n.size>=e.size)return e;let m="image/jpeg"===i?"jpg":"png",h=i===s?e.name:(r=e.name,o=(a=r.lastIndexOf("."))>0?r.slice(0,a):r,`${o}.${m}`);return new File([n],h,{type:i,lastModified:e.lastModified})}finally{t.close()}}let eD=0;function eF(){return`attachment-${++eD}-${Date.now()}`}function eO(e){let[t,r]=(0,s.useState)(null);return(0,s.useEffect)(()=>{let t=URL.createObjectURL(e);return r(t),()=>URL.revokeObjectURL(t)},[e]),t}var eB=e.i(255928),e$=e.i(933221);function eV({entries:e,onRemove:n,onRetry:i,onPreview:a,disabled:o,className:l}){let[g,c]=(0,s.useState)(null),u=null!==g?e.find(e=>e.id===g)??null:null;return 0===e.length?null:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:(0,r.cn)("stg:flex stg:flex-wrap stg:items-center stg:gap-1.5",l),role:"list","aria-label":"Attached files",children:e.map(e=>(0,t.jsx)(e_,{entry:e,onRemove:()=>n(e.id),onRetry:()=>i(e.id),onPreview:a?()=>a(e):()=>c(e.id),disabled:o},e.id))}),u&&(0,t.jsx)(eY,{entry:u,onClose:()=>c(null)})]})}function e_({entry:e,onRemove:s,onRetry:r,onPreview:n,disabled:i}){return e.contentType.startsWith("image/")?(0,t.jsx)(ez,{entry:e,onRemove:s,onRetry:r,onPreview:n,disabled:i}):(0,t.jsx)(eK,{entry:e,onRemove:s,onRetry:r,disabled:i})}function eU(e){let t="preparing"===e.phase,s="uploading"===e.phase,r="error"===e.phase;return`${e.file.name}, ${(0,_.formatFileSize)(e.file.size)}${t?", preparing":""}${s?", uploading":""}${r?", upload failed":""}`}function eW(e){return"preparing"===e.phase||"uploading"===e.phase}function ez({entry:e,onRemove:n,onRetry:i,onPreview:o,disabled:l}){let g=eO(e.file),[c,u]=(0,s.useState)(!1);if(c)return(0,t.jsx)(eK,{entry:e,onRemove:n,onRetry:i,disabled:l});let d="error"===e.phase,m=eW(e);return(0,t.jsxs)(a.Tooltip,{children:[(0,t.jsxs)(a.TooltipTrigger,{render:(0,t.jsx)("span",{role:"listitem","aria-label":eU(e),className:"stg:relative stg:inline-flex"}),children:[(0,t.jsxs)("button",{type:"button",onClick:o,"aria-label":`Preview ${e.file.name}`,className:(0,r.cn)(e$.UNSTYLED_BUTTON,"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",d&&"stg:ring-1 stg:ring-destructive"),children:[g?(0,t.jsx)("img",{src:g,alt:"","aria-hidden":"true",onError:()=>u(!0),className:(0,r.cn)("stg:h-full stg:w-full stg:object-cover",(m||d)&&"stg:opacity-50")}):(0,t.jsx)("span",{className:"stg:block stg:h-full stg:w-full stg:animate-pulse stg:bg-muted","aria-hidden":"true"}),m&&(0,t.jsx)("span",{className:"stg:absolute stg:inset-0 stg:flex stg:items-center stg:justify-center",children:(0,t.jsx)(eG,{size:16})})]}),d&&(0,t.jsx)("button",{type:"button",onClick:i,disabled:l,"aria-label":`Retry uploading ${e.file.name}`,className:(0,r.cn)(e$.UNSTYLED_BUTTON,"stg:absolute stg:left-1/2 stg:top-1/2 stg:-translate-x-1/2 stg:-translate-y-1/2 stg:rounded-full stg:bg-destructive stg:px-1.5 stg:py-0.5 stg:text-[0.6rem] stg:font-medium stg:leading-none stg:text-destructive-foreground stg:shadow-sm stg:hover:bg-destructive-hover stg:disabled:pointer-events-none"),children:"Retry"}),(0,t.jsx)("button",{type:"button",onClick:n,disabled:l,"aria-label":`Remove ${e.file.name}`,className:(0,r.cn)(e$.UNSTYLED_BUTTON,"stg:absolute stg:-right-1.5 stg:-top-1.5 stg:flex stg:h-4 stg:w-4 stg:items-center stg:justify-center stg:rounded-full stg:border stg:border-border stg:bg-background stg:text-muted-foreground stg:shadow-sm stg:hover:text-destructive stg:disabled:pointer-events-none"),children:(0,t.jsx)(eZ,{})})]}),(0,t.jsx)(a.TooltipContent,{side:"top",className:"stg:break-all",children:e.file.name})]})}function eK({entry:e,onRemove:s,onRetry:n,disabled:i}){let a="error"===e.phase,o=eW(e);return(0,t.jsxs)("span",{role:"listitem","aria-label":eU(e),className:(0,r.cn)("stg:inline-flex stg:max-w-[200px] stg:items-center stg:gap-1 stg:rounded-md stg:px-2 stg:py-0.5 stg:text-xs",a?"stg:border stg:border-destructive/30 stg:bg-destructive-subtle stg:text-destructive":"stg:bg-muted-subtle stg:text-foreground",o&&"stg:opacity-70"),children:[o&&(0,t.jsx)(eG,{}),a&&(0,t.jsx)(eJ,{}),!o&&!a&&(0,t.jsx)(eX,{}),(0,t.jsx)("span",{className:"stg:truncate",children:e.file.name}),(0,t.jsx)("span",{className:"stg:shrink-0 stg:text-[0.6rem] stg:tabular-nums stg:text-muted-foreground",children:(0,_.formatFileSize)(e.file.size)}),a&&(0,t.jsx)(eH,{filename:e.file.name,onRetry:n,disabled:i}),(0,t.jsx)(eq,{filename:e.file.name,onRemove:s,disabled:i})]})}function eH({filename:e,onRetry:s,disabled:n}){return(0,t.jsx)("button",{type:"button",onClick:s,disabled:n,className:(0,r.cn)(e$.UNSTYLED_BUTTON,"stg:shrink-0 stg:text-[0.6rem] stg:font-medium stg:text-destructive stg:underline stg:hover:text-destructive-muted stg:disabled:pointer-events-none"),"aria-label":`Retry uploading ${e}`,children:"Retry"})}function eq({filename:e,onRemove:s,disabled:n}){return(0,t.jsx)("button",{type:"button",onClick:s,disabled:n,className:(0,r.cn)(e$.UNSTYLED_BUTTON,"stg:ml-0.5 stg:shrink-0 stg:text-muted-foreground stg:hover:text-destructive stg:disabled:pointer-events-none"),"aria-label":`Remove ${e}`,children:(0,t.jsx)(eZ,{})})}function eY({entry:e,onClose:s}){let r=eO(e.file);return(0,t.jsx)(eB.AttachmentImageLightbox,{src:r,filename:e.file.name,open:!0,onClose:s})}function eG({size:e=10}){return(0,t.jsx)("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",className:"stg:shrink-0 stg:animate-spin stg:text-muted-foreground","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M8 2a6 6 0 1 0 6 6"})})}function eJ(){return(0,t.jsx)("span",{className:"stg:inline-block stg:h-1.5 stg:w-1.5 stg:shrink-0 stg:rounded-full stg:bg-destructive","aria-hidden":"true"})}function eX(){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"})]})}function eZ(){return(0,t.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M4 4L10 10M10 4L4 10"})})}let eQ=/^image\.(png|jpe?g|gif|webp|tiff?|bmp|avif)$/i,e0={"image/png":"png","image/jpeg":"jpg","image/gif":"gif","image/webp":"webp","image/tiff":"tiff","image/bmp":"bmp","image/avif":"avif","image/svg+xml":"svg"},e1=0;function e5({refs:e,onRemove:s,disabled:n,className:i}){return 0===e.length?null:(0,t.jsx)("div",{className:(0,r.cn)("stg:flex stg:flex-wrap stg:gap-1.5",i),role:"list","aria-label":"Referenced workspace files",children:e.map(e=>(0,t.jsx)(e2,{path:e,onRemove:()=>s(e),disabled:n},e))})}function e2({path:e,onRemove:s,disabled:r}){let n=e.split("/").pop()??e;return(0,t.jsxs)(a.Tooltip,{children:[(0,t.jsxs)(a.TooltipTrigger,{render:(0,t.jsx)("span",{role:"listitem","aria-label":`Referenced file: ${e}`,className:"stg:inline-flex stg:max-w-[200px] stg:items-center stg:gap-1 stg:rounded-md stg:bg-muted-subtle stg:px-2 stg:py-0.5 stg:text-xs stg:text-foreground"}),children:[(0,t.jsx)(e4,{}),(0,t.jsx)("span",{className:"stg:truncate",children:n}),(0,t.jsx)("button",{type:"button",onClick:s,disabled:r,className:"stg:ml-0.5 stg:shrink-0 stg:text-muted-foreground stg:hover:text-destructive stg:disabled:pointer-events-none","aria-label":`Remove reference to ${e}`,children:(0,t.jsx)(e3,{})})]}),(0,t.jsx)(a.TooltipContent,{side:"top",className:"stg:break-all",children:e})]})}function e4(){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-accent-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"}),(0,t.jsx)("path",{d:"M5 8H9M5 10H8"})]})}function e3(){return(0,t.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M4 4L10 10M10 4L4 10"})})}var e6=e.i(536907),e8=e.i(139666),e7=e.i(282838);let e9=(0,s.forwardRef)(function({onSubmit:e,isSubmitting:n=!1,disabled:o=!1,onStop:l,isStopping:g=!1,isEditing:d=!1,onCancelEdit:m,harness:p,onHarnessChange:x,showHarnessSelector:y=!1,interactionMode:w,onInteractionModeChange:S,showInteractionModePicker:N=!1,defaultModelId:C,onModelChange:E,showModelSelector:R=!0,workspace:A,gitHubConnection:T,enableGitHub:M=!0,enableLocal:L=!1,onBrowseLocalFolder:I,org:P,agentRef:D,onAgentRefChange:F,onAgentResolutionChange:H,onAgentSetupErrorChange:ee,initialAgentRef:eo,initialInstanceId:el,isDefaultAgent:eg=!1,lockAgent:ec=!1,mcpServerUsages:eu,onMcpServerUsagesChange:ed,skillRefs:em,onSkillRefsChange:eh,sessionVariables:ek,enableAttachments:ew=!0,enableFileReferences:eN=!0,onAttachmentValidationError:eC,initialAttachments:eE,placeholder:eR="Reply…",initialRows:eA=1,autoFocus:eM=!1,ariaLabel:eL="Send message",className:eI},eD){(0,e7.useRenderTracer)("SessionComposer",{disabled:o,isSubmitting:n});let[eO,eB]=(0,s.useState)(C),e$=(0,s.useRef)(!1);(0,s.useEffect)(()=>{e$.current||void 0===C||eB(C)},[C]);let e_=(0,s.useCallback)(e=>{e$.current=!0,eB(e)},[]),[eU,eW]=(0,s.useState)("standard"),[ez,eK]=(0,s.useState)("disabled"),[eH,eq]=(0,s.useState)(p??"native");(0,s.useEffect)(()=>{void 0!==p&&eq(p)},[p]);let[eY,eG]=(0,s.useState)(()=>new Map),eJ=o||n,eX=null!=l,eZ=null!=F&&null!=P,e2=null!=ed&&null!=P,e4=null!=A,e3=null!=eh&&null!=P,e9=null!=ek,[te,ts]=(0,s.useState)(!1),[tr,tn]=(0,s.useState)(null),ti=(0,s.useRef)(void 0),ta=(0,Q.usePersonalEnvironment)(eZ||e2?P??null:null),to=(0,s.useMemo)(()=>new Set(Object.keys(ta.environment?.spec?.data??{})),[ta.environment]),tl=(0,X.useStigmer)(),tg=function(e){let{personalEnvKeys:t,manualSecrets:r,agentRuntimeEnv:n,mcpRuntimeEnv:i}=e,a=(0,s.useMemo)(()=>{let e=new Map;if(n)for(let[t,s]of Object.entries(n))e.set(t,s);if(i)for(let[t,s]of Object.entries(i))e.set(t,s);if(r)for(let t of r){let s=t.key.trim();""!==s&&""!==t.value.trim()&&e.set(s,{value:t.value,isSecret:t.isSecret})}return e},[r,n,i]),o=(0,s.useMemo)(()=>{let e=new Set;if(t)for(let s of t)e.add(s);for(let t of a.keys())e.add(t);return e},[t,a]),l=(0,s.useMemo)(()=>e=>a.get(e),[a]),g=(0,s.useMemo)(()=>e=>o.has(e),[o]);return{availableKeys:o,getAvailableValue:l,isKeySatisfied:g}}({personalEnvKeys:to,manualSecrets:ek?.entries}),tc=(0,s.useMemo)(()=>new Set([...tg.availableKeys,...e8.SYSTEM_ENV_VAR_KEYS]),[tg.availableKeys]),tu=function(e,t){let r=(0,X.useStigmer)(),n=(0,Q.usePersonalEnvironment)(e),[i,a]=(0,s.useReducer)(er,es),o=(0,s.useCallback)(()=>a({type:"CLEAR_ERROR"}),[]),l=(0,s.useCallback)(()=>a({type:"RESET"}),[]),g=(0,s.useCallback)(async s=>{if(!e)throw Error("useAgentSetup: cannot resolve agent when org is null.");a({type:"RESOLVE_START",agentRef:s});try{let i=await r.agent.getByReference(s),o=i.metadata?.name??s.slug,l=i.spec?.env;if(!l||0===Object.keys(l).length){let e={mode:"direct"};return a({type:"RESOLVE_READY",agentRef:s,agentName:o,resolution:e}),{status:"ready",agentRef:s,agentName:o,resolution:e}}let g=`${s.org}/${s.slug}`,c=await r.agentInstance.list((0,Y.create)(G.ListAgentInstancesRequestSchema,{org:e,labels:{[en]:"true",[ei]:g}}));if(c.items.length>0){let e={mode:"saved",instanceId:c.items[0].metadata.id};return a({type:"RESOLVE_READY",agentRef:s,agentName:o,resolution:e}),{status:"ready",agentRef:s,agentName:o,resolution:e}}let u=new Set(Object.keys(n.environment?.spec?.data??{})),d=(0,et.diffEnv)(l,u),m=(0,et.diffEnv)(l,u,t);if(0===d.length){let t=await n.getOrCreate(),l={org:e,slug:t.metadata.slug,kind:J.ApiResourceKind.environment},c=await ea(r,{org:e,agentId:i.metadata.id,agentSlug:s.slug,agentLabel:g,environmentRef:l}),u={mode:"saved",instanceId:c.metadata.id};return a({type:"RESOLVE_READY",agentRef:s,agentName:o,resolution:u}),{status:"ready",agentRef:s,agentName:o,resolution:u}}if(0===m.length){let e={mode:"direct"};return a({type:"RESOLVE_READY",agentRef:s,agentName:o,resolution:e}),{status:"ready",agentRef:s,agentName:o,resolution:e}}return a({type:"RESOLVE_NEEDS_ENV",agentRef:s,agentId:i.metadata.id,agentName:o,missingVariables:m}),{status:"needsEnvVars",agentRef:s,agentName:o,missingVariables:m}}catch(e){throw a({type:"ERROR",error:(0,Z.toError)(e)}),e}},[e,r,n,t]),c=(0,s.useCallback)(async(e,t,s)=>{let r={mode:"saved",instanceId:t},n=s??e.slug;return a({type:"RESOLVE_READY",agentRef:e,agentName:n,resolution:r}),{status:"ready",agentRef:e,agentName:n,resolution:r}},[]),u="needsEnvVars"===i.status?i.missingVariables:null;(0,s.useEffect)(()=>{t&&0!==t.size&&u&&a({type:"POOL_RESOLVE",missingVariables:u.filter(e=>!t.has(e.key))})},[t,u]);let d=(0,s.useCallback)(async(t,s)=>{if("needsEnvVars"!==i.status)throw Error(`useAgentSetup: submitEnvVars requires state.status === 'needsEnvVars'. Current status is '${i.status}'. Call resolveAgent() first and ensure it returned status 'needsEnvVars'.`);if(!e)throw Error("useAgentSetup: cannot submit env vars when org is null.");let{agentRef:o,agentId:l,agentName:g}=i;if(!(s?.saveForFuture??!0)){let e={mode:"oneTime",runtimeEnv:t};return a({type:"SUBMIT_READY",agentRef:o,agentName:g,resolution:e}),{status:"ready",agentRef:o,agentName:g,resolution:e}}a({type:"SUBMIT_START"});try{let s=await n.getOrCreate();await n.addVariables(t);let i={org:e,slug:s.metadata.slug,kind:J.ApiResourceKind.environment},c=`${o.org}/${o.slug}`,u=await ea(r,{org:e,agentId:l,agentSlug:o.slug,agentLabel:c,environmentRef:i}),d={mode:"saved",instanceId:u.metadata.id};return a({type:"SUBMIT_READY",agentRef:o,agentName:g,resolution:d}),{status:"ready",agentRef:o,agentName:g,resolution:d}}catch(e){throw a({type:"ERROR",error:(0,Z.toError)(e)}),e}},[e,r,n,i]);return{state:i,resolveAgent:g,submitEnvVars:d,resolveToInstance:c,clearError:o,reset:l}}(eZ?P??null:null,tc),td=function(e,t){let r=(0,X.useStigmer)(),n=(0,Q.usePersonalEnvironment)(e),[i,a]=(0,s.useReducer)(eb,ev),o=(0,s.useRef)({}),l=(0,s.useRef)(i);l.current=i;let g=(0,s.useCallback)(async s=>{if(!e)throw Error("useMcpServerSetup: cannot add server when org is null.");let i=ex(s);a({type:"ADD_SERVER",key:i});try{let o,l=await r.mcpServer.getByReference(s),g=l.status?.discoveredCapabilities?.tools??[],c=l.spec?.pinnedToolApprovals??[],u=l.spec?.env;if(!u||0===Object.keys(u).length)return void a({type:"RESOLVE_READY",key:i,mcpServer:l,discoveredTools:g,toolApprovals:c,enabledTools:ej(l,g)});let d=new Set(Object.keys(n.environment?.spec?.data??{})),m=l.spec?.auth;if(m?.targetEnvVar&&l.metadata?.id)try{let t=await r.mcpServer.getOAuthGrantStatus((0,Y.create)(ef.GetOAuthGrantStatusInputSchema,{resourceId:l.metadata.id,org:e}));o=t.connectionHealth,t.connected&&d.add(m.targetEnvVar)}catch{}let h=(0,et.diffEnv)(u,d,t).filter(e=>!e.optional);if(0===h.length)return void a({type:"RESOLVE_READY",key:i,mcpServer:l,discoveredTools:g,toolApprovals:c,enabledTools:ej(l,g),oauthConnectionHealth:o});a({type:"RESOLVE_NEEDS_SETUP",key:i,mcpServer:l,missingVariables:h,discoveredTools:g,toolApprovals:c,oauthConnectionHealth:o})}catch(e){a({type:"SET_ERROR",key:i,error:(0,Z.toError)(e)})}},[e,r,n,t]),c=(0,s.useCallback)(e=>{a({type:"REMOVE_SERVER",key:ex(e)})},[]),u=(0,s.useCallback)(async(t,s,r)=>{if(!e)throw Error("useMcpServerSetup: cannot submit env vars when org is null.");let l=ex(t),g=i[l];if(!g||"needsSetup"!==g.status)throw Error(`useMcpServerSetup: submitEnvVars requires the server to be in 'needsSetup' status. Server '${l}' is ${g?`in '${g.status}' status`:"not selected"}. Call addServer() first and wait for it to resolve.`);let{mcpServer:c,discoveredTools:u}=g,d=ej(c,u),m=r?.saveForFuture??!0;if(a({type:"SUBMIT_START",key:l}),!m){Object.assign(o.current,s),a({type:"SUBMIT_DONE",key:l,enabledTools:d});return}try{await n.getOrCreate(),await n.addVariables(s),a({type:"SUBMIT_DONE",key:l,enabledTools:d})}catch(e){a({type:"SUBMIT_FAIL",key:l,error:(0,Z.toError)(e)})}},[e,i,n]),d=(0,s.useCallback)((e,t)=>{a({type:"SET_ENABLED_TOOLS",key:ex(e),enabledTools:t})},[]),m=(0,s.useCallback)(e=>{a({type:"CLEAR_ERROR",key:ex(e)})},[]),h=(0,s.useCallback)(()=>{a({type:"RESET"}),o.current={}},[]);(0,s.useEffect)(()=>{if(!t||0===t.size)return;let e=new Set(Object.keys(n.environment?.spec?.data??{}));for(let[s,r]of Object.entries(l.current)){if("needsSetup"!==r.status)continue;let n=r.mcpServer.spec?.env;if(n)a({type:"POOL_RESOLVE",key:s,missingVariables:(0,et.diffEnv)(n,e,t).filter(e=>!e.optional),enabledTools:ej(r.mcpServer,r.discoveredTools)})}},[t,n.environment]);let p=(0,s.useMemo)(()=>{let e=Object.values(i);return 0===e.length||e.every(e=>"ready"===e.status)},[i]),f=(0,s.useMemo)(()=>Object.values(i).filter(e=>"needsSetup"===e.status).length,[i]),x=(0,s.useMemo)(()=>{let e=[];for(let[t,s]of Object.entries(i)){if("ready"!==s.status)continue;let r=s.discoveredTools.map(e=>e.name),n=0===r.length||s.enabledTools.length===r.length&&s.enabledTools.every(e=>r.includes(e)),i=t.indexOf("/");e.push({mcpServerRef:{org:t.slice(0,i),slug:t.slice(i+1),kind:J.ApiResourceKind.mcp_server},enabledTools:n?void 0:[...s.enabledTools]})}return e},[i]);return{entries:i,addServer:g,removeServer:c,submitEnvVars:u,setEnabledTools:d,clearError:m,reset:h,allReady:p,needsSetupCount:f,pendingRuntimeEnv:o.current,usageInputs:x}}(e2?P??null:null,tc);(0,s.useEffect)(()=>{"ready"===tu.state.status&&H?.(tu.state.resolution)},[tu.state,H]),(0,s.useEffect)(()=>{ee?.(tu.state.error??null)},[tu.state.error,ee]);let tm=function(e){let t=(0,X.useStigmer)(),[r,n]=(0,s.useState)([]),i=(0,s.useRef)(new Map),a=(0,s.useRef)(r);a.current=r;let o=(0,s.useCallback)(async(e,s,r)=>{let a=new AbortController;i.current.set(e,a);try{let i=new Uint8Array(await s.arrayBuffer());if(a.signal.aborted)return;let o=await t.agentExecution.uploadAttachment((0,Y.create)(eT.UploadAttachmentRequestSchema,{filename:s.name,content:i,contentType:r}));if(a.signal.aborted)return;n(t=>t.map(t=>t.id===e?{...t,phase:"ready",storageKey:o.storageKey,error:null}:t))}catch(s){if(a.signal.aborted)return;let t=(0,Z.toError)(s).message;n(s=>s.map(s=>s.id===e?{...s,phase:"error",error:t}:s))}finally{i.current.delete(e)}},[t]),l=(0,s.useCallback)(async(t,s)=>{let r=new AbortController;i.current.set(t,r);let l=await eP(s);if(r.signal.aborted)return;i.current.delete(t);let g=(0,_.validateAttachmentSize)(l);if(g){n(e=>e.filter(e=>e.id!==t)),e?.onValidationError?.(g);return}let c=new Set(a.current.filter(e=>e.id!==t).map(e=>e.file.name)),u=(0,_.uniquifyFilename)(l.name,c),d=u===l.name?l:new File([l],u,{type:l.type,lastModified:l.lastModified}),m=(0,_.detectContentType)(d);n(e=>e.map(e=>e.id===t?{...e,file:d,contentType:m,phase:"uploading"}:e)),o(t,d,m)},[e,o]),g=(0,s.useCallback)((t,s)=>{let r=Array.from(t),i=[],g=new Set(a.current.map(e=>e.file.name));for(let t of r){if(s?.prepareImages){let e=eF();i.push({id:e,file:t,phase:"preparing",contentType:(0,_.detectContentType)(t),storageKey:null,error:null}),l(e,t);continue}let r=(0,_.validateAttachmentSize)(t);if(r){e?.onValidationError?.(r);continue}let n=(0,_.uniquifyFilename)(t.name,g);g.add(n);let a=n===t.name?t:new File([t],n,{type:t.type,lastModified:t.lastModified}),c=eF(),u=(0,_.detectContentType)(a);i.push({id:c,file:a,phase:"uploading",contentType:u,storageKey:null,error:null}),o(c,a,u)}i.length>0&&(a.current=[...a.current,...i],n(e=>[...e,...i]))},[e,o,l]),c=(0,s.useCallback)(e=>{let t=i.current.get(e);t&&(t.abort(),i.current.delete(e)),n(t=>t.filter(t=>t.id!==e))},[]),u=(0,s.useCallback)(e=>{n(t=>{let s=t.find(t=>t.id===e);return s&&"error"===s.phase?(o(e,s.file,s.contentType),t.map(t=>t.id===e?{...t,phase:"uploading",error:null}:t)):t})},[o]),d=(0,s.useCallback)(()=>{for(let e of i.current.values())e.abort();i.current.clear(),n([])},[]),m=(0,s.useCallback)(()=>r.filter(e=>"ready"===e.phase&&null!==e.storageKey).map(e=>({filename:e.file.name,storageKey:e.storageKey,contentType:e.contentType})),[r]),h=r.some(e=>"preparing"===e.phase),p=r.some(e=>"preparing"===e.phase||"uploading"===e.phase),f=r.filter(e=>"ready"===e.phase).length,x=r.length>0,v=x&&f===r.length;return{entries:r,isUploading:p,isPreparing:h,readyCount:f,allReady:v,hasEntries:x,addFiles:g,removeEntry:c,retryEntry:u,clear:d,toAttachmentInputs:m}}(ew?{onValidationError:eC}:void 0),{getByKey:th,getModel:tp,visionLimits:tf,isLoading:tx}=(0,V.useModelRegistry)(),{defaultModel:tv}=(0,V.useModelRegistry)({harness:eH}),tb=(0,s.useMemo)(()=>{let e=eO?th(eO)??tp(eO):void 0,t=eO,s=e;R&&!tx&&void 0===e&&(t=tv?.modelId??eO,s=tv);let r="fast"===eU&&s?.serviceTiers.includes(B.FAST_SERVICE_TIER)?"fast":"standard",n="enabled"===ez&&void 0!==s&&"cursor"===s.harness&&!0===s.thinkingCapable?"enabled":"disabled";return{modelId:t,model:s,serviceTier:r,thinkingMode:n}},[eO,eU,ez,R,tx,th,tp,tv]),tj=(0,s.useMemo)(()=>ew&&0!==tm.entries.length?function(e,t){if(0===e.warnings.length)return null;if(e.modelCannotSeeImages){let e=t?.modelDisplayName??"The selected model";return`${e} can't view images — attached images will reach the agent as files only.`}let s=e.warnings.filter(e=>"too_large"===e.reason),r=e.warnings.filter(e=>"budget_exhausted"===e.reason),n=[];if(s.length>0){let e=t?.limits?`the ${(0,_.formatFileSize)(t.limits.maxImageBytes)} inline-image limit`:"the inline-image size limit";if(1===s.length){let t=s[0];n.push(`${t.name} (${(0,_.formatFileSize)(t.sizeBytes)}) exceeds ${e} and will reach the agent as a file, not an image`)}else 2===s.length?n.push(`${s[0].name} and ${s[1].name} exceed ${e} and will reach the agent as files, not images`):n.push(`${s.length} images exceed ${e} and will reach the agent as files, not images`)}if(r.length>0){let e=t?.limits?`this turn's inline-image budget (${t.limits.maxImages} images, ${(0,_.formatFileSize)(t.limits.maxTotalBytes)} total)`:"this turn's inline-image budget";n.push(1===r.length?`${r[0].name} is over ${e} and will reach the agent as a file`:`${r.length} images are over ${e} and will reach the agent as files`)}return 0===n.length?null:`${n.join("; ")}.`}(function(e,t){let s=e.filter(e=>U.has(e.contentType.toLowerCase()));if(0===s.length)return W;if(t?.model?.visionCapability===!1)return{warnings:s.map(e=>({name:e.name,sizeBytes:e.sizeBytes,reason:"model_no_vision"})),modelCannotSeeImages:!0};let r=t?.limits;if(!r)return W;let n=[],i=0,a=0;for(let e of s){if(e.sizeBytes>r.maxImageBytes){n.push({name:e.name,sizeBytes:e.sizeBytes,reason:"too_large"});continue}if(i>=r.maxImages||a+e.sizeBytes>r.maxTotalBytes){n.push({name:e.name,sizeBytes:e.sizeBytes,reason:"budget_exhausted"});continue}i+=1,a+=e.sizeBytes}return 0===n.length?W:{warnings:n,modelCannotSeeImages:!1}}(tm.entries.filter(e=>"preparing"!==e.phase).map(e=>({name:e.file.name,sizeBytes:e.file.size,contentType:e.contentType})),{model:tb.model,limits:tf}),{limits:tf,modelDisplayName:tb.model?.displayName}):null,[ew,tm.entries,tb.model,tf]),ty=function(){let[e,t]=(0,s.useState)([]),r=(0,s.useCallback)(e=>{t(t=>t.includes(e)?t:[...t,e])},[]),n=(0,s.useCallback)(e=>{t(t=>{let s=t.filter(t=>t!==e);return s.length===t.length?t:s})},[]),i=(0,s.useCallback)(()=>{t(e=>0===e.length?e:[])},[]);return(0,s.useMemo)(()=>({refs:e,hasRefs:e.length>0,add:r,remove:n,clear:i}),[e,r,n,i])}(),tk=(0,s.useRef)(null),[tw,tS]=(0,s.useState)(!1),[tN,tC]=(0,s.useState)(!1),tE=(0,s.useCallback)(e=>{e.target.files&&e.target.files.length>0&&tm.addFiles(e.target.files),tk.current&&(tk.current.value="")},[tm]),tR=(0,s.useCallback)(e=>{if(e.dataTransfer.types.includes(e6.FILE_REF_MIME)&&eN&&!eJ){e.preventDefault(),e.stopPropagation(),tC(!0),tS(!0);return}ew&&!eJ&&(e.preventDefault(),e.stopPropagation(),tC(!1),tS(!0))},[ew,eN,eJ]),tA=(0,s.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),tS(!1),tC(!1)},[]),tT=(0,s.useCallback)(e=>{if(e.preventDefault(),e.stopPropagation(),tS(!1),tC(!1),eJ)return;let t=e.dataTransfer.getData(e6.FILE_REF_MIME);if(t&&eN){try{let{path:e}=JSON.parse(t);e&&ty.add(e)}catch{}return}ew&&e.dataTransfer.files.length>0&&tm.addFiles(e.dataTransfer.files)},[ew,eN,eJ,tm,ty]),tM=(0,s.useCallback)(e=>{let t;if(!ew||eJ)return;let s=(t=e.clipboardData?.files)&&0!==t.length?Array.from(t).map(e=>{var t,s;let r,n,i;return e.type.toLowerCase().startsWith("image/")&&(""===e.name||eQ.test(e.name))?new File([e],(t=e.type,s=new Date,r=e=>String(e).padStart(2,"0"),n=`${r(s.getHours())}${r(s.getMinutes())}${r(s.getSeconds())}`,i=e0[t.toLowerCase()]??"png",e1+=1,`pasted-image-${n}-${e1}.${i}`),{type:e.type,lastModified:e.lastModified}):e}):[];0===s.length||(e.preventDefault(),(0,tm.addFiles)(s,{prepareImages:!0}))},[ew,eJ,tm.addFiles]),tL=(0,s.useCallback)(async(t,s)=>{if(ek?.hasSaveForFutureEntries){let e=ek.toSaveForFutureEnv();if(Object.keys(e).length>0)try{await ta.getOrCreate(),await ta.addVariables(e)}catch{}}let r={};Object.assign(r,await (0,e8.resolveSystemEnvVarValues)(tl)),"ready"===tu.state.status&&"oneTime"===tu.state.resolution.mode&&Object.assign(r,tu.state.resolution.runtimeEnv);let n=td.pendingRuntimeEnv;Object.keys(n).length>0&&Object.assign(r,n),ek&&ek.hasValidEntries&&Object.assign(r,ek.toRuntimeEnv());let i=[...ew?tm.toAttachmentInputs():[],...s?.attachments??[]],a=Object.keys(r).length>0,o=i.length>0,l=s?.interactionMode??(N&&w?w:void 0),g=eN&&ty.hasRefs,c=s?.buildFromPlan,u="fast"===tb.serviceTier?tb.serviceTier:void 0,d="enabled"===tb.thinkingMode?tb.thinkingMode:void 0,m=a||o||l||g||c||u||d?{runtimeEnv:a?r:void 0,attachments:o?i:void 0,interactionMode:l,serviceTier:u,thinkingMode:d,workspaceFileRefs:g?[...ty.refs]:void 0,buildFromPlan:c}:void 0;e(t,tb.modelId?(0,$.parseModelKey)(tb.modelId)?.modelId??tb.modelId:void 0,m),ew&&tm.clear(),eN&&ty.clear()},[e,tb,tl,tu.state,td.pendingRuntimeEnv,ek,ew,tm,ta,N,w]),tI=(0,i.useComposer)({onSubmit:tL,disabled:eJ});(0,s.useImperativeHandle)(eD,()=>({setMessage:tI.setMessage,focus:()=>tI.textareaRef.current?.focus(),submit:(e,t)=>{let s=e.trim();s&&!eJ&&tL(s,t)}}),[tI.setMessage,tI.textareaRef,tL,eJ]);let tP=(0,s.useCallback)(e=>{e_(e),E?.(e)},[E]),tD=(0,s.useCallback)(e=>{eq(e),x?.(e)},[x]),tF=(0,s.useCallback)(e=>{S?.(e)},[S]),tO=(0,s.useCallback)((e,t)=>{eG(s=>{let r=new Map(s);return r.set(e,t),r})},[]),tB="needsEnvVars"===tu.state.status,t$="resolving"===tu.state.status||"submitting"===tu.state.status,tV=(0,s.useCallback)(e=>{ts(e),e||(ti.current=void 0,"agent"===tr&&"needsEnvVars"!==tu.state.status&&"submitting"!==tu.state.status&&tu.reset())},[tr,tu]),t_=(0,s.useCallback)(e=>{"agent"===tr&&"agent"!==e&&"needsEnvVars"!==tu.state.status&&"submitting"!==tu.state.status&&tu.reset(),tn(e)},[tr,tu]),tU=(0,s.useCallback)(async e=>{if(!e){F?.(null),H?.(null);return}try{let t=await tu.resolveAgent(e);"ready"===t.status&&(F?.(t.agentRef),H?.(t.resolution),tO(`${t.agentRef.org}/${t.agentRef.slug}`,t.agentName),ts(!1))}catch{}},[tu,F,H,tO]),tW=(0,s.useCallback)(async(e,t)=>{try{let s=await tu.resolveToInstance(e,t);F?.(s.agentRef),H?.(s.resolution),tO(`${s.agentRef.org}/${s.agentRef.slug}`,s.agentName),ts(!1)}catch{}},[tu,F,H,tO]),tz=(0,s.useCallback)(async(e,{saveForFuture:t})=>{try{let s=await tu.submitEnvVars(e,{saveForFuture:t});F?.(s.agentRef),H?.(s.resolution),tO(`${s.agentRef.org}/${s.agentRef.slug}`,s.agentName),ts(!1)}catch{}},[tu,F,H,tO]),tK=(0,s.useRef)(tU);tK.current=tU;let tH=(0,s.useRef)(tW);tH.current=tW;let tq=(0,s.useRef)(!1);(0,s.useEffect)(()=>{if(!eo||!eZ||!P||tq.current)return;let e=!1;return tq.current=!0,(el?tH.current(eo,el):tK.current(eo)).catch(()=>{e||(tq.current=!1)}),()=>{e=!0}},[eo,el,eZ,P]);let tY=(0,s.useRef)(!1);(0,s.useEffect)(()=>{tY.current||!eo||"needsEnvVars"===tu.state.status&&(tY.current=!0,ts(!0),tn("agent"))},[eo,tu.state.status]);let tG=(0,s.useRef)(!1);(0,s.useEffect)(()=>{eE&&eE.length>0&&ew&&!tG.current&&(tG.current=!0,tm.addFiles(eE))},[eE,ew,tm]);let tJ=(0,s.useRef)(!1),tX=(0,s.useRef)(td.addServer);tX.current=td.addServer;let tZ=(0,s.useRef)(td.setEnabledTools);tZ.current=td.setEnabledTools,(0,s.useEffect)(()=>{if(e2&&!tJ.current&&eu?.length)for(let e of(tJ.current=!0,eu)){let t=e.mcpServerRef;if(!t)continue;let s=e.enabledTools;tX.current(t).then(()=>{s?.length&&tZ.current(t,s)}).catch(()=>{})}},[e2,eu]);let tQ=(0,s.useMemo)(()=>Object.values(td.entries).some(e=>"loading"===e.status),[td.entries]);(0,s.useEffect)(()=>{e2&&!tQ&&ed?.(td.usageInputs)},[e2,td.usageInputs,ed,tQ]);let t0=e2&&!td.allReady,t1=ew&&tm.isUploading,t5=tI.canSubmit&&!t0&&!t1,t2=tI.canSubmit&&!t0&&t1,[t4,t3]=(0,s.useState)(!1);(0,s.useEffect)(()=>{t1||t3(!1)},[t1]);let t6=(0,s.useCallback)(e=>{if(d&&m&&"Escape"===e.key){e.preventDefault(),m();return}if(!t5&&"Enter"===e.key&&!e.shiftKey){e.preventDefault(),t2&&t3(!0);return}tI.textareaProps.onKeyDown(e)},[t5,t2,tI.textareaProps,d,m]),t8=A?.entries.length??0,t7=(0,s.useMemo)(()=>{if(!(t8>0)&&L&&!M&&I)return async()=>{let e=await I();e&&A?.addLocalPath(e)}},[t8,L,M,I,A]),t9=(0,s.useMemo)(()=>t8>0?null:M&&!L?"github":null,[t8,M,L]),se=e2?Object.keys(td.entries).length:0,st=em?.length??0,ss=ek?.entries.length??0,sr=(0,s.useMemo)(()=>{let e={};if("needsEnvVars"===tu.state.status){let t=tu.state.agentName;for(let s of tu.state.missingVariables)(e[s.key]??=[]).push(t)}if(e2)for(let t of Object.values(td.entries)){if("needsSetup"!==t.status)continue;let s=t.mcpServer.metadata?.name??"MCP Server";for(let r of t.missingVariables)(e[r.key]??=[]).push(s)}return e},[tu.state,e2,td.entries]),sn=(0,s.useMemo)(()=>{let e=[];if(eZ){let s=!D&&("needsEnvVars"===tu.state.status||"resolving"===tu.state.status||"submitting"===tu.state.status);(!ec||s)&&e.push({id:"agent",icon:(0,t.jsx)(f,{}),label:"Agent",count:D||s?1:0,hasWarning:s&&"needsEnvVars"===tu.state.status})}return e2&&e.push({id:"mcp",icon:(0,t.jsx)(v,{}),label:"MCP Servers",count:se,hasWarning:td.needsSetupCount>0}),e3&&e.push({id:"skills",icon:(0,t.jsx)(b,{}),label:"Skills",count:st}),e9&&e.push({id:"sessionVars",icon:(0,t.jsx)(j,{}),label:"Session Variables",count:ss}),e},[eZ,ec,D,tu.state,e2,se,td.needsSetupCount,e3,st,e9,ss]),si=(0,s.useCallback)(e=>{switch(e){case"agent":return tB?(0,t.jsxs)("div",{children:[(0,t.jsx)(q,{agentName:"needsEnvVars"===tu.state.status?tu.state.agentName:"Agent",variables:"needsEnvVars"===tu.state.status?tu.state.missingVariables:[],onSubmit:tz,onCancel:()=>tu.reset(),isSubmitting:t$,disabled:eJ,poolValues:tg.getAvailableValue}),tu.state.error&&(0,t.jsx)(tt,{error:tu.state.error})]}):(0,t.jsxs)("div",{className:"stg:relative",children:[(0,t.jsx)(K.AgentPicker,{org:P,value:D??null,onChange:tU,onDisplayNameResolved:tO,disabled:eJ||t$}),t$&&(0,t.jsx)("div",{className:"stg:absolute stg:inset-0 stg:flex stg:items-center stg:justify-center stg:rounded-lg stg:bg-popover/80",children:(0,t.jsx)(k,{})}),tu.state.error&&(0,t.jsx)(tt,{error:tu.state.error})]});case"mcp":return(0,t.jsx)(ep.McpServerPicker,{org:P,setup:{entries:td.entries,onServerAdded:e=>td.addServer(e),onServerRemoved:e=>td.removeServer(e),onSubmitEnvVars:(e,t,s)=>td.submitEnvVars(e,t,{saveForFuture:s.saveForFuture}),onEnabledToolsChange:(e,t)=>td.setEnabledTools(e,t)},initialServerKey:ti.current,onDisplayNameResolved:tO,disabled:eJ,poolValues:tg.getAvailableValue});case"skills":return(0,t.jsx)(ey.SkillPicker,{org:P,value:em??[],onChange:eh,onDisplayNameResolved:tO,disabled:eJ});case"sessionVars":return(0,t.jsx)(eS,{sessionVariables:ek,disabled:eJ,requiredByMap:sr});default:return null}},[tB,tu,t$,eJ,P,D,tU,tz,tO,td,em,eh,ek,tg,sr]);return(0,t.jsx)("div",{role:"form","aria-label":eL,className:(0,r.cn)("stg:shrink-0",eI),children:(0,t.jsxs)("div",{className:(0,r.cn)("stg:rounded-xl stg:border stg:border-border stg:bg-card stg:shadow-sm","stg:focus-within:ring-2 stg:focus-within:ring-ring","plan"===w&&"stg:border-primary-muted",eJ&&!eX&&"stg:opacity-50",tw&&"stg:ring-2 stg:ring-primary/50"),onDragOver:tR,onDragLeave:tA,onDrop:tT,children:[d&&(0,t.jsxs)("div",{role:"status",className:"stg:flex stg:items-center stg:justify-between stg:gap-2 stg:rounded-t-xl stg:border-b stg:border-border stg:bg-muted stg:px-3 stg:py-1.5",children:[(0,t.jsx)("span",{className:"stg:text-xs stg:font-medium stg:text-muted-foreground",children:"Editing message"}),m&&(0,t.jsxs)(a.Tooltip,{children:[(0,t.jsx)(a.TooltipTrigger,{render:(0,t.jsx)("button",{type:"button",onClick:m,"aria-label":"Cancel editing",className:"stg:rounded stg:p-0.5 stg:text-muted-foreground stg:transition-colors stg:hover:bg-accent stg:hover:text-foreground stg:focus-visible:outline-none stg:focus-visible:ring-1 stg:focus-visible:ring-ring"}),children:(0,t.jsx)(h,{})}),(0,t.jsx)(a.TooltipContent,{side:"top",children:"Cancel editing (Esc)"})]})]}),(0,t.jsxs)("div",{className:"stg:relative",children:[(0,t.jsx)("textarea",{...tI.textareaProps,onKeyDown:t6,onPaste:tM,placeholder:eR,rows:eA,autoFocus:eM,className:"stg:block stg:w-full stg:resize-none stg:bg-transparent stg:px-4 stg:pt-3 stg:pb-2 stg:text-sm stg:text-foreground stg:placeholder:text-muted-foreground stg:focus:outline-none stg:disabled:cursor-not-allowed"}),tw&&(0,t.jsx)("div",{className:"stg:pointer-events-none stg:absolute stg:inset-0 stg:flex stg:items-center stg:justify-center stg:rounded-t-xl stg:bg-primary-subtle",children:(0,t.jsx)("span",{className:"stg:text-xs stg:font-medium stg:text-primary",children:tN?"Reference workspace file":"Drop files to attach"})})]}),ew&&(0,t.jsx)("input",{ref:tk,type:"file",multiple:!0,onChange:tE,className:"stg:hidden","aria-hidden":"true",tabIndex:-1}),ew&&tm.hasEntries||eN&&ty.hasRefs?(0,t.jsxs)("div",{className:"stg:space-y-1.5 stg:px-3 stg:pb-2",children:[ew&&tm.hasEntries&&(0,t.jsx)(eV,{entries:tm.entries,onRemove:tm.removeEntry,onRetry:tm.retryEntry,disabled:eJ}),eN&&ty.hasRefs&&(0,t.jsx)(e5,{refs:ty.refs,onRemove:ty.remove,disabled:eJ})]}):null,t4&&(0,t.jsxs)("div",{role:"status",className:"stg:mx-3 stg:mb-2 stg:flex stg:items-center stg:gap-2 stg:rounded-md stg:bg-muted stg:px-2.5 stg:py-1.5 stg:text-xs stg:text-muted-foreground",children:[(0,t.jsx)(c,{}),(0,t.jsx)("span",{children:tm.isPreparing?"Waiting for attachments to finish preparing…":"Waiting for attachments to finish uploading…"})]}),tj&&(0,t.jsxs)("div",{role:"status",className:"stg:mx-3 stg:mb-2 stg:flex stg:items-center stg:gap-2 stg:rounded-md stg:bg-warning/10 stg:px-2.5 stg:py-1.5 stg:text-xs stg:text-warning",children:[(0,t.jsx)(u,{}),(0,t.jsx)("span",{children:tj})]}),eZ&&"needsEnvVars"===tu.state.status&&!D&&(0,t.jsxs)("div",{role:"status",className:"stg:mx-3 stg:mb-2 stg:flex stg:items-center stg:gap-2 stg:rounded-md stg:bg-warning/10 stg:px-2.5 stg:py-1.5 stg:text-xs stg:text-warning",children:[(0,t.jsx)(u,{}),(0,t.jsx)("span",{children:"Agent needs configuration before use"}),(0,t.jsx)("button",{type:"button",onClick:()=>{ts(!0),tn("agent")},disabled:eJ,className:"stg:ml-auto stg:shrink-0 stg:rounded stg:px-1.5 stg:py-0.5 stg:text-[0.6rem] stg:font-medium stg:hover:bg-warning/20 stg:disabled:pointer-events-none stg:disabled:opacity-50",children:"Configure"})]}),e2&&td.needsSetupCount>0&&(0,t.jsxs)("div",{role:"status",className:"stg:mx-3 stg:mb-2 stg:flex stg:items-center stg:gap-2 stg:rounded-md stg:bg-warning/10 stg:px-2.5 stg:py-1.5 stg:text-xs stg:text-warning",children:[(0,t.jsx)(u,{}),(0,t.jsx)("span",{children:1===td.needsSetupCount?"1 MCP server needs configuration":`${td.needsSetupCount} MCP servers need configuration`}),(0,t.jsx)("button",{type:"button",onClick:()=>{1===td.needsSetupCount?ti.current=Object.entries(td.entries).find(([,e])=>"needsSetup"===e.status)?.[0]:ti.current=void 0,ts(!0),tn("mcp")},disabled:eJ,className:"stg:ml-auto stg:shrink-0 stg:rounded stg:px-1.5 stg:py-0.5 stg:text-[0.6rem] stg:font-medium stg:hover:bg-warning/20 stg:disabled:pointer-events-none stg:disabled:opacity-50",children:"Configure"})]}),(0,t.jsx)(O,{disabled:eJ,isSubmitting:n,canSend:t5,onSend:tI.submit,onStop:l,isStopping:g,showWorkspace:e4,workspaceCount:t8,onWorkspaceDirectAction:t7,workspaceContent:A?(0,t.jsx)(z.WorkspaceEditor,{workspace:A,disabled:eJ,gitHubConnection:T,enableGitHub:M,enableLocal:L,onBrowseLocalFolder:I,initialPanel:t9}):null,showAttach:ew,attachmentCount:tm.entries.length,onAttachClick:()=>tk.current?.click(),configureItems:sn,configOpen:te,onConfigOpenChange:tV,configActivePanel:tr,onConfigActivePanelChange:t_,renderConfigPanel:si,showHarnessSelector:y,harness:p,onHarnessChange:tD,showInteractionModePicker:N,interactionMode:w,onInteractionModeChange:tF,showModelSelector:R,modelId:tb.modelId,onModelChange:tP,serviceTier:eU,onServiceTierChange:eW,thinkingMode:ez,onThinkingModeChange:eK})]})})}),te=(0,s.memo)(e9);function tt({error:e}){return em(e)?(0,t.jsx)(ed,{error:e,className:"stg:mt-2"}):(0,t.jsx)("p",{className:"stg:mt-2 stg:text-xs stg:text-destructive",children:(0,n.getUserMessage)(e)})}function ts(e,t,s,r){if(e)try{let t=localStorage.getItem(e);if(t){let e=Number(t);if(Number.isFinite(e)&&e>=s&&e<=r)return e}}catch{}return t}function tr({primary:e,secondary:n,resizablePane:i="secondary",defaultSize:a=384,minSize:o=280,maxSize:l=800,storageKey:g,responsiveCollapse:c="none",collapsedPane:u="none",ariaLabel:d="Resize panel",onResize:m,className:h}){let p="primary"===i,f="none"!==u,[x,v]=(0,s.useState)(()=>ts(g,a,o,l)),[b,j]=(0,s.useState)(g),[y,k]=(0,s.useState)(i);(g!==b||i!==y)&&(j(g),k(i),v(ts(g,a,o,l)));let w=(0,s.useRef)(null),S=(0,s.useRef)(0),N=(0,s.useRef)(!1),C=(0,s.useRef)(m);C.current=m,(0,s.useEffect)(()=>{C.current?.(x)},[x]);let E=(0,s.useCallback)(e=>Math.round(Math.max(o,Math.min(l,e))),[o,l]),R=(0,s.useCallback)(e=>{if(g)try{localStorage.setItem(g,String(e))}catch{}},[g]),A=(0,s.useCallback)(e=>{e.preventDefault(),e.currentTarget.setPointerCapture(e.pointerId),N.current=!0},[]),T=(0,s.useCallback)(e=>{if(!N.current||!w.current)return;let t=e.clientX;cancelAnimationFrame(S.current),S.current=requestAnimationFrame(()=>{let e=w.current;if(!e)return;let s=e.getBoundingClientRect();v(E(p?t-s.left:s.right-t))})},[E,p]),M=(0,s.useCallback)(e=>{N.current&&(N.current=!1,e.currentTarget.releasePointerCapture(e.pointerId),cancelAnimationFrame(S.current),R(x))},[R,x]),L=(0,s.useCallback)(e=>{let t=0;"ArrowLeft"===e.key?t=p?-20:20:"ArrowRight"===e.key&&(t=p?20:-20),0!==t&&(e.preventDefault(),v(e=>{let s=E(e+t);return R(s),s}))},[E,R,p]);(0,s.useEffect)(()=>()=>cancelAnimationFrame(S.current),[]);let I="stg:shrink-0 stg:overflow-hidden",P="stg:min-w-0 stg:flex-1",D="primary"===u?"hidden":"secondary"!==u&&p?I:P,F="secondary"===u?"hidden":"primary"===u||p?P:I;return(0,t.jsxs)("div",{ref:w,className:(0,r.cn)("stg:flex stg:min-h-0 stg:flex-1","none"!==c&&"stg:@container/resizable-split",h),children:[(0,t.jsx)("div",{className:(0,r.cn)(D,"primary"===c&&"stg:@max-3xl/resizable-split:hidden"),style:p&&!f?{width:x}:void 0,children:e}),(0,t.jsx)("div",{role:"separator","aria-orientation":"vertical","aria-valuenow":x,"aria-valuemin":o,"aria-valuemax":l,"aria-label":d,"aria-hidden":f||void 0,tabIndex:f?-1:0,onPointerDown:A,onPointerMove:T,onPointerUp:M,onKeyDown:L,className:(0,r.cn)("stg:group stg:relative stg:z-10 stg:w-1 stg:shrink-0 stg:cursor-col-resize stg:touch-none stg:select-none","stg:bg-[var(--stgm-border,#e5e5e5)]","stg:hover:bg-[var(--stgm-primary,#6366f1)]","stg:focus-visible:bg-[var(--stgm-primary,#6366f1)] stg:focus-visible:outline-none","stg:active:bg-[var(--stgm-primary,#6366f1)]","stg:transition-colors stg:duration-100","none"!==c&&"stg:@max-3xl/resizable-split:hidden",f&&"stg:hidden"),children:(0,t.jsx)("div",{className:"stg:absolute stg:inset-y-0 stg:-left-1.5 stg:-right-1.5"})}),(0,t.jsx)("div",{className:(0,r.cn)(F,"secondary"===c&&"stg:@max-3xl/resizable-split:hidden"),style:p||f?void 0:{width:x},children:n})]})}function tn({conversation:e,panel:s,chip:n,headerActions:i,splitStorageKey:a,responsive:o=!0,resizeAriaLabel:l="Resize chat panel",className:g}){let c=null!=s;return(0,t.jsxs)("div",{className:(0,r.cn)("stg:relative stg:flex stg:h-full stg:w-full stg:flex-col",g),children:[(null!=i||null!=n)&&(0,t.jsxs)("div",{className:"stg:absolute stg:top-2 stg:right-6 stg:z-10 stg:flex stg:items-center stg:gap-2",children:[i,n]}),(0,t.jsx)(tr,{resizablePane:"primary",collapsedPane:c?"none":"secondary",defaultSize:420,minSize:320,maxSize:640,storageKey:a,responsiveCollapse:o&&c?"primary":"none",ariaLabel:l,className:"stg:min-h-0 stg:flex-1",primary:e,secondary:s})]})}e.s(["ResizableSplit",0,tr],776526);var ti=e.i(796545),ta=e.i(503353),to=e.i(469196);let tl=new Map;function tg(e){return`${e.id}\u0000${e.readRef??e.gitBranch??""}`}async function tc(e,t,s={}){var r;let n,i,a;if(!s.bustCache){let t=tl.get(tg(e));if(t)return t}let o=await t(e);if(null===o)return null;let l=(n=(r=o).some(e=>!0===e.notice),i=r.filter(e=>!e.notice),a=(0,to.buildFileTree)(i.filter(e=>!e.isDirectory)),{files:i,tree:a,truncated:n});return tl.set(tg(e),l),l}function tu(e,t){return e.isBasenameHit!==t.isBasenameHit?e.isBasenameHit?-1:1:e.matchStart!==t.matchStart?e.matchStart-t.matchStart:e.path.length!==t.path.length?e.path.length-t.path.length:e.path.localeCompare(t.path)}let td=[];function tm({entries:e,lister:n,onOpenFile:i,selectedFile:a,className:o}){let[l,g]=(0,s.useState)(""),[c,u]=(0,s.useState)(-1),d=(0,s.useRef)(null),m=(0,s.useId)(),h=(0,s.useCallback)(e=>`${m}-opt-${e}`,[m]),{groups:p,totalMatches:f,isLoading:x,isUnsupported:v}=function({entries:e,lister:t,query:r}){let[n,i]=(0,s.useState)({}),a=(0,s.useRef)(e);a.current=e;let o=e.map(e=>`${e.id}\u0001${e.readRef??""}`).join("\0"),l=(0,s.useRef)(0);return(0,s.useEffect)(()=>{if(!t)return void i({});let e=a.current,s=++l.current;for(let r of(i(t=>{let s={};for(let r of e)s[r.id]=t[r.id]??{status:"loading"};return s}),e))tc(r,t).then(e=>{l.current===s&&i(t=>({...t,[r.id]:null===e?{status:"unsupported"}:{status:"ready",listing:e}}))}).catch(e=>{l.current===s&&i(t=>({...t,[r.id]:{status:"error",error:(0,Z.toError)(e)}}))})},[o,t]),(0,s.useMemo)(()=>{if(!t)return{groups:td,totalMatches:0,isLoading:!1,isUnsupported:!0,error:null};let s=[],i=0,a=!1,o=null,l=0;for(let t of e){let e=n[t.id];if(!e||"loading"===e.status){a=!0;continue}if("unsupported"===e.status){l+=1;continue}let g="error"===e.status?e.error??null:null;g&&!o&&(o=g);let c=e.listing?.truncated??!1,u=e.listing?function(e,t){let s=t.trim();if(0===s.length)return[];let r=s.toLowerCase(),n=[];for(let t of e){if(t.isDirectory||t.notice)continue;let e=t.path.toLowerCase().indexOf(r);if(-1===e)continue;let s=t.path.lastIndexOf("/");n.push({path:t.path,matchStart:e,matchEnd:e+r.length,isBasenameHit:e>=s+1})}return n.sort(tu),n.map(({path:e,matchStart:t,matchEnd:s})=>({path:e,matchStart:t,matchEnd:s}))}(e.listing.files,r):[];i+=u.length,(u.length>0||g||c)&&s.push({entry:t,matches:u,truncated:c,error:g})}return{groups:s,totalMatches:i,isLoading:a,isUnsupported:e.length>0&&l===e.length,error:o}},[e,n,r,t])}({entries:e,lister:n,query:l}),b=(0,s.useMemo)(()=>{let e=[];for(let t of p)for(let s of t.matches){if(e.length>=200)return e;e.push({entryId:t.entry.id,entry:t.entry,match:s})}return e},[p]);(0,s.useEffect)(()=>{u(-1)},[l]),(0,s.useEffect)(()=>{d.current?.focus()},[]),(0,s.useEffect)(()=>{if(c<0)return;let e="u">typeof document?document.getElementById(h(c)):null;e?.scrollIntoView?.({block:"nearest"})},[c,h]);let j=(0,s.useCallback)(e=>{if("ArrowDown"===e.key)e.preventDefault(),u(e=>e<b.length-1?e+1:e);else if("ArrowUp"===e.key)e.preventDefault(),u(e=>e>0?e-1:-1);else if("Enter"===e.key){e.preventDefault();let t=b[c];t&&i(t.entryId,t.match.path)}},[b,c,i]),y=l.trim(),k=p.length>1,w=v||0===y.length?"":x&&0===f&&0===p.length?"Searching files…":0===p.length?`No files matching ${y}.`:f>b.length?`Showing the first ${b.length} of ${f} matching files.`:`${b.length} matching ${1===b.length?"file":"files"}.`;return(0,t.jsxs)("div",{className:(0,r.cn)("stg:flex stg:h-full stg:flex-col",o),children:[(0,t.jsx)("div",{role:"status","aria-live":"polite",className:"stg:sr-only",children:w}),(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-1.5 stg:border-b stg:border-border stg:px-2 stg:py-1.5",children:[(0,t.jsx)(tb,{}),(0,t.jsx)("input",{ref:d,type:"text",role:"combobox","aria-expanded":!0,"aria-controls":m,"aria-activedescendant":c>=0?h(c):void 0,value:l,onChange:e=>g(e.target.value),onKeyDown:j,placeholder:"Search files by name…",disabled:v,className:(0,r.cn)("stg:min-w-0 stg:flex-1 stg:bg-transparent stg:text-xs stg:text-foreground","stg:placeholder:text-muted-foreground","stg:focus-visible:outline-none stg:disabled:cursor-not-allowed"),"aria-label":"Search workspace files by name"}),y.length>0&&(0,t.jsx)("button",{type:"button",onClick:()=>{g(""),d.current?.focus()},className:"stg:shrink-0 stg:text-muted-foreground stg:transition-colors stg:hover:text-foreground","aria-label":"Clear search",children:(0,t.jsx)(tj,{})})]}),(0,t.jsx)("div",{className:"stg:min-h-0 stg:flex-1 stg:overflow-y-auto",children:v?(0,t.jsx)(tv,{children:"File search isn’t available here."}):0===y.length?(0,t.jsx)(tv,{children:"Search files by name across the whole workspace."}):x&&0===f&&0===p.length?(0,t.jsx)(tv,{children:"Searching…"}):0===p.length?(0,t.jsxs)(tv,{children:["No files matching “",y,"”."]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("ul",{id:m,role:"listbox","aria-label":"Search results",className:(0,r.cn)(el.UNSTYLED_LIST,"stg:py-0.5"),children:function({groups:e,showGroupHeaders:s,selectedFile:r,focusIndex:n,optionId:i,onOpenFile:a}){let o=[],l=0;for(let g of e){for(let e of(s&&o.push((0,t.jsx)(tf,{name:g.entry.name},`h:${g.entry.id}`)),g.matches)){if(l>=200)break;let s=l++,c=r?.entryId===g.entry.id&&r.path===e.path;o.push((0,t.jsx)(th,{id:i(s),match:e,isFocused:s===n,isOpen:c,onOpen:()=>a(g.entry.id,e.path)},`${g.entry.id}:${e.path}`))}if(g.truncated&&o.push((0,t.jsx)(tx,{children:"Partial listing — too many files to search in full."},`t:${g.entry.id}`)),g.error&&o.push((0,t.jsxs)(tx,{isError:!0,children:["Couldn’t list files: ",g.error.message]},`e:${g.entry.id}`)),l>=200)break}return o}({groups:p,showGroupHeaders:k,selectedFile:a??null,focusIndex:c,optionId:h,onOpenFile:i})}),f>b.length&&(0,t.jsxs)("p",{className:"stg:border-t stg:border-border stg:px-3 stg:py-1.5 stg:text-[0.65rem] stg:text-muted-foreground",children:["Showing the first ",b.length," of ",f," matches — refine your search to narrow the list."]})]})})]})}function th({id:e,match:s,isFocused:n,isOpen:i,onOpen:a}){let o=s.path.lastIndexOf("/"),l=s.path.slice(o+1),g=o>=0?s.path.slice(0,o):"";return(0,t.jsxs)("li",{id:e,role:"option","aria-selected":n,"aria-current":i?"true":void 0,onClick:a,className:(0,r.cn)("stg:flex stg:cursor-pointer stg:items-baseline stg:gap-1.5 stg:px-3 stg:py-1 stg:text-xs stg:transition-colors",n&&"stg:bg-muted",i&&"stg:bg-muted stg:font-medium stg:text-foreground",!n&&!i&&"stg:hover:bg-muted"),children:[(0,t.jsx)("span",{className:"stg:truncate stg:text-foreground",children:(0,t.jsx)(tp,{text:l,offset:o+1,matchStart:s.matchStart,matchEnd:s.matchEnd})}),g&&(0,t.jsx)("span",{className:"stg:truncate stg:text-[0.65rem] stg:text-muted-foreground",children:(0,t.jsx)(tp,{text:g,offset:0,matchStart:s.matchStart,matchEnd:s.matchEnd})})]})}function tp({text:e,offset:s,matchStart:r,matchEnd:n}){let i=Math.max(0,r-s),a=Math.min(e.length,n-s);return i>=a?(0,t.jsx)(t.Fragment,{children:e}):(0,t.jsxs)(t.Fragment,{children:[e.slice(0,i),(0,t.jsx)("span",{className:"stg:font-semibold stg:text-foreground",children:e.slice(i,a)}),e.slice(a)]})}function tf({name:e}){return(0,t.jsx)("li",{role:"presentation",className:"stg:truncate stg:px-3 stg:pb-0.5 stg:pt-2 stg:text-[0.6rem] stg:font-medium stg:uppercase stg:tracking-wide stg:text-muted-foreground",children:e})}function tx({children:e,isError:s}){return(0,t.jsx)("li",{role:"presentation",className:(0,r.cn)("stg:px-3 stg:py-1 stg:text-[0.65rem]",s?"stg:text-destructive":"stg:text-muted-foreground"),children:e})}function tv({children:e}){return(0,t.jsx)("div",{className:"stg:flex stg:h-full stg:items-center stg:justify-center stg:p-8 stg:text-center stg:text-xs stg:text-muted-foreground",children:e})}function tb(){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",className:"stg:shrink-0 stg:text-muted-foreground","aria-hidden":"true",children:[(0,t.jsx)("circle",{cx:"5.25",cy:"5.25",r:"3.5"}),(0,t.jsx)("path",{d:"M7.75 7.75L10.5 10.5"})]})}function tj(){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:"M3 3L9 9M9 3L3 9"})})}let ty=[];function tk({entries:e,searcher:n,onOpenFile:i,selectedFile:a,className:o}){let[l,g]=(0,s.useState)(""),[c,u]=(0,s.useState)(-1),d=(0,s.useRef)(null),m=(0,s.useId)(),h=(0,s.useCallback)(e=>`${m}-opt-${e}`,[m]),{groups:p,totalMatches:f,isLoading:x,isRefetching:v,isUnsupported:b}=function({entries:e,searcher:t,query:r,debounceMs:n=300,minLength:i=2}){let[a,o]=(0,s.useState)({}),[l,g]=(0,s.useState)(!1),[c,u]=(0,s.useState)(r);(0,s.useEffect)(()=>{let e=setTimeout(()=>u(r),n);return()=>clearTimeout(e)},[r,n]);let d=(0,s.useRef)(e);d.current=e;let m=e.map(e=>e.id).join("\0"),h=(0,s.useRef)(0),p=c.trim(),f=p.length<i;return(0,s.useEffect)(()=>{if(!t||f){h.current+=1,o({}),g(!1);return}let e=d.current,s=++h.current;g(!0),Promise.all(e.map(async e=>{try{let s=await t(e,p);if(null===s)return[e.id,{status:"unsupported"}];return[e.id,{status:"ready",matches:s.matches,truncated:s.truncated}]}catch(t){return[e.id,{status:"error",error:(0,Z.toError)(t)}]}})).then(e=>{if(h.current!==s)return;let t={};for(let[s,r]of e)t[s]=r;o(t),g(!1)})},[m,t,p,f]),(0,s.useMemo)(()=>{if(!t)return{groups:ty,totalMatches:0,isLoading:!1,isRefetching:!1,isUnsupported:!0,error:null};let s=[],r=0,n=null,i=0,o=0;for(let t of e){let e=a[t.id];if(e){if(o+=1,"unsupported"===e.status){i+=1;continue}if("error"===e.status){n||(n=e.error),s.push({entry:t,matches:[],truncated:!1,error:e.error});continue}r+=e.matches.length,(e.matches.length>0||e.truncated)&&s.push({entry:t,matches:e.matches,truncated:e.truncated,error:null})}}let g=o>0;return{groups:s,totalMatches:r,isLoading:l&&!g,isRefetching:l&&g,isUnsupported:e.length>0&&i===e.length,error:n}},[e,a,l,t])}({entries:e,searcher:n,query:l,minLength:2}),j=(0,s.useMemo)(()=>{let e=[];for(let t of p)for(let s of t.matches){if(e.length>=200)return e;e.push({entryId:t.entry.id,match:s})}return e},[p]);(0,s.useEffect)(()=>{u(-1)},[l]),(0,s.useEffect)(()=>{d.current?.focus()},[]),(0,s.useEffect)(()=>{if(c<0)return;let e="u">typeof document?document.getElementById(h(c)):null;e?.scrollIntoView?.({block:"nearest"})},[c,h]);let y=(0,s.useCallback)(e=>{if("ArrowDown"===e.key)e.preventDefault(),u(e=>e<j.length-1?e+1:e);else if("ArrowUp"===e.key)e.preventDefault(),u(e=>e>0?e-1:-1);else if("Enter"===e.key){e.preventDefault();let t=j[c];t&&i(t.entryId,t.match.path,{line:t.match.line})}},[j,c,i]),k=l.trim(),w=k.length>0&&k.length<2,S=p.length>1,N=b||0===k.length?"":w?"Type at least 2 characters to search.":x?"Searching file contents…":0===p.length?`No files containing ${k}.`:f>j.length?`Showing the first ${j.length} of ${f} matches.`:`${f} ${1===f?"match":"matches"}.`;return(0,t.jsxs)("div",{className:(0,r.cn)("stg:flex stg:h-full stg:flex-col",o),children:[(0,t.jsx)("div",{role:"status","aria-live":"polite",className:"stg:sr-only",children:N}),(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-1.5 stg:border-b stg:border-border stg:px-2 stg:py-1.5",children:[(0,t.jsx)(tA,{}),(0,t.jsx)("input",{ref:d,type:"text",role:"combobox","aria-expanded":!0,"aria-controls":m,"aria-activedescendant":c>=0?h(c):void 0,value:l,onChange:e=>g(e.target.value),onKeyDown:y,placeholder:"Search text in files…",disabled:b,className:(0,r.cn)("stg:min-w-0 stg:flex-1 stg:bg-transparent stg:text-xs stg:text-foreground","stg:placeholder:text-muted-foreground","stg:focus-visible:outline-none stg:disabled:cursor-not-allowed"),"aria-label":"Search text in workspace files"}),v&&(0,t.jsx)(tM,{}),k.length>0&&(0,t.jsx)("button",{type:"button",onClick:()=>{g(""),d.current?.focus()},className:"stg:shrink-0 stg:text-muted-foreground stg:transition-colors stg:hover:text-foreground","aria-label":"Clear search",children:(0,t.jsx)(tT,{})})]}),(0,t.jsx)("div",{className:"stg:min-h-0 stg:flex-1 stg:overflow-y-auto",children:b?(0,t.jsx)(tR,{children:"Text search isn’t available here."}):0===k.length?(0,t.jsx)(tR,{children:"Search file contents across the whole workspace."}):w?(0,t.jsxs)(tR,{children:["Type at least ",2," characters to search."]}):x?(0,t.jsx)(tR,{children:"Searching…"}):0===p.length?(0,t.jsxs)(tR,{children:["No files containing “",k,"”."]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("ul",{id:m,role:"listbox","aria-label":"Search results",className:(0,r.cn)(el.UNSTYLED_LIST,"stg:py-0.5"),children:function({groups:e,query:s,showEntryHeaders:r,selectedFile:n,focusIndex:i,optionId:a,onOpenFile:o}){let l=[],g=0;for(let c of e){r&&l.push((0,t.jsx)(tN,{name:c.entry.name},`entry:${c.entry.id}`));let e=null;for(let r of c.matches){if(g>=200)break;r.path!==e&&(e=r.path,l.push((0,t.jsx)(tC,{path:r.path},`file:${c.entry.id}:${r.path}`)));let u=g++,d=n?.entryId===c.entry.id&&n.path===r.path;l.push((0,t.jsx)(tw,{id:a(u),match:r,query:s,isFocused:u===i,isOpen:d,onOpen:()=>o(c.entry.id,r.path,{line:r.line})},`line:${c.entry.id}:${r.path}:${r.line}`))}if(c.truncated&&l.push((0,t.jsx)(tE,{children:"Partial results — more matches exist than shown for this workspace."},`t:${c.entry.id}`)),c.error&&l.push((0,t.jsxs)(tE,{isError:!0,children:["Couldn’t search: ",c.error.message]},`e:${c.entry.id}`)),g>=200)break}return l}({groups:p,query:k,showEntryHeaders:S,selectedFile:a??null,focusIndex:c,optionId:h,onOpenFile:i})}),f>j.length&&(0,t.jsxs)("p",{className:"stg:border-t stg:border-border stg:px-3 stg:py-1.5 stg:text-[0.65rem] stg:text-muted-foreground",children:["Showing the first ",j.length," of ",f," matches — refine your search to narrow the list."]})]})})]})}function tw({id:e,match:s,query:n,isFocused:i,isOpen:a,onOpen:o}){return(0,t.jsxs)("li",{id:e,role:"option","aria-selected":i,"aria-current":a?"true":void 0,onClick:o,className:(0,r.cn)("stg:flex stg:cursor-pointer stg:items-baseline stg:gap-2 stg:py-0.5 stg:pl-6 stg:pr-3 stg:text-xs stg:transition-colors",i&&"stg:bg-muted",a&&"stg:bg-muted",!i&&!a&&"stg:hover:bg-muted"),children:[(0,t.jsx)("span",{className:"stg:w-8 stg:shrink-0 stg:text-right stg:font-mono stg:text-[0.65rem] stg:tabular-nums stg:text-muted-foreground-subtle",children:s.line}),(0,t.jsx)("span",{className:"stg:min-w-0 stg:flex-1 stg:truncate stg:font-mono stg:text-muted-foreground",children:(0,t.jsx)(tS,{text:s.preview,query:n})})]})}function tS({text:e,query:s}){let r=function(e,t){let s=t.trim().toLowerCase();if(0===s.length)return[];let r=e.toLowerCase(),n=[],i=0;for(;;){let e=r.indexOf(s,i);if(-1===e)break;let t=e+s.length;n.push({start:e,end:t}),i=t}return n}(e,s);if(0===r.length)return(0,t.jsx)(t.Fragment,{children:e});let n=[],i=0;return r.forEach((s,r)=>{s.start>i&&n.push(e.slice(i,s.start)),n.push((0,t.jsx)("span",{className:"stg:font-semibold stg:text-foreground",children:e.slice(s.start,s.end)},r)),i=s.end}),i<e.length&&n.push(e.slice(i)),(0,t.jsx)(t.Fragment,{children:n})}function tN({name:e}){return(0,t.jsx)("li",{role:"presentation",className:"stg:truncate stg:px-3 stg:pb-0.5 stg:pt-2 stg:text-[0.6rem] stg:font-medium stg:uppercase stg:tracking-wide stg:text-muted-foreground",children:e})}function tC({path:e}){let s=e.lastIndexOf("/"),r=s>=0?e.slice(s+1):e,n=s>=0?e.slice(0,s):"";return(0,t.jsxs)("li",{role:"presentation",className:"stg:flex stg:items-baseline stg:gap-1.5 stg:px-3 stg:pb-0.5 stg:pt-1.5 stg:text-xs",children:[(0,t.jsx)("span",{className:"stg:shrink-0 stg:font-medium stg:text-foreground",children:r}),n&&(0,t.jsx)("span",{className:"stg:truncate stg:text-[0.65rem] stg:text-muted-foreground",children:n})]})}function tE({children:e,isError:s}){return(0,t.jsx)("li",{role:"presentation",className:(0,r.cn)("stg:px-3 stg:py-1 stg:text-[0.65rem]",s?"stg:text-destructive":"stg:text-muted-foreground"),children:e})}function tR({children:e}){return(0,t.jsx)("div",{className:"stg:flex stg:h-full stg:items-center stg:justify-center stg:p-8 stg:text-center stg:text-xs stg:text-muted-foreground",children:e})}function tA(){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",className:"stg:shrink-0 stg:text-muted-foreground","aria-hidden":"true",children:[(0,t.jsx)("circle",{cx:"5.25",cy:"5.25",r:"3.5"}),(0,t.jsx)("path",{d:"M7.75 7.75L10.5 10.5"})]})}function tT(){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:"M3 3L9 9M9 3L3 9"})})}function tM(){return(0,t.jsx)("span",{"aria-hidden":"true",className:"stg:h-3 stg:w-3 stg:shrink-0 stg:animate-spin stg:rounded-full stg:border stg:border-muted-foreground stg:border-t-transparent"})}var tL=e.i(661438),tI=e.i(851624),tP=e.i(92649),tD=e.i(821354),tF=e.i(583093);let tO={content:null},tB={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",webp:"image/webp",avif:"image/avif",bmp:"image/bmp",ico:"image/x-icon"};function t$(e){let t=e.lastIndexOf(".");return -1===t?null:tB[e.slice(t+1).toLowerCase()]??null}class tV extends Error{constructor(e){super(`"${e}" doesn't exist at the workspace's current ref.`),this.name="WorkspaceFileNotFoundError"}}e.s(["MAX_WORKSPACE_FILE_READ_BYTES",0,1048576,"MAX_WORKSPACE_IMAGE_READ_BYTES",0,0xa00000,"WorkspaceFileNotFoundError",0,tV,"workspaceImageMimeType",0,t$],850429);let t_=[85,72,90,65,78,88,70,82],tU=(0,s.forwardRef)(function({selectedFile:e,entries:n,reader:i,change:a,reveal:o,onClose:l,showHeader:g=!0,className:c},u){let d=n.find(t=>t.id===e.entryId)??null,m=e.path,{content:h,isLoading:p,error:f,isUnsupported:x,refetch:v}=function({entry:e,path:t,reader:r}){let n=!!(r&&e&&t),{data:i,isLoading:a,isRefetching:o,error:l,refetch:g}=(0,tF.useFetch)(n?()=>r(e,t).then(e=>({content:e})):null,[e?.id??null,e?.readRef??null,t??null,r],tO),c=!r||n&&!a&&!l&&null===i.content;return(0,s.useMemo)(()=>({content:i.content,isLoading:a,isRefetching:o,error:l,isUnsupported:c,refetch:g}),[i.content,a,o,l,c,g])}({entry:d,path:m,reader:i});(0,s.useImperativeHandle)(u,()=>({refresh:v}),[v]);let b=void 0!==i&&a?.changeType!==tL.FileChangeType.DELETE,j=void 0!==a&&b,[y,k]=(0,s.useState)(o?"file":void 0!==a?"diff":"file");(0,s.useEffect)(()=>{o&&k("file")},[o?.nonce]);let w=a?b?y:"diff":"file",S=(0,s.useCallback)(e=>{"Escape"===e.key&&l&&(e.stopPropagation(),l())},[l]),N=m.lastIndexOf("/"),C=N>=0?m.slice(N+1):m,E=N>=0?m.slice(0,N):"";return d?(0,t.jsxs)("div",{role:"region","aria-label":"File viewer",tabIndex:-1,className:(0,r.cn)("stg:flex stg:h-full stg:flex-col stg:focus:outline-none",c),onKeyDown:S,children:[g&&(0,t.jsx)(tY,{basename:C,dir:E,onRefresh:"file"!==w||x?void 0:v,onClose:l}),j&&(0,t.jsx)(tW,{value:y,onChange:k}),(0,t.jsx)("div",{className:"stg:min-h-0 stg:flex-1 stg:overflow-y-auto",children:"diff"===w&&a?(0,t.jsx)("div",{className:"stg:p-3",children:(0,t.jsx)(tP.FileChangeDiff,{change:a,showFileName:!1,showStats:!0})}):(0,t.jsx)(tz,{basename:C,content:h,isLoading:p,isUnsupported:x,error:f,onRetry:v,reveal:o,change:a})})]}):(0,t.jsxs)("div",{role:"region","aria-label":"File viewer",className:(0,r.cn)("stg:flex stg:h-full stg:flex-col",c),onKeyDown:S,children:[g&&(0,t.jsx)(tY,{basename:C,dir:E,onRefresh:void 0,onClose:l}),(0,t.jsx)("div",{className:"stg:flex stg:flex-1 stg:items-center stg:justify-center stg:p-8 stg:text-center stg:text-xs stg:text-muted-foreground",children:"This file is no longer in the workspace."})]})});function tW({value:e,onChange:n}){let i=(0,s.useRef)([]),a=(0,s.useCallback)(e=>{n(e),i.current[+("diff"!==e)]?.focus()},[n]),o=(0,s.useCallback)(e=>{"ArrowRight"===e.key||"ArrowDown"===e.key?(e.preventDefault(),a("file")):("ArrowLeft"===e.key||"ArrowUp"===e.key)&&(e.preventDefault(),a("diff"))},[a]);return(0,t.jsx)("div",{className:"stg:border-b stg:border-border stg:px-3 stg:py-1.5",children:(0,t.jsx)("div",{role:"radiogroup","aria-label":"File view",className:"stg:inline-flex stg:rounded-md stg:bg-muted stg:p-0.5",children:[{value:"diff",label:"Diff"},{value:"file",label:"File"}].map((s,a)=>{let l=e===s.value;return(0,t.jsx)("button",{ref:e=>{i.current[a]=e},type:"button",role:"radio","aria-checked":l,tabIndex:l?0:-1,onClick:()=>n(s.value),onKeyDown:o,className:(0,r.cn)("stg:inline-flex stg:cursor-pointer stg:items-center stg:rounded-sm stg:px-2 stg:py-0.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",l?"stg:bg-background stg:text-foreground stg:shadow-sm":"stg:text-muted-foreground stg:hover:text-foreground"),children:s.label},s.value)})})})}function tz({basename:e,content:s,isLoading:r,isUnsupported:n,error:i,onRetry:a,reveal:o,change:l}){var g;let c=i instanceof tV;if((n||c)&&void 0!==(g=l)&&g.changeType!==tL.FileChangeType.DELETE&&g.captureLevel!==tL.FileChangeCaptureLevel.HUNK_ONLY&&void 0!==g.after)return(0,t.jsx)(tH,{change:l,basename:e,reveal:o});if(n)return(0,t.jsx)(tG,{children:"Preview isn’t available for this file here."});if(r)return(0,t.jsx)(tq,{});if(c)return(0,t.jsxs)("div",{className:"stg:flex stg:flex-col stg:items-center stg:justify-center stg:gap-2 stg:p-8 stg:text-center",children:[(0,t.jsx)("p",{className:"stg:text-xs stg:text-muted-foreground",children:"This file isn’t available in the workspace source yet. The agent’s latest changes may still be syncing."}),(0,t.jsx)("button",{type:"button",onClick:a,className:"stg:text-xs stg:font-medium stg:text-foreground stg:underline stg:underline-offset-2 stg:hover:text-muted-foreground stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring stg:focus-visible:rounded-sm",children:"Check again"})]});if(i)return(0,t.jsxs)("div",{className:"stg:flex stg:flex-col stg:items-center stg:justify-center stg:gap-2 stg:p-8 stg:text-center",children:[(0,t.jsx)(t0,{}),(0,t.jsx)("p",{className:"stg:text-sm stg:text-destructive",children:i.message}),(0,t.jsx)("button",{type:"button",onClick:a,className:"stg:text-xs stg:font-medium stg:text-foreground stg:underline stg:underline-offset-2 stg:hover:text-muted-foreground stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring stg:focus-visible:rounded-sm",children:"Retry"})]});if(!s)return(0,t.jsx)(tG,{children:"Content not available for preview."});let u=t$(e);return s.bytes&&u?(0,t.jsx)(tK,{bytes:s.bytes,mime:u,basename:e,size:s.size,change:l}):s.isBinary?(0,t.jsxs)(tG,{children:["Binary file — not shown",s.size?` (${tJ(s.size)})`:"","."]}):null===s.text&&s.truncated?(0,t.jsxs)(tG,{children:["This file is too large to preview",s.size?` (${tJ(s.size)})`:"","."]}):null===s.text?(0,t.jsx)(tG,{children:"This file can’t be displayed as text."}):(0,t.jsxs)(t.Fragment,{children:[l&&(0,t.jsx)("p",{className:"stg:border-b stg:border-border-muted stg:px-4 stg:py-1.5 stg:text-[0.65rem] stg:text-muted-foreground",children:"Live — may differ from the reviewed change."}),(0,t.jsx)(tI.ArtifactContentRenderer,{content:s.text,fileName:e,isTruncated:s.truncated,reveal:o})]})}function tK({bytes:e,mime:n,basename:i,size:a,change:o}){let l=eO((0,s.useMemo)(()=>new Blob([e],{type:n}),[e,n])),[g,c]=(0,s.useState)(!1),[u,d]=(0,s.useState)(!1);return g?(0,t.jsxs)(tG,{children:["Binary file — not shown",a?` (${tJ(a)})`:"","."]}):(0,t.jsxs)(t.Fragment,{children:[o&&(0,t.jsx)("p",{className:"stg:border-b stg:border-border-muted stg:px-4 stg:py-1.5 stg:text-[0.65rem] stg:text-muted-foreground",children:"Live — may differ from the reviewed change."}),(0,t.jsxs)("div",{className:"stg:flex stg:flex-col stg:items-center stg:gap-2 stg:p-4",children:[l?(0,t.jsx)("button",{type:"button",onClick:()=>d(!0),"aria-label":`Preview ${i} at full size`,className:(0,r.cn)(e$.UNSTYLED_BUTTON,"stg:max-w-full stg:rounded-md stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring"),children:(0,t.jsx)("img",{src:l,alt:i,onError:()=>c(!0),className:"stg:max-h-[70vh] stg:max-w-full stg:rounded-md stg:border stg:border-border stg:object-contain"})}):(0,t.jsx)("div",{className:"stg:h-48 stg:w-72 stg:max-w-full stg:animate-pulse stg:rounded-md stg:bg-muted","aria-hidden":"true"}),(0,t.jsxs)("p",{className:"stg:text-[0.65rem] stg:tabular-nums stg:text-muted-foreground",children:[n,a?` \xb7 ${tJ(a)}`:""]})]}),(0,t.jsx)(eB.AttachmentImageLightbox,{src:l,filename:i,open:u,onClose:()=>d(!1)})]})}function tH({change:e,basename:s,reveal:r}){let{afterText:n,isBinary:i,isLoading:a,error:o}=(0,tD.useFileChangeContent)(e);return a?(0,t.jsx)(tq,{}):i?(0,t.jsx)(tG,{children:"Binary file — not shown."}):o||null===n?(0,t.jsx)(tG,{children:"Content not available for preview."}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{className:"stg:border-b stg:border-border-muted stg:px-4 stg:py-1.5 stg:text-[0.65rem] stg:text-muted-foreground",children:"As of the agent’s last change — not yet in the workspace source."}),(0,t.jsx)(tI.ArtifactContentRenderer,{content:n,fileName:s,reveal:r})]})}function tq(){return(0,t.jsx)("div",{role:"status",className:"stg:space-y-2 stg:p-4","aria-busy":"true","aria-label":"Loading file",children:t_.map((e,s)=>(0,t.jsx)("div",{className:"stg:h-4 stg:animate-pulse stg:rounded stg:bg-muted",style:{width:`${e}%`},"aria-hidden":"true"},s))})}function tY({basename:e,dir:s,onRefresh:r,onClose:n}){return(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-2 stg:border-b stg:border-border stg:px-3 stg:py-2",children:[(0,t.jsx)(tX,{}),(0,t.jsxs)("div",{className:"stg:flex stg:min-w-0 stg:flex-1 stg:items-baseline stg:gap-1.5",children:[(0,t.jsxs)(a.Tooltip,{children:[(0,t.jsx)(a.TooltipTrigger,{render:(0,t.jsx)("span",{className:"stg:truncate stg:text-xs stg:font-semibold stg:text-foreground"}),children:e}),(0,t.jsx)(a.TooltipContent,{side:"top",className:"stg:break-all",children:s?`${s}/${e}`:e})]}),s&&(0,t.jsx)("span",{className:"stg:truncate stg:text-[0.65rem] stg:text-muted-foreground",children:s})]}),r&&(0,t.jsx)("button",{type:"button",onClick:r,"aria-label":`Reload ${e}`,className:"stg:shrink-0 stg:rounded stg:p-0.5 stg:text-muted-foreground stg:transition-colors stg:hover:text-foreground stg:focus-visible:outline-none stg:focus-visible:ring-1 stg:focus-visible:ring-ring",children:(0,t.jsx)(tQ,{})}),n&&(0,t.jsx)("button",{type:"button",onClick:n,"aria-label":"Close file viewer",className:"stg:shrink-0 stg:rounded stg:p-0.5 stg:text-muted-foreground stg:transition-colors stg:hover:text-foreground stg:focus-visible:outline-none stg:focus-visible:ring-1 stg:focus-visible:ring-ring",children:(0,t.jsx)(tZ,{})})]})}function tG({children:e}){return(0,t.jsx)("div",{className:"stg:flex stg:h-full stg:items-center stg:justify-center stg:p-8 stg:text-center stg:text-xs stg:text-muted-foreground",children:e})}function tJ(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`}function tX(){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:"M9.5 1.5H5C4.17 1.5 3.5 2.17 3.5 3V13C3.5 13.83 4.17 14.5 5 14.5H11C11.83 14.5 12.5 13.83 12.5 13V4.5L9.5 1.5Z"}),(0,t.jsx)("path",{d:"M9.5 1.5V4.5H12.5"})]})}function tZ(){return(0,t.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M3 3L11 11"}),(0,t.jsx)("path",{d:"M11 3L3 11"})]})}function tQ(){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","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M1.5 6a4.5 4.5 0 017.794-3.073M10.5 6a4.5 4.5 0 01-7.794 3.073"}),(0,t.jsx)("path",{d:"M9.5 1v2.5H7M2.5 11V8.5H5"})]})}function t0(){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:text-destructive","aria-hidden":"true",children:[(0,t.jsx)("circle",{cx:"8",cy:"8",r:"6.5"}),(0,t.jsx)("path",{d:"M8 5.5V8.5"}),(0,t.jsx)("circle",{cx:"8",cy:"11",r:"0.5",fill:"currentColor",stroke:"none"})]})}function t1(e,t){return`${e}${encodeURIComponent(t)}`}function t5({editors:e,activeKey:n,onActivate:i,onPin:o,onClose:l,panelId:g,tabIdPrefix:c,className:u}){let d=(0,s.useCallback)((t,s)=>{let r=t+s;if(r<0||r>=e.length)return;let n=e[r];i(n.entryId,n.path)},[e,i]);return(0,t.jsx)(a.TooltipProvider,{children:(0,t.jsx)("div",{role:"tablist","aria-label":"Open editors","aria-orientation":"horizontal",className:(0,r.cn)("stg:flex stg:shrink-0 stg:items-stretch stg:overflow-x-auto stg:border-b stg:border-border",u),children:e.map((e,s)=>{let u=(0,ta.editorKey)(e.entryId,e.path),m=u===n,h=e.path.lastIndexOf("/"),p=h>=0?e.path.slice(h+1):e.path;return(0,t.jsxs)(a.Tooltip,{children:[(0,t.jsxs)(a.TooltipTrigger,{render:(0,t.jsx)("div",{role:"tab",id:c?t1(c,u):void 0,"aria-selected":m,"aria-controls":g,tabIndex:m?0:-1,onClick:()=>i(e.entryId,e.path),onDoubleClick:()=>o(e.entryId,e.path),onAuxClick:t=>{1===t.button&&(t.preventDefault(),l(e.entryId,e.path))},onKeyDown:t=>{"ArrowRight"===t.key?(t.preventDefault(),d(s,1)):"ArrowLeft"===t.key?(t.preventDefault(),d(s,-1)):"Enter"===t.key||" "===t.key?(t.preventDefault(),i(e.entryId,e.path)):("Delete"===t.key||"Backspace"===t.key)&&(t.preventDefault(),l(e.entryId,e.path))},className:(0,r.cn)("stg:group stg:flex stg:max-w-[12rem] stg:shrink-0 stg:cursor-pointer stg:items-center stg:gap-1.5 stg:border-r stg:border-border stg:px-3 stg:py-1.5 stg:text-xs stg:transition-colors","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-inset stg:focus-visible:ring-ring",m?"stg:bg-background stg:text-foreground":"stg:bg-muted-faint stg:text-muted-foreground stg:hover:bg-muted stg:hover:text-foreground")}),children:[(0,t.jsx)("span",{className:(0,r.cn)("stg:truncate",e.preview&&"stg:italic"),children:p}),(0,t.jsx)("span",{"aria-hidden":"true",onClick:t=>{t.stopPropagation(),l(e.entryId,e.path)},className:(0,r.cn)("stg:shrink-0 stg:cursor-pointer stg:rounded stg:p-0.5 stg:text-muted-foreground stg:transition-opacity stg:hover:bg-accent-hover stg:hover:text-foreground",m?"stg:opacity-100":"stg:opacity-0 stg:group-hover:opacity-100"),children:(0,t.jsx)(t2,{})})]}),(0,t.jsx)(a.TooltipContent,{side:"top",className:"stg:break-all",children:e.path})]},u)})})})}function t2(){return(0,t.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M3.5 3.5L10.5 10.5"}),(0,t.jsx)("path",{d:"M10.5 3.5L3.5 10.5"})]})}let t4=[];function t3({entries:e,lister:s,selectedFile:r,onOpenFile:n,onActivateFile:i,onRemoveEntry:a}){return(0,t.jsx)("div",{className:"stg:flex stg:flex-col",children:e.map((e,o)=>(0,t.jsx)(t6,{entry:e,lister:s,defaultExpanded:0===o,selectedPath:r?.entryId===e.id?r.path:void 0,onOpenFile:n,onActivateFile:i,onRemove:a},e.id))})}function t6({entry:e,lister:n,defaultExpanded:i,selectedPath:o,onOpenFile:l,onActivateFile:g,onRemove:c}){let[u,d]=(0,s.useState)(i),{tree:m,isLoading:h,error:p,truncated:f,refresh:x}=function({entry:e,lister:t}){let[r,n]=(0,s.useState)(!1),[i,a]=(0,s.useState)(null),[o,l]=(0,s.useState)(t4),[g,c]=(0,s.useState)(!1),u=(0,s.useRef)(0),d=(0,s.useCallback)(async(e,s)=>{if(!t)return;if(!s){let t=tl.get(tg(e));if(t){l(t.tree),c(t.truncated),a(null),n(!1);return}}let r=++u.current;n(!0),a(null);try{let i=await tc(e,t,{bustCache:s});if(u.current!==r)return;if(null===i){l(t4),c(!1),n(!1);return}l(i.tree),c(i.truncated),n(!1)}catch(e){if(u.current!==r)return;a((0,Z.toError)(e)),l(t4),c(!1),n(!1)}},[t]);(0,s.useEffect)(()=>{if(!e||!t){l(t4),c(!1),n(!1),a(null);return}d(e,!1)},[e,t,d]);let m=(0,s.useCallback)(()=>{e&&t&&d(e,!0)},[e,t,d]);return(0,s.useMemo)(()=>({tree:o,isLoading:r,error:i,truncated:g,refresh:m}),[o,r,i,g,m])}({entry:u?e:null,lister:n});return(0,t.jsxs)("div",{className:"stg:flex stg:flex-col",children:[(0,t.jsxs)("div",{className:"stg:group/root stg:flex stg:items-stretch",children:[(0,t.jsxs)(a.Tooltip,{children:[(0,t.jsxs)(a.TooltipTrigger,{render:(0,t.jsx)("button",{type:"button",onClick:()=>d(e=>!e),"aria-expanded":u,className:(0,r.cn)("stg:flex stg:min-w-0 stg:flex-1 stg:items-center stg:gap-1.5 stg:px-1.5 stg:py-1 stg:text-left stg:text-[0.7rem] stg:font-semibold stg:uppercase stg:tracking-wide stg:text-foreground stg:transition-colors stg:hover:bg-accent-hover","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",{"aria-hidden":"true",className:"stg:text-[10px] stg:text-muted-foreground-subtle",children:u?"▼":"▶"}),(0,t.jsx)("span",{className:"stg:truncate",children:e.name})]}),(0,t.jsx)(a.TooltipContent,{side:"top",className:"stg:break-all",children:"local"===e.type?e.localPath:e.gitUrl})]}),c&&(0,t.jsxs)(a.Tooltip,{children:[(0,t.jsx)(a.TooltipTrigger,{render:(0,t.jsx)("button",{type:"button",onClick:()=>c(e.id),"aria-label":`Remove ${e.name} from workspace`,className:(0,r.cn)("stg:shrink-0 stg:px-1.5 stg:text-muted-foreground stg:opacity-0 stg:transition-opacity","stg:group-hover/root:opacity-100 stg:focus-visible:opacity-100","stg:hover:text-destructive stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-inset stg:focus-visible:ring-ring")}),children:(0,t.jsx)(t7,{})}),(0,t.jsx)(a.TooltipContent,{side:"top",children:`Remove ${e.name} from workspace`})]})]}),u&&(0,t.jsx)(t8,{entryName:e.name,entryId:e.id,tree:m,isLoading:h,error:p,truncated:f,selectedPath:o,onOpenFile:l,onActivateFile:g,onRetry:x})]})}function t8({entryName:e,entryId:s,tree:n,isLoading:i,error:a,truncated:o,selectedPath:l,onOpenFile:g,onActivateFile:c,onRetry:u}){return i?(0,t.jsx)("div",{role:"status",className:"stg:space-y-1.5 stg:px-2 stg:py-2","aria-busy":"true","aria-label":`Loading files for ${e}`,children:[1,2,3,4].map(e=>(0,t.jsx)("div",{className:"stg:h-3.5 stg:animate-pulse stg:rounded stg:bg-muted",style:{width:`${50+10*e}%`},"aria-hidden":"true"},e))}):a?(0,t.jsxs)("div",{className:"stg:px-2 stg:py-2 stg:text-xs stg:text-destructive",children:["Failed to list files: ",a.message,(0,t.jsx)("button",{type:"button",onClick:u,className:"stg:ml-2 stg:rounded-sm stg:underline stg:transition-colors stg:hover:text-destructive stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring",children:"Retry"})]}):0===n.length?(0,t.jsx)("p",{className:"stg:px-3 stg:py-2 stg:text-xs stg:text-muted-foreground",children:"No files found."}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("nav",{"aria-label":`File tree for ${e}`,children:(0,t.jsx)("ul",{className:(0,r.cn)(el.UNSTYLED_LIST,"stg:py-0.5 stg:pl-1.5"),role:"tree",children:n.map(e=>(0,t.jsx)(e6.FileTreeNode,{node:e,selectedPath:l??"",onSelect:e=>g(s,e),onActivate:e=>c(s,e),depth:0,enableDrag:!0,showIcons:!0,indentGuides:!0,maxInitialDepth:0},e.path))})}),o&&(0,t.jsx)("p",{className:"stg:px-3 stg:py-1.5 stg:text-[0.65rem] stg:text-muted-foreground",children:"Showing a partial listing — too many files to load in full."})]})}function t7(){return(0,t.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M4 4L10 10M10 4L4 10"})})}let t9=["files","search"];function se({entries:e,lister:n,reader:i,searcher:a,view:o,onViewChange:l,builtInViews:g=t9,extraViews:c,virtualDocuments:u,onRemoveEntry:d,onAddLocalFolder:m,editors:h,selectedFile:p,onOpenFile:f,onActivateEditor:x,onPinEditor:v,onCloseEditor:b,onCollapse:j,change:y,reveal:k,className:w}){let[S,N]=(0,s.useState)("files"),C=o??S,E=(0,s.useCallback)(e=>{N(e),l?.(e)},[l]),R=g.includes(C)||(c?.some(e=>e.id===C)??!1),A=g[0]??c?.[0]?.id??"files",T=R?C:A,M=c?.find(e=>e.id===T);return(0,t.jsxs)("div",{className:(0,r.cn)("stg:flex stg:h-full stg:min-h-0",w),children:[(0,t.jsx)(st,{view:T,onViewChange:E,builtInViews:g,extraViews:c}),(0,t.jsx)(tr,{resizablePane:"primary",defaultSize:288,minSize:200,maxSize:560,storageKey:"stgm-workspace-sidebar-width",ariaLabel:"Resize sidebar",className:"stg:min-h-0 stg:min-w-0 stg:flex-1",primary:M?(0,t.jsx)(si,{view:M}):"search"===T?(0,t.jsx)(sr,{entries:e,lister:n,searcher:a,selectedFile:p,onOpenFile:f}):(0,t.jsx)(ss,{entries:e,lister:n,selectedFile:p,onOpenFile:f,onActivateFile:v,onRemoveEntry:d,onAddLocalFolder:m}),secondary:(0,t.jsx)(sa,{entries:e,reader:i,editors:h,selectedFile:p,virtualDocuments:u,change:y,reveal:k,onActivateEditor:x,onPinEditor:v,onCloseEditor:b,onCollapse:j})})]})}function st({view:e,onViewChange:n,builtInViews:i,extraViews:o}){let l=[...[{id:"files",label:"Explorer",icon:(0,t.jsx)(su,{})},{id:"search",label:"Search",icon:(0,t.jsx)(sd,{})}].filter(e=>i.includes(e.id)),...o??[]],g=(0,s.useRef)([]),c=(0,s.useCallback)((e,t)=>{let s=null;"ArrowDown"===e.key||"ArrowRight"===e.key?s=Math.min(t+1,l.length-1):"ArrowUp"===e.key||"ArrowLeft"===e.key?s=Math.max(t-1,0):"Home"===e.key?s=0:"End"===e.key&&(s=l.length-1),null!==s&&s!==t&&(e.preventDefault(),n(l[s].id),g.current[s]?.focus())},[l,n]);return(0,t.jsx)(a.TooltipProvider,{children:(0,t.jsx)("div",{role:"radiogroup","aria-label":"Workspace view","aria-orientation":"vertical",className:"stg:flex stg:w-11 stg:shrink-0 stg:flex-col stg:items-center stg:gap-1 stg:border-r stg:border-border stg:bg-muted-faint stg:py-2",children:l.map((s,i)=>{let o=e===s.id,l=null!=s.badge&&s.badge>0;return(0,t.jsxs)(a.Tooltip,{children:[(0,t.jsxs)(a.TooltipTrigger,{render:(0,t.jsx)("button",{ref:e=>{g.current[i]=e},type:"button",role:"radio","aria-checked":o,"aria-label":l?`${s.label} (${s.badge})`:s.label,tabIndex:o?0:-1,onClick:()=>n(s.id),onKeyDown:e=>c(e,i),className:(0,r.cn)("stg:relative stg:flex stg:h-9 stg:w-9 stg:items-center stg:justify-center stg:rounded-md stg:transition-colors","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring",o?"stg:bg-accent stg:text-foreground":"stg:text-muted-foreground stg:hover:bg-accent-hover stg:hover:text-foreground")}),children:[s.icon,l&&(0,t.jsx)("span",{"aria-hidden":"true",className:"stg:absolute stg:-right-0.5 stg:-top-0.5 stg:inline-flex stg:min-w-[0.875rem] stg:items-center stg:justify-center stg:rounded-full stg:bg-primary stg:px-1 stg:py-px stg:text-[9px] stg:font-medium stg:leading-none stg:text-primary-foreground",children:s.badge})]}),(0,t.jsx)(a.TooltipContent,{side:"right",children:s.label})]},s.id)})})})}function ss({entries:e,lister:s,selectedFile:r,onOpenFile:n,onActivateFile:i,onRemoveEntry:a,onAddLocalFolder:o}){return(0,t.jsxs)("div",{className:"stg:flex stg:h-full stg:min-h-0 stg:flex-col stg:border-r stg:border-border",children:[(0,t.jsx)(sg,{title:"Explorer"}),(0,t.jsx)("div",{className:"stg:min-h-0 stg:flex-1 stg:overflow-y-auto stg:py-1.5",children:s&&0!==e.length?(0,t.jsx)(t3,{entries:e,lister:s,selectedFile:r,onOpenFile:n,onActivateFile:i,onRemoveEntry:a}):(0,t.jsx)(sc,{children:"No workspace attached."})}),o&&(0,t.jsx)("div",{className:"stg:shrink-0 stg:border-t stg:border-border-muted stg:p-1.5",children:(0,t.jsxs)("button",{type:"button",onClick:o,className:"stg:flex stg:w-full stg:items-center stg:gap-2 stg:rounded-md stg:px-2 stg:py-1.5 stg:text-xs stg:text-foreground stg:transition-colors stg:hover:bg-accent-hover stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring",children:[(0,t.jsx)(sm,{}),(0,t.jsx)("span",{className:"stg:flex-1 stg:text-left",children:"Add Folder"})]})})]})}function sr({entries:e,lister:r,searcher:n,selectedFile:i,onOpenFile:a}){let[o,l]=(0,s.useState)("name");return(0,t.jsxs)("div",{className:"stg:flex stg:h-full stg:min-h-0 stg:flex-col stg:border-r stg:border-border",children:[(0,t.jsx)(sg,{title:"Search"}),n&&(0,t.jsx)(sn,{value:o,onChange:l}),n&&"text"===o?(0,t.jsx)(tk,{entries:e,searcher:n,onOpenFile:a,selectedFile:i,className:"stg:min-h-0 stg:flex-1"}):(0,t.jsx)(tm,{entries:e,lister:r,onOpenFile:a,selectedFile:i,className:"stg:min-h-0 stg:flex-1"})]})}function sn({value:e,onChange:n}){let i=(0,s.useRef)([]),a=(0,s.useCallback)(e=>{n(e),i.current[+("name"!==e)]?.focus()},[n]),o=(0,s.useCallback)(e=>{"ArrowRight"===e.key||"ArrowDown"===e.key?(e.preventDefault(),a("text")):("ArrowLeft"===e.key||"ArrowUp"===e.key)&&(e.preventDefault(),a("name"))},[a]);return(0,t.jsx)("div",{className:"stg:shrink-0 stg:border-b stg:border-border stg:px-2 stg:py-1.5",children:(0,t.jsx)("div",{role:"radiogroup","aria-label":"Search mode",className:"stg:inline-flex stg:rounded-md stg:bg-muted stg:p-0.5",children:[{value:"name",label:"Name"},{value:"text",label:"Text"}].map((s,a)=>{let l=e===s.value;return(0,t.jsx)("button",{ref:e=>{i.current[a]=e},type:"button",role:"radio","aria-checked":l,tabIndex:l?0:-1,onClick:()=>n(s.value),onKeyDown:o,className:(0,r.cn)("stg:rounded stg:px-2.5 stg:py-0.5 stg:text-[0.7rem] stg:font-medium stg:transition-colors","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring",l?"stg:bg-background stg:text-foreground stg:shadow-sm":"stg:text-muted-foreground stg:hover:text-foreground"),children:s.label},s.value)})})})}function si({view:e}){return e.fitted?(0,t.jsx)("div",{className:"stg:flex stg:h-full stg:min-h-0 stg:flex-col stg:border-r stg:border-border",children:e.content}):(0,t.jsxs)("div",{className:"stg:flex stg:h-full stg:min-h-0 stg:flex-col stg:border-r stg:border-border",children:[(0,t.jsx)(sg,{title:e.label}),(0,t.jsx)("div",{className:"stg:min-h-0 stg:flex-1 stg:overflow-y-auto stg:px-3 stg:py-3",children:e.content})]})}function sa({entries:e,reader:n,editors:i,selectedFile:o,virtualDocuments:l,change:g,reveal:c,onActivateEditor:u,onPinEditor:d,onCloseEditor:m,onCollapse:h}){let p=(0,s.useRef)(null),f=(0,s.useId)(),x=`${f}editor-panel`,v=`${f}editor-tab-`,b=o?(0,ta.editorKey)(o.entryId,o.path):null,j=null!==b?l?.find(e=>(0,ta.editorKey)(e.entryId,e.path)===b):void 0,y=o?e.find(e=>e.id===o.entryId)?.name:void 0;return(0,t.jsxs)("div",{className:"stg:flex stg:h-full stg:min-h-0 stg:flex-col",children:[(0,t.jsxs)("div",{className:(0,r.cn)(sl,"stg:flex stg:shrink-0 stg:items-stretch stg:border-b stg:border-border stg:pr-24"),children:[(0,t.jsxs)(a.Tooltip,{children:[(0,t.jsx)(a.TooltipTrigger,{render:(0,t.jsx)("button",{type:"button",onClick:h,"aria-label":"Back to chat",className:"stg:flex stg:shrink-0 stg:items-center stg:border-r stg:border-border stg:px-2 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-inset stg:focus-visible:ring-ring"}),children:(0,t.jsx)(sh,{})}),(0,t.jsx)(a.TooltipContent,{side:"top",children:"Back to chat"})]}),i.length>0&&(0,t.jsx)(t5,{editors:i,activeKey:b,onActivate:u,onPin:d,onClose:m,panelId:x,tabIdPrefix:v,className:"stg:min-w-0 stg:flex-1 stg:border-b-0"})]}),(0,t.jsx)("div",{className:"stg:flex stg:min-h-0 stg:min-w-0 stg:flex-1 stg:flex-col",...b?{role:"tabpanel",id:x,"aria-labelledby":t1(v,b)}:{},children:j?(0,t.jsx)("div",{className:"stg:min-h-0 stg:min-w-0 stg:flex-1 stg:overflow-y-auto stg:overflow-x-hidden",children:j.content},b??void 0):o?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(so,{entryName:y,path:o.path,onRefresh:n?()=>p.current?.refresh():void 0}),(0,t.jsx)(tU,{ref:p,selectedFile:o,entries:e,reader:n,change:g,reveal:c,onClose:h,showHeader:!1,className:"stg:min-h-0 stg:flex-1"},b??void 0)]}):(0,t.jsx)("div",{className:"stg:flex stg:flex-1 stg:items-center stg:justify-center stg:p-8 stg:text-center stg:text-xs stg:text-muted-foreground",children:"Select a file to view its contents."})})]})}function so({entryName:e,path:s,onRefresh:n}){let i=s.split("/").filter(Boolean),o=e?[e,...i]:i;return(0,t.jsxs)("div",{className:"stg:flex stg:shrink-0 stg:items-center stg:gap-1 stg:border-b stg:border-border-muted stg:px-3 stg:py-1 stg:text-[0.65rem] stg:text-muted-foreground",children:[(0,t.jsx)("nav",{"aria-label":"File location",className:"stg:flex stg:min-w-0 stg:flex-1 stg:items-center stg:gap-1",children:o.map((e,s)=>{let n=s===o.length-1;return(0,t.jsxs)("span",{className:"stg:flex stg:min-w-0 stg:items-center stg:gap-1",children:[s>0&&(0,t.jsx)("span",{className:"stg:text-muted-foreground-subtle","aria-hidden":"true",children:"›"}),(0,t.jsx)("span",{className:(0,r.cn)("stg:truncate",n&&"stg:text-foreground"),children:e})]},s)})}),n&&(0,t.jsxs)(a.Tooltip,{children:[(0,t.jsx)(a.TooltipTrigger,{render:(0,t.jsx)("button",{type:"button",onClick:n,"aria-label":"Reload file",className:"stg:shrink-0 stg:rounded stg:p-0.5 stg:text-muted-foreground stg:transition-colors stg:hover:text-foreground stg:focus-visible:outline-none stg:focus-visible:ring-1 stg:focus-visible:ring-ring"}),children:(0,t.jsx)(sp,{})}),(0,t.jsx)(a.TooltipContent,{side:"top",children:"Reload file"})]})]})}let sl="stg:h-8";function sg({title:e}){return(0,t.jsx)("div",{className:(0,r.cn)(sl,"stg:flex stg:shrink-0 stg:items-center stg:border-b stg:border-border stg:px-3 stg:text-[0.65rem] stg:font-semibold stg:uppercase stg:tracking-wide stg:text-muted-foreground"),children:e})}function sc({children:e}){return(0,t.jsx)("div",{className:"stg:px-2 stg:py-6 stg:text-center stg:text-xs stg:text-muted-foreground",children:e})}function su(){return(0,t.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M13 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),(0,t.jsx)("path",{d:"M13 3v5h5"})]})}function sd(){return(0,t.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,t.jsx)("circle",{cx:"11",cy:"11",r:"7"}),(0,t.jsx)("path",{d:"M21 21l-4.3-4.3"})]})}function sm(){return(0,t.jsxs)("svg",{width:"14",height:"14",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:"M1.5 3.5V11a1 1 0 001 1h9a1 1 0 001-1V5.5a1 1 0 00-1-1H7L5.5 3H2.5a1 1 0 00-1 .5z"}),(0,t.jsx)("path",{d:"M7 7v3M5.5 8.5h3"})]})}function sh(){return(0,t.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M10 3L5 8L10 13"})})}function sp(){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","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M1.5 6a4.5 4.5 0 017.794-3.073M10.5 6a4.5 4.5 0 01-7.794 3.073"}),(0,t.jsx)("path",{d:"M9.5 1v2.5H7M2.5 11V8.5H5"})]})}e.s(["WorkspaceSurface",0,se],603115);var sf=e.i(57674);function sx(e){let t=(0,X.useStigmer)(),r=(0,s.useRef)(0),n=e?async()=>{let s=await sv(()=>t.agent.getDefault((0,Y.create)(sf.GetDefaultAgentRequestSchema,{org:e})),1,1e3);return r.current=Date.now(),s}:null,{data:i,isLoading:a,isRefetching:o,error:l,refetch:g}=(0,tF.useFetch)(n,[e,t],null),c=(0,s.useRef)(null);(0,s.useEffect)(()=>{i&&c.current&&(c.current.resolve(i),c.current=null)},[i]),(0,s.useEffect)(()=>{l&&c.current&&(c.current.reject(l),c.current=null)},[l]);let u=(0,s.useCallback)(()=>{let e,t;return i?Promise.resolve(i):l?Promise.reject(l):(c.current||(c.current={promise:new Promise((s,r)=>{e=s,t=r}),resolve:e,reject:t}),c.current.promise)},[i,l]);return(0,s.useEffect)(()=>{if("u"<typeof document)return;let e=()=>{"visible"===document.visibilityState&&Date.now()-r.current>=3e4&&g()};return document.addEventListener("visibilitychange",e),()=>document.removeEventListener("visibilitychange",e)},[g]),{agent:i,isLoading:a,isRefetching:o,error:l,refetch:g,waitForResolution:u}}async function sv(e,t,s){try{return await e()}catch(r){if(t<=0)throw r;return await new Promise(e=>setTimeout(e,s)),sv(e,t-1,s)}}var sb=e.i(577660);let sj=0;function sy(){let[e,t]=(0,s.useState)([]),r=(0,s.useCallback)(()=>{t(e=>[...e,{id:`sv-${++sj}-${Date.now()}`,key:"",value:"",isSecret:!0,saveForFuture:!1}])},[]),n=(0,s.useCallback)(e=>{t(t=>t.filter(t=>t.id!==e))},[]),i=(0,s.useCallback)((e,s)=>{t(t=>t.map(t=>t.id===e?{...t,...s}:t))},[]),a=(0,s.useCallback)(()=>{t([])},[]),o=(0,s.useMemo)(()=>e.some(e=>""!==e.key.trim()&&""!==e.value.trim()),[e]),l=(0,s.useCallback)(()=>{let t={};for(let s of e){let e=s.key.trim();""!==e&&""!==s.value.trim()&&(t[e]={value:s.value,isSecret:s.isSecret})}return t},[e]),g=(0,s.useCallback)(()=>{let t={};for(let s of e){let e=s.key.trim();""!==e&&""!==s.value.trim()&&s.saveForFuture&&(t[e]={value:s.value,isSecret:s.isSecret})}return t},[e]),c=(0,s.useMemo)(()=>e.some(e=>e.saveForFuture&&""!==e.key.trim()&&""!==e.value.trim()),[e]),u=0===e.length;return(0,s.useMemo)(()=>({entries:e,addEntry:r,removeEntry:n,updateEntry:i,clear:a,isEmpty:u,hasValidEntries:o,toRuntimeEnv:l,toSaveForFutureEnv:g,hasSaveForFutureEntries:c}),[e,r,n,i,a,u,o,l,g,c])}var sk=e.i(28434),sw=e.i(433732),sS=e.i(891400),sN=e.i(205730);async function sC(e,t){let s=await e(),r={...t,...s};return Object.keys(r).length>0?r:void 0}function sE(e){if("fast"===e.serviceTier&&!e.modelName)throw Error('SessionRunConfig: serviceTier "fast" requires modelName — the fast tier is a per-model price and Auto (no pinned model) has no tier dimension. Pin the model the surface should run.');if("enabled"===e.thinkingMode&&!e.modelName)throw Error('SessionRunConfig: thinkingMode "enabled" requires modelName — thinking is a per-model capability and Auto (no pinned model) has no variant dimensions. Pin the model the surface should run.')}let sR="stigmer:session:harness";function sA(e){return"cursor"===e?"stigmer:session:model:cursor":"stigmer:session:model"}var sT=e.i(574803);let sM=(0,ta.virtualEntryId)("plan"),sL="Plan",sI=(0,ta.virtualEntryId)("artifact");function sP(e){return e.sandboxPath||e.name}function sD(e){return(0,s.useMemo)(()=>{let t=new Map;for(let s of e){let e=s.metadata?.id??"",r=s.status?.phase??tL.ExecutionPhase.EXECUTION_PHASE_UNSPECIFIED,n=(0,sT.isTerminalPhase)(r);for(let r of s.status?.artifacts??[]){let s=sP(r);t.set(s,{artifact:r,executionId:e,isTerminal:n,hasNameCollision:!1})}}let s=Array.from(t.values());s.sort((e,t)=>e.artifact.name.localeCompare(t.artifact.name,void 0,{sensitivity:"base"}));let r=new Map;for(let e of s){let t=e.artifact.name.toLowerCase();r.set(t,(r.get(t)??0)+1)}let n=s.map(e=>{let t=e.artifact.name.toLowerCase();return(r.get(t)??0)>1?{...e,hasNameCollision:!0}:e});return{artifacts:n,hasArtifacts:n.length>0,artifactCount:n.length}},[e])}function sF({phase:e,hasChanges:t,planKey:r=null,defaultView:n="files",open:i,defaultOpen:a=!1,onOpenChange:o}){let l=(0,ti.useWorkspaceEditorsStoreRef)(),g=void 0!==i,[c,u]=(0,s.useState)(a),d=g?i:c,m=(0,s.useRef)(o);m.current=o;let h=(0,s.useRef)(g);h.current=g;let p=(0,s.useRef)(d);p.current=d;let f=(0,s.useCallback)(e=>{p.current!==e&&(h.current||(p.current=e,u(e)),m.current?.(e))},[]),[x,v]=(0,s.useState)(n),b=(0,s.useRef)(!1),[j,y]=(0,s.useState)(e);if(e!==j){let t=null!==j&&(0,sT.isTerminalPhase)(j),s=null!==e&&(0,sT.isTerminalPhase)(e);y(e),t!==s&&(b.current=!1,v(n))}let[k,w]=(0,s.useState)(t);t!==k&&(w(t),t&&d&&!b.current&&v("changes"));let S=(0,s.useCallback)(()=>{l.openPinned(sM,sL),f(!0)},[l,f]),N=(0,s.useRef)(r);(0,s.useEffect)(()=>{r!==N.current&&(N.current=r,null!==r&&S())},[r,S]);let C=(0,s.useCallback)(()=>f(!0),[f]),E=(0,s.useCallback)(()=>f(!1),[f]),R=(0,s.useCallback)(e=>{b.current=!0,v(e)},[]),A=(0,s.useCallback)((e,t,s)=>{l.openPreview(e,t,s),f(!0)},[l,f]),T=(0,s.useCallback)(e=>{l.openPreview(sI,sP(e)),f(!0)},[l,f]),M=(0,s.useCallback)(e=>{l.pin(sI,sP(e))},[l]),L=(0,s.useCallback)((e,t)=>l.activate(e,t),[l]),I=(0,s.useCallback)((e,t)=>l.pin(e,t),[l]),P=(0,s.useCallback)((e,t)=>l.close(e,t),[l]);return(0,s.useMemo)(()=>({editorsStore:l,isOpen:d,view:x,openPanel:C,closePanel:E,setView:R,openFile:A,activateEditor:L,pinEditor:I,closeEditor:P,openPlanDocument:S,openArtifact:T,pinArtifact:M}),[l,d,x,C,E,R,A,L,I,P,S,T,M])}function sO(e){return(0,s.useMemo)(()=>{let t=new Map;for(let s of e){let e=s.metadata?.id??"";for(let r of s.status?.workspaceWriteBacks??[])t.set(r.workspaceEntryName,{writeBack:r,executionId:e})}let s=Array.from(t.values());return s.sort((e,t)=>e.writeBack.workspaceEntryName.localeCompare(t.writeBack.workspaceEntryName,void 0,{sensitivity:"base"})),{writeBacks:s,hasWriteBacks:s.length>0,writeBackCount:s.length}},[e])}e.s(["ARTIFACT_DOCUMENT_ENTRY_ID",0,sI],227989);var sB=e.i(174886),s$=e.i(475254);let sV=(0,s$.default)("file-braces",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1",key:"1oajmo"}],["path",{d:"M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1",key:"mpwhp6"}]]),s_=(0,s$.default)("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);var sU=e.i(934197),sW=e.i(414385),sz=e.i(311577),sK=e.i(400553),sH=e.i(155917),sq=e.i(445726);async function sY(e,t,s){let[r,n]=await Promise.all([e.session.get(t),e.agentExecution.listBySession((0,Y.create)(eT.ListAgentExecutionsBySessionRequestSchema,{sessionId:t}))]);if(n.totalPages>1)throw Error(`Session ${t} has ${n.totalPages} pages of executions but transcript export reads a single page. The server has started paginating listBySession; teach fetchSessionTranscript to walk pages before exporting, so no turns are silently dropped.`);let i=s?.resolveOutputs===!1?{}:await sG(e,n.entries,{concurrency:s?.concurrency});return function(e,t,s){let r=s?.includeSuperseded===!0,n=(0,sq.sortChronologically)(t),i=(0,sq.supersededExecutionIds)(n),a=[];for(let e of n){let t=i.has(e.metadata?.id??"");if(t&&!r)continue;let s=e.status?.phase;a.push({execution:e,userPrompt:(0,sq.syntheticUserPrompt)(e),isBuildFromPlan:(0,sq.isBuildFromPlanTurn)(e),superseded:t,inProgress:void 0===s||!(0,sT.isTerminalPhase)(s)})}return{session:e,turns:a,resolvedOutputs:s?.resolvedOutputs??{},includesSuperseded:r}}(r,n.entries,{includeSuperseded:s?.includeSuperseded,resolvedOutputs:i})}async function sG(e,t,s){let r=new Map;for(let e of t)for(let t of function*(e){if(e)for(let t of[e.messages,...e.subAgentExecutions.map(e=>e.messages)])for(let e of t)yield*e.toolCalls}(e.status)){let e=t.outputRef;e?.storageKey&&r.set(e.storageKey,e)}let n={},i=new TextDecoder("utf-8",{fatal:!1});return await sJ([...r.values()],s?.concurrency??4,async t=>{let s={storageKey:t.storageKey,mimeType:t.mimeType,isImage:t.isImage,totalSizeBytes:Number(t.sizeBytes)};if(t.isImage){n[t.storageKey]={...s,truncated:!1};return}let r=(0,sq.execIdFromStorageKey)(t.storageKey);if(!r){n[t.storageKey]={...s,truncated:!1,error:`unexpected storage key shape: ${t.storageKey}`};return}try{let a=await e.agentExecution.getArtifactContent((0,Y.create)(eT.GetArtifactContentRequestSchema,{executionId:r,storageKey:t.storageKey}));n[t.storageKey]={...s,content:i.decode(a.content),truncated:a.truncated,totalSizeBytes:Number(a.totalSizeBytes)}}catch(e){n[t.storageKey]={...s,truncated:!1,error:e instanceof Error?e.message:String(e)}}}),n}async function sJ(e,t,s){let r=0,n=Array.from({length:Math.max(1,Math.min(t,e.length))},async()=>{for(;r<e.length;){let t=e[r++];await s(t)}});await Promise.all(n)}function sX(e,t){let{session:s,turns:r,resolvedOutputs:n}=e,i=[],a=s.metadata?.id??"",o=(0,sH.resolvedSubject)(s.spec?.subject)??`Session ${a}`;i.push(`# ${o}`,""),i.push(`- Session: \`${a}\``);let l=s.spec?.agentInstanceId;l&&i.push(`- Agent instance: \`${l}\``),i.push(`- Turns: ${r.length}`),e.includesSuperseded&&i.push("- Includes superseded (edited-and-resubmitted) turns"),t?.generatedAt&&i.push(`- Exported: ${t.generatedAt}`);for(let e=0;e<r.length;e++){let t=r[e];i.push("","---",""),i.push(`## Turn ${e+1}${function(e){let t=e.execution.status?.startedAt;return t?` \xb7 ${t}`:""}(t)}`),t.superseded&&i.push("","_Superseded by an edited resubmission._"),t.inProgress&&i.push("","_In progress at export time — content is the last persisted snapshot._"),t.isBuildFromPlan&&i.push("","_Build from plan._"),null!==t.userPrompt&&i.push("","**User**","",t.userPrompt),function e(t,s,r,n,i){for(let a of s)switch(a.type){case tL.MessageType.MESSAGE_TOOL:continue;case tL.MessageType.MESSAGE_HUMAN:if(null!==i&&a.content===i)continue;t.push("","**User**","",a.content);continue;case tL.MessageType.MESSAGE_THINKING:t.push("","**Thinking**","",sQ(a.content));continue;case tL.MessageType.MESSAGE_SYSTEM:t.push("","**System**","",sQ(a.content));continue;case tL.MessageType.MESSAGE_AI:for(let s of(a.content.trim()&&t.push("","**Assistant**","",a.content),a.toolCalls)){if("task"===s.name){let i=r.find(e=>e.id===s.id);if(i){!function(t,s,r){let n=[],i=s.subject||s.name||"sub-agent";n.push(`**Sub-agent — ${i}**${function(e){let t=sZ(e.startedAt,e.completedAt);return t?` (${t})`:""}(s)}`),s.input&&n.push("","Input:","",s.input),e(n,s.messages,[],r,null),s.output&&n.push("","Output:","",s.output),s.error&&n.push("","Error:","",s0(s.error)),t.push("",sQ(n.join("\n")))}(t,i,n);continue}}!function(e,t,s){e.push("",`**Tool — \`${t.name}\`**${function(e){let t=[],s=function(e){switch(e){case tL.ToolCallStatus.TOOL_CALL_COMPLETED:return"completed";case tL.ToolCallStatus.TOOL_CALL_FAILED:return"failed";case tL.ToolCallStatus.TOOL_CALL_SKIPPED:return"skipped";case tL.ToolCallStatus.TOOL_CALL_INTERRUPTED:return"interrupted";case tL.ToolCallStatus.TOOL_CALL_RUNNING:return"running";case tL.ToolCallStatus.TOOL_CALL_WAITING_APPROVAL:return"waiting for approval";case tL.ToolCallStatus.TOOL_CALL_PENDING:return"pending";default:return null}}(e.status);s&&t.push(s);let r=sZ(e.startedAt,e.completedAt);return r&&t.push(r),t.length>0?` (${t.join(" · ")})`:""}(t)}`);let r=t.args?JSON.stringify(t.args,null,2):void 0;r&&"{}"!==r&&e.push("",s0(r,"json"));let n=function(e,t){let s=e.outputRef;if(!s?.storageKey)return e.result?{text:e.result}:{};if(s.isImage)return{note:`Image output (${s.mimeType||"image"}, ${Number(s.sizeBytes)} bytes) — not inlined.`};let r=t[s.storageKey];return r?.content!==void 0?{text:r.content,note:r.truncated?`Output truncated at ${r.content.length} of ${r.totalSizeBytes} bytes (server content cap).`:void 0}:{text:s.truncatedPreview||e.result||void 0,note:r?.error?`Offloaded output unavailable (${r.error}) — showing preview.`:"Offloaded output not resolved — showing preview."}}(t,s);n.note&&e.push("",`_${n.note}_`),n.text&&e.push("",s0(n.text)),t.error&&e.push("","Error:","",s0(t.error))}(t,s,n)}continue;default:a.content&&t.push("",sQ(a.content))}}(i,t.execution.status?.messages??[],t.execution.status?.subAgentExecutions??[],n,t.userPrompt);let s=t.execution.status?.error;s&&i.push("","**Execution error**","",sQ(s))}return i.push(""),i.join("\n")}function sZ(e,t){if(!e||!t)return null;let s=Date.parse(e),r=Date.parse(t);if(Number.isNaN(s)||Number.isNaN(r)||r<s)return null;let n=r-s;return n<1e3?`${n}ms`:`${(n/1e3).toFixed(1)}s`}function sQ(e){return e.split("\n").map(e=>e.length>0?`> ${e}`:">").join("\n")}function s0(e,t=""){let s=0;for(let t of e.matchAll(/`+/g))t[0].length>s&&(s=t[0].length);let r="`".repeat(Math.max(3,s+1));return`${r}${t}
2
+ ${e}
3
+ ${r}`}var s1=e.i(846696),s5=e.i(745176);function s2(e,t){let r=(0,X.useStigmer)(),n=t?.includeSuperseded===!0,[i,a]=(0,s.useState)(!1),[o,l]=(0,s.useState)(null),g=(0,s.useCallback)(()=>e?sY(r,e,{includeSuperseded:n}):Promise.reject(Error("Cannot export a transcript without a session id. Pass the session's id to useExportTranscript once the session exists.")),[r,e,n]),c=(0,s.useCallback)(async()=>{l(null),a(!0);let e=g().then(e=>sX(e,{generatedAt:new Date().toISOString()}));try{"u">typeof ClipboardItem&&navigator.clipboard?.write?await navigator.clipboard.write([new ClipboardItem({"text/plain":e.then(e=>new Blob([e],{type:"text/plain"}))})]):await navigator.clipboard.writeText(await e),s1.toast.success("Transcript copied to clipboard")}catch(t){let e=(0,Z.toError)(t);l(e),s1.toast.error(`Couldn't copy the transcript: ${e.message}`)}finally{a(!1)}},[g]),u=(0,s.useCallback)(async e=>{l(null),a(!0);try{var t;let s,r,n=await g(),{content:i,extension:a,mimeType:o}=e(n);(0,s5.downloadTextFile)(i,`${(t=n,r=(s=(0,sH.resolvedSubject)(t.session.spec?.subject))?(0,ee.generateSlug)(s).slice(0,60):"",`${r||t.session.metadata?.id||"session"}-transcript`)}.${a}`,o)}catch(t){let e=(0,Z.toError)(t);l(e),s1.toast.error(`Couldn't export the transcript: ${e.message}`)}finally{a(!1)}},[g]),d=(0,s.useCallback)(()=>u(e=>({content:sX(e,{generatedAt:new Date().toISOString()}),extension:"md",mimeType:"text/markdown"})),[u]),m=(0,s.useCallback)(()=>u(e=>({content:JSON.stringify(function(e){let t=e.turns.map(e=>{let t=(0,sW.toJson)(sz.AgentExecutionSchema,e.execution,{useProtoFieldName:!0});if(null!==t&&"object"==typeof t&&!Array.isArray(t)){let e=t.status;null===e||"object"!=typeof e||Array.isArray(e)||delete e.callback_token}return{user_prompt:e.userPrompt,build_from_plan:e.isBuildFromPlan||void 0,superseded:e.superseded||void 0,in_progress:e.inProgress||void 0,execution:t}}),s={};for(let[t,r]of Object.entries(e.resolvedOutputs))s[t]={storage_key:r.storageKey,content:r.content,truncated:r.truncated||void 0,total_size_bytes:r.totalSizeBytes,mime_type:r.mimeType,is_image:r.isImage||void 0,error:r.error};return{format:"stigmer.ai/session-transcript/v1",session:(0,sW.toJson)(sK.SessionSchema,e.session,{useProtoFieldName:!0}),includes_superseded:e.includesSuperseded,turns:t,resolved_outputs:s}}(e),null,2),extension:"json",mimeType:"application/json"})),[u]);return(0,s.useMemo)(()=>({copyMarkdown:c,downloadMarkdown:d,downloadJson:m,isExporting:i,error:o}),[c,d,m,i,o])}function s4({heading:e,count:s,annotation:r,children:n}){return(0,t.jsxs)("section",{className:"stg:flex stg:flex-col stg:gap-1",children:[(0,t.jsxs)("h3",{className:"stg:px-2 stg:text-[0.65rem] stg:font-semibold stg:uppercase stg:tracking-wider stg:text-muted-foreground",children:[e,null!=s&&s>0&&(0,t.jsxs)("span",{className:"stg:ml-1 stg:text-muted-foreground-faint",children:["(",s,")"]}),r&&(0,t.jsxs)("span",{className:"stg:ml-1 stg:font-normal stg:normal-case stg:tracking-normal stg:text-muted-foreground-faint",children:["(",r,")"]})]}),n]})}function s3({children:e,meta:s,actions:n,className:i}){return(0,t.jsxs)("div",{className:(0,r.cn)("stg:group stg:flex stg:items-center stg:gap-2 stg:px-2 stg:py-1 stg:text-xs",i),children:[(0,t.jsx)("span",{className:"stg:flex stg:min-w-0 stg:flex-1 stg:items-center stg:gap-2 stg:text-foreground",children:e}),s&&(0,t.jsx)("span",{className:"stg:shrink-0 stg:text-[0.65rem] stg:text-muted-foreground",children:s}),n]})}let s6=(0,r.cn)("stg:flex stg:w-full stg:min-w-0 stg:items-center stg:gap-2 stg:px-2 stg:py-1 stg:text-left stg:text-xs stg:text-muted-foreground stg:transition-colors","stg:hover:bg-muted stg:hover:text-foreground","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-inset stg:focus-visible:ring-ring","stg:disabled:pointer-events-none stg:disabled:opacity-50");function s8({onClick:e,label:s}){return(0,t.jsx)("button",{type:"button",onClick:e,"aria-label":s,className:(0,r.cn)("stg:flex stg:shrink-0 stg:items-center stg:text-muted-foreground stg:opacity-0 stg:transition-opacity","stg:group-hover:opacity-100 stg:focus-visible:opacity-100","stg:hover:text-destructive","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-inset stg:focus-visible:ring-ring"),children:(0,t.jsx)(re,{})})}function s7({children:e}){return(0,t.jsx)("p",{className:"stg:px-2 stg:text-xs stg:text-muted-foreground-faint",children:e})}function s9({label:e,labelId:s,children:r}){return(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:justify-between stg:gap-2 stg:px-2 stg:py-1 stg:text-xs",children:[(0,t.jsx)("span",{id:s,className:"stg:shrink-0 stg:text-muted-foreground",children:e}),(0,t.jsx)("span",{className:"stg:flex stg:min-w-0 stg:items-center stg:gap-1.5 stg:truncate stg:text-foreground",children:r})]})}function re(){return(0,t.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M4 4L10 10M10 4L4 10"})})}function rt({agentRef:e,isDefaultAgent:s,mcpServerUsages:r,skillRefs:n,sessionVariables:i,harness:a,executionTarget:o,modelId:l,autoApprove:g,sessionId:c,mutations:u,accessSlot:d}){let m=null!=i&&!i.isEmpty;return(0,t.jsxs)("div",{className:"stg:flex stg:flex-col stg:gap-5",children:[(0,t.jsx)(rs,{harness:a,executionTarget:o,modelId:l,autoApprove:g}),(0,t.jsx)(rr,{agentRef:e,isDefaultAgent:s,onRemove:u?.onRemoveAgent}),(0,t.jsx)(rn,{mcpServerUsages:r,onRemove:u?.onRemoveMcp}),(0,t.jsx)(ri,{skillRefs:n,onRemove:u?.onRemoveSkill}),m&&(0,t.jsx)(ra,{entries:i.entries}),c&&(0,t.jsx)(ro,{sessionId:c}),d&&(0,t.jsx)("section",{children:d})]})}function rs({harness:e,executionTarget:r,modelId:n,autoApprove:i}){let a=(0,s.useId)();return(0,t.jsxs)(s4,{heading:"Run Config",children:[(0,t.jsx)(s9,{label:"Harness",children:A.HARNESS_META[e]?.label??e}),n&&(0,t.jsx)(s9,{label:"Model",children:n}),r&&(0,t.jsx)(s9,{label:"Target",children:"local"===r?"Local":"Cloud"}),i&&(0,t.jsx)(s9,{label:"Auto-approve",labelId:a,children:(0,t.jsx)(sU.Switch,{checked:i.armed,onCheckedChange:i.onChange,"aria-labelledby":a})})]})}function rr({agentRef:e,isDefaultAgent:s,onRemove:r}){return(0,t.jsx)(s4,{heading:"Agent",children:e?(0,t.jsx)(s3,{meta:s?"default":void 0,actions:r&&!s?(0,t.jsx)(s8,{onClick:r,label:`Remove agent ${e.slug}`}):void 0,children:(0,t.jsx)("span",{className:"stg:truncate",children:e.slug})}):(0,t.jsx)(s7,{children:"No agent selected — using platform default."})})}function rn({mcpServerUsages:e,onRemove:s}){return(0,t.jsx)(s4,{heading:"MCP Servers",count:e.length,children:e.length>0?e.map(e=>{let r=e.mcpServerRef.slug,n=e.enabledTools?.length;return(0,t.jsx)(s3,{meta:null!=n&&n>0?`${n} tool${1!==n?"s":""}`:void 0,actions:s?(0,t.jsx)(s8,{onClick:()=>s(e.mcpServerRef),label:`Remove MCP server ${r}`}):void 0,children:(0,t.jsx)("span",{className:"stg:truncate",children:r})},`${e.mcpServerRef.org}/${r}`)}):(0,t.jsx)(s7,{children:"No MCP servers attached."})})}function ri({skillRefs:e,onRemove:s}){return(0,t.jsx)(s4,{heading:"Skills",count:e.length,children:e.length>0?e.map(e=>(0,t.jsx)(s3,{actions:s?(0,t.jsx)(s8,{onClick:()=>s(e),label:`Remove skill ${e.slug}`}):void 0,children:(0,t.jsx)("span",{className:"stg:truncate",children:e.slug})},`${e.org}/${e.slug}`)):(0,t.jsx)(s7,{children:"No skills attached."})})}function ra({entries:e}){return(0,t.jsx)(s4,{heading:"Session Variables",annotation:"next message only",children:e.map(e=>(0,t.jsx)(s3,{meta:e.isSecret?"********":(0,t.jsx)("span",{className:"stg:inline-block stg:max-w-[140px] stg:truncate stg:align-bottom",children:e.value}),children:(0,t.jsx)("span",{className:"stg:truncate stg:font-medium",children:e.key||"(unnamed)"})},e.id))})}function ro({sessionId:e}){let s=s2(e);return(0,t.jsxs)(s4,{heading:"Transcript",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>void s.copyMarkdown(),disabled:s.isExporting,className:s6,children:[(0,t.jsx)(sB.Copy,{className:"stg:size-3.5 stg:shrink-0","aria-hidden":"true"}),"Copy transcript"]}),(0,t.jsxs)("button",{type:"button",onClick:()=>void s.downloadMarkdown(),disabled:s.isExporting,className:s6,children:[(0,t.jsx)(s_,{className:"stg:size-3.5 stg:shrink-0","aria-hidden":"true"}),"Download Markdown"]}),(0,t.jsxs)("button",{type:"button",onClick:()=>void s.downloadJson(),disabled:s.isExporting,className:s6,children:[(0,t.jsx)(sV,{className:"stg:size-3.5 stg:shrink-0","aria-hidden":"true"}),"Download JSON"]})]})}var rl=e.i(482389),rg=e.i(676951),rc=e.i(364802),ru=e.i(193799);let rd=/^(\d+) files? changed(?:, (\d+) insertions?\(\+\))?(?:, (\d+) deletions?\(-\))?$/;function rm(e){let t=e.split("\n");for(let e=t.length-1;e>=0;e--){let s=t[e].trim();if(s)return s}return null}let rh=/^https?:\/\/[^/]+\/([^/]+)\/([^/]+)\/pull\/\d+/;function rp({writeBack:e,className:s}){let n=e.phase===rl.WorkspaceWriteBackPhase.WORKSPACE_WRITE_BACK_FAILED,i=!!e.pullRequestUrl,a=function(e){if(e.workspaceEntryName)return e.workspaceEntryName;let t=rh.exec(e.pullRequestUrl);return t?`${t[1]}/${t[2]}`:"Workspace"}(e);return(0,t.jsxs)("div",{role:"article","aria-label":`Write-back: ${a}`,className:(0,r.cn)("stg:flex stg:flex-col",s),children:[(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-2 stg:px-2 stg:py-1",children:[(0,t.jsx)(rc.TruncatedText,{text:a,className:"stg:min-w-0 stg:flex-1 stg:text-xs stg:font-medium stg:text-foreground"}),(0,t.jsx)(rf,{phase:e.phase,pullRequestNumber:e.pullRequestNumber})]}),i&&(0,t.jsx)(rx,{url:e.pullRequestUrl,number:e.pullRequestNumber}),e.branchName&&(0,t.jsx)(rv,{branchName:e.branchName,baseBranch:e.baseBranch}),e.error&&(0,t.jsx)("div",{className:(0,r.cn)("stg:mx-2 stg:my-1 stg:rounded stg:px-2 stg:py-1 stg:text-xs",n?"stg:bg-destructive-subtle stg:text-destructive":"stg:bg-status-degraded-subtle stg:text-status-degraded"),children:e.error}),e.diffSummary&&(0,t.jsx)(rb,{diffSummary:e.diffSummary})]})}function rf({phase:e,pullRequestNumber:s}){let n;switch(e){case rl.WorkspaceWriteBackPhase.WORKSPACE_WRITE_BACK_COMMITTED:n="Committed";break;case rl.WorkspaceWriteBackPhase.WORKSPACE_WRITE_BACK_PUSHED:n="Pushed";break;case rl.WorkspaceWriteBackPhase.WORKSPACE_WRITE_BACK_PR_CREATED:n=s>0?`PR #${s}`:"PR created";break;case rl.WorkspaceWriteBackPhase.WORKSPACE_WRITE_BACK_FAILED:n="Failed";break;default:return null}return(0,t.jsx)("span",{className:(0,r.cn)("stg:shrink-0 stg:text-[10px] stg:font-medium stg:tabular-nums",e===rl.WorkspaceWriteBackPhase.WORKSPACE_WRITE_BACK_FAILED?"stg:text-destructive":"stg:text-muted-foreground"),children:n})}function rx({url:e,number:s}){return(0,t.jsxs)("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:(0,r.cn)("stg:group stg:flex stg:items-center stg:gap-2 stg:px-2 stg:py-1 stg:text-xs stg:text-muted-foreground stg:transition-colors","stg:hover:bg-muted stg:hover:text-foreground",rj),children:[(0,t.jsx)("span",{className:"stg:shrink-0",children:(0,t.jsx)(rk,{})}),(0,t.jsx)("span",{className:"stg:min-w-0 stg:flex-1 stg:truncate stg:text-foreground",children:s>0?`Pull Request #${s}`:"Pull Request"}),(0,t.jsx)("span",{className:"stg:shrink-0 stg:opacity-0 stg:transition-opacity stg:group-hover:opacity-100 stg:group-focus-visible:opacity-100","aria-hidden":"true",children:(0,t.jsx)(rw,{})})]})}function rv({branchName:e,baseBranch:n}){let{copy:i,copied:o}=(0,ru.useCopyFeedback)(),l=(0,s.useCallback)(()=>{i(e)},[i,e]);return(0,t.jsxs)("div",{className:"stg:group stg:flex stg:items-stretch",children:[(0,t.jsxs)("div",{className:"stg:flex stg:min-w-0 stg:flex-1 stg:items-center stg:gap-2 stg:px-2 stg:py-1 stg:text-xs",children:[(0,t.jsx)("span",{className:"stg:shrink-0 stg:text-muted-foreground",children:(0,t.jsx)(ry,{})}),(0,t.jsx)(rc.TruncatedText,{text:e,className:"stg:min-w-0 stg:font-mono stg:text-foreground"}),n&&(0,t.jsxs)("span",{className:"stg:shrink-0 stg:font-mono stg:text-muted-foreground-faint",children:["← ",n]})]}),(0,t.jsxs)(a.Tooltip,{children:[(0,t.jsx)(a.TooltipTrigger,{render:(0,t.jsx)("button",{type:"button",onClick:l,"aria-label":o?"Branch name copied":`Copy branch name ${e}`,className:(0,r.cn)("stg:flex stg:shrink-0 stg:items-center stg:px-2 stg:text-muted-foreground stg:transition-opacity",o?"stg:opacity-100":"stg:opacity-0 stg:group-hover:opacity-100 stg:focus-visible:opacity-100","stg:hover:text-foreground","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-inset stg:focus-visible:ring-ring")}),children:o?(0,t.jsx)(rN,{}):(0,t.jsx)(rS,{})}),(0,t.jsx)(a.TooltipContent,{side:"top",children:o?"Copied":"Copy branch name"})]})]})}function rb({diffSummary:e}){let s=function(e){let t=rm(e);if(null===t)return null;let s=rd.exec(t);return s?{filesChanged:Number(s[1]),insertions:Number(s[2]??0),deletions:Number(s[3]??0)}:null}(e);if(s)return(0,t.jsx)(rg.DiffSummary,{fileCount:s.filesChanged,additions:s.insertions,deletions:s.deletions,className:"stg:px-2 stg:py-1"});let r=rm(e);return r?(0,t.jsx)("div",{className:"stg:px-2 stg:py-1 stg:font-mono stg:text-xs stg:text-muted-foreground",children:r}):null}let rj="stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-inset stg:focus-visible:ring-ring";function ry(){return(0,t.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,t.jsx)("circle",{cx:"4",cy:"3.5",r:"1.5"}),(0,t.jsx)("circle",{cx:"4",cy:"10.5",r:"1.5"}),(0,t.jsx)("circle",{cx:"10",cy:"5.5",r:"1.5"}),(0,t.jsx)("path",{d:"M4 5V9"}),(0,t.jsx)("path",{d:"M10 7V5.5"}),(0,t.jsx)("path",{d:"M4 5C4 5 4 7 7 7C10 7 10 5.5 10 5.5"})]})}function rk(){return(0,t.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,t.jsx)("circle",{cx:"3.5",cy:"3.5",r:"1.5"}),(0,t.jsx)("circle",{cx:"3.5",cy:"10.5",r:"1.5"}),(0,t.jsx)("circle",{cx:"10.5",cy:"10.5",r:"1.5"}),(0,t.jsx)("path",{d:"M3.5 5V9"}),(0,t.jsx)("path",{d:"M7 3.5H8.5C9.6 3.5 10.5 4.4 10.5 5.5V9"})]})}function rw(){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",className:"stg:shrink-0","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M9 3L3 9"}),(0,t.jsx)("path",{d:"M5 3H9V7"}),(0,t.jsx)("path",{d:"M9 8V10H2V3H4"})]})}function rS(){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",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 rN(){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:"stg:shrink-0","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M2.5 6.5L5 9L9.5 3.5"})})}function rC({executions:e,expectsWriteBack:s=!1,isSettled:r=!1}){let{writeBacks:n,hasWriteBacks:i}=sO(e);return i?(0,t.jsx)("ul",{role:"list",className:`${el.UNSTYLED_LIST} stg:flex stg:flex-col stg:gap-3`,children:n.map(e=>(0,t.jsx)("li",{children:(0,t.jsx)(rp,{writeBack:e.writeBack})},e.writeBack.workspaceEntryName))}):s?(0,t.jsx)("div",{className:"stg:flex stg:flex-col stg:items-center stg:justify-center stg:px-4 stg:py-8 stg:text-center",children:(0,t.jsx)("p",{className:"stg:text-xs stg:text-muted-foreground",children:r?"No changes have been pushed yet. When the agent changes files and you approve them, they are pushed to a branch and pull request here.":"Changes stay in the session workspace while you review them. Approved changes are pushed to a branch and pull request here."})}):(0,t.jsx)("div",{className:"stg:flex stg:flex-col stg:items-center stg:justify-center stg:px-4 stg:py-8 stg:text-center",children:(0,t.jsx)("p",{className:"stg:text-xs stg:text-muted-foreground",children:"No changes yet. Pull requests will appear here once the agent pushes its work back to your repository."})})}var rE=e.i(415400);function rR(e,t=!1){return{name:e.name,tooltip:e.sandboxPath||e.name,subtitlePath:t&&e.sandboxPath?function(e){let t=e.lastIndexOf("/");if(t<=0)return null;let s=e.slice(0,t),r=s.slice(s.lastIndexOf("/")+1);return r?`${r}/`:null}(e.sandboxPath):null,sizeBytes:e.sizeBytes,isDirectory:e.kind===tL.ExecutionArtifactKind.DIRECTORY}}e.s(["fromArtifact",0,function(e,t=!1){let s=e.spec?.displayName||e.metadata?.name||"Unnamed",r=e.spec?.source?.taskName??"";return{name:s,tooltip:s,subtitlePath:t&&r?r:null,sizeBytes:e.status?.sizeBytes??BigInt(0),isDirectory:!1}},"fromExecutionArtifact",0,rR],262045);var rA=e.i(879049),rT=e.i(432814);function rM({item:e,onOpen:s,onActivate:n,onDownload:i,isDownloading:o,className:l}){return(0,t.jsxs)("li",{className:(0,r.cn)("stg:group stg:flex stg:items-stretch",l),children:[(0,t.jsxs)(a.Tooltip,{children:[(0,t.jsxs)(a.TooltipTrigger,{render:(0,t.jsx)("button",{type:"button",onClick:s,onDoubleClick:n,className:(0,r.cn)("stg:flex stg:min-w-0 stg:flex-1 stg:items-center stg:gap-2 stg:px-2 stg:py-1 stg:text-left stg:text-xs stg:text-muted-foreground stg:transition-colors","stg:hover:bg-muted stg:hover:text-foreground","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",children:e.isDirectory?(0,t.jsx)(rA.FolderTypeIcon,{open:!1}):(0,t.jsx)(rA.FileTypeIcon,{fileName:e.name})}),(0,t.jsxs)("span",{className:"stg:min-w-0 stg:flex-1 stg:truncate stg:text-foreground",children:[e.name,e.isDirectory&&"/",e.subtitlePath&&(0,t.jsx)("span",{className:"stg:ml-1.5 stg:text-[0.65rem] stg:text-muted-foreground",children:e.subtitlePath})]}),(0,t.jsx)("span",{className:"stg:shrink-0 stg:tabular-nums stg:text-[0.65rem] stg:text-muted-foreground-faint",children:(0,rT.formatArtifactSize)(e.sizeBytes)})]}),(0,t.jsx)(a.TooltipContent,{side:"top",className:"stg:break-all",children:e.tooltip})]}),(0,t.jsxs)(a.Tooltip,{children:[(0,t.jsx)(a.TooltipTrigger,{render:(0,t.jsx)("span",{className:"stg:flex stg:shrink-0"}),children:(0,t.jsx)("button",{type:"button",onClick:i,disabled:o,"aria-label":o?`Preparing ${e.name}`:`Download ${e.name}`,className:(0,r.cn)("stg:flex stg:shrink-0 stg:items-center stg:px-2 stg:text-muted-foreground stg:opacity-0 stg:transition-opacity","stg:group-hover:opacity-100 stg:focus-visible:opacity-100","stg:hover:text-foreground stg:disabled:opacity-50","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-inset stg:focus-visible:ring-ring"),children:(0,t.jsx)(rL,{})})}),(0,t.jsx)(a.TooltipContent,{side:"top",children:e.isDirectory?"Download ZIP":"Download"})]})]})}function rL(){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",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"})]})}e.s(["ArtifactRowView",0,rM],337249);var rI=e.i(835992);function rP({artifact:e,executionId:r,hasNameCollision:n=!1,onOpen:i,onActivate:a,className:o}){let{download:l,isDownloading:g}=(0,rI.useArtifactDownload)(r),c=(0,s.useMemo)(()=>rR(e,n),[e,n]);return(0,t.jsx)(rM,{item:c,onOpen:i,onActivate:a,onDownload:()=>l(e.storageKey,e.name),isDownloading:g,className:o})}var rD=e.i(848681);function rF({executions:e,org:r,onApplied:n,onImplementPlan:i,onOpenPlan:a,onOpenArtifact:o,onActivateArtifact:l}){let{artifacts:g,hasArtifacts:c}=sD(e),[u,d]=(0,s.useState)(null),m=(0,s.useCallback)(e=>{a&&(0,rD.isPlanArtifact)(e.artifact)?a(e.executionId):o?o(e):d(e)},[a,o]),h=(0,s.useCallback)(e=>{a&&(0,rD.isPlanArtifact)(e.artifact)?a(e.executionId):l?.(e)},[a,l]),p=(0,s.useCallback)(()=>{d(null)},[]);return c?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("ul",{role:"list",className:`${el.UNSTYLED_LIST} stg:flex stg:flex-col`,children:g.map(e=>(0,t.jsx)(rP,{artifact:e.artifact,executionId:e.executionId,hasNameCollision:e.hasNameCollision,onOpen:()=>m(e),onActivate:l?()=>h(e):void 0},sP(e.artifact)))}),u&&(0,t.jsx)(rE.ArtifactPreviewModal,{artifact:u.artifact,executionId:u.executionId,isTerminal:u.isTerminal,org:r,open:!0,onClose:p,onApplied:n,onImplement:(0,rD.isPlanArtifact)(u.artifact)?i:void 0})]}):(0,t.jsx)("div",{className:"stg:flex stg:flex-col stg:items-center stg:justify-center stg:px-4 stg:py-8 stg:text-center",children:(0,t.jsx)("p",{className:"stg:text-xs stg:text-muted-foreground",children:"No artifacts yet. Files generated by the agent will appear here."})})}var rO=e.i(186641),rB=e.i(635025);function r$({executions:e}){let s=(0,rO.useSessionUsage)(e);return s.hasUsage?(0,t.jsxs)("div",{className:"stg:flex stg:flex-col stg:gap-5",children:[(0,t.jsx)(rB.UsageWidget,{executions:e}),s.executionBreakdown.length>0&&(0,t.jsx)(rV,{entries:s.executionBreakdown,executions:e})]}):(0,t.jsx)("div",{className:"stg:flex stg:flex-col stg:items-center stg:justify-center stg:px-4 stg:py-8 stg:text-center",children:(0,t.jsx)("p",{className:"stg:text-xs stg:text-muted-foreground",children:"No usage data yet. Cost and token stats will appear here."})})}function rV({entries:e,executions:s}){return(0,t.jsx)(s4,{heading:"Models per run",children:(0,t.jsx)("div",{role:"list","aria-label":"Per-execution model and tier",className:"stg:flex stg:flex-col",children:e.map((e,r)=>{let n=function(e,t){let s=e.find(e=>e.metadata?.id===t);switch(s?.status?.streamingUsage?.requestedServiceTier){case tL.ServiceTier.FAST:return"fast";case tL.ServiceTier.STANDARD:return"standard";default:return null}}(s,e.executionId);return(0,t.jsxs)("div",{className:"stg:flex stg:items-baseline stg:justify-between stg:gap-2 stg:px-2 stg:py-1 stg:text-xs",role:"listitem",children:[(0,t.jsxs)("span",{className:"stg:min-w-0 stg:truncate stg:text-foreground",children:[(0,t.jsxs)("span",{className:"stg:tabular-nums stg:text-muted-foreground",children:["#",r+1]})," ",e.resolvedModel||"—",n&&(0,t.jsxs)(r_,{children:[n," requested"]}),e.isEstimated&&(0,t.jsx)(r_,{children:"Estimated"})]}),(0,t.jsx)("span",{className:"stg:shrink-0 stg:tabular-nums stg:text-[0.65rem] stg:text-muted-foreground",children:(0,rB.formatCost)(e.billableCostUsd)})]},e.executionId)})})})}function r_({children:e}){return(0,t.jsx)("span",{className:"stg:ml-1 stg:rounded stg:bg-muted stg:px-1 stg:py-0.5 stg:text-[0.6rem] stg:font-medium stg:leading-none stg:text-muted-foreground",children:e})}function rU({allExecutions:e,org:r,sessionConfig:n,onApplied:i,onImplementPlan:a,onOpenPlan:o,onOpenArtifact:l,onActivateArtifact:g,includeExecutionFacets:c=!0,expectsWriteBack:u=!1,changesSettled:d=!1}){let{hasWriteBacks:m,writeBackCount:h}=sO(e),{hasArtifacts:p,artifactCount:f}=sD(e);return(0,s.useMemo)(()=>{let s=[];return n&&s.push({id:"configure",label:"Config",icon:(0,t.jsx)(rW,{}),content:(0,t.jsx)(rt,{...n})}),c&&((m||u)&&s.push({id:"changes",label:"Changes",icon:(0,t.jsx)(rz,{}),badge:h>0?h:void 0,content:(0,t.jsx)(rC,{executions:e,expectsWriteBack:u,isSettled:d})}),p&&s.push({id:"artifacts",label:"Artifacts",icon:(0,t.jsx)(rK,{}),badge:f,content:(0,t.jsx)(rF,{executions:e,org:r,onApplied:i,onImplementPlan:a,onOpenPlan:o,onOpenArtifact:l,onActivateArtifact:g})}),s.push({id:"usage",label:"Usage",icon:(0,t.jsx)(rH,{}),content:(0,t.jsx)(r$,{executions:e})})),s},[n,c,u,d,m,h,p,f,e,r,i,a,o,l,g])}function rW(){return(0,t.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,t.jsx)("circle",{cx:"12",cy:"12",r:"3"}),(0,t.jsx)("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 1 1-4 0v-.09a1.65 1.65 0 0 0-1-1.51 1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 1 1 0-4h.09a1.65 1.65 0 0 0 1.51-1 1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33h.01a1.65 1.65 0 0 0 1-1.51V3a2 2 0 1 1 4 0v.09a1.65 1.65 0 0 0 1 1.51h.01a1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82v.01a1.65 1.65 0 0 0 1.51 1H21a2 2 0 1 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"})]})}function rz(){return(0,t.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,t.jsx)("circle",{cx:"6",cy:"6",r:"2.5"}),(0,t.jsx)("circle",{cx:"6",cy:"18",r:"2.5"}),(0,t.jsx)("circle",{cx:"18",cy:"8",r:"2.5"}),(0,t.jsx)("path",{d:"M6 8.5v7"}),(0,t.jsx)("path",{d:"M18 10.5a7 7 0 0 1-7 5H8.5"})]})}function rK(){return(0,t.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M21 8l-9-5-9 5v8l9 5 9-5z"}),(0,t.jsx)("path",{d:"M3 8l9 5 9-5"}),(0,t.jsx)("path",{d:"M12 13v9"})]})}function rH(){return(0,t.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M3 20h18"}),(0,t.jsx)("path",{d:"M6 20v-6"}),(0,t.jsx)("path",{d:"M11 20V9"}),(0,t.jsx)("path",{d:"M16 20v-9"}),(0,t.jsx)("path",{d:"M21 20V5"})]})}function rq({isOpen:e,onToggle:n,badgeCount:i}){let o=!e&&null!=i&&i>0,l=(0,s.useRef)(null),g=(0,s.useRef)(e);return(0,s.useEffect)(()=>{g.current&&!e&&document.activeElement===document.body&&l.current?.focus(),g.current=e},[e]),(0,t.jsxs)(a.Tooltip,{children:[(0,t.jsxs)(a.TooltipTrigger,{render:(0,t.jsx)("button",{ref:l,type:"button",onClick:n,"aria-expanded":e,"aria-label":e?"Hide panel":"Show panel",className:(0,r.cn)("stg:flex stg:items-center stg:gap-1.5 stg:rounded-md stg:border stg:border-border stg:bg-card stg:px-1.5 stg:py-1","stg:text-muted-foreground stg:transition-colors stg:hover:bg-muted stg:hover:text-foreground","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring")}),children:[o&&(0,t.jsx)("span",{"aria-label":`${i} new items`,className:"stg:inline-flex stg:min-w-[1rem] stg:items-center stg:justify-center stg:rounded-full stg:bg-primary stg:px-1 stg:py-px stg:text-[10px] stg:font-medium stg:leading-none stg:text-primary-foreground",children:i}),(0,t.jsx)(rY,{open:e})]}),(0,t.jsx)(a.TooltipContent,{side:"top",children:e?"Hide panel":"Show panel"})]})}function rY({open:e}){return(0,t.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,t.jsx)("rect",{x:"1.5",y:"2.5",width:"13",height:"11",rx:"1.5"}),(0,t.jsx)("path",{d:"M9.5 2.5v11"}),e&&(0,t.jsx)("rect",{x:"9.5",y:"2.5",width:"5",height:"11",rx:"1.5",fill:"currentColor",stroke:"none"})]})}function rG({onTurnOff:e}){return(0,t.jsxs)("div",{role:"status",className:"stg:flex stg:items-center stg:gap-2 stg:border-t stg:border-border-muted stg:px-4 stg:py-1.5 stg:text-xs stg:text-muted-foreground",children:[(0,t.jsx)(rJ,{}),(0,t.jsx)("span",{className:"stg:min-w-0 stg:flex-1 stg:truncate",children:"Auto-approving tool calls for this session"}),(0,t.jsx)("button",{type:"button",onClick:e,className:"stg:shrink-0 stg:rounded 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:"Turn off"})]})}function rJ(){return(0,t.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"stg:shrink-0 stg:text-success","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"}),(0,t.jsx)("path",{d:"m9 12 2 2 4-4"})]})}e.s(["PanelChip",0,rq],524067),e.s(["NewSessionViewer",0,function({org:e,onSessionCreated:r,onError:i,gitHubConnection:a,enableGitHub:o=!0,enableLocal:l=!1,onBrowseLocalFolder:g,workspaceFileLister:c,workspaceFileReader:u,workspaceContentSearcher:d,getRuntimeEnv:m,audience:h="integrator",runConfig:p,showModelSelector:f=!0,panel:x="auto",defaultPanelOpen:v,panelOpen:b,onPanelOpenChange:j,defaultHarness:y,accountDefaults:k,initialAgentRef:w,initialInstanceId:S,initialAttachments:N,heading:C="What would you like to work on?",placeholder:E="Describe what you need help with…",initialRows:R=3,autoFocus:T=!0,footerContent:M,className:L}){let I=function(e){let{org:t,onSessionCreated:r,onError:i,getRuntimeEnv:a,defaultHarness:o,metadata:l,sessionContext:g}=e,c="guest"===e.audience,u=c?void 0:e.accountDefaults,d=c?void 0:e.runConfig;d&&sE(d);let m=d?.modelName,h=d?.serviceTier,p=d?.thinkingMode,f=(0,sw.useExecutionTarget)(),x=e.executionTarget??f,v=(0,sN.useRunnerAdapter)(),b=(0,sS.useApprovalDefaults)(),[j,y]=(0,s.useState)(null),k=j??(!c&&((u?.autoApprove??!1)||(b?.autoApproveAll??!1))),[w,S]=(0,s.useState)(()=>{if(c)return"cursor";let e=localStorage.getItem(sR);return"native"===e||"cursor"===e?e:u?.harness??o??A.DEFAULT_HARNESS}),N=(0,s.useRef)(!1);(0,s.useEffect)(()=>{let e=u?.harness;c||N.current||!e||localStorage.getItem(sR)||S(e)},[c,u?.harness]);let C=(0,X.useStigmer)(),{getModel:E,isLoading:R}=(0,V.useModelRegistry)({harness:w}),{create:T}=(0,sk.useCreateAgentExecution)(),{agent:M,isLoading:L,error:I,waitForResolution:P}=sx(c?null:t),D=(0,sb.useWorkspaceEntries)(),F=sy(),[O,B]=(0,s.useState)(void 0),[_,U]=(0,s.useState)(null),[W,z]=(0,s.useState)(null),[K,H]=(0,s.useState)([]),[q,Y]=(0,s.useState)([]),[G,J]=(0,s.useState)(!1),[Z,Q]=(0,s.useState)(null),ee=O&&E(O)?O:void 0,et="cursor"===w?u?.cursorModel:u?.nativeModel,es=et&&E(et)?et:void 0,er=ee??es,en=(0,s.useCallback)(e=>{if(N.current=!0,S(e),c)return;localStorage.setItem(sR,e);let t=localStorage.getItem(sA(e));B(t?(0,$.parseModelKey)(t)?.modelId??t:void 0)},[c]);(0,s.useEffect)(()=>{if(c||R)return;let e=localStorage.getItem(sA(w));if(e){let t=(0,$.parseModelKey)(e)?.modelId??e;E(t)&&B(t)}},[E,w,c,R]),(0,s.useEffect)(()=>{if(!c&&O){let e=(0,$.parseModelKey)(O)?.modelId??O;localStorage.setItem(sA(w),e)}},[O,w,c]);let ei=(0,s.useCallback)(async(e,s,o)=>{if(!G){if(!t){let e="Select an organization before starting a session.";Q(e),i?.(e);return}J(!0),Q(null);try{let n,i,d=a?await sC(a,o?.runtimeEnv):o?.runtimeEnv,f={workspaceEntries:D.hasEntries?D.toInput():void 0,mcpServerUsages:K.length>0?K:void 0,skillRefs:q.length>0?q:void 0,metadata:l,sessionContext:g,harness:w,executionTarget:x},b={org:t,message:e,modelName:m??s??er,runtimeEnv:d,attachments:o?.attachments,interactionMode:o?.interactionMode,serviceTier:m?"fast"===h?"fast":void 0:o?.serviceTier,thinkingMode:m?"enabled"===p?"enabled":void 0:o?.thinkingMode,workspaceFileRefs:o?.workspaceFileRefs,autoApproveAll:k||void 0};if(_&&W)"saved"===W.mode?n=W.instanceId:i=(await C.agent.getByReference(_)).metadata.id;else if(c)throw Error("This agent is still loading. Please try again in a moment.");else{let e=M?.status?.defaultInstanceId;if(!e){if(L){var u;let t=await (u=P(),new Promise((e,t)=>{let s=setTimeout(()=>t(Error("Default agent did not load in time. Please try again.")),1e4);u.then(t=>{clearTimeout(s),e(t)},e=>{clearTimeout(s),t(e)})}));e=t?.status?.defaultInstanceId}else if(I)throw Error("Failed to load default agent. Please try again.");if(!e)throw Error("No default agent available. Select an agent to start a session.")}n=e}let{sessionId:j}=await T({...b,agentId:i,sessionSpec:{...f,agentInstanceId:n}});v&&"local"===x&&await v.onSessionOpened(j),F.clear(),r(j)}catch(t){let e=(0,n.getUserMessage)(t,"Failed to start session");Q(e),i?.(e)}finally{J(!1)}}},[G,t,c,w,x,k,v,a,er,m,h,p,D,K,q,l,g,_,W,M,L,I,P,C.agent,T,F,r,i]);return{harness:w,setHarness:en,modelId:er,setModelId:B,agentRef:_,setAgentRef:U,resolution:W,setResolution:z,mcpServerUsages:K,setMcpServerUsages:H,skillRefs:q,setSkillRefs:Y,workspace:D,sessionVariables:F,autoApproveAll:k,setAutoApproveAll:y,isSubmitting:G,submitError:Z,submit:ei}}({org:e,onSessionCreated:r,onError:i,getRuntimeEnv:m,defaultHarness:y,accountDefaults:k,audience:h,runConfig:p}),[P,D]=(0,s.useState)("agent"),F="guest"===h,O=f&&!F&&p?.modelName===void 0,B="integrator"!==h,_="none"!==x&&!F,{setAgentRef:U,setResolution:W}=I;(0,s.useEffect)(()=>{F&&w&&S&&(U(w),W({mode:"saved",instanceId:S}))},[F,w,S,U,W]);let z=sF({phase:null,hasChanges:!1,defaultView:"configure",open:!!_&&b,defaultOpen:v,onOpenChange:_?j:void 0}),{editors:K,activeKey:H,activeFile:q,reveal:Y}=(0,ti.useWorkspaceEditors)(z.editorsStore),G=Y&&Y.key===H?Y:void 0,J=(0,s.useCallback)(()=>{I.setAgentRef(null),I.setResolution(null)},[I.setAgentRef,I.setResolution]),Z=(0,s.useCallback)(e=>{I.setMcpServerUsages(I.mcpServerUsages.filter(t=>t.mcpServerRef.org!==e.org||t.mcpServerRef.slug!==e.slug))},[I.mcpServerUsages,I.setMcpServerUsages]),Q=(0,s.useCallback)(e=>{I.setSkillRefs(I.skillRefs.filter(t=>t.org!==e.org||t.slug!==e.slug))},[I.skillRefs,I.setSkillRefs]),ee=rU({allExecutions:[],org:e,sessionConfig:(0,s.useMemo)(()=>({agentRef:I.agentRef,isDefaultAgent:!1,mcpServerUsages:I.mcpServerUsages,skillRefs:I.skillRefs,sessionVariables:I.sessionVariables,harness:I.harness,executionTarget:void 0,modelId:I.modelId,autoApprove:F?void 0:{armed:I.autoApproveAll,onChange:I.setAutoApproveAll},mutations:B?void 0:{onRemoveAgent:I.agentRef?J:void 0,onRemoveMcp:Z,onRemoveSkill:Q}}),[I.agentRef,I.mcpServerUsages,I.skillRefs,I.sessionVariables,I.harness,I.modelId,I.autoApproveAll,I.setAutoApproveAll,F,B,J,Z,Q]),includeExecutionFacets:!1}),et=l&&!!g,es=(0,s.useCallback)(async()=>{let e=await g?.();e&&I.workspace.addLocalPath(e)},[g,I.workspace.addLocalPath]),er=(0,t.jsx)("div",{className:"stg:flex stg:h-full stg:flex-col stg:items-center stg:overflow-y-auto stg:px-4 stg:py-6",children:(0,t.jsxs)("div",{className:"stg:my-auto stg:w-full stg:max-w-2xl stg:space-y-6",children:[(0,t.jsx)("h1",{className:"stg:text-center stg:text-lg stg:font-medium stg:text-foreground",children:C}),(0,t.jsx)(te,{onSubmit:I.submit,isSubmitting:I.isSubmitting,org:e,workspace:F?void 0:I.workspace,gitHubConnection:o&&!F?a:void 0,enableGitHub:o&&!F,enableLocal:l&&!F,onBrowseLocalFolder:g,agentRef:I.agentRef,onAgentRefChange:F?void 0:I.setAgentRef,onAgentResolutionChange:F?void 0:I.setResolution,initialAgentRef:F?void 0:w,initialInstanceId:F?void 0:S,initialAttachments:F?void 0:N,lockAgent:B&&null!=w,mcpServerUsages:B?void 0:I.mcpServerUsages,onMcpServerUsagesChange:B?void 0:I.setMcpServerUsages,skillRefs:B?void 0:I.skillRefs,onSkillRefsChange:B?void 0:I.setSkillRefs,sessionVariables:B?void 0:I.sessionVariables,showHarnessSelector:!F,harness:I.harness,onHarnessChange:I.setHarness,interactionMode:P,onInteractionModeChange:D,showInteractionModePicker:!F,showModelSelector:O,enableAttachments:!F,defaultModelId:I.modelId,onModelChange:I.setModelId,placeholder:E,initialRows:R,autoFocus:T,ariaLabel:"Start a new session"}),!F&&I.autoApproveAll&&(0,t.jsx)(rG,{onTurnOff:()=>I.setAutoApproveAll(!1)}),M,(0,t.jsx)("p",{className:"stg:text-center stg:text-[0.65rem] stg:text-muted-foreground",children:"Press Enter to send, Shift+Enter for a new line"})]})});return(0,t.jsx)(tn,{className:L,resizeAriaLabel:"Resize composer panel",splitStorageKey:"stgm-new-session-chat-width",chip:_?(0,t.jsx)(rq,{isOpen:z.isOpen,onToggle:z.isOpen?z.closePanel:z.openPanel}):void 0,conversation:er,panel:z.isOpen&&_?(0,t.jsx)(se,{entries:I.workspace.entries,lister:c,reader:u,searcher:d,view:z.view,onViewChange:z.setView,extraViews:ee,onRemoveEntry:I.workspace.remove,onAddLocalFolder:et?es:void 0,editors:K,selectedFile:q,onOpenFile:z.openFile,onActivateEditor:z.activateEditor,onPinEditor:z.pinEditor,onCloseEditor:z.closeEditor,onCollapse:z.closePanel,reveal:G,className:"stg:h-full"}):null})}],275051);var rX=e.i(791418);function rZ(e){return e.replace(/\\/g,"/").replace(/^\/+/,"")}function rQ(e,t){return t?e===t?"":e.startsWith(t+"/")?e.slice(t.length+1):null:null}function r0(e,t,s){if(!e||0===t.length)return null;let r=rZ(e);if(s){let e=rQ(r,rZ(s));null!==e&&(r=e)}if(!r||"."===r||"platform"===(0,rX.classifyPath)(r).kind)return null;let n=t.length>1;for(let e of t){let t=null;if("local"===e.type&&e.localPath?t=rZ(e.localPath):"git"===e.type&&n&&(t=rZ(e.name)),null===t)continue;let s=rQ(r,t);if(""===s)return null;if(s)return{entryId:e.id,path:s}}return 1===t.length?{entryId:t[0].id,path:r}:null}var r1=e.i(226634),r5=e.i(222898),r2=e.i(163568);let r4=(0,s.memo)(function({progress:e,className:n}){let[i,a]=(0,s.useState)(!1);if(!e||0===e.filesChanged)return null;let{filesChanged:o,linesAdded:l,linesRemoved:g,entries:c}=e,u=o-c.length;return(0,t.jsxs)("div",{role:"region","aria-label":"File changes in progress","data-cursor-target":"file-change-progress-bar",className:(0,r.cn)("stg:border-t stg:border-border-muted stg:px-4 stg:py-2",n),children:[(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-2",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>a(e=>!e),"aria-expanded":i,className:"stg:flex stg:min-w-0 stg:flex-1 stg:items-center stg:gap-2 stg:text-left stg:text-xs stg:text-muted-foreground stg:hover:text-foreground",children:[(0,t.jsx)("span",{"aria-hidden":"true",className:(0,r.cn)("stg:shrink-0 stg:transition-transform",i&&"stg:rotate-90"),children:"▸"}),(0,t.jsxs)("span",{"aria-live":"polite",className:"stg:min-w-0 stg:truncate",children:[o," ",1===o?"file":"files"," changing…"]})]}),(0,t.jsx)(r5.FileLineStats,{linesAdded:l,linesRemoved:g})]}),i&&(0,t.jsxs)("ul",{className:(0,r.cn)(el.UNSTYLED_LIST,"stg:mt-2 stg:max-h-[30vh] stg:space-y-1 stg:overflow-y-auto"),children:[c.map(e=>{let s=e.pathAfter||e.pathBefore;return(0,t.jsxs)("li",{className:"stg:flex stg:items-center stg:gap-2",children:[(0,t.jsx)(r5.FileKindBadge,{kind:e.kind}),(0,t.jsx)(r2.FilePathLink,{path:s,dirDisplay:"dim",className:"stg:min-w-0 stg:flex-1 stg:text-xs"}),(0,t.jsx)(r5.FileLineStats,{linesAdded:e.linesAdded,linesRemoved:e.linesRemoved})]},s)}),u>0&&(0,t.jsxs)("li",{className:"stg:text-xs stg:text-muted-foreground-faint",children:["… and ",u," more"]})]})]})});var r3=e.i(372063);function r6({changeSets:e,onSubmit:s,submittingDecisionKeys:n,decisionErrors:i,className:a}){return 0===e.length?null:(0,t.jsx)("div",{role:"region","aria-label":"File changes awaiting review","data-cursor-target":"file-review-dock",className:(0,r.cn)("stg:border-t stg:border-border-muted",a),children:(0,t.jsx)("div",{className:"stg:max-h-[40vh] stg:space-y-2 stg:overflow-y-auto stg:px-4 stg:py-2",children:e.map(e=>(0,t.jsx)(r8,{changeSet:e,onSubmit:s,submittingDecisionKeys:n,decisionErrors:i},e.id))})})}let r8=(0,s.memo)(function({changeSet:e,onSubmit:r,submittingDecisionKeys:n,decisionErrors:i}){let a=(0,s.useCallback)((t,s)=>{r(e.id,t,s)},[r,e.id]);return(0,t.jsx)(r3.FileReviewCard,{fileChangeSet:e,onSubmit:a,submittingDecisionKeys:n,decisionErrors:i,showDiffs:!1})});e.s(["FileReviewDock",0,r6],644389);var r7=e.i(6486);let r9=[[85,72,90],[78,65,88,70]];function ne({className:e}){return(0,t.jsx)("div",{className:(0,r.cn)("stg:flex stg:flex-col stg:gap-4 stg:pt-6 stg:pb-4",e),"aria-busy":"true","aria-label":"Loading conversation",children:(0,t.jsxs)("div",{className:"stg:animate-pulse stg:space-y-4",children:[(0,t.jsx)("div",{className:"stg:ms-[20%] stg:rounded-lg stg:bg-muted-subtle stg:px-4 stg:py-3",children:(0,t.jsx)("div",{className:"stg:h-4 stg:w-3/5 stg:rounded stg:bg-muted"})}),(0,t.jsx)("div",{className:"stg:space-y-2 stg:px-4",children:r9[0].map((e,s)=>(0,t.jsx)("div",{className:"stg:h-4 stg:rounded stg:bg-muted",style:{width:`${e}%`}},s))}),(0,t.jsx)("div",{className:"stg:ms-[20%] stg:rounded-lg stg:bg-muted-subtle stg:px-4 stg:py-3",children:(0,t.jsx)("div",{className:"stg:h-4 stg:w-2/5 stg:rounded stg:bg-muted"})}),(0,t.jsx)("div",{className:"stg:space-y-2 stg:px-4",children:r9[1].map((e,s)=>(0,t.jsx)("div",{className:"stg:h-4 stg:rounded stg:bg-muted",style:{width:`${e}%`}},s))})]})})}e.s(["ThreadSkeleton",0,ne],352082);var nt=e.i(341698),ns=e.i(140076),nr=e.i(972992),nn=e.i(159877);e.i(247167);var ni=e.i(38535),na=e.i(375954),no=e.i(945850),nl=e.i(565621);function ng(e){let t=(0,$.parseModelKey)(e);return t?t.modelId:e}let nc=()=>{};var nu=e.i(526025),nd=e.i(980213);let nm=[];function nh(e){return`${e.executionId}:${e.artifact.contentHash}`}var np=e.i(918789),nf=e.i(61855),nx=e.i(669226),nv=e.i(596639);function nb({plan:e,draft:n,onBuildFromPlan:i,buildDisabled:a,readOnly:o}){let[l,g]=(0,s.useState)("rendered"),c=!o&&void 0!==i,u=(0,nv.useBuildFromPlanHotkey)(c?i:void 0,a),{content:d,isTruncated:m,isLoading:h,error:p,refetch:f}=(0,nx.useArtifactContent)(e.executionId,e.artifact.storageKey,void 0,e.artifact.contentHash),x=o?void 0:n,v=x?.draftText??d,b=void 0!==x&&(!m||x.isEdited),j="edit"!==l||b?l:"rendered";return h?(0,t.jsx)(nj,{children:(0,t.jsx)(nk,{})}):p||null===v?(0,t.jsx)(nj,{children:(0,t.jsxs)("div",{className:"stg:flex stg:flex-col stg:items-center stg:gap-2 stg:px-4 stg:py-8 stg:text-center",children:[(0,t.jsxs)("p",{className:"stg:text-xs stg:text-muted-foreground",children:["Couldn’t load the plan",p?`: ${p.message}`:"."]}),(0,t.jsx)("button",{type:"button",onClick:f,className:"stg:rounded stg:text-xs 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:"Retry"})]})}):(0,t.jsxs)(nj,{onKeyDown:u,children:[(0,t.jsxs)("div",{className:"stg:flex stg:min-w-0 stg:flex-wrap stg:items-center stg:gap-2",children:[(0,t.jsxs)("div",{className:"stg:inline-flex stg:shrink-0 stg:rounded-md stg:bg-muted stg:p-0.5",role:"tablist","aria-label":"Plan view",children:[(0,t.jsx)(nw,{active:"rendered"===j,onClick:()=>g("rendered"),label:"Rendered"}),(0,t.jsx)(nw,{active:"source"===j,onClick:()=>g("source"),label:"Source"}),void 0!==x&&(0,t.jsx)(nw,{active:"edit"===j,onClick:()=>g("edit"),label:"Edit",disabled:!b})]}),(0,t.jsx)("span",{className:"stg:text-[0.65rem] stg:tabular-nums stg:text-muted-foreground-faint",children:(0,rT.formatArtifactSize)(e.artifact.sizeBytes)}),void 0!==x&&!b&&(0,t.jsx)("span",{className:"stg:min-w-0 stg:text-[0.65rem] stg:text-muted-foreground",children:"This plan is too large to edit in place — download it instead."}),(0,t.jsxs)("div",{className:"stg:ml-auto stg:flex stg:min-w-0 stg:flex-wrap stg:items-center stg:gap-3",children:[x?.isEdited&&(0,t.jsxs)("span",{className:"stg:inline-flex stg:items-center stg:gap-2",children:[(0,t.jsx)("span",{className:"stg:rounded-md stg:bg-accent stg:px-1.5 stg:py-0.5 stg:text-[0.65rem] stg:font-medium stg:text-muted-foreground",children:"Edited"}),(0,t.jsx)("button",{type:"button",onClick:()=>x.setDraft(null),className:"stg:rounded stg:text-[0.65rem] stg:font-medium stg:text-muted-foreground stg:underline-offset-2 stg:hover:text-foreground stg:hover:underline stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring",children:"Revert"})]}),o?(0,t.jsx)("span",{role:"status",className:"stg:rounded-md stg:bg-muted stg:px-2 stg:py-0.5 stg:text-[0.65rem] stg:font-medium stg:text-muted-foreground",children:"Superseded by a newer plan"}):i&&(0,t.jsxs)("button",{type:"button",disabled:a,onClick:i,className:(0,r.cn)("stg:inline-flex stg:min-w-0 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)(nS,{}),(0,t.jsx)("span",{className:"stg:truncate",children:a?"Starting build…":"Build"})]})]})]}),"rendered"===j&&(0,t.jsx)(ny,{text:v}),"source"===j&&(0,t.jsx)("pre",{className:"stg:overflow-x-auto stg:rounded-md stg:bg-muted stg:p-3 stg:font-mono stg:text-xs stg:whitespace-pre-wrap stg:text-foreground",children:v}),"edit"===j&&void 0!==x&&(0,t.jsx)("textarea",{value:v,onChange:e=>x.setDraft(e.target.value),"aria-label":"Edit plan",spellCheck:!1,rows:28,className:(0,r.cn)("stg:w-full stg:flex-1 stg:resize-y stg:rounded-md stg:border stg:border-border stg:bg-card stg:p-3","stg:font-mono stg:text-xs stg:leading-relaxed stg:text-foreground","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring")}),m&&(0,t.jsx)("p",{role:"status",className:"stg:text-[0.65rem] stg:text-muted-foreground",children:"Preview truncated — download the artifact for the full plan."})]})}function nj({children:e,onKeyDown:s}){return(0,t.jsx)("div",{role:"article","aria-label":"Plan document",onKeyDown:s,className:"stg:mx-auto stg:flex stg:w-full stg:max-w-3xl stg:flex-col stg:gap-3 stg:px-4 stg:py-3",children:e})}function ny({text:e}){let{title:r,body:n}=(0,s.useMemo)(()=>(0,nf.extractLeadingH1)((0,nf.unwrapEnclosingMarkdownFence)(e,!0)),[e]);return(0,t.jsxs)("div",{className:"stg:overflow-hidden stg:rounded-lg stg:border stg:border-border-muted stg:bg-card",children:[r&&(0,t.jsx)("header",{className:"stg:border-b stg:border-border-muted stg:bg-muted-faint stg:px-4 stg:py-2.5",children:(0,t.jsx)("span",{className:"stg:block stg:truncate stg:text-sm stg:font-semibold stg:text-foreground",children:r})}),(0,t.jsx)("div",{className:"stgm-prose stg:px-4 stg:py-4",children:(0,t.jsx)(np.default,{remarkPlugins:nf.REMARK_PLUGINS,components:nf.PLAN_DOCUMENT_MARKDOWN_COMPONENTS,children:n})})]})}function nk(){return(0,t.jsxs)("div",{className:"stg:space-y-2 stg:py-2","aria-hidden":"true",children:[(0,t.jsx)("div",{className:"stg:h-8 stg:w-full stg:animate-pulse stg:rounded-md stg:bg-muted"}),(0,t.jsx)("div",{className:"stg:h-4 stg:w-2/3 stg:animate-pulse stg:rounded stg:bg-muted"}),(0,t.jsx)("div",{className:"stg:h-4 stg:w-full stg:animate-pulse stg:rounded stg:bg-muted"}),(0,t.jsx)("div",{className:"stg:h-4 stg:w-5/6 stg:animate-pulse stg:rounded stg:bg-muted"})]})}function nw({active:e,onClick:s,label:n,disabled:i}){return(0,t.jsx)("button",{type:"button",role:"tab","aria-selected":e,onClick:s,disabled:i,className:(0,r.cn)("stg:rounded stg:px-2 stg:py-0.5 stg:text-[0.65rem] stg:font-medium stg:transition-colors","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring",e?"stg:bg-card stg:text-foreground stg:shadow-sm":"stg:text-muted-foreground stg:hover:text-foreground","stg:disabled:pointer-events-none stg:disabled:opacity-50"),children:n})}function nS(){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"})})}e.i(146696);var nN=e.i(644731);function nC({displayText:e}){let{title:r,body:n}=(0,s.useMemo)(()=>(0,nf.extractLeadingH1)(e),[e]);return(0,t.jsxs)("div",{role:"article","aria-label":"Plan document","aria-busy":"true",className:"stg:mx-auto stg:flex stg:w-full stg:max-w-3xl stg:flex-col stg:gap-3 stg:px-4 stg:py-3",children:[(0,t.jsx)("div",{className:"stg:flex stg:min-w-0 stg:flex-wrap stg:items-center stg:gap-2",children:(0,t.jsxs)("span",{role:"status",className:"stg:inline-flex stg:items-center stg:gap-1.5 stg:rounded-md stg:bg-muted stg:px-2 stg:py-0.5 stg:text-[0.65rem] stg:font-medium stg:text-muted-foreground",children:[(0,t.jsx)(nE,{}),"Writing…"]})}),(0,t.jsxs)("div",{className:"stg:overflow-hidden stg:rounded-lg stg:border stg:border-border-muted stg:bg-card",children:[r&&(0,t.jsx)("header",{className:"stg:border-b stg:border-border-muted stg:bg-muted-faint stg:px-4 stg:py-2.5",children:(0,t.jsx)("span",{className:"stg:block stg:truncate stg:text-sm stg:font-semibold stg:text-foreground",children:r})}),(0,t.jsx)("div",{className:"stgm-prose stg:px-4 stg:py-4",children:(0,t.jsx)(nN.Streamdown,{components:nf.PLAN_DOCUMENT_MARKDOWN_COMPONENTS,isAnimating:!0,caret:"block",children:n})})]})]})}function nE(){return(0,t.jsx)("span",{"aria-hidden":"true",className:"stg:size-1.5 stg:animate-pulse stg:rounded-full stg:bg-primary"})}var nR=e.i(180762),nA=e.i(385062),nT=e.i(285716);function nM({artifact:e,executionId:s,org:n,isTerminal:i,onApplied:a,className:o}){let l=`artifact-doc:${s}:${e.storageKey}:${e.contentHash}`,g=(0,nR.useArtifactInspection)(e,s,n,{cacheKey:l,onApplied:a}),{download:c,isDownloading:u}=(0,rI.useArtifactDownload)(s),d=!g.isDirectory&&null!==g.content;return(0,t.jsxs)("div",{role:"article","aria-label":`Artifact ${e.name}`,className:(0,r.cn)("stg:flex stg:min-h-0 stg:min-w-0 stg:flex-1 stg:flex-col",o),children:[(0,t.jsxs)("div",{className:"stg:sticky stg:top-0 stg:z-10 stg:flex stg:min-w-0 stg:flex-wrap stg:items-center stg:gap-x-3 stg:gap-y-1.5 stg:border-b stg:border-border stg:bg-background stg:px-4 stg:py-2",children:[(0,t.jsx)("span",{className:"stg:shrink-0 stg:text-muted-foreground",children:g.isDirectory?(0,t.jsx)(nD,{}):(0,t.jsx)(nP,{})}),(0,t.jsxs)("span",{className:"stg:truncate stg:text-sm stg:font-medium stg:text-foreground",children:[e.name,g.isDirectory&&"/"]}),(0,t.jsx)("span",{className:"stg:shrink-0 stg:text-[0.65rem] stg:tabular-nums stg:text-muted-foreground-faint",children:(0,rT.formatArtifactSize)(e.sizeBytes)}),g.isDetecting&&!g.detectionLabel&&(0,t.jsx)("span",{className:"stg:h-4 stg:w-24 stg:shrink-0 stg:animate-pulse stg:rounded-full stg:bg-muted","aria-hidden":"true"}),g.detectionLabel&&(0,t.jsx)("span",{className:"stg:inline-flex stg:shrink-0 stg:items-center stg:rounded-full stg:bg-primary-subtle stg:px-2 stg:py-0.5 stg:text-xs stg:font-medium stg:text-primary",children:g.detectionLabel}),(0,t.jsxs)("div",{className:"stg:ml-auto stg:flex stg:min-w-0 stg:flex-wrap stg:items-center stg:gap-3",children:[d&&(0,t.jsxs)("button",{type:"button",onClick:g.copy,"aria-label":g.copied?"Copied to clipboard":"Copy content",className:(0,r.cn)("stg:inline-flex stg:items-center stg:gap-1.5 stg:text-xs stg:font-medium stg:transition-colors",g.copied?"stg:text-success":"stg:text-muted-foreground stg:hover:text-foreground",nI),children:[g.copied?(0,t.jsx)(nB,{}):(0,t.jsx)(nF,{}),g.copied?"Copied":"Copy"]}),(0,t.jsxs)("button",{type:"button",onClick:()=>c(e.storageKey,e.name),disabled:u,className:(0,r.cn)("stg:inline-flex stg:items-center stg:gap-1.5 stg:text-xs stg:font-medium stg:text-muted-foreground stg:transition-colors stg:hover:text-foreground stg:disabled:opacity-50",nI),children:[(0,t.jsx)(nO,{}),u?"Preparing…":g.isDirectory?"Download ZIP":"Download"]}),(0,t.jsx)(nL,{isDetected:g.isDetected,ctaLabel:g.ctaLabel,isTerminal:i,isApplying:g.isApplying,applyResult:g.applyResult,applyError:g.applyError,onApply:g.apply})]})]}),(0,t.jsx)(nA.ArtifactContentBody,{artifact:e,content:g.content,contentType:g.contentType,isLoading:g.isLoading,error:g.error,isTruncated:g.isTruncated,skillDetection:g.skillDetection,className:"stg:min-w-0"}),(0,t.jsx)("div",{role:"status","aria-live":"polite","aria-atomic":"true",className:"stg:sr-only",children:g.copied&&"Content copied to clipboard"})]})}function nL({isDetected:e,ctaLabel:s,isTerminal:n,isApplying:i,applyResult:a,applyError:o,onApply:l}){return a?(0,t.jsxs)("span",{className:"stg:inline-flex stg:items-center stg:gap-1.5 stg:text-xs stg:font-medium stg:text-success",children:[(0,t.jsx)(nB,{}),"Applied ","·"," ",a.name||a.kind]}):o?(0,t.jsxs)("span",{className:"stg:inline-flex stg:items-center stg:gap-2",role:"alert",children:[(0,t.jsx)("span",{className:"stg:text-xs stg:text-destructive",children:o.message}),(0,t.jsx)("button",{type:"button",onClick:l,className:(0,r.cn)("stg:text-xs stg:font-medium stg:text-destructive stg:underline stg:transition-colors stg:hover:text-destructive-muted",nI),children:"Retry"})]}):e&&s?(0,t.jsx)("span",{"data-cursor-target":"apply-resource-button",children:(0,t.jsx)(nT.ArtifactApplyButton,{label:s,isTerminal:n,isApplying:i,onApply:l})}):null}let nI="stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring stg:focus-visible:rounded-sm";function nP(){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","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M9.5 1.5H5C4.17 1.5 3.5 2.17 3.5 3V13C3.5 13.83 4.17 14.5 5 14.5H11C11.83 14.5 12.5 13.83 12.5 13V4.5L9.5 1.5Z"}),(0,t.jsx)("path",{d:"M9.5 1.5V4.5H12.5"})]})}function nD(){return(0,t.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M14.5 12.5C14.5 13.33 13.83 14 13 14H3C2.17 14 1.5 13.33 1.5 12.5V3.5C1.5 2.67 2.17 2 3 2H6L8 4.5H13C13.83 4.5 14.5 5.17 14.5 6V12.5Z"})})}function nF(){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",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 nO(){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",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 nB(){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:"stg:shrink-0","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M2 6.5L4.5 9L10 3"})})}let n$=(0,s$.default)("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]);e.s(["Download",0,n$],440160);var nV=e.i(845132);function n_({sessionId:e,includeSuperseded:s,className:n}){let i=s2(e,{includeSuperseded:s});return(0,t.jsxs)(nV.ActionMenu,{children:[(0,t.jsx)(nV.ActionMenu.Trigger,{"aria-label":"Export transcript",className:(0,r.cn)("stg:size-7",n),children:i.isExporting?(0,t.jsx)(F.SpinnerIcon,{size:14}):(0,t.jsx)(n$,{className:"stg:size-3.5","aria-hidden":"true"})}),(0,t.jsxs)(nV.ActionMenu.Content,{children:[(0,t.jsx)(nV.ActionMenu.Item,{icon:(0,t.jsx)(sB.Copy,{className:"stg:size-3.5","aria-hidden":"true"}),onSelect:()=>void i.copyMarkdown(),disabled:i.isExporting,children:"Copy transcript"}),(0,t.jsx)(nV.ActionMenu.Item,{icon:(0,t.jsx)(s_,{className:"stg:size-3.5","aria-hidden":"true"}),onSelect:()=>void i.downloadMarkdown(),disabled:i.isExporting,children:"Download Markdown"}),(0,t.jsx)(nV.ActionMenu.Item,{icon:(0,t.jsx)(sV,{className:"stg:size-3.5","aria-hidden":"true"}),onSelect:()=>void i.downloadJson(),disabled:i.isExporting,children:"Download JSON"})]})]})}async function nU(e,t){let s=await e.agentExecution.getArtifactContent((0,Y.create)(eT.GetArtifactContentRequestSchema,{executionId:t.executionId,storageKey:t.artifact.storageKey}));if(s.truncated)throw Error("plan content truncated — not attaching a partial plan");return new TextDecoder().decode(s.content)}let nW=(0,s.memo)(function({flow:e,modelId:r,setModelId:n,interactionMode:i,setInteractionMode:a,composerRef:o,org:l,gitHubConnection:g,enableGitHub:c,enableLocal:u,onBrowseLocalFolder:d,onBuildFromPlan:m,onOpenPlan:h,isBuildingFromPlan:p,planAttachFailed:f,onDismissPlanAttachFailed:x,onFilePathClick:v,isCurated:b,isGuest:j,isObserver:y,modelSelectorVisible:k,threadSlots:w}){let{conv:S}=e,N=e.submitError??S.sendError??S.stopError,C=(0,s.useCallback)(t=>{e.handleSubmit(t)},[e.handleSubmit]),E=(0,s.useCallback)(()=>{S.stop()},[S.stop]),[R,A]=(0,s.useState)(null),T=S.activeStreamExecution?.metadata?.id??null,M=(0,s.useCallback)(e=>{S.stop(),A(T),o.current?.setMessage(e),o.current?.focus()},[S.stop,T,o]),L=(0,s.useCallback)(()=>{A(null),o.current?.setMessage("")},[o]),I=(0,s.useCallback)((t,s,r)=>{e.handleSubmit(t,s,R?{...r,supersedesExecutionId:R}:r),A(null)},[e.handleSubmit,R]),P=(0,s.useMemo)(()=>({workspaceEntries:S.workspaceEntries??[],onFilePathClick:v}),[S.workspaceEntries,v]);return(0,t.jsxs)("div",{className:"stg:flex stg:h-full stg:min-w-0 stg:flex-col",children:[(0,t.jsx)(r1.MessageThread,{executions:S.completedExecutions,activeStreamExecution:S.activeStreamExecution,pendingUserMessage:S.pendingUserMessage,pendingAttachments:S.pendingAttachments,pendingMessageFailed:!!S.sendError&&!!S.pendingUserMessage,onRetrySend:y?void 0:S.retryLastSend,onRetryExecution:y?void 0:C,onApprovalSubmit:y||j?void 0:e.submitApproval,submittingApprovalIds:S.submittingApprovalIds,approvalErrors:S.approvalErrors,showFileReviewRecords:!0,onEditMessage:y||!S.isStoppable?void 0:M,workspaceEntries:S.workspaceEntries,onFilePathClick:v,sandboxWorkspaceRoot:e.sandboxWorkspaceRoot,onBuildFromPlan:y?void 0:m,onOpenPlan:h,org:l,planActionsDisabled:y||!S.canSendFollowUp||p,planBuildPending:p,contentColumn:"center",slots:w,className:"stg:flex-1"}),(0,t.jsxs)("div",{className:"stg:mx-auto stg:w-full stg:max-w-3xl",children:[f&&(0,t.jsx)(nG,{onDismiss:x}),S.isReconnecting&&(0,t.jsx)(nX,{}),S.connectTimedOut&&(0,t.jsx)(nZ,{onRetry:S.reconnectStream}),S.isSlow&&!S.connectTimedOut&&(0,t.jsx)(nQ,{}),S.streamError&&(0,t.jsx)(n0,{error:S.streamError,onReconnect:S.reconnectStream}),!y&&N&&(0,t.jsx)(nJ,{error:N}),!y&&e.autoApproveAll&&(0,t.jsx)(rG,{onTurnOff:()=>e.setAutoApproveAll(!1)}),(0,t.jsxs)(r7.FilePathContext.Provider,{value:P,children:[(0,t.jsx)(r4,{progress:S.fileChangeProgress}),!y&&(0,t.jsx)(r6,{changeSets:S.fileChangeSets,onSubmit:S.submitFileDecision,submittingDecisionKeys:S.submittingFileDecisionKeys,decisionErrors:S.fileDecisionErrors})]}),!y&&(0,t.jsx)(te,{ref:o,onSubmit:I,isSubmitting:S.isSending,disabled:!S.canSendFollowUp,onStop:S.isStoppable?E:void 0,isStopping:S.isStopping,isEditing:null!=R,onCancelEdit:L,org:l,harness:e.harness,defaultModelId:r,onModelChange:n,interactionMode:i,onInteractionModeChange:a,showInteractionModePicker:!j,showModelSelector:k,enableAttachments:!j,workspace:j?void 0:e.workspace,gitHubConnection:j?void 0:g,enableGitHub:c&&!j,enableLocal:u&&!j,onBrowseLocalFolder:d,agentRef:e.agentRef,onAgentRefChange:j?void 0:e.setAgentRef,onAgentResolutionChange:j?void 0:e.setResolution,isDefaultAgent:e.isDefaultAgent,lockAgent:b,mcpServerUsages:b?void 0:e.mcpServerUsages,onMcpServerUsagesChange:b?void 0:e.setMcpServerUsages,skillRefs:b?void 0:e.skillRefs,onSkillRefsChange:b?void 0:e.setSkillRefs,sessionVariables:b?void 0:e.sessionVariables,className:"stg:px-4 stg:py-3"})]})]})});function nz({flow:e,org:r,panel:n,accessSlot:i,onApplied:a,onImplementPlan:o,implementPlanDisabled:l,sessionPlan:g,streamingPlan:c,planDraft:u,openPlanExecutionId:d,onOpenPlan:m,onOpenArtifact:h,onActivateArtifact:p,enableLocal:f,onBrowseLocalFolder:x,workspaceFileLister:v,workspaceFileReader:b,workspaceContentSearcher:j,isCurated:y,isObserver:k,exportSessionId:w}){var S,N;let C,E,{editors:R,activeKey:A,activeFile:T,reveal:M}=(0,ti.useWorkspaceEditors)(n.editorsStore),{artifacts:L}=sD(e.allExecutions),I=M&&M.key===A?M:void 0,P=function(e,t,r,n){var i;let{fileChanges:a}=(i=e?t:nm,(0,s.useMemo)(()=>{let e=(0,nd.deriveExecutionFileChanges)(i);return{fileChanges:e,hasFileChanges:e.length>0,fileChangeCount:e.length}},[i]));return(0,s.useMemo)(()=>e&&r?function(e,t,s,r){for(let n of t){let t=r0(n.path||n.absolutePath,s,r);if(null!==t&&t.entryId===e.entryId&&t.path===e.path)return n}return null}(e,a,r,n)??null:null,[e,a,r,n])}(T&&!(0,ta.isVirtualEntryId)(T.entryId)?T:null,e.allExecutions,e.workspace.entries,e.sandboxWorkspaceRoot),D=(0,s.useMemo)(()=>{if(null===d||d===g?.executionId)return g;let t=e.allExecutions.find(e=>e.metadata?.id===d),s=(0,rD.findPlanArtifact)(t);return s?{executionId:d,artifact:s}:g},[d,g,e.allExecutions]),F=D?.executionId===g?.executionId,O=(0,s.useMemo)(()=>({entryId:sM,path:sL,content:c?(0,t.jsx)(nC,{displayText:c.displayText},`streaming-${c.executionId}`):D?(0,t.jsx)(nb,{plan:D,draft:F?u:void 0,onBuildFromPlan:F?o:void 0,buildDisabled:l,readOnly:!F},nh(D)):(0,t.jsx)(nq,{})}),[c,D,F,u,o,l]),B=(0,s.useMemo)(()=>new Map(L.map(e=>[sP(e.artifact),e])),[L]),$=(0,s.useMemo)(()=>R.filter(e=>e.entryId===sI).map(e=>{let s=B.get(e.path);return{entryId:sI,path:e.path,content:s?(0,t.jsx)(nM,{artifact:s.artifact,executionId:s.executionId,org:r,isTerminal:s.isTerminal,onApplied:a},s.artifact.contentHash||e.path):(0,t.jsx)(nY,{})}}),[R,B,r,a]),V=(0,s.useMemo)(()=>[O,...$],[O,$]),_=(0,s.useCallback)(()=>{e.setAgentRef(null),e.setResolution(null)},[e.setAgentRef,e.setResolution]),U=(0,s.useCallback)(t=>{e.setMcpServerUsages(e.mcpServerUsages.filter(e=>e.mcpServerRef.org!==t.org||e.mcpServerRef.slug!==t.slug))},[e.mcpServerUsages,e.setMcpServerUsages]),W=(0,s.useCallback)(t=>{e.setSkillRefs(e.skillRefs.filter(e=>e.org!==t.org||e.slug!==t.slug))},[e.skillRefs,e.setSkillRefs]),z=(0,s.useMemo)(()=>({agentRef:e.agentRef,isDefaultAgent:e.isDefaultAgent,mcpServerUsages:e.mcpServerUsages,skillRefs:e.skillRefs,sessionVariables:e.sessionVariables,harness:e.harness,executionTarget:e.executionTarget,modelId:e.model[0],autoApprove:k?void 0:{armed:e.autoApproveAll,onChange:e.setAutoApproveAll},sessionId:w,mutations:y?void 0:{onRemoveAgent:e.isDefaultAgent?void 0:_,onRemoveMcp:U,onRemoveSkill:W},accessSlot:i}),[e.agentRef,e.isDefaultAgent,e.mcpServerUsages,e.skillRefs,e.sessionVariables,e.harness,e.executionTarget,e.model,e.autoApproveAll,e.setAutoApproveAll,k,w,y,_,U,W,i]),K="cloud"===e.executionTarget&&e.workspace.entries.some(e=>"git"===e.type),H=e.displayExecution?.status?.phase??tL.ExecutionPhase.EXECUTION_PHASE_UNSPECIFIED,q=rU({allExecutions:e.allExecutions,org:r,sessionConfig:z,onApplied:a,onImplementPlan:o,onOpenPlan:m,onOpenArtifact:h,onActivateArtifact:p,expectsWriteBack:K,changesSettled:(0,sT.isTerminalPhase)(H)}),Y=f&&!!x,G=(0,s.useCallback)(async()=>{let t=await x?.();t&&e.workspace.addLocalPath(t)},[x,e.workspace.addLocalPath]),J=(S=e.allExecutions,N=e.workspace.entries,E=[...C=function(e){let t=new Map;for(let s of e)for(let e of s.status?.workspaceWriteBacks??[])e.commitSha&&t.set(e.workspaceEntryName,e.commitSha);return t}(S)].map(([e,t])=>`${e}\u0001${t}`).join("\0"),(0,s.useMemo)(()=>{if(0===C.size)return N;let e=N.filter(e=>"git"===e.type),t=!1,s=N.map(s=>{let r=function(e,t,s){if("git"!==e.type)return;let r=s.get(e.name);if(r)return r;if(1===t){let e=s.get("");if(e)return e;if(1===s.size)return s.values().next().value}}(s,e.length,C);return r&&r!==s.readRef?(t=!0,{...s,readRef:r}):s});return t?s:N},[N,E]));return(0,t.jsx)(se,{entries:J,lister:v,reader:b,searcher:j,view:n.view,onViewChange:n.setView,extraViews:q,virtualDocuments:V,onRemoveEntry:e.workspace.remove,onAddLocalFolder:Y?G:void 0,editors:R,selectedFile:T,onOpenFile:n.openFile,onActivateEditor:n.activateEditor,onPinEditor:n.pinEditor,onCloseEditor:n.closeEditor,onCollapse:n.closePanel,change:P??void 0,reveal:I,className:"stg:h-full"})}function nK({error:e}){return(0,t.jsx)("div",{className:"stg:flex stg:min-h-[60vh] stg:flex-col stg:items-center stg:justify-center stg:px-4",children:(0,t.jsxs)("div",{className:"stg:w-full stg:max-w-sm stg:space-y-6 stg:text-center",children:[(0,t.jsx)("div",{className:"stg:mx-auto stg:flex stg:size-12 stg:items-center stg:justify-center stg:rounded-full stg:bg-destructive-subtle",children:(0,t.jsx)(n1,{})}),(0,t.jsxs)("div",{className:"stg:space-y-2",children:[(0,t.jsx)("h1",{className:"stg:text-lg stg:font-semibold",children:"Failed to load session"}),(0,t.jsx)("p",{className:"stg:text-sm stg:text-muted-foreground",children:(0,n.getUserMessage)(e)})]}),(0,t.jsx)("button",{type:"button",onClick:()=>window.location.reload(),className:"stg:inline-flex stg:items-center stg:gap-1.5 stg:rounded-lg stg:border stg:border-border stg:bg-card stg:px-3 stg:py-1.5 stg:text-sm stg:font-medium stg:hover:bg-muted",children:"Try again"})]})})}function nH(){return(0,t.jsx)("div",{className:"stg:flex stg:h-full stg:items-center stg:justify-center",children:(0,t.jsxs)("div",{className:"stg:space-y-2 stg:text-center",children:[(0,t.jsx)(n5,{}),(0,t.jsx)("p",{className:"stg:text-sm stg:text-muted-foreground",children:"Starting session…"})]})})}function nq(){return(0,t.jsxs)("div",{role:"status",className:"stg:mx-auto stg:flex stg:w-full stg:max-w-3xl stg:flex-col stg:items-center stg:gap-1 stg:px-4 stg:py-8 stg:text-center",children:[(0,t.jsx)("p",{className:"stg:text-xs stg:font-medium stg:text-foreground",children:"This turn ended before a plan was completed."}),(0,t.jsx)("p",{className:"stg:text-xs stg:text-muted-foreground",children:"Any partial plan text remains in the conversation."})]})}function nY(){return(0,t.jsxs)("div",{role:"status",className:"stg:mx-auto stg:flex stg:w-full stg:max-w-3xl stg:flex-col stg:items-center stg:gap-1 stg:px-4 stg:py-8 stg:text-center",children:[(0,t.jsx)("p",{className:"stg:text-xs stg:font-medium stg:text-foreground",children:"This artifact is no longer available."}),(0,t.jsx)("p",{className:"stg:text-xs stg:text-muted-foreground",children:"It may have been replaced by a newer version of this session."})]})}function nG({onDismiss:e}){return(0,t.jsxs)("div",{role:"status",className:"stg:flex stg:items-center stg:gap-2 stg:border-t stg:border-border-muted stg:px-4 stg:py-1.5 stg:text-xs stg:text-muted-foreground",children:[(0,t.jsx)("span",{className:"stg:min-w-0 stg:flex-1 stg:truncate",children:"Couldn’t attach plan.md — the agent will follow the plan from the conversation instead."}),(0,t.jsx)("button",{type:"button",onClick:e,className:"stg:shrink-0 stg:rounded 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:"Dismiss"})]})}function nJ({error:e}){return em(e)?(0,t.jsx)(ed,{error:e,className:"stg:mx-4 stg:my-2"}):(0,t.jsx)("div",{role:"alert",className:"stg:border-t stg:border-border stg:px-4 stg:py-2 stg:text-xs stg:text-destructive",children:(0,n.getUserMessage)(e)})}function nX(){return(0,t.jsxs)("div",{role:"status","aria-live":"polite",className:"stg:flex stg:items-center stg:gap-2 stg:border-t stg:border-border stg:bg-muted stg:px-4 stg:py-2 stg:text-sm stg:text-muted-foreground",children:[(0,t.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"stg:shrink-0 stg:animate-spin stg:motion-reduce:animate-none","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}),(0,t.jsx)("span",{className:"stg:truncate",children:"Reconnecting…"})]})}function nZ({onRetry:e}){return(0,t.jsxs)("div",{role:"alert",className:"stg:flex stg:items-center stg:gap-3 stg:border-t stg:border-border stg:bg-muted stg:px-4 stg:py-2.5",children:[(0,t.jsx)("p",{className:"stg:min-w-0 stg:flex-1 stg:truncate stg:text-sm stg:text-muted-foreground",children:"The agent hasn’t started yet."}),(0,t.jsx)("button",{type:"button",onClick:e,className:"stg:inline-flex stg:shrink-0 stg:items-center stg:gap-1.5 stg:rounded-md stg:border stg:border-border stg:px-2 stg:py-1 stg:text-xs stg:font-medium stg:hover:bg-card",children:"Retry"})]})}function nQ(){return(0,t.jsxs)("div",{role:"status","aria-live":"polite",className:"stg:flex stg:items-center stg:gap-2 stg:border-t stg:border-border-muted stg:px-4 stg:py-1.5 stg:text-xs stg:text-muted-foreground",children:[(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 stg:motion-reduce:animate-none"}),(0,t.jsx)("span",{className:"stg:relative stg:inline-flex stg:h-2 stg:w-2 stg:rounded-full stg:bg-muted-foreground"})]}),(0,t.jsx)("span",{className:"stg:min-w-0 stg:flex-1 stg:truncate",children:"Still working — this is taking longer than usual."})]})}function n0({error:e,onReconnect:s}){return(0,t.jsxs)("div",{role:"alert",className:"stg:flex stg:items-center stg:gap-3 stg:border-t stg:border-border stg:bg-muted stg:px-4 stg:py-2.5",children:[(0,t.jsx)("p",{className:"stg:min-w-0 stg:flex-1 stg:truncate stg:text-sm stg:text-muted-foreground",children:(0,n.getUserMessage)(e)}),(0,t.jsx)("button",{type:"button",onClick:s,className:"stg:inline-flex stg:shrink-0 stg:items-center stg:gap-1.5 stg:rounded-md stg:border stg:border-border stg:px-2 stg:py-1 stg:text-xs stg:font-medium stg:hover:bg-card",children:"Reconnect"})]})}function n1(){return(0,t.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"stg:text-destructive",children:[(0,t.jsx)("path",{d:"M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"}),(0,t.jsx)("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),(0,t.jsx)("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]})}function n5(){return(0,t.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"stg:mx-auto stg:animate-spin stg:text-muted-foreground",children:(0,t.jsx)("path",{d:"M10 2a8 8 0 0 1 0 16",strokeLinecap:"round"})})}e.s(["SessionViewer",0,function({sessionId:e,org:n,gitHubConnection:i,enableGitHub:a=!0,enableLocal:o=!1,onBrowseLocalFolder:l,workspaceFileLister:g,workspaceFileReader:c,workspaceContentSearcher:u,getRuntimeEnv:d,audience:m="integrator",runConfig:h,accountDefaults:p,showModelSelector:f=!0,panel:x="auto",defaultPanelOpen:v,panelOpen:b,onPanelOpenChange:j,headerActions:y,transcriptExport:k=!0,accessSlot:w,onApplied:S,threadSlots:N,className:C}){let E=function(e){let{sessionId:t,org:r,getRuntimeEnv:n}=e,i="guest"===e.audience,a=i?void 0:e.runConfig;a&&sE(a);let o=a?.modelName,l=a?.serviceTier,g=a?.thinkingMode,c=(0,X.useStigmer)(),u=function(e,t){let r,n,i,a,o,l=(0,X.useStigmer)(),{session:g,isLoading:c,error:u,refetch:d}=function(e){let t=(0,X.useStigmer)(),{data:s,isLoading:r,isRefetching:n,error:i,refetch:a}=(0,tF.useFetch)(e?()=>t.session.get(e):null,[e,t],null,{cacheKey:e?`session:${e}`:void 0});return{session:s,isLoading:r,isRefetching:n,error:i,refetch:a}}(e),[m,h]=(0,s.useState)(!1),{executions:p,isLoading:f,error:x,refetch:v}=function(e,t){let s=(0,X.useStigmer)(),{data:r,isLoading:n,isRefetching:i,error:a,refetch:o}=(0,tF.useFetch)(e?()=>s.agentExecution.listBySession((0,Y.create)(eT.ListAgentExecutionsBySessionRequestSchema,{sessionId:e,pageSize:100})).then(e=>(0,sq.sortChronologically)(e.entries)):null,[e,s],[],{cacheKey:e?`session-executions:${e}`:void 0,refetchInterval:t?.refetchInterval,refetchOnWindowFocus:t?.refetchOnWindowFocus});return{executions:r,isLoading:n,isRefetching:i,error:a,refetch:o}}(e,{refetchInterval:!!m&&5e3,refetchOnWindowFocus:!0}),{create:b,isCreating:j,clearError:y}=(0,sk.useCreateAgentExecution)(),{update:k}=function(){let e=(0,X.useStigmer)(),[t,r]=(0,s.useState)(!1),[n,i]=(0,s.useState)(null),a=(0,s.useCallback)(()=>i(null),[]);return{update:(0,s.useCallback)(async t=>{r(!0),i(null);try{return await e.session.update(t)}catch(e){throw i(e instanceof Error?e.message:"Failed to update session"),e}finally{r(!1)}},[e]),isUpdating:t,error:n,clearError:a}}(),{submitApproval:w,submittingToolCallIds:S,errorsByToolCallId:N,error:C,clearError:E}=function(){let e=(0,X.useStigmer)(),t=(0,no.useKeyedSubmission)(),[r,n]=(0,s.useState)(null),i=(0,s.useCallback)(()=>{t.clearErrors(),n(null)},[t.clearErrors]),a=(0,s.useCallback)(async(s,r,i,a)=>{n(null);try{await t.run(r,async()=>{await e.agentExecution.submitApproval((0,Y.create)(eT.SubmitApprovalInputSchema,{agentExecutionId:s,toolCallId:r,action:i,comment:a??""}))})}catch(e){throw n((0,Z.toError)(e)),e}},[e,t.run]);return(0,s.useMemo)(()=>({submitApproval:a,submittingToolCallIds:t.submittingKeys,errorsByToolCallId:t.errorsByKey,error:r,clearError:i}),[a,t.submittingKeys,t.errorsByKey,r,i])}(),{submitFileDecision:R,submittingDecisionKeys:A,decisionErrors:T,clearDecisionError:M,error:L,clearError:I}=(0,nl.useFileReview)();r=(0,sN.useRunnerAdapter)(),n=(0,sw.useExecutionTarget)(),i=null!=g,a=g?.spec?.executionTarget,o=(0,s.useMemo)(()=>{if(i)return(0,nn.fromProtoExecutionTarget)(a??nr.ExecutionTarget.UNSPECIFIED)??n},[i,a,n]),(0,s.useEffect)(()=>{if(r&&e&&"local"===o)return r.onSessionOpened(e).catch(()=>{}),()=>{r.onSessionClosed(e).catch(()=>{})}},[r,e,o]);let[P,D]=(0,s.useState)(null),[F,O]=(0,s.useState)(null),[B,$]=(0,s.useState)(null),[V,_]=(0,s.useState)(null),U=(0,s.useRef)(null),W=(0,s.useMemo)(()=>{for(let e=p.length-1;e>=0;e--){let t=p[e].status?.phase;if(void 0===t||!(0,sT.isTerminalPhase)(t))return p[e].metadata?.id??null}return null},[p]),z=P??W,K=(0,ti.useConversationStoreRef)(),H=(0,na.useExecutionStream)(z,{store:K}),q=null!==z&&(0,sT.isTerminalPhase)(H.phase),G=!H.isStreaming&&!q&&(null===z&&0===p.length||H.connectTimedOut||null!==H.error);(0,s.useEffect)(()=>{h(G)},[G]),(0,s.useEffect)(()=>{P&&p.some(e=>(e.metadata?.id??"")===P)&&D(null)},[P,p]),(0,s.useEffect)(()=>{H.execution&&(F&&O(null),B&&$(null),V&&_(null))},[F,B,V,H.execution]),(0,s.useEffect)(()=>{z&&(0,sT.isTerminalPhase)(H.phase)&&v()},[z,H.phase,v]);let J=H.execution?.spec?.supersedesExecutionId||null,Q=(0,s.useMemo)(()=>(0,sq.supersededExecutionIds)(p,J),[p,J]),ee=(0,s.useMemo)(()=>p.filter(e=>{let t=e.metadata?.id??"";return(!z||t!==z)&&!Q.has(t)}),[p,z,Q]),et=(0,s.useMemo)(()=>z?p.find(e=>(e.metadata?.id??"")===z)??null:null,[p,z]),es=H.execution??et,er=(0,s.useMemo)(()=>z?H.phase:null,[z,H.phase]),en=er===tL.ExecutionPhase.EXECUTION_PENDING||er===tL.ExecutionPhase.EXECUTION_IN_PROGRESS,ei=function(e,t){let r=(0,X.useStigmer)(),[n,i]=(0,s.useState)(!1),[a,o]=(0,s.useState)(null),l=(0,s.useRef)(e);l.current=e;let g=(0,s.useRef)(r);g.current=r;let c=(0,s.useRef)(t?.onSuccess);c.current=t?.onSuccess;let u=(0,s.useCallback)(()=>o(null),[]),d=(0,s.useCallback)(async e=>{if(!l.current)return null;i(!0),o(null);try{let t=await e();return c.current?.(t),t}catch(e){return o((0,Z.toError)(e)),null}finally{i(!1)}},[]),m=(0,s.useCallback)(e=>d(()=>g.current.agentExecution.cancel((0,Y.create)(eT.CancelAgentExecutionInputSchema,{id:l.current,reason:e??""}))),[d]),h=(0,s.useCallback)(e=>d(()=>g.current.agentExecution.terminate((0,Y.create)(eT.TerminateAgentExecutionInputSchema,{id:l.current,reason:e??""}))),[d]),p=(0,s.useCallback)(e=>d(()=>g.current.agentExecution.pause((0,Y.create)(eT.PauseAgentExecutionInputSchema,{id:l.current,reason:e??""}))),[d]),f=(0,s.useCallback)(()=>d(()=>g.current.agentExecution.resume((0,Y.create)(eT.ResumeAgentExecutionInputSchema,{id:l.current}))),[d]),x=(0,s.useRef)(null),v=(0,s.useCallback)(e=>{let t=l.current;return t?(x.current?.id!==t&&(x.current={id:t,cancelIssued:!1}),x.current.cancelIssued)?h(e):(x.current.cancelIssued=!0,m(e)):Promise.resolve(null)},[m,h]);return{cancel:m,terminate:h,pause:p,resume:f,stop:v,isSubmitting:n,error:a,clearError:u}}(z,{onSuccess:v}),ea=(0,s.useCallback)(async e=>{en&&await ei.stop(e)},[en,ei.stop]),eo=!j&&null===z,el=(0,s.useMemo)(()=>g?.spec?.workspaceEntries??[],[g]),eg=(0,s.useMemo)(()=>g?.spec?.mcpServerUsages??[],[g]),ec=(0,s.useMemo)(()=>g?.spec?.skillRefs??[],[g]),eu=(0,s.useCallback)(async(s,r)=>{if(e&&g){U.current={message:s,options:r},_(null),r?.buildFromPlan||(O(s),$(r?.attachments??null));try{if(r?.agentInstanceId!==void 0||r?.workspaceEntries!==void 0||r?.mcpServerUsages!==void 0||r?.skillRefs!==void 0){var n,i;let t,s,a,o,g=await l.session.get(e);await k((n=g,i={agentInstanceId:r?.agentInstanceId,workspaceEntries:r?.workspaceEntries,mcpServerUsages:r?.mcpServerUsages,skillRefs:r?.skillRefs},t=(0,ni.toSessionUpdateInput)(n),s=i.workspaceEntries??t.workspaceEntries,a=i.mcpServerUsages??t.mcpServerUsages,o=i.skillRefs??t.skillRefs,{...t,agentInstanceId:i.agentInstanceId??t.agentInstanceId,workspaceEntries:s?.length?s:void 0,mcpServerUsages:a?.length?a:void 0,skillRefs:o?.length?o:void 0})),d()}let a=await b({org:t,sessionId:e,message:s,modelName:r?.modelName,runtimeEnv:r?.runtimeEnv,attachments:r?.attachments,interactionMode:r?.interactionMode,serviceTier:r?.serviceTier,thinkingMode:r?.thinkingMode,buildFromPlan:r?.buildFromPlan,autoApproveAll:r?.autoApproveAll,workspaceFileRefs:r?.workspaceFileRefs,supersedesExecutionId:r?.supersedesExecutionId});D(a.executionId),v()}catch(e){O(s),$(r?.attachments??null),_((0,Z.toError)(e))}}},[e,g,t,l,b,k,v,d]),ed=(0,s.useCallback)(()=>{let e=U.current;e&&eu(e.message,e.options)},[eu]),em=(0,s.useCallback)(()=>{_(null),y()},[y]),eh=(0,s.useMemo)(()=>es?.status?.pendingApprovals??[],[es]),ep=(0,s.useCallback)(async(e,t,s)=>{z&&await w(z,e,t,s)},[z,w]),ef=(0,s.useMemo)(()=>(es?.status?.fileChangeSets??[]).filter(e=>e.status===tL.FileChangeSetStatus.AWAITING_REVIEW),[es]),ex=(0,s.useMemo)(()=>es?.status?.fileChangeProgress,[es]),ev=(0,s.useCallback)(async(e,t,s)=>{z&&await R(z,e,t,s)},[z,R]);return{session:g,completedExecutions:ee,activeStreamExecution:es,activePhase:er,isStreaming:H.isStreaming,isConnecting:H.isConnecting,sendFollowUp:eu,canSendFollowUp:eo,isSending:j,sendError:V,clearSendError:em,retryLastSend:ed,pendingUserMessage:F,pendingAttachments:B,workspaceEntries:el,mcpServerUsages:eg,skillRefs:ec,pendingApprovals:eh,submitApproval:ep,submittingApprovalIds:S,approvalErrors:N,approvalError:C,clearApprovalError:E,fileChangeSets:ef,fileChangeProgress:ex,submitFileDecision:ev,submittingFileDecisionKeys:A,fileDecisionErrors:T,clearFileDecisionError:M,fileReviewError:L,clearFileReviewError:I,isStoppable:en,stop:ea,isStopping:ei.isSubmitting,stopError:ei.error,isLoading:c||f,loadError:u||x,isReconnecting:H.isReconnecting,connectTimedOut:H.connectTimedOut,isSlow:H.isSlow,streamError:H.error,reconnectStream:H.reconnect}}(t,r),d=(0,A.fromProtoHarness)(u.session?.spec?.harness??nr.Harness.UNSPECIFIED),m=(0,nn.fromProtoExecutionTarget)(u.session?.spec?.executionTarget??nr.ExecutionTarget.UNSPECIFIED),[h,p]=function(e){let t=e?.harness,r=e?.enabled??!0,{getModel:n}=(0,V.useModelRegistry)({harness:t}),i="cursor"===t?"stigmer:session:model:cursor":"stigmer:session:model",a=(0,s.useRef)(i),[o,l]=(0,s.useState)(()=>{if(!r)return;let e=localStorage.getItem(i);return e?ng(e):void 0});return((0,s.useEffect)(()=>{if(!r||a.current===i)return;a.current=i;let e=localStorage.getItem(i);l(e?ng(e):void 0)},[r,i]),(0,s.useEffect)(()=>{r&&o&&localStorage.setItem(i,o)},[r,o,i]),r)?[o&&n(o)?o:void 0,l]:[void 0,nc]}({harness:d,enabled:!i}),f=(0,s.useMemo)(()=>{let e=u.completedExecutions.at(-1);return e?.spec?.executionConfig?.modelName||void 0},[u.completedExecutions]),x=h??f,v=[x,p],b=(0,s.useMemo)(()=>(0,ns.fromProtoInteractionMode)(u.completedExecutions.at(-1)?.spec?.executionConfig?.interactionMode),[u.completedExecutions]),[j,y]=(0,s.useState)(null),k=(0,sb.useWorkspaceEntries)(),w=sy(),[S,N]=(0,s.useState)([]),[C,E]=(0,s.useState)([]),R=(0,s.useRef)(!1),T=(0,sS.useApprovalDefaults)(),[M,L]=(0,s.useState)(null),I=!i&&(e.accountDefaults?.autoApprove??!1),P=!i&&(T?.autoApproveAll??!1),D=u.activeStreamExecution?.spec?.autoApproveAll===!0,F=M??(I||P||D),O=(0,s.useCallback)(e=>{L(e)},[]),B=(0,s.useCallback)(async(e,t,s)=>{t===tL.ApprovalAction.APPROVE_ALL&&L(!0),await u.submitApproval(e,t,s)},[u.submitApproval]),$=!i&&"observer"!==e.audience&&!(0,nu.isChannelOriginSession)(u.session),_=(0,s.useRef)(new Set);(0,s.useEffect)(()=>{if(F&&$)for(let e of u.pendingApprovals){let t=e.toolCallId;!t||_.current.has(t)||(_.current.add(t),u.submitApproval(t,tL.ApprovalAction.APPROVE_ALL).catch(()=>{}))}},[F,$,u.pendingApprovals,u.submitApproval]);let U=u.session?.spec?.agentInstanceId??null,{agentRef:W}=function(e){let t=(0,X.useStigmer)(),[r,n]=(0,s.useState)(null),[i,a]=(0,s.useState)(!1),[o,l]=(0,s.useState)(null);return(0,s.useEffect)(()=>{if(!e){n(null),a(!1),l(null);return}let s={current:!1};return a(!0),l(null),(async()=>{let r=await t.agentInstance.get(e);if(s.current)return;let i=r.spec?.agentId;if(!i)throw Error(`AgentInstance "${e}" has no spec.agentId. Cannot derive an agent reference.`);let o=await t.agent.get(i);if(s.current)return;let l=o.metadata?.org,g=o.metadata?.slug;if(!l||!g)throw Error(`Agent "${i}" is missing metadata.org or metadata.slug. Cannot construct a ResourceRef.`);n({org:l,slug:g,kind:J.ApiResourceKind.agent}),a(!1)})().catch(e=>{s.current||(l((0,Z.toError)(e)),n(null),a(!1))}),()=>{s.current=!0}},[e,t]),{agentRef:r,isLoading:i,error:o}}(i?null:U),{agent:z,isLoading:K}=sx(i?null:r),[H,q]=(0,s.useState)(null),[G,Q]=(0,s.useState)(null),[ee,et]=(0,s.useState)(!1),[es,er]=(0,s.useState)(!1);!es&&W&&U&&!K&&(er(!0),q(W),Q({mode:"saved",instanceId:U}),et(!!(z&&W.org===z.metadata?.org&&W.slug===z.metadata?.slug))),(0,s.useEffect)(()=>{if(!u.session||R.current)return;R.current=!0;let e=u.session.spec;for(let t of e?.workspaceEntries??[])if(t.source?.source.case==="gitRepo"){let{url:e,branch:s}=t.source.source.value;k.addGitRepo(e,s||void 0)}else t.source?.source.case==="localPath"&&k.addLocalPath(t.source.source.value.path);let t=(0,ni.toSessionUpdateInput)(u.session);t.mcpServerUsages?.length&&N(t.mcpServerUsages),t.skillRefs?.length&&E(t.skillRefs)},[u.session,k]);let[en,ei]=(0,s.useState)(null),ea=(0,s.useCallback)(async(e,t,s)=>{let r,i;ei(null);try{if(G){if("saved"===G.mode&&G.instanceId!==U)r=G.instanceId;else if("direct"===G.mode&&H){let e=await c.agent.getByReference(H),t=e.status?.defaultInstanceId;t&&t!==U&&(r=t)}}i=n?await sC(n,s?.runtimeEnv):s?.runtimeEnv}catch(e){ei(e instanceof Error?e:Error(String(e)));return}u.sendFollowUp(e,{agentInstanceId:r,modelName:o??t??x,workspaceEntries:k.hasEntries?k.toInput():void 0,mcpServerUsages:S.length>0?S:void 0,skillRefs:C.length>0?C:void 0,runtimeEnv:i,attachments:s?.attachments,interactionMode:s?.interactionMode,serviceTier:o?"fast"===l?"fast":void 0:s?.serviceTier,thinkingMode:o?"enabled"===g?"enabled":void 0:s?.thinkingMode,buildFromPlan:s?.buildFromPlan,autoApproveAll:F||void 0,workspaceFileRefs:s?.workspaceFileRefs,supersedesExecutionId:s?.supersedesExecutionId}),w.clear()},[u.sendFollowUp,x,o,l,g,k,S,C,w.clear,G,H,U,c,F,n]),eo=(0,s.useMemo)(()=>{if(u.activeStreamExecution)return u.activeStreamExecution;let e=u.completedExecutions;return e.length>0?e[e.length-1]:null},[u.activeStreamExecution,u.completedExecutions]),el=(0,s.useMemo)(()=>[...u.completedExecutions,...u.activeStreamExecution?[u.activeStreamExecution]:[]],[u.completedExecutions,u.activeStreamExecution]),eg=(0,s.useMemo)(()=>u.workspaceEntries.some(e=>e.source?.source.case==="gitRepo")?"/home/daytona/workspace":void 0,[u.workspaceEntries]);return{conv:u,harness:d,executionTarget:m,model:v,interactionMode:[j??b??"agent",y],agentRef:H,setAgentRef:q,resolution:G,setResolution:Q,isDefaultAgent:ee,mcpServerUsages:S,setMcpServerUsages:N,skillRefs:C,setSkillRefs:E,workspace:k,sessionVariables:w,autoApproveAll:F,setAutoApproveAll:O,submitApproval:B,handleSubmit:ea,submitError:en,displayExecution:eo,allExecutions:el,sandboxWorkspaceRoot:eg}}({sessionId:e,org:n,getRuntimeEnv:d,audience:m,runConfig:h,accountDefaults:p}),{conv:R}=E,T="guest"===m,M=f&&!T&&h?.modelName===void 0,L="observer"===m||(0,nu.isChannelOriginSession)(R.session),I="integrator"!==m||L,P="none"!==x&&!T,[D,F]=E.model,[O,B]=E.interactionMode,$=(0,s.useRef)(null),_=E.displayExecution?.status?.phase??tL.ExecutionPhase.EXECUTION_PHASE_UNSPECIFIED,U=_!==tL.ExecutionPhase.EXECUTION_PHASE_UNSPECIFIED,{hasWriteBacks:W,writeBackCount:z}=sO(E.allExecutions),{artifactCount:K}=sD(E.allExecutions),H=(0,X.useStigmer)(),q=(0,s.useMemo)(()=>(0,rD.findLatestSessionPlan)(E.allExecutions),[E.allExecutions]),G=function(e){let[t,r]=(0,s.useState)(null),n=e?nh(e):null,i=null!==t&&null!==n&&t.key===n?t.text:null,a=(0,s.useRef)(t);a.current=t;let o=(0,s.useRef)(n);o.current=n;let l=(0,s.useCallback)(e=>{let t=o.current;t&&r(null===e?null:{key:t,text:e})},[]),g=(0,s.useCallback)(()=>{let e=a.current,t=o.current;return null!==e&&null!==t&&e.key===t?e.text:null},[]);return(0,s.useMemo)(()=>({draftText:i,isEdited:null!==i,setDraft:l,readDraft:g}),[i,l,g])}(q),Q=(0,s.useMemo)(()=>{let e=R.activeStreamExecution,t=(0,nt.findStreamingPlan)(e),s=e?.metadata?.id;return t&&s?{executionId:s,displayText:t.displayText}:void 0},[R.activeStreamExecution]),[ee,et]=(0,s.useState)(!1),[es,er]=(0,s.useState)(!1),[en,ei]=(0,s.useState)(null),ea=q?nh(q):null,eo=Q?`${Q.executionId}:streaming`:ea,[el,eg]=(0,s.useState)(eo);eo!==el&&(eg(eo),ei(null));let ec=sF({phase:U?_:null,hasChanges:W,planKey:P?eo:null,open:!!P&&b,defaultOpen:v,onOpenChange:P?j:void 0}),eu=(0,s.useCallback)(()=>{B("agent"),er(!1);let e=e=>{$.current?.submit("Build from plan",{interactionMode:"agent",buildFromPlan:!0,attachments:e})};if(!q)return void e();et(!0);let t=q.artifact.name;(async()=>{try{let s=G.readDraft()??await nU(H,q),r=await H.agentExecution.uploadAttachment((0,Y.create)(eT.UploadAttachmentRequestSchema,{filename:t,content:new TextEncoder().encode(s),contentType:"text/markdown"}));e([{filename:t,storageKey:r.storageKey,mountPath:`.stigmer/inputs/${t}`,contentType:"text/markdown"}])}catch{er(!0),e()}finally{et(!1)}})()},[B,q,G.readDraft,H]),ed=(0,s.useCallback)(e=>{ei(q&&e===q.executionId?null:e),ec.openPlanDocument()},[q,ec.openPlanDocument]),em=(0,s.useCallback)(e=>{ec.openArtifact(e.artifact)},[ec.openArtifact]),eh=(0,s.useCallback)(e=>{ec.pinArtifact(e.artifact)},[ec.pinArtifact]),ep=(0,s.useCallback)(e=>{if(!P)return!1;let t=r0(e,E.workspace.entries,E.sandboxWorkspaceRoot);return!!t&&(ec.openFile(t.entryId,t.path),!0)},[P,E.workspace.entries,E.sandboxWorkspaceRoot,ec.openFile]);return R.isLoading?(0,t.jsx)("div",{className:(0,r.cn)("stg:flex stg:h-full stg:w-full stg:flex-col",C),children:(0,t.jsx)(ne,{className:"stg:flex-1 stg:px-0"})}):R.loadError?(0,t.jsx)(nK,{error:R.loadError}):R.session||R.isLoading?(0,t.jsx)(tn,{className:C,headerActions:k&&!P?(0,t.jsxs)(t.Fragment,{children:[y,(0,t.jsx)(n_,{sessionId:e})]}):y,chip:P?(0,t.jsx)(rq,{isOpen:ec.isOpen,onToggle:ec.isOpen?ec.closePanel:ec.openPanel,badgeCount:z+K}):void 0,splitStorageKey:"stgm-session-chat-width",conversation:(0,t.jsx)(nW,{flow:E,modelId:D,setModelId:F,interactionMode:O,setInteractionMode:B,composerRef:$,org:n,gitHubConnection:i,enableGitHub:a,enableLocal:o,onBrowseLocalFolder:l,onBuildFromPlan:eu,onOpenPlan:ed,isBuildingFromPlan:ee,planAttachFailed:es,onDismissPlanAttachFailed:()=>er(!1),onFilePathClick:ep,isCurated:I,isGuest:T,isObserver:L,modelSelectorVisible:M,threadSlots:N}),panel:ec.isOpen&&P?(0,t.jsx)(nz,{flow:E,org:n,panel:ec,accessSlot:L?void 0:w,onApplied:S,onImplementPlan:L?void 0:eu,implementPlanDisabled:L||!R.canSendFollowUp||ee,sessionPlan:q,streamingPlan:Q,planDraft:G,openPlanExecutionId:en,onOpenPlan:ed,onOpenArtifact:em,onActivateArtifact:eh,enableLocal:o,onBrowseLocalFolder:l,workspaceFileLister:g,workspaceFileReader:c,workspaceContentSearcher:u,isCurated:I,isObserver:L,exportSessionId:k?e:null}):null}):(0,t.jsx)(nH,{})}],766895)}]);