decocms 2.285.1 → 2.286.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (381) hide show
  1. package/dist/client/assets/{AlertCircle-Ljx3VIeb.js → AlertCircle-DTmaHldD.js} +1 -1
  2. package/dist/client/assets/{ArrowNarrowLeft-B8YVT66M.js → ArrowNarrowLeft-DlPeFc4v.js} +1 -1
  3. package/dist/client/assets/{CheckCircle-BFRWTTWo.js → CheckCircle-DJ3lme5R.js} +1 -1
  4. package/dist/client/assets/{ChevronDown-BqFspEzt.js → ChevronDown-DGnjAtqs.js} +1 -1
  5. package/dist/client/assets/{ChevronRight-DCsBjQ-n.js → ChevronRight-DV9No7GF.js} +1 -1
  6. package/dist/client/assets/{ChevronUp-D7S3j_fa.js → ChevronUp-BkSgkwhO.js} +1 -1
  7. package/dist/client/assets/{Container-SHbLkl7K.js → Container-B1nHZdmn.js} +1 -1
  8. package/dist/client/assets/DotsVertical-Bp2tW8JI.js +1 -0
  9. package/dist/client/assets/{LinkExternal01-XmkIm96u.js → LinkExternal01-BBbCPDtX.js} +1 -1
  10. package/dist/client/assets/{Lock01-CXrm99F-.js → Lock01-DpPIS3K7.js} +1 -1
  11. package/dist/client/assets/{Palette-B46VjX8F.js → Palette-CI8n49a8.js} +1 -1
  12. package/dist/client/assets/{Play-9pX5w5-3.js → Play-DKFUTU3G.js} +1 -1
  13. package/dist/client/assets/{Plus-Bmk1thjl.js → Plus-oXFwCrYz.js} +1 -1
  14. package/dist/client/assets/RefreshCcw01-B10mKiE2.js +1 -0
  15. package/dist/client/assets/SearchMd-BRJBvWf4.js +1 -0
  16. package/dist/client/assets/{Settings02-C88OtRRq.js → Settings02-Dm9dFDqk.js} +1 -1
  17. package/dist/client/assets/Shield01-BZJVBd5S.js +1 -0
  18. package/dist/client/assets/{Star01-fuGmPeeu.js → Star01-_IJK5Yjt.js} +1 -1
  19. package/dist/client/assets/{Sun-ndN_CHuQ.js → Sun-QqE1VnS_.js} +1 -1
  20. package/dist/client/assets/{Tool01-DBxgF1Y_.js → Tool01-CKowkGsd.js} +1 -1
  21. package/dist/client/assets/{Trash01-BHBjIGXE.js → Trash01-C6bAXG6g.js} +1 -1
  22. package/dist/client/assets/{User01-DCiwOMBU.js → User01-C2-anwoO.js} +1 -1
  23. package/dist/client/assets/{Users03-Bgfd1KM0.js → Users03-DqYvPeZM.js} +1 -1
  24. package/dist/client/assets/{X-BWV-b86T.js → X-i9zBn6Hn.js} +1 -1
  25. package/dist/client/assets/XCircle-C1sJYG9R.js +1 -0
  26. package/dist/client/assets/XClose-BbIo6xHe.js +1 -0
  27. package/dist/client/assets/{Zap-K9sQXDlC.js → Zap-KmbRMccM.js} +1 -1
  28. package/dist/client/assets/{ZapSquare-CTcr_tRy.js → ZapSquare-DT93lGV4.js} +1 -1
  29. package/dist/client/assets/{accordion-COmeMo5z.js → accordion-BV3tm7bj.js} +1 -1
  30. package/dist/client/assets/agent-icon-CyE6nkC1.js +1 -0
  31. package/dist/client/assets/agents-list-7o6gZt-q.js +1 -0
  32. package/dist/client/assets/ai-providers-DI3UF9nU.js +1 -0
  33. package/dist/client/assets/{alert-dialog-DaP8t8su.js → alert-dialog-CicrCOay.js} +2 -2
  34. package/dist/client/assets/{auth-catchall-CerK6T4u.js → auth-catchall-Cyd7fWQv.js} +1 -1
  35. package/dist/client/assets/automation-list-row-B4Vfg4UC.js +1 -0
  36. package/dist/client/assets/automations-DRM_lJom.js +1 -0
  37. package/dist/client/assets/{avatar-gTIcZioB.js → avatar-CF1bgUpD.js} +1 -1
  38. package/dist/client/assets/{badge-DsWPcX1V.js → badge-s_TAXGUN.js} +1 -1
  39. package/dist/client/assets/{brand-context-CnnwTWNT.js → brand-context-iopLFZ2k.js} +1 -1
  40. package/dist/client/assets/{card-CPVRwbgl.js → card-CaekC2K0.js} +1 -1
  41. package/dist/client/assets/{chat-context-CZAEwDWp.js → chat-context-DP5UfIrn.js} +1 -1
  42. package/dist/client/assets/{checkbox-CPqdqI54.js → checkbox-DznLgPgR.js} +1 -1
  43. package/dist/client/assets/collection-detail-CTQuhG7N.js +1 -0
  44. package/dist/client/assets/collection-display-button-BgYKhoGQ.js +1 -0
  45. package/dist/client/assets/{collection-search-DgokupF2.js → collection-search-Bo2bOvRn.js} +1 -1
  46. package/dist/client/assets/{collection-search-lfil19IA.js → collection-search-DMqppne6.js} +1 -1
  47. package/dist/client/assets/collection-table-wrapper-KnWZIddd.js +1 -0
  48. package/dist/client/assets/{collection-tabs-BRY4wHvH.js → collection-tabs-CU6MCzSn.js} +1 -1
  49. package/dist/client/assets/{collections-lJhN2k9k.js → collections-DHmXATua.js} +1 -1
  50. package/dist/client/assets/command-D4w2xkZT.js +1 -0
  51. package/dist/client/assets/{connection-card-BrctpSfE.js → connection-card-DBz-rrLk.js} +1 -1
  52. package/dist/client/assets/connection-detail-zHqb5ZSw.js +1 -0
  53. package/dist/client/assets/{connection-form-helpers-C1FnnBdL.js → connection-form-helpers-CBEV0IXi.js} +1 -1
  54. package/dist/client/assets/connections-CHiGbl1F.js +1 -0
  55. package/dist/client/assets/{constants-D8VkIs2c.js → constants-DDHDU3PV.js} +1 -1
  56. package/dist/client/assets/{constants-D_Nupw5-.js → constants-v4RUVkEN.js} +1 -1
  57. package/dist/client/assets/{dialog-BOagZAx2.js → dialog-C4lREl-t.js} +1 -1
  58. package/dist/client/assets/{drawer-BRUzFEdi.js → drawer-BTCEaGGQ.js} +1 -1
  59. package/dist/client/assets/dropdown-menu-v2GifVOh.js +1 -0
  60. package/dist/client/assets/{dynamic-plugin-layout-ltkevohS.js → dynamic-plugin-layout-CVBBnlEt.js} +1 -1
  61. package/dist/client/assets/{empty-state-BokLRSGE.js → empty-state-BdQTFnZA.js} +1 -1
  62. package/dist/client/assets/{empty-state-DCK4Z2GX.js → empty-state-DdKZ_is7.js} +1 -1
  63. package/dist/client/assets/{extract-connection-data-V-eInhlP.js → extract-connection-data-CfXvFcGA.js} +1 -1
  64. package/dist/client/assets/{features-DIBFVG_b.js → features-fsR9zLkr.js} +1 -1
  65. package/dist/client/assets/{form-DHQjt1Tk.js → form-D7DN8UcB.js} +1 -1
  66. package/dist/client/assets/general-WQbdllPl.js +1 -0
  67. package/dist/client/assets/{github-repo-picker-CIYxcUMn.js → github-repo-picker-DZqLC6FL.js} +2 -2
  68. package/dist/client/assets/index-BCwsJqWc.css +1 -0
  69. package/dist/client/assets/{index-sYNl3b-7.js → index-C5AR7k1c.js} +1 -1
  70. package/dist/client/assets/{index-DWOvEgKr.js → index-CHKi_s_a.js} +1 -1
  71. package/dist/client/assets/{index-DvxSs9Po.js → index-D-RCnwJQ.js} +1 -1
  72. package/dist/client/assets/{index-CNolBSVE.js → index-D34n6J5J.js} +22 -22
  73. package/dist/client/assets/{index-DbNFtLRR.js → index-DBclwIf_.js} +3 -3
  74. package/dist/client/assets/{index-Di0ylaLI.js → index-DnJZfbsP.js} +3 -3
  75. package/dist/client/assets/{index-uSGXbgq4.js → index-FnxI6OGR.js} +1 -1
  76. package/dist/client/assets/{index-BWvVdWtP.js → index-e3AFJ_dX.js} +1 -1
  77. package/dist/client/assets/{index-gfedyrlZ.js → index-qXZ0t4XR.js} +16 -16
  78. package/dist/client/assets/{index-PT6VRyBL.js → index-zDq2Zqio.js} +1 -1
  79. package/dist/client/assets/{infiniteQueryObserver-B8q-YDXm.js → infiniteQueryObserver-1_M-sq16.js} +1 -1
  80. package/dist/client/assets/{input-B8j75XZ_.js → input-urtyHxks.js} +1 -1
  81. package/dist/client/assets/{integration-icon-De50Mm7k.js → integration-icon-Cdkk9YPE.js} +1 -1
  82. package/dist/client/assets/{label-KH35YAYU.js → label-Bt4h_QUk.js} +1 -1
  83. package/dist/client/assets/{layout-E2py7rYQ.js → layout-B5SDe6IW.js} +1 -1
  84. package/dist/client/assets/{login-agOBj-o2.js → login-7zFMf3C1.js} +1 -1
  85. package/dist/client/assets/members-Dy7hWkQ8.js +3 -0
  86. package/dist/client/assets/{monaco-editor-CzAT2DWn.js → monaco-editor-lveN-AoO.js} +1 -1
  87. package/dist/client/assets/{monitoring-stats-row-k0blCMgl.js → monitoring-stats-row-D3x0_phM.js} +1 -1
  88. package/dist/client/assets/{oauth-callback-ViEW-3g2.js → oauth-callback-BJALVgfT.js} +1 -1
  89. package/dist/client/assets/{oauth-callback-ai-provider-cSZy9hW7.js → oauth-callback-ai-provider-o8Hfz-wL.js} +1 -1
  90. package/dist/client/assets/{onboarding-CquRdW5q.js → onboarding-DlI3PsIA.js} +1 -1
  91. package/dist/client/assets/{org-layout-DY9vqUg9.js → org-layout-DPzm8vzJ.js} +1 -1
  92. package/dist/client/assets/{org-plugin-layout-HyePbhDN.js → org-plugin-layout-DB72TzxO.js} +1 -1
  93. package/dist/client/assets/{plugin-empty-state-tSKwN8yW.js → plugin-empty-state-BzyxU1IF.js} +1 -1
  94. package/dist/client/assets/{plugin-header-CgMEgROC.js → plugin-header-hJH6-4Nr.js} +1 -1
  95. package/dist/client/assets/{plugin-layout-B0f9qTk_.js → plugin-layout-l_MDXBYc.js} +1 -1
  96. package/dist/client/assets/{popover-BK6PL-XB.js → popover-j_PzMtdY.js} +1 -1
  97. package/dist/client/assets/{profile-C_xBhvj7.js → profile-lf_QL3Ye.js} +1 -1
  98. package/dist/client/assets/project-app-view-DuFzKNXE.js +1 -0
  99. package/dist/client/assets/registry-D3m_WKwq.js +2 -0
  100. package/dist/client/assets/{registry-layout-7nSgT8Ua.js → registry-layout-DRb_iR_v.js} +3 -3
  101. package/dist/client/assets/{required-auth-layout-D-NWWr5P.js → required-auth-layout-C2o7AZ4K.js} +1 -1
  102. package/dist/client/assets/{reset-password-C7m0cAdE.js → reset-password-DTEY3I_i.js} +1 -1
  103. package/dist/client/assets/roles-DW1_Kn6r.js +1 -0
  104. package/dist/client/assets/{scroll-area-Da2hNrch.js → scroll-area-BebfgLv6.js} +1 -1
  105. package/dist/client/assets/{search-input-BZmdDW7A.js → search-input-dmuYGYsk.js} +1 -1
  106. package/dist/client/assets/{select-JPYD20it.js → select-CePxsPeP.js} +1 -1
  107. package/dist/client/assets/{select-model-DMVU-2Gx.js → select-model-QQ7yjZl9.js} +2 -2
  108. package/dist/client/assets/settings-layout-Cd1tdTnr.js +1 -0
  109. package/dist/client/assets/{shell-layout-DkN8Q_tp.js → shell-layout-BE22YA40.js} +1 -1
  110. package/dist/client/assets/{skeleton-DPqifXUx.js → skeleton-C9NsUzIb.js} +1 -1
  111. package/dist/client/assets/{sso-BdiVJFM8.js → sso-QSGlyP2n.js} +1 -1
  112. package/dist/client/assets/{store-D9lb1Gph.js → store-BB9yi6PD.js} +1 -1
  113. package/dist/client/assets/store-registry-BSp-W72J.js +2 -0
  114. package/dist/client/assets/{switch-CVtXvreH.js → switch-VBeL01bM.js} +1 -1
  115. package/dist/client/assets/{table-C-JSrHQJ.js → table-CQMW-Toa.js} +1 -1
  116. package/dist/client/assets/{tabs-DtgWLQ6i.js → tabs-DOoLL5wa.js} +1 -1
  117. package/dist/client/assets/{task-status-DTuLfGhm.js → task-status-vvRP86lz.js} +7 -7
  118. package/dist/client/assets/{textarea-p_oNKH-r.js → textarea-Ie4QUdo5.js} +1 -1
  119. package/dist/client/assets/{toggle-group-B6-etMEh.js → toggle-group-C077Smww.js} +1 -1
  120. package/dist/client/assets/tools-list-UnPsMGhr.js +1 -0
  121. package/dist/client/assets/{types-BP7V6N8z.js → types-D4PfKOFF.js} +1 -1
  122. package/dist/client/assets/{use-ai-providers-oN1cKhaJ.js → use-ai-providers-DHuVj1kn.js} +1 -1
  123. package/dist/client/assets/{use-collections-BTXUmiDi.js → use-collections-DRlHpXQL.js} +1 -1
  124. package/dist/client/assets/{use-connection-DIvNoxL5.js → use-connection-Cif-LY0f.js} +1 -1
  125. package/dist/client/assets/{use-copy-D8L6lrfC.js → use-copy-uiSuMvtc.js} +1 -1
  126. package/dist/client/assets/{use-create-virtual-mcp-DUKkySGS.js → use-create-virtual-mcp-CBpw3zXA.js} +1 -1
  127. package/dist/client/assets/{use-decopilot-events-BRc3SX00.js → use-decopilot-events-Dpt6CcIN.js} +1 -1
  128. package/dist/client/assets/{use-delete-connection-IDpzSpRp.js → use-delete-connection-BZmW9ZAz.js} +1 -1
  129. package/dist/client/assets/{use-infinite-scroll-WKRKMI2J.js → use-infinite-scroll-CWlV3gJA.js} +1 -1
  130. package/dist/client/assets/{use-list-state-Dyh2zhb9.js → use-list-state-BJZWeXjY.js} +1 -1
  131. package/dist/client/assets/{use-mcp-tools-tZ37UBLL.js → use-mcp-tools-BYVtg7WH.js} +1 -1
  132. package/dist/client/assets/{use-members-AvAHjkiq.js → use-members-M_p47epa.js} +1 -1
  133. package/dist/client/assets/{use-mobile-Ctb5URy7.js → use-mobile-CxvYCzu9.js} +1 -1
  134. package/dist/client/assets/{use-navigate-to-agent-CLfSU3ru.js → use-navigate-to-agent-CFIKBq0L.js} +1 -1
  135. package/dist/client/assets/{use-org-sso-CmuM4ieo.js → use-org-sso-CACnH9GQ.js} +1 -1
  136. package/dist/client/assets/use-organization-roles-o4lVU0iD.js +1 -0
  137. package/dist/client/assets/{use-organization-settings-dQpmtQzl.js → use-organization-settings-BD9CIHH5.js} +1 -1
  138. package/dist/client/assets/{use-registry-connections-CP0QI7iA.js → use-registry-connections-DR_etJ2H.js} +1 -1
  139. package/dist/client/assets/{use-status-sounds-CObwI0DY.js → use-status-sounds-Ce7WandB.js} +1 -1
  140. package/dist/client/assets/{use-tasks-7rX1bsHL.js → use-tasks-Dpp1DK1f.js} +1 -1
  141. package/dist/client/assets/{use-view-mode-BkbloGkm.js → use-view-mode-CZPzVaxj.js} +1 -1
  142. package/dist/client/assets/{use-virtual-mcp-CDOk_IIy.js → use-virtual-mcp-0vHwLInn.js} +1 -1
  143. package/dist/client/assets/useInfiniteQuery-B4w-6TrV.js +1 -0
  144. package/dist/client/assets/useSuspenseInfiniteQuery-WURyRq6p.js +1 -0
  145. package/dist/client/assets/{user-lj8QRtGG.js → user-xj80BAo3.js} +1 -1
  146. package/dist/client/assets/{view-mode-toggle-BiPtlB_S.js → view-mode-toggle-D5CGwPOj.js} +1 -1
  147. package/dist/client/assets/workflow-CD_DiE5j.js +1 -0
  148. package/dist/client/assets/workflow-detail-CxWEb-ID.js +1 -0
  149. package/dist/client/index.html +2 -2
  150. package/dist/server/cli.js +2 -2
  151. package/dist/server/node_modules/figures/index.d.ts +279 -0
  152. package/dist/server/node_modules/figures/index.js +292 -0
  153. package/dist/server/node_modules/figures/license +9 -0
  154. package/dist/server/node_modules/figures/package.json +49 -0
  155. package/dist/server/node_modules/figures/readme.md +337 -0
  156. package/dist/server/node_modules/ink/build/ansi-tokenizer.d.ts +38 -0
  157. package/dist/server/node_modules/ink/build/ansi-tokenizer.js +316 -0
  158. package/dist/server/node_modules/ink/build/ansi-tokenizer.js.map +1 -0
  159. package/dist/server/node_modules/ink/build/apply-styles.js +175 -0
  160. package/dist/server/node_modules/ink/build/build-layout.js +77 -0
  161. package/dist/server/node_modules/ink/build/calculate-wrapped-text.js +53 -0
  162. package/dist/server/node_modules/ink/build/colorize.d.ts +3 -0
  163. package/dist/server/node_modules/ink/build/colorize.js +48 -0
  164. package/dist/server/node_modules/ink/build/colorize.js.map +1 -0
  165. package/dist/server/node_modules/ink/build/components/AccessibilityContext.d.ts +3 -0
  166. package/dist/server/node_modules/ink/build/components/AccessibilityContext.js +5 -0
  167. package/dist/server/node_modules/ink/build/components/AccessibilityContext.js.map +1 -0
  168. package/dist/server/node_modules/ink/build/components/App.d.ts +18 -0
  169. package/dist/server/node_modules/ink/build/components/App.js +351 -0
  170. package/dist/server/node_modules/ink/build/components/App.js.map +1 -0
  171. package/dist/server/node_modules/ink/build/components/AppContext.d.ts +15 -0
  172. package/dist/server/node_modules/ink/build/components/AppContext.js +11 -0
  173. package/dist/server/node_modules/ink/build/components/AppContext.js.map +1 -0
  174. package/dist/server/node_modules/ink/build/components/BackgroundContext.d.ts +4 -0
  175. package/dist/server/node_modules/ink/build/components/BackgroundContext.js +3 -0
  176. package/dist/server/node_modules/ink/build/components/BackgroundContext.js.map +1 -0
  177. package/dist/server/node_modules/ink/build/components/Box.d.ts +117 -0
  178. package/dist/server/node_modules/ink/build/components/Box.js +34 -0
  179. package/dist/server/node_modules/ink/build/components/Box.js.map +1 -0
  180. package/dist/server/node_modules/ink/build/components/Color.js +62 -0
  181. package/dist/server/node_modules/ink/build/components/Cursor.d.ts +83 -0
  182. package/dist/server/node_modules/ink/build/components/Cursor.js +53 -0
  183. package/dist/server/node_modules/ink/build/components/Cursor.js.map +1 -0
  184. package/dist/server/node_modules/ink/build/components/CursorContext.d.ts +11 -0
  185. package/dist/server/node_modules/ink/build/components/CursorContext.js +8 -0
  186. package/dist/server/node_modules/ink/build/components/CursorContext.js.map +1 -0
  187. package/dist/server/node_modules/ink/build/components/ErrorBoundary.d.ts +18 -0
  188. package/dist/server/node_modules/ink/build/components/ErrorBoundary.js +23 -0
  189. package/dist/server/node_modules/ink/build/components/ErrorBoundary.js.map +1 -0
  190. package/dist/server/node_modules/ink/build/components/ErrorOverview.d.ts +6 -0
  191. package/dist/server/node_modules/ink/build/components/ErrorOverview.js +84 -0
  192. package/dist/server/node_modules/ink/build/components/ErrorOverview.js.map +1 -0
  193. package/dist/server/node_modules/ink/build/components/FocusContext.d.ts +16 -0
  194. package/dist/server/node_modules/ink/build/components/FocusContext.js +17 -0
  195. package/dist/server/node_modules/ink/build/components/FocusContext.js.map +1 -0
  196. package/dist/server/node_modules/ink/build/components/Newline.d.ts +13 -0
  197. package/dist/server/node_modules/ink/build/components/Newline.js +8 -0
  198. package/dist/server/node_modules/ink/build/components/Newline.js.map +1 -0
  199. package/dist/server/node_modules/ink/build/components/Spacer.d.ts +7 -0
  200. package/dist/server/node_modules/ink/build/components/Spacer.js +11 -0
  201. package/dist/server/node_modules/ink/build/components/Spacer.js.map +1 -0
  202. package/dist/server/node_modules/ink/build/components/Static.d.ts +24 -0
  203. package/dist/server/node_modules/ink/build/components/Static.js +28 -0
  204. package/dist/server/node_modules/ink/build/components/Static.js.map +1 -0
  205. package/dist/server/node_modules/ink/build/components/StderrContext.d.ts +15 -0
  206. package/dist/server/node_modules/ink/build/components/StderrContext.js +13 -0
  207. package/dist/server/node_modules/ink/build/components/StderrContext.js.map +1 -0
  208. package/dist/server/node_modules/ink/build/components/StdinContext.d.ts +22 -0
  209. package/dist/server/node_modules/ink/build/components/StdinContext.js +19 -0
  210. package/dist/server/node_modules/ink/build/components/StdinContext.js.map +1 -0
  211. package/dist/server/node_modules/ink/build/components/StdoutContext.d.ts +15 -0
  212. package/dist/server/node_modules/ink/build/components/StdoutContext.js +13 -0
  213. package/dist/server/node_modules/ink/build/components/StdoutContext.js.map +1 -0
  214. package/dist/server/node_modules/ink/build/components/Text.d.ts +55 -0
  215. package/dist/server/node_modules/ink/build/components/Text.js +50 -0
  216. package/dist/server/node_modules/ink/build/components/Text.js.map +1 -0
  217. package/dist/server/node_modules/ink/build/components/Transform.d.ts +16 -0
  218. package/dist/server/node_modules/ink/build/components/Transform.js +15 -0
  219. package/dist/server/node_modules/ink/build/components/Transform.js.map +1 -0
  220. package/dist/server/node_modules/ink/build/cursor-helpers.d.ts +38 -0
  221. package/dist/server/node_modules/ink/build/cursor-helpers.js +56 -0
  222. package/dist/server/node_modules/ink/build/cursor-helpers.js.map +1 -0
  223. package/dist/server/node_modules/ink/build/devtools-window-polyfill.d.ts +1 -0
  224. package/dist/server/node_modules/ink/build/devtools-window-polyfill.js +65 -0
  225. package/dist/server/node_modules/ink/build/devtools-window-polyfill.js.map +1 -0
  226. package/dist/server/node_modules/ink/build/devtools.d.ts +1 -0
  227. package/dist/server/node_modules/ink/build/devtools.js +11 -0
  228. package/dist/server/node_modules/ink/build/devtools.js.map +1 -0
  229. package/dist/server/node_modules/ink/build/dom.d.ts +56 -0
  230. package/dist/server/node_modules/ink/build/dom.js +124 -0
  231. package/dist/server/node_modules/ink/build/dom.js.map +1 -0
  232. package/dist/server/node_modules/ink/build/experimental/apply-style.js +140 -0
  233. package/dist/server/node_modules/ink/build/experimental/dom.js +123 -0
  234. package/dist/server/node_modules/ink/build/experimental/output.js +91 -0
  235. package/dist/server/node_modules/ink/build/experimental/reconciler.js +141 -0
  236. package/dist/server/node_modules/ink/build/experimental/renderer.js +81 -0
  237. package/dist/server/node_modules/ink/build/get-max-width.d.ts +3 -0
  238. package/dist/server/node_modules/ink/build/get-max-width.js +10 -0
  239. package/dist/server/node_modules/ink/build/get-max-width.js.map +1 -0
  240. package/dist/server/node_modules/ink/build/hooks/use-app.d.ts +5 -0
  241. package/dist/server/node_modules/ink/build/hooks/use-app.js +8 -0
  242. package/dist/server/node_modules/ink/build/hooks/use-app.js.map +1 -0
  243. package/dist/server/node_modules/ink/build/hooks/use-cursor.d.ts +12 -0
  244. package/dist/server/node_modules/ink/build/hooks/use-cursor.js +29 -0
  245. package/dist/server/node_modules/ink/build/hooks/use-cursor.js.map +1 -0
  246. package/dist/server/node_modules/ink/build/hooks/use-focus-manager.d.ts +28 -0
  247. package/dist/server/node_modules/ink/build/hooks/use-focus-manager.js +17 -0
  248. package/dist/server/node_modules/ink/build/hooks/use-focus-manager.js.map +1 -0
  249. package/dist/server/node_modules/ink/build/hooks/use-focus.d.ts +29 -0
  250. package/dist/server/node_modules/ink/build/hooks/use-focus.js +42 -0
  251. package/dist/server/node_modules/ink/build/hooks/use-focus.js.map +1 -0
  252. package/dist/server/node_modules/ink/build/hooks/use-input.d.ts +131 -0
  253. package/dist/server/node_modules/ink/build/hooks/use-input.js +124 -0
  254. package/dist/server/node_modules/ink/build/hooks/use-input.js.map +1 -0
  255. package/dist/server/node_modules/ink/build/hooks/use-is-screen-reader-enabled.d.ts +5 -0
  256. package/dist/server/node_modules/ink/build/hooks/use-is-screen-reader-enabled.js +11 -0
  257. package/dist/server/node_modules/ink/build/hooks/use-is-screen-reader-enabled.js.map +1 -0
  258. package/dist/server/node_modules/ink/build/hooks/use-stderr.d.ts +5 -0
  259. package/dist/server/node_modules/ink/build/hooks/use-stderr.js +8 -0
  260. package/dist/server/node_modules/ink/build/hooks/use-stderr.js.map +1 -0
  261. package/dist/server/node_modules/ink/build/hooks/use-stdin.d.ts +5 -0
  262. package/dist/server/node_modules/ink/build/hooks/use-stdin.js +8 -0
  263. package/dist/server/node_modules/ink/build/hooks/use-stdin.js.map +1 -0
  264. package/dist/server/node_modules/ink/build/hooks/use-stdout.d.ts +5 -0
  265. package/dist/server/node_modules/ink/build/hooks/use-stdout.js +8 -0
  266. package/dist/server/node_modules/ink/build/hooks/use-stdout.js.map +1 -0
  267. package/dist/server/node_modules/ink/build/hooks/useInput.js +38 -0
  268. package/dist/server/node_modules/ink/build/index.d.ts +34 -0
  269. package/dist/server/node_modules/ink/build/index.js +20 -0
  270. package/dist/server/node_modules/ink/build/index.js.map +1 -0
  271. package/dist/server/node_modules/ink/build/ink.d.ts +90 -0
  272. package/dist/server/node_modules/ink/build/ink.js +637 -0
  273. package/dist/server/node_modules/ink/build/ink.js.map +1 -0
  274. package/dist/server/node_modules/ink/build/input-parser.d.ts +7 -0
  275. package/dist/server/node_modules/ink/build/input-parser.js +154 -0
  276. package/dist/server/node_modules/ink/build/input-parser.js.map +1 -0
  277. package/dist/server/node_modules/ink/build/instance.js +205 -0
  278. package/dist/server/node_modules/ink/build/instances.d.ts +3 -0
  279. package/dist/server/node_modules/ink/build/instances.js +8 -0
  280. package/dist/server/node_modules/ink/build/instances.js.map +1 -0
  281. package/dist/server/node_modules/ink/build/kitty-keyboard.d.ts +23 -0
  282. package/dist/server/node_modules/ink/build/kitty-keyboard.js +32 -0
  283. package/dist/server/node_modules/ink/build/kitty-keyboard.js.map +1 -0
  284. package/dist/server/node_modules/ink/build/layout.d.ts +7 -0
  285. package/dist/server/node_modules/ink/build/layout.js +33 -0
  286. package/dist/server/node_modules/ink/build/layout.js.map +1 -0
  287. package/dist/server/node_modules/ink/build/log-update.d.ts +19 -0
  288. package/dist/server/node_modules/ink/build/log-update.js +242 -0
  289. package/dist/server/node_modules/ink/build/log-update.js.map +1 -0
  290. package/dist/server/node_modules/ink/build/measure-element.d.ts +16 -0
  291. package/dist/server/node_modules/ink/build/measure-element.js +9 -0
  292. package/dist/server/node_modules/ink/build/measure-element.js.map +1 -0
  293. package/dist/server/node_modules/ink/build/measure-text.d.ts +6 -0
  294. package/dist/server/node_modules/ink/build/measure-text.js +21 -0
  295. package/dist/server/node_modules/ink/build/measure-text.js.map +1 -0
  296. package/dist/server/node_modules/ink/build/options.d.ts +52 -0
  297. package/dist/server/node_modules/ink/build/options.js +2 -0
  298. package/dist/server/node_modules/ink/build/options.js.map +1 -0
  299. package/dist/server/node_modules/ink/build/output.d.ts +35 -0
  300. package/dist/server/node_modules/ink/build/output.js +183 -0
  301. package/dist/server/node_modules/ink/build/output.js.map +1 -0
  302. package/dist/server/node_modules/ink/build/parse-keypress.d.ts +22 -0
  303. package/dist/server/node_modules/ink/build/parse-keypress.js +493 -0
  304. package/dist/server/node_modules/ink/build/parse-keypress.js.map +1 -0
  305. package/dist/server/node_modules/ink/build/reconciler.d.ts +4 -0
  306. package/dist/server/node_modules/ink/build/reconciler.js +274 -0
  307. package/dist/server/node_modules/ink/build/reconciler.js.map +1 -0
  308. package/dist/server/node_modules/ink/build/render-background.d.ts +4 -0
  309. package/dist/server/node_modules/ink/build/render-background.js +25 -0
  310. package/dist/server/node_modules/ink/build/render-background.js.map +1 -0
  311. package/dist/server/node_modules/ink/build/render-border.d.ts +4 -0
  312. package/dist/server/node_modules/ink/build/render-border.js +73 -0
  313. package/dist/server/node_modules/ink/build/render-border.js.map +1 -0
  314. package/dist/server/node_modules/ink/build/render-node-to-output.d.ts +14 -0
  315. package/dist/server/node_modules/ink/build/render-node-to-output.js +147 -0
  316. package/dist/server/node_modules/ink/build/render-node-to-output.js.map +1 -0
  317. package/dist/server/node_modules/ink/build/render-to-string.d.ts +38 -0
  318. package/dist/server/node_modules/ink/build/render-to-string.js +115 -0
  319. package/dist/server/node_modules/ink/build/render-to-string.js.map +1 -0
  320. package/dist/server/node_modules/ink/build/render.d.ts +121 -0
  321. package/dist/server/node_modules/ink/build/render.js +55 -0
  322. package/dist/server/node_modules/ink/build/render.js.map +1 -0
  323. package/dist/server/node_modules/ink/build/renderer.d.ts +8 -0
  324. package/dist/server/node_modules/ink/build/renderer.js +55 -0
  325. package/dist/server/node_modules/ink/build/renderer.js.map +1 -0
  326. package/dist/server/node_modules/ink/build/sanitize-ansi.d.ts +2 -0
  327. package/dist/server/node_modules/ink/build/sanitize-ansi.js +27 -0
  328. package/dist/server/node_modules/ink/build/sanitize-ansi.js.map +1 -0
  329. package/dist/server/node_modules/ink/build/screen-reader-update.d.ts +13 -0
  330. package/dist/server/node_modules/ink/build/screen-reader-update.js +38 -0
  331. package/dist/server/node_modules/ink/build/screen-reader-update.js.map +1 -0
  332. package/dist/server/node_modules/ink/build/squash-text-nodes.d.ts +3 -0
  333. package/dist/server/node_modules/ink/build/squash-text-nodes.js +36 -0
  334. package/dist/server/node_modules/ink/build/squash-text-nodes.js.map +1 -0
  335. package/dist/server/node_modules/ink/build/styles.d.ts +240 -0
  336. package/dist/server/node_modules/ink/build/styles.js +232 -0
  337. package/dist/server/node_modules/ink/build/styles.js.map +1 -0
  338. package/dist/server/node_modules/ink/build/utils.d.ts +2 -0
  339. package/dist/server/node_modules/ink/build/utils.js +4 -0
  340. package/dist/server/node_modules/ink/build/utils.js.map +1 -0
  341. package/dist/server/node_modules/ink/build/wrap-text.d.ts +3 -0
  342. package/dist/server/node_modules/ink/build/wrap-text.js +31 -0
  343. package/dist/server/node_modules/ink/build/wrap-text.js.map +1 -0
  344. package/dist/server/node_modules/ink/build/write-synchronized.d.ts +4 -0
  345. package/dist/server/node_modules/ink/build/write-synchronized.js +7 -0
  346. package/dist/server/node_modules/ink/build/write-synchronized.js.map +1 -0
  347. package/dist/server/node_modules/ink/license +10 -0
  348. package/dist/server/node_modules/ink/package.json +201 -0
  349. package/dist/server/node_modules/ink/readme.md +2636 -0
  350. package/dist/server/node_modules/onetime/index.d.ts +64 -0
  351. package/dist/server/node_modules/onetime/index.js +44 -0
  352. package/dist/server/node_modules/onetime/license +9 -0
  353. package/dist/server/node_modules/onetime/package.json +43 -0
  354. package/dist/server/node_modules/onetime/readme.md +94 -0
  355. package/dist/server/server.js +1 -1
  356. package/package.json +1 -1
  357. package/dist/client/assets/SearchMd-VdXbz8fL.js +0 -1
  358. package/dist/client/assets/XCircle-BiHPX6_R.js +0 -1
  359. package/dist/client/assets/agent-icon-DCE-D-qC.js +0 -1
  360. package/dist/client/assets/agents-list-8_yOp3iD.js +0 -1
  361. package/dist/client/assets/ai-providers-DxQNSEJT.js +0 -1
  362. package/dist/client/assets/automation-list-row-BWjwKsQ5.js +0 -1
  363. package/dist/client/assets/automations-D6LOd0hH.js +0 -1
  364. package/dist/client/assets/collection-detail-BTibo6D3.js +0 -1
  365. package/dist/client/assets/collection-display-button-CfjJ9SIP.js +0 -1
  366. package/dist/client/assets/collection-table-wrapper-B4l_6tOy.js +0 -1
  367. package/dist/client/assets/command-BPSv-8-5.js +0 -1
  368. package/dist/client/assets/connection-detail-DgKIsKao.js +0 -1
  369. package/dist/client/assets/connections-rM_I7gvv.js +0 -1
  370. package/dist/client/assets/dropdown-menu-DO26Q0bD.js +0 -1
  371. package/dist/client/assets/general-VnUbEBHT.js +0 -1
  372. package/dist/client/assets/index-DeSgX7LP.css +0 -1
  373. package/dist/client/assets/members-6PieW-Nu.js +0 -3
  374. package/dist/client/assets/project-app-view-EMrqjiux.js +0 -1
  375. package/dist/client/assets/registry-CYL2cMC0.js +0 -2
  376. package/dist/client/assets/settings-layout-hwviWS6Q.js +0 -1
  377. package/dist/client/assets/store-registry-DAeO63_G.js +0 -2
  378. package/dist/client/assets/tools-list-C0RCBhOc.js +0 -1
  379. package/dist/client/assets/useInfiniteQuery-Ci00Hw-m.js +0 -1
  380. package/dist/client/assets/workflow-BrBlpNSn.js +0 -1
  381. package/dist/client/assets/workflow-detail-NqGVn5hy.js +0 -1
@@ -1 +1 @@
1
- import{e as f,c as u,j as m}from"./index-CNolBSVE.js";import{B as g}from"./badge-DsWPcX1V.js";function h(x){const e=f.c(12),{tabs:l,activeTab:n,onTabChange:s,className:a}=x;let t;e[0]!==a?(t=u("flex items-center gap-2 overflow-x-auto no-scrollbar",a),e[0]=a,e[1]=t):t=e[1];let r;if(e[2]!==n||e[3]!==s||e[4]!==l){let c;e[6]!==n||e[7]!==s?(c=o=>{const d=n===o.id;return m.jsxs("button",{type:"button",onClick:()=>s(o.id),className:u("h-7 px-2 text-sm rounded-lg border border-input transition-colors inline-flex gap-1.5 items-center",d&&"bg-accent border-border text-foreground",!d&&"bg-transparent text-muted-foreground hover:border-border hover:bg-accent/50 hover:text-foreground"),children:[o.label,o.count!==void 0&&m.jsx(g,{variant:"secondary",className:u("h-5 min-w-5 px-1 rounded-full text-[10px] font-mono inline-flex items-center justify-center",d?"bg-background text-foreground":"bg-muted-foreground/10 text-muted-foreground"),children:o.count})]},o.id)},e[6]=n,e[7]=s,e[8]=c):c=e[8],r=l.map(c),e[2]=n,e[3]=s,e[4]=l,e[5]=r}else r=e[5];let i;return e[9]!==t||e[10]!==r?(i=m.jsx("div",{className:t,children:r}),e[9]=t,e[10]=r,e[11]=i):i=e[11],i}export{h as C};
1
+ import{e as f,c as u,j as m}from"./index-D34n6J5J.js";import{B as g}from"./badge-s_TAXGUN.js";function h(x){const e=f.c(12),{tabs:l,activeTab:n,onTabChange:s,className:a}=x;let t;e[0]!==a?(t=u("flex items-center gap-2 overflow-x-auto no-scrollbar",a),e[0]=a,e[1]=t):t=e[1];let r;if(e[2]!==n||e[3]!==s||e[4]!==l){let c;e[6]!==n||e[7]!==s?(c=o=>{const d=n===o.id;return m.jsxs("button",{type:"button",onClick:()=>s(o.id),className:u("h-7 px-2 text-sm rounded-lg border border-input transition-colors inline-flex gap-1.5 items-center",d&&"bg-accent border-border text-foreground",!d&&"bg-transparent text-muted-foreground hover:border-border hover:bg-accent/50 hover:text-foreground"),children:[o.label,o.count!==void 0&&m.jsx(g,{variant:"secondary",className:u("h-5 min-w-5 px-1 rounded-full text-[10px] font-mono inline-flex items-center justify-center",d?"bg-background text-foreground":"bg-muted-foreground/10 text-muted-foreground"),children:o.count})]},o.id)},e[6]=n,e[7]=s,e[8]=c):c=e[8],r=l.map(c),e[2]=n,e[3]=s,e[4]=l,e[5]=r}else r=e[5];let i;return e[9]!==t||e[10]!==r?(i=m.jsx("div",{className:t,children:r}),e[9]=t,e[10]=r,e[11]=i):i=e[11],i}export{h as C};
@@ -1 +1 @@
1
- import{v as t,y as i,aJ as p,_ as r,aK as a,bQ as m,bk as h,aC as c,a_ as b}from"./index-CNolBSVE.js";const N=t({id:i().describe("Unique identifier for the entity"),title:i().describe("Human-readable title for the entity"),description:i().nullish().describe("Description of the entity"),created_at:i().datetime(),updated_at:i().datetime(),created_by:i().optional(),updated_by:i().optional()}),f=t({field:a(i()),operator:r(["eq","gt","gte","lt","lte","in","like","contains"]),value:p()}),u=m(()=>h([f,t({operator:r(["and","or","not"]),conditions:a(u)})])),C=t({field:a(i()),direction:r(["asc","desc"]),nulls:r(["first","last"]).optional()}),S=t({where:u.optional().describe("Filter expression"),orderBy:a(C).optional().describe("Sort expressions"),limit:c().int().min(1).max(1e3).optional().describe("Maximum number of items to return"),offset:c().int().min(0).optional().describe("Number of items to skip")});function O(e){return t({items:a(e).describe("Array of collection items"),totalCount:c().int().min(0).optional().describe("Total number of matching items (if available)"),hasMore:b().optional().describe("Whether there are more items available")})}const y=t({id:i().describe("ID of the entity to retrieve")});function _(e){return t({item:e.nullable().describe("The retrieved item, or null if not found")})}function E(e){return t({data:e.partial().describe("Data for the new entity (id may be auto-generated)")})}function I(e){return t({item:e.describe("The created entity with generated id")})}function T(e){return t({id:i().describe("ID of the entity to update"),data:e.partial().describe("Partial entity data to update")})}function L(e){return t({item:e.describe("The updated entity")})}const D=t({id:i().describe("ID of the entity to delete")});function g(e){return t({item:e.describe("The deleted entity")})}function v(e,n,l){const o=e.toUpperCase(),d=l?.readOnly??!1,s=[{name:`COLLECTION_${o}_LIST`,inputSchema:S,outputSchema:O(n)},{name:`COLLECTION_${o}_GET`,inputSchema:y,outputSchema:_(n)}];return d||s.push({name:`COLLECTION_${o}_CREATE`,inputSchema:E(n),outputSchema:I(n),opt:!0},{name:`COLLECTION_${o}_UPDATE`,inputSchema:T(n),outputSchema:L(n),opt:!0},{name:`COLLECTION_${o}_DELETE`,inputSchema:D,outputSchema:g(n),opt:!0}),s}export{N as B,v as c};
1
+ import{v as t,y as i,aJ as p,_ as r,aK as a,bQ as m,bk as h,aC as c,a_ as b}from"./index-D34n6J5J.js";const N=t({id:i().describe("Unique identifier for the entity"),title:i().describe("Human-readable title for the entity"),description:i().nullish().describe("Description of the entity"),created_at:i().datetime(),updated_at:i().datetime(),created_by:i().optional(),updated_by:i().optional()}),f=t({field:a(i()),operator:r(["eq","gt","gte","lt","lte","in","like","contains"]),value:p()}),u=m(()=>h([f,t({operator:r(["and","or","not"]),conditions:a(u)})])),C=t({field:a(i()),direction:r(["asc","desc"]),nulls:r(["first","last"]).optional()}),S=t({where:u.optional().describe("Filter expression"),orderBy:a(C).optional().describe("Sort expressions"),limit:c().int().min(1).max(1e3).optional().describe("Maximum number of items to return"),offset:c().int().min(0).optional().describe("Number of items to skip")});function O(e){return t({items:a(e).describe("Array of collection items"),totalCount:c().int().min(0).optional().describe("Total number of matching items (if available)"),hasMore:b().optional().describe("Whether there are more items available")})}const y=t({id:i().describe("ID of the entity to retrieve")});function _(e){return t({item:e.nullable().describe("The retrieved item, or null if not found")})}function E(e){return t({data:e.partial().describe("Data for the new entity (id may be auto-generated)")})}function I(e){return t({item:e.describe("The created entity with generated id")})}function T(e){return t({id:i().describe("ID of the entity to update"),data:e.partial().describe("Partial entity data to update")})}function L(e){return t({item:e.describe("The updated entity")})}const D=t({id:i().describe("ID of the entity to delete")});function g(e){return t({item:e.describe("The deleted entity")})}function v(e,n,l){const o=e.toUpperCase(),d=l?.readOnly??!1,s=[{name:`COLLECTION_${o}_LIST`,inputSchema:S,outputSchema:O(n)},{name:`COLLECTION_${o}_GET`,inputSchema:y,outputSchema:_(n)}];return d||s.push({name:`COLLECTION_${o}_CREATE`,inputSchema:E(n),outputSchema:I(n),opt:!0},{name:`COLLECTION_${o}_UPDATE`,inputSchema:T(n),outputSchema:L(n),opt:!0},{name:`COLLECTION_${o}_DELETE`,inputSchema:D,outputSchema:g(n),opt:!0}),s}export{N as B,v as c};
@@ -0,0 +1 @@
1
+ import{e as r,c as m,j as n}from"./index-D34n6J5J.js";import{_ as d}from"./index-FnxI6OGR.js";import{i}from"./SearchMd-BRJBvWf4.js";function x(l){const e=r.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=m("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",t),e[3]=t,e[4]=o):o=e[4];let a;return e[5]!==s||e[6]!==o?(a=n.jsx(d,{"data-slot":"command",className:o,...s}),e[5]=s,e[6]=o,e[7]=a):a=e[7],a}function g(l){const e=r.c(9);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(i,{className:"size-5 shrink-0 text-foreground"}),e[3]=o):o=e[3];let a;e[4]!==t?(a=m("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",t),e[4]=t,e[5]=a):a=e[5];let c;return e[6]!==s||e[7]!==a?(c=n.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-10 items-center gap-2 border-b px-3",children:[o,n.jsx(d.Input,{"data-slot":"command-input",className:a,...s})]}),e[6]=s,e[7]=a,e[8]=c):c=e[8],c}function h(l){const e=r.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=m("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",t),e[3]=t,e[4]=o):o=e[4];let a;return e[5]!==s||e[6]!==o?(a=n.jsx(d.List,{"data-slot":"command-list",className:o,...s}),e[5]=s,e[6]=o,e[7]=a):a=e[7],a}function N(l){const e=r.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=n.jsx(d.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...t}),e[2]=t,e[3]=s):s=e[3],s}function v(l){const e=r.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=m("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",t),e[3]=t,e[4]=o):o=e[4];let a;return e[5]!==s||e[6]!==o?(a=n.jsx(d.Group,{"data-slot":"command-group",className:o,...s}),e[5]=s,e[6]=o,e[7]=a):a=e[7],a}function b(l){const e=r.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=m("bg-border -mx-1 h-px",t),e[3]=t,e[4]=o):o=e[4];let a;return e[5]!==s||e[6]!==o?(a=n.jsx(d.Separator,{"data-slot":"command-separator",className:o,...s}),e[5]=s,e[6]=o,e[7]=a):a=e[7],a}function _(l){const e=r.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=m("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[3]=t,e[4]=o):o=e[4];let a;return e[5]!==s||e[6]!==o?(a=n.jsx(d.Item,{"data-slot":"command-item",className:o,...s}),e[5]=s,e[6]=o,e[7]=a):a=e[7],a}export{N as C,v as a,_ as b,b as c,g as d,h as e,x as f};
@@ -1 +1 @@
1
- import{g as _}from"./connection-slug-eyAPH6o3.js";import{e as R,s as $,aH as A,K as L,c as E,j as x}from"./index-CNolBSVE.js";import{u as D}from"./use-registry-connections-CP0QI7iA.js";import{a as K}from"./use-organization-settings-dQpmtQzl.js";import{S as w,c as H}from"./constants-D8VkIs2c.js";import{u as Q}from"./useInfiniteQuery-Ci00Hw-m.js";import{i as F,f as q}from"./extract-connection-data-V-eInhlP.js";import{C as G}from"./card-CPVRwbgl.js";import{I as U}from"./integration-icon-De50Mm7k.js";function ae(s){const e=new Map;for(const o of s){const l=_(o),n=e.get(l);n?n.push(o):e.set(l,[o])}const t=[],f=new Set;for(const o of s){const l=_(o);if(f.has(l))continue;f.add(l);const n=e.get(l),m=n[0];n.length===1?t.push({type:"single",connection:m}):t.push({type:"group",key:l,icon:m.icon,title:m.app_name?m.title.replace(/\s*\(\d+\)\s*$/,""):m.title,connections:n})}return t}function le(){const s=R.c(6),e=D(),t=K(),f=$().project.enabledPlugins??[];let o;if(s[0]!==f||s[1]!==t||s[2]!==e){let l;s[4]!==t?(l=n=>t(n.id),s[4]=t,s[5]=l):l=s[5],o=e.filter(l).map(V),f.includes("private-registry")&&t(w)&&o.push({id:w,title:"Private Registry",icon:null}),s[0]=f,s[1]=t,s[2]=e,s[3]=o}else o=s[3];return o}function V(s){return{id:s.id,title:s.title,icon:s.icon}}const X=24,S=3;function k(s){return s.id.includes("community-registry")}function Y(s){const e=s?.trim();if(e)return{operator:"or",conditions:[{field:["title"],operator:"contains",value:e},{field:["description"],operator:"contains",value:e},{field:["name"],operator:"contains",value:e},{field:["server","title"],operator:"contains",value:e}]}}function T(s,e,t,f){const o=s.map(u=>u.id).sort().join(","),l=Y(f),{data:n,fetchNextPage:m,hasNextPage:c,isFetchingNextPage:v,isLoading:p}=Q({queryKey:L.storeDiscovery(e,`${o}:${f??""}`),queryFn:async({pageParam:u})=>{const r=u??{};return await Promise.all(s.map(async i=>{const g=r[i.id];if(g==="EXHAUSTED")return{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:[]};const I=F(i.id,e);let b;for(let N=0;N<S;N++){let y=null;try{y=await H({connectionId:i.id,orgId:e});const d={limit:X};g&&(d.cursor=g),l&&(d.where=l);const C=await y.callTool({name:I,arguments:d}),P=C.structuredContent??C,j=P.nextCursor||P.cursor||void 0,M=q(P?[P]:[]);return{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:M,nextCursor:j}}catch(d){b=d}finally{await y?.close().catch(()=>{})}}return console.warn(`[useMergedStoreDiscovery] Registry "${i.title}" (${i.id}) failed after ${S} attempts:`,b),{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:[]}}))},initialPageParam:{},getNextPageParam:u=>{const r={};let a=!1;for(const i of u)i.registryId&&(i.nextCursor?(r[i.registryId]=i.nextCursor,a=!0):r[i.registryId]="EXHAUSTED");return a?r:void 0},staleTime:3600*1e3,placeholderData:A,retry:!1,enabled:t&&s.length>0}),h=[];if(n?.pages)for(const u of n.pages)for(const r of u)for(const a of r.items)h.push({...a,_sourceName:a._sourceName??r.registryTitle,_sourceIcon:a._sourceIcon??r.registryIcon,_registryId:a._registryId??r.registryId});return{items:h,hasMore:c??!1,isLoadingMore:v,isInitialLoading:p,fetchNextPage:()=>{c&&!v&&m()}}}function ce(s,e){const t=R.c(17),{org:f}=$();let o;t[0]!==s?(o=s.filter(W),t[0]=s,t[1]=o):o=t[1];const l=o;let n;t[2]!==s?(n=s.filter(z),t[2]=s,t[3]=n):n=t[3];const m=n,c=T(l,f.id,!0,e),v=!c.hasMore&&!c.isInitialLoading,p=T(m,f.id,v,e);let h;if(t[4]!==v||t[5]!==p||t[6]!==c.items){const N=new Set;h=[];const y=[...c.items];v&&y.push(...p.items);for(const d of y){const C=`${d._registryId}:${d.id}`;N.has(C)||(N.add(C),h.push(d))}t[4]=v,t[5]=p,t[6]=c.items,t[7]=h}else h=t[7];const u=c.isInitialLoading,r=c.isLoadingMore||p.isLoadingMore;let a;e:{if(c.hasMore){a=!0;break e}if(m.length>0){if(!v){a=!0;break e}a=p.hasMore;break e}a=!1}const i=a;let g;t[8]!==p||t[9]!==c?(g=()=>{if(c.hasMore){c.fetchNextPage();return}p.hasMore&&p.fetchNextPage()},t[8]=p,t[9]=c,t[10]=g):g=t[10];const I=g;let b;return t[11]!==i||t[12]!==u||t[13]!==r||t[14]!==h||t[15]!==I?(b={items:h,hasMore:i,isLoadingMore:r,isInitialLoading:u,loadMore:I},t[11]=i,t[12]=u,t[13]=r,t[14]=h,t[15]=I,t[16]=b):b=t[16],b}function z(s){return k(s)}function W(s){return!k(s)}function ue(s){const e=R.c(37),{connection:t,onClick:f,headerActions:o,headerActionsAlwaysVisible:l,body:n,footer:m,className:c,fallbackIcon:v}=s,p=l===void 0?!1:l,h=f&&"hover:bg-muted/50";let u;e[0]!==c||e[1]!==h?(u=E("cursor-pointer transition-colors group overflow-hidden flex flex-col h-full",h,c),e[0]=c,e[1]=h,e[2]=u):u=e[2];let r;e[3]!==t.icon||e[4]!==t.title||e[5]!==v?(r=x.jsx(U,{icon:t.icon,name:t.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:v}),e[3]=t.icon,e[4]=t.title,e[5]=v,e[6]=r):r=e[6];let a;e[7]!==o||e[8]!==p?(a=o&&x.jsx("div",{className:E("transition-opacity",!p&&"sm:opacity-0 sm:group-hover:opacity-100"),onClick:B,children:o}),e[7]=o,e[8]=p,e[9]=a):a=e[9];let i;e[10]!==a?(i=x.jsx("div",{className:"relative",children:a}),e[10]=a,e[11]=i):i=e[11];let g;e[12]!==r||e[13]!==i?(g=x.jsxs("div",{className:"flex items-start justify-between",children:[r,i]}),e[12]=r,e[13]=i,e[14]=g):g=e[14];let I;e[15]!==t.title?(I=x.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:t.title}),e[15]=t.title,e[16]=I):I=e[16];const b=t.description||"No description";let N;e[17]!==b?(N=x.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:b}),e[17]=b,e[18]=N):N=e[18];let y;e[19]!==N||e[20]!==I?(y=x.jsxs("div",{className:"flex flex-col gap-1",children:[I,N]}),e[19]=N,e[20]=I,e[21]=y):y=e[21];let d;e[22]!==n?(d=n&&x.jsx("div",{children:n}),e[22]=n,e[23]=d):d=e[23];let C;e[24]!==y||e[25]!==d||e[26]!==g?(C=x.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[g,y,d]}),e[24]=y,e[25]=d,e[26]=g,e[27]=C):C=e[27];let P;e[28]!==m?(P=m&&x.jsx("div",{className:"border-t border-border mt-auto",children:x.jsx("div",{className:"h-14 flex items-center p-4.5",onClick:Z,children:m})}),e[28]=m,e[29]=P):P=e[29];let j;e[30]!==C||e[31]!==P?(j=x.jsxs("div",{className:"flex flex-col flex-1",children:[C,P]}),e[30]=C,e[31]=P,e[32]=j):j=e[32];let M;return e[33]!==f||e[34]!==j||e[35]!==u?(M=x.jsx(G,{className:u,onClick:f,children:j}),e[33]=f,e[34]=j,e[35]=u,e[36]=M):M=e[36],M}function Z(s){return s.stopPropagation()}function B(s){return s.stopPropagation()}export{ue as C,ce as a,ae as g,le as u};
1
+ import{g as _}from"./connection-slug-eyAPH6o3.js";import{e as R,s as $,aH as A,K as L,c as E,j as x}from"./index-D34n6J5J.js";import{u as D}from"./use-registry-connections-DR_etJ2H.js";import{a as K}from"./use-organization-settings-BD9CIHH5.js";import{S as w,c as H}from"./constants-DDHDU3PV.js";import{u as Q}from"./useInfiniteQuery-B4w-6TrV.js";import{i as F,f as q}from"./extract-connection-data-CfXvFcGA.js";import{C as G}from"./card-CaekC2K0.js";import{I as U}from"./integration-icon-Cdkk9YPE.js";function ae(s){const e=new Map;for(const o of s){const l=_(o),n=e.get(l);n?n.push(o):e.set(l,[o])}const t=[],f=new Set;for(const o of s){const l=_(o);if(f.has(l))continue;f.add(l);const n=e.get(l),m=n[0];n.length===1?t.push({type:"single",connection:m}):t.push({type:"group",key:l,icon:m.icon,title:m.app_name?m.title.replace(/\s*\(\d+\)\s*$/,""):m.title,connections:n})}return t}function le(){const s=R.c(6),e=D(),t=K(),f=$().project.enabledPlugins??[];let o;if(s[0]!==f||s[1]!==t||s[2]!==e){let l;s[4]!==t?(l=n=>t(n.id),s[4]=t,s[5]=l):l=s[5],o=e.filter(l).map(V),f.includes("private-registry")&&t(w)&&o.push({id:w,title:"Private Registry",icon:null}),s[0]=f,s[1]=t,s[2]=e,s[3]=o}else o=s[3];return o}function V(s){return{id:s.id,title:s.title,icon:s.icon}}const X=24,S=3;function k(s){return s.id.includes("community-registry")}function Y(s){const e=s?.trim();if(e)return{operator:"or",conditions:[{field:["title"],operator:"contains",value:e},{field:["description"],operator:"contains",value:e},{field:["name"],operator:"contains",value:e},{field:["server","title"],operator:"contains",value:e}]}}function T(s,e,t,f){const o=s.map(u=>u.id).sort().join(","),l=Y(f),{data:n,fetchNextPage:m,hasNextPage:c,isFetchingNextPage:v,isLoading:p}=Q({queryKey:L.storeDiscovery(e,`${o}:${f??""}`),queryFn:async({pageParam:u})=>{const r=u??{};return await Promise.all(s.map(async i=>{const g=r[i.id];if(g==="EXHAUSTED")return{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:[]};const I=F(i.id,e);let b;for(let N=0;N<S;N++){let y=null;try{y=await H({connectionId:i.id,orgId:e});const d={limit:X};g&&(d.cursor=g),l&&(d.where=l);const C=await y.callTool({name:I,arguments:d}),P=C.structuredContent??C,j=P.nextCursor||P.cursor||void 0,M=q(P?[P]:[]);return{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:M,nextCursor:j}}catch(d){b=d}finally{await y?.close().catch(()=>{})}}return console.warn(`[useMergedStoreDiscovery] Registry "${i.title}" (${i.id}) failed after ${S} attempts:`,b),{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:[]}}))},initialPageParam:{},getNextPageParam:u=>{const r={};let a=!1;for(const i of u)i.registryId&&(i.nextCursor?(r[i.registryId]=i.nextCursor,a=!0):r[i.registryId]="EXHAUSTED");return a?r:void 0},staleTime:3600*1e3,placeholderData:A,retry:!1,enabled:t&&s.length>0}),h=[];if(n?.pages)for(const u of n.pages)for(const r of u)for(const a of r.items)h.push({...a,_sourceName:a._sourceName??r.registryTitle,_sourceIcon:a._sourceIcon??r.registryIcon,_registryId:a._registryId??r.registryId});return{items:h,hasMore:c??!1,isLoadingMore:v,isInitialLoading:p,fetchNextPage:()=>{c&&!v&&m()}}}function ce(s,e){const t=R.c(17),{org:f}=$();let o;t[0]!==s?(o=s.filter(W),t[0]=s,t[1]=o):o=t[1];const l=o;let n;t[2]!==s?(n=s.filter(z),t[2]=s,t[3]=n):n=t[3];const m=n,c=T(l,f.id,!0,e),v=!c.hasMore&&!c.isInitialLoading,p=T(m,f.id,v,e);let h;if(t[4]!==v||t[5]!==p||t[6]!==c.items){const N=new Set;h=[];const y=[...c.items];v&&y.push(...p.items);for(const d of y){const C=`${d._registryId}:${d.id}`;N.has(C)||(N.add(C),h.push(d))}t[4]=v,t[5]=p,t[6]=c.items,t[7]=h}else h=t[7];const u=c.isInitialLoading,r=c.isLoadingMore||p.isLoadingMore;let a;e:{if(c.hasMore){a=!0;break e}if(m.length>0){if(!v){a=!0;break e}a=p.hasMore;break e}a=!1}const i=a;let g;t[8]!==p||t[9]!==c?(g=()=>{if(c.hasMore){c.fetchNextPage();return}p.hasMore&&p.fetchNextPage()},t[8]=p,t[9]=c,t[10]=g):g=t[10];const I=g;let b;return t[11]!==i||t[12]!==u||t[13]!==r||t[14]!==h||t[15]!==I?(b={items:h,hasMore:i,isLoadingMore:r,isInitialLoading:u,loadMore:I},t[11]=i,t[12]=u,t[13]=r,t[14]=h,t[15]=I,t[16]=b):b=t[16],b}function z(s){return k(s)}function W(s){return!k(s)}function ue(s){const e=R.c(37),{connection:t,onClick:f,headerActions:o,headerActionsAlwaysVisible:l,body:n,footer:m,className:c,fallbackIcon:v}=s,p=l===void 0?!1:l,h=f&&"hover:bg-muted/50";let u;e[0]!==c||e[1]!==h?(u=E("cursor-pointer transition-colors group overflow-hidden flex flex-col h-full",h,c),e[0]=c,e[1]=h,e[2]=u):u=e[2];let r;e[3]!==t.icon||e[4]!==t.title||e[5]!==v?(r=x.jsx(U,{icon:t.icon,name:t.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:v}),e[3]=t.icon,e[4]=t.title,e[5]=v,e[6]=r):r=e[6];let a;e[7]!==o||e[8]!==p?(a=o&&x.jsx("div",{className:E("transition-opacity",!p&&"sm:opacity-0 sm:group-hover:opacity-100"),onClick:B,children:o}),e[7]=o,e[8]=p,e[9]=a):a=e[9];let i;e[10]!==a?(i=x.jsx("div",{className:"relative",children:a}),e[10]=a,e[11]=i):i=e[11];let g;e[12]!==r||e[13]!==i?(g=x.jsxs("div",{className:"flex items-start justify-between",children:[r,i]}),e[12]=r,e[13]=i,e[14]=g):g=e[14];let I;e[15]!==t.title?(I=x.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:t.title}),e[15]=t.title,e[16]=I):I=e[16];const b=t.description||"No description";let N;e[17]!==b?(N=x.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:b}),e[17]=b,e[18]=N):N=e[18];let y;e[19]!==N||e[20]!==I?(y=x.jsxs("div",{className:"flex flex-col gap-1",children:[I,N]}),e[19]=N,e[20]=I,e[21]=y):y=e[21];let d;e[22]!==n?(d=n&&x.jsx("div",{children:n}),e[22]=n,e[23]=d):d=e[23];let C;e[24]!==y||e[25]!==d||e[26]!==g?(C=x.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[g,y,d]}),e[24]=y,e[25]=d,e[26]=g,e[27]=C):C=e[27];let P;e[28]!==m?(P=m&&x.jsx("div",{className:"border-t border-border mt-auto",children:x.jsx("div",{className:"h-14 flex items-center p-4.5",onClick:Z,children:m})}),e[28]=m,e[29]=P):P=e[29];let j;e[30]!==C||e[31]!==P?(j=x.jsxs("div",{className:"flex flex-col flex-1",children:[C,P]}),e[30]=C,e[31]=P,e[32]=j):j=e[32];let M;return e[33]!==f||e[34]!==j||e[35]!==u?(M=x.jsx(G,{className:u,onClick:f,children:j}),e[33]=f,e[34]=j,e[35]=u,e[36]=M):M=e[36],M}function Z(s){return s.stopPropagation()}function B(s){return s.stopPropagation()}export{ue as C,ce as a,ae as g,le as u};
@@ -0,0 +1 @@
1
+ import{v as he,aI as Te,aJ as Ie,y as le,aK as Ae,e as $,j as t,l as ge,B as H,r as G,c as je,s as te,V as De,K as oe,f as Q,aL as ce,u as $e,aM as Pe,E as Oe,g as Me,o as ze,x as Ve,w as Ee,a0 as Ue,aN as Fe,z as q,a1 as Le}from"./index-D34n6J5J.js";import{g as Re}from"./constants-v4RUVkEN.js";import{E as ve}from"./empty-state-BdQTFnZA.js";import{E as Be,c as He,r as We,b as Xe,d as Ge}from"./connection-form-helpers-CBEV0IXi.js";import{c as Ke,S as qe}from"./index-e3AFJ_dX.js";import{u as be,T as Qe}from"./tools-list-UnPsMGhr.js";import{u as Je}from"./use-members-M_p47epa.js";import{A as Ye}from"./avatar-CF1bgUpD.js";import{b as Ne,a as ye,u as Ze}from"./use-connection-Cif-LY0f.js";import{u as ie,S as et}from"./constants-DDHDU3PV.js";import{b as tt}from"./use-mcp-tools-BYVtg7WH.js";import{g as ae,M as st,a as nt}from"./types-D4PfKOFF.js";import{b as Y,c as ot,a as Z,T as it,d as at}from"./tabs-DOoLL5wa.js";import{I as se}from"./integration-icon-Cdkk9YPE.js";import{s as rt}from"./Plus-oXFwCrYz.js";import{a as _e}from"./Settings02-Dm9dFDqk.js";import{s as re}from"./Trash01-C6bAXG6g.js";import{p as lt,o as ct,r as dt,n as mt,s as ut}from"./index-zDq2Zqio.js";import{a as U,b as F,c as R,d as V,e as B,f as xt,F as pt}from"./form-D7DN8UcB.js";import{I as X}from"./input-urtyHxks.js";import{u as ft,D as ht}from"./use-delete-connection-BZmW9ZAz.js";import{V as gt}from"./layout-B5SDe6IW.js";import{c as jt,C as vt,B as bt,a as Nt,b as yt,d as _t,e as Ct}from"./monitoring-stats-row-D3x0_phM.js";import{u as St}from"./use-virtual-mcp-0vHwLInn.js";import{i as Ce}from"./ChevronRight-DV9No7GF.js";import{a as Se}from"./Users03-DqYvPeZM.js";import{g as we}from"./connection-slug-eyAPH6o3.js";import{n as wt}from"./ZapSquare-DT93lGV4.js";import{T as kt,b as Tt}from"./agent-icon-CyE6nkC1.js";import{b as It}from"./Tool01-CKowkGsd.js";import{C as At}from"./collection-search-Bo2bOvRn.js";import{C as Dt}from"./card-CaekC2K0.js";import{B as $t}from"./badge-s_TAXGUN.js";import{c as Pt,d as Ot,e as Mt,D as de}from"./dropdown-menu-v2GifVOh.js";import{a as me,c as ue,d as xe,S as pe,b as E}from"./select-CePxsPeP.js";import{i as zt}from"./CheckCircle-DJ3lme5R.js";import{t as Vt}from"./ChevronDown-DGnjAtqs.js";import{n as Et}from"./Container-B1nHZdmn.js";import{s as ee}from"./Star01-_IJK5Yjt.js";import{a as Ut}from"./RefreshCcw01-B10mKiE2.js";import{s as Ft}from"./XClose-BbIo6xHe.js";import"./collections-DHmXATua.js";import"./SearchMd-BRJBvWf4.js";import"./index-CHKi_s_a.js";import"./index-D-RCnwJQ.js";import"./extract-connection-data-CfXvFcGA.js";import"./use-registry-connections-DR_etJ2H.js";import"./use-organization-settings-BD9CIHH5.js";import"./index-FnxI6OGR.js";import"./popover-j_PzMtdY.js";import"./use-mobile-CxvYCzu9.js";import"./use-create-virtual-mcp-CBpw3zXA.js";import"./use-navigate-to-agent-CFIKBq0L.js";import"./User01-C2-anwoO.js";import"./use-collections-DRlHpXQL.js";import"./X-i9zBn6Hn.js";import"./label-Bt4h_QUk.js";import"./alert-dialog-CicrCOay.js";import"./AlertCircle-DTmaHldD.js";import"./ArrowNarrowLeft-DlPeFc4v.js";import"./XCircle-C1sJYG9R.js";import"./ChevronUp-BkSgkwhO.js";import"./DotsVertical-Bp2tW8JI.js";import"./Palette-CI8n49a8.js";import"./LinkExternal01-BBbCPDtX.js";import"./Lock01-DpPIS3K7.js";import"./Sun-QqE1VnS_.js";import"./Play-DKFUTU3G.js";import"./Shield01-BZJVBd5S.js";import"./Zap-KmbRMccM.js";const Lt=he({scopes:Ae(le()).describe("List of scopes available"),stateSchema:Te(le(),Ie()).describe("JSON Schema (draft-07) defining the state structure")}),Rt=[{name:"MCP_CONFIGURATION",inputSchema:he({}),outputSchema:Lt}];function Bt(s){const e=$.c(39),{instance:n,onConfigure:i,onAuthenticate:r,onDelete:o}=s;let c;e[0]!==n.id?(c={connectionId:n.id},e[0]=n.id,e[1]=c):c=e[1];const d=be(c),l=!(n.connection_type==="VIRTUAL")&&d.supportsOAuth&&!d.isAuthenticated,u=l?"border-destructive/50 bg-destructive/5":"border-transparent";let p;e[2]!==u?(p=je("flex items-center gap-3 rounded-lg border px-4 py-2.5 transition-colors",u),e[2]=u,e[3]=p):p=e[3];let a;e[4]!==n.icon||e[5]!==n.title?(a=t.jsx(se,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[4]=n.icon,e[5]=n.title,e[6]=a):a=e[6];let f;e[7]!==n.title?(f=t.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[7]=n.title,e[8]=f):f=e[8];let h;e[9]!==l?(h=l&&t.jsx("span",{className:"text-xs text-destructive font-medium",children:"Needs authorization"}),e[9]=l,e[10]=h):h=e[10];let b;e[11]!==f||e[12]!==h?(b=t.jsxs("div",{className:"flex-1 min-w-0",children:[f,h]}),e[11]=f,e[12]=h,e[13]=b):b=e[13];let j;e[14]!==n||e[15]!==l||e[16]!==r?(j=l&&t.jsx(H,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:()=>r(n),children:"Authorize"}),e[14]=n,e[15]=l,e[16]=r,e[17]=j):j=e[17];let v;e[18]!==n||e[19]!==i?(v=()=>i(n),e[18]=n,e[19]=i,e[20]=v):v=e[20];let S;e[21]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx(_e,{size:13}),e[21]=S):S=e[21];let I;e[22]!==v?(I=t.jsx(H,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:v,title:"Configure",children:S}),e[22]=v,e[23]=I):I=e[23];let N;e[24]!==n||e[25]!==o?(N=()=>o(n),e[24]=n,e[25]=o,e[26]=N):N=e[26];let w;e[27]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx(re,{size:13}),e[27]=w):w=e[27];let k;e[28]!==N?(k=t.jsx(H,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:N,title:"Delete",children:w}),e[28]=N,e[29]=k):k=e[29];let _;e[30]!==I||e[31]!==k||e[32]!==j?(_=t.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[j,I,k]}),e[30]=I,e[31]=k,e[32]=j,e[33]=_):_=e[33];let T;return e[34]!==_||e[35]!==p||e[36]!==a||e[37]!==b?(T=t.jsxs("div",{className:p,children:[a,b,_]}),e[34]=_,e[35]=p,e[36]=a,e[37]=b,e[38]=T):T=e[38],T}function Ht(s){const e=$.c(15),{instance:n,onConfigure:i}=s;let r;e[0]!==n.icon||e[1]!==n.title?(r=t.jsx(se,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[0]=n.icon,e[1]=n.title,e[2]=r):r=e[2];let o;e[3]!==n.title?(o=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm font-medium truncate",children:n.title})}),e[3]=n.title,e[4]=o):o=e[4];let c;e[5]!==n||e[6]!==i?(c=()=>i(n),e[5]=n,e[6]=i,e[7]=c):c=e[7];let d;e[8]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(_e,{size:13}),e[8]=d):d=e[8];let m;e[9]!==c?(m=t.jsx("div",{className:"flex items-center gap-1 shrink-0",children:t.jsx(H,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:c,title:"Configure",children:d})}),e[9]=c,e[10]=m):m=e[10];let l;return e[11]!==r||e[12]!==o||e[13]!==m?(l=t.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-transparent px-4 py-2.5 transition-colors",children:[r,o,m]}),e[11]=r,e[12]=o,e[13]=m,e[14]=l):l=e[14],l}function Wt(s){const e=$.c(25),{instances:n,onConfigure:i,onAuthenticate:r,onDelete:o,onAdd:c,isAdding:d}=s;if(n.length===0)return null;const m=n.length===1?"Instance":"Instances";let l;e[0]!==m?(l=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:m}),e[0]=m,e[1]=l):l=e[1];let u;e[2]!==d?(u=d?t.jsx(ge,{size:13,className:"animate-spin"}):t.jsx(rt,{size:13}),e[2]=d,e[3]=u):u=e[3];let p;e[4]!==d||e[5]!==c||e[6]!==u?(p=t.jsxs(H,{variant:"default",size:"sm",className:"h-7 gap-1.5 text-xs",onClick:c,disabled:d,children:[u,"Add instance"]}),e[4]=d,e[5]=c,e[6]=u,e[7]=p):p=e[7];let a;e[8]!==l||e[9]!==p?(a=t.jsxs("div",{className:"px-5 py-4 border-b border-border flex items-center justify-between",children:[l,p]}),e[8]=l,e[9]=p,e[10]=a):a=e[10];let f;if(e[11]!==n||e[12]!==r||e[13]!==i||e[14]!==o){let j;e[16]!==r||e[17]!==i||e[18]!==o?(j=v=>t.jsx(G.Suspense,{fallback:t.jsx(Ht,{instance:v,onConfigure:i}),children:t.jsx(Bt,{instance:v,onConfigure:i,onAuthenticate:r,onDelete:o})},v.id),e[16]=r,e[17]=i,e[18]=o,e[19]=j):j=e[19],f=n.map(j),e[11]=n,e[12]=r,e[13]=i,e[14]=o,e[15]=f}else f=e[15];let h;e[20]!==f?(h=t.jsx("div",{className:"p-2 flex flex-col gap-1",children:f}),e[20]=f,e[21]=h):h=e[21];let b;return e[22]!==a||e[23]!==h?(b=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[a,h]}),e[22]=a,e[23]=h,e[24]=b):b=e[24],b}const Xt=[{value:"7d",label:"7d"},{value:"14d",label:"14d"},{value:"30d",label:"30d"}];function Gt(s){const e=new Date,n=new Date(e);return s==="7d"?n.setDate(n.getDate()-7):s==="14d"?n.setDate(n.getDate()-14):n.setDate(n.getDate()-30),{startDate:n,endDate:e}}const Kt={calls:{label:"Tool calls"},errors:{label:"Errors"}};function qt(s){const e=$.c(3),{connectionId:n,orgId:i,timeframe:r}=s;let o;e[0]!==i?(o={connectionId:et,orgId:i},e[0]=i,e[1]=o):o=e[1];const c=ie(o),d=Gt(r),{data:m}=De({queryKey:oe.connectionActivity(n,r,i),queryFn:async()=>{const f=await c.callTool({name:"MONITORING_LOGS_LIST",arguments:{startDate:d.startDate.toISOString(),endDate:d.endDate.toISOString(),connectionId:n,limit:2e3,offset:0}});return f.structuredContent??f},staleTime:3e5}),l=jt(m?.logs??[],d),u=l.data,p=l.totalCalls>0;let a;return e[2]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Tool calls"}),e[2]=a):a=e[2],t.jsxs("div",{children:[t.jsxs("div",{className:"flex gap-6 px-5 pb-4",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:l.totalCalls.toLocaleString()}),a]}),l.totalErrors>0&&t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-destructive tabular-nums",children:l.totalErrors.toLocaleString()}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Errors"})]}),l.avgDurationMs>0&&t.jsxs("div",{children:[t.jsxs("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:[Math.round(l.avgDurationMs),"ms"]}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Avg latency"})]})]}),p?t.jsxs("div",{children:[t.jsx(vt,{config:Kt,className:"h-16 w-full",children:t.jsxs(bt,{data:u,barCategoryGap:"4%",children:[t.jsx(Nt,{content:t.jsx(yt,{labelFormatter:Jt}),cursor:{fill:"var(--muted)"}}),t.jsx(_t,{dataKey:"calls",radius:[2,2,0,0],minPointSize:1,children:u.map(Qt)})]})}),t.jsxs("div",{className:"flex justify-between px-3 mt-1 pb-3",children:[t.jsx("span",{className:"text-[10px] text-muted-foreground",children:u[0]?.label}),t.jsx("span",{className:"text-[10px] text-muted-foreground",children:u[u.length-1]?.label})]})]}):t.jsx("div",{className:"h-20 flex items-center justify-center",children:t.jsx("p",{className:"text-sm text-muted-foreground/60",children:"No activity in this period"})})]})}function Qt(s,e){return t.jsx(Ct,{fill:s.errorRate>50?"var(--destructive)":"var(--chart-1)",fillOpacity:s.calls===0?.2:s.errorRate>50?.7:.85},`cell-${e}`)}function Jt(s,e){const n=Array.isArray(e)?e[0]:void 0;return n&&typeof n=="object"&&"payload"in n?n.payload?.label??"":""}function Yt(){const s=$.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{children:[t.jsx("div",{className:"flex gap-6 px-5 pb-4",children:t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx("div",{className:"h-7 w-16 rounded-md bg-muted animate-pulse"}),t.jsx("div",{className:"h-3 w-14 rounded bg-muted animate-pulse"})]})}),t.jsx("div",{className:"h-20 w-full rounded-md bg-muted animate-pulse"})]}),s[0]=e):e=s[0],e}function Zt(s){const e=$.c(13),{connectionId:n}=s,[i,r]=G.useState("14d"),{org:o}=te();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("div",{children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Activity"})}),e[0]=c):c=e[0];let d;e[1]!==i?(d=Xt.map(a=>t.jsx("button",{type:"button",onClick:()=>r(a.value),className:je("px-2.5 py-1 text-xs font-medium rounded-md transition-colors",i===a.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:a.label},a.value)),e[1]=i,e[2]=d):d=e[2];let m;e[3]!==d?(m=t.jsxs("div",{className:"px-5 py-4 flex items-center justify-between",children:[c,t.jsx("div",{className:"flex items-center gap-0.5 bg-muted rounded-lg p-0.5",children:d})]}),e[3]=d,e[4]=m):m=e[4];let l;e[5]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(Yt,{}),e[5]=l):l=e[5];let u;e[6]!==n||e[7]!==o.id||e[8]!==i?(u=t.jsx(G.Suspense,{fallback:l,children:t.jsx(qt,{connectionId:n,orgId:o.id,timeframe:i})}),e[6]=n,e[7]=o.id,e[8]=i,e[9]=u):u=e[9];let p;return e[10]!==m||e[11]!==u?(p=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[m,u]}),e[10]=m,e[11]=u,e[12]=p):p=e[12],p}function es(s){const e=$.c(15),{virtualMcp:n,org:i}=s,r=Q();let o;e[0]!==r||e[1]!==i||e[2]!==n.id?(o=()=>{const p=crypto.randomUUID();r({to:"/$org/$taskId",params:{org:i,taskId:p},search:{virtualmcpid:n.id}})},e[0]=r,e[1]=i,e[2]=n.id,e[3]=o):o=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(Se,{size:16}),e[4]=c):c=e[4];let d;e[5]!==n.icon||e[6]!==n.title?(d=t.jsx(se,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:c}),e[5]=n.icon,e[6]=n.title,e[7]=d):d=e[7];let m;e[8]!==n.title?(m=t.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:n.title}),e[8]=n.title,e[9]=m):m=e[9];let l;e[10]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(Ce,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[10]=l):l=e[10];let u;return e[11]!==o||e[12]!==d||e[13]!==m?(u=t.jsxs("button",{type:"button",onClick:o,className:"flex items-center gap-3 rounded-lg hover:bg-muted/50 transition-colors group text-left w-full",children:[d,m,l]}),e[11]=o,e[12]=d,e[13]=m,e[14]=u):u=e[14],u}function ts(s){const e=$.c(7),{virtualMcps:n,org:i}=s;let r;if(e[0]!==i||e[1]!==n){let c;e[3]!==i?(c=d=>t.jsx(es,{virtualMcp:d,org:i},d.id),e[3]=i,e[4]=c):c=e[4],r=n.map(c),e[0]=i,e[1]=n,e[2]=r}else r=e[2];let o;return e[5]!==r?(o=t.jsx("div",{className:"flex flex-col gap-3",children:t.jsx("div",{className:"flex flex-col gap-2",children:r})}),e[5]=r,e[6]=o):o=e[6],o}function ss(s){const e=$.c(7),{connection:n}=s,{org:i}=te();let r;e[0]!==n.id?(r={filters:[{column:"connection_id",value:n.id}]},e[0]=n.id,e[1]=r):r=e[1];const o=St(r);if(!(o.length>0)){let l;return e[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(t.Fragment,{}),e[2]=l):l=e[2],l}let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx("div",{className:"px-5 py-4 border-b border-border",children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Used by agents"})}),e[3]=d):d=e[3];let m;return e[4]!==i.slug||e[5]!==o?(m=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[d,t.jsx("div",{className:"px-5 py-4",children:t.jsx(ts,{virtualMcps:o,org:i.slug})})]}),e[4]=i.slug,e[5]=o,e[6]=m):m=e[6],m}function ns(s){const e=$.c(30),{tools:n,connectionId:i,org:r}=s,o=Q(),{org:c}=te();let d;e[0]!==i||e[1]!==c.id?(d={connectionId:i,orgId:c.id},e[0]=i,e[1]=c.id,e[2]=d):d=e[2];const m=ie(d),l=Ne(i);let u;e[3]!==l||e[4]!==i?(u=l?we(l):i,e[3]=l,e[4]=i,e[5]=u):u=e[5];const p=u,[a,f]=G.useState("");let h,b,j,v;if(e[6]!==p||e[7]!==m||e[8]!==o||e[9]!==r||e[10]!==a||e[11]!==n){const N=(n??[]).filter(os),w=a.toLowerCase().trim(),k=w?N.filter(g=>g.name.toLowerCase().includes(w)||g.description&&g.description.toLowerCase().includes(w)):N;let _;e[16]!==p||e[17]!==o||e[18]!==r?(_=g=>{o({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:r,appSlug:p,collectionName:"tools",itemId:encodeURIComponent(g.name)}})},e[16]=p,e[17]=o,e[18]=r,e[19]=_):_=e[19];const T=_;j="flex flex-col h-full overflow-hidden";let y;e[20]===Symbol.for("react.memo_cache_sentinel")?(y=g=>{g.key==="Escape"&&(f(""),g.target.blur())},e[20]=y):y=e[20],e[21]!==a?(v=t.jsx(At,{value:a,onChange:f,placeholder:"Search apps...",onKeyDown:y}),e[21]=a,e[22]=v):v=e[22],h="flex-1 overflow-auto p-5",b=k.length===0?t.jsx(ve,{image:null,title:a?"No apps found":"No apps available",description:a?"Try adjusting your search terms":"This connection doesn't have any tools with interactive UIs yet."}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-4",children:k.map(g=>{const P=ae(g._meta);return t.jsxs(Dt,{className:"cursor-pointer transition-colors overflow-hidden gap-0",onClick:()=>T(g),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx(st,{resourceURI:P,toolInfo:{tool:g},displayMode:"inline",minHeight:200,maxHeight:200,client:m})}),t.jsxs("div",{className:"flex flex-col gap-2 p-4",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:g.name}),t.jsx(Qe,{annotations:g.annotations,_meta:g._meta})]}),g.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:g.description})]})]},g.name)})}),e[6]=p,e[7]=m,e[8]=o,e[9]=r,e[10]=a,e[11]=n,e[12]=h,e[13]=b,e[14]=j,e[15]=v}else h=e[12],b=e[13],j=e[14],v=e[15];let S;e[23]!==h||e[24]!==b?(S=t.jsx("div",{className:h,children:b}),e[23]=h,e[24]=b,e[25]=S):S=e[25];let I;return e[26]!==j||e[27]!==v||e[28]!==S?(I=t.jsxs("div",{className:j,children:[v,S]}),e[26]=j,e[27]=v,e[28]=S,e[29]=I):I=e[29],I}function os(s){return!!ae(s._meta)}function ke(s){const e=s.replace(/[._]/g," ").trim().split(/\s+/),n=c=>c.charAt(0).toUpperCase()+c.slice(1),i=new Set(["list","create","get","update","delete","fetch","search","run","trigger","review","send","check"]),r=e.map(n),o=e[e.length-1];return r.length>=2&&o&&i.has(o)?[r.pop(),...r].join(" "):r.join(" ")}function ne(s){const e=$.c(2),{label:n}=s;let i;return e[0]!==n?(i=t.jsx("div",{className:"px-5 py-8 text-center",children:t.jsxs("p",{className:"text-sm text-muted-foreground",children:["No ",n," available."]})}),e[0]=n,e[1]=i):i=e[1],i}function is(s){const e=$.c(50),{tools:n,prompts:i,resources:r,connectionId:o,org:c}=s;let d;e[0]!==i?(d=i===void 0?[]:i,e[0]=i,e[1]=d):d=e[1];const m=d;let l;e[2]!==r?(l=r===void 0?[]:r,e[2]=r,e[3]=l):l=e[3];const u=l,p=Q(),a=Ne(o??"");let f;e[4]!==a||e[5]!==o?(f=a?we(a):o,e[4]=a,e[5]=o,e[6]=f):f=e[6];const h=f;let b;e[7]!==h||e[8]!==o||e[9]!==p||e[10]!==c?(b=function(A){!o||!c||p({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:c,appSlug:h,collectionName:"tools",itemId:encodeURIComponent(A)}})},e[7]=h,e[8]=o,e[9]=p,e[10]=c,e[11]=b):b=e[11];const j=b;let v;e[12]!==o||e[13]!==c||e[14]!==n?(v=o&&c&&n.some(ls),e[12]=o,e[13]=c,e[14]=n,e[15]=v):v=e[15];const S=v;if(n.length+m.length+u.length===0){let C;return e[16]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsxs("div",{className:"rounded-xl border border-border bg-card p-5",children:[t.jsx("h3",{className:"text-sm font-semibold text-foreground mb-1",children:"Capabilities"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"No capabilities discovered yet. The connection may still be connecting."})]}),e[16]=C):C=e[16],C}let N;e[17]!==n.length?(N=t.jsxs(Y,{value:"tools",variant:"underline",children:["Tools (",n.length,")"]}),e[17]=n.length,e[18]=N):N=e[18];let w;e[19]!==S?(w=S&&t.jsx(Y,{value:"apps",variant:"underline",children:"UI"}),e[19]=S,e[20]=w):w=e[20];let k,_;e[21]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(Y,{value:"prompts",variant:"underline",children:"Prompts"}),_=t.jsx(Y,{value:"resources",variant:"underline",children:"Resources"}),e[21]=k,e[22]=_):(k=e[21],_=e[22]);let T;e[23]!==N||e[24]!==w?(T=t.jsx("div",{className:"px-5 flex items-center justify-between border-b border-border",children:t.jsxs(ot,{variant:"underline",className:"gap-1",children:[N,w,k,_]})}),e[23]=N,e[24]=w,e[25]=T):T=e[25];let y;e[26]!==j||e[27]!==n?(y=n.length>0?n.map(C=>t.jsxs("button",{type:"button",className:"w-full flex items-start gap-3 px-5 py-3 text-left hover:bg-muted/40 transition-colors cursor-pointer",onClick:()=>j(C.name),children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(It,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:ke(C.name)}),C.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:C.description})]}),t.jsx(Ce,{size:16,className:"text-muted-foreground shrink-0 mt-0.5"})]},C.name)):t.jsx(ne,{label:"tools"}),e[26]=j,e[27]=n,e[28]=y):y=e[28];let g;e[29]!==y?(g=t.jsx(Z,{value:"tools",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:y})}),e[29]=y,e[30]=g):g=e[30];let P;e[31]!==o||e[32]!==S||e[33]!==c||e[34]!==n?(P=S&&t.jsx(Z,{value:"apps",className:"h-auto min-h-[200px]",children:t.jsx(ns,{tools:n,connectionId:o,org:c})}),e[31]=o,e[32]=S,e[33]=c,e[34]=n,e[35]=P):P=e[35];let M;e[36]!==m?(M=m.length>0?m.map(rs):t.jsx(ne,{label:"prompts"}),e[36]=m,e[37]=M):M=e[37];let O;e[38]!==M?(O=t.jsx(Z,{value:"prompts",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:M})}),e[38]=M,e[39]=O):O=e[39];let D;e[40]!==u?(D=u.length>0?u.map(as):t.jsx(ne,{label:"resources"}),e[40]=u,e[41]=D):D=e[41];let z;e[42]!==D?(z=t.jsx(Z,{value:"resources",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:D})}),e[42]=D,e[43]=z):z=e[43];let x;return e[44]!==T||e[45]!==g||e[46]!==P||e[47]!==O||e[48]!==z?(x=t.jsx("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:t.jsxs(it,{defaultValue:"tools",variant:"underline",children:[T,g,P,O,z]})}),e[44]=T,e[45]=g,e[46]=P,e[47]=O,e[48]=z,e[49]=x):x=e[49],x}function as(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(kt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:s.name}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description}),s.uri&&t.jsx("div",{className:"text-xs text-muted-foreground/60 font-mono mt-0.5 truncate",children:s.uri})]})]},s.uri??s.name)}function rs(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(wt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:ke(s.name)}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description})]})]},s.name)}function ls(s){return ae(s._meta)}function cs(s){const e=$.c(13),{connection:n,displayTitle:i}=s,r=i??n.title;let o;e[0]!==n.icon||e[1]!==r?(o=t.jsx(se,{icon:n.icon,name:r,size:"xl",className:"shrink-0"}),e[0]=n.icon,e[1]=r,e[2]=o):o=e[2];let c;e[3]!==r?(c=t.jsx("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:t.jsx("h1",{className:"text-lg md:text-xl font-semibold tracking-tight text-foreground leading-none",children:r})}),e[3]=r,e[4]=c):c=e[4];let d;e[5]!==n.description?(d=n.description&&t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed line-clamp-2",children:n.description}),e[5]=n.description,e[6]=d):d=e[6];let m;e[7]!==c||e[8]!==d?(m=t.jsxs("div",{className:"flex-1 min-w-0",children:[c,d]}),e[7]=c,e[8]=d,e[9]=m):m=e[9];let l;return e[10]!==o||e[11]!==m?(l=t.jsxs("div",{className:"flex items-center gap-4 md:gap-6 py-5 md:py-7 px-4 md:px-8 bg-background border-b border-border shrink-0",children:[o,m]}),e[10]=o,e[11]=m,e[12]=l):l=e[12],l}function ds({form:s,connection:e,hasOAuthToken:n,onReauthenticate:i,onRemoveOAuth:r}){const o=ce({control:s.control,name:"ui_type"}),c=ce({control:s.control,name:"connection_url"}),{stdioEnabled:d}=$e(),m=(()=>{if(typeof c!="string"||!c)return!1;try{const a=new URL(c);return a.hostname==="api.githubcopilot.com"&&a.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),l=d||e.connection_type==="STDIO",u=e.connection_type==="VIRTUAL",p=u?Pe(e.connection_url):null;return u?t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Type"}),t.jsxs("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:[t.jsx(Se,{className:"w-4 h-4 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:"Virtual MCP"})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"This connection references a Virtual MCP. Tools and resources are aggregated dynamically from the Virtual MCP's underlying connections."})]}),p&&t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Virtual MCP ID"}),t.jsx("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:t.jsx("code",{className:"text-sm text-muted-foreground",children:p})})]})]}):t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(U,{control:s.control,name:"ui_type",render:({field:a})=>t.jsxs(F,{className:"flex flex-col gap-3",children:[t.jsx(R,{className:"text-xs text-muted-foreground font-medium",children:"Connection"}),o!=="NPX"&&o!=="STDIO"?t.jsxs("div",{className:"flex items-stretch rounded-lg border border-border overflow-hidden",children:[t.jsxs(me,{value:a.value,onValueChange:a.onChange,children:[t.jsx(V,{children:t.jsxs(ue,{className:"h-full! w-auto min-w-[90px] border-0 rounded-none bg-muted/50 focus:ring-0 focus:ring-offset-0",children:[t.jsx(ee,{className:"w-4 h-4 text-muted-foreground shrink-0"}),t.jsx(xe,{})]})}),t.jsxs(pe,{children:[t.jsx(E,{value:"HTTP",children:"HTTP"}),t.jsx(E,{value:"SSE",children:"SSE"}),t.jsx(E,{value:"Websocket",children:"Websocket"}),l&&t.jsxs(t.Fragment,{children:[t.jsx(E,{value:"NPX",children:"NPX Package"}),t.jsx(E,{value:"STDIO",children:"Custom Command"})]})]})]}),t.jsx("div",{className:"w-px bg-border"}),t.jsx(U,{control:s.control,name:"connection_url",render:({field:f})=>t.jsx(F,{className:"flex-1 min-w-0",children:t.jsx(V,{children:t.jsx(X,{placeholder:"https://example.com/mcp",...f,value:f.value??"",className:"h-10 border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent"})})})})]}):t.jsxs(me,{value:a.value,onValueChange:a.onChange,children:[t.jsx(V,{children:t.jsx(ue,{className:"h-10",children:t.jsx(xe,{})})}),t.jsxs(pe,{children:[t.jsx(E,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ee,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(E,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ee,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(E,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ee,{className:"w-4 h-4"}),"Websocket"]})}),l&&t.jsxs(t.Fragment,{children:[t.jsx(E,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Et,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(E,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Tt,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(B,{})]})}),o==="NPX"&&t.jsx(U,{control:s.control,name:"npx_package",render:({field:a})=>t.jsxs(F,{className:"flex flex-col gap-3",children:[t.jsx(R,{className:"text-xs text-muted-foreground font-medium",children:"NPM Package"}),t.jsx(V,{children:t.jsx(X,{placeholder:"@perplexity-ai/mcp-server",...a,value:a.value||"",className:"h-10 rounded-lg"})}),t.jsx(B,{})]})}),o==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(U,{control:s.control,name:"stdio_command",render:({field:a})=>t.jsxs(F,{className:"flex flex-col gap-3",children:[t.jsx(R,{className:"text-xs text-muted-foreground font-medium",children:"Command"}),t.jsx(V,{children:t.jsx(X,{placeholder:"node, bun, python...",...a,value:a.value||"",className:"h-10 rounded-lg"})}),t.jsx(B,{})]})}),t.jsx(U,{control:s.control,name:"stdio_args",render:({field:a})=>t.jsxs(F,{className:"flex flex-col gap-3",children:[t.jsx(R,{className:"text-xs text-muted-foreground font-medium",children:"Arguments"}),t.jsx(V,{children:t.jsx(X,{placeholder:"arg1 arg2 --flag value",...a,value:a.value||"",className:"h-10 rounded-lg"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Space-separated arguments"}),t.jsx(B,{})]})})]}),t.jsx(U,{control:s.control,name:"stdio_cwd",render:({field:a})=>t.jsxs(F,{className:"flex flex-col gap-3",children:[t.jsx(R,{className:"text-xs text-muted-foreground font-medium",children:"Working Directory"}),t.jsx(V,{children:t.jsx(X,{placeholder:"/path/to/project (optional)",...a,value:a.value||"",className:"h-10 rounded-lg"})}),t.jsx(B,{})]})})]}),(o==="NPX"||o==="STDIO")&&t.jsx(U,{control:s.control,name:"env_vars",render:({field:a})=>t.jsxs(F,{className:"flex flex-col gap-3",children:[t.jsx(R,{className:"text-xs text-muted-foreground font-medium",children:"Environment Variables"}),t.jsx(V,{children:t.jsx(Be,{value:a.value??[],onChange:a.onChange})}),t.jsx(B,{})]})}),o!=="NPX"&&o!=="STDIO"&&t.jsx(U,{control:s.control,name:"connection_token",render:({field:a})=>t.jsxs(F,{className:"flex flex-col gap-3",children:[t.jsx(R,{className:"text-xs text-muted-foreground font-medium",children:m?"GitHub Personal Access Token":"Token"}),n?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(Pt,{children:[t.jsx(Ot,{asChild:!0,children:t.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:t.jsxs($t,{variant:"success",className:"gap-1.5",children:[t.jsx(zt,{size:12}),"Authenticated via OAuth",t.jsx(Vt,{size:12})]})})}),t.jsxs(Mt,{align:"start",children:[t.jsxs(de,{onClick:i,children:[t.jsx(Ut,{size:16}),"Re-authenticate"]}),t.jsxs(de,{variant:"destructive",onClick:r,children:[t.jsx(re,{size:16}),"Remove OAuth"]})]})]})}):e.connection_token&&a.value===null?t.jsxs("div",{className:"relative group",children:[t.jsx("div",{className:"h-10 px-3 flex items-center rounded-lg border border-border bg-muted/50 text-muted-foreground font-mono text-sm",children:"••••••••••••••••"}),t.jsx("button",{type:"button",onClick:()=>a.onChange(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 rounded hover:bg-muted opacity-0 group-hover:opacity-100 transition-opacity",title:"Clear and replace token",children:t.jsx(Ft,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(V,{children:t.jsx(X,{type:"password",placeholder:m?"Paste your GitHub PAT":"Enter access token...",...a,value:a.value||"",className:"h-10 rounded-lg"})}),m&&t.jsxs(xt,{children:["Create a PAT at"," ",t.jsx("a",{href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"github.com/settings/personal-access-tokens"})]})]}),t.jsx(B,{})]})})]})}function ms(s){return s.command==="npx"}function us(s){return s.args?.find(e=>!e.startsWith("-"))??""}function xs(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function fe(s,e){const n={title:s.title,description:s.description??"",icon:s.icon??null,configuration_state:s.configuration_state??{},configuration_scopes:s.configuration_scopes||[]};if(s.connection_type==="STDIO"&&Fe(s.connection_headers)){const i=s.connection_headers,r=We(i.envVars);if(ms(i)){const c=us(i);return{...n,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:c,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:r}}const o=xs(i);return{...n,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:o.command,stdio_args:o.args,stdio_cwd:o.cwd,env_vars:r}}return{...n,ui_type:s.connection_type,connection_url:s.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}function ps(s){let e,n=null,i=null,r=null;return s.ui_type==="NPX"?(e="STDIO",n="",r=Xe(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",r=Ge(s.stdio_command||"",s.stdio_args||"",s.stdio_cwd,s.env_vars||[])):(e=s.ui_type,n=s.connection_url||"",i=s.connection_token||null),{title:s.title,description:s.description||null,icon:s.icon??null,connection_type:e,connection_url:n,...i&&{connection_token:i},...r&&{connection_headers:r},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function fs({connection:s,connectionId:e,org:n,isUpdating:i,tools:r,prompts:o,resources:c,siblings:d}){const m=Q({from:"/$org/settings/connections/$appSlug"}),l=ze(),u=ye(),p=ft({onSuccess:()=>{d.length<=1&&m({to:"/$org/settings/connections",params:{org:n}})}}),[a,f]=G.useState(null),[h,b]=G.useState(!1),j=be({connectionId:e}),{data:v}=Je(),S=v?.data?.members??[],I=a??s,N=S.find(x=>x.userId===I.created_by),k=s?.connection_type==="VIRTUAL"||j.isAuthenticated,_={...s,tools:r},T=Ke(_,Rt),y=Ve({resolver:Ee(He),values:fe(a??s)}),g=y.formState.isDirty,P=async()=>{if(!await y.trigger())return;const C=y.getValues(),A=ps(C),W=a?.id??e;await u.update.mutateAsync({id:W,data:A}),y.reset(C)},M=()=>{y.reset(fe(a??s))},O=async x=>{const{token:C,tokenInfo:A,error:W}=await Le({connectionId:x,scope:"offline_access"});if(W||!C){q.error(`Authentication failed: ${W}`);return}if(A)try{const K=await fetch(`/api/connections/${x}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:A.accessToken,refreshToken:A.refreshToken,expiresIn:A.expiresIn,scope:A.scope,clientId:A.clientId,clientSecret:A.clientSecret,tokenEndpoint:A.tokenEndpoint})});if(!K.ok)console.error("Failed to save OAuth token:",await K.text()),await u.update.mutateAsync({id:x,data:{connection_token:C}});else try{await u.update.mutateAsync({id:x,data:{}})}catch(J){console.warn("Failed to refresh connection tools after OAuth:",J)}}catch(K){console.error("Error saving OAuth token:",K),await u.update.mutateAsync({id:x,data:{connection_token:C}})}else await u.update.mutateAsync({id:x,data:{connection_token:C}});const L=new URL(`/mcp/${x}`,window.location.origin);await l.invalidateQueries({queryKey:oe.isMCPAuthenticated(L.href,null)}),q.success("Authentication successful")},D=()=>O(s.id),z=async()=>{try{const x=await fetch(`/api/connections/${s.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!x.ok){const A=await x.text();q.error(`Failed to remove OAuth: ${A}`);return}const C=new URL(`/mcp/${s.id}`,window.location.origin);await l.invalidateQueries({queryKey:oe.isMCPAuthenticated(C.href,null)}),q.success("OAuth removed. You can now re-authenticate with a different account.")}catch(x){console.error("Error removing OAuth token:",x),q.error("Failed to remove OAuth")}};return t.jsxs(t.Fragment,{children:[t.jsx(ht,{...p}),t.jsx(lt,{open:a!==null,onOpenChange:x=>{x||f(null)},children:t.jsxs(ct,{side:"right",className:"sm:max-w-[520px] p-0 flex flex-col gap-0 overflow-hidden",children:[t.jsxs(dt,{className:"px-4 py-3 md:px-6 md:py-4 border-b border-border shrink-0",children:[t.jsx(mt,{className:"text-base",children:a?.title??s.title}),t.jsx(ut,{className:"text-xs",children:"Update URL, authentication, and other settings"}),N&&t.jsxs("div",{className:"flex items-center gap-1.5 pt-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:"Connected by"}),t.jsx(Ye,{url:N.user?.image??void 0,fallback:N.user?.name??N.user?.email??"?",size:"3xs",shape:"circle"}),t.jsx("span",{className:"text-xs font-medium text-foreground",children:N.user?.name||N.user?.email})]})]}),t.jsxs(pt,{...y,children:[t.jsxs("div",{className:"flex-1 overflow-y-auto px-4 py-3 md:px-6 md:py-5 flex flex-col gap-4 md:gap-6",children:[t.jsxs("div",{className:"flex flex-col gap-3 md:gap-4",children:[t.jsx(U,{control:y.control,name:"title",render:({field:x})=>t.jsxs(F,{children:[t.jsx(R,{children:"Name"}),t.jsx(V,{children:t.jsx(X,{...x})}),t.jsx(B,{})]})}),t.jsx(U,{control:y.control,name:"description",render:({field:x})=>t.jsxs(F,{children:[t.jsx(R,{children:"Description"}),t.jsx(V,{children:t.jsx(X,{...x,value:x.value||""})}),t.jsx(B,{})]})})]}),t.jsx(ds,{form:y,connection:a??s,hasOAuthToken:j.hasOAuthToken,onReauthenticate:D,onRemoveOAuth:z}),t.jsx(qe,{connection:a??s,form:y,hasMcpBinding:T,isMCPAuthenticated:k,supportsOAuth:j.supportsOAuth,isServerError:j.isServerError,onAuthenticate:D,onViewReadme:void 0})]}),t.jsxs("div",{className:"px-6 py-4 border-t border-border flex gap-2 shrink-0",children:[t.jsx(H,{onClick:P,disabled:!g||i,className:"flex-1",children:i?"Saving…":"Save changes"}),g&&t.jsx(H,{variant:"outline",onClick:M,children:"Undo"}),t.jsxs(H,{variant:"outline",className:"gap-2 text-muted-foreground hover:text-destructive hover:border-destructive",onClick:()=>{const x=a??s;f(null),p.requestDelete(x)},children:[t.jsx(re,{size:15}),"Delete"]})]})]},a?.id??s.id)]})}),t.jsx(gt,{hideHeader:!0,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[t.jsx(cs,{connection:s,displayTitle:(()=>{const x=d[0]??s;return x.app_name?x.title.replace(/\s*\(\d+\)\s*$/,""):x.title})()}),t.jsx("div",{className:"flex-1 overflow-auto @container",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-2 gap-5 p-6",children:[t.jsx(Zt,{connectionId:e}),t.jsxs("div",{className:"flex flex-col gap-5",children:[t.jsx(Wt,{instances:d,onConfigure:x=>f(x),onAuthenticate:x=>O(x.id),onDelete:x=>p.requestDelete(x),isAdding:h,onAdd:async()=>{b(!0);try{const x=d[0]??s,C=x.title.replace(/\s*\(\d+\)\s*$/,""),A=d.length+1,W=`${C} (${A})`,L=Re("conn");await u.create.mutateAsync({id:L,title:W,description:x.description??null,connection_type:x.connection_type,connection_url:x.connection_url??null,connection_token:null,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:x.created_by,organization_id:x.organization_id,icon:x.icon??null,app_name:x.app_name??null,app_id:x.app_id??null,connection_headers:x.connection_headers??null,oauth_config:null,configuration_state:x.configuration_state??null,metadata:null,tools:null,bindings:null,status:"inactive"});const K=new URL(`/mcp/${L}`,window.location.origin),J=await Ue({url:K.href,token:null});J.supportsOAuth&&!J.isAuthenticated&&await O(L)}finally{b(!1)}}}),t.jsx(ss,{connection:s})]}),t.jsx("div",{className:"@3xl:col-span-2",children:t.jsx(is,{tools:r,prompts:o,resources:c,connectionId:e,org:n})})]})})]})})]})}function hs(){const s=$.c(38);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/settings/connections/$appSlug"},s[0]=e):e=s[0];const n=Q(e);let i;s[1]===Symbol.for("react.memo_cache_sentinel")?(i={from:"/shell/$org/settings/connections/$appSlug"},s[1]=i):i=s[1];const{appSlug:r,org:o}=Me(i),{org:c}=te(),d=ye();let m;s[2]!==r?(m={slug:r},s[2]=r,s[3]=m):m=s[3];const l=Ze(m),u=l[0]??null,p=u?.id??"",a=p||null;let f;s[4]!==c.id||s[5]!==a?(f={connectionId:a,orgId:c.id},s[4]=c.id,s[5]=a,s[6]=f):f=s[6];const h=ie(f);let b;s[7]!==h?(b={client:h},s[7]=h,s[8]=b):b=s[8];const{data:j}=tt(b);let v;if(s[9]!==u?.tools||s[10]!==p||s[11]!==l||s[12]!==j){const D=j?j.tools.map(ys):(u?.tools??[]).map(Ns);e:{if(l.length<=1){v=D;break e}const z=new Set,x=[],C=vs;for(const A of l){const W=A.id===p?D:C(A.tools);for(const L of W)z.has(L.name)||(z.add(L.name),x.push(L))}v=x.length>0?x:D}s[9]=u?.tools,s[10]=p,s[11]=l,s[12]=j,s[13]=v}else v=s[13];const S=v;let I;s[14]!==h?(I={client:h},s[14]=h,s[15]=I):I=s[15];const{data:N}=at(I);let w;s[16]!==h?(w={client:h},s[16]=h,s[17]=w):w=s[17];const{data:k}=nt(w);let _;s[18]!==N?.prompts?(_=N?.prompts??[],s[18]=N?.prompts,s[19]=_):_=s[19];let T;s[20]!==_?(T=_.map(js),s[20]=_,s[21]=T):T=s[21];const y=T;let g;s[22]!==k?.resources?(g=k?.resources??[],s[22]=k?.resources,s[23]=g):g=s[23];let P;s[24]!==g?(P=g.map(gs),s[24]=g,s[25]=P):P=s[25];const M=P;if(!u){let D;return s[26]!==n||s[27]!==o?(D=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(ve,{title:"Connection not found",description:"This connection may have been deleted or you may not have access.",actions:t.jsx(H,{variant:"outline",onClick:()=>n({to:"/$org/settings/connections",params:{org:o}}),children:"Back to connections"})})}),s[26]=n,s[27]=o,s[28]=D):D=s[28],D}let O;return s[29]!==d.update.isPending||s[30]!==S||s[31]!==u||s[32]!==p||s[33]!==o||s[34]!==y||s[35]!==M||s[36]!==l?(O=t.jsx(fs,{org:o,connection:u,connectionId:p,isUpdating:d.update.isPending,tools:S,prompts:y,resources:M,siblings:l}),s[29]=d.update.isPending,s[30]=S,s[31]=u,s[32]=p,s[33]=o,s[34]=y,s[35]=M,s[36]=l,s[37]=O):O=s[37],O}function gs(s){return{name:s.name,description:s.description,uri:s.uri}}function js(s){return{name:s.name,description:s.description}}function vs(s){return(s??[]).map(bs)}function bs(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema??{},outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Ns(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function ys(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function _s(){const s=$.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Oe,{children:t.jsx(G.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(ge,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(hs,{})})}),s[0]=e):e=s[0],e}function Ln(){const s=$.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(_s,{}),s[0]=e):e=s[0],e}export{Ln as default};
@@ -1 +1 @@
1
- import{v as R,aI as V,aJ as A,y as a,aK as j,_ as z,e as K,j as u,B as C}from"./index-CNolBSVE.js";import{I as H}from"./input-B8j75XZ_.js";import{s as L}from"./Plus-Bmk1thjl.js";import{s as W}from"./Trash01-BHBjIGXE.js";const q=R({key:a().min(1,"Key is required"),value:a()}),M=R({title:a().min(1,"Name is required"),description:a().nullable().optional(),icon:a().nullable().optional(),ui_type:z(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:a().optional(),connection_token:a().nullable().optional(),npx_package:a().optional(),stdio_command:a().optional(),stdio_args:a().optional(),stdio_cwd:a().optional(),env_vars:j(q).optional(),configuration_scopes:j(a()).nullable().optional(),configuration_state:V(a(),A()).nullable().optional()}).refine(n=>n.ui_type==="NPX"?!!n.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(n=>n.ui_type==="STDIO"?!!n.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(n=>n.ui_type==="HTTP"||n.ui_type==="SSE"||n.ui_type==="Websocket"?!!n.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]});function $(n){const e=n.toLowerCase();return!!(["secret","password","passwd","credential","private","token","bearer","jwt","refresh","session","api_key","apikey","auth_key","access_key","secret_key","private_key","service_key","encryption_key","signing_key","license_key","auth","oauth","client_secret","app_secret","webhook","signing","signature","database_url","db_url","mongo_uri","redis_url","postgres_url","mysql_url","connection_string","dsn","service_role","anon_key","supabase_key","openai","anthropic","stripe","twilio","sendgrid","resend","firebase","sentry","datadog","newrelic","new_relic","pplx","replicate","pinecone","cohere","hugging","hf_token","gh_token","npm_token","certificate","cert","ssl","tls","encryption","salt","hash","hmac","personal_access","github_pat","gitlab_pat","bitbucket_pat"].some(s=>e.includes(s))||["sk_","rk_","whsec_","pk_live","sk_live"].some(s=>e.startsWith(s))||["_key","_secret","_token","_password","_auth","_pat"].some(s=>e.endsWith(s)))}function X(n){const e=K.c(34),{value:t,onChange:r,keyPlaceholder:o,valuePlaceholder:s,className:v}=n,m=o===void 0?"VARIABLE_NAME":o,_=s===void 0?"value...":s;let b;e[0]!==r||e[1]!==t?(b=()=>{r([...t,{key:"",value:""}])},e[0]=r,e[1]=t,e[2]=b):b=e[2];const S=b;let x;e[3]!==r||e[4]!==t?(x=l=>{r(t.filter((p,i)=>i!==l))},e[3]=r,e[4]=t,e[5]=x):x=e[5];const g=x;let P;e[6]!==r||e[7]!==t?(P=(l,p)=>{const i=[...t],c=i[l];c&&(i[l]={key:p,value:c.value},r(i))},e[6]=r,e[7]=t,e[8]=P):P=e[8];const y=P;let w;e[9]!==r||e[10]!==t?(w=(l,p)=>{const i=[...t],c=i[l];c&&(i[l]={key:c.key,value:p},r(i))},e[9]=r,e[10]=t,e[11]=w):w=e[11];const k=w;let d;if(e[12]!==y||e[13]!==g||e[14]!==k||e[15]!==m||e[16]!==t||e[17]!==_){let l;e[19]!==y||e[20]!==g||e[21]!==k||e[22]!==m||e[23]!==_?(l=(p,i)=>u.jsxs("div",{className:"flex gap-2 items-center",children:[u.jsx(H,{placeholder:m,value:p.key,onChange:c=>y(i,c.target.value),className:"h-10 rounded-lg flex-1 font-mono text-sm"}),u.jsx(H,{type:$(p.key)?"password":"text",placeholder:_,value:p.value,onChange:c=>k(i,c.target.value),className:"h-10 rounded-lg flex-1"}),u.jsx(C,{type:"button",variant:"ghost",size:"icon",className:"h-10 w-10 shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>g(i),children:u.jsx(W,{size:16})})]},i),e[19]=y,e[20]=g,e[21]=k,e[22]=m,e[23]=_,e[24]=l):l=e[24],d=t.map(l),e[12]=y,e[13]=g,e[14]=k,e[15]=m,e[16]=t,e[17]=_,e[18]=d}else d=e[18];let T;e[25]===Symbol.for("react.memo_cache_sentinel")?(T=u.jsx(L,{size:16,className:"mr-1"}),e[25]=T):T=e[25];let f;e[26]!==S?(f=u.jsxs(C,{type:"button",variant:"outline",size:"sm",className:"w-full h-9 text-muted-foreground",onClick:S,children:[T,"Add Environment Variable"]}),e[26]=S,e[27]=f):f=e[27];let h;e[28]!==d||e[29]!==f?(h=u.jsxs("div",{className:"flex flex-col gap-2",children:[d,f]}),e[28]=d,e[29]=f,e[30]=h):h=e[30];let E;return e[31]!==v||e[32]!==h?(E=u.jsx("div",{className:v,children:h}),e[31]=v,e[32]=h,e[33]=E):E=e[33],E}function I(n){const e={};for(const{key:t,value:r}of n)t.trim()&&(e[t.trim()]=r);return e}function D(n){return n?Object.entries(n).map(([e,t])=>({key:e,value:t})):[]}function N(n){const e=n.trim();if(!e)return"";try{const t=new URL(e),r=t.pathname.length>1?t.pathname.replace(/\/+$/,""):t.pathname;return`${t.origin}${r}`}catch{return e.replace(/\/+$/,"")}}function F(n){const e=n.trim().split(/\s+/).filter(Boolean);if(e.length<2)return null;const t=e[0]?.toLowerCase();if(t!=="npx"&&t!=="bunx")return null;const o=e.slice(1).find(s=>!s.startsWith("-"));return o?{packageName:o}:null}function Y(n){const{uiType:e}=n,t=N(n.connectionUrl??"");if((e==="HTTP"||e==="SSE"||e==="Websocket")&&t===N("https://api.githubcopilot.com/mcp/"))return{id:"github",title:"GitHub",description:"GitHub Copilot MCP",token:{label:"GitHub PAT",placeholder:"github_pat_…",helperText:"Paste a GitHub Personal Access Token (PAT)"}};const r=(n.npxPackage??"").trim();return e==="NPX"&&r==="@perplexity-ai/mcp-server"?{id:"perplexity",title:"Perplexity",description:"Perplexity MCP Server",envVarKeys:["PERPLEXITY_API_KEY"]}:null}function J(n){if(n.registryItems.length===0||n.uiType!=="HTTP"&&n.uiType!=="SSE"&&n.uiType!=="Websocket")return null;const e=N(n.connectionUrl??"");if(!e)return null;const t=n.registryItems.find(s=>(s.server?.remotes??[]).some(m=>N(m.url??"")===e));if(!t)return null;const r=t.title||t.name||t.server?.title||t.server?.name||"",o=t.server?.description||t.description||t.summary||null;return r?{id:"registry",title:r,description:o}:null}function Q(n,e){const t={command:"npx",args:["-y",n]},r=I(e);return Object.keys(r).length>0&&(t.envVars=r),t}function Z(n,e,t,r){const o={command:n};e.trim()&&(o.args=e.trim().split(/\s+/)),t?.trim()&&(o.cwd=t.trim());const s=I(r);return Object.keys(s).length>0&&(o.envVars=s),o}export{X as E,J as a,Q as b,M as c,Z as d,Y as i,F as p,D as r};
1
+ import{v as R,aI as V,aJ as A,y as a,aK as j,_ as z,e as K,j as u,B as C}from"./index-D34n6J5J.js";import{I as H}from"./input-urtyHxks.js";import{s as L}from"./Plus-oXFwCrYz.js";import{s as W}from"./Trash01-C6bAXG6g.js";const q=R({key:a().min(1,"Key is required"),value:a()}),M=R({title:a().min(1,"Name is required"),description:a().nullable().optional(),icon:a().nullable().optional(),ui_type:z(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:a().optional(),connection_token:a().nullable().optional(),npx_package:a().optional(),stdio_command:a().optional(),stdio_args:a().optional(),stdio_cwd:a().optional(),env_vars:j(q).optional(),configuration_scopes:j(a()).nullable().optional(),configuration_state:V(a(),A()).nullable().optional()}).refine(n=>n.ui_type==="NPX"?!!n.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(n=>n.ui_type==="STDIO"?!!n.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(n=>n.ui_type==="HTTP"||n.ui_type==="SSE"||n.ui_type==="Websocket"?!!n.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]});function $(n){const e=n.toLowerCase();return!!(["secret","password","passwd","credential","private","token","bearer","jwt","refresh","session","api_key","apikey","auth_key","access_key","secret_key","private_key","service_key","encryption_key","signing_key","license_key","auth","oauth","client_secret","app_secret","webhook","signing","signature","database_url","db_url","mongo_uri","redis_url","postgres_url","mysql_url","connection_string","dsn","service_role","anon_key","supabase_key","openai","anthropic","stripe","twilio","sendgrid","resend","firebase","sentry","datadog","newrelic","new_relic","pplx","replicate","pinecone","cohere","hugging","hf_token","gh_token","npm_token","certificate","cert","ssl","tls","encryption","salt","hash","hmac","personal_access","github_pat","gitlab_pat","bitbucket_pat"].some(s=>e.includes(s))||["sk_","rk_","whsec_","pk_live","sk_live"].some(s=>e.startsWith(s))||["_key","_secret","_token","_password","_auth","_pat"].some(s=>e.endsWith(s)))}function X(n){const e=K.c(34),{value:t,onChange:r,keyPlaceholder:o,valuePlaceholder:s,className:v}=n,m=o===void 0?"VARIABLE_NAME":o,_=s===void 0?"value...":s;let b;e[0]!==r||e[1]!==t?(b=()=>{r([...t,{key:"",value:""}])},e[0]=r,e[1]=t,e[2]=b):b=e[2];const S=b;let x;e[3]!==r||e[4]!==t?(x=l=>{r(t.filter((p,i)=>i!==l))},e[3]=r,e[4]=t,e[5]=x):x=e[5];const g=x;let P;e[6]!==r||e[7]!==t?(P=(l,p)=>{const i=[...t],c=i[l];c&&(i[l]={key:p,value:c.value},r(i))},e[6]=r,e[7]=t,e[8]=P):P=e[8];const y=P;let w;e[9]!==r||e[10]!==t?(w=(l,p)=>{const i=[...t],c=i[l];c&&(i[l]={key:c.key,value:p},r(i))},e[9]=r,e[10]=t,e[11]=w):w=e[11];const k=w;let d;if(e[12]!==y||e[13]!==g||e[14]!==k||e[15]!==m||e[16]!==t||e[17]!==_){let l;e[19]!==y||e[20]!==g||e[21]!==k||e[22]!==m||e[23]!==_?(l=(p,i)=>u.jsxs("div",{className:"flex gap-2 items-center",children:[u.jsx(H,{placeholder:m,value:p.key,onChange:c=>y(i,c.target.value),className:"h-10 rounded-lg flex-1 font-mono text-sm"}),u.jsx(H,{type:$(p.key)?"password":"text",placeholder:_,value:p.value,onChange:c=>k(i,c.target.value),className:"h-10 rounded-lg flex-1"}),u.jsx(C,{type:"button",variant:"ghost",size:"icon",className:"h-10 w-10 shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>g(i),children:u.jsx(W,{size:16})})]},i),e[19]=y,e[20]=g,e[21]=k,e[22]=m,e[23]=_,e[24]=l):l=e[24],d=t.map(l),e[12]=y,e[13]=g,e[14]=k,e[15]=m,e[16]=t,e[17]=_,e[18]=d}else d=e[18];let T;e[25]===Symbol.for("react.memo_cache_sentinel")?(T=u.jsx(L,{size:16,className:"mr-1"}),e[25]=T):T=e[25];let f;e[26]!==S?(f=u.jsxs(C,{type:"button",variant:"outline",size:"sm",className:"w-full h-9 text-muted-foreground",onClick:S,children:[T,"Add Environment Variable"]}),e[26]=S,e[27]=f):f=e[27];let h;e[28]!==d||e[29]!==f?(h=u.jsxs("div",{className:"flex flex-col gap-2",children:[d,f]}),e[28]=d,e[29]=f,e[30]=h):h=e[30];let E;return e[31]!==v||e[32]!==h?(E=u.jsx("div",{className:v,children:h}),e[31]=v,e[32]=h,e[33]=E):E=e[33],E}function I(n){const e={};for(const{key:t,value:r}of n)t.trim()&&(e[t.trim()]=r);return e}function D(n){return n?Object.entries(n).map(([e,t])=>({key:e,value:t})):[]}function N(n){const e=n.trim();if(!e)return"";try{const t=new URL(e),r=t.pathname.length>1?t.pathname.replace(/\/+$/,""):t.pathname;return`${t.origin}${r}`}catch{return e.replace(/\/+$/,"")}}function F(n){const e=n.trim().split(/\s+/).filter(Boolean);if(e.length<2)return null;const t=e[0]?.toLowerCase();if(t!=="npx"&&t!=="bunx")return null;const o=e.slice(1).find(s=>!s.startsWith("-"));return o?{packageName:o}:null}function Y(n){const{uiType:e}=n,t=N(n.connectionUrl??"");if((e==="HTTP"||e==="SSE"||e==="Websocket")&&t===N("https://api.githubcopilot.com/mcp/"))return{id:"github",title:"GitHub",description:"GitHub Copilot MCP",token:{label:"GitHub PAT",placeholder:"github_pat_…",helperText:"Paste a GitHub Personal Access Token (PAT)"}};const r=(n.npxPackage??"").trim();return e==="NPX"&&r==="@perplexity-ai/mcp-server"?{id:"perplexity",title:"Perplexity",description:"Perplexity MCP Server",envVarKeys:["PERPLEXITY_API_KEY"]}:null}function J(n){if(n.registryItems.length===0||n.uiType!=="HTTP"&&n.uiType!=="SSE"&&n.uiType!=="Websocket")return null;const e=N(n.connectionUrl??"");if(!e)return null;const t=n.registryItems.find(s=>(s.server?.remotes??[]).some(m=>N(m.url??"")===e));if(!t)return null;const r=t.title||t.name||t.server?.title||t.server?.name||"",o=t.server?.description||t.description||t.summary||null;return r?{id:"registry",title:r,description:o}:null}function Q(n,e){const t={command:"npx",args:["-y",n]},r=I(e);return Object.keys(r).length>0&&(t.envVars=r),t}function Z(n,e,t,r){const o={command:n};e.trim()&&(o.args=e.trim().split(/\s+/)),t?.trim()&&(o.cwd=t.trim());const s=I(r);return Object.keys(s).length>0&&(o.envVars=s),o}export{X as E,J as a,Q as b,M as c,Z as d,Y as i,F as p,D as r};
@@ -0,0 +1 @@
1
+ import{e as ie,j as t,E as Ye,r as W,l as ce,s as _e,f as Se,d as Je,b as be,u as Ze,a2 as et,a3 as tt,x as nt,w as st,B,t as te,o as ot,c as re,z as G,a0 as it,a1 as lt,K as ct}from"./index-D34n6J5J.js";import{g as rt}from"./constants-v4RUVkEN.js";import{C as at}from"./collection-display-button-BgYKhoGQ.js";import{S as dt}from"./search-input-dmuYGYsk.js";import{C as mt}from"./collection-tabs-CU6MCzSn.js";import{u as ut,a as Ne,g as pt,C as fe}from"./connection-card-DBz-rrLk.js";import{E as ht}from"./empty-state-BdQTFnZA.js";import{I as xt}from"./integration-icon-Cdkk9YPE.js";import{P as de}from"./index-zDq2Zqio.js";import{u as gt,D as ft}from"./use-delete-connection-BZmW9ZAz.js";import{u as jt}from"./use-infinite-scroll-CWlV3gJA.js";import{u as yt}from"./use-list-state-BJZWeXjY.js";import{g as ke,a as Ct,e as vt}from"./extract-connection-data-CfXvFcGA.js";import{g as ue}from"./connection-slug-eyAPH6o3.js";import{c as De,d as Ae,b as we,A as Te,e as Ie,g as Pe,a as Le,f as Oe}from"./alert-dialog-CicrCOay.js";import{C as $e}from"./checkbox-DznLgPgR.js";import{d as Ee,c as ze,a as Fe,D as Me,e as Ve,b as Be}from"./dialog-C4lREl-t.js";import{c as _t,b as St,D as bt,a as Nt,d as kt,e as Dt,f as At}from"./drawer-BTCEaGGQ.js";import{u as wt}from"./use-mobile-CxvYCzu9.js";import{c as Ue,d as Re,e as He,D as pe}from"./dropdown-menu-v2GifVOh.js";import{a as Q,b as Y,c as J,d as Z,e as ee,F as Ce}from"./form-D7DN8UcB.js";import{I as oe}from"./input-urtyHxks.js";import{a as Tt,c as It,d as Pt,S as Lt,b as le}from"./select-CePxsPeP.js";import{T as Ot}from"./textarea-Ie4QUdo5.js";import{a as Ke,u as $t}from"./use-connection-Cif-LY0f.js";import{u as Et,S as zt}from"./constants-DDHDU3PV.js";import{u as Ft}from"./use-virtual-mcp-0vHwLInn.js";import{b as Mt,S as Vt}from"./agent-icon-CyE6nkC1.js";import{n as he}from"./Container-B1nHZdmn.js";import{i as We}from"./DotsVertical-Bp2tW8JI.js";import{s as Xe}from"./RefreshCcw01-B10mKiE2.js";import{s as ge}from"./Star01-_IJK5Yjt.js";import{s as qe}from"./Plus-oXFwCrYz.js";import{s as Ge}from"./Trash01-C6bAXG6g.js";import{s as Qe}from"./XClose-BbIo6xHe.js";import{i as me,a as ve,E as Bt,c as Ut,p as Rt,b as Ht,d as Kt}from"./connection-form-helpers-CBEV0IXi.js";import"./collections-DHmXATua.js";import"./ChevronDown-DGnjAtqs.js";import"./view-mode-toggle-D5CGwPOj.js";import"./badge-s_TAXGUN.js";import"./SearchMd-BRJBvWf4.js";import"./use-registry-connections-DR_etJ2H.js";import"./use-organization-settings-BD9CIHH5.js";import"./useInfiniteQuery-B4w-6TrV.js";import"./infiniteQueryObserver-1_M-sq16.js";import"./card-CaekC2K0.js";import"./X-i9zBn6Hn.js";import"./use-view-mode-CZPzVaxj.js";import"./ChevronRight-DV9No7GF.js";import"./label-Bt4h_QUk.js";import"./ChevronUp-BkSgkwhO.js";import"./use-collections-DRlHpXQL.js";import"./AlertCircle-DTmaHldD.js";import"./Tool01-CKowkGsd.js";import"./ArrowNarrowLeft-DlPeFc4v.js";import"./XCircle-C1sJYG9R.js";import"./ZapSquare-DT93lGV4.js";import"./Users03-DqYvPeZM.js";import"./CheckCircle-DJ3lme5R.js";import"./Palette-CI8n49a8.js";import"./LinkExternal01-BBbCPDtX.js";import"./Lock01-DpPIS3K7.js";import"./Sun-QqE1VnS_.js";import"./Play-DKFUTU3G.js";import"./Settings02-Dm9dFDqk.js";import"./Shield01-BZJVBd5S.js";import"./User01-C2-anwoO.js";import"./Zap-KmbRMccM.js";function Wt(y){const e=ie.c(51),{group:n,onOpen:g,selectionMode:m,selectedIds:d,onToggleSelect:i}=y;let v;if(e[0]!==n.connections||e[1]!==d){let j;e[3]!==d?(j=U=>d.has(U.id),e[3]=d,e[4]=j):j=e[4],v=n.connections.every(j),e[0]=n.connections,e[1]=d,e[2]=v}else v=e[2];const h=v;let _;if(e[5]!==n.connections||e[6]!==d){let j;e[8]!==d?(j=U=>d.has(U.id),e[8]=d,e[9]=j):j=e[9],_=n.connections.some(j),e[5]=n.connections,e[6]=d,e[7]=_}else _=e[7];const u=_,S=`${n.connections.length} instances`;let x;e[10]!==n.icon||e[11]!==n.title||e[12]!==S?(x={title:n.title,icon:n.icon,description:S},e[10]=n.icon,e[11]=n.title,e[12]=S,e[13]=x):x=e[13];let a;e[14]!==h||e[15]!==n.connections||e[16]!==g||e[17]!==i||e[18]!==d||e[19]!==m?(a=()=>m?(()=>{for(const j of n.connections)h?d.has(j.id)&&i(j.id):d.has(j.id)||i(j.id)})():g(),e[14]=h,e[15]=n.connections,e[16]=g,e[17]=i,e[18]=d,e[19]=m,e[20]=a):a=e[20];const p=m&&h&&"ring-2 ring-primary",f=m&&u&&!h&&"ring-1 ring-primary/50";let k;e[21]!==p||e[22]!==f?(k=re(p,f),e[21]=p,e[22]=f,e[23]=k):k=e[23];let A;e[24]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(he,{}),e[24]=A):A=e[24];let N;e[25]!==h||e[26]!==n.connections||e[27]!==i||e[28]!==d||e[29]!==m||e[30]!==u?(N=m?t.jsx($e,{checked:h?!0:u?"indeterminate":!1,onCheckedChange:()=>{for(const j of n.connections)h?d.has(j.id)&&i(j.id):d.has(j.id)||i(j.id)}}):t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}),t.jsxs("span",{className:"text-xs text-muted-foreground font-normal tabular-nums",children:["x",n.connections.length]})]}),e[25]=h,e[26]=n.connections,e[27]=i,e[28]=d,e[29]=m,e[30]=u,e[31]=N):N=e[31];const I=m?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100";let s;e[32]!==I?(s=re("overflow-hidden transition-all duration-150 ease-out",I),e[32]=I,e[33]=s):s=e[33];let D;e[34]===Symbol.for("react.memo_cache_sentinel")?(D=t.jsx(Re,{asChild:!0,children:t.jsx(B,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:qt,children:t.jsx(We,{size:20})})}),e[34]=D):D=e[34];let M;e[35]!==g?(M=j=>{j.stopPropagation(),g()},e[35]=g,e[36]=M):M=e[36];let $;e[37]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx(Xe,{size:16}),e[37]=$):$=e[37];let P;e[38]!==M?(P=t.jsxs(Ue,{children:[D,t.jsx(He,{align:"end",onClick:Xt,children:t.jsxs(pe,{onClick:M,children:[$,"Open"]})})]}),e[38]=M,e[39]=P):P=e[39];let T;e[40]!==s||e[41]!==P?(T=t.jsx("div",{className:s,children:P}),e[40]=s,e[41]=P,e[42]=T):T=e[42];let z;e[43]!==N||e[44]!==T?(z=t.jsxs("div",{className:"flex items-center gap-1",children:[N,T]}),e[43]=N,e[44]=T,e[45]=z):z=e[45];let F;return e[46]!==z||e[47]!==x||e[48]!==a||e[49]!==k?(F=t.jsx(t.Fragment,{children:t.jsx(fe,{connection:x,onClick:a,className:k,fallbackIcon:A,headerActionsAlwaysVisible:!0,headerActions:z})}),e[46]=z,e[47]=x,e[48]=a,e[49]=k,e[50]=F):F=e[50],F}function Xt(y){return y.stopPropagation()}function qt(y){return y.stopPropagation()}function Gt(y){const e=ie.c(28),{count:n,total:g,onSelectAll:m,onDeselectAll:d,onDelete:i,onAddToAgent:v,onToggleStatus:h,onCancel:_}=y;if(n===0)return null;let u;e[0]!==n?(u=t.jsxs("div",{className:"text-xs text-muted-foreground pr-1 tabular-nums",children:[n," selected"]}),e[0]=n,e[1]=u):u=e[1];let S;e[2]!==n||e[3]!==d||e[4]!==m||e[5]!==g?(S=n<g?t.jsxs(B,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:m,children:["Select all (",g,")"]}):t.jsx(B,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:d,children:"Clear selection"}),e[2]=n,e[3]=d,e[4]=m,e[5]=g,e[6]=S):S=e[6];let x;e[7]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(qe,{size:13}),e[7]=x):x=e[7];let a;e[8]!==v?(a=t.jsxs(B,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:v,children:[x,"Add to Agent"]}),e[8]=v,e[9]=a):a=e[9];let p;e[10]!==h?(p=t.jsx(B,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>h("active"),children:"Enable"}),e[10]=h,e[11]=p):p=e[11];let f;e[12]!==h?(f=t.jsx(B,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>h("inactive"),children:"Disable"}),e[12]=h,e[13]=f):f=e[13];let k;e[14]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(Ge,{size:13}),e[14]=k):k=e[14];let A;e[15]!==i?(A=t.jsxs(B,{variant:"destructive",size:"sm",className:"h-7 text-xs px-2",onClick:i,children:[k,"Delete"]}),e[15]=i,e[16]=A):A=e[16];let N;e[17]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(Qe,{size:13}),e[17]=N):N=e[17];let I;e[18]!==_?(I=t.jsx(B,{variant:"ghost",size:"sm",className:"h-7 text-xs px-2",onClick:_,children:N}),e[18]=_,e[19]=I):I=e[19];let s;return e[20]!==u||e[21]!==I||e[22]!==S||e[23]!==a||e[24]!==p||e[25]!==f||e[26]!==A?(s=t.jsx("div",{className:"fixed bottom-4 left-1/2 z-50 -translate-x-1/2",children:t.jsxs("div",{className:"rounded-xl border border-border bg-background/95 shadow-lg backdrop-blur px-3 py-2 flex items-center gap-2",children:[u,S,a,p,f,A,I]})}),e[20]=u,e[21]=I,e[22]=S,e[23]=a,e[24]=p,e[25]=f,e[26]=A,e[27]=s):s=e[27],s}function Qt(y){const e=ie.c(25),{open:n,onOpenChange:g,agents:m,onConfirm:d}=y,[i,v]=W.useState(null);let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsxs(Fe,{children:[t.jsx(Me,{children:"Add to Agent"}),t.jsx(Ve,{children:"Select an agent to add the selected connections to."})]}),e[0]=h):h=e[0];let _;e[1]!==m||e[2]!==i?(_=m.length===0?t.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"No agents found"}):m.map(N=>t.jsxs("button",{type:"button",onClick:()=>v(N.id),className:re("flex items-center gap-3 w-full rounded-md px-3 py-2 text-left transition-colors",i===N.id?"bg-primary/10 ring-1 ring-primary":"hover:bg-muted/50"),children:[t.jsx(xt,{icon:N.icon,name:N.title,size:"sm",className:"shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:N.title}),N.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:N.description})]})]},N.id)),e[1]=m,e[2]=i,e[3]=_):_=e[3];let u;e[4]!==_?(u=t.jsx("div",{className:"max-h-60 overflow-auto py-2 space-y-1",children:_}),e[4]=_,e[5]=u):u=e[5];let S;e[6]!==g?(S=t.jsx(B,{variant:"outline",onClick:()=>g(!1),children:"Cancel"}),e[6]=g,e[7]=S):S=e[7];const x=!i;let a;e[8]!==d||e[9]!==g||e[10]!==i?(a=()=>{i&&(d(i),g(!1),v(null))},e[8]=d,e[9]=g,e[10]=i,e[11]=a):a=e[11];let p;e[12]!==x||e[13]!==a?(p=t.jsx(B,{disabled:x,onClick:a,children:"Add"}),e[12]=x,e[13]=a,e[14]=p):p=e[14];let f;e[15]!==S||e[16]!==p?(f=t.jsxs(Be,{children:[S,p]}),e[15]=S,e[16]=p,e[17]=f):f=e[17];let k;e[18]!==u||e[19]!==f?(k=t.jsxs(ze,{className:"sm:max-w-[400px]",children:[h,u,f]}),e[18]=u,e[19]=f,e[20]=k):k=e[20];let A;return e[21]!==g||e[22]!==n||e[23]!==k?(A=t.jsx(Ee,{open:n,onOpenChange:g,children:k}),e[21]=g,e[22]=n,e[23]=k,e[24]=A):A=e[24],A}function Yt(y){const e=ie.c(20),{open:n,onOpenChange:g,count:m,onConfirm:d}=y,i=m!==1?"s":"";let v;e[0]!==m||e[1]!==i?(v=t.jsxs(De,{children:["Delete ",m," connection",i,"?"]}),e[0]=m,e[1]=i,e[2]=v):v=e[2];const h=m!==1?"s":"";let _;e[3]!==h?(_=t.jsxs(Ae,{children:["This will permanently delete the selected connection",h,". This action cannot be undone."]}),e[3]=h,e[4]=_):_=e[4];let u;e[5]!==v||e[6]!==_?(u=t.jsxs(we,{children:[v,_]}),e[5]=v,e[6]=_,e[7]=u):u=e[7];let S;e[8]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx(Te,{children:"Cancel"}),e[8]=S):S=e[8];const x=m!==1?"s":"";let a;e[9]!==m||e[10]!==d||e[11]!==x?(a=t.jsxs(Ie,{children:[S,t.jsxs(Pe,{onClick:d,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:["Delete ",m," connection",x]})]}),e[9]=m,e[10]=d,e[11]=x,e[12]=a):a=e[12];let p;e[13]!==u||e[14]!==a?(p=t.jsxs(Le,{children:[u,a]}),e[13]=u,e[14]=a,e[15]=p):p=e[15];let f;return e[16]!==g||e[17]!==n||e[18]!==p?(f=t.jsx(Oe,{open:n,onOpenChange:g,children:p}),e[16]=g,e[17]=n,e[18]=p,e[19]=f):f=e[19],f}function Jt(y){return y._registryId?.includes("community-registry")===!0}function Zt(y){const e=ie.c(56),{item:n,allConnections:g,connectedAppNames:m,connectingItemId:d,onNavigateConnected:i,onConnect:v}=y,[h,_]=W.useState(!1),[u,S]=W.useState(null);let x,a;e[0]!==m||e[1]!==n?(x=ke(n)??"",a=m.has(x),e[0]=m,e[1]=n,e[2]=x,e[3]=a):(x=e[2],a=e[3]);const p=a,f=n._meta?.["mcp.mesh"],k=f?.friendlyName||f?.friendly_name||n.server?.title||n.title||n.server?.name||n.name||n.id||"",A=n.server?.description||n.description||null;let N;e[4]!==n.server?.icons?.[0]?.src||e[5]!==n.server?.repository?(N=n.server?.icons?.[0]?.src||Ct(n.server?.repository)||null,e[4]=n.server?.icons?.[0]?.src,e[5]=n.server?.repository,e[6]=N):N=e[6];const I=N;let s;if(e[7]!==g||e[8]!==x){let b;e[10]!==x?(b=se=>se.connection_type!=="VIRTUAL"&&se.app_name===x,e[10]=x,e[11]=b):b=e[11],s=g.filter(b),e[7]=g,e[8]=x,e[9]=s}else s=e[9];const D=s;let M;e[12]!==n?(M=Jt(n),e[12]=n,e[13]=M):M=e[13];const $=M;let P,T;e[14]!==D||e[15]!==$||e[16]!==p||e[17]!==n||e[18]!==v||e[19]!==i?(P=()=>{if(p){const b=D[0];b&&i(b);return}T()},T=()=>{$?(S("connect"),_(!0)):v(n)},e[14]=D,e[15]=$,e[16]=p,e[17]=n,e[18]=v,e[19]=i,e[20]=P,e[21]=T):(P=e[20],T=e[21]);let z;e[22]!==n||e[23]!==v||e[24]!==u?(z=()=>{te("connections_community_warning_confirmed",{registry_item_id:n.id}),_(!1),u==="connect"&&v(n),S(null)},e[22]=n,e[23]=v,e[24]=u,e[25]=z):z=e[25];const F=z;let j;e[26]!==A||e[27]!==I||e[28]!==k?(j={title:k,description:A,icon:I},e[26]=A,e[27]=I,e[28]=k,e[29]=j):j=e[29];let U;e[30]===Symbol.for("react.memo_cache_sentinel")?(U=t.jsx(he,{}),e[30]=U):U=e[30];let R;e[31]!==$||e[32]!==n._sourceIcon?(R=$&&n._sourceIcon&&t.jsx("img",{src:n._sourceIcon,alt:"Community",className:"size-4 rounded-sm object-contain"}),e[31]=$,e[32]=n._sourceIcon,e[33]=R):R=e[33];let X;e[34]!==d||e[35]!==T||e[36]!==p||e[37]!==n.id?(X=p?t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}):t.jsx(B,{variant:"outline",size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",disabled:d!==null,onClick:b=>{b.stopPropagation(),T()},children:d===n.id?t.jsx(ce,{size:14,className:"animate-spin"}):"Connect"}),e[34]=d,e[35]=T,e[36]=p,e[37]=n.id,e[38]=X):X=e[38];let o;e[39]!==R||e[40]!==X?(o=t.jsxs("div",{className:"flex items-center gap-2",children:[R,X]}),e[39]=R,e[40]=X,e[41]=o):o=e[41];let C;e[42]!==P||e[43]!==o||e[44]!==j?(C=t.jsx(fe,{connection:j,fallbackIcon:U,onClick:P,headerActionsAlwaysVisible:!0,headerActions:o}),e[42]=P,e[43]=o,e[44]=j,e[45]=C):C=e[45];let V;e[46]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsxs(we,{children:[t.jsx(De,{children:"Community MCP Server"}),t.jsx(Ae,{children:"This MCP server is from the Community MCP Registry and is not maintained or verified by Deco. Community servers may have varying levels of quality, security, and reliability. Proceed with caution and review the server details before connecting."})]}),e[46]=V):V=e[46];let H;e[47]===Symbol.for("react.memo_cache_sentinel")?(H=t.jsx(Te,{children:"Cancel"}),e[47]=H):H=e[47];let E;e[48]!==F?(E=t.jsxs(Le,{children:[V,t.jsxs(Ie,{children:[H,t.jsx(Pe,{onClick:F,children:"Continue"})]})]}),e[48]=F,e[49]=E):E=e[49];let l;e[50]!==h||e[51]!==E?(l=t.jsx(Oe,{open:h,onOpenChange:_,children:E}),e[50]=h,e[51]=E,e[52]=l):l=e[52];let O;return e[53]!==C||e[54]!==l?(O=t.jsxs(t.Fragment,{children:[C,l]}),e[53]=C,e[54]=l,e[55]=O):O=e[55],O}function en({listState:y,activeTab:e,typeFilter:n,statusFilter:g,registryFilter:m,enabledRegistries:d}){const{org:i}=_e(),v=ot(),h=Se(),{data:_}=be.useSession(),u=Ke(),S=$t(y),x=gt(),[a,p]=W.useState(new Set),f=a.size>0,[k,A]=W.useState(!1),[N,I]=W.useState(!1),[s,D]=W.useState(null),M=Ft(),$=S.filter(c=>!(n!=="ALL"&&c.connection_type!==n||g!=="ALL"&&c.status!==g)),P=pt($),T=c=>{p(r=>{const w=new Set(r);return w.has(c)?w.delete(c):w.add(c),w})},z=()=>{p(new Set)},F=Ne(d,y.searchTerm),j=F.items,U=jt(F.loadMore,F.hasMore,F.isLoadingMore),R=new Set(S.filter(c=>c.app_name).map(c=>c.app_name)),X=m==="ALL"||d.some(c=>c.id===m)?m:"ALL",o=y.search.length>0,C=e==="all"||o?j.filter(c=>{if(X!=="ALL"&&c._registryId!==X)return!1;if(o){const r=ke(c);if(r&&R.has(r))return!1}return!0}):[],V=e==="connected"||o?P:[],H=async c=>{if(!(!i||!_?.user?.id)){te("connection_add_clicked",{action:"connect_new",registry_item_id:c.id,source:"connections_page"}),D(c.id);try{const r=vt(c,i.id,_.user.id,{remoteIndex:0}),w=r.connection_type==="STDIO",L=!!r.connection_url,q=w&&r.connection_headers&&typeof r.connection_headers=="object"&&"command"in r.connection_headers;if(!L&&!q){G.error("This MCP Server cannot be connected: no connection method available"),D(null);return}const{id:K}=await u.create.mutateAsync(r),je=new URL(`/mcp/${K}`,window.location.origin),ye=await it({url:je.href,token:null});if(ye.supportsOAuth&&!ye.isAuthenticated){const{token:ae,tokenInfo:ne,error:xe}=await lt({connectionId:K,scope:"offline_access"});if(xe||!ae){te("connection_oauth_failed",{connection_id:K,flow:"connections_page_connect",error:xe??"no_token"}),G.error(`Authentication failed: ${xe??"no token received"}`);return}else{if(te("connection_oauth_succeeded",{connection_id:K,flow:"connections_page_connect"}),ne)try{(await fetch(`/api/connections/${K}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:ne.accessToken,refreshToken:ne.refreshToken,expiresIn:ne.expiresIn,scope:ne.scope,clientId:ne.clientId,clientSecret:ne.clientSecret,tokenEndpoint:ne.tokenEndpoint})})).ok?await u.update.mutateAsync({id:K,data:{}}):await u.update.mutateAsync({id:K,data:{connection_token:ae}})}catch{await u.update.mutateAsync({id:K,data:{connection_token:ae}})}else await u.update.mutateAsync({id:K,data:{connection_token:ae}});await v.invalidateQueries({queryKey:ct.isMCPAuthenticated(je.href,null)}),G.success("Authentication successful")}}G.success("Connected successfully")}catch(r){G.error(`Failed to connect: ${r instanceof Error?r.message:String(r)}`)}finally{D(null)}}},E=Et({connectionId:zt,orgId:i.id}),l=()=>{v.invalidateQueries({predicate:c=>{const r=c.queryKey;return r[1]===i.id&&r[3]==="collection"&&r[4]==="CONNECTIONS"}})},O=async()=>{A(!1);const c=[...a];te("connections_bulk_delete",{count:c.length});let r=0;for(const w of c)try{(await E.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:w,force:!0}})).isError||r++}catch{}l(),G.success(`Deleted ${r} connection${r!==1?"s":""}`),z()},b=async c=>{const r=[...a];te("connections_bulk_status_toggled",{count:r.length,to_status:c});let w=0;for(const L of r)try{await u.update.mutateAsync({id:L,data:{status:c}}),w++}catch{}l(),G.success(`${c==="active"?"Enabled":"Disabled"} ${w} connection${w!==1?"s":""}`),z()},se=async c=>{const r=M.find(q=>q.id===c);if(!r||!E)return;te("connections_bulk_add_to_agent",{agent_id:c,count:a.size});const w=new Set(r.connections.map(q=>q.connection_id)),L=[...a].filter(q=>!w.has(q)).map(q=>({connection_id:q,selected_tools:null,selected_resources:null,selected_prompts:null}));if(L.length===0){G.info("All selected connections are already in that agent");return}try{await E.callTool({name:"COLLECTION_VIRTUAL_MCP_UPDATE",arguments:{id:c,data:{connections:[...r.connections,...L]}}}),v.invalidateQueries({predicate:q=>{const K=q.queryKey;return K[1]===i.id&&K[3]==="collection"&&K[4]==="VIRTUAL_MCP"}}),G.success(`Added ${L.length} connection${L.length!==1?"s":""} to "${r.title}"`),z()}catch{G.error("Failed to add connections to agent")}};return t.jsxs(t.Fragment,{children:[t.jsx(ft,{...x}),t.jsx(Yt,{open:k,onOpenChange:A,count:a.size,onConfirm:O}),t.jsx(Qt,{open:N,onOpenChange:I,agents:M,onConfirm:se}),F.isInitialLoading&&e==="all"?t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ce,{size:32,className:"animate-spin text-muted-foreground"})}):t.jsx("div",{children:(o?C.length===0&&$.length===0:e==="all"?C.length===0:$.length===0)?t.jsx(ht,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:"No Connections found",description:y.search?`No Connections match "${y.search}"`:"Create a connection to get started."}):t.jsxs("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:[V.map(c=>{if(c.type==="group")return t.jsx(Wt,{group:c,onOpen:()=>{h({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:c.key}})},selectionMode:f,selectedIds:a,onToggleSelect:T},c.key);const r=c.connection,w=a.has(r.id);return t.jsx(fe,{connection:r,fallbackIcon:t.jsx(he,{}),onClick:()=>f?T(r.id):h({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:ue(r)}}),className:re(w&&"ring-2 ring-primary bg-primary/5"),headerActionsAlwaysVisible:!0,headerActions:t.jsxs("div",{className:"flex items-center gap-1",children:[f?t.jsx($e,{checked:w,onCheckedChange:()=>T(r.id),onClick:L=>L.stopPropagation()}):t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}),t.jsx("div",{className:re("overflow-hidden transition-all duration-150 ease-out",f?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100"),children:t.jsxs(Ue,{children:[t.jsx(Re,{asChild:!0,children:t.jsx(B,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:L=>L.stopPropagation(),children:t.jsx(We,{size:20})})}),t.jsxs(He,{align:"end",onClick:L=>L.stopPropagation(),children:[t.jsxs(pe,{onClick:L=>{L.stopPropagation(),h({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:ue(r)}})},children:[t.jsx(Xe,{size:16}),"Open"]}),t.jsxs(pe,{onClick:L=>{L.stopPropagation(),T(r.id)},children:[t.jsx(Vt,{size:16}),"Select"]}),t.jsxs(pe,{variant:"destructive",onClick:L=>{L.stopPropagation(),x.requestDelete(r)},children:[t.jsx(Ge,{size:16}),"Delete"]})]})]})})]})},r.id)}),C.map(c=>t.jsx(Zt,{item:c,allConnections:S,connectedAppNames:R,connectingItemId:s,onNavigateConnected:r=>h({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:ue(r)}}),onConnect:H},`catalog-${c._registryId}:${c.id}`)),(e==="all"||o)&&d.length>0&&t.jsx("div",{ref:U,className:"col-span-full h-4"}),(e==="all"||o)&&F.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(ce,{size:24,className:"animate-spin text-muted-foreground"})})]})}),f&&t.jsx(Gt,{count:a.size,total:$.length,onSelectAll:()=>{p(new Set($.map(c=>c.id)))},onDeselectAll:()=>p(new Set),onDelete:()=>A(!0),onAddToAgent:()=>I(!0),onToggleStatus:b,onCancel:z})]})}function tn(){const{org:y}=_e(),e=Se(),n=Je({strict:!1}),{data:g}=be.useSession(),{stdioEnabled:m}=Ze(),d=wt(),i=yt({namespace:y.slug,resource:"connections"}),v=Ke(),[h,_]=et(tt.connectionsTab(y.slug),o=>n.tab==="all"||n.tab==="connected"?n.tab:o??"all"),[u,S]=W.useState("ALL"),[x,a]=W.useState("ALL"),[p,f]=W.useState("ALL"),k=ut(),N=Ne(k,i.searchTerm).items,I=i.search!==i.searchTerm,s=nt({resolver:st(Ut),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),D=s.watch("ui_type"),M=s.watch("connection_url"),$=s.watch("npx_package"),P=me({uiType:D,connectionUrl:M??"",npxPackage:$??""})??ve({uiType:D,connectionUrl:M??"",registryItems:N}),T=n.action==="create",z=()=>{te("connections_custom_dialog_opened",{source:"connections_page"}),e({to:"/$org/settings/connections",params:{org:y.slug},search:{action:"create"}})},F=()=>{e({to:"/$org/settings/connections",params:{org:y.slug},search:{}})},j=async o=>{let C,V=null,H=null,E=null;o.ui_type==="NPX"?(C="STDIO",V="",E=Ht(o.npx_package||"",o.env_vars||[])):o.ui_type==="STDIO"?(C="STDIO",V="",E=Kt(o.stdio_command||"",o.stdio_args||"",o.stdio_cwd,o.env_vars||[])):(C=o.ui_type,V=o.connection_url||"",H=o.connection_token||null);const l=rt("conn");te("connection_custom_created",{connection_type:C,ui_type:o.ui_type}),await v.create.mutateAsync({id:l,title:o.title,description:o.description||null,connection_type:C,connection_url:V,connection_token:H,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:g?.user?.id||"system",organization_id:y.id,icon:o.icon??null,app_name:null,app_id:null,connection_headers:E,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),F(),s.reset(),e({to:"/$org/settings/connections/$appSlug",params:{org:y.slug,appSlug:ue({app_name:null,connection_url:V,title:o.title,id:l})}})},U=o=>{o||(T&&F(),s.reset())},R=o=>{const C=o.trim();if(!C)return;const V=!!s.formState.dirtyFields.title,H=!!s.formState.dirtyFields.description,E=!!s.formState.dirtyFields.env_vars,l=b=>{if(b&&(!V&&!s.getValues("title").trim()&&b.title&&s.setValue("title",b.title,{shouldDirty:!1}),!H&&!(s.getValues("description")??"").trim()&&b.description&&s.setValue("description",b.description,{shouldDirty:!1}),!E&&b.envVarKeys?.length)){const se=s.getValues("env_vars")??[],c=new Set(se.map(w=>w.key)),r=b.envVarKeys.filter(w=>!c.has(w));r.length>0&&s.setValue("env_vars",[...se,...r.map(w=>({key:w,value:""}))],{shouldDirty:!0})}},O=Rt(C);if(O&&m){s.setValue("ui_type","NPX",{shouldDirty:!0}),s.setValue("npx_package",O.packageName,{shouldDirty:!0}),s.setValue("connection_url","",{shouldDirty:!0}),s.setValue("connection_token",null,{shouldDirty:!0}),l(me({uiType:"NPX",npxPackage:O.packageName}));return}if(C.startsWith("http://")||C.startsWith("https://")){const b=D==="HTTP"||D==="SSE"||D==="Websocket"?D:"HTTP";s.setValue("ui_type",b,{shouldDirty:!0}),s.setValue("connection_url",C,{shouldDirty:!0}),l(me({uiType:b,connectionUrl:C})??ve({uiType:b,connectionUrl:C,registryItems:N}));return}D==="NPX"&&l(me({uiType:"NPX",npxPackage:C}))},X=t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(B,{variant:"outline",onClick:z,children:[t.jsx(qe,{size:14,className:"sm:hidden"}),t.jsx("span",{className:"hidden sm:inline",children:"Custom Connection"})]})});return t.jsx(t.Fragment,{children:t.jsxs(de,{children:[(()=>{const o="Create Connection",C="Create a custom connection in your organization. Fill in the details below.",V=s.formState.isSubmitting?"Saving...":"Create Connection",H=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(Q,{control:s.control,name:"ui_type",render:({field:l})=>t.jsxs(Y,{children:[t.jsx(J,{children:"Type *"}),t.jsxs(Tt,{value:l.value,onValueChange:l.onChange,children:[t.jsx(Z,{children:t.jsx(It,{children:t.jsx(Pt,{})})}),t.jsxs(Lt,{children:[t.jsx(le,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ge,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(le,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ge,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(le,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ge,{className:"w-4 h-4"}),"Websocket"]})}),m&&t.jsxs(t.Fragment,{children:[t.jsx(le,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(he,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(le,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Mt,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(ee,{})]})}),D==="NPX"&&t.jsx(Q,{control:s.control,name:"npx_package",render:({field:l})=>t.jsxs(Y,{children:[t.jsx(J,{children:"NPM Package *"}),t.jsx(Z,{children:t.jsx(oe,{placeholder:"@perplexity-ai/mcp-server",...l,value:l.value??"",onPaste:O=>{const b=O.clipboardData.getData("text");b&&(O.preventDefault(),s.setValue("npx_package",b.trim(),{shouldDirty:!0}),R(b))},onBlur:O=>{R(O.target.value),l.onBlur()}})}),t.jsx(ee,{})]})}),D==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(Q,{control:s.control,name:"stdio_command",render:({field:l})=>t.jsxs(Y,{children:[t.jsx(J,{children:"Command *"}),t.jsx(Z,{children:t.jsx(oe,{placeholder:"node, bun, python...",...l,value:l.value??""})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:s.control,name:"stdio_args",render:({field:l})=>t.jsxs(Y,{children:[t.jsx(J,{children:"Arguments"}),t.jsx(Z,{children:t.jsx(oe,{placeholder:"arg1 arg2 --flag value",...l,value:l.value??""})}),t.jsx(ee,{})]})})]}),t.jsx(Q,{control:s.control,name:"stdio_cwd",render:({field:l})=>t.jsxs(Y,{children:[t.jsx(J,{children:"Working Directory"}),t.jsx(Z,{children:t.jsx(oe,{placeholder:"/path/to/project (optional)",...l,value:l.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),t.jsx(ee,{})]})})]}),(D==="NPX"||D==="STDIO")&&t.jsx(Q,{control:s.control,name:"env_vars",render:({field:l})=>t.jsxs(Y,{children:[t.jsx(J,{children:"Environment Variables"}),t.jsx(Z,{children:t.jsx(Bt,{value:l.value??[],onChange:l.onChange})}),t.jsx(ee,{})]})}),D!=="NPX"&&D!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(Q,{control:s.control,name:"connection_url",render:({field:l})=>t.jsxs(Y,{children:[t.jsx(J,{children:"URL *"}),t.jsx(Z,{children:t.jsx(oe,{placeholder:"https://example.com/mcp",...l,value:l.value??"",onPaste:O=>{const b=O.clipboardData.getData("text");b&&(O.preventDefault(),s.setValue("connection_url",b.trim(),{shouldDirty:!0}),R(b))},onBlur:O=>{R(O.target.value),l.onBlur()}})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:s.control,name:"connection_token",render:({field:l})=>t.jsxs(Y,{children:[t.jsx(J,{children:P?.token?.label??"Token (optional)"}),t.jsx(Z,{children:t.jsx(oe,{type:"password",placeholder:P?.token?.placeholder??"Bearer token or API key",...l,value:l.value??""})}),P?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[P.token.helperText,P.id==="github"&&t.jsxs(t.Fragment,{children:[" ","·"," ",t.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:"Open GitHub PAT settings"})]})]}),t.jsx(ee,{})]})})]}),t.jsx(Q,{control:s.control,name:"title",render:({field:l})=>t.jsxs(Y,{children:[t.jsx(J,{children:"Name *"}),t.jsx(Z,{children:t.jsx(oe,{placeholder:"My Connection",...l})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:s.control,name:"description",render:({field:l})=>t.jsxs(Y,{children:[t.jsx(J,{children:"Description"}),t.jsx(Z,{children:t.jsx(Ot,{placeholder:"A brief description of this connection",rows:3,...l,value:l.value??""})}),t.jsx(ee,{})]})})]}),E=T;return d?t.jsx(_t,{open:E,onOpenChange:U,children:t.jsxs(St,{className:"max-h-[90vh]",children:[t.jsx(bt,{className:"pb-2",children:t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[t.jsxs("div",{className:"flex-1 text-left",children:[t.jsx(Nt,{children:o}),t.jsx(kt,{className:"mt-1",children:C})]}),t.jsx(Dt,{asChild:!0,children:t.jsx(B,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1",children:t.jsx(Qe,{size:16})})})]})}),t.jsx(Ce,{...s,children:t.jsxs("form",{onSubmit:s.handleSubmit(j),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:H}),t.jsx(At,{children:t.jsx(B,{type:"submit",disabled:s.formState.isSubmitting,className:"w-full",children:V})})]})})]})}):t.jsx(Ee,{open:E,onOpenChange:U,children:t.jsxs(ze,{className:"sm:max-w-[525px]",children:[t.jsxs(Fe,{children:[t.jsx(Me,{children:o}),t.jsx(Ve,{children:C})]}),t.jsx(Ce,{...s,children:t.jsxs("form",{onSubmit:s.handleSubmit(j),children:[t.jsx("div",{className:"py-4",children:H}),t.jsxs(Be,{children:[t.jsx(B,{type:"button",variant:"outline",onClick:()=>U(!1),children:"Cancel"}),t.jsx(B,{type:"submit",disabled:s.formState.isSubmitting,className:"min-w-40",children:V})]})]})})]})})})(),t.jsx(de.Content,{children:t.jsx(de.Body,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(de.Title,{children:"Connections"}),t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(dt,{value:i.search,onChange:i.setSearch,placeholder:"Search for a connection",className:"w-full md:w-[375px]",onKeyDown:o=>{o.key==="Escape"&&(i.setSearch(""),o.target.blur())}}),t.jsx(at,{sortKey:i.sortKey,sortDirection:i.sortDirection,onSort:i.handleSort,sortOptions:[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"connection_type",label:"Type"},{id:"updated_by",label:"Updated by"},{id:"updated_at",label:"Updated"}],filters:[{label:"Type",value:u,onChange:o=>S(o||"ALL"),options:[{id:"ALL",label:"All"},{id:"HTTP",label:"HTTP"},{id:"SSE",label:"SSE"},{id:"Websocket",label:"WebSocket"},{id:"STDIO",label:"STDIO"}]},{label:"Status",value:x,onChange:o=>a(o||"ALL"),options:[{id:"ALL",label:"All"},{id:"active",label:"Active"},{id:"inactive",label:"Inactive"},{id:"error",label:"Error"}]},...k.length>1?[{label:"Registry",value:p,onChange:o=>f(o||"ALL"),options:[{id:"ALL",label:"All registries"},...k.map(o=>({id:o.id,label:o.id.includes("community-registry")?"Community MCP Registry":o.title}))]}]:[]]})]}),X]}),t.jsx(mt,{tabs:[{id:"all",label:"All"},{id:"connected",label:"Connected"}],activeTab:h,onTabChange:o=>{const C=o;C!==h&&te("connections_page_tab_changed",{to_tab:C}),_(C)}}),t.jsx(W.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ce,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx("div",{style:{opacity:I?.5:1,transition:I?"opacity 0.2s 0.2s linear":"opacity 0s 0s linear",pointerEvents:I?"none":"auto"},children:t.jsx(en,{listState:i,activeTab:h,typeFilter:u,statusFilter:x,registryFilter:p,enabledRegistries:k})})})]})})})]})})}function js(){const y=ie.c(1);let e;return y[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ye,{children:t.jsx(W.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ce,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(tn,{})})}),y[0]=e):e=y[0],e}export{js as default};
@@ -1,4 +1,4 @@
1
- import{cL as ce,cM as le,cN as ue,bv as de,cO as he,aO as p,aP as w,cP as fe,cQ as pe,cR as me,cS as A,cT as _e,cU as D,cV as ge,cW as q,cX as we,cY as F,cZ as Te,c_ as ye,c$ as ve,d0 as W,bb as ke,cC as Se,d1 as be,bq as ee,bD as Ce,bJ as Re,bH as Ie,d2 as Ee,d3 as qe,d4 as Pe,d5 as $,d6 as Me,d7 as Ae,bI as $e,bE as He,bF as Oe,bG as Ne,bC as xe,d8 as Le,d9 as De,da as Fe,bx as Ue,db as je,dc as Ve,cx as P,cy as H,cz as Q,dd as ze,bK as x,e as te,V as se}from"./index-CNolBSVE.js";const V={authConfig:()=>["authConfig"],threads:s=>["threads",s],virtualMcpThreads:(s,e)=>["threads",s,"virtual-mcp",e],thread:(s,e)=>["thread",s,e],threadMessages:(s,e)=>["thread-messages",s,e],messages:s=>["messages",s],organizations:()=>["organizations"],members:s=>[s,"members"],invitations:s=>[s,"invitations"],organizationRoles:s=>[s,"organization-roles"],connections:s=>[s,"connections"],connectionsByBinding:(s,e)=>[s,"connections",`binding:${e}`],connection:(s,e)=>[s,"connection",e],isMCPAuthenticated:(s,e)=>["is-mcp-authenticated",s,e],mcpTools:(s,e)=>["mcp","tools",s,e],mcpClient:(s,e,t,r)=>["mcp","client",s,e,t,r],mcpToolsList:s=>["mcp","client",s,"tools"],mcpResourcesList:s=>["mcp","client",s,"resources"],mcpPromptsList:s=>["mcp","client",s,"prompts"],mcpReadResource:(s,e)=>["mcp","client",s,"resource",e],mcpGetPrompt:(s,e,t)=>["mcp","client",s,"prompt",e,t],mcpToolCall:(s,e,t)=>["mcp","client",s,"tool-call",e,t],organizationSettings:s=>["organization-settings",s],activeOrganization:s=>["activeOrganization",s],modelsList:s=>["models-list",s],connectionCollections:s=>[s,"collections","discovery"],toolCall:(s,e,t)=>["tool-call",s,e,t],collectionItems:(s,e)=>["collection",s,e],collection:(s,e,t)=>[s,e,"collection",t],collectionItem:(s,e,t,r,o)=>[s,e,t,"collection",r,o],collectionList:(s,e,t,r,o)=>[s,e,t,"collection",r,"list",o],collectionListInfinite:(s,e,t,r,o)=>[s,e,t,"collection",r,"list-infinite",o],githubReadme:(s,e)=>["github-readme",s,e],monitoringStats:()=>["monitoring","stats"],monitoringLogs:s=>["monitoring","logs",s],monitoringLogsInfinite:(s,e)=>["monitoring","logs-infinite",s,e],virtualMcpPrompts:s=>["virtual-mcp",s,"prompts"],connectionPrompts:s=>["connection",s,"prompts"],connectionResources:s=>["connection",s,"resources"],user:s=>["user",s],registryApp:(s,e)=>["registry-app",s,e]};function N(s){return!!s._zod}function C(s,e){return N(s)?ce(s,e):s.safeParse(e)}function re(s){if(!s)return;let e;if(N(s)?e=s._zod?.def?.shape:e=s.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function We(s){if(N(s)){const a=s._zod?.def;if(a){if(a.value!==void 0)return a.value;if(Array.isArray(a.values)&&a.values.length>0)return a.values[0]}}const t=s._def;if(t){if(t.value!==void 0)return t.value;if(Array.isArray(t.values)&&t.values.length>0)return t.values[0]}const r=s.value;if(r!==void 0)return r}function R(s){return s==="completed"||s==="failed"||s==="cancelled"}function G(s){const t=re(s)?.method;if(!t)throw new Error("Schema is missing a method literal");const r=We(t);if(typeof r!="string")throw new Error("Schema method literal must be a string");return r}function K(s,e){const t=C(s,e);if(!t.success)throw t.error;return t.data}const Qe=6e4;class Ge{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(le,t=>{this._oncancel(t)}),this.setNotificationHandler(ue,t=>{this._onprogress(t)}),this.setRequestHandler(de,t=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(he,async(t,r)=>{const o=await this._taskStore.getTask(t.params.taskId,r.sessionId);if(!o)throw new p(w.InvalidParams,"Failed to retrieve task: Task not found");return{...o}}),this.setRequestHandler(fe,async(t,r)=>{const o=async()=>{const a=t.params.taskId;if(this._taskMessageQueue){let n;for(;n=await this._taskMessageQueue.dequeue(a,r.sessionId);){if(n.type==="response"||n.type==="error"){const l=n.message,f=l.id,u=this._requestResolvers.get(f);if(u)if(this._requestResolvers.delete(f),n.type==="response")u(l);else{const h=l,m=new p(h.error.code,h.error.message,h.error.data);u(m)}else{const h=n.type==="response"?"Response":"Error";this._onerror(new Error(`${h} handler missing for request ${f}`))}continue}await this._transport?.send(n.message,{relatedRequestId:r.requestId})}}const i=await this._taskStore.getTask(a,r.sessionId);if(!i)throw new p(w.InvalidParams,`Task not found: ${a}`);if(!R(i.status))return await this._waitForTaskUpdate(a,r.signal),await o();if(R(i.status)){const n=await this._taskStore.getTaskResult(a,r.sessionId);return this._clearTaskQueue(a),{...n,_meta:{...n._meta,[q]:{taskId:a}}}}return await o()};return await o()}),this.setRequestHandler(pe,async(t,r)=>{try{const{tasks:o,nextCursor:a}=await this._taskStore.listTasks(t.params?.cursor,r.sessionId);return{tasks:o,nextCursor:a,_meta:{}}}catch(o){throw new p(w.InvalidParams,`Failed to list tasks: ${o instanceof Error?o.message:String(o)}`)}}),this.setRequestHandler(me,async(t,r)=>{try{const o=await this._taskStore.getTask(t.params.taskId,r.sessionId);if(!o)throw new p(w.InvalidParams,`Task not found: ${t.params.taskId}`);if(R(o.status))throw new p(w.InvalidParams,`Cannot cancel task in terminal status: ${o.status}`);await this._taskStore.updateTaskStatus(t.params.taskId,"cancelled","Client cancelled task execution.",r.sessionId),this._clearTaskQueue(t.params.taskId);const a=await this._taskStore.getTask(t.params.taskId,r.sessionId);if(!a)throw new p(w.InvalidParams,`Task not found after cancellation: ${t.params.taskId}`);return{_meta:{},...a}}catch(o){throw o instanceof p?o:new p(w.InvalidRequest,`Failed to cancel task: ${o instanceof Error?o.message:String(o)}`)}}))}async _oncancel(e){if(!e.params.requestId)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,r,o,a=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(o,t),startTime:Date.now(),timeout:t,maxTotalTimeout:r,resetTimeoutOnProgress:a,onTimeout:o})}_resetTimeout(e){const t=this._timeoutInfo.get(e);if(!t)return!1;const r=Date.now()-t.startTime;if(t.maxTotalTimeout&&r>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),p.fromError(w.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:r});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){const t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){if(this._transport)throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=e;const t=this.transport?.onclose;this._transport.onclose=()=>{t?.(),this._onclose()};const r=this.transport?.onerror;this._transport.onerror=a=>{r?.(a),this._onerror(a)};const o=this._transport?.onmessage;this._transport.onmessage=(a,i)=>{o?.(a,i),A(a)||_e(a)?this._onresponse(a):D(a)?this._onrequest(a,i):ge(a)?this._onnotification(a):this._onerror(new Error(`Unknown message type: ${JSON.stringify(a)}`))},await this._transport.start()}_onclose(){const e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(const r of this._requestHandlerAbortControllers.values())r.abort();this._requestHandlerAbortControllers.clear();const t=p.fromError(w.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(const r of e.values())r(t)}_onerror(e){this.onerror?.(e)}_onnotification(e){const t=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;t!==void 0&&Promise.resolve().then(()=>t(e)).catch(r=>this._onerror(new Error(`Uncaught error in notification handler: ${r}`)))}_onrequest(e,t){const r=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,o=this._transport,a=e.params?._meta?.[q]?.taskId;if(r===void 0){const u={jsonrpc:"2.0",id:e.id,error:{code:w.MethodNotFound,message:"Method not found"}};a&&this._taskMessageQueue?this._enqueueTaskMessage(a,{type:"error",message:u,timestamp:Date.now()},o?.sessionId).catch(h=>this._onerror(new Error(`Failed to enqueue error response: ${h}`))):o?.send(u).catch(h=>this._onerror(new Error(`Failed to send an error response: ${h}`)));return}const i=new AbortController;this._requestHandlerAbortControllers.set(e.id,i);const n=we(e.params)?e.params.task:void 0,l=this._taskStore?this.requestTaskStore(e,o?.sessionId):void 0,f={signal:i.signal,sessionId:o?.sessionId,_meta:e.params?._meta,sendNotification:async u=>{if(i.signal.aborted)return;const h={relatedRequestId:e.id};a&&(h.relatedTask={taskId:a}),await this.notification(u,h)},sendRequest:async(u,h,m)=>{if(i.signal.aborted)throw new p(w.ConnectionClosed,"Request was cancelled");const g={...m,relatedRequestId:e.id};a&&!g.relatedTask&&(g.relatedTask={taskId:a});const y=g.relatedTask?.taskId??a;return y&&l&&await l.updateTaskStatus(y,"input_required"),await this.request(u,h,g)},authInfo:t?.authInfo,requestId:e.id,requestInfo:t?.requestInfo,taskId:a,taskStore:l,taskRequestedTtl:n?.ttl,closeSSEStream:t?.closeSSEStream,closeStandaloneSSEStream:t?.closeStandaloneSSEStream};Promise.resolve().then(()=>{n&&this.assertTaskHandlerCapability(e.method)}).then(()=>r(e,f)).then(async u=>{if(i.signal.aborted)return;const h={result:u,jsonrpc:"2.0",id:e.id};a&&this._taskMessageQueue?await this._enqueueTaskMessage(a,{type:"response",message:h,timestamp:Date.now()},o?.sessionId):await o?.send(h)},async u=>{if(i.signal.aborted)return;const h={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(u.code)?u.code:w.InternalError,message:u.message??"Internal error",...u.data!==void 0&&{data:u.data}}};a&&this._taskMessageQueue?await this._enqueueTaskMessage(a,{type:"error",message:h,timestamp:Date.now()},o?.sessionId):await o?.send(h)}).catch(u=>this._onerror(new Error(`Failed to send response: ${u}`))).finally(()=>{this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){const{progressToken:t,...r}=e.params,o=Number(t),a=this._progressHandlers.get(o);if(!a){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}const i=this._responseHandlers.get(o),n=this._timeoutInfo.get(o);if(n&&i&&n.resetTimeoutOnProgress)try{this._resetTimeout(o)}catch(l){this._responseHandlers.delete(o),this._progressHandlers.delete(o),this._cleanupTimeout(o),i(l);return}a(r)}_onresponse(e){const t=Number(e.id),r=this._requestResolvers.get(t);if(r){if(this._requestResolvers.delete(t),A(e))r(e);else{const i=new p(e.error.code,e.error.message,e.error.data);r(i)}return}const o=this._responseHandlers.get(t);if(o===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(t),this._cleanupTimeout(t);let a=!1;if(A(e)&&e.result&&typeof e.result=="object"){const i=e.result;if(i.task&&typeof i.task=="object"){const n=i.task;typeof n.taskId=="string"&&(a=!0,this._taskProgressTokens.set(n.taskId,t))}}if(a||this._progressHandlers.delete(t),A(e))o(e);else{const i=p.fromError(e.error.code,e.error.message,e.error.data);o(i)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,t,r){const{task:o}=r??{};if(!o){try{yield{type:"result",result:await this.request(e,t,r)}}catch(i){yield{type:"error",error:i instanceof p?i:new p(w.InternalError,String(i))}}return}let a;try{const i=await this.request(e,F,r);if(i.task)a=i.task.taskId,yield{type:"taskCreated",task:i.task};else throw new p(w.InternalError,"Task creation did not return a task");for(;;){const n=await this.getTask({taskId:a},r);if(yield{type:"taskStatus",task:n},R(n.status)){n.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:a},t,r)}:n.status==="failed"?yield{type:"error",error:new p(w.InternalError,`Task ${a} failed`)}:n.status==="cancelled"&&(yield{type:"error",error:new p(w.InternalError,`Task ${a} was cancelled`)});return}if(n.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:a},t,r)};return}const l=n.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(f=>setTimeout(f,l)),r?.signal?.throwIfAborted()}}catch(i){yield{type:"error",error:i instanceof p?i:new p(w.InternalError,String(i))}}}request(e,t,r){const{relatedRequestId:o,resumptionToken:a,onresumptiontoken:i,task:n,relatedTask:l}=r??{};return new Promise((f,u)=>{const h=c=>{u(c)};if(!this._transport){h(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),n&&this.assertTaskCapability(e.method)}catch(c){h(c);return}r?.signal?.throwIfAborted();const m=this._requestMessageId++,g={...e,jsonrpc:"2.0",id:m};r?.onprogress&&(this._progressHandlers.set(m,r.onprogress),g.params={...e.params,_meta:{...e.params?._meta||{},progressToken:m}}),n&&(g.params={...g.params,task:n}),l&&(g.params={...g.params,_meta:{...g.params?._meta||{},[q]:l}});const y=c=>{this._responseHandlers.delete(m),this._progressHandlers.delete(m),this._cleanupTimeout(m),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:m,reason:String(c)}},{relatedRequestId:o,resumptionToken:a,onresumptiontoken:i}).catch(k=>this._onerror(new Error(`Failed to send cancellation: ${k}`)));const _=c instanceof p?c:new p(w.RequestTimeout,String(c));u(_)};this._responseHandlers.set(m,c=>{if(!r?.signal?.aborted){if(c instanceof Error)return u(c);try{const _=C(t,c.result);_.success?f(_.data):u(_.error)}catch(_){u(_)}}}),r?.signal?.addEventListener("abort",()=>{y(r?.signal?.reason)});const T=r?.timeout??Qe,v=()=>y(p.fromError(w.RequestTimeout,"Request timed out",{timeout:T}));this._setupTimeout(m,T,r?.maxTotalTimeout,v,r?.resetTimeoutOnProgress??!1);const d=l?.taskId;if(d){const c=_=>{const k=this._responseHandlers.get(m);k?k(_):this._onerror(new Error(`Response handler missing for side-channeled request ${m}`))};this._requestResolvers.set(m,c),this._enqueueTaskMessage(d,{type:"request",message:g,timestamp:Date.now()}).catch(_=>{this._cleanupTimeout(m),u(_)})}else this._transport.send(g,{relatedRequestId:o,resumptionToken:a,onresumptiontoken:i}).catch(c=>{this._cleanupTimeout(m),u(c)})})}async getTask(e,t){return this.request({method:"tasks/get",params:e},Te,t)}async getTaskResult(e,t,r){return this.request({method:"tasks/result",params:e},t,r)}async listTasks(e,t){return this.request({method:"tasks/list",params:e},ye,t)}async cancelTask(e,t){return this.request({method:"tasks/cancel",params:e},ve,t)}async notification(e,t){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(e.method);const r=t?.relatedTask?.taskId;if(r){const n={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[q]:t.relatedTask}}};await this._enqueueTaskMessage(r,{type:"notification",message:n,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!t?.relatedRequestId&&!t?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let n={...e,jsonrpc:"2.0"};t?.relatedTask&&(n={...n,params:{...n.params,_meta:{...n.params?._meta||{},[q]:t.relatedTask}}}),this._transport?.send(n,t).catch(l=>this._onerror(l))});return}let i={...e,jsonrpc:"2.0"};t?.relatedTask&&(i={...i,params:{...i.params,_meta:{...i.params?._meta||{},[q]:t.relatedTask}}}),await this._transport.send(i,t)}setRequestHandler(e,t){const r=G(e);this.assertRequestHandlerCapability(r),this._requestHandlers.set(r,(o,a)=>{const i=K(e,o);return Promise.resolve(t(i,a))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t){const r=G(e);this._notificationHandlers.set(r,o=>{const a=K(e,o);return Promise.resolve(t(a))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){const t=this._taskProgressTokens.get(e);t!==void 0&&(this._progressHandlers.delete(t),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,t,r){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");const o=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,t,r,o)}async _clearTaskQueue(e,t){if(this._taskMessageQueue){const r=await this._taskMessageQueue.dequeueAll(e,t);for(const o of r)if(o.type==="request"&&D(o.message)){const a=o.message.id,i=this._requestResolvers.get(a);i?(i(new p(w.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(a)):this._onerror(new Error(`Resolver missing for request ${a} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,t){let r=this._options?.defaultTaskPollInterval??1e3;try{const o=await this._taskStore?.getTask(e);o?.pollInterval&&(r=o.pollInterval)}catch{}return new Promise((o,a)=>{if(t.aborted){a(new p(w.InvalidRequest,"Request cancelled"));return}const i=setTimeout(o,r);t.addEventListener("abort",()=>{clearTimeout(i),a(new p(w.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,t){const r=this._taskStore;if(!r)throw new Error("No task store configured");return{createTask:async o=>{if(!e)throw new Error("No request provided");return await r.createTask(o,e.id,{method:e.method,params:e.params},t)},getTask:async o=>{const a=await r.getTask(o,t);if(!a)throw new p(w.InvalidParams,"Failed to retrieve task: Task not found");return a},storeTaskResult:async(o,a,i)=>{await r.storeTaskResult(o,a,i,t);const n=await r.getTask(o,t);if(n){const l=W.parse({method:"notifications/tasks/status",params:n});await this.notification(l),R(n.status)&&this._cleanupTaskProgressHandler(o)}},getTaskResult:o=>r.getTaskResult(o,t),updateTaskStatus:async(o,a,i)=>{const n=await r.getTask(o,t);if(!n)throw new p(w.InvalidParams,`Task "${o}" not found - it may have been cleaned up`);if(R(n.status))throw new p(w.InvalidParams,`Cannot update task "${o}" from terminal status "${n.status}" to "${a}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await r.updateTaskStatus(o,a,i,t);const l=await r.getTask(o,t);if(l){const f=W.parse({method:"notifications/tasks/status",params:l});await this.notification(f),R(l.status)&&this._cleanupTaskProgressHandler(o)}},listTasks:o=>r.listTasks(o,t)}}}function J(s){return s!==null&&typeof s=="object"&&!Array.isArray(s)}function Ke(s,e){const t={...s};for(const r in e){const o=r,a=e[o];if(a===void 0)continue;const i=t[o];J(i)&&J(a)?t[o]={...i,...a}:t[o]=a}return t}var Je=Se();const Ze=ke(Je);function Be(){const s=new Ze({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return be(s),s}class Ye{constructor(e){this._ajv=e??Be()}getValidator(e){const t="$id"in e&&typeof e.$id=="string"?this._ajv.getSchema(e.$id)??this._ajv.compile(e):this._ajv.compile(e);return r=>t(r)?{valid:!0,data:r,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(t.errors)}}}class Xe{constructor(e){this._client=e}async*callToolStream(e,t=ee,r){const o=this._client,a={...r,task:r?.task??(o.isToolTask(e.name)?{}:void 0)},i=o.requestStream({method:"tools/call",params:e},t,a),n=o.getToolOutputValidator(e.name);for await(const l of i){if(l.type==="result"&&n){const f=l.result;if(!f.structuredContent&&!f.isError){yield{type:"error",error:new p(w.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`)};return}if(f.structuredContent)try{const u=n(f.structuredContent);if(!u.valid){yield{type:"error",error:new p(w.InvalidParams,`Structured content does not match the tool's output schema: ${u.errorMessage}`)};return}}catch(u){if(u instanceof p){yield{type:"error",error:u};return}yield{type:"error",error:new p(w.InvalidParams,`Failed to validate structured content: ${u instanceof Error?u.message:String(u)}`)};return}}yield l}}async getTask(e,t){return this._client.getTask({taskId:e},t)}async getTaskResult(e,t,r){return this._client.getTaskResult({taskId:e},t,r)}async listTasks(e,t){return this._client.listTasks(e?{cursor:e}:void 0,t)}async cancelTask(e,t){return this._client.cancelTask({taskId:e},t)}requestStream(e,t,r){return this._client.requestStream(e,t,r)}}function et(s,e,t){if(!s)throw new Error(`${t} does not support task creation (required for ${e})`);switch(e){case"tools/call":if(!s.tools?.call)throw new Error(`${t} does not support task creation for tools/call (required for ${e})`);break}}function tt(s,e,t){if(!s)throw new Error(`${t} does not support task creation (required for ${e})`);switch(e){case"sampling/createMessage":if(!s.sampling?.createMessage)throw new Error(`${t} does not support task creation for sampling/createMessage (required for ${e})`);break;case"elicitation/create":if(!s.elicitation?.create)throw new Error(`${t} does not support task creation for elicitation/create (required for ${e})`);break}}function O(s,e){if(!(!s||e===null||typeof e!="object")){if(s.type==="object"&&s.properties&&typeof s.properties=="object"){const t=e,r=s.properties;for(const o of Object.keys(r)){const a=r[o];t[o]===void 0&&Object.prototype.hasOwnProperty.call(a,"default")&&(t[o]=a.default),t[o]!==void 0&&O(a,t[o])}}if(Array.isArray(s.anyOf))for(const t of s.anyOf)typeof t!="boolean"&&O(t,e);if(Array.isArray(s.oneOf))for(const t of s.oneOf)typeof t!="boolean"&&O(t,e)}}function st(s){if(!s)return{supportsFormMode:!1,supportsUrlMode:!1};const e=s.form!==void 0,t=s.url!==void 0;return{supportsFormMode:e||!e&&!t,supportsUrlMode:t}}let rt=class extends Ge{constructor(e,t){super(t),this._clientInfo=e,this._cachedToolOutputValidators=new Map,this._cachedKnownTaskTools=new Set,this._cachedRequiredTaskTools=new Set,this._listChangedDebounceTimers=new Map,this._capabilities=t?.capabilities??{},this._jsonSchemaValidator=t?.jsonSchemaValidator??new Ye,t?.listChanged&&(this._pendingListChangedConfig=t.listChanged)}_setupListChangedHandlers(e){e.tools&&this._serverCapabilities?.tools?.listChanged&&this._setupListChangedHandler("tools",Ce,e.tools,async()=>(await this.listTools()).tools),e.prompts&&this._serverCapabilities?.prompts?.listChanged&&this._setupListChangedHandler("prompts",Re,e.prompts,async()=>(await this.listPrompts()).prompts),e.resources&&this._serverCapabilities?.resources?.listChanged&&this._setupListChangedHandler("resources",Ie,e.resources,async()=>(await this.listResources()).resources)}get experimental(){return this._experimental||(this._experimental={tasks:new Xe(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=Ke(this._capabilities,e)}setRequestHandler(e,t){const o=re(e)?.method;if(!o)throw new Error("Schema is missing a method literal");let a;if(N(o)){const n=o;a=n._zod?.def?.value??n.value}else{const n=o;a=n._def?.value??n.value}if(typeof a!="string")throw new Error("Schema method literal must be a string");const i=a;if(i==="elicitation/create"){const n=async(l,f)=>{const u=C(De,l);if(!u.success){const c=u.error instanceof Error?u.error.message:String(u.error);throw new p(w.InvalidParams,`Invalid elicitation request: ${c}`)}const{params:h}=u.data;h.mode=h.mode??"form";const{supportsFormMode:m,supportsUrlMode:g}=st(this._capabilities.elicitation);if(h.mode==="form"&&!m)throw new p(w.InvalidParams,"Client does not support form-mode elicitation requests");if(h.mode==="url"&&!g)throw new p(w.InvalidParams,"Client does not support URL-mode elicitation requests");const y=await Promise.resolve(t(l,f));if(h.task){const c=C(F,y);if(!c.success){const _=c.error instanceof Error?c.error.message:String(c.error);throw new p(w.InvalidParams,`Invalid task creation result: ${_}`)}return c.data}const T=C(Fe,y);if(!T.success){const c=T.error instanceof Error?T.error.message:String(T.error);throw new p(w.InvalidParams,`Invalid elicitation result: ${c}`)}const v=T.data,d=h.mode==="form"?h.requestedSchema:void 0;if(h.mode==="form"&&v.action==="accept"&&v.content&&d&&this._capabilities.elicitation?.form?.applyDefaults)try{O(d,v.content)}catch{}return v};return super.setRequestHandler(e,n)}if(i==="sampling/createMessage"){const n=async(l,f)=>{const u=C(Ue,l);if(!u.success){const v=u.error instanceof Error?u.error.message:String(u.error);throw new p(w.InvalidParams,`Invalid sampling request: ${v}`)}const{params:h}=u.data,m=await Promise.resolve(t(l,f));if(h.task){const v=C(F,m);if(!v.success){const d=v.error instanceof Error?v.error.message:String(v.error);throw new p(w.InvalidParams,`Invalid task creation result: ${d}`)}return v.data}const y=h.tools||h.toolChoice?je:Ve,T=C(y,m);if(!T.success){const v=T.error instanceof Error?T.error.message:String(T.error);throw new p(w.InvalidParams,`Invalid sampling result: ${v}`)}return T.data};return super.setRequestHandler(e,n)}return super.setRequestHandler(e,t)}assertCapability(e,t){if(!this._serverCapabilities?.[e])throw new Error(`Server does not support ${e} (required for ${t})`)}async connect(e,t){if(await super.connect(e),e.sessionId===void 0)try{const r=await this.request({method:"initialize",params:{protocolVersion:Ee,capabilities:this._capabilities,clientInfo:this._clientInfo}},qe,t);if(r===void 0)throw new Error(`Server sent invalid initialize result: ${r}`);if(!Pe.includes(r.protocolVersion))throw new Error(`Server's protocol version is not supported: ${r.protocolVersion}`);this._serverCapabilities=r.capabilities,this._serverVersion=r.serverInfo,e.setProtocolVersion&&e.setProtocolVersion(r.protocolVersion),this._instructions=r.instructions,await this.notification({method:"notifications/initialized"}),this._pendingListChangedConfig&&(this._setupListChangedHandlers(this._pendingListChangedConfig),this._pendingListChangedConfig=void 0)}catch(r){throw this.close(),r}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}getInstructions(){return this._instructions}assertCapabilityForMethod(e){switch(e){case"logging/setLevel":if(!this._serverCapabilities?.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._serverCapabilities?.prompts)throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":case"resources/subscribe":case"resources/unsubscribe":if(!this._serverCapabilities?.resources)throw new Error(`Server does not support resources (required for ${e})`);if(e==="resources/subscribe"&&!this._serverCapabilities.resources.subscribe)throw new Error(`Server does not support resource subscriptions (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._serverCapabilities?.tools)throw new Error(`Server does not support tools (required for ${e})`);break;case"completion/complete":if(!this._serverCapabilities?.completions)throw new Error(`Server does not support completions (required for ${e})`);break}}assertNotificationCapability(e){switch(e){case"notifications/roots/list_changed":if(!this._capabilities.roots?.listChanged)throw new Error(`Client does not support roots list changed notifications (required for ${e})`);break}}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case"sampling/createMessage":if(!this._capabilities.sampling)throw new Error(`Client does not support sampling capability (required for ${e})`);break;case"elicitation/create":if(!this._capabilities.elicitation)throw new Error(`Client does not support elicitation capability (required for ${e})`);break;case"roots/list":if(!this._capabilities.roots)throw new Error(`Client does not support roots capability (required for ${e})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Client does not support tasks capability (required for ${e})`);break}}assertTaskCapability(e){et(this._serverCapabilities?.tasks?.requests,e,"Server")}assertTaskHandlerCapability(e){this._capabilities&&tt(this._capabilities.tasks?.requests,e,"Client")}async ping(e){return this.request({method:"ping"},$,e)}async complete(e,t){return this.request({method:"completion/complete",params:e},Me,t)}async setLoggingLevel(e,t){return this.request({method:"logging/setLevel",params:{level:e}},$,t)}async getPrompt(e,t){return this.request({method:"prompts/get",params:e},Ae,t)}async listPrompts(e,t){return this.request({method:"prompts/list",params:e},$e,t)}async listResources(e,t){return this.request({method:"resources/list",params:e},He,t)}async listResourceTemplates(e,t){return this.request({method:"resources/templates/list",params:e},Oe,t)}async readResource(e,t){return this.request({method:"resources/read",params:e},Ne,t)}async subscribeResource(e,t){return this.request({method:"resources/subscribe",params:e},$,t)}async unsubscribeResource(e,t){return this.request({method:"resources/unsubscribe",params:e},$,t)}async callTool(e,t=ee,r){if(this.isToolTaskRequired(e.name))throw new p(w.InvalidRequest,`Tool "${e.name}" requires task-based execution. Use client.experimental.tasks.callToolStream() instead.`);const o=await this.request({method:"tools/call",params:e},t,r),a=this.getToolOutputValidator(e.name);if(a){if(!o.structuredContent&&!o.isError)throw new p(w.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`);if(o.structuredContent)try{const i=a(o.structuredContent);if(!i.valid)throw new p(w.InvalidParams,`Structured content does not match the tool's output schema: ${i.errorMessage}`)}catch(i){throw i instanceof p?i:new p(w.InvalidParams,`Failed to validate structured content: ${i instanceof Error?i.message:String(i)}`)}}return o}isToolTask(e){return this._serverCapabilities?.tasks?.requests?.tools?.call?this._cachedKnownTaskTools.has(e):!1}isToolTaskRequired(e){return this._cachedRequiredTaskTools.has(e)}cacheToolMetadata(e){this._cachedToolOutputValidators.clear(),this._cachedKnownTaskTools.clear(),this._cachedRequiredTaskTools.clear();for(const t of e){if(t.outputSchema){const o=this._jsonSchemaValidator.getValidator(t.outputSchema);this._cachedToolOutputValidators.set(t.name,o)}const r=t.execution?.taskSupport;(r==="required"||r==="optional")&&this._cachedKnownTaskTools.add(t.name),r==="required"&&this._cachedRequiredTaskTools.add(t.name)}}getToolOutputValidator(e){return this._cachedToolOutputValidators.get(e)}async listTools(e,t){const r=await this.request({method:"tools/list",params:e},xe,t);return this.cacheToolMetadata(r.tools),r}_setupListChangedHandler(e,t,r,o){const a=Le.safeParse(r);if(!a.success)throw new Error(`Invalid ${e} listChanged options: ${a.error.message}`);if(typeof r.onChanged!="function")throw new Error(`Invalid ${e} listChanged options: onChanged must be a function`);const{autoRefresh:i,debounceMs:n}=a.data,{onChanged:l}=r,f=async()=>{if(!i){l(null,null);return}try{const h=await o();l(null,h)}catch(h){const m=h instanceof Error?h:new Error(String(h));l(m,null)}},u=()=>{if(n){const h=this._listChangedDebounceTimers.get(e);h&&clearTimeout(h);const m=setTimeout(f,n);this._listChangedDebounceTimers.set(e,m)}else f()};this.setNotificationHandler(t,u)}async sendRootsListChanged(){return this.notification({method:"notifications/roots/list_changed"})}};function U(s){return s?s instanceof Headers?Object.fromEntries(s.entries()):Array.isArray(s)?Object.fromEntries(s):{...s}:{}}function ot(s=fetch,e){return e?async(t,r)=>{const o={...e,...r,headers:r?.headers?{...U(e.headers),...U(r.headers)}:e.headers};return s(t,o)}:s}class Z extends Error{constructor(e,t){super(e),this.name="ParseError",this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line}}const B=10,at=13,I=32;function L(s){}function nt(s){if(typeof s=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");const{onEvent:e=L,onError:t=L,onRetry:r=L,onComment:o}=s,a=[];let i=!0,n,l="",f=0,u;function h(d){if(i&&(i=!1,d.charCodeAt(0)===239&&d.charCodeAt(1)===187&&d.charCodeAt(2)===191&&(d=d.slice(3))),a.length===0){const k=m(d);k!==""&&a.push(k);return}if(d.indexOf(`
1
+ import{cL as ce,cM as le,cN as ue,bv as de,cO as he,aO as p,aP as w,cP as fe,cQ as pe,cR as me,cS as A,cT as _e,cU as D,cV as ge,cW as q,cX as we,cY as F,cZ as Te,c_ as ye,c$ as ve,d0 as W,bb as ke,cC as Se,d1 as be,bq as ee,bD as Ce,bJ as Re,bH as Ie,d2 as Ee,d3 as qe,d4 as Pe,d5 as $,d6 as Me,d7 as Ae,bI as $e,bE as He,bF as Oe,bG as Ne,bC as xe,d8 as Le,d9 as De,da as Fe,bx as Ue,db as je,dc as Ve,cx as P,cy as H,cz as Q,dd as ze,bK as x,e as te,V as se}from"./index-D34n6J5J.js";const V={authConfig:()=>["authConfig"],threads:s=>["threads",s],virtualMcpThreads:(s,e)=>["threads",s,"virtual-mcp",e],thread:(s,e)=>["thread",s,e],threadMessages:(s,e)=>["thread-messages",s,e],messages:s=>["messages",s],organizations:()=>["organizations"],members:s=>[s,"members"],invitations:s=>[s,"invitations"],organizationRoles:s=>[s,"organization-roles"],connections:s=>[s,"connections"],connectionsByBinding:(s,e)=>[s,"connections",`binding:${e}`],connection:(s,e)=>[s,"connection",e],isMCPAuthenticated:(s,e)=>["is-mcp-authenticated",s,e],mcpTools:(s,e)=>["mcp","tools",s,e],mcpClient:(s,e,t,r)=>["mcp","client",s,e,t,r],mcpToolsList:s=>["mcp","client",s,"tools"],mcpResourcesList:s=>["mcp","client",s,"resources"],mcpPromptsList:s=>["mcp","client",s,"prompts"],mcpReadResource:(s,e)=>["mcp","client",s,"resource",e],mcpGetPrompt:(s,e,t)=>["mcp","client",s,"prompt",e,t],mcpToolCall:(s,e,t)=>["mcp","client",s,"tool-call",e,t],organizationSettings:s=>["organization-settings",s],activeOrganization:s=>["activeOrganization",s],modelsList:s=>["models-list",s],connectionCollections:s=>[s,"collections","discovery"],toolCall:(s,e,t)=>["tool-call",s,e,t],collectionItems:(s,e)=>["collection",s,e],collection:(s,e,t)=>[s,e,"collection",t],collectionItem:(s,e,t,r,o)=>[s,e,t,"collection",r,o],collectionList:(s,e,t,r,o)=>[s,e,t,"collection",r,"list",o],collectionListInfinite:(s,e,t,r,o)=>[s,e,t,"collection",r,"list-infinite",o],githubReadme:(s,e)=>["github-readme",s,e],monitoringStats:()=>["monitoring","stats"],monitoringLogs:s=>["monitoring","logs",s],monitoringLogsInfinite:(s,e)=>["monitoring","logs-infinite",s,e],virtualMcpPrompts:s=>["virtual-mcp",s,"prompts"],connectionPrompts:s=>["connection",s,"prompts"],connectionResources:s=>["connection",s,"resources"],user:s=>["user",s],registryApp:(s,e)=>["registry-app",s,e]};function N(s){return!!s._zod}function C(s,e){return N(s)?ce(s,e):s.safeParse(e)}function re(s){if(!s)return;let e;if(N(s)?e=s._zod?.def?.shape:e=s.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function We(s){if(N(s)){const a=s._zod?.def;if(a){if(a.value!==void 0)return a.value;if(Array.isArray(a.values)&&a.values.length>0)return a.values[0]}}const t=s._def;if(t){if(t.value!==void 0)return t.value;if(Array.isArray(t.values)&&t.values.length>0)return t.values[0]}const r=s.value;if(r!==void 0)return r}function R(s){return s==="completed"||s==="failed"||s==="cancelled"}function G(s){const t=re(s)?.method;if(!t)throw new Error("Schema is missing a method literal");const r=We(t);if(typeof r!="string")throw new Error("Schema method literal must be a string");return r}function K(s,e){const t=C(s,e);if(!t.success)throw t.error;return t.data}const Qe=6e4;class Ge{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(le,t=>{this._oncancel(t)}),this.setNotificationHandler(ue,t=>{this._onprogress(t)}),this.setRequestHandler(de,t=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(he,async(t,r)=>{const o=await this._taskStore.getTask(t.params.taskId,r.sessionId);if(!o)throw new p(w.InvalidParams,"Failed to retrieve task: Task not found");return{...o}}),this.setRequestHandler(fe,async(t,r)=>{const o=async()=>{const a=t.params.taskId;if(this._taskMessageQueue){let n;for(;n=await this._taskMessageQueue.dequeue(a,r.sessionId);){if(n.type==="response"||n.type==="error"){const l=n.message,f=l.id,u=this._requestResolvers.get(f);if(u)if(this._requestResolvers.delete(f),n.type==="response")u(l);else{const h=l,m=new p(h.error.code,h.error.message,h.error.data);u(m)}else{const h=n.type==="response"?"Response":"Error";this._onerror(new Error(`${h} handler missing for request ${f}`))}continue}await this._transport?.send(n.message,{relatedRequestId:r.requestId})}}const i=await this._taskStore.getTask(a,r.sessionId);if(!i)throw new p(w.InvalidParams,`Task not found: ${a}`);if(!R(i.status))return await this._waitForTaskUpdate(a,r.signal),await o();if(R(i.status)){const n=await this._taskStore.getTaskResult(a,r.sessionId);return this._clearTaskQueue(a),{...n,_meta:{...n._meta,[q]:{taskId:a}}}}return await o()};return await o()}),this.setRequestHandler(pe,async(t,r)=>{try{const{tasks:o,nextCursor:a}=await this._taskStore.listTasks(t.params?.cursor,r.sessionId);return{tasks:o,nextCursor:a,_meta:{}}}catch(o){throw new p(w.InvalidParams,`Failed to list tasks: ${o instanceof Error?o.message:String(o)}`)}}),this.setRequestHandler(me,async(t,r)=>{try{const o=await this._taskStore.getTask(t.params.taskId,r.sessionId);if(!o)throw new p(w.InvalidParams,`Task not found: ${t.params.taskId}`);if(R(o.status))throw new p(w.InvalidParams,`Cannot cancel task in terminal status: ${o.status}`);await this._taskStore.updateTaskStatus(t.params.taskId,"cancelled","Client cancelled task execution.",r.sessionId),this._clearTaskQueue(t.params.taskId);const a=await this._taskStore.getTask(t.params.taskId,r.sessionId);if(!a)throw new p(w.InvalidParams,`Task not found after cancellation: ${t.params.taskId}`);return{_meta:{},...a}}catch(o){throw o instanceof p?o:new p(w.InvalidRequest,`Failed to cancel task: ${o instanceof Error?o.message:String(o)}`)}}))}async _oncancel(e){if(!e.params.requestId)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,r,o,a=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(o,t),startTime:Date.now(),timeout:t,maxTotalTimeout:r,resetTimeoutOnProgress:a,onTimeout:o})}_resetTimeout(e){const t=this._timeoutInfo.get(e);if(!t)return!1;const r=Date.now()-t.startTime;if(t.maxTotalTimeout&&r>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),p.fromError(w.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:r});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){const t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){if(this._transport)throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=e;const t=this.transport?.onclose;this._transport.onclose=()=>{t?.(),this._onclose()};const r=this.transport?.onerror;this._transport.onerror=a=>{r?.(a),this._onerror(a)};const o=this._transport?.onmessage;this._transport.onmessage=(a,i)=>{o?.(a,i),A(a)||_e(a)?this._onresponse(a):D(a)?this._onrequest(a,i):ge(a)?this._onnotification(a):this._onerror(new Error(`Unknown message type: ${JSON.stringify(a)}`))},await this._transport.start()}_onclose(){const e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(const r of this._requestHandlerAbortControllers.values())r.abort();this._requestHandlerAbortControllers.clear();const t=p.fromError(w.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(const r of e.values())r(t)}_onerror(e){this.onerror?.(e)}_onnotification(e){const t=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;t!==void 0&&Promise.resolve().then(()=>t(e)).catch(r=>this._onerror(new Error(`Uncaught error in notification handler: ${r}`)))}_onrequest(e,t){const r=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,o=this._transport,a=e.params?._meta?.[q]?.taskId;if(r===void 0){const u={jsonrpc:"2.0",id:e.id,error:{code:w.MethodNotFound,message:"Method not found"}};a&&this._taskMessageQueue?this._enqueueTaskMessage(a,{type:"error",message:u,timestamp:Date.now()},o?.sessionId).catch(h=>this._onerror(new Error(`Failed to enqueue error response: ${h}`))):o?.send(u).catch(h=>this._onerror(new Error(`Failed to send an error response: ${h}`)));return}const i=new AbortController;this._requestHandlerAbortControllers.set(e.id,i);const n=we(e.params)?e.params.task:void 0,l=this._taskStore?this.requestTaskStore(e,o?.sessionId):void 0,f={signal:i.signal,sessionId:o?.sessionId,_meta:e.params?._meta,sendNotification:async u=>{if(i.signal.aborted)return;const h={relatedRequestId:e.id};a&&(h.relatedTask={taskId:a}),await this.notification(u,h)},sendRequest:async(u,h,m)=>{if(i.signal.aborted)throw new p(w.ConnectionClosed,"Request was cancelled");const g={...m,relatedRequestId:e.id};a&&!g.relatedTask&&(g.relatedTask={taskId:a});const y=g.relatedTask?.taskId??a;return y&&l&&await l.updateTaskStatus(y,"input_required"),await this.request(u,h,g)},authInfo:t?.authInfo,requestId:e.id,requestInfo:t?.requestInfo,taskId:a,taskStore:l,taskRequestedTtl:n?.ttl,closeSSEStream:t?.closeSSEStream,closeStandaloneSSEStream:t?.closeStandaloneSSEStream};Promise.resolve().then(()=>{n&&this.assertTaskHandlerCapability(e.method)}).then(()=>r(e,f)).then(async u=>{if(i.signal.aborted)return;const h={result:u,jsonrpc:"2.0",id:e.id};a&&this._taskMessageQueue?await this._enqueueTaskMessage(a,{type:"response",message:h,timestamp:Date.now()},o?.sessionId):await o?.send(h)},async u=>{if(i.signal.aborted)return;const h={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(u.code)?u.code:w.InternalError,message:u.message??"Internal error",...u.data!==void 0&&{data:u.data}}};a&&this._taskMessageQueue?await this._enqueueTaskMessage(a,{type:"error",message:h,timestamp:Date.now()},o?.sessionId):await o?.send(h)}).catch(u=>this._onerror(new Error(`Failed to send response: ${u}`))).finally(()=>{this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){const{progressToken:t,...r}=e.params,o=Number(t),a=this._progressHandlers.get(o);if(!a){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}const i=this._responseHandlers.get(o),n=this._timeoutInfo.get(o);if(n&&i&&n.resetTimeoutOnProgress)try{this._resetTimeout(o)}catch(l){this._responseHandlers.delete(o),this._progressHandlers.delete(o),this._cleanupTimeout(o),i(l);return}a(r)}_onresponse(e){const t=Number(e.id),r=this._requestResolvers.get(t);if(r){if(this._requestResolvers.delete(t),A(e))r(e);else{const i=new p(e.error.code,e.error.message,e.error.data);r(i)}return}const o=this._responseHandlers.get(t);if(o===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(t),this._cleanupTimeout(t);let a=!1;if(A(e)&&e.result&&typeof e.result=="object"){const i=e.result;if(i.task&&typeof i.task=="object"){const n=i.task;typeof n.taskId=="string"&&(a=!0,this._taskProgressTokens.set(n.taskId,t))}}if(a||this._progressHandlers.delete(t),A(e))o(e);else{const i=p.fromError(e.error.code,e.error.message,e.error.data);o(i)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,t,r){const{task:o}=r??{};if(!o){try{yield{type:"result",result:await this.request(e,t,r)}}catch(i){yield{type:"error",error:i instanceof p?i:new p(w.InternalError,String(i))}}return}let a;try{const i=await this.request(e,F,r);if(i.task)a=i.task.taskId,yield{type:"taskCreated",task:i.task};else throw new p(w.InternalError,"Task creation did not return a task");for(;;){const n=await this.getTask({taskId:a},r);if(yield{type:"taskStatus",task:n},R(n.status)){n.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:a},t,r)}:n.status==="failed"?yield{type:"error",error:new p(w.InternalError,`Task ${a} failed`)}:n.status==="cancelled"&&(yield{type:"error",error:new p(w.InternalError,`Task ${a} was cancelled`)});return}if(n.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:a},t,r)};return}const l=n.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(f=>setTimeout(f,l)),r?.signal?.throwIfAborted()}}catch(i){yield{type:"error",error:i instanceof p?i:new p(w.InternalError,String(i))}}}request(e,t,r){const{relatedRequestId:o,resumptionToken:a,onresumptiontoken:i,task:n,relatedTask:l}=r??{};return new Promise((f,u)=>{const h=c=>{u(c)};if(!this._transport){h(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),n&&this.assertTaskCapability(e.method)}catch(c){h(c);return}r?.signal?.throwIfAborted();const m=this._requestMessageId++,g={...e,jsonrpc:"2.0",id:m};r?.onprogress&&(this._progressHandlers.set(m,r.onprogress),g.params={...e.params,_meta:{...e.params?._meta||{},progressToken:m}}),n&&(g.params={...g.params,task:n}),l&&(g.params={...g.params,_meta:{...g.params?._meta||{},[q]:l}});const y=c=>{this._responseHandlers.delete(m),this._progressHandlers.delete(m),this._cleanupTimeout(m),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:m,reason:String(c)}},{relatedRequestId:o,resumptionToken:a,onresumptiontoken:i}).catch(k=>this._onerror(new Error(`Failed to send cancellation: ${k}`)));const _=c instanceof p?c:new p(w.RequestTimeout,String(c));u(_)};this._responseHandlers.set(m,c=>{if(!r?.signal?.aborted){if(c instanceof Error)return u(c);try{const _=C(t,c.result);_.success?f(_.data):u(_.error)}catch(_){u(_)}}}),r?.signal?.addEventListener("abort",()=>{y(r?.signal?.reason)});const T=r?.timeout??Qe,v=()=>y(p.fromError(w.RequestTimeout,"Request timed out",{timeout:T}));this._setupTimeout(m,T,r?.maxTotalTimeout,v,r?.resetTimeoutOnProgress??!1);const d=l?.taskId;if(d){const c=_=>{const k=this._responseHandlers.get(m);k?k(_):this._onerror(new Error(`Response handler missing for side-channeled request ${m}`))};this._requestResolvers.set(m,c),this._enqueueTaskMessage(d,{type:"request",message:g,timestamp:Date.now()}).catch(_=>{this._cleanupTimeout(m),u(_)})}else this._transport.send(g,{relatedRequestId:o,resumptionToken:a,onresumptiontoken:i}).catch(c=>{this._cleanupTimeout(m),u(c)})})}async getTask(e,t){return this.request({method:"tasks/get",params:e},Te,t)}async getTaskResult(e,t,r){return this.request({method:"tasks/result",params:e},t,r)}async listTasks(e,t){return this.request({method:"tasks/list",params:e},ye,t)}async cancelTask(e,t){return this.request({method:"tasks/cancel",params:e},ve,t)}async notification(e,t){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(e.method);const r=t?.relatedTask?.taskId;if(r){const n={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[q]:t.relatedTask}}};await this._enqueueTaskMessage(r,{type:"notification",message:n,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!t?.relatedRequestId&&!t?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let n={...e,jsonrpc:"2.0"};t?.relatedTask&&(n={...n,params:{...n.params,_meta:{...n.params?._meta||{},[q]:t.relatedTask}}}),this._transport?.send(n,t).catch(l=>this._onerror(l))});return}let i={...e,jsonrpc:"2.0"};t?.relatedTask&&(i={...i,params:{...i.params,_meta:{...i.params?._meta||{},[q]:t.relatedTask}}}),await this._transport.send(i,t)}setRequestHandler(e,t){const r=G(e);this.assertRequestHandlerCapability(r),this._requestHandlers.set(r,(o,a)=>{const i=K(e,o);return Promise.resolve(t(i,a))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t){const r=G(e);this._notificationHandlers.set(r,o=>{const a=K(e,o);return Promise.resolve(t(a))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){const t=this._taskProgressTokens.get(e);t!==void 0&&(this._progressHandlers.delete(t),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,t,r){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");const o=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,t,r,o)}async _clearTaskQueue(e,t){if(this._taskMessageQueue){const r=await this._taskMessageQueue.dequeueAll(e,t);for(const o of r)if(o.type==="request"&&D(o.message)){const a=o.message.id,i=this._requestResolvers.get(a);i?(i(new p(w.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(a)):this._onerror(new Error(`Resolver missing for request ${a} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,t){let r=this._options?.defaultTaskPollInterval??1e3;try{const o=await this._taskStore?.getTask(e);o?.pollInterval&&(r=o.pollInterval)}catch{}return new Promise((o,a)=>{if(t.aborted){a(new p(w.InvalidRequest,"Request cancelled"));return}const i=setTimeout(o,r);t.addEventListener("abort",()=>{clearTimeout(i),a(new p(w.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,t){const r=this._taskStore;if(!r)throw new Error("No task store configured");return{createTask:async o=>{if(!e)throw new Error("No request provided");return await r.createTask(o,e.id,{method:e.method,params:e.params},t)},getTask:async o=>{const a=await r.getTask(o,t);if(!a)throw new p(w.InvalidParams,"Failed to retrieve task: Task not found");return a},storeTaskResult:async(o,a,i)=>{await r.storeTaskResult(o,a,i,t);const n=await r.getTask(o,t);if(n){const l=W.parse({method:"notifications/tasks/status",params:n});await this.notification(l),R(n.status)&&this._cleanupTaskProgressHandler(o)}},getTaskResult:o=>r.getTaskResult(o,t),updateTaskStatus:async(o,a,i)=>{const n=await r.getTask(o,t);if(!n)throw new p(w.InvalidParams,`Task "${o}" not found - it may have been cleaned up`);if(R(n.status))throw new p(w.InvalidParams,`Cannot update task "${o}" from terminal status "${n.status}" to "${a}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await r.updateTaskStatus(o,a,i,t);const l=await r.getTask(o,t);if(l){const f=W.parse({method:"notifications/tasks/status",params:l});await this.notification(f),R(l.status)&&this._cleanupTaskProgressHandler(o)}},listTasks:o=>r.listTasks(o,t)}}}function J(s){return s!==null&&typeof s=="object"&&!Array.isArray(s)}function Ke(s,e){const t={...s};for(const r in e){const o=r,a=e[o];if(a===void 0)continue;const i=t[o];J(i)&&J(a)?t[o]={...i,...a}:t[o]=a}return t}var Je=Se();const Ze=ke(Je);function Be(){const s=new Ze({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return be(s),s}class Ye{constructor(e){this._ajv=e??Be()}getValidator(e){const t="$id"in e&&typeof e.$id=="string"?this._ajv.getSchema(e.$id)??this._ajv.compile(e):this._ajv.compile(e);return r=>t(r)?{valid:!0,data:r,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(t.errors)}}}class Xe{constructor(e){this._client=e}async*callToolStream(e,t=ee,r){const o=this._client,a={...r,task:r?.task??(o.isToolTask(e.name)?{}:void 0)},i=o.requestStream({method:"tools/call",params:e},t,a),n=o.getToolOutputValidator(e.name);for await(const l of i){if(l.type==="result"&&n){const f=l.result;if(!f.structuredContent&&!f.isError){yield{type:"error",error:new p(w.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`)};return}if(f.structuredContent)try{const u=n(f.structuredContent);if(!u.valid){yield{type:"error",error:new p(w.InvalidParams,`Structured content does not match the tool's output schema: ${u.errorMessage}`)};return}}catch(u){if(u instanceof p){yield{type:"error",error:u};return}yield{type:"error",error:new p(w.InvalidParams,`Failed to validate structured content: ${u instanceof Error?u.message:String(u)}`)};return}}yield l}}async getTask(e,t){return this._client.getTask({taskId:e},t)}async getTaskResult(e,t,r){return this._client.getTaskResult({taskId:e},t,r)}async listTasks(e,t){return this._client.listTasks(e?{cursor:e}:void 0,t)}async cancelTask(e,t){return this._client.cancelTask({taskId:e},t)}requestStream(e,t,r){return this._client.requestStream(e,t,r)}}function et(s,e,t){if(!s)throw new Error(`${t} does not support task creation (required for ${e})`);switch(e){case"tools/call":if(!s.tools?.call)throw new Error(`${t} does not support task creation for tools/call (required for ${e})`);break}}function tt(s,e,t){if(!s)throw new Error(`${t} does not support task creation (required for ${e})`);switch(e){case"sampling/createMessage":if(!s.sampling?.createMessage)throw new Error(`${t} does not support task creation for sampling/createMessage (required for ${e})`);break;case"elicitation/create":if(!s.elicitation?.create)throw new Error(`${t} does not support task creation for elicitation/create (required for ${e})`);break}}function O(s,e){if(!(!s||e===null||typeof e!="object")){if(s.type==="object"&&s.properties&&typeof s.properties=="object"){const t=e,r=s.properties;for(const o of Object.keys(r)){const a=r[o];t[o]===void 0&&Object.prototype.hasOwnProperty.call(a,"default")&&(t[o]=a.default),t[o]!==void 0&&O(a,t[o])}}if(Array.isArray(s.anyOf))for(const t of s.anyOf)typeof t!="boolean"&&O(t,e);if(Array.isArray(s.oneOf))for(const t of s.oneOf)typeof t!="boolean"&&O(t,e)}}function st(s){if(!s)return{supportsFormMode:!1,supportsUrlMode:!1};const e=s.form!==void 0,t=s.url!==void 0;return{supportsFormMode:e||!e&&!t,supportsUrlMode:t}}let rt=class extends Ge{constructor(e,t){super(t),this._clientInfo=e,this._cachedToolOutputValidators=new Map,this._cachedKnownTaskTools=new Set,this._cachedRequiredTaskTools=new Set,this._listChangedDebounceTimers=new Map,this._capabilities=t?.capabilities??{},this._jsonSchemaValidator=t?.jsonSchemaValidator??new Ye,t?.listChanged&&(this._pendingListChangedConfig=t.listChanged)}_setupListChangedHandlers(e){e.tools&&this._serverCapabilities?.tools?.listChanged&&this._setupListChangedHandler("tools",Ce,e.tools,async()=>(await this.listTools()).tools),e.prompts&&this._serverCapabilities?.prompts?.listChanged&&this._setupListChangedHandler("prompts",Re,e.prompts,async()=>(await this.listPrompts()).prompts),e.resources&&this._serverCapabilities?.resources?.listChanged&&this._setupListChangedHandler("resources",Ie,e.resources,async()=>(await this.listResources()).resources)}get experimental(){return this._experimental||(this._experimental={tasks:new Xe(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=Ke(this._capabilities,e)}setRequestHandler(e,t){const o=re(e)?.method;if(!o)throw new Error("Schema is missing a method literal");let a;if(N(o)){const n=o;a=n._zod?.def?.value??n.value}else{const n=o;a=n._def?.value??n.value}if(typeof a!="string")throw new Error("Schema method literal must be a string");const i=a;if(i==="elicitation/create"){const n=async(l,f)=>{const u=C(De,l);if(!u.success){const c=u.error instanceof Error?u.error.message:String(u.error);throw new p(w.InvalidParams,`Invalid elicitation request: ${c}`)}const{params:h}=u.data;h.mode=h.mode??"form";const{supportsFormMode:m,supportsUrlMode:g}=st(this._capabilities.elicitation);if(h.mode==="form"&&!m)throw new p(w.InvalidParams,"Client does not support form-mode elicitation requests");if(h.mode==="url"&&!g)throw new p(w.InvalidParams,"Client does not support URL-mode elicitation requests");const y=await Promise.resolve(t(l,f));if(h.task){const c=C(F,y);if(!c.success){const _=c.error instanceof Error?c.error.message:String(c.error);throw new p(w.InvalidParams,`Invalid task creation result: ${_}`)}return c.data}const T=C(Fe,y);if(!T.success){const c=T.error instanceof Error?T.error.message:String(T.error);throw new p(w.InvalidParams,`Invalid elicitation result: ${c}`)}const v=T.data,d=h.mode==="form"?h.requestedSchema:void 0;if(h.mode==="form"&&v.action==="accept"&&v.content&&d&&this._capabilities.elicitation?.form?.applyDefaults)try{O(d,v.content)}catch{}return v};return super.setRequestHandler(e,n)}if(i==="sampling/createMessage"){const n=async(l,f)=>{const u=C(Ue,l);if(!u.success){const v=u.error instanceof Error?u.error.message:String(u.error);throw new p(w.InvalidParams,`Invalid sampling request: ${v}`)}const{params:h}=u.data,m=await Promise.resolve(t(l,f));if(h.task){const v=C(F,m);if(!v.success){const d=v.error instanceof Error?v.error.message:String(v.error);throw new p(w.InvalidParams,`Invalid task creation result: ${d}`)}return v.data}const y=h.tools||h.toolChoice?je:Ve,T=C(y,m);if(!T.success){const v=T.error instanceof Error?T.error.message:String(T.error);throw new p(w.InvalidParams,`Invalid sampling result: ${v}`)}return T.data};return super.setRequestHandler(e,n)}return super.setRequestHandler(e,t)}assertCapability(e,t){if(!this._serverCapabilities?.[e])throw new Error(`Server does not support ${e} (required for ${t})`)}async connect(e,t){if(await super.connect(e),e.sessionId===void 0)try{const r=await this.request({method:"initialize",params:{protocolVersion:Ee,capabilities:this._capabilities,clientInfo:this._clientInfo}},qe,t);if(r===void 0)throw new Error(`Server sent invalid initialize result: ${r}`);if(!Pe.includes(r.protocolVersion))throw new Error(`Server's protocol version is not supported: ${r.protocolVersion}`);this._serverCapabilities=r.capabilities,this._serverVersion=r.serverInfo,e.setProtocolVersion&&e.setProtocolVersion(r.protocolVersion),this._instructions=r.instructions,await this.notification({method:"notifications/initialized"}),this._pendingListChangedConfig&&(this._setupListChangedHandlers(this._pendingListChangedConfig),this._pendingListChangedConfig=void 0)}catch(r){throw this.close(),r}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}getInstructions(){return this._instructions}assertCapabilityForMethod(e){switch(e){case"logging/setLevel":if(!this._serverCapabilities?.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._serverCapabilities?.prompts)throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":case"resources/subscribe":case"resources/unsubscribe":if(!this._serverCapabilities?.resources)throw new Error(`Server does not support resources (required for ${e})`);if(e==="resources/subscribe"&&!this._serverCapabilities.resources.subscribe)throw new Error(`Server does not support resource subscriptions (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._serverCapabilities?.tools)throw new Error(`Server does not support tools (required for ${e})`);break;case"completion/complete":if(!this._serverCapabilities?.completions)throw new Error(`Server does not support completions (required for ${e})`);break}}assertNotificationCapability(e){switch(e){case"notifications/roots/list_changed":if(!this._capabilities.roots?.listChanged)throw new Error(`Client does not support roots list changed notifications (required for ${e})`);break}}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case"sampling/createMessage":if(!this._capabilities.sampling)throw new Error(`Client does not support sampling capability (required for ${e})`);break;case"elicitation/create":if(!this._capabilities.elicitation)throw new Error(`Client does not support elicitation capability (required for ${e})`);break;case"roots/list":if(!this._capabilities.roots)throw new Error(`Client does not support roots capability (required for ${e})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Client does not support tasks capability (required for ${e})`);break}}assertTaskCapability(e){et(this._serverCapabilities?.tasks?.requests,e,"Server")}assertTaskHandlerCapability(e){this._capabilities&&tt(this._capabilities.tasks?.requests,e,"Client")}async ping(e){return this.request({method:"ping"},$,e)}async complete(e,t){return this.request({method:"completion/complete",params:e},Me,t)}async setLoggingLevel(e,t){return this.request({method:"logging/setLevel",params:{level:e}},$,t)}async getPrompt(e,t){return this.request({method:"prompts/get",params:e},Ae,t)}async listPrompts(e,t){return this.request({method:"prompts/list",params:e},$e,t)}async listResources(e,t){return this.request({method:"resources/list",params:e},He,t)}async listResourceTemplates(e,t){return this.request({method:"resources/templates/list",params:e},Oe,t)}async readResource(e,t){return this.request({method:"resources/read",params:e},Ne,t)}async subscribeResource(e,t){return this.request({method:"resources/subscribe",params:e},$,t)}async unsubscribeResource(e,t){return this.request({method:"resources/unsubscribe",params:e},$,t)}async callTool(e,t=ee,r){if(this.isToolTaskRequired(e.name))throw new p(w.InvalidRequest,`Tool "${e.name}" requires task-based execution. Use client.experimental.tasks.callToolStream() instead.`);const o=await this.request({method:"tools/call",params:e},t,r),a=this.getToolOutputValidator(e.name);if(a){if(!o.structuredContent&&!o.isError)throw new p(w.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`);if(o.structuredContent)try{const i=a(o.structuredContent);if(!i.valid)throw new p(w.InvalidParams,`Structured content does not match the tool's output schema: ${i.errorMessage}`)}catch(i){throw i instanceof p?i:new p(w.InvalidParams,`Failed to validate structured content: ${i instanceof Error?i.message:String(i)}`)}}return o}isToolTask(e){return this._serverCapabilities?.tasks?.requests?.tools?.call?this._cachedKnownTaskTools.has(e):!1}isToolTaskRequired(e){return this._cachedRequiredTaskTools.has(e)}cacheToolMetadata(e){this._cachedToolOutputValidators.clear(),this._cachedKnownTaskTools.clear(),this._cachedRequiredTaskTools.clear();for(const t of e){if(t.outputSchema){const o=this._jsonSchemaValidator.getValidator(t.outputSchema);this._cachedToolOutputValidators.set(t.name,o)}const r=t.execution?.taskSupport;(r==="required"||r==="optional")&&this._cachedKnownTaskTools.add(t.name),r==="required"&&this._cachedRequiredTaskTools.add(t.name)}}getToolOutputValidator(e){return this._cachedToolOutputValidators.get(e)}async listTools(e,t){const r=await this.request({method:"tools/list",params:e},xe,t);return this.cacheToolMetadata(r.tools),r}_setupListChangedHandler(e,t,r,o){const a=Le.safeParse(r);if(!a.success)throw new Error(`Invalid ${e} listChanged options: ${a.error.message}`);if(typeof r.onChanged!="function")throw new Error(`Invalid ${e} listChanged options: onChanged must be a function`);const{autoRefresh:i,debounceMs:n}=a.data,{onChanged:l}=r,f=async()=>{if(!i){l(null,null);return}try{const h=await o();l(null,h)}catch(h){const m=h instanceof Error?h:new Error(String(h));l(m,null)}},u=()=>{if(n){const h=this._listChangedDebounceTimers.get(e);h&&clearTimeout(h);const m=setTimeout(f,n);this._listChangedDebounceTimers.set(e,m)}else f()};this.setNotificationHandler(t,u)}async sendRootsListChanged(){return this.notification({method:"notifications/roots/list_changed"})}};function U(s){return s?s instanceof Headers?Object.fromEntries(s.entries()):Array.isArray(s)?Object.fromEntries(s):{...s}:{}}function ot(s=fetch,e){return e?async(t,r)=>{const o={...e,...r,headers:r?.headers?{...U(e.headers),...U(r.headers)}:e.headers};return s(t,o)}:s}class Z extends Error{constructor(e,t){super(e),this.name="ParseError",this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line}}const B=10,at=13,I=32;function L(s){}function nt(s){if(typeof s=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");const{onEvent:e=L,onError:t=L,onRetry:r=L,onComment:o}=s,a=[];let i=!0,n,l="",f=0,u;function h(d){if(i&&(i=!1,d.charCodeAt(0)===239&&d.charCodeAt(1)===187&&d.charCodeAt(2)===191&&(d=d.slice(3))),a.length===0){const k=m(d);k!==""&&a.push(k);return}if(d.indexOf(`
2
2
  `)===-1&&d.indexOf("\r")===-1){a.push(d);return}a.push(d);const c=a.join("");a.length=0;const _=m(c);_!==""&&a.push(_)}function m(d){let c=0;if(d.indexOf("\r")===-1){let _=d.indexOf(`
3
3
  `,c);for(;_!==-1;){if(c===_){f>0&&e({id:n,event:u,data:l}),n=void 0,l="",f=0,u=void 0,c=_+1,_=d.indexOf(`
4
4
  `,c);continue}const k=d.charCodeAt(c);if(Y(d,c,k)){const S=d.charCodeAt(c+5)===I?c+6:c+5,b=d.slice(S,_);if(f===0&&d.charCodeAt(_+1)===B){e({id:n,event:u,data:b}),n=void 0,l="",u=void 0,c=_+2,_=d.indexOf(`
@@ -1 +1 @@
1
- import{B as r}from"./collections-lJhN2k9k.js";import{bN as o}from"./index-CNolBSVE.js";let n="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",l=(t=21)=>{let e="",a=crypto.getRandomValues(new Uint8Array(t|=0));for(;t--;)e+=n[a[t]&63];return e};function m(t){return`${t}_${l()}`}const s=o(r,{target:"draft-7"});export{s as B,m as g};
1
+ import{B as r}from"./collections-DHmXATua.js";import{bN as o}from"./index-D34n6J5J.js";let n="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",l=(t=21)=>{let e="",a=crypto.getRandomValues(new Uint8Array(t|=0));for(;t--;)e+=n[a[t]&63];return e};function m(t){return`${t}_${l()}`}const s=o(r,{target:"draft-7"});export{s as B,m as g};
@@ -1 +1 @@
1
- import{e as n,j as i,b$ as g,c,be as u,cH as m,cI as x,c0 as j,c1 as b,cK as N,cJ as h}from"./index-CNolBSVE.js";import{i as D}from"./X-BWV-b86T.js";function C(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(g,{"data-slot":"dialog",...t}),e[2]=t,e[3]=s):s=e[3],s}function k(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(N,{"data-slot":"dialog-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function v(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(j,{"data-slot":"dialog-portal",...t}),e[2]=t,e[3]=s):s=e[3],s}function y(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/45 backdrop-blur-[0.15px]",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(b,{"data-slot":"dialog-overlay",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function $(l){const e=n.c(6),{className:t}=l;let s;e[0]!==t?(s=c("cursor-pointer ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground","absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2","focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[0]=t,e[1]=s):s=e[1];let a,o;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(D,{}),o=i.jsx("span",{className:"sr-only",children:"Close"}),e[2]=a,e[3]=o):(a=e[2],o=e[3]);let r;return e[4]!==s?(r=i.jsxs(h,{className:s,children:[a,o]}),e[4]=s,e[5]=r):r=e[5],r}function w(l){const e=n.c(15);let t,s,a,o;e[0]!==l?({className:s,children:t,closeButtonClassName:a,...o}=l,e[0]=l,e[1]=t,e[2]=s,e[3]=a,e[4]=o):(t=e[1],s=e[2],a=e[3],o=e[4]);let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(y,{}),e[5]=r):r=e[5];let d;e[6]!==s?(d=c("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-xl border p-6 shadow-md duration-200 sm:max-w-lg",s),e[6]=s,e[7]=d):d=e[7];let f;e[8]!==a?(f=i.jsx($,{className:a}),e[8]=a,e[9]=f):f=e[9];let p;return e[10]!==t||e[11]!==o||e[12]!==d||e[13]!==f?(p=i.jsxs(v,{"data-slot":"dialog-portal",children:[r,i.jsxs(u,{"data-slot":"dialog-content",className:d,...o,children:[t,f]})]}),e[10]=t,e[11]=o,e[12]=d,e[13]=f,e[14]=p):p=e[14],p}function T(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col gap-2 text-center sm:text-left",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-header",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function R(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-footer",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function B(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-lg leading-none font-semibold",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(m,{"data-slot":"dialog-title",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function E(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-muted-foreground text-sm",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(x,{"data-slot":"dialog-description",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}export{B as D,T as a,R as b,w as c,C as d,E as e,v as f,y as g,k as h};
1
+ import{e as n,j as i,bZ as g,c,be as u,cH as m,cI as x,b_ as b,b$ as j,cK as N,cJ as h}from"./index-D34n6J5J.js";import{i as D}from"./X-i9zBn6Hn.js";function C(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(g,{"data-slot":"dialog",...t}),e[2]=t,e[3]=s):s=e[3],s}function k(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(N,{"data-slot":"dialog-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function v(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(b,{"data-slot":"dialog-portal",...t}),e[2]=t,e[3]=s):s=e[3],s}function y(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/45 backdrop-blur-[0.15px]",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(j,{"data-slot":"dialog-overlay",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function $(l){const e=n.c(6),{className:t}=l;let s;e[0]!==t?(s=c("cursor-pointer ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground","absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2","focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[0]=t,e[1]=s):s=e[1];let a,o;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(D,{}),o=i.jsx("span",{className:"sr-only",children:"Close"}),e[2]=a,e[3]=o):(a=e[2],o=e[3]);let r;return e[4]!==s?(r=i.jsxs(h,{className:s,children:[a,o]}),e[4]=s,e[5]=r):r=e[5],r}function w(l){const e=n.c(15);let t,s,a,o;e[0]!==l?({className:s,children:t,closeButtonClassName:a,...o}=l,e[0]=l,e[1]=t,e[2]=s,e[3]=a,e[4]=o):(t=e[1],s=e[2],a=e[3],o=e[4]);let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(y,{}),e[5]=r):r=e[5];let d;e[6]!==s?(d=c("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-xl border p-6 shadow-md duration-200 sm:max-w-lg",s),e[6]=s,e[7]=d):d=e[7];let f;e[8]!==a?(f=i.jsx($,{className:a}),e[8]=a,e[9]=f):f=e[9];let p;return e[10]!==t||e[11]!==o||e[12]!==d||e[13]!==f?(p=i.jsxs(v,{"data-slot":"dialog-portal",children:[r,i.jsxs(u,{"data-slot":"dialog-content",className:d,...o,children:[t,f]})]}),e[10]=t,e[11]=o,e[12]=d,e[13]=f,e[14]=p):p=e[14],p}function T(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col gap-2 text-center sm:text-left",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-header",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function R(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-footer",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function B(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-lg leading-none font-semibold",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(m,{"data-slot":"dialog-title",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function E(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-muted-foreground text-sm",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(x,{"data-slot":"dialog-description",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}export{B as D,T as a,R as b,w as c,C as d,E as e,v as f,y as g,k as h};
@@ -1 +1 @@
1
- import{e as d,j as s,cG as i,c}from"./index-CNolBSVE.js";function x(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Root,{"data-slot":"drawer",...t}),e[2]=t,e[3]=a):a=e[3],a}function v(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Trigger,{"data-slot":"drawer-trigger",...t}),e[2]=t,e[3]=a):a=e[3],a}function w(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Portal,{"data-slot":"drawer-portal",...t}),e[2]=t,e[3]=a):a=e[3],a}function b(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Close,{"data-slot":"drawer-close",...t}),e[2]=t,e[3]=a):a=e[3],a}function m(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx(i.Overlay,{"data-slot":"drawer-overlay",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function g(l){const e=d.c(12);let t,a,r;e[0]!==l?({className:a,children:t,...r}=l,e[0]=l,e[1]=t,e[2]=a,e[3]=r):(t=e[1],a=e[2],r=e[3]);let o;e[4]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(m,{}),e[4]=o):o=e[4];let n;e[5]!==a?(n=c("group/drawer-content bg-background fixed z-50 flex h-auto flex-col","data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b","data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[95vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t","data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm","data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm",a),e[5]=a,e[6]=n):n=e[6];let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx("div",{className:"bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block"}),e[7]=f):f=e[7];let u;return e[8]!==t||e[9]!==r||e[10]!==n?(u=s.jsxs(w,{"data-slot":"drawer-portal",children:[o,s.jsxs(i.Content,{"data-slot":"drawer-content",className:n,...r,children:[f,t]})]}),e[8]=t,e[9]=r,e[10]=n,e[11]=u):u=e[11],u}function h(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("flex flex-col gap-1.5 px-4 py-2",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx("div",{"data-slot":"drawer-header",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function j(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("mt-auto flex flex-col gap-2 p-4",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx("div",{"data-slot":"drawer-footer",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function D(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("text-foreground font-semibold",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx(i.Title,{"data-slot":"drawer-title",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function N(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("text-muted-foreground text-sm",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx(i.Description,{"data-slot":"drawer-description",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}export{h as D,D as a,g as b,x as c,N as d,b as e,j as f,v as g};
1
+ import{e as d,j as s,cG as i,c}from"./index-D34n6J5J.js";function x(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Root,{"data-slot":"drawer",...t}),e[2]=t,e[3]=a):a=e[3],a}function v(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Trigger,{"data-slot":"drawer-trigger",...t}),e[2]=t,e[3]=a):a=e[3],a}function w(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Portal,{"data-slot":"drawer-portal",...t}),e[2]=t,e[3]=a):a=e[3],a}function b(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Close,{"data-slot":"drawer-close",...t}),e[2]=t,e[3]=a):a=e[3],a}function m(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx(i.Overlay,{"data-slot":"drawer-overlay",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function g(l){const e=d.c(12);let t,a,r;e[0]!==l?({className:a,children:t,...r}=l,e[0]=l,e[1]=t,e[2]=a,e[3]=r):(t=e[1],a=e[2],r=e[3]);let o;e[4]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(m,{}),e[4]=o):o=e[4];let n;e[5]!==a?(n=c("group/drawer-content bg-background fixed z-50 flex h-auto flex-col","data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b","data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[95vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t","data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm","data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm",a),e[5]=a,e[6]=n):n=e[6];let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx("div",{className:"bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block"}),e[7]=f):f=e[7];let u;return e[8]!==t||e[9]!==r||e[10]!==n?(u=s.jsxs(w,{"data-slot":"drawer-portal",children:[o,s.jsxs(i.Content,{"data-slot":"drawer-content",className:n,...r,children:[f,t]})]}),e[8]=t,e[9]=r,e[10]=n,e[11]=u):u=e[11],u}function h(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("flex flex-col gap-1.5 px-4 py-2",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx("div",{"data-slot":"drawer-header",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function j(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("mt-auto flex flex-col gap-2 p-4",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx("div",{"data-slot":"drawer-footer",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function D(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("text-foreground font-semibold",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx(i.Title,{"data-slot":"drawer-title",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function N(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("text-muted-foreground text-sm",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx(i.Description,{"data-slot":"drawer-description",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}export{h as D,D as a,g as b,x as c,N as d,b as e,j as f,v as g};
@@ -0,0 +1 @@
1
+ import{e as c,j as d,df as f,dg as m,c as u,dh as g,di as x,dj as v,dk as b,dl as h,dm as w,dn as j,dp as N,dq as p,$ as z,dr as _,ds as y}from"./index-D34n6J5J.js";import{i as $}from"./ChevronDown-DGnjAtqs.js";import{i as D}from"./ChevronRight-DV9No7GF.js";import{a as M}from"./DotsVertical-Bp2tW8JI.js";function C(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=d.jsx(f,{"data-slot":"dropdown-menu",...t}),e[2]=t,e[3]=s):s=e[3],s}function T(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=d.jsx(m,{"data-slot":"dropdown-menu-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function E(a){const e=c.c(10);let t,s,o;e[0]!==a?({className:t,sideOffset:o,...s}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o):(t=e[1],s=e[2],o=e[3]);const n=o===void 0?4:o;let r;e[4]!==t?(r=u("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border p-1 shadow-md",t),e[4]=t,e[5]=r):r=e[5];let i;return e[6]!==s||e[7]!==n||e[8]!==r?(i=d.jsx(x,{children:d.jsx(v,{"data-slot":"dropdown-menu-content",sideOffset:n,className:r,...s})}),e[6]=s,e[7]=n,e[8]=r,e[9]=i):i=e[9],i}function G(a){const e=c.c(12);let t,s,o,n;e[0]!==a?({className:t,inset:s,variant:n,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=n):(t=e[1],s=e[2],o=e[3],n=e[4]);const r=n===void 0?"default":n;let i;e[5]!==t?(i=u("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-pointer items-center gap-2 rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[5]=t,e[6]=i):i=e[6];let l;return e[7]!==s||e[8]!==o||e[9]!==i||e[10]!==r?(l=d.jsx(g,{"data-slot":"dropdown-menu-item","data-inset":s,"data-variant":r,className:i,...o}),e[7]=s,e[8]=o,e[9]=i,e[10]=r,e[11]=l):l=e[11],l}function L(a){const e=c.c(13);let t,s,o,n;e[0]!==a?({className:o,children:s,checked:t,...n}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=n):(t=e[1],s=e[2],o=e[3],n=e[4]);let r;e[5]!==o?(r=u("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-lg py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",o),e[5]=o,e[6]=r):r=e[6];let i;e[7]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:d.jsx(p,{children:d.jsx($,{className:"size-4"})})}),e[7]=i):i=e[7];let l;return e[8]!==t||e[9]!==s||e[10]!==n||e[11]!==r?(l=d.jsxs(h,{"data-slot":"dropdown-menu-checkbox-item",className:r,checked:t,...n,children:[i,s]}),e[8]=t,e[9]=s,e[10]=n,e[11]=r,e[12]=l):l=e[12],l}function O(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=d.jsx(y,{"data-slot":"dropdown-menu-radio-group",...t}),e[2]=t,e[3]=s):s=e[3],s}function q(a){const e=c.c(11);let t,s,o;e[0]!==a?({className:s,children:t,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o):(t=e[1],s=e[2],o=e[3]);let n;e[4]!==s?(n=u("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-lg py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",s),e[4]=s,e[5]=n):n=e[5];let r;e[6]===Symbol.for("react.memo_cache_sentinel")?(r=d.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:d.jsx(p,{children:d.jsx(M,{className:"size-2 fill-current"})})}),e[6]=r):r=e[6];let i;return e[7]!==t||e[8]!==o||e[9]!==n?(i=d.jsxs(_,{"data-slot":"dropdown-menu-radio-item",className:n,...o,children:[r,t]}),e[7]=t,e[8]=o,e[9]=n,e[10]=i):i=e[10],i}function P(a){const e=c.c(10);let t,s,o;e[0]!==a?({className:t,inset:s,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o):(t=e[1],s=e[2],o=e[3]);let n;e[4]!==t?(n=u("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",t),e[4]=t,e[5]=n):n=e[5];let r;return e[6]!==s||e[7]!==o||e[8]!==n?(r=d.jsx(b,{"data-slot":"dropdown-menu-label","data-inset":s,className:n,...o}),e[6]=s,e[7]=o,e[8]=n,e[9]=r):r=e[9],r}function A(a){const e=c.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=u("bg-border -mx-1 my-1 h-px",t),e[3]=t,e[4]=o):o=e[4];let n;return e[5]!==s||e[6]!==o?(n=d.jsx(w,{"data-slot":"dropdown-menu-separator",className:o,...s}),e[5]=s,e[6]=o,e[7]=n):n=e[7],n}function B(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=d.jsx(j,{"data-slot":"dropdown-menu-sub",...t}),e[2]=t,e[3]=s):s=e[3],s}function F(a){const e=c.c(13);let t,s,o,n;e[0]!==a?({className:s,inset:o,children:t,...n}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=n):(t=e[1],s=e[2],o=e[3],n=e[4]);let r;e[5]!==s?(r=u("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",s),e[5]=s,e[6]=r):r=e[6];let i;e[7]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx(D,{className:"ml-auto size-4"}),e[7]=i):i=e[7];let l;return e[8]!==t||e[9]!==o||e[10]!==n||e[11]!==r?(l=d.jsxs(z,{"data-slot":"dropdown-menu-sub-trigger","data-inset":o,className:r,...n,children:[t,i]}),e[8]=t,e[9]=o,e[10]=n,e[11]=r,e[12]=l):l=e[12],l}function H(a){const e=c.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=u("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",t),e[3]=t,e[4]=o):o=e[4];let n;return e[5]!==s||e[6]!==o?(n=d.jsx(N,{"data-slot":"dropdown-menu-sub-content",className:o,...s}),e[5]=s,e[6]=o,e[7]=n):n=e[7],n}export{G as D,B as a,H as b,C as c,T as d,E as e,F as f,q as g,O as h,A as i,P as j,L as k};
@@ -1 +1 @@
1
- import{e as d,g as l,bL as p,j as s,O as u}from"./index-CNolBSVE.js";import{P as c}from"./plugin-layout-B0f9qTk_.js";import"./use-connection-DIvNoxL5.js";import"./use-collections-BTXUmiDi.js";import"./constants-D8VkIs2c.js";import"./Settings02-C88OtRRq.js";import"./index-PT6VRyBL.js";import"./use-mobile-Ctb5URy7.js";import"./X-BWV-b86T.js";function L(){const e=d.c(10);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org/$taskId/$pluginId"},e[0]=n):n=e[0];const{pluginId:m}=l(n);let i;e[1]!==m?(i=p.find(r=>r.id===m),e[1]=m,e[2]=i):i=e[2];const t=i;if(t?.renderHeader&&t?.renderEmptyState&&t?.bindingName){let r;return e[3]!==t.bindingName||e[4]!==t.renderEmptyState||e[5]!==t.renderHeader?(r=s.jsx(c,{bindingName:t.bindingName,renderHeader:t.renderHeader,renderEmptyState:t.renderEmptyState}),e[3]=t.bindingName,e[4]=t.renderEmptyState,e[5]=t.renderHeader,e[6]=r):r=e[6],r}const o=t?.LayoutComponent;if(!o){let r;return e[7]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(u,{}),e[7]=r):r=e[7],r}let a;return e[8]!==o?(a=s.jsx(o,{}),e[8]=o,e[9]=a):a=e[9],a}export{L as default};
1
+ import{e as d,g as l,bL as p,j as s,O as u}from"./index-D34n6J5J.js";import{P as c}from"./plugin-layout-l_MDXBYc.js";import"./use-connection-Cif-LY0f.js";import"./use-collections-DRlHpXQL.js";import"./constants-DDHDU3PV.js";import"./Settings02-Dm9dFDqk.js";import"./index-zDq2Zqio.js";import"./use-mobile-CxvYCzu9.js";import"./X-i9zBn6Hn.js";function L(){const e=d.c(10);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org/$taskId/$pluginId"},e[0]=n):n=e[0];const{pluginId:m}=l(n);let i;e[1]!==m?(i=p.find(r=>r.id===m),e[1]=m,e[2]=i):i=e[2];const t=i;if(t?.renderHeader&&t?.renderEmptyState&&t?.bindingName){let r;return e[3]!==t.bindingName||e[4]!==t.renderEmptyState||e[5]!==t.renderHeader?(r=s.jsx(c,{bindingName:t.bindingName,renderHeader:t.renderHeader,renderEmptyState:t.renderEmptyState}),e[3]=t.bindingName,e[4]=t.renderEmptyState,e[5]=t.renderHeader,e[6]=r):r=e[6],r}const o=t?.LayoutComponent;if(!o){let r;return e[7]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(u,{}),e[7]=r):r=e[7],r}let a;return e[8]!==o?(a=s.jsx(o,{}),e[8]=o,e[9]=a):a=e[9],a}export{L as default};