@stigmer/server-slim 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (564) hide show
  1. package/README.md +3 -0
  2. package/console/404.html +1 -0
  3. package/console/__next.__PAGE__.txt +54 -0
  4. package/console/__next._full.txt +71 -0
  5. package/console/__next._index.txt +62 -0
  6. package/console/__next._tree.txt +6 -0
  7. package/console/_next/static/GjBokeF86FffwftazOhh6/_buildManifest.js +11 -0
  8. package/console/_next/static/GjBokeF86FffwftazOhh6/_clientMiddlewareManifest.js +1 -0
  9. package/console/_next/static/GjBokeF86FffwftazOhh6/_ssgManifest.js +1 -0
  10. package/console/_next/static/chunks/0376wi8qbsw94.js +1 -0
  11. package/console/_next/static/chunks/04cglffeuwumk.js +1 -0
  12. package/console/_next/static/chunks/04d276dp3qb52.js +1 -0
  13. package/console/_next/static/chunks/05526ws9tzwim.js +1 -0
  14. package/console/_next/static/chunks/05t5235u7o-c4.js +25 -0
  15. package/console/_next/static/chunks/06fz-g9t73bd6.js +4 -0
  16. package/console/_next/static/chunks/0789xt7opwvm-.js +24 -0
  17. package/console/_next/static/chunks/07twy5plc911w.js +1 -0
  18. package/console/_next/static/chunks/08-p5zefc1rea.js +1 -0
  19. package/console/_next/static/chunks/085db4op75mf5.js +1 -0
  20. package/console/_next/static/chunks/0923388wak11-.js +1 -0
  21. package/console/_next/static/chunks/0_7s7fzux7kiv.js +1 -0
  22. package/console/_next/static/chunks/0_bjj6hug8d9a.js +1 -0
  23. package/console/_next/static/chunks/0_zscrk6o0d0-.js +1 -0
  24. package/console/_next/static/chunks/0a4x97q7frgj3.js +1 -0
  25. package/console/_next/static/chunks/0ab5jlm8l0aud.js +1 -0
  26. package/console/_next/static/chunks/0c_c2b4z1yc02.js +1 -0
  27. package/console/_next/static/chunks/0cuyycns49hl4.js +1 -0
  28. package/console/_next/static/chunks/0cz1d0mv5g_q7.js +1 -0
  29. package/console/_next/static/chunks/0d8f3-znyc_to.js +1 -0
  30. package/console/_next/static/chunks/0e-f1rkyz_u2k.js +1 -0
  31. package/console/_next/static/chunks/0ffx83gbnwq09.js +28 -0
  32. package/console/_next/static/chunks/0fyno0jk61txk.js +115 -0
  33. package/console/_next/static/chunks/0ggwoicp90w_s.js +1 -0
  34. package/console/_next/static/chunks/0h_7_i44vofe3.js +1 -0
  35. package/console/_next/static/chunks/0hagmppwo8s-f.js +1 -0
  36. package/console/_next/static/chunks/0hfvbn6c9k3pf.js +1 -0
  37. package/console/_next/static/chunks/0hw7vilkfpzlc.js +1 -0
  38. package/console/_next/static/chunks/0kb63xcvghh_3.js +1 -0
  39. package/console/_next/static/chunks/0ko5wsi6kukgd.js +1 -0
  40. package/console/_next/static/chunks/0kq99qin4db-q.js +1 -0
  41. package/console/_next/static/chunks/0kqg4u5n17gje.js +1 -0
  42. package/console/_next/static/chunks/0ky9qppyx1n57.js +62 -0
  43. package/console/_next/static/chunks/0og4_5pph-mhm.js +1 -0
  44. package/console/_next/static/chunks/0p7p-bpdrqx75.js +1 -0
  45. package/console/_next/static/chunks/0q2bnr94vvuc2.js +1 -0
  46. package/console/_next/static/chunks/0q3sxhnylk_gn.js +1 -0
  47. package/console/_next/static/chunks/0qg6l3tattq3j.js +1 -0
  48. package/console/_next/static/chunks/0qwyk_70quvjh.js +1 -0
  49. package/console/_next/static/chunks/0qzyqii8_m5r2.js +1 -0
  50. package/console/_next/static/chunks/0rlfx91598uvc.js +1 -0
  51. package/console/_next/static/chunks/0s9njms3lumhx.js +1 -0
  52. package/console/_next/static/chunks/0srualwd948m1.js +29 -0
  53. package/console/_next/static/chunks/0u4m2805tgi7x.js +1 -0
  54. package/console/_next/static/chunks/0udcs-1vq74rp.js +1 -0
  55. package/console/_next/static/chunks/0vno04lmwdchj.js +1 -0
  56. package/console/_next/static/chunks/0vt1_fu_q116n.js +1 -0
  57. package/console/_next/static/chunks/0vuq85gcb9zcl.js +1 -0
  58. package/console/_next/static/chunks/0wxazby0i4xu3.js +5 -0
  59. package/console/_next/static/chunks/0yeh2zqwmmec0.js +22 -0
  60. package/console/_next/static/chunks/0zvl88sijsrqk.js +1 -0
  61. package/console/_next/static/chunks/110bgpy30m6m6.js +1 -0
  62. package/console/_next/static/chunks/14ipylvs6qyyw.js +1 -0
  63. package/console/_next/static/chunks/1745jt9onokna.js +1 -0
  64. package/console/_next/static/chunks/177rfq0tsoku9.js +4 -0
  65. package/console/_next/static/chunks/17mfsiiquey1d.js +1 -0
  66. package/console/_next/static/chunks/197iuvi8udifl.js +1 -0
  67. package/console/_next/static/chunks/1_2-z0tjk0xio.js +1 -0
  68. package/console/_next/static/chunks/1_gh5a14dqnji.js +1 -0
  69. package/console/_next/static/chunks/1ame8n7x9g3xc.js +1 -0
  70. package/console/_next/static/chunks/1apepr-7dz16b.js +1 -0
  71. package/console/_next/static/chunks/1dtukwrl8nulc.js +1 -0
  72. package/console/_next/static/chunks/1e0br64ibniud.js +24 -0
  73. package/console/_next/static/chunks/1fm-45g777ifx.js +1 -0
  74. package/console/_next/static/chunks/1g_iha5barqef.js +1 -0
  75. package/console/_next/static/chunks/1glr_lki18csr.js +2 -0
  76. package/console/_next/static/chunks/1hl355w6m5bp5.js +1 -0
  77. package/console/_next/static/chunks/1id3p9v9v5knn.js +1 -0
  78. package/console/_next/static/chunks/1j6kp4gg0_ylt.js +80 -0
  79. package/console/_next/static/chunks/1jssq3ch7qgd6.js +60 -0
  80. package/console/_next/static/chunks/1jzfyfh-3gqlb.js +1 -0
  81. package/console/_next/static/chunks/1k3d5c49mpp-2.js +1 -0
  82. package/console/_next/static/chunks/1kte_bxw9m-ie.js +1 -0
  83. package/console/_next/static/chunks/1lw52jm27gon2.js +1 -0
  84. package/console/_next/static/chunks/1m9e28v8syzxx.js +34 -0
  85. package/console/_next/static/chunks/1mrmq_pigo_yb.js +1 -0
  86. package/console/_next/static/chunks/1muf1a96cgbv5.js +1 -0
  87. package/console/_next/static/chunks/1n1x0ykt8by6w.js +1 -0
  88. package/console/_next/static/chunks/1qu0tqybdtj0_.js +1 -0
  89. package/console/_next/static/chunks/1r8itpdfffwxa.js +1 -0
  90. package/console/_next/static/chunks/1r_opkrpbuykx.js +1 -0
  91. package/console/_next/static/chunks/1tl0h3c_bp62t.js +1 -0
  92. package/console/_next/static/chunks/1v1m1fr8f0yle.js +1 -0
  93. package/console/_next/static/chunks/1v34vj52v7q0g.js +1 -0
  94. package/console/_next/static/chunks/1wztfxoxnu5_9.js +1 -0
  95. package/console/_next/static/chunks/1x7exm5d_hhb8.js +153 -0
  96. package/console/_next/static/chunks/1xwdphzrhi9cn.js +1 -0
  97. package/console/_next/static/chunks/1yc4gdqzxa5ie.js +1 -0
  98. package/console/_next/static/chunks/1zunrzvni97zi.js +1 -0
  99. package/console/_next/static/chunks/1zv6mtmekep40.js +36 -0
  100. package/console/_next/static/chunks/2-jaie5wchnsy.js +1 -0
  101. package/console/_next/static/chunks/20aa5hen470pm.js +1 -0
  102. package/console/_next/static/chunks/2116ko93nwgx8.js +1 -0
  103. package/console/_next/static/chunks/23vk0ig36j0he.js +1 -0
  104. package/console/_next/static/chunks/245vlws7l85dk.js +1 -0
  105. package/console/_next/static/chunks/24__o4dkdytc8.js +1 -0
  106. package/console/_next/static/chunks/24iwqo9ejhxl8.js +127 -0
  107. package/console/_next/static/chunks/24o9ia1be2cze.js +1 -0
  108. package/console/_next/static/chunks/25aea0bgjydel.css +1 -0
  109. package/console/_next/static/chunks/26-p2jxr4f20d.js +1 -0
  110. package/console/_next/static/chunks/28c--yt2jaxxf.js +1 -0
  111. package/console/_next/static/chunks/28vym848oh1ng.js +1 -0
  112. package/console/_next/static/chunks/29ou6qb6p1lni.js +1 -0
  113. package/console/_next/static/chunks/2aalpmeu_tni-.js +3 -0
  114. package/console/_next/static/chunks/2c4ifddi2dal0.js +20 -0
  115. package/console/_next/static/chunks/2ckm4edha_gkb.js +43 -0
  116. package/console/_next/static/chunks/2d5ods6a8n6yd.js +1 -0
  117. package/console/_next/static/chunks/2dm5g7ylrulvb.js +15 -0
  118. package/console/_next/static/chunks/2dtosus35_o5k.js +1 -0
  119. package/console/_next/static/chunks/2e0_cm1_wv-b4.js +1 -0
  120. package/console/_next/static/chunks/2fh_0n31hibdi.js +226 -0
  121. package/console/_next/static/chunks/2fjsaw5pgjcqb.js +1 -0
  122. package/console/_next/static/chunks/2h5pk3yu15nwr.js +1 -0
  123. package/console/_next/static/chunks/2i7w4yyf77gzw.js +1 -0
  124. package/console/_next/static/chunks/2jo3q7mfk65kd.js +1 -0
  125. package/console/_next/static/chunks/2jutbapb-t64n.js +31 -0
  126. package/console/_next/static/chunks/2k6tx8-w1creu.js +148 -0
  127. package/console/_next/static/chunks/2kh_m5onqedc5.js +1 -0
  128. package/console/_next/static/chunks/2ltzdgpjq3v6a.js +1 -0
  129. package/console/_next/static/chunks/2o2ftjhtb8od3.js +2 -0
  130. package/console/_next/static/chunks/2pyn841-jq-oo.js +10 -0
  131. package/console/_next/static/chunks/2rn289343m-y_.js +139 -0
  132. package/console/_next/static/chunks/2t2l3h2w_04bb.js +1 -0
  133. package/console/_next/static/chunks/2v11hooq3xd5t.js +15 -0
  134. package/console/_next/static/chunks/2vsg5t3fnqmfn.js +1 -0
  135. package/console/_next/static/chunks/2wayafjfoiq7q.css +6 -0
  136. package/console/_next/static/chunks/2xsvteosdtsb-.js +1 -0
  137. package/console/_next/static/chunks/2y-x8nhnufxzb.js +1 -0
  138. package/console/_next/static/chunks/2za4b-si894xj.js +1 -0
  139. package/console/_next/static/chunks/3-igvp1-n4pxs.js +104 -0
  140. package/console/_next/static/chunks/3-k25f-adpe5f.js +1 -0
  141. package/console/_next/static/chunks/3-pzmot7dbrfa.js +1 -0
  142. package/console/_next/static/chunks/3-x5lrgs3wcpl.js +80 -0
  143. package/console/_next/static/chunks/30nrkrr9518_z.js +1 -0
  144. package/console/_next/static/chunks/316lh1-hzgnod.js +1 -0
  145. package/console/_next/static/chunks/31wj1au8smjge.js +1 -0
  146. package/console/_next/static/chunks/329o6uup9qmb3.js +1 -0
  147. package/console/_next/static/chunks/34_1w929-5o6r.js +287 -0
  148. package/console/_next/static/chunks/35szx1ga574xu.js +1 -0
  149. package/console/_next/static/chunks/36tg522pkl8hm.js +1 -0
  150. package/console/_next/static/chunks/37-y9fgnir35a.js +1 -0
  151. package/console/_next/static/chunks/39wss1g0ffaqt.js +1 -0
  152. package/console/_next/static/chunks/3_cv0gj1bm3l6.js +1 -0
  153. package/console/_next/static/chunks/3_f8gd_6816re.js +101 -0
  154. package/console/_next/static/chunks/3a4qfuhsxefh2.js +12 -0
  155. package/console/_next/static/chunks/3asb3ztrvogwl.js +1 -0
  156. package/console/_next/static/chunks/3bsxbw10qhvqo.js +1 -0
  157. package/console/_next/static/chunks/3by94g38ljxl1.js +1 -0
  158. package/console/_next/static/chunks/3c_6owv8m4rta.js +90 -0
  159. package/console/_next/static/chunks/3ea2eo8b5gmju.js +2 -0
  160. package/console/_next/static/chunks/3ercnb2rksl_a.js +1 -0
  161. package/console/_next/static/chunks/3esxfmmm0ypxb.js +2 -0
  162. package/console/_next/static/chunks/3exiw74xbmika.js +1 -0
  163. package/console/_next/static/chunks/3f88-tc5u2heg.js +1 -0
  164. package/console/_next/static/chunks/3f_axahrombdp.js +1 -0
  165. package/console/_next/static/chunks/3gz91kn_v2lfa.js +1 -0
  166. package/console/_next/static/chunks/3i9z3x7tka5x2.js +1 -0
  167. package/console/_next/static/chunks/3ih4kfufd47st.js +1 -0
  168. package/console/_next/static/chunks/3itfi41ayfopd.js +15 -0
  169. package/console/_next/static/chunks/3iwgig-fgcscf.js +15 -0
  170. package/console/_next/static/chunks/3jf8qh1ev3gb4.js +2 -0
  171. package/console/_next/static/chunks/3l6svfyqdsq6o.js +1 -0
  172. package/console/_next/static/chunks/3lj0i-qlb4ah2.js +64 -0
  173. package/console/_next/static/chunks/3lmx6tkunfd3u.js +1 -0
  174. package/console/_next/static/chunks/3lp4d64he__am.js +152 -0
  175. package/console/_next/static/chunks/3m_jz3b2j38nn.js +1 -0
  176. package/console/_next/static/chunks/3oe9w1b39nzmn.js +3 -0
  177. package/console/_next/static/chunks/3on7r_d8o-kna.js +1 -0
  178. package/console/_next/static/chunks/3pbpowf3kdu5z.js +119 -0
  179. package/console/_next/static/chunks/3pwwv0u29nk8c.js +23 -0
  180. package/console/_next/static/chunks/3rweyye6o1z6b.js +79 -0
  181. package/console/_next/static/chunks/3sdqgrmvxm_u4.js +201 -0
  182. package/console/_next/static/chunks/3t3vbs-x5hixj.js +1 -0
  183. package/console/_next/static/chunks/3thqnz0a5zy-h.js +9 -0
  184. package/console/_next/static/chunks/3udubdawo7583.js +1 -0
  185. package/console/_next/static/chunks/3uz4lg6e199sb.js +1 -0
  186. package/console/_next/static/chunks/3v2mkz_46uei2.js +1 -0
  187. package/console/_next/static/chunks/3w5crjmhb-3um.js +1 -0
  188. package/console/_next/static/chunks/3waxhrmr_82j5.js +93 -0
  189. package/console/_next/static/chunks/3zmlzef_jxopu.js +1 -0
  190. package/console/_next/static/chunks/3zqvalj8nr-1y.js +1 -0
  191. package/console/_next/static/chunks/40igag4gq4k0a.js +77 -0
  192. package/console/_next/static/chunks/40wq034qcdji_.js +1 -0
  193. package/console/_next/static/chunks/44crhetqymq_e.js +34 -0
  194. package/console/_next/static/chunks/44q2pv6a3w19q.js +1 -0
  195. package/console/_next/static/chunks/turbopack-2u1d16houkiyo.js +1 -0
  196. package/console/_next/static/media/GeistMono_Variable-s.p.21mfa-4xv0w3g.woff2 +0 -0
  197. package/console/_next/static/media/Geist_Variable-s.p.217kyf1h_p0cg.woff2 +0 -0
  198. package/console/_next/static/media/IBMPlexMono_Medium-s.2v25u5rd2tsaf.woff2 +0 -0
  199. package/console/_next/static/media/IBMPlexMono_Regular-s.09u63wo58kris.woff2 +0 -0
  200. package/console/_next/static/media/IBMPlexSans_Bold-s.3iicodgz0epim.woff2 +0 -0
  201. package/console/_next/static/media/IBMPlexSans_Light-s.3ntejfdcyftfg.woff2 +0 -0
  202. package/console/_next/static/media/IBMPlexSans_Medium-s.3n25cgfiu6qss.woff2 +0 -0
  203. package/console/_next/static/media/IBMPlexSans_Regular-s.2e_-c_m03txvi.woff2 +0 -0
  204. package/console/_next/static/media/IBMPlexSans_SemiBold-s.2sutjpuns2xc5.woff2 +0 -0
  205. package/console/_next/static/media/Inter_Variable-s.2-lfiv6s83kzn.woff2 +0 -0
  206. package/console/_next/static/media/Nunito_Variable-s.3r4_r9s3kxd_-.woff2 +0 -0
  207. package/console/_not-found/__next._full.txt +73 -0
  208. package/console/_not-found/__next._index.txt +62 -0
  209. package/console/_not-found/__next._not-found.__PAGE__.txt +61 -0
  210. package/console/_not-found/__next._tree.txt +5 -0
  211. package/console/_not-found.html +1 -0
  212. package/console/_not-found.txt +73 -0
  213. package/console/apple-touch-icon-dark.png +0 -0
  214. package/console/apple-touch-icon-light.png +0 -0
  215. package/console/auth/callback/__next._full.txt +82 -0
  216. package/console/auth/callback/__next._index.txt +62 -0
  217. package/console/auth/callback/__next._tree.txt +8 -0
  218. package/console/auth/callback/__next.auth.callback.__PAGE__.txt +67 -0
  219. package/console/auth/callback.html +1 -0
  220. package/console/auth/callback.txt +82 -0
  221. package/console/auth/oauth/callback/__next._full.txt +84 -0
  222. package/console/auth/oauth/callback/__next._index.txt +62 -0
  223. package/console/auth/oauth/callback/__next._tree.txt +9 -0
  224. package/console/auth/oauth/callback/__next.auth.oauth.callback.__PAGE__.txt +69 -0
  225. package/console/auth/oauth/callback.html +1 -0
  226. package/console/auth/oauth/callback.txt +84 -0
  227. package/console/brand-avatar.png +0 -0
  228. package/console/chat/__placeholder__/__next._full.txt +80 -0
  229. package/console/chat/__placeholder__/__next._index.txt +62 -0
  230. package/console/chat/__placeholder__/__next._tree.txt +8 -0
  231. package/console/chat/__placeholder__/__next.chat.$d$channel.__PAGE__.txt +65 -0
  232. package/console/chat/__placeholder__.html +1 -0
  233. package/console/chat/__placeholder__.txt +80 -0
  234. package/console/connect/__placeholder__/__next._full.txt +79 -0
  235. package/console/connect/__placeholder__/__next._index.txt +62 -0
  236. package/console/connect/__placeholder__/__next._tree.txt +8 -0
  237. package/console/connect/__placeholder__/__next.connect.$d$token.__PAGE__.txt +64 -0
  238. package/console/connect/__placeholder__.html +1 -0
  239. package/console/connect/__placeholder__.txt +79 -0
  240. package/console/conversations/__next._full.txt +79 -0
  241. package/console/conversations/__next._index.txt +62 -0
  242. package/console/conversations/__next._tree.txt +7 -0
  243. package/console/conversations/__next.conversations.__PAGE__.txt +64 -0
  244. package/console/conversations/__placeholder__/__placeholder__/__next._full.txt +83 -0
  245. package/console/conversations/__placeholder__/__placeholder__/__next._index.txt +62 -0
  246. package/console/conversations/__placeholder__/__placeholder__/__next._tree.txt +9 -0
  247. package/console/conversations/__placeholder__/__placeholder__/__next.conversations.$d$channelId.$d$key.__PAGE__.txt +68 -0
  248. package/console/conversations/__placeholder__/__placeholder__.html +1 -0
  249. package/console/conversations/__placeholder__/__placeholder__.txt +83 -0
  250. package/console/conversations.html +1 -0
  251. package/console/conversations.txt +79 -0
  252. package/console/dashboard/__next._full.txt +77 -0
  253. package/console/dashboard/__next._index.txt +62 -0
  254. package/console/dashboard/__next._tree.txt +7 -0
  255. package/console/dashboard/__next.dashboard.__PAGE__.txt +62 -0
  256. package/console/dashboard.html +1 -0
  257. package/console/dashboard.txt +77 -0
  258. package/console/desktop/billing/__next._full.txt +82 -0
  259. package/console/desktop/billing/__next._index.txt +62 -0
  260. package/console/desktop/billing/__next._tree.txt +8 -0
  261. package/console/desktop/billing/__next.desktop.billing.__PAGE__.txt +67 -0
  262. package/console/desktop/billing.html +1 -0
  263. package/console/desktop/billing.txt +82 -0
  264. package/console/embed.js +1 -0
  265. package/console/favicon-dark-16x16.png +0 -0
  266. package/console/favicon-dark-32x32.png +0 -0
  267. package/console/favicon-dark.ico +0 -0
  268. package/console/favicon-dark.svg +1 -0
  269. package/console/favicon-light-16x16.png +0 -0
  270. package/console/favicon-light-32x32.png +0 -0
  271. package/console/favicon-light.ico +0 -0
  272. package/console/favicon-light.svg +1 -0
  273. package/console/index.html +1 -0
  274. package/console/index.txt +71 -0
  275. package/console/invite/__placeholder__/__next._full.txt +80 -0
  276. package/console/invite/__placeholder__/__next._index.txt +62 -0
  277. package/console/invite/__placeholder__/__next._tree.txt +8 -0
  278. package/console/invite/__placeholder__/__next.invite.$d$token.__PAGE__.txt +65 -0
  279. package/console/invite/__placeholder__.html +1 -0
  280. package/console/invite/__placeholder__.txt +80 -0
  281. package/console/library/__next._full.txt +89 -0
  282. package/console/library/__next._index.txt +62 -0
  283. package/console/library/__next._tree.txt +7 -0
  284. package/console/library/__next.library.__PAGE__.txt +74 -0
  285. package/console/library/agents/__next._full.txt +94 -0
  286. package/console/library/agents/__next._index.txt +62 -0
  287. package/console/library/agents/__next._tree.txt +8 -0
  288. package/console/library/agents/__next.library.agents.__PAGE__.txt +79 -0
  289. package/console/library/agents/__placeholder__/__placeholder__/__next._full.txt +96 -0
  290. package/console/library/agents/__placeholder__/__placeholder__/__next._index.txt +62 -0
  291. package/console/library/agents/__placeholder__/__placeholder__/__next._tree.txt +10 -0
  292. package/console/library/agents/__placeholder__/__placeholder__/__next.library.agents.$d$org.$d$slug.__PAGE__.txt +81 -0
  293. package/console/library/agents/__placeholder__/__placeholder__.html +1 -0
  294. package/console/library/agents/__placeholder__/__placeholder__.txt +96 -0
  295. package/console/library/agents/new/__next._full.txt +99 -0
  296. package/console/library/agents/new/__next._index.txt +62 -0
  297. package/console/library/agents/new/__next._tree.txt +9 -0
  298. package/console/library/agents/new/__next.library.agents.new.__PAGE__.txt +84 -0
  299. package/console/library/agents/new.html +1 -0
  300. package/console/library/agents/new.txt +99 -0
  301. package/console/library/agents.html +1 -0
  302. package/console/library/agents.txt +94 -0
  303. package/console/library/environments/__next._full.txt +95 -0
  304. package/console/library/environments/__next._index.txt +62 -0
  305. package/console/library/environments/__next._tree.txt +8 -0
  306. package/console/library/environments/__next.library.environments.__PAGE__.txt +80 -0
  307. package/console/library/environments/__placeholder__/__placeholder__/__next._full.txt +97 -0
  308. package/console/library/environments/__placeholder__/__placeholder__/__next._index.txt +62 -0
  309. package/console/library/environments/__placeholder__/__placeholder__/__next._tree.txt +10 -0
  310. package/console/library/environments/__placeholder__/__placeholder__/__next.library.environments.$d$org.$d$slug.__PAGE__.txt +82 -0
  311. package/console/library/environments/__placeholder__/__placeholder__.html +1 -0
  312. package/console/library/environments/__placeholder__/__placeholder__.txt +97 -0
  313. package/console/library/environments/new/__next._full.txt +99 -0
  314. package/console/library/environments/new/__next._index.txt +62 -0
  315. package/console/library/environments/new/__next._tree.txt +9 -0
  316. package/console/library/environments/new/__next.library.environments.new.__PAGE__.txt +84 -0
  317. package/console/library/environments/new.html +1 -0
  318. package/console/library/environments/new.txt +99 -0
  319. package/console/library/environments.html +1 -0
  320. package/console/library/environments.txt +95 -0
  321. package/console/library/files/__next._full.txt +94 -0
  322. package/console/library/files/__next._index.txt +62 -0
  323. package/console/library/files/__next._tree.txt +8 -0
  324. package/console/library/files/__next.library.files.__PAGE__.txt +79 -0
  325. package/console/library/files.html +1 -0
  326. package/console/library/files.txt +94 -0
  327. package/console/library/plugins/__next._full.txt +94 -0
  328. package/console/library/plugins/__next._index.txt +62 -0
  329. package/console/library/plugins/__next._tree.txt +8 -0
  330. package/console/library/plugins/__next.library.plugins.__PAGE__.txt +79 -0
  331. package/console/library/plugins/__placeholder__/__placeholder__/__next._full.txt +97 -0
  332. package/console/library/plugins/__placeholder__/__placeholder__/__next._index.txt +62 -0
  333. package/console/library/plugins/__placeholder__/__placeholder__/__next._tree.txt +10 -0
  334. package/console/library/plugins/__placeholder__/__placeholder__/__next.library.plugins.$d$org.$d$slug.__PAGE__.txt +82 -0
  335. package/console/library/plugins/__placeholder__/__placeholder__.html +1 -0
  336. package/console/library/plugins/__placeholder__/__placeholder__.txt +97 -0
  337. package/console/library/plugins/upload/__next._full.txt +99 -0
  338. package/console/library/plugins/upload/__next._index.txt +62 -0
  339. package/console/library/plugins/upload/__next._tree.txt +9 -0
  340. package/console/library/plugins/upload/__next.library.plugins.upload.__PAGE__.txt +84 -0
  341. package/console/library/plugins/upload.html +1 -0
  342. package/console/library/plugins/upload.txt +99 -0
  343. package/console/library/plugins.html +1 -0
  344. package/console/library/plugins.txt +94 -0
  345. package/console/library/routines/__next._full.txt +94 -0
  346. package/console/library/routines/__next._index.txt +62 -0
  347. package/console/library/routines/__next._tree.txt +8 -0
  348. package/console/library/routines/__next.library.routines.__PAGE__.txt +79 -0
  349. package/console/library/routines/__placeholder__/__placeholder__/__next._full.txt +97 -0
  350. package/console/library/routines/__placeholder__/__placeholder__/__next._index.txt +62 -0
  351. package/console/library/routines/__placeholder__/__placeholder__/__next._tree.txt +10 -0
  352. package/console/library/routines/__placeholder__/__placeholder__/__next.library.routines.$d$org.$d$slug.__PAGE__.txt +82 -0
  353. package/console/library/routines/__placeholder__/__placeholder__.html +1 -0
  354. package/console/library/routines/__placeholder__/__placeholder__.txt +97 -0
  355. package/console/library/routines/new/__next._full.txt +98 -0
  356. package/console/library/routines/new/__next._index.txt +62 -0
  357. package/console/library/routines/new/__next._tree.txt +9 -0
  358. package/console/library/routines/new/__next.library.routines.new.__PAGE__.txt +83 -0
  359. package/console/library/routines/new.html +1 -0
  360. package/console/library/routines/new.txt +98 -0
  361. package/console/library/routines.html +1 -0
  362. package/console/library/routines.txt +94 -0
  363. package/console/library/skills/__next._full.txt +94 -0
  364. package/console/library/skills/__next._index.txt +62 -0
  365. package/console/library/skills/__next._tree.txt +8 -0
  366. package/console/library/skills/__next.library.skills.__PAGE__.txt +79 -0
  367. package/console/library/skills/__placeholder__/__placeholder__/__next._full.txt +96 -0
  368. package/console/library/skills/__placeholder__/__placeholder__/__next._index.txt +62 -0
  369. package/console/library/skills/__placeholder__/__placeholder__/__next._tree.txt +10 -0
  370. package/console/library/skills/__placeholder__/__placeholder__/__next.library.skills.$d$org.$d$slug.__PAGE__.txt +81 -0
  371. package/console/library/skills/__placeholder__/__placeholder__.html +1 -0
  372. package/console/library/skills/__placeholder__/__placeholder__.txt +96 -0
  373. package/console/library/skills/new/__next._full.txt +98 -0
  374. package/console/library/skills/new/__next._index.txt +62 -0
  375. package/console/library/skills/new/__next._tree.txt +9 -0
  376. package/console/library/skills/new/__next.library.skills.new.__PAGE__.txt +83 -0
  377. package/console/library/skills/new.html +1 -0
  378. package/console/library/skills/new.txt +98 -0
  379. package/console/library/skills.html +1 -0
  380. package/console/library/skills.txt +94 -0
  381. package/console/library.html +1 -0
  382. package/console/library.txt +89 -0
  383. package/console/login/__next._full.txt +81 -0
  384. package/console/login/__next._index.txt +62 -0
  385. package/console/login/__next._tree.txt +7 -0
  386. package/console/login/__next.login.__PAGE__.txt +66 -0
  387. package/console/login.html +1 -0
  388. package/console/login.txt +81 -0
  389. package/console/marketplace/__next._full.txt +81 -0
  390. package/console/marketplace/__next._index.txt +62 -0
  391. package/console/marketplace/__next._tree.txt +7 -0
  392. package/console/marketplace/__next.marketplace.__PAGE__.txt +66 -0
  393. package/console/marketplace.html +1 -0
  394. package/console/marketplace.txt +81 -0
  395. package/console/models/__next._full.txt +77 -0
  396. package/console/models/__next._index.txt +62 -0
  397. package/console/models/__next._tree.txt +7 -0
  398. package/console/models/__next.models.__PAGE__.txt +62 -0
  399. package/console/models.html +1 -0
  400. package/console/models.txt +77 -0
  401. package/console/oauth/slack/callback/__next._full.txt +84 -0
  402. package/console/oauth/slack/callback/__next._index.txt +62 -0
  403. package/console/oauth/slack/callback/__next._tree.txt +9 -0
  404. package/console/oauth/slack/callback/__next.oauth.slack.callback.__PAGE__.txt +69 -0
  405. package/console/oauth/slack/callback.html +1 -0
  406. package/console/oauth/slack/callback.txt +84 -0
  407. package/console/runs/__placeholder__/__next._full.txt +77 -0
  408. package/console/runs/__placeholder__/__next._index.txt +62 -0
  409. package/console/runs/__placeholder__/__next._tree.txt +8 -0
  410. package/console/runs/__placeholder__/__next.runs.$d$id.__PAGE__.txt +62 -0
  411. package/console/runs/__placeholder__.html +1 -0
  412. package/console/runs/__placeholder__.txt +77 -0
  413. package/console/sessions/__placeholder__/__next._full.txt +77 -0
  414. package/console/sessions/__placeholder__/__next._index.txt +62 -0
  415. package/console/sessions/__placeholder__/__next._tree.txt +8 -0
  416. package/console/sessions/__placeholder__/__next.sessions.$d$id.__PAGE__.txt +62 -0
  417. package/console/sessions/__placeholder__.html +1 -0
  418. package/console/sessions/__placeholder__.txt +77 -0
  419. package/console/settings/__next._full.txt +85 -0
  420. package/console/settings/__next._index.txt +62 -0
  421. package/console/settings/__next._tree.txt +7 -0
  422. package/console/settings/__next.settings.__PAGE__.txt +70 -0
  423. package/console/settings/access-history/__next._full.txt +87 -0
  424. package/console/settings/access-history/__next._index.txt +62 -0
  425. package/console/settings/access-history/__next._tree.txt +8 -0
  426. package/console/settings/access-history/__next.settings.access-history.__PAGE__.txt +72 -0
  427. package/console/settings/access-history.html +1 -0
  428. package/console/settings/access-history.txt +87 -0
  429. package/console/settings/account-preferences/__next._full.txt +87 -0
  430. package/console/settings/account-preferences/__next._index.txt +62 -0
  431. package/console/settings/account-preferences/__next._tree.txt +8 -0
  432. package/console/settings/account-preferences/__next.settings.account-preferences.__PAGE__.txt +72 -0
  433. package/console/settings/account-preferences.html +1 -0
  434. package/console/settings/account-preferences.txt +87 -0
  435. package/console/settings/api-keys/__next._full.txt +86 -0
  436. package/console/settings/api-keys/__next._index.txt +62 -0
  437. package/console/settings/api-keys/__next._tree.txt +8 -0
  438. package/console/settings/api-keys/__next.settings.api-keys.__PAGE__.txt +71 -0
  439. package/console/settings/api-keys.html +1 -0
  440. package/console/settings/api-keys.txt +86 -0
  441. package/console/settings/billing/__next._full.txt +89 -0
  442. package/console/settings/billing/__next._index.txt +62 -0
  443. package/console/settings/billing/__next._tree.txt +8 -0
  444. package/console/settings/billing/__next.settings.billing.__PAGE__.txt +74 -0
  445. package/console/settings/billing.html +1 -0
  446. package/console/settings/billing.txt +89 -0
  447. package/console/settings/channel-apps/__next._full.txt +87 -0
  448. package/console/settings/channel-apps/__next._index.txt +62 -0
  449. package/console/settings/channel-apps/__next._tree.txt +8 -0
  450. package/console/settings/channel-apps/__next.settings.channel-apps.__PAGE__.txt +72 -0
  451. package/console/settings/channel-apps.html +1 -0
  452. package/console/settings/channel-apps.txt +87 -0
  453. package/console/settings/federation-issuers/__next._full.txt +88 -0
  454. package/console/settings/federation-issuers/__next._index.txt +62 -0
  455. package/console/settings/federation-issuers/__next._tree.txt +8 -0
  456. package/console/settings/federation-issuers/__next.settings.federation-issuers.__PAGE__.txt +73 -0
  457. package/console/settings/federation-issuers.html +1 -0
  458. package/console/settings/federation-issuers.txt +88 -0
  459. package/console/settings/invitations/__next._full.txt +87 -0
  460. package/console/settings/invitations/__next._index.txt +62 -0
  461. package/console/settings/invitations/__next._tree.txt +8 -0
  462. package/console/settings/invitations/__next.settings.invitations.__PAGE__.txt +72 -0
  463. package/console/settings/invitations.html +1 -0
  464. package/console/settings/invitations.txt +87 -0
  465. package/console/settings/licenses/__next._full.txt +90 -0
  466. package/console/settings/licenses/__next._index.txt +62 -0
  467. package/console/settings/licenses/__next._tree.txt +8 -0
  468. package/console/settings/licenses/__next.settings.licenses.__PAGE__.txt +75 -0
  469. package/console/settings/licenses.html +1 -0
  470. package/console/settings/licenses.txt +90 -0
  471. package/console/settings/members/__next._full.txt +86 -0
  472. package/console/settings/members/__next._index.txt +62 -0
  473. package/console/settings/members/__next._tree.txt +8 -0
  474. package/console/settings/members/__next.settings.members.__PAGE__.txt +71 -0
  475. package/console/settings/members.html +1 -0
  476. package/console/settings/members.txt +86 -0
  477. package/console/settings/memory/__next._full.txt +86 -0
  478. package/console/settings/memory/__next._index.txt +62 -0
  479. package/console/settings/memory/__next._tree.txt +8 -0
  480. package/console/settings/memory/__next.settings.memory.__PAGE__.txt +71 -0
  481. package/console/settings/memory.html +1 -0
  482. package/console/settings/memory.txt +86 -0
  483. package/console/settings/model-catalog/__next._full.txt +89 -0
  484. package/console/settings/model-catalog/__next._index.txt +62 -0
  485. package/console/settings/model-catalog/__next._tree.txt +8 -0
  486. package/console/settings/model-catalog/__next.settings.model-catalog.__PAGE__.txt +74 -0
  487. package/console/settings/model-catalog.html +1 -0
  488. package/console/settings/model-catalog.txt +89 -0
  489. package/console/settings/notifications/__next._full.txt +89 -0
  490. package/console/settings/notifications/__next._index.txt +62 -0
  491. package/console/settings/notifications/__next._tree.txt +8 -0
  492. package/console/settings/notifications/__next.settings.notifications.__PAGE__.txt +74 -0
  493. package/console/settings/notifications.html +1 -0
  494. package/console/settings/notifications.txt +89 -0
  495. package/console/settings/oauth-apps/__next._full.txt +87 -0
  496. package/console/settings/oauth-apps/__next._index.txt +62 -0
  497. package/console/settings/oauth-apps/__next._tree.txt +8 -0
  498. package/console/settings/oauth-apps/__next.settings.oauth-apps.__PAGE__.txt +72 -0
  499. package/console/settings/oauth-apps.html +1 -0
  500. package/console/settings/oauth-apps.txt +87 -0
  501. package/console/settings/org-embedding/__next._full.txt +87 -0
  502. package/console/settings/org-embedding/__next._index.txt +62 -0
  503. package/console/settings/org-embedding/__next._tree.txt +8 -0
  504. package/console/settings/org-embedding/__next.settings.org-embedding.__PAGE__.txt +72 -0
  505. package/console/settings/org-embedding.html +1 -0
  506. package/console/settings/org-embedding.txt +87 -0
  507. package/console/settings/org-policies/__next._full.txt +87 -0
  508. package/console/settings/org-policies/__next._index.txt +62 -0
  509. package/console/settings/org-policies/__next._tree.txt +8 -0
  510. package/console/settings/org-policies/__next.settings.org-policies.__PAGE__.txt +72 -0
  511. package/console/settings/org-policies.html +1 -0
  512. package/console/settings/org-policies.txt +87 -0
  513. package/console/settings/org-preferences/__next._full.txt +87 -0
  514. package/console/settings/org-preferences/__next._index.txt +62 -0
  515. package/console/settings/org-preferences/__next._tree.txt +8 -0
  516. package/console/settings/org-preferences/__next.settings.org-preferences.__PAGE__.txt +72 -0
  517. package/console/settings/org-preferences.html +1 -0
  518. package/console/settings/org-preferences.txt +87 -0
  519. package/console/settings/org-profile/__next._full.txt +89 -0
  520. package/console/settings/org-profile/__next._index.txt +62 -0
  521. package/console/settings/org-profile/__next._tree.txt +8 -0
  522. package/console/settings/org-profile/__next.settings.org-profile.__PAGE__.txt +74 -0
  523. package/console/settings/org-profile.html +1 -0
  524. package/console/settings/org-profile.txt +89 -0
  525. package/console/settings/plans/__next._full.txt +89 -0
  526. package/console/settings/plans/__next._index.txt +62 -0
  527. package/console/settings/plans/__next._tree.txt +8 -0
  528. package/console/settings/plans/__next.settings.plans.__PAGE__.txt +74 -0
  529. package/console/settings/plans.html +1 -0
  530. package/console/settings/plans.txt +89 -0
  531. package/console/settings/service-accounts/__next._full.txt +87 -0
  532. package/console/settings/service-accounts/__next._index.txt +62 -0
  533. package/console/settings/service-accounts/__next._tree.txt +8 -0
  534. package/console/settings/service-accounts/__next.settings.service-accounts.__PAGE__.txt +72 -0
  535. package/console/settings/service-accounts.html +1 -0
  536. package/console/settings/service-accounts.txt +87 -0
  537. package/console/settings/teams/__next._full.txt +86 -0
  538. package/console/settings/teams/__next._index.txt +62 -0
  539. package/console/settings/teams/__next._tree.txt +8 -0
  540. package/console/settings/teams/__next.settings.teams.__PAGE__.txt +71 -0
  541. package/console/settings/teams.html +1 -0
  542. package/console/settings/teams.txt +86 -0
  543. package/console/settings/usage/__next._full.txt +86 -0
  544. package/console/settings/usage/__next._index.txt +62 -0
  545. package/console/settings/usage/__next._tree.txt +8 -0
  546. package/console/settings/usage/__next.settings.usage.__PAGE__.txt +71 -0
  547. package/console/settings/usage.html +1 -0
  548. package/console/settings/usage.txt +86 -0
  549. package/console/settings/vaults/__next._full.txt +86 -0
  550. package/console/settings/vaults/__next._index.txt +62 -0
  551. package/console/settings/vaults/__next._tree.txt +8 -0
  552. package/console/settings/vaults/__next.settings.vaults.__PAGE__.txt +71 -0
  553. package/console/settings/vaults.html +1 -0
  554. package/console/settings/vaults.txt +86 -0
  555. package/console/settings.html +1 -0
  556. package/console/settings.txt +85 -0
  557. package/main.js +1656 -0
  558. package/mappings.wasm +0 -0
  559. package/package.json +25 -0
  560. package/workflow-bundle-agent-execution.js +29297 -0
  561. package/workflow-bundle-evals.js +11997 -0
  562. package/workflow-bundle-grading.js +11155 -0
  563. package/workflow-bundle-routine.js +11300 -0
  564. package/workflow-worker-thread.cjs +111 -0
@@ -0,0 +1,2 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,774043,e=>{"use strict";e.s(["f",0,"This permanently removes the agent. Past sessions and runs are preserved, but conversations on it cannot continue. This action cannot be undone."])},664659,e=>{"use strict";let t=(0,e.i(475254).f)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);e.s(["f",0,t],664659)},541071,e=>{"use strict";let t=(0,e.i(475254).f)("ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);e.s(["f",0,t],541071)},778917,727612,e=>{"use strict";var t=e.i(475254);let s=(0,t.f)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);e.s(["f",0,s],778917);let r=(0,t.f)("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);e.s(["f",0,r],727612)},862749,e=>{"use strict";let t=(0,e.i(475254).f)("file-code-corner",[["path",{d:"M4 12.15V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-3.35",key:"1wthlu"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m5 16-3 3 3 3",key:"331omg"}],["path",{d:"m9 22 3-3-3-3",key:"lsp7cz"}]]);e.s(["f",0,t],862749)},385663,928240,182990,e=>{"use strict";let t=(0,e.i(475254).f)("layout-template",[["rect",{width:"18",height:"7",x:"3",y:"3",rx:"1",key:"f1a2em"}],["rect",{width:"9",height:"7",x:"3",y:"14",rx:"1",key:"jqznyg"}],["rect",{width:"5",height:"7",x:"16",y:"14",rx:"1",key:"q5h2i8"}]]);e.s(["f",0,t],385663);let s=/\{\{\s*[A-Za-z0-9_]+\s*\}\}/g;e.s(["B",0,function(e){let t=[],r=0;for(let n of e.matchAll(s))n.index>r&&t.push({kind:"text",value:e.slice(r,n.index)}),t.push({kind:"placeholder",value:n[0]}),r=n.index+n[0].length;return r<e.length&&t.push({kind:"text",value:e.slice(r)}),t},"p",0,function(e){switch(e){case"APPROVED":return"ready";case"PENDING":case"IN_APPEAL":return"pending";case"PAUSED":case"LIMIT_EXCEEDED":return"degraded";case"REJECTED":case"DISABLED":return"failed";case"PENDING_DELETION":case"DELETED":return"disabled";default:return"draft"}}],928240);var r=e.i(651023),n=e.i(891287),i=e.i(330428),a=e.i(255817),l=e.i(616701);e.s(["f",0,function(e,t,s){let g=(0,a.f)(),o=s?.approvedOnly??!1,[d,c]=(0,r.useState)(!1),u=e&&t?async()=>(await g.channel.listTemplates((0,n.f)(i.R,{channel:e,org:t,approvedOnly:o}))).entries:null,{data:m,isLoading:x,isRefetching:f,error:h,refetch:p}=(0,l.f)(u,[e,t,o,g],[],{refetchInterval:d}),v=m.some(e=>"PENDING"===e.status);return(0,r.useEffect)(()=>{c(!!v&&6e4)},[v]),{templates:m,isLoading:x,isRefetching:f,error:h,refetch:p}}],182990)},618393,e=>{"use strict";let t=(0,e.i(475254).f)("server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);e.s(["f",0,t],618393)},484763,927056,e=>{"use strict";var t=e.i(974265),s=e.i(651023),r=e.i(803874),n=e.i(213149);e.s(["f",0,function({resource:e,visibility:i,label:a="Manage access"}){let[l,g]=(0,s.useState)(!1),{allowed:o}=(0,r.f)(e?{kind:e.kindString,id:e.id}:null,"can_view_access"),d=(0,s.useCallback)(()=>g(!0),[]);return{action:e&&o?{id:"manage-access",label:a,group:"sharing",onAction:d}:null,dialog:e?(0,t.jsx)(n.f,{open:l,onOpenChange:g,resource:e,visibility:i}):null,open:d,isOpen:l}}],484763);var i=e.i(893976);e.s(["f",0,function({tabs:e,activeTab:r,onTabChange:n,children:a,"aria-label":l,className:g}){let o=(0,s.useId)(),d=(0,s.useRef)(new Map),c=e=>`${o}-tab-${e}`,u=e=>`${o}-panel-${e}`,m=(0,s.useCallback)(e=>{d.current.get(e)?.focus(),n(e)},[n]),x=(0,s.useCallback)(t=>{let s=e.findIndex(e=>e.id===r);if(-1===s)return;let n=null;switch(t.key){case"ArrowRight":n=(s+1)%e.length;break;case"ArrowLeft":n=(s-1+e.length)%e.length;break;case"Home":n=0;break;case"End":n=e.length-1;break;default:return}t.preventDefault(),m(e[n].id)},[e,r,m]);return(0,t.jsxs)("div",{className:(0,i.f)("stg:flex stg:flex-col",g),children:[(0,t.jsx)("div",{role:"tablist","aria-label":l,onKeyDown:x,className:"stg:flex stg:border-b stg:border-border",children:e.map(e=>{let s=e.id===r;return(0,t.jsxs)("button",{ref:t=>{t?d.current.set(e.id,t):d.current.delete(e.id)},id:c(e.id),role:"tab",type:"button","aria-selected":s,"aria-controls":u(e.id),tabIndex:s?0:-1,onClick:()=>n(e.id),"data-cursor-target":`tab-${e.id}`,className:(0,i.f)("stg:relative stg:inline-flex stg:items-center stg:gap-1.5 stg:px-3 stg:py-2 stg:text-xs stg:font-medium stg:transition-colors","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring stg:focus-visible:ring-offset-1",s?"stg:text-foreground":"stg:text-muted-foreground stg:hover:text-foreground"),children:[e.icon,e.label,null!=e.badge&&e.badge>0&&(0,t.jsx)("span",{"aria-hidden":"true",className:(0,i.f)("stg:inline-flex stg:min-w-[1.25rem] stg:items-center stg:justify-center stg:rounded-full stg:px-1 stg:py-px stg:text-2xs stg:font-medium stg:leading-none",s?"stg:bg-primary-subtle stg:text-primary":"stg:bg-muted stg:text-muted-foreground"),children:e.badgeIsLowerBound?`${e.badge}+`:e.badge}),s&&(0,t.jsx)("span",{className:"stg:absolute stg:inset-x-0 stg:-bottom-px stg:h-0.5 stg:bg-primary","aria-hidden":"true"})]},e.id)})}),(0,t.jsx)("div",{id:u(r),role:"tabpanel","aria-labelledby":c(r),tabIndex:0,className:"stg:min-h-0 stg:flex-1 stg:pt-4 stg:focus-visible:outline-none",children:a})]})}],927056)},773624,188546,39285,e=>{"use strict";var t=e.i(974265),s=e.i(651023),r=e.i(893976),n=e.i(65642),i=e.i(231666);function a({className:e}){return(0,t.jsxs)("svg",{className:e,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,t.jsx)("rect",{x:"2.5",y:"2.5",width:"11",height:"4.5",rx:"1"}),(0,t.jsx)("rect",{x:"2.5",y:"9",width:"11",height:"4.5",rx:"1"}),(0,t.jsx)("path",{d:"M5 4.75h.01M5 11.25h.01",strokeWidth:"2"})]})}e.s(["f",0,a],188546);var l=e.i(346298),g=e.i(859448);let o=new Set(["stigmer-channels","stigmer-conversation","stigmer-memory"]),d=/^[a-z][a-z0-9-]*[a-z0-9]$/,c=/^(?:[A-Za-z]+\s+)?\$\{[A-Za-z_][A-Za-z0-9_]*\}(?:[\s:/-]*\$\{[A-Za-z_][A-Za-z0-9_]*\})*$/;function u(e){return c.test(e.trim())?e:"set"}function m(e,t){let s=e.name;if(""===s)return"Give the server a name.";if(!d.test(s))return"A name is lowercase letters, digits and hyphens, starts with a letter, and ends with a letter or digit.";if(o.has(s)||s.startsWith("stigmer")||"plugin"===s)return"Names starting with stigmer are the platform's, and plugin names a plugin's servers. Choose another name.";if(t.includes(s))return`This agent already has a server named ${s}. Give each server its own name.`;let r=e.url;if(""===r)return"Give the server's URL.";if(r.includes("${"))return"The URL cannot name a variable: where a run dials is fixed when the agent is saved, so write it out.";if(!(0,g.t)(r))return"The URL must be https (or http on this machine), with no user name, password or #fragment in it.";let n=new Set;for(let[t,s]of e.headers){if(""===t.trim())return""===s.trim()?"Remove the empty header, or give it a name.":"Give every header a name.";let e=t.toLowerCase();if(n.has(e))return`The header ${t} is named more than once.`;n.add(e)}return null}function x({server:e,status:s,canEdit:i,isSaving:l,onEdit:g,onRemove:o}){let d=Object.entries(e.headers);return(0,t.jsxs)("li",{className:"stg:flex stg:flex-col stg:gap-1 stg:px-3 stg:py-2",children:[(0,t.jsxs)("div",{className:"stg:flex stg:flex-wrap stg:items-center stg:gap-x-3 stg:gap-y-1",children:[(0,t.jsxs)("span",{className:"stg:flex stg:min-w-0 stg:items-center stg:gap-3",children:[(0,t.jsx)(a,{className:"stg:size-4 stg:shrink-0 stg:text-muted-foreground"}),(0,t.jsx)("span",{className:"stg:truncate stg:text-sm stg:font-medium stg:text-foreground",children:e.name})]}),(0,t.jsxs)("span",{className:"stg:ml-auto stg:flex stg:min-w-0 stg:items-center stg:gap-2",children:[s,i&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.f,{type:"button",variant:"ghost",size:"xs",onClick:g,disabled:l,"aria-label":`Change ${e.name}`,children:"Change"}),(0,t.jsx)("button",{type:"button",onClick:o,disabled:l,"aria-label":`Remove ${e.name}`,className:(0,r.f)("stg:inline-flex stg:size-6 stg:items-center stg:justify-center stg:rounded-md stg:text-muted-foreground","stg:hover:bg-destructive-subtle stg:hover:text-destructive","stg:disabled:opacity-50","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring"),children:(0,t.jsx)(p,{className:"stg:size-3.5"})})]})]})]}),(0,t.jsx)("p",{className:"stg:break-all stg:pl-7 stg:font-mono stg:text-xs stg:text-muted-foreground",children:e.url}),d.length>0&&(0,t.jsx)("dl",{className:"stg:m-0 stg:flex stg:flex-col stg:gap-0.5 stg:pl-7 stg:text-xs","aria-label":`Headers ${e.name} is sent with`,children:d.map(([e,s])=>(0,t.jsxs)("div",{className:"stg:flex stg:min-w-0 stg:gap-2",children:[(0,t.jsx)("dt",{className:"stg:shrink-0 stg:font-mono stg:text-foreground",children:e}),(0,t.jsx)("dd",{className:"stg:m-0 stg:min-w-0 stg:break-all stg:font-mono stg:text-muted-foreground",children:u(s)})]},e))})]})}function f({initial:e,others:r,isSaving:a,submitLabel:g,onSubmit:o,onCancel:d}){let c=(0,s.useId)(),[u,x]=(0,s.useState)(e?.name??""),[h,p]=(0,s.useState)(e?.url??""),[v,b]=(0,s.useState)(()=>(0,l.n)(e?.headers??{})),[y,j]=(0,s.useState)(null);return(0,t.jsxs)("div",{role:"group","aria-label":e?`Change ${e.name}`:"New MCP server",className:"stg:flex stg:flex-col stg:gap-3",children:[(0,t.jsxs)("div",{className:"stg:space-y-1",children:[(0,t.jsx)("label",{htmlFor:`${c}-name`,className:"stg:text-xs stg:font-medium stg:text-foreground",children:"Name"}),(0,t.jsx)("input",{id:`${c}-name`,value:u,onChange:e=>x(e.target.value),placeholder:"ledger",autoComplete:"off",spellCheck:!1,disabled:a,className:i.c}),(0,t.jsxs)("p",{className:"stg:text-xs stg:text-muted-foreground",children:["Lowercase letters, digits and hyphens. Its tools are named ",(0,t.jsx)("code",{className:"stg:font-mono",children:"mcp__<name>__<tool>"}),"."]})]}),(0,t.jsxs)("div",{className:"stg:space-y-1",children:[(0,t.jsx)("label",{htmlFor:`${c}-url`,className:"stg:text-xs stg:font-medium stg:text-foreground",children:"URL"}),(0,t.jsx)("input",{id:`${c}-url`,type:"url",value:h,onChange:e=>p(e.target.value),placeholder:"https://ledger.acme-books.example/mcp",autoComplete:"off",spellCheck:!1,disabled:a,className:i.c})]}),(0,t.jsx)(l.I,{rows:v,onChange:b,disabled:a}),null!==y&&(0,t.jsx)("p",{role:"alert",className:"stg:text-xs stg:text-destructive",children:y}),(0,t.jsxs)("div",{className:"stg:flex stg:justify-end stg:gap-2",children:[(0,t.jsx)(n.f,{type:"button",variant:"outline",size:"xs",onClick:d,disabled:a,children:"Cancel"}),(0,t.jsx)(n.f,{type:"button",variant:"primary",size:"xs",onClick:()=>{let e=v.map(e=>[e.key.trim(),e.value]),t={name:u.trim(),url:h.trim(),headers:e},s=m(t,r);j(s),null===s&&o({...t,headers:Object.fromEntries(e)})},disabled:a,children:a?"Saving…":g})]})]})}function h({className:e}){return(0,t.jsx)("svg",{className:e,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M8 3v10M3 8h10"})})}function p({className:e}){return(0,t.jsx)("svg",{className:e,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,t.jsx)("path",{d:"m4 4 8 8M12 4l-8 8"})})}e.s(["q",0,m,"a",0,function(e){return{name:e.name,url:e.url,headers:{...e.headers}}},"w",0,u],39285),e.s(["f",0,function({servers:e,editing:n,isSaving:i,onChange:a,renderStatus:l,emptyText:g}){let[o,d]=(0,s.useState)(null),c=n?o:null,u=(0,s.useCallback)(async e=>{await a(e)&&d(null)},[a]);return(0,t.jsxs)("div",{className:"stg:flex stg:flex-col",children:[e.length>0?(0,t.jsx)("ul",{className:"stg:m-0 stg:flex stg:list-none stg:flex-col stg:divide-y stg:divide-border stg:p-0","aria-label":"MCP servers",children:e.map((s,r)=>c===r?(0,t.jsx)("li",{className:"stg:px-3 stg:py-3",children:(0,t.jsx)(f,{initial:s,others:e.filter((e,t)=>t!==r).map(e=>e.name),isSaving:i,submitLabel:"Save",onSubmit:t=>u(e.map((e,s)=>s===r?t:e)),onCancel:()=>d(null)})},s.name):(0,t.jsx)(x,{server:s,status:l?.(s),canEdit:n&&null===c,isSaving:i,onEdit:()=>d(r),onRemove:()=>void u(e.filter((e,t)=>t!==r))},s.name))}):(0,t.jsx)("p",{className:"stg:px-3 stg:py-3 stg:text-xs stg:text-muted-foreground stg:italic",children:g}),n&&(0,t.jsx)("div",{className:"stg:border-t stg:border-border stg:px-3 stg:py-2",children:"new"===c?(0,t.jsx)(f,{others:e.map(e=>e.name),isSaving:i,submitLabel:"Add",onSubmit:t=>u([...e,t]),onCancel:()=>d(null)}):null===c&&(0,t.jsxs)("button",{type:"button",onClick:()=>d("new"),className:(0,r.f)("stg:inline-flex stg:items-center stg:gap-1 stg:rounded-md stg:px-2.5 stg:py-1.5 stg:text-xs stg:font-medium","stg:border stg:border-dashed stg:border-border stg:text-muted-foreground","stg:hover:border-muted-foreground stg:hover:text-foreground stg:hover:bg-muted-subtle","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring","stg:transition-colors"),children:[(0,t.jsx)(h,{className:"stg:size-3"}),"Add MCP server"]})})]})}],773624)},699187,e=>{"use strict";var t=e.i(891287),s=e.i(109623),r=e.i(255817),n=e.i(766330),i=e.i(205413),a=e.i(616701);e.s(["f",0,function(e){let l=(0,r.f)(),{data:g,isLoading:o,isRefetching:d,error:c,refetch:u}=(0,a.f)(e?()=>(0,i.T)(r=>l.channelapp.list((0,t.f)(s.k,{org:e,pageSize:n.J,pageToken:r}))):null,[e,l],[]);return{channelApps:g,isLoading:o,isRefetching:d,error:c,refetch:u}}])},543727,914118,582688,e=>{"use strict";var t=e.i(974265);function s({className:e}){return(0,t.jsx)("svg",{className:e,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M5.04 15.17a2.52 2.52 0 1 1-2.52-2.52h2.52v2.52zM6.31 15.17a2.52 2.52 0 0 1 5.04 0v6.31a2.52 2.52 0 1 1-5.04 0v-6.31zM8.83 5.04a2.52 2.52 0 1 1 2.52-2.52v2.52H8.83zM8.83 6.31a2.52 2.52 0 0 1 0 5.04H2.52a2.52 2.52 0 1 1 0-5.04h6.31zM18.96 8.83a2.52 2.52 0 1 1 2.52 2.52h-2.52V8.83zM17.69 8.83a2.52 2.52 0 0 1-5.04 0V2.52a2.52 2.52 0 1 1 5.04 0v6.31zM15.17 18.96a2.52 2.52 0 1 1-2.52 2.52v-2.52h2.52zM15.17 17.69a2.52 2.52 0 0 1 0-5.04h6.31a2.52 2.52 0 1 1 0 5.04h-6.31z"})})}function r({className:e}){return(0,t.jsx)("svg",{className:e,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 0 1-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 0 1-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 0 1 2.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0 0 12.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 0 0 5.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 0 0-3.48-8.413Z"})})}e.s(["f",0,s],914118),e.s(["f",0,r],582688);let n=[{id:"slack",label:"Slack",Icon:s,installStyle:"redirect",supportsMessageTemplates:!1,supportsStaffReplies:!1,timelineIncludesCustomerMessages:!1},{id:"whatsapp",label:"WhatsApp",Icon:r,installStyle:"direct",supportsMessageTemplates:!0,supportsStaffReplies:!0,timelineIncludesCustomerMessages:!0}];e.s(["V",0,n,"P",0,function(e){return"cloud"===e},"T",0,function(e){return n.find(t=>t.id===e)??null}],543727)},752930,e=>{"use strict";var t=e.i(891287),s=e.i(500343),r=e.i(255817),n=e.i(766330),i=e.i(616701);e.s(["f",0,function(e){let a=(0,r.f)(),l=e?()=>(0,n.a)(r=>a.channel.list((0,t.f)(s.G,{org:e,pageSize:n.J,pageToken:r}))):null,{data:g,isLoading:o,isRefetching:d,error:c,refetch:u}=(0,i.f)(l,[e,a],[]);return{channels:g,isLoading:o,isRefetching:d,error:c,refetch:u}}])},311015,e=>{"use strict";var t=e.i(974265),s=e.i(893976),r=e.i(65642),n=e.i(651023),i=e.i(475254);let a=(0,i.f)("package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]),l=(0,i.f)("search-x",[["path",{d:"m13.5 8.5-5 5",key:"1cs55j"}],["path",{d:"m8.5 8.5 5 5",key:"a8mexj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]),g=(0,i.f)("lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);var o=e.i(63209);let d="stg:h-10 stg:w-10";e.s(["f",0,function({variant:e,resourceLabel:i,icon:c,title:u,description:m,errorMessage:x,action:f,children:h,className:p}){let v=function(e){let{variant:t,resourceLabel:s="resources",title:r,description:i,errorMessage:c}=e;return(0,n.useMemo)(()=>{let e=function(e,t){switch(e){case"first-use":return{title:`No ${t} yet`,description:`Create ${"agents"===t?"an agent":`a ${t.replace(/s$/,"")}`} to get started.`};case"zero-results":return{title:"No results found",description:"Try adjusting your search or filters."};case"permission":return{title:`No access to ${t}`,description:"You don't have permission to view these resources. Contact your organization admin."};case"error":return{title:"Something went wrong",description:"We couldn't load this content. Please try again."}}}(t,s);return{title:r??e.title,description:"error"===t&&c?c:i??e.description,defaultIcon:function(e){switch(e){case"first-use":return(0,n.createElement)(a,{className:d});case"zero-results":return(0,n.createElement)(l,{className:d});case"permission":return(0,n.createElement)(g,{className:d});case"error":return(0,n.createElement)(o.f,{className:d})}}(t),role:"error"===t?"alert":"status"}},[t,s,r,i,c])}({variant:e,resourceLabel:i,title:u,description:m,errorMessage:x});return(0,t.jsxs)("div",{role:v.role,className:(0,s.f)("stg:flex stg:flex-col stg:items-center stg:gap-3 stg:py-12 stg:text-center",p),children:[(0,t.jsx)("div",{className:"stg:text-muted-foreground-faint",children:c??v.defaultIcon}),(0,t.jsxs)("div",{className:"stg:flex stg:flex-col stg:gap-1",children:[(0,t.jsx)("p",{className:"stg:m-0 stg:text-sm stg:font-medium stg:text-muted-foreground",children:v.title}),(0,t.jsx)("p",{className:"stg:m-0 stg:max-w-sm stg:text-xs stg:text-muted-foreground",children:v.description})]}),h?(0,t.jsx)("div",{className:"stg:mt-1",children:h}):f&&(0,t.jsx)(r.f,{variant:"error"===e?"outline":"primary",icon:f.icon,onClick:f.onClick,className:"stg:mt-1",children:f.label})]})}],311015)},476007,e=>{"use strict";var t=e.i(974265),s=e.i(651023),r=e.i(610595),n=e.i(893976);let i={auth:"Authentication required",permission:"Access denied","not-found":"Not found",validation:"Invalid request",server:"Server error",unavailable:"Service unavailable",cancelled:"Request cancelled",unknown:"Something went wrong"};function a({className:e}){return(0,t.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:e,"aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M7.13 2.5a1 1 0 0 1 1.74 0l5.5 9.5A1 1 0 0 1 13.5 13.5h-11a1 1 0 0 1-.87-1.5l5.5-9.5z"}),(0,t.jsx)("path",{d:"M8 6v3"}),(0,t.jsx)("circle",{cx:"8",cy:"11",r:"0.5",fill:"currentColor",stroke:"none"})]})}function l({className:e}){return(0,t.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:e,"aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M8 1.5l5 2v4c0 3.5-2.5 5.5-5 6.5-2.5-1-5-3-5-6.5v-4l5-2z"}),(0,t.jsx)("path",{d:"M6 6.5l4 4M10 6.5l-4 4"})]})}function g({className:e}){return(0,t.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:e,"aria-hidden":"true",children:(0,t.jsx)("path",{d:"M4 6l4 4 4-4"})})}function o({className:e}){return(0,t.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:e,"aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M2 6.5h4v-4"}),(0,t.jsx)("path",{d:"M3.5 11.5a5.5 5.5 0 1 0 .5-6l-2 1"})]})}e.s(["f",0,function({error:e,title:d,retry:c,className:u}){let[m,x]=(0,s.useState)(!1);if(!e)return null;let f=(0,r.V)(e),h=(0,r.g)(e),p=(0,r.X)(e),v=(0,r.f)(e);return(0,t.jsx)("div",{role:"alert",className:(0,n.f)("stg:bg-destructive-subtle stg:border-destructive/20 stg:text-destructive stg:rounded-lg stg:border stg:p-4",u),children:(0,t.jsxs)("div",{className:"stg:flex stg:items-start stg:gap-3",children:["auth"===f||"permission"===f?(0,t.jsx)(l,{className:"stg:mt-0.5 stg:size-4 stg:shrink-0"}):(0,t.jsx)(a,{className:"stg:mt-0.5 stg:size-4 stg:shrink-0"}),(0,t.jsxs)("div",{className:"stg:min-w-0 stg:flex-1 stg:space-y-1",children:[(0,t.jsx)("p",{className:"stg:text-sm stg:font-medium",children:d??i[f]}),(0,t.jsx)("p",{className:"stg:m-0 stg:text-destructive stg:text-sm",children:h}),p&&(0,t.jsxs)("div",{className:"stg:pt-1",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>x(e=>!e),className:"stg:text-destructive stg:hover:underline stg:inline-flex stg:items-center stg:gap-1 stg:text-xs stg:transition-colors",children:[(0,t.jsx)(g,{className:(0,n.f)("stg:size-3 stg:transition-transform",m&&"stg:rotate-180")}),"Technical details"]}),m&&(0,t.jsxs)("dl",{className:"stg:text-destructive stg:mt-1.5 stg:space-y-0.5 stg:font-mono stg:text-xs",children:[(0,t.jsxs)("div",{className:"stg:flex stg:gap-2",children:[(0,t.jsx)("dt",{className:"stg:shrink-0",children:"Method:"}),(0,t.jsx)("dd",{className:"stg:truncate",children:p.method})]}),(0,t.jsxs)("div",{className:"stg:flex stg:gap-2",children:[(0,t.jsx)("dt",{className:"stg:shrink-0",children:"Path:"}),(0,t.jsx)("dd",{className:"stg:truncate",children:p.path})]})]})]})]}),c&&v&&(0,t.jsxs)("button",{type:"button",onClick:c,className:(0,n.f)("stg:inline-flex stg:shrink-0 stg:items-center stg:gap-1.5 stg:rounded-md stg:border stg:px-2.5 stg:py-1.5 stg:text-xs stg:font-medium","stg:border-destructive/20 stg:text-destructive stg:hover:bg-destructive-subtle","stg:transition-colors"),children:[(0,t.jsx)(o,{className:"stg:size-3"}),"Retry"]})]})})}])},261722,384605,e=>{"use strict";var t=e.i(974265),s=e.i(651023),r=e.i(893976);function n(e,t,r){let n=r?.caretAtEnd??!1,[i,a]=(0,s.useState)(!1),[l,g]=(0,s.useState)(e),[o,d]=(0,s.useState)(e);e!==o&&(d(e),l===o&&g(e));let c=(0,s.useCallback)(()=>{g(e),d(e),a(!0)},[e]);return(0,s.useLayoutEffect)(()=>{if(!i)return;let e=t.current;if(e&&(e.focus(),n)){let t=e.value.length;e.setSelectionRange(t,t)}},[i,t,n]),(0,s.useMemo)(()=>({isEditing:i,setIsEditing:a,draft:l,setDraft:g,startEditing:c}),[i,l,c])}function i({className:e}){return(0,t.jsx)("svg",{className:e,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M11.5 1.5a2.121 2.121 0 0 1 3 3L5 14l-4 1 1-4Z"})})}function a(){return(0,t.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",className:"stg:animate-spin","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M8 2a6 6 0 1 0 6 6"})})}e.s(["f",0,n],384605),e.s(["f",0,function({value:e,onSave:l,placeholder:g="Click to edit",validate:o,minRows:d=3,disabled:c,isSaving:u,error:m,className:x}){let[f,h]=(0,s.useState)(null),p=(0,s.useRef)(null),{isEditing:v,setIsEditing:b,draft:y,setDraft:j,startEditing:k}=n(e,p,{caretAtEnd:!0}),N=(0,s.useCallback)(()=>{h(null),k()},[k]);(0,s.useEffect)(()=>{let e=p.current;e&&(e.style.height="auto",e.style.height=`${e.scrollHeight}px`)},[y,v]);let w=(0,s.useCallback)(async()=>{if(y===e)return void b(!1);if(o){let e=o(y);if(e)return void h(e)}await l(y)&&b(!1)},[y,e,o,l]),C=(0,s.useCallback)(()=>{b(!1),j(e),h(null)},[e]),M=(0,s.useCallback)(e=>{"Enter"===e.key&&(e.ctrlKey||e.metaKey)?(e.preventDefault(),w()):"Escape"===e.key&&C()},[w,C]),S=f||m;return c||!v?(0,t.jsx)("div",{className:(0,r.f)("stg:group/inline-edit",x),children:(0,t.jsx)("button",{type:"button",onClick:()=>{c||N()},disabled:c,className:(0,r.f)("stg:w-full stg:rounded-md stg:px-2 stg:py-1.5 stg:text-left stg:transition-colors",!c&&"stg:hover:bg-accent-hover stg:cursor-pointer",c&&"stg:cursor-default","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-inset stg:focus-visible:ring-ring"),children:(0,t.jsxs)("div",{className:"stg:flex stg:items-start stg:justify-between stg:gap-2",children:[(0,t.jsx)("pre",{className:(0,r.f)("stg:min-w-0 stg:whitespace-pre-wrap stg:break-words stg:font-mono stg:text-sm stg:text-foreground",!e&&"stg:text-muted-foreground stg:italic stg:font-sans"),children:e||g}),!c&&(0,t.jsx)(i,{className:"stg:mt-0.5 stg:size-3 stg:shrink-0 stg:text-muted-foreground stg:opacity-0 stg:transition-opacity stg:group-hover/inline-edit:opacity-100"})]})})}):(0,t.jsxs)("div",{className:(0,r.f)("stg:flex stg:flex-col stg:gap-1.5",x),children:[(0,t.jsx)("textarea",{ref:p,value:y,onChange:e=>{j(e.target.value),h(null)},onKeyDown:M,disabled:u,placeholder:g,rows:d,className:(0,r.f)("stg:w-full stg:resize-y stg:rounded-md stg:border stg:border-border stg:bg-input-bg stg:px-3 stg:py-2 stg:font-mono stg:text-sm stg:text-foreground","stg:focus:outline-none stg:focus:ring-2 stg:focus:ring-ring","stg:disabled:opacity-50",S&&"stg:border-destructive")}),(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:justify-between",children:[(0,t.jsx)("span",{className:"stg:text-2xs stg:text-muted-foreground",children:u?"Saving...":"Ctrl+Enter to save, Escape to cancel"}),(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-1.5",children:[(0,t.jsx)("button",{type:"button",onClick:C,disabled:u,className:(0,r.f)("stg:rounded-md stg:px-2.5 stg:py-1 stg:text-xs stg:font-medium","stg:border stg:border-border stg:bg-background stg:text-foreground stg:hover:bg-accent stg:hover:text-accent-foreground","stg:disabled:opacity-50","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring"),children:"Cancel"}),(0,t.jsxs)("button",{type:"button",onClick:w,disabled:u,className:(0,r.f)("stg:inline-flex stg:items-center stg:gap-1 stg:rounded-md stg:px-2.5 stg:py-1 stg:text-xs stg:font-medium","stg:bg-primary stg:text-primary-foreground stg:hover:bg-primary-hover","stg:disabled:opacity-50","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring"),children:[u&&(0,t.jsx)(a,{}),"Save"]})]})]}),S&&(0,t.jsx)("p",{className:"stg:px-1 stg:text-xs stg:text-destructive",role:"alert",children:S})]})}],261722)},630983,e=>{"use strict";var t=e.i(974265),s=e.i(893976);function r({className:e}){return(0,t.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:e,"aria-hidden":"true",children:[(0,t.jsx)("circle",{cx:"8",cy:"8",r:"6.25"}),(0,t.jsx)("path",{d:"M8 7v4"}),(0,t.jsx)("circle",{cx:"8",cy:"5",r:"0.5",fill:"currentColor",stroke:"none"})]})}e.s(["f",0,function({children:e,className:n}){return(0,t.jsxs)("div",{role:"status",className:(0,s.f)("stg:bg-muted-subtle stg:text-muted-foreground stg:flex stg:items-start stg:gap-2.5 stg:rounded-lg stg:border stg:border-transparent stg:px-4 stg:py-3",n),children:[(0,t.jsx)(r,{className:"stg:mt-0.5 stg:size-4 stg:shrink-0"}),(0,t.jsx)("p",{className:"stg:text-xs stg:leading-relaxed",children:e})]})}])},321953,e=>{"use strict";var t=e.i(974265),s=e.i(893976),r=e.i(610595);e.s(["f",0,function({hasMore:e,loadMore:n,isLoadingMore:i,loadMoreError:a,className:l}){return e||null!==a?(0,t.jsxs)("div",{className:(0,s.f)("stg:mt-2 stg:flex stg:flex-col stg:items-start stg:gap-1",l),children:[null!==a&&(0,t.jsx)("p",{className:"stg:text-destructive stg:text-xs",role:"alert",children:(0,r.g)(a)}),e&&(0,t.jsx)("button",{type:"button",onClick:n,disabled:i,className:"stg:text-primary stg:text-xs stg:font-medium stg:hover:underline stg:disabled:opacity-50",children:i?"Loading…":"Load more"})]}):null}])},166403,e=>{"use strict";var t=e.i(974265);e.s(["f",0,function({subject:e}){return(0,t.jsxs)("p",{className:"stg:text-2xs stg:text-muted-foreground",children:["This app doesn't know your Stigmer server's public address, so it can't show ",e,"."]})}])},921321,e=>{"use strict";e.s(["f",0,function(e){return{org:e.org,slug:e.id?"":e.slug,...e.id?{id:e.id}:{},...e.version?{version:e.version}:{}}}])},310057,e=>{"use strict";var t=e.i(974265),s=e.i(651023);let r=(0,s.createContext)(null);e.s(["p",0,function({children:e}){let[n,i]=(0,s.useState)(null),a=(0,s.useCallback)(e=>i(e),[]),l=(0,s.useMemo)(()=>({label:n,setLabel:a}),[n,a]);return(0,t.jsx)(r.Provider,{value:l,children:e})},"S",0,function(){return(0,s.useContext)(r)?.label??null},"Q",0,function(){let e=(0,s.useContext)(r),t=(0,s.useCallback)(e=>{},[]);return{setLabel:e?.setLabel??t}}])},352371,e=>{"use strict";var t=e.i(651023);e.i(222258);var s=e.i(967785),r=e.i(590745),n=e.i(846696),i=e.i(745176),a=e.i(193799);e.s(["f",0,function({resource:e}){let l=(0,t.useMemo)(()=>e?(0,r.K)(e):null,[e]),g=(0,t.useMemo)(()=>l?JSON.stringify((0,s.x)(l),null,2):null,[l]),o=(0,t.useMemo)(()=>e&&(e.metadata?.slug||e.metadata?.name)||"resource",[e]),{copy:d}=(0,a.f)(),c=(0,t.useCallback)(async()=>{l&&(await d(l)?n.c.success("YAML copied to clipboard"):n.c.error("Couldn't copy YAML"))},[d,l]),u=(0,t.useCallback)(async()=>{g&&(await d(g)?n.c.success("JSON copied to clipboard"):n.c.error("Couldn't copy JSON"))},[d,g]),m=(0,t.useCallback)(()=>{l&&(0,i.a)(l,`${o}.yaml`,"text/yaml")},[l,o]),x=(0,t.useCallback)(()=>{g&&(0,i.a)(g,`${o}.json`,"application/json")},[g,o]);return(0,t.useMemo)(()=>({copyYaml:c,copyJson:u,downloadYaml:m,downloadJson:x,yaml:l,json:g}),[c,u,m,x,l,g])}])},616629,e=>{"use strict";var t=e.i(974265),s=e.i(651023),r=e.i(893976),n=e.i(468806),i=e.i(610595),a=e.i(846696),l=e.i(237973),g=e.i(774079),o=e.i(901501),d=e.i(864652),c=e.i(590745),u=e.i(255817),m=e.i(781836),x=e.i(573732);function f({label:e}){return(0,t.jsx)("div",{className:"stg:flex stg:h-80 stg:items-center stg:justify-center stg:rounded-md stg:border stg:border-border stg:bg-muted stg:text-sm stg:text-muted-foreground",children:e})}e.s(["f",0,function({open:e,onOpenChange:h,resource:p,onApplied:v}){let b=function({resource:e}){let t=(0,u.f)(),r=(0,s.useMemo)(()=>e?(0,c.K)(e):"",[e]),[n,i]=(0,s.useState)(r),[a,l]=(0,s.useState)(!1),[g,x]=(0,s.useState)(!1),[f,h]=(0,s.useState)(null),[p,v]=(0,s.useState)(null);(0,s.useEffect)(()=>{a||i(r)},[r,a]);let b=(0,s.useCallback)(e=>{i(e),l(e!==r)},[r]),y=(0,s.useCallback)(()=>{i(r),l(!1),h(null)},[r]),j=(0,s.useCallback)(()=>h(null),[]),k=(0,s.useMemo)(()=>e&&r?(0,d.a)(r)[0].handler.yamlKind:null,[e,r]),N=(0,s.useMemo)(()=>{let e;if(!n.trim())return{status:"empty"};try{e=(0,d.a)(n)}catch(e){return{status:"invalid",message:(0,m.f)(e).message}}if(e.length>1)return{status:"invalid",message:"This editor applies a single resource. Remove the extra documents, or use Apply YAML in the Library for multi-document manifests."};let t=e[0];return null!==k&&t.handler.yamlKind!==k?{status:"invalid",message:`The document's kind changed from ${k} to ${t.handler.yamlKind}. To apply a different resource kind, use Apply YAML in the Library instead.`}:{status:"valid",document:t}},[n,k]),w=(0,s.useRef)(0);(0,s.useEffect)(()=>{if("valid"!==N.status)return void v(null);let{document:e}=N,s=++w.current;v(null);let r=setTimeout(async()=>{let r;try{let s=await t.manifest.resolveTarget(e);switch(s.action){case"create":r={action:"create",slug:s.slug};break;case"update":r={action:"update",slug:s.slug,slugKept:s.slugKept,visibilityKept:s.visibilityKept};break;case"rename":r={action:"rename",from:s.from,slug:s.slug,visibilityKept:s.visibilityKept};break;default:throw Error(`unhandled target ${String(s)}`)}}catch{r={action:"unknown",slug:e.slug}}w.current===s&&v(r)},400);return()=>clearTimeout(r)},[N,t]);let C=(0,s.useCallback)(async()=>{if("valid"!==N.status)return null;x(!0),h(null);try{let e=await t.manifest.apply(N.document);return l(!1),e}catch(e){throw h((0,m.f)(e)),e}finally{x(!1)}},[N,t]),M=(0,s.useMemo)(()=>(0,o.f)(n),[n]);return(0,s.useMemo)(()=>({yaml:n,setYaml:b,isDirty:a,validation:N,target:p,hasRedactedSecrets:M,apply:C,isApplying:g,error:f,clearError:j,reset:y}),[n,b,a,N,p,M,C,g,f,j,y])}({resource:p}),{reset:y}=b;(0,s.useEffect)(()=>{e&&y()},[e,y]);let j=(0,s.useCallback)(async()=>{try{let e=await b.apply();if(!e)return;a.c.success(`${e.displayName} "${e.name}" applied`),h(!1),v?.(e)}catch{}},[b,h,v]),k="valid"===b.validation.status&&b.isDirty&&!b.isApplying;return(0,t.jsx)(n.f,{open:e,onOpenChange:h,width:"3xl","aria-label":"Edit YAML",children:(0,t.jsxs)("div",{className:"stg:flex stg:flex-col stg:gap-4 stg:p-6",children:[(0,t.jsxs)("div",{className:"stg:flex stg:flex-col stg:gap-1",children:[(0,t.jsx)("h3",{className:"stg:text-base stg:font-semibold stg:text-foreground",children:"Edit YAML"}),(0,t.jsx)("p",{className:"stg:text-sm stg:text-muted-foreground",children:"Edit the resource definition and apply. Changes are validated against the resource schema as you type."})]}),p?(0,t.jsx)(x.f,{value:b.yaml,onChange:b.setYaml,className:"stg:h-80"}):(0,t.jsx)(f,{label:"Loading resource…"}),b.hasRedactedSecrets&&(0,t.jsx)(g.f,{}),"invalid"===b.validation.status&&(0,t.jsx)("div",{role:"alert",className:"stg:rounded-md stg:border stg:border-destructive stg:bg-card stg:px-3 stg:py-2.5 stg:text-sm stg:text-destructive",children:b.validation.message}),b.error&&(0,t.jsxs)("div",{role:"alert",className:"stg:flex stg:items-start stg:gap-3 stg:rounded-md stg:border stg:border-destructive stg:bg-card stg:px-3 stg:py-2.5",children:[(0,t.jsx)("p",{className:"stg:flex-1 stg:text-sm stg:text-destructive",children:(0,i.g)(b.error)}),(0,t.jsxs)("div",{className:"stg:flex stg:shrink-0 stg:items-center stg:gap-2",children:[(0,t.jsx)("button",{type:"button",onClick:j,disabled:"valid"!==b.validation.status||b.isApplying,className:(0,r.f)("stg:rounded-md stg:border stg:border-input stg:bg-background stg:px-2 stg:py-1 stg:text-xs stg:font-medium stg:text-foreground","stg:hover:bg-accent stg:hover:text-accent-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"),children:"Try again"}),(0,t.jsx)("button",{type:"button",onClick:b.clearError,"aria-label":"Dismiss error",className:(0,r.f)("stg:rounded-md stg:px-2 stg:py-1 stg:text-xs stg:font-medium stg:text-muted-foreground","stg:hover:bg-accent stg:hover:text-foreground","stg:focus-visible:outline-none stg:focus-visible:ring-1 stg:focus-visible:ring-ring"),children:"Dismiss"})]})]}),(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:justify-between stg:gap-3",children:[(0,t.jsx)("p",{className:"stg:text-xs stg:text-muted-foreground","aria-live":"polite",children:function(e,t,s){if("valid"!==e.status)return"";if(!t)return"No changes yet.";if(null===s)return"Checking what applying will do…";let r=e.document.handler.displayName;switch(s.action){case"update":return[`Applying will update ${s.slug}.`,...(0,l.f)(r,s)].join(" ");case"create":return`Applying will create ${s.slug}.`;case"rename":return[`Applying will rename ${s.from} to ${s.slug}.`,...(0,l.f)(r,{slugKept:!1,visibilityKept:s.visibilityKept})].join(" ");case"unknown":return`Applying will create or update ${s.slug}.`;default:return String(s)}}(b.validation,b.isDirty,b.target)}),(0,t.jsxs)("div",{className:"stg:flex stg:gap-2",children:[(0,t.jsx)("button",{type:"button",onClick:()=>h(!1),disabled:b.isApplying,className:(0,r.f)("stg:rounded-md stg:px-3 stg:py-1.5 stg:text-sm 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","stg:disabled:pointer-events-none stg:disabled:opacity-50"),children:"Cancel"}),(0,t.jsx)("button",{type:"button",onClick:j,disabled:!k,className:(0,r.f)("stg:rounded-md stg:px-3 stg:py-1.5 stg:text-sm stg:font-medium stg:transition-colors","stg:bg-primary stg:text-primary-foreground stg:hover:bg-primary-hover","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring","stg:disabled:pointer-events-none stg:disabled:opacity-50"),children:b.isApplying?"Applying…":"Apply changes"})]})]})]})})}],616629)},346298,e=>{"use strict";var t=e.i(974265),s=e.i(893976),r=e.i(65642),n=e.i(231666);e.s(["I",0,function({rows:e,onChange:i,disabled:a=!1,className:l}){let g=e.reduce((e,t)=>Math.max(e,t.id),0)+1;return(0,t.jsxs)("fieldset",{className:(0,s.f)("stg:space-y-1.5",l),children:[(0,t.jsxs)("legend",{className:"stg:text-xs stg:font-medium stg:text-muted-foreground",children:["Headers ",(0,t.jsx)("span",{className:"stg:text-muted-foreground-subtle",children:"(optional)"})]}),e.map(s=>(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-2",children:[(0,t.jsx)("input",{"aria-label":"Header name",value:s.key,onChange:t=>i(e.map(e=>e.id===s.id?{...e,key:t.target.value}:e)),placeholder:"Authorization",autoComplete:"off",spellCheck:!1,disabled:a,className:n.c}),(0,t.jsx)("input",{"aria-label":"Header value",value:s.value,onChange:t=>i(e.map(e=>e.id===s.id?{...e,value:t.target.value}:e)),placeholder:"Bearer ${LINEAR_API_KEY}",autoComplete:"off",spellCheck:!1,disabled:a,className:n.c}),(0,t.jsx)(r.f,{type:"button",variant:"ghost",size:"xs",disabled:a,onClick:()=>i(e.filter(e=>e.id!==s.id)),"aria-label":`Remove header ${s.key||"row"}`,children:"Remove"})]},s.id)),(0,t.jsx)(r.f,{type:"button",variant:"outline",size:"xs",disabled:a,onClick:()=>i([...e,{id:g,key:"",value:""}]),children:"Add header"}),(0,t.jsxs)("p",{className:"stg:text-xs stg:text-muted-foreground",children:["Write a key as ",(0,t.jsx)("code",{className:"stg:font-mono",children:"${NAME}"}),", never its value: each conversation that uses the server asks for it and reads it from a vault."]})]})},"n",0,function(e){return Object.entries(e).map(([e,t],s)=>({id:s+1,key:e,value:t}))}])},292420,e=>{"use strict";var t=e.i(974265),s=e.i(893976),r=e.i(141249);e.s(["f",0,function({plugin:e,onPluginClick:n,className:i}){if(null===e)return null;let a=e.metadata,l=a?.name||a?.slug||"a plugin",g=a?{org:a.org,slug:a.slug}:null;return(0,t.jsxs)("div",{role:"note",className:(0,s.f)("stg:flex stg:items-start stg:gap-2 stg:rounded-md stg:border stg:border-border stg:bg-muted stg:px-3 stg:py-2 stg:text-sm stg:text-foreground",i),children:[(0,t.jsx)(r.f,{className:"stg:mt-0.5 stg:size-4 stg:shrink-0 stg:text-muted-foreground"}),(0,t.jsxs)("p",{children:["Installed by the plugin"," ",n&&g?(0,t.jsx)("button",{type:"button",onClick:()=>n(g),className:"stg:cursor-pointer stg:font-medium stg:underline stg:decoration-dotted stg:underline-offset-2 stg:hover:text-primary",children:l}):(0,t.jsx)("span",{className:"stg:font-medium",children:l}),". To change it, change the plugin and push it again; to customise, compose your own agent over its skills and servers."]})]})}])},473489,e=>{"use strict";var t=e.i(651023),s=e.i(910304),r=e.i(255817),n=e.i(616701);let i="stigmer.ai/plugin";e.s(["T",0,i,"l",0,function(e){let a=(0,r.f)(),l=e?.[i]??null,{data:g,isLoading:o}=(0,n.f)(l?async()=>{try{return await a.plugin.get(l)}catch(e){if((0,s.c)(e))return null;throw e}}:null,[l,a],null);return(0,t.useMemo)(()=>({plugin:g,isLoading:o}),[g,o])}])},524728,256237,e=>{"use strict";var t=e.i(170255),s=e.i(255817),r=e.i(616701);function n(e,n,i){let a=(0,s.f)(),l=i?.query,g=i?.refetchToken,{data:o,isLoading:d,isRefetching:c,error:u,refetch:m}=(0,r.f)(n?async()=>(await a.search.query({kinds:[e],org:n,query:l||void 0,pageSize:1})).countsByKind[t.X[e]]??0:null,[a,e,n,l,g],void 0);return{count:o,isLoading:d,isRefetching:c,error:u,refetch:m}}e.s(["f",0,n],256237);var i=e.i(651023),a=e.i(400019),l=e.i(874792);e.s(["w",0,function(e,s){return n(t.X.plugin,e,s)},"z",0,function(e,r){var n;let g,o,d,c,u,{entries:m,hasMore:x,loadMore:f,isLoadingMore:h,loadMoreError:p,isLoading:v,error:b,refetch:y}=(n=t.X.plugin,g=(0,s.f)(),o=r?.pageSize??20,d=r?.query??"",c=(0,i.useMemo)(()=>(0,l.f)(g,n),[g,n]),{entries:(u=(0,a.f)(e?t=>c({org:e,query:d||void 0,pageSize:o,pageToken:t}):null,[c,e,d,o],e=>e.id)).items,hasMore:u.hasMore,loadMore:u.loadMore,isLoadingMore:u.isLoadingMore,loadMoreError:u.loadMoreError,isLoading:u.isLoading,isRefetching:u.isRefetching,error:u.error,refetch:u.refetch});return{plugins:m,hasMore:x,loadMore:f,isLoadingMore:h,loadMoreError:p,isLoading:v,error:b,refetch:y}}],524728)},252771,e=>{"use strict";var t=e.i(974265),s=e.i(651023),r=e.i(893976),n=e.i(610595),i=e.i(803874),a=e.i(379410),l=e.i(891287),g=e.i(459153),o=e.i(255817),d=e.i(781836);function c({currentSlug:e,rename:i,isRenaming:l,error:g,clearError:o,onRenamed:d,hint:u,label:m="Slug",className:x}){let f=(0,s.useId)(),[h,p]=(0,s.useState)(e),[v,b]=(0,s.useState)(null);(0,s.useEffect)(()=>{p(e),b(null)},[e]);let y=l||null!==v,j=h.trim(),k=j.length>0&&j!==e&&!y,N=(0,s.useCallback)(async()=>{if(k){o();try{let t=await i(j);b(e),d(t)}catch{}}},[k,o,i,j,e,d]);return(0,t.jsxs)("div",{className:(0,r.f)("stg:space-y-1",x),children:[(0,t.jsx)("label",{htmlFor:f,className:"stg:text-2xs stg:font-medium stg:text-muted-foreground stg:uppercase stg:tracking-wider",children:m}),(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-2",children:[(0,t.jsx)("input",{id:f,type:"text",value:h,onChange:e=>{p(e.target.value),o()},onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),N())},disabled:y,spellCheck:!1,autoComplete:"off",className:(0,r.f)("stg:w-full stg:rounded-md stg:border stg:border-input stg:bg-background stg:px-2.5 stg:py-1.5 stg:font-mono stg:text-xs stg:text-foreground","stg:focus-visible:outline-none stg:focus-visible:ring-1 stg:focus-visible:ring-ring","stg:disabled:pointer-events-none stg:disabled:opacity-50")}),(0,t.jsxs)("button",{type:"button",onClick:()=>void N(),disabled:!k,className:(0,r.f)("stg:inline-flex stg:shrink-0 stg:items-center stg:gap-1.5 stg:rounded-md stg:px-3 stg:py-1.5 stg:text-xs stg:font-medium","stg:border stg:border-input stg:text-foreground stg:hover:bg-accent-hover","stg:disabled:pointer-events-none stg:disabled:opacity-40"),children:[y&&(0,t.jsx)(a.f,{size:12}),"Rename"]})]}),g?(0,t.jsx)("p",{className:"stg:text-destructive stg:text-2xs",role:"alert",children:(0,n.g)(g)}):(0,t.jsx)("p",{className:"stg:text-2xs stg:text-muted-foreground",children:u})]})}e.s(["V",0,c,"e",0,function({kind:e,resourceId:r,currentSlug:n,onRenamed:a,fallback:u=null,className:m}){let x=(0,i.f)(r?{kind:e,id:r}:null,"can_delete",{fail:"closed"}),{rename:f,isRenaming:h,error:p,clearError:v}=function(e){let t=(0,o.f)(),[r,n]=(0,s.useState)(!1),[i,a]=(0,s.useState)(null),c=(0,s.useCallback)(()=>a(null),[]),u=(0,s.useCallback)(async(s,r)=>{n(!0),a(null);let i=(0,l.f)(g.I,{resourceId:s,slug:r});try{return await function(e,t,s){switch(t){case"agent":return e.agent.rename(s);case"vault":return e.vault.rename(s);case"routine":return e.routine.rename(s);case"environment":return e.environment.rename(s);case"channel_app":return e.channelapp.rename(s);case"oauth_app":return e.oauthapp.rename(s);case"team":return e.team.rename(s);case"federation_issuer":return e.federationIssuer.rename(s)}}(t,e,i)}catch(e){throw a((0,d.f)(e)),e}finally{n(!1)}},[t,e]);return(0,s.useMemo)(()=>({rename:u,isRenaming:r,error:i,clearError:c}),[u,r,i,c])}(e),b=(0,s.useCallback)(e=>f(r??"",e),[f,r]);return r&&x.allowed?(0,t.jsx)(c,{currentSlug:n,rename:b,isRenaming:h,error:p,clearError:v,onRenamed:a,hint:"The name in links and files. After a rename the old slug keeps working for reading for 30 days; a file that names it must change to the new one.",className:m}):(0,t.jsx)(t.Fragment,{children:u})}],252771)},810048,e=>{"use strict";var t=e.i(974265),s=e.i(651023),r=e.i(893976),n=e.i(845132),i=e.i(872673);function a({actions:e,label:r}){var i;let g=(i=e,(0,s.useMemo)(()=>{let e=new Map;for(let t of i){let s=e.get(t.group);s?s.push(t):e.set(t.group,[t])}return Array.from(e.values()).map(e=>({items:e}))},[i]));return(0,t.jsxs)(n.f,{children:[(0,t.jsx)(n.f.Trigger,{"aria-label":r,children:(0,t.jsx)(l,{className:"stg:size-4"})}),(0,t.jsx)(n.f.Content,{children:g.map((e,s)=>(0,t.jsxs)(n.f.Group,{children:[s>0&&(0,t.jsx)(n.f.Separator,{}),e.items.map(e=>(0,t.jsx)(n.f.Item,{icon:e.icon,shortcut:e.shortcut,variant:e.variant,disabled:e.disabled,onSelect:e.onAction,children:e.label},e.id))]},s))})]})}function l({className:e}){return(0,t.jsxs)("svg",{className:e,viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:[(0,t.jsx)("circle",{cx:"8",cy:"3",r:"1.25"}),(0,t.jsx)("circle",{cx:"8",cy:"8",r:"1.25"}),(0,t.jsx)("circle",{cx:"8",cy:"13",r:"1.25"})]})}e.s(["f",0,function({primaryAction:e,actions:n,resource:l,menuLabel:g="More actions",className:o}){var d,c,u;let m,x,{primaryAction:f,actions:h}=(d=e,c=n,u=l??null,m=(0,s.useMemo)(()=>(function(e,t){let s=new Set;for(let r of(e?.requires&&s.add(e.requires),t??[]))r.requires&&s.add(r.requires);return Array.from(s)})(d,c),[d,c]),x=(0,i.f)(u,m,{fail:"closed"}),(0,s.useMemo)(()=>{let e=e=>void 0===e.requires||x[e.requires].allowed;return{primaryAction:d&&e(d)?d:void 0,actions:(c??[]).filter(e)}},[d,c,x])),p=h.length>0;return f||p?(0,t.jsxs)("div",{className:(0,r.f)("stg:flex stg:items-center stg:gap-2",o),children:[f&&(0,t.jsxs)("button",{type:"button",onClick:f.onAction,disabled:f.disabled,className:(0,r.f)("stg:inline-flex stg:items-center stg:gap-1.5 stg:rounded-md stg:px-3 stg:py-1.5 stg:text-sm stg:font-medium stg:transition-colors","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring","stg:bg-primary stg:text-primary-foreground stg:hover:bg-primary-hover","stg:disabled:pointer-events-none stg:disabled:opacity-50"),children:[f.icon,f.label]}),p&&(0,t.jsx)(a,{actions:h,label:g})]}):null}])},668093,652337,e=>{"use strict";var t=e.i(974265),s=e.i(893976),r=e.i(266442),n=e.i(927056),i=e.i(810048),a=e.i(42592);function l({header:e,visibilityControl:s,metaExtra:n}){let{name:i,nameElement:d,org:c,slug:u,qualifiedSlug:m,description:x,iconUrl:f,icon:h,createdAt:p,updatedAt:v,status:b,statusLabel:y}=e,j=u&&u!==i&&!m,k=(0,a.b)();return(0,t.jsxs)("div",{className:"stg:flex stg:min-w-0 stg:items-start stg:gap-3",children:[f?(0,t.jsx)("img",{src:f,alt:"",className:"stg:mt-0.5 stg:size-8 stg:shrink-0 stg:rounded stg:object-cover"}):h?(0,t.jsx)("span",{className:"stg:mt-1 stg:shrink-0",children:h}):null,(0,t.jsxs)("div",{className:"stg:min-w-0 stg:flex-1",children:[(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-2",children:[d??(0,t.jsx)("h2",{className:"stg:truncate stg:text-lg stg:font-semibold stg:text-foreground",children:i}),j&&(0,t.jsx)("code",{className:"stg:shrink-0 stg:rounded stg:bg-muted stg:px-1.5 stg:py-0.5 stg:text-xs stg:font-medium stg:text-muted-foreground",children:u}),b&&(0,t.jsx)(r.f,{phase:b,label:y}),s]}),m&&(0,t.jsx)("span",{className:"stg:mt-0.5 stg:block stg:truncate stg:font-mono stg:text-xs stg:text-muted-foreground",children:m}),(0,t.jsxs)("div",{className:"stg:mt-0.5 stg:flex stg:flex-wrap stg:items-center stg:gap-x-1.5 stg:text-xs stg:text-muted-foreground",children:[c&&(0,t.jsx)("span",{children:k(c)}),n,p&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(g,{}),(0,t.jsxs)("span",{children:["Created ",o(p)]})]}),v&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(g,{}),(0,t.jsxs)("span",{children:["Updated ",o(v)]})]})]}),x&&(0,t.jsx)("p",{className:"stg:mt-2 stg:text-sm stg:text-muted-foreground",children:x})]})]})}function g(){return(0,t.jsx)("span",{className:"stg:shrink-0","aria-hidden":"true",children:"·"})}function o(e){return e.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}function d({className:e}){return(0,t.jsx)("svg",{className:e,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M11.5 1.5a2.121 2.121 0 0 1 3 3L5 14l-4 1 1-4Z"})})}e.s(["f",0,function({header:e,visibilityControl:r,headerMetaExtra:a,headerBanner:g,identity:o,primaryAction:d,actions:c,resource:u,tabs:m,activeTab:x,onTabChange:f,tabsAriaLabel:h,children:p,className:v}){let b=null!=m&&m.length>0;return(0,t.jsxs)("div",{className:(0,s.f)("stg:flex stg:flex-col stg:gap-6",v),children:[g,(0,t.jsxs)("div",{className:"stg:flex stg:flex-col stg:gap-4 stg:sm:flex-row stg:sm:items-start stg:sm:justify-between",children:[o??(0,t.jsx)(l,{header:e,visibilityControl:r,metaExtra:a}),(0,t.jsx)(i.f,{primaryAction:d,actions:c,resource:u,className:"stg:shrink-0"})]}),b&&x&&f?(0,t.jsx)(n.f,{tabs:m,activeTab:x,onTabChange:f,"aria-label":h,children:p}):p]})}],668093),e.s(["f",0,function({title:e,count:r,countIsLowerBound:n=!1,headerActions:i,onEdit:a,scrollTarget:l,children:g,className:o}){return(0,t.jsxs)("section",{className:o,"data-scroll-target":l,children:[(0,t.jsxs)("div",{className:"stg:mb-2 stg:flex stg:items-center stg:gap-2",children:[(0,t.jsx)("h3",{className:"stg:text-xs stg:font-medium stg:uppercase stg:tracking-wider stg:text-muted-foreground",children:e}),null!=r&&r>0&&(0,t.jsx)("span",{className:"stg:inline-flex stg:h-5 stg:min-w-5 stg:items-center stg:justify-center stg:rounded-full stg:bg-muted stg:px-1 stg:text-2xs stg:font-semibold stg:text-muted-foreground",children:n?`${r}+`:r}),(i||a)&&(0,t.jsxs)("div",{className:"stg:ml-auto stg:flex stg:items-center stg:gap-1",children:[i,a&&(0,t.jsx)("button",{type:"button",onClick:a,"aria-label":`Edit ${e.toLowerCase()}`,className:(0,s.f)("stg:inline-flex stg:size-6 stg:items-center stg:justify-center stg:rounded-md stg:text-muted-foreground","stg:hover:bg-accent-hover stg:hover:text-foreground","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring","stg:transition-colors"),children:(0,t.jsx)(d,{className:"stg:size-3.5"})})]})]}),(0,t.jsx)("div",{className:"stg:overflow-hidden stg:rounded-lg stg:border stg:border-border",children:g})]})}],652337)},154752,e=>{"use strict";var t=e.i(651023),s=e.i(846696),r=e.i(193799);e.s(["f",0,function(){let{copy:e}=(0,r.f)(),n=(0,t.useCallback)(async(t,r)=>{await e(t)?s.c.success(`${r} copied`):s.c.error(`Couldn't copy ${r}`)},[e]),i=(0,t.useCallback)(e=>n(e,"ID"),[n]),a=(0,t.useCallback)(e=>n(e,"Slug"),[n]),l=(0,t.useCallback)((e,t)=>n(`${e}/${t}`,"Qualified slug"),[n]);return(0,t.useMemo)(()=>({copy:n,copyId:i,copySlug:a,copyQualifiedSlug:l}),[n,i,a,l])}])},267912,e=>{"use strict";var t=e.i(651023);e.s(["f",0,function({builtInTabs:e,additionalTabs:s,activeTab:r,onTabChange:n,defaultTab:i}){let a=void 0!==r&&void 0!==n,l=(0,t.useMemo)(()=>s&&0!==s.length?[...e,...s]:e,[e,s]),g=i??e[0]?.id??"",[o,d]=(0,t.useState)(g),c=a?r:o,u=(0,t.useCallback)(e=>{a?n(e):d(e)},[a,n]),m=l.length>1?l:void 0,x=(0,t.useMemo)(()=>{if(s)return s.find(e=>e.id===c)},[s,c]);return{effectiveTabs:m,effectiveActiveTab:c,effectiveOnTabChange:u,activeAdditionalTab:x}}])},266442,e=>{"use strict";var t=e.i(974265),s=e.i(893976),r=e.i(188482);let n={ready:"Ready",running:"Running",pending:"Pending",degraded:"Degraded",failed:"Failed",disabled:"Disabled",draft:"Draft"};e.s(["f",0,function({phase:e,label:i,tooltip:a,className:l}){let g=i??n[e],o=(0,t.jsxs)("span",{className:(0,s.f)("stg:inline-flex stg:items-center stg:gap-1.5 stg:rounded-full stg:px-2 stg:py-0.5 stg:text-2xs stg:font-medium stg:leading-none",function(e){switch(e){case"ready":return"stg:bg-[var(--stgm-status-ready-subtle)] stg:text-[var(--stgm-status-ready)]";case"running":return"stg:bg-[var(--stgm-status-running-subtle)] stg:text-[var(--stgm-status-running)]";case"pending":return"stg:bg-[var(--stgm-status-pending-subtle)] stg:text-[var(--stgm-status-pending)]";case"degraded":return"stg:bg-[var(--stgm-status-degraded-subtle)] stg:text-[var(--stgm-status-degraded)]";case"failed":return"stg:bg-[var(--stgm-status-failed-subtle)] stg:text-[var(--stgm-status-failed)]";case"disabled":return"stg:bg-[var(--stgm-status-disabled-subtle)] stg:text-[var(--stgm-status-disabled)]";case"draft":return"stg:bg-[var(--stgm-status-draft-subtle)] stg:text-[var(--stgm-status-draft)]"}}(e),l),children:[(0,t.jsx)("span",{className:(0,s.f)("stg:size-1.5 stg:shrink-0 stg:rounded-full",function(e){switch(e){case"ready":return"stg:bg-[var(--stgm-status-ready)]";case"running":return"stg:bg-[var(--stgm-status-running)]";case"pending":return"stg:bg-[var(--stgm-status-pending)]";case"degraded":return"stg:bg-[var(--stgm-status-degraded)]";case"failed":return"stg:bg-[var(--stgm-status-failed)]";case"disabled":return"stg:bg-[var(--stgm-status-disabled)]";case"draft":return"stg:bg-[var(--stgm-status-draft)]"}}(e)),"aria-hidden":"true"}),g]});return a?(0,t.jsxs)(r.W,{children:[(0,t.jsx)(r.y,{render:(0,t.jsx)("span",{className:"stg:inline-flex"}),children:o}),(0,t.jsx)(r.Y,{side:"top",children:a})]}):o}])},231666,e=>{"use strict";e.s(["x",0,"stg:rounded stg:px-1.5 stg:py-0.5 stg:text-xs stg:text-muted-foreground stg:transition-colors stg:hover:bg-destructive/10 stg:hover:text-destructive stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring stg:disabled:opacity-50","c",0,"stg:w-full stg:rounded-md stg:border stg:border-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:outline-none stg:focus:ring-2 stg:focus:ring-ring stg:disabled:opacity-50","h",0,"stg:inline-flex stg:items-center stg:gap-1.5 stg:rounded-md stg:bg-primary stg:px-3 stg:py-1.5 stg:text-xs stg:font-medium stg:text-primary-foreground stg:hover:bg-primary/90 stg:disabled:cursor-not-allowed stg:disabled:opacity-50","m",0,"stg:rounded stg:px-1.5 stg:py-0.5 stg:text-xs stg:text-muted-foreground stg:transition-colors stg:hover:bg-accent stg:hover:text-accent-foreground stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring stg:disabled:opacity-50"])},784400,e=>{"use strict";var t=e.i(974265),s=e.i(651023),r=e.i(893976),n=e.i(188482),i=e.i(361353);function a({entry:e,isSelected:s,isCompareSource:g,isLast:o,onSelect:d,trailing:c}){return(0,t.jsxs)("div",{role:"listitem","aria-current":e.isCurrent?"true":void 0,className:"stg:relative stg:flex stg:gap-3",children:[(0,t.jsxs)("div",{className:"stg:flex stg:flex-col stg:items-center stg:pt-1",children:[(0,t.jsx)("div",{className:(0,r.f)("stg:size-2.5 stg:shrink-0 stg:rounded-full stg:border-2",e.isCurrent?"stg:border-primary stg:bg-primary":g?"stg:border-primary stg:border-dashed stg:bg-background":s?"stg:border-primary stg:bg-background":"stg:border-border stg:bg-background"),"aria-hidden":"true"}),!o&&(0,t.jsx)("div",{className:"stg:mt-1 stg:w-px stg:flex-1 stg:bg-border","aria-hidden":"true"})]}),(0,t.jsxs)("button",{type:"button",onClick:d,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),d?.())},tabIndex:0,"aria-selected":s,className:(0,r.f)("stg:mb-4 stg:flex stg:min-w-0 stg:flex-1 stg:flex-col stg:gap-1 stg:rounded-md stg:px-2.5 stg:py-2 stg:text-left stg:transition-colors","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring",g?"stg:border stg:border-dashed stg:border-primary stg:bg-primary-subtle":s?"stg:bg-accent-hover":"stg:hover:bg-accent-hover"),children:[(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-2",children:[(0,t.jsxs)(n.W,{children:[(0,t.jsx)(n.y,{render:(0,t.jsx)("code",{className:"stg:shrink-0 stg:rounded stg:bg-muted stg:px-1.5 stg:py-0.5 stg:font-mono stg:text-2xs stg:font-medium stg:text-foreground"}),children:e.label}),(0,t.jsx)(n.Y,{side:"top",className:"stg:break-all",children:e.id})]}),g&&(0,t.jsx)("span",{className:"stg:shrink-0 stg:rounded-full stg:bg-primary stg:px-1.5 stg:py-0.5 stg:text-2xs stg:font-medium stg:text-primary-foreground",children:"A"}),e.tag&&(0,t.jsx)("span",{className:"stg:shrink-0 stg:rounded-full stg:bg-primary-subtle stg:px-1.5 stg:py-0.5 stg:text-2xs stg:font-medium stg:text-primary",children:e.tag}),e.isCurrent&&(0,t.jsx)("span",{className:"stg:shrink-0 stg:rounded-full stg:bg-status-ready-subtle stg:px-1.5 stg:py-0.5 stg:text-2xs stg:font-medium stg:text-status-ready",children:"current"}),c&&(0,t.jsx)("div",{className:"stg:ml-auto stg:shrink-0",children:c})]}),(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-2 stg:text-xs stg:text-muted-foreground",children:[(0,t.jsxs)(n.W,{children:[(0,t.jsx)(n.y,{render:(0,t.jsx)("time",{dateTime:e.timestamp.toISOString()}),children:(0,i.f)(e.timestamp)}),(0,t.jsx)(n.Y,{side:"top",children:e.timestamp.toLocaleString()})]}),e.actor&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{"aria-hidden":"true",children:"·"}),(0,t.jsxs)("span",{className:"stg:flex stg:items-center stg:gap-1",children:[e.actor.avatar&&(0,t.jsx)("img",{src:e.actor.avatar,alt:"",className:"stg:size-3.5 stg:rounded-full"}),(0,t.jsx)("span",{children:e.actor.displayName||e.actor.id})]})]})]}),e.sublabel&&(0,t.jsx)("p",{className:"stg:text-xs stg:text-muted-foreground",children:e.sublabel}),e.gitProvenance&&(0,t.jsx)(l,{provenance:e.gitProvenance})]})]})}function l({provenance:e}){let s=function(e){if(!e)return null;let t=e.replace(/\.git$/,"");if(t.startsWith("https://")||t.startsWith("http://"))return t;let s=t.match(/^(?:git@|ssh:\/\/)([^:/]+)[:/](.+)$/);return s?`https://${s[1]}/${s[2]}`:null}(e.remoteUrl),r=e.commit.slice(0,7),n=s?`${s}/commit/${e.commit}`:null;return(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-1.5 stg:text-2xs stg:text-muted-foreground",children:[(0,t.jsx)(g,{className:"stg:size-3 stg:shrink-0"}),e.ref&&(0,t.jsx)("span",{className:"stg:font-medium",children:e.ref}),n?(0,t.jsx)("a",{href:n,target:"_blank",rel:"noopener noreferrer",className:"stg:font-mono stg:text-primary stg:underline-offset-2 stg:hover:underline",onClick:e=>e.stopPropagation(),children:r}):(0,t.jsx)("code",{className:"stg:font-mono",children:r})]})}function g({className:e}){return(0,t.jsxs)("svg",{className:e,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,t.jsx)("circle",{cx:"8",cy:"4",r:"2"}),(0,t.jsx)("circle",{cx:"8",cy:"12",r:"2"}),(0,t.jsx)("path",{d:"M8 6v4"})]})}var o=e.i(996675);function d({selectedLabel:e,onCancel:s}){return(0,t.jsxs)("div",{role:"status","aria-live":"polite",className:"stg:mb-3 stg:flex stg:items-center stg:gap-2 stg:rounded-md stg:border stg:border-dashed stg:border-primary stg:bg-primary-subtle stg:px-3 stg:py-2 stg:text-xs",children:[(0,t.jsx)(c,{className:"stg:size-3.5 stg:shrink-0 stg:text-primary"}),(0,t.jsxs)("span",{className:"stg:flex-1 stg:text-foreground",children:["Select another version to compare with"," ",(0,t.jsx)("code",{className:"stg:rounded stg:bg-muted stg:px-1 stg:py-0.5 stg:font-mono stg:text-2xs stg:font-medium",children:e})]}),(0,t.jsx)("button",{type:"button",onClick:s,className:(0,r.f)("stg:rounded stg:px-2 stg:py-0.5 stg:text-2xs stg:font-medium stg:text-muted-foreground stg:transition-colors","stg:hover:bg-accent-hover stg:hover:text-foreground","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring"),children:"Cancel"})]})}function c({className:e}){return(0,t.jsx)("svg",{className:e,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M5 12V4M5 4l-3 3M11 4v8M11 12l3-3"})})}function u({className:e}){return(0,t.jsx)(o.f,{className:(0,r.f)("stg:flex stg:flex-col stg:gap-4 stg:pt-2",e),label:"Loading version history",children:[1,2,3].map(e=>(0,t.jsxs)("div",{className:"stg:flex stg:gap-3",children:[(0,t.jsxs)("div",{className:"stg:flex stg:flex-col stg:items-center",children:[(0,t.jsx)("div",{className:"stg:size-2.5 stg:animate-pulse stg:rounded-full stg:bg-muted"}),e<3&&(0,t.jsx)("div",{className:"stg:mt-1 stg:w-px stg:flex-1 stg:bg-border"})]}),(0,t.jsxs)("div",{className:"stg:mb-4 stg:flex-1 stg:space-y-2 stg:px-2.5 stg:py-2",children:[(0,t.jsxs)("div",{className:"stg:flex stg:gap-2",children:[(0,t.jsx)("div",{className:"stg:h-4 stg:w-20 stg:animate-pulse stg:rounded stg:bg-muted"}),(0,t.jsx)("div",{className:"stg:h-4 stg:w-12 stg:animate-pulse stg:rounded-full stg:bg-muted"})]}),(0,t.jsx)("div",{className:"stg:h-3 stg:w-32 stg:animate-pulse stg:rounded stg:bg-muted"})]})]},e))})}function m({message:e,className:s}){return(0,t.jsxs)("div",{role:"status",className:(0,r.f)("stg:flex stg:flex-col stg:items-center stg:gap-2 stg:py-8 stg:text-center",s),children:[(0,t.jsx)(x,{className:"stg:size-8 stg:text-muted-foreground-faint"}),(0,t.jsx)("p",{className:"stg:text-sm stg:text-muted-foreground",children:e})]})}function x({className:e}){return(0,t.jsxs)("svg",{className:e,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M8 4v4l2.5 1.5"}),(0,t.jsx)("circle",{cx:"8",cy:"8",r:"6"}),(0,t.jsx)("path",{d:"M2 8a6 6 0 0 1 6-6"})]})}e.s(["f",0,function({entries:e,onEntrySelect:n,onCompare:i,selectedId:l,isLoading:g,emptyMessage:o="No version history available",className:c}){let[x,f]=(0,s.useState)(null),h=(0,s.useCallback)(e=>{i&&(null===x?f(e):(x===e||i(x,e),f(null))),n?.(e)},[i,n,x]),p=(0,s.useCallback)(()=>{f(null)},[]);if(g)return(0,t.jsx)(u,{className:c});if(0===e.length)return(0,t.jsx)(m,{message:o,className:c});let v=x?e.find(e=>e.id===x)?.label??x.slice(0,12):null;return(0,t.jsxs)("div",{className:(0,r.f)("stg:flex stg:flex-col stg:pt-2",c),children:[x&&(0,t.jsx)(d,{selectedLabel:v,onCancel:p}),(0,t.jsx)("div",{role:"list","aria-label":"Version history",children:e.map((s,r)=>(0,t.jsx)(a,{entry:s,isSelected:s.id===l,isCompareSource:s.id===x,isLast:r===e.length-1,onSelect:()=>h(s.id)},s.id))})]})}],784400)},278950,e=>{"use strict";let t=/^https?:\/\/[A-Za-z0-9]([A-Za-z0-9-]*[A-Za-z0-9])?(\.[A-Za-z0-9]([A-Za-z0-9-]*[A-Za-z0-9])?)*(:[0-9]{1,5})?$/;function s(e,t){let s=`/chat/${encodeURIComponent(e)}`;return t?`${s}?k=${encodeURIComponent(t)}`:s}function r(e){return e.endsWith("/")?e.slice(0,-1):e}e.s(["r",0,"k","h",0,32,"_",0,function(e,t){if(!t)return e;let s=e.includes("?")?"&":"?";return`${e}${s}k=${encodeURIComponent(t)}`},"f",0,function(e,t,n){return r(e)+s(t,n)},"y",0,function(e,t,s){let n=s?` token="${s}"`:"";return`<script src="${r(e)}/embed.js" async></script>
2
+ <stigmer-agent channel="${t}"${n}></stigmer-agent>`},"o",0,s,"g",0,function(e){let s=e.trim();return s?t.test(s)?null:"Must be an exact web origin like https://example.com — no path, query, or trailing slash":"Enter an origin, like https://example.com"}])}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,243311,e=>{"use strict";var t=e.i(974265),s=e.i(651023),i=e.i(19738),r=e.i(878894),n=e.i(367240),l=e.i(588092),c=e.i(610595),a=e.i(102508);let o={auth:"Authentication required",permission:"Access denied","not-found":"Section not found",server:"Server error",unavailable:"Service unavailable"};e.s(["default",0,function({error:e,reset:d}){let u=(0,c.V)(e),m=(0,c.g)(e),f=o[u]??"Something went wrong",x="auth"===u||"permission"===u?l.f:r.f;return(0,s.useEffect)(()=>{console.error("[SettingsErrorBoundary]",e)},[e]),(0,t.jsx)("div",{className:"flex flex-col items-center justify-center py-16",children:(0,t.jsxs)("div",{className:"w-full max-w-sm space-y-6 text-center",children:[(0,t.jsx)("div",{className:"bg-destructive-subtle mx-auto flex size-12 items-center justify-center rounded-full",children:(0,t.jsx)(x,{className:"text-destructive size-6"})}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("h2",{className:"text-lg font-semibold",children:f}),(0,t.jsx)("p",{className:"text-muted-foreground text-sm",children:m})]}),(0,t.jsxs)("div",{className:"flex items-center justify-center gap-3",children:[(0,t.jsxs)(a.f,{variant:"outline",onClick:d,children:[(0,t.jsx)(n.f,{className:"mr-1.5 size-3.5"}),"Try again"]}),(0,t.jsx)(i.default,{href:"/settings/members",className:"hover:bg-muted hover:text-foreground inline-flex h-8 items-center justify-center rounded-lg px-2.5 text-sm font-medium transition-colors",children:"Go to Members"})]}),e.digest&&(0,t.jsxs)("p",{className:"text-muted-foreground-subtle font-mono text-xs",children:["Reference: ",e.digest]})]})})}])},588092,e=>{"use strict";let t=(0,e.i(475254).f)("shield-x",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m14.5 9.5-5 5",key:"17q4r4"}],["path",{d:"m9.5 9.5 5 5",key:"18nt4w"}]]);e.s(["f",0,t],588092)}]);
@@ -0,0 +1,2 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,777448,e=>{"use strict";let t;var s=e.i(974265),n=e.i(651023),r=e.i(363178),i=e.i(891287),a=e.i(500343),l=e.i(278950),o=e.i(272012),g=e.i(524108),c=e.i(338300),d=e.i(548497),u=e.i(910304),f=e.i(486167);class m{tokenClient;channelId;storage;storageKey;embedOrigin;linkToken;tokens=(function(e){let t=null,s=null,n=0,r=async()=>{let r=n;try{let s=await e();return s&&r===n&&(t=s),s?s.accessToken:null}finally{r===n&&(s=null)}};return{get:()=>t&&t.expiresAtMs-Date.now()>6e4?Promise.resolve(t.accessToken):s??=r(),invalidate(){n+=1,t=null,s=null}}})(()=>this.mint());constructor(e){this.channelId=e.channelId,this.storage=e.storage??function(){try{let{localStorage:e}=globalThis;if(e){let t="stigmer:storage-probe";return e.setItem(t,"1"),e.removeItem(t),e}}catch{}let e=new Map;return{getItem:t=>e.get(t)??null,setItem:(t,s)=>{e.set(t,s)}}}(),this.storageKey=`stigmer:guest-id:${e.channelId}`,this.embedOrigin=e.embedOrigin??"",this.linkToken=e.linkToken??"";let t=(0,g.f)({baseUrl:e.baseUrl,interceptors:[f.J,f.f]});this.tokenClient=(0,c.f)(d.H,t)}get guestCookieId(){return h(this.storage,this.storageKey)}getAccessToken=()=>this.tokens.get();async mint(){try{let e=await this.tokenClient.mintGuestToken((0,i.f)(d.n,{channelId:this.channelId,guestCookieId:h(this.storage,this.storageKey)??"",embedOrigin:this.embedOrigin,linkToken:this.linkToken}));return function(e,t,s){try{e.setItem(t,s)}catch{}}(this.storage,this.storageKey,e.guestCookieId),{accessToken:e.accessToken,expiresAtMs:Date.now()+1e3*e.expiresIn}}catch(e){throw(0,u.t)(e)}}}function h(e,t){try{return e.getItem(t)}catch{return null}}let x="stigmer-embed";function p(e){return{source:x,v:1,...e}}let b="null";function v(){try{return window.self!==window.top}catch{return!0}}function k(e,t){if(!v())return;let s=t===b?"*":t;window.parent.postMessage(p(e),s)}var y=e.i(163308),w=e.i(893976),j=e.i(610595),N=e.i(345808),I=e.i(643531),C=e.i(664659),T=e.i(717521),T=T,A=e.i(475254);let $=(0,A.f)("message-circle",[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]]),M=(0,A.f)("square-pen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);var z=e.i(37727),R=e.i(196716),S=e.i(468806),U=e.i(188482),O=e.i(364354),E=e.i(275051),P=e.i(332250),L=e.i(293022);let K={kind:"idle"};function G(e,t){switch(t.type){case"set-open":return e.open===t.open?e:{...e,open:t.open};case"set-session":return e.sessionId===t.sessionId?e:{...e,sessionId:t.sessionId,activity:K,seenRunId:null};case"activity":return{...e,activity:t.activity};case"seen":return"ended"===e.activity.kind&&e.seenRunId!==e.activity.runId?{...e,seenRunId:e.activity.runId}:e}}var Z=e.i(839987),q=e.i(748008);let D=null;function H(){return D??=e.A(38232).then(e=>t=e.SessionViewer,e=>{throw D=null,e})}function F(e){let[r,i]=(0,n.useState)(()=>({viewer:t}));if((0,n.useEffect)(()=>{if(t)return;let e=!0;return H().then(t=>e&&i({viewer:t}),()=>e&&i({failed:!0})),()=>{e=!1}},[]),r.viewer){let t=r.viewer;return(0,s.jsx)(t,{...e})}return r.failed?(0,s.jsxs)("div",{role:"alert",className:(0,w.f)("stg:flex stg:h-full stg:w-full stg:flex-col stg:items-center stg:justify-center stg:gap-1 stg:p-6 stg:text-center stg:text-sm stg:text-muted-foreground",e.className),children:[(0,s.jsx)("span",{children:"The conversation could not load."}),(0,s.jsx)("span",{children:"Reload the page to try again."})]}):(0,s.jsx)("div",{className:(0,w.f)("stg:flex stg:h-full stg:w-full stg:flex-col",e.className),children:(0,s.jsx)(q.f,{className:"stg:flex-1 stg:px-0"})})}function V({agent:e,org:t,variant:r="page",audience:i="endUser",sessionId:a,defaultSessionId:l=null,onSessionChange:o,open:g,defaultOpen:c,onOpenChange:d,title:u,inspector:f,runConfig:m,threadSlots:h,heading:x,placeholder:p,enableGitHub:b,includeMyVault:v,onError:k,className:y}){let j=(0,n.useMemo)(()=>(function(e){if("string"!=typeof e)return e;let t=e.split("/");if(2!==t.length||""===t[0]||""===t[1])throw Error(`AgentChat: agent "${e}" is not "org/slug" (for example "acme/variance-reporter")`);return{org:t[0],slug:t[1]}})(e),[e]),N=t??j.org,[I,C]=(0,n.useReducer)(G,void 0,()=>({open:c??"panel"===r,sessionId:l,activity:K,seenRunId:null})),T=void 0!==a?a:I.sessionId;I.sessionId!==T&&C({type:"set-session",sessionId:T});let A="page"===r||(g??I.open),{agent:$}=(0,R.f)(void 0===u?j.org:null,void 0===u?j.slug:null),M=u??($?.metadata?.name||j.slug),z=(0,n.useCallback)(e=>{void 0===g&&C({type:"set-open",open:e}),d?.(e)},[g,d]),S=(0,n.useCallback)(e=>{void 0===a&&C({type:"set-session",sessionId:e}),o?.(e)},[a,o]);(0,n.useEffect)(()=>{H().catch(()=>{})},[]),(0,n.useEffect)(()=>{A&&C({type:"seen"})},[A,I.activity]);let U=(0,n.useCallback)(e=>C({type:"activity",activity:e}),[]),[O,P]=(0,n.useState)(null),L=(0,n.useCallback)(e=>{P(null),S(e)},[S]),q=(0,n.useCallback)((e,t)=>{P(e),k?.(e,t)},[k]),D="page"===r?f:void 0,W=null!==T?(0,s.jsx)(Z.f.Provider,{value:U,children:(0,s.jsx)(F,{sessionId:T,org:N,audience:i,runConfig:m,inspector:D,threadSlots:h,enableGitHub:b},T)}):(0,s.jsx)(E.f,{org:N,audience:i,initialAgentRef:j,runConfig:m,inspector:D,heading:x,placeholder:p,enableGitHub:b,includeMyVault:v,autoFocus:"page"===r,onSessionCreated:L,onError:q,footerContent:O?(0,s.jsx)("p",{role:"alert",className:"stg:text-center stg:text-xs stg:text-destructive",children:O}):void 0});if("page"===r)return(0,s.jsx)("div",{className:(0,w.f)("stg:h-full stg:w-full",y),children:W});let B=null===T?void 0:()=>S(null);return"panel"===r?(0,s.jsx)(Y,{name:M,open:A,onNewConversation:B,onClose:d?()=>z(!1):void 0,className:y,children:W}):(0,s.jsx)(_,{name:M,open:A,onOpenChange:z,state:I,onNewConversation:B,className:y,children:W})}let W="stg:flex stg:size-10 stg:shrink-0 stg:items-center stg:justify-center stg:rounded-md stg:text-muted-foreground stg:transition-colors stg:hover:bg-muted stg:hover:text-foreground stg:disabled:pointer-events-none stg:disabled:opacity-40 stg:focus-visible:outline-2 stg:focus-visible:outline-ring";function B({name:e,headingId:t,onNewConversation:n,onClose:r,closeIcon:i}){return(0,s.jsxs)("header",{className:"stg:flex stg:h-13 stg:shrink-0 stg:items-center stg:gap-2.5 stg:border-b stg:border-border stg:pr-2 stg:pl-4",children:[(0,s.jsx)("span",{"aria-hidden":"true",className:"stg:flex stg:size-7 stg:shrink-0 stg:items-center stg:justify-center stg:rounded-full stg:bg-foreground stg:text-xs stg:font-semibold stg:text-background",children:e.charAt(0).toUpperCase()}),(0,s.jsx)("h2",{id:t,className:"stg:min-w-0 stg:flex-1 stg:truncate stg:text-sm stg:font-semibold stg:text-foreground",children:e}),(0,s.jsxs)(U.W,{children:[(0,s.jsx)(U.y,{render:(0,s.jsx)("button",{type:"button","aria-label":"New conversation",disabled:void 0===n,onClick:n,className:W,children:(0,s.jsx)(M,{className:"stg:size-4.5","aria-hidden":"true"})})}),(0,s.jsx)(U.Y,{children:"New conversation"})]}),r&&(0,s.jsxs)(U.W,{children:[(0,s.jsx)(U.y,{render:(0,s.jsx)("button",{type:"button","aria-label":"Close the chat",onClick:r,className:W,children:i})}),(0,s.jsx)(U.Y,{children:"Close"})]})]})}function Y({name:e,open:t,onNewConversation:r,onClose:i,className:a,children:l}){let o=(0,n.useId)();return(0,s.jsxs)("section",{"aria-labelledby":o,className:(0,w.f)(t?"stg:flex":"stg:hidden","stg:h-full stg:w-full stg:flex-col stg:bg-background",a),children:[(0,s.jsx)(B,{name:e,headingId:o,onNewConversation:r,onClose:i,closeIcon:(0,s.jsx)(z.X,{className:"stg:size-4.5","aria-hidden":"true"})}),(0,s.jsx)("div",{className:"stg:min-h-0 stg:flex-1",children:l})]})}function _({name:e,open:t,onOpenChange:r,state:i,onNewConversation:a,className:l,children:o}){!function(e){let[,t]=(0,n.useState)(0);(0,n.useEffect)(()=>{if(!e)return;let s=setInterval(()=>t(e=>e+1),1e3);return()=>clearInterval(s)},[e])}(!t&&"working"===i.activity.kind);let g=function(e,t,s){let{activity:n}=e;if("working"===n.kind){if(n.waiting)return{icon:"waiting",label:"Needs your answer",detail:void 0,ariaLabel:`Open the chat. ${t} needs your answer`,announcement:`${t} needs your answer`};let e=n.phrase,r=(0,P.f)(s-n.startedAtMs);return{icon:"working",label:e,detail:r,ariaLabel:`Open the chat. ${t}: ${e}, ${r}`,announcement:""}}if("ended"===n.kind&&n.runId!==e.seenRunId){let e=(0,L.f)(n.phase),s=0===n.filesMade?void 0:`${n.filesMade} ${1===n.filesMade?"file":"files"} made`,r=void 0===s?e:`${e}, ${s}`;return{icon:"completed"===n.phase?"done":"ended",label:e,detail:s,ariaLabel:`Open the chat. ${t}: ${r}`,announcement:`${t}: ${r}`}}return{icon:"chat",label:`Ask ${t}`,detail:void 0,ariaLabel:`Open the chat with ${t}`,announcement:""}}(i,e,Date.now()),c=(0,n.useId)(),d=(0,O.P)(),u=(0,n.useRef)(null),f=(0,n.useRef)(null),m=(0,n.useRef)(!1),[h,x]=(0,n.useState)(!1);(0,n.useEffect)(()=>x(!0),[]),(0,n.useEffect)(()=>{m.current&&(m.current=!1,(t?u.current:f.current)?.focus())},[t]);let p=(0,n.useCallback)(e=>{m.current=!0,r(e)},[r]),b=(0,n.useCallback)(e=>{if("Escape"!==e.key||e.defaultPrevented||!t)return;let s=u.current,n=e.target;null!==s&&s.contains(n)&&n.closest("dialog")===s.closest("dialog")&&(e.preventDefault(),p(!1))},[t,p]);return h&&null!==d?(0,N.createPortal)((0,s.jsxs)("div",{onKeyDown:b,className:(0,w.f)("stg:fixed stg:right-6 stg:bottom-6 stg:z-50 stg:flex stg:flex-col stg:items-end stg:gap-4",l),children:[(0,s.jsx)(S.f,{open:t,onOpenChange:p,modal:!1,"aria-labelledby":c,className:(0,w.f)("stg:m-0 stg:h-[min(52rem,calc(100dvh-7.5rem))] stg:w-[24.375rem] stg:max-w-[calc(100vw-3rem)] stg:overflow-hidden stg:rounded-2xl stg:bg-background stg:text-foreground stg:open:flex","stg:max-sm:fixed stg:max-sm:inset-0 stg:max-sm:h-dvh stg:max-sm:w-full stg:max-sm:max-w-none stg:max-sm:rounded-none stg:max-sm:border-0"),children:(0,s.jsxs)("div",{ref:u,tabIndex:-1,className:"stg:flex stg:h-full stg:w-full stg:flex-col stg:outline-none",children:[(0,s.jsx)(B,{name:e,headingId:c,onNewConversation:a,onClose:()=>p(!1),closeIcon:(0,s.jsx)(C.f,{className:"stg:size-5","aria-hidden":"true"})}),(0,s.jsx)("div",{className:"stg:min-h-0 stg:flex-1",children:o})]})}),(0,s.jsx)(J,{buttonRef:f,name:e,open:t,view:g,onClick:()=>p(!t)}),(0,s.jsx)("span",{className:"stg:sr-only","aria-live":"polite",children:t?"":g.announcement})]}),d??document.body):null}function J({buttonRef:e,name:t,open:n,view:r,onClick:i}){return(0,s.jsx)("button",{ref:e,type:"button","aria-expanded":n,"aria-label":n?`Close the chat with ${t}`:r.ariaLabel,onClick:i,className:(0,w.f)("stg:flex stg:h-12 stg:items-center stg:gap-2.5 stg:rounded-full stg:bg-foreground stg:text-background stg:shadow-lg stg:transition-opacity stg:hover:opacity-90 stg:focus-visible:outline-2 stg:focus-visible:outline-offset-2 stg:focus-visible:outline-ring",n?"stg:size-14 stg:justify-center stg:max-sm:hidden":"stg:max-w-[calc(100vw-3rem)] stg:pr-5 stg:pl-4"),children:n?(0,s.jsx)(C.f,{className:"stg:size-5","aria-hidden":"true"}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(X,{icon:r.icon}),(0,s.jsx)("span",{className:"stg:truncate stg:text-sm stg:font-semibold",children:r.label}),void 0!==r.detail&&(0,s.jsx)("span",{className:"stg:shrink-0 stg:text-sm stg:opacity-60",children:r.detail})]})})}function X({icon:e}){switch(e){case"working":return(0,s.jsx)(T.f,{className:"stg:size-4.5 stg:shrink-0 stg:motion-safe:animate-spin","aria-hidden":"true"});case"waiting":return(0,s.jsx)("span",{"aria-hidden":"true",className:"stg:mx-1 stg:size-2.5 stg:shrink-0 stg:rounded-full stg:bg-background"});case"done":return(0,s.jsx)(I.f,{className:"stg:size-4.5 stg:shrink-0","aria-hidden":"true"});case"ended":return(0,s.jsx)("span",{"aria-hidden":"true",className:"stg:mx-1 stg:size-2.5 stg:shrink-0 stg:rounded-full stg:border-2 stg:border-background"});case"chat":return(0,s.jsx)($,{className:"stg:size-4.5 stg:shrink-0","aria-hidden":"true"})}}var Q=e.i(255817),ee=e.i(616701),et=e.i(996675);function es({channelId:e,heading:t,placeholder:r,showPoweredBy:l=!0,onSessionCreated:o,linkAudience:g="public",linkToken:c,className:d}){let{profile:f,isLoading:m,error:h,refetch:x}=function(e,t){let s=(0,Q.f)(),n=t?.audience??"public",r=t?.linkToken??"",l=e?async()=>{try{return"org"===n?await s.channel.getAgentProfileForMember(e):await s.channel.getAgentProfile((0,i.f)(a.j,{channelId:e,linkToken:r}))}catch(e){if((0,u.c)(e))return null;throw e}}:null,{data:o,isLoading:g,isRefetching:c,error:d,refetch:f}=(0,ee.f)(l,[e,n,r,s],null);return{profile:o,isLoading:g,isRefetching:c,error:d,refetch:f}}(e,{audience:g,linkToken:c}),p=(0,n.useMemo)(()=>{let e;return f?void 0===(e=f.agentRef)||""===e.slug?null:{org:e.org,slug:e.slug,...""!==e.version&&{version:e.version},kind:e.kind}:null},[f]),b=(0,n.useCallback)(e=>{null!==e&&o?.(e)},[o]);if(m)return(0,s.jsx)(et.f,{className:(0,w.f)("stg:flex stg:h-full stg:w-full stg:items-center stg:justify-center",d),label:"Loading agent",children:(0,s.jsx)(en,{})});if(h)return(0,s.jsx)("div",{className:(0,w.f)("stg:flex stg:h-full stg:w-full stg:items-center stg:justify-center",d),children:(0,s.jsx)(er,{title:"Something went wrong",message:(0,j.g)(h),onRetry:x})});if(!f||!p)return(0,s.jsx)("div",{className:(0,w.f)("stg:flex stg:h-full stg:w-full stg:items-center stg:justify-center",d),children:(0,s.jsx)(er,{title:"This agent isn't available",message:"The link may be incorrect, or it may have been turned off."})});let{org:v,slug:k}=f;return(0,s.jsxs)("div",{className:(0,w.f)("stg:flex stg:h-full stg:w-full stg:flex-col",d),children:[(0,s.jsxs)("header",{className:"stg:flex stg:items-center stg:gap-3 stg:border-b stg:border-border stg:px-4 stg:py-3",children:[f.iconUrl?(0,s.jsx)("img",{src:f.iconUrl,alt:"",className:"stg:size-8 stg:rounded-md stg:object-cover"}):(0,s.jsx)("div",{"aria-hidden":"true",className:"stg:flex stg:size-8 stg:items-center stg:justify-center stg:rounded-md stg:bg-muted stg:text-sm stg:font-semibold stg:text-muted-foreground",children:(f.name||k).charAt(0).toUpperCase()}),(0,s.jsxs)("div",{className:"stg:min-w-0",children:[(0,s.jsx)("h1",{className:"stg:truncate stg:text-sm stg:font-semibold stg:text-foreground",children:f.name||k}),f.description&&(0,s.jsx)("p",{className:"stg:truncate stg:text-xs stg:text-muted-foreground",children:f.description})]})]}),(0,s.jsx)("div",{className:"stg:min-h-0 stg:flex-1",children:(0,s.jsx)(V,{agent:p,org:v,audience:"guest",title:f.name||k,includeMyVault:"org"===g,enableGitHub:!1,heading:t??`Chat with ${f.name||k}`,placeholder:r??"Ask anything…",onSessionChange:b})}),l&&(0,s.jsx)("footer",{className:"stg:border-t stg:border-border stg:px-4 stg:py-2 stg:text-center",children:(0,s.jsx)("a",{href:"https://stigmer.ai",target:"_blank",rel:"noopener noreferrer",className:"stg:text-2xs stg:text-muted-foreground stg:hover:text-foreground stg:transition-colors",children:"Powered by Stigmer"})})]})}function en(){return(0,s.jsxs)("div",{className:"stg:w-full stg:max-w-sm stg:space-y-3 stg:px-6",children:[(0,s.jsx)("div",{className:"stg:mx-auto stg:h-8 stg:w-8 stg:animate-pulse stg:rounded-md stg:bg-muted"}),(0,s.jsx)("div",{className:"stg:mx-auto stg:h-4 stg:w-2/3 stg:animate-pulse stg:rounded stg:bg-muted"}),(0,s.jsx)("div",{className:"stg:mx-auto stg:h-3 stg:w-1/2 stg:animate-pulse stg:rounded stg:bg-muted"})]})}function er({title:e,message:t,onRetry:n}){return(0,s.jsxs)("div",{className:"stg:mx-6 stg:w-full stg:max-w-sm stg:rounded-lg stg:border stg:border-border stg:bg-card stg:p-6 stg:text-center stg:shadow-sm",children:[(0,s.jsx)("h2",{className:"stg:text-base stg:font-semibold stg:text-foreground",children:e}),(0,s.jsx)("p",{className:"stg:mt-1 stg:text-sm stg:text-muted-foreground",children:t}),n&&(0,s.jsx)("button",{type:"button",onClick:n,className:(0,w.f)("stg:mt-4 stg:inline-flex stg:items-center stg:justify-center stg:rounded-md stg:px-4 stg:py-2 stg:text-sm stg:font-medium","stg:bg-primary stg:text-primary-foreground stg:hover:bg-primary-hover","stg:transition-colors"),children:"Try again"})]})}e.i(67407);var ei=e.i(800692),ea=e.i(472402),el=e.i(107141),eo=e.i(388487);function eg({onSignIn:e}){return(0,s.jsx)("div",{className:"flex h-full w-full items-center justify-center",children:(0,s.jsxs)("div",{className:"mx-6 w-full max-w-sm rounded-lg border border-border bg-card p-6 text-center shadow-sm",children:[(0,s.jsx)("h2",{className:"text-base font-semibold text-foreground",children:"This agent isn't available"}),(0,s.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:"The link may be incorrect, it may have been turned off, or the agent may be restricted to members of its organization."}),(0,s.jsx)("button",{type:"button",onClick:e,className:"mt-4 inline-flex items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary-hover",children:"Sign in if you have access"})]})})}e.s(["default",0,function(){let e=(0,el.f)("channel",1),t=function(){let[e]=(0,n.useState)(()=>new URLSearchParams(window.location.search).get(l.r)??"");return e}(),g=function(){let{resolvedTheme:e}=(0,r.i)(),[t]=(0,n.useState)(()=>new URLSearchParams(window.location.search).get("theme"));return"light"===t||"dark"===t?t:"dark"===e?"dark":"light"}(),c=(0,ei.f)(),[d,f]=(0,n.useState)(()=>v()?{kind:"resolving"}:{kind:"standalone"});(0,n.useEffect)(()=>{if("resolving"!==d.kind)return;let e=!1;return(function(e=1500){var t;let s,n,r=(n=(s=window.location.ancestorOrigins)&&s.length>0?s[0]:null)&&n!==b?n:null;if(r)return Promise.resolve(r);let i=function(){let e=document.referrer;if(!e)return null;try{return new URL(e).origin}catch{return null}}();return i?Promise.resolve(i):(t=e,new Promise(e=>{let s=!1,n=t=>{s||(s=!0,window.removeEventListener("message",r),clearTimeout(i),e(t))},r=e=>{var t;let s;e.source===window.parent&&((s="object"!=typeof(t=e.data)||null===t||t.source!==x||1!==t.v||"string"!=typeof t.type?null:t)&&"init"===s.type?{type:"init"}:null)&&n(""===e.origin?b:e.origin)},i=setTimeout(()=>n(b),t);window.addEventListener("message",r),window.parent.postMessage(p({type:"hello"}),"*")}))})().then(t=>{e||f({kind:"active",parentOrigin:t})}),()=>{e=!0}},[d.kind]);let[h,w]=(0,n.useState)("probing");(0,n.useEffect)(()=>{if("standalone"!==d.kind||!e)return;let s=!1;return new o.f({baseUrl:(0,ea.T)(),getAccessToken:()=>null}).channel.getAgentProfile((0,i.f)(a.j,{channelId:e,linkToken:t})).then(()=>{s||w("guest")},e=>{s||w((0,u.c)(e)?"member":"guest")}),()=>{s=!0}},[d.kind,e,t]);let j=(0,n.useMemo)(()=>{if(!e||"resolving"===d.kind||"refused"===d.kind)return null;let s=(0,ea.T)(),n=function(e){if(!e.baseUrl)throw Error('createGuestAuth: baseUrl is required (e.g., "https://api.stigmer.ai")');if(!e.channelId)throw Error("createGuestAuth: channelId is required — the channel's id from the chat link");return new m(e)}({baseUrl:s,channelId:e,...t?{linkToken:t}:{},..."active"===d.kind?{embedOrigin:d.parentOrigin}:{}});return{client:new o.f({baseUrl:s,getAccessToken:n.getAccessToken}),guestAuth:n}},[e,t,d]),N=(0,n.useMemo)(()=>{if(!c.accessToken&&c.isLoading)return null;let e=c.accessToken;return new o.f({baseUrl:(0,ea.T)(),getAccessToken:()=>e})},[c.accessToken,c.isLoading]);return((0,n.useEffect)(()=>{if("active"!==d.kind||!j)return;let e=!1;return j.guestAuth.getAccessToken().then(()=>{e||k({type:"ready"},d.parentOrigin)},t=>{!e&&((0,u.a)(t)||(0,u.c)(t))&&(k({type:"refused"},d.parentOrigin),f({kind:"refused"}))}),()=>{e=!0}},[d,j]),e&&j)?"standalone"===d.kind&&"member"===h?c.isLoading||!N?null:c.isAuthenticated?(0,s.jsx)(y.f,{client:N,colorMode:g,loadMermaid:eo.f,children:(0,s.jsx)("div",{className:"h-screen bg-background text-foreground",children:(0,s.jsx)(es,{channelId:e,linkAudience:"org"})})}):(0,s.jsx)(y.f,{client:j.client,colorMode:g,children:(0,s.jsx)("div",{className:"h-screen bg-background text-foreground",children:(0,s.jsx)(eg,{onSignIn:c.login})})}):"standalone"===d.kind&&"probing"===h?null:(0,s.jsx)(y.f,{client:j.client,colorMode:g,loadMermaid:eo.f,children:(0,s.jsx)("div",{className:"h-screen bg-background text-foreground",children:(0,s.jsx)(es,{channelId:e,linkToken:t})})}):null}],777448)},643531,e=>{"use strict";var t=e.i(678745);e.s(["f",()=>t.f])},664659,e=>{"use strict";let t=(0,e.i(475254).f)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);e.s(["f",0,t],664659)},278950,e=>{"use strict";let t=/^https?:\/\/[A-Za-z0-9]([A-Za-z0-9-]*[A-Za-z0-9])?(\.[A-Za-z0-9]([A-Za-z0-9-]*[A-Za-z0-9])?)*(:[0-9]{1,5})?$/;function s(e,t){let s=`/chat/${encodeURIComponent(e)}`;return t?`${s}?k=${encodeURIComponent(t)}`:s}function n(e){return e.endsWith("/")?e.slice(0,-1):e}e.s(["r",0,"k","h",0,32,"_",0,function(e,t){if(!t)return e;let s=e.includes("?")?"&":"?";return`${e}${s}k=${encodeURIComponent(t)}`},"f",0,function(e,t,r){return n(e)+s(t,r)},"y",0,function(e,t,s){let r=s?` token="${s}"`:"";return`<script src="${n(e)}/embed.js" async></script>
2
+ <stigmer-agent channel="${t}"${r}></stigmer-agent>`},"o",0,s,"g",0,function(e){let s=e.trim();return s?t.test(s)?null:"Must be an exact web origin like https://example.com — no path, query, or trailing slash":"Enter an origin, like https://example.com"}])}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,311015,e=>{"use strict";var t=e.i(974265),s=e.i(893976),r=e.i(65642),n=e.i(651023),i=e.i(475254);let a=(0,i.f)("package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]),l=(0,i.f)("search-x",[["path",{d:"m13.5 8.5-5 5",key:"1cs55j"}],["path",{d:"m8.5 8.5 5 5",key:"a8mexj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]),g=(0,i.f)("lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);var o=e.i(63209);let d="stg:h-10 stg:w-10";e.s(["f",0,function({variant:e,resourceLabel:i,icon:c,title:u,description:m,errorMessage:x,action:h,children:f,className:p}){let j=function(e){let{variant:t,resourceLabel:s="resources",title:r,description:i,errorMessage:c}=e;return(0,n.useMemo)(()=>{let e=function(e,t){switch(e){case"first-use":return{title:`No ${t} yet`,description:`Create ${"agents"===t?"an agent":`a ${t.replace(/s$/,"")}`} to get started.`};case"zero-results":return{title:"No results found",description:"Try adjusting your search or filters."};case"permission":return{title:`No access to ${t}`,description:"You don't have permission to view these resources. Contact your organization admin."};case"error":return{title:"Something went wrong",description:"We couldn't load this content. Please try again."}}}(t,s);return{title:r??e.title,description:"error"===t&&c?c:i??e.description,defaultIcon:function(e){switch(e){case"first-use":return(0,n.createElement)(a,{className:d});case"zero-results":return(0,n.createElement)(l,{className:d});case"permission":return(0,n.createElement)(g,{className:d});case"error":return(0,n.createElement)(o.f,{className:d})}}(t),role:"error"===t?"alert":"status"}},[t,s,r,i,c])}({variant:e,resourceLabel:i,title:u,description:m,errorMessage:x});return(0,t.jsxs)("div",{role:j.role,className:(0,s.f)("stg:flex stg:flex-col stg:items-center stg:gap-3 stg:py-12 stg:text-center",p),children:[(0,t.jsx)("div",{className:"stg:text-muted-foreground-faint",children:c??j.defaultIcon}),(0,t.jsxs)("div",{className:"stg:flex stg:flex-col stg:gap-1",children:[(0,t.jsx)("p",{className:"stg:m-0 stg:text-sm stg:font-medium stg:text-muted-foreground",children:j.title}),(0,t.jsx)("p",{className:"stg:m-0 stg:max-w-sm stg:text-xs stg:text-muted-foreground",children:j.description})]}),f?(0,t.jsx)("div",{className:"stg:mt-1",children:f}):h&&(0,t.jsx)(r.f,{variant:"error"===e?"outline":"primary",icon:h.icon,onClick:h.onClick,className:"stg:mt-1",children:h.label})]})}],311015)},476007,e=>{"use strict";var t=e.i(974265),s=e.i(651023),r=e.i(610595),n=e.i(893976);let i={auth:"Authentication required",permission:"Access denied","not-found":"Not found",validation:"Invalid request",server:"Server error",unavailable:"Service unavailable",cancelled:"Request cancelled",unknown:"Something went wrong"};function a({className:e}){return(0,t.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:e,"aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M7.13 2.5a1 1 0 0 1 1.74 0l5.5 9.5A1 1 0 0 1 13.5 13.5h-11a1 1 0 0 1-.87-1.5l5.5-9.5z"}),(0,t.jsx)("path",{d:"M8 6v3"}),(0,t.jsx)("circle",{cx:"8",cy:"11",r:"0.5",fill:"currentColor",stroke:"none"})]})}function l({className:e}){return(0,t.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:e,"aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M8 1.5l5 2v4c0 3.5-2.5 5.5-5 6.5-2.5-1-5-3-5-6.5v-4l5-2z"}),(0,t.jsx)("path",{d:"M6 6.5l4 4M10 6.5l-4 4"})]})}function g({className:e}){return(0,t.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:e,"aria-hidden":"true",children:(0,t.jsx)("path",{d:"M4 6l4 4 4-4"})})}function o({className:e}){return(0,t.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:e,"aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M2 6.5h4v-4"}),(0,t.jsx)("path",{d:"M3.5 11.5a5.5 5.5 0 1 0 .5-6l-2 1"})]})}e.s(["f",0,function({error:e,title:d,retry:c,className:u}){let[m,x]=(0,s.useState)(!1);if(!e)return null;let h=(0,r.V)(e),f=(0,r.g)(e),p=(0,r.X)(e),j=(0,r.f)(e);return(0,t.jsx)("div",{role:"alert",className:(0,n.f)("stg:bg-destructive-subtle stg:border-destructive/20 stg:text-destructive stg:rounded-lg stg:border stg:p-4",u),children:(0,t.jsxs)("div",{className:"stg:flex stg:items-start stg:gap-3",children:["auth"===h||"permission"===h?(0,t.jsx)(l,{className:"stg:mt-0.5 stg:size-4 stg:shrink-0"}):(0,t.jsx)(a,{className:"stg:mt-0.5 stg:size-4 stg:shrink-0"}),(0,t.jsxs)("div",{className:"stg:min-w-0 stg:flex-1 stg:space-y-1",children:[(0,t.jsx)("p",{className:"stg:text-sm stg:font-medium",children:d??i[h]}),(0,t.jsx)("p",{className:"stg:m-0 stg:text-destructive stg:text-sm",children:f}),p&&(0,t.jsxs)("div",{className:"stg:pt-1",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>x(e=>!e),className:"stg:text-destructive stg:hover:underline stg:inline-flex stg:items-center stg:gap-1 stg:text-xs stg:transition-colors",children:[(0,t.jsx)(g,{className:(0,n.f)("stg:size-3 stg:transition-transform",m&&"stg:rotate-180")}),"Technical details"]}),m&&(0,t.jsxs)("dl",{className:"stg:text-destructive stg:mt-1.5 stg:space-y-0.5 stg:font-mono stg:text-xs",children:[(0,t.jsxs)("div",{className:"stg:flex stg:gap-2",children:[(0,t.jsx)("dt",{className:"stg:shrink-0",children:"Method:"}),(0,t.jsx)("dd",{className:"stg:truncate",children:p.method})]}),(0,t.jsxs)("div",{className:"stg:flex stg:gap-2",children:[(0,t.jsx)("dt",{className:"stg:shrink-0",children:"Path:"}),(0,t.jsx)("dd",{className:"stg:truncate",children:p.path})]})]})]})]}),c&&j&&(0,t.jsxs)("button",{type:"button",onClick:c,className:(0,n.f)("stg:inline-flex stg:shrink-0 stg:items-center stg:gap-1.5 stg:rounded-md stg:border stg:px-2.5 stg:py-1.5 stg:text-xs stg:font-medium","stg:border-destructive/20 stg:text-destructive stg:hover:bg-destructive-subtle","stg:transition-colors"),children:[(0,t.jsx)(o,{className:"stg:size-3"}),"Retry"]})]})})}])},796896,e=>{"use strict";e.s(["j",0,"The aud claim your identity provider puts in tokens for Stigmer: an API identifier or client ID your organization registered there","_",0,"API identifier or client ID","i",0,"Federation issuers are managed by your organization's admins."])},853994,e=>{"use strict";var t=e.i(891287),s=e.i(997288),r=e.i(255817),n=e.i(766330),i=e.i(205413),a=e.i(616701);e.s(["f",0,function(e){let l=(0,r.f)(),{data:g,isLoading:o,isRefetching:d,error:c,refetch:u}=(0,a.f)(e?()=>(0,i.T)(r=>l.federationIssuer.list((0,t.f)(s.z,{org:e,pageSize:n.J,pageToken:r}))):null,[e,l],[]);return{federationIssuers:g,isLoading:o,isRefetching:d,error:c,refetch:u}}])},630983,e=>{"use strict";var t=e.i(974265),s=e.i(893976);function r({className:e}){return(0,t.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:e,"aria-hidden":"true",children:[(0,t.jsx)("circle",{cx:"8",cy:"8",r:"6.25"}),(0,t.jsx)("path",{d:"M8 7v4"}),(0,t.jsx)("circle",{cx:"8",cy:"5",r:"0.5",fill:"currentColor",stroke:"none"})]})}e.s(["f",0,function({children:e,className:n}){return(0,t.jsxs)("div",{role:"status",className:(0,s.f)("stg:bg-muted-subtle stg:text-muted-foreground stg:flex stg:items-start stg:gap-2.5 stg:rounded-lg stg:border stg:border-transparent stg:px-4 stg:py-3",n),children:[(0,t.jsx)(r,{className:"stg:mt-0.5 stg:size-4 stg:shrink-0"}),(0,t.jsx)("p",{className:"stg:text-xs stg:leading-relaxed",children:e})]})}])},66724,e=>{"use strict";var t=e.i(974265),s=e.i(893976);e.s(["f",0,function({title:e,description:r,actions:n,headingLevel:i=1,headingId:a,className:l}){return(0,t.jsxs)("header",{className:(0,s.f)("stg:flex stg:flex-col stg:gap-1",l),children:[(0,t.jsxs)("div",{className:"stg:flex stg:min-h-8 stg:flex-wrap stg:items-center stg:justify-between stg:gap-x-6 stg:gap-y-2",children:[(0,t.jsx)(1===i?"h1":"h2",{id:a,className:"stg:m-0 stg:text-xl stg:font-semibold stg:tracking-tight stg:text-foreground",children:e}),null!=n&&!1!==n&&(0,t.jsx)("div",{className:"stg:flex stg:shrink-0 stg:items-center stg:gap-2",children:n})]}),null!=r&&(0,t.jsx)("p",{className:"stg:m-0 stg:max-w-2xl stg:text-sm stg:text-muted-foreground",children:r})]})}])},252771,e=>{"use strict";var t=e.i(974265),s=e.i(651023),r=e.i(893976),n=e.i(610595),i=e.i(803874),a=e.i(379410),l=e.i(891287),g=e.i(459153),o=e.i(255817),d=e.i(781836);function c({currentSlug:e,rename:i,isRenaming:l,error:g,clearError:o,onRenamed:d,hint:u,label:m="Slug",className:x}){let h=(0,s.useId)(),[f,p]=(0,s.useState)(e),[j,v]=(0,s.useState)(null);(0,s.useEffect)(()=>{p(e),v(null)},[e]);let b=l||null!==j,N=f.trim(),k=N.length>0&&N!==e&&!b,y=(0,s.useCallback)(async()=>{if(k){o();try{let t=await i(N);v(e),d(t)}catch{}}},[k,o,i,N,e,d]);return(0,t.jsxs)("div",{className:(0,r.f)("stg:space-y-1",x),children:[(0,t.jsx)("label",{htmlFor:h,className:"stg:text-2xs stg:font-medium stg:text-muted-foreground stg:uppercase stg:tracking-wider",children:m}),(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-2",children:[(0,t.jsx)("input",{id:h,type:"text",value:f,onChange:e=>{p(e.target.value),o()},onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),y())},disabled:b,spellCheck:!1,autoComplete:"off",className:(0,r.f)("stg:w-full stg:rounded-md stg:border stg:border-input stg:bg-background stg:px-2.5 stg:py-1.5 stg:font-mono stg:text-xs stg:text-foreground","stg:focus-visible:outline-none stg:focus-visible:ring-1 stg:focus-visible:ring-ring","stg:disabled:pointer-events-none stg:disabled:opacity-50")}),(0,t.jsxs)("button",{type:"button",onClick:()=>void y(),disabled:!k,className:(0,r.f)("stg:inline-flex stg:shrink-0 stg:items-center stg:gap-1.5 stg:rounded-md stg:px-3 stg:py-1.5 stg:text-xs stg:font-medium","stg:border stg:border-input stg:text-foreground stg:hover:bg-accent-hover","stg:disabled:pointer-events-none stg:disabled:opacity-40"),children:[b&&(0,t.jsx)(a.f,{size:12}),"Rename"]})]}),g?(0,t.jsx)("p",{className:"stg:text-destructive stg:text-2xs",role:"alert",children:(0,n.g)(g)}):(0,t.jsx)("p",{className:"stg:text-2xs stg:text-muted-foreground",children:u})]})}e.s(["V",0,c,"e",0,function({kind:e,resourceId:r,currentSlug:n,onRenamed:a,fallback:u=null,className:m}){let x=(0,i.f)(r?{kind:e,id:r}:null,"can_delete",{fail:"closed"}),{rename:h,isRenaming:f,error:p,clearError:j}=function(e){let t=(0,o.f)(),[r,n]=(0,s.useState)(!1),[i,a]=(0,s.useState)(null),c=(0,s.useCallback)(()=>a(null),[]),u=(0,s.useCallback)(async(s,r)=>{n(!0),a(null);let i=(0,l.f)(g.I,{resourceId:s,slug:r});try{return await function(e,t,s){switch(t){case"agent":return e.agent.rename(s);case"vault":return e.vault.rename(s);case"routine":return e.routine.rename(s);case"environment":return e.environment.rename(s);case"channel_app":return e.channelapp.rename(s);case"oauth_app":return e.oauthapp.rename(s);case"team":return e.team.rename(s);case"federation_issuer":return e.federationIssuer.rename(s)}}(t,e,i)}catch(e){throw a((0,d.f)(e)),e}finally{n(!1)}},[t,e]);return(0,s.useMemo)(()=>({rename:u,isRenaming:r,error:i,clearError:c}),[u,r,i,c])}(e),v=(0,s.useCallback)(e=>h(r??"",e),[h,r]);return r&&x.allowed?(0,t.jsx)(c,{currentSlug:n,rename:v,isRenaming:f,error:p,clearError:j,onRenamed:a,hint:"The name in links and files. After a rename the old slug keeps working for reading for 30 days; a file that names it must change to the new one.",className:m}):(0,t.jsx)(t.Fragment,{children:u})}],252771)},193251,e=>{"use strict";var t=e.i(974265),s=e.i(311015);e.s(["H",0,"Ask one of them if this organization needs one.","j",0,function({what:e}){return(0,t.jsx)(s.f,{variant:"first-use",title:"No organization selected",description:`Choose an organization to see ${e}.`,className:"stg:rounded-lg stg:border stg:border-dashed stg:border-border"})}])},365785,e=>{"use strict";var t=e.i(974265),s=e.i(651023),r=e.i(893976),n=e.i(311015),i=e.i(630983),a=e.i(66724);e.s(["f",0,function({title:e,description:l,actions:g,unavailable:o,denied:d=!1,children:c,className:u}){let m=(0,s.useId)(),x=!0===d?{title:`Only an admin can open ${e}`,description:"Ask an owner or an admin of this organization."}:d||null,h=!!o||null!==x;return(0,t.jsxs)("section",{"aria-labelledby":m,className:(0,r.f)("stg:flex stg:flex-col stg:gap-6",u),children:[(0,t.jsx)(a.f,{title:e,description:l,actions:h?void 0:g,headingLevel:2,headingId:m}),o?(0,t.jsx)(i.f,{children:o}):null!==x?(0,t.jsx)(n.f,{variant:"permission",title:x.title,description:x.description,className:"stg:rounded-lg stg:border stg:border-border"}):c]})}])},734433,e=>{"use strict";var t=e.i(974265),s=e.i(893976),r=e.i(996675);e.s(["SettingsSkeleton",0,function({label:e="Loading",variant:n="rows",rows:i,className:a}){return"figures"===n?(0,t.jsxs)(r.f,{label:e,className:(0,s.f)("stg:flex stg:flex-col stg:gap-4",a),children:[(0,t.jsx)("div",{className:"stg:grid stg:grid-cols-1 stg:gap-3 stg:sm:grid-cols-3","aria-hidden":"true",children:Array.from({length:i??3},(e,s)=>(0,t.jsxs)("span",{className:"stg:flex stg:h-20 stg:flex-col stg:justify-center stg:gap-2 stg:rounded-lg stg:border stg:border-border stg:bg-card stg:px-4",children:[(0,t.jsx)("span",{className:"stg:h-2.5 stg:w-20 stg:animate-pulse stg:rounded stg:bg-muted-subtle"}),(0,t.jsx)("span",{className:"stg:h-5 stg:w-24 stg:animate-pulse stg:rounded stg:bg-muted"})]},s))}),(0,t.jsx)("span",{className:"stg:block stg:h-40 stg:animate-pulse stg:rounded-lg stg:border stg:border-border stg:bg-card","aria-hidden":"true"})]}):(0,t.jsx)(r.f,{label:e,className:(0,s.f)("stg:overflow-hidden stg:rounded-lg stg:border stg:border-border stg:bg-card",a),children:(0,t.jsx)("ul",{className:"stg:m-0 stg:list-none stg:divide-y stg:divide-border stg:p-0","aria-hidden":"true",children:Array.from({length:i??4},(e,s)=>(0,t.jsxs)("li",{className:"stg:flex stg:items-center stg:gap-3 stg:px-4 stg:py-3",children:[(0,t.jsx)("span",{className:"stg:size-8 stg:shrink-0 stg:animate-pulse stg:rounded-full stg:bg-muted"}),(0,t.jsxs)("span",{className:"stg:flex stg:flex-1 stg:flex-col stg:gap-1.5",children:[(0,t.jsx)("span",{className:"stg:h-3 stg:w-40 stg:max-w-full stg:animate-pulse stg:rounded stg:bg-muted"}),(0,t.jsx)("span",{className:"stg:h-2.5 stg:w-64 stg:max-w-full stg:animate-pulse stg:rounded stg:bg-muted-subtle"})]}),(0,t.jsx)("span",{className:"stg:h-5 stg:w-14 stg:shrink-0 stg:animate-pulse stg:rounded-full stg:bg-muted"})]},s))})})}])}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,451241,e=>{"use strict";var t=e.i(974265),s=e.i(651023),r=e.i(537097),n=e.i(255817),i=e.i(616701),a=e.i(297629),o=e.i(42592);let l=(0,s.createContext)(null),u=RegExp("^/library/(agents|skills|routines|plugins|environments)/([^/]+)/([^/]+)/?$");function d(e){let t=e.match(u);return t?{resourceType:t[1],org:t[2],slug:t[3]}:null}function g(e){return"/library"===e||e.startsWith("/library/")}function c(e){return`/library/${e.resourceType}/${e.org}/${e.slug}`}function m(){let e=(0,s.useContext)(l);if(!e)throw Error("useLibraryNavigation must be used within <LibraryNavigationProvider>");return e}e.s(["V",0,function({children:e}){let[u,m]=(0,s.useState)(()=>d(window.location.pathname)),f=(0,r.usePathname)(),[h,x]=(0,s.useState)(f);f!==h&&(x(f),g(f)&&d(f)||m(null));let p=(0,s.useRef)(u);(0,s.useEffect)(()=>{p.current=u},[u]);let b=(0,o.b)(),y=(0,s.useCallback)((e,t,s)=>{var r;let n={resourceType:e,org:b(t),slug:s};(r=p.current)===n||r&&n&&r.resourceType===n.resourceType&&r.org===n.org&&r.slug===n.slug||(m(n),window.history.pushState(null,"",c(n)))},[b]),v=function(e){let t=(0,n.f)(),s=(0,a.L)(),r=e??"",o=null!==s&&!s.isLoading&&""!==r,l=(0,a.l)()??[],u=l.some(e=>e.metadata?.slug===r),d=l.find(e=>e.metadata?.id===r),g=o&&!u&&void 0===d,{data:c}=(0,i.f)(g?async()=>{let e=await t.organization.get(r);return{segment:r,slug:e.metadata?.slug??""}}:null,[g,r,t],null);if(!o||u)return null;let m=d?d.metadata?.slug??"":c?.segment===r?c.slug:"";return m&&m!==r?m:null}(u?.org??null);v&&u&&u.org!==v&&m({...u,org:v,opened:u.opened??u.org}),(0,s.useEffect)(()=>{if(!u)return;let e=d(window.location.pathname);e&&e.resourceType===u.resourceType&&(e.org===u.org||e.org===u.opened)&&(e.slug===u.slug||e.slug===u.openedSlug)&&(e.org!==u.org||e.slug!==u.slug)&&window.history.replaceState(null,"",`${c(u)}${window.location.search}${window.location.hash}`)},[u]);let k=(0,s.useCallback)(e=>{let t=p.current;if(!t||""===e||t.slug===e)return;let s={...t,slug:e,openedSlug:t.openedSlug??t.slug};p.current=s,m(s)},[]),j=(0,s.useCallback)(()=>{if(p.current){let e=`/library/${p.current.resourceType}`;m(null),window.history.pushState(null,"",e)}},[]);(0,s.useEffect)(()=>{function e(){let e=window.location.pathname;g(e)?m(d(e)):m(null)}return window.addEventListener("popstate",e),()=>window.removeEventListener("popstate",e)},[]);let w=u?c(u):f,N=(0,s.useMemo)(()=>({activeDetail:u,currentLibraryPath:w,navigateToDetail:y,canonicalSlug:k,clearDetail:j}),[u,w,y,k,j]);return(0,t.jsx)(l.Provider,{value:N,children:e})},"a",0,function(e){return`${e.resourceType}/${e.opened??e.org}/${e.openedSlug??e.slug}`},"b",0,m,"R",0,function(){let{activeDetail:e}=m();return null!=e}],451241)},769421,e=>{"use strict";var t=e.i(974265),s=e.i(651023),r=e.i(893976),n=e.i(162697),i=e.i(193799);function a(){return(0,t.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,t.jsx)("rect",{x:"5",y:"5",width:"9",height:"9",rx:"1.5"}),(0,t.jsx)("path",{d:"M5 11H3.5A1.5 1.5 0 0 1 2 9.5V3.5A1.5 1.5 0 0 1 3.5 2h6A1.5 1.5 0 0 1 11 3.5V5"})]})}function o(){return(0,t.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M3 8.5l3.5 3.5L13 5"})})}function l(){return(0,t.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,t.jsx)("path",{d:"M4 4l8 8M12 4l-8 8"})})}e.s(["f",0,function({rawKey:e,keyName:u,onDismiss:d,className:g}){let{copy:c,copied:m}=(0,i.f)(),f=(0,s.useRef)(null),h=(0,s.useCallback)(async()=>{!await c(e)&&f.current&&(0,n.f)(f.current)},[c,e]);return(0,t.jsxs)("div",{role:"alert",className:(0,r.f)("stg:rounded-lg stg:border stg:border-primary/30 stg:bg-primary-subtle stg:p-4",g),children:[(0,t.jsxs)("div",{className:"stg:mb-2 stg:flex stg:items-start stg:justify-between stg:gap-3",children:[(0,t.jsxs)("div",{className:"stg:min-w-0",children:[(0,t.jsxs)("p",{className:"stg:text-sm stg:font-medium stg:text-foreground",children:["API key created: ",u]}),(0,t.jsx)("p",{className:"stg:mt-0.5 stg:text-xs stg:text-muted-foreground",children:"Copy this key now. It will not be shown again."})]}),(0,t.jsx)("button",{type:"button",onClick:d,"aria-label":"Dismiss",className:(0,r.f)("stg:shrink-0 stg:rounded stg:p-1","stg:text-muted-foreground stg:hover:text-foreground stg:hover:bg-accent-hover","stg:transition-colors"),children:(0,t.jsx)(l,{})})]}),(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-2",children:[(0,t.jsx)("code",{ref:f,className:(0,r.f)("stg:min-w-0 stg:flex-1 stg:select-all stg:truncate stg:rounded-md","stg:border stg:border-input stg:bg-background stg:px-2.5 stg:py-1.5","stg:font-mono stg:text-xs stg:text-foreground"),children:e}),(0,t.jsxs)("button",{type:"button",onClick:h,className:(0,r.f)("stg:inline-flex stg:shrink-0 stg:items-center stg:gap-1.5 stg:rounded-md stg:px-3 stg:py-1.5 stg:text-xs stg:font-medium","stg:bg-primary stg:text-primary-foreground stg:hover:bg-primary-hover","stg:transition-colors"),children:[m?(0,t.jsx)(o,{}):(0,t.jsx)(a,{}),m?"Copied":"Copy"]})]})]})}])},935456,e=>{"use strict";var t=e.i(974265),s=e.i(651023),r=e.i(893976),n=e.i(869803);let i=[{value:"30",label:"30 days"},{value:"60",label:"60 days"},{value:"90",label:"90 days"},{value:"never",label:"Never"}];e.s(["T",0,"never","_",0,function({value:e,onChange:a,disabled:o=!1}){let l=(0,s.useId)();return(0,t.jsxs)("fieldset",{className:(0,r.f)(n.n,"stg:space-y-1.5"),children:[(0,t.jsx)("legend",{className:"stg:text-xs stg:font-medium stg:text-foreground",children:"Expiration"}),(0,t.jsx)("div",{className:"stg:flex stg:flex-wrap stg:gap-2",children:i.map(s=>{let n=e===s.value;return(0,t.jsxs)("label",{className:(0,r.f)("stg:inline-flex stg:cursor-pointer stg:items-center stg:rounded-md stg:border stg:px-2.5 stg:py-1 stg:text-xs stg:transition-colors",n?"stg:border-primary stg:bg-primary-subtle stg:text-primary stg:font-medium":"stg:border-input stg:bg-background stg:text-muted-foreground stg:hover:border-border stg:hover:text-foreground",o&&"stg:pointer-events-none stg:opacity-50"),children:[(0,t.jsx)("input",{type:"radio",name:l,value:s.value,checked:n,disabled:o,onChange:()=>a(s.value),className:"stg:sr-only"}),s.label]},s.value)})})]})},"F",0,function(e){if("never"===e)return{neverExpires:!0};let t=new Date;return t.setDate(t.getDate()+Number(e)),{expiresAt:t}}])},818424,e=>{"use strict";var t=e.i(974265),s=e.i(893976);let r=(0,s.f)("stg:rounded-md stg:px-2.5 stg:py-1 stg:text-xs stg:font-medium stg:text-muted-foreground stg:transition-colors","stg:hover:bg-accent stg:hover:text-foreground","stg:disabled:pointer-events-none stg:disabled:opacity-40");e.s(["f",0,function({pageNumber:e,hasPrevious:n,hasNext:i,onPrevious:a,onNext:o,pageCount:l,ariaLabel:u,className:d}){return(0,t.jsxs)("div",{className:(0,s.f)("stg:flex stg:items-center stg:justify-between",d),role:"navigation","aria-label":u,children:[(0,t.jsx)("button",{type:"button",disabled:!n,onClick:a,className:r,children:"Previous"}),(0,t.jsx)("span",{className:"stg:text-xs stg:tabular-nums stg:text-muted-foreground",children:void 0===l?`Page ${e}`:`Page ${e} of ${l}`}),(0,t.jsx)("button",{type:"button",disabled:!i,onClick:o,className:r,children:"Next"})]})}])},162697,e=>{"use strict";e.s(["f",0,function(e){let t=window.getSelection();if(!t)return;let s=document.createRange();s.selectNodeContents(e),t.removeAllRanges(),t.addRange(s)}])},383370,e=>{"use strict";var t=e.i(651023),s=e.i(616701);let r=[""];e.s(["f",0,function(e,n,i){let a=(0,t.useMemo)(()=>({}),n),[o,l]=(0,t.useState)({epoch:a,stack:r}),u=o.epoch===a?o.stack:r,d=u[u.length-1]??"",{data:g,isLoading:c,isRefetching:m,error:f,refetch:h}=(0,s.f)(null===e?null:async()=>e(d),[a,d,i],null),x=g?.nextPageToken??"",p=(0,t.useCallback)(()=>{""!==x&&l({epoch:a,stack:[...u,x]})},[a,u,x]),b=(0,t.useCallback)(()=>{u.length<=1||l({epoch:a,stack:u.slice(0,-1)})},[a,u]);return(0,t.useMemo)(()=>({entries:g?.entries??[],page:g,pageNumber:u.length,hasNext:""!==x,hasPrevious:u.length>1,next:p,previous:b,isLoading:c,isRefetching:m,error:f,refetch:h}),[g,u,x,p,b,c,m,f,h])}])},237973,774079,901501,573732,e=>{"use strict";let t;e.s(["f",0,function(e,t){let s=[];return t.slugKept&&s.push(`${e} slugs do not change, so it keeps this slug.`),t.visibilityKept&&s.push(`${e} visibility does not change, so it keeps its visibility.`),s}],237973);var s=e.i(974265),r=e.i(893976);e.s(["f",0,function({className:e}){return(0,s.jsxs)("p",{className:(0,r.f)("stg:rounded-md stg:border stg:border-border stg:bg-muted stg:px-3 stg:py-2 stg:text-xs stg:text-muted-foreground",e),children:["Secret values are shown as ",(0,s.jsx)("code",{className:"stg:font-mono",children:"***REDACTED***"}),". Applying keeps the stored secrets; replace a marker to set a new value."]})}],774079),e.s(["f",0,function(e){return e.includes("***REDACTED***")}],901501);var n=e.i(651023);let i=null,a="stg:flex stg:items-center stg:justify-center stg:rounded-md stg:border stg:border-border stg:bg-muted stg:text-sm stg:text-muted-foreground",o=(0,n.memo)(function(o){let[l,u]=(0,n.useState)(()=>({editor:t}));if((0,n.useEffect)(()=>{if(t)return;let s=!0;return(i??=e.A(333009).then(e=>t=e.CodeMirrorYamlEditor,e=>{throw i=null,e})).then(e=>s&&u({editor:e}),()=>s&&u({failed:!0})),()=>{s=!1}},[]),l.editor){let e=l.editor;return(0,s.jsx)(e,{...o})}return l.failed?(0,s.jsxs)("div",{role:"alert",className:(0,r.f)(a,"stg:flex-col stg:gap-1 stg:p-4 stg:text-center",o.className),style:o.style,children:[(0,s.jsx)("span",{children:"The YAML editor could not load."}),(0,s.jsx)("span",{children:"Reload the page to try again."})]}):(0,s.jsx)("div",{"aria-busy":"true",className:(0,r.f)(a,o.className),style:o.style,children:"Loading editor…"})});e.s(["f",0,o],573732)},85455,453396,551365,e=>{"use strict";var t=e.i(974265),s=e.i(651023),r=e.i(893976),n=e.i(188482);let i=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function a(e){switch(e.kind){case"hourly":return`${e.minute} * * * *`;case"daily":return`${e.minute} ${e.hour} * * *`;case"weekly":{let t=[...new Set(e.days)].sort((e,t)=>e-t);return`${e.minute} ${e.hour} * * ${t.join(",")}`}case"monthly":return`${e.minute} ${e.hour} ${e.day} * *`;case"custom":return e.cron}}let o=/^(\d{1,2}) \* \* \* \*$/,l=/^(\d{1,2}) (\d{1,2}) \* \* \*$/,u=/^(\d{1,2}) (\d{1,2}) \* \* (\d(?:,\d)*)$/,d=/^(\d{1,2}) (\d{1,2}) (\d{1,2}) \* \*$/;function g(e){return Number.isInteger(e)&&e>=0&&e<=59}function c(e){return Number.isInteger(e)&&e>=0&&e<=23}function m(e,t){let s=t?` (${t})`:"";switch(e.kind){case"hourly":return`Every hour at minute ${e.minute}${s}`;case"daily":return`Every day at ${f(e.hour,e.minute)}${s}`;case"weekly":{var r;let t=[...new Set(e.days)].sort((e,t)=>e-t),n=7===t.length?"day":1===(r=t.map(e=>i[e])).length?r[0]:`${r.slice(0,-1).join(", ")} and ${r[r.length-1]}`;return`Every ${n} at ${f(e.hour,e.minute)}${s}`}case"monthly":return`On day ${e.day} of every month at ${f(e.hour,e.minute)}${s}`;case"custom":return`Cron “${e.cron.trim()}”${s}`}}function f(e,t){return`${String(e).padStart(2,"0")}:${String(t).padStart(2,"0")}`}let h=new Set(["@hourly","@daily","@weekly","@monthly","@yearly"]),x=/^[0-9A-Za-z*,/-]+$/;function p(e){if(e.startsWith("CRON_TZ=")||e.startsWith("TZ="))return"spec.cron must not carry a timezone prefix (CRON_TZ=/TZ=) — spec.time_zone is the single timezone authority";if(e.includes("#"))return"spec.cron must not contain a comment (#)";if(e.startsWith("@"))return e.startsWith("@every")?"spec.cron must be a calendar expression — @every intervals are not supported":h.has(e)?null:`spec.cron shorthand "${e}" is not supported — use @hourly, @daily, @weekly, @monthly, or @yearly, or a 5-field cron expression`;let t=e.split(/\s+/).filter(e=>e.length>0);if(5!==t.length)return`spec.cron must have exactly 5 fields (minute hour day-of-month month day-of-week); got ${t.length}`;for(let e of t)if(!x.test(e))return`spec.cron field "${e}" contains unsupported characters — allowed: digits, names, '*', ',', '-', '/'`;return null}e.s(["X",0,i,"f",0,a,"k",0,function(e){let t=e.trim().replace(/\s+/g," ");switch(t){case"@hourly":return{kind:"hourly",minute:0};case"@daily":return{kind:"daily",hour:0,minute:0};case"@weekly":return{kind:"weekly",days:[0],hour:0,minute:0};case"@monthly":return{kind:"monthly",day:1,hour:0,minute:0}}let s=o.exec(t);if(s){let e=Number(s[1]);if(g(e))return{kind:"hourly",minute:e}}if(s=l.exec(t)){let e=Number(s[1]),t=Number(s[2]);if(g(e)&&c(t))return{kind:"daily",hour:t,minute:e}}if(s=u.exec(t)){let e=Number(s[1]),t=Number(s[2]),r=s[3].split(",").map(Number);if(g(e)&&c(t)&&r.length>0&&r.every(e=>e>=0&&e<=6)&&new Set(r).size===r.length)return{kind:"weekly",days:[...r].sort((e,t)=>e-t),hour:t,minute:e}}if(s=d.exec(t)){let e=Number(s[1]),t=Number(s[2]),r=Number(s[3]);if(g(e)&&c(t)&&r>=1&&r<=31)return{kind:"monthly",day:r,hour:t,minute:e}}return{kind:"custom",cron:e}},"Q",0,m,"P",0,f,"H",0,p],453396);let b=[{kind:"hourly",label:"Hourly"},{kind:"daily",label:"Daily"},{kind:"weekly",label:"Weekly"},{kind:"monthly",label:"Monthly"},{kind:"custom",label:"Custom cron"}],y=(0,r.f)("stg:w-16 stg:rounded-md stg:border stg:border-input stg:bg-background stg:px-2 stg:py-1 stg:text-xs stg:text-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");function v({id:e,hour:s,minute:n,disabled:i,onChange:a}){return(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-2 stg:text-xs stg:text-foreground",children:[(0,t.jsx)("label",{htmlFor:e,children:"At"}),(0,t.jsx)("input",{id:e,type:"time",value:f(s,n),onChange:e=>{let[t,s]=e.target.value.split(":").map(Number);Number.isInteger(t)&&Number.isInteger(s)&&a(t,s)},disabled:i,className:(0,r.f)("stg:rounded-md stg:border stg:border-input stg:bg-background stg:px-2 stg:py-1 stg:text-xs stg:text-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")})]})}function k(e,t,s,r){let n=Number(e);return Number.isInteger(n)?Math.min(s,Math.max(t,n)):r}e.s(["f",0,function({value:e,onChange:o,timeZone:l,disabled:u}){let d=(0,s.useId)(),g=(0,s.useCallback)(t=>{t!==e.kind&&o(function(e,t){let s="hour"in t?t.hour:9,r="minute"in t?t.minute:0;switch(e){case"hourly":return{kind:e,minute:r};case"daily":return{kind:e,hour:s,minute:r};case"weekly":return{kind:e,days:[1],hour:s,minute:r};case"monthly":return{kind:e,day:1,hour:s,minute:r};case"custom":return{kind:e,cron:"custom"===t.kind?t.cron:a(t)}}}(t,e))},[e,o]),c="custom"===e.kind&&""!==e.cron.trim()?p(e.cron.trim()):null;return(0,t.jsxs)("div",{className:"stg:space-y-2",children:[(0,t.jsx)("div",{role:"radiogroup","aria-label":"Cadence","aria-disabled":u||void 0,className:(0,r.f)("stg:inline-flex stg:flex-wrap stg:rounded-md stg:bg-muted stg:p-0.5",u&&"stg:pointer-events-none stg:opacity-50"),children:b.map(s=>{let n=e.kind===s.kind;return(0,t.jsx)("button",{type:"button",role:"radio","aria-checked":n,tabIndex:n?0:-1,disabled:u,onClick:()=>g(s.kind),onKeyDown:t=>{if("ArrowRight"===t.key||"ArrowLeft"===t.key){t.preventDefault();let s=b.findIndex(t=>t.kind===e.kind);g(b[(s+("ArrowRight"===t.key?1:-1)+b.length)%b.length].kind)}},className:(0,r.f)("stg:inline-flex stg:cursor-pointer stg:items-center stg:rounded-sm stg:px-2.5 stg:py-1 stg:text-xs stg:font-medium stg:transition-colors","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring",n?"stg:bg-background stg:text-foreground stg:shadow-sm":"stg:text-muted-foreground stg:hover:text-foreground"),children:s.label},s.kind)})}),"hourly"===e.kind&&(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-2 stg:text-xs stg:text-foreground",children:[(0,t.jsx)("label",{htmlFor:`${d}-minute`,children:"At minute"}),(0,t.jsx)("input",{id:`${d}-minute`,type:"number",min:0,max:59,value:e.minute,onChange:t=>o({kind:"hourly",minute:k(t.target.value,0,59,e.minute)}),disabled:u,className:y})]}),"daily"===e.kind&&(0,t.jsx)(v,{id:`${d}-time`,hour:e.hour,minute:e.minute,disabled:u,onChange:(e,t)=>o({kind:"daily",hour:e,minute:t})}),"weekly"===e.kind&&(0,t.jsxs)("div",{className:"stg:space-y-2",children:[(0,t.jsx)("div",{role:"group","aria-label":"Days of week",className:"stg:flex stg:flex-wrap stg:gap-1",children:i.map((s,i)=>{let a=e.days.includes(i),l=a&&1===e.days.length;return(0,t.jsxs)(n.W,{children:[(0,t.jsx)(n.y,{render:(0,t.jsx)("span",{className:"stg:inline-flex"}),children:(0,t.jsx)("button",{type:"button","aria-pressed":a,"aria-label":s,disabled:u||l,onClick:()=>o({...e,days:a?e.days.filter(e=>e!==i):[...e.days,i].sort((e,t)=>e-t)}),className:(0,r.f)("stg:inline-flex stg:h-7 stg:w-9 stg:items-center stg:justify-center stg:rounded-md stg:border stg:text-xs stg:font-medium stg:transition-colors","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring","stg:disabled:pointer-events-none",a?"stg:border-primary stg:bg-primary stg:text-primary-foreground":"stg:border-input stg:bg-background stg:text-muted-foreground stg:hover:text-foreground",l&&"stg:opacity-70"),children:s.slice(0,3)})}),(0,t.jsx)(n.Y,{side:"top",children:l?"A weekly schedule needs at least one day":s})]},s)})}),(0,t.jsx)(v,{id:`${d}-time`,hour:e.hour,minute:e.minute,disabled:u,onChange:(t,s)=>o({...e,hour:t,minute:s})})]}),"monthly"===e.kind&&(0,t.jsxs)("div",{className:"stg:space-y-2",children:[(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-2 stg:text-xs stg:text-foreground",children:[(0,t.jsx)("label",{htmlFor:`${d}-day`,children:"On day"}),(0,t.jsx)("input",{id:`${d}-day`,type:"number",min:1,max:31,value:e.day,onChange:t=>o({...e,day:k(t.target.value,1,31,e.day)}),disabled:u,className:y}),(0,t.jsx)("span",{className:"stg:text-muted-foreground",children:"of every month"})]}),e.day>=29&&(0,t.jsxs)("p",{className:"stg:text-2xs stg:text-muted-foreground",children:["Months without day ",e.day," are skipped — February never fires a day-",e.day," schedule",29===e.day?" except in leap years":"","."]}),(0,t.jsx)(v,{id:`${d}-time`,hour:e.hour,minute:e.minute,disabled:u,onChange:(t,s)=>o({...e,hour:t,minute:s})})]}),"custom"===e.kind&&(0,t.jsxs)("div",{className:"stg:space-y-1",children:[(0,t.jsx)("input",{type:"text","aria-label":"Cron expression",placeholder:"e.g. 0 9 * * MON-FRI",value:e.cron,onChange:e=>o({kind:"custom",cron:e.target.value}),disabled:u,className:(0,r.f)("stg:w-full stg:rounded-md stg:border stg:border-input stg:bg-background stg:px-2.5 stg:py-1.5 stg:font-mono stg:text-xs stg:text-foreground","stg:placeholder:font-sans 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",c&&"stg:border-destructive")}),c?(0,t.jsx)("p",{className:"stg:text-2xs stg:text-destructive",role:"alert",children:c}):(0,t.jsx)("p",{className:"stg:text-2xs stg:text-muted-foreground",children:"5 fields (minute hour day-of-month month day-of-week) or @hourly, @daily, @weekly, @monthly, @yearly."})]}),!("custom"===e.kind&&(c||""===e.cron.trim()))&&(0,t.jsx)("p",{className:"stg:text-xs stg:text-muted-foreground","data-testid":"cadence-summary",children:m(e,l)})]})}],85455);let j="stgm-timezone-list",w={"Africa/Asmera":"Africa/Asmara","America/Buenos_Aires":"America/Argentina/Buenos_Aires","America/Catamarca":"America/Argentina/Catamarca","America/Coral_Harbour":"America/Atikokan","America/Cordoba":"America/Argentina/Cordoba","America/Godthab":"America/Nuuk","America/Indianapolis":"America/Indiana/Indianapolis","America/Jujuy":"America/Argentina/Jujuy","America/Louisville":"America/Kentucky/Louisville","America/Mendoza":"America/Argentina/Mendoza","Asia/Calcutta":"Asia/Kolkata","Asia/Katmandu":"Asia/Kathmandu","Asia/Rangoon":"Asia/Yangon","Asia/Saigon":"Asia/Ho_Chi_Minh","Atlantic/Faeroe":"Atlantic/Faroe","Europe/Kiev":"Europe/Kyiv","Pacific/Enderbury":"Pacific/Kanton","Pacific/Ponape":"Pacific/Pohnpei","Pacific/Truk":"Pacific/Chuuk"},N=Object.fromEntries(Object.entries(w).map(([e,t])=>[t,e]));function C(e){return w[e]??e}function A(){return C(Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC")}e.s(["Y",0,function({id:e,value:n,onChange:i,disabled:a}){let o=(0,s.useMemo)(()=>(function(){try{return[...new Set(Intl.supportedValuesOf("timeZone").map(C))].sort()}catch{let e=A();return"UTC"!==e?[e,"UTC"]:["UTC"]}})(),[]),[l,u]=(0,s.useState)(null),[d,g]=(0,s.useState)(-1),c=(0,s.useRef)(null),m=null!==l,f=(0,s.useMemo)(()=>{if(null===l)return[];let e=l.trim().toLowerCase().replace(/\s+/g,"_");return(e?o.filter(t=>[t,N[t]??""].some(t=>t.toLowerCase().includes(e))):o).slice(0,100)},[o,l]),h=(0,s.useCallback)(()=>{u(null),g(-1)},[]),x=(0,s.useCallback)(e=>{i(e),h()},[i,h]),p=(0,s.useCallback)(e=>{if("Escape"===e.key){e.preventDefault(),h();return}m&&("ArrowDown"===e.key?(e.preventDefault(),g(e=>e<f.length-1?e+1:e)):"ArrowUp"===e.key?(e.preventDefault(),g(e=>e>0?e-1:-1)):"Enter"===e.key&&(e.preventDefault(),d>=0&&d<f.length?x(f[d]):1===f.length&&x(f[0])))},[m,f,d,x,h]);return(0,t.jsxs)("div",{className:"stg:relative",children:[(0,t.jsx)("input",{id:e,type:"text",role:"combobox","aria-expanded":m,"aria-controls":j,"aria-activedescendant":d>=0?`stgm-timezone-${d}`:void 0,"aria-label":"Time zone",placeholder:"Search time zones…",value:l??n,onChange:e=>{u(e.target.value),g(-1)},onFocus:()=>u(""),onBlur:h,onKeyDown:p,disabled:a,className:(0,r.f)("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")}),m&&(0,t.jsx)("div",{ref:c,id:j,role:"listbox","aria-label":"Time zones",className:(0,r.f)("stg:absolute stg:z-popover stg:mt-1 stg:max-h-52 stg:w-full stg:overflow-y-auto stg:rounded-md stg:border stg:border-border","stg:bg-popover stg:p-1 stg:text-popover-foreground stg:shadow-md"),children:0===f.length?(0,t.jsx)("div",{className:"stg:py-3 stg:text-center stg:text-xs stg:text-muted-foreground",children:"No time zones match"}):f.map((e,s)=>(0,t.jsx)("button",{id:`stgm-timezone-${s}`,type:"button",role:"option","aria-selected":e===C(n),onMouseDown:t=>{t.preventDefault(),x(e)},className:(0,r.f)("stg:flex stg:w-full stg:items-center stg:rounded-sm stg:px-2 stg:py-1.5 stg:text-left stg:text-xs stg:transition-colors",s===d?"stg:bg-accent stg:text-foreground":"stg:text-popover-foreground stg:hover:bg-accent-hover",e===C(n)&&"stg:font-medium"),children:e},e))})]})},"W",0,A],551365)},354642,e=>{"use strict";var t=e.i(974265),s=e.i(651023),r=e.i(780412),n=e.i(373351),i=e.i(653650),a=e.i(836959),o=e.i(348990),l=e.i(313488);function u(e,t){let{spec:n}=(0,r.f)(t),{organization:i}=(0,l.f)(e),{environments:u}=(0,o.s)(e),d=n?.environmentRef,g=i?.spec?.preferences?.defaultEnvironmentRef,c=(0,s.useMemo)(()=>(0,a.g)({agent:d,organization:g}),[d,g]),m=(0,s.useCallback)(e=>{let t=u.find(t=>t.metadata?.slug===e.slug);return t?(0,o.B)(t):e.slug},[u]);return(0,s.useMemo)(()=>({inherited:c,nameOf:m}),[c,m])}e.s(["n",0,function({org:e,agentRef:s,value:r,onChange:a,disabled:o,label:l,className:d}){let{inherited:g,nameOf:c}=u(e,s);return(0,t.jsx)(n.f,{org:e,value:r,onChange:a,defaultLabel:(0,i.P)(g,c),disabled:o,label:l,className:d})},"u",0,u])},733224,e=>{"use strict";var t=e.i(974265),s=e.i(651023),r=e.i(893976),n=e.i(65642),i=e.i(468806);function a({titleId:e,routineName:r,enableFirst:i,onStart:d,onClose:g}){let[c,m]=(0,s.useState)(""),[f,h]=(0,s.useState)(!1),x=(0,s.useCallback)(async()=>{h(!0);try{await d(""===c.trim()?void 0:c),g()}catch{}finally{h(!1)}},[c,g,d]);return(0,t.jsxs)("form",{className:"stg:flex stg:flex-col",onSubmit:e=>{e.preventDefault(),x()},children:[(0,t.jsxs)("div",{className:"stg:border-b stg:border-border stg:px-5 stg:py-4",children:[(0,t.jsx)("h2",{id:e,className:"stg:text-sm stg:font-semibold stg:text-foreground",children:i?"Enable and run this routine now?":"Run this routine now?"}),(0,t.jsx)("p",{className:"stg:mt-0.5 stg:truncate stg:text-xs stg:text-muted-foreground",children:r})]}),(0,t.jsxs)("div",{className:"stg:space-y-4 stg:px-5 stg:py-4",children:[(0,t.jsx)("p",{className:"stg:text-xs stg:text-muted-foreground",children:i?"This routine is disabled. Enabling it lets it fire on its schedule again, and starts one real run now so you can see the result. You can disable it again afterwards.":"This starts a real run now, outside its schedule. The run is recorded in this routine's history."}),(0,t.jsxs)("div",{className:"stg:space-y-1",children:[(0,t.jsxs)("label",{htmlFor:`${e}-note`,className:o,children:["Note for this run"," ",(0,t.jsx)("span",{className:"stg:font-normal stg:text-muted-foreground",children:"(optional)"})]}),(0,t.jsx)("textarea",{id:`${e}-note`,value:c,onChange:e=>m(e.target.value),maxLength:65536,rows:4,disabled:f,placeholder:"Sentry alert SEN-4521 fired, see the link",className:u}),(0,t.jsx)("p",{className:l,children:"The agent receives it after the routine’s message, marked as information from you, not instructions."})]})]}),(0,t.jsxs)("div",{className:"stg:flex stg:justify-end stg:gap-2 stg:border-t stg:border-border stg:px-5 stg:py-3",children:[(0,t.jsx)(n.f,{variant:"ghost",size:"sm",type:"button",onClick:g,disabled:f,children:"Cancel"}),(0,t.jsx)(n.f,{variant:"primary",size:"sm",type:"submit",disabled:f,children:i?"Enable & run":"Start run"})]})]})}let o="stg:block stg:text-xs stg:font-medium stg:text-foreground",l="stg:text-2xs stg:text-muted-foreground",u=(0,r.f)("stg:w-full stg:resize-y 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");e.s(["f",0,function({open:e,onOpenChange:r,routineName:n,onStart:o,enableFirst:l=!1,modal:u=!0}){let d=(0,s.useId)(),g=(0,s.useCallback)(()=>r(!1),[r]);return(0,t.jsx)(i.f,{open:e,onOpenChange:r,modal:u,width:"md","aria-labelledby":d,children:e&&(0,t.jsx)(a,{titleId:d,routineName:n,enableFirst:l,onStart:o,onClose:g})})}])},102602,e=>{"use strict";e.s(["X",0,function(e,t){let s=(t?.pausedReason??"")!=="";return e?.enabled?s?{state:"paused",phase:"degraded",label:"Paused",isPaused:s}:{state:"active",phase:"ready",label:"Active",isPaused:s}:{state:"disabled",phase:"disabled",label:"Disabled",isPaused:s}},"u",0,function(e,t){let s=e.getTime()-t.getTime();if(s<6e4)return"now";let r=Math.floor(s/6e4);if(r<60)return`in ${r}m`;let n=Math.floor(r/60);if(n<24)return`in ${n}h`;let i=Math.floor(n/24);if(i<7)return`in ${i}d`;let a=e.getFullYear()===t.getFullYear();return e.toLocaleDateString(void 0,{month:"short",day:"numeric",...a?{}:{year:"numeric"}})}])},511339,323687,e=>{"use strict";var t=e.i(651023),s=e.i(610595),r=e.i(255817),n=e.i(846696),i=e.i(781836);e.s(["f",0,function(){let e=(0,r.f)(),[a,o]=(0,t.useState)(!1),[l,u]=(0,t.useState)(null),d=(0,t.useCallback)(async t=>{o(!0),u(null);try{let s=await e.routine.resume(t);return n.c.success("Routine resumed"),s}catch(t){let e=(0,i.f)(t);throw u(e),n.c.error((0,s.g)(t)),e}finally{o(!1)}},[e]);return(0,t.useMemo)(()=>({resumeRoutine:d,isResuming:a,error:l}),[d,a,l])}],511339);var a=e.i(891287),o=e.i(58837);e.s(["f",0,function(){let e=(0,r.f)(),[l,u]=(0,t.useState)(!1),[d,g]=(0,t.useState)(null),c=(0,t.useCallback)(async(t,r="")=>{u(!0),g(null);try{let s=await e.routine.fire((0,a.f)(o.l,{id:t,text:r}));return s.outcome===o.t.STARTED?n.c.success("Run started"):n.c.error(s.refusalReason||"The run was refused by a launch gate"),s}catch(t){let e=(0,i.f)(t);throw g(e),n.c.error((0,s.g)(t)),e}finally{u(!1)}},[e]);return(0,t.useMemo)(()=>({fireRoutine:c,isFiring:l,error:d}),[c,l,d])}],323687)},41097,284982,e=>{"use strict";var t=e.i(974265),s=e.i(651023),r=e.i(893976),n=e.i(610595),i=e.i(691444),a=e.i(170255),o=e.i(769421),l=e.i(530091),u=e.i(379410),d=e.i(294470),g=e.i(935456),c=e.i(891287),m=e.i(17616),f=e.i(180897),h=e.i(255817),x=e.i(781836);function p({serviceAccountId:e,serviceAccountName:i,onCreated:a,onCancel:o,cancelLabel:l="Cancel",initialName:d="",className:b}){let{create:y,isCreating:v,error:k,clearError:j}=function(){let e=(0,h.f)(),[t,r]=(0,s.useState)(!1),[n,i]=(0,s.useState)(null),a=(0,s.useCallback)(()=>i(null),[]);return{create:(0,s.useCallback)(async t=>{r(!0),i(null);try{return await e.apiKey.createForServiceAccount((0,c.f)(f.q,{serviceAccountId:t.serviceAccountId,name:t.name,neverExpires:!0===t.neverExpires,...void 0!==t.expiresAt&&!0!==t.neverExpires?{expiresAt:(0,m.r)(t.expiresAt)}:{}}))}catch(e){throw i((0,x.f)(e)),e}finally{r(!1)}},[e]),isCreating:t,error:n,clearError:a}}(),w=(0,s.useId)(),[N,C]=(0,s.useState)(d),[A,$]=(0,s.useState)(g.T),S=N.trim(),T=""!==S&&""!==e&&!v,E=(0,s.useCallback)(async t=>{if(t.preventDefault(),T){j();try{let t=await y({serviceAccountId:e,name:S,...(0,g.F)(A)});a?.(t)}catch{}}},[T,j,y,e,S,A,a]);return(0,t.jsxs)("form",{onSubmit:E,className:(0,r.f)("stg:space-y-3",b),children:[(0,t.jsxs)("p",{className:"stg:text-xs stg:text-muted-foreground",children:["The key speaks for ",i,", not for you: it works only in this organization, and it keeps working if you leave."]}),(0,t.jsxs)("div",{className:"stg:space-y-1",children:[(0,t.jsx)("label",{htmlFor:`${w}-name`,className:"stg:text-xs stg:font-medium stg:text-foreground",children:"Key name"}),(0,t.jsx)("input",{id:`${w}-name`,type:"text",value:N,onChange:e=>C(e.target.value),placeholder:"e.g. github-actions",disabled:v,required:!0,className:(0,r.f)("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")})]}),(0,t.jsx)(g._,{value:A,onChange:$,disabled:v}),k&&(0,t.jsx)("p",{className:"stg:text-destructive stg:text-2xs",role:"alert",children:(0,n.g)(k)}),(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-2",children:[(0,t.jsxs)("button",{type:"submit",disabled:!T,className:(0,r.f)("stg:inline-flex stg:items-center stg:gap-1.5 stg:rounded-md stg:px-3 stg:py-1.5 stg:text-xs stg:font-medium","stg:bg-primary stg:text-primary-foreground stg:hover:bg-primary-hover","stg:disabled:pointer-events-none stg:disabled:opacity-40"),children:[v&&(0,t.jsx)(u.f,{size:12}),"Create key"]}),o&&(0,t.jsx)("button",{type:"button",onClick:o,disabled:v,className:(0,r.f)("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:l})]})]})}e.s(["f",0,p],284982);var b=e.i(114361);function y({org:e,defaultRole:i,onCreated:o,onCancel:g,className:m}){let{create:f,isCreating:p,error:v,clearError:k}=function(){let e=(0,h.f)(),[t,r]=(0,s.useState)(!1),[n,i]=(0,s.useState)(null),a=(0,s.useCallback)(()=>i(null),[]);return{create:(0,s.useCallback)(async t=>{r(!0),i(null);try{return await e.identityAccount.createServiceAccount((0,c.f)(b.h,{org:t.org,name:t.name,role:t.role}))}catch(e){throw i((0,x.f)(e)),e}finally{r(!1)}},[e]),isCreating:t,error:n,clearError:a}}(),j=(0,s.useId)(),[w,N]=(0,s.useState)(""),[C,A]=(0,s.useState)(i),$=w.trim(),S=""!==$&&""!==e&&!p,T=(0,s.useCallback)(async t=>{if(t.preventDefault(),S){k();try{let t=await f({org:e,name:$,role:C});o(t,C)}catch{}}},[S,k,f,e,$,C,o]);return(0,t.jsxs)("form",{onSubmit:T,className:(0,r.f)("stg:space-y-3",m),children:[(0,t.jsxs)("div",{className:"stg:space-y-1",children:[(0,t.jsx)("label",{htmlFor:`${j}-name`,className:"stg:text-xs stg:font-medium stg:text-foreground",children:"Name"}),(0,t.jsx)("input",{id:`${j}-name`,type:"text",value:w,onChange:e=>N(e.target.value),placeholder:"e.g. ci-deploy",disabled:p,autoFocus:!0,required:!0,"aria-describedby":`${j}-name-hint`,className:(0,r.f)("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")}),(0,t.jsx)("p",{id:`${j}-name-hint`,className:"stg:text-2xs stg:text-muted-foreground",children:"What it creates says it was created by this name."})]}),(0,t.jsx)(l.f,{kind:a.X.organization,selected:C,onSelect:A,omitRoles:d.m,disabled:p}),v&&(0,t.jsx)("p",{className:"stg:text-destructive stg:text-2xs",role:"alert",children:(0,n.g)(v)}),(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-2",children:[(0,t.jsxs)("button",{type:"submit",disabled:!S,className:(0,r.f)("stg:inline-flex stg:items-center stg:gap-1.5 stg:rounded-md stg:px-3 stg:py-1.5 stg:text-xs stg:font-medium","stg:bg-primary stg:text-primary-foreground stg:hover:bg-primary-hover","stg:disabled:pointer-events-none stg:disabled:opacity-40"),children:[p&&(0,t.jsx)(u.f,{size:12}),"Create service account"]}),g&&(0,t.jsx)("button",{type:"button",onClick:g,disabled:p,className:(0,r.f)("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"})]})]})}e.s(["f",0,function({org:e,onCreated:n,onDone:a,onCancel:l,defaultRole:u=d.O,className:g}){let[c,m]=(0,s.useState)({phase:"account"});if("account"===c.phase)return(0,t.jsx)(y,{org:e,defaultRole:u,className:g,onCancel:l,onCreated:(e,t)=>{n?.(e),m({phase:"firstKey",account:e,role:t})}});if("firstKey"===c.phase){let e=c.account.metadata?.name??"";return(0,t.jsxs)("div",{className:(0,r.f)("stg:space-y-3",g),children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("p",{className:"stg:text-sm stg:font-medium stg:text-foreground",children:[e," created with the ",(0,i.p)(c.role)," role"]}),(0,t.jsxs)("p",{className:"stg:mt-0.5 stg:text-xs stg:text-muted-foreground",children:["Create its first API key now, for the CI job or script that will act as ",e,"."]})]}),(0,t.jsx)(p,{serviceAccountId:c.account.metadata?.id??"",serviceAccountName:e,onCreated:e=>m({phase:"revealed",rawKey:e.spec?.keyHash??"",keyName:e.metadata?.name??"API key"}),onCancel:a,cancelLabel:"Not now"})]})}return(0,t.jsx)(o.f,{rawKey:c.rawKey,keyName:c.keyName,onDismiss:()=>a?.(),className:g})}],41097)}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,866677,e=>{"use strict";var t=e.i(974265),s=e.i(651023),i=e.i(19738),r=e.i(531245),n=e.i(107233),a=e.i(569074),l=e.i(541071),o=e.i(174886),g=e.i(778917),c=e.i(727612),d=e.i(451241),u=e.i(610008),m=e.i(845132),f=e.i(658653),p=e.i(255817),x=e.i(297629),h=e.i(164358),b=e.i(885795),y=e.i(42592),v=e.i(966205),j=e.i(10337),N=e.i(846696),w=e.i(874792),C=e.i(170255),k=e.i(774043);let A=[{id:"name",header:"Name",cell:e=>(0,t.jsx)("span",{className:"font-medium text-foreground",children:e.name||e.slug}),sortable:!0,flex:2},{id:"org",header:"Organization",cell:e=>(0,t.jsx)(b.f,{orgId:e.org,className:"text-muted-foreground"}),flex:1},{id:"description",header:"Description",cell:e=>(0,t.jsx)("span",{className:"line-clamp-1 text-muted-foreground",children:e.description||"—"}),flex:3}];e.s(["AgentListPage",0,function(){let e=(0,x.x)(),{allowed:b}=(0,h.f)(e||null),S=(0,y.b)(),M=(0,p.f)(),{navigateToDetail:$}=(0,d.b)(),{confirmState:z,confirm:R,handleConfirm:T,handleCancel:I}=(0,v.f)(),[K,D]=(0,s.useState)(!1),[P,F]=(0,s.useReducer)(e=>e+1,0),L=(0,s.useCallback)(async e=>{if(await R({title:`Delete ${e.name||e.slug}?`,description:k.f,confirmLabel:"Delete",variant:"destructive"}))try{await M.agent.delete(e.id),N.c.success(`${e.name||e.slug} deleted`),F()}catch{N.c.error("Failed to delete agent")}},[R,M]),O=(0,s.useMemo)(()=>(0,w.f)(M,C.X.agent),[M]),V="/library/agents/new";return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"mb-6",children:[(0,t.jsx)("h1",{className:"text-foreground text-xl font-semibold",children:"Agents"}),(0,t.jsx)("p",{className:"text-muted-foreground mt-1 text-sm",children:"Browse and manage agents in your organization."})]}),(0,t.jsx)(u.f,{refetchToken:P,listFn:O,org:e,columns:A,defaultViewMode:"cards",viewModes:["table","cards"],viewModeStorageKey:"stigmer:workbench:agents:viewMode",searchPlaceholder:"Search agents…",emptyIcon:(0,t.jsx)(r.f,{className:"size-10","aria-hidden":"true"}),emptyTitle:"No agents yet",emptyDescription:"Create an agent to define instructions, tools, skills, and execution behavior.",headerAction:(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)("button",{type:"button",onClick:()=>D(!0),"aria-label":"Apply YAML",className:"inline-flex items-center justify-center rounded-md border border-input bg-background p-1.5 text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:(0,t.jsx)(a.f,{className:"size-3.5","aria-hidden":"true"})}),b&&(0,t.jsxs)(i.default,{href:V,className:"inline-flex items-center gap-1.5 rounded-md bg-primary px-3 py-1.5 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[(0,t.jsx)(n.f,{className:"size-3.5","aria-hidden":"true"}),"Create agent"]})]}),emptyAction:b?(0,t.jsxs)(i.default,{href:V,className:"inline-flex items-center gap-1.5 rounded-md bg-primary px-3 py-1.5 text-xs font-medium text-primary-foreground transition-colors hover:bg-primary-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[(0,t.jsx)(n.f,{className:"size-3.5","aria-hidden":"true"}),"Create agent"]}):void 0,onItemClick:e=>$("agents",e.org,e.slug),renderItemAction:e=>(0,t.jsx)("div",{onClick:e=>e.stopPropagation(),children:(0,t.jsxs)(m.f,{children:[(0,t.jsx)(m.f.Trigger,{"aria-label":`Actions for ${e.name||e.slug}`,children:(0,t.jsx)(l.f,{className:"size-4"})}),(0,t.jsxs)(m.f.Content,{children:[(0,t.jsx)(m.f.Item,{icon:(0,t.jsx)(g.f,{className:"size-4"}),onSelect:()=>$("agents",e.org,e.slug),children:"View details"}),(0,t.jsx)(m.f.Item,{icon:(0,t.jsx)(o.f,{className:"size-4"}),onSelect:()=>{navigator.clipboard.writeText(`${S(e.org)}/${e.slug}`),N.c.success("Copied agent ID")},children:"Copy ID"}),(0,t.jsx)(m.f.Separator,{}),(0,t.jsx)(m.f.Item,{icon:(0,t.jsx)(c.f,{className:"size-4"}),variant:"destructive",onSelect:()=>L(e),children:"Delete"})]})]})}),"aria-label":"Agent workbench"}),(0,t.jsx)(f.f,{open:K,onOpenChange:D,org:e??"",onApplied:F}),(0,t.jsx)(j.f,{state:z,onConfirm:T,onCancel:I})]})}])},569074,e=>{"use strict";let t=(0,e.i(475254).f)("upload",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]);e.s(["f",0,t],569074)},164358,e=>{"use strict";var t=e.i(651023),s=e.i(803874);e.s(["f",0,function(e){let{allowed:i,isLoading:r}=(0,s.f)(e?{kind:"organization",id:e}:null,"can_create_agent");return(0,t.useMemo)(()=>({allowed:!!e&&i,isLoading:!!e&&r}),[e,i,r])}])},658653,e=>{"use strict";var t=e.i(974265),s=e.i(651023),i=e.i(893976),r=e.i(468806),n=e.i(869803),a=e.i(846696),l=e.i(237973),o=e.i(774079),g=e.i(901501),c=e.i(864652),d=e.i(255817),u=e.i(297629),m=e.i(781836),f=e.i(42592),p=e.i(573732);function x({entry:e}){let s=(0,f.b)(),i=(0,l.f)(e.document.handler.displayName,e);return(0,t.jsxs)("li",{className:"stg:rounded-md stg:border stg:border-border stg:bg-card stg:px-3 stg:py-2",children:[(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-2",children:[(0,t.jsx)("span",{className:"stg:inline-flex stg:rounded stg:bg-muted stg:px-1.5 stg:py-0.5 stg:text-xs stg:font-medium stg:text-muted-foreground",children:e.document.handler.displayName}),(0,t.jsx)("span",{className:"stg:text-sm stg:font-medium stg:text-foreground",children:e.document.name}),(0,t.jsx)(h,{entry:e}),(0,t.jsx)("span",{className:"stg:ml-auto stg:text-xs stg:text-muted-foreground",children:s(e.document.org)})]}),e.document.warning&&(0,t.jsx)("p",{className:"stg:mt-1 stg:text-xs stg:text-muted-foreground",children:e.document.warning}),i.length>0&&(0,t.jsx)("p",{className:"stg:mt-1 stg:text-xs stg:text-muted-foreground",children:i.join(" ")}),"failed"===e.status&&e.errorMessage&&(0,t.jsx)("p",{role:"alert",className:"stg:mt-1 stg:text-xs stg:text-destructive",children:e.errorMessage})]})}function h({entry:e}){let s=function(e){switch(e.status){case"applying":return"Applying…";case"applied":return"Applied";case"failed":return"Failed";case"skipped":return"Skipped";case"pending":switch(e.action){case"create":return"Will create";case"update":return"Will update";case"rename":return"Will rename";case"unknown":return"Create or update";default:return String(e.action)}}}(e);return(0,t.jsx)("span",{className:(0,i.f)("stg:inline-flex stg:rounded stg:px-1.5 stg:py-0.5 stg:text-xs stg:font-medium","failed"===e.status?"stg:bg-card stg:text-destructive stg:border stg:border-destructive":"stg:bg-muted stg:text-muted-foreground"),children:s})}e.s(["f",0,function({open:e,onOpenChange:l,org:f,onApplied:h}){var b;let y=(0,s.useRef)(null),v=function(e){let t=(0,d.f)(),[i,r]=(0,s.useState)(""),[n,a]=(0,s.useState)(null),[l,o]=(0,s.useState)(null),[f,p]=(0,s.useState)(!1),[x,h]=(0,s.useState)(!1),b=(0,s.useRef)(e);b.current=e;let y=(0,u.I)((0,u.l)()??[],e)?.metadata,v=(0,s.useRef)([]);v.current=void 0===y?[]:[y.id,y.slug].filter(e=>""!==e);let j=(0,s.useCallback)(e=>{r(e)},[]),N=(0,s.useCallback)(async e=>{let t;try{t=await e.text()}catch{r(""),a(null),o(`Failed to read ${e.name}.`);return}r(t)},[]),w=(0,s.useCallback)(()=>{r(""),a(null),o(null),p(!1),h(!1)},[]),C=(0,s.useRef)(0);(0,s.useEffect)(()=>{if(x)return;let e=++C.current;if(!i.trim()){a(null),o(null),p(!1);return}p(!0);let s=setTimeout(async()=>{let s;try{s=(0,c.a)(i,{org:b.current,orgNames:v.current})}catch(t){C.current===e&&(a(null),o((0,m.f)(t).message),p(!1));return}let r=await Promise.all(s.map(async e=>{let s;try{let i=await t.manifest.resolveTarget(e);s={action:i.action,slugKept:"update"===i.action&&i.slugKept,visibilityKept:"create"!==i.action&&i.visibilityKept}}catch{s={action:"unknown",slugKept:!1,visibilityKept:!1}}return{document:e,...s,status:"pending"}}));C.current===e&&(a(r),o(null),p(!1))},500);return()=>clearTimeout(s)},[i,t,x]);let k=(0,s.useCallback)(async()=>{if(!n||0===n.length)return[];C.current++,h(!0);let e=n.map(e=>({...e,status:"pending"})),s=()=>a([...e]),i=!1;for(let r=0;r<e.length;r++){if(i){e[r]={...e[r],status:"skipped"};continue}e[r]={...e[r],status:"applying"},s();try{let s=await t.manifest.apply(e[r].document);e[r]={...e[r],status:"applied",result:s}}catch(t){e[r]={...e[r],status:"failed",errorMessage:(0,m.f)(t).message},i=!0}s()}return s(),h(!1),e},[n,t]),A=(0,s.useMemo)(()=>(0,g.f)(i),[i]);return(0,s.useMemo)(()=>({content:i,setContent:j,readFile:N,entries:n,validationError:l,isValidating:f,hasRedactedSecrets:A,applyAll:k,isApplying:x,reset:w}),[i,j,N,n,l,f,A,k,x,w])}(f),{reset:j}=v;(0,s.useEffect)(()=>{e&&(j(),y.current&&(y.current.value=""))},[e,j]);let N=(0,s.useCallback)(()=>{l(!1);let e=(v.entries??[]).filter(e=>"applied"===e.status);e.length>0&&h?.(e)},[l,v.entries,h]),w=(0,s.useCallback)(e=>{e||N()},[N]),C=(0,s.useCallback)(e=>{let t=e.target.files?.[0];t&&v.readFile(t)},[v]),k=(0,s.useCallback)(async()=>{let e=await v.applyAll(),t=e.filter(e=>"applied"===e.status);e.length>0&&t.length===e.length&&(a.c.success(1===t.length?"Resource applied":`${t.length} resources applied`),l(!1),h?.(t))},[v,l,h]),A=null!==v.entries&&v.entries.length>0&&!v.isValidating&&!v.isApplying;return(0,t.jsx)(r.f,{open:e,onOpenChange:w,width:"3xl","aria-label":"Apply YAML",children:(0,t.jsxs)("div",{className:"stg:flex stg:flex-col stg:gap-4 stg:p-6",children:[(0,t.jsxs)("div",{className:"stg:flex stg:flex-col stg:gap-1",children:[(0,t.jsx)("h3",{className:"stg:text-base stg:font-semibold stg:text-foreground",children:"Apply YAML"}),(0,t.jsx)("p",{className:"stg:text-sm stg:text-muted-foreground",children:"Paste a resource manifest or upload a file. Resources are created when new and updated when they already exist."})]}),(0,t.jsx)("input",{ref:y,type:"file",accept:".yaml,.yml,.json",onChange:C,className:(0,i.f)("stg:w-full stg:rounded-md stg:border stg:border-input stg:bg-background stg:px-3 stg:py-2 stg:text-sm stg:text-foreground","stg:file:mr-3 stg:file:rounded-md stg:file:border-0 stg:file:bg-primary stg:file:px-2.5 stg:file:py-1 stg:file:text-xs stg:file:font-medium stg:file:text-primary-foreground","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring"),"aria-label":"Select manifest file"}),(0,t.jsx)(p.f,{value:v.content,onChange:v.setContent,className:"stg:h-56"}),v.hasRedactedSecrets&&(0,t.jsx)(o.f,{}),v.validationError&&(0,t.jsx)("div",{role:"alert",className:"stg:rounded-md stg:border stg:border-destructive stg:bg-card stg:px-3 stg:py-2.5 stg:text-sm stg:text-destructive",children:v.validationError}),v.entries&&v.entries.length>0&&(0,t.jsx)("ul",{className:(0,i.f)(n.J,"stg:flex stg:max-h-48 stg:flex-col stg:gap-2 stg:overflow-y-auto"),"aria-label":"Resources to apply",children:v.entries.map((e,s)=>(0,t.jsx)(x,{entry:e},`${e.document.handler.yamlKind}/${e.document.org}/${e.document.slug}/${s}`))}),(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:justify-between stg:gap-3",children:[(0,t.jsx)("p",{className:"stg:text-xs stg:text-muted-foreground","aria-live":"polite",children:v.isValidating?"Validating…":""}),(0,t.jsxs)("div",{className:"stg:flex stg:gap-2",children:[(0,t.jsx)("button",{type:"button",onClick:N,disabled:v.isApplying,className:(0,i.f)("stg:rounded-md stg:px-3 stg:py-1.5 stg:text-sm 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","stg:disabled:pointer-events-none stg:disabled:opacity-50"),children:"Cancel"}),(0,t.jsx)("button",{type:"button",onClick:k,disabled:!A,className:(0,i.f)("stg:rounded-md stg:px-3 stg:py-1.5 stg:text-sm stg:font-medium stg:transition-colors","stg:bg-primary stg:text-primary-foreground stg:hover:bg-primary-hover","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring","stg:disabled:pointer-events-none stg:disabled:opacity-50"),children:v.isApplying?"Applying…":(b=v.entries?.length??0)<=1?"Apply":`Apply ${b} resources`})]})]})]})})}],658653)}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,920744,e=>{"use strict";var i=e.i(974265),s=e.i(651023),l=e.i(19738),r=e.i(107233),a=e.i(283086),t=e.i(541071),n=e.i(174886),o=e.i(778917),c=e.i(727612),d=e.i(451241),m=e.i(610008),f=e.i(845132),u=e.i(255817),g=e.i(297629),x=e.i(885795),h=e.i(42592),p=e.i(966205),k=e.i(10337),b=e.i(846696),j=e.i(874792),y=e.i(170255);let v=[{id:"name",header:"Name",cell:e=>(0,i.jsx)("span",{className:"font-medium text-foreground",children:e.name||e.slug}),sortable:!0,flex:2},{id:"org",header:"Organization",cell:e=>(0,i.jsx)(x.f,{orgId:e.org,className:"text-muted-foreground"}),flex:1},{id:"description",header:"Description",cell:e=>(0,i.jsx)("span",{className:"line-clamp-1 text-muted-foreground",children:e.description||"—"}),flex:3}];e.s(["SkillListPage",0,function(){let e=(0,g.x)(),x=(0,h.b)(),N=(0,u.f)(),{navigateToDetail:w}=(0,d.b)(),{confirmState:z,confirm:C,handleConfirm:S,handleCancel:T}=(0,p.f)(),[I,M]=(0,s.useReducer)(e=>e+1,0),D=(0,s.useCallback)(async e=>{if(await C({title:`Delete ${e.name||e.slug}?`,description:"This action cannot be undone. The skill and its content will be permanently removed.",confirmLabel:"Delete",variant:"destructive"}))try{await N.skill.delete(e.id),b.c.success(`${e.name||e.slug} deleted`),M()}catch{b.c.error("Failed to delete skill")}},[C,N]),A=(0,s.useMemo)(()=>(0,j.f)(N,y.X.skill),[N]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("div",{className:"mb-6",children:[(0,i.jsx)("h1",{className:"text-foreground text-xl font-semibold",children:"Skills"}),(0,i.jsx)("p",{className:"text-muted-foreground mt-1 text-sm",children:"Browse and manage skills in your organization."})]}),(0,i.jsx)(m.f,{refetchToken:I,listFn:A,org:e,columns:v,defaultViewMode:"cards",viewModes:["table","cards"],viewModeStorageKey:"stigmer:workbench:skills:viewMode",searchPlaceholder:"Search skills…",emptyIcon:(0,i.jsx)(a.f,{className:"size-10","aria-hidden":"true"}),emptyTitle:"No skills yet",emptyDescription:"Upload a skill package to provide reusable instructions and context for your agents.",headerAction:(0,i.jsxs)(l.default,{href:"/library/skills/new",className:"inline-flex items-center gap-1.5 rounded-md bg-primary px-3 py-1.5 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[(0,i.jsx)(r.f,{className:"size-3.5","aria-hidden":"true"}),"Upload skill"]}),emptyAction:(0,i.jsxs)(l.default,{href:"/library/skills/new",className:"inline-flex items-center gap-1.5 rounded-md bg-primary px-3 py-1.5 text-xs font-medium text-primary-foreground transition-colors hover:bg-primary-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[(0,i.jsx)(r.f,{className:"size-3.5","aria-hidden":"true"}),"Upload skill"]}),onItemClick:e=>w("skills",e.org,e.slug),renderItemAction:e=>(0,i.jsx)("div",{onClick:e=>e.stopPropagation(),children:(0,i.jsxs)(f.f,{children:[(0,i.jsx)(f.f.Trigger,{"aria-label":`Actions for ${e.name||e.slug}`,children:(0,i.jsx)(t.f,{className:"size-4"})}),(0,i.jsxs)(f.f.Content,{children:[(0,i.jsx)(f.f.Item,{icon:(0,i.jsx)(o.f,{className:"size-4"}),onSelect:()=>w("skills",e.org,e.slug),children:"View details"}),(0,i.jsx)(f.f.Item,{icon:(0,i.jsx)(n.f,{className:"size-4"}),onSelect:()=>{navigator.clipboard.writeText(`${x(e.org)}/${e.slug}`),b.c.success("Copied skill ID")},children:"Copy ID"}),(0,i.jsx)(f.f.Separator,{}),(0,i.jsx)(f.f.Item,{icon:(0,i.jsx)(c.f,{className:"size-4"}),variant:"destructive",onSelect:()=>D(e),children:"Delete"})]})]})}),"aria-label":"Skill workbench"}),(0,i.jsx)(k.f,{state:z,onConfirm:S,onCancel:T})]})}])},283086,e=>{"use strict";let i=(0,e.i(475254).f)("sparkles",[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]]);e.s(["f",0,i],283086)}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,949037,e=>{"use strict";var t=e.i(974265),s=e.i(651023),r=e.i(537097),n=e.i(918789),i=e.i(893976),a=e.i(17616),l=e.i(579342),o=e.i(170255),g=e.i(910304),d=e.i(255817),c=e.i(616701),u=e.i(869803),f=e.i(61855),m=e.i(469196),x=e.i(536907),h=e.i(781836),p=e.i(891287),b=e.i(217516);async function v(t,s){let r=await j(t,s),{unzipSync:n,strFromU8:i}=await e.A(180067),a=Object.entries(n(r)),l=a.map(([e,t])=>({path:e,size:t.length,isDirectory:0===t.length&&e.endsWith("/")})),o=new Map;for(let[e,t]of a)if(!e.endsWith("/"))try{o.set(e,i(t))}catch{o.set(e,"[Binary content]")}return{files:l,contentMap:o}}async function j(e,t){let s,r=(0,p.f)(b.i,{artifactStorageKey:t});try{s=await e.skill.getArtifactDownloadUrl(r)}catch(t){if((0,g.Q)(t))return(await e.skill.getArtifact(r)).artifact;throw t}try{let t=e.fetch??globalThis.fetch,r=await t(s.url);if(!r.ok)throw Error(`artifact download failed with HTTP ${r.status}`);return new Uint8Array(await r.arrayBuffer())}catch(t){return console.warn("[stigmer] skill artifact download URL fetch failed (bucket CORS not provisioned for this origin?) — falling back to the unary lane",t),(await e.skill.getArtifact(r)).artifact}}var N=e.i(996675);function y({artifactStorageKey:e,className:r}){let{files:n,isLoading:a,error:l,getFileContent:o}=function(e){let t=(0,d.f)(),[r,n]=(0,s.useState)(null),[i,a]=(0,s.useState)(new Map),[l,o]=(0,s.useState)(!1),[g,c]=(0,s.useState)(null),u=(0,s.useRef)(0),f=(0,s.useCallback)(async()=>{if(!e){n(null),a(new Map),c(null);return}let s=++u.current;o(!0),c(null);try{let r=await v(t,e);if(u.current!==s)return;a(r.contentMap),n(r.files)}catch(e){if(u.current!==s)return;c((0,h.f)(e)),n(null),a(new Map)}finally{u.current===s&&o(!1)}},[e,t]);(0,s.useEffect)(()=>{f()},[f]);let m=(0,s.useCallback)(e=>i.get(e)??null,[i]),x=(0,s.useCallback)(()=>{f()},[f]);return(0,s.useMemo)(()=>({files:r,isLoading:l,error:g,getFileContent:m,refetch:x}),[r,l,g,m,x])}(e),[g,c]=(0,s.useState)(null),f=(0,s.useMemo)(()=>n?n.filter(e=>!e.isDirectory):[],[n]),p=(0,s.useMemo)(()=>(0,m.f)(f),[f]),b=(0,s.useMemo)(()=>{if(f.some(e=>"SKILL.md"===e.path))return"SKILL.md";let e=[...f].sort((e,t)=>e.path.localeCompare(t.path));return e[0]?.path??null},[f]),j=g??b,w=null!==j?o(j):null;return e?a?(0,t.jsxs)(N.f,{className:(0,i.f)("stg:rounded-lg stg:border stg:border-border",r),label:"Loading skill package files",children:[(0,t.jsx)("div",{className:"stg:p-4",children:(0,t.jsx)("div",{className:"stg:h-3 stg:w-32 stg:animate-pulse stg:rounded stg:bg-muted"})}),(0,t.jsxs)("div",{className:"stg:grid stg:grid-cols-1 stg:md:grid-cols-[200px_1fr] stg:border-t stg:border-border",children:[(0,t.jsx)("div",{className:"stg:space-y-2 stg:p-3 stg:border-b stg:md:border-b-0 stg:md:border-r stg:border-border",children:[1,2,3].map(e=>(0,t.jsx)("div",{className:"stg:h-4 stg:w-full stg:animate-pulse stg:rounded stg:bg-muted"},e))}),(0,t.jsx)("div",{className:"stg:p-4",children:(0,t.jsxs)("div",{className:"stg:space-y-2",children:[(0,t.jsx)("div",{className:"stg:h-4 stg:w-3/4 stg:animate-pulse stg:rounded stg:bg-muted"}),(0,t.jsx)("div",{className:"stg:h-4 stg:w-1/2 stg:animate-pulse stg:rounded stg:bg-muted"}),(0,t.jsx)("div",{className:"stg:h-4 stg:w-2/3 stg:animate-pulse stg:rounded stg:bg-muted"})]})})]})]}):l?(0,t.jsx)("div",{className:(0,i.f)("stg:rounded-lg stg:border stg:border-border stg:p-4",r),children:(0,t.jsxs)("p",{className:"stg:text-sm stg:text-destructive",children:["Failed to load skill package: ",l.message]})}):n&&0!==n.length?(0,t.jsxs)("div",{className:(0,i.f)("stg:rounded-lg stg:border stg:border-border stg:overflow-hidden",r),children:[(0,t.jsx)("div",{className:"stg:border-b stg:border-border stg:px-4 stg:py-2",children:(0,t.jsx)("h3",{className:"stg:text-xs stg:font-medium stg:uppercase stg:tracking-wider stg:text-muted-foreground",children:"Package Files"})}),(0,t.jsxs)("div",{className:"stg:grid stg:grid-cols-1 stg:md:grid-cols-[220px_1fr]",children:[(0,t.jsx)("nav",{className:"stg:border-b stg:border-border stg:md:border-b-0 stg:md:border-r stg:overflow-y-auto","aria-label":"Skill package file tree",children:(0,t.jsx)("ul",{className:(0,i.f)(u.J,"stg:py-1"),role:"tree",children:p.map(e=>(0,t.jsx)(x.B,{node:e,selectedPath:j??"",onSelect:c,depth:0},e.path))})}),(0,t.jsx)("div",{className:"stg:min-h-[200px] stg:max-h-[400px] stg:overflow-y-auto stg:p-4",children:null!==j&&null!==w?(0,t.jsx)(k,{path:j,content:w}):(0,t.jsx)("p",{className:"stg:text-sm stg:text-muted-foreground-subtle stg:italic",children:"Select a file to view its contents"})})]})]}):null:null}function k({path:e,content:s}){return e.endsWith(".md")?(0,t.jsx)(n.f,{remarkPlugins:f.Z,components:f.u,children:(0,f.n)(s)}):(0,t.jsx)("pre",{className:"stg:overflow-x-auto stg:font-mono stg:text-xs stg:leading-relaxed stg:text-foreground stg:whitespace-pre-wrap",children:s})}var w=e.i(476007),C=e.i(758960),S=e.i(484763),M=e.i(803874),L=e.i(188482),A=e.i(668093),D=e.i(652337),P=e.i(267912),T=e.i(384605);function B({value:e,onSave:r,placeholder:n="Click to edit",validate:a,variant:l="default",disabled:o,isSaving:g,error:d,className:c}){let[u,f]=(0,s.useState)(null),m=(0,s.useRef)(null),{isEditing:x,setIsEditing:h,draft:p,setDraft:b,startEditing:v}=(0,T.f)(e,m),j=(0,s.useCallback)(()=>{f(null),v()},[v]),N=(0,s.useCallback)(async()=>{let t=p.trim();if(t===e)return void h(!1);if(a){let e=a(t);if(e)return void f(e)}await r(t)&&h(!1)},[p,e,a,r]),y=(0,s.useCallback)(()=>{h(!1),b(e),f(null)},[e]),k=(0,s.useCallback)(e=>{"Enter"===e.key?(e.preventDefault(),N()):"Escape"===e.key&&y()},[N,y]),w=u||d;return o||!x?(0,t.jsx)("div",{className:(0,i.f)("stg:group/inline-edit",c),children:(0,t.jsxs)("button",{type:"button",onClick:()=>{o||j()},disabled:o,className:(0,i.f)("stg:inline-flex stg:w-full stg:items-center stg:gap-1.5 stg:rounded-md stg:px-1.5 stg:py-0.5 stg:text-left stg:transition-colors",!o&&"stg:hover:bg-accent-hover stg:cursor-pointer",o&&"stg:cursor-default","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-inset stg:focus-visible:ring-ring"),children:[(0,t.jsx)("span",{className:(0,i.f)("stg:min-w-0 stg:truncate","heading"===l?"stg:text-lg stg:font-semibold stg:text-foreground":"stg:text-sm stg:text-foreground",!e&&"stg:text-muted-foreground stg:italic"),children:e||n}),!o&&(0,t.jsx)(E,{className:"stg:size-3 stg:shrink-0 stg:text-muted-foreground stg:opacity-0 stg:transition-opacity stg:group-hover/inline-edit:opacity-100"})]})}):(0,t.jsxs)("div",{className:(0,i.f)("stg:flex stg:flex-col stg:gap-1",c),children:[(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-1.5",children:[(0,t.jsx)("input",{ref:m,type:"text",value:p,onChange:e=>{b(e.target.value),f(null)},onKeyDown:k,disabled:g,placeholder:n,className:(0,i.f)("stg:flex-1 stg:rounded-md stg:border stg:border-border stg:bg-input-bg stg:px-2 stg:py-1 stg:text-sm stg:text-foreground","stg:focus:outline-none stg:focus:ring-2 stg:focus:ring-ring","stg:disabled:opacity-50","heading"===l&&"stg:text-lg stg:font-semibold",w&&"stg:border-destructive")}),(0,t.jsx)("button",{type:"button",onClick:N,disabled:g,"aria-label":"Save",className:(0,i.f)("stg:inline-flex stg:size-7 stg:items-center stg:justify-center stg:rounded-md","stg:bg-primary stg:text-primary-foreground stg:hover:bg-primary-hover","stg:disabled:opacity-50","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring"),children:g?(0,t.jsx)(U,{}):(0,t.jsx)(K,{className:"stg:size-3.5"})}),(0,t.jsx)("button",{type:"button",onClick:y,disabled:g,"aria-label":"Cancel",className:(0,i.f)("stg:inline-flex stg:size-7 stg:items-center stg:justify-center stg:rounded-md","stg:border stg:border-border stg:bg-background stg:text-foreground stg:hover:bg-accent stg:hover:text-accent-foreground","stg:disabled:opacity-50","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring"),children:(0,t.jsx)(R,{className:"stg:size-3.5"})})]}),w&&(0,t.jsx)("p",{className:"stg:px-1 stg:text-xs stg:text-destructive",role:"alert",children:w})]})}function E({className:e}){return(0,t.jsx)("svg",{className:e,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M11.5 1.5a2.121 2.121 0 0 1 3 3L5 14l-4 1 1-4Z"})})}function K({className:e}){return(0,t.jsx)("svg",{className:e,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,t.jsx)("path",{d:"m3 8.5 3.5 3.5 6.5-8"})})}function R({className:e}){return(0,t.jsx)("svg",{className:e,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,t.jsx)("path",{d:"m4 4 8 8M12 4l-8 8"})})}function U(){return(0,t.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",className:"stg:animate-spin","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M8 2a6 6 0 1 0 6 6"})})}var W=e.i(261722),z=e.i(400019);let $=(0,p.f)(b.s);function F(e){return{id:e.versionHash,timestamp:e.pushedAt?(0,a.S)(e.pushedAt):new Date(0),actor:e.pushedBy?{id:e.pushedBy.id,avatar:e.pushedBy.avatar||void 0,displayName:void 0}:void 0,label:e.versionHash.slice(0,12),sublabel:e.message||void 0,isCurrent:e.isCurrent,tag:e.tag||void 0,gitProvenance:e.gitProvenance?{remoteUrl:e.gitProvenance.remoteUrl,ref:e.gitProvenance.ref,commit:e.gitProvenance.commit}:void 0}}var H=e.i(784400),I=e.i(468806),O=e.i(19395);function _(e){if(0===e.length)return 0;let t=1;for(let s=0;s<e.length;s++)"\n"===e[s]&&t++;return t}function Y(e,t){let s="SKILL.md"===e.path||"skill.md"===e.path,r="SKILL.md"===t.path||"skill.md"===t.path;if(s&&!r)return -1;if(!s&&r)return 1;let n={modified:0,added:1,removed:2},i=(n[e.changeType]??3)-(n[t.changeType]??3);return 0!==i?i:e.path.localeCompare(t.path)}function Z(e){let t=0;for(let s of e.values())t+=2*s.length;return t}function G(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`}var V=e.i(598529);function Q({files:e,selectedPath:s,onSelect:r,className:n}){return 0===e.length?null:(0,t.jsx)("nav",{"aria-label":"Changed files",className:(0,i.f)("stg:flex stg:flex-col stg:overflow-auto",n),children:e.map(e=>(0,t.jsxs)("button",{type:"button",onClick:()=>r(e.path),"aria-current":e.path===s?"true":void 0,className:(0,i.f)("stg:flex stg:items-center stg:gap-2 stg:px-3 stg:py-1.5 stg:text-left stg:text-xs stg:transition-colors","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring stg:focus-visible:ring-inset",e.path===s?"stg:bg-accent-hover stg:text-foreground":"stg:text-muted-foreground stg:hover:bg-accent-hover stg:hover:text-foreground"),children:[(0,t.jsx)(q,{changeType:e.changeType}),(0,t.jsx)("span",{className:"stg:min-w-0 stg:flex-1 stg:truncate stg:font-mono",children:e.path}),(0,t.jsx)(J,{additions:e.additions,deletions:e.deletions})]},e.path))})}function q({changeType:e}){return(0,t.jsx)("span",{className:(0,i.f)("stg:shrink-0 stg:font-mono stg:text-2xs stg:font-bold","modified"===e?"stg:text-diff-hunk-header-fg":"added"===e?"stg:text-diff-added-fg":"stg:text-diff-removed-fg"),"aria-label":e,children:"modified"===e?"M":"added"===e?"A":"D"})}function J({additions:e,deletions:s}){return(0,t.jsxs)("span",{className:"stg:shrink-0 stg:font-mono stg:text-2xs",children:[e>0&&(0,t.jsxs)("span",{className:"stg:text-diff-added-fg",children:["+",e]}),e>0&&s>0&&" ",s>0&&(0,t.jsxs)("span",{className:"stg:text-diff-removed-fg",children:["-",s]})]})}var X=e.i(676951);function ee({diff:e,initialSelectedPath:r,className:n}){let[a,l]=(0,s.useState)(r??e.files[0]?.path??null),o=(0,s.useCallback)(e=>{l(e)},[]),g=a?e.getDiff(a):[];return 0===e.files.length?(0,t.jsxs)("div",{role:"status",className:(0,i.f)("stg:flex stg:flex-col stg:items-center stg:gap-2 stg:py-12 stg:text-center",n),children:[(0,t.jsx)(et,{className:"stg:size-8 stg:text-muted-foreground-faint"}),(0,t.jsx)("p",{className:"stg:text-sm stg:text-muted-foreground",children:"No differences found"}),(0,t.jsx)("p",{className:"stg:text-xs stg:text-muted-foreground-subtle",children:"These two versions have identical content."})]}):(0,t.jsxs)("div",{className:(0,i.f)("stg:flex stg:flex-col stg:gap-3",n),children:[(0,t.jsx)(X.f,{fileCount:e.files.length,additions:e.totalAdditions,deletions:e.totalDeletions}),e.files.length>1&&(0,t.jsx)("div",{className:"stg:overflow-hidden stg:rounded-lg stg:border stg:border-border",children:(0,t.jsx)(Q,{files:e.files,selectedPath:a,onSelect:o})}),(0,t.jsx)(V.f,{hunks:g,filePath:a??void 0})]})}function et({className:e}){return(0,t.jsxs)("svg",{className:e,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M8 3v10M3 8h10"}),(0,t.jsx)("circle",{cx:"8",cy:"8",r:"7"})]})}function es({state:e,onClose:r}){let n=(0,s.useCallback)(e=>{e||r()},[r]),{diff:a,isLoading:l,error:o}=function(e,t){let r=(0,d.f)(),[n,i]=(0,s.useState)(null),[a,l]=(0,s.useState)(!1),[o,g]=(0,s.useState)(null),c=(0,s.useRef)(0),u=(0,s.useCallback)(async()=>{if(!e||!t){i(null),g(null);return}let s=++c.current;l(!0),g(null);try{let[n,a]=await Promise.all([v(r,e),v(r,t)]);if(c.current!==s)return;let l=Z(n.contentMap)+Z(a.contentMap);if(l>0xa00000)throw Error(`Combined artifact size (${G(l)}) exceeds the ${G(0xa00000)} limit. Try comparing smaller skill packages.`);let o=function(e,t){let s=new Map,r=[],n=0,i=0;for(let a of new Set([...e.keys(),...t.keys()])){let l=e.get(a),o=t.get(a);if(void 0===l&&void 0!==o){let e=_(o);r.push({path:a,changeType:"added",additions:e,deletions:0}),n+=e;let t=(0,O.f)("",o);s.set(a,t)}else if(void 0!==l&&void 0===o){let e=_(l);r.push({path:a,changeType:"removed",additions:0,deletions:e}),i+=e;let t=(0,O.f)(l,"");s.set(a,t)}else if(void 0!==l&&void 0!==o&&l!==o){let e=(0,O.f)(l,o),t=e.reduce((e,t)=>e+t.lines.filter(e=>"added"===e.type).length,0),g=e.reduce((e,t)=>e+t.lines.filter(e=>"removed"===e.type).length,0);r.push({path:a,changeType:"modified",additions:t,deletions:g}),n+=t,i+=g,s.set(a,e)}}return r.sort(Y),{files:r,totalAdditions:n,totalDeletions:i,getDiff:e=>s.get(e)??[]}}(n.contentMap,a.contentMap);if(c.current!==s)return;i(o)}catch(e){if(c.current!==s)return;g((0,h.f)(e)),i(null)}finally{c.current===s&&l(!1)}},[e,t,r]);return(0,s.useEffect)(()=>{u()},[u]),(0,s.useMemo)(()=>({diff:n,isLoading:a,error:o}),[n,a,o])}(e?.fromArtifactKey??null,e?.toArtifactKey??null);return e?(0,t.jsx)(I.f,{open:!0,onOpenChange:n,width:"4xl",dismissOnBackdrop:!0,className:"stg:h-[85vh]","aria-label":"Skill version diff",children:(0,t.jsxs)("div",{className:"stg:flex stg:h-full stg:flex-col",children:[(0,t.jsxs)("div",{className:"stg:flex stg:shrink-0 stg:items-center stg:justify-between stg:border-b stg:border-border stg:px-4 stg:py-3",children:[(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-2 stg:text-sm",children:[(0,t.jsx)("span",{className:"stg:font-medium stg:text-foreground",children:"Comparing"}),(0,t.jsx)("code",{className:"stg:rounded stg:bg-muted stg:px-1.5 stg:py-0.5 stg:font-mono stg:text-2xs stg:text-muted-foreground",children:e.fromLabel}),(0,t.jsx)(en,{className:"stg:size-3.5 stg:text-muted-foreground-faint"}),(0,t.jsx)("code",{className:"stg:rounded stg:bg-muted stg:px-1.5 stg:py-0.5 stg:font-mono stg:text-2xs stg:text-muted-foreground",children:e.toLabel})]}),(0,t.jsx)("button",{type:"button",onClick:r,"aria-label":"Close diff viewer",className:(0,i.f)("stg:rounded-md stg:p-1.5 stg:text-muted-foreground stg:transition-colors","stg:hover:bg-accent-hover stg:hover:text-foreground","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring"),children:(0,t.jsx)(ei,{className:"stg:size-4"})})]}),(0,t.jsx)("div",{className:"stg:flex-1 stg:overflow-auto stg:p-4",children:l?(0,t.jsx)(er,{}):o?(0,t.jsx)(w.f,{error:o}):a?(0,t.jsx)(ee,{diff:a}):null})]})}):null}function er(){return(0,t.jsxs)(N.f,{className:"stg:flex stg:flex-col stg:gap-4",label:"Loading diff",children:[(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-2",children:[(0,t.jsx)("div",{className:"stg:h-4 stg:w-36 stg:animate-pulse stg:rounded stg:bg-muted"}),(0,t.jsx)("div",{className:"stg:h-4 stg:w-20 stg:animate-pulse stg:rounded stg:bg-muted"}),(0,t.jsx)("div",{className:"stg:h-4 stg:w-20 stg:animate-pulse stg:rounded stg:bg-muted"})]}),(0,t.jsx)("div",{className:"stg:h-6 stg:w-full stg:animate-pulse stg:rounded stg:bg-muted"}),[1,2,3,4,5,6].map(e=>(0,t.jsxs)("div",{className:"stg:flex stg:gap-2",children:[(0,t.jsx)("div",{className:"stg:h-4 stg:w-10 stg:animate-pulse stg:rounded stg:bg-muted"}),(0,t.jsx)("div",{className:"stg:h-4 stg:w-10 stg:animate-pulse stg:rounded stg:bg-muted"}),(0,t.jsx)("div",{className:"stg:h-4 stg:flex-1 stg:animate-pulse stg:rounded stg:bg-muted"})]},e))]})}function en({className:e}){return(0,t.jsx)("svg",{className:e,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M3 8h10M9 4l4 4-4 4"})})}function ei({className:e}){return(0,t.jsx)("svg",{className:e,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M4 4l8 8M12 4l-8 8"})})}var ea=e.i(292420),el=e.i(473489),eo=e.i(321953);let eg={id:"content",label:"Content"},ed={id:"versions",label:"Versions"};function ec({org:e,slug:r,version:n,onResourceLoad:i,primaryAction:u,actions:f,additionalTabs:m,activeTab:x,onTabChange:h,defaultTab:v,onVersionSelect:j,onPluginClick:N,editable:y=!1,onResourceUpdated:k,className:L}){let D,{skill:T,isLoading:B,error:E,refetch:K}=function(e,t,s){let r=(0,d.f)(),{data:n,isLoading:i,isRefetching:a,error:l,refetch:o}=(0,c.f)(e&&t?async()=>{try{return await r.skill.getByReference({org:e,slug:t,version:s})}catch(e){if((0,g.c)(e))return null;throw e}}:null,[e,t,s,r],null);return{skill:n,isLoading:i,isRefetching:a,error:l,refetch:o}}(e,r,n),R=(0,el.l)(T?.metadata?.labels),U=T?.metadata?.id??"",W=(0,s.useMemo)(()=>""!==U?{kind:"skill",id:U}:null,[U]),I=(0,M.f)(y?W:null,"can_edit",{fail:"closed"}),O=y&&I.allowed&&null===R.plugin,_=function(e,t){let r=(0,d.f)(),n=(0,z.f)(e&&t?async s=>{try{let n=(0,p.f)(b.c,{org:e,slug:t,pageToken:s});return await r.skill.listVersions(n)}catch(e){if(function(e){if(!e||"object"!=typeof e)return!1;if("connectCode"in e&&12===e.connectCode)return!0;let t=e.message??"";return t.includes("[unimplemented]")||t.includes("UNIMPLEMENTED")}(e))return $;throw e}}:null,[e,t,r],e=>e.versionHash),i=n.items,{hasMore:a,loadMore:l,isLoadingMore:o,loadMoreError:g,isLoading:c,error:u,refetch:f}=n,m=(0,s.useMemo)(()=>i.map(F),[i]),x=(0,s.useMemo)(()=>{let e=new Map;for(let t of i)t.versionHash&&t.artifactStorageKey&&e.set(t.versionHash,t.artifactStorageKey);return e},[i]),h=(0,s.useCallback)(e=>x.get(e)??null,[x]),v=0===m.length;return(0,s.useMemo)(()=>({versions:m,isEmpty:v,hasMore:a,loadMore:l,isLoadingMore:o,loadMoreError:g,isLoading:c,error:u,refetch:f,getArtifactKey:h}),[m,v,a,l,o,g,c,u,f,h])}(e,r),{versions:Y,isEmpty:Z,getArtifactKey:G}=_,[V,Q]=(0,s.useState)(null),q=(0,s.useMemo)(()=>Z?[eg]:[eg,ed],[Z]),{effectiveTabs:J,effectiveActiveTab:X,effectiveOnTabChange:ee,activeAdditionalTab:et}=(0,P.f)({builtInTabs:q,additionalTabs:m,activeTab:x,onTabChange:h,defaultTab:v}),er=(0,s.useCallback)(e=>j?.(e),[j]),en=(0,s.useCallback)((e,t)=>{let s=G(e),r=G(t);s&&r&&Q({fromArtifactKey:s,toArtifactKey:r,fromLabel:e.slice(0,12),toLabel:t.slice(0,12)})},[G]),ei=(0,s.useCallback)(()=>Q(null),[]),ef=(0,s.useRef)(i);ef.current=i,(0,s.useEffect)(()=>{T?.metadata?.name&&ef.current?.({name:T.metadata.name,id:T.metadata.id})},[T]);let em=(0,S.f)({resource:T?.metadata?{kind:o.X.skill,kindString:"skill",id:T.metadata.id,org:T.metadata.org,name:T.metadata.name}:null,visibility:T?.metadata?{kind:"skill",current:T.metadata.visibility,org:T.metadata.org,onChanged:K}:void 0});if(B)return(0,t.jsx)(eb,{className:L});if(E)return(0,t.jsx)(w.f,{error:E,retry:K,className:L});if(!T)return(0,t.jsx)(ev,{className:L});let ex=T.metadata,eh=T.spec,ep=T.status,eN=ep?.audit?.specAudit,ey={name:ex?.name||ex?.slug||"Untitled",id:ex?.id||"",org:ex?.org,slug:ex?.slug,description:void 0,icon:(0,t.jsx)(ej,{className:"stg:size-6 stg:text-muted-foreground"}),createdAt:eN?.createdAt?(0,a.S)(eN.createdAt):null,updatedAt:eN?.updatedAt?(0,a.S)(eN.updatedAt):null,status:ep?function(e){switch(e){case l.D.READY:return"ready";case l.D.FAILED:return"failed";case l.D.UPLOADING:return"pending";default:return}}(ep.state):void 0,statusLabel:ep?function(e){switch(e){case l.D.READY:return"Ready";case l.D.FAILED:return"Failed";case l.D.UPLOADING:return"Uploading";default:return}}(ep.state):void 0},ek=ex?(0,t.jsx)(C.n,{visibility:ex.visibility,onClick:em.action?em.open:void 0}):void 0,ew=em.action?[...f??[],em.action]:f;return D=et?et.content:"versions"===X&&Y.length>0?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(H.f,{entries:Y,onEntrySelect:er,onCompare:en}),(0,t.jsx)(eo.f,{hasMore:_.hasMore,loadMore:_.loadMore,isLoadingMore:_.isLoadingMore,loadMoreError:_.loadMoreError})]}):(0,t.jsx)(eu,{spec:eh,status:ep,editable:O}),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(A.f,{header:ey,visibilityControl:ek,headerBanner:(0,t.jsx)(ea.f,{plugin:R.plugin,onPluginClick:N}),primaryAction:u,actions:ew,resource:W,tabs:J,activeTab:J?X:void 0,onTabChange:J?ee:void 0,tabsAriaLabel:"Skill detail sections",className:L,children:D}),em.dialog,(0,t.jsx)(es,{state:V,onClose:ei})]})}function eu({spec:e,status:s,editable:r}){return(0,t.jsxs)("div",{className:"stg:flex stg:flex-col stg:gap-6",children:[(r||e?.description)&&(0,t.jsx)(D.f,{title:"Description",children:r?(0,t.jsx)("div",{className:"stg:max-h-20 stg:overflow-y-auto stg:p-3",children:(0,t.jsx)(W.f,{value:e?.description||"",onSave:async()=>!1,isSaving:!1,placeholder:"Add a description",minRows:2,disabled:!0})}):(0,t.jsx)("div",{className:"stg:p-3",children:(0,t.jsx)("pre",{className:"stg:whitespace-pre-wrap stg:break-words stg:text-sm stg:text-foreground stg:font-sans",children:e?.description})})}),(r||e?.tag)&&(0,t.jsx)(D.f,{title:"Tag",children:r?(0,t.jsx)("div",{className:"stg:p-3",children:(0,t.jsx)(B,{value:e?.tag||"",onSave:async()=>!1,isSaving:!1,placeholder:"Add a tag (e.g. stable, latest)",disabled:!0})}):(0,t.jsx)("div",{className:"stg:flex stg:items-center stg:gap-2 stg:px-3 stg:py-2.5",children:(0,t.jsx)("span",{className:"stg:rounded stg:bg-muted stg:px-1.5 stg:py-0.5 stg:font-mono stg:text-xs stg:font-medium stg:text-foreground",children:e?.tag})})}),s?.artifactStorageKey?(0,t.jsx)(y,{artifactStorageKey:s.artifactStorageKey}):e?.skillMd?(0,t.jsx)(ef,{content:e.skillMd}):null,s&&(s.versionHash||s.gitProvenance)&&(0,t.jsx)(ex,{versionHash:s.versionHash,gitProvenance:s.gitProvenance})]})}function ef({content:e}){let[r,i]=(0,s.useState)("rendered");return(0,t.jsx)(ep,{title:"Skill Content",trailing:(0,t.jsx)(em,{value:r,onChange:i}),children:"rendered"===r?(0,t.jsx)("div",{className:"stg:p-4",children:(0,t.jsx)(n.f,{remarkPlugins:f.Z,components:f.u,children:(0,f.n)(e)})}):(0,t.jsx)("pre",{className:"stg:overflow-x-auto stg:p-4 stg:font-mono stg:text-sm stg:leading-relaxed stg:text-foreground",children:e})})}function em({value:e,onChange:s}){return(0,t.jsxs)("div",{role:"radiogroup","aria-label":"Content view mode",className:"stg:inline-flex stg:rounded-md stg:border stg:border-input stg:text-2xs",children:[(0,t.jsx)("button",{type:"button",role:"radio","aria-checked":"rendered"===e,onClick:()=>s("rendered"),className:(0,i.f)("stg:rounded-l-md stg:px-2 stg:py-0.5 stg:font-medium stg:transition-colors","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring","rendered"===e?"stg:bg-muted stg:text-foreground":"stg:text-muted-foreground stg:hover:text-foreground"),children:"Preview"}),(0,t.jsx)("button",{type:"button",role:"radio","aria-checked":"source"===e,onClick:()=>s("source"),className:(0,i.f)("stg:rounded-r-md stg:border-l stg:border-input stg:px-2 stg:py-0.5 stg:font-medium stg:transition-colors","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring","source"===e?"stg:bg-muted stg:text-foreground":"stg:text-muted-foreground stg:hover:text-foreground"),children:"Source"})]})}function ex({versionHash:e,gitProvenance:s}){let r=e?e.slice(0,12):null;return(0,t.jsx)(D.f,{title:"Version",children:(0,t.jsxs)("div",{className:"stg:flex stg:flex-col stg:gap-3 stg:p-3",children:[r&&(0,t.jsxs)("div",{className:"stg:flex stg:items-baseline stg:gap-2",children:[(0,t.jsx)("span",{className:"stg:text-xs stg:font-medium stg:text-muted-foreground",children:"Hash"}),(0,t.jsxs)(L.W,{children:[(0,t.jsx)(L.y,{render:(0,t.jsx)("code",{className:"stg:font-mono stg:text-xs stg:text-foreground"}),children:r}),(0,t.jsx)(L.Y,{side:"top",className:"stg:break-all",children:e})]})]}),s&&(0,t.jsx)(eh,{provenance:s})]})})}function eh({provenance:e}){let s=function(e){if(!e)return null;let t=e.replace(/\.git$/,"");if(t.startsWith("https://")||t.startsWith("http://"))return t;let s=t.match(/^(?:git@|ssh:\/\/)([^:/]+)[:/](.+)$/);return s?`https://${s[1]}/${s[2]}`:null}(e.remoteUrl),r=e.commit?e.commit.slice(0,7):null;return(0,t.jsxs)("div",{className:"stg:flex stg:flex-col stg:gap-1.5",children:[(0,t.jsxs)("div",{className:"stg:flex stg:items-baseline stg:gap-2",children:[(0,t.jsx)("span",{className:"stg:text-xs stg:font-medium stg:text-muted-foreground",children:"Git"}),(0,t.jsxs)("div",{className:"stg:flex stg:flex-wrap stg:items-baseline stg:gap-x-1.5 stg:text-xs stg:text-foreground",children:[s?(0,t.jsx)("a",{href:s,className:"stg:text-primary stg:underline stg:underline-offset-2 stg:hover:text-primary-muted",target:"_blank",rel:"noopener noreferrer",children:function(e){try{return new URL(e).pathname.replace(/^\//,"").replace(/\.git$/,"")}catch{return e}}(s)}):(0,t.jsx)("span",{className:"stg:font-mono",children:e.remoteUrl}),e.ref&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"stg:text-muted-foreground",children:"@"}),(0,t.jsx)("span",{children:e.ref})]}),r&&(0,t.jsxs)(L.W,{children:[(0,t.jsx)(L.y,{render:(0,t.jsx)("code",{className:"stg:rounded stg:bg-muted stg:px-1 stg:py-0.5 stg:font-mono stg:text-2xs"}),children:r}),(0,t.jsx)(L.Y,{side:"top",className:"stg:break-all",children:e.commit})]})]})]}),e.subdir&&(0,t.jsxs)("div",{className:"stg:flex stg:items-baseline stg:gap-2",children:[(0,t.jsx)("span",{className:"stg:text-xs stg:font-medium stg:text-muted-foreground",children:"Path"}),(0,t.jsx)("code",{className:"stg:font-mono stg:text-xs stg:text-foreground",children:e.subdir})]})]})}function ep({title:e,trailing:s,children:r}){return(0,t.jsxs)("section",{children:[(0,t.jsxs)("div",{className:"stg:mb-2 stg:flex stg:items-center stg:justify-between",children:[(0,t.jsx)("h3",{className:"stg:text-xs stg:font-medium stg:uppercase stg:tracking-wider stg:text-muted-foreground",children:e}),s]}),(0,t.jsx)("div",{className:"stg:overflow-hidden stg:rounded-lg stg:border stg:border-border",children:r})]})}function eb({className:e}){return(0,t.jsxs)(N.f,{className:(0,i.f)("stg:flex stg:flex-col stg:gap-6",e),label:"Loading skill details",children:[(0,t.jsxs)("div",{className:"stg:flex stg:items-start stg:gap-3",children:[(0,t.jsx)("div",{className:"stg:mt-1 stg:size-6 stg:shrink-0 stg:animate-pulse stg:rounded stg:bg-muted"}),(0,t.jsxs)("div",{className:"stg:flex-1 stg:space-y-2",children:[(0,t.jsx)("div",{className:"stg:h-5 stg:w-48 stg:animate-pulse stg:rounded stg:bg-muted"}),(0,t.jsx)("div",{className:"stg:h-3 stg:w-64 stg:animate-pulse stg:rounded stg:bg-muted"}),(0,t.jsx)("div",{className:"stg:h-4 stg:w-full stg:max-w-md stg:animate-pulse stg:rounded stg:bg-muted"})]})]}),(0,t.jsxs)("div",{className:"stg:space-y-2",children:[(0,t.jsx)("div",{className:"stg:h-3 stg:w-28 stg:animate-pulse stg:rounded stg:bg-muted"}),(0,t.jsx)("div",{className:"stg:animate-pulse stg:rounded-lg stg:border stg:border-border stg:bg-muted-faint",style:{height:"240px"}})]}),(0,t.jsxs)("div",{className:"stg:space-y-2",children:[(0,t.jsx)("div",{className:"stg:h-3 stg:w-20 stg:animate-pulse stg:rounded stg:bg-muted"}),(0,t.jsx)("div",{className:"stg:animate-pulse stg:rounded-lg stg:border stg:border-border stg:bg-muted-faint",style:{height:"64px"}})]})]})}function ev({className:e}){return(0,t.jsxs)("div",{role:"status",className:(0,i.f)("stg:flex stg:flex-col stg:items-center stg:gap-2 stg:py-12 stg:text-center",e),children:[(0,t.jsx)(ej,{className:"stg:size-10 stg:text-muted-foreground-faint"}),(0,t.jsx)("p",{className:"stg:text-sm stg:font-medium stg:text-muted-foreground",children:"Skill not found"}),(0,t.jsx)("p",{className:"stg:text-xs stg:text-muted-foreground-subtle",children:"This skill doesn't exist or you don't have access to it."})]})}function ej({className:e}){return(0,t.jsx)("svg",{className:e,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M9 1.5 4 9h4l-1 5.5L12 7H8l1-5.5Z"})})}var eN=e.i(154752),ey=e.i(966205),ek=e.i(582321),ew=e.i(10337),eC=e.i(310057),eS=e.i(451241),eM=e.i(107141);function eL({org:e,slug:n}){let i=(0,r.useRouter)(),{navigateToDetail:a}=(0,eS.b)(),{setLabel:l}=(0,eC.Q)(),[o,g]=(0,s.useState)(null),[d,c]=(0,s.useState)("Skill"),{copyId:u,copyQualifiedSlug:f}=(0,eN.f)(),{confirmState:m,confirm:x,handleConfirm:h,handleCancel:p}=(0,ey.f)(),{deleteResource:b,isDeleting:v}=(0,ek.f)("skill",o,d);(0,s.useEffect)(()=>()=>l(null),[l]);let j=(0,s.useCallback)(({name:e,id:t})=>{l(e),g(t),c(e)},[l]),N=(0,s.useCallback)(async()=>{if(await x({title:`Delete ${d}?`,description:"This action cannot be undone. The skill and its content will be permanently removed.",confirmLabel:"Delete",variant:"destructive"}))try{await b(),i.push("/library/skills")}catch{}},[x,b,i,d]),y=(0,s.useMemo)(()=>[{id:"copy-id",label:"Copy ID",group:"clipboard",onAction:()=>{o&&u(o)},disabled:!o},{id:"copy-slug",label:"Copy slug",group:"clipboard",onAction:()=>f(e,n)},{id:"delete",requires:"can_delete",label:"Delete",variant:"destructive",group:"danger",onAction:N,disabled:v}],[o,u,f,e,n,N,v]);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ec,{org:e,slug:n,editable:!0,onResourceLoad:j,onPluginClick:({org:e,slug:t})=>a("plugins",e,t),actions:y}),(0,t.jsx)(ew.f,{state:m,onConfirm:h,onCancel:p})]})}e.s(["SkillDetailPage",0,function(){let e=(0,eS.R)(),s=(0,eM.f)("org",2),r=(0,eM.f)("slug");return!e&&s&&r?(0,t.jsx)(eL,{org:s,slug:r}):null},"SkillDetailPageInner",0,eL],949037)}]);