decocms 2.285.0 → 2.285.1

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 (406) hide show
  1. package/dist/client/assets/{AlertCircle-0nxz1rX8.js → AlertCircle-Ljx3VIeb.js} +1 -1
  2. package/dist/client/assets/{ArrowNarrowLeft-C2eNhBDd.js → ArrowNarrowLeft-B8YVT66M.js} +1 -1
  3. package/dist/client/assets/{CheckCircle-CkYTxj_S.js → CheckCircle-BFRWTTWo.js} +1 -1
  4. package/dist/client/assets/{ChevronDown-CYzIAmcr.js → ChevronDown-BqFspEzt.js} +1 -1
  5. package/dist/client/assets/{ChevronRight-DeEIl6Ga.js → ChevronRight-DCsBjQ-n.js} +1 -1
  6. package/dist/client/assets/{ChevronUp-MMJijhLH.js → ChevronUp-D7S3j_fa.js} +1 -1
  7. package/dist/client/assets/{Container-Co8nThxH.js → Container-SHbLkl7K.js} +1 -1
  8. package/dist/client/assets/{LinkExternal01-B1CK34My.js → LinkExternal01-XmkIm96u.js} +1 -1
  9. package/dist/client/assets/{Lock01-D0hjzmk2.js → Lock01-CXrm99F-.js} +1 -1
  10. package/dist/client/assets/{Palette-Dk9Jb8jx.js → Palette-B46VjX8F.js} +1 -1
  11. package/dist/client/assets/{Play-BxeG5fNv.js → Play-9pX5w5-3.js} +1 -1
  12. package/dist/client/assets/{Plus-gZScqBbn.js → Plus-Bmk1thjl.js} +1 -1
  13. package/dist/client/assets/{SearchMd-DmmmzJIi.js → SearchMd-VdXbz8fL.js} +1 -1
  14. package/dist/client/assets/{Settings02-BF97-Fnm.js → Settings02-C88OtRRq.js} +1 -1
  15. package/dist/client/assets/{Star01-yc5vq0ru.js → Star01-fuGmPeeu.js} +1 -1
  16. package/dist/client/assets/{Sun-B0IvK7nO.js → Sun-ndN_CHuQ.js} +1 -1
  17. package/dist/client/assets/{Tool01-BtxOSAs7.js → Tool01-DBxgF1Y_.js} +1 -1
  18. package/dist/client/assets/{Trash01-Cv5TKLdc.js → Trash01-BHBjIGXE.js} +1 -1
  19. package/dist/client/assets/{User01-Bm0y4lC0.js → User01-DCiwOMBU.js} +1 -1
  20. package/dist/client/assets/{Users03-BjqYs6sm.js → Users03-Bgfd1KM0.js} +1 -1
  21. package/dist/client/assets/{X-D_cmo_DI.js → X-BWV-b86T.js} +1 -1
  22. package/dist/client/assets/{XCircle-DofWfDB_.js → XCircle-BiHPX6_R.js} +1 -1
  23. package/dist/client/assets/{Zap-MBVwanCx.js → Zap-K9sQXDlC.js} +1 -1
  24. package/dist/client/assets/{ZapSquare-Acx_yvzd.js → ZapSquare-CTcr_tRy.js} +1 -1
  25. package/dist/client/assets/{accordion-Bs6iOXfP.js → accordion-COmeMo5z.js} +1 -1
  26. package/dist/client/assets/{agent-icon-B4FOoeEp.js → agent-icon-DCE-D-qC.js} +1 -1
  27. package/dist/client/assets/{agents-list-CCDumukV.js → agents-list-8_yOp3iD.js} +1 -1
  28. package/dist/client/assets/ai-providers-DxQNSEJT.js +1 -0
  29. package/dist/client/assets/{alert-dialog-CGn0S0CC.js → alert-dialog-DaP8t8su.js} +1 -1
  30. package/dist/client/assets/{auth-catchall-LYMGDHGY.js → auth-catchall-CerK6T4u.js} +1 -1
  31. package/dist/client/assets/{automation-list-row-CKWNl7Xx.js → automation-list-row-BWjwKsQ5.js} +1 -1
  32. package/dist/client/assets/{automations-t-caERGV.js → automations-D6LOd0hH.js} +1 -1
  33. package/dist/client/assets/{avatar-B4iYr4Pn.js → avatar-gTIcZioB.js} +1 -1
  34. package/dist/client/assets/{badge-BKbfqB0P.js → badge-DsWPcX1V.js} +1 -1
  35. package/dist/client/assets/{brand-context-eZ6U4eZs.js → brand-context-CnnwTWNT.js} +1 -1
  36. package/dist/client/assets/{card-C6TLc-pg.js → card-CPVRwbgl.js} +1 -1
  37. package/dist/client/assets/{chat-context-bxvplF3Z.js → chat-context-CZAEwDWp.js} +1 -1
  38. package/dist/client/assets/{checkbox-BafUZKEr.js → checkbox-CPqdqI54.js} +1 -1
  39. package/dist/client/assets/{collection-detail-I5bQPS94.js → collection-detail-BTibo6D3.js} +1 -1
  40. package/dist/client/assets/{collection-display-button-D58wr6x3.js → collection-display-button-CfjJ9SIP.js} +1 -1
  41. package/dist/client/assets/{collection-search-BSwS6tWM.js → collection-search-DgokupF2.js} +1 -1
  42. package/dist/client/assets/{collection-search-_WhBw8st.js → collection-search-lfil19IA.js} +1 -1
  43. package/dist/client/assets/{collection-table-wrapper-DoehWRok.js → collection-table-wrapper-B4l_6tOy.js} +1 -1
  44. package/dist/client/assets/{collection-tabs-Cegi88gO.js → collection-tabs-BRY4wHvH.js} +1 -1
  45. package/dist/client/assets/{collections-CJcBtWs5.js → collections-lJhN2k9k.js} +1 -1
  46. package/dist/client/assets/{command-BDTuhAyF.js → command-BPSv-8-5.js} +1 -1
  47. package/dist/client/assets/{connection-card-pbt5_GMK.js → connection-card-BrctpSfE.js} +1 -1
  48. package/dist/client/assets/{connection-detail-CpUnSGYQ.js → connection-detail-DgKIsKao.js} +1 -1
  49. package/dist/client/assets/{connection-form-helpers-B-iFdAbF.js → connection-form-helpers-C1FnnBdL.js} +1 -1
  50. package/dist/client/assets/{connections-COVM3fme.js → connections-rM_I7gvv.js} +1 -1
  51. package/dist/client/assets/{constants-BgpFj97_.js → constants-D8VkIs2c.js} +1 -1
  52. package/dist/client/assets/{constants-Dp_2h6cY.js → constants-D_Nupw5-.js} +1 -1
  53. package/dist/client/assets/{dialog-BlDJEasr.js → dialog-BOagZAx2.js} +1 -1
  54. package/dist/client/assets/{drawer-n2769KGk.js → drawer-BRUzFEdi.js} +1 -1
  55. package/dist/client/assets/{dropdown-menu-DwLxT3z1.js → dropdown-menu-DO26Q0bD.js} +1 -1
  56. package/dist/client/assets/{dynamic-plugin-layout-D7LPOea8.js → dynamic-plugin-layout-ltkevohS.js} +1 -1
  57. package/dist/client/assets/{empty-state-Di9idjlO.js → empty-state-BokLRSGE.js} +1 -1
  58. package/dist/client/assets/{empty-state-CCV3q11p.js → empty-state-DCK4Z2GX.js} +1 -1
  59. package/dist/client/assets/{extract-connection-data-BkZ-2zmr.js → extract-connection-data-V-eInhlP.js} +1 -1
  60. package/dist/client/assets/{features-BnFC3Zii.js → features-DIBFVG_b.js} +1 -1
  61. package/dist/client/assets/{form-2LsJQI5E.js → form-DHQjt1Tk.js} +1 -1
  62. package/dist/client/assets/{general-gsvbF_Za.js → general-VnUbEBHT.js} +1 -1
  63. package/dist/client/assets/{github-repo-picker-DnkATBdp.js → github-repo-picker-CIYxcUMn.js} +1 -1
  64. package/dist/client/assets/{index-CWVXiaiz.js → index-BWvVdWtP.js} +1 -1
  65. package/dist/client/assets/{index-DHvfV22T.js → index-CNolBSVE.js} +2 -2
  66. package/dist/client/assets/{index-BqgOT0Li.js → index-DWOvEgKr.js} +1 -1
  67. package/dist/client/assets/{index-BZMU1-Zz.js → index-DbNFtLRR.js} +1 -1
  68. package/dist/client/assets/{index-CYT7K8Th.js → index-Di0ylaLI.js} +1 -1
  69. package/dist/client/assets/{index-DAwDZKfR.js → index-DvxSs9Po.js} +1 -1
  70. package/dist/client/assets/{index-BXweTbWN.js → index-PT6VRyBL.js} +1 -1
  71. package/dist/client/assets/{index-DGbBxceU.js → index-gfedyrlZ.js} +25 -25
  72. package/dist/client/assets/{index-DRvZCWzg.js → index-sYNl3b-7.js} +1 -1
  73. package/dist/client/assets/{index-D748RB59.js → index-uSGXbgq4.js} +1 -1
  74. package/dist/client/assets/{infiniteQueryObserver-BgQN01Hf.js → infiniteQueryObserver-B8q-YDXm.js} +1 -1
  75. package/dist/client/assets/{input-CDeKOB27.js → input-B8j75XZ_.js} +1 -1
  76. package/dist/client/assets/{integration-icon-CI13mmaS.js → integration-icon-De50Mm7k.js} +1 -1
  77. package/dist/client/assets/{label-CnjZ_mJO.js → label-KH35YAYU.js} +1 -1
  78. package/dist/client/assets/{layout-BiEb87aZ.js → layout-E2py7rYQ.js} +1 -1
  79. package/dist/client/assets/{login-BfsLvipz.js → login-agOBj-o2.js} +1 -1
  80. package/dist/client/assets/{members-COWr_hPe.js → members-6PieW-Nu.js} +1 -1
  81. package/dist/client/assets/{monaco-editor-CtX0YP6U.js → monaco-editor-CzAT2DWn.js} +1 -1
  82. package/dist/client/assets/{monitoring-stats-row-BQ4J0Yec.js → monitoring-stats-row-k0blCMgl.js} +1 -1
  83. package/dist/client/assets/{oauth-callback-BN4EOUXR.js → oauth-callback-ViEW-3g2.js} +1 -1
  84. package/dist/client/assets/{oauth-callback-ai-provider-BaqShyIl.js → oauth-callback-ai-provider-cSZy9hW7.js} +1 -1
  85. package/dist/client/assets/{onboarding-DsfytkRm.js → onboarding-CquRdW5q.js} +1 -1
  86. package/dist/client/assets/{org-layout-BfWUJisr.js → org-layout-DY9vqUg9.js} +1 -1
  87. package/dist/client/assets/{org-plugin-layout-BBYslPfT.js → org-plugin-layout-HyePbhDN.js} +1 -1
  88. package/dist/client/assets/{plugin-empty-state-B5LlIWxc.js → plugin-empty-state-tSKwN8yW.js} +1 -1
  89. package/dist/client/assets/{plugin-header-Bk48Ukf6.js → plugin-header-CgMEgROC.js} +1 -1
  90. package/dist/client/assets/{plugin-layout-BKF_beSo.js → plugin-layout-B0f9qTk_.js} +1 -1
  91. package/dist/client/assets/{popover-xVRU-oRu.js → popover-BK6PL-XB.js} +1 -1
  92. package/dist/client/assets/{profile-D-jM1gw3.js → profile-C_xBhvj7.js} +1 -1
  93. package/dist/client/assets/{project-app-view-CjbRHagh.js → project-app-view-EMrqjiux.js} +1 -1
  94. package/dist/client/assets/registry-CYL2cMC0.js +2 -0
  95. package/dist/client/assets/{registry-layout-DnwI9vdC.js → registry-layout-7nSgT8Ua.js} +1 -1
  96. package/dist/client/assets/{required-auth-layout-B1r3oQ4H.js → required-auth-layout-D-NWWr5P.js} +1 -1
  97. package/dist/client/assets/{reset-password-DSTvsN7x.js → reset-password-C7m0cAdE.js} +1 -1
  98. package/dist/client/assets/{scroll-area-D5mZ0hRE.js → scroll-area-Da2hNrch.js} +1 -1
  99. package/dist/client/assets/{search-input-Dq6mcRO6.js → search-input-BZmdDW7A.js} +1 -1
  100. package/dist/client/assets/{select-DVBzN73v.js → select-JPYD20it.js} +1 -1
  101. package/dist/client/assets/{select-model-CT_wRRZk.js → select-model-DMVU-2Gx.js} +1 -1
  102. package/dist/client/assets/{settings-layout-D70kmFKJ.js → settings-layout-hwviWS6Q.js} +1 -1
  103. package/dist/client/assets/{shell-layout-DaX2wZ77.js → shell-layout-DkN8Q_tp.js} +1 -1
  104. package/dist/client/assets/{skeleton-BZGew3qV.js → skeleton-DPqifXUx.js} +1 -1
  105. package/dist/client/assets/{sso-CSm1qVA0.js → sso-BdiVJFM8.js} +1 -1
  106. package/dist/client/assets/{store-BLxzwqyY.js → store-D9lb1Gph.js} +1 -1
  107. package/dist/client/assets/store-registry-DAeO63_G.js +2 -0
  108. package/dist/client/assets/{switch-DhZAgC2R.js → switch-CVtXvreH.js} +1 -1
  109. package/dist/client/assets/{table-PpA3iGsP.js → table-C-JSrHQJ.js} +1 -1
  110. package/dist/client/assets/{tabs-CqvMN_xV.js → tabs-DtgWLQ6i.js} +1 -1
  111. package/dist/client/assets/{task-status-fLMf5O9c.js → task-status-DTuLfGhm.js} +1 -1
  112. package/dist/client/assets/{textarea-8UV3LDMX.js → textarea-p_oNKH-r.js} +1 -1
  113. package/dist/client/assets/{toggle-group-Brc7WatS.js → toggle-group-B6-etMEh.js} +1 -1
  114. package/dist/client/assets/{tools-list-BbeD_D_r.js → tools-list-C0RCBhOc.js} +1 -1
  115. package/dist/client/assets/{types-C318llZ2.js → types-BP7V6N8z.js} +1 -1
  116. package/dist/client/assets/{use-ai-providers-Do6DYo3A.js → use-ai-providers-oN1cKhaJ.js} +1 -1
  117. package/dist/client/assets/{use-collections-B6b08eGL.js → use-collections-BTXUmiDi.js} +1 -1
  118. package/dist/client/assets/{use-connection-B4n7P5ZX.js → use-connection-DIvNoxL5.js} +1 -1
  119. package/dist/client/assets/{use-copy-D_fZmQan.js → use-copy-D8L6lrfC.js} +1 -1
  120. package/dist/client/assets/{use-create-virtual-mcp-jrLS8Jsa.js → use-create-virtual-mcp-DUKkySGS.js} +1 -1
  121. package/dist/client/assets/{use-decopilot-events-BaTABZmJ.js → use-decopilot-events-BRc3SX00.js} +1 -1
  122. package/dist/client/assets/{use-delete-connection-CRBBtM2M.js → use-delete-connection-IDpzSpRp.js} +1 -1
  123. package/dist/client/assets/{use-infinite-scroll-E-ClEQ_w.js → use-infinite-scroll-WKRKMI2J.js} +1 -1
  124. package/dist/client/assets/{use-list-state-DueB6o1G.js → use-list-state-Dyh2zhb9.js} +1 -1
  125. package/dist/client/assets/{use-mcp-tools-BGEi8TMH.js → use-mcp-tools-tZ37UBLL.js} +1 -1
  126. package/dist/client/assets/{use-members-C-n0fYdD.js → use-members-AvAHjkiq.js} +1 -1
  127. package/dist/client/assets/{use-mobile-DHF6z3l-.js → use-mobile-Ctb5URy7.js} +1 -1
  128. package/dist/client/assets/{use-navigate-to-agent-CVVCVmb_.js → use-navigate-to-agent-CLfSU3ru.js} +1 -1
  129. package/dist/client/assets/{use-org-sso-CVSlB5eM.js → use-org-sso-CmuM4ieo.js} +1 -1
  130. package/dist/client/assets/{use-organization-settings-hZWDePgg.js → use-organization-settings-dQpmtQzl.js} +1 -1
  131. package/dist/client/assets/{use-registry-connections-DE87auCx.js → use-registry-connections-CP0QI7iA.js} +1 -1
  132. package/dist/client/assets/{use-status-sounds-DmiUFixH.js → use-status-sounds-CObwI0DY.js} +1 -1
  133. package/dist/client/assets/{use-tasks-BtKmvszc.js → use-tasks-7rX1bsHL.js} +1 -1
  134. package/dist/client/assets/{use-view-mode-C4RBFxYO.js → use-view-mode-BkbloGkm.js} +1 -1
  135. package/dist/client/assets/{use-virtual-mcp-ByUoWLLO.js → use-virtual-mcp-CDOk_IIy.js} +1 -1
  136. package/dist/client/assets/useInfiniteQuery-Ci00Hw-m.js +1 -0
  137. package/dist/client/assets/{user-xlREBAPA.js → user-lj8QRtGG.js} +1 -1
  138. package/dist/client/assets/{view-mode-toggle-DhKikjfW.js → view-mode-toggle-BiPtlB_S.js} +1 -1
  139. package/dist/client/assets/{workflow-Z523A-0v.js → workflow-BrBlpNSn.js} +1 -1
  140. package/dist/client/assets/workflow-detail-NqGVn5hy.js +1 -0
  141. package/dist/client/index.html +1 -1
  142. package/dist/server/cli.js +1 -1
  143. package/dist/server/node_modules/{postgres-interval/license → pg/LICENSE} +6 -6
  144. package/dist/server/node_modules/pg/README.md +95 -0
  145. package/dist/server/node_modules/pg/esm/index.mjs +20 -0
  146. package/dist/server/node_modules/pg/lib/client.js +743 -0
  147. package/dist/server/node_modules/pg/lib/connection-parameters.js +171 -0
  148. package/dist/server/node_modules/pg/lib/connection.js +221 -0
  149. package/dist/server/node_modules/pg/lib/crypto/cert-signatures.js +122 -0
  150. package/dist/server/node_modules/pg/lib/crypto/sasl.js +212 -0
  151. package/dist/server/node_modules/pg/lib/crypto/utils-legacy.js +43 -0
  152. package/dist/server/node_modules/pg/lib/crypto/utils-webcrypto.js +89 -0
  153. package/dist/server/node_modules/pg/lib/crypto/utils.js +9 -0
  154. package/dist/server/node_modules/pg/lib/defaults.js +91 -0
  155. package/dist/server/node_modules/pg/lib/index.js +73 -0
  156. package/dist/server/node_modules/pg/lib/native/client.js +323 -0
  157. package/dist/server/node_modules/pg/lib/native/index.js +2 -0
  158. package/dist/server/node_modules/pg/lib/native/query.js +165 -0
  159. package/dist/server/node_modules/pg/lib/query.js +252 -0
  160. package/dist/server/node_modules/pg/lib/result.js +109 -0
  161. package/dist/server/node_modules/pg/lib/stream.js +83 -0
  162. package/dist/server/node_modules/pg/lib/type-overrides.js +35 -0
  163. package/dist/server/node_modules/pg/lib/utils.js +217 -0
  164. package/dist/server/node_modules/pg/package.json +76 -0
  165. package/package.json +1 -1
  166. package/dist/client/assets/ai-providers-DmtetLwH.js +0 -1
  167. package/dist/client/assets/registry-iJ2QFmg-.js +0 -2
  168. package/dist/client/assets/store-registry-BdrjcFsM.js +0 -2
  169. package/dist/client/assets/useInfiniteQuery-m9L0mxCO.js +0 -1
  170. package/dist/client/assets/workflow-detail-CLjOJ-4m.js +0 -1
  171. package/dist/server/node_modules/figures/index.d.ts +0 -279
  172. package/dist/server/node_modules/figures/index.js +0 -292
  173. package/dist/server/node_modules/figures/license +0 -9
  174. package/dist/server/node_modules/figures/package.json +0 -49
  175. package/dist/server/node_modules/figures/readme.md +0 -337
  176. package/dist/server/node_modules/ink/build/ansi-tokenizer.d.ts +0 -38
  177. package/dist/server/node_modules/ink/build/ansi-tokenizer.js +0 -316
  178. package/dist/server/node_modules/ink/build/ansi-tokenizer.js.map +0 -1
  179. package/dist/server/node_modules/ink/build/apply-styles.js +0 -175
  180. package/dist/server/node_modules/ink/build/build-layout.js +0 -77
  181. package/dist/server/node_modules/ink/build/calculate-wrapped-text.js +0 -53
  182. package/dist/server/node_modules/ink/build/colorize.d.ts +0 -3
  183. package/dist/server/node_modules/ink/build/colorize.js +0 -48
  184. package/dist/server/node_modules/ink/build/colorize.js.map +0 -1
  185. package/dist/server/node_modules/ink/build/components/AccessibilityContext.d.ts +0 -3
  186. package/dist/server/node_modules/ink/build/components/AccessibilityContext.js +0 -5
  187. package/dist/server/node_modules/ink/build/components/AccessibilityContext.js.map +0 -1
  188. package/dist/server/node_modules/ink/build/components/App.d.ts +0 -18
  189. package/dist/server/node_modules/ink/build/components/App.js +0 -351
  190. package/dist/server/node_modules/ink/build/components/App.js.map +0 -1
  191. package/dist/server/node_modules/ink/build/components/AppContext.d.ts +0 -15
  192. package/dist/server/node_modules/ink/build/components/AppContext.js +0 -11
  193. package/dist/server/node_modules/ink/build/components/AppContext.js.map +0 -1
  194. package/dist/server/node_modules/ink/build/components/BackgroundContext.d.ts +0 -4
  195. package/dist/server/node_modules/ink/build/components/BackgroundContext.js +0 -3
  196. package/dist/server/node_modules/ink/build/components/BackgroundContext.js.map +0 -1
  197. package/dist/server/node_modules/ink/build/components/Box.d.ts +0 -117
  198. package/dist/server/node_modules/ink/build/components/Box.js +0 -34
  199. package/dist/server/node_modules/ink/build/components/Box.js.map +0 -1
  200. package/dist/server/node_modules/ink/build/components/Color.js +0 -62
  201. package/dist/server/node_modules/ink/build/components/Cursor.d.ts +0 -83
  202. package/dist/server/node_modules/ink/build/components/Cursor.js +0 -53
  203. package/dist/server/node_modules/ink/build/components/Cursor.js.map +0 -1
  204. package/dist/server/node_modules/ink/build/components/CursorContext.d.ts +0 -11
  205. package/dist/server/node_modules/ink/build/components/CursorContext.js +0 -8
  206. package/dist/server/node_modules/ink/build/components/CursorContext.js.map +0 -1
  207. package/dist/server/node_modules/ink/build/components/ErrorBoundary.d.ts +0 -18
  208. package/dist/server/node_modules/ink/build/components/ErrorBoundary.js +0 -23
  209. package/dist/server/node_modules/ink/build/components/ErrorBoundary.js.map +0 -1
  210. package/dist/server/node_modules/ink/build/components/ErrorOverview.d.ts +0 -6
  211. package/dist/server/node_modules/ink/build/components/ErrorOverview.js +0 -84
  212. package/dist/server/node_modules/ink/build/components/ErrorOverview.js.map +0 -1
  213. package/dist/server/node_modules/ink/build/components/FocusContext.d.ts +0 -16
  214. package/dist/server/node_modules/ink/build/components/FocusContext.js +0 -17
  215. package/dist/server/node_modules/ink/build/components/FocusContext.js.map +0 -1
  216. package/dist/server/node_modules/ink/build/components/Newline.d.ts +0 -13
  217. package/dist/server/node_modules/ink/build/components/Newline.js +0 -8
  218. package/dist/server/node_modules/ink/build/components/Newline.js.map +0 -1
  219. package/dist/server/node_modules/ink/build/components/Spacer.d.ts +0 -7
  220. package/dist/server/node_modules/ink/build/components/Spacer.js +0 -11
  221. package/dist/server/node_modules/ink/build/components/Spacer.js.map +0 -1
  222. package/dist/server/node_modules/ink/build/components/Static.d.ts +0 -24
  223. package/dist/server/node_modules/ink/build/components/Static.js +0 -28
  224. package/dist/server/node_modules/ink/build/components/Static.js.map +0 -1
  225. package/dist/server/node_modules/ink/build/components/StderrContext.d.ts +0 -15
  226. package/dist/server/node_modules/ink/build/components/StderrContext.js +0 -13
  227. package/dist/server/node_modules/ink/build/components/StderrContext.js.map +0 -1
  228. package/dist/server/node_modules/ink/build/components/StdinContext.d.ts +0 -22
  229. package/dist/server/node_modules/ink/build/components/StdinContext.js +0 -19
  230. package/dist/server/node_modules/ink/build/components/StdinContext.js.map +0 -1
  231. package/dist/server/node_modules/ink/build/components/StdoutContext.d.ts +0 -15
  232. package/dist/server/node_modules/ink/build/components/StdoutContext.js +0 -13
  233. package/dist/server/node_modules/ink/build/components/StdoutContext.js.map +0 -1
  234. package/dist/server/node_modules/ink/build/components/Text.d.ts +0 -55
  235. package/dist/server/node_modules/ink/build/components/Text.js +0 -50
  236. package/dist/server/node_modules/ink/build/components/Text.js.map +0 -1
  237. package/dist/server/node_modules/ink/build/components/Transform.d.ts +0 -16
  238. package/dist/server/node_modules/ink/build/components/Transform.js +0 -15
  239. package/dist/server/node_modules/ink/build/components/Transform.js.map +0 -1
  240. package/dist/server/node_modules/ink/build/cursor-helpers.d.ts +0 -38
  241. package/dist/server/node_modules/ink/build/cursor-helpers.js +0 -56
  242. package/dist/server/node_modules/ink/build/cursor-helpers.js.map +0 -1
  243. package/dist/server/node_modules/ink/build/devtools-window-polyfill.d.ts +0 -1
  244. package/dist/server/node_modules/ink/build/devtools-window-polyfill.js +0 -65
  245. package/dist/server/node_modules/ink/build/devtools-window-polyfill.js.map +0 -1
  246. package/dist/server/node_modules/ink/build/devtools.d.ts +0 -1
  247. package/dist/server/node_modules/ink/build/devtools.js +0 -11
  248. package/dist/server/node_modules/ink/build/devtools.js.map +0 -1
  249. package/dist/server/node_modules/ink/build/dom.d.ts +0 -56
  250. package/dist/server/node_modules/ink/build/dom.js +0 -124
  251. package/dist/server/node_modules/ink/build/dom.js.map +0 -1
  252. package/dist/server/node_modules/ink/build/experimental/apply-style.js +0 -140
  253. package/dist/server/node_modules/ink/build/experimental/dom.js +0 -123
  254. package/dist/server/node_modules/ink/build/experimental/output.js +0 -91
  255. package/dist/server/node_modules/ink/build/experimental/reconciler.js +0 -141
  256. package/dist/server/node_modules/ink/build/experimental/renderer.js +0 -81
  257. package/dist/server/node_modules/ink/build/get-max-width.d.ts +0 -3
  258. package/dist/server/node_modules/ink/build/get-max-width.js +0 -10
  259. package/dist/server/node_modules/ink/build/get-max-width.js.map +0 -1
  260. package/dist/server/node_modules/ink/build/hooks/use-app.d.ts +0 -5
  261. package/dist/server/node_modules/ink/build/hooks/use-app.js +0 -8
  262. package/dist/server/node_modules/ink/build/hooks/use-app.js.map +0 -1
  263. package/dist/server/node_modules/ink/build/hooks/use-cursor.d.ts +0 -12
  264. package/dist/server/node_modules/ink/build/hooks/use-cursor.js +0 -29
  265. package/dist/server/node_modules/ink/build/hooks/use-cursor.js.map +0 -1
  266. package/dist/server/node_modules/ink/build/hooks/use-focus-manager.d.ts +0 -28
  267. package/dist/server/node_modules/ink/build/hooks/use-focus-manager.js +0 -17
  268. package/dist/server/node_modules/ink/build/hooks/use-focus-manager.js.map +0 -1
  269. package/dist/server/node_modules/ink/build/hooks/use-focus.d.ts +0 -29
  270. package/dist/server/node_modules/ink/build/hooks/use-focus.js +0 -42
  271. package/dist/server/node_modules/ink/build/hooks/use-focus.js.map +0 -1
  272. package/dist/server/node_modules/ink/build/hooks/use-input.d.ts +0 -131
  273. package/dist/server/node_modules/ink/build/hooks/use-input.js +0 -124
  274. package/dist/server/node_modules/ink/build/hooks/use-input.js.map +0 -1
  275. package/dist/server/node_modules/ink/build/hooks/use-is-screen-reader-enabled.d.ts +0 -5
  276. package/dist/server/node_modules/ink/build/hooks/use-is-screen-reader-enabled.js +0 -11
  277. package/dist/server/node_modules/ink/build/hooks/use-is-screen-reader-enabled.js.map +0 -1
  278. package/dist/server/node_modules/ink/build/hooks/use-stderr.d.ts +0 -5
  279. package/dist/server/node_modules/ink/build/hooks/use-stderr.js +0 -8
  280. package/dist/server/node_modules/ink/build/hooks/use-stderr.js.map +0 -1
  281. package/dist/server/node_modules/ink/build/hooks/use-stdin.d.ts +0 -5
  282. package/dist/server/node_modules/ink/build/hooks/use-stdin.js +0 -8
  283. package/dist/server/node_modules/ink/build/hooks/use-stdin.js.map +0 -1
  284. package/dist/server/node_modules/ink/build/hooks/use-stdout.d.ts +0 -5
  285. package/dist/server/node_modules/ink/build/hooks/use-stdout.js +0 -8
  286. package/dist/server/node_modules/ink/build/hooks/use-stdout.js.map +0 -1
  287. package/dist/server/node_modules/ink/build/hooks/useInput.js +0 -38
  288. package/dist/server/node_modules/ink/build/index.d.ts +0 -34
  289. package/dist/server/node_modules/ink/build/index.js +0 -20
  290. package/dist/server/node_modules/ink/build/index.js.map +0 -1
  291. package/dist/server/node_modules/ink/build/ink.d.ts +0 -90
  292. package/dist/server/node_modules/ink/build/ink.js +0 -637
  293. package/dist/server/node_modules/ink/build/ink.js.map +0 -1
  294. package/dist/server/node_modules/ink/build/input-parser.d.ts +0 -7
  295. package/dist/server/node_modules/ink/build/input-parser.js +0 -154
  296. package/dist/server/node_modules/ink/build/input-parser.js.map +0 -1
  297. package/dist/server/node_modules/ink/build/instance.js +0 -205
  298. package/dist/server/node_modules/ink/build/instances.d.ts +0 -3
  299. package/dist/server/node_modules/ink/build/instances.js +0 -8
  300. package/dist/server/node_modules/ink/build/instances.js.map +0 -1
  301. package/dist/server/node_modules/ink/build/kitty-keyboard.d.ts +0 -23
  302. package/dist/server/node_modules/ink/build/kitty-keyboard.js +0 -32
  303. package/dist/server/node_modules/ink/build/kitty-keyboard.js.map +0 -1
  304. package/dist/server/node_modules/ink/build/layout.d.ts +0 -7
  305. package/dist/server/node_modules/ink/build/layout.js +0 -33
  306. package/dist/server/node_modules/ink/build/layout.js.map +0 -1
  307. package/dist/server/node_modules/ink/build/log-update.d.ts +0 -19
  308. package/dist/server/node_modules/ink/build/log-update.js +0 -242
  309. package/dist/server/node_modules/ink/build/log-update.js.map +0 -1
  310. package/dist/server/node_modules/ink/build/measure-element.d.ts +0 -16
  311. package/dist/server/node_modules/ink/build/measure-element.js +0 -9
  312. package/dist/server/node_modules/ink/build/measure-element.js.map +0 -1
  313. package/dist/server/node_modules/ink/build/measure-text.d.ts +0 -6
  314. package/dist/server/node_modules/ink/build/measure-text.js +0 -21
  315. package/dist/server/node_modules/ink/build/measure-text.js.map +0 -1
  316. package/dist/server/node_modules/ink/build/options.d.ts +0 -52
  317. package/dist/server/node_modules/ink/build/options.js +0 -2
  318. package/dist/server/node_modules/ink/build/options.js.map +0 -1
  319. package/dist/server/node_modules/ink/build/output.d.ts +0 -35
  320. package/dist/server/node_modules/ink/build/output.js +0 -183
  321. package/dist/server/node_modules/ink/build/output.js.map +0 -1
  322. package/dist/server/node_modules/ink/build/parse-keypress.d.ts +0 -22
  323. package/dist/server/node_modules/ink/build/parse-keypress.js +0 -493
  324. package/dist/server/node_modules/ink/build/parse-keypress.js.map +0 -1
  325. package/dist/server/node_modules/ink/build/reconciler.d.ts +0 -4
  326. package/dist/server/node_modules/ink/build/reconciler.js +0 -274
  327. package/dist/server/node_modules/ink/build/reconciler.js.map +0 -1
  328. package/dist/server/node_modules/ink/build/render-background.d.ts +0 -4
  329. package/dist/server/node_modules/ink/build/render-background.js +0 -25
  330. package/dist/server/node_modules/ink/build/render-background.js.map +0 -1
  331. package/dist/server/node_modules/ink/build/render-border.d.ts +0 -4
  332. package/dist/server/node_modules/ink/build/render-border.js +0 -73
  333. package/dist/server/node_modules/ink/build/render-border.js.map +0 -1
  334. package/dist/server/node_modules/ink/build/render-node-to-output.d.ts +0 -14
  335. package/dist/server/node_modules/ink/build/render-node-to-output.js +0 -147
  336. package/dist/server/node_modules/ink/build/render-node-to-output.js.map +0 -1
  337. package/dist/server/node_modules/ink/build/render-to-string.d.ts +0 -38
  338. package/dist/server/node_modules/ink/build/render-to-string.js +0 -115
  339. package/dist/server/node_modules/ink/build/render-to-string.js.map +0 -1
  340. package/dist/server/node_modules/ink/build/render.d.ts +0 -121
  341. package/dist/server/node_modules/ink/build/render.js +0 -55
  342. package/dist/server/node_modules/ink/build/render.js.map +0 -1
  343. package/dist/server/node_modules/ink/build/renderer.d.ts +0 -8
  344. package/dist/server/node_modules/ink/build/renderer.js +0 -55
  345. package/dist/server/node_modules/ink/build/renderer.js.map +0 -1
  346. package/dist/server/node_modules/ink/build/sanitize-ansi.d.ts +0 -2
  347. package/dist/server/node_modules/ink/build/sanitize-ansi.js +0 -27
  348. package/dist/server/node_modules/ink/build/sanitize-ansi.js.map +0 -1
  349. package/dist/server/node_modules/ink/build/screen-reader-update.d.ts +0 -13
  350. package/dist/server/node_modules/ink/build/screen-reader-update.js +0 -38
  351. package/dist/server/node_modules/ink/build/screen-reader-update.js.map +0 -1
  352. package/dist/server/node_modules/ink/build/squash-text-nodes.d.ts +0 -3
  353. package/dist/server/node_modules/ink/build/squash-text-nodes.js +0 -36
  354. package/dist/server/node_modules/ink/build/squash-text-nodes.js.map +0 -1
  355. package/dist/server/node_modules/ink/build/styles.d.ts +0 -240
  356. package/dist/server/node_modules/ink/build/styles.js +0 -232
  357. package/dist/server/node_modules/ink/build/styles.js.map +0 -1
  358. package/dist/server/node_modules/ink/build/utils.d.ts +0 -2
  359. package/dist/server/node_modules/ink/build/utils.js +0 -4
  360. package/dist/server/node_modules/ink/build/utils.js.map +0 -1
  361. package/dist/server/node_modules/ink/build/wrap-text.d.ts +0 -3
  362. package/dist/server/node_modules/ink/build/wrap-text.js +0 -31
  363. package/dist/server/node_modules/ink/build/wrap-text.js.map +0 -1
  364. package/dist/server/node_modules/ink/build/write-synchronized.d.ts +0 -4
  365. package/dist/server/node_modules/ink/build/write-synchronized.js +0 -7
  366. package/dist/server/node_modules/ink/build/write-synchronized.js.map +0 -1
  367. package/dist/server/node_modules/ink/license +0 -10
  368. package/dist/server/node_modules/ink/package.json +0 -201
  369. package/dist/server/node_modules/ink/readme.md +0 -2636
  370. package/dist/server/node_modules/mimic-fn/index.d.ts +0 -54
  371. package/dist/server/node_modules/mimic-fn/index.js +0 -13
  372. package/dist/server/node_modules/mimic-fn/license +0 -9
  373. package/dist/server/node_modules/mimic-fn/package.json +0 -42
  374. package/dist/server/node_modules/mimic-fn/readme.md +0 -69
  375. package/dist/server/node_modules/onetime/index.d.ts +0 -64
  376. package/dist/server/node_modules/onetime/index.js +0 -44
  377. package/dist/server/node_modules/onetime/license +0 -9
  378. package/dist/server/node_modules/onetime/package.json +0 -43
  379. package/dist/server/node_modules/onetime/readme.md +0 -94
  380. package/dist/server/node_modules/pg-int8/LICENSE +0 -13
  381. package/dist/server/node_modules/pg-int8/README.md +0 -16
  382. package/dist/server/node_modules/pg-int8/index.js +0 -100
  383. package/dist/server/node_modules/pg-int8/package.json +0 -24
  384. package/dist/server/node_modules/postgres-array/index.d.ts +0 -4
  385. package/dist/server/node_modules/postgres-array/index.js +0 -97
  386. package/dist/server/node_modules/postgres-array/license +0 -21
  387. package/dist/server/node_modules/postgres-array/package.json +0 -35
  388. package/dist/server/node_modules/postgres-array/readme.md +0 -43
  389. package/dist/server/node_modules/postgres-bytea/index.js +0 -33
  390. package/dist/server/node_modules/postgres-bytea/license +0 -21
  391. package/dist/server/node_modules/postgres-bytea/package.json +0 -34
  392. package/dist/server/node_modules/postgres-bytea/readme.md +0 -34
  393. package/dist/server/node_modules/postgres-date/index.js +0 -116
  394. package/dist/server/node_modules/postgres-date/license +0 -21
  395. package/dist/server/node_modules/postgres-date/package.json +0 -33
  396. package/dist/server/node_modules/postgres-date/readme.md +0 -49
  397. package/dist/server/node_modules/postgres-interval/index.d.ts +0 -20
  398. package/dist/server/node_modules/postgres-interval/index.js +0 -125
  399. package/dist/server/node_modules/postgres-interval/package.json +0 -36
  400. package/dist/server/node_modules/postgres-interval/readme.md +0 -48
  401. package/dist/server/node_modules/split2/LICENSE +0 -13
  402. package/dist/server/node_modules/split2/README.md +0 -85
  403. package/dist/server/node_modules/split2/bench.js +0 -27
  404. package/dist/server/node_modules/split2/index.js +0 -141
  405. package/dist/server/node_modules/split2/package.json +0 -39
  406. package/dist/server/node_modules/split2/test.js +0 -409
@@ -1 +1 @@
1
- import{bV as b,e as f,j as c,aB as C,r as d,c as p,aY as j,bW as v,bX as h}from"./index-DHvfV22T.js";import{L as N}from"./label-CnjZ_mJO.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{E as F,M as a,w as b,L as c,P as d,R as e,y as f};
1
+ import{bV as b,e as f,j as c,aB as C,r as d,c as p,aY as j,bW as v,bX as h}from"./index-CNolBSVE.js";import{L as N}from"./label-KH35YAYU.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{E as F,M as a,w as b,L as c,P as d,R as e,y as f};
@@ -1 +1 @@
1
- import{e as G,r as J,z as T,j as s,B as M,f as pe,s as ce,o as de,x as je,w as be,a as W,t as q,K as Z,b as me,v as ve,y as se,n as Ne,c as ye,aD as Se}from"./index-DHvfV22T.js";import{P as Q}from"./index-BXweTbWN.js";import{C as Y,b as X,c as ee,a as te,d as ue,e as _e}from"./card-C6TLc-pg.js";import{I as oe}from"./input-CDeKOB27.js";import{L as B}from"./label-CnjZ_mJO.js";import{c as Ce}from"./XCircle-DofWfDB_.js";import{i as fe}from"./X-D_cmo_DI.js";import{u as V}from"./unwrap-tool-result-BYXdCQMg.js";import{S as we,u as ze,W as ie,i as De}from"./constants-BgpFj97_.js";import{S as Ae}from"./switch-DhZAgC2R.js";import{u as Ee,a as le,D as Ie,c as Pe,S as ke,v as Oe,K as Te,P as Fe,d as Re,C as Le,s as Me,b as $e,e as qe}from"./collection-search-_WhBw8st.js";import{u as ge}from"./use-virtual-mcp-ByUoWLLO.js";import{b as Ge,P as Ke,a as Ue}from"./popover-xVRU-oRu.js";import{S as He}from"./skeleton-BZGew3qV.js";import{T as Be}from"./agent-icon-B4FOoeEp.js";import{s as Je}from"./Plus-gZScqBbn.js";import{a as xe}from"./Users03-BjqYs6sm.js";import{I as ae}from"./integration-icon-CI13mmaS.js";import{u as Qe,c as Ve}from"./use-organization-settings-hZWDePgg.js";import"./use-mobile-DHF6z3l-.js";import"./SearchMd-DmmmzJIi.js";import"./use-collections-B6b08eGL.js";import"./AlertCircle-0nxz1rX8.js";import"./Tool01-BtxOSAs7.js";import"./ArrowNarrowLeft-C2eNhBDd.js";import"./ZapSquare-Acx_yvzd.js";import"./CheckCircle-CkYTxj_S.js";import"./ChevronDown-CYzIAmcr.js";import"./ChevronRight-DeEIl6Ga.js";import"./ChevronUp-MMJijhLH.js";import"./Container-Co8nThxH.js";import"./Star01-yc5vq0ru.js";import"./Palette-Dk9Jb8jx.js";import"./LinkExternal01-B1CK34My.js";import"./Lock01-D0hjzmk2.js";import"./Sun-B0IvK7nO.js";import"./Play-BxeG5fNv.js";import"./Settings02-BF97-Fnm.js";import"./Trash01-Cv5TKLdc.js";import"./User01-Bm0y4lC0.js";import"./Zap-MBVwanCx.js";function We(t){const e=G.c(28),{value:i,onChange:o,name:p,disabled:a}=t,n=J.useRef(null);let C;e[0]!==o?(C=b=>{const w=b.target.files?.[0];if(w){if(w.size>2097152){T.error("Image must be smaller than 2MB");return}const m=new FileReader;m.onerror=()=>{const S=m.error;console.error("FileReader error:",S),T.error(S?.message||"Failed to read image file. Please try again."),n.current&&(n.current.value="")},m.onloadend=()=>{m.readyState===FileReader.DONE&&m.result&&o(m.result),n.current&&(n.current.value="")},m.readAsDataURL(w)}},e[0]=o,e[1]=C):C=e[1];const E=C;let N;e[2]===Symbol.for("react.memo_cache_sentinel")?(N=()=>{n.current?.click()},e[2]=N):N=e[2];const r=N;let f;e[3]!==o?(f=b=>{b.stopPropagation(),o("")},e[3]=o,e[4]=f):f=e[4];const g=f;let d;e[5]!==a||e[6]!==E?(d=s.jsx("input",{type:"file",ref:n,className:"hidden",accept:"image/*",onChange:E,disabled:a}),e[5]=a,e[6]=E,e[7]=d):d=e[7];let c;e[8]!==a||e[9]!==g||e[10]!==p||e[11]!==i?(c=i?s.jsxs("div",{className:"relative group",children:[s.jsx("div",{className:"h-20 w-20 rounded-lg border border-border bg-muted/20 overflow-hidden",children:s.jsx("img",{src:i,alt:p||"Logo",className:"w-full h-full object-cover"})}),s.jsx("button",{type:"button",onClick:g,disabled:a,className:"absolute -top-2 -right-2 h-6 w-6 rounded-full bg-destructive text-destructive-foreground opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center",children:s.jsx(fe,{className:"h-3 w-3"})})]}):s.jsxs("button",{type:"button",onClick:r,disabled:a,className:"h-20 w-20 rounded-lg border-2 border-dashed border-border hover:border-foreground/50 hover:bg-accent/50 transition-colors flex flex-col items-center justify-center gap-1 text-muted-foreground hover:text-foreground disabled:opacity-50 disabled:pointer-events-none",children:[s.jsx(Ce,{className:"h-5 w-5"}),s.jsx("span",{className:"text-xs",children:"Upload"})]}),e[8]=a,e[9]=g,e[10]=p,e[11]=i,e[12]=c):c=e[12];const z=i?"Change Logo":"Upload Logo";let D;e[13]!==a||e[14]!==z?(D=s.jsx(M,{type:"button",variant:"outline",size:"sm",onClick:r,disabled:a,className:"mb-2",children:z}),e[13]=a,e[14]=z,e[15]=D):D=e[15];let x;e[16]!==a||e[17]!==g||e[18]!==i?(x=i&&s.jsx(M,{type:"button",variant:"ghost",size:"sm",onClick:g,disabled:a,className:"ml-2",children:"Remove"}),e[16]=a,e[17]=g,e[18]=i,e[19]=x):x=e[19];let j;e[20]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Recommended: Square image, at least 200x200px. Max 2MB."}),e[20]=j):j=e[20];let h;e[21]!==D||e[22]!==x?(h=s.jsxs("div",{className:"flex-1",children:[D,x,j]}),e[21]=D,e[22]=x,e[23]=h):h=e[23];let y;return e[24]!==h||e[25]!==d||e[26]!==c?(y=s.jsxs("div",{className:"flex items-start gap-4",children:[d,c,h]}),e[24]=h,e[25]=d,e[26]=c,e[27]=y):y=e[27],y}const Ze=ve({name:se().min(1,"Name is required").max(255,"Name is too long"),slug:se().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:se().optional()});function Ye(){const t=pe(),{org:e}=ce(),i=de(),[o,p]=J.useState(!1),a=je({resolver:be(Ze),values:{name:e.name??"",slug:e.slug??"",logo:e.logo??""}}),n=W({mutationFn:async r=>{const f={name:r.name,slug:r.slug};r.logo&&(f.logo=r.logo);const g=await me.organization.update({organizationId:e.id,data:f});if(g?.error)throw new Error(g.error.message||"Failed to update organization");return g},onSuccess:r=>{q("organization_settings_updated",{organization_id:e.id,fields:Object.keys(a.formState.dirtyFields)}),i.invalidateQueries({queryKey:Z.organizations()}),i.invalidateQueries({queryKey:Z.activeOrganization(e.slug)}),T.success("Organization settings updated successfully"),r?.data?.slug&&r.data.slug!==e.slug&&t({to:"/$org/settings/general",params:{org:r.data.slug}})},onError:r=>{q("organization_settings_update_failed",{organization_id:e.id,fields:Object.keys(a.formState.dirtyFields),error:r instanceof Error?r.message:String(r)}),T.error(r instanceof Error?r.message:"Failed to update organization")},onSettled:()=>{p(!1)}}),C=r=>{p(!0),n.mutate(r)},E=a.formState.isDirty,N=a.formState.errors;return s.jsx("form",{onSubmit:a.handleSubmit(C),className:"flex flex-col gap-6",children:s.jsxs(Y,{className:"p-6",children:[s.jsx(X,{className:"p-0",children:s.jsx(ee,{className:"text-sm",children:"Overview"})}),s.jsxs(te,{className:"flex flex-col gap-6 p-0",children:[s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx(B,{className:"text-xs text-muted-foreground",children:"Logo"}),s.jsx(We,{value:a.watch("logo"),onChange:r=>a.setValue("logo",r??"",{shouldDirty:!0}),name:a.watch("name"),disabled:o}),N.logo&&s.jsx("p",{className:"text-xs text-destructive",children:N.logo.message})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-5",children:[s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx(B,{htmlFor:"org-name",className:"text-xs text-muted-foreground",children:"Organization name"}),s.jsx(oe,{id:"org-name",...a.register("name"),placeholder:"Organization name",disabled:o}),N.name&&s.jsx("p",{className:"text-xs text-destructive",children:N.name.message})]}),s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx(B,{htmlFor:"org-slug",className:"text-xs text-muted-foreground",children:"Slug"}),s.jsx(oe,{id:"org-slug",...a.register("slug"),placeholder:"my-organization",disabled:o,onChange:r=>{const f=r.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"");a.setValue("slug",f,{shouldDirty:!0,shouldTouch:!0,shouldValidate:!0})}}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Only lowercase letters, numbers, and hyphens."}),N.slug&&s.jsx("p",{className:"text-xs text-destructive",children:N.slug.message})]})]})]}),E&&s.jsxs(ue,{className:"p-0 pt-2 gap-2",children:[s.jsx(M,{type:"submit",disabled:o,children:o?"Saving…":"Save"}),s.jsx(M,{type:"button",variant:"outline",onClick:()=>a.reset(),disabled:o,children:"Cancel"})]})]})})}function Xe(){const t=G.c(62),{org:e}=ce(),{data:i}=me.useSession(),o=de();let p;t[0]!==e.id?(p={connectionId:we,orgId:e.id},t[0]=e.id,t[1]=p):p=t[1];const a=ze(p);let n;t[2]!==e.id?(n=Z.organizationDomain(e.id),t[2]=e.id,t[3]=n):n=t[3];let C;t[4]!==a?(C=async()=>{const l=await a.callTool({name:"ORGANIZATION_DOMAIN_GET",arguments:{}});return V(l)},t[4]=a,t[5]=C):C=t[5];let E;t[6]!==n||t[7]!==C?(E={queryKey:n,queryFn:C},t[6]=n,t[7]=C,t[8]=E):E=t[8];const{data:N,isPending:r}=Ne(E),f=i?.user?.email??"";let g;t[9]!==f?(g=f.split("@")[1]?.toLowerCase()??"",t[9]=f,t[10]=g):g=t[10];const d=g,c=N?.domain??null,z=N?.autoJoinEnabled??!1,D=d&&d!==c;let x;t[11]!==e.id||t[12]!==o?(x=()=>o.invalidateQueries({queryKey:Z.organizationDomain(e.id)}),t[11]=e.id,t[12]=o,t[13]=x):x=t[13];const j=x;let h;t[14]!==a||t[15]!==d?(h=async()=>{const l=await a.callTool({name:"ORGANIZATION_DOMAIN_SET",arguments:{domain:d,autoJoinEnabled:!1}});return V(l)},t[14]=a,t[15]=d,t[16]=h):h=t[16];let y;t[17]!==j||t[18]!==e.id||t[19]!==d?(y=()=>{q("organization_domain_claimed",{organization_id:e.id,email_domain:d}),j(),T.success("Domain claimed")},t[17]=j,t[18]=e.id,t[19]=d,t[20]=y):y=t[20];let b;t[21]!==e.id||t[22]!==d?(b=l=>{q("organization_domain_claim_failed",{organization_id:e.id,email_domain:d,error:l instanceof Error?l.message:String(l)}),T.error(l instanceof Error?l.message:"Failed to claim domain")},t[21]=e.id,t[22]=d,t[23]=b):b=t[23];let w;t[24]!==h||t[25]!==y||t[26]!==b?(w={mutationFn:h,onSuccess:y,onError:b},t[24]=h,t[25]=y,t[26]=b,t[27]=w):w=t[27];const m=W(w);let S;t[28]!==a?(S=async()=>{const l=await a.callTool({name:"ORGANIZATION_DOMAIN_CLEAR",arguments:{}});return V(l)},t[28]=a,t[29]=S):S=t[29];let v;t[30]!==c||t[31]!==j||t[32]!==e.id?(v=()=>{q("organization_domain_cleared",{organization_id:e.id,email_domain:c}),j(),T.success("Domain removed")},t[30]=c,t[31]=j,t[32]=e.id,t[33]=v):v=t[33];let _;t[34]!==c||t[35]!==e.id?(_=l=>{q("organization_domain_clear_failed",{organization_id:e.id,email_domain:c,error:l instanceof Error?l.message:String(l)}),T.error(l instanceof Error?l.message:"Failed to remove domain")},t[34]=c,t[35]=e.id,t[36]=_):_=t[36];let k;t[37]!==S||t[38]!==v||t[39]!==_?(k={mutationFn:S,onSuccess:v,onError:_},t[37]=S,t[38]=v,t[39]=_,t[40]=k):k=t[40];const P=W(k);let A;t[41]!==a||t[42]!==c||t[43]!==e.id?(A=async l=>{if(!c)return;q("organization_auto_join_toggled",{organization_id:e.id,enabled:l});const L=await a.callTool({name:"ORGANIZATION_DOMAIN_UPDATE",arguments:{autoJoinEnabled:l}});return V(L)},t[41]=a,t[42]=c,t[43]=e.id,t[44]=A):A=t[44];let I;t[45]!==j?(I=()=>{j(),T.success("Auto-join setting updated")},t[45]=j,t[46]=I):I=t[46];let O;t[47]!==e.id?(O=l=>{q("organization_auto_join_toggle_failed",{organization_id:e.id,error:l instanceof Error?l.message:String(l)}),T.error(l instanceof Error?l.message:"Failed to update auto-join")},t[47]=e.id,t[48]=O):O=t[48];let u;t[49]!==A||t[50]!==I||t[51]!==O?(u={mutationFn:A,onSuccess:I,onError:O},t[49]=A,t[50]=I,t[51]=O,t[52]=u):u=t[52];const F=W(u);if(r)return null;let R;t[53]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsxs(X,{className:"p-0",children:[s.jsx(ee,{className:"text-sm",children:"Email Domain"}),s.jsx(_e,{className:"text-xs",children:"Claim your company's email domain so new users with matching emails can automatically join this organization."})]}),t[53]=R):R=t[53];let $;return t[54]!==z||t[55]!==D||t[56]!==P||t[57]!==c||t[58]!==m||t[59]!==F||t[60]!==d?($=s.jsxs(Y,{className:"p-6",children:[R,s.jsx(te,{className:"flex flex-col gap-4 p-0 pt-4",children:c?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("div",{className:"flex-1",children:[s.jsx(B,{className:"text-xs text-muted-foreground",children:"Claimed domain"}),s.jsx("p",{className:"text-sm font-medium",children:c})]}),s.jsx(M,{variant:"outline",size:"sm",onClick:()=>P.mutate(),disabled:P.isPending,children:"Remove"})]}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx(B,{className:"text-xs",children:"Auto-join"}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Users with @",c," emails will automatically join this organization on signup."]})]}),s.jsx(Ae,{checked:z,onCheckedChange:l=>F.mutate(l),disabled:F.isPending})]})]}):D?s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("div",{className:"flex-1",children:[s.jsx(B,{className:"text-xs text-muted-foreground",children:"Your domain"}),s.jsx("p",{className:"text-sm font-medium",children:d})]}),s.jsx(M,{size:"sm",onClick:()=>m.mutate(),disabled:m.isPending,children:m.isPending?"Claiming...":"Claim Domain"})]}):s.jsx("p",{className:"text-xs text-muted-foreground",children:"No corporate email domain detected."})})]}),t[54]=z,t[55]=D,t[56]=P,t[57]=c,t[58]=m,t[59]=F,t[60]=d,t[61]=$):$=t[61],$}const re=["site-editor","site-diagnostics","ai-image","ai-research"],ne=8;function et(t,e,i){const o=e.find(a=>a.id===t);if(o)return{id:o.id,title:o.title,icon:o.icon,kind:"template"};const p=i.find(a=>a.id===t);return p?{id:t,title:p.title,icon:p.icon??null,kind:"custom"}:{id:t,title:t,icon:null,kind:"missing"}}function tt(t){const e=G.c(39),{agent:i,onRemove:o}=t;let p;e[0]!==i.id?(p={id:i.id},e[0]=i.id,e[1]=p):p=e[1];const{attributes:a,listeners:n,setNodeRef:C,transform:E,transition:N,isDragging:r}=Re(p);let f;e[2]!==E?(f=Le.Transform.toString(E),e[2]=E,e[3]=f):f=e[3];const g=r?.5:void 0,d=r?100:void 0;let c;e[4]!==f||e[5]!==g||e[6]!==d||e[7]!==N?(c={transform:f,transition:N,opacity:g,zIndex:d},e[4]=f,e[5]=g,e[6]=d,e[7]=N,e[8]=c):c=e[8];const z=c,D=r&&"shadow-lg";let x;e[9]!==D?(x=ye("flex items-center gap-3 px-3 py-2 rounded-lg border border-border bg-background",D),e[9]=D,e[10]=x):x=e[10];const j=`Drag to reorder ${i.title}`;let h;e[11]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(Be,{size:14}),e[11]=h):h=e[11];let y;e[12]!==a||e[13]!==n||e[14]!==j?(y=s.jsx("button",{type:"button",...a,...n,className:"text-muted-foreground hover:text-foreground cursor-grab active:cursor-grabbing","aria-label":j,children:h}),e[12]=a,e[13]=n,e[14]=j,e[15]=y):y=e[15];let b;e[16]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(xe,{size:14}),e[16]=b):b=e[16];let w;e[17]!==i.icon||e[18]!==i.title?(w=s.jsx(ae,{icon:i.icon,name:i.title,size:"xs",fallbackIcon:b}),e[17]=i.icon,e[18]=i.title,e[19]=w):w=e[19];let m;e[20]!==i.title?(m=s.jsx("span",{className:"text-sm text-foreground truncate",children:i.title}),e[20]=i.title,e[21]=m):m=e[21];const S=i.kind==="template"?"Template":i.kind==="custom"?"Custom agent":"Unavailable";let v;e[22]!==S?(v=s.jsx("span",{className:"text-xs text-muted-foreground",children:S}),e[22]=S,e[23]=v):v=e[23];let _;e[24]!==m||e[25]!==v?(_=s.jsxs("div",{className:"flex flex-col min-w-0 flex-1",children:[m,v]}),e[24]=m,e[25]=v,e[26]=_):_=e[26];const k=`Remove ${i.title}`;let P;e[27]===Symbol.for("react.memo_cache_sentinel")?(P=s.jsx(fe,{size:14}),e[27]=P):P=e[27];let A;e[28]!==o||e[29]!==k?(A=s.jsx("button",{type:"button",onClick:o,className:"text-muted-foreground hover:text-foreground p-1 rounded","aria-label":k,children:P}),e[28]=o,e[29]=k,e[30]=A):A=e[30];let I;return e[31]!==C||e[32]!==z||e[33]!==y||e[34]!==w||e[35]!==_||e[36]!==A||e[37]!==x?(I=s.jsxs("div",{ref:C,style:z,className:x,children:[y,w,_,A]}),e[31]=C,e[32]=z,e[33]=y,e[34]=w,e[35]=_,e[36]=A,e[37]=x,e[38]=I):I=e[38],I}function st(t){const e=G.c(48),{selectedIds:i,onAdd:o}=t,[p,a]=J.useState(!1),[n,C]=J.useState(""),E=ge();let N;e[0]!==i?(N=new Set(i),e[0]=i,e[1]=N):N=e[1];const r=N;let f,g,d,c,z,D,x,j,h,y,b,w,m;if(e[2]!==E||e[3]!==o||e[4]!==p||e[5]!==n||e[6]!==r){const P=n.toLowerCase();c=ie.filter(u=>!r.has(u.id)&&(!n||u.title.toLowerCase().includes(P)));let A;e[20]!==r?(A=u=>u.id!==null&&!De(u.id)&&!r.has(u.id),e[20]=r,e[21]=A):A=e[21],d=E.filter(A).filter(u=>!n||u.title.toLowerCase().includes(P));let I;e[22]!==o?(I=u=>{o(u),a(!1),C("")},e[22]=o,e[23]=I):I=e[23];const O=I;g=Ge,w=p,m=a,e[24]===Symbol.for("react.memo_cache_sentinel")?(z=s.jsx(Ke,{asChild:!0,children:s.jsxs(M,{type:"button",variant:"outline",size:"sm",children:[s.jsx(Je,{size:14}),"Add agent"]})}),e[24]=z):z=e[24],f=Ue,h="w-[320px] p-0 overflow-hidden",y="start",e[25]!==n?(b=s.jsx(qe,{value:n,onChange:C,placeholder:"Search agents..."}),e[25]=n,e[26]=b):b=e[26],D="max-h-[320px] overflow-y-auto p-2 flex flex-col gap-3",x=c.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"}),c.map(u=>s.jsxs("button",{type:"button",onClick:()=>O(u.id),className:"flex items-center gap-2 px-2 py-1.5 rounded-md hover:bg-accent text-left",children:[s.jsx(ae,{icon:u.icon,name:u.title,size:"xs"}),s.jsx("span",{className:"text-sm truncate",children:u.title})]},u.id))]}),j=d.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"}),d.map(u=>s.jsxs("button",{type:"button",onClick:()=>O(u.id),className:"flex items-center gap-2 px-2 py-1.5 rounded-md hover:bg-accent text-left",children:[s.jsx(ae,{icon:u.icon,name:u.title,size:"xs",fallbackIcon:s.jsx(xe,{size:14})}),s.jsx("span",{className:"text-sm truncate",children:u.title})]},u.id))]}),e[2]=E,e[3]=o,e[4]=p,e[5]=n,e[6]=r,e[7]=f,e[8]=g,e[9]=d,e[10]=c,e[11]=z,e[12]=D,e[13]=x,e[14]=j,e[15]=h,e[16]=y,e[17]=b,e[18]=w,e[19]=m}else f=e[7],g=e[8],d=e[9],c=e[10],z=e[11],D=e[12],x=e[13],j=e[14],h=e[15],y=e[16],b=e[17],w=e[18],m=e[19];let S;e[27]!==d||e[28]!==c.length||e[29]!==n?(S=c.length===0&&d.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]=d,e[28]=c.length,e[29]=n,e[30]=S):S=e[30];let v;e[31]!==S||e[32]!==D||e[33]!==x||e[34]!==j?(v=s.jsxs("div",{className:D,children:[x,j,S]}),e[31]=S,e[32]=D,e[33]=x,e[34]=j,e[35]=v):v=e[35];let _;e[36]!==f||e[37]!==v||e[38]!==h||e[39]!==y||e[40]!==b?(_=s.jsxs(f,{className:h,align:y,children:[b,v]}),e[36]=f,e[37]=v,e[38]=h,e[39]=y,e[40]=b,e[41]=_):_=e[41];let k;return e[42]!==g||e[43]!==z||e[44]!==_||e[45]!==w||e[46]!==m?(k=s.jsxs(g,{open:w,onOpenChange:m,children:[z,_]}),e[42]=g,e[43]=z,e[44]=_,e[45]=w,e[46]=m,e[47]=k):k=e[47],k}function nt(){const t=G.c(60),e=Qe(),i=ge(),o=Ve();let p;t[0]!==e?.ids?(p=e?.ids??[...re],t[0]=e?.ids,t[1]=p):p=t[1];const a=p,[n,C]=J.useState(a);let E;t[2]!==n||t[3]!==a?(E=n.length!==a.length||n.some((l,L)=>l!==a[L]),t[2]=n,t[3]=a,t[4]=E):E=t[4];const N=E;let r;t[5]===Symbol.for("react.memo_cache_sentinel")?(r={activationConstraint:{distance:5}},t[5]=r):r=t[5];let f;t[6]===Symbol.for("react.memo_cache_sentinel")?(f={coordinateGetter:Me},t[6]=f):f=t[6];const g=Ee(le(Fe,r),le(Te,f));let d;t[7]!==n?(d=l=>{const{active:L,over:K}=l;if(!K||L.id===K.id)return;const H=n.indexOf(L.id),U=n.indexOf(K.id);H===-1||U===-1||C($e([...n],H,U))},t[7]=n,t[8]=d):d=t[8];const c=d;let z;t[9]!==n?(z=l=>{n.includes(l)||C([...n,l])},t[9]=n,t[10]=z):z=t[10];const D=z;let x;t[11]!==n?(x=l=>{C(n.filter(L=>L!==l))},t[11]=n,t[12]=x):x=t[12];const j=x;let h;t[13]===Symbol.for("react.memo_cache_sentinel")?(h=()=>{C([...re])},t[13]=h):h=t[13];const y=h;let b;t[14]!==n||t[15]!==o?(b=()=>{o.mutate({ids:n},{onSuccess:()=>{q("default_home_agents_updated",{count:n.length,template_count:n.filter(it).length}),T.success("Default home agents updated")},onError:at})},t[14]=n,t[15]=o,t[16]=b):b=t[16];const w=b;let m,S,v,_,k,P,A;if(t[17]!==i||t[18]!==n||t[19]!==c||t[20]!==j||t[21]!==g||t[22]!==o.isPending){let l;t[30]!==i?(l=U=>et(U,ie,i),t[30]=i,t[31]=l):l=t[31];const L=n.map(l);v=Math.max(0,n.length-ne),S=Y,k="p-6";let K;t[32]===Symbol.for("react.memo_cache_sentinel")?(K=s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx(ee,{className:"text-sm",children:"Default home agents"}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Choose which agents appear on the home view for everyone in this organization. Drag to reorder. Up to ",ne," tiles render on the home view."]})]}),t[32]=K):K=t[32];let H;t[33]===Symbol.for("react.memo_cache_sentinel")?(H=s.jsx(Se,{size:14}),t[33]=H):H=t[33],t[34]!==o.isPending?(P=s.jsxs(X,{className:"p-0 flex flex-row items-start justify-between gap-3",children:[K,s.jsxs(M,{type:"button",variant:"ghost",size:"sm",onClick:y,disabled:o.isPending,children:[H,"Reset defaults"]})]}),t[34]=o.isPending,t[35]=P):P=t[35],m=te,A="p-0 flex flex-col gap-3",_=L.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(Ie,{sensors:g,collisionDetection:Pe,onDragEnd:c,children:s.jsx(ke,{items:n,strategy:Oe,children:s.jsx("div",{className:"flex flex-col gap-1.5",children:L.map((U,he)=>s.jsxs("div",{className:"flex flex-col gap-1.5",children:[he===ne&&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(tt,{agent:U,onRemove:()=>j(U.id)})]},U.id))})})}),t[17]=i,t[18]=n,t[19]=c,t[20]=j,t[21]=g,t[22]=o.isPending,t[23]=m,t[24]=S,t[25]=v,t[26]=_,t[27]=k,t[28]=P,t[29]=A}else m=t[23],S=t[24],v=t[25],_=t[26],k=t[27],P=t[28],A=t[29];let I;t[36]!==n||t[37]!==D?(I=s.jsx(st,{selectedIds:n,onAdd:D}),t[36]=n,t[37]=D,t[38]=I):I=t[38];let O;t[39]!==v?(O=v>0&&s.jsxs("span",{className:"text-xs text-muted-foreground",children:[v," agent",v===1?"":"s"," won't fit on the home view"]}),t[39]=v,t[40]=O):O=t[40];let u;t[41]!==I||t[42]!==O?(u=s.jsxs("div",{className:"flex items-center justify-between",children:[I,O]}),t[41]=I,t[42]=O,t[43]=u):u=t[43];let F;t[44]!==m||t[45]!==_||t[46]!==u||t[47]!==A?(F=s.jsxs(m,{className:A,children:[_,u]}),t[44]=m,t[45]=_,t[46]=u,t[47]=A,t[48]=F):F=t[48];let R;t[49]!==w||t[50]!==a||t[51]!==N||t[52]!==o.isPending?(R=N&&s.jsxs(ue,{className:"p-0 pt-2 gap-2",children:[s.jsx(M,{type:"button",onClick:w,disabled:o.isPending,children:o.isPending?"Saving…":"Save"}),s.jsx(M,{type:"button",variant:"outline",onClick:()=>C(a),disabled:o.isPending,children:"Cancel"})]}),t[49]=w,t[50]=a,t[51]=N,t[52]=o.isPending,t[53]=R):R=t[53];let $;return t[54]!==S||t[55]!==k||t[56]!==P||t[57]!==F||t[58]!==R?($=s.jsxs(S,{className:k,children:[P,F,R]}),t[54]=S,t[55]=k,t[56]=P,t[57]=F,t[58]=R,t[59]=$):$=t[59],$}function at(t){T.error(t instanceof Error?t.message:"Failed to update default home agents")}function it(t){return ie.some(e=>e.id===t)}function ot(){const t=G.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(X,{className:"p-0",children:s.jsx(ee,{className:"text-sm",children:"Default home agents"})}),t[0]=e):e=t[0];let i;return t[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsxs(Y,{className:"p-6",children:[e,s.jsx(te,{className:"p-0 flex flex-col gap-2",children:Array.from({length:4}).map(lt)})]}),t[1]=i):i=t[1],i}function lt(t,e){return s.jsx(He,{className:"h-12 w-full rounded-lg"},e)}function rt(){const t=G.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(J.Suspense,{fallback:s.jsx(ot,{}),children:s.jsx(nt,{})}),t[0]=e):e=t[0],e}function ct(){const t=G.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Q,{children:s.jsx(Q.Content,{children:s.jsx(Q.Body,{children:s.jsxs("div",{className:"flex flex-col gap-6",children:[s.jsx(Q.Title,{children:"Organization"}),s.jsx(Ye,{}),s.jsx(Xe,{}),s.jsx(rt,{})]})})})}),t[0]=e):e=t[0],e}function Zt(){const t=G.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(ct,{}),t[0]=e):e=t[0],e}export{Zt as default};
1
+ import{e as G,r as J,z as T,j as s,B as M,f as pe,s as ce,o as de,x as je,w as be,a as W,t as q,K as Z,b as me,v as ve,y as se,n as Ne,c as ye,aD as Se}from"./index-CNolBSVE.js";import{P as Q}from"./index-PT6VRyBL.js";import{C as Y,b as X,c as ee,a as te,d as ue,e as _e}from"./card-CPVRwbgl.js";import{I as oe}from"./input-B8j75XZ_.js";import{L as B}from"./label-KH35YAYU.js";import{c as Ce}from"./XCircle-BiHPX6_R.js";import{i as fe}from"./X-BWV-b86T.js";import{u as V}from"./unwrap-tool-result-BYXdCQMg.js";import{S as we,u as ze,W as ie,i as De}from"./constants-D8VkIs2c.js";import{S as Ae}from"./switch-CVtXvreH.js";import{u as Ee,a as le,D as Ie,c as Pe,S as ke,v as Oe,K as Te,P as Fe,d as Re,C as Le,s as Me,b as $e,e as qe}from"./collection-search-lfil19IA.js";import{u as ge}from"./use-virtual-mcp-CDOk_IIy.js";import{b as Ge,P as Ke,a as Ue}from"./popover-BK6PL-XB.js";import{S as He}from"./skeleton-DPqifXUx.js";import{T as Be}from"./agent-icon-DCE-D-qC.js";import{s as Je}from"./Plus-Bmk1thjl.js";import{a as xe}from"./Users03-Bgfd1KM0.js";import{I as ae}from"./integration-icon-De50Mm7k.js";import{u as Qe,c as Ve}from"./use-organization-settings-dQpmtQzl.js";import"./use-mobile-Ctb5URy7.js";import"./SearchMd-VdXbz8fL.js";import"./use-collections-BTXUmiDi.js";import"./AlertCircle-Ljx3VIeb.js";import"./Tool01-DBxgF1Y_.js";import"./ArrowNarrowLeft-B8YVT66M.js";import"./ZapSquare-CTcr_tRy.js";import"./CheckCircle-BFRWTTWo.js";import"./ChevronDown-BqFspEzt.js";import"./ChevronRight-DCsBjQ-n.js";import"./ChevronUp-D7S3j_fa.js";import"./Container-SHbLkl7K.js";import"./Star01-fuGmPeeu.js";import"./Palette-B46VjX8F.js";import"./LinkExternal01-XmkIm96u.js";import"./Lock01-CXrm99F-.js";import"./Sun-ndN_CHuQ.js";import"./Play-9pX5w5-3.js";import"./Settings02-C88OtRRq.js";import"./Trash01-BHBjIGXE.js";import"./User01-DCiwOMBU.js";import"./Zap-K9sQXDlC.js";function We(t){const e=G.c(28),{value:i,onChange:o,name:p,disabled:a}=t,n=J.useRef(null);let C;e[0]!==o?(C=b=>{const w=b.target.files?.[0];if(w){if(w.size>2097152){T.error("Image must be smaller than 2MB");return}const m=new FileReader;m.onerror=()=>{const S=m.error;console.error("FileReader error:",S),T.error(S?.message||"Failed to read image file. Please try again."),n.current&&(n.current.value="")},m.onloadend=()=>{m.readyState===FileReader.DONE&&m.result&&o(m.result),n.current&&(n.current.value="")},m.readAsDataURL(w)}},e[0]=o,e[1]=C):C=e[1];const E=C;let N;e[2]===Symbol.for("react.memo_cache_sentinel")?(N=()=>{n.current?.click()},e[2]=N):N=e[2];const r=N;let f;e[3]!==o?(f=b=>{b.stopPropagation(),o("")},e[3]=o,e[4]=f):f=e[4];const g=f;let d;e[5]!==a||e[6]!==E?(d=s.jsx("input",{type:"file",ref:n,className:"hidden",accept:"image/*",onChange:E,disabled:a}),e[5]=a,e[6]=E,e[7]=d):d=e[7];let c;e[8]!==a||e[9]!==g||e[10]!==p||e[11]!==i?(c=i?s.jsxs("div",{className:"relative group",children:[s.jsx("div",{className:"h-20 w-20 rounded-lg border border-border bg-muted/20 overflow-hidden",children:s.jsx("img",{src:i,alt:p||"Logo",className:"w-full h-full object-cover"})}),s.jsx("button",{type:"button",onClick:g,disabled:a,className:"absolute -top-2 -right-2 h-6 w-6 rounded-full bg-destructive text-destructive-foreground opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center",children:s.jsx(fe,{className:"h-3 w-3"})})]}):s.jsxs("button",{type:"button",onClick:r,disabled:a,className:"h-20 w-20 rounded-lg border-2 border-dashed border-border hover:border-foreground/50 hover:bg-accent/50 transition-colors flex flex-col items-center justify-center gap-1 text-muted-foreground hover:text-foreground disabled:opacity-50 disabled:pointer-events-none",children:[s.jsx(Ce,{className:"h-5 w-5"}),s.jsx("span",{className:"text-xs",children:"Upload"})]}),e[8]=a,e[9]=g,e[10]=p,e[11]=i,e[12]=c):c=e[12];const z=i?"Change Logo":"Upload Logo";let D;e[13]!==a||e[14]!==z?(D=s.jsx(M,{type:"button",variant:"outline",size:"sm",onClick:r,disabled:a,className:"mb-2",children:z}),e[13]=a,e[14]=z,e[15]=D):D=e[15];let x;e[16]!==a||e[17]!==g||e[18]!==i?(x=i&&s.jsx(M,{type:"button",variant:"ghost",size:"sm",onClick:g,disabled:a,className:"ml-2",children:"Remove"}),e[16]=a,e[17]=g,e[18]=i,e[19]=x):x=e[19];let j;e[20]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Recommended: Square image, at least 200x200px. Max 2MB."}),e[20]=j):j=e[20];let h;e[21]!==D||e[22]!==x?(h=s.jsxs("div",{className:"flex-1",children:[D,x,j]}),e[21]=D,e[22]=x,e[23]=h):h=e[23];let y;return e[24]!==h||e[25]!==d||e[26]!==c?(y=s.jsxs("div",{className:"flex items-start gap-4",children:[d,c,h]}),e[24]=h,e[25]=d,e[26]=c,e[27]=y):y=e[27],y}const Ze=ve({name:se().min(1,"Name is required").max(255,"Name is too long"),slug:se().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:se().optional()});function Ye(){const t=pe(),{org:e}=ce(),i=de(),[o,p]=J.useState(!1),a=je({resolver:be(Ze),values:{name:e.name??"",slug:e.slug??"",logo:e.logo??""}}),n=W({mutationFn:async r=>{const f={name:r.name,slug:r.slug};r.logo&&(f.logo=r.logo);const g=await me.organization.update({organizationId:e.id,data:f});if(g?.error)throw new Error(g.error.message||"Failed to update organization");return g},onSuccess:r=>{q("organization_settings_updated",{organization_id:e.id,fields:Object.keys(a.formState.dirtyFields)}),i.invalidateQueries({queryKey:Z.organizations()}),i.invalidateQueries({queryKey:Z.activeOrganization(e.slug)}),T.success("Organization settings updated successfully"),r?.data?.slug&&r.data.slug!==e.slug&&t({to:"/$org/settings/general",params:{org:r.data.slug}})},onError:r=>{q("organization_settings_update_failed",{organization_id:e.id,fields:Object.keys(a.formState.dirtyFields),error:r instanceof Error?r.message:String(r)}),T.error(r instanceof Error?r.message:"Failed to update organization")},onSettled:()=>{p(!1)}}),C=r=>{p(!0),n.mutate(r)},E=a.formState.isDirty,N=a.formState.errors;return s.jsx("form",{onSubmit:a.handleSubmit(C),className:"flex flex-col gap-6",children:s.jsxs(Y,{className:"p-6",children:[s.jsx(X,{className:"p-0",children:s.jsx(ee,{className:"text-sm",children:"Overview"})}),s.jsxs(te,{className:"flex flex-col gap-6 p-0",children:[s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx(B,{className:"text-xs text-muted-foreground",children:"Logo"}),s.jsx(We,{value:a.watch("logo"),onChange:r=>a.setValue("logo",r??"",{shouldDirty:!0}),name:a.watch("name"),disabled:o}),N.logo&&s.jsx("p",{className:"text-xs text-destructive",children:N.logo.message})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-5",children:[s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx(B,{htmlFor:"org-name",className:"text-xs text-muted-foreground",children:"Organization name"}),s.jsx(oe,{id:"org-name",...a.register("name"),placeholder:"Organization name",disabled:o}),N.name&&s.jsx("p",{className:"text-xs text-destructive",children:N.name.message})]}),s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx(B,{htmlFor:"org-slug",className:"text-xs text-muted-foreground",children:"Slug"}),s.jsx(oe,{id:"org-slug",...a.register("slug"),placeholder:"my-organization",disabled:o,onChange:r=>{const f=r.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"");a.setValue("slug",f,{shouldDirty:!0,shouldTouch:!0,shouldValidate:!0})}}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Only lowercase letters, numbers, and hyphens."}),N.slug&&s.jsx("p",{className:"text-xs text-destructive",children:N.slug.message})]})]})]}),E&&s.jsxs(ue,{className:"p-0 pt-2 gap-2",children:[s.jsx(M,{type:"submit",disabled:o,children:o?"Saving…":"Save"}),s.jsx(M,{type:"button",variant:"outline",onClick:()=>a.reset(),disabled:o,children:"Cancel"})]})]})})}function Xe(){const t=G.c(62),{org:e}=ce(),{data:i}=me.useSession(),o=de();let p;t[0]!==e.id?(p={connectionId:we,orgId:e.id},t[0]=e.id,t[1]=p):p=t[1];const a=ze(p);let n;t[2]!==e.id?(n=Z.organizationDomain(e.id),t[2]=e.id,t[3]=n):n=t[3];let C;t[4]!==a?(C=async()=>{const l=await a.callTool({name:"ORGANIZATION_DOMAIN_GET",arguments:{}});return V(l)},t[4]=a,t[5]=C):C=t[5];let E;t[6]!==n||t[7]!==C?(E={queryKey:n,queryFn:C},t[6]=n,t[7]=C,t[8]=E):E=t[8];const{data:N,isPending:r}=Ne(E),f=i?.user?.email??"";let g;t[9]!==f?(g=f.split("@")[1]?.toLowerCase()??"",t[9]=f,t[10]=g):g=t[10];const d=g,c=N?.domain??null,z=N?.autoJoinEnabled??!1,D=d&&d!==c;let x;t[11]!==e.id||t[12]!==o?(x=()=>o.invalidateQueries({queryKey:Z.organizationDomain(e.id)}),t[11]=e.id,t[12]=o,t[13]=x):x=t[13];const j=x;let h;t[14]!==a||t[15]!==d?(h=async()=>{const l=await a.callTool({name:"ORGANIZATION_DOMAIN_SET",arguments:{domain:d,autoJoinEnabled:!1}});return V(l)},t[14]=a,t[15]=d,t[16]=h):h=t[16];let y;t[17]!==j||t[18]!==e.id||t[19]!==d?(y=()=>{q("organization_domain_claimed",{organization_id:e.id,email_domain:d}),j(),T.success("Domain claimed")},t[17]=j,t[18]=e.id,t[19]=d,t[20]=y):y=t[20];let b;t[21]!==e.id||t[22]!==d?(b=l=>{q("organization_domain_claim_failed",{organization_id:e.id,email_domain:d,error:l instanceof Error?l.message:String(l)}),T.error(l instanceof Error?l.message:"Failed to claim domain")},t[21]=e.id,t[22]=d,t[23]=b):b=t[23];let w;t[24]!==h||t[25]!==y||t[26]!==b?(w={mutationFn:h,onSuccess:y,onError:b},t[24]=h,t[25]=y,t[26]=b,t[27]=w):w=t[27];const m=W(w);let S;t[28]!==a?(S=async()=>{const l=await a.callTool({name:"ORGANIZATION_DOMAIN_CLEAR",arguments:{}});return V(l)},t[28]=a,t[29]=S):S=t[29];let v;t[30]!==c||t[31]!==j||t[32]!==e.id?(v=()=>{q("organization_domain_cleared",{organization_id:e.id,email_domain:c}),j(),T.success("Domain removed")},t[30]=c,t[31]=j,t[32]=e.id,t[33]=v):v=t[33];let _;t[34]!==c||t[35]!==e.id?(_=l=>{q("organization_domain_clear_failed",{organization_id:e.id,email_domain:c,error:l instanceof Error?l.message:String(l)}),T.error(l instanceof Error?l.message:"Failed to remove domain")},t[34]=c,t[35]=e.id,t[36]=_):_=t[36];let k;t[37]!==S||t[38]!==v||t[39]!==_?(k={mutationFn:S,onSuccess:v,onError:_},t[37]=S,t[38]=v,t[39]=_,t[40]=k):k=t[40];const P=W(k);let A;t[41]!==a||t[42]!==c||t[43]!==e.id?(A=async l=>{if(!c)return;q("organization_auto_join_toggled",{organization_id:e.id,enabled:l});const L=await a.callTool({name:"ORGANIZATION_DOMAIN_UPDATE",arguments:{autoJoinEnabled:l}});return V(L)},t[41]=a,t[42]=c,t[43]=e.id,t[44]=A):A=t[44];let I;t[45]!==j?(I=()=>{j(),T.success("Auto-join setting updated")},t[45]=j,t[46]=I):I=t[46];let O;t[47]!==e.id?(O=l=>{q("organization_auto_join_toggle_failed",{organization_id:e.id,error:l instanceof Error?l.message:String(l)}),T.error(l instanceof Error?l.message:"Failed to update auto-join")},t[47]=e.id,t[48]=O):O=t[48];let u;t[49]!==A||t[50]!==I||t[51]!==O?(u={mutationFn:A,onSuccess:I,onError:O},t[49]=A,t[50]=I,t[51]=O,t[52]=u):u=t[52];const F=W(u);if(r)return null;let R;t[53]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsxs(X,{className:"p-0",children:[s.jsx(ee,{className:"text-sm",children:"Email Domain"}),s.jsx(_e,{className:"text-xs",children:"Claim your company's email domain so new users with matching emails can automatically join this organization."})]}),t[53]=R):R=t[53];let $;return t[54]!==z||t[55]!==D||t[56]!==P||t[57]!==c||t[58]!==m||t[59]!==F||t[60]!==d?($=s.jsxs(Y,{className:"p-6",children:[R,s.jsx(te,{className:"flex flex-col gap-4 p-0 pt-4",children:c?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("div",{className:"flex-1",children:[s.jsx(B,{className:"text-xs text-muted-foreground",children:"Claimed domain"}),s.jsx("p",{className:"text-sm font-medium",children:c})]}),s.jsx(M,{variant:"outline",size:"sm",onClick:()=>P.mutate(),disabled:P.isPending,children:"Remove"})]}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx(B,{className:"text-xs",children:"Auto-join"}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Users with @",c," emails will automatically join this organization on signup."]})]}),s.jsx(Ae,{checked:z,onCheckedChange:l=>F.mutate(l),disabled:F.isPending})]})]}):D?s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("div",{className:"flex-1",children:[s.jsx(B,{className:"text-xs text-muted-foreground",children:"Your domain"}),s.jsx("p",{className:"text-sm font-medium",children:d})]}),s.jsx(M,{size:"sm",onClick:()=>m.mutate(),disabled:m.isPending,children:m.isPending?"Claiming...":"Claim Domain"})]}):s.jsx("p",{className:"text-xs text-muted-foreground",children:"No corporate email domain detected."})})]}),t[54]=z,t[55]=D,t[56]=P,t[57]=c,t[58]=m,t[59]=F,t[60]=d,t[61]=$):$=t[61],$}const re=["site-editor","site-diagnostics","ai-image","ai-research"],ne=8;function et(t,e,i){const o=e.find(a=>a.id===t);if(o)return{id:o.id,title:o.title,icon:o.icon,kind:"template"};const p=i.find(a=>a.id===t);return p?{id:t,title:p.title,icon:p.icon??null,kind:"custom"}:{id:t,title:t,icon:null,kind:"missing"}}function tt(t){const e=G.c(39),{agent:i,onRemove:o}=t;let p;e[0]!==i.id?(p={id:i.id},e[0]=i.id,e[1]=p):p=e[1];const{attributes:a,listeners:n,setNodeRef:C,transform:E,transition:N,isDragging:r}=Re(p);let f;e[2]!==E?(f=Le.Transform.toString(E),e[2]=E,e[3]=f):f=e[3];const g=r?.5:void 0,d=r?100:void 0;let c;e[4]!==f||e[5]!==g||e[6]!==d||e[7]!==N?(c={transform:f,transition:N,opacity:g,zIndex:d},e[4]=f,e[5]=g,e[6]=d,e[7]=N,e[8]=c):c=e[8];const z=c,D=r&&"shadow-lg";let x;e[9]!==D?(x=ye("flex items-center gap-3 px-3 py-2 rounded-lg border border-border bg-background",D),e[9]=D,e[10]=x):x=e[10];const j=`Drag to reorder ${i.title}`;let h;e[11]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(Be,{size:14}),e[11]=h):h=e[11];let y;e[12]!==a||e[13]!==n||e[14]!==j?(y=s.jsx("button",{type:"button",...a,...n,className:"text-muted-foreground hover:text-foreground cursor-grab active:cursor-grabbing","aria-label":j,children:h}),e[12]=a,e[13]=n,e[14]=j,e[15]=y):y=e[15];let b;e[16]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(xe,{size:14}),e[16]=b):b=e[16];let w;e[17]!==i.icon||e[18]!==i.title?(w=s.jsx(ae,{icon:i.icon,name:i.title,size:"xs",fallbackIcon:b}),e[17]=i.icon,e[18]=i.title,e[19]=w):w=e[19];let m;e[20]!==i.title?(m=s.jsx("span",{className:"text-sm text-foreground truncate",children:i.title}),e[20]=i.title,e[21]=m):m=e[21];const S=i.kind==="template"?"Template":i.kind==="custom"?"Custom agent":"Unavailable";let v;e[22]!==S?(v=s.jsx("span",{className:"text-xs text-muted-foreground",children:S}),e[22]=S,e[23]=v):v=e[23];let _;e[24]!==m||e[25]!==v?(_=s.jsxs("div",{className:"flex flex-col min-w-0 flex-1",children:[m,v]}),e[24]=m,e[25]=v,e[26]=_):_=e[26];const k=`Remove ${i.title}`;let P;e[27]===Symbol.for("react.memo_cache_sentinel")?(P=s.jsx(fe,{size:14}),e[27]=P):P=e[27];let A;e[28]!==o||e[29]!==k?(A=s.jsx("button",{type:"button",onClick:o,className:"text-muted-foreground hover:text-foreground p-1 rounded","aria-label":k,children:P}),e[28]=o,e[29]=k,e[30]=A):A=e[30];let I;return e[31]!==C||e[32]!==z||e[33]!==y||e[34]!==w||e[35]!==_||e[36]!==A||e[37]!==x?(I=s.jsxs("div",{ref:C,style:z,className:x,children:[y,w,_,A]}),e[31]=C,e[32]=z,e[33]=y,e[34]=w,e[35]=_,e[36]=A,e[37]=x,e[38]=I):I=e[38],I}function st(t){const e=G.c(48),{selectedIds:i,onAdd:o}=t,[p,a]=J.useState(!1),[n,C]=J.useState(""),E=ge();let N;e[0]!==i?(N=new Set(i),e[0]=i,e[1]=N):N=e[1];const r=N;let f,g,d,c,z,D,x,j,h,y,b,w,m;if(e[2]!==E||e[3]!==o||e[4]!==p||e[5]!==n||e[6]!==r){const P=n.toLowerCase();c=ie.filter(u=>!r.has(u.id)&&(!n||u.title.toLowerCase().includes(P)));let A;e[20]!==r?(A=u=>u.id!==null&&!De(u.id)&&!r.has(u.id),e[20]=r,e[21]=A):A=e[21],d=E.filter(A).filter(u=>!n||u.title.toLowerCase().includes(P));let I;e[22]!==o?(I=u=>{o(u),a(!1),C("")},e[22]=o,e[23]=I):I=e[23];const O=I;g=Ge,w=p,m=a,e[24]===Symbol.for("react.memo_cache_sentinel")?(z=s.jsx(Ke,{asChild:!0,children:s.jsxs(M,{type:"button",variant:"outline",size:"sm",children:[s.jsx(Je,{size:14}),"Add agent"]})}),e[24]=z):z=e[24],f=Ue,h="w-[320px] p-0 overflow-hidden",y="start",e[25]!==n?(b=s.jsx(qe,{value:n,onChange:C,placeholder:"Search agents..."}),e[25]=n,e[26]=b):b=e[26],D="max-h-[320px] overflow-y-auto p-2 flex flex-col gap-3",x=c.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"}),c.map(u=>s.jsxs("button",{type:"button",onClick:()=>O(u.id),className:"flex items-center gap-2 px-2 py-1.5 rounded-md hover:bg-accent text-left",children:[s.jsx(ae,{icon:u.icon,name:u.title,size:"xs"}),s.jsx("span",{className:"text-sm truncate",children:u.title})]},u.id))]}),j=d.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"}),d.map(u=>s.jsxs("button",{type:"button",onClick:()=>O(u.id),className:"flex items-center gap-2 px-2 py-1.5 rounded-md hover:bg-accent text-left",children:[s.jsx(ae,{icon:u.icon,name:u.title,size:"xs",fallbackIcon:s.jsx(xe,{size:14})}),s.jsx("span",{className:"text-sm truncate",children:u.title})]},u.id))]}),e[2]=E,e[3]=o,e[4]=p,e[5]=n,e[6]=r,e[7]=f,e[8]=g,e[9]=d,e[10]=c,e[11]=z,e[12]=D,e[13]=x,e[14]=j,e[15]=h,e[16]=y,e[17]=b,e[18]=w,e[19]=m}else f=e[7],g=e[8],d=e[9],c=e[10],z=e[11],D=e[12],x=e[13],j=e[14],h=e[15],y=e[16],b=e[17],w=e[18],m=e[19];let S;e[27]!==d||e[28]!==c.length||e[29]!==n?(S=c.length===0&&d.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]=d,e[28]=c.length,e[29]=n,e[30]=S):S=e[30];let v;e[31]!==S||e[32]!==D||e[33]!==x||e[34]!==j?(v=s.jsxs("div",{className:D,children:[x,j,S]}),e[31]=S,e[32]=D,e[33]=x,e[34]=j,e[35]=v):v=e[35];let _;e[36]!==f||e[37]!==v||e[38]!==h||e[39]!==y||e[40]!==b?(_=s.jsxs(f,{className:h,align:y,children:[b,v]}),e[36]=f,e[37]=v,e[38]=h,e[39]=y,e[40]=b,e[41]=_):_=e[41];let k;return e[42]!==g||e[43]!==z||e[44]!==_||e[45]!==w||e[46]!==m?(k=s.jsxs(g,{open:w,onOpenChange:m,children:[z,_]}),e[42]=g,e[43]=z,e[44]=_,e[45]=w,e[46]=m,e[47]=k):k=e[47],k}function nt(){const t=G.c(60),e=Qe(),i=ge(),o=Ve();let p;t[0]!==e?.ids?(p=e?.ids??[...re],t[0]=e?.ids,t[1]=p):p=t[1];const a=p,[n,C]=J.useState(a);let E;t[2]!==n||t[3]!==a?(E=n.length!==a.length||n.some((l,L)=>l!==a[L]),t[2]=n,t[3]=a,t[4]=E):E=t[4];const N=E;let r;t[5]===Symbol.for("react.memo_cache_sentinel")?(r={activationConstraint:{distance:5}},t[5]=r):r=t[5];let f;t[6]===Symbol.for("react.memo_cache_sentinel")?(f={coordinateGetter:Me},t[6]=f):f=t[6];const g=Ee(le(Fe,r),le(Te,f));let d;t[7]!==n?(d=l=>{const{active:L,over:K}=l;if(!K||L.id===K.id)return;const H=n.indexOf(L.id),U=n.indexOf(K.id);H===-1||U===-1||C($e([...n],H,U))},t[7]=n,t[8]=d):d=t[8];const c=d;let z;t[9]!==n?(z=l=>{n.includes(l)||C([...n,l])},t[9]=n,t[10]=z):z=t[10];const D=z;let x;t[11]!==n?(x=l=>{C(n.filter(L=>L!==l))},t[11]=n,t[12]=x):x=t[12];const j=x;let h;t[13]===Symbol.for("react.memo_cache_sentinel")?(h=()=>{C([...re])},t[13]=h):h=t[13];const y=h;let b;t[14]!==n||t[15]!==o?(b=()=>{o.mutate({ids:n},{onSuccess:()=>{q("default_home_agents_updated",{count:n.length,template_count:n.filter(it).length}),T.success("Default home agents updated")},onError:at})},t[14]=n,t[15]=o,t[16]=b):b=t[16];const w=b;let m,S,v,_,k,P,A;if(t[17]!==i||t[18]!==n||t[19]!==c||t[20]!==j||t[21]!==g||t[22]!==o.isPending){let l;t[30]!==i?(l=U=>et(U,ie,i),t[30]=i,t[31]=l):l=t[31];const L=n.map(l);v=Math.max(0,n.length-ne),S=Y,k="p-6";let K;t[32]===Symbol.for("react.memo_cache_sentinel")?(K=s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx(ee,{className:"text-sm",children:"Default home agents"}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Choose which agents appear on the home view for everyone in this organization. Drag to reorder. Up to ",ne," tiles render on the home view."]})]}),t[32]=K):K=t[32];let H;t[33]===Symbol.for("react.memo_cache_sentinel")?(H=s.jsx(Se,{size:14}),t[33]=H):H=t[33],t[34]!==o.isPending?(P=s.jsxs(X,{className:"p-0 flex flex-row items-start justify-between gap-3",children:[K,s.jsxs(M,{type:"button",variant:"ghost",size:"sm",onClick:y,disabled:o.isPending,children:[H,"Reset defaults"]})]}),t[34]=o.isPending,t[35]=P):P=t[35],m=te,A="p-0 flex flex-col gap-3",_=L.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(Ie,{sensors:g,collisionDetection:Pe,onDragEnd:c,children:s.jsx(ke,{items:n,strategy:Oe,children:s.jsx("div",{className:"flex flex-col gap-1.5",children:L.map((U,he)=>s.jsxs("div",{className:"flex flex-col gap-1.5",children:[he===ne&&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(tt,{agent:U,onRemove:()=>j(U.id)})]},U.id))})})}),t[17]=i,t[18]=n,t[19]=c,t[20]=j,t[21]=g,t[22]=o.isPending,t[23]=m,t[24]=S,t[25]=v,t[26]=_,t[27]=k,t[28]=P,t[29]=A}else m=t[23],S=t[24],v=t[25],_=t[26],k=t[27],P=t[28],A=t[29];let I;t[36]!==n||t[37]!==D?(I=s.jsx(st,{selectedIds:n,onAdd:D}),t[36]=n,t[37]=D,t[38]=I):I=t[38];let O;t[39]!==v?(O=v>0&&s.jsxs("span",{className:"text-xs text-muted-foreground",children:[v," agent",v===1?"":"s"," won't fit on the home view"]}),t[39]=v,t[40]=O):O=t[40];let u;t[41]!==I||t[42]!==O?(u=s.jsxs("div",{className:"flex items-center justify-between",children:[I,O]}),t[41]=I,t[42]=O,t[43]=u):u=t[43];let F;t[44]!==m||t[45]!==_||t[46]!==u||t[47]!==A?(F=s.jsxs(m,{className:A,children:[_,u]}),t[44]=m,t[45]=_,t[46]=u,t[47]=A,t[48]=F):F=t[48];let R;t[49]!==w||t[50]!==a||t[51]!==N||t[52]!==o.isPending?(R=N&&s.jsxs(ue,{className:"p-0 pt-2 gap-2",children:[s.jsx(M,{type:"button",onClick:w,disabled:o.isPending,children:o.isPending?"Saving…":"Save"}),s.jsx(M,{type:"button",variant:"outline",onClick:()=>C(a),disabled:o.isPending,children:"Cancel"})]}),t[49]=w,t[50]=a,t[51]=N,t[52]=o.isPending,t[53]=R):R=t[53];let $;return t[54]!==S||t[55]!==k||t[56]!==P||t[57]!==F||t[58]!==R?($=s.jsxs(S,{className:k,children:[P,F,R]}),t[54]=S,t[55]=k,t[56]=P,t[57]=F,t[58]=R,t[59]=$):$=t[59],$}function at(t){T.error(t instanceof Error?t.message:"Failed to update default home agents")}function it(t){return ie.some(e=>e.id===t)}function ot(){const t=G.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(X,{className:"p-0",children:s.jsx(ee,{className:"text-sm",children:"Default home agents"})}),t[0]=e):e=t[0];let i;return t[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsxs(Y,{className:"p-6",children:[e,s.jsx(te,{className:"p-0 flex flex-col gap-2",children:Array.from({length:4}).map(lt)})]}),t[1]=i):i=t[1],i}function lt(t,e){return s.jsx(He,{className:"h-12 w-full rounded-lg"},e)}function rt(){const t=G.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(J.Suspense,{fallback:s.jsx(ot,{}),children:s.jsx(nt,{})}),t[0]=e):e=t[0],e}function ct(){const t=G.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Q,{children:s.jsx(Q.Content,{children:s.jsx(Q.Body,{children:s.jsxs("div",{className:"flex flex-col gap-6",children:[s.jsx(Q.Title,{children:"Organization"}),s.jsx(Ye,{}),s.jsx(Xe,{}),s.jsx(rt,{})]})})})}),t[0]=e):e=t[0],e}function Zt(){const t=G.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(ct,{}),t[0]=e):e=t[0],e}export{Zt as default};
@@ -1,4 +1,4 @@
1
- import{e as M,s as z,o as ve,b as ze,r as O,K as ne,n as He,a as Fe,j as t,c as he,B as oe,t as V,z as ie,f as We,a0 as Je,a1 as Xe,az as je,C as Ze,l as xe,V as et}from"./index-DHvfV22T.js";import{S as re,u as $,d as we,W as Be,j as ye}from"./constants-BgpFj97_.js";import{u as Ne}from"./use-navigate-to-agent-CVVCVmb_.js";import{c as ce,d as le,a as de,D as ue,b as tt}from"./dialog-BlDJEasr.js";import{i as Ae}from"./SearchMd-DmmmzJIi.js";import{C as qe}from"./collection-search-BSwS6tWM.js";import{c as Ee,b as Se,D as Oe,a as Le}from"./drawer-n2769KGk.js";import{u as Re}from"./use-mobile-DHF6z3l-.js";import{I as Me}from"./integration-icon-CI13mmaS.js";import{a as ke,u as nt}from"./use-connection-B4n7P5ZX.js";import{u as st,d as Qe}from"./use-mcp-tools-BGEi8TMH.js";import{b as Ue,u as it}from"./use-virtual-mcp-ByUoWLLO.js";import{C as ot}from"./checkbox-BafUZKEr.js";import{i as at}from"./Lock01-D0hjzmk2.js";import{I as rt}from"./agent-icon-B4FOoeEp.js";import{e as ct}from"./extract-connection-data-BkZ-2zmr.js";function lt(i){return i.toLowerCase().trim().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}async function dt(){const i=await fetch("/api/deco-sites");if(!i.ok){const e=await i.json().catch(()=>({}));throw new Error(e.error??`Failed to load sites (${i.status})`)}return i.json()}function Kt(i){const e=M.c(65),{open:n,onOpenChange:a,onBack:c}=i,{org:s}=z(),l=Ne(),m=ve(),{data:f}=ze.useSession(),[x,h]=O.useState(null),[T,d]=O.useState("");let u;e[0]!==s.id?(u={connectionId:re,orgId:s.id},e[0]=s.id,e[1]=u):u=e[1];const p=$(u);let r;e[2]!==f?.user?.email?(r=ne.decoSites(f?.user?.email),e[2]=f?.user?.email,e[3]=r):r=e[3];const g=n&&!!f?.user?.email;let C;e[4]!==r||e[5]!==g?(C={queryKey:r,queryFn:dt,enabled:g,staleTime:6e4,retry:!1},e[4]=r,e[5]=g,e[6]=C):C=e[6];const{data:_,isLoading:N,error:b}=He(C),I=_?.sites??[];let o;e[7]!==a?(o=w=>{w||(h(null),d("")),a(w)},e[7]=a,e[8]=o):o=e[8];const y=o;let A;e[9]!==T?(A=w=>w.name.toLowerCase().includes(T.toLowerCase())||w.domains?.[0]?.domain.toLowerCase().includes(T.toLowerCase()),e[9]=T,e[10]=A):A=e[10];const v=I.filter(A),E=!x||v.some(w=>w.name===x);let j;e[11]!==p||e[12]!==s.id?(j=async w=>{V("deco_site_import_started",{site_name:w});const G=await fetch("/api/deco-sites/connection",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({siteName:w,orgId:s.id})}),D=await G.json().catch(ft);if(!G.ok)throw new Error(D.error??`Failed to create connection (${G.status})`);const L=D.connId;if(!L)throw new Error("Server did not return a connection ID");const ge=D.icon??null,te=lt(w),Pe=await p.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:w,description:"Imported from deco.cx",pinned:!0,icon:ge??null,subtype:"project",metadata:{instructions:null,enabled_plugins:[],ui:{banner:null,bannerColor:"#22C55E",icon:ge,themeColor:"#22C55E",slug:te,pinnedViews:[{connectionId:L,toolName:"file_explorer",label:"Preview",icon:null},{connectionId:L,toolName:"fetch_assets",label:"Assets",icon:null},{connectionId:L,toolName:"get_monitor_data",label:"Monitor",icon:null},{connectionId:L,toolName:"list_pull_requests",label:"Pull Requests",icon:null},{connectionId:L,toolName:"list_releases",label:"Releases",icon:null}],layout:{defaultMainView:{type:"ext-apps",id:L,toolName:"file_explorer"}}}},connections:[{connection_id:L}]}}}),Ge=Pe.structuredContent??Pe;return{slug:te,virtualMcpId:Ge.item.id,connId:L,item:Ge.item}},e[11]=p,e[12]=s.id,e[13]=j):j=e[13];let S;e[14]!==p||e[15]!==y||e[16]!==l||e[17]!==s.id||e[18]!==m?(S=w=>{const{slug:G,virtualMcpId:D,item:L}=w;V("deco_site_import_succeeded",{site_name:L.title,virtual_mcp_id:D,slug:G}),m.setQueryData(ne.collectionItem(p,s.id,"","VIRTUAL_MCP",D),{item:L}),m.invalidateQueries({predicate:ge=>{const te=ge.queryKey;return te[1]===s.id&&te[3]==="collection"&&te[4]==="VIRTUAL_MCP"}}),m.invalidateQueries({queryKey:ne.projects(s.id)}),ie.success(`Imported ${G} from deco.cx`),y(!1),localStorage.setItem("mesh:sidebar-open",JSON.stringify(!1)),l(D)},e[14]=p,e[15]=y,e[16]=l,e[17]=s.id,e[18]=m,e[19]=S):S=e[19];let k;e[20]!==j||e[21]!==S?(k={mutationFn:j,onSuccess:S,onError:mt},e[20]=j,e[21]=S,e[22]=k):k=e[22];const U=Fe(k),H=le,se=ce,R="sm:max-w-[900px] p-0 gap-0 overflow-hidden";let P;e[23]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(de,{className:"sr-only",children:t.jsx(ue,{children:"Import from deco.cx"})}),e[23]=P):P=e[23];let F;e[24]!==c?(F=c&&t.jsx("button",{type:"button",onClick:c,className:"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors","aria-label":"Go back",children:t.jsx(Ae,{size:18})}),e[24]=c,e[25]=F):F=e[25];let me;e[26]===Symbol.for("react.memo_cache_sentinel")?(me=t.jsx("span",{className:"text-sm font-medium text-foreground",children:"Import from deco.cx"}),e[26]=me):me=e[26];let B;e[27]!==F?(B=t.jsxs("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3",children:[F,me]}),e[27]=F,e[28]=B):B=e[28];let fe;e[29]===Symbol.for("react.memo_cache_sentinel")?(fe=w=>{w.key==="Escape"&&d("")},e[29]=fe):fe=e[29];let q;e[30]!==T?(q=t.jsx("div",{children:t.jsx(qe,{value:T,onChange:d,placeholder:"Search sites...",onKeyDown:fe})}),e[30]=T,e[31]=q):q=e[31];const Ke="pb-0 min-h-[300px]";let Q;e[32]!==N?(Q=N&&t.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:"Loading sites..."}),e[32]=N,e[33]=Q):Q=e[33];const _e=!N&&!b&&I.length===0&&t.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:"No sites found for this account."}),Ce=!N&&I.length>0&&t.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4 max-h-[420px] overflow-y-auto py-4 px-8 [scrollbar-gutter:stable]",children:[v.length===0&&t.jsxs("p",{className:"col-span-3 text-sm text-muted-foreground text-center py-8",children:["No sites match “",T,"”"]}),v.map(w=>{const G=w.domains?.find(ut)?.domain??w.domains?.[0]?.domain,D=x===w.name;return t.jsxs("button",{type:"button",onClick:()=>h(w.name),className:he("flex flex-col rounded-xl border overflow-hidden text-left transition-all cursor-pointer",D?"border-primary ring-1 ring-primary":"border-border hover:border-muted-foreground/40"),children:[t.jsx("div",{className:"w-full aspect-video bg-muted overflow-hidden",children:w.thumb_url?t.jsx("img",{src:w.thumb_url,alt:w.name,className:"w-full h-full object-cover",loading:"lazy"}):t.jsx("div",{className:"w-full h-full bg-muted"})}),t.jsxs("div",{className:"px-4 py-3",children:[t.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:w.name}),G&&t.jsx("p",{className:"text-xs text-muted-foreground truncate mt-0.5",children:G})]})]},w.name)})]});let Y;e[34]!==Q||e[35]!==_e||e[36]!==Ce?(Y=t.jsxs("div",{className:Ke,children:[Q,_e,Ce]}),e[34]=Q,e[35]=_e,e[36]=Ce,e[37]=Y):Y=e[37];let K;e[38]!==y?(K=()=>y(!1),e[38]=y,e[39]=K):K=e[39];let W;e[40]!==U.isPending||e[41]!==K?(W=t.jsx(oe,{variant:"outline",onClick:K,disabled:U.isPending,children:"Cancel"}),e[40]=U.isPending,e[41]=K,e[42]=W):W=e[42];const Ie=!x||!E||U.isPending||N;let J;e[43]!==U||e[44]!==x?(J=()=>x&&U.mutate(x),e[43]=U,e[44]=x,e[45]=J):J=e[45];const Te=U.isPending?"Importing...":"Import";let X;e[46]!==Ie||e[47]!==J||e[48]!==Te?(X=t.jsx(oe,{disabled:Ie,onClick:J,children:Te}),e[46]=Ie,e[47]=J,e[48]=Te,e[49]=X):X=e[49];let Z;e[50]!==W||e[51]!==X?(Z=t.jsxs(tt,{className:"px-8 py-5 border-t border-border",children:[W,X]}),e[50]=W,e[51]=X,e[52]=Z):Z=e[52];let ee;e[53]!==se||e[54]!==P||e[55]!==B||e[56]!==q||e[57]!==Y||e[58]!==Z?(ee=t.jsxs(se,{className:R,children:[P,B,q,Y,Z]}),e[53]=se,e[54]=P,e[55]=B,e[56]=q,e[57]=Y,e[58]=Z,e[59]=ee):ee=e[59];let pe;return e[60]!==H||e[61]!==y||e[62]!==n||e[63]!==ee?(pe=t.jsx(H,{open:n,onOpenChange:y,children:ee}),e[60]=H,e[61]=y,e[62]=n,e[63]=ee,e[64]=pe):pe=e[64],pe}function ut(i){return i.production}function mt(i){V("deco_site_import_failed",{error:i instanceof Error?i.message:"Unknown error"}),ie.error("Import failed: "+(i instanceof Error?i.message:"Unknown error"))}function ft(){return{}}function Ye(i,e){const n=M.c(11),{org:a}=z();let c;n[0]!==a.id?(c=we.REGISTRY(a.id),n[0]=a.id,n[1]=c):c=n[1];const s=c;let l;n[2]!==a.id||n[3]!==s?(l={connectionId:s,orgId:a.id},n[2]=a.id,n[3]=s,n[4]=l):l=n[4];const m=$(l);let f;n[5]!==i?(f={name:i},n[5]=i,n[6]=f):f=n[6];const x=e?.enabled??!0;let h;return n[7]!==m||n[8]!==f||n[9]!==x?(h={client:m,toolName:"COLLECTION_REGISTRY_APP_GET",toolArguments:f,enabled:x,staleTime:3e5,select:pt},n[7]=m,n[8]=f,n[9]=x,n[10]=h):h=n[10],st(h)}function pt(i){return i.structuredContent?.item??null}const gt=["Full HAR capture with cache, TTFB, and request analysis","Screenshot capture for visual inspection","Page discovery via sitemap, navigation, and link crawling","SEO audit — meta tags, structured data, robots.txt","Third-party script inventory and size analysis","Dead link detection across the entire site","Deco-specific diagnostics (?__d debug mode)"];function De(i){const e=M.c(7),{onRecruit:n,isRecruiting:a,isLoading:c}=i;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx("p",{className:"text-sm text-muted-foreground",children:"Add a blackbox diagnostics agent that tests your storefront from the outside — no internal access needed. Give it a URL and it produces a detailed performance and health report."}),e[0]=s):s=e[0];let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx("p",{className:"text-sm font-medium text-foreground",children:"Capabilities"}),e[1]=l):l=e[1];let m;e[2]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsxs("div",{className:"space-y-2",children:[l,t.jsx("ul",{className:"space-y-1.5",children:gt.map(ht)})]}),e[2]=m):m=e[2];const f=a||c,x=a?"Setting up...":"Add Site Diagnostics";let h;return e[3]!==n||e[4]!==f||e[5]!==x?(h=t.jsxs("div",{className:"flex flex-col gap-6",children:[s,m,t.jsx(oe,{onClick:n,disabled:f,className:"w-full cursor-pointer",children:x})]}),e[3]=n,e[4]=f,e[5]=x,e[6]=h):h=e[6],h}function ht(i){return t.jsxs("li",{className:"text-sm text-muted-foreground flex items-start gap-2",children:[t.jsx("span",{className:"text-emerald-500 mt-0.5 shrink-0",children:"+"}),i]},i)}function Wt({open:i,onOpenChange:e,existingAgent:n}){const a=Re(),{org:c}=z(),s=Ne(),l=ke(),m=Ue(),f=$({connectionId:re,orgId:c.id}),x=Qe({client:f}),[h,T]=O.useState(!1),d=Be.find(I=>I.id==="site-diagnostics"),{data:u,isLoading:p}=Ye(d.appId,{enabled:i}),r=u?.title||u?.server?.title||u?.server?.name||d.title,g=u?.server?.icons?.[0]?.src??d.icon,C=u?.server?.description??null,_=t.jsx(Me,{icon:g,name:r,size:"sm"}),N=async()=>{if(u){if(n){e(!1),s(n.id);return}T(!0);try{const I=await x.mutateAsync({name:"COLLECTION_CONNECTIONS_LIST",arguments:{where:{field:["app_id"],operator:"eq",value:d.appId},limit:1,offset:0}});let o;const A=I?.structuredContent?.items?.find(E=>E.app_id===d.appId);if(A)o=A.id;else{const E=u.server?.remotes?.[0]?.url;if(!E)throw new Error("Registry item is missing a remote URL for site-diagnostics");o=(await l.create.mutateAsync({title:r,description:C,icon:u.server?.icons?.[0]?.src??d.icon,connection_type:"HTTP",connection_url:E,app_name:u.server?.name??"site-diagnostics",app_id:d.appId,metadata:{type:"site-diagnostics",source:"store",registry_item_id:d.appId,verified:!0}})).id}const v=await m.create.mutateAsync({title:r,description:C,icon:g,status:"active",connections:[{connection_id:o,selected_tools:null,selected_resources:null,selected_prompts:null}],metadata:{type:"site-diagnostics",instructions:null,ui:{pinnedViews:[{connectionId:o,toolName:"diagnose",label:"diagnose",icon:null}],layout:{defaultMainView:{type:"ext-apps",id:o,toolName:"diagnose"}}}}});V("agent_recruit_confirmed",{template_id:"site-diagnostics",agent_id:v.id}),e(!1),s(v.id)}catch(I){V("agent_recruit_failed",{template_id:"site-diagnostics",error:I instanceof Error?I.message:String(I)}),console.error("Failed to create Site Diagnostics agent:",I)}finally{T(!1)}}},b=`Add ${r}`;return a?t.jsx(Ee,{open:i,onOpenChange:e,children:t.jsxs(Se,{className:"h-[70dvh]",children:[t.jsx(Oe,{className:"px-4 pt-4 pb-4 shrink-0",children:t.jsxs("div",{className:"flex items-center gap-3",children:[_,t.jsx(Le,{className:"text-xl font-semibold",children:b})]})}),t.jsx("div",{className:"flex flex-col flex-1 min-h-0 px-4 pb-8",children:t.jsx(De,{onRecruit:N,isRecruiting:h,isLoading:p})})]})}):t.jsx(le,{open:i,onOpenChange:e,children:t.jsxs(ce,{className:"sm:max-w-[500px] p-8",children:[t.jsx(de,{className:"mb-4",children:t.jsxs("div",{className:"flex items-center gap-3",children:[_,t.jsx(ue,{className:"text-xl font-semibold",children:b})]})}),t.jsx(De,{onRecruit:N,isRecruiting:h,isLoading:p})]})})}const xt="https://sites-lean-canva.decocache.com/api/mcp",Nt=["Build and update Lean Canvas business models visually","Interactive grid UI with all 9 canvas sections","Iterative updates — add information as you discover it","Covers: Problem, Solution, Key Metrics, Unique Value Proposition","Covers: Channels, Customer Segments, Cost Structure, Revenue Streams","Unfair Advantage analysis"];function Ve(i){const e=M.c(7),{onRecruit:n,isRecruiting:a}=i;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("p",{className:"text-sm text-muted-foreground",children:"Add a Lean Canvas agent that helps you build and iterate on your business model. Describe your idea and it produces a visual, structured canvas."}),e[0]=c):c=e[0];let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx("p",{className:"text-sm font-medium text-foreground",children:"Capabilities"}),e[1]=s):s=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsxs("div",{className:"space-y-2",children:[s,t.jsx("ul",{className:"space-y-1.5",children:Nt.map(_t)})]}),e[2]=l):l=e[2];const m=a?"Setting up...":"Add Lean Canvas";let f;return e[3]!==a||e[4]!==n||e[5]!==m?(f=t.jsxs("div",{className:"flex flex-col gap-6",children:[c,l,t.jsx(oe,{onClick:n,disabled:a,className:"w-full cursor-pointer",children:m})]}),e[3]=a,e[4]=n,e[5]=m,e[6]=f):f=e[6],f}function _t(i){return t.jsxs("li",{className:"text-sm text-muted-foreground flex items-start gap-2",children:[t.jsx("span",{className:"text-emerald-500 mt-0.5 shrink-0",children:"+"}),i]},i)}function Jt({open:i,onOpenChange:e,existingAgent:n}){const a=Re(),{org:c}=z(),s=Ne(),l=ke(),m=Ue(),f=$({connectionId:re,orgId:c.id}),x=Qe({client:f}),[h,T]=O.useState(!1),d=Be.find(g=>g.id==="lean-canvas"),u=t.jsx(Me,{icon:d.icon,name:d.title,size:"sm"}),p=async()=>{if(n){e(!1),s(n.id);return}T(!0);try{const g=await x.mutateAsync({name:"COLLECTION_CONNECTIONS_LIST",arguments:{where:{field:["app_id"],operator:"eq",value:"lean-canvas"},limit:1,offset:0}});let C;const N=g?.structuredContent?.items?.find(o=>o.app_id==="lean-canvas"),b=we.SELF(c.id);N?C=N.id:C=(await l.create.mutateAsync({title:d.title,description:"Lean Canvas business model builder",icon:d.icon,connection_type:"HTTP",connection_url:xt,app_name:"lean-canvas",app_id:"lean-canvas",configuration_state:{OBJECT_STORAGE:{__type:"@deco/object-storage",value:b}},metadata:{type:"lean-canvas",source:"store",verified:!0}})).id;const I=await m.create.mutateAsync({title:d.title,description:"Lean Canvas business model builder",icon:d.icon,status:"active",connections:[{connection_id:C,selected_tools:null,selected_resources:null,selected_prompts:null},{connection_id:b,selected_tools:null,selected_resources:null,selected_prompts:null}],metadata:{type:"lean-canvas",instructions:null,ui:{pinnedViews:[{connectionId:C,toolName:"lean_canvas",label:"lean_canvas",icon:null}],layout:{defaultMainView:{type:"ext-apps",id:C,toolName:"lean_canvas"}}}}});V("agent_recruit_confirmed",{template_id:"lean-canvas",agent_id:I.id}),e(!1),s(I.id)}catch(g){V("agent_recruit_failed",{template_id:"lean-canvas",error:g instanceof Error?g.message:String(g)}),console.error("Failed to create Lean Canvas agent:",g)}finally{T(!1)}},r=`Add ${d.title}`;return a?t.jsx(Ee,{open:i,onOpenChange:e,children:t.jsxs(Se,{className:"h-[70dvh]",children:[t.jsx(Oe,{className:"px-4 pt-4 pb-4 shrink-0",children:t.jsxs("div",{className:"flex items-center gap-3",children:[u,t.jsx(Le,{className:"text-xl font-semibold",children:r})]})}),t.jsx("div",{className:"flex flex-col flex-1 min-h-0 px-4 pb-8",children:t.jsx(Ve,{onRecruit:p,isRecruiting:h})})]})}):t.jsx(le,{open:i,onOpenChange:e,children:t.jsxs(ce,{className:"sm:max-w-[500px] p-8",children:[t.jsx(de,{className:"mb-4",children:t.jsxs("div",{className:"flex items-center gap-3",children:[u,t.jsx(ue,{className:"text-xl font-semibold",children:r})]})}),t.jsx(Ve,{onRecruit:p,isRecruiting:h})]})})}const Ct=`<role>
1
+ import{e as M,s as z,o as ve,b as ze,r as O,K as ne,n as He,a as Fe,j as t,c as he,B as oe,t as V,z as ie,f as We,a0 as Je,a1 as Xe,az as je,C as Ze,l as xe,V as et}from"./index-CNolBSVE.js";import{S as re,u as $,d as we,W as Be,j as ye}from"./constants-D8VkIs2c.js";import{u as Ne}from"./use-navigate-to-agent-CLfSU3ru.js";import{c as ce,d as le,a as de,D as ue,b as tt}from"./dialog-BOagZAx2.js";import{i as Ae}from"./SearchMd-VdXbz8fL.js";import{C as qe}from"./collection-search-DgokupF2.js";import{c as Ee,b as Se,D as Oe,a as Le}from"./drawer-BRUzFEdi.js";import{u as Re}from"./use-mobile-Ctb5URy7.js";import{I as Me}from"./integration-icon-De50Mm7k.js";import{a as ke,u as nt}from"./use-connection-DIvNoxL5.js";import{u as st,d as Qe}from"./use-mcp-tools-tZ37UBLL.js";import{b as Ue,u as it}from"./use-virtual-mcp-CDOk_IIy.js";import{C as ot}from"./checkbox-CPqdqI54.js";import{i as at}from"./Lock01-CXrm99F-.js";import{I as rt}from"./agent-icon-DCE-D-qC.js";import{e as ct}from"./extract-connection-data-V-eInhlP.js";function lt(i){return i.toLowerCase().trim().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}async function dt(){const i=await fetch("/api/deco-sites");if(!i.ok){const e=await i.json().catch(()=>({}));throw new Error(e.error??`Failed to load sites (${i.status})`)}return i.json()}function Kt(i){const e=M.c(65),{open:n,onOpenChange:a,onBack:c}=i,{org:s}=z(),l=Ne(),m=ve(),{data:f}=ze.useSession(),[x,h]=O.useState(null),[T,d]=O.useState("");let u;e[0]!==s.id?(u={connectionId:re,orgId:s.id},e[0]=s.id,e[1]=u):u=e[1];const p=$(u);let r;e[2]!==f?.user?.email?(r=ne.decoSites(f?.user?.email),e[2]=f?.user?.email,e[3]=r):r=e[3];const g=n&&!!f?.user?.email;let C;e[4]!==r||e[5]!==g?(C={queryKey:r,queryFn:dt,enabled:g,staleTime:6e4,retry:!1},e[4]=r,e[5]=g,e[6]=C):C=e[6];const{data:_,isLoading:N,error:b}=He(C),I=_?.sites??[];let o;e[7]!==a?(o=w=>{w||(h(null),d("")),a(w)},e[7]=a,e[8]=o):o=e[8];const y=o;let A;e[9]!==T?(A=w=>w.name.toLowerCase().includes(T.toLowerCase())||w.domains?.[0]?.domain.toLowerCase().includes(T.toLowerCase()),e[9]=T,e[10]=A):A=e[10];const v=I.filter(A),E=!x||v.some(w=>w.name===x);let j;e[11]!==p||e[12]!==s.id?(j=async w=>{V("deco_site_import_started",{site_name:w});const G=await fetch("/api/deco-sites/connection",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({siteName:w,orgId:s.id})}),D=await G.json().catch(ft);if(!G.ok)throw new Error(D.error??`Failed to create connection (${G.status})`);const L=D.connId;if(!L)throw new Error("Server did not return a connection ID");const ge=D.icon??null,te=lt(w),Pe=await p.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:w,description:"Imported from deco.cx",pinned:!0,icon:ge??null,subtype:"project",metadata:{instructions:null,enabled_plugins:[],ui:{banner:null,bannerColor:"#22C55E",icon:ge,themeColor:"#22C55E",slug:te,pinnedViews:[{connectionId:L,toolName:"file_explorer",label:"Preview",icon:null},{connectionId:L,toolName:"fetch_assets",label:"Assets",icon:null},{connectionId:L,toolName:"get_monitor_data",label:"Monitor",icon:null},{connectionId:L,toolName:"list_pull_requests",label:"Pull Requests",icon:null},{connectionId:L,toolName:"list_releases",label:"Releases",icon:null}],layout:{defaultMainView:{type:"ext-apps",id:L,toolName:"file_explorer"}}}},connections:[{connection_id:L}]}}}),Ge=Pe.structuredContent??Pe;return{slug:te,virtualMcpId:Ge.item.id,connId:L,item:Ge.item}},e[11]=p,e[12]=s.id,e[13]=j):j=e[13];let S;e[14]!==p||e[15]!==y||e[16]!==l||e[17]!==s.id||e[18]!==m?(S=w=>{const{slug:G,virtualMcpId:D,item:L}=w;V("deco_site_import_succeeded",{site_name:L.title,virtual_mcp_id:D,slug:G}),m.setQueryData(ne.collectionItem(p,s.id,"","VIRTUAL_MCP",D),{item:L}),m.invalidateQueries({predicate:ge=>{const te=ge.queryKey;return te[1]===s.id&&te[3]==="collection"&&te[4]==="VIRTUAL_MCP"}}),m.invalidateQueries({queryKey:ne.projects(s.id)}),ie.success(`Imported ${G} from deco.cx`),y(!1),localStorage.setItem("mesh:sidebar-open",JSON.stringify(!1)),l(D)},e[14]=p,e[15]=y,e[16]=l,e[17]=s.id,e[18]=m,e[19]=S):S=e[19];let k;e[20]!==j||e[21]!==S?(k={mutationFn:j,onSuccess:S,onError:mt},e[20]=j,e[21]=S,e[22]=k):k=e[22];const U=Fe(k),H=le,se=ce,R="sm:max-w-[900px] p-0 gap-0 overflow-hidden";let P;e[23]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(de,{className:"sr-only",children:t.jsx(ue,{children:"Import from deco.cx"})}),e[23]=P):P=e[23];let F;e[24]!==c?(F=c&&t.jsx("button",{type:"button",onClick:c,className:"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors","aria-label":"Go back",children:t.jsx(Ae,{size:18})}),e[24]=c,e[25]=F):F=e[25];let me;e[26]===Symbol.for("react.memo_cache_sentinel")?(me=t.jsx("span",{className:"text-sm font-medium text-foreground",children:"Import from deco.cx"}),e[26]=me):me=e[26];let B;e[27]!==F?(B=t.jsxs("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3",children:[F,me]}),e[27]=F,e[28]=B):B=e[28];let fe;e[29]===Symbol.for("react.memo_cache_sentinel")?(fe=w=>{w.key==="Escape"&&d("")},e[29]=fe):fe=e[29];let q;e[30]!==T?(q=t.jsx("div",{children:t.jsx(qe,{value:T,onChange:d,placeholder:"Search sites...",onKeyDown:fe})}),e[30]=T,e[31]=q):q=e[31];const Ke="pb-0 min-h-[300px]";let Q;e[32]!==N?(Q=N&&t.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:"Loading sites..."}),e[32]=N,e[33]=Q):Q=e[33];const _e=!N&&!b&&I.length===0&&t.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:"No sites found for this account."}),Ce=!N&&I.length>0&&t.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4 max-h-[420px] overflow-y-auto py-4 px-8 [scrollbar-gutter:stable]",children:[v.length===0&&t.jsxs("p",{className:"col-span-3 text-sm text-muted-foreground text-center py-8",children:["No sites match “",T,"”"]}),v.map(w=>{const G=w.domains?.find(ut)?.domain??w.domains?.[0]?.domain,D=x===w.name;return t.jsxs("button",{type:"button",onClick:()=>h(w.name),className:he("flex flex-col rounded-xl border overflow-hidden text-left transition-all cursor-pointer",D?"border-primary ring-1 ring-primary":"border-border hover:border-muted-foreground/40"),children:[t.jsx("div",{className:"w-full aspect-video bg-muted overflow-hidden",children:w.thumb_url?t.jsx("img",{src:w.thumb_url,alt:w.name,className:"w-full h-full object-cover",loading:"lazy"}):t.jsx("div",{className:"w-full h-full bg-muted"})}),t.jsxs("div",{className:"px-4 py-3",children:[t.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:w.name}),G&&t.jsx("p",{className:"text-xs text-muted-foreground truncate mt-0.5",children:G})]})]},w.name)})]});let Y;e[34]!==Q||e[35]!==_e||e[36]!==Ce?(Y=t.jsxs("div",{className:Ke,children:[Q,_e,Ce]}),e[34]=Q,e[35]=_e,e[36]=Ce,e[37]=Y):Y=e[37];let K;e[38]!==y?(K=()=>y(!1),e[38]=y,e[39]=K):K=e[39];let W;e[40]!==U.isPending||e[41]!==K?(W=t.jsx(oe,{variant:"outline",onClick:K,disabled:U.isPending,children:"Cancel"}),e[40]=U.isPending,e[41]=K,e[42]=W):W=e[42];const Ie=!x||!E||U.isPending||N;let J;e[43]!==U||e[44]!==x?(J=()=>x&&U.mutate(x),e[43]=U,e[44]=x,e[45]=J):J=e[45];const Te=U.isPending?"Importing...":"Import";let X;e[46]!==Ie||e[47]!==J||e[48]!==Te?(X=t.jsx(oe,{disabled:Ie,onClick:J,children:Te}),e[46]=Ie,e[47]=J,e[48]=Te,e[49]=X):X=e[49];let Z;e[50]!==W||e[51]!==X?(Z=t.jsxs(tt,{className:"px-8 py-5 border-t border-border",children:[W,X]}),e[50]=W,e[51]=X,e[52]=Z):Z=e[52];let ee;e[53]!==se||e[54]!==P||e[55]!==B||e[56]!==q||e[57]!==Y||e[58]!==Z?(ee=t.jsxs(se,{className:R,children:[P,B,q,Y,Z]}),e[53]=se,e[54]=P,e[55]=B,e[56]=q,e[57]=Y,e[58]=Z,e[59]=ee):ee=e[59];let pe;return e[60]!==H||e[61]!==y||e[62]!==n||e[63]!==ee?(pe=t.jsx(H,{open:n,onOpenChange:y,children:ee}),e[60]=H,e[61]=y,e[62]=n,e[63]=ee,e[64]=pe):pe=e[64],pe}function ut(i){return i.production}function mt(i){V("deco_site_import_failed",{error:i instanceof Error?i.message:"Unknown error"}),ie.error("Import failed: "+(i instanceof Error?i.message:"Unknown error"))}function ft(){return{}}function Ye(i,e){const n=M.c(11),{org:a}=z();let c;n[0]!==a.id?(c=we.REGISTRY(a.id),n[0]=a.id,n[1]=c):c=n[1];const s=c;let l;n[2]!==a.id||n[3]!==s?(l={connectionId:s,orgId:a.id},n[2]=a.id,n[3]=s,n[4]=l):l=n[4];const m=$(l);let f;n[5]!==i?(f={name:i},n[5]=i,n[6]=f):f=n[6];const x=e?.enabled??!0;let h;return n[7]!==m||n[8]!==f||n[9]!==x?(h={client:m,toolName:"COLLECTION_REGISTRY_APP_GET",toolArguments:f,enabled:x,staleTime:3e5,select:pt},n[7]=m,n[8]=f,n[9]=x,n[10]=h):h=n[10],st(h)}function pt(i){return i.structuredContent?.item??null}const gt=["Full HAR capture with cache, TTFB, and request analysis","Screenshot capture for visual inspection","Page discovery via sitemap, navigation, and link crawling","SEO audit — meta tags, structured data, robots.txt","Third-party script inventory and size analysis","Dead link detection across the entire site","Deco-specific diagnostics (?__d debug mode)"];function De(i){const e=M.c(7),{onRecruit:n,isRecruiting:a,isLoading:c}=i;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx("p",{className:"text-sm text-muted-foreground",children:"Add a blackbox diagnostics agent that tests your storefront from the outside — no internal access needed. Give it a URL and it produces a detailed performance and health report."}),e[0]=s):s=e[0];let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx("p",{className:"text-sm font-medium text-foreground",children:"Capabilities"}),e[1]=l):l=e[1];let m;e[2]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsxs("div",{className:"space-y-2",children:[l,t.jsx("ul",{className:"space-y-1.5",children:gt.map(ht)})]}),e[2]=m):m=e[2];const f=a||c,x=a?"Setting up...":"Add Site Diagnostics";let h;return e[3]!==n||e[4]!==f||e[5]!==x?(h=t.jsxs("div",{className:"flex flex-col gap-6",children:[s,m,t.jsx(oe,{onClick:n,disabled:f,className:"w-full cursor-pointer",children:x})]}),e[3]=n,e[4]=f,e[5]=x,e[6]=h):h=e[6],h}function ht(i){return t.jsxs("li",{className:"text-sm text-muted-foreground flex items-start gap-2",children:[t.jsx("span",{className:"text-emerald-500 mt-0.5 shrink-0",children:"+"}),i]},i)}function Wt({open:i,onOpenChange:e,existingAgent:n}){const a=Re(),{org:c}=z(),s=Ne(),l=ke(),m=Ue(),f=$({connectionId:re,orgId:c.id}),x=Qe({client:f}),[h,T]=O.useState(!1),d=Be.find(I=>I.id==="site-diagnostics"),{data:u,isLoading:p}=Ye(d.appId,{enabled:i}),r=u?.title||u?.server?.title||u?.server?.name||d.title,g=u?.server?.icons?.[0]?.src??d.icon,C=u?.server?.description??null,_=t.jsx(Me,{icon:g,name:r,size:"sm"}),N=async()=>{if(u){if(n){e(!1),s(n.id);return}T(!0);try{const I=await x.mutateAsync({name:"COLLECTION_CONNECTIONS_LIST",arguments:{where:{field:["app_id"],operator:"eq",value:d.appId},limit:1,offset:0}});let o;const A=I?.structuredContent?.items?.find(E=>E.app_id===d.appId);if(A)o=A.id;else{const E=u.server?.remotes?.[0]?.url;if(!E)throw new Error("Registry item is missing a remote URL for site-diagnostics");o=(await l.create.mutateAsync({title:r,description:C,icon:u.server?.icons?.[0]?.src??d.icon,connection_type:"HTTP",connection_url:E,app_name:u.server?.name??"site-diagnostics",app_id:d.appId,metadata:{type:"site-diagnostics",source:"store",registry_item_id:d.appId,verified:!0}})).id}const v=await m.create.mutateAsync({title:r,description:C,icon:g,status:"active",connections:[{connection_id:o,selected_tools:null,selected_resources:null,selected_prompts:null}],metadata:{type:"site-diagnostics",instructions:null,ui:{pinnedViews:[{connectionId:o,toolName:"diagnose",label:"diagnose",icon:null}],layout:{defaultMainView:{type:"ext-apps",id:o,toolName:"diagnose"}}}}});V("agent_recruit_confirmed",{template_id:"site-diagnostics",agent_id:v.id}),e(!1),s(v.id)}catch(I){V("agent_recruit_failed",{template_id:"site-diagnostics",error:I instanceof Error?I.message:String(I)}),console.error("Failed to create Site Diagnostics agent:",I)}finally{T(!1)}}},b=`Add ${r}`;return a?t.jsx(Ee,{open:i,onOpenChange:e,children:t.jsxs(Se,{className:"h-[70dvh]",children:[t.jsx(Oe,{className:"px-4 pt-4 pb-4 shrink-0",children:t.jsxs("div",{className:"flex items-center gap-3",children:[_,t.jsx(Le,{className:"text-xl font-semibold",children:b})]})}),t.jsx("div",{className:"flex flex-col flex-1 min-h-0 px-4 pb-8",children:t.jsx(De,{onRecruit:N,isRecruiting:h,isLoading:p})})]})}):t.jsx(le,{open:i,onOpenChange:e,children:t.jsxs(ce,{className:"sm:max-w-[500px] p-8",children:[t.jsx(de,{className:"mb-4",children:t.jsxs("div",{className:"flex items-center gap-3",children:[_,t.jsx(ue,{className:"text-xl font-semibold",children:b})]})}),t.jsx(De,{onRecruit:N,isRecruiting:h,isLoading:p})]})})}const xt="https://sites-lean-canva.decocache.com/api/mcp",Nt=["Build and update Lean Canvas business models visually","Interactive grid UI with all 9 canvas sections","Iterative updates — add information as you discover it","Covers: Problem, Solution, Key Metrics, Unique Value Proposition","Covers: Channels, Customer Segments, Cost Structure, Revenue Streams","Unfair Advantage analysis"];function Ve(i){const e=M.c(7),{onRecruit:n,isRecruiting:a}=i;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("p",{className:"text-sm text-muted-foreground",children:"Add a Lean Canvas agent that helps you build and iterate on your business model. Describe your idea and it produces a visual, structured canvas."}),e[0]=c):c=e[0];let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx("p",{className:"text-sm font-medium text-foreground",children:"Capabilities"}),e[1]=s):s=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsxs("div",{className:"space-y-2",children:[s,t.jsx("ul",{className:"space-y-1.5",children:Nt.map(_t)})]}),e[2]=l):l=e[2];const m=a?"Setting up...":"Add Lean Canvas";let f;return e[3]!==a||e[4]!==n||e[5]!==m?(f=t.jsxs("div",{className:"flex flex-col gap-6",children:[c,l,t.jsx(oe,{onClick:n,disabled:a,className:"w-full cursor-pointer",children:m})]}),e[3]=a,e[4]=n,e[5]=m,e[6]=f):f=e[6],f}function _t(i){return t.jsxs("li",{className:"text-sm text-muted-foreground flex items-start gap-2",children:[t.jsx("span",{className:"text-emerald-500 mt-0.5 shrink-0",children:"+"}),i]},i)}function Jt({open:i,onOpenChange:e,existingAgent:n}){const a=Re(),{org:c}=z(),s=Ne(),l=ke(),m=Ue(),f=$({connectionId:re,orgId:c.id}),x=Qe({client:f}),[h,T]=O.useState(!1),d=Be.find(g=>g.id==="lean-canvas"),u=t.jsx(Me,{icon:d.icon,name:d.title,size:"sm"}),p=async()=>{if(n){e(!1),s(n.id);return}T(!0);try{const g=await x.mutateAsync({name:"COLLECTION_CONNECTIONS_LIST",arguments:{where:{field:["app_id"],operator:"eq",value:"lean-canvas"},limit:1,offset:0}});let C;const N=g?.structuredContent?.items?.find(o=>o.app_id==="lean-canvas"),b=we.SELF(c.id);N?C=N.id:C=(await l.create.mutateAsync({title:d.title,description:"Lean Canvas business model builder",icon:d.icon,connection_type:"HTTP",connection_url:xt,app_name:"lean-canvas",app_id:"lean-canvas",configuration_state:{OBJECT_STORAGE:{__type:"@deco/object-storage",value:b}},metadata:{type:"lean-canvas",source:"store",verified:!0}})).id;const I=await m.create.mutateAsync({title:d.title,description:"Lean Canvas business model builder",icon:d.icon,status:"active",connections:[{connection_id:C,selected_tools:null,selected_resources:null,selected_prompts:null},{connection_id:b,selected_tools:null,selected_resources:null,selected_prompts:null}],metadata:{type:"lean-canvas",instructions:null,ui:{pinnedViews:[{connectionId:C,toolName:"lean_canvas",label:"lean_canvas",icon:null}],layout:{defaultMainView:{type:"ext-apps",id:C,toolName:"lean_canvas"}}}}});V("agent_recruit_confirmed",{template_id:"lean-canvas",agent_id:I.id}),e(!1),s(I.id)}catch(g){V("agent_recruit_failed",{template_id:"lean-canvas",error:g instanceof Error?g.message:String(g)}),console.error("Failed to create Lean Canvas agent:",g)}finally{T(!1)}},r=`Add ${d.title}`;return a?t.jsx(Ee,{open:i,onOpenChange:e,children:t.jsxs(Se,{className:"h-[70dvh]",children:[t.jsx(Oe,{className:"px-4 pt-4 pb-4 shrink-0",children:t.jsxs("div",{className:"flex items-center gap-3",children:[u,t.jsx(Le,{className:"text-xl font-semibold",children:r})]})}),t.jsx("div",{className:"flex flex-col flex-1 min-h-0 px-4 pb-8",children:t.jsx(Ve,{onRecruit:p,isRecruiting:h})})]})}):t.jsx(le,{open:i,onOpenChange:e,children:t.jsxs(ce,{className:"sm:max-w-[500px] p-8",children:[t.jsx(de,{className:"mb-4",children:t.jsxs("div",{className:"flex items-center gap-3",children:[u,t.jsx(ue,{className:"text-xl font-semibold",children:r})]})}),t.jsx(Ve,{onRecruit:p,isRecruiting:h})]})})}const Ct=`<role>
2
2
  You are the Agent Manager. You create, configure, and maintain agents (Virtual MCPs) in this workspace.
3
3
  </role>
4
4