@xopcai/xopc 0.0.415 → 0.0.417
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/README.md +2 -2
- package/README.zh-CN.md +2 -2
- package/dist/browser-ext/_locales/en/messages.json +4 -1
- package/dist/browser-ext/_locales/zh_CN/messages.json +4 -1
- package/dist/browser-ext/dist/assets/{page-context-MuzjMBlJ.js → page-context-BKnEwsOO.js} +2914 -1381
- package/dist/browser-ext/dist/background.js +39 -10
- package/dist/browser-ext/dist/sidepanel.html +1 -1
- package/dist/browser-ext/dist/sidepanel.js +502 -348
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/activity-YogQEteU.js +1 -0
- package/dist/gateway/static/root/assets/activity-store-DnqOM8GN.js +1 -0
- package/dist/gateway/static/root/assets/agent-avatar-dicebear-1UABT2KS.js +1 -0
- package/dist/gateway/static/root/assets/agent-avatar-display-Cy50vjbq.js +2 -0
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-V4NX_cWz.js +1 -0
- package/dist/gateway/static/root/assets/agent-display-names-Bje7vfSn.js +1 -0
- package/dist/gateway/static/root/assets/agent-plugin-dialog-CQ5LLDMO.js +1 -0
- package/dist/gateway/static/root/assets/agents-O7mago-m.js +77 -0
- package/dist/gateway/static/root/assets/{agents-admin-api-B1p-ghg9.js → agents-admin-api-CyjykMEh.js} +2 -2
- package/dist/gateway/static/root/assets/agents-app-path-ciChvpCS.js +1 -0
- package/dist/gateway/static/root/assets/api-C1dxxDZx.js +1 -0
- package/dist/gateway/static/root/assets/api-Ddrs70xV.js +1 -0
- package/dist/gateway/static/root/assets/app-chrome-BeB4KgOf.js +1 -0
- package/dist/gateway/static/root/assets/app-link-CytZ5zkp.js +1 -0
- package/dist/gateway/static/root/assets/app-management-settings-panel-C1Zs-eha.js +1 -0
- package/dist/gateway/static/root/assets/appearance-settings-lIfGokbz.js +1 -0
- package/dist/gateway/static/root/assets/apps-page-CUvtsRYD.js +1 -0
- package/dist/gateway/static/root/assets/archive-Dz0hferG.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-Ch7wolHE.js → archive-plugin-n5lPr79c.js} +1 -1
- package/dist/gateway/static/root/assets/arrow-left-D880xG-P.js +1 -0
- package/dist/gateway/static/root/assets/arrow-right-DSSvoX71.js +1 -0
- package/dist/gateway/static/root/assets/arrow-up-D5ZtR1QT.js +1 -0
- package/dist/gateway/static/root/assets/arrow-up-right-T72JbQ1Q.js +1 -0
- package/dist/gateway/static/root/assets/{attachment-preview-renderer-wzIchDSv.js → attachment-preview-renderer-DdOEgexg.js} +3 -3
- package/dist/gateway/static/root/assets/{attachment-process-heavy-Db4nTY5N.js → attachment-process-heavy-DGZZ-M85.js} +2 -2
- package/dist/gateway/static/root/assets/automation-api-Bld8blNl.js +1 -0
- package/dist/gateway/static/root/assets/automation-display-BcfZOQTC.js +2 -0
- package/dist/gateway/static/root/assets/{automations-page-DK7AU79v.js → automations-page-oLsNzu_6.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-BgtYY2Mm.js +8 -0
- package/dist/gateway/static/root/assets/beta-badge-BnzdzIEl.js +1 -0
- package/dist/gateway/static/root/assets/{binary-plugins-B4HcHYsC.js → binary-plugins-D9VW7dWP.js} +2 -2
- package/dist/gateway/static/root/assets/{block-editor-BQAWEZF-.js → block-editor-C477bTtO.js} +23 -23
- package/dist/gateway/static/root/assets/book-open-CCGtrT3R.js +1 -0
- package/dist/gateway/static/root/assets/bot-DjLkhyZL.js +1 -0
- package/dist/gateway/static/root/assets/box-DvYoGszj.js +1 -0
- package/dist/gateway/static/root/assets/braces-Cfmtagno.js +1 -0
- package/dist/gateway/static/root/assets/brand-logo-CgT9zQfr.js +1 -0
- package/dist/gateway/static/root/assets/briefcase-business-BsoCaI_t.js +1 -0
- package/dist/gateway/static/root/assets/browser-BLJWD7WI.js +8 -0
- package/dist/gateway/static/root/assets/{browser-automation-inputs-D6AccXaA.js → browser-automation-inputs-CCiYXxmh.js} +1 -1
- package/dist/gateway/static/root/assets/browser-automations-page-DIUNY94X.js +3 -0
- package/dist/gateway/static/root/assets/browser-control-api-Y3fvmeBk.js +6 -0
- package/dist/gateway/static/root/assets/browser-notification-delivery-DmE2FgGc.js +1 -0
- package/dist/gateway/static/root/assets/browser-settings-page-DjkGahlz.js +3 -0
- package/dist/gateway/static/root/assets/{button-aIC072nz.js → button-CnRSIP6m.js} +1 -1
- package/dist/gateway/static/root/assets/calendar-clock-D-quYVPe.js +1 -0
- package/dist/gateway/static/root/assets/calendar-days-hw_Y-g-s.js +1 -0
- package/dist/gateway/static/root/assets/capabilities-DAyA681v.js +1 -0
- package/dist/gateway/static/root/assets/capabilities-DRVXLssH.js +1 -0
- package/dist/gateway/static/root/assets/capabilities-page-DFW4Y0x8.js +2 -0
- package/dist/gateway/static/root/assets/capabilities-settings-panel-uOHSMQPZ.js +8 -0
- package/dist/gateway/static/root/assets/capability-header-actions-CTUCuBlW.js +1 -0
- package/dist/gateway/static/root/assets/capability-icon-DVoZxEgW.js +1 -0
- package/dist/gateway/static/root/assets/capability-links-DzQWK1Fh.js +1 -0
- package/dist/gateway/static/root/assets/channels-D2a69dSt.js +1 -0
- package/dist/gateway/static/root/assets/channels-routes-r2g-9DdC.js +1 -0
- package/dist/gateway/static/root/assets/chat-agents-api-D5nR_JVe.js +1 -0
- package/dist/gateway/static/root/assets/chat-chart-block-K2t333qv.js +2 -0
- package/dist/gateway/static/root/assets/chat-page-CG38tCHE.js +71 -0
- package/dist/gateway/static/root/assets/chat-page-zQeUaawJ.css +1 -0
- package/dist/gateway/static/root/assets/chat-terminal-dock-CkFG6mA3.js +35 -0
- package/dist/gateway/static/root/assets/chevron-left-DqFhpbvK.js +1 -0
- package/dist/gateway/static/root/assets/chevron-right-BweFrslA.js +1 -0
- package/dist/gateway/static/root/assets/chunk-D32TOXHM-DQIy-Baq.js +156 -0
- package/dist/gateway/static/root/assets/chunk-KS7C4IRE-CiwuuyV8.js +4 -0
- package/dist/gateway/static/root/assets/circle-BoO4YvTx.js +1 -0
- package/dist/gateway/static/root/assets/circle-alert-BEjgurr2.js +1 -0
- package/dist/gateway/static/root/assets/circle-pause-CN9jYH2s.js +1 -0
- package/dist/gateway/static/root/assets/circle-x-DFsCKeya.js +1 -0
- package/dist/gateway/static/root/assets/clock-3-DnrAnuyZ.js +1 -0
- package/dist/gateway/static/root/assets/cloud-C4-yfnnk.js +1 -0
- package/dist/gateway/static/root/assets/cloud-credits-B-nbtkqv.js +1 -0
- package/dist/gateway/static/root/assets/code-xml-DJtYhZUF.js +1 -0
- package/dist/gateway/static/root/assets/coins-DjP27vUx.js +1 -0
- package/dist/gateway/static/root/assets/command-palette-api-Do_66X1B.js +1 -0
- package/dist/gateway/static/root/assets/composer-payload-handoff-BU3B-C26.js +1 -0
- package/dist/gateway/static/root/assets/computer-settings-page-DBxOcMko.js +1 -0
- package/dist/gateway/static/root/assets/confirm-dialog-XGclfBqe.js +1 -0
- package/dist/gateway/static/root/assets/connected-providers-grid-Dmnu2zle.js +1 -0
- package/dist/gateway/static/root/assets/connector-filters-Cfcx9EA2.js +1 -0
- package/dist/gateway/static/root/assets/connector-service-page-rWpnchb3.js +1 -0
- package/dist/gateway/static/root/assets/connectors-api-DIBG72k4.js +1 -0
- package/dist/gateway/static/root/assets/connectors-page-DT_WrC1y.js +1 -0
- package/dist/gateway/static/root/assets/constants-DBtMsXdW.js +1 -0
- package/dist/gateway/static/root/assets/copy-text-row-CYIv7RfP.js +1 -0
- package/dist/gateway/static/root/assets/cpu-B247669f.js +1 -0
- package/dist/gateway/static/root/assets/database-CjjeZfRG.js +1 -0
- package/dist/gateway/static/root/assets/date-picker-CE-cZFCU.js +1 -0
- package/dist/gateway/static/root/assets/dependency-picker-7SpSfDSg.js +1 -0
- package/dist/gateway/static/root/assets/desktop-pet-lorocS9j.js +1 -0
- package/dist/gateway/static/root/assets/desktop-pet-narrative-CS8qJpNO.js +1 -0
- package/dist/gateway/static/root/assets/desktop-pet-settings-CEcohlZq.js +1 -0
- package/dist/gateway/static/root/assets/{desktop-pet-sprite-Bd-aOI7N.js → desktop-pet-sprite-D5YYq2zC.js} +1 -1
- package/dist/gateway/static/root/assets/dev-view-store-57HgVuZ6.js +1 -0
- package/dist/gateway/static/root/assets/device-pairing-wizard-CLCPuf4R.js +1 -0
- package/dist/gateway/static/root/assets/directory-picker-path-field-D4jMhpka.js +1 -0
- package/dist/gateway/static/root/assets/discussion-annotation-sync-BKjf9gWe.js +1 -0
- package/dist/gateway/static/root/assets/dist-CaUuvp8-.js +1 -0
- package/dist/gateway/static/root/assets/dist-DNCdG_qB.js +1 -0
- package/dist/gateway/static/root/assets/dist-DfWfZ9iu.js +1 -0
- package/dist/gateway/static/root/assets/dist-DusecO_p.js +1 -0
- package/dist/gateway/static/root/assets/docx-preview-CnIClbYi.js +20 -0
- package/dist/gateway/static/root/assets/earth-BMhZtzcj.js +1 -0
- package/dist/gateway/static/root/assets/echarts-runtime-QSmTlXOu.js +18 -0
- package/dist/gateway/static/root/assets/electron-env-DHOGevH3.js +1 -0
- package/dist/gateway/static/root/assets/extension-debug-page-BsK2LMXQ.js +1 -0
- package/dist/gateway/static/root/assets/extension-iframe-host-Dhkk5JV2.js +1 -0
- package/dist/gateway/static/root/assets/extension-marketplace-api-CVJPqJOB.js +1 -0
- package/dist/gateway/static/root/assets/extension-page-Brps2XDP.js +1 -0
- package/dist/gateway/static/root/assets/extension-paths-DvuaZJuy.js +1 -0
- package/dist/gateway/static/root/assets/extension-provider-Byrd8Sor.js +1 -0
- package/dist/gateway/static/root/assets/extension-settings-page-CHY68DpG.js +1 -0
- package/dist/gateway/static/root/assets/file-BqMS_3DT.js +1 -0
- package/dist/gateway/static/root/assets/file-archive-DanfQJNe.js +1 -0
- package/dist/gateway/static/root/assets/file-preview-surface-BlprUrIs.js +1 -0
- package/dist/gateway/static/root/assets/file-text-D12HbeVy.js +1 -0
- package/dist/gateway/static/root/assets/file-tree-CFlZnV3Y.js +1 -0
- package/dist/gateway/static/root/assets/file-tree-utils-DJs1faGv.js +1 -0
- package/dist/gateway/static/root/assets/files-BNL4kkSB.js +1 -0
- package/dist/gateway/static/root/assets/floating-ui.dom-seOukHzT.js +1 -0
- package/dist/gateway/static/root/assets/folder-CN-pC3XL.js +1 -0
- package/dist/gateway/static/root/assets/folder-kanban-CpLlFI1o.js +1 -0
- package/dist/gateway/static/root/assets/form-field-width-DJw_jULe.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-config-swr-fQKBHBi1.js → gateway-config-swr-BAmUhiP1.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-realtime-CsykKL4l.js +1 -0
- package/dist/gateway/static/root/assets/gateway-realtime-store-DQqMBruB.js +1 -0
- package/dist/gateway/static/root/assets/gateway-restart-Ch128Lrr.js +1 -0
- package/dist/gateway/static/root/assets/gateway-settings-BA5-Uuwx.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-startup-retry-Cfwxof4k.js → gateway-startup-retry-CtUB3g6N.js} +1 -1
- package/dist/gateway/static/root/assets/gauge-C78eD2BA.js +1 -0
- package/dist/gateway/static/root/assets/git-branch-Dh9uxTot.js +1 -0
- package/dist/gateway/static/root/assets/global-defaults-api-CINf-C6a.js +2 -0
- package/dist/gateway/static/root/assets/heart-Cp4rgrqn.js +1 -0
- package/dist/gateway/static/root/assets/highlight-code-BH65IIbJ.js +1 -0
- package/dist/gateway/static/root/assets/highlighted-body-KQOG7T2V-DKGma5wI.js +1 -0
- package/dist/gateway/static/root/assets/history-DXH_9jsE.js +1 -0
- package/dist/gateway/static/root/assets/home-page-DaMFBYo1.js +2 -0
- package/dist/gateway/static/root/assets/image-Cwyalflz.js +1 -0
- package/dist/gateway/static/root/assets/image-generation-api-I_JgLL_m.js +1 -0
- package/dist/gateway/static/root/assets/imports-page-BWShtGRQ.js +1 -0
- package/dist/gateway/static/root/assets/index-BpCi0TdG.js +11 -0
- package/dist/gateway/static/root/assets/index-DY2Y83b9.css +1 -0
- package/dist/gateway/static/root/assets/index.module-Cd9ENXfk.js +1 -0
- package/dist/gateway/static/root/assets/info-CDrmIZhb.js +1 -0
- package/dist/gateway/static/root/assets/install-connector-dialog-DU1Tz7B3.js +1 -0
- package/dist/gateway/static/root/assets/interaction-BdhHBbYa.js +1 -0
- package/dist/gateway/static/root/assets/is-masked-secret-DOkL5b_X.js +1 -0
- package/dist/gateway/static/root/assets/{jszip.min-DT31yWkU.js → jszip.min-Dj17eJqX.js} +1 -1
- package/dist/gateway/static/root/assets/key-round-DWbpyU2U.js +1 -0
- package/dist/gateway/static/root/assets/keyboard-shortcuts-settings-CdM4BQwp.js +1 -0
- package/dist/gateway/static/root/assets/languages-zXtNocoy.js +2 -0
- package/dist/gateway/static/root/assets/laptop-CI3hBVrl.js +1 -0
- package/dist/gateway/static/root/assets/layers-mJW7JJKm.js +1 -0
- package/dist/gateway/static/root/assets/layout-grid-CEVZdVFU.js +1 -0
- package/dist/gateway/static/root/assets/list-checks-BbsExAoq.js +1 -0
- package/dist/gateway/static/root/assets/list-filter-COkzTdOz.js +1 -0
- package/dist/gateway/static/root/assets/list-todo-CTVRto8O.js +1 -0
- package/dist/gateway/static/root/assets/list-tree-B0OMswgM.js +1 -0
- package/dist/gateway/static/root/assets/local-app-workbench-page-qPflPuQD.js +1 -0
- package/dist/gateway/static/root/assets/local-apps-Ck6kACsY.js +1 -0
- package/dist/gateway/static/root/assets/local-apps-page-CxyRVfjD.js +1 -0
- package/dist/gateway/static/root/assets/local-session-drafts-B9ZPwotC.js +1 -0
- package/dist/gateway/static/root/assets/{locale-store-B7s2Hb35.js → locale-store-lIXD1FMw.js} +1 -1
- package/dist/gateway/static/root/assets/lock-keyhole-DEK5kH0u.js +1 -0
- package/dist/gateway/static/root/assets/logs-page-CbY1N-zi.js +2 -0
- package/dist/gateway/static/root/assets/loopi-C09I2mNj.css +1 -0
- package/dist/gateway/static/root/assets/loopi-CNtmi9FU.js +1 -0
- package/dist/gateway/static/root/assets/management-settings-Diy12JfQ.js +1 -0
- package/dist/gateway/static/root/assets/{markdown-editor-phTQ0mox.js → markdown-editor-BuuGlcfG.js} +1 -1
- package/dist/gateway/static/root/assets/markdown-view-C-DHb3Io.css +1 -0
- package/dist/gateway/static/root/assets/markdown-view-CJt-i2Dp.js +324 -0
- package/dist/gateway/static/root/assets/{media-plugins-DYQDjCVQ.js → media-plugins-D_bR23mA.js} +1 -1
- package/dist/gateway/static/root/assets/mermaid-MCJ5UELQ-Ur99GwOg.js +1 -0
- package/dist/gateway/static/root/assets/mermaid-render-oOellPHt.js +134 -0
- package/dist/gateway/static/root/assets/message-circle-Badhj-4D.js +1 -0
- package/dist/gateway/static/root/assets/message-square-fVE7Ghj1.js +1 -0
- package/dist/gateway/static/root/assets/message-square-plus-XP0tGdlV.js +1 -0
- package/dist/gateway/static/root/assets/{messages-BYq0cPbn.js → messages-DRR9N3HC.js} +1 -1
- package/dist/gateway/static/root/assets/messages-square-BckAJrEW.js +1 -0
- package/dist/gateway/static/root/assets/mic-CuUb7zc-.js +1 -0
- package/dist/gateway/static/root/assets/minimize-2-DtOGrlpo.js +1 -0
- package/dist/gateway/static/root/assets/mobile-pair-qr-CuIbmw5x.js +1 -0
- package/dist/gateway/static/root/assets/model-selector-DCYA_ntf.js +1 -0
- package/dist/gateway/static/root/assets/models-hub-cache-za2fWJLg.js +1 -0
- package/dist/gateway/static/root/assets/monitor-Af5eAvF7.js +1 -0
- package/dist/gateway/static/root/assets/mouse-pointer-2-DZ51Onvj.js +1 -0
- package/dist/gateway/static/root/assets/navigation-BkjnOw30.js +1 -0
- package/dist/gateway/static/root/assets/network-BUQLY1BV.js +1 -0
- package/dist/gateway/static/root/assets/new-session-preferences-gb411vZP.js +1 -0
- package/dist/gateway/static/root/assets/note-detail-panel-DBs1yHLy.js +5 -0
- package/dist/gateway/static/root/assets/note-image-lightbox-CivkB6LB.js +1 -0
- package/dist/gateway/static/root/assets/notes-api-C_458rv5.js +1 -0
- package/dist/gateway/static/root/assets/notes-page-DL3c-41a.js +8 -0
- package/dist/gateway/static/root/assets/number-input-El7Szeln.js +1 -0
- package/dist/gateway/static/root/assets/oauth-api-C3X9FLYw.js +1 -0
- package/dist/gateway/static/root/assets/oauth-authorization-window-o6URRos4.js +1 -0
- package/dist/gateway/static/root/assets/oauth-provider-connect-H81se_3n.js +1 -0
- package/dist/gateway/static/root/assets/package-wATCyihJ.js +1 -0
- package/dist/gateway/static/root/assets/page-context-capture-button-BkAlQ7cB.js +1 -0
- package/dist/gateway/static/root/assets/page-context-draft-ClLgaOaD.js +1 -0
- package/dist/gateway/static/root/assets/page-header-store-DH8K0xii.js +1 -0
- package/dist/gateway/static/root/assets/page-tabs-oeTY7z3_.js +1 -0
- package/dist/gateway/static/root/assets/panel-left-C8MqSXRZ.js +1 -0
- package/dist/gateway/static/root/assets/panel-right-CFGrHTsD.js +1 -0
- package/dist/gateway/static/root/assets/paperclip-f1HujQY1.js +1 -0
- package/dist/gateway/static/root/assets/pause-DuPxgSxk.js +1 -0
- package/dist/gateway/static/root/assets/{pdf-D4PI9qAw.js → pdf-EQHMWEbX.js} +3 -3
- package/dist/gateway/static/root/assets/pdf-runtime-JnUAvfIa.js +2 -0
- package/dist/gateway/static/root/assets/{pdf.worker.min-B4E34YdZ.js → pdf.worker.min-bpyjgR8v.js} +7 -7
- package/dist/gateway/static/root/assets/pencil-DmIY3Oa-.js +1 -0
- package/dist/gateway/static/root/assets/personal-avatar-BLtHt8fV.js +1 -0
- package/dist/gateway/static/root/assets/personal-avatar-BUCb7OiW.css +1 -0
- package/dist/gateway/static/root/assets/personal-page-B5DP3lO-.js +1 -0
- package/dist/gateway/static/root/assets/personal-proactivity-DaRnbB1f.js +1 -0
- package/dist/gateway/static/root/assets/personal-settings-panel-DjDc5Kaz.js +1 -0
- package/dist/gateway/static/root/assets/phone-dependencies-card-DISHarj8.js +1 -0
- package/dist/gateway/static/root/assets/phone-model-picker-u8YIQCgo.js +1 -0
- package/dist/gateway/static/root/assets/phone-settings-page-el3pT0PD.js +1 -0
- package/dist/gateway/static/root/assets/phone-workspace-store-fhnZrgy_.js +1 -0
- package/dist/gateway/static/root/assets/pin-off-BMRv-Kxr.js +1 -0
- package/dist/gateway/static/root/assets/play-kxZvpBg8.js +1 -0
- package/dist/gateway/static/root/assets/plug-DKYPEgkR.js +1 -0
- package/dist/gateway/static/root/assets/plug-zap-L8NMe3Sv.js +1 -0
- package/dist/gateway/static/root/assets/plugin-details-dialog-CTBs1Jde.js +1 -0
- package/dist/gateway/static/root/assets/plus-Q2yW6OE7.js +1 -0
- package/dist/gateway/static/root/assets/popover-select-DniHw2dy.js +1 -0
- package/dist/gateway/static/root/assets/power-ZI-pBczI.js +1 -0
- package/dist/gateway/static/root/assets/power-off-CwwQ7Gp7.js +1 -0
- package/dist/gateway/static/root/assets/preference-select-fields-D7oluyHN.js +1 -0
- package/dist/gateway/static/root/assets/preload-helper-Czpn1I53.js +1 -0
- package/dist/gateway/static/root/assets/preview-open-alternatives-CY_hjK4b.js +1 -0
- package/dist/gateway/static/root/assets/product-automation-feedback-DsUSqCOX.js +7 -0
- package/dist/gateway/static/root/assets/product-delivery-BU_H84jL.js +1 -0
- package/dist/gateway/static/root/assets/product-navigation-Co8pLbDP.js +1 -0
- package/dist/gateway/static/root/assets/product-open-page-xn9G4hSI.js +1 -0
- package/dist/gateway/static/root/assets/product-preview-content-DcoK-iZe.js +1 -0
- package/dist/gateway/static/root/assets/product-preview-modal-Ruw9WSKK.js +2 -0
- package/dist/gateway/static/root/assets/project-detail-page-BKvWLiMw.js +7 -0
- package/dist/gateway/static/root/assets/project-understanding-BCQr0AZ_.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-D4g7bB7X.js +1 -0
- package/dist/gateway/static/root/assets/providers-api-CzVkFKFg.js +1 -0
- package/dist/gateway/static/root/assets/puzzle-BptcPjKI.js +1 -0
- package/dist/gateway/static/root/assets/recording-upload-0jxahBMo.js +1 -0
- package/dist/gateway/static/root/assets/refresh-button-bU_0NarN.js +1 -0
- package/dist/gateway/static/root/assets/refresh-cw-BRlGaq2w.js +1 -0
- package/dist/gateway/static/root/assets/{registry-api-BcfoLEna.js → registry-api-n8TwtJ_j.js} +2 -2
- package/dist/gateway/static/root/assets/remote-access-hub-cZpBi4Rk.js +1 -0
- package/dist/gateway/static/root/assets/rotate-ccw-JM1TBLpp.js +1 -0
- package/dist/gateway/static/root/assets/rotate-cw-LIg3Am9S.js +1 -0
- package/dist/gateway/static/root/assets/route-preload-B5UiReO7.js +2 -0
- package/dist/gateway/static/root/assets/runtime-health-D2TDFLLq.js +1 -0
- package/dist/gateway/static/root/assets/{runtime-tools-api-DesqGCnE.js → runtime-tools-api-D-8KjYK6.js} +1 -1
- package/dist/gateway/static/root/assets/runtime-tools-settings-panel-MKlLFuow.js +1 -0
- package/dist/gateway/static/root/assets/save-DRDABU--.js +1 -0
- package/dist/gateway/static/root/assets/schema-form-v4N4lawq.js +1 -0
- package/dist/gateway/static/root/assets/schemas-CCWMleym.js +55 -0
- package/dist/gateway/static/root/assets/search-DA7gz22f.js +1 -0
- package/dist/gateway/static/root/assets/secret-input-BQvFXqzz.js +1 -0
- package/dist/gateway/static/root/assets/secret-input-labels-B5Jl5HqK.js +1 -0
- package/dist/gateway/static/root/assets/segmented-styles-Cqb91xsn.js +1 -0
- package/dist/gateway/static/root/assets/send-1f1Ntw6E.js +1 -0
- package/dist/gateway/static/root/assets/server-BlHCBjiE.js +1 -0
- package/dist/gateway/static/root/assets/service-recommendation-list-B1xuVT3N.js +1 -0
- package/dist/gateway/static/root/assets/{session-api-DdQnMwkl.js → session-api-CsCoI2im.js} +1 -1
- package/dist/gateway/static/root/assets/session-channel-icon-SsY70Z6t.js +1 -0
- package/dist/gateway/static/root/assets/session-identity-label-B7sgG1PE.js +1 -0
- package/dist/gateway/static/root/assets/session-manager-5l9q0cd5.js +16 -0
- package/dist/gateway/static/root/assets/sessions-page-DsLw2aMD.js +1 -0
- package/dist/gateway/static/root/assets/settings-2-D-csvaET.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-B5lQeVNi.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-section-BqoVSko2.js +1 -0
- package/dist/gateway/static/root/assets/settings-form-draft-Dy10ldo8.js +1 -0
- package/dist/gateway/static/root/assets/settings-form-section-num14vSv.js +1 -0
- package/dist/gateway/static/root/assets/settings-loading-skeleton-BTqvr_Fw.js +1 -0
- package/dist/gateway/static/root/assets/settings-mode-store-CBsJ-Qg2.js +1 -0
- package/dist/gateway/static/root/assets/settings-page-DROUGyJl.js +1 -0
- package/dist/gateway/static/root/assets/settings-page-header-Bv-kQFTm.js +1 -0
- package/dist/gateway/static/root/assets/settings-page-layout-DHP6MrrL.js +1 -0
- package/dist/gateway/static/root/assets/settings-uiTATseT.js +1 -0
- package/dist/gateway/static/root/assets/setup-status-panel-MJE3B_LX.js +1 -0
- package/dist/gateway/static/root/assets/share-link-dialog-BJHRQVKC.js +1 -0
- package/dist/gateway/static/root/assets/share-preview-page-Bsrv_zOQ.js +2 -0
- package/dist/gateway/static/root/assets/shares-api-rtWVHA_d.js +1 -0
- package/dist/gateway/static/root/assets/shares-settings-CfIRv4uX.js +1 -0
- package/dist/gateway/static/root/assets/shield-B1sI_cxl.js +1 -0
- package/dist/gateway/static/root/assets/shield-check-BU58siTV.js +1 -0
- package/dist/gateway/static/root/assets/shield-off-2jsucUds.js +1 -0
- package/dist/gateway/static/root/assets/side-chat-shortcut-BIw-1TTD.js +1 -0
- package/dist/gateway/static/root/assets/skill-api-B_W1K3sv.js +1 -0
- package/dist/gateway/static/root/assets/skill-api-utils-C7V4JVXM.js +1 -0
- package/dist/gateway/static/root/assets/skill-list-api-BzlKXPsE.js +1 -0
- package/dist/gateway/static/root/assets/skill-reload-api-Cff2GgZb.js +1 -0
- package/dist/gateway/static/root/assets/skill-wire-pattern-BPpeIcCi.js +1 -0
- package/dist/gateway/static/root/assets/skills-page-DtBloYeU.js +2 -0
- package/dist/gateway/static/root/assets/sliders-horizontal-DqsYor6I.js +1 -0
- package/dist/gateway/static/root/assets/sliding-tab-list-DuQyViqe.js +1 -0
- package/dist/gateway/static/root/assets/smartphone-DSSsQFqA.js +1 -0
- package/dist/gateway/static/root/assets/{source-workspace-editor-BIvi89Zx.js → source-workspace-editor-kxosllTu.js} +1 -1
- package/dist/gateway/static/root/assets/sparkles-DHlfQFAF.js +1 -0
- package/dist/gateway/static/root/assets/specialists-xbB3xL9e.js +1 -0
- package/dist/gateway/static/root/assets/square-DMK_fB-3.js +1 -0
- package/dist/gateway/static/root/assets/square-pen-B8FsvqNu.js +1 -0
- package/dist/gateway/static/root/assets/square-terminal-K87bylpZ.js +1 -0
- package/dist/gateway/static/root/assets/star-BUWJqJ5c.js +1 -0
- package/dist/gateway/static/root/assets/stethoscope-DRqTAtjD.js +1 -0
- package/dist/gateway/static/root/assets/sticky-note-fzP7NAJq.js +1 -0
- package/dist/gateway/static/root/assets/store-SzD1Jvgm.js +1 -0
- package/dist/gateway/static/root/assets/system-settings-panel-BeQeUUMH.js +1 -0
- package/dist/gateway/static/root/assets/task-detail-page-Drrv-Hp0.js +2 -0
- package/dist/gateway/static/root/assets/task-result-evidence-D1Kyskm_.js +1 -0
- package/dist/gateway/static/root/assets/tasks-DRmd6sWt.js +1 -0
- package/dist/gateway/static/root/assets/terminal-oKqqZdiG.js +1 -0
- package/dist/gateway/static/root/assets/terminal-panel-store-5Fzctajw.js +1 -0
- package/dist/gateway/static/root/assets/theme-store-DW45fWYQ.js +1 -0
- package/dist/gateway/static/root/assets/timer-rCwGHjuO.js +1 -0
- package/dist/gateway/static/root/assets/tool-friendly-title-DGmi7rCQ.js +1 -0
- package/dist/gateway/static/root/assets/tracing-settings-page-B12u5D9A.js +1 -0
- package/dist/gateway/static/root/assets/trash-2-DusmjVPV.js +1 -0
- package/dist/gateway/static/root/assets/triangle-alert-2JXFNNKU.js +1 -0
- package/dist/gateway/static/root/assets/tunnel-api-DGO56LQU.js +1 -0
- package/dist/gateway/static/root/assets/understanding-activity-store-CTe6TFB0.js +1 -0
- package/dist/gateway/static/root/assets/understanding-refresh-store-mE9OKG6q.js +1 -0
- package/dist/gateway/static/root/assets/unlink-BEuthaaq.js +1 -0
- package/dist/gateway/static/root/assets/upload-rrb46c3c.js +1 -0
- package/dist/gateway/static/root/assets/usage-page-Ud2U9UG1.js +1 -0
- package/dist/gateway/static/root/assets/use-async-resource-BHFGZCY2.js +1 -0
- package/dist/gateway/static/root/assets/use-autosave-Cs2Ga_Y_.js +1 -0
- package/dist/gateway/static/root/assets/use-composer-attachments-BCbMj-MN.js +2 -0
- package/dist/gateway/static/root/assets/use-directory-picker-C4p7AgWY.js +1 -0
- package/dist/gateway/static/root/assets/use-file-preview-expanded-DSpCRXUW.js +2 -0
- package/dist/gateway/static/root/assets/use-media-query-ady-FgjK.js +1 -0
- package/dist/gateway/static/root/assets/use-personal-profile-BHL2AxWU.js +1 -0
- package/dist/gateway/static/root/assets/use-workspace-tree-CnmPZrpx.js +1 -0
- package/dist/gateway/static/root/assets/user-model-page-p5iPfnwl.js +2 -0
- package/dist/gateway/static/root/assets/user-round-C9jxPhMR.js +1 -0
- package/dist/gateway/static/root/assets/{vendor-codemirror-Qdcjid65.js → vendor-codemirror-aCQ0FcJT.js} +8 -8
- package/dist/gateway/static/root/assets/{vendor-swr-BIWyz7Rc.js → vendor-swr-CdRzEUwF.js} +1 -1
- package/dist/gateway/static/root/assets/video-B6V0GFss.js +1 -0
- package/dist/gateway/static/root/assets/voice-api-key-field-3gyc2UV3.js +1 -0
- package/dist/gateway/static/root/assets/voice-call-context-BM2A4bLz.js +1 -0
- package/dist/gateway/static/root/assets/{voice-config-api-BkUlN7GH.js → voice-config-api-Cda2uBIC.js} +1 -1
- package/dist/gateway/static/root/assets/voice-input-shortcut-events-DtYHsPLF.js +1 -0
- package/dist/gateway/static/root/assets/voice-transcribe-api-TInEfIYo.js +1 -0
- package/dist/gateway/static/root/assets/volume-2-BSJhAY97.js +1 -0
- package/dist/gateway/static/root/assets/wand-sparkles-CkSL-3Fy.js +1 -0
- package/dist/gateway/static/root/assets/{with-selector-aYPsXwdl.js → with-selector-xonYxPoM.js} +1 -1
- package/dist/gateway/static/root/assets/work-discovery-overlay-Dqu5CQCS.js +1 -0
- package/dist/gateway/static/root/assets/work-discovery-page-p-8ciZ0i.js +1 -0
- package/dist/gateway/static/root/assets/working-directory-picker-modal-DHl2cZY1.js +1 -0
- package/dist/gateway/static/root/assets/workspace-api-CtDbI6T7.js +2 -0
- package/dist/gateway/static/root/assets/workspace-editor-agent-store-B94Q2nN8.js +1 -0
- package/dist/gateway/static/root/assets/workspace-file-preview-dialog-CTIbUfKb.js +1 -0
- package/dist/gateway/static/root/assets/workspace-open-location-menu-BwxouqdZ.js +1 -0
- package/dist/gateway/static/root/assets/wrench-DFb4r8bH.js +1 -0
- package/dist/gateway/static/root/assets/x-B_N4OPjy.js +1 -0
- package/dist/gateway/static/root/assets/{xlsx-CKkngM-o.js → xlsx-Cl_0CZaL.js} +11 -11
- package/dist/gateway/static/root/assets/xml-_d7dTN2Q.js +3 -0
- package/dist/gateway/static/root/assets/xopc-cloud-account-card-CFb-23rS.js +1 -0
- package/dist/gateway/static/root/assets/zap-dximCGjy.js +1 -0
- package/dist/gateway/static/root/browser-setup-test.html +5 -0
- package/dist/gateway/static/root/browser-setup-test.js +7 -0
- package/dist/gateway/static/root/index.html +267 -46
- package/dist/package.js +1 -1
- package/dist/packages/gateway-contract/src/browser-setup.js +6 -0
- package/dist/packages/gateway-contract/src/index.js +4 -0
- package/dist/packages/gateway-contract/src/phone-setup.js +6 -0
- package/dist/packages/realtime-client/src/index.js +1 -0
- package/dist/packages/realtime-protocol/src/index.js +1 -0
- package/dist/src/activity/emitter.js +1 -2
- package/dist/src/activity/service.js +1 -2
- package/dist/src/agent/agent-manager.d.ts +5 -0
- package/dist/src/agent/agent-manager.js +16 -6
- package/dist/src/agent/background-review/run-background-review.js +2 -3
- package/dist/src/agent/context/execution-context.js +1 -2
- package/dist/src/agent/context/execution-scope.js +1 -2
- package/dist/src/agent/context/project-context.js +1 -2
- package/dist/src/agent/embedded/agent-profile-context.js +1 -2
- package/dist/src/agent/embedded/run-turn.js +2 -4
- package/dist/src/agent/embedded/sqlite-hydrating-session-manager.js +1 -2
- package/dist/src/agent/embedded/tool-search-extension.js +14 -1
- package/dist/src/agent/external-tools/cliProvider.js +3 -4
- package/dist/src/agent/external-tools/composio-provider.js +3 -4
- package/dist/src/agent/external-tools/endpoint-provider.js +2 -2
- package/dist/src/agent/memory/compaction-promotion.js +1 -2
- package/dist/src/agent/orchestration/research-checkpoint.js +26 -31
- package/dist/src/agent/prompt/response-language.js +1 -2
- package/dist/src/agent/prompt/service-prompt-builder.js +3 -6
- package/dist/src/agent/prompt/system-prompt.js +1 -2
- package/dist/src/agent/service/direct-turn-helpers.js +1 -2
- package/dist/src/agent/service/process-direct-streaming.js +1 -2
- package/dist/src/agent/service/webchat-tts.js +1 -2
- package/dist/src/agent/service.d.ts +1 -0
- package/dist/src/agent/service.js +8 -3
- package/dist/src/agent/service.types.d.ts +3 -0
- package/dist/src/agent/skills/index.js +1 -1
- package/dist/src/agent/skills/managed-store.js +1 -1
- package/dist/src/agent/skills/skill-manage-ops.js +1 -1
- package/dist/src/agent/tool-manuals/computer.d.ts +1 -1
- package/dist/src/agent/tool-manuals/computer.js +2 -0
- package/dist/src/agent/tool-manuals/phone.d.ts +1 -1
- package/dist/src/agent/tool-manuals/phone.js +14 -4
- package/dist/src/agent/tool-manuals/xopc-configuration.d.ts +2 -0
- package/dist/src/agent/tool-manuals/xopc-configuration.js +29 -0
- package/dist/src/agent/tools/browser/tool/browser-use-tool.d.ts +2 -0
- package/dist/src/agent/tools/browser/tool/browser-use-tool.js +6 -2
- package/dist/src/agent/tools/delegate-tool.js +2 -4
- package/dist/src/agent/tools/factory.d.ts +4 -0
- package/dist/src/agent/tools/factory.js +23 -9
- package/dist/src/agent/tools/personal-read-tool.js +1 -1
- package/dist/src/agent/tools/personal-task-tool.js +1 -2
- package/dist/src/agent/tools/phone-use-tool.d.ts +2 -0
- package/dist/src/agent/tools/phone-use-tool.js +79 -4
- package/dist/src/agent/tools/research-checkpoint-tool.js +1 -2
- package/dist/src/agent/tools/tool-manual-tool.d.ts +1 -1
- package/dist/src/agent/tools/tool-manual-tool.js +3 -1
- package/dist/src/agent/tools/toolExposure.js +3 -0
- package/dist/src/agent/tools/xopc-use-tool.d.ts +5 -2
- package/dist/src/agent/tools/xopc-use-tool.js +47 -6
- package/dist/src/agent-catalog/capabilities.js +2 -2
- package/dist/src/agent-catalog/repository.js +3 -4
- package/dist/src/agent-catalog/test-support.js +1 -2
- package/dist/src/agent-matching/selection-repository.js +1 -2
- package/dist/src/automations/capabilities/drafts.js +3 -5
- package/dist/src/bootstrap/application-state.js +1 -2
- package/dist/src/browser/automations/repository.js +1 -2
- package/dist/src/browser/drivers/browser-driver.d.ts +2 -2
- package/dist/src/browser/drivers/extension-driver.d.ts +2 -2
- package/dist/src/browser/drivers/extension-driver.js +6 -3
- package/dist/src/browser/native-messaging-host.js +2 -4
- package/dist/src/browser/providers/browser-ext-install.js +3 -2
- package/dist/src/browser/providers/realtime-extension.js +1 -2
- package/dist/src/browser/recordings/service.js +1 -2
- package/dist/src/browser/runtime/browser-runtime.d.ts +4 -1
- package/dist/src/browser/runtime/browser-runtime.js +29 -17
- package/dist/src/browser/setup/repository.d.ts +5 -0
- package/dist/src/browser/setup/repository.js +42 -0
- package/dist/src/browser/setup/service.d.ts +157 -0
- package/dist/src/browser/setup/service.js +433 -0
- package/dist/src/browser/setup/types.d.ts +38 -0
- package/dist/src/browser/setup/types.js +1 -0
- package/dist/src/capabilities/runtime/dispatcher.js +1 -1
- package/dist/src/capabilities/runtime/product.js +1 -1
- package/dist/src/chat-previews/store.js +1 -2
- package/dist/src/cli/commands/agents.js +1 -1
- package/dist/src/cli/commands/doctor/checks/automation-integrity.js +1 -2
- package/dist/src/cli/commands/doctor/checks/database-relations.js +1 -2
- package/dist/src/cli/commands/doctor/checks/database-schema.js +2 -3
- package/dist/src/cli/commands/doctor/checks/node-version.js +6 -6
- package/dist/src/cli/commands/doctor/checks/session-integrity.js +1 -2
- package/dist/src/cli/commands/gateway/lifecycle.js +1 -1
- package/dist/src/cli/commands/gateway/shared.js +1 -2
- package/dist/src/cli/commands/history.js +1 -2
- package/dist/src/cli/commands/models.js +1 -1
- package/dist/src/cli/commands/onboard/model.js +1 -1
- package/dist/src/cli/commands/project.js +1 -2
- package/dist/src/cli/utils/init-workspace-core.js +1 -1
- package/dist/src/computer/diagnostics.d.ts +7 -7
- package/dist/src/computer/diagnostics.js +8 -2
- package/dist/src/computer/errors.js +9 -1
- package/dist/src/computer/evaluation.d.ts +4 -4
- package/dist/src/computer/keyboard.d.ts +1 -1
- package/dist/src/computer/keyboard.js +10 -2
- package/dist/src/computer/model-adapter.js +27 -7
- package/dist/src/config/agent-profile.js +1 -1
- package/dist/src/config/gateway-bind.js +1 -2
- package/dist/src/config/schema.d.ts +7 -0
- package/dist/src/connectors/cli/lifecycle.js +1 -2
- package/dist/src/connectors/composio-managed-events.js +1 -2
- package/dist/src/connectors/connected-source-ingestion.js +1 -2
- package/dist/src/connectors/connected-source-understanding.js +3 -5
- package/dist/src/connectors/content-enrichment.js +1 -2
- package/dist/src/connectors/learning-coordinator.js +2 -3
- package/dist/src/connectors/runtime-adapter-registry.js +1 -2
- package/dist/src/daemon/constants.js +9 -14
- package/dist/src/daemon/index.js +1 -4
- package/dist/src/daemon/install-plan.js +1 -2
- package/dist/src/daemon/launchd.js +1 -2
- package/dist/src/daemon/schtasks.js +1 -2
- package/dist/src/daemon/service-audit.js +1 -2
- package/dist/src/daemon/service.js +1 -2
- package/dist/src/daemon/systemd.js +1 -2
- package/dist/src/discussions/analyzer.d.ts +3 -3
- package/dist/src/endpoint-tools/runtime.js +1 -2
- package/dist/src/execution-environments/local-worktree-manager.js +1 -1
- package/dist/src/execution-environments/subject.js +1 -2
- package/dist/src/extensions/agent-plugins/branding.js +2 -1
- package/dist/src/extensions/agent-plugins/cli-authorization.js +2 -1
- package/dist/src/extensions/agent-plugins/contained-path.d.ts +1 -0
- package/dist/src/extensions/agent-plugins/contained-path.js +29 -0
- package/dist/src/extensions/agent-plugins/mcp-adapter.js +2 -1
- package/dist/src/extensions/agent-plugins/resources.js +1 -1
- package/dist/src/extensions/agent-plugins/skill-catalog.js +3 -2
- package/dist/src/extensions/agent-plugins/source-catalog.js +1 -1
- package/dist/src/extensions/agent-plugins/store.js +2 -1
- package/dist/src/extensions/agent-plugins/validation.d.ts +1 -2
- package/dist/src/extensions/agent-plugins/validation.js +3 -26
- package/dist/src/gateway/agent-builtin-tools.d.ts +1 -1
- package/dist/src/gateway/agents-admin.js +2 -2
- package/dist/src/gateway/client-ip.js +1 -2
- package/dist/src/gateway/file-space-service.js +1 -2
- package/dist/src/gateway/global-defaults-admin.js +1 -1
- package/dist/src/gateway/hono/app.js +2 -4
- package/dist/src/gateway/hono/middleware/auth.js +3 -6
- package/dist/src/gateway/hono/middleware/logger.js +1 -2
- package/dist/src/gateway/hono/middleware/public-device-rate-limit.js +1 -2
- package/dist/src/gateway/hono/middleware/scopes.js +1 -2
- package/dist/src/gateway/hono/middleware/strict-rate-limit.js +1 -2
- package/dist/src/gateway/hono/oauth-async.js +1 -2
- package/dist/src/gateway/hono/routes/agents.js +1 -1
- package/dist/src/gateway/hono/routes/browser-session.js +1 -2
- package/dist/src/gateway/hono/routes/browser-setup.d.ts +3 -0
- package/dist/src/gateway/hono/routes/browser-setup.js +114 -0
- package/dist/src/gateway/hono/routes/browser.d.ts +2 -1
- package/dist/src/gateway/hono/routes/browser.js +4 -7
- package/dist/src/gateway/hono/routes/cli-connectors.js +1 -2
- package/dist/src/gateway/hono/routes/composer-history.js +1 -2
- package/dist/src/gateway/hono/routes/config-patch/misc.js +1 -1
- package/dist/src/gateway/hono/routes/config.js +1 -2
- package/dist/src/gateway/hono/routes/connectors.js +9 -11
- package/dist/src/gateway/hono/routes/context-sources.js +1 -2
- package/dist/src/gateway/hono/routes/device-pairing-approval.js +2 -4
- package/dist/src/gateway/hono/routes/device-push.js +1 -2
- package/dist/src/gateway/hono/routes/devices.js +4 -8
- package/dist/src/gateway/hono/routes/discussions.js +1 -2
- package/dist/src/gateway/hono/routes/endpoint-tools.js +1 -2
- package/dist/src/gateway/hono/routes/home.js +2 -3
- package/dist/src/gateway/hono/routes/interaction-state.js +1 -2
- package/dist/src/gateway/hono/routes/lazy-bundles.js +8 -0
- package/dist/src/gateway/hono/routes/memory-learning.js +1 -2
- package/dist/src/gateway/hono/routes/notes.js +2 -2
- package/dist/src/gateway/hono/routes/personal-agent.js +1 -2
- package/dist/src/gateway/hono/routes/phone-dependencies.js +2 -7
- package/dist/src/gateway/hono/routes/phone-setup.d.ts +7 -0
- package/dist/src/gateway/hono/routes/phone-setup.js +231 -0
- package/dist/src/gateway/hono/routes/phone-wireless.d.ts +4 -0
- package/dist/src/gateway/hono/routes/phone-wireless.js +63 -0
- package/dist/src/gateway/hono/routes/phone.js +119 -28
- package/dist/src/gateway/hono/routes/projects.js +3 -4
- package/dist/src/gateway/hono/routes/public-gateway.js +4 -3
- package/dist/src/gateway/hono/routes/session-input-handler.js +1 -1
- package/dist/src/gateway/hono/routes/sessions.js +2 -4
- package/dist/src/gateway/hono/routes/shares.js +2 -4
- package/dist/src/gateway/hono/routes/tasks.js +2 -3
- package/dist/src/gateway/hono/routes/user-model-refresh.js +1 -2
- package/dist/src/gateway/hono/routes/user-model.js +1 -2
- package/dist/src/gateway/host.js +4 -9
- package/dist/src/gateway/image-generation-setup.js +1 -1
- package/dist/src/gateway/index.js +2 -6
- package/dist/src/gateway/listen.js +1 -2
- package/dist/src/gateway/next-turn-suggestions/service.js +1 -2
- package/dist/src/gateway/next-turn-suggestions/snapshot.js +1 -2
- package/dist/src/gateway/provider-model-setup.js +1 -1
- package/dist/src/gateway/rate-limit/auth-policy.js +11 -7
- package/dist/src/gateway/rate-limit/buckets.js +220 -211
- package/dist/src/gateway/rate-limit/env-flags.js +1 -4
- package/dist/src/gateway/rate-limit/index.js +4 -13
- package/dist/src/gateway/runtime-config.js +2 -4
- package/dist/src/gateway/security/audit.js +1 -2
- package/dist/src/gateway/security/browser-session.js +1 -2
- package/dist/src/gateway/security/device-request-proof.d.ts +1 -2
- package/dist/src/gateway/security/device-request-proof.js +2 -4
- package/dist/src/gateway/security/gateway-scopes.js +2 -6
- package/dist/src/gateway/security/index.js +1 -4
- package/dist/src/gateway/security/loopback.js +6 -7
- package/dist/src/gateway/service/agent-runner.js +2 -4
- package/dist/src/gateway/service/app-context-access.js +1 -2
- package/dist/src/gateway/service/config-coordinator.d.ts +4 -0
- package/dist/src/gateway/service/run-gateway-agent.js +2 -4
- package/dist/src/gateway/service/session-input-coordinator.js +3 -6
- package/dist/src/gateway/service.d.ts +5 -0
- package/dist/src/gateway/service.js +64 -22
- package/dist/src/gateway/session-context-summary.js +2 -4
- package/dist/src/gateway/tailscale-auth.js +1 -2
- package/dist/src/gateway/ws-security.js +1 -2
- package/dist/src/gateway/xopc-cloud-capability-setup.js +8 -2
- package/dist/src/home-intelligence/host.js +2 -2
- package/dist/src/imports/importService.js +1 -1
- package/dist/src/infra/rate-limit/failure-limiter.js +90 -78
- package/dist/src/infra/rate-limit/index.js +3 -11
- package/dist/src/infra/rate-limit/keyed-store.js +47 -52
- package/dist/src/infra/rate-limit/rate-limiter.js +58 -55
- package/dist/src/infra/update-restart.js +1 -1
- package/dist/src/infra/update-service-refresh.js +1 -2
- package/dist/src/knowledge/chunks.js +1 -4
- package/dist/src/knowledge/connected-knowledge-pipeline.js +3 -6
- package/dist/src/knowledge/ingestion-service.js +1 -2
- package/dist/src/knowledge-memory/repository.js +1 -2
- package/dist/src/local-apps/service.js +1 -1
- package/dist/src/local-apps/store.js +1 -2
- package/dist/src/media/session-references.js +1 -2
- package/dist/src/memory-learning/forget-capture.js +1 -2
- package/dist/src/memory-learning/forgotten-history.js +3 -6
- package/dist/src/memory-learning/service.js +1 -2
- package/dist/src/memory-learning/source-learning.js +3 -3
- package/dist/src/memory-learning/task-receipts.js +1 -2
- package/dist/src/memory-learning/work-candidate.d.ts +29 -0
- package/dist/src/memory-learning/work-candidate.js +31 -0
- package/dist/src/memory-learning/work-capture.d.ts +2 -29
- package/dist/src/memory-learning/work-capture.js +2 -30
- package/dist/src/memory-maintenance/service.js +1 -2
- package/dist/src/notes/agent-context.js +1 -2
- package/dist/src/notes/attachment-ref.js +4 -8
- package/dist/src/notes/note-attachment-sync.js +1 -2
- package/dist/src/notes/note-index-meta.js +7 -14
- package/dist/src/notes/note-markdown.js +7 -13
- package/dist/src/notes/service.js +3 -6
- package/dist/src/notes/store.js +2 -4
- package/dist/src/notifications/clarification.js +1 -2
- package/dist/src/notifications/service.js +1 -2
- package/dist/src/personal-agent/proactivity/repository.js +1 -2
- package/dist/src/personal-agent/proactivity/service.js +1 -2
- package/dist/src/personal-agent/prompt-context.js +1 -2
- package/dist/src/personal-agent/reply-composer.js +4 -5
- package/dist/src/personal-agent/repository.js +1 -2
- package/dist/src/personal-agent/request-delivery.js +1 -2
- package/dist/src/personal-agent/result-extraction.js +71 -71
- package/dist/src/personal-agent/service.js +2 -3
- package/dist/src/phone/adb-command.d.ts +1 -0
- package/dist/src/phone/adb-command.js +12 -0
- package/dist/src/phone/adb-driver.d.ts +6 -2
- package/dist/src/phone/adb-driver.js +45 -21
- package/dist/src/phone/cloud-adb-connection.d.ts +34 -0
- package/dist/src/phone/cloud-adb-connection.js +324 -0
- package/dist/src/phone/cloud-adb-writable.d.ts +3 -0
- package/dist/src/phone/cloud-adb-writable.js +21 -0
- package/dist/src/phone/cloud-adb.d.ts +3 -32
- package/dist/src/phone/cloud-adb.js +3 -259
- package/dist/src/phone/cloud-key-permissions.d.ts +2 -0
- package/dist/src/phone/cloud-key-permissions.js +66 -0
- package/dist/src/phone/cloud-phones.js +2 -1
- package/dist/src/phone/cloud-scrcpy.d.ts +1 -1
- package/dist/src/phone/cloud-scrcpy.js +3 -2
- package/dist/src/phone/contracts.d.ts +197 -1
- package/dist/src/phone/contracts.js +55 -6
- package/dist/src/phone/foreground.d.ts +1 -0
- package/dist/src/phone/foreground.js +18 -0
- package/dist/src/phone/live-state.d.ts +2 -0
- package/dist/src/phone/live-state.js +5 -0
- package/dist/src/phone/model-adapter.d.ts +65 -4
- package/dist/src/phone/model-adapter.js +157 -48
- package/dist/src/phone/numeric-entry.d.ts +31 -0
- package/dist/src/phone/numeric-entry.js +126 -0
- package/dist/src/phone/planning.d.ts +27 -0
- package/dist/src/phone/planning.js +79 -0
- package/dist/src/phone/recovery.d.ts +37 -0
- package/dist/src/phone/recovery.js +81 -0
- package/dist/src/phone/reliability.d.ts +2 -2
- package/dist/src/phone/reliability.js +19 -6
- package/dist/src/phone/repository.d.ts +4 -1
- package/dist/src/phone/repository.js +12 -1
- package/dist/src/phone/runtime.d.ts +79 -3
- package/dist/src/phone/runtime.js +861 -93
- package/dist/src/phone/scrcpy.js +3 -2
- package/dist/src/phone/semantic-controls.d.ts +13 -0
- package/dist/src/phone/semantic-controls.js +76 -0
- package/dist/src/phone/setup/service.d.ts +101 -0
- package/dist/src/phone/setup/service.js +296 -0
- package/dist/src/phone/task-feedback.d.ts +4 -0
- package/dist/src/phone/task-feedback.js +47 -0
- package/dist/src/phone/ui-dump-binary.d.ts +1 -0
- package/dist/src/phone/ui-dump-binary.js +4 -0
- package/dist/src/phone/wireless.d.ts +80 -0
- package/dist/src/phone/wireless.js +244 -0
- package/dist/src/projects/capabilities/write.js +1 -2
- package/dist/src/projects/project-service.js +1 -2
- package/dist/src/projects/workspace.js +1 -2
- package/dist/src/providers/presentation.js +2 -2
- package/dist/src/providers/xopc-cloud-model-source.js +6 -2
- package/dist/src/realtime/runtime.d.ts +3 -0
- package/dist/src/realtime/runtime.js +16 -3
- package/dist/src/remote-access/exposure-guards.js +1 -2
- package/dist/src/runtime-tools/archive.js +1 -1
- package/dist/src/runtime-tools/catalog.d.ts +1 -1
- package/dist/src/runtime-tools/catalog.js +2 -2
- package/dist/src/session/config-store.js +1 -2
- package/dist/src/session/init-session-turn.js +1 -2
- package/dist/src/session/resolve-session.js +1 -2
- package/dist/src/session/store.js +2 -4
- package/dist/src/share/share-rate-limit.js +1 -2
- package/dist/src/share/share-url.js +1 -2
- package/dist/src/share/site-share-router.js +1 -2
- package/dist/src/storage/sqlite/activity-repository.js +2 -6
- package/dist/src/storage/sqlite/browser-tab-binding-repository.js +2 -6
- package/dist/src/storage/sqlite/clarification-wait-repository.js +9 -14
- package/dist/src/storage/sqlite/collaboration-rule-repository.js +3 -8
- package/dist/src/storage/sqlite/composer-input-history-repository.js +3 -8
- package/dist/src/storage/sqlite/config-repository.js +5 -9
- package/dist/src/storage/sqlite/connector-learning-repository.js +2 -6
- package/dist/src/storage/sqlite/connector-sync-policy-repository.js +2 -6
- package/dist/src/storage/sqlite/context-evidence-repository.js +3 -8
- package/dist/src/storage/sqlite/context-extraction-repository.js +3 -8
- package/dist/src/storage/sqlite/device-access-repository.js +16 -23
- package/dist/src/storage/sqlite/device-pairing-approval.js +2 -6
- package/dist/src/storage/sqlite/device-pairing-repository.js +5 -10
- package/dist/src/storage/sqlite/endpoint-principal-repository.js +2 -6
- package/dist/src/storage/sqlite/endpoint-session-binding-repository.js +2 -6
- package/dist/src/storage/sqlite/endpoint-tool-invocation-repository.js +2 -6
- package/dist/src/storage/sqlite/gateway-identity-repository.js +2 -6
- package/dist/src/storage/sqlite/home-attention-repository.js +2 -6
- package/dist/src/storage/sqlite/index.js +40 -72
- package/dist/src/storage/sqlite/interaction-state-repository.js +4 -10
- package/dist/src/storage/sqlite/knowledge-repository.js +3 -8
- package/dist/src/storage/sqlite/note-agent-context-repository.js +2 -6
- package/dist/src/storage/sqlite/notes-repository.js +4 -9
- package/dist/src/storage/sqlite/research-checkpoint-repository.js +3 -8
- package/dist/src/storage/sqlite/schema.d.ts +2 -2
- package/dist/src/storage/sqlite/schema.js +7 -7
- package/dist/src/storage/sqlite/schema.sql +10 -0
- package/dist/src/storage/sqlite/session-creation-repository.js +2 -4
- package/dist/src/storage/sqlite/session-task-plan-repository.js +9 -14
- package/dist/src/storage/sqlite/session-turn-replace-repository.js +5 -9
- package/dist/src/storage/sqlite/sidebar-layout-repository.js +9 -14
- package/dist/src/storage/sqlite/transcript-repository.js +6 -10
- package/dist/src/storage/sqlite/upgrades/260_browser_setup.sql +9 -0
- package/dist/src/storage/sqlite/user-people-repository.js +3 -8
- package/dist/src/storage/sqlite/user-trust-repository.js +4 -9
- package/dist/src/tasks/capabilities/read.js +2 -2
- package/dist/src/tasks/capabilities/write.js +1 -1
- package/dist/src/tasks/execution-context.js +1 -2
- package/dist/src/tasks/home-query-service.js +1 -2
- package/dist/src/tasks/task-allocation-repository.js +1 -2
- package/dist/src/tasks/task-context-assembler.js +1 -2
- package/dist/src/tasks/task-handoff.js +2 -4
- package/dist/src/tasks/task-instruction-sequence.d.ts +1 -0
- package/dist/src/tasks/task-instruction-sequence.js +7 -0
- package/dist/src/tasks/task-language.js +1 -2
- package/dist/src/tasks/task-research-result.d.ts +1 -2
- package/dist/src/tasks/task-research-result.js +1 -3
- package/dist/src/tasks/task-result-delivery-repository.js +1 -1
- package/dist/src/tasks/task-result-delivery-service.js +3 -3
- package/dist/src/tasks/task-run-coordinator.js +3 -3
- package/dist/src/tasks/task-run-dispatcher.js +1 -2
- package/dist/src/tasks/task-value-metrics-service.js +1 -2
- package/dist/src/tui/backends/embedded-backend.js +2 -3
- package/dist/src/tui/tui-commands.js +1 -2
- package/dist/src/tunnel/registration-proof.js +1 -2
- package/dist/src/tunnel/tunnel-rate-limit.js +1 -2
- package/dist/src/user-context/access-policy.js +1 -2
- package/dist/src/user-context/domain.js +13 -18
- package/dist/src/user-context/extraction/registry.js +1 -2
- package/dist/src/user-context/interaction-state.js +1 -4
- package/dist/src/user-context/relationship-continuity.js +1 -2
- package/dist/src/user-context/sources/consent-repository.js +1 -2
- package/dist/src/user-context/sources/index.js +1 -1
- package/dist/src/user-context/trust-policy.js +8 -13
- package/dist/src/user-model/action-rule-suggestions.js +1 -2
- package/dist/src/user-model/bootstrap.js +1 -2
- package/dist/src/user-model/capture/executor.js +2 -4
- package/dist/src/user-model/capture/semantic.d.ts +1 -1
- package/dist/src/user-model/capture/semantic.js +1 -1
- package/dist/src/user-model/domain.js +30 -35
- package/dist/src/user-model/goals.js +1 -2
- package/dist/src/user-model/index.js +1 -4
- package/dist/src/user-model/observation-repository.js +1 -2
- package/dist/src/user-model/repository.js +1 -2
- package/dist/src/user-model/usage-policy.js +1 -2
- package/dist/src/voice/realtime/memory-context.js +1 -2
- package/dist/src/voice/realtime/persona-context.js +1 -1
- package/dist/src/work-discovery/service.js +4 -6
- package/package.json +8 -8
- package/skills/tools/configure-xopc/SKILL.md +54 -0
- package/skills/tools/configure-xopc/references/browser/acceptance.md +32 -0
- package/skills/tools/configure-xopc/references/browser/chrome-extension.md +23 -0
- package/skills/tools/configure-xopc/references/browser/overview.md +19 -0
- package/skills/tools/configure-xopc/references/browser/permissions.md +23 -0
- package/skills/tools/configure-xopc/references/browser/troubleshooting.md +24 -0
- package/skills/tools/configure-xopc/references/phone/acceptance.md +27 -0
- package/skills/tools/configure-xopc/references/phone/aliyun.md +29 -0
- package/skills/tools/configure-xopc/references/phone/dependencies.md +18 -0
- package/skills/tools/configure-xopc/references/phone/local.md +19 -0
- package/skills/tools/configure-xopc/references/phone/models.md +21 -0
- package/skills/tools/configure-xopc/references/phone/overview.md +25 -0
- package/skills/tools/configure-xopc/references/phone/troubleshooting.md +27 -0
- package/skills/tools/configure-xopc/references/scene-index.md +12 -0
- package/dist/gateway/static/root/assets/agent-avatar-dicebear-CJFwitU2.js +0 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-DclyJr1N.js +0 -1
- package/dist/gateway/static/root/assets/agents-jhErNtzi.js +0 -77
- package/dist/gateway/static/root/assets/app-management-settings-panel-DgwqNi5i.js +0 -1
- package/dist/gateway/static/root/assets/appearance-settings-C0wJfFyz.js +0 -1
- package/dist/gateway/static/root/assets/apps-page-C0LcnI4h.js +0 -1
- package/dist/gateway/static/root/assets/automation-display-BFN7zWBg.js +0 -2
- package/dist/gateway/static/root/assets/automations-workspace-CBxiV34x.js +0 -8
- package/dist/gateway/static/root/assets/browser-automations-page-vJIrTxdi.js +0 -3
- package/dist/gateway/static/root/assets/browser-settings-page-in5Roh_E.js +0 -3
- package/dist/gateway/static/root/assets/capabilities-BlxF36t-.js +0 -1
- package/dist/gateway/static/root/assets/capabilities-page-CiGx8wpQ.js +0 -2
- package/dist/gateway/static/root/assets/capabilities-settings-panel-a8kqjzQu.js +0 -8
- package/dist/gateway/static/root/assets/capability-header-actions-D4Yq35fD.js +0 -1
- package/dist/gateway/static/root/assets/channels-C_CxcjKT.js +0 -1
- package/dist/gateway/static/root/assets/chat-terminal-dock-zdMySdMm.js +0 -36
- package/dist/gateway/static/root/assets/chunk-KS7C4IRE-BvcCCgTW.js +0 -4
- package/dist/gateway/static/root/assets/cloud-credits-BMYMiiNn.js +0 -1
- package/dist/gateway/static/root/assets/computer-settings-page-C5Z6Jr0p.js +0 -1
- package/dist/gateway/static/root/assets/connector-service-page-Cxus0qrZ.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-DCBO2CxK.js +0 -1
- package/dist/gateway/static/root/assets/constants-DeXt1mV-.js +0 -1
- package/dist/gateway/static/root/assets/date-picker-DuyyD6jz.js +0 -1
- package/dist/gateway/static/root/assets/dependency-picker-BZN72rrk.js +0 -1
- package/dist/gateway/static/root/assets/desktop-pet-BtvTIDCi.js +0 -1
- package/dist/gateway/static/root/assets/desktop-pet-settings-BcyP7Z6v.js +0 -1
- package/dist/gateway/static/root/assets/device-pairing-wizard-Ctbgr50F.js +0 -1
- package/dist/gateway/static/root/assets/directory-picker-path-field-DOusKz-O.js +0 -1
- package/dist/gateway/static/root/assets/dist-C3DSFZCi.js +0 -1
- package/dist/gateway/static/root/assets/dist-CI_fqRk-.js +0 -1
- package/dist/gateway/static/root/assets/docx-preview-CajIk2FR.js +0 -20
- package/dist/gateway/static/root/assets/echarts-runtime-tcHc9TOS.js +0 -18
- package/dist/gateway/static/root/assets/electron-env-Dit0bHgy.js +0 -1
- package/dist/gateway/static/root/assets/extension-debug-page-Bt4FwsFu.js +0 -1
- package/dist/gateway/static/root/assets/extension-page-0vsxX3FB.js +0 -1
- package/dist/gateway/static/root/assets/extension-settings-page-5Pt5_ELc.js +0 -1
- package/dist/gateway/static/root/assets/files-Bw4SBGdM.js +0 -1
- package/dist/gateway/static/root/assets/floating-ui.dom-B7uQOZZW.js +0 -1
- package/dist/gateway/static/root/assets/gateway-realtime-DkWCHVzI.js +0 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-Bx9KCID-.js +0 -1
- package/dist/gateway/static/root/assets/gateway-settings-BsVOcmV5.js +0 -1
- package/dist/gateway/static/root/assets/highlight-code-C8eS9949.js +0 -1
- package/dist/gateway/static/root/assets/highlighted-body-KQOG7T2V-Cbk7eMlg.js +0 -1
- package/dist/gateway/static/root/assets/home-page-BZDZnmyc.js +0 -2
- package/dist/gateway/static/root/assets/image-generation-api-CAS8QVla.js +0 -1
- package/dist/gateway/static/root/assets/imports-page-BCLBYzV1.js +0 -1
- package/dist/gateway/static/root/assets/index-Bys6njTY.js +0 -710
- package/dist/gateway/static/root/assets/index-Vsf0bj5e.css +0 -1
- package/dist/gateway/static/root/assets/keyboard-shortcuts-settings-CM_kt5XN.js +0 -1
- package/dist/gateway/static/root/assets/languages-byq_L2Ae.js +0 -2
- package/dist/gateway/static/root/assets/local-app-workbench-page-Dk87jtcc.js +0 -1
- package/dist/gateway/static/root/assets/local-apps-page-BTSOChhk.js +0 -1
- package/dist/gateway/static/root/assets/local-apps-yys1VChX.js +0 -1
- package/dist/gateway/static/root/assets/local-session-drafts-iGX_6O0O.js +0 -1
- package/dist/gateway/static/root/assets/logs-page-D3gVdm8S.js +0 -2
- package/dist/gateway/static/root/assets/management-settings-BQNYFE4J.js +0 -1
- package/dist/gateway/static/root/assets/mermaid-MCJ5UELQ-ChweJKTv.js +0 -1
- package/dist/gateway/static/root/assets/note-detail-panel-CYKwUCte.js +0 -5
- package/dist/gateway/static/root/assets/note-image-lightbox-BTSZb9ZT.js +0 -1
- package/dist/gateway/static/root/assets/notes-page-CJ5nhWfL.js +0 -8
- package/dist/gateway/static/root/assets/number-input-DDeqHK-G.js +0 -1
- package/dist/gateway/static/root/assets/page-context-capture-button-DVn_dU83.js +0 -1
- package/dist/gateway/static/root/assets/pdf-runtime-DU_sMPjG.js +0 -2
- package/dist/gateway/static/root/assets/personal-page-DcW14lqn.js +0 -1
- package/dist/gateway/static/root/assets/personal-proactivity-BJcZ3Yhi.js +0 -1
- package/dist/gateway/static/root/assets/personal-settings-panel-C16Iqe7X.js +0 -1
- package/dist/gateway/static/root/assets/phone-dependencies-card-D3l9uPFM.js +0 -1
- package/dist/gateway/static/root/assets/phone-model-picker-DOv38vBn.js +0 -1
- package/dist/gateway/static/root/assets/phone-settings-page-DUHp1q_9.js +0 -1
- package/dist/gateway/static/root/assets/plugin-details-dialog-BpfgDlVa.js +0 -1
- package/dist/gateway/static/root/assets/popover-select-DGKUpVsz.js +0 -1
- package/dist/gateway/static/root/assets/preload-helper-zJ_50EbN.js +0 -1
- package/dist/gateway/static/root/assets/preview-open-alternatives-RlHk76TI.js +0 -1
- package/dist/gateway/static/root/assets/product-delivery-BqNm-8S5.js +0 -1
- package/dist/gateway/static/root/assets/product-open-page-Dh-HqLrE.js +0 -1
- package/dist/gateway/static/root/assets/product-preview-content-c3K-4DWc.js +0 -1
- package/dist/gateway/static/root/assets/project-detail-page-GD8TxKad.js +0 -7
- package/dist/gateway/static/root/assets/projects-page-B8HAt9sD.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-D3el7lHK.js +0 -1
- package/dist/gateway/static/root/assets/runtime-tools-settings-panel-Dbskk6RG.js +0 -1
- package/dist/gateway/static/root/assets/schema-form-CXO1B1k4.js +0 -1
- package/dist/gateway/static/root/assets/schemas-CObaziC7.js +0 -64
- package/dist/gateway/static/root/assets/session-manager-CA1NkTR_.js +0 -16
- package/dist/gateway/static/root/assets/sessions-page-07liaSHH.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-BGjU8rfN.js +0 -1
- package/dist/gateway/static/root/assets/settings-form-section-BQxKmbbJ.js +0 -1
- package/dist/gateway/static/root/assets/settings-page-DvVMpKiA.js +0 -1
- package/dist/gateway/static/root/assets/settings-page-header-CYpuTXUW.js +0 -1
- package/dist/gateway/static/root/assets/settings-page-layout-B20AfmFG.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-DKo_VTx-.js +0 -1
- package/dist/gateway/static/root/assets/share-preview-page-XgZk8Oa1.js +0 -2
- package/dist/gateway/static/root/assets/shares-settings-BODFqK8k.js +0 -1
- package/dist/gateway/static/root/assets/skill-api-CV-WT2hj.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-Ce6OUk2C.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-B7ehOIML.js +0 -2
- package/dist/gateway/static/root/assets/specialists-4bkS5rZ4.js +0 -1
- package/dist/gateway/static/root/assets/system-settings-panel-CxJkZRT4.js +0 -1
- package/dist/gateway/static/root/assets/task-detail-page-CxRR0QuW.js +0 -2
- package/dist/gateway/static/root/assets/task-result-evidence-D-gGKNX9.js +0 -1
- package/dist/gateway/static/root/assets/tasks-TVRjEggr.js +0 -1
- package/dist/gateway/static/root/assets/tracing-settings-page-CQw3G-FB.js +0 -1
- package/dist/gateway/static/root/assets/tunnel-api-B2HnCi0U.js +0 -1
- package/dist/gateway/static/root/assets/usage-page-uUEkO38r.js +0 -1
- package/dist/gateway/static/root/assets/use-autosave-Dc0nwUpX.js +0 -1
- package/dist/gateway/static/root/assets/user-model-page-ICUutbKL.js +0 -2
- package/dist/gateway/static/root/assets/voice-api-key-field-BSWXZkGa.js +0 -1
- package/dist/gateway/static/root/assets/work-discovery-overlay-H3cdwq3l.js +0 -1
- package/dist/gateway/static/root/assets/xopc-cloud-account-card-CvT_W6YS.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{t as i}from"./createLucideIcon-DPHK1VkS.js";import{t as a}from"./chevron-left-DqFhpbvK.js";import{t as o}from"./chevron-right-BweFrslA.js";import{n as s,r as c}from"./popover-select-DniHw2dy.js";import{t as l}from"./circle-check-C23XjkUj.js";import{t as u}from"./secret-input-BQvFXqzz.js";import{t as d}from"./globe-DSSGFWFn.js";import{t as f}from"./loader-circle-CifKLtgG.js";import{t as p}from"./plus-Q2yW6OE7.js";import{t as m}from"./search-DA7gz22f.js";import{t as h}from"./settings-2-D-csvaET.js";import{t as g}from"./x-B_N4OPjy.js";import{t as _}from"./messages-DRR9N3HC.js";import{t as v}from"./cn-0WouolD0.js";import{a as y,i as b,l as x,o as S}from"./locale-store-lIXD1FMw.js";import{i as C}from"./vendor-swr-CdRzEUwF.js";import{t as w}from"./button-CnRSIP6m.js";import{t as T}from"./skeleton-BI5TyibZ.js";import{a as E,i as D,n as O,o as k,r as A,s as j,t as M}from"./dist-DfWfZ9iu.js";import{i as N,o as ee}from"./settings-shell-dialog-layer-BU3UuiJr.js";import{n as P}from"./interaction-BdhHBbYa.js";import{r as F}from"./gateway-config-swr-BAmUhiP1.js";import{n as I,t as L}from"./registry-api-n8TwtJ_j.js";import{a as R,o as z,s as B}from"./form-field-width-DJw_jULe.js";import{n as te}from"./secret-input-labels-B5Jl5HqK.js";import{t as ne}from"./sliding-tab-list-DuQyViqe.js";import{i as V,n as H}from"./models-hub-cache-za2fWJLg.js";import{a as re,i as U,o as W}from"./providers-api-CzVkFKFg.js";import{t as ie}from"./oauth-provider-connect-H81se_3n.js";var ae=i(`circle-dashed`,[[`path`,{d:`M10.1 2.182a10 10 0 0 1 3.8 0`,key:`5ilxe3`}],[`path`,{d:`M13.9 21.818a10 10 0 0 1-3.8 0`,key:`11zvb9`}],[`path`,{d:`M17.609 3.721a10 10 0 0 1 2.69 2.7`,key:`1iw5b2`}],[`path`,{d:`M2.182 13.9a10 10 0 0 1 0-3.8`,key:`c0bmvh`}],[`path`,{d:`M20.279 17.609a10 10 0 0 1-2.7 2.69`,key:`1ruxm7`}],[`path`,{d:`M21.818 10.1a10 10 0 0 1 0 3.8`,key:`qkgqxc`}],[`path`,{d:`M3.721 6.391a10 10 0 0 1 2.7-2.69`,key:`1mcia2`}],[`path`,{d:`M6.391 20.279a10 10 0 0 1-2.69-2.7`,key:`1fvljs`}]]),oe=i(`log-in`,[[`path`,{d:`m10 17 5-5-5-5`,key:`1bsop3`}],[`path`,{d:`M15 12H3`,key:`6jk70r`}],[`path`,{d:`M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4`,key:`u53s6r`}]]),G=e(t(),1),K=n(),q={chat:[`日常对话与交办任务`,`Everyday conversations and tasks`],vision:[`理解照片、截图和图片内容`,`Understand photos, screenshots and images`],image:[`根据描述生成图片`,`Create images from a description`],transcription:[`聊天听写与笔记录音转文字`,`Dictate messages and transcribe recorded notes`],speech:[`朗读消息,选择喜欢的音色`,`Read messages aloud in your preferred voice`],conversation:[`实时通话、音色与音频设备`,`Live calls, voices and audio devices`],background:[`自动化、定时和无人值守任务`,`Automations, schedules and unattended tasks`]};function se(e,t,n){return n?{"qwen-token-plan-cn":`阿里云百炼订阅 · 北京`,"qwen-token-plan":`阿里云百炼订阅 · 国际`,"dashscope-cn":`阿里云百炼 · 中国区`,"dashscope-intl":`阿里云百炼 · 国际区`,"xiaomi-token-plan-cn":`小米 MiMo 订阅 · 中国区`}[e]??t:t}var ce=[{label:[`文本`,`Text`],uses:[`chat`]},{label:[`图片`,`Images`],uses:[`vision`,`image`]},{label:[`语音`,`Voice`],uses:[`transcription`,`speech`,`conversation`]},{label:[`后台`,`Background`],uses:[`background`]}],le={chat:[`对话与任务`,`Chat and tasks`],vision:[`看图`,`Image understanding`],image:[`生成图片`,`Image generation`],transcription:[`录音与听写`,`Recording and dictation`],speech:[`文字转语音`,`Text to speech`],conversation:[`实时语音对话`,`Realtime conversation`],background:[`自动与后台任务`,`Background tasks`]};function ue(e){return e&&Object.hasOwn(le,e)?e:void 0}function J(e){return e&&(e.startsWith(`/chat/`)||e===`/personal`)?e:void 0}function Y(e,t){let[n,r]=e.split(`?`),i=new URLSearchParams(r),a=J(t.get(`returnTo`));return a&&i.set(`returnTo`,a),`${n}${i.size?`?${i}`:``}`}async function de(e){return(await S(b(`/api/models/setup/${encodeURIComponent(e)}`))).payload}async function fe(e,t={}){return(await S(b(`/api/models/setup/${encodeURIComponent(e)}/preview`),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)})).payload}async function pe(e,t,n){await S(b(`/api/models/setup/${encodeURIComponent(e)}/apply`),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({...t,revision:n})}),await V()}function me(e,t){return e===`single`?t.getApiKey:e===`intl`?t.getApiKeyIntl:t.getApiKeyCn}var X={"qwen-token-plan-cn":{apiKeyUrl:`https://bailian.console.aliyun.com/cn-beijing/subscription/overview`,docsUrl:`https://help.aliyun.cn/zh/model-studio/token-plan-personal-quick-start`,description:`Alibaba Bailian subscription. Configure chat, vision and image generation with one key.`,descriptionZh:`阿里云百炼订阅,一份 Key 配置对话、视觉和图片生成。`,bestFor:[`general`,`coding`,`vision`],aliases:[`阿里云订阅`,`百炼订阅`,`aliyun`,`bailian`,`qwen`,`token plan`,`通义`,`千问`],envVars:[`QWEN_TOKEN_PLAN_CN_API_KEY`]},openai:{apiKeyUrl:`https://platform.openai.com/api-keys`,pricingUrl:`https://openai.com/pricing`,docsUrl:`https://platform.openai.com/docs`,description:`The most widely used LLM provider. Powers ChatGPT.`,descriptionZh:`最广泛使用的 LLM 服务商,ChatGPT 背后的技术。`,bestFor:[`general`,`coding`,`vision`],freeTier:!1,freeTierNote:`Pay-as-you-go; new accounts may receive trial credits.`,aliases:[`chatgpt`,`gpt`,`gpt-4`,`gpt4`,`gpt-4o`,`gpt4o`],envVars:[`OPENAI_API_KEY`]},anthropic:{apiKeyUrl:`https://console.anthropic.com/settings/keys`,pricingUrl:`https://www.anthropic.com/pricing`,docsUrl:`https://docs.anthropic.com`,description:`Anthropic model access. Available models are loaded from the gateway catalog.`,descriptionZh:`Anthropic 模型服务。可用模型由网关目录动态加载。`,bestFor:[`long context`,`coding`,`reasoning`],freeTier:!1,aliases:[`claude`,`claude 3`,`claude sonnet`,`claude opus`,`claude haiku`],envVars:[`ANTHROPIC_OAUTH_TOKEN`,`ANTHROPIC_API_KEY`]},google:{apiKeyUrl:`https://aistudio.google.com/app/apikey`,pricingUrl:`https://ai.google.dev/pricing`,docsUrl:`https://ai.google.dev/docs`,description:`Google AI model access. Available models are loaded from the gateway catalog.`,descriptionZh:`Google AI 模型服务。可用模型由网关目录动态加载。`,bestFor:[`multimodal`,`long context`,`general`],freeTier:!0,freeTierNote:`Free tier available via Google AI Studio.`,aliases:[`gemini`,`google gemini`,`bard`,`google ai`],envVars:[`GEMINI_API_KEY`,`GOOGLE_API_KEY`]},"google-vertex":{apiKeyUrl:`https://console.cloud.google.com/apis/credentials`,pricingUrl:`https://cloud.google.com/vertex-ai/pricing`,docsUrl:`https://cloud.google.com/vertex-ai/docs`,description:`Google Vertex AI — enterprise-grade model hosting on GCP.`,descriptionZh:`Google Vertex AI,企业级 GCP 托管模型服务。`,bestFor:[`enterprise`,`multimodal`,`compliance`],freeTier:!1,aliases:[`vertex`,`vertex ai`,`gcp`,`google cloud`],envVars:[`GOOGLE_CLOUD_API_KEY`,`GOOGLE_CLOUD_PROJECT`,`GOOGLE_CLOUD_LOCATION`]},"google-gemini-cli":{apiKeyUrl:`https://aistudio.google.com/app/apikey`,pricingUrl:`https://ai.google.dev/pricing`,docsUrl:`https://ai.google.dev/docs`,description:`Gemini via CLI token — for users authenticated with the Gemini CLI tool.`,descriptionZh:`通过 Gemini CLI 令牌访问 Gemini,适合已安装 CLI 工具的用户。`,bestFor:[`general`,`multimodal`],freeTier:!0,freeTierNote:`Uses your existing Gemini CLI authentication.`,aliases:[`gemini cli`,`gemini-cli`],envVars:[`GEMINI_CLI_TOKEN`,`GOOGLE_TOKEN`]},"google-antigravity":{apiKeyUrl:`https://console.cloud.google.com/apis/credentials`,pricingUrl:`https://cloud.google.com/pricing`,docsUrl:`https://cloud.google.com/docs`,description:`Google Antigravity — internal/experimental Google AI endpoint.`,descriptionZh:`Google Antigravity,Google 内部/实验性 AI 端点。`,bestFor:[`experimental`],freeTier:!1,aliases:[`antigravity`,`google antigravity`],envVars:[`ANTIGRAVITY_API_KEY`]},groq:{apiKeyUrl:`https://console.groq.com/keys`,pricingUrl:`https://groq.com/pricing/`,docsUrl:`https://console.groq.com/docs`,description:`Extremely fast inference — ideal for latency-sensitive applications.`,descriptionZh:`推理速度极快,适合对延迟敏感的场景。`,bestFor:[`speed`,`cheap`],freeTier:!0,freeTierNote:`Generous free tier with rate limits.`,aliases:[`groq`,`llama on groq`,`mixtral on groq`],envVars:[`GROQ_API_KEY`]},deepseek:{apiKeyUrl:`https://platform.deepseek.com/api_keys`,pricingUrl:`https://api-docs.deepseek.com/quick_start/pricing/`,docsUrl:`https://platform.deepseek.com/api-docs/`,description:`DeepSeek model access through an OpenAI-compatible API.`,descriptionZh:`通过 OpenAI 兼容 API 访问 DeepSeek 模型。`,bestFor:[`reasoning`,`cheap`,`coding`],freeTier:!0,freeTierNote:`Free credits may be available for new accounts.`,aliases:[`deepseek`,`deep seek`,`deepseek v4`,`deepseek-v4`,`r1`],envVars:[`DEEPSEEK_API_KEY`]},"volcengine-ark":{apiKeyUrl:`https://console.volcengine.com/ark/region:ark+cn-beijing/apiKey`,pricingUrl:`https://www.volcengine.com/docs/82379/1099320`,docsUrl:`https://www.volcengine.com/docs/82379/1302008`,description:`Volcengine Ark — OpenAI-compatible access to Doubao and custom Ark endpoints.`,descriptionZh:`火山方舟,通过 OpenAI 兼容接口访问豆包与自定义方舟 endpoint。`,bestFor:[`chinese`,`general`,`enterprise`],aliases:[`volcengine`,`ark`,`doubao`,`volces`,`火山方舟`,`豆包`],envVars:[`ARK_API_KEY`,`VOLCENGINE_API_KEY`]},"volcengine-plan":{apiKeyUrl:`https://console.volcengine.com/ark/region:ark+cn-beijing/apiKey`,pricingUrl:`https://www.volcengine.com/docs/82379/1099320`,docsUrl:`https://www.volcengine.com/docs/82379/1302008`,description:`Volcengine Doubao Coding Plan — Ark coding endpoint.`,descriptionZh:`火山方舟豆包 Coding Plan,使用 Ark coding endpoint。`,bestFor:[`coding`,`chinese`],aliases:[`volcengine plan`,`ark coding`,`doubao coding`,`火山方舟 coding`],envVars:[`ARK_API_KEY`,`VOLCENGINE_API_KEY`]},"byteplus-plan":{apiKeyUrl:`https://console.byteplus.com/ark/region:ark+ap-southeast-1/apiKey`,pricingUrl:`https://docs.byteplus.com/en/docs/ModelArk`,docsUrl:`https://docs.byteplus.com/en/docs/ModelArk/OpenAI`,description:`BytePlus Doubao Coding Plan — international Ark coding endpoint.`,descriptionZh:`BytePlus 豆包 Coding Plan,国际区 Ark coding endpoint。`,bestFor:[`coding`,`chinese`],aliases:[`byteplus`,`byteplus plan`,`doubao coding international`],envVars:[`BYTEPLUS_API_KEY`,`ARK_API_KEY`]},xai:{apiKeyUrl:`https://console.x.ai/`,pricingUrl:`https://x.ai/api`,docsUrl:`https://docs.x.ai/`,description:`xAI model access. Available models are loaded from the gateway catalog.`,descriptionZh:`xAI 模型服务。可用模型由网关目录动态加载。`,bestFor:[`reasoning`,`real-time`],freeTier:!1,aliases:[`grok`,`xai`,`x.ai`],envVars:[`XAI_API_KEY`]},cerebras:{apiKeyUrl:`https://cloud.cerebras.ai/platform/`,pricingUrl:`https://cloud.cerebras.ai/platform/`,docsUrl:`https://inference-docs.cerebras.ai/`,description:`Ultra-fast inference on custom AI chips. Fastest Llama inference available.`,descriptionZh:`基于专用 AI 芯片的超快推理,Llama 推理速度业界最快。`,bestFor:[`speed`],freeTier:!0,freeTierNote:`Free tier available.`,aliases:[`cerebras`],envVars:[`CEREBRAS_API_KEY`]},mistral:{apiKeyUrl:`https://console.mistral.ai/api-keys/`,pricingUrl:`https://mistral.ai/technology/#pricing`,docsUrl:`https://docs.mistral.ai/`,description:`European open-weight models. Good balance of quality and cost.`,descriptionZh:`欧洲开源模型,质量与成本平衡好。`,bestFor:[`general`,`cheap`,`coding`],freeTier:!1,aliases:[`mistral`,`mixtral`,`codestral`],envVars:[`MISTRAL_API_KEY`]},openrouter:{apiKeyUrl:`https://openrouter.ai/keys`,pricingUrl:`https://openrouter.ai/models`,docsUrl:`https://openrouter.ai/docs`,description:`API gateway to 100+ models from many providers with a single key.`,descriptionZh:`统一 API 网关,一个 Key 访问 100+ 模型。`,bestFor:[`general`,`flexibility`],freeTier:!0,freeTierNote:`Some models are free; pay-per-use for others.`,aliases:[`openrouter`,`open router`],envVars:[`OPENROUTER_API_KEY`]},azure:{apiKeyUrl:`https://portal.azure.com/#view/Microsoft_Azure_ProjectOxford/CognitiveServicesHub/~/OpenAI`,pricingUrl:`https://azure.microsoft.com/en-us/pricing/details/cognitive-services/openai-service/`,docsUrl:`https://learn.microsoft.com/en-us/azure/ai-services/openai/`,description:`OpenAI models hosted on Azure. Enterprise SLA and data residency.`,descriptionZh:`Azure 托管的 OpenAI 模型,企业级 SLA 和数据合规。`,bestFor:[`enterprise`,`compliance`,`coding`],freeTier:!1,aliases:[`azure`,`azure openai`,`aoai`],envVars:[`AZURE_OPENAI_API_KEY`,`AZURE_OPENAI_BASE_URL`]},"amazon-bedrock":{apiKeyUrl:`https://console.aws.amazon.com/iam/home#/security_credentials`,pricingUrl:`https://aws.amazon.com/bedrock/pricing/`,docsUrl:`https://docs.aws.amazon.com/bedrock/`,description:`AWS Bedrock hosted model access with enterprise controls.`,descriptionZh:`AWS Bedrock 托管模型服务,提供企业级控制能力。`,bestFor:[`enterprise`,`compliance`],freeTier:!1,aliases:[`bedrock`,`aws`,`amazon`],envVars:[`AWS_ACCESS_KEY_ID`,`AWS_SECRET_ACCESS_KEY`,`AWS_REGION`]},minimax:{apiKeyUrl:`https://platform.minimax.io/user-center/basic-information/interface-key`,pricingUrl:`https://platform.minimax.io/docs/guides/models-intro`,docsUrl:`https://platform.minimax.io/docs/guides/quickstart-preparation`,description:`MiniMax — Chinese multimodal model with strong text and audio capabilities.`,descriptionZh:`MiniMax,国产多模态模型,文本和音频能力强。`,bestFor:[`multimodal`,`chinese`],freeTier:!0,freeTierNote:`注册赠送免费额度。`,aliases:[`minimax`,`mini max`,`abab`],envVars:[`MINIMAX_API_KEY`]},"minimax-cn":{apiKeyUrl:`https://platform.minimaxi.com/user-center/basic-information/interface-key`,pricingUrl:`https://platform.minimaxi.com/document/Price`,docsUrl:`https://platform.minimaxi.com/document/Announcement`,description:`MiniMax (China endpoint) — domestic access for Chinese users.`,descriptionZh:`MiniMax 国内端点,国内用户直连访问。`,bestFor:[`multimodal`,`chinese`],freeTier:!0,freeTierNote:`注册赠送免费额度。`,aliases:[`minimax cn`,`minimax china`,`abab`],envVars:[`MINIMAX_CN_API_KEY`,`MINIMAX_API_KEY`]},stepfun:{apiKeyUrl:`https://platform.stepfun.com/interface-key`,pricingUrl:`https://platform.stepfun.com/docs/pricing`,docsUrl:`https://platform.stepfun.com/docs`,description:`StepFun OpenAI-compatible endpoint.`,descriptionZh:`阶跃星辰 StepFun OpenAI 兼容端点。`,bestFor:[`chinese`,`reasoning`,`general`],aliases:[`stepfun`,`step`,`阶跃星辰`],envVars:[`STEPFUN_API_KEY`]},"stepfun-cn":{apiKeyUrl:`https://platform.stepfun.com/interface-key`,pricingUrl:`https://platform.stepfun.com/docs/pricing`,docsUrl:`https://platform.stepfun.com/docs`,description:`StepFun China — OpenAI-compatible chat endpoint.`,descriptionZh:`阶跃星辰 StepFun 中国区 OpenAI 兼容对话端点。`,bestFor:[`chinese`,`reasoning`,`general`],aliases:[`stepfun cn`,`step cn`,`阶跃星辰`],envVars:[`STEPFUN_API_KEY`]},"stepfun-intl":{apiKeyUrl:`https://platform.stepfun.com/interface-key`,pricingUrl:`https://platform.stepfun.com/docs/pricing`,docsUrl:`https://platform.stepfun.com/docs`,description:`StepFun International — OpenAI-compatible chat endpoint.`,descriptionZh:`阶跃星辰 StepFun 国际区 OpenAI 兼容对话端点。`,bestFor:[`chinese`,`reasoning`,`general`],aliases:[`stepfun intl`,`step international`],envVars:[`STEPFUN_API_KEY`]},"stepfun-plan":{apiKeyUrl:`https://platform.stepfun.com/interface-key`,pricingUrl:`https://platform.stepfun.com/docs/pricing`,docsUrl:`https://platform.stepfun.com/docs`,description:`StepFun Step Plan coding/planning endpoint.`,descriptionZh:`阶跃星辰 Step Plan coding/planning 专用端点。`,bestFor:[`coding`,`reasoning`,`chinese`],aliases:[`stepfun plan`,`step plan`,`阶跃 plan`],envVars:[`STEPFUN_API_KEY`]},"stepfun-plan-cn":{apiKeyUrl:`https://platform.stepfun.com/interface-key`,pricingUrl:`https://platform.stepfun.com/docs/pricing`,docsUrl:`https://platform.stepfun.com/docs`,description:`StepFun Step Plan China — coding/planning endpoint.`,descriptionZh:`阶跃星辰 Step Plan 中国区 coding/planning 专用端点。`,bestFor:[`coding`,`reasoning`,`chinese`],aliases:[`stepfun plan cn`,`step plan cn`,`阶跃 plan`],envVars:[`STEPFUN_API_KEY`]},"stepfun-plan-intl":{apiKeyUrl:`https://platform.stepfun.com/interface-key`,pricingUrl:`https://platform.stepfun.com/docs/pricing`,docsUrl:`https://platform.stepfun.com/docs`,description:`StepFun Step Plan International — coding/planning endpoint.`,descriptionZh:`阶跃星辰 Step Plan 国际区 coding/planning 专用端点。`,bestFor:[`coding`,`reasoning`,`chinese`],aliases:[`stepfun plan intl`,`step plan international`],envVars:[`STEPFUN_API_KEY`]},"kimi-coding":{apiKeyUrl:`https://platform.kimi.com/console/api-keys`,pricingUrl:`https://platform.kimi.com/docs/pricing/chat`,docsUrl:`https://platform.kimi.com/docs`,description:`Kimi Coding — dedicated Anthropic-compatible coding endpoint.`,descriptionZh:`Kimi Coding,Anthropic 兼容的专用 coding 端点。`,bestFor:[`coding`,`chinese`,`vision`],freeTier:!0,freeTierNote:`注册赠送免费额度。`,aliases:[`kimi coding`,`moonshot coding`,`kimi code`],envVars:[`KIMI_API_KEY`,`MOONSHOT_API_KEY`]},moonshotai:{apiKeyUrl:`https://platform.moonshot.ai/console/api-keys`,pricingUrl:`https://platform.moonshot.ai/docs/pricing`,docsUrl:`https://platform.moonshot.ai/docs`,description:`Moonshot Kimi — international API (api.moonshot.ai).`,descriptionZh:`月之暗面 Kimi 国际版 API(api.moonshot.ai)。`,bestFor:[`coding`,`chinese`,`long context`],freeTier:!0,aliases:[`moonshot`,`kimi`,`moonshot ai`],envVars:[`MOONSHOT_API_KEY`]},"moonshotai-cn":{apiKeyUrl:`https://platform.moonshot.cn/console/api-keys`,pricingUrl:`https://platform.moonshot.cn/docs/pricing/chat`,docsUrl:`https://platform.moonshot.cn/docs`,description:`Moonshot Kimi — China region endpoint.`,descriptionZh:`月之暗面 Kimi 中国区域端点。`,bestFor:[`coding`,`chinese`,`long context`],freeTier:!0,aliases:[`moonshot cn`,`kimi cn`],envVars:[`MOONSHOT_API_KEY`]},fal:{apiKeyUrl:`https://fal.ai/dashboard/keys`,pricingUrl:`https://fal.ai/pricing`,docsUrl:`https://fal.ai/docs`,description:`fal — serverless image and media generation APIs.`,descriptionZh:`fal:无服务器图像与媒体生成 API。`,bestFor:[`image`,`video`],freeTier:!0,aliases:[`fal ai`,`fal.ai`],envVars:[`FAL_KEY`,`FAL_API_KEY`]},fireworks:{apiKeyUrl:`https://fireworks.ai/account/api-keys`,pricingUrl:`https://fireworks.ai/pricing`,docsUrl:`https://docs.fireworks.ai`,description:`Fireworks AI — fast inference for open and proprietary models.`,descriptionZh:`Fireworks AI,多种开源与商业模型的高速推理服务。`,bestFor:[`speed`,`coding`,`open weights`],freeTier:!0,aliases:[`fireworks ai`,`fireworks`],envVars:[`FIREWORKS_API_KEY`]},together:{apiKeyUrl:`https://api.together.xyz/settings/api-keys`,pricingUrl:`https://www.together.ai/pricing`,docsUrl:`https://docs.together.ai`,description:`Together AI — hosted Llama, Qwen, DeepSeek, and more.`,descriptionZh:`Together AI,托管 Llama、Qwen、DeepSeek 等模型。`,bestFor:[`open source`,`flexibility`],freeTier:!0,aliases:[`together ai`,`together.xyz`],envVars:[`TOGETHER_API_KEY`]},"cloudflare-workers-ai":{apiKeyUrl:`https://dash.cloudflare.com/?to=/:account/ai/workers-ai`,pricingUrl:`https://developers.cloudflare.com/workers-ai/platform/pricing/`,docsUrl:`https://developers.cloudflare.com/workers-ai/`,description:`Cloudflare Workers AI — models at the edge via Cloudflare API.`,descriptionZh:`Cloudflare Workers AI,通过 Cloudflare API 在边缘运行模型。`,bestFor:[`edge`,`latency`],freeTier:!0,aliases:[`workers ai`,`cf workers ai`],envVars:[`CLOUDFLARE_API_KEY`]},"cloudflare-ai-gateway":{apiKeyUrl:`https://dash.cloudflare.com/?to=/:account/ai/ai-gateway`,pricingUrl:`https://developers.cloudflare.com/ai-gateway/pricing/`,docsUrl:`https://developers.cloudflare.com/ai-gateway/`,description:`Cloudflare AI Gateway — unified OpenAI/Anthropic-compatible routing.`,descriptionZh:`Cloudflare AI Gateway,统一 OpenAI/Anthropic 兼容路由。`,bestFor:[`routing`,`observability`,`enterprise`],freeTier:!0,aliases:[`cf ai gateway`,`cloudflare gateway`],envVars:[`CLOUDFLARE_API_KEY`]},xiaomi:{apiKeyUrl:`https://platform.xiaomimimo.com/#/console/api-keys`,pricingUrl:`https://mimo.mi.com/`,docsUrl:`https://platform.xiaomimimo.com/`,description:`Xiaomi MiMo — API billing through the MiMo open platform; endpoint api.xiaomimimo.com.`,descriptionZh:`小米 MiMo 按量计费线路,在开放平台创建密钥;接口域名为 api.xiaomimimo.com。`,bestFor:[`general`,`coding`],freeTier:!1,aliases:[`xiaomi`,`mimo`,`小米`,`xiaomimimo`],envVars:[`XIAOMI_API_KEY`]},"xiaomi-token-plan-cn":{apiKeyUrl:`https://platform.xiaomimimo.com/#/console/api-keys`,pricingUrl:`https://mimo.mi.com/`,docsUrl:`https://platform.xiaomimimo.com/`,description:`Xiaomi MiMo Token Plan — China region (token-plan-cn.xiaomimimo.com).`,descriptionZh:`小米 MiMo Token 套餐 · 中国区(token-plan-cn.xiaomimimo.com)。`,bestFor:[`general`,`coding`],freeTier:!1,aliases:[`xiaomi token cn`,`mimo token cn`],envVars:[`XIAOMI_TOKEN_PLAN_CN_API_KEY`,`XIAOMI_TOKEN_PLAN_API_KEY`]},"xiaomi-token-plan-ams":{apiKeyUrl:`https://platform.xiaomimimo.com/#/console/api-keys`,pricingUrl:`https://mimo.mi.com/`,docsUrl:`https://platform.xiaomimimo.com/`,description:`Xiaomi MiMo Token Plan — Amsterdam region (token-plan-ams.xiaomimimo.com).`,descriptionZh:`小米 MiMo Token 套餐 · 阿姆斯特丹(token-plan-ams.xiaomimimo.com)。`,bestFor:[`general`,`coding`],freeTier:!1,aliases:[`xiaomi token ams`,`mimo token ams`],envVars:[`XIAOMI_TOKEN_PLAN_AMS_API_KEY`,`XIAOMI_TOKEN_PLAN_API_KEY`]},"xiaomi-token-plan-sgp":{apiKeyUrl:`https://platform.xiaomimimo.com/#/console/api-keys`,pricingUrl:`https://mimo.mi.com/`,docsUrl:`https://platform.xiaomimimo.com/`,description:`Xiaomi MiMo Token Plan — Singapore region (token-plan-sgp.xiaomimimo.com).`,descriptionZh:`小米 MiMo Token 套餐 · 新加坡(token-plan-sgp.xiaomimimo.com)。`,bestFor:[`general`,`coding`],freeTier:!1,aliases:[`xiaomi token sgp`,`mimo token sgp`],envVars:[`XIAOMI_TOKEN_PLAN_SGP_API_KEY`,`XIAOMI_TOKEN_PLAN_API_KEY`]},"ant-ling":{apiKeyUrl:`https://ling.tbox.cn/`,docsUrl:`https://ling.tbox.cn/`,description:`Ant Ling — domestic OpenAI-compatible access to Ling and Ring models.`,descriptionZh:`蚂蚁 Ling,国内 OpenAI 兼容服务,提供 Ling 与 Ring 系列模型。`,bestFor:[`chinese`,`reasoning`,`coding`],aliases:[`ant ling`,`ling`,`ring`,`蚂蚁 ling`,`蚂蚁灵`],envVars:[`ANT_LING_API_KEY`,`LING_API_KEY`]},"zai-coding-global":{apiKeyUrl:`https://z.ai/manage-apikey/apikey-list`,pricingUrl:`https://z.ai/manage-apikey/billing`,docsUrl:`https://docs.z.ai/guides/overview/quick-start`,description:`Zhipu GLM Coding Plan — international z.ai endpoint.`,descriptionZh:`智谱 GLM Coding Plan 国际区 z.ai 端点。`,bestFor:[`coding`,`reasoning`,`chinese`],aliases:[`zai coding`,`zhipu coding global`,`glm coding global`],envVars:[`ZAI_API_KEY`,`Z_AI_API_KEY`]},"zai-coding-cn":{apiKeyUrl:`https://bigmodel.cn/usercenter/proj-mgmt/apikeys`,pricingUrl:`https://bigmodel.cn/pricing`,docsUrl:`https://docs.bigmodel.cn/cn/guide/start/model-overview`,description:`Zhipu GLM Coding Plan — China endpoint from the pi-ai provider catalog.`,descriptionZh:`智谱 GLM Coding Plan 中国区,来自 pi-ai 内置 provider 目录。`,bestFor:[`coding`,`reasoning`,`chinese`],aliases:[`zai coding cn`,`zhipu coding cn`,`glm coding cn`,`智谱 coding`],envVars:[`ZHIPU_API_KEY`,`BIGMODEL_API_KEY`,`ZAI_API_KEY`]},"zhipu-coding-cn":{apiKeyUrl:`https://bigmodel.cn/usercenter/proj-mgmt/apikeys`,pricingUrl:`https://bigmodel.cn/pricing`,docsUrl:`https://docs.bigmodel.cn/cn/guide/start/model-overview`,description:`Zhipu GLM Coding Plan — China BigModel endpoint.`,descriptionZh:`智谱 GLM Coding Plan 中国区 BigModel 端点。`,bestFor:[`coding`,`reasoning`,`chinese`],aliases:[`zhipu coding`,`glm coding cn`,`智谱 coding`],envVars:[`ZHIPU_API_KEY`,`BIGMODEL_API_KEY`,`ZAI_API_KEY`]},"zhipu-cn":{apiKeyUrl:`https://bigmodel.cn/usercenter/proj-mgmt/apikeys`,pricingUrl:`https://bigmodel.cn/pricing`,docsUrl:`https://docs.bigmodel.cn/cn/guide/start/model-overview`,description:`Zhipu GLM China — BigModel OpenAI-compatible endpoint.`,descriptionZh:`智谱 GLM 中国区,通过 BigModel OpenAI 兼容接口访问。`,bestFor:[`chinese`,`reasoning`,`general`],freeTier:!0,aliases:[`zhipu`,`glm`,`bigmodel`,`智谱`,`z.ai cn`],envVars:[`ZHIPU_API_KEY`,`BIGMODEL_API_KEY`]},huggingface:{apiKeyUrl:`https://huggingface.co/settings/tokens`,pricingUrl:`https://huggingface.co/pricing`,docsUrl:`https://huggingface.co/docs/api-inference/`,description:`Access thousands of open-source models via Hugging Face Inference API.`,descriptionZh:`通过 Hugging Face 访问数千个开源模型。`,bestFor:[`open source`,`flexibility`],freeTier:!0,freeTierNote:`Free tier with rate limits.`,aliases:[`huggingface`,`hugging face`,`hf`],envVars:[`HF_TOKEN`,`HUGGINGFACE_TOKEN`]},opencode:{apiKeyUrl:`https://opencode.ai/auth`,pricingUrl:`https://opencode.ai/docs`,docsUrl:`https://opencode.ai/docs/providers/`,description:`OpenCode — AI coding assistant provider.`,descriptionZh:`OpenCode,AI 代码助手服务商。`,bestFor:[`coding`],freeTier:!1,aliases:[`opencode`,`open code`],envVars:[`OPENCODE_API_KEY`]},"opencode-go":{apiKeyUrl:`https://opencode.ai/auth`,pricingUrl:`https://opencode.ai/docs`,docsUrl:`https://opencode.ai/docs/providers/`,description:`OpenCode Go — AI coding assistant provider (Go variant).`,descriptionZh:`OpenCode Go,AI 代码助手服务商(Go 版本)。`,bestFor:[`coding`],freeTier:!1,aliases:[`opencode go`,`opencode-go`],envVars:[`OPENCODE_API_KEY`]},zai:{apiKeyUrl:`https://z.ai/manage-apikey/apikey-list`,pricingUrl:`https://z.ai/manage-apikey/billing`,docsUrl:`https://docs.z.ai/guides/overview/quick-start`,description:`Zhipu GLM International — z.ai OpenAI-compatible endpoint.`,descriptionZh:`智谱 GLM 国际区,通过 z.ai OpenAI 兼容接口访问。`,bestFor:[`general`,`reasoning`,`chinese`],freeTier:!1,aliases:[`zai`,`z.ai`,`zhipu global`,`glm global`,`智谱`],envVars:[`ZAI_API_KEY`,`Z_AI_API_KEY`]},dashscope:{apiKeyUrl:`https://dashscope.console.aliyun.com/apiKey`,pricingUrl:`https://help.aliyun.com/zh/dashscope/developer-reference/tongyi-thousand-questions-metering-and-billing`,docsUrl:`https://help.aliyun.com/zh/model-studio/developer-reference/compatibility-of-openai-with-dashscope`,description:`Alibaba Bailian / DashScope service provider.`,descriptionZh:`阿里百炼 / DashScope 服务 provider。`,bestFor:[`chinese`,`coding`,`image`,`speech`],freeTier:!0,aliases:[`dash scope`,`alibaba dashscope`,`qwen`,`tongyi`,`阿里百炼`,`通义千问`],envVars:[`DASHSCOPE_API_KEY`,`QWEN_API_KEY`]},"dashscope-cn":{apiKeyUrl:`https://dashscope.console.aliyun.com/apiKey`,pricingUrl:`https://help.aliyun.com/zh/dashscope/developer-reference/tongyi-thousand-questions-metering-and-billing`,docsUrl:`https://help.aliyun.com/zh/model-studio/developer-reference/compatibility-of-openai-with-dashscope`,description:`Alibaba Bailian / DashScope China — Qwen LLMs through the China endpoint.`,descriptionZh:`阿里百炼 / DashScope 中国区:通过国内端点访问通义千问 LLM。`,bestFor:[`chinese`,`coding`,`image`],freeTier:!0,aliases:[`dash scope cn`,`alibaba dashscope cn`,`qwen cn`,`tongyi cn`,`阿里百炼`,`通义千问`],envVars:[`DASHSCOPE_API_KEY`,`QWEN_API_KEY`]},"dashscope-intl":{apiKeyUrl:`https://modelstudio.console.alibabacloud.com/`,pricingUrl:`https://www.alibabacloud.com/help/en/model-studio/billing-for-tongyi-qianwen`,docsUrl:`https://www.alibabacloud.com/help/en/model-studio/compatibility-of-openai-with-dashscope`,description:`Alibaba Bailian / DashScope International — Qwen LLMs through the international endpoint.`,descriptionZh:`阿里百炼 / DashScope 国际区:通过国际端点访问通义千问 LLM。`,bestFor:[`chinese`,`coding`,`image`],freeTier:!0,aliases:[`dash scope intl`,`alibaba cloud dashscope`,`qwen intl`,`tongyi intl`],envVars:[`DASHSCOPE_API_KEY`,`QWEN_API_KEY`]},"vercel-ai-gateway":{apiKeyUrl:`https://vercel.com/account/tokens`,pricingUrl:`https://vercel.com/pricing`,docsUrl:`https://vercel.com/docs/ai/ai-gateway`,description:`Vercel AI Gateway — route requests to multiple LLM providers via Vercel.`,descriptionZh:`Vercel AI Gateway,通过 Vercel 路由请求到多个 LLM 服务商。`,bestFor:[`flexibility`,`enterprise`],freeTier:!1,aliases:[`vercel gateway`,`vercel ai gateway`],envVars:[`AI_GATEWAY_API_KEY`,`VERCEL_AI_GATEWAY_API_KEY`]},"github-copilot":{apiKeyUrl:`https://github.com/settings/tokens`,pricingUrl:`https://github.com/features/copilot#pricing`,docsUrl:`https://docs.github.com/en/copilot`,description:`GitHub Copilot — use your GitHub token to access Copilot models.`,descriptionZh:`使用 GitHub 令牌访问 Copilot 模型。`,bestFor:[`coding`],freeTier:!0,freeTierNote:`Free for verified students and open-source maintainers.`,aliases:[`github copilot`,`copilot`,`github`],envVars:[`COPILOT_GITHUB_TOKEN`,`GH_TOKEN`,`GITHUB_TOKEN`,`GITHUB_COPILOT_TOKEN`]}};function he(e,t){let n=X[e];return n&&n.apiKeyUrl?[{href:n.apiKeyUrl,kind:`single`}]:[]}var ge=[`common`,`domestic`,`specialty`,`enterprise`,`oauth`,`extension`];function _e(e){let t=new Map;for(let e of ge)t.set(e,[]);for(let n of e){let e=n.category||`specialty`,r=t.get(e)??[];r.push(n),t.set(e,r)}return t}var ve=[{value:`openai-completions`,label:`OpenAI Completions`},{value:`openai-responses`,label:`OpenAI Responses`},{value:`anthropic-messages`,label:`Anthropic Messages`},{value:`google-generative-ai`,label:`Google Generative AI`},{value:`azure-openai-responses`,label:`Azure OpenAI`},{value:`bedrock-converse-stream`,label:`AWS Bedrock`},{value:`google-gemini-cli`,label:`Google Gemini CLI`},{value:`google-vertex`,label:`Google Vertex AI`}];function ye(e){if(!e||typeof e!=`object`)return;let t=e;if(typeof t.error==`string`)return t.error;if(t.error&&typeof t.error==`object`&&`message`in t.error){let e=t.error.message;return typeof e==`string`?e:void 0}}function be(e){if(!e||typeof e!=`object`)return{providers:{}};let t=e,n=t.providers;return n&&typeof n==`object`&&!Array.isArray(n)?e:{...t,providers:{}}}async function xe(){let e=await y(b(`/api/models-json`)),t=await e.json().catch(()=>({}));if(!e.ok||!t.ok||!t.payload)throw Error(ye(t)||`HTTP ${e.status}`);return{...t.payload,config:be(t.payload.config)}}async function Se(e){let t=await y(b(`/api/models-json`),{method:`PATCH`,body:JSON.stringify({config:e})}),n=await t.json().catch(()=>({}));if(!t.ok||!n.ok||!n.payload)throw Error(ye(n)||`HTTP ${t.status}`);return await V(),n.payload}async function Ce(e){let t=await y(b(`/api/models-json/discover-models`),{method:`POST`,body:JSON.stringify(e)}),n=await t.json().catch(()=>({}));if(!t.ok||!n.ok||!n.payload)throw Error(ye(n)||`HTTP ${t.status}`);return n.payload.models}function we(e,t,n){return{id:e,name:t||e,input:[`text`],contextWindow:128e3,maxTokens:16384,cost:{input:0,output:0,cacheRead:0,cacheWrite:0},...n}}var Z={ollama:{label:`Ollama`,providerId:`ollama`,config:{baseUrl:`http://localhost:11434/v1`,api:`openai-completions`,apiKey:`ollama`}},lmstudio:{label:`LM Studio`,providerId:`lmstudio`,config:{baseUrl:`http://localhost:1234/v1`,api:`openai-completions`,apiKey:`lmstudio`}},openrouter:{label:`OpenRouter`,providerId:`openrouter`,config:{baseUrl:`https://openrouter.ai/api/v1`,api:`openai-completions`,apiKey:``}},zhipuCn:{label:`Zhipu GLM China`,providerId:`zhipu-cn`,config:{baseUrl:`https://open.bigmodel.cn/api/paas/v4`,api:`openai-completions`,apiKey:`ZHIPU_API_KEY`,models:[{id:`glm-5.2`,name:`GLM 5.2`,contextWindow:1e6,maxTokens:65536,reasoning:!0,input:[`text`]}]}},zaiGeneral:{label:`Zhipu GLM International`,providerId:`zai`,config:{baseUrl:`https://api.z.ai/api/paas/v4`,api:`openai-completions`,apiKey:`ZAI_API_KEY`,models:[{id:`glm-5.2`,name:`GLM 5.2`,contextWindow:1e6,maxTokens:65536,reasoning:!0,input:[`text`]}]}},dashscopeCn:{label:`Alibaba Bailian / DashScope China`,providerId:`dashscope-cn`,description:`China OpenAI-compatible Qwen endpoint`,config:{baseUrl:`https://dashscope.aliyuncs.com/compatible-mode/v1`,api:`openai-completions`,apiKey:`DASHSCOPE_API_KEY`,models:[{id:`qwen3.7-max`,name:`Qwen3.7 Max`,contextWindow:1e6,input:[`text`,`image`]},{id:`qwen3.7-plus`,name:`Qwen3.7 Plus`,contextWindow:1e6,input:[`text`,`image`]},{id:`qwen3.6-flash`,name:`Qwen3.6 Flash`,contextWindow:1e6,input:[`text`]}]}},dashscopeIntl:{label:`Alibaba Bailian / DashScope International`,providerId:`dashscope-intl`,description:`International OpenAI-compatible Qwen endpoint`,config:{baseUrl:`https://dashscope-intl.aliyuncs.com/compatible-mode/v1`,api:`openai-completions`,apiKey:`DASHSCOPE_API_KEY`,models:[{id:`qwen3.7-max`,name:`Qwen3.7 Max`,contextWindow:1e6,input:[`text`,`image`]},{id:`qwen3.7-plus`,name:`Qwen3.7 Plus`,contextWindow:1e6,input:[`text`,`image`]},{id:`qwen3.6-flash`,name:`Qwen3.6 Flash`,contextWindow:1e6,input:[`text`]}]}},volcengineArk:{label:`Volcengine Ark`,providerId:`volcengine-ark`,description:`Use your Ark endpoint id as the model id`,config:{baseUrl:`https://ark.cn-beijing.volces.com/api/v3`,api:`openai-completions`,apiKey:`ARK_API_KEY`,models:[{id:`ep-your-endpoint-id`,name:`Ark endpoint ID`,contextWindow:128e3,input:[`text`]}]}},volcenginePlan:{label:`Volcengine Doubao Coding Plan`,providerId:`volcengine-plan`,description:`Doubao coding-plan endpoint on Volcengine Ark`,config:{baseUrl:`https://ark.cn-beijing.volces.com/api/coding/v3`,api:`openai-completions`,apiKey:`ARK_API_KEY`,models:[{id:`ark-code-latest`,name:`Ark Coding Plan`,contextWindow:256e3,maxTokens:4096,input:[`text`]},{id:`doubao-seed-2.0-code`,name:`Doubao Seed 2.0 Code`,contextWindow:256e3,maxTokens:4096,input:[`text`]},{id:`doubao-seed-2.0-pro`,name:`Doubao Seed 2.0 Pro`,contextWindow:256e3,maxTokens:4096,input:[`text`]},{id:`doubao-seed-2.0-lite`,name:`Doubao Seed 2.0 Lite`,contextWindow:256e3,maxTokens:4096,input:[`text`]}]}},byteplusPlan:{label:`BytePlus Doubao Coding Plan`,providerId:`byteplus-plan`,description:`Doubao coding-plan endpoint on BytePlus`,config:{baseUrl:`https://ark.ap-southeast.bytepluses.com/api/coding/v3`,api:`openai-completions`,apiKey:`BYTEPLUS_API_KEY`,models:[{id:`ark-code-latest`,name:`Ark Coding Plan`,contextWindow:256e3,maxTokens:4096,input:[`text`]},{id:`doubao-seed-2.0-code`,name:`Doubao Seed 2.0 Code`,contextWindow:256e3,maxTokens:4096,input:[`text`]},{id:`doubao-seed-2.0-pro`,name:`Doubao Seed 2.0 Pro`,contextWindow:256e3,maxTokens:4096,input:[`text`]},{id:`doubao-seed-2.0-lite`,name:`Doubao Seed 2.0 Lite`,contextWindow:256e3,maxTokens:4096,input:[`text`]}]}},deepseek:{label:`DeepSeek`,providerId:`deepseek`,config:{baseUrl:`https://api.deepseek.com`,api:`openai-completions`,apiKey:`DEEPSEEK_API_KEY`,models:[{id:`deepseek-v4-pro`,name:`DeepSeek V4 Pro`,contextWindow:1e6,maxTokens:393216,reasoning:!0,input:[`text`]},{id:`deepseek-v4-flash`,name:`DeepSeek V4 Flash`,contextWindow:1e6,maxTokens:393216,reasoning:!0,input:[`text`]}]}},moonshotCn:{label:`Kimi / Moonshot China`,providerId:`moonshotai-cn`,config:{baseUrl:`https://api.moonshot.cn/v1`,api:`openai-completions`,apiKey:`MOONSHOT_API_KEY`,models:[{id:`kimi-k2.7-code`,name:`Kimi K2.7 Code`,contextWindow:262144,maxTokens:32768,reasoning:!0,input:[`text`,`image`]},{id:`kimi-k2.6`,name:`Kimi K2.6`,contextWindow:128e3,input:[`text`]}]}},moonshotIntl:{label:`Kimi / Moonshot International`,providerId:`moonshotai`,config:{baseUrl:`https://api.moonshot.ai/v1`,api:`openai-completions`,apiKey:`MOONSHOT_API_KEY`,models:[{id:`kimi-k2.7-code`,name:`Kimi K2.7 Code`,contextWindow:262144,maxTokens:32768,reasoning:!0,input:[`text`,`image`]},{id:`kimi-k2.6`,name:`Kimi K2.6`,contextWindow:128e3,input:[`text`]}]}},kimiCoding:{label:`Kimi Coding`,providerId:`kimi-coding`,description:`Dedicated Kimi coding endpoint`,config:{baseUrl:`https://api.kimi.com/coding`,api:`anthropic-messages`,apiKey:`KIMI_API_KEY`,headers:{"User-Agent":`KimiCLI/1.5`},models:[{id:`k2p7`,name:`Kimi K2.7 Code`,contextWindow:262144,maxTokens:32768,reasoning:!0,input:[`text`,`image`]},{id:`kimi-for-coding`,name:`Kimi For Coding`,contextWindow:262144,maxTokens:32768,reasoning:!0,input:[`text`,`image`]}]}},stepfunIntl:{label:`StepFun International`,providerId:`stepfun-intl`,config:{baseUrl:`https://api.stepfun.ai/v1`,api:`openai-completions`,apiKey:`STEPFUN_API_KEY`,models:[{id:`step-3.7-flash`,name:`Step 3.7 Flash`,contextWindow:1e6,reasoning:!0,input:[`text`,`image`]},{id:`step-3.5-flash-2603`,name:`Step 3.5 Flash 2603`,contextWindow:1e6,reasoning:!0,input:[`text`,`image`]},{id:`step-3.5-flash`,name:`Step 3.5 Flash`,contextWindow:1e6,reasoning:!0,input:[`text`]}]}},stepfunCn:{label:`StepFun China`,providerId:`stepfun-cn`,config:{baseUrl:`https://api.stepfun.com/v1`,api:`openai-completions`,apiKey:`STEPFUN_API_KEY`,models:[{id:`step-3.7-flash`,name:`Step 3.7 Flash`,contextWindow:1e6,reasoning:!0,input:[`text`,`image`]},{id:`step-3.5-flash-2603`,name:`Step 3.5 Flash 2603`,contextWindow:1e6,reasoning:!0,input:[`text`,`image`]},{id:`step-3.5-flash`,name:`Step 3.5 Flash`,contextWindow:1e6,reasoning:!0,input:[`text`]}]}},stepfunPlanIntl:{label:`StepFun Step Plan International`,providerId:`stepfun-plan-intl`,config:{baseUrl:`https://api.stepfun.ai/step_plan/v1`,api:`openai-completions`,apiKey:`STEPFUN_API_KEY`,models:[{id:`step-3.7-flash`,name:`Step 3.7 Flash`,contextWindow:1e6,reasoning:!0,input:[`text`,`image`]},{id:`step-3.5-flash-2603`,name:`Step 3.5 Flash 2603`,contextWindow:1e6,reasoning:!0,input:[`text`,`image`]},{id:`step-3.5-flash`,name:`Step 3.5 Flash`,contextWindow:1e6,reasoning:!0,input:[`text`]}]}},stepfunPlanCn:{label:`StepFun Step Plan China`,providerId:`stepfun-plan-cn`,config:{baseUrl:`https://api.stepfun.com/step_plan/v1`,api:`openai-completions`,apiKey:`STEPFUN_API_KEY`,models:[{id:`step-3.7-flash`,name:`Step 3.7 Flash`,contextWindow:1e6,reasoning:!0,input:[`text`,`image`]},{id:`step-3.5-flash-2603`,name:`Step 3.5 Flash 2603`,contextWindow:1e6,reasoning:!0,input:[`text`,`image`]},{id:`step-3.5-flash`,name:`Step 3.5 Flash`,contextWindow:1e6,reasoning:!0,input:[`text`]}]}},xiaomi:{label:`Xiaomi MiMo`,providerId:`xiaomi`,config:{baseUrl:`https://api.xiaomimimo.com/v1`,api:`openai-completions`,apiKey:`XIAOMI_API_KEY`,models:[{id:`mimo-v2.5-pro`,name:`MiMo V2.5 Pro`,contextWindow:1e6,reasoning:!0,input:[`text`]},{id:`mimo-v2.5-pro-ultraspeed`,name:`MiMo V2.5 Pro UltraSpeed`,contextWindow:1e6,reasoning:!0,input:[`text`]},{id:`mimo-v2.5`,name:`MiMo V2.5`,contextWindow:1e6,reasoning:!0,input:[`text`,`image`]}]}},xiaomiTokenPlanCn:{label:`Xiaomi MiMo Token Plan China`,providerId:`xiaomi-token-plan-cn`,config:{baseUrl:`https://token-plan-cn.xiaomimimo.com/v1`,api:`openai-completions`,apiKey:`XIAOMI_TOKEN_PLAN_CN_API_KEY`,models:[{id:`mimo-v2.5-pro`,name:`MiMo V2.5 Pro`,contextWindow:1e6,reasoning:!0,input:[`text`]},{id:`mimo-v2.5-pro-ultraspeed`,name:`MiMo V2.5 Pro UltraSpeed`,contextWindow:1e6,reasoning:!0,input:[`text`]},{id:`mimo-v2.5`,name:`MiMo V2.5`,contextWindow:1e6,reasoning:!0,input:[`text`,`image`]}]}},xiaomiTokenPlanAms:{label:`Xiaomi MiMo Token Plan Amsterdam`,providerId:`xiaomi-token-plan-ams`,config:{baseUrl:`https://token-plan-ams.xiaomimimo.com/v1`,api:`openai-completions`,apiKey:`XIAOMI_TOKEN_PLAN_AMS_API_KEY`,models:[{id:`mimo-v2.5-pro`,name:`MiMo V2.5 Pro`,contextWindow:1e6,reasoning:!0,input:[`text`]},{id:`mimo-v2.5-pro-ultraspeed`,name:`MiMo V2.5 Pro UltraSpeed`,contextWindow:1e6,reasoning:!0,input:[`text`]},{id:`mimo-v2.5`,name:`MiMo V2.5`,contextWindow:1e6,reasoning:!0,input:[`text`,`image`]}]}},xiaomiTokenPlanSgp:{label:`Xiaomi MiMo Token Plan Singapore`,providerId:`xiaomi-token-plan-sgp`,config:{baseUrl:`https://token-plan-sgp.xiaomimimo.com/v1`,api:`openai-completions`,apiKey:`XIAOMI_TOKEN_PLAN_SGP_API_KEY`,models:[{id:`mimo-v2.5-pro`,name:`MiMo V2.5 Pro`,contextWindow:1e6,reasoning:!0,input:[`text`]},{id:`mimo-v2.5-pro-ultraspeed`,name:`MiMo V2.5 Pro UltraSpeed`,contextWindow:1e6,reasoning:!0,input:[`text`]},{id:`mimo-v2.5`,name:`MiMo V2.5`,contextWindow:1e6,reasoning:!0,input:[`text`,`image`]}]}},minimax:{label:`MiniMax`,providerId:`minimax`,description:`Anthropic-compatible endpoint preferred for agent workflows`,config:{baseUrl:`https://api.minimax.io/anthropic`,api:`anthropic-messages`,apiKey:`MINIMAX_API_KEY`,authHeader:!0,models:[{id:`MiniMax-M3`,name:`MiniMax M3`,contextWindow:1e6,reasoning:!0,input:[`text`,`image`]},{id:`MiniMax-M2.7-highspeed`,name:`MiniMax M2.7 Highspeed`,contextWindow:204800,input:[`text`]},{id:`MiniMax-M2.7`,name:`MiniMax M2.7`,contextWindow:204800,input:[`text`]}]}},zhipuCodingCn:{label:`Zhipu GLM Coding Plan China`,providerId:`zhipu-coding-cn`,config:{baseUrl:`https://open.bigmodel.cn/api/coding/paas/v4`,api:`openai-completions`,apiKey:`ZHIPU_API_KEY`,models:[{id:`glm-5.2`,name:`GLM 5.2`,contextWindow:1e6,maxTokens:65536,reasoning:!0,input:[`text`]}]}},zaiCodingGlobal:{label:`Zhipu GLM Coding Plan International`,providerId:`zai-coding-global`,config:{baseUrl:`https://api.z.ai/api/coding/paas/v4`,api:`openai-completions`,apiKey:`ZAI_API_KEY`,models:[{id:`glm-5.2`,name:`GLM 5.2`,contextWindow:1e6,maxTokens:65536,reasoning:!0,input:[`text`]}]}},minimaxCn:{label:`MiniMax China`,providerId:`minimax-cn`,config:{baseUrl:`https://api.minimaxi.com/anthropic`,api:`anthropic-messages`,apiKey:`MINIMAX_CN_API_KEY`,authHeader:!0,models:[{id:`MiniMax-M3`,name:`MiniMax M3`,contextWindow:1e6,reasoning:!0,input:[`text`,`image`]},{id:`MiniMax-M2.7-highspeed`,name:`MiniMax M2.7 Highspeed`,contextWindow:204800,input:[`text`]},{id:`MiniMax-M2.7`,name:`MiniMax M2.7`,contextWindow:204800,input:[`text`]}]}}},Te=Object.entries(Z).map(([e,t])=>({key:e,...t}));function Ee(e){return Z[e]?.providerId??e}function De(e){return Te.find(t=>t.providerId===e)?.key}var Oe=new Set([`dashscope-cn`,`dashscope-intl`,`volcengine-ark`,`volcengine-plan`,`byteplus-plan`,`stepfun-cn`,`stepfun-intl`,`stepfun-plan-cn`,`stepfun-plan-intl`,`zhipu-cn`,`zai-coding-global`,`zhipu-coding-cn`]);function ke(e){if(Oe.has(e))return De(e)}var Ae=[{value:`text`,labelKey:`inputTextOnly`},{value:`text,image`,labelKey:`inputTextVision`}];function je(){return v(`w-full rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg`,`placeholder:text-fg-subtle`,B,`dark:border-edge`)}function Me(){return v(z,R)}function Ne(e){return(e.input||[`text`]).includes(`image`)?`text,image`:`text`}function Pe(e){return e===`text,image`?[`text`,`image`]:[`text`]}var Q=r(),$={chat:[`对话与任务`,`Chat and tasks`],vision:[`看图`,`Image understanding`],image:[`画图`,`Image generation`],background:[`后台任务`,`Background tasks`],speech:[`语音合成`,`Speech synthesis`],transcription:[`录音识别`,`Recorded audio recognition`],conversation:[`实时语音对话`,`Realtime conversation`]};function Fe({providerId:e,row:t,modelIds:n,existingConnection:r=!1,targetUse:i,connectOnly:o=!1,language:d,alternatives:p=[],onChooseProvider:m,onBack:h,onDone:v,onApplied:y,inline:b=!1,onPendingChange:x}){let S=d===`zh`,C=(0,G.useRef)(!1),[E,O]=(0,G.useState)(null),[k,A]=(0,G.useState)({mode:i?`replace`:`fill`,modelIds:n}),[M,N]=(0,G.useState)(``),[ee,P]=(0,G.useState)(!1),[F,I]=(0,G.useState)(!1),[L,R]=(0,G.useState)(r||!!t?.configured),[z,B]=(0,G.useState)(!1),V=(0,G.useRef)(!1),[H,U]=(0,G.useState)(``),[W,ae]=(0,G.useState)(!1),[oe,K]=(0,G.useState)(0);(0,G.useEffect)(()=>{let t=!0;return fe(e,{modelIds:n,...o?{selected:[]}:{},...i&&!o?{mode:`replace`,selected:[i]}:{}}).then(e=>{t&&(O(e),R(e.configured),C.current||(C.current=!0,A({mode:i?`replace`:`fill`,modelIds:n,selected:o?[]:e.uses.filter(e=>e.selected).map(e=>e.id)})),U(``))}).catch(e=>{t&&U(e instanceof Error?e.message:String(e))}),()=>{t=!1}},[e,n,i,o,oe]),(0,G.useEffect)(()=>(x?.(z),()=>x?.(!1)),[z,x]);let q=k.selected??[],ce=e=>{A({...k,mode:e,selected:E?.uses.filter(t=>t.recommended&&t.choices.length&&(e===`replace`||t.selected)).map(e=>e.id)??[]})},ue=async()=>{if(!E||V.current)return;V.current=!0,B(!0),U(``),I(!1);let t=!1;try{M.trim()&&(await re({[e]:M.trim()}),t=!0,I(!0),R(!0),P(!1),N(``));let n=await fe(e,k);if(R(n.configured),o){if(!n.configured)throw Error(S?`请先连接此服务。`:`Connect this service first.`);O(n),ae(!0),y?.();return}let r=E.uses.filter(e=>q.includes(e.id)).map(e=>k.overrides?.[e.id]??e.recommended),i=n.uses.filter(e=>q.includes(e.id)).map(e=>k.overrides?.[e.id]??e.recommended);if(E.revision!==n.revision||JSON.stringify(r)!==JSON.stringify(i))throw O(n),A({...k,selected:n.uses.filter(e=>e.selected).map(e=>e.id)}),Error(S?`目录或当前配置已更新,请核对后再次应用。`:`The catalog or settings changed. Review the updated choices and apply again.`);if(!n.configured)throw Error(S?`请先连接此服务。`:`Connect this service first.`);await pe(e,k,n.revision),O(n),ae(!0),y?.()}catch(e){let n=e instanceof Error?e.message:String(e);U((!b&&t?S?`服务已保存,用途配置未完成。`:`Connection saved; model setup is incomplete. `:``)+n)}finally{V.current=!1,B(!1)}},J=E?.profile.name??t?.name??e,Y=E?.profile.apiKeyUrl??X[e]?.apiKeyUrl;if(b){let n=E?.uses.find(e=>e.id===i),r=i?k.overrides?.[i]??n?.recommended:void 0,a=se(e,J,S);return(0,Q.jsxs)(`div`,{className:`space-y-6 p-4 sm:p-5`,children:[(0,Q.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[(0,Q.jsx)(`h3`,{className:`text-base font-semibold text-fg`,children:a}),(0,Q.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:i?`${S?`用于`:`For `}${le[i][+!S]}`:``})]}),(0,Q.jsx)(w,{variant:`ghost`,disabled:z,onClick:v,children:S?`更换服务`:`Change service`})]}),!E&&!H?(0,Q.jsx)(T,{className:`h-48 w-full rounded-xl`}):null,E?(0,Q.jsxs)(Q.Fragment,{children:[E.profile.credential===`oauth`&&!L?(0,Q.jsx)(ie,{providerId:e,displayName:a,connected:L,onConnected:()=>{R(!0),K(e=>e+1)}}):null,E.profile.credential===`oauth`&&L&&!t?.supportsApiKey?(0,Q.jsxs)(`p`,{className:`flex items-center gap-2 rounded-xl bg-surface-inset px-4 py-3 text-sm text-fg`,children:[(0,Q.jsx)(l,{className:`size-4 text-fg-muted`,"aria-hidden":!0}),S?`使用已有连接`:`Using the existing connection`]}):null,E.profile.credential===`api-key`||E.profile.credential===`oauth`&&t?.supportsApiKey?(0,Q.jsx)(`div`,{className:`space-y-3`,children:L&&!ee?(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-xl bg-surface-inset px-4 py-3`,children:[(0,Q.jsxs)(`p`,{className:`flex items-center gap-2 text-sm text-fg`,children:[(0,Q.jsx)(l,{className:`size-4 text-fg-muted`,"aria-hidden":!0}),S?`使用已有连接`:`Using the existing connection`]}),(0,Q.jsx)(w,{variant:`ghost`,disabled:z,onClick:()=>P(!0),children:S?`更换`:`Change`})]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,Q.jsx)(`label`,{htmlFor:`provider-setup-key`,className:`text-sm font-medium text-fg`,children:E.profile.access===`subscription`?S?`订阅 API Key`:`Subscription API key`:`API Key`}),L?(0,Q.jsx)(w,{variant:`ghost`,disabled:z,onClick:()=>{P(!1),N(``)},children:S?`保留原 Key`:`Keep saved key`}):null]}),(0,Q.jsx)(u,{id:`provider-setup-key`,disabled:z,value:M,onChange:N,placeholder:L?S?`输入新的 API Key`:`Enter a new API key`:S?`粘贴 API Key`:`Paste your API key`,labels:te(_(d).providersSettings)}),L?(0,Q.jsx)(`p`,{className:`text-xs leading-relaxed text-fg-muted`,children:S?`此服务的其他已配置模型也会使用新的 Key。`:`Other models configured with this service will also use the new key.`}):null,Y?(0,Q.jsx)(`a`,{className:`inline-flex min-h-10 items-center text-sm text-accent-fg hover:underline`,href:Y,target:`_blank`,rel:`noopener noreferrer`,children:S?`获取 API Key`:`Get an API key`}):null]})}):null,n?(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[(0,Q.jsx)(`label`,{className:`block text-sm font-medium text-fg`,children:S?`选择模型`:`Model`}),(0,Q.jsx)(s,{value:r??``,disabled:z||!n.choices.length,"aria-label":S?`选择模型`:`Model`,onChange:e=>A({...k,selected:[n.id],overrides:{...k.overrides,[n.id]:e.target.value}}),children:n.choices.map(e=>(0,Q.jsx)(c,{value:e.id,children:e.name},e.id))})]}):null,(0,Q.jsxs)(`p`,{className:`text-sm leading-relaxed text-fg-muted`,children:[S?`只更改当前能力使用的模型。`:`Changes the model for this capability only.`,E.profile.interactiveOnly?S?` 后台任务继续使用原服务。`:` Background tasks keep their current service.`:``]})]}):null,H?(0,Q.jsxs)(`div`,{role:`alert`,className:`space-y-2 rounded-xl border border-edge p-3`,children:[(0,Q.jsx)(`p`,{className:`text-sm text-danger`,children:F?S?`连接信息已保存,模型尚未切换。请重试。`:`Connection saved. The model has not switched; please retry.`:S?`未能应用配置,请重试。`:`Could not apply settings. Please retry.`}),(0,Q.jsxs)(`details`,{className:`text-xs text-fg-muted`,children:[(0,Q.jsx)(`summary`,{className:`cursor-pointer`,children:S?`查看详情`:`Show details`}),(0,Q.jsx)(`p`,{className:`mt-2 break-words`,children:H})]})]}):null,(0,Q.jsx)(`div`,{className:`flex items-center justify-end gap-3 border-t border-edge-subtle pt-4`,children:(0,Q.jsxs)(w,{variant:`primary`,disabled:z||!E&&!H||!!E&&(!L&&!M.trim()||!r||!n?.choices.some(e=>e.id===r)),onClick:()=>{E?ue():K(e=>e+1)},children:[z?(0,Q.jsx)(f,{className:`size-4 animate-spin`,"aria-hidden":!0}):null,z?S?`正在应用…`:`Applying…`:!E&&H?S?`重新加载`:`Reload`:H?S?`重试`:`Retry`:L&&!M.trim()?S?`使用此模型`:`Use this model`:S?`连接并使用`:`Connect and use`]})})]})}let de=b?`h3`:j,me=b?`p`:D;return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-start gap-3 px-5 py-5`,children:[h&&!z&&!W?(0,Q.jsx)(w,{variant:`ghost`,className:`shrink-0 p-1.5`,"aria-label":S?`返回`:`Back`,onClick:h,children:(0,Q.jsx)(a,{className:`size-4`})}):null,(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(de,{className:`text-base font-semibold text-fg`,children:i?`${S?`连接服务 · `:`Connect service · `}${$[i][+!S]}`:S?`连接模型服务`:`Connect model service`}),(0,Q.jsx)(me,{className:`mt-2 text-sm text-fg-muted`,children:J})]}),(0,Q.jsx)(w,{variant:`ghost`,className:`shrink-0 p-1.5`,disabled:z,"aria-label":S?`关闭`:`Close`,onClick:v,children:(0,Q.jsx)(g,{className:`size-4`})})]}),(0,Q.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-4 overflow-y-auto px-5 pb-5`,children:[!E&&!H?(0,Q.jsx)(T,{className:`h-64 w-full rounded-xl`}):null,E?(0,Q.jsxs)(Q.Fragment,{children:[!W&&p.length>1&&m?(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`label`,{className:`mb-2 block text-xs text-fg-muted`,children:S?`接入方式 / 地域`:`Access method / region`}),(0,Q.jsx)(s,{value:e,disabled:z,"aria-label":S?`接入方式 / 地域`:`Access method / region`,onChange:e=>m(e.target.value),children:p.map(e=>(0,Q.jsx)(c,{value:e.id,children:e.setupProfile?.name??e.name},e.id))})]}):null,W?(0,Q.jsxs)(`p`,{role:`status`,className:`flex items-center gap-2 text-sm text-fg`,children:[(0,Q.jsx)(l,{className:`size-4`}),o?S?`服务连接已保存`:`Connection saved`:S?`所选用途配置已保存`:`Selected model uses saved`]}):(0,Q.jsxs)(Q.Fragment,{children:[E.profile.credential===`oauth`&&!L?(0,Q.jsx)(ie,{providerId:e,displayName:J,connected:L,onConnected:()=>{R(!0),K(e=>e+1)}}):null,(E.profile.credential===`api-key`||E.profile.credential===`oauth`&&t?.supportsApiKey)&&!r?(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[(0,Q.jsx)(`label`,{htmlFor:`provider-setup-key`,className:`text-sm font-medium text-fg`,children:E.profile.access===`subscription`?S?`套餐 API Key`:`Plan API key`:`API Key`}),(0,Q.jsx)(u,{id:`provider-setup-key`,disabled:z,value:M,onChange:N,placeholder:L?S?`留空使用已保存的凭据`:`Leave empty to use saved credentials`:`API Key`,labels:te(_(d).providersSettings)}),Y?(0,Q.jsx)(`a`,{className:`inline-flex min-h-8 items-center text-sm text-accent-fg hover:underline`,href:Y,target:`_blank`,rel:`noopener noreferrer`,children:S?`获取对应接入方式的 Key`:`Get a key for this access method`}):null]}):null,!o&&!b?(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,Q.jsx)(`span`,{className:`text-sm font-medium text-fg`,children:S?`模型用途`:`Model uses`}),(0,Q.jsx)(ne,{className:`flex gap-2`,indicatorClassName:`rounded-lg bg-surface-active`,children:[`fill`,`replace`].map(e=>(0,Q.jsx)(w,{variant:k.mode===e?`secondary`:`ghost`,disabled:z,"aria-pressed":k.mode===e,onClick:()=>ce(e),children:e===`fill`?S?`补齐未配置`:`Fill missing`:S?`改用此服务`:`Switch to this service`},e))})]}):(0,Q.jsx)(`p`,{className:`text-sm text-fg-muted`,children:b?S?`仅更新当前能力,其他模型和参数保持原设置。`:`Only this capability changes; other settings are preserved.`:S?`保存连接后返回能力设置,再选择要使用的模型。`:`Save the connection, then choose a model in capability settings.`})]}),o?(0,Q.jsxs)(`p`,{className:`text-xs text-fg-muted`,children:[S?`支持用途:`:`Supported uses: `,E.uses.filter(e=>e.choices.length&&(!i||e.id===i)).map(e=>$[e.id][+!S]).join(`、`)]}):null,o?null:(0,Q.jsx)(`div`,{className:`divide-y divide-edge rounded-xl border border-edge bg-surface-inset px-4`,children:E.uses.filter(e=>!b||!i||e.id===i).map(e=>{let t=k.overrides?.[e.id]??e.recommended,n=e.choices.find(e=>e.id===t);return(0,Q.jsxs)(`div`,{className:`space-y-2 py-3`,children:[(0,Q.jsxs)(`label`,{className:`flex min-h-10 items-start gap-3`,children:[(0,Q.jsx)(`input`,{hidden:b,type:`checkbox`,className:`ui-checkbox mt-1`,checked:q.includes(e.id),disabled:b||z||W||!t||!e.choices.length,onChange:t=>A({...k,selected:t.target.checked?[...q,e.id]:q.filter(t=>t!==e.id)})}),(0,Q.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:$[e.id][+!S]}),(0,Q.jsx)(`span`,{className:`mt-1 block break-all text-xs text-fg-muted`,children:q.includes(e.id)?`${e.current?`${e.current} → `:``}${n?.name??t??``}`:e.current?`${S?`保留:`:`Keep: `}${e.current}`:e.reason===`interactive_only`?S?`此套餐不用于后台任务`:`This plan is not used for background tasks`:n?.name??(S?`暂无可自动配置的模型`:`No automatic model selection available`)})]})]}),!W&&e.choices.length>1?(0,Q.jsxs)(`details`,{open:b||void 0,className:`pl-7`,children:[(0,Q.jsx)(`summary`,{className:`text-xs text-accent-fg`,children:S?`选择具体模型`:`Choose a model`}),(0,Q.jsx)(s,{value:t??``,disabled:z,"aria-label":$[e.id][+!S],onChange:t=>A({...k,selected:[...new Set([...q,e.id])],overrides:{...k.overrides,[e.id]:t.target.value}}),children:e.choices.map(e=>(0,Q.jsx)(c,{value:e.id,children:e.name},e.id))})]}):null]},e.id)})}),W?null:(0,Q.jsx)(w,{variant:`ghost`,disabled:z,onClick:()=>K(e=>e+1),children:S?`刷新目录`:`Refresh catalog`}),!o&&!b?(0,Q.jsxs)(`details`,{children:[(0,Q.jsx)(`summary`,{className:`text-xs text-accent-fg`,children:S?`任务模型与其他用途`:`Task models and other uses`}),(0,Q.jsxs)(`div`,{className:`mt-2 space-y-1 text-xs text-fg-muted`,children:[Object.entries(E.taskModels).map(([e,t])=>(0,Q.jsxs)(`p`,{children:[e,`: `,t]},e)),(0,Q.jsx)(`p`,{children:S?`未选用途与电脑操作保留当前配置;所选用途清除跨服务回退。`:`Unselected uses and Computer Use keep their settings. Selected uses clear cross-service fallbacks.`})]})]}):null,(0,Q.jsx)(`p`,{className:`text-xs leading-5 text-fg-muted`,children:E.profile.interactiveOnly?S?`此套餐仅用于交互任务。后台调用会检查使用范围,不会自动切换到其他收费来源。`:`This plan is for interactive tasks. Background calls check usage scope and do not automatically switch billing sources.`:S?`仅更新勾选的全局用途,智能体和会话的独立设置继续生效。`:`Only selected global uses change. Agent and session overrides remain effective.`}),(0,Q.jsx)(`p`,{className:`text-xs text-fg-muted`,children:S?`配置保存与模型真实调用验证分别显示;此操作不会发送测试请求。`:`Saving settings does not perform a model test request.`})]}):null,H?(0,Q.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:H}):null]}),(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-3 border-t border-edge px-5 py-4`,children:[(0,Q.jsx)(`span`,{className:`text-xs text-fg-muted`,children:E&&!W&&!o?S?`将配置 ${q.length} 项`:`${q.length} uses selected`:``}),W?(0,Q.jsx)(w,{onClick:v,children:S?`完成`:`Done`}):!E&&H?(0,Q.jsx)(w,{onClick:()=>K(e=>e+1),children:S?`重试`:`Retry`}):(0,Q.jsxs)(w,{onClick:()=>void ue(),disabled:z||!E||!L&&!M.trim()||b&&!q.some(e=>k.overrides?.[e]||E.uses.find(t=>t.id===e)?.recommended),children:[z?(0,Q.jsx)(f,{className:`mr-2 size-4 animate-spin`,"aria-hidden":!0}):null,z?S?`正在应用…`:`Applying…`:q.length?b&&i?`${S?`连接并用于`:`Connect and use for `}${$[i][+!S]}`:S?`连接并应用`:`Connect and apply`:S?`仅连接`:`Connect only`]})]})]})}function Ie(e){let t=(0,K.c)(7),{target:n,targetUse:r,zh:i,onDone:a,onApplied:o}=e,s=i?`zh`:`en`,c;return t[0]!==o||t[1]!==a||t[2]!==s||t[3]!==n.modelIds||t[4]!==n.providerId||t[5]!==r?(c=(0,Q.jsx)(Fe,{providerId:n.providerId,modelIds:n.modelIds,targetUse:r,language:s,existingConnection:!0,onDone:a,onApplied:o},n.providerId),t[0]=o,t[1]=a,t[2]=s,t[3]=n.modelIds,t[4]=n.providerId,t[5]=r,t[6]=c):c=t[6],c}function Le(e){let t=(0,K.c)(38),{open:n,initialProviderId:r,initialUse:i,connectOnly:a,onOpenChange:o,builtinRows:s,customConfig:c,labels:l,language:u,onSaved:d}=e,f=a!==void 0&&a,p;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(p={type:`pick`},t[0]=p):p=t[0];let[m,h]=(0,G.useState)(p),[g,_]=(0,G.useState)(``),y;t[1]!==r||t[2]!==m?(y=m.type===`pick`&&r?{type:`builtin`,providerId:r}:m,t[1]=r,t[2]=m,t[3]=y):y=t[3];let b=y,x=(0,G.useRef)(0),S;t[4]!==b.providerId||t[5]!==b.type||t[6]!==s?(S=b.type===`builtin`?s.find(e=>e.id===b.providerId)?.setupProfile?.brand:void 0,t[4]=b.providerId,t[5]=b.type,t[6]=s,t[7]=S):S=t[7];let C=S,w;t[8]===o?w=t[9]:(w=e=>{e||window.setTimeout(()=>{h({type:`pick`}),_(``),x.current=0},200),o(e)},t[8]=o,t[9]=w);let T=w,D;t[10]!==s||t[11]!==f||t[12]!==T||t[13]!==d?(D=(e,t)=>{let n=s.some(t=>t.id===e&&t.configured);f||t?.length===0||t===void 0&&n?(d(e),T(!1)):h({type:`success`,target:{providerId:e,modelIds:t}})},t[10]=s,t[11]=f,t[12]=T,t[13]=d,t[14]=D):D=t[14];let O=D,j;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,Q.jsx)(E,{className:v(`xopc-dialog-overlay fixed inset-0 bg-scrim`,ee)}),t[15]=j):j=t[15];let P;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(P=v(`xopc-dialog-content fixed left-1/2 top-1/2 flex h-[min(40rem,calc(100vh-3rem))] w-[min(40rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-2xl border border-edge bg-surface-overlay`,N),t[16]=P):P=t[16];let F;t[17]!==b.presetKey||t[18]!==b.providerId||t[19]!==b.target||t[20]!==b.type||t[21]!==s||t[22]!==f||t[23]!==c||t[24]!==T||t[25]!==O||t[26]!==r||t[27]!==i||t[28]!==l||t[29]!==u||t[30]!==d||t[31]!==g||t[32]!==C?(F=(0,Q.jsxs)(k,{children:[j,(0,Q.jsx)(A,{className:P,children:b.type===`success`?(0,Q.jsx)(Ie,{target:b.target,targetUse:i,zh:u===`zh`,onApplied:()=>d(b.target.providerId),onDone:()=>T(!1)}):b.type===`pick`?(0,Q.jsx)(ze,{builtinRows:s,searchQuery:g,onSearchChange:_,labels:l,language:u,scrollTopRef:x,onPickBuiltin:e=>{let t=ke(e);h(t?{type:`custom`,presetKey:t}:{type:`builtin`,providerId:e})},onPickCustom:()=>h({type:`custom`})}):b.type===`builtin`?(0,Q.jsx)(Fe,{providerId:b.providerId,targetUse:i,connectOnly:f,row:s.find(e=>e.id===b.providerId),language:u,alternatives:C?s.filter(e=>e.setupProfile?.brand===C):[],onChooseProvider:e=>{let t=ke(e);h(t?{type:`custom`,presetKey:t}:{type:`builtin`,providerId:e})},onBack:r?void 0:()=>h({type:`pick`}),onApplied:()=>{d(b.providerId),f&&T(!1)},onDone:()=>T(!1)},b.providerId):(0,Q.jsx)(Ge,{initialPresetKey:b.presetKey,customConfig:c,labels:l,language:u,onBack:()=>h({type:`pick`}),onSaved:O})})]}),t[17]=b.presetKey,t[18]=b.providerId,t[19]=b.target,t[20]=b.type,t[21]=s,t[22]=f,t[23]=c,t[24]=T,t[25]=O,t[26]=r,t[27]=i,t[28]=l,t[29]=u,t[30]=d,t[31]=g,t[32]=C,t[33]=F):F=t[33];let I;return t[34]!==T||t[35]!==n||t[36]!==F?(I=(0,Q.jsx)(M,{open:n,onOpenChange:T,children:F}),t[34]=T,t[35]=n,t[36]=F,t[37]=I):I=t[37],I}function Re(e){let t=(0,K.c)(4),{label:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=v(`rounded-lg p-1.5 text-fg-muted hover:bg-surface-hover hover:text-fg`,P.press),t[0]=r):r=t[0];let i;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Q.jsx)(g,{className:`size-4`,"aria-hidden":!0}),t[1]=i):i=t[1];let a;return t[2]===n?a=t[3]:(a=(0,Q.jsx)(O,{asChild:!0,children:(0,Q.jsx)(`button`,{type:`button`,className:r,"aria-label":n,children:i})}),t[2]=n,t[3]=a),a}function ze({builtinRows:e,searchQuery:t,onSearchChange:n,labels:r,language:i,scrollTopRef:a,onPickBuiltin:s,onPickCustom:c}){let l=t.trim().toLowerCase(),u=(0,G.useRef)(null);(0,G.useLayoutEffect)(()=>{let e=u.current;e&&a.current>0&&(e.scrollTop=a.current)},[a]);let f=(0,G.useMemo)(()=>l?e.filter(e=>{let t=X[e.id]?.aliases??[];return e.id.toLowerCase().includes(l)||e.name.toLowerCase().includes(l)||t.some(e=>e.toLowerCase().includes(l))}):e,[e,l]),p=(0,G.useMemo)(()=>{let e=new Set;return f.filter(t=>{let n=t.setupProfile?.brand??t.id;return e.has(n)?!1:(e.add(n),!0)})},[f]),h=p.filter(e=>e.onboardingFeatured&&[`subscription`,`account`].includes(e.setupProfile?.access??``)).slice(0,6),g=h.map(e=>e.id),_=p.filter(e=>e.configured&&!g.includes(e.id)),y=(0,G.useMemo)(()=>_e(p.filter(e=>!g.includes(e.id)&&!e.configured)),[p,g]),b=e=>{let t=X[e.id];return i===`zh`?t?.descriptionZh??t?.description:t?.description};return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`div`,{className:`flex items-start justify-between gap-4 px-5 pb-3 pt-5`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(j,{className:`text-base font-semibold text-fg`,children:r.step1Title}),(0,Q.jsx)(D,{className:`mt-1 text-sm text-fg-muted`,children:r.step1Subtitle})]}),(0,Q.jsx)(Re,{label:r.close})]}),(0,Q.jsx)(`div`,{className:`px-5 pb-3`,children:(0,Q.jsxs)(`div`,{className:`relative`,children:[(0,Q.jsx)(m,{className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-fg-subtle`,strokeWidth:1.75,"aria-hidden":!0}),(0,Q.jsx)(`input`,{type:`search`,value:t,onChange:e=>n(e.target.value),placeholder:r.searchPlaceholder,autoComplete:`off`,className:v(`h-10 w-full rounded-xl border border-edge bg-surface-base py-2 pl-10 pr-3 text-sm text-fg placeholder:text-fg-subtle`,B)})]})}),(0,Q.jsx)(`div`,{ref:u,onScroll:e=>{a.current=e.currentTarget.scrollTop},className:`min-h-0 flex-1 overscroll-contain overflow-y-auto px-5 pb-5`,children:l&&p.length===0?(0,Q.jsx)(`p`,{className:`py-6 text-center text-sm text-fg-muted`,children:r.noResults}):l?(0,Q.jsx)(Be,{title:r.searchResults,children:p.map(e=>(0,Q.jsx)(Ve,{row:e,description:b(e),labels:r,onPick:s},e.id))}):(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[h.length>0?(0,Q.jsx)(Be,{title:r.quickStart,children:h.map(e=>(0,Q.jsx)(Ve,{row:e,description:b(e),labels:r,prominent:!0,onPick:s},e.id))}):null,_.length>0?(0,Q.jsx)(Be,{title:r.connectedSection,children:_.map(e=>(0,Q.jsx)(Ve,{row:e,description:b(e),labels:r,onPick:s},e.id))}):null,ge.map(e=>{let t=y.get(e)??[];return t.length===0?null:(0,Q.jsx)(Be,{title:r.categories[e]??e,children:t.map(e=>(0,Q.jsx)(Ve,{row:e,description:b(e),labels:r,onPick:s},e.id))},e)}),(0,Q.jsxs)(`button`,{type:`button`,onClick:c,className:v(`flex w-full items-center gap-3 rounded-xl bg-surface-hover/25 px-4 py-3 text-left transition-colors`,`hover:bg-surface-hover/55 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`),children:[(0,Q.jsx)(`span`,{className:`flex size-9 shrink-0 items-center justify-center rounded-lg bg-surface-base/60 text-fg-muted`,children:(0,Q.jsx)(d,{className:`size-4`,strokeWidth:1.75,"aria-hidden":!0})}),(0,Q.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:r.addCustom}),(0,Q.jsx)(`span`,{className:`mt-0.5 block text-xs text-fg-muted`,children:r.customDescription})]}),(0,Q.jsx)(o,{className:`size-4 shrink-0 text-fg-subtle`,"aria-hidden":!0})]})]})})]})}function Be(e){let t=(0,K.c)(7),{title:n,children:r}=e,i;t[0]===n?i=t[1]:(i=(0,Q.jsx)(`h3`,{className:`mb-1.5 px-1 text-xs font-semibold text-fg-muted`,children:n}),t[0]=n,t[1]=i);let a;t[2]===r?a=t[3]:(a=(0,Q.jsx)(`div`,{className:`flex flex-col gap-1 rounded-xl bg-surface-hover/20 p-1`,children:r}),t[2]=r,t[3]=a);let o;return t[4]!==i||t[5]!==a?(o=(0,Q.jsxs)(`section`,{children:[i,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6],o}function Ve(e){let t=(0,K.c)(27),{row:n,description:r,labels:i,prominent:a,onPick:s}=e,c=a!==void 0&&a,u;t[0]!==s||t[1]!==n.id?(u=()=>s(n.id),t[0]=s,t[1]=n.id,t[2]=u):u=t[2];let d=c&&`bg-surface-base/80`,f;t[3]===d?f=t[4]:(f=v(`flex min-h-12 w-full items-center gap-3 rounded-lg bg-surface-base/55 px-3 py-2.5 text-left transition-colors`,`hover:bg-surface-base focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,d),t[3]=d,t[4]=f);let p;t[5]===n.name?p=t[6]:(p=(0,Q.jsx)(`span`,{className:`truncate text-sm font-medium text-fg`,children:n.name}),t[5]=n.name,t[6]=p);let m;t[7]!==i||t[8]!==c?(m=c?(0,Q.jsx)(`span`,{className:`shrink-0 rounded-full bg-accent-soft px-2 py-0.5 text-[11px] font-medium text-accent-fg`,children:i.recommended}):null,t[7]=i,t[8]=c,t[9]=m):m=t[9];let h;t[10]!==p||t[11]!==m?(h=(0,Q.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[p,m]}),t[10]=p,t[11]=m,t[12]=h):h=t[12];let g;t[13]===r?g=t[14]:(g=r?(0,Q.jsx)(`span`,{className:`mt-0.5 block truncate text-xs text-fg-muted`,children:r}):null,t[13]=r,t[14]=g);let _;t[15]!==h||t[16]!==g?(_=(0,Q.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[h,g]}),t[15]=h,t[16]=g,t[17]=_):_=t[17];let y;t[18]!==i||t[19]!==n.configured?(y=n.configured?(0,Q.jsxs)(`span`,{className:`inline-flex shrink-0 items-center gap-1 rounded-full bg-emerald-500/10 px-2 py-1 text-[11px] font-medium text-emerald-700 dark:text-emerald-300`,children:[(0,Q.jsx)(l,{className:`size-3.5`,"aria-hidden":!0}),i.connected]}):null,t[18]=i,t[19]=n.configured,t[20]=y):y=t[20];let b;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,Q.jsx)(o,{className:`size-4 shrink-0 text-fg-subtle`,"aria-hidden":!0}),t[21]=b):b=t[21];let x;return t[22]!==y||t[23]!==u||t[24]!==f||t[25]!==_?(x=(0,Q.jsxs)(`button`,{type:`button`,onClick:u,className:f,children:[_,y,b]}),t[22]=y,t[23]=u,t[24]=f,t[25]=_,t[26]=x):x=t[26],x}function He(e){return{clientKey:crypto.randomUUID(),value:e}}function Ue(e=`custom`){if(e!==`custom`&&Z[e]){let t=Z[e].config;return{preset:e,providerId:Ee(e),baseUrl:t.baseUrl??``,api:t.api??`openai-completions`,apiKey:t.apiKey??``,modelSlots:(t.models?.map(e=>e.id)??[``]).map(He),error:null}}return{preset:`custom`,providerId:``,baseUrl:``,api:`openai-completions`,apiKey:``,modelSlots:[He(``)],error:null}}function We(e,t){switch(t.type){case`applyPreset`:return t.key===`custom`?{...e,preset:`custom`,error:null}:Z[t.key]?Ue(t.key):e;case`setProviderId`:return{...e,providerId:t.value};case`setBaseUrl`:return{...e,baseUrl:t.value};case`setApi`:return{...e,api:t.value};case`setApiKey`:return{...e,apiKey:t.value};case`addModelSlot`:return{...e,modelSlots:[...e.modelSlots,He(``)]};case`updateModelId`:return{...e,modelSlots:e.modelSlots.map((e,n)=>n===t.index?{...e,value:t.value}:e)};case`setModelIds`:return{...e,modelSlots:(t.values.length>0?t.values:[``]).map(He)};case`removeModelSlot`:return{...e,modelSlots:e.modelSlots.filter((e,n)=>n!==t.index)};case`setError`:return{...e,error:t.value}}}function Ge({initialPresetKey:e,customConfig:t,labels:n,language:r,onBack:i,onSaved:a}){let[l,d]=(0,G.useReducer)(We,void 0,()=>Ue(e)),[h,y]=(0,G.useState)(!1),[b,x]=(0,G.useState)(!1),S=te(_(r).providersSettings),{preset:C,providerId:T,baseUrl:E,api:D,apiKey:O,modelSlots:k,error:A}=l,M=k.map(e=>e.value),N=async()=>{let e=T.trim(),r=E.trim();if(!e){d({type:`setError`,value:n.providerIdRequired});return}if(!r){d({type:`setError`,value:n.baseUrlRequired});return}let i=M.map(e=>e.trim()).filter(Boolean);y(!0),d({type:`setError`,value:null});try{let n=t?.providers??{},o=C===`custom`?void 0:Z[C]?.config,s={...o??{},baseUrl:r,api:D,apiKey:O.trim()||void 0,models:i.map(e=>o?.models?.find(t=>t.id===e)??{id:e})};await Se({providers:{...n,[e]:s}});let c=new Set(n[e]?.models?.map(e=>e.id)??[]);a(e,s.models?.filter(e=>!c.has(e.id)&&!e.computerUse).map(e=>e.id)??[])}catch(e){d({type:`setError`,value:e instanceof Error?e.message:n.saveError})}finally{y(!1)}},ee=async()=>{let e=T.trim()||Ee(C)||`custom`,t=E.trim();if(!t){d({type:`setError`,value:n.baseUrlRequired});return}x(!0),d({type:`setError`,value:null});try{let r=C===`custom`?void 0:Z[C]?.config,i=(await Ce({providerId:e,baseUrl:t,apiKey:O.trim()||void 0,api:D,headers:r?.headers})).map(e=>e.id).filter(e=>e&&!e.includes(`/`));d({type:`setModelIds`,values:i}),i.length===0&&d({type:`setError`,value:n.discoverModelsHint})}catch(e){d({type:`setError`,value:e instanceof Error?e.message:n.discoverModelsHint})}finally{x(!1)}},F=T.trim()&&E.trim(),I=(D===`openai-completions`||D===`openai-responses`)&&E.trim();return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 px-5 pb-3 pt-5`,children:[(0,Q.jsx)(`button`,{type:`button`,onClick:i,className:v(`rounded-lg p-1.5 text-fg-muted hover:bg-surface-hover hover:text-fg`,P.press),"aria-label":n.back,children:(0,Q.jsx)(o,{className:`size-4 rotate-180`,"aria-hidden":!0})}),(0,Q.jsx)(j,{className:`min-w-0 flex-1 text-base font-semibold text-fg`,children:n.step2CustomTitle}),(0,Q.jsx)(Re,{label:n.close})]}),(0,Q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-5 pb-4`,children:(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4 rounded-xl bg-surface-hover/20 p-4`,children:[(0,Q.jsx)(`p`,{className:`text-sm text-fg-muted`,children:n.customDescription}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,Q.jsx)(`label`,{htmlFor:`custom-preset`,className:`text-sm font-medium text-fg`,children:n.presetLabel}),(0,Q.jsxs)(s,{id:`custom-preset`,value:C,onChange:e=>d({type:`applyPreset`,key:e.target.value}),className:Me(),children:[(0,Q.jsx)(c,{value:`custom`,children:n.presetCustom}),Te.map(e=>(0,Q.jsx)(c,{value:e.key,children:e.label},e.key))]})]}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,Q.jsx)(`label`,{htmlFor:`custom-provider-id`,className:`text-sm font-medium text-fg`,children:n.providerIdLabel}),(0,Q.jsx)(`input`,{id:`custom-provider-id`,type:`text`,autoComplete:`off`,value:T,onChange:e=>d({type:`setProviderId`,value:e.target.value}),placeholder:n.providerIdPlaceholder,className:v(`rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg placeholder:text-fg-subtle`,B)})]}),(0,Q.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,Q.jsx)(`label`,{htmlFor:`custom-base-url`,className:`text-sm font-medium text-fg`,children:n.baseUrlLabel}),(0,Q.jsx)(`input`,{id:`custom-base-url`,type:`url`,autoComplete:`off`,value:E,onChange:e=>d({type:`setBaseUrl`,value:e.target.value}),placeholder:n.baseUrlPlaceholder,className:v(`rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg placeholder:text-fg-subtle`,B)})]}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,Q.jsx)(`label`,{htmlFor:`custom-api-type`,className:`text-sm font-medium text-fg`,children:n.apiTypeLabel}),(0,Q.jsx)(s,{id:`custom-api-type`,value:D,onChange:e=>d({type:`setApi`,value:e.target.value}),className:Me(),children:ve.map(e=>(0,Q.jsx)(c,{value:e.value,children:e.label},e.value))})]})]}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,Q.jsx)(`label`,{htmlFor:`custom-api-key`,className:`text-sm font-medium text-fg`,children:n.apiKeyLabel}),(0,Q.jsx)(u,{id:`custom-api-key`,value:O,onChange:e=>d({type:`setApiKey`,value:e}),placeholder:n.apiKeyPlaceholder,labels:S})]}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,Q.jsx)(`span`,{className:`text-sm font-medium text-fg`,children:n.modelIdLabel}),(0,Q.jsxs)(w,{type:`button`,variant:`secondary`,className:`gap-1.5`,disabled:!I||b,onClick:()=>void ee(),children:[b?(0,Q.jsx)(f,{className:`size-3.5 animate-spin`,"aria-hidden":!0}):(0,Q.jsx)(m,{className:`size-3.5`,"aria-hidden":!0}),b?n.discoveringModels:n.discoverModels]})]}),M.map((e,t)=>(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(`input`,{type:`text`,autoComplete:`off`,value:e,onChange:e=>d({type:`updateModelId`,index:t,value:e.target.value}),placeholder:n.modelIdPlaceholder,className:v(`flex-1 rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg placeholder:text-fg-subtle`,B)}),M.length>1?(0,Q.jsx)(`button`,{type:`button`,onClick:()=>d({type:`removeModelSlot`,index:t}),className:v(`rounded-lg p-1.5 text-fg-subtle hover:bg-surface-hover hover:text-fg`,P.press),children:(0,Q.jsx)(g,{className:`size-3.5`,"aria-hidden":!0})}):null]},k[t].clientKey)),(0,Q.jsxs)(w,{type:`button`,variant:`ghost`,className:`w-fit gap-1.5 text-fg-muted`,onClick:()=>d({type:`addModelSlot`}),children:[(0,Q.jsx)(p,{className:`size-3.5`,"aria-hidden":!0}),n.addModel]})]}),A?(0,Q.jsx)(`p`,{className:`text-sm text-red-600 dark:text-red-400`,children:A}):null]})}),(0,Q.jsxs)(`div`,{className:`flex items-center justify-end gap-2 bg-surface-hover/15 px-5 py-3`,children:[(0,Q.jsx)(w,{type:`button`,variant:`secondary`,onClick:i,children:n.cancel}),(0,Q.jsx)(w,{type:`button`,variant:`primary`,disabled:!F||h,onClick:()=>void N(),children:h?(0,Q.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,Q.jsx)(f,{className:`size-3.5 animate-spin`,"aria-hidden":!0}),n.saving]}):n.save})]})]})}function Ke(){let e=(0,K.c)(29),t=!!x(Qe),{data:n,isLoading:r}=F(t),i;e[0]===t?i=e[1]:(i=t?b(`/api/providers/meta`):null,e[0]=t,e[1]=i);let a;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(a={revalidateOnFocus:!1},e[2]=a):a=e[2];let{data:o,isLoading:s}=C(i,Ze,a),c;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(c={revalidateOnFocus:!1},e[3]=c):c=e[3];let{data:l,isLoading:u}=C(t?L:null,Xe,c),d;e[4]===l?d=e[5]:(d=l===void 0?[]:l,e[4]=l,e[5]=d);let f=d,p;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(p={revalidateOnFocus:!1},e[6]=p):p=e[6];let{data:m}=C(t?H:null,Ye,p),h;bb0:{if(!o||n===void 0){let t;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(t=[],e[7]=t):t=e[7],h=t;break bb0}let t;e[8]!==n?.payload?.config||e[9]!==o||e[10]!==f?(t=U(o,W(n?.payload?.config),f),e[8]=n?.payload?.config,e[9]=o,e[10]=f,e[11]=t):t=e[11],h=t}let g=h,_;bb1:{if(!m){_=null;break bb1}let t;e[12]===m.config?t=e[13]:(t=be(m.config),e[12]=m.config,e[13]=t),_=t}let v=_,y;if(e[14]!==g||e[15]!==v||e[16]!==o||e[17]!==f){y=[];let t=new Set((o??[]).filter(Je).map(qe)),n;e[19]===v?n=e[20]:(n=new Set(v?Object.keys(v.providers):[]),e[19]=v,e[20]=n);let r=n;for(let e of g){if(!t.has(e.id))continue;let n=r.has(e.id),i=n?v.providers[e.id]?.models?.length??0:f.filter(t=>t.provider===e.id).length;y.push({id:e.id,name:e.name,configured:!0,isCustom:n,modelCount:i})}if(v){let t;e[21]===v.providers?t=e[22]:(t=Object.entries(v.providers),e[21]=v.providers,e[22]=t);for(let[e,n]of t)y.some(t=>t.id===e)||y.push({id:e,name:e,configured:!0,isCustom:!0,modelCount:n.models?.length??0})}e[14]=g,e[15]=v,e[16]=o,e[17]=f,e[18]=y}else y=e[18];let S=y,w=r||s||u,T;return e[23]!==g||e[24]!==S||e[25]!==v||e[26]!==w||e[27]!==f?(T={cards:S,loading:w,builtinRows:g,customConfig:v,allModels:f},e[23]=g,e[24]=S,e[25]=v,e[26]=w,e[27]=f,e[28]=T):T=e[28],T}function qe(e){return e.id}function Je(e){return e.configured}function Ye(){return xe()}function Xe(){return I()}async function Ze(e){let{payload:t}=await(await fetch(e,{credentials:`same-origin`,redirect:`error`})).json();return t?.providers??[]}function Qe(e){return e.conversationId}function $e(e){let t=(0,K.c)(12),{labels:n,data:r,onAdd:i,onManage:a}=e,{cards:o,loading:s}=r;if(s){let e;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsx)(T,{className:`h-6 w-48 max-w-full`}),t[0]=e):e=t[0];let n;return t[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Q.jsxs)(`div`,{className:`flex flex-col gap-3`,"aria-busy":`true`,children:[e,(0,Q.jsx)(`div`,{className:`flex flex-col gap-1`,children:[1,2,3].map(tt)})]}),t[1]=n):n=t[1],n}let c;if(t[2]!==o||t[3]!==n||t[4]!==i||t[5]!==a){let e=o.filter(et),r=e.length>0?n.titleCount.replace(`{{count}}`,String(e.length)):n.title,s;t[7]===r?s=t[8]:(s=(0,Q.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:r}),t[7]=r,t[8]=s);let l=e.length>0?(0,Q.jsxs)(w,{type:`button`,variant:`primary`,className:`gap-1.5`,onClick:i,children:[(0,Q.jsx)(p,{className:`size-3.5`,strokeWidth:2,"aria-hidden":!0}),n.addProvider]}):null,u;t[9]!==s||t[10]!==l?(u=(0,Q.jsxs)(`div`,{className:`flex items-center justify-between`,children:[s,l]}),t[9]=s,t[10]=l,t[11]=u):u=t[11],c=(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[u,e.length===0?(0,Q.jsxs)(`div`,{className:`rounded-xl bg-surface-hover/25 px-6 py-10 text-center`,children:[(0,Q.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:n.empty}),(0,Q.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:n.emptyHint}),(0,Q.jsxs)(w,{type:`button`,variant:`primary`,className:`mt-4 gap-1.5`,onClick:i,children:[(0,Q.jsx)(p,{className:`size-3.5`,strokeWidth:2,"aria-hidden":!0}),n.addProvider]})]}):(0,Q.jsx)(`div`,{className:`flex flex-col gap-1 rounded-xl bg-surface-hover/20 p-1`,children:e.map(e=>(0,Q.jsx)(nt,{card:e,labels:n,onManage:()=>a(e.id,e.isCustom)},e.id))})]}),t[2]=o,t[3]=n,t[4]=i,t[5]=a,t[6]=c}else c=t[6];return c}function et(e){return e.configured}function tt(e){return(0,Q.jsx)(T,{className:`h-16 rounded-lg`},e)}function nt(e){let t=(0,K.c)(26),{card:n,labels:r,onManage:i}=e,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=v(`group relative flex min-h-16 w-full flex-col justify-center gap-2 rounded-lg bg-surface-base/45 px-3 py-3 text-left transition-colors sm:flex-row sm:items-center sm:gap-4`,`hover:bg-surface-hover/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,P.pressCard),t[0]=a):a=t[0];let o;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Q.jsx)(l,{className:`size-4 shrink-0 text-emerald-600 dark:text-emerald-400`,"aria-hidden":!0}),t[1]=o):o=t[1];let s;t[2]===n.name?s=t[3]:(s=(0,Q.jsx)(`span`,{className:`min-w-0 text-sm font-semibold leading-snug text-fg`,children:n.name}),t[2]=n.name,t[3]=s);let c;t[4]!==n.isCustom||t[5]!==r.custom?(c=n.isCustom?(0,Q.jsx)(`span`,{className:`shrink-0 rounded bg-surface-hover px-1.5 py-0.5 text-[10px] font-medium text-fg-subtle`,children:r.custom}):null,t[4]=n.isCustom,t[5]=r.custom,t[6]=c):c=t[6];let u;t[7]!==s||t[8]!==c?(u=(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-2`,children:[o,s,c]}),t[7]=s,t[8]=c,t[9]=u):u=t[9];let d;t[10]!==n.modelCount||t[11]!==r.modelsCount||t[12]!==r.noModels?(d=n.modelCount>0?r.modelsCount.replace(`{{count}}`,String(n.modelCount)):r.noModels,t[10]=n.modelCount,t[11]=r.modelsCount,t[12]=r.noModels,t[13]=d):d=t[13];let f;t[14]===d?f=t[15]:(f=(0,Q.jsx)(`span`,{className:`whitespace-nowrap text-xs text-fg-subtle`,children:d}),t[14]=d,t[15]=f);let p;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Q.jsx)(h,{className:`size-3`,"aria-hidden":!0}),t[16]=p):p=t[16];let m;t[17]===r.manage?m=t[18]:(m=(0,Q.jsxs)(`span`,{className:`flex items-center gap-1 text-xs font-medium text-accent-fg`,children:[p,r.manage]}),t[17]=r.manage,t[18]=m);let g;t[19]!==f||t[20]!==m?(g=(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-4 pl-6 sm:justify-end sm:pl-0`,children:[f,m]}),t[19]=f,t[20]=m,t[21]=g):g=t[21];let _;return t[22]!==i||t[23]!==g||t[24]!==u?(_=(0,Q.jsxs)(`button`,{type:`button`,onClick:i,className:a,children:[u,g]}),t[22]=i,t[23]=g,t[24]=u,t[25]=_):_=t[25],_}export{ue as C,oe as D,se as E,ae as O,J as S,q as T,pe as _,Fe as a,ce as b,Pe as c,Me as d,we as f,me as g,he as h,Ie as i,ke as l,X as m,Ke as n,Ae as o,Se as p,Le as r,je as s,$e as t,Ne as u,de as v,Y as w,le as x,fe as y};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./createLucideIcon-DPHK1VkS.js";var t=e(`clipboard-paste`,[[`path`,{d:`M11 14h10`,key:`1w8e9d`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v1.344`,key:`1e62lh`}],[`path`,{d:`m17 18 4-4-4-4`,key:`z2g111`}],[`path`,{d:`M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 1.793-1.113`,key:`bjbb7m`}],[`rect`,{x:`8`,y:`2`,width:`8`,height:`4`,rx:`1`,key:`ublpy`}]]);function n(e){return!(e.runtime.type===`composio`&&e.runtime.role===`credential`)}function r(e,t){let n=t.trim().toLowerCase();return!n||[e.displayName,e.description,e.category,e.kind,e.source,...e.tags??[]].some(e=>e.toLowerCase().includes(n))}function i(e,t,n){return e.filter(e=>r(e,t)).toSorted((e,t)=>n===`source`&&e.source!==t.source?e.source.localeCompare(t.source):e.displayName.localeCompare(t.displayName))}function a(e,t){let n=t.trim().toLowerCase();return!n||[e.displayName,e.connectorId,e.instanceId,e.status,e.connectionStatus??``,e.materialized.type,e.materialized.type===`mcp`?e.materialized.serverId:e.materialized.id].some(e=>e.toLowerCase().includes(n))}function o(e,t){let n=t.trim().toLowerCase();return!n||[e.displayName??``,e.id,e.command??``,e.url??``,e.transport].some(e=>e.toLowerCase().includes(n))}export{t as a,n as i,i as n,a as r,o as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e,n as t}from"./rolldown-runtime-aKtaBQYM.js";import{a as n,n as r,t as i}from"./vendor-react-BOUWij0V.js";import{t as a}from"./chunk-KS7C4IRE-CiwuuyV8.js";import{t as o}from"./secret-input-BQvFXqzz.js";import{t as s}from"./settings-uiTATseT.js";import{t as c}from"./x-B_N4OPjy.js";import{t as l}from"./messages-DRR9N3HC.js";import{n as u}from"./locale-store-lIXD1FMw.js";import{i as d}from"./vendor-swr-CdRzEUwF.js";import{t as f}from"./button-CnRSIP6m.js";import{t as p}from"./skeleton-BI5TyibZ.js";import{a as m,c as h,i as g,n as _,o as v,r as y,s as b,t as x}from"./dist-DfWfZ9iu.js";import{C as S,D as C,f as w,t as T}from"./connectors-api-DIBG72k4.js";import{t as E}from"./confirm-dialog-XGclfBqe.js";import{t as D}from"./oauth-provider-connect-H81se_3n.js";var O=t({ConnectorServiceDialog:()=>I,ConnectorServicePage:()=>M}),k=r(),A=e(n(),1),j=i();function M(){let e=(0,k.c)(11),t=u(N),n;e[0]===t?n=e[1]:(n=l(t),e[0]=t,e[1]=n);let r=n.connectorsSettings,i=t===`zh`,o;e[2]===r.title?o=e[3]:(o=(0,j.jsx)(a,{to:`/capabilities/connectors`,className:`text-sm text-accent-fg`,children:r.title}),e[2]=r.title,e[3]=o);let s=i?`应用连接服务`:`App connection service`,c;e[4]===s?c=e[5]:(c=(0,j.jsx)(`h1`,{className:`text-xl font-semibold`,children:s}),e[4]=s,e[5]=c);let d,f;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,j.jsx)(`p`,{className:`text-sm text-fg-muted`,children:(0,j.jsx)(P,{})}),f=(0,j.jsx)(R,{}),e[6]=d,e[7]=f):(d=e[6],f=e[7]);let p;return e[8]!==o||e[9]!==c?(p=(0,j.jsxs)(`main`,{className:`mx-auto w-full max-w-2xl space-y-6 p-6`,children:[o,c,d,f]}),e[8]=o,e[9]=c,e[10]=p):p=e[10],p}function N(e){return e.language}function P(){let e=(0,k.c)(2),t=u(F)===`zh`?`此设置决定新账号通过哪个服务连接。已有账号继续使用其原来的连接服务。`:`Choose the service for new accounts. Existing accounts keep their original service.`,n;return e[0]===t?n=e[1]:(n=(0,j.jsx)(j.Fragment,{children:t}),e[0]=t,e[1]=n),n}function F(e){return e.language}function I(e){let t=(0,k.c)(27),n;t[0]===e?n=t[1]:(n=e===void 0?{}:e,t[0]=e,t[1]=n);let{open:r,onOpenChange:i,hideTrigger:a}=n,o=a!==void 0&&a,d=u(L),p;t[2]===d?p=t[3]:(p=l(d),t[2]=d,t[3]=p);let S=p.connectorsSettings,C=d===`zh`,w;t[4]!==o||t[5]!==C?(w=o?null:(0,j.jsx)(h,{asChild:!0,children:(0,j.jsxs)(f,{type:`button`,variant:`secondary`,className:`shrink-0`,"aria-label":C?`应用连接服务`:`Connection service`,children:[(0,j.jsx)(s,{className:`size-4`,"aria-hidden":!0}),(0,j.jsx)(`span`,{className:`hidden sm:inline`,children:C?`应用连接服务`:`Connection service`})]})}),t[4]=o,t[5]=C,t[6]=w):w=t[6];let T;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,j.jsx)(m,{className:`xopc-dialog-overlay fixed inset-0 z-[60] bg-scrim`}),t[7]=T):T=t[7];let E=C?`应用连接服务`:`App connection service`,D;t[8]===E?D=t[9]:(D=(0,j.jsx)(b,{className:`text-base font-semibold text-fg`,children:E}),t[8]=E,t[9]=D);let O;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,j.jsx)(g,{className:`mt-1 text-sm text-fg-muted`,children:(0,j.jsx)(P,{})}),t[10]=O):O=t[10];let A;t[11]===D?A=t[12]:(A=(0,j.jsxs)(`div`,{className:`min-w-0`,children:[D,O]}),t[11]=D,t[12]=A);let M;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,j.jsx)(c,{className:`size-5`,"aria-hidden":!0}),t[13]=M):M=t[13];let N;t[14]===S.modalClose?N=t[15]:(N=(0,j.jsx)(_,{asChild:!0,children:(0,j.jsx)(f,{variant:`ghost`,className:`shrink-0 p-1.5`,"aria-label":S.modalClose,children:M})}),t[14]=S.modalClose,t[15]=N);let F;t[16]!==N||t[17]!==A?(F=(0,j.jsxs)(`div`,{className:`flex shrink-0 items-start justify-between gap-3 border-b border-edge-subtle px-6 py-5`,children:[A,N]}),t[16]=N,t[17]=A,t[18]=F):F=t[18];let I;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,j.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-6 py-5`,children:(0,j.jsx)(R,{})}),t[19]=I):I=t[19];let z;t[20]===F?z=t[21]:(z=(0,j.jsxs)(v,{children:[T,(0,j.jsxs)(y,{className:`xopc-dialog-content fixed left-1/2 top-1/2 z-[60] flex h-[min(100dvh-2rem,42rem)] w-[min(100%-2rem,42rem)] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-2xl border border-edge bg-surface-overlay shadow-float`,children:[F,I]})]}),t[20]=F,t[21]=z);let B;return t[22]!==i||t[23]!==r||t[24]!==z||t[25]!==w?(B=(0,j.jsxs)(x,{open:r,onOpenChange:i,children:[w,z]}),t[22]=i,t[23]=r,t[24]=z,t[25]=w,t[26]=B):B=t[26],B}function L(e){return e.language}function R(){let e=u(e=>e.language),t=l(e).connectorsSettings,n=e===`zh`,{data:r,error:i,mutate:a}=d(`connector-service`,w),[s,c]=(0,A.useState)(``),[m,h]=(0,A.useState)(!1),[g,_]=(0,A.useState)(),[v,y]=(0,A.useState)();async function b(e){h(!0),_(void 0);try{await e(),c(``),await a()}catch(e){_(e instanceof Error?e.message:String(e))}finally{h(!1)}}return(0,j.jsxs)(`div`,{className:`space-y-6`,children:[!r&&!i?(0,j.jsx)(p,{className:`h-40 w-full`}):null,r?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`section`,{className:`space-y-3 rounded-xl border border-edge p-4`,children:[(0,j.jsx)(`h2`,{className:`font-medium`,children:`XOPC Cloud`}),(0,j.jsx)(`p`,{className:`text-sm text-fg-muted`,children:t.composioSetupHint}),(0,j.jsx)(D,{providerId:`xopc-cloud`,displayName:`XOPC Cloud`,connected:r.mode===`managed`&&r.configured,onConnected:()=>{a()}}),(0,j.jsx)(f,{variant:`secondary`,disabled:m||r.mode===`managed`&&r.configured,onClick:()=>void b(()=>C({mode:`managed`})),children:r.mode===`managed`?n?`当前服务`:`Current service`:n?`使用 XOPC Cloud`:`Use XOPC Cloud`})]}),(0,j.jsxs)(`details`,{className:`rounded-xl border border-edge p-4`,children:[(0,j.jsx)(`summary`,{className:`cursor-pointer text-sm font-medium`,children:t.composioSetupByok}),(0,j.jsxs)(`div`,{className:`mt-4 space-y-3`,children:[(0,j.jsxs)(`ol`,{className:`list-inside list-decimal text-sm text-fg-muted`,children:[(0,j.jsx)(`li`,{children:t.composioSetupStepProject}),(0,j.jsx)(`li`,{children:t.composioSetupStepKey}),(0,j.jsx)(`li`,{children:t.composioSetupStepPaste})]}),(0,j.jsx)(`a`,{href:`https://app.composio.dev`,target:`_blank`,rel:`noreferrer`,className:`text-sm text-accent-fg`,children:t.composioSetupOpenDashboard}),(0,j.jsxs)(`label`,{className:`block space-y-2 text-sm`,children:[(0,j.jsx)(`span`,{children:`Composio API key`}),(0,j.jsx)(o,{value:s,onChange:c,labels:t.secretInputLabels,placeholder:t.composioSetupKeyPlaceholder})]}),(0,j.jsx)(`p`,{className:`text-xs text-fg-subtle`,children:t.composioSetupStorageHint}),(0,j.jsx)(f,{disabled:m||!s.trim(),onClick:()=>void b(()=>T(s)),children:n?`验证并使用新项目`:`Verify and use new project`}),(0,j.jsx)(`p`,{className:`text-xs text-fg-subtle`,children:n?`验证只检查连接服务和现有账号访问,不执行写入。工具权限在实际使用时检查。环境变量密钥需在运行环境中修改。`:`Verification checks service and existing account access without writes. Tool permissions are checked on use. Environment keys must be updated in the gateway environment.`}),(0,j.jsx)(`p`,{className:`text-xs text-fg-subtle`,children:t.composioSessionWritePermissionHint}),r.backends?.filter(e=>e.mode===`byok`).map(e=>(0,j.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 text-sm`,children:[(0,j.jsxs)(`div`,{className:`min-w-0`,children:[(0,j.jsx)(`p`,{children:e.label}),(0,j.jsxs)(`p`,{className:`text-xs text-fg-muted`,children:[e.credentialSource===`environment`?n?`环境变量`:`Environment`:n?`本地保存`:`Stored locally`,e.verifiedAt&&` · ${new Date(e.verifiedAt).toLocaleString()}`]})]}),(0,j.jsx)(f,{variant:`ghost`,disabled:m||!s.trim()||e.credentialSource===`environment`,onClick:()=>void b(()=>T(s,e.id)),children:n?`用上方密钥更新`:`Update with key above`}),(0,j.jsx)(f,{variant:`ghost`,disabled:m||e.id===r.backendId,onClick:()=>void b(()=>C({backendId:e.id})),children:e.id===r.backendId?n?`当前服务`:`Current service`:n?`使用`:`Use`}),(0,j.jsx)(f,{variant:`ghost`,disabled:m||e.id===r.backendId,onClick:()=>y(e.id),children:n?`移除`:`Remove`})]},e.id))]})]})]}):null,g||i?(0,j.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:g??String(i)}):null,(0,j.jsx)(E,{open:!!v,title:n?`移除连接服务`:`Remove connection service`,description:n?`移除此服务及其本地保存的密钥,不修改环境变量。需要先切换服务并断开该项目的账号,已有数据不会删除。`:`Remove this service and its saved key, without changing environment variables. Switch services and disconnect this project’s accounts first. Existing data is retained.`,confirmLabel:n?`移除`:`Remove`,cancelLabel:t.modalCancel,destructive:!0,onCancel:()=>y(void 0),onConfirm:()=>{let e=v;y(void 0),e&&b(()=>S(e))}})]})}export{O as n,I as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e,o as t}from"./locale-store-lIXD1FMw.js";import{n}from"./gateway-config-swr-BAmUhiP1.js";function r(e,t){if(!e.payload)throw Error(e.error??t);return e.payload}async function i(){return r(await t(e(`/api/connectors/catalog`)),`Could not load connector catalog.`).connectors}async function a(n){let i=new URLSearchParams;return n?.q?.trim()&&i.set(`q`,n.q.trim()),n?.page&&i.set(`page`,String(n.page)),n?.pageSize&&i.set(`pageSize`,String(n.pageSize)),n?.refresh&&i.set(`refresh`,`1`),n?.verification&&i.set(`verification`,n.verification),r(await t(e(`/api/connectors/composio/catalog${i.size?`?${i.toString()}`:``}`)),`Could not load Composio catalog.`)}async function o(n){let i=new URLSearchParams;return n?.q?.trim()&&i.set(`q`,n.q.trim()),n?.page&&i.set(`page`,String(n.page)),n?.pageSize&&i.set(`pageSize`,String(n.pageSize)),n?.category?.trim()&&i.set(`category`,n.category.trim()),n?.sort&&i.set(`sort`,n.sort),r(await t(e(`/api/capabilities/connectors${i.size?`?${i.toString()}`:``}`)),`Could not load Store connector capabilities.`)}async function s(n,i){return r(await t(e(`/api/capabilities/connectors/${encodeURIComponent(n)}/install-plan`),{method:`POST`,body:JSON.stringify({version:i})}),`Could not prepare connector installation.`).plan}async function c(i,a,o,s){let c=await t(e(`/api/capabilities/connectors/${encodeURIComponent(i)}/install`),{method:`POST`,body:JSON.stringify({...a,version:o,reviewHash:s})});return n(),r(c,`Could not install Store connector.`).instance}async function l(){return r(await t(e(`/api/connectors/installed`)),`Could not load installed connectors.`).instances}async function u(n,i){return r(await t(e(`/api/connectors/${encodeURIComponent(n)}/auth/start`),{method:`POST`,body:JSON.stringify({accountId:i})}),`Could not start connector authorization.`).authorization}async function d(){return r(await t(e(`/api/connectors/composio/setup-status`)),`Could not check the connection service.`)}async function f(n,i){r(await t(e(`/api/connectors/composio/setup`),{method:`POST`,body:JSON.stringify({apiKey:n,replaceBackendId:i})}),`Could not enable the connection service.`)}async function p(n){await t(e(`/api/connectors/composio/setup`),{method:`POST`,body:JSON.stringify(n)})}async function m(n){await t(e(`/api/connectors/composio/backends/${encodeURIComponent(n)}`),{method:`DELETE`})}async function h(n){await t(e(`/api/connectors/composio/accounts/${encodeURIComponent(n)}`),{method:`DELETE`})}async function g(i,a){let o=await t(e(`/api/connectors/${encodeURIComponent(i)}/install`),{method:`POST`,body:JSON.stringify(a)});return n(),r(o,`Could not install connector.`).instance}async function _(n,i){return r(await t(e(`/api/connectors/${encodeURIComponent(n)}/config`),{method:`POST`,body:JSON.stringify(i)}),`Could not update connector config.`).instance}async function v(r){await t(e(`/api/connectors/${encodeURIComponent(r)}`),{method:`DELETE`}),n()}async function y(n){return r(await t(e(`/api/connectors/${encodeURIComponent(n)}/test`),{method:`POST`}),`Connector test failed.`)}async function b(){return r(await t(e(`/api/connectors/composio/connections`)),`Could not load Composio connections.`).connections}async function x(n){return r(await t(e(`/api/connectors/composio/${encodeURIComponent(n)}/auth-configs`)),`Could not load Composio auth configs.`).auth}async function S(e,t,n=12e4,r){let i=Date.now()+n,a=1500;for(;Date.now()<i;){if(r){let e=await C(r);if(e.status===`failed`)throw Error(`Authorization failed or a different account was authorized. The original account was not changed.`);if(e.status===`expired`)throw Error(`Authorization expired. Start a new connection.`);if(e.status!==`succeeded`){await new Promise(e=>window.setTimeout(e,a)),a=Math.min(5e3,a*1.5);continue}}let n=(await b().catch(()=>[])).find(n=>n.toolkit.toLowerCase()===e.toLowerCase()&&n.status===`active`&&(!t||n.providerConnectionId===t));if(n)return n;await new Promise(e=>window.setTimeout(e,2e3))}throw Error(`Connection authorization timed out.`)}async function C(n){return r(await t(e(`/api/connectors/composio/authorizations/${encodeURIComponent(n)}`)),`Could not check authorization.`).attempt}async function w(n,i){return r(await t(e(`/api/connectors/composio/connections/${encodeURIComponent(n)}`),{method:`PATCH`,body:JSON.stringify(i)}),`Could not update Composio connection.`).connection}async function T(n,r){await t(e(`/api/connectors/composio/accounts/${encodeURIComponent(n)}`),{method:`PATCH`,body:JSON.stringify(r)})}async function E(n){return r(await t(e(`/api/connectors/composio/${encodeURIComponent(n)}/health`)),`Could not check Composio connector health.`).health}async function D(n){await t(e(`/api/connectors/composio/connections/${encodeURIComponent(n)}/refresh`),{method:`POST`})}async function O(n){await t(e(`/api/connectors/composio/connections/${encodeURIComponent(n)}`),{method:`DELETE`})}async function k(n){return r(await t(e(`/api/connectors/composio/${encodeURIComponent(n)}/scope`)),`Could not load Composio scope.`).scope}async function A(i,a){let o=await t(e(`/api/connectors/composio/${encodeURIComponent(i)}/scope`),{method:`POST`,body:JSON.stringify({scope:a})});return n(),r(o,`Could not update Composio scope.`).scope}async function j(n){return r(await t(e(`/api/connectors/composio/${encodeURIComponent(n)}/policy`)),`Could not load Composio policy.`)}async function M(n,i){return r(await t(e(`/api/connectors/composio/${encodeURIComponent(n)}/policy`),{method:`PATCH`,body:JSON.stringify(i)}),`Could not update Composio policy.`).policy}async function N(n){return r(await t(e(`/api/connectors/composio/${encodeURIComponent(n)}/tools`)),`Could not load Composio tools.`).tools}async function P(n=50){return r(await t(e(`/api/connectors/composio/triggers?limit=${encodeURIComponent(String(n))}`)),`Could not load Composio trigger events.`).events}async function F(n){return r(await t(e(`/api/connectors/composio/accounts/${encodeURIComponent(n)}/learning`),{method:`POST`}),`Could not start learning from this connection.`).job}async function I(){return r(await t(e(`/api/connectors/learning`)),`Could not load connector learning jobs.`).jobs}async function L(n){return r(await t(e(`/api/connectors/composio/accounts/${encodeURIComponent(n)}/sync-policy`)),`Could not load connector sync policy.`).policy}async function R(n,i){return r(await t(e(`/api/connectors/composio/accounts/${encodeURIComponent(n)}/sync-policy`),{method:`PATCH`,body:JSON.stringify(i)}),`Could not update connector sync policy.`).policy}async function z(n){return r(await t(e(`/api/connectors/${encodeURIComponent(n)}/source-sync`),{method:`POST`}),`Could not sync connector source.`)}async function B(n=`pending`){return r(await t(e(`/api/connectors/approvals?status=${encodeURIComponent(n)}`)),`Could not load connector approvals.`).approvals}async function V(n,i){return r(await t(e(`/api/connectors/approvals/respond`),{method:`POST`,body:JSON.stringify({id:n,decision:i})}),`Could not update connector approval.`).approval}async function H(i,a){let o=await t(e(`/api/connectors/${encodeURIComponent(i)}/${a?`enable`:`disable`}`),{method:`POST`});return n(),r(o,`Could not update connector state.`).instance}export{F as A,m as C,p as D,O as E,w as F,M as I,_ as L,z as M,y as N,A as O,T as P,R,D as S,V as T,b as _,l as a,B as b,C as c,k as d,d as f,c as g,g as h,i,u as j,H as k,E as l,L as m,h as n,o,x as p,a as r,s,f as t,j as u,N as v,v as w,I as x,P as y,S as z};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{m as i,u as a}from"./chunk-KS7C4IRE-CiwuuyV8.js";import{i as o,n as s,r as c,t as l}from"./service-recommendation-list-B1xuVT3N.js";import{t as u}from"./chevron-down-ccbiQQz_.js";import{t as d}from"./chevron-right-BweFrslA.js";import{n as f,r as p,t as m}from"./popover-select-DniHw2dy.js";import{t as h}from"./circle-alert-BEjgurr2.js";import{t as g}from"./circle-check-C23XjkUj.js";import{t as _}from"./circle-pause-CN9jYH2s.js";import{a as v,i as y,n as b,r as x,t as S}from"./connector-filters-Cfcx9EA2.js";import{t as C}from"./clock-3-DnrAnuyZ.js";import{t as w}from"./database-CjjeZfRG.js";import{t as T}from"./ellipsis-0k4rZLoy.js";import{t as E}from"./external-link-DjqjBmc3.js";import{n as D}from"./secret-input-BQvFXqzz.js";import{t as O}from"./eye-CABVeTq0.js";import{t as k}from"./key-round-DWbpyU2U.js";import{t as A}from"./loader-circle-CifKLtgG.js";import{a as j,c as M,i as N,n as P,o as F,r as I,s as L,t as R}from"./install-connector-dialog-DU1Tz7B3.js";import{t as z}from"./plug-DKYPEgkR.js";import{t as B}from"./plus-Q2yW6OE7.js";import{t as V}from"./refresh-cw-BRlGaq2w.js";import{t as H}from"./save-DRDABU--.js";import{t as ee}from"./server-BlHCBjiE.js";import{t as U}from"./settings-uiTATseT.js";import{t as te}from"./store-SzD1Jvgm.js";import{t as W}from"./terminal-oKqqZdiG.js";import{t as ne}from"./trash-2-DusmjVPV.js";import{t as G}from"./wrench-DFb4r8bH.js";import{t as re}from"./x-B_N4OPjy.js";import{t as ie}from"./messages-DRR9N3HC.js";import{t as K}from"./cn-0WouolD0.js";import{i as q,l as ae,n as oe,o as J}from"./locale-store-lIXD1FMw.js";import{i as Y}from"./vendor-swr-CdRzEUwF.js";import{t as X}from"./button-CnRSIP6m.js";import{t as se}from"./skeleton-BI5TyibZ.js";import{a as ce,i as le,n as Z,o as ue,r as de,s as fe,t as pe}from"./dist-DfWfZ9iu.js";import{r as me}from"./extension-provider-Byrd8Sor.js";import{n as he}from"./copy-to-clipboard-HOJ79TWv.js";import{n as ge}from"./interaction-BdhHBbYa.js";import{n as _e,r as ve}from"./gateway-config-swr-BAmUhiP1.js";import{A as ye,E as be,F as xe,I as Se,L as Ce,M as we,N as Te,O as Ee,P as De,R as Oe,S as ke,_ as Ae,a as je,c as Me,d as Ne,i as Pe,j as Fe,l as Ie,m as Le,n as Re,o as ze,p as Be,r as Ve,s as He,u as Ue,v as We,w as Ge,x as Ke,y as qe,z as Je}from"./connectors-api-DIBG72k4.js";import{s as Ye}from"./form-field-width-DJw_jULe.js";import{n as Xe}from"./electron-env-DHOGevH3.js";import{t as Ze}from"./page-tabs-oeTY7z3_.js";import{t as Qe}from"./page-header-store-DH8K0xii.js";import{t as $e}from"./sliding-tab-list-DuQyViqe.js";import{t as et}from"./confirm-dialog-XGclfBqe.js";import{a as tt,c as nt,o as rt,r as it,t as at}from"./dist-DNCdG_qB.js";import{t as ot}from"./capability-links-DzQWK1Fh.js";import{t as st}from"./capability-icon-DVoZxEgW.js";import{n as ct,t as lt}from"./capability-header-actions-CTUCuBlW.js";import{t as ut}from"./connector-service-page-rWpnchb3.js";import{t as dt}from"./number-input-El7Szeln.js";var Q=e(t(),1),ft=n(),$=r();function pt(e){let t=(0,ft.c)(57),{connector:n,installed:r,onInstall:i,onOpenDetails:a,t:o}=e,s,c,l,u,d,f;if(t[0]!==n||t[1]!==r||t[2]!==i||t[3]!==a||t[4]!==o){let e=n.capabilities.filter(mt),p=e.slice(0,2),m=Math.max(0,e.length-p.length),h=o.connect,_;t[11]!==n||t[12]!==o?(_=N(n,o),t[11]=n,t[12]=o,t[13]=_):_=t[13];let v=_,y=n.verificationLevel===`verified`?o.connectorVerified:n.verificationLevel===`beta`?o.connectorBeta:n.verificationLevel===`experimental`?o.connectorExperimental:null,b;t[14]!==h||t[15]!==n||t[16]!==i?(b=e=>(0,$.jsxs)(X,{type:`button`,variant:`secondary`,className:K(`h-8 justify-center px-2.5 text-xs font-medium`,e),onClick:()=>i(n),children:[(0,$.jsx)(M,{className:`size-4`}),h]}),t[14]=h,t[15]=n,t[16]=i,t[17]=b):b=t[17],s=b,f=`group flex min-h-[8.75rem] flex-col rounded-xl border border-edge bg-surface-panel p-4 transition-colors hover:bg-surface-hover/45 focus-within:ring-2 focus-within:ring-accent/30`,c=`flex min-w-0 flex-1 flex-col`;let x;t[18]===n?x=t[19]:(x=(0,$.jsx)(P,{connector:n}),t[18]=n,t[19]=x);let S;t[20]!==n||t[21]!==a?(S=a?(0,$.jsx)(`button`,{type:`button`,className:`block max-w-full truncate text-left text-sm font-semibold text-fg hover:underline`,onClick:()=>a(n),children:n.displayName}):(0,$.jsx)(`h3`,{className:`truncate text-sm font-semibold text-fg`,children:n.displayName}),t[20]=n,t[21]=a,t[22]=S):S=t[22];let C;t[23]===y?C=t[24]:(C=y?(0,$.jsx)(`span`,{className:`mt-1 inline-flex rounded-full border border-edge px-1.5 py-0.5 text-[10px] font-medium text-fg-subtle`,children:y}):null,t[23]=y,t[24]=C);let w;t[25]!==C||t[26]!==S?(w=(0,$.jsxs)(`div`,{className:`min-w-0`,children:[S,C]}),t[25]=C,t[26]=S,t[27]=w):w=t[27];let T;t[28]!==w||t[29]!==x?(T=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-start gap-3`,children:[x,w]}),t[28]=w,t[29]=x,t[30]=T):T=t[30];let E;t[31]!==r||t[32]!==s?(E=r?null:(0,$.jsx)(`div`,{className:`hidden shrink-0 items-center gap-1 sm:flex`,children:s()}),t[31]=r,t[32]=s,t[33]=E):E=t[33];let D;t[34]!==r||t[35]!==o.connectedBadge?(D=r?(0,$.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full border border-emerald-500/30 bg-emerald-500/10 px-2 py-0.5 text-[11px] font-medium text-emerald-700 dark:text-emerald-300`,children:[(0,$.jsx)(g,{className:`size-3`,"aria-hidden":!0}),o.connectedBadge]}):null,t[34]=r,t[35]=o.connectedBadge,t[36]=D):D=t[36];let O;t[37]!==E||t[38]!==D?(O=(0,$.jsxs)(`div`,{className:`flex shrink-0 items-start gap-2`,children:[E,D]}),t[37]=E,t[38]=D,t[39]=O):O=t[39],t[40]!==T||t[41]!==O?(l=(0,$.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[T,O]}),t[40]=T,t[41]=O,t[42]=l):l=t[42],t[43]===v?u=t[44]:(u=(0,$.jsx)(`p`,{className:`mt-3 line-clamp-2 text-sm leading-6 text-fg-muted`,title:v,children:v}),t[43]=v,t[44]=u),d=p.length>0?(0,$.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-1.5`,children:[p.map(e=>(0,$.jsx)(`span`,{className:`rounded-md bg-surface-base px-2 py-0.5 text-[11px] text-fg-muted`,children:o.connectorCapabilityLabels[e]??e},e)),m>0?(0,$.jsxs)(`span`,{className:`rounded-md bg-surface-base px-2 py-0.5 text-[11px] text-fg-subtle`,children:[`+`,m]}):null]}):null,t[0]=n,t[1]=r,t[2]=i,t[3]=a,t[4]=o,t[5]=s,t[6]=c,t[7]=l,t[8]=u,t[9]=d,t[10]=f}else s=t[5],c=t[6],l=t[7],u=t[8],d=t[9],f=t[10];let p;t[45]!==c||t[46]!==l||t[47]!==u||t[48]!==d?(p=(0,$.jsxs)(`div`,{className:c,children:[l,u,d]}),t[45]=c,t[46]=l,t[47]=u,t[48]=d,t[49]=p):p=t[49];let m;t[50]!==r||t[51]!==s?(m=r?null:(0,$.jsx)(`div`,{className:`mt-4 flex flex-col gap-2 border-t border-edge pt-3 sm:hidden`,children:s(`w-full`)}),t[50]=r,t[51]=s,t[52]=m):m=t[52];let h;return t[53]!==f||t[54]!==p||t[55]!==m?(h=(0,$.jsxs)(`div`,{className:f,children:[p,m]}),t[53]=f,t[54]=p,t[55]=m,t[56]=h):h=t[56],h}function mt(e){return!e.startsWith(`runtime.`)&&!e.startsWith(`auth.`)}var ht=[`c0`,`c1`,`c2`,`c3`,`c4`,`c5`];function gt(e,t){return t.some(t=>t.connectorId===e.id)}var _t=`animate-pulse motion-reduce:animate-none rounded-md bg-surface-hover dark:bg-surface-active/50`;function vt(){let e=(0,ft.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(`div`,{className:K(`size-10 shrink-0 rounded-xl`,_t)}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsx)(`div`,{className:`flex h-full min-h-[9.5rem] flex-col rounded-xl bg-surface-panel p-4 shadow-surface`,"aria-hidden":!0,children:(0,$.jsxs)(`div`,{className:`flex min-h-0 flex-1 items-start gap-3`,children:[t,(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-2`,children:[(0,$.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,$.jsx)(`div`,{className:K(`h-4 min-w-0 flex-1`,_t)}),(0,$.jsx)(`div`,{className:K(`h-8 w-[4.5rem] shrink-0 rounded-lg`,_t)})]}),(0,$.jsx)(`div`,{className:K(`h-3 w-full`,_t)}),(0,$.jsx)(`div`,{className:K(`h-3 w-[88%]`,_t)})]})]})}),e[1]=n):n=e[1],n}function yt(){let e=(0,ft.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(se,{className:`size-9 shrink-0 rounded-lg`}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsxs)(`div`,{className:`flex min-h-[8.75rem] min-w-0 flex-col rounded-xl border border-edge bg-surface-panel p-4`,"aria-hidden":!0,children:[(0,$.jsxs)(`div`,{className:`flex items-start gap-3`,children:[t,(0,$.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-2`,children:[(0,$.jsx)(se,{className:`h-4 w-28 max-w-full`}),(0,$.jsx)(se,{className:`h-3 w-20 max-w-full`})]})]}),(0,$.jsx)(se,{className:`mt-2 h-3 w-48 max-w-full`}),(0,$.jsx)(se,{className:`ml-auto mt-auto h-3 w-16`})]}),e[1]=n):n=e[1],n}var bt=[`understand`,`act`,`reach`];function xt(e){if(e.benefits?.length)return[...new Set(e.benefits)];let t=new Set(e.capabilities),n=[e.id,e.displayName,...e.tags??[]].join(` `).toLowerCase(),r=[];return(t.has(`context`)||t.has(`memory_source`)||t.has(`resources`)||e.category===`docs`||e.category===`data`||/notion|drive|document|confluence|airtable|database|knowledge|wiki/.test(n))&&r.push(`understand`),t.has(`tools`)&&r.push(`act`),(t.has(`channel`)||/slack|telegram|discord|teams|mail|message|wechat|weixin/.test(n))&&r.push(`reach`),r.length?[...new Set(r)]:[`act`]}function St(e){return xt(e)[0]??`act`}function Ct(e,t){let n=t?St(t):`act`,r=e.connectionStatus===`connected`||e.status===`connected`||e.usage.lastHealthStatus===`ok`,i=e.status===`not_configured`||e.status===`failed`||e.status===`degraded`||e.status===`unauthorized`||e.connectionStatus===`unauthorized`||e.connectionStatus===`error`,a=n===`understand`?e.usage.lastResourceCount:n===`act`?e.usage.lastToolCount:void 0;return{benefit:n,state:r?`ready`:i?`needs_setup`:`checking`,availableCount:a}}function wt(e,t){return t.connectorCapabilityLabels[e]??e}function Tt(e,t){if(e.runtime.type===`mcp`)return j(t.connectorRuntimeMcp,{serverId:e.runtime.serverId});let n=e.runtime.type===`composio`?e.runtime.toolkit:e.runtime.type===`cli`?e.runtime.adapterId:e.runtime.sourceKind;return j(t.connectorRuntimeGeneric,{runtime:e.runtime.type,id:n??e.runtime.type})}function Et(e,t){return e.auth.mode===`cli`?t.connectorAuthCli:e.auth.mode===`oauth`?t.connectorAuthOAuth:e.auth.mode===`apiKey`?t.connectorAuthApiKey:t.connectorAuthNone}function Dt(e){let t=(0,ft.c)(133),{connector:n,installed:r,onClose:i,onInstall:a,t:o}=e,s;t[0]!==n||t[1]!==o?(s=N(n,o),t[0]=n,t[1]=o,t[2]=s):s=t[2];let c=s,l,u,d,f,p,m,h,_,v,y,b,x,S,C,w,T;if(t[3]!==n||t[4]!==c||t[5]!==r||t[6]!==i||t[7]!==o){let e=xt(n),a;t[24]!==n.setup.config||t[25]!==n.setup.secrets?(a=[...(n.setup.secrets??[]).filter(At),...(n.setup.config??[]).filter(kt)],t[24]=n.setup.config,t[25]=n.setup.secrets,t[26]=a):a=t[26];let s=a,E=n.capabilities.filter(Ot);d=pe,h=!0,t[27]===i?_=t[28]:(_=e=>{e||i()},t[27]=i,t[28]=_),u=ue,t[29]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,$.jsx)(ce,{className:`xopc-dialog-overlay fixed inset-0 z-[60] bg-scrim`}),t[29]=m):m=t[29],l=de,t[30]===Symbol.for(`react.memo_cache_sentinel`)?(f=K(`xopc-dialog-content fixed left-1/2 top-1/2 z-[60] flex h-[min(100vh-2rem,42rem)] w-[min(100%-2rem,min(92vw,44rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden`,`rounded-2xl border border-edge bg-surface-overlay shadow-float outline-none dark:border-edge`),t[30]=f):f=t[30];let D;t[31]===n?D=t[32]:(D=(0,$.jsx)(P,{connector:n,size:`lg`}),t[31]=n,t[32]=D);let O;t[33]===n.displayName?O=t[34]:(O=(0,$.jsx)(fe,{className:`text-base font-semibold text-fg`,children:n.displayName}),t[33]=n.displayName,t[34]=O);let A;t[35]!==r||t[36]!==o.connectedBadge?(A=r?(0,$.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-emerald-500/10 px-2 py-0.5 text-[11px] font-medium text-emerald-700 dark:text-emerald-300`,children:[(0,$.jsx)(g,{className:`size-3`,"aria-hidden":!0}),o.connectedBadge]}):null,t[35]=r,t[36]=o.connectedBadge,t[37]=A):A=t[37];let M;t[38]!==O||t[39]!==A?(M=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[O,A]}),t[38]=O,t[39]=A,t[40]=M):M=t[40];let N;t[41]===c?N=t[42]:(N=(0,$.jsx)(le,{className:`mt-1 line-clamp-3 text-sm leading-6 text-fg-muted`,children:c}),t[41]=c,t[42]=N);let F;t[43]!==M||t[44]!==N?(F=(0,$.jsxs)(`div`,{className:`min-w-0`,children:[M,N]}),t[43]=M,t[44]=N,t[45]=F):F=t[45];let I;t[46]!==D||t[47]!==F?(I=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-start gap-3`,children:[D,F]}),t[46]=D,t[47]=F,t[48]=I):I=t[48];let L;t[49]===Symbol.for(`react.memo_cache_sentinel`)?(L=K(`rounded-lg p-1.5 text-fg-muted hover:bg-surface-hover hover:text-fg`,ge.focusRingPanel),t[49]=L):L=t[49];let R;t[50]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,$.jsx)(re,{className:`size-5`,strokeWidth:1.75,"aria-hidden":!0}),t[50]=R):R=t[50];let z;t[51]===o.modalClose?z=t[52]:(z=(0,$.jsx)(Z,{asChild:!0,children:(0,$.jsx)(`button`,{type:`button`,className:L,"aria-label":o.modalClose,children:R})}),t[51]=o.modalClose,t[52]=z),t[53]!==I||t[54]!==z?(p=(0,$.jsxs)(`div`,{className:`flex shrink-0 items-start justify-between gap-3 border-b border-edge-subtle px-5 py-5 sm:px-6`,children:[I,z]}),t[53]=I,t[54]=z,t[55]=p):p=t[55],C=`min-h-0 flex-1 space-y-5 overflow-y-auto px-5 py-5 sm:px-6`,w=e.length?(0,$.jsxs)(`section`,{children:[(0,$.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:o.connectorWhyConnect}),(0,$.jsx)(`div`,{className:`mt-3 divide-y divide-edge-subtle overflow-hidden rounded-xl border border-edge bg-surface-base`,children:e.map(e=>(0,$.jsxs)(`div`,{className:`px-4 py-3`,children:[(0,$.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:o.connectorBenefitHeadings[e]}),(0,$.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:o.connectorBenefitHints[e]})]},e))})]}):null;let B;t[56]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,$.jsx)(k,{className:`mt-0.5 size-4 shrink-0 text-fg-muted`,"aria-hidden":!0}),t[56]=B):B=t[56];let V;t[57]===o.detailPermissions?V=t[58]:(V=(0,$.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:o.detailPermissions}),t[57]=o.detailPermissions,t[58]=V);let H;t[59]!==n||t[60]!==o?(H=Et(n,o),t[59]=n,t[60]=o,t[61]=H):H=t[61];let U;t[62]===H?U=t[63]:(U=(0,$.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:H}),t[62]=H,t[63]=U);let te;t[64]!==V||t[65]!==U?(te=(0,$.jsxs)(`div`,{className:`flex items-start gap-3 border-b border-edge-subtle px-4 py-3`,children:[B,(0,$.jsxs)(`div`,{children:[V,U]})]}),t[64]=V,t[65]=U,t[66]=te):te=t[66];let W;t[67]===o.connectorSetupTitle?W=t[68]:(W=(0,$.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:o.connectorSetupTitle}),t[67]=o.connectorSetupTitle,t[68]=W);let ne;t[69]!==s.length||t[70]!==o.connectorRequiredInputsCount||t[71]!==o.connectorSetupNone?(ne=s.length?j(o.connectorRequiredInputsCount,{count:String(s.length)}):o.connectorSetupNone,t[69]=s.length,t[70]=o.connectorRequiredInputsCount,t[71]=o.connectorSetupNone,t[72]=ne):ne=t[72];let G;t[73]===ne?G=t[74]:(G=(0,$.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:ne}),t[73]=ne,t[74]=G);let ie;t[75]!==W||t[76]!==G?(ie=(0,$.jsxs)(`div`,{className:`px-4 py-3`,children:[W,G]}),t[75]=W,t[76]=G,t[77]=ie):ie=t[77],t[78]!==te||t[79]!==ie?(T=(0,$.jsxs)(`section`,{className:`overflow-hidden rounded-xl border border-edge bg-surface-base`,children:[te,ie]}),t[78]=te,t[79]=ie,t[80]=T):T=t[80],x=`rounded-xl border border-edge bg-surface-base`,t[81]===o.connectorTechnicalDetails?S=t[82]:(S=(0,$.jsx)(`summary`,{className:`cursor-pointer px-4 py-3 text-sm font-medium text-fg-muted hover:text-fg`,children:o.connectorTechnicalDetails}),t[81]=o.connectorTechnicalDetails,t[82]=S),v=`space-y-5 border-t border-edge-subtle px-4 py-4`;let q;t[83]===Symbol.for(`react.memo_cache_sentinel`)?(q=(0,$.jsx)(ee,{className:`size-3.5`,"aria-hidden":!0}),t[83]=q):q=t[83];let ae;t[84]===o.connectorRuntimeTitle?ae=t[85]:(ae=(0,$.jsxs)(`p`,{className:`flex items-center gap-2 text-xs font-medium text-fg-muted`,children:[q,o.connectorRuntimeTitle]}),t[84]=o.connectorRuntimeTitle,t[85]=ae);let oe;t[86]!==n||t[87]!==o?(oe=Tt(n,o),t[86]=n,t[87]=o,t[88]=oe):oe=t[88];let J;t[89]===oe?J=t[90]:(J=(0,$.jsx)(`p`,{className:`mt-1 break-words text-xs text-fg-subtle`,children:oe}),t[89]=oe,t[90]=J),t[91]!==ae||t[92]!==J?(y=(0,$.jsxs)(`div`,{children:[ae,J]}),t[91]=ae,t[92]=J,t[93]=y):y=t[93],b=E.length?(0,$.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:E.map(e=>(0,$.jsx)(`span`,{className:`rounded-md bg-surface-panel px-2 py-1 text-xs text-fg-muted`,children:wt(e,o)},e))}):null,t[3]=n,t[4]=c,t[5]=r,t[6]=i,t[7]=o,t[8]=l,t[9]=u,t[10]=d,t[11]=f,t[12]=p,t[13]=m,t[14]=h,t[15]=_,t[16]=v,t[17]=y,t[18]=b,t[19]=x,t[20]=S,t[21]=C,t[22]=w,t[23]=T}else l=t[8],u=t[9],d=t[10],f=t[11],p=t[12],m=t[13],h=t[14],_=t[15],v=t[16],y=t[17],b=t[18],x=t[19],S=t[20],C=t[21],w=t[22],T=t[23];let E;t[94]!==v||t[95]!==y||t[96]!==b?(E=(0,$.jsxs)(`div`,{className:v,children:[y,b]}),t[94]=v,t[95]=y,t[96]=b,t[97]=E):E=t[97];let D;t[98]!==E||t[99]!==x||t[100]!==S?(D=(0,$.jsxs)(`details`,{className:x,children:[S,E]}),t[98]=E,t[99]=x,t[100]=S,t[101]=D):D=t[101];let O;t[102]!==D||t[103]!==C||t[104]!==w||t[105]!==T?(O=(0,$.jsxs)(`div`,{className:C,children:[w,T,D]}),t[102]=D,t[103]=C,t[104]=w,t[105]=T,t[106]=O):O=t[106];let A;t[107]===o.modalClose?A=t[108]:(A=(0,$.jsx)(Z,{asChild:!0,children:(0,$.jsx)(X,{variant:`secondary`,children:o.modalClose})}),t[107]=o.modalClose,t[108]=A);let F;t[109]!==n||t[110]!==r||t[111]!==i||t[112]!==a||t[113]!==o.connect?(F=r?null:(0,$.jsxs)(X,{variant:`primary`,onClick:()=>{a(n),i()},children:[(0,$.jsx)(M,{className:`size-4`}),o.connect]}),t[109]=n,t[110]=r,t[111]=i,t[112]=a,t[113]=o.connect,t[114]=F):F=t[114];let I;t[115]!==A||t[116]!==F?(I=(0,$.jsxs)(`div`,{className:`flex shrink-0 justify-end gap-2 border-t border-edge-subtle px-5 py-4 sm:px-6`,children:[A,F]}),t[115]=A,t[116]=F,t[117]=I):I=t[117];let L;t[118]!==l||t[119]!==f||t[120]!==p||t[121]!==O||t[122]!==I?(L=(0,$.jsxs)(l,{className:f,children:[p,O,I]}),t[118]=l,t[119]=f,t[120]=p,t[121]=O,t[122]=I,t[123]=L):L=t[123];let R;t[124]!==u||t[125]!==m||t[126]!==L?(R=(0,$.jsxs)(u,{children:[m,L]}),t[124]=u,t[125]=m,t[126]=L,t[127]=R):R=t[127];let z;return t[128]!==d||t[129]!==h||t[130]!==_||t[131]!==R?(z=(0,$.jsx)(d,{open:h,onOpenChange:_,children:R}),t[128]=d,t[129]=h,t[130]=_,t[131]=R,t[132]=z):z=t[132],z}function Ot(e){return!e.startsWith(`runtime.`)&&!e.startsWith(`auth.`)}function kt(e){return e.required}function At(e){return e.required}var jt=(0,Q.memo)(function(e){let t=(0,ft.c)(45),{onRefresh:n,refreshing:r,refreshLabel:i,onBrowseCatalog:a,onAddCustomServer:o,addLabel:s,browseLabel:c,customLabel:l,serviceLabel:d,moreActionsLabel:f}=e,[p,m]=(0,Q.useState)(!1),h;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(h=K(`touch-target flex cursor-pointer items-center gap-2 rounded-lg px-3 py-2 text-sm text-fg outline-none data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50 data-[highlighted]:bg-surface-hover`,ge.transition),t[0]=h):h=t[0];let g=h,_;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,$.jsx)(B,{className:`size-4`,strokeWidth:1.75,"aria-hidden":!0}),t[1]=_):_=t[1];let v;t[2]===s?v=t[3]:(v=(0,$.jsx)(`span`,{className:`hidden sm:inline`,children:s}),t[2]=s,t[3]=v);let y;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,$.jsx)(u,{className:`size-3.5`,strokeWidth:1.75,"aria-hidden":!0}),t[4]=y):y=t[4];let b;t[5]!==s||t[6]!==v?(b=(0,$.jsx)(nt,{asChild:!0,children:(0,$.jsxs)(X,{type:`button`,variant:`primary`,className:`shrink-0 gap-2`,"aria-label":s,children:[_,v,y]})}),t[5]=s,t[6]=v,t[7]=b):b=t[7];let x;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,$.jsx)(te,{className:`size-4 text-fg-muted`,strokeWidth:1.75,"aria-hidden":!0}),t[8]=x):x=t[8];let S;t[9]!==c||t[10]!==a?(S=(0,$.jsxs)(it,{className:g,onSelect:a,children:[x,c]}),t[9]=c,t[10]=a,t[11]=S):S=t[11];let C;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,$.jsx)(G,{className:`size-4 text-fg-muted`,strokeWidth:1.75,"aria-hidden":!0}),t[12]=C):C=t[12];let w;t[13]!==l||t[14]!==o?(w=(0,$.jsxs)(it,{className:g,onSelect:o,children:[C,l]}),t[13]=l,t[14]=o,t[15]=w):w=t[15];let E;t[16]!==S||t[17]!==w?(E=(0,$.jsx)(tt,{children:(0,$.jsxs)(at,{className:`z-50 min-w-[14rem] rounded-xl border border-edge bg-surface-overlay p-1 shadow-popover dark:border-edge`,sideOffset:6,align:`end`,children:[S,w]})}),t[16]=S,t[17]=w,t[18]=E):E=t[18];let D;t[19]!==E||t[20]!==b?(D=(0,$.jsxs)(rt,{children:[b,E]}),t[19]=E,t[20]=b,t[21]=D):D=t[21];let O;t[22]===p?O=t[23]:(O=(0,$.jsx)(ut,{open:p,onOpenChange:m,hideTrigger:!0}),t[22]=p,t[23]=O);let k;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,$.jsx)(T,{className:`size-4`,"aria-hidden":!0}),t[24]=k):k=t[24];let j;t[25]===f?j=t[26]:(j=(0,$.jsx)(nt,{asChild:!0,children:(0,$.jsx)(X,{type:`button`,variant:`secondary`,className:`size-9 shrink-0 p-0`,"aria-label":f,title:f,children:k})}),t[25]=f,t[26]=j);let M;t[27]!==n||t[28]!==i||t[29]!==r?(M=n?(0,$.jsxs)(it,{className:g,disabled:r,onSelect:n,children:[r?(0,$.jsx)(A,{className:`size-4 animate-spin text-fg-muted`,"aria-hidden":!0}):(0,$.jsx)(V,{className:`size-4 text-fg-muted`,"aria-hidden":!0}),i]}):null,t[27]=n,t[28]=i,t[29]=r,t[30]=M):M=t[30];let N,P;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(N=()=>m(!0),P=(0,$.jsx)(U,{className:`size-4 text-fg-muted`,"aria-hidden":!0}),t[31]=N,t[32]=P):(N=t[31],P=t[32]);let F;t[33]===d?F=t[34]:(F=(0,$.jsxs)(it,{className:g,onSelect:N,children:[P,d]}),t[33]=d,t[34]=F);let I;t[35]!==M||t[36]!==F?(I=(0,$.jsx)(tt,{children:(0,$.jsxs)(at,{className:`z-50 min-w-[14rem] rounded-xl border border-edge bg-surface-overlay p-1 shadow-popover dark:border-edge`,sideOffset:6,align:`end`,children:[M,F]})}),t[35]=M,t[36]=F,t[37]=I):I=t[37];let L;t[38]!==j||t[39]!==I?(L=(0,$.jsxs)(rt,{children:[j,I]}),t[38]=j,t[39]=I,t[40]=L):L=t[40];let R;return t[41]!==D||t[42]!==O||t[43]!==L?(R=(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center justify-end gap-2`,children:[D,O,L]}),t[41]=D,t[42]=O,t[43]=L,t[44]=R):R=t[44],R});function Mt(e=``,t=``){return{clientKey:crypto.randomUUID(),key:e,value:t}}var Nt=/^([^:=]+)[:=](.*)$/;function Pt(e){let t=e.trim();if(!t)return null;try{let e=JSON.parse(t);if(e&&typeof e==`object`&&!Array.isArray(e))return It(e)}catch{}let n=[];for(let e of t.split(/\r?\n/)){let t=e.trim();if(!t)continue;let r=Nt.exec(t);r&&n.push(Mt(r[1].trim(),r[2].trim()))}return n.length>0?n:null}function Ft(e){let t=Object.create(null);for(let n of e){let e=n.key.trim();e&&(t[e]=n.reference??n.value)}return Object.keys(t).length>0?t:void 0}function It(e){if(!e||typeof e!=`object`)return[Mt()];let t=Object.entries(e).map(([e,t])=>typeof t==`object`&&t&&!Array.isArray(t)?{...Mt(e),reference:t}:Mt(e,t==null?``:String(t)));return t.length>0?t:[Mt()]}function Lt(e){if(!e||typeof e!=`object`||Array.isArray(e))return!1;let t=e.xopcConnector;return!!(t&&typeof t==`object`&&!Array.isArray(t)&&t.managed===!0)}function Rt(e){let t=e.trim();if(!t)return;if(t.startsWith(`[`)){let e=JSON.parse(t);if(!Array.isArray(e)||e.some(e=>typeof e!=`string`))throw Error(`Command arguments must be a JSON array of strings.`);return e}let n=[],r=``,i=``,a=!1;for(let e=0;e<t.length;e++){let o=t[e];o===`\\`&&t[e+1]&&i!==`'`&&/[\s"'\\]/.test(t[e+1])?(r+=t[++e],a=!0):i?o===i?i=``:r+=o:o===`"`||o===`'`?(i=o,a=!0):/\s/.test(o)?a&&=(n.push(r),r=``,!1):(r+=o,a=!0)}if(i)throw Error(`Command arguments contain an unclosed quote.`);return a&&n.push(r),n}function zt(e){let t=e.trim();if(!t)return;let n=JSON.parse(t);if(!n||typeof n!=`object`||Array.isArray(n))throw Error(`Expected a JSON object`);return n}function Bt(e){let t={...e.extra,exposure:e.exposure};if(e.displayName?.trim()?t.displayName=e.displayName.trim():delete t.displayName,delete t.command,delete t.args,delete t.env,delete t.cwd,delete t.url,delete t.headers,delete t.type,e.transport===`stdio`){t.type=`stdio`,t.command=e.command.trim();let n=Rt(e.argsText);if(n&&(t.args=n),e.cwd.trim()&&(t.cwd=e.cwd.trim()),e.envEntries){let n=new Set;for(let t of e.envEntries)if(!(!t.key.trim()&&!t.value&&!t.reference)){if(!t.key.trim()||n.has(t.key.trim()))throw Error(`Environment variable names must be non-empty and unique.`);n.add(t.key.trim())}let r=Ft(e.envEntries);r&&(t.env=r)}else e.envJson.trim()&&(t.env=zt(e.envJson));delete t.oauth,delete t.auth}else{t.type=`http`,t.url=e.url.trim();let n=Ft(e.headers);n&&(t.headers=n);let r={...t.oauth??{}};e.oauthClientId.trim()?r.clientId=e.oauthClientId.trim():delete r.clientId,Object.keys(r).length?t.oauth=r:delete t.oauth}return e.timeout===void 0?delete t.timeout:t.timeout=e.timeout,t}function Vt(e,t){let n=t.oauth;return{clientKey:e,id:e,displayName:typeof t.displayName==`string`?t.displayName:``,transport:typeof t.url==`string`?`streamable-http`:`stdio`,command:typeof t.command==`string`?t.command:``,argsText:Array.isArray(t.args)?JSON.stringify(t.args):``,envJson:t.env?JSON.stringify(t.env,null,2):``,cwd:typeof t.cwd==`string`?t.cwd:``,url:typeof t.url==`string`?t.url:``,headers:It(t.headers),oauthClientId:typeof n?.clientId==`string`?n.clientId:``,timeout:typeof t.timeout==`number`?t.timeout:void 0,exposure:t.exposure??`codemode`,extra:t}}function Ht(e,t){let n=`mcp`;try{n=e.transport===`streamable-http`?new URL(e.url).hostname:e.command.split(/[\\/]/).pop()||n}catch{}let r=n.replace(/[^a-zA-Z0-9_-]+/g,`_`).replace(/^_+|_+$/g,``)||`mcp`,i=new Set([...t].map(e=>e.replace(/-/g,`_`))),a=r;for(let e=2;i.has(a.replace(/-/g,`_`));e++)a=`${r}_${e}`;return a}function Ut(e){let t=e.trim(),n=new URL(/^[a-z][a-z\d+.-]*:/i.test(t)&&!/^[^/]+:\d+(?:[/?#]|$)/.test(t)?t:`${/^(localhost|127\.0\.0\.1)(:|\/|$)/i.test(t)?`http`:`https`}://${t}`);if(![`http:`,`https:`].includes(n.protocol)||n.username||n.password)throw Error(`Use an HTTP or HTTPS MCP address without embedded credentials.`);return n.href}function Wt(e){let t=JSON.parse(e);if(!t||typeof t!=`object`||Array.isArray(t))throw Error(`Expected a JSON object.`);let n=t.mcpServers??t.mcp?.servers??t.servers;if(n!==void 0&&(!n||typeof n!=`object`||Array.isArray(n)))throw Error(`Expected a server configuration object.`);let r=n?Object.entries(n):[[``,t]];if(!r.length)throw Error(`No MCP servers found.`);return r.map(([e,t])=>{if(!t||typeof t!=`object`||Array.isArray(t))throw Error(`Invalid MCP server configuration.`);let n=t;if(typeof n.url!=`string`&&typeof n.command!=`string`)throw Error(`The configuration needs an MCP URL or command.`);if(n.args!==void 0&&(!Array.isArray(n.args)||n.args.some(e=>typeof e!=`string`)))throw Error(`Command arguments must be strings.`);let r=Vt(e,n);return r.clientKey=crypto.randomUUID(),r.url&&=Ut(r.url),r})}function Gt(e=``){return{clientKey:crypto.randomUUID(),id:e,transport:`streamable-http`,command:``,argsText:``,envJson:``,cwd:``,url:``,headers:[],oauthClientId:``,timeout:void 0,exposure:`codemode`,extra:{}}}function Kt(e){let t=e?.mcp?.servers??{};return{servers:Object.entries(t).filter(([,e])=>!Lt(e)).map(([e,t])=>Vt(e,t)).sort((e,t)=>e.id.localeCompare(t.id))}}function qt(e){return Bt(e)}async function Jt(e,t){return(await J(q(`/api/mcp/servers/${encodeURIComponent(e)}/tools`),{method:`POST`,signal:AbortSignal.any([t,AbortSignal.timeout(95e3)])})).payload.tools}async function Yt(e,t,n,r){return(await J(q(`/api/mcp/drafts`),{method:`POST`,signal:r,body:JSON.stringify({serverId:e.id,sourceServerId:t,expectedServer:n,server:Bt(e)})})).payload}async function Xt(e,t){return(await J(q(`/api/mcp/drafts/${encodeURIComponent(e)}/probe`),{method:`POST`,signal:AbortSignal.any([t,AbortSignal.timeout(95e3)])})).payload}async function Zt(e){await J(q(`/api/mcp/drafts/${encodeURIComponent(e)}`),{method:`DELETE`})}async function Qt(e,t=!1){let n=await J(q(`/api/mcp/drafts/${encodeURIComponent(e)}/commit`),{method:`POST`,body:JSON.stringify({enable:t})});return _e(),n.payload}async function $t(e){return(await J(q(`/api/mcp/drafts/${encodeURIComponent(e)}/auth`),{method:`POST`})).payload}async function en(e,t){return(await J(q(`/api/mcp/drafts/${encodeURIComponent(e)}/auth`),{signal:t})).payload}async function tn(e){await J(q(`/api/mcp/drafts/${encodeURIComponent(e)}/auth`),{method:`DELETE`})}async function nn(e,t){await J(q(`/api/mcp/drafts/${encodeURIComponent(e)}/auth/redirect`),{method:`POST`,body:JSON.stringify({url:t})})}async function rn(e,t){return(await J(q(`/api/mcp/drafts/${encodeURIComponent(e)}/tools`),{signal:t})).payload.tools}async function an(e){let t=await J(q(`/api/mcp/servers`),{signal:e});return Object.fromEntries(t.payload.servers.filter(e=>e.lastCheck&&Number.isFinite(Date.parse(e.lastCheck.checkedAt))).map(e=>[e.id,e.lastCheck]))}async function on(e){let t=await J(q(`/api/mcp/servers/${encodeURIComponent(e.id)}`),{method:`DELETE`,body:JSON.stringify({expectedServer:e.extra})});return _e(),t.payload}function sn(e){let t=(0,ft.c)(111),{serverId:n,displayName:r,returnFocusTo:i,draftId:a,t:o,onClose:s,onConfigure:c}=e,l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(l=[],t[0]=l):l=t[0];let[u,d]=(0,Q.useState)(l),[f,p]=(0,Q.useState)(!0),[m,h]=(0,Q.useState)(``),[g,_]=(0,Q.useState)(``),[v,y]=(0,Q.useState)(0),b=(0,Q.useRef)(!1),x;t[1]!==a||t[2]!==n||t[3]!==o.setupAccessDenied||t[4]!==o.setupConflict||t[5]!==o.setupGatewayUnauthorized||t[6]!==o.setupRateLimited||t[7]!==o.toolsLoadFailed?(x=()=>{let e=new AbortController,t=!0;return p(!0),h(``),d([]),(a?rn(a,e.signal):Jt(n,e.signal)).then(e=>{t&&d(e)}).catch(e=>{let n=e?.status;t&&h(n===401?o.setupGatewayUnauthorized:n===403?o.setupAccessDenied:n===429?o.setupRateLimited:n===404||n===409?o.setupConflict:o.toolsLoadFailed)}).finally(()=>{t&&p(!1)}),()=>{t=!1,e.abort()}},t[1]=a,t[2]=n,t[3]=o.setupAccessDenied,t[4]=o.setupConflict,t[5]=o.setupGatewayUnauthorized,t[6]=o.setupRateLimited,t[7]=o.toolsLoadFailed,t[8]=x):x=t[8];let S;t[9]!==a||t[10]!==v||t[11]!==n||t[12]!==o?(S=[n,a,v,o],t[9]=a,t[10]=v,t[11]=n,t[12]=o,t[13]=S):S=t[13],(0,Q.useEffect)(x,S);let C,w,T,E,D,O,k,A,j,M,N,P,F;if(t[14]!==r||t[15]!==m||t[16]!==f||t[17]!==s||t[18]!==c||t[19]!==g||t[20]!==i||t[21]!==n||t[22]!==o.exposureLabels||t[23]!==o.setupConfigure||t[24]!==o.toolDetails||t[25]!==o.toolsClearSearch||t[26]!==o.toolsDialogSearchEmpty||t[27]!==o.toolsDialogSearchPlaceholder||t[28]!==o.toolsDialogSubtitle||t[29]!==o.toolsDialogTitle||t[30]!==o.toolsEmpty||t[31]!==o.toolsLoading||t[32]!==o.toolsRetryHint||t[33]!==o.toolsSearchSummary||t[34]!==o.toolsTitle||t[35]!==u){let e=g.trim().toLowerCase(),a;if(t[49]!==n){let e;t[51]===Symbol.for(`react.memo_cache_sentinel`)?(e=/-/g,t[51]=e):e=t[51],a=n.replace(e,`_`),t[49]=n,t[50]=a}else a=t[50];let l=`mcp__${a}__`,d=u.filter(t=>`${t.name} ${t.description}`.toLowerCase().includes(e));T=pe,O=!0,t[52]===s?k=t[53]:(k=e=>{e||s()},t[52]=s,t[53]=k),w=ue,t[54]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,$.jsx)(ce,{className:`fixed inset-0 z-[60] bg-scrim`}),t[54]=D):D=t[54],C=de,t[55]===i?P=t[56]:(P=e=>{(b.current||i)&&e.preventDefault(),!b.current&&i?.isConnected&&i.focus()},t[55]=i,t[56]=P),F=`fixed left-1/2 top-1/2 z-[60] flex h-[min(42rem,calc(100dvh-2rem))] w-[min(48rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-2xl border border-edge bg-surface-overlay`;let p;t[57]===o.toolsDialogTitle?p=t[58]:(p=(0,$.jsx)(fe,{className:`font-semibold`,children:o.toolsDialogTitle}),t[57]=o.toolsDialogTitle,t[58]=p);let h;t[59]!==r||t[60]!==m||t[61]!==f||t[62]!==n||t[63]!==o.toolsDialogSubtitle||t[64]!==u.length?(h=f||m?r||n:o.toolsDialogSubtitle.replace(`{{serverId}}`,r||n).replace(`{{count}}`,String(u.length)),t[59]=r,t[60]=m,t[61]=f,t[62]=n,t[63]=o.toolsDialogSubtitle,t[64]=u.length,t[65]=h):h=t[65];let v;t[66]===h?v=t[67]:(v=(0,$.jsx)(le,{className:`mt-1 break-words text-sm text-fg-muted`,children:h}),t[66]=h,t[67]=v);let y;t[68]===Symbol.for(`react.memo_cache_sentinel`)?(y=e=>_(e.target.value),t[68]=y):y=t[68];let x;t[69]!==g||t[70]!==o.toolsDialogSearchPlaceholder?(x=(0,$.jsx)(`input`,{className:`mt-4 w-full rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg`,value:g,onChange:y,placeholder:o.toolsDialogSearchPlaceholder,"aria-label":o.toolsDialogSearchPlaceholder}),t[69]=g,t[70]=o.toolsDialogSearchPlaceholder,t[71]=x):x=t[71];let S=e&&!f&&!m?(0,$.jsx)(`p`,{role:`status`,className:`mt-2 text-xs text-fg-muted`,children:o.toolsSearchSummary.replace(`{{visible}}`,String(d.length)).replace(`{{count}}`,String(u.length))}):null;t[72]!==p||t[73]!==v||t[74]!==x||t[75]!==S?(E=(0,$.jsxs)(`div`,{className:`shrink-0 border-b border-edge p-5`,children:[p,v,x,S]}),t[72]=p,t[73]=v,t[74]=x,t[75]=S,t[76]=E):E=t[76],A=`min-h-0 flex-1 overflow-y-auto p-5`,j=f,t[77]!==o.toolsTitle||t[78]!==u.length?(M=o.toolsTitle.replace(`{{count}}`,String(u.length)),t[77]=o.toolsTitle,t[78]=u.length,t[79]=M):M=t[79],N=f?(0,$.jsx)(`div`,{role:`status`,"aria-label":o.toolsLoading,className:`space-y-3`,children:[0,1,2].map(ln)}):m?(0,$.jsxs)(`div`,{role:`alert`,className:`space-y-3`,children:[(0,$.jsx)(`p`,{className:`whitespace-pre-wrap break-words text-sm text-danger`,children:m}),(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:o.toolsRetryHint}),c?(0,$.jsx)(X,{variant:`secondary`,onClick:()=>{b.current=!0,c()},children:o.setupConfigure}):null]}):d.length?(0,$.jsx)(`div`,{className:`space-y-3`,children:d.map(e=>(0,$.jsxs)(`article`,{className:`rounded-lg border border-edge p-4`,children:[(0,$.jsx)(`h3`,{className:`break-all font-mono text-sm font-semibold text-fg`,children:e.name.startsWith(l)?e.name.slice(l.length):e.name}),e.exposure&&Object.hasOwn(o.exposureLabels,e.exposure)?(0,$.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:o.exposureLabels[e.exposure]}):null,e.description?(0,$.jsx)(`p`,{className:`mt-2 whitespace-pre-wrap break-words text-sm text-fg-muted`,children:e.description}):null,(0,$.jsxs)(`details`,{className:`mt-3`,children:[(0,$.jsx)(`summary`,{className:`cursor-pointer text-sm text-accent-fg`,children:o.toolDetails}),(0,$.jsx)(`p`,{className:`mt-2 break-all font-mono text-xs text-fg-muted`,children:e.name}),(0,$.jsx)(`pre`,{className:`mt-2 overflow-x-auto rounded-md bg-surface-panel p-3 text-xs text-fg`,children:JSON.stringify(e.inputSchema,null,2)})]})]},e.name))}):(0,$.jsxs)(`div`,{className:`space-y-3`,children:[(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:u.length?o.toolsDialogSearchEmpty:o.toolsEmpty}),e?(0,$.jsx)(X,{variant:`secondary`,onClick:()=>_(``),children:o.toolsClearSearch}):null]}),t[14]=r,t[15]=m,t[16]=f,t[17]=s,t[18]=c,t[19]=g,t[20]=i,t[21]=n,t[22]=o.exposureLabels,t[23]=o.setupConfigure,t[24]=o.toolDetails,t[25]=o.toolsClearSearch,t[26]=o.toolsDialogSearchEmpty,t[27]=o.toolsDialogSearchPlaceholder,t[28]=o.toolsDialogSubtitle,t[29]=o.toolsDialogTitle,t[30]=o.toolsEmpty,t[31]=o.toolsLoading,t[32]=o.toolsRetryHint,t[33]=o.toolsSearchSummary,t[34]=o.toolsTitle,t[35]=u,t[36]=C,t[37]=w,t[38]=T,t[39]=E,t[40]=D,t[41]=O,t[42]=k,t[43]=A,t[44]=j,t[45]=M,t[46]=N,t[47]=P,t[48]=F}else C=t[36],w=t[37],T=t[38],E=t[39],D=t[40],O=t[41],k=t[42],A=t[43],j=t[44],M=t[45],N=t[46],P=t[47],F=t[48];let I;t[80]!==A||t[81]!==j||t[82]!==M||t[83]!==N?(I=(0,$.jsx)(`div`,{className:A,"aria-busy":j,"aria-label":M,children:N}),t[80]=A,t[81]=j,t[82]=M,t[83]=N,t[84]=I):I=t[84];let L;t[85]===Symbol.for(`react.memo_cache_sentinel`)?(L=()=>y(cn),t[85]=L):L=t[85];let R;t[86]!==f||t[87]!==o.refreshTools?(R=(0,$.jsx)(X,{variant:`secondary`,disabled:f,onClick:L,children:o.refreshTools}),t[86]=f,t[87]=o.refreshTools,t[88]=R):R=t[88];let z;t[89]!==s||t[90]!==o.toolsDialogClose?(z=(0,$.jsx)(Z,{asChild:!0,children:(0,$.jsx)(X,{onClick:s,children:o.toolsDialogClose})}),t[89]=s,t[90]=o.toolsDialogClose,t[91]=z):z=t[91];let B;t[92]!==R||t[93]!==z?(B=(0,$.jsxs)(`div`,{className:`flex shrink-0 justify-end gap-2 border-t border-edge p-4`,children:[R,z]}),t[92]=R,t[93]=z,t[94]=B):B=t[94];let V;t[95]!==C||t[96]!==E||t[97]!==I||t[98]!==B||t[99]!==P||t[100]!==F?(V=(0,$.jsxs)(C,{onCloseAutoFocus:P,className:F,children:[E,I,B]}),t[95]=C,t[96]=E,t[97]=I,t[98]=B,t[99]=P,t[100]=F,t[101]=V):V=t[101];let H;t[102]!==w||t[103]!==D||t[104]!==V?(H=(0,$.jsxs)(w,{children:[D,V]}),t[102]=w,t[103]=D,t[104]=V,t[105]=H):H=t[105];let ee;return t[106]!==T||t[107]!==O||t[108]!==k||t[109]!==H?(ee=(0,$.jsx)(T,{open:O,onOpenChange:k,children:H}),t[106]=T,t[107]=O,t[108]=k,t[109]=H,t[110]=ee):ee=t[110],ee}function cn(e){return e+1}function ln(e){return(0,$.jsx)(se,{className:`h-24 w-full`},e)}function un(e){if(e.transport===`stdio`)return e.command.trim();try{let t=new URL(e.url);return`${t.protocol}//${t.host}${t.pathname}`}catch{return e.url.trim().split(/[?#]/,1)[0].replace(/\/\/[^/]*@/,`//`)}}function dn({row:e,lastCheck:t,t:n,cs:r,onEdit:i,onRemove:a}){let o=oe(e=>e.language),[s,c]=(0,Q.useState)(!1),l=(0,Q.useRef)(null),[u,d]=(0,Q.useState)(!1),[f,p]=(0,Q.useState)(``),m=e.displayName||e.id,h=un(e),v=e.extra.enabled===!1,y=v?_:t?g:C,b=e.transport===`stdio`?W:ee,x=v?n.setupDisabled:t?r.customCheckSucceeded:r.customUnchecked,S=t?new Intl.DateTimeFormat(o,{dateStyle:`medium`,timeStyle:`short`}).format(new Date(t.checkedAt)):null;return(0,$.jsxs)(`li`,{className:`flex min-h-[8.75rem] min-w-0 flex-col rounded-xl border border-edge bg-surface-panel p-4 transition-colors hover:bg-surface-hover/45 focus-within:ring-2 focus-within:ring-accent/30`,children:[(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,$.jsxs)(`div`,{className:`flex min-w-0 items-start gap-3`,children:[(0,$.jsx)(`div`,{title:n.transportLabels[e.transport],className:`flex size-9 shrink-0 items-center justify-center rounded-xl border border-edge-subtle bg-surface-inset text-fg-muted`,children:(0,$.jsx)(b,{className:`size-4`,"aria-hidden":!0})}),(0,$.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-col items-start gap-1`,children:[(0,$.jsx)(`h3`,{className:`min-w-0 max-w-full text-sm font-semibold text-fg`,children:(0,$.jsx)(`button`,{type:`button`,onClick:i,title:m,className:`block max-w-full truncate rounded text-left hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:m})}),(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 text-[11px]`,children:[(0,$.jsxs)(`span`,{title:S?r.customLastChecked.replace(`{{time}}`,S):void 0,"aria-label":S?`${x} · ${r.customLastChecked.replace(`{{time}}`,S)}`:x,className:K(`inline-flex shrink-0 items-center gap-1`,!v&&t?`text-emerald-700 dark:text-emerald-300`:`text-fg-muted`),children:[(0,$.jsx)(y,{className:`size-3.5`,"aria-hidden":!0}),x]}),t?(0,$.jsx)(`span`,{className:`text-fg-muted`,children:r.customToolCount.replace(`{{count}}`,String(t.toolCount))}):null]})]})})]}),(0,$.jsx)(`p`,{title:h,className:`mt-2 truncate font-mono text-xs leading-5 text-fg-muted`,children:h})]}),(0,$.jsxs)(`div`,{className:`mt-2 flex shrink-0 items-center gap-1`,children:[(0,$.jsx)(`span`,{className:`mr-auto text-[11px] text-fg-subtle`,children:n.transportLabels[e.transport]}),(0,$.jsx)(X,{variant:`ghost`,className:`h-8 px-2 py-1 text-xs`,onClick:i,children:n.setupConfigure}),(0,$.jsx)(X,{ref:l,variant:`secondary`,className:`h-8 px-2 py-1 text-xs shadow-none sm:shadow-none`,disabled:v,onClick:()=>c(!0),children:n.viewTools}),(0,$.jsxs)(rt,{children:[(0,$.jsx)(nt,{asChild:!0,children:(0,$.jsx)(X,{variant:`ghost`,className:`size-8 p-0`,"aria-label":r.customManage.replace(`{{name}}`,m),title:r.customManage.replace(`{{name}}`,m),children:(0,$.jsx)(T,{className:`size-4`,"aria-hidden":!0})})}),(0,$.jsx)(tt,{children:(0,$.jsx)(at,{align:`end`,sideOffset:6,className:`z-50 min-w-36 rounded-xl border border-edge bg-surface-overlay p-1 shadow-popover`,children:(0,$.jsxs)(it,{onSelect:()=>d(!0),className:`flex cursor-pointer items-center gap-2 rounded-lg px-3 py-2 text-sm text-danger outline-none data-[highlighted]:bg-surface-hover`,children:[(0,$.jsx)(ne,{className:`size-4`,"aria-hidden":!0}),n.removeServer]})})})]})]}),f?(0,$.jsx)(`p`,{role:`alert`,className:`mt-2 text-sm text-danger`,children:f}):null,s?(0,$.jsx)(sn,{serverId:e.id,displayName:e.displayName,returnFocusTo:l.current,t:n,onClose:()=>c(!1),onConfigure:()=>{c(!1),i()}}):null,(0,$.jsx)(et,{open:u,title:r.removeConfirmTitle.replace(`{{name}}`,m),description:r.removeConfirmDescription,confirmLabel:n.removeServer,cancelLabel:r.modalCancel,destructive:!0,onCancel:()=>d(!1),onConfirm:()=>{d(!1),p(``),a().catch(()=>p(n.setupRemoveFailed))}})]})}function fn(e){let t=(0,ft.c)(30),{servers:n,lastChecks:r,t:i,cs:a,onAdd:o,onEdit:s,onRemove:c}=e,l;t[0]===a.customIntegrationsTitle?l=t[1]:(l=(0,$.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:a.customIntegrationsTitle}),t[0]=a.customIntegrationsTitle,t[1]=l);let u;t[2]===n.length?u=t[3]:(u=(0,$.jsx)(`span`,{className:`rounded-md bg-surface-inset px-1.5 py-0.5 text-xs tabular-nums text-fg-muted`,children:n.length}),t[2]=n.length,t[3]=u);let d;t[4]!==l||t[5]!==u?(d=(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[l,u]}),t[4]=l,t[5]=u,t[6]=d):d=t[6];let f;t[7]===a.customIntegrationsHint?f=t[8]:(f=(0,$.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:a.customIntegrationsHint}),t[7]=a.customIntegrationsHint,t[8]=f);let p;t[9]!==d||t[10]!==f?(p=(0,$.jsxs)(`div`,{className:`min-w-0`,children:[d,f]}),t[9]=d,t[10]=f,t[11]=p):p=t[11];let m;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,$.jsx)(B,{className:`size-3.5`,"aria-hidden":!0}),t[12]=m):m=t[12];let h;t[13]!==a.customAdd||t[14]!==o?(h=(0,$.jsxs)(X,{variant:`secondary`,className:`shrink-0 text-xs shadow-none sm:shadow-none`,onClick:o,children:[m,a.customAdd]}),t[13]=a.customAdd,t[14]=o,t[15]=h):h=t[15];let g;t[16]!==p||t[17]!==h?(g=(0,$.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-center justify-between gap-3`,children:[p,h]}),t[16]=p,t[17]=h,t[18]=g):g=t[18];let _;t[19]!==a||t[20]!==r||t[21]!==s||t[22]!==c||t[23]!==n||t[24]!==i?(_=n.length?(0,$.jsx)(`ul`,{className:`grid gap-4 sm:grid-cols-2 xl:grid-cols-3`,children:n.map(e=>(0,$.jsx)(dn,{row:e,lastCheck:r[e.id],t:i,cs:a,onEdit:()=>s(e),onRemove:()=>c(e)},e.clientKey))}):(0,$.jsx)(`p`,{className:`rounded-xl border border-dashed border-edge px-5 py-8 text-center text-sm text-fg-muted`,children:a.customEmpty}),t[19]=a,t[20]=r,t[21]=s,t[22]=c,t[23]=n,t[24]=i,t[25]=_):_=t[25];let v;return t[26]!==a.customIntegrationsTitle||t[27]!==g||t[28]!==_?(v=(0,$.jsxs)(`section`,{"aria-label":a.customIntegrationsTitle,children:[g,_]}),t[26]=a.customIntegrationsTitle,t[27]=g,t[28]=_,t[29]=v):v=t[29],v}function pn(e){return e.format===`agent-plugin`&&!!e.pluginId&&(!!e.setup?.authorizations?.length||e.authorizationStatus===`required`||!!e.components?.mcp.some(e=>e.type!==`stdio`))}function mn(e){let t=(0,ft.c)(54),{extension:n,language:r,onOpen:i}=e,a;t[0]===r?a=t[1]:(a=r.startsWith(`zh`),t[0]=r,t[1]=a);let o=a,s;t[2]===o?s=t[3]:(s=(e,t)=>o?e:t,t[2]=o,t[3]=s);let c=s,l=n.installationState===`preparing`,u=n.activationEligible===!1,f=n.authorizationStatus===`required`,p;t[4]!==u||t[5]!==n.readiness||t[6]!==f||t[7]!==l||t[8]!==c?(p=l?c(`准备未完成`,`Setup incomplete`):u?c(`已停用`,`Disabled`):f?c(`需要授权`,`Authorization required`):n.readiness===`blocked`||n.readiness===`degraded`?c(`需要处理`,`Needs attention`):c(`已连接`,`Connected`),t[4]=u,t[5]=n.readiness,t[6]=f,t[7]=l,t[8]=c,t[9]=p):p=t[9];let m=p,v;t[10]!==u||t[11]!==f||t[12]!==l||t[13]!==c?(v=l?c(`继续安装`,`Continue setup`):!u&&f?c(`去授权`,`Connect account`):c(`查看详情`,`View details`),t[10]=u,t[11]=f,t[12]=l,t[13]=c,t[14]=v):v=t[14];let y=v,b;t[15]===n.setup?.authorizations?b=t[16]:(b=n.setup?.authorizations??[],t[15]=n.setup?.authorizations,t[16]=b);let x=b,S=x.length===1?x[0].title:n.name,w=l||!u&&(f||n.readiness===`blocked`||n.readiness===`degraded`),T=l?C:u?_:w?h:g,E=w&&`border-amber-500/25`,D;t[17]===E?D=t[18]:(D=K(`flex min-h-[8.75rem] w-full min-w-0 flex-col rounded-xl border border-edge bg-surface-panel p-4 text-left transition-colors hover:bg-surface-hover/45 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-accent`,E),t[17]=E,t[18]=D);let O=n.branding?.iconUrl,k;t[19]===O?k=t[20]:(k=(0,$.jsx)(st,{iconUrl:O,fallback:z,className:`size-9`}),t[19]=O,t[20]=k);let A;t[21]===S?A=t[22]:(A=(0,$.jsx)(`span`,{className:`block truncate text-sm font-semibold text-fg`,title:S,children:S}),t[21]=S,t[22]=A);let j=w?`text-amber-700 dark:text-amber-300`:u?`text-fg-muted`:`text-emerald-700 dark:text-emerald-300`,M;t[23]===j?M=t[24]:(M=K(`mt-1 inline-flex items-center gap-1 text-[11px]`,j),t[23]=j,t[24]=M);let N;t[25]===T?N=t[26]:(N=(0,$.jsx)(T,{className:`size-3.5`,"aria-hidden":!0}),t[25]=T,t[26]=N);let P;t[27]!==m||t[28]!==M||t[29]!==N?(P=(0,$.jsxs)(`span`,{className:M,children:[N,m]}),t[27]=m,t[28]=M,t[29]=N,t[30]=P):P=t[30];let F;t[31]!==A||t[32]!==P?(F=(0,$.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[A,P]}),t[31]=A,t[32]=P,t[33]=F):F=t[33];let I;t[34]!==F||t[35]!==k?(I=(0,$.jsxs)(`span`,{className:`flex w-full min-w-0 items-start gap-3`,children:[k,F]}),t[34]=F,t[35]=k,t[36]=I):I=t[36];let L=n.name,R;t[37]===c?R=t[38]:(R=c(`由插件提供`,`Provided by plugin`),t[37]=c,t[38]=R);let B;t[39]!==n.name||t[40]!==R?(B=(0,$.jsxs)(`span`,{className:`mt-2 block w-full truncate text-xs leading-5 text-fg-muted`,title:L,children:[R,` · `,n.name]}),t[39]=n.name,t[40]=R,t[41]=B):B=t[41];let V=w?`text-accent-fg`:`text-fg-muted`,H;t[42]===V?H=t[43]:(H=K(`mt-auto flex w-full items-center justify-end gap-1 pt-2 text-xs`,V),t[42]=V,t[43]=H);let ee;t[44]===Symbol.for(`react.memo_cache_sentinel`)?(ee=(0,$.jsx)(d,{className:`size-3.5 shrink-0`,"aria-hidden":!0}),t[44]=ee):ee=t[44];let U;t[45]!==y||t[46]!==H?(U=(0,$.jsxs)(`span`,{className:H,children:[y,ee]}),t[45]=y,t[46]=H,t[47]=U):U=t[47];let te;return t[48]!==i||t[49]!==I||t[50]!==B||t[51]!==U||t[52]!==D?(te=(0,$.jsxs)(`button`,{type:`button`,onClick:i,className:D,children:[I,B,U]}),t[48]=i,t[49]=I,t[50]=B,t[51]=U,t[52]=D,t[53]=te):te=t[53],te}function hn(e){let t=e.connectedAt?Date.parse(e.connectedAt):0;return Number.isFinite(t)?t:0}function gn(e,t){return e.status===`active`&&t.status!==`active`?-1:e.status!==`active`&&t.status===`active`?1:e.isCurrentAuthorization===t.isCurrentAuthorization?hn(t)-hn(e):e.isCurrentAuthorization?-1:1}function _n(e){let t=new Map;for(let n of e){let e=n.accountId??n.identityKey??`authorization:${n.id}`;t.set(e,[...t.get(e)??[],n])}return[...t.entries()].map(([e,t])=>{let n=[...t].sort(gn);return{key:e,primary:n[0],authorizations:n}}).sort((e,t)=>gn(e.primary,t.primary))}var vn=K(`w-full rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg`,`placeholder:text-fg-subtle`,Ye);function yn(e){return e.materialized.type===`composio`?e.materialized.toolkit:null}function bn(e,t){return e===`write`?t.composioScopeWrite:e===`admin`?t.composioScopeAdmin:t.composioScopeRead}function xn(e,t,n){return e.status===`connected`?j(n.composioHealthConnected,{count:String(t)}):e.status===`reauthorization_required`?n.composioHealthReconnect:e.status===`disconnected`?n.composioHealthDisconnected:e.errorCode===`missing_credential`?n.composioHealthMissingCredential:e.errorCode===`unauthorized`?n.composioHealthUnauthorized:e.errorCode===`forbidden`?n.composioHealthForbidden:e.errorCode===`network`?n.composioHealthNetwork:e.errorCode===`timeout`?n.composioHealthTimeout:n.composioHealthDegraded}function Sn(e,t){return e===`active`?t.composioConnectionHealthy:e===`pending`?t.composioConnectionPending:e===`expired`?t.composioConnectionExpired:e===`failed`?t.composioConnectionFailed:e===`revoked`||e===`disabled`?t.composioConnectionRevoked:t.composioConnectionUnknown}function Cn(e,t,n){return e.status===`paused`?t?.scanEnabled===!1?n.connectorLearningPausedByPolicy:n.connectorLearningPausedByFailure:e.status===`queued`?n.connectorLearningQueued:e.status===`running`?n.connectorLearningRunning:e.status===`completed`?n.connectorLearningCompleted:n.connectorLearningFailed}function wn({instance:e,t,onChanged:n}){let r=yn(e),i=oe(e=>e.language)===`zh`,[a,o]=(0,Q.useState)([]),[s,c]=(0,Q.useState)([]),[l,u]=(0,Q.useState)([]),[d,m]=(0,Q.useState)(null),[_,v]=(0,Q.useState)([]),[y,b]=(0,Q.useState)(null),[x,S]=(0,Q.useState)(null),[C,w]=(0,Q.useState)([]),[T,E]=(0,Q.useState)({}),[D,O]=(0,Q.useState)(`read`),[M,N]=(0,Q.useState)(!1),[P,F]=(0,Q.useState)(null),[L,R]=(0,Q.useState)(!1),[z,B]=(0,Q.useState)(null),[H,ee]=(0,Q.useState)(null),[U,te]=(0,Q.useState)(!1),[W,G]=(0,Q.useState)(!1),[re,ie]=(0,Q.useState)(!1),q=(0,Q.useRef)(0),ae=(0,Q.useRef)(0),J=(0,Q.useMemo)(()=>_n(a),[a]),Y=(0,Q.useCallback)(e=>new Promise((t,n)=>{let r=window.setTimeout(()=>n(Error(i?`连接服务响应超时,请重试。`:`The connection service timed out. Please retry.`)),15e3);e.then(t,n).finally(()=>window.clearTimeout(r))}),[i]),ce=(0,Q.useCallback)(async()=>{if(!r||e.materialized.type!==`composio`||e.materialized.role===`credential`)return;N(!0),F(null);let t=++q.current;try{let e=(await Promise.allSettled([Y(Ae()).then(e=>{t===q.current&&(o(e.filter(e=>e.toolkit.toLowerCase()===r.toLowerCase())),te(!0))}),Y(Ne(r)).then(e=>{t===q.current&&O(e)}),Y(Ue(r)).then(e=>{t===q.current&&(m(e.policy),v(e.agents))})])).find(e=>e.status===`rejected`);t===q.current&&e?.status===`rejected`&&F(String(e.reason instanceof Error?e.reason.message:e.reason))}finally{t===q.current&&N(!1)}},[e.materialized,r,Y]);(0,Q.useEffect)(()=>(ce(),()=>{q.current++}),[ce]);let le=(0,Q.useCallback)(async()=>{if(!r)return;let e=++ae.current;ie(!0),R(!1);let t=t=>n=>{e===ae.current&&t(n)},n=await Promise.allSettled([Y(We(r)).then(t(c)),Y(qe(20)).then(t(e=>u(e.filter(e=>!e.toolkit||e.toolkit.toLowerCase()===r.toLowerCase())))),Y(Be(r)).then(t(S)),Y(Ie(r)).then(t(b))]);e===ae.current&&(R(n.some(e=>e.status===`rejected`)),ie(!1))},[r,Y]);(0,Q.useEffect)(()=>(W&&le(),()=>{ae.current++}),[W,le]),(0,Q.useEffect)(()=>{let e=!1,t=_n(a).map(e=>e.primary).filter(e=>e.supportsLearning&&e.accountId);if(t.length)return Y(Ke()).then(t=>{e||w(t)}).catch(()=>{}),Promise.allSettled(t.map(async e=>[e.accountId,await Y(Le(e.accountId))])).then(t=>{e||E(Object.fromEntries(t.flatMap(e=>e.status===`fulfilled`?[e.value]:[])))}),()=>{e=!0}},[a,Y]);let Z=(0,Q.useCallback)(async i=>{if(!r)return;let a=Xe()?null:window.open(`about:blank`,`_blank`);a&&(a.opener=null),N(!0),F(null);try{if(!Xe()&&!a)throw Error(`Allow popups to open the authorization page.`);let t=await Fe(e.connectorId,i);if(!t.authorizationUrl)throw Error(`The authorization provider did not return an authorization URL.`);if(Xe()){let e=await window.electronAPI?.shell?.openExternalUrl(t.authorizationUrl);if(!e?.ok)throw Error(e?.error??`Could not open the system browser.`)}else a.location.href=t.authorizationUrl;let o=await Je(r,t.connectionId,12e4,t.attemptId);if(i&&o.accountId!==i)throw Error(`A different account was authorized. The original account and its task bindings were not changed.`);await Promise.all([n?.(),ce()])}catch(e){F(I(e,t))}finally{a?.close(),N(!1)}},[e.connectorId,ce,n,t,r]),ue=(0,Q.useCallback)(async t=>{N(!0),F(null);try{await Ce(e.instanceId,{config:{...e.config??{},authConfigId:t||void 0}}),await Promise.all([n?.(),ce()])}catch(e){F(e instanceof Error?e.message:String(e))}finally{N(!1)}},[e.config,e.instanceId,ce,n]),de=async e=>{let t=Xe()?null:window.open(`about:blank`,`_blank`);t&&(t.opener=null),F(null);try{let n=await Me(e.id);if(n.authorizationUrl)if(Xe())await window.electronAPI?.shell?.openExternalUrl(n.authorizationUrl);else if(t)t.location.href=n.authorizationUrl;else throw Error(`Allow popups to reopen authorization.`);else t?.close(),await ce()}catch(e){t?.close(),F(e instanceof Error?e.message:String(e))}},fe=(0,Q.useCallback)(async e=>{if(r){O(e),F(null);try{await Ee(r,e)}catch(e){F(e instanceof Error?e.message:String(e)),await ce()}}},[ce,r]),pe=(0,Q.useCallback)(async e=>{if(r){F(null);try{m(await Se(r,e))}catch(e){F(e instanceof Error?e.message:String(e))}}},[r]),me=(0,Q.useCallback)(e=>{if(!d)return;let t=d.allowedAgentIds.includes(e);if(t&&d.allowedAgentIds.length===1)return;let n=t?d.allowedAgentIds.filter(t=>t!==e):[...d.allowedAgentIds,e];pe({allowedAgentIds:n})},[pe,d]),he=(0,Q.useCallback)(async e=>{N(!0),F(null);try{await e(),await ce()}catch(e){F(e instanceof Error?e.message:String(e))}finally{N(!1)}},[ce]);if(!r)return null;if(e.materialized.type===`composio`&&e.materialized.role===`credential`)return(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:t.composioApiKeyStored});let ge=J.filter(e=>e.primary.status===`active`).length,_e=ge>0?t.composioAddAccount:t.composioConnectAccount,ve=U&&ge>0,we=x?.requiresCustomAuthConfig===!0,Te=x?.authConfigs.filter(e=>e.status===`ENABLED`&&e.isEnabledForToolRouter)??[];return(0,$.jsxs)(`div`,{className:`space-y-5`,children:[(0,$.jsxs)(`section`,{className:`flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between`,children:[(0,$.jsxs)(`div`,{className:`min-w-0`,children:[(0,$.jsxs)(`span`,{className:K(`inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-xs font-medium`,ve?`bg-emerald-500/10 text-emerald-700 dark:text-emerald-300`:`bg-amber-500/10 text-amber-700 dark:text-amber-300`),children:[ve?(0,$.jsx)(g,{className:`size-3.5`}):(0,$.jsx)(h,{className:`size-3.5`}),ve?t.connectionReady:U||P?t.connectionNeedsSetup:t.connectionChecking]}),U&&(0,$.jsx)(`p`,{className:`mt-2 text-sm text-fg-muted`,children:j(t.composioAccountCount,{count:String(J.length)})})]}),(0,$.jsxs)(X,{variant:`primary`,className:`shrink-0`,disabled:M,onClick:()=>void Z(),children:[M?(0,$.jsx)(A,{className:`size-4 animate-spin`}):(0,$.jsx)(k,{className:`size-4`}),_e]})]}),P?(0,$.jsxs)(`div`,{role:`alert`,className:`flex flex-wrap items-center justify-between gap-2 rounded-xl border border-danger/20 bg-danger/5 px-3 py-2 text-sm text-danger`,children:[(0,$.jsx)(`p`,{children:P}),(0,$.jsx)(X,{variant:`secondary`,disabled:M,onClick:()=>void ce(),children:t.composioRetry})]}):null,y&&!ve?(0,$.jsxs)(`div`,{className:`flex flex-col gap-3 rounded-xl border border-amber-500/25 bg-amber-500/5 p-4 sm:flex-row sm:items-center sm:justify-between`,children:[(0,$.jsx)(`p`,{className:`text-sm text-amber-800 dark:text-amber-200`,children:xn(y,ge,t)}),y.recovery===`none`?null:(0,$.jsx)(X,{variant:`secondary`,disabled:M,onClick:()=>void(y.recovery===`retry`?ce():Z()),children:y.recovery===`retry`?t.composioRetry:t.composioReconnectAccount})]}):null,we&&Te.length===0?(0,$.jsx)(`p`,{className:`rounded-xl border border-amber-500/25 bg-amber-500/5 px-4 py-3 text-sm text-amber-800 dark:text-amber-200`,children:t.composioAuthConfigEmpty}):null,d?(0,$.jsxs)(`section`,{className:`overflow-hidden rounded-xl border border-edge bg-surface-base`,children:[(0,$.jsxs)(`div`,{className:`grid gap-3 border-b border-edge-subtle px-4 py-4 sm:grid-cols-[minmax(0,1fr)_15rem] sm:items-start`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:t.composioAccessTitle}),(0,$.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:D===`read`?t.composioAccessReadHint:D===`admin`?t.composioAccessAdminHint:t.composioAccessWriteHint})]}),(0,$.jsxs)(f,{value:D,onChange:e=>void fe(e.currentTarget.value),children:[(0,$.jsx)(p,{value:`read`,children:t.composioAccessReadOnly}),(0,$.jsx)(p,{value:`write`,children:t.composioAccessReadWrite}),D===`admin`?(0,$.jsx)(p,{value:`admin`,children:t.composioAccessAdminCurrent}):null]})]}),(0,$.jsxs)(`details`,{children:[(0,$.jsx)(`summary`,{className:`cursor-pointer px-4 py-3 text-sm text-fg-muted`,children:t.composioAdvancedSettings}),(0,$.jsxs)(`div`,{className:`grid gap-3 border-b border-edge-subtle px-4 py-4 sm:grid-cols-[minmax(0,1fr)_15rem] sm:items-center`,children:[(0,$.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:t.composioConfirmationPolicy}),(0,$.jsxs)(f,{value:d.confirmationPolicy,onChange:e=>void pe({confirmationPolicy:e.currentTarget.value}),children:[(0,$.jsx)(p,{value:`writes`,children:t.composioConfirmWrites}),(0,$.jsx)(p,{value:`always`,children:t.composioConfirmAlways}),d.confirmationPolicy===`never`?(0,$.jsx)(p,{value:`never`,children:t.composioConfirmNever}):null]})]}),(0,$.jsxs)(`div`,{className:`px-4 py-4`,children:[(0,$.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:t.composioAllowedAgents}),(0,$.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:d.allowedAgentIds.length?t.composioAllowedAgentsSelected:t.composioAllowedAgentsAll}),(0,$.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:[(0,$.jsx)(`button`,{type:`button`,className:K(`rounded-full border px-2.5 py-1 text-xs transition-colors`,d.allowedAgentIds.length===0?`border-accent bg-accent/10 text-accent`:`border-edge bg-surface-panel text-fg-muted hover:text-fg`),onClick:()=>void pe({allowedAgentIds:[]}),children:t.composioAllowedAgentsAllOption}),_.map(e=>(0,$.jsx)(`button`,{type:`button`,className:K(`rounded-full border px-2.5 py-1 text-xs transition-colors`,d.allowedAgentIds.includes(e.id)?`border-accent bg-accent/10 text-accent`:`border-edge bg-surface-panel text-fg-muted hover:text-fg`),onClick:()=>me(e.id),children:e.name},e.id))]})]}),(0,$.jsxs)(`fieldset`,{className:`space-y-2 border-t border-edge-subtle p-4 text-xs text-fg-muted`,children:[(0,$.jsx)(`legend`,{children:i?`可用账号范围`:`Available accounts`}),(0,$.jsxs)(`label`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(`input`,{type:`checkbox`,checked:d.selectedAccountIds===null,disabled:M,onChange:e=>void pe({selectedAccountIds:e.currentTarget.checked?null:[]})}),i?`所有账号(包括以后新增)`:`All accounts, including new ones`]}),d.selectedAccountIds!==null&&J.map(({primary:e})=>e.accountId&&(0,$.jsxs)(`label`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(`input`,{type:`checkbox`,disabled:M,checked:d.selectedAccountIds.includes(e.accountId),onChange:t=>void pe({selectedAccountIds:t.currentTarget.checked?[...d.selectedAccountIds,e.accountId]:d.selectedAccountIds.filter(t=>t!==e.accountId)})}),e.alias??e.accountEmail??e.accountId]},e.accountId)),d.selectedAccountIds?.length===0&&(0,$.jsx)(`p`,{children:i?`未选择账号,Agent 无法使用此应用。`:`No accounts selected. Agents cannot use this app.`})]})]})]}):null,(0,$.jsxs)(`section`,{children:[(0,$.jsxs)(`div`,{className:`mb-3 flex items-center justify-between gap-3`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:t.composioConnectedAccounts}),U&&(0,$.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:j(t.composioAccountCount,{count:String(J.length)})})]}),(0,$.jsxs)(X,{variant:`ghost`,className:`h-8 px-2 text-xs`,disabled:M,onClick:()=>void ce(),children:[(0,$.jsx)(V,{className:K(`size-3.5`,M&&`animate-spin`)}),t.refresh]})]}),J.length?(0,$.jsx)(`div`,{className:`divide-y divide-edge-subtle overflow-hidden rounded-xl border border-edge bg-surface-base`,children:J.map(e=>{let r=e.primary,a=C.find(e=>r.accountId?e.accountId===r.accountId:e.connectionId===r.id),o=r.accountId?T[r.accountId]:void 0;return(0,$.jsxs)(`article`,{className:`px-4 py-4`,children:[(0,$.jsxs)(`div`,{className:`flex flex-col items-start justify-between gap-3 sm:flex-row`,children:[(0,$.jsxs)(`div`,{className:`min-w-0`,children:[(0,$.jsx)(`div`,{className:`flex flex-wrap items-center gap-2`,children:(0,$.jsx)(`p`,{className:`truncate text-sm font-medium text-fg`,children:r.alias??r.workspace??r.accountEmail??r.username??t.composioUnnamedAuthorization})}),(0,$.jsx)(`p`,{className:`mt-1 break-all text-xs text-fg-muted`,children:r.accountEmail??r.username??r.workspace??r.accountId}),r.backendLabel&&(0,$.jsx)(`p`,{className:`mt-1 text-xs text-fg-subtle`,children:r.backendLabel}),(0,$.jsx)(`p`,{className:K(`mt-1 text-xs`,r.status===`active`?`text-emerald-700 dark:text-emerald-300`:`text-amber-700 dark:text-amber-300`),children:r.accountEnabled===!1?i?`已暂停`:`Paused`:Sn(r.status,t)}),a?(0,$.jsx)(`p`,{className:K(`mt-1 text-xs`,a.status===`failed`?`text-red-600`:`text-fg-subtle`),children:j(t.connectorLearningStatus,{status:Cn(a,o,t),count:String(a.candidatesCreated)})}):null]}),(0,$.jsxs)(`div`,{className:`flex shrink-0 flex-wrap gap-2`,children:[r.status===`pending`&&(0,$.jsx)(X,{variant:`secondary`,className:`h-8 px-2.5 text-xs`,onClick:()=>void de(r),children:i?`继续授权`:`Continue authorization`}),r.accountId&&(0,$.jsx)(X,{variant:`ghost`,className:`h-8 px-2.5 text-xs text-danger`,disabled:M,onClick:()=>ee(r.accountId),children:i?`断开`:`Disconnect`}),r.accountId&&r.status!==`active`&&(0,$.jsx)(X,{variant:`secondary`,className:`h-8 px-2.5 text-xs`,disabled:M,onClick:()=>void Z(r.accountId),children:t.composioReconnectAccount}),r.accountId&&(0,$.jsx)(X,{variant:`secondary`,className:`h-8 px-2.5 text-xs`,disabled:M,onClick:()=>void he(()=>De(r.accountId,{enabled:r.accountEnabled===!1})),children:r.accountEnabled===!1?i?`启用`:`Enable`:i?`暂停`:`Pause`}),r.supportsLearning&&r.status===`active`&&r.accountEnabled!==!1?(0,$.jsxs)(X,{variant:`secondary`,className:`h-8 shrink-0 px-2.5 text-xs`,disabled:M,onClick:()=>void he(async()=>{if(!r.accountId)throw Error(`Connector account is unavailable.`);await ye(r.accountId),await n?.()}),children:[(0,$.jsx)(V,{className:`size-3.5`}),t.composioSyncNow]}):null]})]}),(0,$.jsxs)(`details`,{className:`mt-3 text-xs text-fg-muted`,children:[(0,$.jsx)(`summary`,{className:`w-fit cursor-pointer font-medium hover:text-fg`,children:t.composioAccountSettings}),(0,$.jsxs)(`div`,{className:`mt-3 space-y-4 rounded-lg bg-surface-panel p-3`,children:[r.accountId&&(0,$.jsxs)(`fieldset`,{className:`space-y-2`,children:[(0,$.jsx)(`legend`,{className:`mb-2 font-medium`,children:t.composioAllowedAgents}),(0,$.jsxs)(`label`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(`input`,{type:`checkbox`,disabled:M,checked:r.allowedAgentIds==null,onChange:e=>void he(()=>De(r.accountId,{allowedAgentIds:e.currentTarget.checked?null:[]}))}),t.composioAllowedAgentsAllOption]}),r.allowedAgentIds!=null&&_.map(e=>(0,$.jsxs)(`label`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(`input`,{type:`checkbox`,disabled:M,checked:r.allowedAgentIds.includes(e.id),onChange:t=>{let n=t.currentTarget.checked;he(()=>De(r.accountId,{allowedAgentIds:n?[...r.allowedAgentIds,e.id]:r.allowedAgentIds.filter(t=>t!==e.id)}))}}),e.name]},e.id)),r.allowedAgentIds?.length===0&&(0,$.jsx)(`p`,{children:i?`未选择 Agent:任何 Agent 都不能使用此账号。`:`No agents selected: this account is unavailable to all agents.`})]}),r.supportsLearning&&o?(0,$.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,$.jsxs)(`label`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(`input`,{type:`checkbox`,checked:o.scanEnabled,disabled:M,onChange:e=>void he(()=>Oe(r.accountId,{scanEnabled:e.currentTarget.checked}))}),t.connectorScheduledScan]}),o.scanEnabled?(0,$.jsxs)(`label`,{className:`sm:col-span-2`,children:[t.connectorScanInterval,(0,$.jsxs)(f,{className:`mt-1`,value:String(o.intervalMinutes??30),disabled:M,onChange:e=>void he(()=>Oe(r.accountId,{intervalMinutes:Number(e.currentTarget.value)})),children:[(0,$.jsxs)(p,{value:`5`,children:[`5 `,t.connectorMinutes]}),(0,$.jsxs)(p,{value:`15`,children:[`15 `,t.connectorMinutes]}),(0,$.jsxs)(p,{value:`30`,children:[`30 `,t.connectorMinutes]}),(0,$.jsxs)(p,{value:`60`,children:[`60 `,t.connectorMinutes]})]})]}):null]}):null,(0,$.jsxs)(`label`,{className:`block`,children:[t.composioAccountAlias,(0,$.jsx)(`input`,{className:K(vn,`mt-1 h-8 py-1 text-xs`),defaultValue:r.alias??``,onBlur:e=>{e.currentTarget.value!==(r.alias??``)&&he(()=>xe(r.id,{alias:e.currentTarget.value}))}})]}),(0,$.jsx)(`div`,{className:`space-y-2`,children:e.authorizations.map(e=>(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,$.jsxs)(`p`,{className:`min-w-0 break-all font-mono text-fg-subtle`,children:[t.composioAuthorizationId,`: `,e.providerConnectionId]}),(0,$.jsx)(X,{variant:`ghost`,className:`size-7 shrink-0 p-0 text-danger`,title:t.composioRevoke,disabled:M,onClick:()=>B(e.id),children:(0,$.jsx)(ne,{className:`size-3.5`})})]},e.id))}),(0,$.jsx)(`div`,{className:`flex justify-end gap-1`,children:(0,$.jsx)(X,{variant:`ghost`,className:`size-8 p-0`,title:t.refresh,disabled:M,onClick:()=>void he(()=>ke(r.id)),children:(0,$.jsx)(V,{className:`size-4`})})})]})]})]},e.key)})}):M&&!U?(0,$.jsxs)(`div`,{"aria-busy":`true`,"aria-label":t.connectionChecking,className:`space-y-3`,children:[(0,$.jsx)(se,{className:`h-16 w-full`}),(0,$.jsx)(se,{className:`h-16 w-full`})]}):U?(0,$.jsx)(`div`,{className:`rounded-xl border border-dashed border-edge px-4 py-8 text-center`,children:(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:t.composioConnectionsEmpty})}):null]}),(0,$.jsxs)(`details`,{className:`rounded-xl border border-edge bg-surface-base`,onToggle:e=>G(e.currentTarget.open),children:[(0,$.jsx)(`summary`,{className:`cursor-pointer px-4 py-3 text-sm font-medium text-fg-muted hover:text-fg`,children:t.composioAdvancedSettings}),(0,$.jsxs)(`div`,{className:`space-y-5 border-t border-edge-subtle px-4 py-4`,children:[re?(0,$.jsx)(se,{"aria-label":t.connectionChecking,className:`h-16 w-full`}):null,L?(0,$.jsxs)(`p`,{className:`rounded-lg bg-amber-500/10 px-3 py-2 text-xs text-amber-800 dark:text-amber-200`,children:[t.composioDiagnosticsUnavailable,(0,$.jsx)(X,{variant:`ghost`,disabled:re,onClick:()=>void le(),children:t.composioRetry})]}):null,x?.mode===`byok`?(0,$.jsxs)(`section`,{children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-2`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:t.composioAuthConfigTitle}),(0,$.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:we?t.composioAuthConfigRequiredHint:t.composioAuthConfigOptionalHint})]}),(0,$.jsx)(`a`,{className:`text-xs font-medium text-accent-fg hover:underline`,href:`https://app.composio.dev`,target:`_blank`,rel:`noreferrer`,children:t.composioAuthConfigManage})]}),(0,$.jsxs)(f,{className:`mt-3`,value:typeof e.config?.authConfigId==`string`?e.config.authConfigId:``,disabled:M,onChange:e=>void ue(e.currentTarget.value),children:[we?null:(0,$.jsx)(p,{value:``,children:t.composioAuthConfigManaged}),we&&typeof e.config?.authConfigId!=`string`?(0,$.jsx)(p,{value:``,disabled:!0,children:t.composioAuthConfigSelect}):null,Te.map(e=>(0,$.jsxs)(p,{value:e.id,children:[e.name,` · `,e.authScheme??`OAuth`]},e.id))]})]}):null,(0,$.jsxs)(`div`,{className:`grid gap-5 sm:grid-cols-2`,children:[(0,$.jsxs)(`section`,{children:[(0,$.jsx)(`p`,{className:`mb-2 text-xs font-medium uppercase tracking-wide text-fg-subtle`,children:t.composioAgentTools}),(0,$.jsx)(`div`,{className:`space-y-2`,children:s.length?s.slice(0,8).map(e=>(0,$.jsxs)(`div`,{className:`rounded-lg bg-surface-panel px-3 py-2`,children:[(0,$.jsx)(`p`,{className:`truncate font-mono text-xs text-fg`,children:e.slug}),(0,$.jsxs)(`p`,{className:`mt-0.5 text-xs text-fg-subtle`,children:[bn(e.scope,t),e.curated?``:` ${t.composioUncuratedSuffix}`]})]},e.slug)):(0,$.jsx)(`p`,{className:`text-xs text-fg-muted`,children:t.composioToolsEmpty})})]}),(0,$.jsxs)(`section`,{children:[(0,$.jsx)(`p`,{className:`mb-2 text-xs font-medium uppercase tracking-wide text-fg-subtle`,children:t.composioRecentTriggers}),(0,$.jsx)(`div`,{className:`space-y-2`,children:l.length?l.slice(0,5).map(e=>(0,$.jsxs)(`div`,{className:`rounded-lg bg-surface-panel px-3 py-2`,children:[(0,$.jsx)(`p`,{className:`truncate text-xs text-fg`,children:e.trigger??e.id}),(0,$.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-subtle`,children:new Date(e.at).toLocaleString()})]},`${e.id}-${e.at}`)):(0,$.jsx)(`p`,{className:`text-xs text-fg-muted`,children:t.composioTriggersEmpty})})]})]})]})]}),(0,$.jsx)(et,{open:H!==null,title:i?`断开账号`:`Disconnect account`,description:i?`停止此账号的工具使用和学习,并撤销其全部授权。已保存的数据不会删除。`:`Stop tool access and learning for this account and revoke all its authorizations. Saved data will not be deleted.`,confirmLabel:i?`断开`:`Disconnect`,cancelLabel:t.modalCancel,destructive:!0,onConfirm:()=>{let e=H;ee(null),e&&he(()=>Re(e))},onCancel:()=>ee(null)}),(0,$.jsx)(et,{open:z!==null,title:t.composioRevoke,description:t.composioRevokeConfirm,confirmLabel:t.composioRevoke,cancelLabel:t.modalCancel,destructive:!0,onConfirm:()=>{let e=z;B(null),e&&he(()=>be(e))},onCancel:()=>B(null)})]})}var Tn=K(`w-full rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg`,`placeholder:text-fg-subtle`,Ye);function En(e,t){let n={};for(let r of e?.setup.config??[]){let e=t.config?.[r.key]??r.defaultValue??``;n[r.key]=typeof e==`string`?e:JSON.stringify(e,null,2)}return n}function Dn(e,t){let n=t.trim();return e===`json`?n?JSON.parse(n):void 0:e===`number`?n?Number(n):void 0:e===`boolean`?n===`true`:n||void 0}function On({instance:e,definition:t,onClose:n,onChanged:r,t:i}){let[a,o]=(0,Q.useState)(!1),[s,c]=(0,Q.useState)(!1),[l,u]=(0,Q.useState)(!1),[d,f]=(0,Q.useState)(!1),[p,m]=(0,Q.useState)(null),[h,g]=(0,Q.useState)(()=>En(t,e)),[_,v]=(0,Q.useState)(null),[y,b]=(0,Q.useState)(!1),[x,S]=(0,Q.useState)(null),C=t?.setup.config??[],T=(e.materialized.type===`mcp`||e.materialized.type===`memorySource`)&&C.length>0&&(t?.setup.secrets??[]).length===0,E=e.materialized.type===`mcp`,D=e.materialized.type===`composio`,O=e.materialized.type===`memorySource`,k=t?N(t,i):null,M=(0,Q.useCallback)(async()=>{b(!0),v(null);try{let t=await Te(e.instanceId);S(t),t.ok||v(t.error??t.action??i.healthStatusLabels[t.status]),await r()}catch(e){v(e instanceof Error?e.message:String(e))}finally{b(!1)}},[e.instanceId,r,i.healthStatusLabels]),F=(0,Q.useCallback)(async()=>{o(!0),v(null);try{await Ge(e.instanceId),await r(),n()}catch(e){v(e instanceof Error?e.message:String(e)),o(!1)}},[e.instanceId,r,n]),I=(0,Q.useCallback)(async()=>{if(!(!t||!T)){u(!0),v(null);try{let n={};for(let e of t.setup.config??[]){let t=Dn(e.type,h[e.key]??``);t!==void 0&&(n[e.key]=t)}await Ce(e.instanceId,{config:n}),await r()}catch(e){v(e instanceof Error?e.message:String(e))}finally{u(!1)}}},[h,t,e.instanceId,r,T]),L=(0,Q.useCallback)(async()=>{f(!0),m(null),v(null);try{let t=await we(e.connectorId);m(t.recordIds.length),await r()}catch(e){v(e instanceof Error?e.message:String(e))}finally{f(!1)}},[e.connectorId,r]);return(0,$.jsxs)(pe,{open:!0,onOpenChange:e=>{e||n()},children:[(0,$.jsxs)(ue,{children:[(0,$.jsx)(ce,{className:`xopc-dialog-overlay fixed inset-0 z-[60] bg-scrim`}),(0,$.jsxs)(de,{className:K(`xopc-dialog-content fixed left-1/2 top-1/2 z-[60] flex -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden`,D?`h-[min(100dvh-2rem,36rem)] w-[min(100%-2rem,40rem)]`:`h-[min(100dvh-2rem,44rem)] w-[min(100%-2rem,min(92vw,54rem))]`,`rounded-2xl border border-edge bg-surface-overlay shadow-float outline-none dark:border-edge`),children:[(0,$.jsxs)(`div`,{className:`flex shrink-0 items-start justify-between gap-3 border-b border-edge-subtle px-6 py-5`,children:[(0,$.jsxs)(`div`,{className:`flex min-w-0 items-start gap-3`,children:[(0,$.jsx)(P,{connector:t,size:`lg`}),(0,$.jsxs)(`div`,{className:`min-w-0`,children:[(0,$.jsx)(fe,{className:`text-base font-semibold text-fg`,children:e.displayName}),(0,$.jsx)(le,{className:`mt-1 text-sm text-fg-muted`,children:k??(e.materialized.type===`mcp`?j(i.mcpServerRuntime,{serverId:e.materialized.serverId}):j(i.runtimeLabel,{runtime:e.materialized.type}))})]})]}),(0,$.jsx)(Z,{asChild:!0,children:(0,$.jsxs)(`button`,{type:`button`,className:K(`rounded-lg p-1.5 text-fg-muted hover:bg-surface-hover hover:text-fg`,ge.focusRingPanel),"aria-label":i.modalClose,children:[(0,$.jsx)(re,{className:`size-5`,strokeWidth:1.75,"aria-hidden":!0}),(0,$.jsx)(`span`,{className:`sr-only`,children:i.modalClose})]})})]}),(0,$.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-6 py-5`,children:[_?(0,$.jsx)(`p`,{className:`mb-4 rounded-xl bg-red-500/10 px-3 py-2 text-sm text-red-600`,children:_}):null,E?(0,$.jsxs)(`div`,{className:`space-y-3 rounded-xl border border-edge bg-surface-base p-3 text-sm`,children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,$.jsx)(`p`,{className:`text-fg-muted`,role:`status`,children:x?.ok?j(i.toolsAvailable,{count:String(x.toolCount)}):x?i.healthStatusLabels[x.status]:e.usage.lastHealthStatus?i.healthStatusLabels[e.usage.lastHealthStatus]:i.healthNotTested}),(0,$.jsxs)(X,{variant:`secondary`,"aria-busy":y,disabled:y||!e.enabled,onClick:()=>void M(),children:[y?(0,$.jsx)(A,{className:`size-4 animate-spin`,"aria-hidden":!0}):(0,$.jsx)(V,{className:`size-4`,"aria-hidden":!0}),i.test]})]}),T?C.map(e=>(0,$.jsxs)(`label`,{className:`flex flex-col gap-1.5`,children:[(0,$.jsx)(`span`,{className:`font-medium text-fg`,children:e.label}),e.description?(0,$.jsx)(`span`,{className:`text-xs text-fg-subtle`,children:e.description}):null,(0,$.jsx)(`input`,{className:Tn,value:h[e.key]??``,placeholder:e.placeholder,onChange:t=>g(n=>({...n,[e.key]:t.currentTarget.value}))})]},e.key)):null]}):null,D?(0,$.jsx)(wn,{instance:e,t:i,onChanged:r}):null,O?(0,$.jsxs)(`div`,{className:`space-y-4`,children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 rounded-xl border border-edge bg-surface-base p-4 text-sm`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`p`,{className:`font-medium text-fg`,children:i.connectedSourceSync}),k?(0,$.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:k}):null,p===null?null:(0,$.jsx)(`p`,{className:`mt-1 text-xs text-emerald-600`,children:j(i.connectedSourceSynced,{count:String(p)})})]}),(0,$.jsxs)(X,{disabled:d,onClick:()=>void L(),children:[d?(0,$.jsx)(A,{className:`size-4 animate-spin`}):(0,$.jsx)(w,{className:`size-4`}),i.composioSyncNow]})]}),T?(0,$.jsx)(`div`,{className:`grid gap-3 rounded-xl border border-edge bg-surface-base p-4`,children:C.map(e=>(0,$.jsxs)(`label`,{className:`flex flex-col gap-1.5`,children:[(0,$.jsx)(`span`,{className:`text-sm font-medium text-fg`,children:e.label}),e.description?(0,$.jsx)(`span`,{className:`text-xs text-fg-subtle`,children:e.description}):null,(0,$.jsx)(`input`,{className:Tn,value:h[e.key]??``,placeholder:e.placeholder,onChange:t=>g(n=>({...n,[e.key]:t.currentTarget.value}))})]},e.key))}):null]}):null,!E&&!D&&!O?(0,$.jsx)(`div`,{className:`rounded-xl border border-edge bg-surface-base p-4 text-sm text-fg-muted`,children:(0,$.jsx)(`p`,{children:i.connectorPolicyHint})}):null,(0,$.jsxs)(`details`,{className:`mt-5 rounded-xl border border-edge`,children:[(0,$.jsx)(`summary`,{className:`cursor-pointer px-4 py-3 text-sm font-medium text-fg-muted hover:text-danger`,children:i.dangerZone}),(0,$.jsxs)(`div`,{className:`flex flex-col gap-3 border-t border-danger/15 px-4 py-4 sm:flex-row sm:items-center sm:justify-between`,children:[(0,$.jsx)(`p`,{className:`text-xs leading-5 text-fg-muted`,children:i.removeConnectorHint}),(0,$.jsxs)(X,{variant:`secondary`,className:`shrink-0 border-danger/30 text-danger hover:bg-danger/10`,disabled:a,onClick:()=>c(!0),children:[a?(0,$.jsx)(A,{className:`size-4 animate-spin`}):(0,$.jsx)(ne,{className:`size-4`}),i.remove]})]})]})]}),(0,$.jsxs)(`div`,{className:`flex shrink-0 flex-wrap justify-end gap-2 border-t border-edge-subtle px-6 py-4`,children:[(0,$.jsx)(X,{variant:`secondary`,onClick:n,children:i.modalClose}),(E||O)&&T?(0,$.jsxs)(X,{variant:`primary`,disabled:l,onClick:()=>void I(),children:[l?(0,$.jsx)(A,{className:`size-4 animate-spin`}):(0,$.jsx)(H,{className:`size-4`}),i.modalSave]}):null]})]})]}),(0,$.jsx)(et,{open:s,title:j(i.removeConfirmTitle,{name:e.displayName}),description:i.removeConfirmDescription,confirmLabel:i.removeConfirmAction,cancelLabel:i.modalCancel,destructive:!0,onConfirm:()=>{c(!1),F()},onCancel:()=>{a||c(!1)}})]})}function kn(e){let t=(0,ft.c)(2),n;return t[0]===e?n=t[1]:(n=e.instance.materialized.type===`cli`&&e.definition?(0,$.jsx)(F,{definition:e.definition,instance:e.instance,onClose:e.onClose,onChanged:e.onChanged}):(0,$.jsx)(On,{...e}),t[0]=e,t[1]=n),n}function An(e){let t=(0,ft.c)(59),{instance:n,definition:r,highlighted:i,onOpenDetails:a,t:o}=e,s=i!==void 0&&i,c;t[0]!==r||t[1]!==n?(c=Ct(n,r),t[0]=r,t[1]=n,t[2]=c):c=t[2];let l=c.state,u;t[3]!==r||t[4]!==o?(u=r?N(r,o):null,t[3]=r,t[4]=o,t[5]=u):u=t[5];let f=u,p,m,_,v,y,b,x,S,w;if(t[6]!==l||t[7]!==r||t[8]!==s||t[9]!==n||t[10]!==a||t[11]!==o.connectionChecking||t[12]!==o.connectionNeedsSetup||t[13]!==o.connectionReady){p=l===`ready`?{label:o.connectionReady,Icon:g,className:`text-emerald-700 dark:text-emerald-300`}:l===`needs_setup`?{label:o.connectionNeedsSetup,Icon:h,className:`text-amber-700 dark:text-amber-300`}:{label:o.connectionChecking,Icon:C,className:`text-fg-muted`},w=`button`;let e=l===`needs_setup`&&`border-amber-500/25`,i=s&&`bg-accent-soft`;t[23]!==e||t[24]!==i?(m=K(`flex min-h-[8.75rem] w-full min-w-0 flex-col rounded-xl border border-edge bg-surface-panel p-4 text-left hover:bg-surface-hover/45`,ge.transition,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-accent`,e,i),t[23]=e,t[24]=i,t[25]=m):m=t[25],t[26]!==n||t[27]!==a?(_=()=>a(n),t[26]=n,t[27]=a,t[28]=_):_=t[28],x=`flex w-full min-w-0 items-start gap-3`,t[29]===r?S=t[30]:(S=(0,$.jsx)(P,{connector:r,size:`sm`}),t[29]=r,t[30]=S),y=`min-w-0 flex-1`,t[31]===n.displayName?b=t[32]:(b=(0,$.jsx)(`h3`,{className:`truncate text-sm font-semibold text-fg`,title:n.displayName,children:n.displayName}),t[31]=n.displayName,t[32]=b),v=K(`mt-1 inline-flex items-center gap-1 text-[11px]`,p.className),t[6]=l,t[7]=r,t[8]=s,t[9]=n,t[10]=a,t[11]=o.connectionChecking,t[12]=o.connectionNeedsSetup,t[13]=o.connectionReady,t[14]=p,t[15]=m,t[16]=_,t[17]=v,t[18]=y,t[19]=b,t[20]=x,t[21]=S,t[22]=w}else p=t[14],m=t[15],_=t[16],v=t[17],y=t[18],b=t[19],x=t[20],S=t[21],w=t[22];let T;t[33]===p.Icon?T=t[34]:(T=(0,$.jsx)(p.Icon,{className:`size-3.5`,"aria-hidden":!0}),t[33]=p.Icon,t[34]=T);let E;t[35]!==p.label||t[36]!==T||t[37]!==v?(E=(0,$.jsxs)(`span`,{className:v,children:[T,p.label]}),t[35]=p.label,t[36]=T,t[37]=v,t[38]=E):E=t[38];let D;t[39]!==E||t[40]!==y||t[41]!==b?(D=(0,$.jsxs)(`div`,{className:y,children:[b,E]}),t[39]=E,t[40]=y,t[41]=b,t[42]=D):D=t[42];let O;t[43]!==D||t[44]!==x||t[45]!==S?(O=(0,$.jsxs)(`div`,{className:x,children:[S,D]}),t[43]=D,t[44]=x,t[45]=S,t[46]=O):O=t[46];let k;t[47]===f?k=t[48]:(k=f?(0,$.jsx)(`p`,{className:`mt-2 w-full line-clamp-2 text-xs leading-5 text-fg-muted`,title:f,children:f}):null,t[47]=f,t[48]=k);let A;t[49]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,$.jsx)(d,{className:`size-3.5 shrink-0`,"aria-hidden":!0}),t[49]=A):A=t[49];let j;t[50]===o.installedDetails?j=t[51]:(j=(0,$.jsxs)(`span`,{className:`mt-auto flex w-full items-center justify-end gap-1 pt-2 text-xs text-fg-muted`,children:[o.installedDetails,A]}),t[50]=o.installedDetails,t[51]=j);let M;return t[52]!==m||t[53]!==_||t[54]!==O||t[55]!==k||t[56]!==j||t[57]!==w?(M=(0,$.jsxs)(`button`,{type:w,className:m,onClick:_,children:[O,k,j]}),t[52]=m,t[53]=_,t[54]=O,t[55]=k,t[56]=j,t[57]=w,t[58]=M):M=t[58],M}function jn(e,t){return Gt()}function Mn(e){let t=e.headers.filter(e=>e.key.trim()),n=t.find(e=>e.key.toLowerCase()===`authorization`&&!e.reference&&/^Bearer\s/i.test(e.value)),r=e.extra.auth||t.some(e=>e.reference)||e.extra.oauth&&t.some(e=>e.key.toLowerCase()===`authorization`)?`existing`:e.extra.oauth?`oauth`:n?`bearer`:t.length?`headers`:`auto`;return{mode:r,token:n?.value.replace(/^Bearer\s+/i,``)??``,apiKey:``,headerName:``,customHeaders:t.length?t:[Mt()],additionalHeaders:r===`bearer`?t.filter(e=>e!==n):r===`oauth`?t:[]}}function Nn(e,t){if(e.transport===`stdio`||t.mode===`existing`)return{...e,extra:{...e.extra}};let n={...e.extra};delete n.auth,t.mode!==`oauth`&&delete n.oauth;let r=t.mode===`headers`?t.customHeaders:t.additionalHeaders;if(t.mode===`bearer`){let e=t.token.trim().replace(/^Bearer\s+/i,``);r=[...r,Mt(`Authorization`,`Bearer ${e}`)]}return t.mode===`apiKey`&&(r=[...r,Mt(t.headerName.trim(),t.apiKey.trim())]),{...e,extra:n,headers:r,oauthClientId:t.mode===`oauth`?e.oauthClientId:``}}function Pn(e){let t=new Set;return e.findIndex(e=>{let n=e.key.trim();if(!n&&!e.value&&!e.reference)return!1;if(!/^[!#$%&'*+.^_`|~\da-z-]+$/i.test(n)||/[\r\n]/.test(e.value))return!0;let r=n.toLowerCase();return t.has(r)?!0:(t.add(r),!1)})}function Fn(){return K(`w-full rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg`,`placeholder:text-fg-subtle`,Ye)}function In({label:e,optionalLabel:t,addLabel:n,removeHeaderAria:r,pasteLabel:i,pasteFailed:a,pasteFailedTitle:o,dismissLabel:s,keyPlaceholder:c,valuePlaceholder:l,headers:u,onChange:d,referenceLabel:f=`Existing credential reference`,showValueLabel:p=`Show value`,hideValueLabel:m=`Hide value`,allowPaste:h=!0}){let[g,_]=(0,Q.useState)(new Set),[y,b]=(0,Q.useState)(!1),x=(e,t)=>{d(u.map((n,r)=>r===e?{...n,...t}:n))},S=()=>{d([...u,Mt()])},C=e=>{let t=u.filter((t,n)=>n!==e);d(t.length>0?t:[Mt()])},w=async()=>{try{let e=await he();if(!e){b(!0);return}let t=Pt(e);if(!t?.length){b(!0);return}d(t)}catch{b(!0)}};return(0,$.jsxs)(`div`,{className:`flex flex-col gap-2 md:col-span-2`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-1.5 text-sm font-medium text-fg`,children:[(0,$.jsx)(`span`,{children:e}),t?(0,$.jsx)(`span`,{className:`font-normal text-fg-subtle`,children:t}):null]}),h?(0,$.jsxs)(X,{type:`button`,variant:`ghost`,className:`h-8 gap-1.5 px-2 text-xs`,onClick:()=>void w(),children:[(0,$.jsx)(v,{className:`size-3.5`,"aria-hidden":!0}),i]}):null]}),(0,$.jsx)(`div`,{className:`flex flex-col gap-2`,children:u.map((e,t)=>(0,$.jsxs)(`div`,{className:`grid min-w-0 grid-cols-[minmax(0,1fr)_auto_auto] items-center gap-2 sm:grid-cols-[minmax(0,1fr)_minmax(0,1.4fr)_auto_auto]`,children:[(0,$.jsx)(`input`,{className:K(Fn(),`col-span-3 min-w-0 font-mono text-xs sm:col-span-1`),"aria-label":`${c} ${t+1}`,value:e.key,placeholder:c,onChange:e=>x(t,{key:e.target.value})}),(0,$.jsx)(`input`,{className:K(Fn(),`min-w-0 font-mono text-xs`),type:g.has(e.clientKey)?`text`:`password`,autoComplete:`off`,"aria-label":`${l} ${t+1}`,readOnly:!!e.reference,value:e.reference?f:e.value,placeholder:e.reference?f:l,onChange:e=>x(t,{value:e.target.value})}),(0,$.jsx)(X,{type:`button`,variant:`ghost`,className:`size-10 shrink-0 px-0`,disabled:!!e.reference,"aria-label":g.has(e.clientKey)?m:p,onClick:()=>_(t=>{let n=new Set(t);return n.has(e.clientKey)?n.delete(e.clientKey):n.add(e.clientKey),n}),children:g.has(e.clientKey)?(0,$.jsx)(D,{className:`size-4`,"aria-hidden":!0}):(0,$.jsx)(O,{className:`size-4`,"aria-hidden":!0})}),(0,$.jsx)(X,{type:`button`,variant:`ghost`,className:`size-9 shrink-0 px-0`,disabled:u.length<=1&&!e.key&&!e.value,onClick:()=>C(t),"aria-label":r,children:(0,$.jsx)(ne,{className:`size-4 text-fg-subtle`,"aria-hidden":!0})}),e.reference?(0,$.jsx)(`p`,{className:`col-span-3 break-words text-xs text-fg-muted sm:col-span-4`,children:f}):null]},e.clientKey))}),(0,$.jsx)(et,{open:y,title:o,description:a,confirmLabel:s,onConfirm:()=>b(!1),onCancel:()=>b(!1)}),(0,$.jsxs)(`button`,{type:`button`,className:K(`self-start text-sm text-accent hover:underline`,ge.press),onClick:S,children:[`+ `,n]})]})}var Ln=K(`w-full min-w-0 rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg`,Ye);function Rn(e){let t=(0,ft.c)(20),{value:n,onChange:r,label:i,t:a,required:o}=e,s=o!==void 0&&o,[c,l]=(0,Q.useState)(!1),u;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(u=K(Ln,`mt-1.5`),t[0]=u):u=t[0];let d=c?`text`:`password`,f;t[1]===r?f=t[2]:(f=e=>r(e.target.value),t[1]=r,t[2]=f);let p;t[3]!==s||t[4]!==d||t[5]!==f||t[6]!==n?(p=(0,$.jsx)(`input`,{className:u,type:d,value:n,required:s,autoComplete:`off`,onChange:f}),t[3]=s,t[4]=d,t[5]=f,t[6]=n,t[7]=p):p=t[7];let m;t[8]!==i||t[9]!==p?(m=(0,$.jsxs)(`label`,{className:`block text-sm font-medium text-fg`,children:[i,p]}),t[8]=i,t[9]=p,t[10]=m):m=t[10];let h;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(h=()=>l(zn),t[11]=h):h=t[11];let g;t[12]===c?g=t[13]:(g=c?(0,$.jsx)(D,{className:`size-4`,"aria-hidden":!0}):(0,$.jsx)(O,{className:`size-4`,"aria-hidden":!0}),t[12]=c,t[13]=g);let _=c?a.setupHideValue:a.setupShowValue,v;t[14]!==g||t[15]!==_?(v=(0,$.jsxs)(X,{type:`button`,variant:`ghost`,className:`gap-1.5 text-xs`,onClick:h,children:[g,_]}),t[14]=g,t[15]=_,t[16]=v):v=t[16];let y;return t[17]!==v||t[18]!==m?(y=(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[m,v]}),t[17]=v,t[18]=m,t[19]=y):y=t[19],y}function zn(e){return!e}function Bn(e){let t=(0,ft.c)(17),{headers:n,onChange:r,t:i,additional:a,environment:o}=e,s=a!==void 0&&a,c=o!==void 0&&o,l=c?i.envLabel:s?i.setupAdditionalHeaders:i.headersLabel,u=c?i.setupAddEnv:i.addHeader,d=c?i.setupRemoveEnv:i.removeHeader,f=c?i.setupEnvName:i.headerKeyPlaceholder,p=c?i.setupEnvValue:i.headerValuePlaceholder,m=!c,h;return t[0]!==n||t[1]!==r||t[2]!==i.optionalSuffix||t[3]!==i.pasteHeaders||t[4]!==i.pasteHeadersDismiss||t[5]!==i.pasteHeadersFailed||t[6]!==i.pasteHeadersFailedTitle||t[7]!==i.setupHideValue||t[8]!==i.setupReference||t[9]!==i.setupShowValue||t[10]!==l||t[11]!==u||t[12]!==d||t[13]!==f||t[14]!==p||t[15]!==m?(h=(0,$.jsx)(In,{label:l,optionalLabel:i.optionalSuffix,addLabel:u,removeHeaderAria:d,pasteLabel:i.pasteHeaders,pasteFailed:i.pasteHeadersFailed,pasteFailedTitle:i.pasteHeadersFailedTitle,dismissLabel:i.pasteHeadersDismiss,keyPlaceholder:f,valuePlaceholder:p,headers:n,onChange:r,referenceLabel:i.setupReference,showValueLabel:i.setupShowValue,hideValueLabel:i.setupHideValue,allowPaste:m}),t[0]=n,t[1]=r,t[2]=i.optionalSuffix,t[3]=i.pasteHeaders,t[4]=i.pasteHeadersDismiss,t[5]=i.pasteHeadersFailed,t[6]=i.pasteHeadersFailedTitle,t[7]=i.setupHideValue,t[8]=i.setupReference,t[9]=i.setupShowValue,t[10]=l,t[11]=u,t[12]=d,t[13]=f,t[14]=p,t[15]=m,t[16]=h):h=t[16],h}function Vn(e){let t=(0,ft.c)(52),{draft:n,onChange:r,t:i,allowExisting:a}=e,o=i.setupAuthLabel,s=i.setupAuthLabel,c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=K(Ln,`mt-1.5`),t[0]=c):c=t[0];let l=n.mode,u;t[1]===r?u=t[2]:(u=e=>r({mode:e.target.value}),t[1]=r,t[2]=u);let d;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(d=[`auto`,`oauth`,`bearer`,`apiKey`,`headers`,`none`],t[3]=d):d=t[3];let m;t[4]===i.setupAuthModes?m=t[5]:(m=d.map(e=>(0,$.jsx)(p,{value:e,children:i.setupAuthModes[e]},e)),t[4]=i.setupAuthModes,t[5]=m);let h;t[6]!==a||t[7]!==n.mode||t[8]!==i.setupAuthModes?(h=a||n.mode===`existing`?(0,$.jsx)(p,{value:`existing`,children:i.setupAuthModes.existing}):null,t[6]=a,t[7]=n.mode,t[8]=i.setupAuthModes,t[9]=h):h=t[9];let g;t[10]!==n.mode||t[11]!==i.setupAuthLabel||t[12]!==u||t[13]!==m||t[14]!==h?(g=(0,$.jsxs)(f,{"aria-label":s,className:c,value:l,onChange:u,children:[m,h]}),t[10]=n.mode,t[11]=i.setupAuthLabel,t[12]=u,t[13]=m,t[14]=h,t[15]=g):g=t[15];let _;t[16]!==i.setupAuthLabel||t[17]!==g?(_=(0,$.jsxs)(`label`,{className:`block text-sm font-medium text-fg`,children:[o,g]}),t[16]=i.setupAuthLabel,t[17]=g,t[18]=_):_=t[18];let v;t[19]!==n.mode||t[20]!==i.setupAuthAutoHint?(v=n.mode===`auto`?(0,$.jsx)(`p`,{className:`text-xs text-fg-muted`,children:i.setupAuthAutoHint}):null,t[19]=n.mode,t[20]=i.setupAuthAutoHint,t[21]=v):v=t[21];let y;t[22]!==n.mode||t[23]!==i.setupAuthOAuthHint?(y=n.mode===`oauth`?(0,$.jsx)(`p`,{className:`text-xs text-fg-muted`,children:i.setupAuthOAuthHint}):null,t[22]=n.mode,t[23]=i.setupAuthOAuthHint,t[24]=y):y=t[24];let b;t[25]!==n.mode||t[26]!==i.setupExistingHint?(b=n.mode===`existing`?(0,$.jsx)(`p`,{className:`text-xs text-fg-muted`,children:i.setupExistingHint}):null,t[25]=n.mode,t[26]=i.setupExistingHint,t[27]=b):b=t[27];let x;t[28]!==n.mode||t[29]!==n.token||t[30]!==r||t[31]!==i?(x=n.mode===`bearer`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Rn,{value:n.token,onChange:e=>r({token:e}),label:i.setupTokenLabel,t:i,required:!0}),(0,$.jsx)(`p`,{className:`text-xs text-fg-muted`,children:i.setupTokenHint})]}):null,t[28]=n.mode,t[29]=n.token,t[30]=r,t[31]=i,t[32]=x):x=t[32];let S;t[33]!==n.apiKey||t[34]!==n.headerName||t[35]!==n.mode||t[36]!==r||t[37]!==i?(S=n.mode===`apiKey`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`label`,{className:`block text-sm font-medium text-fg`,children:[i.setupApiKeyHeader,(0,$.jsx)(`input`,{className:K(Ln,`mt-1.5`),placeholder:`x-api-key`,value:n.headerName,required:!0,onChange:e=>r({headerName:e.target.value})})]}),(0,$.jsx)(`p`,{className:`text-xs text-fg-muted`,children:i.setupApiKeyHint}),(0,$.jsx)(Rn,{value:n.apiKey,onChange:e=>r({apiKey:e}),label:`API Key`,t:i,required:!0})]}):null,t[33]=n.apiKey,t[34]=n.headerName,t[35]=n.mode,t[36]=r,t[37]=i,t[38]=S):S=t[38];let C;t[39]!==n.customHeaders||t[40]!==n.mode||t[41]!==r||t[42]!==i?(C=n.mode===`headers`?(0,$.jsx)(Bn,{headers:n.customHeaders,onChange:e=>r({customHeaders:e}),t:i}):null,t[39]=n.customHeaders,t[40]=n.mode,t[41]=r,t[42]=i,t[43]=C):C=t[43];let w;return t[44]!==_||t[45]!==v||t[46]!==y||t[47]!==b||t[48]!==x||t[49]!==S||t[50]!==C?(w=(0,$.jsxs)(`div`,{className:`space-y-4`,children:[_,v,y,b,x,S,C]}),t[44]=_,t[45]=v,t[46]=y,t[47]=b,t[48]=x,t[49]=S,t[50]=C,t[51]=w):w=t[51],w}function Hn(e){let t=(0,ft.c)(8),{label:n,children:r,hint:i}=e,a;t[0]===n?a=t[1]:(a=(0,$.jsx)(`span`,{children:n}),t[0]=n,t[1]=a);let o;t[2]===i?o=t[3]:(o=i?(0,$.jsx)(`span`,{className:`block text-xs font-normal text-fg-muted`,children:i}):null,t[2]=i,t[3]=o);let s;return t[4]!==r||t[5]!==a||t[6]!==o?(s=(0,$.jsxs)(`label`,{className:`block space-y-1.5 text-sm font-medium text-fg`,children:[a,r,o]}),t[4]=r,t[5]=a,t[6]=o,t[7]=s):s=t[7],s}function Un({row:e,t,onUpdate:n}){let[r,i]=(0,Q.useState)(()=>It(e.envJson?JSON.parse(e.envJson):void 0)),[a,o]=(0,Q.useState)(!1),s=[];try{s=Rt(e.argsText)??[]}catch{}let c=e=>n({argsText:JSON.stringify(e)});return(0,$.jsxs)(`div`,{"data-field":`commandOptions`,className:`space-y-4`,children:[(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,$.jsx)(`span`,{className:`text-sm font-medium text-fg`,children:t.argsLabel}),(0,$.jsx)(X,{type:`button`,variant:`ghost`,onClick:()=>o(e=>!e),children:a?t.setupArgsRows:t.setupArgsPaste})]}),a?(0,$.jsx)(Hn,{label:t.setupArgsPaste,hint:t.argsHint,children:(0,$.jsx)(`input`,{className:Ln,value:e.argsText,onChange:e=>n({argsText:e.target.value})})}):s.map((e,n)=>(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,$.jsx)(`input`,{className:Ln,"aria-label":`${t.argsLabel} ${n+1}`,value:e,onChange:e=>c(s.map((t,r)=>r===n?e.target.value:t))}),(0,$.jsx)(X,{type:`button`,variant:`ghost`,"aria-label":t.setupRemoveArg,onClick:()=>c(s.filter((e,t)=>t!==n)),children:(0,$.jsx)(ne,{className:`size-4`,"aria-hidden":!0})})]},n)),a?null:(0,$.jsxs)(X,{type:`button`,variant:`ghost`,onClick:()=>c([...s,``]),children:[(0,$.jsx)(B,{className:`size-4`,"aria-hidden":!0}),t.setupAddArg]})]}),(0,$.jsx)(Bn,{environment:!0,headers:r,t,onChange:e=>{i(e),n({envEntries:e,envJson:JSON.stringify(Ft(e)??{})})}})]})}function Wn(e){let t=(0,ft.c)(15),{row:n,t:r,onUpdate:i,variant:a,showOAuth:o,idReadOnly:s}=e,c=a===void 0?`all`:a,l=o!==void 0&&o,u=s!==void 0&&s,d=c!==`advanced`,m=c!==`basic`,h;t[0]!==d||t[1]!==i||t[2]!==n||t[3]!==r?(h=d?(0,$.jsxs)($.Fragment,{children:[n.transport===`stdio`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Hn,{label:`${r.commandLabel} *`,children:(0,$.jsx)(`input`,{"data-field":`command`,className:Ln,value:n.command,required:!0,onChange:e=>i({command:e.target.value})})}),(0,$.jsx)(Un,{row:n,t:r,onUpdate:i})]}):(0,$.jsx)(Hn,{label:`${r.urlLabel} *`,children:(0,$.jsx)(`input`,{"data-field":`url`,className:Ln,value:n.url,placeholder:`https://example.com/mcp`,required:!0,onChange:e=>i({url:e.target.value})})}),(0,$.jsx)(Hn,{label:r.setupNameLabel,hint:r.setupNameHint,children:(0,$.jsx)(`input`,{className:Ln,value:n.displayName??``,placeholder:r.setupNamePlaceholder,onChange:e=>i({displayName:e.target.value})})})]}):null,t[0]=d,t[1]=i,t[2]=n,t[3]=r,t[4]=h):h=t[4];let g;t[5]!==m||t[6]!==u||t[7]!==i||t[8]!==n||t[9]!==l||t[10]!==r?(g=m?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Hn,{label:r.serverIdLabel,hint:r.setupIdHint,children:(0,$.jsx)(`input`,{className:Ln,readOnly:u,value:n.id,onChange:e=>i({id:e.target.value}),placeholder:r.serverIdPlaceholder})}),n.transport===`stdio`?(0,$.jsx)(Hn,{label:r.cwdLabel,children:(0,$.jsx)(`input`,{className:Ln,value:n.cwd,onChange:e=>i({cwd:e.target.value})})}):null,n.transport!==`stdio`&&l?(0,$.jsx)(Hn,{label:r.oauthClientIdLabel,hint:r.oauthClientIdHint,children:(0,$.jsx)(`input`,{className:Ln,value:n.oauthClientId,onChange:e=>i({oauthClientId:e.target.value})})}):null,(0,$.jsx)(Hn,{label:r.exposureLabel,hint:r.setupExposureHint,children:(0,$.jsx)(f,{"aria-label":r.exposureLabel,className:Ln,value:n.exposure,onChange:e=>i({exposure:e.target.value}),children:[`codemode`,`deferred`,`direct`,`hidden`].map(e=>(0,$.jsx)(p,{value:e,children:r.exposureLabels[e]},e))})}),(0,$.jsx)(Hn,{label:r.requestTimeoutLabel,children:(0,$.jsx)(dt,{allowEmpty:!0,type:`number`,min:1,className:Ln,value:n.timeout??``,placeholder:r.setupDefaultTimeout,onChange:e=>i({timeout:e.target.value?Number(e.target.value):void 0})})})]}):null,t[5]=m,t[6]=u,t[7]=i,t[8]=n,t[9]=l,t[10]=r,t[11]=g):g=t[11];let _;return t[12]!==h||t[13]!==g?(_=(0,$.jsxs)(`div`,{className:`space-y-4`,children:[h,g]}),t[12]=h,t[13]=g,t[14]=_):_=t[14],_}function Gn(e,t){let n=e;if(n?.status===429)return t.setupRateLimited;if(n?.status===401)return t.setupGatewayUnauthorized;if(n?.status===404||n?.status===409)return t.setupConflict;if(n?.status&&n.status>=500)return t.setupGatewayCheckFailed;let r={command_missing:t.setupCommandMissing,connection_refused:t.setupConnectionRefused,host_not_found:t.setupHostNotFound,timeout:t.setupTimedOut,access_denied:t.setupAccessDenied,network:t.setupServiceNetworkFailed,tls:t.setupTlsFailed,invalid_response:t.setupInvalidResponse,not_found:t.setupEndpointNotFound,rate_limited:t.setupServiceRateLimited,configuration:t.setupInvalidConfig};if(n?.errorCode&&Object.hasOwn(r,n.errorCode))return r[n.errorCode];let i=e instanceof Error?e.message:typeof e==`string`?e:n?.error??``;return/ENOENT|command not found|executable.{0,30}not found/i.test(i)?t.setupCommandMissing:/ECONNREFUSED|connection refused/i.test(i)?t.setupConnectionRefused:/ENOTFOUND|EAI_AGAIN|could not resolve/i.test(i)?t.setupHostNotFound:/timeout|timed out/i.test(i)?t.setupTimedOut:/fetch failed|failed to fetch|network error|NetworkError/i.test(i)?n?.error===void 0?t.setupGatewayNetworkFailed:t.setupServiceNetworkFailed:/\b(?:401|403)\b|unauthorized|forbidden|permission denied/i.test(i)?t.setupAccessDenied:t.setupCheckFailed}function Kn(e,t){return JSON.stringify({id:e.id,config:qt(Nn(e,t))})}function qn(e,t){try{return Kn(e,t)}catch{return JSON.stringify({row:e,auth:t})}}function Jn(e){let{t,cs:n}=e,r=(0,Q.useId)(),[i,a]=(0,Q.useState)(e.initialRow),[o,s]=(0,Q.useState)(()=>Mn(e.initialRow)),[c,l]=(0,Q.useState)(`idle`),[u,d]=(0,Q.useState)(``),[m,h]=(0,Q.useState)(!1),[_,v]=(0,Q.useState)(),[y,b]=(0,Q.useState)(),[x,S]=(0,Q.useState)(),[C,w]=(0,Q.useState)(!1),[T,D]=(0,Q.useState)(!1),[O,k]=(0,Q.useState)(``),[j,M]=(0,Q.useState)(``),[N,P]=(0,Q.useState)([]),[F,I]=(0,Q.useState)(`0`),[L,R]=(0,Q.useState)(0),[z,B]=(0,Q.useState)(``),[V,H]=(0,Q.useState)(!1),[ee,U]=(0,Q.useState)(!1),te=e.mode===`edit`,[W,ne]=(0,Q.useState)(``),G=(0,Q.useRef)(void 0),[ie]=(0,Q.useState)(()=>qn(e.initialRow,Mn(e.initialRow))),q=(0,Q.useRef)(e.mode===`edit`?e.initialRow.id:``),ae=(0,Q.useRef)(void 0),oe=(0,Q.useRef)(void 0),J=(0,Q.useRef)(void 0),Y=(0,Q.useRef)(null),se=(0,Q.useRef)(``),Z=(0,Q.useRef)(!0),me=(0,Q.useRef)(null),he=(0,Q.useRef)(null),ge=(0,Q.useRef)(null),_e=(0,Q.useRef)(null),ve=(0,Q.useRef)(e.onSaved);ve.current=e.onSaved;let ye=x?.state===`starting`||x?.state===`authorizing`,be=c!==`idle`||ye,xe=ie!==qn(i,o),Se=i.extra.enabled===!1,Ce=!m&&(xe||!!O.trim());(0,Q.useEffect)(()=>(Z.current=!0,()=>{Z.current=!1,ae.current?.abort(),Y.current?.close(),G.current&&Zt(G.current).catch(()=>{})}),[]),(0,Q.useEffect)(()=>{if(!Ce)return;let e=e=>{e.preventDefault(),e.returnValue=``};return window.addEventListener(`beforeunload`,e),()=>window.removeEventListener(`beforeunload`,e)},[Ce]),(0,Q.useEffect)(()=>{if(!_)return;let e=ge.current?.querySelector(`[data-field="${_.field}"]`),t=e?.closest(`details`);t&&(t.open=!0);let n=e?.querySelector(`input,button,textarea`)??e;return n?.setAttribute(`aria-invalid`,`true`),n?.setAttribute(`aria-describedby`,r),_.focus!==!1&&(n??_e.current)?.focus(),()=>{n?.removeAttribute(`aria-invalid`),n?.removeAttribute(`aria-describedby`)}},[_,r]),(0,Q.useEffect)(()=>{if(!x||!ye)return;let e=new AbortController;oe.current=e;let n;async function r(){try{let n=await en(G.current,e.signal);if(e.signal.aborted||(S(n),n.authorizationUrl&&se.current!==n.authorizationUrl&&(se.current=n.authorizationUrl,window.electronAPI?.shell?.openExternalUrl?!(await window.electronAPI.shell.openExternalUrl(n.authorizationUrl)).ok&&!e.signal.aborted&&d(t.oauthOpenFailed):Y.current&&!Y.current.closed&&Y.current.location.replace(n.authorizationUrl)),e.signal.aborted))return;if(n.state===`connected`){J.current=void 0,Y.current?.close(),b({state:`connected`,toolCount:n.toolCount}),d(``);return}if(n.state===`error`||n.state===`cancelled`){J.current=void 0,Y.current?.close(),d(n.state===`cancelled`?t.setupCancelled:t.setupAuthFailed),/client.{0,20}(id|registration)|register|registration/i.test(n.error??``)&&w(!0);return}}catch{if(e.signal.aborted)return;we(),Y.current?.close(),d(t.setupAuthFailed);return}n=setTimeout(()=>void r(),1200)}return r(),()=>{e.abort(),clearTimeout(n)}},[x?.id,ye,t.oauthOpenFailed,t.setupCancelled,t.setupAuthFailed]);function we(){ae.current?.abort(),oe.current?.abort(),G.current&&Zt(G.current).catch(()=>{}),G.current=void 0,ne(``),H(!1),b(void 0),S(void 0),d(``),v(void 0)}function Te(e){a(t=>({...t,...e})),we()}function Ee(e){s(t=>({...t,...e})),we()}function De(){c===`saving`||ye||(c===`checking`&&(we(),l(`idle`)),Ce?U(!0):e.onClose())}function Oe(){try{P(Wt(O)),I(`0`),M(``)}catch{M(t.setupImportError),P([])}}function ke(){let t=N[Number(F)];if(!t)return;let n={...t,id:q.current||t.id,clientKey:e.initialRow.clientKey,extra:{...t.extra,...q.current?{enabled:i.extra.enabled}:{}}};a(n),s(Mn(n)),we(),R(e=>e+1),D(!1),k(``),P([])}function Ae(e){function n(e,t){return v({field:e,message:t}),!1}if(e.transport===`streamable-http`){try{e.url=Ut(e.url)}catch{return n(`url`,t.setupAddressInvalid)}if(o.mode===`bearer`&&!o.token.trim().replace(/^Bearer\s*/i,``)||o.mode===`apiKey`&&(!o.apiKey.trim()||!o.headerName.trim()))return n(`auth`,t.setupCredentialRequired);if(Pn(e.headers)>=0)return n(`auth`,t.setupHeaderInvalid);if(o.mode===`oauth`&&e.headers.some(e=>e.key.trim().toLowerCase()===`authorization`))return n(`auth`,t.setupOAuthHeaderConflict);if(o.mode===`headers`&&!e.headers.some(e=>e.key.trim()&&(e.value.trim()||e.reference)))return n(`auth`,t.setupCredentialRequired)}else if(!e.command.trim())return n(`command`,t.setupCommandRequired);if(e.timeout!==void 0&&(!Number.isFinite(e.timeout)||e.timeout<=0))return n(`advanced`,t.setupInvalidConfig);try{qt(e)}catch(r){return n(e.transport===`stdio`?`commandOptions`:`advanced`,r instanceof Error&&r.message.startsWith(`Environment`)?t.setupEnvInvalid:t.setupInvalidConfig)}return!0}async function je(){d(``),l(`checking`),se.current=``,window.electronAPI?.shell?.openExternalUrl||(Y.current=window.open(`about:blank`,`_blank`),Y.current&&(Y.current.opener=null));try{let e=await $t(G.current);if(!Z.current){Y.current?.close(),G.current&&Zt(G.current).catch(()=>{});return}J.current=e.id,S(e)}catch{Y.current?.close(),Z.current&&d(t.setupAuthFailed)}finally{Z.current&&l(`idle`)}}async function Me(){let r=Nn(i,o);if(!Ae(r))return;let s=e.existingCustomServers.filter(t=>t.clientKey!==e.initialRow.clientKey&&t.id!==q.current),c=new Set([...e.managedServerIds,...s.map(e=>e.id)]);if(r.id=q.current||r.id.trim()||Ht(r,c),!/^[a-zA-Z0-9_-]+$/.test(r.id)||[...c].some(e=>e.replace(/-/g,`_`)===r.id.replace(/-/g,`_`))){v({field:`advanced`,message:n.duplicateServerId});return}we(),l(`checking`);let u=new AbortController;ae.current=u;try{let n=await Yt(r,q.current||void 0,e.initialRow.extra,u.signal);if(!Z.current||u.signal.aborted){Zt(n.id).catch(()=>{});return}G.current=n.id,a(r),ne(qn(r,o));let i=await Xt(n.id,u.signal);if(!Z.current||u.signal.aborted)return;b(i),i.state===`error`&&d(Gn(i,t))}catch(e){Z.current&&!u.signal.aborted&&d(e.status===409?t.setupConflict:Gn(e,t))}finally{Z.current&&ae.current===u&&l(`idle`)}}async function Ne(n=!1){if(!(!G.current||y?.state!==`connected`||W!==qn(i,o))){l(`saving`),d(``);try{let t=await Qt(G.current,n);G.current=void 0,await ve.current().catch(()=>{}),t?.reloadRequired?h(!0):e.onClose()}catch(e){let n=e.status;n===404||n===409?(we(),d(t.setupConflict)):d(t.setupSaveFailed)}finally{Z.current&&l(`idle`)}}}async function Pe(){oe.current?.abort();let e=G.current;J.current=void 0,S(void 0),Y.current?.close(),d(t.setupCancelled),l(`checking`);try{e&&await tn(e)}catch{Z.current&&(we(),d(t.setupCancelled))}finally{Z.current&&l(`idle`)}}async function Fe(){x?.authorizationUrl&&(window.electronAPI?.shell?.openExternalUrl?(await window.electronAPI.shell.openExternalUrl(x.authorizationUrl)).ok||d(t.oauthOpenFailed):window.open(x.authorizationUrl,`_blank`,`noopener,noreferrer`))}async function Ie(){if(x)try{await nn(G.current,z),B(``),d(``)}catch{d(t.setupRedirectInvalid)}}let Le=!!G.current&&W===qn(i,o)&&(o.mode===`oauth`||o.mode===`auto`&&y?.state===`oauth_required`)&&y?.state!==`connected`,Re=/^(?:https?:\/\/)?(?:localhost|127\.0\.0\.1|\[::1\])(?=[:/]|$)/i.test(i.url.trim()),ze=N[Number(F)];return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(pe,{open:e.open,onOpenChange:e=>{e||De()},children:(0,$.jsxs)(ue,{children:[(0,$.jsx)(ce,{className:`fixed inset-0 z-[60] bg-scrim`}),(0,$.jsxs)(de,{ref:me,tabIndex:-1,className:`fixed left-1/2 top-1/2 z-[60] flex h-[min(44rem,calc(100dvh-2rem))] w-[min(42rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-2xl border border-edge bg-surface-overlay`,onOpenAutoFocus:e=>{e.preventDefault(),me.current?.focus()},children:[(0,$.jsxs)(`div`,{className:`flex shrink-0 items-start justify-between gap-3 border-b border-edge p-5`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(fe,{className:`font-semibold`,children:e.mode===`edit`?t.setupEditTitle:t.setupTitle}),(0,$.jsx)(le,{className:`mt-1 text-sm text-fg-muted`,children:t.setupHint})]}),(0,$.jsx)(`button`,{type:`button`,disabled:c===`saving`||ye,onClick:De,className:`rounded-lg p-2 text-fg-muted hover:bg-surface-hover disabled:opacity-50`,"aria-label":n.modalClose,children:(0,$.jsx)(re,{className:`size-5`,"aria-hidden":!0})})]}),(0,$.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain p-5`,children:[T?(0,$.jsxs)(`div`,{className:`space-y-4`,children:[(0,$.jsx)(X,{variant:`ghost`,onClick:()=>D(!1),children:t.setupImportBack}),(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:t.setupImportEmpty}),(0,$.jsxs)(`label`,{className:`block text-sm font-medium text-fg`,children:[t.setupImport,(0,$.jsx)(`textarea`,{className:K(Ln,`mt-1.5 min-h-40 font-mono text-xs`),value:O,placeholder:`{"mcpServers": {"docs": {"url": "https://example.com/mcp"}}}`,onChange:e=>{k(e.target.value),P([]),M(``)}})]}),(0,$.jsx)(X,{variant:`secondary`,disabled:!O.trim(),onClick:Oe,children:t.setupImportPreview}),j?(0,$.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:j}):null,ze?(0,$.jsxs)(`div`,{className:`space-y-3 rounded-lg border border-edge p-4`,children:[(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:t.setupImportScope}),(0,$.jsxs)(`label`,{className:`block text-sm font-medium`,children:[t.setupImportChoose,(0,$.jsx)(f,{"aria-label":t.setupImportChoose,className:K(Ln,`mt-1.5`),value:F,onChange:e=>I(e.target.value),children:N.map((e,t)=>(0,$.jsx)(p,{value:String(t),children:e.displayName||e.id||un(e)},t))})]}),(0,$.jsxs)(`p`,{className:`break-all text-sm text-fg-muted`,children:[ze.transport===`stdio`?t.setupUseCommand:t.setupUseUrl,` · `,un(ze)]})]}):null]}):(0,$.jsxs)(`form`,{ref:ge,noValidate:!0,onBlurCapture:e=>{if(e.target instanceof HTMLInputElement&&e.target.dataset.field===`url`&&i.url.trim())try{Ut(i.url)}catch{v({field:`url`,message:t.setupAddressInvalid,focus:!1})}},onSubmit:e=>{e.preventDefault(),Me()},children:[(0,$.jsxs)(`fieldset`,{disabled:be||m,className:`min-w-0 space-y-4`,children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,$.jsx)($e,{className:`flex gap-1`,role:`group`,"aria-label":t.transportLabel,children:[`streamable-http`,`stdio`].map(e=>(0,$.jsx)(X,{type:`button`,variant:i.transport===e?`secondary`:`ghost`,"aria-pressed":i.transport===e,onClick:()=>Te({transport:e}),children:e===`stdio`?t.setupUseCommand:t.setupUseUrl},e))}),(0,$.jsx)(X,{type:`button`,variant:`ghost`,onClick:()=>D(!0),children:t.setupImport})]}),(0,$.jsx)(`div`,{children:(0,$.jsx)(Wn,{row:i,t,variant:`basic`,onUpdate:Te},`${i.transport}-${L}`)}),i.transport===`streamable-http`?(0,$.jsx)(`div`,{"data-field":`auth`,children:(0,$.jsx)(Vn,{allowExisting:!!i.extra.auth||i.headers.some(e=>!!e.reference),draft:o,onChange:Ee,t})}):null,_?(0,$.jsx)(`p`,{id:r,ref:_e,tabIndex:-1,role:`alert`,className:`text-sm text-danger`,children:_.message}):null,(0,$.jsxs)(`details`,{"data-field":`advanced`,className:`rounded-lg border border-edge p-3`,open:C,onToggle:e=>w(e.currentTarget.open),children:[(0,$.jsx)(`summary`,{className:`cursor-pointer text-sm font-medium text-fg-muted`,children:t.setupAdvanced}),(0,$.jsxs)(`div`,{className:`mt-4 space-y-4`,children:[(0,$.jsx)(Wn,{row:i,t,variant:`advanced`,idReadOnly:te,showOAuth:o.mode===`oauth`,onUpdate:Te}),i.transport===`streamable-http`&&o.mode!==`headers`&&o.mode!==`existing`?(0,$.jsx)(Bn,{additional:!0,headers:o.additionalHeaders,onChange:e=>Ee({additionalHeaders:e}),t}):null]})]}),(0,$.jsx)(`p`,{className:`text-xs leading-relaxed text-fg-muted`,children:i.transport===`stdio`?t.setupCommandHostHint:Re?t.setupLocalhostHint:t.setupGatewayHint}),(0,$.jsx)(`p`,{className:`text-xs text-fg-muted`,children:t.setupTestNotice})]}),(0,$.jsx)(`button`,{type:`submit`,hidden:!0})]}),m?(0,$.jsx)(`p`,{role:`alert`,className:`mt-4 text-sm text-fg`,children:t.setupReloadRequired}):null,!T&&!m?(0,$.jsxs)(`div`,{className:`mt-4 space-y-3`,"aria-live":`polite`,children:[c===`idle`?null:(0,$.jsxs)(`p`,{role:`status`,className:`flex items-center gap-2 text-sm text-fg-muted`,children:[(0,$.jsx)(A,{className:`size-4 animate-spin motion-reduce:animate-none`,"aria-hidden":!0}),c===`saving`?t.setupSaving:t.setupChecking]}),c===`idle`&&te&&!xe&&!y&&!u&&!ye?(0,$.jsx)(`p`,{role:`status`,className:`text-sm text-fg-muted`,children:Se?t.setupDisabled:e.lastCheck?t.setupLastCheck.replace(`{{count}}`,String(e.lastCheck.toolCount)):t.setupSavedUnchecked}):null,y?.state===`connected`?(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsxs)(`p`,{role:`status`,className:`flex items-center gap-2 text-sm text-success`,children:[(0,$.jsx)(g,{className:`size-4 shrink-0`,"aria-hidden":!0}),y.toolCount?t.setupConnected.replace(`{{count}}`,String(y.toolCount)):t.setupZeroTools]}),(0,$.jsx)(X,{ref:he,variant:`secondary`,onClick:()=>H(!0),children:t.viewTools})]}):null,y?.state===`token_required`?(0,$.jsx)(`p`,{role:`status`,className:`text-sm text-fg-muted`,children:t.setupNeedsAuth}):null,y?.state===`oauth_required`&&!ye?(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:t.setupOAuthRequired}):null,ye?(0,$.jsxs)(`div`,{className:`space-y-3 rounded-lg border border-edge p-4`,children:[(0,$.jsxs)(`p`,{role:`status`,className:`flex items-center gap-2 text-sm text-fg-muted`,children:[(0,$.jsx)(A,{className:`size-4 animate-spin motion-reduce:animate-none`,"aria-hidden":!0}),t.setupAuthorizing]}),(0,$.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[x?.authorizationUrl?(0,$.jsxs)(X,{variant:`secondary`,onClick:()=>void Fe(),children:[(0,$.jsx)(E,{className:`size-4`,"aria-hidden":!0}),t.oauthOpenAuthorization]}):null,(0,$.jsx)(X,{variant:`ghost`,onClick:()=>void Pe(),children:t.setupCancelAuth})]}),x?.acceptsRedirect?(0,$.jsxs)(`details`,{children:[(0,$.jsx)(`summary`,{className:`cursor-pointer text-sm text-accent-fg`,children:t.setupRemoteFallback}),(0,$.jsx)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:t.setupRedirectHint}),(0,$.jsxs)(`label`,{className:`mt-2 block text-sm`,children:[t.setupRedirectLabel,(0,$.jsx)(`input`,{className:Ln,value:z,onChange:e=>B(e.target.value)})]}),(0,$.jsx)(X,{className:`mt-2`,disabled:!z.trim(),onClick:()=>void Ie(),children:t.setupContinue})]}):null]}):null,u?(0,$.jsxs)(`div`,{role:`alert`,className:`space-y-1 text-sm`,children:[(0,$.jsx)(`p`,{className:`text-danger`,children:u}),u!==t.setupSaveFailed&&c!==`saving`?(0,$.jsx)(`p`,{className:`text-fg-muted`,children:t.setupTestFailure}):null]}):null]}):null]}),(0,$.jsxs)(`div`,{className:`flex shrink-0 flex-wrap justify-end gap-2 border-t border-edge p-4`,children:[(0,$.jsx)(X,{variant:`secondary`,disabled:c===`saving`||ye,onClick:De,children:te||m?t.setupClose:n.modalCancel}),m?null:T?(0,$.jsx)(X,{variant:`primary`,disabled:!ze,onClick:ke,children:t.setupImportApply}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(X,{variant:y?.state===`connected`?`secondary`:`primary`,disabled:be,onClick:()=>Le?void je():void Me(),children:Le?t.setupSignIn:t.setupTestConnection}),y?.state===`connected`&&W===qn(i,o)?(0,$.jsxs)($.Fragment,{children:[Se?(0,$.jsx)(X,{variant:`secondary`,disabled:be,onClick:()=>void Ne(!0),children:t.setupEnableSave}):null,(0,$.jsx)(X,{variant:`primary`,disabled:be,"aria-busy":be,onClick:()=>void Ne(),children:te?t.setupSaveOnly:t.setupAddConnection})]}):null]})]})]})]})}),(0,$.jsx)(et,{open:ee,title:t.setupUnsavedTitle,description:t.setupUnsavedHint,confirmLabel:t.setupDiscard,cancelLabel:t.setupKeepEditing,onCancel:()=>U(!1),onConfirm:e.onClose,overlayClassName:`z-[70]`,contentClassName:`z-[70]`}),V?(0,$.jsx)(sn,{draftId:G.current,serverId:i.id,displayName:i.displayName,returnFocusTo:he.current,t,onClose:()=>H(!1)}):null]})}var Yn=`recommended`,Xn=`builtin`,Zn=`composio`,Qn=`xopc-store`;function $n(e,t=`en`){return e==="default"&&t.startsWith(`zh`)?Yn:Xn}function er(e,t){let n=e.connectorManifest;if(!n||typeof n!=`object`||Array.isArray(n))return null;let r=n;if(r.contractVersion!==1||r.id!==e.name)return null;let i=r.runtime,a=r.auth;if(!i||typeof i!=`object`||Array.isArray(i)||!a||typeof a!=`object`||Array.isArray(a))return null;let o=i,s=a;if(o.type!==`mcp`||typeof o.serverId!=`string`)return null;let c=[`code`,`docs`,`browser`,`data`,`automation`,`custom`].includes(String(r.category??``))?r.category:`custom`,l=s.mode===`oauth`?{mode:`oauth`,...typeof s.clientId==`string`?{clientId:s.clientId}:{}}:s.mode===`apiKey`?{mode:`apiKey`}:{mode:`none`},u=e.localizations?.[t===`zh`?`zh-CN`:`en`];return{id:e.name,version:e.latestVersion??`store`,displayName:u?.displayName??(typeof r.displayName==`string`?r.displayName:e.name),description:u?.description??(typeof r.description==`string`?r.description:e.description),category:c,kind:`mcp`,source:`store`,...e.branding?.iconUrl?{branding:{logoUrl:e.branding.iconUrl,source:`registry`}}:{},capabilities:Array.isArray(r.capabilities)?r.capabilities.filter(e=>typeof e==`string`):[],tags:Array.isArray(r.tags)?r.tags.filter(e=>typeof e==`string`):[`store`],auth:l,setup:r.setup&&typeof r.setup==`object`&&!Array.isArray(r.setup)?r.setup:{},runtime:{type:`mcp`,serverId:o.serverId}}}function tr(e){return o(e.map(e=>({connector:e,service:{id:e.id,source:e.source===`builtin`?`builtin-connector`:e.source===`store`?`store-connector`:`registry-connector`}})),`en`).map(e=>e.connector)}function nr(e){return e?.startsWith(`/`)&&!e.startsWith(`//`)?e:`/user-model`}function rr({embedded:e=!1,onHeaderActionChange:t}){let n=me().filter(pn),r=oe(e=>e.language),o=ie(r),u=o.connectorsSettings,d=o.mcpSettings,f=ae(e=>e.conversationId),p=!!f,h=a(),[g,_]=i(),v=g.get(`understanding`)===`1`,C=nr(g.get(`returnTo`)),w=!!g.get(`returnTo`)&&!v,T=g.get(`tab`),[E,D]=(0,Q.useState)(!v&&T===`connected`?`connected`:`discover`),{data:O}=Y(p&&E===`discover`&&!v?[`service-recommendations`,r]:null,()=>s(r),{revalidateOnFocus:!1}),k=(0,Q.useMemo)(()=>new Set(O?.items.filter(e=>e.service?.source===`store-plugin`).map(e=>c(e.id))??[]),[O]),j=(0,Q.useRef)(!1),[M,N]=(0,Q.useState)({catalog:[],registryCatalog:[],instances:[],loading:!0,error:null}),[P,F]=(0,Q.useState)(!1),[I,z]=(0,Q.useState)(!1),[B,V]=(0,Q.useState)(1),[H,ee]=(0,Q.useState)(void 0),[U,te]=(0,Q.useState)(``),[W,ne]=(0,Q.useState)(v||w?g.get(`connector`)??``:``),[G,re]=(0,Q.useState)($n(v?`understanding`:`default`,r)),[q,J]=(0,Q.useState)(`name`),[se,ce]=(0,Q.useState)(v?`understand`:`all`),[le,Z]=(0,Q.useState)(null),[ue,de]=(0,Q.useState)(null),[fe,pe]=(0,Q.useState)(null),[he,ge]=(0,Q.useState)(null),[_e,ye]=(0,Q.useState)(null),[be,xe]=(0,Q.useState)(null),{data:Se,mutate:Ce}=ve(p),we=Se?.payload?.config,Te=(0,Q.useMemo)(()=>we===void 0?null:Kt(we),[we]),Ee=Te?.servers??[],De=M.instances.length+Ee.length+n.length,[Oe,ke]=(0,Q.useState)({});(0,Q.useEffect)(()=>{if(ke({}),!p||!we)return;let e=new AbortController;return an(e.signal).then(t=>{e.signal.aborted||ke(t)}).catch(()=>{}),()=>e.abort()},[p,we]);let Ae=(0,Q.useCallback)(async()=>{if(!f){N({catalog:[],registryCatalog:[],instances:[],loading:!1,error:null});return}N(e=>({...e,loading:!0,error:null}));try{let[e,t]=await Promise.all([Pe(),je()]);N(n=>({catalog:e,registryCatalog:n.registryCatalog,instances:t,loading:!1,error:null}))}catch(e){N({catalog:[],registryCatalog:[],instances:[],loading:!1,error:e instanceof Error?e.message:String(e)})}},[f]);(0,Q.useEffect)(()=>{Ae()},[Ae]),(0,Q.useEffect)(()=>{j.current||M.loading||p&&!Te||(D(v?`discover`:De>0?`connected`:`discover`),j.current=!0)},[p,De,Te,v,M.loading]),(0,Q.useEffect)(()=>{re(e=>e===`builtin`||e===`recommended`?$n(v?`understanding`:`default`,r):e)},[r,v]);let Me=(0,Q.useCallback)(e=>{j.current=!0,D(e)},[]),Ne=(0,Q.useMemo)(()=>[{id:Zn,displayName:u.composioSourceName},{id:Qn,displayName:u.storeSourceName}],[u.composioSourceName,u.storeSourceName]),Fe=(0,Q.useCallback)(async e=>{if(!p||G===`builtin`||G===`recommended`){N(e=>({...e,registryCatalog:[]})),V(1),ee(void 0);return}let t=W.trim(),n=Math.max(e?.page??1,1),i=e?.append??!1,a=G===`all`?Ne:Ne.filter(e=>e.id===G);if(a.length!==0){F(!0),i?N(e=>({...e,error:null})):(V(1),ee(void 0),N(e=>({...e,registryCatalog:[],error:null})));try{let e=await Promise.all(a.map(async e=>{if(e.id===`composio`){let e=await Ve({q:t||void 0,page:n,pageSize:24,verification:`experimental`});return{connectors:e.connectors,totalPages:e.meta.totalPages}}let i=await ze({q:t||void 0,page:n,pageSize:24,sort:q===`source`?`newest`:`downloads`});return{connectors:i.items.flatMap(e=>{let t=er(e,r);return t?[t]:[]}),totalPages:i.meta.totalPages}})),o=tr(e.flatMap(e=>e.connectors)),s=Math.max(1,...e.map(e=>e.totalPages??1));V(n),ee(s),N(e=>({...e,registryCatalog:i?tr([...e.registryCatalog,...o]):o}))}catch(e){N(t=>({...t,error:e instanceof Error?e.message:String(e)}))}finally{F(!1)}}},[q,W,G,p,Ne,r]);(0,Q.useEffect)(()=>{if(E!==`discover`||M.loading)return;if(G===`builtin`||G===`recommended`){N(e=>({...e,registryCatalog:[]})),V(1),ee(void 0);return}let e=window.setTimeout(()=>{Fe()},W.trim()?350:0);return()=>window.clearTimeout(e)},[W,G,Fe,M.loading,E]);let Ie=(0,Q.useMemo)(()=>new Set(M.instances.map(e=>e.connectorId)),[M.instances]),Le=(0,Q.useMemo)(()=>new Map([...M.catalog,...M.registryCatalog].map(e=>[e.id,e])),[M.catalog,M.registryCatalog]);(0,Q.useEffect)(()=>{if(M.loading)return;let e=g.get(`connector`),t=g.get(`instance`);if(!e&&!t)return;let n=M.instances.find(n=>t?n.instanceId===t:n.connectorId===e);if(n)j.current=!0,te(``),pe(n.instanceId),ge(n),D(`connected`);else if(e){let t=Le.get(e);if(!t)return;j.current=!0,re($n(v?`understanding`:`default`,r)),ne(``),de(t),D(`discover`)}let i=new URLSearchParams(g);i.delete(`connector`),i.delete(`instance`),i.set(`tab`,n?`connected`:`discover`),_(i,{replace:!0})},[Le,v,r,g,_,M.instances,M.loading]);let Re=(0,Q.useCallback)(async e=>{z(!0),N(e=>({...e,error:null}));try{let t=await He(e);Z(L(t.definition,{packageName:t.packageName,version:t.version,reviewHash:t.reviewHash,permissions:t.permissions}))}catch(e){N(t=>({...t,error:e instanceof Error?e.message:String(e)}))}finally{z(!1)}},[]);(0,Q.useEffect)(()=>{let e=g.get(`storeConnector`);if(!p||!e)return;let t=new URLSearchParams(g);t.delete(`storeConnector`),_(t,{replace:!0}),Re(e)},[p,g,_,Re]);let Be=(0,Q.useMemo)(()=>new Set(M.instances.flatMap(e=>e.materialized.type===`mcp`?[e.materialized.serverId]:[])),[M.instances]),Ue=(0,Q.useCallback)(async e=>{let t=await on(e);await Ce(),await Ae(),t.reloadRequired&&N(e=>({...e,error:d.setupReloadRequired}))},[Ae,Ce,d.setupReloadRequired]),We=(0,Q.useCallback)(()=>{xe({mode:`add`,row:jn(Ee,Be)})},[Ee,Be]),Ge=Qe(e=>e.setPageHeader),Ke=Qe(e=>e.clearPageHeader),qe=(0,Q.useMemo)(()=>({searchLabel:E===`connected`?u.connectedSearchPlaceholder:u.discoverSearchPlaceholder,search:(0,$.jsx)(ct,{value:E===`connected`?U:W,onChange:E===`connected`?te:ne,placeholder:E===`connected`?u.connectedSearchPlaceholder:u.discoverSearchPlaceholder}),secondary:(0,$.jsx)(jt,{onRefresh:E===`connected`&&p?Ae:void 0,refreshing:M.loading,refreshLabel:u.refreshConnections,onBrowseCatalog:()=>Me(`discover`),onAddCustomServer:We,addLabel:u.addConnection,browseLabel:u.addFromCatalog,customLabel:u.addCustomServerAdvanced,serviceLabel:r.startsWith(`zh`)?`应用连接服务`:`Connection service`,moreActionsLabel:o.capabilitiesHub.moreActions})}),[U,u,W,p,r,Ae,o.capabilitiesHub.moreActions,We,Me,M.loading,E]);(0,Q.useLayoutEffect)(()=>e?(t?.(qe),()=>t?.(null)):(Ge({startExtra:null,main:(0,$.jsx)(`div`,{className:`min-w-0`,children:(0,$.jsx)(`h1`,{className:`truncate text-base font-semibold tracking-tight text-fg`,children:u.title})}),end:(0,$.jsx)(lt,{contribution:qe})}),()=>Ke()),[Ke,u.title,e,qe,t,Ge]);let Je=(0,Q.useMemo)(()=>M.instances.map(e=>({instance:e,value:Ct(e,Le.get(e.connectorId))})),[Le,M.instances]),Ye=(0,Q.useMemo)(()=>new Map(Je.map(({instance:e,value:t})=>[e.instanceId,t])),[Je]),Xe=(0,Q.useMemo)(()=>M.instances.filter(e=>x(e,U)).sort((e,t)=>{let n={needs_setup:0,checking:1,ready:2},r=Ye.get(e.instanceId)?.state??`checking`,i=Ye.get(t.instanceId)?.state??`checking`;return n[r]-n[i]||e.displayName.localeCompare(t.displayName)}),[U,Ye,M.instances]),et=(0,Q.useMemo)(()=>Xe.filter(e=>Ye.get(e.instanceId)?.state===`needs_setup`),[Ye,Xe]),tt=(0,Q.useMemo)(()=>Xe.filter(e=>Ye.get(e.instanceId)?.state!==`needs_setup`),[Ye,Xe]),nt=(0,Q.useMemo)(()=>Ee.filter(e=>S(e,U)),[U,Ee]),rt=(0,Q.useMemo)(()=>{let e=U.trim().toLowerCase();return n.filter(t=>[t.name,t.description,...(t.setup?.authorizations??[]).map(e=>e.title),...(t.components?.mcp??[]).map(e=>e.name)].filter(Boolean).join(` `).toLowerCase().includes(e))},[U,n]),it=Xe.length+nt.length+rt.length,at=(0,Q.useMemo)(()=>M.catalog.filter(e=>e.source===`builtin`&&e.integrationStrategy?.preferred!==!1&&y(e)),[M.catalog]),st=(0,Q.useMemo)(()=>G===`recommended`?[]:G===`builtin`?at:G===`all`?tr([...at,...M.registryCatalog]):M.registryCatalog,[at,G,M.registryCatalog]),ut=(0,Q.useMemo)(()=>{let e=v?st.filter(e=>e.understanding?.mode===`activity`):tr(st).filter(e=>!k.has(c(e.id)));return b(se===`all`?e:e.filter(e=>xt(e).includes(se)),W,q)},[q,W,st,v,se,k]),dt=(0,Q.useMemo)(()=>bt.filter(e=>st.some(t=>xt(t).includes(e))),[st]);(0,Q.useEffect)(()=>{se!==`all`&&!dt.includes(se)&&ce(`all`)},[dt,se]);let ft=E===`discover`&&G!==`builtin`&&!!(H&&B<H),mt=(0,Q.useMemo)(()=>M.instances.find(e=>e.instanceId===fe)??he,[fe,he,M.instances]),_t=(0,Q.useMemo)(()=>[{value:Yn,label:r===`zh`?`推荐服务`:`Recommended services`},{value:`all`,label:u.discoverSourceAll},{value:Xn,label:u.discoverSourceBuiltin},...Ne.map(e=>({value:e.id,label:e.displayName}))],[u.discoverSourceAll,u.discoverSourceBuiltin,Ne,r]),St=[{id:`connected`,label:u.tabConnected,count:De},{id:`discover`,label:u.tabDiscover}];return(0,$.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col bg-surface-panel`,children:(0,$.jsxs)(`div`,{className:K(`mx-auto flex w-full max-w-7xl flex-col gap-6 px-4 sm:px-6 lg:px-8`,e?`pb-7 pt-3 lg:pb-9 lg:pt-4`:`py-7 lg:py-9`),children:[p?null:(0,$.jsx)(`p`,{className:`rounded-xl border border-edge bg-surface-panel px-4 py-3 text-sm text-fg-muted`,children:u.tokenHint}),v?(0,$.jsxs)(`div`,{className:`flex flex-col gap-3 rounded-xl border border-accent/25 bg-accent-soft px-4 py-3 sm:flex-row sm:items-center sm:justify-between`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`p`,{className:`text-sm font-semibold text-fg`,children:u.understandingSetupTitle}),(0,$.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:u.understandingSetupHint})]}),(0,$.jsx)(X,{type:`button`,variant:`secondary`,className:`shrink-0`,onClick:()=>h(C),children:u.understandingSetupDone})]}):null,w?(0,$.jsxs)(`div`,{className:`flex flex-col gap-3 rounded-xl border border-accent/25 bg-accent-soft px-4 py-3 sm:flex-row sm:items-center sm:justify-between`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`p`,{className:`text-sm font-semibold text-fg`,children:u.recoverySetupTitle}),(0,$.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:u.recoverySetupHint})]}),(0,$.jsx)(X,{type:`button`,variant:`secondary`,className:`min-h-11 shrink-0`,onClick:()=>h(C),children:u.recoverySetupDone})]}):null,(0,$.jsxs)(`section`,{className:`flex flex-col gap-4`,children:[(0,$.jsx)(`div`,{className:`border-b border-edge-subtle pb-3 dark:border-edge-subtle`,children:(0,$.jsx)(Ze,{items:St,activeTab:E,onChange:Me,ariaLabel:u.navAria,tabIdPrefix:`connectors-tab`,panelIdPrefix:`connectors-panel`,className:`flex-wrap`})}),M.error?(0,$.jsx)(`p`,{className:`rounded-xl bg-red-500/10 px-3 py-2 text-sm text-red-600`,children:M.error}):null,E===`connected`&&p?(0,$.jsx)(`div`,{className:`flex flex-col gap-6`,children:M.loading?(0,$.jsx)(`div`,{className:`grid gap-4 sm:grid-cols-2 xl:grid-cols-3`,"aria-busy":`true`,"aria-label":u.loading,children:ht.slice(0,3).map(e=>(0,$.jsx)(yt,{},e))}):De===0?(0,$.jsxs)(`div`,{className:`py-14 text-center`,children:[(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:u.connectionsEmpty}),(0,$.jsx)(X,{type:`button`,variant:`primary`,className:`mt-4`,onClick:()=>Me(`discover`),children:u.addFromCatalog})]}):it===0?(0,$.jsx)(`div`,{className:`py-14 text-center text-sm text-fg-muted`,children:u.connectionsSearchEmpty}):(0,$.jsxs)(`div`,{className:`space-y-6`,children:[et.length?(0,$.jsxs)(`section`,{children:[(0,$.jsxs)(`div`,{className:`mb-2 flex items-center gap-2`,children:[(0,$.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:u.needsAttentionTitle}),(0,$.jsx)(`span`,{className:`text-xs tabular-nums text-amber-700 dark:text-amber-300`,children:et.length})]}),(0,$.jsx)(`div`,{className:`grid gap-4 sm:grid-cols-2 xl:grid-cols-3`,children:et.map(e=>(0,$.jsx)(An,{instance:e,definition:Le.get(e.connectorId),highlighted:e.instanceId===_e,onOpenDetails:e=>{ye(null),pe(e.instanceId),ge(e)},t:u},e.instanceId))})]}):null,tt.length||rt.length?(0,$.jsx)(`section`,{children:(0,$.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2 xl:grid-cols-3`,children:[tt.map(e=>(0,$.jsx)(An,{instance:e,definition:Le.get(e.connectorId),highlighted:e.instanceId===_e,onOpenDetails:e=>{ye(null),pe(e.instanceId),ge(e)},t:u},e.instanceId)),rt.map(e=>(0,$.jsx)(mn,{extension:e,language:r,onOpen:()=>h(ot(e.pluginId,`connections`,e.authorizationStatus===`required`))},e.id))]})}):null,nt.length||!U.trim()?(0,$.jsx)(fn,{servers:nt,lastChecks:Oe,t:d,cs:u,onAdd:We,onEdit:e=>xe({mode:`edit`,row:structuredClone(e)}),onRemove:Ue}):null]})}):null,E===`discover`&&p?(0,$.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[v?null:(0,$.jsx)($e,{className:`flex min-w-0 flex-1 basis-80 flex-wrap gap-2`,role:`group`,"aria-label":u.taskFilterAria,indicatorClassName:`rounded-lg bg-surface-active`,children:[`all`,...dt].map(e=>(0,$.jsx)(`button`,{type:`button`,className:K(`rounded-full border px-3 py-1.5 text-xs font-medium transition-colors`,se===e?`border-accent/40 bg-accent-soft text-accent-fg`:`border-edge bg-surface-panel text-fg-muted hover:bg-surface-hover hover:text-fg`),"aria-pressed":se===e,onClick:()=>ce(e),children:e===`all`?u.taskAll:u.connectorBenefitHeadings[e]},e))}),(0,$.jsxs)(`div`,{className:K(`ml-auto grid w-full gap-2 sm:flex sm:w-auto sm:justify-end`,v?`grid-cols-1`:`grid-cols-2`),children:[v?null:(0,$.jsx)(`div`,{className:`min-w-0 sm:w-40`,children:(0,$.jsx)(m,{value:G,options:_t,placeholder:u.discoverSourceAll,allowEmpty:!1,ariaLabel:u.registrySourceAria,triggerClassName:`h-9 bg-surface-panel text-xs`,onChange:re})}),G===`recommended`?null:(0,$.jsx)(`div`,{className:`min-w-0 sm:w-40`,children:(0,$.jsx)(m,{value:q,options:[{value:`name`,label:u.sortName},{value:`source`,label:u.sortSource}],placeholder:u.sortName,allowEmpty:!1,ariaLabel:u.sortAria,triggerClassName:`h-9 bg-surface-panel text-xs`,onChange:e=>J(e)})})]})]}),G===`recommended`?(0,$.jsx)(l,{layout:`cards`,initialCount:6,query:W,onChanged:async()=>{await Ae(),await Ce()}}):(M.loading||P)&&ut.length===0?(0,$.jsx)(`div`,{className:`grid gap-4 sm:grid-cols-2 xl:grid-cols-3`,"aria-busy":`true`,"aria-label":u.loading,children:ht.map(e=>(0,$.jsx)(vt,{},e))}):ut.length===0?(0,$.jsx)(`div`,{className:`py-14 text-center text-sm text-fg-muted`,children:u.discoverEmpty}):(0,$.jsxs)(`div`,{className:`relative`,children:[P?(0,$.jsx)(`div`,{className:`pointer-events-none absolute inset-0 z-[1] flex justify-center bg-surface-panel/40 pt-[min(28vh,7.5rem)] backdrop-blur-[1px] motion-reduce:backdrop-blur-none dark:bg-surface-base/35`,"aria-busy":`true`,"aria-label":u.loading,children:(0,$.jsx)(A,{className:`size-8 shrink-0 animate-spin text-accent motion-reduce:animate-none`,strokeWidth:2,"aria-hidden":!0})}):null,(0,$.jsx)(`div`,{className:`grid gap-4 sm:grid-cols-2 xl:grid-cols-3`,children:ut.map(e=>(0,$.jsx)(pt,{connector:e,installed:Ie.has(e.id)||gt(e,M.instances),onInstall:e=>{if(e.source===`store`){Re(e.id);return}Z(L(e))},onOpenDetails:e.source===`store`?void 0:de,t:u},e.id))}),ft?(0,$.jsx)(`div`,{className:`mt-4 flex justify-center`,children:(0,$.jsxs)(X,{type:`button`,variant:`secondary`,disabled:P||I,onClick:()=>void Fe({page:B+1,append:!0}),children:[P?(0,$.jsx)(A,{className:`size-4 animate-spin`}):null,u.loadMore]})}):null]})]}):null]}),le?(0,$.jsx)(R,{draft:le,onChange:Z,onClose:()=>Z(null),t:u,onInstalled:async e=>{await Ae(),await Ce(),ye(e.instanceId),Me(`connected`)}}):null,ue?(0,$.jsx)(Dt,{connector:ue,installed:Ie.has(ue.id)||gt(ue,M.instances),onClose:()=>de(null),onInstall:e=>Z(L(e)),t:u}):null,mt?(0,$.jsx)(kn,{instance:mt,definition:Le.get(mt.connectorId),onClose:()=>{pe(null),ge(null)},onChanged:Ae,t:u,mcp:d}):null,be?(0,$.jsx)(Jn,{open:!0,mode:be.mode,initialRow:be.row,lastCheck:be.mode===`edit`?Oe[be.row.id]:void 0,existingCustomServers:Ee,config:we,managedServerIds:Be,t:d,cs:u,onClose:()=>xe(null),onSaved:async()=>{await Ce(),await Ae(),Me(`connected`)}},`${be.mode}-${be.row.clientKey}`):null]})})}export{rr as ConnectorsPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,c as t,d as n,i as r,m as i,n as a,u as o}from"./schemas-CCWMleym.js";var s=i().min(1).max(120),c=n({id:s,toolCallId:i().min(1),toolName:i().min(1),excerpt:i().min(1).max(2e3),url:i().url().optional(),snapshotHash:i().regex(/^[a-f0-9]{64}$/),observedAt:o().int().nonnegative()}),l=n({id:s,statement:i().min(1).max(2e3),kind:a([`fact`,`inference`,`recommendation`]),sourceIds:r(s).min(1).max(8),support:a([`supported`,`unsupported`,`uncertain`,`unreviewed`]),note:i().max(1e3).optional()}),u=n({criterionIndex:o().int().nonnegative(),criterion:i().min(1),status:a([`passed`,`failed`,`unverified`]),claimIds:r(s).max(40),note:i().min(1).max(1e3)}),d=n({version:t(1),contractVersion:o().int().positive(),instructionSequence:o().int().nonnegative(),sources:r(c).max(40),claims:r(l).min(1).max(40),checks:r(u).max(40),review:a([`model_reviewed`,`unavailable`]),finalArtifactIds:r(i().min(1)).max(50).optional(),inspectedArtifactIds:r(i().min(1)).max(50).optional(),instructionChecks:r(n({sequence:o().int().positive(),instruction:i().min(1),status:a([`passed`,`failed`,`unverified`]),claimIds:r(s).max(40),note:i().min(1).max(1e3)})).max(40).optional()}).superRefine((e,t)=>{let n=(e,n)=>{new Set(e).size!==e.length&&t.addIssue({code:`custom`,message:`Duplicate ${n}`})};n(e.sources.map(e=>e.id),`source IDs`),n(e.claims.map(e=>e.id),`claim IDs`),n(e.checks.map(e=>e.criterionIndex),`criterion indices`),n((e.instructionChecks??[]).map(e=>e.sequence),`instruction sequences`);let r=new Set(e.sources.map(e=>e.id)),i=new Set(e.claims.map(e=>e.id));for(let n of e.claims)n.sourceIds.some(e=>!r.has(e))&&t.addIssue({code:`custom`,message:`Unknown claim source`});for(let n of[...e.checks,...e.instructionChecks??[]])n.claimIds.some(e=>!i.has(e))&&t.addIssue({code:`custom`,message:`Unknown criterion claim`})}),f=a([`document`,`spreadsheet`,`presentation`,`pdf`,`image`,`video`,`audio`,`site`,`archive`,`file`]),p=a([`workspace`,`external_host`,`worktree`,`remote_runtime`,`artifact_store`]),m=a([`materializing`,`available`,`expired`,`missing`,`failed`]),h=a([`preview`,`download`,`open`,`import`,`share`,`regenerate`]),g=n({artifactId:i().min(1),sourceFileId:i().min(1).optional(),title:i().min(1),kind:f,mimeType:i().optional(),sha256:i().regex(/^[a-f0-9]{64}$/).optional(),sizeBytes:o().nonnegative().optional(),availability:m,location:p,capabilities:r(h),uri:i().optional(),workspaceRelativePath:i().optional(),shareUrl:i().url().optional(),thumbnailUrl:i().optional(),expiresAt:i().optional()}),_=n({path:i().min(1),status:a([`added`,`modified`,`deleted`,`renamed`]).optional(),added:o().nonnegative().optional(),removed:o().nonnegative().optional()}),v=n({changeSetId:i().min(1),files:r(_),added:o().nonnegative(),removed:o().nonnegative(),diff:i(),diffTruncated:e().optional(),environment:a([`workspace`,`worktree`,`remote_runtime`])}),y=n({evidenceId:i().min(1),kind:a([`check`,`screenshot`,`video`,`log`]),label:i().min(1),status:a([`passed`,`failed`,`warning`]),durationMs:o().nonnegative().optional(),command:i().optional(),artifactId:i().optional(),revision:i().optional(),logPath:i().optional()}),b=n({version:t(1),outcomeId:i().min(1),runId:i().min(1),turnId:i().min(1),status:a([`succeeded`,`partial`,`failed`]),summary:i().optional(),deliverables:r(g),changeSet:v.optional(),evidence:r(y),research:d.optional(),createdAt:i()}),x=`xopc-file:`;function S(e){if(!e.startsWith(x))return null;try{return decodeURIComponent(e.slice(10)).trim()||null}catch{return null}}function C(e){let t=new Map(e.map(e=>[e.artifactId,e])),n=new Map,r=e=>e.availability===`available`?e.location===`artifact_store`?2:1:0;for(let e of t.values()){let t=e.sourceFileId??S(e.uri??``),i=t?`source:${t}`:`artifact:${e.artifactId}`,a=n.get(i);(!a||r(e)>=r(a))&&n.set(i,e)}return[...n.values()]}function w(e){let t=b.safeParse(e);return t.success?{...t.data,deliverables:C(t.data.deliverables)}:null}var T=32*1024*1024;export{w as i,b as n,S as r,T as t};
|