@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,5 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,16715,379185,292270,e=>{"use strict";var t=e.i(475254);let s=(0,t.default)("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);e.s(["RefreshCw",0,s],16715);var r=e.i(843476),n=e.i(271645),a=e.i(891287),i=e.i(893976),o=e.i(610595),l=e.i(421415),u=e.i(586108),c=e.i(326283),d=e.i(367539),g=e.i(891914),m=e.i(379410);e.s(["CreateOrganizationForm",0,function({onCreated:e,onCancel:t,className:s}){let h=(0,n.useId)(),{create:p,isCreating:f,error:x,clearError:v}=function(){let e=(0,u.useStigmer)(),[t,s]=(0,n.useState)(!1),[r,a]=(0,n.useState)(null),i=(0,n.useCallback)(()=>a(null),[]);return{create:(0,n.useCallback)(async t=>{s(!0),a(null);try{return await e.organization.create(t)}catch(e){throw a((0,c.toError)(e)),e}finally{s(!1)}},[e]),isCreating:t,error:r,clearError:i}}(),[b,y]=(0,n.useState)(""),[k,j]=(0,n.useState)(""),[w,N]=(0,n.useState)(""),S=(0,n.useRef)(!1),C=b.trim(),E=k.length>0||C.length>0?(0,g.validateMessage)(l.ApiResourceMetadataSchema,(0,a.create)(l.ApiResourceMetadataSchema,{...k.length>0&&{slug:k},...C.length>0&&{name:C}})):[],T=k.length>0?(0,g.getFieldError)(E,"slug"):null,A=C.length>0?(0,g.getFieldError)(E,"name"):null,I=""!==C&&k.length>0&&null===T&&null===A&&!f,M=(0,n.useCallback)(e=>{y(e),S.current||j((0,d.generateSlug)(e.trim()))},[]),O=(0,n.useCallback)(e=>{S.current=!0,j(e)},[]),R=(0,n.useCallback)(async t=>{if(t.preventDefault(),I){v();try{let t=await p({name:C,slug:k,org:k,description:w.trim()||void 0});e?.(t)}catch{}}},[I,C,k,w,p,v,e]);return(0,r.jsxs)("form",{onSubmit:R,className:(0,i.cn)("stg:space-y-3",s),children:[(0,r.jsxs)("div",{className:"stg:space-y-2",children:[(0,r.jsxs)("div",{className:"stg:space-y-1",children:[(0,r.jsx)("label",{htmlFor:`${h}-name`,className:"stg:text-xs stg:font-medium stg:text-foreground",children:"Name"}),(0,r.jsx)("input",{id:`${h}-name`,type:"text",value:b,onChange:e=>M(e.target.value),placeholder:"e.g. Acme Corp",disabled:f,autoFocus:!0,required:!0,maxLength:63,className:(0,i.cn)("stg:w-full stg:rounded-md stg:border stg:bg-background stg:px-2.5 stg:py-1.5 stg:text-xs stg:text-foreground","stg:placeholder:text-muted-foreground","stg:focus-visible:outline-none stg:focus-visible:ring-1 stg:focus-visible:ring-ring","stg:disabled:pointer-events-none stg:disabled:opacity-50",A?"stg:border-destructive":"stg:border-input")}),A?(0,r.jsx)("p",{className:"stg:text-[0.65rem] stg:text-destructive",role:"alert",children:A}):(0,r.jsx)("p",{className:"stg:text-[0.65rem] stg:text-muted-foreground",children:"A human-readable display name for the organization."})]}),(0,r.jsxs)("div",{className:"stg:space-y-1",children:[(0,r.jsx)("label",{htmlFor:`${h}-slug`,className:"stg:text-xs stg:font-medium stg:text-foreground",children:"Slug"}),(0,r.jsx)("input",{id:`${h}-slug`,type:"text",value:k,onChange:e=>O(e.target.value),placeholder:"e.g. acme-corp",disabled:f,required:!0,className:(0,i.cn)("stg:w-full stg:rounded-md stg:border stg:bg-background stg:px-2.5 stg:py-1.5 stg:text-xs stg:text-foreground stg:font-mono","stg:placeholder:text-muted-foreground","stg:focus-visible:outline-none stg:focus-visible:ring-1 stg:focus-visible:ring-ring","stg:disabled:pointer-events-none stg:disabled:opacity-50",T?"stg:border-destructive":"stg:border-input")}),T?(0,r.jsx)("p",{className:"stg:text-[0.65rem] stg:text-destructive",role:"alert",children:T}):(0,r.jsx)("p",{className:"stg:text-[0.65rem] stg:text-muted-foreground",children:"URL-friendly identifier used in resource references. 2–63 characters: lowercase letters, numbers, and hyphens."})]}),(0,r.jsxs)("div",{className:"stg:space-y-1",children:[(0,r.jsxs)("label",{htmlFor:`${h}-desc`,className:"stg:text-xs stg:font-medium stg:text-muted-foreground",children:["Description"," ",(0,r.jsx)("span",{className:"stg:text-muted-foreground-subtle",children:"(optional)"})]}),(0,r.jsx)("input",{id:`${h}-desc`,type:"text",value:w,onChange:e=>N(e.target.value),placeholder:"What is this organization for?",disabled:f,className:(0,i.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","stg:focus-visible:outline-none stg:focus-visible:ring-1 stg:focus-visible:ring-ring","stg:disabled:pointer-events-none stg:disabled:opacity-50")})]})]}),x&&(0,r.jsx)("p",{className:"stg:text-destructive stg:text-[0.65rem]",role:"alert",children:(0,o.getUserMessage)(x)}),(0,r.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-2",children:[(0,r.jsxs)("button",{type:"submit",disabled:!I,className:(0,i.cn)("stg:inline-flex stg:items-center stg:gap-1.5 stg:rounded-md stg:px-3 stg:py-1.5 stg:text-xs stg:font-medium","stg:bg-primary stg:text-primary-foreground stg:hover:bg-primary-hover","stg:disabled:pointer-events-none stg:disabled:opacity-40"),children:[f&&(0,r.jsx)(m.SpinnerIcon,{size:12}),"Create organization"]}),t&&(0,r.jsx)("button",{type:"button",onClick:t,disabled:f,className:(0,i.cn)("stg:rounded-md stg:px-3 stg:py-1.5 stg:text-xs","stg:text-muted-foreground stg:hover:text-foreground stg:hover:bg-accent-hover","stg:disabled:pointer-events-none stg:disabled:opacity-50"),children:"Cancel"})]})]})}],379185);let h=(0,t.default)("log-out",[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]]);e.s(["LogOut",0,h],292270)},693079,e=>{"use strict";let t,s,r,n,a,i;var o=e.i(843476),l=e.i(271645),u=e.i(618566);e.i(247167);var c=e.i(363178);function d(e){return(0,o.jsx)(c.ThemeProvider,{...e})}var g={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},m=new class{#e=g;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},h="u"<typeof window||"Deno"in globalThis;function p(){}function f(e,t){return"function"==typeof e?e(t):e}function x(e,t){let{type:s="all",exact:r,fetchStatus:n,predicate:a,queryKey:i,stale:o}=e;if(i){if(r){if(t.queryHash!==b(i,t.options))return!1}else if(!k(t.queryKey,i))return!1}if("all"!==s){let e=t.isActive();if("active"===s&&!e||"inactive"===s&&e)return!1}return("boolean"!=typeof o||t.isStale()===o)&&(!n||n===t.state.fetchStatus)&&(!a||!!a(t))}function v(e,t){let{exact:s,status:r,predicate:n,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(s){if(y(t.options.mutationKey)!==y(a))return!1}else if(!k(t.options.mutationKey,a))return!1}return(!r||t.state.status===r)&&(!n||!!n(t))}function b(e,t){return(t?.queryKeyHashFn||y)(e)}function y(e){return JSON.stringify(e,(e,t)=>N(t)?Object.keys(t).sort().reduce((e,s)=>(e[s]=t[s],e),{}):t)}function k(e,t){return e===t||typeof e==typeof t&&!!e&&!!t&&"object"==typeof e&&"object"==typeof t&&Object.keys(t).every(s=>k(e[s],t[s]))}var j=Object.prototype.hasOwnProperty;function w(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function N(e){if(!S(e))return!1;let t=e.constructor;if(void 0===t)return!0;let s=t.prototype;return!!S(s)&&!!s.hasOwnProperty("isPrototypeOf")&&Object.getPrototypeOf(e)===Object.prototype}function S(e){return"[object Object]"===Object.prototype.toString.call(e)}function C(e,t,s=0){let r=[...e,t];return s&&r.length>s?r.slice(1):r}function E(e,t,s=0){let r=[t,...e];return s&&r.length>s?r.slice(0,-1):r}var T=Symbol();function A(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:e.queryFn&&e.queryFn!==T?e.queryFn:()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`))}var I=(t=[],s=0,r=e=>{e()},n=e=>{e()},a=function(e){setTimeout(e,0)},{batch:e=>{let i;s++;try{i=e()}finally{let e;--s||(e=t,t=[],e.length&&a(()=>{n(()=>{e.forEach(e=>{r(e)})})}))}return i},batchCalls:e=>(...t)=>{i(()=>{e(...t)})},schedule:i=e=>{s?t.push(e):a(()=>{r(e)})},setNotifyFunction:e=>{r=e},setBatchNotifyFunction:e=>{n=e},setScheduler:e=>{a=e}}),M=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},O=new class extends M{#s;#r;#n;constructor(){super(),this.#n=e=>{if(!h&&window.addEventListener){let t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#r||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#r?.(),this.#r=void 0)}setEventListener(e){this.#n=e,this.#r?.(),this.#r=e(e=>{"boolean"==typeof e?this.setFocused(e):this.onFocus()})}setFocused(e){this.#s!==e&&(this.#s=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return"boolean"==typeof this.#s?this.#s:globalThis.document?.visibilityState!=="hidden"}},R=new class extends M{#a=!0;#r;#n;constructor(){super(),this.#n=e=>{if(!h&&window.addEventListener){let t=()=>e(!0),s=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",s)}}}}onSubscribe(){this.#r||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#r?.(),this.#r=void 0)}setEventListener(e){this.#n=e,this.#r?.(),this.#r=e(this.setOnline.bind(this))}setOnline(e){this.#a!==e&&(this.#a=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#a}};function _(e){return Math.min(1e3*2**e,3e4)}function D(e){return(e??"online")!=="online"||R.isOnline()}var P=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function F(e){let t,s=!1,r=0,n=function(){let e,t,s=new Promise((s,r)=>{e=s,t=r});function r(e){Object.assign(s,e),delete s.resolve,delete s.reject}return s.status="pending",s.catch(()=>{}),s.resolve=t=>{r({status:"fulfilled",value:t}),e(t)},s.reject=e=>{r({status:"rejected",reason:e}),t(e)},s}(),a=()=>O.isFocused()&&("always"===e.networkMode||R.isOnline())&&e.canRun(),i=()=>D(e.networkMode)&&e.canRun(),o=e=>{"pending"===n.status&&(t?.(),n.resolve(e))},l=e=>{"pending"===n.status&&(t?.(),n.reject(e))},u=()=>new Promise(s=>{t=e=>{("pending"!==n.status||a())&&s(e)},e.onPause?.()}).then(()=>{t=void 0,"pending"===n.status&&e.onContinue?.()}),c=()=>{let t;if("pending"!==n.status)return;let i=0===r?e.initialPromise:void 0;try{t=i??e.fn()}catch(e){t=Promise.reject(e)}Promise.resolve(t).then(o).catch(t=>{if("pending"!==n.status)return;let i=e.retry??3*!h,o=e.retryDelay??_,d="function"==typeof o?o(r,t):o,g=!0===i||"number"==typeof i&&r<i||"function"==typeof i&&i(r,t);s||!g?l(t):(r++,e.onFail?.(r,t),new Promise(e=>{m.setTimeout(e,d)}).then(()=>a()?void 0:u()).then(()=>{s?l(t):c()}))})};return{promise:n,status:()=>n.status,cancel:t=>{if("pending"===n.status){let s=new P(t);l(s),e.onCancel?.(s)}},continue:()=>(t?.(),n),cancelRetry:()=>{s=!0},continueRetry:()=>{s=!1},canStart:i,start:()=>(i()?c():u().then(c),n)}}var L=class{#i;destroy(){this.clearGcTimeout()}scheduleGc(){var e;this.clearGcTimeout(),"number"==typeof(e=this.gcTime)&&e>=0&&e!==1/0&&(this.#i=m.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(h?1/0:3e5))}clearGcTimeout(){this.#i&&(m.clearTimeout(this.#i),this.#i=void 0)}},W=class extends L{#o;#l;#u;#c;#d;#g;#m;constructor(e){super(),this.#m=!1,this.#g=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#c=e.client,this.#u=this.#c.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#o=U(this.options),this.state=e.state??this.#o,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#d?.promise}setOptions(e){if(this.options={...this.#g,...e},this.updateGcTime(this.options.gcTime),this.state&&void 0===this.state.data){let e=U(this.options);void 0!==e.data&&(this.setState(K(e.data,e.dataUpdatedAt)),this.#o=e)}}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.#u.remove(this)}setData(e,t){var s,r;let n=(s=this.state.data,"function"==typeof(r=this.options).structuralSharing?r.structuralSharing(s,e):!1!==r.structuralSharing?function e(t,s,r=0){if(t===s)return t;if(r>500)return s;let n=w(t)&&w(s);if(!n&&!(N(t)&&N(s)))return s;let a=(n?t:Object.keys(t)).length,i=n?s:Object.keys(s),o=i.length,l=n?Array(o):{},u=0;for(let c=0;c<o;c++){let o=n?c:i[c],d=t[o],g=s[o];if(d===g){l[o]=d,(n?c<a:j.call(t,o))&&u++;continue}if(null===d||null===g||"object"!=typeof d||"object"!=typeof g){l[o]=g;continue}let m=e(d,g,r+1);l[o]=m,m===d&&u++}return a===o&&u===a?t:l}(s,e):e);return this.#h({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#h({type:"setState",state:e,setStateOptions:t})}cancel(e){let t=this.#d?.promise;return this.#d?.cancel(e),t?t.then(p).catch(p):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#o)}isActive(){return this.observers.some(e=>{var t;return!1!==(t=e.options.enabled,"function"==typeof t?t(this):t)})}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===T||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>"static"===f(e.options.staleTime,this))}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):void 0===this.state.data||this.state.isInvalidated}isStaleByTime(e=0){return void 0===this.state.data||"static"!==e&&(!!this.state.isInvalidated||!Math.max(this.state.dataUpdatedAt+(e||0)-Date.now(),0))}onFocus(){let e=this.observers.find(e=>e.shouldFetchOnWindowFocus());e?.refetch({cancelRefetch:!1}),this.#d?.continue()}onOnline(){let e=this.observers.find(e=>e.shouldFetchOnReconnect());e?.refetch({cancelRefetch:!1}),this.#d?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#u.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#d&&(this.#m?this.#d.cancel({revert:!0}):this.#d.cancelRetry()),this.scheduleGc()),this.#u.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#h({type:"invalidate"})}async fetch(e,t){let s;if("idle"!==this.state.fetchStatus&&this.#d?.status()!=="rejected"){if(void 0!==this.state.data&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#d)return this.#d.continueRetry(),this.#d.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let r=new AbortController,n=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#m=!0,r.signal)})},a=()=>{let e,s=A(this.options,t),r=(n(e={client:this.#c,queryKey:this.queryKey,meta:this.meta}),e);return(this.#m=!1,this.options.persister)?this.options.persister(s,r,this):s(r)},i=(n(s={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#c,state:this.state,fetchFn:a}),s);this.options.behavior?.onFetch(i,this),this.#l=this.state,("idle"===this.state.fetchStatus||this.state.fetchMeta!==i.fetchOptions?.meta)&&this.#h({type:"fetch",meta:i.fetchOptions?.meta}),this.#d=F({initialPromise:t?.initialPromise,fn:i.fetchFn,onCancel:e=>{e instanceof P&&e.revert&&this.setState({...this.#l,fetchStatus:"idle"}),r.abort()},onFail:(e,t)=>{this.#h({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#h({type:"pause"})},onContinue:()=>{this.#h({type:"continue"})},retry:i.options.retry,retryDelay:i.options.retryDelay,networkMode:i.options.networkMode,canRun:()=>!0});try{let e=await this.#d.start();if(void 0===e)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#u.config.onSuccess?.(e,this),this.#u.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof P){if(e.silent)return this.#d.promise;else if(e.revert){if(void 0===this.state.data)throw e;return this.state.data}}throw this.#h({type:"error",error:e}),this.#u.config.onError?.(e,this),this.#u.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#h(e){let t=t=>{switch(e.type){case"failed":return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":var s;return{...t,...(s=t.data,{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:D(this.options.networkMode)?"fetching":"paused",...void 0===s&&{error:null,status:"pending"}}),fetchMeta:e.meta??null};case"success":let r={...t,...K(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#l=e.manual?r:void 0,r;case"error":let n=e.error;return{...t,error:n,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:n,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}};this.state=t(this.state),I.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#u.notify({query:this,type:"updated",action:e})})}};function K(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function U(e){let t="function"==typeof e.initialData?e.initialData():e.initialData,s=void 0!==t,r=s?"function"==typeof e.initialDataUpdatedAt?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:s?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}var B=class extends M{constructor(e={}){super(),this.config=e,this.#p=new Map}#p;build(e,t,s){let r=t.queryKey,n=t.queryHash??b(r,t),a=this.get(n);return a||(a=new W({client:e,queryKey:r,queryHash:n,options:e.defaultQueryOptions(t),state:s,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#p.has(e.queryHash)||(this.#p.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){let t=this.#p.get(e.queryHash);t&&(e.destroy(),t===e&&this.#p.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){I.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#p.get(e)}getAll(){return[...this.#p.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>x(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>x(e,t)):t}notify(e){I.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){I.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){I.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},z=class extends L{#c;#f;#x;#d;constructor(e){super(),this.#c=e.client,this.mutationId=e.mutationId,this.#x=e.mutationCache,this.#f=[],this.state=e.state||{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0},this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#f.includes(e)||(this.#f.push(e),this.clearGcTimeout(),this.#x.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#f=this.#f.filter(t=>t!==e),this.scheduleGc(),this.#x.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#f.length||("pending"===this.state.status?this.scheduleGc():this.#x.remove(this))}continue(){return this.#d?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#h({type:"continue"})},s={client:this.#c,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#d=F({fn:()=>this.options.mutationFn?this.options.mutationFn(e,s):Promise.reject(Error("No mutationFn found")),onFail:(e,t)=>{this.#h({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#h({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#x.canRun(this)});let r="pending"===this.state.status,n=!this.#d.canStart();try{if(r)t();else{this.#h({type:"pending",variables:e,isPaused:n}),this.#x.config.onMutate&&await this.#x.config.onMutate(e,this,s);let t=await this.options.onMutate?.(e,s);t!==this.state.context&&this.#h({type:"pending",context:t,variables:e,isPaused:n})}let a=await this.#d.start();return await this.#x.config.onSuccess?.(a,e,this.state.context,this,s),await this.options.onSuccess?.(a,e,this.state.context,s),await this.#x.config.onSettled?.(a,null,this.state.variables,this.state.context,this,s),await this.options.onSettled?.(a,null,e,this.state.context,s),this.#h({type:"success",data:a}),a}catch(t){try{await this.#x.config.onError?.(t,e,this.state.context,this,s)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,s)}catch(e){Promise.reject(e)}try{await this.#x.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,s)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,s)}catch(e){Promise.reject(e)}throw this.#h({type:"error",error:t}),t}finally{this.#x.runNext(this)}}#h(e){this.state=(t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"pending":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}})(this.state),I.batch(()=>{this.#f.forEach(t=>{t.onMutationUpdate(e)}),this.#x.notify({mutation:this,type:"updated",action:e})})}},q=class extends M{constructor(e={}){super(),this.config=e,this.#v=new Set,this.#b=new Map,this.#y=0}#v;#b;#y;build(e,t,s){let r=new z({client:e,mutationCache:this,mutationId:++this.#y,options:e.defaultMutationOptions(t),state:s});return this.add(r),r}add(e){this.#v.add(e);let t=$(e);if("string"==typeof t){let s=this.#b.get(t);s?s.push(e):this.#b.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#v.delete(e)){let t=$(e);if("string"==typeof t){let s=this.#b.get(t);if(s)if(s.length>1){let t=s.indexOf(e);-1!==t&&s.splice(t,1)}else s[0]===e&&this.#b.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){let t=$(e);if("string"!=typeof t)return!0;{let s=this.#b.get(t),r=s?.find(e=>"pending"===e.state.status);return!r||r===e}}runNext(e){let t=$(e);if("string"!=typeof t)return Promise.resolve();{let s=this.#b.get(t)?.find(t=>t!==e&&t.state.isPaused);return s?.continue()??Promise.resolve()}}clear(){I.batch(()=>{this.#v.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#v.clear(),this.#b.clear()})}getAll(){return Array.from(this.#v)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>v(t,e))}findAll(e={}){return this.getAll().filter(t=>v(e,t))}notify(e){I.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return I.batch(()=>Promise.all(e.map(e=>e.continue().catch(p))))}};function $(e){return e.options.scope?.id}function H(e){return{onFetch:(t,s)=>{let r=t.options,n=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],i=t.state.data?.pageParams||[],o={pages:[],pageParams:[]},l=0,u=async()=>{let s=!1,u=A(t.options,t.fetchOptions),c=async(e,r,n)=>{if(s)return Promise.reject();if(null==r&&e.pages.length)return Promise.resolve(e);let a=(()=>{var e,a;let i,o,l={client:t.client,queryKey:t.queryKey,pageParam:r,direction:n?"backward":"forward",meta:t.options.meta};return e=()=>t.signal,a=()=>s=!0,o=!1,Object.defineProperty(l,"signal",{enumerable:!0,get:()=>(i??=e(),o||(o=!0,i.aborted?a():i.addEventListener("abort",a,{once:!0})),i)}),l})(),i=await u(a),{maxPages:o}=t.options,l=n?E:C;return{pages:l(e.pages,i,o),pageParams:l(e.pageParams,r,o)}};if(n&&a.length){let e="backward"===n,t={pages:a,pageParams:i},s=(e?function(e,{pages:t,pageParams:s}){return t.length>0?e.getPreviousPageParam?.(t[0],t,s[0],s):void 0}:G)(r,t);o=await c(t,s,e)}else{let t=e??a.length;do{let e=0===l?i[0]??r.initialPageParam:G(r,o);if(l>0&&null==e)break;o=await c(o,e),l++}while(l<t)}return o};t.options.persister?t.fetchFn=()=>t.options.persister?.(u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},s):t.fetchFn=u}}}function G(e,{pages:t,pageParams:s}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,s[r],s):void 0}var V=class{#k;#x;#g;#j;#w;#N;#S;#C;constructor(e={}){this.#k=e.queryCache||new B,this.#x=e.mutationCache||new q,this.#g=e.defaultOptions||{},this.#j=new Map,this.#w=new Map,this.#N=0}mount(){this.#N++,1===this.#N&&(this.#S=O.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#k.onFocus())}),this.#C=R.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#k.onOnline())}))}unmount(){this.#N--,0===this.#N&&(this.#S?.(),this.#S=void 0,this.#C?.(),this.#C=void 0)}isFetching(e){return this.#k.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#x.findAll({...e,status:"pending"}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#k.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),s=this.#k.build(this,t),r=s.state.data;return void 0===r?this.fetchQuery(e):(e.revalidateIfStale&&s.isStaleByTime(f(t.staleTime,s))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#k.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,s){let r=this.defaultQueryOptions({queryKey:e}),n=this.#k.get(r.queryHash),a=n?.state.data,i="function"==typeof t?t(a):t;if(void 0!==i)return this.#k.build(this,r).setData(i,{...s,manual:!0})}setQueriesData(e,t,s){return I.batch(()=>this.#k.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,s)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#k.get(t.queryHash)?.state}removeQueries(e){let t=this.#k;I.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let s=this.#k;return I.batch(()=>(s.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){let s={revert:!0,...t};return Promise.all(I.batch(()=>this.#k.findAll(e).map(e=>e.cancel(s)))).then(p).catch(p)}invalidateQueries(e,t={}){return I.batch(()=>(this.#k.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType==="none")?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t))}refetchQueries(e,t={}){let s={...t,cancelRefetch:t.cancelRefetch??!0};return Promise.all(I.batch(()=>this.#k.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,s);return s.throwOnError||(t=t.catch(p)),"paused"===e.state.fetchStatus?Promise.resolve():t}))).then(p)}fetchQuery(e){let t=this.defaultQueryOptions(e);void 0===t.retry&&(t.retry=!1);let s=this.#k.build(this,t);return s.isStaleByTime(f(t.staleTime,s))?s.fetch(t):Promise.resolve(s.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(p).catch(p)}fetchInfiniteQuery(e){return e.behavior=H(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(p).catch(p)}ensureInfiniteQueryData(e){return e.behavior=H(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return R.isOnline()?this.#x.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#k}getMutationCache(){return this.#x}getDefaultOptions(){return this.#g}setDefaultOptions(e){this.#g=e}setQueryDefaults(e,t){this.#j.set(y(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#j.values()],s={};return t.forEach(t=>{k(e,t.queryKey)&&Object.assign(s,t.defaultOptions)}),s}setMutationDefaults(e,t){this.#w.set(y(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#w.values()],s={};return t.forEach(t=>{k(e,t.mutationKey)&&Object.assign(s,t.defaultOptions)}),s}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#g.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=b(t.queryKey,t)),void 0===t.refetchOnReconnect&&(t.refetchOnReconnect="always"!==t.networkMode),void 0===t.throwOnError&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===T&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#g.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#k.clear(),this.#x.clear()}},X=l.createContext(void 0),Q=({client:e,children:t})=>(l.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,o.jsx)(X.Provider,{value:e,children:t})),Y=e.i(531278),J=e.i(610595),Z=e.i(941693),ee=e.i(297629);e.i(67407);var et=e.i(282155),es=e.i(671010),er=e.i(272012),en=e.i(163308),ea=e.i(800692),ei=e.i(472402);function eo(){try{let e=new URL((0,ei.getApiBaseUrl)()).hostname;if("localhost"===e||"127.0.0.1"===e||"::1"===e)return"local"}catch{return"local"}return"cloud"}function el({children:e}){let{accessToken:t,logout:s}=(0,ea.useAuth)(),{resolvedTheme:r}=(0,c.useTheme)(),n=(0,l.useCallback)(()=>t,[t]),a=(0,l.useCallback)(()=>s(),[s]),i=(0,l.useMemo)(()=>new er.Stigmer({baseUrl:(0,ei.getApiBaseUrl)(),getAccessToken:n,onUnauthenticated:a}),[n,a]),u=function(e){let[t,s]=(0,l.useState)(eo),r=(0,l.useMemo)(()=>e,[e]);return(0,l.useEffect)(()=>{if(!r)return;let e=!1;return r.platform.getServerInfo().then(t=>{e||s(t.deploymentMode)},()=>{}),()=>{e=!0}},[r]),t}(i);return(0,o.jsx)(en.StigmerProvider,{client:i,deploymentMode:u,colorMode:"dark"===r?"dark":"light",preset:"monochrome",children:e})}var eu=e.i(846696),ec=e.i(444868);function ed(e){let t=(0,ec.useColorMode)();return(0,o.jsx)(eu.Toaster,{theme:t,position:"top-right",richColors:!0,className:"toaster stg:group",toastOptions:{classNames:{toast:"stg:group toast stg:group-[.toaster]:bg-background stg:group-[.toaster]:text-foreground stg:group-[.toaster]:border-border stg:group-[.toaster]:shadow-lg",description:"stg:group-[.toast]:text-muted-foreground",actionButton:"stg:group-[.toast]:bg-primary stg:group-[.toast]:text-primary-foreground",cancelButton:"stg:group-[.toast]:bg-muted stg:group-[.toast]:text-muted-foreground"}},...e})}var eg=e.i(63209),em=e.i(16715),eh=e.i(607486),ep=e.i(292270),ef=e.i(379185),ex=e.i(707125);let ev=["/invite/"];function eb({children:e}){let t=(0,u.usePathname)(),{state:s,retry:r,refresh:n}=function(e){let{isBypassed:t,isOidcMode:s}=e,{orgs:r,isLoading:n,error:a,retry:i,refresh:o}=(0,ee.useOrg)(),[u,c]=(0,l.useState)(!1),[d,g]=(0,l.useState)(!1);t||u||n||0!==r.length||a||!s||c(!0);let m=u&&0===r.length&&!d;return(0,l.useEffect)(()=>{if(!m)return;let e=setInterval(()=>o(),2e3),t=setTimeout(()=>g(!0),1e4);return()=>{clearInterval(e),clearTimeout(t)}},[m,o]),{state:t?{status:"bypassed"}:m?{status:"provisioning"}:n?{status:"loading"}:a?{status:"error",message:a}:0===r.length?{status:"no-orgs"}:{status:"ready"},retry:i,refresh:o}}({isBypassed:ev.some(e=>t.startsWith(e)),isOidcMode:"oidc"===(0,ex.getRuntimeConfig)().authMode});switch(s.status){case"bypassed":case"ready":return(0,o.jsx)(o.Fragment,{children:e});case"loading":return(0,o.jsx)(ej,{});case"provisioning":return(0,o.jsx)(ek,{});case"error":return(0,o.jsx)(ew,{message:s.message,onRetry:r});case"no-orgs":return(0,o.jsx)(eN,{onRefresh:n})}}function ey(){let{user:e,logout:t}=(0,ea.useAuth)();if(!e)return null;let s=(e.name??e.email).charAt(0).toUpperCase();return(0,o.jsxs)("div",{className:"absolute top-0 right-0 flex items-center gap-3 p-4",children:[(0,o.jsxs)("div",{className:"flex items-center gap-2",children:[(0,o.jsx)("div",{className:"bg-muted text-muted-foreground flex size-6 shrink-0 items-center justify-center rounded-full",children:(0,o.jsx)("span",{className:"text-xs font-medium",children:s})}),(0,o.jsx)("span",{className:"text-muted-foreground text-sm",children:e.email})]}),(0,o.jsxs)("button",{onClick:t,className:"text-muted-foreground hover:text-foreground inline-flex cursor-pointer items-center gap-1.5 text-sm transition-colors",children:[(0,o.jsx)(ep.LogOut,{className:"size-3.5"}),"Sign out"]})]})}function ek(){let{user:e}=(0,ea.useAuth)(),t=e?.name??e?.email;return(0,o.jsxs)("div",{className:"relative flex min-h-screen flex-col items-center justify-center p-8",children:[(0,o.jsx)(ey,{}),(0,o.jsxs)("div",{className:"flex flex-col items-center gap-4 text-center",children:[e&&(0,o.jsx)("div",{className:"flex size-12 items-center justify-center rounded-full bg-muted",children:(0,o.jsx)("span",{className:"text-muted-foreground text-lg font-medium",children:(t??"?").charAt(0).toUpperCase()})}),(0,o.jsxs)("div",{className:"space-y-1.5",children:[(0,o.jsx)("h1",{className:"text-lg font-semibold text-foreground",children:t?`Welcome, ${t}!`:"Welcome!"}),(0,o.jsx)("p",{className:"text-sm text-muted-foreground",children:"Setting up your workspace…"})]}),(0,o.jsx)(Y.Loader2,{className:"text-muted-foreground size-5 animate-spin"})]})]})}function ej(){return(0,o.jsx)("div",{className:"flex min-h-screen flex-col items-center justify-center gap-3",children:(0,o.jsx)(Y.Loader2,{className:"text-muted-foreground size-8 animate-spin"})})}function ew({message:e,onRetry:t}){return(0,o.jsxs)("div",{className:"relative flex min-h-screen flex-col items-center justify-center gap-4 p-8",children:[(0,o.jsx)(ey,{}),(0,o.jsx)(eg.AlertCircle,{className:"text-destructive size-8"}),(0,o.jsx)("p",{className:"text-destructive text-sm font-medium",children:"Failed to load organizations"}),(0,o.jsx)("p",{className:"text-muted-foreground max-w-md text-center text-sm",children:e}),(0,o.jsxs)("button",{onClick:t,className:"inline-flex items-center gap-1.5 rounded-md bg-primary px-3 py-1.5 text-xs font-medium text-primary-foreground hover:bg-primary-hover",children:[(0,o.jsx)(em.RefreshCw,{className:"size-3"}),"Try again"]})]})}function eN({onRefresh:e}){let t=(0,l.useCallback)(t=>{e(t.metadata?.slug)},[e]);return(0,o.jsxs)("div",{className:"relative flex min-h-screen flex-col items-center justify-center p-8",children:[(0,o.jsx)(ey,{}),(0,o.jsxs)("div",{className:"w-full max-w-sm space-y-6",children:[(0,o.jsxs)("div",{className:"flex flex-col items-center gap-3 text-center",children:[(0,o.jsx)("div",{className:"flex size-12 items-center justify-center rounded-full bg-muted",children:(0,o.jsx)(eh.Building2,{className:"text-muted-foreground size-6"})}),(0,o.jsx)("h1",{className:"text-lg font-semibold text-foreground",children:"Welcome to Stigmer"}),(0,o.jsx)("p",{className:"text-sm text-muted-foreground",children:"Create an organization to get started. Organizations are the top-level context that owns your agents, environments, and resources."})]}),(0,o.jsx)(ef.CreateOrganizationForm,{onCreated:t})]})]})}var eS=e.i(910304),eC=e.i(586108),eE=e.i(326283);let eT=Object.freeze({status:"ready",account:null});function eA({children:e}){let{state:t,retry:s}=function(e){let{isEnabled:t}=e,s=(0,eC.useStigmer)(),[r,n]=(0,l.useState)(t?{status:"checking"}:eT),a=(0,l.useRef)(0),i=(0,l.useCallback)(async()=>{let e=++a.current;n({status:"checking"});try{let t=await s.identityAccount.whoAmI();if(e!==a.current)return;n({status:"ready",account:t})}catch(t){if(e!==a.current)return;if(!(0,eS.isNotFound)(t))return void n({status:"error",message:(0,eE.toError)(t).message});n({status:"provisioning"});try{let t=await s.identityAccount.provisionMyAccount();if(e!==a.current)return;n({status:"ready",account:t})}catch(t){if(e!==a.current)return;n({status:"error",message:(0,eE.toError)(t).message})}}},[s]);return(0,l.useEffect)(()=>{t?i():n(eT)},[t,i]),{state:r,retry:(0,l.useCallback)(()=>{t&&i()},[t,i])}}({isEnabled:"oidc"===(0,ex.getRuntimeConfig)().authMode});switch(t.status){case"ready":return(0,o.jsx)(o.Fragment,{children:e});case"checking":return(0,o.jsx)(eM,{});case"provisioning":return(0,o.jsx)(eO,{});case"error":return(0,o.jsx)(eR,{message:t.message,onRetry:s})}}function eI(){let{user:e,logout:t}=(0,ea.useAuth)();if(!e)return null;let s=(e.name??e.email).charAt(0).toUpperCase();return(0,o.jsxs)("div",{className:"absolute top-0 right-0 flex items-center gap-3 p-4",children:[(0,o.jsxs)("div",{className:"flex items-center gap-2",children:[(0,o.jsx)("div",{className:"bg-muted text-muted-foreground flex size-6 shrink-0 items-center justify-center rounded-full",children:(0,o.jsx)("span",{className:"text-xs font-medium",children:s})}),(0,o.jsx)("span",{className:"text-muted-foreground text-sm",children:e.email})]}),(0,o.jsxs)("button",{onClick:t,className:"text-muted-foreground hover:text-foreground inline-flex cursor-pointer items-center gap-1.5 text-sm transition-colors",children:[(0,o.jsx)(ep.LogOut,{className:"size-3.5"}),"Sign out"]})]})}function eM(){return(0,o.jsx)("div",{className:"flex min-h-screen flex-col items-center justify-center gap-3",children:(0,o.jsx)(Y.Loader2,{className:"text-muted-foreground size-8 animate-spin"})})}function eO(){let{user:e}=(0,ea.useAuth)(),t=e?.name??e?.email;return(0,o.jsxs)("div",{className:"relative flex min-h-screen flex-col items-center justify-center p-8",children:[(0,o.jsx)(eI,{}),(0,o.jsxs)("div",{className:"flex flex-col items-center gap-4 text-center",children:[e&&(0,o.jsx)("div",{className:"flex size-12 items-center justify-center rounded-full bg-muted",children:(0,o.jsx)("span",{className:"text-muted-foreground text-lg font-medium",children:(t??"?").charAt(0).toUpperCase()})}),(0,o.jsxs)("div",{className:"space-y-1.5",children:[(0,o.jsx)("h1",{className:"text-lg font-semibold text-foreground",children:t?`Welcome, ${t}!`:"Welcome!"}),(0,o.jsx)("p",{className:"text-sm text-muted-foreground",children:"Setting up your account…"})]}),(0,o.jsx)(Y.Loader2,{className:"text-muted-foreground size-5 animate-spin"})]})]})}function eR({message:e,onRetry:t}){return(0,o.jsxs)("div",{className:"relative flex min-h-screen flex-col items-center justify-center gap-4 p-8",children:[(0,o.jsx)(eI,{}),(0,o.jsx)(eg.AlertCircle,{className:"text-destructive size-8"}),(0,o.jsx)("p",{className:"text-destructive text-sm font-medium",children:"Failed to set up your account"}),(0,o.jsx)("p",{className:"text-muted-foreground max-w-md text-center text-sm",children:e}),(0,o.jsxs)("button",{onClick:t,className:"inline-flex items-center gap-1.5 rounded-md bg-primary px-3 py-1.5 text-xs font-medium text-primary-foreground hover:bg-primary-hover",children:[(0,o.jsx)(em.RefreshCw,{className:"size-3"}),"Try again"]})]})}let e_=["/login","/invite/"],eD=["/chat/"],eP=new V({defaultOptions:{queries:{staleTime:3e4,retry:(e,t)=>!!(0,J.isRetryableError)(t)&&e<1,refetchOnWindowFocus:!0},mutations:{retry:!1}}});function eF({children:e}){let t=(0,u.usePathname)(),s=e_.some(e=>t.startsWith(e)),r=eD.some(e=>t.startsWith(e));return s?(0,o.jsx)(o.Fragment,{children:e}):r?(0,o.jsx)(et.AuthProvider,{children:e}):(0,o.jsx)(et.AuthProvider,{children:(0,o.jsx)(l.Suspense,{fallback:(0,o.jsx)(eW,{}),children:(0,o.jsx)(es.AuthGuard,{children:(0,o.jsx)(Q,{client:eP,children:(0,o.jsx)(el,{children:(0,o.jsx)(eA,{children:(0,o.jsx)(Z.FetchCacheProvider,{children:(0,o.jsx)(ee.OrgProvider,{children:(0,o.jsxs)(eb,{children:[e,(0,o.jsx)(ed,{})]})})})})})})})})})}function eL({children:e}){let[t,s]=(0,l.useState)(!1),[r,n]=(0,l.useState)(null);return((0,l.useEffect)(()=>{(0,ex.loadRuntimeConfig)().then(()=>s(!0)).catch(e=>{n(e instanceof Error?e.message:"Failed to load configuration")})},[]),r)?(0,o.jsxs)("div",{className:"flex min-h-screen flex-col items-center justify-center gap-3 p-8",children:[(0,o.jsx)("p",{className:"text-destructive text-sm font-medium",children:"Configuration Error"}),(0,o.jsx)("p",{className:"text-muted-foreground max-w-md text-center text-sm",children:r})]}):t?(0,o.jsx)(o.Fragment,{children:e}):(0,o.jsx)(eW,{})}function eW(){return(0,o.jsx)("div",{className:"flex min-h-screen flex-col items-center justify-center gap-3",children:(0,o.jsx)(Y.Loader2,{className:"text-muted-foreground size-8 animate-spin"})})}e.s(["Providers",0,function({children:e}){return(0,o.jsx)(eL,{children:(0,o.jsx)(d,{attribute:"class",defaultTheme:"system",enableSystem:!0,children:(0,o.jsx)(eF,{children:e})})})}],693079)},36634,e=>{"use strict";var t=e.i(843476),s=e.i(271645),r=e.i(312056);let n=(0,s.createContext)(null),a=/^\/sessions\/(.+)/;function i(e){return"/"===e||a.test(e)}e.s(["SessionNavigationProvider",0,function({children:e}){let{currentPath:o,navigate:l}=(0,r.useAppNavigation)(),u=i(o),c=u?o.match(a)?.[1]??null:null,[d,g]=(0,s.useState)(null),m=(0,s.useRef)(o);(0,s.useEffect)(()=>{let e=m.current;i(e)&&!i(o)&&g(e),m.current=o},[o]);let h=(0,s.useCallback)(e=>{l(`/sessions/${e}`)},[l]),p=(0,s.useCallback)(()=>{l("/")},[l]),f=(0,s.useMemo)(()=>({activeSessionId:c,isSessionZone:u,lastSessionZonePath:d,navigateToSession:h,navigateToHome:p}),[c,u,d,h,p]);return(0,t.jsx)(n.Provider,{value:f,children:e})},"isSessionZonePath",0,i,"useSessionNavigation",0,function(){let e=(0,s.useContext)(n);if(!e)throw Error("useSessionNavigation must be used within <SessionNavigationProvider>");return e}])},936636,e=>{"use strict";var t,s,r,n=e.i(843476),a=e.i(271645),i=e.i(618566),o=e.i(475254);let l=(0,o.default)("panel-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);var u=e.i(893976),c=e.i(586108),d=e.i(583093);function g(e){let t=(0,c.useStigmer)(),s=e?async()=>{let s=await t.agentExecution.get(e);return s.spec?.sessionId??null}:null,{data:r,isLoading:n,error:a}=(0,d.useFetch)(s,[e,t],null);return{sessionId:r,isLoading:n,error:a}}var m=e.i(102508),h=e.i(36634),p=e.i(635549),f=e.i(846696),x=e.i(275051),v=e.i(615987),b=e.i(597744),y=e.i(170255);function k(){let e=(0,b.useResourceAvailable)(y.ApiResourceKind.identity_account),{account:t}=(0,v.useMyIdentityAccount)({enabled:e});return(0,a.useMemo)(()=>{let e=t?.spec?.preferences;if(!e)return;let s="native"===e.defaultHarness||"cursor"===e.defaultHarness?e.defaultHarness:void 0,r=e.defaultNativeModel||void 0,n=e.defaultCursorModel||void 0,a=e.defaultAutoApprove||void 0;if(s||r||n||a)return{harness:s,nativeModel:r,cursorModel:n,autoApprove:a}},[t])}var j=e.i(891287),w=e.i(217516),N=e.i(196716),S=e.i(727996),C=e.i(254347),E=e.i(590745),T=e.i(55389);let A=/github\.com[/:]([^/]+)\/([^/.]+?)(?:\.git)?$/;function I(e){let t=e.match(A);return t?{owner:t[1],repo:t[2]}:null}let M={path:"... (tree truncated by GitHub — repository has too many files)",isDirectory:!1,notice:!0};function O(e){let t=(0,a.useCallback)(async t=>{if("git"!==t.type||!t.gitUrl||!e)return null;let s=I(t.gitUrl);if(!s)return null;let r=t.readRef||t.gitBranch||"main",n=`https://api.github.com/repos/${s.owner}/${s.repo}/git/trees/${encodeURIComponent(r)}?recursive=1`,a=await fetch(n,{headers:{Authorization:`Bearer ${e}`}});if(!a.ok)return null;let i=await a.json(),o=i.tree.filter(e=>"blob"===e.type||"tree"===e.type).map(e=>({path:e.path,isDirectory:"tree"===e.type}));return i.truncated&&o.push(M),o},[e]);if(e)return t}var R=e.i(850429);function _(e){let t=atob(e.replace(/\s/g,""));return Uint8Array.from(t,e=>e.charCodeAt(0))}function D(e,t,s=null){if(function(e){let t=Math.min(e.length,8e3);for(let s=0;s<t;s++)if(0===e[s])return!0;return!1}(e))return{text:null,isBinary:!0,size:t,encoding:"base64",...null!==s&&e.length<=R.MAX_WORKSPACE_IMAGE_READ_BYTES?{bytes:e}:{}};let r=function(e){try{return new TextDecoder("utf-8",{fatal:!0}).decode(e)}catch{return null}}(e);if(null===r)return{text:null,isBinary:!1,size:t,encoding:"unknown"};let n=e.length>R.MAX_WORKSPACE_FILE_READ_BYTES;return{text:n?r.slice(0,R.MAX_WORKSPACE_FILE_READ_BYTES):r,isBinary:!1,size:t,encoding:"utf-8",...n?{truncated:!0}:{}}}let P="https://api.github.com/repos";function F(e){let t=(0,a.useCallback)(async(t,s)=>{if("git"!==t.type||!t.gitUrl||!e)return null;let r=I(t.gitUrl);if(!r)return null;let n=t.readRef||t.gitBranch||"main",a=`${P}/${r.owner}/${r.repo}/contents/${s.split("/").map(encodeURIComponent).join("/")}?ref=${encodeURIComponent(n)}`,i=await fetch(a,{headers:{Authorization:`Bearer ${e}`}});if(404===i.status)throw new R.WorkspaceFileNotFoundError(s);if(!i.ok)throw Error(`GitHub content fetch failed for ${s} (HTTP ${i.status})`);let o=await i.json();if(Array.isArray(o))throw Error(`Cannot read "${s}": path is a directory`);return"base64"===o.encoding?D(_(o.content),o.size,(0,R.workspaceImageMimeType)(s)):L(r,o,s,e)},[e]);if(e)return t}async function L(e,t,s,r){if(t.size>0xa00000)return{text:null,isBinary:!1,size:t.size,encoding:"none",truncated:!0};let n=`${P}/${e.owner}/${e.repo}/git/blobs/${t.sha}`,a=await fetch(n,{headers:{Authorization:`Bearer ${r}`}});if(!a.ok)throw Error(`GitHub blob fetch failed for ${t.sha} (HTTP ${a.status})`);let i=await a.json();return D(_(i.content),i.size,(0,R.workspaceImageMimeType)(s))}var W=e.i(433732);function K(e){let t=(0,W.useExecutionTarget)(),s=(0,b.useDeploymentMode)(),r=e?.hasLocalPicker??!1;return(0,a.useMemo)(()=>"cloud"===(t??("local"===s?"local":"cloud"))?{enableGitHub:!0,enableLocal:!1}:{enableGitHub:!r,enableLocal:!0},[t,s,r])}let U={agent:{org:"stigmer",slug:"agent-creator"},skill:{org:"stigmer",slug:"skill-creator"},"mcp-server":{org:"stigmer",slug:"mcp-server-creator"}},B=new Set(Object.keys(U));var z=e.i(297629);let q={agent:"Describe the agent you’d like to build — its purpose, the skills and MCP servers it should use, and any system instructions to guide its behavior.",skill:"Describe the skill you’d like to build — what it does and what instructions it should follow. You can attach a workspace or reference files for additional context.","mcp-server":"Describe the MCP server you’d like to register — its name, connection type (stdio or SSE), startup command or endpoint URL, and any required environment variables."},$={agent:"Add an Agent",skill:"Add a Skill","mcp-server":"Add an MCP Server"},H={agent:"Describe how you’d like to modify this agent…",skill:"Describe how you’d like to modify this skill…","mcp-server":"Describe how you’d like to modify this MCP server…"};function G(){let e=(0,i.useSearchParams)(),t=function(e){var t;let s=null!==(t=e.get("draft"))&&B.has(t)?t:null;if(!s)return null;let r=e.get("editOrg"),n=e.get("editSlug");return r&&n?{draftType:s,editRef:{org:r,slug:n}}:{draftType:s}}(e),s=(0,z.useActiveOrgSlug)(),r=k(),o=(0,T.useGitHubConnection)(s),{enableGitHub:l,enableLocal:u}=K(),d=O(o.token),g=F(o.token),{navigateToSession:m}=(0,h.useSessionNavigation)(),p=t?.draftType??null,v=t?.editRef??null,[b,y]=(0,a.useState)(()=>p),[A,I]=(0,a.useState)(v);null===b&&p&&(y(p),I(v));let M=A??null,R=null!==M,_=e.get("agent"),D=e.get("instance"),[P,L]=(0,a.useState)(()=>V(_)),[W,G]=(0,a.useState)(()=>D??void 0);void 0===P&&_&&(L(V(_)),G(D??void 0));let[X,Q]=(0,a.useState)(()=>b?U[b]:P);void 0===X&&b&&Q(U[b]),void 0===X&&P&&Q(P),(0,a.useEffect)(()=>{(p||_)&&window.history.replaceState({},"","/")},[p,_]);let Y=function(e,t){let s=(0,c.useStigmer)(),r=t?.org??null,n=t?.slug??null,{agent:i}=(0,N.useAgent)("agent"===e?r:null,"agent"===e?n:null),{mcpServer:o}=(0,S.useMcpServer)("mcp-server"===e?r:null,"mcp-server"===e?n:null),{skill:l}=(0,C.useSkill)("skill"===e?r:null,"skill"===e?n:null),[u,d]=(0,a.useState)(void 0),[g,m]=(0,a.useState)(null),h=(0,a.useRef)(!1);return(0,a.useEffect)(()=>{if(!h.current){if("agent"===e&&i){h.current=!0;try{let e=(0,E.serializeManifest)(i),t=i.metadata?.slug??"agent";d([new File([e],`${t}.yaml`,{type:"text/yaml"})])}catch{m("Failed to serialize agent for editing")}}if("mcp-server"===e&&o){h.current=!0;try{let e=(0,E.serializeManifest)(o),t=o.metadata?.slug??"mcp-server";d([new File([e],`${t}.yaml`,{type:"text/yaml"})])}catch{m("Failed to serialize MCP server for editing")}}}},[e,i,o]),(0,a.useEffect)(()=>{if(h.current||"skill"!==e||!l)return;let t=l.status?.artifactStorageKey;if(!t)return;h.current=!0;let r=l.metadata?.slug??"skill";s.skill.getArtifact((0,j.create)(w.GetArtifactRequestSchema,{artifactStorageKey:t})).then(e=>{let t=new ArrayBuffer(e.artifact.byteLength);new Uint8Array(t).set(e.artifact),d([new File([new Blob([t],{type:"application/zip"})],`${r}.zip`,{type:"application/zip"})])}).catch(()=>{m("Failed to download skill package for editing")})},[e,l,s]),{files:u,error:g}}(b,M);(0,a.useEffect)(()=>{Y.error&&f.toast.error(Y.error)},[Y.error]);let J=b?R?H[b]:q[b]:void 0,Z=R?"What would you like to change?":b?$[b]:void 0;return(0,n.jsx)(x.NewSessionViewer,{org:s,onSessionCreated:m,onError:e=>f.toast.error(e),accountDefaults:r,gitHubConnection:l?o:void 0,enableGitHub:l,enableLocal:u,workspaceFileLister:d,workspaceFileReader:g,initialAgentRef:X,initialInstanceId:W,initialAttachments:Y.files,heading:Z,placeholder:J,className:"h-full"})}function V(e){if(!e)return;let t=e.indexOf("/");if(!(t<=0)&&t!==e.length-1)return{org:e.slice(0,t),slug:e.slice(t+1)}}var X=e.i(766895),Q=e.i(217127);e.i(107141);var Y=e.i(352082);function J({id:e}){let t=(0,z.useActiveOrgSlug)(),s=(0,z.useActiveOrgId)(),r=(0,T.useGitHubConnection)(t),{enableGitHub:a,enableLocal:i}=K(),o=O(r.token),l=F(r.token),u=k();return(0,n.jsx)("div",{className:"flex h-full w-full flex-col",children:(0,n.jsx)(X.SessionViewer,{sessionId:e,org:t,accountDefaults:u,gitHubConnection:a?r:void 0,enableGitHub:a,enableLocal:i,workspaceFileLister:o,workspaceFileReader:l,accessSlot:(0,n.jsx)(Q.ManageAccessButton,{resource:{kind:y.ApiResourceKind.session,kindString:"session",id:e,org:s}})})})}var Z=e.i(566022),ee=e.i(735922),et=e.i(910304),es=e.i(205730);let er=new Set([Z.ExecutionPhase.EXECUTION_COMPLETED,Z.ExecutionPhase.EXECUTION_FAILED,Z.ExecutionPhase.EXECUTION_CANCELLED,Z.ExecutionPhase.EXECUTION_TERMINATED]);function en(e){let t=(0,c.useStigmer)(),s=(0,es.useRunnerAdapter)(),r=(0,W.useExecutionTarget)(),n=(0,a.useRef)(null),i=e?async()=>{try{return await t.workflowExecution.get(e)}catch(e){if((0,et.isNotFound)(e))return null;throw e}}:null,{data:o,isLoading:l,isRefetching:u,error:g,refetch:m}=(0,d.useFetch)(i,[e,t],null,{cacheKey:e?`workflow-execution:${e}`:void 0});return(0,a.useEffect)(()=>{let t=o?.status?.phase,a=o?.metadata?.id;s&&"local"===r&&e&&null!=t&&er.has(t)&&a===e&&n.current!==e&&(n.current=e,s.onWorkflowExecutionTerminated(e).catch(()=>{}))},[o?.status?.phase,o?.metadata?.id,e,s,r]),(0,a.useEffect)(()=>{n.current=null},[e]),{execution:o,isLoading:l,isRefetching:u,error:g,refetch:m}}var ea=e.i(218766),ei=e.i(610595),eo=e.i(326283),el=e.i(868278),eu=e.i(777489),ec=e.i(661438);let ed={stage:"idle"},eg=BigInt(0),em=BigInt(-1),eh={costConsumedMicros:eg,costRemainingMicros:em,tokensConsumed:eg,tokensRemaining:em,thresholdBreached:!1};class ep{_events=[];_streamState=ed;_listeners=new Set;_taskStatesCache=null;_costSummaryCache=null;_totalTasks=0;appendEvents(e){if(0===e.length)return;let t=this._events.length>0?this._events[this._events.length-1].sequenceNumber:eg,s=e.filter(e=>e.sequenceNumber>t);if(0!==s.length){for(let e of(s.sort((e,t)=>e.sequenceNumber<t.sequenceNumber?-1:+(e.sequenceNumber>t.sequenceNumber)),this._events=[...this._events,...s],this._taskStatesCache=null,this._costSummaryCache=null,s))e.eventType===eu.WorkflowEventType.execution_started&&"executionStarted"===e.payload.case&&(this._totalTasks=e.payload.value.totalTasks);this._notify()}}setStreamState(e){var t,s;t=this._streamState,s=e,t.stage===s.stage&&("idle"===t.stage||"error"===t.stage&&"error"===s.stage&&t.executionId===s.executionId&&t.error===s.error||"reconnecting"===t.stage&&"reconnecting"===s.stage&&t.executionId===s.executionId&&t.attempt===s.attempt||"executionId"in t&&"executionId"in s&&t.executionId===s.executionId)||(this._streamState=e,this._notify())}reset(){let e=0===this._events.length&&"idle"===this._streamState.stage;this._events=[],this._streamState=ed,this._taskStatesCache=null,this._costSummaryCache=null,this._totalTasks=0,e||this._notify()}subscribe=e=>(this._listeners.add(e),()=>{this._listeners.delete(e)});getEvents=()=>this._events;getStreamState=()=>this._streamState;getLatestSequence=()=>0===this._events.length?eg:this._events[this._events.length-1].sequenceNumber;getTotalTasks=()=>this._totalTasks;getTaskStates=()=>(this._taskStatesCache||(this._taskStatesCache=function(e){let t=new Map;for(let n of e){let e=n.taskName;if(!e)continue;let a=t.get(e),i=n.payload;switch(i.case){case"taskStarted":t.set(e,{taskName:e,taskKind:i.value.taskKind,status:"running",durationMs:0,costMicros:a?.costMicros??eg,tokensUsed:a?.tokensUsed??eg,attemptNumber:i.value.attemptNumber,error:"",childExecutionId:a?.childExecutionId??"",agentSlug:a?.agentSlug??"",currentToolName:a?.currentToolName??"",messagesCount:a?.messagesCount??0,toolCallsCount:a?.toolCallsCount??0,inputSummary:i.value.inputSummary??a?.inputSummary??null,outputSummary:null,approvalRequest:null,approvalResolution:null});break;case"taskCompleted":t.set(e,{taskName:e,taskKind:i.value.taskKind,status:"completed",durationMs:Number(i.value.durationMs),costMicros:i.value.costMicros,tokensUsed:i.value.tokensUsed,attemptNumber:a?.attemptNumber??1,error:"",childExecutionId:a?.childExecutionId??"",agentSlug:a?.agentSlug??"",currentToolName:"",messagesCount:a?.messagesCount??0,toolCallsCount:a?.toolCallsCount??0,inputSummary:a?.inputSummary??null,outputSummary:i.value.outputSummary??null,approvalRequest:a?.approvalRequest??null,approvalResolution:a?.approvalResolution??null});break;case"taskFailed":t.set(e,{taskName:e,taskKind:i.value.taskKind,status:i.value.willRetry?"retrying":"failed",durationMs:Number(i.value.durationMs),costMicros:a?.costMicros??eg,tokensUsed:a?.tokensUsed??eg,attemptNumber:i.value.attemptNumber,error:i.value.error,childExecutionId:a?.childExecutionId??"",agentSlug:a?.agentSlug??"",currentToolName:"",messagesCount:a?.messagesCount??0,toolCallsCount:a?.toolCallsCount??0,inputSummary:a?.inputSummary??null,outputSummary:null,approvalRequest:a?.approvalRequest??null,approvalResolution:a?.approvalResolution??null});break;case"taskSkipped":t.set(e,{taskName:e,taskKind:i.value.taskKind,status:"skipped",durationMs:0,costMicros:eg,tokensUsed:eg,attemptNumber:0,error:"",childExecutionId:a?.childExecutionId??"",agentSlug:"",currentToolName:"",messagesCount:0,toolCallsCount:0,inputSummary:null,outputSummary:null,approvalRequest:null,approvalResolution:null});break;case"taskRetrying":a&&t.set(e,{...a,status:"retrying"});break;case"agentCallStarted":a&&t.set(e,{...a,childExecutionId:i.value.childExecutionId||a.childExecutionId,agentSlug:i.value.agentSlug||a.agentSlug});break;case"agentCallProgress":var s,r;a&&t.set(e,{...a,status:(s=a.status,r=i.value.agentPhase,"running"===s?r===ec.ExecutionPhase.EXECUTION_WAITING_FOR_APPROVAL?"waiting_approval":"running":"waiting_approval"===s?r===ec.ExecutionPhase.EXECUTION_WAITING_FOR_APPROVAL||r===ec.ExecutionPhase.EXECUTION_PHASE_UNSPECIFIED?"waiting_approval":"running":s),childExecutionId:i.value.childExecutionId||a.childExecutionId,currentToolName:i.value.currentToolName||a.currentToolName,messagesCount:i.value.messagesCount||a.messagesCount,toolCallsCount:i.value.toolCallsCount||a.toolCallsCount,tokensUsed:i.value.tokensConsumed>eg?i.value.tokensConsumed:a.tokensUsed});break;case"agentCallCompleted":a&&t.set(e,{...a,costMicros:i.value.costMicros,tokensUsed:i.value.tokensConsumed,currentToolName:""});break;case"approvalRequested":a&&t.set(e,{...a,status:"waiting_approval",approvalRequest:i.value,approvalResolution:null});break;case"approvalResolved":a&&t.set(e,{...a,status:"waiting_approval"===a.status?"running":a.status,approvalResolution:i.value})}}return t}(this._events)),this._taskStatesCache);getCostSummary=()=>(this._costSummaryCache||(this._costSummaryCache=function(e){for(let t=e.length-1;t>=0;t--){let s=e[t].payload;if("budgetCheckpoint"===s.case)return{costConsumedMicros:s.value.costConsumedMicros,costRemainingMicros:s.value.costRemainingMicros,tokensConsumed:s.value.tokensConsumed,tokensRemaining:s.value.tokensRemaining,thresholdBreached:s.value.thresholdBreached}}for(let t=e.length-1;t>=0;t--){let s=e[t].payload;if("executionCompleted"===s.case)return{costConsumedMicros:s.value.totalCostMicros,costRemainingMicros:em,tokensConsumed:s.value.totalTokens,tokensRemaining:em,thresholdBreached:!1}}let t=eg,s=eg;for(let r of e)"taskCompleted"===r.payload.case&&(t+=r.payload.value.costMicros,s+=r.payload.value.tokensUsed);return t>eg||s>eg?{costConsumedMicros:t,costRemainingMicros:em,tokensConsumed:s,tokensRemaining:em,thresholdBreached:!1}:eh}(this._events)),this._costSummaryCache);_notify(){for(let e of this._listeners)e()}}let ef=new Set([Z.ExecutionPhase.EXECUTION_COMPLETED,Z.ExecutionPhase.EXECUTION_FAILED,Z.ExecutionPhase.EXECUTION_CANCELLED,Z.ExecutionPhase.EXECUTION_TERMINATED]);function ex(e,t){let s=(0,c.useStigmer)(),r=(0,a.useRef)(null);t?.store||r.current||(r.current=new ep);let n=t?.store??r.current,[i,o]=(0,a.useState)(0),l=(0,a.useCallback)(()=>{o(e=>e+1)},[]),u=t?.eventTypes,d=t?.executionPhase,g=t?.autoReconnect??!0,m=t?.reconnectOptions,h=(0,a.useRef)(n);h.current=n;let p=(0,a.useRef)(void 0),f=(0,a.useRef)(null);(0,a.useEffect)(()=>{var t;if(!e){n.reset(),p.current=void 0,f.current=null;return}let r=new AbortController,i=h.current,o=void 0!==d&&ef.has(d);return null!==f.current&&f.current!==e&&(i.reset(),p.current=void 0),f.current=e,t=p.current,void 0!==t&&void 0!==d&&ef.has(t)&&!ef.has(d)&&i.reset(),p.current=d,o?(i.setStreamState({stage:"connecting",executionId:e}),(async()=>{try{let t=BigInt(0),n=!0;for(;n&&!r.signal.aborted;){let o=await s.workflowExecution.getEventLog((0,j.create)(ea.GetEventLogRequestSchema,{executionId:e,afterSequence:t,eventTypes:u?[...u]:[],pageSize:500}));if(r.signal.aborted)return;(0,a.startTransition)(()=>{i.appendEvents(o.events)}),n=o.hasMore,t=o.latestSequence}r.signal.aborted||i.setStreamState({stage:"complete",executionId:e})}catch(t){if(r.signal.aborted)return;i.setStreamState({stage:"error",executionId:e,error:(0,eo.toError)(t)})}})()):(i.setStreamState({stage:"connecting",executionId:e}),(async()=>{let t=r.signal,n=m?.maxAttempts??el.DEFAULT_RECONNECT_MAX_ATTEMPTS,o=0;for(;!t.aborted;)try{let r=i.getLatestSequence();for await(let n of s.workflowExecution.subscribeEvents((0,j.create)(ea.SubscribeEventsRequestSchema,{executionId:e,afterSequence:r,eventTypes:u?[...u]:[]}),t)){if(t.aborted)return;o=0,(0,a.startTransition)(()=>{i.appendEvents([n]);let t=i.getStreamState().stage;("connecting"===t||"reconnecting"===t)&&i.setStreamState({stage:"streaming",executionId:e})})}t.aborted||i.setStreamState({stage:"complete",executionId:e});return}catch(r){if(t.aborted)return;let s=(0,eo.toError)(r);if(s.message.includes("UNIMPLEMENTED")||s.message.includes("unimplemented"))return void i.setStreamState({stage:"unsupported",executionId:e});if(!g||!(0,ei.isTransientStreamError)(s)||o>=n)return void i.setStreamState({stage:"error",executionId:e,error:s});o+=1,i.setStreamState({stage:"reconnecting",executionId:e,attempt:o,error:s});try{await (0,el.sleep)((0,el.computeBackoffDelay)(o,m),t)}catch{return}}})()),()=>{r.abort()}},[e,s,i,d]);let x=(0,a.useSyncExternalStore)(n.subscribe,n.getEvents),v=(0,a.useSyncExternalStore)(n.subscribe,n.getTaskStates),b=(0,a.useSyncExternalStore)(n.subscribe,n.getCostSummary),y=(0,a.useSyncExternalStore)(n.subscribe,n.getStreamState),k=(0,a.useSyncExternalStore)(n.subscribe,n.getTotalTasks),w="streaming"===y.stage,N="connecting"===y.stage,S="reconnecting"===y.stage,C="reconnecting"===y.stage?y.attempt:0,E="error"===y.stage?y.error:null;return{events:x,taskStates:v,costSummary:b,streamState:y,totalTasks:k,isStreaming:w,isConnecting:N,isReconnecting:S,reconnectAttempt:C,error:E,reconnect:l}}var ev=e.i(202796),eb=e.i(980213);let ey=new Set(["completed","failed","skipped"]),ek=new Set([Z.WorkflowTaskStatus.WORKFLOW_TASK_COMPLETED,Z.WorkflowTaskStatus.WORKFLOW_TASK_FAILED,Z.WorkflowTaskStatus.WORKFLOW_TASK_SKIPPED]);var ej=e.i(945850),ew=e.i(565621),eN=e.i(244686),eS=e.i(267460);let eC=new Set([Z.ExecutionPhase.EXECUTION_PENDING,Z.ExecutionPhase.EXECUTION_IN_PROGRESS]),eE=new Set([Z.ExecutionPhase.EXECUTION_COMPLETED,Z.ExecutionPhase.EXECUTION_FAILED,Z.ExecutionPhase.EXECUTION_CANCELLED,Z.ExecutionPhase.EXECUTION_TERMINATED]),eT=(0,a.memo)(function({execution:e,streamState:t,costSummary:s,actions:r,onDiagnose:i,isDiagnosing:o,onCompare:l,headerActions:c,className:d}){let g=e.status?.phase??Z.ExecutionPhase.EXECUTION_PHASE_UNSPECIFIED,m=e.metadata?.name??e.metadata?.id??"Execution",h=e.status?.startedAt??"",p=e.status?.completedAt??"",f=(0,a.useMemo)(()=>{if(!h)return null;let e=new Date(h).getTime(),t=p?new Date(p).getTime():Date.now();return(0,eS.formatDuration)(t-e)},[h,p]),x=(0,a.useMemo)(()=>s.costConsumedMicros<=BigInt(0)?null:(0,eS.formatMicroUsd)(s.costConsumedMicros),[s.costConsumedMicros]),v=eC.has(g),b=g===Z.ExecutionPhase.EXECUTION_PAUSED,y=g===Z.ExecutionPhase.EXECUTION_FAILED,k="streaming"===t.stage||"connecting"===t.stage||"reconnecting"===t.stage;return(0,n.jsxs)("header",{className:(0,u.cn)("stg:flex stg:items-center stg:gap-3 stg:border-b stg:border-border stg:px-4 stg:py-3",d),children:[(0,n.jsx)(eN.WorkflowExecutionPhaseBadge,{phase:g}),(0,n.jsx)("h2",{className:"stg:min-w-0 stg:flex-1 stg:truncate stg:text-sm stg:font-semibold stg:text-foreground",children:m}),f&&(0,n.jsx)("span",{className:"stg:shrink-0 stg:text-xs stg:text-muted-foreground",children:f}),x&&(0,n.jsx)("span",{className:"stg:shrink-0 stg:text-xs stg:text-muted-foreground",children:x}),k&&(0,n.jsxs)("span",{className:"stg:flex stg:items-center stg:gap-1 stg:text-xs stg:text-muted-foreground",children:[(0,n.jsxs)("span",{className:"stg:relative stg:flex stg:h-1.5 stg:w-1.5",children:[(0,n.jsx)("span",{className:"stg:absolute stg:inline-flex stg:h-full stg:w-full stg:animate-ping stg:rounded-full stg:bg-success stg:opacity-75"}),(0,n.jsx)("span",{className:"stg:relative stg:inline-flex stg:h-1.5 stg:w-1.5 stg:rounded-full stg:bg-success"})]}),"Live"]}),(0,n.jsxs)("div",{className:"stg:flex stg:shrink-0 stg:items-center stg:gap-1.5",children:[l&&eE.has(g)&&(0,n.jsx)(eA,{label:"Compare with…",onClick:l,disabled:!1}),v&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(eA,{label:"Pause",onClick:()=>r.pause(),disabled:r.isSubmitting}),(0,n.jsx)(eA,{label:"Cancel",variant:"destructive",onClick:()=>r.cancel(),disabled:r.isSubmitting})]}),b&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(eA,{label:"Resume",onClick:()=>r.resume(),disabled:r.isSubmitting}),(0,n.jsx)(eA,{label:"Cancel",variant:"destructive",onClick:()=>r.cancel(),disabled:r.isSubmitting})]}),y&&(0,n.jsxs)(n.Fragment,{children:[i&&(0,n.jsx)(eA,{label:o?"Diagnosing…":"Diagnose",onClick:i,disabled:r.isSubmitting||!!o}),(0,n.jsx)(eA,{label:"Recover",onClick:()=>r.recover(),disabled:r.isSubmitting})]}),c&&(0,n.jsx)("div",{className:"stg:relative stg:flex stg:items-center",children:c})]})]})});function eA({label:e,variant:t,onClick:s,disabled:r}){return(0,n.jsx)("button",{type:"button",onClick:s,disabled:r,className:(0,u.cn)("stg:rounded stg:px-2 stg:py-1 stg:text-xs stg:font-medium stg:transition-colors","stg:disabled:pointer-events-none stg:disabled:opacity-50","destructive"===t?"stg:border stg:border-destructive/30 stg:text-destructive stg:hover:bg-destructive/10":"stg:border stg:border-border stg:text-foreground stg:hover:bg-muted"),children:e})}var eI=e.i(59309),eM=e.i(28434),eO=e.i(375954),eR=e.i(574803),e_=e.i(796545),eD=e.i(145995),eP=e.i(839329);let eF={org:"",slug:"workflow-architect"};var eL=e.i(226634),eW=e.i(953520),eK=e.i(163732),eU=e.i(379410);let eB=new Set(["ready","complete","error"]);function ez({executionId:e,org:t,currentWorkflowYaml:s,onApplyFix:r,onClose:i,className:o}){let[l,c]=(0,a.useState)(""),d=(0,a.useRef)(null),g=function(e){let{executionId:t,org:s,autoStart:r=!0,onError:n}=e,[i,o]=(0,a.useState)("idle"),[l,u]=(0,a.useState)(null),[c,d]=(0,a.useState)([]),[g,m]=(0,a.useState)(null),[h,p]=(0,a.useState)(null),f=(0,a.useRef)(s);f.current=s;let x=(0,a.useRef)(t);x.current=t;let v=(0,a.useRef)(n);v.current=n;let b=(0,a.useRef)(null),y=(0,a.useRef)(!1),k=(0,a.useRef)(!1),{create:j}=(0,eI.useCreateSession)(),{create:w}=(0,eM.useCreateAgentExecution)(),N=(0,e_.useConversationStoreRef)(),S=(0,eO.useExecutionStream)(l,{store:N}),C=(0,a.useCallback)(()=>`Diagnose the failed workflow execution \`${x.current}\`.
2
+
3
+ Analyze the failure root cause using the execution status and event log.
4
+ If this is a workflow definition error, generate a validated fix.
5
+ If this is a runtime error, explain the root cause and suggest operational remediation.`,[]);(0,a.useEffect)(()=>{if("streaming"===i&&S.phase!==ec.ExecutionPhase.EXECUTION_PHASE_UNSPECIFIED&&(0,eR.isTerminalPhase)(S.phase)&&!y.current){y.current=!0,S.execution&&d(e=>[...e,S.execution]);let e=S.execution?.status?.structuredOutput;if(e){let t=e.action,s=e.yaml,r=e.explanation;"fix_yaml"===t&&s?(m({yaml:s,explanation:r??""}),o("complete")):o("ready")}else{let e=(0,eD.extractWorkflowYaml)(S.execution);e?(m(e),o("complete")):o("ready")}u(null)}},[i,S.phase,S.execution]),(0,a.useEffect)(()=>{if(S.error&&"streaming"===i){let e=(0,ei.getUserMessage)(S.error,"Agent stream interrupted");o("error"),p(e),v.current?.(e)}},[S.error,i]);let E=(0,a.useCallback)(async()=>{if("idle"===i||"error"===i){o("starting"),p(null),m(null),y.current=!1;try{let e=b.current;if(!e){let{sessionId:t}=await j({org:f.current,agentRef:{...eF,org:f.current}});b.current=t,e=t}let t=C(),{executionId:s}=await w({org:f.current,sessionId:e,message:t,structuredOutputSchema:eP.WORKFLOW_DIAGNOSIS_RESPONSE_SCHEMA});u(s),o("streaming")}catch(t){let e=(0,ei.getUserMessage)(t,"Failed to start the Workflow Architect agent");o("error"),p(e),v.current?.(e)}}},[i,j,w,C]),T=(0,a.useCallback)(async e=>{let t=e.trim();if(t.length<5)return void p("Follow-up must be at least 5 characters");if("ready"===i||"complete"===i||"error"===i){o("starting"),p(null),m(null),y.current=!1;try{let e=b.current;if(!e){let{sessionId:t}=await j({org:f.current,agentRef:{...eF,org:f.current}});b.current=t,e=t}let{executionId:s}=await w({org:f.current,sessionId:e,message:t,structuredOutputSchema:eP.WORKFLOW_DIAGNOSIS_RESPONSE_SCHEMA});u(s),o("streaming")}catch(t){let e=(0,ei.getUserMessage)(t,"Failed to send follow-up to the Workflow Architect agent");o("error"),p(e),v.current?.(e)}}},[i,j,w]),A=(0,a.useCallback)(()=>{if("complete"!==i||!g)return null;let e=g.yaml;return m(null),o("ready"),e},[i,g]),I=(0,a.useCallback)(()=>{"complete"===i&&(m(null),o("ready"))},[i]),M=(0,a.useCallback)(()=>{o("idle"),u(null),d([]),m(null),p(null),b.current=null,y.current=!1,k.current=!1},[]);return(0,a.useEffect)(()=>{r&&"idle"===i&&!k.current&&(k.current=!0,E())},[r,i,E]),(0,a.useMemo)(()=>({phase:i,completedExecutions:c,activeExecution:S.execution,isStreaming:S.isStreaming||S.isConnecting,extractedYaml:g?.yaml??null,explanation:g?.explanation??null,error:h,diagnose:E,sendFollowUp:T,acceptFix:A,discardFix:I,reset:M}),[i,c,S.execution,S.isStreaming,S.isConnecting,g,h,E,T,A,I,M])}({executionId:e,org:t,currentWorkflowYaml:s,autoStart:!0,onError:()=>{}}),m=eB.has(g.phase),h=g.completedExecutions.length>0||null!==g.activeExecution,p=(0,a.useCallback)(async()=>{let e=l.trim();e.length<5||(c(""),await g.sendFollowUp(e),requestAnimationFrame(()=>{d.current?.scrollTo({top:d.current.scrollHeight,behavior:"smooth"})}))},[g.sendFollowUp,l]),f=(0,a.useCallback)(()=>{let e=g.acceptFix();e&&r&&r(e)},[g.acceptFix,r]),x=(0,a.useCallback)(()=>{g.discardFix()},[g.discardFix]),v=(0,a.useCallback)(()=>{g.reset()},[g.reset]),b=(0,a.useCallback)(e=>{"Enter"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),p())},[p]);return(0,n.jsxs)("div",{className:(0,u.cn)("stg:flex stg:h-full stg:flex-col stg:bg-background",o),role:"complementary","aria-label":"Workflow diagnosis panel",children:[(0,n.jsxs)("div",{className:"stg:flex stg:items-center stg:justify-between stg:border-b stg:border-border stg:px-3 stg:py-2",children:[(0,n.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-1.5",children:[(0,n.jsx)(eH,{}),(0,n.jsx)("h3",{className:"stg:text-xs stg:font-semibold stg:text-foreground",children:"AI Diagnosis"}),g.isStreaming&&(0,n.jsxs)("span",{className:"stg:inline-flex stg:items-center stg:gap-1 stg:text-[0.65rem] stg:text-muted-foreground",children:[(0,n.jsx)(eU.SpinnerIcon,{size:10}),"Analyzing…"]})]}),i&&(0,n.jsx)("button",{type:"button",onClick:i,className:"stg:rounded stg:p-0.5 stg:text-muted-foreground stg:hover:bg-muted stg:hover:text-foreground","aria-label":"Close diagnosis panel",children:(0,n.jsx)(eG,{})})]}),(0,n.jsxs)("div",{ref:d,className:"stg:flex stg:min-h-0 stg:flex-1 stg:flex-col stg:overflow-y-auto",children:["starting"===g.phase&&!h&&(0,n.jsxs)("div",{className:"stg:flex stg:flex-col stg:items-center stg:justify-center stg:gap-2 stg:py-8",children:[(0,n.jsx)(eU.SpinnerIcon,{size:14}),(0,n.jsx)("p",{className:"stg:text-xs stg:text-muted-foreground",children:"Starting Workflow Architect…"})]}),h&&(0,n.jsx)(eL.MessageThread,{executions:g.completedExecutions,activeStreamExecution:g.activeExecution,className:"stg:flex-1"}),g.error&&"error"===g.phase&&(0,n.jsxs)("div",{className:"stg:mx-3 stg:mt-3 stg:space-y-2",children:[(0,n.jsx)("div",{className:"stg:rounded-md stg:border stg:border-destructive/30 stg:bg-destructive/5 stg:px-3 stg:py-2 stg:text-xs stg:text-destructive",role:"alert",children:g.error}),(0,n.jsx)("button",{type:"button",onClick:v,className:(0,u.cn)("stg:w-full stg:rounded-md stg:px-3 stg:py-1.5 stg:text-xs stg:font-medium stg:transition-colors","stg:border stg:border-input stg:bg-background stg:text-foreground","stg:hover:bg-accent stg:hover:text-accent-foreground"),children:"Try Again"})]})]}),"complete"===g.phase&&g.extractedYaml&&(0,n.jsx)(eq,{extractedYaml:g.extractedYaml,explanation:g.explanation,beforeYaml:s,onApplyFix:r?f:void 0,onDiscard:x}),"ready"===g.phase&&!g.extractedYaml&&g.completedExecutions.length>0&&(0,n.jsx)("div",{className:"stg:border-t stg:border-border stg:px-3 stg:py-2",children:(0,n.jsx)("div",{className:"stg:rounded-md stg:border stg:border-border stg:bg-muted/50 stg:px-2.5 stg:py-2 stg:text-[0.7rem] stg:text-muted-foreground",children:"No workflow definition changes are needed. Check the analysis above for remediation steps."})}),(0,n.jsxs)("div",{className:"stg:border-t stg:border-border stg:p-3",children:[(0,n.jsx)("textarea",{value:l,onChange:e=>c(e.target.value),onKeyDown:b,placeholder:"Ask a follow-up question...",disabled:!m,rows:2,className:(0,u.cn)("stg:w-full stg:resize-none stg:rounded-md stg:border stg:border-input stg:bg-background stg:px-2.5 stg:py-1.5 stg:text-sm stg:text-foreground","stg:placeholder:text-muted-foreground","stg:focus-visible:outline-none stg:focus-visible:ring-1 stg:focus-visible:ring-ring","stg:disabled:pointer-events-none stg:disabled:opacity-50")}),(0,n.jsxs)("div",{className:"stg:mt-2 stg:flex stg:items-center stg:justify-between",children:[(0,n.jsxs)("p",{className:"stg:text-[0.65rem] stg:text-muted-foreground",children:["⌘","+Enter to send"]}),(0,n.jsx)("button",{type:"button",onClick:p,disabled:!m||l.trim().length<5,className:(0,u.cn)("stg:inline-flex stg:items-center stg:gap-1.5 stg:rounded-md stg:px-3 stg:py-1.5 stg:text-xs stg:font-medium stg:transition-colors","stg:bg-primary stg:text-primary-foreground stg:hover:bg-primary/90","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring","stg:disabled:pointer-events-none stg:disabled:opacity-40"),children:"Send"})]})]})]})}function eq({extractedYaml:e,explanation:t,beforeYaml:s,onApplyFix:r,onDiscard:i}){let[o,l]=(0,a.useState)(!1),c=s?(0,eW.computeUnifiedDiff)(s,e):null,d=c?.some(e=>"equal"!==e.type)??!1;return(0,n.jsxs)("div",{className:"stg:border-t stg:border-border stg:px-3 stg:py-3","aria-live":"polite",children:[t&&(0,n.jsxs)("div",{className:"stg:mb-3",children:[(0,n.jsx)("h4",{className:"stg:mb-1 stg:text-[0.65rem] stg:font-medium stg:uppercase stg:tracking-wider stg:text-muted-foreground",children:"Suggested Fix"}),(0,n.jsx)("p",{className:"stg:text-xs stg:leading-relaxed stg:text-foreground",children:t})]}),d&&s&&(0,n.jsx)("div",{className:"stg:mb-3",children:(0,n.jsx)("div",{className:"stg:h-[200px] stg:overflow-hidden stg:rounded-md stg:border stg:border-border",children:(0,n.jsx)(eK.WorkflowDiffGraph,{beforeYaml:s,afterYaml:e})})}),d&&c&&(0,n.jsxs)("div",{className:"stg:mb-3",children:[(0,n.jsx)("button",{type:"button",onClick:()=>l(e=>!e),className:"stg:text-[0.65rem] stg:font-medium stg:text-muted-foreground stg:hover:text-foreground",children:o?"▾ Hide YAML diff":"▸ View YAML diff"}),o&&(0,n.jsx)("div",{className:"stg:mt-1",children:(0,n.jsx)(e$,{lines:c})})]}),(0,n.jsxs)("div",{className:"stg:flex stg:gap-2",children:[r&&(0,n.jsx)("button",{type:"button",onClick:r,className:(0,u.cn)("stg:flex-1 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/90","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring"),children:"Apply Fix"}),(0,n.jsx)("button",{type:"button",onClick:i,className:(0,u.cn)("stg:flex-1 stg:rounded-md stg:px-3 stg:py-1.5 stg:text-xs stg:font-medium stg:transition-colors","stg:border stg:border-input stg:bg-background stg:text-foreground","stg:hover:bg-accent stg:hover:text-accent-foreground","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring"),children:"Discard"})]})]})}function e$({lines:e}){return e.filter(e=>"equal"!==e.type||""!==e.content.trim()).length>200?(0,n.jsx)("p",{className:"stg:text-[0.7rem] stg:text-muted-foreground",children:"Diff is too large to display. Apply the fix to see the updated YAML."}):(0,n.jsx)("pre",{className:"stg:max-h-60 stg:overflow-auto stg:rounded-md stg:border stg:border-border stg:text-[0.7rem] stg:leading-relaxed",children:e.map((e,t)=>(0,n.jsxs)("div",{className:(0,u.cn)("stg:px-2","added"===e.type&&"stg:bg-success/10 stg:text-success","removed"===e.type&&"stg:bg-destructive/10 stg:text-destructive","equal"===e.type&&"stg:text-muted-foreground"),children:[(0,n.jsx)("span",{className:"stg:mr-2 stg:inline-block stg:w-3 stg:select-none stg:text-right stg:opacity-60",children:"added"===e.type?"+":"removed"===e.type?"-":" "}),e.content]},t))})}function eH(){return(0,n.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,n.jsx)("path",{d:"M8 2l1.5 4.5L14 8l-4.5 1.5L8 14l-1.5-4.5L2 8l4.5-1.5z"})})}function eG(){return(0,n.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round","aria-hidden":"true",children:(0,n.jsx)("path",{d:"M4 4l8 8M12 4l-8 8"})})}var eV=e.i(154548),eX=e.i(30590),eQ=e.i(882267),eY=e.i(144905),eJ=e.i(714028),eZ=e.i(678321),e0=e.i(532680),e1=e.i(926059);e.i(222258);var e2=e.i(967785),e5=e.i(242792),e3=e.i(455959);let e6=new Map([["agent","agent_call"],["http","http_call"],["grpc","grpc_call"],["llm","llm_call"],["transform","transform"],["human_input","human_input"],["validate","validate"],["emit_event","emit_event"],["notification","notification"],["eval","eval"]]);var e7=e.i(286872),e4=e.i(207425);let e8=new Set(["running","waiting_approval","retrying"]),e9=new Set(["completed","failed","skipped"]),te=new Set(["completed","failed"]);async function tt(e,t,s){try{let r=await e.workflow.get(t);return{yaml:(0,e1.serializeWorkflowYaml)(r),isVersionPinned:!1,versionFetchFailed:s}}catch(e){if((0,et.isNotFound)(e))return null;throw e}}var ts=e.i(554823),tr=e.i(188482);let tn=(0,a.memo)(function({activeTask:e,isFollowing:t,onFollowToggle:s,onJumpToTask:r,className:i}){let o="waiting_approval"===e.status,l=e.concurrentCount>1,[c,d]=(0,a.useState)(e.durationMs),g=(0,a.useRef)(null);(0,a.useEffect)(()=>(d(e.durationMs),"running"===e.status&&(g.current=setInterval(()=>{d(e=>e+1e3)},1e3)),()=>{g.current&&(clearInterval(g.current),g.current=null)}),[e.taskName,e.durationMs,e.status]);let m=o?`Awaiting approval: ${e.currentToolName||e.taskName}`:l?`Running: ${e.taskName} (+${e.concurrentCount-1} parallel)`:`Running: ${e.taskName}`,h=o?`Approval required for ${e.currentToolName||e.taskName}`:`Now running: ${e.taskName}`;return(0,n.jsxs)("div",{className:(0,u.cn)("stg:absolute stg:left-3 stg:top-3 stg:z-50 stg:flex stg:items-center stg:gap-2",i),children:[(0,n.jsxs)(tr.Tooltip,{children:[(0,n.jsxs)(tr.TooltipTrigger,{render:(0,n.jsx)("button",{type:"button",onClick:r,className:(0,u.cn)("stg:flex stg:items-center stg:gap-2 stg:rounded-md stg:border stg:px-2.5 stg:py-1.5 stg:text-xs stg:font-medium stg:shadow-sm stg:backdrop-blur-sm stg:transition-colors",o?"stg:border-[var(--stgm-warning,#f59e0b)]/40 stg:bg-[var(--stgm-warning,#f59e0b)]/10 stg:text-[var(--stgm-foreground,#1a1a2e)] stg:hover:bg-[var(--stgm-warning,#f59e0b)]/20":"stg:border-[var(--stgm-primary,#6366f1)]/30 stg:bg-[var(--stgm-card,#fff)]/90 stg:text-[var(--stgm-foreground,#1a1a2e)] stg:hover:bg-[var(--stgm-primary,#6366f1)]/10")}),children:[(0,n.jsx)("span",{className:(0,u.cn)("stg:inline-block stg:h-2 stg:w-2 stg:rounded-full stg:motion-safe:animate-pulse",o?"stg:bg-[var(--stgm-warning,#f59e0b)]":"stg:bg-[var(--stgm-primary,#6366f1)]"),"aria-hidden":"true"}),(0,n.jsx)("span",{children:m}),c>0&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("span",{className:"stg:text-[var(--stgm-muted-foreground,#737373)]","aria-hidden":"true",children:"·"}),(0,n.jsx)("span",{className:"stg:tabular-nums stg:text-[var(--stgm-muted-foreground,#737373)]",children:(0,eS.formatDuration)(c)})]})]}),(0,n.jsx)(tr.TooltipContent,{side:"bottom",children:"Click to center on active task"})]}),(0,n.jsxs)(tr.Tooltip,{children:[(0,n.jsx)(tr.TooltipTrigger,{render:(0,n.jsx)("button",{type:"button",onClick:s,className:(0,u.cn)("stg:flex stg:h-7 stg:w-7 stg:items-center stg:justify-center stg:rounded-md stg:border stg:shadow-sm stg:backdrop-blur-sm stg:transition-colors",t?"stg:border-[var(--stgm-primary,#6366f1)]/40 stg:bg-[var(--stgm-primary,#6366f1)]/10 stg:text-[var(--stgm-primary,#6366f1)]":"stg:border-[var(--stgm-border,#e5e5e5)] stg:bg-[var(--stgm-card,#fff)]/90 stg:text-[var(--stgm-muted-foreground,#737373)] stg:hover:text-[var(--stgm-foreground,#1a1a2e)]"),"aria-label":t?"Stop following active task":"Follow active task","aria-pressed":t}),children:(0,n.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:t?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("circle",{cx:"7",cy:"7",r:"3",stroke:"currentColor",strokeWidth:"1.5"}),(0,n.jsx)("path",{d:"M7 1v2M7 11v2M1 7h2M11 7h2",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("path",{d:"M1.5 7s2.2-3.5 5.5-3.5S12.5 7 12.5 7s-2.2 3.5-5.5 3.5S1.5 7 1.5 7z",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"}),(0,n.jsx)("circle",{cx:"7",cy:"7",r:"1.5",stroke:"currentColor",strokeWidth:"1.5"})]})})}),(0,n.jsx)(tr.TooltipContent,{side:"bottom",children:t?"Following active task (click to stop)":"Follow active task"})]}),(0,n.jsx)("span",{role:"status","aria-live":"polite","aria-atomic":"true",className:"stg:sr-only",children:h})]})});function ta(e){let[t,s]=(0,a.useState)(""),r=(0,a.useRef)(new Map);return(0,a.useEffect)(()=>{let t=r.current,n=[];for(let[s,r]of e){let e=t.get(s);if(e?.status!==r.status)switch(r.status){case"running":n.push(`Task ${s} started`);break;case"completed":n.push(`Task ${s} completed`);break;case"failed":n.push(r.error?`Task ${s} failed: ${r.error.slice(0,80)}`:`Task ${s} failed`);break;case"waiting_approval":n.push(`Approval required for task ${s}`);break;case"retrying":n.push(`Task ${s} retrying, attempt ${r.attemptNumber}`)}}n.length>0&&s(n.join(". ")),r.current=e},[e]),t}let ti={[eJ.CANVAS_TASK_NODE_TYPE]:eQ.WorkflowNode},to={[eJ.CANVAS_TRANSITION_EDGE_TYPE]:eY.CanvasTransitionEdge},tl={markerEnd:{type:eX.MarkerType.ArrowClosed,width:16,height:16}},tu=(0,a.memo)(function(e){return(0,n.jsx)(eV.ReactFlowProvider,{children:(0,n.jsx)(td,{...e})})}),tc=new Set([3,4,5,6]);function td({executionId:e,followExecution:t=!1,execution:s,taskStates:r,panelOffsetPx:i=0,announceTaskStates:o=!0,nodesDraggable:l=!1,className:g}){let{nodes:m,edges:h,isLoading:p,error:f,versionMismatch:x,taskStates:v,executionPhase:b}=function(e){let{executionId:t,nodesDraggable:s=!1}=e,r=(0,c.useStigmer)(),n=en(void 0!==e.execution?null:t),i=void 0!==e.execution?e.execution:n.execution,o=void 0===e.execution&&n.isLoading,l=void 0!==e.execution?null:n.error,u=i?.status?.phase,g=i?.spec?.workflowId||null,m=i?.spec?.workflowInstanceId||null,h=i?.status?.workflowVersionHash||null,p=!g&&m?async()=>{try{let e=await r.workflowInstance.get(m);return e.spec?.workflowId??null}catch{return null}}:null,{data:f}=(0,d.useFetch)(p,[m,r],null),x=g||f,v=x?async()=>{if(h)try{let e=await r.workflow.getVersion((0,j.create)(e0.GetWorkflowVersionInputSchema,{workflowId:x,versionHash:h}));if(e?.validatedYaml)return{yaml:e.validatedYaml,isVersionPinned:!0,versionFetchFailed:!1};return await tt(r,x,!0)}catch{return await tt(r,x,!0)}return await tt(r,x,!1)}:null,{data:b,isLoading:y,error:k}=(0,d.useFetch)(v,[x,h,r],null),w=b?.isVersionPinned??!1,N=(0,a.useMemo)(()=>{if(!b?.yaml)return null;try{let e=!function(e){try{let t=(0,e2.parse)(e);return null!=t&&"object"==typeof t&&!Array.isArray(t)&&"do"in t&&Array.isArray(t.do)}catch{return!1}}(b.yaml)?(0,eJ.yamlToGraph)(b.yaml):function(e){let t=function(e){let t;try{t=(0,e2.parse)(e)}catch{throw Error("Failed to parse content as YAML.")}if(!t||"object"!=typeof t||Array.isArray(t))throw Error("YAML must be a mapping document.");return t}(e),s=function(e){let t=e.document;if(!t||"object"!=typeof t||Array.isArray(t))throw Error("CNCF workflow YAML is missing required field: document.");return{dsl:"string"==typeof t.dsl?t.dsl:"1.0.0",namespace:"string"==typeof t.namespace?t.namespace:"",name:"string"==typeof t.name?t.name:"",version:"string"==typeof t.version?t.version:"",..."string"==typeof t.description&&{description:t.description}}}(t),r=t.do;if(!Array.isArray(r)||0===r.length)throw Error("CNCF workflow YAML is missing required field: do (task list).");let n=function(e){let t=[];for(let s of e){if(!s||"object"!=typeof s||Array.isArray(s))continue;let e=Object.keys(s);if(1!==e.length)continue;let r=e[0],n=s[r];if(!n||"object"!=typeof n||Array.isArray(n))continue;let a=function(e,t){let s="string"==typeof t.then?t.then:void 0,r=function(e){let t=e.export;if(!t||"object"!=typeof t||Array.isArray(t))return;let s=t.as;return"string"==typeof s?s:void 0}(t);if("switch"in t&&Array.isArray(t.switch)){let n=function(e){let t=[];for(let s of e){if(!s||"object"!=typeof s||Array.isArray(s))continue;let e=Object.keys(s);if(1!==e.length)continue;let r=e[0],n=s[r];n&&"object"==typeof n&&!Array.isArray(n)?t.push({name:r,when:"string"==typeof n.when?n.when:void 0,then:"string"==typeof n.then?n.then:void 0}):t.push({name:r})}return t}(t.switch),a={cases:n.map(e=>({name:e.name,when:e.when}))};return{name:e,kind:(0,eJ.stringToTaskKind)("switch_case"),kindString:"switch_case",config:a,then:s,exportAs:r,switchCases:n}}if("set"in t){let n=t.set??{};return{name:e,kind:(0,eJ.stringToTaskKind)("set_vars"),kindString:"set_vars",config:n,then:s,exportAs:r}}if("for"in t){let n=t.for??{};return{name:e,kind:(0,eJ.stringToTaskKind)("for_each"),kindString:"for_each",config:{for:n},then:s,exportAs:r}}if("fork"in t){let n=t.fork??{};return{name:e,kind:(0,eJ.stringToTaskKind)("fork"),kindString:"fork",config:n,then:s,exportAs:r}}if("try"in t)return{name:e,kind:(0,eJ.stringToTaskKind)("try_catch"),kindString:"try_catch",config:{},then:s,exportAs:r};if("run"in t){let n=t.run??{};return{name:e,kind:(0,eJ.stringToTaskKind)("run_workflow"),kindString:"run_workflow",config:n,then:s,exportAs:r}}if("call"in t&&"string"==typeof t.call){var n;let a,i=(n=t.call,e6.get(n)??n),o=t.with??{};return"human_input"===i&&Array.isArray(o.outcomes)&&(a=o.outcomes.filter(e=>e&&"object"==typeof e&&"string"==typeof e.name).map(e=>({name:e.name,then:"string"==typeof e.then?e.then:void 0}))),{name:e,kind:(0,eJ.stringToTaskKind)(i),kindString:i,config:o,then:s,exportAs:r,outcomeThenEdges:a}}return{name:e,kind:ee.WorkflowTaskKind.workflow_task_kind_unspecified,kindString:"unknown",config:{},then:s,exportAs:r}}(r,n);a&&t.push(a)}return t}(r);if(0===n.length)throw Error("CNCF workflow YAML: do list contains no valid task entries.");let a=new Set(n.map(e=>e.name)),i=[],o=[],l=0,u=()=>`e_${l++}`;for(let e of(i.push({id:e5.START_NODE_ID,taskName:"Start",kind:ee.WorkflowTaskKind.workflow_task_kind_unspecified,category:"start",config:{},position:{x:0,y:0}}),n))i.push({id:e.name,taskName:e.name,kind:e.kind,category:(0,e3.categorizeKind)(e.kindString),config:e.config,...e.exportAs&&{export:{as:e.exportAs}},...e.then&&{flow:{then:e.then}},position:{x:0,y:0}});o.push({id:u(),source:e5.START_NODE_ID,target:n[0].name});let c=new Set;for(let e=0;e<n.length;e++){let t=n[e];if("end"===t.then){c.add(t.name);continue}if(t.then&&a.has(t.then)){o.push({id:u(),source:t.name,target:t.then});continue}if("switch_case"===t.kindString&&t.switchCases){for(let e of t.switchCases)e.name&&e.then&&a.has(e.then)&&o.push({id:u(),source:t.name,target:e.then,label:e.name,sourceHandle:`case_${e.name}`});!t.switchCases.some(e=>!e.when)&&e<n.length-1&&o.push({id:u(),source:t.name,target:n[e+1].name});continue}if("human_input"===t.kindString&&t.outcomeThenEdges){let e=!1;for(let s of t.outcomeThenEdges)s.name&&s.then&&a.has(s.then)&&(o.push({id:u(),source:t.name,target:s.then,label:s.name,sourceHandle:`outcome_${s.name}`}),e=!0);if(e)continue}e<n.length-1?o.push({id:u(),source:t.name,target:n[e+1].name}):c.add(t.name)}if(c.size>0)for(let e of(i.push({id:e5.END_NODE_ID,taskName:"End",kind:ee.WorkflowTaskKind.workflow_task_kind_unspecified,category:"end",config:{},position:{x:0,y:0}}),c))o.push({id:u(),source:e,target:e5.END_NODE_ID});return{document:s,nodes:i,edges:o}}(b.yaml),t=(0,e7.applyDagreLayout)(e,e4.EXECUTION_DAGRE_CONFIG);return{elements:(0,eJ.toReactFlowElements)(t),graphModel:t}}catch{return null}},[b]),S=N?.elements??null,C=N?.graphModel??null,E=ex(void 0!==e.taskStates?null:t,{executionPhase:u}),T=void 0!==e.taskStates?e.taskStates:E.taskStates,A=i?.status?.pendingApprovals,I=(0,a.useMemo)(()=>S?S.nodes.map(e=>{let t,r=e.data;if(r.isSentinel)return s?{...e,draggable:!1}:e;let n=T.get(r.taskName),a=n?{status:n.status,durationMs:n.durationMs,costMicros:n.costMicros,attemptNumber:n.attemptNumber,error:n.error||void 0}:{status:"not_reached"},i=r.kind===ee.WorkflowTaskKind.fork&&r.config?function(e,t){let s=e.branches;if(!Array.isArray(s)||0===s.length)return null;let r=!0===e.compete,n=0,a=0;for(let e of s){if(!e||"object"!=typeof e)continue;let s=e.do;if(!Array.isArray(s)||0===s.length){a++;continue}a++,s.every(e=>{if(!e||"object"!=typeof e||!e.name)return!1;let s=t.get(e.name);return s?.status==="completed"})&&n++}return 0===a?null:{completed:n,total:a,compete:r}}(r.config,T):null,o=n?.status==="running"&&n.agentSlug&&(n.currentToolName||n.messagesCount>0)?{agentSlug:n.agentSlug,currentToolName:n.currentToolName,messagesCount:n.messagesCount,toolCallsCount:n.toolCallsCount}:void 0;if(n?.status==="waiting_approval"&&n.childExecutionId&&A){let e=A.find(e=>e.childAgentExecutionId===n.childExecutionId);e?.approval?.toolName&&(t=e.approval.toolName)}return{...e,data:{...r,executionState:a,...i&&{forkProgress:i},...o&&{agentActivity:o},...t&&{approvalToolName:t}},draggable:s,connectable:!1,deletable:!1}}):[],[S,T,A,s]),M=(0,a.useMemo)(()=>{if(!S||!C)return[];let e=function(e,t,s){let r=new Map(t.map(e=>[e.id,e])),n=e=>{let t=r.get(e);if(!t)return"not_reached";var n=t.taskName;if(e===e5.START_NODE_ID)return"completed";if(e===e5.END_NODE_ID)return"not_reached";let a=s.get(n);return a?.status??"not_reached"},a=new Map;for(let t of e){let e=a.get(t.source);e||(e=[],a.set(t.source,e)),e.push(t)}let i=new Set;for(let[e,t]of a)t.some(e=>null!=e.sourceHandle)&&i.add(e);let o=new Map;for(let e of i){let t=(a.get(e)??[]).some(e=>null!=e.sourceHandle&&"not_reached"!==n(e.target));o.set(e,t)}let l=new Map;for(let t of e){let e=n(t.source),s=n(t.target);if("not_reached"===e||"pending"===e){l.set(t.id,"not_reached");continue}let r=te.has(e);if(r&&e8.has(s)){l.set(t.id,"active");continue}if(r&&e9.has(s)){l.set(t.id,"taken");continue}if(e8.has(e)){l.set(t.id,"not_reached");continue}if(r&&"not_reached"===s&&null!=t.sourceHandle&&i.has(t.source)&&o.get(t.source)){l.set(t.id,"not_taken");continue}if(r&&t.target===e5.END_NODE_ID){l.set(t.id,"taken");continue}l.set(t.id,"not_reached")}return l}(C.edges,C.nodes,T);return S.edges.map(t=>{let s=e.get(t.id);return s&&"not_reached"!==s?{...t,data:{...t.data,executionState:s}}:t})},[S,C,T]),O=b?.versionFetchFailed??!1,R=(0,a.useMemo)(()=>{if(w)return null;if(O&&h)return"Unable to load the pinned workflow version. Showing the current definition as a fallback.";if(!i?.status?.tasks||!S)return null;let e=new Set(i.status.tasks.map(e=>e.taskName).filter(Boolean)),t=new Set(S.nodes.map(e=>e.data.taskName).filter(e=>"Start"!==e&&"End"!==e)),s=[...e].filter(e=>!t.has(e)),r=[...t].filter(t=>!e.has(t));return s.length>0||r.length>0?"This execution predates version tracking. The workflow has since been modified.":null},[i?.status?.tasks,S,w,O,h]),_=o||y,D=l?.message??k?.message??(_||S||!x?null:"Unable to build workflow graph")??null;return{nodes:I,edges:M,executionPhase:u,isLoading:_,error:D,versionMismatch:R,versionResolutionFailed:O,taskStates:T}}({executionId:e,execution:s,taskStates:r,nodesDraggable:l}),{fitView:y}=(0,eV.useReactFlow)(),[k,w]=(0,a.useState)(!1),N=(0,a.useRef)(!1),S=(0,a.useRef)(!1),C=(0,a.useRef)(null),[E,T]=(0,a.useState)({});(0,a.useEffect)(()=>{T({})},[e]);let A=l&&Object.keys(E).length>0,I=(0,a.useCallback)(e=>{if(!l)return;let t=e.filter(e=>"position"===e.type&&"position"in e&&null!=e.position);0!==t.length&&T(e=>{let s={...e};for(let e of t)s[e.id]=e.position;return s})},[l]),M=(0,a.useCallback)(()=>{T({})},[]),O=(0,a.useCallback)(()=>{if(S.current)return;let e=C.current;e&&0!==e.offsetWidth&&0!==e.offsetHeight&&(S.current=!0,y({padding:.15,duration:(0,ts.getAnimationDuration)(300)}),w(!0))},[y]),R=(0,a.useCallback)(()=>{N.current=!0,m.length>0&&O()},[m.length,O]);(0,a.useEffect)(()=>{N.current&&m.length>0&&O()},[m.length,O]),(0,a.useEffect)(()=>{let e=C.current;if(!e||"u"<typeof ResizeObserver)return;let t=new ResizeObserver(()=>{N.current&&m.length>0&&O()});return t.observe(e),()=>t.disconnect()},[m.length,O]);let _=(0,a.useMemo)(()=>{let e=null,t=0;for(let[s,r]of v){if("waiting_approval"===r.status)return{taskName:s,status:"waiting_approval",durationMs:r.durationMs,agentSlug:r.agentSlug,currentToolName:r.currentToolName,concurrentCount:1};"running"===r.status&&(t++,e||(e={taskName:s,status:"running",durationMs:r.durationMs,agentSlug:r.agentSlug,currentToolName:r.currentToolName,concurrentCount:1}))}return e&&t>1?{...e,concurrentCount:t}:e},[v]),D=null!=b&&tc.has(b),{isFollowing:P,enableFollow:F,disableFollow:L,handleMoveStart:W}=function(e){let{enabled:t,activeTaskName:s,nodes:r,didInitialFit:n,isTerminal:i,panelOffsetPx:o=0}=e,{setCenter:l,getZoom:u,fitView:c}=(0,eV.useReactFlow)(),[d,g]=(0,a.useState)("auto_fit"),m=(0,a.useRef)(null),h=(0,a.useRef)(null);(0,a.useEffect)(()=>{i&&"auto_fit"!==d&&(g("auto_fit"),m.current=null,c({padding:.15,duration:(0,ts.getAnimationDuration)(300)}))},[i,d,c]),(0,a.useEffect)(()=>{if(!t||!n||"following"!==d||!s||s===m.current)return;let e=r.find(e=>e.data.taskName===s);if(e)return h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{var t;let r,n,a=e.width??e.measured?.width??200,i=e.height??e.measured?.height??56,c=(r=(t={nodeX:e.position.x,nodeY:e.position.y,nodeWidth:a,nodeHeight:i,currentZoom:u(),panelOffsetPx:o}).nodeX+t.nodeWidth/2,n=t.nodeY+t.nodeHeight/2,{x:r-(t.panelOffsetPx>0?t.panelOffsetPx/2/t.currentZoom:0),y:n,zoom:Math.max(t.currentZoom,1)}),d=(0,ts.getAnimationDuration)(400);l(c.x,c.y,{zoom:c.zoom,duration:d}),m.current=s},150),()=>{h.current&&clearTimeout(h.current)}},[t,n,d,s,r,l,u,o]),(0,a.useEffect)(()=>{t&&n&&"auto_fit"===d&&s&&g("following")},[t,n,d,s]);let p=(0,a.useCallback)((e,t)=>{null!==e&&"following"===d&&g("user_control")},[d]);return{followState:d,isFollowing:"following"===d,enableFollow:(0,a.useCallback)(()=>{g("following"),m.current=null},[]),disableFollow:(0,a.useCallback)(()=>{g("user_control")},[]),handleMoveStart:p}}({enabled:t,activeTaskName:_?.taskName??null,nodes:m,didInitialFit:k,isTerminal:D,panelOffsetPx:i}),K=ta(v),U=(0,a.useCallback)((e,t)=>{W(e,t)},[W]),B=(0,a.useMemo)(()=>m.map(e=>{let t=E[e.id];return t?{...e,position:t}:e}),[m,E]);return p?(0,n.jsx)("div",{className:(0,u.cn)("stg:flex stg:h-full stg:items-center stg:justify-center",g),children:(0,n.jsx)(tg,{})}):f?(0,n.jsx)("div",{className:(0,u.cn)("stg:flex stg:h-full stg:flex-col stg:items-center stg:justify-center stg:gap-2 stg:px-6 stg:text-center",g),children:(0,n.jsx)("p",{className:"stg:text-sm stg:text-[var(--stgm-muted-foreground,#737373)]",children:f})}):0===m.length?(0,n.jsx)("div",{className:(0,u.cn)("stg:flex stg:h-full stg:items-center stg:justify-center stg:text-sm stg:text-[var(--stgm-muted-foreground,#737373)]",g),children:"No graph available for this execution"}):(0,n.jsx)(eZ.WorkflowGraphModeProvider,{mode:"execution",children:(0,n.jsxs)("div",{ref:C,className:(0,u.cn)("stg:relative stg:h-full stg:w-full",g),children:[x&&(0,n.jsx)("div",{className:"stg:absolute stg:left-3 stg:right-3 stg:top-3 stg:z-50 stg:rounded-md stg:border stg:border-[var(--stgm-warning,#f59e0b)]/30 stg:bg-[var(--stgm-warning,#f59e0b)]/5 stg:px-3 stg:py-2 stg:text-xs stg:text-[var(--stgm-foreground,#1a1a2e)]",children:x}),t&&_&&(0,n.jsx)(tn,{activeTask:_,isFollowing:P,onFollowToggle:P?L:F,onJumpToTask:()=>F()}),A&&(0,n.jsx)("button",{type:"button",onClick:M,className:(0,u.cn)("stg:absolute stg:left-3 stg:z-50 stg:rounded-full stg:border stg:border-[var(--stgm-border,#e5e5e5)] stg:bg-[var(--stgm-background,#fff)] stg:px-3 stg:py-1 stg:text-xs stg:text-[var(--stgm-foreground,#1a1a2e)] stg:shadow-sm stg:transition-colors stg:hover:bg-[var(--stgm-muted,#f5f5f5)]",x?"stg:top-12":"stg:top-3"),children:"Reset layout"}),(0,n.jsxs)(eV.ReactFlow,{nodes:B,edges:h,nodeTypes:ti,edgeTypes:to,defaultEdgeOptions:tl,onInit:R,onMoveStart:U,onNodesChange:l?I:void 0,nodesDraggable:l,nodesConnectable:!1,nodesFocusable:!1,elementsSelectable:!1,panOnDrag:!0,zoomOnScroll:!0,fitView:!1,minZoom:.2,maxZoom:2,proOptions:{hideAttribution:!0},"aria-label":"Workflow execution graph",children:[(0,n.jsx)(eV.Background,{variant:eV.BackgroundVariant.Dots,gap:16,size:1}),(0,n.jsx)(eV.Controls,{showInteractive:!1}),(0,n.jsx)(eV.MiniMap,{nodeColor:e=>{let t=e.data,s=t.executionState?.status;return"completed"===s?"var(--stgm-success, #22c55e)":"failed"===s?"var(--stgm-destructive, #ef4444)":"running"===s?"var(--stgm-primary, #6366f1)":"var(--stgm-muted, #e5e5e5)"},pannable:!0,zoomable:!0})]}),o&&(0,n.jsx)("div",{role:"log","aria-live":"polite","aria-atomic":"false",className:"stg:sr-only",children:K})]})})}function tg(){return(0,n.jsxs)("div",{className:"stg:flex stg:flex-col stg:items-center stg:gap-3",children:[(0,n.jsx)("div",{className:"stg:h-8 stg:w-8 stg:animate-pulse stg:rounded-full stg:bg-[var(--stgm-muted,#e5e5e5)]"}),(0,n.jsx)("div",{className:"stg:h-3 stg:w-24 stg:animate-pulse stg:rounded stg:bg-[var(--stgm-muted,#e5e5e5)]"}),(0,n.jsxs)("div",{className:"stg:mt-2 stg:flex stg:gap-4",children:[(0,n.jsx)("div",{className:"stg:h-10 stg:w-32 stg:animate-pulse stg:rounded-md stg:bg-[var(--stgm-muted,#e5e5e5)]"}),(0,n.jsx)("div",{className:"stg:h-10 stg:w-32 stg:animate-pulse stg:rounded-md stg:bg-[var(--stgm-muted,#e5e5e5)]"})]})]})}var tm=e.i(468806),th=e.i(879738),tp=e.i(361353);let tf=new Set([Z.ExecutionPhase.EXECUTION_COMPLETED,Z.ExecutionPhase.EXECUTION_FAILED,Z.ExecutionPhase.EXECUTION_CANCELLED,Z.ExecutionPhase.EXECUTION_TERMINATED]),tx=(0,a.memo)(function({open:e,workflowId:t,baseExecutionId:s,basePhase:r,onConfirm:i,onClose:o}){let[l,c]=(0,a.useState)(null),{executions:d,isLoading:g}=(0,th.useWorkflowExecutionList)({workflowId:t,pageSize:20}),m=(0,a.useMemo)(()=>d.filter(e=>e.metadata?.id!==s&&tf.has(e.status?.phase??Z.ExecutionPhase.EXECUTION_PHASE_UNSPECIFIED)),[d,s]);(0,a.useEffect)(()=>{if(!e||0===m.length||l)return;let t=r===Z.ExecutionPhase.EXECUTION_FAILED?Z.ExecutionPhase.EXECUTION_COMPLETED:Z.ExecutionPhase.EXECUTION_FAILED,s=m.find(e=>e.status?.phase===t),n=m[0];c((s??n)?.metadata?.id??null)},[e,m,l,r]),(0,a.useEffect)(()=>{e||c(null)},[e]);let h=(0,a.useCallback)(()=>{l&&i(l)},[l,i]),p=(0,a.useCallback)(e=>{e||o()},[o]);return(0,n.jsx)(tm.DialogShell,{open:e,onOpenChange:p,width:"md",dismissOnBackdrop:!0,className:"stgm stg:max-h-[70vh] stg:bg-[var(--stgm-background,#fff)] stg:border-[var(--stgm-border,#e5e5e5)]","aria-label":"Select execution to compare",children:(0,n.jsxs)("div",{className:"stg:flex stg:flex-col",children:[(0,n.jsxs)("div",{className:"stg:flex stg:items-center stg:justify-between stg:border-b stg:border-[var(--stgm-border,#e5e5e5)] stg:px-4 stg:py-3",children:[(0,n.jsx)("span",{className:"stg:text-sm stg:font-semibold stg:text-[var(--stgm-foreground,#1a1a2e)]",children:"Compare with..."}),(0,n.jsx)("button",{type:"button",onClick:o,className:"stg:flex stg:h-6 stg:w-6 stg:items-center stg:justify-center stg:rounded stg:text-[var(--stgm-muted-foreground,#737373)] stg:hover:bg-[var(--stgm-muted,#f5f5f5)] stg:hover:text-[var(--stgm-foreground,#1a1a2e)]","aria-label":"Close",children:(0,n.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round","aria-hidden":"true",children:(0,n.jsx)("path",{d:"M2 2l8 8M10 2l-8 8"})})})]}),(0,n.jsxs)("div",{className:"stg:max-h-[50vh] stg:overflow-y-auto stg:p-2",role:"listbox","aria-label":"Recent executions",children:[g&&(0,n.jsx)("div",{className:"stg:flex stg:items-center stg:justify-center stg:py-8 stg:text-xs stg:text-[var(--stgm-muted-foreground,#737373)]",children:"Loading executions..."}),!g&&0===m.length&&(0,n.jsx)("div",{className:"stg:flex stg:items-center stg:justify-center stg:py-8 stg:text-xs stg:text-[var(--stgm-muted-foreground,#737373)]",children:"No other completed executions found."}),m.map(e=>{let t,s=e.metadata?.id??"",r=e.metadata?.name||e.metadata?.slug||s,a=e.status?.phase??Z.ExecutionPhase.EXECUTION_PHASE_UNSPECIFIED,i=e.status?.startedAt,o=function(e,t){if(!e||!t)return null;let s=new Date(e).getTime(),r=new Date(t).getTime();return Number.isNaN(s)||Number.isNaN(r)?null:r-s}(i,e.status?.completedAt),d=s===l;return(0,n.jsxs)("button",{type:"button",role:"option","aria-selected":d,onClick:()=>c(s),className:(0,u.cn)("stg:flex stg:w-full stg:items-center stg:gap-3 stg:rounded-md stg:px-3 stg:py-2 stg:text-left stg:text-sm stg:transition-colors",d?"stg:bg-[var(--stgm-primary,#4f46e5)]/10 stg:ring-1 stg:ring-[var(--stgm-primary,#4f46e5)]":"stg:hover:bg-[var(--stgm-muted,#f5f5f5)]"),children:[(0,n.jsx)(eN.WorkflowExecutionPhaseBadge,{phase:a}),(0,n.jsxs)("div",{className:"stg:flex stg:flex-1 stg:flex-col stg:gap-0.5 stg:overflow-hidden",children:[(0,n.jsx)("span",{className:"stg:truncate stg:text-xs stg:font-medium stg:text-[var(--stgm-foreground,#1a1a2e)]",children:r}),(0,n.jsxs)("span",{className:"stg:text-[10px] stg:text-[var(--stgm-muted-foreground,#737373)]",children:[i?Number.isNaN((t=new Date(i)).getTime())?"—":(0,tp.formatRelativeTime)(t):"—",null!=o&&` \xb7 ${(0,eS.formatDuration)(o)}`]})]})]},s)})]}),(0,n.jsxs)("div",{className:"stg:flex stg:items-center stg:justify-end stg:gap-2 stg:border-t stg:border-[var(--stgm-border,#e5e5e5)] stg:px-4 stg:py-3",children:[(0,n.jsx)("button",{type:"button",onClick:o,className:"stg:rounded-md stg:px-3 stg:py-1.5 stg:text-xs stg:font-medium stg:text-[var(--stgm-muted-foreground,#737373)] stg:hover:bg-[var(--stgm-muted,#f5f5f5)] stg:hover:text-[var(--stgm-foreground,#1a1a2e)]",children:"Cancel"}),(0,n.jsx)("button",{type:"button",onClick:h,disabled:!l,className:(0,u.cn)("stg:rounded-md stg:px-3 stg:py-1.5 stg:text-xs stg:font-medium",l?"stg:bg-[var(--stgm-primary,#4f46e5)] stg:text-[var(--stgm-primary-foreground,#fff)] stg:hover:bg-[var(--stgm-primary,#4f46e5)]/90":"stg:cursor-not-allowed stg:bg-[var(--stgm-muted,#f5f5f5)] stg:text-[var(--stgm-muted-foreground,#737373)]"),children:"Compare"})]})]})})});var tv=e.i(911237);function tb(e){if(!e)return null;let t=new Date(e).getTime();return Number.isNaN(t)?null:t}function ty(e){let t=tb(e.startedAt),s=tb(e.completedAt);return null==t||null==s?null:s-t}function tk(e){let t=new Map;for(let s of e)s.taskName&&t.set(s.taskName,s);return t}BigInt(0);let tj=BigInt(0),tw=(0,a.memo)(function({comparison:e,className:t}){let s=function(e){var t,s;let{baseRow:r,compareRow:n,durationDeltaMs:a,costDeltaMicros:i,tokensDelta:o}=e,l={label:"Duration",baseValue:null!=r.durationMs?(0,eS.formatDuration)(r.durationMs):"—",compareValue:null!=n.durationMs?(0,eS.formatDuration)(n.durationMs):"—",delta:(t=a,s=e=>(0,eS.formatDuration)(Math.abs(e)),null==t?"—":0===t?"No change":`${t>0?"+":"−"}${s(Math.abs(t))}`),deltaDirection:null==a?"neutral":a>0?"worse":a<0?"better":"neutral"},u={label:"Cost",baseValue:r.costMicros>tj?(0,eS.formatMicroUsd)(r.costMicros):"—",compareValue:n.costMicros>tj?(0,eS.formatMicroUsd)(n.costMicros):"—",delta:tN(i,eS.formatMicroUsd),deltaDirection:i===tj?"neutral":i>tj?"worse":"better"},c={label:"Tokens",baseValue:r.totalTokens>tj?(0,eS.formatTokenCount)(r.totalTokens):"—",compareValue:n.totalTokens>tj?(0,eS.formatTokenCount)(n.totalTokens):"—",delta:tN(o,eS.formatTokenCount),deltaDirection:o===tj?"neutral":o>tj?"worse":"better"},d=e.tasks.filter(e=>e.statusChanged).length;return[l,u,c,{label:"Task Outcomes",baseValue:`${r.completedTaskCount}/${r.taskCount}`,compareValue:`${n.completedTaskCount}/${n.taskCount}`,delta:0===d?"All identical":`${d} differ`,deltaDirection:0===d?"neutral":"worse"}]}(e);return(0,n.jsx)("div",{className:(0,u.cn)("stg:grid stg:grid-cols-2 stg:gap-3 stg:lg:grid-cols-4",t),"aria-label":"Comparison summary",children:s.map(e=>(0,n.jsxs)("div",{className:"stg:rounded-lg stg:border stg:border-[var(--stgm-border,#e5e5e5)] stg:bg-[var(--stgm-card,#fff)] stg:p-3",children:[(0,n.jsx)("span",{className:"stg:text-[10px] stg:font-medium stg:uppercase stg:tracking-wide stg:text-[var(--stgm-muted-foreground,#737373)]",children:e.label}),(0,n.jsxs)("div",{className:"stg:mt-1.5 stg:flex stg:items-baseline stg:gap-2",children:[(0,n.jsx)("span",{className:"stg:text-sm stg:font-semibold stg:text-[var(--stgm-foreground,#1a1a2e)]",children:e.baseValue}),(0,n.jsxs)("span",{className:"stg:text-[10px] stg:text-[var(--stgm-muted-foreground,#737373)]",children:["vs ",e.compareValue]})]}),(0,n.jsx)("div",{className:"stg:mt-1",children:(0,n.jsx)("span",{className:(0,u.cn)("stg:text-xs stg:font-medium","better"===e.deltaDirection&&"stg:text-[var(--stgm-success,#16a34a)]","worse"===e.deltaDirection&&"stg:text-[var(--stgm-destructive,#dc2626)]","neutral"===e.deltaDirection&&"stg:text-[var(--stgm-muted-foreground,#737373)]"),children:e.delta})})]},e.label))})});function tN(e,t){if(e===tj)return"No change";let s=e>tj?"+":"−";return`${s}${t(e<tj?-e:e)}`}let tS=BigInt(0),tC=(0,a.memo)(function({comparison:e,changesOnly:t=!1,className:s}){let[r,i]=(0,a.useState)(t?"changed":"all"),o=(0,a.useMemo)(()=>{switch(r){case"changed":return e.tasks.filter(e=>e.statusChanged);case"failed":return e.tasks.filter(e=>e.baseStatus===Z.WorkflowTaskStatus.WORKFLOW_TASK_FAILED||e.compareStatus===Z.WorkflowTaskStatus.WORKFLOW_TASK_FAILED);default:return e.tasks}},[e.tasks,r]),l=(0,a.useCallback)(e=>i(e),[]);return(0,n.jsxs)("div",{className:(0,u.cn)("stg:flex stg:flex-col stg:gap-2",s),children:[(0,n.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-1",role:"tablist","aria-label":"Task filter",children:[(0,n.jsx)(tM,{label:"All",count:e.tasks.length,active:"all"===r,onClick:()=>l("all")}),(0,n.jsx)(tM,{label:"Changed",count:e.tasks.filter(e=>e.statusChanged).length,active:"changed"===r,onClick:()=>l("changed")}),(0,n.jsx)(tM,{label:"Failed",count:e.tasks.filter(e=>e.baseStatus===Z.WorkflowTaskStatus.WORKFLOW_TASK_FAILED||e.compareStatus===Z.WorkflowTaskStatus.WORKFLOW_TASK_FAILED).length,active:"failed"===r,onClick:()=>l("failed")})]}),(0,n.jsx)("div",{className:"stg:overflow-x-auto stg:rounded-md stg:border stg:border-[var(--stgm-border,#e5e5e5)]",children:(0,n.jsxs)("table",{className:"stg:w-full stg:text-xs","aria-label":"Task comparison",children:[(0,n.jsx)("thead",{children:(0,n.jsxs)("tr",{className:"stg:border-b stg:border-[var(--stgm-border,#e5e5e5)] stg:bg-[var(--stgm-muted,#f5f5f5)]",children:[(0,n.jsx)("th",{className:"stg:px-3 stg:py-2 stg:text-left stg:font-medium stg:text-[var(--stgm-muted-foreground,#737373)]",children:"Task"}),(0,n.jsx)("th",{className:"stg:px-3 stg:py-2 stg:text-center stg:font-medium stg:text-[var(--stgm-muted-foreground,#737373)]",children:"Base Status"}),(0,n.jsx)("th",{className:"stg:px-3 stg:py-2 stg:text-center stg:font-medium stg:text-[var(--stgm-muted-foreground,#737373)]",children:"Compare Status"}),(0,n.jsx)("th",{className:"stg:px-3 stg:py-2 stg:text-right stg:font-medium stg:text-[var(--stgm-muted-foreground,#737373)]",children:"Duration"}),(0,n.jsx)("th",{className:"stg:px-3 stg:py-2 stg:text-right stg:font-medium stg:text-[var(--stgm-muted-foreground,#737373)]",children:"Cost"})]})}),(0,n.jsxs)("tbody",{children:[0===o.length&&(0,n.jsx)("tr",{children:(0,n.jsx)("td",{colSpan:5,className:"stg:px-3 stg:py-6 stg:text-center stg:text-[var(--stgm-muted-foreground,#737373)]",children:"all"===r?"No tasks to compare.":"No matching tasks."})}),o.map(t=>(0,n.jsx)(tE,{task:t,isDivergencePoint:t.taskName===e.divergencePoint},t.taskName))]})]})}),(e.tasksOnlyInBase.length>0||e.tasksOnlyInCompare.length>0)&&(0,n.jsxs)("div",{className:"stg:mt-1 stg:text-[10px] stg:text-[var(--stgm-muted-foreground,#737373)]",children:[e.tasksOnlyInBase.length>0&&(0,n.jsxs)("p",{children:["Only in base: ",e.tasksOnlyInBase.join(", ")]}),e.tasksOnlyInCompare.length>0&&(0,n.jsxs)("p",{children:["Only in compare: ",e.tasksOnlyInCompare.join(", ")]})]})]})}),tE=(0,a.memo)(function({task:e,isDivergencePoint:t}){return(0,n.jsxs)("tr",{className:(0,u.cn)("stg:border-b stg:border-[var(--stgm-border,#e5e5e5)] stg:last:border-b-0",e.statusChanged&&"stg:bg-[var(--stgm-destructive,#dc2626)]/5",t&&"stg:ring-1 stg:ring-inset stg:ring-[var(--stgm-warning,#f59e0b)]/50"),children:[(0,n.jsx)("td",{className:"stg:px-3 stg:py-2",children:(0,n.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-1.5",children:[t&&(0,n.jsxs)(tr.Tooltip,{children:[(0,n.jsx)(tr.TooltipTrigger,{render:(0,n.jsx)("span",{className:"stg:inline-block stg:h-1.5 stg:w-1.5 stg:rounded-full stg:bg-[var(--stgm-warning,#f59e0b)]","aria-label":"Divergence point"})}),(0,n.jsx)(tr.TooltipContent,{side:"top",children:"First point of divergence"})]}),(0,n.jsx)("span",{className:"stg:font-medium stg:text-[var(--stgm-foreground,#1a1a2e)]",children:e.taskName})]})}),(0,n.jsx)("td",{className:"stg:px-3 stg:py-2 stg:text-center",children:(0,n.jsx)(tT,{status:e.baseStatus})}),(0,n.jsx)("td",{className:"stg:px-3 stg:py-2 stg:text-center",children:(0,n.jsx)(tT,{status:e.compareStatus})}),(0,n.jsx)("td",{className:"stg:px-3 stg:py-2 stg:text-right",children:(0,n.jsx)(tA,{task:e})}),(0,n.jsx)("td",{className:"stg:px-3 stg:py-2 stg:text-right",children:(0,n.jsx)(tI,{task:e})})]})});function tT({status:e}){let t=tO.get(e)??{label:"Unknown",colorClass:"stg:text-[var(--stgm-muted-foreground,#737373)]"};return(0,n.jsx)("span",{className:(0,u.cn)("stg:inline-flex stg:items-center stg:gap-1 stg:text-[10px] stg:font-medium",t.colorClass),children:t.label})}function tA({task:e}){if(null==e.baseDurationMs&&null==e.compareDurationMs)return(0,n.jsx)("span",{children:"—"});let t=null!=e.baseDurationMs?(0,eS.formatDuration)(e.baseDurationMs):"—",s=null!=e.compareDurationMs?(0,eS.formatDuration)(e.compareDurationMs):"—";if(null==e.durationDeltaMs||0===e.durationDeltaMs)return(0,n.jsx)("span",{className:"stg:text-[var(--stgm-muted-foreground,#737373)]",children:t});let r=e.durationDeltaMs>0?"+":"−",a=Math.abs(e.durationDeltaMs),i=e.durationDeltaMs>0?"stg:text-[var(--stgm-destructive,#dc2626)]":"stg:text-[var(--stgm-success,#16a34a)]";return(0,n.jsxs)("span",{className:"stg:flex stg:flex-col stg:items-end",children:[(0,n.jsxs)("span",{className:"stg:text-[var(--stgm-foreground,#1a1a2e)]",children:[t," / ",s]}),(0,n.jsxs)("span",{className:(0,u.cn)("stg:text-[10px]",i),children:[r,(0,eS.formatDuration)(a)]})]})}function tI({task:e}){if(e.baseCostMicros===tS&&e.compareCostMicros===tS)return(0,n.jsx)("span",{className:"stg:text-[var(--stgm-muted-foreground,#737373)]",children:"—"});let t=e.baseCostMicros>tS?(0,eS.formatMicroUsd)(e.baseCostMicros):"—",s=e.compareCostMicros>tS?(0,eS.formatMicroUsd)(e.compareCostMicros):"—";return e.baseCostMicros-e.compareCostMicros===tS?(0,n.jsx)("span",{className:"stg:text-[var(--stgm-muted-foreground,#737373)]",children:t}):(0,n.jsxs)("span",{className:"stg:text-[var(--stgm-foreground,#1a1a2e)]",children:[t," / ",s]})}function tM({label:e,count:t,active:s,onClick:r}){return(0,n.jsxs)("button",{type:"button",role:"tab","aria-selected":s,onClick:r,className:(0,u.cn)("stg:rounded-full stg:px-2.5 stg:py-1 stg:text-[10px] stg:font-medium stg:transition-colors",s?"stg:bg-[var(--stgm-foreground,#1a1a2e)] stg:text-[var(--stgm-background,#fff)]":"stg:bg-[var(--stgm-muted,#f5f5f5)] stg:text-[var(--stgm-muted-foreground,#737373)] stg:hover:bg-[var(--stgm-border,#e5e5e5)]"),children:[e," (",t,")"]})}let tO=new Map([[Z.WorkflowTaskStatus.WORKFLOW_TASK_STATUS_UNSPECIFIED,{label:"—",colorClass:"stg:text-[var(--stgm-muted-foreground,#737373)]"}],[Z.WorkflowTaskStatus.WORKFLOW_TASK_PENDING,{label:"Pending",colorClass:"stg:text-[var(--stgm-muted-foreground,#737373)]"}],[Z.WorkflowTaskStatus.WORKFLOW_TASK_IN_PROGRESS,{label:"Running",colorClass:"stg:text-[var(--stgm-foreground,#1a1a2e)]"}],[Z.WorkflowTaskStatus.WORKFLOW_TASK_COMPLETED,{label:"Completed",colorClass:"stg:text-[var(--stgm-success,#16a34a)]"}],[Z.WorkflowTaskStatus.WORKFLOW_TASK_FAILED,{label:"Failed",colorClass:"stg:text-[var(--stgm-destructive,#dc2626)]"}],[Z.WorkflowTaskStatus.WORKFLOW_TASK_SKIPPED,{label:"Skipped",colorClass:"stg:text-[var(--stgm-muted-foreground,#737373)]"}],[Z.WorkflowTaskStatus.WORKFLOW_TASK_WAITING_APPROVAL,{label:"Waiting",colorClass:"stg:text-[var(--stgm-warning,#f59e0b)]"}]]);var tR=e.i(364802);let t_=(0,a.memo)(function({baseExecutionId:e,compareExecutionId:t,onBack:s,className:r}){let{comparison:i,isLoading:o,error:l}=function({baseId:e,compareId:t}){let{execution:s,isLoading:r,error:n,refetch:i}=en(e),{execution:o,isLoading:l,error:u,refetch:c}=en(t);return{comparison:(0,a.useMemo)(()=>s&&o?function(e,t){let s=(0,tv.deriveExecutionRow)(e),r=(0,tv.deriveExecutionRow)(t),n=e.status?.tasks??[],a=t.status?.tasks??[],i=tk(n),o=tk(a),l=new Set;i.forEach((e,t)=>l.add(t)),o.forEach((e,t)=>l.add(t));let u=[],c=[],d=[],g=null;for(let e of Array.from(l).sort((e,t)=>{let s=n.findIndex(t=>t.taskName===e),r=n.findIndex(e=>e.taskName===t);return(s>=0?s:a.findIndex(t=>t.taskName===e))-(r>=0?r:a.findIndex(e=>e.taskName===t))})){let t=i.get(e),s=o.get(e);if(t&&!s){c.push(e);continue}if(!t&&s){d.push(e);continue}if(!t||!s)continue;let r=t.status??Z.WorkflowTaskStatus.WORKFLOW_TASK_STATUS_UNSPECIFIED,n=s.status??Z.WorkflowTaskStatus.WORKFLOW_TASK_STATUS_UNSPECIFIED,a=r!==n,l=ty(t),m=ty(s),h=null!=l&&null!=m?l-m:null,p=BigInt(t.costMicros??0),f=BigInt(s.costMicros??0),x=BigInt(t.inputTokens??0)+BigInt(t.outputTokens??0),v=BigInt(s.inputTokens??0)+BigInt(s.outputTokens??0);a&&null===g&&(g=e),u.push({taskName:e,taskKind:null!=t.taskType?String(t.taskType):"",baseStatus:r,compareStatus:n,statusChanged:a,baseDurationMs:l,compareDurationMs:m,durationDeltaMs:h,baseCostMicros:p,compareCostMicros:f,baseTokens:x,compareTokens:v,baseError:t.error||null,compareError:s.error||null})}let m=null!=s.durationMs&&null!=r.durationMs?s.durationMs-r.durationMs:null;return{baseRow:s,compareRow:r,durationDeltaMs:m,costDeltaMicros:s.costMicros-r.costMicros,tokensDelta:s.totalTokens-r.totalTokens,tasks:u,tasksOnlyInBase:c,tasksOnlyInCompare:d,divergencePoint:g}}(s,o):null,[s,o]),isLoading:r||l,error:n??u??null,refetch:(0,a.useMemo)(()=>()=>{i(),c()},[i,c])}}({baseId:e,compareId:t});return o?(0,n.jsx)("div",{className:(0,u.cn)("stg:flex stg:items-center stg:justify-center stg:py-16",r),children:(0,n.jsx)("span",{className:"stg:text-sm stg:text-[var(--stgm-muted-foreground,#737373)]",children:"Loading comparison..."})}):l?(0,n.jsxs)("div",{className:(0,u.cn)("stg:flex stg:flex-col stg:items-center stg:justify-center stg:gap-2 stg:py-16",r),children:[(0,n.jsx)("span",{className:"stg:text-sm stg:text-[var(--stgm-destructive,#dc2626)]",children:"Failed to load executions"}),(0,n.jsx)("span",{className:"stg:text-xs stg:text-[var(--stgm-muted-foreground,#737373)]",children:l.message})]}):i?(0,n.jsxs)("section",{className:(0,u.cn)("stg:flex stg:flex-col stg:gap-4",r),"aria-label":"Execution comparison",children:[(0,n.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-3",children:[(0,n.jsxs)("button",{type:"button",onClick:s,className:"stg:flex stg:items-center stg:gap-1.5 stg:rounded-md stg:px-2 stg:py-1 stg:text-xs stg:font-medium stg:text-[var(--stgm-muted-foreground,#737373)] stg:hover:bg-[var(--stgm-muted,#f5f5f5)] stg:hover:text-[var(--stgm-foreground,#1a1a2e)]","aria-label":"Back to execution",children:[(0,n.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,n.jsx)("path",{d:"M7.5 9L4.5 6l3-3"})}),"Back"]}),(0,n.jsxs)("div",{className:"stg:flex stg:flex-1 stg:items-center stg:gap-2",children:[(0,n.jsx)(tD,{name:i.baseRow.name||e,phase:i.baseRow.phase,label:"Base"}),(0,n.jsx)("span",{className:"stg:text-xs stg:text-[var(--stgm-muted-foreground,#737373)]",children:"vs"}),(0,n.jsx)(tD,{name:i.compareRow.name||t,phase:i.compareRow.phase,label:"Compare"})]})]}),i.divergencePoint&&(0,n.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-2 stg:rounded-md stg:border stg:border-[var(--stgm-warning,#f59e0b)]/30 stg:bg-[var(--stgm-warning,#f59e0b)]/5 stg:px-3 stg:py-2",children:[(0,n.jsx)("span",{className:"stg:inline-block stg:h-2 stg:w-2 stg:rounded-full stg:bg-[var(--stgm-warning,#f59e0b)]","aria-hidden":"true"}),(0,n.jsxs)("span",{className:"stg:text-xs stg:text-[var(--stgm-foreground,#1a1a2e)]",children:["First divergence at ",(0,n.jsx)("strong",{children:i.divergencePoint})]})]}),(0,n.jsx)(tw,{comparison:i}),(0,n.jsx)(tC,{comparison:i})]}):null});function tD({name:e,phase:t,label:s}){return(0,n.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-1.5",children:[(0,n.jsxs)("span",{className:"stg:text-[10px] stg:font-medium stg:uppercase stg:tracking-wide stg:text-[var(--stgm-muted-foreground,#737373)]",children:[s,":"]}),(0,n.jsx)(eN.WorkflowExecutionPhaseBadge,{phase:t}),(0,n.jsx)(tR.TruncatedText,{text:e,className:"stg:max-w-[10rem] stg:text-xs stg:font-medium stg:text-[var(--stgm-foreground,#1a1a2e)]"})]})}var tP=e.i(776526),tF=e.i(227989),tL=e.i(503353);let tW=(0,tL.virtualEntryId)("filechange");function tK(e){return e.path||e.absolutePath}var tU=e.i(92649),tB=e.i(603115),tz=e.i(524067);let tq=(0,tL.virtualEntryId)("diagnosis"),t$="AI Diagnosis";function tH(e){let t=e.metadata?.id??"",s=e.spec?.displayName||e.metadata?.name||"Unnamed";return`${t}/${s}`}var tG=e.i(869803),tV=e.i(337249),tX=e.i(262045);function tQ(e){return e.spec?.displayName||e.metadata?.name||"Unnamed"}function tY(){let e=(0,c.useStigmer)(),[t,s]=(0,a.useState)(!1),[r,n]=(0,a.useState)(null),i=(0,a.useCallback)(async r=>{if(r&&!t){s(!0),n(null);try{let t=await e.artifact.getDownloadUrl(r);t.url&&window.open(t.url,"_blank","noopener,noreferrer")}catch(e){n((0,eo.toError)(e))}finally{s(!1)}}},[e,t]);return(0,a.useMemo)(()=>({download:i,isDownloading:t,error:r}),[i,t,r])}function tJ({artifacts:e,onOpen:t,onActivate:s}){let r=(0,a.useMemo)(()=>(function(e){let t=new Map;for(let s of e){let e=tQ(s).toLowerCase();t.set(e,(t.get(e)??0)+1)}return[...e.map(e=>{let s=(t.get(tQ(e).toLowerCase())??0)>1;return{artifact:e,item:(0,tX.fromArtifact)(e,s)}})].sort((e,t)=>e.item.name.localeCompare(t.item.name,void 0,{sensitivity:"base"}))})(e),[e]);return 0===r.length?(0,n.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,n.jsx)("p",{className:"stg:text-xs stg:text-muted-foreground",children:"No artifacts yet. Files produced by workflow tasks will appear here."})}):(0,n.jsx)("ul",{role:"list",className:`${tG.UNSTYLED_LIST} stg:flex stg:flex-col`,children:r.map(({artifact:e,item:r})=>(0,n.jsx)(tZ,{artifact:e,item:r,onOpen:()=>t(e),onActivate:s?()=>s(e):void 0},e.metadata?.id??r.name))})}function tZ({artifact:e,item:t,onOpen:s,onActivate:r}){let{download:a,isDownloading:i}=tY();return(0,n.jsx)(tV.ArtifactRowView,{item:t,onOpen:s,onActivate:r,onDownload:()=>a(e.metadata?.id??""),isDownloading:i})}var t0=e.i(488479);function t1({fileChanges:e,isLoading:t=!1,isRefetching:s=!1,error:r=null,activePath:i=null,onOpen:o}){let l=(0,a.useMemo)(()=>e.map(eb.toFileDiffEntry),[e]),u=(0,a.useMemo)(()=>new Map(e.map(e=>[e.path||e.absolutePath,e])),[e]);return t?(0,n.jsx)("div",{role:"status",className:"stg:flex stg:flex-col stg:items-center stg:justify-center stg:px-4 stg:py-8 stg:text-center",children:(0,n.jsx)("p",{className:"stg:text-xs stg:text-muted-foreground",children:"Loading file changes…"})}):0===e.length?(0,n.jsxs)("div",{className:"stg:flex stg:flex-col stg:gap-2 stg:px-4 stg:py-8 stg:text-center",children:[r&&(0,n.jsx)(t2,{error:r}),(0,n.jsx)("p",{className:"stg:text-xs stg:text-muted-foreground",children:"No file changes yet. Files edited by agent tasks will appear here."})]}):(0,n.jsxs)("div",{className:"stg:flex stg:flex-col stg:gap-2",children:[r&&(0,n.jsx)("div",{className:"stg:px-2 stg:pt-2",children:(0,n.jsx)(t2,{error:r})}),(0,n.jsx)(t0.DiffFileList,{files:l,selectedPath:i,onSelect:e=>{let t=u.get(e);t&&o(t)}}),s&&(0,n.jsx)("p",{role:"status",className:"stg:px-3 stg:pb-2 stg:text-[0.65rem] stg:text-muted-foreground-faint",children:"Updating…"})]})}function t2({error:e}){return(0,n.jsxs)("div",{role:"alert",className:"stg:rounded-md stg:border stg:border-border stg:bg-muted-subtle stg:px-3 stg:py-2 stg:text-left stg:text-xs stg:text-destructive",children:["Some task changes could not be loaded: ",e.message]})}let t5=BigInt(0),t3=BigInt(0);function t6({costSummary:e,taskStates:t}){let s=(0,a.useMemo)(()=>(function(e){let t=[];for(let s of e.values())(s.costMicros!==t5||s.tokensUsed!==t5)&&t.push({taskName:s.taskName,taskKind:s.taskKind,kindLabel:(0,e3.kindToDisplayName)((0,eJ.taskKindToString)(s.taskKind)),status:s.status,costMicros:s.costMicros,tokensUsed:s.tokensUsed});return t.sort((e,t)=>e.costMicros!==t.costMicros?e.costMicros>t.costMicros?-1:1:e.tokensUsed!==t.tokensUsed?e.tokensUsed>t.tokensUsed?-1:1:e.taskName.localeCompare(t.taskName,void 0,{sensitivity:"base"}))})(t),[t]);return e.costConsumedMicros>t3||e.tokensConsumed>t3||0!==s.length?(0,n.jsxs)("div",{className:"stg:flex stg:flex-col stg:gap-4",children:[(0,n.jsx)(t7,{costSummary:e}),s.length>0&&(0,n.jsxs)("div",{className:"stg:flex stg:flex-col stg:gap-1",children:[(0,n.jsx)("h3",{className:"stg:px-2 stg:text-xs stg:font-semibold stg:uppercase stg:tracking-wider stg:text-muted-foreground",children:"By task"}),(0,n.jsx)("ul",{role:"list",className:(0,u.cn)(tG.UNSTYLED_LIST,"stg:flex stg:flex-col"),children:s.map(e=>(0,n.jsx)(t8,{item:e},e.taskName))})]})]}):(0,n.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,n.jsx)("p",{className:"stg:text-xs stg:text-muted-foreground",children:"No usage data yet. Cost and token stats will appear here."})})}function t7({costSummary:e}){let t=e.costRemainingMicros>=t3?e.costConsumedMicros+e.costRemainingMicros:void 0,s=e.tokensRemaining>=t3?e.tokensConsumed+e.tokensRemaining:void 0;return(0,n.jsxs)("div",{className:"stg:flex stg:flex-col stg:gap-1.5 stg:px-2",role:"region","aria-label":"Execution cost summary",children:[(0,n.jsxs)("div",{className:"stg:flex stg:items-baseline stg:gap-1.5",children:[(0,n.jsx)("span",{className:"stg:text-sm stg:font-medium stg:tabular-nums stg:text-foreground",children:(0,eS.formatMicroUsd)(e.costConsumedMicros)}),void 0!==t&&(0,n.jsxs)("span",{className:"stg:text-xs stg:tabular-nums stg:text-muted-foreground",children:["of ",(0,eS.formatMicroUsd)(t)," budget"]})]}),(0,n.jsx)(t4,{consumed:e.costConsumedMicros,limit:t,breached:e.thresholdBreached,label:"Cost budget"}),(0,n.jsxs)("div",{className:"stg:text-xs stg:tabular-nums stg:text-muted-foreground",children:[(0,eS.formatTokenCount)(e.tokensConsumed)," tokens",void 0!==s&&` of ${(0,eS.formatTokenCount)(s)}`]}),(0,n.jsx)(t4,{consumed:e.tokensConsumed,limit:s,breached:e.thresholdBreached,label:"Token budget"}),e.thresholdBreached&&(0,n.jsxs)("p",{className:"stg:flex stg:items-center stg:gap-1.5 stg:text-xs stg:text-warning",children:[(0,n.jsx)(t9,{}),"Budget threshold breached"]})]})}function t4({consumed:e,limit:t,breached:s,label:r}){if(void 0===t||t<=t3)return null;let a=Number(e*BigInt(100)/t);return(0,n.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-2","aria-label":r,children:[(0,n.jsx)("div",{role:"progressbar","aria-valuenow":Math.min(a,100),"aria-valuemin":0,"aria-valuemax":100,className:"stg:h-1.5 stg:min-w-0 stg:flex-1 stg:overflow-hidden stg:rounded-full stg:bg-muted",children:(0,n.jsx)("div",{className:(0,u.cn)("stg:h-full stg:rounded-full stg:transition-all",s||a>80?"stg:bg-warning":"stg:bg-primary"),style:{width:`${Math.min(a,100)}%`}})}),(0,n.jsxs)("span",{className:"stg:shrink-0 stg:text-[10px] stg:tabular-nums stg:text-muted-foreground",children:[a.toFixed(0),"%"]})]})}function t8({item:e}){var t,s;return(0,n.jsx)("li",{className:"stg:flex stg:items-stretch",children:(0,n.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-left stg:text-xs stg:text-muted-foreground",children:[(0,n.jsxs)("span",{className:"stg:min-w-0 stg:flex-1 stg:truncate stg:text-foreground",children:[e.taskName,(0,n.jsxs)("span",{className:"stg:ml-1.5 stg:text-[0.65rem] stg:text-muted-foreground",children:[e.kindLabel,("running"===(t=e.status)||"retrying"===t||"waiting_approval"===t)&&` \xb7 ${"waiting_approval"===(s=e.status)?"waiting approval":s}`]})]}),(0,n.jsx)("span",{className:"stg:shrink-0 stg:tabular-nums stg:text-foreground",children:(0,eS.formatMicroUsd)(e.costMicros)}),(0,n.jsxs)("span",{className:"stg:w-14 stg:shrink-0 stg:text-right stg:tabular-nums stg:text-[0.65rem] stg:text-muted-foreground-faint",children:[(0,eS.formatTokenCount)(e.tokensUsed)," tok"]})]})})}function t9(){return(0,n.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","aria-hidden":"true",children:[(0,n.jsx)("path",{d:"M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"}),(0,n.jsx)("path",{d:"M12 9v4"}),(0,n.jsx)("path",{d:"M12 17h.01"})]})}function se(){return(0,n.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,n.jsx)("path",{d:"M21 8l-9-5-9 5v8l9 5 9-5z"}),(0,n.jsx)("path",{d:"M3 8l9 5 9-5"}),(0,n.jsx)("path",{d:"M12 13v9"})]})}function st(){return(0,n.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,n.jsx)("path",{d:"M14 3H7a1 1 0 0 0-1 1v16a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1V7z"}),(0,n.jsx)("path",{d:"M14 3v4h4"}),(0,n.jsx)("path",{d:"M10 11h4"}),(0,n.jsx)("path",{d:"M12 9v4"}),(0,n.jsx)("path",{d:"M10 16.5h4"})]})}function ss(){return(0,n.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,n.jsx)("path",{d:"M3 20h18"}),(0,n.jsx)("path",{d:"M6 20v-6"}),(0,n.jsx)("path",{d:"M11 20V9"}),(0,n.jsx)("path",{d:"M16 20v-9"}),(0,n.jsx)("path",{d:"M21 20V5"})]})}var sr=e.i(509968),sn=e.i(432814);let sa={content:null,contentType:null,totalSizeBytes:BigInt(0),isTruncated:!1};var si=e.i(193799);function so({artifact:e,className:t}){let s,r=e.metadata?.id??"",i=e.spec?.displayName||e.metadata?.name||"Unnamed",o=e.spec?.contentType??"",l=e.status?.sizeBytes??BigInt(0),g=!!r&&((s=o.toLowerCase()).startsWith("text/")||s.includes("json")||s.includes("yaml")||s.includes("xml")||s.includes("markdown")||s.includes("csv")),{content:m,contentType:h,isTruncated:p,isLoading:f,error:x}=function(e,t){let s=(0,c.useStigmer)(),{data:r,isLoading:n,isRefetching:a,error:i,refetch:o}=(0,d.useFetch)(e?()=>s.artifact.getContent((0,j.create)(ev.GetArtifactContentRequestSchema,{artifactId:e})).then(e=>({content:new TextDecoder().decode(e.content),contentType:e.contentType||null,totalSizeBytes:e.totalSizeBytes,isTruncated:e.truncated})):null,[e,s],sa,t?{cacheKey:t}:void 0);return{content:r.content,contentType:r.contentType,totalSizeBytes:r.totalSizeBytes,isTruncated:r.isTruncated,isLoading:n,isRefetching:a,error:i,refetch:o}}(g?r:null,g?`workflow-artifact-doc:${r}`:void 0),{download:v,isDownloading:b}=tY(),{copy:y,copied:k}=(0,si.useCopyFeedback)(),w=(0,a.useCallback)(()=>{m&&y(m)},[m,y]),N=null!==m;return(0,n.jsxs)("div",{role:"article","aria-label":`Artifact ${i}`,className:(0,u.cn)("stg:flex stg:min-h-0 stg:min-w-0 stg:flex-1 stg:flex-col",t),children:[(0,n.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,n.jsx)("span",{className:"stg:shrink-0 stg:text-muted-foreground",children:(0,n.jsx)(su,{})}),(0,n.jsx)("span",{className:"stg:truncate stg:text-sm stg:font-medium stg:text-foreground",children:i}),(0,n.jsx)("span",{className:"stg:shrink-0 stg:text-[0.65rem] stg:tabular-nums stg:text-muted-foreground-faint",children:(0,sn.formatArtifactSize)(l)}),o&&(0,n.jsx)("span",{className:"stg:shrink-0 stg:text-[0.65rem] stg:text-muted-foreground",children:o}),(0,n.jsxs)("div",{className:"stg:ml-auto stg:flex stg:min-w-0 stg:flex-wrap stg:items-center stg:gap-3",children:[N&&(0,n.jsxs)("button",{type:"button",onClick:w,"aria-label":k?"Copied to clipboard":"Copy content",className:(0,u.cn)("stg:inline-flex stg:items-center stg:gap-1.5 stg:text-xs stg:font-medium stg:transition-colors",k?"stg:text-success":"stg:text-muted-foreground stg:hover:text-foreground",sl),children:[k?(0,n.jsx)(sg,{}):(0,n.jsx)(sc,{}),k?"Copied":"Copy"]}),(0,n.jsxs)("button",{type:"button",onClick:()=>v(r),disabled:b||!r,className:(0,u.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",sl),children:[(0,n.jsx)(sd,{}),b?"Preparing…":"Download"]})]})]}),(0,n.jsx)("div",{className:"stg:min-w-0",children:(0,n.jsx)(sr.ArtifactFileContent,{fileName:i,content:m,contentType:h??o,isLoading:f,error:x,isTruncated:p})}),(0,n.jsx)("div",{role:"status","aria-live":"polite","aria-atomic":"true",className:"stg:sr-only",children:k&&"Content copied to clipboard"})]})}let sl="stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring stg:focus-visible:rounded-sm";function su(){return(0,n.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,n.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,n.jsx)("path",{d:"M9.5 1.5V4.5H12.5"})]})}function sc(){return(0,n.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,n.jsx)("rect",{x:"4",y:"4",width:"6.5",height:"6.5",rx:"1"}),(0,n.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 sd(){return(0,n.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,n.jsx)("path",{d:"M6 1.5V8.5"}),(0,n.jsx)("path",{d:"M3 6L6 9L9 6"}),(0,n.jsx)("path",{d:"M2 10.5H10"})]})}function sg(){return(0,n.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,n.jsx)("path",{d:"M2 6.5L4.5 9L10 3"})})}var sm=e.i(106909),sh=e.i(901982),sp=e.i(719705),sf=e.i(863714),sx=e.i(422891),sv=e.i(130460),sb=e.i(644389);let sy=[],sk=(0,a.memo)(function({childExecutionId:e,agentSlug:t,hitl:s,onNavigateToAgentExecution:r,className:i}){let{ref:o,isVisible:l}=function(){let e=(0,a.useRef)(null),[t,s]=(0,a.useState)(!1);return(0,a.useEffect)(()=>{let t=e.current;if(!t)return;let r=new IntersectionObserver(e=>{let t=e[e.length-1];t&&s(t.isIntersecting)},{root:null,rootMargin:"200px 0px 200px 0px",threshold:0});return r.observe(t),()=>r.disconnect()},[]),{ref:e,isVisible:t}}(),{execution:g,phase:m,isLoading:h,isReconnecting:p,error:f,reconnect:x}=function(e,t){let s=(0,c.useStigmer)(),r=t?.live??!0,n=e?async()=>{try{return await s.agentExecution.get(e)}catch(e){if((0,et.isNotFound)(e))return null;throw e}}:null,{data:i,isLoading:o,error:l,refetch:u}=(0,d.useFetch)(n,[e,s],null,{cacheKey:e?`agent-execution:${e}`:void 0}),g=i?.status?.phase??ec.ExecutionPhase.EXECUTION_PHASE_UNSPECIFIED,m=r&&null!==i&&!(0,eR.isTerminalPhase)(g),h=(0,eO.useExecutionStream)(m?e:null),p=(0,a.useRef)(null);e&&h.execution?p.current={id:e,execution:h.execution}:p.current?.id!==e&&(p.current=null);let f=h.execution??p.current?.execution??i,x=f?.status?.phase??ec.ExecutionPhase.EXECUTION_PHASE_UNSPECIFIED,v=h.reconnect,b=(0,a.useCallback)(()=>{u(),v()},[u,v]),y=l??h.error,{isStreaming:k,isReconnecting:j}=h;return(0,a.useMemo)(()=>({execution:f,phase:x,isLoading:o,isStreaming:k,isReconnecting:j,error:y,reconnect:b}),[f,x,o,k,j,y,b])}(e,{live:l}),v=(0,eR.isTerminalPhase)(m),b=(0,a.useMemo)(()=>v?[]:(0,sv.displayFileChangeSets)(g?.status).filter(e=>e.status===ec.FileChangeSetStatus.AWAITING_REVIEW&&e.changes.length>0),[g?.status,v]),y=s?.submitFileDecision,k=(0,a.useCallback)((t,s,r)=>{y?.(e,t,s,r)},[y,e]),j=p||!!r;return(0,n.jsxs)("div",{ref:o,role:"group","aria-label":t?`Transcript of agent ${t}`:"Agent transcript",className:(0,u.cn)("stg:flex stg:max-h-[60vh] stg:min-w-0 stg:flex-col",i),children:[j&&(0,n.jsxs)("div",{className:"stg:flex stg:min-w-0 stg:shrink-0 stg:items-center stg:gap-3 stg:pb-1.5",children:[p&&(0,n.jsx)("span",{className:"stg:text-xs stg:text-muted-foreground",children:"Reconnecting…"}),r&&(0,n.jsxs)("button",{type:"button",onClick:()=>r(e),className:"stg:ml-auto stg:inline-flex stg:shrink-0 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:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring stg:focus-visible:rounded-sm",children:[(0,n.jsx)(sj,{}),"Open standalone"]})]}),(0,n.jsx)("div",{className:"stg:min-h-0 stg:min-w-0 stg:flex-1",children:g?(0,n.jsx)(eL.MessageThread,{executions:sy,activeStreamExecution:g,onApprovalSubmit:s?.submitApproval,submittingApprovalIds:s?.approvalSubmittingToolCallIds,approvalErrors:s?.approvalErrorsByToolCallId,showFileReviewRecords:null!=s,className:"stg:h-full"}):h?(0,n.jsx)(Y.ThreadSkeleton,{className:"stg:py-2"}):f?(0,n.jsxs)("div",{role:"alert",className:"stg:flex stg:flex-col stg:items-start stg:gap-2 stg:py-2",children:[(0,n.jsx)("p",{className:"stg:text-xs stg:text-destructive",children:f.message}),(0,n.jsx)("button",{type:"button",onClick:x,className:"stg:rounded stg:border stg:border-border stg:px-3 stg:py-1.5 stg:text-xs stg:font-medium stg:text-foreground stg:hover:bg-muted stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring",children:"Retry"})]}):(0,n.jsxs)("div",{role:"status",className:"stg:flex stg:flex-col stg:gap-1 stg:py-2",children:[(0,n.jsx)("p",{className:"stg:text-xs stg:font-medium stg:text-foreground",children:"This agent execution is no longer available."}),(0,n.jsx)("p",{className:"stg:text-xs stg:text-muted-foreground",children:"It may have been removed, or the workflow run predates transcript retention."})]})}),s&&b.length>0&&(0,n.jsx)(sb.FileReviewDock,{changeSets:b,onSubmit:k,submittingDecisionKeys:s.fileDecisionSubmittingKeys,decisionErrors:s.fileDecisionErrorsByKey,className:"stg:shrink-0"})]})});function sj(){return(0,n.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round",className:"stg:shrink-0","aria-hidden":"true",children:[(0,n.jsx)("path",{d:"M10.5 4.5V1.5H7.5"}),(0,n.jsx)("path",{d:"M10.5 1.5L6 6"}),(0,n.jsx)("path",{d:"M8.5 7v3a1 1 0 0 1-1 1h-5a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h3"})]})}var sw=e.i(167040),sN=e.i(156463),sS=e.i(918789),sC=e.i(61855),sE=e.i(954418),sT=e.i(321425),sA=e.i(46103);let sI=/^(https?:\/\/|[a-z]{2,6}_[0-9a-zA-Z]{8,}$|[0-9a-f]{8}-[0-9a-f]{4}-|\/[a-z])/,sM=(0,a.memo)(function({data:e,className:t}){let s=Object.entries(e);return 0===s.length?(0,n.jsx)("p",{className:(0,u.cn)("stg:text-xs stg:text-muted-foreground",t),children:"No data fields"}):(0,n.jsx)("div",{className:(0,u.cn)("stg:space-y-3 stg:text-xs",t),children:(0,n.jsx)(sO,{entries:s,depth:0})})});function sO({entries:e,depth:t}){let s=[],r=[];for(let[t,n]of e)(0,sA.isScalar)(n)||null==n?s.push([t,n]):r.push([t,n]);return(0,n.jsxs)(n.Fragment,{children:[s.length>0&&(0,n.jsx)("dl",{className:"stg:grid stg:grid-cols-[auto_1fr] stg:gap-x-3 stg:gap-y-1.5 stg:rounded-md stg:border stg:border-border stg:bg-muted-faint stg:px-2.5 stg:py-2",children:s.map(([e,t])=>(0,n.jsx)(sR,{label:e,value:t},e))}),r.map(([e,s])=>(0,n.jsx)(sD,{label:e,value:s,depth:t},e))]})}function sR({label:e,value:t}){let s=null==t?"—":String(t),r="string"==typeof t&&s.length>120&&!sI.test(s);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("dt",{className:"stg:whitespace-nowrap stg:font-mono stg:text-muted-foreground",children:(0,sA.humanizeArgKey)(e)}),r?(0,n.jsx)("dd",{className:"stg:min-w-0",children:(0,n.jsx)(s_,{text:s})}):(0,n.jsx)("dd",{className:(0,u.cn)("stg:min-w-0 stg:font-mono stg:text-foreground","boolean"==typeof t&&"stg:font-medium",null==t&&"stg:text-muted-foreground"),children:s.includes("\n")?(0,n.jsx)("pre",{className:"stg:whitespace-pre-wrap stg:break-words stg:rounded stg:border stg:border-border stg:bg-muted-subtle stg:px-2 stg:py-1 stg:font-mono stg:text-foreground",children:s}):(0,n.jsx)(tR.TruncatedText,{text:s,className:"stg:block"})})]})}function s_({text:e}){let t=e.length>300,[s,r]=(0,a.useState)(!1),i=t&&!s?e.slice(0,300)+"…":e;return(0,n.jsxs)("div",{children:[(0,n.jsx)("p",{className:"stg:whitespace-pre-wrap stg:break-words stg:leading-relaxed stg:text-foreground",children:i}),t&&(0,n.jsx)("button",{type:"button",onClick:()=>r(e=>!e),className:"stg:mt-0.5 stg:text-xs stg:font-medium stg:text-primary stg:transition-colors stg:hover:text-primary-muted",children:s?"Show less":"Show more"})]})}function sD({label:e,value:t,depth:s}){if(Array.isArray(t))return(0,n.jsx)(sF,{label:e,items:t,depth:s});if("object"==typeof t&&null!==t){let r=Object.entries(t);return 0===r.length||s+1>=5&&!sK(r)?(0,n.jsx)(sA.CollapsibleJsonBlock,{label:(0,sA.humanizeArgKey)(e),content:(0,sA.formatJson)(t)}):(0,n.jsx)(sU,{label:(0,sA.humanizeArgKey)(e),children:(0,n.jsx)(sO,{entries:r,depth:s+1})})}return(0,n.jsx)(sA.CollapsibleJsonBlock,{label:(0,sA.humanizeArgKey)(e),content:(0,sA.formatJson)(t)})}let sP=["name","title","label","id"];function sF({label:e,items:t,depth:s}){if(0===t.length)return(0,n.jsxs)("div",{className:"stg:flex stg:items-baseline stg:gap-1.5",children:[(0,n.jsx)("span",{className:"stg:font-medium stg:text-muted-foreground",children:(0,sA.humanizeArgKey)(e)}),(0,n.jsx)("span",{className:"stg:text-muted-foreground-subtle",children:"(0 items)"})]});if(t.every(e=>(0,sA.isScalar)(e)||null==e)&&t.length<=5)return(0,n.jsxs)("div",{className:"stg:space-y-1",children:[(0,n.jsx)("span",{className:"stg:font-medium stg:text-muted-foreground",children:(0,sA.humanizeArgKey)(e)}),(0,n.jsx)("p",{className:"stg:font-mono stg:text-foreground",children:t.map(e=>String(e??"null")).join(", ")})]});return t.every(e=>"object"==typeof e&&null!==e&&!Array.isArray(e))&&(s<5||t.every(e=>sK(Object.entries(e))))?(0,n.jsx)(sL,{label:e,items:t,depth:s}):(0,n.jsx)(sA.CollapsibleJsonBlock,{label:`${(0,sA.humanizeArgKey)(e)} (${t.length} items)`,content:(0,sA.formatJson)(t)})}function sL({label:e,items:t,depth:s}){let[r,i]=(0,a.useState)(!0),o=t.length<=3;return(0,n.jsxs)("div",{className:"stg:space-y-1.5",children:[(0,n.jsxs)("button",{type:"button",onClick:()=>i(e=>!e),className:"stg:flex stg:items-center stg:gap-1 stg:font-medium stg:text-muted-foreground stg:transition-colors stg:hover:text-foreground",children:[(0,n.jsx)(sB,{expanded:r}),(0,sA.humanizeArgKey)(e)," ",(0,n.jsxs)("span",{className:"stg:font-normal stg:text-muted-foreground-subtle",children:["(",t.length," ",1===t.length?"item":"items",")"]})]}),r&&(0,n.jsx)("div",{className:"stg:space-y-1.5 stg:border-l-2 stg:border-border stg:pl-3",children:t.map((e,t)=>(0,n.jsx)(sW,{item:e,index:t,depth:s,defaultExpanded:o},t))})]})}function sW({item:e,index:t,depth:s,defaultExpanded:r}){let[i,o]=(0,a.useState)(r),l=Object.entries(e),u=function(e){for(let t of sP){let s=e[t];if((0,sA.isScalar)(s))return String(s)}return null}(e),c=u?`Item ${t+1} \u2014 ${u}`:`Item ${t+1}`;return 0===l.length?(0,n.jsxs)("div",{className:"stg:text-muted-foreground",children:[c," ",(0,n.jsx)("span",{className:"stg:font-normal stg:text-muted-foreground-subtle",children:"(empty)"})]}):(0,n.jsxs)("div",{className:"stg:space-y-1",children:[(0,n.jsxs)("button",{type:"button",onClick:()=>o(e=>!e),className:"stg:flex stg:items-center stg:gap-1 stg:text-muted-foreground stg:transition-colors stg:hover:text-foreground",children:[(0,n.jsx)(sB,{expanded:i}),(0,n.jsx)("span",{className:"stg:font-medium",children:`Item ${t+1}`}),u&&(0,n.jsxs)("span",{className:"stg:font-normal stg:text-muted-foreground-subtle",children:["— ",u]})]}),i&&(0,n.jsx)("div",{className:"stg:border-l-2 stg:border-border stg:pl-3",children:(0,n.jsx)(sO,{entries:l,depth:s+1})})]})}function sK(e){return e.every(([,e])=>(0,sA.isScalar)(e)||null==e)}function sU({label:e,children:t}){let[s,r]=(0,a.useState)(!0);return(0,n.jsxs)("div",{className:"stg:space-y-1.5",children:[(0,n.jsxs)("button",{type:"button",onClick:()=>r(e=>!e),className:"stg:flex stg:items-center stg:gap-1 stg:font-medium stg:text-muted-foreground stg:transition-colors stg:hover:text-foreground",children:[(0,n.jsx)(sB,{expanded:s}),e]}),s&&(0,n.jsx)("div",{className:"stg:border-l-2 stg:border-border stg:pl-3",children:t})]})}function sB({expanded:e}){return(0,n.jsx)("svg",{width:"8",height:"8",viewBox:"0 0 8 8",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:(0,u.cn)("stg:shrink-0 stg:transition-transform stg:duration-150",e&&"stg:rotate-90"),"aria-hidden":"true",children:(0,n.jsx)("path",{d:"M2 1L6 4L2 7"})})}let sz=[{name:"approve",label:"Approve"},{name:"reject",label:"Reject"}],sq=(0,a.memo)(function({taskName:e,prompt:t,outcomes:s,formSchema:r,payload:i=null,onSubmit:o,isSubmitting:l,error:c,className:d}){var g;let m=s.length>0?s:sz,[h,p]=(0,a.useState)(null),[f,x]=(0,a.useState)(""),[v,b]=(0,a.useState)({}),y=(0,a.useMemo)(()=>(function(e){if(!e||"object"!=typeof e)return[];let t=e.properties;return t&&"object"==typeof t?Object.entries(t).map(([e,t])=>({name:e,label:s$(e.replace(/_/g," ")),description:"string"==typeof t?.description?t.description:""})):[]})(r),[r]);(0,a.useEffect)(()=>{l||p(null)},[l]);let k=(0,a.useCallback)((e,t)=>{b(s=>({...s,[e]:t}))},[]),j=(0,a.useCallback)(t=>{p(t);let s=y.length>0?Object.fromEntries(Object.entries(v).filter(([,e])=>""!==e.trim())):void 0;o(e,t,s&&Object.keys(s).length>0?s:void 0,f.trim()||void 0)},[e,v,f,y.length,o]);return(0,n.jsxs)("div",{role:"form","aria-label":`Approval decision for ${e}`,"aria-busy":l,className:(0,u.cn)("stg:mt-2 stg:rounded-lg stg:border stg:border-border-prominent stg:border-l-2 stg:border-l-warning stg:p-3",d),children:[t&&(0,n.jsx)("div",{className:"stg:mb-3 stg:max-h-80 stg:overflow-y-auto stg:rounded stg:border stg:border-border stg:bg-background stg:p-3",children:(0,n.jsx)("div",{className:"stgm-prose",children:(0,n.jsx)(sS.default,{components:sC.MARKDOWN_COMPONENTS,remarkPlugins:sC.REMARK_PLUGINS,children:t})})}),null!==i&&(0,n.jsx)("div",{"aria-label":`Review material for ${e}`,className:"stg:mb-3 stg:max-h-96 stg:overflow-y-auto stg:rounded stg:border stg:border-border stg:bg-background stg:p-3",children:null===(g=i)||"object"!=typeof g||Array.isArray(g)?(0,n.jsx)("pre",{className:"stg:overflow-auto stg:whitespace-pre-wrap stg:break-words stg:font-mono stg:text-xs stg:leading-relaxed stg:text-foreground",children:(0,n.jsx)("code",{children:(0,sA.formatJson)(i)})}):(0,n.jsx)(sM,{data:i})}),y.length>0&&(0,n.jsx)("div",{className:"stg:mb-3 stg:space-y-2",children:y.map(t=>(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{htmlFor:`${e}-${t.name}`,className:"stg:mb-1 stg:block stg:text-xs stg:font-medium stg:text-foreground",children:t.label}),(0,n.jsx)("textarea",{id:`${e}-${t.name}`,value:v[t.name]??"",onChange:e=>k(t.name,e.target.value),placeholder:t.description,disabled:l,rows:2,className:(0,u.cn)("stg:w-full stg:rounded stg:border stg:border-border stg:bg-background stg:px-2 stg:py-1.5 stg:text-xs stg:text-foreground","stg:placeholder:text-muted-foreground","stg:focus:outline-none stg:focus:ring-1 stg:focus:ring-ring","stg:disabled:opacity-50","stg:resize-y")})]},t.name))}),(0,n.jsx)("div",{className:"stg:mb-2",children:(0,n.jsx)("textarea",{value:f,onChange:e=>x(e.target.value),placeholder:"Comment (optional)",disabled:l,rows:1,className:(0,u.cn)("stg:w-full stg:rounded stg:border stg:border-border stg:bg-background stg:px-2 stg:py-1.5 stg:text-xs stg:text-foreground","stg:placeholder:text-muted-foreground","stg:focus:outline-none stg:focus:ring-1 stg:focus:ring-ring","stg:disabled:opacity-50","stg:resize-y")})}),(0,n.jsx)("div",{className:"stg:flex stg:flex-wrap stg:gap-2",children:m.map((e,t)=>(0,n.jsx)(sE.DecisionButton,{label:e.label||s$(e.name),variant:function(e,t,s){if(0===t)return"primary";let r=e.toLowerCase();return"reject"===r||"deny"===r||r.includes("reject")||t===s-1&&2===s?"danger":"ghost"}(e.name,t,m.length),onClick:()=>j(e.name),isActive:h===e.name,isSubmitting:l},e.name))}),c&&(0,n.jsx)("div",{className:"stg:mt-2",children:(0,n.jsx)(sT.InCardDecisionError,{error:c,leadIn:"submit decision",cursorTarget:"wf-task-approval-error"})})]})});function s$(e){return e.charAt(0).toUpperCase()+e.slice(1)}let sH=(0,a.memo)(function({taskName:e,prompt:t,outcomes:s,formSchema:r,payload:i=null,uiHint:o,payloadArtifactId:l=null,onSubmit:u,isSubmitting:c,error:g,className:m}){let h=(0,sw.useReviewRenderer)(o),p=function(e,t){let s=(0,a.useContext)(sN.StigmerContext),{data:r,isLoading:n,error:i,refetch:o}=(0,d.useFetch)(t?async()=>{if(!s)throw Error("This gate's review payload is artifact-backed and needs a Stigmer client to fetch. Wrap your component tree with <StigmerProvider client={stigmerClient}>.");let e=await s.artifact.getContent((0,j.create)(ev.GetArtifactContentRequestSchema,{artifactId:t,maxBytes:BigInt(0x3200000)}));if(e.truncated)throw Error(`Review payload artifact ${t} exceeds the 52428800 byte limit and was truncated`);return JSON.parse(new TextDecoder().decode(e.content))}:null,[t,s],null);return t?{payload:r,isLoading:n,error:i,refetch:o}:{payload:e,isLoading:!1,error:null,refetch:o}}(i,l??null),f=(0,a.useCallback)((t,s,r)=>u(e,t,s,r),[u,e]);return p.isLoading?(0,n.jsx)(sG,{taskName:e,className:m}):p.error?(0,n.jsx)(sV,{taskName:e,error:p.error,onRetry:p.refetch,className:m}):h&&null!==p.payload?(0,n.jsx)("div",{className:m,children:(0,n.jsx)(h,{taskName:e,payload:p.payload,formSchema:r??null,outcomes:s,submit:f,isSubmitting:c,error:g??null})}):(0,n.jsx)(sq,{taskName:e,prompt:t,outcomes:s,formSchema:r,payload:p.payload,onSubmit:u,isSubmitting:c,error:g,className:m})});function sG({taskName:e,className:t}){return(0,n.jsx)("div",{role:"status","aria-label":`Loading review material for ${e}`,className:(0,u.cn)("stg:mt-2 stg:rounded-lg stg:border stg:border-border-prominent stg:border-l-2 stg:border-l-warning stg:p-3",t),children:(0,n.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-2 stg:text-xs stg:text-muted-foreground",children:[(0,n.jsx)(sX,{}),"Loading review material…"]})})}function sV({taskName:e,error:t,onRetry:s,className:r}){return(0,n.jsxs)("div",{role:"alert",className:(0,u.cn)("stg:mt-2 stg:rounded-lg stg:border stg:border-border-prominent stg:border-l-2 stg:border-l-destructive stg:p-3",r),children:[(0,n.jsxs)("p",{className:"stg:text-xs stg:font-medium stg:text-foreground",children:["Could not load the review material for ",e]}),(0,n.jsx)("p",{className:"stg:mt-1 stg:break-words stg:text-xs stg:text-muted-foreground",children:t.message}),(0,n.jsx)("p",{className:"stg:mt-1 stg:text-xs stg:text-muted-foreground",children:"The gate stays pending — retry to load the material before deciding."}),(0,n.jsx)("button",{type:"button",onClick:s,className:(0,u.cn)("stg:mt-2 stg:rounded stg:border stg:border-border stg:px-2 stg:py-1 stg:text-xs stg:font-medium stg:text-foreground","stg:transition-colors stg:hover:bg-muted","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring"),children:"Retry"})]})}function sX(){return(0,n.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",className:"stg:animate-spin","aria-hidden":"true",children:[(0,n.jsx)("circle",{cx:"6",cy:"6",r:"5",stroke:"currentColor",strokeWidth:"1.5",strokeOpacity:"0.25"}),(0,n.jsx)("path",{d:"M11 6a5 5 0 0 0-5-5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}var sQ=e.i(414385),sY=e.i(612221);function sJ(e,t){let s=e?.[t];return"string"==typeof s?s:""}function sZ(e,t){let s=e?.[t];return null===s||"object"!=typeof s||Array.isArray(s)?null:s}let s0=(0,a.memo)(function({taskName:e,prompt:t,outcomes:s,decision:r,className:i}){let o=!r||""===r.outcome,l=(0,a.useMemo)(()=>{if(!r||!r.outcome)return"";let e=s.find(e=>e.name===r.outcome);return e?.label||s5(r.outcome.replace(/_/g," "))},[r,s]),c=(0,a.useMemo)(()=>{let e;return r&&!o?(e=r.outcome.toLowerCase()).includes("reject")||e.includes("deny")||e.includes("decline")?"reject":e.includes("approve")||e.includes("accept")||"yes"===e?"approve":"neutral":"neutral"},[r,o]),d=(0,a.useMemo)(()=>{var e;return(e=r?.formData??null)?Object.entries(e).map(([e,t])=>({key:e,label:s5(e.replace(/_/g," ")),value:function(e){if(null==e)return"";if("string"==typeof e)return e;if("number"==typeof e||"boolean"==typeof e)return String(e);try{return JSON.stringify(e,null,2)}catch{return String(e)}}(t)})):[]},[r]),g=(0,a.useMemo)(()=>r?function(e){let t=e.reviewerActor,s=t?.displayName||t?.email||e.reviewer;if(!s)return null;let r=t?.email&&t.email!==s?t.email:"";return{label:s,email:r,avatar:t?.avatar??"",isRawId:!t?.displayName&&!t?.email}}(r):null,[r]);return(0,n.jsxs)("div",{role:"group","aria-label":`Approval decision for ${e}`,className:(0,u.cn)("stg:mt-2 stg:rounded-lg stg:border stg:border-border stg:bg-muted-subtle stg:p-3",i),children:[o?(0,n.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-2 stg:text-xs stg:text-muted-foreground",children:[(0,n.jsx)(sx.SpinnerIcon,{size:12}),(0,n.jsx)("span",{children:"Decision recorded — finalizing…"})]}):(0,n.jsxs)("div",{className:"stg:flex stg:flex-wrap stg:items-center stg:gap-x-2 stg:gap-y-1",children:[(0,n.jsxs)("span",{className:(0,u.cn)("stg:inline-flex stg:items-center stg:gap-1.5 stg:rounded-md stg:px-2 stg:py-1 stg:text-xs stg:font-medium",s2[c]),children:[(0,n.jsx)(s6,{tone:c}),l]}),r.autoResolved&&(0,n.jsx)("span",{className:"stg:rounded stg:bg-muted stg:px-1.5 stg:py-0.5 stg:text-[10px] stg:font-medium stg:text-muted-foreground",children:"auto-resolved"})]}),!o&&(0,n.jsxs)("div",{className:"stg:mt-1.5 stg:flex stg:flex-wrap stg:items-center stg:gap-x-1.5 stg:text-[11px] stg:text-muted-foreground",children:[g&&(0,n.jsx)(s1,{reviewer:g}),r.respondedAt&&(0,n.jsxs)(n.Fragment,{children:[g&&(0,n.jsx)(s3,{}),(0,n.jsx)("span",{className:"stg:tabular-nums",children:(0,eS.formatTimestamp)(r.respondedAt)})]}),r.waitDurationMs>0&&(0,n.jsxs)(n.Fragment,{children:[(g||r.respondedAt)&&(0,n.jsx)(s3,{}),(0,n.jsxs)("span",{className:"stg:tabular-nums",children:["waited ",(0,eS.formatDuration)(r.waitDurationMs)]})]})]}),t&&(0,n.jsx)("div",{className:"stg:mt-3 stg:max-h-80 stg:overflow-y-auto stg:rounded stg:border stg:border-border stg:bg-background stg:p-3",children:(0,n.jsx)("div",{className:"stgm-prose",children:(0,n.jsx)(sS.default,{components:sC.MARKDOWN_COMPONENTS,remarkPlugins:sC.REMARK_PLUGINS,children:t})})}),!o&&r.comment&&(0,n.jsxs)("div",{className:"stg:mt-3",children:[(0,n.jsx)("p",{className:"stg:mb-1 stg:text-[11px] stg:font-medium stg:uppercase stg:tracking-wide stg:text-muted-foreground",children:"Comment"}),(0,n.jsx)("p",{className:"stg:whitespace-pre-wrap stg:rounded stg:border stg:border-border stg:bg-background stg:p-2 stg:text-xs stg:text-foreground",children:r.comment})]}),!o&&d.length>0&&(0,n.jsx)("dl",{className:"stg:mt-3 stg:space-y-2",children:d.map(e=>(0,n.jsxs)("div",{children:[(0,n.jsx)("dt",{className:"stg:mb-1 stg:text-[11px] stg:font-medium stg:uppercase stg:tracking-wide stg:text-muted-foreground",children:e.label}),(0,n.jsx)("dd",{className:"stg:whitespace-pre-wrap stg:rounded stg:border stg:border-border stg:bg-background stg:p-2 stg:text-xs stg:text-foreground",children:e.value})]},e.key))})]})});function s1({reviewer:e}){let t=(0,u.cn)(e.isRawId?"stg:font-mono stg:text-[10px] stg:text-muted-foreground":"stg:font-medium stg:text-foreground");return(0,n.jsxs)("span",{className:"stg:flex stg:items-center stg:gap-1",children:["by"," ",e.avatar&&(0,n.jsx)("img",{src:e.avatar,alt:"",className:"stg:size-3.5 stg:rounded-full"}),e.email?(0,n.jsxs)(tr.Tooltip,{children:[(0,n.jsx)(tr.TooltipTrigger,{render:(0,n.jsx)("span",{className:t}),children:e.label}),(0,n.jsx)(tr.TooltipContent,{side:"top",children:e.email})]}):(0,n.jsx)("span",{className:t,children:e.label})]})}let s2={approve:"stg:bg-success-subtle stg:text-success",reject:"stg:bg-destructive-subtle stg:text-destructive",neutral:"stg:bg-muted stg:text-foreground"};function s5(e){return e.length>0?e.charAt(0).toUpperCase()+e.slice(1):e}function s3(){return(0,n.jsx)("span",{"aria-hidden":"true",children:"·"})}function s6({tone:e}){return"reject"===e?(0,n.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.75","aria-hidden":"true",children:(0,n.jsx)("path",{d:"M3 3l6 6M9 3l-6 6",strokeLinecap:"round"})}):"approve"===e?(0,n.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.75","aria-hidden":"true",children:(0,n.jsx)("path",{d:"M2.5 6.5l2.5 2.5 4.5-5.5",strokeLinecap:"round",strokeLinejoin:"round"})}):(0,n.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.75","aria-hidden":"true",children:(0,n.jsx)("circle",{cx:"6",cy:"6",r:"4"})})}function s7(e,t,s){return e&&Object.keys(e).length>0?{data:e,summary:t,artifactIds:s,source:"snapshot"}:t&&Object.keys(t).length>0?{data:t,summary:t,artifactIds:s,source:"event-summary"}:null}let s4=new Map([["ai","action"],["control_flow","control"],["invocation","action"],["data","action"],["governance","gate"],["event","event"],["unspecified","action"]]),s8=new Map,s9=new Set([ee.WorkflowTaskKind.transform,ee.WorkflowTaskKind.validate,ee.WorkflowTaskKind.llm_call,ee.WorkflowTaskKind.eval,ee.WorkflowTaskKind.emit_event,ee.WorkflowTaskKind.notification,ee.WorkflowTaskKind.agent_call,ee.WorkflowTaskKind.set_vars,ee.WorkflowTaskKind.human_input,ee.WorkflowTaskKind.http_call,ee.WorkflowTaskKind.grpc_call,ee.WorkflowTaskKind.activity_call,ee.WorkflowTaskKind.run_workflow,ee.WorkflowTaskKind.try_catch,ee.WorkflowTaskKind.raise_error]);function re(e){return"string"==typeof e&&e.length>0?e:null}function rt(e){return null==e||"object"!=typeof e||Array.isArray(e)?null:e}function rs(e){if(null===e)return"null";if("string"==typeof e)return`"${rr(e)}"`;if("number"==typeof e||"boolean"==typeof e)return String(e);if(Array.isArray(e))return`[${e.length} ${1===e.length?"item":"items"}]`;let t=Object.keys(e);if(1===t.length){let s=e[t[0]];if(null===s||"string"==typeof s||"number"==typeof s||"boolean"==typeof s)return rs(s)}return`{${t.length} ${1===t.length?"field":"fields"}}`}function rr(e){let t=e.indexOf("\n");return -1===t?e:e.slice(0,t)}function rn(e){return e.length>80?`${e.slice(0,79)}\u2026`:e}let ra=new Set(["running","retrying","waiting_approval"]),ri=new Set(["completed","failed","skipped"]),ro=(0,a.memo)(function({taskStates:e,totalTasks:t,isRunning:s,onNavigateToAgentExecution:r,hitl:i,taskSnapshotsByName:o,scrollOnSend:l=!0,className:c}){let d,g,{items:m,progress:h}=(g=function(e,t,s){let r=new Map;if(s)for(let e of s)r.set(e.taskName,e);let n=[],a=0,i=0;for(let t of e.values()){var o,l,u;ri.has(t.status)?a+=1:ra.has(t.status)&&(i+=1);let e=function(e){var t,s;let r=s8.get(e.taskKind),n=r?.disclosure?.(e)??(t=e.taskKind,s9.has(t)?"preview":"summary"),a="waiting_approval"===(s=e).status?"Awaiting approval":"failed"===s.status&&s.error?rr(s.error):"skipped"===s.status?"Skipped":null;return null!==a?{previewLine:rn(a),disclosure:n}:{previewLine:rn(r?.previewLine?.(e)??function(e){var t,s;switch(e.taskKind){case ee.WorkflowTaskKind.agent_call:return function(e){let t=[];return e.agentSlug&&t.push(e.agentSlug),"running"===e.status&&e.currentToolName&&t.push(`running ${e.currentToolName}`),(e.messagesCount>0||e.toolCallsCount>0)&&t.push(`${e.messagesCount} msgs \xb7 ${e.toolCallsCount} tools`),t.length>0?t.join(" · "):null}(e);case ee.WorkflowTaskKind.set_vars:return function(e){if(!e)return null;let t=Object.keys(rt(e.variables)??e);if(0===t.length)return null;let s=t.slice(0,3).join(", "),r=t.length-3;return r>0?`set ${s} +${r} more`:`set ${s}`}(e.inputSummary);case ee.WorkflowTaskKind.transform:return function(e){let t=re(e.inputSummary?.engine)?.toLowerCase()??null;if(e.outputSummary){let s=rs(e.outputSummary);return t?`${t} → ${s}`:`→ ${s}`}return t}(e);case ee.WorkflowTaskKind.validate:return function(e){if(!e)return null;let t=e.valid;if(!0===t)return"valid";if(!1===t){let t=Array.isArray(e.errors)?e.errors.length:0;return t>0?`${t} ${1===t?"error":"errors"}`:"invalid"}return null}(e.outputSummary);case ee.WorkflowTaskKind.llm_call:return function(e){let t=[],s=re(e.inputSummary?.model);return s&&t.push(s),e.outputSummary&&t.push(rs(e.outputSummary)),t.length>0?t.join(" · "):null}(e);case ee.WorkflowTaskKind.eval:return function(e){if(!e)return null;let t=e.pass,s=e.score;if("boolean"!=typeof t)return null;let r=t?"pass":"fail";return"number"==typeof s?`${r} \xb7 score ${s}`:r}(e.outputSummary);case ee.WorkflowTaskKind.emit_event:return function(e){let t=re(e.outputSummary?.type);if(t)return`emitted ${t}`;let s=re(rt(e.inputSummary?.event)?.type);return s?`emitting ${s}`:null}(e);case ee.WorkflowTaskKind.notification:return function(e){let t=e.outputSummary,s=re(t?.channel)??re(e.inputSummary?.channel);return t&&!1===t.delivered?"delivery failed":t&&s?`sent via ${s}`:s}(e);case ee.WorkflowTaskKind.human_input:return function(e){let t=re(e?.outcome);if(!t)return null;let s=rt(e?.reviewer_actor),r=re(s?.display_name)??re(s?.email)??re(e?.reviewer);return r?`${t} \xb7 by ${r}`:t}(e.outputSummary);case ee.WorkflowTaskKind.wait:return function(e){let t=e.inputSummary;if(!t)return null;let s="running"===e.status?"waiting":"waited",r=rt(t.duration);if(r){let e=function(e){let t=t=>{let s=e[t];return"number"==typeof s&&Number.isFinite(s)?s:0},s=864e5*t("days")+36e5*t("hours")+6e4*t("minutes")+1e3*t("seconds")+t("milliseconds");return s>0?(0,eS.formatDuration)(s):null}(r);return e?`${s} ${e}`:null}let n=re(t.until);return n?`${s} until ${n}`:null}(e);case ee.WorkflowTaskKind.listen:return"running"===(t=e).status?"waiting for signal":"completed"===t.status?"signal received":null;case ee.WorkflowTaskKind.switch_case:return function(e){let t=re(e?.__flow_directive__);return t?`\u2192 ${t}`:null}(e.outputSummary);case ee.WorkflowTaskKind.try_catch:return"completed"===(s=e).status&&s.attemptNumber>1?`recovered after ${s.attemptNumber} attempts`:s.outputSummary?rs(s.outputSummary):null;default:return null}}(e)??""),disclosure:n}}(t),s={taskName:t.taskName,taskKind:t.taskKind,kindLabel:t.taskKind===ee.WorkflowTaskKind.workflow_task_kind_unspecified?"":(0,e3.kindToDisplayName)((0,eJ.taskKindToString)(t.taskKind)),variant:(o=t.taskKind)===ee.WorkflowTaskKind.agent_call?"agent-call":s4.get((0,e3.categorizeKind)((0,eJ.taskKindToString)(o)))??"action",status:t.status,durationMs:t.durationMs,costMicros:t.costMicros,tokensUsed:t.tokensUsed,attemptNumber:t.attemptNumber,error:t.error,childExecutionId:t.childExecutionId,agentSlug:t.agentSlug,currentToolName:t.currentToolName,messagesCount:t.messagesCount,toolCallsCount:t.toolCallsCount,previewLine:e.previewLine,disclosure:e.disclosure,inputSummary:t.inputSummary,outputSummary:t.outputSummary,approvalRequest:t.approvalRequest,approvalResolution:t.approvalResolution},c=r.get(t.taskName);n.push(c&&(l=c,u=s,l.taskName===u.taskName&&l.taskKind===u.taskKind&&l.status===u.status&&l.durationMs===u.durationMs&&l.costMicros===u.costMicros&&l.tokensUsed===u.tokensUsed&&l.attemptNumber===u.attemptNumber&&l.error===u.error&&l.childExecutionId===u.childExecutionId&&l.agentSlug===u.agentSlug&&l.currentToolName===u.currentToolName&&l.messagesCount===u.messagesCount&&l.toolCallsCount===u.toolCallsCount&&l.previewLine===u.previewLine&&l.inputSummary===u.inputSummary&&l.outputSummary===u.outputSummary&&l.approvalRequest===u.approvalRequest&&l.approvalResolution===u.approvalResolution)?c:s)}return{items:n,progress:{settledTasks:a,activeTasks:i,totalTasks:t>0?t:0}}}(e,t,(d=(0,a.useRef)([])).current),d.current=g.items,g),{scrollRef:p,sentinelRef:f,contentRef:x,isFollowing:v,jumpToLatest:b}=(0,sm.useAutoScroll)(),y=(0,a.useMemo)(()=>i&&l?{...i,submitApproval:(...e)=>(b(),i.submitApproval(...e)),submitTaskApproval:(...e)=>(b(),i.submitTaskApproval(...e)),submitFileDecision:(...e)=>(b(),i.submitFileDecision(...e))}:i,[i,l,b]);return(0,n.jsxs)("div",{className:(0,u.cn)("stg:relative stg:flex stg:h-full stg:min-h-0 stg:flex-col",c),children:[(0,n.jsx)(rl,{progress:h,isRunning:s}),(0,n.jsx)("div",{ref:p,className:"stg:min-h-0 stg:flex-1 stg:overflow-y-auto",children:(0,n.jsxs)("div",{ref:x,className:"stg:mx-auto stg:flex stg:w-full stg:max-w-3xl stg:flex-col stg:gap-2 stg:px-4 stg:py-4",children:[0===m.length?(0,n.jsx)(ru,{isRunning:s}):m.map(e=>(0,n.jsx)(rc,{item:e,onNavigateToAgentExecution:r,hitl:"waiting_approval"===e.status?y:void 0,snapshot:o?.get(e.taskName)},e.taskName)),(0,n.jsx)("div",{ref:f,"aria-hidden":"true"})]})}),(0,n.jsx)(sh.JumpToLatestButton,{visible:!v,onClick:b})]})});function rl({progress:e,isRunning:t}){let{settledTasks:s,activeTasks:r,totalTasks:a}=e,i=a>0?`${s} of ${a} tasks`:`${s} ${1===s?"task":"tasks"}`;return(0,n.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-2 stg:border-b stg:border-border stg:px-4 stg:py-1.5 stg:text-xs stg:text-muted-foreground",children:[(0,n.jsx)("span",{children:i}),r>0&&(0,n.jsxs)("span",{className:"stg:flex stg:items-center stg:gap-1.5",children:[(0,n.jsx)("span",{"aria-hidden":"true",className:(0,u.cn)("stg:size-1.5 stg:rounded-full stg:bg-primary",t&&"stg:animate-pulse")}),r," active"]})]})}function ru({isRunning:e}){return(0,n.jsx)("div",{role:"status",className:"stg:px-4 stg:py-10 stg:text-center stg:text-sm stg:text-muted-foreground",children:e?"Waiting for the first task to start…":"No task activity was recorded for this execution."})}let rc=(0,a.memo)(function({item:e,onNavigateToAgentExecution:t,hitl:s,snapshot:r}){let[i,o]=(0,a.useState)(!1),l=(0,a.useMemo)(()=>s7(r?.output,e.outputSummary,r?.artifactIds??[]),[r,e.outputSummary]),u=(0,a.useMemo)(()=>s7(r?.input,e.inputSummary,[]),[r,e.inputSummary]),c=(0,a.useMemo)(()=>{var t;return e.approvalRequest?{prompt:(t=e.approvalRequest).prompt,outcomes:(t.outcomes??[]).map(e=>({name:e.name,label:e.label})),formSchema:t.formSchema?t.formSchema:null,payload:t.payload?(0,sQ.toJson)(sY.ValueSchema,t.payload):null,uiHint:t.uiHint,payloadArtifactId:t.payloadArtifactId||null}:null},[e.approvalRequest]),d=(0,a.useMemo)(()=>{var t,s;let n;return e.approvalRequest?(t=e.approvalResolution,n=sJ(s=r?.output,"outcome"),null===t&&""===n?null:{outcome:n,reviewer:sJ(s,"reviewer")||(t?.resolvedBy??""),reviewerActor:function(e,t){let s=sZ(t,"reviewer_actor");if(s)return{id:sJ(s,"id"),displayName:sJ(s,"display_name"),email:sJ(s,"email"),avatar:sJ(s,"avatar")};let r=e?.resolvedByActor;return r?{id:r.id,displayName:r.displayName,email:r.email,avatar:r.avatar}:null}(t,s),respondedAt:sJ(s,"responded_at")||null,comment:sJ(s,"comment")||(t?.comment??""),formData:sZ(s,"form_data"),waitDurationMs:t?Number(t.waitDurationMs):0,autoResolved:s?.auto_resolved===!0}):null},[e.approvalRequest,e.approvalResolution,r]),g="preview"===e.disclosure,m="agent-call"===e.variant&&""!==e.childExecutionId,h=!!s&&"waiting_approval"===e.status&&!m,p=!h&&null!==c&&null!==d,f=!m&&g&&(null!==l||!!e.error||p),x=!g&&!m&&(rh(e).length>0||!!e.error||null!==u||null!==l),v=(0,eS.formatMetaChips)({durationMs:e.durationMs,costMicros:e.costMicros,tokens:e.tokensUsed}),b=e.previewLine||null;return(0,n.jsxs)(sf.ThreadCardShell,{accent:"waiting_approval"===e.status?"warning":null,cursorTarget:"workflow-task-row",children:[(0,n.jsxs)(sf.ThreadCardHeader,{gesture:x?{kind:"expand",expanded:i,onToggle:()=>o(e=>!e)}:{kind:"none"},children:[(0,n.jsx)(rx,{status:e.status}),(0,n.jsxs)("span",{className:"stg:min-w-0 stg:flex-1 stg:flex stg:items-baseline stg:gap-1.5 stg:overflow-hidden",children:[(0,n.jsx)("span",{className:"stg:shrink-0 stg:font-medium stg:text-foreground",children:e.taskName}),e.kindLabel&&(0,n.jsx)("span",{className:"stg:shrink-0 stg:rounded stg:border stg:border-border stg:px-1 stg:py-px stg:text-[10px] stg:uppercase stg:tracking-wide stg:text-muted-foreground",children:e.kindLabel}),e.attemptNumber>1&&(0,n.jsxs)("span",{className:"stg:shrink-0 stg:text-muted-foreground",children:["attempt ",e.attemptNumber]}),b&&(0,n.jsx)("span",{className:"stg:min-w-0 stg:truncate stg:text-muted-foreground",children:b})]}),v&&(0,n.jsx)("span",{className:"stg:shrink-0 stg:tabular-nums stg:text-muted-foreground",children:v})]}),h&&s&&(0,n.jsx)(sf.ThreadCardBody,{children:(0,n.jsx)(rd,{item:e,hitl:s,approvalRequestView:c})}),m&&(0,n.jsx)(sf.ThreadCardBody,{cursorTarget:"task-transcript",children:(0,n.jsxs)("div",{className:"stg:flex stg:flex-col stg:gap-2",children:[e.error&&(0,n.jsx)(sp.BoundedContent,{children:(0,n.jsx)("pre",{className:"stg:whitespace-pre-wrap stg:break-words stg:text-xs stg:text-destructive",children:e.error})}),(0,n.jsx)(sk,{childExecutionId:e.childExecutionId,agentSlug:e.agentSlug||void 0,hitl:s,onNavigateToAgentExecution:t})]})}),f&&(0,n.jsx)(sf.ThreadCardBody,{cursorTarget:"task-preview",children:(0,n.jsx)(rm,{item:e,outputIO:l,approvalSummary:p&&c?{request:c,decision:d}:void 0})}),x&&i&&(0,n.jsx)(sf.ThreadCardBody,{children:(0,n.jsx)(rp,{item:e,inputIO:u,outputIO:l})})]})});function rd({item:e,hitl:t,approvalRequestView:s}){return s?(0,n.jsx)(sH,{taskName:e.taskName,prompt:s.prompt,outcomes:s.outcomes,formSchema:s.formSchema??void 0,payload:s.payload,uiHint:s.uiHint,payloadArtifactId:s.payloadArtifactId,onSubmit:t.submitTaskApproval,isSubmitting:t.taskApprovalSubmittingTaskNames.has(e.taskName),error:t.taskApprovalErrorsByTaskName.get(e.taskName)??null}):(0,n.jsx)("p",{className:"stg:text-xs stg:text-muted-foreground",children:"Review required to continue this run."})}function rg({label:e,io:t}){return(0,n.jsxs)("div",{className:"stg:flex stg:flex-col stg:gap-1",children:[(0,n.jsx)("span",{className:"stg:text-[10px] stg:font-medium stg:uppercase stg:tracking-wide stg:text-muted-foreground",children:e}),"event-summary"===t.source&&(0,n.jsx)("p",{className:"stg:text-[10px] stg:text-muted-foreground",children:"Showing truncated summary from the event log. Full data appears when the run's snapshot is available."}),(0,n.jsx)(sp.BoundedContent,{children:(0,n.jsx)(sM,{data:t.data})})]})}function rm({item:e,outputIO:t,approvalSummary:s}){return(0,n.jsxs)("div",{className:"stg:flex stg:flex-col stg:gap-2",children:[e.error&&(0,n.jsx)(sp.BoundedContent,{children:(0,n.jsx)("pre",{className:"stg:whitespace-pre-wrap stg:break-words stg:text-xs stg:text-destructive",children:e.error})}),s?(0,n.jsx)(s0,{taskName:e.taskName,prompt:s.request.prompt,outcomes:s.request.outcomes,decision:s.decision}):t&&(0,n.jsx)(rg,{label:"Output",io:t})]})}function rh(e){let t=[];e.attemptNumber>1&&t.push(["Attempt",String(e.attemptNumber)]);let s=(0,eS.formatMetaChips)({costMicros:e.costMicros,tokens:e.tokensUsed});return s&&t.push(["Usage",s]),"agent-call"===e.variant&&e.agentSlug&&t.push(["Agent",e.agentSlug]),t}function rp({item:e,inputIO:t,outputIO:s}){let r=rh(e);return(0,n.jsxs)("div",{className:"stg:flex stg:flex-col stg:gap-2",children:[r.length>0&&(0,n.jsx)("dl",{className:"stg:grid stg:grid-cols-[auto_1fr] stg:gap-x-4 stg:gap-y-1 stg:text-xs",children:r.map(([e,t])=>(0,n.jsxs)("div",{className:"stg:contents",children:[(0,n.jsx)("dt",{className:"stg:text-muted-foreground",children:e}),(0,n.jsx)("dd",{className:"stg:text-foreground",children:t})]},e))}),e.error&&(0,n.jsx)(sp.BoundedContent,{children:(0,n.jsx)("pre",{className:"stg:whitespace-pre-wrap stg:break-words stg:text-xs stg:text-destructive",children:e.error})}),t&&(0,n.jsx)(rg,{label:"Input",io:t}),s&&(0,n.jsx)(rg,{label:"Output",io:s})]})}let rf={running:{Icon:sx.SpinnerIcon,color:"stg:text-foreground"},retrying:{Icon:sx.SpinnerIcon,color:"stg:text-warning"},waiting_approval:{Icon:sx.ClockIcon,color:"stg:text-warning"},completed:{Icon:sx.CheckCircleIcon,color:"stg:text-success"},failed:{Icon:sx.XCircleIcon,color:"stg:text-destructive"},skipped:{Icon:sx.SlashCircleIcon,color:"stg:text-muted-foreground"},pending:{Icon:sx.DotIcon,color:"stg:text-muted-foreground"}};function rx({status:e}){let{Icon:t,color:s}=rf[e];return(0,n.jsx)("span",{className:(0,u.cn)("stg:shrink-0",s),"aria-hidden":"true",children:(0,n.jsx)(t,{})})}let rv="stgm-wf-exec-center-view.v2";function rb(){try{let e=localStorage.getItem(rv);if("thread"===e||"graph"===e)return e}catch{}return"thread"}let ry=(0,a.memo)(function({executionId:e,org:t,onNavigateToAgentExecution:s,onNavigateToWorkflowEditor:r,headerActions:i,nodesDraggable:o,panel:l="auto",defaultPanelOpen:g,panelOpen:m,onPanelOpenChange:h,className:p}){let f,x,{execution:v,isLoading:b,error:y,refetch:k}=en(e),w=v?.status?.phase,N=w===Z.ExecutionPhase.EXECUTION_PENDING||w===Z.ExecutionPhase.EXECUTION_IN_PROGRESS,{events:S,taskStates:C,costSummary:E,streamState:T,totalTasks:A,error:I,reconnect:M}=ex(e,{executionPhase:w}),O=(0,a.useMemo)(()=>{if(S.length>0||"complete"!==T.stage)return null;let e=v?.status?.tasks;if(!e||0===e.length)return null;let t=new Map;for(let s of e){let e=s.taskName;if(!e)continue;let r="pending";switch(s.status){case Z.WorkflowTaskStatus.WORKFLOW_TASK_IN_PROGRESS:r="running";break;case Z.WorkflowTaskStatus.WORKFLOW_TASK_COMPLETED:r="completed";break;case Z.WorkflowTaskStatus.WORKFLOW_TASK_FAILED:r="failed";break;case Z.WorkflowTaskStatus.WORKFLOW_TASK_SKIPPED:r="skipped";break;case Z.WorkflowTaskStatus.WORKFLOW_TASK_WAITING_APPROVAL:r="waiting_approval";break;default:r="pending"}let n=0;s.startedAt&&s.completedAt&&(n=new Date(s.completedAt).getTime()-new Date(s.startedAt).getTime()),t.set(e,{taskName:e,taskKind:ee.WorkflowTaskKind.workflow_task_kind_unspecified,status:r,durationMs:n,costMicros:BigInt(0),tokensUsed:BigInt(0),attemptNumber:1,error:s.error??"",childExecutionId:"",agentSlug:"",currentToolName:"",messagesCount:0,toolCallsCount:0,inputSummary:null,outputSummary:null,approvalRequest:null,approvalResolution:null})}return t},[S.length,T.stage,v?.status?.tasks]),R=O??C,_=O?O.size:A,D=(0,a.useMemo)(()=>{let e=v?.status?.tasks;if(!e||0===e.length)return;let t=new Map;for(let s of e)s.taskName&&t.set(s.taskName,s);return t},[v?.status?.tasks]),{artifacts:P}=function(e){let t=(0,c.useStigmer)(),s=e?async()=>[...(await t.artifact.listByExecution((0,j.create)(ev.ListArtifactsByExecutionRequestSchema,{workflowExecutionId:e}))).entries]:null,{data:r,isLoading:n,isRefetching:a,error:i,refetch:o}=(0,d.useFetch)(s,[e,t],[],{cacheKey:e?`workflow-execution-artifacts:${e}`:void 0});return{artifacts:r,isLoading:n,isRefetching:a,error:i,refetch:o}}(e),F=function({executionId:e,taskStates:t,taskSnapshots:s}){let r=(0,c.useStigmer)(),n=(0,a.useRef)(r);n.current=r;let i=function(e,t){let s=[],r=new Set,n=new Set;for(let t of e.values())!t.childExecutionId||r.has(t.childExecutionId)||(r.add(t.childExecutionId),n.add(t.taskName),s.push({taskName:t.taskName,childExecutionId:t.childExecutionId,settled:ey.has(t.status)}));if(!t||0===t.length)return s;let a=[];for(let s of t){if(!s.taskName||n.has(s.taskName))continue;let t=s.metadata,i=t?.agent_execution_id;if("string"!=typeof i||!i||r.has(i))continue;r.add(i);let o=e.get(s.taskName);a.push({taskName:s.taskName,childExecutionId:i,settled:o?ey.has(o.status):ek.has(s.status),startedAt:s.startedAt??""})}for(let{startedAt:e,...t}of(a.sort((e,t)=>e.startedAt&&t.startedAt?e.startedAt.localeCompare(t.startedAt):0),a))s.push(t);return s}(t,s),o=i.map(e=>`${e.childExecutionId}:${e.settled?"1":"0"}`).join("\n"),l=(0,a.useRef)({signature:o,children:i});l.current.signature!==o&&(l.current={signature:o,children:i});let u=l.current.children,[d,g]=(0,a.useState)(()=>new Map),m=(0,a.useRef)(new Map),[h,p]=(0,a.useState)(!1),[f,x]=(0,a.useState)(null),[v,b]=(0,a.useState)(0),y=(0,a.useMemo)(()=>()=>{m.current.clear(),b(e=>e+1)},[]),k=(0,a.useRef)(e);k.current!==e&&(k.current=e,m.current.clear(),g(new Map),p(!1),x(null)),(0,a.useEffect)(()=>{if(!e)return;let t=u.filter(e=>{let t=m.current.get(e.childExecutionId);return void 0===t||!1===t&&e.settled});if(0===t.length)return;let s=!1;return p(!0),x(null),(async()=>{let e=await Promise.all(t.map(async e=>{try{let t=await n.current.agentExecution.get(e.childExecutionId);return{child:e,execution:t,error:null}}catch(t){return{child:e,execution:null,error:(0,eo.toError)(t)}}}));s||(g(t=>{let s=new Map(t);for(let{child:t,execution:r}of e)r&&(s.set(t.childExecutionId,r),m.current.set(t.childExecutionId,t.settled));return s}),x(e.find(e=>e.error)?.error??null),p(!1))})(),()=>{s=!0}},[e,o,v]);let j=(0,a.useMemo)(()=>{let e=[];for(let t of u){let s=d.get(t.childExecutionId);s&&e.push(s)}return(0,eb.deriveExecutionFileChanges)(e)},[u,d]),w=d.size>0,N=h&&!w,S=h&&w;return(0,a.useMemo)(()=>({fileChanges:j,fileChangeCount:j.length,isLoading:N,isRefetching:S,error:f,refetch:y}),[j,N,S,f,y])}({executionId:e,taskStates:R,taskSnapshots:v?.status?.tasks}),L=function(e,t){let s=(0,c.useStigmer)(),[r,n]=(0,a.useState)(!1),[i,o]=(0,a.useState)(null),l=(0,ej.useKeyedSubmission)(),u=(0,ej.useKeyedSubmission)(),d=(0,ej.useKeyedSubmission)(),g=(0,a.useRef)(e);g.current=e;let m=(0,a.useRef)(s);m.current=s;let h=(0,a.useRef)(t?.onSuccess);h.current=t?.onSuccess;let p=(0,a.useCallback)(()=>o(null),[]),f=(0,a.useCallback)(async(e,t=!0)=>{if(!g.current)return null;n(!0),o(null);try{let s=await e();return t&&h.current?.(s),s}catch(e){return o((0,eo.toError)(e)),null}finally{n(!1)}},[]),x=(0,a.useCallback)(e=>f(()=>m.current.workflowExecution.cancel((0,j.create)(ea.CancelWorkflowExecutionInputSchema,{id:g.current,reason:e??""}))),[f]),v=(0,a.useCallback)(e=>f(()=>m.current.workflowExecution.terminate((0,j.create)(ea.TerminateWorkflowExecutionInputSchema,{id:g.current,reason:e??""}))),[f]),b=(0,a.useCallback)(e=>f(()=>m.current.workflowExecution.pause((0,j.create)(ea.PauseWorkflowExecutionInputSchema,{id:g.current,reason:e??""}))),[f]),y=(0,a.useCallback)(()=>f(()=>m.current.workflowExecution.resume((0,j.create)(ea.ResumeWorkflowExecutionInputSchema,{id:g.current}))),[f]),k=(0,a.useCallback)(e=>f(()=>m.current.workflowExecution.recover((0,j.create)(ea.RecoverWorkflowExecutionInputSchema,{id:g.current,reason:e??""}))),[f]),w=(0,a.useCallback)((e,t,s)=>g.current?l.run(e,()=>m.current.workflowExecution.submitApproval((0,j.create)(ea.SubmitWorkflowApprovalInputSchema,{executionId:g.current,toolCallId:e,action:t,comment:s??""}))).catch(()=>null):Promise.resolve(null),[l.run]),N=(0,a.useCallback)((e,t,s,r)=>g.current?u.run(e,()=>m.current.workflowExecution.submitWorkflowTaskApproval((0,j.create)(ea.SubmitWorkflowTaskApprovalInputSchema,{executionId:g.current,taskName:e,outcome:t,formData:s,reviewer:"",comment:r??""}))).catch(()=>null):Promise.resolve(null),[u.run]),S=(0,a.useCallback)((e,t,s,r)=>{if(!g.current)return Promise.resolve(null);let n=r?.fileChangeId??"",a=r?.scope??(n?ec.FileDecisionScope.FILE:ec.FileDecisionScope.CHANGE_SET),i=(0,ew.fileDecisionKey)(t,n||void 0);return d.run(i,()=>m.current.workflowExecution.submitFileDecision((0,j.create)(ea.SubmitWorkflowFileDecisionInputSchema,{executionId:g.current,childAgentExecutionId:e,changeSetId:t,scope:a,fileChangeId:n,action:s,expectedDigest:r?.expectedDigest??"",reason:r?.reason??"",acknowledgeUnreviewable:r?.acknowledgeUnreviewable??!1}))).catch(()=>null)},[d.run]);return(0,a.useMemo)(()=>({cancel:x,terminate:v,pause:b,resume:y,recover:k,submitApproval:w,submitTaskApproval:N,submitFileDecision:S,isSubmitting:r,error:i,clearError:p,approvalSubmittingToolCallIds:l.submittingKeys,approvalErrorsByToolCallId:l.errorsByKey,taskApprovalSubmittingTaskNames:u.submittingKeys,taskApprovalErrorsByTaskName:u.errorsByKey,fileDecisionSubmittingKeys:d.submittingKeys,fileDecisionErrorsByKey:d.errorsByKey}),[x,v,b,y,k,w,N,S,r,i,p,l.submittingKeys,l.errorsByKey,u.submittingKeys,u.errorsByKey,d.submittingKeys,d.errorsByKey])}(e,{onSuccess:k}),W=(0,a.useMemo)(()=>({submitApproval:L.submitApproval,approvalSubmittingToolCallIds:L.approvalSubmittingToolCallIds,approvalErrorsByToolCallId:L.approvalErrorsByToolCallId,submitFileDecision:L.submitFileDecision,fileDecisionSubmittingKeys:L.fileDecisionSubmittingKeys,fileDecisionErrorsByKey:L.fileDecisionErrorsByKey,submitTaskApproval:L.submitTaskApproval,taskApprovalSubmittingTaskNames:L.taskApprovalSubmittingTaskNames,taskApprovalErrorsByTaskName:L.taskApprovalErrorsByTaskName}),[L.submitApproval,L.approvalSubmittingToolCallIds,L.approvalErrorsByToolCallId,L.submitFileDecision,L.fileDecisionSubmittingKeys,L.fileDecisionErrorsByKey,L.submitTaskApproval,L.taskApprovalSubmittingTaskNames,L.taskApprovalErrorsByTaskName]),K="none"!==l,U=function({defaultView:e="artifacts",open:t,defaultOpen:s=!1,onOpenChange:r}={}){let n=(0,e_.useWorkspaceEditorsStoreRef)(),i=void 0!==t,[o,l]=(0,a.useState)(s),u=i?t:o,c=(0,a.useRef)(r);c.current=r;let d=(0,a.useRef)(i);d.current=i;let g=(0,a.useRef)(u);g.current=u;let m=(0,a.useCallback)(e=>{g.current!==e&&(d.current||(g.current=e,l(e)),c.current?.(e))},[]),[h,p]=(0,a.useState)(e),f=(0,a.useCallback)(()=>m(!0),[m]),x=(0,a.useCallback)(()=>m(!1),[m]),v=(0,a.useCallback)(e=>p(e),[]),b=(0,a.useCallback)(()=>{n.openPinned(tq,t$),m(!0)},[n,m]),y=(0,a.useCallback)((e,t,s)=>{n.openPreview(e,t,s),m(!0)},[n,m]),k=(0,a.useCallback)(e=>{n.openPreview(tF.ARTIFACT_DOCUMENT_ENTRY_ID,tH(e)),m(!0)},[n,m]),j=(0,a.useCallback)(e=>{n.pin(tF.ARTIFACT_DOCUMENT_ENTRY_ID,tH(e))},[n]),w=(0,a.useCallback)(e=>{n.openPreview(tW,tK(e)),m(!0)},[n,m]),N=(0,a.useCallback)(e=>{n.pin(tW,tK(e))},[n]),S=(0,a.useCallback)((e,t)=>n.activate(e,t),[n]),C=(0,a.useCallback)((e,t)=>n.pin(e,t),[n]),E=(0,a.useCallback)((e,t)=>n.close(e,t),[n]);return(0,a.useMemo)(()=>({editorsStore:n,isOpen:u,view:h,openPanel:f,closePanel:x,setView:v,openDiagnosis:b,openFile:y,activateEditor:S,pinEditor:C,closeEditor:E,openArtifact:k,pinArtifact:j,openFileChange:w,pinFileChange:N}),[n,u,h,f,x,v,b,y,S,C,E,k,j,w,N])}({open:!!K&&m,defaultOpen:g,onOpenChange:K?h:void 0}),[B,z]=(0,a.useState)(!1),[q,$]=(0,a.useState)(null),[H,G]=(0,a.useState)(rb),V=(0,a.useCallback)(e=>{G(e);try{localStorage.setItem(rv,e)}catch{}},[]);(0,a.useEffect)(()=>{try{localStorage.removeItem("stgm-wf-exec-center-view")}catch{}},[]);let X=ta(R),Q=(0,a.useRef)(T.stage);(0,a.useEffect)(()=>{let e=Q.current;Q.current=T.stage;let t="complete"===T.stage&&("streaming"===e||"reconnecting"===e),s="streaming"===T.stage&&"streaming"!==e;(t||s)&&k()},[T.stage,k]);let Y=(0,a.useCallback)(e=>{k()},[k]);f=(0,a.useRef)(new Map),(x=(0,a.useRef)(Y)).current=Y,(0,a.useEffect)(()=>{let e=f.current;if(f.current=R,!N)return;let t=[],s=[];for(let[r,n]of R){let a=e.get(r)?.status;a!==n.status&&("waiting_approval"===n.status?t.push(r):"waiting_approval"===a&&s.push(r))}(t.length>0||s.length>0)&&x.current({entered:t,exited:s})},[R,N]);let J=(0,a.useCallback)(()=>{z(!0)},[]),et=(0,a.useCallback)(()=>{z(!1)},[]),es=(0,a.useCallback)(e=>{$(e),z(!1)},[]),er=(0,a.useCallback)(()=>{$(null)},[]),ei=(0,a.useCallback)(e=>{r&&r(e,v?.metadata?.slug??v?.metadata?.name??"")},[r,v]);return b?(0,n.jsx)("div",{className:(0,u.cn)("stg:flex stg:h-full stg:items-center stg:justify-center",p),children:(0,n.jsx)(rN,{})}):y?(0,n.jsxs)("div",{className:(0,u.cn)("stg:flex stg:h-full stg:flex-col stg:items-center stg:justify-center stg:gap-3 stg:px-6",p),children:[(0,n.jsx)("p",{className:"stg:text-sm stg:text-destructive",children:y.message}),(0,n.jsx)("button",{type:"button",onClick:k,className:"stg:rounded stg:border stg:border-border stg:px-3 stg:py-1.5 stg:text-xs stg:font-medium stg:text-foreground stg:hover:bg-muted",children:"Retry"})]}):v?(0,n.jsxs)("div",{className:(0,u.cn)("stg:flex stg:h-full stg:flex-col stg:overflow-hidden",p),children:[(0,n.jsx)(eT,{execution:v,streamState:T,costSummary:E,actions:L,onDiagnose:t&&K?U.openDiagnosis:void 0,onCompare:J,headerActions:(0,n.jsxs)(n.Fragment,{children:[i,K&&(0,n.jsx)(tz.PanelChip,{isOpen:U.isOpen,onToggle:U.isOpen?U.closePanel:U.openPanel,badgeCount:P.length})]})}),(0,n.jsx)(tx,{open:B,workflowId:v.spec?.workflowId??v.spec?.workflowInstanceId??"",baseExecutionId:e,basePhase:w??0,onConfirm:es,onClose:et}),L.error&&(0,n.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-2 stg:border-b stg:border-destructive/20 stg:bg-destructive/5 stg:px-4 stg:py-2",children:[(0,n.jsx)("p",{className:"stg:flex-1 stg:text-xs stg:text-destructive",children:L.error.message}),(0,n.jsx)("button",{type:"button",onClick:L.clearError,className:"stg:shrink-0 stg:rounded stg:border stg:border-destructive/30 stg:px-2 stg:py-1 stg:text-xs stg:text-destructive stg:hover:bg-destructive/10",children:"Dismiss"})]}),q?(0,n.jsx)("div",{className:"stg:min-h-0 stg:flex-1 stg:overflow-y-auto stg:p-4",children:(0,n.jsx)(t_,{baseExecutionId:e,compareExecutionId:q,onBack:er})}):(0,n.jsxs)(n.Fragment,{children:[I&&(0,n.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-2 stg:border-b stg:border-destructive/20 stg:bg-destructive/5 stg:px-4 stg:py-2",children:[(0,n.jsx)("p",{className:"stg:flex-1 stg:text-xs stg:text-destructive",children:I.message}),(0,n.jsx)("button",{type:"button",onClick:M,className:"stg:shrink-0 stg:rounded stg:border stg:border-destructive/30 stg:px-2 stg:py-1 stg:text-xs stg:text-destructive stg:hover:bg-destructive/10",children:"Reconnect"})]}),(0,n.jsx)(tP.ResizableSplit,{resizablePane:"secondary",collapsedPane:U.isOpen?"none":"secondary",defaultSize:560,minSize:360,maxSize:960,storageKey:"stgm-wf-exec-panel-width",ariaLabel:"Resize execution panel",className:"stg:min-h-0 stg:flex-1",primary:(0,n.jsxs)("div",{className:"stg:flex stg:h-full stg:min-h-0 stg:flex-1 stg:flex-col",children:[(0,n.jsx)(rS,{view:H,onChange:V}),(0,n.jsx)("div",{role:"log","aria-live":"polite","aria-atomic":"false",className:"stg:sr-only",children:X}),(0,n.jsx)("div",{"data-center-view":"thread",className:(0,u.cn)("stg:min-h-0 stg:flex-1","thread"!==H&&"stg:hidden"),children:(0,n.jsx)(ro,{taskStates:R,totalTasks:_,isRunning:N,onNavigateToAgentExecution:s,hitl:W,taskSnapshotsByName:D,className:"stg:h-full"})}),(0,n.jsx)("div",{"data-center-view":"graph",className:(0,u.cn)("stg:min-h-0 stg:flex-1","graph"!==H&&"stg:hidden"),children:(0,n.jsx)(tu,{executionId:e,execution:v,taskStates:R,followExecution:N&&"graph"===H,announceTaskStates:!1,nodesDraggable:o,className:"stg:h-full"})})]}),secondary:U.isOpen&&K?(0,n.jsx)(rk,{panel:U,executionId:e,org:t,artifacts:P,fileChangesState:F,costSummary:E,taskStates:R,onApplyFix:r?ei:void 0}):null})]})]}):(0,n.jsx)("div",{className:(0,u.cn)("stg:flex stg:h-full stg:items-center stg:justify-center stg:text-sm stg:text-muted-foreground",p),children:"Execution not found"})});function rk({panel:e,executionId:t,org:s,artifacts:r,fileChangesState:i,costSummary:o,taskStates:l,onApplyFix:u}){let{editors:c,activeFile:d}=(0,e_.useWorkspaceEditors)(e.editorsStore),g=d?.entryId===tW?d.path:null,m=function({artifacts:e,onOpenArtifact:t,onActivateArtifact:s,fileChanges:r,fileChangesLoading:i,fileChangesRefetching:o,fileChangesError:l,activeFileChangePath:u,onOpenFileChange:c,costSummary:d,taskStates:g}){return(0,a.useMemo)(()=>[{id:"artifacts",label:"Artifacts",icon:(0,n.jsx)(se,{}),badge:e.length>0?e.length:void 0,content:(0,n.jsx)(tJ,{artifacts:e,onOpen:t,onActivate:s})},{id:"changes",label:"Changes",icon:(0,n.jsx)(st,{}),badge:r.length>0?r.length:void 0,content:(0,n.jsx)(t1,{fileChanges:r,isLoading:i,isRefetching:o,error:l,activePath:u,onOpen:c})},{id:"usage",label:"Usage",icon:(0,n.jsx)(ss,{}),content:(0,n.jsx)(t6,{costSummary:d,taskStates:g})}],[e,t,s,r,i,o,l,u,c,d,g])}({artifacts:r,onOpenArtifact:e.openArtifact,onActivateArtifact:e.pinArtifact,fileChanges:i.fileChanges,fileChangesLoading:i.isLoading,fileChangesRefetching:i.isRefetching,fileChangesError:i.error,activeFileChangePath:g,onOpenFileChange:e.openFileChange,costSummary:o,taskStates:l}),h=(0,a.useMemo)(()=>new Map(r.map(e=>[tH(e),e])),[r]),p=(0,a.useMemo)(()=>new Map(i.fileChanges.map(e=>[tK(e),e])),[i.fileChanges]),f=(0,a.useMemo)(()=>c.filter(e=>e.entryId===tF.ARTIFACT_DOCUMENT_ENTRY_ID||e.entryId===tW||e.entryId===tq).map(r=>{if(r.entryId===tq)return{entryId:tq,path:r.path,content:(0,n.jsx)(ez,{executionId:t,org:s??"",onApplyFix:u,onClose:()=>e.closeEditor(tq,t$)},r.path)};if(r.entryId===tW){let e=p.get(r.path);return{entryId:tW,path:r.path,content:e?(0,n.jsx)("div",{className:"stg:mx-auto stg:w-full stg:max-w-5xl stg:px-4 stg:py-4",children:(0,n.jsx)(tU.FileChangeDiff,{change:e},r.path)}):(0,n.jsx)(rj,{})}}let a=h.get(r.path);return{entryId:tF.ARTIFACT_DOCUMENT_ENTRY_ID,path:r.path,content:a?(0,n.jsx)(so,{artifact:a},r.path):(0,n.jsx)(rw,{})}}),[c,h,p,t,s,u,e.closeEditor]);return(0,n.jsx)(tB.WorkspaceSurface,{entries:[],lister:void 0,reader:void 0,builtInViews:[],view:e.view,onViewChange:e.setView,extraViews:m,virtualDocuments:f,editors:c,selectedFile:d,onOpenFile:e.openFile,onActivateEditor:e.activateEditor,onPinEditor:e.pinEditor,onCloseEditor:e.closeEditor,onCollapse:e.closePanel,className:"stg:h-full"})}function rj(){return(0,n.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,n.jsx)("p",{className:"stg:text-xs stg:font-medium stg:text-foreground",children:"This file change is no longer available."}),(0,n.jsx)("p",{className:"stg:text-xs stg:text-muted-foreground",children:"The rollup was refreshed and this file no longer appears among the execution's changes."})]})}function rw(){return(0,n.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,n.jsx)("p",{className:"stg:text-xs stg:font-medium stg:text-foreground",children:"This artifact is no longer available."}),(0,n.jsx)("p",{className:"stg:text-xs stg:text-muted-foreground",children:"It may have expired or been removed from storage."})]})}function rN(){return(0,n.jsxs)("div",{className:"stg:flex stg:w-full stg:flex-col stg:gap-3 stg:p-6",children:[(0,n.jsx)("div",{className:"stg:h-4 stg:w-48 stg:animate-pulse stg:rounded stg:bg-muted"}),(0,n.jsx)("div",{className:"stg:h-3 stg:w-32 stg:animate-pulse stg:rounded stg:bg-muted"}),(0,n.jsx)("div",{className:"stg:mt-4 stg:space-y-2",children:Array.from({length:5},(e,t)=>(0,n.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-3",children:[(0,n.jsx)("div",{className:"stg:size-3 stg:animate-pulse stg:rounded-full stg:bg-muted"}),(0,n.jsx)("div",{className:"stg:h-3 stg:flex-1 stg:animate-pulse stg:rounded stg:bg-muted"})]},t))})]})}function rS({view:e,onChange:t}){return(0,n.jsxs)("div",{role:"radiogroup","aria-label":"Center view",className:"stg:flex stg:items-center stg:gap-0.5 stg:border-b stg:border-[var(--stgm-border,#e5e5e5)] stg:px-2 stg:py-1",children:[(0,n.jsx)(rC,{label:"Thread",isActive:"thread"===e,onClick:()=>t("thread")}),(0,n.jsx)(rC,{label:"Graph",isActive:"graph"===e,onClick:()=>t("graph")})]})}function rC({label:e,isActive:t,onClick:s}){return(0,n.jsx)("button",{type:"button",role:"radio","aria-checked":t,onClick:s,className:(0,u.cn)("stg:rounded stg:px-2 stg:py-0.5 stg:text-xs stg:font-medium stg:transition-colors",t?"stg:bg-[var(--stgm-muted,#f5f5f5)] stg:text-[var(--stgm-foreground,#171717)]":"stg:text-[var(--stgm-muted-foreground,#737373)] stg:hover:text-[var(--stgm-foreground,#171717)]"),children:e})}function rE({executionId:e,org:t}){let{navigateToSession:s}=(0,h.useSessionNavigation)(),r=(0,z.useActiveOrgSlug)(),i=t??r,o=(0,z.useActiveOrgId)(),[l,u]=(0,a.useState)(null),{sessionId:c,isLoading:d}=g(l);(0,a.useEffect)(()=>{c&&s(c)},[c,s]);let m=(0,a.useCallback)(e=>{u(e)},[]),p=(0,a.useCallback)((e,t)=>{let s=i??"";window.location.href=`/library/workflows/${s}/${t}`},[i]);return(0,n.jsxs)("div",{className:"relative flex h-full w-full flex-col",children:[d&&(0,n.jsx)("div",{className:"pointer-events-none absolute inset-x-0 top-4 z-50 flex justify-center",children:(0,n.jsxs)("div",{className:"flex items-center gap-2 rounded-lg border border-border bg-card px-4 py-2 text-sm text-muted-foreground shadow-md",children:[(0,n.jsx)("div",{className:"size-4 animate-spin rounded-full border-2 border-muted border-t-primary"}),"Navigating to session…"]})}),(0,n.jsx)(ry,{executionId:e,org:i,onNavigateToAgentExecution:m,onNavigateToWorkflowEditor:p,headerActions:(0,n.jsx)(Q.ManageAccessButton,{resource:{kind:y.ApiResourceKind.workflow_execution,kindString:"workflow_execution",id:e,org:o}}),nodesDraggable:!0},e)]})}var rT=e.i(440160);let rA=(0,o.default)("monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);var rI=e.i(37727);let rM=[{test:e=>e.endsWith(".dmg"),os:"macos",arch:null,label:"macOS"},{test:e=>e.endsWith("-setup.exe"),os:"windows",arch:"x64",label:"Windows (64-bit)"},{test:e=>e.endsWith(".deb"),os:"linux",arch:"x64",label:"Linux (.deb)"},{test:e=>e.endsWith(".AppImage"),os:"linux",arch:"x64",label:"Linux (.AppImage)"}],rO=null;async function rR(){if(rO)return{ok:!0,release:rO};try{let e=await fetch("https://api.github.com/repos/stigmer/stigmer/releases/latest",{headers:{Accept:"application/vnd.github.v3+json"}});if(!e.ok)return{ok:!1,reason:"fetch-failed",status:e.status};let t=await e.json(),s=(t.tag_name??"").replace(/^v/,""),r=[];for(let e of t.assets??[]){let t=function(e,t){for(let s of rM)if(s.test(e))return{os:s.os,arch:s.arch,url:t,filename:e,label:s.label};return null}(e.name,e.browser_download_url);t&&r.push(t)}if(0===r.length)return{ok:!1,reason:"no-assets"};return rO={version:s,assets:r},{ok:!0,release:rO}}catch{return{ok:!1,reason:"fetch-failed"}}}let r_={macos:"Open the .dmg and drag Stigmer to Applications.",windows:"Run the installer and follow the prompts.",linux:"Install with sudo dpkg -i <filename>."},rD={macos:"macOS",windows:"Windows",linux:"Linux"},rP={label:"Download page",onClick:()=>window.open("https://stigmer.ai/download","_blank","noopener,noreferrer")};async function rF(){try{let[e,t]=await Promise.all([new Promise(e=>{if("u"<typeof navigator)return void e({os:null,arch:null});let t=navigator.userAgent.toLowerCase(),s=null;t.includes("mac")?s="macos":t.includes("win")?s="windows":t.includes("linux")&&(s="linux");let r=null;if("macos"===s){let t=navigator.userAgentData;if(t)return void t.getHighEntropyValues(["architecture"]).then(t=>{e({os:s,arch:"arm"===t.architecture?"arm64":"x64"})}).catch(()=>{e({os:s,arch:"arm64"})});r="arm64"}else("windows"===s||"linux"===s)&&(r="x64");e({os:s,arch:r})}),rR()]);if(!e.os){console.warn("[desktop-download] Platform detection returned no OS",{userAgent:"u">typeof navigator?navigator.userAgent:"n/a"}),f.toast.warning("Couldn’t detect your platform.",{description:"Visit the download page to pick the right installer.",action:rP,duration:8e3});return}if(!t.ok){console.warn("[desktop-download] Release fetch failed",t),f.toast.warning("Couldn’t reach the download server.",{description:"Try again in a moment, or visit the download page.",action:rP,duration:8e3});return}let s=function(e,t){if(!t.os)return null;let s=e.filter(e=>e.os===t.os&&(null===e.arch||null===t.arch||e.arch===t.arch));return 0===s.length?null:1===s.length?s[0]:s.find(e=>e.filename.endsWith(".deb"))??s[0]}(t.release.assets,e);if(!s){console.warn("[desktop-download] No matching asset for platform",{platform:e,availableAssets:t.release.assets.map(e=>({os:e.os,arch:e.arch,filename:e.filename}))}),f.toast.warning(`No installer found for ${rD[e.os]??e.os}.`,{description:"This platform may not be supported yet. Check all available downloads.",action:rP,duration:8e3});return}let r=document.createElement("a");r.href=s.url,r.download=s.filename,r.style.display="none",document.body.appendChild(r),r.click(),document.body.removeChild(r),function(){try{localStorage.setItem(rK,new Date().toISOString()),window.dispatchEvent(new StorageEvent("storage",{key:rK}))}catch{}}(),f.toast.success(`Downloading Stigmer Desktop for ${s.label}`,{description:r_[s.os??""]??"Check your downloads folder for the installer.",duration:8e3})}catch(e){console.warn("[desktop-download] Unexpected error",e),f.toast.warning("Something went wrong.",{description:"Visit the download page to download Stigmer Desktop.",action:rP,duration:8e3})}}let rL="stigmer:desktop-banner-first-seen",rW="stigmer:desktop-banner-dismissed",rK="stigmer:desktop-downloaded",rU="stigmer:has-local-runner",rB="2026.04",rz=!1;function rq(){try{if(rz||function(){try{if(function(){try{return"__TAURI__"in window}catch{return!1}}()||localStorage.getItem(rK)||localStorage.getItem(rU))return!0;return!1}catch{return!1}}()||function(){try{let e=localStorage.getItem(rW);if(!e)return!1;let t=JSON.parse(e);return t?.campaign===rB}catch{return!1}}())return!1;return null!==localStorage.getItem(rL)}catch{return!1}}function r$(){return!1}function rH(e){function t(t){(t.key===rL||t.key===rW||t.key===rK||t.key===rU)&&e()}return window.addEventListener("storage",t),()=>window.removeEventListener("storage",t)}function rG({onDismiss:e}){return(0,n.jsxs)("aside",{role:"complementary","aria-label":"Desktop app",className:"bg-card border-border-muted flex items-center gap-3 border-b px-4 py-2.5",children:[(0,n.jsx)(rA,{className:"text-muted-foreground size-4 shrink-0"}),(0,n.jsxs)("p",{className:"text-muted-foreground min-w-0 flex-1 text-xs",children:[(0,n.jsx)("span",{className:"text-foreground font-medium",children:"Stigmer Desktop"})," — ","manage runners from your system tray with deep-link launches and native notifications."]}),(0,n.jsxs)("button",{type:"button",onClick:rF,className:"text-primary hover:text-foreground inline-flex shrink-0 items-center gap-1 text-xs font-medium transition-colors",children:["Download",(0,n.jsx)(rT.Download,{className:"text-muted-foreground size-3"})]}),(0,n.jsx)("button",{type:"button",onClick:e,"aria-label":"Dismiss",className:"text-muted-foreground hover:text-foreground -mr-1 shrink-0 rounded p-0.5 transition-colors",children:(0,n.jsx)(rI.X,{className:"size-3.5"})})]})}var rV=e.i(522016),rX=e.i(766354),rQ=e.i(607486),rY=e.i(63209),rJ=e.i(16715);let rZ=(0,o.default)("chevrons-up-down",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);var r0=e.i(107233),r1=e.i(284614);e.s([],275704),e.i(275704),e.i(247167);var r2=e.i(367805);let r5=a.createContext(void 0);function r3(e){let t=a.useContext(r5);if(!1===e&&void 0===t)throw Error((0,r2.default)(27));return t}var r6=e.i(327601),r7=e.i(383590),r4=e.i(284759);let r8={...r7.popupStateMapping,...r4.transitionStatusMapping},r9=a.forwardRef(function(e,t){let{render:s,className:r,forceRender:n=!1,...a}=e,{store:i}=r3(),o=i.useState("open"),l=i.useState("nested"),u=i.useState("mounted"),c=i.useState("transitionStatus");return(0,r6.useRenderElement)("div",e,{state:{open:o,transitionStatus:c},ref:[i.context.backdropRef,t],stateAttributesMapping:r8,props:[{role:"presentation",hidden:!u,style:{userSelect:"none",WebkitUserSelect:"none"}},a],enabled:n||!l})});var ne=e.i(991730),nt=e.i(5963),ns=e.i(803404);let nr=a.forwardRef(function(e,t){let{render:s,className:r,disabled:n=!1,nativeButton:a=!0,...i}=e,{store:o}=r3(),l=o.useState("open"),{getButtonProps:u,buttonRef:c}=(0,ne.useButton)({disabled:n,native:a});return(0,r6.useRenderElement)("button",e,{state:{disabled:n},ref:[t,c],props:[{onClick:function(e){l&&o.setOpen(!1,(0,nt.createChangeEventDetails)(ns.REASONS.closePress,e.nativeEvent))}},i,u]})});var nn=e.i(189879);let na=a.forwardRef(function(e,t){let{render:s,className:r,id:n,...a}=e,{store:i}=r3(),o=(0,nn.useBaseUiId)(n);return i.useSyncedValueWithCleanup("descriptionElementId",o),(0,r6.useRenderElement)("p",e,{ref:t,props:[{id:o},a]})});var ni=e.i(488306);let no=((t={}).nestedDialogs="--nested-dialogs",t),nl=((s={})[s.open=r7.CommonPopupDataAttributes.open]="open",s[s.closed=r7.CommonPopupDataAttributes.closed]="closed",s[s.startingStyle=r7.CommonPopupDataAttributes.startingStyle]="startingStyle",s[s.endingStyle=r7.CommonPopupDataAttributes.endingStyle]="endingStyle",s.nested="data-nested",s.nestedDialogOpen="data-nested-dialog-open",s),nu=a.createContext(void 0);function nc(){let e=a.useContext(nu);if(void 0===e)throw Error((0,r2.default)(26));return e}var nd=e.i(889269),ng=e.i(992238);let nm={...r7.popupStateMapping,...r4.transitionStatusMapping,nestedDialogOpen:e=>e?{[nl.nestedDialogOpen]:""}:null},nh=a.forwardRef(function(e,t){let{className:s,finalFocus:r,initialFocus:a,render:i,...o}=e,{store:l}=r3(),u=l.useState("descriptionElementId"),c=l.useState("disablePointerDismissal"),d=l.useState("floatingRootContext"),g=l.useState("popupProps"),m=l.useState("modal"),h=l.useState("mounted"),p=l.useState("nested"),f=l.useState("nestedOpenDialogCount"),x=l.useState("open"),v=l.useState("openMethod"),b=l.useState("titleElementId"),y=l.useState("transitionStatus"),k=l.useState("role");nc(),(0,nd.useOpenChangeComplete)({open:x,ref:l.context.popupRef,onComplete(){x&&l.context.onOpenChangeComplete?.(!0)}});let j=void 0===a?function(e){return"touch"!==e||l.context.popupRef.current}:a,w=(0,r6.useRenderElement)("div",e,{state:{open:x,nested:p,transitionStatus:y,nestedDialogOpen:f>0},props:[g,{"aria-labelledby":b??void 0,"aria-describedby":u??void 0,role:k,tabIndex:-1,hidden:!h,onKeyDown(e){ng.COMPOSITE_KEYS.has(e.key)&&e.stopPropagation()},style:{[no.nestedDialogs]:f}},o],ref:[t,l.context.popupRef,l.useStateSetter("popupElement")],stateAttributesMapping:nm});return(0,n.jsx)(ni.FloatingFocusManager,{context:d,openInteractionType:v,disabled:!h,closeOnFocusOut:!c,initialFocus:j,returnFocus:r,modal:!1!==m,restoreFocus:"popup",children:w})});var np=e.i(658130),nf=e.i(937692),nx=e.i(536893);let nv=a.forwardRef(function(e,t){let{keepMounted:s=!1,...r}=e,{store:a}=r3(),i=a.useState("mounted"),o=a.useState("modal"),l=a.useState("open");return i||s?(0,n.jsx)(nu.Provider,{value:s,children:(0,n.jsxs)(nf.FloatingPortal,{ref:t,...r,children:[i&&!0===o&&(0,n.jsx)(nx.InternalBackdrop,{ref:a.context.internalBackdropRef,inert:(0,np.inertValue)(!l)}),e.children]})}):null});var nb=e.i(630628),ny=e.i(58509),nk=e.i(676477),nj=e.i(66196),nw=e.i(933605),nN=e.i(789633),nS=e.i(926665),nC=e.i(206157),nE=e.i(247857),nT=e.i(450091),nA=e.i(258642),nI=e.i(783921),nM=e.i(598263),nO=e.i(600628),nR=e.i(769375);let n_={...nO.popupStoreSelectors,modal:(0,nI.createSelector)(e=>e.modal),nested:(0,nI.createSelector)(e=>e.nested),nestedOpenDialogCount:(0,nI.createSelector)(e=>e.nestedOpenDialogCount),disablePointerDismissal:(0,nI.createSelector)(e=>e.disablePointerDismissal),openMethod:(0,nI.createSelector)(e=>e.openMethod),descriptionElementId:(0,nI.createSelector)(e=>e.descriptionElementId),titleElementId:(0,nI.createSelector)(e=>e.titleElementId),viewportElement:(0,nI.createSelector)(e=>e.viewportElement),role:(0,nI.createSelector)(e=>e.role)};class nD extends nM.ReactStore{constructor(e){super(function(e={}){return{...(0,nO.createInitialPopupStoreState)(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,role:"dialog",...e}}(e),{popupRef:a.createRef(),backdropRef:a.createRef(),internalBackdropRef:a.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:new nR.PopupTriggerMap,onOpenChange:void 0,onOpenChangeComplete:void 0},n_)}setOpen=(e,t)=>{if(t.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},e||null!=t.trigger||null==this.state.activeTriggerId||(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;let s={open:e,nativeEvent:t.event,reason:t.reason,nested:this.state.nested};this.state.floatingRootContext.context.events?.emit("openchange",s);let r={open:e},n=t.trigger?.id??null;(n||e)&&(r.activeTriggerId=n,r.activeTriggerElement=t.trigger??null),this.update(r)}}let nP=((r={})[r.open=r7.CommonPopupDataAttributes.open]="open",r[r.closed=r7.CommonPopupDataAttributes.closed]="closed",r[r.startingStyle=r7.CommonPopupDataAttributes.startingStyle]="startingStyle",r[r.endingStyle=r7.CommonPopupDataAttributes.endingStyle]="endingStyle",r.nested="data-nested",r.nestedDialogOpen="data-nested-dialog-open",r),nF={...r7.popupStateMapping,...r4.transitionStatusMapping,nested:e=>e?{[nP.nested]:""}:null,nestedDialogOpen:e=>e?{[nP.nestedDialogOpen]:""}:null},nL=a.forwardRef(function(e,t){let{className:s,render:r,children:n,...a}=e,i=nc(),{store:o}=r3(),l=o.useState("open"),u=o.useState("nested"),c=o.useState("transitionStatus"),d=o.useState("nestedOpenDialogCount"),g=o.useState("mounted");return(0,r6.useRenderElement)("div",e,{enabled:i||g,state:{open:l,nested:u,transitionStatus:c,nestedDialogOpen:d>0},ref:[t,o.useStateSetter("viewportElement")],stateAttributesMapping:nF,props:[{role:"presentation",hidden:!g,style:{pointerEvents:l?void 0:"none"},children:n},a]})}),nW=a.forwardRef(function(e,t){let{render:s,className:r,id:n,...a}=e,{store:i}=r3(),o=(0,nn.useBaseUiId)(n);return i.useSyncedValueWithCleanup("titleElementId",o),(0,r6.useRenderElement)("h2",e,{ref:t,props:[{id:o},a]})});var nK=e.i(607335),nU=e.i(804012);let nB=a.forwardRef(function(e,t){let{render:s,className:r,disabled:n=!1,nativeButton:i=!0,id:o,payload:l,handle:u,...c}=e,d=r3(!0),g=u?.store??d?.store;if(!g)throw Error((0,r2.default)(79));let m=(0,nn.useBaseUiId)(o),h=g.useState("floatingRootContext"),p=g.useState("isOpenedByTrigger",m),f=a.useRef(null),{registerTrigger:x,isMountedByThisTrigger:v}=(0,nA.useTriggerDataForwarding)(m,f,g,{payload:l}),{getButtonProps:b,buttonRef:y}=(0,ne.useButton)({disabled:n,native:i}),k=(0,nU.useClick)(h,{enabled:null!=h}),j=(0,nN.useInteractions)([k]),w=g.useState("triggerProps",v);return(0,r6.useRenderElement)("button",e,{state:{disabled:n,open:p},ref:[y,t,x,f],props:[j.getReferenceProps(),w,{[nK.CLICK_TRIGGER_IDENTIFIER]:"",id:m},c,b],stateAttributesMapping:r7.triggerOpenStateMapping})});class nz{constructor(e){this.store=e??new nD}open(e){let t=e?this.store.context.triggerElements.getById(e):void 0;this.store.setOpen(!0,(0,nt.createChangeEventDetails)(ns.REASONS.imperativeAction,void 0,t))}openWithPayload(e){this.store.set("payload",e),this.store.setOpen(!0,(0,nt.createChangeEventDetails)(ns.REASONS.imperativeAction,void 0,void 0))}close(){this.store.setOpen(!1,(0,nt.createChangeEventDetails)(ns.REASONS.imperativeAction,void 0,void 0))}get isOpen(){return this.store.state.open}}e.s(["Backdrop",0,r9,"Close",0,nr,"Description",0,na,"Handle",0,nz,"Popup",0,nh,"Portal",0,nv,"Root",0,function(e){let{children:t,open:s,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:o,disablePointerDismissal:l=!1,modal:u=!0,actionsRef:c,handle:d,triggerId:g,defaultTriggerId:m=null}=e,h=r3(!0),p=!!h,f=(0,nb.useRefWithInit)(()=>d?.store??new nD({open:r,openProp:s,activeTriggerId:m,triggerIdProp:g,modal:u,disablePointerDismissal:l,nested:p})).current;(0,ny.useOnFirstRender)(()=>{void 0===s&&!1===f.state.open&&!0===r&&f.update({open:!0,activeTriggerId:m})}),f.useControlledProp("openProp",s),f.useControlledProp("triggerIdProp",g),f.useSyncedValues({disablePointerDismissal:l,nested:p,modal:u}),f.useContextCallback("onOpenChange",i),f.useContextCallback("onOpenChangeComplete",o);let x=f.useState("payload");!function(e){let{store:t,parentContext:s,actionsRef:r}=e,n=t.useState("open"),i=t.useState("disablePointerDismissal"),o=t.useState("modal"),l=t.useState("popupElement"),{openMethod:u,triggerProps:c}=(0,nT.useOpenInteractionType)(n);(0,nA.useImplicitActiveTrigger)(t);let{forceUnmount:d}=(0,nA.useOpenStateTransitions)(n,t),g=(0,nk.useStableCallback)(e=>{let s=(0,nt.createChangeEventDetails)(e);return s.preventUnmountOnClose=()=>{t.set("preventUnmountingOnClose",!0)},s}),m=a.useCallback(()=>{t.setOpen(!1,g(ns.REASONS.imperativeAction))},[t,g]);a.useImperativeHandle(r,()=>({unmount:d,close:m}),[d,m]);let h=(0,nC.useSyncedFloatingRootContext)({popupStore:t,onOpenChange:t.setOpen,treatPopupAsFloatingElement:!0,noEmit:!0}),[p,f]=a.useState(0),x=0===p,v=(0,nS.useRole)(h),b=(0,nw.useDismiss)(h,{outsidePressEvent:()=>t.context.internalBackdropRef.current||t.context.backdropRef.current?"intentional":{mouse:"trap-focus"===o?"sloppy":"intentional",touch:"sloppy"},outsidePress(e){if(!t.context.outsidePressEnabledRef.current||"button"in e&&0!==e.button||"touches"in e&&1!==e.touches.length)return!1;let s=(0,nE.getTarget)(e);return!!x&&!i&&(!o||!t.context.internalBackdropRef.current&&!t.context.backdropRef.current||t.context.internalBackdropRef.current===s||t.context.backdropRef.current===s||(0,nE.contains)(s,l)&&!s?.hasAttribute("data-base-ui-portal"))},escapeKey:x});(0,nj.useScrollLock)(n&&!0===o,l);let{getReferenceProps:y,getFloatingProps:k,getTriggerProps:j}=(0,nN.useInteractions)([v,b]);t.useContextCallback("onNestedDialogOpen",e=>{f(e+1)}),t.useContextCallback("onNestedDialogClose",()=>{f(0)}),a.useEffect(()=>(s?.onNestedDialogOpen&&n&&s.onNestedDialogOpen(p),s?.onNestedDialogClose&&!n&&s.onNestedDialogClose(),()=>{s?.onNestedDialogClose&&n&&s.onNestedDialogClose()}),[n,s,p]);let w=a.useMemo(()=>y(c),[y,c]),N=a.useMemo(()=>j(c),[j,c]),S=a.useMemo(()=>k(),[k]);t.useSyncedValues({openMethod:u,activeTriggerProps:w,inactiveTriggerProps:N,popupProps:S,floatingRootContext:h,nestedOpenDialogCount:p})}({store:f,actionsRef:c,parentContext:h?.store.context,onOpenChange:i,triggerIdProp:g});let v=a.useMemo(()=>({store:f}),[f]);return(0,n.jsx)(r5.Provider,{value:v,children:"function"==typeof t?t({payload:x}):t})},"Title",0,nW,"Trigger",0,nB,"Viewport",0,nL,"createHandle",0,function(){return new nz}],387913);var nq=e.i(387913),nq=nq,n$=e.i(364354),nH=e.i(916624),nG=e.i(379185);function nV({onOrgChanged:e,className:t}){let{orgs:s,activeOrg:r,setActiveOrg:i,isLoading:o,error:l,retry:c,refresh:d}=(0,z.useOrg)(),[g,m]=(0,a.useState)(!1),h=(0,n$.useStigmerPortalContainer)(),p=(0,a.useCallback)(t=>{let n=s.find(e=>e.metadata?.slug===t);n&&n.metadata?.slug!==r?.metadata?.slug&&(i(n),e?.(n))},[s,r,i,e]),f=(0,a.useCallback)(t=>{m(!1),d(t.metadata?.slug),e?.(t)},[d,e]),x=(0,a.useMemo)(()=>s.filter(e=>e.spec?.isPersonal),[s]),v=(0,a.useMemo)(()=>s.filter(e=>!e.spec?.isPersonal),[s]);if(o)return(0,n.jsx)(nQ,{className:t});if(l)return(0,n.jsxs)("div",{className:(0,u.cn)("stg:flex stg:items-center stg:gap-2 stg:px-2 stg:py-1.5",t),children:[(0,n.jsx)(rY.AlertCircle,{className:"stg:text-destructive stg:size-4 stg:shrink-0"}),(0,n.jsx)("span",{className:"stg:text-destructive stg:truncate stg:text-xs",children:l}),(0,n.jsx)("button",{onClick:c,className:"stg:text-sidebar-muted-foreground stg:hover:text-sidebar-foreground stg:shrink-0 stg:rounded stg:p-0.5 stg:transition-colors","aria-label":"Retry loading organizations",children:(0,n.jsx)(rJ.RefreshCw,{className:"stg:size-3"})})]});let b=s.length>0&&r,y=r?.spec?.isPersonal?r1.User:rQ.Building2;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(nH.Menu,{children:[(0,n.jsxs)(nH.MenuTrigger,{"aria-label":"Organization menu",className:(0,u.cn)("stg:hover:bg-sidebar-accent stg:flex stg:w-full stg:cursor-pointer stg:items-center stg:gap-2 stg:rounded-lg stg:px-2 stg:py-1.5 stg:text-sm stg:transition-colors stg:focus:outline-none",t),children:[(0,n.jsx)(y,{className:"stg:text-sidebar-muted-foreground stg:mt-0.5 stg:size-4 stg:shrink-0 stg:self-start"}),b?(0,n.jsx)(nX,{org:r,slugClassName:"stg:text-sidebar-muted-foreground"}):(0,n.jsx)("span",{className:"stg:text-sidebar-muted-foreground stg:truncate",children:"No organizations"}),(0,n.jsx)(rZ,{className:"stg:text-sidebar-muted-foreground stg:ml-auto stg:mt-0.5 stg:size-3.5 stg:shrink-0 stg:self-start"})]}),(0,n.jsxs)(nH.MenuContent,{align:"start",side:"bottom",sideOffset:4,children:[b&&(0,n.jsxs)(nH.MenuRadioGroup,{value:r.metadata?.slug??"",onValueChange:p,children:[x.map(e=>(0,n.jsxs)(nH.MenuRadioItem,{value:e.metadata?.slug??"",className:"stg:items-start",children:[(0,n.jsx)(r1.User,{className:"stg:mt-0.5 stg:size-3.5 stg:shrink-0"}),(0,n.jsx)(nX,{org:e})]},e.metadata?.slug)),x.length>0&&v.length>0&&(0,n.jsx)(nH.MenuSeparator,{}),v.map(e=>(0,n.jsxs)(nH.MenuRadioItem,{value:e.metadata?.slug??"",className:"stg:items-start",children:[(0,n.jsx)(rQ.Building2,{className:"stg:mt-0.5 stg:size-3.5 stg:shrink-0"}),(0,n.jsx)(nX,{org:e})]},e.metadata?.slug))]}),b&&(0,n.jsx)(nH.MenuSeparator,{}),(0,n.jsxs)(nH.MenuItem,{onClick:()=>m(!0),children:[(0,n.jsx)(r0.Plus,{className:"stg:size-4"}),"Create organization"]})]})]}),(0,n.jsx)(nq.Root,{open:g,onOpenChange:e=>m(e),children:(0,n.jsxs)(nq.Portal,{container:h,children:[(0,n.jsx)(nq.Backdrop,{className:(0,u.cn)("stg:fixed stg:inset-0 stg:z-50 stg:bg-black/50","stg:data-open:animate-in stg:data-open:fade-in-0","stg:data-closed:animate-out stg:data-closed:fade-out-0","stg:duration-150")}),(0,n.jsxs)(nq.Popup,{className:(0,u.cn)("stg:bg-background stg:text-foreground stg:ring-border/20","stg:fixed stg:top-1/2 stg:left-1/2 stg:z-50 stg:w-full stg:max-w-md stg:-translate-x-1/2 stg:-translate-y-1/2 stg:rounded-lg stg:p-6 stg:shadow-lg stg:ring-1 stg:outline-none","stg:data-open:animate-in stg:data-open:fade-in-0 stg:data-open:zoom-in-95","stg:data-closed:animate-out stg:data-closed:fade-out-0 stg:data-closed:zoom-out-95","stg:duration-150"),children:[(0,n.jsx)(nq.Title,{className:"stg:text-foreground stg:text-sm stg:font-semibold",children:"Create organization"}),(0,n.jsx)(nq.Description,{className:"stg:text-muted-foreground stg:mt-1 stg:mb-4 stg:text-xs",children:"Organizations are tenancy boundaries that own agents, environments, and other resources."}),(0,n.jsx)(nG.CreateOrganizationForm,{onCreated:f,onCancel:()=>m(!1)})]})]})})]})}function nX({org:e,slugClassName:t}){let s=e.metadata?.name||e.metadata?.slug,r=e.metadata?.slug;return(0,n.jsxs)("span",{className:"stg:min-w-0 stg:flex-1",children:[(0,n.jsx)("span",{className:"stg:block stg:truncate stg:text-sm stg:font-medium stg:leading-tight",children:s}),r&&(0,n.jsx)("span",{className:(0,u.cn)("stg:block stg:truncate stg:text-xs stg:leading-tight",t??"stg:text-muted-foreground"),children:r})]})}function nQ({className:e}){return(0,n.jsxs)("div",{className:(0,u.cn)("stg:flex stg:items-center stg:gap-2 stg:px-2 stg:py-1.5",e),children:[(0,n.jsx)("div",{className:"stg:bg-sidebar-muted stg:size-4 stg:animate-pulse stg:rounded"}),(0,n.jsx)("div",{className:"stg:bg-sidebar-muted stg:h-4 stg:w-24 stg:animate-pulse stg:rounded"})]})}function nY({ariaLabel:e,isOpen:t=!0,onCollapse:s,onOrgChanged:r,footer:i,children:o}){let c=(0,a.useId)();return(0,n.jsxs)("nav",{id:c,"aria-label":e,className:"stg:bg-sidebar stg:text-sidebar-foreground stg:flex stg:h-full stg:flex-col",children:[(0,n.jsxs)("div",{className:"stg:flex stg:flex-none stg:items-center stg:gap-1 stg:px-2 stg:py-2",children:[(0,n.jsx)("button",{type:"button",onClick:s,"aria-expanded":t,"aria-controls":c,"aria-label":"Collapse sidebar",className:(0,u.cn)("stg:inline-flex stg:size-7 stg:shrink-0 stg:items-center stg:justify-center stg:rounded-md","stg:text-sidebar-foreground stg:transition-colors stg:motion-reduce:transition-none","stg:hover:bg-sidebar-accent stg:hover:text-sidebar-accent-foreground","stg:aria-expanded:bg-sidebar-accent stg:aria-expanded:text-sidebar-accent-foreground","stg:focus-visible:ring-sidebar-ring stg:focus-visible:ring-2 stg:focus-visible:outline-none"),children:(0,n.jsx)(l,{className:"stg:size-4"})}),(0,n.jsx)("div",{className:"stg:min-w-0 stg:flex-1",children:(0,n.jsx)(nV,{onOrgChanged:r})})]}),o,(0,n.jsx)("div",{className:"stg:border-sidebar-border stg:flex-none stg:border-t stg:px-3 stg:py-2",children:i})]})}function nJ(){return(0,n.jsx)("div",{className:"stg:px-3 stg:py-1",children:(0,n.jsx)("div",{className:"stg:bg-sidebar-border stg:h-px"})})}function nZ(e,{muted:t=!1}={}){return(0,u.cn)("stg:flex stg:items-center stg:gap-2 stg:rounded-lg stg:px-2 stg:py-1.5 stg:text-sm stg:font-medium stg:transition-colors",e?"stg:bg-sidebar-accent stg:text-sidebar-accent-foreground":(0,u.cn)(t?"stg:text-sidebar-muted-foreground":"stg:text-sidebar-foreground","stg:hover:bg-sidebar-accent stg:hover:text-sidebar-accent-foreground"))}function n0({groups:e,activePath:t=null,renderLink:s,backHref:r="/",footer:a,isOpen:i=!0,onCollapse:o,onOrgChanged:l}){return(0,n.jsxs)(nY,{ariaLabel:"Management navigation",isOpen:i,onCollapse:o,onOrgChanged:l,footer:a,children:[(0,n.jsx)("div",{className:"stg:flex-none stg:px-3 stg:py-1",children:s({id:"back-to-sessions",href:r,active:!1,className:nZ(!1,{muted:!0}),"aria-current":void 0,children:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(rX.ArrowLeft,{className:"stg:size-4 stg:shrink-0"}),"Back to Sessions"]})})}),(0,n.jsx)(nJ,{}),(0,n.jsx)("div",{className:"stg:flex stg:flex-col stg:gap-4 stg:px-3 stg:py-1",children:e.map(e=>(0,n.jsxs)("div",{className:"stg:flex stg:flex-col stg:gap-0.5",children:[(0,n.jsx)("span",{className:"stg:text-sidebar-muted-foreground stg:px-2 stg:pb-1 stg:text-[11px] stg:font-medium stg:tracking-wider stg:uppercase",children:e.label}),e.items.map(e=>{let r=null!=t&&(t===e.href||t.startsWith(`${e.href}/`));return(0,n.jsx)(n1,{href:e.href,label:e.label,icon:(0,n.jsx)(e.icon,{className:"stg:size-4 stg:shrink-0"}),active:r,renderLink:s},e.href)})]},e.label))}),(0,n.jsx)("div",{className:"stg:flex-1"})]})}function n1({href:e,label:t,icon:s,active:r,renderLink:a}){return a({id:e.slice(e.lastIndexOf("/")+1),href:e,active:r,className:nZ(r),"aria-current":r?"page":void 0,children:(0,n.jsxs)(n.Fragment,{children:[s,t]})})}var n2=e.i(20753),n5=e.i(363178),n3=e.i(292270);let n6=(0,o.default)("settings",[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),n7=(0,o.default)("sun-moon",[["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M14.837 16.385a6 6 0 1 1-7.223-7.222c.624-.147.97.66.715 1.248a4 4 0 0 0 5.26 5.259c.589-.255 1.396.09 1.248.715",key:"xlf6rm"}],["path",{d:"M16 12a4 4 0 0 0-4-4",key:"6vsxu"}],["path",{d:"m19 5-1.256 1.256",key:"1yg6a6"}],["path",{d:"M20 12h2",key:"1q8mjw"}]]);function n4({user:e,colorMode:t,onColorModeChange:s,onSettingsClick:r,onSignOut:a,extraItems:i,className:o}){let l=null!=t&&null!=s,c=null!=r,d=c||l||i,g=e?.name??e?.email,m=e?"User menu":"Settings";return(0,n.jsxs)(nH.Menu,{children:[(0,n.jsxs)(nH.MenuTrigger,{"aria-label":m,className:(0,u.cn)("stg:hover:bg-sidebar-accent stg:flex stg:w-full stg:cursor-pointer stg:items-center stg:gap-2 stg:rounded-lg stg:px-2 stg:py-1.5 stg:transition-colors stg:focus:outline-none",o),children:[(0,n.jsx)(n9,{name:g}),e?(0,n.jsxs)("div",{className:"stg:flex stg:min-w-0 stg:flex-1 stg:flex-col stg:text-left",children:[e.name&&(0,n.jsx)("span",{className:"stg:truncate stg:text-sm stg:font-medium",children:e.name}),(0,n.jsx)("span",{className:"stg:text-sidebar-muted-foreground stg:truncate stg:text-xs",children:e.email})]}):(0,n.jsx)("span",{className:"stg:text-sidebar-muted-foreground stg:truncate stg:text-sm",children:"Local mode"}),(0,n.jsx)(rZ,{className:"stg:text-sidebar-muted-foreground stg:ml-auto stg:size-3.5 stg:shrink-0"})]}),(0,n.jsxs)(nH.MenuContent,{align:"start",side:"top",sideOffset:8,children:[c&&(0,n.jsxs)(nH.MenuItem,{onClick:r,children:[(0,n.jsx)(n6,{className:"stg:size-4"}),"Settings"]}),c&&l&&(0,n.jsx)(nH.MenuSeparator,{}),l&&(0,n.jsx)(n8,{colorMode:t,onColorModeChange:s}),i&&(0,n.jsxs)(n.Fragment,{children:[(c||l)&&(0,n.jsx)(nH.MenuSeparator,{}),i]}),null!=a&&(0,n.jsxs)(n.Fragment,{children:[d&&(0,n.jsx)(nH.MenuSeparator,{}),(0,n.jsxs)(nH.MenuItem,{onClick:a,children:[(0,n.jsx)(n3.LogOut,{className:"stg:size-4"}),"Sign out"]})]})]})]})}function n8({colorMode:e,onColorModeChange:t}){return(0,n.jsxs)(nH.MenuGroup,{"aria-label":"Color scheme",children:[(0,n.jsxs)(nH.MenuLabel,{children:[(0,n.jsx)(n7,{className:"stg:mr-1 stg:inline stg:size-3 stg:align-[-2px]"}),"Color Scheme"]}),(0,n.jsxs)(nH.MenuRadioGroup,{value:e,onValueChange:e=>t(e),children:[(0,n.jsx)(nH.MenuRadioItem,{value:"light",children:"Light"}),(0,n.jsx)(nH.MenuRadioItem,{value:"dark",children:"Dark"}),(0,n.jsx)(nH.MenuRadioItem,{value:"system",children:"System"})]})]})}function n9({name:e}){let t=e?e.charAt(0).toUpperCase():null;return(0,n.jsx)("div",{className:(0,u.cn)("stg:bg-sidebar-accent stg:text-sidebar-accent-foreground stg:border-sidebar-border","stg:flex stg:size-6 stg:shrink-0 stg:items-center stg:justify-center stg:rounded-full stg:border"),children:t?(0,n.jsx)("span",{className:"stg:text-xs stg:font-medium",children:t}):(0,n.jsx)(r1.User,{className:"stg:size-3.5"})})}e.i(67407);var ae=e.i(800692),at=e.i(704077);function as({className:e,inset:t,variant:s="default",...r}){return(0,n.jsx)(at.Menu.Item,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":s,className:(0,u.cn)("group/dropdown-menu-item focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive-subtle data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:text-destructive relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 data-inset:pl-7 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r})}function ar(){let{user:e,logout:t}=(0,ae.useAuth)(),{theme:s,setTheme:r}=(0,n5.useTheme)(),o=(0,i.useRouter)(),l=(0,a.useCallback)(()=>{o.push("/settings")},[o]);return(0,n.jsx)(n4,{user:e?{name:e.name,email:e.email}:null,colorMode:s??"system",onColorModeChange:r,onSettingsClick:l,onSignOut:e?t:void 0,extraItems:(0,n.jsx)(an,{})})}function an(){return(0,n.jsxs)(as,{onClick:rF,children:[(0,n.jsx)(rA,{className:"size-4"}),"Get Desktop App",(0,n.jsx)(rT.Download,{className:"text-muted-foreground ml-auto size-3"})]})}(0,o.default)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),e.i(678784);let aa="stigmer:sidebar-open";function ai(){try{let e=localStorage.getItem(aa);if(null===e)return!0;return"false"!==e}catch{return!0}}function ao(){return!0}function al(e){function t(t){t.key===aa&&e()}return window.addEventListener("storage",t),()=>window.removeEventListener("storage",t)}function au(e){try{localStorage.setItem(aa,String(e))}catch{}window.dispatchEvent(new StorageEvent("storage",{key:aa}))}function ac(){let e=(0,a.useSyncExternalStore)(al,ai,ao),t=(0,a.useCallback)(()=>au(!ai()),[]);return{isOpen:e,toggle:t,open:(0,a.useCallback)(()=>au(!0),[]),close:(0,a.useCallback)(()=>au(!1),[])}}function ad(){let e=ac(),t=(0,i.usePathname)(),s=(0,i.useRouter)(),{lastSessionZonePath:r}=(0,h.useSessionNavigation)(),o=(0,n2.useSettingsNavGroups)(),l=(0,a.useCallback)(({href:e,className:t,children:s,"aria-current":r})=>(0,n.jsx)(rV.default,{href:e,"aria-current":r,className:t,children:s}),[]),u=(0,a.useCallback)(()=>{s.push("/dashboard")},[s]);return(0,n.jsx)(n0,{groups:o,activePath:t,backHref:r??"/",renderLink:l,footer:(0,n.jsx)(ar,{}),isOpen:e.isOpen,onCollapse:e.close,onOrgChanged:u})}var ag=e.i(12556),am=e.i(799190),ah=e.i(17616);let ap=new Date(0);function af(e){let t=e.updatedAt?(0,ah.timestampDate)(e.updatedAt):ap;return{id:e.id,type:"session"===e.type?"session":"workflow_execution",subject:e.subject||("session"===e.type?"Untitled session":"Untitled execution"),updatedAt:t.getTime()>0?t:ap,status:e.status||void 0}}let ax=(0,o.default)("layout-dashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]),av=(0,o.default)("library",[["path",{d:"m16 6 4 14",key:"ji33uf"}],["path",{d:"M12 6v14",key:"1n7gus"}],["path",{d:"M8 8v12",key:"1gg7y9"}],["path",{d:"M4 4v16",key:"6qkkli"}]]);var ab=e.i(686311),ay=e.i(981997),ak=e.i(640524);function aj(e,t){let s=new Date(e);return s.setDate(s.getDate()+t),s}let aw=new Map([["failed","destructive"],["terminated","destructive"],["cancelled","muted"],["running","muted"],["pending","muted"]]);function aN({className:e,children:t,...s}){return(0,n.jsx)("div",{className:(0,u.cn)("stg:relative stg:overflow-auto","stg:[scrollbar-width:thin] stg:[scrollbar-color:var(--color-border)_transparent]","stg:[&::-webkit-scrollbar]:w-2.5","stg:[&::-webkit-scrollbar-track]:bg-transparent","stg:[&::-webkit-scrollbar-thumb]:rounded-full","stg:[&::-webkit-scrollbar-thumb]:bg-border",e),...s,children:t})}function aS({activeNav:e=null,renderLink:t,recentActivity:s,activeSessionId:r=null,activeExecutionId:i=null,renderEntryAccessory:o,conversationsBadgeCount:l,footer:u,isOpen:c=!0,onCollapse:d,onOrgChanged:g,now:m}){let{entries:h,isLoading:p=!1,error:f=null}=s,x=(0,a.useMemo)(()=>(function(e,t){let s,r=((s=new Date(t??new Date)).setHours(0,0,0,0),s),n=aj(r,-1),a=aj(r,-6),i=aj(r,-29),o=[{label:"Today",entries:[]},{label:"Yesterday",entries:[]},{label:"Previous 7 Days",entries:[]},{label:"Previous 30 Days",entries:[]},{label:"Older",entries:[]}];for(let t of e){let e=t.updatedAt;e>=r?o[0].entries.push(t):e>=n?o[1].entries.push(t):e>=a?o[2].entries.push(t):e>=i?o[3].entries.push(t):o[4].entries.push(t)}return o.filter(e=>e.entries.length>0)})(h,m),[h,m]);return(0,n.jsxs)(nY,{ariaLabel:"Main navigation",isOpen:c,onCollapse:d,onOrgChanged:g,footer:u,children:[(0,n.jsx)(aC,{id:"new-session",href:"/",label:"New Session",icon:r0.Plus,active:"new-session"===e,renderLink:t}),(0,n.jsx)(aC,{id:"dashboard",href:"/dashboard",label:"Dashboard",icon:ax,active:"dashboard"===e,renderLink:t}),(0,n.jsx)(aC,{id:"conversations",href:"/conversations",label:"Conversations",icon:ay.MessagesSquare,active:"conversations"===e,renderLink:t,accessory:void 0!==l&&l>0?(0,n.jsx)(aE,{count:l}):null}),(0,n.jsx)(aC,{id:"library",href:"/library",label:"Library",icon:av,active:"library"===e,renderLink:t}),(0,n.jsx)(nJ,{}),(0,n.jsx)(aN,{className:"stg:flex-1",children:(0,n.jsxs)("div",{className:"stg:p-3",children:[(0,n.jsx)("p",{className:"stg:text-sidebar-muted-foreground stg:mb-2 stg:px-1 stg:text-[11px] stg:font-semibold stg:tracking-wider stg:uppercase",children:"Recents"}),p?(0,n.jsx)(aI,{}):f?(0,n.jsx)(aM,{message:f.message}):0===x.length?(0,n.jsx)(aO,{}):(0,n.jsx)(aT,{groups:x,activeSessionId:r,activeExecutionId:i,renderLink:t,renderEntryAccessory:o,now:m})]})})]})}function aC({id:e,href:t,label:s,icon:r,active:a,renderLink:i,accessory:o=null}){return(0,n.jsx)("div",{className:"stg:flex-none stg:px-3 stg:py-1",children:i({id:e,href:t,active:a,className:nZ(a),"aria-current":a?"page":void 0,children:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(r,{className:"stg:size-4 stg:shrink-0"}),s,o]})})})}function aE({count:e}){return(0,n.jsxs)("span",{className:"stg:ml-auto stg:flex stg:shrink-0 stg:items-center",children:[(0,n.jsx)("span",{"aria-hidden":"true",className:"stg:bg-sidebar-primary stg:text-sidebar-primary-foreground stg:rounded-full stg:px-1.5 stg:py-0.5 stg:text-[10px] stg:leading-none stg:font-semibold stg:tabular-nums",children:e>99?"99+":e}),(0,n.jsx)("span",{className:"stg:sr-only",children:1===e?"1 conversation needs a human":`${e} conversations need a human`})]})}function aT({groups:e,activeSessionId:t,activeExecutionId:s,renderLink:r,renderEntryAccessory:a,now:i}){return(0,n.jsx)(tr.TooltipProvider,{children:(0,n.jsx)("div",{className:"stg:space-y-4",children:e.map(e=>(0,n.jsxs)("div",{children:[(0,n.jsx)("p",{className:"stg:text-sidebar-muted-foreground stg:mb-1 stg:px-2 stg:text-[10px] stg:font-medium stg:tracking-wider stg:uppercase",children:e.label}),(0,n.jsx)("ul",{className:`${tG.UNSTYLED_LIST} stg:space-y-0.5`,role:"list",children:e.entries.map(e=>(0,n.jsx)(aA,{entry:e,activeSessionId:t,activeExecutionId:s,renderLink:r,renderEntryAccessory:a,now:i},e.id))})]},e.label))})})}let aA=(0,a.memo)(function({entry:e,activeSessionId:t,activeExecutionId:s,renderLink:r,renderEntryAccessory:a,now:i}){let o="session"===e.type,l=o?e.id===t:e.id===s,u=o?`/sessions/${e.id}`:`/executions/${e.id}`,c=o?ab.MessageSquare:ak.Workflow,d=function(e){if("workflow_execution"!==e.type||!e.status)return null;let t=aw.get(e.status);return t?{label:e.status,tone:t}:null}(e),g=r({id:e.id,href:u,active:l,"aria-current":l?"page":void 0,entry:e,className:l?"stg:flex stg:items-start stg:gap-2 stg:rounded-lg stg:px-2 stg:py-1.5 stg:text-xs stg:transition-colors stg:bg-sidebar-accent stg:text-sidebar-accent-foreground stg:font-medium":"stg:flex stg:items-start stg:gap-2 stg:rounded-lg stg:px-2 stg:py-1.5 stg:text-xs stg:transition-colors stg:text-sidebar-foreground stg:hover:bg-sidebar-accent stg:hover:text-sidebar-accent-foreground",children:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(c,{className:"stg:mt-0.5 stg:size-3 stg:shrink-0 stg:opacity-50","aria-hidden":"true"}),(0,n.jsx)("span",{className:"stg:line-clamp-2 stg:flex-1",children:e.subject}),(0,n.jsxs)("span",{className:"stg:flex stg:shrink-0 stg:flex-col stg:items-end stg:gap-0.5 stg:text-[10px] stg:leading-tight",children:[(0,n.jsx)("span",{className:"stg:text-sidebar-muted-foreground stg:tabular-nums",children:(0,tp.formatRelativeTime)(e.updatedAt,i)}),d&&(0,n.jsx)("span",{className:"destructive"===d.tone?"stg:text-destructive":"stg:text-sidebar-muted-foreground",children:d.label})]}),a?.(e)]})});return(0,n.jsx)("li",{children:(0,n.jsxs)(tr.Tooltip,{children:[(0,n.jsx)(tr.TooltipTrigger,{render:g}),(0,n.jsx)(tr.TooltipContent,{side:"right",sideOffset:12,children:e.subject})]})})});function aI(){return(0,n.jsx)("div",{className:"stg:space-y-2 stg:px-2","aria-busy":"true","aria-label":"Loading sessions",children:Array.from({length:5},(e,t)=>(0,n.jsx)("div",{className:"stg:bg-sidebar-muted stg:h-5 stg:animate-pulse stg:rounded",style:{width:`${70+20*Math.sin(1.5*t)}%`}},t))})}function aM({message:e}){return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("p",{className:"stg:text-destructive stg:mb-4 stg:px-2 stg:text-xs",role:"alert",children:e}),(0,n.jsx)(aO,{})]})}function aO(){return(0,n.jsxs)("div",{className:"stg:flex stg:flex-col stg:items-center stg:gap-2 stg:py-8 stg:text-center",children:[(0,n.jsx)(ab.MessageSquare,{className:"stg:text-sidebar-muted-foreground stg:size-8"}),(0,n.jsx)("p",{className:"stg:text-sidebar-muted-foreground stg:text-xs",children:"No recent activity"})]})}function aR(e){return!e.metaKey&&!e.ctrlKey&&!e.shiftKey&&!e.altKey&&0===e.button}function a_(){let e=ac(),t=(0,i.usePathname)(),s=(0,i.useRouter)(),r=function(){let e=(void 0)??30,t=(0,c.useStigmer)(),s=(0,z.useActiveOrgSlug)(),{data:r,isLoading:n,error:i,refetch:o}=(0,d.useFetch)(()=>t.activity.listRecentActivity({pageSize:e,org:s}).then(e=>e.entries.map(af)),[t,e,s],[],{cacheKey:`recent-activity:${s}`}),[l,u]=(0,a.useState)([]),g=(0,a.useRef)(r);return(0,a.useEffect)(()=>{r!==g.current&&(g.current=r,l.length>0&&u([]))},[r,l.length]),{entries:(0,a.useMemo)(()=>{if(0===l.length)return r;let e=new Set(r.map(e=>e.id)),t=l.filter(t=>!e.has(t.id));return t.length>0?[...t,...r]:r},[r,l]),isLoading:n,error:i,refetch:o,prependOptimistic:(0,a.useCallback)(e=>{u(t=>t.some(t=>t.id===e.id)?t:[{id:e.id,type:e.type,subject:e.subject,updatedAt:new Date},...t])},[])}}(),{refetch:o,prependOptimistic:l}=r,{count:u}=function(e){let t=(0,c.useStigmer)(),s=(void 0)??am.CONVERSATION_BADGE_POLL_INTERVAL_MS,r=e?async()=>(await t.agentChannel.listConversations((0,j.create)(ag.ListChannelConversationsInputSchema,{org:e,filter:ag.ChannelConversationListFilter.filter_wants_human,pageInfo:{num:1,size:1}}))).totalCount:null,{data:n,isLoading:i,error:o,refetch:l}=(0,d.useFetch)(r,[e,t],0,{refetchInterval:s,refetchOnWindowFocus:!0});return(0,a.useMemo)(()=>({count:n,isLoading:i,error:o,refetch:l}),[n,i,o,l])}((0,z.useActiveOrgSlug)()||null),{activeSessionId:g,isSessionZone:m,navigateToSession:f,navigateToHome:x}=(0,h.useSessionNavigation)(),{activeExecutionId:v,isExecutionZone:b,navigateToExecution:y}=(0,p.useExecutionNavigation)(),k=!m&&!b&&t.startsWith("/dashboard"),w=!m&&!b&&t.startsWith("/conversations"),N=!m&&!b&&t.startsWith("/library"),S=(0,a.useCallback)(()=>{s.push("/dashboard")},[s]),C=(0,a.useRef)(r.entries);(0,a.useEffect)(()=>{C.current=r.entries}),(0,a.useEffect)(()=>{if(v&&!C.current.some(e=>e.id===v)&&l({id:v,type:"workflow_execution",subject:"Loading…"}),o(),!(g??v))return;let e=setTimeout(o,8e3),t=setTimeout(o,18e3);return()=>{clearTimeout(e),clearTimeout(t)}},[g,v,o,l]);let E=(0,a.useCallback)(({id:e,href:t,className:s,children:r,entry:a,"aria-current":i})=>a?(0,n.jsx)("a",{href:t,onClick:e=>{aR(e)&&(e.preventDefault(),"session"===a.type?f(a.id):y(a.id))},"aria-current":i,className:s,children:r}):"new-session"===e?(0,n.jsx)(rV.default,{href:"/",onClick:e=>{aR(e)&&(e.preventDefault(),x())},className:s,children:r}):(0,n.jsx)(rV.default,{href:t,"aria-current":i,className:s,children:r}),[f,y,x]);return(0,n.jsx)(aS,{activeNav:k?"dashboard":w?"conversations":N?"library":null,renderLink:E,recentActivity:r,activeSessionId:g,activeExecutionId:v,conversationsBadgeCount:u,footer:(0,n.jsx)(ar,{}),isOpen:e.isOpen,onCollapse:e.close,onOrgChanged:S})}function aD({executionId:e}){let{navigateToSession:t}=(0,h.useSessionNavigation)(),s=e.startsWith("aex_"),{sessionId:r}=g(s?e:null);return((0,a.useEffect)(()=>{r&&t(r)},[r,t]),s)?null:(0,n.jsx)(rE,{executionId:e})}function aP({activeSessionId:e}){return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:(0,u.cn)("h-full",null!=e&&"hidden"),"aria-hidden":null!=e,children:(0,n.jsx)(G,{})}),null!=e&&(0,n.jsx)(J,{id:e},e)]})}e.s(["AppShell",0,function({children:e}){let t,s=ac(),r=(0,i.usePathname)(),{activeSessionId:o,isSessionZone:c}=(0,h.useSessionNavigation)(),{activeExecutionId:d,isExecutionZone:g}=(0,p.useExecutionNavigation)(),f=(t=(0,a.useSyncExternalStore)(rH,rq,r$),(0,a.useEffect)(()=>{try{localStorage.getItem(rL)||(localStorage.setItem(rL,new Date().toISOString()),rz=!0)}catch{}},[]),{visible:t,dismiss:(0,a.useCallback)(()=>{try{localStorage.setItem(rW,JSON.stringify({campaign:rB,ts:new Date().toISOString()}))}catch{}window.dispatchEvent(new StorageEvent("storage",{key:rW}))},[])}),x=r.startsWith("/settings"),v=r.startsWith("/invite/")||r.startsWith("/login")||r.startsWith("/chat/");(0,a.useEffect)(()=>{s.isOpen&&window.innerWidth<1024&&s.close()},[r]);let b=s.isOpen,y=s.close;return((0,a.useEffect)(()=>{function e(e){"Escape"===e.key&&b&&window.innerWidth<1024&&y()}return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[b,y]),v)?(0,n.jsx)("div",{className:"bg-background text-foreground min-h-screen",children:(0,n.jsx)("main",{children:e})}):(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)("div",{className:"bg-background text-foreground flex h-screen",children:[s.isOpen&&(0,n.jsx)("div",{className:"bg-backdrop fixed inset-0 z-40 backdrop-blur-sm lg:hidden",onClick:s.close,"aria-hidden":"true"}),(0,n.jsx)(m.Button,{variant:"ghost",size:"icon-sm",onClick:s.open,"aria-label":"Open sidebar",className:(0,u.cn)("fixed top-2 left-2 z-30",s.isOpen&&"hidden"),children:(0,n.jsx)(l,{className:"size-4"})}),(0,n.jsx)("div",{className:(0,u.cn)("shrink-0 overflow-hidden","border-sidebar-border border-r","transition-[width] duration-200 ease-in-out motion-reduce:transition-none",s.isOpen?"w-70":"w-0","max-lg:fixed max-lg:inset-y-0 max-lg:left-0 max-lg:z-50 max-lg:shadow-lg"),children:(0,n.jsx)("div",{className:"h-full w-70",children:(0,n.jsx)("div",{className:"h-full animate-in fade-in duration-150",children:x?(0,n.jsx)(ad,{}):(0,n.jsx)(a_,{})},x?"management":"session")})}),(0,n.jsxs)("main",{className:"min-w-0 flex-1 flex flex-col overflow-hidden",children:[f.visible&&(0,n.jsx)(rG,{onDismiss:f.dismiss}),(0,n.jsx)("div",{className:"min-w-0 flex-1 overflow-y-auto",children:x?e:g&&d?(0,n.jsx)(aD,{executionId:d},d):c?(0,n.jsx)(aP,{activeSessionId:o}):e})]})]})})}],936636)}]);