decocms 2.276.3 → 2.277.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-B4Z_bYRy.js → AlertCircle-ZN1y5-aw.js} +1 -1
- package/dist/client/assets/{ArrowNarrowLeft-Cfmub-b9.js → ArrowNarrowLeft-BPki4rs6.js} +1 -1
- package/dist/client/assets/{CheckCircle-BCmdWySf.js → CheckCircle-CzlD2NtZ.js} +1 -1
- package/dist/client/assets/{ChevronDown-LbB92Eif.js → ChevronDown-BjlYfwkz.js} +1 -1
- package/dist/client/assets/{ChevronRight-Bp2wM59-.js → ChevronRight-Ers_V2D1.js} +1 -1
- package/dist/client/assets/{ChevronUp-DugRD1Os.js → ChevronUp-BFd66NER.js} +1 -1
- package/dist/client/assets/{Container-4EEqLr04.js → Container-BH-IjM7q.js} +1 -1
- package/dist/client/assets/{LinkExternal01-n0OTj3Hs.js → LinkExternal01-Df1708RH.js} +1 -1
- package/dist/client/assets/{Lock01-Bcc8tT2X.js → Lock01-DC87zCkJ.js} +1 -1
- package/dist/client/assets/{Palette-DJlRra7b.js → Palette-BAefAlJJ.js} +1 -1
- package/dist/client/assets/{Play-DE1MmEh7.js → Play-8RSCt4_z.js} +1 -1
- package/dist/client/assets/{Plus-lTLN-5sW.js → Plus-D7R85tnb.js} +1 -1
- package/dist/client/assets/{SearchMd-Ch9A9-sY.js → SearchMd-CuF0EE4i.js} +1 -1
- package/dist/client/assets/{Settings02-CRSd_kje.js → Settings02-0biYSyip.js} +1 -1
- package/dist/client/assets/{Star01-jT36fQMs.js → Star01-DG4GVqjt.js} +1 -1
- package/dist/client/assets/{Sun-BjJ31DgB.js → Sun-bNHtETAN.js} +1 -1
- package/dist/client/assets/{Tool01-BABHhadV.js → Tool01-BYIP93fl.js} +1 -1
- package/dist/client/assets/{Trash01-qTBTo_1R.js → Trash01-DiVIK0OP.js} +1 -1
- package/dist/client/assets/{Upload01-D584ZGhL.js → Upload01-1ZdG7oJK.js} +1 -1
- package/dist/client/assets/{User01-Dn7ERaE8.js → User01-ZdNcPumq.js} +1 -1
- package/dist/client/assets/{Users03-CLsqBvj5.js → Users03-C4Ee_frB.js} +1 -1
- package/dist/client/assets/{X-DbufVvYT.js → X-DJVuZ58d.js} +1 -1
- package/dist/client/assets/{XCircle-CMz1Sln8.js → XCircle-C-PtnVDi.js} +1 -1
- package/dist/client/assets/{Zap-DCaRrmPx.js → Zap-DFbFP4h9.js} +1 -1
- package/dist/client/assets/{ZapSquare-DOWrBmYM.js → ZapSquare-Bn1DnHGa.js} +1 -1
- package/dist/client/assets/{accordion-BM2v3K-F.js → accordion-BKyKwvi4.js} +1 -1
- package/dist/client/assets/{agent-icon-WnDt_mly.js → agent-icon-BCqNXHrJ.js} +1 -1
- package/dist/client/assets/{agents-list-B15lvUTv.js → agents-list-st6j9oA0.js} +1 -1
- package/dist/client/assets/ai-providers-Cq8P81dq.js +1 -0
- package/dist/client/assets/{alert-dialog-BGXEvrTS.js → alert-dialog-Cce2zNSt.js} +1 -1
- package/dist/client/assets/{auth-catchall-BhYcp03z.js → auth-catchall-DOZwh2ME.js} +1 -1
- package/dist/client/assets/{automation-list-row-CzwsnIcA.js → automation-list-row-D3uOWcPZ.js} +1 -1
- package/dist/client/assets/{automations-BleBenZq.js → automations-_4yX33cm.js} +1 -1
- package/dist/client/assets/{avatar-B6IagwQu.js → avatar-DtO_DjAh.js} +1 -1
- package/dist/client/assets/{badge-CYgBI6R4.js → badge-y-hsEihY.js} +1 -1
- package/dist/client/assets/{brand-context-kUM9sJBK.js → brand-context-zVTleDgN.js} +1 -1
- package/dist/client/assets/{card-CDkIOtIp.js → card-Dgjac7df.js} +1 -1
- package/dist/client/assets/{chat-context-DeS_zKzS.js → chat-context-jZHB4zZq.js} +1 -1
- package/dist/client/assets/{checkbox-B1ZvEQ9K.js → checkbox-BK1FOOnx.js} +1 -1
- package/dist/client/assets/{collection-detail-C4RjlFe9.js → collection-detail-x76KaTbs.js} +1 -1
- package/dist/client/assets/{collection-display-button-BYlepxvt.js → collection-display-button-Gr_qxtzC.js} +1 -1
- package/dist/client/assets/{collection-search-BaDjhV61.js → collection-search-9bv6LiW5.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-BtJe8KWC.js → collection-table-wrapper-BD46An7o.js} +1 -1
- package/dist/client/assets/{collection-tabs-B5daS-aK.js → collection-tabs-DBij18bF.js} +1 -1
- package/dist/client/assets/{collections-CnDJSz0t.js → collections-BZR-yDlA.js} +1 -1
- package/dist/client/assets/{command-CVgGbZrE.js → command-DsPZNxzv.js} +1 -1
- package/dist/client/assets/{connection-card-DAXfCJL1.js → connection-card-Cavj0z1s.js} +1 -1
- package/dist/client/assets/{connection-detail-0iVaAltH.js → connection-detail-B_MywG2r.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-BK0aECJK.js → connection-form-helpers-BickqfM0.js} +1 -1
- package/dist/client/assets/{connections-CPgxORLh.js → connections-Di7YhHpL.js} +1 -1
- package/dist/client/assets/{constants-BxY9N-ws.js → constants-B6BlNNCv.js} +1 -1
- package/dist/client/assets/{constants-MEMD8ENM.js → constants-D4bpaQIy.js} +1 -1
- package/dist/client/assets/{dialog-D8xpcPd2.js → dialog-CrC-U752.js} +1 -1
- package/dist/client/assets/{drawer-BpOYQqLe.js → drawer-D164IDvt.js} +1 -1
- package/dist/client/assets/{dropdown-menu-ClMXG_z6.js → dropdown-menu-BCSsOhoD.js} +1 -1
- package/dist/client/assets/{dynamic-plugin-layout-BDs8LP0t.js → dynamic-plugin-layout-PtppgAts.js} +1 -1
- package/dist/client/assets/{empty-state-DqQ_mj5B.js → empty-state-Burt6Pjq.js} +1 -1
- package/dist/client/assets/{empty-state-DlH6Q1vv.js → empty-state-CMAHTHUe.js} +1 -1
- package/dist/client/assets/{extract-connection-data-BattRyEN.js → extract-connection-data-CIGH4JOA.js} +1 -1
- package/dist/client/assets/{features-BgwyDCES.js → features-DkrqQmvn.js} +1 -1
- package/dist/client/assets/{form-pojp-kTY.js → form-NpftjNqr.js} +1 -1
- package/dist/client/assets/{general-AROtMABc.js → general-CPi9v1zL.js} +1 -1
- package/dist/client/assets/{index-CtnGGdXo.js → index-BabWp460.js} +1 -1
- package/dist/client/assets/{index-BSxLmbjR.js → index-C7Syt5sm.js} +23 -23
- package/dist/client/assets/{index-DiAp1HHT.js → index-CESHAiFx.js} +1 -1
- package/dist/client/assets/{index-BFVdz8if.js → index-CMJ6GQ7C.js} +3 -3
- package/dist/client/assets/{index-DIVxtkpR.js → index-CSCpQ3nk.js} +1 -1
- package/dist/client/assets/{index-Coav-ncz.js → index-ClWc2yds.js} +1 -1
- package/dist/client/assets/{index-DY2kqbCP.js → index-CmG3u4sk.js} +1 -1
- package/dist/client/assets/{index-WGfZydLo.js → index-D0eg_rFC.js} +2 -2
- package/dist/client/assets/{index-B2JtGbgE.js → index-DE-s5va1.js} +1 -1
- package/dist/client/assets/{index-C3NVKlFX.js → index-MDHGBKc3.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-CdZ0ASHN.js → infiniteQueryObserver-CpBPXtl6.js} +1 -1
- package/dist/client/assets/{input-Bzj33Fxq.js → input-B0rO4kCw.js} +1 -1
- package/dist/client/assets/{integration-icon-ZjWVueCq.js → integration-icon-yOwsHf6q.js} +1 -1
- package/dist/client/assets/{label-DiBCBN0N.js → label-DEuSkBBi.js} +1 -1
- package/dist/client/assets/{layout-BXIOD6PJ.js → layout-CEdjROI5.js} +1 -1
- package/dist/client/assets/{lean-canvas-recruit-modal-BL32AVEC.js → lean-canvas-recruit-modal-BMnsbvdl.js} +1 -1
- package/dist/client/assets/{login-CXDNRsDi.js → login-vu3mdB5z.js} +1 -1
- package/dist/client/assets/{members-DVaoQxs-.js → members-DtGUx-F1.js} +1 -1
- package/dist/client/assets/{monaco-editor-lqRUssyU.js → monaco-editor-wLqdDZ5S.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-BcGs8N45.js → monitoring-stats-row-5HVh1Gjz.js} +1 -1
- package/dist/client/assets/{oauth-callback-C20Tc5eT.js → oauth-callback-DXN54EUy.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-CHWLGFFS.js → oauth-callback-ai-provider-W7GdFBbP.js} +1 -1
- package/dist/client/assets/{onboarding-AqO1F9Ot.js → onboarding-BeW6omQ6.js} +1 -1
- package/dist/client/assets/{org-layout-GwZNK-gH.js → org-layout-Cp3RupKt.js} +1 -1
- package/dist/client/assets/{org-plugin-layout-DiKymIqI.js → org-plugin-layout-Bnfoicc4.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-BmbedKr8.js → plugin-empty-state-0LwQ6R3R.js} +1 -1
- package/dist/client/assets/{plugin-header-5ddC-K4s.js → plugin-header-BYiR1ua4.js} +1 -1
- package/dist/client/assets/{plugin-layout-ZLFaNfn_.js → plugin-layout-DCOghZWx.js} +1 -1
- package/dist/client/assets/{popover-DB3l_dUB.js → popover-DUh9iDm9.js} +1 -1
- package/dist/client/assets/{profile-BXxzRaC3.js → profile-Bk0bLa4g.js} +1 -1
- package/dist/client/assets/{project-app-view-CLbmaYfp.js → project-app-view-BtOMb74o.js} +1 -1
- package/dist/client/assets/registry-CorCxIMC.js +2 -0
- package/dist/client/assets/{registry-layout-Bcu6gWnT.js → registry-layout-TU21GgUM.js} +1 -1
- package/dist/client/assets/{required-auth-layout-DXAKQPxa.js → required-auth-layout-eS3mZHM3.js} +1 -1
- package/dist/client/assets/{reset-password-BgkjBAas.js → reset-password-nmqGdy62.js} +1 -1
- package/dist/client/assets/{scroll-area-Df4WEHfA.js → scroll-area-BPvcbDba.js} +1 -1
- package/dist/client/assets/{search-input-BgrLZ0dV.js → search-input-DuumYWEB.js} +1 -1
- package/dist/client/assets/{select-DMGlO4yi.js → select-DV6Y5fbl.js} +1 -1
- package/dist/client/assets/select-model-BhJ9eJ30.js +4 -0
- package/dist/client/assets/{settings-layout-DGJoyTnE.js → settings-layout-C6WZX8H8.js} +1 -1
- package/dist/client/assets/{shell-layout-DjJ6Z_Cf.js → shell-layout-Bx85tvr4.js} +1 -1
- package/dist/client/assets/{skeleton-CAEDpRxb.js → skeleton-C_5kHpZw.js} +1 -1
- package/dist/client/assets/{sso-D1MeHfxN.js → sso-Du9xnoxY.js} +1 -1
- package/dist/client/assets/{store-C324vYbF.js → store-DFSqH5M5.js} +1 -1
- package/dist/client/assets/store-registry-ysGrUhGY.js +2 -0
- package/dist/client/assets/{switch-DjEl0Zkr.js → switch-CbAhbOmy.js} +1 -1
- package/dist/client/assets/{table-DAEmh2te.js → table-D03jqlLZ.js} +1 -1
- package/dist/client/assets/{tabs-3MozWL7O.js → tabs-DtdegoWH.js} +1 -1
- package/dist/client/assets/{task-status-DlDVvsLX.js → task-status-BgBSzATn.js} +1 -1
- package/dist/client/assets/{textarea-CfqOOIJa.js → textarea-D_j-5IAu.js} +1 -1
- package/dist/client/assets/{toggle-group-CNs9-MRq.js → toggle-group-DDh5VZ6f.js} +1 -1
- package/dist/client/assets/{tools-list-Bc5Oy8LD.js → tools-list-CJJNUxfe.js} +1 -1
- package/dist/client/assets/{types-D_q3jEZ8.js → types-CXkK-iOI.js} +1 -1
- package/dist/client/assets/{use-ai-providers-StUHlUMB.js → use-ai-providers-ElYJdGU0.js} +1 -1
- package/dist/client/assets/{use-collections-DEST7K_q.js → use-collections-ByN3iK_-.js} +1 -1
- package/dist/client/assets/{use-connection-CbAQnOed.js → use-connection-DS4JMmfK.js} +1 -1
- package/dist/client/assets/{use-copy-Cl4ZPEvD.js → use-copy-1vU78qsX.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-CwozrztD.js → use-create-virtual-mcp-C0ZtxKxG.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-K_yfq6tB.js → use-decopilot-events-Dv7rn_zQ.js} +1 -1
- package/dist/client/assets/{use-delete-connection-BjsFe5Xj.js → use-delete-connection-CnPoPnuN.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-BCfAtSyW.js → use-infinite-scroll-D9oxXo_y.js} +1 -1
- package/dist/client/assets/{use-list-state-Dk_FNgfa.js → use-list-state-Bt2BkuK4.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-BtTkT0ox.js → use-mcp-tools-CpSp-YOn.js} +1 -1
- package/dist/client/assets/{use-members-DVLjy3CZ.js → use-members-CN2GRsgZ.js} +1 -1
- package/dist/client/assets/{use-mobile-vpGkifWc.js → use-mobile-D5xdghWW.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-Dg-q0ecS.js → use-navigate-to-agent-DC2aXNSM.js} +1 -1
- package/dist/client/assets/{use-org-sso-DK-UaGWB.js → use-org-sso-HLMtUxyI.js} +1 -1
- package/dist/client/assets/{use-organization-settings-D9EGsoNi.js → use-organization-settings-CRVxUE8d.js} +1 -1
- package/dist/client/assets/{use-registry-connections-CjUJFqM_.js → use-registry-connections-DiPCzdOz.js} +1 -1
- package/dist/client/assets/{use-status-sounds-CuOzTU0E.js → use-status-sounds-CepswEV9.js} +1 -1
- package/dist/client/assets/{use-tasks-Cf8x3tn2.js → use-tasks-Cvm0js2U.js} +1 -1
- package/dist/client/assets/{use-view-mode-Cz3j5joy.js → use-view-mode-Qb4bThwm.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-DJidRNsl.js → use-virtual-mcp-DmXmoSMd.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-BmiRpP8z.js +1 -0
- package/dist/client/assets/{user-DJ61KCKE.js → user-rEzOpeDj.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-D3cr4bdy.js → view-mode-toggle-EUXERI9v.js} +1 -1
- package/dist/client/assets/{workflow-BJJzWzRg.js → workflow-CD3p-F8j.js} +1 -1
- package/dist/client/assets/workflow-detail-DH47DpCR.js +1 -0
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +166 -166
- package/dist/server/node_modules/pg/README.md +95 -0
- package/dist/server/node_modules/pg/esm/index.mjs +20 -0
- package/dist/server/node_modules/pg/lib/client.js +743 -0
- package/dist/server/node_modules/pg/lib/connection-parameters.js +171 -0
- package/dist/server/node_modules/pg/lib/connection.js +221 -0
- package/dist/server/node_modules/pg/lib/crypto/cert-signatures.js +122 -0
- package/dist/server/node_modules/pg/lib/crypto/sasl.js +212 -0
- package/dist/server/node_modules/pg/lib/crypto/utils-legacy.js +43 -0
- package/dist/server/node_modules/pg/lib/crypto/utils-webcrypto.js +89 -0
- package/dist/server/node_modules/pg/lib/crypto/utils.js +9 -0
- package/dist/server/node_modules/pg/lib/defaults.js +91 -0
- package/dist/server/node_modules/pg/lib/index.js +73 -0
- package/dist/server/node_modules/pg/lib/native/client.js +323 -0
- package/dist/server/node_modules/pg/lib/native/index.js +2 -0
- package/dist/server/node_modules/pg/lib/native/query.js +165 -0
- package/dist/server/node_modules/pg/lib/query.js +252 -0
- package/dist/server/node_modules/pg/lib/result.js +109 -0
- package/dist/server/node_modules/pg/lib/stream.js +83 -0
- package/dist/server/node_modules/pg/lib/type-overrides.js +35 -0
- package/dist/server/node_modules/pg/lib/utils.js +217 -0
- package/dist/server/node_modules/pg/package.json +76 -0
- package/package.json +1 -1
- package/dist/client/assets/ai-providers-B3rFYyQJ.js +0 -1
- package/dist/client/assets/registry-h9nbKgtr.js +0 -2
- package/dist/client/assets/select-model-D4EGus9X.js +0 -4
- package/dist/client/assets/store-registry-DkhNudAU.js +0 -2
- package/dist/client/assets/useInfiniteQuery-ChHJkjep.js +0 -1
- package/dist/client/assets/workflow-detail-CPLNyuzk.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
- package/dist/server/node_modules/convert-to-spaces/dist/index.d.ts +0 -2
- package/dist/server/node_modules/convert-to-spaces/dist/index.js +0 -4
- package/dist/server/node_modules/convert-to-spaces/license +0 -21
- package/dist/server/node_modules/convert-to-spaces/package.json +0 -40
- package/dist/server/node_modules/convert-to-spaces/readme.md +0 -39
- package/dist/server/node_modules/environment/index.d.ts +0 -74
- package/dist/server/node_modules/environment/index.js +0 -47
- package/dist/server/node_modules/environment/license +0 -9
- package/dist/server/node_modules/environment/package.json +0 -74
- package/dist/server/node_modules/environment/readme.md +0 -94
- package/dist/server/node_modules/escape-string-regexp/index.d.ts +0 -18
- package/dist/server/node_modules/escape-string-regexp/index.js +0 -11
- package/dist/server/node_modules/escape-string-regexp/license +0 -9
- package/dist/server/node_modules/escape-string-regexp/package.json +0 -43
- package/dist/server/node_modules/escape-string-regexp/readme.md +0 -29
- package/dist/server/node_modules/is-fullwidth-code-point/index.d.ts +0 -17
- package/dist/server/node_modules/is-fullwidth-code-point/index.js +0 -12
- package/dist/server/node_modules/is-fullwidth-code-point/license +0 -9
- package/dist/server/node_modules/is-fullwidth-code-point/package.json +0 -53
- package/dist/server/node_modules/is-fullwidth-code-point/readme.md +0 -31
- package/dist/server/node_modules/is-unicode-supported/index.d.ts +0 -12
- package/dist/server/node_modules/is-unicode-supported/index.js +0 -21
- package/dist/server/node_modules/is-unicode-supported/license +0 -9
- package/dist/server/node_modules/is-unicode-supported/package.json +0 -47
- package/dist/server/node_modules/is-unicode-supported/readme.md +0 -35
- package/dist/server/node_modules/mimic-fn/index.d.ts +0 -54
- package/dist/server/node_modules/mimic-fn/index.js +0 -13
- package/dist/server/node_modules/mimic-fn/license +0 -9
- package/dist/server/node_modules/mimic-fn/package.json +0 -42
- package/dist/server/node_modules/mimic-fn/readme.md +0 -69
- package/dist/server/node_modules/pg-cloudflare/README.md +0 -112
- package/dist/server/node_modules/pg-cloudflare/dist/empty.d.ts +0 -2
- package/dist/server/node_modules/pg-cloudflare/dist/empty.js +0 -6
- package/dist/server/node_modules/pg-cloudflare/dist/empty.js.map +0 -1
- package/dist/server/node_modules/pg-cloudflare/dist/index.d.ts +0 -31
- package/dist/server/node_modules/pg-cloudflare/dist/index.js +0 -152
- package/dist/server/node_modules/pg-cloudflare/dist/index.js.map +0 -1
- package/dist/server/node_modules/pg-cloudflare/esm/index.mjs +0 -3
- package/dist/server/node_modules/pg-cloudflare/package.json +0 -39
- package/dist/server/node_modules/pg-cloudflare/src/empty.ts +0 -3
- package/dist/server/node_modules/pg-cloudflare/src/index.ts +0 -166
- package/dist/server/node_modules/pg-cloudflare/src/types.d.ts +0 -25
- package/dist/server/node_modules/pg-connection-string/LICENSE +0 -21
- package/dist/server/node_modules/pg-connection-string/README.md +0 -105
- package/dist/server/node_modules/pg-connection-string/esm/index.mjs +0 -8
- package/dist/server/node_modules/pg-connection-string/index.d.ts +0 -36
- package/dist/server/node_modules/pg-connection-string/index.js +0 -231
- package/dist/server/node_modules/pg-connection-string/package.json +0 -52
- package/dist/server/node_modules/pg-int8/LICENSE +0 -13
- package/dist/server/node_modules/pg-int8/README.md +0 -16
- package/dist/server/node_modules/pg-int8/index.js +0 -100
- package/dist/server/node_modules/pg-int8/package.json +0 -24
- package/dist/server/node_modules/pg-protocol/LICENSE +0 -21
- package/dist/server/node_modules/pg-protocol/README.md +0 -3
- package/dist/server/node_modules/pg-protocol/dist/b.d.ts +0 -1
- package/dist/server/node_modules/pg-protocol/dist/b.js +0 -23
- package/dist/server/node_modules/pg-protocol/dist/b.js.map +0 -1
- package/dist/server/node_modules/pg-protocol/dist/buffer-reader.d.ts +0 -15
- package/dist/server/node_modules/pg-protocol/dist/buffer-reader.js +0 -55
- package/dist/server/node_modules/pg-protocol/dist/buffer-reader.js.map +0 -1
- package/dist/server/node_modules/pg-protocol/dist/buffer-writer.d.ts +0 -16
- package/dist/server/node_modules/pg-protocol/dist/buffer-writer.js +0 -81
- package/dist/server/node_modules/pg-protocol/dist/buffer-writer.js.map +0 -1
- package/dist/server/node_modules/pg-protocol/dist/inbound-parser.test.d.ts +0 -1
- package/dist/server/node_modules/pg-protocol/dist/inbound-parser.test.js +0 -530
- package/dist/server/node_modules/pg-protocol/dist/inbound-parser.test.js.map +0 -1
- package/dist/server/node_modules/pg-protocol/dist/index.d.ts +0 -6
- package/dist/server/node_modules/pg-protocol/dist/index.js +0 -15
- package/dist/server/node_modules/pg-protocol/dist/index.js.map +0 -1
- package/dist/server/node_modules/pg-protocol/dist/messages.d.ts +0 -162
- package/dist/server/node_modules/pg-protocol/dist/messages.js +0 -160
- package/dist/server/node_modules/pg-protocol/dist/messages.js.map +0 -1
- package/dist/server/node_modules/pg-protocol/dist/outbound-serializer.test.d.ts +0 -1
- package/dist/server/node_modules/pg-protocol/dist/outbound-serializer.test.js +0 -252
- package/dist/server/node_modules/pg-protocol/dist/outbound-serializer.test.js.map +0 -1
- package/dist/server/node_modules/pg-protocol/dist/parser.d.ts +0 -24
- package/dist/server/node_modules/pg-protocol/dist/parser.js +0 -324
- package/dist/server/node_modules/pg-protocol/dist/parser.js.map +0 -1
- package/dist/server/node_modules/pg-protocol/dist/serializer.d.ts +0 -42
- package/dist/server/node_modules/pg-protocol/dist/serializer.js +0 -189
- package/dist/server/node_modules/pg-protocol/dist/serializer.js.map +0 -1
- package/dist/server/node_modules/pg-protocol/esm/index.js +0 -11
- package/dist/server/node_modules/pg-protocol/package.json +0 -45
- package/dist/server/node_modules/pg-protocol/src/b.ts +0 -25
- package/dist/server/node_modules/pg-protocol/src/buffer-reader.ts +0 -58
- package/dist/server/node_modules/pg-protocol/src/buffer-writer.ts +0 -85
- package/dist/server/node_modules/pg-protocol/src/inbound-parser.test.ts +0 -575
- package/dist/server/node_modules/pg-protocol/src/index.ts +0 -11
- package/dist/server/node_modules/pg-protocol/src/messages.ts +0 -262
- package/dist/server/node_modules/pg-protocol/src/outbound-serializer.test.ts +0 -276
- package/dist/server/node_modules/pg-protocol/src/parser.ts +0 -413
- package/dist/server/node_modules/pg-protocol/src/serializer.ts +0 -274
- package/dist/server/node_modules/pg-protocol/src/testing/buffer-list.ts +0 -67
- package/dist/server/node_modules/pg-protocol/src/testing/test-buffers.ts +0 -166
- package/dist/server/node_modules/pg-protocol/src/types/chunky.d.ts +0 -1
- package/dist/server/node_modules/pg-types/.travis.yml +0 -7
- package/dist/server/node_modules/pg-types/Makefile +0 -14
- package/dist/server/node_modules/pg-types/README.md +0 -75
- package/dist/server/node_modules/pg-types/index.d.ts +0 -137
- package/dist/server/node_modules/pg-types/index.js +0 -47
- package/dist/server/node_modules/pg-types/index.test-d.ts +0 -21
- package/dist/server/node_modules/pg-types/lib/arrayParser.js +0 -11
- package/dist/server/node_modules/pg-types/lib/binaryParsers.js +0 -257
- package/dist/server/node_modules/pg-types/lib/builtins.js +0 -73
- package/dist/server/node_modules/pg-types/lib/textParsers.js +0 -215
- package/dist/server/node_modules/pg-types/package.json +0 -42
- package/dist/server/node_modules/pg-types/test/index.js +0 -24
- package/dist/server/node_modules/pg-types/test/types.js +0 -597
- package/dist/server/node_modules/pgpass/README.md +0 -74
- package/dist/server/node_modules/pgpass/lib/helper.js +0 -233
- package/dist/server/node_modules/pgpass/lib/index.js +0 -23
- package/dist/server/node_modules/pgpass/package.json +0 -41
- package/dist/server/node_modules/postgres-array/index.d.ts +0 -4
- package/dist/server/node_modules/postgres-array/index.js +0 -97
- package/dist/server/node_modules/postgres-array/license +0 -21
- package/dist/server/node_modules/postgres-array/package.json +0 -35
- package/dist/server/node_modules/postgres-array/readme.md +0 -43
- package/dist/server/node_modules/postgres-bytea/index.js +0 -33
- package/dist/server/node_modules/postgres-bytea/license +0 -21
- package/dist/server/node_modules/postgres-bytea/package.json +0 -34
- package/dist/server/node_modules/postgres-bytea/readme.md +0 -34
- package/dist/server/node_modules/postgres-date/index.js +0 -116
- package/dist/server/node_modules/postgres-date/license +0 -21
- package/dist/server/node_modules/postgres-date/package.json +0 -33
- package/dist/server/node_modules/postgres-date/readme.md +0 -49
- package/dist/server/node_modules/postgres-interval/index.d.ts +0 -20
- package/dist/server/node_modules/postgres-interval/index.js +0 -125
- package/dist/server/node_modules/postgres-interval/license +0 -21
- package/dist/server/node_modules/postgres-interval/package.json +0 -36
- package/dist/server/node_modules/postgres-interval/readme.md +0 -48
- package/dist/server/node_modules/restore-cursor/index.d.ts +0 -11
- package/dist/server/node_modules/restore-cursor/index.js +0 -11
- package/dist/server/node_modules/restore-cursor/license +0 -9
- package/dist/server/node_modules/restore-cursor/package.json +0 -55
- package/dist/server/node_modules/restore-cursor/readme.md +0 -31
- package/dist/server/node_modules/split2/LICENSE +0 -13
- package/dist/server/node_modules/split2/README.md +0 -85
- package/dist/server/node_modules/split2/bench.js +0 -27
- package/dist/server/node_modules/split2/index.js +0 -141
- package/dist/server/node_modules/split2/package.json +0 -39
- package/dist/server/node_modules/split2/test.js +0 -409
- package/dist/server/node_modules/string-width/index.d.ts +0 -39
- package/dist/server/node_modules/string-width/index.js +0 -82
- package/dist/server/node_modules/string-width/license +0 -9
- package/dist/server/node_modules/string-width/package.json +0 -64
- package/dist/server/node_modules/string-width/readme.md +0 -66
- /package/dist/server/node_modules/{pg-cloudflare → pg}/LICENSE +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{v as Ke,y as te,e as b,j as t,E as Te,r as C,s as le,x as Qe,c as U,aY as Ye,aZ as Ge,l as ie,d as Ze,az as Q,B as W,z as Xe,g as ae,a_ as ke}from"./index-WGfZydLo.js";import{E as Pe}from"./empty-state-DqQ_mj5B.js";import{u as et,a as Ee}from"./use-collections-DEST7K_q.js";import{u as ce}from"./constants-MEMD8ENM.js";import{a as se,F as tt,b as de,d as me}from"./form-pojp-kTY.js";import{I as ue}from"./input-Bzj33Fxq.js";import{T as re}from"./textarea-CfqOOIJa.js";import{a as st,b as nt,V as xe}from"./layout-BXIOD6PJ.js";import{S as ot,W as rt,a as lt}from"./index-Coav-ncz.js";import{g as it,M as at,b as je}from"./types-D_q3jEZ8.js";import{a as be,c as Ne,d as ve,S as Se,b as ne}from"./select-DMGlO4yi.js";import{T as ct,c as ye,a as we,b as Ce}from"./use-mobile-vpGkifWc.js";import{i as dt}from"./AlertCircle-B4Z_bYRy.js";import{O as mt,Q as ut,X as xt,Y as pt,Z as ft,_ as Ie}from"./agent-icon-WnDt_mly.js";import{e as ht}from"./XCircle-CMz1Sln8.js";import{i as gt}from"./Play-DE1MmEh7.js";import{i as jt}from"./ChevronRight-Bp2wM59-.js";import{O as bt,M as Nt}from"./index-DIVxtkpR.js";import{g as vt}from"./connection-slug-eyAPH6o3.js";import{u as St,T as yt}from"./tools-list-Bc5Oy8LD.js";import{b as _e,u as Oe}from"./use-connection-CbAQnOed.js";import{b as wt}from"./use-mcp-tools-BtTkT0ox.js";import{c as Ct}from"./content-blocks-o63cs2vh.js";import{I as $e}from"./integration-icon-ZjWVueCq.js";import{a as It,g as $t}from"./chat-context-DeS_zKzS.js";import{u as Tt}from"./shell-layout-DjJ6Z_Cf.js";import{M as kt}from"./monaco-editor-lqRUssyU.js";import{E as Pt}from"./empty-state-DlH6Q1vv.js";import{n as Et}from"./Container-4EEqLr04.js";import"./label-DiBCBN0N.js";import"./index-DiAp1HHT.js";import"./X-DbufVvYT.js";import"./index-DY2kqbCP.js";import"./collections-CnDJSz0t.js";import"./index-B2JtGbgE.js";import"./use-virtual-mcp-DJidRNsl.js";import"./accordion-BM2v3K-F.js";import"./scroll-area-Df4WEHfA.js";import"./badge-CYgBI6R4.js";import"./view-mode-toggle-D3cr4bdy.js";import"./dialog-D8xpcPd2.js";import"./dropdown-menu-ClMXG_z6.js";import"./ChevronDown-LbB92Eif.js";import"./Plus-lTLN-5sW.js";import"./Tool01-BABHhadV.js";import"./index-C3NVKlFX.js";import"./create-sse-subscription-CxkOgzKf.js";import"./ChevronUp-DugRD1Os.js";import"./SearchMd-Ch9A9-sY.js";import"./ArrowNarrowLeft-Cfmub-b9.js";import"./ZapSquare-DOWrBmYM.js";import"./Users03-CLsqBvj5.js";import"./CheckCircle-BCmdWySf.js";import"./Star01-jT36fQMs.js";import"./Palette-DJlRra7b.js";import"./LinkExternal01-n0OTj3Hs.js";import"./Lock01-Bcc8tT2X.js";import"./Sun-BjJ31DgB.js";import"./Settings02-CRSd_kje.js";import"./Trash01-qTBTo_1R.js";import"./Upload01-D584ZGhL.js";import"./User01-Dn7ERaE8.js";import"./Zap-DCaRrmPx.js";import"./extract-connection-data-BattRyEN.js";import"./constants-BxY9N-ws.js";import"./use-registry-connections-CjUJFqM_.js";import"./use-organization-settings-D9EGsoNi.js";import"./index-CtnGGdXo.js";import"./popover-DB3l_dUB.js";import"./use-create-virtual-mcp-CwozrztD.js";import"./use-navigate-to-agent-Dg-q0ecS.js";import"./use-ai-providers-StUHlUMB.js";import"./use-decopilot-events-K_yfq6tB.js";import"./use-tasks-Cf8x3tn2.js";import"./required-auth-layout-DXAKQPxa.js";import"./use-org-sso-DK-UaGWB.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 _t(){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 Ot(s){const e=b.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:Dt}),t.jsx(se,{control:o.control,name:"description",render:Rt})]})]}),e[1]=o.control,e[2]=r):r=e[2];let l,i;e[3]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Message"}),i=t.jsx("div",{className:"text-xs text-muted-foreground",children:"This becomes the user message in the prompt."}),e[3]=l,e[4]=i):(l=e[3],i=e[4]);let c;e[5]!==o.control?(c=t.jsxs("div",{className:"flex flex-col gap-2",children:[l,i,t.jsx(se,{control:o.control,name:"body",render:At})]}),e[5]=o.control,e[6]=c):c=e[6];let a;e[7]!==r||e[8]!==c?(a=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]=a):a=e[9];let x;return e[10]!==o||e[11]!==a?(x=t.jsx(tt,{...o,children:a}),e[10]=o,e[11]=a,e[12]=x):x=e[12],x}function At(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 Rt(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 Dt(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 Mt(s){const e=b.c(35),{providerId:o,promptId:n}=s,{org:r}=le(),l=o||null;let i;e[0]!==r.id||e[1]!==l?(i={connectionId:l,orgId:r.id},e[0]=r.id,e[1]=l,e[2]=i):i=e[2];const c=ce(i),a=et(o,"PROMPT",n,c),x=Ee(o,"PROMPT",c),f=x.update.isPending;let u;e[3]!==a?(u=a?{title:a.title,description:a.description??null,body:oe(a)}:void 0,e[3]=a,e[4]=u):u=e[4];let h;e[5]!==u?(h={values:u},e[5]=u,e[6]=h):h=e[6];const N=Qe(h);let T;e[7]!==N||e[8]!==a?(T=()=>{a&&N.reset({title:a.title,description:a.description??null,body:oe(a)})},e[7]=N,e[8]=a,e[9]=T):T=e[9];const _=T;let O;e[10]!==x.update||e[11]!==N||e[12]!==n?(O=N.handleSubmit(async v=>{const P=await x.update.mutateAsync({id:n,data:{title:v.title,description:v.description,arguments:[],icons:[],messages:[{role:"user",content:{type:"text",text:v.body}}]}});N.reset({title:P.title,description:P.description??null,body:oe(P)})}),e[10]=x.update,e[11]=N,e[12]=n,e[13]=O):O=e[13];const A=O;if(!a){let v;return e[14]===Symbol.for("react.memo_cache_sentinel")?(v=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[14]=v):v=e[14],v}let y;e[15]!==a.title?(y=t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:a.title}),e[15]=a.title,e[16]=y):y=e[16];let k;e[17]!==a.description?(k=a.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:a.description})]}):null,e[17]=a.description,e[18]=k):k=e[18];let I;e[19]!==y||e[20]!==k?(I=t.jsx(nt,{children:t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[y,k]})}),e[19]=y,e[20]=k,e[21]=I):I=e[21];let g;e[22]!==A?(g=()=>{A()},e[22]=A,e[23]=g):g=e[23];let S;e[24]!==N.formState.isDirty||e[25]!==f||e[26]!==_||e[27]!==g?(S=t.jsx(st,{children:t.jsx(ot,{onSave:g,onUndo:_,isDirty:N.formState.isDirty,isSaving:f})}),e[24]=N.formState.isDirty,e[25]=f,e[26]=_,e[27]=g,e[28]=S):S=e[28];let w;e[29]!==N?(w=t.jsx("div",{className:"h-full",children:t.jsx(Ot,{form:N})}),e[29]=N,e[30]=w):w=e[30];let $;return e[31]!==S||e[32]!==w||e[33]!==I?($=t.jsxs(xe,{children:[I,S,w]}),e[31]=S,e[32]=w,e[33]=I,e[34]=$):$=e[34],$}function zt(s){const e=b.c(4),{itemId:o}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=_t(),e[0]=n):n=e[0];const r=n;if(!r){let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=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]=i):i=e[1],i}let l;return e[2]!==o?(l=t.jsx(Te,{children:t.jsx(C.Suspense,{fallback:null,children:t.jsx(Mt,{providerId:r,promptId:o})})}),e[2]=o,e[3]=l):l=e[3],l}const Ut=Ye("relative w-full rounded-lg border px-4 py-3 text-sm flex items-start gap-3 [&>svg]:size-4 [&>svg]:flex-shrink-0 [&>svg]:mt-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-destructive/5 text-destructive border-destructive/25 [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90",warning:"bg-warning/10 text-warning-foreground border-warning [&>svg]:text-current *:data-[slot=alert-description]:text-warning-foreground/90",success:"bg-success/10 text-success-foreground border-success [&>svg]:text-current *:data-[slot=alert-description]:text-success-foreground/90",info:"bg-card text-card-foreground border-border [&>svg]:text-current *:data-[slot=alert-description]:text-muted-foreground/90"}},defaultVariants:{variant:"default"}});function Bt(s){const e=b.c(10);let o,n,r;e[0]!==s?({className:o,variant:r,...n}=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]!==o||e[5]!==r?(l=U(Ut({variant:r}),o),e[4]=o,e[5]=r,e[6]=l):l=e[6];let i;return e[7]!==n||e[8]!==l?(i=t.jsx("div",{"data-slot":"alert",role:"alert",className:l,...n}),e[7]=n,e[8]=l,e[9]=i):i=e[9],i}function Lt(s){const e=b.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=U("line-clamp-1 min-h-4 font-medium tracking-tight",o),e[3]=o,e[4]=r):r=e[4];let l;return e[5]!==n||e[6]!==r?(l=t.jsx("div",{"data-slot":"alert-title",className:r,...n}),e[5]=n,e[6]=r,e[7]=l):l=e[7],l}function Vt(s){const e=b.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=U("text-muted-foreground leading-relaxed",o),e[3]=o,e[4]=r):r=e[4];let l;return e[5]!==n||e[6]!==r?(l=t.jsx("div",{"data-slot":"alert-description",className:r,...n}),e[5]=n,e[6]=r,e[7]=l):l=e[7],l}function Ae(s){const e=b.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=U("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=b.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=U("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 J(s){const e=b.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=U("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 Y(s){const e=b.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 i;e[4]!==n?(i=U("hover:text-foreground transition-colors truncate",n),e[4]=n,e[5]=i):i=e[5];let c;return e[6]!==l||e[7]!==r||e[8]!==i?(c=t.jsx(l,{"data-slot":"breadcrumb-link",className:i,...r}),e[6]=l,e[7]=r,e[8]=i,e[9]=c):c=e[9],c}function De(s){const e=b.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=U("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 G(s){const e=b.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=U("[&>svg]:size-3.5 text-muted-foreground opacity-50 list-none shrink-0",n),e[4]=n,e[5]=l):l=e[5];let i;e[6]!==o?(i=o??t.jsx(jt,{}),e[6]=o,e[7]=i):i=e[7];let c;return e[8]!==r||e[9]!==l||e[10]!==i?(c=t.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:l,...r,children:i}),e[8]=r,e[9]=l,e[10]=i,e[11]=c):c=e[11],c}const Ft=s=>s.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function Jt(s){const e=b.c(11),{toolName:o,connectionId:n,siblings:r,onSelectInstance:l,onBack:i}=s;let c;e[0]!==n?(c={connectionId:n},e[0]=n,e[1]=c):c=e[1];const a=St(c);if(!a.isAuthenticated){let u;return e[2]!==a.supportsOAuth||e[3]!==i?(u=t.jsx("div",{className:"flex h-full items-center justify-center",children:a.supportsOAuth?t.jsx(bt,{onAuthenticate:()=>i(),buttonText:"Go back to authenticate"}):t.jsx(Nt,{hasReadme:!1})}),e[2]=a.supportsOAuth,e[3]=i,e[4]=u):u=e[4],u}const x=`${n}:${o}`;let f;return e[5]!==n||e[6]!==l||e[7]!==r||e[8]!==x||e[9]!==o?(f=t.jsx(qt,{toolName:o,connectionId:n,siblings:r,onSelectInstance:l},x),e[5]=n,e[6]=l,e[7]=r,e[8]=x,e[9]=o,e[10]=f):f=e[10],f}function qt({toolName:s,connectionId:e,siblings:o,onSelectInstance:n}){const{replayId:r}=Ze({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}})(),i=(()=>{if(!l)return null;const d={};for(const[m,j]of Object.entries(l))j!==null&&typeof j=="object"?d[m]=JSON.stringify(j,null,2):d[m]=j;return d})(),[c,a]=C.useState(i??{}),[x,f]=C.useState(l?JSON.stringify(l,null,2):"{}"),[u,h]=C.useState(null),[N,T]=C.useState(null),[_,O]=C.useState(null),[A,y]=C.useState(null),[k,I]=C.useState(!1),[g,S]=C.useState(null),{org:w}=le(),$=_e(e),{sendMessage:v}=It(),P=$t(),{setChatOpen:B}=Tt(),M=`${e}:${s}`,R=ce({connectionId:e,orgId:w.id}),z=wt({client:R}),p=z.data?.tools?.find(d=>d.name===s),E=it(p?._meta),L=d=>{const m=Ct(d.content);m.content.length>0&&(B(!0),v({tiptapDoc:m}))},[D,Z]=C.useState("json"),[Me,ze]=C.useState(!1);E&&!Me&&(Z("ui"),ze(!0));const pe=p?.inputSchema?.properties,fe=pe?Object.keys(pe):[],q=fe.length>0,H={};if(q&&p?.inputSchema?.properties)for(const d of fe)H[d]=p.inputSchema.required?.includes(d)?"":void 0;const X=d=>Object.prototype.hasOwnProperty.call(c,d),Ue=async()=>{I(!0),y(null),h(null),T(null),O(null),S(null);const d=performance.now();try{if(!R)throw new Error("MCP client is not available");const m=q?{...H,...c}:(()=>{const V=x.trim();if(!V)return{};const F=JSON.parse(V);if(F&&typeof F=="object")return F;throw new Error("Raw JSON input must be an object.")})();q&&p?.inputSchema?.properties&&Object.entries(p.inputSchema.properties).forEach(([V,F])=>{if((F.type==="object"||F.type==="array")&&typeof m[V]=="string")try{m[V]=JSON.parse(m[V])}catch{}});const j=await R.callTool({name:s,arguments:m}),K=j.structuredContent??j,qe=performance.now(),We=Math.round(qe-d);h(K),T(j),O(m);const He=JSON.stringify(K),ge=new TextEncoder().encode(He).length;S({duration:`${We}ms`,bytes:`${ge} bytes`,tokens:`~${Math.ceil(ge/4)} tokens`,cost:"$0.0000"})}catch(m){const j=m instanceof Error?m.message:String(m);y(j||"Unknown error occurred");const K=performance.now();S({duration:`${Math.round(K-d)}ms`})}finally{I(!1)}},ee=(d,m)=>{a(j=>({...j,[d]:m}))},Be=()=>{h(null),T(null),O(null),y(null),S(null)},Le=p?.name??Ft(s),Ve=t.jsx(Ae,{children:t.jsxs(Re,{children:[t.jsx(J,{children:t.jsx(Y,{asChild:!0,children:t.jsx(Q,{to:"/$org/settings/connections",params:{org:w.slug},children:"Connections"})})}),t.jsx(G,{}),$&&t.jsxs(t.Fragment,{children:[t.jsx(J,{children:t.jsx(Y,{asChild:!0,children:t.jsx(Q,{to:"/$org/settings/connections/$appSlug",params:{org:w.slug,appSlug:vt($)},search:{tab:"tools"},children:$.title})})}),t.jsx(G,{})]}),t.jsx(J,{children:t.jsx(De,{children:Le})})]})}),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))})]}),Fe=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"}),p?.inputSchema?.required&&p.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&&p?.inputSchema?.properties?Object.entries(p.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,p.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:X(d)?c[d]??"":H[d]??"",onChange:j=>ee(d,j.target.value),placeholder:`Enter ${d} as JSON...`,rows:3}):m.type==="boolean"?t.jsxs(be,{value:X(d)?String(c[d]??""):"",onValueChange:j=>ee(d,j==="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:X(d)?c[d]??"":H[d]??"",onChange:j=>ee(d,j.target.value),placeholder:`Enter ${d}...`})]},d)):p?.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:x,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:Be,children:[t.jsx(mt,{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(gt,{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(ut,{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(xt,{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(pt,{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(ct,{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:()=>Z("ui"),children:t.jsx(ft,{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:()=>Z("json"),children:t.jsx(Ie,{size:14})})}),t.jsx(Ce,{children:"JSON view"})]})]})})]})]}),A&&t.jsx("div",{className:"px-6 py-4 bg-background",children:t.jsx(Bt,{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(dt,{className:"h-4 w-4"}),t.jsx(Lt,{className:"mb-0",children:"Execution Failed"})]}),t.jsx(Vt,{className:"text-xs text-destructive",children:A})]})})}),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(C.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(at,{resourceURI:E,toolInfo:p?{tool:p}:void 0,toolInput:_??void 0,toolResult:N??void 0,displayMode:"fullscreen",minHeight:je.view.minHeight,maxHeight:je.view.maxHeight,client:R,onMessage:L,onUpdateModelContext:d=>P?.setAppContext(M,d),onTeardown:()=>P?.clearAppContext(M),className:"h-full"})}):u?t.jsxs(t.Fragment,{children:[t.jsx(kt,{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(ht,{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(xe,{breadcrumb:Ve,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:[z.isSuccess?t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-green-500 animate-pulse shrink-0"}):z.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:z.isSuccess?"ready":z.isLoading?"connecting":"error"})]}),t.jsx(yt,{annotations:p?.annotations,_meta:p?._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:p?.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:Fe}),Je]})})]})})}function Wt(s){const e=b.c(10),{itemId:o,siblings:n,onBack:r}=s,[l,i]=C.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 a=c;if(!_e(a||void 0)||!a){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]!==a||e[6]!==r||e[7]!==n||e[8]!==o?(u=t.jsx(C.Suspense,{fallback:f,children:t.jsx(Jt,{toolName:o,connectionId:a,siblings:n,onSelectInstance:i,onBack:r})}),e[5]=a,e[6]=r,e[7]=n,e[8]=o,e[9]=u):u=e[9],u}const Ht={workflow:lt,workflow_execution:rt,prompt:zt};function Kt(){const s=b.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 i=Oe(l);let c;s[3]!==e.history?(c=()=>{e.history.back()},s[3]=e.history,s[4]=c):c=s[4];const a=c,x=Qt;let f;return s[5]!==a||s[6]!==r||s[7]!==i?(f=t.jsx(Wt,{itemId:r,siblings:i,onBack:a,onUpdate:x}),s[5]=a,s[6]=r,s[7]=i,s[8]=f):f=s[8],f}async function Qt(s){return Promise.resolve()}function Yt(s){return s.toLowerCase().split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function Gt(){const s=b.c(40),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 i;s[1]!==e.history?(i=()=>{e.history.back()},s[1]=e.history,s[2]=i):i=s[2];const c=i,{org:a}=le();let x;s[3]!==n.appSlug?(x={slug:n.appSlug},s[3]=n.appSlug,s[4]=x):x=s[4];const u=Oe(x)[0]??null,h=u?.id??"",N=h||"no-connection",T=h??null;let _;s[5]!==a.id||s[6]!==T?(_={connectionId:T,orgId:a.id},s[5]=a.id,s[6]=T,s[7]=_):_=s[7];const O=ce(_),A=Ee(N,r,O);let y;s[8]!==A||s[9]!==l?(y=async D=>{l&&await A.update.mutateAsync({id:l,data:D})},s[8]=A,s[9]=l,s[10]=y):y=s[10];const k=y;let I;s[11]!==r?(I=r?.toLowerCase(),s[11]=r,s[12]=I):I=s[12];const g=I,S=g&&Ht[g];let w;s[13]!==r?(w=Yt(r),s[13]=r,s[14]=w):w=s[14];const $=w;let v;s[15]!==a.slug?(v=t.jsx(J,{children:t.jsx(Y,{asChild:!0,children:t.jsx(Q,{to:"/$org/settings/connections",params:{org:a.slug},children:"Connections"})})}),s[15]=a.slug,s[16]=v):v=s[16];let P;s[17]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(G,{}),s[17]=P):P=s[17];let B;s[18]!==r||s[19]!==u||s[20]!==a.slug||s[21]!==n.appSlug?(B=u&&t.jsxs(t.Fragment,{children:[t.jsx(J,{children:t.jsx(Y,{asChild:!0,children:t.jsx(Q,{to:"/$org/settings/connections/$appSlug",params:{org:a.slug,appSlug:n.appSlug},search:{tab:r},children:u.title})})}),t.jsx(G,{})]}),s[18]=r,s[19]=u,s[20]=a.slug,s[21]=n.appSlug,s[22]=B):B=s[22];let M;s[23]!==$?(M=t.jsx(J,{children:t.jsx(De,{children:$})}),s[23]=$,s[24]=M):M=s[24];let R;s[25]!==B||s[26]!==M||s[27]!==v?(R=t.jsx(Ae,{children:t.jsxs(Re,{children:[v,P,B,M]})}),s[25]=B,s[26]=M,s[27]=v,s[28]=R):R=s[28];const z=R;if(S){let D;return s[29]!==S||s[30]!==c||s[31]!==k||s[32]!==l?(D=t.jsx(S,{itemId:l,onBack:c,onUpdate:k}),s[29]=S,s[30]=c,s[31]=k,s[32]=l,s[33]=D):D=s[33],D}let p;s[34]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(Et,{size:36,className:"text-muted-foreground"}),s[34]=p):p=s[34];let E;s[35]!==c?(E=t.jsx(Pt,{icon:p,title:"No component defined",description:"No component for this collection was defined",buttonProps:{onClick:c,children:"Go back"}}),s[35]=c,s[36]=E):E=s[36];let L;return s[37]!==z||s[38]!==E?(L=t.jsx(xe,{breadcrumb:z,children:E}),s[37]=z,s[38]=E,s[39]=L):L=s[39],L}function Zt(){const s=b.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 i;return s[1]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Kt,{}),s[1]=i):i=s[1],i}let l;return s[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(Gt,{}),s[2]=l):l=s[2],l}function Sn(){const s=b.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Te,{children:t.jsx(C.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(Zt,{})})}),s[0]=e):e=s[0],e}export{Sn as default};
|
|
1
|
+
import{v as Ke,y as te,e as b,j as t,E as Te,r as C,s as le,x as Qe,c as U,aY as Ye,aZ as Ge,l as ie,d as Ze,az as Q,B as W,z as Xe,g as ae,a_ as ke}from"./index-D0eg_rFC.js";import{E as Pe}from"./empty-state-Burt6Pjq.js";import{u as et,a as Ee}from"./use-collections-ByN3iK_-.js";import{u as ce}from"./constants-D4bpaQIy.js";import{a as se,F as tt,b as de,d as me}from"./form-NpftjNqr.js";import{I as ue}from"./input-B0rO4kCw.js";import{T as re}from"./textarea-D_j-5IAu.js";import{a as st,b as nt,V as xe}from"./layout-CEdjROI5.js";import{S as ot,W as rt,a as lt}from"./index-ClWc2yds.js";import{g as it,M as at,b as je}from"./types-CXkK-iOI.js";import{a as be,c as Ne,d as ve,S as Se,b as ne}from"./select-DV6Y5fbl.js";import{T as ct,c as ye,a as we,b as Ce}from"./use-mobile-D5xdghWW.js";import{i as dt}from"./AlertCircle-ZN1y5-aw.js";import{O as mt,Q as ut,X as xt,Y as pt,Z as ft,_ as Ie}from"./agent-icon-BCqNXHrJ.js";import{e as ht}from"./XCircle-C-PtnVDi.js";import{i as gt}from"./Play-8RSCt4_z.js";import{i as jt}from"./ChevronRight-Ers_V2D1.js";import{O as bt,M as Nt}from"./index-CSCpQ3nk.js";import{g as vt}from"./connection-slug-eyAPH6o3.js";import{u as St,T as yt}from"./tools-list-CJJNUxfe.js";import{b as _e,u as Oe}from"./use-connection-DS4JMmfK.js";import{b as wt}from"./use-mcp-tools-CpSp-YOn.js";import{c as Ct}from"./content-blocks-o63cs2vh.js";import{I as $e}from"./integration-icon-yOwsHf6q.js";import{a as It,g as $t}from"./chat-context-jZHB4zZq.js";import{u as Tt}from"./shell-layout-Bx85tvr4.js";import{M as kt}from"./monaco-editor-wLqdDZ5S.js";import{E as Pt}from"./empty-state-CMAHTHUe.js";import{n as Et}from"./Container-BH-IjM7q.js";import"./label-DEuSkBBi.js";import"./index-CESHAiFx.js";import"./X-DJVuZ58d.js";import"./index-CmG3u4sk.js";import"./collections-BZR-yDlA.js";import"./index-DE-s5va1.js";import"./use-virtual-mcp-DmXmoSMd.js";import"./accordion-BKyKwvi4.js";import"./scroll-area-BPvcbDba.js";import"./badge-y-hsEihY.js";import"./view-mode-toggle-EUXERI9v.js";import"./dialog-CrC-U752.js";import"./dropdown-menu-BCSsOhoD.js";import"./ChevronDown-BjlYfwkz.js";import"./Plus-D7R85tnb.js";import"./Tool01-BYIP93fl.js";import"./index-MDHGBKc3.js";import"./create-sse-subscription-CxkOgzKf.js";import"./ChevronUp-BFd66NER.js";import"./SearchMd-CuF0EE4i.js";import"./ArrowNarrowLeft-BPki4rs6.js";import"./ZapSquare-Bn1DnHGa.js";import"./Users03-C4Ee_frB.js";import"./CheckCircle-CzlD2NtZ.js";import"./Star01-DG4GVqjt.js";import"./Palette-BAefAlJJ.js";import"./LinkExternal01-Df1708RH.js";import"./Lock01-DC87zCkJ.js";import"./Sun-bNHtETAN.js";import"./Settings02-0biYSyip.js";import"./Trash01-DiVIK0OP.js";import"./Upload01-1ZdG7oJK.js";import"./User01-ZdNcPumq.js";import"./Zap-DFbFP4h9.js";import"./extract-connection-data-CIGH4JOA.js";import"./constants-B6BlNNCv.js";import"./use-registry-connections-DiPCzdOz.js";import"./use-organization-settings-CRVxUE8d.js";import"./index-BabWp460.js";import"./popover-DUh9iDm9.js";import"./use-create-virtual-mcp-C0ZtxKxG.js";import"./use-navigate-to-agent-DC2aXNSM.js";import"./use-ai-providers-ElYJdGU0.js";import"./use-decopilot-events-Dv7rn_zQ.js";import"./use-tasks-Cvm0js2U.js";import"./required-auth-layout-eS3mZHM3.js";import"./use-org-sso-HLMtUxyI.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 _t(){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 Ot(s){const e=b.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:Dt}),t.jsx(se,{control:o.control,name:"description",render:Rt})]})]}),e[1]=o.control,e[2]=r):r=e[2];let l,i;e[3]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Message"}),i=t.jsx("div",{className:"text-xs text-muted-foreground",children:"This becomes the user message in the prompt."}),e[3]=l,e[4]=i):(l=e[3],i=e[4]);let c;e[5]!==o.control?(c=t.jsxs("div",{className:"flex flex-col gap-2",children:[l,i,t.jsx(se,{control:o.control,name:"body",render:At})]}),e[5]=o.control,e[6]=c):c=e[6];let a;e[7]!==r||e[8]!==c?(a=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]=a):a=e[9];let x;return e[10]!==o||e[11]!==a?(x=t.jsx(tt,{...o,children:a}),e[10]=o,e[11]=a,e[12]=x):x=e[12],x}function At(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 Rt(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 Dt(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 Mt(s){const e=b.c(35),{providerId:o,promptId:n}=s,{org:r}=le(),l=o||null;let i;e[0]!==r.id||e[1]!==l?(i={connectionId:l,orgId:r.id},e[0]=r.id,e[1]=l,e[2]=i):i=e[2];const c=ce(i),a=et(o,"PROMPT",n,c),x=Ee(o,"PROMPT",c),f=x.update.isPending;let u;e[3]!==a?(u=a?{title:a.title,description:a.description??null,body:oe(a)}:void 0,e[3]=a,e[4]=u):u=e[4];let h;e[5]!==u?(h={values:u},e[5]=u,e[6]=h):h=e[6];const N=Qe(h);let T;e[7]!==N||e[8]!==a?(T=()=>{a&&N.reset({title:a.title,description:a.description??null,body:oe(a)})},e[7]=N,e[8]=a,e[9]=T):T=e[9];const _=T;let O;e[10]!==x.update||e[11]!==N||e[12]!==n?(O=N.handleSubmit(async v=>{const P=await x.update.mutateAsync({id:n,data:{title:v.title,description:v.description,arguments:[],icons:[],messages:[{role:"user",content:{type:"text",text:v.body}}]}});N.reset({title:P.title,description:P.description??null,body:oe(P)})}),e[10]=x.update,e[11]=N,e[12]=n,e[13]=O):O=e[13];const A=O;if(!a){let v;return e[14]===Symbol.for("react.memo_cache_sentinel")?(v=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[14]=v):v=e[14],v}let y;e[15]!==a.title?(y=t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:a.title}),e[15]=a.title,e[16]=y):y=e[16];let k;e[17]!==a.description?(k=a.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:a.description})]}):null,e[17]=a.description,e[18]=k):k=e[18];let I;e[19]!==y||e[20]!==k?(I=t.jsx(nt,{children:t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[y,k]})}),e[19]=y,e[20]=k,e[21]=I):I=e[21];let g;e[22]!==A?(g=()=>{A()},e[22]=A,e[23]=g):g=e[23];let S;e[24]!==N.formState.isDirty||e[25]!==f||e[26]!==_||e[27]!==g?(S=t.jsx(st,{children:t.jsx(ot,{onSave:g,onUndo:_,isDirty:N.formState.isDirty,isSaving:f})}),e[24]=N.formState.isDirty,e[25]=f,e[26]=_,e[27]=g,e[28]=S):S=e[28];let w;e[29]!==N?(w=t.jsx("div",{className:"h-full",children:t.jsx(Ot,{form:N})}),e[29]=N,e[30]=w):w=e[30];let $;return e[31]!==S||e[32]!==w||e[33]!==I?($=t.jsxs(xe,{children:[I,S,w]}),e[31]=S,e[32]=w,e[33]=I,e[34]=$):$=e[34],$}function zt(s){const e=b.c(4),{itemId:o}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=_t(),e[0]=n):n=e[0];const r=n;if(!r){let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=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]=i):i=e[1],i}let l;return e[2]!==o?(l=t.jsx(Te,{children:t.jsx(C.Suspense,{fallback:null,children:t.jsx(Mt,{providerId:r,promptId:o})})}),e[2]=o,e[3]=l):l=e[3],l}const Ut=Ye("relative w-full rounded-lg border px-4 py-3 text-sm flex items-start gap-3 [&>svg]:size-4 [&>svg]:flex-shrink-0 [&>svg]:mt-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-destructive/5 text-destructive border-destructive/25 [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90",warning:"bg-warning/10 text-warning-foreground border-warning [&>svg]:text-current *:data-[slot=alert-description]:text-warning-foreground/90",success:"bg-success/10 text-success-foreground border-success [&>svg]:text-current *:data-[slot=alert-description]:text-success-foreground/90",info:"bg-card text-card-foreground border-border [&>svg]:text-current *:data-[slot=alert-description]:text-muted-foreground/90"}},defaultVariants:{variant:"default"}});function Bt(s){const e=b.c(10);let o,n,r;e[0]!==s?({className:o,variant:r,...n}=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]!==o||e[5]!==r?(l=U(Ut({variant:r}),o),e[4]=o,e[5]=r,e[6]=l):l=e[6];let i;return e[7]!==n||e[8]!==l?(i=t.jsx("div",{"data-slot":"alert",role:"alert",className:l,...n}),e[7]=n,e[8]=l,e[9]=i):i=e[9],i}function Lt(s){const e=b.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=U("line-clamp-1 min-h-4 font-medium tracking-tight",o),e[3]=o,e[4]=r):r=e[4];let l;return e[5]!==n||e[6]!==r?(l=t.jsx("div",{"data-slot":"alert-title",className:r,...n}),e[5]=n,e[6]=r,e[7]=l):l=e[7],l}function Vt(s){const e=b.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=U("text-muted-foreground leading-relaxed",o),e[3]=o,e[4]=r):r=e[4];let l;return e[5]!==n||e[6]!==r?(l=t.jsx("div",{"data-slot":"alert-description",className:r,...n}),e[5]=n,e[6]=r,e[7]=l):l=e[7],l}function Ae(s){const e=b.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=U("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=b.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=U("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 J(s){const e=b.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=U("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 Y(s){const e=b.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 i;e[4]!==n?(i=U("hover:text-foreground transition-colors truncate",n),e[4]=n,e[5]=i):i=e[5];let c;return e[6]!==l||e[7]!==r||e[8]!==i?(c=t.jsx(l,{"data-slot":"breadcrumb-link",className:i,...r}),e[6]=l,e[7]=r,e[8]=i,e[9]=c):c=e[9],c}function De(s){const e=b.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=U("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 G(s){const e=b.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=U("[&>svg]:size-3.5 text-muted-foreground opacity-50 list-none shrink-0",n),e[4]=n,e[5]=l):l=e[5];let i;e[6]!==o?(i=o??t.jsx(jt,{}),e[6]=o,e[7]=i):i=e[7];let c;return e[8]!==r||e[9]!==l||e[10]!==i?(c=t.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:l,...r,children:i}),e[8]=r,e[9]=l,e[10]=i,e[11]=c):c=e[11],c}const Ft=s=>s.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function Jt(s){const e=b.c(11),{toolName:o,connectionId:n,siblings:r,onSelectInstance:l,onBack:i}=s;let c;e[0]!==n?(c={connectionId:n},e[0]=n,e[1]=c):c=e[1];const a=St(c);if(!a.isAuthenticated){let u;return e[2]!==a.supportsOAuth||e[3]!==i?(u=t.jsx("div",{className:"flex h-full items-center justify-center",children:a.supportsOAuth?t.jsx(bt,{onAuthenticate:()=>i(),buttonText:"Go back to authenticate"}):t.jsx(Nt,{hasReadme:!1})}),e[2]=a.supportsOAuth,e[3]=i,e[4]=u):u=e[4],u}const x=`${n}:${o}`;let f;return e[5]!==n||e[6]!==l||e[7]!==r||e[8]!==x||e[9]!==o?(f=t.jsx(qt,{toolName:o,connectionId:n,siblings:r,onSelectInstance:l},x),e[5]=n,e[6]=l,e[7]=r,e[8]=x,e[9]=o,e[10]=f):f=e[10],f}function qt({toolName:s,connectionId:e,siblings:o,onSelectInstance:n}){const{replayId:r}=Ze({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}})(),i=(()=>{if(!l)return null;const d={};for(const[m,j]of Object.entries(l))j!==null&&typeof j=="object"?d[m]=JSON.stringify(j,null,2):d[m]=j;return d})(),[c,a]=C.useState(i??{}),[x,f]=C.useState(l?JSON.stringify(l,null,2):"{}"),[u,h]=C.useState(null),[N,T]=C.useState(null),[_,O]=C.useState(null),[A,y]=C.useState(null),[k,I]=C.useState(!1),[g,S]=C.useState(null),{org:w}=le(),$=_e(e),{sendMessage:v}=It(),P=$t(),{setChatOpen:B}=Tt(),M=`${e}:${s}`,R=ce({connectionId:e,orgId:w.id}),z=wt({client:R}),p=z.data?.tools?.find(d=>d.name===s),E=it(p?._meta),L=d=>{const m=Ct(d.content);m.content.length>0&&(B(!0),v({tiptapDoc:m}))},[D,Z]=C.useState("json"),[Me,ze]=C.useState(!1);E&&!Me&&(Z("ui"),ze(!0));const pe=p?.inputSchema?.properties,fe=pe?Object.keys(pe):[],q=fe.length>0,H={};if(q&&p?.inputSchema?.properties)for(const d of fe)H[d]=p.inputSchema.required?.includes(d)?"":void 0;const X=d=>Object.prototype.hasOwnProperty.call(c,d),Ue=async()=>{I(!0),y(null),h(null),T(null),O(null),S(null);const d=performance.now();try{if(!R)throw new Error("MCP client is not available");const m=q?{...H,...c}:(()=>{const V=x.trim();if(!V)return{};const F=JSON.parse(V);if(F&&typeof F=="object")return F;throw new Error("Raw JSON input must be an object.")})();q&&p?.inputSchema?.properties&&Object.entries(p.inputSchema.properties).forEach(([V,F])=>{if((F.type==="object"||F.type==="array")&&typeof m[V]=="string")try{m[V]=JSON.parse(m[V])}catch{}});const j=await R.callTool({name:s,arguments:m}),K=j.structuredContent??j,qe=performance.now(),We=Math.round(qe-d);h(K),T(j),O(m);const He=JSON.stringify(K),ge=new TextEncoder().encode(He).length;S({duration:`${We}ms`,bytes:`${ge} bytes`,tokens:`~${Math.ceil(ge/4)} tokens`,cost:"$0.0000"})}catch(m){const j=m instanceof Error?m.message:String(m);y(j||"Unknown error occurred");const K=performance.now();S({duration:`${Math.round(K-d)}ms`})}finally{I(!1)}},ee=(d,m)=>{a(j=>({...j,[d]:m}))},Be=()=>{h(null),T(null),O(null),y(null),S(null)},Le=p?.name??Ft(s),Ve=t.jsx(Ae,{children:t.jsxs(Re,{children:[t.jsx(J,{children:t.jsx(Y,{asChild:!0,children:t.jsx(Q,{to:"/$org/settings/connections",params:{org:w.slug},children:"Connections"})})}),t.jsx(G,{}),$&&t.jsxs(t.Fragment,{children:[t.jsx(J,{children:t.jsx(Y,{asChild:!0,children:t.jsx(Q,{to:"/$org/settings/connections/$appSlug",params:{org:w.slug,appSlug:vt($)},search:{tab:"tools"},children:$.title})})}),t.jsx(G,{})]}),t.jsx(J,{children:t.jsx(De,{children:Le})})]})}),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))})]}),Fe=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"}),p?.inputSchema?.required&&p.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&&p?.inputSchema?.properties?Object.entries(p.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,p.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:X(d)?c[d]??"":H[d]??"",onChange:j=>ee(d,j.target.value),placeholder:`Enter ${d} as JSON...`,rows:3}):m.type==="boolean"?t.jsxs(be,{value:X(d)?String(c[d]??""):"",onValueChange:j=>ee(d,j==="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:X(d)?c[d]??"":H[d]??"",onChange:j=>ee(d,j.target.value),placeholder:`Enter ${d}...`})]},d)):p?.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:x,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:Be,children:[t.jsx(mt,{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(gt,{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(ut,{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(xt,{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(pt,{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(ct,{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:()=>Z("ui"),children:t.jsx(ft,{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:()=>Z("json"),children:t.jsx(Ie,{size:14})})}),t.jsx(Ce,{children:"JSON view"})]})]})})]})]}),A&&t.jsx("div",{className:"px-6 py-4 bg-background",children:t.jsx(Bt,{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(dt,{className:"h-4 w-4"}),t.jsx(Lt,{className:"mb-0",children:"Execution Failed"})]}),t.jsx(Vt,{className:"text-xs text-destructive",children:A})]})})}),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(C.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(at,{resourceURI:E,toolInfo:p?{tool:p}:void 0,toolInput:_??void 0,toolResult:N??void 0,displayMode:"fullscreen",minHeight:je.view.minHeight,maxHeight:je.view.maxHeight,client:R,onMessage:L,onUpdateModelContext:d=>P?.setAppContext(M,d),onTeardown:()=>P?.clearAppContext(M),className:"h-full"})}):u?t.jsxs(t.Fragment,{children:[t.jsx(kt,{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(ht,{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(xe,{breadcrumb:Ve,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:[z.isSuccess?t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-green-500 animate-pulse shrink-0"}):z.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:z.isSuccess?"ready":z.isLoading?"connecting":"error"})]}),t.jsx(yt,{annotations:p?.annotations,_meta:p?._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:p?.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:Fe}),Je]})})]})})}function Wt(s){const e=b.c(10),{itemId:o,siblings:n,onBack:r}=s,[l,i]=C.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 a=c;if(!_e(a||void 0)||!a){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]!==a||e[6]!==r||e[7]!==n||e[8]!==o?(u=t.jsx(C.Suspense,{fallback:f,children:t.jsx(Jt,{toolName:o,connectionId:a,siblings:n,onSelectInstance:i,onBack:r})}),e[5]=a,e[6]=r,e[7]=n,e[8]=o,e[9]=u):u=e[9],u}const Ht={workflow:lt,workflow_execution:rt,prompt:zt};function Kt(){const s=b.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 i=Oe(l);let c;s[3]!==e.history?(c=()=>{e.history.back()},s[3]=e.history,s[4]=c):c=s[4];const a=c,x=Qt;let f;return s[5]!==a||s[6]!==r||s[7]!==i?(f=t.jsx(Wt,{itemId:r,siblings:i,onBack:a,onUpdate:x}),s[5]=a,s[6]=r,s[7]=i,s[8]=f):f=s[8],f}async function Qt(s){return Promise.resolve()}function Yt(s){return s.toLowerCase().split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function Gt(){const s=b.c(40),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 i;s[1]!==e.history?(i=()=>{e.history.back()},s[1]=e.history,s[2]=i):i=s[2];const c=i,{org:a}=le();let x;s[3]!==n.appSlug?(x={slug:n.appSlug},s[3]=n.appSlug,s[4]=x):x=s[4];const u=Oe(x)[0]??null,h=u?.id??"",N=h||"no-connection",T=h??null;let _;s[5]!==a.id||s[6]!==T?(_={connectionId:T,orgId:a.id},s[5]=a.id,s[6]=T,s[7]=_):_=s[7];const O=ce(_),A=Ee(N,r,O);let y;s[8]!==A||s[9]!==l?(y=async D=>{l&&await A.update.mutateAsync({id:l,data:D})},s[8]=A,s[9]=l,s[10]=y):y=s[10];const k=y;let I;s[11]!==r?(I=r?.toLowerCase(),s[11]=r,s[12]=I):I=s[12];const g=I,S=g&&Ht[g];let w;s[13]!==r?(w=Yt(r),s[13]=r,s[14]=w):w=s[14];const $=w;let v;s[15]!==a.slug?(v=t.jsx(J,{children:t.jsx(Y,{asChild:!0,children:t.jsx(Q,{to:"/$org/settings/connections",params:{org:a.slug},children:"Connections"})})}),s[15]=a.slug,s[16]=v):v=s[16];let P;s[17]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(G,{}),s[17]=P):P=s[17];let B;s[18]!==r||s[19]!==u||s[20]!==a.slug||s[21]!==n.appSlug?(B=u&&t.jsxs(t.Fragment,{children:[t.jsx(J,{children:t.jsx(Y,{asChild:!0,children:t.jsx(Q,{to:"/$org/settings/connections/$appSlug",params:{org:a.slug,appSlug:n.appSlug},search:{tab:r},children:u.title})})}),t.jsx(G,{})]}),s[18]=r,s[19]=u,s[20]=a.slug,s[21]=n.appSlug,s[22]=B):B=s[22];let M;s[23]!==$?(M=t.jsx(J,{children:t.jsx(De,{children:$})}),s[23]=$,s[24]=M):M=s[24];let R;s[25]!==B||s[26]!==M||s[27]!==v?(R=t.jsx(Ae,{children:t.jsxs(Re,{children:[v,P,B,M]})}),s[25]=B,s[26]=M,s[27]=v,s[28]=R):R=s[28];const z=R;if(S){let D;return s[29]!==S||s[30]!==c||s[31]!==k||s[32]!==l?(D=t.jsx(S,{itemId:l,onBack:c,onUpdate:k}),s[29]=S,s[30]=c,s[31]=k,s[32]=l,s[33]=D):D=s[33],D}let p;s[34]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(Et,{size:36,className:"text-muted-foreground"}),s[34]=p):p=s[34];let E;s[35]!==c?(E=t.jsx(Pt,{icon:p,title:"No component defined",description:"No component for this collection was defined",buttonProps:{onClick:c,children:"Go back"}}),s[35]=c,s[36]=E):E=s[36];let L;return s[37]!==z||s[38]!==E?(L=t.jsx(xe,{breadcrumb:z,children:E}),s[37]=z,s[38]=E,s[39]=L):L=s[39],L}function Zt(){const s=b.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 i;return s[1]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Kt,{}),s[1]=i):i=s[1],i}let l;return s[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(Gt,{}),s[2]=l):l=s[2],l}function Sn(){const s=b.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Te,{children:t.jsx(C.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(Zt,{})})}),s[0]=e):e=s[0],e}export{Sn as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as B,j as s,c as M,B as V}from"./index-
|
|
1
|
+
import{e as B,j as s,c as M,B as V}from"./index-D0eg_rFC.js";import{D as z,d as _,e as $,c as E}from"./dropdown-menu-BCSsOhoD.js";import{e as L,ac as O,ad as R,ae as A,a1 as F}from"./agent-icon-BCqNXHrJ.js";import{i as S}from"./ChevronDown-BjlYfwkz.js";import{a as I,b as K,T as P,c as W}from"./use-mobile-D5xdghWW.js";import{V as q}from"./view-mode-toggle-EUXERI9v.js";import{B as G}from"./badge-y-hsEihY.js";function te(t){const e=B.c(31),{viewMode:r,onViewModeChange:m,sortKey:T,sortDirection:p,onSort:f,sortOptions:u,filters:h}=t;let g;e[0]!==u?(g=u===void 0?[]:u,e[0]=u,e[1]=g):g=e[1];const j=g;let b;e[2]!==h?(b=h===void 0?[]:h,e[2]=h,e[3]=b):b=e[3];const l=b;let v;e[4]!==l?(v=l.filter(J),e[4]=l,e[5]=v):v=e[5];const N=v.length;let w;e[6]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(R,{size:16}),e[6]=w):w=e[6];let i;e[7]!==N?(i=N>0&&s.jsx(G,{variant:"default",className:"absolute -top-1.5 -right-1.5 h-4 min-w-4 px-1 text-[10px] leading-none",children:N}),e[7]=N,e[8]=i):i=e[8];let o;e[9]!==i?(o=s.jsx(I,{asChild:!0,children:s.jsx(_,{asChild:!0,children:s.jsxs(V,{variant:"outline",size:"icon",className:"relative",children:[w,i]})})}),e[9]=i,e[10]=o):o=e[10];let C;e[11]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx(K,{children:"Display & filters"}),e[11]=C):C=e[11];let a;e[12]!==o?(a=s.jsx(P,{children:s.jsxs(W,{children:[o,C]})}),e[12]=o,e[13]=a):a=e[13];let n;e[14]!==m||e[15]!==r?(n=m&&r&&s.jsx("div",{className:"p-2 border-b border-border",children:s.jsx(q,{value:r,onValueChange:m,fullWidth:!0,options:[{value:"table",icon:s.jsx(A,{})},{value:"cards",icon:s.jsx(F,{})}]})}),e[14]=m,e[15]=r,e[16]=n):n=e[16];let c;e[17]!==f||e[18]!==p||e[19]!==T||e[20]!==j?(c=j.length>0&&f&&s.jsxs("div",{className:"p-1 flex flex-col gap-0.5 border-b border-border",children:[s.jsx("div",{className:"px-2 py-1.5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Sort by"}),j.map(y=>{const D=T===y.id;return s.jsx(z,{onClick:()=>f(y.id),className:M("h-8 px-2 py-0 cursor-pointer",D&&"bg-accent"),children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[D&&s.jsx(S,{size:16,className:"text-foreground shrink-0"}),!D&&s.jsx("div",{className:"w-4 shrink-0"}),s.jsx("span",{className:"text-sm text-foreground flex-1",children:y.label}),D&&p&&(p==="asc"?s.jsx(L,{size:16,className:"text-foreground shrink-0"}):s.jsx(O,{size:16,className:"text-foreground shrink-0"}))]})},y.id)})]}),e[17]=f,e[18]=p,e[19]=T,e[20]=j,e[21]=c):c=e[21];let d;e[22]!==l?(d=l.map(H),e[22]=l,e[23]=d):d=e[23];let x;e[24]!==n||e[25]!==c||e[26]!==d?(x=s.jsxs($,{align:"end",className:"w-[200px] p-0 gap-0",children:[n,c,d]}),e[24]=n,e[25]=c,e[26]=d,e[27]=x):x=e[27];let k;return e[28]!==a||e[29]!==x?(k=s.jsxs(E,{children:[a,x]}),e[28]=a,e[29]=x,e[30]=k):k=e[30],k}function H(t){return s.jsxs("div",{className:"p-1 flex flex-col gap-0.5 border-b border-border last:border-b-0",children:[s.jsx("div",{className:"px-2 py-1.5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:t.label}),t.options.map(e=>{const r=t.value===e.id;return s.jsx(z,{onClick:()=>t.onChange(e.id),className:M("h-8 px-2 py-0 cursor-pointer",r&&"bg-accent"),children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[r&&s.jsx(S,{size:16,className:"text-foreground shrink-0"}),!r&&s.jsx("div",{className:"w-4 shrink-0"}),s.jsx("span",{className:"text-sm text-foreground flex-1",children:e.label})]})},e.id)})]},t.label)}function J(t){return t.value!=="ALL"}export{te as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as v,c as b,j as n,l as w}from"./index-
|
|
1
|
+
import{e as v,c as b,j as n,l as w}from"./index-D0eg_rFC.js";import{a as C}from"./SearchMd-CuF0EE4i.js";function S(j){const e=v.c(21),{value:d,onChange:m,placeholder:g,onKeyDown:x,className:u,isSearching:f,disabled:i}=j,p=g===void 0?"Search...":g;let t;e[0]!==u?(t=b("shrink-0 w-full border-b border-border h-12",u),e[0]=u,e[1]=t):t=e[1];const h=i?"cursor-not-allowed opacity-50":"cursor-text";let s;e[2]!==h?(s=b("flex items-center gap-2.5 h-12 px-4",h),e[2]=h,e[3]=s):s=e[3];let l;e[4]!==f?(l=f?n.jsx(w,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):n.jsx(C,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=f,e[5]=l):l=e[5];let r;e[6]!==m?(r=N=>m(N.target.value),e[6]=m,e[7]=r):r=e[7];let o;e[8]!==i||e[9]!==x||e[10]!==p||e[11]!==r||e[12]!==d?(o=n.jsx("input",{type:"text",value:d,onChange:r,onKeyDown:x,placeholder:p,disabled:i,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[8]=i,e[9]=x,e[10]=p,e[11]=r,e[12]=d,e[13]=o):o=e[13];let a;e[14]!==s||e[15]!==l||e[16]!==o?(a=n.jsxs("label",{className:s,children:[l,o]}),e[14]=s,e[15]=l,e[16]=o,e[17]=a):a=e[17];let c;return e[18]!==t||e[19]!==a?(c=n.jsx("div",{className:t,children:a}),e[18]=t,e[19]=a,e[20]=c):c=e[20],c}export{S as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as k,j as s,c as C}from"./index-
|
|
1
|
+
import{e as k,j as s,c as C}from"./index-D0eg_rFC.js";import{e as S,d as R,a as T,T as H,b as L,c as z}from"./table-D03jqlLZ.js";import{e as D,ac as E}from"./agent-icon-BCqNXHrJ.js";function I(y){const e=k.c(29),{columns:r,data:f,sortKey:x,sortDirection:u,onSort:i,onRowClick:n,rowClassName:c}=y;let p;e[0]!==u?(p=function(t,h){return s.jsx("div",{className:"w-4 flex items-center justify-center",children:h&&u&&(u==="asc"?s.jsx(D,{size:16,className:"text-muted-foreground transition-colors"}):s.jsx(E,{size:16,className:"text-muted-foreground transition-colors"}))})},e[0]=u,e[1]=p):p=e[1];const b=p;let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=function(t,h){let N="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-[11px] h-9 uppercase tracking-wider";return t===h-1&&(N="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-[11px] h-9 uppercase tracking-wider w-8"),N},e[2]=d):d=e[2];const a=d;let l;if(e[3]!==r||e[4]!==i||e[5]!==b||e[6]!==x){let o;e[8]!==r.length||e[9]!==i||e[10]!==b||e[11]!==x?(o=(t,h)=>{const N=x===t.id;return s.jsx(S,{className:C(a(h,r.length),"group transition-colors select-none",t.sortable&&"hover:bg-accent cursor-pointer",t.rowClassName,t.cellClassName),onClick:t.sortable&&i?()=>i(t.id):void 0,children:s.jsxs("span",{className:"flex items-center gap-1",children:[t.header,t.sortable&&b(t.id,N)]})},t.id)},e[8]=r.length,e[9]=i,e[10]=b,e[11]=x,e[12]=o):o=e[12],l=r.map(o),e[3]=r,e[4]=i,e[5]=b,e[6]=x,e[7]=l}else l=e[7];let g;e[13]!==l?(g=s.jsx(R,{className:"border-b-0",children:s.jsx(T,{className:"h-9 hover:bg-transparent border-b border-border",children:l})}),e[13]=l,e[14]=g):g=e[14];let j;if(e[15]!==r||e[16]!==f||e[17]!==n||e[18]!==c){let o;e[20]!==r||e[21]!==n||e[22]!==c?(o=(t,h)=>{const N=c?.(t);return s.jsx(T,{"data-row-index":h,className:C("group/data-row transition-colors border-b-0 hover:bg-accent/50",n?"cursor-pointer":"",N),onClick:n?()=>n(t):void 0,children:r.map(m=>s.jsx(H,{className:C("px-5 py-4 h-16 align-middle text-sm text-foreground",m.cellClassName,m.wrap?"whitespace-normal wrap-break-word":""),children:s.jsx("div",{className:C(m.wrap?"w-full":"min-w-0 w-full",!m.wrap&&"truncate overflow-hidden whitespace-nowrap"),children:m.render?m.render(t):m.accessor?m.accessor(t):null})},m.id))},h)},e[20]=r,e[21]=n,e[22]=c,e[23]=o):o=e[23],j=f.map(o),e[15]=r,e[16]=f,e[17]=n,e[18]=c,e[19]=j}else j=e[19];let w;e[24]!==j?(w=s.jsx(L,{children:j}),e[24]=j,e[25]=w):w=e[25];let v;return e[26]!==g||e[27]!==w?(v=s.jsxs(z,{className:"w-full border-collapse",children:[g,w]}),e[26]=g,e[27]=w,e[28]=v):v=e[28],v}function B(y){const e=k.c(12),{columns:r,data:f,isLoading:x,sortKey:u,sortDirection:i,onSort:n,onRowClick:c,emptyState:p}=y;if(x===void 0?!1:x){let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("div",{className:"text-muted-foreground",children:"Loading..."})}),e[0]=a):a=e[0],a}if(f.length===0){let a;e[1]!==p?(a=p||s.jsx("div",{className:"text-center py-12 text-muted-foreground",children:"No items found"}),e[1]=p,e[2]=a):a=e[2];let l;return e[3]!==a?(l=s.jsx("div",{className:"flex items-center justify-center h-full",children:a}),e[3]=a,e[4]=l):l=e[4],l}let d;return e[5]!==r||e[6]!==f||e[7]!==c||e[8]!==n||e[9]!==i||e[10]!==u?(d=s.jsx("div",{className:"flex-1",children:s.jsx(I,{columns:r,data:f,sortKey:u,sortDirection:i,onSort:n,onRowClick:c})}),e[5]=r,e[6]=f,e[7]=c,e[8]=n,e[9]=i,e[10]=u,e[11]=d):d=e[11],d}export{B as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as f,c as u,j as m}from"./index-
|
|
1
|
+
import{e as f,c as u,j as m}from"./index-D0eg_rFC.js";import{B as g}from"./badge-y-hsEihY.js";function h(x){const e=f.c(12),{tabs:l,activeTab:n,onTabChange:s,className:a}=x;let t;e[0]!==a?(t=u("flex items-center gap-2 overflow-x-auto no-scrollbar",a),e[0]=a,e[1]=t):t=e[1];let r;if(e[2]!==n||e[3]!==s||e[4]!==l){let c;e[6]!==n||e[7]!==s?(c=o=>{const d=n===o.id;return m.jsxs("button",{type:"button",onClick:()=>s(o.id),className:u("h-7 px-2 text-sm rounded-lg border border-input transition-colors inline-flex gap-1.5 items-center",d&&"bg-accent border-border text-foreground",!d&&"bg-transparent text-muted-foreground hover:border-border hover:bg-accent/50 hover:text-foreground"),children:[o.label,o.count!==void 0&&m.jsx(g,{variant:"secondary",className:u("h-5 min-w-5 px-1 rounded-full text-[10px] font-mono inline-flex items-center justify-center",d?"bg-background text-foreground":"bg-muted-foreground/10 text-muted-foreground"),children:o.count})]},o.id)},e[6]=n,e[7]=s,e[8]=c):c=e[8],r=l.map(c),e[2]=n,e[3]=s,e[4]=l,e[5]=r}else r=e[5];let i;return e[9]!==t||e[10]!==r?(i=m.jsx("div",{className:t,children:r}),e[9]=t,e[10]=r,e[11]=i):i=e[11],i}export{h as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{v as t,y as i,aK as p,_ as r,aL as a,bQ as m,bk as h,aD as c,a$ as b}from"./index-
|
|
1
|
+
import{v as t,y as i,aK as p,_ as r,aL as a,bQ as m,bk as h,aD as c,a$ as b}from"./index-D0eg_rFC.js";const N=t({id:i().describe("Unique identifier for the entity"),title:i().describe("Human-readable title for the entity"),description:i().nullish().describe("Description of the entity"),created_at:i().datetime(),updated_at:i().datetime(),created_by:i().optional(),updated_by:i().optional()}),f=t({field:a(i()),operator:r(["eq","gt","gte","lt","lte","in","like","contains"]),value:p()}),u=m(()=>h([f,t({operator:r(["and","or","not"]),conditions:a(u)})])),C=t({field:a(i()),direction:r(["asc","desc"]),nulls:r(["first","last"]).optional()}),S=t({where:u.optional().describe("Filter expression"),orderBy:a(C).optional().describe("Sort expressions"),limit:c().int().min(1).max(1e3).optional().describe("Maximum number of items to return"),offset:c().int().min(0).optional().describe("Number of items to skip")});function O(e){return t({items:a(e).describe("Array of collection items"),totalCount:c().int().min(0).optional().describe("Total number of matching items (if available)"),hasMore:b().optional().describe("Whether there are more items available")})}const y=t({id:i().describe("ID of the entity to retrieve")});function E(e){return t({item:e.nullable().describe("The retrieved item, or null if not found")})}function I(e){return t({data:e.partial().describe("Data for the new entity (id may be auto-generated)")})}function _(e){return t({item:e.describe("The created entity with generated id")})}function L(e){return t({id:i().describe("ID of the entity to update"),data:e.partial().describe("Partial entity data to update")})}function T(e){return t({item:e.describe("The updated entity")})}const D=t({id:i().describe("ID of the entity to delete")});function g(e){return t({item:e.describe("The deleted entity")})}function v(e,n,l){const o=e.toUpperCase(),d=l?.readOnly??!1,s=[{name:`COLLECTION_${o}_LIST`,inputSchema:S,outputSchema:O(n)},{name:`COLLECTION_${o}_GET`,inputSchema:y,outputSchema:E(n)}];return d||s.push({name:`COLLECTION_${o}_CREATE`,inputSchema:I(n),outputSchema:_(n),opt:!0},{name:`COLLECTION_${o}_UPDATE`,inputSchema:L(n),outputSchema:T(n),opt:!0},{name:`COLLECTION_${o}_DELETE`,inputSchema:D,outputSchema:g(n),opt:!0}),s}export{N as B,v as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{I as c}from"./infiniteQueryObserver-
|
|
1
|
+
import{I as c}from"./infiniteQueryObserver-CpBPXtl6.js";import{bY as u,bZ as p,e as n,c as m,j as l}from"./index-D0eg_rFC.js";import{_ as d}from"./index-BabWp460.js";import{a as f}from"./SearchMd-CuF0EE4i.js";function v(r,e){return u({...r,enabled:!0,suspense:!0,throwOnError:p},c,e)}function y(r){const e=n.c(8);let t,s;e[0]!==r?({className:t,...s}=r,e[0]=r,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=m("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",t),e[3]=t,e[4]=o):o=e[4];let a;return e[5]!==s||e[6]!==o?(a=l.jsx(d,{"data-slot":"command",className:o,...s}),e[5]=s,e[6]=o,e[7]=a):a=e[7],a}function N(r){const e=n.c(9);let t,s;e[0]!==r?({className:t,...s}=r,e[0]=r,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=l.jsx(f,{className:"size-5 shrink-0 text-foreground"}),e[3]=o):o=e[3];let a;e[4]!==t?(a=m("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",t),e[4]=t,e[5]=a):a=e[5];let i;return e[6]!==s||e[7]!==a?(i=l.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-10 items-center gap-2 border-b px-3",children:[o,l.jsx(d.Input,{"data-slot":"command-input",className:a,...s})]}),e[6]=s,e[7]=a,e[8]=i):i=e[8],i}function _(r){const e=n.c(8);let t,s;e[0]!==r?({className:t,...s}=r,e[0]=r,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=m("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",t),e[3]=t,e[4]=o):o=e[4];let a;return e[5]!==s||e[6]!==o?(a=l.jsx(d.List,{"data-slot":"command-list",className:o,...s}),e[5]=s,e[6]=o,e[7]=a):a=e[7],a}function j(r){const e=n.c(4);let t;e[0]!==r?({...t}=r,e[0]=r,e[1]=t):t=e[1];let s;return e[2]!==t?(s=l.jsx(d.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...t}),e[2]=t,e[3]=s):s=e[3],s}function w(r){const e=n.c(8);let t,s;e[0]!==r?({className:t,...s}=r,e[0]=r,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=m("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",t),e[3]=t,e[4]=o):o=e[4];let a;return e[5]!==s||e[6]!==o?(a=l.jsx(d.Group,{"data-slot":"command-group",className:o,...s}),e[5]=s,e[6]=o,e[7]=a):a=e[7],a}function C(r){const e=n.c(8);let t,s;e[0]!==r?({className:t,...s}=r,e[0]=r,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=m("bg-border -mx-1 h-px",t),e[3]=t,e[4]=o):o=e[4];let a;return e[5]!==s||e[6]!==o?(a=l.jsx(d.Separator,{"data-slot":"command-separator",className:o,...s}),e[5]=s,e[6]=o,e[7]=a):a=e[7],a}function k(r){const e=n.c(8);let t,s;e[0]!==r?({className:t,...s}=r,e[0]=r,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=m("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[3]=t,e[4]=o):o=e[4];let a;return e[5]!==s||e[6]!==o?(a=l.jsx(d.Item,{"data-slot":"command-item",className:o,...s}),e[5]=s,e[6]=o,e[7]=a):a=e[7],a}export{j as C,w as a,k as b,C as c,N as d,y as e,_ as f,v as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as _}from"./connection-slug-eyAPH6o3.js";import{e as R,s as $,aI as A,K as L,c as E,j as x}from"./index-
|
|
1
|
+
import{g as _}from"./connection-slug-eyAPH6o3.js";import{e as R,s as $,aI as A,K as L,c as E,j as x}from"./index-D0eg_rFC.js";import{u as D}from"./use-registry-connections-DiPCzdOz.js";import{u as K}from"./use-organization-settings-CRVxUE8d.js";import{S as w,c as Q}from"./constants-D4bpaQIy.js";import{u as F}from"./useInfiniteQuery-BmiRpP8z.js";import{i as H,f as q}from"./extract-connection-data-CIGH4JOA.js";import{C as G}from"./card-Dgjac7df.js";import{I as U}from"./integration-icon-yOwsHf6q.js";function ae(s){const e=new Map;for(const o of s){const l=_(o),n=e.get(l);n?n.push(o):e.set(l,[o])}const t=[],f=new Set;for(const o of s){const l=_(o);if(f.has(l))continue;f.add(l);const n=e.get(l),m=n[0];n.length===1?t.push({type:"single",connection:m}):t.push({type:"group",key:l,icon:m.icon,title:m.app_name?m.title.replace(/\s*\(\d+\)\s*$/,""):m.title,connections:n})}return t}function le(){const s=R.c(6),e=D(),t=K(),f=$().project.enabledPlugins??[];let o;if(s[0]!==f||s[1]!==t||s[2]!==e){let l;s[4]!==t?(l=n=>t(n.id),s[4]=t,s[5]=l):l=s[5],o=e.filter(l).map(V),f.includes("private-registry")&&t(w)&&o.push({id:w,title:"Private Registry",icon:null}),s[0]=f,s[1]=t,s[2]=e,s[3]=o}else o=s[3];return o}function V(s){return{id:s.id,title:s.title,icon:s.icon}}const X=24,S=3;function k(s){return s.id.includes("community-registry")}function Y(s){const e=s?.trim();if(e)return{operator:"or",conditions:[{field:["title"],operator:"contains",value:e},{field:["description"],operator:"contains",value:e},{field:["name"],operator:"contains",value:e},{field:["server","title"],operator:"contains",value:e}]}}function T(s,e,t,f){const o=s.map(u=>u.id).sort().join(","),l=Y(f),{data:n,fetchNextPage:m,hasNextPage:c,isFetchingNextPage:I,isLoading:p}=F({queryKey:L.storeDiscovery(e,`${o}:${f??""}`),queryFn:async({pageParam:u})=>{const r=u??{};return await Promise.all(s.map(async i=>{const g=r[i.id];if(g==="EXHAUSTED")return{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:[]};const v=H(i.id,e);let b;for(let N=0;N<S;N++){let y=null;try{y=await Q({connectionId:i.id,orgId:e});const d={limit:X};g&&(d.cursor=g),l&&(d.where=l);const C=await y.callTool({name:v,arguments:d}),P=C.structuredContent??C,j=P.nextCursor||P.cursor||void 0,M=q(P?[P]:[]);return{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:M,nextCursor:j}}catch(d){b=d}finally{await y?.close().catch(()=>{})}}return console.warn(`[useMergedStoreDiscovery] Registry "${i.title}" (${i.id}) failed after ${S} attempts:`,b),{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:[]}}))},initialPageParam:{},getNextPageParam:u=>{const r={};let a=!1;for(const i of u)i.registryId&&(i.nextCursor?(r[i.registryId]=i.nextCursor,a=!0):r[i.registryId]="EXHAUSTED");return a?r:void 0},staleTime:3600*1e3,placeholderData:A,retry:!1,enabled:t&&s.length>0}),h=[];if(n?.pages)for(const u of n.pages)for(const r of u)for(const a of r.items)h.push({...a,_sourceName:a._sourceName??r.registryTitle,_sourceIcon:a._sourceIcon??r.registryIcon,_registryId:a._registryId??r.registryId});return{items:h,hasMore:c??!1,isLoadingMore:I,isInitialLoading:p,fetchNextPage:()=>{c&&!I&&m()}}}function ce(s,e){const t=R.c(17),{org:f}=$();let o;t[0]!==s?(o=s.filter(W),t[0]=s,t[1]=o):o=t[1];const l=o;let n;t[2]!==s?(n=s.filter(z),t[2]=s,t[3]=n):n=t[3];const m=n,c=T(l,f.id,!0,e),I=!c.hasMore&&!c.isInitialLoading,p=T(m,f.id,I,e);let h;if(t[4]!==I||t[5]!==p||t[6]!==c.items){const N=new Set;h=[];const y=[...c.items];I&&y.push(...p.items);for(const d of y){const C=`${d._registryId}:${d.id}`;N.has(C)||(N.add(C),h.push(d))}t[4]=I,t[5]=p,t[6]=c.items,t[7]=h}else h=t[7];const u=c.isInitialLoading,r=c.isLoadingMore||p.isLoadingMore;let a;e:{if(c.hasMore){a=!0;break e}if(m.length>0){if(!I){a=!0;break e}a=p.hasMore;break e}a=!1}const i=a;let g;t[8]!==p||t[9]!==c?(g=()=>{if(c.hasMore){c.fetchNextPage();return}p.hasMore&&p.fetchNextPage()},t[8]=p,t[9]=c,t[10]=g):g=t[10];const v=g;let b;return t[11]!==i||t[12]!==u||t[13]!==r||t[14]!==h||t[15]!==v?(b={items:h,hasMore:i,isLoadingMore:r,isInitialLoading:u,loadMore:v},t[11]=i,t[12]=u,t[13]=r,t[14]=h,t[15]=v,t[16]=b):b=t[16],b}function z(s){return k(s)}function W(s){return!k(s)}function ue(s){const e=R.c(37),{connection:t,onClick:f,headerActions:o,headerActionsAlwaysVisible:l,body:n,footer:m,className:c,fallbackIcon:I}=s,p=l===void 0?!1:l,h=f&&"hover:bg-muted/50";let u;e[0]!==c||e[1]!==h?(u=E("cursor-pointer transition-colors group overflow-hidden flex flex-col h-full",h,c),e[0]=c,e[1]=h,e[2]=u):u=e[2];let r;e[3]!==t.icon||e[4]!==t.title||e[5]!==I?(r=x.jsx(U,{icon:t.icon,name:t.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:I}),e[3]=t.icon,e[4]=t.title,e[5]=I,e[6]=r):r=e[6];let a;e[7]!==o||e[8]!==p?(a=o&&x.jsx("div",{className:E("transition-opacity",!p&&"sm:opacity-0 sm:group-hover:opacity-100"),onClick:B,children:o}),e[7]=o,e[8]=p,e[9]=a):a=e[9];let i;e[10]!==a?(i=x.jsx("div",{className:"relative",children:a}),e[10]=a,e[11]=i):i=e[11];let g;e[12]!==r||e[13]!==i?(g=x.jsxs("div",{className:"flex items-start justify-between",children:[r,i]}),e[12]=r,e[13]=i,e[14]=g):g=e[14];let v;e[15]!==t.title?(v=x.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:t.title}),e[15]=t.title,e[16]=v):v=e[16];const b=t.description||"No description";let N;e[17]!==b?(N=x.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:b}),e[17]=b,e[18]=N):N=e[18];let y;e[19]!==N||e[20]!==v?(y=x.jsxs("div",{className:"flex flex-col gap-1",children:[v,N]}),e[19]=N,e[20]=v,e[21]=y):y=e[21];let d;e[22]!==n?(d=n&&x.jsx("div",{children:n}),e[22]=n,e[23]=d):d=e[23];let C;e[24]!==y||e[25]!==d||e[26]!==g?(C=x.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[g,y,d]}),e[24]=y,e[25]=d,e[26]=g,e[27]=C):C=e[27];let P;e[28]!==m?(P=m&&x.jsx("div",{className:"border-t border-border mt-auto",children:x.jsx("div",{className:"h-14 flex items-center p-4.5",onClick:Z,children:m})}),e[28]=m,e[29]=P):P=e[29];let j;e[30]!==C||e[31]!==P?(j=x.jsxs("div",{className:"flex flex-col flex-1",children:[C,P]}),e[30]=C,e[31]=P,e[32]=j):j=e[32];let M;return e[33]!==f||e[34]!==j||e[35]!==u?(M=x.jsx(G,{className:u,onClick:f,children:j}),e[33]=f,e[34]=j,e[35]=u,e[36]=M):M=e[36],M}function Z(s){return s.stopPropagation()}function B(s){return s.stopPropagation()}export{ue as C,ce as a,ae as g,le as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{v as he,aJ as Te,aK as Ie,y as le,aL as Ae,e as $,j as t,l as ge,B as H,r as G,c as je,s as te,V as De,K as oe,f as Q,aM as ce,u as $e,aN as Pe,E as Oe,g as Me,o as ze,x as Ve,w as Ee,a0 as Ue,aO as Fe,z as q,a1 as Le}from"./index-WGfZydLo.js";import{g as Re}from"./constants-BxY9N-ws.js";import{E as ve}from"./empty-state-DqQ_mj5B.js";import{E as Be,c as He,r as We,b as Xe,d as Ge}from"./connection-form-helpers-BK0aECJK.js";import{c as Ke,S as qe}from"./index-DIVxtkpR.js";import{u as be,T as Qe}from"./tools-list-Bc5Oy8LD.js";import{u as Je}from"./use-members-DVLjy3CZ.js";import{A as Ye}from"./avatar-B6IagwQu.js";import{b as Ne,a as ye,u as Ze}from"./use-connection-CbAQnOed.js";import{u as ie,S as et}from"./constants-MEMD8ENM.js";import{b as tt}from"./use-mcp-tools-BtTkT0ox.js";import{g as ae,M as st,a as nt}from"./types-D_q3jEZ8.js";import{b as Y,c as ot,a as Z,T as it,d as at}from"./tabs-3MozWL7O.js";import{I as se}from"./integration-icon-ZjWVueCq.js";import{s as rt}from"./Plus-lTLN-5sW.js";import{a as _e}from"./Settings02-CRSd_kje.js";import{s as re}from"./Trash01-qTBTo_1R.js";import{p as lt,o as ct,r as dt,n as mt,s as ut}from"./index-DiAp1HHT.js";import{a as U,b as F,c as R,d as V,e as B,f as xt,F as pt}from"./form-pojp-kTY.js";import{I as X}from"./input-Bzj33Fxq.js";import{u as ft,D as ht}from"./use-delete-connection-BjsFe5Xj.js";import{V as gt}from"./layout-BXIOD6PJ.js";import{c as jt,C as vt,B as bt,a as Nt,b as yt,d as _t,e as Ct}from"./monitoring-stats-row-BcGs8N45.js";import{u as St}from"./use-virtual-mcp-DJidRNsl.js";import{i as Ce}from"./ChevronRight-Bp2wM59-.js";import{a as Se}from"./Users03-CLsqBvj5.js";import{g as we}from"./connection-slug-eyAPH6o3.js";import{n as wt}from"./ZapSquare-DOWrBmYM.js";import{W as kt,b as Tt,s as It}from"./agent-icon-WnDt_mly.js";import{b as At}from"./Tool01-BABHhadV.js";import{C as Dt}from"./collection-search-BaDjhV61.js";import{C as $t}from"./card-CDkIOtIp.js";import{B as Pt}from"./badge-CYgBI6R4.js";import{c as Ot,d as Mt,e as zt,D as de}from"./dropdown-menu-ClMXG_z6.js";import{a as me,c as ue,d as xe,S as pe,b as E}from"./select-DMGlO4yi.js";import{i as Vt}from"./CheckCircle-BCmdWySf.js";import{t as Et}from"./ChevronDown-LbB92Eif.js";import{n as Ut}from"./Container-4EEqLr04.js";import{s as ee}from"./Star01-jT36fQMs.js";import{c as Ft}from"./SearchMd-Ch9A9-sY.js";import"./collections-CnDJSz0t.js";import"./index-DY2kqbCP.js";import"./index-B2JtGbgE.js";import"./extract-connection-data-BattRyEN.js";import"./use-registry-connections-CjUJFqM_.js";import"./use-organization-settings-D9EGsoNi.js";import"./index-CtnGGdXo.js";import"./popover-DB3l_dUB.js";import"./use-mobile-vpGkifWc.js";import"./use-create-virtual-mcp-CwozrztD.js";import"./use-navigate-to-agent-Dg-q0ecS.js";import"./User01-Dn7ERaE8.js";import"./use-collections-DEST7K_q.js";import"./X-DbufVvYT.js";import"./label-DiBCBN0N.js";import"./alert-dialog-BGXEvrTS.js";import"./AlertCircle-B4Z_bYRy.js";import"./ArrowNarrowLeft-Cfmub-b9.js";import"./XCircle-CMz1Sln8.js";import"./ChevronUp-DugRD1Os.js";import"./Palette-DJlRra7b.js";import"./LinkExternal01-n0OTj3Hs.js";import"./Lock01-Bcc8tT2X.js";import"./Sun-BjJ31DgB.js";import"./Play-DE1MmEh7.js";import"./Upload01-D584ZGhL.js";import"./Zap-DCaRrmPx.js";const Lt=he({scopes:Ae(le()).describe("List of scopes available"),stateSchema:Te(le(),Ie()).describe("JSON Schema (draft-07) defining the state structure")}),Rt=[{name:"MCP_CONFIGURATION",inputSchema:he({}),outputSchema:Lt}];function Bt(s){const e=$.c(39),{instance:n,onConfigure:i,onAuthenticate:r,onDelete:o}=s;let c;e[0]!==n.id?(c={connectionId:n.id},e[0]=n.id,e[1]=c):c=e[1];const d=be(c),l=!(n.connection_type==="VIRTUAL")&&d.supportsOAuth&&!d.isAuthenticated,u=l?"border-destructive/50 bg-destructive/5":"border-transparent";let p;e[2]!==u?(p=je("flex items-center gap-3 rounded-lg border px-4 py-2.5 transition-colors",u),e[2]=u,e[3]=p):p=e[3];let a;e[4]!==n.icon||e[5]!==n.title?(a=t.jsx(se,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[4]=n.icon,e[5]=n.title,e[6]=a):a=e[6];let f;e[7]!==n.title?(f=t.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[7]=n.title,e[8]=f):f=e[8];let h;e[9]!==l?(h=l&&t.jsx("span",{className:"text-xs text-destructive font-medium",children:"Needs authorization"}),e[9]=l,e[10]=h):h=e[10];let b;e[11]!==f||e[12]!==h?(b=t.jsxs("div",{className:"flex-1 min-w-0",children:[f,h]}),e[11]=f,e[12]=h,e[13]=b):b=e[13];let j;e[14]!==n||e[15]!==l||e[16]!==r?(j=l&&t.jsx(H,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:()=>r(n),children:"Authorize"}),e[14]=n,e[15]=l,e[16]=r,e[17]=j):j=e[17];let v;e[18]!==n||e[19]!==i?(v=()=>i(n),e[18]=n,e[19]=i,e[20]=v):v=e[20];let S;e[21]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx(_e,{size:13}),e[21]=S):S=e[21];let I;e[22]!==v?(I=t.jsx(H,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:v,title:"Configure",children:S}),e[22]=v,e[23]=I):I=e[23];let N;e[24]!==n||e[25]!==o?(N=()=>o(n),e[24]=n,e[25]=o,e[26]=N):N=e[26];let w;e[27]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx(re,{size:13}),e[27]=w):w=e[27];let k;e[28]!==N?(k=t.jsx(H,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:N,title:"Delete",children:w}),e[28]=N,e[29]=k):k=e[29];let _;e[30]!==I||e[31]!==k||e[32]!==j?(_=t.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[j,I,k]}),e[30]=I,e[31]=k,e[32]=j,e[33]=_):_=e[33];let T;return e[34]!==_||e[35]!==p||e[36]!==a||e[37]!==b?(T=t.jsxs("div",{className:p,children:[a,b,_]}),e[34]=_,e[35]=p,e[36]=a,e[37]=b,e[38]=T):T=e[38],T}function Ht(s){const e=$.c(15),{instance:n,onConfigure:i}=s;let r;e[0]!==n.icon||e[1]!==n.title?(r=t.jsx(se,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[0]=n.icon,e[1]=n.title,e[2]=r):r=e[2];let o;e[3]!==n.title?(o=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm font-medium truncate",children:n.title})}),e[3]=n.title,e[4]=o):o=e[4];let c;e[5]!==n||e[6]!==i?(c=()=>i(n),e[5]=n,e[6]=i,e[7]=c):c=e[7];let d;e[8]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(_e,{size:13}),e[8]=d):d=e[8];let m;e[9]!==c?(m=t.jsx("div",{className:"flex items-center gap-1 shrink-0",children:t.jsx(H,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:c,title:"Configure",children:d})}),e[9]=c,e[10]=m):m=e[10];let l;return e[11]!==r||e[12]!==o||e[13]!==m?(l=t.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-transparent px-4 py-2.5 transition-colors",children:[r,o,m]}),e[11]=r,e[12]=o,e[13]=m,e[14]=l):l=e[14],l}function Wt(s){const e=$.c(25),{instances:n,onConfigure:i,onAuthenticate:r,onDelete:o,onAdd:c,isAdding:d}=s;if(n.length===0)return null;const m=n.length===1?"Instance":"Instances";let l;e[0]!==m?(l=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:m}),e[0]=m,e[1]=l):l=e[1];let u;e[2]!==d?(u=d?t.jsx(ge,{size:13,className:"animate-spin"}):t.jsx(rt,{size:13}),e[2]=d,e[3]=u):u=e[3];let p;e[4]!==d||e[5]!==c||e[6]!==u?(p=t.jsxs(H,{variant:"default",size:"sm",className:"h-7 gap-1.5 text-xs",onClick:c,disabled:d,children:[u,"Add instance"]}),e[4]=d,e[5]=c,e[6]=u,e[7]=p):p=e[7];let a;e[8]!==l||e[9]!==p?(a=t.jsxs("div",{className:"px-5 py-4 border-b border-border flex items-center justify-between",children:[l,p]}),e[8]=l,e[9]=p,e[10]=a):a=e[10];let f;if(e[11]!==n||e[12]!==r||e[13]!==i||e[14]!==o){let j;e[16]!==r||e[17]!==i||e[18]!==o?(j=v=>t.jsx(G.Suspense,{fallback:t.jsx(Ht,{instance:v,onConfigure:i}),children:t.jsx(Bt,{instance:v,onConfigure:i,onAuthenticate:r,onDelete:o})},v.id),e[16]=r,e[17]=i,e[18]=o,e[19]=j):j=e[19],f=n.map(j),e[11]=n,e[12]=r,e[13]=i,e[14]=o,e[15]=f}else f=e[15];let h;e[20]!==f?(h=t.jsx("div",{className:"p-2 flex flex-col gap-1",children:f}),e[20]=f,e[21]=h):h=e[21];let b;return e[22]!==a||e[23]!==h?(b=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[a,h]}),e[22]=a,e[23]=h,e[24]=b):b=e[24],b}const Xt=[{value:"7d",label:"7d"},{value:"14d",label:"14d"},{value:"30d",label:"30d"}];function Gt(s){const e=new Date,n=new Date(e);return s==="7d"?n.setDate(n.getDate()-7):s==="14d"?n.setDate(n.getDate()-14):n.setDate(n.getDate()-30),{startDate:n,endDate:e}}const Kt={calls:{label:"Tool calls"},errors:{label:"Errors"}};function qt(s){const e=$.c(3),{connectionId:n,orgId:i,timeframe:r}=s;let o;e[0]!==i?(o={connectionId:et,orgId:i},e[0]=i,e[1]=o):o=e[1];const c=ie(o),d=Gt(r),{data:m}=De({queryKey:oe.connectionActivity(n,r,i),queryFn:async()=>{const f=await c.callTool({name:"MONITORING_LOGS_LIST",arguments:{startDate:d.startDate.toISOString(),endDate:d.endDate.toISOString(),connectionId:n,limit:2e3,offset:0}});return f.structuredContent??f},staleTime:3e5}),l=jt(m?.logs??[],d),u=l.data,p=l.totalCalls>0;let a;return e[2]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Tool calls"}),e[2]=a):a=e[2],t.jsxs("div",{children:[t.jsxs("div",{className:"flex gap-6 px-5 pb-4",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:l.totalCalls.toLocaleString()}),a]}),l.totalErrors>0&&t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-destructive tabular-nums",children:l.totalErrors.toLocaleString()}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Errors"})]}),l.avgDurationMs>0&&t.jsxs("div",{children:[t.jsxs("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:[Math.round(l.avgDurationMs),"ms"]}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Avg latency"})]})]}),p?t.jsxs("div",{children:[t.jsx(vt,{config:Kt,className:"h-16 w-full",children:t.jsxs(bt,{data:u,barCategoryGap:"4%",children:[t.jsx(Nt,{content:t.jsx(yt,{labelFormatter:Jt}),cursor:{fill:"var(--muted)"}}),t.jsx(_t,{dataKey:"calls",radius:[2,2,0,0],minPointSize:1,children:u.map(Qt)})]})}),t.jsxs("div",{className:"flex justify-between px-3 mt-1 pb-3",children:[t.jsx("span",{className:"text-[10px] text-muted-foreground",children:u[0]?.label}),t.jsx("span",{className:"text-[10px] text-muted-foreground",children:u[u.length-1]?.label})]})]}):t.jsx("div",{className:"h-20 flex items-center justify-center",children:t.jsx("p",{className:"text-sm text-muted-foreground/60",children:"No activity in this period"})})]})}function Qt(s,e){return t.jsx(Ct,{fill:s.errorRate>50?"var(--destructive)":"var(--chart-1)",fillOpacity:s.calls===0?.2:s.errorRate>50?.7:.85},`cell-${e}`)}function Jt(s,e){const n=Array.isArray(e)?e[0]:void 0;return n&&typeof n=="object"&&"payload"in n?n.payload?.label??"":""}function Yt(){const s=$.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{children:[t.jsx("div",{className:"flex gap-6 px-5 pb-4",children:t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx("div",{className:"h-7 w-16 rounded-md bg-muted animate-pulse"}),t.jsx("div",{className:"h-3 w-14 rounded bg-muted animate-pulse"})]})}),t.jsx("div",{className:"h-20 w-full rounded-md bg-muted animate-pulse"})]}),s[0]=e):e=s[0],e}function Zt(s){const e=$.c(13),{connectionId:n}=s,[i,r]=G.useState("14d"),{org:o}=te();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("div",{children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Activity"})}),e[0]=c):c=e[0];let d;e[1]!==i?(d=Xt.map(a=>t.jsx("button",{type:"button",onClick:()=>r(a.value),className:je("px-2.5 py-1 text-xs font-medium rounded-md transition-colors",i===a.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:a.label},a.value)),e[1]=i,e[2]=d):d=e[2];let m;e[3]!==d?(m=t.jsxs("div",{className:"px-5 py-4 flex items-center justify-between",children:[c,t.jsx("div",{className:"flex items-center gap-0.5 bg-muted rounded-lg p-0.5",children:d})]}),e[3]=d,e[4]=m):m=e[4];let l;e[5]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(Yt,{}),e[5]=l):l=e[5];let u;e[6]!==n||e[7]!==o.id||e[8]!==i?(u=t.jsx(G.Suspense,{fallback:l,children:t.jsx(qt,{connectionId:n,orgId:o.id,timeframe:i})}),e[6]=n,e[7]=o.id,e[8]=i,e[9]=u):u=e[9];let p;return e[10]!==m||e[11]!==u?(p=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[m,u]}),e[10]=m,e[11]=u,e[12]=p):p=e[12],p}function es(s){const e=$.c(15),{virtualMcp:n,org:i}=s,r=Q();let o;e[0]!==r||e[1]!==i||e[2]!==n.id?(o=()=>{const p=crypto.randomUUID();r({to:"/$org/$taskId",params:{org:i,taskId:p},search:{virtualmcpid:n.id}})},e[0]=r,e[1]=i,e[2]=n.id,e[3]=o):o=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(Se,{size:16}),e[4]=c):c=e[4];let d;e[5]!==n.icon||e[6]!==n.title?(d=t.jsx(se,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:c}),e[5]=n.icon,e[6]=n.title,e[7]=d):d=e[7];let m;e[8]!==n.title?(m=t.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:n.title}),e[8]=n.title,e[9]=m):m=e[9];let l;e[10]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(Ce,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[10]=l):l=e[10];let u;return e[11]!==o||e[12]!==d||e[13]!==m?(u=t.jsxs("button",{type:"button",onClick:o,className:"flex items-center gap-3 rounded-lg hover:bg-muted/50 transition-colors group text-left w-full",children:[d,m,l]}),e[11]=o,e[12]=d,e[13]=m,e[14]=u):u=e[14],u}function ts(s){const e=$.c(7),{virtualMcps:n,org:i}=s;let r;if(e[0]!==i||e[1]!==n){let c;e[3]!==i?(c=d=>t.jsx(es,{virtualMcp:d,org:i},d.id),e[3]=i,e[4]=c):c=e[4],r=n.map(c),e[0]=i,e[1]=n,e[2]=r}else r=e[2];let o;return e[5]!==r?(o=t.jsx("div",{className:"flex flex-col gap-3",children:t.jsx("div",{className:"flex flex-col gap-2",children:r})}),e[5]=r,e[6]=o):o=e[6],o}function ss(s){const e=$.c(7),{connection:n}=s,{org:i}=te();let r;e[0]!==n.id?(r={filters:[{column:"connection_id",value:n.id}]},e[0]=n.id,e[1]=r):r=e[1];const o=St(r);if(!(o.length>0)){let l;return e[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(t.Fragment,{}),e[2]=l):l=e[2],l}let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx("div",{className:"px-5 py-4 border-b border-border",children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Used by agents"})}),e[3]=d):d=e[3];let m;return e[4]!==i.slug||e[5]!==o?(m=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[d,t.jsx("div",{className:"px-5 py-4",children:t.jsx(ts,{virtualMcps:o,org:i.slug})})]}),e[4]=i.slug,e[5]=o,e[6]=m):m=e[6],m}function ns(s){const e=$.c(30),{tools:n,connectionId:i,org:r}=s,o=Q(),{org:c}=te();let d;e[0]!==i||e[1]!==c.id?(d={connectionId:i,orgId:c.id},e[0]=i,e[1]=c.id,e[2]=d):d=e[2];const m=ie(d),l=Ne(i);let u;e[3]!==l||e[4]!==i?(u=l?we(l):i,e[3]=l,e[4]=i,e[5]=u):u=e[5];const p=u,[a,f]=G.useState("");let h,b,j,v;if(e[6]!==p||e[7]!==m||e[8]!==o||e[9]!==r||e[10]!==a||e[11]!==n){const N=(n??[]).filter(os),w=a.toLowerCase().trim(),k=w?N.filter(g=>g.name.toLowerCase().includes(w)||g.description&&g.description.toLowerCase().includes(w)):N;let _;e[16]!==p||e[17]!==o||e[18]!==r?(_=g=>{o({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:r,appSlug:p,collectionName:"tools",itemId:encodeURIComponent(g.name)}})},e[16]=p,e[17]=o,e[18]=r,e[19]=_):_=e[19];const T=_;j="flex flex-col h-full overflow-hidden";let y;e[20]===Symbol.for("react.memo_cache_sentinel")?(y=g=>{g.key==="Escape"&&(f(""),g.target.blur())},e[20]=y):y=e[20],e[21]!==a?(v=t.jsx(Dt,{value:a,onChange:f,placeholder:"Search apps...",onKeyDown:y}),e[21]=a,e[22]=v):v=e[22],h="flex-1 overflow-auto p-5",b=k.length===0?t.jsx(ve,{image:null,title:a?"No apps found":"No apps available",description:a?"Try adjusting your search terms":"This connection doesn't have any tools with interactive UIs yet."}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-4",children:k.map(g=>{const P=ae(g._meta);return t.jsxs($t,{className:"cursor-pointer transition-colors overflow-hidden gap-0",onClick:()=>T(g),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx(st,{resourceURI:P,toolInfo:{tool:g},displayMode:"inline",minHeight:200,maxHeight:200,client:m})}),t.jsxs("div",{className:"flex flex-col gap-2 p-4",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:g.name}),t.jsx(Qe,{annotations:g.annotations,_meta:g._meta})]}),g.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:g.description})]})]},g.name)})}),e[6]=p,e[7]=m,e[8]=o,e[9]=r,e[10]=a,e[11]=n,e[12]=h,e[13]=b,e[14]=j,e[15]=v}else h=e[12],b=e[13],j=e[14],v=e[15];let S;e[23]!==h||e[24]!==b?(S=t.jsx("div",{className:h,children:b}),e[23]=h,e[24]=b,e[25]=S):S=e[25];let I;return e[26]!==j||e[27]!==v||e[28]!==S?(I=t.jsxs("div",{className:j,children:[v,S]}),e[26]=j,e[27]=v,e[28]=S,e[29]=I):I=e[29],I}function os(s){return!!ae(s._meta)}function ke(s){const e=s.replace(/[._]/g," ").trim().split(/\s+/),n=c=>c.charAt(0).toUpperCase()+c.slice(1),i=new Set(["list","create","get","update","delete","fetch","search","run","trigger","review","send","check"]),r=e.map(n),o=e[e.length-1];return r.length>=2&&o&&i.has(o)?[r.pop(),...r].join(" "):r.join(" ")}function ne(s){const e=$.c(2),{label:n}=s;let i;return e[0]!==n?(i=t.jsx("div",{className:"px-5 py-8 text-center",children:t.jsxs("p",{className:"text-sm text-muted-foreground",children:["No ",n," available."]})}),e[0]=n,e[1]=i):i=e[1],i}function is(s){const e=$.c(50),{tools:n,prompts:i,resources:r,connectionId:o,org:c}=s;let d;e[0]!==i?(d=i===void 0?[]:i,e[0]=i,e[1]=d):d=e[1];const m=d;let l;e[2]!==r?(l=r===void 0?[]:r,e[2]=r,e[3]=l):l=e[3];const u=l,p=Q(),a=Ne(o??"");let f;e[4]!==a||e[5]!==o?(f=a?we(a):o,e[4]=a,e[5]=o,e[6]=f):f=e[6];const h=f;let b;e[7]!==h||e[8]!==o||e[9]!==p||e[10]!==c?(b=function(A){!o||!c||p({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:c,appSlug:h,collectionName:"tools",itemId:encodeURIComponent(A)}})},e[7]=h,e[8]=o,e[9]=p,e[10]=c,e[11]=b):b=e[11];const j=b;let v;e[12]!==o||e[13]!==c||e[14]!==n?(v=o&&c&&n.some(ls),e[12]=o,e[13]=c,e[14]=n,e[15]=v):v=e[15];const S=v;if(n.length+m.length+u.length===0){let C;return e[16]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsxs("div",{className:"rounded-xl border border-border bg-card p-5",children:[t.jsx("h3",{className:"text-sm font-semibold text-foreground mb-1",children:"Capabilities"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"No capabilities discovered yet. The connection may still be connecting."})]}),e[16]=C):C=e[16],C}let N;e[17]!==n.length?(N=t.jsxs(Y,{value:"tools",variant:"underline",children:["Tools (",n.length,")"]}),e[17]=n.length,e[18]=N):N=e[18];let w;e[19]!==S?(w=S&&t.jsx(Y,{value:"apps",variant:"underline",children:"UI"}),e[19]=S,e[20]=w):w=e[20];let k,_;e[21]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(Y,{value:"prompts",variant:"underline",children:"Prompts"}),_=t.jsx(Y,{value:"resources",variant:"underline",children:"Resources"}),e[21]=k,e[22]=_):(k=e[21],_=e[22]);let T;e[23]!==N||e[24]!==w?(T=t.jsx("div",{className:"px-5 flex items-center justify-between border-b border-border",children:t.jsxs(ot,{variant:"underline",className:"gap-1",children:[N,w,k,_]})}),e[23]=N,e[24]=w,e[25]=T):T=e[25];let y;e[26]!==j||e[27]!==n?(y=n.length>0?n.map(C=>t.jsxs("button",{type:"button",className:"w-full flex items-start gap-3 px-5 py-3 text-left hover:bg-muted/40 transition-colors cursor-pointer",onClick:()=>j(C.name),children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(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:ke(C.name)}),C.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:C.description})]}),t.jsx(Ce,{size:16,className:"text-muted-foreground shrink-0 mt-0.5"})]},C.name)):t.jsx(ne,{label:"tools"}),e[26]=j,e[27]=n,e[28]=y):y=e[28];let g;e[29]!==y?(g=t.jsx(Z,{value:"tools",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:y})}),e[29]=y,e[30]=g):g=e[30];let P;e[31]!==o||e[32]!==S||e[33]!==c||e[34]!==n?(P=S&&t.jsx(Z,{value:"apps",className:"h-auto min-h-[200px]",children:t.jsx(ns,{tools:n,connectionId:o,org:c})}),e[31]=o,e[32]=S,e[33]=c,e[34]=n,e[35]=P):P=e[35];let M;e[36]!==m?(M=m.length>0?m.map(rs):t.jsx(ne,{label:"prompts"}),e[36]=m,e[37]=M):M=e[37];let O;e[38]!==M?(O=t.jsx(Z,{value:"prompts",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:M})}),e[38]=M,e[39]=O):O=e[39];let D;e[40]!==u?(D=u.length>0?u.map(as):t.jsx(ne,{label:"resources"}),e[40]=u,e[41]=D):D=e[41];let z;e[42]!==D?(z=t.jsx(Z,{value:"resources",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:D})}),e[42]=D,e[43]=z):z=e[43];let x;return e[44]!==T||e[45]!==g||e[46]!==P||e[47]!==O||e[48]!==z?(x=t.jsx("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:t.jsxs(it,{defaultValue:"tools",variant:"underline",children:[T,g,P,O,z]})}),e[44]=T,e[45]=g,e[46]=P,e[47]=O,e[48]=z,e[49]=x):x=e[49],x}function as(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(kt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:s.name}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description}),s.uri&&t.jsx("div",{className:"text-xs text-muted-foreground/60 font-mono mt-0.5 truncate",children:s.uri})]})]},s.uri??s.name)}function rs(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(wt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:ke(s.name)}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description})]})]},s.name)}function ls(s){return ae(s._meta)}function cs(s){const e=$.c(13),{connection:n,displayTitle:i}=s,r=i??n.title;let o;e[0]!==n.icon||e[1]!==r?(o=t.jsx(se,{icon:n.icon,name:r,size:"xl",className:"shrink-0"}),e[0]=n.icon,e[1]=r,e[2]=o):o=e[2];let c;e[3]!==r?(c=t.jsx("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:t.jsx("h1",{className:"text-lg md:text-xl font-semibold tracking-tight text-foreground leading-none",children:r})}),e[3]=r,e[4]=c):c=e[4];let d;e[5]!==n.description?(d=n.description&&t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed line-clamp-2",children:n.description}),e[5]=n.description,e[6]=d):d=e[6];let m;e[7]!==c||e[8]!==d?(m=t.jsxs("div",{className:"flex-1 min-w-0",children:[c,d]}),e[7]=c,e[8]=d,e[9]=m):m=e[9];let l;return e[10]!==o||e[11]!==m?(l=t.jsxs("div",{className:"flex items-center gap-4 md:gap-6 py-5 md:py-7 px-4 md:px-8 bg-background border-b border-border shrink-0",children:[o,m]}),e[10]=o,e[11]=m,e[12]=l):l=e[12],l}function ds({form:s,connection:e,hasOAuthToken:n,onReauthenticate:i,onRemoveOAuth:r}){const o=ce({control:s.control,name:"ui_type"}),c=ce({control:s.control,name:"connection_url"}),{stdioEnabled:d}=$e(),m=(()=>{if(typeof c!="string"||!c)return!1;try{const a=new URL(c);return a.hostname==="api.githubcopilot.com"&&a.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),l=d||e.connection_type==="STDIO",u=e.connection_type==="VIRTUAL",p=u?Pe(e.connection_url):null;return u?t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Type"}),t.jsxs("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:[t.jsx(Se,{className:"w-4 h-4 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:"Virtual MCP"})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"This connection references a Virtual MCP. Tools and resources are aggregated dynamically from the Virtual MCP's underlying connections."})]}),p&&t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Virtual MCP ID"}),t.jsx("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:t.jsx("code",{className:"text-sm text-muted-foreground",children:p})})]})]}):t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(U,{control:s.control,name:"ui_type",render:({field:a})=>t.jsxs(F,{className:"flex flex-col gap-3",children:[t.jsx(R,{className:"text-xs text-muted-foreground font-medium",children:"Connection"}),o!=="NPX"&&o!=="STDIO"?t.jsxs("div",{className:"flex items-stretch rounded-lg border border-border overflow-hidden",children:[t.jsxs(me,{value:a.value,onValueChange:a.onChange,children:[t.jsx(V,{children:t.jsxs(ue,{className:"h-full! w-auto min-w-[90px] border-0 rounded-none bg-muted/50 focus:ring-0 focus:ring-offset-0",children:[t.jsx(ee,{className:"w-4 h-4 text-muted-foreground shrink-0"}),t.jsx(xe,{})]})}),t.jsxs(pe,{children:[t.jsx(E,{value:"HTTP",children:"HTTP"}),t.jsx(E,{value:"SSE",children:"SSE"}),t.jsx(E,{value:"Websocket",children:"Websocket"}),l&&t.jsxs(t.Fragment,{children:[t.jsx(E,{value:"NPX",children:"NPX Package"}),t.jsx(E,{value:"STDIO",children:"Custom Command"})]})]})]}),t.jsx("div",{className:"w-px bg-border"}),t.jsx(U,{control:s.control,name:"connection_url",render:({field:f})=>t.jsx(F,{className:"flex-1 min-w-0",children:t.jsx(V,{children:t.jsx(X,{placeholder:"https://example.com/mcp",...f,value:f.value??"",className:"h-10 border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent"})})})})]}):t.jsxs(me,{value:a.value,onValueChange:a.onChange,children:[t.jsx(V,{children:t.jsx(ue,{className:"h-10",children:t.jsx(xe,{})})}),t.jsxs(pe,{children:[t.jsx(E,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ee,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(E,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ee,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(E,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ee,{className:"w-4 h-4"}),"Websocket"]})}),l&&t.jsxs(t.Fragment,{children:[t.jsx(E,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Ut,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(E,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Tt,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(B,{})]})}),o==="NPX"&&t.jsx(U,{control:s.control,name:"npx_package",render:({field:a})=>t.jsxs(F,{className:"flex flex-col gap-3",children:[t.jsx(R,{className:"text-xs text-muted-foreground font-medium",children:"NPM Package"}),t.jsx(V,{children:t.jsx(X,{placeholder:"@perplexity-ai/mcp-server",...a,value:a.value||"",className:"h-10 rounded-lg"})}),t.jsx(B,{})]})}),o==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(U,{control:s.control,name:"stdio_command",render:({field:a})=>t.jsxs(F,{className:"flex flex-col gap-3",children:[t.jsx(R,{className:"text-xs text-muted-foreground font-medium",children:"Command"}),t.jsx(V,{children:t.jsx(X,{placeholder:"node, bun, python...",...a,value:a.value||"",className:"h-10 rounded-lg"})}),t.jsx(B,{})]})}),t.jsx(U,{control:s.control,name:"stdio_args",render:({field:a})=>t.jsxs(F,{className:"flex flex-col gap-3",children:[t.jsx(R,{className:"text-xs text-muted-foreground font-medium",children:"Arguments"}),t.jsx(V,{children:t.jsx(X,{placeholder:"arg1 arg2 --flag value",...a,value:a.value||"",className:"h-10 rounded-lg"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Space-separated arguments"}),t.jsx(B,{})]})})]}),t.jsx(U,{control:s.control,name:"stdio_cwd",render:({field:a})=>t.jsxs(F,{className:"flex flex-col gap-3",children:[t.jsx(R,{className:"text-xs text-muted-foreground font-medium",children:"Working Directory"}),t.jsx(V,{children:t.jsx(X,{placeholder:"/path/to/project (optional)",...a,value:a.value||"",className:"h-10 rounded-lg"})}),t.jsx(B,{})]})})]}),(o==="NPX"||o==="STDIO")&&t.jsx(U,{control:s.control,name:"env_vars",render:({field:a})=>t.jsxs(F,{className:"flex flex-col gap-3",children:[t.jsx(R,{className:"text-xs text-muted-foreground font-medium",children:"Environment Variables"}),t.jsx(V,{children:t.jsx(Be,{value:a.value??[],onChange:a.onChange})}),t.jsx(B,{})]})}),o!=="NPX"&&o!=="STDIO"&&t.jsx(U,{control:s.control,name:"connection_token",render:({field:a})=>t.jsxs(F,{className:"flex flex-col gap-3",children:[t.jsx(R,{className:"text-xs text-muted-foreground font-medium",children:m?"GitHub Personal Access Token":"Token"}),n?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(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(de,{onClick:i,children:[t.jsx(Ft,{size:16}),"Re-authenticate"]}),t.jsxs(de,{variant:"destructive",onClick:r,children:[t.jsx(re,{size:16}),"Remove OAuth"]})]})]})}):e.connection_token&&a.value===null?t.jsxs("div",{className:"relative group",children:[t.jsx("div",{className:"h-10 px-3 flex items-center rounded-lg border border-border bg-muted/50 text-muted-foreground font-mono text-sm",children:"••••••••••••••••"}),t.jsx("button",{type:"button",onClick:()=>a.onChange(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 rounded hover:bg-muted opacity-0 group-hover:opacity-100 transition-opacity",title:"Clear and replace token",children:t.jsx(It,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(V,{children:t.jsx(X,{type:"password",placeholder:m?"Paste your GitHub PAT":"Enter access token...",...a,value:a.value||"",className:"h-10 rounded-lg"})}),m&&t.jsxs(xt,{children:["Create a PAT at"," ",t.jsx("a",{href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"github.com/settings/personal-access-tokens"})]})]}),t.jsx(B,{})]})})]})}function ms(s){return s.command==="npx"}function us(s){return s.args?.find(e=>!e.startsWith("-"))??""}function xs(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function fe(s,e){const n={title:s.title,description:s.description??"",icon:s.icon??null,configuration_state:s.configuration_state??{},configuration_scopes:s.configuration_scopes||[]};if(s.connection_type==="STDIO"&&Fe(s.connection_headers)){const i=s.connection_headers,r=We(i.envVars);if(ms(i)){const c=us(i);return{...n,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:c,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:r}}const o=xs(i);return{...n,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:o.command,stdio_args:o.args,stdio_cwd:o.cwd,env_vars:r}}return{...n,ui_type:s.connection_type,connection_url:s.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}function ps(s){let e,n=null,i=null,r=null;return s.ui_type==="NPX"?(e="STDIO",n="",r=Xe(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",r=Ge(s.stdio_command||"",s.stdio_args||"",s.stdio_cwd,s.env_vars||[])):(e=s.ui_type,n=s.connection_url||"",i=s.connection_token||null),{title:s.title,description:s.description||null,icon:s.icon??null,connection_type:e,connection_url:n,...i&&{connection_token:i},...r&&{connection_headers:r},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function fs({connection:s,connectionId:e,org:n,isUpdating:i,tools:r,prompts:o,resources:c,siblings:d}){const m=Q({from:"/$org/settings/connections/$appSlug"}),l=ze(),u=ye(),p=ft({onSuccess:()=>{d.length<=1&&m({to:"/$org/settings/connections",params:{org:n}})}}),[a,f]=G.useState(null),[h,b]=G.useState(!1),j=be({connectionId:e}),{data:v}=Je(),S=v?.data?.members??[],I=a??s,N=S.find(x=>x.userId===I.created_by),k=s?.connection_type==="VIRTUAL"||j.isAuthenticated,_={...s,tools:r},T=Ke(_,Rt),y=Ve({resolver:Ee(He),values:fe(a??s)}),g=y.formState.isDirty,P=async()=>{if(!await y.trigger())return;const C=y.getValues(),A=ps(C),W=a?.id??e;await u.update.mutateAsync({id:W,data:A}),y.reset(C)},M=()=>{y.reset(fe(a??s))},O=async x=>{const{token:C,tokenInfo:A,error:W}=await Le({connectionId:x,scope:"offline_access"});if(W||!C){q.error(`Authentication failed: ${W}`);return}if(A)try{const K=await fetch(`/api/connections/${x}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:A.accessToken,refreshToken:A.refreshToken,expiresIn:A.expiresIn,scope:A.scope,clientId:A.clientId,clientSecret:A.clientSecret,tokenEndpoint:A.tokenEndpoint})});if(!K.ok)console.error("Failed to save OAuth token:",await K.text()),await u.update.mutateAsync({id:x,data:{connection_token:C}});else try{await u.update.mutateAsync({id:x,data:{}})}catch(J){console.warn("Failed to refresh connection tools after OAuth:",J)}}catch(K){console.error("Error saving OAuth token:",K),await u.update.mutateAsync({id:x,data:{connection_token:C}})}else await u.update.mutateAsync({id:x,data:{connection_token:C}});const L=new URL(`/mcp/${x}`,window.location.origin);await l.invalidateQueries({queryKey:oe.isMCPAuthenticated(L.href,null)}),q.success("Authentication successful")},D=()=>O(s.id),z=async()=>{try{const x=await fetch(`/api/connections/${s.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!x.ok){const A=await x.text();q.error(`Failed to remove OAuth: ${A}`);return}const C=new URL(`/mcp/${s.id}`,window.location.origin);await l.invalidateQueries({queryKey:oe.isMCPAuthenticated(C.href,null)}),q.success("OAuth removed. You can now re-authenticate with a different account.")}catch(x){console.error("Error removing OAuth token:",x),q.error("Failed to remove OAuth")}};return t.jsxs(t.Fragment,{children:[t.jsx(ht,{...p}),t.jsx(lt,{open:a!==null,onOpenChange:x=>{x||f(null)},children:t.jsxs(ct,{side:"right",className:"sm:max-w-[520px] p-0 flex flex-col gap-0 overflow-hidden",children:[t.jsxs(dt,{className:"px-4 py-3 md:px-6 md:py-4 border-b border-border shrink-0",children:[t.jsx(mt,{className:"text-base",children:a?.title??s.title}),t.jsx(ut,{className:"text-xs",children:"Update URL, authentication, and other settings"}),N&&t.jsxs("div",{className:"flex items-center gap-1.5 pt-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:"Connected by"}),t.jsx(Ye,{url:N.user?.image??void 0,fallback:N.user?.name??N.user?.email??"?",size:"3xs",shape:"circle"}),t.jsx("span",{className:"text-xs font-medium text-foreground",children:N.user?.name||N.user?.email})]})]}),t.jsxs(pt,{...y,children:[t.jsxs("div",{className:"flex-1 overflow-y-auto px-4 py-3 md:px-6 md:py-5 flex flex-col gap-4 md:gap-6",children:[t.jsxs("div",{className:"flex flex-col gap-3 md:gap-4",children:[t.jsx(U,{control:y.control,name:"title",render:({field:x})=>t.jsxs(F,{children:[t.jsx(R,{children:"Name"}),t.jsx(V,{children:t.jsx(X,{...x})}),t.jsx(B,{})]})}),t.jsx(U,{control:y.control,name:"description",render:({field:x})=>t.jsxs(F,{children:[t.jsx(R,{children:"Description"}),t.jsx(V,{children:t.jsx(X,{...x,value:x.value||""})}),t.jsx(B,{})]})})]}),t.jsx(ds,{form:y,connection:a??s,hasOAuthToken:j.hasOAuthToken,onReauthenticate:D,onRemoveOAuth:z}),t.jsx(qe,{connection:a??s,form:y,hasMcpBinding:T,isMCPAuthenticated:k,supportsOAuth:j.supportsOAuth,isServerError:j.isServerError,onAuthenticate:D,onViewReadme:void 0})]}),t.jsxs("div",{className:"px-6 py-4 border-t border-border flex gap-2 shrink-0",children:[t.jsx(H,{onClick:P,disabled:!g||i,className:"flex-1",children:i?"Saving…":"Save changes"}),g&&t.jsx(H,{variant:"outline",onClick:M,children:"Undo"}),t.jsxs(H,{variant:"outline",className:"gap-2 text-muted-foreground hover:text-destructive hover:border-destructive",onClick:()=>{const x=a??s;f(null),p.requestDelete(x)},children:[t.jsx(re,{size:15}),"Delete"]})]})]},a?.id??s.id)]})}),t.jsx(gt,{hideHeader:!0,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[t.jsx(cs,{connection:s,displayTitle:(()=>{const x=d[0]??s;return x.app_name?x.title.replace(/\s*\(\d+\)\s*$/,""):x.title})()}),t.jsx("div",{className:"flex-1 overflow-auto @container",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-2 gap-5 p-6",children:[t.jsx(Zt,{connectionId:e}),t.jsxs("div",{className:"flex flex-col gap-5",children:[t.jsx(Wt,{instances:d,onConfigure:x=>f(x),onAuthenticate:x=>O(x.id),onDelete:x=>p.requestDelete(x),isAdding:h,onAdd:async()=>{b(!0);try{const x=d[0]??s,C=x.title.replace(/\s*\(\d+\)\s*$/,""),A=d.length+1,W=`${C} (${A})`,L=Re("conn");await u.create.mutateAsync({id:L,title:W,description:x.description??null,connection_type:x.connection_type,connection_url:x.connection_url??null,connection_token:null,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:x.created_by,organization_id:x.organization_id,icon:x.icon??null,app_name:x.app_name??null,app_id:x.app_id??null,connection_headers:x.connection_headers??null,oauth_config:null,configuration_state:x.configuration_state??null,metadata:null,tools:null,bindings:null,status:"inactive"});const K=new URL(`/mcp/${L}`,window.location.origin),J=await Ue({url:K.href,token:null});J.supportsOAuth&&!J.isAuthenticated&&await O(L)}finally{b(!1)}}}),t.jsx(ss,{connection:s})]}),t.jsx("div",{className:"@3xl:col-span-2",children:t.jsx(is,{tools:r,prompts:o,resources:c,connectionId:e,org:n})})]})})]})})]})}function hs(){const s=$.c(38);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/settings/connections/$appSlug"},s[0]=e):e=s[0];const n=Q(e);let i;s[1]===Symbol.for("react.memo_cache_sentinel")?(i={from:"/shell/$org/settings/connections/$appSlug"},s[1]=i):i=s[1];const{appSlug:r,org:o}=Me(i),{org:c}=te(),d=ye();let m;s[2]!==r?(m={slug:r},s[2]=r,s[3]=m):m=s[3];const l=Ze(m),u=l[0]??null,p=u?.id??"",a=p||null;let f;s[4]!==c.id||s[5]!==a?(f={connectionId:a,orgId:c.id},s[4]=c.id,s[5]=a,s[6]=f):f=s[6];const h=ie(f);let b;s[7]!==h?(b={client:h},s[7]=h,s[8]=b):b=s[8];const{data:j}=tt(b);let v;if(s[9]!==u?.tools||s[10]!==p||s[11]!==l||s[12]!==j){const D=j?j.tools.map(ys):(u?.tools??[]).map(Ns);e:{if(l.length<=1){v=D;break e}const z=new Set,x=[],C=vs;for(const A of l){const W=A.id===p?D:C(A.tools);for(const L of W)z.has(L.name)||(z.add(L.name),x.push(L))}v=x.length>0?x:D}s[9]=u?.tools,s[10]=p,s[11]=l,s[12]=j,s[13]=v}else v=s[13];const S=v;let I;s[14]!==h?(I={client:h},s[14]=h,s[15]=I):I=s[15];const{data:N}=at(I);let w;s[16]!==h?(w={client:h},s[16]=h,s[17]=w):w=s[17];const{data:k}=nt(w);let _;s[18]!==N?.prompts?(_=N?.prompts??[],s[18]=N?.prompts,s[19]=_):_=s[19];let T;s[20]!==_?(T=_.map(js),s[20]=_,s[21]=T):T=s[21];const y=T;let g;s[22]!==k?.resources?(g=k?.resources??[],s[22]=k?.resources,s[23]=g):g=s[23];let P;s[24]!==g?(P=g.map(gs),s[24]=g,s[25]=P):P=s[25];const M=P;if(!u){let D;return s[26]!==n||s[27]!==o?(D=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(ve,{title:"Connection not found",description:"This connection may have been deleted or you may not have access.",actions:t.jsx(H,{variant:"outline",onClick:()=>n({to:"/$org/settings/connections",params:{org:o}}),children:"Back to connections"})})}),s[26]=n,s[27]=o,s[28]=D):D=s[28],D}let O;return s[29]!==d.update.isPending||s[30]!==S||s[31]!==u||s[32]!==p||s[33]!==o||s[34]!==y||s[35]!==M||s[36]!==l?(O=t.jsx(fs,{org:o,connection:u,connectionId:p,isUpdating:d.update.isPending,tools:S,prompts:y,resources:M,siblings:l}),s[29]=d.update.isPending,s[30]=S,s[31]=u,s[32]=p,s[33]=o,s[34]=y,s[35]=M,s[36]=l,s[37]=O):O=s[37],O}function gs(s){return{name:s.name,description:s.description,uri:s.uri}}function js(s){return{name:s.name,description:s.description}}function vs(s){return(s??[]).map(bs)}function bs(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema??{},outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Ns(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function ys(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function _s(){const s=$.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Oe,{children:t.jsx(G.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(ge,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(hs,{})})}),s[0]=e):e=s[0],e}function En(){const s=$.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(_s,{}),s[0]=e):e=s[0],e}export{En as default};
|
|
1
|
+
import{v as he,aJ as Te,aK as Ie,y as le,aL as Ae,e as $,j as t,l as ge,B as H,r as G,c as je,s as te,V as De,K as oe,f as Q,aM as ce,u as $e,aN as Pe,E as Oe,g as Me,o as ze,x as Ve,w as Ee,a0 as Ue,aO as Fe,z as q,a1 as Le}from"./index-D0eg_rFC.js";import{g as Re}from"./constants-B6BlNNCv.js";import{E as ve}from"./empty-state-Burt6Pjq.js";import{E as Be,c as He,r as We,b as Xe,d as Ge}from"./connection-form-helpers-BickqfM0.js";import{c as Ke,S as qe}from"./index-CSCpQ3nk.js";import{u as be,T as Qe}from"./tools-list-CJJNUxfe.js";import{u as Je}from"./use-members-CN2GRsgZ.js";import{A as Ye}from"./avatar-DtO_DjAh.js";import{b as Ne,a as ye,u as Ze}from"./use-connection-DS4JMmfK.js";import{u as ie,S as et}from"./constants-D4bpaQIy.js";import{b as tt}from"./use-mcp-tools-CpSp-YOn.js";import{g as ae,M as st,a as nt}from"./types-CXkK-iOI.js";import{b as Y,c as ot,a as Z,T as it,d as at}from"./tabs-DtdegoWH.js";import{I as se}from"./integration-icon-yOwsHf6q.js";import{s as rt}from"./Plus-D7R85tnb.js";import{a as _e}from"./Settings02-0biYSyip.js";import{s as re}from"./Trash01-DiVIK0OP.js";import{p as lt,o as ct,r as dt,n as mt,s as ut}from"./index-CESHAiFx.js";import{a as U,b as F,c as R,d as V,e as B,f as xt,F as pt}from"./form-NpftjNqr.js";import{I as X}from"./input-B0rO4kCw.js";import{u as ft,D as ht}from"./use-delete-connection-CnPoPnuN.js";import{V as gt}from"./layout-CEdjROI5.js";import{c as jt,C as vt,B as bt,a as Nt,b as yt,d as _t,e as Ct}from"./monitoring-stats-row-5HVh1Gjz.js";import{u as St}from"./use-virtual-mcp-DmXmoSMd.js";import{i as Ce}from"./ChevronRight-Ers_V2D1.js";import{a as Se}from"./Users03-C4Ee_frB.js";import{g as we}from"./connection-slug-eyAPH6o3.js";import{n as wt}from"./ZapSquare-Bn1DnHGa.js";import{W as kt,b as Tt,s as It}from"./agent-icon-BCqNXHrJ.js";import{b as At}from"./Tool01-BYIP93fl.js";import{C as Dt}from"./collection-search-9bv6LiW5.js";import{C as $t}from"./card-Dgjac7df.js";import{B as Pt}from"./badge-y-hsEihY.js";import{c as Ot,d as Mt,e as zt,D as de}from"./dropdown-menu-BCSsOhoD.js";import{a as me,c as ue,d as xe,S as pe,b as E}from"./select-DV6Y5fbl.js";import{i as Vt}from"./CheckCircle-CzlD2NtZ.js";import{t as Et}from"./ChevronDown-BjlYfwkz.js";import{n as Ut}from"./Container-BH-IjM7q.js";import{s as ee}from"./Star01-DG4GVqjt.js";import{c as Ft}from"./SearchMd-CuF0EE4i.js";import"./collections-BZR-yDlA.js";import"./index-CmG3u4sk.js";import"./index-DE-s5va1.js";import"./extract-connection-data-CIGH4JOA.js";import"./use-registry-connections-DiPCzdOz.js";import"./use-organization-settings-CRVxUE8d.js";import"./index-BabWp460.js";import"./popover-DUh9iDm9.js";import"./use-mobile-D5xdghWW.js";import"./use-create-virtual-mcp-C0ZtxKxG.js";import"./use-navigate-to-agent-DC2aXNSM.js";import"./User01-ZdNcPumq.js";import"./use-collections-ByN3iK_-.js";import"./X-DJVuZ58d.js";import"./label-DEuSkBBi.js";import"./alert-dialog-Cce2zNSt.js";import"./AlertCircle-ZN1y5-aw.js";import"./ArrowNarrowLeft-BPki4rs6.js";import"./XCircle-C-PtnVDi.js";import"./ChevronUp-BFd66NER.js";import"./Palette-BAefAlJJ.js";import"./LinkExternal01-Df1708RH.js";import"./Lock01-DC87zCkJ.js";import"./Sun-bNHtETAN.js";import"./Play-8RSCt4_z.js";import"./Upload01-1ZdG7oJK.js";import"./Zap-DFbFP4h9.js";const Lt=he({scopes:Ae(le()).describe("List of scopes available"),stateSchema:Te(le(),Ie()).describe("JSON Schema (draft-07) defining the state structure")}),Rt=[{name:"MCP_CONFIGURATION",inputSchema:he({}),outputSchema:Lt}];function Bt(s){const e=$.c(39),{instance:n,onConfigure:i,onAuthenticate:r,onDelete:o}=s;let c;e[0]!==n.id?(c={connectionId:n.id},e[0]=n.id,e[1]=c):c=e[1];const d=be(c),l=!(n.connection_type==="VIRTUAL")&&d.supportsOAuth&&!d.isAuthenticated,u=l?"border-destructive/50 bg-destructive/5":"border-transparent";let p;e[2]!==u?(p=je("flex items-center gap-3 rounded-lg border px-4 py-2.5 transition-colors",u),e[2]=u,e[3]=p):p=e[3];let a;e[4]!==n.icon||e[5]!==n.title?(a=t.jsx(se,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[4]=n.icon,e[5]=n.title,e[6]=a):a=e[6];let f;e[7]!==n.title?(f=t.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[7]=n.title,e[8]=f):f=e[8];let h;e[9]!==l?(h=l&&t.jsx("span",{className:"text-xs text-destructive font-medium",children:"Needs authorization"}),e[9]=l,e[10]=h):h=e[10];let b;e[11]!==f||e[12]!==h?(b=t.jsxs("div",{className:"flex-1 min-w-0",children:[f,h]}),e[11]=f,e[12]=h,e[13]=b):b=e[13];let j;e[14]!==n||e[15]!==l||e[16]!==r?(j=l&&t.jsx(H,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:()=>r(n),children:"Authorize"}),e[14]=n,e[15]=l,e[16]=r,e[17]=j):j=e[17];let v;e[18]!==n||e[19]!==i?(v=()=>i(n),e[18]=n,e[19]=i,e[20]=v):v=e[20];let S;e[21]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx(_e,{size:13}),e[21]=S):S=e[21];let I;e[22]!==v?(I=t.jsx(H,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:v,title:"Configure",children:S}),e[22]=v,e[23]=I):I=e[23];let N;e[24]!==n||e[25]!==o?(N=()=>o(n),e[24]=n,e[25]=o,e[26]=N):N=e[26];let w;e[27]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx(re,{size:13}),e[27]=w):w=e[27];let k;e[28]!==N?(k=t.jsx(H,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:N,title:"Delete",children:w}),e[28]=N,e[29]=k):k=e[29];let _;e[30]!==I||e[31]!==k||e[32]!==j?(_=t.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[j,I,k]}),e[30]=I,e[31]=k,e[32]=j,e[33]=_):_=e[33];let T;return e[34]!==_||e[35]!==p||e[36]!==a||e[37]!==b?(T=t.jsxs("div",{className:p,children:[a,b,_]}),e[34]=_,e[35]=p,e[36]=a,e[37]=b,e[38]=T):T=e[38],T}function Ht(s){const e=$.c(15),{instance:n,onConfigure:i}=s;let r;e[0]!==n.icon||e[1]!==n.title?(r=t.jsx(se,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[0]=n.icon,e[1]=n.title,e[2]=r):r=e[2];let o;e[3]!==n.title?(o=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm font-medium truncate",children:n.title})}),e[3]=n.title,e[4]=o):o=e[4];let c;e[5]!==n||e[6]!==i?(c=()=>i(n),e[5]=n,e[6]=i,e[7]=c):c=e[7];let d;e[8]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(_e,{size:13}),e[8]=d):d=e[8];let m;e[9]!==c?(m=t.jsx("div",{className:"flex items-center gap-1 shrink-0",children:t.jsx(H,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:c,title:"Configure",children:d})}),e[9]=c,e[10]=m):m=e[10];let l;return e[11]!==r||e[12]!==o||e[13]!==m?(l=t.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-transparent px-4 py-2.5 transition-colors",children:[r,o,m]}),e[11]=r,e[12]=o,e[13]=m,e[14]=l):l=e[14],l}function Wt(s){const e=$.c(25),{instances:n,onConfigure:i,onAuthenticate:r,onDelete:o,onAdd:c,isAdding:d}=s;if(n.length===0)return null;const m=n.length===1?"Instance":"Instances";let l;e[0]!==m?(l=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:m}),e[0]=m,e[1]=l):l=e[1];let u;e[2]!==d?(u=d?t.jsx(ge,{size:13,className:"animate-spin"}):t.jsx(rt,{size:13}),e[2]=d,e[3]=u):u=e[3];let p;e[4]!==d||e[5]!==c||e[6]!==u?(p=t.jsxs(H,{variant:"default",size:"sm",className:"h-7 gap-1.5 text-xs",onClick:c,disabled:d,children:[u,"Add instance"]}),e[4]=d,e[5]=c,e[6]=u,e[7]=p):p=e[7];let a;e[8]!==l||e[9]!==p?(a=t.jsxs("div",{className:"px-5 py-4 border-b border-border flex items-center justify-between",children:[l,p]}),e[8]=l,e[9]=p,e[10]=a):a=e[10];let f;if(e[11]!==n||e[12]!==r||e[13]!==i||e[14]!==o){let j;e[16]!==r||e[17]!==i||e[18]!==o?(j=v=>t.jsx(G.Suspense,{fallback:t.jsx(Ht,{instance:v,onConfigure:i}),children:t.jsx(Bt,{instance:v,onConfigure:i,onAuthenticate:r,onDelete:o})},v.id),e[16]=r,e[17]=i,e[18]=o,e[19]=j):j=e[19],f=n.map(j),e[11]=n,e[12]=r,e[13]=i,e[14]=o,e[15]=f}else f=e[15];let h;e[20]!==f?(h=t.jsx("div",{className:"p-2 flex flex-col gap-1",children:f}),e[20]=f,e[21]=h):h=e[21];let b;return e[22]!==a||e[23]!==h?(b=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[a,h]}),e[22]=a,e[23]=h,e[24]=b):b=e[24],b}const Xt=[{value:"7d",label:"7d"},{value:"14d",label:"14d"},{value:"30d",label:"30d"}];function Gt(s){const e=new Date,n=new Date(e);return s==="7d"?n.setDate(n.getDate()-7):s==="14d"?n.setDate(n.getDate()-14):n.setDate(n.getDate()-30),{startDate:n,endDate:e}}const Kt={calls:{label:"Tool calls"},errors:{label:"Errors"}};function qt(s){const e=$.c(3),{connectionId:n,orgId:i,timeframe:r}=s;let o;e[0]!==i?(o={connectionId:et,orgId:i},e[0]=i,e[1]=o):o=e[1];const c=ie(o),d=Gt(r),{data:m}=De({queryKey:oe.connectionActivity(n,r,i),queryFn:async()=>{const f=await c.callTool({name:"MONITORING_LOGS_LIST",arguments:{startDate:d.startDate.toISOString(),endDate:d.endDate.toISOString(),connectionId:n,limit:2e3,offset:0}});return f.structuredContent??f},staleTime:3e5}),l=jt(m?.logs??[],d),u=l.data,p=l.totalCalls>0;let a;return e[2]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Tool calls"}),e[2]=a):a=e[2],t.jsxs("div",{children:[t.jsxs("div",{className:"flex gap-6 px-5 pb-4",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:l.totalCalls.toLocaleString()}),a]}),l.totalErrors>0&&t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-destructive tabular-nums",children:l.totalErrors.toLocaleString()}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Errors"})]}),l.avgDurationMs>0&&t.jsxs("div",{children:[t.jsxs("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:[Math.round(l.avgDurationMs),"ms"]}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Avg latency"})]})]}),p?t.jsxs("div",{children:[t.jsx(vt,{config:Kt,className:"h-16 w-full",children:t.jsxs(bt,{data:u,barCategoryGap:"4%",children:[t.jsx(Nt,{content:t.jsx(yt,{labelFormatter:Jt}),cursor:{fill:"var(--muted)"}}),t.jsx(_t,{dataKey:"calls",radius:[2,2,0,0],minPointSize:1,children:u.map(Qt)})]})}),t.jsxs("div",{className:"flex justify-between px-3 mt-1 pb-3",children:[t.jsx("span",{className:"text-[10px] text-muted-foreground",children:u[0]?.label}),t.jsx("span",{className:"text-[10px] text-muted-foreground",children:u[u.length-1]?.label})]})]}):t.jsx("div",{className:"h-20 flex items-center justify-center",children:t.jsx("p",{className:"text-sm text-muted-foreground/60",children:"No activity in this period"})})]})}function Qt(s,e){return t.jsx(Ct,{fill:s.errorRate>50?"var(--destructive)":"var(--chart-1)",fillOpacity:s.calls===0?.2:s.errorRate>50?.7:.85},`cell-${e}`)}function Jt(s,e){const n=Array.isArray(e)?e[0]:void 0;return n&&typeof n=="object"&&"payload"in n?n.payload?.label??"":""}function Yt(){const s=$.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{children:[t.jsx("div",{className:"flex gap-6 px-5 pb-4",children:t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx("div",{className:"h-7 w-16 rounded-md bg-muted animate-pulse"}),t.jsx("div",{className:"h-3 w-14 rounded bg-muted animate-pulse"})]})}),t.jsx("div",{className:"h-20 w-full rounded-md bg-muted animate-pulse"})]}),s[0]=e):e=s[0],e}function Zt(s){const e=$.c(13),{connectionId:n}=s,[i,r]=G.useState("14d"),{org:o}=te();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("div",{children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Activity"})}),e[0]=c):c=e[0];let d;e[1]!==i?(d=Xt.map(a=>t.jsx("button",{type:"button",onClick:()=>r(a.value),className:je("px-2.5 py-1 text-xs font-medium rounded-md transition-colors",i===a.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:a.label},a.value)),e[1]=i,e[2]=d):d=e[2];let m;e[3]!==d?(m=t.jsxs("div",{className:"px-5 py-4 flex items-center justify-between",children:[c,t.jsx("div",{className:"flex items-center gap-0.5 bg-muted rounded-lg p-0.5",children:d})]}),e[3]=d,e[4]=m):m=e[4];let l;e[5]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(Yt,{}),e[5]=l):l=e[5];let u;e[6]!==n||e[7]!==o.id||e[8]!==i?(u=t.jsx(G.Suspense,{fallback:l,children:t.jsx(qt,{connectionId:n,orgId:o.id,timeframe:i})}),e[6]=n,e[7]=o.id,e[8]=i,e[9]=u):u=e[9];let p;return e[10]!==m||e[11]!==u?(p=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[m,u]}),e[10]=m,e[11]=u,e[12]=p):p=e[12],p}function es(s){const e=$.c(15),{virtualMcp:n,org:i}=s,r=Q();let o;e[0]!==r||e[1]!==i||e[2]!==n.id?(o=()=>{const p=crypto.randomUUID();r({to:"/$org/$taskId",params:{org:i,taskId:p},search:{virtualmcpid:n.id}})},e[0]=r,e[1]=i,e[2]=n.id,e[3]=o):o=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(Se,{size:16}),e[4]=c):c=e[4];let d;e[5]!==n.icon||e[6]!==n.title?(d=t.jsx(se,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:c}),e[5]=n.icon,e[6]=n.title,e[7]=d):d=e[7];let m;e[8]!==n.title?(m=t.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:n.title}),e[8]=n.title,e[9]=m):m=e[9];let l;e[10]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(Ce,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[10]=l):l=e[10];let u;return e[11]!==o||e[12]!==d||e[13]!==m?(u=t.jsxs("button",{type:"button",onClick:o,className:"flex items-center gap-3 rounded-lg hover:bg-muted/50 transition-colors group text-left w-full",children:[d,m,l]}),e[11]=o,e[12]=d,e[13]=m,e[14]=u):u=e[14],u}function ts(s){const e=$.c(7),{virtualMcps:n,org:i}=s;let r;if(e[0]!==i||e[1]!==n){let c;e[3]!==i?(c=d=>t.jsx(es,{virtualMcp:d,org:i},d.id),e[3]=i,e[4]=c):c=e[4],r=n.map(c),e[0]=i,e[1]=n,e[2]=r}else r=e[2];let o;return e[5]!==r?(o=t.jsx("div",{className:"flex flex-col gap-3",children:t.jsx("div",{className:"flex flex-col gap-2",children:r})}),e[5]=r,e[6]=o):o=e[6],o}function ss(s){const e=$.c(7),{connection:n}=s,{org:i}=te();let r;e[0]!==n.id?(r={filters:[{column:"connection_id",value:n.id}]},e[0]=n.id,e[1]=r):r=e[1];const o=St(r);if(!(o.length>0)){let l;return e[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(t.Fragment,{}),e[2]=l):l=e[2],l}let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx("div",{className:"px-5 py-4 border-b border-border",children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Used by agents"})}),e[3]=d):d=e[3];let m;return e[4]!==i.slug||e[5]!==o?(m=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[d,t.jsx("div",{className:"px-5 py-4",children:t.jsx(ts,{virtualMcps:o,org:i.slug})})]}),e[4]=i.slug,e[5]=o,e[6]=m):m=e[6],m}function ns(s){const e=$.c(30),{tools:n,connectionId:i,org:r}=s,o=Q(),{org:c}=te();let d;e[0]!==i||e[1]!==c.id?(d={connectionId:i,orgId:c.id},e[0]=i,e[1]=c.id,e[2]=d):d=e[2];const m=ie(d),l=Ne(i);let u;e[3]!==l||e[4]!==i?(u=l?we(l):i,e[3]=l,e[4]=i,e[5]=u):u=e[5];const p=u,[a,f]=G.useState("");let h,b,j,v;if(e[6]!==p||e[7]!==m||e[8]!==o||e[9]!==r||e[10]!==a||e[11]!==n){const N=(n??[]).filter(os),w=a.toLowerCase().trim(),k=w?N.filter(g=>g.name.toLowerCase().includes(w)||g.description&&g.description.toLowerCase().includes(w)):N;let _;e[16]!==p||e[17]!==o||e[18]!==r?(_=g=>{o({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:r,appSlug:p,collectionName:"tools",itemId:encodeURIComponent(g.name)}})},e[16]=p,e[17]=o,e[18]=r,e[19]=_):_=e[19];const T=_;j="flex flex-col h-full overflow-hidden";let y;e[20]===Symbol.for("react.memo_cache_sentinel")?(y=g=>{g.key==="Escape"&&(f(""),g.target.blur())},e[20]=y):y=e[20],e[21]!==a?(v=t.jsx(Dt,{value:a,onChange:f,placeholder:"Search apps...",onKeyDown:y}),e[21]=a,e[22]=v):v=e[22],h="flex-1 overflow-auto p-5",b=k.length===0?t.jsx(ve,{image:null,title:a?"No apps found":"No apps available",description:a?"Try adjusting your search terms":"This connection doesn't have any tools with interactive UIs yet."}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-4",children:k.map(g=>{const P=ae(g._meta);return t.jsxs($t,{className:"cursor-pointer transition-colors overflow-hidden gap-0",onClick:()=>T(g),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx(st,{resourceURI:P,toolInfo:{tool:g},displayMode:"inline",minHeight:200,maxHeight:200,client:m})}),t.jsxs("div",{className:"flex flex-col gap-2 p-4",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:g.name}),t.jsx(Qe,{annotations:g.annotations,_meta:g._meta})]}),g.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:g.description})]})]},g.name)})}),e[6]=p,e[7]=m,e[8]=o,e[9]=r,e[10]=a,e[11]=n,e[12]=h,e[13]=b,e[14]=j,e[15]=v}else h=e[12],b=e[13],j=e[14],v=e[15];let S;e[23]!==h||e[24]!==b?(S=t.jsx("div",{className:h,children:b}),e[23]=h,e[24]=b,e[25]=S):S=e[25];let I;return e[26]!==j||e[27]!==v||e[28]!==S?(I=t.jsxs("div",{className:j,children:[v,S]}),e[26]=j,e[27]=v,e[28]=S,e[29]=I):I=e[29],I}function os(s){return!!ae(s._meta)}function ke(s){const e=s.replace(/[._]/g," ").trim().split(/\s+/),n=c=>c.charAt(0).toUpperCase()+c.slice(1),i=new Set(["list","create","get","update","delete","fetch","search","run","trigger","review","send","check"]),r=e.map(n),o=e[e.length-1];return r.length>=2&&o&&i.has(o)?[r.pop(),...r].join(" "):r.join(" ")}function ne(s){const e=$.c(2),{label:n}=s;let i;return e[0]!==n?(i=t.jsx("div",{className:"px-5 py-8 text-center",children:t.jsxs("p",{className:"text-sm text-muted-foreground",children:["No ",n," available."]})}),e[0]=n,e[1]=i):i=e[1],i}function is(s){const e=$.c(50),{tools:n,prompts:i,resources:r,connectionId:o,org:c}=s;let d;e[0]!==i?(d=i===void 0?[]:i,e[0]=i,e[1]=d):d=e[1];const m=d;let l;e[2]!==r?(l=r===void 0?[]:r,e[2]=r,e[3]=l):l=e[3];const u=l,p=Q(),a=Ne(o??"");let f;e[4]!==a||e[5]!==o?(f=a?we(a):o,e[4]=a,e[5]=o,e[6]=f):f=e[6];const h=f;let b;e[7]!==h||e[8]!==o||e[9]!==p||e[10]!==c?(b=function(A){!o||!c||p({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:c,appSlug:h,collectionName:"tools",itemId:encodeURIComponent(A)}})},e[7]=h,e[8]=o,e[9]=p,e[10]=c,e[11]=b):b=e[11];const j=b;let v;e[12]!==o||e[13]!==c||e[14]!==n?(v=o&&c&&n.some(ls),e[12]=o,e[13]=c,e[14]=n,e[15]=v):v=e[15];const S=v;if(n.length+m.length+u.length===0){let C;return e[16]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsxs("div",{className:"rounded-xl border border-border bg-card p-5",children:[t.jsx("h3",{className:"text-sm font-semibold text-foreground mb-1",children:"Capabilities"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"No capabilities discovered yet. The connection may still be connecting."})]}),e[16]=C):C=e[16],C}let N;e[17]!==n.length?(N=t.jsxs(Y,{value:"tools",variant:"underline",children:["Tools (",n.length,")"]}),e[17]=n.length,e[18]=N):N=e[18];let w;e[19]!==S?(w=S&&t.jsx(Y,{value:"apps",variant:"underline",children:"UI"}),e[19]=S,e[20]=w):w=e[20];let k,_;e[21]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(Y,{value:"prompts",variant:"underline",children:"Prompts"}),_=t.jsx(Y,{value:"resources",variant:"underline",children:"Resources"}),e[21]=k,e[22]=_):(k=e[21],_=e[22]);let T;e[23]!==N||e[24]!==w?(T=t.jsx("div",{className:"px-5 flex items-center justify-between border-b border-border",children:t.jsxs(ot,{variant:"underline",className:"gap-1",children:[N,w,k,_]})}),e[23]=N,e[24]=w,e[25]=T):T=e[25];let y;e[26]!==j||e[27]!==n?(y=n.length>0?n.map(C=>t.jsxs("button",{type:"button",className:"w-full flex items-start gap-3 px-5 py-3 text-left hover:bg-muted/40 transition-colors cursor-pointer",onClick:()=>j(C.name),children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(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:ke(C.name)}),C.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:C.description})]}),t.jsx(Ce,{size:16,className:"text-muted-foreground shrink-0 mt-0.5"})]},C.name)):t.jsx(ne,{label:"tools"}),e[26]=j,e[27]=n,e[28]=y):y=e[28];let g;e[29]!==y?(g=t.jsx(Z,{value:"tools",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:y})}),e[29]=y,e[30]=g):g=e[30];let P;e[31]!==o||e[32]!==S||e[33]!==c||e[34]!==n?(P=S&&t.jsx(Z,{value:"apps",className:"h-auto min-h-[200px]",children:t.jsx(ns,{tools:n,connectionId:o,org:c})}),e[31]=o,e[32]=S,e[33]=c,e[34]=n,e[35]=P):P=e[35];let M;e[36]!==m?(M=m.length>0?m.map(rs):t.jsx(ne,{label:"prompts"}),e[36]=m,e[37]=M):M=e[37];let O;e[38]!==M?(O=t.jsx(Z,{value:"prompts",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:M})}),e[38]=M,e[39]=O):O=e[39];let D;e[40]!==u?(D=u.length>0?u.map(as):t.jsx(ne,{label:"resources"}),e[40]=u,e[41]=D):D=e[41];let z;e[42]!==D?(z=t.jsx(Z,{value:"resources",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:D})}),e[42]=D,e[43]=z):z=e[43];let x;return e[44]!==T||e[45]!==g||e[46]!==P||e[47]!==O||e[48]!==z?(x=t.jsx("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:t.jsxs(it,{defaultValue:"tools",variant:"underline",children:[T,g,P,O,z]})}),e[44]=T,e[45]=g,e[46]=P,e[47]=O,e[48]=z,e[49]=x):x=e[49],x}function as(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(kt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:s.name}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description}),s.uri&&t.jsx("div",{className:"text-xs text-muted-foreground/60 font-mono mt-0.5 truncate",children:s.uri})]})]},s.uri??s.name)}function rs(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(wt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:ke(s.name)}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description})]})]},s.name)}function ls(s){return ae(s._meta)}function cs(s){const e=$.c(13),{connection:n,displayTitle:i}=s,r=i??n.title;let o;e[0]!==n.icon||e[1]!==r?(o=t.jsx(se,{icon:n.icon,name:r,size:"xl",className:"shrink-0"}),e[0]=n.icon,e[1]=r,e[2]=o):o=e[2];let c;e[3]!==r?(c=t.jsx("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:t.jsx("h1",{className:"text-lg md:text-xl font-semibold tracking-tight text-foreground leading-none",children:r})}),e[3]=r,e[4]=c):c=e[4];let d;e[5]!==n.description?(d=n.description&&t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed line-clamp-2",children:n.description}),e[5]=n.description,e[6]=d):d=e[6];let m;e[7]!==c||e[8]!==d?(m=t.jsxs("div",{className:"flex-1 min-w-0",children:[c,d]}),e[7]=c,e[8]=d,e[9]=m):m=e[9];let l;return e[10]!==o||e[11]!==m?(l=t.jsxs("div",{className:"flex items-center gap-4 md:gap-6 py-5 md:py-7 px-4 md:px-8 bg-background border-b border-border shrink-0",children:[o,m]}),e[10]=o,e[11]=m,e[12]=l):l=e[12],l}function ds({form:s,connection:e,hasOAuthToken:n,onReauthenticate:i,onRemoveOAuth:r}){const o=ce({control:s.control,name:"ui_type"}),c=ce({control:s.control,name:"connection_url"}),{stdioEnabled:d}=$e(),m=(()=>{if(typeof c!="string"||!c)return!1;try{const a=new URL(c);return a.hostname==="api.githubcopilot.com"&&a.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),l=d||e.connection_type==="STDIO",u=e.connection_type==="VIRTUAL",p=u?Pe(e.connection_url):null;return u?t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Type"}),t.jsxs("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:[t.jsx(Se,{className:"w-4 h-4 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:"Virtual MCP"})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"This connection references a Virtual MCP. Tools and resources are aggregated dynamically from the Virtual MCP's underlying connections."})]}),p&&t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Virtual MCP ID"}),t.jsx("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:t.jsx("code",{className:"text-sm text-muted-foreground",children:p})})]})]}):t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(U,{control:s.control,name:"ui_type",render:({field:a})=>t.jsxs(F,{className:"flex flex-col gap-3",children:[t.jsx(R,{className:"text-xs text-muted-foreground font-medium",children:"Connection"}),o!=="NPX"&&o!=="STDIO"?t.jsxs("div",{className:"flex items-stretch rounded-lg border border-border overflow-hidden",children:[t.jsxs(me,{value:a.value,onValueChange:a.onChange,children:[t.jsx(V,{children:t.jsxs(ue,{className:"h-full! w-auto min-w-[90px] border-0 rounded-none bg-muted/50 focus:ring-0 focus:ring-offset-0",children:[t.jsx(ee,{className:"w-4 h-4 text-muted-foreground shrink-0"}),t.jsx(xe,{})]})}),t.jsxs(pe,{children:[t.jsx(E,{value:"HTTP",children:"HTTP"}),t.jsx(E,{value:"SSE",children:"SSE"}),t.jsx(E,{value:"Websocket",children:"Websocket"}),l&&t.jsxs(t.Fragment,{children:[t.jsx(E,{value:"NPX",children:"NPX Package"}),t.jsx(E,{value:"STDIO",children:"Custom Command"})]})]})]}),t.jsx("div",{className:"w-px bg-border"}),t.jsx(U,{control:s.control,name:"connection_url",render:({field:f})=>t.jsx(F,{className:"flex-1 min-w-0",children:t.jsx(V,{children:t.jsx(X,{placeholder:"https://example.com/mcp",...f,value:f.value??"",className:"h-10 border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent"})})})})]}):t.jsxs(me,{value:a.value,onValueChange:a.onChange,children:[t.jsx(V,{children:t.jsx(ue,{className:"h-10",children:t.jsx(xe,{})})}),t.jsxs(pe,{children:[t.jsx(E,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ee,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(E,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ee,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(E,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ee,{className:"w-4 h-4"}),"Websocket"]})}),l&&t.jsxs(t.Fragment,{children:[t.jsx(E,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Ut,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(E,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Tt,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(B,{})]})}),o==="NPX"&&t.jsx(U,{control:s.control,name:"npx_package",render:({field:a})=>t.jsxs(F,{className:"flex flex-col gap-3",children:[t.jsx(R,{className:"text-xs text-muted-foreground font-medium",children:"NPM Package"}),t.jsx(V,{children:t.jsx(X,{placeholder:"@perplexity-ai/mcp-server",...a,value:a.value||"",className:"h-10 rounded-lg"})}),t.jsx(B,{})]})}),o==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(U,{control:s.control,name:"stdio_command",render:({field:a})=>t.jsxs(F,{className:"flex flex-col gap-3",children:[t.jsx(R,{className:"text-xs text-muted-foreground font-medium",children:"Command"}),t.jsx(V,{children:t.jsx(X,{placeholder:"node, bun, python...",...a,value:a.value||"",className:"h-10 rounded-lg"})}),t.jsx(B,{})]})}),t.jsx(U,{control:s.control,name:"stdio_args",render:({field:a})=>t.jsxs(F,{className:"flex flex-col gap-3",children:[t.jsx(R,{className:"text-xs text-muted-foreground font-medium",children:"Arguments"}),t.jsx(V,{children:t.jsx(X,{placeholder:"arg1 arg2 --flag value",...a,value:a.value||"",className:"h-10 rounded-lg"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Space-separated arguments"}),t.jsx(B,{})]})})]}),t.jsx(U,{control:s.control,name:"stdio_cwd",render:({field:a})=>t.jsxs(F,{className:"flex flex-col gap-3",children:[t.jsx(R,{className:"text-xs text-muted-foreground font-medium",children:"Working Directory"}),t.jsx(V,{children:t.jsx(X,{placeholder:"/path/to/project (optional)",...a,value:a.value||"",className:"h-10 rounded-lg"})}),t.jsx(B,{})]})})]}),(o==="NPX"||o==="STDIO")&&t.jsx(U,{control:s.control,name:"env_vars",render:({field:a})=>t.jsxs(F,{className:"flex flex-col gap-3",children:[t.jsx(R,{className:"text-xs text-muted-foreground font-medium",children:"Environment Variables"}),t.jsx(V,{children:t.jsx(Be,{value:a.value??[],onChange:a.onChange})}),t.jsx(B,{})]})}),o!=="NPX"&&o!=="STDIO"&&t.jsx(U,{control:s.control,name:"connection_token",render:({field:a})=>t.jsxs(F,{className:"flex flex-col gap-3",children:[t.jsx(R,{className:"text-xs text-muted-foreground font-medium",children:m?"GitHub Personal Access Token":"Token"}),n?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(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(de,{onClick:i,children:[t.jsx(Ft,{size:16}),"Re-authenticate"]}),t.jsxs(de,{variant:"destructive",onClick:r,children:[t.jsx(re,{size:16}),"Remove OAuth"]})]})]})}):e.connection_token&&a.value===null?t.jsxs("div",{className:"relative group",children:[t.jsx("div",{className:"h-10 px-3 flex items-center rounded-lg border border-border bg-muted/50 text-muted-foreground font-mono text-sm",children:"••••••••••••••••"}),t.jsx("button",{type:"button",onClick:()=>a.onChange(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 rounded hover:bg-muted opacity-0 group-hover:opacity-100 transition-opacity",title:"Clear and replace token",children:t.jsx(It,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(V,{children:t.jsx(X,{type:"password",placeholder:m?"Paste your GitHub PAT":"Enter access token...",...a,value:a.value||"",className:"h-10 rounded-lg"})}),m&&t.jsxs(xt,{children:["Create a PAT at"," ",t.jsx("a",{href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"github.com/settings/personal-access-tokens"})]})]}),t.jsx(B,{})]})})]})}function ms(s){return s.command==="npx"}function us(s){return s.args?.find(e=>!e.startsWith("-"))??""}function xs(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function fe(s,e){const n={title:s.title,description:s.description??"",icon:s.icon??null,configuration_state:s.configuration_state??{},configuration_scopes:s.configuration_scopes||[]};if(s.connection_type==="STDIO"&&Fe(s.connection_headers)){const i=s.connection_headers,r=We(i.envVars);if(ms(i)){const c=us(i);return{...n,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:c,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:r}}const o=xs(i);return{...n,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:o.command,stdio_args:o.args,stdio_cwd:o.cwd,env_vars:r}}return{...n,ui_type:s.connection_type,connection_url:s.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}function ps(s){let e,n=null,i=null,r=null;return s.ui_type==="NPX"?(e="STDIO",n="",r=Xe(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",r=Ge(s.stdio_command||"",s.stdio_args||"",s.stdio_cwd,s.env_vars||[])):(e=s.ui_type,n=s.connection_url||"",i=s.connection_token||null),{title:s.title,description:s.description||null,icon:s.icon??null,connection_type:e,connection_url:n,...i&&{connection_token:i},...r&&{connection_headers:r},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function fs({connection:s,connectionId:e,org:n,isUpdating:i,tools:r,prompts:o,resources:c,siblings:d}){const m=Q({from:"/$org/settings/connections/$appSlug"}),l=ze(),u=ye(),p=ft({onSuccess:()=>{d.length<=1&&m({to:"/$org/settings/connections",params:{org:n}})}}),[a,f]=G.useState(null),[h,b]=G.useState(!1),j=be({connectionId:e}),{data:v}=Je(),S=v?.data?.members??[],I=a??s,N=S.find(x=>x.userId===I.created_by),k=s?.connection_type==="VIRTUAL"||j.isAuthenticated,_={...s,tools:r},T=Ke(_,Rt),y=Ve({resolver:Ee(He),values:fe(a??s)}),g=y.formState.isDirty,P=async()=>{if(!await y.trigger())return;const C=y.getValues(),A=ps(C),W=a?.id??e;await u.update.mutateAsync({id:W,data:A}),y.reset(C)},M=()=>{y.reset(fe(a??s))},O=async x=>{const{token:C,tokenInfo:A,error:W}=await Le({connectionId:x,scope:"offline_access"});if(W||!C){q.error(`Authentication failed: ${W}`);return}if(A)try{const K=await fetch(`/api/connections/${x}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:A.accessToken,refreshToken:A.refreshToken,expiresIn:A.expiresIn,scope:A.scope,clientId:A.clientId,clientSecret:A.clientSecret,tokenEndpoint:A.tokenEndpoint})});if(!K.ok)console.error("Failed to save OAuth token:",await K.text()),await u.update.mutateAsync({id:x,data:{connection_token:C}});else try{await u.update.mutateAsync({id:x,data:{}})}catch(J){console.warn("Failed to refresh connection tools after OAuth:",J)}}catch(K){console.error("Error saving OAuth token:",K),await u.update.mutateAsync({id:x,data:{connection_token:C}})}else await u.update.mutateAsync({id:x,data:{connection_token:C}});const L=new URL(`/mcp/${x}`,window.location.origin);await l.invalidateQueries({queryKey:oe.isMCPAuthenticated(L.href,null)}),q.success("Authentication successful")},D=()=>O(s.id),z=async()=>{try{const x=await fetch(`/api/connections/${s.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!x.ok){const A=await x.text();q.error(`Failed to remove OAuth: ${A}`);return}const C=new URL(`/mcp/${s.id}`,window.location.origin);await l.invalidateQueries({queryKey:oe.isMCPAuthenticated(C.href,null)}),q.success("OAuth removed. You can now re-authenticate with a different account.")}catch(x){console.error("Error removing OAuth token:",x),q.error("Failed to remove OAuth")}};return t.jsxs(t.Fragment,{children:[t.jsx(ht,{...p}),t.jsx(lt,{open:a!==null,onOpenChange:x=>{x||f(null)},children:t.jsxs(ct,{side:"right",className:"sm:max-w-[520px] p-0 flex flex-col gap-0 overflow-hidden",children:[t.jsxs(dt,{className:"px-4 py-3 md:px-6 md:py-4 border-b border-border shrink-0",children:[t.jsx(mt,{className:"text-base",children:a?.title??s.title}),t.jsx(ut,{className:"text-xs",children:"Update URL, authentication, and other settings"}),N&&t.jsxs("div",{className:"flex items-center gap-1.5 pt-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:"Connected by"}),t.jsx(Ye,{url:N.user?.image??void 0,fallback:N.user?.name??N.user?.email??"?",size:"3xs",shape:"circle"}),t.jsx("span",{className:"text-xs font-medium text-foreground",children:N.user?.name||N.user?.email})]})]}),t.jsxs(pt,{...y,children:[t.jsxs("div",{className:"flex-1 overflow-y-auto px-4 py-3 md:px-6 md:py-5 flex flex-col gap-4 md:gap-6",children:[t.jsxs("div",{className:"flex flex-col gap-3 md:gap-4",children:[t.jsx(U,{control:y.control,name:"title",render:({field:x})=>t.jsxs(F,{children:[t.jsx(R,{children:"Name"}),t.jsx(V,{children:t.jsx(X,{...x})}),t.jsx(B,{})]})}),t.jsx(U,{control:y.control,name:"description",render:({field:x})=>t.jsxs(F,{children:[t.jsx(R,{children:"Description"}),t.jsx(V,{children:t.jsx(X,{...x,value:x.value||""})}),t.jsx(B,{})]})})]}),t.jsx(ds,{form:y,connection:a??s,hasOAuthToken:j.hasOAuthToken,onReauthenticate:D,onRemoveOAuth:z}),t.jsx(qe,{connection:a??s,form:y,hasMcpBinding:T,isMCPAuthenticated:k,supportsOAuth:j.supportsOAuth,isServerError:j.isServerError,onAuthenticate:D,onViewReadme:void 0})]}),t.jsxs("div",{className:"px-6 py-4 border-t border-border flex gap-2 shrink-0",children:[t.jsx(H,{onClick:P,disabled:!g||i,className:"flex-1",children:i?"Saving…":"Save changes"}),g&&t.jsx(H,{variant:"outline",onClick:M,children:"Undo"}),t.jsxs(H,{variant:"outline",className:"gap-2 text-muted-foreground hover:text-destructive hover:border-destructive",onClick:()=>{const x=a??s;f(null),p.requestDelete(x)},children:[t.jsx(re,{size:15}),"Delete"]})]})]},a?.id??s.id)]})}),t.jsx(gt,{hideHeader:!0,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[t.jsx(cs,{connection:s,displayTitle:(()=>{const x=d[0]??s;return x.app_name?x.title.replace(/\s*\(\d+\)\s*$/,""):x.title})()}),t.jsx("div",{className:"flex-1 overflow-auto @container",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-2 gap-5 p-6",children:[t.jsx(Zt,{connectionId:e}),t.jsxs("div",{className:"flex flex-col gap-5",children:[t.jsx(Wt,{instances:d,onConfigure:x=>f(x),onAuthenticate:x=>O(x.id),onDelete:x=>p.requestDelete(x),isAdding:h,onAdd:async()=>{b(!0);try{const x=d[0]??s,C=x.title.replace(/\s*\(\d+\)\s*$/,""),A=d.length+1,W=`${C} (${A})`,L=Re("conn");await u.create.mutateAsync({id:L,title:W,description:x.description??null,connection_type:x.connection_type,connection_url:x.connection_url??null,connection_token:null,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:x.created_by,organization_id:x.organization_id,icon:x.icon??null,app_name:x.app_name??null,app_id:x.app_id??null,connection_headers:x.connection_headers??null,oauth_config:null,configuration_state:x.configuration_state??null,metadata:null,tools:null,bindings:null,status:"inactive"});const K=new URL(`/mcp/${L}`,window.location.origin),J=await Ue({url:K.href,token:null});J.supportsOAuth&&!J.isAuthenticated&&await O(L)}finally{b(!1)}}}),t.jsx(ss,{connection:s})]}),t.jsx("div",{className:"@3xl:col-span-2",children:t.jsx(is,{tools:r,prompts:o,resources:c,connectionId:e,org:n})})]})})]})})]})}function hs(){const s=$.c(38);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/settings/connections/$appSlug"},s[0]=e):e=s[0];const n=Q(e);let i;s[1]===Symbol.for("react.memo_cache_sentinel")?(i={from:"/shell/$org/settings/connections/$appSlug"},s[1]=i):i=s[1];const{appSlug:r,org:o}=Me(i),{org:c}=te(),d=ye();let m;s[2]!==r?(m={slug:r},s[2]=r,s[3]=m):m=s[3];const l=Ze(m),u=l[0]??null,p=u?.id??"",a=p||null;let f;s[4]!==c.id||s[5]!==a?(f={connectionId:a,orgId:c.id},s[4]=c.id,s[5]=a,s[6]=f):f=s[6];const h=ie(f);let b;s[7]!==h?(b={client:h},s[7]=h,s[8]=b):b=s[8];const{data:j}=tt(b);let v;if(s[9]!==u?.tools||s[10]!==p||s[11]!==l||s[12]!==j){const D=j?j.tools.map(ys):(u?.tools??[]).map(Ns);e:{if(l.length<=1){v=D;break e}const z=new Set,x=[],C=vs;for(const A of l){const W=A.id===p?D:C(A.tools);for(const L of W)z.has(L.name)||(z.add(L.name),x.push(L))}v=x.length>0?x:D}s[9]=u?.tools,s[10]=p,s[11]=l,s[12]=j,s[13]=v}else v=s[13];const S=v;let I;s[14]!==h?(I={client:h},s[14]=h,s[15]=I):I=s[15];const{data:N}=at(I);let w;s[16]!==h?(w={client:h},s[16]=h,s[17]=w):w=s[17];const{data:k}=nt(w);let _;s[18]!==N?.prompts?(_=N?.prompts??[],s[18]=N?.prompts,s[19]=_):_=s[19];let T;s[20]!==_?(T=_.map(js),s[20]=_,s[21]=T):T=s[21];const y=T;let g;s[22]!==k?.resources?(g=k?.resources??[],s[22]=k?.resources,s[23]=g):g=s[23];let P;s[24]!==g?(P=g.map(gs),s[24]=g,s[25]=P):P=s[25];const M=P;if(!u){let D;return s[26]!==n||s[27]!==o?(D=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(ve,{title:"Connection not found",description:"This connection may have been deleted or you may not have access.",actions:t.jsx(H,{variant:"outline",onClick:()=>n({to:"/$org/settings/connections",params:{org:o}}),children:"Back to connections"})})}),s[26]=n,s[27]=o,s[28]=D):D=s[28],D}let O;return s[29]!==d.update.isPending||s[30]!==S||s[31]!==u||s[32]!==p||s[33]!==o||s[34]!==y||s[35]!==M||s[36]!==l?(O=t.jsx(fs,{org:o,connection:u,connectionId:p,isUpdating:d.update.isPending,tools:S,prompts:y,resources:M,siblings:l}),s[29]=d.update.isPending,s[30]=S,s[31]=u,s[32]=p,s[33]=o,s[34]=y,s[35]=M,s[36]=l,s[37]=O):O=s[37],O}function gs(s){return{name:s.name,description:s.description,uri:s.uri}}function js(s){return{name:s.name,description:s.description}}function vs(s){return(s??[]).map(bs)}function bs(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema??{},outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Ns(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function ys(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function _s(){const s=$.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Oe,{children:t.jsx(G.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(ge,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(hs,{})})}),s[0]=e):e=s[0],e}function En(){const s=$.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(_s,{}),s[0]=e):e=s[0],e}export{En as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{v as R,aJ as A,aK as I,y as a,aL as j,_ as z,e as L,j as u,B as C}from"./index-
|
|
1
|
+
import{v as R,aJ as A,aK as I,y as a,aL as j,_ as z,e as L,j as u,B as C}from"./index-D0eg_rFC.js";import{I as H}from"./input-B0rO4kCw.js";import{s as K}from"./Plus-D7R85tnb.js";import{s as W}from"./Trash01-DiVIK0OP.js";const q=R({key:a().min(1,"Key is required"),value:a()}),M=R({title:a().min(1,"Name is required"),description:a().nullable().optional(),icon:a().nullable().optional(),ui_type:z(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:a().optional(),connection_token:a().nullable().optional(),npx_package:a().optional(),stdio_command:a().optional(),stdio_args:a().optional(),stdio_cwd:a().optional(),env_vars:j(q).optional(),configuration_scopes:j(a()).nullable().optional(),configuration_state:A(a(),I()).nullable().optional()}).refine(n=>n.ui_type==="NPX"?!!n.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(n=>n.ui_type==="STDIO"?!!n.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(n=>n.ui_type==="HTTP"||n.ui_type==="SSE"||n.ui_type==="Websocket"?!!n.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]});function $(n){const e=n.toLowerCase();return!!(["secret","password","passwd","credential","private","token","bearer","jwt","refresh","session","api_key","apikey","auth_key","access_key","secret_key","private_key","service_key","encryption_key","signing_key","license_key","auth","oauth","client_secret","app_secret","webhook","signing","signature","database_url","db_url","mongo_uri","redis_url","postgres_url","mysql_url","connection_string","dsn","service_role","anon_key","supabase_key","openai","anthropic","stripe","twilio","sendgrid","resend","firebase","sentry","datadog","newrelic","new_relic","pplx","replicate","pinecone","cohere","hugging","hf_token","gh_token","npm_token","certificate","cert","ssl","tls","encryption","salt","hash","hmac","personal_access","github_pat","gitlab_pat","bitbucket_pat"].some(s=>e.includes(s))||["sk_","rk_","whsec_","pk_live","sk_live"].some(s=>e.startsWith(s))||["_key","_secret","_token","_password","_auth","_pat"].some(s=>e.endsWith(s)))}function X(n){const e=L.c(34),{value:t,onChange:r,keyPlaceholder:o,valuePlaceholder:s,className:v}=n,m=o===void 0?"VARIABLE_NAME":o,_=s===void 0?"value...":s;let b;e[0]!==r||e[1]!==t?(b=()=>{r([...t,{key:"",value:""}])},e[0]=r,e[1]=t,e[2]=b):b=e[2];const S=b;let x;e[3]!==r||e[4]!==t?(x=l=>{r(t.filter((p,i)=>i!==l))},e[3]=r,e[4]=t,e[5]=x):x=e[5];const g=x;let P;e[6]!==r||e[7]!==t?(P=(l,p)=>{const i=[...t],c=i[l];c&&(i[l]={key:p,value:c.value},r(i))},e[6]=r,e[7]=t,e[8]=P):P=e[8];const y=P;let w;e[9]!==r||e[10]!==t?(w=(l,p)=>{const i=[...t],c=i[l];c&&(i[l]={key:c.key,value:p},r(i))},e[9]=r,e[10]=t,e[11]=w):w=e[11];const k=w;let d;if(e[12]!==y||e[13]!==g||e[14]!==k||e[15]!==m||e[16]!==t||e[17]!==_){let l;e[19]!==y||e[20]!==g||e[21]!==k||e[22]!==m||e[23]!==_?(l=(p,i)=>u.jsxs("div",{className:"flex gap-2 items-center",children:[u.jsx(H,{placeholder:m,value:p.key,onChange:c=>y(i,c.target.value),className:"h-10 rounded-lg flex-1 font-mono text-sm"}),u.jsx(H,{type:$(p.key)?"password":"text",placeholder:_,value:p.value,onChange:c=>k(i,c.target.value),className:"h-10 rounded-lg flex-1"}),u.jsx(C,{type:"button",variant:"ghost",size:"icon",className:"h-10 w-10 shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>g(i),children:u.jsx(W,{size:16})})]},i),e[19]=y,e[20]=g,e[21]=k,e[22]=m,e[23]=_,e[24]=l):l=e[24],d=t.map(l),e[12]=y,e[13]=g,e[14]=k,e[15]=m,e[16]=t,e[17]=_,e[18]=d}else d=e[18];let T;e[25]===Symbol.for("react.memo_cache_sentinel")?(T=u.jsx(K,{size:16,className:"mr-1"}),e[25]=T):T=e[25];let f;e[26]!==S?(f=u.jsxs(C,{type:"button",variant:"outline",size:"sm",className:"w-full h-9 text-muted-foreground",onClick:S,children:[T,"Add Environment Variable"]}),e[26]=S,e[27]=f):f=e[27];let h;e[28]!==d||e[29]!==f?(h=u.jsxs("div",{className:"flex flex-col gap-2",children:[d,f]}),e[28]=d,e[29]=f,e[30]=h):h=e[30];let E;return e[31]!==v||e[32]!==h?(E=u.jsx("div",{className:v,children:h}),e[31]=v,e[32]=h,e[33]=E):E=e[33],E}function V(n){const e={};for(const{key:t,value:r}of n)t.trim()&&(e[t.trim()]=r);return e}function D(n){return n?Object.entries(n).map(([e,t])=>({key:e,value:t})):[]}function N(n){const e=n.trim();if(!e)return"";try{const t=new URL(e),r=t.pathname.length>1?t.pathname.replace(/\/+$/,""):t.pathname;return`${t.origin}${r}`}catch{return e.replace(/\/+$/,"")}}function F(n){const e=n.trim().split(/\s+/).filter(Boolean);if(e.length<2)return null;const t=e[0]?.toLowerCase();if(t!=="npx"&&t!=="bunx")return null;const o=e.slice(1).find(s=>!s.startsWith("-"));return o?{packageName:o}:null}function Y(n){const{uiType:e}=n,t=N(n.connectionUrl??"");if((e==="HTTP"||e==="SSE"||e==="Websocket")&&t===N("https://api.githubcopilot.com/mcp/"))return{id:"github",title:"GitHub",description:"GitHub Copilot MCP",token:{label:"GitHub PAT",placeholder:"github_pat_…",helperText:"Paste a GitHub Personal Access Token (PAT)"}};const r=(n.npxPackage??"").trim();return e==="NPX"&&r==="@perplexity-ai/mcp-server"?{id:"perplexity",title:"Perplexity",description:"Perplexity MCP Server",envVarKeys:["PERPLEXITY_API_KEY"]}:null}function J(n){if(n.registryItems.length===0||n.uiType!=="HTTP"&&n.uiType!=="SSE"&&n.uiType!=="Websocket")return null;const e=N(n.connectionUrl??"");if(!e)return null;const t=n.registryItems.find(s=>(s.server?.remotes??[]).some(m=>N(m.url??"")===e));if(!t)return null;const r=t.title||t.name||t.server?.title||t.server?.name||"",o=t.server?.description||t.description||t.summary||null;return r?{id:"registry",title:r,description:o}:null}function Q(n,e){const t={command:"npx",args:["-y",n]},r=V(e);return Object.keys(r).length>0&&(t.envVars=r),t}function Z(n,e,t,r){const o={command:n};e.trim()&&(o.args=e.trim().split(/\s+/)),t?.trim()&&(o.cwd=t.trim());const s=V(r);return Object.keys(s).length>0&&(o.envVars=s),o}export{X as E,J as a,Q as b,M as c,Z as d,Y as i,F as p,D as r};
|