decocms 2.311.5 → 2.311.7

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 (255) hide show
  1. package/dist/client/assets/{AlertCircle-CjTfXQMH.js → AlertCircle-BJeD5C4R.js} +1 -1
  2. package/dist/client/assets/{Archive-CaJ5kGW4.js → Archive-YlLF-Utw.js} +1 -1
  3. package/dist/client/assets/{ArrowNarrowLeft-SJEHnXyc.js → ArrowNarrowLeft-Bxr_bNh3.js} +1 -1
  4. package/dist/client/assets/{ArrowUpRight-07AMyW3q.js → ArrowUpRight-BjngPScU.js} +1 -1
  5. package/dist/client/assets/{Check-CmnOcISu.js → Check-CCt4TdqV.js} +1 -1
  6. package/dist/client/assets/{CheckCircle-Lywb4tzc.js → CheckCircle-Bj4ArLnA.js} +1 -1
  7. package/dist/client/assets/{ChevronDown-B7nkAKvX.js → ChevronDown-Bj0_PlcH.js} +1 -1
  8. package/dist/client/assets/{ChevronRight-CFgoiwVv.js → ChevronRight-C4ssXj8j.js} +1 -1
  9. package/dist/client/assets/{ChevronUp-COT1DfaR.js → ChevronUp-BX6pOMeY.js} +1 -1
  10. package/dist/client/assets/{Container-D1pwjZQv.js → Container-DCeE5VzU.js} +1 -1
  11. package/dist/client/assets/{DotsVertical-CiKG-O-v.js → DotsVertical-dBwy2z8i.js} +1 -1
  12. package/dist/client/assets/{LinkExternal01-B5ftsff4.js → LinkExternal01-zCvf1EzU.js} +1 -1
  13. package/dist/client/assets/{Lock01-BRRKEYOm.js → Lock01-DiQ4vbxd.js} +1 -1
  14. package/dist/client/assets/{Palette-VwQOwYSo.js → Palette-C4IIjTNv.js} +1 -1
  15. package/dist/client/assets/{Play-DP3It0wz.js → Play-hz-Aap6I.js} +1 -1
  16. package/dist/client/assets/{Plus-BB2q_olj.js → Plus-CMSPc8qr.js} +1 -1
  17. package/dist/client/assets/{RefreshCcw01-cS3DHDDp.js → RefreshCcw01-mHpCJu3a.js} +1 -1
  18. package/dist/client/assets/{SearchMd-CrQCxOMr.js → SearchMd-DRJGWUxm.js} +1 -1
  19. package/dist/client/assets/{Settings02-DVf2OlMW.js → Settings02-zMTyQvfN.js} +1 -1
  20. package/dist/client/assets/{Shield01-B3ECj0f_.js → Shield01-CyagHvp0.js} +1 -1
  21. package/dist/client/assets/{Star01-4_ptKeQ0.js → Star01-CtyYcqs8.js} +1 -1
  22. package/dist/client/assets/{Sun-DmD9Q3PB.js → Sun-DyWU3dmA.js} +1 -1
  23. package/dist/client/assets/{Tool01-BMc0DiTH.js → Tool01-CXQadPQ0.js} +1 -1
  24. package/dist/client/assets/{Trash01-6VDjweik.js → Trash01-BIkNmKu1.js} +1 -1
  25. package/dist/client/assets/{User01-C8lenn3T.js → User01-DnkItw6o.js} +1 -1
  26. package/dist/client/assets/{Users03-CIbaYGvp.js → Users03-DvpIbtPT.js} +1 -1
  27. package/dist/client/assets/{X-DosXDblw.js → X-a6NKB5cR.js} +1 -1
  28. package/dist/client/assets/{XCircle-ClvYl5pR.js → XCircle-2YGJT4l8.js} +1 -1
  29. package/dist/client/assets/{XClose-CzeywUWk.js → XClose-BKyQhmnE.js} +1 -1
  30. package/dist/client/assets/{Zap-BIo7bCpk.js → Zap-Cv-p123E.js} +1 -1
  31. package/dist/client/assets/{ZapSquare-DBCGSeVa.js → ZapSquare-D206qQUt.js} +1 -1
  32. package/dist/client/assets/{accordion-DclhREAs.js → accordion-C7jtb5zG.js} +1 -1
  33. package/dist/client/assets/{agent-icon-CVuf051c.js → agent-icon-Byl44fjz.js} +1 -1
  34. package/dist/client/assets/{agents-list-DwVCJjeW.js → agents-list-DgD602gD.js} +1 -1
  35. package/dist/client/assets/ai-providers-DERjwW01.js +1 -0
  36. package/dist/client/assets/{alert-dialog-74AkvGEe.js → alert-dialog-D9PtfJxf.js} +1 -1
  37. package/dist/client/assets/{auth-catchall-bUIqYMGp.js → auth-catchall-C-sTCCTb.js} +1 -1
  38. package/dist/client/assets/{automation-list-row-BXPs3B4q.js → automation-list-row-BZwWkD3I.js} +1 -1
  39. package/dist/client/assets/{automations-DWwEIlG6.js → automations-BdT0XSk0.js} +1 -1
  40. package/dist/client/assets/{avatar-C8DSVjWY.js → avatar-CWZ0ixfS.js} +1 -1
  41. package/dist/client/assets/{badge-DHtX06_M.js → badge-CA0TtSK-.js} +1 -1
  42. package/dist/client/assets/{brand-context-tIAqpiX9.js → brand-context-gd6jn5E6.js} +1 -1
  43. package/dist/client/assets/{card-2PzQvDZe.js → card-2C8lyYM4.js} +1 -1
  44. package/dist/client/assets/{chat-context-BC1CXyf7.js → chat-context-mruWDWkr.js} +1 -1
  45. package/dist/client/assets/{checkbox-BhLpSvVG.js → checkbox-DW6m6j_q.js} +1 -1
  46. package/dist/client/assets/{collection-detail-8c2GHEb3.js → collection-detail-DYSi_23k.js} +1 -1
  47. package/dist/client/assets/{collection-display-button-DwDu2s8u.js → collection-display-button-DOvm0aV5.js} +1 -1
  48. package/dist/client/assets/{collection-search-BEFvuI7B.js → collection-search-Cljm_M2l.js} +1 -1
  49. package/dist/client/assets/{collection-search-CmQSMD5X.js → collection-search-H6nTPyyn.js} +1 -1
  50. package/dist/client/assets/{collection-table-wrapper-BS8qzlIv.js → collection-table-wrapper-DZe1V1aM.js} +1 -1
  51. package/dist/client/assets/{collection-tabs-DRcC41aH.js → collection-tabs-CErfHiTV.js} +1 -1
  52. package/dist/client/assets/{collections-CeyUXk8d.js → collections-DqQJv3EJ.js} +1 -1
  53. package/dist/client/assets/{command-BakvhlkN.js → command-CBLhLeAX.js} +1 -1
  54. package/dist/client/assets/{connection-card-DojP2_fI.js → connection-card-DP37rlHa.js} +1 -1
  55. package/dist/client/assets/{connection-detail-CLbkMPqD.js → connection-detail-DDGjj1IS.js} +1 -1
  56. package/dist/client/assets/{connection-form-helpers-DC0Nw-dt.js → connection-form-helpers-aO3CUs1Q.js} +1 -1
  57. package/dist/client/assets/{connections-CH2AWiB-.js → connections-DADCBg8H.js} +1 -1
  58. package/dist/client/assets/{constants-DN0vtCn3.js → constants-CWE1wq29.js} +1 -1
  59. package/dist/client/assets/{constants-BxcPdAxA.js → constants-RsPwfdJf.js} +1 -1
  60. package/dist/client/assets/{dialog-CSDOHRuZ.js → dialog-VeABQIqc.js} +1 -1
  61. package/dist/client/assets/{domain-settings-C7eJxKRE.js → domain-settings-2pYm6clh.js} +1 -1
  62. package/dist/client/assets/{drawer-i2HsSBna.js → drawer-D7OQ4h1T.js} +1 -1
  63. package/dist/client/assets/{dropdown-menu-CuTxWawv.js → dropdown-menu-CPdBBQUU.js} +1 -1
  64. package/dist/client/assets/{dynamic-plugin-layout-CAFdK5Xc.js → dynamic-plugin-layout-T8gyrVC2.js} +1 -1
  65. package/dist/client/assets/{empty-state-Pw6pEnBg.js → empty-state-CrERbkuT.js} +1 -1
  66. package/dist/client/assets/{empty-state-Bx9CGRh0.js → empty-state-S9xe6i3I.js} +1 -1
  67. package/dist/client/assets/{extract-connection-data-CTVdkIjk.js → extract-connection-data-BQeAhwrY.js} +1 -1
  68. package/dist/client/assets/{features-Cf1q1FgR.js → features-B2uK7w_y.js} +1 -1
  69. package/dist/client/assets/{form-CyoIgyt_.js → form-JLSGdp7n.js} +1 -1
  70. package/dist/client/assets/{general-EFmcuMkr.js → general-0Zopjnmp.js} +1 -1
  71. package/dist/client/assets/{index-Bo_Hzl5t.js → index-B35PIg0k.js} +1 -1
  72. package/dist/client/assets/{index-DQBpcchF.js → index-BgW8ua3s.js} +1 -1
  73. package/dist/client/assets/{index-DUpS8oet.js → index-Brtp4PAP.js} +1 -1
  74. package/dist/client/assets/{index-C4IrsGbo.js → index-BuvWAXu5.js} +1 -1
  75. package/dist/client/assets/{index-BbNr81kL.js → index-CWu36EWB.js} +1 -1
  76. package/dist/client/assets/{index-D_WrlK5r.js → index-Ca5_2L4b.js} +1 -1
  77. package/dist/client/assets/{index-quDf3VhH.js → index-CeWLRM93.js} +1 -1
  78. package/dist/client/assets/{index-nM5EBUdq.js → index-CesZkHwj.js} +1 -1
  79. package/dist/client/assets/{index-2dbmNgG2.js → index-Cyow5Z3q.js} +1 -1
  80. package/dist/client/assets/{index-BC8Qj8Ud.js → index-DAvXxT14.js} +1 -1
  81. package/dist/client/assets/{index-BPbpFSlG.js → index-DDErZWVi.js} +2 -2
  82. package/dist/client/assets/{index-CJpfncMG.js → index-DN6qRLqz.js} +3 -3
  83. package/dist/client/assets/{index-B4s1crzl.js → index-D_x_9ry-.js} +1 -1
  84. package/dist/client/assets/{index-CVT_xMzU.js → index-DdBKKPxs.js} +1 -1
  85. package/dist/client/assets/{index-CRIGn0SA.js → index-DqFd1_Ou.js} +1 -1
  86. package/dist/client/assets/{index-CxxsJumH.js → index-Njoumabj.js} +1 -1
  87. package/dist/client/assets/{infiniteQueryObserver-CXf2zWh1.js → infiniteQueryObserver-D8Dut25K.js} +1 -1
  88. package/dist/client/assets/{input-DHBDt0A0.js → input-mPr-_Wkz.js} +1 -1
  89. package/dist/client/assets/{integration-icon-BsCzD6pa.js → integration-icon-DBaPSUho.js} +1 -1
  90. package/dist/client/assets/{label-D08h5k1R.js → label-3-gb9Mfh.js} +1 -1
  91. package/dist/client/assets/{layout-B1PdCwnm.js → layout-CmzRa0Nb.js} +1 -1
  92. package/dist/client/assets/{lean-canvas-recruit-modal-BnmgWty8.js → lean-canvas-recruit-modal-D4edhHd5.js} +1 -1
  93. package/dist/client/assets/{login-tBteHrh1.js → login-C-z-KQJy.js} +1 -1
  94. package/dist/client/assets/{members-BTrVRWxW.js → members-BozGuU0c.js} +1 -1
  95. package/dist/client/assets/{monaco-editor-DZ5QI8uz.js → monaco-editor-BfP_aqvh.js} +1 -1
  96. package/dist/client/assets/{monitoring-stats-row-B44Z4xAF.js → monitoring-stats-row-B51dMYWy.js} +1 -1
  97. package/dist/client/assets/{oauth-callback-DQoc6xwl.js → oauth-callback-5HwVk_9m.js} +1 -1
  98. package/dist/client/assets/{oauth-callback-ai-provider-4TlgQtIM.js → oauth-callback-ai-provider-CDjlMLfh.js} +1 -1
  99. package/dist/client/assets/{onboarding-focuY_h9.js → onboarding-tjBqLdVl.js} +1 -1
  100. package/dist/client/assets/{org-layout-CeARFSnY.js → org-layout-BWkVASJj.js} +1 -1
  101. package/dist/client/assets/{org-plugin-layout-B6JCfLhZ.js → org-plugin-layout-DYx1Oog9.js} +1 -1
  102. package/dist/client/assets/{pair-DK8WArXa.js → pair-C0_kf-8-.js} +1 -1
  103. package/dist/client/assets/{plugin-empty-state-BRwCgISr.js → plugin-empty-state-BYzIjFjW.js} +1 -1
  104. package/dist/client/assets/{plugin-header-DPn1Avqw.js → plugin-header-BgQH62F3.js} +1 -1
  105. package/dist/client/assets/{plugin-layout-CXXOhn9o.js → plugin-layout-DZOAczkV.js} +1 -1
  106. package/dist/client/assets/{popover-HGsZ47vz.js → popover-DnPkEGaL.js} +1 -1
  107. package/dist/client/assets/{profile-Q4Mq5bka.js → profile-Bk3W3VFa.js} +1 -1
  108. package/dist/client/assets/{project-app-view-CfhY_w3a.js → project-app-view-Pr8DzxWg.js} +1 -1
  109. package/dist/client/assets/registry-JtQ5iqN-.js +2 -0
  110. package/dist/client/assets/{registry-layout-DAUnauvK.js → registry-layout-D1IqZv0l.js} +1 -1
  111. package/dist/client/assets/{required-auth-layout-D-wVBMo_.js → required-auth-layout-BXiLDjox.js} +1 -1
  112. package/dist/client/assets/{reset-password-C6Sgyd-m.js → reset-password-CXOrskA0.js} +1 -1
  113. package/dist/client/assets/{roles-lMb3kTlV.js → roles-DKeVL_Vk.js} +1 -1
  114. package/dist/client/assets/{scroll-area-PHdLgpTR.js → scroll-area-Bi0ICljU.js} +1 -1
  115. package/dist/client/assets/{search-input-DzbQ3jIA.js → search-input-Bv2SSEED.js} +1 -1
  116. package/dist/client/assets/{select-ThJxxmvQ.js → select-C0jYaD9l.js} +1 -1
  117. package/dist/client/assets/{select-model-DPEgFP5P.js → select-model-GxB6dprW.js} +1 -1
  118. package/dist/client/assets/{settings-layout-DWdCJ7T1.js → settings-layout-CMKqgYzn.js} +1 -1
  119. package/dist/client/assets/{settings-section-CE6DXKE_.js → settings-section-DtN4ZHic.js} +1 -1
  120. package/dist/client/assets/{shell-layout--0UwjzTK.js → shell-layout-tb5uFFJK.js} +1 -1
  121. package/dist/client/assets/{skeleton-BW69nAou.js → skeleton-DxQ-428k.js} +1 -1
  122. package/dist/client/assets/{sso-CLxH7gN_.js → sso-DBqJfU28.js} +1 -1
  123. package/dist/client/assets/{store-Dvy5qA8V.js → store-DWGyHob3.js} +1 -1
  124. package/dist/client/assets/store-registry-DRlN5Ein.js +2 -0
  125. package/dist/client/assets/{switch-2kbNkhgy.js → switch-BoKNT-B-.js} +1 -1
  126. package/dist/client/assets/{table-pY_1blbB.js → table-DUsaq02U.js} +1 -1
  127. package/dist/client/assets/{tabs-BHCoB9-B.js → tabs-De__eheK.js} +1 -1
  128. package/dist/client/assets/{task-status-CoiJkfnQ.js → task-status-C_r8wvmS.js} +1 -1
  129. package/dist/client/assets/{textarea-yE-qQiGr.js → textarea-C0unIP9X.js} +1 -1
  130. package/dist/client/assets/{toggle-group-CGlJJKpo.js → toggle-group-CjJ2xnFY.js} +1 -1
  131. package/dist/client/assets/{tools-list-kG_ujXbv.js → tools-list-CJJv21mu.js} +1 -1
  132. package/dist/client/assets/{tooltip-8EMcUk8q.js → tooltip-6l925dLT.js} +1 -1
  133. package/dist/client/assets/{types-0qNHrw5h.js → types-063PNzne.js} +1 -1
  134. package/dist/client/assets/{use-ai-providers-CJfgIRCZ.js → use-ai-providers-CXJtJ3gs.js} +1 -1
  135. package/dist/client/assets/{use-collections-bP--NcMC.js → use-collections-Clscqpr6.js} +1 -1
  136. package/dist/client/assets/{use-connection-Bszp6a5W.js → use-connection-BONz3omb.js} +1 -1
  137. package/dist/client/assets/{use-copy-CbGC0huz.js → use-copy-BMM4g8qh.js} +1 -1
  138. package/dist/client/assets/{use-create-virtual-mcp-CF9S4n1L.js → use-create-virtual-mcp-L41f6BHk.js} +1 -1
  139. package/dist/client/assets/{use-debounced-autosave-0DHMqbbb.js → use-debounced-autosave-B7SdViQU.js} +1 -1
  140. package/dist/client/assets/{use-decopilot-events-CJqb-CIN.js → use-decopilot-events-CURKUwZC.js} +1 -1
  141. package/dist/client/assets/{use-delete-connection-CFFQ-eJW.js → use-delete-connection-DRmN2AAk.js} +1 -1
  142. package/dist/client/assets/{use-infinite-scroll-D4oMTPVQ.js → use-infinite-scroll-CsVuEiLa.js} +1 -1
  143. package/dist/client/assets/{use-list-state-Dxu3SrCJ.js → use-list-state-Bsx4nOHW.js} +1 -1
  144. package/dist/client/assets/{use-mcp-tools-IbqZtDzy.js → use-mcp-tools-CGp3Yu6f.js} +1 -1
  145. package/dist/client/assets/{use-members-DWszFm6D.js → use-members-LUjEaikV.js} +1 -1
  146. package/dist/client/assets/{use-navigate-to-agent-DQOeSZSb.js → use-navigate-to-agent-Btl0kxvD.js} +1 -1
  147. package/dist/client/assets/{use-org-auth-client-BNkFwsu-.js → use-org-auth-client-Bdgc183j.js} +1 -1
  148. package/dist/client/assets/{use-org-sso-CqRALwPj.js → use-org-sso-ex6uAkHi.js} +1 -1
  149. package/dist/client/assets/{use-organization-roles-CZxWWJmd.js → use-organization-roles-DsrGcTs6.js} +1 -1
  150. package/dist/client/assets/{use-organization-settings-DF1zVgfV.js → use-organization-settings-DAE9VhMp.js} +1 -1
  151. package/dist/client/assets/{use-registry-connections-DDZ2kJae.js → use-registry-connections-BneTMB19.js} +1 -1
  152. package/dist/client/assets/{use-status-sounds-BeCVKlHT.js → use-status-sounds-C0CX0jN4.js} +1 -1
  153. package/dist/client/assets/{use-tasks-sf9lm6fu.js → use-tasks-C50wbCHs.js} +1 -1
  154. package/dist/client/assets/{use-view-mode-D3O388Wv.js → use-view-mode-Bnx_K3_C.js} +1 -1
  155. package/dist/client/assets/{use-virtual-mcp-CAY4xxsA.js → use-virtual-mcp-BlO6orHF.js} +1 -1
  156. package/dist/client/assets/useInfiniteQuery-C6j5jRkd.js +1 -0
  157. package/dist/client/assets/useSuspenseInfiniteQuery-Lk0XRceb.js +1 -0
  158. package/dist/client/assets/{user-Dt-2ZGGA.js → user-DUAXfww9.js} +1 -1
  159. package/dist/client/assets/{view-mode-toggle-B4e_lOZL.js → view-mode-toggle-DEaKPNk7.js} +1 -1
  160. package/dist/client/assets/{workflow-D0V_EvQ3.js → workflow-DHCLn9f-.js} +1 -1
  161. package/dist/client/assets/workflow-detail-DMKespmd.js +1 -0
  162. package/dist/client/index.html +1 -1
  163. package/dist/server/cli.js +17 -18
  164. package/dist/server/node_modules/ansi-regex/index.d.ts +33 -0
  165. package/dist/server/node_modules/ansi-regex/index.js +14 -0
  166. package/dist/server/node_modules/ansi-regex/package.json +61 -0
  167. package/dist/server/node_modules/ansi-regex/readme.md +66 -0
  168. package/dist/server/node_modules/emoji-regex/LICENSE-MIT.txt +20 -0
  169. package/dist/server/node_modules/emoji-regex/README.md +107 -0
  170. package/dist/server/node_modules/emoji-regex/index.d.ts +3 -0
  171. package/dist/server/node_modules/emoji-regex/index.js +4 -0
  172. package/dist/server/node_modules/emoji-regex/index.mjs +4 -0
  173. package/dist/server/node_modules/emoji-regex/package.json +45 -0
  174. package/dist/server/node_modules/onetime/index.d.ts +64 -0
  175. package/dist/server/node_modules/onetime/index.js +44 -0
  176. package/dist/server/node_modules/onetime/license +9 -0
  177. package/dist/server/node_modules/onetime/package.json +43 -0
  178. package/dist/server/node_modules/onetime/readme.md +94 -0
  179. package/dist/server/node_modules/pg-cloudflare/README.md +112 -0
  180. package/dist/server/node_modules/pg-cloudflare/dist/empty.d.ts +2 -0
  181. package/dist/server/node_modules/pg-cloudflare/dist/empty.js +6 -0
  182. package/dist/server/node_modules/pg-cloudflare/dist/empty.js.map +1 -0
  183. package/dist/server/node_modules/pg-cloudflare/dist/index.d.ts +31 -0
  184. package/dist/server/node_modules/pg-cloudflare/dist/index.js +152 -0
  185. package/dist/server/node_modules/pg-cloudflare/dist/index.js.map +1 -0
  186. package/dist/server/node_modules/pg-cloudflare/esm/index.mjs +3 -0
  187. package/dist/server/node_modules/pg-cloudflare/package.json +39 -0
  188. package/dist/server/node_modules/pg-cloudflare/src/empty.ts +3 -0
  189. package/dist/server/node_modules/pg-cloudflare/src/index.ts +166 -0
  190. package/dist/server/node_modules/pg-cloudflare/src/types.d.ts +25 -0
  191. package/dist/server/node_modules/pg-connection-string/LICENSE +21 -0
  192. package/dist/server/node_modules/pg-connection-string/README.md +105 -0
  193. package/dist/server/node_modules/pg-connection-string/esm/index.mjs +8 -0
  194. package/dist/server/node_modules/pg-connection-string/index.d.ts +36 -0
  195. package/dist/server/node_modules/pg-connection-string/index.js +231 -0
  196. package/dist/server/node_modules/pg-connection-string/package.json +52 -0
  197. package/dist/server/node_modules/pg-int8/LICENSE +13 -0
  198. package/dist/server/node_modules/pg-int8/README.md +16 -0
  199. package/dist/server/node_modules/pg-int8/index.js +100 -0
  200. package/dist/server/node_modules/pg-int8/package.json +24 -0
  201. package/dist/server/node_modules/postgres-bytea/index.js +33 -0
  202. package/dist/server/node_modules/postgres-bytea/license +21 -0
  203. package/dist/server/node_modules/postgres-bytea/package.json +34 -0
  204. package/dist/server/node_modules/postgres-bytea/readme.md +34 -0
  205. package/dist/server/node_modules/postgres-interval/index.d.ts +20 -0
  206. package/dist/server/node_modules/postgres-interval/index.js +125 -0
  207. package/dist/server/node_modules/postgres-interval/license +21 -0
  208. package/dist/server/node_modules/postgres-interval/package.json +36 -0
  209. package/dist/server/node_modules/postgres-interval/readme.md +48 -0
  210. package/dist/server/node_modules/string-width/index.d.ts +39 -0
  211. package/dist/server/node_modules/string-width/index.js +82 -0
  212. package/dist/server/node_modules/string-width/license +9 -0
  213. package/dist/server/node_modules/{figures → string-width}/package.json +27 -12
  214. package/dist/server/node_modules/string-width/readme.md +66 -0
  215. package/dist/server/node_modules/xtend/.jshintrc +30 -0
  216. package/dist/server/node_modules/xtend/LICENSE +20 -0
  217. package/dist/server/node_modules/xtend/README.md +32 -0
  218. package/dist/server/node_modules/xtend/immutable.js +19 -0
  219. package/dist/server/node_modules/xtend/mutable.js +17 -0
  220. package/dist/server/node_modules/xtend/package.json +55 -0
  221. package/dist/server/node_modules/xtend/test.js +103 -0
  222. package/dist/server/server.js +16 -17
  223. package/package.json +1 -1
  224. package/dist/client/assets/ai-providers-Dvj--FTM.js +0 -1
  225. package/dist/client/assets/registry-DZhiFceQ.js +0 -2
  226. package/dist/client/assets/store-registry-Ca7gEG02.js +0 -2
  227. package/dist/client/assets/useInfiniteQuery-DpFgBC5z.js +0 -1
  228. package/dist/client/assets/useSuspenseInfiniteQuery-B_gLWLYH.js +0 -1
  229. package/dist/client/assets/workflow-detail-tYYnfOHI.js +0 -1
  230. package/dist/server/node_modules/figures/index.d.ts +0 -279
  231. package/dist/server/node_modules/figures/index.js +0 -292
  232. package/dist/server/node_modules/figures/readme.md +0 -337
  233. package/dist/server/node_modules/pg/README.md +0 -95
  234. package/dist/server/node_modules/pg/esm/index.mjs +0 -20
  235. package/dist/server/node_modules/pg/lib/client.js +0 -743
  236. package/dist/server/node_modules/pg/lib/connection-parameters.js +0 -171
  237. package/dist/server/node_modules/pg/lib/connection.js +0 -221
  238. package/dist/server/node_modules/pg/lib/crypto/cert-signatures.js +0 -122
  239. package/dist/server/node_modules/pg/lib/crypto/sasl.js +0 -212
  240. package/dist/server/node_modules/pg/lib/crypto/utils-legacy.js +0 -43
  241. package/dist/server/node_modules/pg/lib/crypto/utils-webcrypto.js +0 -89
  242. package/dist/server/node_modules/pg/lib/crypto/utils.js +0 -9
  243. package/dist/server/node_modules/pg/lib/defaults.js +0 -91
  244. package/dist/server/node_modules/pg/lib/index.js +0 -73
  245. package/dist/server/node_modules/pg/lib/native/client.js +0 -323
  246. package/dist/server/node_modules/pg/lib/native/index.js +0 -2
  247. package/dist/server/node_modules/pg/lib/native/query.js +0 -165
  248. package/dist/server/node_modules/pg/lib/query.js +0 -252
  249. package/dist/server/node_modules/pg/lib/result.js +0 -109
  250. package/dist/server/node_modules/pg/lib/stream.js +0 -83
  251. package/dist/server/node_modules/pg/lib/type-overrides.js +0 -35
  252. package/dist/server/node_modules/pg/lib/utils.js +0 -217
  253. package/dist/server/node_modules/pg/package.json +0 -76
  254. /package/dist/server/node_modules/{figures → ansi-regex}/license +0 -0
  255. /package/dist/server/node_modules/{pg → pg-cloudflare}/LICENSE +0 -0
@@ -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-BPbpFSlG.js";import{P as x}from"./index-CVT_xMzU.js";import{e as I}from"./use-organization-settings-DF1zVgfV.js";import{S as Q}from"./switch-2kbNkhgy.js";import{n as R}from"./Container-D1pwjZQv.js";import{b as w,S as z,a as F,d as M}from"./settings-section-CE6DXKE_.js";import"./tooltip-8EMcUk8q.js";import"./X-DosXDblw.js";import"./constants-BxcPdAxA.js";import"./card-2PzQvDZe.js";import"./ArrowUpRight-07AMyW3q.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-DDErZWVi.js";import{P as x}from"./index-DdBKKPxs.js";import{e as I}from"./use-organization-settings-DAE9VhMp.js";import{S as Q}from"./switch-BoKNT-B-.js";import{n as R}from"./Container-DCeE5VzU.js";import{b as w,S as z,a as F,d as M}from"./settings-section-DtN4ZHic.js";import"./tooltip-6l925dLT.js";import"./X-a6NKB5cR.js";import"./constants-RsPwfdJf.js";import"./card-2C8lyYM4.js";import"./ArrowUpRight-BjngPScU.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-BPbpFSlG.js";import{L as N}from"./label-D08h5k1R.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-DDErZWVi.js";import{L as N}from"./label-3-gb9Mfh.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 ae,s as re,o as ce,z as fe,C as xe,a as de,t as W,x as M,K as Y,j as s,D as se,H as pe,J as X,e as F,r as K,B as H,c as he,M as je,R as ne}from"./index-BPbpFSlG.js";import{P as U}from"./index-CVT_xMzU.js";import{u as ve}from"./use-org-auth-client-BNkFwsu-.js";import{u as be}from"./use-debounced-autosave-0DHMqbbb.js";import{A as ye}from"./avatar-C8DSVjWY.js";import{I as me}from"./input-DHBDt0A0.js";import{S as Z,a as J,b as Q,c as Se,d as Ce}from"./settings-section-CE6DXKE_.js";import{D as Ne}from"./domain-settings-C7eJxKRE.js";import{u as _e,a as oe,D as De,c as ze,S as Ae,v as we,K as Pe,P as Oe,d as Ee,C as Ie,s as ke,b as Te,e as Fe}from"./collection-search-BEFvuI7B.js";import{W as te,i as Le,S as Re,u as $e}from"./constants-BxcPdAxA.js";import{b as ue}from"./use-virtual-mcp-CAY4xxsA.js";import{b as Me,P as Ke,a as qe}from"./popover-HGsZ47vz.js";import{S as Be}from"./skeleton-BW69nAou.js";import{y as He}from"./agent-icon-CVuf051c.js";import{s as Ve}from"./Plus-BB2q_olj.js";import{a as ge}from"./Users03-CIbaYGvp.js";import{i as Ge}from"./X-DosXDblw.js";import{I as ee}from"./integration-icon-BsCzD6pa.js";import{a as Ue,d as Qe}from"./use-organization-settings-DF1zVgfV.js";import{c as We,b as Ye,d as Ze,f as Je,e as Xe,g as et,a as tt,A as st}from"./alert-dialog-74AkvGEe.js";import"./tooltip-8EMcUk8q.js";import"./User01-C8lenn3T.js";import"./card-2PzQvDZe.js";import"./ArrowUpRight-07AMyW3q.js";import"./unwrap-tool-result-BYXdCQMg.js";import"./switch-2kbNkhgy.js";import"./SearchMd-CrQCxOMr.js";import"./use-collections-bP--NcMC.js";import"./AlertCircle-CjTfXQMH.js";import"./Tool01-BMc0DiTH.js";import"./Archive-CaJ5kGW4.js";import"./XClose-CzeywUWk.js";import"./RefreshCcw01-cS3DHDDp.js";import"./ArrowNarrowLeft-SJEHnXyc.js";import"./XCircle-ClvYl5pR.js";import"./ZapSquare-DBCGSeVa.js";import"./CheckCircle-Lywb4tzc.js";import"./Check-CmnOcISu.js";import"./ChevronDown-B7nkAKvX.js";import"./ChevronRight-CFgoiwVv.js";import"./ChevronUp-COT1DfaR.js";import"./DotsVertical-CiKG-O-v.js";import"./Container-D1pwjZQv.js";import"./Star01-4_ptKeQ0.js";import"./Palette-VwQOwYSo.js";import"./LinkExternal01-B5ftsff4.js";import"./Lock01-BRRKEYOm.js";import"./Sun-DmD9Q3PB.js";import"./Play-DP3It0wz.js";import"./Settings02-DVf2OlMW.js";import"./Shield01-B3ECj0f_.js";import"./Trash01-6VDjweik.js";import"./Zap-BIo7bCpk.js";const nt=pe({name:X().min(1,"Name is required").max(255,"Name is too long"),slug:X().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:X().optional()});function ot(t){const e=F.c(13),{value:r,onChange:l,name:a,disabled:u}=t,n=K.useRef(null);let S;e[0]===Symbol.for("react.memo_cache_sentinel")?(S=()=>n.current?.click(),e[0]=S):S=e[0];const g=S;let C;e[1]!==l?(C=P=>{const p=P.target.files?.[0];if(!p)return;if(p.size>2097152){M.error("Image must be smaller than 2MB");return}const h=new FileReader;h.onerror=it,h.onloadend=()=>{h.result&&l(h.result),n.current&&(n.current.value="")},h.readAsDataURL(p)},e[1]=l,e[2]=C):C=e[2];const o=C;let i;e[3]!==u||e[4]!==o?(i=s.jsx("input",{ref:n,type:"file",accept:"image/*",onChange:o,className:"hidden",disabled:u}),e[3]=u,e[4]=o,e[5]=i):i=e[5];const d=r||void 0,m=a??"?";let f;e[6]!==d||e[7]!==m?(f=s.jsx(ye,{url:d,fallback:m,shape:"square",size:"base"}),e[6]=d,e[7]=m,e[8]=f):f=e[8];let x;return e[9]!==u||e[10]!==i||e[11]!==f?(x=s.jsxs("button",{type:"button",onClick:g,disabled:u,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]=u,e[10]=i,e[11]=f,e[12]=x):x=e[12],x}function it(){return M.error("Failed to read image")}function lt(){const t=ae(),{org:e}=re(),r=ve(),l=ce(),a=fe({resolver:xe(nt),values:{name:e.name??"",slug:e.slug??"",logo:e.logo??""}}),u=de({mutationFn:async o=>{const i={name:o.name,slug:o.slug};o.logo&&(i.logo=o.logo);const d=await r.organization.update({data:i});if(d?.error)throw new Error(d.error.message||"Failed to update organization");return d},onSuccess:(o,i)=>{W("organization_settings_updated",{organization_id:e.id,fields:Object.keys(i)}),l.invalidateQueries({queryKey:Y.organizations()}),l.invalidateQueries({queryKey:Y.activeOrganization(e.slug)}),M.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)=>{W("organization_settings_update_failed",{organization_id:e.id,fields:Object.keys(i),error:o instanceof Error?o.message:String(o)}),M.error(o instanceof Error?o.message:"Failed to update organization")}}),{schedule:n,flush:S}=be({save:async()=>{const o=a.control._formState.dirtyFields;if(Object.keys(o).length===0||!await a.trigger())return;const d=a.getValues(),m=a.control._defaultValues;a.reset(d,{keepValues:!0});try{await u.mutateAsync(d)}catch{a.reset(m,{keepValues:!0})}}}),g=a.formState.errors,C=typeof window<"u"?`${window.location.host}/`:"";return s.jsx(Z,{children:s.jsxs(J,{children:[s.jsx(Q,{title:"Logo",description:"Recommended size is 256x256px",action:s.jsx(ot,{value:a.watch("logo"),onChange:o=>{a.setValue("logo",o??"",{shouldDirty:!0}),S()},name:a.watch("name")})}),s.jsx(Q,{title:"Name",action:s.jsx(se,{control:a.control,name:"name",render:({field:o})=>s.jsx(me,{id:"org-name",...o,onChange:i=>{o.onChange(i),n()},onBlur:()=>{o.onBlur(),S()},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:[C&&s.jsx("span",{className:"pl-3 text-sm text-muted-foreground select-none",children:C}),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 d=i.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"");a.setValue("slug",d,{shouldDirty:!0,shouldTouch:!0,shouldValidate:!0}),n()},onBlur:()=>{o.onBlur(),S()}})})]})}),(g.name||g.slug||g.logo)&&s.jsxs("div",{className:"px-5 pb-3 flex flex-col gap-1",children:[g.name&&s.jsx("p",{className:"text-xs text-destructive",children:g.name.message}),g.slug&&s.jsx("p",{className:"text-xs text-destructive",children:g.slug.message}),g.logo&&s.jsx("p",{className:"text-xs text-destructive",children:g.logo.message})]})]})})}const ie=["site-editor","site-diagnostics","ai-image","ai-research"],le=8;function at(t,e,r){const l=e.find(u=>u.id===t);if(l)return{id:l.id,title:l.title,icon:l.icon,kind:"template"};const a=r.find(u=>u.id===t);return a?{id:t,title:a.title,icon:a.icon??null,kind:"custom"}:{id:t,title:t,icon:null,kind:"missing"}}function rt(t){const e=F.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:u,listeners:n,setNodeRef:S,transform:g,transition:C,isDragging:o}=Ee(a);let i;e[2]!==g?(i=Ie.Transform.toString(g),e[2]=g,e[3]=i):i=e[3];const d=o?.5:void 0,m=o?100:void 0;let f;e[4]!==i||e[5]!==d||e[6]!==m||e[7]!==C?(f={transform:i,transition:C,opacity:d,zIndex:m},e[4]=i,e[5]=d,e[6]=m,e[7]=C,e[8]=f):f=e[8];const x=f,P=o&&"shadow-lg";let p;e[9]!==P?(p=he("flex items-center gap-3 px-3 py-2 rounded-lg border border-border bg-background",P),e[9]=P,e[10]=p):p=e[10];const h=`Drag to reorder ${r.title}`;let z;e[11]===Symbol.for("react.memo_cache_sentinel")?(z=s.jsx(He,{size:14}),e[11]=z):z=e[11];let E;e[12]!==u||e[13]!==n||e[14]!==h?(E=s.jsx("button",{type:"button",...u,...n,className:"text-muted-foreground hover:text-foreground cursor-grab active:cursor-grabbing","aria-label":h,children:z}),e[12]=u,e[13]=n,e[14]=h,e[15]=E):E=e[15];let v;e[16]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(ge,{size:14}),e[16]=v):v=e[16];let N;e[17]!==r.icon||e[18]!==r.title?(N=s.jsx(ee,{icon:r.icon,name:r.title,size:"xs",fallbackIcon:v}),e[17]=r.icon,e[18]=r.title,e[19]=N):N=e[19];let b;e[20]!==r.title?(b=s.jsx("span",{className:"text-sm text-foreground truncate",children:r.title}),e[20]=r.title,e[21]=b):b=e[21];const _=r.kind==="template"?"Template":r.kind==="custom"?"Custom agent":"Unavailable";let j;e[22]!==_?(j=s.jsx("span",{className:"text-xs text-muted-foreground",children:_}),e[22]=_,e[23]=j):j=e[23];let D;e[24]!==b||e[25]!==j?(D=s.jsxs("div",{className:"flex flex-col min-w-0 flex-1",children:[b,j]}),e[24]=b,e[25]=j,e[26]=D):D=e[26];const w=`Remove ${r.title}`;let A;e[27]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx(Ge,{size:14}),e[27]=A):A=e[27];let y;e[28]!==l||e[29]!==w?(y=s.jsx("button",{type:"button",onClick:l,className:"text-muted-foreground hover:text-foreground p-1 rounded","aria-label":w,children:A}),e[28]=l,e[29]=w,e[30]=y):y=e[30];let O;return e[31]!==S||e[32]!==x||e[33]!==E||e[34]!==N||e[35]!==D||e[36]!==y||e[37]!==p?(O=s.jsxs("div",{ref:S,style:x,className:p,children:[E,N,D,y]}),e[31]=S,e[32]=x,e[33]=E,e[34]=N,e[35]=D,e[36]=y,e[37]=p,e[38]=O):O=e[38],O}function ct(t){const e=F.c(48),{selectedIds:r,onAdd:l}=t,[a,u]=K.useState(!1),[n,S]=K.useState(""),g=ue();let C;e[0]!==r?(C=new Set(r),e[0]=r,e[1]=C):C=e[1];const o=C;let i,d,m,f,x,P,p,h,z,E,v,N,b;if(e[2]!==g||e[3]!==l||e[4]!==a||e[5]!==n||e[6]!==o){const A=n.toLowerCase();f=te.filter(c=>!o.has(c.id)&&(!n||c.title.toLowerCase().includes(A)));let y;e[20]!==o?(y=c=>c.id!==null&&!Le(c.id)&&!o.has(c.id),e[20]=o,e[21]=y):y=e[21],m=g.filter(y).filter(c=>!n||c.title.toLowerCase().includes(A));let O;e[22]!==l?(O=c=>{l(c),u(!1),S("")},e[22]=l,e[23]=O):O=e[23];const I=O;d=Me,N=a,b=u,e[24]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(Ke,{asChild:!0,children:s.jsxs(H,{type:"button",variant:"outline",size:"sm",children:[s.jsx(Ve,{size:14}),"Add agent"]})}),e[24]=x):x=e[24],i=qe,z="w-[320px] p-0 overflow-hidden",E="start",e[25]!==n?(v=s.jsx(Fe,{value:n,onChange:S,placeholder:"Search agents..."}),e[25]=n,e[26]=v):v=e[26],P="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:()=>I(c.id),className:"flex items-center gap-2 px-2 py-1.5 rounded-md hover:bg-accent text-left",children:[s.jsx(ee,{icon:c.icon,name:c.title,size:"xs"}),s.jsx("span",{className:"text-sm truncate",children:c.title})]},c.id))]}),h=m.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"}),m.map(c=>s.jsxs("button",{type:"button",onClick:()=>I(c.id),className:"flex items-center gap-2 px-2 py-1.5 rounded-md hover:bg-accent text-left",children:[s.jsx(ee,{icon:c.icon,name:c.title,size:"xs",fallbackIcon:s.jsx(ge,{size:14})}),s.jsx("span",{className:"text-sm truncate",children:c.title})]},c.id))]}),e[2]=g,e[3]=l,e[4]=a,e[5]=n,e[6]=o,e[7]=i,e[8]=d,e[9]=m,e[10]=f,e[11]=x,e[12]=P,e[13]=p,e[14]=h,e[15]=z,e[16]=E,e[17]=v,e[18]=N,e[19]=b}else i=e[7],d=e[8],m=e[9],f=e[10],x=e[11],P=e[12],p=e[13],h=e[14],z=e[15],E=e[16],v=e[17],N=e[18],b=e[19];let _;e[27]!==m||e[28]!==f.length||e[29]!==n?(_=f.length===0&&m.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]=m,e[28]=f.length,e[29]=n,e[30]=_):_=e[30];let j;e[31]!==_||e[32]!==P||e[33]!==p||e[34]!==h?(j=s.jsxs("div",{className:P,children:[p,h,_]}),e[31]=_,e[32]=P,e[33]=p,e[34]=h,e[35]=j):j=e[35];let D;e[36]!==i||e[37]!==j||e[38]!==z||e[39]!==E||e[40]!==v?(D=s.jsxs(i,{className:z,align:E,children:[v,j]}),e[36]=i,e[37]=j,e[38]=z,e[39]=E,e[40]=v,e[41]=D):D=e[41];let w;return e[42]!==d||e[43]!==x||e[44]!==D||e[45]!==N||e[46]!==b?(w=s.jsxs(d,{open:N,onOpenChange:b,children:[x,D]}),e[42]=d,e[43]=x,e[44]=D,e[45]=N,e[46]=b,e[47]=w):w=e[47],w}function dt(){const t=F.c(61),e=Ue(),r=ue(),l=Qe();let a;t[0]!==e?.ids?(a=e?.ids??[...ie],t[0]=e?.ids,t[1]=a):a=t[1];const u=a,[n,S]=K.useState(u);let g;t[2]!==n||t[3]!==u?(g=n.length!==u.length||n.some((k,T)=>k!==u[T]),t[2]=n,t[3]=u,t[4]=g):g=t[4];const C=g;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:ke},t[6]=i):i=t[6];const d=_e(oe(Oe,o),oe(Pe,i));let m;t[7]!==n?(m=k=>{const{active:T,over:R}=k;if(!R||T.id===R.id)return;const $=n.indexOf(T.id),G=n.indexOf(R.id);$===-1||G===-1||S(Te([...n],$,G))},t[7]=n,t[8]=m):m=t[8];const f=m;let x;t[9]!==n?(x=k=>{n.includes(k)||S([...n,k])},t[9]=n,t[10]=x):x=t[10];const P=x;let p;t[11]!==n?(p=k=>{S(n.filter(T=>T!==k))},t[11]=n,t[12]=p):p=t[12];const h=p;let z;t[13]===Symbol.for("react.memo_cache_sentinel")?(z=()=>{S([...ie])},t[13]=z):z=t[13];const E=z;let v;t[14]!==n||t[15]!==l?(v=()=>{l.mutate({ids:n},{onSuccess:()=>{W("default_home_agents_updated",{count:n.length,template_count:n.filter(ut).length}),M.success("Default home agents updated")},onError:mt})},t[14]=n,t[15]=l,t[16]=v):v=t[16];const N=v;let b,_,j,D,w,A,y;if(t[17]!==r||t[18]!==n||t[19]!==f||t[20]!==h||t[21]!==d||t[22]!==l.isPending){let k;t[30]!==r?(k=$=>at($,te,r),t[30]=r,t[31]=k):k=t[31];const T=n.map(k);j=Math.max(0,n.length-le),_=Z,w="Default home agents";let R;t[32]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsx(je,{size:14}),t[32]=R):R=t[32],t[33]!==l.isPending?(A=s.jsxs(H,{type:"button",variant:"ghost",size:"sm",onClick:E,disabled:l.isPending,children:[R,"Reset defaults"]}),t[33]=l.isPending,t[34]=A):A=t[34],b=J,y="px-5 py-5 flex flex-col gap-3",D=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(De,{sensors:d,collisionDetection:ze,onDragEnd:f,children:s.jsx(Ae,{items:n,strategy:we,children:s.jsx("div",{className:"flex flex-col gap-1.5",children:T.map(($,G)=>s.jsxs("div",{className:"flex flex-col gap-1.5",children:[G===le&&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(rt,{agent:$,onRemove:()=>h($.id)})]},$.id))})})}),t[17]=r,t[18]=n,t[19]=f,t[20]=h,t[21]=d,t[22]=l.isPending,t[23]=b,t[24]=_,t[25]=j,t[26]=D,t[27]=w,t[28]=A,t[29]=y}else b=t[23],_=t[24],j=t[25],D=t[26],w=t[27],A=t[28],y=t[29];let O;t[35]!==n||t[36]!==P?(O=s.jsx(ct,{selectedIds:n,onAdd:P}),t[35]=n,t[36]=P,t[37]=O):O=t[37];let I;t[38]!==j?(I=j>0&&s.jsxs("span",{className:"text-xs text-muted-foreground",children:[j," agent",j===1?"":"s"," won't fit on the home view"]}),t[38]=j,t[39]=I):I=t[39];let c;t[40]!==O||t[41]!==I?(c=s.jsxs("div",{className:"flex items-center justify-between",children:[O,I]}),t[40]=O,t[41]=I,t[42]=c):c=t[42];let L;t[43]!==D||t[44]!==c||t[45]!==y?(L=s.jsxs("div",{className:y,children:[D,c]}),t[43]=D,t[44]=c,t[45]=y,t[46]=L):L=t[46];let q;t[47]!==N||t[48]!==u||t[49]!==C||t[50]!==l.isPending?(q=C&&s.jsxs(Se,{children:[s.jsx(H,{type:"button",variant:"outline",onClick:()=>S(u),disabled:l.isPending,children:"Cancel"}),s.jsx(H,{type:"button",onClick:N,disabled:l.isPending,children:l.isPending?"Saving…":"Save"})]}),t[47]=N,t[48]=u,t[49]=C,t[50]=l.isPending,t[51]=q):q=t[51];let B;t[52]!==b||t[53]!==L||t[54]!==q?(B=s.jsxs(b,{children:[L,q]}),t[52]=b,t[53]=L,t[54]=q,t[55]=B):B=t[55];let V;return t[56]!==_||t[57]!==w||t[58]!==A||t[59]!==B?(V=s.jsx(_,{title:w,actions:A,children:B}),t[56]=_,t[57]=w,t[58]=A,t[59]=B,t[60]=V):V=t[60],V}function mt(t){M.error(t instanceof Error?t.message:"Failed to update default home agents")}function ut(t){return te.some(e=>e.id===t)}function gt(){const t=F.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Z,{title:"Default home agents",children:s.jsx(J,{children:s.jsx("div",{className:"px-5 py-5 flex flex-col gap-2",children:Array.from({length:4}).map(ft)})})}),t[0]=e):e=t[0],e}function ft(t,e){return s.jsx(Be,{className:"h-12 w-full rounded-lg"},e)}function xt(){const t=F.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(K.Suspense,{fallback:s.jsx(gt,{}),children:s.jsx(dt,{})}),t[0]=e):e=t[0],e}function pt(){const t=F.c(47),{org:e}=re(),r=ae(),l=ce(),[a,u]=K.useState(!1),[n,S]=K.useState("");let g;t[0]!==e.id||t[1]!==e.slug?(g={connectionId:Re,orgSlug:e.slug,orgId:e.id},t[0]=e.id,t[1]=e.slug,t[2]=g):g=t[2];const C=$e(g);let o;t[3]!==e.id||t[4]!==C?(o=async()=>{const I=await C.callTool({name:"ORGANIZATION_DELETE",arguments:{id:e.id}});if(I.isError){const c=I.content,L=Array.isArray(c)&&c[0]?.type==="text"&&typeof c[0].text=="string"?c[0].text:"Failed to delete organization";throw new Error(L)}},t[3]=e.id,t[4]=C,t[5]=o):o=t[5];let i;t[6]!==r||t[7]!==e.id||t[8]!==e.slug||t[9]!==l?(i=()=>{W("organization_deleted",{organization_id:e.id}),localStorage.getItem(ne.lastOrgSlug())===e.slug&&localStorage.removeItem(ne.lastOrgSlug()),l.removeQueries({queryKey:Y.activeOrganization(e.slug)}),l.invalidateQueries({queryKey:Y.organizations()}),M.success("Organization deleted"),r({to:"/"})},t[6]=r,t[7]=e.id,t[8]=e.slug,t[9]=l,t[10]=i):i=t[10];let d;t[11]!==o||t[12]!==i?(d={mutationFn:o,onSuccess:i,onError:ht},t[11]=o,t[12]=i,t[13]=d):d=t[13];const m=de(d);let f;t[14]===Symbol.for("react.memo_cache_sentinel")?(f=()=>u(!0),t[14]=f):f=t[14];let x;t[15]!==m.isPending?(x=s.jsx(Z,{title:"Danger Zone",description:"Irreversible actions that affect your entire organization.",children:s.jsx(J,{className:"border-destructive/40",children:s.jsx(Q,{title:"Delete organization",description:"Permanently delete this organization and all of its data. This action cannot be undone.",action:s.jsx(H,{variant:"destructive",size:"sm",onClick:f,disabled:m.isPending,children:"Delete"})})})}),t[15]=m.isPending,t[16]=x):x=t[16];let P;t[17]===Symbol.for("react.memo_cache_sentinel")?(P=I=>{u(I),I||S("")},t[17]=P):P=t[17];let p;t[18]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(We,{children:"Delete Organization?"}),t[18]=p):p=t[18];let h;t[19]!==e.name?(h=s.jsxs("p",{children:["This will permanently delete all data associated with"," ",s.jsx("span",{className:"font-medium text-foreground",children:e.name}),". This action cannot be undone."]}),t[19]=e.name,t[20]=h):h=t[20];let z;t[21]!==e.name?(z=s.jsxs("p",{className:"mt-3 mb-1.5",children:["Type"," ",s.jsx("span",{className:"font-medium text-foreground",children:e.name})," ","to confirm:"]}),t[21]=e.name,t[22]=z):z=t[22];let E;t[23]===Symbol.for("react.memo_cache_sentinel")?(E=I=>S(I.target.value),t[23]=E):E=t[23];let v;t[24]!==n||t[25]!==e.name?(v=s.jsx(me,{value:n,onChange:E,placeholder:e.name,autoFocus:!0}),t[24]=n,t[25]=e.name,t[26]=v):v=t[26];let N;t[27]!==v||t[28]!==h||t[29]!==z?(N=s.jsxs(Ye,{children:[p,s.jsx(Ze,{asChild:!0,children:s.jsxs("div",{children:[h,z,v]})})]}),t[27]=v,t[28]=h,t[29]=z,t[30]=N):N=t[30];let b;t[31]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(Je,{children:"Cancel"}),t[31]=b):b=t[31];let _;t[32]!==m?(_=()=>m.mutate(),t[32]=m,t[33]=_):_=t[33];const j=n!==e.name||m.isPending,D=m.isPending?"Deleting…":"Delete organization";let w;t[34]!==_||t[35]!==j||t[36]!==D?(w=s.jsxs(Xe,{children:[b,s.jsx(et,{onClick:_,disabled:j,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90 disabled:opacity-50",children:D})]}),t[34]=_,t[35]=j,t[36]=D,t[37]=w):w=t[37];let A;t[38]!==N||t[39]!==w?(A=s.jsxs(tt,{children:[N,w]}),t[38]=N,t[39]=w,t[40]=A):A=t[40];let y;t[41]!==a||t[42]!==A?(y=s.jsx(st,{open:a,onOpenChange:P,children:A}),t[41]=a,t[42]=A,t[43]=y):y=t[43];let O;return t[44]!==y||t[45]!==x?(O=s.jsxs(s.Fragment,{children:[x,y]}),t[44]=y,t[45]=x,t[46]=O):O=t[46],O}function ht(t){M.error(t instanceof Error?t.message:"Failed to delete organization")}function jt(){const t=F.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(U,{children:s.jsx(U.Content,{children:s.jsx(U.Body,{children:s.jsxs(Ce,{children:[s.jsx(U.Title,{children:"Organization"}),s.jsx(lt,{}),s.jsx(Ne,{}),s.jsx(xt,{}),s.jsx(pt,{})]})})})}),t[0]=e):e=t[0],e}function js(){const t=F.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(jt,{}),t[0]=e):e=t[0],e}export{js as default};
1
+ import{f as ae,s as re,o as ce,z as fe,C as xe,a as de,t as W,x as M,K as Y,j as s,D as se,H as pe,J as X,e as F,r as K,B as H,c as he,M as je,R as ne}from"./index-DDErZWVi.js";import{P as U}from"./index-DdBKKPxs.js";import{u as ve}from"./use-org-auth-client-Bdgc183j.js";import{u as be}from"./use-debounced-autosave-B7SdViQU.js";import{A as ye}from"./avatar-CWZ0ixfS.js";import{I as me}from"./input-mPr-_Wkz.js";import{S as Z,a as J,b as Q,c as Se,d as Ce}from"./settings-section-DtN4ZHic.js";import{D as Ne}from"./domain-settings-2pYm6clh.js";import{u as _e,a as oe,D as De,c as ze,S as Ae,v as we,K as Pe,P as Oe,d as Ee,C as Ie,s as ke,b as Te,e as Fe}from"./collection-search-Cljm_M2l.js";import{W as te,i as Le,S as Re,u as $e}from"./constants-RsPwfdJf.js";import{b as ue}from"./use-virtual-mcp-BlO6orHF.js";import{b as Me,P as Ke,a as qe}from"./popover-DnPkEGaL.js";import{S as Be}from"./skeleton-DxQ-428k.js";import{y as He}from"./agent-icon-Byl44fjz.js";import{s as Ve}from"./Plus-CMSPc8qr.js";import{a as ge}from"./Users03-DvpIbtPT.js";import{i as Ge}from"./X-a6NKB5cR.js";import{I as ee}from"./integration-icon-DBaPSUho.js";import{a as Ue,d as Qe}from"./use-organization-settings-DAE9VhMp.js";import{c as We,b as Ye,d as Ze,f as Je,e as Xe,g as et,a as tt,A as st}from"./alert-dialog-D9PtfJxf.js";import"./tooltip-6l925dLT.js";import"./User01-DnkItw6o.js";import"./card-2C8lyYM4.js";import"./ArrowUpRight-BjngPScU.js";import"./unwrap-tool-result-BYXdCQMg.js";import"./switch-BoKNT-B-.js";import"./SearchMd-DRJGWUxm.js";import"./use-collections-Clscqpr6.js";import"./AlertCircle-BJeD5C4R.js";import"./Tool01-CXQadPQ0.js";import"./Archive-YlLF-Utw.js";import"./XClose-BKyQhmnE.js";import"./RefreshCcw01-mHpCJu3a.js";import"./ArrowNarrowLeft-Bxr_bNh3.js";import"./XCircle-2YGJT4l8.js";import"./ZapSquare-D206qQUt.js";import"./CheckCircle-Bj4ArLnA.js";import"./Check-CCt4TdqV.js";import"./ChevronDown-Bj0_PlcH.js";import"./ChevronRight-C4ssXj8j.js";import"./ChevronUp-BX6pOMeY.js";import"./DotsVertical-dBwy2z8i.js";import"./Container-DCeE5VzU.js";import"./Star01-CtyYcqs8.js";import"./Palette-C4IIjTNv.js";import"./LinkExternal01-zCvf1EzU.js";import"./Lock01-DiQ4vbxd.js";import"./Sun-DyWU3dmA.js";import"./Play-hz-Aap6I.js";import"./Settings02-zMTyQvfN.js";import"./Shield01-CyagHvp0.js";import"./Trash01-BIkNmKu1.js";import"./Zap-Cv-p123E.js";const nt=pe({name:X().min(1,"Name is required").max(255,"Name is too long"),slug:X().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:X().optional()});function ot(t){const e=F.c(13),{value:r,onChange:l,name:a,disabled:u}=t,n=K.useRef(null);let S;e[0]===Symbol.for("react.memo_cache_sentinel")?(S=()=>n.current?.click(),e[0]=S):S=e[0];const g=S;let C;e[1]!==l?(C=P=>{const p=P.target.files?.[0];if(!p)return;if(p.size>2097152){M.error("Image must be smaller than 2MB");return}const h=new FileReader;h.onerror=it,h.onloadend=()=>{h.result&&l(h.result),n.current&&(n.current.value="")},h.readAsDataURL(p)},e[1]=l,e[2]=C):C=e[2];const o=C;let i;e[3]!==u||e[4]!==o?(i=s.jsx("input",{ref:n,type:"file",accept:"image/*",onChange:o,className:"hidden",disabled:u}),e[3]=u,e[4]=o,e[5]=i):i=e[5];const d=r||void 0,m=a??"?";let f;e[6]!==d||e[7]!==m?(f=s.jsx(ye,{url:d,fallback:m,shape:"square",size:"base"}),e[6]=d,e[7]=m,e[8]=f):f=e[8];let x;return e[9]!==u||e[10]!==i||e[11]!==f?(x=s.jsxs("button",{type:"button",onClick:g,disabled:u,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]=u,e[10]=i,e[11]=f,e[12]=x):x=e[12],x}function it(){return M.error("Failed to read image")}function lt(){const t=ae(),{org:e}=re(),r=ve(),l=ce(),a=fe({resolver:xe(nt),values:{name:e.name??"",slug:e.slug??"",logo:e.logo??""}}),u=de({mutationFn:async o=>{const i={name:o.name,slug:o.slug};o.logo&&(i.logo=o.logo);const d=await r.organization.update({data:i});if(d?.error)throw new Error(d.error.message||"Failed to update organization");return d},onSuccess:(o,i)=>{W("organization_settings_updated",{organization_id:e.id,fields:Object.keys(i)}),l.invalidateQueries({queryKey:Y.organizations()}),l.invalidateQueries({queryKey:Y.activeOrganization(e.slug)}),M.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)=>{W("organization_settings_update_failed",{organization_id:e.id,fields:Object.keys(i),error:o instanceof Error?o.message:String(o)}),M.error(o instanceof Error?o.message:"Failed to update organization")}}),{schedule:n,flush:S}=be({save:async()=>{const o=a.control._formState.dirtyFields;if(Object.keys(o).length===0||!await a.trigger())return;const d=a.getValues(),m=a.control._defaultValues;a.reset(d,{keepValues:!0});try{await u.mutateAsync(d)}catch{a.reset(m,{keepValues:!0})}}}),g=a.formState.errors,C=typeof window<"u"?`${window.location.host}/`:"";return s.jsx(Z,{children:s.jsxs(J,{children:[s.jsx(Q,{title:"Logo",description:"Recommended size is 256x256px",action:s.jsx(ot,{value:a.watch("logo"),onChange:o=>{a.setValue("logo",o??"",{shouldDirty:!0}),S()},name:a.watch("name")})}),s.jsx(Q,{title:"Name",action:s.jsx(se,{control:a.control,name:"name",render:({field:o})=>s.jsx(me,{id:"org-name",...o,onChange:i=>{o.onChange(i),n()},onBlur:()=>{o.onBlur(),S()},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:[C&&s.jsx("span",{className:"pl-3 text-sm text-muted-foreground select-none",children:C}),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 d=i.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"");a.setValue("slug",d,{shouldDirty:!0,shouldTouch:!0,shouldValidate:!0}),n()},onBlur:()=>{o.onBlur(),S()}})})]})}),(g.name||g.slug||g.logo)&&s.jsxs("div",{className:"px-5 pb-3 flex flex-col gap-1",children:[g.name&&s.jsx("p",{className:"text-xs text-destructive",children:g.name.message}),g.slug&&s.jsx("p",{className:"text-xs text-destructive",children:g.slug.message}),g.logo&&s.jsx("p",{className:"text-xs text-destructive",children:g.logo.message})]})]})})}const ie=["site-editor","site-diagnostics","ai-image","ai-research"],le=8;function at(t,e,r){const l=e.find(u=>u.id===t);if(l)return{id:l.id,title:l.title,icon:l.icon,kind:"template"};const a=r.find(u=>u.id===t);return a?{id:t,title:a.title,icon:a.icon??null,kind:"custom"}:{id:t,title:t,icon:null,kind:"missing"}}function rt(t){const e=F.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:u,listeners:n,setNodeRef:S,transform:g,transition:C,isDragging:o}=Ee(a);let i;e[2]!==g?(i=Ie.Transform.toString(g),e[2]=g,e[3]=i):i=e[3];const d=o?.5:void 0,m=o?100:void 0;let f;e[4]!==i||e[5]!==d||e[6]!==m||e[7]!==C?(f={transform:i,transition:C,opacity:d,zIndex:m},e[4]=i,e[5]=d,e[6]=m,e[7]=C,e[8]=f):f=e[8];const x=f,P=o&&"shadow-lg";let p;e[9]!==P?(p=he("flex items-center gap-3 px-3 py-2 rounded-lg border border-border bg-background",P),e[9]=P,e[10]=p):p=e[10];const h=`Drag to reorder ${r.title}`;let z;e[11]===Symbol.for("react.memo_cache_sentinel")?(z=s.jsx(He,{size:14}),e[11]=z):z=e[11];let E;e[12]!==u||e[13]!==n||e[14]!==h?(E=s.jsx("button",{type:"button",...u,...n,className:"text-muted-foreground hover:text-foreground cursor-grab active:cursor-grabbing","aria-label":h,children:z}),e[12]=u,e[13]=n,e[14]=h,e[15]=E):E=e[15];let v;e[16]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(ge,{size:14}),e[16]=v):v=e[16];let N;e[17]!==r.icon||e[18]!==r.title?(N=s.jsx(ee,{icon:r.icon,name:r.title,size:"xs",fallbackIcon:v}),e[17]=r.icon,e[18]=r.title,e[19]=N):N=e[19];let b;e[20]!==r.title?(b=s.jsx("span",{className:"text-sm text-foreground truncate",children:r.title}),e[20]=r.title,e[21]=b):b=e[21];const _=r.kind==="template"?"Template":r.kind==="custom"?"Custom agent":"Unavailable";let j;e[22]!==_?(j=s.jsx("span",{className:"text-xs text-muted-foreground",children:_}),e[22]=_,e[23]=j):j=e[23];let D;e[24]!==b||e[25]!==j?(D=s.jsxs("div",{className:"flex flex-col min-w-0 flex-1",children:[b,j]}),e[24]=b,e[25]=j,e[26]=D):D=e[26];const w=`Remove ${r.title}`;let A;e[27]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx(Ge,{size:14}),e[27]=A):A=e[27];let y;e[28]!==l||e[29]!==w?(y=s.jsx("button",{type:"button",onClick:l,className:"text-muted-foreground hover:text-foreground p-1 rounded","aria-label":w,children:A}),e[28]=l,e[29]=w,e[30]=y):y=e[30];let O;return e[31]!==S||e[32]!==x||e[33]!==E||e[34]!==N||e[35]!==D||e[36]!==y||e[37]!==p?(O=s.jsxs("div",{ref:S,style:x,className:p,children:[E,N,D,y]}),e[31]=S,e[32]=x,e[33]=E,e[34]=N,e[35]=D,e[36]=y,e[37]=p,e[38]=O):O=e[38],O}function ct(t){const e=F.c(48),{selectedIds:r,onAdd:l}=t,[a,u]=K.useState(!1),[n,S]=K.useState(""),g=ue();let C;e[0]!==r?(C=new Set(r),e[0]=r,e[1]=C):C=e[1];const o=C;let i,d,m,f,x,P,p,h,z,E,v,N,b;if(e[2]!==g||e[3]!==l||e[4]!==a||e[5]!==n||e[6]!==o){const A=n.toLowerCase();f=te.filter(c=>!o.has(c.id)&&(!n||c.title.toLowerCase().includes(A)));let y;e[20]!==o?(y=c=>c.id!==null&&!Le(c.id)&&!o.has(c.id),e[20]=o,e[21]=y):y=e[21],m=g.filter(y).filter(c=>!n||c.title.toLowerCase().includes(A));let O;e[22]!==l?(O=c=>{l(c),u(!1),S("")},e[22]=l,e[23]=O):O=e[23];const I=O;d=Me,N=a,b=u,e[24]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(Ke,{asChild:!0,children:s.jsxs(H,{type:"button",variant:"outline",size:"sm",children:[s.jsx(Ve,{size:14}),"Add agent"]})}),e[24]=x):x=e[24],i=qe,z="w-[320px] p-0 overflow-hidden",E="start",e[25]!==n?(v=s.jsx(Fe,{value:n,onChange:S,placeholder:"Search agents..."}),e[25]=n,e[26]=v):v=e[26],P="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:()=>I(c.id),className:"flex items-center gap-2 px-2 py-1.5 rounded-md hover:bg-accent text-left",children:[s.jsx(ee,{icon:c.icon,name:c.title,size:"xs"}),s.jsx("span",{className:"text-sm truncate",children:c.title})]},c.id))]}),h=m.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"}),m.map(c=>s.jsxs("button",{type:"button",onClick:()=>I(c.id),className:"flex items-center gap-2 px-2 py-1.5 rounded-md hover:bg-accent text-left",children:[s.jsx(ee,{icon:c.icon,name:c.title,size:"xs",fallbackIcon:s.jsx(ge,{size:14})}),s.jsx("span",{className:"text-sm truncate",children:c.title})]},c.id))]}),e[2]=g,e[3]=l,e[4]=a,e[5]=n,e[6]=o,e[7]=i,e[8]=d,e[9]=m,e[10]=f,e[11]=x,e[12]=P,e[13]=p,e[14]=h,e[15]=z,e[16]=E,e[17]=v,e[18]=N,e[19]=b}else i=e[7],d=e[8],m=e[9],f=e[10],x=e[11],P=e[12],p=e[13],h=e[14],z=e[15],E=e[16],v=e[17],N=e[18],b=e[19];let _;e[27]!==m||e[28]!==f.length||e[29]!==n?(_=f.length===0&&m.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]=m,e[28]=f.length,e[29]=n,e[30]=_):_=e[30];let j;e[31]!==_||e[32]!==P||e[33]!==p||e[34]!==h?(j=s.jsxs("div",{className:P,children:[p,h,_]}),e[31]=_,e[32]=P,e[33]=p,e[34]=h,e[35]=j):j=e[35];let D;e[36]!==i||e[37]!==j||e[38]!==z||e[39]!==E||e[40]!==v?(D=s.jsxs(i,{className:z,align:E,children:[v,j]}),e[36]=i,e[37]=j,e[38]=z,e[39]=E,e[40]=v,e[41]=D):D=e[41];let w;return e[42]!==d||e[43]!==x||e[44]!==D||e[45]!==N||e[46]!==b?(w=s.jsxs(d,{open:N,onOpenChange:b,children:[x,D]}),e[42]=d,e[43]=x,e[44]=D,e[45]=N,e[46]=b,e[47]=w):w=e[47],w}function dt(){const t=F.c(61),e=Ue(),r=ue(),l=Qe();let a;t[0]!==e?.ids?(a=e?.ids??[...ie],t[0]=e?.ids,t[1]=a):a=t[1];const u=a,[n,S]=K.useState(u);let g;t[2]!==n||t[3]!==u?(g=n.length!==u.length||n.some((k,T)=>k!==u[T]),t[2]=n,t[3]=u,t[4]=g):g=t[4];const C=g;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:ke},t[6]=i):i=t[6];const d=_e(oe(Oe,o),oe(Pe,i));let m;t[7]!==n?(m=k=>{const{active:T,over:R}=k;if(!R||T.id===R.id)return;const $=n.indexOf(T.id),G=n.indexOf(R.id);$===-1||G===-1||S(Te([...n],$,G))},t[7]=n,t[8]=m):m=t[8];const f=m;let x;t[9]!==n?(x=k=>{n.includes(k)||S([...n,k])},t[9]=n,t[10]=x):x=t[10];const P=x;let p;t[11]!==n?(p=k=>{S(n.filter(T=>T!==k))},t[11]=n,t[12]=p):p=t[12];const h=p;let z;t[13]===Symbol.for("react.memo_cache_sentinel")?(z=()=>{S([...ie])},t[13]=z):z=t[13];const E=z;let v;t[14]!==n||t[15]!==l?(v=()=>{l.mutate({ids:n},{onSuccess:()=>{W("default_home_agents_updated",{count:n.length,template_count:n.filter(ut).length}),M.success("Default home agents updated")},onError:mt})},t[14]=n,t[15]=l,t[16]=v):v=t[16];const N=v;let b,_,j,D,w,A,y;if(t[17]!==r||t[18]!==n||t[19]!==f||t[20]!==h||t[21]!==d||t[22]!==l.isPending){let k;t[30]!==r?(k=$=>at($,te,r),t[30]=r,t[31]=k):k=t[31];const T=n.map(k);j=Math.max(0,n.length-le),_=Z,w="Default home agents";let R;t[32]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsx(je,{size:14}),t[32]=R):R=t[32],t[33]!==l.isPending?(A=s.jsxs(H,{type:"button",variant:"ghost",size:"sm",onClick:E,disabled:l.isPending,children:[R,"Reset defaults"]}),t[33]=l.isPending,t[34]=A):A=t[34],b=J,y="px-5 py-5 flex flex-col gap-3",D=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(De,{sensors:d,collisionDetection:ze,onDragEnd:f,children:s.jsx(Ae,{items:n,strategy:we,children:s.jsx("div",{className:"flex flex-col gap-1.5",children:T.map(($,G)=>s.jsxs("div",{className:"flex flex-col gap-1.5",children:[G===le&&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(rt,{agent:$,onRemove:()=>h($.id)})]},$.id))})})}),t[17]=r,t[18]=n,t[19]=f,t[20]=h,t[21]=d,t[22]=l.isPending,t[23]=b,t[24]=_,t[25]=j,t[26]=D,t[27]=w,t[28]=A,t[29]=y}else b=t[23],_=t[24],j=t[25],D=t[26],w=t[27],A=t[28],y=t[29];let O;t[35]!==n||t[36]!==P?(O=s.jsx(ct,{selectedIds:n,onAdd:P}),t[35]=n,t[36]=P,t[37]=O):O=t[37];let I;t[38]!==j?(I=j>0&&s.jsxs("span",{className:"text-xs text-muted-foreground",children:[j," agent",j===1?"":"s"," won't fit on the home view"]}),t[38]=j,t[39]=I):I=t[39];let c;t[40]!==O||t[41]!==I?(c=s.jsxs("div",{className:"flex items-center justify-between",children:[O,I]}),t[40]=O,t[41]=I,t[42]=c):c=t[42];let L;t[43]!==D||t[44]!==c||t[45]!==y?(L=s.jsxs("div",{className:y,children:[D,c]}),t[43]=D,t[44]=c,t[45]=y,t[46]=L):L=t[46];let q;t[47]!==N||t[48]!==u||t[49]!==C||t[50]!==l.isPending?(q=C&&s.jsxs(Se,{children:[s.jsx(H,{type:"button",variant:"outline",onClick:()=>S(u),disabled:l.isPending,children:"Cancel"}),s.jsx(H,{type:"button",onClick:N,disabled:l.isPending,children:l.isPending?"Saving…":"Save"})]}),t[47]=N,t[48]=u,t[49]=C,t[50]=l.isPending,t[51]=q):q=t[51];let B;t[52]!==b||t[53]!==L||t[54]!==q?(B=s.jsxs(b,{children:[L,q]}),t[52]=b,t[53]=L,t[54]=q,t[55]=B):B=t[55];let V;return t[56]!==_||t[57]!==w||t[58]!==A||t[59]!==B?(V=s.jsx(_,{title:w,actions:A,children:B}),t[56]=_,t[57]=w,t[58]=A,t[59]=B,t[60]=V):V=t[60],V}function mt(t){M.error(t instanceof Error?t.message:"Failed to update default home agents")}function ut(t){return te.some(e=>e.id===t)}function gt(){const t=F.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Z,{title:"Default home agents",children:s.jsx(J,{children:s.jsx("div",{className:"px-5 py-5 flex flex-col gap-2",children:Array.from({length:4}).map(ft)})})}),t[0]=e):e=t[0],e}function ft(t,e){return s.jsx(Be,{className:"h-12 w-full rounded-lg"},e)}function xt(){const t=F.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(K.Suspense,{fallback:s.jsx(gt,{}),children:s.jsx(dt,{})}),t[0]=e):e=t[0],e}function pt(){const t=F.c(47),{org:e}=re(),r=ae(),l=ce(),[a,u]=K.useState(!1),[n,S]=K.useState("");let g;t[0]!==e.id||t[1]!==e.slug?(g={connectionId:Re,orgSlug:e.slug,orgId:e.id},t[0]=e.id,t[1]=e.slug,t[2]=g):g=t[2];const C=$e(g);let o;t[3]!==e.id||t[4]!==C?(o=async()=>{const I=await C.callTool({name:"ORGANIZATION_DELETE",arguments:{id:e.id}});if(I.isError){const c=I.content,L=Array.isArray(c)&&c[0]?.type==="text"&&typeof c[0].text=="string"?c[0].text:"Failed to delete organization";throw new Error(L)}},t[3]=e.id,t[4]=C,t[5]=o):o=t[5];let i;t[6]!==r||t[7]!==e.id||t[8]!==e.slug||t[9]!==l?(i=()=>{W("organization_deleted",{organization_id:e.id}),localStorage.getItem(ne.lastOrgSlug())===e.slug&&localStorage.removeItem(ne.lastOrgSlug()),l.removeQueries({queryKey:Y.activeOrganization(e.slug)}),l.invalidateQueries({queryKey:Y.organizations()}),M.success("Organization deleted"),r({to:"/"})},t[6]=r,t[7]=e.id,t[8]=e.slug,t[9]=l,t[10]=i):i=t[10];let d;t[11]!==o||t[12]!==i?(d={mutationFn:o,onSuccess:i,onError:ht},t[11]=o,t[12]=i,t[13]=d):d=t[13];const m=de(d);let f;t[14]===Symbol.for("react.memo_cache_sentinel")?(f=()=>u(!0),t[14]=f):f=t[14];let x;t[15]!==m.isPending?(x=s.jsx(Z,{title:"Danger Zone",description:"Irreversible actions that affect your entire organization.",children:s.jsx(J,{className:"border-destructive/40",children:s.jsx(Q,{title:"Delete organization",description:"Permanently delete this organization and all of its data. This action cannot be undone.",action:s.jsx(H,{variant:"destructive",size:"sm",onClick:f,disabled:m.isPending,children:"Delete"})})})}),t[15]=m.isPending,t[16]=x):x=t[16];let P;t[17]===Symbol.for("react.memo_cache_sentinel")?(P=I=>{u(I),I||S("")},t[17]=P):P=t[17];let p;t[18]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(We,{children:"Delete Organization?"}),t[18]=p):p=t[18];let h;t[19]!==e.name?(h=s.jsxs("p",{children:["This will permanently delete all data associated with"," ",s.jsx("span",{className:"font-medium text-foreground",children:e.name}),". This action cannot be undone."]}),t[19]=e.name,t[20]=h):h=t[20];let z;t[21]!==e.name?(z=s.jsxs("p",{className:"mt-3 mb-1.5",children:["Type"," ",s.jsx("span",{className:"font-medium text-foreground",children:e.name})," ","to confirm:"]}),t[21]=e.name,t[22]=z):z=t[22];let E;t[23]===Symbol.for("react.memo_cache_sentinel")?(E=I=>S(I.target.value),t[23]=E):E=t[23];let v;t[24]!==n||t[25]!==e.name?(v=s.jsx(me,{value:n,onChange:E,placeholder:e.name,autoFocus:!0}),t[24]=n,t[25]=e.name,t[26]=v):v=t[26];let N;t[27]!==v||t[28]!==h||t[29]!==z?(N=s.jsxs(Ye,{children:[p,s.jsx(Ze,{asChild:!0,children:s.jsxs("div",{children:[h,z,v]})})]}),t[27]=v,t[28]=h,t[29]=z,t[30]=N):N=t[30];let b;t[31]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(Je,{children:"Cancel"}),t[31]=b):b=t[31];let _;t[32]!==m?(_=()=>m.mutate(),t[32]=m,t[33]=_):_=t[33];const j=n!==e.name||m.isPending,D=m.isPending?"Deleting…":"Delete organization";let w;t[34]!==_||t[35]!==j||t[36]!==D?(w=s.jsxs(Xe,{children:[b,s.jsx(et,{onClick:_,disabled:j,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90 disabled:opacity-50",children:D})]}),t[34]=_,t[35]=j,t[36]=D,t[37]=w):w=t[37];let A;t[38]!==N||t[39]!==w?(A=s.jsxs(tt,{children:[N,w]}),t[38]=N,t[39]=w,t[40]=A):A=t[40];let y;t[41]!==a||t[42]!==A?(y=s.jsx(st,{open:a,onOpenChange:P,children:A}),t[41]=a,t[42]=A,t[43]=y):y=t[43];let O;return t[44]!==y||t[45]!==x?(O=s.jsxs(s.Fragment,{children:[x,y]}),t[44]=y,t[45]=x,t[46]=O):O=t[46],O}function ht(t){M.error(t instanceof Error?t.message:"Failed to delete organization")}function jt(){const t=F.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(U,{children:s.jsx(U.Content,{children:s.jsx(U.Body,{children:s.jsxs(Ce,{children:[s.jsx(U.Title,{children:"Organization"}),s.jsx(lt,{}),s.jsx(Ne,{}),s.jsx(xt,{}),s.jsx(pt,{})]})})})}),t[0]=e):e=t[0],e}function js(){const t=F.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(jt,{}),t[0]=e):e=t[0],e}export{js as default};
@@ -1 +1 @@
1
- import{e as f,j as t,r as h,g as S,O as u,l as _}from"./index-BPbpFSlG.js";import{S as g,a as v,b as y,u as k,c as N,d as T,e as w}from"./index-CVT_xMzU.js";import{u as C}from"./tooltip-8EMcUk8q.js";import{n as P}from"./ZapSquare-DBCGSeVa.js";import{u as O,T as j,a as M,b as p,S as R,c as $}from"./index-nM5EBUdq.js";import{C as I}from"./chat-context-BC1CXyf7.js";import"./X-DosXDblw.js";import"./agent-icon-CVuf051c.js";import"./AlertCircle-CjTfXQMH.js";import"./Tool01-BMc0DiTH.js";import"./Archive-CaJ5kGW4.js";import"./XClose-CzeywUWk.js";import"./RefreshCcw01-cS3DHDDp.js";import"./ArrowNarrowLeft-SJEHnXyc.js";import"./XCircle-ClvYl5pR.js";import"./ArrowUpRight-07AMyW3q.js";import"./Users03-CIbaYGvp.js";import"./CheckCircle-Lywb4tzc.js";import"./Check-CmnOcISu.js";import"./ChevronDown-B7nkAKvX.js";import"./ChevronRight-CFgoiwVv.js";import"./ChevronUp-COT1DfaR.js";import"./DotsVertical-CiKG-O-v.js";import"./Container-D1pwjZQv.js";import"./Star01-4_ptKeQ0.js";import"./Palette-VwQOwYSo.js";import"./SearchMd-CrQCxOMr.js";import"./LinkExternal01-B5ftsff4.js";import"./Lock01-BRRKEYOm.js";import"./Sun-DmD9Q3PB.js";import"./Play-DP3It0wz.js";import"./Plus-BB2q_olj.js";import"./Settings02-DVf2OlMW.js";import"./Shield01-B3ECj0f_.js";import"./Trash01-6VDjweik.js";import"./User01-C8lenn3T.js";import"./Zap-BIo7bCpk.js";import"./shell-layout--0UwjzTK.js";import"./dialog-CSDOHRuZ.js";import"./required-auth-layout-D-wVBMo_.js";import"./use-tasks-sf9lm6fu.js";import"./use-collections-bP--NcMC.js";import"./constants-BxcPdAxA.js";import"./use-organization-settings-DF1zVgfV.js";import"./use-org-sso-CqRALwPj.js";import"./pair-DK8WArXa.js";import"./index-2dbmNgG2.js";import"./use-copy-CbGC0huz.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./content-blocks-o63cs2vh.js";import"./types-0qNHrw5h.js";import"./integration-icon-BsCzD6pa.js";import"./use-virtual-mcp-CAY4xxsA.js";import"./skeleton-BW69nAou.js";import"./popover-HGsZ47vz.js";import"./drawer-i2HsSBna.js";import"./avatar-C8DSVjWY.js";import"./alert-dialog-74AkvGEe.js";import"./form-CyoIgyt_.js";import"./label-D08h5k1R.js";import"./input-DHBDt0A0.js";import"./index-CRIGn0SA.js";import"./use-mcp-tools-IbqZtDzy.js";import"./use-ai-providers-CJfgIRCZ.js";import"./index-BC8Qj8Ud.js";import"./switch-2kbNkhgy.js";import"./use-connection-Bszp6a5W.js";import"./lean-canvas-recruit-modal-BnmgWty8.js";import"./use-navigate-to-agent-DQOeSZSb.js";import"./collection-search-CmQSMD5X.js";import"./checkbox-BhLpSvVG.js";import"./extract-connection-data-CTVdkIjk.js";import"./constants-DN0vtCn3.js";import"./collections-CeyUXk8d.js";import"./tabs-BHCoB9-B.js";import"./select-ThJxxmvQ.js";import"./toggle-group-CGlJJKpo.js";import"./select-model-DPEgFP5P.js";import"./ai-providers-logos-DD3qZ33J.js";import"./use-debounced-autosave-0DHMqbbb.js";import"./settings-section-CE6DXKE_.js";import"./card-2PzQvDZe.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./unwrap-tool-result-BYXdCQMg.js";import"./dropdown-menu-CuTxWawv.js";import"./index-DUpS8oet.js";import"./question-004-sINsf4GQ.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-DojP2_fI.js";import"./use-registry-connections-DDZ2kJae.js";import"./useInfiniteQuery-DpFgBC5z.js";import"./infiniteQueryObserver-CXf2zWh1.js";import"./collection-tabs-DRcC41aH.js";import"./badge-DHtX06_M.js";import"./textarea-yE-qQiGr.js";import"./connection-form-helpers-DC0Nw-dt.js";import"./use-infinite-scroll-D4oMTPVQ.js";import"./useSuspenseInfiniteQuery-B_gLWLYH.js";import"./collection-search-BEFvuI7B.js";import"./use-create-virtual-mcp-CF9S4n1L.js";import"./empty-state-Bx9CGRh0.js";import"./use-decopilot-events-CJqb-CIN.js";import"./create-sse-subscription-CxkOgzKf.js";import"./task-status-CoiJkfnQ.js";const z=280;function L(){const e=f.c(2),{tasksOpen:r}=O();if(!r)return null;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={width:`${z}px`},e[0]=o):o=e[0];let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("aside",{className:"shrink-0 h-full bg-sidebar pb-1",style:o,children:t.jsx("div",{className:"h-full p-0.5 pt-0.25",children:t.jsx("div",{className:"h-full bg-background rounded-[0.75rem] overflow-hidden card-shadow",children:t.jsx(j,{})})})}),e[1]=i):i=e[1],i}function E(){const e=f.c(1);let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(h.Suspense,{fallback:null,children:t.jsx(L,{})}),e[0]=r):r=e[0],r}function b(){const e=f.c(1);let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(_,{size:20,className:"animate-spin text-muted-foreground"})}),e[0]=r):r=e[0],r}function F(){const e=f.c(18),{setOpenMobile:r,openMobile:o}=k();let i;e[0]!==r?(i=()=>r(!0),e[0]=r,e[1]=i):i=e[1];let m;e[2]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(P,{size:20}),e[2]=m):m=e[2];let s;e[3]!==i?(s=t.jsx("div",{className:"shrink-0 flex items-center px-2 h-12 bg-background border-b border-border",children:t.jsx("button",{type:"button",onClick:i,className:"flex size-8 shrink-0 items-center justify-center rounded-md text-foreground/60 hover:bg-accent hover:text-foreground transition-colors","aria-label":"Open menu",children:m})}),e[3]=i,e[4]=s):s=e[4];let a;e[5]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(N,{className:"sr-only",children:"Navigation"}),e[5]=a):a=e[5];let l;e[6]!==r?(l=t.jsx("div",{className:"w-14 shrink-0 bg-sidebar flex flex-col items-center border-r border-border overflow-y-auto group/sidebar","data-state":"collapsed",children:t.jsx($,{onClose:()=>r(!1)})}),e[6]=r,e[7]=l):l=e[7];let n;e[8]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"flex-1 min-w-0 overflow-hidden",children:t.jsx(j,{})}),e[8]=n):n=e[8];let c;e[9]!==l?(c=t.jsxs(T,{side:"left",hideCloseButton:!0,className:"w-[calc(100vw-3rem)] sm:max-w-md! p-0",children:[a,t.jsxs("div",{className:"flex h-full",children:[l,n]})]}),e[9]=l,e[10]=c):c=e[10];let d;e[11]!==o||e[12]!==r||e[13]!==c?(d=t.jsx(w,{open:o,onOpenChange:r,children:c}),e[11]=o,e[12]=r,e[13]=c,e[14]=d):d=e[14];let x;return e[15]!==s||e[16]!==d?(x=t.jsxs(t.Fragment,{children:[s,d]}),e[15]=s,e[16]=d,e[17]=x):x=e[17],x}function zt(){const e=f.c(7),r=C();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={strict:!1},e[0]=o):o=e[0];const m=!!S(o).taskId;let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s={"--sidebar-width-icon":"3.5rem"},e[1]=s):s=e[1];let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(R,{}),e[2]=a):a=e[2];let l;e[3]===Symbol.for("react.memo_cache_sentinel")?(l={background:"transparent",containerType:"inline-size"},e[3]=l):l=e[3];let n;return e[4]!==m||e[5]!==r?(n=t.jsx(g,{defaultOpen:!1,children:t.jsx("div",{className:"flex flex-col h-dvh overflow-hidden",children:t.jsxs(v,{className:"flex-1 bg-sidebar",style:s,children:[a,t.jsx(y,{className:"flex flex-col",style:l,children:t.jsx(I,{children:t.jsx(M,{children:r?t.jsxs(t.Fragment,{children:[!m&&t.jsx(F,{}),t.jsx(h.Suspense,{fallback:t.jsx(b,{}),children:t.jsx(u,{})})]}):t.jsxs(p,{children:[t.jsxs(p.Header,{children:[t.jsxs(p.LeftColumn,{children:[t.jsx(p.Nav,{}),t.jsx(p.TogglesSlot,{})]}),t.jsx(p.CenterSlot,{}),t.jsxs(p.RightColumn,{children:[t.jsx(p.TabsSlot,{}),t.jsx(p.RightSlot,{})]})]}),t.jsxs("div",{className:"flex-1 min-h-0 flex flex-row",children:[m&&t.jsx(E,{}),t.jsx(h.Suspense,{fallback:t.jsx(b,{}),children:t.jsx(u,{})})]})]})})})})]})})}),e[4]=m,e[5]=r,e[6]=n):n=e[6],n}export{zt as default};
1
+ import{e as f,j as t,r as h,g as S,O as u,l as _}from"./index-DDErZWVi.js";import{S as g,a as v,b as y,u as k,c as N,d as T,e as w}from"./index-DdBKKPxs.js";import{u as C}from"./tooltip-6l925dLT.js";import{n as P}from"./ZapSquare-D206qQUt.js";import{u as O,T as j,a as M,b as p,S as R,c as $}from"./index-CesZkHwj.js";import{C as I}from"./chat-context-mruWDWkr.js";import"./X-a6NKB5cR.js";import"./agent-icon-Byl44fjz.js";import"./AlertCircle-BJeD5C4R.js";import"./Tool01-CXQadPQ0.js";import"./Archive-YlLF-Utw.js";import"./XClose-BKyQhmnE.js";import"./RefreshCcw01-mHpCJu3a.js";import"./ArrowNarrowLeft-Bxr_bNh3.js";import"./XCircle-2YGJT4l8.js";import"./ArrowUpRight-BjngPScU.js";import"./Users03-DvpIbtPT.js";import"./CheckCircle-Bj4ArLnA.js";import"./Check-CCt4TdqV.js";import"./ChevronDown-Bj0_PlcH.js";import"./ChevronRight-C4ssXj8j.js";import"./ChevronUp-BX6pOMeY.js";import"./DotsVertical-dBwy2z8i.js";import"./Container-DCeE5VzU.js";import"./Star01-CtyYcqs8.js";import"./Palette-C4IIjTNv.js";import"./SearchMd-DRJGWUxm.js";import"./LinkExternal01-zCvf1EzU.js";import"./Lock01-DiQ4vbxd.js";import"./Sun-DyWU3dmA.js";import"./Play-hz-Aap6I.js";import"./Plus-CMSPc8qr.js";import"./Settings02-zMTyQvfN.js";import"./Shield01-CyagHvp0.js";import"./Trash01-BIkNmKu1.js";import"./User01-DnkItw6o.js";import"./Zap-Cv-p123E.js";import"./shell-layout-tb5uFFJK.js";import"./dialog-VeABQIqc.js";import"./required-auth-layout-BXiLDjox.js";import"./use-tasks-C50wbCHs.js";import"./use-collections-Clscqpr6.js";import"./constants-RsPwfdJf.js";import"./use-organization-settings-DAE9VhMp.js";import"./use-org-sso-ex6uAkHi.js";import"./pair-C0_kf-8-.js";import"./index-Cyow5Z3q.js";import"./use-copy-BMM4g8qh.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./content-blocks-o63cs2vh.js";import"./types-063PNzne.js";import"./integration-icon-DBaPSUho.js";import"./use-virtual-mcp-BlO6orHF.js";import"./skeleton-DxQ-428k.js";import"./popover-DnPkEGaL.js";import"./drawer-D7OQ4h1T.js";import"./avatar-CWZ0ixfS.js";import"./alert-dialog-D9PtfJxf.js";import"./form-JLSGdp7n.js";import"./label-3-gb9Mfh.js";import"./input-mPr-_Wkz.js";import"./index-DqFd1_Ou.js";import"./use-mcp-tools-CGp3Yu6f.js";import"./use-ai-providers-CXJtJ3gs.js";import"./index-DAvXxT14.js";import"./switch-BoKNT-B-.js";import"./use-connection-BONz3omb.js";import"./lean-canvas-recruit-modal-D4edhHd5.js";import"./use-navigate-to-agent-Btl0kxvD.js";import"./collection-search-H6nTPyyn.js";import"./checkbox-DW6m6j_q.js";import"./extract-connection-data-BQeAhwrY.js";import"./constants-CWE1wq29.js";import"./collections-DqQJv3EJ.js";import"./tabs-De__eheK.js";import"./select-C0jYaD9l.js";import"./toggle-group-CjJ2xnFY.js";import"./select-model-GxB6dprW.js";import"./ai-providers-logos-DD3qZ33J.js";import"./use-debounced-autosave-B7SdViQU.js";import"./settings-section-DtN4ZHic.js";import"./card-2C8lyYM4.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./unwrap-tool-result-BYXdCQMg.js";import"./dropdown-menu-CPdBBQUU.js";import"./index-Brtp4PAP.js";import"./question-004-sINsf4GQ.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-DP37rlHa.js";import"./use-registry-connections-BneTMB19.js";import"./useInfiniteQuery-C6j5jRkd.js";import"./infiniteQueryObserver-D8Dut25K.js";import"./collection-tabs-CErfHiTV.js";import"./badge-CA0TtSK-.js";import"./textarea-C0unIP9X.js";import"./connection-form-helpers-aO3CUs1Q.js";import"./use-infinite-scroll-CsVuEiLa.js";import"./useSuspenseInfiniteQuery-Lk0XRceb.js";import"./collection-search-Cljm_M2l.js";import"./use-create-virtual-mcp-L41f6BHk.js";import"./empty-state-S9xe6i3I.js";import"./use-decopilot-events-CURKUwZC.js";import"./create-sse-subscription-CxkOgzKf.js";import"./task-status-C_r8wvmS.js";const z=280;function L(){const e=f.c(2),{tasksOpen:r}=O();if(!r)return null;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={width:`${z}px`},e[0]=o):o=e[0];let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("aside",{className:"shrink-0 h-full bg-sidebar pb-1",style:o,children:t.jsx("div",{className:"h-full p-0.5 pt-0.25",children:t.jsx("div",{className:"h-full bg-background rounded-[0.75rem] overflow-hidden card-shadow",children:t.jsx(j,{})})})}),e[1]=i):i=e[1],i}function E(){const e=f.c(1);let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(h.Suspense,{fallback:null,children:t.jsx(L,{})}),e[0]=r):r=e[0],r}function b(){const e=f.c(1);let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(_,{size:20,className:"animate-spin text-muted-foreground"})}),e[0]=r):r=e[0],r}function F(){const e=f.c(18),{setOpenMobile:r,openMobile:o}=k();let i;e[0]!==r?(i=()=>r(!0),e[0]=r,e[1]=i):i=e[1];let m;e[2]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(P,{size:20}),e[2]=m):m=e[2];let s;e[3]!==i?(s=t.jsx("div",{className:"shrink-0 flex items-center px-2 h-12 bg-background border-b border-border",children:t.jsx("button",{type:"button",onClick:i,className:"flex size-8 shrink-0 items-center justify-center rounded-md text-foreground/60 hover:bg-accent hover:text-foreground transition-colors","aria-label":"Open menu",children:m})}),e[3]=i,e[4]=s):s=e[4];let a;e[5]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(N,{className:"sr-only",children:"Navigation"}),e[5]=a):a=e[5];let l;e[6]!==r?(l=t.jsx("div",{className:"w-14 shrink-0 bg-sidebar flex flex-col items-center border-r border-border overflow-y-auto group/sidebar","data-state":"collapsed",children:t.jsx($,{onClose:()=>r(!1)})}),e[6]=r,e[7]=l):l=e[7];let n;e[8]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"flex-1 min-w-0 overflow-hidden",children:t.jsx(j,{})}),e[8]=n):n=e[8];let c;e[9]!==l?(c=t.jsxs(T,{side:"left",hideCloseButton:!0,className:"w-[calc(100vw-3rem)] sm:max-w-md! p-0",children:[a,t.jsxs("div",{className:"flex h-full",children:[l,n]})]}),e[9]=l,e[10]=c):c=e[10];let d;e[11]!==o||e[12]!==r||e[13]!==c?(d=t.jsx(w,{open:o,onOpenChange:r,children:c}),e[11]=o,e[12]=r,e[13]=c,e[14]=d):d=e[14];let x;return e[15]!==s||e[16]!==d?(x=t.jsxs(t.Fragment,{children:[s,d]}),e[15]=s,e[16]=d,e[17]=x):x=e[17],x}function zt(){const e=f.c(7),r=C();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={strict:!1},e[0]=o):o=e[0];const m=!!S(o).taskId;let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s={"--sidebar-width-icon":"3.5rem"},e[1]=s):s=e[1];let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(R,{}),e[2]=a):a=e[2];let l;e[3]===Symbol.for("react.memo_cache_sentinel")?(l={background:"transparent",containerType:"inline-size"},e[3]=l):l=e[3];let n;return e[4]!==m||e[5]!==r?(n=t.jsx(g,{defaultOpen:!1,children:t.jsx("div",{className:"flex flex-col h-dvh overflow-hidden",children:t.jsxs(v,{className:"flex-1 bg-sidebar",style:s,children:[a,t.jsx(y,{className:"flex flex-col",style:l,children:t.jsx(I,{children:t.jsx(M,{children:r?t.jsxs(t.Fragment,{children:[!m&&t.jsx(F,{}),t.jsx(h.Suspense,{fallback:t.jsx(b,{}),children:t.jsx(u,{})})]}):t.jsxs(p,{children:[t.jsxs(p.Header,{children:[t.jsxs(p.LeftColumn,{children:[t.jsx(p.Nav,{}),t.jsx(p.TogglesSlot,{})]}),t.jsx(p.CenterSlot,{}),t.jsxs(p.RightColumn,{children:[t.jsx(p.TabsSlot,{}),t.jsx(p.RightSlot,{})]})]}),t.jsxs("div",{className:"flex-1 min-h-0 flex flex-row",children:[m&&t.jsx(E,{}),t.jsx(h.Suspense,{fallback:t.jsx(b,{}),children:t.jsx(u,{})})]})]})})})})]})})}),e[4]=m,e[5]=r,e[6]=n):n=e[6],n}export{zt as default};
@@ -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-BPbpFSlG.js";import{D as Ts,F as Es,B as $s}from"./index-D_WrlK5r.js";import{e as Fe,i as Os,u as ae}from"./constants-BxcPdAxA.js";import{b as fn}from"./use-virtual-mcp-CAY4xxsA.js";import{M as Re}from"./monaco-editor-DZ5QI8uz.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-DclhREAs.js";import{B as le}from"./badge-DHtX06_M.js";import{c as vt,S as wt,d as nt,b as Nt,a as kt}from"./select-ThJxxmvQ.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-2dbmNgG2.js";import{V as Xs}from"./view-mode-toggle-B4e_lOZL.js";import{a8 as Js,a9 as Gs,i as Qs,a0 as mn,aa as Ys,P as Zs,r as eo,ab as pn,X as to,T as xn,ac as no,ad as so,R as bt,ae as oo}from"./agent-icon-CVuf051c.js";import{i as hn}from"./Play-DP3It0wz.js";import{b as ro,a as io,V as Qe}from"./layout-B1PdCwnm.js";import{c as gn,T as bn,a as Sn,b as jn}from"./tooltip-8EMcUk8q.js";import{u as lo,a as co}from"./use-connection-Bszp6a5W.js";import{u as Ot,d as Rt,b as yn}from"./use-mcp-tools-IbqZtDzy.js";import{c as ao,d as uo,e as fo,D as mo,a as po,b as xo}from"./dialog-CSDOHRuZ.js";import"./index-CxxsJumH.js";import{S as ho}from"./index-DUpS8oet.js";import{D as vn,a as wn,b as Nn,c as Ye}from"./dropdown-menu-CuTxWawv.js";import{s as go}from"./Plus-BB2q_olj.js";import{b as kn}from"./Tool01-BMc0DiTH.js";import{i as He}from"./Check-CmnOcISu.js";import{s as Mt}from"./XClose-CzeywUWk.js";import{I as Lt}from"./integration-icon-BsCzD6pa.js";import{a as bo,S as So}from"./scroll-area-PHdLgpTR.js";import"./index-CRIGn0SA.js";import{i as _n}from"./X-DosXDblw.js";import{u as Cn,a as jo}from"./use-collections-bP--NcMC.js";import{E as In}from"./empty-state-Pw6pEnBg.js";import{c as yo}from"./create-sse-subscription-CxkOgzKf.js";import{I as Kt}from"./input-DHBDt0A0.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-DDErZWVi.js";import{D as Ts,F as Es,B as $s}from"./index-Ca5_2L4b.js";import{e as Fe,i as Os,u as ae}from"./constants-RsPwfdJf.js";import{b as fn}from"./use-virtual-mcp-BlO6orHF.js";import{M as Re}from"./monaco-editor-BfP_aqvh.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-C7jtb5zG.js";import{B as le}from"./badge-CA0TtSK-.js";import{c as vt,S as wt,d as nt,b as Nt,a as kt}from"./select-C0jYaD9l.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-Cyow5Z3q.js";import{V as Xs}from"./view-mode-toggle-DEaKPNk7.js";import{a8 as Js,a9 as Gs,i as Qs,a0 as mn,aa as Ys,P as Zs,r as eo,ab as pn,X as to,T as xn,ac as no,ad as so,R as bt,ae as oo}from"./agent-icon-Byl44fjz.js";import{i as hn}from"./Play-hz-Aap6I.js";import{b as ro,a as io,V as Qe}from"./layout-CmzRa0Nb.js";import{c as gn,T as bn,a as Sn,b as jn}from"./tooltip-6l925dLT.js";import{u as lo,a as co}from"./use-connection-BONz3omb.js";import{u as Ot,d as Rt,b as yn}from"./use-mcp-tools-CGp3Yu6f.js";import{c as ao,d as uo,e as fo,D as mo,a as po,b as xo}from"./dialog-VeABQIqc.js";import"./index-Njoumabj.js";import{S as ho}from"./index-Brtp4PAP.js";import{D as vn,a as wn,b as Nn,c as Ye}from"./dropdown-menu-CPdBBQUU.js";import{s as go}from"./Plus-CMSPc8qr.js";import{b as kn}from"./Tool01-CXQadPQ0.js";import{i as He}from"./Check-CCt4TdqV.js";import{s as Mt}from"./XClose-BKyQhmnE.js";import{I as Lt}from"./integration-icon-DBaPSUho.js";import{a as bo,S as So}from"./scroll-area-Bi0ICljU.js";import"./index-DqFd1_Ou.js";import{i as _n}from"./X-a6NKB5cR.js";import{u as Cn,a as jo}from"./use-collections-Clscqpr6.js";import{E as In}from"./empty-state-CrERbkuT.js";import{c as yo}from"./create-sse-subscription-CxkOgzKf.js";import{I as Kt}from"./input-mPr-_Wkz.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
  `)}
@@ -1 +1 @@
1
- import{P as z,a as G,D as H,o as J,p as Q}from"./index-2dbmNgG2.js";function V(x){var l;const{char:D,allowSpaces:b,allowToIncludeChar:P,allowedPrefixes:E,startOfLine:F,$position:v}=x,B=b&&!P,y=Q(D),K=new RegExp(`\\s${y}$`),h=F?"^":"",M=P?"":y,N=B?new RegExp(`${h}${y}.*?(?=\\s${M}|$)`,"gm"):new RegExp(`${h}(?:^)?${y}[^\\s${M}]*`,"gm"),q=((l=v.nodeBefore)==null?void 0:l.isText)&&v.nodeBefore.text;if(!q)return null;const O=v.pos-q.length,u=Array.from(q.matchAll(N)).pop();if(!u||u.input===void 0||u.index===void 0)return null;const d=u.input.slice(Math.max(0,u.index-1),u.index),e=new RegExp(`^[${E?.join("")}\0]?$`).test(d);if(E!==null&&!e)return null;const I=O+u.index;let p=I+u[0].length;return B&&K.test(q.slice(p-1,p+1))&&(u[0]+=" ",p+=1),I<v.pos&&p>=v.pos?{range:{from:I,to:p},query:u[0].slice(D.length),text:u[0]}:null}var W=new z("suggestion");function Y({pluginKey:x=W,editor:l,char:D="@",allowSpaces:b=!1,allowToIncludeChar:P=!1,allowedPrefixes:E=[" "],startOfLine:F=!1,decorationTag:v="span",decorationClass:B="suggestion",decorationContent:y="",decorationEmptyClass:K="is-empty",command:h=()=>null,items:M=()=>[],render:N=()=>({}),allow:q=()=>!0,findSuggestionMatch:O=V,shouldShow:u}){let d;const e=N?.(),I=()=>{const n=l.state.selection.$anchor.pos,a=l.view.coordsAtPos(n),{top:r,right:s,bottom:o,left:c}=a;try{return new DOMRect(c,r,s-c,o-r)}catch{return null}},p=(n,a)=>a?()=>{const r=x.getState(l.state),s=r?.decorationId,o=n.dom.querySelector(`[data-decoration-id="${s}"]`);return o?.getBoundingClientRect()||null}:I;function U(n,a){var r;try{const o=x.getState(n.state),c=o?.decorationId?n.dom.querySelector(`[data-decoration-id="${o.decorationId}"]`):null,g={editor:l,range:o?.range||{from:0,to:0},query:o?.query||null,text:o?.text||null,items:[],command:m=>h({editor:l,range:o?.range||{from:0,to:0},props:m}),decorationNode:c,clientRect:p(n,c)};(r=e?.onExit)==null||r.call(e,g)}catch{}const s=n.state.tr.setMeta(a,{exit:!0});n.dispatch(s)}const C=new G({key:x,view(){return{update:async(n,a)=>{var r,s,o,c,g,m,S;const t=(r=this.key)==null?void 0:r.getState(a),f=(s=this.key)==null?void 0:s.getState(n.state),i=t.active&&f.active&&t.range.from!==f.range.from,_=!t.active&&f.active,A=t.active&&!f.active,R=!_&&!A&&t.query!==f.query,w=_||i&&R,k=R||i,j=A||i&&R;if(!w&&!k&&!j)return;const $=j&&!w?t:f,T=n.dom.querySelector(`[data-decoration-id="${$.decorationId}"]`);d={editor:l,range:$.range,query:$.query,text:$.text,items:[],command:L=>h({editor:l,range:$.range,props:L}),decorationNode:T,clientRect:p(n,T)},w&&((o=e?.onBeforeStart)==null||o.call(e,d)),k&&((c=e?.onBeforeUpdate)==null||c.call(e,d)),(k||w)&&(d.items=await M({editor:l,query:$.query})),j&&((g=e?.onExit)==null||g.call(e,d)),k&&((m=e?.onUpdate)==null||m.call(e,d)),w&&((S=e?.onStart)==null||S.call(e,d))},destroy:()=>{var n;d&&((n=e?.onExit)==null||n.call(e,d))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(n,a,r,s){const{isEditable:o}=l,{composing:c}=l.view,{selection:g}=n,{empty:m,from:S}=g,t={...a},f=n.getMeta(x);if(f&&f.exit)return t.active=!1,t.decorationId=null,t.range={from:0,to:0},t.query=null,t.text=null,t;if(t.composing=c,o&&(m||l.view.composing)){(S<a.range.from||S>a.range.to)&&!c&&!a.composing&&(t.active=!1);const i=O({char:D,allowSpaces:b,allowToIncludeChar:P,allowedPrefixes:E,startOfLine:F,$position:g.$from}),_=`id_${Math.floor(Math.random()*4294967295)}`;i&&q({editor:l,state:s,range:i.range,isActive:a.active})&&(!u||u({editor:l,range:i.range,query:i.query,text:i.text,transaction:n}))?(t.active=!0,t.decorationId=a.decorationId?a.decorationId:_,t.range=i.range,t.query=i.query,t.text=i.text):t.active=!1}else t.active=!1;return t.active||(t.decorationId=null,t.range={from:0,to:0},t.query=null,t.text=null),t}},props:{handleKeyDown(n,a){var r,s,o,c;const{active:g,range:m}=C.getState(n.state);if(!g)return!1;if(a.key==="Escape"||a.key==="Esc"){const t=C.getState(n.state),f=(r=d?.decorationNode)!=null?r:null,i=f??(t?.decorationId?n.dom.querySelector(`[data-decoration-id="${t.decorationId}"]`):null);if(((s=e?.onKeyDown)==null?void 0:s.call(e,{view:n,event:a,range:t.range}))||!1)return!0;const A={editor:l,range:t.range,query:t.query,text:t.text,items:[],command:R=>h({editor:l,range:t.range,props:R}),decorationNode:i,clientRect:i?()=>i.getBoundingClientRect()||null:null};return(o=e?.onExit)==null||o.call(e,A),U(n,x),!0}return((c=e?.onKeyDown)==null?void 0:c.call(e,{view:n,event:a,range:m}))||!1},decorations(n){const{active:a,range:r,decorationId:s,query:o}=C.getState(n);if(!a)return null;const c=!o?.length,g=[B];return c&&g.push(K),H.create(n.doc,[J.inline(r.from,r.to,{nodeName:v,class:g.join(" "),"data-decoration-id":s,"data-decoration-content":y})])}}});return C}export{Y as S};
1
+ import{P as z,a as G,D as H,o as J,p as Q}from"./index-Cyow5Z3q.js";function V(x){var l;const{char:D,allowSpaces:b,allowToIncludeChar:P,allowedPrefixes:E,startOfLine:F,$position:v}=x,B=b&&!P,y=Q(D),K=new RegExp(`\\s${y}$`),h=F?"^":"",M=P?"":y,N=B?new RegExp(`${h}${y}.*?(?=\\s${M}|$)`,"gm"):new RegExp(`${h}(?:^)?${y}[^\\s${M}]*`,"gm"),q=((l=v.nodeBefore)==null?void 0:l.isText)&&v.nodeBefore.text;if(!q)return null;const O=v.pos-q.length,u=Array.from(q.matchAll(N)).pop();if(!u||u.input===void 0||u.index===void 0)return null;const d=u.input.slice(Math.max(0,u.index-1),u.index),e=new RegExp(`^[${E?.join("")}\0]?$`).test(d);if(E!==null&&!e)return null;const I=O+u.index;let p=I+u[0].length;return B&&K.test(q.slice(p-1,p+1))&&(u[0]+=" ",p+=1),I<v.pos&&p>=v.pos?{range:{from:I,to:p},query:u[0].slice(D.length),text:u[0]}:null}var W=new z("suggestion");function Y({pluginKey:x=W,editor:l,char:D="@",allowSpaces:b=!1,allowToIncludeChar:P=!1,allowedPrefixes:E=[" "],startOfLine:F=!1,decorationTag:v="span",decorationClass:B="suggestion",decorationContent:y="",decorationEmptyClass:K="is-empty",command:h=()=>null,items:M=()=>[],render:N=()=>({}),allow:q=()=>!0,findSuggestionMatch:O=V,shouldShow:u}){let d;const e=N?.(),I=()=>{const n=l.state.selection.$anchor.pos,a=l.view.coordsAtPos(n),{top:r,right:s,bottom:o,left:c}=a;try{return new DOMRect(c,r,s-c,o-r)}catch{return null}},p=(n,a)=>a?()=>{const r=x.getState(l.state),s=r?.decorationId,o=n.dom.querySelector(`[data-decoration-id="${s}"]`);return o?.getBoundingClientRect()||null}:I;function U(n,a){var r;try{const o=x.getState(n.state),c=o?.decorationId?n.dom.querySelector(`[data-decoration-id="${o.decorationId}"]`):null,g={editor:l,range:o?.range||{from:0,to:0},query:o?.query||null,text:o?.text||null,items:[],command:m=>h({editor:l,range:o?.range||{from:0,to:0},props:m}),decorationNode:c,clientRect:p(n,c)};(r=e?.onExit)==null||r.call(e,g)}catch{}const s=n.state.tr.setMeta(a,{exit:!0});n.dispatch(s)}const C=new G({key:x,view(){return{update:async(n,a)=>{var r,s,o,c,g,m,S;const t=(r=this.key)==null?void 0:r.getState(a),f=(s=this.key)==null?void 0:s.getState(n.state),i=t.active&&f.active&&t.range.from!==f.range.from,_=!t.active&&f.active,A=t.active&&!f.active,R=!_&&!A&&t.query!==f.query,w=_||i&&R,k=R||i,j=A||i&&R;if(!w&&!k&&!j)return;const $=j&&!w?t:f,T=n.dom.querySelector(`[data-decoration-id="${$.decorationId}"]`);d={editor:l,range:$.range,query:$.query,text:$.text,items:[],command:L=>h({editor:l,range:$.range,props:L}),decorationNode:T,clientRect:p(n,T)},w&&((o=e?.onBeforeStart)==null||o.call(e,d)),k&&((c=e?.onBeforeUpdate)==null||c.call(e,d)),(k||w)&&(d.items=await M({editor:l,query:$.query})),j&&((g=e?.onExit)==null||g.call(e,d)),k&&((m=e?.onUpdate)==null||m.call(e,d)),w&&((S=e?.onStart)==null||S.call(e,d))},destroy:()=>{var n;d&&((n=e?.onExit)==null||n.call(e,d))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(n,a,r,s){const{isEditable:o}=l,{composing:c}=l.view,{selection:g}=n,{empty:m,from:S}=g,t={...a},f=n.getMeta(x);if(f&&f.exit)return t.active=!1,t.decorationId=null,t.range={from:0,to:0},t.query=null,t.text=null,t;if(t.composing=c,o&&(m||l.view.composing)){(S<a.range.from||S>a.range.to)&&!c&&!a.composing&&(t.active=!1);const i=O({char:D,allowSpaces:b,allowToIncludeChar:P,allowedPrefixes:E,startOfLine:F,$position:g.$from}),_=`id_${Math.floor(Math.random()*4294967295)}`;i&&q({editor:l,state:s,range:i.range,isActive:a.active})&&(!u||u({editor:l,range:i.range,query:i.query,text:i.text,transaction:n}))?(t.active=!0,t.decorationId=a.decorationId?a.decorationId:_,t.range=i.range,t.query=i.query,t.text=i.text):t.active=!1}else t.active=!1;return t.active||(t.decorationId=null,t.range={from:0,to:0},t.query=null,t.text=null),t}},props:{handleKeyDown(n,a){var r,s,o,c;const{active:g,range:m}=C.getState(n.state);if(!g)return!1;if(a.key==="Escape"||a.key==="Esc"){const t=C.getState(n.state),f=(r=d?.decorationNode)!=null?r:null,i=f??(t?.decorationId?n.dom.querySelector(`[data-decoration-id="${t.decorationId}"]`):null);if(((s=e?.onKeyDown)==null?void 0:s.call(e,{view:n,event:a,range:t.range}))||!1)return!0;const A={editor:l,range:t.range,query:t.query,text:t.text,items:[],command:R=>h({editor:l,range:t.range,props:R}),decorationNode:i,clientRect:i?()=>i.getBoundingClientRect()||null:null};return(o=e?.onExit)==null||o.call(e,A),U(n,x),!0}return((c=e?.onKeyDown)==null?void 0:c.call(e,{view:n,event:a,range:m}))||!1},decorations(n){const{active:a,range:r,decorationId:s,query:o}=C.getState(n);if(!a)return null;const c=!o?.length,g=[B];return c&&g.push(K),H.create(n.doc,[J.inline(r.from,r.to,{nodeName:v,class:g.join(" "),"data-decoration-id":s,"data-decoration-content":y})])}}});return C}export{Y as S};
@@ -1 +1 @@
1
- import{e as R,j as i,r as P,s as ae,P as Ce,f as ke,c as ce,t as me,b as je,K as Ie,n as Se}from"./index-BPbpFSlG.js";import{u as _e}from"./tooltip-8EMcUk8q.js";import{I as ve}from"./integration-icon-BsCzD6pa.js";import{S as ue}from"./skeleton-BW69nAou.js";import{W as F,i as ye}from"./constants-BxcPdAxA.js";import{b as Ae}from"./use-virtual-mcp-CAY4xxsA.js";import{a as Oe}from"./use-organization-settings-DF1zVgfV.js";import{i as De}from"./ChevronRight-CFgoiwVv.js";import{s as Me}from"./Plus-BB2q_olj.js";import{a as Ee}from"./Users03-CIbaYGvp.js";import{I as oe,S as Re,L as Te,b as $e}from"./lean-canvas-recruit-modal-BnmgWty8.js";import{b as Pe,d as Le,e as ze,c as Be,u as Fe,C as G}from"./index-BC8Qj8Ud.js";import{u as He}from"./use-create-virtual-mcp-CF9S4n1L.js";import{d as Ue}from"./XCircle-ClvYl5pR.js";import"./Container-D1pwjZQv.js";import"./agent-icon-CVuf051c.js";import"./AlertCircle-CjTfXQMH.js";import"./Tool01-BMc0DiTH.js";import"./Archive-CaJ5kGW4.js";import"./XClose-CzeywUWk.js";import"./RefreshCcw01-cS3DHDDp.js";import"./ArrowNarrowLeft-SJEHnXyc.js";import"./ArrowUpRight-07AMyW3q.js";import"./ZapSquare-DBCGSeVa.js";import"./CheckCircle-Lywb4tzc.js";import"./Check-CmnOcISu.js";import"./ChevronDown-B7nkAKvX.js";import"./ChevronUp-COT1DfaR.js";import"./DotsVertical-CiKG-O-v.js";import"./Star01-4_ptKeQ0.js";import"./Palette-VwQOwYSo.js";import"./SearchMd-CrQCxOMr.js";import"./index-CVT_xMzU.js";import"./X-DosXDblw.js";import"./LinkExternal01-B5ftsff4.js";import"./Lock01-BRRKEYOm.js";import"./Sun-DmD9Q3PB.js";import"./Play-DP3It0wz.js";import"./Settings02-DVf2OlMW.js";import"./Shield01-B3ECj0f_.js";import"./Trash01-6VDjweik.js";import"./User01-C8lenn3T.js";import"./Zap-BIo7bCpk.js";import"./use-collections-bP--NcMC.js";import"./use-navigate-to-agent-DQOeSZSb.js";import"./dialog-CSDOHRuZ.js";import"./collection-search-CmQSMD5X.js";import"./checkbox-BhLpSvVG.js";import"./use-connection-Bszp6a5W.js";import"./extract-connection-data-CTVdkIjk.js";import"./constants-DN0vtCn3.js";import"./collections-CeyUXk8d.js";import"./drawer-i2HsSBna.js";import"./use-mcp-tools-IbqZtDzy.js";import"./switch-2kbNkhgy.js";import"./input-DHBDt0A0.js";import"./chat-context-BC1CXyf7.js";import"./use-ai-providers-CJfgIRCZ.js";import"./use-decopilot-events-CJqb-CIN.js";import"./create-sse-subscription-CxkOgzKf.js";import"./use-tasks-sf9lm6fu.js";import"./shell-layout--0UwjzTK.js";import"./required-auth-layout-D-wVBMo_.js";import"./use-org-sso-CqRALwPj.js";import"./pair-DK8WArXa.js";import"./index-2dbmNgG2.js";import"./use-copy-CbGC0huz.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./content-blocks-o63cs2vh.js";import"./types-0qNHrw5h.js";import"./tabs-BHCoB9-B.js";import"./form-CyoIgyt_.js";import"./label-D08h5k1R.js";import"./select-ThJxxmvQ.js";import"./toggle-group-CGlJJKpo.js";import"./select-model-DPEgFP5P.js";import"./ai-providers-logos-DD3qZ33J.js";import"./use-debounced-autosave-0DHMqbbb.js";import"./settings-section-CE6DXKE_.js";import"./card-2PzQvDZe.js";import"./avatar-C8DSVjWY.js";import"./alert-dialog-74AkvGEe.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./unwrap-tool-result-BYXdCQMg.js";import"./dropdown-menu-CuTxWawv.js";import"./index-DUpS8oet.js";import"./question-004-sINsf4GQ.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-DojP2_fI.js";import"./use-registry-connections-DDZ2kJae.js";import"./useInfiniteQuery-DpFgBC5z.js";import"./infiniteQueryObserver-CXf2zWh1.js";import"./collection-tabs-DRcC41aH.js";import"./badge-DHtX06_M.js";import"./textarea-yE-qQiGr.js";import"./connection-form-helpers-DC0Nw-dt.js";import"./use-infinite-scroll-D4oMTPVQ.js";import"./useSuspenseInfiniteQuery-B_gLWLYH.js";function We(e){try{const t=localStorage.getItem(`mesh:chat:recent-agents:${e}`);return t?JSON.parse(t):[]}catch{return[]}}const Ke=8;function xe(e){const t=R.c(21),{agent:s,onSpecialClick:r,tracking:n}=e,{org:o}=ae(),c=ke();let a;t[0]!==s.id||t[1]!==s.title||t[2]!==c||t[3]!==r||t[4]!==o||t[5]!==n.action||t[6]!==n.template_id||t[7]!==n.tile_kind?(a=()=>{if(me("home_agent_tile_clicked",{template_id:n.template_id,agent_id:s.id,agent_title:s.title,tile_kind:n.tile_kind,action:n.action}),r)r();else{const I=crypto.randomUUID();c({to:"/$org/$taskId",params:{org:o.slug,taskId:I},search:{virtualmcpid:s.id}})}},t[0]=s.id,t[1]=s.title,t[2]=c,t[3]=r,t[4]=o,t[5]=n.action,t[6]=n.template_id,t[7]=n.tile_kind,t[8]=a):a=t[8];const m=a;let u;t[9]===Symbol.for("react.memo_cache_sentinel")?(u=ce("flex flex-col items-center gap-3 p-2 rounded-lg","transition-colors","cursor-pointer","w-[100px] shrink-0","group"),t[9]=u):u=t[9];const L=`Select agent ${s.title}`;let k;t[10]===Symbol.for("react.memo_cache_sentinel")?(k=i.jsx(Ee,{size:24}),t[10]=k):k=t[10];let x;t[11]!==s.icon||t[12]!==s.title?(x=i.jsx(ve,{icon:s.icon,name:s.title,size:"md",fallbackIcon:k,className:"transition-transform group-hover:scale-110"}),t[11]=s.icon,t[12]=s.title,t[13]=x):x=t[13];let d;t[14]!==s.title?(d=i.jsx("p",{className:"text-xs sm:text-sm text-foreground text-center leading-tight line-clamp-2 break-words w-full",children:s.title}),t[14]=s.title,t[15]=d):d=t[15];let b;return t[16]!==m||t[17]!==L||t[18]!==x||t[19]!==d?(b=i.jsxs("button",{type:"button",onClick:m,className:u,"aria-label":L,children:[x,d]}),t[16]=m,t[17]=L,t[18]=x,t[19]=d,t[20]=b):b=t[20],b}function Ve(){const e=R.c(8),t=ke(),{org:s}=ae();let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=ce("flex flex-col items-center gap-3 p-2 rounded-lg","transition-colors","cursor-pointer","w-[100px] shrink-0","group"),e[0]=r):r=e[0];let n;e[1]!==t||e[2]!==s.slug?(n=()=>{me("home_see_all_agents_clicked"),t({to:"/$org/settings/agents",params:{org:s.slug}})},e[1]=t,e[2]=s.slug,e[3]=n):n=e[3];let o,c;e[4]===Symbol.for("react.memo_cache_sentinel")?(o=i.jsx("div",{className:"size-12 rounded-xl bg-accent flex items-center justify-center shrink-0 transition-transform group-hover:scale-110",children:i.jsx(De,{size:20,className:"text-foreground"})}),c=i.jsx("p",{className:"text-xs sm:text-sm text-foreground text-center leading-tight",children:"See all"}),e[4]=o,e[5]=c):(o=e[4],c=e[5]);let a;return e[6]!==n?(a=i.jsxs("button",{type:"button",className:r,"aria-label":"See all agents",onClick:n,children:[o,c]}),e[6]=n,e[7]=a):a=e[7],a}function qe(){const e=R.c(9);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={navigateOnCreate:!0},e[0]=t):t=e[0];const{createVirtualMCP:s,isCreating:r}=He(t);let n;e[1]!==s?(n=()=>{me("home_create_agent_clicked"),s()},e[1]=s,e[2]=n):n=e[2];let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=ce("flex flex-col items-center gap-3 p-2 rounded-lg","transition-colors","cursor-pointer","w-[100px] shrink-0","group","disabled:opacity-50 disabled:cursor-not-allowed"),e[3]=o):o=e[3];let c,a;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=i.jsx("div",{className:"size-12 rounded-xl bg-background border-2 border-dashed border-border flex items-center justify-center shrink-0 transition-transform group-hover:scale-110",children:i.jsx(Me,{size:20,className:"text-muted-foreground"})}),a=i.jsx("p",{className:"text-xs sm:text-sm text-foreground text-center leading-tight",children:"Create agent"}),e[4]=c,e[5]=a):(c=e[4],a=e[5]);let m;return e[6]!==r||e[7]!==n?(m=i.jsxs("button",{type:"button",onClick:n,disabled:r,className:o,"aria-label":"Create agent",children:[c,a]}),e[6]=r,e[7]=n,e[8]=m):m=e[8],m}function ie(e,t,s){return e.find(r=>r.id!==null&&(r.metadata?.type===t||r.title===s))}function Ge(){const e=R.c(52),t=Ae(),{locator:s,org:r}=ae(),n=Oe(),[o,c]=P.useState(!1),[a,m]=P.useState(!1),[u,L]=P.useState(!1),[k,x]=P.useState(!1),[d,b]=P.useState(!1),[I,T]=P.useState(!1),[E,$]=P.useState(!1),[z]=Ce(),S=Pe(r.slug);let h,p,f,g,j,A,_,v;if(e[0]!==s||e[1]!==S||e[2]!==n||e[3]!==z||e[4]!==t){const se=F.find(lt),Y=F.find(rt),J=F.find(nt),Q=F.find(st),Z=F.find(it),de=F.find(tt),ne=F.find(et);f=ie(t,Y.id,Y.title),h=ie(t,J.id,J.title),p=ie(t,Q.id,Q.title),g=ie(t,Z.id,Z.title);const pe=l=>{if(l===se.id)return{key:l,kind:"template-recruit",templateId:"site-editor",agent:se,onClick:"import-deco"};if(l===Y.id)return f?{key:f.id,kind:"existing",templateId:"site-diagnostics",agent:f}:{key:l,kind:"template-recruit",templateId:"site-diagnostics",agent:Y,onClick:"diagnostics"};if(l===J.id)return h?{key:h.id,kind:"existing",templateId:"ai-image",agent:h}:{key:l,kind:"template-recruit",templateId:"ai-image",agent:J,onClick:"ai-image"};if(l===Z.id)return g?{key:g.id,kind:"existing",templateId:"lean-canvas",agent:g}:{key:l,kind:"template-recruit",templateId:"lean-canvas",agent:Z,onClick:"lean-canvas"};if(l===de.id)return{key:l,kind:"template-recruit",templateId:"studio-pack",agent:de,onClick:"studio-pack"};if(l===ne.id)return z.experimental_vibecode?{key:l,kind:"template-recruit",templateId:"self-healing-storefront",agent:ne,onClick:"self-healing"}:null;if(l===Q.id)return p?{key:p.id,kind:"existing",templateId:"ai-research",agent:p}:{key:l,kind:"template-recruit",templateId:"ai-research",agent:Q,onClick:"ai-research"};const B=t.find(V=>V.id!==null&&V.id===l&&!ye(V.id));return B?{key:B.id,kind:"existing",templateId:null,agent:B}:null};let ee;if(n?.ids)ee=n.ids.map(pe).filter(Ze).slice(0,Ke);else{const B=[se.id,ne.id,Y.id,J.id,Q.id].map(pe).filter(Xe),V=We(s),we=t.filter(Qe).filter(q=>q.id!==f?.id&&q.id!==h?.id&&q.id!==p?.id).sort((q,fe)=>{const re=V.indexOf(q.id),le=V.indexOf(fe.id);return re!==-1&&le!==-1?re-le:re!==-1?-1:le!==-1?1:new Date(fe.updated_at).getTime()-new Date(q.updated_at).getTime()}).slice(0,4).map(Je);ee=[...B,...we]}j=ee.some(Ye);let te;e[13]!==S?(te=l=>{if(l.kind==="template-recruit"){const B={"import-deco":()=>c(!0),diagnostics:()=>m(!0),"ai-image":()=>L(!0),"ai-research":()=>x(!0),"lean-canvas":()=>b(!0),"studio-pack":()=>T(!0),"self-healing":()=>$(!0)}[l.onClick];return i.jsx(xe,{agent:l.agent,onSpecialClick:B,tracking:{template_id:l.templateId,tile_kind:"template",action:"open_modal"}},l.key)}return i.jsx(xe,{agent:l.agent,onSpecialClick:()=>S(l.agent.id),tracking:{template_id:l.templateId,tile_kind:l.templateId?"existing":"recent",action:"navigate"}},l.key)},e[13]=S,e[14]=te):te=e[14];const Ne=te;v="w-full max-md:overflow-x-auto max-md:[scrollbar-width:none] max-md:[&::-webkit-scrollbar]:hidden",A="flex flex-wrap justify-center gap-1.5 max-md:flex-nowrap max-md:justify-start md:max-h-52 md:overflow-hidden",_=ee.map(Ne),e[0]=s,e[1]=S,e[2]=n,e[3]=z,e[4]=t,e[5]=h,e[6]=p,e[7]=f,e[8]=g,e[9]=j,e[10]=A,e[11]=_,e[12]=v}else h=e[5],p=e[6],f=e[7],g=e[8],j=e[9],A=e[10],_=e[11],v=e[12];let O;e[15]===Symbol.for("react.memo_cache_sentinel")?(O=i.jsx(qe,{}),e[15]=O):O=e[15];let y;e[16]!==j?(y=j&&i.jsx(Ve,{}),e[16]=j,e[17]=y):y=e[17];let D;e[18]!==A||e[19]!==_||e[20]!==y?(D=i.jsxs("div",{className:A,children:[_,O,y]}),e[18]=A,e[19]=_,e[20]=y,e[21]=D):D=e[21];let N;e[22]!==v||e[23]!==D?(N=i.jsx("div",{className:v,children:D}),e[22]=v,e[23]=D,e[24]=N):N=e[24];let w;e[25]!==o?(w=i.jsx(oe,{open:o,onOpenChange:c}),e[25]=o,e[26]=w):w=e[26];let C;e[27]!==a||e[28]!==f?(C=i.jsx(Re,{open:a,onOpenChange:m,existingAgent:f}),e[27]=a,e[28]=f,e[29]=C):C=e[29];let M;e[30]!==u||e[31]!==h?(M=i.jsx(Le,{open:u,onOpenChange:L,existingAgent:h}),e[30]=u,e[31]=h,e[32]=M):M=e[32];let H;e[33]!==k||e[34]!==p?(H=i.jsx(ze,{open:k,onOpenChange:x,existingAgent:p}),e[33]=k,e[34]=p,e[35]=H):H=e[35];let U;e[36]!==g||e[37]!==d?(U=i.jsx(Te,{open:d,onOpenChange:b,existingAgent:g}),e[36]=g,e[37]=d,e[38]=U):U=e[38];let W;e[39]!==I?(W=i.jsx($e,{open:I,onOpenChange:T}),e[39]=I,e[40]=W):W=e[40];let K;e[41]!==E?(K=i.jsx(Be,{open:E,onOpenChange:$}),e[41]=E,e[42]=K):K=e[42];let X;return e[43]!==H||e[44]!==U||e[45]!==W||e[46]!==K||e[47]!==N||e[48]!==w||e[49]!==C||e[50]!==M?(X=i.jsxs(i.Fragment,{children:[N,w,C,M,H,U,W,K]}),e[43]=H,e[44]=U,e[45]=W,e[46]=K,e[47]=N,e[48]=w,e[49]=C,e[50]=M,e[51]=X):X=e[51],X}function Ye(e){return e.kind==="existing"&&e.templateId===null}function Je(e){return{key:e.id,kind:"existing",templateId:null,agent:e}}function Qe(e){return e.id!==null&&!ye(e.id)}function Xe(e){return e!==null}function Ze(e){return e!==null}function et(e){return e.id==="self-healing-storefront"}function tt(e){return e.id==="studio-pack"}function it(e){return e.id==="lean-canvas"}function st(e){return e.id==="ai-research"}function nt(e){return e.id==="ai-image"}function rt(e){return e.id==="site-diagnostics"}function lt(e){return e.id==="site-editor"}function ot(){const e=R.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=i.jsx("div",{className:"w-full max-md:overflow-x-auto max-md:[scrollbar-width:none] max-md:[&::-webkit-scrollbar]:hidden",children:i.jsx("div",{className:"flex flex-wrap justify-center gap-1.5 max-md:flex-nowrap max-md:justify-start md:max-h-52 md:overflow-hidden",children:Array.from({length:7}).map(at)})}),e[0]=t):t=e[0],t}function at(e,t){return i.jsxs("div",{className:"flex flex-col items-center gap-3 p-2 w-[100px] shrink-0",children:[i.jsx(ue,{className:"size-12 rounded-xl shrink-0"}),i.jsx(ue,{className:"h-3 sm:h-4 w-full"})]},t)}function ge(){const e=R.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=i.jsx(P.Suspense,{fallback:i.jsx(ot,{}),children:i.jsx(Ge,{})}),e[0]=t):t=e[0],t}const ct=["radial-gradient(ellipse 25% 220% at -5% 120%, rgba(165,149,255,0.35) 0%, transparent 100%)","radial-gradient(ellipse 25% 220% at 105% -20%, rgba(208,236,26,0.32) 0%, transparent 100%)"].join(", "),mt="/decotexture.svg";function he(e){const t=R.c(7),{onClick:s}=e;let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r={backgroundImage:ct},t[0]=r):r=t[0];let n,o;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsx("div",{className:"relative shrink-0 p-1.5 bg-[var(--brand-green-light)] rounded-lg border border-border",children:i.jsx(ve,{icon:"/logos/deco%20logo.svg",name:"deco.cx",size:"xs",className:"border-0 rounded-none bg-transparent"})}),o=i.jsx("p",{className:"flex-1 relative text-sm font-medium text-foreground leading-none whitespace-nowrap",children:"Import your deco.cx site"}),t[1]=n,t[2]=o):(n=t[1],o=t[2]);let c;t[3]===Symbol.for("react.memo_cache_sentinel")?(c=i.jsx("img",{src:mt,alt:"","aria-hidden":!0,className:"absolute pointer-events-none",style:{width:"274.5px",height:"272.25px",left:"calc(50% + 145.5px)",top:"calc(50% + 40px)",transform:"translate(-50%, -50%)"}}),t[3]=c):c=t[3];let a;t[4]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx("div",{className:"relative bg-background flex items-center justify-center size-8 rounded-md shrink-0",children:i.jsx(Ue,{size:16,className:"text-foreground transition-transform group-hover:translate-x-0.5"})}),t[4]=a):a=t[4];let m;return t[5]!==s?(m=i.jsxs("button",{type:"button",onClick:s,className:"w-full relative flex items-center gap-4 px-4 py-4 rounded-lg border border-border bg-background overflow-hidden transition-colors text-left cursor-pointer group",style:r,children:[n,o,c,a]}),t[5]=s,t[6]=m):m=t[6],m}function dt(){const e=R.c(5),{data:t}=je.useSession();let s;e[0]!==t?.user?.email?(s=Ie.decoProfile(t?.user?.email),e[0]=t?.user?.email,e[1]=s):s=e[1];const r=!!t?.user?.email;let n;e[2]!==s||e[3]!==r?(n={queryKey:s,queryFn:pt,enabled:r,staleTime:3e5},e[2]=s,e[3]=r,e[4]=n):n=e[4];const{data:o}=Se(n);return o?.isDecoUser??!1}async function pt(){const e=await fetch("/api/deco-sites/profile");return e.ok?e.json():{isDecoUser:!1}}function be(){const e=R.c(51),{data:t}=je.useSession(),[s,r]=P.useState(!1),n=dt(),o=_e(),{hasDecoKey:c,isZeroBalance:a,isInitialFreeCredit:m,balanceDollars:u,hasOnlyDecoProvider:L}=Fe();let k;e[0]!==t?.user?.name?(k=t?.user?.name?.split(" ")[0]||"there",e[0]=t?.user?.name,e[1]=k):k=e[1];const x=k,d=c&&m&&u!=null,b=c&&a&&L;if(o){let _;e[2]!==u||e[3]!==d?(_=d&&i.jsx("div",{className:"mb-4",children:i.jsx(G.CreditsEyebrow,{balanceDollars:u})}),e[2]=u,e[3]=d,e[4]=_):_=e[4];let v;e[5]!==b?(v=b&&i.jsx("div",{className:"mb-4",children:i.jsx(G.NoCreditsEyebrow,{})}),e[5]=b,e[6]=v):v=e[6];let O;e[7]!==x?(O=i.jsxs("p",{className:"text-3xl font-medium text-foreground text-center max-w-[280px]",children:["What's on your mind, ",x,"?"]}),e[7]=x,e[8]=O):O=e[8];let y;e[9]!==_||e[10]!==v||e[11]!==O?(y=i.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center w-full",children:[_,v,O]}),e[9]=_,e[10]=v,e[11]=O,e[12]=y):y=e[12];let D;e[13]===Symbol.for("react.memo_cache_sentinel")?(D=i.jsxs("div",{className:"w-full flex flex-col gap-4 pb-4",children:[i.jsx(ge,{}),i.jsx(G.Input,{showConnectionsBanner:!0})]}),e[13]=D):D=e[13];let N;e[14]!==n?(N=n&&i.jsx("div",{className:"w-full",children:i.jsx(he,{onClick:()=>r(!0)})}),e[14]=n,e[15]=N):N=e[15];let w;e[16]!==y||e[17]!==N?(w=i.jsxs("div",{className:"flex-1 relative flex flex-col items-center px-4",children:[y,D,N]}),e[16]=y,e[17]=N,e[18]=w):w=e[18];let C;e[19]!==s?(C=i.jsx(oe,{open:s,onOpenChange:r}),e[19]=s,e[20]=C):C=e[20];let M;return e[21]!==w||e[22]!==C?(M=i.jsxs(i.Fragment,{children:[w,C]}),e[21]=w,e[22]=C,e[23]=M):M=e[23],M}let I;e[24]!==u||e[25]!==d?(I=d&&i.jsx("div",{className:"mb-4",children:i.jsx(G.CreditsEyebrow,{balanceDollars:u})}),e[24]=u,e[25]=d,e[26]=I):I=e[26];let T;e[27]!==b?(T=b&&i.jsx("div",{className:"mb-4",children:i.jsx(G.NoCreditsEyebrow,{})}),e[27]=b,e[28]=T):T=e[28];let E;e[29]!==x?(E=i.jsxs("p",{className:"text-3xl font-medium text-foreground",children:["What's on your mind, ",x,"?"]}),e[29]=x,e[30]=E):E=e[30];let $;e[31]!==I||e[32]!==T||e[33]!==E?($=i.jsxs("div",{className:"text-center mb-10",children:[I,T,E]}),e[31]=I,e[32]=T,e[33]=E,e[34]=$):$=e[34];let z;e[35]===Symbol.for("react.memo_cache_sentinel")?(z=i.jsx("div",{className:"w-full",children:i.jsx(G.Input,{showConnectionsBanner:!0})}),e[35]=z):z=e[35];let S;e[36]!==$?(S=i.jsxs("div",{className:"flex flex-col items-center w-full max-w-[672px]",children:[$,z]}),e[36]=$,e[37]=S):S=e[37];let h;e[38]===Symbol.for("react.memo_cache_sentinel")?(h=i.jsx("div",{className:"w-full mt-10 mx-auto",children:i.jsx(ge,{})}),e[38]=h):h=e[38];let p;e[39]!==S?(p=i.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center w-full",children:[S,h]}),e[39]=S,e[40]=p):p=e[40];let f;e[41]!==n?(f=n&&i.jsx("div",{className:"absolute bottom-6 left-0 right-0 px-10",children:i.jsx("div",{className:"w-full max-w-[500px] mx-auto",children:i.jsx(he,{onClick:()=>r(!0)})})}),e[41]=n,e[42]=f):f=e[42];let g;e[43]!==p||e[44]!==f?(g=i.jsxs("div",{className:"flex-1 relative flex flex-col items-center px-10",children:[p,f]}),e[43]=p,e[44]=f,e[45]=g):g=e[45];let j;e[46]!==s?(j=i.jsx(oe,{open:s,onOpenChange:r}),e[46]=s,e[47]=j):j=e[47];let A;return e[48]!==g||e[49]!==j?(A=i.jsxs(i.Fragment,{children:[g,j]}),e[48]=g,e[49]=j,e[50]=A):A=e[50],A}function ss(){const e=R.c(2);if(_e()){let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx("div",{className:"flex-1 min-h-0 flex flex-col bg-background overflow-hidden",children:i.jsx(be,{})}),e[0]=r):r=e[0],r}let s;return e[1]===Symbol.for("react.memo_cache_sentinel")?(s=i.jsx("div",{className:"flex-1 min-h-0 p-1.5 overflow-hidden",children:i.jsx("div",{className:"flex h-full flex-col bg-background overflow-hidden card-shadow rounded-[0.75rem]",children:i.jsx(be,{})})}),e[1]=s):s=e[1],s}export{ss as default};
1
+ import{e as R,j as i,r as P,s as ae,P as Ce,f as ke,c as ce,t as me,b as je,K as Ie,n as Se}from"./index-DDErZWVi.js";import{u as _e}from"./tooltip-6l925dLT.js";import{I as ve}from"./integration-icon-DBaPSUho.js";import{S as ue}from"./skeleton-DxQ-428k.js";import{W as F,i as ye}from"./constants-RsPwfdJf.js";import{b as Ae}from"./use-virtual-mcp-BlO6orHF.js";import{a as Oe}from"./use-organization-settings-DAE9VhMp.js";import{i as De}from"./ChevronRight-C4ssXj8j.js";import{s as Me}from"./Plus-CMSPc8qr.js";import{a as Ee}from"./Users03-DvpIbtPT.js";import{I as oe,S as Re,L as Te,b as $e}from"./lean-canvas-recruit-modal-D4edhHd5.js";import{b as Pe,d as Le,e as ze,c as Be,u as Fe,C as G}from"./index-DAvXxT14.js";import{u as He}from"./use-create-virtual-mcp-L41f6BHk.js";import{d as Ue}from"./XCircle-2YGJT4l8.js";import"./Container-DCeE5VzU.js";import"./agent-icon-Byl44fjz.js";import"./AlertCircle-BJeD5C4R.js";import"./Tool01-CXQadPQ0.js";import"./Archive-YlLF-Utw.js";import"./XClose-BKyQhmnE.js";import"./RefreshCcw01-mHpCJu3a.js";import"./ArrowNarrowLeft-Bxr_bNh3.js";import"./ArrowUpRight-BjngPScU.js";import"./ZapSquare-D206qQUt.js";import"./CheckCircle-Bj4ArLnA.js";import"./Check-CCt4TdqV.js";import"./ChevronDown-Bj0_PlcH.js";import"./ChevronUp-BX6pOMeY.js";import"./DotsVertical-dBwy2z8i.js";import"./Star01-CtyYcqs8.js";import"./Palette-C4IIjTNv.js";import"./SearchMd-DRJGWUxm.js";import"./index-DdBKKPxs.js";import"./X-a6NKB5cR.js";import"./LinkExternal01-zCvf1EzU.js";import"./Lock01-DiQ4vbxd.js";import"./Sun-DyWU3dmA.js";import"./Play-hz-Aap6I.js";import"./Settings02-zMTyQvfN.js";import"./Shield01-CyagHvp0.js";import"./Trash01-BIkNmKu1.js";import"./User01-DnkItw6o.js";import"./Zap-Cv-p123E.js";import"./use-collections-Clscqpr6.js";import"./use-navigate-to-agent-Btl0kxvD.js";import"./dialog-VeABQIqc.js";import"./collection-search-H6nTPyyn.js";import"./checkbox-DW6m6j_q.js";import"./use-connection-BONz3omb.js";import"./extract-connection-data-BQeAhwrY.js";import"./constants-CWE1wq29.js";import"./collections-DqQJv3EJ.js";import"./drawer-D7OQ4h1T.js";import"./use-mcp-tools-CGp3Yu6f.js";import"./switch-BoKNT-B-.js";import"./input-mPr-_Wkz.js";import"./chat-context-mruWDWkr.js";import"./use-ai-providers-CXJtJ3gs.js";import"./use-decopilot-events-CURKUwZC.js";import"./create-sse-subscription-CxkOgzKf.js";import"./use-tasks-C50wbCHs.js";import"./shell-layout-tb5uFFJK.js";import"./required-auth-layout-BXiLDjox.js";import"./use-org-sso-ex6uAkHi.js";import"./pair-C0_kf-8-.js";import"./index-Cyow5Z3q.js";import"./use-copy-BMM4g8qh.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./content-blocks-o63cs2vh.js";import"./types-063PNzne.js";import"./tabs-De__eheK.js";import"./form-JLSGdp7n.js";import"./label-3-gb9Mfh.js";import"./select-C0jYaD9l.js";import"./toggle-group-CjJ2xnFY.js";import"./select-model-GxB6dprW.js";import"./ai-providers-logos-DD3qZ33J.js";import"./use-debounced-autosave-B7SdViQU.js";import"./settings-section-DtN4ZHic.js";import"./card-2C8lyYM4.js";import"./avatar-CWZ0ixfS.js";import"./alert-dialog-D9PtfJxf.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./unwrap-tool-result-BYXdCQMg.js";import"./dropdown-menu-CPdBBQUU.js";import"./index-Brtp4PAP.js";import"./question-004-sINsf4GQ.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-DP37rlHa.js";import"./use-registry-connections-BneTMB19.js";import"./useInfiniteQuery-C6j5jRkd.js";import"./infiniteQueryObserver-D8Dut25K.js";import"./collection-tabs-CErfHiTV.js";import"./badge-CA0TtSK-.js";import"./textarea-C0unIP9X.js";import"./connection-form-helpers-aO3CUs1Q.js";import"./use-infinite-scroll-CsVuEiLa.js";import"./useSuspenseInfiniteQuery-Lk0XRceb.js";function We(e){try{const t=localStorage.getItem(`mesh:chat:recent-agents:${e}`);return t?JSON.parse(t):[]}catch{return[]}}const Ke=8;function xe(e){const t=R.c(21),{agent:s,onSpecialClick:r,tracking:n}=e,{org:o}=ae(),c=ke();let a;t[0]!==s.id||t[1]!==s.title||t[2]!==c||t[3]!==r||t[4]!==o||t[5]!==n.action||t[6]!==n.template_id||t[7]!==n.tile_kind?(a=()=>{if(me("home_agent_tile_clicked",{template_id:n.template_id,agent_id:s.id,agent_title:s.title,tile_kind:n.tile_kind,action:n.action}),r)r();else{const I=crypto.randomUUID();c({to:"/$org/$taskId",params:{org:o.slug,taskId:I},search:{virtualmcpid:s.id}})}},t[0]=s.id,t[1]=s.title,t[2]=c,t[3]=r,t[4]=o,t[5]=n.action,t[6]=n.template_id,t[7]=n.tile_kind,t[8]=a):a=t[8];const m=a;let u;t[9]===Symbol.for("react.memo_cache_sentinel")?(u=ce("flex flex-col items-center gap-3 p-2 rounded-lg","transition-colors","cursor-pointer","w-[100px] shrink-0","group"),t[9]=u):u=t[9];const L=`Select agent ${s.title}`;let k;t[10]===Symbol.for("react.memo_cache_sentinel")?(k=i.jsx(Ee,{size:24}),t[10]=k):k=t[10];let x;t[11]!==s.icon||t[12]!==s.title?(x=i.jsx(ve,{icon:s.icon,name:s.title,size:"md",fallbackIcon:k,className:"transition-transform group-hover:scale-110"}),t[11]=s.icon,t[12]=s.title,t[13]=x):x=t[13];let d;t[14]!==s.title?(d=i.jsx("p",{className:"text-xs sm:text-sm text-foreground text-center leading-tight line-clamp-2 break-words w-full",children:s.title}),t[14]=s.title,t[15]=d):d=t[15];let b;return t[16]!==m||t[17]!==L||t[18]!==x||t[19]!==d?(b=i.jsxs("button",{type:"button",onClick:m,className:u,"aria-label":L,children:[x,d]}),t[16]=m,t[17]=L,t[18]=x,t[19]=d,t[20]=b):b=t[20],b}function Ve(){const e=R.c(8),t=ke(),{org:s}=ae();let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=ce("flex flex-col items-center gap-3 p-2 rounded-lg","transition-colors","cursor-pointer","w-[100px] shrink-0","group"),e[0]=r):r=e[0];let n;e[1]!==t||e[2]!==s.slug?(n=()=>{me("home_see_all_agents_clicked"),t({to:"/$org/settings/agents",params:{org:s.slug}})},e[1]=t,e[2]=s.slug,e[3]=n):n=e[3];let o,c;e[4]===Symbol.for("react.memo_cache_sentinel")?(o=i.jsx("div",{className:"size-12 rounded-xl bg-accent flex items-center justify-center shrink-0 transition-transform group-hover:scale-110",children:i.jsx(De,{size:20,className:"text-foreground"})}),c=i.jsx("p",{className:"text-xs sm:text-sm text-foreground text-center leading-tight",children:"See all"}),e[4]=o,e[5]=c):(o=e[4],c=e[5]);let a;return e[6]!==n?(a=i.jsxs("button",{type:"button",className:r,"aria-label":"See all agents",onClick:n,children:[o,c]}),e[6]=n,e[7]=a):a=e[7],a}function qe(){const e=R.c(9);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={navigateOnCreate:!0},e[0]=t):t=e[0];const{createVirtualMCP:s,isCreating:r}=He(t);let n;e[1]!==s?(n=()=>{me("home_create_agent_clicked"),s()},e[1]=s,e[2]=n):n=e[2];let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=ce("flex flex-col items-center gap-3 p-2 rounded-lg","transition-colors","cursor-pointer","w-[100px] shrink-0","group","disabled:opacity-50 disabled:cursor-not-allowed"),e[3]=o):o=e[3];let c,a;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=i.jsx("div",{className:"size-12 rounded-xl bg-background border-2 border-dashed border-border flex items-center justify-center shrink-0 transition-transform group-hover:scale-110",children:i.jsx(Me,{size:20,className:"text-muted-foreground"})}),a=i.jsx("p",{className:"text-xs sm:text-sm text-foreground text-center leading-tight",children:"Create agent"}),e[4]=c,e[5]=a):(c=e[4],a=e[5]);let m;return e[6]!==r||e[7]!==n?(m=i.jsxs("button",{type:"button",onClick:n,disabled:r,className:o,"aria-label":"Create agent",children:[c,a]}),e[6]=r,e[7]=n,e[8]=m):m=e[8],m}function ie(e,t,s){return e.find(r=>r.id!==null&&(r.metadata?.type===t||r.title===s))}function Ge(){const e=R.c(52),t=Ae(),{locator:s,org:r}=ae(),n=Oe(),[o,c]=P.useState(!1),[a,m]=P.useState(!1),[u,L]=P.useState(!1),[k,x]=P.useState(!1),[d,b]=P.useState(!1),[I,T]=P.useState(!1),[E,$]=P.useState(!1),[z]=Ce(),S=Pe(r.slug);let h,p,f,g,j,A,_,v;if(e[0]!==s||e[1]!==S||e[2]!==n||e[3]!==z||e[4]!==t){const se=F.find(lt),Y=F.find(rt),J=F.find(nt),Q=F.find(st),Z=F.find(it),de=F.find(tt),ne=F.find(et);f=ie(t,Y.id,Y.title),h=ie(t,J.id,J.title),p=ie(t,Q.id,Q.title),g=ie(t,Z.id,Z.title);const pe=l=>{if(l===se.id)return{key:l,kind:"template-recruit",templateId:"site-editor",agent:se,onClick:"import-deco"};if(l===Y.id)return f?{key:f.id,kind:"existing",templateId:"site-diagnostics",agent:f}:{key:l,kind:"template-recruit",templateId:"site-diagnostics",agent:Y,onClick:"diagnostics"};if(l===J.id)return h?{key:h.id,kind:"existing",templateId:"ai-image",agent:h}:{key:l,kind:"template-recruit",templateId:"ai-image",agent:J,onClick:"ai-image"};if(l===Z.id)return g?{key:g.id,kind:"existing",templateId:"lean-canvas",agent:g}:{key:l,kind:"template-recruit",templateId:"lean-canvas",agent:Z,onClick:"lean-canvas"};if(l===de.id)return{key:l,kind:"template-recruit",templateId:"studio-pack",agent:de,onClick:"studio-pack"};if(l===ne.id)return z.experimental_vibecode?{key:l,kind:"template-recruit",templateId:"self-healing-storefront",agent:ne,onClick:"self-healing"}:null;if(l===Q.id)return p?{key:p.id,kind:"existing",templateId:"ai-research",agent:p}:{key:l,kind:"template-recruit",templateId:"ai-research",agent:Q,onClick:"ai-research"};const B=t.find(V=>V.id!==null&&V.id===l&&!ye(V.id));return B?{key:B.id,kind:"existing",templateId:null,agent:B}:null};let ee;if(n?.ids)ee=n.ids.map(pe).filter(Ze).slice(0,Ke);else{const B=[se.id,ne.id,Y.id,J.id,Q.id].map(pe).filter(Xe),V=We(s),we=t.filter(Qe).filter(q=>q.id!==f?.id&&q.id!==h?.id&&q.id!==p?.id).sort((q,fe)=>{const re=V.indexOf(q.id),le=V.indexOf(fe.id);return re!==-1&&le!==-1?re-le:re!==-1?-1:le!==-1?1:new Date(fe.updated_at).getTime()-new Date(q.updated_at).getTime()}).slice(0,4).map(Je);ee=[...B,...we]}j=ee.some(Ye);let te;e[13]!==S?(te=l=>{if(l.kind==="template-recruit"){const B={"import-deco":()=>c(!0),diagnostics:()=>m(!0),"ai-image":()=>L(!0),"ai-research":()=>x(!0),"lean-canvas":()=>b(!0),"studio-pack":()=>T(!0),"self-healing":()=>$(!0)}[l.onClick];return i.jsx(xe,{agent:l.agent,onSpecialClick:B,tracking:{template_id:l.templateId,tile_kind:"template",action:"open_modal"}},l.key)}return i.jsx(xe,{agent:l.agent,onSpecialClick:()=>S(l.agent.id),tracking:{template_id:l.templateId,tile_kind:l.templateId?"existing":"recent",action:"navigate"}},l.key)},e[13]=S,e[14]=te):te=e[14];const Ne=te;v="w-full max-md:overflow-x-auto max-md:[scrollbar-width:none] max-md:[&::-webkit-scrollbar]:hidden",A="flex flex-wrap justify-center gap-1.5 max-md:flex-nowrap max-md:justify-start md:max-h-52 md:overflow-hidden",_=ee.map(Ne),e[0]=s,e[1]=S,e[2]=n,e[3]=z,e[4]=t,e[5]=h,e[6]=p,e[7]=f,e[8]=g,e[9]=j,e[10]=A,e[11]=_,e[12]=v}else h=e[5],p=e[6],f=e[7],g=e[8],j=e[9],A=e[10],_=e[11],v=e[12];let O;e[15]===Symbol.for("react.memo_cache_sentinel")?(O=i.jsx(qe,{}),e[15]=O):O=e[15];let y;e[16]!==j?(y=j&&i.jsx(Ve,{}),e[16]=j,e[17]=y):y=e[17];let D;e[18]!==A||e[19]!==_||e[20]!==y?(D=i.jsxs("div",{className:A,children:[_,O,y]}),e[18]=A,e[19]=_,e[20]=y,e[21]=D):D=e[21];let N;e[22]!==v||e[23]!==D?(N=i.jsx("div",{className:v,children:D}),e[22]=v,e[23]=D,e[24]=N):N=e[24];let w;e[25]!==o?(w=i.jsx(oe,{open:o,onOpenChange:c}),e[25]=o,e[26]=w):w=e[26];let C;e[27]!==a||e[28]!==f?(C=i.jsx(Re,{open:a,onOpenChange:m,existingAgent:f}),e[27]=a,e[28]=f,e[29]=C):C=e[29];let M;e[30]!==u||e[31]!==h?(M=i.jsx(Le,{open:u,onOpenChange:L,existingAgent:h}),e[30]=u,e[31]=h,e[32]=M):M=e[32];let H;e[33]!==k||e[34]!==p?(H=i.jsx(ze,{open:k,onOpenChange:x,existingAgent:p}),e[33]=k,e[34]=p,e[35]=H):H=e[35];let U;e[36]!==g||e[37]!==d?(U=i.jsx(Te,{open:d,onOpenChange:b,existingAgent:g}),e[36]=g,e[37]=d,e[38]=U):U=e[38];let W;e[39]!==I?(W=i.jsx($e,{open:I,onOpenChange:T}),e[39]=I,e[40]=W):W=e[40];let K;e[41]!==E?(K=i.jsx(Be,{open:E,onOpenChange:$}),e[41]=E,e[42]=K):K=e[42];let X;return e[43]!==H||e[44]!==U||e[45]!==W||e[46]!==K||e[47]!==N||e[48]!==w||e[49]!==C||e[50]!==M?(X=i.jsxs(i.Fragment,{children:[N,w,C,M,H,U,W,K]}),e[43]=H,e[44]=U,e[45]=W,e[46]=K,e[47]=N,e[48]=w,e[49]=C,e[50]=M,e[51]=X):X=e[51],X}function Ye(e){return e.kind==="existing"&&e.templateId===null}function Je(e){return{key:e.id,kind:"existing",templateId:null,agent:e}}function Qe(e){return e.id!==null&&!ye(e.id)}function Xe(e){return e!==null}function Ze(e){return e!==null}function et(e){return e.id==="self-healing-storefront"}function tt(e){return e.id==="studio-pack"}function it(e){return e.id==="lean-canvas"}function st(e){return e.id==="ai-research"}function nt(e){return e.id==="ai-image"}function rt(e){return e.id==="site-diagnostics"}function lt(e){return e.id==="site-editor"}function ot(){const e=R.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=i.jsx("div",{className:"w-full max-md:overflow-x-auto max-md:[scrollbar-width:none] max-md:[&::-webkit-scrollbar]:hidden",children:i.jsx("div",{className:"flex flex-wrap justify-center gap-1.5 max-md:flex-nowrap max-md:justify-start md:max-h-52 md:overflow-hidden",children:Array.from({length:7}).map(at)})}),e[0]=t):t=e[0],t}function at(e,t){return i.jsxs("div",{className:"flex flex-col items-center gap-3 p-2 w-[100px] shrink-0",children:[i.jsx(ue,{className:"size-12 rounded-xl shrink-0"}),i.jsx(ue,{className:"h-3 sm:h-4 w-full"})]},t)}function ge(){const e=R.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=i.jsx(P.Suspense,{fallback:i.jsx(ot,{}),children:i.jsx(Ge,{})}),e[0]=t):t=e[0],t}const ct=["radial-gradient(ellipse 25% 220% at -5% 120%, rgba(165,149,255,0.35) 0%, transparent 100%)","radial-gradient(ellipse 25% 220% at 105% -20%, rgba(208,236,26,0.32) 0%, transparent 100%)"].join(", "),mt="/decotexture.svg";function he(e){const t=R.c(7),{onClick:s}=e;let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r={backgroundImage:ct},t[0]=r):r=t[0];let n,o;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsx("div",{className:"relative shrink-0 p-1.5 bg-[var(--brand-green-light)] rounded-lg border border-border",children:i.jsx(ve,{icon:"/logos/deco%20logo.svg",name:"deco.cx",size:"xs",className:"border-0 rounded-none bg-transparent"})}),o=i.jsx("p",{className:"flex-1 relative text-sm font-medium text-foreground leading-none whitespace-nowrap",children:"Import your deco.cx site"}),t[1]=n,t[2]=o):(n=t[1],o=t[2]);let c;t[3]===Symbol.for("react.memo_cache_sentinel")?(c=i.jsx("img",{src:mt,alt:"","aria-hidden":!0,className:"absolute pointer-events-none",style:{width:"274.5px",height:"272.25px",left:"calc(50% + 145.5px)",top:"calc(50% + 40px)",transform:"translate(-50%, -50%)"}}),t[3]=c):c=t[3];let a;t[4]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx("div",{className:"relative bg-background flex items-center justify-center size-8 rounded-md shrink-0",children:i.jsx(Ue,{size:16,className:"text-foreground transition-transform group-hover:translate-x-0.5"})}),t[4]=a):a=t[4];let m;return t[5]!==s?(m=i.jsxs("button",{type:"button",onClick:s,className:"w-full relative flex items-center gap-4 px-4 py-4 rounded-lg border border-border bg-background overflow-hidden transition-colors text-left cursor-pointer group",style:r,children:[n,o,c,a]}),t[5]=s,t[6]=m):m=t[6],m}function dt(){const e=R.c(5),{data:t}=je.useSession();let s;e[0]!==t?.user?.email?(s=Ie.decoProfile(t?.user?.email),e[0]=t?.user?.email,e[1]=s):s=e[1];const r=!!t?.user?.email;let n;e[2]!==s||e[3]!==r?(n={queryKey:s,queryFn:pt,enabled:r,staleTime:3e5},e[2]=s,e[3]=r,e[4]=n):n=e[4];const{data:o}=Se(n);return o?.isDecoUser??!1}async function pt(){const e=await fetch("/api/deco-sites/profile");return e.ok?e.json():{isDecoUser:!1}}function be(){const e=R.c(51),{data:t}=je.useSession(),[s,r]=P.useState(!1),n=dt(),o=_e(),{hasDecoKey:c,isZeroBalance:a,isInitialFreeCredit:m,balanceDollars:u,hasOnlyDecoProvider:L}=Fe();let k;e[0]!==t?.user?.name?(k=t?.user?.name?.split(" ")[0]||"there",e[0]=t?.user?.name,e[1]=k):k=e[1];const x=k,d=c&&m&&u!=null,b=c&&a&&L;if(o){let _;e[2]!==u||e[3]!==d?(_=d&&i.jsx("div",{className:"mb-4",children:i.jsx(G.CreditsEyebrow,{balanceDollars:u})}),e[2]=u,e[3]=d,e[4]=_):_=e[4];let v;e[5]!==b?(v=b&&i.jsx("div",{className:"mb-4",children:i.jsx(G.NoCreditsEyebrow,{})}),e[5]=b,e[6]=v):v=e[6];let O;e[7]!==x?(O=i.jsxs("p",{className:"text-3xl font-medium text-foreground text-center max-w-[280px]",children:["What's on your mind, ",x,"?"]}),e[7]=x,e[8]=O):O=e[8];let y;e[9]!==_||e[10]!==v||e[11]!==O?(y=i.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center w-full",children:[_,v,O]}),e[9]=_,e[10]=v,e[11]=O,e[12]=y):y=e[12];let D;e[13]===Symbol.for("react.memo_cache_sentinel")?(D=i.jsxs("div",{className:"w-full flex flex-col gap-4 pb-4",children:[i.jsx(ge,{}),i.jsx(G.Input,{showConnectionsBanner:!0})]}),e[13]=D):D=e[13];let N;e[14]!==n?(N=n&&i.jsx("div",{className:"w-full",children:i.jsx(he,{onClick:()=>r(!0)})}),e[14]=n,e[15]=N):N=e[15];let w;e[16]!==y||e[17]!==N?(w=i.jsxs("div",{className:"flex-1 relative flex flex-col items-center px-4",children:[y,D,N]}),e[16]=y,e[17]=N,e[18]=w):w=e[18];let C;e[19]!==s?(C=i.jsx(oe,{open:s,onOpenChange:r}),e[19]=s,e[20]=C):C=e[20];let M;return e[21]!==w||e[22]!==C?(M=i.jsxs(i.Fragment,{children:[w,C]}),e[21]=w,e[22]=C,e[23]=M):M=e[23],M}let I;e[24]!==u||e[25]!==d?(I=d&&i.jsx("div",{className:"mb-4",children:i.jsx(G.CreditsEyebrow,{balanceDollars:u})}),e[24]=u,e[25]=d,e[26]=I):I=e[26];let T;e[27]!==b?(T=b&&i.jsx("div",{className:"mb-4",children:i.jsx(G.NoCreditsEyebrow,{})}),e[27]=b,e[28]=T):T=e[28];let E;e[29]!==x?(E=i.jsxs("p",{className:"text-3xl font-medium text-foreground",children:["What's on your mind, ",x,"?"]}),e[29]=x,e[30]=E):E=e[30];let $;e[31]!==I||e[32]!==T||e[33]!==E?($=i.jsxs("div",{className:"text-center mb-10",children:[I,T,E]}),e[31]=I,e[32]=T,e[33]=E,e[34]=$):$=e[34];let z;e[35]===Symbol.for("react.memo_cache_sentinel")?(z=i.jsx("div",{className:"w-full",children:i.jsx(G.Input,{showConnectionsBanner:!0})}),e[35]=z):z=e[35];let S;e[36]!==$?(S=i.jsxs("div",{className:"flex flex-col items-center w-full max-w-[672px]",children:[$,z]}),e[36]=$,e[37]=S):S=e[37];let h;e[38]===Symbol.for("react.memo_cache_sentinel")?(h=i.jsx("div",{className:"w-full mt-10 mx-auto",children:i.jsx(ge,{})}),e[38]=h):h=e[38];let p;e[39]!==S?(p=i.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center w-full",children:[S,h]}),e[39]=S,e[40]=p):p=e[40];let f;e[41]!==n?(f=n&&i.jsx("div",{className:"absolute bottom-6 left-0 right-0 px-10",children:i.jsx("div",{className:"w-full max-w-[500px] mx-auto",children:i.jsx(he,{onClick:()=>r(!0)})})}),e[41]=n,e[42]=f):f=e[42];let g;e[43]!==p||e[44]!==f?(g=i.jsxs("div",{className:"flex-1 relative flex flex-col items-center px-10",children:[p,f]}),e[43]=p,e[44]=f,e[45]=g):g=e[45];let j;e[46]!==s?(j=i.jsx(oe,{open:s,onOpenChange:r}),e[46]=s,e[47]=j):j=e[47];let A;return e[48]!==g||e[49]!==j?(A=i.jsxs(i.Fragment,{children:[g,j]}),e[48]=g,e[49]=j,e[50]=A):A=e[50],A}function ss(){const e=R.c(2);if(_e()){let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx("div",{className:"flex-1 min-h-0 flex flex-col bg-background overflow-hidden",children:i.jsx(be,{})}),e[0]=r):r=e[0],r}let s;return e[1]===Symbol.for("react.memo_cache_sentinel")?(s=i.jsx("div",{className:"flex-1 min-h-0 p-1.5 overflow-hidden",children:i.jsx("div",{className:"flex h-full flex-col bg-background overflow-hidden card-shadow rounded-[0.75rem]",children:i.jsx(be,{})})}),e[1]=s):s=e[1],s}export{ss 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 Ve,c as le,ba as Rn,n as Ys,K as At,E as os,d as zs,t as Bt}from"./index-BPbpFSlG.js";import{S as Bs}from"./search-input-DzbQ3jIA.js";import{r as is,c as ls,d as cs,e as ds,P as Ue}from"./index-CVT_xMzU.js";import{E as dn}from"./empty-state-Bx9CGRh0.js";import{B as Ke}from"./badge-DHtX06_M.js";import{b as ct,P as dt,a as ut}from"./popover-HGsZ47vz.js";import{T as Mt,a as kt,b as Ct}from"./tooltip-8EMcUk8q.js";import{i as Ht}from"./Check-CmnOcISu.js";import{e as un,c as _t,n as Wn}from"./XCircle-ClvYl5pR.js";import{a as Hs}from"./SearchMd-CrQCxOMr.js";import{i as Vs}from"./Play-DP3It0wz.js";import{W as qs,X as Us,x as Ks,V as Gs}from"./agent-icon-CVuf051c.js";import{M as An}from"./monaco-editor-DZ5QI8uz.js";import{u as Qs}from"./use-members-DWszFm6D.js";import{u as $n}from"./use-connection-Bszp6a5W.js";import{S as mn,u as fn,i as Js,g as Xs,d as Zs}from"./constants-BxcPdAxA.js";import{b as ea}from"./use-virtual-mcp-CAY4xxsA.js";import{n as Ge}from"./Container-D1pwjZQv.js";import{c as ta}from"./XClose-CzeywUWk.js";import{s as na}from"./Plus-BB2q_olj.js";import{s as sa}from"./Trash01-6VDjweik.js";import{I as pt}from"./input-DHBDt0A0.js";import{C as Yn}from"./checkbox-BhLpSvVG.js";import{t as gt}from"./ChevronDown-B7nkAKvX.js";import{d as aa,C as ra,b as zn,e as oa,a as ia,f as la}from"./command-BakvhlkN.js";import{a as Pt,b as Tt,c as Ot,d as Re,S as Ft}from"./select-ThJxxmvQ.js";import{S as ca}from"./scroll-area-PHdLgpTR.js";import{a as da}from"./ZapSquare-DBCGSeVa.js";import{i as ua}from"./ChevronRight-CFgoiwVv.js";import{T as ma}from"./textarea-yE-qQiGr.js";import{C as us}from"./collection-tabs-DRcC41aH.js";import{S as fa}from"./switch-2kbNkhgy.js";import{L as ha}from"./label-D08h5k1R.js";import{I as ze}from"./integration-icon-BsCzD6pa.js";import{A as $t}from"./avatar-C8DSVjWY.js";import{C as ms}from"./card-2PzQvDZe.js";import{K as st}from"./monitoring-stats-row-B44Z4xAF.js";import{c as fs}from"./use-mcp-tools-IbqZtDzy.js";import{g as xa}from"./connection-slug-eyAPH6o3.js";import{u as hs}from"./useSuspenseInfiniteQuery-B_gLWLYH.js";import{T as ke,a as mt,b as hn,c as xn,d as pn,e as ce}from"./table-pY_1blbB.js";import{n as xs}from"./ChevronUp-COT1DfaR.js";import{u as gn}from"./use-infinite-scroll-D4oMTPVQ.js";import{u as pa}from"./useInfiniteQuery-DpFgBC5z.js";import{w as ga,x as va}from"./pair-DK8WArXa.js";import{S as Lt}from"./task-status-CoiJkfnQ.js";import"./X-DosXDblw.js";import"./AlertCircle-CjTfXQMH.js";import"./Tool01-BMc0DiTH.js";import"./Archive-CaJ5kGW4.js";import"./RefreshCcw01-cS3DHDDp.js";import"./ArrowNarrowLeft-SJEHnXyc.js";import"./ArrowUpRight-07AMyW3q.js";import"./Users03-CIbaYGvp.js";import"./CheckCircle-Lywb4tzc.js";import"./DotsVertical-CiKG-O-v.js";import"./Star01-4_ptKeQ0.js";import"./Palette-VwQOwYSo.js";import"./LinkExternal01-B5ftsff4.js";import"./Lock01-BRRKEYOm.js";import"./Sun-DmD9Q3PB.js";import"./Settings02-DVf2OlMW.js";import"./Shield01-B3ECj0f_.js";import"./User01-C8lenn3T.js";import"./Zap-BIo7bCpk.js";import"./index-2dbmNgG2.js";import"./use-org-auth-client-BNkFwsu-.js";import"./use-collections-bP--NcMC.js";import"./index-B4s1crzl.js";import"./index-CxxsJumH.js";import"./infiniteQueryObserver-CXf2zWh1.js";import"./use-copy-CbGC0huz.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./dialog-CSDOHRuZ.js";import"./content-blocks-o63cs2vh.js";import"./types-0qNHrw5h.js";import"./chat-context-BC1CXyf7.js";import"./use-ai-providers-CJfgIRCZ.js";import"./use-decopilot-events-CJqb-CIN.js";import"./create-sse-subscription-CxkOgzKf.js";import"./use-tasks-sf9lm6fu.js";import"./use-organization-settings-DF1zVgfV.js";import"./shell-layout--0UwjzTK.js";import"./required-auth-layout-D-wVBMo_.js";import"./use-org-sso-CqRALwPj.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 Ve,c as le,ba as Rn,n as Ys,K as At,E as os,d as zs,t as Bt}from"./index-DDErZWVi.js";import{S as Bs}from"./search-input-Bv2SSEED.js";import{r as is,c as ls,d as cs,e as ds,P as Ue}from"./index-DdBKKPxs.js";import{E as dn}from"./empty-state-S9xe6i3I.js";import{B as Ke}from"./badge-CA0TtSK-.js";import{b as ct,P as dt,a as ut}from"./popover-DnPkEGaL.js";import{T as Mt,a as kt,b as Ct}from"./tooltip-6l925dLT.js";import{i as Ht}from"./Check-CCt4TdqV.js";import{e as un,c as _t,n as Wn}from"./XCircle-2YGJT4l8.js";import{a as Hs}from"./SearchMd-DRJGWUxm.js";import{i as Vs}from"./Play-hz-Aap6I.js";import{W as qs,X as Us,x as Ks,V as Gs}from"./agent-icon-Byl44fjz.js";import{M as An}from"./monaco-editor-BfP_aqvh.js";import{u as Qs}from"./use-members-LUjEaikV.js";import{u as $n}from"./use-connection-BONz3omb.js";import{S as mn,u as fn,i as Js,g as Xs,d as Zs}from"./constants-RsPwfdJf.js";import{b as ea}from"./use-virtual-mcp-BlO6orHF.js";import{n as Ge}from"./Container-DCeE5VzU.js";import{c as ta}from"./XClose-BKyQhmnE.js";import{s as na}from"./Plus-CMSPc8qr.js";import{s as sa}from"./Trash01-BIkNmKu1.js";import{I as pt}from"./input-mPr-_Wkz.js";import{C as Yn}from"./checkbox-DW6m6j_q.js";import{t as gt}from"./ChevronDown-Bj0_PlcH.js";import{d as aa,C as ra,b as zn,e as oa,a as ia,f as la}from"./command-CBLhLeAX.js";import{a as Pt,b as Tt,c as Ot,d as Re,S as Ft}from"./select-C0jYaD9l.js";import{S as ca}from"./scroll-area-Bi0ICljU.js";import{a as da}from"./ZapSquare-D206qQUt.js";import{i as ua}from"./ChevronRight-C4ssXj8j.js";import{T as ma}from"./textarea-C0unIP9X.js";import{C as us}from"./collection-tabs-CErfHiTV.js";import{S as fa}from"./switch-BoKNT-B-.js";import{L as ha}from"./label-3-gb9Mfh.js";import{I as ze}from"./integration-icon-DBaPSUho.js";import{A as $t}from"./avatar-CWZ0ixfS.js";import{C as ms}from"./card-2C8lyYM4.js";import{K as st}from"./monitoring-stats-row-B51dMYWy.js";import{c as fs}from"./use-mcp-tools-CGp3Yu6f.js";import{g as xa}from"./connection-slug-eyAPH6o3.js";import{u as hs}from"./useSuspenseInfiniteQuery-Lk0XRceb.js";import{T as ke,a as mt,b as hn,c as xn,d as pn,e as ce}from"./table-DUsaq02U.js";import{n as xs}from"./ChevronUp-BX6pOMeY.js";import{u as gn}from"./use-infinite-scroll-CsVuEiLa.js";import{u as pa}from"./useInfiniteQuery-C6j5jRkd.js";import{w as ga,x as va}from"./pair-C0_kf-8-.js";import{S as Lt}from"./task-status-C_r8wvmS.js";import"./X-a6NKB5cR.js";import"./AlertCircle-BJeD5C4R.js";import"./Tool01-CXQadPQ0.js";import"./Archive-YlLF-Utw.js";import"./RefreshCcw01-mHpCJu3a.js";import"./ArrowNarrowLeft-Bxr_bNh3.js";import"./ArrowUpRight-BjngPScU.js";import"./Users03-DvpIbtPT.js";import"./CheckCircle-Bj4ArLnA.js";import"./DotsVertical-dBwy2z8i.js";import"./Star01-CtyYcqs8.js";import"./Palette-C4IIjTNv.js";import"./LinkExternal01-zCvf1EzU.js";import"./Lock01-DiQ4vbxd.js";import"./Sun-DyWU3dmA.js";import"./Settings02-zMTyQvfN.js";import"./Shield01-CyagHvp0.js";import"./User01-DnkItw6o.js";import"./Zap-Cv-p123E.js";import"./index-Cyow5Z3q.js";import"./use-org-auth-client-Bdgc183j.js";import"./use-collections-Clscqpr6.js";import"./index-D_x_9ry-.js";import"./index-Njoumabj.js";import"./infiniteQueryObserver-D8Dut25K.js";import"./use-copy-BMM4g8qh.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./dialog-VeABQIqc.js";import"./content-blocks-o63cs2vh.js";import"./types-063PNzne.js";import"./chat-context-mruWDWkr.js";import"./use-ai-providers-CXJtJ3gs.js";import"./use-decopilot-events-CURKUwZC.js";import"./create-sse-subscription-CxkOgzKf.js";import"./use-tasks-C50wbCHs.js";import"./use-organization-settings-DAE9VhMp.js";import"./shell-layout-tb5uFFJK.js";import"./required-auth-layout-BXiLDjox.js";import"./use-org-sso-ex6uAkHi.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{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-BPbpFSlG.js";import{f as cc,h as uc,n as fc,j as dc,C as hc,A as pc}from"./constants-BxcPdAxA.js";import{B as Ti,c as Pi}from"./collections-CeyUXk8d.js";import{R as Es}from"./index-CxxsJumH.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-DDErZWVi.js";import{f as cc,h as uc,n as fc,j as dc,C as hc,A as pc}from"./constants-RsPwfdJf.js";import{B as Ti,c as Pi}from"./collections-DqQJv3EJ.js";import{R as Es}from"./index-Njoumabj.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": {