@orgsdk/cli 1.0.1 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (219) hide show
  1. package/README.md +5 -3
  2. package/bin/configuration.mjs +0 -12
  3. package/bin/options.mjs +6 -5
  4. package/bin/orgsdk.mjs +5 -7
  5. package/bin/supervision.mjs +29 -40
  6. package/dist/THIRD_PARTY_NOTICES.txt +53 -0
  7. package/dist/runtime/README.md +3 -3
  8. package/dist/server/index.js +935 -650
  9. package/dist/server/out/404/index.html +1 -1
  10. package/dist/server/out/404.html +1 -1
  11. package/dist/server/out/__next.!KHdvcmtzcGFjZSk.__PAGE__.txt +34 -33
  12. package/dist/server/out/__next._full.txt +28 -27
  13. package/dist/server/out/__next._tree.txt +1 -1
  14. package/dist/server/out/_next/static/chunks/08j8vkv6c63tl.js +1 -0
  15. package/dist/server/out/_next/static/chunks/08mhtndhqtap6.js +1 -0
  16. package/dist/server/out/_next/static/chunks/0_4g944_32yce.js +1 -0
  17. package/dist/server/out/_next/static/chunks/0ldil27yuop5w.js +1 -0
  18. package/dist/server/out/_next/static/chunks/0ml0xmlylpypc.js +1 -0
  19. package/dist/server/out/_next/static/chunks/0pnz1790dyskl.js +1 -0
  20. package/dist/server/out/_next/static/chunks/0vvzjn6qqroc-.js +1 -0
  21. package/dist/server/out/_next/static/chunks/1-rdwquujn9vu.js +1 -0
  22. package/dist/server/out/_next/static/chunks/{0y5lgqdwpeabb.js → 119rk6qs93dvi.js} +1 -1
  23. package/dist/server/out/_next/static/chunks/1mvslk_7tkoql.js +1 -0
  24. package/dist/server/out/_next/static/chunks/1qo38zfnwh7m8.js +1 -0
  25. package/dist/server/out/_next/static/chunks/1wzgdpm-y6pr7.js +1 -0
  26. package/dist/server/out/_next/static/chunks/1ybinna1i7_ih.js +1 -0
  27. package/dist/server/out/_next/static/chunks/1z4_it-ka8j5y.js +1 -0
  28. package/dist/server/out/_next/static/chunks/{0khjy8qh1ll42.js → 23_jxnb5bd655.js} +1 -1
  29. package/dist/server/out/_next/static/chunks/26xwt7opuq5ra.js +1 -0
  30. package/dist/server/out/_next/static/chunks/2_mjw80no8x2k.js +1 -0
  31. package/dist/server/out/_next/static/chunks/2e3acf42jw52v.js +1 -0
  32. package/dist/server/out/_next/static/chunks/2isb6m1ll4dfq.js +3 -0
  33. package/dist/server/out/_next/static/chunks/2q18r9vstryqj.js +3 -0
  34. package/dist/server/out/_next/static/chunks/2zwn2yzygk1de.js +1 -0
  35. package/dist/server/out/_next/static/chunks/{2z60o39-yshg2.js → 36wd29nar_zo_.js} +1 -1
  36. package/dist/server/out/_next/static/chunks/37a4b-pq_bp3z.js +1 -0
  37. package/dist/server/out/_next/static/chunks/37ulwyxnek-f9.js +1 -0
  38. package/dist/server/out/_next/static/chunks/38qp_i6ue7fcy.js +1 -0
  39. package/dist/server/out/_next/static/chunks/3a4y69p5pl3_7.js +10 -0
  40. package/dist/server/out/_next/static/chunks/3l2yelj-blib4.js +1 -0
  41. package/dist/server/out/_next/static/chunks/3u6154viqt17v.js +1 -0
  42. package/dist/server/out/_next/static/chunks/{2navy2mx7--vk.js → 3w6l6p3ylx6oq.js} +2 -2
  43. package/dist/server/out/_next/static/chunks/{0cwfl2xanfapu.js → 3yetoibj5lso8.js} +1 -1
  44. package/dist/server/out/_next/static/chunks/42mg-r2kufm8n.js +1 -0
  45. package/dist/server/out/_not-found/__next._full.txt +22 -19
  46. package/dist/server/out/_not-found/__next._not-found.__PAGE__.txt +25 -22
  47. package/dist/server/out/_not-found/__next._tree.txt +1 -1
  48. package/dist/server/out/_not-found/index.html +1 -1
  49. package/dist/server/out/_not-found/index.txt +22 -19
  50. package/dist/server/out/accounts/2fa/__next._full.txt +25 -24
  51. package/dist/server/out/accounts/2fa/__next._tree.txt +1 -1
  52. package/dist/server/out/accounts/2fa/__next.accounts.2fa.__PAGE__.txt +28 -27
  53. package/dist/server/out/accounts/2fa/index.html +1 -1
  54. package/dist/server/out/accounts/2fa/index.txt +25 -24
  55. package/dist/server/out/accounts/email/__next._full.txt +25 -24
  56. package/dist/server/out/accounts/email/__next._tree.txt +1 -1
  57. package/dist/server/out/accounts/email/__next.accounts.email.__PAGE__.txt +28 -27
  58. package/dist/server/out/accounts/email/index.html +1 -1
  59. package/dist/server/out/accounts/email/index.txt +25 -24
  60. package/dist/server/out/accounts/login/__next._full.txt +25 -24
  61. package/dist/server/out/accounts/login/__next._tree.txt +1 -1
  62. package/dist/server/out/accounts/login/__next.accounts.login.__PAGE__.txt +28 -27
  63. package/dist/server/out/accounts/login/index.html +1 -1
  64. package/dist/server/out/accounts/login/index.txt +25 -24
  65. package/dist/server/out/accounts/logout/__next._full.txt +25 -24
  66. package/dist/server/out/accounts/logout/__next._tree.txt +1 -1
  67. package/dist/server/out/accounts/logout/__next.accounts.logout.__PAGE__.txt +28 -27
  68. package/dist/server/out/accounts/logout/index.html +1 -1
  69. package/dist/server/out/accounts/logout/index.txt +25 -24
  70. package/dist/server/out/accounts/password/change/__next._full.txt +26 -25
  71. package/dist/server/out/accounts/password/change/__next._tree.txt +1 -1
  72. package/dist/server/out/accounts/password/change/__next.accounts.password.change.__PAGE__.txt +30 -29
  73. package/dist/server/out/accounts/password/change/index.html +1 -1
  74. package/dist/server/out/accounts/password/change/index.txt +26 -25
  75. package/dist/server/out/accounts/password/reset/__next._full.txt +25 -23
  76. package/dist/server/out/accounts/password/reset/__next._tree.txt +1 -1
  77. package/dist/server/out/accounts/password/reset/__next.accounts.password.reset.__PAGE__.txt +29 -27
  78. package/dist/server/out/accounts/password/reset/index.html +1 -1
  79. package/dist/server/out/accounts/password/reset/index.txt +25 -23
  80. package/dist/server/out/accounts/signup/__next._full.txt +25 -24
  81. package/dist/server/out/accounts/signup/__next._tree.txt +1 -1
  82. package/dist/server/out/accounts/signup/__next.accounts.signup.__PAGE__.txt +28 -27
  83. package/dist/server/out/accounts/signup/index.html +1 -1
  84. package/dist/server/out/accounts/signup/index.txt +25 -24
  85. package/dist/server/out/actions/__next.!KHdvcmtzcGFjZSk.actions.__PAGE__.txt +33 -33
  86. package/dist/server/out/actions/__next._full.txt +28 -28
  87. package/dist/server/out/actions/__next._tree.txt +1 -1
  88. package/dist/server/out/actions/index.html +1 -1
  89. package/dist/server/out/actions/index.txt +28 -28
  90. package/dist/server/out/agents/__next.!KHdvcmtzcGFjZSk.agents.__PAGE__.txt +38 -37
  91. package/dist/server/out/agents/__next._full.txt +31 -30
  92. package/dist/server/out/agents/__next._tree.txt +1 -1
  93. package/dist/server/out/agents/index.html +1 -1
  94. package/dist/server/out/agents/index.txt +31 -30
  95. package/dist/server/out/approvals/__next.!KHdvcmtzcGFjZSk.approvals.__PAGE__.txt +38 -37
  96. package/dist/server/out/approvals/__next._full.txt +31 -30
  97. package/dist/server/out/approvals/__next._tree.txt +1 -1
  98. package/dist/server/out/approvals/index.html +1 -1
  99. package/dist/server/out/approvals/index.txt +31 -30
  100. package/dist/server/out/artifacts/__next.!KHdvcmtzcGFjZSk.artifacts.__PAGE__.txt +30 -30
  101. package/dist/server/out/artifacts/__next._full.txt +25 -25
  102. package/dist/server/out/artifacts/__next._tree.txt +1 -1
  103. package/dist/server/out/artifacts/index.html +1 -1
  104. package/dist/server/out/artifacts/index.txt +25 -25
  105. package/dist/server/out/audit/__next.!KHdvcmtzcGFjZSk.audit.__PAGE__.txt +35 -34
  106. package/dist/server/out/audit/__next._full.txt +28 -27
  107. package/dist/server/out/audit/__next._tree.txt +1 -1
  108. package/dist/server/out/audit/index.html +1 -1
  109. package/dist/server/out/audit/index.txt +28 -27
  110. package/dist/server/out/chat/__next.!KHdvcmtzcGFjZSk.chat.__PAGE__.txt +34 -33
  111. package/dist/server/out/chat/__next._full.txt +27 -26
  112. package/dist/server/out/chat/__next._tree.txt +1 -1
  113. package/dist/server/out/chat/index.html +1 -1
  114. package/dist/server/out/chat/index.txt +27 -26
  115. package/dist/server/out/connections/__next.!KHdvcmtzcGFjZSk.connections.__PAGE__.txt +38 -37
  116. package/dist/server/out/connections/__next._full.txt +31 -30
  117. package/dist/server/out/connections/__next._tree.txt +1 -1
  118. package/dist/server/out/connections/index.html +1 -1
  119. package/dist/server/out/connections/index.txt +31 -30
  120. package/dist/server/out/credentials/__next.!KHdvcmtzcGFjZSk.credentials.__PAGE__.txt +29 -29
  121. package/dist/server/out/credentials/__next._full.txt +24 -24
  122. package/dist/server/out/credentials/__next._tree.txt +1 -1
  123. package/dist/server/out/credentials/index.html +1 -1
  124. package/dist/server/out/credentials/index.txt +24 -24
  125. package/dist/server/out/documents/__next.!KHdvcmtzcGFjZSk.documents.__PAGE__.txt +38 -37
  126. package/dist/server/out/documents/__next._full.txt +31 -30
  127. package/dist/server/out/documents/__next._tree.txt +1 -1
  128. package/dist/server/out/documents/index.html +1 -1
  129. package/dist/server/out/documents/index.txt +31 -30
  130. package/dist/server/out/index.html +1 -1
  131. package/dist/server/out/index.txt +28 -27
  132. package/dist/server/out/people/__next.!KHdvcmtzcGFjZSk.people.__PAGE__.txt +38 -37
  133. package/dist/server/out/people/__next._full.txt +31 -30
  134. package/dist/server/out/people/__next._tree.txt +1 -1
  135. package/dist/server/out/people/index.html +1 -1
  136. package/dist/server/out/people/index.txt +31 -30
  137. package/dist/server/out/plugins/__next.!KHdvcmtzcGFjZSk.plugins.__PAGE__.txt +31 -31
  138. package/dist/server/out/plugins/__next._full.txt +26 -26
  139. package/dist/server/out/plugins/__next._tree.txt +1 -1
  140. package/dist/server/out/plugins/index.html +1 -1
  141. package/dist/server/out/plugins/index.txt +26 -26
  142. package/dist/server/out/projects/__next.!KHdvcmtzcGFjZSk.projects.__PAGE__.txt +38 -37
  143. package/dist/server/out/projects/__next._full.txt +31 -30
  144. package/dist/server/out/projects/__next._tree.txt +1 -1
  145. package/dist/server/out/projects/index.html +1 -1
  146. package/dist/server/out/projects/index.txt +31 -30
  147. package/dist/server/out/runs/__next.!KHdvcmtzcGFjZSk.runs.__PAGE__.txt +30 -30
  148. package/dist/server/out/runs/__next._full.txt +25 -25
  149. package/dist/server/out/runs/__next._tree.txt +1 -1
  150. package/dist/server/out/runs/index.html +1 -1
  151. package/dist/server/out/runs/index.txt +25 -25
  152. package/dist/server/out/schedules/__next.!KHdvcmtzcGFjZSk.schedules.__PAGE__.txt +29 -29
  153. package/dist/server/out/schedules/__next._full.txt +24 -24
  154. package/dist/server/out/schedules/__next._tree.txt +1 -1
  155. package/dist/server/out/schedules/index.html +1 -1
  156. package/dist/server/out/schedules/index.txt +24 -24
  157. package/dist/server/out/settings/__next.!KHdvcmtzcGFjZSk.settings.__PAGE__.txt +38 -37
  158. package/dist/server/out/settings/__next._full.txt +31 -30
  159. package/dist/server/out/settings/__next._tree.txt +1 -1
  160. package/dist/server/out/settings/index.html +1 -1
  161. package/dist/server/out/settings/index.txt +31 -30
  162. package/dist/server/out/setup/__next._full.txt +27 -26
  163. package/dist/server/out/setup/__next._tree.txt +1 -1
  164. package/dist/server/out/setup/__next.setup.__PAGE__.txt +30 -29
  165. package/dist/server/out/setup/index.html +1 -1
  166. package/dist/server/out/setup/index.txt +27 -26
  167. package/dist/server/out/studio/approve/__next._full.txt +30 -0
  168. package/dist/server/out/studio/approve/__next._tree.txt +5 -0
  169. package/dist/server/out/studio/approve/__next.studio.approve.__PAGE__.txt +37 -0
  170. package/dist/server/out/studio/approve/index.html +1 -0
  171. package/dist/server/out/studio/approve/index.txt +30 -0
  172. package/dist/server/out/tables/__next.!KHdvcmtzcGFjZSk.tables.__PAGE__.txt +35 -34
  173. package/dist/server/out/tables/__next._full.txt +28 -27
  174. package/dist/server/out/tables/__next._tree.txt +1 -1
  175. package/dist/server/out/tables/index.html +1 -1
  176. package/dist/server/out/tables/index.txt +28 -27
  177. package/dist/server/out/webhooks/__next.!KHdvcmtzcGFjZSk.webhooks.__PAGE__.txt +38 -37
  178. package/dist/server/out/webhooks/__next._full.txt +31 -30
  179. package/dist/server/out/webhooks/__next._tree.txt +1 -1
  180. package/dist/server/out/webhooks/index.html +1 -1
  181. package/dist/server/out/webhooks/index.txt +31 -30
  182. package/dist/server/out/workspaces/invite/__next._full.txt +28 -27
  183. package/dist/server/out/workspaces/invite/__next._tree.txt +1 -1
  184. package/dist/server/out/workspaces/invite/__next.workspaces.invite.__PAGE__.txt +31 -30
  185. package/dist/server/out/workspaces/invite/index.html +1 -1
  186. package/dist/server/out/workspaces/invite/index.txt +28 -27
  187. package/docs/browser-sessions.md +3 -3
  188. package/docs/npm-distribution.md +4 -4
  189. package/docs/studio.md +25 -0
  190. package/package.json +3 -1
  191. package/runtime/README.md +3 -3
  192. package/dist/server/out/_next/static/chunks/0ay0b1lpy734z.js +0 -1
  193. package/dist/server/out/_next/static/chunks/0e7s8ie0wlk66.js +0 -1
  194. package/dist/server/out/_next/static/chunks/0ey-6hb0za4r_.js +0 -1
  195. package/dist/server/out/_next/static/chunks/0r0572w1rwpcv.js +0 -1
  196. package/dist/server/out/_next/static/chunks/0rghk0nc6wr4-.js +0 -3
  197. package/dist/server/out/_next/static/chunks/0u_9k8f7709np.js +0 -1
  198. package/dist/server/out/_next/static/chunks/0w34iczo7r1v5.js +0 -1
  199. package/dist/server/out/_next/static/chunks/0zfiikazg0_ga.js +0 -1
  200. package/dist/server/out/_next/static/chunks/1c2xcwifk3vhh.js +0 -1
  201. package/dist/server/out/_next/static/chunks/1clfpekejl_sp.js +0 -1
  202. package/dist/server/out/_next/static/chunks/1dwr62uuyceq-.js +0 -1
  203. package/dist/server/out/_next/static/chunks/1fweh1ttncdlv.js +0 -1
  204. package/dist/server/out/_next/static/chunks/1iklteprcoims.js +0 -1
  205. package/dist/server/out/_next/static/chunks/1zieh-zxgxmcp.js +0 -1
  206. package/dist/server/out/_next/static/chunks/25q38gki_yyde.js +0 -3
  207. package/dist/server/out/_next/static/chunks/25qsan0t-_of0.js +0 -1
  208. package/dist/server/out/_next/static/chunks/26yareaaj1kyr.js +0 -1
  209. package/dist/server/out/_next/static/chunks/2bkkmnhngpacd.js +0 -1
  210. package/dist/server/out/_next/static/chunks/2e39uy7huhczu.js +0 -1
  211. package/dist/server/out/_next/static/chunks/2rp65hq6bmpxv.js +0 -1
  212. package/dist/server/out/_next/static/chunks/3_d6w25_b15kx.js +0 -1
  213. package/dist/server/out/_next/static/chunks/3d8gkwu9nszjk.js +0 -1
  214. package/dist/server/out/_next/static/chunks/3l-16g1y6k5rs.js +0 -1
  215. package/dist/server/out/_next/static/chunks/3obu_9-ka7u_h.js +0 -1
  216. package/dist/server/out/_next/static/chunks/3u7q5w03st-rs.js +0 -1
  217. /package/dist/server/out/_next/static/{USFNp_mjuU8VbaPftn8uI → EF7eiGRF-6pU64XbVOn6f}/_buildManifest.js +0 -0
  218. /package/dist/server/out/_next/static/{USFNp_mjuU8VbaPftn8uI → EF7eiGRF-6pU64XbVOn6f}/_clientMiddlewareManifest.js +0 -0
  219. /package/dist/server/out/_next/static/{USFNp_mjuU8VbaPftn8uI → EF7eiGRF-6pU64XbVOn6f}/_ssgManifest.js +0 -0
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,22016,(e,t,r)=>{"use strict";e.i(47167),Object.defineProperty(r,"__esModule",{value:!0});var n={default:function(){return x},useLinkStatus:function(){return b}};for(var a in n)Object.defineProperty(r,a,{enumerable:!0,get:n[a]});let s=e.r(90809),o=e.r(18050),i=s._(e.r(71645)),l=e.r(95057),u=e.r(8372),c=e.r(18581),f=e.r(18967),d=e.r(5550),p=e.r(88540),m=e.r(91949),h=e.r(73668),g=e.r(9396);function x(t){var r;let n,a,s,[x,b]=(0,i.useOptimistic)(m.IDLE_LINK_STATUS),j=(0,i.useRef)(null),{href:w,as:v,children:N,prefetch:S=null,passHref:C,replace:P,shallow:_,scroll:k,onClick:E,onMouseEnter:T,onTouchStart:O,legacyBehavior:L=!1,onNavigate:U,transitionTypes:R,ref:A,unstable_dynamicOnHover:M,...$}=t;n=N,L&&("string"==typeof n||"number"==typeof n)&&(n=(0,o.jsx)("a",{children:n}));let I=i.default.useContext(u.AppRouterContext),B=!1!==S,F=!1===S?"none":!0===S?"full":"auto",D="none"!==F?"auto"===F?g.FetchStrategy.PPR:g.FetchStrategy.Full:g.FetchStrategy.PPR,q="string"==typeof(r=v||w)?r:(0,l.formatUrl)(r);if(L){if(n?.$$typeof===Symbol.for("react.lazy"))throw Error("`<Link legacyBehavior>` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's `<a>` tag.");a=i.default.Children.only(n)}let K=L?a&&"object"==typeof a&&a.ref:A,z,W=i.default.useCallback(e=>(null!==I&&(j.current=(0,m.mountLinkInstance)(e,q,I,D,B,b,z)),()=>{j.current&&((0,m.unmountLinkForCurrentNavigation)(j.current),j.current=null),(0,m.unmountPrefetchableInstance)(e)}),[B,q,I,D,b,z]),V={ref:(0,c.useMergedRef)(W,K),onClick(t){L||"function"!=typeof E||E(t),L&&a.props&&"function"==typeof a.props.onClick&&a.props.onClick(t),!I||t.defaultPrevented||function(t,r,n,a,s,o,i,l="none"){if("u">typeof window){let u,{nodeName:c}=t.currentTarget;if("A"===c.toUpperCase()&&((u=t.currentTarget.getAttribute("target"))&&"_self"!==u||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.nativeEvent&&2===t.nativeEvent.which)||t.currentTarget.hasAttribute("download"))return;if(!(0,h.isLocalURL)(r)){a&&(t.preventDefault(),location.replace(r));return}if(t.preventDefault(),o){let e=!1;if(o({preventDefault:()=>{e=!0}}),e)return}let{navigate:f}=e.r(32916);f(r,a?"replace":"push",!1===s?p.ScrollBehavior.NoScroll:p.ScrollBehavior.Default,n.current,i,l)}}(t,q,j,P,k,U,R,F)},onMouseEnter(e){L||"function"!=typeof T||T(e),L&&a.props&&"function"==typeof a.props.onMouseEnter&&a.props.onMouseEnter(e),I&&B&&(0,m.onNavigationIntent)(e.currentTarget,!0===M)},onTouchStart:function(e){L||"function"!=typeof O||O(e),L&&a.props&&"function"==typeof a.props.onTouchStart&&a.props.onTouchStart(e),I&&B&&(0,m.onNavigationIntent)(e.currentTarget,!0===M)}};return(0,f.isAbsoluteUrl)(q)?V.href=q:L&&!C&&("a"!==a.type||"href"in a.props)||(V.href=(0,d.addBasePath)(q)),s=L?i.default.cloneElement(a,V):(0,o.jsx)("a",{...$,...V,children:n}),(0,o.jsx)(y.Provider,{value:x,children:s})}let y=(0,i.createContext)(m.IDLE_LINK_STATUS),b=()=>(0,i.useContext)(y);("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},18581,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"useMergedRef",{enumerable:!0,get:function(){return a}});let n=e.r(71645);function a(e,t){let r=(0,n.useRef)(null),a=(0,n.useRef)(null);return(0,n.useCallback)(n=>{if(null===n){let e=r.current;e&&(r.current=null,e());let t=a.current;t&&(a.current=null,t())}else e&&(r.current=s(e,n)),t&&(a.current=s(t,n))},[e,t])}function s(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let r=e(t);return"function"==typeof r?r:()=>e(null)}}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},95057,(e,t,r)=>{"use strict";e.i(47167),Object.defineProperty(r,"__esModule",{value:!0});var n={formatUrl:function(){return i},formatWithValidation:function(){return u},urlObjectKeys:function(){return l}};for(var a in n)Object.defineProperty(r,a,{enumerable:!0,get:n[a]});let s=e.r(90809)._(e.r(98183)),o=/https?|ftp|gopher|file/;function i(e){let{auth:t,hostname:r}=e,n=e.protocol||"",a=e.pathname||"",i=e.hash||"",l=e.query||"",u=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?u=t+e.host:r&&(u=t+(~r.indexOf(":")?`[${r}]`:r),e.port&&(u+=":"+e.port)),l&&"object"==typeof l&&(l=String(s.urlQueryToSearchParams(l)));let c=e.search||l&&`?${l}`||"";return n&&!n.endsWith(":")&&(n+=":"),e.slashes||(!n||o.test(n))&&!1!==u?(u="//"+(u||""),a&&"/"!==a[0]&&(a="/"+a)):u||(u=""),i&&"#"!==i[0]&&(i="#"+i),c&&"?"!==c[0]&&(c="?"+c),a=a.replace(/[?#]/g,encodeURIComponent),c=c.replace("#","%23"),`${n}${u}${a}${c}${i}`}let l=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function u(e){return i(e)}},73668,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"isLocalURL",{enumerable:!0,get:function(){return s}});let n=e.r(18967),a=e.r(52817);function s(e){if(!(0,n.isAbsoluteUrl)(e))return!0;try{let t=(0,n.getLocationOrigin)(),r=new URL(e,t);return r.origin===t&&(0,a.hasBasePath)(r.pathname)}catch(e){return!1}}},18967,(e,t,r)=>{"use strict";e.i(47167),Object.defineProperty(r,"__esModule",{value:!0});var n={DecodeError:function(){return x},MiddlewareNotFoundError:function(){return w},MissingStaticPage:function(){return j},NormalizeError:function(){return y},PageNotFoundError:function(){return b},SP:function(){return h},ST:function(){return g},WEB_VITALS:function(){return s},execOnce:function(){return o},getDisplayName:function(){return f},getLocationOrigin:function(){return u},getURL:function(){return c},isAbsoluteUrl:function(){return l},isResSent:function(){return d},loadGetInitialProps:function(){return m},normalizeRepeatedSlashes:function(){return p},stringifyError:function(){return v}};for(var a in n)Object.defineProperty(r,a,{enumerable:!0,get:n[a]});let s=["CLS","FCP","INP","LCP","TTFB"];function o(e){let t,r=!1;return(...n)=>(r||(r=!0,t=e(...n)),t)}let i=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,l=e=>{let t=e.charCodeAt(0);return!!(t>=65&&t<=90||t>=97&&t<=122)&&i.test(e)};function u(){let{protocol:e,hostname:t,port:r}=window.location;return`${e}//${t}${r?":"+r:""}`}function c(){let{href:e}=window.location,t=u();return e.substring(t.length)}function f(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function d(e){return e.finished||e.headersSent}function p(e){let t=e.split("?");return t[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(t[1]?`?${t.slice(1).join("?")}`:"")}async function m(e,t){let r=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await m(t.Component,t.ctx)}:{};let n=await e.getInitialProps(t);if(r&&d(r))return n;if(!n)throw Error(`"${f(e)}.getInitialProps()" should resolve to an object. But found "${n}" instead.`);return n}let h="u">typeof performance,g=h&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class x extends Error{}class y extends Error{}class b extends Error{constructor(e){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message=`Cannot find module for page: ${e}`}}class j extends Error{constructor(e,t){super(),this.message=`Failed to load static file for page: ${e} ${t}`}}class w extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function v(e){return JSON.stringify({message:e.message,stack:e.stack})}},70307,e=>{"use strict";var t=e.i(18050),r=e.i(22016),n=e.i(71645),a=e.i(73656),s=e.i(95813),o=e.i(15448),i=e.i(19455),l=e.i(93479),u=e.i(18879);e.s(["default",0,function(){let[e,c]=(0,n.useState)(),[f,d]=(0,n.useState)(""),[p,m]=(0,n.useState)(!1),[h,g]=(0,n.useState)(!1),[x,y]=(0,n.useState)(0);return(0,n.useEffect)(()=>{let e=new AbortController;return a.U.auth.setupStatus.query(void 0,{signal:e.signal}).then(t=>{e.signal.aborted||c(t)}).catch(t=>{e.signal.aborted||d((0,s.f)(t))}),()=>{e.abort()}},[x]),(0,t.jsxs)(o.f,{title:"Set up your workspace",description:"Create your local administrator and first project. Configure a runner and connect your external client after signing in.",children:[h&&(0,t.jsxs)("div",{role:"status",children:[(0,t.jsx)("p",{children:"Your workspace is ready. Sign in to get started."}),(0,t.jsx)(i.f,{asChild:!0,children:(0,t.jsx)(r.default,{href:"/accounts/login/",children:"Sign in"})})]}),!h&&e?.setup_required===!1&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{children:"This server is already set up."}),(0,t.jsx)(i.f,{asChild:!0,children:(0,t.jsx)(r.default,{href:"/accounts/login/",children:"Sign in"})})]}),!h&&e?.setup_required&&(0,t.jsx)("form",{className:"space-y-4",onSubmit:t=>{t.preventDefault();let r=new FormData(t.currentTarget);m(!0),d(""),(async()=>{try{let t=(0,u.f)(r,"password1");if(t!==(0,u.f)(r,"password2"))throw Error("The passwords do not match.");await a.U.auth.setup.mutate({domain:e.hostname,workspace_name:(0,u.f)(r,"workspace_name"),username:(0,u.f)(r,"username"),email:(0,u.f)(r,"email"),password1:t,password2:(0,u.f)(r,"password2"),project_name:(0,u.f)(r,"project_name")}),g(!0)}catch(e){d((0,s.f)(e))}finally{m(!1)}})()},children:(0,t.jsxs)("fieldset",{disabled:p,className:"space-y-4 border-0 p-0",children:[(0,t.jsxs)("label",{className:"block text-sm font-medium",children:["Workspace name",(0,t.jsx)(l.f,{name:"workspace_name",autoComplete:"organization",required:!0,maxLength:100})]}),(0,t.jsxs)("label",{className:"block text-sm font-medium",children:["Username",(0,t.jsx)(l.f,{name:"username",autoComplete:"username",required:!0,maxLength:150})]}),(0,t.jsxs)("label",{className:"block text-sm font-medium",children:["Email",(0,t.jsx)(l.f,{name:"email",type:"email",autoComplete:"email",required:!0})]}),(0,t.jsx)("p",{className:"small",children:"Use this email to sign in. No email verification is needed."}),(0,t.jsxs)("label",{className:"block text-sm font-medium",children:["Password",(0,t.jsx)(l.f,{name:"password1",type:"password",autoComplete:"new-password",required:!0})]}),(0,t.jsxs)("label",{className:"block text-sm font-medium",children:["Confirm password",(0,t.jsx)(l.f,{name:"password2",type:"password",autoComplete:"new-password",required:!0})]}),(0,t.jsxs)("label",{className:"block text-sm font-medium",children:["First project name",(0,t.jsx)(l.f,{name:"project_name",defaultValue:"My project",maxLength:100})]}),(0,t.jsx)(i.f,{type:"submit",children:p?"Creating workspace…":"Create workspace"})]})}),!h&&!e&&!f&&(0,t.jsx)("p",{role:"status",children:"Checking this installation…"}),f&&(0,t.jsxs)("div",{role:"alert",children:[(0,t.jsx)("p",{className:"error",children:f}),!e&&(0,t.jsx)(i.f,{variant:"outline",onClick:()=>{d(""),y(e=>e+1)},children:"Try again"})]})]})}])},15448,e=>{"use strict";var t=e.i(18050),r=e.i(22016),n=e.i(2716);e.s(["f",0,function({title:e,description:a,children:s,showAccountNavigation:o=!1}){return(0,t.jsxs)("div",{className:"min-h-screen",children:[(0,t.jsxs)("header",{className:"flex items-center justify-between border-b border-slate-200 bg-white px-6 py-4 sm:px-10",children:[(0,t.jsxs)(r.default,{href:"/",className:"flex items-center gap-2 text-lg font-semibold text-slate-900",children:[(0,t.jsx)(n.f,{className:"h-9 w-9"}),"OrgSDK"]}),(0,t.jsx)(r.default,{href:"/",className:"text-sm",children:"Back to app"})]}),(0,t.jsxs)("main",{className:"mx-auto w-full max-w-xl px-4 py-10 sm:py-16",children:[o&&(0,t.jsxs)("nav",{"aria-label":"Account",className:"mb-6 flex flex-wrap gap-4 text-sm",children:[(0,t.jsx)(r.default,{href:"/accounts/email/",children:"Account"}),(0,t.jsx)(r.default,{href:"/accounts/password/change/",children:"Password"}),(0,t.jsx)(r.default,{href:"/accounts/2fa/",children:"Two-factor authentication"}),(0,t.jsx)(r.default,{href:"/accounts/logout/",children:"Sign out"})]}),(0,t.jsxs)("section",{className:"panel",children:[(0,t.jsx)("h1",{className:"!text-2xl",children:e}),a&&(0,t.jsx)("p",{className:"mb-6 text-sm",children:a}),s]})]})]})}])},93479,e=>{"use strict";var t=e.i(18050),r=e.i(71645),n=e.i(39689);let a=r.forwardRef(({className:e,type:r,...a},s)=>(0,t.jsx)("input",{type:r,className:(0,n.f)("flex h-9 w-full rounded-md border border-input bg-background px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:s,...a}));a.displayName="Input",e.s(["f",0,a])},2716,e=>{"use strict";var t=e.i(18050);e.s(["f",0,function({className:e,...r}){return(0,t.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 64 64",fill:"none","aria-hidden":"true",className:e,...r,children:[(0,t.jsx)("circle",{cx:"32",cy:"32",r:"19",stroke:"#4f46e5",strokeWidth:"12"}),(0,t.jsx)("circle",{cx:"50",cy:"14",r:"6",fill:"#8b5cf6"})]})}])},18879,e=>{"use strict";e.s(["f",0,function(e,t){let r=e.get(t);return"string"==typeof r?r:""}])}]);
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,51757,e=>{"use strict";var t=e.i(56420);let a={name:"circle-check",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 9-5.5 5.5L8 12",key:"xofnsj"}]],aliases:["check-circle-2"]};a.node;let i=(0,t.f)(a);e.s(["f",0,i],51757)},13581,29487,e=>{"use strict";var t=e.i(71645),a=e.i(95813);e.s(["f",0,function(e,i=0){let[s,l]=(0,t.useState)(),[n,r]=(0,t.useState)(""),[o,d]=(0,t.useState)(!0),c=(0,t.useRef)(void 0),u=(0,t.useRef)(!1),h=(0,t.useCallback)(async()=>{c.current?.abort();let t=new AbortController;c.current=t;try{let a=await e(t.signal);if(t.signal.aborted||!u.current)return;l(a),r("")}catch(e){!t.signal.aborted&&u.current&&r((0,a.f)(e))}finally{!t.signal.aborted&&u.current&&d(!1)}},[e]);return(0,t.useEffect)(()=>{u.current=!0,queueMicrotask(()=>{u.current&&h()});let e=i>0?setInterval(()=>{h()},i):void 0;return()=>{u.current=!1,c.current?.abort(),clearInterval(e)}},[h,i]),{data:s,error:n,isLoading:o,refresh:h}}],13581);var i=e.i(18050),s=e.i(19455);e.s(["f",0,function({isLoading:e,error:t,refresh:a}){return(0,i.jsxs)(i.Fragment,{children:[e?(0,i.jsx)("p",{role:"status",children:"Loading workspace data…"}):void 0,t?(0,i.jsxs)("div",{className:"error",role:"alert",children:[(0,i.jsx)("p",{children:t}),(0,i.jsx)(s.f,{variant:"outline",onClick:()=>{a()},children:"Try again"})]}):void 0]})}],29487)},93479,e=>{"use strict";var t=e.i(18050),a=e.i(71645),i=e.i(39689);let s=a.forwardRef(({className:e,type:a,...s},l)=>(0,t.jsx)("input",{type:a,className:(0,i.f)("flex h-9 w-full rounded-md border border-input bg-background px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:l,...s}));s.displayName="Input",e.s(["f",0,s])},10505,79432,e=>{"use strict";var t=e.i(18050),a=e.i(56420);let i={name:"activity",size:24,node:[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]};i.node;let s=(0,a.f)(i);e.s(["f",0,s],79432);var l=e.i(51757);let n={name:"clock-3",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6h4",key:"135r8i"}]]};n.node;let r=(0,a.f)(n),o={name:"shield-exclamation-point",size:24,node:[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]],aliases:["shield-alert"]};o.node;let d=(0,a.f)(o),c={name:"circle-x",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],aliases:["x-circle"]};c.node;let u=(0,a.f)(c);function h(e){return({chat:"Chat task",code:"Code execution",session:"Execution session",action:"Action run",validate:"Code validation",test:"Action tests"})[e]??e.replaceAll("_"," ")}e.s(["k",0,function({status:e}){let a={succeeded:l.f,waiting_approval:d,running:s,queued:r,failed:u,cancelled:u,interrupted:u}[e]??r;return(0,t.jsxs)("span",{className:`run-status status-${e}`,children:[(0,t.jsx)(a,{size:13,"aria-hidden":"true"}),e.replaceAll("_"," ")]})},"B",0,["queued","running","waiting_approval"],"A",0,function(e){return void 0===e?"":"string"==typeof e?e:JSON.stringify(e,void 0,2)},"N",0,function(e,t){let a=t.find(t=>t.id===e.project)?.name??"Project";return"chat"===e.operation?`${a} \xb7 ${(function(e,t){if(null!==e&&"object"==typeof e&&Object.hasOwn(e,t)){let a=Reflect.get(e,t);if("string"==typeof a)return a}return""})(e.inputs,"message").slice(0,70)}`:`${a} \xb7 ${h(e.operation)}`},"T",0,h],10505)},57743,e=>{"use strict";var t=e.i(18050),a=e.i(71645),i=e.i(73656),s=e.i(95813),l=e.i(13581),n=e.i(19455),r=e.i(93479),o=e.i(94757),d=e.i(87309),c=e.i(29487),u=e.i(10505);let h={key:"name",type:"text",required:!0};function v({table:e,onSaved:l}){let d=(0,a.useId)(),{setDirty:c}=(0,o.useWorkspace)(),[u,x]=(0,a.useState)(e?.name??""),[m,f]=(0,a.useState)(e?.columns??[h]),[p,b]=(0,a.useState)(!1),[y,j]=(0,a.useState)(""),[w,k]=(0,a.useState)("");function g(e,t){f(a=>a.map((a,i)=>i===e?{...a,...t}:a))}return(0,t.jsxs)("form",{onChange:()=>{c(!0)},onSubmit:t=>{t.preventDefault(),b(!0),j(""),k(""),(async()=>{try{let t={name:u,columns:m};e?await i.U.tables.update.mutate({id:e.id,...t,revision:e.revision}):(await i.U.tables.create.mutate(t),x(""),f([h])),c(!1),await l(),k("Table saved.")}catch(e){j((0,s.f)(e))}finally{b(!1)}})()},children:[(0,t.jsxs)("fieldset",{disabled:p,className:"space-y-3",children:[(0,t.jsx)("legend",{className:"mb-3 font-semibold",children:e?"Edit table definition":"Create a table"}),(0,t.jsxs)("label",{children:["Table name",(0,t.jsx)(r.f,{required:!0,maxLength:120,value:u,onChange:e=>{x(e.target.value)}})]}),(0,t.jsx)("p",{className:"small",children:"Column keys use lowercase letters, digits and underscores, starting with a letter. Existing rows must remain valid when a definition changes."}),m.map((e,a)=>(0,t.jsxs)("div",{className:"table-column-fields",children:[(0,t.jsxs)("label",{className:"table-column-key",children:["Column ",a+1," key",(0,t.jsx)(r.f,{required:!0,pattern:"[a-z][a-z0-9_]{0,47}",maxLength:48,value:e.key,onChange:e=>{g(a,{key:e.target.value})}})]}),(0,t.jsxs)("div",{className:"table-column-type",children:[(0,t.jsx)("label",{htmlFor:`${d}-type-${String(a)}`,children:"Type"}),(0,t.jsxs)("select",{id:`${d}-type-${String(a)}`,value:e.type,onChange:e=>{let t=e.target.value;["text","number","boolean","date"].includes(t)&&g(a,{type:t})},children:[(0,t.jsx)("option",{value:"text",children:"Text"}),(0,t.jsx)("option",{value:"number",children:"Number"}),(0,t.jsx)("option",{value:"boolean",children:"Boolean"}),(0,t.jsx)("option",{value:"date",children:"Date"})]})]}),(0,t.jsxs)("label",{className:"check",children:[(0,t.jsx)("input",{type:"checkbox",checked:e.required,onChange:e=>{g(a,{required:e.target.checked})}}),"Required"]}),(0,t.jsxs)(n.f,{type:"button",variant:"outline",disabled:1===m.length,onClick:()=>{c(!0),f(e=>e.filter((e,t)=>t!==a))},children:["Remove column ",a+1]})]},a)),(0,t.jsxs)("div",{className:"row",children:[(0,t.jsx)(n.f,{type:"button",variant:"outline",disabled:m.length>=50,onClick:()=>{c(!0),f(e=>[...e,{key:"",type:"text",required:!1}])},children:"Add column"}),(0,t.jsx)(n.f,{type:"submit",children:p?"Saving…":"Save table"})]})]}),y?(0,t.jsx)("p",{className:"error",role:"alert",children:y}):void 0,w?(0,t.jsx)("p",{className:"notice",role:"status",children:w}):void 0]})}function x({table:e,row:l,onSaved:d,onCancel:c}){let h=(0,a.useId)(),{setDirty:v}=(0,o.useWorkspace)(),[m,f]=(0,a.useState)(()=>Object.fromEntries(e.columns.map(e=>[e.key,l?.values[e.key]===void 0||null===l.values[e.key]?"":(0,u.A)(l.values[e.key])]))),[p,b]=(0,a.useState)(!1),[y,j]=(0,a.useState)("");return(0,t.jsxs)("form",{className:"panel",onChange:()=>{v(!0)},onSubmit:t=>{t.preventDefault(),b(!0),j(""),(async()=>{try{let t=Object.fromEntries(e.columns.map(e=>{let t=m[e.key]??"";return""!==t||e.required?"boolean"===e.type?[e.key,"true"===t]:"number"===e.type?[e.key,Number(t)]:[e.key,t]:[e.key,null]})),a={table_revision:e.revision,values:t};l?await i.U.tables.updateRow.mutate({id:e.id,rowId:l.id,...a,revision:l.revision}):await i.U.tables.createRow.mutate({id:e.id,...a}),v(!1),await d()}catch(e){j((0,s.f)(e))}finally{b(!1)}})()},children:[(0,t.jsx)("h3",{children:l?"Edit row":"Add row"}),(0,t.jsxs)("fieldset",{disabled:p,className:"space-y-3",children:[e.columns.map(e=>(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{htmlFor:`${h}-${e.key}`,children:[e.key,e.required?" (required)":" (optional)"]}),"boolean"===e.type?(0,t.jsxs)("select",{id:`${h}-${e.key}`,required:e.required,value:m[e.key]??"",onChange:t=>{f(a=>({...a,[e.key]:t.target.value}))},children:[(0,t.jsx)("option",{value:"",children:"No value"}),(0,t.jsx)("option",{value:"true",children:"True"}),(0,t.jsx)("option",{value:"false",children:"False"})]}):(0,t.jsx)(r.f,{id:`${h}-${e.key}`,type:"text"===e.type?"text":e.type,required:e.required,step:"number"===e.type?"any":void 0,maxLength:"text"===e.type?1e4:void 0,value:m[e.key]??"",onChange:t=>{f(a=>({...a,[e.key]:t.target.value}))}})]},e.key)),(0,t.jsxs)("div",{className:"row",children:[(0,t.jsx)(n.f,{type:"submit",children:p?"Saving…":"Save row"}),(0,t.jsx)(n.f,{type:"button",variant:"outline",onClick:c,children:"Cancel"})]})]}),y?(0,t.jsxs)("p",{className:"error",role:"alert",children:[y," After a conflict, cancel this edit, reload rows and definition, then reopen the row to reconcile your changes."]}):void 0]})}function m({table:e,refreshTables:r}){let{canManage:h,isDirty:f,setDirty:p}=(0,o.useWorkspace)(),b=(0,d.h)(),[y,j]=(0,a.useState)(1),[w,k]=(0,a.useState)(),[g,N]=(0,a.useState)(!1),[C,S]=(0,a.useState)(""),[q,A]=(0,a.useState)(!1),$=(0,a.useCallback)(async t=>{let a=await i.U.tables.listRows.query({id:e.id},{signal:t});return{...a,results:a.results.slice((y-1)*50,50*y),next:a.count>50*y}},[e.id,y]),T=(0,l.f)($);async function R(t){if(await b({title:"Delete this row?",description:"The saved values in this row will be permanently deleted.",actionLabel:"Delete row"})){A(!0),S("");try{await i.U.tables.deleteRow.mutate({id:e.id,rowId:t.id,revision:t.revision}),T.data?.results.length===1&&y>1?j(y-1):await T.refresh()}catch(e){S((0,s.f)(e))}finally{A(!1)}}}return(0,t.jsxs)("section",{className:"panel",children:[(0,t.jsxs)("div",{className:"panel-title",children:[(0,t.jsx)("h2",{children:e.name}),(0,t.jsx)(n.f,{disabled:q||void 0!==w||g,onClick:()=>{k("new")},children:"Add row"})]}),(0,t.jsx)(c.f,{...T}),(0,t.jsxs)("div",{className:"row",children:[(0,t.jsx)(n.f,{variant:"outline",disabled:q,onClick:()=>{(async()=>{(!f||await b())&&(p(!1),k(void 0),N(!1),await T.refresh(),await r())})()},children:"Reload rows and definition"}),(0,t.jsxs)("span",{children:[T.data?.count??0," rows · Page ",y]})]}),T.data?.results.length===0?(0,t.jsx)("p",{children:"No rows on this page. Add a row to start collecting data."}):void 0,(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsxs)("table",{className:"w-full text-left",children:[(0,t.jsxs)("caption",{className:"sr-only",children:["Rows in ",e.name]}),(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{children:[e.columns.map(e=>(0,t.jsxs)("th",{className:"p-2",scope:"col",children:[e.key," ",(0,t.jsxs)("small",{children:["(",e.type,")"]})]},e.key)),(0,t.jsx)("th",{scope:"col",children:"Actions"})]})}),(0,t.jsx)("tbody",{children:T.data?.results.map(a=>(0,t.jsxs)("tr",{className:"border-t",children:[e.columns.map(e=>(0,t.jsx)("td",{className:"max-w-72 break-words p-2",children:void 0===a.values[e.key]||null===a.values[e.key]?"—":(0,u.A)(a.values[e.key])},e.key)),(0,t.jsx)("td",{children:(0,t.jsxs)("div",{className:"row",children:[(0,t.jsx)(n.f,{variant:"outline",disabled:q||void 0!==w||g,onClick:()=>{k(a)},children:"Edit row"}),(0,t.jsx)(n.f,{variant:"destructive",disabled:q,onClick:()=>{R(a)},children:"Delete row"})]})})]},a.id))})]})}),(0,t.jsxs)("div",{className:"row",children:[(0,t.jsx)(n.f,{variant:"outline",disabled:1===y||void 0!==w,onClick:()=>{j(y-1)},children:"Previous rows"}),(0,t.jsx)(n.f,{variant:"outline",disabled:!T.data?.next||void 0!==w,onClick:()=>{j(y+1)},children:"Next rows"})]}),void 0===w?void 0:(0,t.jsx)(x,{table:e,..."new"===w?{}:{row:w},onCancel:()=>{(async()=>{(!f||await b())&&(p(!1),k(void 0))})()},onSaved:async()=>{k(void 0),await T.refresh()}},"new"===w?"new":w.id),C?(0,t.jsx)("p",{className:"error",role:"alert",children:C}):void 0,h?(0,t.jsxs)("div",{className:"mt-5",children:[(0,t.jsx)(n.f,{variant:"outline",disabled:void 0!==w,onClick:()=>{(async()=>{(!g||!f||await b())&&(p(!1),N(!g))})()},children:g?"Close definition editor":"Edit table definition"}),g?(0,t.jsx)(v,{table:e,onSaved:r}):void 0]}):(0,t.jsx)("p",{className:"small",children:"Owners and admins manage table definitions. Members can edit rows."})]})}e.s(["Tables",0,function(){let{canManage:e,isDirty:r,setDirty:u}=(0,o.useWorkspace)();(0,a.useEffect)(()=>()=>{u(!1)},[u]);let h=(0,d.h)(),[x,f]=(0,a.useState)(1),[p,b]=(0,a.useState)(""),[y,j]=(0,a.useState)(""),[w,k]=(0,a.useState)(!1),g=(0,a.useCallback)(async e=>{let t=await i.U.tables.list.query(void 0,{signal:e});return{...t,results:t.results.slice((x-1)*50,50*x),next:t.count>50*x}},[x]),N=(0,l.f)(g),C=N.data?.results.find(e=>e.id===p);async function S(){if(C&&await h({title:`Delete ${C.name}?`,description:"This permanently deletes the table definition and every row in this table.",actionLabel:"Delete table"})){k(!0),j("");try{await i.U.tables.delete.mutate({id:C.id,revision:C.revision}),u(!1),b(""),N.data?.results.length===1&&x>1?f(x-1):await N.refresh()}catch(e){j((0,s.f)(e))}finally{k(!1)}}}return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("section",{className:"panel",children:[(0,t.jsx)("h2",{children:"Workspace tables"}),(0,t.jsx)("p",{children:"Store shared records in tables with text, number, boolean and date columns."}),(0,t.jsx)(c.f,{...N}),N.isLoading||N.data?.count!==0?void 0:(0,t.jsx)("p",{children:"No tables yet. A workspace owner or admin can create your first table below."}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{htmlFor:"workspace-table",children:"Table"}),(0,t.jsxs)("select",{id:"workspace-table",value:C?.id??"",disabled:w,onChange:e=>{let t=e.target.value;(async()=>{(!r||await h())&&(u(!1),b(t))})()},children:[(0,t.jsx)("option",{value:"",children:"Choose a table"}),N.data?.results.map(e=>(0,t.jsx)("option",{value:e.id,children:e.name},e.id))]})]}),(0,t.jsxs)("div",{className:"row",children:[(0,t.jsx)(n.f,{variant:"outline",disabled:1===x||w||r,onClick:()=>{b(""),f(x-1)},children:"Previous tables"}),(0,t.jsxs)("span",{children:["Page ",x]}),(0,t.jsx)(n.f,{variant:"outline",disabled:!N.data?.next||w||r,onClick:()=>{b(""),f(x+1)},children:"Next tables"}),e&&C?(0,t.jsx)(n.f,{variant:"destructive",disabled:w,onClick:()=>{S()},children:"Delete table"}):void 0]}),y?(0,t.jsx)("p",{className:"error",role:"alert",children:y}):void 0]}),C?(0,t.jsx)(m,{table:C,refreshTables:N.refresh},`${C.id}:${String(C.revision)}`):void 0,e&&!C?(0,t.jsx)("section",{className:"panel",children:(0,t.jsx)(v,{onSaved:N.refresh})}):void 0]})}])}]);
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,22016,(e,t,r)=>{"use strict";e.i(47167),Object.defineProperty(r,"__esModule",{value:!0});var n={default:function(){return y},useLinkStatus:function(){return b}};for(var a in n)Object.defineProperty(r,a,{enumerable:!0,get:n[a]});let o=e.r(90809),s=e.r(18050),i=o._(e.r(71645)),u=e.r(95057),l=e.r(8372),c=e.r(18581),d=e.r(18967),f=e.r(5550),p=e.r(88540),h=e.r(91949),m=e.r(73668),g=e.r(9396);function y(t){var r;let n,a,o,[y,b]=(0,i.useOptimistic)(h.IDLE_LINK_STATUS),w=(0,i.useRef)(null),{href:j,as:v,children:S,prefetch:C=null,passHref:N,replace:P,shallow:_,scroll:E,onClick:T,onMouseEnter:U,onTouchStart:R,legacyBehavior:L=!1,onNavigate:O,transitionTypes:$,ref:A,unstable_dynamicOnHover:I,...k}=t;n=S,L&&("string"==typeof n||"number"==typeof n)&&(n=(0,s.jsx)("a",{children:n}));let M=i.default.useContext(l.AppRouterContext),F=!1!==C,B=!1===C?"none":!0===C?"full":"auto",D="none"!==B?"auto"===B?g.FetchStrategy.PPR:g.FetchStrategy.Full:g.FetchStrategy.PPR,K="string"==typeof(r=v||j)?r:(0,u.formatUrl)(r);if(L){if(n?.$$typeof===Symbol.for("react.lazy"))throw Error("`<Link legacyBehavior>` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's `<a>` tag.");a=i.default.Children.only(n)}let q=L?a&&"object"==typeof a&&a.ref:A,z,W=i.default.useCallback(e=>(null!==M&&(w.current=(0,h.mountLinkInstance)(e,K,M,D,F,b,z)),()=>{w.current&&((0,h.unmountLinkForCurrentNavigation)(w.current),w.current=null),(0,h.unmountPrefetchableInstance)(e)}),[F,K,M,D,b,z]),V={ref:(0,c.useMergedRef)(W,q),onClick(t){L||"function"!=typeof T||T(t),L&&a.props&&"function"==typeof a.props.onClick&&a.props.onClick(t),!M||t.defaultPrevented||function(t,r,n,a,o,s,i,u="none"){if("u">typeof window){let l,{nodeName:c}=t.currentTarget;if("A"===c.toUpperCase()&&((l=t.currentTarget.getAttribute("target"))&&"_self"!==l||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.nativeEvent&&2===t.nativeEvent.which)||t.currentTarget.hasAttribute("download"))return;if(!(0,m.isLocalURL)(r)){a&&(t.preventDefault(),location.replace(r));return}if(t.preventDefault(),s){let e=!1;if(s({preventDefault:()=>{e=!0}}),e)return}let{navigate:d}=e.r(32916);d(r,a?"replace":"push",!1===o?p.ScrollBehavior.NoScroll:p.ScrollBehavior.Default,n.current,i,u)}}(t,K,w,P,E,O,$,B)},onMouseEnter(e){L||"function"!=typeof U||U(e),L&&a.props&&"function"==typeof a.props.onMouseEnter&&a.props.onMouseEnter(e),M&&F&&(0,h.onNavigationIntent)(e.currentTarget,!0===I)},onTouchStart:function(e){L||"function"!=typeof R||R(e),L&&a.props&&"function"==typeof a.props.onTouchStart&&a.props.onTouchStart(e),M&&F&&(0,h.onNavigationIntent)(e.currentTarget,!0===I)}};return(0,d.isAbsoluteUrl)(K)?V.href=K:L&&!N&&("a"!==a.type||"href"in a.props)||(V.href=(0,f.addBasePath)(K)),o=L?i.default.cloneElement(a,V):(0,s.jsx)("a",{...k,...V,children:n}),(0,s.jsx)(x.Provider,{value:y,children:o})}let x=(0,i.createContext)(h.IDLE_LINK_STATUS),b=()=>(0,i.useContext)(x);("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},18581,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"useMergedRef",{enumerable:!0,get:function(){return a}});let n=e.r(71645);function a(e,t){let r=(0,n.useRef)(null),a=(0,n.useRef)(null);return(0,n.useCallback)(n=>{if(null===n){let e=r.current;e&&(r.current=null,e());let t=a.current;t&&(a.current=null,t())}else e&&(r.current=o(e,n)),t&&(a.current=o(t,n))},[e,t])}function o(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let r=e(t);return"function"==typeof r?r:()=>e(null)}}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},95057,(e,t,r)=>{"use strict";e.i(47167),Object.defineProperty(r,"__esModule",{value:!0});var n={formatUrl:function(){return i},formatWithValidation:function(){return l},urlObjectKeys:function(){return u}};for(var a in n)Object.defineProperty(r,a,{enumerable:!0,get:n[a]});let o=e.r(90809)._(e.r(98183)),s=/https?|ftp|gopher|file/;function i(e){let{auth:t,hostname:r}=e,n=e.protocol||"",a=e.pathname||"",i=e.hash||"",u=e.query||"",l=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?l=t+e.host:r&&(l=t+(~r.indexOf(":")?`[${r}]`:r),e.port&&(l+=":"+e.port)),u&&"object"==typeof u&&(u=String(o.urlQueryToSearchParams(u)));let c=e.search||u&&`?${u}`||"";return n&&!n.endsWith(":")&&(n+=":"),e.slashes||(!n||s.test(n))&&!1!==l?(l="//"+(l||""),a&&"/"!==a[0]&&(a="/"+a)):l||(l=""),i&&"#"!==i[0]&&(i="#"+i),c&&"?"!==c[0]&&(c="?"+c),a=a.replace(/[?#]/g,encodeURIComponent),c=c.replace("#","%23"),`${n}${l}${a}${c}${i}`}let u=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function l(e){return i(e)}},73668,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"isLocalURL",{enumerable:!0,get:function(){return o}});let n=e.r(18967),a=e.r(52817);function o(e){if(!(0,n.isAbsoluteUrl)(e))return!0;try{let t=(0,n.getLocationOrigin)(),r=new URL(e,t);return r.origin===t&&(0,a.hasBasePath)(r.pathname)}catch(e){return!1}}},18967,(e,t,r)=>{"use strict";e.i(47167),Object.defineProperty(r,"__esModule",{value:!0});var n={DecodeError:function(){return y},MiddlewareNotFoundError:function(){return j},MissingStaticPage:function(){return w},NormalizeError:function(){return x},PageNotFoundError:function(){return b},SP:function(){return m},ST:function(){return g},WEB_VITALS:function(){return o},execOnce:function(){return s},getDisplayName:function(){return d},getLocationOrigin:function(){return l},getURL:function(){return c},isAbsoluteUrl:function(){return u},isResSent:function(){return f},loadGetInitialProps:function(){return h},normalizeRepeatedSlashes:function(){return p},stringifyError:function(){return v}};for(var a in n)Object.defineProperty(r,a,{enumerable:!0,get:n[a]});let o=["CLS","FCP","INP","LCP","TTFB"];function s(e){let t,r=!1;return(...n)=>(r||(r=!0,t=e(...n)),t)}let i=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,u=e=>{let t=e.charCodeAt(0);return!!(t>=65&&t<=90||t>=97&&t<=122)&&i.test(e)};function l(){let{protocol:e,hostname:t,port:r}=window.location;return`${e}//${t}${r?":"+r:""}`}function c(){let{href:e}=window.location,t=l();return e.substring(t.length)}function d(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function f(e){return e.finished||e.headersSent}function p(e){let t=e.split("?");return t[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(t[1]?`?${t.slice(1).join("?")}`:"")}async function h(e,t){let r=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await h(t.Component,t.ctx)}:{};let n=await e.getInitialProps(t);if(r&&f(r))return n;if(!n)throw Error(`"${d(e)}.getInitialProps()" should resolve to an object. But found "${n}" instead.`);return n}let m="u">typeof performance,g=m&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class y extends Error{}class x extends Error{}class b extends Error{constructor(e){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message=`Cannot find module for page: ${e}`}}class w extends Error{constructor(e,t){super(),this.message=`Failed to load static file for page: ${e} ${t}`}}class j extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function v(e){return JSON.stringify({message:e.message,stack:e.stack})}},76046,e=>{"use strict";e.i(44362);var t=e.i(14778);e.s(["k",0,function(){location.assign(function(e){let t=new URLSearchParams(e).get("next");if(!t||!t.startsWith("/")||t.startsWith("//")||t.includes("\\"))return"/";for(let e of t)if((e.codePointAt(0)??0)<=32)return"/";let r=new URL(t,location.origin);return r.origin===location.origin?`${r.pathname}${r.search}${r.hash}`:"/"}(location.search))},"z",0,"Confirm your identity below, then retry your change.","$",0,function(e){return(0,t.f)(e)&&e.data?.code==="UNAUTHORIZED"},"y",0,function(){let e=`${location.pathname}${location.search}${location.hash}`;location.replace(`/accounts/login/?next=${encodeURIComponent(e)}`)},"u",0,function(e){return!e.is_authenticated&&e.flows.some(e=>"mfa_authenticate"===e.id)}])},86441,e=>{"use strict";var t=e.i(18050),r=e.i(22016),n=e.i(73656),a=e.i(71645),o=e.i(92229),s=e.i(18879),i=e.i(11105);function u(){return(0,t.jsxs)("details",{open:!0,className:"mt-6 border-t border-slate-200 pt-4",children:[(0,t.jsx)("summary",{className:"cursor-pointer text-sm font-medium",children:"Confirm your identity"}),(0,t.jsxs)("p",{className:"text-sm",children:["Session expired? ",(0,t.jsx)(r.default,{href:"/accounts/login/",children:"Sign in again"}),"."]}),(0,t.jsx)("p",{className:"text-sm",children:"If a security change asks you to confirm your identity, enter your password or an authenticator code, then retry the change."}),(0,t.jsx)(i.F,{submitLabel:"Confirm password",onSubmit:async e=>(await n.U.auth.reauthenticate.mutate({password:(0,s.f)(e,"password")}),"Identity confirmed. Retry your change."),children:(0,t.jsx)(i.j,{label:"Password",type:"password",name:"password",autoComplete:"current-password",required:!0})}),(0,t.jsx)("div",{className:"mt-5",children:(0,t.jsx)(i.F,{submitLabel:"Confirm code",onSubmit:async e=>(await n.U.auth.mfaReauthenticate.mutate({code:(0,s.f)(e,"code")}),"Identity confirmed. Retry your change."),children:(0,t.jsx)(i.j,{label:"Authenticator or recovery code",name:"code",autoComplete:"one-time-code",required:!0})})})]})}e.s(["f",0,function({children:e}){let[s,i]=(0,a.useState)(),[l,c]=(0,a.useState)(!1);(0,a.useEffect)(()=>{let e=new AbortController;return(0,n.m)(e.signal).then(t=>{e.signal.aborted||i(t)}).catch(()=>{e.signal.aborted||c(!0)}),()=>{e.abort()}},[]);let[d,f]=(0,a.useState)(!1);return l?(0,t.jsx)("p",{role:"alert",children:"Unable to load your account. Reload to try again."}):s?s.is_authenticated?(0,t.jsxs)(o.T,{value:()=>{f(!0)},children:[e,d&&(0,t.jsx)(u,{})]}):(0,t.jsxs)("p",{children:["Please ",(0,t.jsx)(r.default,{href:"/accounts/login/",children:"sign in"})," to manage your account."]}):(0,t.jsx)("p",{role:"status",children:"Loading your account…"})}],86441)},11105,92229,e=>{"use strict";var t=e.i(18050),r=e.i(71645),n=e.i(76046),a=e.i(95813);let o=(0,r.createContext)(void 0);function s(){let e=(0,r.useContext)(o);return(t,r)=>e&&(0,n.$)(t)?(e(),n.z):(0,a.f)(t,r)}e.s(["T",0,o,"G",0,s],92229);var i=e.i(19455),u=e.i(93479);e.s(["j",0,function({label:e,...r}){return(0,t.jsxs)("label",{children:[e,(0,t.jsx)(u.f,{...r})]})},"F",0,function({children:e,submitLabel:n,onSubmit:a}){let o=s(),[u,l]=(0,r.useState)(!1),[c,d]=(0,r.useState)(""),[f,p]=(0,r.useState)("");async function h(e){e.preventDefault();let t=new FormData(e.currentTarget);l(!0),d(""),p("");try{p(await a(t)??"")}catch(e){d(o(e,"Unable to save. Please try again."))}finally{l(!1)}}return(0,t.jsxs)("form",{onSubmit:e=>{h(e)},children:[(0,t.jsxs)("fieldset",{disabled:u,className:"min-w-0 border-0 p-0",children:[e,(0,t.jsx)(i.f,{type:"submit",disabled:u,children:u?"Please wait…":n})]}),c&&(0,t.jsx)("p",{role:"alert",className:"error mt-4",children:c}),f&&(0,t.jsx)("p",{role:"status",className:"notice mt-4",children:f})]})}],11105)},15448,e=>{"use strict";var t=e.i(18050),r=e.i(22016),n=e.i(2716);e.s(["f",0,function({title:e,description:a,children:o,showAccountNavigation:s=!1}){return(0,t.jsxs)("div",{className:"min-h-screen",children:[(0,t.jsxs)("header",{className:"flex items-center justify-between border-b border-slate-200 bg-white px-6 py-4 sm:px-10",children:[(0,t.jsxs)(r.default,{href:"/",className:"flex items-center gap-2 text-lg font-semibold text-slate-900",children:[(0,t.jsx)(n.f,{className:"h-9 w-9"}),"OrgSDK"]}),(0,t.jsx)(r.default,{href:"/",className:"text-sm",children:"Back to app"})]}),(0,t.jsxs)("main",{className:"mx-auto w-full max-w-xl px-4 py-10 sm:py-16",children:[s&&(0,t.jsxs)("nav",{"aria-label":"Account",className:"mb-6 flex flex-wrap gap-4 text-sm",children:[(0,t.jsx)(r.default,{href:"/accounts/email/",children:"Account"}),(0,t.jsx)(r.default,{href:"/accounts/password/change/",children:"Password"}),(0,t.jsx)(r.default,{href:"/accounts/2fa/",children:"Two-factor authentication"}),(0,t.jsx)(r.default,{href:"/accounts/logout/",children:"Sign out"})]}),(0,t.jsxs)("section",{className:"panel",children:[(0,t.jsx)("h1",{className:"!text-2xl",children:e}),a&&(0,t.jsx)("p",{className:"mb-6 text-sm",children:a}),o]})]})]})}])},86108,e=>{"use strict";var t=e.i(18050),r=e.i(71645),n=e.i(73656),a=e.i(95813),o=e.i(18879),s=e.i(15448),i=e.i(86441),u=e.i(11105);function l(){let[e,s]=(0,r.useState)(""),[i,l]=(0,r.useState)("");return(0,r.useEffect)(()=>{let e=!0;return n.U.auth.emails.query().then(t=>{e&&s(t.find(e=>e.primary)?.email??"")}).catch(t=>{e&&l((0,a.f)(t,"Unable to load email address."))}),()=>{e=!1}},[]),(0,t.jsxs)(t.Fragment,{children:[i&&(0,t.jsx)("p",{role:"alert",className:"error",children:i}),(0,t.jsx)(u.F,{submitLabel:"Save email address",onSubmit:async e=>(await n.U.auth.changeEmail.mutate({email:(0,o.f)(e,"email")}),s((0,o.f)(e,"email")),"Email address saved."),children:(0,t.jsx)(u.j,{label:"Email address",name:"email",type:"email",defaultValue:e,autoComplete:"email",required:!0},e)})]})}e.s(["ChangePassword",0,function(){return(0,t.jsx)(s.f,{title:"Change password",description:"Choose a strong password you do not use elsewhere.",showAccountNavigation:!0,children:(0,t.jsx)(i.f,{children:(0,t.jsxs)(u.F,{submitLabel:"Change password",onSubmit:async e=>{let t=(0,o.f)(e,"new_password");if(t!==(0,o.f)(e,"confirm_password"))throw Error("The new passwords do not match.");return await n.U.auth.changePassword.mutate({current_password:(0,o.f)(e,"current_password"),new_password:t}),"Your password has been changed."},children:[(0,t.jsx)(u.j,{label:"Current password",name:"current_password",type:"password",autoComplete:"current-password",required:!0}),(0,t.jsx)(u.j,{label:"New password",name:"new_password",type:"password",autoComplete:"new-password",required:!0}),(0,t.jsx)(u.j,{label:"Confirm new password",name:"confirm_password",type:"password",autoComplete:"new-password",required:!0})]})})})},"ManageAccount",0,function(){return(0,t.jsx)(s.f,{title:"Account settings",description:"Manage the email address you use to sign in.",showAccountNavigation:!0,children:(0,t.jsx)(i.f,{children:(0,t.jsx)(l,{})})})}])},93479,e=>{"use strict";var t=e.i(18050),r=e.i(71645),n=e.i(39689);let a=r.forwardRef(({className:e,type:r,...a},o)=>(0,t.jsx)("input",{type:r,className:(0,n.f)("flex h-9 w-full rounded-md border border-input bg-background px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:o,...a}));a.displayName="Input",e.s(["f",0,a])},2716,e=>{"use strict";var t=e.i(18050);e.s(["f",0,function({className:e,...r}){return(0,t.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 64 64",fill:"none","aria-hidden":"true",className:e,...r,children:[(0,t.jsx)("circle",{cx:"32",cy:"32",r:"19",stroke:"#4f46e5",strokeWidth:"12"}),(0,t.jsx)("circle",{cx:"50",cy:"14",r:"6",fill:"#8b5cf6"})]})}])},18879,e=>{"use strict";e.s(["f",0,function(e,t){let r=e.get(t);return"string"==typeof r?r:""}])}]);
@@ -1,3 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,5500,(e,t,n)=>{"use strict";e.i(47167),Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"Image",{enumerable:!0,get:function(){return x}});let r=e.r(55682),s=e.r(90809),a=e.r(18050),l=s._(e.r(71645)),i=r._(e.r(74080)),o=r._(e.r(25633)),c=e.r(8927),u=e.r(65856),d=e.r(49381),p=r._(e.r(1948)),f=e.r(18581);function h(e,t,n,r,s,a,l){let i=e?.src;e&&e["data-loaded-src"]!==i&&(e["data-loaded-src"]=i,("decode"in e?e.decode():Promise.resolve()).catch(()=>{}).then(()=>{if(e.parentElement&&e.isConnected){if("empty"!==t&&s(!0),n?.current){let t=new Event("load");Object.defineProperty(t,"target",{writable:!1,value:e});let r=!1,s=!1;n.current({...t,nativeEvent:t,currentTarget:e,target:e,isDefaultPrevented:()=>r,isPropagationStopped:()=>s,persist:()=>{},preventDefault:()=>{r=!0,t.preventDefault()},stopPropagation:()=>{s=!0,t.stopPropagation()}})}r?.current&&r.current(e)}}))}function g(e){return l.use?{fetchPriority:e}:{fetchpriority:e}}"u"<typeof window&&(globalThis.__NEXT_IMAGE_IMPORTED=!0);let m="u"<typeof window?l.useEffect:l.useLayoutEffect,b=(0,l.forwardRef)(({src:e,srcSet:t,sizes:n,height:r,width:s,decoding:i,className:o,style:c,fetchPriority:u,placeholder:d,loading:p,unoptimized:b,fill:j,onLoadRef:x,onLoadingCompleteRef:v,setBlurComplete:y,setShowAltText:w,sizesInput:S,onLoad:C,onError:k,..._},N)=>{let P=(0,l.useRef)(!1),O=(0,l.useRef)(null);m(()=>{let{current:e}=P,{current:t}=O;e||null===t||(k&&(t.src=t.src),t.complete&&h(t,d,x,v,y,b,S),P.current=!0)},[e,d,x,v,k,b,S]);let R=(0,f.useMergedRef)(N,O);return(0,a.jsx)("img",{..._,...g(u),loading:p,width:s,height:r,decoding:i,"data-nimg":j?"fill":"1",className:o,style:c,sizes:n,srcSet:t,src:e,ref:R,onLoad:e=>{h(e.currentTarget,d,x,v,y,b,S)},onError:e=>{w(!0),"empty"!==d&&y(!0),k&&k(e)}})});function j({isAppRouter:e,imgAttributes:t}){let n={as:"image",imageSrcSet:t.srcSet,imageSizes:t.sizes,crossOrigin:t.crossOrigin,referrerPolicy:t.referrerPolicy,...g(t.fetchPriority)};return e&&i.default.preload?(i.default.preload(t.src,n),null):(0,a.jsx)(o.default,{children:(0,a.jsx)("link",{rel:"preload",href:t.srcSet?void 0:t.src,...n},"__nimg-"+t.src+t.srcSet+t.sizes)})}let x=(0,l.forwardRef)((e,t)=>{let n=(0,l.useContext)(u.RouterContext),r=(0,d.useImageConfig)(),{onLoad:s,onLoadingComplete:i}=e,o=(0,l.useRef)(s);(0,l.useEffect)(()=>{o.current=s},[s]);let f=(0,l.useRef)(i);(0,l.useEffect)(()=>{f.current=i},[i]);let[h,g]=(0,l.useState)(!1),[m,x]=(0,l.useState)(!1),{props:v,meta:y}=(0,c.getImgProps)(e,{defaultLoader:p.default,imgConf:r,blurComplete:h,showAltText:m});return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(b,{...v,unoptimized:y.unoptimized,placeholder:y.placeholder,fill:y.fill,onLoadRef:o,onLoadingCompleteRef:f,setBlurComplete:g,setShowAltText:x,sizesInput:e.sizes,ref:t}),y.preload?(0,a.jsx)(j,{isAppRouter:!n,imgAttributes:v}):null]})});("function"==typeof n.default||"object"==typeof n.default&&null!==n.default)&&void 0===n.default.__esModule&&(Object.defineProperty(n.default,"__esModule",{value:!0}),Object.assign(n.default,n),t.exports=n.default)},49381,(e,t,n)=>{"use strict";e.i(47167),Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"useImageConfig",{enumerable:!0,get:function(){return i}});let r=e.r(71645),s=e.r(87690),a=e.r(18556),l={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[32,48,64,96,128,256,384],qualities:[75],path:"/_next/image/",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!0};function i(){let e=(0,r.useContext)(a.ImageConfigContext);return(0,s.prepareImageConfig)(l,e)}("function"==typeof n.default||"object"==typeof n.default&&null!==n.default)&&void 0===n.default.__esModule&&(Object.defineProperty(n.default,"__esModule",{value:!0}),Object.assign(n.default,n),t.exports=n.default)},90317,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r={bindSnapshot:function(){return u},createAsyncLocalStorage:function(){return o},createSnapshot:function(){return d},getOrCreateGlobalAsyncLocalStorage:function(){return c}};for(var s in r)Object.defineProperty(n,s,{enumerable:!0,get:r[s]});let a=Error("Invariant: AsyncLocalStorage accessed in runtime where it is not available");class l{disable(){throw a}getStore(){}run(){throw a}exit(){throw a}enterWith(){throw a}static bind(e){return e}}let i="u">typeof globalThis&&globalThis.AsyncLocalStorage;function o(){return i?new i:new l}function c(e){let t=Symbol.for(`@next/${e}@16.4.5`),n=globalThis;return n[t]??=o()}function u(e){return i?i.bind(e):l.bind(e)}function d(){return i?i.snapshot():function(e,...t){return e(...t)}}},42344,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"workAsyncStorageInstance",{enumerable:!0,get:function(){return r}});let r=(0,e.r(90317).getOrCreateGlobalAsyncLocalStorage)("work-async-storage")},63599,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"workAsyncStorage",{enumerable:!0,get:function(){return r.workAsyncStorageInstance}});let r=e.r(42344)},70703,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"default",{enumerable:!0,get:function(){return s}});let r=e.r(55682)._(e.r(69093));function s(e,t){let n={};"function"==typeof e&&(n.loader=e);let s={...n,...t};return(0,r.default)({...s,modules:s.loadableGenerated?.modules})}("function"==typeof n.default||"object"==typeof n.default&&null!==n.default)&&void 0===n.default.__esModule&&(Object.defineProperty(n.default,"__esModule",{value:!0}),Object.assign(n.default,n),t.exports=n.default)},9885,(e,t,n)=>{"use strict";function r(e){return e.split("/").map(e=>encodeURIComponent(e)).join("/")}Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"encodeURIPath",{enumerable:!0,get:function(){return r}})},70965,(e,t,n)=>{"use strict";function r(e,t){let n=e||75;return t?.qualities?.length?t.qualities.reduce((e,t)=>Math.abs(t-n)<Math.abs(e-n)?t:e,t.qualities[0]):n}Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"findClosestQuality",{enumerable:!0,get:function(){return r}})},8927,(e,t,n)=>{"use strict";e.i(47167),Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"getImgProps",{enumerable:!0,get:function(){return o}});let r=e.r(43369),s=e.r(88143),a=["-moz-initial","fill","none","scale-down",void 0];function l(e){return void 0!==e.default}function i(e){return void 0===e?e:"number"==typeof e?Number.isFinite(e)?e:0/0:"string"==typeof e&&/^[0-9]+$/.test(e)?parseInt(e,10):0/0}function o({src:e,sizes:t,unoptimized:n=!1,priority:c=!1,preload:u=!1,loading:d,className:p,quality:f,width:h,height:g,fill:m=!1,style:b,overrideSrc:j,onLoad:x,onLoadingComplete:v,placeholder:y="empty",blurDataURL:w,fetchPriority:S,decoding:C="async",layout:k,objectFit:_,objectPosition:N,lazyBoundary:P,lazyRoot:O,...R},A){var M;let I,E,{imgConf:z,showAltText:U,blurComplete:L,defaultLoader:T}=A;if(void 0===T)throw Error("images.loaderFile detected but the file is missing default export.\nRead more: https://nextjs.org/docs/messages/invalid-images-config");let $=R.loader||T;delete R.loader,delete R.srcSet;let D="__next_img_default"in $;if(D){if("custom"===z.loader)throw Error(`Image with src "${e}" is missing "loader" prop.
2
- Read more: https://nextjs.org/docs/messages/next-image-missing-loader`)}else{let e=$;$=t=>{let{config:n,...r}=t;return e(r)}}if(k){"fill"===k&&(m=!0);let e={intrinsic:{maxWidth:"100%",height:"auto"},responsive:{width:"100%",height:"auto"}}[k];e&&(b={...b,...e});let n={responsive:"100vw",fill:"100vw"}[k];n&&!t&&(t=n)}let B="",F=i(h),q=i(g);if((M=e)&&"object"==typeof M&&(l(M)||void 0!==M.src)){let t=l(e)?e.default:e;if(!t.src)throw Error(`An object should only be passed to the image component src parameter if it comes from a static image import. It must include src. Received ${JSON.stringify(t)}`);if(!t.height||!t.width)throw Error(`An object should only be passed to the image component src parameter if it comes from a static image import. It must include height and width. Received ${JSON.stringify(t)}`);if(I=t.blurWidth,E=t.blurHeight,w=w||t.blurDataURL,B=t.src,!m)if(F||q){if(F&&!q){let e=F/t.width;q=Math.round(t.height*e)}else if(!F&&q){let e=q/t.height;F=Math.round(t.width*e)}}else F=t.width,q=t.height}let W=!c&&!u&&("lazy"===d||void 0===d);(!(e="string"==typeof e?e:B)||e.startsWith("data:")||e.startsWith("blob:"))&&(n=!0,W=!1),z.unoptimized&&(n=!0),D&&!z.dangerouslyAllowSVG&&e.split("?",1)[0].endsWith(".svg")&&(n=!0);let J=i(f),G=Object.assign(m?{position:"absolute",height:"100%",width:"100%",left:0,top:0,right:0,bottom:0,objectFit:_,objectPosition:N}:{},U?{}:{color:"transparent"},b),H=L||"empty"===y?null:"blur"===y?`url("data:image/svg+xml;charset=utf-8,${(0,s.getImageBlurSvg)({widthInt:F,heightInt:q,blurWidth:I,blurHeight:E,blurDataURL:w||"",objectFit:G.objectFit})}")`:`url("${y}")`,K=a.includes(G.objectFit)?"fill"===G.objectFit?"100% 100%":"cover":G.objectFit,V=H?{backgroundSize:K,backgroundPosition:G.objectPosition||"50% 50%",backgroundRepeat:"no-repeat",backgroundImage:H}:{},Q=function({config:e,src:t,unoptimized:n,width:s,quality:a,sizes:l,loader:i}){if(n){if(t.startsWith("/")&&!t.startsWith("//")){let e=(0,r.getDeploymentId)();if(t.includes("/_next/static/immutable")&&!(0,r.getAssetToken)())e=void 0;else if(e){let n=t.indexOf("?");if(-1!==n){let r=new URLSearchParams(t.slice(n+1));r.get("dpl")||(r.append("dpl",e),t=t.slice(0,n)+"?"+r.toString())}else t+=`?dpl=${e}`}}return{src:t,srcSet:void 0,sizes:void 0}}let{widths:o,kind:c}=function({deviceSizes:e,allSizes:t},n,r){if(r){let n=/(^|\s)(1?\d?\d)vw/g,s=[];for(let e;e=n.exec(r);)s.push(parseInt(e[2]));if(s.length){let n=.01*Math.min(...s);return{widths:t.filter(t=>t>=e[0]*n),kind:"w"}}return{widths:t,kind:"w"}}return"number"!=typeof n?{widths:e,kind:"w"}:{widths:[...new Set([n,2*n].map(e=>t.find(t=>t>=e)||t[t.length-1]))],kind:"x"}}(e,s,l),u=o.length-1;return{sizes:l||"w"!==c?l:"100vw",srcSet:o.map((n,r)=>`${i({config:e,src:t,quality:a,width:n})} ${"w"===c?n:r+1}${c}`).join(", "),src:i({config:e,src:t,quality:a,width:o[u]})}}({config:z,src:e,unoptimized:n,width:F,quality:J,sizes:t,loader:$}),X=W?"lazy":d;return{props:{...R,loading:X,fetchPriority:S,width:F,height:q,decoding:C,className:p,style:{...G,...V},sizes:Q.sizes,srcSet:Q.srcSet,src:j||Q.src},meta:{unoptimized:n,preload:u||c,placeholder:y,fill:m}}}},25633,(e,t,n)=>{"use strict";e.i(47167),Object.defineProperty(n,"__esModule",{value:!0});var r={default:function(){return g},defaultHead:function(){return d}};for(var s in r)Object.defineProperty(n,s,{enumerable:!0,get:r[s]});let a=e.r(55682),l=e.r(90809),i=e.r(18050),o=l._(e.r(71645)),c=a._(e.r(98879)),u=e.r(42732);function d(){return[(0,i.jsx)("meta",{charSet:"utf-8"},"charset"),(0,i.jsx)("meta",{name:"viewport",content:"width=device-width"},"viewport")]}function p(e,t){return"string"==typeof t||"number"==typeof t?e:t.type===o.default.Fragment?e.concat(o.default.Children.toArray(t.props.children).reduce((e,t)=>"string"==typeof t||"number"==typeof t?e:e.concat(t),[])):e.concat(t)}let f=["name","httpEquiv","charSet","itemProp"];function h(e){let t,n,r,s;return e.reduce(p,[]).reverse().concat(d().reverse()).filter((t=new Set,n=new Set,r=new Set,s={},e=>{let a=!0,l=!1;if(e.key&&"number"!=typeof e.key&&e.key.indexOf("$")>0){l=!0;let n=e.key.slice(e.key.indexOf("$")+1);t.has(n)?a=!1:t.add(n)}switch(e.type){case"title":case"base":n.has(e.type)?a=!1:n.add(e.type);break;case"meta":for(let t=0,n=f.length;t<n;t++){let n=f[t];if(e.props.hasOwnProperty(n))if("charSet"===n)r.has(n)?a=!1:r.add(n);else{let t=e.props[n],r=s[n]||new Set;("name"!==n||!l)&&r.has(t)?a=!1:(r.add(t),s[n]=r)}}}return a})).reverse().map((e,t)=>{let n=e.key||t;return o.default.cloneElement(e,{key:n})})}let g=function({children:e}){let t=(0,o.useContext)(u.HeadManagerContext);return(0,i.jsx)(c.default,{reduceComponentsToState:h,headManager:t,children:e})};("function"==typeof n.default||"object"==typeof n.default&&null!==n.default)&&void 0===n.default.__esModule&&(Object.defineProperty(n.default,"__esModule",{value:!0}),Object.assign(n.default,n),t.exports=n.default)},88143,(e,t,n)=>{"use strict";function r({widthInt:e,heightInt:t,blurWidth:n,blurHeight:s,blurDataURL:a,objectFit:l}){let i=n?40*n:e,o=s?40*s:t,c=i&&o?`viewBox='0 0 ${i} ${o}'`:"";return`%3Csvg xmlns='http://www.w3.org/2000/svg' ${c}%3E%3Cfilter id='b' color-interpolation-filters='sRGB'%3E%3CfeGaussianBlur stdDeviation='20'/%3E%3CfeColorMatrix values='1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 100 -1' result='s'/%3E%3CfeFlood x='0' y='0' width='100%25' height='100%25'/%3E%3CfeComposite operator='out' in='s'/%3E%3CfeComposite in2='SourceGraphic'/%3E%3CfeGaussianBlur stdDeviation='20'/%3E%3C/filter%3E%3Cimage width='100%25' height='100%25' x='0' y='0' preserveAspectRatio='${c?"none":"contain"===l?"xMidYMid":"cover"===l?"xMidYMid slice":"none"}' style='filter: url(%23b);' href='${a}'/%3E%3C/svg%3E`}Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"getImageBlurSvg",{enumerable:!0,get:function(){return r}})},18556,(e,t,n)=>{"use strict";e.i(47167),Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"ImageConfigContext",{enumerable:!0,get:function(){return a}});let r=e.r(55682)._(e.r(71645)),s=e.r(87690),a=r.default.createContext(s.imageConfigDefault)},87690,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r={VALID_LOADERS:function(){return a},imageConfigDefault:function(){return c},prepareImageConfig:function(){return o}};for(var s in r)Object.defineProperty(n,s,{enumerable:!0,get:r[s]});let a=["default","imgix","cloudinary","akamai","custom"],l={},i=new WeakMap;function o(e,t){let n=e??l,r=t??l,s=i.get(n);if(s){let e=s.get(r);if(e)return e}let a=e||t||c,o=[...a.deviceSizes].sort((e,t)=>e-t),u=[...a.imageSizes],d={deviceSizes:o,imageSizes:u,allSizes:[...o,...u].sort((e,t)=>e-t),qualities:void 0===a.qualities?void 0:[...a.qualities].sort((e,t)=>e-t),path:a.path,loader:a.loader,dangerouslyAllowSVG:a.dangerouslyAllowSVG,unoptimized:a.unoptimized,domains:a.domains,remotePatterns:a.remotePatterns,localPatterns:"u"<typeof window&&void 0!==t?t.localPatterns:a.localPatterns,output:a.output};return s||(s=new WeakMap,i.set(n,s)),s.set(r,d),d}let c={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[32,48,64,96,128,256,384],path:"/_next/image",loader:"default",loaderFile:"",domains:[],disableStaticImages:!1,minimumCacheTTL:14400,formats:["image/webp"],maximumDiskCacheSize:void 0,maximumRedirects:3,maximumResponseBody:5e7,dangerouslyAllowLocalIP:!1,dangerouslyAllowSVG:!1,contentSecurityPolicy:"script-src 'none'; frame-src 'none'; sandbox;",contentDispositionType:"attachment",localPatterns:void 0,remotePatterns:[],qualities:[75],unoptimized:!1,customCacheHandler:!1}},1948,(e,t,n)=>{"use strict";e.i(47167),Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"default",{enumerable:!0,get:function(){return l}});let r=e.r(70965),s=e.r(43369);function a({config:e,src:t,width:n,quality:l}){let i=(0,s.getDeploymentId)();if(t.startsWith("/")&&!t.startsWith("//"))if(t.includes("/_next/static/immutable")&&!(0,s.getAssetToken)())i=void 0;else{let e=t.indexOf("?");if(-1!==e){let n=new URLSearchParams(t.slice(e+1)),r=n.get("dpl");if(r){i=r,n.delete("dpl");let s=n.toString();t=t.slice(0,e)+(s?"?"+s:"")}}}if(t.startsWith("/")&&t.includes("?")&&e.localPatterns?.length===1&&"**"===e.localPatterns[0].pathname&&""===e.localPatterns[0].search)throw Error(`Image with src "${t}" is using a query string which is not configured in images.localPatterns.
3
- Read more: https://nextjs.org/docs/messages/next-image-unconfigured-localpatterns`);let o=(0,r.findClosestQuality)(l,e);return`${e.path}?url=${encodeURIComponent(t)}&w=${n}&q=${o}${t.startsWith("/")&&i?`&dpl=${i}`:""}`}a.__next_img_default=!0;let l=a},67585,(e,t,n)=>{"use strict";e.i(47167),Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"BailoutToCSRForNextDynamic",{enumerable:!0,get:function(){return l}});let r=e.r(71645),s=e.r(74080);e.r(32061);let a=e.r(49354).createReactBrowserBailoutReason.bind(null,"next/dynamic");function l({children:e}){return(0,r.use)((0,s.browser)(a)),e}},69093,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"default",{enumerable:!0,get:function(){return c}});let r=e.r(18050),s=e.r(71645),a=e.r(67585),l=e.r(52157);function i(e){return{default:e&&"default"in e?e.default:e}}let o={loader:()=>Promise.resolve(i(()=>null)),loading:null,ssr:!0},c=function(e){let t={...o,...e},n=(0,s.lazy)(()=>t.loader().then(i)),c=t.loading;function u(e){let i=c?(0,r.jsx)(c,{isLoading:!0,pastDelay:!0,error:null}):null,o=!t.ssr||!!t.loading,u=o?s.Suspense:s.Fragment,d=t.ssr?(0,r.jsxs)(r.Fragment,{children:["u"<typeof window?(0,r.jsx)(l.PreloadChunks,{moduleIds:t.modules}):null,(0,r.jsx)(n,{...e})]}):(0,r.jsx)(a.BailoutToCSRForNextDynamic,{children:(0,r.jsx)(n,{...e})});return(0,r.jsx)(u,{...o?{fallback:i}:{},children:d})}return u.displayName="LoadableComponent",u}},52157,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"PreloadChunks",{enumerable:!0,get:function(){return o}});let r=e.r(18050),s=e.r(74080),a=e.r(63599),l=e.r(9885),i=e.r(43369);function o({moduleIds:e}){if("u">typeof window)return null;let t=a.workAsyncStorage.getStore();if(void 0===t)return null;let n=[];if(t.reactLoadableManifest&&e){let r=t.reactLoadableManifest;for(let t of e){if(!r[t])continue;let e=r[t].files;n.push(...e)}}if(0===n.length)return null;let c=(0,i.getAssetTokenQuery)();return(0,r.jsx)(r.Fragment,{children:n.map(e=>{let n=`${t.assetPrefix}/_next/${(0,l.encodeURIPath)(e)}${c}`;return e.endsWith(".css")?(0,r.jsx)("link",{precedence:"dynamic",href:n,rel:"stylesheet",as:"style",nonce:t.nonce},e):((0,s.preload)(n,{as:"script",fetchPriority:"low",nonce:t.nonce}),null)})})}},49354,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r={createReactBrowserBailoutReason:function(){return l},getReactBrowserBailoutReason:function(){return i},isNextBrowserBailoutError:function(){return o}};for(var s in r)Object.defineProperty(n,s,{enumerable:!0,get:r[s]});let a=Symbol.for("next.browser-bailout-reason");function l(e){return{$$typeof:a,reason:e}}function i(e){let t=e?.cause;return t?.$$typeof===a?t.reason:void 0}function o(e){return void 0!==i(e)}},65856,(e,t,n)=>{"use strict";e.i(47167),Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"RouterContext",{enumerable:!0,get:function(){return r}});let r=(e.r(55682)._(e.r(71645))).default.createContext(null)},98879,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"default",{enumerable:!0,get:function(){return i}});let r=e.r(71645),s="u"<typeof window,a=s?()=>{}:r.useLayoutEffect,l=s?()=>{}:r.useEffect;function i(e){let{headManager:t,reduceComponentsToState:n}=e;function i(){if(t&&t.mountedInstances){let e=r.Children.toArray(Array.from(t.mountedInstances).filter(Boolean));t.updateHead(n(e))}}return s&&(t?.mountedInstances?.add(e.children),i()),a(()=>(t?.mountedInstances?.add(e.children),()=>{t?.mountedInstances?.delete(e.children)})),a(()=>(t&&(t._pendingUpdate=i),()=>{t&&(t._pendingUpdate=i)})),l(()=>(t&&t._pendingUpdate&&(t._pendingUpdate(),t._pendingUpdate=null),()=>{t&&t._pendingUpdate&&(t._pendingUpdate(),t._pendingUpdate=null)})),null}},13581,29487,e=>{"use strict";var t=e.i(71645),n=e.i(95813);e.s(["f",0,function(e,r=0){let[s,a]=(0,t.useState)(),[l,i]=(0,t.useState)(""),[o,c]=(0,t.useState)(!0),u=(0,t.useRef)(void 0),d=(0,t.useRef)(!1),p=(0,t.useCallback)(async()=>{u.current?.abort();let t=new AbortController;u.current=t;try{let n=await e(t.signal);if(t.signal.aborted||!d.current)return;a(n),i("")}catch(e){!t.signal.aborted&&d.current&&i((0,n.f)(e))}finally{!t.signal.aborted&&d.current&&c(!1)}},[e]);return(0,t.useEffect)(()=>{d.current=!0,queueMicrotask(()=>{d.current&&p()});let e=r>0?setInterval(()=>{p()},r):void 0;return()=>{d.current=!1,u.current?.abort(),clearInterval(e)}},[p,r]),{data:s,error:l,isLoading:o,refresh:p}}],13581);var r=e.i(18050),s=e.i(19455);e.s(["f",0,function({isLoading:e,error:t,refresh:n}){return(0,r.jsxs)(r.Fragment,{children:[e?(0,r.jsx)("p",{role:"status",children:"Loading workspace data…"}):void 0,t?(0,r.jsxs)("div",{className:"error",role:"alert",children:[(0,r.jsx)("p",{children:t}),(0,r.jsx)(s.f,{variant:"outline",onClick:()=>{n()},children:"Try again"})]}):void 0]})}],29487)},33103,e=>{"use strict";var t=e.i(18050),n=e.i(70703),r=e.i(71645),s=e.i(73656),a=e.i(95813),l=e.i(13581),i=e.i(19455),o=e.i(93479),c=e.i(24687),u=e.i(22219),u=u,d=e.i(40192),p=e.i(54105);let f=u.enum(["none","headers","oauth"]),h=u.enum(["auto","streamable-http","sse"]),g=d.z.record(p.z.string(),p.z.string()),m=[{value:"none",label:"No authentication"},{value:"headers",label:"Token or custom headers"},{value:"oauth",label:"Sign in with OAuth"}],b=[{value:"auto",label:"Automatic"},{value:"streamable-http",label:"Streamable HTTP"},{value:"sse",label:"Legacy HTTP/SSE"}];function j({connection:e,busy:n,perform:a,onDirtyChange:l}){let[u,d]=(0,r.useState)(e.endpoint),[p,x]=(0,r.useState)(e.authMode),[v,y]=(0,r.useState)(e.transport),[w,S]=(0,r.useState)(""),[C,k]=(0,r.useState)(""),[_,N]=(0,r.useState)(""),[P,O]=(0,r.useState)(""),[R,A]=(0,r.useState)(""),[M,I]=(0,r.useState)(""),E=u!==e.endpoint||p!==e.authMode||v!==e.transport||!!(w||C),z=E||!!(P||R||M);return(0,r.useEffect)(()=>(l(z),()=>{l(!1)}),[z,l]),(0,t.jsxs)("div",{className:"space-y-3",children:["oauth"===e.authMode?(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("details",{children:[(0,t.jsx)("summary",{children:"Registered OAuth application (optional)"}),(0,t.jsxs)("label",{className:"block",children:["Client ID",(0,t.jsx)(o.f,{value:P,onChange:e=>{O(e.target.value)}})]}),(0,t.jsxs)("label",{className:"block",children:["Client secret",(0,t.jsx)(o.f,{type:"password",autoComplete:"off",value:R,onChange:e=>{A(e.target.value)}})]}),(0,t.jsxs)("label",{className:"block",children:["Client metadata URL",(0,t.jsx)(o.f,{type:"url",value:M,onChange:e=>{I(e.target.value)}})]}),(0,t.jsxs)("p",{className:"small",children:["Register ",(0,t.jsx)("code",{children:"/oauth/mcp/callback"})," on your configured OrgSDK public origin as the callback URL."]})]}),(0,t.jsx)(i.f,{disabled:n||E,onClick:()=>{a(async()=>{let t=await s.U.plugins.mcp.beginOAuth.mutate({id:e.pluginId,...P&&{client_id:P},...R&&{client_secret:R},...M&&{client_metadata_url:M}});O(""),A(""),I(""),l(!1),N(t.authorization_url)},"Open the sign-in link, finish authorization, then check the connection.")},children:e.authenticated?"Reconnect account":"Sign in"}),_?(0,t.jsx)("a",{className:"underline",href:_,target:"_blank",rel:"noopener noreferrer",children:"Continue to server sign-in"}):null]}):null,(0,t.jsxs)("details",{children:[(0,t.jsx)("summary",{children:"Update connection"}),(0,t.jsx)("p",{children:"Saving disables this connection until its tools are checked and reviewed again."}),(0,t.jsxs)("label",{className:"block",children:["Server URL",(0,t.jsx)(o.f,{type:"url",value:u,onChange:e=>{d(e.target.value)}})]}),(0,t.jsxs)("label",{className:"block",children:["Authentication",(0,t.jsx)("select",{className:"field",value:p,onChange:e=>{x(f.parse(e.target.value))},children:m.map(e=>(0,t.jsx)("option",{value:e.value,children:e.label},e.value))})]}),"headers"===p?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("label",{className:"block",children:["Replacement bearer token",(0,t.jsx)(o.f,{type:"password",autoComplete:"off",value:w,onChange:e=>{S(e.target.value)}})]}),(0,t.jsxs)("label",{className:"block",children:["Replacement custom headers (JSON)",(0,t.jsx)(c.f,{value:C,onChange:e=>{k(e.target.value)},placeholder:'{"X-API-Key":"..."}'})]}),(0,t.jsx)("p",{className:"small",children:"Leave credential fields empty to keep existing credentials at the same endpoint."})]}):null,(0,t.jsxs)("label",{className:"block",children:["Connection transport",(0,t.jsx)("select",{className:"field",value:v,onChange:e=>{y(h.parse(e.target.value))},children:b.map(e=>(0,t.jsx)("option",{value:e.value,children:e.label},e.value))})]}),(0,t.jsx)(i.f,{disabled:n||!E,onClick:()=>{a(async()=>{let t=C.trim()?g.parse(JSON.parse(C)):{};await s.U.plugins.mcp.update.mutate({id:e.pluginId,endpoint:u,transport:v,auth_mode:p,..."headers"===p&&(w||C)&&{headers:{...t,...w&&{Authorization:`Bearer ${w}`}}}}),S(""),k("")})},children:"Save connection changes"})]})]})}var x=e.i(29487);function v({plugin:e,canManage:n,onChanged:o,onDirtyChange:c}){let u=(0,r.useCallback)(t=>s.U.plugins.mcp.get.query({id:e.id},{signal:t}),[e.id]),d=(0,l.f)(u),p=d.refresh,[f,h]=(0,r.useState)(null),[g,m]=(0,r.useState)(!1),[b,y]=(0,r.useState)(""),[w,S]=(0,r.useState)(""),[C,k]=(0,r.useState)(!1),_=C||null!==f;(0,r.useEffect)(()=>(c(e.id,_),()=>{c(e.id,!1)}),[e.id,_,c]);let N=d.data;(0,r.useEffect)(()=>{if(N?.status!=="checking")return;let e=setInterval(()=>{p()},2e3);return()=>{clearInterval(e)}},[N?.status,p]);let P=async(e,t="")=>{m(!0),y(""),S("");try{await e(),await d.refresh(),await o(),S(t)}catch(e){y((0,a.f)(e))}finally{m(!1)}},O=N?.candidate,R=O?.tools.filter(e=>N?.enabledTools.includes(e.name)&&N.catalogue.some(t=>{let{alias:n,...r}=t;return JSON.stringify(r)===JSON.stringify(e)})).map(e=>e.name)??[],A=f??R;return(0,t.jsxs)("article",{className:"rounded-lg border p-4 space-y-3","aria-label":`MCP ${e.slug}`,children:[(0,t.jsx)("h3",{children:e.slug}),(0,t.jsx)(x.f,{...d}),N?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{className:"break-all small",children:N.endpoint}),(0,t.jsxs)("p",{children:[e.enabled?"Enabled":"Disabled"," ·"," ",N.enabledTools.length," tools selected"]}),"ready"===N.runner?null:(0,t.jsx)("p",{role:"status",children:"offline"===N.runner?"Connect the project runner to check or use this server.":"Upgrade the project runner to enable MCP connections."}),"checking"===N.status?(0,t.jsx)("p",{role:"status",children:N.discovery?.status==="queued"?"Waiting for the project runner…":"Checking connection and available tools…"}):null,"authentication_required"===N.status?(0,t.jsx)("p",{role:"status",children:"This server requires authentication. Sign in or update its credentials."}):null,"failed"===N.status?(0,t.jsxs)("p",{role:"alert",children:["Connection check failed. ",N.discovery?.error]}):null,N.checkedAt?(0,t.jsxs)("p",{className:"small",children:["Last checked ",new Date(N.checkedAt).toLocaleString()]}):null,n?(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsx)(i.f,{disabled:g||"ready"!==N.runner||"checking"===N.status,onClick:()=>{h(null),P(()=>s.U.plugins.mcp.discover.mutate({id:e.id}))},children:"Check connection / refresh tools"}),(0,t.jsx)(i.f,{variant:"outline",disabled:g||!e.enabled&&0===N.enabledTools.length,onClick:()=>{P(()=>s.U.plugins.update.mutate({id:e.id,enabled:!e.enabled}),e.enabled?"Connection disabled. Active runs are being cancelled.":"Connection enabled.")},children:e.enabled?"Disable":"Enable"}),(0,t.jsx)(i.f,{variant:"outline",disabled:g,onClick:()=>{P(()=>s.U.plugins.delete.mutate({id:e.id}))},children:"Remove"})]}):null,O&&!O.authRequired?(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("h4",{children:"Review available tools"}),(0,t.jsx)("p",{children:"Only selected tools become available to this project. Changed tools need your review again."}),O.tools.map(e=>{var r;return(0,t.jsxs)("div",{className:"block rounded border p-2",children:[(0,t.jsxs)("label",{children:[(0,t.jsx)("input",{type:"checkbox",disabled:!n||g,checked:A.includes(e.name),onChange:t=>{h(t.target.checked?[...A,e.name]:A.filter(t=>t!==e.name))}})," ",(0,t.jsx)("strong",{children:e.name})]}),(0,t.jsx)("span",{className:"small",children:(r=e.name,R.includes(r)?"Enabled, unchanged":N?.catalogue.some(e=>e.name===r)?"Review changes":"New tool")}),(0,t.jsx)("p",{className:"small",children:e.description}),(0,t.jsxs)("details",{children:[(0,t.jsx)("summary",{children:"Tool contract"}),(0,t.jsx)("pre",{className:"overflow-auto",children:JSON.stringify({inputSchema:e.inputSchema,outputSchema:e.outputSchema},null,2)})]})]},e.name)}),N.enabledTools.some(e=>O.tools.every(t=>t.name!==e))?(0,t.jsxs)("p",{role:"status",children:["Removed by the server:"," ",N.enabledTools.filter(e=>O.tools.every(t=>t.name!==e)).join(", "),". Accepting this catalogue removes their access and cancels affected runs."]}):null,0===O.tools.length?(0,t.jsx)("p",{children:"This server exposes no tools."}):null,n?(0,t.jsx)(i.f,{disabled:g,onClick:()=>{let t=N.discoveryRunId;t&&P(async()=>{await s.U.plugins.mcp.accept.mutate({id:e.id,run:t,tools:A}),h(null)},"Selected tools are ready for code and actions.")},children:"Enable selected tools"}):null]}):null,N.catalogue.length>0?(0,t.jsxs)("details",{children:[(0,t.jsx)("summary",{children:"Enabled tool reference"}),N.catalogue.filter(e=>N.enabledTools.includes(e.name)).map(n=>(0,t.jsxs)("div",{children:[(0,t.jsxs)("code",{children:[e.slug.replaceAll(/-([a-z])/g,(e,t)=>t.toUpperCase()),".",n.alias,"(args)"]}),(0,t.jsx)("pre",{className:"overflow-auto",children:JSON.stringify(n.inputSchema,null,2)})]},n.name))]}):null,n?(0,t.jsx)(j,{connection:N,busy:g,perform:P,onDirtyChange:k},N.revision):null]}):null,b?(0,t.jsx)("p",{role:"alert",children:b}):null,w?(0,t.jsx)("p",{role:"status",children:w}):null]})}function y({project:e,onSaved:n,onDirtyChange:l}){let[u,d]=(0,r.useState)(""),[p,j]=(0,r.useState)(""),[x,v]=(0,r.useState)("auto"),[w,S]=(0,r.useState)("none"),[C,k]=(0,r.useState)(""),[_,N]=(0,r.useState)(""),[P,O]=(0,r.useState)(!1),[R,A]=(0,r.useState)(""),M=!!(u||p||C||_);return(0,r.useEffect)(()=>(l(M),()=>{l(!1)}),[M,l]),(0,t.jsxs)("form",{className:"space-y-4",onSubmit:t=>{t.preventDefault(),O(!0),A(""),(async()=>{try{let t=_.trim()?g.parse(JSON.parse(_)):{};await s.U.plugins.mcp.create.mutate({project:e,slug:u,endpoint:p,transport:x,auth_mode:w,..."headers"===w&&{headers:{...t,...C&&{Authorization:`Bearer ${C}`}}}}),d(""),j(""),k(""),N(""),await n()}catch(e){A((0,a.f)(e))}finally{O(!1)}})()},children:[(0,t.jsx)("h3",{children:"Connect MCP server"}),(0,t.jsx)("p",{children:"Add a server, check its connection, then choose the tools this project can use."}),(0,t.jsxs)("label",{className:"block",children:["Connection name",(0,t.jsx)(o.f,{required:!0,value:u,onChange:e=>{d(e.target.value)},placeholder:"customer-tools",pattern:"[a-z][a-z0-9]*(-[a-z][a-z0-9]*)*"})]}),(0,t.jsxs)("label",{className:"block",children:["Server URL",(0,t.jsx)(o.f,{required:!0,type:"url",value:p,onChange:e=>{j(e.target.value)},placeholder:"https://example.com/mcp"})]}),(0,t.jsxs)("label",{className:"block",children:["Authentication",(0,t.jsx)("select",{className:"field",value:w,onChange:e=>{S(f.parse(e.target.value))},children:m.map(e=>(0,t.jsx)("option",{value:e.value,children:e.label},e.value))})]}),"headers"===w?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("label",{className:"block",children:["Bearer token",(0,t.jsx)(o.f,{type:"password",autoComplete:"off",value:C,onChange:e=>{k(e.target.value)}})]}),(0,t.jsxs)("details",{children:[(0,t.jsx)("summary",{children:"Custom authentication headers"}),(0,t.jsxs)("label",{className:"block",children:["Headers as a JSON object",(0,t.jsx)(c.f,{value:_,onChange:e=>{N(e.target.value)},placeholder:'{"X-API-Key":"..."}'})]})]})]}):null,(0,t.jsxs)("details",{children:[(0,t.jsx)("summary",{children:"Transport settings"}),(0,t.jsxs)("label",{className:"block",children:["Connection transport",(0,t.jsx)("select",{className:"field",value:x,onChange:e=>{v(h.parse(e.target.value))},children:b.map(e=>(0,t.jsx)("option",{value:e.value,children:e.label},e.value))})]})]}),R?(0,t.jsx)("p",{role:"alert",children:R}):null,(0,t.jsx)(i.f,{disabled:P,type:"submit",children:P?"Saving…":"Add connection"})]})}function w({project:e,plugins:n,canManage:s,onChanged:a,onDirtyChange:l}){let[i,o]=(0,r.useState)({}),c=Object.values(i).some(Boolean),u=(0,r.useCallback)((e,t)=>{o(n=>n[e]===t?n:{...n,[e]:t})},[]),d=(0,r.useCallback)(e=>{u("create",e)},[u]);return(0,r.useEffect)(()=>(l(c),()=>{l(!1)}),[c,l]),(0,t.jsxs)("section",{className:"panel space-y-4",children:[(0,t.jsx)("h2",{children:"Remote MCP connections"}),(0,t.jsx)("p",{children:"Use tools from your own servers in this project’s code and actions. Connections run from the project runner."}),n.map(e=>(0,t.jsx)(v,{plugin:e,canManage:s,onChanged:a,onDirtyChange:u},e.id)),s?(0,t.jsx)(y,{project:e,onSaved:a,onDirtyChange:d},e):(0,t.jsx)("p",{children:"Ask an administrator to connect a server or change tool access."})]})}var S=e.i(23920);async function C(e){return s.U.plugins.marketplace.query(void 0,{signal:e})}function k({releases:e}){let n=(0,l.f)(C),[s,a]=(0,r.useState)(""),i=s.trim().toLowerCase().split(/\s+/).filter(Boolean),c=(n.data??[]).filter(t=>{let n=[t.display_name,t.description,t.category,...t.tags,...t.use_cases].join(" ").toLowerCase();return e.every(e=>e.slug!==t.slug)&&i.every(e=>n.includes(e))});return(0,t.jsxs)("section",{className:"panel space-y-4",children:[(0,t.jsx)("h2",{children:"Discover plugins"}),(0,t.jsx)("p",{children:"Explore the OrgSDK plugin catalog. Plugins without a published release can be inspected on the website; installation becomes available when a compatible release is published."}),(0,t.jsx)("a",{className:"underline",href:"https://orgsdk.ai/plugins",target:"_blank",rel:"noreferrer",children:"Browse plugins on orgsdk.ai ↗"}),(0,t.jsxs)("label",{className:"block",children:["Search plugin catalog",(0,t.jsx)(o.f,{type:"search",value:s,onChange:e=>{a(e.target.value)},placeholder:"Search names, categories or use cases"})]}),(0,t.jsx)(x.f,{...n}),n.isLoading||n.error||0!==c.length?null:(0,t.jsx)("p",{children:"No additional plugins match this search."}),(0,t.jsx)("div",{className:"grid gap-4 md:grid-cols-2",children:c.map(e=>(0,t.jsxs)("article",{className:"rounded-lg border p-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)(S.f,{catalogSlug:e.slug,url:"string"==typeof e.icon_url?e.icon_url:""}),(0,t.jsx)("h3",{children:e.display_name})]}),(0,t.jsxs)("p",{className:"small",children:[e.category," ·"," ","available"===e.release_status?"Release listed on marketplace":"Awaiting release"]}),(0,t.jsx)("p",{children:e.description}),"number"==typeof e.tool_count?(0,t.jsxs)("p",{className:"small",children:[e.tool_count," functions"]}):null,(0,t.jsx)("ul",{className:"my-3 list-inside list-disc text-sm",children:e.use_cases.map(e=>(0,t.jsx)("li",{children:e},e))}),(0,t.jsxs)("a",{className:"inline-flex min-h-11 items-center underline",href:e.url,target:"_blank",rel:"noreferrer",children:["Explore ",e.display_name," ↗"]})]},e.slug))})]})}function _({plugin:e,auth:n,onConnected:l}){let[c,u]=(0,r.useState)(`${e.slug} connection`),[d,p]=(0,r.useState)(""),[f,h]=(0,r.useState)(""),[g,m]=(0,r.useState)(""),[b,j]=(0,r.useState)(!1),[x,v]=(0,r.useState)(""),y=n.provider;if(!y)return null;let w=async()=>{j(!0),v("");try{if("oauth2"===n.type){let t=await s.U.credentials.beginOAuth.mutate({plugin:e.id,name:c,client_id:f,client_secret:g});m(""),location.assign(t.authorization_url);return}let t="github"===e.slug?"secret_token":"secret_apiKey",r=await s.U.credentials.create.mutate({name:c,provider:y,secret:{[t]:d}});p(""),await l(r.id)}catch(e){v((0,a.f)(e))}finally{j(!1)}};return(0,t.jsxs)("details",{className:"my-4 rounded-lg border p-4",children:[(0,t.jsxs)("summary",{children:["Connect ",n.label??e.slug]}),(0,t.jsxs)("label",{children:["Connection name",(0,t.jsx)(o.f,{value:c,onChange:e=>{u(e.target.value)},disabled:b})]}),"oauth2"===n.type?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{children:"Use your own OAuth application. Register this redirect URL:"}),(0,t.jsxs)("code",{className:"break-all",children:[location.origin,"/oauth/callback"]}),(0,t.jsxs)("label",{children:["Client ID",(0,t.jsx)(o.f,{value:f,onChange:e=>{h(e.target.value)},disabled:b})]}),(0,t.jsxs)("label",{children:["Client secret",(0,t.jsx)(o.f,{type:"password",autoComplete:"off",value:g,onChange:e=>{m(e.target.value)},disabled:b})]})]}):(0,t.jsxs)("label",{children:[n.label??"API token",(0,t.jsx)(o.f,{type:"password",autoComplete:"off",value:d,onChange:e=>{p(e.target.value)},disabled:b})]}),(0,t.jsx)(i.f,{type:"button",className:"mt-3",disabled:b||!c.trim()||("oauth2"===n.type?!f||!g:!d),onClick:()=>{w()},children:"Connect"}),x?(0,t.jsx)("p",{role:"alert",children:x}):null]})}var N=e.i(78688);function P({slug:e,metadata:n}){let{tools:s,isComplete:a}=(0,N.o)(n),[l,i]=(0,r.useState)(""),c=l.trim().toLowerCase().split(/\s+/).filter(Boolean),u=s.filter(e=>c.every(t=>`${e.name} ${e.description}`.toLowerCase().includes(t))),d=e.replaceAll(/-([a-z])/g,(e,t)=>t.toUpperCase());return(0,t.jsxs)("details",{className:"my-3 min-w-0 rounded-lg border p-3",children:[(0,t.jsxs)("summary",{children:["Capabilities · ",s.length," functions"]}),a?null:(0,t.jsx)("p",{className:"small",children:"Function information is incomplete for this release."}),s.length>0?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("label",{className:"my-3 block",children:["Find a function",(0,t.jsx)(o.f,{type:"search",value:l,onChange:e=>{i(e.target.value)},placeholder:"Search functions or descriptions"})]}),(0,t.jsxs)("p",{className:"small",role:"status",children:[u.length," of ",s.length," functions"]}),(0,t.jsx)("div",{className:"max-h-80 space-y-3 overflow-auto",children:u.map(e=>(0,t.jsxs)("details",{className:"min-w-0 rounded border p-3",children:[(0,t.jsx)("summary",{className:"break-words",children:(0,t.jsxs)("code",{children:[d,".",e.name]})}),(0,t.jsx)("p",{className:"small my-2",children:e.description}),(0,t.jsx)("dl",{className:"space-y-2 text-sm",children:e.parameters.map(e=>(0,t.jsxs)("div",{children:[(0,t.jsxs)("dt",{className:"break-words font-medium",children:[e.name,e.optional?" (optional)":"",":"," ",(0,t.jsx)("code",{children:e.type})]}),e.description?(0,t.jsx)("dd",{children:e.description}):null]},e.name))}),e.returnType?(0,t.jsxs)("p",{className:"small mt-2 break-words",children:["Returns: ",(0,t.jsx)("code",{children:e.returnType})]}):null]},e.name))}),0===u.length?(0,t.jsx)("p",{children:"No matching functions."}):null]}):(0,t.jsx)("p",{className:"small",children:"No functions are declared in this metadata."})]})}var O=e.i(85951),R=e.i(79258),A=e.i(56420);let M={name:"power",size:24,node:[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]]};M.node;let I=(0,A.f)(M);var E=e.i(19877),z=e.i(15080),U=e.i(59037),L=e.i(87309),T=e.i(94757),$=e.i(75016);let D=(0,n.default)(async()=>{let t=await e.A(96001);return t.configureMonaco(),t.default},{loadableGenerated:{modules:[160]},ssr:!1}),B='export const safeFunctions = [{\n name: "greet",\n handler: (name: string) => `Hello, ${name}!`\n}];',F=d.z.record(p.z.string(),E.z.json());async function q(e){let[t,n]=await Promise.all([(0,z.p)(e),(0,z._)(e)]);return{plugins:t,credentials:n}}async function W(e){return s.U.plugins.catalog.query(void 0,{signal:e})}function J({canManage:e,onDirtyChange:n}){let u=(0,l.f)(q),d=(0,l.f)(W),p=(d.data??[]).filter((e,t,n)=>n.findIndex(t=>t.slug===e.slug)===t),{selected:f,projects:h}=(0,T.useWorkspace)(),g=h.find(e=>e.id===f),m=(u.data?.plugins??[]).filter(e=>e.project===f),[b,j]=(0,r.useState)(""),[v,y]=(0,r.useState)(""),C=v.trim().toLowerCase().split(/\s+/).filter(Boolean),A=p.filter(e=>{let t=[e.display_name,e.description,e.category,...(0,N.o)(e.tools).tools.map(e=>`${e.name} ${e.description}`)].join(" ").toLowerCase();return C.every(e=>t.includes(e))}),[M,E]=(0,r.useState)(""),[z,G]=(0,r.useState)("1.0.0"),[H,K]=(0,r.useState)(""),[V,Q]=(0,r.useState)(B),[X,Y]=(0,r.useState)(""),[Z,ee]=(0,r.useState)("{}"),et=m.find(e=>e.id===b),en=et?.distribution==="external",er=(0,N.u)(et?.auth),[es,ea]=(0,r.useState)(!1),[el,ei]=(0,r.useState)(""),[eo,ec]=(0,r.useState)(""),eu=JSON.stringify({slug:M,version:z,description:H,source:V,credential:X,configuration:Z}),[ed,ep]=(0,r.useState)(JSON.stringify({slug:"",version:"1.0.0",description:"",source:B,credential:"",configuration:"{}"})),[ef,eh]=(0,r.useState)(!1),eg=eu!==ed,em=(0,L.h)();if((0,U.f)(eg||ef,n),!g)return(0,t.jsxs)("section",{className:"panel space-y-4",children:[(0,t.jsx)("h2",{children:"Project plugins"}),(0,t.jsx)("p",{children:"Create a project before installing and configuring its tools."}),(0,t.jsx)($.f,{href:"/projects/?new=1",children:"Create project"})]});let eb=e=>{let t={slug:e?.slug??"",version:e?.version??"1.0.0",description:e?.description??"",source:e?.source??B,credential:e?.credential??"",configuration:JSON.stringify(e?.configuration??{},null,2)};j(e?.id??""),E(t.slug),G(t.version),K(t.description),Q(t.source),Y(t.credential),ee(t.configuration),ep(JSON.stringify(t))},ej=async e=>{(!eg||await em())&&eb(e)},ex=async e=>{ea(!0),ei(""),ec("");try{await e(),await u.refresh()}catch(e){ei((0,a.f)(e))}finally{ea(!1)}};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(w,{project:f,plugins:m.filter(e=>"mcp"===e.distribution),canManage:e,onChanged:u.refresh,onDirtyChange:eh}),(0,t.jsxs)("section",{className:"panel",children:[(0,t.jsx)("h2",{children:"Plugin marketplace"}),(0,t.jsxs)("p",{children:["Install optional tools for ",g.name," from the external marketplace. This project owns its plugin configuration and credentials."]}),(0,t.jsxs)("p",{className:"small mt-3",children:["Project: ",(0,t.jsx)("strong",{children:g.name})]}),(0,t.jsx)(x.f,{...d}),(0,t.jsxs)("label",{className:"my-4 block",children:["Find plugins or capabilities",(0,t.jsx)(o.f,{type:"search",value:v,onChange:e=>{y(e.target.value)},placeholder:"Search plugins, functions or descriptions"})]}),d.isLoading||d.error||!(p.length>0)||0!==A.length?null:(0,t.jsx)("p",{children:"No plugins match this search."}),d.isLoading||d.error||d.data?.length!==0?null:(0,t.jsx)("p",{children:"No external releases are available from the configured marketplace. Your projects can run without plugins."}),(0,t.jsx)("div",{className:"grid gap-4 md:grid-cols-2",children:A.map(n=>{let r=m.find(e=>e.slug===n.slug);return(0,t.jsxs)("article",{className:"min-w-0 rounded-lg border p-4","aria-label":n.display_name,children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)(S.f,{catalogSlug:n.slug,url:(0,N.g)(n.marketplace)}),(0,t.jsx)("h3",{children:n.display_name})]}),(0,t.jsxs)("p",{className:"small",children:[n.category," · v",n.version]}),(0,t.jsx)("p",{children:n.description}),(0,t.jsx)(P,{slug:n.slug,metadata:n.tools}),(0,t.jsx)("p",{className:"small",children:n.package_url?"Downloadable package. The runner installs this pinned release for the selected project.":"Local package. Install this package on the selected project’s runner first using the executor CLI with --file. Saving its configuration here does not install the package."}),e&&r?.distribution==="external"&&r.digest!==n.digest?(0,t.jsx)(i.f,{variant:"outline",disabled:es,onClick:()=>{ex(async()=>{eg&&!await em()||(eb(await s.U.plugins.update.mutate({id:r.id,version:n.version,refresh_bundle:!0})),ec("Plugin updated for future runs. Older runs still require their original executor image."))})},children:"Update plugin"}):null,(0,t.jsxs)("details",{className:"my-3",children:[(0,t.jsx)("summary",{children:"Documentation"}),(0,t.jsx)("p",{className:"small",children:"Upstream reference documentation. Use the connection form below for this installation."}),(0,t.jsx)(O.f,{className:"max-h-80 overflow-auto",content:n.documentation})]}),r?(0,t.jsx)(i.f,{variant:"outline",onClick:()=>{ej(r)},children:"Configure"}):null,!r&&e?(0,t.jsx)(i.f,{disabled:es,onClick:()=>{ex(async()=>{eg&&!await em()||(eb(await s.U.plugins.create.mutate({project:f,slug:n.slug,version:n.version,distribution:"external",enabled:!0})),ec("Plugin enabled for the selected project. The runner downloads and verifies its package. Connect credentials if required."))})},children:"Enable plugin"}):null,r||e?null:(0,t.jsx)("p",{children:"Ask an administrator to enable this plugin."})]},n.slug)})})]}),(0,t.jsx)(k,{releases:d.data??[]}),(0,t.jsxs)("section",{className:"panel",children:[(0,t.jsx)(x.f,{...u}),(0,t.jsx)("div",{className:"panel-title",children:(0,t.jsxs)("h2",{children:[(0,t.jsx)(R.f,{size:18})," Installed plugins"]})}),u.isLoading||u.error||0!==m.length?void 0:(0,t.jsxs)("div",{className:"resource-empty",children:[(0,t.jsx)(R.f,{size:30}),(0,t.jsx)("h3",{children:"No plugins installed"}),(0,t.jsx)("p",{children:"Installed plugins will appear here. Ask your workspace administrator to provision reviewed tools."})]}),m.filter(e=>"mcp"!==e.distribution).map(n=>(0,t.jsxs)("div",{className:"resource-row",children:[(0,t.jsx)(S.f,{catalogSlug:"external"===n.distribution?n.slug:void 0,url:n.icon_url,size:24}),(0,t.jsxs)("div",{children:[(0,t.jsx)("strong",{children:"string"==typeof n.display_name?n.display_name:n.slug}),(0,t.jsxs)("small",{children:[g.name," · v",n.version," ·"," ",n.enabled?"Enabled":"Disabled"," ·"," ",n.description]})]}),(0,t.jsxs)("div",{className:"row",children:[(0,t.jsx)(i.f,{variant:"outline",size:"sm",onClick:()=>{ej(n)},children:"Inspect"}),e?(0,t.jsxs)(i.f,{variant:"ghost",size:"sm",disabled:es,onClick:()=>{ex(async()=>{await s.U.plugins.update.mutate({id:n.id,enabled:!n.enabled}),ec(n.enabled?"Plugin disabled for future runs.":"Plugin enabled.")})},children:[(0,t.jsx)(I,{size:13}),n.enabled?"Disable":"Enable"]}):void 0]})]},n.id))]}),b?(0,t.jsxs)("section",{className:"panel",children:[(0,t.jsxs)("h2",{children:["Plugin: ",M]}),et?.distribution==="external"?(0,t.jsx)(P,{slug:et.slug,metadata:et.tools}):null,(0,t.jsx)("p",{className:"small",children:en?"This plugin comes from an external release. Select a matching credential and configure it below.":"Changed source requires a new version. Existing runs keep their pinned plugin source."}),(0,t.jsxs)("form",{onSubmit:e=>{e.preventDefault(),ex(async()=>{let e={version:z,description:H,...en?{configuration:F.parse(JSON.parse(Z))}:{source:V},credential:X||null};await s.U.plugins.update.mutate({id:b,...e}),ep(eu),ec("Plugin saved for its project.")})},children:[(0,t.jsxs)("div",{className:"row",children:[(0,t.jsxs)("label",{children:["Plugin slug",(0,t.jsx)(o.f,{required:!0,value:M,disabled:!0,onChange:e=>{E(e.target.value)}})]}),(0,t.jsxs)("label",{children:["Plugin version",(0,t.jsx)(o.f,{required:!0,value:z,disabled:en||es||!e,onChange:e=>{G(e.target.value)}})]}),(0,t.jsxs)("label",{children:["Plugin credential",(0,t.jsxs)("select",{value:X,disabled:es||!e,onChange:e=>{Y(e.target.value)},children:[(0,t.jsx)("option",{value:"",children:"No credential"}),u.data?.credentials.filter(e=>!en||e.provider===er.provider).map(e=>(0,t.jsx)("option",{value:e.id,children:e.name},e.id))]})]})]}),(0,t.jsxs)("label",{children:["Description",(0,t.jsx)(o.f,{value:H,disabled:es||!e,onChange:e=>{K(e.target.value)}})]}),en?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{className:"small",children:er.hint??"No additional setup instructions."}),(0,t.jsx)("p",{children:(0,t.jsx)($.f,{href:"/credentials/",children:"Manage credentials"})}),(0,t.jsxs)("label",{children:["Configuration (JSON)",(0,t.jsx)(c.f,{value:Z,disabled:es||!e,onChange:e=>{ee(e.target.value)}})]})]}):(0,t.jsxs)("div",{className:"source-pane",children:[(0,t.jsxs)("div",{className:"source-toolbar",children:[(0,t.jsx)("span",{children:"plugin.ts"}),(0,t.jsx)("span",{children:"TypeScript safe-functions"})]}),(0,t.jsx)("div",{className:"desktop-editor",children:(0,t.jsx)(D,{actionId:`plugin-${b||"new"}`,value:V,onChange:Q,readOnly:es||!e})}),(0,t.jsx)("div",{className:"mobile-editor",children:(0,t.jsxs)("label",{children:["Plugin source",(0,t.jsx)(c.f,{className:"code",rows:12,value:V,readOnly:es||!e,onChange:e=>{Q(e.target.value)}})]})})]}),e?(0,t.jsx)(i.f,{type:"submit",className:"mt-4",disabled:es||!M.trim()||!z.trim(),children:"Save plugin"}):(0,t.jsx)("p",{className:"small",children:"Only owners and admins can update plugins."}),e&&b?(0,t.jsx)(i.f,{type:"button",variant:"outline",className:"ml-3 mt-4",disabled:es,onClick:()=>{ex(async()=>{await em({title:"Remove this plugin?",description:"Its tools will be removed from future project runs. Existing runs retain their pinned source.",actionLabel:"Remove plugin"})&&(await s.U.plugins.delete.mutate({id:b}),eb(),ec("Plugin removed."))})},children:"Remove plugin"}):void 0]}),en&&e&&!eg?(0,t.jsx)(_,{plugin:et,auth:er,onConnected:async e=>{try{let t=await s.U.plugins.update.mutate({id:et.id,credential:e});eb(t),ec("Credential connected for this project’s plugin.")}finally{await u.refresh()}}},et.id):null]}):void 0,el?(0,t.jsx)("p",{className:"error",role:"alert",children:el}):void 0,eo?(0,t.jsx)("p",{className:"notice",role:"status",children:eo}):void 0]})}e.s(["default",0,function(){let{canManage:e,setDirty:n,selected:r}=(0,T.useWorkspace)();return(0,t.jsx)(J,{canManage:e,onDirtyChange:n},r)}],33103)},93479,e=>{"use strict";var t=e.i(18050),n=e.i(71645),r=e.i(39689);let s=n.forwardRef(({className:e,type:n,...s},a)=>(0,t.jsx)("input",{type:n,className:(0,r.f)("flex h-9 w-full rounded-md border border-input bg-background px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:a,...s}));s.displayName="Input",e.s(["f",0,s])},24687,e=>{"use strict";var t=e.i(18050),n=e.i(71645),r=e.i(39689);let s=n.forwardRef(({className:e,...n},s)=>(0,t.jsx)("textarea",{className:(0,r.f)("flex min-h-[60px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:s,...n}));s.displayName="Textarea",e.s(["f",0,s])},23920,e=>{"use strict";var t=e.i(18050),n=e.i(5500),n=n,r=e.i(79258),s=e.i(71645);let a=new Map([["asana","/plugins/icons/asana.ico"],["browser","/plugins/icons/browser-cdp.png"],["browser-cdp","/plugins/icons/browser-cdp.png"],["data","/plugins/icons/data.svg"],["facebook","/plugins/icons/facebook.svg"],["github","/plugins/icons/github.svg"],["gmail","/plugins/icons/gmail.svg"],["google-drive","/plugins/icons/google-drive.svg"],["google-sheets","/plugins/icons/google-sheets.svg"],["google-tasks","/plugins/icons/google-tasks.svg"],["harvest","/plugins/icons/harvest.svg"],["linkedin","/plugins/icons/linkedin.png"],["llm","/plugins/icons/llm.svg"],["serper","/plugins/icons/serper.png"],["servicem8","/plugins/icons/servicem8.png"],["shippo","/plugins/icons/shippo.png"],["shopify","/plugins/icons/shopify.png"],["twitter","/plugins/icons/twitter.svg"],["xero","/plugins/icons/xero.svg"],["zendesk","/plugins/icons/zendesk.svg"]]);e.s(["f",0,function({url:e,catalogSlug:l="",size:i=32}){let o=a.get(l)??"",c=function(e){if(!e)return"";try{let t=new URL(e);return"https:"!==t.protocol||t.username||t.password?"":t.href}catch{return""}}(e),[u,d]=(0,s.useState)([]),p=[o&&c===`https://orgsdk.ai${o}`?o:c,o].find(e=>e.length>0&&!u.includes(e));return p?(0,t.jsx)(n.Image,{src:p,alt:"",width:i,height:i,unoptimized:!0,referrerPolicy:"no-referrer",className:"shrink-0 object-contain",onError:()=>{d(e=>[...e,p])}}):(0,t.jsx)(r.f,{size:i,className:"shrink-0","aria-hidden":"true"})}],23920)},59037,e=>{"use strict";var t=e.i(71645);e.s(["f",0,function(e,n){(0,t.useEffect)(()=>{n(e);let t=e=>{e.preventDefault()};return e&&addEventListener("beforeunload",t),()=>{removeEventListener("beforeunload",t),n(!1)}},[e,n])}])},78688,e=>{"use strict";function t(e){return null===e||"object"!=typeof e||Array.isArray(e)?{}:Object.fromEntries(Object.entries(e))}function n(e){return"string"==typeof e?e:""}e.s(["o",0,function(e){if(!Array.isArray(e))return{tools:[],isComplete:!1};let r=[],s=!0;for(let a of e){let e=t(a),l=n(e.name);if(!l){s=!1;continue}let i=[];if(Array.isArray(e.parameters))for(let r of e.parameters){let e=t(r);if(!n(e.name)){s=!1;continue}i.push({name:n(e.name),type:n(e.type),description:n(e.description),optional:!0===e.optional})}r.push({name:l,description:n(e.description),parameters:i,returnType:n(e.returnType)})}return{tools:r,isComplete:s}},"u",0,function(e){let n=t(e);return{..."string"==typeof n.type&&{type:n.type},..."string"==typeof n.provider&&{provider:n.provider},..."string"==typeof n.label&&{label:n.label},..."string"==typeof n.hint&&{hint:n.hint}}},"g",0,function(e){return n(t(e).icon_url)}])}]);
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,96001,l=>{l.v(t=>Promise.all(["static/chunks/0y5lgqdwpeabb.js"].map(t=>l.l(t))).then(()=>t(160)))},67426,l=>{l.v(t=>Promise.all(["static/chunks/2lxgam-nk-e9a.js"].map(t=>l.l(t))).then(()=>t(99279)))}]);
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,11241,e=>{"use strict";var s=e.i(56420);let t={name:"arrow-left",size:24,node:[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]};t.node;let i=(0,s.f)(t);e.s(["f",0,i],11241)},51757,e=>{"use strict";var s=e.i(56420);let t={name:"circle-check",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 9-5.5 5.5L8 12",key:"xofnsj"}]],aliases:["check-circle-2"]};t.node;let i=(0,s.f)(t);e.s(["f",0,i],51757)},62368,e=>{"use strict";var s=e.i(56420);let t={name:"download",size:24,node:[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]};t.node;let i=(0,s.f)(t);e.s(["f",0,i],62368)},95925,29272,e=>{"use strict";var s=e.i(56420);let t={name:"rotate-ccw",size:24,node:[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]};t.node;let i=(0,s.f)(t);e.s(["f",0,i],95925);let r={name:"square",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]};r.node;let a=(0,s.f)(r);e.s(["f",0,a],29272)},66595,e=>{"use strict";var s=e.i(56420);let t={name:"search",size:24,node:[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]};t.node;let i=(0,s.f)(t);e.s(["f",0,i],66595)},13581,29487,e=>{"use strict";var s=e.i(71645),t=e.i(95813);e.s(["f",0,function(e,i=0){let[r,a]=(0,s.useState)(),[n,l]=(0,s.useState)(""),[c,o]=(0,s.useState)(!0),d=(0,s.useRef)(void 0),u=(0,s.useRef)(!1),h=(0,s.useCallback)(async()=>{d.current?.abort();let s=new AbortController;d.current=s;try{let t=await e(s.signal);if(s.signal.aborted||!u.current)return;a(t),l("")}catch(e){!s.signal.aborted&&u.current&&l((0,t.f)(e))}finally{!s.signal.aborted&&u.current&&o(!1)}},[e]);return(0,s.useEffect)(()=>{u.current=!0,queueMicrotask(()=>{u.current&&h()});let e=i>0?setInterval(()=>{h()},i):void 0;return()=>{u.current=!1,d.current?.abort(),clearInterval(e)}},[h,i]),{data:r,error:n,isLoading:c,refresh:h}}],13581);var i=e.i(18050),r=e.i(19455);e.s(["f",0,function({isLoading:e,error:s,refresh:t}){return(0,i.jsxs)(i.Fragment,{children:[e?(0,i.jsx)("p",{role:"status",children:"Loading workspace data…"}):void 0,s?(0,i.jsxs)("div",{className:"error",role:"alert",children:[(0,i.jsx)("p",{children:s}),(0,i.jsx)(r.f,{variant:"outline",onClick:()=>{t()},children:"Try again"})]}):void 0]})}],29487)},3340,e=>{"use strict";var s=e.i(18050),t=e.i(18566),i=e.i(59140),r=e.i(66595),a=e.i(71645),n=e.i(73656),l=e.i(13581),c=e.i(15080),o=e.i(19455),d=e.i(93479),u=e.i(29487),h=e.i(10505),x=e.i(94757),p=e.i(36174);function j({projects:e,selected:t,onSelect:i,actionId:m=""}){let{selected:f}=(0,x.useWorkspace)(),v=(0,a.useCallback)(async e=>{let[s,t]=await Promise.all([(0,c.f)(e),m?n.U.actions.versions.query({id:m},{signal:e}):void 0]),i=new Set(t?.map(e=>e.id));return s.filter(e=>e.project===f&&(!m||null!==e.action_version&&i.has(e.action_version)))},[m,f]),g=(0,l.f)(v,5e3),[y,b]=(0,a.useState)(""),[k,w]=(0,a.useState)(""),[N,S]=(0,a.useState)(""),C=g.data?.filter(s=>s.project===f&&(!k||s.status===k)&&(!N||s.operation===N)&&`${(0,h.N)(s,e)} ${s.id}`.toLowerCase().includes(y.toLowerCase()))??[];return t&&!g.data?.some(e=>e.id===t)?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(u.f,{...g}),g.isLoading||g.error?null:(0,s.jsx)("p",{role:"alert",children:"This run is not available in this action or project."})]}):t?(0,s.jsx)(p.T,{id:t,projects:e,back:()=>{i("")},openRun:i},t):(0,s.jsxs)("section",{className:"panel",children:[(0,s.jsxs)("div",{className:"panel-title",children:[(0,s.jsx)("h2",{children:"Run history"}),(0,s.jsxs)("span",{className:"badge",children:[C.length," runs"]})]}),(0,s.jsxs)("p",{className:"small",children:["Project:"," ",e.find(e=>e.id===f)?.name??"Choose a project"]}),(0,s.jsxs)("div",{className:"resource-toolbar",children:[(0,s.jsxs)("label",{className:"search-field",children:[(0,s.jsx)(r.f,{size:15}),(0,s.jsx)(d.f,{"aria-label":"Search runs",placeholder:"Search by project or run ID…",value:y,onChange:e=>{b(e.target.value)}})]}),(0,s.jsxs)("select",{"aria-label":"Run status",value:k,onChange:e=>{w(e.target.value)},children:[(0,s.jsx)("option",{value:"",children:"All statuses"}),["queued","running","waiting_approval","succeeded","failed","cancelled","interrupted"].map(e=>(0,s.jsx)("option",{value:e,children:e.replaceAll("_"," ")},e))]}),(0,s.jsxs)("select",{"aria-label":"Run type",value:N,onChange:e=>{S(e.target.value)},children:[(0,s.jsx)("option",{value:"",children:"All work"}),(0,s.jsx)("option",{value:"action",children:"Actions"}),(0,s.jsx)("option",{value:"code",children:"Code execution"}),(0,s.jsx)("option",{value:"validate",children:"Code validation"}),(0,s.jsx)("option",{value:"test",children:"Action tests"}),(0,s.jsx)("option",{value:"chat",children:"Chat tasks"})]})]}),(0,s.jsx)(u.f,{...g}),g.isLoading||0!==C.length?void 0:(0,s.jsxs)("div",{className:"resource-empty",children:[(0,s.jsx)("h3",{children:"No matching runs"}),(0,s.jsx)("p",{children:"Execute code from an external client or run a saved action, then follow its progress here."})]}),(0,s.jsx)("div",{className:"table-wrap",children:(0,s.jsxs)("table",{children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{children:"Work"}),(0,s.jsx)("th",{children:"Status"}),(0,s.jsx)("th",{children:"Created"}),(0,s.jsx)("th",{})]})}),(0,s.jsx)("tbody",{children:C.map(t=>(0,s.jsxs)("tr",{children:[(0,s.jsxs)("td",{children:[(0,s.jsx)("strong",{children:(0,h.N)(t,e)}),(0,s.jsx)("small",{className:"block muted",children:t.id.slice(0,8)})]}),(0,s.jsx)("td",{children:(0,s.jsx)(h.k,{status:t.status})}),(0,s.jsx)("td",{children:new Date(t.created_at).toLocaleString()}),(0,s.jsx)("td",{children:(0,s.jsx)(o.f,{variant:"outline",size:"sm",onClick:()=>{i(t.id)},children:"View run"})})]},t.id))})]})})]})}e.s(["default",0,function(){let{projects:e,selected:r,navigateTo:a}=(0,x.useWorkspace)(),n=(0,t.useSearchParams)();return(0,s.jsx)(i.c,{current:"runs",children:t=>(0,s.jsx)(j,{projects:e,actionId:t,selected:n.get("run")??"",onSelect:e=>{let s=new URLSearchParams({project:r});t&&s.set("action",t),e&&s.set("run",e),a(`/runs/?${s.toString()}`)}},`${r}:${t}`)})}],3340)},93479,e=>{"use strict";var s=e.i(18050),t=e.i(71645),i=e.i(39689);let r=t.forwardRef(({className:e,type:t,...r},a)=>(0,s.jsx)("input",{type:t,className:(0,i.f)("flex h-9 w-full rounded-md border border-input bg-background px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:a,...r}));r.displayName="Input",e.s(["f",0,r])},24687,e=>{"use strict";var s=e.i(18050),t=e.i(71645),i=e.i(39689);let r=t.forwardRef(({className:e,...t},r)=>(0,s.jsx)("textarea",{className:(0,i.f)("flex min-h-[60px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...t}));r.displayName="Textarea",e.s(["f",0,r])},12102,e=>{"use strict";var s=e.i(40192),t=e.i(54105),i=e.i(19877),r=e.i(22219),r=r;let a=s.z.record(t.z.string(),i.z.json());e.s(["z",0,function(e){let s=JSON.parse(e);return r.array(a).min(1).max(50).parse(s)},"J",0,function(e){let s=JSON.parse(e);return a.parse(s)}],12102)},59140,e=>{"use strict";var s=e.i(18050),t=e.i(71645),i=e.i(18566),r=e.i(11241),a=e.i(73656),n=e.i(13581),l=e.i(94757),c=e.i(75016),o=e.i(29487);let d=[{id:"editor",label:"Code & configuration",path:"/actions/"},{id:"runs",label:"Runs",path:"/runs/"},{id:"schedules",label:"Schedule",path:"/schedules/"},{id:"webhooks",label:"Webhooks",path:"/webhooks/"}];function u({action:e,current:t}){let i=e.project,a=new URLSearchParams({project:i,action:e.id});return(0,s.jsxs)("div",{className:"mb-6 min-w-0 space-y-3",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,s.jsxs)(c.f,{className:"inline-flex items-center gap-1 text-sm",href:`/actions/?${new URLSearchParams({project:i}).toString()}`,children:[(0,s.jsx)(r.f,{size:14,"aria-hidden":"true"})," All actions"]}),(0,s.jsx)("span",{className:"text-slate-300","aria-hidden":"true",children:"/"}),(0,s.jsx)("strong",{className:"min-w-0 break-words",children:e.name})]}),(0,s.jsx)("nav",{className:"flex flex-wrap gap-2","aria-label":"Action sections",children:d.map(e=>(0,s.jsx)(c.f,{href:`${e.path}?${a.toString()}`,"aria-current":t===e.id?"page":void 0,className:t===e.id?"rounded-md bg-indigo-50 px-3 py-2 text-sm font-medium text-indigo-700":"rounded-md px-3 py-2 text-sm text-slate-600 hover:bg-slate-100",children:e.label},e.id))})]})}function h({project:e,actionId:i,current:r,children:l}){let d=(0,t.useCallback)(async s=>{if(!i)return;let t=await a.U.actions.get.query({id:i},{signal:s});if(t.project!==e)throw Error("This action is not available in the selected project.");return t},[i,e]),x=(0,n.f)(d);return i&&(x.isLoading||x.error||x.data?.id!==i)?(0,s.jsx)(o.f,{...x}):(0,s.jsxs)(s.Fragment,{children:[x.data?(0,s.jsx)(u,{action:x.data,current:r}):(0,s.jsx)("p",{className:"mb-5",children:(0,s.jsx)(c.f,{href:`/actions/?${new URLSearchParams({project:e}).toString()}`,children:"Back to project actions"})}),l(i)]})}e.s(["F",0,u,"c",0,function({current:e,children:t}){let{selected:r}=(0,l.useWorkspace)(),a=(0,i.useSearchParams)().get("action")??"";return(0,s.jsx)(h,{project:r,actionId:a,current:e,children:t},`${r}:${a}`)}])},44555,e=>{"use strict";var s=e.i(18050),t=e.i(56420);let i={name:"shield-check",size:24,node:[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]};i.node;let r=(0,t.f)(i);var a=e.i(71645),n=e.i(73656),l=e.i(95813),c=e.i(13581),o=e.i(15080),d=e.i(19455),u=e.i(29487);e.s(["f",0,function({runId:e,openRun:t}){let i=(0,c.f)(o.i,5e3),[h,x]=(0,a.useState)(""),[p,j]=(0,a.useState)(""),m=i.data?.filter(s=>"pending"===s.status&&(!e||s.run===e))??[],f=async(e,s)=>{x(e),j("");try{await n.U.approvals.decide.mutate({id:e,decision:s}),await i.refresh()}catch(e){j((0,l.f)(e))}finally{x("")}};return(0,s.jsxs)("section",{className:"panel",children:[(0,s.jsxs)("div",{className:"panel-title",children:[(0,s.jsxs)("h2",{children:[(0,s.jsx)(r,{size:18})," ",e?"Run approvals":"Approval queue"]}),(0,s.jsxs)("span",{className:"badge",children:[m.length," pending"]})]}),(0,s.jsx)(u.f,{...i}),p?(0,s.jsx)("p",{className:"error",role:"alert",children:p}):void 0,i.isLoading||0!==m.length?void 0:(0,s.jsxs)("div",{className:"resource-empty",children:[(0,s.jsx)(r,{size:28}),(0,s.jsx)("h3",{children:"All caught up"}),(0,s.jsx)("p",{children:"No decisions are waiting for you."})]}),m.map(e=>(0,s.jsxs)("article",{className:"approval-card",children:[(0,s.jsx)("span",{className:"eyebrow",children:"Human approval required"}),(0,s.jsx)("p",{className:"approval-prompt",children:e.prompt}),(0,s.jsxs)("div",{className:"row",children:[(0,s.jsx)(d.f,{disabled:!!h,onClick:()=>{f(e.id,"approved")},children:h===e.id?"Saving decision…":"Approve"}),(0,s.jsx)(d.f,{variant:"outline",disabled:!!h,onClick:()=>{f(e.id,"denied")},children:"Deny"}),t?(0,s.jsx)(d.f,{variant:"ghost",onClick:()=>{t(e.run)},children:"Inspect run"}):void 0]})]},e.id))]})}],44555)},36174,e=>{"use strict";var s=e.i(18050),t=e.i(11241),i=e.i(62368),r=e.i(95925),a=e.i(29272),n=e.i(71645),l=e.i(73656),c=e.i(95813),o=e.i(13581),d=e.i(15080),u=e.i(19455),h=e.i(85951),x=e.i(10505),p=e.i(29487),j=e.i(90409),m=e.i(59241),f=e.i(12102),v=e.i(75016),g=e.i(93479),y=e.i(24687);function b({id:e}){let[t,i]=(0,n.useState)(""),[r,a]=(0,n.useState)('{"type":"object"}'),[o,d]=(0,n.useState)("{}"),[h,x]=(0,n.useState)(!1),[p,j]=(0,n.useState)(""),[m,k]=(0,n.useState)(""),[w,N]=(0,n.useState)("");async function S(){x(!0),N(""),j("");try{let s=await l.U.runs.promote.mutate({id:e,name:t.trim(),input_schema:(0,f.J)(r),output_schema:(0,f.J)(o)});k(s.action),j(`Saved exact run source as version ${String(s.version.number)} of ${t.trim()} (action ${s.action}).`)}catch(e){N((0,c.f)(e))}finally{x(!1)}}return(0,s.jsxs)("details",{children:[(0,s.jsx)("summary",{children:"Promote accepted source to a saved action"}),(0,s.jsx)("p",{children:"The server copies this run’s exact source and SDK provenance. Run inputs remain examples and are not saved as defaults."}),(0,s.jsxs)("label",{children:["New action name",(0,s.jsx)(g.f,{value:t,disabled:h,onChange:e=>{i(e.target.value)}})]}),(0,s.jsxs)("label",{children:["Input schema (JSON)",(0,s.jsx)(y.f,{className:"code",value:r,disabled:h,onChange:e=>{a(e.target.value)}})]}),(0,s.jsxs)("label",{children:["Output schema (JSON)",(0,s.jsx)(y.f,{className:"code",value:o,disabled:h,onChange:e=>{d(e.target.value)}})]}),(0,s.jsx)(u.f,{disabled:h||!t.trim(),onClick:()=>{S()},children:"Promote exact source"}),w?(0,s.jsx)("p",{role:"alert",className:"error",children:w}):null,p?(0,s.jsx)("p",{role:"status",children:p}):null,m?(0,s.jsx)(v.f,{href:`/actions/?action=${encodeURIComponent(m)}`,children:"Open saved action"}):null]})}var k=e.i(44555);function w(e){let s=new Blob([e.content],{type:e.media_type}),t=URL.createObjectURL(s),i=document.createElement("a");i.href=t,i.download=e.name,i.click(),URL.revokeObjectURL(t)}function N({run:e,hasCheckReport:t}){return t?(0,s.jsx)(m.f,{output:e.output}):"succeeded"!==e.status?(0,s.jsx)("p",{children:x.B.includes(e.status)?"This run is still in progress. Its result will appear here.":`This run ${e.status}. Review the trace before retrying.`}):"chat"===e.operation?(0,s.jsx)(h.f,{content:(0,x.A)(e.output)}):(0,s.jsx)("pre",{children:(0,x.A)(e.output)||"Completed without output."})}let S={session:"Session result",test:"Mocked test results",validate:"Semantic validation diagnostics"};e.s(["T",0,function({id:e,projects:h,back:m,openRun:f}){let v=(0,j.f)(e),g=(0,o.f)(d.K),[y,C]=(0,n.useState)(!1),[A,z]=(0,n.useState)(""),_=v.data?.run,R=void 0!==_&&("test"===_.operation||"validate"===_.operation)&&null!==_.output&&"object"==typeof _.output&&Object.hasOwn(_.output,"result"),U=async s=>{C(!0),z("");try{if("cancel"===s)await l.U.runs.cancel.mutate({id:e});else{let s=await l.U.runs.retry.mutate({id:e,idempotency_key:crypto.randomUUID()});f(s.id)}await v.refresh()}catch(e){z((0,c.f)(e))}finally{C(!1)}};return(0,s.jsxs)("div",{className:"run-detail",children:[(0,s.jsxs)(u.f,{variant:"ghost",onClick:m,children:[(0,s.jsx)(t.f,{size:14})," All runs"]}),(0,s.jsx)(p.f,{...v}),A?(0,s.jsx)("p",{className:"error",role:"alert",children:A}):void 0,_?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("section",{className:"panel",children:[(0,s.jsxs)("div",{className:"panel-title",children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)("p",{className:"eyebrow",children:["RUN ",_.id.slice(0,8)]}),(0,s.jsxs)("h2",{children:[h.find(e=>e.id===_.project)?.name??"Project"," ","· ",(0,x.T)(_.operation)]})]}),(0,s.jsxs)("div",{className:"row",children:[(0,s.jsx)(x.k,{status:_.status}),x.B.includes(_.status)?(0,s.jsxs)(u.f,{variant:"outline",disabled:y||_.cancel_requested,onClick:()=>{U("cancel")},children:[(0,s.jsx)(a.f,{size:13}),_.cancel_requested?"Cancellation requested":"Cancel run"]}):void 0,["action","code","validate","test"].includes(_.operation)&&["failed","interrupted","cancelled"].includes(_.status)?(0,s.jsxs)(u.f,{variant:"outline",disabled:y,onClick:()=>{U("retry")},children:[(0,s.jsx)(r.f,{size:13})," Retry run"]}):void 0]})]}),(0,s.jsxs)("p",{className:"small",children:["Created ",new Date(_.created_at).toLocaleString()," · Updated"," ",new Date(_.updated_at).toLocaleString()]}),_.retry_of?(0,s.jsx)(u.f,{variant:"link",onClick:()=>{f(_.retry_of??"")},children:"View original run"}):void 0,_.error?(0,s.jsx)("div",{className:"error",role:"alert",children:_.error}):void 0,(0,s.jsxs)("dl",{children:[(0,s.jsx)("dt",{children:"Origin"}),(0,s.jsxs)("dd",{children:[_.origin," ",_.origin_reference]}),(0,s.jsx)("dt",{children:"Originating client"}),(0,s.jsx)("dd",{children:_.client_token??"No client token (historical attribution may be unknown)"}),(0,s.jsx)("dt",{children:"SDK revision"}),(0,s.jsx)("dd",{children:(0,x.A)(_.sdk_revision)||"Unknown"}),(0,s.jsx)("dt",{children:"Configuration revision"}),(0,s.jsx)("dd",{children:(0,x.A)(_.configuration_revision)||"Unknown"}),(0,s.jsx)("dt",{children:"Immutable action version"}),(0,s.jsx)("dd",{children:_.action_version??"One-off source / none"}),(0,s.jsx)("dt",{children:"Source digest"}),(0,s.jsx)("dd",{children:(0,x.A)(_.source_digest)||"Unknown"})]}),null===_.source?null:(0,s.jsxs)("details",{children:[(0,s.jsx)("summary",{children:"Accepted source"}),(0,s.jsx)("pre",{children:(0,x.A)(_.source)})]}),"code"===_.operation&&null!==_.source?(0,s.jsx)(b,{id:_.id},_.id):null,(0,s.jsx)("h3",{children:S[_.operation]??"Outcome"}),(0,s.jsx)(N,{run:_,hasCheckReport:R}),(0,s.jsxs)("details",{children:[(0,s.jsx)("summary",{children:"Run inputs"}),(0,s.jsx)("pre",{children:(0,x.A)(_.inputs)})]})]}),"waiting_approval"===_.status?(0,s.jsx)(k.f,{runId:e}):void 0,(0,s.jsxs)("section",{className:"panel",children:[(0,s.jsx)("h2",{children:"Artifacts"}),(0,s.jsx)(p.f,{...g}),g.data?.filter(s=>s.run===e).length===0?(0,s.jsx)("p",{className:"small",children:"No artifacts were saved by this run."}):void 0,g.data?.filter(s=>s.run===e).map(e=>(0,s.jsxs)("details",{children:[(0,s.jsx)("summary",{children:e.name}),(0,s.jsxs)(u.f,{variant:"outline",size:"sm",onClick:()=>{w(e)},children:[(0,s.jsx)(i.f,{size:13}),"Download"]}),(0,s.jsx)("pre",{children:e.content})]},e.id))]}),"session"===_.operation?null:(0,s.jsxs)("section",{className:"panel",children:[(0,s.jsx)("h2",{children:"Execution trace"}),v.data?.events.length===0?(0,s.jsx)("p",{className:"small",children:"Waiting for the first execution event."}):void 0,(0,s.jsx)("ol",{className:"run-timeline",children:v.data?.events.map(e=>(0,s.jsxs)("li",{children:[(0,s.jsx)("span",{className:"timeline-dot"}),(0,s.jsxs)("details",{children:[(0,s.jsxs)("summary",{children:[(0,s.jsx)("strong",{children:e.kind.replaceAll("."," ")}),(0,s.jsx)("time",{children:new Date(e.created_at).toLocaleTimeString()})]}),(0,s.jsx)("pre",{children:(0,x.A)(e.data)})]})]},e.sequence))})]})]}):void 0]})},"t",0,w],36174)},10505,79432,e=>{"use strict";var s=e.i(18050),t=e.i(56420);let i={name:"activity",size:24,node:[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]};i.node;let r=(0,t.f)(i);e.s(["f",0,r],79432);var a=e.i(51757);let n={name:"clock-3",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6h4",key:"135r8i"}]]};n.node;let l=(0,t.f)(n),c={name:"shield-exclamation-point",size:24,node:[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]],aliases:["shield-alert"]};c.node;let o=(0,t.f)(c),d={name:"circle-x",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],aliases:["x-circle"]};d.node;let u=(0,t.f)(d);function h(e){return({chat:"Chat task",code:"Code execution",session:"Execution session",action:"Action run",validate:"Code validation",test:"Action tests"})[e]??e.replaceAll("_"," ")}e.s(["k",0,function({status:e}){let t={succeeded:a.f,waiting_approval:o,running:r,queued:l,failed:u,cancelled:u,interrupted:u}[e]??l;return(0,s.jsxs)("span",{className:`run-status status-${e}`,children:[(0,s.jsx)(t,{size:13,"aria-hidden":"true"}),e.replaceAll("_"," ")]})},"B",0,["queued","running","waiting_approval"],"A",0,function(e){return void 0===e?"":"string"==typeof e?e:JSON.stringify(e,void 0,2)},"N",0,function(e,s){let t=s.find(s=>s.id===e.project)?.name??"Project";return"chat"===e.operation?`${t} \xb7 ${(function(e,s){if(null!==e&&"object"==typeof e&&Object.hasOwn(e,s)){let t=Reflect.get(e,s);if("string"==typeof t)return t}return""})(e.inputs,"message").slice(0,70)}`:`${t} \xb7 ${h(e.operation)}`},"T",0,h],10505)},90409,59241,e=>{"use strict";var s=e.i(71645),t=e.i(73656),i=e.i(13581);e.s(["f",0,function(e){let r=(0,s.useCallback)(async s=>{let[i,r]=await Promise.all([t.U.runs.get.query({id:e},{signal:s}),t.U.runs.events.query({id:e},{signal:s})]);return{run:i,events:r}},[e]),a=(0,i.f)(r,3e3),n=a.data?.run.id===e?a.data:void 0,l=void 0!==n,{refresh:c}=a;return(0,s.useEffect)(()=>{if(l)return function(e,s,i=t.U.runs.stream.subscribe){let r,a=!0,n=()=>{a&&!r&&(r=setTimeout(()=>{r=void 0,a&&s()},400))},l=i({id:e},{onData:n,onComplete(){a&&(clearTimeout(r),r=void 0,s())},onError:n});return()=>{a=!1,clearTimeout(r),l.unsubscribe()}}(e,c)},[e,l,c]),{...a,data:n}}],90409);var r=e.i(18050),a=e.i(10505);function n(e){return"object"!=typeof e||null===e||Array.isArray(e)?void 0:e}e.s(["f",0,function({output:e}){let s=n(e),t=n(s?.result)??s;if(!t)return null;let i=n(t.validation)??t,l=Array.isArray(i.diagnostics)?i.diagnostics:[],c=Array.isArray(t.cases)?t.cases:[];return(0,r.jsxs)("div",{children:["boolean"==typeof i.valid?(0,r.jsx)("p",{children:i.valid?"Source passed semantic validation.":"Source failed semantic validation."}):null,l.length>0?(0,r.jsx)("ul",{children:l.map((e,s)=>{let t=n(e);return(0,r.jsxs)("li",{children:["Line ",(0,a.A)(t?.line),", column"," ",(0,a.A)(t?.column),":"," ",(0,a.A)(t?.message)]},s)})}):null,c.length>0?(0,r.jsxs)("table",{children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{children:"Case"}),(0,r.jsx)("th",{children:"Result"}),(0,r.jsx)("th",{children:"Details"})]})}),(0,r.jsx)("tbody",{children:c.map((e,s)=>{let t=n(e);return(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,a.A)(t?.name)}),(0,r.jsx)("td",{children:t?.passed===!0?"Passed":"Failed"}),(0,r.jsxs)("td",{children:["string"==typeof t?.error&&""!==t.error?(0,r.jsx)("p",{children:t.error}):null,Array.isArray(t?.violations)?(0,r.jsx)("pre",{children:(0,a.A)(t.violations)}):null,(0,r.jsxs)("details",{children:[(0,r.jsx)("summary",{children:"Actual output and logs"}),(0,r.jsx)("pre",{children:(0,a.A)(t?.actual)}),(0,r.jsx)("pre",{children:(0,a.A)(t?.logs)})]})]})]},s)})})]}):null]})}],59241)}]);
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,11241,e=>{"use strict";var s=e.i(56420);let i={name:"arrow-left",size:24,node:[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]};i.node;let t=(0,s.f)(i);e.s(["f",0,t],11241)},51757,e=>{"use strict";var s=e.i(56420);let i={name:"circle-check",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 9-5.5 5.5L8 12",key:"xofnsj"}]],aliases:["check-circle-2"]};i.node;let t=(0,s.f)(i);e.s(["f",0,t],51757)},62368,e=>{"use strict";var s=e.i(56420);let i={name:"download",size:24,node:[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]};i.node;let t=(0,s.f)(i);e.s(["f",0,t],62368)},26091,e=>{"use strict";var s=e.i(56420);let i={name:"file-text",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]};i.node;let t=(0,s.f)(i);e.s(["f",0,t],26091)},95925,29272,e=>{"use strict";var s=e.i(56420);let i={name:"rotate-ccw",size:24,node:[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]};i.node;let t=(0,s.f)(i);e.s(["f",0,t],95925);let r={name:"square",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]};r.node;let a=(0,s.f)(r);e.s(["f",0,a],29272)},66595,e=>{"use strict";var s=e.i(56420);let i={name:"search",size:24,node:[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]};i.node;let t=(0,s.f)(i);e.s(["f",0,t],66595)},13581,29487,e=>{"use strict";var s=e.i(71645),i=e.i(95813);e.s(["f",0,function(e,t=0){let[r,a]=(0,s.useState)(),[n,l]=(0,s.useState)(""),[c,d]=(0,s.useState)(!0),o=(0,s.useRef)(void 0),u=(0,s.useRef)(!1),h=(0,s.useCallback)(async()=>{o.current?.abort();let s=new AbortController;o.current=s;try{let i=await e(s.signal);if(s.signal.aborted||!u.current)return;a(i),l("")}catch(e){!s.signal.aborted&&u.current&&l((0,i.f)(e))}finally{!s.signal.aborted&&u.current&&d(!1)}},[e]);return(0,s.useEffect)(()=>{u.current=!0,queueMicrotask(()=>{u.current&&h()});let e=t>0?setInterval(()=>{h()},t):void 0;return()=>{u.current=!1,o.current?.abort(),clearInterval(e)}},[h,t]),{data:r,error:n,isLoading:c,refresh:h}}],13581);var t=e.i(18050),r=e.i(19455);e.s(["f",0,function({isLoading:e,error:s,refresh:i}){return(0,t.jsxs)(t.Fragment,{children:[e?(0,t.jsx)("p",{role:"status",children:"Loading workspace data…"}):void 0,s?(0,t.jsxs)("div",{className:"error",role:"alert",children:[(0,t.jsx)("p",{children:s}),(0,t.jsx)(r.f,{variant:"outline",onClick:()=>{i()},children:"Try again"})]}):void 0]})}],29487)},39372,e=>{"use strict";var s=e.i(18050),i=e.i(62368),t=e.i(26091),r=e.i(66595),a=e.i(71645),n=e.i(13581),l=e.i(15080),c=e.i(19455),d=e.i(93479),o=e.i(85951),u=e.i(29487),h=e.i(36174);function p({openRun:e}){let x=(0,n.f)(l.K),[f,j]=(0,a.useState)(""),[m,v]=(0,a.useState)(""),y=x.data?.filter(e=>e.name.toLowerCase().includes(f.toLowerCase()))??[],g=x.data?.find(e=>e.id===m);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("section",{className:"panel",children:[(0,s.jsxs)("div",{className:"panel-title",children:[(0,s.jsx)("h2",{children:"Saved artifacts"}),(0,s.jsxs)("span",{className:"badge",children:[x.data?.length??0," files"]})]}),(0,s.jsx)("p",{className:"small",children:"Markdown, JSON and text produced by your projects and actions."}),(0,s.jsxs)("label",{className:"search-field",children:[(0,s.jsx)(r.f,{size:15}),(0,s.jsx)(d.f,{"aria-label":"Search artifacts",value:f,placeholder:"Search files…",onChange:e=>{j(e.target.value)}})]}),(0,s.jsx)(u.f,{...x}),x.isLoading||0!==y.length?void 0:(0,s.jsxs)("div",{className:"resource-empty",children:[(0,s.jsx)(t.f,{size:30}),(0,s.jsx)("h3",{children:"No artifacts found"}),(0,s.jsx)("p",{children:"Files saved during runs appear here."})]}),y.map(e=>(0,s.jsxs)("div",{className:"resource-row",children:[(0,s.jsx)(t.f,{size:18}),(0,s.jsxs)("div",{children:[(0,s.jsx)("strong",{children:e.name}),(0,s.jsxs)("small",{children:[e.media_type," · ",new Blob([e.content]).size," bytes"]})]}),(0,s.jsx)(c.f,{variant:"outline",size:"sm",onClick:()=>{v(e.id)},children:"Open"})]},e.id))]}),g?(0,s.jsxs)("section",{className:"panel",children:[(0,s.jsxs)("div",{className:"panel-title",children:[(0,s.jsx)("h2",{children:g.name}),(0,s.jsxs)("div",{className:"row",children:[(0,s.jsx)(c.f,{variant:"outline",onClick:()=>{e(g.run)},children:"View producing run"}),(0,s.jsxs)(c.f,{onClick:()=>{(0,h.t)(g)},children:[(0,s.jsx)(i.f,{size:14}),"Download"]})]})]}),g.media_type.includes("markdown")||g.name.endsWith(".md")?(0,s.jsx)(o.f,{content:g.content}):(0,s.jsx)("pre",{children:g.content})]}):void 0]})}var x=e.i(94757);e.s(["default",0,function(){let{openRun:e}=(0,x.useWorkspace)();return(0,s.jsx)(p,{openRun:e})}],39372)},93479,e=>{"use strict";var s=e.i(18050),i=e.i(71645),t=e.i(39689);let r=i.forwardRef(({className:e,type:i,...r},a)=>(0,s.jsx)("input",{type:i,className:(0,t.f)("flex h-9 w-full rounded-md border border-input bg-background px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:a,...r}));r.displayName="Input",e.s(["f",0,r])},24687,e=>{"use strict";var s=e.i(18050),i=e.i(71645),t=e.i(39689);let r=i.forwardRef(({className:e,...i},r)=>(0,s.jsx)("textarea",{className:(0,t.f)("flex min-h-[60px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...i}));r.displayName="Textarea",e.s(["f",0,r])},12102,e=>{"use strict";var s=e.i(40192),i=e.i(54105),t=e.i(19877),r=e.i(22219),r=r;let a=s.z.record(i.z.string(),t.z.json());e.s(["z",0,function(e){let s=JSON.parse(e);return r.array(a).min(1).max(50).parse(s)},"J",0,function(e){let s=JSON.parse(e);return a.parse(s)}],12102)},44555,e=>{"use strict";var s=e.i(18050),i=e.i(56420);let t={name:"shield-check",size:24,node:[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]};t.node;let r=(0,i.f)(t);var a=e.i(71645),n=e.i(73656),l=e.i(95813),c=e.i(13581),d=e.i(15080),o=e.i(19455),u=e.i(29487);e.s(["f",0,function({runId:e,openRun:i}){let t=(0,c.f)(d.i,5e3),[h,p]=(0,a.useState)(""),[x,f]=(0,a.useState)(""),j=t.data?.filter(s=>"pending"===s.status&&(!e||s.run===e))??[],m=async(e,s)=>{p(e),f("");try{await n.U.approvals.decide.mutate({id:e,decision:s}),await t.refresh()}catch(e){f((0,l.f)(e))}finally{p("")}};return(0,s.jsxs)("section",{className:"panel",children:[(0,s.jsxs)("div",{className:"panel-title",children:[(0,s.jsxs)("h2",{children:[(0,s.jsx)(r,{size:18})," ",e?"Run approvals":"Approval queue"]}),(0,s.jsxs)("span",{className:"badge",children:[j.length," pending"]})]}),(0,s.jsx)(u.f,{...t}),x?(0,s.jsx)("p",{className:"error",role:"alert",children:x}):void 0,t.isLoading||0!==j.length?void 0:(0,s.jsxs)("div",{className:"resource-empty",children:[(0,s.jsx)(r,{size:28}),(0,s.jsx)("h3",{children:"All caught up"}),(0,s.jsx)("p",{children:"No decisions are waiting for you."})]}),j.map(e=>(0,s.jsxs)("article",{className:"approval-card",children:[(0,s.jsx)("span",{className:"eyebrow",children:"Human approval required"}),(0,s.jsx)("p",{className:"approval-prompt",children:e.prompt}),(0,s.jsxs)("div",{className:"row",children:[(0,s.jsx)(o.f,{disabled:!!h,onClick:()=>{m(e.id,"approved")},children:h===e.id?"Saving decision…":"Approve"}),(0,s.jsx)(o.f,{variant:"outline",disabled:!!h,onClick:()=>{m(e.id,"denied")},children:"Deny"}),i?(0,s.jsx)(o.f,{variant:"ghost",onClick:()=>{i(e.run)},children:"Inspect run"}):void 0]})]},e.id))]})}],44555)},36174,e=>{"use strict";var s=e.i(18050),i=e.i(11241),t=e.i(62368),r=e.i(95925),a=e.i(29272),n=e.i(71645),l=e.i(73656),c=e.i(95813),d=e.i(13581),o=e.i(15080),u=e.i(19455),h=e.i(85951),p=e.i(10505),x=e.i(29487),f=e.i(90409),j=e.i(59241),m=e.i(12102),v=e.i(75016),y=e.i(93479),g=e.i(24687);function b({id:e}){let[i,t]=(0,n.useState)(""),[r,a]=(0,n.useState)('{"type":"object"}'),[d,o]=(0,n.useState)("{}"),[h,p]=(0,n.useState)(!1),[x,f]=(0,n.useState)(""),[j,k]=(0,n.useState)(""),[w,N]=(0,n.useState)("");async function A(){p(!0),N(""),f("");try{let s=await l.U.runs.promote.mutate({id:e,name:i.trim(),input_schema:(0,m.J)(r),output_schema:(0,m.J)(d)});k(s.action),f(`Saved exact run source as version ${String(s.version.number)} of ${i.trim()} (action ${s.action}).`)}catch(e){N((0,c.f)(e))}finally{p(!1)}}return(0,s.jsxs)("details",{children:[(0,s.jsx)("summary",{children:"Promote accepted source to a saved action"}),(0,s.jsx)("p",{children:"The server copies this run’s exact source and SDK provenance. Run inputs remain examples and are not saved as defaults."}),(0,s.jsxs)("label",{children:["New action name",(0,s.jsx)(y.f,{value:i,disabled:h,onChange:e=>{t(e.target.value)}})]}),(0,s.jsxs)("label",{children:["Input schema (JSON)",(0,s.jsx)(g.f,{className:"code",value:r,disabled:h,onChange:e=>{a(e.target.value)}})]}),(0,s.jsxs)("label",{children:["Output schema (JSON)",(0,s.jsx)(g.f,{className:"code",value:d,disabled:h,onChange:e=>{o(e.target.value)}})]}),(0,s.jsx)(u.f,{disabled:h||!i.trim(),onClick:()=>{A()},children:"Promote exact source"}),w?(0,s.jsx)("p",{role:"alert",className:"error",children:w}):null,x?(0,s.jsx)("p",{role:"status",children:x}):null,j?(0,s.jsx)(v.f,{href:`/actions/?action=${encodeURIComponent(j)}`,children:"Open saved action"}):null]})}var k=e.i(44555);function w(e){let s=new Blob([e.content],{type:e.media_type}),i=URL.createObjectURL(s),t=document.createElement("a");t.href=i,t.download=e.name,t.click(),URL.revokeObjectURL(i)}function N({run:e,hasCheckReport:i}){return i?(0,s.jsx)(j.f,{output:e.output}):"succeeded"!==e.status?(0,s.jsx)("p",{children:p.B.includes(e.status)?"This run is still in progress. Its result will appear here.":`This run ${e.status}. Review the trace before retrying.`}):"chat"===e.operation?(0,s.jsx)(h.f,{content:(0,p.A)(e.output)}):(0,s.jsx)("pre",{children:(0,p.A)(e.output)||"Completed without output."})}let A={session:"Session result",test:"Mocked test results",validate:"Semantic validation diagnostics"};e.s(["T",0,function({id:e,projects:h,back:j,openRun:m}){let v=(0,f.f)(e),y=(0,d.f)(o.K),[g,z]=(0,n.useState)(!1),[C,S]=(0,n.useState)(""),_=v.data?.run,O=void 0!==_&&("test"===_.operation||"validate"===_.operation)&&null!==_.output&&"object"==typeof _.output&&Object.hasOwn(_.output,"result"),R=async s=>{z(!0),S("");try{if("cancel"===s)await l.U.runs.cancel.mutate({id:e});else{let s=await l.U.runs.retry.mutate({id:e,idempotency_key:crypto.randomUUID()});m(s.id)}await v.refresh()}catch(e){S((0,c.f)(e))}finally{z(!1)}};return(0,s.jsxs)("div",{className:"run-detail",children:[(0,s.jsxs)(u.f,{variant:"ghost",onClick:j,children:[(0,s.jsx)(i.f,{size:14})," All runs"]}),(0,s.jsx)(x.f,{...v}),C?(0,s.jsx)("p",{className:"error",role:"alert",children:C}):void 0,_?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("section",{className:"panel",children:[(0,s.jsxs)("div",{className:"panel-title",children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)("p",{className:"eyebrow",children:["RUN ",_.id.slice(0,8)]}),(0,s.jsxs)("h2",{children:[h.find(e=>e.id===_.project)?.name??"Project"," ","· ",(0,p.T)(_.operation)]})]}),(0,s.jsxs)("div",{className:"row",children:[(0,s.jsx)(p.k,{status:_.status}),p.B.includes(_.status)?(0,s.jsxs)(u.f,{variant:"outline",disabled:g||_.cancel_requested,onClick:()=>{R("cancel")},children:[(0,s.jsx)(a.f,{size:13}),_.cancel_requested?"Cancellation requested":"Cancel run"]}):void 0,["action","code","validate","test"].includes(_.operation)&&["failed","interrupted","cancelled"].includes(_.status)?(0,s.jsxs)(u.f,{variant:"outline",disabled:g,onClick:()=>{R("retry")},children:[(0,s.jsx)(r.f,{size:13})," Retry run"]}):void 0]})]}),(0,s.jsxs)("p",{className:"small",children:["Created ",new Date(_.created_at).toLocaleString()," · Updated"," ",new Date(_.updated_at).toLocaleString()]}),_.retry_of?(0,s.jsx)(u.f,{variant:"link",onClick:()=>{m(_.retry_of??"")},children:"View original run"}):void 0,_.error?(0,s.jsx)("div",{className:"error",role:"alert",children:_.error}):void 0,(0,s.jsxs)("dl",{children:[(0,s.jsx)("dt",{children:"Origin"}),(0,s.jsxs)("dd",{children:[_.origin," ",_.origin_reference]}),(0,s.jsx)("dt",{children:"Originating client"}),(0,s.jsx)("dd",{children:_.client_token??"No client token (historical attribution may be unknown)"}),(0,s.jsx)("dt",{children:"SDK revision"}),(0,s.jsx)("dd",{children:(0,p.A)(_.sdk_revision)||"Unknown"}),(0,s.jsx)("dt",{children:"Configuration revision"}),(0,s.jsx)("dd",{children:(0,p.A)(_.configuration_revision)||"Unknown"}),(0,s.jsx)("dt",{children:"Immutable action version"}),(0,s.jsx)("dd",{children:_.action_version??"One-off source / none"}),(0,s.jsx)("dt",{children:"Source digest"}),(0,s.jsx)("dd",{children:(0,p.A)(_.source_digest)||"Unknown"})]}),null===_.source?null:(0,s.jsxs)("details",{children:[(0,s.jsx)("summary",{children:"Accepted source"}),(0,s.jsx)("pre",{children:(0,p.A)(_.source)})]}),"code"===_.operation&&null!==_.source?(0,s.jsx)(b,{id:_.id},_.id):null,(0,s.jsx)("h3",{children:A[_.operation]??"Outcome"}),(0,s.jsx)(N,{run:_,hasCheckReport:O}),(0,s.jsxs)("details",{children:[(0,s.jsx)("summary",{children:"Run inputs"}),(0,s.jsx)("pre",{children:(0,p.A)(_.inputs)})]})]}),"waiting_approval"===_.status?(0,s.jsx)(k.f,{runId:e}):void 0,(0,s.jsxs)("section",{className:"panel",children:[(0,s.jsx)("h2",{children:"Artifacts"}),(0,s.jsx)(x.f,{...y}),y.data?.filter(s=>s.run===e).length===0?(0,s.jsx)("p",{className:"small",children:"No artifacts were saved by this run."}):void 0,y.data?.filter(s=>s.run===e).map(e=>(0,s.jsxs)("details",{children:[(0,s.jsx)("summary",{children:e.name}),(0,s.jsxs)(u.f,{variant:"outline",size:"sm",onClick:()=>{w(e)},children:[(0,s.jsx)(t.f,{size:13}),"Download"]}),(0,s.jsx)("pre",{children:e.content})]},e.id))]}),"session"===_.operation?null:(0,s.jsxs)("section",{className:"panel",children:[(0,s.jsx)("h2",{children:"Execution trace"}),v.data?.events.length===0?(0,s.jsx)("p",{className:"small",children:"Waiting for the first execution event."}):void 0,(0,s.jsx)("ol",{className:"run-timeline",children:v.data?.events.map(e=>(0,s.jsxs)("li",{children:[(0,s.jsx)("span",{className:"timeline-dot"}),(0,s.jsxs)("details",{children:[(0,s.jsxs)("summary",{children:[(0,s.jsx)("strong",{children:e.kind.replaceAll("."," ")}),(0,s.jsx)("time",{children:new Date(e.created_at).toLocaleTimeString()})]}),(0,s.jsx)("pre",{children:(0,p.A)(e.data)})]})]},e.sequence))})]})]}):void 0]})},"t",0,w],36174)},10505,79432,e=>{"use strict";var s=e.i(18050),i=e.i(56420);let t={name:"activity",size:24,node:[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]};t.node;let r=(0,i.f)(t);e.s(["f",0,r],79432);var a=e.i(51757);let n={name:"clock-3",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6h4",key:"135r8i"}]]};n.node;let l=(0,i.f)(n),c={name:"shield-exclamation-point",size:24,node:[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]],aliases:["shield-alert"]};c.node;let d=(0,i.f)(c),o={name:"circle-x",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],aliases:["x-circle"]};o.node;let u=(0,i.f)(o);function h(e){return({chat:"Chat task",code:"Code execution",session:"Execution session",action:"Action run",validate:"Code validation",test:"Action tests"})[e]??e.replaceAll("_"," ")}e.s(["k",0,function({status:e}){let i={succeeded:a.f,waiting_approval:d,running:r,queued:l,failed:u,cancelled:u,interrupted:u}[e]??l;return(0,s.jsxs)("span",{className:`run-status status-${e}`,children:[(0,s.jsx)(i,{size:13,"aria-hidden":"true"}),e.replaceAll("_"," ")]})},"B",0,["queued","running","waiting_approval"],"A",0,function(e){return void 0===e?"":"string"==typeof e?e:JSON.stringify(e,void 0,2)},"N",0,function(e,s){let i=s.find(s=>s.id===e.project)?.name??"Project";return"chat"===e.operation?`${i} \xb7 ${(function(e,s){if(null!==e&&"object"==typeof e&&Object.hasOwn(e,s)){let i=Reflect.get(e,s);if("string"==typeof i)return i}return""})(e.inputs,"message").slice(0,70)}`:`${i} \xb7 ${h(e.operation)}`},"T",0,h],10505)},90409,59241,e=>{"use strict";var s=e.i(71645),i=e.i(73656),t=e.i(13581);e.s(["f",0,function(e){let r=(0,s.useCallback)(async s=>{let[t,r]=await Promise.all([i.U.runs.get.query({id:e},{signal:s}),i.U.runs.events.query({id:e},{signal:s})]);return{run:t,events:r}},[e]),a=(0,t.f)(r,3e3),n=a.data?.run.id===e?a.data:void 0,l=void 0!==n,{refresh:c}=a;return(0,s.useEffect)(()=>{if(l)return function(e,s,t=i.U.runs.stream.subscribe){let r,a=!0,n=()=>{a&&!r&&(r=setTimeout(()=>{r=void 0,a&&s()},400))},l=t({id:e},{onData:n,onComplete(){a&&(clearTimeout(r),r=void 0,s())},onError:n});return()=>{a=!1,clearTimeout(r),l.unsubscribe()}}(e,c)},[e,l,c]),{...a,data:n}}],90409);var r=e.i(18050),a=e.i(10505);function n(e){return"object"!=typeof e||null===e||Array.isArray(e)?void 0:e}e.s(["f",0,function({output:e}){let s=n(e),i=n(s?.result)??s;if(!i)return null;let t=n(i.validation)??i,l=Array.isArray(t.diagnostics)?t.diagnostics:[],c=Array.isArray(i.cases)?i.cases:[];return(0,r.jsxs)("div",{children:["boolean"==typeof t.valid?(0,r.jsx)("p",{children:t.valid?"Source passed semantic validation.":"Source failed semantic validation."}):null,l.length>0?(0,r.jsx)("ul",{children:l.map((e,s)=>{let i=n(e);return(0,r.jsxs)("li",{children:["Line ",(0,a.A)(i?.line),", column"," ",(0,a.A)(i?.column),":"," ",(0,a.A)(i?.message)]},s)})}):null,c.length>0?(0,r.jsxs)("table",{children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{children:"Case"}),(0,r.jsx)("th",{children:"Result"}),(0,r.jsx)("th",{children:"Details"})]})}),(0,r.jsx)("tbody",{children:c.map((e,s)=>{let i=n(e);return(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,a.A)(i?.name)}),(0,r.jsx)("td",{children:i?.passed===!0?"Passed":"Failed"}),(0,r.jsxs)("td",{children:["string"==typeof i?.error&&""!==i.error?(0,r.jsx)("p",{children:i.error}):null,Array.isArray(i?.violations)?(0,r.jsx)("pre",{children:(0,a.A)(i.violations)}):null,(0,r.jsxs)("details",{children:[(0,r.jsx)("summary",{children:"Actual output and logs"}),(0,r.jsx)("pre",{children:(0,a.A)(i?.actual)}),(0,r.jsx)("pre",{children:(0,a.A)(i?.logs)})]})]})]},s)})})]}):null]})}],59241)}]);
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,51757,e=>{"use strict";var t=e.i(56420);let s={name:"circle-check",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 9-5.5 5.5L8 12",key:"xofnsj"}]],aliases:["check-circle-2"]};s.node;let n=(0,t.f)(s);e.s(["f",0,n],51757)},59659,e=>{"use strict";var t=e.i(56420);let s={name:"trash",size:24,node:[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],aliases:["trash-2"]};s.node;let n=(0,t.f)(s);e.s(["f",0,n],59659)},13581,29487,e=>{"use strict";var t=e.i(71645),s=e.i(95813);e.s(["f",0,function(e,n=0){let[i,a]=(0,t.useState)(),[r,c]=(0,t.useState)(""),[o,l]=(0,t.useState)(!0),d=(0,t.useRef)(void 0),u=(0,t.useRef)(!1),h=(0,t.useCallback)(async()=>{d.current?.abort();let t=new AbortController;d.current=t;try{let s=await e(t.signal);if(t.signal.aborted||!u.current)return;a(s),c("")}catch(e){!t.signal.aborted&&u.current&&c((0,s.f)(e))}finally{!t.signal.aborted&&u.current&&l(!1)}},[e]);return(0,t.useEffect)(()=>{u.current=!0,queueMicrotask(()=>{u.current&&h()});let e=n>0?setInterval(()=>{h()},n):void 0;return()=>{u.current=!1,d.current?.abort(),clearInterval(e)}},[h,n]),{data:i,error:r,isLoading:o,refresh:h}}],13581);var n=e.i(18050),i=e.i(19455);e.s(["f",0,function({isLoading:e,error:t,refresh:s}){return(0,n.jsxs)(n.Fragment,{children:[e?(0,n.jsx)("p",{role:"status",children:"Loading workspace data…"}):void 0,t?(0,n.jsxs)("div",{className:"error",role:"alert",children:[(0,n.jsx)("p",{children:t}),(0,n.jsx)(i.f,{variant:"outline",onClick:()=>{s()},children:"Try again"})]}):void 0]})}],29487)},16271,e=>{"use strict";var t=e.i(18050),s=e.i(67965),n=e.i(56420);let i={name:"copy",size:24,node:[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]};i.node;let a=(0,n.f)(i);var r=e.i(58925);let c={name:"plug",size:24,node:[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z",key:"1xoxul"}],["path",{d:"M9 8V2",key:"14iosj"}]]};c.node;let o=(0,n.f)(c);var l=e.i(59659),d=e.i(71645),u=e.i(73656),h=e.i(95813),p=e.i(15080),j=e.i(13581),x=e.i(19455),v=e.i(93479),m=e.i(29487),f=e.i(87309),g=e.i(94757),k=e.i(59037),y=e.i(75016),b=e.i(10505);let C=[["catalog:read","Discover granted projects, actions and SDK"],["code:execute","Execute one-off code in selected projects"],["actions:write","Create and version actions in selected projects"],["actions:run","Execute granted saved actions"],["actions:test","Run isolated mocked action tests"],["runs:read","Inspect this client's own runs"],["runs:cancel","Cancel this client's own runs"]],w=C.map(([e])=>e),N=["catalog:read","actions:run","runs:read","runs:cancel"];async function _(e,t){let[s,n]=await Promise.all([(0,p.q)(e),(0,p.t)(e)]),i=await Promise.all(n.filter(e=>e.project===t).map(async t=>(await u.U.actions.versions.query({id:t.id},{signal:e})).map(e=>({...e,actionName:t.name,project:t.project}))));return{projects:s.filter(e=>e.id===t),versions:i.flat()}}function S(e,t,s){return s?[...e,t]:e.filter(e=>e!==t)}function M({canManage:e,navigate:n}){let{selected:i,projects:c,setDirty:P}=(0,g.useWorkspace)(),z=(0,j.f)(p.h),q=(0,d.useCallback)(e=>_(e,i),[i]),R=(0,j.f)(q),T=new Set(R.data?.versions.map(e=>e.id)),A=(z.data??[]).filter(e=>e.projects.includes(i)||e.action_versions.some(e=>T.has(e))),L=c.find(e=>e.id===i)?.name??"this project",[E,$]=(0,d.useState)(i?[i]:[]),[O,U]=(0,d.useState)([]),[D,V]=(0,d.useState)("projects"),B=(0,f.h)(),[H,I]=(0,d.useState)(""),[K,F]=(0,d.useState)(w),[G,J]=(0,d.useState)(""),[W,Y]=(0,d.useState)(!1),[Q,X]=(0,d.useState)(""),[Z,ee]=(0,d.useState)("");(0,k.f)(""!==H.trim()||""!==G,P);let et=async e=>{Y(!0),X(""),ee("");try{await e(),await z.refresh()}catch(e){X((0,h.f)(e))}finally{Y(!1)}};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("section",{className:"panel",children:[(0,t.jsxs)("h2",{children:[(0,t.jsx)(s.f,{size:18})," Connect an agent over MCP"]}),(0,t.jsxs)("p",{children:["Choose what your agent can do in ",L,", then add the MCP connection to its client. Your project controls the actions, plugins and workspace data available to it."]}),(0,t.jsxs)("div",{className:"my-4 flex flex-wrap gap-4 text-sm",children:[(0,t.jsx)(y.f,{href:`/projects/?${new URLSearchParams({project:i,tab:"access"}).toString()}`,children:"Review data access"}),(0,t.jsx)(y.f,{href:`/plugins/?${new URLSearchParams({project:i}).toString()}`,children:"Manage project plugins"})]}),(0,t.jsxs)("div",{className:"two-columns",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{children:"1. Create a scoped token"}),(0,t.jsx)("p",{className:"small",children:"Give each client its own token. Select only the access it needs, then save the token in that client."})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{children:"2. Configure your client"}),(0,t.jsxs)("p",{className:"small",children:["Use this workspace domain with the MCP endpoint ",(0,t.jsx)("code",{children:"/mcp/"}),", or the typed tRPC API at ",(0,t.jsx)("code",{children:"/trpc"}),". Send the token as"," ",(0,t.jsx)("code",{children:"Authorization: Bearer <token>"}),"."]}),(0,t.jsxs)(x.f,{variant:"outline",onClick:()=>{navigator.clipboard.writeText(`${location.origin}/mcp/`).then(()=>{ee("MCP endpoint copied.")}).catch(()=>{X("Could not copy. Use this workspace domain followed by /mcp/.")})},children:[(0,t.jsx)(a,{size:13}),"Copy MCP endpoint"]})]})]}),(0,t.jsx)("p",{className:"small",children:"Activity reflects requests observed locally since tracking began, not whether a client is online. Recently used means a request in the last seven days; inactive means no request in that window. Never used means no observed request, including tokens issued before tracking began."})]}),(0,t.jsxs)("section",{className:"panel",children:[(0,t.jsxs)("div",{className:"panel-title",children:[(0,t.jsxs)("h2",{children:["Clients with access to ",L]}),(0,t.jsx)(x.f,{variant:"outline",size:"sm",onClick:()=>{z.refresh()},children:"Refresh activity"})]}),(0,t.jsx)(m.f,{...z}),(0,t.jsx)(m.f,{...R}),z.data?(0,t.jsxs)("p",{className:"small",children:[A.filter(e=>!e.revoked&&e.request_count>0).length," ","current tokens used ·"," ",A.filter(e=>!e.revoked&&0===e.request_count).length," ","never observed · ",A.filter(e=>e.revoked).length," ","revoked"]}):void 0,z.isLoading||R.isLoading||z.error||R.error||0!==A.length?void 0:(0,t.jsx)("p",{children:"No clients have been granted access to this project yet."}),A.map(s=>(0,t.jsxs)("div",{className:"resource-row",children:[(0,t.jsx)(r.f,{size:17}),(0,t.jsxs)("div",{children:[(0,t.jsx)("strong",{children:s.name}),(0,t.jsxs)("small",{children:["Scoped client token · ",(0,b.A)(s.scopes)," ·"," ",s.activity_state.replaceAll("_"," ")]}),(0,t.jsxs)("small",{children:["Projects:"," ",s.projects.map(e=>R.data?.projects.find(t=>t.id===e)?.name??e).join(", ")||"None"]}),(0,t.jsxs)("small",{children:["Exact action versions:"," ",s.action_versions.map(e=>{let t=R.data?.versions.find(t=>t.id===e);return t?`${t.actionName} \xb7 version ${String(t.number)}`:e}).join(", ")||"None"]}),(0,t.jsxs)("small",{children:[s.request_count," requests · ",s.success_count," successful · ",s.error_count," errors · ",s.trpc_request_count," tRPC ·"," ",s.mcp_request_count," MCP"]}),(0,t.jsxs)("small",{children:["First observed:"," ",s.first_used_at?new Date(s.first_used_at).toLocaleString():"Never"," ","· Last observed:"," ",s.last_used_at?new Date(s.last_used_at).toLocaleString():"Never"]}),s.last_used_at?(0,t.jsxs)("small",{children:["Last outcome: ",s.last_outcome," · ",s.last_transport," · HTTP ",s.last_status_code]}):void 0]}),e&&!s.revoked?(0,t.jsxs)(x.f,{variant:"outline",size:"sm",disabled:W,onClick:()=>{et(async()=>{await B({title:"Revoke this client's access?",description:"The client will no longer be able to use this workspace with its token.",actionLabel:"Revoke token"})&&(await u.U.tokens.revoke.mutate({id:s.id}),ee("Client token revoked."))})},children:[(0,t.jsx)(l.f,{size:13}),"Revoke"]}):void 0]},s.id))]}),(0,t.jsx)("p",{className:"small",children:"Counts include requests with a valid token identity and current membership, including scope denials. Errors include HTTP failures and MCP protocol or tool errors, even with HTTP 200. Request bodies and secrets are not stored."}),e?(0,t.jsxs)("section",{className:"panel",children:[(0,t.jsx)("h2",{children:"Create access token"}),(0,t.jsxs)("form",{onSubmit:e=>{e.preventDefault(),et(async()=>{J((await u.U.tokens.create.mutate({name:H,scopes:K,projects:"projects"===D?E:[],action_versions:"versions"===D?O:[]})).token),I(""),ee("Token created. Copy it now; it will not be shown again.")})},children:[(0,t.jsxs)("label",{children:["Client name",(0,t.jsx)(v.f,{required:!0,value:H,disabled:W,onChange:e=>{I(e.target.value)},placeholder:"e.g. Local MCP client"})]}),(0,t.jsxs)("label",{children:["Permission preset",(0,t.jsxs)("select",{disabled:W,defaultValue:"author",onChange:e=>{let t="author"===e.target.value;F(t?w:N),V(t?"projects":"versions")},children:[(0,t.jsx)("option",{value:"author",children:"Authoring client — explore code, save and test actions"}),(0,t.jsx)("option",{value:"runner",children:"Action runner — execute selected saved versions"})]})]}),(0,t.jsxs)("fieldset",{children:[(0,t.jsx)("legend",{children:"Actual operations granted"}),C.map(([e,s])=>(0,t.jsxs)("label",{className:"check permission-option",children:[(0,t.jsx)(v.f,{type:"checkbox",checked:K.includes(e),disabled:W,onChange:t=>{F(s=>t.target.checked?[...s,e]:s.filter(t=>t!==e))}}),(0,t.jsxs)("span",{children:[s," ",(0,t.jsx)("code",{children:e})]})]},e))]}),(0,t.jsxs)("fieldset",{disabled:W,children:[(0,t.jsx)("legend",{children:"Resource grants"}),(0,t.jsxs)("label",{children:["Grant access to",(0,t.jsxs)("select",{value:D,onChange:e=>{V(e.target.value)},children:[(0,t.jsx)("option",{value:"projects",children:"Selected projects"}),(0,t.jsx)("option",{value:"versions",children:"Exact immutable action versions"})]})]}),(0,t.jsx)(m.f,{...R}),"projects"===D?R.data?.projects.map(e=>(0,t.jsxs)("label",{className:"check",children:[(0,t.jsx)("input",{type:"checkbox",checked:E.includes(e.id),onChange:t=>{$(s=>S(s,e.id,t.target.checked))}}),e.name]},e.id)):R.data?.versions.map(e=>(0,t.jsxs)("label",{className:"check",children:[(0,t.jsx)("input",{type:"checkbox",checked:O.includes(e.id),onChange:t=>{U(s=>S(s,e.id,t.target.checked))}}),e.actionName," · version ",e.number," ·"," ",R.data?.projects.find(t=>t.id===e.project)?.name]},e.id)),"versions"===D&&K.some(e=>["code:execute","actions:write"].includes(e))?(0,t.jsx)("p",{className:"error",children:"Code execution and action authoring require a project grant. Remove these operations or select projects."}):null,(0,t.jsx)("p",{className:"small",children:"Project grants include current and future actions in those projects. Exact-version grants permit only the versions selected here. Clients cannot manage plugins, credentials, grants or approvals. Existing keys retain their current authority until revoked."})]}),(0,t.jsx)(x.f,{type:"submit",disabled:W||!!G||0===K.length||("projects"===D?0===E.length:0===O.length||K.some(e=>["code:execute","actions:write"].includes(e))),children:"Create token"})]}),G?(0,t.jsxs)("div",{className:"issued-token",children:[(0,t.jsxs)("label",{children:["New access token",(0,t.jsx)(v.f,{type:"password",readOnly:!0,autoComplete:"off",value:G})]}),(0,t.jsxs)("p",{className:"small",children:["Configure your client’s HTTP MCP transport with this workspace’s"," ",(0,t.jsx)("code",{children:"/mcp/"})," endpoint and an"," ",(0,t.jsx)("code",{children:"Authorization: Bearer"})," header containing this token. Keep the token in the client’s secret configuration. OrgSDK does not require a model account."]}),(0,t.jsx)(x.f,{variant:"outline",onClick:()=>{navigator.clipboard.writeText(JSON.stringify({mcpServers:{orgsdk:{type:"http",url:`${location.origin}/mcp/`,headers:{Authorization:`Bearer ${G}`}}}},null,2)).then(()=>{ee("MCP configuration copied. Store it privately in your client configuration.")}).catch(()=>{X("Clipboard unavailable. Configure the endpoint and authorization header manually.")})},children:"Copy MCP configuration"}),(0,t.jsxs)(x.f,{variant:"outline",onClick:()=>{navigator.clipboard.writeText(G).then(()=>{ee("Token copied.")}).catch(()=>{X("Clipboard access failed. Select and copy the new token field.")})},children:[(0,t.jsx)(a,{size:13}),"Copy token"]}),(0,t.jsx)(x.f,{variant:"ghost",onClick:()=>{J("")},children:"Dismiss token"})]}):void 0]}):(0,t.jsx)("p",{className:"notice",children:"Only owners and admins can issue or revoke access tokens."}),(0,t.jsxs)("div",{className:"quick-grid",children:[(0,t.jsxs)("button",{className:"quick-action",onClick:()=>{n("credentials")},children:[(0,t.jsx)(r.f,{size:18}),(0,t.jsx)("strong",{children:"Credentials"}),(0,t.jsx)("span",{children:"Manage encrypted provider secrets."})]}),(0,t.jsxs)("button",{className:"quick-action",onClick:()=>{n("plugins")},children:[(0,t.jsx)(o,{size:18}),(0,t.jsx)("strong",{children:"Plugins"}),(0,t.jsx)("span",{children:"Install and configure your projects’ integrations."})]})]}),Q?(0,t.jsx)("p",{className:"error",role:"alert",children:Q}):void 0,Z?(0,t.jsx)("p",{className:"notice",role:"status",children:Z}):void 0]})}e.s(["default",0,function(){let{canManage:e,goTo:s,selected:n}=(0,g.useWorkspace)();return(0,t.jsx)(M,{canManage:e,navigate:s},n)}],16271)},93479,e=>{"use strict";var t=e.i(18050),s=e.i(71645),n=e.i(39689);let i=s.forwardRef(({className:e,type:s,...i},a)=>(0,t.jsx)("input",{type:s,className:(0,n.f)("flex h-9 w-full rounded-md border border-input bg-background px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:a,...i}));i.displayName="Input",e.s(["f",0,i])},10505,79432,e=>{"use strict";var t=e.i(18050),s=e.i(56420);let n={name:"activity",size:24,node:[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]};n.node;let i=(0,s.f)(n);e.s(["f",0,i],79432);var a=e.i(51757);let r={name:"clock-3",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6h4",key:"135r8i"}]]};r.node;let c=(0,s.f)(r),o={name:"shield-exclamation-point",size:24,node:[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]],aliases:["shield-alert"]};o.node;let l=(0,s.f)(o),d={name:"circle-x",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],aliases:["x-circle"]};d.node;let u=(0,s.f)(d);function h(e){return({chat:"Chat task",code:"Code execution",session:"Execution session",action:"Action run",validate:"Code validation",test:"Action tests"})[e]??e.replaceAll("_"," ")}e.s(["k",0,function({status:e}){let s={succeeded:a.f,waiting_approval:l,running:i,queued:c,failed:u,cancelled:u,interrupted:u}[e]??c;return(0,t.jsxs)("span",{className:`run-status status-${e}`,children:[(0,t.jsx)(s,{size:13,"aria-hidden":"true"}),e.replaceAll("_"," ")]})},"B",0,["queued","running","waiting_approval"],"A",0,function(e){return void 0===e?"":"string"==typeof e?e:JSON.stringify(e,void 0,2)},"N",0,function(e,t){let s=t.find(t=>t.id===e.project)?.name??"Project";return"chat"===e.operation?`${s} \xb7 ${(function(e,t){if(null!==e&&"object"==typeof e&&Object.hasOwn(e,t)){let s=Reflect.get(e,t);if("string"==typeof s)return s}return""})(e.inputs,"message").slice(0,70)}`:`${s} \xb7 ${h(e.operation)}`},"T",0,h],10505)},59037,e=>{"use strict";var t=e.i(71645);e.s(["f",0,function(e,s){(0,t.useEffect)(()=>{s(e);let t=e=>{e.preventDefault()};return e&&addEventListener("beforeunload",t),()=>{removeEventListener("beforeunload",t),s(!1)}},[e,s])}])}]);
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,43776,e=>{"use strict";var s=e.i(18050),a=e.i(18566),t=e.i(19455),i=e.i(93479),n=e.i(24687),l=e.i(67489),r=e.i(69212),c=e.i(59037),o=e.i(90350),d=e.i(31084),u=e.i(94757),h=e.i(71645),m=e.i(12102);e.i(44362);var p=e.i(42765),p=p,x=e.i(22219),x=x,j=x,f=e.i(73656),v=e.i(95813),g=e.i(90409),b=e.i(59241),y=e.i(10505);function N({id:e}){let a=(0,g.f)(e);return(0,s.jsxs)("div",{"aria-live":"polite",children:[a.error?(0,s.jsx)("p",{role:"alert",children:a.error}):null,a.data?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("p",{children:["test"===a.data.run.operation?"Mocked tests":"Semantic validation"," ",(0,s.jsx)(y.k,{status:a.data.run.status})]}),a.data.run.error?(0,s.jsx)("p",{role:"alert",children:a.data.run.error}):null,(0,s.jsx)(b.f,{output:a.data.run.output})]}):(0,s.jsx)("p",{children:"Loading check…"})]})}function w({project:e,action:a,version:i,source:l,inputSchema:r,outputSchema:c,dirty:o,onDirtyChange:d}){let[u,g]=(0,h.useState)('[\n {"name":"example", "inputs":{}, "expected":null, "mocks":[], "forbidden_calls":[]}\n]'),[b,y]=(0,h.useState)(""),[S,k]=(0,h.useState)(),[C,$]=(0,h.useState)(!!i),[z,A]=(0,h.useState)(!1),[_,U]=(0,h.useState)(""),[T,R]=(0,h.useState)("");async function P(s){A(!0),U("");try{if("validate"===s){let s=await f.U.actions.validateCode.mutate({project:e,source:l,input_schema:(0,m.J)(r),output_schema:(0,m.J)(c),idempotency_key:crypto.randomUUID()});R(s.id);return}if(!a||!i||o)throw Error("Save the source version before editing or running its tests.");if("save"===s){let e=await f.U.actions.saveTests.mutate({id:a.id,version:i.number,cases:(0,m.z)(u)});k(e.revision),y(u),d(!1);return}if(void 0===S||u!==b)throw Error("Save the test suite before running it.");let t=await f.U.actions.runTests.mutate({id:a.id,version:i.number,suite_revision:S,idempotency_key:crypto.randomUUID()});R(t.id)}catch(e){U((0,v.f)(e))}finally{A(!1)}}return(0,h.useEffect)(()=>{if(!a||!i)return;let e=new AbortController;return(async()=>{try{let s=await f.U.actions.tests.query({id:a.id,version:i.number},{signal:e.signal});if(e.signal.aborted)return;let t=JSON.stringify(s.cases,null,2);g(t),y(t),k(s.revision)}catch(a){let s;e.signal.aborted||(s=a instanceof p.t?a.data:void 0,x.object({code:j.literal("NOT_FOUND")}).safeParse(s).success)||U((0,v.f)(a))}finally{e.signal.aborted||$(!1)}})(),()=>{e.abort()}},[a,i]),(0,s.jsxs)("section",{className:"panel","aria-label":"Validation and mocked tests",children:[(0,s.jsx)("h3",{children:"Validation and mocked tests"}),(0,s.jsx)(t.f,{variant:"outline",disabled:z||!e||!l.trim(),onClick:()=>{P("validate")},children:"Validate source"}),(0,s.jsx)("p",{className:"small",children:"Semantic validation checks this editor’s source and both contracts against the project SDK. It executes no integrations."}),i?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("h4",{children:["Version ",i.number," ·"," ",void 0===S?"No saved test suite":`Test suite revision ${String(S)}`]}),(0,s.jsx)("p",{className:"small",children:"Mocked tests run in isolation without network, project files or live credentials. Mocks declare expected calls; unexpected calls fail."}),(0,s.jsxs)("label",{children:["Test cases (JSON)",(0,s.jsx)(n.f,{className:"code",rows:12,value:u,disabled:C||z||o,onChange:e=>{g(e.target.value),d(e.target.value!==b)}})]}),(0,s.jsxs)("div",{className:"row",children:[(0,s.jsx)(t.f,{variant:"outline",disabled:C||z||o,onClick:()=>{P("save")},children:"Save test suite revision"}),(0,s.jsx)(t.f,{disabled:C||z||o||void 0===S||u!==b,onClick:()=>{P("test")},children:"Run mocked tests"})]}),o?(0,s.jsx)("p",{children:"Save a new source version before saving its tests."}):null]}):(0,s.jsx)("p",{children:"Save a source version to add mocked regression tests."}),_?(0,s.jsx)("p",{className:"error",role:"alert",children:_}):null,T?(0,s.jsx)(N,{id:T},T):null]})}var S=e.i(18879);function k({action:e,isBusy:a,save:n}){return(0,s.jsxs)("details",{className:"panel",children:[(0,s.jsx)("summary",{children:"Action settings"}),(0,s.jsxs)("form",{className:"mt-4",onSubmit:e=>{e.preventDefault();let s=new FormData(e.currentTarget);n({name:(0,S.f)(s,"name"),description:(0,S.f)(s,"description"),enabled:s.has("enabled")})},children:[(0,s.jsxs)("label",{children:["Action name",(0,s.jsx)(i.f,{name:"name",required:!0,defaultValue:e.name,disabled:a})]}),(0,s.jsxs)("label",{children:["Description",(0,s.jsx)(i.f,{name:"description",defaultValue:e.description,disabled:a})]}),(0,s.jsxs)("label",{className:"check",children:[(0,s.jsx)("input",{name:"enabled",type:"checkbox",defaultChecked:e.enabled,disabled:a}),"Enabled for new runs"]}),(0,s.jsx)("p",{className:"small",children:"Disable an action to prevent new runs while preserving its saved versions and run history."}),(0,s.jsx)("div",{className:"row",children:(0,s.jsx)(t.f,{type:"submit",disabled:a,children:"Save action settings"})})]})]})}var C=e.i(87309),$=e.i(70703),z=e.i(56420);let A={name:"braces",size:24,node:[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]],aliases:["curly-braces"]};A.node;let _=(0,z.f)(A);var U=e.i(6501),T=e.i(52330);let R={name:"maximize-2",size:24,node:[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]]};R.node;let P=(0,z.f)(R),O={name:"minimize-2",size:24,node:[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]]};O.node;let D=(0,z.f)(O);var M=e.i(21357),L=e.i(77071);let I={name:"save",size:24,node:[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]};I.node;let J=(0,z.f)(I);var V=e.i(15080),B=e.i(13581),E=e.i(26495),E=E,q=e.i(79258),F=e.i(66595),K=e.i(29487),H=e.i(78688),W=e.i(75016),G=e.i(23920);async function Y(s){let a,t=await (0,V.p)(s);t.some(e=>"inline"===e.distribution)&&(a=(await e.A(67426)).inspectInlinePlugin);let i=new Map;for(let e of t)i.set(e.id,"inline"===e.distribution?a?.(e.source)??{tools:[],isComplete:!1}:(0,H.o)(e.tools));return{plugins:t,tools:i}}function Q({project:e}){let a=(0,B.f)(Y),[t,n]=(0,h.useState)(""),l=a.data?.plugins.filter(s=>s.project===e?.id)??[],r=l.map(e=>{let s=a.data?.tools.get(e.id)??{tools:[],isComplete:!1},i=s.tools,n="string"==typeof e.display_name?e.display_name:e.slug,l=t.trim().toLowerCase(),r=`${n} ${e.description}`.toLowerCase().includes(l);return{plugin:e,name:n,isComplete:s.isComplete,totalTools:i.length,tools:r?i:i.filter(e=>`${e.name} ${e.description}`.toLowerCase().includes(l)),visible:r||i.some(e=>`${e.name} ${e.description}`.toLowerCase().includes(l))}}).filter(e=>e.visible);return(0,s.jsxs)("section",{className:"action-plugin-panel action-card","aria-label":"Action plugins",children:[(0,s.jsxs)("div",{className:"action-panel-heading",children:[(0,s.jsxs)("h3",{children:["Plugins ",(0,s.jsx)("span",{className:"count",children:l.length})]}),(0,s.jsxs)(W.f,{className:"action-text-link",href:`/plugins/?project=${encodeURIComponent(e?.id??"")}`,children:[(0,s.jsx)(L.f,{size:14})," ",l.length>0?"Manage":"Add plugin"]})]}),l.length>0?(0,s.jsxs)("label",{className:"search-field",children:[(0,s.jsx)(F.f,{size:15,"aria-hidden":"true"}),(0,s.jsx)(i.f,{"aria-label":"Search plugins or tools",placeholder:"Search plugins or tools…",value:t,onChange:e=>{n(e.target.value)}})]}):null,(0,s.jsx)("p",{className:"small action-panel-caption",children:e?`Available to ${e.name}`:"Choose a project to see its plugins."}),(0,s.jsx)(K.f,{...a}),a.isLoading||a.error||0!==r.length?null:(0,s.jsxs)("div",{className:"action-empty action-plugin-empty",children:[(0,s.jsx)("span",{className:"plugin-empty-symbol",children:(0,s.jsx)(q.f,{size:28})}),(0,s.jsx)("h4",{children:t?"No matching tools":"Add tools to your action"}),(0,s.jsx)("p",{children:t?"Try another plugin or tool name.":"Explore the marketplace, then assign plugins to this action’s project to use them in your workflow."}),t?null:(0,s.jsxs)(W.f,{className:"button plugin-marketplace-button",href:"/plugins/",children:[(0,s.jsx)(L.f,{size:15})," Browse marketplace"]})]}),(0,s.jsx)("div",{className:"action-plugin-list",hidden:0===r.length,children:r.map(({plugin:e,name:a,tools:i,isComplete:n,totalTools:l})=>{var r;return(0,s.jsxs)("details",{className:"action-plugin",open:!0,children:[(0,s.jsxs)("summary",{children:[(0,s.jsx)(E.f,{className:"plugin-chevron",size:16}),(0,s.jsx)("span",{className:`plugin-symbol plugin-symbol-${e.slug}`,children:(0,s.jsx)(G.f,{catalogSlug:"external"===e.distribution?e.slug:void 0,url:e.icon_url,size:23})}),(0,s.jsxs)("span",{className:"plugin-name",children:[(0,s.jsx)("strong",{children:a}),(0,s.jsx)("small",{children:`${String(l)} ${1===l?"function":"functions"}${!n&&"inline"===e.distribution?" declared":""}`})]}),(0,s.jsxs)("span",{className:`plugin-state ${e.enabled?"is-enabled":""}`,children:[(0,s.jsx)("i",{}),e.enabled?"Enabled":"Disabled"]})]}),i.length>0?(0,s.jsx)("ul",{className:"plugin-tools",children:i.map(e=>(0,s.jsxs)("li",{title:e.description,children:[(0,s.jsx)(_,{size:14}),(0,s.jsxs)("div",{children:[(0,s.jsx)("strong",{children:e.name}),e.description?(0,s.jsx)("p",{className:"small",children:e.description}):null,e.parameters.length>0?(0,s.jsxs)("p",{className:"small",children:["Parameters:"," ",e.parameters.map(e=>`${e.name}${e.optional?"?":""}${e.type?`: ${e.type}`:""}${e.description?` — ${e.description}`:""}`).join("; ")]}):null,e.returnType?(0,s.jsxs)("p",{className:"small",children:["Returns: ",e.returnType]}):null]})]},e.name))}):(0,s.jsx)("p",{className:"small plugin-tool-note",children:(r="inline"===e.distribution,n?"This plugin declares no tools.":r?"Tool definitions are dynamic or could not be read. Their names cannot be listed without running the plugin.":"This installed release does not include tool information.")}),!n&&i.length>0?(0,s.jsx)("p",{className:"small plugin-tool-note",children:"inline"===e.distribution?"Showing statically declared tools. Additional dynamic definitions cannot be listed without running the plugin.":"Showing available tool information. This installed release includes incomplete metadata."}):null]},`${e.id}-${t}`)})}),l.length>0?(0,s.jsx)(W.f,{className:"action-catalog-link",href:"/plugins/",children:"Browse plugin marketplace →"}):null]})}var X=e.i(75775),Z=e.i(62368);let ee={name:"file-braces",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1",key:"1oajmo"}],["path",{d:"M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1",key:"mpwhp6"}]],aliases:["file-json"]};ee.node;let es=(0,z.f)(ee);var ea=e.i(26091),et=e.i(94508);let ei={name:"terminal",size:24,node:[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]};ei.node;let en=(0,z.f)(ei);var el=e.i(36174);function er({runs:e,selectedId:a,onSelect:t,compact:i=!1}){return 0===e.length?(0,s.jsxs)("div",{className:"action-empty",children:[(0,s.jsx)(en,{size:24}),(0,s.jsx)("p",{children:"No runs yet. Save and run this action to see its activity."})]}):(0,s.jsx)("div",{className:"action-run-table",children:(0,s.jsxs)("table",{children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{children:"Run"}),(0,s.jsx)("th",{children:"Status"}),(0,s.jsx)("th",{children:"Created"})]})}),(0,s.jsx)("tbody",{children:(i?e.slice(0,5):e).map(e=>(0,s.jsxs)("tr",{className:a===e.id?"is-selected":"",children:[(0,s.jsx)("td",{children:(0,s.jsxs)("button",{type:"button",className:"action-run-link","aria-label":`Inspect run ${e.id.slice(0,8)}`,"aria-pressed":a===e.id,onClick:()=>{t(e.id)},children:["#",e.id.slice(0,8)]})}),(0,s.jsx)("td",{children:(0,s.jsx)(y.k,{status:e.status})}),(0,s.jsx)("td",{children:(0,s.jsxs)("time",{dateTime:e.created_at,title:new Date(e.created_at).toLocaleString(),children:[new Date(e.created_at).toLocaleDateString(void 0,{month:"short",day:"numeric"}),(0,s.jsx)("small",{children:new Date(e.created_at).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})})]})})]},e.id))})]})})}function ec({run:e}){let a=(0,h.useCallback)(async s=>(await (0,V.K)(s)).filter(s=>s.run===e.id),[e.id]),i=(0,B.f)(a,5e3*!!y.B.includes(e.status));return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(K.f,{...i}),i.data?.length===0?(0,s.jsxs)("div",{className:"action-empty",children:[(0,s.jsx)(et.f,{size:24}),(0,s.jsx)("p",{children:"No artifacts saved by this run."}),(0,s.jsx)("span",{children:"Files created by the action will appear here."})]}):null,(0,s.jsx)("div",{className:"action-artifact-grid",children:i.data?.map(e=>{let a=e.media_type.includes("json")?es:ea.f;return(0,s.jsxs)("article",{className:"action-artifact",children:[(0,s.jsxs)("header",{children:[(0,s.jsx)("span",{className:"artifact-symbol",children:(0,s.jsx)(a,{size:20})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("strong",{title:e.name,children:e.name}),(0,s.jsxs)("small",{children:[e.media_type," ·"," ",new Blob([e.content]).size.toLocaleString()," B"]})]}),(0,s.jsx)(t.f,{variant:"ghost",size:"icon","aria-label":`Download ${e.name}`,onClick:()=>{(0,el.t)(e)},children:(0,s.jsx)(Z.f,{size:15})})]}),(0,s.jsxs)("details",{children:[(0,s.jsx)("summary",{children:"Preview file"}),(0,s.jsx)("pre",{children:e.content})]}),(0,s.jsx)("pre",{className:"artifact-excerpt","aria-hidden":"true",children:e.content.slice(0,450)})]},e.id)})})]})}function eo({run:e}){let a=(0,h.useCallback)(async s=>f.U.runs.events.query({id:e.id},{signal:s}),[e.id]),t=(0,B.f)(a,3e3*!!y.B.includes(e.status));return(0,s.jsxs)("div",{className:"action-logs",children:[(0,s.jsx)(K.f,{...t}),e.error?(0,s.jsx)("p",{className:"error",role:"alert",children:e.error}):null,t.data?.length===0?(0,s.jsx)("p",{className:"small",children:"No execution events yet."}):null,t.data?.map(e=>(0,s.jsxs)("div",{className:"action-log-line",children:[(0,s.jsx)("time",{children:new Date(e.created_at).toLocaleTimeString()}),(0,s.jsxs)("details",{children:[(0,s.jsx)("summary",{children:e.kind.replaceAll("."," ")}),(0,s.jsx)("pre",{children:(0,y.A)(e.data)})]})]},e.sequence))]})}let ed=["Run artifacts","Previous runs","Logs","Output"];function eu({runs:e,run:a,onSelect:t}){let[i,n]=(0,h.useState)("Run artifacts"),l="Previous runs"!==i&&!a;return(0,s.jsxs)("section",{className:"action-card action-results","aria-label":"Action run results",children:[(0,s.jsx)("div",{className:"action-tab-bar",role:"tablist","aria-label":"Run information",children:ed.map((e,a)=>(0,s.jsx)("button",{id:`result-tab-${String(a)}`,role:"tab","aria-selected":i===e,"aria-controls":"action-result-panel",tabIndex:i===e?0:-1,onClick:()=>{n(e)},onKeyDown:e=>{let s={ArrowRight:(a+1)%ed.length,ArrowLeft:(a+ed.length-1)%ed.length,Home:0,End:ed.length-1}[e.key];void 0!==s&&(e.preventDefault(),n(ed[s]??"Run artifacts"),document.querySelector(`#result-tab-${String(s)}`)?.focus())},children:e},e))}),(0,s.jsxs)("div",{id:"action-result-panel",role:"tabpanel","aria-labelledby":`result-tab-${String(ed.indexOf(i))}`,tabIndex:0,children:[a?(0,s.jsxs)("div",{className:"action-result-context",children:[(0,s.jsxs)("span",{children:["Run #",a.id.slice(0,8)," ",(0,s.jsx)(y.k,{status:a.status})]}),(0,s.jsxs)(W.f,{href:`/runs/?run=${a.id}`,children:["Run details ",(0,s.jsx)(X.f,{size:13})]})]}):null,"Previous runs"===i?(0,s.jsx)(er,{runs:e,selectedId:a?.id??"",onSelect:t}):null,l?(0,s.jsxs)("div",{className:"action-empty",children:[(0,s.jsx)(et.f,{size:26}),(0,s.jsx)("p",{children:"Your run results will appear here."}),(0,s.jsx)("span",{children:"Save your action, then choose Run selected version to get started."})]}):null,"Run artifacts"===i&&a?(0,s.jsx)(ec,{run:a},`${a.id}-${a.status}`):null,"Logs"===i&&a?(0,s.jsx)(eo,{run:a},a.id):null,"Output"===i&&a?(0,s.jsx)("pre",{className:"action-output",children:y.B.includes(a.status)?"This run is in progress. Its output will appear here.":a.error||(0,y.A)(a.output)||"This run completed without output."}):null]})]})}var eh=e.i(59140);let em=(0,$.default)(async()=>{let s=await e.A(96001);return s.configureMonaco(),s.default},{loadableGenerated:{modules:[160]},ssr:!1}),ep='const { name } = actionParams;\nreturn `Hello, ${name ?? "world"}!`;';function ex({projects:e,onDirtyChange:p,selectedId:x,onSelect:j}){let{selected:g}=(0,u.useWorkspace)(),b=(0,a.useRouter)(),N=(0,C.h)(),[S,$]=(0,h.useState)([]),[z,A]=(0,h.useState)(),[R,O]=(0,h.useState)(g||(e[0]?.id??"")),[I,E]=(0,h.useState)(""),[q,F]=(0,h.useState)(ep),[H,G]=(0,h.useState)(ep),[Y,X]=(0,h.useState)([]),[Z,ee]=(0,h.useState)(""),es='{"type":"object"}',[ea,et]=(0,h.useState)(!1),[ei,en]=(0,h.useState)(es),[el,ec]=(0,h.useState)(es),[eo,ed]=(0,h.useState)("{}"),[ej,ef]=(0,h.useState)("{}"),[ev,eg]=(0,h.useState)('{"name": "team"}'),[eb,ey]=(0,h.useState)(o.A),[eN,ew]=(0,h.useState)(!1),[eS,ek]=(0,h.useState)(""),[eC,e$]=(0,h.useState)(""),[ez,eA]=(0,h.useState)(!0),[e_,eU]=(0,h.useState)(""),[eT,eR]=(0,h.useState)(0),[eP,eO]=(0,h.useState)("source"),[eD,eM]=(0,h.useState)(!1),[eL,eI]=(0,h.useState)(""),eJ=z?.id,eV=(0,h.useCallback)(async e=>eJ?(0,V.f)(e):[],[eJ]),eB=(0,B.f)(eV,5e3*!!eJ),eE=new Set(Y.map(e=>e.id)),eq=(eB.data??[]).filter(e=>null!==e.action_version&&eE.has(e.action_version)).toSorted((e,s)=>s.created_at.localeCompare(e.created_at)),eF=eq[0],eK=eq.find(e=>e.id===eL)??eF,eH=q!==H||ei!==el||eo!==ej||!z&&""!==I,eW=Y[0],eG=eW?"Saved":"Draft",eY=eH?"Unsaved changes":eG,eQ=!!Z&&Z!==eW?.id,eX=!!z&&z.enabled&&!!Z&&!eH;if((0,c.f)(eH||ea,p),(0,h.useEffect)(()=>{let e=new AbortController;return(async()=>{try{let s=await (0,V.t)(e.signal);e.signal.throwIfAborted();let a=s.filter(e=>e.project===g);if($(a),x){let s=a.find(e=>e.id===x);if(!s)throw Error("This action does not exist or is not available in this workspace.");let t=await f.U.actions.versions.query({id:s.id},{signal:e.signal});e.signal.throwIfAborted();let i=t.toSorted((e,s)=>s.number-e.number),n=i[0];A(s),O(s.project),E(s.name),X(i),ee(n?.id??""),F(n?.source??ep),G(n?.source??ep);let l=JSON.stringify(n?.input_schema??{type:"object"});en(l),ec(l);let r=JSON.stringify(n?.output_schema??{});ed(r),ef(r),ek("")}}catch(s){e.signal.aborted||eU((0,v.f)(s))}finally{e.signal.aborted||eA(!1)}})(),()=>{e.abort()}},[x,g,eT]),ez)return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(r.K,{children:(0,s.jsx)("strong",{children:"Actions"})}),(0,s.jsx)("p",{role:"status",children:"Loading actions…"})]});if(e_)return(0,s.jsxs)("section",{className:"panel space-y-4",children:[(0,s.jsx)("h1",{children:"Action unavailable"}),(0,s.jsx)("p",{className:"error",role:"alert",children:e_}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-3",children:[(0,s.jsx)(t.f,{variant:"outline",asChild:!0,children:(0,s.jsx)(W.f,{href:`/actions/?project=${encodeURIComponent(g)}`,children:"Back to actions"})}),(0,s.jsx)(t.f,{onClick:()=>{eU(""),eA(!0),eR(e=>e+1)},children:"Try again"})]})]});let eZ=async e=>{ew(!0),ek(""),e$("");try{await e()}catch(e){ek((0,v.f)(e))}finally{ew(!1)}},e0=async()=>!(eH||ea)||await N(),e1=async e=>{e||x?j(e?.id??""):await e0()&&(et(!1),A(void 0),X([]),ee(""),E(""),F(ep),G(ep),en(es),ec(es),ed("{}"),ef("{}"),eI(""),eO("source"),ek(""),e$(""))},e2=async e=>{if(!await e0())return;let s=Y.find(s=>s.id===e);if(!s)return;et(!1),ee(s.id),F(s.source),G(s.source);let a=JSON.stringify(s.input_schema);en(a),ec(a);let t=JSON.stringify(s.output_schema);ed(t),ef(t)},e4=async()=>{if(ea&&!await N())return;if(!z&&(await f.U.actions.list.query()).results.some(e=>e.project===R&&e.name===I.trim()))throw Error("An action with this name already exists in this project. Open that action or choose a different name.");let e=await f.U.actions.saveAction.mutate({project:R,...z&&{action:z.id},name:I.trim(),source:q,input_schema:(0,m.J)(ei),output_schema:(0,m.J)(eo)}),s=z??await f.U.actions.get.query({id:e.action}),a=e.version;if(z||(A(s),$(e=>[...e,s])),et(!1),X(e=>[a,...e.filter(e=>e.id!==a.id)]),ee(a.id),G(q),ec(ei),ef(eo),e$(`Version ${String(a.number)} saved.`),x)return;let t=new URLSearchParams({project:R,action:s.id});b.replace(`/actions/?${t.toString()}`)},e5=async()=>{let e=Y.find(e=>e.id===Z);z&&eX&&e&&(eI((await f.U.runs.create.mutate({project:R,action:z.id,operation:"action",version:e.number,inputs:(0,m.J)(ev),idempotency_key:crypto.randomUUID()})).id),await eB.refresh(),e$("Run queued. Follow its progress and results below."))},e6={schema:{description:"Define the JSON Schema used to validate this version’s run inputs.",label:"Input schema (JSON)",value:ei},output:{description:"Define the JSON Schema used to validate this version’s returned output.",label:"Output schema (JSON)",value:eo},inputs:{description:"Provide the JSON inputs for your next run or schedule.",label:"Run inputs (JSON)",value:ev}}[eP];return(0,s.jsx)("div",{className:"actions-workspace",children:(0,s.jsxs)("section",{className:"action-detail","aria-label":"Action editor",children:[(0,s.jsx)(r.K,{children:(0,s.jsxs)("div",{className:"action-toolbar",children:[(0,s.jsx)("h1",{className:"sr-only",children:z?.name??"New action"}),(0,s.jsxs)("nav",{className:"action-breadcrumb","aria-label":"Action navigation",children:[(0,s.jsx)(T.f,{size:16,"aria-hidden":"true"}),(0,s.jsx)(W.f,{href:`/actions/?project=${encodeURIComponent(g)}`,children:"Actions"}),(0,s.jsx)("span",{"aria-hidden":"true",children:"/"}),(0,s.jsxs)(l.d,{value:z?.id??"new",disabled:eN,onValueChange:e=>{e1(S.find(s=>s.id===e))},children:[(0,s.jsx)(l.P,{"aria-label":"Choose action",className:"action-selector",children:(0,s.jsx)(l.U,{})}),(0,s.jsxs)(l.r,{children:[(0,s.jsx)(l.T,{value:"new",children:"New action"}),S.map(e=>(0,s.jsx)(l.T,{value:e.id,children:e.name},e.id))]})]}),(0,s.jsx)("span",{className:`action-save-status ${eH?"is-dirty":""}`,children:eY}),z?.enabled===!1?(0,s.jsx)("span",{className:"badge",children:"Disabled"}):null,(0,s.jsx)(t.f,{variant:"ghost",size:"icon",disabled:eN,"aria-label":"New action",title:"New action",onClick:()=>{e1()},children:(0,s.jsx)(L.f,{size:15})})]}),(0,s.jsxs)("div",{className:"row action-header-controls",children:[eF?(0,s.jsxs)("div",{className:"action-last-run",children:[(0,s.jsx)("span",{children:"Last run"}),(0,s.jsx)(y.k,{status:eF.status}),(0,s.jsx)("small",{children:new Date(eF.created_at).toLocaleString()})]}):null,(0,s.jsxs)(t.f,{variant:"outline",disabled:eN||!q.trim()||!z&&(!I.trim()||!R),onClick:()=>{eZ(e4)},children:[(0,s.jsx)(J,{size:15})," ",eQ?"Save as new version":"Save version"]}),(0,s.jsxs)(t.f,{className:"secondary",disabled:eN||!eX,onClick:()=>{eZ(e5)},children:[(0,s.jsx)(M.f,{size:15})," Run selected version"]})]})]})}),z?(0,s.jsx)(eh.F,{action:z,current:"editor"}):(0,s.jsxs)("div",{className:"mb-5 space-y-2",children:[(0,s.jsx)(W.f,{href:`/actions/?project=${encodeURIComponent(g)}`,children:"Back to actions"}),(0,s.jsx)("h1",{children:"New action"}),(0,s.jsx)("p",{children:"Save reusable code for your connected MCP client to run."})]}),eS?(0,s.jsx)("p",{className:"error",role:"alert",children:eS}):void 0,eC?(0,s.jsx)("p",{className:"notice",role:"status",children:eC}):void 0,z?void 0:(0,s.jsxs)("div",{className:"panel row action-create-fields",children:[(0,s.jsxs)("label",{children:["Action name",(0,s.jsx)(i.f,{value:I,disabled:eN,onChange:e=>{E(e.target.value)},placeholder:"e.g. Daily report"})]}),(0,s.jsxs)("label",{children:["Project",(0,s.jsx)(i.f,{readOnly:!0,value:e.find(e=>e.id===g)?.name??"No project selected"}),(0,s.jsx)("small",{children:"Choose a project in the sidebar before creating an action."})]})]}),0===e.length?(0,s.jsx)("p",{className:"notice",children:"Create a project from Projects before saving an action."}):void 0,(0,s.jsx)(K.f,{...eB}),(0,s.jsxs)("div",{className:`action-content-grid ${eD?"is-editor-expanded":""}`,children:[(0,s.jsxs)("div",{className:"action-editor-column",children:[(0,s.jsxs)("div",{className:"source-pane action-source-pane",children:[(0,s.jsxs)("div",{className:"source-toolbar",children:[(0,s.jsxs)("div",{className:"action-editor-tabs",role:"group","aria-label":"Action configuration",children:[(0,s.jsxs)("button",{type:"button",className:"source"===eP?"is-active":"","aria-pressed":"source"===eP,onClick:()=>{eO("source")},children:[(0,s.jsx)("span",{className:"typescript-icon",children:"TS"})," action.ts"," ",eH?(0,s.jsx)("span",{className:"unsaved-dot",title:"Unsaved changes"}):null]}),(0,s.jsxs)("button",{type:"button",className:"schema"===eP?"is-active":"","aria-pressed":"schema"===eP,onClick:()=>{eO("schema")},children:[(0,s.jsx)(_,{size:14})," Input schema"]}),(0,s.jsxs)("button",{type:"button",className:"output"===eP?"is-active":"","aria-pressed":"output"===eP,onClick:()=>{eO("output")},children:[(0,s.jsx)(_,{size:14})," Output schema"]}),(0,s.jsxs)("button",{type:"button",className:"inputs"===eP?"is-active":"","aria-pressed":"inputs"===eP,onClick:()=>{eO("inputs")},children:[(0,s.jsx)(_,{size:14})," Run inputs"]}),(0,s.jsxs)("button",{type:"button",className:"schedule"===eP?"is-active":"","aria-pressed":"schedule"===eP,onClick:()=>{eO("schedule")},children:[(0,s.jsx)(U.f,{size:14})," Schedule"]})]}),(0,s.jsxs)("div",{className:"row",children:[Y.length>0?(0,s.jsxs)(l.d,{value:Z,disabled:eN,onValueChange:e=>{e2(e)},children:[(0,s.jsx)(l.P,{"aria-label":"Action version",className:"action-version-selector",children:(0,s.jsx)(l.U,{})}),(0,s.jsx)(l.r,{children:Y.map(e=>(0,s.jsxs)(l.T,{value:e.id,children:["Version ",e.number,e.id===eW?.id?" (latest)":""]},e.id))})]}):null,(0,s.jsx)(t.f,{variant:"ghost",size:"icon","aria-label":eD?"Collapse editor":"Expand editor","aria-pressed":eD,onClick:()=>{eM(!eD)},children:eD?(0,s.jsx)(D,{size:15}):(0,s.jsx)(P,{size:15})})]})]}),"source"===eP?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"desktop-editor",children:(0,s.jsx)(em,{value:q,onChange:F,readOnly:eN,actionId:`${R}:${z?.id??"new"}:${Z}`,projectId:R,theme:"light",height:"100%"})}),(0,s.jsx)("div",{className:"mobile-editor",children:(0,s.jsxs)("label",{children:["TypeScript source",(0,s.jsx)(n.f,{className:"code",rows:18,spellCheck:!1,value:q,readOnly:eN,onChange:e=>{F(e.target.value)}})]})})]}):null,"schedule"===eP?(0,s.jsxs)("section",{className:"action-schedule-editor","aria-labelledby":"action-schedule-title",children:[(0,s.jsx)("h3",{id:"action-schedule-title",children:"Schedule action"}),z?(0,s.jsx)(W.f,{href:`/schedules/?${new URLSearchParams({project:R,action:z.id}).toString()}`,children:"View saved schedules"}):null,(0,s.jsx)("p",{className:"small",children:"Creating a schedule copies the current Run inputs. Scheduled runs use this action’s latest saved version."}),eX&&!eQ?null:(0,s.jsx)("p",{className:"notice",role:"status",children:z&&eW?z.enabled?eQ?"Choose the latest version before creating a schedule.":"Save your changes before creating a schedule.":"Enable this action before creating a schedule.":"Save this action before creating a schedule."}),(0,s.jsx)(d.f,{value:eb,onChange:ey,disabled:eN}),(0,s.jsx)(t.f,{className:"secondary",disabled:eN||!eX||eQ,onClick:()=>{eZ(async()=>{z&&eX&&(await f.U.schedules.create.mutate({action:z.id,cron:eb,inputs:(0,m.J)(ev)}),e$("Schedule created."))})},children:"Create schedule"})]}):null,e6?(0,s.jsxs)("div",{className:"action-json-editor",children:[(0,s.jsx)("p",{className:"small",children:e6.description}),(0,s.jsxs)("label",{children:[e6.label,(0,s.jsx)(n.f,{className:"code",spellCheck:!1,value:e6.value,readOnly:eN,onChange:e=>{"schema"===eP?en(e.target.value):"output"===eP?ed(e.target.value):eg(e.target.value)}})]})]}):null,(0,s.jsxs)("footer",{className:"source-footer",children:[(0,s.jsx)("span",{children:"schedule"===eP?"Schedule":"source"===eP?"TypeScript":"JSON"}),(0,s.jsx)("span",{children:eQ?"Historical version · edits save a new version":eY})]})]}),(0,s.jsx)(eu,{runs:eq,run:eK,onSelect:eI})]}),(0,s.jsxs)("aside",{className:"action-context-column","aria-label":"Plugins and recent runs",children:[(0,s.jsx)(Q,{project:e.find(e=>e.id===R)},R),(0,s.jsxs)("section",{className:"action-card action-recent-runs","aria-label":"Recent action runs",children:[(0,s.jsxs)("div",{className:"action-panel-heading",children:[(0,s.jsx)("h3",{children:"Previous runs"}),(0,s.jsxs)("span",{className:"count",children:[eq.length," ",1===eq.length?"run":"runs"]})]}),(0,s.jsx)(er,{runs:eq,selectedId:eK?.id??"",onSelect:eI})]})]})]}),(0,s.jsx)(w,{project:R,action:z,version:Y.find(e=>e.id===Z),source:q,inputSchema:ei,outputSchema:eo,dirty:eH,onDirtyChange:et},`${R}:${z?.id??"new"}:${Z}`),Y.find(e=>e.id===Z)?.promoted_from?(0,s.jsxs)("p",{className:"small",children:["Promoted from run"," ",Y.find(e=>e.id===Z)?.promoted_from]}):null,eH||eQ?(0,s.jsx)("p",{className:"small",role:"status",children:eQ?"Running uses the selected saved version. Editing and saving creates a new immutable version.":"Save your changes before running or scheduling this action."}):void 0,(0,s.jsx)("div",{className:"action-configuration",children:z?(0,s.jsx)(k,{action:z,isBusy:eN,save:e=>{eZ(async()=>{let s=await f.U.actions.update.mutate({id:z.id,...e});A(s),$(e=>e.map(e=>e.id===s.id?s:e)),e$("Action settings saved.")})}},z.id):void 0})]})})}function ej(e){let{selected:a}=(0,u.useWorkspace)();return(0,s.jsx)(ex,{...e},`${a}:${e.selectedId}`)}var ef=e.i(67965),ev=e.i(1101);function eg(){let{projects:e,selected:a}=(0,u.useWorkspace)(),n=e.find(e=>e.id===a),l=(0,B.f)(V.t),[c,o]=(0,h.useState)("");if(!n)return(0,s.jsxs)("section",{className:"panel space-y-4",children:[(0,s.jsx)(r.K,{children:(0,s.jsx)("strong",{children:"Actions"})}),(0,s.jsx)("h1",{children:"Actions"}),(0,s.jsx)("p",{children:"Create a project to give your MCP client a place to build and run saved actions."}),(0,s.jsx)(t.f,{asChild:!0,children:(0,s.jsx)(W.f,{href:"/projects/?new=1",children:"Create project"})})]});let d=(l.data??[]).filter(e=>e.project===a),m=c.trim().toLowerCase(),p=d.filter(e=>`${e.name} ${e.description}`.toLowerCase().includes(m)),x=new URLSearchParams({project:a}).toString();return(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsx)(r.K,{children:(0,s.jsxs)("div",{className:"flex min-w-0 items-center gap-3 text-sm",children:[(0,s.jsx)(W.f,{href:`/projects/?${x}`,className:"truncate",children:n.name}),(0,s.jsx)("span",{"aria-hidden":"true",className:"text-slate-300",children:"/"}),(0,s.jsx)("strong",{children:"Actions"})]})}),(0,s.jsxs)("header",{className:"flex flex-wrap items-start justify-between gap-4",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("p",{className:"text-sm font-medium",children:n.name}),(0,s.jsx)("h1",{children:"Actions"}),(0,s.jsx)("p",{children:"Build what your connected MCP client can run in this project."})]}),(0,s.jsx)(t.f,{asChild:!0,children:(0,s.jsxs)(W.f,{href:`/actions/?${x}&new=1`,children:[(0,s.jsx)(L.f,{size:16,"aria-hidden":"true"})," New action"]})})]}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-4 rounded-xl border border-indigo-100 bg-indigo-50/50 p-4",children:[(0,s.jsxs)("div",{className:"flex items-start gap-3",children:[(0,s.jsx)(ef.f,{size:20,className:"mt-0.5 shrink-0 text-indigo-600","aria-hidden":"true"}),(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)("p",{className:"text-sm font-medium text-slate-900",children:"Built with your MCP client"}),(0,s.jsx)("p",{className:"text-sm",children:"Save reusable actions, inspect their runs, then add schedules or webhooks."})]})]}),(0,s.jsx)(t.f,{variant:"outline",asChild:!0,children:(0,s.jsx)(W.f,{href:`/connections/?${x}`,children:"Connect client"})})]}),(0,s.jsx)(K.f,{...l}),l.data&&d.length>0?(0,s.jsxs)("section",{className:"space-y-4","aria-label":"Saved actions",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[(0,s.jsxs)("p",{className:"text-sm",children:[d.length," saved"," ",1===d.length?"action":"actions"]}),(0,s.jsxs)("label",{className:"relative block w-full sm:max-w-xs",children:[(0,s.jsx)("span",{className:"sr-only",children:"Search actions"}),(0,s.jsx)(F.f,{size:16,className:"absolute top-2.5 left-3 text-slate-400","aria-hidden":"true"}),(0,s.jsx)(i.f,{value:c,onChange:e=>{o(e.target.value)},placeholder:"Search actions",className:"pl-9!"})]})]}),(0,s.jsx)("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-3",children:p.map(e=>(0,s.jsx)(ev.f,{action:e},e.id))}),0===p.length?(0,s.jsxs)("p",{role:"status",children:["No actions match “",c,"”."]}):null]}):null,l.isLoading||l.error||0!==d.length?null:(0,s.jsxs)("section",{className:"flex flex-col items-start gap-4 rounded-xl border border-dashed border-slate-300 bg-white p-6",children:[(0,s.jsx)(T.f,{size:24,className:"text-indigo-600","aria-hidden":"true"}),(0,s.jsx)("h2",{className:"mb-0!",children:"No saved actions yet"}),(0,s.jsx)("p",{children:"Ask your connected MCP client to create an action, or start one here. Each action keeps its code versions, runs, schedules and webhooks together."}),(0,s.jsx)(t.f,{variant:"outline",asChild:!0,children:(0,s.jsx)(W.f,{href:`/actions/?${x}&new=1`,children:"Create an action"})})]})]})}e.s(["default",0,function(){let{projects:e,selected:t,setDirty:i,navigateTo:n}=(0,u.useWorkspace)(),l=(0,a.useSearchParams)(),r=l.get("action")??"",c="1"===l.get("new");return r||c?(0,s.jsx)(ej,{projects:e,onDirtyChange:i,selectedId:r,onSelect:e=>{let s=new URLSearchParams({project:t});e?s.set("action",e):s.set("new","1"),n(`/actions/?${s.toString()}`)}},r):(0,s.jsx)(eg,{},t)}],43776)}]);
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,59659,e=>{"use strict";var a=e.i(56420);let t={name:"trash",size:24,node:[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],aliases:["trash-2"]};t.node;let i=(0,a.f)(t);e.s(["f",0,i],59659)},13581,29487,e=>{"use strict";var a=e.i(71645),t=e.i(95813);e.s(["f",0,function(e,i=0){let[r,s]=(0,a.useState)(),[n,l]=(0,a.useState)(""),[d,c]=(0,a.useState)(!0),o=(0,a.useRef)(void 0),u=(0,a.useRef)(!1),h=(0,a.useCallback)(async()=>{o.current?.abort();let a=new AbortController;o.current=a;try{let t=await e(a.signal);if(a.signal.aborted||!u.current)return;s(t),l("")}catch(e){!a.signal.aborted&&u.current&&l((0,t.f)(e))}finally{!a.signal.aborted&&u.current&&c(!1)}},[e]);return(0,a.useEffect)(()=>{u.current=!0,queueMicrotask(()=>{u.current&&h()});let e=i>0?setInterval(()=>{h()},i):void 0;return()=>{u.current=!1,o.current?.abort(),clearInterval(e)}},[h,i]),{data:r,error:n,isLoading:d,refresh:h}}],13581);var i=e.i(18050),r=e.i(19455);e.s(["f",0,function({isLoading:e,error:a,refresh:t}){return(0,i.jsxs)(i.Fragment,{children:[e?(0,i.jsx)("p",{role:"status",children:"Loading workspace data…"}):void 0,a?(0,i.jsxs)("div",{className:"error",role:"alert",children:[(0,i.jsx)("p",{children:a}),(0,i.jsx)(r.f,{variant:"outline",onClick:()=>{t()},children:"Try again"})]}):void 0]})}],29487)},61790,e=>{"use strict";var a=e.i(18050),t=e.i(58925),i=e.i(56420);let r={name:"pencil",size:24,node:[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]};r.node;let s=(0,i.f)(r);var n=e.i(59659),l=e.i(71645),d=e.i(73656),c=e.i(40192),o=e.i(54105),u=e.i(19877),h=e.i(95813),p=e.i(15080),f=e.i(13581),v=e.i(19455),m=e.i(93479),j=e.i(59037),x=e.i(29487),g=e.i(87309);function b({canManage:e,onDirtyChange:i}){let r=(0,f.f)(p._),y=(0,g.h)(),[w,k]=(0,l.useState)(""),[N,S]=(0,l.useState)(""),[C,z]=(0,l.useState)("openai"),[M,R]=(0,l.useState)(""),[D,E]=(0,l.useState)(!1),[O,A]=(0,l.useState)(""),[L,T]=(0,l.useState)(""),U=r.data?.find(e=>e.id===w);(0,j.f)(""!==M||N!==(U?.name??"")||C!==(U?.provider??"openai"),i);let q=async e=>{E(!0),A(""),T("");try{await e(),await r.refresh()}catch(e){A((0,h.f)(e))}finally{E(!1)}};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("section",{className:"panel",children:[(0,a.jsxs)("div",{className:"panel-title",children:[(0,a.jsxs)("h2",{children:[(0,a.jsx)(t.f,{size:18})," Credential inventory"]}),(0,a.jsxs)("span",{className:"badge",children:[r.data?.length??0," credentials"]})]}),(0,a.jsx)("p",{className:"small",children:"Secret values are encrypted and never returned. Replacing a secret affects future runs; retained runs keep their snapshot scope."}),(0,a.jsx)(x.f,{...r}),r.isLoading||r.data?.length!==0?void 0:(0,a.jsxs)("div",{className:"resource-empty",children:[(0,a.jsx)(t.f,{size:28}),(0,a.jsx)("h3",{children:"No credentials yet"}),(0,a.jsx)("p",{children:"Add a provider credential, then assign it to a plugin."})]}),r.data?.map(i=>(0,a.jsxs)("div",{className:"resource-row",children:[(0,a.jsx)(t.f,{size:17}),(0,a.jsxs)("div",{children:[(0,a.jsx)("strong",{children:i.name}),(0,a.jsxs)("small",{children:[i.provider," · Value hidden"]})]}),e?(0,a.jsxs)("div",{className:"row",children:[(0,a.jsxs)(v.f,{variant:"outline",size:"sm",disabled:D,onClick:()=>{k(i.id),S(i.name),z(i.provider),R("")},children:[(0,a.jsx)(s,{size:13}),"Edit"]}),(0,a.jsx)(v.f,{variant:"ghost",size:"icon","aria-label":`Delete credential ${i.name}`,disabled:D,onClick:()=>{q(async()=>{await y({title:"Delete this credential?",description:"Disconnect any plugins using this credential before deleting it.",actionLabel:"Delete credential"})&&(await d.U.credentials.delete.mutate({id:i.id}),T("Credential deleted."))})},children:(0,a.jsx)(n.f,{size:14})})]}):void 0]},i.id))]}),e?(0,a.jsxs)("section",{className:"panel",children:[(0,a.jsx)("h2",{children:w?"Replace or rename credential":"Add a credential"}),(0,a.jsxs)("form",{onSubmit:e=>{e.preventDefault(),q(async()=>{let e=M.trim()?c.z.record(o.z.string(),u.z.json()).parse(JSON.parse(M)):void 0;if(w)await d.U.credentials.update.mutate({id:w,name:N,provider:C,...void 0!==e&&{secret:e}});else{if(void 0===e)throw Error("Enter the credential secret as a JSON object.");await d.U.credentials.create.mutate({name:N,provider:C,secret:e})}R(""),k(""),S(""),z("openai"),T("Credential saved. Assign it in plugin settings.")})},children:[(0,a.jsxs)("div",{className:"row",children:[(0,a.jsxs)("label",{children:["Credential name",(0,a.jsx)(m.f,{required:!0,value:N,disabled:D,onChange:e=>{S(e.target.value)}})]}),(0,a.jsxs)("label",{children:["Provider",(0,a.jsx)(m.f,{required:!0,value:C,disabled:D,onChange:e=>{z(e.target.value)}})]})]}),(0,a.jsxs)("label",{children:[w?"Replacement secret JSON (leave blank to keep current value)":"Secret JSON",(0,a.jsx)(m.f,{type:"password",required:!w,autoComplete:"new-password",value:M,disabled:D,placeholder:'{"api_key":"…"}',onChange:e=>{R(e.target.value)}})]}),(0,a.jsxs)("div",{className:"row",children:[(0,a.jsx)(v.f,{type:"submit",disabled:D,children:"Save credential"}),w?(0,a.jsx)(v.f,{type:"button",variant:"outline",onClick:()=>{k(""),S(""),R(""),z("openai")},children:"Cancel editing"}):void 0]})]})]}):(0,a.jsx)("p",{className:"notice",children:"Only workspace owners and admins can manage credentials."}),O?(0,a.jsx)("p",{className:"error",role:"alert",children:O}):void 0,L?(0,a.jsx)("p",{className:"notice",role:"status",children:L}):void 0]})}var y=e.i(94757);e.s(["default",0,function(){let{canManage:e,setDirty:t}=(0,y.useWorkspace)();return(0,a.jsx)(b,{canManage:e,onDirtyChange:t})}],61790)},93479,e=>{"use strict";var a=e.i(18050),t=e.i(71645),i=e.i(39689);let r=t.forwardRef(({className:e,type:t,...r},s)=>(0,a.jsx)("input",{type:t,className:(0,i.f)("flex h-9 w-full rounded-md border border-input bg-background px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:s,...r}));r.displayName="Input",e.s(["f",0,r])},59037,e=>{"use strict";var a=e.i(71645);e.s(["f",0,function(e,t){(0,a.useEffect)(()=>{t(e);let a=e=>{e.preventDefault()};return e&&addEventListener("beforeunload",a),()=>{removeEventListener("beforeunload",a),t(!1)}},[e,t])}])}]);