decocms 2.310.6 → 2.310.8

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 (206) hide show
  1. package/dist/client/assets/{AlertCircle-CFABZy3o.js → AlertCircle-Bfs7s4nW.js} +1 -1
  2. package/dist/client/assets/{ArrowNarrowLeft-qjcSXUou.js → ArrowNarrowLeft-Bmz6Y8e3.js} +1 -1
  3. package/dist/client/assets/{ArrowUpRight-havdJdQt.js → ArrowUpRight-uN4rpxFQ.js} +1 -1
  4. package/dist/client/assets/{Check-4wEPFmVT.js → Check-Dn9d8wcY.js} +1 -1
  5. package/dist/client/assets/{CheckCircle-D7ReuLNV.js → CheckCircle-Ce1bjJWu.js} +1 -1
  6. package/dist/client/assets/{ChevronDown-CLwgC4lc.js → ChevronDown-CXCDuqLa.js} +1 -1
  7. package/dist/client/assets/{ChevronRight-DW27S4dx.js → ChevronRight-D5XY6PcV.js} +1 -1
  8. package/dist/client/assets/{ChevronUp-DAW3-3dA.js → ChevronUp-CumNURD7.js} +1 -1
  9. package/dist/client/assets/{Container-C9S2fJrQ.js → Container-CaXLIAOI.js} +1 -1
  10. package/dist/client/assets/{DotsVertical-BReL32xd.js → DotsVertical-t9aJW5_k.js} +1 -1
  11. package/dist/client/assets/{LinkExternal01-0Xs4UV_i.js → LinkExternal01-Df6M_hj7.js} +1 -1
  12. package/dist/client/assets/{Lock01-BjKqD6QN.js → Lock01-zKy6_9kx.js} +1 -1
  13. package/dist/client/assets/{Palette-Dtg_tDlg.js → Palette-YLM_ef0u.js} +1 -1
  14. package/dist/client/assets/{Play-85A9faRd.js → Play-CgFl5SH3.js} +1 -1
  15. package/dist/client/assets/{Plus-BxG8Erza.js → Plus-CaMiYyQj.js} +1 -1
  16. package/dist/client/assets/{RefreshCcw01-DdgK7Krp.js → RefreshCcw01-Dg3dsSrt.js} +1 -1
  17. package/dist/client/assets/{SearchMd-JVaJZdXg.js → SearchMd-CEMS2-Af.js} +1 -1
  18. package/dist/client/assets/{Settings02-BZivkDIL.js → Settings02-eRruwxu8.js} +1 -1
  19. package/dist/client/assets/{Shield01-CAl07SGJ.js → Shield01-CcUKPlcN.js} +1 -1
  20. package/dist/client/assets/{Star01-DEmigL_c.js → Star01-DLhWwRZb.js} +1 -1
  21. package/dist/client/assets/{Sun-TDfj1GPd.js → Sun-cU8BjYNb.js} +1 -1
  22. package/dist/client/assets/{Tool01-Bhj2T1uN.js → Tool01-CVk9VJBE.js} +1 -1
  23. package/dist/client/assets/{Trash01-CdymalYb.js → Trash01-BRo1VQ8E.js} +1 -1
  24. package/dist/client/assets/{User01-BZ9BWkFc.js → User01-kmVRHRma.js} +1 -1
  25. package/dist/client/assets/{Users03-DG3Gfjoh.js → Users03-CIV6olE1.js} +1 -1
  26. package/dist/client/assets/{X-DzLPqoAC.js → X-D9eppmZ5.js} +1 -1
  27. package/dist/client/assets/{XCircle-DTJod2tn.js → XCircle-aWgEOCXr.js} +1 -1
  28. package/dist/client/assets/{XClose-0biyZ-nq.js → XClose-DbuUzE7b.js} +1 -1
  29. package/dist/client/assets/{Zap-aKe8CYDP.js → Zap-BbjHF1GM.js} +1 -1
  30. package/dist/client/assets/{ZapSquare-DtdkchqU.js → ZapSquare-DrCreQ3A.js} +1 -1
  31. package/dist/client/assets/{accordion-CHtp00zM.js → accordion-CB4pTANL.js} +1 -1
  32. package/dist/client/assets/{agent-icon-D-W_-Msq.js → agent-icon-BVZUm3pj.js} +1 -1
  33. package/dist/client/assets/{agents-list-DuIrLHcS.js → agents-list-DlTc6QGI.js} +1 -1
  34. package/dist/client/assets/ai-providers-CEEk5xRd.js +1 -0
  35. package/dist/client/assets/{alert-dialog-DZ7MoPrC.js → alert-dialog-BBdkraBS.js} +1 -1
  36. package/dist/client/assets/{auth-catchall-0StMYUgy.js → auth-catchall-bUIQyqBf.js} +1 -1
  37. package/dist/client/assets/{automation-list-row-CS-JiMPM.js → automation-list-row-tSvFX0_P.js} +1 -1
  38. package/dist/client/assets/{automations-BAEn2v9X.js → automations-DZkLzvwz.js} +1 -1
  39. package/dist/client/assets/{avatar-CtlfIArZ.js → avatar-BLsDXTLO.js} +1 -1
  40. package/dist/client/assets/{badge-YKYMjnfu.js → badge-CHhcYTOG.js} +1 -1
  41. package/dist/client/assets/{brand-context-DfGmGZnx.js → brand-context-BZbDeID5.js} +1 -1
  42. package/dist/client/assets/{card-uZ87GViI.js → card-B46IKqYa.js} +1 -1
  43. package/dist/client/assets/{chat-context-BFxTlymH.js → chat-context-UGxRb1rI.js} +1 -1
  44. package/dist/client/assets/{checkbox-BFMSekYh.js → checkbox-CxcVXBXV.js} +1 -1
  45. package/dist/client/assets/{collection-detail-z1-sDcK2.js → collection-detail-DaQ_oR9e.js} +1 -1
  46. package/dist/client/assets/{collection-display-button-DqIrM4V5.js → collection-display-button-BXqWBMEX.js} +1 -1
  47. package/dist/client/assets/{collection-search-CrNavgfW.js → collection-search-BOYToHG4.js} +1 -1
  48. package/dist/client/assets/{collection-search-DV0cCH2j.js → collection-search-lhyumEEV.js} +1 -1
  49. package/dist/client/assets/{collection-table-wrapper-CjedtIca.js → collection-table-wrapper-BPAycPr7.js} +1 -1
  50. package/dist/client/assets/{collection-tabs-D653lS2B.js → collection-tabs-HQQcyoFg.js} +1 -1
  51. package/dist/client/assets/{collections-kcgqXRh1.js → collections-a3wfsjnW.js} +1 -1
  52. package/dist/client/assets/{command-DEZQ8Srq.js → command-BBGje1oX.js} +1 -1
  53. package/dist/client/assets/{connection-card-DDf_nl47.js → connection-card-DJeKMgvX.js} +1 -1
  54. package/dist/client/assets/{connection-detail-DIAn09sC.js → connection-detail-BEyRsGap.js} +1 -1
  55. package/dist/client/assets/{connection-form-helpers-CaEsrTVy.js → connection-form-helpers-C2msx2a-.js} +1 -1
  56. package/dist/client/assets/{connections-BTFAJALU.js → connections-DOax_hsw.js} +1 -1
  57. package/dist/client/assets/{constants-9g9gFjnw.js → constants-CCLDSt04.js} +1 -1
  58. package/dist/client/assets/{constants-DsSHL62C.js → constants-RWvzCl_g.js} +1 -1
  59. package/dist/client/assets/{dialog-B4KlHjek.js → dialog-CrUS2M-J.js} +1 -1
  60. package/dist/client/assets/{domain-settings-D1FHhwCI.js → domain-settings-CJEzm_aH.js} +1 -1
  61. package/dist/client/assets/{drawer-5orE9Wr9.js → drawer-B55E50R8.js} +1 -1
  62. package/dist/client/assets/{dropdown-menu-BsFYaC7C.js → dropdown-menu-CAcyogWh.js} +1 -1
  63. package/dist/client/assets/{dynamic-plugin-layout-CwAziEC5.js → dynamic-plugin-layout-CDvQ_Np7.js} +1 -1
  64. package/dist/client/assets/{empty-state-DnjUFLB3.js → empty-state-B0wC2RI0.js} +1 -1
  65. package/dist/client/assets/{empty-state-fJhgTnn4.js → empty-state-DDTz8h9v.js} +1 -1
  66. package/dist/client/assets/{extract-connection-data-4I5O_R5k.js → extract-connection-data-4PWi7FLi.js} +1 -1
  67. package/dist/client/assets/{features-CNtB2JQC.js → features-9eK6Dvvc.js} +1 -1
  68. package/dist/client/assets/{form-CDvvEZtA.js → form-9gavmyEG.js} +1 -1
  69. package/dist/client/assets/{general-Dz0H1FEC.js → general-Dd7eNyE0.js} +1 -1
  70. package/dist/client/assets/{index-B3Ttc_5_.js → index-0P8ZmKvA.js} +1 -1
  71. package/dist/client/assets/{index-WBXw_0um.js → index-2L6LxWB9.js} +1 -1
  72. package/dist/client/assets/index-B77fLAOn.js +1 -0
  73. package/dist/client/assets/{index-CoY1MHFJ.js → index-B7jEWpXG.js} +1 -1
  74. package/dist/client/assets/{index-ChoE-W6u.js → index-BOyxqY6S.js} +1 -1
  75. package/dist/client/assets/{index-BJq84O_6.js → index-Bm8TOoJq.js} +1 -1
  76. package/dist/client/assets/{index-CneSjNEN.js → index-Bs5p63Lp.js} +1 -1
  77. package/dist/client/assets/{index-n0iHPcte.js → index-D-AchbAp.js} +2 -2
  78. package/dist/client/assets/{index-CVzq_PSm.js → index-D-Sd8524.js} +1 -1
  79. package/dist/client/assets/{index-TikwA-8X.js → index-D2SMYQnt.js} +3 -3
  80. package/dist/client/assets/{index-H-xuVWHv.js → index-DJKFaAtT.js} +1 -1
  81. package/dist/client/assets/{index-__EZcmD7.js → index-DZmO6N1n.js} +1 -1
  82. package/dist/client/assets/{index-C1C4QgjJ.js → index-DbKfVBRv.js} +1 -1
  83. package/dist/client/assets/{index-BnEPkkjz.js → index-hAn15iQr.js} +1 -1
  84. package/dist/client/assets/{index-DrOTgwhJ.js → index-jcMGjOmp.js} +1 -1
  85. package/dist/client/assets/{index-_Uov_1Gm.js → index-zJlISM1n.js} +1 -1
  86. package/dist/client/assets/{infiniteQueryObserver-CWqfKiPC.js → infiniteQueryObserver-DoJUGWdU.js} +1 -1
  87. package/dist/client/assets/{input-DEYTwRzn.js → input-CakwXYXP.js} +1 -1
  88. package/dist/client/assets/{integration-icon-Bkie-XyL.js → integration-icon-C-l7PWbV.js} +1 -1
  89. package/dist/client/assets/{label-DWRjHkWy.js → label-CIwIDYzF.js} +1 -1
  90. package/dist/client/assets/{layout-CjfRI0kM.js → layout-BELe2gYF.js} +1 -1
  91. package/dist/client/assets/{lean-canvas-recruit-modal-DGk9eFdJ.js → lean-canvas-recruit-modal-BL7Hqazc.js} +1 -1
  92. package/dist/client/assets/{login-DKUj7zIS.js → login-BjVz6Lmy.js} +1 -1
  93. package/dist/client/assets/{members-BbSPO94a.js → members-CV-YNJVI.js} +1 -1
  94. package/dist/client/assets/{monaco-editor-DqaoMZN_.js → monaco-editor-C8cqLWnt.js} +1 -1
  95. package/dist/client/assets/{monitoring-stats-row-DhIBV8mS.js → monitoring-stats-row-03tCjfSg.js} +1 -1
  96. package/dist/client/assets/{oauth-callback-ai-provider--0vKdiLB.js → oauth-callback-ai-provider-Cn406SsN.js} +1 -1
  97. package/dist/client/assets/{oauth-callback-4rQ_SIXQ.js → oauth-callback-lAoZsaec.js} +1 -1
  98. package/dist/client/assets/{onboarding-CCqg4mEL.js → onboarding-DrvTr1Oe.js} +1 -1
  99. package/dist/client/assets/{org-layout-GNTOf2Y_.js → org-layout-D46j3LFF.js} +1 -1
  100. package/dist/client/assets/{org-plugin-layout-DvR4YnGa.js → org-plugin-layout-BqNL0q9V.js} +1 -1
  101. package/dist/client/assets/{pair-tqYVnZzb.js → pair-BJVqYs09.js} +1 -1
  102. package/dist/client/assets/{plugin-empty-state-B7Ew5cqE.js → plugin-empty-state-BM8f9tif.js} +1 -1
  103. package/dist/client/assets/{plugin-header-HT1h0NLv.js → plugin-header-BQz7TyX6.js} +1 -1
  104. package/dist/client/assets/{plugin-layout-BRlJ23A-.js → plugin-layout-CIgCE7YR.js} +1 -1
  105. package/dist/client/assets/{popover-BDSYEq1Z.js → popover-D2EOAbOM.js} +1 -1
  106. package/dist/client/assets/{profile-CE6TtzAL.js → profile-BAs8A8Ct.js} +1 -1
  107. package/dist/client/assets/{project-app-view-CKGfiYJS.js → project-app-view-C6cxoEkx.js} +1 -1
  108. package/dist/client/assets/registry-CJxOyZl6.js +2 -0
  109. package/dist/client/assets/{registry-layout-BgUN22Is.js → registry-layout-Dbn2jbhx.js} +1 -1
  110. package/dist/client/assets/{required-auth-layout-C2TKIvqH.js → required-auth-layout-eFrhlW0x.js} +1 -1
  111. package/dist/client/assets/{reset-password-CFEVrlT-.js → reset-password--oJpG98M.js} +1 -1
  112. package/dist/client/assets/{roles-UDExR41M.js → roles-wXb5aFM5.js} +1 -1
  113. package/dist/client/assets/{scroll-area-1CfGMim0.js → scroll-area-DkzB0VrI.js} +1 -1
  114. package/dist/client/assets/{search-input-BUN7olRm.js → search-input-C4_6QMbq.js} +1 -1
  115. package/dist/client/assets/{select-CDN58G81.js → select-Ji_VTvAf.js} +1 -1
  116. package/dist/client/assets/{select-model-BoyVFry8.js → select-model-kUAjnROT.js} +1 -1
  117. package/dist/client/assets/{settings-layout-DyxDLw6w.js → settings-layout-CUCVg_-5.js} +1 -1
  118. package/dist/client/assets/{settings-section-gdfEnAUq.js → settings-section-Bqaz9XGD.js} +1 -1
  119. package/dist/client/assets/{shell-layout-BAgHU931.js → shell-layout-DWNJFELP.js} +1 -1
  120. package/dist/client/assets/{skeleton-B66wWsdL.js → skeleton-CXubnmL1.js} +1 -1
  121. package/dist/client/assets/{sso-9AzOTM0F.js → sso-Dg7s8bK4.js} +1 -1
  122. package/dist/client/assets/{store-8UHU7otF.js → store-CPWqUmyF.js} +1 -1
  123. package/dist/client/assets/store-registry-BbL6NKlA.js +2 -0
  124. package/dist/client/assets/{switch-DIHVY0RD.js → switch-B4qY2cAW.js} +1 -1
  125. package/dist/client/assets/{table-pLgWKqqj.js → table-tkXjFnMe.js} +1 -1
  126. package/dist/client/assets/{tabs-B36z-iXu.js → tabs-wvEgEfW5.js} +1 -1
  127. package/dist/client/assets/{task-status-zPChwtIb.js → task-status-DHF3W_Oc.js} +1 -1
  128. package/dist/client/assets/{textarea-BJm0Tf5N.js → textarea-hPI8GSZO.js} +1 -1
  129. package/dist/client/assets/{toggle-group-BCvX9smm.js → toggle-group-D0qc93NL.js} +1 -1
  130. package/dist/client/assets/{tools-list-DsW7X9uH.js → tools-list-D_CH2LCo.js} +1 -1
  131. package/dist/client/assets/{tooltip-DK9ITTps.js → tooltip-mh5HW7ZO.js} +1 -1
  132. package/dist/client/assets/{types-CHJA9iY7.js → types-DmP7ytXf.js} +1 -1
  133. package/dist/client/assets/{use-ai-providers-Wa05FQa-.js → use-ai-providers-BsD7sWlS.js} +1 -1
  134. package/dist/client/assets/{use-collections-DEtL7TsG.js → use-collections-Bj_MIMYU.js} +1 -1
  135. package/dist/client/assets/{use-connection-BA7MX_A_.js → use-connection-C1Huhuv0.js} +1 -1
  136. package/dist/client/assets/{use-copy-B_9_NtCX.js → use-copy-Vr-WiQt5.js} +1 -1
  137. package/dist/client/assets/{use-create-virtual-mcp-BWms3_Wm.js → use-create-virtual-mcp-BrRlmCqc.js} +1 -1
  138. package/dist/client/assets/{use-debounced-autosave-RQpwA8uI.js → use-debounced-autosave-yq4OwEo1.js} +1 -1
  139. package/dist/client/assets/{use-decopilot-events-CAAYd06u.js → use-decopilot-events-DU6d8uCa.js} +1 -1
  140. package/dist/client/assets/{use-delete-connection-mhnpE7ro.js → use-delete-connection-CfYt6XCO.js} +1 -1
  141. package/dist/client/assets/{use-infinite-scroll-CM8Ra6DF.js → use-infinite-scroll-N5zwi7TE.js} +1 -1
  142. package/dist/client/assets/{use-list-state-BWx4o2vn.js → use-list-state-BqbT3RUK.js} +1 -1
  143. package/dist/client/assets/{use-mcp-tools-D_JiTODV.js → use-mcp-tools-CDiw0vXX.js} +1 -1
  144. package/dist/client/assets/{use-members-Dh6NCni1.js → use-members-BaAd9sSt.js} +1 -1
  145. package/dist/client/assets/{use-navigate-to-agent-Cr_ZMHfb.js → use-navigate-to-agent-JbrD8A1R.js} +1 -1
  146. package/dist/client/assets/{use-org-auth-client-D8ifGvzT.js → use-org-auth-client-BQtfAiH5.js} +1 -1
  147. package/dist/client/assets/{use-org-sso-IjJZMJF0.js → use-org-sso-qmLHQ9XF.js} +1 -1
  148. package/dist/client/assets/{use-organization-roles-sdfgjrG3.js → use-organization-roles-Sgkr0Ix4.js} +1 -1
  149. package/dist/client/assets/{use-organization-settings-ZtHNr_4_.js → use-organization-settings-D3c1eAkJ.js} +1 -1
  150. package/dist/client/assets/{use-registry-connections-C9TouqtJ.js → use-registry-connections-C6aVUyvC.js} +1 -1
  151. package/dist/client/assets/{use-status-sounds-BEFDLRaR.js → use-status-sounds-DICuWgmF.js} +1 -1
  152. package/dist/client/assets/{use-tasks-DZC5fx2d.js → use-tasks-Dw1R9K3S.js} +1 -1
  153. package/dist/client/assets/{use-view-mode-C1XifkB4.js → use-view-mode-DhSDMztv.js} +1 -1
  154. package/dist/client/assets/{use-virtual-mcp-w_wFYi9Y.js → use-virtual-mcp-BhZKmvOZ.js} +1 -1
  155. package/dist/client/assets/useInfiniteQuery-B2eIGcfO.js +1 -0
  156. package/dist/client/assets/useSuspenseInfiniteQuery-Yn6IM0vI.js +1 -0
  157. package/dist/client/assets/{user-BHWnxivf.js → user-CjG66nlK.js} +1 -1
  158. package/dist/client/assets/{view-mode-toggle-DUYrFi8F.js → view-mode-toggle-DZcY_eG-.js} +1 -1
  159. package/dist/client/assets/{workflow-CAeRJIAh.js → workflow-CaMuJTBT.js} +1 -1
  160. package/dist/client/assets/workflow-detail-DbigvtdD.js +1 -0
  161. package/dist/client/index.html +1 -1
  162. package/dist/server/cli.js +10 -2
  163. package/dist/server/node_modules/is-fullwidth-code-point/index.d.ts +17 -0
  164. package/dist/server/node_modules/is-fullwidth-code-point/index.js +12 -0
  165. package/dist/server/node_modules/is-fullwidth-code-point/license +9 -0
  166. package/dist/server/node_modules/is-fullwidth-code-point/package.json +53 -0
  167. package/dist/server/node_modules/is-fullwidth-code-point/readme.md +31 -0
  168. package/dist/server/node_modules/mimic-fn/index.d.ts +54 -0
  169. package/dist/server/node_modules/mimic-fn/index.js +13 -0
  170. package/dist/server/node_modules/mimic-fn/license +9 -0
  171. package/dist/server/node_modules/mimic-fn/package.json +42 -0
  172. package/dist/server/node_modules/mimic-fn/readme.md +69 -0
  173. package/dist/server/node_modules/pg-int8/LICENSE +13 -0
  174. package/dist/server/node_modules/pg-int8/README.md +16 -0
  175. package/dist/server/node_modules/pg-int8/index.js +100 -0
  176. package/dist/server/node_modules/pg-int8/package.json +24 -0
  177. package/dist/server/node_modules/postgres-array/index.d.ts +4 -0
  178. package/dist/server/node_modules/postgres-array/index.js +97 -0
  179. package/dist/server/node_modules/postgres-array/license +21 -0
  180. package/dist/server/node_modules/postgres-array/package.json +35 -0
  181. package/dist/server/node_modules/postgres-array/readme.md +43 -0
  182. package/dist/server/node_modules/postgres-date/index.js +116 -0
  183. package/dist/server/node_modules/postgres-date/license +21 -0
  184. package/dist/server/node_modules/postgres-date/package.json +33 -0
  185. package/dist/server/node_modules/postgres-date/readme.md +49 -0
  186. package/dist/server/node_modules/postgres-interval/index.d.ts +20 -0
  187. package/dist/server/node_modules/postgres-interval/index.js +125 -0
  188. package/dist/server/node_modules/postgres-interval/license +21 -0
  189. package/dist/server/node_modules/postgres-interval/package.json +36 -0
  190. package/dist/server/node_modules/postgres-interval/readme.md +48 -0
  191. package/dist/server/node_modules/xtend/.jshintrc +30 -0
  192. package/dist/server/node_modules/xtend/LICENSE +20 -0
  193. package/dist/server/node_modules/xtend/README.md +32 -0
  194. package/dist/server/node_modules/xtend/immutable.js +19 -0
  195. package/dist/server/node_modules/xtend/mutable.js +17 -0
  196. package/dist/server/node_modules/xtend/package.json +55 -0
  197. package/dist/server/node_modules/xtend/test.js +103 -0
  198. package/dist/server/server.js +9 -1
  199. package/package.json +1 -1
  200. package/dist/client/assets/ai-providers-BTcrVDAh.js +0 -1
  201. package/dist/client/assets/index-Di6eCNBZ.js +0 -1
  202. package/dist/client/assets/registry-KydgQONl.js +0 -2
  203. package/dist/client/assets/store-registry-JV-2CVIA.js +0 -2
  204. package/dist/client/assets/useInfiniteQuery-tCVYDURJ.js +0 -1
  205. package/dist/client/assets/useSuspenseInfiniteQuery-hHdMeBLO.js +0 -1
  206. package/dist/client/assets/workflow-detail-CsmAVzf-.js +0 -1
@@ -1 +1 @@
1
- import{e as b,s as k,o as E,bM as P,j as i,X as K,aG as _,K as S,x as q}from"./index-n0iHPcte.js";import{P as x}from"./index-CVzq_PSm.js";import{e as I}from"./use-organization-settings-ZtHNr_4_.js";import{S as Q}from"./switch-DIHVY0RD.js";import{n as R}from"./Container-C9S2fJrQ.js";import{b as w,S as z,a as F,d as M}from"./settings-section-gdfEnAUq.js";import"./tooltip-DK9ITTps.js";import"./X-DzLPqoAC.js";import"./constants-DsSHL62C.js";import"./card-uZ87GViI.js";import"./ArrowUpRight-havdJdQt.js";function N(){const e=b.c(17),{org:t,project:s}=k(),o=E();let d;e[0]!==s.enabledPlugins?(d=s.enabledPlugins??[],e[0]=s.enabledPlugins,e[1]=d):d=e[1];const c=d,l=I();let m;e[2]!==t||e[3]!==s.slug||e[4]!==o?(m=()=>{o.invalidateQueries({queryKey:S.project(t.id,s.slug)}),o.invalidateQueries({queryKey:S.projects(t.id)}),o.invalidateQueries({predicate:n=>{const r=n.queryKey;return r[1]===t.id&&r[3]==="collection"&&r[4]==="VIRTUAL_MCP"}})},e[2]=t,e[3]=s.slug,e[4]=o,e[5]=m):m=e[5];const j=m;let g;e[6]!==j||e[7]!==l||e[8]!==c?(g=(n,r)=>{const u=new Set(c);r?u.add(n):u.delete(n),l.mutate({enabled_plugins:Array.from(u)},{onSuccess:j,onError:A})},e[6]=j,e[7]=l,e[8]=c,e[9]=g):g=e[9];const p=g,y=$,C=U;if(P.length===0){let n;return e[10]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsx("p",{className:"text-sm text-muted-foreground",children:"No plugins available."}),e[10]=n):n=e[10],n}let a;e[11]!==p||e[12]!==l||e[13]!==c?(a=P.map(n=>{const r=y(n.id),u=C(n.id),h=c.includes(n.id);return i.jsx(w,{title:r?.label??n.id,description:u??void 0,icon:i.jsx("span",{className:"text-muted-foreground [&>svg]:size-4",children:r?.icon??i.jsx(R,{size:14})}),onClick:()=>!l.isPending&&p(n.id,!h),action:i.jsx(Q,{checked:h,onCheckedChange:v=>p(n.id,v),disabled:l.isPending,onClick:T})},n.id)}),e[11]=p,e[12]=l,e[13]=c,e[14]=a):a=e[14];let f;return e[15]!==a?(f=i.jsx(z,{children:i.jsx(F,{children:a})}),e[15]=a,e[16]=f):f=e[16],f}function T(e){return e.stopPropagation()}function U(e){return P.find(s=>s.id===e)?.description??null}function $(e){const t=K.find(o=>o.pluginId===e);if(t)return{label:t.label,icon:t.items[0]?.icon};const s=_.find(o=>o.pluginId===e);return s?{label:s.label,icon:s.icon}:null}function A(e){q.error("Failed to update plugin: "+(e instanceof Error?e.message:"Unknown error"))}function D(){const e=b.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=i.jsx(x,{children:i.jsx(x.Content,{children:i.jsx(x.Body,{children:i.jsxs(M,{children:[i.jsx(x.Title,{children:"Plugins"}),i.jsx(N,{})]})})})}),e[0]=t):t=e[0],t}function ee(){const e=b.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=i.jsx(D,{}),e[0]=t):t=e[0],t}export{ee as default};
1
+ import{e as b,s as k,o as E,bM as P,j as i,X as K,aG as _,K as S,x as q}from"./index-D-AchbAp.js";import{P as x}from"./index-D-Sd8524.js";import{e as I}from"./use-organization-settings-D3c1eAkJ.js";import{S as Q}from"./switch-B4qY2cAW.js";import{n as R}from"./Container-CaXLIAOI.js";import{b as w,S as z,a as F,d as M}from"./settings-section-Bqaz9XGD.js";import"./tooltip-mh5HW7ZO.js";import"./X-D9eppmZ5.js";import"./constants-RWvzCl_g.js";import"./card-B46IKqYa.js";import"./ArrowUpRight-uN4rpxFQ.js";function N(){const e=b.c(17),{org:t,project:s}=k(),o=E();let d;e[0]!==s.enabledPlugins?(d=s.enabledPlugins??[],e[0]=s.enabledPlugins,e[1]=d):d=e[1];const c=d,l=I();let m;e[2]!==t||e[3]!==s.slug||e[4]!==o?(m=()=>{o.invalidateQueries({queryKey:S.project(t.id,s.slug)}),o.invalidateQueries({queryKey:S.projects(t.id)}),o.invalidateQueries({predicate:n=>{const r=n.queryKey;return r[1]===t.id&&r[3]==="collection"&&r[4]==="VIRTUAL_MCP"}})},e[2]=t,e[3]=s.slug,e[4]=o,e[5]=m):m=e[5];const j=m;let g;e[6]!==j||e[7]!==l||e[8]!==c?(g=(n,r)=>{const u=new Set(c);r?u.add(n):u.delete(n),l.mutate({enabled_plugins:Array.from(u)},{onSuccess:j,onError:A})},e[6]=j,e[7]=l,e[8]=c,e[9]=g):g=e[9];const p=g,y=$,C=U;if(P.length===0){let n;return e[10]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsx("p",{className:"text-sm text-muted-foreground",children:"No plugins available."}),e[10]=n):n=e[10],n}let a;e[11]!==p||e[12]!==l||e[13]!==c?(a=P.map(n=>{const r=y(n.id),u=C(n.id),h=c.includes(n.id);return i.jsx(w,{title:r?.label??n.id,description:u??void 0,icon:i.jsx("span",{className:"text-muted-foreground [&>svg]:size-4",children:r?.icon??i.jsx(R,{size:14})}),onClick:()=>!l.isPending&&p(n.id,!h),action:i.jsx(Q,{checked:h,onCheckedChange:v=>p(n.id,v),disabled:l.isPending,onClick:T})},n.id)}),e[11]=p,e[12]=l,e[13]=c,e[14]=a):a=e[14];let f;return e[15]!==a?(f=i.jsx(z,{children:i.jsx(F,{children:a})}),e[15]=a,e[16]=f):f=e[16],f}function T(e){return e.stopPropagation()}function U(e){return P.find(s=>s.id===e)?.description??null}function $(e){const t=K.find(o=>o.pluginId===e);if(t)return{label:t.label,icon:t.items[0]?.icon};const s=_.find(o=>o.pluginId===e);return s?{label:s.label,icon:s.icon}:null}function A(e){q.error("Failed to update plugin: "+(e instanceof Error?e.message:"Unknown error"))}function D(){const e=b.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=i.jsx(x,{children:i.jsx(x.Content,{children:i.jsx(x.Body,{children:i.jsxs(M,{children:[i.jsx(x.Title,{children:"Plugins"}),i.jsx(N,{})]})})})}),e[0]=t):t=e[0],t}function ee(){const e=b.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=i.jsx(D,{}),e[0]=t):t=e[0],t}export{ee as default};
@@ -1 +1 @@
1
- import{bW as b,e as f,j as c,D as C,r as d,c as p,aY as j,bX as v,bY as h}from"./index-n0iHPcte.js";import{L as N}from"./label-DWRjHkWy.js";const E=b,g=d.createContext({}),M=t=>{const e=f.c(9);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let o;e[2]!==s.name?(o={name:s.name},e[2]=s.name,e[3]=o):o=e[3];let n;e[4]!==s?(n=c.jsx(C,{...s}),e[4]=s,e[5]=n):n=e[5];let r;return e[6]!==o||e[7]!==n?(r=c.jsx(g.Provider,{value:o,children:n}),e[6]=o,e[7]=n,e[8]=r):r=e[8],r},x=()=>{const t=f.c(13),e=d.useContext(g),s=d.useContext($),{getFieldState:o}=v();let n;t[0]!==e.name?(n={name:e.name},t[0]=e.name,t[1]=n):n=t[1];const r=h(n);let a;t[2]!==e.name||t[3]!==r||t[4]!==o?(a=o(e.name,r),t[2]=e.name,t[3]=r,t[4]=o,t[5]=a):a=t[5];const l=a;if(!e)throw new Error("useFormField should be used within <FormField>");const{id:i}=s,m=`${i}-form-item`,F=`${i}-form-item-description`,I=`${i}-form-item-message`;let u;return t[6]!==e.name||t[7]!==l||t[8]!==i||t[9]!==m||t[10]!==F||t[11]!==I?(u={id:i,name:e.name,formItemId:m,formDescriptionId:F,formMessageId:I,...l},t[6]=e.name,t[7]=l,t[8]=i,t[9]=m,t[10]=F,t[11]=I,t[12]=u):u=t[12],u},$=d.createContext({});function w(t){const e=f.c(13);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const n=d.useId();let r;e[3]!==n?(r={id:n},e[3]=n,e[4]=r):r=e[4];let a;e[5]!==s?(a=p("grid gap-2",s),e[5]=s,e[6]=a):a=e[6];let l;e[7]!==o||e[8]!==a?(l=c.jsx("div",{"data-slot":"form-item",className:a,...o}),e[7]=o,e[8]=a,e[9]=l):l=e[9];let i;return e[10]!==r||e[11]!==l?(i=c.jsx($.Provider,{value:r,children:l}),e[10]=r,e[11]=l,e[12]=i):i=e[12],i}function L(t){const e=f.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:n,formItemId:r}=x(),a=!!n;let l;e[3]!==s?(l=p("text-foreground data-[error=true]:text-destructive",s),e[3]=s,e[4]=l):l=e[4];let i;return e[5]!==r||e[6]!==o||e[7]!==a||e[8]!==l?(i=c.jsx(N,{"data-slot":"form-label","data-error":a,className:l,htmlFor:r,...o}),e[5]=r,e[6]=o,e[7]=a,e[8]=l,e[9]=i):i=e[9],i}function P(t){const e=f.c(7);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];const{error:o,formItemId:n,formDescriptionId:r,formMessageId:a}=x(),l=o?`${r} ${a}`:`${r}`,i=!!o;let m;return e[2]!==n||e[3]!==s||e[4]!==l||e[5]!==i?(m=c.jsx(j,{"data-slot":"form-control",id:n,"aria-describedby":l,"aria-invalid":i,...s}),e[2]=n,e[3]=s,e[4]=l,e[5]=i,e[6]=m):m=e[6],m}function y(t){const e=f.c(9);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{formDescriptionId:n}=x();let r;e[3]!==s?(r=p("text-muted-foreground text-sm",s),e[3]=s,e[4]=r):r=e[4];let a;return e[5]!==n||e[6]!==o||e[7]!==r?(a=c.jsx("p",{"data-slot":"form-description",id:n,className:r,...o}),e[5]=n,e[6]=o,e[7]=r,e[8]=a):a=e[8],a}function R(t){const e=f.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:n,formMessageId:r}=x(),a=n?String(n?.message??""):o.children;if(!a)return null;let l;e[3]!==s?(l=p("text-destructive text-sm",s),e[3]=s,e[4]=l):l=e[4];let i;return e[5]!==a||e[6]!==r||e[7]!==o||e[8]!==l?(i=c.jsx("p",{"data-slot":"form-message",id:r,className:l,...o,children:a}),e[5]=a,e[6]=r,e[7]=o,e[8]=l,e[9]=i):i=e[9],i}export{M as F,E as a,w as b,L as c,P as d,y as e,R as f};
1
+ import{bW as b,e as f,j as c,D as C,r as d,c as p,aY as j,bX as v,bY as h}from"./index-D-AchbAp.js";import{L as N}from"./label-CIwIDYzF.js";const E=b,g=d.createContext({}),M=t=>{const e=f.c(9);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let o;e[2]!==s.name?(o={name:s.name},e[2]=s.name,e[3]=o):o=e[3];let n;e[4]!==s?(n=c.jsx(C,{...s}),e[4]=s,e[5]=n):n=e[5];let r;return e[6]!==o||e[7]!==n?(r=c.jsx(g.Provider,{value:o,children:n}),e[6]=o,e[7]=n,e[8]=r):r=e[8],r},x=()=>{const t=f.c(13),e=d.useContext(g),s=d.useContext($),{getFieldState:o}=v();let n;t[0]!==e.name?(n={name:e.name},t[0]=e.name,t[1]=n):n=t[1];const r=h(n);let a;t[2]!==e.name||t[3]!==r||t[4]!==o?(a=o(e.name,r),t[2]=e.name,t[3]=r,t[4]=o,t[5]=a):a=t[5];const l=a;if(!e)throw new Error("useFormField should be used within <FormField>");const{id:i}=s,m=`${i}-form-item`,F=`${i}-form-item-description`,I=`${i}-form-item-message`;let u;return t[6]!==e.name||t[7]!==l||t[8]!==i||t[9]!==m||t[10]!==F||t[11]!==I?(u={id:i,name:e.name,formItemId:m,formDescriptionId:F,formMessageId:I,...l},t[6]=e.name,t[7]=l,t[8]=i,t[9]=m,t[10]=F,t[11]=I,t[12]=u):u=t[12],u},$=d.createContext({});function w(t){const e=f.c(13);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const n=d.useId();let r;e[3]!==n?(r={id:n},e[3]=n,e[4]=r):r=e[4];let a;e[5]!==s?(a=p("grid gap-2",s),e[5]=s,e[6]=a):a=e[6];let l;e[7]!==o||e[8]!==a?(l=c.jsx("div",{"data-slot":"form-item",className:a,...o}),e[7]=o,e[8]=a,e[9]=l):l=e[9];let i;return e[10]!==r||e[11]!==l?(i=c.jsx($.Provider,{value:r,children:l}),e[10]=r,e[11]=l,e[12]=i):i=e[12],i}function L(t){const e=f.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:n,formItemId:r}=x(),a=!!n;let l;e[3]!==s?(l=p("text-foreground data-[error=true]:text-destructive",s),e[3]=s,e[4]=l):l=e[4];let i;return e[5]!==r||e[6]!==o||e[7]!==a||e[8]!==l?(i=c.jsx(N,{"data-slot":"form-label","data-error":a,className:l,htmlFor:r,...o}),e[5]=r,e[6]=o,e[7]=a,e[8]=l,e[9]=i):i=e[9],i}function P(t){const e=f.c(7);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];const{error:o,formItemId:n,formDescriptionId:r,formMessageId:a}=x(),l=o?`${r} ${a}`:`${r}`,i=!!o;let m;return e[2]!==n||e[3]!==s||e[4]!==l||e[5]!==i?(m=c.jsx(j,{"data-slot":"form-control",id:n,"aria-describedby":l,"aria-invalid":i,...s}),e[2]=n,e[3]=s,e[4]=l,e[5]=i,e[6]=m):m=e[6],m}function y(t){const e=f.c(9);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{formDescriptionId:n}=x();let r;e[3]!==s?(r=p("text-muted-foreground text-sm",s),e[3]=s,e[4]=r):r=e[4];let a;return e[5]!==n||e[6]!==o||e[7]!==r?(a=c.jsx("p",{"data-slot":"form-description",id:n,className:r,...o}),e[5]=n,e[6]=o,e[7]=r,e[8]=a):a=e[8],a}function R(t){const e=f.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:n,formMessageId:r}=x(),a=n?String(n?.message??""):o.children;if(!a)return null;let l;e[3]!==s?(l=p("text-destructive text-sm",s),e[3]=s,e[4]=l):l=e[4];let i;return e[5]!==a||e[6]!==r||e[7]!==o||e[8]!==l?(i=c.jsx("p",{"data-slot":"form-message",id:r,className:l,...o,children:a}),e[5]=a,e[6]=r,e[7]=o,e[8]=l,e[9]=i):i=e[9],i}export{M as F,E as a,w as b,L as c,P as d,y as e,R as f};
@@ -1 +1 @@
1
- import{f as re,s as ce,o as de,z as me,C as ue,a as fe,t as Y,x as V,K as te,j as s,D as se,H as ge,J as W,e as L,r as H,B as G,c as xe,M as pe}from"./index-n0iHPcte.js";import{P as q}from"./index-CVzq_PSm.js";import{u as he}from"./use-org-auth-client-D8ifGvzT.js";import{u as je}from"./use-debounced-autosave-RQpwA8uI.js";import{A as ve}from"./avatar-CtlfIArZ.js";import{I as be}from"./input-DEYTwRzn.js";import{S as X,a as Z,b as Q,c as ye,d as Se}from"./settings-section-gdfEnAUq.js";import{D as Ne}from"./domain-settings-D1FHhwCI.js";import{u as Ce,a as ne,D as we,c as _e,S as ze,v as De,K as Ae,P as ke,d as Pe,C as Ie,s as Ee,b as Oe,e as Te}from"./collection-search-CrNavgfW.js";import{W as ee,i as Re}from"./constants-DsSHL62C.js";import{b as le}from"./use-virtual-mcp-w_wFYi9Y.js";import{b as Fe,P as Le,a as $e}from"./popover-BDSYEq1Z.js";import{S as Me}from"./skeleton-B66wWsdL.js";import{y as Be}from"./agent-icon-D-W_-Msq.js";import{s as Ve}from"./Plus-BxG8Erza.js";import{a as ae}from"./Users03-DG3Gfjoh.js";import{i as He}from"./X-DzLPqoAC.js";import{I as J}from"./integration-icon-Bkie-XyL.js";import{a as Ke,d as Ue}from"./use-organization-settings-ZtHNr_4_.js";import"./tooltip-DK9ITTps.js";import"./User01-BZ9BWkFc.js";import"./card-uZ87GViI.js";import"./ArrowUpRight-havdJdQt.js";import"./unwrap-tool-result-BYXdCQMg.js";import"./switch-DIHVY0RD.js";import"./SearchMd-JVaJZdXg.js";import"./use-collections-DEtL7TsG.js";import"./AlertCircle-CFABZy3o.js";import"./Tool01-Bhj2T1uN.js";import"./XClose-0biyZ-nq.js";import"./RefreshCcw01-DdgK7Krp.js";import"./ArrowNarrowLeft-qjcSXUou.js";import"./XCircle-DTJod2tn.js";import"./ZapSquare-DtdkchqU.js";import"./CheckCircle-D7ReuLNV.js";import"./Check-4wEPFmVT.js";import"./ChevronDown-CLwgC4lc.js";import"./ChevronRight-DW27S4dx.js";import"./ChevronUp-DAW3-3dA.js";import"./DotsVertical-BReL32xd.js";import"./Container-C9S2fJrQ.js";import"./Star01-DEmigL_c.js";import"./Palette-Dtg_tDlg.js";import"./LinkExternal01-0Xs4UV_i.js";import"./Lock01-BjKqD6QN.js";import"./Sun-TDfj1GPd.js";import"./Play-85A9faRd.js";import"./Settings02-BZivkDIL.js";import"./Shield01-CAl07SGJ.js";import"./Trash01-CdymalYb.js";import"./Zap-aKe8CYDP.js";const qe=ge({name:W().min(1,"Name is required").max(255,"Name is too long"),slug:W().min(1,"Slug is required").max(50,"Slug is too long").regex(/^[a-z0-9-]+$/,"Slug must contain only lowercase letters, numbers, and hyphens"),logo:W().optional()});function Ge(t){const e=L.c(13),{value:r,onChange:l,name:a,disabled:d}=t,n=H.useRef(null);let j;e[0]===Symbol.for("react.memo_cache_sentinel")?(j=()=>n.current?.click(),e[0]=j):j=e[0];const u=j;let v;e[1]!==l?(v=z=>{const p=z.target.files?.[0];if(!p)return;if(p.size>2097152){V.error("Image must be smaller than 2MB");return}const b=new FileReader;b.onerror=We,b.onloadend=()=>{b.result&&l(b.result),n.current&&(n.current.value="")},b.readAsDataURL(p)},e[1]=l,e[2]=v):v=e[2];const o=v;let i;e[3]!==d||e[4]!==o?(i=s.jsx("input",{ref:n,type:"file",accept:"image/*",onChange:o,className:"hidden",disabled:d}),e[3]=d,e[4]=o,e[5]=i):i=e[5];const m=r||void 0,g=a??"?";let f;e[6]!==m||e[7]!==g?(f=s.jsx(ve,{url:m,fallback:g,shape:"square",size:"base"}),e[6]=m,e[7]=g,e[8]=f):f=e[8];let x;return e[9]!==d||e[10]!==i||e[11]!==f?(x=s.jsxs("button",{type:"button",onClick:u,disabled:d,className:"rounded-lg overflow-hidden hover:ring-2 hover:ring-border transition-all disabled:opacity-50","aria-label":"Upload organization logo",children:[i,f]}),e[9]=d,e[10]=i,e[11]=f,e[12]=x):x=e[12],x}function We(){return V.error("Failed to read image")}function Qe(){const t=re(),{org:e}=ce(),r=he(),l=de(),a=me({resolver:ue(qe),values:{name:e.name??"",slug:e.slug??"",logo:e.logo??""}}),d=fe({mutationFn:async o=>{const i={name:o.name,slug:o.slug};o.logo&&(i.logo=o.logo);const m=await r.organization.update({data:i});if(m?.error)throw new Error(m.error.message||"Failed to update organization");return m},onSuccess:(o,i)=>{Y("organization_settings_updated",{organization_id:e.id,fields:Object.keys(i)}),l.invalidateQueries({queryKey:te.organizations()}),l.invalidateQueries({queryKey:te.activeOrganization(e.slug)}),V.success("Organization updated successfully"),o?.data?.slug&&o.data.slug!==e.slug&&t({to:"/$org/settings/general",params:{org:o.data.slug}})},onError:(o,i)=>{Y("organization_settings_update_failed",{organization_id:e.id,fields:Object.keys(i),error:o instanceof Error?o.message:String(o)}),V.error(o instanceof Error?o.message:"Failed to update organization")}}),{schedule:n,flush:j}=je({save:async()=>{const o=a.control._formState.dirtyFields;if(Object.keys(o).length===0||!await a.trigger())return;const m=a.getValues(),g=a.control._defaultValues;a.reset(m,{keepValues:!0});try{await d.mutateAsync(m)}catch{a.reset(g,{keepValues:!0})}}}),u=a.formState.errors,v=typeof window<"u"?`${window.location.host}/`:"";return s.jsx(X,{children:s.jsxs(Z,{children:[s.jsx(Q,{title:"Logo",description:"Recommended size is 256x256px",action:s.jsx(Ge,{value:a.watch("logo"),onChange:o=>{a.setValue("logo",o??"",{shouldDirty:!0}),j()},name:a.watch("name")})}),s.jsx(Q,{title:"Name",action:s.jsx(se,{control:a.control,name:"name",render:({field:o})=>s.jsx(be,{id:"org-name",...o,onChange:i=>{o.onChange(i),n()},onBlur:()=>{o.onBlur(),j()},placeholder:"Organization name",className:"w-[280px]"})})}),s.jsx(Q,{title:"URL",action:s.jsxs("div",{className:"flex items-center w-[280px] rounded-md border border-input bg-input/30 focus-within:ring-2 focus-within:ring-ring/50 overflow-hidden",children:[v&&s.jsx("span",{className:"pl-3 text-sm text-muted-foreground select-none",children:v}),s.jsx(se,{control:a.control,name:"slug",render:({field:o})=>s.jsx("input",{id:"org-slug",value:o.value??"",name:o.name,ref:o.ref,placeholder:"my-organization",className:"flex-1 min-w-0 bg-transparent px-2 py-1.5 text-sm text-foreground placeholder:text-muted-foreground/60 outline-none",onChange:i=>{const m=i.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"");a.setValue("slug",m,{shouldDirty:!0,shouldTouch:!0,shouldValidate:!0}),n()},onBlur:()=>{o.onBlur(),j()}})})]})}),(u.name||u.slug||u.logo)&&s.jsxs("div",{className:"px-5 pb-3 flex flex-col gap-1",children:[u.name&&s.jsx("p",{className:"text-xs text-destructive",children:u.name.message}),u.slug&&s.jsx("p",{className:"text-xs text-destructive",children:u.slug.message}),u.logo&&s.jsx("p",{className:"text-xs text-destructive",children:u.logo.message})]})]})})}const oe=["site-editor","site-diagnostics","ai-image","ai-research"],ie=8;function Ye(t,e,r){const l=e.find(d=>d.id===t);if(l)return{id:l.id,title:l.title,icon:l.icon,kind:"template"};const a=r.find(d=>d.id===t);return a?{id:t,title:a.title,icon:a.icon??null,kind:"custom"}:{id:t,title:t,icon:null,kind:"missing"}}function Je(t){const e=L.c(39),{agent:r,onRemove:l}=t;let a;e[0]!==r.id?(a={id:r.id},e[0]=r.id,e[1]=a):a=e[1];const{attributes:d,listeners:n,setNodeRef:j,transform:u,transition:v,isDragging:o}=Pe(a);let i;e[2]!==u?(i=Ie.Transform.toString(u),e[2]=u,e[3]=i):i=e[3];const m=o?.5:void 0,g=o?100:void 0;let f;e[4]!==i||e[5]!==m||e[6]!==g||e[7]!==v?(f={transform:i,transition:v,opacity:m,zIndex:g},e[4]=i,e[5]=m,e[6]=g,e[7]=v,e[8]=f):f=e[8];const x=f,z=o&&"shadow-lg";let p;e[9]!==z?(p=xe("flex items-center gap-3 px-3 py-2 rounded-lg border border-border bg-background",z),e[9]=z,e[10]=p):p=e[10];const b=`Drag to reorder ${r.title}`;let D;e[11]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsx(Be,{size:14}),e[11]=D):D=e[11];let P;e[12]!==d||e[13]!==n||e[14]!==b?(P=s.jsx("button",{type:"button",...d,...n,className:"text-muted-foreground hover:text-foreground cursor-grab active:cursor-grabbing","aria-label":b,children:D}),e[12]=d,e[13]=n,e[14]=b,e[15]=P):P=e[15];let N;e[16]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(ae,{size:14}),e[16]=N):N=e[16];let w;e[17]!==r.icon||e[18]!==r.title?(w=s.jsx(J,{icon:r.icon,name:r.title,size:"xs",fallbackIcon:N}),e[17]=r.icon,e[18]=r.title,e[19]=w):w=e[19];let y;e[20]!==r.title?(y=s.jsx("span",{className:"text-sm text-foreground truncate",children:r.title}),e[20]=r.title,e[21]=y):y=e[21];const _=r.kind==="template"?"Template":r.kind==="custom"?"Custom agent":"Unavailable";let h;e[22]!==_?(h=s.jsx("span",{className:"text-xs text-muted-foreground",children:_}),e[22]=_,e[23]=h):h=e[23];let S;e[24]!==y||e[25]!==h?(S=s.jsxs("div",{className:"flex flex-col min-w-0 flex-1",children:[y,h]}),e[24]=y,e[25]=h,e[26]=S):S=e[26];const I=`Remove ${r.title}`;let A;e[27]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx(He,{size:14}),e[27]=A):A=e[27];let C;e[28]!==l||e[29]!==I?(C=s.jsx("button",{type:"button",onClick:l,className:"text-muted-foreground hover:text-foreground p-1 rounded","aria-label":I,children:A}),e[28]=l,e[29]=I,e[30]=C):C=e[30];let k;return e[31]!==j||e[32]!==x||e[33]!==P||e[34]!==w||e[35]!==S||e[36]!==C||e[37]!==p?(k=s.jsxs("div",{ref:j,style:x,className:p,children:[P,w,S,C]}),e[31]=j,e[32]=x,e[33]=P,e[34]=w,e[35]=S,e[36]=C,e[37]=p,e[38]=k):k=e[38],k}function Xe(t){const e=L.c(48),{selectedIds:r,onAdd:l}=t,[a,d]=H.useState(!1),[n,j]=H.useState(""),u=le();let v;e[0]!==r?(v=new Set(r),e[0]=r,e[1]=v):v=e[1];const o=v;let i,m,g,f,x,z,p,b,D,P,N,w,y;if(e[2]!==u||e[3]!==l||e[4]!==a||e[5]!==n||e[6]!==o){const A=n.toLowerCase();f=ee.filter(c=>!o.has(c.id)&&(!n||c.title.toLowerCase().includes(A)));let C;e[20]!==o?(C=c=>c.id!==null&&!Re(c.id)&&!o.has(c.id),e[20]=o,e[21]=C):C=e[21],g=u.filter(C).filter(c=>!n||c.title.toLowerCase().includes(A));let k;e[22]!==l?(k=c=>{l(c),d(!1),j("")},e[22]=l,e[23]=k):k=e[23];const O=k;m=Fe,w=a,y=d,e[24]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(Le,{asChild:!0,children:s.jsxs(G,{type:"button",variant:"outline",size:"sm",children:[s.jsx(Ve,{size:14}),"Add agent"]})}),e[24]=x):x=e[24],i=$e,D="w-[320px] p-0 overflow-hidden",P="start",e[25]!==n?(N=s.jsx(Te,{value:n,onChange:j,placeholder:"Search agents..."}),e[25]=n,e[26]=N):N=e[26],z="max-h-[320px] overflow-y-auto p-2 flex flex-col gap-3",p=f.length>0&&s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground px-1",children:"Templates"}),f.map(c=>s.jsxs("button",{type:"button",onClick:()=>O(c.id),className:"flex items-center gap-2 px-2 py-1.5 rounded-md hover:bg-accent text-left",children:[s.jsx(J,{icon:c.icon,name:c.title,size:"xs"}),s.jsx("span",{className:"text-sm truncate",children:c.title})]},c.id))]}),b=g.length>0&&s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground px-1",children:"Custom agents"}),g.map(c=>s.jsxs("button",{type:"button",onClick:()=>O(c.id),className:"flex items-center gap-2 px-2 py-1.5 rounded-md hover:bg-accent text-left",children:[s.jsx(J,{icon:c.icon,name:c.title,size:"xs",fallbackIcon:s.jsx(ae,{size:14})}),s.jsx("span",{className:"text-sm truncate",children:c.title})]},c.id))]}),e[2]=u,e[3]=l,e[4]=a,e[5]=n,e[6]=o,e[7]=i,e[8]=m,e[9]=g,e[10]=f,e[11]=x,e[12]=z,e[13]=p,e[14]=b,e[15]=D,e[16]=P,e[17]=N,e[18]=w,e[19]=y}else i=e[7],m=e[8],g=e[9],f=e[10],x=e[11],z=e[12],p=e[13],b=e[14],D=e[15],P=e[16],N=e[17],w=e[18],y=e[19];let _;e[27]!==g||e[28]!==f.length||e[29]!==n?(_=f.length===0&&g.length===0&&s.jsx("div",{className:"text-xs text-muted-foreground text-center py-6",children:n?"No agents found":"All agents are already added"}),e[27]=g,e[28]=f.length,e[29]=n,e[30]=_):_=e[30];let h;e[31]!==_||e[32]!==z||e[33]!==p||e[34]!==b?(h=s.jsxs("div",{className:z,children:[p,b,_]}),e[31]=_,e[32]=z,e[33]=p,e[34]=b,e[35]=h):h=e[35];let S;e[36]!==i||e[37]!==h||e[38]!==D||e[39]!==P||e[40]!==N?(S=s.jsxs(i,{className:D,align:P,children:[N,h]}),e[36]=i,e[37]=h,e[38]=D,e[39]=P,e[40]=N,e[41]=S):S=e[41];let I;return e[42]!==m||e[43]!==x||e[44]!==S||e[45]!==w||e[46]!==y?(I=s.jsxs(m,{open:w,onOpenChange:y,children:[x,S]}),e[42]=m,e[43]=x,e[44]=S,e[45]=w,e[46]=y,e[47]=I):I=e[47],I}function Ze(){const t=L.c(61),e=Ke(),r=le(),l=Ue();let a;t[0]!==e?.ids?(a=e?.ids??[...oe],t[0]=e?.ids,t[1]=a):a=t[1];const d=a,[n,j]=H.useState(d);let u;t[2]!==n||t[3]!==d?(u=n.length!==d.length||n.some((E,T)=>E!==d[T]),t[2]=n,t[3]=d,t[4]=u):u=t[4];const v=u;let o;t[5]===Symbol.for("react.memo_cache_sentinel")?(o={activationConstraint:{distance:5}},t[5]=o):o=t[5];let i;t[6]===Symbol.for("react.memo_cache_sentinel")?(i={coordinateGetter:Ee},t[6]=i):i=t[6];const m=Ce(ne(ke,o),ne(Ae,i));let g;t[7]!==n?(g=E=>{const{active:T,over:R}=E;if(!R||T.id===R.id)return;const F=n.indexOf(T.id),U=n.indexOf(R.id);F===-1||U===-1||j(Oe([...n],F,U))},t[7]=n,t[8]=g):g=t[8];const f=g;let x;t[9]!==n?(x=E=>{n.includes(E)||j([...n,E])},t[9]=n,t[10]=x):x=t[10];const z=x;let p;t[11]!==n?(p=E=>{j(n.filter(T=>T!==E))},t[11]=n,t[12]=p):p=t[12];const b=p;let D;t[13]===Symbol.for("react.memo_cache_sentinel")?(D=()=>{j([...oe])},t[13]=D):D=t[13];const P=D;let N;t[14]!==n||t[15]!==l?(N=()=>{l.mutate({ids:n},{onSuccess:()=>{Y("default_home_agents_updated",{count:n.length,template_count:n.filter(tt).length}),V.success("Default home agents updated")},onError:et})},t[14]=n,t[15]=l,t[16]=N):N=t[16];const w=N;let y,_,h,S,I,A,C;if(t[17]!==r||t[18]!==n||t[19]!==f||t[20]!==b||t[21]!==m||t[22]!==l.isPending){let E;t[30]!==r?(E=F=>Ye(F,ee,r),t[30]=r,t[31]=E):E=t[31];const T=n.map(E);h=Math.max(0,n.length-ie),_=X,I="Default home agents";let R;t[32]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsx(pe,{size:14}),t[32]=R):R=t[32],t[33]!==l.isPending?(A=s.jsxs(G,{type:"button",variant:"ghost",size:"sm",onClick:P,disabled:l.isPending,children:[R,"Reset defaults"]}),t[33]=l.isPending,t[34]=A):A=t[34],y=Z,C="px-5 py-5 flex flex-col gap-3",S=T.length===0?s.jsx("div",{className:"rounded-lg border border-dashed border-border p-6 text-center text-xs text-muted-foreground",children:'No agents selected. The home view will only show "Create agent".'}):s.jsx(we,{sensors:m,collisionDetection:_e,onDragEnd:f,children:s.jsx(ze,{items:n,strategy:De,children:s.jsx("div",{className:"flex flex-col gap-1.5",children:T.map((F,U)=>s.jsxs("div",{className:"flex flex-col gap-1.5",children:[U===ie&&s.jsxs("div",{className:"flex items-center gap-2 px-1 py-1 text-xs text-muted-foreground",children:[s.jsx("div",{className:"flex-1 h-px bg-border"}),s.jsx("span",{children:"Below this line is hidden on the home view"}),s.jsx("div",{className:"flex-1 h-px bg-border"})]}),s.jsx(Je,{agent:F,onRemove:()=>b(F.id)})]},F.id))})})}),t[17]=r,t[18]=n,t[19]=f,t[20]=b,t[21]=m,t[22]=l.isPending,t[23]=y,t[24]=_,t[25]=h,t[26]=S,t[27]=I,t[28]=A,t[29]=C}else y=t[23],_=t[24],h=t[25],S=t[26],I=t[27],A=t[28],C=t[29];let k;t[35]!==n||t[36]!==z?(k=s.jsx(Xe,{selectedIds:n,onAdd:z}),t[35]=n,t[36]=z,t[37]=k):k=t[37];let O;t[38]!==h?(O=h>0&&s.jsxs("span",{className:"text-xs text-muted-foreground",children:[h," agent",h===1?"":"s"," won't fit on the home view"]}),t[38]=h,t[39]=O):O=t[39];let c;t[40]!==k||t[41]!==O?(c=s.jsxs("div",{className:"flex items-center justify-between",children:[k,O]}),t[40]=k,t[41]=O,t[42]=c):c=t[42];let $;t[43]!==S||t[44]!==c||t[45]!==C?($=s.jsxs("div",{className:C,children:[S,c]}),t[43]=S,t[44]=c,t[45]=C,t[46]=$):$=t[46];let M;t[47]!==w||t[48]!==d||t[49]!==v||t[50]!==l.isPending?(M=v&&s.jsxs(ye,{children:[s.jsx(G,{type:"button",variant:"outline",onClick:()=>j(d),disabled:l.isPending,children:"Cancel"}),s.jsx(G,{type:"button",onClick:w,disabled:l.isPending,children:l.isPending?"Saving…":"Save"})]}),t[47]=w,t[48]=d,t[49]=v,t[50]=l.isPending,t[51]=M):M=t[51];let B;t[52]!==y||t[53]!==$||t[54]!==M?(B=s.jsxs(y,{children:[$,M]}),t[52]=y,t[53]=$,t[54]=M,t[55]=B):B=t[55];let K;return t[56]!==_||t[57]!==I||t[58]!==A||t[59]!==B?(K=s.jsx(_,{title:I,actions:A,children:B}),t[56]=_,t[57]=I,t[58]=A,t[59]=B,t[60]=K):K=t[60],K}function et(t){V.error(t instanceof Error?t.message:"Failed to update default home agents")}function tt(t){return ee.some(e=>e.id===t)}function st(){const t=L.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(X,{title:"Default home agents",children:s.jsx(Z,{children:s.jsx("div",{className:"px-5 py-5 flex flex-col gap-2",children:Array.from({length:4}).map(nt)})})}),t[0]=e):e=t[0],e}function nt(t,e){return s.jsx(Me,{className:"h-12 w-full rounded-lg"},e)}function ot(){const t=L.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(H.Suspense,{fallback:s.jsx(st,{}),children:s.jsx(Ze,{})}),t[0]=e):e=t[0],e}function it(){const t=L.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(q,{children:s.jsx(q.Content,{children:s.jsx(q.Body,{children:s.jsxs(Se,{children:[s.jsx(q.Title,{children:"Organization"}),s.jsx(Qe,{}),s.jsx(Ne,{}),s.jsx(ot,{})]})})})}),t[0]=e):e=t[0],e}function ns(){const t=L.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(it,{}),t[0]=e):e=t[0],e}export{ns as default};
1
+ import{f as re,s as ce,o as de,z as me,C as ue,a as fe,t as Y,x as V,K as te,j as s,D as se,H as ge,J as W,e as L,r as H,B as G,c as xe,M as pe}from"./index-D-AchbAp.js";import{P as q}from"./index-D-Sd8524.js";import{u as he}from"./use-org-auth-client-BQtfAiH5.js";import{u as je}from"./use-debounced-autosave-yq4OwEo1.js";import{A as ve}from"./avatar-BLsDXTLO.js";import{I as be}from"./input-CakwXYXP.js";import{S as X,a as Z,b as Q,c as ye,d as Se}from"./settings-section-Bqaz9XGD.js";import{D as Ne}from"./domain-settings-CJEzm_aH.js";import{u as Ce,a as ne,D as we,c as _e,S as ze,v as De,K as Ae,P as ke,d as Pe,C as Ie,s as Ee,b as Oe,e as Te}from"./collection-search-BOYToHG4.js";import{W as ee,i as Re}from"./constants-RWvzCl_g.js";import{b as le}from"./use-virtual-mcp-BhZKmvOZ.js";import{b as Fe,P as Le,a as $e}from"./popover-D2EOAbOM.js";import{S as Me}from"./skeleton-CXubnmL1.js";import{y as Be}from"./agent-icon-BVZUm3pj.js";import{s as Ve}from"./Plus-CaMiYyQj.js";import{a as ae}from"./Users03-CIV6olE1.js";import{i as He}from"./X-D9eppmZ5.js";import{I as J}from"./integration-icon-C-l7PWbV.js";import{a as Ke,d as Ue}from"./use-organization-settings-D3c1eAkJ.js";import"./tooltip-mh5HW7ZO.js";import"./User01-kmVRHRma.js";import"./card-B46IKqYa.js";import"./ArrowUpRight-uN4rpxFQ.js";import"./unwrap-tool-result-BYXdCQMg.js";import"./switch-B4qY2cAW.js";import"./SearchMd-CEMS2-Af.js";import"./use-collections-Bj_MIMYU.js";import"./AlertCircle-Bfs7s4nW.js";import"./Tool01-CVk9VJBE.js";import"./XClose-DbuUzE7b.js";import"./RefreshCcw01-Dg3dsSrt.js";import"./ArrowNarrowLeft-Bmz6Y8e3.js";import"./XCircle-aWgEOCXr.js";import"./ZapSquare-DrCreQ3A.js";import"./CheckCircle-Ce1bjJWu.js";import"./Check-Dn9d8wcY.js";import"./ChevronDown-CXCDuqLa.js";import"./ChevronRight-D5XY6PcV.js";import"./ChevronUp-CumNURD7.js";import"./DotsVertical-t9aJW5_k.js";import"./Container-CaXLIAOI.js";import"./Star01-DLhWwRZb.js";import"./Palette-YLM_ef0u.js";import"./LinkExternal01-Df6M_hj7.js";import"./Lock01-zKy6_9kx.js";import"./Sun-cU8BjYNb.js";import"./Play-CgFl5SH3.js";import"./Settings02-eRruwxu8.js";import"./Shield01-CcUKPlcN.js";import"./Trash01-BRo1VQ8E.js";import"./Zap-BbjHF1GM.js";const qe=ge({name:W().min(1,"Name is required").max(255,"Name is too long"),slug:W().min(1,"Slug is required").max(50,"Slug is too long").regex(/^[a-z0-9-]+$/,"Slug must contain only lowercase letters, numbers, and hyphens"),logo:W().optional()});function Ge(t){const e=L.c(13),{value:r,onChange:l,name:a,disabled:d}=t,n=H.useRef(null);let j;e[0]===Symbol.for("react.memo_cache_sentinel")?(j=()=>n.current?.click(),e[0]=j):j=e[0];const u=j;let v;e[1]!==l?(v=z=>{const p=z.target.files?.[0];if(!p)return;if(p.size>2097152){V.error("Image must be smaller than 2MB");return}const b=new FileReader;b.onerror=We,b.onloadend=()=>{b.result&&l(b.result),n.current&&(n.current.value="")},b.readAsDataURL(p)},e[1]=l,e[2]=v):v=e[2];const o=v;let i;e[3]!==d||e[4]!==o?(i=s.jsx("input",{ref:n,type:"file",accept:"image/*",onChange:o,className:"hidden",disabled:d}),e[3]=d,e[4]=o,e[5]=i):i=e[5];const m=r||void 0,g=a??"?";let f;e[6]!==m||e[7]!==g?(f=s.jsx(ve,{url:m,fallback:g,shape:"square",size:"base"}),e[6]=m,e[7]=g,e[8]=f):f=e[8];let x;return e[9]!==d||e[10]!==i||e[11]!==f?(x=s.jsxs("button",{type:"button",onClick:u,disabled:d,className:"rounded-lg overflow-hidden hover:ring-2 hover:ring-border transition-all disabled:opacity-50","aria-label":"Upload organization logo",children:[i,f]}),e[9]=d,e[10]=i,e[11]=f,e[12]=x):x=e[12],x}function We(){return V.error("Failed to read image")}function Qe(){const t=re(),{org:e}=ce(),r=he(),l=de(),a=me({resolver:ue(qe),values:{name:e.name??"",slug:e.slug??"",logo:e.logo??""}}),d=fe({mutationFn:async o=>{const i={name:o.name,slug:o.slug};o.logo&&(i.logo=o.logo);const m=await r.organization.update({data:i});if(m?.error)throw new Error(m.error.message||"Failed to update organization");return m},onSuccess:(o,i)=>{Y("organization_settings_updated",{organization_id:e.id,fields:Object.keys(i)}),l.invalidateQueries({queryKey:te.organizations()}),l.invalidateQueries({queryKey:te.activeOrganization(e.slug)}),V.success("Organization updated successfully"),o?.data?.slug&&o.data.slug!==e.slug&&t({to:"/$org/settings/general",params:{org:o.data.slug}})},onError:(o,i)=>{Y("organization_settings_update_failed",{organization_id:e.id,fields:Object.keys(i),error:o instanceof Error?o.message:String(o)}),V.error(o instanceof Error?o.message:"Failed to update organization")}}),{schedule:n,flush:j}=je({save:async()=>{const o=a.control._formState.dirtyFields;if(Object.keys(o).length===0||!await a.trigger())return;const m=a.getValues(),g=a.control._defaultValues;a.reset(m,{keepValues:!0});try{await d.mutateAsync(m)}catch{a.reset(g,{keepValues:!0})}}}),u=a.formState.errors,v=typeof window<"u"?`${window.location.host}/`:"";return s.jsx(X,{children:s.jsxs(Z,{children:[s.jsx(Q,{title:"Logo",description:"Recommended size is 256x256px",action:s.jsx(Ge,{value:a.watch("logo"),onChange:o=>{a.setValue("logo",o??"",{shouldDirty:!0}),j()},name:a.watch("name")})}),s.jsx(Q,{title:"Name",action:s.jsx(se,{control:a.control,name:"name",render:({field:o})=>s.jsx(be,{id:"org-name",...o,onChange:i=>{o.onChange(i),n()},onBlur:()=>{o.onBlur(),j()},placeholder:"Organization name",className:"w-[280px]"})})}),s.jsx(Q,{title:"URL",action:s.jsxs("div",{className:"flex items-center w-[280px] rounded-md border border-input bg-input/30 focus-within:ring-2 focus-within:ring-ring/50 overflow-hidden",children:[v&&s.jsx("span",{className:"pl-3 text-sm text-muted-foreground select-none",children:v}),s.jsx(se,{control:a.control,name:"slug",render:({field:o})=>s.jsx("input",{id:"org-slug",value:o.value??"",name:o.name,ref:o.ref,placeholder:"my-organization",className:"flex-1 min-w-0 bg-transparent px-2 py-1.5 text-sm text-foreground placeholder:text-muted-foreground/60 outline-none",onChange:i=>{const m=i.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"");a.setValue("slug",m,{shouldDirty:!0,shouldTouch:!0,shouldValidate:!0}),n()},onBlur:()=>{o.onBlur(),j()}})})]})}),(u.name||u.slug||u.logo)&&s.jsxs("div",{className:"px-5 pb-3 flex flex-col gap-1",children:[u.name&&s.jsx("p",{className:"text-xs text-destructive",children:u.name.message}),u.slug&&s.jsx("p",{className:"text-xs text-destructive",children:u.slug.message}),u.logo&&s.jsx("p",{className:"text-xs text-destructive",children:u.logo.message})]})]})})}const oe=["site-editor","site-diagnostics","ai-image","ai-research"],ie=8;function Ye(t,e,r){const l=e.find(d=>d.id===t);if(l)return{id:l.id,title:l.title,icon:l.icon,kind:"template"};const a=r.find(d=>d.id===t);return a?{id:t,title:a.title,icon:a.icon??null,kind:"custom"}:{id:t,title:t,icon:null,kind:"missing"}}function Je(t){const e=L.c(39),{agent:r,onRemove:l}=t;let a;e[0]!==r.id?(a={id:r.id},e[0]=r.id,e[1]=a):a=e[1];const{attributes:d,listeners:n,setNodeRef:j,transform:u,transition:v,isDragging:o}=Pe(a);let i;e[2]!==u?(i=Ie.Transform.toString(u),e[2]=u,e[3]=i):i=e[3];const m=o?.5:void 0,g=o?100:void 0;let f;e[4]!==i||e[5]!==m||e[6]!==g||e[7]!==v?(f={transform:i,transition:v,opacity:m,zIndex:g},e[4]=i,e[5]=m,e[6]=g,e[7]=v,e[8]=f):f=e[8];const x=f,z=o&&"shadow-lg";let p;e[9]!==z?(p=xe("flex items-center gap-3 px-3 py-2 rounded-lg border border-border bg-background",z),e[9]=z,e[10]=p):p=e[10];const b=`Drag to reorder ${r.title}`;let D;e[11]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsx(Be,{size:14}),e[11]=D):D=e[11];let P;e[12]!==d||e[13]!==n||e[14]!==b?(P=s.jsx("button",{type:"button",...d,...n,className:"text-muted-foreground hover:text-foreground cursor-grab active:cursor-grabbing","aria-label":b,children:D}),e[12]=d,e[13]=n,e[14]=b,e[15]=P):P=e[15];let N;e[16]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(ae,{size:14}),e[16]=N):N=e[16];let w;e[17]!==r.icon||e[18]!==r.title?(w=s.jsx(J,{icon:r.icon,name:r.title,size:"xs",fallbackIcon:N}),e[17]=r.icon,e[18]=r.title,e[19]=w):w=e[19];let y;e[20]!==r.title?(y=s.jsx("span",{className:"text-sm text-foreground truncate",children:r.title}),e[20]=r.title,e[21]=y):y=e[21];const _=r.kind==="template"?"Template":r.kind==="custom"?"Custom agent":"Unavailable";let h;e[22]!==_?(h=s.jsx("span",{className:"text-xs text-muted-foreground",children:_}),e[22]=_,e[23]=h):h=e[23];let S;e[24]!==y||e[25]!==h?(S=s.jsxs("div",{className:"flex flex-col min-w-0 flex-1",children:[y,h]}),e[24]=y,e[25]=h,e[26]=S):S=e[26];const I=`Remove ${r.title}`;let A;e[27]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx(He,{size:14}),e[27]=A):A=e[27];let C;e[28]!==l||e[29]!==I?(C=s.jsx("button",{type:"button",onClick:l,className:"text-muted-foreground hover:text-foreground p-1 rounded","aria-label":I,children:A}),e[28]=l,e[29]=I,e[30]=C):C=e[30];let k;return e[31]!==j||e[32]!==x||e[33]!==P||e[34]!==w||e[35]!==S||e[36]!==C||e[37]!==p?(k=s.jsxs("div",{ref:j,style:x,className:p,children:[P,w,S,C]}),e[31]=j,e[32]=x,e[33]=P,e[34]=w,e[35]=S,e[36]=C,e[37]=p,e[38]=k):k=e[38],k}function Xe(t){const e=L.c(48),{selectedIds:r,onAdd:l}=t,[a,d]=H.useState(!1),[n,j]=H.useState(""),u=le();let v;e[0]!==r?(v=new Set(r),e[0]=r,e[1]=v):v=e[1];const o=v;let i,m,g,f,x,z,p,b,D,P,N,w,y;if(e[2]!==u||e[3]!==l||e[4]!==a||e[5]!==n||e[6]!==o){const A=n.toLowerCase();f=ee.filter(c=>!o.has(c.id)&&(!n||c.title.toLowerCase().includes(A)));let C;e[20]!==o?(C=c=>c.id!==null&&!Re(c.id)&&!o.has(c.id),e[20]=o,e[21]=C):C=e[21],g=u.filter(C).filter(c=>!n||c.title.toLowerCase().includes(A));let k;e[22]!==l?(k=c=>{l(c),d(!1),j("")},e[22]=l,e[23]=k):k=e[23];const O=k;m=Fe,w=a,y=d,e[24]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(Le,{asChild:!0,children:s.jsxs(G,{type:"button",variant:"outline",size:"sm",children:[s.jsx(Ve,{size:14}),"Add agent"]})}),e[24]=x):x=e[24],i=$e,D="w-[320px] p-0 overflow-hidden",P="start",e[25]!==n?(N=s.jsx(Te,{value:n,onChange:j,placeholder:"Search agents..."}),e[25]=n,e[26]=N):N=e[26],z="max-h-[320px] overflow-y-auto p-2 flex flex-col gap-3",p=f.length>0&&s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground px-1",children:"Templates"}),f.map(c=>s.jsxs("button",{type:"button",onClick:()=>O(c.id),className:"flex items-center gap-2 px-2 py-1.5 rounded-md hover:bg-accent text-left",children:[s.jsx(J,{icon:c.icon,name:c.title,size:"xs"}),s.jsx("span",{className:"text-sm truncate",children:c.title})]},c.id))]}),b=g.length>0&&s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground px-1",children:"Custom agents"}),g.map(c=>s.jsxs("button",{type:"button",onClick:()=>O(c.id),className:"flex items-center gap-2 px-2 py-1.5 rounded-md hover:bg-accent text-left",children:[s.jsx(J,{icon:c.icon,name:c.title,size:"xs",fallbackIcon:s.jsx(ae,{size:14})}),s.jsx("span",{className:"text-sm truncate",children:c.title})]},c.id))]}),e[2]=u,e[3]=l,e[4]=a,e[5]=n,e[6]=o,e[7]=i,e[8]=m,e[9]=g,e[10]=f,e[11]=x,e[12]=z,e[13]=p,e[14]=b,e[15]=D,e[16]=P,e[17]=N,e[18]=w,e[19]=y}else i=e[7],m=e[8],g=e[9],f=e[10],x=e[11],z=e[12],p=e[13],b=e[14],D=e[15],P=e[16],N=e[17],w=e[18],y=e[19];let _;e[27]!==g||e[28]!==f.length||e[29]!==n?(_=f.length===0&&g.length===0&&s.jsx("div",{className:"text-xs text-muted-foreground text-center py-6",children:n?"No agents found":"All agents are already added"}),e[27]=g,e[28]=f.length,e[29]=n,e[30]=_):_=e[30];let h;e[31]!==_||e[32]!==z||e[33]!==p||e[34]!==b?(h=s.jsxs("div",{className:z,children:[p,b,_]}),e[31]=_,e[32]=z,e[33]=p,e[34]=b,e[35]=h):h=e[35];let S;e[36]!==i||e[37]!==h||e[38]!==D||e[39]!==P||e[40]!==N?(S=s.jsxs(i,{className:D,align:P,children:[N,h]}),e[36]=i,e[37]=h,e[38]=D,e[39]=P,e[40]=N,e[41]=S):S=e[41];let I;return e[42]!==m||e[43]!==x||e[44]!==S||e[45]!==w||e[46]!==y?(I=s.jsxs(m,{open:w,onOpenChange:y,children:[x,S]}),e[42]=m,e[43]=x,e[44]=S,e[45]=w,e[46]=y,e[47]=I):I=e[47],I}function Ze(){const t=L.c(61),e=Ke(),r=le(),l=Ue();let a;t[0]!==e?.ids?(a=e?.ids??[...oe],t[0]=e?.ids,t[1]=a):a=t[1];const d=a,[n,j]=H.useState(d);let u;t[2]!==n||t[3]!==d?(u=n.length!==d.length||n.some((E,T)=>E!==d[T]),t[2]=n,t[3]=d,t[4]=u):u=t[4];const v=u;let o;t[5]===Symbol.for("react.memo_cache_sentinel")?(o={activationConstraint:{distance:5}},t[5]=o):o=t[5];let i;t[6]===Symbol.for("react.memo_cache_sentinel")?(i={coordinateGetter:Ee},t[6]=i):i=t[6];const m=Ce(ne(ke,o),ne(Ae,i));let g;t[7]!==n?(g=E=>{const{active:T,over:R}=E;if(!R||T.id===R.id)return;const F=n.indexOf(T.id),U=n.indexOf(R.id);F===-1||U===-1||j(Oe([...n],F,U))},t[7]=n,t[8]=g):g=t[8];const f=g;let x;t[9]!==n?(x=E=>{n.includes(E)||j([...n,E])},t[9]=n,t[10]=x):x=t[10];const z=x;let p;t[11]!==n?(p=E=>{j(n.filter(T=>T!==E))},t[11]=n,t[12]=p):p=t[12];const b=p;let D;t[13]===Symbol.for("react.memo_cache_sentinel")?(D=()=>{j([...oe])},t[13]=D):D=t[13];const P=D;let N;t[14]!==n||t[15]!==l?(N=()=>{l.mutate({ids:n},{onSuccess:()=>{Y("default_home_agents_updated",{count:n.length,template_count:n.filter(tt).length}),V.success("Default home agents updated")},onError:et})},t[14]=n,t[15]=l,t[16]=N):N=t[16];const w=N;let y,_,h,S,I,A,C;if(t[17]!==r||t[18]!==n||t[19]!==f||t[20]!==b||t[21]!==m||t[22]!==l.isPending){let E;t[30]!==r?(E=F=>Ye(F,ee,r),t[30]=r,t[31]=E):E=t[31];const T=n.map(E);h=Math.max(0,n.length-ie),_=X,I="Default home agents";let R;t[32]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsx(pe,{size:14}),t[32]=R):R=t[32],t[33]!==l.isPending?(A=s.jsxs(G,{type:"button",variant:"ghost",size:"sm",onClick:P,disabled:l.isPending,children:[R,"Reset defaults"]}),t[33]=l.isPending,t[34]=A):A=t[34],y=Z,C="px-5 py-5 flex flex-col gap-3",S=T.length===0?s.jsx("div",{className:"rounded-lg border border-dashed border-border p-6 text-center text-xs text-muted-foreground",children:'No agents selected. The home view will only show "Create agent".'}):s.jsx(we,{sensors:m,collisionDetection:_e,onDragEnd:f,children:s.jsx(ze,{items:n,strategy:De,children:s.jsx("div",{className:"flex flex-col gap-1.5",children:T.map((F,U)=>s.jsxs("div",{className:"flex flex-col gap-1.5",children:[U===ie&&s.jsxs("div",{className:"flex items-center gap-2 px-1 py-1 text-xs text-muted-foreground",children:[s.jsx("div",{className:"flex-1 h-px bg-border"}),s.jsx("span",{children:"Below this line is hidden on the home view"}),s.jsx("div",{className:"flex-1 h-px bg-border"})]}),s.jsx(Je,{agent:F,onRemove:()=>b(F.id)})]},F.id))})})}),t[17]=r,t[18]=n,t[19]=f,t[20]=b,t[21]=m,t[22]=l.isPending,t[23]=y,t[24]=_,t[25]=h,t[26]=S,t[27]=I,t[28]=A,t[29]=C}else y=t[23],_=t[24],h=t[25],S=t[26],I=t[27],A=t[28],C=t[29];let k;t[35]!==n||t[36]!==z?(k=s.jsx(Xe,{selectedIds:n,onAdd:z}),t[35]=n,t[36]=z,t[37]=k):k=t[37];let O;t[38]!==h?(O=h>0&&s.jsxs("span",{className:"text-xs text-muted-foreground",children:[h," agent",h===1?"":"s"," won't fit on the home view"]}),t[38]=h,t[39]=O):O=t[39];let c;t[40]!==k||t[41]!==O?(c=s.jsxs("div",{className:"flex items-center justify-between",children:[k,O]}),t[40]=k,t[41]=O,t[42]=c):c=t[42];let $;t[43]!==S||t[44]!==c||t[45]!==C?($=s.jsxs("div",{className:C,children:[S,c]}),t[43]=S,t[44]=c,t[45]=C,t[46]=$):$=t[46];let M;t[47]!==w||t[48]!==d||t[49]!==v||t[50]!==l.isPending?(M=v&&s.jsxs(ye,{children:[s.jsx(G,{type:"button",variant:"outline",onClick:()=>j(d),disabled:l.isPending,children:"Cancel"}),s.jsx(G,{type:"button",onClick:w,disabled:l.isPending,children:l.isPending?"Saving…":"Save"})]}),t[47]=w,t[48]=d,t[49]=v,t[50]=l.isPending,t[51]=M):M=t[51];let B;t[52]!==y||t[53]!==$||t[54]!==M?(B=s.jsxs(y,{children:[$,M]}),t[52]=y,t[53]=$,t[54]=M,t[55]=B):B=t[55];let K;return t[56]!==_||t[57]!==I||t[58]!==A||t[59]!==B?(K=s.jsx(_,{title:I,actions:A,children:B}),t[56]=_,t[57]=I,t[58]=A,t[59]=B,t[60]=K):K=t[60],K}function et(t){V.error(t instanceof Error?t.message:"Failed to update default home agents")}function tt(t){return ee.some(e=>e.id===t)}function st(){const t=L.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(X,{title:"Default home agents",children:s.jsx(Z,{children:s.jsx("div",{className:"px-5 py-5 flex flex-col gap-2",children:Array.from({length:4}).map(nt)})})}),t[0]=e):e=t[0],e}function nt(t,e){return s.jsx(Me,{className:"h-12 w-full rounded-lg"},e)}function ot(){const t=L.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(H.Suspense,{fallback:s.jsx(st,{}),children:s.jsx(Ze,{})}),t[0]=e):e=t[0],e}function it(){const t=L.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(q,{children:s.jsx(q.Content,{children:s.jsx(q.Body,{children:s.jsxs(Se,{children:[s.jsx(q.Title,{children:"Organization"}),s.jsx(Qe,{}),s.jsx(Ne,{}),s.jsx(ot,{})]})})})}),t[0]=e):e=t[0],e}function ns(){const t=L.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(it,{}),t[0]=e):e=t[0],e}export{ns as default};
@@ -1,4 +1,4 @@
1
- import{e as ae,r as R,f as cn,s as lt,j as s,B as ne,x as qe,c as le,ba as Rn,n as Ys,K as At,E as os,d as zs,t as Bt}from"./index-n0iHPcte.js";import{S as Bs}from"./search-input-BUN7olRm.js";import{r as is,c as ls,d as cs,e as ds,P as Ue}from"./index-CVzq_PSm.js";import{E as dn}from"./empty-state-DnjUFLB3.js";import{B as Ke}from"./badge-YKYMjnfu.js";import{b as ct,P as dt,a as ut}from"./popover-BDSYEq1Z.js";import{T as Mt,a as kt,b as Ct}from"./tooltip-DK9ITTps.js";import{i as Ht}from"./Check-4wEPFmVT.js";import{e as un,c as _t,n as Wn}from"./XCircle-DTJod2tn.js";import{a as Hs}from"./SearchMd-JVaJZdXg.js";import{i as qs}from"./Play-85A9faRd.js";import{X as Vs,Y as Us,x as Ks,W as Gs}from"./agent-icon-D-W_-Msq.js";import{M as An}from"./monaco-editor-DqaoMZN_.js";import{u as Qs}from"./use-members-Dh6NCni1.js";import{u as $n}from"./use-connection-BA7MX_A_.js";import{S as mn,u as fn,i as Js,g as Xs,d as Zs}from"./constants-DsSHL62C.js";import{b as ea}from"./use-virtual-mcp-w_wFYi9Y.js";import{n as Ge}from"./Container-C9S2fJrQ.js";import{c as ta}from"./XClose-0biyZ-nq.js";import{s as na}from"./Plus-BxG8Erza.js";import{s as sa}from"./Trash01-CdymalYb.js";import{I as pt}from"./input-DEYTwRzn.js";import{C as Yn}from"./checkbox-BFMSekYh.js";import{t as gt}from"./ChevronDown-CLwgC4lc.js";import{d as aa,C as ra,b as zn,e as oa,a as ia,f as la}from"./command-DEZQ8Srq.js";import{a as Pt,b as Tt,c as Ot,d as Re,S as Ft}from"./select-CDN58G81.js";import{S as ca}from"./scroll-area-1CfGMim0.js";import{n as da}from"./ZapSquare-DtdkchqU.js";import{i as ua}from"./ChevronRight-DW27S4dx.js";import{T as ma}from"./textarea-BJm0Tf5N.js";import{C as us}from"./collection-tabs-D653lS2B.js";import{S as fa}from"./switch-DIHVY0RD.js";import{L as ha}from"./label-DWRjHkWy.js";import{I as ze}from"./integration-icon-Bkie-XyL.js";import{A as $t}from"./avatar-CtlfIArZ.js";import{C as ms}from"./card-uZ87GViI.js";import{K as st}from"./monitoring-stats-row-DhIBV8mS.js";import{c as fs}from"./use-mcp-tools-D_JiTODV.js";import{g as xa}from"./connection-slug-eyAPH6o3.js";import{u as hs}from"./useSuspenseInfiniteQuery-hHdMeBLO.js";import{T as ke,a as mt,b as hn,c as xn,d as pn,e as ce}from"./table-pLgWKqqj.js";import{n as xs}from"./ChevronUp-DAW3-3dA.js";import{u as gn}from"./use-infinite-scroll-CM8Ra6DF.js";import{u as pa}from"./useInfiniteQuery-tCVYDURJ.js";import{w as ga,x as va}from"./pair-tqYVnZzb.js";import{S as Lt}from"./task-status-zPChwtIb.js";import"./X-DzLPqoAC.js";import"./AlertCircle-CFABZy3o.js";import"./Tool01-Bhj2T1uN.js";import"./RefreshCcw01-DdgK7Krp.js";import"./ArrowNarrowLeft-qjcSXUou.js";import"./ArrowUpRight-havdJdQt.js";import"./Users03-DG3Gfjoh.js";import"./CheckCircle-D7ReuLNV.js";import"./DotsVertical-BReL32xd.js";import"./Star01-DEmigL_c.js";import"./Palette-Dtg_tDlg.js";import"./LinkExternal01-0Xs4UV_i.js";import"./Lock01-BjKqD6QN.js";import"./Sun-TDfj1GPd.js";import"./Settings02-BZivkDIL.js";import"./Shield01-CAl07SGJ.js";import"./User01-BZ9BWkFc.js";import"./Zap-aKe8CYDP.js";import"./index-CneSjNEN.js";import"./use-org-auth-client-D8ifGvzT.js";import"./use-collections-DEtL7TsG.js";import"./index-__EZcmD7.js";import"./index-H-xuVWHv.js";import"./infiniteQueryObserver-CWqfKiPC.js";import"./use-copy-B_9_NtCX.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./dialog-B4KlHjek.js";import"./content-blocks-o63cs2vh.js";import"./types-CHJA9iY7.js";import"./chat-context-BFxTlymH.js";import"./use-ai-providers-Wa05FQa-.js";import"./use-decopilot-events-CAAYd06u.js";import"./create-sse-subscription-CxkOgzKf.js";import"./use-tasks-DZC5fx2d.js";import"./use-organization-settings-ZtHNr_4_.js";import"./shell-layout-BAgHU931.js";import"./required-auth-layout-C2TKIvqH.js";import"./use-org-sso-IjJZMJF0.js";const tn={maxJsonRenderSize:5e4,pageSize:50,streamingRefetchInterval:3e3};function Qe(t){return t.filter(e=>e.key.trim()).map(e=>{const n=encodeURIComponent(e.key.trim()),a=encodeURIComponent(e.value||"");return`${n}:${e.operator}:${a}`}).join(",")}function ba(t){return t?t.split(",").map(e=>{const[n,a,...r]=e.split(":");return{key:decodeURIComponent(n||""),operator:a||"eq",value:decodeURIComponent(r.join(":")||"")}}):[]}function St(t){return t.filter(e=>e.key.trim()).map(e=>{switch(e.operator){case"eq":return`${e.key}=${e.value}`;case"contains":return`${e.key}~${e.value}`;case"exists":return`${e.key}?`;case"in":return`${e.key}@${e.value}`}}).join(`
1
+ import{e as ae,r as R,f as cn,s as lt,j as s,B as ne,x as qe,c as le,ba as Rn,n as Ys,K as At,E as os,d as zs,t as Bt}from"./index-D-AchbAp.js";import{S as Bs}from"./search-input-C4_6QMbq.js";import{r as is,c as ls,d as cs,e as ds,P as Ue}from"./index-D-Sd8524.js";import{E as dn}from"./empty-state-B0wC2RI0.js";import{B as Ke}from"./badge-CHhcYTOG.js";import{b as ct,P as dt,a as ut}from"./popover-D2EOAbOM.js";import{T as Mt,a as kt,b as Ct}from"./tooltip-mh5HW7ZO.js";import{i as Ht}from"./Check-Dn9d8wcY.js";import{e as un,c as _t,n as Wn}from"./XCircle-aWgEOCXr.js";import{a as Hs}from"./SearchMd-CEMS2-Af.js";import{i as qs}from"./Play-CgFl5SH3.js";import{X as Vs,Y as Us,x as Ks,W as Gs}from"./agent-icon-BVZUm3pj.js";import{M as An}from"./monaco-editor-C8cqLWnt.js";import{u as Qs}from"./use-members-BaAd9sSt.js";import{u as $n}from"./use-connection-C1Huhuv0.js";import{S as mn,u as fn,i as Js,g as Xs,d as Zs}from"./constants-RWvzCl_g.js";import{b as ea}from"./use-virtual-mcp-BhZKmvOZ.js";import{n as Ge}from"./Container-CaXLIAOI.js";import{c as ta}from"./XClose-DbuUzE7b.js";import{s as na}from"./Plus-CaMiYyQj.js";import{s as sa}from"./Trash01-BRo1VQ8E.js";import{I as pt}from"./input-CakwXYXP.js";import{C as Yn}from"./checkbox-CxcVXBXV.js";import{t as gt}from"./ChevronDown-CXCDuqLa.js";import{d as aa,C as ra,b as zn,e as oa,a as ia,f as la}from"./command-BBGje1oX.js";import{a as Pt,b as Tt,c as Ot,d as Re,S as Ft}from"./select-Ji_VTvAf.js";import{S as ca}from"./scroll-area-DkzB0VrI.js";import{n as da}from"./ZapSquare-DrCreQ3A.js";import{i as ua}from"./ChevronRight-D5XY6PcV.js";import{T as ma}from"./textarea-hPI8GSZO.js";import{C as us}from"./collection-tabs-HQQcyoFg.js";import{S as fa}from"./switch-B4qY2cAW.js";import{L as ha}from"./label-CIwIDYzF.js";import{I as ze}from"./integration-icon-C-l7PWbV.js";import{A as $t}from"./avatar-BLsDXTLO.js";import{C as ms}from"./card-B46IKqYa.js";import{K as st}from"./monitoring-stats-row-03tCjfSg.js";import{c as fs}from"./use-mcp-tools-CDiw0vXX.js";import{g as xa}from"./connection-slug-eyAPH6o3.js";import{u as hs}from"./useSuspenseInfiniteQuery-Yn6IM0vI.js";import{T as ke,a as mt,b as hn,c as xn,d as pn,e as ce}from"./table-tkXjFnMe.js";import{n as xs}from"./ChevronUp-CumNURD7.js";import{u as gn}from"./use-infinite-scroll-N5zwi7TE.js";import{u as pa}from"./useInfiniteQuery-B2eIGcfO.js";import{w as ga,x as va}from"./pair-BJVqYs09.js";import{S as Lt}from"./task-status-DHF3W_Oc.js";import"./X-D9eppmZ5.js";import"./AlertCircle-Bfs7s4nW.js";import"./Tool01-CVk9VJBE.js";import"./RefreshCcw01-Dg3dsSrt.js";import"./ArrowNarrowLeft-Bmz6Y8e3.js";import"./ArrowUpRight-uN4rpxFQ.js";import"./Users03-CIV6olE1.js";import"./CheckCircle-Ce1bjJWu.js";import"./DotsVertical-t9aJW5_k.js";import"./Star01-DLhWwRZb.js";import"./Palette-YLM_ef0u.js";import"./LinkExternal01-Df6M_hj7.js";import"./Lock01-zKy6_9kx.js";import"./Sun-cU8BjYNb.js";import"./Settings02-eRruwxu8.js";import"./Shield01-CcUKPlcN.js";import"./User01-kmVRHRma.js";import"./Zap-BbjHF1GM.js";import"./index-Bs5p63Lp.js";import"./use-org-auth-client-BQtfAiH5.js";import"./use-collections-Bj_MIMYU.js";import"./index-DZmO6N1n.js";import"./index-DJKFaAtT.js";import"./infiniteQueryObserver-DoJUGWdU.js";import"./use-copy-Vr-WiQt5.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./dialog-CrUS2M-J.js";import"./content-blocks-o63cs2vh.js";import"./types-DmP7ytXf.js";import"./chat-context-UGxRb1rI.js";import"./use-ai-providers-BsD7sWlS.js";import"./use-decopilot-events-DU6d8uCa.js";import"./create-sse-subscription-CxkOgzKf.js";import"./use-tasks-Dw1R9K3S.js";import"./use-organization-settings-D3c1eAkJ.js";import"./shell-layout-DWNJFELP.js";import"./required-auth-layout-eFrhlW0x.js";import"./use-org-sso-qmLHQ9XF.js";const tn={maxJsonRenderSize:5e4,pageSize:50,streamingRefetchInterval:3e3};function Qe(t){return t.filter(e=>e.key.trim()).map(e=>{const n=encodeURIComponent(e.key.trim()),a=encodeURIComponent(e.value||"");return`${n}:${e.operator}:${a}`}).join(",")}function ba(t){return t?t.split(",").map(e=>{const[n,a,...r]=e.split(":");return{key:decodeURIComponent(n||""),operator:a||"eq",value:decodeURIComponent(r.join(":")||"")}}):[]}function St(t){return t.filter(e=>e.key.trim()).map(e=>{switch(e.operator){case"eq":return`${e.key}=${e.value}`;case"contains":return`${e.key}~${e.value}`;case"exists":return`${e.key}?`;case"in":return`${e.key}@${e.value}`}}).join(`
2
2
  `)}function Bn(t){return t.trim()?t.split(`
3
3
  `).map(e=>e.trim()).filter(e=>e.length>0).map(e=>{if(e.endsWith("?"))return{key:e.slice(0,-1),operator:"exists",value:""};if(e.includes("=")){const[n,...a]=e.split("=");return{key:n||"",operator:"eq",value:a.join("=")}}if(e.includes("~")){const[n,...a]=e.split("~");return{key:n||"",operator:"contains",value:a.join("~")}}if(e.includes("@")){const[n,...a]=e.split("@");return{key:n||"",operator:"in",value:a.join("@")}}return{key:e,operator:"exists",value:""}}):[]}function ya(t){const e={},n={},a=[],r={};for(const o of t)if(o.key.trim())switch(o.operator){case"eq":o.value&&(e[o.key]=o.value);break;case"contains":o.value&&(n[o.key]=`%${o.value}%`);break;case"exists":a.push(o.key);break;case"in":o.value&&(r[o.key]=o.value);break}return{properties:Object.keys(e).length>0?e:void 0,propertyPatterns:Object.keys(n).length>0?n:void 0,propertyKeys:a.length>0?a:void 0,propertyInValues:Object.keys(r).length>0?r:void 0}}function Hn(t){if(!t)return{content:"null",isTruncated:!1,originalSize:4};if(typeof t._decocms_truncated=="string")return{content:t._decocms_truncated,isTruncated:!0,originalSize:t._decocms_truncated.length};const e=JSON.stringify(t,null,2),n=e.length;return n<=tn.maxJsonRenderSize?{content:e,isTruncated:!1,originalSize:n}:{content:e.slice(0,tn.maxJsonRenderSize)+`
4
4
 
@@ -1,4 +1,4 @@
1
- import{cj as ne,e as _,j as o,B as te,l as ln,bc as ze,ck as ms,r as T,s as oe,c as O,g as ps,o as cn,c5 as xs,a7 as hs,a8 as fe,aW as an,c6 as gs,aT as bs,c4 as Ss,c7 as un,b6 as js,cd as ys,ce as vs,ae as ws,cf as Ns,cl as $t,cm as dn,x as ks,y as _s,cn as Cs,co as Is}from"./index-n0iHPcte.js";import{D as Ts,F as Es,B as $s}from"./index-CoY1MHFJ.js";import{e as Fe,i as Os,u as ae}from"./constants-DsSHL62C.js";import{b as fn}from"./use-virtual-mcp-w_wFYi9Y.js";import{M as Re}from"./monaco-editor-DqaoMZN_.js";import{A as Rs,c as Ms,a as Ls,b as Ps,e as As,R as Ut,d as zs}from"./accordion-CHtp00zM.js";import{B as le}from"./badge-YKYMjnfu.js";import{c as vt,S as wt,d as nt,b as Nt,a as kt}from"./select-CDN58G81.js";import{N as Ws,h as Ds,j as Fs,m as Be,P as Hs,i as Vs,R as Us,c as qs,k as Ks,e as qt,d as Bs,S as st}from"./index-CneSjNEN.js";import{V as Xs}from"./view-mode-toggle-DUYrFi8F.js";import{a9 as Js,aa as Gs,i as Qs,a1 as mn,ab as Ys,Q as Zs,r as eo,ac as pn,Y as to,U as xn,ad as no,ae as so,S as bt,af as oo}from"./agent-icon-D-W_-Msq.js";import{i as hn}from"./Play-85A9faRd.js";import{b as ro,a as io,V as Qe}from"./layout-CjfRI0kM.js";import{c as gn,T as bn,a as Sn,b as jn}from"./tooltip-DK9ITTps.js";import{u as lo,a as co}from"./use-connection-BA7MX_A_.js";import{u as Ot,d as Rt,b as yn}from"./use-mcp-tools-D_JiTODV.js";import{c as ao,d as uo,e as fo,D as mo,a as po,b as xo}from"./dialog-B4KlHjek.js";import"./index-H-xuVWHv.js";import{S as ho}from"./index-_Uov_1Gm.js";import{D as vn,a as wn,b as Nn,c as Ye}from"./dropdown-menu-BsFYaC7C.js";import{s as go}from"./Plus-BxG8Erza.js";import{b as kn}from"./Tool01-Bhj2T1uN.js";import{i as He}from"./Check-4wEPFmVT.js";import{s as Mt}from"./XClose-0biyZ-nq.js";import{I as Lt}from"./integration-icon-Bkie-XyL.js";import{a as bo,S as So}from"./scroll-area-1CfGMim0.js";import"./index-BJq84O_6.js";import{i as _n}from"./X-DzLPqoAC.js";import{u as Cn,a as jo}from"./use-collections-DEtL7TsG.js";import{E as In}from"./empty-state-fJhgTnn4.js";import{c as yo}from"./create-sse-subscription-CxkOgzKf.js";import{I as Kt}from"./input-DEYTwRzn.js";const Tn=ne("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);const En=ne("Braces",[["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"}]]);const ot=ne("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const rt=ne("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);const vo=ne("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);const $n=ne("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);const wo=ne("Copy",[["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"}]]);const On=ne("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);const Rn=ne("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);const Mn=ne("Hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]);const No=ne("OctagonAlert",[["path",{d:"M12 16h.01",key:"1drbdi"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z",key:"1fd625"}]]);const Ln=ne("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const Pn=ne("SquareCheckBig",[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);const ko=ne("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);const An=ne("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]);function _o(t){const e=_.c(15),{onSave:n,onUndo:s,isDirty:i,isSaving:r,saveLabel:l,undoLabel:c}=t,a=l===void 0?"Save":l,u=c===void 0?"Undo":c;if(!i)return null;let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=o.jsx(Js,{size:14}),e[0]=d):d=e[0];let f;e[1]!==r||e[2]!==s||e[3]!==u?(f=o.jsxs(te,{variant:"outline",size:"sm",onClick:s,disabled:r,"aria-label":u,children:[d,u]}),e[1]=r,e[2]=s,e[3]=u,e[4]=f):f=e[4];let m;e[5]!==r?(m=r?o.jsx(ln,{size:14,className:"animate-spin"}):o.jsx(Gs,{size:14}),e[5]=r,e[6]=m):m=e[6];let x;e[7]!==r||e[8]!==n||e[9]!==a||e[10]!==m?(x=o.jsxs(te,{variant:"default",size:"sm",onClick:n,disabled:r,"aria-label":a,children:[m,a]}),e[7]=r,e[8]=n,e[9]=a,e[10]=m,e[11]=x):x=e[11];let p;return e[12]!==f||e[13]!==x?(p=o.jsxs(o.Fragment,{children:[f,x]}),e[12]=f,e[13]=x,e[14]=p):p=e[14],p}const Bt=t=>{let e;const n=new Set,s=(u,d)=>{const f=typeof u=="function"?u(e):u;if(!Object.is(f,e)){const m=e;e=d??(typeof f!="object"||f===null)?f:Object.assign({},e,f),n.forEach(x=>x(e,m))}},i=()=>e,c={setState:s,getState:i,getInitialState:()=>a,subscribe:u=>(n.add(u),()=>n.delete(u))},a=e=t(s,i,c);return c},Pt=(t=>t?Bt(t):Bt),Co=t=>t;function _t(t,e=Co){const n=ze.useSyncExternalStore(t.subscribe,ze.useCallback(()=>e(t.getState()),[t,e]),ze.useCallback(()=>e(t.getInitialState()),[t,e]));return ze.useDebugValue(n),n}const Io=t=>{const e=Pt(t),n=s=>_t(e,s);return Object.assign(n,e),n},To=(t=>Io);function zn(t,e){let n;try{n=t()}catch{return}return{getItem:i=>{var r;const l=a=>a===null?null:JSON.parse(a,void 0),c=(r=n.getItem(i))!=null?r:null;return c instanceof Promise?c.then(l):l(c)},setItem:(i,r)=>n.setItem(i,JSON.stringify(r,void 0)),removeItem:i=>n.removeItem(i)}}const Ct=t=>e=>{try{const n=t(e);return n instanceof Promise?n:{then(s){return Ct(s)(n)},catch(s){return this}}}catch(n){return{then(s){return this},catch(s){return Ct(s)(n)}}}},Eo=(t,e)=>(n,s,i)=>{let r={storage:zn(()=>window.localStorage),partialize:g=>g,version:0,merge:(g,b)=>({...b,...g}),...e},l=!1,c=0;const a=new Set,u=new Set;let d=r.storage;if(!d)return t((...g)=>{console.warn(`[zustand persist middleware] Unable to update item '${r.name}', the given storage is currently unavailable.`),n(...g)},s,i);const f=()=>{const g=r.partialize({...s()});return d.setItem(r.name,{state:g,version:r.version})},m=i.setState;i.setState=(g,b)=>(m(g,b),f());const x=t((...g)=>(n(...g),f()),s,i);i.getInitialState=()=>x;let p;const h=()=>{var g,b;if(!d)return;const j=++c;l=!1,a.forEach(y=>{var S;return y((S=s())!=null?S:x)});const v=((b=r.onRehydrateStorage)==null?void 0:b.call(r,(g=s())!=null?g:x))||void 0;return Ct(d.getItem.bind(d))(r.name).then(y=>{if(y)if(typeof y.version=="number"&&y.version!==r.version){if(r.migrate){const S=r.migrate(y.state,y.version);return S instanceof Promise?S.then(w=>[!0,w]):[!0,S]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,y.state];return[!1,void 0]}).then(y=>{var S;if(j!==c)return;const[w,N]=y;if(p=r.merge(N,(S=s())!=null?S:x),n(p,!0),w)return f()}).then(()=>{j===c&&(v?.(s(),void 0),p=s(),l=!0,u.forEach(y=>y(p)))}).catch(y=>{j===c&&v?.(void 0,y)})};return i.persist={setOptions:g=>{r={...r,...g},g.storage&&(d=g.storage)},clearStorage:()=>{d?.removeItem(r.name)},getOptions:()=>r,rehydrate:()=>h(),hasHydrated:()=>l,onHydrate:g=>(a.add(g),()=>{a.delete(g)}),onFinishHydration:g=>(u.add(g),()=>{u.delete(g)})},r.skipHydration||h(),p||x},Wn=Eo,{useSyncExternalStoreWithSelector:$o}=ms,Oo=t=>t;function Ro(t,e=Oo,n){const s=$o(t.subscribe,t.getState,t.getInitialState,e,n);return ze.useDebugValue(s),s}const Xt=t=>Symbol.iterator in t,Jt=t=>"entries"in t,Gt=(t,e)=>{const n=t instanceof Map?t:new Map(t.entries()),s=e instanceof Map?e:new Map(e.entries());if(n.size!==s.size)return!1;for(const[i,r]of n)if(!s.has(i)||!Object.is(r,s.get(i)))return!1;return!0},Mo=(t,e)=>{const n=t[Symbol.iterator](),s=e[Symbol.iterator]();let i=n.next(),r=s.next();for(;!i.done&&!r.done;){if(!Object.is(i.value,r.value))return!1;i=n.next(),r=s.next()}return!!i.done&&!!r.done};function Lo(t,e){return Object.is(t,e)?!0:typeof t!="object"||t===null||typeof e!="object"||e===null||Object.getPrototypeOf(t)!==Object.getPrototypeOf(e)?!1:Xt(t)&&Xt(e)?Jt(t)&&Jt(e)?Gt(t,e):Mo(t,e):Gt({entries:()=>Object.entries(t)},{entries:()=>Object.entries(e)})}function Dn(t,e="Output"){if(!t)return`interface ${e} {}`;function n(r){if(!r||typeof r!="object")return"unknown";const l=r.type;if(Array.isArray(l))return l.map(c=>s(c)).join(" | ");switch(l){case"string":return r.enum?r.enum.map(c=>`"${c}"`).join(" | "):"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";case"array":{const c=r.items;return c?`${n(c)}[]`:"unknown[]"}case"object":return i(r);default:return r.anyOf?r.anyOf.map(n).join(" | "):r.oneOf?r.oneOf.map(n).join(" | "):r.allOf?r.allOf.map(n).join(" & "):"unknown"}}function s(r){switch(r){case"string":return"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";default:return"unknown"}}function i(r){const l=r.properties;if(!l)return"Record<string, unknown>";const c=new Set(r.required||[]);return`{
1
+ import{cj as ne,e as _,j as o,B as te,l as ln,bc as ze,ck as ms,r as T,s as oe,c as O,g as ps,o as cn,c5 as xs,a7 as hs,a8 as fe,aW as an,c6 as gs,aT as bs,c4 as Ss,c7 as un,b6 as js,cd as ys,ce as vs,ae as ws,cf as Ns,cl as $t,cm as dn,x as ks,y as _s,cn as Cs,co as Is}from"./index-D-AchbAp.js";import{D as Ts,F as Es,B as $s}from"./index-B7jEWpXG.js";import{e as Fe,i as Os,u as ae}from"./constants-RWvzCl_g.js";import{b as fn}from"./use-virtual-mcp-BhZKmvOZ.js";import{M as Re}from"./monaco-editor-C8cqLWnt.js";import{A as Rs,c as Ms,a as Ls,b as Ps,e as As,R as Ut,d as zs}from"./accordion-CB4pTANL.js";import{B as le}from"./badge-CHhcYTOG.js";import{c as vt,S as wt,d as nt,b as Nt,a as kt}from"./select-Ji_VTvAf.js";import{N as Ws,h as Ds,j as Fs,m as Be,P as Hs,i as Vs,R as Us,c as qs,k as Ks,e as qt,d as Bs,S as st}from"./index-Bs5p63Lp.js";import{V as Xs}from"./view-mode-toggle-DZcY_eG-.js";import{a9 as Js,aa as Gs,i as Qs,a1 as mn,ab as Ys,Q as Zs,r as eo,ac as pn,Y as to,U as xn,ad as no,ae as so,S as bt,af as oo}from"./agent-icon-BVZUm3pj.js";import{i as hn}from"./Play-CgFl5SH3.js";import{b as ro,a as io,V as Qe}from"./layout-BELe2gYF.js";import{c as gn,T as bn,a as Sn,b as jn}from"./tooltip-mh5HW7ZO.js";import{u as lo,a as co}from"./use-connection-C1Huhuv0.js";import{u as Ot,d as Rt,b as yn}from"./use-mcp-tools-CDiw0vXX.js";import{c as ao,d as uo,e as fo,D as mo,a as po,b as xo}from"./dialog-CrUS2M-J.js";import"./index-DJKFaAtT.js";import{S as ho}from"./index-zJlISM1n.js";import{D as vn,a as wn,b as Nn,c as Ye}from"./dropdown-menu-CAcyogWh.js";import{s as go}from"./Plus-CaMiYyQj.js";import{b as kn}from"./Tool01-CVk9VJBE.js";import{i as He}from"./Check-Dn9d8wcY.js";import{s as Mt}from"./XClose-DbuUzE7b.js";import{I as Lt}from"./integration-icon-C-l7PWbV.js";import{a as bo,S as So}from"./scroll-area-DkzB0VrI.js";import"./index-Bm8TOoJq.js";import{i as _n}from"./X-D9eppmZ5.js";import{u as Cn,a as jo}from"./use-collections-Bj_MIMYU.js";import{E as In}from"./empty-state-DDTz8h9v.js";import{c as yo}from"./create-sse-subscription-CxkOgzKf.js";import{I as Kt}from"./input-CakwXYXP.js";const Tn=ne("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);const En=ne("Braces",[["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"}]]);const ot=ne("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const rt=ne("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);const vo=ne("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);const $n=ne("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);const wo=ne("Copy",[["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"}]]);const On=ne("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);const Rn=ne("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);const Mn=ne("Hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]);const No=ne("OctagonAlert",[["path",{d:"M12 16h.01",key:"1drbdi"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z",key:"1fd625"}]]);const Ln=ne("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const Pn=ne("SquareCheckBig",[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);const ko=ne("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);const An=ne("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]);function _o(t){const e=_.c(15),{onSave:n,onUndo:s,isDirty:i,isSaving:r,saveLabel:l,undoLabel:c}=t,a=l===void 0?"Save":l,u=c===void 0?"Undo":c;if(!i)return null;let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=o.jsx(Js,{size:14}),e[0]=d):d=e[0];let f;e[1]!==r||e[2]!==s||e[3]!==u?(f=o.jsxs(te,{variant:"outline",size:"sm",onClick:s,disabled:r,"aria-label":u,children:[d,u]}),e[1]=r,e[2]=s,e[3]=u,e[4]=f):f=e[4];let m;e[5]!==r?(m=r?o.jsx(ln,{size:14,className:"animate-spin"}):o.jsx(Gs,{size:14}),e[5]=r,e[6]=m):m=e[6];let x;e[7]!==r||e[8]!==n||e[9]!==a||e[10]!==m?(x=o.jsxs(te,{variant:"default",size:"sm",onClick:n,disabled:r,"aria-label":a,children:[m,a]}),e[7]=r,e[8]=n,e[9]=a,e[10]=m,e[11]=x):x=e[11];let p;return e[12]!==f||e[13]!==x?(p=o.jsxs(o.Fragment,{children:[f,x]}),e[12]=f,e[13]=x,e[14]=p):p=e[14],p}const Bt=t=>{let e;const n=new Set,s=(u,d)=>{const f=typeof u=="function"?u(e):u;if(!Object.is(f,e)){const m=e;e=d??(typeof f!="object"||f===null)?f:Object.assign({},e,f),n.forEach(x=>x(e,m))}},i=()=>e,c={setState:s,getState:i,getInitialState:()=>a,subscribe:u=>(n.add(u),()=>n.delete(u))},a=e=t(s,i,c);return c},Pt=(t=>t?Bt(t):Bt),Co=t=>t;function _t(t,e=Co){const n=ze.useSyncExternalStore(t.subscribe,ze.useCallback(()=>e(t.getState()),[t,e]),ze.useCallback(()=>e(t.getInitialState()),[t,e]));return ze.useDebugValue(n),n}const Io=t=>{const e=Pt(t),n=s=>_t(e,s);return Object.assign(n,e),n},To=(t=>Io);function zn(t,e){let n;try{n=t()}catch{return}return{getItem:i=>{var r;const l=a=>a===null?null:JSON.parse(a,void 0),c=(r=n.getItem(i))!=null?r:null;return c instanceof Promise?c.then(l):l(c)},setItem:(i,r)=>n.setItem(i,JSON.stringify(r,void 0)),removeItem:i=>n.removeItem(i)}}const Ct=t=>e=>{try{const n=t(e);return n instanceof Promise?n:{then(s){return Ct(s)(n)},catch(s){return this}}}catch(n){return{then(s){return this},catch(s){return Ct(s)(n)}}}},Eo=(t,e)=>(n,s,i)=>{let r={storage:zn(()=>window.localStorage),partialize:g=>g,version:0,merge:(g,b)=>({...b,...g}),...e},l=!1,c=0;const a=new Set,u=new Set;let d=r.storage;if(!d)return t((...g)=>{console.warn(`[zustand persist middleware] Unable to update item '${r.name}', the given storage is currently unavailable.`),n(...g)},s,i);const f=()=>{const g=r.partialize({...s()});return d.setItem(r.name,{state:g,version:r.version})},m=i.setState;i.setState=(g,b)=>(m(g,b),f());const x=t((...g)=>(n(...g),f()),s,i);i.getInitialState=()=>x;let p;const h=()=>{var g,b;if(!d)return;const j=++c;l=!1,a.forEach(y=>{var S;return y((S=s())!=null?S:x)});const v=((b=r.onRehydrateStorage)==null?void 0:b.call(r,(g=s())!=null?g:x))||void 0;return Ct(d.getItem.bind(d))(r.name).then(y=>{if(y)if(typeof y.version=="number"&&y.version!==r.version){if(r.migrate){const S=r.migrate(y.state,y.version);return S instanceof Promise?S.then(w=>[!0,w]):[!0,S]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,y.state];return[!1,void 0]}).then(y=>{var S;if(j!==c)return;const[w,N]=y;if(p=r.merge(N,(S=s())!=null?S:x),n(p,!0),w)return f()}).then(()=>{j===c&&(v?.(s(),void 0),p=s(),l=!0,u.forEach(y=>y(p)))}).catch(y=>{j===c&&v?.(void 0,y)})};return i.persist={setOptions:g=>{r={...r,...g},g.storage&&(d=g.storage)},clearStorage:()=>{d?.removeItem(r.name)},getOptions:()=>r,rehydrate:()=>h(),hasHydrated:()=>l,onHydrate:g=>(a.add(g),()=>{a.delete(g)}),onFinishHydration:g=>(u.add(g),()=>{u.delete(g)})},r.skipHydration||h(),p||x},Wn=Eo,{useSyncExternalStoreWithSelector:$o}=ms,Oo=t=>t;function Ro(t,e=Oo,n){const s=$o(t.subscribe,t.getState,t.getInitialState,e,n);return ze.useDebugValue(s),s}const Xt=t=>Symbol.iterator in t,Jt=t=>"entries"in t,Gt=(t,e)=>{const n=t instanceof Map?t:new Map(t.entries()),s=e instanceof Map?e:new Map(e.entries());if(n.size!==s.size)return!1;for(const[i,r]of n)if(!s.has(i)||!Object.is(r,s.get(i)))return!1;return!0},Mo=(t,e)=>{const n=t[Symbol.iterator](),s=e[Symbol.iterator]();let i=n.next(),r=s.next();for(;!i.done&&!r.done;){if(!Object.is(i.value,r.value))return!1;i=n.next(),r=s.next()}return!!i.done&&!!r.done};function Lo(t,e){return Object.is(t,e)?!0:typeof t!="object"||t===null||typeof e!="object"||e===null||Object.getPrototypeOf(t)!==Object.getPrototypeOf(e)?!1:Xt(t)&&Xt(e)?Jt(t)&&Jt(e)?Gt(t,e):Mo(t,e):Gt({entries:()=>Object.entries(t)},{entries:()=>Object.entries(e)})}function Dn(t,e="Output"){if(!t)return`interface ${e} {}`;function n(r){if(!r||typeof r!="object")return"unknown";const l=r.type;if(Array.isArray(l))return l.map(c=>s(c)).join(" | ");switch(l){case"string":return r.enum?r.enum.map(c=>`"${c}"`).join(" | "):"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";case"array":{const c=r.items;return c?`${n(c)}[]`:"unknown[]"}case"object":return i(r);default:return r.anyOf?r.anyOf.map(n).join(" | "):r.oneOf?r.oneOf.map(n).join(" | "):r.allOf?r.allOf.map(n).join(" & "):"unknown"}}function s(r){switch(r){case"string":return"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";default:return"unknown"}}function i(r){const l=r.properties;if(!l)return"Record<string, unknown>";const c=new Set(r.required||[]);return`{
2
2
  ${Object.entries(l).map(([u,d])=>{const f=c.has(u)?"":"?";return`${d.description?` /** ${d.description} */
3
3
  `:""} ${u}${f}: ${n(d)};`}).join(`
4
4
  `)}
@@ -0,0 +1 @@
1
+ import{e as n,j as r,r as d,g as h,O as f,l as u}from"./index-D-AchbAp.js";import{S as j,a as b,b as S}from"./index-D-Sd8524.js";import{u as _}from"./tooltip-mh5HW7ZO.js";import{u as k,T as y,a as T,b as i,S as g}from"./index-hAn15iQr.js";import{C as v}from"./chat-context-UGxRb1rI.js";import"./X-D9eppmZ5.js";import"./agent-icon-BVZUm3pj.js";import"./AlertCircle-Bfs7s4nW.js";import"./Tool01-CVk9VJBE.js";import"./XClose-DbuUzE7b.js";import"./RefreshCcw01-Dg3dsSrt.js";import"./ArrowNarrowLeft-Bmz6Y8e3.js";import"./XCircle-aWgEOCXr.js";import"./ArrowUpRight-uN4rpxFQ.js";import"./ZapSquare-DrCreQ3A.js";import"./Users03-CIV6olE1.js";import"./CheckCircle-Ce1bjJWu.js";import"./Check-Dn9d8wcY.js";import"./ChevronDown-CXCDuqLa.js";import"./ChevronRight-D5XY6PcV.js";import"./ChevronUp-CumNURD7.js";import"./DotsVertical-t9aJW5_k.js";import"./Container-CaXLIAOI.js";import"./Star01-DLhWwRZb.js";import"./Palette-YLM_ef0u.js";import"./SearchMd-CEMS2-Af.js";import"./LinkExternal01-Df6M_hj7.js";import"./Lock01-zKy6_9kx.js";import"./Sun-cU8BjYNb.js";import"./Play-CgFl5SH3.js";import"./Plus-CaMiYyQj.js";import"./Settings02-eRruwxu8.js";import"./Shield01-CcUKPlcN.js";import"./Trash01-BRo1VQ8E.js";import"./User01-kmVRHRma.js";import"./Zap-BbjHF1GM.js";import"./shell-layout-DWNJFELP.js";import"./dialog-CrUS2M-J.js";import"./required-auth-layout-eFrhlW0x.js";import"./use-tasks-Dw1R9K3S.js";import"./use-collections-Bj_MIMYU.js";import"./constants-RWvzCl_g.js";import"./use-organization-settings-D3c1eAkJ.js";import"./use-org-sso-qmLHQ9XF.js";import"./pair-BJVqYs09.js";import"./index-Bs5p63Lp.js";import"./use-copy-Vr-WiQt5.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./content-blocks-o63cs2vh.js";import"./types-DmP7ytXf.js";import"./integration-icon-C-l7PWbV.js";import"./use-virtual-mcp-BhZKmvOZ.js";import"./skeleton-CXubnmL1.js";import"./popover-D2EOAbOM.js";import"./drawer-B55E50R8.js";import"./avatar-BLsDXTLO.js";import"./alert-dialog-BBdkraBS.js";import"./form-9gavmyEG.js";import"./label-CIwIDYzF.js";import"./input-CakwXYXP.js";import"./index-Bm8TOoJq.js";import"./use-mcp-tools-CDiw0vXX.js";import"./use-ai-providers-BsD7sWlS.js";import"./index-BOyxqY6S.js";import"./switch-B4qY2cAW.js";import"./use-connection-C1Huhuv0.js";import"./lean-canvas-recruit-modal-BL7Hqazc.js";import"./use-navigate-to-agent-JbrD8A1R.js";import"./collection-search-lhyumEEV.js";import"./checkbox-CxcVXBXV.js";import"./extract-connection-data-4PWi7FLi.js";import"./constants-CCLDSt04.js";import"./collections-a3wfsjnW.js";import"./tabs-wvEgEfW5.js";import"./select-Ji_VTvAf.js";import"./toggle-group-D0qc93NL.js";import"./select-model-kUAjnROT.js";import"./ai-providers-logos-DD3qZ33J.js";import"./use-debounced-autosave-yq4OwEo1.js";import"./settings-section-Bqaz9XGD.js";import"./card-B46IKqYa.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./unwrap-tool-result-BYXdCQMg.js";import"./dropdown-menu-CAcyogWh.js";import"./index-zJlISM1n.js";import"./question-004-sINsf4GQ.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-DJeKMgvX.js";import"./use-registry-connections-C6aVUyvC.js";import"./useInfiniteQuery-B2eIGcfO.js";import"./infiniteQueryObserver-DoJUGWdU.js";import"./collection-tabs-HQQcyoFg.js";import"./badge-CHhcYTOG.js";import"./textarea-hPI8GSZO.js";import"./connection-form-helpers-C2msx2a-.js";import"./use-infinite-scroll-N5zwi7TE.js";import"./useSuspenseInfiniteQuery-Yn6IM0vI.js";import"./collection-search-BOYToHG4.js";import"./use-create-virtual-mcp-BrRlmCqc.js";import"./empty-state-B0wC2RI0.js";import"./use-decopilot-events-DU6d8uCa.js";import"./create-sse-subscription-CxkOgzKf.js";import"./task-status-DHF3W_Oc.js";const N=280;function P(){const t=n.c(2),{tasksOpen:e}=k();if(!e)return null;let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={width:`${N}px`},t[0]=o):o=t[0];let m;return t[1]===Symbol.for("react.memo_cache_sentinel")?(m=r.jsx("aside",{className:"shrink-0 h-full bg-sidebar pb-1",style:o,children:r.jsx("div",{className:"h-full p-0.5 pt-0.25",children:r.jsx("div",{className:"h-full bg-background rounded-[0.75rem] overflow-hidden card-shadow",children:r.jsx(y,{})})})}),t[1]=m):m=t[1],m}function C(){const t=n.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=r.jsx(d.Suspense,{fallback:null,children:r.jsx(P,{})}),t[0]=e):e=t[0],e}function x(){const t=n.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=r.jsx("div",{className:"flex-1 flex items-center justify-center",children:r.jsx(u,{size:20,className:"animate-spin text-muted-foreground"})}),t[0]=e):e=t[0],e}function gr(){const t=n.c(7),e=_();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={strict:!1},t[0]=o):o=t[0];const c=!!h(o).taskId;let s;t[1]===Symbol.for("react.memo_cache_sentinel")?(s={"--sidebar-width-icon":"3.5rem"},t[1]=s):s=t[1];let l;t[2]===Symbol.for("react.memo_cache_sentinel")?(l=r.jsx(g,{}),t[2]=l):l=t[2];let p;t[3]===Symbol.for("react.memo_cache_sentinel")?(p={background:"transparent",containerType:"inline-size"},t[3]=p):p=t[3];let a;return t[4]!==c||t[5]!==e?(a=r.jsx(j,{defaultOpen:!1,children:r.jsx("div",{className:"flex flex-col h-dvh overflow-hidden",children:r.jsxs(b,{className:"flex-1 bg-sidebar",style:s,children:[l,r.jsx(S,{className:"flex flex-col",style:p,children:r.jsx(v,{children:r.jsx(T,{children:e?r.jsx(d.Suspense,{fallback:r.jsx(x,{}),children:r.jsx(f,{})}):r.jsxs(i,{children:[r.jsxs(i.Header,{children:[r.jsxs(i.LeftColumn,{children:[r.jsx(i.Nav,{}),r.jsx(i.TogglesSlot,{})]}),r.jsx(i.CenterSlot,{}),r.jsxs(i.RightColumn,{children:[r.jsx(i.TabsSlot,{}),r.jsx(i.RightSlot,{})]})]}),r.jsxs("div",{className:"flex-1 min-h-0 flex flex-row",children:[c&&r.jsx(C,{}),r.jsx(d.Suspense,{fallback:r.jsx(x,{}),children:r.jsx(f,{})})]})]})})})})]})})}),t[4]=c,t[5]=e,t[6]=a):a=t[6],a}export{gr as default};
@@ -1,4 +1,4 @@
1
- import{cp as Fe,bn as Os,J as oe,I as ge,a_ as ti,bS as _i,aK as Ie,bl as mt,a$ as qe,ap as mr,cq as rn,H as _e,cr as Ii,cs as ws,ct as ec,bQ as tc,cu as ia,cv as nc,cw as rc,cx as ic,cy as fn,cz as Tr,cA as xs,bL as sa,bD as sc,aJ as ze,bR as oc,aI as On,bb as Ci,cB as ac,r as N,j as w,cC as oa,cD as lc}from"./index-n0iHPcte.js";import{f as cc,h as uc,n as fc,j as dc,C as hc,A as pc}from"./constants-DsSHL62C.js";import{B as Ti,c as Pi}from"./collections-kcgqXRh1.js";import{R as Es}from"./index-H-xuVWHv.js";var mc=class{apply(e,t){if(!t.type)return;const n=Array.isArray(t.type)?t.type:[t.type],r=new Set(n);if(r.has("string")||(e.string=!1),!r.has("number")&&!r.has("integer")&&(e.number=!1),r.has("boolean")||(e.boolean=!1),r.has("null")||(e.null=!1),r.has("array")||(e.array=!1),r.has("object")||(e.object=!1),r.has("integer")&&e.number!==!1){const i=e.number||ge();i instanceof rn&&(e.number=i.int())}}},yc=class{apply(e,t){if(t.const===void 0)return;const n=t.const;e.string=!1,e.number=!1,e.boolean=!1,e.null=!1,e.array=!1,e.object=!1,typeof n=="string"?e.string=qe(n):typeof n=="number"?e.number=qe(n):typeof n=="boolean"?e.boolean=qe(n):n===null?e.null=_i():Array.isArray(n)?e.array=void 0:typeof n=="object"&&(e.object=void 0)}},gc=class{apply(e,t){if(!t.enum)return;if(t.enum.length===0){t.type||(e.string=!1,e.number=!1,e.boolean=!1,e.null=!1,e.array=!1,e.object=!1);return}const n={string:t.enum.filter(r=>typeof r=="string"),number:t.enum.filter(r=>typeof r=="number"),boolean:t.enum.filter(r=>typeof r=="boolean"),null:t.enum.filter(r=>r===null),array:t.enum.filter(r=>Array.isArray(r)),object:t.enum.filter(r=>typeof r=="object"&&r!==null&&!Array.isArray(r))};e.string=this.createTypeSchema(n.string,"string"),e.number=this.createTypeSchema(n.number,"number"),e.boolean=this.createTypeSchema(n.boolean,"boolean"),e.null=n.null.length>0?_i():!1,e.array=n.array.length>0?void 0:!1,e.object=n.object.length>0?void 0:!1}createTypeSchema(e,t){if(e.length===0)return!1;if(e.length===1)return qe(e[0]);if(t==="string")return mr(e);if(t==="number"){const[n,r,...i]=e;return mt([qe(n),qe(r),...i.map(s=>qe(s))])}return t==="boolean"?mt([qe(!0),qe(!1)]):!1}},bc=class{apply(e,t){const n=t;if(n.type==="string"&&n.format==="binary"&&n.contentEncoding==="binary"){let r=ic();n.minLength!==void 0&&(r=r.min(n.minLength)),n.maxLength!==void 0&&(r=r.max(n.maxLength)),n.contentMediaType!==void 0&&(r=r.mime(n.contentMediaType)),e.file=r,e.string=!1}}},Sc=class{apply(e,t){const n=t;t.type===void 0&&(n.minLength!==void 0||n.maxLength!==void 0||n.pattern!==void 0)&&e.string===void 0&&(e.string=oe())}},vc=class{apply(e,t){const n=t;if(n.minLength!==void 0&&e.string!==!1){const r=e.string||oe();r instanceof Ii&&(e.string=r.refine(i=>Array.from(i).length>=n.minLength,{message:`String must be at least ${n.minLength} characters long`}))}}},Oc=class{apply(e,t){const n=t;if(n.maxLength!==void 0&&e.string!==!1){const r=e.string||oe();r instanceof Ii&&(e.string=r.refine(i=>Array.from(i).length<=n.maxLength,{message:`String must be at most ${n.maxLength} characters long`}))}}},wc=class{apply(e,t){const n=t;if(n.pattern&&e.string!==!1){const r=e.string||oe();if(r instanceof Ii){const i=new RegExp(n.pattern);e.string=r.regex(i)}}}},xc=class{apply(e,t){const n=t;if(n.minimum!==void 0&&e.number!==!1){const r=e.number||ge();r instanceof rn&&(e.number=r.min(n.minimum))}}},Ec=class{apply(e,t){const n=t;if(n.maximum!==void 0&&e.number!==!1){const r=e.number||ge();r instanceof rn&&(e.number=r.max(n.maximum))}}},Ac=class{apply(e,t){const n=t;if(n.exclusiveMinimum!==void 0&&e.number!==!1){const r=e.number||ge();r instanceof rn&&(typeof n.exclusiveMinimum=="number"?e.number=r.gt(n.exclusiveMinimum):e.number=!1)}}},_c=class{apply(e,t){const n=t;if(n.exclusiveMaximum!==void 0&&e.number!==!1){const r=e.number||ge();r instanceof rn&&(typeof n.exclusiveMaximum=="number"?e.number=r.lt(n.exclusiveMaximum):e.number=!1)}}},Ic=class{apply(e,t){const n=t;if(n.multipleOf!==void 0&&e.number!==!1){const r=e.number||ge();r instanceof rn&&(e.number=r.refine(i=>{if(n.multipleOf===0)return!1;const s=i/n.multipleOf,o=Math.round(s),a=Math.min(Math.abs(i)*Number.EPSILON*10,Math.abs(n.multipleOf)*Number.EPSILON*10);return Math.abs(s-o)<=a/Math.abs(n.multipleOf)},{message:`Must be a multiple of ${n.multipleOf}`}))}}},Cc=class{apply(e,t){const n=t;t.type===void 0&&(n.minItems!==void 0||n.maxItems!==void 0||n.items!==void 0||n.prefixItems!==void 0)&&e.array===void 0&&(e.array=Ie(Fe()))}},Tc=class{apply(e,t){const n=t;n.minItems!==void 0&&e.array!==!1&&(e.array=(e.array||Ie(Fe())).min(n.minItems))}},Pc=class{apply(e,t){const n=t;n.maxItems!==void 0&&e.array!==!1&&(e.array=(e.array||Ie(Fe())).max(n.maxItems))}},Fc=class{apply(e,t){const n=t;if(e.array!==!1)if(Array.isArray(n.items))e.array=e.array||Ie(Fe());else if(n.items&&typeof n.items!="boolean"&&!n.prefixItems){const r=Ae(n.items);let i=Ie(r);if(e.array&&e.array instanceof ec){const s=e.array._def;s.checks&&s.checks.forEach(o=>{if(o._zod&&o._zod.def){const a=o._zod.def;a.check==="min_length"&&a.minimum!==void 0?i=i.min(a.minimum):a.check==="max_length"&&a.maximum!==void 0&&(i=i.max(a.maximum))}})}e.array=i}else typeof n.items=="boolean"&&n.items===!1?n.prefixItems?e.array=e.array||Ie(Fe()):e.array=Ie(Fe()).max(0):typeof n.items=="boolean"&&n.items===!0?e.array=e.array||Ie(Fe()):n.prefixItems&&(e.array=e.array||Ie(Fe()))}},jc=class{apply(e,t){if(t.type!=="array")return;const n=t;if(!Array.isArray(n.items)||e.array===!1)return;const r=n.items.map(s=>Ae(s));let i;r.length===0?i=ws([]):i=ws(r),n.minItems!==void 0&&n.minItems>r.length&&(i=!1),n.maxItems!==void 0&&n.maxItems<r.length&&(i=!1),e.tuple=i,e.array=!1}},$c=class{apply(e,t){const n=t;e.object!==!1&&(n.properties||n.required||n.additionalProperties!==void 0)&&(e.object=e.object||_e({}).passthrough())}},Dc=class{apply(e,t){const n=t;t.type===void 0&&(n.maxProperties!==void 0||n.minProperties!==void 0)&&e.object===void 0&&(e.object=_e({}).passthrough())}},Nc=class{apply(e,t){const n=t;if(n.maxProperties!==void 0&&e.object!==!1){const r=e.object||_e({}).passthrough();e.object=r.refine(i=>Object.keys(i).length<=n.maxProperties,{message:`Object must have at most ${n.maxProperties} properties`})}}},Rc=class{apply(e,t){const n=t;if(n.minProperties!==void 0&&e.object!==!1){const r=e.object||_e({}).passthrough();e.object=r.refine(i=>Object.keys(i).length>=n.minProperties,{message:`Object must have at least ${n.minProperties} properties`})}}};function Tn(e,t){if(e===t)return!0;if(e==null||t==null)return e===t;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t))return e.length!==t.length?!1:e.every((n,r)=>Tn(n,t[r]));if(typeof e=="object"&&typeof t=="object"){const n=Object.keys(e),r=Object.keys(t);return n.length!==r.length?!1:n.every(i=>r.includes(i)&&Tn(e[i],t[i]))}return!1}function Mc(){return e=>{if(!Array.isArray(e))return!0;const t=[];return e.every(n=>t.some(i=>Tn(n,i))?!1:(t.push(n),!0))}}function cr(e,t){return e.safeParse(t).success}var Uc=class{apply(e,t){if(!t.not)return e;const n=Ae(t.not);return e.refine(r=>!cr(n,r),{message:"Value must not match the 'not' schema"})}},kc=class{apply(e,t){return t.uniqueItems!==!0?e:e.refine(Mc(),{message:"Array items must be unique"})}},Lc=class{apply(e,t){return!t.allOf||t.allOf.length===0?e:t.allOf.map(r=>Ae(r)).reduce((r,i)=>ia(r,i),e)}},Bc=class{apply(e,t){if(!t.anyOf||t.anyOf.length===0)return e;const n=t.anyOf.length===1?Ae(t.anyOf[0]):mt([Ae(t.anyOf[0]),Ae(t.anyOf[1]),...t.anyOf.slice(2).map(r=>Ae(r))]);return ia(e,n)}},Wc=class{apply(e,t){if(!t.oneOf||t.oneOf.length===0)return e;const n=t.oneOf.map(r=>Ae(r));return e.refine(r=>{let i=0;for(const s of n)if(s.safeParse(r).success&&(i++,i>1))return!1;return i===1},{message:"Value must match exactly one of the oneOf schemas"})}},qc=class{apply(e,t){const n=t;if(n.prefixItems&&Array.isArray(n.prefixItems)){const i=n.prefixItems.map(s=>Ae(s));return e.refine(s=>{if(!Array.isArray(s))return!0;for(let o=0;o<Math.min(s.length,i.length);o++)if(!cr(i[o],s[o]))return!1;if(s.length>i.length){if(typeof n.items=="boolean"&&n.items===!1)return!1;if(n.items&&typeof n.items=="object"&&!Array.isArray(n.items)){const o=Ae(n.items);for(let a=i.length;a<s.length;a++)if(!cr(o,s[a]))return!1}}return!0},{message:"Array does not match prefixItems schema"})}return e}},Vc=class{apply(e,t){const n=t;if(!n.properties&&!n.required&&n.additionalProperties!==!1)return e;if(e instanceof nc||e instanceof rc){const r={};if(n.properties)for(const[i,s]of Object.entries(n.properties))s!==void 0&&(r[i]=Ae(s));if(n.required&&Array.isArray(n.required)){const i=new Set(n.required);for(const s of Object.keys(r))i.has(s)||(r[s]=r[s].optional())}else for(const i of Object.keys(r))r[i]=r[i].optional();return n.additionalProperties===!1?_e(r):_e(r).passthrough()}return e.refine(r=>{if(typeof r!="object"||r===null||Array.isArray(r))return!0;if(n.properties){for(const[i,s]of Object.entries(n.properties))if(s!==void 0&&Object.getOwnPropertyDescriptor(r,i)!==void 0&&!Ae(s).safeParse(r[i]).success)return!1}if(n.required&&Array.isArray(n.required)){for(const i of n.required)if(!(Object.getOwnPropertyDescriptor(r,i)!==void 0))return!1}if(n.additionalProperties===!1&&n.properties){const i=new Set(Object.keys(n.properties));for(const s in r)if(!i.has(s))return!1}return!0},{message:"Object constraints validation failed"})}},Hc=class{apply(e,t){if(!t.enum||t.enum.length===0)return e;const n=t.enum.filter(r=>Array.isArray(r)||typeof r=="object"&&r!==null);return n.length===0?e:e.refine(r=>typeof r!="object"||r===null?!0:n.some(i=>Tn(r,i)),{message:"Value must match one of the enum values"})}},Kc=class{apply(e,t){if(t.const===void 0)return e;const n=t.const;return typeof n!="object"||n===null?e:e.refine(r=>Tn(r,n),{message:"Value must equal the const value"})}},Gc=class{apply(e,t){return t.description&&(e=e.describe(t.description)),e}},zc=class{apply(e,t){var n;const r=t;return!((n=r.required)!=null&&n.includes("__proto__"))||t.type!==void 0?e:Fe().refine(i=>this.validateRequired(i,r.required),{message:"Missing required properties"})}validateRequired(e,t){return typeof e!="object"||e===null||Array.isArray(e)?!0:t.every(n=>Object.prototype.hasOwnProperty.call(e,n))}},Yc=class{apply(e,t){var n;const r=t;if(r.contains===void 0)return e;const i=Ae(r.contains),s=(n=r.minContains)!=null?n:1,o=r.maxContains;return e.refine(a=>{if(!Array.isArray(a))return!0;let l=0;for(const c of a)cr(i,c)&&l++;return!(l<s||o!==void 0&&l>o)},{message:"Array must contain required items matching the schema"})}},Jc=class{apply(e,t){const{default:n}=t;return n===void 0||!e.safeParse(n).success?e:e.default(n)}},Zc=[new yc,new gc,new mc,new bc,new Sc,new Cc,new Dc,new vc,new Oc,new wc,new xc,new Ec,new Ac,new _c,new Ic,new jc,new Tc,new Pc,new Fc,new Nc,new Rc,new $c],Xc=[new zc,new Hc,new Kc,new Lc,new Bc,new Wc,new qc,new Vc,new Yc,new Uc,new kc,new Jc,new Gc];function Ae(e){if(typeof e=="boolean")return e?Fe():Os();const t={};for(const i of Zc)i.apply(t,e);const n=[];if(t.string!==!1&&n.push(t.string||oe()),t.number!==!1&&n.push(t.number||ge()),t.boolean!==!1&&n.push(t.boolean||ti()),t.null!==!1&&n.push(t.null||_i()),t.array!==!1&&n.push(t.array||Ie(Fe())),t.tuple!==!1&&t.tuple!==void 0&&n.push(t.tuple),t.object!==!1)if(t.object)n.push(t.object);else{const i=tc(s=>typeof s=="object"&&s!==null&&!Array.isArray(s),"Must be an object, not an array");n.push(i)}t.file!==!1&&t.file!==void 0&&n.push(t.file);let r;n.length===0?r=Os():n.length===1?r=n[0]:Object.keys(e).some(s=>s!=="$schema"&&s!=="title"&&s!=="description")?r=mt(n):r=Fe();for(const i of Xc)r=i.apply(r,e);return r}class As extends Event{constructor(t,n){var r,i;super(t),this.code=(r=n?.code)!=null?r:void 0,this.message=(i=n?.message)!=null?i:void 0}[Symbol.for("nodejs.util.inspect.custom")](t,n,r){return r(_s(this),n)}[Symbol.for("Deno.customInspect")](t,n){return t(_s(this),n)}}function Qc(e){const t=globalThis.DOMException;return typeof t=="function"?new t(e,"SyntaxError"):new SyntaxError(e)}function ni(e){return e instanceof Error?"errors"in e&&Array.isArray(e.errors)?e.errors.map(ni).join(", "):"cause"in e&&e.cause instanceof Error?`${e}: ${ni(e.cause)}`:e.message:`${e}`}function _s(e){return{type:e.type,message:e.message,code:e.code,defaultPrevented:e.defaultPrevented,cancelable:e.cancelable,timeStamp:e.timeStamp}}var aa=e=>{throw TypeError(e)},Fi=(e,t,n)=>t.has(e)||aa("Cannot "+n),G=(e,t,n)=>(Fi(e,t,"read from private field"),n?n.call(e):t.get(e)),Se=(e,t,n)=>t.has(e)?aa("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),he=(e,t,n,r)=>(Fi(e,t,"write to private field"),t.set(e,n),n),Qe=(e,t,n)=>(Fi(e,t,"access private method"),n),Ce,Et,kt,Qn,ur,wn,qt,xn,ct,Lt,Gt,Bt,mn,Re,ri,ii,si,Is,oi,ai,yn,li,ci;class er extends EventTarget{constructor(t,n){var r,i;super(),Se(this,Re),this.CONNECTING=0,this.OPEN=1,this.CLOSED=2,Se(this,Ce),Se(this,Et),Se(this,kt),Se(this,Qn),Se(this,ur),Se(this,wn),Se(this,qt),Se(this,xn,null),Se(this,ct),Se(this,Lt),Se(this,Gt,null),Se(this,Bt,null),Se(this,mn,null),Se(this,ii,async s=>{var o;G(this,Lt).reset();const{body:a,redirected:l,status:c,headers:u}=s;if(c===204){Qe(this,Re,yn).call(this,"Server sent HTTP 204, not reconnecting",204),this.close();return}if(l?he(this,kt,new URL(s.url)):he(this,kt,void 0),c!==200){Qe(this,Re,yn).call(this,`Non-200 status code (${c})`,c);return}if(!(u.get("content-type")||"").startsWith("text/event-stream")){Qe(this,Re,yn).call(this,'Invalid content type, expected "text/event-stream"',c);return}if(G(this,Ce)===this.CLOSED)return;he(this,Ce,this.OPEN);const f=new Event("open");if((o=G(this,mn))==null||o.call(this,f),this.dispatchEvent(f),typeof a!="object"||!a||!("getReader"in a)){Qe(this,Re,yn).call(this,"Invalid response body, expected a web ReadableStream",c),this.close();return}const h=new TextDecoder,m=a.getReader();let d=!0;do{const{done:p,value:y}=await m.read();y&&G(this,Lt).feed(h.decode(y,{stream:!p})),p&&(d=!1,G(this,Lt).reset(),Qe(this,Re,li).call(this))}while(d)}),Se(this,si,s=>{he(this,ct,void 0),!(s.name==="AbortError"||s.type==="aborted")&&Qe(this,Re,li).call(this,ni(s))}),Se(this,oi,s=>{typeof s.id=="string"&&he(this,xn,s.id);const o=new MessageEvent(s.event||"message",{data:s.data,origin:G(this,kt)?G(this,kt).origin:G(this,Et).origin,lastEventId:s.id||""});G(this,Bt)&&(!s.event||s.event==="message")&&G(this,Bt).call(this,o),this.dispatchEvent(o)}),Se(this,ai,s=>{he(this,wn,s)}),Se(this,ci,()=>{he(this,qt,void 0),G(this,Ce)===this.CONNECTING&&Qe(this,Re,ri).call(this)});try{if(t instanceof URL)he(this,Et,t);else if(typeof t=="string")he(this,Et,new URL(t,eu()));else throw new Error("Invalid URL")}catch{throw Qc("An invalid or illegal string was specified")}he(this,Lt,cc({onEvent:G(this,oi),onRetry:G(this,ai)})),he(this,Ce,this.CONNECTING),he(this,wn,3e3),he(this,ur,(r=n?.fetch)!=null?r:globalThis.fetch),he(this,Qn,(i=n?.withCredentials)!=null?i:!1),Qe(this,Re,ri).call(this)}get readyState(){return G(this,Ce)}get url(){return G(this,Et).href}get withCredentials(){return G(this,Qn)}get onerror(){return G(this,Gt)}set onerror(t){he(this,Gt,t)}get onmessage(){return G(this,Bt)}set onmessage(t){he(this,Bt,t)}get onopen(){return G(this,mn)}set onopen(t){he(this,mn,t)}addEventListener(t,n,r){const i=n;super.addEventListener(t,i,r)}removeEventListener(t,n,r){const i=n;super.removeEventListener(t,i,r)}close(){G(this,qt)&&clearTimeout(G(this,qt)),G(this,Ce)!==this.CLOSED&&(G(this,ct)&&G(this,ct).abort(),he(this,Ce,this.CLOSED),he(this,ct,void 0))}}Ce=new WeakMap,Et=new WeakMap,kt=new WeakMap,Qn=new WeakMap,ur=new WeakMap,wn=new WeakMap,qt=new WeakMap,xn=new WeakMap,ct=new WeakMap,Lt=new WeakMap,Gt=new WeakMap,Bt=new WeakMap,mn=new WeakMap,Re=new WeakSet,ri=function(){he(this,Ce,this.CONNECTING),he(this,ct,new AbortController),G(this,ur)(G(this,Et),Qe(this,Re,Is).call(this)).then(G(this,ii)).catch(G(this,si))},ii=new WeakMap,si=new WeakMap,Is=function(){var e;const t={mode:"cors",redirect:"follow",headers:{Accept:"text/event-stream",...G(this,xn)?{"Last-Event-ID":G(this,xn)}:void 0},cache:"no-store",signal:(e=G(this,ct))==null?void 0:e.signal};return"window"in globalThis&&(t.credentials=this.withCredentials?"include":"same-origin"),t},oi=new WeakMap,ai=new WeakMap,yn=function(e,t){var n;G(this,Ce)!==this.CLOSED&&he(this,Ce,this.CLOSED);const r=new As("error",{code:t,message:e});(n=G(this,Gt))==null||n.call(this,r),this.dispatchEvent(r)},li=function(e,t){var n;if(G(this,Ce)===this.CLOSED)return;he(this,Ce,this.CONNECTING);const r=new As("error",{code:t,message:e});(n=G(this,Gt))==null||n.call(this,r),this.dispatchEvent(r),he(this,qt,setTimeout(G(this,ci),G(this,wn)))},ci=new WeakMap,er.CONNECTING=0,er.OPEN=1,er.CLOSED=2;function eu(){const e="document"in globalThis?globalThis.document:void 0;return e&&typeof e=="object"&&"baseURI"in e&&typeof e.baseURI=="string"?e.baseURI:void 0}class tu extends Error{constructor(t,n,r){super(`SSE error: ${n}`),this.code=t,this.event=r}}class nu{constructor(t,n){this._url=t,this._resourceMetadataUrl=void 0,this._scope=void 0,this._eventSourceInit=n?.eventSourceInit,this._requestInit=n?.requestInit,this._authProvider=n?.authProvider,this._fetch=n?.fetch,this._fetchWithInit=uc(n?.fetch,n?.requestInit)}async _authThenStart(){if(!this._authProvider)throw new fn("No auth provider");let t;try{t=await Tr(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})}catch(n){throw this.onerror?.(n),n}if(t!=="AUTHORIZED")throw new fn;return await this._startOrAuth()}async _commonHeaders(){const t={};if(this._authProvider){const r=await this._authProvider.tokens();r&&(t.Authorization=`Bearer ${r.access_token}`)}this._protocolVersion&&(t["mcp-protocol-version"]=this._protocolVersion);const n=fc(this._requestInit?.headers);return new Headers({...t,...n})}_startOrAuth(){const t=this?._eventSourceInit?.fetch??this._fetch??fetch;return new Promise((n,r)=>{this._eventSource=new er(this._url.href,{...this._eventSourceInit,fetch:async(i,s)=>{const o=await this._commonHeaders();o.set("Accept","text/event-stream");const a=await t(i,{...s,headers:o});if(a.status===401&&a.headers.has("www-authenticate")){const{resourceMetadataUrl:l,scope:c}=xs(a);this._resourceMetadataUrl=l,this._scope=c}return a}}),this._abortController=new AbortController,this._eventSource.onerror=i=>{if(i.code===401&&this._authProvider){this._authThenStart().then(n,r);return}const s=new tu(i.code,i.message,i);r(s),this.onerror?.(s)},this._eventSource.onopen=()=>{},this._eventSource.addEventListener("endpoint",i=>{const s=i;try{if(this._endpoint=new URL(s.data,this._url),this._endpoint.origin!==this._url.origin)throw new Error(`Endpoint origin does not match connection origin: ${this._endpoint.origin}`)}catch(o){r(o),this.onerror?.(o),this.close();return}n()}),this._eventSource.onmessage=i=>{const s=i;let o;try{o=sa.parse(JSON.parse(s.data))}catch(a){this.onerror?.(a);return}this.onmessage?.(o)}})}async start(){if(this._eventSource)throw new Error("SSEClientTransport already started! If using Client class, note that connect() calls start() automatically.");return await this._startOrAuth()}async finishAuth(t){if(!this._authProvider)throw new fn("No auth provider");if(await Tr(this._authProvider,{serverUrl:this._url,authorizationCode:t,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new fn("Failed to authorize")}async close(){this._abortController?.abort(),this._eventSource?.close(),this.onclose?.()}async send(t){if(!this._endpoint)throw new Error("Not connected");try{const n=await this._commonHeaders();n.set("content-type","application/json");const r={...this._requestInit,method:"POST",headers:n,body:JSON.stringify(t),signal:this._abortController?.signal},i=await(this._fetch??fetch)(this._endpoint,r);if(!i.ok){const s=await i.text().catch(()=>null);if(i.status===401&&this._authProvider){const{resourceMetadataUrl:o,scope:a}=xs(i);if(this._resourceMetadataUrl=o,this._scope=a,await Tr(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new fn;return this.send(t)}throw new Error(`Error POSTing to endpoint (HTTP ${i.status}): ${s}`)}await i.body?.cancel()}catch(n){throw this.onerror?.(n),n}}setProtocolVersion(t){this._protocolVersion=t}}const ru="mcp";class iu{constructor(t){this._url=t}start(){if(this._socket)throw new Error("WebSocketClientTransport already started! If using Client class, note that connect() calls start() automatically.");return new Promise((t,n)=>{this._socket=new WebSocket(this._url,ru),this._socket.onerror=r=>{const i="error"in r?r.error:new Error(`WebSocket error: ${JSON.stringify(r)}`);n(i),this.onerror?.(i)},this._socket.onopen=()=>{t()},this._socket.onclose=()=>{this.onclose?.()},this._socket.onmessage=r=>{let i;try{i=sa.parse(JSON.parse(r.data))}catch(s){this.onerror?.(s);return}this.onmessage?.(i)}})}async close(){this._socket?.close()}send(t){return new Promise((n,r)=>{if(!this._socket){r(new Error("Not connected"));return}this._socket?.send(JSON.stringify(t)),n()})}}class su extends dc{constructor(t,n){super(t,n)}send(t,n){const r=ou(t);return r?.type==="emit"?(this.onmessage?.(r.message),Promise.resolve()):r?.type==="suppress"?Promise.resolve():super.send(t,n)}}function ou(e){const t=e;if(!t||typeof t!="object"||!("method"in t))return null;switch(t.method){case"initialize":{const n=t?.params?.protocolVersion;return n?{type:"emit",message:{result:{protocolVersion:n,capabilities:{tools:{}},serverInfo:{name:"deco-chat-server",version:"1.0.0"}},jsonrpc:t.jsonrpc??"2.0",id:t.id}}:null}case"notifications/roots/list_changed":case"notifications/initialized":case"notifications/cancelled":case"notifications/progress":return{type:"suppress"};default:return null}}class au extends hc{constructor(t,n){super(t,n)}async listTools(t,n){return await this.request({method:"tools/list",params:t},sc,n)}}const lu=async(e,t,n)=>{const r=cu(e.connection,t,n);if(!r)throw new Error("Unknown MCP connection type");const i=new au({name:e?.name??"MCP Client",version:"1.0.0"});return await i.connect(r),{client:i}},cu=(e,t,n)=>{if(e.type==="Websocket")return new iu(new URL(e.url));if(e.type!=="SSE"&&e.type!=="HTTP")return null;const i={...e.token?{authorization:`Bearer ${e.token}`}:{},...n??{},..."headers"in e?e.headers||{}:{}};if(e.type==="SSE"){const s={requestInit:{headers:i,signal:t}};return e.token&&(s.eventSourceInit={fetch:(o,a)=>fetch(o,{...a,headers:{...i,Accept:"text/event-stream"},signal:t})}),new nu(new URL(e.url),s)}return new su(new URL(e.url),{requestInit:{headers:i,signal:t,credentials:"include"}})},Cs=e=>{try{return JSON.parse(e)}catch{return e}},zn=new Map,Ts=(e,t)=>({...e,id:e.name,inputSchema:e.inputSchema?Ae(e.inputSchema):void 0,outputSchema:e.outputSchema?Ae(e.outputSchema):void 0,execute:n=>t(n.context,e.name)});function uu(e){const t=n=>"connection"in e?lu({connection:e.connection},void 0,n):e.client;return new Proxy({},{get(n,r){if(r==="toJSON")return null;if(typeof r!="string")throw new Error("Name must be a string");if(r==="listTools")return a;async function i(l,c=r){const u=e?.debugId?.(),f=u?{"x-trace-debug-id":u}:void 0,{client:h}=await t(f),{structuredContent:m,isError:d,content:p}=await h.callTool({name:String(c),arguments:l});if(d){const S=p?.[0]?.text,O=typeof S=="string"?Cs(S):null,E=O?.code&&typeof e?.getErrorByStatusCode=="function"?e.getErrorByStatusCode(O.code,O.message,O.traceId):null;throw E||new Error(`Tool ${String(c)} returned an error: ${JSON.stringify(m??p)}`)}if(m!==void 0)return m;const y=p?.[0]?.text;return typeof y=="string"?Cs(y):void 0}async function s(){const{client:l}=await t(),{tools:c}=await l.listTools();return c}async function o(){if(!("connection"in e))return s();const l=e.connection,c=JSON.stringify(l);try{return zn.has(c)||zn.set(c,s()),await zn.get(c)}catch(u){console.error("Failed to list tools",u),zn.delete(c);return}}async function a(){return(await o()??[]).map(c=>Ts(c,i))}return i.asTool=async()=>{const c=(await o()??[]).find(u=>u.name===r);if(!c)throw new Error(`Tool ${r} not found`);return Ts(c,i)},i}})}new Proxy({},{get(e,t){return t==="toJSON"?null:t==="forConnection"?n=>fu({connection:n}):global[t]}});function fu(e){return uu(e)}const du=_e({toolName:oe().describe("Name of the tool to invoke on that connection"),transformCode:oe().optional().describe("Pure TypeScript function for data transformation of the tool call result. Must be a TypeScript file that declares the Output interface and exports a default function: `interface Output { ... } export default async function(stepInput): Output { ... }`\n The stepInput will match with the tool call outputSchema. If transformCode is not provided, the tool call result will be used as the step output.\n Providing an transformCode is recommended because it both allows you to transform the data and validate it against a JSON Schema - tools are ephemeral and may return unexpected data.")}),hu=_e({code:oe().describe(`Pure TypeScript function for data transformation. Useful to merge data from multiple steps and transform it. Must be a TypeScript file that declares the Output interface and exports a default function: \`interface Output { ... } export default async function(stepInput): Output { ... }\`
1
+ import{cp as Fe,bn as Os,J as oe,I as ge,a_ as ti,bS as _i,aK as Ie,bl as mt,a$ as qe,ap as mr,cq as rn,H as _e,cr as Ii,cs as ws,ct as ec,bQ as tc,cu as ia,cv as nc,cw as rc,cx as ic,cy as fn,cz as Tr,cA as xs,bL as sa,bD as sc,aJ as ze,bR as oc,aI as On,bb as Ci,cB as ac,r as N,j as w,cC as oa,cD as lc}from"./index-D-AchbAp.js";import{f as cc,h as uc,n as fc,j as dc,C as hc,A as pc}from"./constants-RWvzCl_g.js";import{B as Ti,c as Pi}from"./collections-a3wfsjnW.js";import{R as Es}from"./index-DJKFaAtT.js";var mc=class{apply(e,t){if(!t.type)return;const n=Array.isArray(t.type)?t.type:[t.type],r=new Set(n);if(r.has("string")||(e.string=!1),!r.has("number")&&!r.has("integer")&&(e.number=!1),r.has("boolean")||(e.boolean=!1),r.has("null")||(e.null=!1),r.has("array")||(e.array=!1),r.has("object")||(e.object=!1),r.has("integer")&&e.number!==!1){const i=e.number||ge();i instanceof rn&&(e.number=i.int())}}},yc=class{apply(e,t){if(t.const===void 0)return;const n=t.const;e.string=!1,e.number=!1,e.boolean=!1,e.null=!1,e.array=!1,e.object=!1,typeof n=="string"?e.string=qe(n):typeof n=="number"?e.number=qe(n):typeof n=="boolean"?e.boolean=qe(n):n===null?e.null=_i():Array.isArray(n)?e.array=void 0:typeof n=="object"&&(e.object=void 0)}},gc=class{apply(e,t){if(!t.enum)return;if(t.enum.length===0){t.type||(e.string=!1,e.number=!1,e.boolean=!1,e.null=!1,e.array=!1,e.object=!1);return}const n={string:t.enum.filter(r=>typeof r=="string"),number:t.enum.filter(r=>typeof r=="number"),boolean:t.enum.filter(r=>typeof r=="boolean"),null:t.enum.filter(r=>r===null),array:t.enum.filter(r=>Array.isArray(r)),object:t.enum.filter(r=>typeof r=="object"&&r!==null&&!Array.isArray(r))};e.string=this.createTypeSchema(n.string,"string"),e.number=this.createTypeSchema(n.number,"number"),e.boolean=this.createTypeSchema(n.boolean,"boolean"),e.null=n.null.length>0?_i():!1,e.array=n.array.length>0?void 0:!1,e.object=n.object.length>0?void 0:!1}createTypeSchema(e,t){if(e.length===0)return!1;if(e.length===1)return qe(e[0]);if(t==="string")return mr(e);if(t==="number"){const[n,r,...i]=e;return mt([qe(n),qe(r),...i.map(s=>qe(s))])}return t==="boolean"?mt([qe(!0),qe(!1)]):!1}},bc=class{apply(e,t){const n=t;if(n.type==="string"&&n.format==="binary"&&n.contentEncoding==="binary"){let r=ic();n.minLength!==void 0&&(r=r.min(n.minLength)),n.maxLength!==void 0&&(r=r.max(n.maxLength)),n.contentMediaType!==void 0&&(r=r.mime(n.contentMediaType)),e.file=r,e.string=!1}}},Sc=class{apply(e,t){const n=t;t.type===void 0&&(n.minLength!==void 0||n.maxLength!==void 0||n.pattern!==void 0)&&e.string===void 0&&(e.string=oe())}},vc=class{apply(e,t){const n=t;if(n.minLength!==void 0&&e.string!==!1){const r=e.string||oe();r instanceof Ii&&(e.string=r.refine(i=>Array.from(i).length>=n.minLength,{message:`String must be at least ${n.minLength} characters long`}))}}},Oc=class{apply(e,t){const n=t;if(n.maxLength!==void 0&&e.string!==!1){const r=e.string||oe();r instanceof Ii&&(e.string=r.refine(i=>Array.from(i).length<=n.maxLength,{message:`String must be at most ${n.maxLength} characters long`}))}}},wc=class{apply(e,t){const n=t;if(n.pattern&&e.string!==!1){const r=e.string||oe();if(r instanceof Ii){const i=new RegExp(n.pattern);e.string=r.regex(i)}}}},xc=class{apply(e,t){const n=t;if(n.minimum!==void 0&&e.number!==!1){const r=e.number||ge();r instanceof rn&&(e.number=r.min(n.minimum))}}},Ec=class{apply(e,t){const n=t;if(n.maximum!==void 0&&e.number!==!1){const r=e.number||ge();r instanceof rn&&(e.number=r.max(n.maximum))}}},Ac=class{apply(e,t){const n=t;if(n.exclusiveMinimum!==void 0&&e.number!==!1){const r=e.number||ge();r instanceof rn&&(typeof n.exclusiveMinimum=="number"?e.number=r.gt(n.exclusiveMinimum):e.number=!1)}}},_c=class{apply(e,t){const n=t;if(n.exclusiveMaximum!==void 0&&e.number!==!1){const r=e.number||ge();r instanceof rn&&(typeof n.exclusiveMaximum=="number"?e.number=r.lt(n.exclusiveMaximum):e.number=!1)}}},Ic=class{apply(e,t){const n=t;if(n.multipleOf!==void 0&&e.number!==!1){const r=e.number||ge();r instanceof rn&&(e.number=r.refine(i=>{if(n.multipleOf===0)return!1;const s=i/n.multipleOf,o=Math.round(s),a=Math.min(Math.abs(i)*Number.EPSILON*10,Math.abs(n.multipleOf)*Number.EPSILON*10);return Math.abs(s-o)<=a/Math.abs(n.multipleOf)},{message:`Must be a multiple of ${n.multipleOf}`}))}}},Cc=class{apply(e,t){const n=t;t.type===void 0&&(n.minItems!==void 0||n.maxItems!==void 0||n.items!==void 0||n.prefixItems!==void 0)&&e.array===void 0&&(e.array=Ie(Fe()))}},Tc=class{apply(e,t){const n=t;n.minItems!==void 0&&e.array!==!1&&(e.array=(e.array||Ie(Fe())).min(n.minItems))}},Pc=class{apply(e,t){const n=t;n.maxItems!==void 0&&e.array!==!1&&(e.array=(e.array||Ie(Fe())).max(n.maxItems))}},Fc=class{apply(e,t){const n=t;if(e.array!==!1)if(Array.isArray(n.items))e.array=e.array||Ie(Fe());else if(n.items&&typeof n.items!="boolean"&&!n.prefixItems){const r=Ae(n.items);let i=Ie(r);if(e.array&&e.array instanceof ec){const s=e.array._def;s.checks&&s.checks.forEach(o=>{if(o._zod&&o._zod.def){const a=o._zod.def;a.check==="min_length"&&a.minimum!==void 0?i=i.min(a.minimum):a.check==="max_length"&&a.maximum!==void 0&&(i=i.max(a.maximum))}})}e.array=i}else typeof n.items=="boolean"&&n.items===!1?n.prefixItems?e.array=e.array||Ie(Fe()):e.array=Ie(Fe()).max(0):typeof n.items=="boolean"&&n.items===!0?e.array=e.array||Ie(Fe()):n.prefixItems&&(e.array=e.array||Ie(Fe()))}},jc=class{apply(e,t){if(t.type!=="array")return;const n=t;if(!Array.isArray(n.items)||e.array===!1)return;const r=n.items.map(s=>Ae(s));let i;r.length===0?i=ws([]):i=ws(r),n.minItems!==void 0&&n.minItems>r.length&&(i=!1),n.maxItems!==void 0&&n.maxItems<r.length&&(i=!1),e.tuple=i,e.array=!1}},$c=class{apply(e,t){const n=t;e.object!==!1&&(n.properties||n.required||n.additionalProperties!==void 0)&&(e.object=e.object||_e({}).passthrough())}},Dc=class{apply(e,t){const n=t;t.type===void 0&&(n.maxProperties!==void 0||n.minProperties!==void 0)&&e.object===void 0&&(e.object=_e({}).passthrough())}},Nc=class{apply(e,t){const n=t;if(n.maxProperties!==void 0&&e.object!==!1){const r=e.object||_e({}).passthrough();e.object=r.refine(i=>Object.keys(i).length<=n.maxProperties,{message:`Object must have at most ${n.maxProperties} properties`})}}},Rc=class{apply(e,t){const n=t;if(n.minProperties!==void 0&&e.object!==!1){const r=e.object||_e({}).passthrough();e.object=r.refine(i=>Object.keys(i).length>=n.minProperties,{message:`Object must have at least ${n.minProperties} properties`})}}};function Tn(e,t){if(e===t)return!0;if(e==null||t==null)return e===t;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t))return e.length!==t.length?!1:e.every((n,r)=>Tn(n,t[r]));if(typeof e=="object"&&typeof t=="object"){const n=Object.keys(e),r=Object.keys(t);return n.length!==r.length?!1:n.every(i=>r.includes(i)&&Tn(e[i],t[i]))}return!1}function Mc(){return e=>{if(!Array.isArray(e))return!0;const t=[];return e.every(n=>t.some(i=>Tn(n,i))?!1:(t.push(n),!0))}}function cr(e,t){return e.safeParse(t).success}var Uc=class{apply(e,t){if(!t.not)return e;const n=Ae(t.not);return e.refine(r=>!cr(n,r),{message:"Value must not match the 'not' schema"})}},kc=class{apply(e,t){return t.uniqueItems!==!0?e:e.refine(Mc(),{message:"Array items must be unique"})}},Lc=class{apply(e,t){return!t.allOf||t.allOf.length===0?e:t.allOf.map(r=>Ae(r)).reduce((r,i)=>ia(r,i),e)}},Bc=class{apply(e,t){if(!t.anyOf||t.anyOf.length===0)return e;const n=t.anyOf.length===1?Ae(t.anyOf[0]):mt([Ae(t.anyOf[0]),Ae(t.anyOf[1]),...t.anyOf.slice(2).map(r=>Ae(r))]);return ia(e,n)}},Wc=class{apply(e,t){if(!t.oneOf||t.oneOf.length===0)return e;const n=t.oneOf.map(r=>Ae(r));return e.refine(r=>{let i=0;for(const s of n)if(s.safeParse(r).success&&(i++,i>1))return!1;return i===1},{message:"Value must match exactly one of the oneOf schemas"})}},qc=class{apply(e,t){const n=t;if(n.prefixItems&&Array.isArray(n.prefixItems)){const i=n.prefixItems.map(s=>Ae(s));return e.refine(s=>{if(!Array.isArray(s))return!0;for(let o=0;o<Math.min(s.length,i.length);o++)if(!cr(i[o],s[o]))return!1;if(s.length>i.length){if(typeof n.items=="boolean"&&n.items===!1)return!1;if(n.items&&typeof n.items=="object"&&!Array.isArray(n.items)){const o=Ae(n.items);for(let a=i.length;a<s.length;a++)if(!cr(o,s[a]))return!1}}return!0},{message:"Array does not match prefixItems schema"})}return e}},Vc=class{apply(e,t){const n=t;if(!n.properties&&!n.required&&n.additionalProperties!==!1)return e;if(e instanceof nc||e instanceof rc){const r={};if(n.properties)for(const[i,s]of Object.entries(n.properties))s!==void 0&&(r[i]=Ae(s));if(n.required&&Array.isArray(n.required)){const i=new Set(n.required);for(const s of Object.keys(r))i.has(s)||(r[s]=r[s].optional())}else for(const i of Object.keys(r))r[i]=r[i].optional();return n.additionalProperties===!1?_e(r):_e(r).passthrough()}return e.refine(r=>{if(typeof r!="object"||r===null||Array.isArray(r))return!0;if(n.properties){for(const[i,s]of Object.entries(n.properties))if(s!==void 0&&Object.getOwnPropertyDescriptor(r,i)!==void 0&&!Ae(s).safeParse(r[i]).success)return!1}if(n.required&&Array.isArray(n.required)){for(const i of n.required)if(!(Object.getOwnPropertyDescriptor(r,i)!==void 0))return!1}if(n.additionalProperties===!1&&n.properties){const i=new Set(Object.keys(n.properties));for(const s in r)if(!i.has(s))return!1}return!0},{message:"Object constraints validation failed"})}},Hc=class{apply(e,t){if(!t.enum||t.enum.length===0)return e;const n=t.enum.filter(r=>Array.isArray(r)||typeof r=="object"&&r!==null);return n.length===0?e:e.refine(r=>typeof r!="object"||r===null?!0:n.some(i=>Tn(r,i)),{message:"Value must match one of the enum values"})}},Kc=class{apply(e,t){if(t.const===void 0)return e;const n=t.const;return typeof n!="object"||n===null?e:e.refine(r=>Tn(r,n),{message:"Value must equal the const value"})}},Gc=class{apply(e,t){return t.description&&(e=e.describe(t.description)),e}},zc=class{apply(e,t){var n;const r=t;return!((n=r.required)!=null&&n.includes("__proto__"))||t.type!==void 0?e:Fe().refine(i=>this.validateRequired(i,r.required),{message:"Missing required properties"})}validateRequired(e,t){return typeof e!="object"||e===null||Array.isArray(e)?!0:t.every(n=>Object.prototype.hasOwnProperty.call(e,n))}},Yc=class{apply(e,t){var n;const r=t;if(r.contains===void 0)return e;const i=Ae(r.contains),s=(n=r.minContains)!=null?n:1,o=r.maxContains;return e.refine(a=>{if(!Array.isArray(a))return!0;let l=0;for(const c of a)cr(i,c)&&l++;return!(l<s||o!==void 0&&l>o)},{message:"Array must contain required items matching the schema"})}},Jc=class{apply(e,t){const{default:n}=t;return n===void 0||!e.safeParse(n).success?e:e.default(n)}},Zc=[new yc,new gc,new mc,new bc,new Sc,new Cc,new Dc,new vc,new Oc,new wc,new xc,new Ec,new Ac,new _c,new Ic,new jc,new Tc,new Pc,new Fc,new Nc,new Rc,new $c],Xc=[new zc,new Hc,new Kc,new Lc,new Bc,new Wc,new qc,new Vc,new Yc,new Uc,new kc,new Jc,new Gc];function Ae(e){if(typeof e=="boolean")return e?Fe():Os();const t={};for(const i of Zc)i.apply(t,e);const n=[];if(t.string!==!1&&n.push(t.string||oe()),t.number!==!1&&n.push(t.number||ge()),t.boolean!==!1&&n.push(t.boolean||ti()),t.null!==!1&&n.push(t.null||_i()),t.array!==!1&&n.push(t.array||Ie(Fe())),t.tuple!==!1&&t.tuple!==void 0&&n.push(t.tuple),t.object!==!1)if(t.object)n.push(t.object);else{const i=tc(s=>typeof s=="object"&&s!==null&&!Array.isArray(s),"Must be an object, not an array");n.push(i)}t.file!==!1&&t.file!==void 0&&n.push(t.file);let r;n.length===0?r=Os():n.length===1?r=n[0]:Object.keys(e).some(s=>s!=="$schema"&&s!=="title"&&s!=="description")?r=mt(n):r=Fe();for(const i of Xc)r=i.apply(r,e);return r}class As extends Event{constructor(t,n){var r,i;super(t),this.code=(r=n?.code)!=null?r:void 0,this.message=(i=n?.message)!=null?i:void 0}[Symbol.for("nodejs.util.inspect.custom")](t,n,r){return r(_s(this),n)}[Symbol.for("Deno.customInspect")](t,n){return t(_s(this),n)}}function Qc(e){const t=globalThis.DOMException;return typeof t=="function"?new t(e,"SyntaxError"):new SyntaxError(e)}function ni(e){return e instanceof Error?"errors"in e&&Array.isArray(e.errors)?e.errors.map(ni).join(", "):"cause"in e&&e.cause instanceof Error?`${e}: ${ni(e.cause)}`:e.message:`${e}`}function _s(e){return{type:e.type,message:e.message,code:e.code,defaultPrevented:e.defaultPrevented,cancelable:e.cancelable,timeStamp:e.timeStamp}}var aa=e=>{throw TypeError(e)},Fi=(e,t,n)=>t.has(e)||aa("Cannot "+n),G=(e,t,n)=>(Fi(e,t,"read from private field"),n?n.call(e):t.get(e)),Se=(e,t,n)=>t.has(e)?aa("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),he=(e,t,n,r)=>(Fi(e,t,"write to private field"),t.set(e,n),n),Qe=(e,t,n)=>(Fi(e,t,"access private method"),n),Ce,Et,kt,Qn,ur,wn,qt,xn,ct,Lt,Gt,Bt,mn,Re,ri,ii,si,Is,oi,ai,yn,li,ci;class er extends EventTarget{constructor(t,n){var r,i;super(),Se(this,Re),this.CONNECTING=0,this.OPEN=1,this.CLOSED=2,Se(this,Ce),Se(this,Et),Se(this,kt),Se(this,Qn),Se(this,ur),Se(this,wn),Se(this,qt),Se(this,xn,null),Se(this,ct),Se(this,Lt),Se(this,Gt,null),Se(this,Bt,null),Se(this,mn,null),Se(this,ii,async s=>{var o;G(this,Lt).reset();const{body:a,redirected:l,status:c,headers:u}=s;if(c===204){Qe(this,Re,yn).call(this,"Server sent HTTP 204, not reconnecting",204),this.close();return}if(l?he(this,kt,new URL(s.url)):he(this,kt,void 0),c!==200){Qe(this,Re,yn).call(this,`Non-200 status code (${c})`,c);return}if(!(u.get("content-type")||"").startsWith("text/event-stream")){Qe(this,Re,yn).call(this,'Invalid content type, expected "text/event-stream"',c);return}if(G(this,Ce)===this.CLOSED)return;he(this,Ce,this.OPEN);const f=new Event("open");if((o=G(this,mn))==null||o.call(this,f),this.dispatchEvent(f),typeof a!="object"||!a||!("getReader"in a)){Qe(this,Re,yn).call(this,"Invalid response body, expected a web ReadableStream",c),this.close();return}const h=new TextDecoder,m=a.getReader();let d=!0;do{const{done:p,value:y}=await m.read();y&&G(this,Lt).feed(h.decode(y,{stream:!p})),p&&(d=!1,G(this,Lt).reset(),Qe(this,Re,li).call(this))}while(d)}),Se(this,si,s=>{he(this,ct,void 0),!(s.name==="AbortError"||s.type==="aborted")&&Qe(this,Re,li).call(this,ni(s))}),Se(this,oi,s=>{typeof s.id=="string"&&he(this,xn,s.id);const o=new MessageEvent(s.event||"message",{data:s.data,origin:G(this,kt)?G(this,kt).origin:G(this,Et).origin,lastEventId:s.id||""});G(this,Bt)&&(!s.event||s.event==="message")&&G(this,Bt).call(this,o),this.dispatchEvent(o)}),Se(this,ai,s=>{he(this,wn,s)}),Se(this,ci,()=>{he(this,qt,void 0),G(this,Ce)===this.CONNECTING&&Qe(this,Re,ri).call(this)});try{if(t instanceof URL)he(this,Et,t);else if(typeof t=="string")he(this,Et,new URL(t,eu()));else throw new Error("Invalid URL")}catch{throw Qc("An invalid or illegal string was specified")}he(this,Lt,cc({onEvent:G(this,oi),onRetry:G(this,ai)})),he(this,Ce,this.CONNECTING),he(this,wn,3e3),he(this,ur,(r=n?.fetch)!=null?r:globalThis.fetch),he(this,Qn,(i=n?.withCredentials)!=null?i:!1),Qe(this,Re,ri).call(this)}get readyState(){return G(this,Ce)}get url(){return G(this,Et).href}get withCredentials(){return G(this,Qn)}get onerror(){return G(this,Gt)}set onerror(t){he(this,Gt,t)}get onmessage(){return G(this,Bt)}set onmessage(t){he(this,Bt,t)}get onopen(){return G(this,mn)}set onopen(t){he(this,mn,t)}addEventListener(t,n,r){const i=n;super.addEventListener(t,i,r)}removeEventListener(t,n,r){const i=n;super.removeEventListener(t,i,r)}close(){G(this,qt)&&clearTimeout(G(this,qt)),G(this,Ce)!==this.CLOSED&&(G(this,ct)&&G(this,ct).abort(),he(this,Ce,this.CLOSED),he(this,ct,void 0))}}Ce=new WeakMap,Et=new WeakMap,kt=new WeakMap,Qn=new WeakMap,ur=new WeakMap,wn=new WeakMap,qt=new WeakMap,xn=new WeakMap,ct=new WeakMap,Lt=new WeakMap,Gt=new WeakMap,Bt=new WeakMap,mn=new WeakMap,Re=new WeakSet,ri=function(){he(this,Ce,this.CONNECTING),he(this,ct,new AbortController),G(this,ur)(G(this,Et),Qe(this,Re,Is).call(this)).then(G(this,ii)).catch(G(this,si))},ii=new WeakMap,si=new WeakMap,Is=function(){var e;const t={mode:"cors",redirect:"follow",headers:{Accept:"text/event-stream",...G(this,xn)?{"Last-Event-ID":G(this,xn)}:void 0},cache:"no-store",signal:(e=G(this,ct))==null?void 0:e.signal};return"window"in globalThis&&(t.credentials=this.withCredentials?"include":"same-origin"),t},oi=new WeakMap,ai=new WeakMap,yn=function(e,t){var n;G(this,Ce)!==this.CLOSED&&he(this,Ce,this.CLOSED);const r=new As("error",{code:t,message:e});(n=G(this,Gt))==null||n.call(this,r),this.dispatchEvent(r)},li=function(e,t){var n;if(G(this,Ce)===this.CLOSED)return;he(this,Ce,this.CONNECTING);const r=new As("error",{code:t,message:e});(n=G(this,Gt))==null||n.call(this,r),this.dispatchEvent(r),he(this,qt,setTimeout(G(this,ci),G(this,wn)))},ci=new WeakMap,er.CONNECTING=0,er.OPEN=1,er.CLOSED=2;function eu(){const e="document"in globalThis?globalThis.document:void 0;return e&&typeof e=="object"&&"baseURI"in e&&typeof e.baseURI=="string"?e.baseURI:void 0}class tu extends Error{constructor(t,n,r){super(`SSE error: ${n}`),this.code=t,this.event=r}}class nu{constructor(t,n){this._url=t,this._resourceMetadataUrl=void 0,this._scope=void 0,this._eventSourceInit=n?.eventSourceInit,this._requestInit=n?.requestInit,this._authProvider=n?.authProvider,this._fetch=n?.fetch,this._fetchWithInit=uc(n?.fetch,n?.requestInit)}async _authThenStart(){if(!this._authProvider)throw new fn("No auth provider");let t;try{t=await Tr(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})}catch(n){throw this.onerror?.(n),n}if(t!=="AUTHORIZED")throw new fn;return await this._startOrAuth()}async _commonHeaders(){const t={};if(this._authProvider){const r=await this._authProvider.tokens();r&&(t.Authorization=`Bearer ${r.access_token}`)}this._protocolVersion&&(t["mcp-protocol-version"]=this._protocolVersion);const n=fc(this._requestInit?.headers);return new Headers({...t,...n})}_startOrAuth(){const t=this?._eventSourceInit?.fetch??this._fetch??fetch;return new Promise((n,r)=>{this._eventSource=new er(this._url.href,{...this._eventSourceInit,fetch:async(i,s)=>{const o=await this._commonHeaders();o.set("Accept","text/event-stream");const a=await t(i,{...s,headers:o});if(a.status===401&&a.headers.has("www-authenticate")){const{resourceMetadataUrl:l,scope:c}=xs(a);this._resourceMetadataUrl=l,this._scope=c}return a}}),this._abortController=new AbortController,this._eventSource.onerror=i=>{if(i.code===401&&this._authProvider){this._authThenStart().then(n,r);return}const s=new tu(i.code,i.message,i);r(s),this.onerror?.(s)},this._eventSource.onopen=()=>{},this._eventSource.addEventListener("endpoint",i=>{const s=i;try{if(this._endpoint=new URL(s.data,this._url),this._endpoint.origin!==this._url.origin)throw new Error(`Endpoint origin does not match connection origin: ${this._endpoint.origin}`)}catch(o){r(o),this.onerror?.(o),this.close();return}n()}),this._eventSource.onmessage=i=>{const s=i;let o;try{o=sa.parse(JSON.parse(s.data))}catch(a){this.onerror?.(a);return}this.onmessage?.(o)}})}async start(){if(this._eventSource)throw new Error("SSEClientTransport already started! If using Client class, note that connect() calls start() automatically.");return await this._startOrAuth()}async finishAuth(t){if(!this._authProvider)throw new fn("No auth provider");if(await Tr(this._authProvider,{serverUrl:this._url,authorizationCode:t,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new fn("Failed to authorize")}async close(){this._abortController?.abort(),this._eventSource?.close(),this.onclose?.()}async send(t){if(!this._endpoint)throw new Error("Not connected");try{const n=await this._commonHeaders();n.set("content-type","application/json");const r={...this._requestInit,method:"POST",headers:n,body:JSON.stringify(t),signal:this._abortController?.signal},i=await(this._fetch??fetch)(this._endpoint,r);if(!i.ok){const s=await i.text().catch(()=>null);if(i.status===401&&this._authProvider){const{resourceMetadataUrl:o,scope:a}=xs(i);if(this._resourceMetadataUrl=o,this._scope=a,await Tr(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new fn;return this.send(t)}throw new Error(`Error POSTing to endpoint (HTTP ${i.status}): ${s}`)}await i.body?.cancel()}catch(n){throw this.onerror?.(n),n}}setProtocolVersion(t){this._protocolVersion=t}}const ru="mcp";class iu{constructor(t){this._url=t}start(){if(this._socket)throw new Error("WebSocketClientTransport already started! If using Client class, note that connect() calls start() automatically.");return new Promise((t,n)=>{this._socket=new WebSocket(this._url,ru),this._socket.onerror=r=>{const i="error"in r?r.error:new Error(`WebSocket error: ${JSON.stringify(r)}`);n(i),this.onerror?.(i)},this._socket.onopen=()=>{t()},this._socket.onclose=()=>{this.onclose?.()},this._socket.onmessage=r=>{let i;try{i=sa.parse(JSON.parse(r.data))}catch(s){this.onerror?.(s);return}this.onmessage?.(i)}})}async close(){this._socket?.close()}send(t){return new Promise((n,r)=>{if(!this._socket){r(new Error("Not connected"));return}this._socket?.send(JSON.stringify(t)),n()})}}class su extends dc{constructor(t,n){super(t,n)}send(t,n){const r=ou(t);return r?.type==="emit"?(this.onmessage?.(r.message),Promise.resolve()):r?.type==="suppress"?Promise.resolve():super.send(t,n)}}function ou(e){const t=e;if(!t||typeof t!="object"||!("method"in t))return null;switch(t.method){case"initialize":{const n=t?.params?.protocolVersion;return n?{type:"emit",message:{result:{protocolVersion:n,capabilities:{tools:{}},serverInfo:{name:"deco-chat-server",version:"1.0.0"}},jsonrpc:t.jsonrpc??"2.0",id:t.id}}:null}case"notifications/roots/list_changed":case"notifications/initialized":case"notifications/cancelled":case"notifications/progress":return{type:"suppress"};default:return null}}class au extends hc{constructor(t,n){super(t,n)}async listTools(t,n){return await this.request({method:"tools/list",params:t},sc,n)}}const lu=async(e,t,n)=>{const r=cu(e.connection,t,n);if(!r)throw new Error("Unknown MCP connection type");const i=new au({name:e?.name??"MCP Client",version:"1.0.0"});return await i.connect(r),{client:i}},cu=(e,t,n)=>{if(e.type==="Websocket")return new iu(new URL(e.url));if(e.type!=="SSE"&&e.type!=="HTTP")return null;const i={...e.token?{authorization:`Bearer ${e.token}`}:{},...n??{},..."headers"in e?e.headers||{}:{}};if(e.type==="SSE"){const s={requestInit:{headers:i,signal:t}};return e.token&&(s.eventSourceInit={fetch:(o,a)=>fetch(o,{...a,headers:{...i,Accept:"text/event-stream"},signal:t})}),new nu(new URL(e.url),s)}return new su(new URL(e.url),{requestInit:{headers:i,signal:t,credentials:"include"}})},Cs=e=>{try{return JSON.parse(e)}catch{return e}},zn=new Map,Ts=(e,t)=>({...e,id:e.name,inputSchema:e.inputSchema?Ae(e.inputSchema):void 0,outputSchema:e.outputSchema?Ae(e.outputSchema):void 0,execute:n=>t(n.context,e.name)});function uu(e){const t=n=>"connection"in e?lu({connection:e.connection},void 0,n):e.client;return new Proxy({},{get(n,r){if(r==="toJSON")return null;if(typeof r!="string")throw new Error("Name must be a string");if(r==="listTools")return a;async function i(l,c=r){const u=e?.debugId?.(),f=u?{"x-trace-debug-id":u}:void 0,{client:h}=await t(f),{structuredContent:m,isError:d,content:p}=await h.callTool({name:String(c),arguments:l});if(d){const S=p?.[0]?.text,O=typeof S=="string"?Cs(S):null,E=O?.code&&typeof e?.getErrorByStatusCode=="function"?e.getErrorByStatusCode(O.code,O.message,O.traceId):null;throw E||new Error(`Tool ${String(c)} returned an error: ${JSON.stringify(m??p)}`)}if(m!==void 0)return m;const y=p?.[0]?.text;return typeof y=="string"?Cs(y):void 0}async function s(){const{client:l}=await t(),{tools:c}=await l.listTools();return c}async function o(){if(!("connection"in e))return s();const l=e.connection,c=JSON.stringify(l);try{return zn.has(c)||zn.set(c,s()),await zn.get(c)}catch(u){console.error("Failed to list tools",u),zn.delete(c);return}}async function a(){return(await o()??[]).map(c=>Ts(c,i))}return i.asTool=async()=>{const c=(await o()??[]).find(u=>u.name===r);if(!c)throw new Error(`Tool ${r} not found`);return Ts(c,i)},i}})}new Proxy({},{get(e,t){return t==="toJSON"?null:t==="forConnection"?n=>fu({connection:n}):global[t]}});function fu(e){return uu(e)}const du=_e({toolName:oe().describe("Name of the tool to invoke on that connection"),transformCode:oe().optional().describe("Pure TypeScript function for data transformation of the tool call result. Must be a TypeScript file that declares the Output interface and exports a default function: `interface Output { ... } export default async function(stepInput): Output { ... }`\n The stepInput will match with the tool call outputSchema. If transformCode is not provided, the tool call result will be used as the step output.\n Providing an transformCode is recommended because it both allows you to transform the data and validate it against a JSON Schema - tools are ephemeral and may return unexpected data.")}),hu=_e({code:oe().describe(`Pure TypeScript function for data transformation. Useful to merge data from multiple steps and transform it. Must be a TypeScript file that declares the Output interface and exports a default function: \`interface Output { ... } export default async function(stepInput): Output { ... }\`
2
2
  The stepInput is the resolved value of the references in the input field. Example:
3
3
  {
4
4
  "input": {