decocms 2.367.38 → 2.369.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.
- package/dist/client/assets/{AlertCircle-CVwjiL5t.js → AlertCircle-BCHNBTJj.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-BsdiWOZ_.js → ArrowUpRight-DOVZA3k4.js} +1 -1
- package/dist/client/assets/{Check-BIvjG7jh.js → Check-B34N9tsV.js} +1 -1
- package/dist/client/assets/{CheckCircle-naAuY0Am.js → CheckCircle-CFtTCxLL.js} +1 -1
- package/dist/client/assets/{ChevronDown-2DdfyPVo.js → ChevronDown-Dr50fepz.js} +1 -1
- package/dist/client/assets/{ChevronRight-Djwmm7yx.js → ChevronRight-CISMqQmL.js} +1 -1
- package/dist/client/assets/{ChevronUp-CYign-Xr.js → ChevronUp-Caidv6lK.js} +1 -1
- package/dist/client/assets/{Container-BYMVUIOR.js → Container-B1RIjk98.js} +1 -1
- package/dist/client/assets/{DotsVertical-6XBT76_0.js → DotsVertical-rWYOU3RE.js} +1 -1
- package/dist/client/assets/{FilterLines-xU-m-2To.js → FilterLines-Bdqyhomu.js} +1 -1
- package/dist/client/assets/{HardDrive-CPUYFXaj.js → HardDrive-DoscLgG-.js} +1 -1
- package/dist/client/assets/{Key01-CTY2QvpD.js → Key01-BoIyqgwL.js} +1 -1
- package/dist/client/assets/{LayoutLeft-BA4wxcAF.js → LayoutLeft-D7dJReEM.js} +1 -1
- package/dist/client/assets/{LinkExternal01-Dn8eWUjC.js → LinkExternal01-DVJRR2up.js} +1 -1
- package/dist/client/assets/{Lock01-DzYUukb5.js → Lock01-Bk5T6G6y.js} +1 -1
- package/dist/client/assets/{Monitor01-nKIM1K_1.js → Monitor01-5rN-C0di.js} +1 -1
- package/dist/client/assets/{Palette-B6NpJZ9F.js → Palette-B-cRX_Fx.js} +1 -1
- package/dist/client/assets/{Play-qd-MZyD5.js → Play-BsXLejZM.js} +1 -1
- package/dist/client/assets/{Plus-Cq_1PqM9.js → Plus-beS007Js.js} +1 -1
- package/dist/client/assets/{RefreshCcw01-CYXiv82D.js → RefreshCcw01-Dcpv3eTL.js} +1 -1
- package/dist/client/assets/{SearchMd-WZzMz_xm.js → SearchMd-CB2F2Eh5.js} +1 -1
- package/dist/client/assets/{Settings02-BGX5GQSJ.js → Settings02-DB_WZ-LQ.js} +1 -1
- package/dist/client/assets/{Shield01-Dd3PCkCh.js → Shield01-D_j6WQ24.js} +1 -1
- package/dist/client/assets/{Star01-TIrOjEGQ.js → Star01-CH8zsyZS.js} +1 -1
- package/dist/client/assets/{Stars02-BgabhO3x.js → Stars02-CH6m9NsR.js} +1 -1
- package/dist/client/assets/{Sun-BMF5NYnu.js → Sun-vCQYJllf.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-B39nOlBz.js → SwitchHorizontal01-BXOMQbPs.js} +1 -1
- package/dist/client/assets/{Tool01-CAdd6NGF.js → Tool01-B1_kF5r4.js} +1 -1
- package/dist/client/assets/{Trash01-CHrTm5S-.js → Trash01-Dv-uw8l0.js} +1 -1
- package/dist/client/assets/{Upload01-CfhmyOeM.js → Upload01-Dei9Gr0H.js} +1 -1
- package/dist/client/assets/{User01-CnVuEZ_q.js → User01-DuylSQbh.js} +1 -1
- package/dist/client/assets/{Users01-CARILaym.js → Users01-BWQyCQSo.js} +1 -1
- package/dist/client/assets/{Users03-COREII3z.js → Users03-Xhe-Woui.js} +1 -1
- package/dist/client/assets/{X-CexC7CUQ.js → X-DgjPW3BN.js} +1 -1
- package/dist/client/assets/XCircle-Kzv3aw-k.js +1 -0
- package/dist/client/assets/{XClose-BOJwjK3-.js → XClose-C8_9CjoM.js} +1 -1
- package/dist/client/assets/{Zap-DRsZpKeC.js → Zap-Co2SfCXQ.js} +1 -1
- package/dist/client/assets/{ZapSquare-rxLTzaCI.js → ZapSquare-BGWKuepx.js} +1 -1
- package/dist/client/assets/{accordion-DEFWqB9v.js → accordion-Bf2zVAiI.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-CJWirXjW.js → add-connection-dialog-wVzM7TTa.js} +1 -1
- package/dist/client/assets/agent-icon-DAOer5aY.js +1 -0
- package/dist/client/assets/{agent-icons-BMYEM-93.js → agent-icons-DNhkZE7D.js} +1 -1
- package/dist/client/assets/agents-list-DABEUXXh.js +1 -0
- package/dist/client/assets/{ai-providers-DOK2_evy.js → ai-providers-ra9PS9Te.js} +1 -1
- package/dist/client/assets/{alert-DsUJkc45.js → alert-B8IvxWyW.js} +1 -1
- package/dist/client/assets/{alert-dialog-DJnXid5j.js → alert-dialog-CBy2mP5M.js} +3 -3
- package/dist/client/assets/{auth-catchall-D2kMqSF3.js → auth-catchall-DwI_DCPg.js} +1 -1
- package/dist/client/assets/{auth-split-layout-DNx4VwCy.js → auth-split-layout-CPl1Ogax.js} +1 -1
- package/dist/client/assets/{automation-list-row-9h6JxfVT.js → automation-list-row-DPAKg98L.js} +1 -1
- package/dist/client/assets/automations-vmGkl90g.js +1 -0
- package/dist/client/assets/{avatar-ByQQ7GEH.js → avatar-CBIJBj_W.js} +1 -1
- package/dist/client/assets/{badge-Dci-e_Pw.js → badge-CXArobm8.js} +1 -1
- package/dist/client/assets/{brand-context-CQ0JpFGU.js → brand-context-BHVsDYH_.js} +1 -1
- package/dist/client/assets/{card-CqaEJI_U.js → card-CNyFBXf4.js} +1 -1
- package/dist/client/assets/{chat-context-DxSqonhB.js → chat-context-BWXApvuA.js} +1 -1
- package/dist/client/assets/{checkbox-DdM7zWwz.js → checkbox-D1Q1psVt.js} +1 -1
- package/dist/client/assets/{cli-auth-success-W0LeKzND.js → cli-auth-success-Cv251YT1.js} +1 -1
- package/dist/client/assets/collection-detail-4oC2alH8.js +1 -0
- package/dist/client/assets/{collection-display-button-Bb5eYsxS.js → collection-display-button-CxfftABc.js} +1 -1
- package/dist/client/assets/{collection-search-CZPmAdbz.js → collection-search-CtjpA7Tw.js} +1 -1
- package/dist/client/assets/{collection-search-DYkFJwme.js → collection-search-D3hp8frj.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-VrRyg9Ib.js → collection-table-wrapper-htzX5Cc-.js} +1 -1
- package/dist/client/assets/{collection-tabs-BME6pm9f.js → collection-tabs-B9KC7Uhn.js} +1 -1
- package/dist/client/assets/{collections-CuEt9akO.js → collections-CEURDRm7.js} +1 -1
- package/dist/client/assets/{command-DaAuDqUV.js → command-BTA7LUZM.js} +1 -1
- package/dist/client/assets/{connect-desktop-dialog-v3Y8dgGN.js → connect-desktop-dialog-DygjlLBa.js} +1 -1
- package/dist/client/assets/{connection-card-BY9Z3I7R.js → connection-card-4Md1PbMA.js} +1 -1
- package/dist/client/assets/connection-detail-k_WdL2vk.js +1 -0
- package/dist/client/assets/{connection-form-helpers-M4qUZwhZ.js → connection-form-helpers-DI61y2e0.js} +1 -1
- package/dist/client/assets/connections-CMhBDlPe.js +1 -0
- package/dist/client/assets/{constants-piR0edM1.js → constants-D5RCRPRT.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-DWRmePhE.js → decopilot-sse-pool-BgB0FvkR.js} +1 -1
- package/dist/client/assets/{dialog-Bg6eRMC4.js → dialog-2y75M1_6.js} +1 -1
- package/dist/client/assets/{domain-settings-CHHiS2Vl.js → domain-settings-qIsJxkrR.js} +1 -1
- package/dist/client/assets/{drawer-q5yKuLmY.js → drawer-W7QX6Ax_.js} +1 -1
- package/dist/client/assets/{dropdown-menu-TulqWZOe.js → dropdown-menu-9FoS_14a.js} +1 -1
- package/dist/client/assets/{dynamic-plugin-layout-DEIRfHv3.js → dynamic-plugin-layout-DE7Rx2Mh.js} +1 -1
- package/dist/client/assets/{empty-state-CKtqz2A5.js → empty-state-BlF5e09g.js} +1 -1
- package/dist/client/assets/{empty-state-ZqctI9xZ.js → empty-state-CRPtBPjo.js} +1 -1
- package/dist/client/assets/{extract-connection-data-BYGRbWJu.js → extract-connection-data-CtQqD73R.js} +1 -1
- package/dist/client/assets/features-6QwqoSn3.js +1 -0
- package/dist/client/assets/file-explorer-C9P9tLrr.js +2 -0
- package/dist/client/assets/{files-CXeAP3oD.js → files-B8cc-gBv.js} +1 -1
- package/dist/client/assets/{form-B-pClhzT.js → form-BVQywbIc.js} +1 -1
- package/dist/client/assets/general-CnRlBB-m.js +1 -0
- package/dist/client/assets/{generate-id-DfUEx9en.js → generate-id-CpWgmfmA.js} +1 -1
- package/dist/client/assets/{github-repo-picker-A9GOBLjA.js → github-repo-picker-DmuX5zhB.js} +1 -1
- package/dist/client/assets/{hooks-Buro5ByR.js → hooks-18b6g3fs.js} +1 -1
- package/dist/client/assets/{hover-card-CUfoIFQV.js → hover-card-DOoMOMFv.js} +1 -1
- package/dist/client/assets/index-0fMq3-pH.js +1 -0
- package/dist/client/assets/{index-BDOr2buP.js → index-8_y4UNLc.js} +1 -1
- package/dist/client/assets/{index-B_5hPR5_.js → index-B6vP9EOZ.js} +1 -1
- package/dist/client/assets/{index-C_m1_Qyy.js → index-BM33-uTI.js} +27 -27
- package/dist/client/assets/{index-DjuWoEWL.js → index-B_mvEXXb.js} +1 -1
- package/dist/client/assets/{index-Df1UV_SS.js → index-Bn5sNNK8.js} +1 -1
- package/dist/client/assets/{index-zGvFjFjO.js → index-BwE83rPX.js} +1 -1
- package/dist/client/assets/{index-CdCX0F7Y.js → index-C0gY1SEz.js} +4 -4
- package/dist/client/assets/{index-BHpJxImt.js → index-CZU3_Yg-.js} +2 -2
- package/dist/client/assets/{index-Wwb5vGkQ.js → index-Ct4M2Ud6.js} +1 -1
- package/dist/client/assets/index-D6GfXYzs.js +1 -0
- package/dist/client/assets/{index-CKs6rcu1.js → index-DHCuljhb.js} +1 -1
- package/dist/client/assets/{index-DKWbd0LS.js → index-g7KxjIc5.js} +2 -2
- package/dist/client/assets/index-k6iT8Tf1.js +1 -0
- package/dist/client/assets/{index-B55MEl-c.js → index-oIPZXuqi.js} +1 -1
- package/dist/client/assets/{index-DvIjF9DA.js → index-vupo1sDr.js} +13 -13
- package/dist/client/assets/{infiniteQueryObserver-CUomJPae.js → infiniteQueryObserver-DjZk0454.js} +1 -1
- package/dist/client/assets/{input-DHJ18fY7.js → input-DyimJ0YM.js} +1 -1
- package/dist/client/assets/{integration-icon-Bo72bKVV.js → integration-icon-D9qjqDnw.js} +1 -1
- package/dist/client/assets/{label-jUTi8Oc4.js → label-CYBEQrtl.js} +1 -1
- package/dist/client/assets/{layout-PcloJcLR.js → layout-CwSzvRV6.js} +1 -1
- package/dist/client/assets/{login-C1Yqpj4I.js → login-BwJgBWmn.js} +1 -1
- package/dist/client/assets/{members-x8tMmNra.js → members-SZUmLKla.js} +1 -1
- package/dist/client/assets/{monaco-editor-D-22abDQ.js → monaco-editor-BYDkxeGd.js} +3 -3
- package/dist/client/assets/{monitoring-stats-row-DkPBMjPc.js → monitoring-stats-row-8DFwtJdG.js} +1 -1
- package/dist/client/assets/{oauth-callback-5B-GDOKs.js → oauth-callback-D3HQSih9.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-KqAiGkB8.js → oauth-callback-ai-provider-hlYQfy41.js} +1 -1
- package/dist/client/assets/{onboarding-BQaPrCwV.js → onboarding-ClFOQyD0.js} +1 -1
- package/dist/client/assets/{org-layout-DOPcV20w.js → org-layout-CQSZYn7L.js} +1 -1
- package/dist/client/assets/{org-plugin-layout-BlQBf5vT.js → org-plugin-layout-CkozoVe-.js} +1 -1
- package/dist/client/assets/{pair-DgOi01tx.js → pair-XXkclPo3.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-qP6k2hvb.js → plugin-empty-state-DcMxNkqz.js} +1 -1
- package/dist/client/assets/{plugin-header-D3WS6Tch.js → plugin-header-RG7So6zC.js} +1 -1
- package/dist/client/assets/{plugin-layout--Nx4BaLL.js → plugin-layout-1Sg2oR8k.js} +1 -1
- package/dist/client/assets/{popover-COqcQ0Rg.js → popover-DOu91n_v.js} +1 -1
- package/dist/client/assets/{profile-DZu-CjT9.js → profile-Bu4-Eb6R.js} +1 -1
- package/dist/client/assets/project-app-view-yK_XWVMG.js +1 -0
- package/dist/client/assets/registry-D1JNm-Xx.js +2 -0
- package/dist/client/assets/{registry-layout-B6kU_bv7.js → registry-layout-BmtyLpq5.js} +3 -3
- package/dist/client/assets/{required-auth-layout-CJnuX5pr.js → required-auth-layout-tzyLq2cT.js} +1 -1
- package/dist/client/assets/{reset-password-B2Ia2er4.js → reset-password-CsA4hRoj.js} +1 -1
- package/dist/client/assets/roles-dL46UDfg.js +1 -0
- package/dist/client/assets/{search-input-BX9Kn801.js → search-input-DHqGiAAb.js} +1 -1
- package/dist/client/assets/{secrets-BEffGZyZ.js → secrets-CXaOA3bo.js} +1 -1
- package/dist/client/assets/sections-editor-AHG3CG-Y.js +1 -0
- package/dist/client/assets/{select-DAV_VIox.js → select-C7bkDnqt.js} +1 -1
- package/dist/client/assets/settings-layout-MCrWdztj.js +1 -0
- package/dist/client/assets/{settings-section-DLBjUAhp.js → settings-section-DFOkupJ0.js} +1 -1
- package/dist/client/assets/{shell-controls-CNwl3y79.js → shell-controls-jx6fo9En.js} +1 -1
- package/dist/client/assets/shell-layout-BgY4DXFm.js +1 -0
- package/dist/client/assets/{sidebar-BFp8v2I0.js → sidebar-Dne1fKYn.js} +1 -1
- package/dist/client/assets/{skeleton-tYEs8dsN.js → skeleton-BiCcS3UT.js} +1 -1
- package/dist/client/assets/{sortable.esm-vK1UhoBn.js → sortable.esm-BQrMCI5H.js} +1 -1
- package/dist/client/assets/{spinner-DLBC6d93.js → spinner-Bb25iFDc.js} +1 -1
- package/dist/client/assets/{sso-BvpZRsH4.js → sso-MK5Q0tuC.js} +1 -1
- package/dist/client/assets/{store-DMo12WtF.js → store-Cu8faowN.js} +1 -1
- package/dist/client/assets/store-registry-DYz-eLFY.js +2 -0
- package/dist/client/assets/{switch-Bmqleb0M.js → switch-STNewpCh.js} +1 -1
- package/dist/client/assets/{table-Cbi2Lt5J.js → table-BR0ZQG-N.js} +1 -1
- package/dist/client/assets/{tabs-DKgnbdu4.js → tabs-BIXB9X7f.js} +1 -1
- package/dist/client/assets/{task-status-CqP04HQ9.js → task-status-Cpj07cgX.js} +1 -1
- package/dist/client/assets/{textarea-C035ZOMR.js → textarea-Csq7UfFg.js} +1 -1
- package/dist/client/assets/{toggle-group-D_tMezdr.js → toggle-group-Cvm94FnA.js} +1 -1
- package/dist/client/assets/toolbar-BFZ_P1su.js +1 -0
- package/dist/client/assets/{tools-list-DmcpkTFh.js → tools-list-BG_WhFGX.js} +1 -1
- package/dist/client/assets/{tooltip-BeTs1OMg.js → tooltip-GbZ-ULDS.js} +1 -1
- package/dist/client/assets/{types-BZ3eurxp.js → types-BGMjh8Dq.js} +5 -5
- package/dist/client/assets/{use-ai-providers-CgowGcDz.js → use-ai-providers-CaxnWnZW.js} +1 -1
- package/dist/client/assets/{use-collections-D_7JW6dX.js → use-collections-DnQvffUs.js} +1 -1
- package/dist/client/assets/{use-connection-BbCw9KPq.js → use-connection-CRCT5mv0.js} +1 -1
- package/dist/client/assets/{use-copy-DbsD5qK3.js → use-copy-Bx-USwd1.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-DJVm-5Gn.js → use-create-virtual-mcp-DgE9-y_o.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-B4_HunOp.js → use-debounced-autosave-BBZX5k0R.js} +1 -1
- package/dist/client/assets/{use-delete-connection-B0yMHUHX.js → use-delete-connection-BXEk19GO.js} +1 -1
- package/dist/client/assets/{use-file-configs-DEsQ0trh.js → use-file-configs-D9H5_-BE.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-XJXa4_f9.js → use-infinite-scroll-D0a1rm12.js} +1 -1
- package/dist/client/assets/{use-list-state-C8eifEnv.js → use-list-state-BN7DRxUQ.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-Cxw_xwII.js → use-mcp-prompts-Bn3MJOn8.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-Cg4H0QB3.js → use-mcp-tools-BppARYHs.js} +1 -1
- package/dist/client/assets/{use-members-BB2rBOpc.js → use-members-BF_X33y-.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-CVbR4ICA.js → use-navigate-to-agent-COcSBZ_P.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-Bk4CKLSt.js → use-org-auth-client-Bu3yErl5.js} +1 -1
- package/dist/client/assets/{use-org-sso-Baws_Cb6.js → use-org-sso-Cbun5-U-.js} +1 -1
- package/dist/client/assets/{use-organization-roles-DNG5Wg-t.js → use-organization-roles-BZFkc9QW.js} +1 -1
- package/dist/client/assets/{use-organization-settings-BfJ6uqm2.js → use-organization-settings-BgjGLKnf.js} +1 -1
- package/dist/client/assets/{use-registry-connections-CRI9AlTc.js → use-registry-connections-0IoXir_p.js} +1 -1
- package/dist/client/assets/{use-secrets-CPfeyzy3.js → use-secrets-CUom62Zy.js} +1 -1
- package/dist/client/assets/{use-status-sounds-Ch0BXIj1.js → use-status-sounds-BKNm7I6l.js} +1 -1
- package/dist/client/assets/{use-view-mode-Bzy-dMu6.js → use-view-mode-CWH9EmAt.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-DXij_fSZ.js → use-virtual-mcp-DA5BI4_W.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-C-wnWXsR.js +1 -0
- package/dist/client/assets/{useRouterState-DNwJdpeR.js → useRouterState-Rq7IpB5d.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-Q-NFKrZT.js +1 -0
- package/dist/client/assets/{user-D0ZUKhOx.js → user-CpeLJRjb.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-DPGq5mgK.js → view-mode-toggle-s0VkAFh3.js} +1 -1
- package/dist/client/assets/workflow-DPBHWxQm.js +1 -0
- package/dist/client/assets/workflow-detail-Din6OWiM.js +1 -0
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +1 -1
- package/dist/server/node_modules/@opentelemetry/otlp-transformer/build/esm/generated/root.js +36 -6
- package/dist/server/node_modules/@opentelemetry/otlp-transformer/build/esm/generated/root.js.map +1 -1
- package/dist/server/node_modules/@opentelemetry/otlp-transformer/build/esm/trace/internal.js +15 -0
- package/dist/server/node_modules/@opentelemetry/otlp-transformer/build/esm/trace/internal.js.map +1 -1
- package/dist/server/node_modules/@opentelemetry/otlp-transformer/build/esnext/generated/root.js +36 -6
- package/dist/server/node_modules/@opentelemetry/otlp-transformer/build/esnext/generated/root.js.map +1 -1
- package/dist/server/node_modules/@opentelemetry/otlp-transformer/build/esnext/trace/internal.js +15 -0
- package/dist/server/node_modules/@opentelemetry/otlp-transformer/build/esnext/trace/internal.js.map +1 -1
- package/dist/server/node_modules/@opentelemetry/otlp-transformer/build/src/generated/root.js +36 -6
- package/dist/server/node_modules/@opentelemetry/otlp-transformer/build/src/generated/root.js.map +1 -1
- package/dist/server/node_modules/@opentelemetry/otlp-transformer/build/src/trace/internal.js +15 -0
- package/dist/server/node_modules/@opentelemetry/otlp-transformer/build/src/trace/internal.js.map +1 -1
- package/dist/server/node_modules/@opentelemetry/otlp-transformer/package.json +12 -14
- package/dist/server/node_modules/protobufjs/dist/light/protobuf.js +13 -10
- package/dist/server/node_modules/protobufjs/dist/light/protobuf.js.map +1 -1
- package/dist/server/node_modules/protobufjs/dist/light/protobuf.min.js +3 -3
- package/dist/server/node_modules/protobufjs/dist/light/protobuf.min.js.map +1 -1
- package/dist/server/node_modules/protobufjs/dist/minimal/protobuf.js +2 -2
- package/dist/server/node_modules/protobufjs/dist/minimal/protobuf.min.js +2 -2
- package/dist/server/node_modules/protobufjs/dist/protobuf.js +14 -55
- package/dist/server/node_modules/protobufjs/dist/protobuf.js.map +1 -1
- package/dist/server/node_modules/protobufjs/dist/protobuf.min.js +3 -3
- package/dist/server/node_modules/protobufjs/dist/protobuf.min.js.map +1 -1
- package/dist/server/node_modules/protobufjs/package.json +1 -1
- package/dist/server/node_modules/protobufjs/src/message.js +7 -3
- package/dist/server/node_modules/protobufjs/src/object.js +3 -6
- package/dist/server/node_modules/protobufjs/src/parse.js +1 -45
- package/dist/server/node_modules/protobufjs/src/type.js +1 -0
- package/package.json +1 -1
- package/dist/client/assets/ArrowNarrowLeft-C0lNfAd-.js +0 -1
- package/dist/client/assets/XCircle-D5rCjCCo.js +0 -1
- package/dist/client/assets/agent-icon-C3wnlI99.js +0 -1
- package/dist/client/assets/agents-list-B3SpQwX5.js +0 -1
- package/dist/client/assets/automations-r03D9cAA.js +0 -1
- package/dist/client/assets/collection-detail-CGNHV1EW.js +0 -1
- package/dist/client/assets/connection-detail-CGrlvist.js +0 -1
- package/dist/client/assets/connections-BV1UPzfV.js +0 -1
- package/dist/client/assets/features-D7qzU1ah.js +0 -1
- package/dist/client/assets/file-explorer-C4vwodhd.js +0 -2
- package/dist/client/assets/general-BHrzNm6e.js +0 -1
- package/dist/client/assets/index-2vcb4P4k.js +0 -1
- package/dist/client/assets/index-BPYCGyhU.js +0 -1
- package/dist/client/assets/index-RQIiwepL.js +0 -1
- package/dist/client/assets/project-app-view-CbzbFEPu.js +0 -1
- package/dist/client/assets/registry-10Lvnw38.js +0 -2
- package/dist/client/assets/roles-Dnu1ERmI.js +0 -1
- package/dist/client/assets/sections-editor-6afDX4oI.js +0 -1
- package/dist/client/assets/settings-layout-Cs92wKZb.js +0 -1
- package/dist/client/assets/shell-layout-BZaILYv9.js +0 -1
- package/dist/client/assets/store-registry-BzJ2CQJA.js +0 -2
- package/dist/client/assets/toolbar-AIIkxXjs.js +0 -1
- package/dist/client/assets/useInfiniteQuery-D0JT5WrD.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-D794zrC9.js +0 -1
- package/dist/client/assets/workflow-DkG9K0We.js +0 -1
- package/dist/client/assets/workflow-detail-CEB6a5Nl.js +0 -1
- package/dist/server/node_modules/ansi-styles/index.d.ts +0 -236
- package/dist/server/node_modules/ansi-styles/index.js +0 -223
- package/dist/server/node_modules/ansi-styles/license +0 -9
- package/dist/server/node_modules/ansi-styles/package.json +0 -54
- package/dist/server/node_modules/ansi-styles/readme.md +0 -173
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{e as ae,T as ge,j as s,B as oe,q as he,r as X,t as D,o as ue}from"./index-C_m1_Qyy.js";import{c as k,b as pe,a as re,D as le}from"./dropdown-menu-TulqWZOe.js";import{s as xe}from"./Star01-TIrOjEGQ.js";import{a as je}from"./Users03-COREII3z.js";import{G as _e,S as Ce,u as be,H as ne,W as ce,a as ye,I as Ne}from"./github-repo-picker-A9GOBLjA.js";import{b as Se,a as ve}from"./use-virtual-mcp-DXij_fSZ.js";import{P as Z}from"./index-CKs6rcu1.js";import{i as De}from"./DotsVertical-6XBT76_0.js";import{a as Ae}from"./Settings02-BGX5GQSJ.js";import{s as ke}from"./Trash01-CHrTm5S-.js";import{A as we,aj as Te}from"./agent-icon-C3wnlI99.js";import{a as ze}from"./use-navigate-to-agent-CVbR4ICA.js";import{C as Ie}from"./card-CqaEJI_U.js";import{f as Pe}from"./formatDistanceToNow-Cb2QZZJn.js";import{E as He}from"./empty-state-CKtqz2A5.js";import{u as Ee}from"./use-create-virtual-mcp-DJVm-5Gn.js";import{c as Oe,b as Ge,d as Me,f as Be,e as Fe,g as $e,a as Le,A as We}from"./alert-dialog-DJnXid5j.js";import{S as Re}from"./search-input-BX9Kn801.js";import{s as me}from"./Plus-Cq_1PqM9.js";import"./Check-BIvjG7jh.js";import"./ChevronRight-Djwmm7yx.js";import"./constants-piR0edM1.js";import"./dialog-Bg6eRMC4.js";import"./X-CexC7CUQ.js";import"./RefreshCcw01-CYXiv82D.js";import"./collection-search-CZPmAdbz.js";import"./SearchMd-WZzMz_xm.js";import"./checkbox-DdM7zWwz.js";import"./use-connection-BbCw9KPq.js";import"./use-collections-D_7JW6dX.js";import"./Lock01-DzYUukb5.js";import"./use-mcp-tools-Cg4H0QB3.js";import"./extract-connection-data-BYGRbWJu.js";import"./generate-id-DfUEx9en.js";import"./collections-CuEt9akO.js";import"./sidebar-BFp8v2I0.js";import"./LayoutLeft-BA4wxcAF.js";import"./tooltip-BeTs1OMg.js";import"./AlertCircle-CVwjiL5t.js";import"./Tool01-CAdd6NGF.js";import"./Stars02-BgabhO3x.js";import"./SwitchHorizontal01-B39nOlBz.js";import"./ArrowNarrowLeft-C0lNfAd-.js";import"./XCircle-D5rCjCCo.js";import"./ArrowUpRight-BsdiWOZ_.js";import"./ZapSquare-rxLTzaCI.js";import"./CheckCircle-naAuY0Am.js";import"./ChevronDown-2DdfyPVo.js";import"./ChevronUp-CYign-Xr.js";import"./Container-BYMVUIOR.js";import"./FilterLines-xU-m-2To.js";import"./Palette-B6NpJZ9F.js";import"./HardDrive-CPUYFXaj.js";import"./Key01-CTY2QvpD.js";import"./LinkExternal01-Dn8eWUjC.js";import"./Monitor01-nKIM1K_1.js";import"./Sun-BMF5NYnu.js";import"./Play-qd-MZyD5.js";import"./Shield01-Dd3PCkCh.js";import"./Upload01-CfhmyOeM.js";import"./User01-CnVuEZ_q.js";import"./Users01-CARILaym.js";import"./XClose-BOJwjK3-.js";import"./Zap-DRsZpKeC.js";import"./differenceInSeconds-NQ4PDo0z.js";function de(e){const t=ae.c(27),{onCreateFromScratch:i,onCreateWebsite:j,onCreateHydrogenStore:l,onImportGitHub:y,onImportDeco:h,isCreating:o,align:S,side:c,showBetaBadge:N}=e,m=S===void 0?"end":S,[_]=ge();let u;t[0]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(je,{size:14}),t[0]=u):u=t[0];let g;t[1]!==o||t[2]!==i?(g=s.jsxs(k,{disabled:o,onClick:i,children:[u,"Create from scratch"]}),t[1]=o,t[2]=i,t[3]=g):g=t[3];let x;t[4]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(xe,{size:14}),t[4]=x):x=t[4];let C;t[5]!==o||t[6]!==j?(C=s.jsxs(k,{disabled:o,onClick:j,children:[x,"Start Website"]}),t[5]=o,t[6]=j,t[7]=C):C=t[7];let d;t[8]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx("img",{src:Ce,alt:"",className:"size-3.5 object-contain"}),t[8]=d):d=t[8];let a;t[9]!==o||t[10]!==l?(a=s.jsxs(k,{disabled:o,onClick:l,children:[d,"Create Shopify Headless Store"]}),t[9]=o,t[10]=l,t[11]=a):a=t[11];let n;t[12]!==y||t[13]!==_.experimental_vibecode||t[14]!==N?(n=_.experimental_vibecode&&s.jsxs(k,{onClick:y,children:[s.jsx(_e,{className:"size-3.5"}),"Import from GitHub",N&&s.jsx("span",{className:"ml-auto text-[10px] font-medium text-muted-foreground bg-muted rounded px-1 py-0.5",children:"Beta"})]}),t[12]=y,t[13]=_.experimental_vibecode,t[14]=N,t[15]=n):n=t[15];let p;t[16]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"deco.cx",className:"size-3.5"}),t[16]=p):p=t[16];let r;t[17]!==h?(r=s.jsxs(k,{onClick:h,children:[p,"Import from deco.cx"]}),t[17]=h,t[18]=r):r=t[18];let f;return t[19]!==m||t[20]!==c||t[21]!==r||t[22]!==g||t[23]!==C||t[24]!==a||t[25]!==n?(f=s.jsxs(pe,{side:c,align:m,className:"w-48",children:[g,C,a,n,r]}),t[19]=m,t[20]=c,t[21]=r,t[22]=g,t[23]=C,t[24]=a,t[25]=n,t[26]=f):f=t[26],f}function Ve(e){const t=ae.c(44),{project:i,onDeleteClick:j}=e,l=ze();let y;t[0]!==l||t[1]!==i.id?(y=()=>l(i.id),t[0]=l,t[1]=i.id,t[2]=y):y=t[2];let h;t[3]!==i.title||t[4]!==y?(h=s.jsx("button",{type:"button",onClick:y,className:"absolute inset-0 z-0","aria-label":i.title}),t[3]=i.title,t[4]=y,t[5]=h):h=t[5];let o;t[6]!==i.icon||t[7]!==i.title?(o=s.jsx(we,{icon:i.icon,name:i.title,size:"sm",className:"shrink-0 shadow-sm"}),t[6]=i.icon,t[7]=i.title,t[8]=o):o=t[8];let S;t[9]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(re,{asChild:!0,children:s.jsx(oe,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",children:s.jsx(De,{size:20})})}),t[9]=S):S=t[9];let c;t[10]!==l||t[11]!==i.id?(c=()=>l(i.id,{search:{main:"settings"}}),t[10]=l,t[11]=i.id,t[12]=c):c=t[12];let N;t[13]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(Ae,{size:16}),t[13]=N):N=t[13];let m;t[14]!==c?(m=s.jsxs(k,{onClick:c,children:[N,"Settings"]}),t[14]=c,t[15]=m):m=t[15];let _;t[16]!==j?(_=j&&s.jsxs(k,{variant:"destructive",onClick:A=>{A.stopPropagation(),j(A)},children:[s.jsx(ke,{size:16}),"Delete"]}),t[16]=j,t[17]=_):_=t[17];let u;t[18]!==m||t[19]!==_?(u=s.jsx("div",{className:"relative z-10 pointer-events-auto transition-opacity sm:opacity-0 sm:group-hover:opacity-100",children:s.jsxs(le,{children:[S,s.jsxs(pe,{align:"end",children:[m,_]})]})}),t[18]=m,t[19]=_,t[20]=u):u=t[20];let g;t[21]!==o||t[22]!==u?(g=s.jsxs("div",{className:"flex items-start justify-between",children:[o,u]}),t[21]=o,t[22]=u,t[23]=g):g=t[23];let x;t[24]!==i.title?(x=s.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:i.title}),t[24]=i.title,t[25]=x):x=t[25];const C=i.description||"No description";let d;t[26]!==C?(d=s.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:C}),t[26]=C,t[27]=d):d=t[27];let a;t[28]!==x||t[29]!==d?(a=s.jsxs("div",{className:"flex flex-col gap-1",children:[x,d]}),t[28]=x,t[29]=d,t[30]=a):a=t[30];let n;t[31]!==g||t[32]!==a?(n=s.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[g,a]}),t[31]=g,t[32]=a,t[33]=n):n=t[33];let p;t[34]!==i.updated_at?(p=Pe(new Date(i.updated_at),{addSuffix:!0}),t[34]=i.updated_at,t[35]=p):p=t[35];let r;t[36]!==p?(r=s.jsx("div",{className:"border-t border-border mt-auto",children:s.jsx("div",{className:"h-10 flex items-center px-4.5",children:s.jsx("p",{className:"text-xs text-muted-foreground",children:p})})}),t[36]=p,t[37]=r):r=t[37];let f;t[38]!==n||t[39]!==r?(f=s.jsxs("div",{className:"flex flex-col flex-1 pointer-events-none",children:[n,r]}),t[38]=n,t[39]=r,t[40]=f):f=t[40];let v;return t[41]!==f||t[42]!==h?(v=s.jsxs(Ie,{className:"relative transition-colors group overflow-hidden flex flex-col h-full hover:bg-muted/50",children:[h,f]}),t[41]=f,t[42]=h,t[43]=v):v=t[43],v}function is(){const e=ae.c(71),{org:t}=he(),i=Se(),j=ve(),[l,y]=X.useState("");let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h={navigateOnCreate:!0},e[0]=h):h=e[0];const{createVirtualMCP:o,isCreating:S}=Ee(h),{createFromTemplate:c,isCreating:N}=be(),[m,_]=X.useState(null),[u,g]=X.useState(!1),[x,C]=X.useState(!1);let d,a,n,p,r,f,v;if(e[1]!==j||e[2]!==i||e[3]!==c||e[4]!==o||e[5]!==m||e[6]!==S||e[7]!==N||e[8]!==t||e[9]!==l){const V=l.toLowerCase(),se=i.filter(b=>b.id!==t.id&&(b.title.toLowerCase().includes(V)||b.description?.toLowerCase().includes(V)));let Y;e[17]!==j||e[18]!==m?(Y=async()=>{if(!m)return;const{id:b,title:fe}=m;_(null);try{await j.delete.mutateAsync(b),D("agent_deleted",{agent_id:b,source:"agents_list"}),ue.success(`Deleted "${fe}"`)}catch{}},e[17]=j,e[18]=m,e[19]=Y):Y=e[19],p=Y,n=Z,a=Z.Content,d=Z.Body;let q;e[20]===Symbol.for("react.memo_cache_sentinel")?(q=s.jsx(Z.Title,{children:"Agents"}),e[20]=q):q=e[20];let K;e[21]===Symbol.for("react.memo_cache_sentinel")?(K=b=>{b.key==="Escape"&&(y(""),b.target.blur())},e[21]=K):K=e[21];let O;e[22]!==l?(O=s.jsx(Re,{value:l,onChange:y,placeholder:"Search for an agent...",className:"w-full md:w-[375px]",onKeyDown:K}),e[22]=l,e[23]=O):O=e[23];let J;e[24]===Symbol.for("react.memo_cache_sentinel")?(J=s.jsx(re,{asChild:!0,children:s.jsxs(oe,{size:"sm",children:[s.jsx(me,{size:14}),"Create Agent"]})}),e[24]=J):J=e[24];let G;e[25]!==o?(G=()=>{D("agent_create_clicked",{source:"agents_list",method:"scratch"}),o()},e[25]=o,e[26]=G):G=e[26];let M,B;e[27]!==c?(M=()=>{D("agent_create_clicked",{source:"agents_list",method:"website"}),c(ce)},B=()=>{D("agent_create_clicked",{source:"agents_list",method:"hydrogen"}),c(ne)},e[27]=c,e[28]=M,e[29]=B):(M=e[28],B=e[29]);let Q,U;e[30]===Symbol.for("react.memo_cache_sentinel")?(Q=()=>{D("agent_create_clicked",{source:"agents_list",method:"github"}),C(!0)},U=()=>{D("agent_create_clicked",{source:"agents_list",method:"deco"}),g(!0)},e[30]=Q,e[31]=U):(Q=e[30],U=e[31]);const ie=S||N;let F;e[32]!==M||e[33]!==B||e[34]!==ie||e[35]!==G?(F=s.jsxs(le,{children:[J,s.jsx(de,{onCreateFromScratch:G,onCreateWebsite:M,onCreateHydrogenStore:B,onImportGitHub:Q,onImportDeco:U,isCreating:ie,align:"end"})]}),e[32]=M,e[33]=B,e[34]=ie,e[35]=G,e[36]=F):F=e[36],e[37]!==F||e[38]!==O?(r=s.jsxs("div",{className:"flex flex-col gap-6",children:[q,s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[O,F]})]}),e[37]=F,e[38]=O,e[39]=r):r=e[39],f=se.length===0&&s.jsx("div",{className:"flex items-center justify-center py-20",children:s.jsx(He,{image:s.jsx(Te,{size:48,className:"text-muted-foreground"}),title:l?"No agents found":"No agents yet",description:l?`No agents match "${l}"`:"Create an agent to get started.",actions:!l&&s.jsxs(le,{children:[s.jsx(re,{asChild:!0,children:s.jsxs(oe,{size:"sm",children:[s.jsx(me,{size:14}),"Create Agent"]})}),s.jsx(de,{onCreateFromScratch:()=>{D("agent_create_clicked",{source:"agents_list_empty",method:"scratch"}),o()},onCreateWebsite:()=>{D("agent_create_clicked",{source:"agents_list_empty",method:"website"}),c(ce)},onCreateHydrogenStore:()=>{D("agent_create_clicked",{source:"agents_list_empty",method:"hydrogen"}),c(ne)},onImportGitHub:()=>{D("agent_create_clicked",{source:"agents_list_empty",method:"github"}),C(!0)},onImportDeco:()=>{D("agent_create_clicked",{source:"agents_list_empty",method:"deco"}),g(!0)},isCreating:S||N,align:"center",showBetaBadge:!0})]})})}),v=se.length>0&&s.jsxs("div",{className:"mt-6 @container",children:[s.jsx("h3",{className:"text-sm font-medium text-muted-foreground mb-3",children:"Agents"}),s.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:se.map(b=>s.jsx(Ve,{project:b,onDeleteClick:()=>_({id:b.id,title:b.title})},b.id))})]}),e[1]=j,e[2]=i,e[3]=c,e[4]=o,e[5]=m,e[6]=S,e[7]=N,e[8]=t,e[9]=l,e[10]=d,e[11]=a,e[12]=n,e[13]=p,e[14]=r,e[15]=f,e[16]=v}else d=e[10],a=e[11],n=e[12],p=e[13],r=e[14],f=e[15],v=e[16];let A;e[40]!==d||e[41]!==r||e[42]!==f||e[43]!==v?(A=s.jsxs(d,{children:[r,f,v]}),e[40]=d,e[41]=r,e[42]=f,e[43]=v,e[44]=A):A=e[44];let w;e[45]!==a||e[46]!==A?(w=s.jsx(a,{children:A}),e[45]=a,e[46]=A,e[47]=w):w=e[47];let T;e[48]!==x?(T=s.jsx(ye,{open:x,onOpenChange:C}),e[48]=x,e[49]=T):T=e[49];let z;e[50]!==u?(z=s.jsx(Ne,{open:u,onOpenChange:g}),e[50]=u,e[51]=z):z=e[51];const ee=!!m;let $;e[52]===Symbol.for("react.memo_cache_sentinel")?($=V=>!V&&_(null),e[52]=$):$=e[52];let L;e[53]===Symbol.for("react.memo_cache_sentinel")?(L=s.jsx(Oe,{children:"Delete Agent?"}),e[53]=L):L=e[53];const te=m?.title;let I;e[54]!==te?(I=s.jsxs(Ge,{children:[L,s.jsxs(Me,{children:["This action cannot be undone. This will permanently delete"," ",s.jsx("span",{className:"font-medium text-foreground",children:te}),"."]})]}),e[54]=te,e[55]=I):I=e[55];let W;e[56]===Symbol.for("react.memo_cache_sentinel")?(W=s.jsx(Be,{children:"Cancel"}),e[56]=W):W=e[56];let P;e[57]!==p?(P=s.jsxs(Fe,{children:[W,s.jsx($e,{onClick:p,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),e[57]=p,e[58]=P):P=e[58];let H;e[59]!==I||e[60]!==P?(H=s.jsxs(Le,{children:[I,P]}),e[59]=I,e[60]=P,e[61]=H):H=e[61];let E;e[62]!==H||e[63]!==ee?(E=s.jsx(We,{open:ee,onOpenChange:$,children:H}),e[62]=H,e[63]=ee,e[64]=E):E=e[64];let R;return e[65]!==n||e[66]!==E||e[67]!==w||e[68]!==T||e[69]!==z?(R=s.jsxs(n,{children:[w,T,z,E]}),e[65]=n,e[66]=E,e[67]=w,e[68]=T,e[69]=z,e[70]=R):R=e[70],R}export{is as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{e as L,q as R,f as T,r as M,j as o,B as $,t as A}from"./index-C_m1_Qyy.js";import{s as q}from"./Plus-Cq_1PqM9.js";import{i as S}from"./Zap-DRsZpKeC.js";import{S as D}from"./search-input-BX9Kn801.js";import{P as l}from"./index-CKs6rcu1.js";import{E as b}from"./empty-state-CKtqz2A5.js";import{c as O,A as V}from"./automation-list-row-9h6JxfVT.js";import{a as F}from"./use-navigate-to-agent-CVbR4ICA.js";import{h as G}from"./constants-piR0edM1.js";import{b as H}from"./use-virtual-mcp-DXij_fSZ.js";import"./SearchMd-WZzMz_xm.js";import"./sidebar-BFp8v2I0.js";import"./LayoutLeft-BA4wxcAF.js";import"./tooltip-BeTs1OMg.js";import"./X-CexC7CUQ.js";import"./alert-dialog-DJnXid5j.js";import"./dropdown-menu-TulqWZOe.js";import"./Check-BIvjG7jh.js";import"./ChevronRight-Djwmm7yx.js";import"./DotsVertical-6XBT76_0.js";import"./agent-icon-C3wnlI99.js";import"./AlertCircle-CVwjiL5t.js";import"./Tool01-CAdd6NGF.js";import"./Stars02-BgabhO3x.js";import"./SwitchHorizontal01-B39nOlBz.js";import"./RefreshCcw01-CYXiv82D.js";import"./ArrowNarrowLeft-C0lNfAd-.js";import"./XCircle-D5rCjCCo.js";import"./ArrowUpRight-BsdiWOZ_.js";import"./ZapSquare-rxLTzaCI.js";import"./Users03-COREII3z.js";import"./CheckCircle-naAuY0Am.js";import"./ChevronDown-2DdfyPVo.js";import"./ChevronUp-CYign-Xr.js";import"./Container-BYMVUIOR.js";import"./FilterLines-xU-m-2To.js";import"./Star01-TIrOjEGQ.js";import"./Palette-B6NpJZ9F.js";import"./HardDrive-CPUYFXaj.js";import"./Key01-CTY2QvpD.js";import"./LinkExternal01-Dn8eWUjC.js";import"./Lock01-DzYUukb5.js";import"./Monitor01-nKIM1K_1.js";import"./Sun-BMF5NYnu.js";import"./Play-qd-MZyD5.js";import"./Settings02-BGX5GQSJ.js";import"./Shield01-Dd3PCkCh.js";import"./Trash01-CHrTm5S-.js";import"./Upload01-CfhmyOeM.js";import"./User01-CnVuEZ_q.js";import"./Users01-CARILaym.js";import"./XClose-BOJwjK3-.js";import"./use-collections-D_7JW6dX.js";function Jt(){const t=L.c(16),{org:m}=R(),{data:_}=O(void 0),u=_===void 0?[]:_,B=H(),k=F(),d=T(),[f,E]=M.useState(""),g=f.toLowerCase(),C=new Map(B.map(J)),N=u.filter(e=>{if(!g||e.name.toLowerCase().includes(g))return!0;if(e.virtual_mcp_id){const a=C.get(e.virtual_mcp_id);if(a&&a.title.toLowerCase().includes(g))return!0}return!1}),P=(e,a)=>{const y=a&&C.has(a)?a:G(m.id);A("automations_list_row_clicked",{automation_id:e,agent_id:y,source:"settings_automations"}),k(y,{search:{main:"automation:"+e}})};let n;t[0]!==d||t[1]!==m.slug?(n=()=>{A("automations_empty_state_browse_agents_clicked"),d({to:"/$org/settings/agents",params:{org:m.slug}})},t[0]=d,t[1]=m.slug,t[2]=n):n=t[2];const z=n,x=l,h=l,j=l;let p;t[3]===Symbol.for("react.memo_cache_sentinel")?(p=o.jsx(l.Title,{children:"Automations"}),t[3]=p):p=t[3];const v=u.length>0&&o.jsx(D,{value:f,onChange:E,placeholder:"Search automations...",className:"w-full md:w-[375px]"});let i;t[4]!==v?(i=o.jsxs("div",{className:"flex flex-col gap-6",children:[p,v]}),t[4]=v,t[5]=i):i=t[5];const w=u.length===0?o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(b,{image:o.jsx(S,{size:48,className:"text-muted-foreground"}),title:"No automations yet",description:"Automations are created per agent. Open an agent and add one from its Automations tab.",actions:o.jsxs($,{size:"sm",onClick:z,children:[o.jsx(q,{size:14}),"Browse agents"]})})}):N.length===0?o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(b,{image:o.jsx(S,{size:48,className:"text-muted-foreground"}),title:"No automations found",description:`No automations match "${f}"`})}):o.jsx("div",{className:"mt-6 rounded-xl border border-border overflow-hidden",children:N.map(e=>o.jsx(V,{automation:e,showAgent:!0,onClick:()=>P(e.id,e.virtual_mcp_id)},e.id))});let r;t[6]!==j.Body||t[7]!==i||t[8]!==w?(r=o.jsxs(j.Body,{children:[i,w]}),t[6]=j.Body,t[7]=i,t[8]=w,t[9]=r):r=t[9];let s;t[10]!==h.Content||t[11]!==r?(s=o.jsx(h.Content,{children:r}),t[10]=h.Content,t[11]=r,t[12]=s):s=t[12];let c;return t[13]!==x||t[14]!==s?(c=o.jsx(x,{children:s}),t[13]=x,t[14]=s,t[15]=c):c=t[15],c}function J(t){return[t.id,t]}export{Jt as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{J as Ke,P as te,e as C,j as t,E as Te,r as w,q as le,F as Ye,c as J,aX as Ge,l as ie,d as Qe,L as Y,B as W,o as Xe,g as ae,aY as ke}from"./index-C_m1_Qyy.js";import{E as Pe}from"./empty-state-CKtqz2A5.js";import{u as Ze,a as Ee}from"./use-collections-D_7JW6dX.js";import{u as ce}from"./constants-piR0edM1.js";import{F as se,a as et,b as de,d as me}from"./form-B-pClhzT.js";import{I as ue}from"./input-DHJ18fY7.js";import{T as re}from"./textarea-C035ZOMR.js";import{a as tt,b as st,V as pe}from"./layout-PcloJcLR.js";import{S as nt,W as ot,a as rt}from"./index-Wwb5vGkQ.js";import{g as lt,M as it,b as je}from"./types-BZ3eurxp.js";import{A as at,a as ct,b as dt}from"./alert-DsUJkc45.js";import{S as be,a as Ne,b as ve,c as Se,d as ne}from"./select-DAV_VIox.js";import{c as mt,b as ye,T as we,a as Ce}from"./tooltip-BeTs1OMg.js";import{i as ut}from"./AlertCircle-CVwjiL5t.js";import{y as pt,E as xt,X as ft,Y as ht,Z as gt,_ as Ie}from"./agent-icon-C3wnlI99.js";import{a as jt}from"./RefreshCcw01-CYXiv82D.js";import{i as bt}from"./Play-qd-MZyD5.js";import{i as Nt}from"./ChevronRight-Djwmm7yx.js";import{O as vt,M as St}from"./index-DjuWoEWL.js";import{g as yt}from"./connection-slug-eyAPH6o3.js";import{u as wt,T as Ct}from"./tools-list-DmcpkTFh.js";import{a as _e,u as Ae}from"./use-connection-BbCw9KPq.js";import{b as It}from"./use-mcp-tools-Cg4H0QB3.js";import{c as $t}from"./content-blocks-o63cs2vh.js";import{I as $e}from"./integration-icon-Bo72bKVV.js";import{f as Tt,k as kt}from"./chat-context-DxSqonhB.js";import{u as Pt}from"./shell-layout-BZaILYv9.js";import{M as Et}from"./monaco-editor-D-22abDQ.js";import{E as _t}from"./empty-state-ZqctI9xZ.js";import{n as At}from"./Container-BYMVUIOR.js";import"./label-jUTi8Oc4.js";import"./index-CKs6rcu1.js";import"./sidebar-BFp8v2I0.js";import"./LayoutLeft-BA4wxcAF.js";import"./X-CexC7CUQ.js";import"./index-DvIjF9DA.js";import"./collections-CuEt9akO.js";import"./index-BDOr2buP.js";import"./use-virtual-mcp-DXij_fSZ.js";import"./accordion-DEFWqB9v.js";import"./index-zGvFjFjO.js";import"./badge-Dci-e_Pw.js";import"./spinner-DLBC6d93.js";import"./view-mode-toggle-DPGq5mgK.js";import"./dialog-Bg6eRMC4.js";import"./index-B55MEl-c.js";import"./hover-card-CUfoIFQV.js";import"./dropdown-menu-TulqWZOe.js";import"./Check-BIvjG7jh.js";import"./DotsVertical-6XBT76_0.js";import"./Plus-Cq_1PqM9.js";import"./Tool01-CAdd6NGF.js";import"./XClose-BOJwjK3-.js";import"./index-Df1UV_SS.js";import"./create-sse-subscription-CjI9SUTI.js";import"./ChevronDown-2DdfyPVo.js";import"./ChevronUp-CYign-Xr.js";import"./Stars02-BgabhO3x.js";import"./SwitchHorizontal01-B39nOlBz.js";import"./ArrowNarrowLeft-C0lNfAd-.js";import"./XCircle-D5rCjCCo.js";import"./ArrowUpRight-BsdiWOZ_.js";import"./ZapSquare-rxLTzaCI.js";import"./Users03-COREII3z.js";import"./CheckCircle-naAuY0Am.js";import"./FilterLines-xU-m-2To.js";import"./Star01-TIrOjEGQ.js";import"./Palette-B6NpJZ9F.js";import"./HardDrive-CPUYFXaj.js";import"./Key01-CTY2QvpD.js";import"./LinkExternal01-Dn8eWUjC.js";import"./Lock01-DzYUukb5.js";import"./Monitor01-nKIM1K_1.js";import"./Sun-BMF5NYnu.js";import"./SearchMd-WZzMz_xm.js";import"./Settings02-BGX5GQSJ.js";import"./Shield01-Dd3PCkCh.js";import"./Trash01-CHrTm5S-.js";import"./Upload01-CfhmyOeM.js";import"./User01-CnVuEZ_q.js";import"./Users01-CARILaym.js";import"./Zap-DRsZpKeC.js";import"./extract-connection-data-BYGRbWJu.js";import"./generate-id-DfUEx9en.js";import"./use-registry-connections-CRI9AlTc.js";import"./use-organization-settings-BfJ6uqm2.js";import"./index-B_5hPR5_.js";import"./popover-COqcQ0Rg.js";import"./use-create-virtual-mcp-DJVm-5Gn.js";import"./use-navigate-to-agent-CVbR4ICA.js";import"./hooks-Buro5ByR.js";import"./decopilot-sse-pool-DWRmePhE.js";import"./use-ai-providers-CgowGcDz.js";import"./avatar-ByQQ7GEH.js";import"./required-auth-layout-CJnuX5pr.js";import"./useRouterState-DNwJdpeR.js";import"./use-org-sso-Baws_Cb6.js";Ke({title:te().min(1),description:te().nullable(),body:te()});function oe(s){for(const e of s.messages??[])if(e.role==="user"&&e.content?.type==="text")return e.content.text??"";return""}function Ot(){const s=window.location.pathname.split("/").filter(Boolean),e=s.findIndex(n=>n==="mcps"),o=e>=0?s[e+1]:void 0;return o?decodeURIComponent(o):void 0}function Rt(s){const e=C.c(13),{form:o}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Details"}),e[0]=n):n=e[0];let r;e[1]!==o.control?(r=t.jsxs("div",{className:"flex flex-col gap-4",children:[n,t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[t.jsx(se,{control:o.control,name:"title",render:Lt}),t.jsx(se,{control:o.control,name:"description",render:Mt})]})]}),e[1]=o.control,e[2]=r):r=e[2];let l,a;e[3]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Message"}),a=t.jsx("div",{className:"text-xs text-muted-foreground",children:"This becomes the user message in the prompt."}),e[3]=l,e[4]=a):(l=e[3],a=e[4]);let c;e[5]!==o.control?(c=t.jsxs("div",{className:"flex flex-col gap-2",children:[l,a,t.jsx(se,{control:o.control,name:"body",render:Dt})]}),e[5]=o.control,e[6]=c):c=e[6];let i;e[7]!==r||e[8]!==c?(i=t.jsxs("div",{className:"h-full py-6 flex flex-col max-w-3xl mx-auto w-full min-w-0 gap-8 overflow-y-auto px-4",children:[r,c]}),e[7]=r,e[8]=c,e[9]=i):i=e[9];let p;return e[10]!==o||e[11]!==i?(p=t.jsx(et,{...o,children:i}),e[10]=o,e[11]=i,e[12]=p):p=e[12],p}function Dt(s){const{field:e}=s;return t.jsx(de,{children:t.jsx(me,{children:t.jsx(re,{...e,value:e.value??"",placeholder:"Write the prompt message…",className:"min-h-[240px] resize-none text-base leading-relaxed font-normal rounded-xl border border-border bg-muted/20 px-4 py-3 shadow-none focus-visible:ring-0"})})})}function Mt(s){const{field:e}=s;return t.jsxs(de,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Description"}),t.jsx(me,{children:t.jsx(ue,{...e,value:e.value??"",placeholder:"Add a description…",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function Lt(s){const{field:e}=s;return t.jsxs(de,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Title"}),t.jsx(me,{children:t.jsx(ue,{...e,placeholder:"Untitled prompt",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function Ut(s){const e=C.c(36),{providerId:o,promptId:n}=s,{org:r}=le(),l=o||null;let a;e[0]!==r.id||e[1]!==r.slug||e[2]!==l?(a={connectionId:l,orgId:r.id,orgSlug:r.slug},e[0]=r.id,e[1]=r.slug,e[2]=l,e[3]=a):a=e[3];const c=ce(a),i=Ze(o,"PROMPT",n,c),p=Ee(o,"PROMPT",c),f=p.update.isPending;let u;e[4]!==i?(u=i?{title:i.title,description:i.description??null,body:oe(i)}:void 0,e[4]=i,e[5]=u):u=e[5];let h;e[6]!==u?(h={values:u},e[6]=u,e[7]=h):h=e[7];const N=Ye(h);let T;e[8]!==N||e[9]!==i?(T=()=>{i&&N.reset({title:i.title,description:i.description??null,body:oe(i)})},e[8]=N,e[9]=i,e[10]=T):T=e[10];const _=T;let A;e[11]!==p.update||e[12]!==N||e[13]!==n?(A=N.handleSubmit(async j=>{const P=await p.update.mutateAsync({id:n,data:{title:j.title,description:j.description,arguments:[],icons:[],messages:[{role:"user",content:{type:"text",text:j.body}}]}});N.reset({title:P.title,description:P.description??null,body:oe(P)})}),e[11]=p.update,e[12]=N,e[13]=n,e[14]=A):A=e[14];const O=A;if(!i){let j;return e[15]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Pe,{title:"Prompt not found",description:"This prompt may have been deleted or you may not have access to it."})}),e[15]=j):j=e[15],j}let y;e[16]!==i.title?(y=t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:i.title}),e[16]=i.title,e[17]=y):y=e[17];let k;e[18]!==i.description?(k=i.description?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"•"}),t.jsx("span",{className:"text-xs text-muted-foreground font-normal truncate min-w-0 max-w-[20ch]",children:i.description})]}):null,e[18]=i.description,e[19]=k):k=e[19];let I;e[20]!==y||e[21]!==k?(I=t.jsx(st,{children:t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[y,k]})}),e[20]=y,e[21]=k,e[22]=I):I=e[22];let g;e[23]!==O?(g=()=>{O()},e[23]=O,e[24]=g):g=e[24];let v;e[25]!==N.formState.isDirty||e[26]!==f||e[27]!==_||e[28]!==g?(v=t.jsx(tt,{children:t.jsx(nt,{onSave:g,onUndo:_,isDirty:N.formState.isDirty,isSaving:f})}),e[25]=N.formState.isDirty,e[26]=f,e[27]=_,e[28]=g,e[29]=v):v=e[29];let S;e[30]!==N?(S=t.jsx("div",{className:"h-full",children:t.jsx(Rt,{form:N})}),e[30]=N,e[31]=S):S=e[31];let $;return e[32]!==v||e[33]!==S||e[34]!==I?($=t.jsxs(pe,{children:[I,v,S]}),e[32]=v,e[33]=S,e[34]=I,e[35]=$):$=e[35],$}function zt(s){const e=C.c(4),{itemId:o}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=Ot(),e[0]=n):n=e[0];const r=n;if(!r){let a;return e[1]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Pe,{title:"Prompt not found",description:"Missing connection information in the current route."})}),e[1]=a):a=e[1],a}let l;return e[2]!==o?(l=t.jsx(Te,{children:t.jsx(w.Suspense,{fallback:null,children:t.jsx(Ut,{providerId:r,promptId:o})})}),e[2]=o,e[3]=l):l=e[3],l}function Oe(s){const e=C.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let r;e[3]!==o?(r=J("min-w-0 overflow-hidden",o),e[3]=o,e[4]=r):r=e[4];let l;return e[5]!==n||e[6]!==r?(l=t.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",className:r,...n}),e[5]=n,e[6]=r,e[7]=l):l=e[7],l}function Re(s){const e=C.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let r;e[3]!==o?(r=J("flex items-center gap-1.5 text-sm sm:gap-2 overflow-hidden",o),e[3]=o,e[4]=r):r=e[4];let l;return e[5]!==n||e[6]!==r?(l=t.jsx("ol",{"data-slot":"breadcrumb-list",className:r,...n}),e[5]=n,e[6]=r,e[7]=l):l=e[7],l}function V(s){const e=C.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let r;e[3]!==o?(r=J("inline-flex items-center gap-1.5 min-w-0",o),e[3]=o,e[4]=r):r=e[4];let l;return e[5]!==n||e[6]!==r?(l=t.jsx("li",{"data-slot":"breadcrumb-item",className:r,...n}),e[5]=n,e[6]=r,e[7]=l):l=e[7],l}function G(s){const e=C.c(10);let o,n,r;e[0]!==s?({asChild:o,className:n,...r}=s,e[0]=s,e[1]=o,e[2]=n,e[3]=r):(o=e[1],n=e[2],r=e[3]);const l=o?Ge:"a";let a;e[4]!==n?(a=J("hover:text-foreground transition-colors truncate",n),e[4]=n,e[5]=a):a=e[5];let c;return e[6]!==l||e[7]!==r||e[8]!==a?(c=t.jsx(l,{"data-slot":"breadcrumb-link",className:a,...r}),e[6]=l,e[7]=r,e[8]=a,e[9]=c):c=e[9],c}function De(s){const e=C.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let r;e[3]!==o?(r=J("text-foreground font-medium truncate",o),e[3]=o,e[4]=r):r=e[4];let l;return e[5]!==n||e[6]!==r?(l=t.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:r,...n}),e[5]=n,e[6]=r,e[7]=l):l=e[7],l}function Q(s){const e=C.c(12);let o,n,r;e[0]!==s?({children:o,className:n,...r}=s,e[0]=s,e[1]=o,e[2]=n,e[3]=r):(o=e[1],n=e[2],r=e[3]);let l;e[4]!==n?(l=J("[&>svg]:size-3.5 text-muted-foreground opacity-50 list-none shrink-0",n),e[4]=n,e[5]=l):l=e[5];let a;e[6]!==o?(a=o??t.jsx(Nt,{}),e[6]=o,e[7]=a):a=e[7];let c;return e[8]!==r||e[9]!==l||e[10]!==a?(c=t.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:l,...r,children:a}),e[8]=r,e[9]=l,e[10]=a,e[11]=c):c=e[11],c}const Bt=s=>s.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function Ft(s){const e=C.c(11),{toolName:o,connectionId:n,siblings:r,onSelectInstance:l,onBack:a}=s;let c;e[0]!==n?(c={connectionId:n},e[0]=n,e[1]=c):c=e[1];const i=wt(c);if(!i.isAuthenticated){let u;return e[2]!==i.supportsOAuth||e[3]!==a?(u=t.jsx("div",{className:"flex h-full items-center justify-center",children:i.supportsOAuth?t.jsx(vt,{onAuthenticate:()=>a(),buttonText:"Go back to authenticate"}):t.jsx(St,{hasReadme:!1})}),e[2]=i.supportsOAuth,e[3]=a,e[4]=u):u=e[4],u}const p=`${n}:${o}`;let f;return e[5]!==n||e[6]!==l||e[7]!==r||e[8]!==p||e[9]!==o?(f=t.jsx(Vt,{toolName:o,connectionId:n,siblings:r,onSelectInstance:l},p),e[5]=n,e[6]=l,e[7]=r,e[8]=p,e[9]=o,e[10]=f):f=e[10],f}function Vt({toolName:s,connectionId:e,siblings:o,onSelectInstance:n}){const{replayId:r}=Qe({strict:!1}),l=(()=>{if(!r)return null;const d=`replay-${r}`,m=sessionStorage.getItem(d);if(!m)return null;sessionStorage.removeItem(d);try{return JSON.parse(m)}catch{return null}})(),a=(()=>{if(!l)return null;const d={};for(const[m,b]of Object.entries(l))b!==null&&typeof b=="object"?d[m]=JSON.stringify(b,null,2):d[m]=b;return d})(),[c,i]=w.useState(a??{}),[p,f]=w.useState(l?JSON.stringify(l,null,2):"{}"),[u,h]=w.useState(null),[N,T]=w.useState(null),[_,A]=w.useState(null),[O,y]=w.useState(null),[k,I]=w.useState(!1),[g,v]=w.useState(null),{org:S}=le(),$=_e(e),j=Tt(),P=kt(),{setChatOpen:U}=Pt(),M=`${e}:${s}`,R=ce({connectionId:e,orgId:S.id,orgSlug:S.slug}),L=It({client:R}),x=L.data?.tools?.find(d=>d.name===s),E=lt(x?._meta),z=d=>{if(!j)return;const m=$t(d.content);m.content.length>0&&(U(!0),j.sendMessage({tiptapDoc:m}))},[D,X]=w.useState("json"),[Me,Le]=w.useState(!1);E&&!Me&&(X("ui"),Le(!0));const xe=x?.inputSchema?.properties,fe=xe?Object.keys(xe):[],q=fe.length>0,H={};if(q&&x?.inputSchema?.properties)for(const d of fe)H[d]=x.inputSchema.required?.includes(d)?"":void 0;const Z=d=>Object.prototype.hasOwnProperty.call(c,d),Ue=async()=>{I(!0),y(null),h(null),T(null),A(null),v(null);const d=performance.now();try{if(!R)throw new Error("MCP client is not available");const m=q?{...H,...c}:(()=>{const B=p.trim();if(!B)return{};const F=JSON.parse(B);if(F&&typeof F=="object")return F;throw new Error("Raw JSON input must be an object.")})();q&&x?.inputSchema?.properties&&Object.entries(x.inputSchema.properties).forEach(([B,F])=>{if((F.type==="object"||F.type==="array")&&typeof m[B]=="string")try{m[B]=JSON.parse(m[B])}catch{}});const b=await R.callTool({name:s,arguments:m}),K=b.structuredContent??b,qe=performance.now(),We=Math.round(qe-d);h(K),T(b),A(m);const He=JSON.stringify(K),ge=new TextEncoder().encode(He).length;v({duration:`${We}ms`,bytes:`${ge} bytes`,tokens:`~${Math.ceil(ge/4)} tokens`,cost:"$0.0000"})}catch(m){const b=m instanceof Error?m.message:String(m);y(b||"Unknown error occurred");const K=performance.now();v({duration:`${Math.round(K-d)}ms`})}finally{I(!1)}},ee=(d,m)=>{i(b=>({...b,[d]:m}))},ze=()=>{h(null),T(null),A(null),y(null),v(null)},Be=x?.name??Bt(s),Fe=t.jsx(Oe,{children:t.jsxs(Re,{children:[t.jsx(V,{children:t.jsx(G,{asChild:!0,children:t.jsx(Y,{to:"/$org/settings/connections",params:{org:S.slug},children:"Connections"})})}),t.jsx(Q,{}),$&&t.jsxs(t.Fragment,{children:[t.jsx(V,{children:t.jsx(G,{asChild:!0,children:t.jsx(Y,{to:"/$org/settings/connections/$appSlug",params:{org:S.slug,appSlug:yt($)},search:{tab:"tools"},children:$.title})})}),t.jsx(Q,{})]}),t.jsx(V,{children:t.jsx(De,{children:Be})})]})}),he=o.length>1&&t.jsxs(be,{value:e,onValueChange:n,children:[t.jsx(Ne,{className:"h-8 w-auto min-w-[200px]",children:t.jsx(ve,{})}),t.jsx(Se,{children:o.map(d=>t.jsx(ne,{value:d.id,children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx($e,{icon:d.icon,name:d.title,size:"xs",className:"shrink-0"}),d.title]})},d.id))})]}),Ve=t.jsxs("div",{className:"flex flex-col p-6 gap-4 overflow-auto",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h2",{className:"text-sm font-semibold text-foreground uppercase tracking-wide",children:"Parameters"}),x?.inputSchema?.required&&x.inputSchema.required.length>0&&t.jsxs("span",{className:"text-xs text-muted-foreground",children:[t.jsx("span",{className:"text-red-500",children:"*"})," Required"]})]}),t.jsx("div",{className:"space-y-4",children:q&&x?.inputSchema?.properties?Object.entries(x.inputSchema.properties).map(([d,m])=>t.jsxs("div",{className:"space-y-2",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("label",{className:"text-sm font-medium leading-none flex items-center gap-1.5",children:[d,x.inputSchema?.required?.includes(d)&&t.jsx("span",{className:"text-red-500 text-xs",children:"*"})]}),t.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:m.type})]}),m.description&&t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:m.description}),m.type==="object"||m.type==="array"?t.jsx(re,{className:"font-mono text-xs",value:Z(d)?c[d]??"":H[d]??"",onChange:b=>ee(d,b.target.value),placeholder:`Enter ${d} as JSON...`,rows:3}):m.type==="boolean"?t.jsxs(be,{value:Z(d)?String(c[d]??""):"",onValueChange:b=>ee(d,b==="true"),children:[t.jsx(Ne,{children:t.jsx(ve,{placeholder:"Select true or false..."})}),t.jsxs(Se,{children:[t.jsx(ne,{value:"true",children:"true"}),t.jsx(ne,{value:"false",children:"false"})]})]}):t.jsx(ue,{value:Z(d)?c[d]??"":H[d]??"",onChange:b=>ee(d,b.target.value),placeholder:`Enter ${d}...`})]},d)):x?.inputSchema&&!q?t.jsxs("div",{className:"space-y-2",children:[t.jsx("label",{className:"text-sm font-medium",children:"Raw JSON Input"}),t.jsx(re,{className:"font-mono text-xs min-h-[120px]",value:p,onChange:d=>f(d.target.value),placeholder:'e.g. { "foo": "bar" }'})]}):t.jsx("div",{className:"flex items-center justify-center p-8 bg-muted/30 rounded-lg border border-dashed border-border",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"No parameters required"})})}),t.jsx("div",{className:"flex items-center gap-2 pt-2",children:k?t.jsxs(W,{size:"sm",variant:"destructive",className:"h-8 gap-2",onClick:ze,children:[t.jsx(pt,{className:"h-3.5 w-3.5"}),"Cancel"]}):t.jsxs(W,{size:"sm",variant:"default",className:"h-8 gap-2",onClick:Ue,children:[t.jsx(bt,{className:"h-3.5 w-3.5 fill-current"}),"Execute Tool"]})})]}),Je=t.jsxs("div",{className:"flex flex-col @3xl:h-full @3xl:overflow-hidden",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 h-14 border-b border-border bg-background",children:[t.jsx("h2",{className:"text-sm font-medium text-foreground uppercase tracking-wide",children:"Result"}),t.jsxs("div",{className:"flex items-center gap-3",children:[g&&t.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(xt,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:g.duration})]}),g.tokens&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(ft,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:g.tokens})]}),g.bytes&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(ht,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:g.bytes})]}),g.cost&&t.jsx("div",{className:"flex items-center gap-1.5",children:t.jsx("span",{className:"font-mono text-foreground",children:g.cost})})]}),E&&t.jsx(mt,{children:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsxs(ye,{children:[t.jsx(we,{asChild:!0,children:t.jsx(W,{size:"icon",variant:D==="ui"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>X("ui"),children:t.jsx(gt,{size:14})})}),t.jsx(Ce,{children:"Interactive view"})]}),t.jsxs(ye,{children:[t.jsx(we,{asChild:!0,children:t.jsx(W,{size:"icon",variant:D==="json"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>X("json"),children:t.jsx(Ie,{size:14})})}),t.jsx(Ce,{children:"JSON view"})]})]})})]})]}),O&&t.jsx("div",{className:"px-6 py-4 bg-background",children:t.jsx(at,{variant:"destructive",children:t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(ut,{className:"h-4 w-4"}),t.jsx(ct,{className:"mb-0",children:"Execution Failed"})]}),t.jsx(dt,{className:"text-xs text-destructive",children:O})]})})}),t.jsx("div",{className:"relative flex-1 min-h-[400px] @3xl:min-h-0 @3xl:overflow-auto bg-muted/50",children:E&&D==="ui"&&R?t.jsx(w.Suspense,{fallback:t.jsx("div",{className:"flex items-center justify-center h-48",children:t.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[t.jsx("div",{className:"size-4 border-2 border-current border-t-transparent rounded-full animate-spin"}),t.jsx("span",{className:"text-sm",children:"Loading app..."})]})}),children:t.jsx(it,{resourceURI:E,toolInfo:x?{tool:x}:void 0,toolInput:_??void 0,toolResult:N??void 0,displayMode:"fullscreen",minHeight:je.view.minHeight,maxHeight:je.view.maxHeight,client:R,onMessage:z,onUpdateModelContext:d=>P?.setAppContext(M,d),onTeardown:()=>P?.clearAppContext(M),className:"h-full"})}):u?t.jsxs(t.Fragment,{children:[t.jsx(Et,{code:JSON.stringify(u,null,2),language:"json",height:"100%",readOnly:!0}),t.jsx(W,{size:"icon",variant:"ghost",className:"absolute top-4 right-4 h-8 w-8 bg-background/80 hover:bg-background border border-border shadow-sm",onClick:()=>{navigator.clipboard.writeText(JSON.stringify(u,null,2)),Xe.success("Copied to clipboard")},children:t.jsx(jt,{className:"h-3.5 w-3.5"})})]}):t.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-muted-foreground",children:[t.jsx(Ie,{className:"h-12 w-12 mb-3 opacity-40"}),t.jsx("p",{className:"text-sm",children:"Run the tool to see results"})]})})]});return t.jsx(pe,{breadcrumb:Fe,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden @container",children:[t.jsxs("div",{className:"flex flex-col gap-3 py-7 px-8 bg-background border-b border-border shrink-0",children:[t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx($e,{icon:$?.icon||null,name:$?.title||s,size:"xl",className:"shrink-0"}),t.jsx("h1",{className:"text-xl font-semibold tracking-tight text-foreground leading-none truncate",children:s}),t.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1 bg-muted/50 rounded-md h-fit shrink-0",children:[L.isSuccess?t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-green-500 animate-pulse shrink-0"}):L.isLoading?t.jsx(ie,{size:10,className:"animate-spin text-yellow-500 shrink-0"}):t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-red-500 shrink-0"}),t.jsx("span",{className:"font-mono text-xs capitalize text-muted-foreground leading-none",children:L.isSuccess?"ready":L.isLoading?"connecting":"error"})]}),t.jsx(Ct,{annotations:x?.annotations,_meta:x?._meta}),t.jsx("div",{className:"hidden @3xl:flex items-center ml-auto shrink-0",children:he})]}),t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:x?.description||"No description available"})]}),o.length>1&&t.jsxs("div",{className:"flex @3xl:hidden items-center gap-3 px-8 py-3 border-b border-border",children:[t.jsx("span",{className:"text-xs font-medium text-muted-foreground shrink-0",children:"Instance"}),he]}),t.jsx("div",{className:"flex-1 overflow-auto @3xl:overflow-hidden",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-[minmax(0,2fr)_minmax(0,5fr)] @3xl:h-full @3xl:grid-rows-1",children:[t.jsx("div",{className:"@3xl:border-r border-border @3xl:overflow-auto",children:Ve}),Je]})})]})})}function Jt(s){const e=C.c(10),{itemId:o,siblings:n,onBack:r}=s,[l,a]=w.useState(n[0]?.id??"");let c;e[0]!==l||e[1]!==n?(c=n.find(h=>h.id===l)?.id??n[0]?.id??"",e[0]=l,e[1]=n,e[2]=c):c=e[2];const i=c;if(!_e(i||void 0)||!i){let h;return e[3]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[t.jsx("h3",{className:"text-lg font-semibold",children:"Connection not found"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"This connection may have been deleted or you may not have access."})]})}),e[3]=h):h=e[3],h}let f;e[4]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ie,{size:32,className:"animate-spin text-muted-foreground"})}),e[4]=f):f=e[4];let u;return e[5]!==i||e[6]!==r||e[7]!==n||e[8]!==o?(u=t.jsx(w.Suspense,{fallback:f,children:t.jsx(Ft,{toolName:o,connectionId:i,siblings:n,onSelectInstance:a,onBack:r})}),e[5]=i,e[6]=r,e[7]=n,e[8]=o,e[9]=u):u=e[9],u}const qt={workflow:rt,workflow_execution:ot,prompt:zt};function Wt(){const s=C.c(9),e=ke();let o;s[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=o):o=s[0];const n=ae(o),r=decodeURIComponent(n.itemId);let l;s[1]!==n.appSlug?(l={slug:n.appSlug},s[1]=n.appSlug,s[2]=l):l=s[2];const a=Ae(l);let c;s[3]!==e.history?(c=()=>{e.history.back()},s[3]=e.history,s[4]=c):c=s[4];const i=c,p=Ht;let f;return s[5]!==i||s[6]!==r||s[7]!==a?(f=t.jsx(Jt,{itemId:r,siblings:a,onBack:i,onUpdate:p}),s[5]=i,s[6]=r,s[7]=a,s[8]=f):f=s[8],f}async function Ht(s){return Promise.resolve()}function Kt(s){return s.toLowerCase().split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function Yt(){const s=C.c(41),e=ke();let o;s[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=o):o=s[0];const n=ae(o),r=decodeURIComponent(n.collectionName),l=decodeURIComponent(n.itemId);let a;s[1]!==e.history?(a=()=>{e.history.back()},s[1]=e.history,s[2]=a):a=s[2];const c=a,{org:i}=le();let p;s[3]!==n.appSlug?(p={slug:n.appSlug},s[3]=n.appSlug,s[4]=p):p=s[4];const u=Ae(p)[0]??null,h=u?.id??"",N=h||"no-connection",T=h??null;let _;s[5]!==i.id||s[6]!==i.slug||s[7]!==T?(_={connectionId:T,orgId:i.id,orgSlug:i.slug},s[5]=i.id,s[6]=i.slug,s[7]=T,s[8]=_):_=s[8];const A=ce(_),O=Ee(N,r,A);let y;s[9]!==O||s[10]!==l?(y=async D=>{l&&await O.update.mutateAsync({id:l,data:D})},s[9]=O,s[10]=l,s[11]=y):y=s[11];const k=y;let I;s[12]!==r?(I=r?.toLowerCase(),s[12]=r,s[13]=I):I=s[13];const g=I,v=g&&qt[g];let S;s[14]!==r?(S=Kt(r),s[14]=r,s[15]=S):S=s[15];const $=S;let j;s[16]!==i.slug?(j=t.jsx(V,{children:t.jsx(G,{asChild:!0,children:t.jsx(Y,{to:"/$org/settings/connections",params:{org:i.slug},children:"Connections"})})}),s[16]=i.slug,s[17]=j):j=s[17];let P;s[18]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(Q,{}),s[18]=P):P=s[18];let U;s[19]!==r||s[20]!==u||s[21]!==i.slug||s[22]!==n.appSlug?(U=u&&t.jsxs(t.Fragment,{children:[t.jsx(V,{children:t.jsx(G,{asChild:!0,children:t.jsx(Y,{to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:n.appSlug},search:{tab:r},children:u.title})})}),t.jsx(Q,{})]}),s[19]=r,s[20]=u,s[21]=i.slug,s[22]=n.appSlug,s[23]=U):U=s[23];let M;s[24]!==$?(M=t.jsx(V,{children:t.jsx(De,{children:$})}),s[24]=$,s[25]=M):M=s[25];let R;s[26]!==U||s[27]!==M||s[28]!==j?(R=t.jsx(Oe,{children:t.jsxs(Re,{children:[j,P,U,M]})}),s[26]=U,s[27]=M,s[28]=j,s[29]=R):R=s[29];const L=R;if(v){let D;return s[30]!==v||s[31]!==c||s[32]!==k||s[33]!==l?(D=t.jsx(v,{itemId:l,onBack:c,onUpdate:k}),s[30]=v,s[31]=c,s[32]=k,s[33]=l,s[34]=D):D=s[34],D}let x;s[35]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(At,{size:36,className:"text-muted-foreground"}),s[35]=x):x=s[35];let E;s[36]!==c?(E=t.jsx(_t,{icon:x,title:"No component defined",description:"No component for this collection was defined",buttonProps:{onClick:c,children:"Go back"}}),s[36]=c,s[37]=E):E=s[37];let z;return s[38]!==L||s[39]!==E?(z=t.jsx(pe,{breadcrumb:L,children:E}),s[38]=L,s[39]=E,s[40]=z):z=s[40],z}function Gt(){const s=C.c(3);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=e):e=s[0];const o=ae(e);if(decodeURIComponent(o.collectionName)==="tools"){let a;return s[1]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(Wt,{}),s[1]=a):a=s[1],a}let l;return s[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(Yt,{}),s[2]=l):l=s[2],l}function Bn(){const s=C.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Te,{children:t.jsx(w.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ie,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Gt,{})})}),s[0]=e):e=s[0],e}export{Bn as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{J as ge,aq as Ie,aN as Ae,P as ce,ao as De,e as P,j as t,l as je,B as q,r as G,c as ve,q as J,s as $e,K as ne,f as Y,w as de,u as Pe,aO as Oe,E as Me,g as ze,D as Ve,F as Ee,G as Ue,I as Fe,aP as Re,o as Q,H as Le}from"./index-C_m1_Qyy.js";import{g as He}from"./generate-id-DfUEx9en.js";import{E as be}from"./empty-state-CKtqz2A5.js";import{E as Be,c as qe,r as We,b as Ge,d as Xe}from"./connection-form-helpers-M4qUZwhZ.js";import{c as Ke,S as Qe}from"./index-DjuWoEWL.js";import{u as Ne,T as Je}from"./tools-list-DmcpkTFh.js";import{u as Ye}from"./use-members-BB2rBOpc.js";import{A as Ze}from"./avatar-ByQQ7GEH.js";import{a as ye,b as _e,u as et}from"./use-connection-BbCw9KPq.js";import{u as re,S as tt}from"./constants-piR0edM1.js";import{b as st}from"./use-mcp-tools-Cg4H0QB3.js";import{g as ae,M as nt,a as ot}from"./types-BZ3eurxp.js";import{a as it}from"./use-mcp-prompts-Cxw_xwII.js";import{I as oe}from"./integration-icon-Bo72bKVV.js";import{s as rt}from"./Plus-Cq_1PqM9.js";import{a as Se}from"./Settings02-BGX5GQSJ.js";import{s as le}from"./Trash01-CHrTm5S-.js";import{e as at,d as lt,p as ct,c as dt,q as mt}from"./sidebar-BFp8v2I0.js";import{F as R,b as L,c as H,d as V,f as B,e as ut,a as xt}from"./form-B-pClhzT.js";import{I as W}from"./input-DHJ18fY7.js";import{u as pt,D as ft}from"./use-delete-connection-B0yMHUHX.js";import{V as ht}from"./layout-PcloJcLR.js";import{c as gt,C as jt,B as vt,a as bt,b as Nt,d as yt,e as _t}from"./monitoring-stats-row-DkPBMjPc.js";import{b as St}from"./use-virtual-mcp-DXij_fSZ.js";import{i as Ce}from"./ChevronRight-Djwmm7yx.js";import{a as we}from"./Users03-COREII3z.js";import{T as ee,a as Ct,b as te,c as wt}from"./tabs-DKgnbdu4.js";import{g as ke}from"./connection-slug-eyAPH6o3.js";import{b as kt}from"./ZapSquare-rxLTzaCI.js";import{W as Tt,w as It}from"./agent-icon-C3wnlI99.js";import{b as At}from"./Tool01-CAdd6NGF.js";import{C as Dt}from"./collection-search-CZPmAdbz.js";import{C as $t}from"./card-CqaEJI_U.js";import{B as Pt}from"./badge-Dci-e_Pw.js";import{D as Ot,a as Mt,b as zt,c as me}from"./dropdown-menu-TulqWZOe.js";import{S as ue,a as xe,b as pe,c as fe,d as F}from"./select-DAV_VIox.js";import{i as Vt}from"./CheckCircle-naAuY0Am.js";import{t as Et}from"./ChevronDown-2DdfyPVo.js";import{n as Ut}from"./Container-BYMVUIOR.js";import{s as se}from"./Star01-TIrOjEGQ.js";import{c as Ft}from"./RefreshCcw01-CYXiv82D.js";import{s as Rt}from"./XClose-BOJwjK3-.js";import"./collections-CuEt9akO.js";import"./Key01-CTY2QvpD.js";import"./index-DvIjF9DA.js";import"./index-BDOr2buP.js";import"./extract-connection-data-BYGRbWJu.js";import"./use-registry-connections-CRI9AlTc.js";import"./use-organization-settings-BfJ6uqm2.js";import"./index-B_5hPR5_.js";import"./popover-COqcQ0Rg.js";import"./tooltip-BeTs1OMg.js";import"./Check-BIvjG7jh.js";import"./SearchMd-WZzMz_xm.js";import"./use-create-virtual-mcp-DJVm-5Gn.js";import"./use-navigate-to-agent-CVbR4ICA.js";import"./use-org-auth-client-Bk4CKLSt.js";import"./User01-CnVuEZ_q.js";import"./use-collections-D_7JW6dX.js";import"./LayoutLeft-BA4wxcAF.js";import"./X-CexC7CUQ.js";import"./label-jUTi8Oc4.js";import"./alert-dialog-DJnXid5j.js";import"./index-CKs6rcu1.js";import"./AlertCircle-CVwjiL5t.js";import"./Stars02-BgabhO3x.js";import"./SwitchHorizontal01-B39nOlBz.js";import"./ArrowNarrowLeft-C0lNfAd-.js";import"./XCircle-D5rCjCCo.js";import"./ArrowUpRight-BsdiWOZ_.js";import"./ChevronUp-CYign-Xr.js";import"./DotsVertical-6XBT76_0.js";import"./FilterLines-xU-m-2To.js";import"./Palette-B6NpJZ9F.js";import"./HardDrive-CPUYFXaj.js";import"./LinkExternal01-Dn8eWUjC.js";import"./Lock01-DzYUukb5.js";import"./Monitor01-nKIM1K_1.js";import"./Sun-BMF5NYnu.js";import"./Play-qd-MZyD5.js";import"./Shield01-Dd3PCkCh.js";import"./Upload01-CfhmyOeM.js";import"./Users01-CARILaym.js";import"./Zap-DRsZpKeC.js";const Lt=ge({scopes:De(ce()).describe("List of scopes available"),stateSchema:Ie(ce(),Ae()).describe("JSON Schema (draft-07) defining the state structure")}),Ht=[{name:"MCP_CONFIGURATION",inputSchema:ge({}),outputSchema:Lt}];function Bt(s){const e=P.c(39),{instance:n,onConfigure:i,onAuthenticate:a,onDelete:o}=s;let r;e[0]!==n.id?(r={connectionId:n.id},e[0]=n.id,e[1]=r):r=e[1];const c=Ne(r),d=!(n.connection_type==="VIRTUAL")&&c.supportsOAuth&&!c.isAuthenticated,u=d?"border-destructive/50 bg-destructive/5":"border-transparent";let p;e[2]!==u?(p=ve("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 l;e[4]!==n.icon||e[5]!==n.title?(l=t.jsx(oe,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[4]=n.icon,e[5]=n.title,e[6]=l):l=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 g;e[9]!==d?(g=d&&t.jsx("span",{className:"text-xs text-destructive font-medium",children:"Needs authorization"}),e[9]=d,e[10]=g):g=e[10];let v;e[11]!==f||e[12]!==g?(v=t.jsxs("div",{className:"flex-1 min-w-0",children:[f,g]}),e[11]=f,e[12]=g,e[13]=v):v=e[13];let b;e[14]!==n||e[15]!==d||e[16]!==a?(b=d&&t.jsx(q,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:()=>a(n),children:"Authorize"}),e[14]=n,e[15]=d,e[16]=a,e[17]=b):b=e[17];let j;e[18]!==n||e[19]!==i?(j=()=>i(n),e[18]=n,e[19]=i,e[20]=j):j=e[20];let _;e[21]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(Se,{size:13}),e[21]=_):_=e[21];let w;e[22]!==j?(w=t.jsx(q,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:j,title:"Configure",children:_}),e[22]=j,e[23]=w):w=e[23];let S;e[24]!==n||e[25]!==o?(S=()=>o(n),e[24]=n,e[25]=o,e[26]=S):S=e[26];let N;e[27]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(le,{size:13}),e[27]=N):N=e[27];let k;e[28]!==S?(k=t.jsx(q,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:S,title:"Delete",children:N}),e[28]=S,e[29]=k):k=e[29];let y;e[30]!==w||e[31]!==k||e[32]!==b?(y=t.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[b,w,k]}),e[30]=w,e[31]=k,e[32]=b,e[33]=y):y=e[33];let C;return e[34]!==y||e[35]!==p||e[36]!==l||e[37]!==v?(C=t.jsxs("div",{className:p,children:[l,v,y]}),e[34]=y,e[35]=p,e[36]=l,e[37]=v,e[38]=C):C=e[38],C}function qt(s){const e=P.c(15),{instance:n,onConfigure:i}=s;let a;e[0]!==n.icon||e[1]!==n.title?(a=t.jsx(oe,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[0]=n.icon,e[1]=n.title,e[2]=a):a=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 r;e[5]!==n||e[6]!==i?(r=()=>i(n),e[5]=n,e[6]=i,e[7]=r):r=e[7];let c;e[8]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(Se,{size:13}),e[8]=c):c=e[8];let m;e[9]!==r?(m=t.jsx("div",{className:"flex items-center gap-1 shrink-0",children:t.jsx(q,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:r,title:"Configure",children:c})}),e[9]=r,e[10]=m):m=e[10];let d;return e[11]!==a||e[12]!==o||e[13]!==m?(d=t.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-transparent px-4 py-2.5 transition-colors",children:[a,o,m]}),e[11]=a,e[12]=o,e[13]=m,e[14]=d):d=e[14],d}function Wt(s){const e=P.c(25),{instances:n,onConfigure:i,onAuthenticate:a,onDelete:o,onAdd:r,isAdding:c}=s;if(n.length===0)return null;const m=n.length===1?"Instance":"Instances";let d;e[0]!==m?(d=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:m}),e[0]=m,e[1]=d):d=e[1];let u;e[2]!==c?(u=c?t.jsx(je,{size:13,className:"animate-spin"}):t.jsx(rt,{size:13}),e[2]=c,e[3]=u):u=e[3];let p;e[4]!==c||e[5]!==r||e[6]!==u?(p=t.jsxs(q,{variant:"default",size:"sm",className:"h-7 gap-1.5 text-xs",onClick:r,disabled:c,children:[u,"Add instance"]}),e[4]=c,e[5]=r,e[6]=u,e[7]=p):p=e[7];let l;e[8]!==d||e[9]!==p?(l=t.jsxs("div",{className:"px-5 py-4 border-b border-border flex items-center justify-between",children:[d,p]}),e[8]=d,e[9]=p,e[10]=l):l=e[10];let f;if(e[11]!==n||e[12]!==a||e[13]!==i||e[14]!==o){let b;e[16]!==a||e[17]!==i||e[18]!==o?(b=j=>t.jsx(G.Suspense,{fallback:t.jsx(qt,{instance:j,onConfigure:i}),children:t.jsx(Bt,{instance:j,onConfigure:i,onAuthenticate:a,onDelete:o})},j.id),e[16]=a,e[17]=i,e[18]=o,e[19]=b):b=e[19],f=n.map(b),e[11]=n,e[12]=a,e[13]=i,e[14]=o,e[15]=f}else f=e[15];let g;e[20]!==f?(g=t.jsx("div",{className:"p-2 flex flex-col gap-1",children:f}),e[20]=f,e[21]=g):g=e[21];let v;return e[22]!==l||e[23]!==g?(v=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[l,g]}),e[22]=l,e[23]=g,e[24]=v):v=e[24],v}const Gt=[{value:"7d",label:"7d"},{value:"14d",label:"14d"},{value:"30d",label:"30d"}];function Xt(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=P.c(4),{connectionId:n,orgId:i,orgSlug:a,timeframe:o}=s;let r;e[0]!==i||e[1]!==a?(r={connectionId:tt,orgId:i,orgSlug:a},e[0]=i,e[1]=a,e[2]=r):r=e[2];const c=re(r),m=Xt(o),{data:d}=$e({queryKey:ne.connectionActivity(n,o,i),queryFn:async()=>{const g=await c.callTool({name:"MONITORING_LOGS_LIST",arguments:{startDate:m.startDate.toISOString(),endDate:m.endDate.toISOString(),connectionId:n,limit:2e3,offset:0}});return g.structuredContent??g},staleTime:3e5}),u=gt(d?.logs??[],m),p=u.data,l=u.totalCalls>0;let f;return e[3]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Tool calls"}),e[3]=f):f=e[3],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:u.totalCalls.toLocaleString()}),f]}),u.totalErrors>0&&t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-destructive tabular-nums",children:u.totalErrors.toLocaleString()}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Errors"})]}),u.avgDurationMs>0&&t.jsxs("div",{children:[t.jsxs("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:[Math.round(u.avgDurationMs),"ms"]}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Avg latency"})]})]}),l?t.jsxs("div",{children:[t.jsx(jt,{config:Kt,className:"h-16 w-full",children:t.jsxs(vt,{data:p,barCategoryGap:"4%",children:[t.jsx(bt,{content:t.jsx(Nt,{labelFormatter:Yt}),cursor:{fill:"var(--muted)"}}),t.jsx(yt,{dataKey:"calls",radius:[2,2,0,0],minPointSize:1,children:p.map(Jt)})]})}),t.jsxs("div",{className:"flex justify-between px-3 mt-1 pb-3",children:[t.jsx("span",{className:"text-[10px] text-muted-foreground",children:p[0]?.label}),t.jsx("span",{className:"text-[10px] text-muted-foreground",children:p[p.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 Jt(s,e){return t.jsx(_t,{fill:s.errorRate>50?"var(--destructive)":"var(--chart-1)",fillOpacity:s.calls===0?.2:s.errorRate>50?.7:.85},`cell-${e}`)}function Yt(s,e){const n=Array.isArray(e)?e[0]:void 0;return n&&typeof n=="object"&&"payload"in n?n.payload?.label??"":""}function Zt(){const s=P.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 es(s){const e=P.c(14),{connectionId:n}=s,[i,a]=G.useState("14d"),{org:o}=J();let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Activity"})}),e[0]=r):r=e[0];let c;e[1]!==i?(c=Gt.map(l=>t.jsx("button",{type:"button",onClick:()=>a(l.value),className:ve("px-2.5 py-1 text-xs font-medium rounded-md transition-colors",i===l.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:l.label},l.value)),e[1]=i,e[2]=c):c=e[2];let m;e[3]!==c?(m=t.jsxs("div",{className:"px-5 py-4 flex items-center justify-between",children:[r,t.jsx("div",{className:"flex items-center gap-0.5 bg-muted rounded-lg p-0.5",children:c})]}),e[3]=c,e[4]=m):m=e[4];let d;e[5]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(Zt,{}),e[5]=d):d=e[5];let u;e[6]!==n||e[7]!==o.id||e[8]!==o.slug||e[9]!==i?(u=t.jsx(G.Suspense,{fallback:d,children:t.jsx(Qt,{connectionId:n,orgId:o.id,orgSlug:o.slug,timeframe:i})}),e[6]=n,e[7]=o.id,e[8]=o.slug,e[9]=i,e[10]=u):u=e[10];let p;return e[11]!==m||e[12]!==u?(p=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[m,u]}),e[11]=m,e[12]=u,e[13]=p):p=e[13],p}function ts(s){const e=P.c(15),{virtualMcp:n,org:i}=s,a=Y();let o;e[0]!==a||e[1]!==i||e[2]!==n.id?(o=()=>{const p=crypto.randomUUID();a({to:"/$org/$taskId",params:{org:i,taskId:p},search:{virtualmcpid:n.id}})},e[0]=a,e[1]=i,e[2]=n.id,e[3]=o):o=e[3];let r;e[4]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(we,{size:16}),e[4]=r):r=e[4];let c;e[5]!==n.icon||e[6]!==n.title?(c=t.jsx(oe,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:r}),e[5]=n.icon,e[6]=n.title,e[7]=c):c=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 d;e[10]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(Ce,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[10]=d):d=e[10];let u;return e[11]!==o||e[12]!==c||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:[c,m,d]}),e[11]=o,e[12]=c,e[13]=m,e[14]=u):u=e[14],u}function ss(s){const e=P.c(7),{virtualMcps:n,org:i}=s;let a;if(e[0]!==i||e[1]!==n){let r;e[3]!==i?(r=c=>t.jsx(ts,{virtualMcp:c,org:i},c.id),e[3]=i,e[4]=r):r=e[4],a=n.map(r),e[0]=i,e[1]=n,e[2]=a}else a=e[2];let o;return e[5]!==a?(o=t.jsx("div",{className:"flex flex-col gap-3",children:t.jsx("div",{className:"flex flex-col gap-2",children:a})}),e[5]=a,e[6]=o):o=e[6],o}function ns(s){const e=P.c(7),{connection:n}=s,{org:i}=J();let a;e[0]!==n.id?(a={filters:[{column:"connection_id",value:n.id}]},e[0]=n.id,e[1]=a):a=e[1];const o=St(a);if(!(o.length>0)){let d;return e[2]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(t.Fragment,{}),e[2]=d):d=e[2],d}let c;e[3]===Symbol.for("react.memo_cache_sentinel")?(c=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]=c):c=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:[c,t.jsx("div",{className:"px-5 py-4",children:t.jsx(ss,{virtualMcps:o,org:i.slug})})]}),e[4]=i.slug,e[5]=o,e[6]=m):m=e[6],m}function os(s){const e=P.c(31),{tools:n,connectionId:i,org:a}=s,o=Y(),{org:r}=J();let c;e[0]!==i||e[1]!==r.id||e[2]!==r.slug?(c={connectionId:i,orgId:r.id,orgSlug:r.slug},e[0]=i,e[1]=r.id,e[2]=r.slug,e[3]=c):c=e[3];const m=re(c),d=ye(i);let u;e[4]!==d||e[5]!==i?(u=d?ke(d):i,e[4]=d,e[5]=i,e[6]=u):u=e[6];const p=u,[l,f]=G.useState("");let g,v,b,j;if(e[7]!==p||e[8]!==m||e[9]!==o||e[10]!==a||e[11]!==l||e[12]!==n){const S=(n??[]).filter(is),N=l.toLowerCase().trim(),k=N?S.filter(h=>h.name.toLowerCase().includes(N)||h.description&&h.description.toLowerCase().includes(N)):S;let y;e[17]!==p||e[18]!==o||e[19]!==a?(y=h=>{o({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:a,appSlug:p,collectionName:"tools",itemId:encodeURIComponent(h.name)}})},e[17]=p,e[18]=o,e[19]=a,e[20]=y):y=e[20];const C=y;b="flex flex-col h-full overflow-hidden";let I;e[21]===Symbol.for("react.memo_cache_sentinel")?(I=h=>{h.key==="Escape"&&(f(""),h.target.blur())},e[21]=I):I=e[21],e[22]!==l?(j=t.jsx(Dt,{value:l,onChange:f,placeholder:"Search apps...",onKeyDown:I}),e[22]=l,e[23]=j):j=e[23],g="flex-1 overflow-auto p-5",v=k.length===0?t.jsx(be,{image:null,title:l?"No apps found":"No apps available",description:l?"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(h=>{const A=ae(h._meta);return t.jsxs($t,{className:"cursor-pointer transition-colors overflow-hidden gap-0",onClick:()=>C(h),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx(nt,{resourceURI:A,toolInfo:{tool:h},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:h.name}),t.jsx(Je,{annotations:h.annotations,_meta:h._meta})]}),h.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:h.description})]})]},h.name)})}),e[7]=p,e[8]=m,e[9]=o,e[10]=a,e[11]=l,e[12]=n,e[13]=g,e[14]=v,e[15]=b,e[16]=j}else g=e[13],v=e[14],b=e[15],j=e[16];let _;e[24]!==g||e[25]!==v?(_=t.jsx("div",{className:g,children:v}),e[24]=g,e[25]=v,e[26]=_):_=e[26];let w;return e[27]!==b||e[28]!==j||e[29]!==_?(w=t.jsxs("div",{className:b,children:[j,_]}),e[27]=b,e[28]=j,e[29]=_,e[30]=w):w=e[30],w}function is(s){return!!ae(s._meta)}function Te(s){const e=s.replace(/[._]/g," ").trim().split(/\s+/),n=r=>r.charAt(0).toUpperCase()+r.slice(1),i=new Set(["list","create","get","update","delete","fetch","search","run","trigger","review","send","check"]),a=e.map(n),o=e[e.length-1];return a.length>=2&&o&&i.has(o)?[a.pop(),...a].join(" "):a.join(" ")}function ie(s){const e=P.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 rs(s){const e=P.c(50),{tools:n,prompts:i,resources:a,connectionId:o,org:r}=s;let c;e[0]!==i?(c=i===void 0?[]:i,e[0]=i,e[1]=c):c=e[1];const m=c;let d;e[2]!==a?(d=a===void 0?[]:a,e[2]=a,e[3]=d):d=e[3];const u=d,p=Y(),l=ye(o??"");let f;e[4]!==l||e[5]!==o?(f=l?ke(l):o,e[4]=l,e[5]=o,e[6]=f):f=e[6];const g=f;let v;e[7]!==g||e[8]!==o||e[9]!==p||e[10]!==r?(v=function(D){!o||!r||p({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:r,appSlug:g,collectionName:"tools",itemId:encodeURIComponent(D)}})},e[7]=g,e[8]=o,e[9]=p,e[10]=r,e[11]=v):v=e[11];const b=v;let j;e[12]!==o||e[13]!==r||e[14]!==n?(j=o&&r&&n.some(cs),e[12]=o,e[13]=r,e[14]=n,e[15]=j):j=e[15];const _=j;if(n.length+m.length+u.length===0){let x;return e[16]===Symbol.for("react.memo_cache_sentinel")?(x=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]=x):x=e[16],x}let S;e[17]!==n.length?(S=t.jsxs(ee,{value:"tools",variant:"underline",children:["Tools (",n.length,")"]}),e[17]=n.length,e[18]=S):S=e[18];let N;e[19]!==_?(N=_&&t.jsx(ee,{value:"apps",variant:"underline",children:"UI"}),e[19]=_,e[20]=N):N=e[20];let k,y;e[21]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(ee,{value:"prompts",variant:"underline",children:"Prompts"}),y=t.jsx(ee,{value:"resources",variant:"underline",children:"Resources"}),e[21]=k,e[22]=y):(k=e[21],y=e[22]);let C;e[23]!==S||e[24]!==N?(C=t.jsx("div",{className:"px-5 flex items-center justify-between border-b border-border",children:t.jsxs(Ct,{variant:"underline",className:"gap-1",children:[S,N,k,y]})}),e[23]=S,e[24]=N,e[25]=C):C=e[25];let I;e[26]!==b||e[27]!==n?(I=n.length>0?n.map(x=>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:()=>b(x.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(At,{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:Te(x.name)}),x.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:x.description})]}),t.jsx(Ce,{size:16,className:"text-muted-foreground shrink-0 mt-0.5"})]},x.name)):t.jsx(ie,{label:"tools"}),e[26]=b,e[27]=n,e[28]=I):I=e[28];let h;e[29]!==I?(h=t.jsx(te,{value:"tools",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:I})}),e[29]=I,e[30]=h):h=e[30];let A;e[31]!==o||e[32]!==_||e[33]!==r||e[34]!==n?(A=_&&t.jsx(te,{value:"apps",className:"h-auto min-h-[200px]",children:t.jsx(os,{tools:n,connectionId:o,org:r})}),e[31]=o,e[32]=_,e[33]=r,e[34]=n,e[35]=A):A=e[35];let M;e[36]!==m?(M=m.length>0?m.map(ls):t.jsx(ie,{label:"prompts"}),e[36]=m,e[37]=M):M=e[37];let O;e[38]!==M?(O=t.jsx(te,{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 T;e[40]!==u?(T=u.length>0?u.map(as):t.jsx(ie,{label:"resources"}),e[40]=u,e[41]=T):T=e[41];let z;e[42]!==T?(z=t.jsx(te,{value:"resources",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:T})}),e[42]=T,e[43]=z):z=e[43];let E;return e[44]!==C||e[45]!==h||e[46]!==A||e[47]!==O||e[48]!==z?(E=t.jsx("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:t.jsxs(wt,{defaultValue:"tools",variant:"underline",children:[C,h,A,O,z]})}),e[44]=C,e[45]=h,e[46]=A,e[47]=O,e[48]=z,e[49]=E):E=e[49],E}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(Tt,{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 ls(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:Te(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 cs(s){return ae(s._meta)}function ds(s){const e=P.c(13),{connection:n,displayTitle:i}=s,a=i??n.title;let o;e[0]!==n.icon||e[1]!==a?(o=t.jsx(oe,{icon:n.icon,name:a,size:"xl",className:"shrink-0"}),e[0]=n.icon,e[1]=a,e[2]=o):o=e[2];let r;e[3]!==a?(r=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:a})}),e[3]=a,e[4]=r):r=e[4];let c;e[5]!==n.description?(c=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]=c):c=e[6];let m;e[7]!==r||e[8]!==c?(m=t.jsxs("div",{className:"flex-1 min-w-0",children:[r,c]}),e[7]=r,e[8]=c,e[9]=m):m=e[9];let d;return e[10]!==o||e[11]!==m?(d=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]=d):d=e[12],d}function ms({form:s,connection:e,hasOAuthToken:n,onReauthenticate:i,onRemoveOAuth:a}){const o=de({control:s.control,name:"ui_type"}),r=de({control:s.control,name:"connection_url"}),{stdioEnabled:c}=Pe(),m=(()=>{if(typeof r!="string"||!r)return!1;try{const l=new URL(r);return l.hostname==="api.githubcopilot.com"&&l.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),d=c||e.connection_type==="STDIO",u=e.connection_type==="VIRTUAL",p=u?Oe(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(we,{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(R,{control:s.control,name:"ui_type",render:({field:l})=>t.jsxs(L,{className:"flex flex-col gap-3",children:[t.jsx(H,{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(ue,{value:l.value,onValueChange:l.onChange,children:[t.jsx(V,{children:t.jsxs(xe,{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(se,{className:"w-4 h-4 text-muted-foreground shrink-0"}),t.jsx(pe,{})]})}),t.jsxs(fe,{children:[t.jsx(F,{value:"HTTP",children:"HTTP"}),t.jsx(F,{value:"SSE",children:"SSE"}),t.jsx(F,{value:"Websocket",children:"Websocket"}),d&&t.jsxs(t.Fragment,{children:[t.jsx(F,{value:"NPX",children:"NPX Package"}),t.jsx(F,{value:"STDIO",children:"Custom Command"})]})]})]}),t.jsx("div",{className:"w-px bg-border"}),t.jsx(R,{control:s.control,name:"connection_url",render:({field:f})=>t.jsx(L,{className:"flex-1 min-w-0",children:t.jsx(V,{children:t.jsx(W,{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(ue,{value:l.value,onValueChange:l.onChange,children:[t.jsx(V,{children:t.jsx(xe,{className:"h-10",children:t.jsx(pe,{})})}),t.jsxs(fe,{children:[t.jsx(F,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(se,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(F,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(se,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(F,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(se,{className:"w-4 h-4"}),"Websocket"]})}),d&&t.jsxs(t.Fragment,{children:[t.jsx(F,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Ut,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(F,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(It,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(B,{})]})}),o==="NPX"&&t.jsx(R,{control:s.control,name:"npx_package",render:({field:l})=>t.jsxs(L,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:"NPM Package"}),t.jsx(V,{children:t.jsx(W,{placeholder:"@perplexity-ai/mcp-server",...l,value:l.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(R,{control:s.control,name:"stdio_command",render:({field:l})=>t.jsxs(L,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:"Command"}),t.jsx(V,{children:t.jsx(W,{placeholder:"node, bun, python...",...l,value:l.value||"",className:"h-10 rounded-lg"})}),t.jsx(B,{})]})}),t.jsx(R,{control:s.control,name:"stdio_args",render:({field:l})=>t.jsxs(L,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:"Arguments"}),t.jsx(V,{children:t.jsx(W,{placeholder:"arg1 arg2 --flag value",...l,value:l.value||"",className:"h-10 rounded-lg"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Space-separated arguments"}),t.jsx(B,{})]})})]}),t.jsx(R,{control:s.control,name:"stdio_cwd",render:({field:l})=>t.jsxs(L,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:"Working Directory"}),t.jsx(V,{children:t.jsx(W,{placeholder:"/path/to/project (optional)",...l,value:l.value||"",className:"h-10 rounded-lg"})}),t.jsx(B,{})]})})]}),(o==="NPX"||o==="STDIO")&&t.jsx(R,{control:s.control,name:"env_vars",render:({field:l})=>t.jsxs(L,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:"Environment Variables"}),t.jsx(V,{children:t.jsx(Be,{value:l.value??[],onChange:l.onChange})}),t.jsx(B,{})]})}),o!=="NPX"&&o!=="STDIO"&&t.jsx(R,{control:s.control,name:"connection_token",render:({field:l})=>t.jsxs(L,{className:"flex flex-col gap-3",children:[t.jsx(H,{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(Ot,{children:[t.jsx(Mt,{asChild:!0,children:t.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:t.jsxs(Pt,{variant:"success",className:"gap-1.5",children:[t.jsx(Vt,{size:12}),"Authenticated via OAuth",t.jsx(Et,{size:12})]})})}),t.jsxs(zt,{align:"start",children:[t.jsxs(me,{onClick:i,children:[t.jsx(Ft,{size:16}),"Re-authenticate"]}),t.jsxs(me,{variant:"destructive",onClick:a,children:[t.jsx(le,{size:16}),"Remove OAuth"]})]})]})}):e.connection_token&&l.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:()=>l.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(Rt,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(V,{children:t.jsx(W,{type:"password",placeholder:m?"Paste your GitHub PAT":"Enter access token...",...l,value:l.value||"",className:"h-10 rounded-lg"})}),m&&t.jsxs(ut,{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 us(s){return s.command==="npx"}function xs(s){return s.args?.find(e=>!e.startsWith("-"))??""}function ps(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function he(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"&&Re(s.connection_headers)){const i=s.connection_headers,a=We(i.envVars);if(us(i)){const r=xs(i);return{...n,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:r,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:a}}const o=ps(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:a}}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 fs(s){let e,n=null,i=null,a=null;return s.ui_type==="NPX"?(e="STDIO",n="",a=Ge(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",a=Xe(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},...a&&{connection_headers:a},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function hs({connection:s,connectionId:e,org:n,isUpdating:i,tools:a,prompts:o,resources:r,siblings:c}){const m=Y({from:"/$org/settings/connections/$appSlug"}),d=Ve(),u=_e(),{org:p}=J(),l=pt({onSuccess:()=>{c.length<=1&&m({to:"/$org/settings/connections",params:{org:n}})}}),[f,g]=G.useState(null),[v,b]=G.useState(!1),j=Ne({connectionId:e}),{data:_}=Ye(),w=_?.data?.members??[],S=f??s,N=w.find(x=>x.userId===S.created_by),y=s?.connection_type==="VIRTUAL"||j.isAuthenticated,C={...s,tools:a},I=Ke(C,Ht),h=Ee({resolver:Ue(qe),values:he(f??s)}),A=h.formState.isDirty,M=async()=>{if(!await h.trigger())return;const D=h.getValues(),$=fs(D),U=f?.id??e;await u.update.mutateAsync({id:U,data:$}),h.reset(D)},O=()=>{h.reset(he(f??s))},T=async x=>{const{token:D,tokenInfo:$,error:U}=await Le({connectionId:x,orgSlug:p.slug,scope:"offline_access"});if(U||!D){Q.error(`Authentication failed: ${U}`);return}if($)try{const X=await fetch(`/api/${p.slug}/connections/${x}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:$.accessToken,refreshToken:$.refreshToken,expiresIn:$.expiresIn,scope:$.scope,clientId:$.clientId,clientSecret:$.clientSecret,tokenEndpoint:$.tokenEndpoint})});if(!X.ok)console.error("Failed to save OAuth token:",await X.text()),await u.update.mutateAsync({id:x,data:{connection_token:D}});else try{await u.update.mutateAsync({id:x,data:{}})}catch(Z){console.warn("Failed to refresh connection tools after OAuth:",Z)}}catch(X){console.error("Error saving OAuth token:",X),await u.update.mutateAsync({id:x,data:{connection_token:D}})}else await u.update.mutateAsync({id:x,data:{connection_token:D}});const K=new URL(`/api/${p.slug}/mcp/${x}`,window.location.origin);await d.invalidateQueries({queryKey:ne.isMCPAuthenticated(K.href,null)}),await d.invalidateQueries({queryKey:ne.mcpClientPrefix()}),Q.success("Authentication successful")},z=()=>T(s.id),E=async()=>{try{const x=await fetch(`/api/${p.slug}/connections/${s.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!x.ok){const $=await x.text();Q.error(`Failed to remove OAuth: ${$}`);return}const D=new URL(`/api/${p.slug}/mcp/${s.id}`,window.location.origin);await d.invalidateQueries({queryKey:ne.isMCPAuthenticated(D.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(ft,{...l}),t.jsx(at,{open:f!==null,onOpenChange:x=>{x||g(null)},children:t.jsxs(lt,{side:"right",className:"sm:max-w-[520px] p-0 flex flex-col gap-0 overflow-hidden",children:[t.jsxs(ct,{className:"px-4 py-3 md:px-6 md:py-4 border-b border-border shrink-0",children:[t.jsx(dt,{className:"text-base",children:f?.title??s.title}),t.jsx(mt,{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(Ze,{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(xt,{...h,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(R,{control:h.control,name:"title",render:({field:x})=>t.jsxs(L,{children:[t.jsx(H,{children:"Name"}),t.jsx(V,{children:t.jsx(W,{...x})}),t.jsx(B,{})]})}),t.jsx(R,{control:h.control,name:"description",render:({field:x})=>t.jsxs(L,{children:[t.jsx(H,{children:"Description"}),t.jsx(V,{children:t.jsx(W,{...x,value:x.value||""})}),t.jsx(B,{})]})})]}),t.jsx(ms,{form:h,connection:f??s,hasOAuthToken:j.hasOAuthToken,onReauthenticate:z,onRemoveOAuth:E}),t.jsx(Qe,{connection:f??s,form:h,hasMcpBinding:I,isMCPAuthenticated:y,supportsOAuth:j.supportsOAuth,isServerError:j.isServerError,onAuthenticate:z,onViewReadme:void 0})]}),t.jsxs("div",{className:"px-6 py-4 border-t border-border flex gap-2 shrink-0",children:[t.jsx(q,{onClick:M,disabled:!A||i,className:"flex-1",children:i?"Saving…":"Save changes"}),A&&t.jsx(q,{variant:"outline",onClick:O,children:"Undo"}),t.jsxs(q,{variant:"outline",className:"gap-2 text-muted-foreground hover:text-destructive hover:border-destructive",onClick:()=>{const x=f??s;g(null),l.requestDelete(x)},children:[t.jsx(le,{size:15}),"Delete"]})]})]},f?.id??s.id)]})}),t.jsx(ht,{hideHeader:!0,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[t.jsx(ds,{connection:s,displayTitle:(()=>{const x=c[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(es,{connectionId:e}),t.jsxs("div",{className:"flex flex-col gap-5",children:[t.jsx(Wt,{instances:c,onConfigure:x=>g(x),onAuthenticate:x=>T(x.id),onDelete:x=>l.requestDelete(x),isAdding:v,onAdd:async()=>{b(!0);try{const x=c[0]??s,D=x.title.replace(/\s*\(\d+\)\s*$/,""),$=c.length+1,U=`${D} (${$})`,K=He("conn");await u.create.mutateAsync({id:K,title:U,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 X=new URL(`/api/${p.slug}/mcp/${K}`,window.location.origin),Z=await Fe({url:X.href,token:null,orgId:p.id});Z.supportsOAuth&&!Z.isAuthenticated&&await T(K)}finally{b(!1)}}}),t.jsx(ns,{connection:s})]}),t.jsx("div",{className:"@3xl:col-span-2",children:t.jsx(rs,{tools:a,prompts:o,resources:r,connectionId:e,org:n})})]})})]})})]})}function gs(){const s=P.c(39);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/settings/connections/$appSlug"},s[0]=e):e=s[0];const n=Y(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:a,org:o}=ze(i),{org:r}=J(),c=_e();let m;s[2]!==a?(m={slug:a},s[2]=a,s[3]=m):m=s[3];const d=et(m),u=d[0]??null,p=u?.id??"",l=p||null;let f;s[4]!==r.id||s[5]!==r.slug||s[6]!==l?(f={connectionId:l,orgId:r.id,orgSlug:r.slug},s[4]=r.id,s[5]=r.slug,s[6]=l,s[7]=f):f=s[7];const g=re(f);let v;s[8]!==g?(v={client:g},s[8]=g,s[9]=v):v=s[9];const{data:b}=st(v);let j;if(s[10]!==u?.tools||s[11]!==p||s[12]!==d||s[13]!==b){const T=b?b.tools.map(_s):(u?.tools??[]).map(ys);e:{if(d.length<=1){j=T;break e}const z=new Set,E=[],x=bs;for(const D of d){const $=D.id===p?T:x(D.tools);for(const U of $)z.has(U.name)||(z.add(U.name),E.push(U))}j=E.length>0?E:T}s[10]=u?.tools,s[11]=p,s[12]=d,s[13]=b,s[14]=j}else j=s[14];const _=j;let w;s[15]!==g?(w={client:g},s[15]=g,s[16]=w):w=s[16];const{data:S}=it(w);let N;s[17]!==g?(N={client:g},s[17]=g,s[18]=N):N=s[18];const{data:k}=ot(N);let y;s[19]!==S?.prompts?(y=S?.prompts??[],s[19]=S?.prompts,s[20]=y):y=s[20];let C;s[21]!==y?(C=y.map(vs),s[21]=y,s[22]=C):C=s[22];const I=C;let h;s[23]!==k?.resources?(h=k?.resources??[],s[23]=k?.resources,s[24]=h):h=s[24];let A;s[25]!==h?(A=h.map(js),s[25]=h,s[26]=A):A=s[26];const M=A;if(!u){let T;return s[27]!==n||s[28]!==o?(T=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(be,{title:"Connection not found",description:"This connection may have been deleted or you may not have access.",actions:t.jsx(q,{variant:"outline",onClick:()=>n({to:"/$org/settings/connections",params:{org:o}}),children:"Back to connections"})})}),s[27]=n,s[28]=o,s[29]=T):T=s[29],T}let O;return s[30]!==c.update.isPending||s[31]!==_||s[32]!==u||s[33]!==p||s[34]!==o||s[35]!==I||s[36]!==M||s[37]!==d?(O=t.jsx(hs,{org:o,connection:u,connectionId:p,isUpdating:c.update.isPending,tools:_,prompts:I,resources:M,siblings:d}),s[30]=c.update.isPending,s[31]=_,s[32]=u,s[33]=p,s[34]=o,s[35]=I,s[36]=M,s[37]=d,s[38]=O):O=s[38],O}function js(s){return{name:s.name,description:s.description,uri:s.uri}}function vs(s){return{name:s.name,description:s.description}}function bs(s){return(s??[]).map(Ns)}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(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Ss(){const s=P.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Me,{children:t.jsx(G.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(je,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(gs,{})})}),s[0]=e):e=s[0],e}function so(){const s=P.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ss,{}),s[0]=e):e=s[0],e}export{so as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{e as ie,j as t,E as Ye,r as W,l as re,q as _e,f as Se,d as Je,b as be,u as Ze,p as et,U as tt,F as nt,G as st,B,t as te,D as ot,c as ce,o as G,I as it,H as lt,K as rt}from"./index-C_m1_Qyy.js";import{g as ct}from"./generate-id-DfUEx9en.js";import{C as at}from"./collection-display-button-Bb5eYsxS.js";import{S as dt}from"./search-input-BX9Kn801.js";import{C as mt}from"./collection-tabs-BME6pm9f.js";import{u as ut,a as Ne,g as pt,C as fe}from"./connection-card-BY9Z3I7R.js";import{E as ht}from"./empty-state-CKtqz2A5.js";import{I as xt}from"./integration-icon-Bo72bKVV.js";import{P as de}from"./index-CKs6rcu1.js";import{u as gt,D as ft}from"./use-delete-connection-B0yMHUHX.js";import{u as jt}from"./use-infinite-scroll-XJXa4_f9.js";import{u as yt}from"./use-list-state-C8eifEnv.js";import{g as ke,a as Ct,e as vt}from"./extract-connection-data-BYGRbWJu.js";import{g as ue}from"./connection-slug-eyAPH6o3.js";import{c as De,d as Ae,b as we,f as Te,e as Ie,g as Pe,a as Le,A as Oe}from"./alert-dialog-DJnXid5j.js";import{C as $e}from"./checkbox-DdM7zWwz.js";import{b as Ee,a as ze,c as Fe,d as Me,e as Ve,D as Be}from"./dialog-Bg6eRMC4.js";import{b as _t,a as St,c as bt,D as Nt,d as kt,e as Dt,f as At}from"./drawer-q5yKuLmY.js";import{u as wt}from"./tooltip-BeTs1OMg.js";import{D as Ue,a as He,b as Re,c as pe}from"./dropdown-menu-TulqWZOe.js";import{F as Q,b as Y,c as J,d as Z,f as ee,a as Ce}from"./form-B-pClhzT.js";import{I as oe}from"./input-DHJ18fY7.js";import{S as Tt,a as It,b as Pt,c as Lt,d as le}from"./select-DAV_VIox.js";import{T as Ot}from"./textarea-C035ZOMR.js";import{b as Ke,u as $t}from"./use-connection-BbCw9KPq.js";import{u as Et,S as zt}from"./constants-piR0edM1.js";import{b as Ft}from"./use-virtual-mcp-DXij_fSZ.js";import{w as Mt,V as Vt}from"./agent-icon-C3wnlI99.js";import{n as he}from"./Container-BYMVUIOR.js";import{i as We}from"./DotsVertical-6XBT76_0.js";import{s as Xe}from"./RefreshCcw01-CYXiv82D.js";import{s as ge}from"./Star01-TIrOjEGQ.js";import{s as qe}from"./Plus-Cq_1PqM9.js";import{s as Ge}from"./Trash01-CHrTm5S-.js";import{s as Qe}from"./XClose-BOJwjK3-.js";import{i as me,a as ve,E as Bt,c as Ut,p as Ht,b as Rt,d as Kt}from"./connection-form-helpers-M4qUZwhZ.js";import"./collections-CuEt9akO.js";import"./SwitchHorizontal01-B39nOlBz.js";import"./Check-BIvjG7jh.js";import"./view-mode-toggle-DPGq5mgK.js";import"./badge-Dci-e_Pw.js";import"./SearchMd-WZzMz_xm.js";import"./use-registry-connections-CRI9AlTc.js";import"./use-organization-settings-BfJ6uqm2.js";import"./useInfiniteQuery-D0JT5WrD.js";import"./infiniteQueryObserver-CUomJPae.js";import"./card-CqaEJI_U.js";import"./sidebar-BFp8v2I0.js";import"./LayoutLeft-BA4wxcAF.js";import"./X-CexC7CUQ.js";import"./use-view-mode-Bzy-dMu6.js";import"./ChevronRight-Djwmm7yx.js";import"./label-jUTi8Oc4.js";import"./ChevronDown-2DdfyPVo.js";import"./ChevronUp-CYign-Xr.js";import"./use-collections-D_7JW6dX.js";import"./AlertCircle-CVwjiL5t.js";import"./Tool01-CAdd6NGF.js";import"./Stars02-BgabhO3x.js";import"./ArrowNarrowLeft-C0lNfAd-.js";import"./XCircle-D5rCjCCo.js";import"./ArrowUpRight-BsdiWOZ_.js";import"./ZapSquare-rxLTzaCI.js";import"./Users03-COREII3z.js";import"./CheckCircle-naAuY0Am.js";import"./FilterLines-xU-m-2To.js";import"./Palette-B6NpJZ9F.js";import"./HardDrive-CPUYFXaj.js";import"./Key01-CTY2QvpD.js";import"./LinkExternal01-Dn8eWUjC.js";import"./Lock01-DzYUukb5.js";import"./Monitor01-nKIM1K_1.js";import"./Sun-BMF5NYnu.js";import"./Play-qd-MZyD5.js";import"./Settings02-BGX5GQSJ.js";import"./Shield01-Dd3PCkCh.js";import"./Upload01-CfhmyOeM.js";import"./User01-CnVuEZ_q.js";import"./Users01-CARILaym.js";import"./Zap-DRsZpKeC.js";function Wt(y){const e=ie.c(51),{group:n,onOpen:g,selectionMode:m,selectedIds:d,onToggleSelect:o}=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]!==o||e[18]!==d||e[19]!==m?(a=()=>m?(()=>{for(const j of n.connections)h?d.has(j.id)&&o(j.id):d.has(j.id)||o(j.id)})():g(),e[14]=h,e[15]=n.connections,e[16]=g,e[17]=o,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=ce(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]!==o||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)&&o(j.id):d.has(j.id)||o(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]=o,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=ce("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(He,{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(Re,{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:o,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]!==o?(A=t.jsxs(B,{variant:"destructive",size:"sm",className:"h-7 text-xs px-2",onClick:o,children:[k,"Delete"]}),e[15]=o,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,[o,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]!==o?(_=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:ce("flex items-center gap-3 w-full rounded-md px-3 py-2 text-left transition-colors",o===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]=o,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=!o;let a;e[8]!==d||e[9]!==g||e[10]!==o?(a=()=>{o&&(d(o),g(!1),v(null))},e[8]=d,e[9]=g,e[10]=o,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,o=m!==1?"s":"";let v;e[0]!==m||e[1]!==o?(v=t.jsxs(De,{children:["Delete ",m," connection",o,"?"]}),e[0]=m,e[1]=o,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:o,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]!==o?(P=()=>{if(p){const b=D[0];b&&o(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]=o,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 H;e[31]!==$||e[32]!==n._sourceIcon?(H=$&&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]=H):H=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(re,{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 i;e[39]!==H||e[40]!==X?(i=t.jsxs("div",{className:"flex items-center gap-2",children:[H,X]}),e[39]=H,e[40]=X,e[41]=i):i=e[41];let C;e[42]!==P||e[43]!==i||e[44]!==j?(C=t.jsx(fe,{connection:j,fallbackIcon:U,onClick:P,headerActionsAlwaysVisible:!0,headerActions:i}),e[42]=P,e[43]=i,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 R;e[47]===Symbol.for("react.memo_cache_sentinel")?(R=t.jsx(Te,{children:"Cancel"}),e[47]=R):R=e[47];let E;e[48]!==F?(E=t.jsxs(Le,{children:[V,t.jsxs(Ie,{children:[R,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:o}=_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(r=>!(n!=="ALL"&&r.connection_type!==n||g!=="ALL"&&r.status!==g)),P=pt($),T=r=>{p(c=>{const w=new Set(c);return w.has(r)?w.delete(r):w.add(r),w})},z=()=>{p(new Set)},F=Ne(d,y.searchTerm),j=F.items,U=jt(F.loadMore,F.hasMore,F.isLoadingMore),H=new Set(S.filter(r=>r.app_name).map(r=>r.app_name)),X=m==="ALL"||d.some(r=>r.id===m)?m:"ALL",i=y.search.length>0,C=e==="all"||i?j.filter(r=>{if(X!=="ALL"&&r._registryId!==X)return!1;if(i){const c=ke(r);if(c&&H.has(c))return!1}return!0}):[],V=e==="connected"||i?P:[],R=async r=>{if(!(!o||!_?.user?.id)){te("connection_add_clicked",{action:"connect_new",registry_item_id:r.id,source:"connections_page"}),D(r.id);try{const c=vt(r,o.id,_.user.id,{remoteIndex:0}),w=c.connection_type==="STDIO",L=!!c.connection_url,q=w&&c.connection_headers&&typeof c.connection_headers=="object"&&"command"in c.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(c),je=new URL(`/api/${o.slug}/mcp/${K}`,window.location.origin),ye=await it({url:je.href,token:null,orgId:o.id});if(ye.supportsOAuth&&!ye.isAuthenticated){const{token:ae,tokenInfo:ne,error:xe}=await lt({connectionId:K,orgSlug:o.slug,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/${o.slug}/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:rt.isMCPAuthenticated(je.href,null)}),G.success("Authentication successful")}}G.success("Connected successfully")}catch(c){G.error(`Failed to connect: ${c instanceof Error?c.message:String(c)}`)}finally{D(null)}}},E=Et({connectionId:zt,orgId:o.id,orgSlug:o.slug}),l=()=>{v.invalidateQueries({predicate:r=>{const c=r.queryKey;return c[1]===o.id&&c[3]==="collection"&&c[4]==="CONNECTIONS"}})},O=async()=>{A(!1);const r=[...a];te("connections_bulk_delete",{count:r.length});let c=0;for(const w of r)try{(await E.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:w,force:!0}})).isError||c++}catch{}l(),G.success(`Deleted ${c} connection${c!==1?"s":""}`),z()},b=async r=>{const c=[...a];te("connections_bulk_status_toggled",{count:c.length,to_status:r});let w=0;for(const L of c)try{await u.update.mutateAsync({id:L,data:{status:r}}),w++}catch{}l(),G.success(`${r==="active"?"Enabled":"Disabled"} ${w} connection${w!==1?"s":""}`),z()},se=async r=>{const c=M.find(q=>q.id===r);if(!c||!E)return;te("connections_bulk_add_to_agent",{agent_id:r,count:a.size});const w=new Set(c.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:r,data:{connections:[...c.connections,...L]}}}),v.invalidateQueries({predicate:q=>{const K=q.queryKey;return K[1]===o.id&&K[3]==="collection"&&K[4]==="VIRTUAL_MCP"}}),G.success(`Added ${L.length} connection${L.length!==1?"s":""} to "${c.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(re,{size:32,className:"animate-spin text-muted-foreground"})}):t.jsx("div",{children:(i?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(r=>{if(r.type==="group")return t.jsx(Wt,{group:r,onOpen:()=>{h({to:"/$org/settings/connections/$appSlug",params:{org:o.slug,appSlug:r.key}})},selectionMode:f,selectedIds:a,onToggleSelect:T},r.key);const c=r.connection,w=a.has(c.id);return t.jsx(fe,{connection:c,fallbackIcon:t.jsx(he,{}),onClick:()=>f?T(c.id):h({to:"/$org/settings/connections/$appSlug",params:{org:o.slug,appSlug:ue(c)}}),className:ce(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(c.id),onClick:L=>L.stopPropagation()}):t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}),t.jsx("div",{className:ce("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(He,{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(Re,{align:"end",onClick:L=>L.stopPropagation(),children:[t.jsxs(pe,{onClick:L=>{L.stopPropagation(),h({to:"/$org/settings/connections/$appSlug",params:{org:o.slug,appSlug:ue(c)}})},children:[t.jsx(Xe,{size:16}),"Open"]}),t.jsxs(pe,{onClick:L=>{L.stopPropagation(),T(c.id)},children:[t.jsx(Vt,{size:16}),"Select"]}),t.jsxs(pe,{variant:"destructive",onClick:L=>{L.stopPropagation(),x.requestDelete(c)},children:[t.jsx(Ge,{size:16}),"Delete"]})]})]})})]})},c.id)}),C.map(r=>t.jsx(Zt,{item:r,allConnections:S,connectedAppNames:H,connectingItemId:s,onNavigateConnected:c=>h({to:"/$org/settings/connections/$appSlug",params:{org:o.slug,appSlug:ue(c)}}),onConnect:R},`catalog-${r._registryId}:${r.id}`)),(e==="all"||i)&&d.length>0&&t.jsx("div",{ref:U,className:"col-span-full h-4"}),(e==="all"||i)&&F.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(re,{size:24,className:"animate-spin text-muted-foreground"})})]})}),f&&t.jsx(Gt,{count:a.size,total:$.length,onSelectAll:()=>{p(new Set($.map(r=>r.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(),o=yt({namespace:y.slug,resource:"connections"}),v=Ke(),[h,_]=et(tt.connectionsTab(y.slug),i=>n.tab==="all"||n.tab==="connected"?n.tab:i??"all"),[u,S]=W.useState("ALL"),[x,a]=W.useState("ALL"),[p,f]=W.useState("ALL"),k=ut(),N=Ne(k,o.searchTerm).items,I=o.search!==o.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 i=>{let C,V=null,R=null,E=null;i.ui_type==="NPX"?(C="STDIO",V="",E=Rt(i.npx_package||"",i.env_vars||[])):i.ui_type==="STDIO"?(C="STDIO",V="",E=Kt(i.stdio_command||"",i.stdio_args||"",i.stdio_cwd,i.env_vars||[])):(C=i.ui_type,V=i.connection_url||"",R=i.connection_token||null);const l=ct("conn");te("connection_custom_created",{connection_type:C,ui_type:i.ui_type}),await v.create.mutateAsync({id:l,title:i.title,description:i.description||null,connection_type:C,connection_url:V,connection_token:R,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:g?.user?.id||"system",organization_id:y.id,icon:i.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:i.title,id:l})}})},U=i=>{i||(T&&F(),s.reset())},H=i=>{const C=i.trim();if(!C)return;const V=!!s.formState.dirtyFields.title,R=!!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}),!R&&!(s.getValues("description")??"").trim()&&b.description&&s.setValue("description",b.description,{shouldDirty:!1}),!E&&b.envVarKeys?.length)){const se=s.getValues("env_vars")??[],r=new Set(se.map(w=>w.key)),c=b.envVarKeys.filter(w=>!r.has(w));c.length>0&&s.setValue("env_vars",[...se,...c.map(w=>({key:w,value:""}))],{shouldDirty:!0})}},O=Ht(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 i="Create Connection",C="Create a custom connection in your organization. Fill in the details below.",V=s.formState.isSubmitting?"Saving...":"Create Connection",R=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}),H(b))},onBlur:O=>{H(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}),H(b))},onBlur:O=>{H(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:i}),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:R}),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:i}),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:R}),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:o.search,onChange:o.setSearch,placeholder:"Search for a connection",className:"w-full md:w-[375px]",onKeyDown:i=>{i.key==="Escape"&&(o.setSearch(""),i.target.blur())}}),t.jsx(at,{sortKey:o.sortKey,sortDirection:o.sortDirection,onSort:o.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:i=>S(i||"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:i=>a(i||"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:i=>f(i||"ALL"),options:[{id:"ALL",label:"All registries"},...k.map(i=>({id:i.id,label:i.id.includes("community-registry")?"Community MCP Registry":i.title}))]}]:[]]})]}),X]}),t.jsx(mt,{tabs:[{id:"all",label:"All"},{id:"connected",label:"Connected"}],activeTab:h,onTabChange:i=>{const C=i;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(re,{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:o,activeTab:h,typeFilter:u,statusFilter:x,registryFilter:p,enabledRegistries:k})})})]})})})]})})}function Ts(){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(re,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(tn,{})})}),y[0]=e):e=y[0],e}export{Ts as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{e as b,q as k,D as E,bO as x,j as i,bP as q,aL as K,K as S,o as _}from"./index-C_m1_Qyy.js";import{P}from"./index-CKs6rcu1.js";import{d as I}from"./use-organization-settings-BfJ6uqm2.js";import{S as Q}from"./switch-Bmqleb0M.js";import{n as R}from"./Container-BYMVUIOR.js";import{b as w,S as z,a as D,d as F}from"./settings-section-DLBjUAhp.js";import"./sidebar-BFp8v2I0.js";import"./LayoutLeft-BA4wxcAF.js";import"./tooltip-BeTs1OMg.js";import"./X-CexC7CUQ.js";import"./constants-piR0edM1.js";import"./card-CqaEJI_U.js";import"./ArrowUpRight-BsdiWOZ_.js";function N(){const e=b.c(17),{org:t,project:s}=k(),o=E();let u;e[0]!==s.enabledPlugins?(u=s.enabledPlugins??[],e[0]=s.enabledPlugins,e[1]=u):u=e[1];const c=u,l=I();let m;e[2]!==t||e[3]!==s.slug||e[4]!==o?(m=()=>{o.invalidateQueries({queryKey:S.project(t.id,s.slug)}),o.invalidateQueries({queryKey:S.projects(t.id)}),o.invalidateQueries({predicate:n=>{const r=n.queryKey;return r[1]===t.id&&r[3]==="collection"&&r[4]==="VIRTUAL_MCP"}})},e[2]=t,e[3]=s.slug,e[4]=o,e[5]=m):m=e[5];const j=m;let g;e[6]!==j||e[7]!==l||e[8]!==c?(g=(n,r)=>{const d=new Set(c);r?d.add(n):d.delete(n),l.mutate({enabled_plugins:Array.from(d)},{onSuccess:j,onError:A})},e[6]=j,e[7]=l,e[8]=c,e[9]=g):g=e[9];const p=g,y=$,C=U;if(x.length===0){let n;return e[10]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsx("p",{className:"text-sm text-muted-foreground",children:"No plugins available."}),e[10]=n):n=e[10],n}let a;e[11]!==p||e[12]!==l||e[13]!==c?(a=x.map(n=>{const r=y(n.id),d=C(n.id),h=c.includes(n.id);return i.jsx(w,{title:r?.label??n.id,description:d??void 0,icon:i.jsx("span",{className:"text-muted-foreground [&>svg]:size-4",children:r?.icon??i.jsx(R,{size:14})}),onClick:()=>!l.isPending&&p(n.id,!h),action:i.jsx(Q,{checked:h,onCheckedChange:v=>p(n.id,v),disabled:l.isPending,onClick:T})},n.id)}),e[11]=p,e[12]=l,e[13]=c,e[14]=a):a=e[14];let f;return e[15]!==a?(f=i.jsx(z,{children:i.jsx(D,{children:a})}),e[15]=a,e[16]=f):f=e[16],f}function T(e){return e.stopPropagation()}function U(e){return x.find(s=>s.id===e)?.description??null}function $(e){const t=q.find(o=>o.pluginId===e);if(t)return{label:t.label,icon:t.items[0]?.icon};const s=K.find(o=>o.pluginId===e);return s?{label:s.label,icon:s.icon}:null}function A(e){_.error("Failed to update plugin: "+(e instanceof Error?e.message:"Unknown error"))}function L(){const e=b.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=i.jsx(P,{children:i.jsx(P.Content,{children:i.jsx(P.Body,{children:i.jsxs(F,{children:[i.jsx(P.Title,{children:"Plugins"}),i.jsx(N,{})]})})})}),e[0]=t):t=e[0],t}function ne(){const e=b.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=i.jsx(L,{}),e[0]=t):t=e[0],t}export{ne as default};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as l,D as te,j as t,l as w,c as E}from"./index-C_m1_Qyy.js";import{S as re,F as oe,l as se}from"./monaco-editor-D-22abDQ.js";import{t as ie}from"./ChevronDown-2DdfyPVo.js";import{i as ne}from"./ChevronRight-Djwmm7yx.js";import{M as ae,aj as le,r as de}from"./agent-icon-C3wnlI99.js";import{s as me}from"./XClose-BOJwjK3-.js";import{u as ce}from"./chat-context-DxSqonhB.js";import{u as pe}from"./shell-layout-BZaILYv9.js";import{k as ue,m as fe,o as N,p as xe,q as he,t as g,v as ge,w as ye}from"./index-CdCX0F7Y.js";import"./select-DAV_VIox.js";import"./tooltip-BeTs1OMg.js";import"./Check-BIvjG7jh.js";import"./ChevronUp-CYign-Xr.js";import"./spinner-DLBC6d93.js";import"./AlertCircle-CVwjiL5t.js";import"./Tool01-CAdd6NGF.js";import"./Stars02-BgabhO3x.js";import"./SwitchHorizontal01-B39nOlBz.js";import"./RefreshCcw01-CYXiv82D.js";import"./ArrowNarrowLeft-C0lNfAd-.js";import"./XCircle-D5rCjCCo.js";import"./ArrowUpRight-BsdiWOZ_.js";import"./ZapSquare-rxLTzaCI.js";import"./Users03-COREII3z.js";import"./CheckCircle-naAuY0Am.js";import"./DotsVertical-6XBT76_0.js";import"./Container-BYMVUIOR.js";import"./FilterLines-xU-m-2To.js";import"./Star01-TIrOjEGQ.js";import"./Palette-B6NpJZ9F.js";import"./HardDrive-CPUYFXaj.js";import"./Key01-CTY2QvpD.js";import"./LayoutLeft-BA4wxcAF.js";import"./LinkExternal01-Dn8eWUjC.js";import"./Lock01-DzYUukb5.js";import"./Monitor01-nKIM1K_1.js";import"./Sun-BMF5NYnu.js";import"./Play-qd-MZyD5.js";import"./Plus-Cq_1PqM9.js";import"./SearchMd-WZzMz_xm.js";import"./Settings02-BGX5GQSJ.js";import"./Shield01-Dd3PCkCh.js";import"./Trash01-CHrTm5S-.js";import"./Upload01-CfhmyOeM.js";import"./User01-CnVuEZ_q.js";import"./Users01-CARILaym.js";import"./X-CexC7CUQ.js";import"./Zap-DRsZpKeC.js";import"./hooks-Buro5ByR.js";import"./constants-piR0edM1.js";import"./decopilot-sse-pool-DWRmePhE.js";import"./create-sse-subscription-CjI9SUTI.js";import"./use-virtual-mcp-DXij_fSZ.js";import"./use-collections-D_7JW6dX.js";import"./use-ai-providers-CgowGcDz.js";import"./use-organization-settings-BfJ6uqm2.js";import"./avatar-ByQQ7GEH.js";import"./dialog-Bg6eRMC4.js";import"./required-auth-layout-CJnuX5pr.js";import"./useRouterState-DNwJdpeR.js";import"./use-org-sso-Baws_Cb6.js";import"./index-BHpJxImt.js";import"./pair-DgOi01tx.js";import"./index-zGvFjFjO.js";import"./use-copy-DbsD5qK3.js";import"./format-time-GeUngI9C.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./content-blocks-o63cs2vh.js";import"./types-BZ3eurxp.js";import"./integration-icon-Bo72bKVV.js";import"./use-mcp-prompts-Cxw_xwII.js";import"./form-B-pClhzT.js";import"./label-jUTi8Oc4.js";import"./input-DHJ18fY7.js";import"./drawer-q5yKuLmY.js";import"./collection-search-CZPmAdbz.js";import"./tabs-DKgnbdu4.js";import"./toggle-group-D_tMezdr.js";import"./agent-icons-BMYEM-93.js";import"./checkbox-DdM7zWwz.js";import"./skeleton-tYEs8dsN.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-DLBjUAhp.js";import"./card-CqaEJI_U.js";import"./connect-desktop-dialog-v3Y8dgGN.js";import"./unwrap-tool-result-BYXdCQMg.js";import"./popover-COqcQ0Rg.js";import"./index-B55MEl-c.js";import"./dropdown-menu-TulqWZOe.js";import"./question-004-sINsf4GQ.js";import"./add-connection-dialog-CJWirXjW.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-BY9Z3I7R.js";import"./use-registry-connections-CRI9AlTc.js";import"./use-connection-BbCw9KPq.js";import"./useInfiniteQuery-D0JT5WrD.js";import"./infiniteQueryObserver-CUomJPae.js";import"./extract-connection-data-BYGRbWJu.js";import"./generate-id-DfUEx9en.js";import"./collections-CuEt9akO.js";import"./collection-tabs-BME6pm9f.js";import"./badge-Dci-e_Pw.js";import"./textarea-C035ZOMR.js";import"./connection-form-helpers-M4qUZwhZ.js";import"./use-infinite-scroll-XJXa4_f9.js";import"./useSuspenseInfiniteQuery-D794zrC9.js";import"./index-2vcb4P4k.js";import"./sidebar-BFp8v2I0.js";import"./toolbar-AIIkxXjs.js";import"./collection-search-DYkFJwme.js";import"./use-navigate-to-agent-CVbR4ICA.js";import"./use-create-virtual-mcp-DJVm-5Gn.js";import"./github-repo-picker-A9GOBLjA.js";import"./use-mcp-tools-Cg4H0QB3.js";import"./alert-dialog-DJnXid5j.js";import"./index-Df1UV_SS.js";import"./command-DaAuDqUV.js";import"./index-B_5hPR5_.js";import"./hover-card-CUfoIFQV.js";import"./task-status-CqP04HQ9.js";import"./use-status-sounds-Ch0BXIj1.js";import"./empty-state-CKtqz2A5.js";import"./accordion-DEFWqB9v.js";import"./user-D0ZUKhOx.js";import"./tools-list-DmcpkTFh.js";import"./switch-Bmqleb0M.js";import"./use-debounced-autosave-B4_HunOp.js";import"./index-CKs6rcu1.js";import"./use-secrets-CPfeyzy3.js";import"./view-mode-toggle-DPGq5mgK.js";import"./automation-list-row-9h6JxfVT.js";import"./search-input-BX9Kn801.js";se.config({paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.0/min/vs"}});function S(a,c,p,y){return`/api/${a}/sandbox/${encodeURIComponent(c)}/${encodeURIComponent(p)}/${y}`}function K(a){return a.startsWith("/")?a.slice(1):a}function Ir({orgSlug:a,virtualMcpId:c,branch:p}){const[y,P]=l.useState([]),[k,C]=l.useState(new Set),[i,j]=l.useState(null),[b,F]=l.useState([]),[f,V]=l.useState(""),[O,L]=l.useState(!1),[z,R]=l.useState(!1),[v,x]=l.useState(new Map),B=l.useRef(null),[d,h]=l.useState(null),{sendMessage:q}=ce(),{setChatOpen:I}=pe(),J=te(),A=l.useRef(!1);A.current||(A.current=!0,Q());async function Q(){L(!0);try{const e=await fetch(S(a,c,p,"glob"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({pattern:"**/*"})});if(!e.ok)return;const r=await e.json();P(r.files??[]),R(!0)}finally{L(!1)}}async function $(e){if(!v.get(e)?.loaded){x(o=>{const s=new Map(o);return s.set(e,{savedContent:"",editorValue:"",loaded:!1}),s});try{const o=await fetch(S(a,c,p,"read"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:K(e)})});if(!o.ok)return;const s=await o.json(),n=he(s.content??"");x(m=>{const T=new Map(m);return T.set(e,{savedContent:n,editorValue:n,loaded:!0}),T})}catch{}}}async function U(e,r){try{const o=await fetch(S(a,c,p,"write"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:K(e),content:r})});if(!o.ok){g("file save failed",{path:e,status:o.status});return}g("file saved via sandbox /write",{path:e}),J.invalidateQueries({queryKey:ge(a,c,p)});try{const s=await ye(a,c,p);g("git status after save",s)}catch(s){g("git status after save failed",{path:e,error:s instanceof Error?s.message:String(s)})}x(s=>{const n=new Map(s),m=n.get(e);return m&&n.set(e,{...m,savedContent:r}),n})}catch{}}function W(e){j(e),h(null),b.includes(e)||F(r=>[...r,e]),$(e)}function G(e){F(r=>{const o=r.filter(s=>s!==e);return i===e&&j(o[o.length-1]??null),o}),x(r=>{const o=new Map(r);return o.delete(e),o})}function H(e){C(r=>{const o=new Set(r);return o.has(e)?o.delete(e):o.add(e),o})}function X(e){const r=xe(e);C(o=>{const s=new Set(o);for(const n of r)s.add(n);return s}),W(e)}const Y=ue(y),D=fe(Y,k),M=f?D.filter(e=>e.node.name.toLowerCase().includes(f.toLowerCase())):D,u=i?v.get(i):null,Z=u?.loaded&&u.editorValue!==u.savedContent,_=(e,r)=>{B.current=e,e.addCommand(r.KeyMod.CtrlCmd|r.KeyCode.KeyS,async()=>{if(!i)return;const o=e.getValue();await U(i,o)}),e.addCommand(r.KeyMod.CtrlCmd|r.KeyCode.KeyK,()=>{const o=e.getSelection(),s=e.getModel();if(!o||!s||!i)return;const n=s.getValueInRange(o);h({filePath:i,lineStart:o.startLineNumber,lineEnd:o.endLineNumber,selectedCode:n})})};function ee(e){if(!d)return;const r=[`The user selected code in the file explorer and asked: **"${e.trim()}"**`,"",`**File:** \`${d.filePath}\``,`**Lines:** ${d.lineStart}–${d.lineEnd}`];if(d.selectedCode){const o=N(d.filePath),s=d.selectedCode.replace(/```/g,"`` `");r.push("","**Selected code:**","```"+o,s,"```")}r.push("","Please read the source file, locate the code, and apply the requested change."),I(!0),q({parts:[{type:"text",text:r.join(`
|
|
2
|
-
`)}]}),h(null)}return O&&!z?t.jsx("div",{className:"flex items-center justify-center h-full w-full",children:t.jsx(w,{size:20,className:"animate-spin text-muted-foreground"})}):t.jsxs("div",{className:"flex h-full w-full overflow-hidden",children:[t.jsxs("div",{className:"w-64 shrink-0 border-r flex flex-col overflow-hidden",children:[t.jsx("div",{className:"p-2 border-b",children:t.jsxs("div",{className:"relative",children:[t.jsx(ae,{size:14,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground"}),t.jsx("input",{type:"text",value:f,onChange:e=>V(e.target.value),placeholder:"Search files...",className:"w-full rounded-md border border-input bg-transparent pl-7 pr-2 py-1.5 text-xs outline-none placeholder:text-muted-foreground focus:ring-1 focus:ring-ring"})]})}),t.jsx(re,{className:"flex-1",children:t.jsxs("div",{className:"py-1",children:[M.map(e=>{const{node:r,depth:o}=e,s=r.kind==="directory",n=k.has(r.path),m=i===r.path;return t.jsxs("button",{type:"button",className:E("flex w-full items-center gap-1 px-2 py-1 text-left text-xs hover:bg-accent transition-colors",m&&"bg-accent"),style:{paddingLeft:`${o*12+8}px`},onClick:()=>{s?H(r.path):X(r.path)},children:[s?t.jsxs(t.Fragment,{children:[n?t.jsx(ie,{size:12,className:"shrink-0 text-muted-foreground"}):t.jsx(ne,{size:12,className:"shrink-0 text-muted-foreground"}),t.jsx(le,{size:14,className:"shrink-0 text-muted-foreground"})]}):t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"w-3 shrink-0"}),t.jsx(de,{size:14,className:"shrink-0 text-muted-foreground"})]}),t.jsx("span",{className:"truncate",children:r.name})]},r.path)}),z&&M.length===0&&t.jsx("div",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:f?`No files match "${f}"`:"No files found"})]})})]}),t.jsxs("div",{className:"relative flex-1 flex flex-col overflow-hidden",children:[b.length>0&&t.jsx("div",{className:"flex items-center border-b overflow-x-auto shrink-0",children:b.map(e=>{const r=v.get(e),o=r?.loaded&&r.editorValue!==r.savedContent,s=i===e,n=e.split("/").pop()??e;return t.jsxs("div",{className:E("flex items-center gap-1 px-3 py-1.5 text-xs border-r cursor-pointer transition-colors",s?"bg-background text-foreground":"bg-muted/50 text-muted-foreground hover:bg-accent"),onClick:()=>{j(e),$(e)},onKeyDown:()=>{},role:"tab",tabIndex:0,"aria-selected":s,children:[t.jsx("span",{className:"truncate max-w-32",children:n}),o&&t.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-foreground/60 shrink-0"}),t.jsx("button",{type:"button",className:"ml-1 rounded p-0.5 hover:bg-accent-foreground/10",onClick:m=>{m.stopPropagation(),G(e)},children:t.jsx(me,{size:12})})]},e)})}),d&&t.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 z-20 mt-2",style:{width:"360px"},children:t.jsxs("form",{className:"flex w-full items-center gap-1.5 rounded-xl border border-border bg-background/95 px-3 py-1.5 shadow-lg backdrop-blur",onSubmit:e=>{e.preventDefault();const o=e.currentTarget.elements.namedItem("askAiInput");o.value.trim()&&ee(o.value)},children:[t.jsx("input",{name:"askAiInput",autoFocus:!0,type:"text",placeholder:"Ask the AI...",className:"min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground",onKeyDown:e=>{e.stopPropagation(),e.key==="Escape"&&h(null)}}),t.jsx("button",{type:"submit",className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-foreground text-background transition-opacity",title:"Send",children:t.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":"true",children:[t.jsx("title",{children:"Send"}),t.jsx("path",{d:"M5 9V1M1 5l4-4 4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})})]})}),t.jsx("div",{className:"flex-1 overflow-hidden",children:i&&u?.loaded?t.jsx(oe,{language:N(i),theme:document.documentElement.classList.contains("dark")?"vs-dark":"light",value:u.editorValue,path:i,onChange:e=>{const r=i;r&&x(o=>{const s=new Map(o),n=s.get(r);return n&&s.set(r,{...n,editorValue:e??""}),s})},onMount:_,loading:t.jsx("div",{className:"flex items-center justify-center h-full w-full",children:t.jsx(w,{size:20,className:"animate-spin text-muted-foreground"})}),options:{fontSize:13,scrollBeyondLastLine:!1,automaticLayout:!0,lineNumbersMinChars:2,wordWrap:"on",minimap:{enabled:!1},padding:{top:12,bottom:12},scrollbar:{vertical:"auto",horizontal:"auto",verticalScrollbarSize:8,horizontalScrollbarSize:8}}},i):i&&!u?.loaded?t.jsx("div",{className:"flex items-center justify-center h-full w-full",children:t.jsx(w,{size:20,className:"animate-spin text-muted-foreground"})}):t.jsx("div",{className:"flex items-center justify-center h-full w-full text-sm text-muted-foreground",children:"Select a file to edit"})}),i&&t.jsxs("div",{className:"flex items-center justify-between px-3 py-1 border-t text-[11px] text-muted-foreground shrink-0",children:[t.jsx("span",{className:"truncate",children:i}),t.jsxs("span",{children:[Z?"Modified":"Saved"," ·"," ",N(i)]})]})]})]})}export{Ir as FileExplorer};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{f as oe,q as ie,D as le,F as ge,G as fe,a as ae,t as Y,o as L,K as Z,j as s,C as ee,J as xe,P as X,e as T,r as K,B as H,c as pe,z as he,U as te,a0 as je}from"./index-C_m1_Qyy.js";import{P as G}from"./index-CKs6rcu1.js";import{u as ve}from"./use-org-auth-client-Bk4CKLSt.js";import{u as be}from"./use-debounced-autosave-B4_HunOp.js";import{A as ye}from"./avatar-ByQQ7GEH.js";import{I as re}from"./input-DHJ18fY7.js";import{S as J,a as W,b as Q,c as Se,d as Ce}from"./settings-section-DLBjUAhp.js";import{D as _e}from"./domain-settings-CHHiS2Vl.js";import{u as ze,a as se,K as Ne,P as De,D as we,c as Ae,S as Pe,v as Oe,b as Ie,C as ke,s as Ee,d as Fe}from"./sortable.esm-vK1UhoBn.js";import{i as Te,S as Re,u as $e}from"./constants-piR0edM1.js";import{b as ce}from"./use-virtual-mcp-DXij_fSZ.js";import{P as Le,a as Me,b as qe}from"./popover-COqcQ0Rg.js";import{C as Ke}from"./collection-search-DYkFJwme.js";import{S as Be}from"./skeleton-tYEs8dsN.js";import{ab as Ve}from"./agent-icon-C3wnlI99.js";import{s as He}from"./Plus-Cq_1PqM9.js";import{a as de}from"./Users03-COREII3z.js";import{i as Ue}from"./X-CexC7CUQ.js";import{I as me}from"./integration-icon-Bo72bKVV.js";import{b as Ge,c as Qe}from"./use-organization-settings-BfJ6uqm2.js";import{c as Ye,b as Ze,d as Je,f as We,e as Xe,g as et,a as tt,A as st}from"./alert-dialog-DJnXid5j.js";import"./sidebar-BFp8v2I0.js";import"./LayoutLeft-BA4wxcAF.js";import"./tooltip-BeTs1OMg.js";import"./User01-CnVuEZ_q.js";import"./card-CqaEJI_U.js";import"./ArrowUpRight-BsdiWOZ_.js";import"./unwrap-tool-result-BYXdCQMg.js";import"./switch-Bmqleb0M.js";import"./use-collections-D_7JW6dX.js";import"./SearchMd-WZzMz_xm.js";import"./AlertCircle-CVwjiL5t.js";import"./Tool01-CAdd6NGF.js";import"./Stars02-BgabhO3x.js";import"./SwitchHorizontal01-B39nOlBz.js";import"./RefreshCcw01-CYXiv82D.js";import"./ArrowNarrowLeft-C0lNfAd-.js";import"./XCircle-D5rCjCCo.js";import"./ZapSquare-rxLTzaCI.js";import"./CheckCircle-naAuY0Am.js";import"./Check-BIvjG7jh.js";import"./ChevronDown-2DdfyPVo.js";import"./ChevronRight-Djwmm7yx.js";import"./ChevronUp-CYign-Xr.js";import"./DotsVertical-6XBT76_0.js";import"./Container-BYMVUIOR.js";import"./FilterLines-xU-m-2To.js";import"./Star01-TIrOjEGQ.js";import"./Palette-B6NpJZ9F.js";import"./HardDrive-CPUYFXaj.js";import"./Key01-CTY2QvpD.js";import"./LinkExternal01-Dn8eWUjC.js";import"./Lock01-DzYUukb5.js";import"./Monitor01-nKIM1K_1.js";import"./Sun-BMF5NYnu.js";import"./Play-qd-MZyD5.js";import"./Settings02-BGX5GQSJ.js";import"./Shield01-Dd3PCkCh.js";import"./Trash01-CHrTm5S-.js";import"./Upload01-CfhmyOeM.js";import"./Users01-CARILaym.js";import"./XClose-BOJwjK3-.js";import"./Zap-DRsZpKeC.js";const nt=xe({name:X().min(1,"Name is required").max(255,"Name is too long"),slug:X().min(1,"Slug is required").max(50,"Slug is too long").regex(/^[a-z0-9-]+$/,"Slug must contain only lowercase letters, numbers, and hyphens"),logo:X().optional()});function ot(e){const t=T.c(13),{value:l,onChange:a,name:c,disabled:f}=e,n=K.useRef(null);let j;t[0]===Symbol.for("react.memo_cache_sentinel")?(j=()=>n.current?.click(),t[0]=j):j=t[0];const u=j;let v;t[1]!==a?(v=w=>{const g=w.target.files?.[0];if(!g)return;if(g.size>2097152){L.error("Image must be smaller than 2MB");return}const h=new FileReader;h.onerror=it,h.onloadend=()=>{h.result&&a(h.result),n.current&&(n.current.value="")},h.readAsDataURL(g)},t[1]=a,t[2]=v):v=t[2];const o=v;let i;t[3]!==f||t[4]!==o?(i=s.jsx("input",{ref:n,type:"file",accept:"image/*",onChange:o,className:"hidden",disabled:f}),t[3]=f,t[4]=o,t[5]=i):i=t[5];const d=l||void 0,m=c??"?";let x;t[6]!==d||t[7]!==m?(x=s.jsx(ye,{url:d,fallback:m,shape:"square",size:"base"}),t[6]=d,t[7]=m,t[8]=x):x=t[8];let p;return t[9]!==f||t[10]!==i||t[11]!==x?(p=s.jsxs("button",{type:"button",onClick:u,disabled:f,className:"rounded-lg overflow-hidden hover:ring-2 hover:ring-border transition-all disabled:opacity-50","aria-label":"Upload organization logo",children:[i,x]}),t[9]=f,t[10]=i,t[11]=x,t[12]=p):p=t[12],p}function it(){return L.error("Failed to read image")}function lt(){const e=oe(),{org:t}=ie(),l=ve(),a=le(),c=ge({resolver:fe(nt),values:{name:t.name??"",slug:t.slug??"",logo:t.logo??""}}),f=ae({mutationFn:async o=>{const i={name:o.name,slug:o.slug};o.logo&&(i.logo=o.logo);const d=await l.organization.update({data:i});if(d?.error)throw new Error(d.error.message||"Failed to update organization");return d},onSuccess:(o,i)=>{Y("organization_settings_updated",{organization_id:t.id,fields:Object.keys(i)}),a.invalidateQueries({queryKey:Z.organizations()}),a.invalidateQueries({queryKey:Z.activeOrganization(t.slug)}),L.success("Organization updated successfully"),o?.data?.slug&&o.data.slug!==t.slug&&e({to:"/$org/settings/general",params:{org:o.data.slug}})},onError:(o,i)=>{Y("organization_settings_update_failed",{organization_id:t.id,fields:Object.keys(i),error:o instanceof Error?o.message:String(o)}),L.error(o instanceof Error?o.message:"Failed to update organization")}}),{schedule:n,flush:j}=be({save:async()=>{const o=c.control._formState.dirtyFields;if(Object.keys(o).length===0||!await c.trigger())return;const d=c.getValues(),m=c.control._defaultValues;c.reset(d,{keepValues:!0});try{await f.mutateAsync(d)}catch{c.reset(m,{keepValues:!0})}}}),u=c.formState.errors,v=typeof window<"u"?`${window.location.host}/`:"";return s.jsx(J,{children:s.jsxs(W,{children:[s.jsx(Q,{title:"Logo",description:"Recommended size is 256x256px",action:s.jsx(ot,{value:c.watch("logo"),onChange:o=>{c.setValue("logo",o??"",{shouldDirty:!0}),j()},name:c.watch("name")})}),s.jsx(Q,{title:"Name",action:s.jsx(ee,{control:c.control,name:"name",render:({field:o})=>s.jsx(re,{id:"org-name",...o,onChange:i=>{o.onChange(i),n()},onBlur:()=>{o.onBlur(),j()},placeholder:"Organization name",className:"w-[280px]"})})}),s.jsx(Q,{title:"URL",action:s.jsxs("div",{className:"flex items-center w-[280px] rounded-md border border-input bg-input/30 focus-within:ring-2 focus-within:ring-ring/50 overflow-hidden",children:[v&&s.jsx("span",{className:"pl-3 text-sm text-muted-foreground select-none",children:v}),s.jsx(ee,{control:c.control,name:"slug",render:({field:o})=>s.jsx("input",{id:"org-slug",value:o.value??"",name:o.name,ref:o.ref,placeholder:"my-organization",className:"flex-1 min-w-0 bg-transparent px-2 py-1.5 text-sm text-foreground placeholder:text-muted-foreground/60 outline-none",onChange:i=>{const d=i.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"");c.setValue("slug",d,{shouldDirty:!0,shouldTouch:!0,shouldValidate:!0}),n()},onBlur:()=>{o.onBlur(),j()}})})]})}),(u.name||u.slug||u.logo)&&s.jsxs("div",{className:"px-5 pb-3 flex flex-col gap-1",children:[u.name&&s.jsx("p",{className:"text-xs text-destructive",children:u.name.message}),u.slug&&s.jsx("p",{className:"text-xs text-destructive",children:u.slug.message}),u.logo&&s.jsx("p",{className:"text-xs text-destructive",children:u.logo.message})]})]})})}const ne=8;function at(e,t){const l=t.find(a=>a.id===e);return l?{id:e,title:l.title,icon:l.icon??null,kind:"custom"}:{id:e,title:e,icon:null,kind:"missing"}}function rt(e){const t=T.c(39),{agent:l,onRemove:a}=e;let c;t[0]!==l.id?(c={id:l.id},t[0]=l.id,t[1]=c):c=t[1];const{attributes:f,listeners:n,setNodeRef:j,transform:u,transition:v,isDragging:o}=Ie(c);let i;t[2]!==u?(i=ke.Transform.toString(u),t[2]=u,t[3]=i):i=t[3];const d=o?.5:void 0,m=o?100:void 0;let x;t[4]!==i||t[5]!==d||t[6]!==m||t[7]!==v?(x={transform:i,transition:v,opacity:d,zIndex:m},t[4]=i,t[5]=d,t[6]=m,t[7]=v,t[8]=x):x=t[8];const p=x,w=o&&"shadow-lg";let g;t[9]!==w?(g=pe("flex items-center gap-3 px-3 py-2 rounded-lg border border-border bg-background",w),t[9]=w,t[10]=g):g=t[10];const h=`Drag to reorder ${l.title}`;let S;t[11]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(Ve,{size:14}),t[11]=S):S=t[11];let z;t[12]!==f||t[13]!==n||t[14]!==h?(z=s.jsx("button",{type:"button",...f,...n,className:"text-muted-foreground hover:text-foreground cursor-grab active:cursor-grabbing","aria-label":h,children:S}),t[12]=f,t[13]=n,t[14]=h,t[15]=z):z=t[15];let C;t[16]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx(de,{size:14}),t[16]=C):C=t[16];let b;t[17]!==l.icon||t[18]!==l.title?(b=s.jsx(me,{icon:l.icon,name:l.title,size:"xs",fallbackIcon:C}),t[17]=l.icon,t[18]=l.title,t[19]=b):b=t[19];let _;t[20]!==l.title?(_=s.jsx("span",{className:"text-sm text-foreground truncate",children:l.title}),t[20]=l.title,t[21]=_):_=t[21];const P=l.kind==="custom"?"Custom agent":"Unavailable";let y;t[22]!==P?(y=s.jsx("span",{className:"text-xs text-muted-foreground",children:P}),t[22]=P,t[23]=y):y=t[23];let A;t[24]!==_||t[25]!==y?(A=s.jsxs("div",{className:"flex flex-col min-w-0 flex-1",children:[_,y]}),t[24]=_,t[25]=y,t[26]=A):A=t[26];const N=`Remove ${l.title}`;let D;t[27]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsx(Ue,{size:14}),t[27]=D):D=t[27];let r;t[28]!==a||t[29]!==N?(r=s.jsx("button",{type:"button",onClick:a,className:"text-muted-foreground hover:text-foreground p-1 rounded","aria-label":N,children:D}),t[28]=a,t[29]=N,t[30]=r):r=t[30];let O;return t[31]!==j||t[32]!==p||t[33]!==z||t[34]!==b||t[35]!==A||t[36]!==r||t[37]!==g?(O=s.jsxs("div",{ref:j,style:p,className:g,children:[z,b,A,r]}),t[31]=j,t[32]=p,t[33]=z,t[34]=b,t[35]=A,t[36]=r,t[37]=g,t[38]=O):O=t[38],O}function ct(e){const t=T.c(39),{selectedIds:l,onAdd:a}=e,[c,f]=K.useState(!1),[n,j]=K.useState(""),u=ce();let v;t[0]!==l?(v=new Set(l),t[0]=l,t[1]=v):v=t[1];const o=v;let i,d,m,x,p,w,g,h,S,z;if(t[2]!==u||t[3]!==a||t[4]!==c||t[5]!==n||t[6]!==o){const P=n.toLowerCase();let y;t[17]!==o?(y=r=>r.id!==null&&!Te(r.id)&&!o.has(r.id),t[17]=o,t[18]=y):y=t[18];const A=u.filter(y).filter(r=>!n||r.title.toLowerCase().includes(P));let N;t[19]!==a?(N=r=>{a(r),f(!1),j("")},t[19]=a,t[20]=N):N=t[20];const D=N;d=Le,h=c,S=f,t[21]===Symbol.for("react.memo_cache_sentinel")?(z=s.jsx(Me,{asChild:!0,children:s.jsxs(H,{type:"button",variant:"outline",size:"sm",children:[s.jsx(He,{size:14}),"Add agent"]})}),t[21]=z):z=t[21],i=qe,p="w-[320px] p-0 overflow-hidden",w="start",t[22]!==n?(g=s.jsx(Ke,{value:n,onChange:j,placeholder:"Search agents..."}),t[22]=n,t[23]=g):g=t[23],m="max-h-[320px] overflow-y-auto p-2 flex flex-col gap-3",x=A.length>0?s.jsx("div",{className:"flex flex-col gap-1",children:A.map(r=>s.jsxs("button",{type:"button",onClick:()=>D(r.id),className:"flex items-center gap-2 px-2 py-1.5 rounded-md hover:bg-accent text-left",children:[s.jsx(me,{icon:r.icon,name:r.title,size:"xs",fallbackIcon:s.jsx(de,{size:14})}),s.jsx("span",{className:"text-sm truncate",children:r.title})]},r.id))}):s.jsx("div",{className:"text-xs text-muted-foreground text-center py-6",children:n?"No agents found":"All agents are already added"}),t[2]=u,t[3]=a,t[4]=c,t[5]=n,t[6]=o,t[7]=i,t[8]=d,t[9]=m,t[10]=x,t[11]=p,t[12]=w,t[13]=g,t[14]=h,t[15]=S,t[16]=z}else i=t[7],d=t[8],m=t[9],x=t[10],p=t[11],w=t[12],g=t[13],h=t[14],S=t[15],z=t[16];let C;t[24]!==m||t[25]!==x?(C=s.jsx("div",{className:m,children:x}),t[24]=m,t[25]=x,t[26]=C):C=t[26];let b;t[27]!==i||t[28]!==C||t[29]!==p||t[30]!==w||t[31]!==g?(b=s.jsxs(i,{className:p,align:w,children:[g,C]}),t[27]=i,t[28]=C,t[29]=p,t[30]=w,t[31]=g,t[32]=b):b=t[32];let _;return t[33]!==d||t[34]!==b||t[35]!==h||t[36]!==S||t[37]!==z?(_=s.jsxs(d,{open:h,onOpenChange:S,children:[z,b]}),t[33]=d,t[34]=b,t[35]=h,t[36]=S,t[37]=z,t[38]=_):_=t[38],_}function dt(){const e=T.c(61),t=Ge(),l=ce(),a=Qe();let c;e[0]!==t?.ids?(c=t?.ids??[],e[0]=t?.ids,e[1]=c):c=e[1];const f=c,[n,j]=K.useState(f);let u;e[2]!==n||e[3]!==f?(u=n.length!==f.length||n.some((k,F)=>k!==f[F]),e[2]=n,e[3]=f,e[4]=u):u=e[4];const v=u;let o;e[5]===Symbol.for("react.memo_cache_sentinel")?(o={activationConstraint:{distance:5}},e[5]=o):o=e[5];let i;e[6]===Symbol.for("react.memo_cache_sentinel")?(i={coordinateGetter:Ee},e[6]=i):i=e[6];const d=ze(se(De,o),se(Ne,i));let m;e[7]!==n?(m=k=>{const{active:F,over:M}=k;if(!M||F.id===M.id)return;const q=n.indexOf(F.id),$=n.indexOf(M.id);q===-1||$===-1||j(Fe([...n],q,$))},e[7]=n,e[8]=m):m=e[8];const x=m;let p;e[9]!==n?(p=k=>{n.includes(k)||j([...n,k])},e[9]=n,e[10]=p):p=e[10];const w=p;let g;e[11]!==n?(g=k=>{j(n.filter(F=>F!==k))},e[11]=n,e[12]=g):g=e[12];const h=g;let S;e[13]===Symbol.for("react.memo_cache_sentinel")?(S=()=>{j([])},e[13]=S):S=e[13];const z=S;let C;e[14]!==n||e[15]!==a?(C=()=>{a.mutate({ids:n},{onSuccess:()=>{Y("default_home_agents_updated",{count:n.length}),L.success("Default home agents updated")},onError:mt})},e[14]=n,e[15]=a,e[16]=C):C=e[16];const b=C;let _,P,y,A,N,D,r;if(e[17]!==l||e[18]!==n||e[19]!==x||e[20]!==h||e[21]!==d||e[22]!==a.isPending){let k;e[30]!==l?(k=$=>at($,l),e[30]=l,e[31]=k):k=e[31];const F=n.map(k);y=Math.max(0,n.length-ne),P=J,N="Default home agents";const M=a.isPending||n.length===0;let q;e[32]===Symbol.for("react.memo_cache_sentinel")?(q=s.jsx(he,{size:14}),e[32]=q):q=e[32],e[33]!==M?(D=s.jsxs(H,{type:"button",variant:"ghost",size:"sm",onClick:z,disabled:M,children:[q,"Clear all"]}),e[33]=M,e[34]=D):D=e[34],_=W,r="px-5 py-5 flex flex-col gap-3",A=F.length===0?s.jsx("div",{className:"rounded-lg border border-dashed border-border p-6 text-center text-xs text-muted-foreground",children:'No agents selected. The home view will only show "Create agent".'}):s.jsx(we,{sensors:d,collisionDetection:Ae,onDragEnd:x,children:s.jsx(Pe,{items:n,strategy:Oe,children:s.jsx("div",{className:"flex flex-col gap-1.5",children:F.map(($,ue)=>s.jsxs("div",{className:"flex flex-col gap-1.5",children:[ue===ne&&s.jsxs("div",{className:"flex items-center gap-2 px-1 py-1 text-xs text-muted-foreground",children:[s.jsx("div",{className:"flex-1 h-px bg-border"}),s.jsx("span",{children:"Below this line is hidden on the home view"}),s.jsx("div",{className:"flex-1 h-px bg-border"})]}),s.jsx(rt,{agent:$,onRemove:()=>h($.id)})]},$.id))})})}),e[17]=l,e[18]=n,e[19]=x,e[20]=h,e[21]=d,e[22]=a.isPending,e[23]=_,e[24]=P,e[25]=y,e[26]=A,e[27]=N,e[28]=D,e[29]=r}else _=e[23],P=e[24],y=e[25],A=e[26],N=e[27],D=e[28],r=e[29];let O;e[35]!==n||e[36]!==w?(O=s.jsx(ct,{selectedIds:n,onAdd:w}),e[35]=n,e[36]=w,e[37]=O):O=e[37];let I;e[38]!==y?(I=y>0&&s.jsxs("span",{className:"text-xs text-muted-foreground",children:[y," agent",y===1?"":"s"," won't fit on the home view"]}),e[38]=y,e[39]=I):I=e[39];let E;e[40]!==O||e[41]!==I?(E=s.jsxs("div",{className:"flex items-center justify-between",children:[O,I]}),e[40]=O,e[41]=I,e[42]=E):E=e[42];let R;e[43]!==A||e[44]!==E||e[45]!==r?(R=s.jsxs("div",{className:r,children:[A,E]}),e[43]=A,e[44]=E,e[45]=r,e[46]=R):R=e[46];let B;e[47]!==b||e[48]!==f||e[49]!==v||e[50]!==a.isPending?(B=v&&s.jsxs(Se,{children:[s.jsx(H,{type:"button",variant:"outline",onClick:()=>j(f),disabled:a.isPending,children:"Cancel"}),s.jsx(H,{type:"button",onClick:b,disabled:a.isPending,children:a.isPending?"Saving…":"Save"})]}),e[47]=b,e[48]=f,e[49]=v,e[50]=a.isPending,e[51]=B):B=e[51];let V;e[52]!==_||e[53]!==R||e[54]!==B?(V=s.jsxs(_,{children:[R,B]}),e[52]=_,e[53]=R,e[54]=B,e[55]=V):V=e[55];let U;return e[56]!==P||e[57]!==N||e[58]!==D||e[59]!==V?(U=s.jsx(P,{title:N,actions:D,children:V}),e[56]=P,e[57]=N,e[58]=D,e[59]=V,e[60]=U):U=e[60],U}function mt(e){L.error(e instanceof Error?e.message:"Failed to update default home agents")}function ut(){const e=T.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(J,{title:"Default home agents",children:s.jsx(W,{children:s.jsx("div",{className:"px-5 py-5 flex flex-col gap-2",children:Array.from({length:4}).map(gt)})})}),e[0]=t):t=e[0],t}function gt(e,t){return s.jsx(Be,{className:"h-12 w-full rounded-lg"},t)}function ft(){const e=T.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(K.Suspense,{fallback:s.jsx(ut,{}),children:s.jsx(dt,{})}),e[0]=t):t=e[0],t}function xt(){const e=T.c(47),{org:t}=ie(),l=oe(),a=le(),[c,f]=K.useState(!1),[n,j]=K.useState("");let u;e[0]!==t.id||e[1]!==t.slug?(u={connectionId:Re,orgSlug:t.slug,orgId:t.id},e[0]=t.id,e[1]=t.slug,e[2]=u):u=e[2];const v=$e(u);let o;e[3]!==t.id||e[4]!==v?(o=async()=>{const I=await v.callTool({name:"ORGANIZATION_DELETE",arguments:{id:t.id}});if(I.isError){const E=I.content,R=Array.isArray(E)&&E[0]?.type==="text"&&typeof E[0].text=="string"?E[0].text:"Failed to delete organization";throw new Error(R)}},e[3]=t.id,e[4]=v,e[5]=o):o=e[5];let i;e[6]!==l||e[7]!==t.id||e[8]!==t.slug||e[9]!==a?(i=()=>{Y("organization_deleted",{organization_id:t.id}),localStorage.getItem(te.lastOrgSlug())===t.slug&&localStorage.removeItem(te.lastOrgSlug()),je(),a.removeQueries({queryKey:Z.activeOrganization(t.slug)}),a.invalidateQueries({queryKey:Z.organizations()}),L.success("Organization deleted"),l({to:"/"})},e[6]=l,e[7]=t.id,e[8]=t.slug,e[9]=a,e[10]=i):i=e[10];let d;e[11]!==o||e[12]!==i?(d={mutationFn:o,onSuccess:i,onError:pt},e[11]=o,e[12]=i,e[13]=d):d=e[13];const m=ae(d);let x;e[14]===Symbol.for("react.memo_cache_sentinel")?(x=()=>f(!0),e[14]=x):x=e[14];let p;e[15]!==m.isPending?(p=s.jsx(J,{title:"Danger Zone",description:"Irreversible actions that affect your entire organization.",children:s.jsx(W,{className:"border-destructive/40",children:s.jsx(Q,{title:"Delete organization",description:"Permanently delete this organization and all of its data. This action cannot be undone.",action:s.jsx(H,{variant:"destructive",size:"sm",onClick:x,disabled:m.isPending,children:"Delete"})})})}),e[15]=m.isPending,e[16]=p):p=e[16];let w;e[17]===Symbol.for("react.memo_cache_sentinel")?(w=I=>{f(I),I||j("")},e[17]=w):w=e[17];let g;e[18]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(Ye,{children:"Delete Organization?"}),e[18]=g):g=e[18];let h;e[19]!==t.name?(h=s.jsxs("p",{children:["This will permanently delete all data associated with"," ",s.jsx("span",{className:"font-medium text-foreground",children:t.name}),". This action cannot be undone."]}),e[19]=t.name,e[20]=h):h=e[20];let S;e[21]!==t.name?(S=s.jsxs("p",{className:"mt-3 mb-1.5",children:["Type"," ",s.jsx("span",{className:"font-medium text-foreground",children:t.name})," ","to confirm:"]}),e[21]=t.name,e[22]=S):S=e[22];let z;e[23]===Symbol.for("react.memo_cache_sentinel")?(z=I=>j(I.target.value),e[23]=z):z=e[23];let C;e[24]!==n||e[25]!==t.name?(C=s.jsx(re,{value:n,onChange:z,placeholder:t.name,autoFocus:!0}),e[24]=n,e[25]=t.name,e[26]=C):C=e[26];let b;e[27]!==C||e[28]!==h||e[29]!==S?(b=s.jsxs(Ze,{children:[g,s.jsx(Je,{asChild:!0,children:s.jsxs("div",{children:[h,S,C]})})]}),e[27]=C,e[28]=h,e[29]=S,e[30]=b):b=e[30];let _;e[31]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx(We,{children:"Cancel"}),e[31]=_):_=e[31];let P;e[32]!==m?(P=()=>m.mutate(),e[32]=m,e[33]=P):P=e[33];const y=n!==t.name||m.isPending,A=m.isPending?"Deleting…":"Delete organization";let N;e[34]!==P||e[35]!==y||e[36]!==A?(N=s.jsxs(Xe,{children:[_,s.jsx(et,{onClick:P,disabled:y,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90 disabled:opacity-50",children:A})]}),e[34]=P,e[35]=y,e[36]=A,e[37]=N):N=e[37];let D;e[38]!==b||e[39]!==N?(D=s.jsxs(tt,{children:[b,N]}),e[38]=b,e[39]=N,e[40]=D):D=e[40];let r;e[41]!==c||e[42]!==D?(r=s.jsx(st,{open:c,onOpenChange:w,children:D}),e[41]=c,e[42]=D,e[43]=r):r=e[43];let O;return e[44]!==r||e[45]!==p?(O=s.jsxs(s.Fragment,{children:[p,r]}),e[44]=r,e[45]=p,e[46]=O):O=e[46],O}function pt(e){L.error(e instanceof Error?e.message:"Failed to delete organization")}function ht(){const e=T.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(G,{children:s.jsx(G.Content,{children:s.jsx(G.Body,{children:s.jsxs(Ce,{children:[s.jsx(G.Title,{children:"Organization"}),s.jsx(lt,{}),s.jsx(_e,{}),s.jsx(ft,{}),s.jsx(xt,{})]})})})}),e[0]=t):t=e[0],t}function Ds(){const e=T.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(ht,{}),e[0]=t):t=e[0],t}export{Ds as default};
|