@stigmer/server-slim 3.18.0 → 3.19.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 (581) hide show
  1. package/console/404.html +1 -1
  2. package/console/__next.__PAGE__.txt +2 -2
  3. package/console/__next._full.txt +24 -23
  4. package/console/__next._head.txt +4 -4
  5. package/console/__next._index.txt +13 -15
  6. package/console/__next._tree.txt +2 -2
  7. package/console/_next/static/chunks/0.k18aw8l68rs.js +1 -0
  8. package/console/_next/static/chunks/0.wpyf_drhv8x.css +1 -0
  9. package/console/_next/static/chunks/0028ryyk-zcrk.js +1 -0
  10. package/console/_next/static/chunks/{0x.4919xjicc5.js → 004w~8qxculo~.js} +1 -1
  11. package/console/_next/static/chunks/05121lnteh0k4.js +1 -0
  12. package/console/_next/static/chunks/05hsc2apcu-66.js +1 -0
  13. package/console/_next/static/chunks/0625f_sg_08~p.js +1 -0
  14. package/console/_next/static/chunks/06rm9q_8qy6o9.js +1 -0
  15. package/console/_next/static/chunks/0a9_yomn052wg.js +1 -0
  16. package/console/_next/static/chunks/0af9vacgizdg..js +1 -0
  17. package/console/_next/static/chunks/0ala3mcyjvwvv.js +1 -0
  18. package/console/_next/static/chunks/0b8nbfovx36l5.js +1 -0
  19. package/console/_next/static/chunks/0dozqag.y8cvd.js +1 -0
  20. package/console/_next/static/chunks/{0.cr0e7bzkpoi.js → 0hjw5613u.jem.js} +3 -3
  21. package/console/_next/static/chunks/0id2oe7r5dozz.js +1 -0
  22. package/console/_next/static/chunks/0l9~uyr.vjf0t.js +2 -0
  23. package/console/_next/static/chunks/0mg-64_rqe3v9.js +1 -0
  24. package/console/_next/static/chunks/0rihzw4w1wzg3.js +1 -0
  25. package/console/_next/static/chunks/0s.hd0_eyzhc..js +1 -0
  26. package/console/_next/static/chunks/0ta6paxih8wwd.js +1 -0
  27. package/console/_next/static/chunks/0u9~d-cnb0w01.js +1 -0
  28. package/console/_next/static/chunks/0zc3nm7n~zcnb.js +3 -0
  29. package/console/_next/static/chunks/{0ij17mw0v0qd-.js → 0zfzrf3u6eg~~.js} +1 -1
  30. package/console/_next/static/chunks/12wm5jicnl6m8.js +1 -0
  31. package/console/_not-found/__next._full.txt +27 -26
  32. package/console/_not-found/__next._head.txt +4 -4
  33. package/console/_not-found/__next._index.txt +13 -15
  34. package/console/_not-found/__next._not-found.__PAGE__.txt +3 -3
  35. package/console/_not-found/__next._not-found.txt +3 -3
  36. package/console/_not-found/__next._tree.txt +2 -2
  37. package/console/_not-found.html +1 -1
  38. package/console/_not-found.txt +27 -26
  39. package/console/auth/callback/__next._full.txt +32 -31
  40. package/console/auth/callback/__next._head.txt +4 -4
  41. package/console/auth/callback/__next._index.txt +13 -15
  42. package/console/auth/callback/__next._tree.txt +2 -2
  43. package/console/auth/callback/__next.auth.callback.__PAGE__.txt +4 -4
  44. package/console/auth/callback/__next.auth.callback.txt +3 -3
  45. package/console/auth/callback/__next.auth.txt +3 -3
  46. package/console/auth/callback.html +1 -1
  47. package/console/auth/callback.txt +32 -31
  48. package/console/auth/github/callback/__next._full.txt +35 -34
  49. package/console/auth/github/callback/__next._head.txt +4 -4
  50. package/console/auth/github/callback/__next._index.txt +13 -15
  51. package/console/auth/github/callback/__next._tree.txt +2 -2
  52. package/console/auth/github/callback/__next.auth.github.callback.__PAGE__.txt +4 -4
  53. package/console/auth/github/callback/__next.auth.github.callback.txt +3 -3
  54. package/console/auth/github/callback/__next.auth.github.txt +3 -3
  55. package/console/auth/github/callback/__next.auth.txt +3 -3
  56. package/console/auth/github/callback.html +1 -1
  57. package/console/auth/github/callback.txt +35 -34
  58. package/console/auth/oauth/callback/__next._full.txt +35 -34
  59. package/console/auth/oauth/callback/__next._head.txt +4 -4
  60. package/console/auth/oauth/callback/__next._index.txt +13 -15
  61. package/console/auth/oauth/callback/__next._tree.txt +2 -2
  62. package/console/auth/oauth/callback/__next.auth.oauth.callback.__PAGE__.txt +4 -4
  63. package/console/auth/oauth/callback/__next.auth.oauth.callback.txt +3 -3
  64. package/console/auth/oauth/callback/__next.auth.oauth.txt +3 -3
  65. package/console/auth/oauth/callback/__next.auth.txt +3 -3
  66. package/console/auth/oauth/callback.html +1 -1
  67. package/console/auth/oauth/callback.txt +35 -34
  68. package/console/chat/__placeholder__/__placeholder__/__next._full.txt +30 -32
  69. package/console/chat/__placeholder__/__placeholder__/__next._head.txt +4 -4
  70. package/console/chat/__placeholder__/__placeholder__/__next._index.txt +13 -15
  71. package/console/chat/__placeholder__/__placeholder__/__next._tree.txt +2 -2
  72. package/console/chat/__placeholder__/__placeholder__/__next.chat.$d$org.$d$slug.__PAGE__.txt +3 -3
  73. package/console/chat/__placeholder__/__placeholder__/__next.chat.$d$org.$d$slug.txt +3 -3
  74. package/console/chat/__placeholder__/__placeholder__/__next.chat.$d$org.txt +3 -3
  75. package/console/chat/__placeholder__/__placeholder__/__next.chat.txt +3 -3
  76. package/console/chat/__placeholder__/__placeholder__.html +1 -1
  77. package/console/chat/__placeholder__/__placeholder__.txt +30 -32
  78. package/console/conversations/__next._full.txt +28 -27
  79. package/console/conversations/__next._head.txt +4 -4
  80. package/console/conversations/__next._index.txt +13 -15
  81. package/console/conversations/__next._tree.txt +2 -2
  82. package/console/conversations/__next.conversations.__PAGE__.txt +3 -3
  83. package/console/conversations/__next.conversations.txt +3 -3
  84. package/console/conversations/__placeholder__/__placeholder__/__next._full.txt +30 -32
  85. package/console/conversations/__placeholder__/__placeholder__/__next._head.txt +4 -4
  86. package/console/conversations/__placeholder__/__placeholder__/__next._index.txt +13 -15
  87. package/console/conversations/__placeholder__/__placeholder__/__next._tree.txt +2 -2
  88. package/console/conversations/__placeholder__/__placeholder__/__next.conversations.$d$channelId.$d$key.__PAGE__.txt +3 -3
  89. package/console/conversations/__placeholder__/__placeholder__/__next.conversations.$d$channelId.$d$key.txt +3 -3
  90. package/console/conversations/__placeholder__/__placeholder__/__next.conversations.$d$channelId.txt +3 -3
  91. package/console/conversations/__placeholder__/__placeholder__/__next.conversations.txt +3 -3
  92. package/console/conversations/__placeholder__/__placeholder__.html +1 -1
  93. package/console/conversations/__placeholder__/__placeholder__.txt +30 -32
  94. package/console/conversations.html +1 -1
  95. package/console/conversations.txt +28 -27
  96. package/console/dashboard/__next._full.txt +28 -27
  97. package/console/dashboard/__next._head.txt +4 -4
  98. package/console/dashboard/__next._index.txt +13 -15
  99. package/console/dashboard/__next._tree.txt +2 -2
  100. package/console/dashboard/__next.dashboard.__PAGE__.txt +3 -3
  101. package/console/dashboard/__next.dashboard.txt +3 -3
  102. package/console/dashboard.html +1 -1
  103. package/console/dashboard.txt +28 -27
  104. package/console/executions/__placeholder__/__next._full.txt +30 -29
  105. package/console/executions/__placeholder__/__next._head.txt +4 -4
  106. package/console/executions/__placeholder__/__next._index.txt +13 -15
  107. package/console/executions/__placeholder__/__next._tree.txt +2 -2
  108. package/console/executions/__placeholder__/__next.executions.$d$id.__PAGE__.txt +2 -2
  109. package/console/executions/__placeholder__/__next.executions.$d$id.txt +3 -3
  110. package/console/executions/__placeholder__/__next.executions.txt +3 -3
  111. package/console/executions/__placeholder__.html +1 -1
  112. package/console/executions/__placeholder__.txt +30 -29
  113. package/console/index.html +1 -1
  114. package/console/index.txt +24 -23
  115. package/console/invite/__placeholder__/__next._full.txt +31 -30
  116. package/console/invite/__placeholder__/__next._head.txt +4 -4
  117. package/console/invite/__placeholder__/__next._index.txt +13 -15
  118. package/console/invite/__placeholder__/__next._tree.txt +2 -2
  119. package/console/invite/__placeholder__/__next.invite.$d$token.__PAGE__.txt +3 -3
  120. package/console/invite/__placeholder__/__next.invite.$d$token.txt +3 -3
  121. package/console/invite/__placeholder__/__next.invite.txt +3 -3
  122. package/console/invite/__placeholder__.html +1 -1
  123. package/console/invite/__placeholder__.txt +31 -30
  124. package/console/library/__next._full.txt +29 -28
  125. package/console/library/__next._head.txt +4 -4
  126. package/console/library/__next._index.txt +13 -15
  127. package/console/library/__next._tree.txt +2 -2
  128. package/console/library/__next.library.__PAGE__.txt +3 -3
  129. package/console/library/__next.library.txt +5 -5
  130. package/console/library/agents/__next._full.txt +34 -33
  131. package/console/library/agents/__next._head.txt +4 -4
  132. package/console/library/agents/__next._index.txt +13 -15
  133. package/console/library/agents/__next._tree.txt +2 -2
  134. package/console/library/agents/__next.library.agents.__PAGE__.txt +3 -3
  135. package/console/library/agents/__next.library.agents.txt +3 -3
  136. package/console/library/agents/__next.library.txt +5 -5
  137. package/console/library/agents/__placeholder__/__placeholder__/__next._full.txt +34 -36
  138. package/console/library/agents/__placeholder__/__placeholder__/__next._head.txt +4 -4
  139. package/console/library/agents/__placeholder__/__placeholder__/__next._index.txt +13 -15
  140. package/console/library/agents/__placeholder__/__placeholder__/__next._tree.txt +2 -2
  141. package/console/library/agents/__placeholder__/__placeholder__/__next.library.agents.$d$org.$d$slug.__PAGE__.txt +3 -3
  142. package/console/library/agents/__placeholder__/__placeholder__/__next.library.agents.$d$org.$d$slug.txt +3 -3
  143. package/console/library/agents/__placeholder__/__placeholder__/__next.library.agents.$d$org.txt +3 -3
  144. package/console/library/agents/__placeholder__/__placeholder__/__next.library.agents.txt +3 -3
  145. package/console/library/agents/__placeholder__/__placeholder__/__next.library.txt +5 -5
  146. package/console/library/agents/__placeholder__/__placeholder__.html +1 -1
  147. package/console/library/agents/__placeholder__/__placeholder__.txt +34 -36
  148. package/console/library/agents/new/__next._full.txt +38 -37
  149. package/console/library/agents/new/__next._head.txt +4 -4
  150. package/console/library/agents/new/__next._index.txt +13 -15
  151. package/console/library/agents/new/__next._tree.txt +2 -2
  152. package/console/library/agents/new/__next.library.agents.new.__PAGE__.txt +4 -4
  153. package/console/library/agents/new/__next.library.agents.new.txt +3 -3
  154. package/console/library/agents/new/__next.library.agents.txt +3 -3
  155. package/console/library/agents/new/__next.library.txt +5 -5
  156. package/console/library/agents/new.html +1 -1
  157. package/console/library/agents/new.txt +38 -37
  158. package/console/library/agents.html +1 -1
  159. package/console/library/agents.txt +34 -33
  160. package/console/library/mcp-servers/__next._full.txt +34 -33
  161. package/console/library/mcp-servers/__next._head.txt +4 -4
  162. package/console/library/mcp-servers/__next._index.txt +13 -15
  163. package/console/library/mcp-servers/__next._tree.txt +2 -2
  164. package/console/library/mcp-servers/__next.library.mcp-servers.__PAGE__.txt +3 -3
  165. package/console/library/mcp-servers/__next.library.mcp-servers.txt +3 -3
  166. package/console/library/mcp-servers/__next.library.txt +5 -5
  167. package/console/library/mcp-servers/__placeholder__/__placeholder__/__next._full.txt +34 -36
  168. package/console/library/mcp-servers/__placeholder__/__placeholder__/__next._head.txt +4 -4
  169. package/console/library/mcp-servers/__placeholder__/__placeholder__/__next._index.txt +13 -15
  170. package/console/library/mcp-servers/__placeholder__/__placeholder__/__next._tree.txt +2 -2
  171. package/console/library/mcp-servers/__placeholder__/__placeholder__/__next.library.mcp-servers.$d$org.$d$slug.__PAGE__.txt +3 -3
  172. package/console/library/mcp-servers/__placeholder__/__placeholder__/__next.library.mcp-servers.$d$org.$d$slug.txt +3 -3
  173. package/console/library/mcp-servers/__placeholder__/__placeholder__/__next.library.mcp-servers.$d$org.txt +3 -3
  174. package/console/library/mcp-servers/__placeholder__/__placeholder__/__next.library.mcp-servers.txt +3 -3
  175. package/console/library/mcp-servers/__placeholder__/__placeholder__/__next.library.txt +5 -5
  176. package/console/library/mcp-servers/__placeholder__/__placeholder__.html +1 -1
  177. package/console/library/mcp-servers/__placeholder__/__placeholder__.txt +34 -36
  178. package/console/library/mcp-servers/new/__next._full.txt +38 -37
  179. package/console/library/mcp-servers/new/__next._head.txt +4 -4
  180. package/console/library/mcp-servers/new/__next._index.txt +13 -15
  181. package/console/library/mcp-servers/new/__next._tree.txt +2 -2
  182. package/console/library/mcp-servers/new/__next.library.mcp-servers.new.__PAGE__.txt +4 -4
  183. package/console/library/mcp-servers/new/__next.library.mcp-servers.new.txt +3 -3
  184. package/console/library/mcp-servers/new/__next.library.mcp-servers.txt +3 -3
  185. package/console/library/mcp-servers/new/__next.library.txt +5 -5
  186. package/console/library/mcp-servers/new.html +1 -1
  187. package/console/library/mcp-servers/new.txt +38 -37
  188. package/console/library/mcp-servers.html +1 -1
  189. package/console/library/mcp-servers.txt +34 -33
  190. package/console/library/plugins/__next._full.txt +34 -33
  191. package/console/library/plugins/__next._head.txt +4 -4
  192. package/console/library/plugins/__next._index.txt +13 -15
  193. package/console/library/plugins/__next._tree.txt +2 -2
  194. package/console/library/plugins/__next.library.plugins.__PAGE__.txt +3 -3
  195. package/console/library/plugins/__next.library.plugins.txt +3 -3
  196. package/console/library/plugins/__next.library.txt +5 -5
  197. package/console/library/plugins/__placeholder__/__placeholder__/__next._full.txt +34 -36
  198. package/console/library/plugins/__placeholder__/__placeholder__/__next._head.txt +4 -4
  199. package/console/library/plugins/__placeholder__/__placeholder__/__next._index.txt +13 -15
  200. package/console/library/plugins/__placeholder__/__placeholder__/__next._tree.txt +2 -2
  201. package/console/library/plugins/__placeholder__/__placeholder__/__next.library.plugins.$d$org.$d$slug.__PAGE__.txt +3 -3
  202. package/console/library/plugins/__placeholder__/__placeholder__/__next.library.plugins.$d$org.$d$slug.txt +3 -3
  203. package/console/library/plugins/__placeholder__/__placeholder__/__next.library.plugins.$d$org.txt +3 -3
  204. package/console/library/plugins/__placeholder__/__placeholder__/__next.library.plugins.txt +3 -3
  205. package/console/library/plugins/__placeholder__/__placeholder__/__next.library.txt +5 -5
  206. package/console/library/plugins/__placeholder__/__placeholder__.html +1 -1
  207. package/console/library/plugins/__placeholder__/__placeholder__.txt +34 -36
  208. package/console/library/plugins/upload/__next._full.txt +38 -37
  209. package/console/library/plugins/upload/__next._head.txt +4 -4
  210. package/console/library/plugins/upload/__next._index.txt +13 -15
  211. package/console/library/plugins/upload/__next._tree.txt +2 -2
  212. package/console/library/plugins/upload/__next.library.plugins.txt +3 -3
  213. package/console/library/plugins/upload/__next.library.plugins.upload.__PAGE__.txt +4 -4
  214. package/console/library/plugins/upload/__next.library.plugins.upload.txt +3 -3
  215. package/console/library/plugins/upload/__next.library.txt +5 -5
  216. package/console/library/plugins/upload.html +1 -1
  217. package/console/library/plugins/upload.txt +38 -37
  218. package/console/library/plugins.html +1 -1
  219. package/console/library/plugins.txt +34 -33
  220. package/console/library/schedules/__next._full.txt +34 -33
  221. package/console/library/schedules/__next._head.txt +4 -4
  222. package/console/library/schedules/__next._index.txt +13 -15
  223. package/console/library/schedules/__next._tree.txt +2 -2
  224. package/console/library/schedules/__next.library.schedules.__PAGE__.txt +3 -3
  225. package/console/library/schedules/__next.library.schedules.txt +3 -3
  226. package/console/library/schedules/__next.library.txt +5 -5
  227. package/console/library/schedules/__placeholder__/__placeholder__/__next._full.txt +34 -36
  228. package/console/library/schedules/__placeholder__/__placeholder__/__next._head.txt +4 -4
  229. package/console/library/schedules/__placeholder__/__placeholder__/__next._index.txt +13 -15
  230. package/console/library/schedules/__placeholder__/__placeholder__/__next._tree.txt +2 -2
  231. package/console/library/schedules/__placeholder__/__placeholder__/__next.library.schedules.$d$org.$d$slug.__PAGE__.txt +3 -3
  232. package/console/library/schedules/__placeholder__/__placeholder__/__next.library.schedules.$d$org.$d$slug.txt +3 -3
  233. package/console/library/schedules/__placeholder__/__placeholder__/__next.library.schedules.$d$org.txt +3 -3
  234. package/console/library/schedules/__placeholder__/__placeholder__/__next.library.schedules.txt +3 -3
  235. package/console/library/schedules/__placeholder__/__placeholder__/__next.library.txt +5 -5
  236. package/console/library/schedules/__placeholder__/__placeholder__.html +1 -1
  237. package/console/library/schedules/__placeholder__/__placeholder__.txt +34 -36
  238. package/console/library/schedules/new/__next._full.txt +38 -37
  239. package/console/library/schedules/new/__next._head.txt +4 -4
  240. package/console/library/schedules/new/__next._index.txt +13 -15
  241. package/console/library/schedules/new/__next._tree.txt +2 -2
  242. package/console/library/schedules/new/__next.library.schedules.new.__PAGE__.txt +4 -4
  243. package/console/library/schedules/new/__next.library.schedules.new.txt +3 -3
  244. package/console/library/schedules/new/__next.library.schedules.txt +3 -3
  245. package/console/library/schedules/new/__next.library.txt +5 -5
  246. package/console/library/schedules/new.html +1 -1
  247. package/console/library/schedules/new.txt +38 -37
  248. package/console/library/schedules.html +1 -1
  249. package/console/library/schedules.txt +34 -33
  250. package/console/library/skills/__next._full.txt +34 -33
  251. package/console/library/skills/__next._head.txt +4 -4
  252. package/console/library/skills/__next._index.txt +13 -15
  253. package/console/library/skills/__next._tree.txt +2 -2
  254. package/console/library/skills/__next.library.skills.__PAGE__.txt +3 -3
  255. package/console/library/skills/__next.library.skills.txt +3 -3
  256. package/console/library/skills/__next.library.txt +5 -5
  257. package/console/library/skills/__placeholder__/__placeholder__/__next._full.txt +34 -36
  258. package/console/library/skills/__placeholder__/__placeholder__/__next._head.txt +4 -4
  259. package/console/library/skills/__placeholder__/__placeholder__/__next._index.txt +13 -15
  260. package/console/library/skills/__placeholder__/__placeholder__/__next._tree.txt +2 -2
  261. package/console/library/skills/__placeholder__/__placeholder__/__next.library.skills.$d$org.$d$slug.__PAGE__.txt +3 -3
  262. package/console/library/skills/__placeholder__/__placeholder__/__next.library.skills.$d$org.$d$slug.txt +3 -3
  263. package/console/library/skills/__placeholder__/__placeholder__/__next.library.skills.$d$org.txt +3 -3
  264. package/console/library/skills/__placeholder__/__placeholder__/__next.library.skills.txt +3 -3
  265. package/console/library/skills/__placeholder__/__placeholder__/__next.library.txt +5 -5
  266. package/console/library/skills/__placeholder__/__placeholder__.html +1 -1
  267. package/console/library/skills/__placeholder__/__placeholder__.txt +34 -36
  268. package/console/library/skills/new/__next._full.txt +38 -37
  269. package/console/library/skills/new/__next._head.txt +4 -4
  270. package/console/library/skills/new/__next._index.txt +13 -15
  271. package/console/library/skills/new/__next._tree.txt +2 -2
  272. package/console/library/skills/new/__next.library.skills.new.__PAGE__.txt +4 -4
  273. package/console/library/skills/new/__next.library.skills.new.txt +3 -3
  274. package/console/library/skills/new/__next.library.skills.txt +3 -3
  275. package/console/library/skills/new/__next.library.txt +5 -5
  276. package/console/library/skills/new.html +1 -1
  277. package/console/library/skills/new.txt +38 -37
  278. package/console/library/skills.html +1 -1
  279. package/console/library/skills.txt +34 -33
  280. package/console/library/workflows/__next._full.txt +34 -33
  281. package/console/library/workflows/__next._head.txt +4 -4
  282. package/console/library/workflows/__next._index.txt +13 -15
  283. package/console/library/workflows/__next._tree.txt +2 -2
  284. package/console/library/workflows/__next.library.txt +5 -5
  285. package/console/library/workflows/__next.library.workflows.__PAGE__.txt +3 -3
  286. package/console/library/workflows/__next.library.workflows.txt +3 -3
  287. package/console/library/workflows/__placeholder__/__placeholder__/__next._full.txt +34 -36
  288. package/console/library/workflows/__placeholder__/__placeholder__/__next._head.txt +4 -4
  289. package/console/library/workflows/__placeholder__/__placeholder__/__next._index.txt +13 -15
  290. package/console/library/workflows/__placeholder__/__placeholder__/__next._tree.txt +2 -2
  291. package/console/library/workflows/__placeholder__/__placeholder__/__next.library.txt +5 -5
  292. package/console/library/workflows/__placeholder__/__placeholder__/__next.library.workflows.$d$org.$d$slug.__PAGE__.txt +3 -3
  293. package/console/library/workflows/__placeholder__/__placeholder__/__next.library.workflows.$d$org.$d$slug.txt +3 -3
  294. package/console/library/workflows/__placeholder__/__placeholder__/__next.library.workflows.$d$org.txt +3 -3
  295. package/console/library/workflows/__placeholder__/__placeholder__/__next.library.workflows.txt +3 -3
  296. package/console/library/workflows/__placeholder__/__placeholder__.html +1 -1
  297. package/console/library/workflows/__placeholder__/__placeholder__.txt +34 -36
  298. package/console/library/workflows/executions/__next._full.txt +35 -34
  299. package/console/library/workflows/executions/__next._head.txt +4 -4
  300. package/console/library/workflows/executions/__next._index.txt +13 -15
  301. package/console/library/workflows/executions/__next._tree.txt +2 -2
  302. package/console/library/workflows/executions/__next.library.txt +5 -5
  303. package/console/library/workflows/executions/__next.library.workflows.executions.__PAGE__.txt +3 -3
  304. package/console/library/workflows/executions/__next.library.workflows.executions.txt +3 -3
  305. package/console/library/workflows/executions/__next.library.workflows.txt +3 -3
  306. package/console/library/workflows/executions.html +1 -1
  307. package/console/library/workflows/executions.txt +35 -34
  308. package/console/library/workflows/new/__next._full.txt +38 -37
  309. package/console/library/workflows/new/__next._head.txt +4 -4
  310. package/console/library/workflows/new/__next._index.txt +13 -15
  311. package/console/library/workflows/new/__next._tree.txt +2 -2
  312. package/console/library/workflows/new/__next.library.txt +5 -5
  313. package/console/library/workflows/new/__next.library.workflows.new.__PAGE__.txt +4 -4
  314. package/console/library/workflows/new/__next.library.workflows.new.txt +3 -3
  315. package/console/library/workflows/new/__next.library.workflows.txt +3 -3
  316. package/console/library/workflows/new.html +1 -1
  317. package/console/library/workflows/new.txt +38 -37
  318. package/console/library/workflows.html +1 -1
  319. package/console/library/workflows.txt +34 -33
  320. package/console/library.html +1 -1
  321. package/console/library.txt +29 -28
  322. package/console/login/__next._full.txt +31 -30
  323. package/console/login/__next._head.txt +4 -4
  324. package/console/login/__next._index.txt +13 -15
  325. package/console/login/__next._tree.txt +2 -2
  326. package/console/login/__next.login.__PAGE__.txt +4 -4
  327. package/console/login/__next.login.txt +3 -3
  328. package/console/login.html +1 -1
  329. package/console/login.txt +31 -30
  330. package/console/marketplace/__next._full.txt +28 -27
  331. package/console/marketplace/__next._head.txt +4 -4
  332. package/console/marketplace/__next._index.txt +13 -15
  333. package/console/marketplace/__next._tree.txt +2 -2
  334. package/console/marketplace/__next.marketplace.__PAGE__.txt +3 -3
  335. package/console/marketplace/__next.marketplace.txt +3 -3
  336. package/console/marketplace.html +1 -1
  337. package/console/marketplace.txt +28 -27
  338. package/console/oauth/slack/callback/__next._full.txt +35 -34
  339. package/console/oauth/slack/callback/__next._head.txt +4 -4
  340. package/console/oauth/slack/callback/__next._index.txt +13 -15
  341. package/console/oauth/slack/callback/__next._tree.txt +2 -2
  342. package/console/oauth/slack/callback/__next.oauth.slack.callback.__PAGE__.txt +4 -4
  343. package/console/oauth/slack/callback/__next.oauth.slack.callback.txt +3 -3
  344. package/console/oauth/slack/callback/__next.oauth.slack.txt +3 -3
  345. package/console/oauth/slack/callback/__next.oauth.txt +3 -3
  346. package/console/oauth/slack/callback.html +1 -1
  347. package/console/oauth/slack/callback.txt +35 -34
  348. package/console/sessions/__placeholder__/__next._full.txt +30 -29
  349. package/console/sessions/__placeholder__/__next._head.txt +4 -4
  350. package/console/sessions/__placeholder__/__next._index.txt +13 -15
  351. package/console/sessions/__placeholder__/__next._tree.txt +2 -2
  352. package/console/sessions/__placeholder__/__next.sessions.$d$id.__PAGE__.txt +2 -2
  353. package/console/sessions/__placeholder__/__next.sessions.$d$id.txt +3 -3
  354. package/console/sessions/__placeholder__/__next.sessions.txt +3 -3
  355. package/console/sessions/__placeholder__.html +1 -1
  356. package/console/sessions/__placeholder__.txt +30 -29
  357. package/console/settings/__next._full.txt +31 -30
  358. package/console/settings/__next._head.txt +4 -4
  359. package/console/settings/__next._index.txt +13 -15
  360. package/console/settings/__next._tree.txt +2 -2
  361. package/console/settings/__next.settings.__PAGE__.txt +4 -4
  362. package/console/settings/__next.settings.txt +5 -5
  363. package/console/settings/account-preferences/__next._full.txt +33 -32
  364. package/console/settings/account-preferences/__next._head.txt +4 -4
  365. package/console/settings/account-preferences/__next._index.txt +13 -15
  366. package/console/settings/account-preferences/__next._tree.txt +2 -2
  367. package/console/settings/account-preferences/__next.settings.account-preferences.__PAGE__.txt +3 -3
  368. package/console/settings/account-preferences/__next.settings.account-preferences.txt +3 -3
  369. package/console/settings/account-preferences/__next.settings.txt +5 -5
  370. package/console/settings/account-preferences.html +1 -1
  371. package/console/settings/account-preferences.txt +33 -32
  372. package/console/settings/api-keys/__next._full.txt +33 -32
  373. package/console/settings/api-keys/__next._head.txt +4 -4
  374. package/console/settings/api-keys/__next._index.txt +13 -15
  375. package/console/settings/api-keys/__next._tree.txt +2 -2
  376. package/console/settings/api-keys/__next.settings.api-keys.__PAGE__.txt +3 -3
  377. package/console/settings/api-keys/__next.settings.api-keys.txt +3 -3
  378. package/console/settings/api-keys/__next.settings.txt +5 -5
  379. package/console/settings/api-keys.html +1 -1
  380. package/console/settings/api-keys.txt +33 -32
  381. package/console/settings/billing/__next._full.txt +36 -35
  382. package/console/settings/billing/__next._head.txt +4 -4
  383. package/console/settings/billing/__next._index.txt +13 -15
  384. package/console/settings/billing/__next._tree.txt +2 -2
  385. package/console/settings/billing/__next.settings.billing.__PAGE__.txt +4 -4
  386. package/console/settings/billing/__next.settings.billing.txt +3 -3
  387. package/console/settings/billing/__next.settings.txt +5 -5
  388. package/console/settings/billing.html +1 -1
  389. package/console/settings/billing.txt +36 -35
  390. package/console/settings/channel-apps/__next._full.txt +33 -32
  391. package/console/settings/channel-apps/__next._head.txt +4 -4
  392. package/console/settings/channel-apps/__next._index.txt +13 -15
  393. package/console/settings/channel-apps/__next._tree.txt +2 -2
  394. package/console/settings/channel-apps/__next.settings.channel-apps.__PAGE__.txt +3 -3
  395. package/console/settings/channel-apps/__next.settings.channel-apps.txt +3 -3
  396. package/console/settings/channel-apps/__next.settings.txt +5 -5
  397. package/console/settings/channel-apps.html +1 -1
  398. package/console/settings/channel-apps.txt +33 -32
  399. package/console/settings/cursor-accounts/__next._full.txt +36 -35
  400. package/console/settings/cursor-accounts/__next._head.txt +4 -4
  401. package/console/settings/cursor-accounts/__next._index.txt +13 -15
  402. package/console/settings/cursor-accounts/__next._tree.txt +2 -2
  403. package/console/settings/cursor-accounts/__next.settings.cursor-accounts.__PAGE__.txt +4 -4
  404. package/console/settings/cursor-accounts/__next.settings.cursor-accounts.txt +3 -3
  405. package/console/settings/cursor-accounts/__next.settings.txt +5 -5
  406. package/console/settings/cursor-accounts.html +1 -1
  407. package/console/settings/cursor-accounts.txt +36 -35
  408. package/console/settings/environments/__next._full.txt +33 -32
  409. package/console/settings/environments/__next._head.txt +4 -4
  410. package/console/settings/environments/__next._index.txt +13 -15
  411. package/console/settings/environments/__next._tree.txt +2 -2
  412. package/console/settings/environments/__next.settings.environments.__PAGE__.txt +3 -3
  413. package/console/settings/environments/__next.settings.environments.txt +3 -3
  414. package/console/settings/environments/__next.settings.txt +5 -5
  415. package/console/settings/environments.html +1 -1
  416. package/console/settings/environments.txt +33 -32
  417. package/console/settings/identity-providers/__next._full.txt +33 -32
  418. package/console/settings/identity-providers/__next._head.txt +4 -4
  419. package/console/settings/identity-providers/__next._index.txt +13 -15
  420. package/console/settings/identity-providers/__next._tree.txt +2 -2
  421. package/console/settings/identity-providers/__next.settings.identity-providers.__PAGE__.txt +3 -3
  422. package/console/settings/identity-providers/__next.settings.identity-providers.txt +3 -3
  423. package/console/settings/identity-providers/__next.settings.txt +5 -5
  424. package/console/settings/identity-providers.html +1 -1
  425. package/console/settings/identity-providers.txt +33 -32
  426. package/console/settings/invitations/__next._full.txt +33 -32
  427. package/console/settings/invitations/__next._head.txt +4 -4
  428. package/console/settings/invitations/__next._index.txt +13 -15
  429. package/console/settings/invitations/__next._tree.txt +2 -2
  430. package/console/settings/invitations/__next.settings.invitations.__PAGE__.txt +3 -3
  431. package/console/settings/invitations/__next.settings.invitations.txt +3 -3
  432. package/console/settings/invitations/__next.settings.txt +5 -5
  433. package/console/settings/invitations.html +1 -1
  434. package/console/settings/invitations.txt +33 -32
  435. package/console/settings/members/__next._full.txt +33 -32
  436. package/console/settings/members/__next._head.txt +4 -4
  437. package/console/settings/members/__next._index.txt +13 -15
  438. package/console/settings/members/__next._tree.txt +2 -2
  439. package/console/settings/members/__next.settings.members.__PAGE__.txt +3 -3
  440. package/console/settings/members/__next.settings.members.txt +3 -3
  441. package/console/settings/members/__next.settings.txt +5 -5
  442. package/console/settings/members.html +1 -1
  443. package/console/settings/members.txt +33 -32
  444. package/console/settings/memory/__next._full.txt +33 -32
  445. package/console/settings/memory/__next._head.txt +4 -4
  446. package/console/settings/memory/__next._index.txt +13 -15
  447. package/console/settings/memory/__next._tree.txt +2 -2
  448. package/console/settings/memory/__next.settings.memory.__PAGE__.txt +3 -3
  449. package/console/settings/memory/__next.settings.memory.txt +3 -3
  450. package/console/settings/memory/__next.settings.txt +5 -5
  451. package/console/settings/memory.html +1 -1
  452. package/console/settings/memory.txt +33 -32
  453. package/console/settings/oauth-apps/__next._full.txt +33 -32
  454. package/console/settings/oauth-apps/__next._head.txt +4 -4
  455. package/console/settings/oauth-apps/__next._index.txt +13 -15
  456. package/console/settings/oauth-apps/__next._tree.txt +2 -2
  457. package/console/settings/oauth-apps/__next.settings.oauth-apps.__PAGE__.txt +3 -3
  458. package/console/settings/oauth-apps/__next.settings.oauth-apps.txt +3 -3
  459. package/console/settings/oauth-apps/__next.settings.txt +5 -5
  460. package/console/settings/oauth-apps.html +1 -1
  461. package/console/settings/oauth-apps.txt +33 -32
  462. package/console/settings/org-preferences/__next._full.txt +33 -32
  463. package/console/settings/org-preferences/__next._head.txt +4 -4
  464. package/console/settings/org-preferences/__next._index.txt +13 -15
  465. package/console/settings/org-preferences/__next._tree.txt +2 -2
  466. package/console/settings/org-preferences/__next.settings.org-preferences.__PAGE__.txt +3 -3
  467. package/console/settings/org-preferences/__next.settings.org-preferences.txt +3 -3
  468. package/console/settings/org-preferences/__next.settings.txt +5 -5
  469. package/console/settings/org-preferences.html +1 -1
  470. package/console/settings/org-preferences.txt +33 -32
  471. package/console/settings/org-profile/__next._full.txt +33 -32
  472. package/console/settings/org-profile/__next._head.txt +4 -4
  473. package/console/settings/org-profile/__next._index.txt +13 -15
  474. package/console/settings/org-profile/__next._tree.txt +2 -2
  475. package/console/settings/org-profile/__next.settings.org-profile.__PAGE__.txt +3 -3
  476. package/console/settings/org-profile/__next.settings.org-profile.txt +3 -3
  477. package/console/settings/org-profile/__next.settings.txt +5 -5
  478. package/console/settings/org-profile.html +1 -1
  479. package/console/settings/org-profile.txt +33 -32
  480. package/console/settings/platform-clients/__next._full.txt +33 -32
  481. package/console/settings/platform-clients/__next._head.txt +4 -4
  482. package/console/settings/platform-clients/__next._index.txt +13 -15
  483. package/console/settings/platform-clients/__next._tree.txt +2 -2
  484. package/console/settings/platform-clients/__next.settings.platform-clients.__PAGE__.txt +3 -3
  485. package/console/settings/platform-clients/__next.settings.platform-clients.txt +3 -3
  486. package/console/settings/platform-clients/__next.settings.txt +5 -5
  487. package/console/settings/platform-clients.html +1 -1
  488. package/console/settings/platform-clients.txt +33 -32
  489. package/console/settings/pricing-governance/__next._full.txt +36 -35
  490. package/console/settings/pricing-governance/__next._head.txt +4 -4
  491. package/console/settings/pricing-governance/__next._index.txt +13 -15
  492. package/console/settings/pricing-governance/__next._tree.txt +2 -2
  493. package/console/settings/pricing-governance/__next.settings.pricing-governance.__PAGE__.txt +4 -4
  494. package/console/settings/pricing-governance/__next.settings.pricing-governance.txt +3 -3
  495. package/console/settings/pricing-governance/__next.settings.txt +5 -5
  496. package/console/settings/pricing-governance.html +1 -1
  497. package/console/settings/pricing-governance.txt +36 -35
  498. package/console/settings/provider-standing/__next._full.txt +36 -35
  499. package/console/settings/provider-standing/__next._head.txt +4 -4
  500. package/console/settings/provider-standing/__next._index.txt +13 -15
  501. package/console/settings/provider-standing/__next._tree.txt +2 -2
  502. package/console/settings/provider-standing/__next.settings.provider-standing.__PAGE__.txt +4 -4
  503. package/console/settings/provider-standing/__next.settings.provider-standing.txt +3 -3
  504. package/console/settings/provider-standing/__next.settings.txt +5 -5
  505. package/console/settings/provider-standing.html +1 -1
  506. package/console/settings/provider-standing.txt +36 -35
  507. package/console/settings/usage/__next._full.txt +33 -32
  508. package/console/settings/usage/__next._head.txt +4 -4
  509. package/console/settings/usage/__next._index.txt +13 -15
  510. package/console/settings/usage/__next._tree.txt +2 -2
  511. package/console/settings/usage/__next.settings.txt +5 -5
  512. package/console/settings/usage/__next.settings.usage.__PAGE__.txt +3 -3
  513. package/console/settings/usage/__next.settings.usage.txt +3 -3
  514. package/console/settings/usage.html +1 -1
  515. package/console/settings/usage.txt +33 -32
  516. package/console/settings.html +1 -1
  517. package/console/settings.txt +31 -30
  518. package/console/workflows/__next._full.txt +28 -27
  519. package/console/workflows/__next._head.txt +4 -4
  520. package/console/workflows/__next._index.txt +13 -15
  521. package/console/workflows/__next._tree.txt +2 -2
  522. package/console/workflows/__next.workflows.__PAGE__.txt +2 -2
  523. package/console/workflows/__next.workflows.txt +3 -3
  524. package/console/workflows/__placeholder__/__placeholder__/__next._full.txt +30 -32
  525. package/console/workflows/__placeholder__/__placeholder__/__next._head.txt +4 -4
  526. package/console/workflows/__placeholder__/__placeholder__/__next._index.txt +13 -15
  527. package/console/workflows/__placeholder__/__placeholder__/__next._tree.txt +2 -2
  528. package/console/workflows/__placeholder__/__placeholder__/__next.workflows.$d$org.$d$slug.__PAGE__.txt +3 -3
  529. package/console/workflows/__placeholder__/__placeholder__/__next.workflows.$d$org.$d$slug.txt +3 -3
  530. package/console/workflows/__placeholder__/__placeholder__/__next.workflows.$d$org.txt +3 -3
  531. package/console/workflows/__placeholder__/__placeholder__/__next.workflows.txt +3 -3
  532. package/console/workflows/__placeholder__/__placeholder__.html +1 -1
  533. package/console/workflows/__placeholder__/__placeholder__.txt +30 -32
  534. package/console/workflows/executions/__next._full.txt +31 -30
  535. package/console/workflows/executions/__next._head.txt +4 -4
  536. package/console/workflows/executions/__next._index.txt +13 -15
  537. package/console/workflows/executions/__next._tree.txt +2 -2
  538. package/console/workflows/executions/__next.workflows.executions.__PAGE__.txt +2 -2
  539. package/console/workflows/executions/__next.workflows.executions.txt +3 -3
  540. package/console/workflows/executions/__next.workflows.txt +3 -3
  541. package/console/workflows/executions/__placeholder__/__next._full.txt +30 -31
  542. package/console/workflows/executions/__placeholder__/__next._head.txt +4 -4
  543. package/console/workflows/executions/__placeholder__/__next._index.txt +13 -15
  544. package/console/workflows/executions/__placeholder__/__next._tree.txt +2 -2
  545. package/console/workflows/executions/__placeholder__/__next.workflows.executions.$d$id.__PAGE__.txt +3 -3
  546. package/console/workflows/executions/__placeholder__/__next.workflows.executions.$d$id.txt +3 -3
  547. package/console/workflows/executions/__placeholder__/__next.workflows.executions.txt +3 -3
  548. package/console/workflows/executions/__placeholder__/__next.workflows.txt +3 -3
  549. package/console/workflows/executions/__placeholder__.html +1 -1
  550. package/console/workflows/executions/__placeholder__.txt +30 -31
  551. package/console/workflows/executions.html +1 -1
  552. package/console/workflows/executions.txt +31 -30
  553. package/console/workflows.html +1 -1
  554. package/console/workflows.txt +28 -27
  555. package/main.js +21 -21
  556. package/package.json +6 -6
  557. package/console/_next/static/chunks/0-3vl848v~x7_.js +0 -1
  558. package/console/_next/static/chunks/0.ocu5b3uajbn.js +0 -1
  559. package/console/_next/static/chunks/00609po93aecc.js +0 -1
  560. package/console/_next/static/chunks/00o8ud2dmna2j.js +0 -1
  561. package/console/_next/static/chunks/02fsq8lsaeu8j.js +0 -1
  562. package/console/_next/static/chunks/071fdr3kvata1.js +0 -1
  563. package/console/_next/static/chunks/0_3utrn1at0vi.js +0 -1
  564. package/console/_next/static/chunks/0_j8~rfb.1ufy.js +0 -1
  565. package/console/_next/static/chunks/0amugang-25bm.js +0 -1
  566. package/console/_next/static/chunks/0c7llz2igr3w7.js +0 -1
  567. package/console/_next/static/chunks/0dtrm.qvfku1r.js +0 -3
  568. package/console/_next/static/chunks/0e7jd8wufwnu2.js +0 -1
  569. package/console/_next/static/chunks/0fgcvnc-b_oz_.js +0 -1
  570. package/console/_next/static/chunks/0g4-6iy.9p8sl.js +0 -1
  571. package/console/_next/static/chunks/0gz8yljnjzsmu.js +0 -1
  572. package/console/_next/static/chunks/0j~6628v9z3k-.js +0 -1
  573. package/console/_next/static/chunks/0og40-yo-nth-.js +0 -1
  574. package/console/_next/static/chunks/0rob~86j~8vge.js +0 -1
  575. package/console/_next/static/chunks/0s6bm1sujua~8.css +0 -1
  576. package/console/_next/static/chunks/0xq42ojv80jqz.js +0 -1
  577. package/console/_next/static/chunks/0xs_3fux3hsk3.js +0 -2
  578. package/console/_next/static/chunks/12329wyw7127c.js +0 -1
  579. /package/console/_next/static/{0d4BawxHa-jMy4WgCDP1P → -SJovNiHfwazArKzyL7X6}/_buildManifest.js +0 -0
  580. /package/console/_next/static/{0d4BawxHa-jMy4WgCDP1P → -SJovNiHfwazArKzyL7X6}/_clientMiddlewareManifest.js +0 -0
  581. /package/console/_next/static/{0d4BawxHa-jMy4WgCDP1P → -SJovNiHfwazArKzyL7X6}/_ssgManifest.js +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stigmer/server-slim",
3
- "version": "3.18.0",
3
+ "version": "3.19.0",
4
4
  "description": "Self-contained build of the Stigmer TypeScript control plane, launched by the stigmer CLI's local stack",
5
5
  "license": "Apache-2.0",
6
6
  "engines": {
@@ -11,11 +11,11 @@
11
11
  "@grpc/grpc-js": "^1.14.4"
12
12
  },
13
13
  "optionalDependencies": {
14
- "@stigmer/server-slim-darwin-arm64": "3.18.0",
15
- "@stigmer/server-slim-darwin-x64": "3.18.0",
16
- "@stigmer/server-slim-linux-x64": "3.18.0",
17
- "@stigmer/server-slim-linux-arm64": "3.18.0",
18
- "@stigmer/server-slim-win32-x64": "3.18.0"
14
+ "@stigmer/server-slim-darwin-arm64": "3.19.0",
15
+ "@stigmer/server-slim-darwin-x64": "3.19.0",
16
+ "@stigmer/server-slim-linux-x64": "3.19.0",
17
+ "@stigmer/server-slim-linux-arm64": "3.19.0",
18
+ "@stigmer/server-slim-win32-x64": "3.19.0"
19
19
  },
20
20
  "repository": {
21
21
  "type": "git",
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,506213,e=>{"use strict";e.s([],593742),e.i(593742);var t,i=e.i(271645),n=e.i(66196),s=e.i(58509),r=e.i(933605),o=e.i(789633),a=e.i(926665),l=e.i(151665),c=e.i(206157);e.i(247167);var u=e.i(367805);let g=i.createContext(void 0);function d(e){let t=i.useContext(g);if(void 0===t&&!e)throw Error((0,u.default)(47));return t}var p=e.i(174080),b=e.i(598263),m=e.i(783921),v=e.i(566745),f=e.i(630628),h=e.i(294365),S=e.i(803404),x=e.i(600628),A=e.i(769375),y=e.i(607335);let k={...x.popupStoreSelectors,disabled:(0,m.createSelector)(e=>e.disabled),instantType:(0,m.createSelector)(e=>e.instantType),openMethod:(0,m.createSelector)(e=>e.openMethod),openChangeReason:(0,m.createSelector)(e=>e.openChangeReason),modal:(0,m.createSelector)(e=>e.modal),stickIfOpen:(0,m.createSelector)(e=>e.stickIfOpen),titleElementId:(0,m.createSelector)(e=>e.titleElementId),descriptionElementId:(0,m.createSelector)(e=>e.descriptionElementId),openOnHover:(0,m.createSelector)(e=>e.openOnHover),closeDelay:(0,m.createSelector)(e=>e.closeDelay),hasViewport:(0,m.createSelector)(e=>e.hasViewport)};class C extends b.ReactStore{constructor(e){const t={...(0,x.createInitialPopupStoreState)(),disabled:!1,modal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,nested:!1,openOnHover:!1,closeDelay:0,hasViewport:!1,...e};t.open&&e?.mounted===void 0&&(t.mounted=!0),super(t,{popupRef:i.createRef(),backdropRef:i.createRef(),internalBackdropRef:i.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:i.createRef(),beforeContentFocusGuardRef:i.createRef(),stickIfOpenTimeout:new v.Timeout,triggerElements:new A.PopupTriggerMap},k)}setOpen=(e,t)=>{let i=t.reason===S.REASONS.triggerHover,n=t.reason===S.REASONS.triggerPress&&0===t.event.detail,s=!e&&(t.reason===S.REASONS.escapeKey||null==t.reason);if(t.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},this.context.onOpenChange?.(e,t),t.isCanceled)return;let r={open:e,nativeEvent:t.event,reason:t.reason,nested:this.state.nested,triggerElement:t.trigger},o=this.state.floatingRootContext.context.events;o?.emit("openchange",r);let a=()=>{let i={open:e,openChangeReason:t.reason},n=t.trigger?.id??null;(n||e)&&(i.activeTriggerId=n,i.activeTriggerElement=t.trigger??null),this.update(i)};i?(this.set("stickIfOpen",!0),this.context.stickIfOpenTimeout.start(y.PATIENT_CLICK_THRESHOLD,()=>{this.set("stickIfOpen",!1)}),p.flushSync(a)):a(),n||s?this.set("instantType",n?"click":"dismiss"):t.reason===S.REASONS.focusOut?this.set("instantType","focus"):this.set("instantType",void 0)};static useStore(e,t){let i=(0,f.useRefWithInit)(()=>new C(t)).current,n=e??i;return(0,h.useOnMount)(i.disposeEffect),n}disposeEffect=()=>this.context.stickIfOpenTimeout.disposeEffect()}var I=e.i(5963),W=e.i(258642),R=e.i(450091),E=e.i(843476);function V({props:e}){let{children:t,open:u,defaultOpen:d=!1,onOpenChange:p,onOpenChangeComplete:b,modal:m=!1,handle:v,triggerId:f,defaultTriggerId:h=null}=e,x=C.useStore(v?.store,{modal:m,open:d,openProp:u,activeTriggerId:h,triggerIdProp:f});(0,s.useOnFirstRender)(()=>{void 0===u&&!1===x.state.open&&!0===d&&x.update({open:!0,activeTriggerId:h})}),x.useControlledProp("openProp",u),x.useControlledProp("triggerIdProp",f);let A=x.useState("open"),y=x.useState("positionerElement"),k=x.useState("payload"),Y=x.useState("openChangeReason");x.useContextCallback("onOpenChange",p),x.useContextCallback("onOpenChangeComplete",b);let{openMethod:G,triggerProps:N}=(0,R.useOpenInteractionType)(A);(0,W.useImplicitActiveTrigger)(x);let{forceUnmount:B}=(0,W.useOpenStateTransitions)(A,x,()=>{x.update({stickIfOpen:!0,openChangeReason:null})});(0,n.useScrollLock)(A&&!0===m&&Y!==S.REASONS.triggerHover&&"touch"!==G,y),i.useEffect(()=>{A||x.context.stickIfOpenTimeout.clear()},[x,A]);let j=i.useCallback(e=>{let t=(0,I.createChangeEventDetails)(e);return t.preventUnmountOnClose=()=>{x.set("preventUnmountingOnClose",!0)},t},[x]),w=i.useCallback(()=>{x.setOpen(!1,j(S.REASONS.imperativeAction))},[x,j]);i.useImperativeHandle(e.actionsRef,()=>({unmount:B,close:w}),[B,w]);let Z=(0,c.useSyncedFloatingRootContext)({popupStore:x,onOpenChange:x.setOpen}),L=(0,r.useDismiss)(Z,{outsidePressEvent:{mouse:"trap-focus"===m?"sloppy":"intentional",touch:"sloppy"}}),F=(0,a.useRole)(Z),{getReferenceProps:X,getFloatingProps:M,getTriggerProps:J}=(0,o.useInteractions)([L,F]),P=i.useMemo(()=>X(N),[X,N]),O=i.useMemo(()=>J(N),[J,N]),Q=i.useMemo(()=>M(),[M]);x.useSyncedValues({modal:m,openMethod:G,activeTriggerProps:P,inactiveTriggerProps:O,popupProps:Q,floatingRootContext:Z,nested:null!=(0,l.useFloatingParentNodeId)()});let _=i.useMemo(()=>({store:x}),[x]);return(0,E.jsx)(g.Provider,{value:_,children:"function"==typeof t?t({payload:k}):t})}var Y=e.i(676477),G=e.i(991730),N=e.i(383590),B=e.i(327601),j=e.i(437287),w=e.i(804012),Z=e.i(397254),L=e.i(189879),F=e.i(672408),X=e.i(247857),M=e.i(559266);let J=i.forwardRef(function(e,t){let{render:n,className:s,disabled:r=!1,nativeButton:a=!0,handle:l,payload:c,openOnHover:g=!1,delay:b=300,closeDelay:m=0,id:v,...f}=e,h=d(!0),x=l?.store??h?.store;if(!x)throw Error((0,u.default)(74));let A=(0,L.useBaseUiId)(v),k=x.useState("isTriggerActive",A),C=x.useState("floatingRootContext"),R=x.useState("isOpenedByTrigger",A),V=i.useRef(null),{registerTrigger:J,isMountedByThisTrigger:P}=(0,W.useTriggerDataForwarding)(A,V,x,{payload:c,disabled:r,openOnHover:g,closeDelay:m}),O=x.useState("openChangeReason"),Q=x.useState("stickIfOpen"),_=x.useState("openMethod"),z=(0,Z.useHoverReferenceInteraction)(C,{enabled:null!=C&&g&&("touch"!==_||O!==S.REASONS.triggerPress),mouseOnly:!0,move:!1,handleClose:(0,j.safePolygon)(),restMs:b,delay:{close:m},triggerElementRef:V,isActiveTrigger:k}),D=(0,w.useClick)(C,{enabled:null!=C,stickIfOpen:Q}),T=(0,o.useInteractions)([D]),K=x.useState("triggerProps",P),{getButtonProps:H,buttonRef:U}=(0,G.useButton)({disabled:r,native:a}),$=i.useMemo(()=>({open:e=>e&&O===S.REASONS.triggerPress?N.pressableTriggerOpenStateMapping.open(e):N.triggerOpenStateMapping.open(e)}),[O]),q=(0,B.useRenderElement)("button",e,{state:{disabled:r,open:R},ref:[U,t,J,V],props:[T.getReferenceProps(),z,K,{[y.CLICK_TRIGGER_IDENTIFIER]:"",id:A},f,H],stateAttributesMapping:$}),ee=i.useRef(null),et=(0,Y.useStableCallback)(e=>{p.flushSync(()=>{x.setOpen(!1,(0,I.createChangeEventDetails)(S.REASONS.focusOut,e.nativeEvent,e.currentTarget))});let t=(0,M.getTabbableBeforeElement)(ee.current);t?.focus()}),ei=(0,Y.useStableCallback)(e=>{let t=x.select("positionerElement");if(t&&(0,M.isOutsideEvent)(e,t))x.context.beforeContentFocusGuardRef.current?.focus();else{p.flushSync(()=>{x.setOpen(!1,(0,I.createChangeEventDetails)(S.REASONS.focusOut,e.nativeEvent,e.currentTarget))});let i=(0,M.getTabbableAfterElement)(x.context.triggerFocusTargetRef.current||V.current);for(;null!==i&&(0,X.contains)(t,i);){let e=i;if((i=(0,M.getNextTabbable)(i))===e)break}i?.focus()}});return k?(0,E.jsxs)(i.Fragment,{children:[(0,E.jsx)(F.FocusGuard,{ref:ee,onFocus:et}),(0,E.jsx)(i.Fragment,{children:q},A),(0,E.jsx)(F.FocusGuard,{ref:x.context.triggerFocusTargetRef,onFocus:ei})]}):(0,E.jsx)(i.Fragment,{children:q},A)});var P=e.i(937692);let O=i.createContext(void 0),Q=i.forwardRef(function(e,t){let{keepMounted:i=!1,...n}=e,{store:s}=d();return s.useState("mounted")||i?(0,E.jsx)(O.Provider,{value:i,children:(0,E.jsx)(P.FloatingPortal,{ref:t,...n})}):null});var _=e.i(658130),z=e.i(500977);let D=i.createContext(void 0);function T(){let e=i.useContext(D);if(!e)throw Error((0,u.default)(46));return e}var K=e.i(56590),H=e.i(536893),U=e.i(177817),$=e.i(767569),q=e.i(418847);let ee=i.forwardRef(function(e,t){let{render:n,className:s,anchor:r,positionMethod:o="absolute",side:a="bottom",align:c="center",sideOffset:g=0,alignOffset:p=0,collisionBoundary:b="clipping-ancestors",collisionPadding:m=5,arrowPadding:v=5,sticky:f=!1,disableAnchorTracking:h=!1,collisionAvoidance:x=y.POPUP_COLLISION_AVOIDANCE,...A}=e,{store:k}=d(),C=function(){let e=i.useContext(O);if(void 0===e)throw Error((0,u.default)(45));return e}(),I=(0,l.useFloatingNodeId)(),W=k.useState("floatingRootContext"),R=k.useState("mounted"),V=k.useState("open"),Y=k.useState("openChangeReason"),G=k.useState("activeTriggerElement"),j=k.useState("modal"),w=k.useState("positionerElement"),Z=k.useState("instantType"),L=k.useState("transitionStatus"),F=k.useState("hasViewport"),X=i.useRef(null),M=(0,U.useAnimationsFinished)(w,!1,!1),J=(0,K.useAnchorPositioning)({anchor:r,floatingRootContext:W,positionMethod:o,mounted:R,side:a,sideOffset:g,align:c,alignOffset:p,arrowPadding:v,collisionBoundary:b,collisionPadding:m,sticky:f,disableAnchorTracking:h,keepMounted:C,nodeId:I,collisionAvoidance:x,adaptiveOrigin:F?$.adaptiveOrigin:void 0}),P=i.useMemo(()=>{let e={};return V||(e.pointerEvents="none"),{role:"presentation",hidden:!R,style:{...J.positionerStyles,...e}}},[V,R,J.positionerStyles]),Q=i.useMemo(()=>({props:P,...J}),[P,J]),T=W.useState("domReferenceElement");(0,z.useIsoLayoutEffect)(()=>{let e=X.current;if(T&&(X.current=T),e&&T&&T!==e){k.set("instantType",void 0);let e=new AbortController;return M(()=>{k.set("instantType","trigger-change")},e.signal),()=>{e.abort()}}},[T,M,k]);let ee={open:V,side:Q.side,align:Q.align,anchorHidden:Q.anchorHidden,instant:Z},et=i.useCallback(e=>{k.set("positionerElement",e)},[k]),ei=(0,B.useRenderElement)("div",e,{state:ee,props:[Q.props,(0,q.getDisabledMountTransitionStyles)(L),A],ref:[t,et],stateAttributesMapping:N.popupStateMapping});return(0,E.jsxs)(D.Provider,{value:Q,children:[R&&!0===j&&Y!==S.REASONS.triggerHover&&(0,E.jsx)(H.InternalBackdrop,{ref:k.context.internalBackdropRef,inert:(0,_.inertValue)(!V),cutout:G}),(0,E.jsx)(l.FloatingNode,{id:I,children:ei})]})});var et=e.i(229315),ei=e.i(488306),en=e.i(761896),es=e.i(284759),er=e.i(889269),eo=e.i(992238),ea=e.i(560752);let el=i.createContext(void 0);function ec(e){let{value:t,children:i}=e;return(0,E.jsx)(el.Provider,{value:t,children:i})}let eu={...N.popupStateMapping,...es.transitionStatusMapping},eg=i.forwardRef(function(e,t){let{className:n,render:s,initialFocus:r,finalFocus:o,...a}=e,{store:l}=d(),c=T(),u=null!=(0,ea.useToolbarRootContext)(!0),{context:g,hasClosePart:p}=function(){let[e,t]=i.useState(0),n=(0,Y.useStableCallback)(()=>(t(e=>e+1),()=>{t(e=>Math.max(0,e-1))}));return{context:i.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}(),b=l.useState("open"),m=l.useState("openMethod"),v=l.useState("instantType"),f=l.useState("transitionStatus"),h=l.useState("popupProps"),x=l.useState("titleElementId"),A=l.useState("descriptionElementId"),y=l.useState("modal"),k=l.useState("mounted"),C=l.useState("openChangeReason"),I=l.useState("activeTriggerElement"),W=l.useState("floatingRootContext");(0,er.useOpenChangeComplete)({open:b,ref:l.context.popupRef,onComplete(){b&&l.context.onOpenChangeComplete?.(!0)}});let R=l.useState("disabled"),V=l.useState("openOnHover"),G=l.useState("closeDelay");(0,en.useHoverFloatingInteraction)(W,{enabled:V&&!R,closeDelay:G});let N=void 0===r?function(e){return"touch"!==e||l.context.popupRef.current}:r,j={open:b,side:c.side,align:c.align,instant:v,transitionStatus:f},w=i.useCallback(e=>{l.set("popupElement",e)},[l]),Z=(0,B.useRenderElement)("div",e,{state:j,ref:[t,l.context.popupRef,w],props:[h,{"aria-labelledby":x,"aria-describedby":A,onKeyDown(e){u&&eo.COMPOSITE_KEYS.has(e.key)&&e.stopPropagation()}},(0,q.getDisabledMountTransitionStyles)(f),a],stateAttributesMapping:eu});return(0,E.jsx)(ei.FloatingFocusManager,{context:W,openInteractionType:m,modal:!1!==y&&p,disabled:!k||C===S.REASONS.triggerHover,initialFocus:N,returnFocus:o,restoreFocus:"popup",previousFocusableElement:(0,et.isHTMLElement)(I)?I:void 0,nextFocusableElement:l.context.triggerFocusTargetRef,beforeContentFocusGuardRef:l.context.beforeContentFocusGuardRef,children:(0,E.jsx)(ec,{value:g,children:Z})})}),ed=i.forwardRef(function(e,t){let{className:i,render:n,...s}=e,{store:r}=d(),o=r.useState("open"),{arrowRef:a,side:l,align:c,arrowUncentered:u,arrowStyles:g}=T();return(0,B.useRenderElement)("div",e,{state:{open:o,side:l,align:c,uncentered:u},ref:[t,a],props:[{style:g,"aria-hidden":!0},s],stateAttributesMapping:N.popupStateMapping})}),ep={...N.popupStateMapping,...es.transitionStatusMapping},eb=i.forwardRef(function(e,t){let{className:i,render:n,...s}=e,{store:r}=d(),o=r.useState("open"),a=r.useState("mounted"),l=r.useState("transitionStatus"),c=r.useState("openChangeReason");return(0,B.useRenderElement)("div",e,{state:{open:o,transitionStatus:l},ref:[r.context.backdropRef,t],props:[{role:"presentation",hidden:!a,style:{pointerEvents:c===S.REASONS.triggerHover?"none":void 0,userSelect:"none",WebkitUserSelect:"none"}},s],stateAttributesMapping:ep})}),em=i.forwardRef(function(e,t){let{render:i,className:n,...s}=e,{store:r}=d(),o=(0,L.useBaseUiId)(s.id);return(0,z.useIsoLayoutEffect)(()=>(r.set("titleElementId",o),()=>{r.set("titleElementId",void 0)}),[r,o]),(0,B.useRenderElement)("h2",e,{ref:t,props:[{id:o},s]})}),ev=i.forwardRef(function(e,t){let{render:i,className:n,...s}=e,{store:r}=d(),o=(0,L.useBaseUiId)(s.id);return(0,z.useIsoLayoutEffect)(()=>(r.set("descriptionElementId",o),()=>{r.set("descriptionElementId",void 0)}),[r,o]),(0,B.useRenderElement)("p",e,{ref:t,props:[{id:o},s]})}),ef=i.forwardRef(function(e,t){let n,{render:s,className:r,disabled:o=!1,nativeButton:a=!0,...l}=e,{buttonRef:c,getButtonProps:u}=(0,G.useButton)({disabled:o,focusableWhenDisabled:!1,native:a}),{store:g}=d();return n=i.useContext(el),(0,z.useIsoLayoutEffect)(()=>n?.register(),[n]),(0,B.useRenderElement)("button",e,{ref:[t,c],props:[{onClick(e){g.setOpen(!1,(0,I.createChangeEventDetails)(S.REASONS.closePress,e.nativeEvent,e.currentTarget))}},l,u]})}),eh=((t={}).popupWidth="--popup-width",t.popupHeight="--popup-height",t);var eS=e.i(712666);let ex={activationDirection:e=>e?{"data-activation-direction":e}:null},eA=i.forwardRef(function(e,t){let{render:i,className:n,children:s,...r}=e,{store:o}=d(),{side:a}=T(),l=o.useState("instantType"),{children:c,state:u}=(0,eS.usePopupViewport)({store:o,side:a,cssVars:eh,children:s}),g={activationDirection:u.activationDirection,transitioning:u.transitioning,instant:l};return(0,B.useRenderElement)("div",e,{state:g,ref:t,props:[r,{children:c}],stateAttributesMapping:ex})});class ey{constructor(){this.store=new C}open(e){let t=e?this.store.context.triggerElements.getById(e)??void 0:void 0;if(e&&!t)throw Error((0,u.default)(80,e));this.store.setOpen(!0,(0,I.createChangeEventDetails)(S.REASONS.imperativeAction,void 0,t))}close(){this.store.setOpen(!1,(0,I.createChangeEventDetails)(S.REASONS.imperativeAction,void 0,void 0))}get isOpen(){return this.store.state.open}}e.s(["Arrow",0,ed,"Backdrop",0,eb,"Close",0,ef,"Description",0,ev,"Handle",0,ey,"Popup",0,eg,"Portal",0,Q,"Positioner",0,ee,"Root",0,function(e){return d(!0)?(0,E.jsx)(V,{props:e}):(0,E.jsx)(l.FloatingTree,{children:(0,E.jsx)(V,{props:e})})},"Title",0,em,"Trigger",0,J,"Viewport",0,eA,"createHandle",0,function(){return new ey}],307311);var ek=e.i(307311);e.s(["Popover",0,ek],506213)},267872,e=>{"use strict";var t,i;e.i(113024);let n=(0,e.i(424407).fileDesc)("CixhaS9zdGlnbWVyL2lhbS9pZGVudGl0eWFjY291bnQvdjEvZW51bS5wcm90bxIhYWkuc3RpZ21lci5pYW0uaWRlbnRpdHlhY2NvdW50LnYxKpIBCh9JZGVudGl0eUFjY291bnRQcm92aXNpb25pbmdNb2RlEjIKLmlkZW50aXR5X2FjY291bnRfcHJvdmlzaW9uaW5nX21vZGVfdW5zcGVjaWZpZWQQABIKCgZkaXJlY3QQARINCglmZWRlcmF0ZWQQAhILCgdtYWNoaW5lEAMSEwoPcGxhdGZvcm1fY2xpZW50EARiBnByb3RvMw");(i=t||(t={}))[i.identity_account_provisioning_mode_unspecified=0]="identity_account_provisioning_mode_unspecified",i[i.direct=1]="direct",i[i.federated=2]="federated",i[i.machine=3]="machine",i[i.platform_client=4]="platform_client",e.s(["file_ai_stigmer_iam_identityaccount_v1_enum",0,n])},452026,632897,626874,e=>{"use strict";var t=e.i(424407),i=e.i(304532),n=e.i(421415),s=e.i(988158),r=e.i(761867);let o=(0,t.fileDesc)("CiZhaS9zdGlnbWVyL2lhbS9pYW1wb2xpY3kvdjEvc3BlYy5wcm90bxIbYWkuc3RpZ21lci5pYW0uaWFtcG9saWN5LnYxIr4BCg1JYW1Qb2xpY3lTcGVjEkYKCXByaW5jaXBhbBgBIAEoCzIrLmFpLnN0aWdtZXIuaWFtLmlhbXBvbGljeS52MS5BcGlSZXNvdXJjZVJlZkIGukgDyAEBEkUKCHJlc291cmNlGAIgASgLMisuYWkuc3RpZ21lci5pYW0uaWFtcG9saWN5LnYxLkFwaVJlc291cmNlUmVmQga6SAPIAQESHgoIcmVsYXRpb24YAyABKAlCDLpICcgBAXIEEAEYQCJkCg5BcGlSZXNvdXJjZVJlZhIbCgRraW5kGAEgASgJQg26SArIAQFyBRABGIACEhkKAmlkGAIgASgJQg26SArIAQFyBRABGIACEhoKCHJlbGF0aW9uGAMgASgJQgi6SAVyAxiAAmIGcHJvdG8z",[r.file_buf_validate_validate]),a=(0,i.messageDesc)(o,0),l=(0,i.messageDesc)(o,1);e.s(["ApiResourceRefSchema",0,l,"IamPolicySpecSchema",0,a,"file_ai_stigmer_iam_iampolicy_v1_spec",0,o],632897);let c=(0,t.fileDesc)("CiVhaS9zdGlnbWVyL2lhbS9pYW1wb2xpY3kvdjEvYXBpLnByb3RvEhthaS5zdGlnbWVyLmlhbS5pYW1wb2xpY3kudjEimQIKCUlhbVBvbGljeRItCgthcGlfdmVyc2lvbhgBIAEoCUIYukgVchMKEWlhbS5zdGlnbWVyLmFpL3YxEh4KBGtpbmQYAiABKAlCELpIDXILCglJYW1Qb2xpY3kSRQoIbWV0YWRhdGEYAyABKAsyMy5haS5zdGlnbWVyLmNvbW1vbnMuYXBpcmVzb3VyY2UuQXBpUmVzb3VyY2VNZXRhZGF0YRI4CgRzcGVjGAQgASgLMiouYWkuc3RpZ21lci5pYW0uaWFtcG9saWN5LnYxLklhbVBvbGljeVNwZWMSPAoGc3RhdHVzGAUgASgLMiwuYWkuc3RpZ21lci5pYW0uaWFtcG9saWN5LnYxLklhbVBvbGljeVN0YXR1cyJSCg9JYW1Qb2xpY3lTdGF0dXMSPwoFYXVkaXQYASABKAsyMC5haS5zdGlnbWVyLmNvbW1vbnMuYXBpcmVzb3VyY2UuQXBpUmVzb3VyY2VBdWRpdGIGcHJvdG8z",[n.file_ai_stigmer_commons_apiresource_metadata,s.file_ai_stigmer_commons_apiresource_status,o,r.file_buf_validate_validate]);e.s(["file_ai_stigmer_iam_iampolicy_v1_api",0,c],626874);var u=e.i(267872);let g=(0,t.fileDesc)("CiRhaS9zdGlnbWVyL2lhbS9pYW1wb2xpY3kvdjEvaW8ucHJvdG8SG2FpLnN0aWdtZXIuaWFtLmlhbXBvbGljeS52MSLDAgoSQXBpUmVzb3VyY2VSZWZWaWV3EgwKBGtpbmQYASABKAkSCgoCaWQYAiABKAkSEAoIcmVsYXRpb24YAyABKAkSDAoEbmFtZRgEIAEoCRINCgVlbWFpbBgFIAEoCRIMCgRzbHVnGAYgASgJEg4KBmF2YXRhchgHIAEoCRJACgdtZW1iZXJzGAggAygLMi8uYWkuc3RpZ21lci5pYW0uaWFtcG9saWN5LnYxLkFwaVJlc291cmNlUmVmVmlldxI+CgV0ZWFtcxgJIAMoCzIvLmFpLnN0aWdtZXIuaWFtLmlhbXBvbGljeS52MS5BcGlSZXNvdXJjZVJlZlZpZXcSRAoPaWRlbnRpdHlfb3JpZ2luGAogASgLMisuYWkuc3RpZ21lci5pYW0uaWFtcG9saWN5LnYxLklkZW50aXR5T3JpZ2luIo4BCg5JZGVudGl0eU9yaWdpbhJdChFwcm92aXNpb25pbmdfbW9kZRgBIAEoDjJCLmFpLnN0aWdtZXIuaWFtLmlkZW50aXR5YWNjb3VudC52MS5JZGVudGl0eUFjY291bnRQcm92aXNpb25pbmdNb2RlEh0KFXByb3ZpZGVyX2Rpc3BsYXlfbmFtZRgCIAEoCSIkCgtJYW1Qb2xpY3lJZBIVCgV2YWx1ZRgBIAEoCUIGukgDyAEBIqcBChZQcmluY2lwYWxSZXNvdXJjZUlucHV0EkYKCXByaW5jaXBhbBgBIAEoCzIrLmFpLnN0aWdtZXIuaWFtLmlhbXBvbGljeS52MS5BcGlSZXNvdXJjZVJlZkIGukgDyAEBEkUKCHJlc291cmNlGAIgASgLMisuYWkuc3RpZ21lci5pYW0uaWFtcG9saWN5LnYxLkFwaVJlc291cmNlUmVmQga6SAPIAQEiqQEKF1Jlc291cmNlUHJpbmNpcGFsc0lucHV0EkUKCHJlc291cmNlGAEgASgLMisuYWkuc3RpZ21lci5pYW0uaWFtcG9saWN5LnYxLkFwaVJlc291cmNlUmVmQga6SAPIAQESRwoKcHJpbmNpcGFscxgCIAMoCzIrLmFpLnN0aWdtZXIuaWFtLmlhbXBvbGljeS52MS5BcGlSZXNvdXJjZVJlZkIGukgDyAEBImQKFFJldm9rZU9yZ0FjY2Vzc0lucHV0EicKE2lkZW50aXR5X2FjY291bnRfaWQYASABKAlCCrpIB8gBAXICEAESIwoPb3JnYW5pemF0aW9uX2lkGAIgASgJQgq6SAfIAQFyAhABIkoKD0lhbVBvbGljaWVzTGlzdBI3CgdlbnRyaWVzGAEgAygLMiYuYWkuc3RpZ21lci5pYW0uaWFtcG9saWN5LnYxLklhbVBvbGljeSJ7ChdMaXN0UmVzb3VyY2VBY2Nlc3NJbnB1dBJFCghyZXNvdXJjZRgBIAEoCzIrLmFpLnN0aWdtZXIuaWFtLmlhbXBvbGljeS52MS5BcGlSZXNvdXJjZVJlZkIGukgDyAEBEhkKEWluY2x1ZGVfaW5oZXJpdGVkGAIgASgIIl4KHVJlc291cmNlQWNjZXNzQnlQcmluY2lwYWxMaXN0Ej0KB2VudHJpZXMYASADKAsyLC5haS5zdGlnbWVyLmlhbS5pYW1wb2xpY3kudjEuUHJpbmNpcGFsQWNjZXNzIowBCg9QcmluY2lwYWxBY2Nlc3MSQgoJcHJpbmNpcGFsGAEgASgLMi8uYWkuc3RpZ21lci5pYW0uaWFtcG9saWN5LnYxLkFwaVJlc291cmNlUmVmVmlldxI1CgVyb2xlcxgCIAMoCzImLmFpLnN0aWdtZXIuaWFtLmlhbXBvbGljeS52MS5Sb2xlR3JhbnQimwEKCVJvbGVHcmFudBIzCgRyb2xlGAEgASgLMiUuYWkuc3RpZ21lci5pYW0uaWFtcG9saWN5LnYxLlJvbGVJbmZvEkMKDm93bmVyX3Jlc291cmNlGAIgASgLMisuYWkuc3RpZ21lci5pYW0uaWFtcG9saWN5LnYxLkFwaVJlc291cmNlUmVmEhQKDGlzX2luaGVyaXRlZBgDIAEoCCJUChhSZXNvdXJjZUFjY2Vzc0J5Um9sZUxpc3QSOAoHZW50cmllcxgBIAMoCzInLmFpLnN0aWdtZXIuaWFtLmlhbXBvbGljeS52MS5Sb2xlQWNjZXNzIocBCgpSb2xlQWNjZXNzEjQKBHJvbGUYASABKAsyJi5haS5zdGlnbWVyLmlhbS5pYW1wb2xpY3kudjEuUm9sZUdyYW50EkMKCnByaW5jaXBhbHMYAiADKAsyLy5haS5zdGlnbWVyLmlhbS5pYW1wb2xpY3kudjEuQXBpUmVzb3VyY2VSZWZWaWV3IkcKCFJvbGVJbmZvEgoKAmlkGAEgASgJEgwKBGNvZGUYAiABKAkSDAoEbmFtZRgDIAEoCRITCgtkZXNjcmlwdGlvbhgEIAEoCSJOChZQcmluY2lwYWxSZXNvdXJjZVJvbGVzEjQKBXJvbGVzGAEgAygLMiUuYWkuc3RpZ21lci5pYW0uaWFtcG9saWN5LnYxLlJvbGVJbmZvIqYBChdDaGVja0F1dGhvcml6YXRpb25JbnB1dBJCCgZwb2xpY3kYASABKAsyKi5haS5zdGlnbWVyLmlhbS5pYW1wb2xpY3kudjEuSWFtUG9saWN5U3BlY0IGukgDyAEBEkcKE2NvbnRleHR1YWxfcG9saWNpZXMYAiADKAsyKi5haS5zdGlnbWVyLmlhbS5pYW1wb2xpY3kudjEuSWFtUG9saWN5U3BlYyIxChhDaGVja0F1dGhvcml6YXRpb25SZXN1bHQSFQoNaXNfYXV0aG9yaXplZBgBIAEoCCLIAQoWQ2hlY2tNeVBlcm1pc3Npb25JbnB1dBJFCghyZXNvdXJjZRgBIAEoCzIrLmFpLnN0aWdtZXIuaWFtLmlhbXBvbGljeS52MS5BcGlSZXNvdXJjZVJlZkIGukgDyAEBEh4KCHJlbGF0aW9uGAIgASgJQgy6SAnIAQFyBBABGEASRwoTY29udGV4dHVhbF9wb2xpY2llcxgDIAMoCzIqLmFpLnN0aWdtZXIuaWFtLmlhbXBvbGljeS52MS5JYW1Qb2xpY3lTcGVjIvIBCh5MaXN0QXV0aG9yaXplZFJlc291cmNlSWRzSW5wdXQSRgoJcHJpbmNpcGFsGAEgASgLMisuYWkuc3RpZ21lci5pYW0uaWFtcG9saWN5LnYxLkFwaVJlc291cmNlUmVmQga6SAPIAQESIQoNcmVzb3VyY2Vfa2luZBgCIAEoCUIKukgHyAEBcgIQARIcCghyZWxhdGlvbhgDIAEoCUIKukgHyAEBcgIQARJHChNjb250ZXh0dWFsX3BvbGljaWVzGAQgAygLMiouYWkuc3RpZ21lci5pYW0uaWFtcG9saWN5LnYxLklhbVBvbGljeVNwZWMiMQoZQXV0aG9yaXplZFJlc291cmNlSWRzTGlzdBIUCgxyZXNvdXJjZV9pZHMYASADKAki8wEKH0xpc3RBdXRob3JpemVkUHJpbmNpcGFsSWRzSW5wdXQSRQoIcmVzb3VyY2UYASABKAsyKy5haS5zdGlnbWVyLmlhbS5pYW1wb2xpY3kudjEuQXBpUmVzb3VyY2VSZWZCBrpIA8gBARIiCg5wcmluY2lwYWxfa2luZBgCIAEoCUIKukgHyAEBcgIQARIcCghyZWxhdGlvbhgDIAEoCUIKukgHyAEBcgIQARJHChNjb250ZXh0dWFsX3BvbGljaWVzGAQgAygLMiouYWkuc3RpZ21lci5pYW0uaWFtcG9saWN5LnYxLklhbVBvbGljeVNwZWMiMwoaQXV0aG9yaXplZFByaW5jaXBhbElkc0xpc3QSFQoNcHJpbmNpcGFsX2lkcxgBIAMoCSJZChdHZXRQcmluY2lwYWxzQ291bnRJbnB1dBIaCgZvcmdfaWQYASABKAlCCrpIB8gBAXICEAESIgoOcHJpbmNpcGFsX2tpbmQYAiABKAlCCrpIB8gBAXICEAEiIAoPUHJpbmNpcGFsc0NvdW50Eg0KBWNvdW50GAEgASgFYgZwcm90bzM",[c,o,u.file_ai_stigmer_iam_identityaccount_v1_enum,r.file_buf_validate_validate]),d=(0,i.messageDesc)(g,2),p=(0,i.messageDesc)(g,5),b=(0,i.messageDesc)(g,7),m=(0,i.messageDesc)(g,17),v=(0,i.messageDesc)(g,22);e.s(["CheckMyPermissionInputSchema",0,m,"GetPrincipalsCountInputSchema",0,v,"IamPolicyIdSchema",0,d,"ListResourceAccessInputSchema",0,b,"RevokeOrgAccessInputSchema",0,p,"file_ai_stigmer_iam_iampolicy_v1_io",0,g],452026)},981922,e=>{"use strict";var t=e.i(271645),i=e.i(891287),n=e.i(452026),s=e.i(632897),r=e.i(586108);e.s(["useCheckPermission",0,function(e,o,a){let l=(0,r.useStigmer)(),c="open"===(a?.fail??"open"),[u,g]=(0,t.useState)(c),[d,p]=(0,t.useState)(!1),[b,m]=(0,t.useState)(null),v=e?`${e.kind}:${e.id}:${o}`:null,f=(0,t.useRef)(new Map);return(0,t.useEffect)(()=>{if(!e||!v){g(c),p(!1);return}let t=f.current.get(v);if(void 0!==t){g(t),p(!1);return}let r=!1;g(c),p(!0);let a=(0,i.create)(n.CheckMyPermissionInputSchema,{resource:(0,i.create)(s.ApiResourceRefSchema,{kind:e.kind,id:e.id}),relation:o});return l.iamPolicy.checkMyPermission(a).then(e=>{if(r)return;let t=e.isAuthorized;f.current.set(v,t),g(t),m(null)}).catch(e=>{r||(g(c),m(e instanceof Error?e:Error(String(e))))}).finally(()=>{r||p(!1)}),()=>{r=!0}},[v,e?.kind,e?.id,o,c,l]),{allowed:u,isLoading:d,error:b}}])},575407,e=>{"use strict";var t=e.i(271645),i=e.i(891287),n=e.i(725842),s=e.i(910304),r=e.i(586108),o=e.i(326283);e.s(["useSsoProvider",0,function(e){let a=(0,r.useStigmer)(),[l,c]=(0,t.useState)(null),[u,g]=(0,t.useState)(!1),[d,p]=(0,t.useState)(null);return(0,t.useEffect)(()=>{if(!e){c(null),g(!1),p(null);return}let t={current:!1};return g(!0),p(null),a.identityProvider.getSsoProvider((0,i.create)(n.OrganizationSsoLookupSchema,{org:e})).then(e=>{t.current||(c(e),g(!1))},e=>{t.current||((0,s.isNotFound)(e)?c(null):p((0,o.toError)(e)),g(!1))}),()=>{t.current=!0}},[e,a]),{ssoProvider:l,isLoading:u,error:d}}])},590150,973532,e=>{"use strict";var t=e.i(981922);e.s(["PermissionGate",0,function({resource:e,relation:i,children:n,fallback:s=null,loading:r=null}){let{allowed:o,isLoading:a}=(0,t.useCheckPermission)(e,i);return a?r:o?n:s}],590150);var i=e.i(170255),n=e.i(597744);let s={kind:"platform",id:"stigmer"};e.s(["useCanSetPublicVisibility",0,function(){let e=(0,n.useResourceAvailable)(i.ApiResourceKind.platform),{allowed:r,isLoading:o}=(0,t.useCheckPermission)(e?s:null,"can_set_public_visibility",{fail:"closed"});return e?{allowed:r,isLoading:o}:{allowed:!0,isLoading:!1}}],973532)},758960,853793,e=>{"use strict";var t=e.i(843476),i=e.i(271645),n=e.i(506213),s=e.i(893976),r=e.i(364354),o=e.i(188482),a=e.i(10337),l=e.i(966205);let c="stg:inline-flex stg:shrink-0 stg:items-center stg:gap-1 stg:rounded-full stg:bg-muted stg:px-2 stg:py-0.5 stg:text-[10px] stg:font-medium stg:text-muted-foreground",u=(0,i.forwardRef)(function({option:e,isSelected:i,role:n,isHighlighted:r,disabled:o,tabIndex:a,onSelect:l,onMouseEnter:c,onKeyDown:u},g){let b=void 0!==e.lockedReason,m="radio"===n?{"aria-checked":i}:{"aria-selected":i};return(0,t.jsxs)("button",{ref:g,type:"button",role:n,...m,"aria-disabled":b||void 0,tabIndex:a,disabled:o||b,onClick:l,onMouseEnter:c,onKeyDown:u,className:(0,s.cn)("stg:flex stg:w-full stg:items-start stg:gap-2 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",b?"stg:disabled:pointer-events-none stg:cursor-default":"stg:disabled:pointer-events-none stg:disabled:opacity-50",!b&&(r?"stg:bg-accent stg:text-foreground":"stg:hover:bg-accent-hover")),children:[(0,t.jsx)(d,{tone:e.tone,className:"stg:mt-0.5 stg:size-3.5 stg:shrink-0 stg:text-muted-foreground"}),(0,t.jsxs)("span",{className:"stg:min-w-0 stg:flex-1",children:[(0,t.jsx)("span",{className:(0,s.cn)("stg:block stg:text-xs stg:font-medium",b?"stg:text-muted-foreground":"stg:text-foreground"),children:e.label}),(0,t.jsx)("span",{className:"stg:block stg:text-[0.65rem] stg:leading-snug stg:text-muted-foreground",children:b?e.lockedReason:e.description})]}),b?(0,t.jsx)(p,{className:"stg:mt-0.5 stg:size-3.5 stg:shrink-0 stg:text-muted-foreground"}):i&&(0,t.jsx)(f,{className:"stg:mt-0.5 stg:size-3.5 stg:shrink-0 stg:text-primary"})]})}),g={private:{container:"stg:border-amber-200 stg:bg-amber-50 stg:dark:border-amber-800/50 stg:dark:bg-amber-950/30",text:"stg:text-amber-800 stg:dark:text-amber-200",confirm:"stg:bg-amber-600 stg:hover:bg-amber-700 stg:dark:bg-amber-600 stg:dark:hover:bg-amber-500",cancel:"stg:text-amber-700 stg:hover:text-amber-900 stg:dark:text-amber-300 stg:dark:hover:text-amber-100"},org:{container:"stg:border-blue-200 stg:bg-blue-50 stg:dark:border-blue-800/50 stg:dark:bg-blue-950/30",text:"stg:text-blue-800 stg:dark:text-blue-200",confirm:"stg:bg-blue-600 stg:hover:bg-blue-700 stg:dark:bg-blue-600 stg:dark:hover:bg-blue-500",cancel:"stg:text-blue-700 stg:hover:text-blue-900 stg:dark:text-blue-300 stg:dark:hover:text-blue-100"},platform:{container:"stg:border-violet-200 stg:bg-violet-50 stg:dark:border-violet-800/50 stg:dark:bg-violet-950/30",text:"stg:text-violet-800 stg:dark:text-violet-200",confirm:"stg:bg-violet-600 stg:hover:bg-violet-700 stg:dark:bg-violet-600 stg:dark:hover:bg-violet-500",cancel:"stg:text-violet-700 stg:hover:text-violet-900 stg:dark:text-violet-300 stg:dark:hover:text-violet-100"},public:{container:"stg:border-emerald-200 stg:bg-emerald-50 stg:dark:border-emerald-800/50 stg:dark:bg-emerald-950/30",text:"stg:text-emerald-800 stg:dark:text-emerald-200",confirm:"stg:bg-emerald-600 stg:hover:bg-emerald-700 stg:dark:bg-emerald-600 stg:dark:hover:bg-emerald-500",cancel:"stg:text-emerald-700 stg:hover:text-emerald-900 stg:dark:text-emerald-300 stg:dark:hover:text-emerald-100"}};function d({tone:e,className:i}){switch(e){case"org":return(0,t.jsx)(b,{className:i});case"platform":return(0,t.jsx)(m,{className:i});case"public":return(0,t.jsx)(v,{className:i});default:return(0,t.jsx)(p,{className:i})}}function p({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:"3.5",y:"7",width:"9",height:"7",rx:"1.5"}),(0,t.jsx)("path",{d:"M5.5 7V5a2.5 2.5 0 0 1 5 0v2"})]})}function b({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:"6",cy:"5",r:"2.5"}),(0,t.jsx)("path",{d:"M2 13c0-2.21 1.79-4 4-4s4 1.79 4 4"}),(0,t.jsx)("circle",{cx:"11.5",cy:"5.5",r:"2"}),(0,t.jsx)("path",{d:"M14 13c0-1.66-1.12-3-2.5-3-.5 0-1 .14-1.4.4"})]})}function m({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:"M2 14V4.5L6.5 2v12"}),(0,t.jsx)("path",{d:"M6.5 6.5 14 8.5V14"}),(0,t.jsx)("path",{d:"M2 14h12"}),(0,t.jsx)("path",{d:"M4.25 6h.01M4.25 8.5h.01M4.25 11h.01M10.5 10.5h.01M10.5 12.5h.01"})]})}function v({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:"8",r:"6"}),(0,t.jsx)("path",{d:"M2 8h12"}),(0,t.jsx)("path",{d:"M8 2c1.66 1.46 2.6 3.63 2.6 6s-.94 4.54-2.6 6c-1.66-1.46-2.6-3.63-2.6-6s.94-4.54 2.6-6Z"})]})}function f({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 6.5 12 13 4.5"})})}var h=e.i(302933);let S={value:h.ApiResourceVisibility.visibility_private,label:"Private",description:"Only you can access",tone:"private"},x={value:h.ApiResourceVisibility.visibility_org,label:"Organization",description:"All members of your organization",confirmPrompt:"Make visible to all org members?",tone:"org"},A={value:h.ApiResourceVisibility.visibility_platform,label:"Platform",description:"All organizations managed by your platform",confirmDialog:{title:"Share with your whole platform?",description:"Every organization managed by your platform will be able to view and use this resource. You can return it to a narrower visibility at any time."},tone:"platform"},y={value:h.ApiResourceVisibility.visibility_public,label:"Public",description:"Anyone on Stigmer",confirmDialog:{title:"Make this public?",description:"Anyone signed in to Stigmer will be able to view and use this resource. You can return it to a narrower visibility at any time."},tone:"public"};function k(e){return e?y:{...y,lockedReason:"Public listing is granted by the platform team — contact us to publish this resource."}}function C(e){switch(e){case h.ApiResourceVisibility.visibility_org:return x;case h.ApiResourceVisibility.visibility_platform:return A;case h.ApiResourceVisibility.visibility_public:return y;default:return S}}function I(){return(0,t.jsx)("svg",{className:"stg:size-2.5 stg:shrink-0 stg:text-muted-foreground",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M3 4.5 6 7.5 9 4.5"})})}e.s(["blueprintVisibilityLevels",0,function(e){let t=k(e.canSetPublicVisibility);return"local"===e.deploymentMode?[S,t]:e.hasIdentityProvider?[S,x,A,t]:[S,x,t]},"environmentVisibilityLevels",0,function(e){return"local"===e?[S]:[{...S,description:"Only you can view and use these credentials"},{...x,description:"Agents run in your org — including shared-agent visitors — can use these credentials. Members see names only; secret values stay hidden.",confirmPrompt:"Let agents run in your org use these credentials?"}]},"instanceVisibilityLevels",0,function(e){return[S,{...x,description:"All org members can view executions"},{...k(e.canSetPublicVisibility),description:"All authenticated users can view"}]},"visibilityOption",0,C],853793),e.s(["VisibilityBadge",0,function({visibility:e,className:i,onClick:n}){let r=C(e),a=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(d,{tone:r.tone,className:"stg:size-2.5"}),r.label]});return n?(0,t.jsxs)(o.Tooltip,{children:[(0,t.jsx)(o.TooltipTrigger,{render:(0,t.jsx)("button",{type:"button",onClick:n,"aria-label":`${r.label} visibility — manage access`,className:(0,s.cn)(c,"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",i)}),children:a}),(0,t.jsx)(o.TooltipContent,{side:"top",children:"Manage access"})]}):(0,t.jsx)("span",{className:(0,s.cn)(c,i),children:a})},"VisibilitySelector",0,function({visibility:e,options:o,onVisibilityChange:p,mode:b="manage",isPending:m=!1,disabled:v=!1,ariaLabel:f="Resource visibility",className:h}){let S=(0,r.useStigmerPortalContainer)(),{confirmState:x,confirm:A,handleConfirm:y,handleCancel:k}=(0,l.useConfirmAction)(),[W,R]=(0,i.useState)(!1),[E,V]=(0,i.useState)(null),[Y,G]=(0,i.useState)(-1),N=(0,i.useRef)([]),B=v||m,j=(0,i.useMemo)(()=>o.some(t=>t.value===e)?o:[...o,C(e)],[o,e]),w=(0,i.useCallback)(t=>{let i=j.map(e=>e.value);return i.indexOf(t)>i.indexOf(e)},[j,e]),Z=(0,i.useCallback)(e=>{R(!1),V(null),p(e)},[p]),L=(0,i.useCallback)(t=>{if(void 0!==t.lockedReason)return;let i=t.value;if(i===e){V(null),R(!1);return}if("create"===b||!w(i))return void Z(i);if(t.confirmDialog){R(!1),V(null),A({title:t.confirmDialog.title,description:t.confirmDialog.description,confirmLabel:`Make ${t.label}`,variant:"default"}).then(e=>{e&&p(i)});return}t.confirmPrompt?V(i):Z(i)},[e,b,w,Z,A,p]),F=(0,i.useCallback)((e,t)=>{let i=j.length,n=e;for(let e=0;e<i&&(n=(n+t+i)%i,j[n]?.lockedReason!==void 0);e++);G(n),N.current[n]?.focus()},[j]),X=(0,i.useCallback)((e,t)=>{switch(e.key){case"ArrowDown":case"ArrowRight":e.preventDefault(),F(t,1);break;case"ArrowUp":case"ArrowLeft":e.preventDefault(),F(t,-1);break;case"Home":e.preventDefault(),G(0),N.current[0]?.focus();break;case"End":{e.preventDefault();let t=j.length-1;G(t),N.current[t]?.focus()}}},[F,j.length]);(0,i.useEffect)(()=>{if(!W){V(null),G(-1);return}let t=j.findIndex(t=>t.value===e),i=t>=0?t:0;G(i);let n=requestAnimationFrame(()=>N.current[i]?.focus());return()=>cancelAnimationFrame(n)},[W,j,e]);let M=(0,t.jsx)(a.ConfirmDialog,{state:x,onConfirm:y,onCancel:k}),J=i=>j.map((n,s)=>(0,t.jsx)(u,{ref:e=>{N.current[s]=e},option:n,role:i,isSelected:e===n.value,isHighlighted:"option"===i&&Y===s,tabIndex:"radio"===i?e===n.value?0:-1:Y===s?0:-1,disabled:B,onSelect:()=>L(n),onMouseEnter:"option"===i?()=>G(s):void 0,onKeyDown:e=>X(e,s)},n.value));if("create"===b)return(0,t.jsx)("div",{role:"radiogroup","aria-label":f,"aria-disabled":B||void 0,className:(0,s.cn)("stg:flex stg:flex-col stg:gap-0.5 stg:rounded-md stg:border stg:border-border stg:p-1",B&&"stg:pointer-events-none stg:opacity-50",h),children:J("radio")});let P=C(e),O=null!==E?j.find(e=>e.value===E):void 0;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(n.Popover.Root,{open:W,onOpenChange:R,children:[(0,t.jsxs)(n.Popover.Trigger,{disabled:B,"aria-label":`${f}: ${P.label}`,className:(0,s.cn)(c,"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","stg:disabled:pointer-events-none stg:disabled:opacity-50",h),children:[m?(0,t.jsx)("span",{className:"stg:inline-block stg:size-2.5 stg:animate-spin stg:rounded-full stg:border-2 stg:border-current stg:border-t-transparent","aria-hidden":"true"}):(0,t.jsx)(d,{tone:P.tone,className:"stg:size-2.5"}),P.label,(0,t.jsx)(I,{})]}),(0,t.jsx)(n.Popover.Portal,{container:S,children:(0,t.jsx)(n.Popover.Positioner,{sideOffset:4,align:"start",children:(0,t.jsxs)(n.Popover.Popup,{role:"listbox","aria-label":f,className:(0,s.cn)("stg:z-popover stg:w-72 stg:rounded-lg stg:border stg:border-border stg:bg-popover stg:p-1 stg:shadow-md","stg:text-popover-foreground stg:animate-in stg:fade-in-0 stg:zoom-in-95"),children:[J("option"),O?.confirmPrompt&&(0,t.jsxs)("div",{role:"alert",className:(0,s.cn)("stg:mt-1 stg:flex stg:items-center stg:gap-2 stg:rounded-md stg:border stg:px-2.5 stg:py-1.5",g[O.tone].container),children:[(0,t.jsx)("span",{className:(0,s.cn)("stg:flex-1 stg:text-[0.65rem] stg:leading-snug",g[O.tone].text),children:O.confirmPrompt}),(0,t.jsx)("button",{type:"button",onClick:()=>V(null),className:(0,s.cn)("stg:rounded stg:px-2 stg:py-0.5 stg:text-[0.65rem] stg:font-medium","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring",g[O.tone].cancel),children:"Cancel"}),(0,t.jsx)("button",{type:"button",onClick:()=>Z(O.value),className:(0,s.cn)("stg:rounded stg:px-2 stg:py-0.5 stg:text-[0.65rem] stg:font-medium stg:text-white","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring",g[O.tone].confirm),children:"Confirm"})]})]})})})]}),M]})}],758960)},388023,e=>{"use strict";var t=e.i(843476),i=e.i(271645),n=e.i(302933),s=e.i(597744),r=e.i(590150),o=e.i(575407),a=e.i(973532),l=e.i(758960),c=e.i(853793),u=e.i(891287),g=e.i(459153),d=e.i(586108),p=e.i(326283);let b={agent:"agent",workflow:"workflow",plugin:"plugin",skill:"skill",mcpServer:"mcp_server",agentInstance:"agent_instance",workflowInstance:"workflow_instance",environment:"environment"},m=new Set(["agentInstance","workflowInstance"]);e.s(["ResourceVisibilityControl",0,function({kind:e,resourceId:v,visibility:f,org:h,onChanged:S,className:x}){let{updateVisibility:A,isPending:y}=function(e,t){let n=(0,d.useStigmer)(),[s,r]=(0,i.useState)(!1),[o,a]=(0,i.useState)(null);return{updateVisibility:(0,i.useCallback)(async i=>{if(t){r(!0),a(null);try{let s=(0,u.create)(g.UpdateVisibilityInputSchema,{resourceId:t,visibility:i});switch(e){case"skill":await n.skill.updateVisibility(s);break;case"agent":await n.agent.updateVisibility(s);break;case"mcpServer":await n.mcpServer.updateVisibility(s);break;case"workflow":await n.workflow.updateVisibility(s);break;case"plugin":await n.plugin.updateVisibility(s);break;case"agentInstance":await n.agentInstance.updateVisibility(s);break;case"workflowInstance":await n.workflowInstance.updateVisibility(s);break;case"environment":await n.environment.updateVisibility(s)}}catch(e){throw a((0,p.toError)(e)),e}finally{r(!1)}}},[e,t,n]),isPending:s,error:o}}(e,v),k=(0,s.useDeploymentMode)(),C=(0,a.useCanSetPublicVisibility)(),I=m.has(e),W="environment"===e,R=I||W||"local"===k?null:h??null,{ssoProvider:E}=(0,o.useSsoProvider)(R),V=W?(0,c.environmentVisibilityLevels)(k):I?(0,c.instanceVisibilityLevels)({canSetPublicVisibility:C.allowed}):(0,c.blueprintVisibilityLevels)({deploymentMode:k,hasIdentityProvider:null!==E,canSetPublicVisibility:C.allowed}),Y=(0,i.useCallback)(async e=>{try{await A(e),S?.()}catch{}},[A,S]),G=(0,t.jsx)(l.VisibilityBadge,{visibility:f,className:x});if(V.length<2)return G;let N=(0,t.jsx)(l.VisibilitySelector,{visibility:f,options:V,onVisibilityChange:Y,isPending:y,ariaLabel:I?"Instance visibility":"Resource visibility",className:x});return C.allowed&&f===n.ApiResourceVisibility.visibility_public?N:(0,t.jsx)(r.PermissionGate,{resource:{kind:b[e],id:v},relation:"can_edit",fallback:G,loading:G,children:N})}],388023)}]);
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,361353,e=>{"use strict";e.s(["formatRelativeTime",0,function(e,t){let s=t??new Date,r=s.getTime()-e.getTime();if(r<6e4)return"now";let i=Math.floor(r/6e4);if(i<60)return`${i}m`;let n=Math.floor(i/60);if(n<24)return`${n}h`;let a=Math.floor(n/24);if(a<7)return`${a}d`;let l=e.getFullYear()===s.getFullYear();return e.toLocaleDateString(void 0,{month:"short",day:"numeric",...l?{}:{year:"numeric"}})}])},691444,e=>{"use strict";var t=e.i(430182);let s={[t.IamRole.iam_role_unspecified]:"unspecified",[t.IamRole.owner]:"owner",[t.IamRole.admin]:"admin",[t.IamRole.member]:"member",[t.IamRole.viewer]:"viewer",[t.IamRole.participant]:"participant"},r={owner:t.IamRole.owner,admin:t.IamRole.admin,member:t.IamRole.member,viewer:t.IamRole.viewer,participant:t.IamRole.participant},i={[t.IamRole.iam_role_unspecified]:"Unspecified",[t.IamRole.owner]:"Owner",[t.IamRole.admin]:"Admin",[t.IamRole.member]:"Member",[t.IamRole.viewer]:"Viewer",[t.IamRole.participant]:"Participant"},n={[t.IamRole.iam_role_unspecified]:"",[t.IamRole.owner]:"Full access including delete and access management",[t.IamRole.admin]:"Edit access and member management",[t.IamRole.member]:"Standard access to organization resources",[t.IamRole.viewer]:"Read-only access",[t.IamRole.participant]:"Reply to customers and manage conversation takeover"};e.s(["iamRoleDescription",0,function(e){return n[e]??""},"iamRoleDisplayName",0,function(e){return i[e]??"Unknown"},"iamRoleFromString",0,function(e){return r[e]},"iamRoleToString",0,function(e){return s[e]??"unspecified"}])},146312,818094,e=>{"use strict";var t=e.i(843476),s=e.i(271645),r=e.i(893976),i=e.i(869803),n=e.i(170255),a=e.i(430182);let l=new Map([[n.ApiResourceKind.identity_provider,[a.IamRole.owner,a.IamRole.viewer]],[n.ApiResourceKind.oauth_app,[a.IamRole.owner,a.IamRole.viewer]],[n.ApiResourceKind.platform_client,[a.IamRole.owner,a.IamRole.viewer]],[n.ApiResourceKind.organization,[a.IamRole.owner,a.IamRole.admin,a.IamRole.member,a.IamRole.viewer]],[n.ApiResourceKind.agent,[a.IamRole.owner,a.IamRole.viewer]],[n.ApiResourceKind.session,[a.IamRole.owner,a.IamRole.viewer]],[n.ApiResourceKind.skill,[a.IamRole.owner,a.IamRole.viewer]],[n.ApiResourceKind.mcp_server,[a.IamRole.owner,a.IamRole.viewer]],[n.ApiResourceKind.agent_instance,[a.IamRole.owner,a.IamRole.viewer]],[n.ApiResourceKind.agent_share,[a.IamRole.owner,a.IamRole.viewer]],[n.ApiResourceKind.agent_channel,[a.IamRole.owner,a.IamRole.viewer,a.IamRole.participant]],[n.ApiResourceKind.channel_app,[a.IamRole.owner,a.IamRole.viewer]],[n.ApiResourceKind.workflow,[a.IamRole.owner,a.IamRole.viewer]],[n.ApiResourceKind.workflow_instance,[a.IamRole.owner,a.IamRole.viewer]],[n.ApiResourceKind.workflow_execution,[a.IamRole.owner,a.IamRole.viewer]],[n.ApiResourceKind.environment,[a.IamRole.owner,a.IamRole.viewer]],[n.ApiResourceKind.artifact,[a.IamRole.owner,a.IamRole.viewer]],[n.ApiResourceKind.schedule,[a.IamRole.owner,a.IamRole.viewer]],[n.ApiResourceKind.plugin,[a.IamRole.owner,a.IamRole.viewer]],[n.ApiResourceKind.project,[a.IamRole.owner,a.IamRole.viewer]]]),o=Object.freeze([]);function c(e){return l.get(e)??o}e.s(["getGrantableRoles",0,c,"hasGrantableRoles",0,function(e){let t=l.get(e);return void 0!==t&&t.length>0}],818094);var d=e.i(691444);e.s(["RoleSelector",0,function({kind:e,onSelect:n,selected:a,defaultRole:l,disabled:o=!1,className:g}){let u=(0,s.useId)(),{options:m,selected:p,select:x}=function(e,t){let[r,i]=(0,s.useState)(t??null),n=(0,s.useMemo)(()=>null===e?[]:c(e).map(e=>({role:e,label:(0,d.iamRoleDisplayName)(e),description:(0,d.iamRoleDescription)(e),value:(0,d.iamRoleToString)(e)})),[e]),a=(0,s.useMemo)(()=>null!==r?(0,d.iamRoleToString)(r):"",[r]);return{options:n,selected:r,selectedValue:a,select:(0,s.useCallback)(e=>i(e),[]),clear:(0,s.useCallback)(()=>i(null),[]),hasOptions:n.length>0}}(e,l),f=void 0!==a?a:p;return 0===m.length?null:(0,t.jsxs)("fieldset",{className:(0,r.cn)(i.UNSTYLED_FIELDSET,"stg:space-y-1.5",g),children:[(0,t.jsx)("legend",{className:"stg:text-xs stg:font-medium stg:text-foreground",children:"Role"}),(0,t.jsx)("div",{className:"stg:flex stg:flex-wrap stg:gap-2",children:m.map(e=>{let s=f===e.role;return(0,t.jsxs)("label",{className:(0,r.cn)("stg:inline-flex stg:cursor-pointer stg:flex-col stg:rounded-md stg:border stg:px-3 stg:py-1.5 stg:text-xs stg:transition-colors",s?"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:u,value:e.value,checked:s,disabled:o,onChange:()=>{var t;x(t=e.role),n?.(t)},className:"stg:sr-only"}),(0,t.jsx)("span",{children:e.label}),(0,t.jsx)("span",{className:"stg:text-[0.625rem] stg:text-muted-foreground stg:font-normal stg:mt-0.5",children:e.description})]},e.value)})})]})}],146312)},564035,288441,890079,32011,e=>{"use strict";var t=e.i(891287),s=e.i(452026),r=e.i(632897),i=e.i(586108),n=e.i(583093);e.s(["useResourceAccess",0,function(e,a){let l=(0,i.useStigmer)(),o=e?.kind??null,c=e?.id??null,d=a?.includeInherited??!1,{data:g,isLoading:u,isRefetching:m,error:p,refetch:x}=(0,n.useFetch)(o&&c?()=>{let e=(0,t.create)(s.ListResourceAccessInputSchema,{resource:(0,t.create)(r.ApiResourceRefSchema,{kind:o,id:c}),includeInherited:d});return l.iamPolicy.listResourceAccessByPrincipal(e).then(e=>[...e.entries])}:null,[o,c,d,l],[]);return{members:g,isLoading:u,isRefetching:m,error:p,refetch:x}}],564035);var a=e.i(271645),l=e.i(326283);e.s(["useCreateIamPolicy",0,function(){let e=(0,i.useStigmer)(),[t,s]=(0,a.useState)(!1),[r,n]=(0,a.useState)(null),o=(0,a.useCallback)(()=>n(null),[]);return{create:(0,a.useCallback)(async t=>{s(!0),n(null);try{return await e.iamPolicy.create(t)}catch(e){throw n((0,l.toError)(e)),e}finally{s(!1)}},[e]),isCreating:t,error:r,clearError:o}}],288441),e.s(["useDeleteIamPolicy",0,function(){let e=(0,i.useStigmer)(),[t,s]=(0,a.useState)(!1),[r,n]=(0,a.useState)(null),o=(0,a.useCallback)(()=>n(null),[]);return{remove:(0,a.useCallback)(async t=>{s(!0),n(null);try{return await e.iamPolicy.delete(t)}catch(e){throw n((0,l.toError)(e)),e}finally{s(!1)}},[e]),isDeleting:t,error:r,clearError:o}}],890079);var o=e.i(843476),c=e.i(893976),d=e.i(188482);function g(e){return e?.identityOrigin?.providerDisplayName??""}e.s(["ProviderBadge",0,function({principal:e,className:t}){let s=g(e);return s?(0,o.jsxs)(d.Tooltip,{children:[(0,o.jsx)(d.TooltipTrigger,{render:(0,o.jsx)("span",{className:(0,c.cn)("stg:inline-flex stg:items-center stg:rounded stg:px-1.5 stg:py-0.5 stg:text-[0.6rem] stg:font-medium","stg:bg-muted-subtle stg:text-muted-foreground",t)}),children:s}),(0,o.jsx)(d.TooltipContent,{side:"top",children:`Identity provider: ${s}`})]}):null},"providerLabel",0,g],32011)},213149,e=>{"use strict";var t=e.i(843476),s=e.i(271645),r=e.i(893976),i=e.i(468806),n=e.i(818094),a=e.i(869803),l=e.i(610595),o=e.i(597744),c=e.i(891287),d=e.i(632897),g=e.i(564035),u=e.i(288441),m=e.i(890079),p=e.i(691444),x=e.i(146312),f=e.i(32011);function h({orgId:e,value:i,onChange:n,excludePrincipalIds:o,disabled:c=!1,className:d}){let u=(0,s.useId)(),{members:m,isLoading:p,error:x}=(0,g.useResourceAccess)(e?{kind:"organization",id:e}:null),[b,y]=(0,s.useState)(""),[R,w]=(0,s.useState)(!1),[j,k]=(0,s.useState)(0),I=(0,s.useRef)(null),N=(0,s.useMemo)(()=>new Set(o??[]),[o]),S=(0,s.useMemo)(()=>{let e=new Map;for(let t of m){let s=t.principal;s&&"identity_account"===s.kind&&s.id&&(e.has(s.id)||e.set(s.id,s))}return[...e.values()]},[m]),C=(0,s.useMemo)(()=>{let e=new Map;for(let t of S){let s=t.email?.toLowerCase();s&&e.set(s,(e.get(s)??0)+1)}return new Set([...e.entries()].filter(([,e])=>e>1).map(([e])=>e))},[S]),A=(0,s.useMemo)(()=>{let e=b.trim().toLowerCase();return e?S.filter(t=>{let s=(t.name??"").toLowerCase(),r=(t.email??"").toLowerCase();return s.includes(e)||r.includes(e)}):S},[S,b]),M=(0,s.useCallback)(e=>{N.has(e.id)||(n({id:e.id,name:e.name||e.email||e.id,email:e.email,view:e}),y(""),w(!1))},[N,n]),K=(0,s.useCallback)(e=>{if("ArrowDown"===e.key)e.preventDefault(),w(!0),k(e=>Math.min(e+1,A.length-1));else if("ArrowUp"===e.key)e.preventDefault(),k(e=>Math.max(e-1,0));else if("Enter"===e.key){e.preventDefault();let t=A[j];t&&!N.has(t.id)&&M(t)}else"Escape"===e.key&&w(!1)},[A,j,N,M]);return i?(0,t.jsxs)("div",{className:(0,r.cn)("stg:space-y-1",d),children:[(0,t.jsx)("span",{className:"stg:block stg:text-xs stg:font-medium stg:text-foreground",children:"Person"}),(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:justify-between stg:gap-2 stg:rounded-md stg:border stg:border-input stg:bg-background stg:px-2.5 stg:py-1.5",children:[(0,t.jsxs)("div",{className:"stg:flex stg:min-w-0 stg:items-center stg:gap-2",children:[(0,t.jsx)("div",{className:"stg:flex stg:h-6 stg:w-6 stg:shrink-0 stg:items-center stg:justify-center stg:rounded-full stg:bg-muted stg:text-[0.6rem] stg:font-medium stg:text-muted-foreground","aria-hidden":"true",children:(i.name[0]??"?").toUpperCase()}),(0,t.jsxs)("div",{className:"stg:min-w-0",children:[(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-1.5",children:[(0,t.jsx)("span",{className:"stg:truncate stg:text-xs stg:text-foreground",children:i.name}),(0,t.jsx)(f.ProviderBadge,{principal:i.view})]}),i.email&&i.email!==i.name&&(0,t.jsx)("span",{className:"stg:block stg:truncate stg:text-[0.6rem] stg:text-muted-foreground",children:i.email})]})]}),(0,t.jsx)("button",{type:"button",onClick:()=>n(null),disabled:c,"aria-label":"Clear selected person",className:(0,r.cn)("stg:shrink-0 stg:rounded stg:p-0.5 stg:text-muted-foreground","stg:hover:text-foreground stg:hover:bg-accent-hover","stg:disabled:pointer-events-none stg:disabled:opacity-50"),children:(0,t.jsx)(v,{})})]})]}):(0,t.jsxs)("div",{className:(0,r.cn)("stg:space-y-1",d),children:[(0,t.jsx)("label",{htmlFor:`${u}-input`,className:"stg:block stg:text-xs stg:font-medium stg:text-foreground",children:"Person"}),(0,t.jsxs)("div",{className:"stg:relative",children:[(0,t.jsx)("input",{id:`${u}-input`,ref:I,type:"text",role:"combobox","aria-expanded":R,"aria-controls":u,"aria-autocomplete":"list",autoComplete:"off",value:b,onChange:e=>{y(e.target.value),w(!0),k(0)},onFocus:()=>w(!0),onBlur:()=>{window.setTimeout(()=>w(!1),120)},onKeyDown:K,placeholder:"Search by name or email",disabled:c||p,autoFocus:!0,className:(0,r.cn)("stg:w-full stg:rounded-md stg:border stg:border-input stg:bg-background stg:px-2.5 stg:py-1.5 stg:text-xs stg:text-foreground","stg:placeholder:text-muted-foreground","stg:focus-visible:outline-none stg:focus-visible:ring-1 stg:focus-visible:ring-ring","stg:disabled:pointer-events-none stg:disabled:opacity-50")}),R&&(0,t.jsxs)("ul",{id:u,role:"listbox","aria-label":"Organization members",className:(0,r.cn)(a.UNSTYLED_LIST,"stg:absolute stg:z-10 stg:mt-1 stg:max-h-56 stg:w-full stg:overflow-auto stg:rounded-md stg:border stg:border-border stg:bg-popover stg:py-1 stg:shadow-md"),children:[p&&(0,t.jsx)("li",{className:"stg:px-2.5 stg:py-2 stg:text-xs stg:text-muted-foreground",children:"Loading members…"}),!p&&x&&(0,t.jsx)("li",{className:"stg:px-2.5 stg:py-2 stg:text-[0.65rem] stg:text-destructive",role:"alert",children:(0,l.getUserMessage)(x)}),!p&&!x&&0===A.length&&(0,t.jsx)("li",{className:"stg:px-2.5 stg:py-2 stg:text-xs stg:text-muted-foreground",children:b.trim()?"No members match your search.":"No members to share with."}),!p&&!x&&A.map((e,s)=>{let i=N.has(e.id),n=s===j,a=e.name||e.email||e.id,l=!!(0,f.providerLabel)(e)&&(e.identityOrigin?.providerDisplayName!=="Stigmer"||!!e.email&&C.has(e.email.toLowerCase()));return(0,t.jsxs)("li",{role:"option","aria-selected":n,"aria-disabled":i,onMouseEnter:()=>k(s),onMouseDown:t=>{t.preventDefault(),i||M(e)},className:(0,r.cn)("stg:flex stg:items-center stg:justify-between stg:gap-2 stg:px-2.5 stg:py-1.5",i?"stg:cursor-not-allowed stg:opacity-50":"stg:cursor-pointer",n&&!i&&"stg:bg-accent-hover"),children:[(0,t.jsxs)("div",{className:"stg:flex stg:min-w-0 stg:items-center stg:gap-2",children:[(0,t.jsx)("div",{className:"stg:flex stg:h-6 stg:w-6 stg:shrink-0 stg:items-center stg:justify-center stg:rounded-full stg:bg-muted stg:text-[0.6rem] stg:font-medium stg:text-muted-foreground","aria-hidden":"true",children:(a[0]??"?").toUpperCase()}),(0,t.jsxs)("div",{className:"stg:min-w-0",children:[(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-1.5",children:[(0,t.jsx)("span",{className:"stg:truncate stg:text-xs stg:text-foreground",children:a}),l&&(0,t.jsx)(f.ProviderBadge,{principal:e})]}),e.email&&e.email!==a&&(0,t.jsx)("span",{className:"stg:block stg:truncate stg:text-[0.6rem] stg:text-muted-foreground",children:e.email})]})]}),i&&(0,t.jsx)("span",{className:"stg:shrink-0 stg:text-[0.6rem] stg:text-muted-foreground",children:"Has access"})]},e.id)})]})]})]})}function v(){return(0,t.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M4 4l8 8M12 4l-8 8"})})}var b=e.i(379410);function y({resourceKind:e,resourceKindString:i,resourceId:n,orgId:a,excludePrincipalIds:o,onGranted:g,onCancel:m,className:f}){let{create:v,isCreating:R,error:w,clearError:j}=(0,u.useCreateIamPolicy)(),[k,I]=(0,s.useState)(null),[N,S]=(0,s.useState)(null),C=null!==k&&null!==N&&!R,A=(0,s.useCallback)(async e=>{if(e.preventDefault(),C&&null!==N&&null!==k){j();try{let e=(0,c.create)(d.IamPolicySpecSchema,{principal:(0,c.create)(d.ApiResourceRefSchema,{kind:"identity_account",id:k.id}),resource:(0,c.create)(d.ApiResourceRefSchema,{kind:i,id:n}),relation:(0,p.iamRoleToString)(N)}),t=await v(e);g?.(t)}catch{}}},[C,N,k,i,n,v,j,g]);return(0,t.jsxs)("form",{onSubmit:A,className:(0,r.cn)("stg:space-y-3",f),children:[(0,t.jsxs)("div",{className:"stg:space-y-3",children:[(0,t.jsx)(h,{orgId:a,value:k,onChange:I,excludePrincipalIds:o,disabled:R}),(0,t.jsx)(x.RoleSelector,{kind:e,selected:N,onSelect:S,disabled:R})]}),w&&(0,t.jsx)("p",{className:"stg:text-destructive stg:text-[0.65rem]",role:"alert",children:(0,l.getUserMessage)(w)}),(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-2",children:[(0,t.jsxs)("button",{type:"submit",disabled:!C,className:(0,r.cn)("stg:inline-flex stg:items-center stg:gap-1.5 stg:rounded-md stg:px-3 stg:py-1.5 stg:text-xs stg:font-medium","stg:bg-primary stg:text-primary-foreground stg:hover:bg-primary-hover","stg:disabled:pointer-events-none stg:disabled:opacity-40"),children:[R&&(0,t.jsx)(b.SpinnerIcon,{size:12}),"Grant access"]}),m&&(0,t.jsx)("button",{type:"button",onClick:m,disabled:R,className:(0,r.cn)("stg:rounded-md stg:px-3 stg:py-1.5 stg:text-xs","stg:text-muted-foreground stg:hover:text-foreground stg:hover:bg-accent-hover","stg:disabled:pointer-events-none stg:disabled:opacity-50"),children:"Cancel"})]})]})}var R=e.i(590150);function w({resource:e,resourceKindString:i,resourceKind:p,orgId:x,className:f}){let{accessList:h,isLoading:v,fetchError:b,revokeAccess:k,isRevoking:I,revokeError:N,refetch:S,hasGrantableRoles:C}=function(e){var t;let r=(0,s.useMemo)(()=>e?{kind:e.kind,id:e.id}:null,[e?.kind,e?.id]),{members:i,isLoading:a,isRefetching:l,error:o,refetch:p}=(0,g.useResourceAccess)(r),{roles:x,hasRoles:f}=(t=e?.resourceKind??null,(0,s.useMemo)(()=>null===t?{roles:[],hasRoles:!1}:{roles:(0,n.getGrantableRoles)(t),hasRoles:(0,n.hasGrantableRoles)(t)},[t])),{create:h,isCreating:v,error:b,clearError:y}=(0,u.useCreateIamPolicy)(),{remove:R,isDeleting:w,error:j,clearError:k}=(0,m.useDeleteIamPolicy)(),I=(0,s.useRef)(e);I.current=e;let N=(0,s.useCallback)(async(e,t)=>{let s=I.current;if(!s)return;let r=(0,c.create)(d.IamPolicySpecSchema,{principal:(0,c.create)(d.ApiResourceRefSchema,{kind:"identity_account",id:e}),resource:(0,c.create)(d.ApiResourceRefSchema,{kind:s.kind,id:s.id}),relation:t});await h(r),p()},[h,p]);return{accessList:i,isLoading:a,isRefetching:l,fetchError:o,grantableRoles:x,hasGrantableRoles:f,grantAccess:N,isGranting:v,grantError:b,revokeAccess:(0,s.useCallback)(async(e,t)=>{let s=I.current;if(!s)return;let r=(0,c.create)(d.IamPolicySpecSchema,{principal:(0,c.create)(d.ApiResourceRefSchema,{kind:"identity_account",id:e}),resource:(0,c.create)(d.ApiResourceRefSchema,{kind:s.kind,id:s.id}),relation:t});await R(r),p()},[R,p]),isRevoking:w,revokeError:j,refetch:p,clearErrors:(0,s.useCallback)(()=>{y(),k()},[y,k])}}(e),A=(0,o.useDeploymentMode)(),[M,K]=(0,s.useState)(!1);if("local"===A&&"organization"!==e.kind)return(0,t.jsxs)("p",{className:(0,r.cn)("stg:text-xs stg:text-muted-foreground",f),children:["This edition does not share ",i.replaceAll("_"," "),"s with individual people. Sharing with specific people is available in Stigmer Enterprise and Cloud."]});let T=h.map(e=>e.principal?.id).filter(e=>!!e),E={kind:i,id:e.id};return(0,t.jsxs)("div",{className:(0,r.cn)("stg:flex stg:flex-col stg:gap-4",f),children:[(0,t.jsxs)("div",{className:"stg:space-y-1",children:[(0,t.jsx)("p",{className:"stg:text-xs stg:text-muted-foreground",children:v?"Loading access list...":`${h.length} ${1===h.length?"person":"people"} with access`}),b&&(0,t.jsx)("p",{className:"stg:text-destructive stg:text-[0.65rem]",role:"alert",children:(0,l.getUserMessage)(b)}),!v&&h.length>0&&(0,t.jsx)("ul",{className:(0,r.cn)(a.UNSTYLED_LIST,"stg:space-y-1 stg:mt-2"),"aria-label":"People with access",children:h.map(e=>(0,t.jsx)(j,{entry:e,grantGate:E,onRevoke:k,isRevoking:I},e.principal?.id??"unknown"))}),N&&(0,t.jsx)("p",{className:"stg:text-destructive stg:text-[0.65rem]",role:"alert",children:(0,l.getUserMessage)(N)})]}),C&&(0,t.jsx)(R.PermissionGate,{resource:E,relation:"can_grant_access",children:(0,t.jsx)("div",{className:"stg:border-t stg:border-border stg:pt-3",children:M?(0,t.jsx)(y,{resourceKind:p,resourceKindString:i,resourceId:e.id,orgId:x,excludePrincipalIds:T,onGranted:()=>{K(!1),S()},onCancel:()=>K(!1)}):(0,t.jsx)("button",{type:"button",onClick:()=>K(!0),className:(0,r.cn)("stg:w-full stg:rounded-md stg:px-3 stg:py-1.5 stg:text-xs stg:font-medium stg:text-center","stg:border stg:border-dashed stg:border-border","stg:text-muted-foreground stg:hover:text-foreground stg:hover:border-foreground/30","stg:hover:bg-accent-hover stg:transition-colors"),children:"+ Add people"})})})]})}function j({entry:e,grantGate:i,onRevoke:n,isRevoking:a}){let l=e.principal,o=e.roles,c=l?.name||l?.email||l?.id||"Unknown",d=o[0]?.role,g=(0,s.useCallback)(async()=>{l?.id&&d?.code&&await n(l.id,d.code)},[l?.id,d?.code,n]);return(0,t.jsxs)("li",{className:"stg:flex stg:items-center stg:justify-between stg:gap-2 stg:rounded-md stg:px-2 stg:py-1.5 stg:hover:bg-accent-hover stg:group",children:[(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-2 stg:min-w-0",children:[(0,t.jsx)("div",{className:"stg:h-6 stg:w-6 stg:rounded-full stg:bg-muted stg:flex stg:items-center stg:justify-center stg:text-[0.6rem] stg:font-medium stg:text-muted-foreground stg:shrink-0","aria-hidden":"true",children:(l?.name?.[0]??l?.email?.[0]??"?").toUpperCase()}),(0,t.jsxs)("div",{className:"stg:min-w-0",children:[(0,t.jsx)("p",{className:"stg:text-xs stg:text-foreground stg:truncate",children:c}),l?.email&&l.name&&(0,t.jsx)("p",{className:"stg:text-[0.6rem] stg:text-muted-foreground stg:truncate",children:l.email})]})]}),(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-1.5 stg:shrink-0",children:[(0,t.jsx)("span",{className:"stg:text-[0.6rem] stg:text-muted-foreground stg:capitalize",children:d?.name??d?.code??"—"}),(0,t.jsx)(R.PermissionGate,{resource:i,relation:"can_grant_access",children:(0,t.jsx)("button",{type:"button",onClick:g,disabled:a,"aria-label":`Remove ${c}'s access`,className:(0,r.cn)("stg:rounded stg:p-0.5 stg:text-muted-foreground stg:opacity-0 stg:group-hover:opacity-100","stg:hover:text-destructive stg:hover:bg-destructive/10","stg:disabled:pointer-events-none stg:disabled:opacity-50","stg:transition-opacity"),children:(0,t.jsx)(k,{})})})]})]})}function k(){return(0,t.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M4 4l8 8M12 4l-8 8"})})}var I=e.i(388023);function N({title:e,description:s,children:r}){return(0,t.jsxs)("section",{className:"stg:px-6 stg:py-4",children:[(0,t.jsx)("h3",{className:"stg:text-xs stg:font-medium stg:text-muted-foreground",children:e}),s&&(0,t.jsx)("p",{className:"stg:mt-0.5 stg:text-[0.65rem] stg:text-muted-foreground",children:s}),(0,t.jsx)("div",{className:"stg:mt-2.5",children:r})]})}function S(){return(0,t.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M4 4l8 8M12 4l-8 8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}e.s(["ManageAccessDialog",0,function({open:e,onOpenChange:a,resource:l,visibility:o,extraSection:c}){let d=(0,s.useId)(),g=(0,s.useCallback)(()=>{a(!1)},[a]),u=(0,n.hasGrantableRoles)(l.kind);return(0,t.jsx)(i.DialogShell,{open:e,onOpenChange:a,width:"md","aria-labelledby":d,children:e&&(0,t.jsxs)("div",{className:"stg:flex stg:flex-col",children:[(0,t.jsxs)("div",{className:"stg:flex stg:items-start stg:justify-between stg:border-b stg:border-border stg:px-6 stg:py-4",children:[(0,t.jsxs)("div",{className:"stg:min-w-0",children:[(0,t.jsx)("h2",{id:d,className:"stg:text-base stg:font-semibold stg:text-foreground",children:"Manage access"}),l.name&&(0,t.jsx)("p",{className:"stg:mt-0.5 stg:truncate stg:text-xs stg:text-muted-foreground",children:l.name})]}),(0,t.jsx)("button",{type:"button",onClick:g,"aria-label":"Close",className:(0,r.cn)("stg:rounded-md stg:p-1 stg:text-muted-foreground","stg:hover:text-foreground stg:hover:bg-accent-hover","stg:focus:outline-none stg:focus:ring-2 stg:focus:ring-ring"),children:(0,t.jsx)(S,{})})]}),(0,t.jsxs)("div",{className:"stg:flex stg:flex-col stg:divide-y stg:divide-border",children:[o&&(0,t.jsx)(N,{title:"General access",description:"Who can find and open this resource.",children:(0,t.jsx)(I.ResourceVisibilityControl,{kind:o.kind,resourceId:l.id,visibility:o.current,org:o.org,onChanged:o.onChanged})}),u&&(0,t.jsx)(N,{title:"People with access",children:(0,t.jsx)(w,{resource:{kind:l.kindString,id:l.id,resourceKind:l.kind},resourceKindString:l.kindString,resourceKind:l.kind,orgId:l.org})}),c&&(0,t.jsx)(N,{title:c.title,description:c.description,children:c.content})]}),(0,t.jsx)("div",{className:"stg:flex stg:items-center stg:justify-end stg:border-t stg:border-border stg:px-6 stg:py-3",children:(0,t.jsx)("button",{type:"button",onClick:g,className:(0,r.cn)("stg:rounded-md stg:px-3 stg:py-1.5 stg:text-sm stg:font-medium","stg:bg-primary stg:text-primary-foreground stg:hover:bg-primary-hover","stg:focus:outline-none stg:focus:ring-2 stg:focus:ring-ring stg:focus:ring-offset-2"),children:"Done"})})]})})}],213149)},686311,e=>{"use strict";let t=(0,e.i(475254).default)("message-square",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]);e.s(["MessageSquare",0,t],686311)},705450,e=>{"use strict";var t=e.i(142245),s=e.i(57897),r=e.i(274217),i=e.i(971811),n=e.i(647767);function a(e,t,r,i){return t.$typeName==e.typeName&&r.$typeName==e.typeName&&(t===r||l((0,s.reflect)(e,t),(0,s.reflect)(e,r),i))}function l(e,s,l){if("google.protobuf.Any"===e.desc.typeName&&(null==l?void 0:l.unpackAny)==!0)return function(e,s,n){if(e.typeUrl!==s.typeUrl)return!1;let l=(0,i.anyUnpack)(e,n.registry),o=(0,i.anyUnpack)(s,n.registry);if(l&&o){let e=n.registry.getMessage(l.$typeName);if(e)return a(e,l,o,n)}return(0,t.scalarEquals)(r.ScalarType.BYTES,e.value,s.value)}(e.message,s.message,l);for(let t of e.fields)if(!o(t,e,s,l))return!1;return((null==l?void 0:l.unknown)!=!0||!!function(e,s,i){function n(e,t){var s;let r=null!=(s=e.getUnknown())?s:[];return t?r.filter(s=>!t.getExtensionFor(e.desc,s.no)):r}let a=n(e,i),l=n(s,i);if(a.length!=l.length)return!1;for(let e=0;e<a.length;e++){let s=a[e],i=l[e];if(s.no!=i.no||s.wireType!=i.wireType||!(0,t.scalarEquals)(r.ScalarType.BYTES,s.data,i.data))return!1}return!0}(e,s,l.registry))&&((null==l?void 0:l.extensions)!=!0||!!function(e,t,s){function r(e,t){var s;return(null!=(s=e.getUnknown())?s:[]).map(s=>t.getExtensionFor(e.desc,s.no)).filter(e=>void 0!=e).filter((e,t,s)=>s.indexOf(e)===t)}let i=r(e,s.registry),a=r(t,s.registry);if(i.length!=a.length||i.some(e=>!a.includes(e)))return!1;for(let r of i){let[i,a]=(0,n.createExtensionContainer)(r,(0,n.getExtension)(e.message,r)),[l]=(0,n.createExtensionContainer)(r,(0,n.getExtension)(t.message,r));if(!o(a,i,l,s))return!1}return!0}(e,s,l))}function o(e,s,r,i){if(!s.isSet(e)&&!r.isSet(e))return!0;if(!s.isSet(e)||!r.isSet(e))return!1;switch(e.fieldKind){case"scalar":return(0,t.scalarEquals)(e.scalar,s.get(e),r.get(e));case"enum":return s.get(e)===r.get(e);case"message":return l(s.get(e),r.get(e),i);case"map":{let n=s.get(e),a=r.get(e),o=[];for(let e of n.keys()){if(!a.has(e))return!1;o.push(e)}for(let e of a.keys())if(!n.has(e))return!1;for(let s of o){let r=n.get(s),o=a.get(s);if(r!==o)switch(e.mapKind){case"enum":return!1;case"message":if(!l(r,o,i))return!1;break;case"scalar":if(!(0,t.scalarEquals)(e.scalar,r,o))return!1}}break}case"list":{let n=s.get(e),a=r.get(e);if(n.size!=a.size)return!1;for(let s=0;s<n.size;s++){let r=n.get(s),o=a.get(s);if(r!==o)switch(e.listKind){case"enum":return!1;case"message":if(!l(r,o,i))return!1;break;case"scalar":if(!(0,t.scalarEquals)(e.scalar,r,o))return!1}}}}return!0}e.s(["equals",0,a])},37727,e=>{"use strict";let t=(0,e.i(475254).default)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);e.s(["X",0,t],37727)},284614,e=>{"use strict";let t=(0,e.i(475254).default)("user",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);e.s(["User",0,t],284614)}]);
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,65642,e=>{"use strict";var t=e.i(843476),s=e.i(893976);let r={primary:"stg:bg-primary stg:text-primary-foreground stg:hover:bg-primary-hover",outline:"stg:border stg:border-border stg:text-foreground stg:hover:bg-accent-hover",ghost:"stg:text-foreground stg:hover:bg-accent-hover",destructive:"stg:bg-destructive stg:text-destructive-foreground stg:hover:bg-destructive-hover"},n={xs:"stg:px-2.5 stg:py-1 stg:text-xs",sm:"stg:px-3 stg:py-1.5 stg:text-xs"};e.s(["Button",0,function({variant:e="primary",size:a="sm",icon:o,type:l="button",className:i,children:c,...d}){return(0,t.jsxs)("button",{type:l,className:(0,s.cn)("stg:inline-flex stg:items-center stg:gap-1 stg:rounded-md stg:font-medium stg:transition-colors","stg:motion-reduce:transition-none","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring","stg:disabled:pointer-events-none stg:disabled:opacity-50",n[a],r[e],i),...d,children:[o,c]})}])},541071,727612,e=>{"use strict";var t=e.i(475254);let s=(0,t.default)("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(["MoreHorizontal",0,s],541071);let r=(0,t.default)("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(["Trash2",0,r],727612)},431343,e=>{"use strict";let t=(0,e.i(475254).default)("play",[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]);e.s(["Play",0,t],431343)},495242,e=>{"use strict";let t=(0,e.i(475254).default)("pause",[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]]);e.s(["Pause",0,t],495242)},424089,e=>{"use strict";var t=e.i(843476),s=e.i(271645),r=e.i(893976),n=e.i(869803),a=e.i(610595),o=e.i(910304),l=e.i(65642);function i({tone:e,label:s}){return(0,t.jsx)("span",{className:(0,r.cn)("stg:inline-block stg:rounded stg:px-1.5 stg:py-0.5 stg:text-[10px] stg:font-medium","ok"===e&&"stg:bg-accent stg:text-primary","warn"===e&&"stg:bg-muted-subtle stg:text-destructive","muted"===e&&"stg:bg-muted-subtle stg:text-muted-foreground"),children:s})}var c=e.i(891287),d=e.i(988467),u=e.i(933221);function g({initial:e,isSubmitting:n,submitError:o,onSubmit:i,onCancel:m,className:h}){let x=null===e,[p,b]=(0,s.useState)(e?.displayName??""),[y,f]=(0,s.useState)(x?"":"***REDACTED***"),[j,v]=(0,s.useState)(e?.enabled??!0),[k,N]=(0,s.useState)(!e?.onDemandUsageDisabled),[C,w]=(0,s.useState)((e?.orgIds??[]).join("\n")),[S,A]=(0,s.useState)(e?.teamInviteLink??""),I=""!==p.trim()&&""!==y.trim()&&!n;return(0,t.jsxs)("form",{className:(0,r.cn)("stg:max-w-xl stg:space-y-3",h),onSubmit:t=>{t.preventDefault(),I&&i((0,c.create)(d.CursorAccountSchema,{accountId:e?.accountId??"",displayName:p.trim(),adminApiKey:y.trim(),enabled:j,onDemandUsageDisabled:!k,teamInviteLink:S.trim(),orgIds:C.split(/[\s,]+/).map(e=>e.trim()).filter(e=>""!==e)}))},children:[(0,t.jsx)("h3",{className:"stg:text-sm stg:font-semibold stg:text-foreground",children:x?"Add Cursor account":`Edit ${e.displayName}`}),(0,t.jsx)(u.Field,{label:"Display name",required:!0,children:(0,t.jsx)("input",{className:u.INPUT_CLASSES,value:p,onChange:e=>b(e.target.value),placeholder:"e.g. scenar.ai team",disabled:n})}),(0,t.jsx)(u.Field,{label:"Team Admin API key",required:!0,children:(0,t.jsx)("input",{className:u.INPUT_CLASSES,type:"password",value:y,onChange:e=>f(e.target.value),placeholder:"key from Cursor dashboard → API → Team tab",disabled:n,autoComplete:"off"})}),!x&&(0,t.jsx)("p",{className:"stg:text-[11px] stg:text-muted-foreground",children:"Leave the masked value untouched to keep the stored key; typing a new key rotates it (validated against Cursor before saving)."}),(0,t.jsx)(u.Field,{label:"Team invite link",children:(0,t.jsx)("input",{className:u.INPUT_CLASSES,type:"url",value:S,onChange:e=>A(e.target.value),placeholder:"https://… (Cursor dashboard → Invite Members → Copy Invite Link)",disabled:n,autoComplete:"off",spellCheck:!1})}),(0,t.jsx)("p",{className:"stg:text-[11px] stg:text-muted-foreground",children:'Optional. Powers one-click "Copy invite" on coverage rows whose key owner is not on the team. The link is long-lived and joinable by anyone holding it (each join consumes a paid seat) — share it deliberately, and revoke or rotate it from the Cursor dashboard. Leave empty to clear.'}),(0,t.jsx)(u.Field,{label:"Dedicated organization ids",children:(0,t.jsx)("textarea",{className:(0,r.cn)(u.INPUT_CLASSES,"stg:min-h-16 stg:font-mono"),value:C,onChange:e=>w(e.target.value),placeholder:"one org id per line\n(leave empty for a shared-pool account)",disabled:n})}),(0,t.jsx)("p",{className:"stg:text-[11px] stg:text-muted-foreground",children:"Listing org ids DEDICATES this account to them: their sessions use only this account's keys and fail with a clear message when it runs dry. Leaving this empty makes the account part of the shared pool that serves every other org — pool sessions may move between pool accounts when one is depleted. Each org may appear in at most one account."}),(0,t.jsxs)("div",{className:"stg:space-y-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{className:"stg:flex stg:items-center stg:gap-1.5 stg:text-xs stg:text-foreground",children:[(0,t.jsx)("input",{type:"checkbox",checked:j,onChange:e=>v(e.target.checked),disabled:n}),"Enabled for key selection"]}),(0,t.jsx)("p",{className:"stg:mt-0.5 stg:pl-[1.375rem] stg:text-[11px] stg:text-muted-foreground",children:"Leave checked for accounts that should serve traffic. Unchecking drains the account: new sessions stop routing here immediately, but sessions already pinned to one of its keys keep working."})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{className:"stg:flex stg:items-center stg:gap-1.5 stg:text-xs stg:text-foreground",children:[(0,t.jsx)("input",{type:"checkbox",checked:k,onChange:e=>N(e.target.checked),disabled:n}),"On-demand usage enabled (as configured in the Cursor dashboard)"]}),(0,t.jsx)("p",{className:"stg:mt-0.5 stg:pl-[1.375rem] stg:text-[11px] stg:text-muted-foreground",children:"Declared here because Cursor's Admin API cannot report the team's on-demand setting. Uncheck only when the dashboard has on-demand usage OFF: new sessions then avoid member keys whose included third-party (API) pool is nearly spent, since such keys can no longer serve third-party models at all."})]})]}),o&&(0,t.jsx)("p",{className:"stg:text-destructive stg:text-xs",role:"alert",children:(0,a.getUserMessage)(o)}),(0,t.jsxs)("div",{className:"stg:flex stg:gap-2",children:[(0,t.jsx)(l.Button,{type:"submit",size:"sm",disabled:!I,children:n?"Saving…":x?"Create account":"Save changes"}),(0,t.jsx)(l.Button,{type:"button",size:"sm",variant:"outline",onClick:m,disabled:n,children:"Cancel"})]})]})}function m({className:e}){return(0,t.jsxs)("div",{className:(0,r.cn)("stg:rounded-lg stg:border stg:border-border stg:bg-card stg:px-4 stg:py-6 stg:text-center",e),role:"status",children:[(0,t.jsx)("p",{className:"stg:text-xs stg:font-semibold stg:text-foreground",children:"Platform operator access required"}),(0,t.jsx)("p",{className:"stg:mx-auto stg:mt-1 stg:max-w-md stg:text-xs stg:text-muted-foreground",children:"Cursor account management is a Stigmer-internal surface holding provider credentials and team spend. It needs the platform operator role — organization roles do not grant it. If you believe you should have access, contact a platform operator."})]})}var h=e.i(40253);let x=BigInt(0);function p(e){let t=Number(e)/1e6;return`$${t.toFixed(2)}`}function b(e){return e&&e.seconds!==x?new Date(1e3*Number(e.seconds)).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"never"}function y(e){return`${Math.round(e)}%`}var f=e.i(326283),j=e.i(541071),v=e.i(495242),k=e.i(431343),N=e.i(727612),C=e.i(193799),w=e.i(845132),S=e.i(364802);let A="stg:grid stg:grid-cols-[minmax(0,1fr)_4rem_4rem_4.5rem_4.5rem_6rem_2.25rem] stg:items-center stg:gap-2 stg:px-3 stg:py-2";function I({accountId:e,coverage:s,inviteLink:n,actions:a,onChanged:o}){return(0,t.jsx)("div",{className:"stg:overflow-x-auto stg:rounded-lg stg:border stg:border-border stg:bg-card",children:(0,t.jsxs)("div",{role:"table","aria-label":"Team coverage",className:"stg:min-w-[40rem]",children:[(0,t.jsxs)("div",{role:"row",className:(0,r.cn)(A,"stg:border-b stg:border-border stg:text-[11px] stg:font-medium stg:text-muted-foreground"),children:[(0,t.jsx)("span",{role:"columnheader",children:"Member"}),(0,t.jsx)("span",{role:"columnheader",className:"stg:text-right",children:"First-party"}),(0,t.jsx)("span",{role:"columnheader",className:"stg:text-right",children:"API"}),(0,t.jsx)("span",{role:"columnheader",className:"stg:text-right",children:"Included"}),(0,t.jsx)("span",{role:"columnheader",className:"stg:text-right",children:"On-demand"}),(0,t.jsx)("span",{role:"columnheader",children:"Status"}),(0,t.jsx)("span",{role:"columnheader",children:(0,t.jsx)("span",{className:"stg:sr-only",children:"Actions"})})]}),!s.hasRoster&&(0,t.jsx)(T,{title:"Execution keys — not yet classified",description:'No roster sync has run for this account. Run "Sync now" to load the team roster and classify these keys.',count:s.unclassified.length,children:s.unclassified.map(s=>(0,t.jsx)(E,{accountId:e,keyView:s,hasRoster:!1,actions:a,onChanged:o},s.key?.keyId))}),s.onTeamWithKey.length>0&&(0,t.jsx)(T,{title:"On the team — key held",count:s.onTeamWithKey.length,children:s.onTeamWithKey.map(s=>(0,t.jsx)(E,{accountId:e,keyView:s,hasRoster:!0,actions:a,onChanged:o},s.key?.keyId))}),s.hasRoster&&(0,t.jsx)(T,{title:"On the team — no execution key",description:s.onTeamWithoutKey.length>0?"Sessions can never run under these members' identity or included quota. Add their user-scoped keys below to close the gap.":"Every active roster member holds an execution key — the roster is fully covered.",count:s.onTeamWithoutKey.length,children:s.onTeamWithoutKey.map(e=>(0,t.jsx)(_,{memberView:e},e.member?.email))}),s.offTeamWithKey.length>0&&(0,t.jsx)(T,{title:"Key held — not on the team",description:""!==n?"These key owners must join the Cursor team before their usage counts against its quota — copy the invite link, send it out-of-band, then “Sync now” reclassifies once they join.":"These key owners must join the Cursor team before their usage counts against its quota. Invites are sent from the Cursor dashboard (cursor.com → Invite Members); paste the team's invite link into the account editor to enable one-click copying here.",count:s.offTeamWithKey.length,action:""!==n?(0,t.jsx)(L,{inviteLink:n}):void 0,children:s.offTeamWithKey.map(s=>(0,t.jsx)(E,{accountId:e,keyView:s,hasRoster:!0,actions:a,onChanged:o},s.key?.keyId))})]})})}function T({title:e,description:s,count:r,action:n,children:a}){return(0,t.jsxs)("div",{role:"rowgroup",className:"stg:border-b stg:border-border stg:last:border-b-0",children:[(0,t.jsx)("div",{role:"row",className:"stg:bg-muted-subtle stg:px-3 stg:py-1.5",children:(0,t.jsxs)("div",{role:"cell","aria-colspan":7,className:"stg:flex stg:items-start stg:justify-between stg:gap-2",children:[(0,t.jsxs)("span",{className:"stg:min-w-0",children:[(0,t.jsxs)("span",{className:"stg:text-[11px] stg:font-semibold stg:text-foreground",children:[e,(0,t.jsx)("span",{className:"stg:ml-1.5 stg:font-normal stg:text-muted-foreground",children:r})]}),s&&(0,t.jsx)("span",{className:"stg:block stg:text-[11px] stg:text-muted-foreground",children:s})]}),n&&(0,t.jsx)("span",{className:"stg:shrink-0",children:n})]})}),a]})}function K({email:e,secondary:s}){return(0,t.jsxs)("span",{role:"cell",className:"stg:min-w-0",children:[(0,t.jsx)(S.TruncatedText,{text:e,className:"stg:font-medium stg:text-foreground"}),s&&(0,t.jsx)(S.TruncatedText,{text:s,className:"stg:text-[11px] stg:text-muted-foreground"})]})}function E({accountId:e,keyView:s,hasRoster:n,actions:a,onChanged:o}){let l=s.key;if(!l)return null;let c=[l.cursorKeyName||"unnamed key",l.label].filter(e=>""!==e).join(" · ");return(0,t.jsxs)("div",{role:"row",className:(0,r.cn)(A,"stg:border-t stg:border-border-muted stg:text-xs"),children:[(0,t.jsx)(K,{email:l.boundEmail,secondary:c}),(0,t.jsx)(M,{spend:s.spend}),(0,t.jsxs)("span",{role:"cell",className:"stg:flex stg:flex-wrap stg:items-center stg:gap-1",children:[s.usageGuardTripped&&(0,t.jsx)(i,{tone:"warn",label:"Usage guard"}),(0,t.jsx)(P,{keyView:s,hasRoster:n})]}),(0,t.jsx)("span",{role:"cell",className:"stg:text-right",children:(0,t.jsxs)(w.ActionMenu,{children:[(0,t.jsx)(w.ActionMenu.Trigger,{"aria-label":`Actions for ${l.boundEmail}`,children:(0,t.jsx)(j.MoreHorizontal,{className:"stg:size-4"})}),(0,t.jsxs)(w.ActionMenu.Content,{children:[(0,t.jsx)(w.ActionMenu.Item,{icon:l.enabled?(0,t.jsx)(v.Pause,{}):(0,t.jsx)(k.Play,{}),disabled:a.isSubmitting,onSelect:()=>{a.setKeyEnabled(e,l.keyId,!l.enabled).then(o,()=>{})},children:l.enabled?"Disable":"Enable"}),(0,t.jsx)(w.ActionMenu.Separator,{}),(0,t.jsx)(w.ActionMenu.Item,{icon:(0,t.jsx)(N.Trash2,{}),variant:"destructive",disabled:a.isSubmitting,onSelect:()=>{a.removeKey({accountId:e,keyId:l.keyId}).then(o,()=>{})},children:"Remove"})]})]})})]})}function _({memberView:e}){let s=e.member;return s?(0,t.jsxs)("div",{role:"row",className:(0,r.cn)(A,"stg:border-t stg:border-border-muted stg:text-xs"),children:[(0,t.jsx)(K,{email:s.email,secondary:s.name||void 0}),(0,t.jsx)(M,{spend:e.spend}),(0,t.jsx)("span",{role:"cell",children:(0,t.jsx)(i,{tone:"muted",label:"No key"})}),(0,t.jsx)("span",{role:"cell"})]}):null}function M({spend:e}){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{role:"cell",className:"stg:text-right stg:tabular-nums stg:text-muted-foreground",children:e?y(e.autoPercentUsed):"—"}),(0,t.jsx)("span",{role:"cell",className:"stg:text-right stg:tabular-nums stg:text-muted-foreground",children:e?y(e.apiPercentUsed):"—"}),(0,t.jsx)("span",{role:"cell",className:"stg:text-right stg:tabular-nums stg:text-muted-foreground",children:e?p(e.includedSpendUsdMicros):"—"}),(0,t.jsx)("span",{role:"cell",className:"stg:text-right stg:tabular-nums stg:text-muted-foreground",children:e?p(e.overageSpendUsdMicros):"—"})]})}function P({keyView:e,hasRoster:s}){return s?e.state===h.CursorMemberKeyState.member_key_owner_removed?(0,t.jsx)(i,{tone:"warn",label:"Left team"}):e.state===h.CursorMemberKeyState.member_key_owner_unknown?(0,t.jsx)(i,{tone:"muted",label:"Not on team"}):e.key?.enabled?(0,t.jsx)(i,{tone:"ok",label:"Active"}):(0,t.jsx)(i,{tone:"muted",label:"Disabled"}):(0,t.jsx)(i,{tone:"muted",label:"Awaiting sync"})}function L({inviteLink:e}){let{copy:s,copied:r}=(0,C.useCopyFeedback)();return(0,t.jsx)(l.Button,{size:"sm",variant:"outline",onClick:()=>void s(e),children:r?"Copied":"Copy invite"})}function U(e){return[...new Set(e.split(/\r?\n/).map(e=>e.trim()).filter(e=>""!==e))]}function D(e,t){return e.length>=8?`key ${t+1} (…${e.slice(-4)})`:`key ${t+1}`}function $({accountId:e,view:o,coverage:i,actions:c,onChanged:d,onImported:g}){let[m,h]=(0,s.useState)(""),[x,p]=(0,s.useState)(""),[b,y]=(0,s.useState)(!1),[j,v]=(0,s.useState)(""),[k,N]=(0,s.useState)(!1),[C,w]=(0,s.useState)(null),[S,A]=(0,s.useState)(null),T=o.keyViews,K=i.unclassified.length>0||i.onTeamWithKey.length>0||i.onTeamWithoutKey.length>0||i.offTeamWithKey.length>0,E=U(j).length,_=async t=>{t.preventDefault();let s=U(j);if(0===s.length||k)return;N(!0),A(null);let r=new Set(T.map(e=>e.key?.keyId).filter(e=>!!e)),n=[],o=[];for(let[t,l]of s.entries()){w({done:t,total:s.length});try{let s=(await c.addKey({accountId:e,apiKey:l})).memberKeys.find(e=>!r.has(e.keyId));s&&r.add(s.keyId),n.push({keyPreview:D(l,t),ok:!0,message:s?.boundEmail?`added — bound to ${s.boundEmail}`:"added"})}catch(e){c.clearError(),o.push(l),n.push({keyPreview:D(l,t),ok:!1,message:(0,a.getUserMessage)((0,f.toError)(e))})}}w(null),A(n),v(o.join("\n")),N(!1),o.length<s.length&&g()};return(0,t.jsxs)("section",{className:"stg:space-y-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h4",{className:"stg:text-xs stg:font-semibold stg:text-foreground",children:"Team coverage"}),i.hasRoster&&(0,t.jsxs)("p",{className:"stg:text-[11px] stg:text-muted-foreground",children:[i.onTeamWithKey.length," covered"," · ",(0,t.jsxs)("span",{className:(0,r.cn)(i.onTeamWithoutKey.length>0&&"stg:font-medium stg:text-destructive"),children:[i.onTeamWithoutKey.length," without keys"]}),i.offTeamWithKey.length>0?` \xb7 ${i.offTeamWithKey.length} off-team`:""]})]}),0===T.length&&(0,t.jsxs)("p",{className:"stg:text-xs stg:text-muted-foreground",role:"status",children:["No execution keys — this account is ",(0,t.jsx)("strong",{children:"not routable"}),". Add a member's user-scoped API key below."]}),K&&(0,t.jsx)(I,{accountId:e,coverage:i,inviteLink:o.account?.teamInviteLink??"",actions:c,onChanged:d}),c.error&&(0,t.jsx)("p",{className:"stg:text-destructive stg:text-xs",role:"alert",children:(0,a.getUserMessage)(c.error)}),(0,t.jsxs)("form",{className:"stg:flex stg:flex-wrap stg:items-end stg:gap-2",onSubmit:t=>{t.preventDefault(),""===m.trim()||c.isSubmitting||c.addKey({accountId:e,apiKey:m.trim(),label:x.trim()||void 0}).then(()=>{h(""),p(""),d()},()=>{})},children:[(0,t.jsxs)("label",{className:"stg:block stg:min-w-56 stg:flex-1 stg:space-y-1",children:[(0,t.jsx)("span",{className:"stg:text-[11px] stg:font-medium stg:text-muted-foreground",children:"User-scoped API key"}),(0,t.jsx)("input",{className:u.INPUT_CLASSES,type:"password",value:m,onChange:e=>h(e.target.value),placeholder:"the member's personal Cursor API key",disabled:c.isSubmitting,autoComplete:"off"})]}),(0,t.jsxs)("label",{className:"stg:block stg:min-w-40 stg:space-y-1",children:[(0,t.jsx)("span",{className:"stg:text-[11px] stg:font-medium stg:text-muted-foreground",children:"Label (optional)"}),(0,t.jsx)("input",{className:u.INPUT_CLASSES,value:x,onChange:e=>p(e.target.value),placeholder:"e.g. zane — prod",disabled:c.isSubmitting})]}),(0,t.jsx)(l.Button,{type:"submit",size:"sm",disabled:""===m.trim()||c.isSubmitting,children:c.isSubmitting?"Verifying…":"Add key"}),(0,t.jsx)(l.Button,{type:"button",size:"sm",variant:"outline",disabled:k,onClick:()=>{y(e=>!e),A(null)},children:b?"Hide import":"Import keys"})]}),b&&(0,t.jsxs)("form",{className:"stg:space-y-2 stg:rounded-md stg:border stg:border-border stg:bg-card stg:p-3",onSubmit:_,children:[(0,t.jsxs)("label",{className:"stg:block stg:space-y-1",children:[(0,t.jsx)("span",{className:"stg:text-[11px] stg:font-medium stg:text-muted-foreground",children:"Bulk import — one user-scoped API key per line"}),(0,t.jsx)("textarea",{className:(0,r.cn)(u.INPUT_CLASSES,"stg:min-h-24 stg:font-mono"),value:j,onChange:e=>v(e.target.value),placeholder:"key_...\nkey_...\nkey_...",disabled:k,autoComplete:"off",spellCheck:!1})]}),(0,t.jsx)("p",{className:"stg:text-[11px] stg:text-muted-foreground",children:"Each key is verified against Cursor and bound to its owning team member, one at a time. Lines that fail stay in the box so you can fix and retry them. A roster sync runs automatically afterwards, so the coverage table reflects current team membership."}),(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-2",children:[(0,t.jsx)(l.Button,{type:"submit",size:"sm",disabled:0===E||k,children:k&&C?`Importing ${C.done+1} of ${C.total}…`:E>0?`Import ${E} ${1===E?"key":"keys"}`:"Import keys"}),(0,t.jsx)(l.Button,{type:"button",size:"sm",variant:"outline",disabled:k,onClick:()=>{y(!1),v(""),A(null)},children:"Close"})]}),S&&(0,t.jsx)("ul",{role:"list","aria-label":"Import results",className:(0,r.cn)(n.UNSTYLED_LIST,"stg:space-y-0.5 stg:text-[11px]"),children:S.map(e=>(0,t.jsxs)("li",{className:e.ok?"stg:text-muted-foreground":"stg:text-destructive",children:[e.keyPreview,": ",e.message]},e.keyPreview))})]})]})}var W=e.i(586108),z=e.i(583093);function B(){let e=(0,W.useStigmer)(),[t,r]=(0,s.useState)(!1),[n,a]=(0,s.useState)(null);return{upsert:(0,s.useCallback)(async t=>{r(!0),a(null);try{return await e.cursorAccounts.upsertAccount({account:t})}catch(t){let e=(0,f.toError)(t);throw a(e),e}finally{r(!1)}},[e.cursorAccounts]),isSubmitting:t,error:n,clearError:(0,s.useCallback)(()=>a(null),[])}}function R({className:e}){let[i,c]=(0,s.useState)({phase:"list"}),d=function(){let e=(0,W.useStigmer)(),t=(void 0)??!0,{data:s,isLoading:r,isRefetching:n,error:a,refetch:o}=(0,z.useFetch)(t?()=>e.cursorAccounts.listAccounts():null,[t,e],null);return{accounts:s,isLoading:r,isRefetching:n,error:a,refetch:o}}(),u=(0,s.useCallback)(()=>c({phase:"list"}),[]);if(d.isLoading)return(0,t.jsxs)("div",{className:(0,r.cn)("stg:space-y-2",e),"aria-busy":"true",children:[(0,t.jsx)("div",{className:"stg:h-4 stg:w-40 stg:animate-pulse stg:rounded stg:bg-muted-subtle"}),Array.from({length:3},(e,s)=>(0,t.jsx)("div",{className:"stg:h-10 stg:animate-pulse stg:rounded-lg stg:bg-muted-subtle"},s))]});if(d.error)return(0,o.isPermissionDenied)(d.error)?(0,t.jsx)(m,{className:e}):(0,t.jsx)("p",{className:(0,r.cn)("stg:text-destructive stg:text-xs",e),role:"alert",children:(0,a.getUserMessage)(d.error)});if("create"===i.phase)return(0,t.jsx)(F,{className:e,onSaved:()=>{d.refetch(),u()},onCancel:u});if("detail"===i.phase)return(0,t.jsx)(O,{className:e,accountId:i.accountId,editing:i.editing,onEditingChange:e=>c({phase:"detail",accountId:i.accountId,editing:e}),onDeleted:()=>{d.refetch(),u()},onChanged:d.refetch,onBack:u});let g=d.accounts?.accounts??[],h=function(e){let t=0,s=0,r=0;for(let n of e)t+=n.routableKeyCount,r+=n.guardTrippedKeyCount,n.account?.enabled===!0&&n.enabledKeyCount>0&&0===n.routableKeyCount&&(s+=1);return{totalAccounts:e.length,totalRoutableKeys:t,drainedAccounts:s,guardTrippedKeys:r}}(g);return(0,t.jsxs)("div",{className:(0,r.cn)("stg:space-y-3",e),children:[(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:justify-between stg:gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"stg:text-sm stg:font-semibold stg:text-foreground",children:"Cursor accounts"}),g.length>0&&(0,t.jsxs)("p",{className:(0,r.cn)("stg:text-[11px]",0===h.totalRoutableKeys?"stg:text-destructive":"stg:text-muted-foreground"),role:0===h.totalRoutableKeys?"alert":void 0,children:[0===h.totalRoutableKeys?"No routable execution key anywhere - executions on API-pool models are failing":`${h.totalRoutableKeys} routable ${1===h.totalRoutableKeys?"key":"keys"} across ${h.totalAccounts} ${1===h.totalAccounts?"account":"accounts"}`,h.drainedAccounts>0?` \xb7 ${h.drainedAccounts} ${1===h.drainedAccounts?"account":"accounts"} drained`:"",h.guardTrippedKeys>0?` \xb7 ${h.guardTrippedKeys} ${1===h.guardTrippedKeys?"key":"keys"} usage-drained`:""]})]}),(0,t.jsx)(l.Button,{size:"sm",onClick:()=>c({phase:"create"}),children:"Add account"})]}),(0,t.jsxs)("div",{className:"stg:rounded-lg stg:border stg:border-border stg:bg-card",children:[(0,t.jsxs)("div",{"aria-hidden":"true",className:"stg:grid stg:grid-cols-[2fr_1fr_1fr_1fr_1fr] stg:gap-2 stg:border-b stg:border-border stg:px-3 stg:py-2 stg:text-[11px] stg:font-medium stg:text-muted-foreground",children:[(0,t.jsx)("span",{children:"Account"}),(0,t.jsx)("span",{children:"Orgs"}),(0,t.jsx)("span",{children:"Status"}),(0,t.jsx)("span",{children:"Routable keys"}),(0,t.jsx)("span",{className:"stg:text-right",children:"Last synced"})]}),0===g.length?(0,t.jsx)("p",{className:"stg:px-3 stg:py-2 stg:text-xs stg:text-muted-foreground",children:"No Cursor accounts yet. Add one with its team Admin API key, then add member execution keys to make it routable."}):(0,t.jsx)("ul",{role:"list","aria-label":"Cursor accounts",className:n.UNSTYLED_LIST,children:g.map(e=>(0,t.jsx)(V,{summary:e,onOpen:()=>c({phase:"detail",accountId:e.account?.accountId??"",editing:!1})},e.account?.accountId))})]})]})}function V({summary:e,onOpen:s}){let n=e.account;return n?(0,t.jsx)("li",{className:"stg:border-b stg:border-border stg:last:border-b-0",children:(0,t.jsxs)("button",{type:"button",onClick:s,className:(0,r.cn)("stg:grid stg:w-full stg:grid-cols-[2fr_1fr_1fr_1fr_1fr] stg:items-center stg:gap-2 stg:px-3 stg:py-2 stg:text-left stg:text-xs","stg:transition-colors stg:hover:bg-accent","stg:focus-visible:outline-none stg:focus-visible:ring-1 stg:focus-visible:ring-ring"),children:[(0,t.jsxs)("span",{className:"stg:min-w-0",children:[(0,t.jsx)("span",{className:"stg:block stg:truncate stg:font-medium stg:text-foreground",children:n.displayName}),0===n.orgIds.length&&(0,t.jsx)("span",{className:"stg:block stg:text-[11px] stg:text-muted-foreground",children:"shared pool"})]}),(0,t.jsx)("span",{className:"stg:text-muted-foreground",children:n.orgIds.length>0?n.orgIds.length:"—"}),(0,t.jsx)("span",{children:(0,t.jsx)(i,{tone:n.enabled?"ok":"muted",label:n.enabled?"Enabled":"Disabled"})}),(0,t.jsx)("span",{children:e.routableKeyCount>0?(0,t.jsxs)("span",{className:"stg:text-muted-foreground",children:[e.routableKeyCount," of ",e.enabledKeyCount]}):e.guardTrippedKeyCount>0?(0,t.jsx)(i,{tone:"warn",label:"Drained"}):(0,t.jsx)(i,{tone:"warn",label:"Not routable"})}),(0,t.jsx)("span",{className:"stg:text-right stg:text-muted-foreground",children:b(e.lastSyncedAt)})]})}):null}function F({className:e,onSaved:s,onCancel:r}){let{upsert:n,isSubmitting:a,error:o}=B();return(0,t.jsx)("div",{className:e,children:(0,t.jsx)(g,{initial:null,isSubmitting:a,submitError:o,onSubmit:e=>{n(e).then(s,()=>{})},onCancel:r})})}function O({className:e,accountId:n,editing:o,onEditingChange:i,onDeleted:c,onChanged:d,onBack:u}){let m,x=function(e){let t=(0,W.useStigmer)(),{data:s,isLoading:r,isRefetching:n,error:a,refetch:o}=(0,z.useFetch)(e?()=>t.cursorAccounts.getAccountView(e):null,[e,t],null);return{view:s,isLoading:r,isRefetching:n,error:a,refetch:o}}(n),{upsert:p,isSubmitting:y,error:j,clearError:v}=B(),{remove:k,isSubmitting:N,error:C}=function(){let e=(0,W.useStigmer)(),[t,r]=(0,s.useState)(!1),[n,a]=(0,s.useState)(null);return{remove:(0,s.useCallback)(async t=>{r(!0),a(null);try{return await e.cursorAccounts.deleteAccount(t)}catch(t){let e=(0,f.toError)(t);throw a(e),e}finally{r(!1)}},[e.cursorAccounts]),isSubmitting:t,error:n,clearError:(0,s.useCallback)(()=>a(null),[])}}(),{sync:w,isSyncing:S,error:A}=function(){let e=(0,W.useStigmer)(),[t,r]=(0,s.useState)(!1),[n,a]=(0,s.useState)(null);return{sync:(0,s.useCallback)(async t=>{r(!0),a(null);try{return await e.cursorAccounts.syncAccount(t)}catch(t){let e=(0,f.toError)(t);throw a(e),e}finally{r(!1)}},[e.cursorAccounts]),isSyncing:t,error:n,clearError:(0,s.useCallback)(()=>a(null),[])}}(),I=function(){let e=(0,W.useStigmer)(),[t,r]=(0,s.useState)(!1),[n,a]=(0,s.useState)(null),o=(0,s.useCallback)(async e=>{r(!0),a(null);try{return await e()}catch(t){let e=(0,f.toError)(t);throw a(e),e}finally{r(!1)}},[]),l=(0,s.useCallback)(t=>o(()=>e.cursorAccounts.addMemberKey(t)),[o,e.cursorAccounts]),i=(0,s.useCallback)(t=>o(()=>e.cursorAccounts.removeMemberKey(t)),[o,e.cursorAccounts]);return{addKey:l,removeKey:i,setKeyEnabled:(0,s.useCallback)((t,s,r)=>o(()=>e.cursorAccounts.setMemberKeyEnabled({accountId:t,keyId:s,enabled:r})),[o,e.cursorAccounts]),isSubmitting:t,error:n,clearError:(0,s.useCallback)(()=>a(null),[])}}(),T=(0,s.useCallback)(()=>{x.refetch(),d()},[x.refetch,d]),K=(0,s.useCallback)(()=>{w(n).then(T,T)},[w,n,T]);if(x.isLoading)return(0,t.jsxs)("div",{className:(0,r.cn)("stg:space-y-2",e),"aria-busy":"true",children:[(0,t.jsx)("div",{className:"stg:h-4 stg:w-40 stg:animate-pulse stg:rounded stg:bg-muted-subtle"}),(0,t.jsx)("div",{className:"stg:h-24 stg:animate-pulse stg:rounded-lg stg:bg-muted-subtle"})]});if(x.error||!x.view?.account)return(0,t.jsxs)("div",{className:(0,r.cn)("stg:space-y-2",e),children:[(0,t.jsx)("p",{className:"stg:text-destructive stg:text-xs",role:"alert",children:x.error?(0,a.getUserMessage)(x.error):"Account not found."}),(0,t.jsx)(l.Button,{size:"sm",variant:"outline",onClick:u,children:"Back to accounts"})]});let E=x.view,_=E.account,M=(m=void 0!==E.snapshot)?{hasRoster:m,onTeamWithKey:E.keyViews.filter(e=>e.state===h.CursorMemberKeyState.member_key_active),onTeamWithoutKey:E.membersWithoutKeysViews,offTeamWithKey:E.keyViews.filter(e=>e.state!==h.CursorMemberKeyState.member_key_active),unclassified:[]}:{hasRoster:m,onTeamWithKey:[],onTeamWithoutKey:[],offTeamWithKey:[],unclassified:E.keyViews},P=M.onTeamWithKey.length+M.onTeamWithoutKey.length,L=(E.snapshot?.members.length??0)-P;return o?(0,t.jsx)("div",{className:e,children:(0,t.jsx)(g,{initial:_,isSubmitting:y,submitError:j,onSubmit:e=>{p(e).then(()=>{T(),i(!1)},()=>{})},onCancel:()=>{v(),i(!1)}})}):(0,t.jsxs)("div",{className:(0,r.cn)("stg:space-y-4",e),children:[(0,t.jsxs)("div",{className:"stg:flex stg:flex-wrap stg:items-center stg:justify-between stg:gap-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"stg:text-sm stg:font-semibold stg:text-foreground",children:_.displayName}),(0,t.jsxs)("p",{className:"stg:text-[11px] stg:text-muted-foreground",children:[_.orgIds.length>0?`Dedicated to ${_.orgIds.length} org(s): ${_.orgIds.join(", ")}`:"Shared pool — serves every org with no dedicated account"," · ",_.enabled?"enabled":"disabled",_.onDemandUsageDisabled?" · on-demand usage off (usage guard active)":""," · synced ",b(E.snapshot?.syncedAt),M.hasRoster?` \xb7 ${P} ${1===P?"member":"members"}`:"",M.hasRoster&&L>0?` \xb7 ${L} removed ${1===L?"seat":"seats"}`:""]})]}),(0,t.jsxs)("div",{className:"stg:flex stg:gap-2",children:[(0,t.jsx)(l.Button,{size:"sm",variant:"outline",onClick:u,children:"Back"}),(0,t.jsx)(l.Button,{size:"sm",variant:"outline",disabled:S,onClick:()=>{w(n).then(T,()=>{})},children:S?"Syncing…":"Sync now"}),(0,t.jsx)(l.Button,{size:"sm",variant:"outline",onClick:()=>i(!0),children:"Edit"}),(0,t.jsx)(l.Button,{size:"sm",variant:"destructive",disabled:N,onClick:()=>{k({accountId:n}).then(c,()=>{})},children:N?"Deleting…":"Delete"})]})]}),A&&(0,t.jsx)("p",{className:"stg:text-destructive stg:text-xs",role:"alert",children:(0,a.getUserMessage)(A)}),C&&(0,t.jsx)("p",{className:"stg:text-destructive stg:text-xs",role:"alert",children:(0,a.getUserMessage)(C)}),E.snapshot?.syncError&&(0,t.jsxs)("p",{className:"stg:text-xs stg:text-muted-foreground",role:"status",children:["Last sync was partial: ",E.snapshot.syncError]}),(0,t.jsx)($,{accountId:n,view:E,coverage:M,actions:I,onChanged:T,onImported:K})]})}e.s(["default",0,function(){return(0,t.jsx)(R,{})}],424089)}]);
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,65642,t=>{"use strict";var e=t.i(843476),s=t.i(893976);let r={primary:"stg:bg-primary stg:text-primary-foreground stg:hover:bg-primary-hover",outline:"stg:border stg:border-border stg:text-foreground stg:hover:bg-accent-hover",ghost:"stg:text-foreground stg:hover:bg-accent-hover",destructive:"stg:bg-destructive stg:text-destructive-foreground stg:hover:bg-destructive-hover"},i={xs:"stg:px-2.5 stg:py-1 stg:text-xs",sm:"stg:px-3 stg:py-1.5 stg:text-xs"};t.s(["Button",0,function({variant:t="primary",size:n="sm",icon:g,type:o="button",className:a,children:l,...d}){return(0,e.jsxs)("button",{type:o,className:(0,s.cn)("stg:inline-flex stg:items-center stg:gap-1 stg:rounded-md stg:font-medium stg:transition-colors","stg:motion-reduce:transition-none","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring","stg:disabled:pointer-events-none stg:disabled:opacity-50",i[n],r[t],a),...d,children:[g,l]})}])},927056,t=>{"use strict";var e=t.i(843476),s=t.i(271645),r=t.i(893976);t.s(["Tabs",0,function({tabs:t,activeTab:i,onTabChange:n,children:g,"aria-label":o,className:a}){let l=(0,s.useId)(),d=(0,s.useRef)(new Map),u=t=>`${l}-tab-${t}`,c=t=>`${l}-panel-${t}`,b=(0,s.useCallback)(t=>{d.current.get(t)?.focus(),n(t)},[n]),x=(0,s.useCallback)(e=>{let s=t.findIndex(t=>t.id===i);if(-1===s)return;let r=null;switch(e.key){case"ArrowRight":r=(s+1)%t.length;break;case"ArrowLeft":r=(s-1+t.length)%t.length;break;case"Home":r=0;break;case"End":r=t.length-1;break;default:return}e.preventDefault(),b(t[r].id)},[t,i,b]);return(0,e.jsxs)("div",{className:(0,r.cn)("stg:flex stg:flex-col",a),children:[(0,e.jsx)("div",{role:"tablist","aria-label":o,onKeyDown:x,className:"stg:flex stg:border-b stg:border-border",children:t.map(t=>{let s=t.id===i;return(0,e.jsxs)("button",{ref:e=>{e?d.current.set(t.id,e):d.current.delete(t.id)},id:u(t.id),role:"tab",type:"button","aria-selected":s,"aria-controls":c(t.id),tabIndex:s?0:-1,onClick:()=>n(t.id),"data-cursor-target":`tab-${t.id}`,className:(0,r.cn)("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:[t.icon,t.label,null!=t.badge&&t.badge>0&&(0,e.jsx)("span",{"aria-hidden":"true",className:(0,r.cn)("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-[10px] stg:font-medium stg:leading-none",s?"stg:bg-primary-subtle stg:text-primary":"stg:bg-muted stg:text-muted-foreground"),children:t.badge}),s&&(0,e.jsx)("span",{className:"stg:absolute stg:inset-x-0 stg:-bottom-px stg:h-0.5 stg:bg-primary","aria-hidden":"true"})]},t.id)})}),(0,e.jsx)("div",{id:c(i),role:"tabpanel","aria-labelledby":u(i),tabIndex:0,className:"stg:min-h-0 stg:flex-1 stg:pt-4 stg:focus-visible:outline-none",children:g})]})}])}]);
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,348728,841358,e=>{"use strict";var t=e.i(843476),s=e.i(271645),n=e.i(893976),r=e.i(170255),o=e.i(336973),i=e.i(437241),l=e.i(586108),a=e.i(289677),g=e.i(230849),d=e.i(4144),c=e.i(610595),u=e.i(351240),m=e.i(188482);function x({tools:e,toolApprovals:r,enabledTools:o,onChange:i,disabled:l,className:a}){let c=(0,s.useId)(),u=(0,g.useScrollShadows)(),m=(0,s.useMemo)(()=>new Map(r.map(e=>[e.toolName,e.message])),[r]),h=(0,s.useMemo)(()=>new Set(o),[o]),v=(0,s.useCallback)(e=>{i(h.has(e)?o.filter(t=>t!==e):[...o,e])},[h,o,i]),f=(0,s.useCallback)(()=>{i(e.map(e=>e.name))},[e,i]),b=(0,s.useCallback)(()=>{i([])},[i]);return 0===e.length?(0,t.jsxs)("div",{className:(0,n.cn)("stg:space-y-1",a),children:[(0,t.jsx)("div",{className:"stg:text-[0.65rem] stg:font-medium stg:text-muted-foreground",children:"Tools"}),(0,t.jsxs)("div",{className:"stg:rounded-md stg:border stg:border-border stg:px-3 stg:py-4 stg:text-center",children:[(0,t.jsx)("p",{className:"stg:text-xs stg:text-muted-foreground",children:"Tools have not been discovered yet."}),(0,t.jsx)("p",{className:"stg:mt-1 stg:text-[0.65rem] stg:text-muted-foreground-subtle",children:"All tools will be enabled by default."})]})]}):(0,t.jsxs)("div",{className:(0,n.cn)("stg:space-y-1.5",a),children:[(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:justify-between",children:[(0,t.jsxs)("span",{className:"stg:text-[0.65rem] stg:font-medium stg:text-muted-foreground",children:["Tools (",e.length,")"]}),(0,t.jsxs)("span",{className:"stg:flex stg:items-center stg:gap-1",children:[(0,t.jsx)("button",{type:"button",onClick:f,disabled:l,className:(0,n.cn)("stg:rounded stg:px-1.5 stg:py-0.5 stg:text-[0.6rem] stg:font-medium","stg:text-muted-foreground stg:hover:text-foreground stg:hover:bg-accent-hover","stg:disabled:pointer-events-none stg:disabled:opacity-50"),children:"All"}),(0,t.jsx)("button",{type:"button",onClick:b,disabled:l,className:(0,n.cn)("stg:rounded stg:px-1.5 stg:py-0.5 stg:text-[0.6rem] stg:font-medium","stg:text-muted-foreground stg:hover:text-foreground stg:hover:bg-accent-hover","stg:disabled:pointer-events-none stg:disabled:opacity-50"),children:"None"})]})]}),(0,t.jsxs)("div",{className:"stg:relative",children:[u.canScrollUp&&(0,t.jsx)(d.ScrollFade,{position:"top"}),(0,t.jsx)("div",{ref:u.scrollRef,role:"group","aria-label":"MCP server tools",className:"stg:max-h-52 stg:space-y-0.5 stg:overflow-y-auto",children:e.map(e=>{let s=`${c}-tool-${e.name}`,r=e.description?`${s}-desc`:void 0,o=m.get(e.name),i=h.has(e.name);return(0,t.jsx)("div",{className:(0,n.cn)("stg:group stg:rounded-md stg:px-2 stg:py-1.5 stg:transition-colors",i?"stg:bg-accent-hover":"stg:hover:bg-accent-hover"),children:(0,t.jsxs)("label",{htmlFor:s,className:"stg:flex stg:cursor-pointer stg:items-start stg:gap-2",children:[(0,t.jsx)("input",{id:s,type:"checkbox",checked:i,onChange:()=>v(e.name),disabled:l,"aria-describedby":r,className:"stg:mt-0.5 stg:size-3 stg:shrink-0 stg:accent-primary stg:disabled:pointer-events-none stg:disabled:opacity-50"}),(0,t.jsxs)("span",{className:"stg:min-w-0 stg:flex-1",children:[(0,t.jsxs)("span",{className:"stg:flex stg:items-center stg:gap-1.5",children:[(0,t.jsx)("span",{className:"stg:truncate stg:font-mono stg:text-xs stg:text-foreground",children:e.name}),void 0!==o&&(0,t.jsx)(p,{message:o})]}),e.description&&(0,t.jsx)("span",{id:r,className:"stg:line-clamp-2 stg:group-hover:line-clamp-none stg:group-focus-within:line-clamp-none stg:text-[0.65rem] stg:leading-relaxed stg:text-muted-foreground",children:e.description})]})]})},e.name)})}),u.canScrollDown&&(0,t.jsx)(d.ScrollFade,{position:"bottom"})]})]})}function p({message:e}){return(0,t.jsxs)(m.Tooltip,{children:[(0,t.jsxs)(m.TooltipTrigger,{render:(0,t.jsx)("span",{className:"stg:inline-flex stg:shrink-0 stg:items-center stg:gap-0.5 stg:rounded stg:px-1 stg:py-0.5 stg:text-[0.6rem] stg:font-medium stg:leading-none stg:bg-warning/15 stg:text-warning"}),children:[(0,t.jsx)(h,{}),"Approval"]}),(0,t.jsx)(m.TooltipContent,{side:"top",children:e||"This tool requires approval before execution"})]})}function h(){return(0,t.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M8 1.5L2.5 4v4c0 3.5 2.5 5.5 5.5 7 3-1.5 5.5-3.5 5.5-7V4L8 1.5z"})})}var v=e.i(793907),f=e.i(168197);function b({mcpServer:e,credentials:r,oauthSignIn:o,discoveredTools:i,toolApprovals:l,enabledTools:a,onEnabledToolsChange:g,onBack:d,onSwitchToManual:m,onSwitchToOAuth:p,error:h,disabled:v,className:f}){let y=e.metadata?.name??e.metadata?.slug??"MCP Server",k=e.spec?.iconUrl,S=e.spec?.description,C=v||r?.isSubmitting,w=!!o&&("initiating"===o.phase||"awaiting-callback"===o.phase||"completing"===o.phase||"connecting"===o.phase),A=(0,s.useCallback)((e,t)=>{r?.onSubmit(e,t)},[r]);return(0,t.jsxs)("div",{className:(0,n.cn)("stg:space-y-3",f),role:"region","aria-label":`Configure ${y}`,children:[(0,t.jsxs)("div",{className:"stg:flex stg:items-start stg:gap-2",children:[(0,t.jsx)("button",{type:"button",onClick:d,disabled:r?.isSubmitting||w,className:(0,n.cn)("stg:mt-0.5 stg:shrink-0 stg:rounded stg:p-0.5","stg:text-muted-foreground stg:hover:text-foreground stg:hover:bg-accent-hover","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring","stg:disabled:pointer-events-none stg:disabled:opacity-50"),"aria-label":"Back to MCP server list",children:(0,t.jsx)(N,{})}),(0,t.jsxs)("div",{className:"stg:flex stg:min-w-0 stg:flex-1 stg:items-start stg:gap-2",children:[k&&(0,t.jsx)("img",{src:k,alt:"",width:16,height:16,className:"stg:mt-0.5 stg:size-4 stg:shrink-0 stg:rounded-sm stg:object-contain"}),(0,t.jsxs)("div",{className:"stg:min-w-0 stg:flex-1",children:[(0,t.jsx)("h3",{className:"stg:truncate stg:text-xs stg:font-medium stg:text-foreground",children:y}),S&&(0,t.jsx)("p",{className:"stg:line-clamp-2 stg:text-[0.65rem] stg:leading-relaxed stg:text-muted-foreground",children:S})]})]})]}),o&&(0,t.jsx)(j,{serverName:y,isConnected:o.isConnected,connectionHealth:o.connectionHealth,phase:o.phase,onSignIn:o.onSignIn,onDisconnect:o.onDisconnect,isDisconnecting:o.isDisconnecting,disconnectError:o.disconnectError,onClearDisconnectError:o.onClearDisconnectError,error:o.error,failedPhase:o.failedPhase,isOAuthStranded:o.isOAuthStranded,onClearError:o.onClearError,isVendorApprovalPending:o.isVendorApprovalPending,isVendorApprovalBlocked:o.isVendorApprovalBlocked,vendorApprovalDocsUrl:o.vendorApprovalDocsUrl,canBringOwnApp:o.canBringOwnApp,isOrgOAuthApp:o.isOrgOAuthApp,onBringOwnApp:o.onBringOwnApp,onRemoveOrgApp:o.onRemoveOrgApp,isRemovingOrgApp:o.isRemovingOrgApp,manualEntrySupported:o.manualEntrySupported,onSwitchToManual:m}),!o&&p&&(0,t.jsx)("button",{type:"button",onClick:p,className:"stg:text-[0.65rem] stg:text-muted-foreground stg:underline stg:decoration-muted-foreground/40 stg:underline-offset-2 stg:hover:text-foreground stg:hover:decoration-foreground",children:"Sign in with OAuth instead"}),r&&(0,t.jsx)(u.EnvVarForm,{variables:r.variables,onSubmit:A,isSubmitting:r.isSubmitting,disabled:v||w,title:"Credentials required",defaultSaveForFuture:r.defaultSaveForFuture,hideSaveToggle:r.hideSaveToggle,poolValues:r.poolValues,className:"stg:w-full"}),h&&(0,t.jsx)("div",{role:"alert",className:"stg:rounded-md stg:border stg:border-destructive/30 stg:bg-destructive-subtle stg:px-2.5 stg:py-2 stg:text-xs stg:text-destructive",children:(0,c.getUserMessage)(h)}),(0,t.jsx)(x,{tools:i,toolApprovals:l,enabledTools:a,onChange:g,disabled:!!C||!!r||w})]})}function j({serverName:e,isConnected:r,connectionHealth:i,phase:l,onSignIn:a,onDisconnect:g,isDisconnecting:d,disconnectError:u,onClearDisconnectError:m,error:x,failedPhase:p,isOAuthStranded:h,onClearError:b,isVendorApprovalPending:N,isVendorApprovalBlocked:k,vendorApprovalDocsUrl:S,canBringOwnApp:C,isOrgOAuthApp:w,onBringOwnApp:A,onRemoveOrgApp:E,isRemovingOrgApp:O,manualEntrySupported:T,onSwitchToManual:R}){let[D,L]=(0,s.useState)("idle"),[M,H]=(0,s.useState)("idle"),$=k??N,F="initiating"===l||"awaiting-callback"===l||"completing"===l||"connecting"===l,_=!!h,B=F||!!$&&!w&&!_,U=F||!!d||!!O,P=i===o.OAuthConnectionHealth.OAUTH_CONNECTION_HEALTH_TOKEN_EXPIRED,K=_?{textClass:"stg:text-amber-600 stg:dark:text-amber-400",dotClass:"stg:bg-amber-500",label:"Signed in — tools not discovered yet"}:function(e,t,s){if(s&&!t)return{textClass:"stg:text-amber-600 stg:dark:text-amber-400",dotClass:"stg:bg-amber-500",label:"Pending approval"};switch(e){case o.OAuthConnectionHealth.OAUTH_CONNECTION_HEALTH_HEALTHY:return{textClass:"stg:text-success",dotClass:"stg:bg-success",label:"Signed in"};case o.OAuthConnectionHealth.OAUTH_CONNECTION_HEALTH_TOKEN_EXPIRED_REFRESHABLE:return{textClass:"stg:text-amber-600 stg:dark:text-amber-400",dotClass:"stg:bg-amber-500",label:"Token expired"};case o.OAuthConnectionHealth.OAUTH_CONNECTION_HEALTH_TOKEN_EXPIRED:return{textClass:"stg:text-destructive",dotClass:"stg:bg-destructive",label:"Re-auth needed"};default:return{textClass:"stg:text-muted-foreground",dotClass:"stg:bg-muted-foreground",label:"Sign-in required"}}}(i,r,!!N&&!w),I=r&&g&&!U&&"idle"===D,V=w&&E&&!U&&"idle"===M;return"confirming"===D||"disconnecting"===D?(0,t.jsxs)("div",{className:"stg:space-y-1.5",children:[(0,t.jsx)("p",{className:"stg:text-[0.65rem] stg:text-foreground",children:"Remove credentials? You can reconnect at any time."}),(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-1.5",children:[(0,t.jsxs)("button",{type:"button",disabled:!!d,onClick:async()=>{if(g){L("disconnecting");try{await g(),L("idle")}catch{L("confirming")}}},className:(0,n.cn)("stg:inline-flex stg:items-center stg:gap-1 stg:rounded stg:px-2 stg:py-0.5 stg:text-[0.65rem] stg:font-medium","stg:bg-destructive stg:text-destructive-foreground stg:hover:bg-destructive-hover","stg:disabled:pointer-events-none stg:disabled:opacity-50"),children:[d&&(0,t.jsx)(y,{}),"Disconnect"]}),(0,t.jsx)("button",{type:"button",disabled:!!d,onClick:()=>{L("idle"),m?.()},className:(0,n.cn)("stg:inline-flex stg:items-center stg:rounded stg:px-2 stg:py-0.5 stg:text-[0.65rem] stg:font-medium","stg:text-muted-foreground stg:hover:text-foreground stg:hover:bg-accent-hover","stg:disabled:pointer-events-none stg:disabled:opacity-50"),children:"Cancel"})]}),u&&(0,t.jsxs)("div",{className:"stg:flex stg:items-start stg:gap-1.5 stg:text-[0.65rem] stg:text-destructive",role:"alert",children:[(0,t.jsx)("span",{className:"stg:flex-1",children:(0,c.getUserMessage)(u)}),(0,t.jsx)("button",{type:"button",onClick:()=>m?.(),className:"stg:shrink-0 stg:underline stg:underline-offset-2 stg:hover:no-underline",children:"Dismiss"})]})]}):"confirming"===M||"removing"===M?(0,t.jsxs)("div",{className:"stg:space-y-1.5",children:[(0,t.jsx)("p",{className:"stg:text-[0.65rem] stg:text-foreground",children:"Remove your custom OAuth app? The server will revert to the platform's app."}),(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-1.5",children:[(0,t.jsxs)("button",{type:"button",disabled:!!O,onClick:async()=>{if(E){H("removing");try{await E(),H("idle")}catch{H("confirming")}}},className:(0,n.cn)("stg:inline-flex stg:items-center stg:gap-1 stg:rounded stg:px-2 stg:py-0.5 stg:text-[0.65rem] stg:font-medium","stg:bg-destructive stg:text-destructive-foreground stg:hover:bg-destructive-hover","stg:disabled:pointer-events-none stg:disabled:opacity-50"),children:[O&&(0,t.jsx)(y,{}),"Remove"]}),(0,t.jsx)("button",{type:"button",disabled:!!O,onClick:()=>H("idle"),className:(0,n.cn)("stg:inline-flex stg:items-center stg:rounded stg:px-2 stg:py-0.5 stg:text-[0.65rem] stg:font-medium","stg:text-muted-foreground stg:hover:text-foreground stg:hover:bg-accent-hover","stg:disabled:pointer-events-none stg:disabled:opacity-50"),children:"Cancel"})]})]}):(0,t.jsxs)("div",{className:"stg:space-y-1.5",children:[(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:justify-between",children:[(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-1.5",children:[(0,t.jsxs)("span",{className:(0,n.cn)("stg:inline-flex stg:items-center stg:gap-1 stg:text-[0.65rem] stg:font-medium",K.textClass),children:[(0,t.jsx)("span",{className:(0,n.cn)("stg:size-1.5 stg:rounded-full",K.dotClass),"aria-hidden":"true"}),K.label]}),w&&r&&(0,t.jsx)("span",{className:"stg:text-[0.6rem] stg:text-muted-foreground",children:"Your app"}),I&&(0,t.jsx)("button",{type:"button",onClick:()=>L("confirming"),className:"stg:text-[0.65rem] stg:text-muted-foreground stg:underline stg:decoration-muted-foreground/40 stg:underline-offset-2 stg:hover:text-foreground stg:hover:decoration-foreground",children:"Disconnect"}),V&&(0,t.jsx)("button",{type:"button",onClick:()=>H("confirming"),className:"stg:text-[0.65rem] stg:text-muted-foreground stg:underline stg:decoration-muted-foreground/40 stg:underline-offset-2 stg:hover:text-foreground stg:hover:decoration-foreground",children:"Remove custom app"})]}),(0,t.jsx)("button",{type:"button",onClick:a,disabled:B,className:(0,n.cn)("stg:inline-flex stg:items-center stg:gap-1 stg:rounded stg:px-2 stg:py-0.5 stg:text-[0.65rem] stg:font-medium",!r||P||_?"stg:bg-primary stg:text-primary-foreground stg:hover:bg-primary-hover":"stg:text-muted-foreground stg:hover:text-foreground stg:hover:bg-accent-hover","stg:disabled:pointer-events-none stg:disabled:opacity-50"),children:F?(0,t.jsx)(y,{}):_?"Discover tools":w&&!r?"Sign in with your app":r&&!P?"Re-authenticate":P?"Sign in to reconnect":`Sign in with ${e}`})]}),!r&&!w&&(0,t.jsx)(v.VendorApprovalBlockedNotice,{blocked:!!$,pending:!!N,manualEntrySupported:T??!!R,canBringOwnApp:!!(C&&A),docsUrl:S??null,onBringOwnApp:A,compact:!0}),w&&!r&&(0,t.jsx)("span",{className:"stg:text-[0.6rem] stg:text-muted-foreground",children:"Using your OAuth app"}),x&&(0,t.jsxs)("div",{className:"stg:flex stg:items-start stg:gap-1.5 stg:text-[0.65rem] stg:text-destructive",role:"alert",children:[(0,t.jsx)("span",{className:"stg:flex-1",children:(0,f.getOAuthConnectErrorMessage)(x,p??null)}),(0,t.jsxs)("div",{className:"stg:flex stg:shrink-0 stg:items-center stg:gap-1.5",children:[(0,c.isRetryableError)(x)&&(0,t.jsx)("button",{type:"button",onClick:()=>{b(),a()},className:"stg:font-medium stg:underline stg:underline-offset-2 stg:hover:no-underline",children:"Try again"}),(0,t.jsx)("button",{type:"button",onClick:b,className:"stg:underline stg:underline-offset-2 stg:hover:no-underline",children:"Dismiss"})]})]}),!r&&!F&&(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-2",children:[R&&(0,t.jsx)("button",{type:"button",onClick:R,className:"stg:text-[0.65rem] stg:text-muted-foreground stg:underline stg:decoration-muted-foreground/40 stg:underline-offset-2 stg:hover:text-foreground stg:hover:decoration-foreground",children:"Enter token manually"}),C&&A&&!$&&(0,t.jsx)("button",{type:"button",onClick:A,className:"stg:text-[0.65rem] stg:text-muted-foreground stg:underline stg:decoration-muted-foreground/40 stg:underline-offset-2 stg:hover:text-foreground stg:hover:decoration-foreground",children:"Use your own OAuth app"})]})]})}function y(){return(0,t.jsx)("svg",{width:"10",height:"10",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"})})}function N(){return(0,t.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M10 3L5 8l5 5"})})}var k=e.i(862645),S=e.i(254450);function C(e){var t;return t=e.mcpServerRef,`${t.org}/${t.slug}`}function w(e){let t=e.indexOf("/");return{org:e.slice(0,t),slug:e.slice(t+1),kind:r.ApiResourceKind.mcp_server}}function A({slug:e,onRemove:s,disabled:n}){return(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-2 stg:rounded-md stg:bg-muted-faint stg:px-2 stg:py-1 stg:text-xs",children:[(0,t.jsx)(D,{}),(0,t.jsx)("span",{className:"stg:min-w-0 stg:flex-1 stg:truncate stg:text-foreground",children:e}),(0,t.jsx)("button",{type:"button",onClick:s,disabled:n,className:"stg:shrink-0 stg:text-muted-foreground stg:hover:text-destructive stg:disabled:pointer-events-none","aria-label":`Remove ${e}`,children:(0,t.jsx)(L,{})})]})}function E({serverKey:e,entry:s,onConfigure:r,onRetry:o,onRemove:i,disabled:l}){let a,g=(a=e.indexOf("/"),e.slice(a+1)),d="submitting"===s.status,c=null!=s.error;return(0,t.jsxs)("div",{className:"stg:space-y-1",children:[(0,t.jsxs)("div",{className:(0,n.cn)("stg:flex stg:items-center stg:gap-2 stg:rounded-md stg:px-2 stg:py-1 stg:text-xs",c?"stg:bg-destructive-subtle":"stg:bg-muted-faint"),children:[(0,t.jsx)(O,{status:s.status,hasError:c}),(0,t.jsx)("span",{className:"stg:min-w-0 stg:flex-1 stg:truncate stg:text-foreground",children:g}),"loading"===s.status&&!c&&(0,t.jsx)("span",{className:"stg:shrink-0 stg:text-[0.6rem] stg:text-muted-foreground",children:"Loading…"}),"loading"===s.status&&c&&(0,t.jsx)("button",{type:"button",onClick:o,disabled:l,className:(0,n.cn)("stg:shrink-0 stg:rounded stg:px-1.5 stg:py-0.5 stg:text-[0.6rem] stg:font-medium","stg:text-destructive stg:hover:bg-destructive-subtle","stg:disabled:pointer-events-none stg:disabled:opacity-50"),children:"Retry"}),"needsSetup"===s.status&&(0,t.jsx)("button",{type:"button",onClick:r,disabled:l,className:(0,n.cn)("stg:shrink-0 stg:rounded stg:px-1.5 stg:py-0.5 stg:text-[0.6rem] stg:font-medium","stg:text-warning stg:hover:bg-warning/10","stg:disabled:pointer-events-none stg:disabled:opacity-50"),"aria-label":`Configure ${g}`,children:"Configure"}),d&&(0,t.jsx)("span",{className:"stg:shrink-0 stg:text-[0.6rem] stg:text-muted-foreground",children:"Saving…"}),"ready"===s.status&&(0,t.jsxs)("button",{type:"button",onClick:r,disabled:l,className:(0,n.cn)("stg:shrink-0 stg:flex stg:items-center stg:gap-0.5 stg:rounded stg:px-1.5 stg:py-0.5 stg:text-[0.6rem] stg:font-medium","stg:text-muted-foreground stg:hover:text-foreground stg:hover:bg-accent-hover","stg:disabled:pointer-events-none stg:disabled:opacity-50"),"aria-label":`Configure ${g}`,children:[s.discoveredTools.length>0&&(0,t.jsxs)("span",{children:[s.enabledTools.length,"/",s.discoveredTools.length," tools"]}),(0,t.jsx)(M,{})]}),(0,t.jsx)("button",{type:"button",onClick:i,disabled:l||d,className:"stg:shrink-0 stg:text-muted-foreground stg:hover:text-destructive stg:disabled:pointer-events-none stg:disabled:opacity-50","aria-label":`Remove ${g}`,children:(0,t.jsx)(L,{})})]}),c&&"loading"===s.status&&(0,t.jsx)("p",{className:"stg:px-2 stg:text-[0.6rem] stg:leading-relaxed stg:text-destructive stg:line-clamp-2",children:s.error.message})]})}function O({status:e,hasError:s}){if(s)return(0,t.jsx)("span",{className:"stg:inline-block stg:size-2 stg:shrink-0 stg:rounded-full stg:bg-destructive","aria-label":"Error"});switch(e){case"loading":case"submitting":return(0,t.jsx)(H,{});case"needsSetup":return(0,t.jsx)("span",{className:"stg:inline-block stg:size-2 stg:shrink-0 stg:rounded-full stg:bg-warning","aria-label":"Needs setup"});case"ready":return(0,t.jsx)("span",{className:"stg:inline-block stg:size-2 stg:shrink-0 stg:rounded-full stg:bg-emerald-500","aria-label":"Ready"})}}function T({text:e,query:s}){if(!s)return(0,t.jsx)(t.Fragment,{children:e});let n=e.toLowerCase().indexOf(s.toLowerCase());return -1===n?(0,t.jsx)(t.Fragment,{children:e}):(0,t.jsxs)(t.Fragment,{children:[e.slice(0,n),(0,t.jsx)("span",{className:"stg:font-semibold",children:e.slice(n,n+s.length)}),e.slice(n+s.length)]})}function R(){return(0,t.jsx)("div",{className:"stg:space-y-1 stg:py-1",children:[60,75,50,68].map((e,s)=>(0,t.jsxs)("div",{className:"stg:flex stg:flex-col stg:gap-1 stg:px-2 stg:py-1.5",children:[(0,t.jsx)("div",{className:"stg:h-3 stg:rounded stg:bg-muted stg:animate-pulse",style:{width:`${e}%`}}),(0,t.jsx)("div",{className:"stg:h-2 stg:rounded stg:bg-muted-subtle stg:animate-pulse",style:{width:`${Math.min(e+15,90)}%`}})]},s))})}function D(){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:"stg:shrink-0 stg:text-muted-foreground","aria-hidden":"true",children:[(0,t.jsx)("rect",{x:"2",y:"2",width:"12",height:"4",rx:"1"}),(0,t.jsx)("rect",{x:"2",y:"10",width:"12",height:"4",rx:"1"}),(0,t.jsx)("circle",{cx:"5",cy:"4",r:"0.75",fill:"currentColor",stroke:"none"}),(0,t.jsx)("circle",{cx:"5",cy:"12",r:"0.75",fill:"currentColor",stroke:"none"})]})}function L(){return(0,t.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M4 4L10 10M10 4L4 10"})})}function M(){return(0,t.jsx)("svg",{width:"10",height:"10",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:"M6 4l4 4-4 4"})})}function H(){return(0,t.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",className:"stg:shrink-0 stg:animate-spin stg:text-muted-foreground","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M8 2a6 6 0 1 0 6 6"})})}function $(e){return`${e.org}/${e.slug}`}e.s(["McpServerPicker",0,function({org:e,scope:c,value:u,onChange:m,onDisplayNameResolved:x,disabled:p,className:h,setup:v,initialServerKey:j,poolValues:y,activeOrg:N}){var O;let L,M,H=(0,s.useId)(),$=`${H}-list`,[F,_]=(0,s.useState)(c??"org"),{results:B,isLoading:U,error:P,query:K,setQuery:I}=(O={scope:F},L=(0,l.useStigmer)(),M=(0,s.useCallback)(e=>L.mcpServer.list(e),[L]),(0,a.useResourceSearch)(M,e,O)),V=(0,f.useMcpServerOAuthConnect)(),W=(0,k.useMcpServerConnect)(),[z,q]=(0,s.useState)(null),[X,Y]=(0,s.useState)(-1),[G,J]=(0,s.useState)(()=>j?{type:"configure",serverKey:j}:{type:"list"}),[Q,Z]=(0,s.useState)(()=>new Set),ee=(0,s.useRef)(null),et=(0,g.useScrollShadows)(),es=(0,g.useScrollShadows)(),en=(0,s.useMemo)(()=>new Set(v?Object.keys(v.entries):(u??[]).map(C)),[v,u]),er=en.size,eo=(0,s.useMemo)(()=>B.filter(e=>!en.has(`${e.org}/${e.slug}`)),[B,en]);(0,s.useEffect)(()=>{"configure"!==G.type||v&&G.serverKey in v.entries||J({type:"list"})},[G,v]),(0,s.useEffect)(()=>{Y(-1)},[K]),(0,s.useEffect)(()=>{X>=0&&et.scrollRef.current?.querySelector(`[data-idx="${X}"]`)?.scrollIntoView({block:"nearest"})},[X,et.scrollRef]);let ei=(0,s.useCallback)(e=>{let t={org:e.org,slug:e.slug,kind:r.ApiResourceKind.mcp_server};v?v.onServerAdded(t):m?.([...u??[],{mcpServerRef:t}]),x?.(`${e.org}/${e.slug}`,e.name)},[v,u,m,x]),el=(0,s.useCallback)(e=>{"configure"===G.type&&G.serverKey===e&&J({type:"list"}),v?v.onServerRemoved(w(e)):m?.((u??[]).filter(t=>C(t)!==e))},[v,u,m,G]),ea=(0,s.useCallback)(e=>{"ArrowDown"===e.key?(e.preventDefault(),Y(e=>e<eo.length-1?e+1:e)):"ArrowUp"===e.key?(e.preventDefault(),Y(e=>e>0?e-1:-1)):"Enter"===e.key&&X>=0&&X<eo.length?(e.preventDefault(),ei(eo[X])):"Enter"===e.key&&e.preventDefault()},[eo,X,ei]);if("configure"===G.type&&v){let s=v.entries[G.serverKey];if(!s||"loading"===s.status)return J({type:"list"}),null;let r=w(G.serverKey),l="needsSetup"===s.status||"submitting"===s.status,a=s.mcpServer.spec?.auth,g=a?.targetEnvVar||null,d=!!a,c=!a?.oauthOnly,u=Q.has(G.serverKey),m="needsSetup"===s.status?s.missingVariables:[],x=g&&!u?m.filter(e=>e.key!==g):m,f=x.length>0,j=!!g&&m.some(e=>e.key===g),k=s.mcpServer.status?.oauthStatus,S=d&&k?.vendorApprovalStatus===i.VendorApprovalStatus.PENDING,C=d&&(k?.vendorApprovalStatus===i.VendorApprovalStatus.PENDING||k?.vendorApprovalStatus===i.VendorApprovalStatus.REJECTED),A=Object.keys(s.mcpServer.spec?.env??{}),E=z===G.serverKey,O=E?V.error:null,T=E?V.failedPhase:null,R=E?W.error:null,D="connecting"===T,L=s.oauthConnectionHealth===o.OAuthConnectionHealth.OAUTH_CONNECTION_HEALTH_HEALTHY||s.oauthConnectionHealth===o.OAuthConnectionHealth.OAUTH_CONNECTION_HEALTH_TOKEN_EXPIRED_REFRESHABLE,M=D||d&&"ready"===s.status&&L&&0===s.discoveredTools.length,H=d&&!u?{onSignIn:async()=>{if(!s.mcpServer.metadata?.id)return;let t=s.mcpServer.metadata.id,n=N??e;if(q(G.serverKey),M){try{await W.connect(t,n,void 0,A),V.clearError(),v.onServerAdded(r)}catch{}return}try{await V.startOAuth(t,n,A),v.onServerAdded(r)}catch{}},phase:W.isConnecting&&E?"connecting":V.phase,isConnected:!j,connectionHealth:s.oauthConnectionHealth,error:O??R,failedPhase:O?T:R?"connecting":null,isOAuthStranded:M,onClearError:()=>{V.clearError(),W.clearError()},isVendorApprovalPending:S,isVendorApprovalBlocked:C,vendorApprovalDocsUrl:k?.vendorApprovalDocsUrl||null,manualEntrySupported:c}:void 0,$=d&&c?()=>{Z(e=>{let t=new Set(e);return t.add(G.serverKey),t})}:void 0,F=d&&u?()=>{Z(e=>{let t=new Set(e);return t.delete(G.serverKey),t})}:void 0;return(0,t.jsx)("div",{className:(0,n.cn)("stg:w-72",h),children:(0,t.jsx)(b,{mcpServer:s.mcpServer,oauthSignIn:H,credentials:l&&f?{variables:x,onSubmit:(e,t)=>v.onSubmitEnvVars(r,e,t),isSubmitting:"submitting"===s.status,poolValues:y}:void 0,onSwitchToManual:$,onSwitchToOAuth:F,discoveredTools:s.discoveredTools,toolApprovals:s.toolApprovals,enabledTools:"ready"===s.status?s.enabledTools:s.discoveredTools.map(e=>e.name),onEnabledToolsChange:e=>v.onEnabledToolsChange(r,e),onBack:()=>J({type:"list"}),error:s.error,disabled:p})})}return(0,t.jsxs)("div",{className:(0,n.cn)("stg:space-y-2 stg:w-72",h),children:[er>0&&(0,t.jsxs)("div",{className:"stg:space-y-1",children:[(0,t.jsx)("div",{className:"stg:text-[0.65rem] stg:font-medium stg:text-muted-foreground",children:"Selected"}),(0,t.jsxs)("div",{className:"stg:relative",children:[es.canScrollUp&&(0,t.jsx)(d.ScrollFade,{position:"top"}),(0,t.jsx)("div",{ref:es.scrollRef,className:"stg:max-h-28 stg:space-y-1 stg:overflow-y-auto",children:v?Object.entries(v.entries).map(([e,s])=>(0,t.jsx)(E,{serverKey:e,entry:s,onConfigure:()=>J({type:"configure",serverKey:e}),onRetry:()=>v.onServerAdded(w(e)),onRemove:()=>el(e),disabled:p},e)):(u??[]).map(e=>{let s=C(e);return(0,t.jsx)(A,{slug:e.mcpServerRef.slug,onRemove:()=>el(s),disabled:p},s)})}),es.canScrollDown&&(0,t.jsx)(d.ScrollFade,{position:"bottom"})]})]}),(0,t.jsx)("input",{ref:ee,type:"text",role:"combobox","aria-expanded":!0,"aria-controls":$,"aria-activedescendant":X>=0?`${H}-opt-${X}`:void 0,placeholder:"Search MCP servers...",value:K,onChange:e=>I(e.target.value),onKeyDown:ea,disabled:p,className:"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-2 stg:focus-visible:ring-ring stg:disabled:pointer-events-none stg:disabled:opacity-50",autoFocus:!0}),(0,t.jsx)(S.ScopeToggle,{value:F,onChange:_,disabled:p}),P&&(0,t.jsx)("p",{className:"stg:text-xs stg:text-destructive",children:P.message}),(0,t.jsxs)("div",{className:"stg:relative",children:[et.canScrollUp&&(0,t.jsx)(d.ScrollFade,{position:"top"}),(0,t.jsx)("div",{ref:et.scrollRef,id:$,role:"listbox","aria-label":"MCP Servers",className:"stg:max-h-52 stg:overflow-y-auto",children:U?(0,t.jsx)(R,{}):0===eo.length?(0,t.jsx)("div",{className:"stg:py-4 stg:text-center stg:text-xs stg:text-muted-foreground",children:K?"No MCP servers match your search":er>0?"All available servers selected":"No MCP servers found"}):eo.map((e,s)=>(0,t.jsxs)("button",{id:`${H}-opt-${s}`,type:"button","data-idx":s,onClick:()=>ei(e),disabled:p,className:(0,n.cn)("stg:group stg:flex stg:w-full stg:flex-col stg:gap-0.5 stg:rounded-md stg:px-2 stg:py-1.5 stg:text-left stg:text-xs stg:transition-colors","stg:disabled:pointer-events-none stg:disabled:opacity-50",s===X?"stg:bg-accent stg:text-foreground":"stg:text-foreground stg:hover:bg-accent-hover"),role:"option","aria-selected":s===X,children:[(0,t.jsxs)("span",{className:"stg:flex stg:items-center stg:gap-1.5",children:[(0,t.jsx)(D,{}),(0,t.jsx)("span",{className:"stg:truncate stg:font-medium",children:(0,t.jsx)(T,{text:e.name,query:K})}),(0,t.jsx)("span",{className:"stg:ml-auto stg:shrink-0 stg:text-[0.6rem] stg:text-muted-foreground",children:e.org})]}),e.description&&(0,t.jsx)("span",{className:(0,n.cn)("stg:pl-5 stg:text-[0.65rem] stg:text-muted-foreground",s!==X&&"stg:line-clamp-2 stg:group-hover:line-clamp-none"),children:e.description})]},e.id))}),et.canScrollDown&&(0,t.jsx)(d.ScrollFade,{position:"bottom"})]})]})}],348728);let F="stgm-skill-list";function _({text:e,query:s}){if(!s)return(0,t.jsx)(t.Fragment,{children:e});let n=e.toLowerCase().indexOf(s.toLowerCase());return -1===n?(0,t.jsx)(t.Fragment,{children:e}):(0,t.jsxs)(t.Fragment,{children:[e.slice(0,n),(0,t.jsx)("span",{className:"stg:font-semibold",children:e.slice(n,n+s.length)}),e.slice(n+s.length)]})}function B(){return(0,t.jsx)("div",{className:"stg:space-y-1 stg:py-1",children:[55,70,45,62].map((e,s)=>(0,t.jsxs)("div",{className:"stg:flex stg:flex-col stg:gap-1 stg:px-2 stg:py-1.5",children:[(0,t.jsx)("div",{className:"stg:h-3 stg:rounded stg:bg-muted stg:animate-pulse",style:{width:`${e}%`}}),(0,t.jsx)("div",{className:"stg:h-2 stg:rounded stg:bg-muted-subtle stg:animate-pulse",style:{width:`${Math.min(e+15,90)}%`}})]},s))})}function U(){return(0,t.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:"stg:shrink-0 stg:text-muted-foreground","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M2 3h12M2 7h8M2 11h10M2 15h6"})})}function P(){return(0,t.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M4 4L10 10M10 4L4 10"})})}e.s(["SkillPicker",0,function({org:e,scope:o,value:i,onChange:c,onDisplayNameResolved:u,disabled:m,className:x}){var p;let h,v,[f,b]=(0,s.useState)(o??"org"),{results:j,isLoading:y,error:N,query:k,setQuery:C}=(p={scope:f},h=(0,l.useStigmer)(),v=(0,s.useCallback)(e=>h.skill.list(e),[h]),(0,a.useResourceSearch)(v,e,p)),[w,A]=(0,s.useState)(-1),E=(0,s.useRef)(null),O=(0,g.useScrollShadows)(),T=(0,g.useScrollShadows)(),R=(0,s.useMemo)(()=>new Set(i.map($)),[i]),D=(0,s.useMemo)(()=>j.filter(e=>!R.has(`${e.org}/${e.slug}`)),[j,R]);(0,s.useEffect)(()=>{A(-1)},[k]),(0,s.useEffect)(()=>{w>=0&&O.scrollRef.current?.querySelector(`[data-idx="${w}"]`)?.scrollIntoView({block:"nearest"})},[w,O.scrollRef]);let L=(0,s.useCallback)(e=>{c([...i,{org:e.org,slug:e.slug,kind:r.ApiResourceKind.skill}]),u?.(`${e.org}/${e.slug}`,e.name)},[i,c,u]),M=(0,s.useCallback)(e=>{c(i.filter(t=>$(t)!==e))},[i,c]),H=(0,s.useCallback)(e=>{"ArrowDown"===e.key?(e.preventDefault(),A(e=>e<D.length-1?e+1:e)):"ArrowUp"===e.key?(e.preventDefault(),A(e=>e>0?e-1:-1)):"Enter"===e.key&&w>=0&&w<D.length?(e.preventDefault(),L(D[w])):"Enter"===e.key&&e.preventDefault()},[D,w,L]);return(0,t.jsxs)("div",{className:["stg:space-y-2 stg:w-72",x].filter(Boolean).join(" "),children:[i.length>0&&(0,t.jsxs)("div",{className:"stg:space-y-1",children:[(0,t.jsx)("div",{className:"stg:text-[0.65rem] stg:font-medium stg:text-muted-foreground",children:"Selected"}),(0,t.jsxs)("div",{className:"stg:relative",children:[T.canScrollUp&&(0,t.jsx)(d.ScrollFade,{position:"top"}),(0,t.jsx)("div",{ref:T.scrollRef,className:"stg:max-h-28 stg:space-y-1 stg:overflow-y-auto",children:i.map(e=>{let s=$(e);return(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-2 stg:rounded-md stg:bg-muted-faint stg:px-2 stg:py-1 stg:text-xs",children:[(0,t.jsx)(U,{}),(0,t.jsx)("span",{className:"stg:min-w-0 stg:flex-1 stg:truncate stg:text-foreground",children:e.slug}),(0,t.jsx)("button",{type:"button",onClick:()=>M(s),disabled:m,className:"stg:shrink-0 stg:text-muted-foreground stg:hover:text-destructive stg:disabled:pointer-events-none","aria-label":`Remove ${e.slug}`,children:(0,t.jsx)(P,{})})]},s)})}),T.canScrollDown&&(0,t.jsx)(d.ScrollFade,{position:"bottom"})]})]}),(0,t.jsx)("input",{ref:E,type:"text",role:"combobox","aria-expanded":!0,"aria-controls":F,"aria-activedescendant":w>=0?`stgm-skill-${w}`:void 0,placeholder:"Search skills...",value:k,onChange:e=>C(e.target.value),onKeyDown:H,disabled:m,className:"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-2 stg:focus-visible:ring-ring stg:disabled:pointer-events-none stg:disabled:opacity-50",autoFocus:!0}),(0,t.jsx)(S.ScopeToggle,{value:f,onChange:b,disabled:m}),N&&(0,t.jsx)("p",{className:"stg:text-xs stg:text-destructive",children:N.message}),(0,t.jsxs)("div",{className:"stg:relative",children:[O.canScrollUp&&(0,t.jsx)(d.ScrollFade,{position:"top"}),(0,t.jsx)("div",{ref:O.scrollRef,id:F,role:"listbox","aria-label":"Skills",className:"stg:max-h-52 stg:overflow-y-auto",children:y?(0,t.jsx)(B,{}):0===D.length?(0,t.jsx)("div",{className:"stg:py-4 stg:text-center stg:text-xs stg:text-muted-foreground",children:k?"No skills match your search":i.length>0?"All available skills selected":"No skills found"}):D.map((e,s)=>(0,t.jsxs)("button",{id:`stgm-skill-${s}`,type:"button","data-idx":s,onClick:()=>L(e),disabled:m,className:(0,n.cn)("stg:group stg:flex stg:w-full stg:flex-col stg:gap-0.5 stg:rounded-md stg:px-2 stg:py-1.5 stg:text-left stg:text-xs stg:transition-colors","stg:disabled:pointer-events-none stg:disabled:opacity-50",s===w?"stg:bg-accent stg:text-foreground":"stg:text-foreground stg:hover:bg-accent-hover"),role:"option","aria-selected":s===w,children:[(0,t.jsxs)("span",{className:"stg:flex stg:items-center stg:gap-1.5",children:[(0,t.jsx)(U,{}),(0,t.jsx)("span",{className:"stg:truncate stg:font-medium",children:(0,t.jsx)(_,{text:e.name,query:k})}),(0,t.jsx)("span",{className:"stg:ml-auto stg:shrink-0 stg:text-[0.6rem] stg:text-muted-foreground",children:e.org})]}),e.description&&(0,t.jsx)("span",{className:(0,n.cn)("stg:pl-5 stg:text-[0.65rem] stg:text-muted-foreground",s!==w&&"stg:line-clamp-2 stg:group-hover:line-clamp-none"),children:e.description})]},e.id))}),O.canScrollDown&&(0,t.jsx)(d.ScrollFade,{position:"bottom"})]})]})}],841358)}]);
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,830419,782130,802087,321252,961378,427187,775106,816053,e=>{"use strict";var t,r,n,s,i=e.i(843476),a=e.i(271645),o=e.i(893976),l=e.i(65642),d=e.i(476007),c=e.i(468806),u=e.i(379410),p=e.i(57330),f=e.i(869803);let h="https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",m="https://agent-plugins.org/schemas/1.0.0/mcp.schema.json",g={"agent-plugins":"plugin.json",claude:".claude-plugin/plugin.json",cursor:".cursor-plugin/plugin.json",codex:".codex-plugin/plugin.json"},v=e=>`'${e??""}'`,b=e=>void 0===e?"":` in ${v(e)}`,y={"no-manifest":()=>`no plugin manifest found: expected one of ${Object.values(g).map(e=>v(e)).join(", ")}`,"manifest-unreadable":e=>`manifest ${v(e.path)} is not valid JSON: ${e.detail??"parse error"}`,"manifest-schema-missing":e=>`manifest ${v(e.path)} is missing the required '$schema' field; an Agent Plugins manifest declares ${v(h)}`,"manifest-schema-unsupported":e=>`manifest ${v(e.path)} declares an unsupported '$schema' ${v(e.detail)}; this reader supports ${v(h)}`,"manifest-name-missing":e=>`manifest ${v(e.path)} is missing the required 'name' field`,"manifest-name-invalid":e=>`plugin name ${v(e.subject)}${b(e.path)} is invalid: 1 to 64 characters of lowercase letters, digits, hyphens and periods, starting and ending alphanumeric, with no '--' or '..'`,"manifest-name-conflict":e=>`manifests disagree on the plugin name: ${v(e.subject)} in ${v(e.path)} versus ${e.detail??"another manifest"}`,"manifest-field-type":e=>`field ${v(e.subject)}${b(e.path)} has the wrong type: expected ${e.detail??"a different type"}`,"path-not-relative":e=>`path ${v(e.subject)}${b(e.path)} must be plugin-relative and begin with './'`,"path-escapes-root":e=>`path ${v(e.subject)}${b(e.path)} escapes the plugin root`,"path-glob-unsupported":e=>`path ${v(e.subject)}${b(e.path)} is a glob pattern; declare directories and files by path`,"path-uncontained":e=>`the reader listed a path outside the plugin root: ${v(e.path)}`,"document-too-large":e=>`${v(e.path)} is ${e.subject??"too many"} bytes, over the ${e.detail??""}-byte limit for this kind of document`,"skill-frontmatter-missing":e=>`${v(e.path)} must start with YAML frontmatter ('---')`,"skill-frontmatter-unclosed":e=>`${v(e.path)} frontmatter is not closed (missing the closing '---')`,"skill-frontmatter-unreadable":e=>`${v(e.path)} frontmatter is not valid YAML: ${e.detail??"parse error"}`,"skill-name-invalid":e=>`skill name ${v(e.subject)}${b(e.path)} is invalid: lowercase letters, digits and hyphens, optionally dot-scoped, with every segment alphanumeric`,"skill-name-duplicate":e=>`skill name ${v(e.subject)} appears more than once (again${b(e.path)})`,"mcp-config-unreadable":e=>`MCP configuration ${v(e.path)} is not valid JSON: ${e.detail??"parse error"}`,"mcp-config-shape":e=>`MCP configuration ${v(e.path)} must be an object with an 'mcpServers' object`,"mcp-config-schema-missing":e=>`MCP configuration ${v(e.path)} is missing the required '$schema' field; an Agent Plugins configuration declares ${v(m)}`,"mcp-config-schema-unsupported":e=>`MCP configuration ${v(e.path)} declares an unsupported '$schema' ${v(e.detail)}; this reader supports ${v(m)}`,"mcp-config-field-unknown":e=>`MCP configuration ${v(e.path)} has an unexpected top-level field ${v(e.subject)}; only '$schema' and 'mcpServers' are allowed`,"mcp-server-shape":e=>`MCP server ${v(e.subject)}${b(e.path)} must be an object`,"mcp-server-type-missing":e=>`MCP server ${v(e.subject)}${b(e.path)} is missing the 'type' field the Agent Plugins format requires ('stdio', 'streamable-http' or 'sse')`,"mcp-server-transport-unknown":e=>`MCP server ${v(e.subject)}${b(e.path)} has no 'type' and neither a 'command' nor a 'url' to infer it from`,"mcp-server-type-ambiguous":e=>`MCP server ${v(e.subject)}${b(e.path)} declares both 'command' and 'url'; a server is either stdio or HTTP`,"mcp-server-type-unknown":e=>`MCP server ${v(e.subject)}${b(e.path)} has an unknown 'type' ${v(e.detail)}; expected 'stdio', 'http', 'streamable-http' or 'sse'`,"mcp-server-field-unknown":e=>`MCP server ${v(e.subject)}${b(e.path)} has a field ${v(e.detail)} that its transport does not define`,"mcp-server-field-type":e=>`MCP server ${v(e.subject)}${b(e.path)} field ${v(e.detail)} has the wrong type`,"mcp-server-url-missing":e=>`MCP server ${v(e.subject)}${b(e.path)} is missing the 'url' its HTTP transport requires`,"mcp-server-url-invalid":e=>`MCP server ${v(e.subject)}${b(e.path)} has an invalid 'url' ${v(e.detail)}: expected an absolute HTTPS URL (HTTP only for localhost) with no user information or fragment`,"mcp-server-url-variable":e=>`MCP server ${v(e.subject)}${b(e.path)} has a variable in its 'url'; Stigmer sends the URL as written, so write the URL out and put variables in 'headers'`,"mcp-server-command-missing":e=>`MCP server ${v(e.subject)}${b(e.path)} is missing the 'command' its stdio transport requires`,"mcp-server-command-invalid":e=>`MCP server ${v(e.subject)}${b(e.path)} has a 'command' that is not a single executable name; put arguments in 'args'`,"mcp-server-command-relative":e=>`MCP server ${v(e.subject)}${b(e.path)} runs a command bundled in the plugin ${v(e.detail)}; Stigmer runs only commands on the runner's PATH (for example 'npx' or 'uvx')`,"mcp-server-plugin-root-reference":e=>`MCP server ${v(e.subject)}${b(e.path)} references the plugin's own files through ${v(e.detail)}; Stigmer does not mount plugin files into the runner`,"mcp-server-cwd-unsupported":e=>`MCP server ${v(e.subject)}${b(e.path)} sets a working directory; Stigmer does not mount plugin files, so a bundled directory cannot be reached`,"mcp-server-env-literal":e=>`MCP server ${v(e.subject)}${b(e.path)} sets environment variable ${v(e.detail)} to a literal value; Stigmer passes declared variables by name, so write ${v(`${e.detail??"KEY"}: "\${${e.detail??"KEY"}}"`)} and declare the variable`,"mcp-server-env-rename":e=>`MCP server ${v(e.subject)}${b(e.path)} maps environment variable ${v(e.detail)} to a differently named variable; Stigmer passes declared variables by name, so use the same name on both sides`,"mcp-server-name-duplicate":e=>`MCP server name ${v(e.subject)} appears more than once (again${b(e.path)})`,"mcp-server-header-duplicate":e=>`MCP server ${v(e.subject)}${b(e.path)} declares header ${v(e.detail)} more than once (header names are case-insensitive)`,"mcp-server-header-invalid":e=>`MCP server ${v(e.subject)}${b(e.path)} has an invalid header name ${v(e.detail)}`,"sub-agent-frontmatter-unreadable":e=>`${v(e.path)} frontmatter is not valid YAML: ${e.detail??"parse error"}`,"sub-agent-instructions-short":e=>`sub-agent ${v(e.subject)}${b(e.path)} has instructions under ${e.detail??""} characters; the body of the file is the sub-agent's prompt`,"sub-agent-name-duplicate":e=>`sub-agent name ${v(e.subject)} appears more than once (again${b(e.path)})`,"variable-name-invalid":e=>`variable name ${v(e.subject)}${b(e.path)} is invalid: an environment variable name is letters, digits and underscores, not starting with a digit`,"overlay-server-unknown":e=>`${v(e.path)} overlays MCP server ${v(e.subject)}, which the plugin does not declare`,"overlay-document-unknown":e=>`${v(e.path)} is not a document Stigmer reads; the 'ai.stigmer/' folder holds 'agent.yaml', 'workflows/<name>.yaml' and 'mcp-servers/<server>.yaml'`},$={"manifest-field-unknown":e=>`manifest ${v(e.path)} has an unknown field ${v(e.subject)}, ignored`,"manifest-extensions-invalid":e=>`manifest ${v(e.path)} has an 'extensions' field that is not an object, ignored`,"path-missing":e=>`path ${v(e.subject)} declared${b(e.path)} does not exist in the plugin`,"skill-name-defaulted":e=>`${v(e.path)} has no 'name' in its frontmatter; the skill is named after its directory, ${v(e.subject)}`,"skill-name-differs-from-directory":e=>`skill ${v(e.subject)}${b(e.path)} is named differently from its directory ${v(e.detail)}`,"skill-description-missing":e=>`skill ${v(e.subject)}${b(e.path)} has no 'description'`,"mcp-config-field-ignored":e=>`MCP configuration ${v(e.path)} has a top-level field ${v(e.subject)} Stigmer does not read, ignored`,"mcp-server-sse-mapped":e=>`MCP server ${v(e.subject)}${b(e.path)} declares the legacy 'sse' transport; Stigmer connects over Streamable HTTP and falls back to SSE only when the server rejects it`,"mcp-server-field-ignored":e=>`MCP server ${v(e.subject)}${b(e.path)} has a field ${v(e.detail)} Stigmer does not read, ignored`,"mcp-server-auth-ignored":e=>`MCP server ${v(e.subject)}${b(e.path)} has an 'auth' block Stigmer does not read; OAuth for a server is declared in 'ai.stigmer/mcp-servers/${e.subject??"<server>"}.yaml'`,"variable-inferred":e=>`variable ${v(e.subject)} is referenced by MCP server ${v(e.detail)} but not declared; it is declared as a required secret`,"variable-unreferenced":e=>`variable ${v(e.subject)}${b(e.path)} is declared but no MCP server references it`,"variable-default-dropped":e=>`variable ${v(e.subject)}${b(e.path)} has a default value, which Stigmer does not carry; the user supplies the value`,"variable-type-narrowed":e=>`variable ${v(e.subject)}${b(e.path)} is typed ${v(e.detail)}; Stigmer variables are strings`,"variable-option-dropped":e=>`variable ${v(e.subject)}${b(e.path)} has a ${v(e.detail)} constraint, which Stigmer does not carry`,"sub-agent-name-defaulted":e=>`${v(e.path)} has no 'name' in its frontmatter; the sub-agent is named after the file, ${v(e.subject)}`,"sub-agent-skill-unknown":e=>`sub-agent ${v(e.subject)}${b(e.path)} asks for skill ${v(e.detail)}, which the plugin does not ship`,"sub-agent-model-unknown":e=>`sub-agent ${v(e.subject)}${b(e.path)} names model ${v(e.detail)}, which Stigmer cannot map; the sub-agent runs on the session's model`,"sub-agent-field-ignored":e=>`sub-agent ${v(e.subject)}${b(e.path)} has a field ${v(e.detail)} Stigmer does not read, ignored`};class w{errorSentences;warningSentences;errors=[];warnings=[];constructor(e,t){this.errorSentences=e,this.warningSentences=t}error(e,t={}){this.errors.push(k(e,t,this.errorSentences[e](t)))}warn(e,t={}){this.warnings.push(k(e,t,this.warningSentences[e](t)))}}class j extends w{constructor(){super(y,$)}}function k(e,t,r){return{kind:e,...void 0!==t.path&&{path:t.path},...void 0!==t.subject&&{subject:t.subject},...void 0!==t.detail&&{detail:t.detail},message:r}}let x={stigmer:"marketplace.json",claude:".claude-plugin/marketplace.json",cursor:".cursor-plugin/marketplace.json",codex:".agents/plugins/marketplace.json"},S=Object.values(x).map(e=>v(e)).join(", "),M={"marketplace-not-found":()=>`no marketplace file found: expected one of ${S}`,"marketplace-too-large":e=>`${v(e.path)} is ${e.subject??""} bytes, above the ${e.detail??""} byte cap for a marketplace file`,"marketplace-unreadable":e=>`${v(e.path)} is not a readable marketplace file: ${e.detail??"parse error"}`,"marketplace-field-type":e=>`${v(e.path)} field ${v(e.subject)} must be ${e.detail??"of another type"}`,"marketplace-name-missing":e=>`${v(e.path)} has no 'name'; a marketplace needs one so its plugins can be addressed as '<marketplace>/<plugin>'`,"marketplace-name-invalid":e=>`${v(e.path)} name ${v(e.subject)} is invalid: 1 to 64 characters of a-z, 0-9, '-' and '.', starting and ending alphanumeric, no '--' or '..'`,"marketplace-plugins-missing":e=>`${v(e.path)} has no 'plugins' list`,"entry-shape":e=>`${v(e.path)} plugins[${e.subject??""}] must be an object with 'name' and 'source'`,"entry-name-missing":e=>`${v(e.path)} plugins[${e.subject??""}] has no 'name'`,"entry-name-invalid":e=>`${v(e.path)} plugin ${v(e.subject)} has an invalid name: 1 to 64 characters of a-z, 0-9, '-' and '.', starting and ending alphanumeric, no '--' or '..'`,"entry-name-duplicate":e=>`${v(e.path)} lists plugin ${v(e.subject)} more than once; 'install ${e.subject??""}' would be ambiguous`,"entry-source-missing":e=>`${v(e.path)} plugin ${v(e.subject)} has no 'source'`,"entry-source-escapes-root":e=>`${v(e.path)} plugin ${v(e.subject)} has source ${v(e.detail)} outside the marketplace root; a source is a directory inside the marketplace`,"default-unknown":e=>`${v(e.path)} names ${v(e.subject)} as a default but lists no plugin of that name`},P={"entry-source-unsupported":e=>`plugin ${v(e.subject)}${b(e.path)} has source ${v(e.detail)}, a form Stigmer does not fetch (only a directory inside the marketplace); not offered`,"entry-directory-missing":e=>`plugin ${v(e.subject)}${b(e.path)} names directory ${v(e.detail)}, which the marketplace does not contain; not offered`,"entry-not-a-plugin":e=>`plugin ${v(e.subject)}${b(e.path)} names directory ${v(e.detail)}, which holds no plugin manifest; not offered`};class C extends w{constructor(){super(M,P)}}let N={manifest:262144,mcpConfig:262144,skillMd:1048576,subAgent:1048576,overlay:1048576,marketplace:1048576};new TextEncoder;let A=new TextDecoder("utf-8",{fatal:!1});function E(e,t){return e<t?-1:+(e>t)}function I(e){let t=A.decode(e);return 65279===t.charCodeAt(0)?t.slice(1):t}function _(e){return!(""===e||e.startsWith("/")||e.includes("\\"))&&e.split("/").every(e=>""!==e&&"."!==e&&".."!==e)}let T=/[*?[\]{}]/;function O(e){if(T.test(e))return{ok:!1,kind:"path-glob-unsupported"};if("."===e||"./"===e)return{ok:!0,path:""};if(!e.startsWith("./"))return{ok:!1,kind:"path-not-relative"};let t=e.slice(2).replace(/\/+$/,"");return""===t?{ok:!0,path:""}:_(t)?{ok:!0,path:t}:{ok:!1,kind:"path-escapes-root"}}function z(e,t){return""===e?t:`${e}/${t}`}function D(e){let t=e.lastIndexOf("/");return -1===t?e:e.slice(t+1)}function L(e){let t=e.lastIndexOf("/");return -1===t?"":e.slice(0,t)}class R{files;byPath;constructor(e){this.files=e,this.byPath=new Map(e.entries.map(e=>[e.path,e]))}has(e){return this.byPath.has(e)}entry(e){return this.byPath.get(e)}filesUnder(e){if(""===e)return this.files.entries.map(e=>e.path);let t=`${e}/`;return this.files.entries.filter(e=>e.path.startsWith(t)).map(e=>e.path)}isDirectory(e){if(""===e)return this.files.entries.length>0;let t=`${e}/`;return this.files.entries.some(e=>e.path.startsWith(t))}childDirectories(e){let t=""===e?"":`${e}/`,r=new Set;for(let e of this.files.entries){if(!e.path.startsWith(t))continue;let n=e.path.slice(t.length),s=n.indexOf("/");-1!==s&&r.add(n.slice(0,s))}return[...r].sort(E)}childFiles(e){let t=""===e?"":`${e}/`,r=[];for(let e of this.files.entries){if(!e.path.startsWith(t))continue;let n=e.path.slice(t.length);n.includes("/")||r.push(n)}return r.sort(E)}}function U(e,t,r,n){let s=W(e,t,r,n);return void 0===s?void 0:I(s)}function W(e,t,r,n){let s=N[r],i=e.entry(t);if(void 0===i)throw Error(`plugin file '${t}' is not listed`);if(i.size>s)return void n.error("document-too-large",{path:t,subject:String(i.size),detail:String(s)});let a=e.files.read(t);return a.length>s?void n.error("document-too-large",{path:t,subject:String(a.length),detail:String(s)}):a}function B(e,t,r,n){let s;try{s=JSON.parse(e)}catch(e){n.error(r,{path:t,detail:e instanceof Error?e.message:String(e)});return}return F(s)?s:void n.error(r,{path:t,detail:"the document is not a JSON object"})}function F(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function G(e){return Array.isArray(e)&&e.every(e=>"string"==typeof e)}function q(e){return F(e)&&Object.values(e).every(e=>"string"==typeof e)}function J(e){return"string"==typeof e?e:JSON.stringify(e)}function Z(e){return Object.entries(e)}function Y(e,t,r,n){let s=e[t];if(void 0!==s)return"string"!=typeof s?void n.error("manifest-field-type",{path:r,subject:t,detail:"a string"}):s}function H(e,t,r,n){for(let[s]of Z(e))t.has(s)||n.warn("manifest-field-unknown",{path:r,subject:s})}function V(e,t,r){let n={},s=Y(e,"name",t,r);void 0!==s&&(n.name=s);let i=Y(e,"version",t,r);void 0!==i&&(n.version=i);let a=Y(e,"description",t,r);void 0!==a&&(n.description=a);let o=Y(e,"homepage",t,r);void 0!==o&&(n.homepage=o);let l=Y(e,"repository",t,r);void 0!==l&&(n.repository=l);let d=Y(e,"license",t,r);void 0!==d&&(n.license=d);let c=function(e,t,r,n){let s=e[t];if(void 0!==s)return G(s)?s:void n.error("manifest-field-type",{path:r,subject:t,detail:"an array of strings"})}(e,"keywords",t,r);void 0!==c&&(n.keywords=c);let u=function(e,t,r){let n=e.author;if(void 0===n)return;if(!F(n))return void r.error("manifest-field-type",{path:t,subject:"author",detail:"an object"});let s={},i=Y(n,"name",t,r);void 0!==i&&(s.name=i);let a=Y(n,"email",t,r);void 0!==a&&(s.email=a);let o=Y(n,"url",t,r);return void 0!==o&&(s.url=o),s}(e,t,r);return void 0!==u&&(n.author=u),n}function K(e,t,r,n){let s=function(e,t,r,n){let s=e[t];if(void 0!==s){if("string"==typeof s)return[s];if(G(s))return s;n.error("manifest-field-type",{path:r,subject:t,detail:"a string or an array of strings"})}}(e,t,r,n);if(void 0===s)return;let i=[];for(let e of s){let t=O(e);if(!t.ok){n.error(t.kind,{path:r,subject:e});continue}i.push({path:t.path,manifest:r})}return i}function Q(e,t,r,n,s){let i=e[t];if(void 0===i)return[];let a=Array.isArray(i)?i:[i],o=[];for(let e of a)if("string"==typeof e){let t=O(e);if(!t.ok){s.error(t.kind,{path:r,subject:e});continue}o.push({kind:"file",path:t.path,dialect:n,manifest:r})}else F(e)?o.push({kind:"inline",manifest:r,servers:e,dialect:n}):s.error("manifest-field-type",{path:r,subject:t,detail:"a path, an object, or an array of either"});return o}let X={hooks:"hooks",rules:"rules",commands:"commands",workflows:"workflows",outputStyles:"output-styles",lspServers:"lsp-servers",channels:"channels",dependencies:"dependencies",defaultEnabled:"default-enabled",minClientVersions:"min-client-versions",logo:"logo",apps:"apps"};function ee(e,t){let r=[];for(let[n,s]of Z(e)){let e=X[n];if(void 0!==e&&r.push({kind:e,path:`${t}#${n}`}),"experimental"===n&&F(s))for(let[e]of Z(s)){let n=et[e];void 0!==n&&r.push({kind:n,path:`${t}#experimental.${e}`})}}return r}let et={themes:"themes",monitors:"monitors",evals:"evals"},er=new Set(["name","version","description","author","homepage","repository","license","keywords","skills","commands","agents","workflows","hooks","mcpServers","outputStyles","lspServers","experimental","userConfig","channels","dependencies","defaultEnabled"]),en=".mcp.json";function es(e,t,r,n,s){H(e,n,t,s);let i=V(e,t,s),a=K(e,"skills",t,s)??[],o=K(e,"agents",t,s),l=Q(e,"mcpServers",t,r,s),d={dialect:r,path:t,identity:i,skillPaths:a,mcpConfigs:l,ignored:ee(e,t)};return void 0!==o&&(d.agentPaths=o),void 0!==e.userConfig&&(d.variables={dialect:"claude",value:e.userConfig,manifest:t}),d}let ei=new Set([...er,"apps","interface"]),ea=new Set(["name","displayName","description","version","minClientVersions","author","publisher","homepage","repository","license","logo","keywords","category","tags","commands","agents","skills","rules","hooks","variables","mcpServers"]),eo=new Set(["$schema","name","version","description","author","homepage","repository","license","keywords","extensions"]),el="mcp.json",ed=["claude","cursor","codex"],ec=/^[a-z0-9]([a-z0-9.-]*[a-z0-9])?$/;function eu(e){let t=new Set(Object.values(g));for(let r of e)if(t.has(r))return!0;return!1}function ep(e,t){let r=[],n=n=>{var s,i,a;let o,l=g[n];if(!e.has(l))return;let d=void 0===(o=U(e,s=l,"manifest",i=t))?void 0:B(o,s,"manifest-unreadable",i),c=void 0===d?(a=n,{dialect:a,path:l,identity:{},skillPaths:[],mcpConfigs:[],ignored:[]}):function(e,t,r,n){switch(e){case"agent-plugins":let s;return void 0===(s=t.$schema)?n.error("manifest-schema-missing",{path:r}):s!==h&&n.error("manifest-schema-unsupported",{path:r,detail:J(s)}),H(t,eo,r,n),{dialect:"agent-plugins",path:r,identity:V(t,r,n),skillPaths:[],mcpConfigs:[],ignored:function(e,t,r){let n=e.extensions;if(void 0===n)return[];if(!F(n))return r.warn("manifest-extensions-invalid",{path:t}),[];let s=[];for(let[e,r]of Z(n))F(r)&&0===Z(r).length||s.push({kind:"extension",path:`${t}#extensions.${e}`});return s}(t,r,n)};case"claude":return es(t,r,"claude",er,n);case"cursor":let i,a,o,l;return H(t,ea,r,n),i=V(t,r,n),a=K(t,"skills",r,n)??[],o=K(t,"agents",r,n),l={dialect:"cursor",path:r,identity:i,skillPaths:a,mcpConfigs:Q(t,"mcpServers",r,"cursor",n),ignored:ee(t,r)},void 0!==o&&(l.agentPaths=o),void 0!==t.variables&&(l.variables={dialect:"cursor",value:t.variables,manifest:r}),l;case"codex":return es(t,r,"codex",ei,n);default:throw Error(`unknown dialect ${String(e)}`)}}(n,d,l,t);return r.push(c),c},s=n("agent-plugins"),i=ed.map(n).filter(e=>void 0!==e);if(0===r.length)return void t.error("no-manifest");let a=s??i[0];if(void 0===a)throw Error("manifest set without an identity manifest");let o=[a,...r.filter(e=>e!==a)],l=function(e,t,r){let n=e.identity.name;if(void 0===n){if(r.errors.some(t=>"manifest-unreadable"===t.kind&&t.path===e.path))return;r.error("manifest-name-missing",{path:e.path});return}let s=!0;for(let i of(ef(n)||(r.error("manifest-name-invalid",{path:e.path,subject:n}),s=!1),t)){if(i===e)continue;let t=i.identity.name;void 0!==t&&t!==n&&(r.error("manifest-name-conflict",{path:e.path,subject:n,detail:`'${t}' in '${i.path}'`}),s=!1)}return s?n:void 0}(a,o,t);return{dialect:a.dialect,manifests:o,name:l,readsAgents:i.length>0,mcpSources:function(e,t,r){let n=[];for(let s of(void 0!==t&&e.has(el)&&n.push({kind:"file",path:el,dialect:"agent-plugins",manifest:t.path}),r))s.mcpConfigs.length>0?n.push(...s.mcpConfigs):"cursor"!==s.dialect&&e.has(en)&&n.push({kind:"file",path:en,dialect:s.dialect,manifest:s.path});let s=new Set;return n.filter(e=>"inline"===e.kind||!s.has(e.path)&&(s.add(e.path),!0))}(e,s,i)}}function ef(e){return e.length<=64&&ec.test(e)&&!e.includes("--")&&!e.includes("..")}e.s(["detectManifests",0,ep,"hasPluginManifest",0,eu,"isValidPluginName",0,ef],782130);let eh=["stigmer","claude","cursor","codex"];function em(e){return{ok:!1,errors:e.errors,warnings:e.warnings}}function eg(e,t){let r=e[t];return"string"==typeof r?r:void 0}function ev(e){let t=e;return"."===t||"./"===t||(t.startsWith("./")&&(t=t.slice(2)),""===(t=t.replace(/\/+$/,"")))?{ok:!0,dir:""}:_(t)?{ok:!0,dir:t}:{ok:!1}}let eb={rules:"rules",hooks:"hooks",commands:"commands",canvases:"canvases",workflows:"workflows","output-styles":"output-styles",themes:"themes",monitors:"monitors",bin:"bin",assets:"assets",evals:"evals"},ey={".lsp.json":"lsp-servers","settings.json":"settings",".app.json":"apps"},e$=/\$\{([A-Za-z_][A-Za-z0-9_]*)\}/g,ew=/^[A-Za-z_][A-Za-z0-9_]*$/,ej=/\$\{user_config\.([A-Za-z_][A-Za-z0-9_]*)\}/g,ek=new Set(["${PLUGIN_ROOT}","${PLUGIN_DATA}","${CLAUDE_PLUGIN_ROOT}","${CLAUDE_PLUGIN_DATA}","${CLAUDE_PROJECT_DIR}","${CURSOR_PLUGIN_ROOT}"]),ex=new Set(["PLUGIN_ROOT","PLUGIN_DATA"]);function eS(e){return e.replace(ej,(e,t)=>`\${${t}}`)}function eM(e){for(let t of ek)if(e.includes(t))return t}function eP(e){let t=[];for(let r of e.matchAll(e$)){let e=r[1];void 0===e||t.includes(e)||t.push(e)}return t}let eC=new Set(["$schema","mcpServers"]),eN=new Set(["type","command","args","env","cwd"]),eA=new Set(["type","url","headers"]),eE=new Set(["type","command","args","env","cwd"]),eI=new Set(["type","url","headers"]),e_=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;function eT(e,t){for(let r of eP(e))t.add(r)}let eO="ai.stigmer",ez=`${eO}/agent.yaml`,eD=`${eO}/workflows`,eL=`${eO}/mcp-servers`;e.i(222258);var eR=e.i(967785);let eU=/^[a-z0-9]+([.-][a-z0-9]+)*$/;function eW(e){let t=e.split(/\r?\n/);if(0===t.length||t[0]?.trim()!=="---")return{ok:!1,reason:"missing"};for(let e=1;e<t.length;e++)if(t[e]?.trim()==="---")return{ok:!0,yaml:t.slice(1,e).join("\n"),body:t.slice(e+1).join("\n")};return{ok:!1,reason:"unclosed"}}function eB(e){let t;try{t=(0,eR.parse)(e)}catch(e){return{ok:!1,detail:e instanceof Error?e.message:String(e)}}return null==t?{ok:!0,fields:{}}:F(t)?{ok:!0,fields:t}:{ok:!1,detail:"the frontmatter is not a mapping"}}let eF="SKILL.md",eG="skills",eq=new Set(["name","description","model","skills"]);function eJ(e){let t=[e.title,e.description].filter(e=>"string"==typeof e&&""!==e);return 0===t.length?void 0:t.join(": ")}var eZ=e.i(229969);let eY=new Date(1980,0,1);async function eH(e){return Array.from(new Uint8Array(await globalThis.crypto.subtle.digest("SHA-256",e)),e=>e.toString(16).padStart(2,"0")).join("")}let eV=[".git/",".svn/",".hg/",".bzr/",".env",".env.*","!.env.example","!.env.template","!.env.sample","*.pem","*.key","*.p12","*.pfx","*.keystore","*.jks","id_rsa","id_rsa.*","id_ed25519","id_ed25519.*","id_dsa","id_dsa.*","credentials.json","service-account*.json","gcp-credentials*.json","aws-credentials",".aws/credentials",".aws/config",".secrets",".secrets/","*.secret",".credentials/","secrets.yaml","secrets.yml","secrets.json",".npmrc",".pypirc",".gem/credentials",".docker/config.json",".idea/",".vscode/","*.swp","*.swo","*.swn","*~",".project",".classpath",".settings/","*.sublime-workspace","*.sublime-project",".vs/",".DS_Store",".DS_Store?","._*",".Spotlight-V100",".Trashes","Thumbs.db","Thumbs.db:encryptable","desktop.ini","ehthumbs.db","ehthumbs_vista.db","node_modules/","npm-debug.log*","yarn-debug.log*","yarn-error.log*",".npm/",".yarn/cache/",".yarn/unplugged/",".pnp.*","__pycache__/","*.py[cod]","*$py.class",".Python","*.so",".venv/","venv/","env/","ENV/",".pytest_cache/",".mypy_cache/",".ruff_cache/",".tox/",".nox/","*.egg-info/",".eggs/","dist/","build/","develop-eggs/",".installed.cfg","*.manifest","*.spec","pip-log.txt","pip-delete-this-directory.txt","target/","*.class","*.jar","*.war","*.ear",".gradle/","gradle-app.setting",".gradletasknamecache","vendor/","target/","Cargo.lock","coverage/",".coverage","htmlcov/",".nyc_output/","coverage.xml","*.cover",".hypothesis/","*.log","logs/","tmp/","temp/","*.tmp","*.temp","*.bak","*.backup"];class eK extends Error{}function eQ(e,t){try{var r=e,n=t;e:for(;r.length>0;){let[e,t,s]=function(e){let t=!1;for(;e.length>0&&"*"===e[0];)e=e.slice(1),t=!0;let r=!1,n=0;t:for(n=0;n<e.length;n++)switch(e[n]){case"\\":n+1<e.length&&n++;break;case"[":r=!0;break;case"]":r=!1;break;case"*":if(!r)break t}return[t,e.slice(0,n),e.slice(n)]}(r);if(r=s,e&&""===t)return!n.includes("/");let[i,a]=eX(t,n);if(a&&(0===i.length||r.length>0)){n=i;continue}if(e)for(let e=0;e<n.length&&"/"!==n[e];e++){let[s,i]=eX(t,n.slice(e+1));if(i){if(0===r.length&&s.length>0)continue;n=s;continue e}}return!1}return 0===n.length}catch(e){if(e instanceof eK)return!1;throw e}}function eX(e,t){let r=!1;for(;e.length>0;){r||0!==t.length||(r=!0);let n=e[0];if("["===n){let n="";r||(n=t[0]??"",t=t.slice(1));let s=!1;(e=e.slice(1)).length>0&&"^"===e[0]&&(s=!0,e=e.slice(1));let i=!1,a=0;for(;;){let t;if(e.length>0&&"]"===e[0]&&a>0){e=e.slice(1);break}[t,e]=e0(e);let r=t;"-"===e[0]&&([r,e]=e0(e.slice(1))),t<=n&&n<=r&&(i=!0),a++}i===s&&(r=!0)}else if("?"===n)r||("/"===t[0]&&(r=!0),t=t.slice(1)),e=e.slice(1);else if("\\"===n){if(0===(e=e.slice(1)).length)throw new eK("bad pattern");r||(e[0]!==t[0]&&(r=!0),t=t.slice(1)),e=e.slice(1)}else r||(e[0]!==t[0]&&(r=!0),t=t.slice(1)),e=e.slice(1)}return r?["",!1]:[t,!0]}function e0(e){if(0===e.length||"-"===e[0]||"]"===e[0]||"\\"===e[0]&&0===(e=e.slice(1)).length)throw new eK("bad pattern");let t=e[0]??"",r=e.slice(1);if(0===r.length)throw new eK("bad pattern");return[t,r]}(t=n||(n={}))[t.NoMatch=0]="NoMatch",t[t.Exclude=1]="Exclude",t[t.Include=2]="Include";class e1{inclusion;domain;parts;dirOnly;isGlob;constructor(e,t,r,n,s){this.domain=e,this.parts=t,this.inclusion=r,this.dirOnly=n,this.isGlob=s}match(e,t){let r=this.inclusion?n.Include:n.Exclude;if(e.length<=this.domain.length)return n.NoMatch;for(let t=0;t<this.domain.length;t++)if(e[t]!==this.domain[t])return n.NoMatch;let s=e.slice(this.domain.length);return(this.isGlob?this.globMatch(s,t):this.simpleNameMatch(s,t))?r:n.NoMatch}simpleNameMatch(e,t){for(let r=0;r<e.length;r++)if(eQ(this.parts[0]??"",e[r]??"")){if(this.dirOnly&&!t&&r===e.length-1)return!1;return!0}return!1}globMatch(e,t){let r=!1,n=!1,s=e;for(let e=0;e<this.parts.length;e++){let t=this.parts[e]??"";if(""===t){n=!1;continue}if("**"===t){if(e===this.parts.length-1)break;n=!0;continue}if(t.includes("**")||0===s.length)return!1;if(n)for(n=!1;;){if(0===s.length){r=!1;break}let e=s[0]??"";if(s=s.slice(1),eQ(t,e)){r=!0;break}}else{if(!eQ(t,s[0]??""))return!1;r=!0,s=s.slice(1)}}return r&&this.dirOnly&&!t&&0===s.length&&(r=!1),r}}let e2="defaults",e5=".gitignore",e8=".stigmerignore";(r=s||(s={}))[r.NoMatch=0]="NoMatch",r[r.Excluded=1]="Excluded",r[r.Included=2]="Included",r[r.DefaultDeny=3]="DefaultDeny",s.NoMatch,s.Excluded,s.Included,s.DefaultDeny;class e6{entries;constructor(e){this.entries=e}matchWithReason(e,t){let r,i,a=""===(r=e.replace(/\\/g,"/").replace(/^\.\//,""))||"."===r?[]:r.split("/");if(0===a.length)return{ignored:!1,reason:s.NoMatch,source:"",pattern:""};let o=n.NoMatch;for(let e of this.entries){let r=e.pattern.match(a,t);r!==n.NoMatch&&(i=e,o=r)}return void 0===i?{ignored:!1,reason:s.NoMatch,source:"",pattern:""}:o===n.Exclude?{ignored:!0,reason:i.source===e2?s.DefaultDeny:s.Excluded,source:i.source,pattern:i.raw}:{ignored:!1,reason:s.Included,source:i.source,pattern:i.raw}}match(e,t){return this.matchWithReason(e,t).ignored}patterns(){return this.entries.map(e=>`[${e.source}] ${e.raw}`)}}function e4(e,t){let r=[];for(let n of e){let e=n.trim();""===e||e.startsWith("#")||r.push({pattern:function(e,t){let r=e,n=!1;r.startsWith("!")&&(n=!0,r=r.slice(1)),r.endsWith("\\ ")||(r=r.replace(/ +$/,""));let s=!1;r.endsWith("/")&&(s=!0,r=r.slice(0,-1));let i=r.includes("/");return new e1(t,r.split("/"),n,s,i)}(e,[]),source:t,raw:e})}return r}let e9=new TextDecoder;async function e7(e){let t=function(e){let t=new j;for(let r of e.entries)_(r.path)||t.error("path-uncontained",{path:r.path});let r=new R(e),n=ep(r,t);if(void 0===n)return{ok:!1,errors:t.errors,warnings:t.warnings};let s=function(e,t,r){let n=[],s=new Map;for(let i of function(e,t,r){let n=new Set,s=t=>{for(let r of e.childDirectories(t)){let s=z(t,r);e.has(z(s,eF))&&n.add(s)}};s(eG);let i=t.manifests.flatMap(e=>e.skillPaths);for(let{path:t,manifest:a}of i)e.has(z(t,eF))?n.add(t):e.isDirectory(t)?s(t):r.warn("path-missing",{path:a,subject:""===t?".":`./${t}`});return 0===i.length&&!e.isDirectory(eG)&&e.has(eF)&&n.add(""),[...n].sort(E)}(e,t,r)){let a=function(e,t,r,n){let s,i=z(t,eF),a=U(e,i,"skillMd",n);if(void 0===a)return;let o=eW(a);if(!o.ok)return void n.error("missing"===o.reason?"skill-frontmatter-missing":"skill-frontmatter-unclosed",{path:i});let l=eB(o.yaml);if(!l.ok)return void n.error("skill-frontmatter-unreadable",{path:i,detail:l.detail});let d=""===t?r.name??"skill":D(t);if("string"==typeof l.fields.name&&""!==l.fields.name?s=l.fields.name:(s=d,n.warn("skill-name-defaulted",{path:i,subject:s})),!eU.test(s))return void n.error("skill-name-invalid",{path:i,subject:s});""!==t&&s!==d&&n.warn("skill-name-differs-from-directory",{path:i,subject:s,detail:d});let c=l.fields.description;return("string"!=typeof c||""===c)&&n.warn("skill-description-missing",{path:i,subject:s}),{name:s,..."string"==typeof c&&""!==c&&{description:c},dir:t,files:e.filesUnder(t)}}(e,i,t,r);if(void 0!==a){if(void 0!==s.get(a.name)){r.error("skill-name-duplicate",{subject:a.name,path:z(i,eF)});continue}s.set(a.name,i),n.push(a)}}return n}(r,n,t),i=function(e,t,r){let n=[],s=new Set,i=0;for(let a of t){let t=function(e,t,r){let n="agent-plugins"===t.dialect;if("inline"===t.kind){let e=F(t.servers)?t.servers.mcpServers:void 0,n=F(e)?e:t.servers;return F(n)?{path:t.manifest,servers:n}:void r.error("mcp-config-shape",{path:t.manifest})}if(!e.has(t.path))return void r.warn("path-missing",{path:t.manifest,subject:`./${t.path}`});let s=U(e,t.path,"mcpConfig",r);if(void 0===s)return;let i=B(s,t.path,"mcp-config-unreadable",r);if(void 0===i)return;if(n){let e=i.$schema;void 0===e?r.error("mcp-config-schema-missing",{path:t.path}):e!==m&&r.error("mcp-config-schema-unsupported",{path:t.path,detail:J(e)})}for(let[e]of Z(i))eC.has(e)||(n?r.error("mcp-config-field-unknown",{path:t.path,subject:e}):r.warn("mcp-config-field-ignored",{path:t.path,subject:e}));let a=i.mcpServers;return F(a)?{path:t.path,servers:a}:void r.error("mcp-config-shape",{path:t.path})}(e,a,r);if(void 0===t){i++;continue}for(let[e,o]of Z(t.servers)){if(s.has(e)){r.error("mcp-server-name-duplicate",{subject:e,path:t.path}),i++;continue}s.add(e);let l=function(e,t,r,n,s){let i={subject:e,path:r};if(!F(t))return void s.error("mcp-server-shape",i);let a=function(e,t,r,n){let s=e.type;if(void 0!==s&&"string"!=typeof s)return void n.error("mcp-server-field-type",{...t,detail:"type"});if(void 0===s){if(r)return void n.error("mcp-server-type-missing",t);let s=void 0!==e.command,i=void 0!==e.url;return s&&i?void n.error("mcp-server-type-ambiguous",t):s?"stdio":i?"http":void n.error("mcp-server-transport-unknown",t)}switch(s){case"stdio":return"stdio";case"streamable-http":return"http";case"http":if(r)return void n.error("mcp-server-type-unknown",{...t,detail:s});return"http";case"sse":return n.warn("mcp-server-sse-mapped",t),"http";default:n.error("mcp-server-type-unknown",{...t,detail:s});return}}(t,i,n,s);if(void 0===a)return;let o="stdio"===a?n?eN:eE:n?eA:eI,l=new Set,d=!0;for(let[e,r]of Z(t))if(!o.has(e))if(n)s.error("mcp-server-field-unknown",{...i,detail:e}),d=!1;else if("auth"===e)for(let e of(s.warn("mcp-server-auth-ignored",i),function e(t){return"string"==typeof t?[eS(t)]:Array.isArray(t)?t.flatMap(e):F(t)?Object.values(t).flatMap(e):[]}(r)))eT(e,l);else s.warn("mcp-server-field-ignored",{...i,detail:e});if(d)return"stdio"===a?function(e,t,r,n,s){let i=!0,a=()=>{i=!1},o=t.command;if(void 0===o)s.error("mcp-server-command-missing",r),a();else if("string"!=typeof o)s.error("mcp-server-field-type",{...r,detail:"command"}),a();else{let e=eM(o);void 0!==e?(s.error("mcp-server-plugin-root-reference",{...r,detail:e}),a()):o.startsWith("./")?(s.error("mcp-server-command-relative",{...r,detail:o}),a()):(""===o||/\s/.test(o)||o.includes("/"))&&(s.error("mcp-server-command-invalid",r),a())}let l=[],d=t.args;if(void 0!==d)if(G(d))for(let e of d){let t=eS(e),i=eM(t);if(void 0!==i){s.error("mcp-server-plugin-root-reference",{...r,detail:i}),a();continue}eT(t,n),l.push(t)}else s.error("mcp-server-field-type",{...r,detail:"args"}),a();let c=t.env;if(void 0!==c)if(q(c))for(let[e,t]of Object.entries(c)){if(ex.has(e)){s.error("mcp-server-plugin-root-reference",{...r,detail:e}),a();continue}if(!ew.test(e)){s.error("variable-name-invalid",{subject:e,path:r.path}),a();continue}let i=eS(t),o=eM(i);if(void 0!==o){s.error("mcp-server-plugin-root-reference",{...r,detail:o}),a();continue}let l=function(e){let t=/^\$\{([A-Za-z_][A-Za-z0-9_]*)\}$/.exec(e);return t?.[1]}(i);void 0===l?(s.error("mcp-server-env-literal",{...r,detail:e}),a()):l!==e?(s.error("mcp-server-env-rename",{...r,detail:e}),a()):n.add(e)}else s.error("mcp-server-field-type",{...r,detail:"env"}),a();if(void 0!==t.cwd&&(s.error("mcp-server-cwd-unsupported",r),a()),i&&"string"==typeof o)return{name:e,transport:"stdio",command:o,args:l,env:[...n].sort()}}(e,t,i,l,s):function(e,t,r,n,s){let i,a=!0,o=()=>{a=!1},l=t.url;if(void 0===l)s.error("mcp-server-url-missing",r),o();else if("string"!=typeof l)s.error("mcp-server-field-type",{...r,detail:"url"}),o();else{let e=eM(i=eS(l));void 0!==e?(s.error("mcp-server-plugin-root-reference",{...r,detail:e}),o()):eP(i).length>0?(s.error("mcp-server-url-variable",r),o()):!function(e){var t;let r;try{r=new URL(e)}catch{return!1}return""===r.username&&""===r.password&&""===r.hash&&("https:"===r.protocol||"http:"===r.protocol&&("localhost"===(t=r.hostname)||"[::1]"===t||"::1"===t||/^127\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(t)))}(i)&&(s.error("mcp-server-url-invalid",{...r,detail:i}),o())}let d=[],c=t.headers;if(void 0!==c)if(q(c)){let e=new Set;for(let[t,i]of Object.entries(c)){if(!e_.test(t)){s.error("mcp-server-header-invalid",{...r,detail:t}),o();continue}let a=t.toLowerCase();if(e.has(a)){s.error("mcp-server-header-duplicate",{...r,detail:t}),o();continue}e.add(a);let l=eS(i),c=eM(l);if(void 0!==c){s.error("mcp-server-plugin-root-reference",{...r,detail:c}),o();continue}eT(l,n),d.push([t,l])}}else s.error("mcp-server-field-type",{...r,detail:"headers"}),o();if(a&&void 0!==i)return{name:e,transport:"http",url:i,headers:Object.fromEntries(d),env:[...n].sort()}}(e,t,i,l,s)}(e,o,t.path,"agent-plugins"===a.dialect,r);void 0!==l?n.push(l):i++}}return{servers:n,refused:i,declaredNames:s}}(r,n.mcpSources,t),a=i.servers,o=function(e,t,r){let n=new Map,s=new Map;for(let t of e.manifests){let e=t.variables;if(void 0!==e)for(let t of"cursor"===e.dialect?function(e,t,r){if(!F(e)||"object"!==e.type)return r.error("manifest-field-type",{path:t,subject:"variables",detail:"a JSON Schema object with type 'object'"}),[];let n=e.properties??{};if(!F(n))return r.error("manifest-field-type",{path:t,subject:"variables.properties",detail:"an object"}),[];let s=e.required??[];if(!G(s))return r.error("manifest-field-type",{path:t,subject:"variables.required",detail:"an array of strings"}),[];let i=[];for(let[e,a]of Z(n)){if(!ew.test(e)){r.error("variable-name-invalid",{subject:e,path:t});continue}let n=F(a)?a:{},o=n.type;void 0!==o&&"string"!==o&&r.warn("variable-type-narrowed",{subject:e,path:t,detail:J(o)}),void 0!==n.default&&r.warn("variable-default-dropped",{subject:e,path:t}),void 0!==n.enum&&r.warn("variable-option-dropped",{subject:e,path:t,detail:"enum"});let l=eJ(n);i.push({name:e,...void 0!==l&&{description:l},isSecret:!0,optional:!s.includes(e),declaredBy:"cursor"})}return i}(e.value,e.manifest,r):function(e,t,r){if(!F(e))return r.error("manifest-field-type",{path:t,subject:"userConfig",detail:"an object"}),[];let n=[];for(let[s,i]of Z(e)){if(!ew.test(s)){r.error("variable-name-invalid",{subject:s,path:t});continue}if(!F(i)){r.error("manifest-field-type",{path:t,subject:`userConfig.${s}`,detail:"an object"});continue}let e=i.type;for(let n of(void 0!==e&&"string"!==e&&r.warn("variable-type-narrowed",{subject:s,path:t,detail:J(e)}),void 0!==i.default&&r.warn("variable-default-dropped",{subject:s,path:t}),["options","multiple","min","max"]))void 0!==i[n]&&r.warn("variable-option-dropped",{subject:s,path:t,detail:n});let a=eJ(i);n.push({name:s,...void 0!==a&&{description:a},isSecret:!0===i.sensitive,optional:!0!==i.required,declaredBy:"claude"})}return n}(e.value,e.manifest,r))n.has(t.name)||(n.set(t.name,t),s.set(t.name,e.manifest))}let i=new Map;for(let e of t.servers)for(let t of e.env)i.has(t)||i.set(t,e.name);if(0===t.refused)for(let[e,t]of n)i.has(e)||r.warn("variable-unreferenced",{subject:t.name,path:s.get(e)});let a=[];for(let[e,t]of[...i].sort(([e],[t])=>e<t?-1:+(e>t)))n.has(e)||(r.warn("variable-inferred",{subject:e,detail:t}),a.push({name:e,isSecret:!0,optional:!1,declaredBy:"inferred"}));return[...n.values(),...a]}(n,i,t),l=function(e,t,r,n){if(!t.readsAgents)return[];let s=new Set(r.map(e=>e.name)),i=[],a=new Set;for(let r of function(e,t,r){let n=new Set,s=t=>{for(let r of e.childFiles(t))r.endsWith(".md")&&n.add(z(t,r))},i=t.manifests.flatMap(e=>e.agentPaths??[]);for(let{path:a,manifest:o}of(t.manifests.every(e=>void 0===e.agentPaths)&&s("agents"),i))""!==a&&e.has(a)&&a.endsWith(".md")?n.add(a):e.isDirectory(a)?s(a):r.warn("path-missing",{path:o,subject:""===a?".":`./${a}`});return[...n].sort(E)}(e,t,n)){let t=function(e,t,r,n){let s,i,a=U(e,t,"subAgent",n);if(void 0===a)return;let o=eW(a),l={},d=a;if(o.ok){let e=eB(o.yaml);if(!e.ok)return void n.error("sub-agent-frontmatter-unreadable",{path:t,detail:e.detail});l=e.fields,d=o.body}else if("unclosed"===o.reason)return void n.error("sub-agent-frontmatter-unreadable",{path:t,detail:"the frontmatter is not closed (missing the closing '---')"});let c=D(t).replace(/\.md$/,"");"string"==typeof l.name&&""!==l.name?s=l.name:(s=c,n.warn("sub-agent-name-defaulted",{path:t,subject:s}));let u=d.trim();if(u.length<10)return void n.error("sub-agent-instructions-short",{path:t,subject:s,detail:String(10)});let p=l.description,f=l.skills,h=[];if(Array.isArray(f))for(let e of f)"string"==typeof e&&(r.has(e)?h.push(e):n.warn("sub-agent-skill-unknown",{path:t,subject:s,detail:e}));let m=l.model;for(let e of("string"==typeof m&&""!==m.trim()&&"unknown"===(i=function(e){let t=e.trim().toLowerCase();return{raw:e,alias:"inherit"===t?"inherit":"fast"===t?"fast":t.includes("haiku")?"haiku":t.includes("sonnet")?"sonnet":t.includes("opus")?"opus":"unknown"}}(m)).alias&&n.warn("sub-agent-model-unknown",{path:t,subject:s,detail:m}),Object.keys(l)))eq.has(e)||n.warn("sub-agent-field-ignored",{path:t,subject:s,detail:e});return{name:s,..."string"==typeof p&&""!==p&&{description:p},instructions:u,skillNames:h,...void 0!==i&&{modelHint:i},path:t}}(e,r,s,n);if(void 0!==t){if(a.has(t.name)){n.error("sub-agent-name-duplicate",{subject:t.name,path:r});continue}a.add(t.name),i.push(t)}}return i}(r,n,s,t),d=function(e,t,r){let n={workflows:[],mcpServers:[]},s=[],i=[];for(let a of e.filesUnder(eO)){if(a===ez){let t=W(e,a,"overlay",r);void 0!==t&&(n.agent={path:a,bytes:t});continue}let o=function(e){let t=D(e);return t.endsWith(".yaml")&&t.length>5?t.slice(0,-5):void 0}(a);if(void 0!==o&&L(a)===eD){let t=W(e,a,"overlay",r);void 0!==t&&s.push({path:a,bytes:t,name:o});continue}if(void 0!==o&&L(a)===eL){if(!t.has(o)){r.error("overlay-server-unknown",{path:a,subject:o});continue}let n=W(e,a,"overlay",r);void 0!==n&&i.push({path:a,bytes:n,server:o});continue}r.error("overlay-document-unknown",{path:a})}return n.workflows=s,n.mcpServers=i,n}(r,i.declaredNames,t),c=function(e){let t=new Set,r=[];for(let n of e)for(let e of n){let n=`${e.kind}\u0000${e.path}`;t.has(n)||(t.add(n),r.push(e))}return r}([function(e,t){let r=[];for(let n of e.childDirectories("")){let e=eb[n];void 0!==e&&r.push({kind:e,path:`${n}/`}),"agents"!==n||t||r.push({kind:"agents",path:`${n}/`})}for(let t of e.childFiles("")){let e=ey[t];void 0!==e&&r.push({kind:e,path:t})}return r}(r,n.readsAgents),...n.manifests.map(e=>e.ignored)]);if(t.errors.length>0||void 0===n.name)return{ok:!1,errors:t.errors,warnings:t.warnings};let u=n.manifests[0]?.identity??{};return{ok:!0,plugin:{name:n.name,...void 0!==u.version&&{version:u.version},...void 0!==u.description&&{description:u.description},...void 0!==u.author&&{author:u.author},...void 0!==u.homepage&&{homepage:u.homepage},...void 0!==u.repository&&{repository:u.repository},...void 0!==u.license&&{license:u.license},keywords:u.keywords??[],dialect:n.dialect,manifestsFound:n.manifests.map(e=>e.path),skills:s,mcpServers:a,subAgents:l,variables:o,overlay:d,ignored:c},warnings:t.warnings}}(e.files);if(!t.ok)return{ok:!1,kind:"refused",errors:t.errors,warnings:t.warnings};let r=function(e){let t={};for(let r of e.entries)t[r.path]=e.read(r.path);return(0,eZ.zipSync)(t,{level:6,mtime:eY})}(e.files);return{ok:!0,prepared:{plugin:t.plugin,warnings:t.warnings,files:e.files,stats:e.stats,archive:r,digest:await eH(r)}}}async function e3(e,t){let r=new Map(e.map(e=>[e.path,e])),n=new Map,s=async e=>{let t=r.get(e);if(void 0===t)throw Error(`plugin file '${e}' is not listed`);n.set(e,await t.read())};await Promise.all([e5,e8].filter(e=>r.has(e)).map(e=>s(e)));let{maxBytes:i,...a}=t,o=function(e,t,r){var n,s,i;let a,o,l,d=new Map(e.map(e=>[e.path,e])),c=(a=[],(n={includeDefaults:!0,...r.respectGitignore&&d.has(e5)&&{gitignore:(s=t(e5),e9.decode(s))},...d.has(e8)&&{stigmerignore:(i=t(e8),e9.decode(i))},...void 0!==r.extraIgnore&&{extraIgnore:r.extraIgnore},...void 0!==r.extraInclude&&{extraInclude:r.extraInclude}}).includeDefaults&&a.push(...e4(eV,e2)),void 0!==n.gitignore&&a.push(...e4(n.gitignore.split(/\r?\n/),e5)),void 0!==n.stigmerignore&&a.push(...e4(n.stigmerignore.split(/\r?\n/),e8)),o=n.extraIgnore??[],l=n.extraInclude??[],(o.length>0||l.length>0)&&a.push(...function(e,t){let r=e4(e,"cli"),n=[];for(let e of t){let t=e.trim();""!==t&&n.push(t.startsWith("!")?t:`!${t}`)}return r.push(...e4(n,"cli")),r}(o,l)),new e6(a)),u={filesIncluded:0,filesIgnored:0,dirsSkipped:0,totalSize:0},p=new Set,f=[];for(let t of[...e].sort((e,t)=>(function(e,t){let r=e.split("/"),n=t.split("/"),s=Math.min(r.length,n.length);for(let e=0;e<s;e++){let t=r[e]??"",s=n[e]??"";if(t!==s)return t<s?-1:1}return r.length-n.length})(e.path,t.path)))if(!function(e,t,r,n){let s=e.split("/"),i="";for(let e=0;e<s.length-1;e++){if(i=""===i?s[e]??"":`${i}/${s[e]??""}`,r.has(i))return!0;if(t.matchWithReason(i,!0).ignored)return r.add(i),n.dirsSkipped++,!0}return!1}(t.path,c,p,u)){if(c.matchWithReason(t.path,!1).ignored){u.filesIgnored++;continue}f.push({path:t.path,size:t.size}),u.filesIncluded++,u.totalSize+=t.size}return{files:{entries:f,read(e){if(!d.has(e))throw Error(`plugin file '${e}' is not listed`);return t(e)}},stats:u,matcher:c}}(e,e=>{let t=n.get(e);if(void 0===t)throw Error(`plugin file '${e}' was not read before selection asked for it`);return t},a);return void 0!==i&&o.stats.totalSize>i?{ok:!1,kind:"too-large",selectedBytes:o.stats.totalSize,maxBytes:i}:(await Promise.all(o.files.entries.filter(e=>!n.has(e.path)).map(e=>s(e.path))),e7(o))}e.s(["preparePluginFromTree",0,e3],802087);class te extends Error{reason;constructor(e,t){super(e),this.reason=t,this.name="MarketplaceSourceError"}}let tt={entries:2e4,pluginBytes:0x6400000};function tr(e){return`${(e/1048576).toFixed(1)} MiB`}e.s(["MARKETPLACE_TREE_LIMITS",0,tt,"MarketplaceSourceError",0,te,"formatMib",0,tr],321252);class tn extends Error{subject;errors;warnings;constructor(e,t,r){super(`${e}: ${1===t.length?"1 problem":`${t.length} problems`} found`),this.subject=e,this.errors=t,this.warnings=r,this.name="PluginReadRefusal"}}async function ts(e){let t=new Set(Object.values(x)),r=e.files.filter(e=>t.has(e.path)),n=new Map;await Promise.all(r.map(async t=>{n.set(t.path,await e.fetchFile(t.path))}));let s=function(e,t){var r,n,s;let i,a=new C,o=new R(e),l=function(e){for(let t of eh){let r=x[t];if(e.has(r))return{dialect:t,path:r}}}(o);if(void 0===l)return a.error("marketplace-not-found"),em(a);let{dialect:d,path:c}=l,u=function(e,t,r){let n,s=N.marketplace,i=e.entry(t);if(void 0===i)throw Error(`marketplace file '${t}' is not listed`);if(i.size>s)return void r.error("marketplace-too-large",{path:t,subject:String(i.size),detail:String(s)});let a=e.files.read(t);if(a.length>s)return void r.error("marketplace-too-large",{path:t,subject:String(a.length),detail:String(s)});try{n=JSON.parse(I(a))}catch(e){r.error("marketplace-unreadable",{path:t,detail:e instanceof Error?e.message:String(e)});return}return F(n)?n:void r.error("marketplace-unreadable",{path:t,detail:"the document is not a JSON object"})}(o,c,a);if(void 0===u)return em(a);let p=(r=u,n=c,s=a,void 0===(i=r.name)?void s.error("marketplace-name-missing",{path:n}):"string"!=typeof i?void s.error("marketplace-field-type",{path:n,subject:"name",detail:"a string"}):ef(i)?i:void s.error("marketplace-name-invalid",{path:n,subject:i})),f=function(e,t,r,n){let s=e.plugins;if(void 0===s)return n.error("marketplace-plugins-missing",{path:r}),[];if(!Array.isArray(s))return n.error("marketplace-field-type",{path:r,subject:"plugins",detail:"an array"}),[];let i="claude"===t?function(e){let t=e.metadata;if(!F(t))return"";let r=eg(t,"pluginRoot");if(void 0===r)return"";let n=ev(r);return n.ok?n.dir:""}(e):"",a=[],o=new Set;return s.forEach((e,s)=>{let l;if(!F(e))return void n.error("entry-shape",{path:r,subject:String(s)});let d=e.name;if(void 0===d)return void n.error("entry-name-missing",{path:r,subject:String(s)});if("string"!=typeof d||!ef(d))return void n.error("entry-name-invalid",{path:r,subject:J(d)});if(o.has(d))return void n.error("entry-name-duplicate",{path:r,subject:d});o.add(d);let c=eg(e,"description");a.push({name:d,dir:function(e,t,r,n,s){var i,a,o,l;let d;if(void 0===e)return void s.error("entry-source-missing",{path:n,subject:t});if("string"==typeof e){if(i=e,/^[a-z][a-z0-9+.-]*:\/\//i.test(i))return void s.warn("entry-source-unsupported",{path:n,subject:t,detail:e});d=e}else{if(!F(e)||"local"!==e.source||"string"!=typeof e.path){return void s.warn("entry-source-unsupported",{path:n,subject:t,detail:F(a=e)&&"string"==typeof a.source?a.source:J(a)})}d=e.path}let c=ev(d);return c.ok?(o=r,l=c.dir,""===o?l:""===l?o:`${o}/${l}`):void s.error("entry-source-escapes-root",{path:n,subject:t,detail:d})}(e.source,d,i,r,n),...void 0!==c&&{description:c},installedByDefault:"codex"===t&&F(l=e.policy)&&"INSTALLED_BY_DEFAULT"===l.installation})}),a}(u,d,c,a),h="tree"===t?function(e,t,r,n){let s=[];for(let i of e)if(void 0!==i.dir){if(!t.isDirectory(i.dir)){n.warn("entry-directory-missing",{path:r,subject:i.name,detail:""===i.dir?".":i.dir});continue}if(!eu(function(e,t){let r=""===t?"":`${t}/`;return e.filesUnder(t).map(e=>e.slice(r.length))}(t,i.dir))){n.warn("entry-not-a-plugin",{path:r,subject:i.name,detail:""===i.dir?".":i.dir});continue}s.push({name:i.name,dir:i.dir,...void 0!==i.description&&{description:i.description}})}return s}(f,o,c,a):function(e){let t=[];for(let r of e)void 0!==r.dir&&t.push({name:r.name,dir:r.dir,...void 0!==r.description&&{description:r.description}});return t}(f),m=function(e,t,r,n,s,i){let a,o=new Set(t.map(e=>e.name)),l=new Set(r.map(e=>e.name));if("stigmer"===n){let t=e.defaults;void 0===t?a=[]:G(t)?a=t:(i.error("marketplace-field-type",{path:s,subject:"defaults",detail:"an array of strings"}),a=[])}else a="codex"===n?t.filter(e=>e.installedByDefault).map(e=>e.name):[];let d=[];for(let e of a){if(!o.has(e)){i.error("default-unknown",{path:s,subject:e});continue}l.has(e)&&!d.includes(e)&&d.push(e)}return d}(u,f,h,d,c,a);if(a.errors.length>0||void 0===p)return em(a);let g=function(e,t){switch(t){case"stigmer":return eg(e,"description");case"claude":case"cursor":{let t=e.metadata;return F(t)?eg(t,"description"):void 0}case"codex":return;default:return t}}(u,d),v=function(e){let t=e.owner;if(!F(t))return;let r=eg(t,"name"),n=eg(t,"email"),s=eg(t,"url");if(void 0!==r||void 0!==n||void 0!==s)return{...void 0!==r&&{name:r},...void 0!==n&&{email:n},...void 0!==s&&{url:s}}}(u);return{ok:!0,marketplace:{name:p,...void 0!==g&&{description:g},...void 0!==v&&{owner:v},dialect:d,path:c,plugins:h,defaults:m},warnings:a.warnings}}({entries:[...e.files].sort((e,t)=>e.path<t.path?-1:+(e.path>t.path)),read(e){let t=n.get(e);if(void 0===t)throw Error(`marketplace read asked for '${e}', which is not a marketplace file`);return t}},"tree");if(!s.ok)throw new tn(`${e.describe} is not a marketplace this console can read`,s.errors,s.warnings);return{tree:e,marketplace:s.marketplace,warnings:s.warnings}}function ti(e,t){return e.plugins.find(e=>e.name===t)}async function ta(e,t){let r=""===t.dir?"":`${t.dir}/`,n=e.tree.files.filter(e=>e.path.startsWith(r)).map(t=>({path:t.path.slice(r.length),size:t.size,read:()=>e.tree.fetchFile(t.path)})),s=n.reduce((e,t)=>e+t.size,0);if(s>tt.pluginBytes)throw to(t.name,s);let i=await e3(n,{respectGitignore:!0,maxBytes:tt.pluginBytes});if(!i.ok)switch(i.kind){case"refused":throw new tn(`'${t.name}' cannot be installed`,i.errors,i.warnings);case"too-large":throw to(t.name,i.selectedBytes);default:return i}let{plugin:a,warnings:o,stats:l,archive:d,digest:c}=i.prepared;return{origin:{kind:"source",entry:t,tree:e.tree.describe},plugin:a,warnings:o,stats:l,archive:d,digest:c}}function to(e,t){return new te(`'${e}' is ${tr(t)} of files, over the ${tr(tt.pluginBytes)} a plugin archive may carry`,"too-large")}function tl({prepared:e,relation:t,className:r}){let{plugin:n}=e;return(0,i.jsxs)("div",{className:(0,o.cn)("stg:flex stg:flex-col stg:gap-5",r),children:[(0,i.jsx)(tp,{title:"Plugin",children:(0,i.jsx)(tf,{rows:[["Name",n.name],["Version",n.version??""],["Format",p.DIALECT_LABELS[n.dialect]],["Files",`${e.stats.filesIncluded} read`]]})}),(0,i.jsxs)(tp,{title:"Installs",children:[(0,i.jsx)(tf,{rows:[["Skills",th(n.skills.map(e=>e.name))],["MCP servers",th(n.mcpServers.map(e=>`${e.name} (${e.transport})`))],["Sub-agents",th(n.subAgents.map(e=>e.name))],["Variables",th(n.variables.map(e=>`${e.name}${e.optional?" (optional)":""}${"inferred"===e.declaredBy?" (inferred)":""}`))]]}),n.variables.length>0&&(0,i.jsx)("p",{className:"stg:mt-2 stg:text-xs stg:text-muted-foreground",children:"The agent asks for these the first time you start a session on it, and saves them to your personal environment."})]}),e.warnings.length>0&&(0,i.jsx)(tp,{title:"Warnings",children:(0,i.jsx)("ul",{className:"stg:list-disc stg:space-y-1 stg:pl-5 stg:text-sm stg:text-foreground",children:e.warnings.map((e,t)=>(0,i.jsx)("li",{children:e.message},`${e.kind}:${t}`))})}),n.ignored.length>0&&(0,i.jsx)(tp,{title:"Not installed",children:(0,i.jsx)("ul",{className:(0,o.cn)(f.UNSTYLED_LIST,"stg:space-y-0.5 stg:text-sm stg:text-muted-foreground"),children:n.ignored.map(e=>(0,i.jsxs)("li",{children:[e.kind," ",(0,i.jsxs)("span",{className:"stg:font-mono stg:text-xs",children:["(",e.path,")"]})]},e.path))})}),t&&(0,i.jsx)(tc,{relation:t,name:n.name})]})}function td(e){switch(e.kind){case"source":return e.tree;case"upload":return"zip"===e.pick?`${e.name}${void 0===e.rerooted?"":` (read from its '${e.rerooted}/' folder)`}`:`the folder '${e.name}'`;default:return e}}function tc({relation:e,name:t}){switch(e){case"installed":return(0,i.jsxs)("p",{role:"status",className:"stg:text-sm stg:text-muted-foreground",children:["This exact version of '",t,"' is already installed; there is nothing to do."]});case"upgrade":return(0,i.jsxs)("p",{role:"status",className:"stg:text-sm stg:text-foreground",children:["'",t,"' is already installed at another version. Installing replaces its skills, servers and agent with this version's, whichever source it came from; the agent is re-created, so a session bound to the previous one does not follow."]});case"not-installed":return null;default:return e}}function tu({error:e,retry:t,hint:r}){return e instanceof tn?(0,i.jsxs)("div",{role:"alert",className:"stg:rounded-md stg:border stg:border-destructive stg:p-3 stg:text-sm",children:[(0,i.jsxs)("p",{className:"stg:font-medium stg:text-foreground",children:[e.subject,":"]}),(0,i.jsx)("ul",{className:"stg:mt-1 stg:list-disc stg:space-y-0.5 stg:pl-5 stg:text-foreground",children:e.errors.map((e,t)=>(0,i.jsx)("li",{children:e.message},`e${t}`))}),e.warnings.length>0&&(0,i.jsx)("ul",{className:"stg:mt-2 stg:list-disc stg:space-y-0.5 stg:pl-5 stg:text-muted-foreground",children:e.warnings.map((e,t)=>(0,i.jsx)("li",{children:e.message},`w${t}`))}),r&&(0,i.jsx)("p",{className:"stg:mt-2 stg:text-muted-foreground",children:r})]}):(0,i.jsx)(d.ErrorMessage,{error:e,...t&&{retry:t},title:"The plugin could not be read"})}function tp({title:e,children:t}){return(0,i.jsxs)("section",{children:[(0,i.jsx)("h3",{className:"stg:mb-1.5 stg:text-xs stg:font-medium stg:uppercase stg:tracking-wider stg:text-muted-foreground",children:e}),(0,i.jsx)("div",{className:"stg:rounded-md stg:border stg:border-border stg:p-3",children:t})]})}function tf({rows:e}){return(0,i.jsx)("dl",{className:"stg:grid stg:grid-cols-[auto_1fr] stg:gap-x-4 stg:gap-y-1 stg:text-sm",children:e.filter(([,e])=>""!==e).map(([e,t])=>(0,i.jsxs)("div",{className:"stg:contents",children:[(0,i.jsx)("dt",{className:"stg:text-muted-foreground",children:e}),(0,i.jsx)("dd",{className:"stg:min-w-0 stg:break-words stg:text-foreground",children:t})]},e))})}function th(e){return 0===e.length?"none":`${e.length}: ${e.join(", ")}`}e.s(["PluginReadRefusal",0,tn,"findEntry",0,ti,"openMarketplace",0,ts,"prepareEntry",0,ta],961378),e.s(["InstallPreview",0,tl,"PrepareRefusal",0,tu,"describeOrigin",0,td],427187);var tm=e.i(891287),tg=e.i(44454),tv=e.i(586108),tb=e.i(326283);function ty(){let e=(0,tv.useStigmer)(),[t,r]=(0,a.useState)(!1),[n,s]=(0,a.useState)(null),i=(0,a.useCallback)(async(t,n)=>{r(!0),s(null);try{let r=await e.plugin.push((0,tm.create)(tg.PushPluginRequestSchema,{org:n.org,artifact:t.archive,message:void 0===n.installedFrom?"upload"===t.origin.kind?"uploaded from the console":"installed from the console":`installed from marketplace '${n.installedFrom}'`,...void 0!==n.visibility&&{visibility:n.visibility}})),s=(await e.plugin.listMembers(r.metadata?.id??"")).members;return{plugin:r,members:s}}catch(t){let e=(0,tb.toError)(t);throw s(e),e}finally{r(!1)}},[e]),o=(0,a.useCallback)(()=>s(null),[]);return(0,a.useMemo)(()=>({install:i,isInstalling:t,error:n,clearError:o}),[i,t,n,o])}e.s(["useInstallPlugin",0,ty],775106);var t$=e.i(583093),tw=e.i(203941),tj=e.i(910304);function tk(e,t){let r=(0,tv.useStigmer)(),n=e?.plugin.name??null,s=e?.digest??null,{data:i,isLoading:o,error:l,refetch:d}=(0,t$.useFetch)(n&&t?()=>r.plugin.getByReference({org:t,slug:n}).catch(e=>{if((0,tj.isNotFound)(e))return null;throw e}):null,[n,t,r],void 0),c=(0,a.useMemo)(()=>{if(void 0===i||null===s)return null;if(null===i)return"not-installed";let e=i.status;return e?.digest===s&&e.state===tw.PluginState.READY?"installed":"upgrade"},[i,s]);return(0,a.useMemo)(()=>({installed:i??null,relation:c,isLoading:o,error:l,refetch:d}),[i,c,o,l,d])}function tx({opened:e,entryName:t,sourceName:r,org:n,onClose:s,onInstalled:o}){let c,p,f,{prepared:h,relation:m,isPreparing:g,error:v,refetch:b}=(c=e&&t?ti(e.marketplace,t):void 0,f=tk((p=(0,t$.useFetch)(e&&c?()=>ta(e,c):null,[e,c],null)).data,n),(0,a.useMemo)(()=>({prepared:p.data,installed:f.installed,relation:f.relation,isPreparing:p.isLoading||f.isLoading,error:p.error??f.error,refetch:p.refetch}),[p.data,p.isLoading,p.error,p.refetch,f])),{install:y,isInstalling:$,error:w,clearError:j}=ty(),[k,x]=(0,a.useState)(null);(0,a.useEffect)(()=>{j(),x(null)},[t,j]);let S=(0,a.useCallback)(async()=>{if(h)try{let e=await y(h,{org:n,installedFrom:r});x(e),o?.(e)}catch{}},[h,y,n,r,o]),M="upgrade"===m?`Upgrade ${t}`:`Install ${t}`;return(0,i.jsxs)("div",{className:"stg:flex stg:flex-col stg:gap-5",children:[(0,i.jsx)("header",{className:"stg:flex stg:items-start stg:justify-between stg:gap-4",children:(0,i.jsxs)("div",{children:[(0,i.jsx)("h2",{className:"stg:text-base stg:font-semibold stg:text-foreground",children:M}),(0,i.jsxs)("p",{className:"stg:mt-0.5 stg:text-xs stg:text-muted-foreground",children:["From ",r," (",h?td(h.origin):e.tree.describe,") into ",n]})]})}),g&&(0,i.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-2 stg:text-sm stg:text-muted-foreground",role:"status",children:[(0,i.jsx)(u.SpinnerIcon,{className:"stg:size-4"}),"Reading the plugin's files…"]}),v&&(0,i.jsx)(tu,{error:v,retry:b}),h&&!g&&(0,i.jsx)(tl,{prepared:h,relation:m}),w&&(0,i.jsx)(d.ErrorMessage,{error:w,title:"The server refused the install"}),k&&(0,i.jsxs)("div",{role:"status",className:"stg:rounded-md stg:border stg:border-border stg:bg-muted stg:p-3 stg:text-sm stg:text-foreground",children:["Installed plugin '",k.plugin.metadata?.slug,"' (",tS(k),")."]}),(0,i.jsxs)("footer",{className:"stg:flex stg:justify-end stg:gap-2 stg:pt-1",children:[(0,i.jsx)(l.Button,{variant:"outline",size:"sm",onClick:s,children:k?"Close":"Cancel"}),!k&&(0,i.jsx)(l.Button,{variant:"primary",size:"sm",onClick:S,disabled:!h||g||$||"installed"===m,children:$?"Installing…":"upgrade"===m?"Upgrade":"Install"})]})]})}function tS(e){let t=e.plugin.status?.materialized,r=[tM(t?.skills??0,"skill"),tM(t?.mcpServers??0,"MCP server"),tM(t?.agents??0,"agent")];return void 0!==t&&t.workflows>0&&r.push(tM(t.workflows,"workflow")),r.join(", ")}function tM(e,t){return`${e} ${t}${1===e?"":"s"}`}e.s(["useInstallRelation",0,tk],816053),e.s(["PluginInstallDialog",0,function({opened:e,entryName:t,sourceName:r,org:n,open:s,onClose:a,onInstalled:l,className:d}){return s&&null!==e&&null!==t?(0,i.jsx)(c.DialogShell,{open:!0,onOpenChange:e=>{e||a()},width:"lg",className:(0,o.cn)("stg:max-h-[85vh] stg:bg-card stg:text-foreground",d),"aria-label":`Install ${t}`,children:(0,i.jsx)("div",{className:"stg:flex stg:max-h-[85vh] stg:flex-col stg:overflow-y-auto stg:p-6",children:(0,i.jsx)(tx,{opened:e,entryName:t,sourceName:r,org:n,onClose:a,onInstalled:l})})}):null},"summariseInstall",0,tS],830419)}]);