@stigmer/server-slim 3.17.0 → 3.18.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 +16 -16
  4. package/console/__next._head.txt +4 -4
  5. package/console/__next._index.txt +10 -10
  6. package/console/__next._tree.txt +2 -2
  7. package/console/_next/static/chunks/{04hrkprhk3cjo.js → 0.cr0e7bzkpoi.js} +3 -3
  8. package/console/_next/static/chunks/0.ocu5b3uajbn.js +1 -0
  9. package/console/_next/static/chunks/{16ukgtm3fhab~.js → 06qoer~dl1svs.js} +2 -2
  10. package/console/_next/static/chunks/071fdr3kvata1.js +1 -0
  11. package/console/_next/static/chunks/{0s5t77.~jqey1.js → 0_3utrn1at0vi.js} +1 -1
  12. package/console/_next/static/chunks/0_j8~rfb.1ufy.js +1 -0
  13. package/console/_next/static/chunks/0auyo62rglco8.js +1 -0
  14. package/console/_next/static/chunks/{0xp6mamoqde.n.js → 0fgcvnc-b_oz_.js} +1 -1
  15. package/console/_next/static/chunks/0gz8yljnjzsmu.js +1 -0
  16. package/console/_next/static/chunks/{107065384mt73.js → 0hc-53ypd.8xp.js} +1 -1
  17. package/console/_next/static/chunks/0hca-f9-nua.e.js +1 -0
  18. package/console/_next/static/chunks/0j~6628v9z3k-.js +1 -0
  19. package/console/_next/static/chunks/0pxd7smgb31vs.js +1 -0
  20. package/console/_next/static/chunks/0rs1tuslqwnz3.js +1 -0
  21. package/console/_next/static/chunks/0s6bm1sujua~8.css +1 -0
  22. package/console/_next/static/chunks/0xq42ojv80jqz.js +1 -0
  23. package/console/_next/static/chunks/{0dmmn-x2crcuv.js → 0xs_3fux3hsk3.js} +2 -2
  24. package/console/_next/static/chunks/{127-4s-8utcan.js → 0yheev3nzjrip.js} +1 -1
  25. package/console/_next/static/chunks/0yuo~koxf.2fn.js +1 -0
  26. package/console/_next/static/chunks/0zzf3a9srn32x.js +1 -0
  27. package/console/_next/static/chunks/110bry9pdkk8s.js +5 -0
  28. package/console/_next/static/chunks/17pusweun3t84.js +1 -0
  29. package/console/_not-found/__next._full.txt +16 -16
  30. package/console/_not-found/__next._head.txt +4 -4
  31. package/console/_not-found/__next._index.txt +10 -10
  32. package/console/_not-found/__next._not-found.__PAGE__.txt +3 -3
  33. package/console/_not-found/__next._not-found.txt +3 -3
  34. package/console/_not-found/__next._tree.txt +2 -2
  35. package/console/_not-found.html +1 -1
  36. package/console/_not-found.txt +16 -16
  37. package/console/auth/callback/__next._full.txt +18 -18
  38. package/console/auth/callback/__next._head.txt +4 -4
  39. package/console/auth/callback/__next._index.txt +10 -10
  40. package/console/auth/callback/__next._tree.txt +2 -2
  41. package/console/auth/callback/__next.auth.callback.__PAGE__.txt +4 -4
  42. package/console/auth/callback/__next.auth.callback.txt +3 -3
  43. package/console/auth/callback/__next.auth.txt +3 -3
  44. package/console/auth/callback.html +1 -1
  45. package/console/auth/callback.txt +18 -18
  46. package/console/auth/github/callback/__next._full.txt +18 -18
  47. package/console/auth/github/callback/__next._head.txt +4 -4
  48. package/console/auth/github/callback/__next._index.txt +10 -10
  49. package/console/auth/github/callback/__next._tree.txt +2 -2
  50. package/console/auth/github/callback/__next.auth.github.callback.__PAGE__.txt +4 -4
  51. package/console/auth/github/callback/__next.auth.github.callback.txt +3 -3
  52. package/console/auth/github/callback/__next.auth.github.txt +3 -3
  53. package/console/auth/github/callback/__next.auth.txt +3 -3
  54. package/console/auth/github/callback.html +1 -1
  55. package/console/auth/github/callback.txt +18 -18
  56. package/console/auth/oauth/callback/__next._full.txt +18 -18
  57. package/console/auth/oauth/callback/__next._head.txt +4 -4
  58. package/console/auth/oauth/callback/__next._index.txt +10 -10
  59. package/console/auth/oauth/callback/__next._tree.txt +2 -2
  60. package/console/auth/oauth/callback/__next.auth.oauth.callback.__PAGE__.txt +4 -4
  61. package/console/auth/oauth/callback/__next.auth.oauth.callback.txt +3 -3
  62. package/console/auth/oauth/callback/__next.auth.oauth.txt +3 -3
  63. package/console/auth/oauth/callback/__next.auth.txt +3 -3
  64. package/console/auth/oauth/callback.html +1 -1
  65. package/console/auth/oauth/callback.txt +18 -18
  66. package/console/chat/__placeholder__/__placeholder__/__next._full.txt +17 -17
  67. package/console/chat/__placeholder__/__placeholder__/__next._head.txt +4 -4
  68. package/console/chat/__placeholder__/__placeholder__/__next._index.txt +10 -10
  69. package/console/chat/__placeholder__/__placeholder__/__next._tree.txt +2 -2
  70. package/console/chat/__placeholder__/__placeholder__/__next.chat.$d$org.$d$slug.__PAGE__.txt +3 -3
  71. package/console/chat/__placeholder__/__placeholder__/__next.chat.$d$org.$d$slug.txt +3 -3
  72. package/console/chat/__placeholder__/__placeholder__/__next.chat.$d$org.txt +3 -3
  73. package/console/chat/__placeholder__/__placeholder__/__next.chat.txt +3 -3
  74. package/console/chat/__placeholder__/__placeholder__.html +1 -1
  75. package/console/chat/__placeholder__/__placeholder__.txt +17 -17
  76. package/console/conversations/__next._full.txt +17 -17
  77. package/console/conversations/__next._head.txt +4 -4
  78. package/console/conversations/__next._index.txt +10 -10
  79. package/console/conversations/__next._tree.txt +2 -2
  80. package/console/conversations/__next.conversations.__PAGE__.txt +3 -3
  81. package/console/conversations/__next.conversations.txt +3 -3
  82. package/console/conversations/__placeholder__/__placeholder__/__next._full.txt +17 -17
  83. package/console/conversations/__placeholder__/__placeholder__/__next._head.txt +4 -4
  84. package/console/conversations/__placeholder__/__placeholder__/__next._index.txt +10 -10
  85. package/console/conversations/__placeholder__/__placeholder__/__next._tree.txt +2 -2
  86. package/console/conversations/__placeholder__/__placeholder__/__next.conversations.$d$channelId.$d$key.__PAGE__.txt +3 -3
  87. package/console/conversations/__placeholder__/__placeholder__/__next.conversations.$d$channelId.$d$key.txt +3 -3
  88. package/console/conversations/__placeholder__/__placeholder__/__next.conversations.$d$channelId.txt +3 -3
  89. package/console/conversations/__placeholder__/__placeholder__/__next.conversations.txt +3 -3
  90. package/console/conversations/__placeholder__/__placeholder__.html +1 -1
  91. package/console/conversations/__placeholder__/__placeholder__.txt +17 -17
  92. package/console/conversations.html +1 -1
  93. package/console/conversations.txt +17 -17
  94. package/console/dashboard/__next._full.txt +17 -17
  95. package/console/dashboard/__next._head.txt +4 -4
  96. package/console/dashboard/__next._index.txt +10 -10
  97. package/console/dashboard/__next._tree.txt +2 -2
  98. package/console/dashboard/__next.dashboard.__PAGE__.txt +3 -3
  99. package/console/dashboard/__next.dashboard.txt +3 -3
  100. package/console/dashboard.html +1 -1
  101. package/console/dashboard.txt +17 -17
  102. package/console/executions/__placeholder__/__next._full.txt +16 -16
  103. package/console/executions/__placeholder__/__next._head.txt +4 -4
  104. package/console/executions/__placeholder__/__next._index.txt +10 -10
  105. package/console/executions/__placeholder__/__next._tree.txt +2 -2
  106. package/console/executions/__placeholder__/__next.executions.$d$id.__PAGE__.txt +2 -2
  107. package/console/executions/__placeholder__/__next.executions.$d$id.txt +3 -3
  108. package/console/executions/__placeholder__/__next.executions.txt +3 -3
  109. package/console/executions/__placeholder__.html +1 -1
  110. package/console/executions/__placeholder__.txt +16 -16
  111. package/console/index.html +1 -1
  112. package/console/index.txt +16 -16
  113. package/console/invite/__placeholder__/__next._full.txt +17 -17
  114. package/console/invite/__placeholder__/__next._head.txt +4 -4
  115. package/console/invite/__placeholder__/__next._index.txt +10 -10
  116. package/console/invite/__placeholder__/__next._tree.txt +2 -2
  117. package/console/invite/__placeholder__/__next.invite.$d$token.__PAGE__.txt +3 -3
  118. package/console/invite/__placeholder__/__next.invite.$d$token.txt +3 -3
  119. package/console/invite/__placeholder__/__next.invite.txt +3 -3
  120. package/console/invite/__placeholder__.html +1 -1
  121. package/console/invite/__placeholder__.txt +17 -17
  122. package/console/library/__next._full.txt +21 -21
  123. package/console/library/__next._head.txt +4 -4
  124. package/console/library/__next._index.txt +10 -10
  125. package/console/library/__next._tree.txt +2 -2
  126. package/console/library/__next.library.__PAGE__.txt +3 -3
  127. package/console/library/__next.library.txt +5 -5
  128. package/console/library/agents/__next._full.txt +21 -21
  129. package/console/library/agents/__next._head.txt +4 -4
  130. package/console/library/agents/__next._index.txt +10 -10
  131. package/console/library/agents/__next._tree.txt +2 -2
  132. package/console/library/agents/__next.library.agents.__PAGE__.txt +3 -3
  133. package/console/library/agents/__next.library.agents.txt +3 -3
  134. package/console/library/agents/__next.library.txt +5 -5
  135. package/console/library/agents/__placeholder__/__placeholder__/__next._full.txt +20 -20
  136. package/console/library/agents/__placeholder__/__placeholder__/__next._head.txt +4 -4
  137. package/console/library/agents/__placeholder__/__placeholder__/__next._index.txt +10 -10
  138. package/console/library/agents/__placeholder__/__placeholder__/__next._tree.txt +2 -2
  139. package/console/library/agents/__placeholder__/__placeholder__/__next.library.agents.$d$org.$d$slug.__PAGE__.txt +3 -3
  140. package/console/library/agents/__placeholder__/__placeholder__/__next.library.agents.$d$org.$d$slug.txt +3 -3
  141. package/console/library/agents/__placeholder__/__placeholder__/__next.library.agents.$d$org.txt +3 -3
  142. package/console/library/agents/__placeholder__/__placeholder__/__next.library.agents.txt +3 -3
  143. package/console/library/agents/__placeholder__/__placeholder__/__next.library.txt +5 -5
  144. package/console/library/agents/__placeholder__/__placeholder__.html +1 -1
  145. package/console/library/agents/__placeholder__/__placeholder__.txt +20 -20
  146. package/console/library/agents/new/__next._full.txt +21 -21
  147. package/console/library/agents/new/__next._head.txt +4 -4
  148. package/console/library/agents/new/__next._index.txt +10 -10
  149. package/console/library/agents/new/__next._tree.txt +2 -2
  150. package/console/library/agents/new/__next.library.agents.new.__PAGE__.txt +4 -4
  151. package/console/library/agents/new/__next.library.agents.new.txt +3 -3
  152. package/console/library/agents/new/__next.library.agents.txt +3 -3
  153. package/console/library/agents/new/__next.library.txt +5 -5
  154. package/console/library/agents/new.html +1 -1
  155. package/console/library/agents/new.txt +21 -21
  156. package/console/library/agents.html +1 -1
  157. package/console/library/agents.txt +21 -21
  158. package/console/library/mcp-servers/__next._full.txt +21 -21
  159. package/console/library/mcp-servers/__next._head.txt +4 -4
  160. package/console/library/mcp-servers/__next._index.txt +10 -10
  161. package/console/library/mcp-servers/__next._tree.txt +2 -2
  162. package/console/library/mcp-servers/__next.library.mcp-servers.__PAGE__.txt +3 -3
  163. package/console/library/mcp-servers/__next.library.mcp-servers.txt +3 -3
  164. package/console/library/mcp-servers/__next.library.txt +5 -5
  165. package/console/library/mcp-servers/__placeholder__/__placeholder__/__next._full.txt +20 -20
  166. package/console/library/mcp-servers/__placeholder__/__placeholder__/__next._head.txt +4 -4
  167. package/console/library/mcp-servers/__placeholder__/__placeholder__/__next._index.txt +10 -10
  168. package/console/library/mcp-servers/__placeholder__/__placeholder__/__next._tree.txt +2 -2
  169. package/console/library/mcp-servers/__placeholder__/__placeholder__/__next.library.mcp-servers.$d$org.$d$slug.__PAGE__.txt +3 -3
  170. package/console/library/mcp-servers/__placeholder__/__placeholder__/__next.library.mcp-servers.$d$org.$d$slug.txt +3 -3
  171. package/console/library/mcp-servers/__placeholder__/__placeholder__/__next.library.mcp-servers.$d$org.txt +3 -3
  172. package/console/library/mcp-servers/__placeholder__/__placeholder__/__next.library.mcp-servers.txt +3 -3
  173. package/console/library/mcp-servers/__placeholder__/__placeholder__/__next.library.txt +5 -5
  174. package/console/library/mcp-servers/__placeholder__/__placeholder__.html +1 -1
  175. package/console/library/mcp-servers/__placeholder__/__placeholder__.txt +20 -20
  176. package/console/library/mcp-servers/new/__next._full.txt +21 -21
  177. package/console/library/mcp-servers/new/__next._head.txt +4 -4
  178. package/console/library/mcp-servers/new/__next._index.txt +10 -10
  179. package/console/library/mcp-servers/new/__next._tree.txt +2 -2
  180. package/console/library/mcp-servers/new/__next.library.mcp-servers.new.__PAGE__.txt +4 -4
  181. package/console/library/mcp-servers/new/__next.library.mcp-servers.new.txt +3 -3
  182. package/console/library/mcp-servers/new/__next.library.mcp-servers.txt +3 -3
  183. package/console/library/mcp-servers/new/__next.library.txt +5 -5
  184. package/console/library/mcp-servers/new.html +1 -1
  185. package/console/library/mcp-servers/new.txt +21 -21
  186. package/console/library/mcp-servers.html +1 -1
  187. package/console/library/mcp-servers.txt +21 -21
  188. package/console/library/plugins/__next._full.txt +21 -21
  189. package/console/library/plugins/__next._head.txt +4 -4
  190. package/console/library/plugins/__next._index.txt +10 -10
  191. package/console/library/plugins/__next._tree.txt +2 -2
  192. package/console/library/plugins/__next.library.plugins.__PAGE__.txt +3 -3
  193. package/console/library/plugins/__next.library.plugins.txt +3 -3
  194. package/console/library/plugins/__next.library.txt +5 -5
  195. package/console/library/plugins/__placeholder__/__placeholder__/__next._full.txt +20 -20
  196. package/console/library/plugins/__placeholder__/__placeholder__/__next._head.txt +4 -4
  197. package/console/library/plugins/__placeholder__/__placeholder__/__next._index.txt +10 -10
  198. package/console/library/plugins/__placeholder__/__placeholder__/__next._tree.txt +2 -2
  199. package/console/library/plugins/__placeholder__/__placeholder__/__next.library.plugins.$d$org.$d$slug.__PAGE__.txt +3 -3
  200. package/console/library/plugins/__placeholder__/__placeholder__/__next.library.plugins.$d$org.$d$slug.txt +3 -3
  201. package/console/library/plugins/__placeholder__/__placeholder__/__next.library.plugins.$d$org.txt +3 -3
  202. package/console/library/plugins/__placeholder__/__placeholder__/__next.library.plugins.txt +3 -3
  203. package/console/library/plugins/__placeholder__/__placeholder__/__next.library.txt +5 -5
  204. package/console/library/plugins/__placeholder__/__placeholder__.html +1 -1
  205. package/console/library/plugins/__placeholder__/__placeholder__.txt +20 -20
  206. package/console/library/plugins/upload/__next._full.txt +41 -0
  207. package/console/library/plugins/upload/__next._head.txt +6 -0
  208. package/console/library/plugins/upload/__next._index.txt +17 -0
  209. package/console/library/plugins/{install → upload}/__next._tree.txt +2 -2
  210. package/console/library/plugins/upload/__next.library.plugins.txt +5 -0
  211. package/console/library/plugins/upload/__next.library.plugins.upload.__PAGE__.txt +9 -0
  212. package/console/library/plugins/upload/__next.library.plugins.upload.txt +5 -0
  213. package/console/library/plugins/upload/__next.library.txt +7 -0
  214. package/console/library/plugins/upload.html +1 -0
  215. package/console/library/plugins/upload.txt +41 -0
  216. package/console/library/plugins.html +1 -1
  217. package/console/library/plugins.txt +21 -21
  218. package/console/library/schedules/__next._full.txt +20 -20
  219. package/console/library/schedules/__next._head.txt +4 -4
  220. package/console/library/schedules/__next._index.txt +10 -10
  221. package/console/library/schedules/__next._tree.txt +2 -2
  222. package/console/library/schedules/__next.library.schedules.__PAGE__.txt +3 -3
  223. package/console/library/schedules/__next.library.schedules.txt +3 -3
  224. package/console/library/schedules/__next.library.txt +5 -5
  225. package/console/library/schedules/__placeholder__/__placeholder__/__next._full.txt +20 -20
  226. package/console/library/schedules/__placeholder__/__placeholder__/__next._head.txt +4 -4
  227. package/console/library/schedules/__placeholder__/__placeholder__/__next._index.txt +10 -10
  228. package/console/library/schedules/__placeholder__/__placeholder__/__next._tree.txt +2 -2
  229. package/console/library/schedules/__placeholder__/__placeholder__/__next.library.schedules.$d$org.$d$slug.__PAGE__.txt +3 -3
  230. package/console/library/schedules/__placeholder__/__placeholder__/__next.library.schedules.$d$org.$d$slug.txt +3 -3
  231. package/console/library/schedules/__placeholder__/__placeholder__/__next.library.schedules.$d$org.txt +3 -3
  232. package/console/library/schedules/__placeholder__/__placeholder__/__next.library.schedules.txt +3 -3
  233. package/console/library/schedules/__placeholder__/__placeholder__/__next.library.txt +5 -5
  234. package/console/library/schedules/__placeholder__/__placeholder__.html +1 -1
  235. package/console/library/schedules/__placeholder__/__placeholder__.txt +20 -20
  236. package/console/library/schedules/new/__next._full.txt +21 -21
  237. package/console/library/schedules/new/__next._head.txt +4 -4
  238. package/console/library/schedules/new/__next._index.txt +10 -10
  239. package/console/library/schedules/new/__next._tree.txt +2 -2
  240. package/console/library/schedules/new/__next.library.schedules.new.__PAGE__.txt +4 -4
  241. package/console/library/schedules/new/__next.library.schedules.new.txt +3 -3
  242. package/console/library/schedules/new/__next.library.schedules.txt +3 -3
  243. package/console/library/schedules/new/__next.library.txt +5 -5
  244. package/console/library/schedules/new.html +1 -1
  245. package/console/library/schedules/new.txt +21 -21
  246. package/console/library/schedules.html +1 -1
  247. package/console/library/schedules.txt +20 -20
  248. package/console/library/skills/__next._full.txt +20 -20
  249. package/console/library/skills/__next._head.txt +4 -4
  250. package/console/library/skills/__next._index.txt +10 -10
  251. package/console/library/skills/__next._tree.txt +2 -2
  252. package/console/library/skills/__next.library.skills.__PAGE__.txt +3 -3
  253. package/console/library/skills/__next.library.skills.txt +3 -3
  254. package/console/library/skills/__next.library.txt +5 -5
  255. package/console/library/skills/__placeholder__/__placeholder__/__next._full.txt +20 -20
  256. package/console/library/skills/__placeholder__/__placeholder__/__next._head.txt +4 -4
  257. package/console/library/skills/__placeholder__/__placeholder__/__next._index.txt +10 -10
  258. package/console/library/skills/__placeholder__/__placeholder__/__next._tree.txt +2 -2
  259. package/console/library/skills/__placeholder__/__placeholder__/__next.library.skills.$d$org.$d$slug.__PAGE__.txt +3 -3
  260. package/console/library/skills/__placeholder__/__placeholder__/__next.library.skills.$d$org.$d$slug.txt +3 -3
  261. package/console/library/skills/__placeholder__/__placeholder__/__next.library.skills.$d$org.txt +3 -3
  262. package/console/library/skills/__placeholder__/__placeholder__/__next.library.skills.txt +3 -3
  263. package/console/library/skills/__placeholder__/__placeholder__/__next.library.txt +5 -5
  264. package/console/library/skills/__placeholder__/__placeholder__.html +1 -1
  265. package/console/library/skills/__placeholder__/__placeholder__.txt +20 -20
  266. package/console/library/skills/new/__next._full.txt +22 -22
  267. package/console/library/skills/new/__next._head.txt +4 -4
  268. package/console/library/skills/new/__next._index.txt +10 -10
  269. package/console/library/skills/new/__next._tree.txt +2 -2
  270. package/console/library/skills/new/__next.library.skills.new.__PAGE__.txt +4 -4
  271. package/console/library/skills/new/__next.library.skills.new.txt +3 -3
  272. package/console/library/skills/new/__next.library.skills.txt +3 -3
  273. package/console/library/skills/new/__next.library.txt +5 -5
  274. package/console/library/skills/new.html +1 -1
  275. package/console/library/skills/new.txt +22 -22
  276. package/console/library/skills.html +1 -1
  277. package/console/library/skills.txt +20 -20
  278. package/console/library/workflows/__next._full.txt +21 -21
  279. package/console/library/workflows/__next._head.txt +4 -4
  280. package/console/library/workflows/__next._index.txt +10 -10
  281. package/console/library/workflows/__next._tree.txt +2 -2
  282. package/console/library/workflows/__next.library.txt +5 -5
  283. package/console/library/workflows/__next.library.workflows.__PAGE__.txt +3 -3
  284. package/console/library/workflows/__next.library.workflows.txt +3 -3
  285. package/console/library/workflows/__placeholder__/__placeholder__/__next._full.txt +20 -20
  286. package/console/library/workflows/__placeholder__/__placeholder__/__next._head.txt +4 -4
  287. package/console/library/workflows/__placeholder__/__placeholder__/__next._index.txt +10 -10
  288. package/console/library/workflows/__placeholder__/__placeholder__/__next._tree.txt +2 -2
  289. package/console/library/workflows/__placeholder__/__placeholder__/__next.library.txt +5 -5
  290. package/console/library/workflows/__placeholder__/__placeholder__/__next.library.workflows.$d$org.$d$slug.__PAGE__.txt +3 -3
  291. package/console/library/workflows/__placeholder__/__placeholder__/__next.library.workflows.$d$org.$d$slug.txt +3 -3
  292. package/console/library/workflows/__placeholder__/__placeholder__/__next.library.workflows.$d$org.txt +3 -3
  293. package/console/library/workflows/__placeholder__/__placeholder__/__next.library.workflows.txt +3 -3
  294. package/console/library/workflows/__placeholder__/__placeholder__.html +1 -1
  295. package/console/library/workflows/__placeholder__/__placeholder__.txt +20 -20
  296. package/console/library/workflows/executions/__next._full.txt +20 -20
  297. package/console/library/workflows/executions/__next._head.txt +4 -4
  298. package/console/library/workflows/executions/__next._index.txt +10 -10
  299. package/console/library/workflows/executions/__next._tree.txt +2 -2
  300. package/console/library/workflows/executions/__next.library.txt +5 -5
  301. package/console/library/workflows/executions/__next.library.workflows.executions.__PAGE__.txt +3 -3
  302. package/console/library/workflows/executions/__next.library.workflows.executions.txt +3 -3
  303. package/console/library/workflows/executions/__next.library.workflows.txt +3 -3
  304. package/console/library/workflows/executions.html +1 -1
  305. package/console/library/workflows/executions.txt +20 -20
  306. package/console/library/workflows/new/__next._full.txt +22 -22
  307. package/console/library/workflows/new/__next._head.txt +4 -4
  308. package/console/library/workflows/new/__next._index.txt +10 -10
  309. package/console/library/workflows/new/__next._tree.txt +2 -2
  310. package/console/library/workflows/new/__next.library.txt +5 -5
  311. package/console/library/workflows/new/__next.library.workflows.new.__PAGE__.txt +4 -4
  312. package/console/library/workflows/new/__next.library.workflows.new.txt +3 -3
  313. package/console/library/workflows/new/__next.library.workflows.txt +3 -3
  314. package/console/library/workflows/new.html +1 -1
  315. package/console/library/workflows/new.txt +22 -22
  316. package/console/library/workflows.html +1 -1
  317. package/console/library/workflows.txt +21 -21
  318. package/console/library.html +1 -1
  319. package/console/library.txt +21 -21
  320. package/console/login/__next._full.txt +18 -18
  321. package/console/login/__next._head.txt +4 -4
  322. package/console/login/__next._index.txt +10 -10
  323. package/console/login/__next._tree.txt +2 -2
  324. package/console/login/__next.login.__PAGE__.txt +4 -4
  325. package/console/login/__next.login.txt +3 -3
  326. package/console/login.html +1 -1
  327. package/console/login.txt +18 -18
  328. package/console/marketplace/__next._full.txt +32 -0
  329. package/console/marketplace/__next._head.txt +6 -0
  330. package/console/marketplace/__next._index.txt +17 -0
  331. package/console/marketplace/__next._tree.txt +5 -0
  332. package/console/marketplace/__next.marketplace.__PAGE__.txt +6 -0
  333. package/console/marketplace/__next.marketplace.txt +5 -0
  334. package/console/marketplace.html +1 -0
  335. package/console/marketplace.txt +32 -0
  336. package/console/oauth/slack/callback/__next._full.txt +18 -18
  337. package/console/oauth/slack/callback/__next._head.txt +4 -4
  338. package/console/oauth/slack/callback/__next._index.txt +10 -10
  339. package/console/oauth/slack/callback/__next._tree.txt +2 -2
  340. package/console/oauth/slack/callback/__next.oauth.slack.callback.__PAGE__.txt +4 -4
  341. package/console/oauth/slack/callback/__next.oauth.slack.callback.txt +3 -3
  342. package/console/oauth/slack/callback/__next.oauth.slack.txt +3 -3
  343. package/console/oauth/slack/callback/__next.oauth.txt +3 -3
  344. package/console/oauth/slack/callback.html +1 -1
  345. package/console/oauth/slack/callback.txt +18 -18
  346. package/console/sessions/__placeholder__/__next._full.txt +16 -16
  347. package/console/sessions/__placeholder__/__next._head.txt +4 -4
  348. package/console/sessions/__placeholder__/__next._index.txt +10 -10
  349. package/console/sessions/__placeholder__/__next._tree.txt +2 -2
  350. package/console/sessions/__placeholder__/__next.sessions.$d$id.__PAGE__.txt +2 -2
  351. package/console/sessions/__placeholder__/__next.sessions.$d$id.txt +3 -3
  352. package/console/sessions/__placeholder__/__next.sessions.txt +3 -3
  353. package/console/sessions/__placeholder__.html +1 -1
  354. package/console/sessions/__placeholder__.txt +16 -16
  355. package/console/settings/__next._full.txt +20 -20
  356. package/console/settings/__next._head.txt +4 -4
  357. package/console/settings/__next._index.txt +10 -10
  358. package/console/settings/__next._tree.txt +2 -2
  359. package/console/settings/__next.settings.__PAGE__.txt +4 -4
  360. package/console/settings/__next.settings.txt +5 -5
  361. package/console/settings/account-preferences/__next._full.txt +19 -19
  362. package/console/settings/account-preferences/__next._head.txt +4 -4
  363. package/console/settings/account-preferences/__next._index.txt +10 -10
  364. package/console/settings/account-preferences/__next._tree.txt +2 -2
  365. package/console/settings/account-preferences/__next.settings.account-preferences.__PAGE__.txt +3 -3
  366. package/console/settings/account-preferences/__next.settings.account-preferences.txt +3 -3
  367. package/console/settings/account-preferences/__next.settings.txt +5 -5
  368. package/console/settings/account-preferences.html +1 -1
  369. package/console/settings/account-preferences.txt +19 -19
  370. package/console/settings/api-keys/__next._full.txt +19 -19
  371. package/console/settings/api-keys/__next._head.txt +4 -4
  372. package/console/settings/api-keys/__next._index.txt +10 -10
  373. package/console/settings/api-keys/__next._tree.txt +2 -2
  374. package/console/settings/api-keys/__next.settings.api-keys.__PAGE__.txt +3 -3
  375. package/console/settings/api-keys/__next.settings.api-keys.txt +3 -3
  376. package/console/settings/api-keys/__next.settings.txt +5 -5
  377. package/console/settings/api-keys.html +1 -1
  378. package/console/settings/api-keys.txt +19 -19
  379. package/console/settings/billing/__next._full.txt +20 -20
  380. package/console/settings/billing/__next._head.txt +4 -4
  381. package/console/settings/billing/__next._index.txt +10 -10
  382. package/console/settings/billing/__next._tree.txt +2 -2
  383. package/console/settings/billing/__next.settings.billing.__PAGE__.txt +4 -4
  384. package/console/settings/billing/__next.settings.billing.txt +3 -3
  385. package/console/settings/billing/__next.settings.txt +5 -5
  386. package/console/settings/billing.html +1 -1
  387. package/console/settings/billing.txt +20 -20
  388. package/console/settings/channel-apps/__next._full.txt +19 -19
  389. package/console/settings/channel-apps/__next._head.txt +4 -4
  390. package/console/settings/channel-apps/__next._index.txt +10 -10
  391. package/console/settings/channel-apps/__next._tree.txt +2 -2
  392. package/console/settings/channel-apps/__next.settings.channel-apps.__PAGE__.txt +3 -3
  393. package/console/settings/channel-apps/__next.settings.channel-apps.txt +3 -3
  394. package/console/settings/channel-apps/__next.settings.txt +5 -5
  395. package/console/settings/channel-apps.html +1 -1
  396. package/console/settings/channel-apps.txt +19 -19
  397. package/console/settings/cursor-accounts/__next._full.txt +20 -20
  398. package/console/settings/cursor-accounts/__next._head.txt +4 -4
  399. package/console/settings/cursor-accounts/__next._index.txt +10 -10
  400. package/console/settings/cursor-accounts/__next._tree.txt +2 -2
  401. package/console/settings/cursor-accounts/__next.settings.cursor-accounts.__PAGE__.txt +4 -4
  402. package/console/settings/cursor-accounts/__next.settings.cursor-accounts.txt +3 -3
  403. package/console/settings/cursor-accounts/__next.settings.txt +5 -5
  404. package/console/settings/cursor-accounts.html +1 -1
  405. package/console/settings/cursor-accounts.txt +20 -20
  406. package/console/settings/environments/__next._full.txt +19 -19
  407. package/console/settings/environments/__next._head.txt +4 -4
  408. package/console/settings/environments/__next._index.txt +10 -10
  409. package/console/settings/environments/__next._tree.txt +2 -2
  410. package/console/settings/environments/__next.settings.environments.__PAGE__.txt +3 -3
  411. package/console/settings/environments/__next.settings.environments.txt +3 -3
  412. package/console/settings/environments/__next.settings.txt +5 -5
  413. package/console/settings/environments.html +1 -1
  414. package/console/settings/environments.txt +19 -19
  415. package/console/settings/identity-providers/__next._full.txt +19 -19
  416. package/console/settings/identity-providers/__next._head.txt +4 -4
  417. package/console/settings/identity-providers/__next._index.txt +10 -10
  418. package/console/settings/identity-providers/__next._tree.txt +2 -2
  419. package/console/settings/identity-providers/__next.settings.identity-providers.__PAGE__.txt +3 -3
  420. package/console/settings/identity-providers/__next.settings.identity-providers.txt +3 -3
  421. package/console/settings/identity-providers/__next.settings.txt +5 -5
  422. package/console/settings/identity-providers.html +1 -1
  423. package/console/settings/identity-providers.txt +19 -19
  424. package/console/settings/invitations/__next._full.txt +19 -19
  425. package/console/settings/invitations/__next._head.txt +4 -4
  426. package/console/settings/invitations/__next._index.txt +10 -10
  427. package/console/settings/invitations/__next._tree.txt +2 -2
  428. package/console/settings/invitations/__next.settings.invitations.__PAGE__.txt +3 -3
  429. package/console/settings/invitations/__next.settings.invitations.txt +3 -3
  430. package/console/settings/invitations/__next.settings.txt +5 -5
  431. package/console/settings/invitations.html +1 -1
  432. package/console/settings/invitations.txt +19 -19
  433. package/console/settings/members/__next._full.txt +19 -19
  434. package/console/settings/members/__next._head.txt +4 -4
  435. package/console/settings/members/__next._index.txt +10 -10
  436. package/console/settings/members/__next._tree.txt +2 -2
  437. package/console/settings/members/__next.settings.members.__PAGE__.txt +3 -3
  438. package/console/settings/members/__next.settings.members.txt +3 -3
  439. package/console/settings/members/__next.settings.txt +5 -5
  440. package/console/settings/members.html +1 -1
  441. package/console/settings/members.txt +19 -19
  442. package/console/settings/memory/__next._full.txt +19 -19
  443. package/console/settings/memory/__next._head.txt +4 -4
  444. package/console/settings/memory/__next._index.txt +10 -10
  445. package/console/settings/memory/__next._tree.txt +2 -2
  446. package/console/settings/memory/__next.settings.memory.__PAGE__.txt +3 -3
  447. package/console/settings/memory/__next.settings.memory.txt +3 -3
  448. package/console/settings/memory/__next.settings.txt +5 -5
  449. package/console/settings/memory.html +1 -1
  450. package/console/settings/memory.txt +19 -19
  451. package/console/settings/oauth-apps/__next._full.txt +19 -19
  452. package/console/settings/oauth-apps/__next._head.txt +4 -4
  453. package/console/settings/oauth-apps/__next._index.txt +10 -10
  454. package/console/settings/oauth-apps/__next._tree.txt +2 -2
  455. package/console/settings/oauth-apps/__next.settings.oauth-apps.__PAGE__.txt +3 -3
  456. package/console/settings/oauth-apps/__next.settings.oauth-apps.txt +3 -3
  457. package/console/settings/oauth-apps/__next.settings.txt +5 -5
  458. package/console/settings/oauth-apps.html +1 -1
  459. package/console/settings/oauth-apps.txt +19 -19
  460. package/console/settings/org-preferences/__next._full.txt +19 -19
  461. package/console/settings/org-preferences/__next._head.txt +4 -4
  462. package/console/settings/org-preferences/__next._index.txt +10 -10
  463. package/console/settings/org-preferences/__next._tree.txt +2 -2
  464. package/console/settings/org-preferences/__next.settings.org-preferences.__PAGE__.txt +3 -3
  465. package/console/settings/org-preferences/__next.settings.org-preferences.txt +3 -3
  466. package/console/settings/org-preferences/__next.settings.txt +5 -5
  467. package/console/settings/org-preferences.html +1 -1
  468. package/console/settings/org-preferences.txt +19 -19
  469. package/console/settings/org-profile/__next._full.txt +19 -19
  470. package/console/settings/org-profile/__next._head.txt +4 -4
  471. package/console/settings/org-profile/__next._index.txt +10 -10
  472. package/console/settings/org-profile/__next._tree.txt +2 -2
  473. package/console/settings/org-profile/__next.settings.org-profile.__PAGE__.txt +3 -3
  474. package/console/settings/org-profile/__next.settings.org-profile.txt +3 -3
  475. package/console/settings/org-profile/__next.settings.txt +5 -5
  476. package/console/settings/org-profile.html +1 -1
  477. package/console/settings/org-profile.txt +19 -19
  478. package/console/settings/platform-clients/__next._full.txt +19 -19
  479. package/console/settings/platform-clients/__next._head.txt +4 -4
  480. package/console/settings/platform-clients/__next._index.txt +10 -10
  481. package/console/settings/platform-clients/__next._tree.txt +2 -2
  482. package/console/settings/platform-clients/__next.settings.platform-clients.__PAGE__.txt +3 -3
  483. package/console/settings/platform-clients/__next.settings.platform-clients.txt +3 -3
  484. package/console/settings/platform-clients/__next.settings.txt +5 -5
  485. package/console/settings/platform-clients.html +1 -1
  486. package/console/settings/platform-clients.txt +19 -19
  487. package/console/settings/pricing-governance/__next._full.txt +20 -20
  488. package/console/settings/pricing-governance/__next._head.txt +4 -4
  489. package/console/settings/pricing-governance/__next._index.txt +10 -10
  490. package/console/settings/pricing-governance/__next._tree.txt +2 -2
  491. package/console/settings/pricing-governance/__next.settings.pricing-governance.__PAGE__.txt +4 -4
  492. package/console/settings/pricing-governance/__next.settings.pricing-governance.txt +3 -3
  493. package/console/settings/pricing-governance/__next.settings.txt +5 -5
  494. package/console/settings/pricing-governance.html +1 -1
  495. package/console/settings/pricing-governance.txt +20 -20
  496. package/console/settings/provider-standing/__next._full.txt +20 -20
  497. package/console/settings/provider-standing/__next._head.txt +4 -4
  498. package/console/settings/provider-standing/__next._index.txt +10 -10
  499. package/console/settings/provider-standing/__next._tree.txt +2 -2
  500. package/console/settings/provider-standing/__next.settings.provider-standing.__PAGE__.txt +4 -4
  501. package/console/settings/provider-standing/__next.settings.provider-standing.txt +3 -3
  502. package/console/settings/provider-standing/__next.settings.txt +5 -5
  503. package/console/settings/provider-standing.html +1 -1
  504. package/console/settings/provider-standing.txt +20 -20
  505. package/console/settings/usage/__next._full.txt +19 -19
  506. package/console/settings/usage/__next._head.txt +4 -4
  507. package/console/settings/usage/__next._index.txt +10 -10
  508. package/console/settings/usage/__next._tree.txt +2 -2
  509. package/console/settings/usage/__next.settings.txt +5 -5
  510. package/console/settings/usage/__next.settings.usage.__PAGE__.txt +3 -3
  511. package/console/settings/usage/__next.settings.usage.txt +3 -3
  512. package/console/settings/usage.html +1 -1
  513. package/console/settings/usage.txt +19 -19
  514. package/console/settings.html +1 -1
  515. package/console/settings.txt +20 -20
  516. package/console/workflows/__next._full.txt +16 -16
  517. package/console/workflows/__next._head.txt +4 -4
  518. package/console/workflows/__next._index.txt +10 -10
  519. package/console/workflows/__next._tree.txt +2 -2
  520. package/console/workflows/__next.workflows.__PAGE__.txt +2 -2
  521. package/console/workflows/__next.workflows.txt +3 -3
  522. package/console/workflows/__placeholder__/__placeholder__/__next._full.txt +17 -17
  523. package/console/workflows/__placeholder__/__placeholder__/__next._head.txt +4 -4
  524. package/console/workflows/__placeholder__/__placeholder__/__next._index.txt +10 -10
  525. package/console/workflows/__placeholder__/__placeholder__/__next._tree.txt +2 -2
  526. package/console/workflows/__placeholder__/__placeholder__/__next.workflows.$d$org.$d$slug.__PAGE__.txt +3 -3
  527. package/console/workflows/__placeholder__/__placeholder__/__next.workflows.$d$org.$d$slug.txt +3 -3
  528. package/console/workflows/__placeholder__/__placeholder__/__next.workflows.$d$org.txt +3 -3
  529. package/console/workflows/__placeholder__/__placeholder__/__next.workflows.txt +3 -3
  530. package/console/workflows/__placeholder__/__placeholder__.html +1 -1
  531. package/console/workflows/__placeholder__/__placeholder__.txt +17 -17
  532. package/console/workflows/executions/__next._full.txt +16 -16
  533. package/console/workflows/executions/__next._head.txt +4 -4
  534. package/console/workflows/executions/__next._index.txt +10 -10
  535. package/console/workflows/executions/__next._tree.txt +2 -2
  536. package/console/workflows/executions/__next.workflows.executions.__PAGE__.txt +2 -2
  537. package/console/workflows/executions/__next.workflows.executions.txt +3 -3
  538. package/console/workflows/executions/__next.workflows.txt +3 -3
  539. package/console/workflows/executions/__placeholder__/__next._full.txt +17 -17
  540. package/console/workflows/executions/__placeholder__/__next._head.txt +4 -4
  541. package/console/workflows/executions/__placeholder__/__next._index.txt +10 -10
  542. package/console/workflows/executions/__placeholder__/__next._tree.txt +2 -2
  543. package/console/workflows/executions/__placeholder__/__next.workflows.executions.$d$id.__PAGE__.txt +3 -3
  544. package/console/workflows/executions/__placeholder__/__next.workflows.executions.$d$id.txt +3 -3
  545. package/console/workflows/executions/__placeholder__/__next.workflows.executions.txt +3 -3
  546. package/console/workflows/executions/__placeholder__/__next.workflows.txt +3 -3
  547. package/console/workflows/executions/__placeholder__.html +1 -1
  548. package/console/workflows/executions/__placeholder__.txt +17 -17
  549. package/console/workflows/executions.html +1 -1
  550. package/console/workflows/executions.txt +16 -16
  551. package/console/workflows.html +1 -1
  552. package/console/workflows.txt +16 -16
  553. package/main.js +6 -6
  554. package/package.json +6 -6
  555. package/workflow-bundle-agent-execution.js +1 -1
  556. package/workflow-bundle-workflow-execution.js +1 -1
  557. package/console/_next/static/chunks/0-rl_~-k4zneu.js +0 -1
  558. package/console/_next/static/chunks/00d~s.n2ue-_h.js +0 -1
  559. package/console/_next/static/chunks/03y0rf3oc7s.8.js +0 -1
  560. package/console/_next/static/chunks/05hwz_mbqzf1o.js +0 -1
  561. package/console/_next/static/chunks/08tdiho~eajic.js +0 -1
  562. package/console/_next/static/chunks/0h5_gexj.8ede.js +0 -1
  563. package/console/_next/static/chunks/0hb.-vcj2w6kf.js +0 -1
  564. package/console/_next/static/chunks/0n_eq4ve3k9iw.js +0 -5
  565. package/console/_next/static/chunks/0uvbqsa~x3_x6.js +0 -1
  566. package/console/_next/static/chunks/0~t6-khw6kbrz.js +0 -1
  567. package/console/_next/static/chunks/148.037r-t498.js +0 -1
  568. package/console/_next/static/chunks/16ql-tt25wyl~.css +0 -1
  569. package/console/_next/static/chunks/17h3h-dhcyv24.js +0 -1
  570. package/console/library/plugins/install/__next._full.txt +0 -41
  571. package/console/library/plugins/install/__next._head.txt +0 -6
  572. package/console/library/plugins/install/__next._index.txt +0 -17
  573. package/console/library/plugins/install/__next.library.plugins.install.__PAGE__.txt +0 -9
  574. package/console/library/plugins/install/__next.library.plugins.install.txt +0 -5
  575. package/console/library/plugins/install/__next.library.plugins.txt +0 -5
  576. package/console/library/plugins/install/__next.library.txt +0 -7
  577. package/console/library/plugins/install.html +0 -1
  578. package/console/library/plugins/install.txt +0 -41
  579. /package/console/_next/static/{nsysxL2UYvxTUeX1Z93Nk → 0d4BawxHa-jMy4WgCDP1P}/_buildManifest.js +0 -0
  580. /package/console/_next/static/{nsysxL2UYvxTUeX1Z93Nk → 0d4BawxHa-jMy4WgCDP1P}/_clientMiddlewareManifest.js +0 -0
  581. /package/console/_next/static/{nsysxL2UYvxTUeX1Z93Nk → 0d4BawxHa-jMy4WgCDP1P}/_ssgManifest.js +0 -0
@@ -0,0 +1 @@
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,4 +1,4 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,765391,e=>{"use strict";var t=e.i(843476),s=e.i(271645),n=e.i(618566),r=e.i(893976),a=e.i(59306),i=e.i(468806),o=e.i(661438),l=e.i(610595),c=e.i(586108),g=e.i(59309),d=e.i(28434),u=e.i(375954),p=e.i(574803),m=e.i(796545),h=e.i(926059),f=e.i(145995),x=e.i(839329);let v={org:"",slug:"workflow-architect"};var y=e.i(226634),b=e.i(163732),_=e.i(379410);function k({open:e,onOpenChange:n,org:r,onSuccess:a,onError:y}){let b=function(e){let{org:t,onSuccess:n,onError:r}=e,a=(0,c.useStigmer)(),[i,y]=(0,s.useState)(""),[b,_]=(0,s.useState)("idle"),[k,w]=(0,s.useState)(null),[j,$]=(0,s.useState)(null),[N,C]=(0,s.useState)(null),[E,A]=(0,s.useState)(null),T=(0,s.useRef)(t);T.current=t;let I=(0,s.useRef)(n);I.current=n;let R=(0,s.useRef)(r);R.current=r;let{create:L}=(0,g.useCreateSession)(),{create:S}=(0,d.useCreateAgentExecution)(),P=(0,m.useConversationStoreRef)(),O=(0,u.useExecutionStream)(k,{store:P}),M=(0,s.useRef)(!1);(0,s.useEffect)(()=>{if("streaming"===b&&O.phase!==o.ExecutionPhase.EXECUTION_PHASE_UNSPECIFIED&&(0,p.isTerminalPhase)(O.phase)&&!M.current){M.current=!0;let e=O.execution?.status?.structuredOutput;if(e){let t=e.action,s=e.yaml,n=e.explanation;"generated_yaml"===t&&s?(C({yaml:s,explanation:n??""}),_("complete")):(_("extraction-failed"),A(n??"The agent did not produce a workflow definition."))}else{let e=(0,f.extractWorkflowYaml)(O.execution);e?(C(e),_("complete")):(_("extraction-failed"),A("The agent completed but did not produce a YAML workflow definition. Try again with a more specific prompt."))}}},[b,O.phase,O.execution]),(0,s.useEffect)(()=>{O.error&&"streaming"===b&&(_("error"),A((0,l.getUserMessage)(O.error,"Agent stream interrupted")),R.current?.((0,l.getUserMessage)(O.error,"Agent stream interrupted")))},[O.error,b]);let z=(0,s.useCallback)(async()=>{if("idle"!==b&&"error"!==b&&"extraction-failed"!==b)return;let e=i.trim();if(e.length<10)return void A("Prompt must be at least 10 characters");_("starting"),A(null),C(null),M.current=!1;try{let{sessionId:t}=await L({org:T.current,agentRef:{...v,org:T.current}});$(t);let{executionId:s}=await S({org:T.current,sessionId:t,message:e,structuredOutputSchema:x.WORKFLOW_ARCHITECT_RESPONSE_SCHEMA});w(s),_("streaming")}catch(t){let e=(0,l.getUserMessage)(t,"Failed to start the Workflow Architect agent");_("error"),A(e),R.current?.(e)}},[b,i,L,S]),D=(0,s.useCallback)(async()=>{if("complete"===b&&N){_("applying"),A(null);try{let e=(0,h.parseWorkflowYaml)(N.yaml,T.current),t=await a.workflow.apply(e),s=t.metadata?.slug,n=t.metadata?.org||T.current;if(!s)throw Error("Workflow was created but no slug was returned. Check the workflows list.");I.current(n,s)}catch(t){let e=(0,l.getUserMessage)(t,"Failed to create workflow");_("error"),A(e),R.current?.(e)}}},[b,N,a]),U=(0,s.useCallback)(()=>{y(""),_("idle"),w(null),$(null),C(null),A(null),M.current=!1},[]);return(0,s.useMemo)(()=>({prompt:i,setPrompt:y,phase:b,execution:O.execution,isStreaming:O.isStreaming||O.isConnecting,extractedYaml:N?.yaml??null,explanation:N?.explanation??null,error:E,generate:z,createWorkflow:D,reset:U}),[i,b,O.execution,O.isStreaming,O.isConnecting,N,E,z,D,U])}({org:r,onSuccess:(0,s.useCallback)((e,t)=>{n(!1),a(e,t)},[n,a]),onError:y});return(0,s.useEffect)(()=>{e&&b.reset()},[e,b.reset]),(0,t.jsx)(i.DialogShell,{open:e,onOpenChange:n,width:"3xl",dismissOnBackdrop:!0,"aria-label":"Workflow Architect",children:(0,t.jsx)("div",{className:"stg:flex stg:flex-col",children:(0,t.jsx)(w,{flow:b,onClose:()=>n(!1)})})})}function w({flow:e,onClose:s}){switch(e.phase){case"idle":return(0,t.jsx)($,{flow:e,onClose:s});case"starting":case"streaming":return(0,t.jsx)(N,{flow:e,onClose:s});case"complete":case"applying":return(0,t.jsx)(C,{flow:e,onClose:s});case"extraction-failed":case"error":return(0,t.jsx)(E,{flow:e,onClose:s});default:return null}}let j=(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-sm stg:text-foreground","stg:placeholder:text-muted-foreground","stg:focus-visible:outline-none stg:focus-visible:ring-1 stg:focus-visible:ring-ring","stg:disabled:pointer-events-none stg:disabled:opacity-50");function $({flow:e,onClose:n}){let a=(0,s.useId)();return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"stg:border-b stg:border-border stg:px-6 stg:py-4",children:[(0,t.jsx)("h3",{className:"stg:text-base stg:font-semibold stg:text-foreground",children:"Generate Workflow"}),(0,t.jsx)("p",{className:"stg:mt-0.5 stg:text-xs stg:text-muted-foreground",children:"Describe what you want and the Workflow Architect agent will design, validate, and generate a workflow definition"})]}),(0,t.jsxs)("div",{className:"stg:max-h-[60vh] stg:overflow-y-auto stg:px-6 stg:py-4",children:[e.error&&(0,t.jsx)("div",{className:"stg:mb-4 stg:rounded-md stg:border stg:border-destructive stg:bg-destructive-muted stg:px-3 stg:py-2 stg:text-sm stg:text-destructive",role:"alert",children:e.error}),(0,t.jsxs)("div",{className:"stg:flex stg:flex-col stg:gap-1",children:[(0,t.jsxs)("label",{htmlFor:a,className:"stg:text-xs stg:font-medium stg:text-foreground",children:["Description",(0,t.jsx)("span",{className:"stg:ml-1 stg:text-destructive","aria-label":"required",children:"*"})]}),(0,t.jsx)("textarea",{id:a,value:e.prompt,onChange:t=>e.setPrompt(t.target.value),placeholder:"e.g., A workflow that enriches customer data using my data-agent, validates the output, and sends a Slack notification on failure",rows:5,className:(0,r.cn)(j,"stg:resize-y"),onKeyDown:t=>{"Enter"===t.key&&(t.metaKey||t.ctrlKey)&&(t.preventDefault(),e.generate())}}),(0,t.jsx)("p",{className:"stg:text-[0.7rem] stg:text-muted-foreground",children:"Describe the goal, steps, and any specific agents or task kinds to use. The agent will discover available resources automatically."})]})]}),(0,t.jsxs)("div",{className:"stg:flex stg:justify-end stg:gap-2 stg:border-t stg:border-border stg:px-6 stg:py-3",children:[(0,t.jsx)("button",{type:"button",onClick:n,className:(0,r.cn)("stg:rounded-md stg:px-3 stg:py-1.5 stg:text-sm stg:font-medium stg:transition-colors","stg:border stg:border-input stg:bg-background stg:text-foreground","stg:hover:bg-accent stg:hover:text-accent-foreground","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring"),children:"Cancel"}),(0,t.jsx)("button",{type:"button",onClick:e.generate,disabled:e.prompt.trim().length<10,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-sm stg:font-medium stg:transition-colors","stg:bg-primary stg:text-primary-foreground stg:hover:bg-primary-hover","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring","stg:disabled:pointer-events-none stg:disabled:opacity-40"),children:"Generate"})]})]})}function N({flow:e,onClose:s}){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"stg:border-b stg:border-border stg:px-6 stg:py-4",children:[(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-2",children:[(0,t.jsx)("h3",{className:"stg:text-base stg:font-semibold stg:text-foreground",children:"Workflow Architect"}),(0,t.jsxs)("span",{className:"stg:inline-flex stg:items-center stg:gap-1.5 stg:text-xs stg:text-muted-foreground",children:[(0,t.jsx)(_.SpinnerIcon,{size:14}),"starting"===e.phase?"Starting…":"Working…"]})]}),(0,t.jsx)("p",{className:"stg:mt-0.5 stg:text-xs stg:text-muted-foreground",children:"The agent is designing and validating your workflow"})]}),(0,t.jsx)("div",{className:"stg:h-[55vh] stg:overflow-hidden",children:(0,t.jsx)(y.MessageThread,{executions:[],activeStreamExecution:e.execution,pendingUserMessage:"starting"===e.phase?e.prompt:void 0,className:"stg:h-full"})}),(0,t.jsx)("div",{className:"stg:flex stg:justify-end stg:gap-2 stg:border-t stg:border-border stg:px-6 stg:py-3",children:(0,t.jsx)("button",{type:"button",onClick:()=>{e.reset(),s()},className:(0,r.cn)("stg:rounded-md stg:px-3 stg:py-1.5 stg:text-sm stg:font-medium stg:transition-colors","stg:border stg:border-input stg:bg-background stg:text-foreground","stg:hover:bg-accent stg:hover:text-accent-foreground","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring"),children:"Cancel"})})]})}function C({flow:e,onClose:n}){let a="applying"===e.phase,[i,o]=(0,s.useState)(!1);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"stg:border-b stg:border-border stg:px-6 stg:py-4",children:[(0,t.jsx)("h3",{className:"stg:text-base stg:font-semibold stg:text-foreground",children:"Generated Workflow"}),(0,t.jsx)("p",{className:"stg:mt-0.5 stg:text-xs stg:text-muted-foreground",children:"Review the generated workflow before creating it"})]}),(0,t.jsxs)("div",{className:"stg:max-h-[65vh] stg:overflow-y-auto stg:px-6 stg:py-4",children:[e.error&&(0,t.jsx)("div",{className:"stg:mb-4 stg:rounded-md stg:border stg:border-destructive stg:bg-destructive-muted stg:px-3 stg:py-2 stg:text-sm stg:text-destructive",role:"alert",children:e.error}),e.explanation&&(0,t.jsxs)("div",{className:"stg:mb-4",children:[(0,t.jsx)("h4",{className:"stg:mb-1 stg:text-xs stg:font-medium stg:text-muted-foreground",children:"Explanation"}),(0,t.jsx)("p",{className:"stg:whitespace-pre-wrap stg:text-sm stg:text-foreground",children:e.explanation})]}),e.extractedYaml&&(0,t.jsxs)("div",{children:[(0,t.jsx)("h4",{className:"stg:mb-1 stg:text-xs stg:font-medium stg:text-muted-foreground",children:"Workflow Structure"}),(0,t.jsx)("div",{className:"stg:h-[280px] stg:overflow-hidden stg:rounded-md stg:border stg:border-border",children:(0,t.jsx)(b.WorkflowDiffGraph,{beforeYaml:"",afterYaml:e.extractedYaml})}),(0,t.jsxs)("div",{className:"stg:mt-3",children:[(0,t.jsx)("button",{type:"button",onClick:()=>o(e=>!e),className:"stg:text-xs stg:font-medium stg:text-muted-foreground stg:hover:text-foreground",children:i?"▾ Hide YAML":"▸ View YAML"}),i&&(0,t.jsx)("pre",{className:"stg:mt-1 stg:max-h-60 stg:overflow-auto stg:rounded-md stg:border stg:border-border stg:bg-muted stg:p-3 stg:text-xs stg:leading-relaxed stg:text-foreground",children:e.extractedYaml})]})]})]}),(0,t.jsxs)("div",{className:"stg:flex stg:justify-between stg:border-t stg:border-border stg:px-6 stg:py-3",children:[(0,t.jsx)("button",{type:"button",onClick:n,disabled:a,className:(0,r.cn)("stg:rounded-md stg:px-3 stg:py-1.5 stg:text-sm stg:font-medium stg:transition-colors","stg:text-muted-foreground 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"),children:"Close"}),(0,t.jsxs)("div",{className:"stg:flex stg:gap-2",children:[(0,t.jsx)("button",{type:"button",onClick:e.reset,disabled:a,className:(0,r.cn)("stg:rounded-md stg:px-3 stg:py-1.5 stg:text-sm stg:font-medium stg:transition-colors","stg:border stg:border-input stg:bg-background stg:text-foreground","stg:hover:bg-accent stg:hover:text-accent-foreground","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring","stg:disabled:pointer-events-none stg:disabled:opacity-50"),children:"Try Again"}),(0,t.jsxs)("button",{type:"button",onClick:e.createWorkflow,disabled:a,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-sm stg:font-medium stg:transition-colors","stg:bg-primary stg:text-primary-foreground stg:hover:bg-primary-hover","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring","stg:disabled:pointer-events-none stg:disabled:opacity-40"),children:[a&&(0,t.jsx)(_.SpinnerIcon,{size:14}),a?"Creating…":"Create Workflow"]})]})]})]})}function E({flow:e,onClose:s}){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"stg:border-b stg:border-border stg:px-6 stg:py-4",children:(0,t.jsx)("h3",{className:"stg:text-base stg:font-semibold stg:text-foreground",children:"Generation Failed"})}),(0,t.jsx)("div",{className:"stg:px-6 stg:py-6",children:(0,t.jsx)("div",{className:"stg:rounded-md stg:border stg:border-destructive stg:bg-destructive-muted stg:px-3 stg:py-2 stg:text-sm stg:text-destructive",role:"alert",children:e.error??"An unexpected error occurred."})}),(0,t.jsxs)("div",{className:"stg:flex stg:justify-end stg:gap-2 stg:border-t stg:border-border stg:px-6 stg:py-3",children:[(0,t.jsx)("button",{type:"button",onClick:s,className:(0,r.cn)("stg:rounded-md stg:px-3 stg:py-1.5 stg:text-sm stg:font-medium stg:transition-colors","stg:border stg:border-input stg:bg-background stg:text-foreground","stg:hover:bg-accent stg:hover:text-accent-foreground","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring"),children:"Close"}),(0,t.jsx)("button",{type:"button",onClick:e.reset,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-sm stg:font-medium stg:transition-colors","stg:bg-primary stg:text-primary-foreground stg:hover:bg-primary-hover","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring"),children:"Try Again"})]})]})}let A={"customer-support":"Customer Support","code-review":"Code Review","data-analysis":"Data Analysis",devops:"DevOps",content:"Content",integration:"Integration",general:"General"},T={parallel:"Parallel",branching:"Branching",hitl:"Human-in-the-Loop",loop:"Loop","error-handling":"Error Handling",batch:"Batch Processing","ai-pipeline":"AI Pipeline","http-integration":"HTTP Integration"};var I=e.i(938107);e.i(222258);var R=e.i(967785);function L(e){try{let t=(0,R.parse)(e),s=t?.spec;if(!s)return S;let n=Array.isArray(s.tasks)?s.tasks:[],r=new Set;for(let e of n)"string"==typeof e.kind&&r.add(e.kind),function e(t,s){let n=t.task_config;if(!n)return;let r=n.branches;if(Array.isArray(r))for(let t of r){let n=t?.do;if(Array.isArray(n))for(let t of n)"string"==typeof t?.kind&&s.add(t.kind),e(t,s)}let a=n.do;if(Array.isArray(a))for(let t of a)"string"==typeof t?.kind&&s.add(t.kind),e(t,s);let i=n.catch;if(Array.isArray(i))for(let t of i){let n=t?.do;if(Array.isArray(n))for(let t of n)"string"==typeof t?.kind&&s.add(t.kind),e(t,s)}let o=n.do;if(Array.isArray(o)&&"for_each"===t.kind)for(let t of o)"string"==typeof t?.kind&&s.add(t.kind),e(t,s)}(e,r);let a=s.env,i=a&&"object"==typeof a?Object.keys(a).length:0,o=null!=s.budget&&"object"==typeof s.budget,l=function(e,t){let s=[];t.has("fork")&&s.push("parallel"),t.has("switch_case")&&s.push("branching"),t.has("human_input")&&s.push("hitl"),t.has("for_each")&&s.push("batch"),t.has("try_catch")&&s.push("error-handling"),(t.has("http_call")||t.has("grpc_call"))&&s.push("http-integration"),(["agent_call","llm_call","eval"].filter(e=>t.has(e)).length>=2||t.has("agent_call")&&e.filter(e=>"agent_call"===e.kind).length>=2)&&s.push("ai-pipeline");let n=e.map(e=>e.name).filter(Boolean);for(let t=0;t<e.length;t++){let r=e[t]?.flow?.then;if(r&&n.indexOf(r)<t){s.push("loop");break}}return s}(n,r);return{taskCount:n.length,taskKinds:[...r].sort(),patterns:l,envVarCount:i,hasBudget:o}}catch{return S}}let S={taskCount:0,taskKinds:[],patterns:[],envVarCount:0,hasBudget:!1};var P=e.i(855862);let O={"customer-support":"stg:bg-blue-500/10 stg:text-blue-700 stg:dark:text-blue-400","code-review":"stg:bg-violet-500/10 stg:text-violet-700 stg:dark:text-violet-400","data-analysis":"stg:bg-amber-500/10 stg:text-amber-700 stg:dark:text-amber-400",devops:"stg:bg-emerald-500/10 stg:text-emerald-700 stg:dark:text-emerald-400",content:"stg:bg-pink-500/10 stg:text-pink-700 stg:dark:text-pink-400",integration:"stg:bg-cyan-500/10 stg:text-cyan-700 stg:dark:text-cyan-400",general:"stg:bg-muted stg:text-muted-foreground"},M={parallel:"stg:bg-violet-500/10 stg:text-violet-700 stg:dark:text-violet-400",branching:"stg:bg-amber-500/10 stg:text-amber-700 stg:dark:text-amber-400",hitl:"stg:bg-emerald-500/10 stg:text-emerald-700 stg:dark:text-emerald-400",loop:"stg:bg-pink-500/10 stg:text-pink-700 stg:dark:text-pink-400","error-handling":"stg:bg-red-500/10 stg:text-red-700 stg:dark:text-red-400",batch:"stg:bg-cyan-500/10 stg:text-cyan-700 stg:dark:text-cyan-400","ai-pipeline":"stg:bg-blue-500/10 stg:text-blue-700 stg:dark:text-blue-400","http-integration":"stg:bg-orange-500/10 stg:text-orange-700 stg:dark:text-orange-400"};function z({template:e,onSelect:n,onPreview:a,className:i}){let o=(0,s.useMemo)(()=>L(e.data.yaml??""),[e.data.yaml]),l=(0,s.useCallback)(()=>{n(e)},[n,e]),c=(0,s.useCallback)(t=>{t.stopPropagation(),a?.(e)},[a,e]),g=(0,s.useCallback)(t=>{("Enter"===t.key||" "===t.key)&&(t.preventDefault(),n(e))},[n,e]),d=P.TEMPLATE_CATEGORY_LABELS[e.category]??e.category;return(0,t.jsxs)("div",{role:"button",tabIndex:0,onClick:l,onKeyDown:g,"aria-label":`Use ${e.name} template`,className:(0,r.cn)("stg:group stg:flex stg:cursor-pointer stg:flex-col stg:gap-3 stg:rounded-lg stg:border stg:border-border stg:bg-card stg:p-4","stg:transition-colors stg:hover:border-primary stg:hover:bg-accent","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring",i),children:[(0,t.jsxs)("div",{className:"stg:flex stg:items-start stg:justify-between stg:gap-2",children:[(0,t.jsxs)("div",{className:"stg:min-w-0 stg:flex-1",children:[(0,t.jsx)("p",{className:"stg:text-sm stg:font-medium stg:text-foreground",children:e.name}),(0,t.jsx)("span",{className:(0,r.cn)("stg:mt-1 stg:inline-block stg:rounded-full stg:px-2 stg:py-0.5 stg:text-[10px] stg:font-medium",O[e.category]??O.general),children:d})]}),a&&(0,t.jsx)("button",{type:"button",onClick:c,"aria-label":`Preview ${e.name}`,className:(0,r.cn)("stg:rounded-md stg:p-1 stg:text-muted-foreground stg:opacity-0 stg:transition-opacity","stg:hover:bg-accent stg:hover:text-accent-foreground","stg:focus-visible:opacity-100 stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring","stg:group-hover:opacity-100"),children:(0,t.jsx)(D,{})})]}),(0,t.jsx)("p",{className:"stg:line-clamp-2 stg:text-xs stg:leading-relaxed stg:text-muted-foreground",children:e.description}),o.patterns.length>0&&(0,t.jsx)("div",{className:"stg:flex stg:flex-wrap stg:gap-1",children:o.patterns.slice(0,3).map(e=>(0,t.jsx)("span",{className:(0,r.cn)("stg:rounded stg:px-1.5 stg:py-0.5 stg:text-[10px] stg:font-medium",M[e]??"stg:bg-muted stg:text-muted-foreground"),children:T[e]},e))}),(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-3 stg:text-[10px] stg:text-muted-foreground",children:[(0,t.jsxs)("span",{children:[o.taskCount," tasks"]}),o.envVarCount>0&&(0,t.jsxs)("span",{children:[o.envVarCount," env vars"]}),o.hasBudget&&(0,t.jsx)("span",{children:"Budget"})]})]})}function D(){return(0,t.jsxs)("svg",{className:"stg:size-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z"}),(0,t.jsx)("circle",{cx:12,cy:12,r:3})]})}var U=e.i(154548);function W({template:e,open:n,onClose:a,onSelect:o}){let l=(0,s.useCallback)(e=>{e||a()},[a]),c=(0,s.useCallback)(()=>{e&&o(e)},[e,o]),g=(0,s.useMemo)(()=>e?L(e.data.yaml??""):null,[e]);if(!e||!g)return null;let d=P.TEMPLATE_CATEGORY_LABELS[e.category]??e.category;return(0,t.jsx)(i.DialogShell,{open:n,onOpenChange:l,width:"3xl",className:"stgm stg:max-h-[85vh] stg:bg-background","aria-label":`Preview ${e.name}`,children:(0,t.jsxs)("div",{className:"stg:flex stg:flex-col",children:[(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:justify-between stg:border-b stg:border-border stg:px-5 stg:py-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"stg:text-base stg:font-semibold stg:text-foreground",children:e.name}),(0,t.jsx)("span",{className:"stg:text-xs stg:text-muted-foreground",children:d})]}),(0,t.jsx)("button",{type:"button",onClick:a,"aria-label":"Close preview",className:(0,r.cn)("stg:rounded-md stg:p-1.5 stg:text-muted-foreground stg:transition-colors","stg:hover:bg-accent stg:hover:text-accent-foreground","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring"),children:(0,t.jsx)(q,{})})]}),(0,t.jsxs)("div",{className:"stg:flex stg:flex-col stg:gap-4 stg:px-5 stg:py-4",children:[(0,t.jsx)("p",{className:"stg:text-sm stg:leading-relaxed stg:text-muted-foreground",children:e.description}),(0,t.jsxs)("div",{className:"stg:flex stg:flex-wrap stg:items-center stg:gap-3",children:[(0,t.jsx)(F,{label:`${g.taskCount} tasks`}),(0,t.jsx)(F,{label:`${g.taskKinds.length} task types`}),g.envVarCount>0&&(0,t.jsx)(F,{label:`${g.envVarCount} env vars`}),g.hasBudget&&(0,t.jsx)(F,{label:"Budget configured"})]}),g.patterns.length>0&&(0,t.jsx)("div",{className:"stg:flex stg:flex-wrap stg:gap-1.5",children:g.patterns.map(e=>(0,t.jsx)("span",{className:"stg:rounded-full stg:bg-muted stg:px-2.5 stg:py-0.5 stg:text-xs stg:font-medium stg:text-muted-foreground",children:T[e]},e))}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"stg:mb-1.5 stg:text-xs stg:font-medium stg:text-foreground",children:"Task types used"}),(0,t.jsx)("div",{className:"stg:flex stg:flex-wrap stg:gap-1.5",children:g.taskKinds.map(e=>(0,t.jsx)("code",{className:"stg:rounded stg:bg-muted stg:px-1.5 stg:py-0.5 stg:text-[11px] stg:text-muted-foreground",children:e},e))})]}),(0,t.jsx)("div",{className:"stg:h-64 stg:overflow-hidden stg:rounded-md stg:border stg:border-border stg:bg-muted/30",children:(0,t.jsx)(U.ReactFlowProvider,{children:(0,t.jsx)(B,{yaml:e.data.yaml??""})})})]}),(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:justify-end stg:gap-2 stg:border-t stg:border-border stg:px-5 stg:py-3",children:[(0,t.jsx)("button",{type:"button",onClick:a,className:(0,r.cn)("stg:rounded-md stg:px-3 stg:py-1.5 stg:text-sm stg:font-medium stg:text-muted-foreground stg:transition-colors","stg:hover:bg-accent stg:hover:text-accent-foreground","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring"),children:"Cancel"}),(0,t.jsx)("button",{type:"button",onClick:c,className:(0,r.cn)("stg:rounded-md stg:bg-primary stg:px-4 stg:py-1.5 stg:text-sm stg:font-medium stg:text-primary-foreground stg:transition-colors","stg:hover:bg-primary/90","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring"),children:"Use this template"})]})]})})}function B({yaml:e}){let{fitView:n}=(0,U.useReactFlow)(),[r,a]=(0,s.useState)({nodes:[],edges:[]});return((0,s.useEffect)(()=>{try{let t=(0,R.parse)(e),s=t?.spec?.tasks??[],n=[],r=[];for(let e=0;e<s.length;e++){let t=s[e],a=t.name??`task_${e}`;n.push({id:a,type:"default",position:{x:150,y:80*e},data:{label:`${a} (${t.kind??"unknown"})`},style:{fontSize:11,padding:"4px 8px",borderRadius:6,minWidth:160,textAlign:"center"}});let i=t.flow?.then;if(i&&"end"!==i)r.push({id:`${a}->${i}`,source:a,target:i});else if(!i&&e<s.length-1){let t=s[e+1];r.push({id:`${a}->${t.name??`task_${e+1}`}`,source:a,target:t.name??`task_${e+1}`})}}a({nodes:n,edges:r})}catch{a({nodes:[],edges:[]})}},[e]),(0,s.useEffect)(()=>{if(r.nodes.length>0){let e=setTimeout(()=>n({padding:.2}),50);return()=>clearTimeout(e)}},[r.nodes.length,n]),0===r.nodes.length)?(0,t.jsx)("div",{className:"stg:flex stg:h-full stg:items-center stg:justify-center stg:text-xs stg:text-muted-foreground",children:"No preview available"}):(0,t.jsx)(U.ReactFlow,{nodes:r.nodes,edges:r.edges,nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1,panOnDrag:!0,zoomOnScroll:!0,fitView:!0,proOptions:{hideAttribution:!0},children:(0,t.jsx)(U.Background,{variant:U.BackgroundVariant.Dots,gap:16,size:1})})}function F({label:e}){return(0,t.jsx)("span",{className:"stg:rounded-md stg:bg-muted stg:px-2 stg:py-0.5 stg:text-[11px] stg:font-medium stg:text-muted-foreground",children:e})}function q(){return(0,t.jsxs)("svg",{className:"stg:size-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M18 6 6 18"}),(0,t.jsx)("path",{d:"m6 6 12 12"})]})}function Y({templates:e,onSelect:n,emptyContent:a,className:i}){let{filtered:o,query:l,setQuery:c,activeCategory:g,setActiveCategory:d,availableCategories:u}=(0,I.useTemplateFilter)({templates:e}),[p,m]=(0,s.useState)(null),h=(0,s.useCallback)(e=>{m(e)},[]),f=(0,s.useCallback)(()=>{m(null)},[]),x=(0,s.useCallback)(e=>{m(null),n(e)},[n]),v=(0,s.useCallback)(e=>{let t=e.currentTarget.querySelectorAll('[role="tab"]');if(!t.length)return;let s=Array.from(t).findIndex(e=>e===document.activeElement);if(-1===s)return;let n=null;"ArrowRight"===e.key?n=(s+1)%t.length:"ArrowLeft"===e.key?n=(s-1+t.length)%t.length:"Home"===e.key?n=0:"End"===e.key&&(n=t.length-1),null!==n&&(e.preventDefault(),t[n].focus(),t[n].click())},[]);return(0,t.jsxs)("div",{className:(0,r.cn)("stg:flex stg:flex-col stg:gap-4",i),children:[(0,t.jsxs)("div",{className:"stg:relative",children:[(0,t.jsx)(V,{}),(0,t.jsx)("input",{type:"search",value:l,onChange:e=>c(e.target.value),placeholder:"Search templates…","aria-label":"Search workflow templates",className:(0,r.cn)("stg:w-full stg:rounded-md stg:border stg:border-input stg:bg-input-bg stg:py-2 stg:pl-9 stg:pr-3 stg:text-sm stg:text-foreground","stg:placeholder:text-muted-foreground","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring")})]}),u.length>1&&(0,t.jsxs)("div",{role:"tablist","aria-label":"Template categories",onKeyDown:v,className:"stg:flex stg:flex-wrap stg:gap-1",children:[(0,t.jsx)(G,{label:"All",isActive:null===g,onClick:()=>d(null)}),u.map(e=>(0,t.jsx)(G,{label:A[e]??e,isActive:g===e,onClick:()=>d(e)},e))]}),o.length>0?(0,t.jsx)("div",{role:"list","aria-label":"Workflow templates",className:"stg:grid stg:grid-cols-1 stg:gap-3 stg:sm:grid-cols-2 stg:lg:grid-cols-3",children:o.map(e=>(0,t.jsx)("div",{role:"listitem",children:(0,t.jsx)(z,{template:e,onSelect:n,onPreview:h})},e.id))}):a??(0,t.jsx)("div",{className:"stg:py-8 stg:text-center stg:text-sm stg:text-muted-foreground",children:"No templates match your search."}),(0,t.jsx)(W,{template:p,open:null!==p,onClose:f,onSelect:x})]})}function G({label:e,isActive:s,onClick:n}){return(0,t.jsx)("button",{type:"button",role:"tab","aria-selected":s,tabIndex:s?0:-1,onClick:n,className:(0,r.cn)("stg:rounded-md stg:px-2.5 stg:py-1 stg:text-xs stg:font-medium stg:transition-colors","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring",s?"stg:bg-primary stg:text-primary-foreground":"stg:bg-muted stg:text-muted-foreground stg:hover:bg-accent stg:hover:text-accent-foreground"),children:e})}function V(){return(0,t.jsxs)("svg",{className:"stg:pointer-events-none stg:absolute stg:left-3 stg:top-1/2 stg:size-4 stg:-translate-y-1/2 stg:text-muted-foreground",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,t.jsx)("circle",{cx:11,cy:11,r:8}),(0,t.jsx)("path",{d:"m21 21-4.3-4.3"})]})}let K=`apiVersion: agentic.stigmer.ai/v1
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,765391,e=>{"use strict";var t=e.i(843476),s=e.i(271645),n=e.i(618566),r=e.i(893976),a=e.i(59306),i=e.i(468806),o=e.i(661438),l=e.i(610595),c=e.i(586108),g=e.i(59309),d=e.i(28434),u=e.i(375954),p=e.i(574803),m=e.i(796545),h=e.i(926059),f=e.i(145995),x=e.i(839329),v=e.i(154813),y=e.i(226634),b=e.i(163732),_=e.i(379410);function k({open:e,onOpenChange:n,org:r,onSuccess:a,onError:y}){let b=function(e){let{org:t,onSuccess:n,onError:r}=e,a=(0,c.useStigmer)(),[i,y]=(0,s.useState)(""),[b,_]=(0,s.useState)("idle"),[k,w]=(0,s.useState)(null),[j,$]=(0,s.useState)(null),[N,C]=(0,s.useState)(null),[E,A]=(0,s.useState)(null),T=(0,s.useRef)(t);T.current=t;let I=(0,s.useRef)(n);I.current=n;let R=(0,s.useRef)(r);R.current=r;let{create:L}=(0,g.useCreateSession)(),{create:S}=(0,d.useCreateAgentExecution)(),P=(0,m.useConversationStoreRef)(),O=(0,u.useExecutionStream)(k,{store:P}),M=(0,s.useRef)(!1);(0,s.useEffect)(()=>{if("streaming"===b&&O.phase!==o.ExecutionPhase.EXECUTION_PHASE_UNSPECIFIED&&(0,p.isTerminalPhase)(O.phase)&&!M.current){M.current=!0;let e=O.execution?.status?.structuredOutput;if(e){let t=e.action,s=e.yaml,n=e.explanation;"generated_yaml"===t&&s?(C({yaml:s,explanation:n??""}),_("complete")):(_("extraction-failed"),A(n??"The agent did not produce a workflow definition."))}else{let e=(0,f.extractWorkflowYaml)(O.execution);e?(C(e),_("complete")):(_("extraction-failed"),A("The agent completed but did not produce a YAML workflow definition. Try again with a more specific prompt."))}}},[b,O.phase,O.execution]),(0,s.useEffect)(()=>{O.error&&"streaming"===b&&(_("error"),A((0,l.getUserMessage)(O.error,"Agent stream interrupted")),R.current?.((0,l.getUserMessage)(O.error,"Agent stream interrupted")))},[O.error,b]);let z=(0,s.useCallback)(async()=>{if("idle"!==b&&"error"!==b&&"extraction-failed"!==b)return;let e=i.trim();if(e.length<10)return void A("Prompt must be at least 10 characters");_("starting"),A(null),C(null),M.current=!1;try{let{sessionId:t}=await L({org:T.current,agentRef:(0,v.workflowArchitectRef)(T.current)});$(t);let{executionId:s}=await S({org:T.current,sessionId:t,message:e,structuredOutputSchema:x.WORKFLOW_ARCHITECT_RESPONSE_SCHEMA});w(s),_("streaming")}catch(t){let e=(0,l.getUserMessage)(t,"Failed to start the Workflow Architect agent");_("error"),A(e),R.current?.(e)}},[b,i,L,S]),D=(0,s.useCallback)(async()=>{if("complete"===b&&N){_("applying"),A(null);try{let e=(0,h.parseWorkflowYaml)(N.yaml,T.current),t=await a.workflow.apply(e),s=t.metadata?.slug,n=t.metadata?.org||T.current;if(!s)throw Error("Workflow was created but no slug was returned. Check the workflows list.");I.current(n,s)}catch(t){let e=(0,l.getUserMessage)(t,"Failed to create workflow");_("error"),A(e),R.current?.(e)}}},[b,N,a]),W=(0,s.useCallback)(()=>{y(""),_("idle"),w(null),$(null),C(null),A(null),M.current=!1},[]);return(0,s.useMemo)(()=>({prompt:i,setPrompt:y,phase:b,execution:O.execution,isStreaming:O.isStreaming||O.isConnecting,extractedYaml:N?.yaml??null,explanation:N?.explanation??null,error:E,generate:z,createWorkflow:D,reset:W}),[i,b,O.execution,O.isStreaming,O.isConnecting,N,E,z,D,W])}({org:r,onSuccess:(0,s.useCallback)((e,t)=>{n(!1),a(e,t)},[n,a]),onError:y});return(0,s.useEffect)(()=>{e&&b.reset()},[e,b.reset]),(0,t.jsx)(i.DialogShell,{open:e,onOpenChange:n,width:"3xl",dismissOnBackdrop:!0,"aria-label":"Workflow Architect",children:(0,t.jsx)("div",{className:"stg:flex stg:flex-col",children:(0,t.jsx)(w,{flow:b,onClose:()=>n(!1)})})})}function w({flow:e,onClose:s}){switch(e.phase){case"idle":return(0,t.jsx)($,{flow:e,onClose:s});case"starting":case"streaming":return(0,t.jsx)(N,{flow:e,onClose:s});case"complete":case"applying":return(0,t.jsx)(C,{flow:e,onClose:s});case"extraction-failed":case"error":return(0,t.jsx)(E,{flow:e,onClose:s});default:return null}}let j=(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-sm stg:text-foreground","stg:placeholder:text-muted-foreground","stg:focus-visible:outline-none stg:focus-visible:ring-1 stg:focus-visible:ring-ring","stg:disabled:pointer-events-none stg:disabled:opacity-50");function $({flow:e,onClose:n}){let a=(0,s.useId)();return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"stg:border-b stg:border-border stg:px-6 stg:py-4",children:[(0,t.jsx)("h3",{className:"stg:text-base stg:font-semibold stg:text-foreground",children:"Generate Workflow"}),(0,t.jsx)("p",{className:"stg:mt-0.5 stg:text-xs stg:text-muted-foreground",children:"Describe what you want and the Workflow Architect agent will design, validate, and generate a workflow definition"})]}),(0,t.jsxs)("div",{className:"stg:max-h-[60vh] stg:overflow-y-auto stg:px-6 stg:py-4",children:[e.error&&(0,t.jsx)("div",{className:"stg:mb-4 stg:rounded-md stg:border stg:border-destructive stg:bg-destructive-muted stg:px-3 stg:py-2 stg:text-sm stg:text-destructive",role:"alert",children:e.error}),(0,t.jsxs)("div",{className:"stg:flex stg:flex-col stg:gap-1",children:[(0,t.jsxs)("label",{htmlFor:a,className:"stg:text-xs stg:font-medium stg:text-foreground",children:["Description",(0,t.jsx)("span",{className:"stg:ml-1 stg:text-destructive","aria-label":"required",children:"*"})]}),(0,t.jsx)("textarea",{id:a,value:e.prompt,onChange:t=>e.setPrompt(t.target.value),placeholder:"e.g., A workflow that enriches customer data using my data-agent, validates the output, and sends a Slack notification on failure",rows:5,className:(0,r.cn)(j,"stg:resize-y"),onKeyDown:t=>{"Enter"===t.key&&(t.metaKey||t.ctrlKey)&&(t.preventDefault(),e.generate())}}),(0,t.jsx)("p",{className:"stg:text-[0.7rem] stg:text-muted-foreground",children:"Describe the goal, steps, and any specific agents or task kinds to use. The agent will discover available resources automatically."})]})]}),(0,t.jsxs)("div",{className:"stg:flex stg:justify-end stg:gap-2 stg:border-t stg:border-border stg:px-6 stg:py-3",children:[(0,t.jsx)("button",{type:"button",onClick:n,className:(0,r.cn)("stg:rounded-md stg:px-3 stg:py-1.5 stg:text-sm stg:font-medium stg:transition-colors","stg:border stg:border-input stg:bg-background stg:text-foreground","stg:hover:bg-accent stg:hover:text-accent-foreground","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring"),children:"Cancel"}),(0,t.jsx)("button",{type:"button",onClick:e.generate,disabled:e.prompt.trim().length<10,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-sm stg:font-medium stg:transition-colors","stg:bg-primary stg:text-primary-foreground stg:hover:bg-primary-hover","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring","stg:disabled:pointer-events-none stg:disabled:opacity-40"),children:"Generate"})]})]})}function N({flow:e,onClose:s}){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"stg:border-b stg:border-border stg:px-6 stg:py-4",children:[(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-2",children:[(0,t.jsx)("h3",{className:"stg:text-base stg:font-semibold stg:text-foreground",children:"Workflow Architect"}),(0,t.jsxs)("span",{className:"stg:inline-flex stg:items-center stg:gap-1.5 stg:text-xs stg:text-muted-foreground",children:[(0,t.jsx)(_.SpinnerIcon,{size:14}),"starting"===e.phase?"Starting…":"Working…"]})]}),(0,t.jsx)("p",{className:"stg:mt-0.5 stg:text-xs stg:text-muted-foreground",children:"The agent is designing and validating your workflow"})]}),(0,t.jsx)("div",{className:"stg:h-[55vh] stg:overflow-hidden",children:(0,t.jsx)(y.MessageThread,{executions:[],activeStreamExecution:e.execution,pendingUserMessage:"starting"===e.phase?e.prompt:void 0,className:"stg:h-full"})}),(0,t.jsx)("div",{className:"stg:flex stg:justify-end stg:gap-2 stg:border-t stg:border-border stg:px-6 stg:py-3",children:(0,t.jsx)("button",{type:"button",onClick:()=>{e.reset(),s()},className:(0,r.cn)("stg:rounded-md stg:px-3 stg:py-1.5 stg:text-sm stg:font-medium stg:transition-colors","stg:border stg:border-input stg:bg-background stg:text-foreground","stg:hover:bg-accent stg:hover:text-accent-foreground","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring"),children:"Cancel"})})]})}function C({flow:e,onClose:n}){let a="applying"===e.phase,[i,o]=(0,s.useState)(!1);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"stg:border-b stg:border-border stg:px-6 stg:py-4",children:[(0,t.jsx)("h3",{className:"stg:text-base stg:font-semibold stg:text-foreground",children:"Generated Workflow"}),(0,t.jsx)("p",{className:"stg:mt-0.5 stg:text-xs stg:text-muted-foreground",children:"Review the generated workflow before creating it"})]}),(0,t.jsxs)("div",{className:"stg:max-h-[65vh] stg:overflow-y-auto stg:px-6 stg:py-4",children:[e.error&&(0,t.jsx)("div",{className:"stg:mb-4 stg:rounded-md stg:border stg:border-destructive stg:bg-destructive-muted stg:px-3 stg:py-2 stg:text-sm stg:text-destructive",role:"alert",children:e.error}),e.explanation&&(0,t.jsxs)("div",{className:"stg:mb-4",children:[(0,t.jsx)("h4",{className:"stg:mb-1 stg:text-xs stg:font-medium stg:text-muted-foreground",children:"Explanation"}),(0,t.jsx)("p",{className:"stg:whitespace-pre-wrap stg:text-sm stg:text-foreground",children:e.explanation})]}),e.extractedYaml&&(0,t.jsxs)("div",{children:[(0,t.jsx)("h4",{className:"stg:mb-1 stg:text-xs stg:font-medium stg:text-muted-foreground",children:"Workflow Structure"}),(0,t.jsx)("div",{className:"stg:h-[280px] stg:overflow-hidden stg:rounded-md stg:border stg:border-border",children:(0,t.jsx)(b.WorkflowDiffGraph,{beforeYaml:"",afterYaml:e.extractedYaml})}),(0,t.jsxs)("div",{className:"stg:mt-3",children:[(0,t.jsx)("button",{type:"button",onClick:()=>o(e=>!e),className:"stg:text-xs stg:font-medium stg:text-muted-foreground stg:hover:text-foreground",children:i?"▾ Hide YAML":"▸ View YAML"}),i&&(0,t.jsx)("pre",{className:"stg:mt-1 stg:max-h-60 stg:overflow-auto stg:rounded-md stg:border stg:border-border stg:bg-muted stg:p-3 stg:text-xs stg:leading-relaxed stg:text-foreground",children:e.extractedYaml})]})]})]}),(0,t.jsxs)("div",{className:"stg:flex stg:justify-between stg:border-t stg:border-border stg:px-6 stg:py-3",children:[(0,t.jsx)("button",{type:"button",onClick:n,disabled:a,className:(0,r.cn)("stg:rounded-md stg:px-3 stg:py-1.5 stg:text-sm stg:font-medium stg:transition-colors","stg:text-muted-foreground 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"),children:"Close"}),(0,t.jsxs)("div",{className:"stg:flex stg:gap-2",children:[(0,t.jsx)("button",{type:"button",onClick:e.reset,disabled:a,className:(0,r.cn)("stg:rounded-md stg:px-3 stg:py-1.5 stg:text-sm stg:font-medium stg:transition-colors","stg:border stg:border-input stg:bg-background stg:text-foreground","stg:hover:bg-accent stg:hover:text-accent-foreground","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring","stg:disabled:pointer-events-none stg:disabled:opacity-50"),children:"Try Again"}),(0,t.jsxs)("button",{type:"button",onClick:e.createWorkflow,disabled:a,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-sm stg:font-medium stg:transition-colors","stg:bg-primary stg:text-primary-foreground stg:hover:bg-primary-hover","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring","stg:disabled:pointer-events-none stg:disabled:opacity-40"),children:[a&&(0,t.jsx)(_.SpinnerIcon,{size:14}),a?"Creating…":"Create Workflow"]})]})]})]})}function E({flow:e,onClose:s}){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"stg:border-b stg:border-border stg:px-6 stg:py-4",children:(0,t.jsx)("h3",{className:"stg:text-base stg:font-semibold stg:text-foreground",children:"Generation Failed"})}),(0,t.jsx)("div",{className:"stg:px-6 stg:py-6",children:(0,t.jsx)("div",{className:"stg:rounded-md stg:border stg:border-destructive stg:bg-destructive-muted stg:px-3 stg:py-2 stg:text-sm stg:text-destructive",role:"alert",children:e.error??"An unexpected error occurred."})}),(0,t.jsxs)("div",{className:"stg:flex stg:justify-end stg:gap-2 stg:border-t stg:border-border stg:px-6 stg:py-3",children:[(0,t.jsx)("button",{type:"button",onClick:s,className:(0,r.cn)("stg:rounded-md stg:px-3 stg:py-1.5 stg:text-sm stg:font-medium stg:transition-colors","stg:border stg:border-input stg:bg-background stg:text-foreground","stg:hover:bg-accent stg:hover:text-accent-foreground","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring"),children:"Close"}),(0,t.jsx)("button",{type:"button",onClick:e.reset,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-sm stg:font-medium stg:transition-colors","stg:bg-primary stg:text-primary-foreground stg:hover:bg-primary-hover","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring"),children:"Try Again"})]})]})}let A={"customer-support":"Customer Support","code-review":"Code Review","data-analysis":"Data Analysis",devops:"DevOps",content:"Content",integration:"Integration",general:"General"},T={parallel:"Parallel",branching:"Branching",hitl:"Human-in-the-Loop",loop:"Loop","error-handling":"Error Handling",batch:"Batch Processing","ai-pipeline":"AI Pipeline","http-integration":"HTTP Integration"};var I=e.i(938107);e.i(222258);var R=e.i(967785);function L(e){try{let t=(0,R.parse)(e),s=t?.spec;if(!s)return S;let n=Array.isArray(s.tasks)?s.tasks:[],r=new Set;for(let e of n)"string"==typeof e.kind&&r.add(e.kind),function e(t,s){let n=t.task_config;if(!n)return;let r=n.branches;if(Array.isArray(r))for(let t of r){let n=t?.do;if(Array.isArray(n))for(let t of n)"string"==typeof t?.kind&&s.add(t.kind),e(t,s)}let a=n.do;if(Array.isArray(a))for(let t of a)"string"==typeof t?.kind&&s.add(t.kind),e(t,s);let i=n.catch;if(Array.isArray(i))for(let t of i){let n=t?.do;if(Array.isArray(n))for(let t of n)"string"==typeof t?.kind&&s.add(t.kind),e(t,s)}let o=n.do;if(Array.isArray(o)&&"for_each"===t.kind)for(let t of o)"string"==typeof t?.kind&&s.add(t.kind),e(t,s)}(e,r);let a=s.env,i=a&&"object"==typeof a?Object.keys(a).length:0,o=null!=s.budget&&"object"==typeof s.budget,l=function(e,t){let s=[];t.has("fork")&&s.push("parallel"),t.has("switch_case")&&s.push("branching"),t.has("human_input")&&s.push("hitl"),t.has("for_each")&&s.push("batch"),t.has("try_catch")&&s.push("error-handling"),(t.has("http_call")||t.has("grpc_call"))&&s.push("http-integration"),(["agent_call","llm_call","eval"].filter(e=>t.has(e)).length>=2||t.has("agent_call")&&e.filter(e=>"agent_call"===e.kind).length>=2)&&s.push("ai-pipeline");let n=e.map(e=>e.name).filter(Boolean);for(let t=0;t<e.length;t++){let r=e[t]?.flow?.then;if(r&&n.indexOf(r)<t){s.push("loop");break}}return s}(n,r);return{taskCount:n.length,taskKinds:[...r].sort(),patterns:l,envVarCount:i,hasBudget:o}}catch{return S}}let S={taskCount:0,taskKinds:[],patterns:[],envVarCount:0,hasBudget:!1};var P=e.i(855862);let O={"customer-support":"stg:bg-blue-500/10 stg:text-blue-700 stg:dark:text-blue-400","code-review":"stg:bg-violet-500/10 stg:text-violet-700 stg:dark:text-violet-400","data-analysis":"stg:bg-amber-500/10 stg:text-amber-700 stg:dark:text-amber-400",devops:"stg:bg-emerald-500/10 stg:text-emerald-700 stg:dark:text-emerald-400",content:"stg:bg-pink-500/10 stg:text-pink-700 stg:dark:text-pink-400",integration:"stg:bg-cyan-500/10 stg:text-cyan-700 stg:dark:text-cyan-400",general:"stg:bg-muted stg:text-muted-foreground"},M={parallel:"stg:bg-violet-500/10 stg:text-violet-700 stg:dark:text-violet-400",branching:"stg:bg-amber-500/10 stg:text-amber-700 stg:dark:text-amber-400",hitl:"stg:bg-emerald-500/10 stg:text-emerald-700 stg:dark:text-emerald-400",loop:"stg:bg-pink-500/10 stg:text-pink-700 stg:dark:text-pink-400","error-handling":"stg:bg-red-500/10 stg:text-red-700 stg:dark:text-red-400",batch:"stg:bg-cyan-500/10 stg:text-cyan-700 stg:dark:text-cyan-400","ai-pipeline":"stg:bg-blue-500/10 stg:text-blue-700 stg:dark:text-blue-400","http-integration":"stg:bg-orange-500/10 stg:text-orange-700 stg:dark:text-orange-400"};function z({template:e,onSelect:n,onPreview:a,className:i}){let o=(0,s.useMemo)(()=>L(e.data.yaml??""),[e.data.yaml]),l=(0,s.useCallback)(()=>{n(e)},[n,e]),c=(0,s.useCallback)(t=>{t.stopPropagation(),a?.(e)},[a,e]),g=(0,s.useCallback)(t=>{("Enter"===t.key||" "===t.key)&&(t.preventDefault(),n(e))},[n,e]),d=P.TEMPLATE_CATEGORY_LABELS[e.category]??e.category;return(0,t.jsxs)("div",{role:"button",tabIndex:0,onClick:l,onKeyDown:g,"aria-label":`Use ${e.name} template`,className:(0,r.cn)("stg:group stg:flex stg:cursor-pointer stg:flex-col stg:gap-3 stg:rounded-lg stg:border stg:border-border stg:bg-card stg:p-4","stg:transition-colors stg:hover:border-primary stg:hover:bg-accent","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring",i),children:[(0,t.jsxs)("div",{className:"stg:flex stg:items-start stg:justify-between stg:gap-2",children:[(0,t.jsxs)("div",{className:"stg:min-w-0 stg:flex-1",children:[(0,t.jsx)("p",{className:"stg:text-sm stg:font-medium stg:text-foreground",children:e.name}),(0,t.jsx)("span",{className:(0,r.cn)("stg:mt-1 stg:inline-block stg:rounded-full stg:px-2 stg:py-0.5 stg:text-[10px] stg:font-medium",O[e.category]??O.general),children:d})]}),a&&(0,t.jsx)("button",{type:"button",onClick:c,"aria-label":`Preview ${e.name}`,className:(0,r.cn)("stg:rounded-md stg:p-1 stg:text-muted-foreground stg:opacity-0 stg:transition-opacity","stg:hover:bg-accent stg:hover:text-accent-foreground","stg:focus-visible:opacity-100 stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring","stg:group-hover:opacity-100"),children:(0,t.jsx)(D,{})})]}),(0,t.jsx)("p",{className:"stg:line-clamp-2 stg:text-xs stg:leading-relaxed stg:text-muted-foreground",children:e.description}),o.patterns.length>0&&(0,t.jsx)("div",{className:"stg:flex stg:flex-wrap stg:gap-1",children:o.patterns.slice(0,3).map(e=>(0,t.jsx)("span",{className:(0,r.cn)("stg:rounded stg:px-1.5 stg:py-0.5 stg:text-[10px] stg:font-medium",M[e]??"stg:bg-muted stg:text-muted-foreground"),children:T[e]},e))}),(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-3 stg:text-[10px] stg:text-muted-foreground",children:[(0,t.jsxs)("span",{children:[o.taskCount," tasks"]}),o.envVarCount>0&&(0,t.jsxs)("span",{children:[o.envVarCount," env vars"]}),o.hasBudget&&(0,t.jsx)("span",{children:"Budget"})]})]})}function D(){return(0,t.jsxs)("svg",{className:"stg:size-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z"}),(0,t.jsx)("circle",{cx:12,cy:12,r:3})]})}var W=e.i(154548);function U({template:e,open:n,onClose:a,onSelect:o}){let l=(0,s.useCallback)(e=>{e||a()},[a]),c=(0,s.useCallback)(()=>{e&&o(e)},[e,o]),g=(0,s.useMemo)(()=>e?L(e.data.yaml??""):null,[e]);if(!e||!g)return null;let d=P.TEMPLATE_CATEGORY_LABELS[e.category]??e.category;return(0,t.jsx)(i.DialogShell,{open:n,onOpenChange:l,width:"3xl",className:"stgm stg:max-h-[85vh] stg:bg-background","aria-label":`Preview ${e.name}`,children:(0,t.jsxs)("div",{className:"stg:flex stg:flex-col",children:[(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:justify-between stg:border-b stg:border-border stg:px-5 stg:py-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"stg:text-base stg:font-semibold stg:text-foreground",children:e.name}),(0,t.jsx)("span",{className:"stg:text-xs stg:text-muted-foreground",children:d})]}),(0,t.jsx)("button",{type:"button",onClick:a,"aria-label":"Close preview",className:(0,r.cn)("stg:rounded-md stg:p-1.5 stg:text-muted-foreground stg:transition-colors","stg:hover:bg-accent stg:hover:text-accent-foreground","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring"),children:(0,t.jsx)(q,{})})]}),(0,t.jsxs)("div",{className:"stg:flex stg:flex-col stg:gap-4 stg:px-5 stg:py-4",children:[(0,t.jsx)("p",{className:"stg:text-sm stg:leading-relaxed stg:text-muted-foreground",children:e.description}),(0,t.jsxs)("div",{className:"stg:flex stg:flex-wrap stg:items-center stg:gap-3",children:[(0,t.jsx)(F,{label:`${g.taskCount} tasks`}),(0,t.jsx)(F,{label:`${g.taskKinds.length} task types`}),g.envVarCount>0&&(0,t.jsx)(F,{label:`${g.envVarCount} env vars`}),g.hasBudget&&(0,t.jsx)(F,{label:"Budget configured"})]}),g.patterns.length>0&&(0,t.jsx)("div",{className:"stg:flex stg:flex-wrap stg:gap-1.5",children:g.patterns.map(e=>(0,t.jsx)("span",{className:"stg:rounded-full stg:bg-muted stg:px-2.5 stg:py-0.5 stg:text-xs stg:font-medium stg:text-muted-foreground",children:T[e]},e))}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"stg:mb-1.5 stg:text-xs stg:font-medium stg:text-foreground",children:"Task types used"}),(0,t.jsx)("div",{className:"stg:flex stg:flex-wrap stg:gap-1.5",children:g.taskKinds.map(e=>(0,t.jsx)("code",{className:"stg:rounded stg:bg-muted stg:px-1.5 stg:py-0.5 stg:text-[11px] stg:text-muted-foreground",children:e},e))})]}),(0,t.jsx)("div",{className:"stg:h-64 stg:overflow-hidden stg:rounded-md stg:border stg:border-border stg:bg-muted/30",children:(0,t.jsx)(W.ReactFlowProvider,{children:(0,t.jsx)(B,{yaml:e.data.yaml??""})})})]}),(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:justify-end stg:gap-2 stg:border-t stg:border-border stg:px-5 stg:py-3",children:[(0,t.jsx)("button",{type:"button",onClick:a,className:(0,r.cn)("stg:rounded-md stg:px-3 stg:py-1.5 stg:text-sm stg:font-medium stg:text-muted-foreground stg:transition-colors","stg:hover:bg-accent stg:hover:text-accent-foreground","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring"),children:"Cancel"}),(0,t.jsx)("button",{type:"button",onClick:c,className:(0,r.cn)("stg:rounded-md stg:bg-primary stg:px-4 stg:py-1.5 stg:text-sm stg:font-medium stg:text-primary-foreground stg:transition-colors","stg:hover:bg-primary/90","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring"),children:"Use this template"})]})]})})}function B({yaml:e}){let{fitView:n}=(0,W.useReactFlow)(),[r,a]=(0,s.useState)({nodes:[],edges:[]});return((0,s.useEffect)(()=>{try{let t=(0,R.parse)(e),s=t?.spec?.tasks??[],n=[],r=[];for(let e=0;e<s.length;e++){let t=s[e],a=t.name??`task_${e}`;n.push({id:a,type:"default",position:{x:150,y:80*e},data:{label:`${a} (${t.kind??"unknown"})`},style:{fontSize:11,padding:"4px 8px",borderRadius:6,minWidth:160,textAlign:"center"}});let i=t.flow?.then;if(i&&"end"!==i)r.push({id:`${a}->${i}`,source:a,target:i});else if(!i&&e<s.length-1){let t=s[e+1];r.push({id:`${a}->${t.name??`task_${e+1}`}`,source:a,target:t.name??`task_${e+1}`})}}a({nodes:n,edges:r})}catch{a({nodes:[],edges:[]})}},[e]),(0,s.useEffect)(()=>{if(r.nodes.length>0){let e=setTimeout(()=>n({padding:.2}),50);return()=>clearTimeout(e)}},[r.nodes.length,n]),0===r.nodes.length)?(0,t.jsx)("div",{className:"stg:flex stg:h-full stg:items-center stg:justify-center stg:text-xs stg:text-muted-foreground",children:"No preview available"}):(0,t.jsx)(W.ReactFlow,{nodes:r.nodes,edges:r.edges,nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1,panOnDrag:!0,zoomOnScroll:!0,fitView:!0,proOptions:{hideAttribution:!0},children:(0,t.jsx)(W.Background,{variant:W.BackgroundVariant.Dots,gap:16,size:1})})}function F({label:e}){return(0,t.jsx)("span",{className:"stg:rounded-md stg:bg-muted stg:px-2 stg:py-0.5 stg:text-[11px] stg:font-medium stg:text-muted-foreground",children:e})}function q(){return(0,t.jsxs)("svg",{className:"stg:size-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M18 6 6 18"}),(0,t.jsx)("path",{d:"m6 6 12 12"})]})}function Y({templates:e,onSelect:n,emptyContent:a,className:i}){let{filtered:o,query:l,setQuery:c,activeCategory:g,setActiveCategory:d,availableCategories:u}=(0,I.useTemplateFilter)({templates:e}),[p,m]=(0,s.useState)(null),h=(0,s.useCallback)(e=>{m(e)},[]),f=(0,s.useCallback)(()=>{m(null)},[]),x=(0,s.useCallback)(e=>{m(null),n(e)},[n]),v=(0,s.useCallback)(e=>{let t=e.currentTarget.querySelectorAll('[role="tab"]');if(!t.length)return;let s=Array.from(t).findIndex(e=>e===document.activeElement);if(-1===s)return;let n=null;"ArrowRight"===e.key?n=(s+1)%t.length:"ArrowLeft"===e.key?n=(s-1+t.length)%t.length:"Home"===e.key?n=0:"End"===e.key&&(n=t.length-1),null!==n&&(e.preventDefault(),t[n].focus(),t[n].click())},[]);return(0,t.jsxs)("div",{className:(0,r.cn)("stg:flex stg:flex-col stg:gap-4",i),children:[(0,t.jsxs)("div",{className:"stg:relative",children:[(0,t.jsx)(V,{}),(0,t.jsx)("input",{type:"search",value:l,onChange:e=>c(e.target.value),placeholder:"Search templates…","aria-label":"Search workflow templates",className:(0,r.cn)("stg:w-full stg:rounded-md stg:border stg:border-input stg:bg-input-bg stg:py-2 stg:pl-9 stg:pr-3 stg:text-sm stg:text-foreground","stg:placeholder:text-muted-foreground","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring")})]}),u.length>1&&(0,t.jsxs)("div",{role:"tablist","aria-label":"Template categories",onKeyDown:v,className:"stg:flex stg:flex-wrap stg:gap-1",children:[(0,t.jsx)(G,{label:"All",isActive:null===g,onClick:()=>d(null)}),u.map(e=>(0,t.jsx)(G,{label:A[e]??e,isActive:g===e,onClick:()=>d(e)},e))]}),o.length>0?(0,t.jsx)("div",{role:"list","aria-label":"Workflow templates",className:"stg:grid stg:grid-cols-1 stg:gap-3 stg:sm:grid-cols-2 stg:lg:grid-cols-3",children:o.map(e=>(0,t.jsx)("div",{role:"listitem",children:(0,t.jsx)(z,{template:e,onSelect:n,onPreview:h})},e.id))}):a??(0,t.jsx)("div",{className:"stg:py-8 stg:text-center stg:text-sm stg:text-muted-foreground",children:"No templates match your search."}),(0,t.jsx)(U,{template:p,open:null!==p,onClose:f,onSelect:x})]})}function G({label:e,isActive:s,onClick:n}){return(0,t.jsx)("button",{type:"button",role:"tab","aria-selected":s,tabIndex:s?0:-1,onClick:n,className:(0,r.cn)("stg:rounded-md stg:px-2.5 stg:py-1 stg:text-xs stg:font-medium stg:transition-colors","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring",s?"stg:bg-primary stg:text-primary-foreground":"stg:bg-muted stg:text-muted-foreground stg:hover:bg-accent stg:hover:text-accent-foreground"),children:e})}function V(){return(0,t.jsxs)("svg",{className:"stg:pointer-events-none stg:absolute stg:left-3 stg:top-1/2 stg:size-4 stg:-translate-y-1/2 stg:text-muted-foreground",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,t.jsx)("circle",{cx:11,cy:11,r:8}),(0,t.jsx)("path",{d:"m21 21-4.3-4.3"})]})}let K=`apiVersion: agentic.stigmer.ai/v1
2
2
  kind: Workflow
3
3
  metadata:
4
4
  name: my-workflow
@@ -1068,4 +1068,4 @@ spec:
1068
1068
  max_retries: 2
1069
1069
  export:
1070
1070
  as: "\${ . }"
1071
- `}}];var J=e.i(297629),Q=e.i(310057),X=e.i(380568),Z=e.i(846696),ee=e.i(451241),et=e.i(789198);let es=()=>e.r(195737)(Worker);function en({title:e,description:s,icon:n,onClick:a,badge:i}){return(0,t.jsxs)("button",{type:"button",onClick:a,className:(0,r.cn)("group flex flex-col items-center gap-3 rounded-lg border border-border bg-card p-6 text-center","transition-colors hover:border-primary hover:bg-accent","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"),children:[(0,t.jsx)("span",{className:"text-muted-foreground transition-colors group-hover:text-foreground",children:n}),(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:e}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:s})]}),i&&(0,t.jsx)("span",{className:"rounded-full bg-muted px-2 py-0.5 text-[10px] font-medium text-muted-foreground",children:i})]})}function er(){return(0,t.jsxs)("svg",{className:"size-8",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,t.jsx)("rect",{width:"7",height:"7",x:"3",y:"3",rx:"1"}),(0,t.jsx)("rect",{width:"7",height:"7",x:"14",y:"3",rx:"1"}),(0,t.jsx)("rect",{width:"7",height:"7",x:"14",y:"14",rx:"1"}),(0,t.jsx)("rect",{width:"7",height:"7",x:"3",y:"14",rx:"1"})]})}function ea(){return(0,t.jsxs)("svg",{className:"size-8",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,t.jsx)("rect",{width:"7",height:"7",x:"3",y:"3",rx:"1"}),(0,t.jsx)("rect",{width:"7",height:"7",x:"14",y:"3",rx:"1"}),(0,t.jsx)("rect",{width:"7",height:"7",x:"14",y:"14",rx:"1"}),(0,t.jsx)("rect",{width:"7",height:"7",x:"3",y:"14",rx:"1"})]})}function ei(){return(0,t.jsxs)("svg",{className:"size-8",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M12 3l1.5 4.5L18 9l-4.5 1.5L12 15l-1.5-4.5L6 9l4.5-1.5z"}),(0,t.jsx)("path",{d:"M18 15l.75 2.25L21 18l-2.25.75L18 21l-.75-2.25L15 18l2.25-.75z"})]})}function eo(){return(0,t.jsxs)("svg",{className:"size-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"m12 19-7-7 7-7"}),(0,t.jsx)("path",{d:"M19 12H5"})]})}e.s(["WorkflowNewPage",0,function(){let e=(0,J.useActiveOrgSlug)(),i=(0,n.useRouter)(),o=(0,X.useElkLayoutEngine)({workerFactory:es}),{navigateToDetail:l}=(0,ee.useLibraryNavigation)(),{setLabel:c}=(0,Q.useBreadcrumbOverride)(),[g,d]=(0,s.useState)("picking"),[u,p]=(0,s.useState)(K);(0,et.useRequestFullViewport)("editor"===g),(0,s.useEffect)(()=>{c("New workflow")},[c]);let m=(0,s.useCallback)(()=>{Z.toast.success("Workflow created"),i.push("/library/workflows")},[i]),h=(0,s.useCallback)(e=>{Z.toast.error(e.message)},[]),f=(0,s.useCallback)(e=>{p(e.data.yaml??K),d("editor")},[]),x=(0,s.useCallback)((e,t)=>{l("workflows",e,t)},[l]);return e?"editor"===g?(0,t.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 border-b border-border px-3 py-2",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>d("picking"),className:(0,r.cn)("inline-flex items-center gap-1.5 rounded-md px-2 py-1 text-sm","text-muted-foreground transition-colors","hover:bg-accent hover:text-accent-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"),children:[(0,t.jsx)(eo,{}),"Back"]}),(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"New workflow"})]}),(0,t.jsx)("div",{className:"min-h-0 flex-1",children:(0,t.jsx)(a.WorkflowEditorView,{initialYaml:u,org:e,defaultMode:"visual",layoutEngine:o,onSaveSuccess:m,onSaveError:h,className:"h-full"})})]}):"templates"===g?(0,t.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("button",{type:"button",onClick:()=>d("picking"),"aria-label":"Back to creation options",className:(0,r.cn)("inline-flex items-center justify-center rounded-md p-1.5","text-muted-foreground transition-colors","hover:bg-accent hover:text-accent-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"),children:(0,t.jsx)(eo,{})}),(0,t.jsx)("h2",{className:"text-base font-semibold text-foreground",children:"Choose a template"})]}),(0,t.jsx)(Y,{templates:H,onSelect:f})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"text-lg font-semibold text-foreground",children:"Create a new workflow"}),(0,t.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:"Choose how you'd like to get started."})]}),(0,t.jsxs)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-3",children:[(0,t.jsx)(en,{title:"Start from template",description:"Browse pre-built workflow patterns and customize them.",icon:(0,t.jsx)(er,{}),onClick:()=>d("templates"),badge:`${H.length} available`}),(0,t.jsx)(en,{title:"Visual Editor",description:"Design your workflow visually with drag-and-drop tasks and connections.",icon:(0,t.jsx)(ea,{}),onClick:()=>{p(K),d("editor")}}),(0,t.jsx)(en,{title:"Generate with AI",description:"Describe what you want and let AI create a workflow for you.",icon:(0,t.jsx)(ei,{}),onClick:()=>d("generating")})]})]}),(0,t.jsx)(k,{open:"generating"===g,onOpenChange:e=>{e||d("picking")},org:e,onSuccess:x,onError:e=>Z.toast.error(e)})]}):null}],765391)}]);
1071
+ `}}];var J=e.i(297629),Q=e.i(310057),X=e.i(380568),Z=e.i(846696),ee=e.i(451241),et=e.i(789198);let es=()=>e.r(195737)(Worker);function en({title:e,description:s,icon:n,onClick:a,badge:i}){return(0,t.jsxs)("button",{type:"button",onClick:a,className:(0,r.cn)("group flex flex-col items-center gap-3 rounded-lg border border-border bg-card p-6 text-center","transition-colors hover:border-primary hover:bg-accent","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"),children:[(0,t.jsx)("span",{className:"text-muted-foreground transition-colors group-hover:text-foreground",children:n}),(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:e}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:s})]}),i&&(0,t.jsx)("span",{className:"rounded-full bg-muted px-2 py-0.5 text-[10px] font-medium text-muted-foreground",children:i})]})}function er(){return(0,t.jsxs)("svg",{className:"size-8",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,t.jsx)("rect",{width:"7",height:"7",x:"3",y:"3",rx:"1"}),(0,t.jsx)("rect",{width:"7",height:"7",x:"14",y:"3",rx:"1"}),(0,t.jsx)("rect",{width:"7",height:"7",x:"14",y:"14",rx:"1"}),(0,t.jsx)("rect",{width:"7",height:"7",x:"3",y:"14",rx:"1"})]})}function ea(){return(0,t.jsxs)("svg",{className:"size-8",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,t.jsx)("rect",{width:"7",height:"7",x:"3",y:"3",rx:"1"}),(0,t.jsx)("rect",{width:"7",height:"7",x:"14",y:"3",rx:"1"}),(0,t.jsx)("rect",{width:"7",height:"7",x:"14",y:"14",rx:"1"}),(0,t.jsx)("rect",{width:"7",height:"7",x:"3",y:"14",rx:"1"})]})}function ei(){return(0,t.jsxs)("svg",{className:"size-8",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M12 3l1.5 4.5L18 9l-4.5 1.5L12 15l-1.5-4.5L6 9l4.5-1.5z"}),(0,t.jsx)("path",{d:"M18 15l.75 2.25L21 18l-2.25.75L18 21l-.75-2.25L15 18l2.25-.75z"})]})}function eo(){return(0,t.jsxs)("svg",{className:"size-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"m12 19-7-7 7-7"}),(0,t.jsx)("path",{d:"M19 12H5"})]})}e.s(["WorkflowNewPage",0,function(){let e=(0,J.useActiveOrgSlug)(),i=(0,n.useRouter)(),o=(0,X.useElkLayoutEngine)({workerFactory:es}),{navigateToDetail:l}=(0,ee.useLibraryNavigation)(),{setLabel:c}=(0,Q.useBreadcrumbOverride)(),g=(0,v.useWorkflowArchitect)(e),[d,u]=(0,s.useState)("picking"),[p,m]=(0,s.useState)(K);(0,et.useRequestFullViewport)("editor"===d),(0,s.useEffect)(()=>{c("New workflow")},[c]);let h=(0,s.useCallback)(()=>{Z.toast.success("Workflow created"),i.push("/library/workflows")},[i]),f=(0,s.useCallback)(e=>{Z.toast.error(e.message)},[]),x=(0,s.useCallback)(e=>{m(e.data.yaml??K),u("editor")},[]),y=(0,s.useCallback)((e,t)=>{l("workflows",e,t)},[l]);return e?"editor"===d?(0,t.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 border-b border-border px-3 py-2",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>u("picking"),className:(0,r.cn)("inline-flex items-center gap-1.5 rounded-md px-2 py-1 text-sm","text-muted-foreground transition-colors","hover:bg-accent hover:text-accent-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"),children:[(0,t.jsx)(eo,{}),"Back"]}),(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"New workflow"})]}),(0,t.jsx)("div",{className:"min-h-0 flex-1",children:(0,t.jsx)(a.WorkflowEditorView,{initialYaml:p,org:e,defaultMode:"visual",layoutEngine:o,onSaveSuccess:h,onSaveError:f,className:"h-full"})})]}):"templates"===d?(0,t.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("button",{type:"button",onClick:()=>u("picking"),"aria-label":"Back to creation options",className:(0,r.cn)("inline-flex items-center justify-center rounded-md p-1.5","text-muted-foreground transition-colors","hover:bg-accent hover:text-accent-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"),children:(0,t.jsx)(eo,{})}),(0,t.jsx)("h2",{className:"text-base font-semibold text-foreground",children:"Choose a template"})]}),(0,t.jsx)(Y,{templates:H,onSelect:x})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"text-lg font-semibold text-foreground",children:"Create a new workflow"}),(0,t.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:"Choose how you'd like to get started."})]}),(0,t.jsxs)("div",{className:(0,r.cn)("grid grid-cols-1 gap-3","available"===g.availability?"sm:grid-cols-3":"sm:grid-cols-2"),children:[(0,t.jsx)(en,{title:"Start from template",description:"Browse pre-built workflow patterns and customize them.",icon:(0,t.jsx)(er,{}),onClick:()=>u("templates"),badge:`${H.length} available`}),(0,t.jsx)(en,{title:"Visual Editor",description:"Design your workflow visually with drag-and-drop tasks and connections.",icon:(0,t.jsx)(ea,{}),onClick:()=>{m(K),u("editor")}}),"available"===g.availability&&(0,t.jsx)(en,{title:"Generate with AI",description:"Describe what you want and let AI create a workflow for you.",icon:(0,t.jsx)(ei,{}),onClick:()=>u("generating")})]})]}),"available"===g.availability&&(0,t.jsx)(k,{open:"generating"===d,onOpenChange:e=>{e||u("picking")},org:e,onSuccess:y,onError:e=>Z.toast.error(e)})]}):null}],765391)}]);
@@ -0,0 +1 @@
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)}]);